@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.
- package/package.json +1 -1
- package/public/assets/index-Ca6N-CJM.js +1215 -0
- package/public/assets/index-Ca6N-CJM.js.map +1 -0
- package/public/assets/{index-D7O0bp8_.css → index-DrVVVhsP.css} +1 -1
- package/public/index.html +2 -2
- package/public/assets/index-BT7N7LrC.js +0 -1025
- package/public/assets/index-BT7N7LrC.js.map +0 -1
|
@@ -1,1025 +0,0 @@
|
|
|
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 n of a)if(n.type==="childList")for(const r of n.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function s(a){const n={};return a.integrity&&(n.integrity=a.integrity),a.referrerPolicy&&(n.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?n.credentials="include":a.crossOrigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function i(a){if(a.ep)return;a.ep=!0;const n=s(a);fetch(a.href,n)}})();const B=globalThis,G=B.ShadowRoot&&(B.ShadyCSS===void 0||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pt=Symbol(),it=new WeakMap;let Rt=class{constructor(e,s,i){if(this._$cssResult$=!0,i!==pt)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(G&&e===void 0){const i=s!==void 0&&s.length===1;i&&(e=it.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&it.set(s,e))}return e}toString(){return this.cssText}};const Ht=t=>new Rt(typeof t=="string"?t:t+"",void 0,pt),Pt=(t,e)=>{if(G)t.adoptedStyleSheets=e.map(s=>s instanceof CSSStyleSheet?s:s.styleSheet);else for(const s of e){const i=document.createElement("style"),a=B.litNonce;a!==void 0&&i.setAttribute("nonce",a),i.textContent=s.cssText,t.appendChild(i)}},at=G?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const i of e.cssRules)s+=i.cssText;return Ht(s)})(t):t;const{is:Ot,defineProperty:Bt,getOwnPropertyDescriptor:jt,getOwnPropertyNames:Ut,getOwnPropertySymbols:Nt,getPrototypeOf:It}=Object,J=globalThis,ot=J.trustedTypes,Jt=ot?ot.emptyScript:"",zt=J.reactiveElementPolyfillSupport,M=(t,e)=>t,U={toAttribute(t,e){switch(e){case Boolean:t=t?Jt: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}},K=(t,e)=>!Ot(t,e),nt={attribute:!0,type:String,converter:U,reflect:!1,useDefault:!1,hasChanged:K};Symbol.metadata??=Symbol("metadata"),J.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=nt){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&&Bt(this.prototype,e,a)}}static getPropertyDescriptor(e,s,i){const{get:a,set:n}=jt(this.prototype,e)??{get(){return this[s]},set(r){this[s]=r}};return{get:a,set(r){const v=a?.call(this);n?.call(this,r),this.requestUpdate(e,v,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??nt}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const e=It(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(M("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(M("properties"))){const s=this.properties,i=[...Ut(s),...Nt(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(at(a))}else e!==void 0&&s.push(at(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 Pt(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 n=(i.converter?.toAttribute!==void 0?i.converter:U).toAttribute(s,i.type);this._$Em=e,n==null?this.removeAttribute(a):this.setAttribute(a,n),this._$Em=null}}_$AK(e,s){const i=this.constructor,a=i._$Eh.get(e);if(a!==void 0&&this._$Em!==a){const n=i.getPropertyOptions(a),r=typeof n.converter=="function"?{fromAttribute:n.converter}:n.converter?.fromAttribute!==void 0?n.converter:U;this._$Em=a;const v=r.fromAttribute(s,n.type);this[a]=v??this._$Ej?.get(a)??v,this._$Em=null}}requestUpdate(e,s,i,a=!1,n){if(e!==void 0){const r=this.constructor;if(a===!1&&(n=this[e]),i??=r.getPropertyOptions(e),!((i.hasChanged??K)(n,s)||i.useDefault&&i.reflect&&n===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:n},r){i&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,r??s??this[e]),n!==!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,n]of this._$Ep)this[a]=n;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[a,n]of i){const{wrapped:r}=n,v=this[a];r!==!0||this._$AL.has(a)||v===void 0||this.C(a,void 0,n,v)}}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[M("elementProperties")]=new Map,A[M("finalized")]=new Map,zt?.({ReactiveElement:A}),(J.reactiveElementVersions??=[]).push("2.1.2");const Q=globalThis,rt=t=>t,N=Q.trustedTypes,ct=N?N.createPolicy("lit-html",{createHTML:t=>t}):void 0,gt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,yt="?"+b,Vt=`<${yt}>`,k=document,F=()=>k.createComment(""),D=t=>t===null||typeof t!="object"&&typeof t!="function",Y=Array.isArray,Wt=t=>Y(t)||typeof t?.[Symbol.iterator]=="function",W=`[
|
|
2
|
-
\f\r]`,E=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,lt=/-->/g,dt=/>/g,w=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
3
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),ht=/'/g,ut=/"/g,mt=/^(?:script|style|textarea|title)$/i,qt=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),o=qt(1),C=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),vt=new WeakMap,x=k.createTreeWalker(k,129);function ft(t,e){if(!Y(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ct!==void 0?ct.createHTML(e):e}const Zt=(t,e)=>{const s=t.length-1,i=[];let a,n=e===2?"<svg>":e===3?"<math>":"",r=E;for(let v=0;v<s;v++){const u=t[v];let y,m,p=-1,f=0;for(;f<u.length&&(r.lastIndex=f,m=r.exec(u),m!==null);)f=r.lastIndex,r===E?m[1]==="!--"?r=lt:m[1]!==void 0?r=dt:m[2]!==void 0?(mt.test(m[2])&&(a=RegExp("</"+m[2],"g")),r=w):m[3]!==void 0&&(r=w):r===w?m[0]===">"?(r=a??E,p=-1):m[1]===void 0?p=-2:(p=r.lastIndex-m[2].length,y=m[1],r=m[3]===void 0?w:m[3]==='"'?ut:ht):r===ut||r===ht?r=w:r===lt||r===dt?r=E:(r=w,a=void 0);const $=r===w&&t[v+1].startsWith("/>")?" ":"";n+=r===E?u+Vt:p>=0?(i.push(y),u.slice(0,p)+gt+u.slice(p)+b+$):u+b+(p===-2?v:$)}return[ft(t,n+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class R{constructor({strings:e,_$litType$:s},i){let a;this.parts=[];let n=0,r=0;const v=e.length-1,u=this.parts,[y,m]=Zt(e,s);if(this.el=R.createElement(y,i),x.currentNode=this.el.content,s===2||s===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(a=x.nextNode())!==null&&u.length<v;){if(a.nodeType===1){if(a.hasAttributes())for(const p of a.getAttributeNames())if(p.endsWith(gt)){const f=m[r++],$=a.getAttribute(p).split(b),P=/([.?@])?(.*)/.exec(f);u.push({type:1,index:n,name:P[2],strings:$,ctor:P[1]==="."?Kt:P[1]==="?"?Qt:P[1]==="@"?Yt:z}),a.removeAttribute(p)}else p.startsWith(b)&&(u.push({type:6,index:n}),a.removeAttribute(p));if(mt.test(a.tagName)){const p=a.textContent.split(b),f=p.length-1;if(f>0){a.textContent=N?N.emptyScript:"";for(let $=0;$<f;$++)a.append(p[$],F()),x.nextNode(),u.push({type:2,index:++n});a.append(p[f],F())}}}else if(a.nodeType===8)if(a.data===yt)u.push({type:2,index:n});else{let p=-1;for(;(p=a.data.indexOf(b,p+1))!==-1;)u.push({type:7,index:n}),p+=b.length-1}n++}}static createElement(e,s){const i=k.createElement("template");return i.innerHTML=e,i}}function L(t,e,s=t,i){if(e===C)return e;let a=i!==void 0?s._$Co?.[i]:s._$Cl;const n=D(e)?void 0:e._$litDirective$;return a?.constructor!==n&&(a?._$AO?.(!1),n===void 0?a=void 0:(a=new n(t),a._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=a:s._$Cl=a),a!==void 0&&(e=L(t,a._$AS(t,e.values),a,i)),e}class Gt{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??k).importNode(s,!0);x.currentNode=a;let n=x.nextNode(),r=0,v=0,u=i[0];for(;u!==void 0;){if(r===u.index){let y;u.type===2?y=new H(n,n.nextSibling,this,e):u.type===1?y=new u.ctor(n,u.name,u.strings,this,e):u.type===6&&(y=new Xt(n,this,e)),this._$AV.push(y),u=i[++v]}r!==u?.index&&(n=x.nextNode(),r++)}return x.currentNode=k,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 H{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,i,a){this.type=2,this._$AH=h,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=L(this,e,s),D(e)?e===h||e==null||e===""?(this._$AH!==h&&this._$AR(),this._$AH=h):e!==this._$AH&&e!==C&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Wt(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!==h&&D(this._$AH)?this._$AA.nextSibling.data=e:this.T(k.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=R.createElement(ft(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===a)this._$AH.p(s);else{const n=new Gt(a,this),r=n.u(this.options);n.p(s),this.T(r),this._$AH=n}}_$AC(e){let s=vt.get(e.strings);return s===void 0&&vt.set(e.strings,s=new R(e)),s}k(e){Y(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,a=0;for(const n of e)a===s.length?s.push(i=new H(this.O(F()),this.O(F()),this,this.options)):i=s[a],i._$AI(n),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=rt(e).nextSibling;rt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class z{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,i,a,n){this.type=1,this._$AH=h,this._$AN=void 0,this.element=e,this.name=s,this._$AM=a,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=h}_$AI(e,s=this,i,a){const n=this.strings;let r=!1;if(n===void 0)e=L(this,e,s,0),r=!D(e)||e!==this._$AH&&e!==C,r&&(this._$AH=e);else{const v=e;let u,y;for(e=n[0],u=0;u<n.length-1;u++)y=L(this,v[i+u],s,u),y===C&&(y=this._$AH[u]),r||=!D(y)||y!==this._$AH[u],y===h?e=h:e!==h&&(e+=(y??"")+n[u+1]),this._$AH[u]=y}r&&!a&&this.j(e)}j(e){e===h?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Kt extends z{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===h?void 0:e}}class Qt extends z{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==h)}}class Yt extends z{constructor(e,s,i,a,n){super(e,s,i,a,n),this.type=5}_$AI(e,s=this){if((e=L(this,e,s,0)??h)===C)return;const i=this._$AH,a=e===h&&i!==h||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==h&&(i===h||a);a&&this.element.removeEventListener(this.name,this,i),n&&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 Xt{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){L(this,e)}}const te=Q.litHtmlPolyfillSupport;te?.(R,H),(Q.litHtmlVersions??=[]).push("3.3.2");const ee=(t,e,s)=>{const i=s?.renderBefore??e;let a=i._$litPart$;if(a===void 0){const n=s?.renderBefore??null;i._$litPart$=a=new H(e.insertBefore(F(),n),n,void 0,s??{})}return a._$AI(t),a};const X=globalThis;class T 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=ee(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return C}}T._$litElement$=!0,T.finalized=!0,X.litElementHydrateSupport?.({LitElement:T});const se=X.litElementPolyfillSupport;se?.({LitElement:T});(X.litElementVersions??=[]).push("4.2.2");const ie=t=>(e,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};const ae={attribute:!0,type:String,converter:U,reflect:!1,hasChanged:K},oe=(t=ae,e,s)=>{const{kind:i,metadata:a}=s;let n=globalThis.litPropertyMetadata.get(a);if(n===void 0&&globalThis.litPropertyMetadata.set(a,n=new Map),i==="setter"&&((t=Object.create(t)).wrapped=!0),n.set(s.name,t),i==="accessor"){const{name:r}=s;return{set(v){const u=e.get.call(this);e.set.call(this,v),this.requestUpdate(r,u,t,!0,v)},init(v){return v!==void 0&&this.C(r,void 0,t,v),v}}}if(i==="setter"){const{name:r}=s;return function(v){const u=this[r];e.call(this,v),this.requestUpdate(r,u,t,!0,v)}}throw Error("Unsupported decorator location: "+i)};function ne(t){return(e,s)=>typeof s=="object"?oe(t,e,s):((i,a,n)=>{const r=a.hasOwnProperty(n);return a.constructor.createProperty(n,i),r?Object.getOwnPropertyDescriptor(a,n):void 0})(t,e,s)}function d(t){return ne({...t,state:!0,attribute:!1})}const $t={name:"",instruction:"",scheduleType:"every",every:"30m",cronExpression:"",at:""},bt="costar.dashboard.settings.v1",S={theme:"system",chatShowThinking:!0,splitRatio:.6,navCollapsed:!1,navGroupsCollapsed:{}};function re(){try{const t=localStorage.getItem(bt);if(!t)return{...S};const e=JSON.parse(t);return{theme:e.theme==="light"||e.theme==="dark"||e.theme==="system"?e.theme:S.theme,chatShowThinking:typeof e.chatShowThinking=="boolean"?e.chatShowThinking:S.chatShowThinking,splitRatio:typeof e.splitRatio=="number"&&e.splitRatio>=.3&&e.splitRatio<=.8?e.splitRatio:S.splitRatio,navCollapsed:typeof e.navCollapsed=="boolean"?e.navCollapsed:S.navCollapsed,navGroupsCollapsed:typeof e.navGroupsCollapsed=="object"&&e.navGroupsCollapsed!==null?e.navGroupsCollapsed:S.navGroupsCollapsed}}catch{return{...S}}}function ce(t){try{localStorage.setItem(bt,JSON.stringify(t))}catch{}}const le=[{label:"main",tabs:["dashboard","chat"]},{label:"agent",tabs:["cron","activity","sessions"]},{label:"data",tabs:["assets","projects","workspace"]},{label:"system",tabs:["skills","logs","config"]}],q={dashboard:"/",chat:"/chat",cron:"/cron",activity:"/activity",sessions:"/sessions",assets:"/assets",projects:"/projects",workspace:"/workspace",skills:"/skills",logs:"/logs",config:"/config"},de={dashboard:"Dashboard",chat:"Chat",cron:"Cron Jobs",activity:"Activity",sessions:"Sessions",assets:"Assets",projects:"Projects",workspace:"Workspace",skills:"Skills",logs:"Logs",config:"Config"},he={dashboard:"home",chat:"messageSquare",cron:"clock",activity:"activity",sessions:"fileText",assets:"package",projects:"folder",workspace:"edit",skills:"zap",logs:"terminal",config:"settings"},ue={main:"Main",agent:"Agent",data:"Data",system:"System"};function ve(t){return q[t]}function wt(t){for(const[s,i]of Object.entries(q))if(t===i)return s;const e=t.replace(/\/$/,"")||"/";for(const[s,i]of Object.entries(q))if(e===i)return s;return null}function pe(t){return he[t]}function ge(t){return de[t]}function ye(t){return ue[t]||t}function me(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function St(t){return t==="system"?me():t}class fe{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[n,r]of Object.entries(s))r!==void 0&&r!==""&&a.searchParams.set(n,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 u=await fetch(this.url("/api/sessions"),{method:"POST",headers:{"Content-Type":"application/json"},signal:i.signal});if(!u.ok){s.onError?.(`Failed to create session: ${u.statusText}`);return}const y=await u.json();this._chatSessionId=y.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 n=a.body.getReader(),r=new TextDecoder;let v="";for(;;){const{done:u,value:y}=await n.read();if(u)break;v+=r.decode(y,{stream:!0});const m=v.split(`
|
|
4
|
-
`);v=m.pop()||"";let p="",f="";for(const $ of m)$.startsWith("event: ")?p=$.slice(7).trim():$.startsWith("data: ")?(f=$.slice(6),p&&f&&(this._handleSSEEvent(p,f,s),p="",f="")):$===""&&(p="",f="")}}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 g=new fe;async function $e(t){try{const[e,s]=await Promise.all([g.get("/api/status"),g.get("/api/version")]);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 xt(t){const[e,s,i,a,n]=await Promise.allSettled([g.get("/api/status"),g.get("/api/version"),g.get("/api/db/activity/stats"),g.get("/api/db/projects",{limit:"100"}),g.get("/api/db/activity",{limit:"5"})]);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(r=>r.is_active)||null),n.status==="fulfilled"&&(t.recentActivity=n.value)}async function V(t){t.cronLoading=!0;try{t.cronJobs=await g.get("/api/cron/jobs")}catch{t.cronJobs=[]}t.cronLoading=!1}async function be(t){t.cronLoading=!0;try{const e=t.cronForm;await g.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={...$t},await V(t)}catch(e){alert(`Failed to create job: ${e.message}`)}t.cronLoading=!1}async function we(t,e){try{await g.post(`/api/cron/jobs/${e}/run`)}catch(s){alert(`Failed to run job: ${s.message}`)}}async function Se(t,e){if(confirm("Delete this cron job?"))try{await g.del(`/api/cron/jobs/${e}`),await V(t)}catch(s){alert(`Failed to delete job: ${s.message}`)}}async function xe(t,e,s){t.cronHistoryJob=s,t.cronHistoryOpen=!0;try{t.cronHistory=await g.get("/api/cron/history",{jobId:e,limit:"50"})}catch{t.cronHistory=[]}}async function tt(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([g.get("/api/db/activity",e),g.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 ke(t){t.activityOffset+=50;try{const e={limit:"50",offset:String(t.activityOffset)};t.activityStatusFilter&&(e.status=t.activityStatusFilter);const s=await g.get("/api/db/activity",e);t.activityList=[...t.activityList,...s],t.activityHasMore=s.length>=50}catch{t.activityHasMore=!1}}async function _e(t){if(!t.activitySearch.trim()){await tt(t);return}t.activityLoading=!0;try{t.activityList=await g.get("/api/db/activity/search",{q:t.activitySearch,limit:"50"}),t.activityHasMore=!1}catch{t.activityList=[]}t.activityLoading=!1}async function kt(t){t.assetsLoading=!0;try{t.assetsList=await g.get("/api/db/assets",{limit:"100"})}catch{t.assetsList=[]}t.assetsLoading=!1}async function _t(t){t.projectsLoading=!0;try{t.projectsList=await g.get("/api/db/projects",{limit:"100"})}catch{t.projectsList=[]}t.projectsLoading=!1}async function At(t){t.sessionsLoading=!0;try{const e=await g.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 Ae(t,e){t.sessionDetailName=e;try{const s=await g.get(`/api/sessions/files/${encodeURIComponent(e)}/parsed`);t.sessionDetail=s.turns||s}catch{t.sessionDetail=[]}}async function Ct(t){t.workspaceLoading=!0;try{const e=await g.get("/api/workspace/files");t.workspaceFiles=e.files||[]}catch{t.workspaceFiles=[]}t.workspaceLoading=!1}async function Ce(t,e){t.workspaceEditingFile=e;try{const s=await g.get(`/api/workspace/files/${encodeURIComponent(e)}`);t.workspaceEditContent=s.content||""}catch{t.workspaceEditContent="(Failed to load file)"}}async function Le(t){t.workspaceSaving=!0;try{await g.put(`/api/workspace/files/${encodeURIComponent(t.workspaceEditingFile)}`,{content:t.workspaceEditContent})}catch(e){alert(`Failed to save: ${e.message}`)}t.workspaceSaving=!1}async function Lt(t){t.skillsLoading=!0;try{const e=await g.get("/api/skills");t.skillsList=Array.isArray(e)?e:e.skills||[]}catch{t.skillsList=[]}t.skillsLoading=!1}async function Et(t){t.configLoading=!0;try{t.configData=await g.get("/api/config")}catch{t.configData={}}t.configLoading=!1}async function Mt(t){t.envLoading=!0;try{t.envData=await g.get("/api/env")}catch{t.envData={}}t.envLoading=!1}async function Ee(t){t.updating=!0,t.updateResult="";try{const e=await g.post("/api/update");t.updateResult=e.stdout||e.message||"Update complete"}catch(e){t.updateResult=`Error: ${e.message}`}t.updating=!1}function Me(t,e){if(e===t.tab)return;t.tab=e;const s=ve(e);history.pushState(null,"",s),et(t)}function Te(t,e){t.theme=e,t.themeResolved=St(e),Tt(t.themeResolved),t.settings={...t.settings,theme:e},ce(t.settings)}function Fe(t){const e=wt(window.location.pathname);e&&e!==t.tab&&(t.tab=e,et(t))}async function et(t){switch(t.tab){case"dashboard":await xt(t);break;case"cron":await V(t);break;case"activity":await tt(t);break;case"assets":await kt(t);break;case"projects":await _t(t);break;case"sessions":await At(t);break;case"workspace":await Ct(t);break;case"skills":await Lt(t);break;case"config":await Et(t),await Mt(t);break}}function De(t){t.theme=t.settings.theme,t.themeResolved=St(t.theme),Tt(t.themeResolved);const e=wt(window.location.pathname);e&&(t.tab=e),$e(t),et(t)}function Re(t){t.logStream?.close(),t.logStream=null,t.popStateHandler&&(window.removeEventListener("popstate",t.popStateHandler),t.popStateHandler=null)}function Tt(t){document.documentElement.setAttribute("data-theme",t)}function He(t){return t.chatSending||t.chatLoading}async function Pe(t,e){const s=e||t.chatMessage.trim();if(!s||He(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=g.streamChat(s,{onDelta:a=>{t.chatStream=(t.chatStream||"")+a;const n=[...t.chatStreamFlow],r=n[n.length-1];r&&r.type==="text"?n[n.length-1]={type:"text",content:r.content+a}:n.push({type:"text",content:a}),t.chatStreamFlow=n},onToolStart:a=>{i++,t.chatButtonLabel=`Tool ${i}...`;const n={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:n},{type:"text",content:""}]},onToolEnd:a=>{const n=[...t.chatStreamFlow],r=n.find(v=>v.type==="tool"&&v.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=n},onCompactionStart:()=>{t.chatCompacting=!0},onCompactionEnd:()=>{t.chatCompacting=!1},onDone:a=>{const r={role:"assistant",content:t.chatStream||a.response||"",flow:t.chatStreamFlow.filter(v=>!(v.type==="text"&&!v.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 Oe(t){t.chatAbort?.abort(),t.chatStream=null,t.chatStreamFlow=[],t.chatSending=!1,t.chatAbort=null,t.chatButtonLabel="",t.chatCompacting=!1}async function Be(t,e){await Pe(t,e)}function je(t){Oe(t)}const Ue={messageSquare:o`
|
|
5
|
-
<svg viewBox="0 0 24 24">
|
|
6
|
-
<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />
|
|
7
|
-
</svg>
|
|
8
|
-
`,barChart:o`
|
|
9
|
-
<svg viewBox="0 0 24 24">
|
|
10
|
-
<line x1="12" x2="12" y1="20" y2="10" />
|
|
11
|
-
<line x1="18" x2="18" y1="20" y2="4" />
|
|
12
|
-
<line x1="6" x2="6" y1="20" y2="16" />
|
|
13
|
-
</svg>
|
|
14
|
-
`,link:o`
|
|
15
|
-
<svg viewBox="0 0 24 24">
|
|
16
|
-
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71" />
|
|
17
|
-
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71" />
|
|
18
|
-
</svg>
|
|
19
|
-
`,radio:o`
|
|
20
|
-
<svg viewBox="0 0 24 24">
|
|
21
|
-
<circle cx="12" cy="12" r="2" />
|
|
22
|
-
<path
|
|
23
|
-
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"
|
|
24
|
-
/>
|
|
25
|
-
</svg>
|
|
26
|
-
`,fileText:o`
|
|
27
|
-
<svg viewBox="0 0 24 24">
|
|
28
|
-
<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" />
|
|
29
|
-
<polyline points="14 2 14 8 20 8" />
|
|
30
|
-
<line x1="16" x2="8" y1="13" y2="13" />
|
|
31
|
-
<line x1="16" x2="8" y1="17" y2="17" />
|
|
32
|
-
<line x1="10" x2="8" y1="9" y2="9" />
|
|
33
|
-
</svg>
|
|
34
|
-
`,zap:o`
|
|
35
|
-
<svg viewBox="0 0 24 24"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" /></svg>
|
|
36
|
-
`,monitor:o`
|
|
37
|
-
<svg viewBox="0 0 24 24">
|
|
38
|
-
<rect width="20" height="14" x="2" y="3" rx="2" />
|
|
39
|
-
<line x1="8" x2="16" y1="21" y2="21" />
|
|
40
|
-
<line x1="12" x2="12" y1="17" y2="21" />
|
|
41
|
-
</svg>
|
|
42
|
-
`,settings:o`
|
|
43
|
-
<svg viewBox="0 0 24 24">
|
|
44
|
-
<path
|
|
45
|
-
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"
|
|
46
|
-
/>
|
|
47
|
-
<circle cx="12" cy="12" r="3" />
|
|
48
|
-
</svg>
|
|
49
|
-
`,bug:o`
|
|
50
|
-
<svg viewBox="0 0 24 24">
|
|
51
|
-
<path d="m8 2 1.88 1.88" />
|
|
52
|
-
<path d="M14.12 3.88 16 2" />
|
|
53
|
-
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1" />
|
|
54
|
-
<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" />
|
|
55
|
-
<path d="M12 20v-9" />
|
|
56
|
-
<path d="M6.53 9C4.6 8.8 3 7.1 3 5" />
|
|
57
|
-
<path d="M6 13H2" />
|
|
58
|
-
<path d="M3 21c0-2.1 1.7-3.9 3.8-4" />
|
|
59
|
-
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4" />
|
|
60
|
-
<path d="M22 13h-4" />
|
|
61
|
-
<path d="M17.2 17c2.1.1 3.8 1.9 3.8 4" />
|
|
62
|
-
</svg>
|
|
63
|
-
`,scrollText:o`
|
|
64
|
-
<svg viewBox="0 0 24 24">
|
|
65
|
-
<path d="M8 21h12a2 2 0 0 0 2-2v-2H10v2a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v3h4" />
|
|
66
|
-
<path d="M19 17V5a2 2 0 0 0-2-2H4" />
|
|
67
|
-
<path d="M15 8h-5" />
|
|
68
|
-
<path d="M15 12h-5" />
|
|
69
|
-
</svg>
|
|
70
|
-
`,folder:o`
|
|
71
|
-
<svg viewBox="0 0 24 24">
|
|
72
|
-
<path
|
|
73
|
-
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"
|
|
74
|
-
/>
|
|
75
|
-
</svg>
|
|
76
|
-
`,menu:o`
|
|
77
|
-
<svg viewBox="0 0 24 24">
|
|
78
|
-
<line x1="4" x2="20" y1="12" y2="12" />
|
|
79
|
-
<line x1="4" x2="20" y1="6" y2="6" />
|
|
80
|
-
<line x1="4" x2="20" y1="18" y2="18" />
|
|
81
|
-
</svg>
|
|
82
|
-
`,x:o`
|
|
83
|
-
<svg viewBox="0 0 24 24">
|
|
84
|
-
<path d="M18 6 6 18" />
|
|
85
|
-
<path d="m6 6 12 12" />
|
|
86
|
-
</svg>
|
|
87
|
-
`,check:o`
|
|
88
|
-
<svg viewBox="0 0 24 24"><path d="M20 6 9 17l-5-5" /></svg>
|
|
89
|
-
`,arrowDown:o`
|
|
90
|
-
<svg viewBox="0 0 24 24">
|
|
91
|
-
<path d="M12 5v14" />
|
|
92
|
-
<path d="m19 12-7 7-7-7" />
|
|
93
|
-
</svg>
|
|
94
|
-
`,copy:o`
|
|
95
|
-
<svg viewBox="0 0 24 24">
|
|
96
|
-
<rect width="14" height="14" x="8" y="8" rx="2" ry="2" />
|
|
97
|
-
<path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />
|
|
98
|
-
</svg>
|
|
99
|
-
`,search:o`
|
|
100
|
-
<svg viewBox="0 0 24 24">
|
|
101
|
-
<circle cx="11" cy="11" r="8" />
|
|
102
|
-
<path d="m21 21-4.3-4.3" />
|
|
103
|
-
</svg>
|
|
104
|
-
`,brain:o`
|
|
105
|
-
<svg viewBox="0 0 24 24">
|
|
106
|
-
<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" />
|
|
107
|
-
<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" />
|
|
108
|
-
<path d="M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4" />
|
|
109
|
-
<path d="M17.599 6.5a3 3 0 0 0 .399-1.375" />
|
|
110
|
-
<path d="M6.003 5.125A3 3 0 0 0 6.401 6.5" />
|
|
111
|
-
<path d="M3.477 10.896a4 4 0 0 1 .585-.396" />
|
|
112
|
-
<path d="M19.938 10.5a4 4 0 0 1 .585.396" />
|
|
113
|
-
<path d="M6 18a4 4 0 0 1-1.967-.516" />
|
|
114
|
-
<path d="M19.967 17.484A4 4 0 0 1 18 18" />
|
|
115
|
-
</svg>
|
|
116
|
-
`,book:o`
|
|
117
|
-
<svg viewBox="0 0 24 24">
|
|
118
|
-
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20" />
|
|
119
|
-
</svg>
|
|
120
|
-
`,loader:o`
|
|
121
|
-
<svg viewBox="0 0 24 24">
|
|
122
|
-
<path d="M12 2v4" />
|
|
123
|
-
<path d="m16.2 7.8 2.9-2.9" />
|
|
124
|
-
<path d="M18 12h4" />
|
|
125
|
-
<path d="m16.2 16.2 2.9 2.9" />
|
|
126
|
-
<path d="M12 18v4" />
|
|
127
|
-
<path d="m4.9 19.1 2.9-2.9" />
|
|
128
|
-
<path d="M2 12h4" />
|
|
129
|
-
<path d="m4.9 4.9 2.9 2.9" />
|
|
130
|
-
</svg>
|
|
131
|
-
`,wrench:o`
|
|
132
|
-
<svg viewBox="0 0 24 24">
|
|
133
|
-
<path
|
|
134
|
-
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"
|
|
135
|
-
/>
|
|
136
|
-
</svg>
|
|
137
|
-
`,fileCode:o`
|
|
138
|
-
<svg viewBox="0 0 24 24">
|
|
139
|
-
<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" />
|
|
140
|
-
<polyline points="14 2 14 8 20 8" />
|
|
141
|
-
<path d="m10 13-2 2 2 2" />
|
|
142
|
-
<path d="m14 17 2-2-2-2" />
|
|
143
|
-
</svg>
|
|
144
|
-
`,edit:o`
|
|
145
|
-
<svg viewBox="0 0 24 24">
|
|
146
|
-
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
|
|
147
|
-
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" />
|
|
148
|
-
</svg>
|
|
149
|
-
`,penLine:o`
|
|
150
|
-
<svg viewBox="0 0 24 24">
|
|
151
|
-
<path d="M12 20h9" />
|
|
152
|
-
<path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" />
|
|
153
|
-
</svg>
|
|
154
|
-
`,paperclip:o`
|
|
155
|
-
<svg viewBox="0 0 24 24">
|
|
156
|
-
<path
|
|
157
|
-
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"
|
|
158
|
-
/>
|
|
159
|
-
</svg>
|
|
160
|
-
`,globe:o`
|
|
161
|
-
<svg viewBox="0 0 24 24">
|
|
162
|
-
<circle cx="12" cy="12" r="10" />
|
|
163
|
-
<path d="M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20" />
|
|
164
|
-
<path d="M2 12h20" />
|
|
165
|
-
</svg>
|
|
166
|
-
`,image:o`
|
|
167
|
-
<svg viewBox="0 0 24 24">
|
|
168
|
-
<rect width="18" height="18" x="3" y="3" rx="2" ry="2" />
|
|
169
|
-
<circle cx="9" cy="9" r="2" />
|
|
170
|
-
<path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />
|
|
171
|
-
</svg>
|
|
172
|
-
`,smartphone:o`
|
|
173
|
-
<svg viewBox="0 0 24 24">
|
|
174
|
-
<rect width="14" height="20" x="5" y="2" rx="2" ry="2" />
|
|
175
|
-
<path d="M12 18h.01" />
|
|
176
|
-
</svg>
|
|
177
|
-
`,plug:o`
|
|
178
|
-
<svg viewBox="0 0 24 24">
|
|
179
|
-
<path d="M12 22v-5" />
|
|
180
|
-
<path d="M9 8V2" />
|
|
181
|
-
<path d="M15 8V2" />
|
|
182
|
-
<path d="M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z" />
|
|
183
|
-
</svg>
|
|
184
|
-
`,circle:o`
|
|
185
|
-
<svg viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" /></svg>
|
|
186
|
-
`,puzzle:o`
|
|
187
|
-
<svg viewBox="0 0 24 24">
|
|
188
|
-
<path
|
|
189
|
-
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"
|
|
190
|
-
/>
|
|
191
|
-
</svg>
|
|
192
|
-
`,activity:o`
|
|
193
|
-
<svg viewBox="0 0 24 24">
|
|
194
|
-
<path d="M22 12h-4l-3 9L9 3l-3 9H2" />
|
|
195
|
-
</svg>
|
|
196
|
-
`,database:o`
|
|
197
|
-
<svg viewBox="0 0 24 24">
|
|
198
|
-
<ellipse cx="12" cy="5" rx="9" ry="3" />
|
|
199
|
-
<path d="M3 5V19A9 3 0 0 0 21 19V5" />
|
|
200
|
-
<path d="M3 12A9 3 0 0 0 21 12" />
|
|
201
|
-
</svg>
|
|
202
|
-
`,package:o`
|
|
203
|
-
<svg viewBox="0 0 24 24">
|
|
204
|
-
<path d="m7.5 4.27 9 5.15" />
|
|
205
|
-
<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" />
|
|
206
|
-
<path d="m3.3 7 8.7 5 8.7-5" />
|
|
207
|
-
<path d="M12 22V12" />
|
|
208
|
-
</svg>
|
|
209
|
-
`,play:o`
|
|
210
|
-
<svg viewBox="0 0 24 24"><polygon points="5 3 19 12 5 21 5 3" /></svg>
|
|
211
|
-
`,trash:o`
|
|
212
|
-
<svg viewBox="0 0 24 24">
|
|
213
|
-
<path d="M3 6h18" />
|
|
214
|
-
<path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6" />
|
|
215
|
-
<path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2" />
|
|
216
|
-
</svg>
|
|
217
|
-
`,clock:o`
|
|
218
|
-
<svg viewBox="0 0 24 24">
|
|
219
|
-
<circle cx="12" cy="12" r="10" />
|
|
220
|
-
<polyline points="12 6 12 12 16 14" />
|
|
221
|
-
</svg>
|
|
222
|
-
`,send:o`
|
|
223
|
-
<svg viewBox="0 0 24 24">
|
|
224
|
-
<path d="m22 2-7 20-4-9-9-4Z" />
|
|
225
|
-
<path d="M22 2 11 13" />
|
|
226
|
-
</svg>
|
|
227
|
-
`,sun:o`
|
|
228
|
-
<svg viewBox="0 0 24 24">
|
|
229
|
-
<circle cx="12" cy="12" r="4" />
|
|
230
|
-
<path d="M12 2v2" /><path d="M12 20v2" />
|
|
231
|
-
<path d="m4.93 4.93 1.41 1.41" /><path d="m17.66 17.66 1.41 1.41" />
|
|
232
|
-
<path d="M2 12h2" /><path d="M20 12h2" />
|
|
233
|
-
<path d="m6.34 17.66-1.41 1.41" /><path d="m19.07 4.93-1.41 1.41" />
|
|
234
|
-
</svg>
|
|
235
|
-
`,moon:o`
|
|
236
|
-
<svg viewBox="0 0 24 24"><path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z" /></svg>
|
|
237
|
-
`,chevronDown:o`
|
|
238
|
-
<svg viewBox="0 0 24 24"><path d="m6 9 6 6 6-6" /></svg>
|
|
239
|
-
`,chevronRight:o`
|
|
240
|
-
<svg viewBox="0 0 24 24"><path d="m9 18 6-6-6-6" /></svg>
|
|
241
|
-
`,refresh:o`
|
|
242
|
-
<svg viewBox="0 0 24 24">
|
|
243
|
-
<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" />
|
|
244
|
-
<path d="M21 3v5h-5" />
|
|
245
|
-
<path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" />
|
|
246
|
-
<path d="M8 16H3v5" />
|
|
247
|
-
</svg>
|
|
248
|
-
`,terminal:o`
|
|
249
|
-
<svg viewBox="0 0 24 24">
|
|
250
|
-
<polyline points="4 17 10 11 4 5" />
|
|
251
|
-
<line x1="12" x2="20" y1="19" y2="19" />
|
|
252
|
-
</svg>
|
|
253
|
-
`,home:o`
|
|
254
|
-
<svg viewBox="0 0 24 24">
|
|
255
|
-
<path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" />
|
|
256
|
-
<polyline points="9 22 9 12 15 12 15 22" />
|
|
257
|
-
</svg>
|
|
258
|
-
`,save:o`
|
|
259
|
-
<svg viewBox="0 0 24 24">
|
|
260
|
-
<path d="M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" />
|
|
261
|
-
<polyline points="17 21 17 13 7 13 7 21" />
|
|
262
|
-
<polyline points="7 3 7 8 15 8" />
|
|
263
|
-
</svg>
|
|
264
|
-
`,plus:o`
|
|
265
|
-
<svg viewBox="0 0 24 24">
|
|
266
|
-
<path d="M5 12h14" />
|
|
267
|
-
<path d="M12 5v14" />
|
|
268
|
-
</svg>
|
|
269
|
-
`,externalLink:o`
|
|
270
|
-
<svg viewBox="0 0 24 24">
|
|
271
|
-
<path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" />
|
|
272
|
-
<polyline points="15 3 21 3 21 9" />
|
|
273
|
-
<line x1="10" x2="21" y1="14" y2="3" />
|
|
274
|
-
</svg>
|
|
275
|
-
`,stop:o`
|
|
276
|
-
<svg viewBox="0 0 24 24"><rect width="14" height="14" x="5" y="5" rx="2" /></svg>
|
|
277
|
-
`};function j(t,e="nav-item__icon"){return o`<span class=${e} aria-hidden="true">${Ue[t]}</span>`}function Ne(t){return o`
|
|
278
|
-
<header class="topbar">
|
|
279
|
-
<div class="topbar__left">
|
|
280
|
-
<span class="topbar__brand">CoStar</span>
|
|
281
|
-
${t.serverStatus?.version?o`<span class="topbar__version">v${t.serverStatus.version}</span>`:h}
|
|
282
|
-
</div>
|
|
283
|
-
<div class="topbar__right">
|
|
284
|
-
${ze(t)}
|
|
285
|
-
<span class="topbar__status ${t.serverStatus?.status==="running"?"status--ok":""}">
|
|
286
|
-
${t.serverStatus?.status||"..."}
|
|
287
|
-
</span>
|
|
288
|
-
</div>
|
|
289
|
-
</header>
|
|
290
|
-
`}function Ie(t){return o`
|
|
291
|
-
<nav class="nav">
|
|
292
|
-
${le.map(e=>o`
|
|
293
|
-
<div class="nav-group">
|
|
294
|
-
<div class="nav-group__label">${ye(e.label)}</div>
|
|
295
|
-
${e.tabs.map(s=>Je(t,s))}
|
|
296
|
-
</div>
|
|
297
|
-
`)}
|
|
298
|
-
</nav>
|
|
299
|
-
`}function Je(t,e){return o`
|
|
300
|
-
<button
|
|
301
|
-
class="nav-item ${t.tab===e?"active":""}"
|
|
302
|
-
@click=${()=>t.setTab(e)}
|
|
303
|
-
>
|
|
304
|
-
${j(pe(e))}
|
|
305
|
-
<span>${ge(e)}</span>
|
|
306
|
-
</button>
|
|
307
|
-
`}function ze(t){return o`
|
|
308
|
-
<div class="theme-toggle" style="display: flex; gap: 4px; margin-right: 12px;">
|
|
309
|
-
<button
|
|
310
|
-
class="btn btn-sm ${t.theme==="light"?"btn-primary":""}"
|
|
311
|
-
@click=${()=>t.setTheme("light")}
|
|
312
|
-
title="Light theme"
|
|
313
|
-
>
|
|
314
|
-
${j("sun","btn-icon")}
|
|
315
|
-
</button>
|
|
316
|
-
<button
|
|
317
|
-
class="btn btn-sm ${t.theme==="dark"?"btn-primary":""}"
|
|
318
|
-
@click=${()=>t.setTheme("dark")}
|
|
319
|
-
title="Dark theme"
|
|
320
|
-
>
|
|
321
|
-
${j("moon","btn-icon")}
|
|
322
|
-
</button>
|
|
323
|
-
<button
|
|
324
|
-
class="btn btn-sm ${t.theme==="system"?"btn-primary":""}"
|
|
325
|
-
@click=${()=>t.setTheme("system")}
|
|
326
|
-
title="System theme"
|
|
327
|
-
>
|
|
328
|
-
${j("monitor","btn-icon")}
|
|
329
|
-
</button>
|
|
330
|
-
</div>
|
|
331
|
-
`}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 I(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 st(t,e=120){return t.length<=e?t:`${t.slice(0,Math.max(0,e-1))}…`}function Ft(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ve(t){return o`
|
|
332
|
-
<div class="dashboard-grid" style="animation: dashboard-enter 0.4s var(--ease-out) both;">
|
|
333
|
-
<!-- Status Cards -->
|
|
334
|
-
<div class="stats-row">
|
|
335
|
-
${O("Status",t.serverStatus?t.serverStatus.online?"Online":"Offline":"...",t.serverStatus?.version?`v${t.serverStatus.version}`:"")}
|
|
336
|
-
${O("Uptime",t.serverStatus?.uptime?I(t.serverStatus.uptime*1e3):"...",t.serverStatus?.cronRunning?`${t.serverStatus.cronJobs} cron jobs`:"")}
|
|
337
|
-
${O("Activities",t.activityStats?String(t.activityStats.total):"...",t.activityStats?`${t.activityStats.completed} completed, ${t.activityStats.failed} failed`:"")}
|
|
338
|
-
${O("Active Project",t.activeProject?.name||"None",t.projectCount!==null?`${t.projectCount} total`:"")}
|
|
339
|
-
</div>
|
|
340
|
-
|
|
341
|
-
<!-- Quick Actions -->
|
|
342
|
-
<div class="card" style="animation-delay: 0.1s;">
|
|
343
|
-
<div class="card-header">
|
|
344
|
-
<h3>Quick Actions</h3>
|
|
345
|
-
</div>
|
|
346
|
-
<div class="card-body" style="display: flex; gap: 8px; flex-wrap: wrap; padding: 16px;">
|
|
347
|
-
<button class="btn btn-primary btn-sm" @click=${()=>t.setTab("chat")}>Open Chat</button>
|
|
348
|
-
<button class="btn btn-sm" @click=${()=>t.setTab("cron")}>Manage Cron</button>
|
|
349
|
-
<button class="btn btn-sm" @click=${()=>t.setTab("activity")}>View Activity</button>
|
|
350
|
-
<button class="btn btn-sm" @click=${()=>t.setTab("workspace")}>Workspace</button>
|
|
351
|
-
<button class="btn btn-sm" @click=${()=>t.setTab("logs")}>View Logs</button>
|
|
352
|
-
</div>
|
|
353
|
-
</div>
|
|
354
|
-
|
|
355
|
-
<!-- Recent Activity -->
|
|
356
|
-
${t.recentActivity.length>0?o`
|
|
357
|
-
<div class="card" style="animation-delay: 0.2s;">
|
|
358
|
-
<div class="card-header">
|
|
359
|
-
<h3>Recent Activity</h3>
|
|
360
|
-
</div>
|
|
361
|
-
<div class="table-wrap">
|
|
362
|
-
<table>
|
|
363
|
-
<thead>
|
|
364
|
-
<tr>
|
|
365
|
-
<th>Time</th>
|
|
366
|
-
<th>Request</th>
|
|
367
|
-
<th>Status</th>
|
|
368
|
-
<th>Executor</th>
|
|
369
|
-
</tr>
|
|
370
|
-
</thead>
|
|
371
|
-
<tbody>
|
|
372
|
-
${t.recentActivity.slice(0,5).map(e=>o`
|
|
373
|
-
<tr>
|
|
374
|
-
<td style="white-space: nowrap;">${_(e.created_at)}</td>
|
|
375
|
-
<td style="max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
376
|
-
${(e.request||"").substring(0,80)}
|
|
377
|
-
</td>
|
|
378
|
-
<td>
|
|
379
|
-
<span class="tag ${e.status==="completed"?"tag-green":e.status==="failed"?"tag-red":"tag-yellow"}">
|
|
380
|
-
${e.status}
|
|
381
|
-
</span>
|
|
382
|
-
</td>
|
|
383
|
-
<td>
|
|
384
|
-
<span class="tag ${e.executor==="client"?"tag-blue":"tag-muted"}">${e.executor}</span>
|
|
385
|
-
</td>
|
|
386
|
-
</tr>
|
|
387
|
-
`)}
|
|
388
|
-
</tbody>
|
|
389
|
-
</table>
|
|
390
|
-
</div>
|
|
391
|
-
</div>
|
|
392
|
-
`:h}
|
|
393
|
-
</div>
|
|
394
|
-
`}function O(t,e,s){return o`
|
|
395
|
-
<div class="stat-card">
|
|
396
|
-
<div class="stat-label">${t}</div>
|
|
397
|
-
<div class="stat-value">${e}</div>
|
|
398
|
-
${s?o`<div class="stat-sub">${s}</div>`:h}
|
|
399
|
-
</div>
|
|
400
|
-
`}function We(t){return o`
|
|
401
|
-
<div class="chat-container">
|
|
402
|
-
<div class="chat-messages" id="chat-messages">
|
|
403
|
-
${t.chatMessages.length===0&&!t.chatSending?o`
|
|
404
|
-
<div class="empty-state">
|
|
405
|
-
<div class="empty-icon">💬</div>
|
|
406
|
-
<p>Send a message to start chatting with your CoStar agent.</p>
|
|
407
|
-
</div>
|
|
408
|
-
`:h}
|
|
409
|
-
|
|
410
|
-
${t.chatMessages.map(e=>Ze(e))}
|
|
411
|
-
|
|
412
|
-
${t.chatSending?qe(t):h}
|
|
413
|
-
</div>
|
|
414
|
-
|
|
415
|
-
${t.chatCompacting?o`<div class="compaction-banner active">
|
|
416
|
-
<span class="compaction-icon">⚙</span>
|
|
417
|
-
<span class="compaction-text">Compacting conversation context...</span>
|
|
418
|
-
</div>`:h}
|
|
419
|
-
|
|
420
|
-
<div class="chat-input-wrap">
|
|
421
|
-
<input
|
|
422
|
-
type="text"
|
|
423
|
-
class="input"
|
|
424
|
-
style="flex:1;"
|
|
425
|
-
placeholder="Type a message..."
|
|
426
|
-
.value=${t.chatMessage}
|
|
427
|
-
@input=${e=>{t.chatMessage=e.target.value}}
|
|
428
|
-
@keydown=${e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),t.handleSendChat())}}
|
|
429
|
-
?disabled=${t.chatSending}
|
|
430
|
-
/>
|
|
431
|
-
${t.chatSending?o`<button class="btn btn-danger" @click=${()=>t.abortChat()}>
|
|
432
|
-
${t.chatButtonLabel||"Stop"}
|
|
433
|
-
</button>`:o`<button class="btn btn-primary" @click=${()=>t.handleSendChat()} ?disabled=${!t.chatMessage.trim()}>Send</button>`}
|
|
434
|
-
</div>
|
|
435
|
-
</div>
|
|
436
|
-
`}function qe(t){return o`
|
|
437
|
-
<div class="chat-msg assistant">
|
|
438
|
-
<div class="avatar">C</div>
|
|
439
|
-
<div class="msg-content">
|
|
440
|
-
<div class="msg-role">CoStar</div>
|
|
441
|
-
<div class="msg-flow">
|
|
442
|
-
${t.chatStreamFlow.map(e=>e.type==="text"?o`<div class="msg-text-segment streaming-cursor" .innerHTML=${Z(e.content)}></div>`:Dt(e.card))}
|
|
443
|
-
</div>
|
|
444
|
-
</div>
|
|
445
|
-
</div>
|
|
446
|
-
`}function Ze(t){if(t.role==="user")return o`
|
|
447
|
-
<div class="chat-msg user">
|
|
448
|
-
<div class="avatar">U</div>
|
|
449
|
-
<div class="msg-content">
|
|
450
|
-
<div class="msg-role">You</div>
|
|
451
|
-
<div>${Ft(t.content)}</div>
|
|
452
|
-
</div>
|
|
453
|
-
</div>
|
|
454
|
-
`;const s=t.flow&&t.flow.length>0;return o`
|
|
455
|
-
<div class="chat-msg assistant">
|
|
456
|
-
<div class="avatar">C</div>
|
|
457
|
-
<div class="msg-content">
|
|
458
|
-
<div class="msg-role">CoStar</div>
|
|
459
|
-
${s?o`<div class="msg-flow">
|
|
460
|
-
${t.flow.map(i=>i.type==="text"?o`<div class="msg-text-segment" .innerHTML=${Z(i.content)}></div>`:Dt(i.card))}
|
|
461
|
-
</div>`:o`<div .innerHTML=${Z(t.content)}></div>`}
|
|
462
|
-
${t.meta&&(t.meta.toolCalls||t.meta.inputTokens)?o`<div class="chat-meta">
|
|
463
|
-
${t.meta.toolCalls?o`<span>🔧 ${t.meta.toolCalls} tool${t.meta.toolCalls>1?"s":""}</span>`:h}
|
|
464
|
-
${t.meta.inputTokens?o`<span>→ ${t.meta.inputTokens.toLocaleString()} in</span>`:h}
|
|
465
|
-
${t.meta.outputTokens?o`<span>← ${t.meta.outputTokens.toLocaleString()} out</span>`:h}
|
|
466
|
-
${t.meta.compactionCount?o`<span>📦 ${t.meta.compactionCount} compaction${t.meta.compactionCount>1?"s":""}</span>`:h}
|
|
467
|
-
</div>`:h}
|
|
468
|
-
</div>
|
|
469
|
-
</div>
|
|
470
|
-
`}function Dt(t,e){const s=t.status==="running"?"⚙":t.status==="error"?"❌":"✅",i=t.status==="error"?"error":t.status==="done"?"success":"",a=t.durationMs?` (${Ge(t.durationMs)})`:"",n=t.status==="running"?"running...":t.status==="error"?`error${a}`:`done${a}`;return o`
|
|
471
|
-
<div class="tool-card" @click=${r=>{r.currentTarget.classList.toggle("expanded")}}>
|
|
472
|
-
<div class="tool-card-header">
|
|
473
|
-
<span class="tool-icon ${t.status==="running"?"running":""}" .innerHTML=${s}></span>
|
|
474
|
-
<span class="tool-name">${t.name}</span>
|
|
475
|
-
<span class="tool-status ${i}">${n}</span>
|
|
476
|
-
<span class="tool-chevron">▶</span>
|
|
477
|
-
</div>
|
|
478
|
-
<div class="tool-card-body">
|
|
479
|
-
${t.args?o`<div class="tool-section">
|
|
480
|
-
<div class="tool-section-label">Arguments</div>
|
|
481
|
-
<pre>${t.args}</pre>
|
|
482
|
-
</div>`:h}
|
|
483
|
-
${t.result?o`<div class="tool-section">
|
|
484
|
-
<div class="tool-section-label">Result</div>
|
|
485
|
-
<pre>${t.result}</pre>
|
|
486
|
-
</div>`:h}
|
|
487
|
-
</div>
|
|
488
|
-
</div>
|
|
489
|
-
`}function Ge(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 Z(t){if(!t)return"";let e=Ft(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 Ke(t){return o`
|
|
490
|
-
<div class="page-content">
|
|
491
|
-
<!-- Create Form -->
|
|
492
|
-
<div class="card">
|
|
493
|
-
<div class="card-header">
|
|
494
|
-
<h3>Create Cron Job</h3>
|
|
495
|
-
</div>
|
|
496
|
-
<div class="card-body" style="padding: 16px;">
|
|
497
|
-
<div class="form-grid">
|
|
498
|
-
<div class="form-field">
|
|
499
|
-
<label>Name</label>
|
|
500
|
-
<input type="text" class="input" placeholder="Job name" .value=${t.cronForm.name}
|
|
501
|
-
@input=${e=>{t.cronForm={...t.cronForm,name:e.target.value}}} />
|
|
502
|
-
</div>
|
|
503
|
-
<div class="form-field">
|
|
504
|
-
<label>Schedule Type</label>
|
|
505
|
-
<select class="input" .value=${t.cronForm.scheduleType}
|
|
506
|
-
@change=${e=>{t.cronForm={...t.cronForm,scheduleType:e.target.value}}}>
|
|
507
|
-
<option value="every">Every (interval)</option>
|
|
508
|
-
<option value="cron">Cron expression</option>
|
|
509
|
-
<option value="at">At (one-time)</option>
|
|
510
|
-
</select>
|
|
511
|
-
</div>
|
|
512
|
-
${t.cronForm.scheduleType==="every"?o`
|
|
513
|
-
<div class="form-field">
|
|
514
|
-
<label>Interval (e.g. 30m, 2h, 1d)</label>
|
|
515
|
-
<input type="text" class="input" placeholder="30m" .value=${t.cronForm.every}
|
|
516
|
-
@input=${e=>{t.cronForm={...t.cronForm,every:e.target.value}}} />
|
|
517
|
-
</div>
|
|
518
|
-
`:t.cronForm.scheduleType==="cron"?o`
|
|
519
|
-
<div class="form-field">
|
|
520
|
-
<label>Cron Expression</label>
|
|
521
|
-
<input type="text" class="input" placeholder="0 */6 * * *" .value=${t.cronForm.cronExpression}
|
|
522
|
-
@input=${e=>{t.cronForm={...t.cronForm,cronExpression:e.target.value}}} />
|
|
523
|
-
</div>
|
|
524
|
-
`:o`
|
|
525
|
-
<div class="form-field">
|
|
526
|
-
<label>Run At (ISO datetime)</label>
|
|
527
|
-
<input type="datetime-local" class="input" .value=${t.cronForm.at}
|
|
528
|
-
@input=${e=>{t.cronForm={...t.cronForm,at:e.target.value}}} />
|
|
529
|
-
</div>
|
|
530
|
-
`}
|
|
531
|
-
<div class="form-field" style="grid-column: 1 / -1;">
|
|
532
|
-
<label>Instruction</label>
|
|
533
|
-
<textarea class="input" rows="3" placeholder="What should the agent do?"
|
|
534
|
-
.value=${t.cronForm.instruction}
|
|
535
|
-
@input=${e=>{t.cronForm={...t.cronForm,instruction:e.target.value}}}></textarea>
|
|
536
|
-
</div>
|
|
537
|
-
<div>
|
|
538
|
-
<button class="btn btn-primary" @click=${()=>t.createCronJob()} ?disabled=${t.cronLoading}>
|
|
539
|
-
Create Job
|
|
540
|
-
</button>
|
|
541
|
-
</div>
|
|
542
|
-
</div>
|
|
543
|
-
</div>
|
|
544
|
-
</div>
|
|
545
|
-
|
|
546
|
-
<!-- Jobs List -->
|
|
547
|
-
<div class="card">
|
|
548
|
-
<div class="card-header">
|
|
549
|
-
<h3>Cron Jobs</h3>
|
|
550
|
-
<button class="btn btn-sm" @click=${()=>t.loadCronJobs()}>Refresh</button>
|
|
551
|
-
</div>
|
|
552
|
-
${t.cronLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.cronJobs.length===0?o`<div class="empty-state"><div class="empty-icon">⏰</div><p>No cron jobs configured</p></div>`:o`
|
|
553
|
-
<div class="table-wrap">
|
|
554
|
-
<table>
|
|
555
|
-
<thead>
|
|
556
|
-
<tr><th>Name</th><th>Schedule</th><th>Status</th><th>Next Run</th><th>Instruction</th><th>Actions</th></tr>
|
|
557
|
-
</thead>
|
|
558
|
-
<tbody>
|
|
559
|
-
${t.cronJobs.map(e=>Qe(t,e))}
|
|
560
|
-
</tbody>
|
|
561
|
-
</table>
|
|
562
|
-
</div>
|
|
563
|
-
`}
|
|
564
|
-
</div>
|
|
565
|
-
</div>
|
|
566
|
-
`}function Qe(t,e){const s=Ye(e),i=e.status==="active"||e.enabled?o`<span class="tag tag-green">Active</span>`:e.status==="completed"?o`<span class="tag tag-blue">Done</span>`:o`<span class="tag tag-muted">Paused</span>`;return o`
|
|
567
|
-
<tr>
|
|
568
|
-
<td><strong>${e.name}</strong></td>
|
|
569
|
-
<td><code>${s}</code></td>
|
|
570
|
-
<td>${i}</td>
|
|
571
|
-
<td>${e.next_run_at?_(e.next_run_at):"--"}</td>
|
|
572
|
-
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
573
|
-
${(e.instruction||"").substring(0,80)}
|
|
574
|
-
</td>
|
|
575
|
-
<td style="white-space: nowrap;">
|
|
576
|
-
<button class="btn btn-sm btn-primary" @click=${()=>t.runCronJob(e.id)}>Run</button>
|
|
577
|
-
<button class="btn btn-sm" @click=${()=>t.showCronHistory(e.id,e.name)}>History</button>
|
|
578
|
-
<button class="btn btn-sm btn-danger" @click=${()=>t.deleteCronJob(e.id)}>Delete</button>
|
|
579
|
-
</td>
|
|
580
|
-
</tr>
|
|
581
|
-
`}function Ye(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 Xe(t){return o`
|
|
582
|
-
<div class="page-content">
|
|
583
|
-
<!-- Stats Bar -->
|
|
584
|
-
${t.activityStats?o`
|
|
585
|
-
<div class="stats-row">
|
|
586
|
-
<div class="stat-card"><div class="stat-label">Total</div><div class="stat-value">${t.activityStats.total}</div></div>
|
|
587
|
-
<div class="stat-card"><div class="stat-label">Completed</div><div class="stat-value" style="color: var(--ok);">${t.activityStats.completed}</div></div>
|
|
588
|
-
<div class="stat-card"><div class="stat-label">Failed</div><div class="stat-value" style="color: var(--danger);">${t.activityStats.failed}</div></div>
|
|
589
|
-
<div class="stat-card"><div class="stat-label">Avg Duration</div><div class="stat-value">${I(t.activityStats.avgDuration||0)}</div></div>
|
|
590
|
-
</div>
|
|
591
|
-
`:h}
|
|
592
|
-
|
|
593
|
-
<!-- Toolbar -->
|
|
594
|
-
<div class="toolbar">
|
|
595
|
-
<input type="text" class="input" placeholder="Search activity..."
|
|
596
|
-
style="max-width: 300px;"
|
|
597
|
-
.value=${t.activitySearch}
|
|
598
|
-
@input=${e=>{t.activitySearch=e.target.value}}
|
|
599
|
-
@keydown=${e=>{e.key==="Enter"&&t.searchActivity()}} />
|
|
600
|
-
<select class="input" style="max-width: 150px;"
|
|
601
|
-
.value=${t.activityStatusFilter}
|
|
602
|
-
@change=${e=>{t.activityStatusFilter=e.target.value,t.loadActivity()}}>
|
|
603
|
-
<option value="">All Status</option>
|
|
604
|
-
<option value="completed">Completed</option>
|
|
605
|
-
<option value="pending">Pending</option>
|
|
606
|
-
<option value="failed">Failed</option>
|
|
607
|
-
</select>
|
|
608
|
-
<button class="btn btn-sm" @click=${()=>t.loadActivity()}>Refresh</button>
|
|
609
|
-
</div>
|
|
610
|
-
|
|
611
|
-
<!-- Table -->
|
|
612
|
-
<div class="card">
|
|
613
|
-
<div class="card-header">
|
|
614
|
-
<h3>Activity Log</h3>
|
|
615
|
-
</div>
|
|
616
|
-
${t.activityLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.activityList.length===0?o`<div class="empty-state"><div class="empty-icon">📊</div><p>No activity recorded yet</p></div>`:o`
|
|
617
|
-
<div class="table-wrap">
|
|
618
|
-
<table>
|
|
619
|
-
<thead>
|
|
620
|
-
<tr><th>Time</th><th>Request</th><th>Status</th><th>Executor</th><th>Duration</th></tr>
|
|
621
|
-
</thead>
|
|
622
|
-
<tbody>
|
|
623
|
-
${t.activityList.map(e=>ts(t,e))}
|
|
624
|
-
</tbody>
|
|
625
|
-
</table>
|
|
626
|
-
</div>
|
|
627
|
-
${t.activityHasMore?o`<div style="padding: 16px; text-align: center;"><button class="btn btn-sm" @click=${()=>t.loadMoreActivity()}>Load More</button></div>`:h}
|
|
628
|
-
`}
|
|
629
|
-
</div>
|
|
630
|
-
</div>
|
|
631
|
-
|
|
632
|
-
<!-- Detail Modal -->
|
|
633
|
-
${t.activityDetail?o`
|
|
634
|
-
<div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.activityDetail=null)}}>
|
|
635
|
-
<div class="modal" style="max-width: 800px;">
|
|
636
|
-
<div class="modal-header">
|
|
637
|
-
<h3>Activity Detail</h3>
|
|
638
|
-
<button class="btn btn-sm" @click=${()=>{t.activityDetail=null}}>Close</button>
|
|
639
|
-
</div>
|
|
640
|
-
<div class="modal-body">
|
|
641
|
-
<div class="config-list">
|
|
642
|
-
<div class="config-row"><span class="config-key">ID</span><span class="config-value"><code>${t.activityDetail.id}</code></span></div>
|
|
643
|
-
<div class="config-row"><span class="config-key">Status</span><span class="config-value">${t.activityDetail.status}</span></div>
|
|
644
|
-
<div class="config-row"><span class="config-key">Executor</span><span class="config-value">${t.activityDetail.executor}</span></div>
|
|
645
|
-
<div class="config-row"><span class="config-key">Created</span><span class="config-value">${new Date(t.activityDetail.created_at).toLocaleString()}</span></div>
|
|
646
|
-
${t.activityDetail.duration?o`<div class="config-row"><span class="config-key">Duration</span><span class="config-value">${I(t.activityDetail.duration)}</span></div>`:h}
|
|
647
|
-
${t.activityDetail.keywords?o`<div class="config-row"><span class="config-key">Keywords</span><span class="config-value">${t.activityDetail.keywords}</span></div>`:h}
|
|
648
|
-
</div>
|
|
649
|
-
<h4 style="margin-top: 16px;">Request</h4>
|
|
650
|
-
<pre class="code-block">${t.activityDetail.request||"(empty)"}</pre>
|
|
651
|
-
${t.activityDetail.response?o`<h4 style="margin-top: 16px;">Response</h4><pre class="code-block">${t.activityDetail.response}</pre>`:h}
|
|
652
|
-
${t.activityDetail.error?o`<h4 style="margin-top: 16px; color: var(--danger);">Error</h4><pre class="code-block" style="color: var(--danger);">${t.activityDetail.error}</pre>`:h}
|
|
653
|
-
</div>
|
|
654
|
-
</div>
|
|
655
|
-
</div>
|
|
656
|
-
`:h}
|
|
657
|
-
`}function ts(t,e){return o`
|
|
658
|
-
<tr style="cursor: pointer;" @click=${()=>{t.activityDetail=e}}>
|
|
659
|
-
<td style="white-space: nowrap;">${_(e.created_at)}</td>
|
|
660
|
-
<td style="max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
661
|
-
${st(e.request||"",80)}
|
|
662
|
-
</td>
|
|
663
|
-
<td>
|
|
664
|
-
<span class="tag ${e.status==="completed"?"tag-green":e.status==="failed"?"tag-red":"tag-yellow"}">${e.status}</span>
|
|
665
|
-
</td>
|
|
666
|
-
<td>
|
|
667
|
-
<span class="tag ${e.executor==="client"?"tag-blue":"tag-muted"}">${e.executor}</span>
|
|
668
|
-
</td>
|
|
669
|
-
<td>${e.duration?I(e.duration):"--"}</td>
|
|
670
|
-
</tr>
|
|
671
|
-
`}function es(t){const e=t.assetTypeFilter?t.assetsList.filter(s=>s.type===t.assetTypeFilter):t.assetsList;return o`
|
|
672
|
-
<div class="page-content">
|
|
673
|
-
<div class="toolbar">
|
|
674
|
-
<select class="input" style="max-width: 150px;"
|
|
675
|
-
.value=${t.assetTypeFilter}
|
|
676
|
-
@change=${s=>{t.assetTypeFilter=s.target.value}}>
|
|
677
|
-
<option value="">All Types</option>
|
|
678
|
-
<option value="image">Image</option>
|
|
679
|
-
<option value="document">Document</option>
|
|
680
|
-
<option value="audio">Audio</option>
|
|
681
|
-
<option value="video">Video</option>
|
|
682
|
-
<option value="code">Code</option>
|
|
683
|
-
<option value="other">Other</option>
|
|
684
|
-
</select>
|
|
685
|
-
<button class="btn btn-sm" @click=${()=>t.loadAssets()}>Refresh</button>
|
|
686
|
-
<span class="muted-text" style="margin-left: auto;">${e.length} assets</span>
|
|
687
|
-
</div>
|
|
688
|
-
|
|
689
|
-
<div class="card">
|
|
690
|
-
<div class="card-header"><h3>Assets</h3></div>
|
|
691
|
-
${t.assetsLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:e.length===0?o`<div class="empty-state"><div class="empty-icon">📦</div><p>No assets tracked yet</p></div>`:o`
|
|
692
|
-
<div class="table-wrap">
|
|
693
|
-
<table>
|
|
694
|
-
<thead><tr><th>Name</th><th>Type</th><th>Path / URL</th><th>Created</th></tr></thead>
|
|
695
|
-
<tbody>
|
|
696
|
-
${e.map(s=>o`
|
|
697
|
-
<tr>
|
|
698
|
-
<td>
|
|
699
|
-
<strong>${s.name}</strong>
|
|
700
|
-
${s.description?o`<br /><span class="muted-text">${st(s.description,60)}</span>`:h}
|
|
701
|
-
</td>
|
|
702
|
-
<td><span class="tag tag-blue">${s.type||"unknown"}</span></td>
|
|
703
|
-
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
704
|
-
${s.remote_url||s.local_file_path||"--"}
|
|
705
|
-
</td>
|
|
706
|
-
<td style="white-space: nowrap;">${_(s.created_at)}</td>
|
|
707
|
-
</tr>
|
|
708
|
-
`)}
|
|
709
|
-
</tbody>
|
|
710
|
-
</table>
|
|
711
|
-
</div>
|
|
712
|
-
`}
|
|
713
|
-
</div>
|
|
714
|
-
</div>
|
|
715
|
-
`}function ss(t){return o`
|
|
716
|
-
<div class="page-content">
|
|
717
|
-
<div class="card">
|
|
718
|
-
<div class="card-header">
|
|
719
|
-
<h3>Projects</h3>
|
|
720
|
-
<button class="btn btn-sm" @click=${()=>t.loadProjects()}>Refresh</button>
|
|
721
|
-
</div>
|
|
722
|
-
${t.projectsLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.projectsList.length===0?o`<div class="empty-state"><div class="empty-icon">📂</div><p>No projects yet</p></div>`:o`
|
|
723
|
-
<div class="table-wrap">
|
|
724
|
-
<table>
|
|
725
|
-
<thead><tr><th>Name</th><th>Description</th><th>Path</th><th>Status</th><th>Created</th></tr></thead>
|
|
726
|
-
<tbody>
|
|
727
|
-
${t.projectsList.map(e=>o`
|
|
728
|
-
<tr style="${e.is_active?"border-left: 3px solid var(--ok);":""}">
|
|
729
|
-
<td><strong>${e.name}</strong></td>
|
|
730
|
-
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
731
|
-
${st(e.description||"",80)}
|
|
732
|
-
</td>
|
|
733
|
-
<td><code>${e.project_path||"--"}</code></td>
|
|
734
|
-
<td>
|
|
735
|
-
${e.is_active?o`<span class="tag tag-green">Active</span>`:o`<span class="tag tag-muted">Inactive</span>`}
|
|
736
|
-
</td>
|
|
737
|
-
<td style="white-space: nowrap;">${_(e.created_at)}</td>
|
|
738
|
-
</tr>
|
|
739
|
-
`)}
|
|
740
|
-
</tbody>
|
|
741
|
-
</table>
|
|
742
|
-
</div>
|
|
743
|
-
`}
|
|
744
|
-
</div>
|
|
745
|
-
</div>
|
|
746
|
-
`}function is(t){return o`
|
|
747
|
-
<div class="page-content">
|
|
748
|
-
<div class="card">
|
|
749
|
-
<div class="card-header">
|
|
750
|
-
<h3>Sessions</h3>
|
|
751
|
-
<button class="btn btn-sm" @click=${()=>t.loadSessions()}>Refresh</button>
|
|
752
|
-
</div>
|
|
753
|
-
${t.sessionsLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.sessionsList.length===0?o`<div class="empty-state"><div class="empty-icon">📝</div><p>No session files found</p></div>`:o`
|
|
754
|
-
<div class="table-wrap">
|
|
755
|
-
<table>
|
|
756
|
-
<thead><tr><th>Name</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
|
|
757
|
-
<tbody>
|
|
758
|
-
${t.sessionsList.map(e=>o`
|
|
759
|
-
<tr>
|
|
760
|
-
<td><code>${e.name}</code></td>
|
|
761
|
-
<td>${as(e.size)}</td>
|
|
762
|
-
<td>${e.modified?_(e.modified):"--"}</td>
|
|
763
|
-
<td>
|
|
764
|
-
<button class="btn btn-sm" @click=${()=>t.viewSession(e.name)}>View</button>
|
|
765
|
-
</td>
|
|
766
|
-
</tr>
|
|
767
|
-
`)}
|
|
768
|
-
</tbody>
|
|
769
|
-
</table>
|
|
770
|
-
</div>
|
|
771
|
-
`}
|
|
772
|
-
</div>
|
|
773
|
-
|
|
774
|
-
${t.sessionDetail?o`
|
|
775
|
-
<div class="card">
|
|
776
|
-
<div class="card-header">
|
|
777
|
-
<h3>${t.sessionDetailName}</h3>
|
|
778
|
-
<button class="btn btn-sm" @click=${()=>{t.sessionDetail=null,t.sessionDetailName=""}}>Close</button>
|
|
779
|
-
</div>
|
|
780
|
-
<div class="card-body" style="padding: 16px;">
|
|
781
|
-
<div class="chat-messages" style="max-height: 500px; overflow-y: auto;">
|
|
782
|
-
${t.sessionDetail.map(e=>o`
|
|
783
|
-
<div class="chat-msg chat-msg--${e.role}">
|
|
784
|
-
<div class="chat-msg__role">${e.role==="user"?"User":e.role==="assistant"?"Assistant":"System"}</div>
|
|
785
|
-
<div class="chat-msg__body">${typeof e.content=="string"?e.content:JSON.stringify(e.content)}</div>
|
|
786
|
-
</div>
|
|
787
|
-
`)}
|
|
788
|
-
</div>
|
|
789
|
-
</div>
|
|
790
|
-
</div>
|
|
791
|
-
`:h}
|
|
792
|
-
</div>
|
|
793
|
-
`}function as(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function os(t){return o`
|
|
794
|
-
<div class="page-content">
|
|
795
|
-
<div class="card">
|
|
796
|
-
<div class="card-header">
|
|
797
|
-
<h3>Workspace Files</h3>
|
|
798
|
-
<button class="btn btn-sm" @click=${()=>t.loadWorkspaceFiles()}>Refresh</button>
|
|
799
|
-
</div>
|
|
800
|
-
${t.workspaceLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.workspaceFiles.length===0?o`<div class="empty-state"><div class="empty-icon">📁</div><p>No workspace files</p></div>`:o`
|
|
801
|
-
<div class="table-wrap">
|
|
802
|
-
<table>
|
|
803
|
-
<thead><tr><th>File</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
|
|
804
|
-
<tbody>
|
|
805
|
-
${t.workspaceFiles.map(e=>o`
|
|
806
|
-
<tr class="${t.workspaceEditingFile===e.name?"row-active":""}">
|
|
807
|
-
<td><code>${e.name}</code></td>
|
|
808
|
-
<td>${e.size}B</td>
|
|
809
|
-
<td>${e.modified?_(e.modified):"--"}</td>
|
|
810
|
-
<td>
|
|
811
|
-
<button class="btn btn-sm" @click=${()=>t.editWorkspaceFile(e.name)}>
|
|
812
|
-
${t.workspaceEditingFile===e.name?"Refresh":"Edit"}
|
|
813
|
-
</button>
|
|
814
|
-
</td>
|
|
815
|
-
</tr>
|
|
816
|
-
`)}
|
|
817
|
-
</tbody>
|
|
818
|
-
</table>
|
|
819
|
-
</div>
|
|
820
|
-
`}
|
|
821
|
-
</div>
|
|
822
|
-
|
|
823
|
-
${t.workspaceEditingFile?o`
|
|
824
|
-
<div class="card">
|
|
825
|
-
<div class="card-header">
|
|
826
|
-
<h3>${t.workspaceEditingFile}</h3>
|
|
827
|
-
<div style="display: flex; gap: 8px;">
|
|
828
|
-
<button class="btn btn-sm btn-primary" @click=${()=>t.saveWorkspaceFile()} ?disabled=${t.workspaceSaving}>
|
|
829
|
-
${t.workspaceSaving?"Saving...":"Save"}
|
|
830
|
-
</button>
|
|
831
|
-
<button class="btn btn-sm" @click=${()=>{t.workspaceEditingFile="",t.workspaceEditContent=""}}>Close</button>
|
|
832
|
-
</div>
|
|
833
|
-
</div>
|
|
834
|
-
<div class="card-body" style="padding: 0;">
|
|
835
|
-
<textarea
|
|
836
|
-
class="workspace-editor"
|
|
837
|
-
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;"
|
|
838
|
-
.value=${t.workspaceEditContent}
|
|
839
|
-
@input=${e=>{t.workspaceEditContent=e.target.value}}
|
|
840
|
-
></textarea>
|
|
841
|
-
</div>
|
|
842
|
-
</div>
|
|
843
|
-
`:h}
|
|
844
|
-
</div>
|
|
845
|
-
`}function ns(t){return o`
|
|
846
|
-
<div class="page-content">
|
|
847
|
-
<div class="toolbar">
|
|
848
|
-
<h3 style="margin:0;font-size:15px;font-weight:600;">Skills</h3>
|
|
849
|
-
<button class="btn btn-sm" style="margin-left:auto;" @click=${()=>t.loadSkills()}>Refresh</button>
|
|
850
|
-
</div>
|
|
851
|
-
|
|
852
|
-
${t.skillsLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:t.skillsList.length===0?o`<div class="empty-state"><div class="empty-icon">⚡</div><p>No skills loaded. Add skills to your workspace or managed directory.</p></div>`:o`
|
|
853
|
-
<div class="skill-grid">
|
|
854
|
-
${t.skillsList.map(e=>o`
|
|
855
|
-
<div class="skill-card">
|
|
856
|
-
<div class="skill-header">
|
|
857
|
-
<span class="skill-emoji">${e.emoji||"📦"}</span>
|
|
858
|
-
<span class="skill-name">${e.name}</span>
|
|
859
|
-
</div>
|
|
860
|
-
<div class="skill-desc">${e.description||"No description"}</div>
|
|
861
|
-
<div class="skill-footer">
|
|
862
|
-
${e.eligible!==void 0?e.eligible?o`<span class="tag tag-green">Eligible</span>`:o`<span class="tag tag-muted">Inactive</span>`:e.enabled?o`<span class="tag tag-green">Enabled</span>`:o`<span class="tag tag-muted">Disabled</span>`}
|
|
863
|
-
${e.source?o`<span class="tag tag-blue">${e.source}</span>`:h}
|
|
864
|
-
</div>
|
|
865
|
-
</div>
|
|
866
|
-
`)}
|
|
867
|
-
</div>
|
|
868
|
-
`}
|
|
869
|
-
</div>
|
|
870
|
-
`}function rs(t){const e=cs(t);return o`
|
|
871
|
-
<div class="page-content">
|
|
872
|
-
<div class="log-toolbar">
|
|
873
|
-
<select class="input" style="width:auto;min-width:130px;"
|
|
874
|
-
.value=${t.logFilter}
|
|
875
|
-
@change=${s=>{t.logFilter=s.target.value}}>
|
|
876
|
-
<option value="">All Levels</option>
|
|
877
|
-
<option value="info">Info</option>
|
|
878
|
-
<option value="warn">Warn</option>
|
|
879
|
-
<option value="error">Error</option>
|
|
880
|
-
<option value="debug">Debug</option>
|
|
881
|
-
</select>
|
|
882
|
-
<button class="btn btn-sm" @click=${()=>t.startLogStream()}>Refresh</button>
|
|
883
|
-
<label style="display:flex;align-items:center;gap:6px;margin-bottom:0;cursor:pointer;">
|
|
884
|
-
<input type="checkbox" ?checked=${t.logStreaming}
|
|
885
|
-
@change=${s=>{s.target.checked?t.startLogStream():t.stopLogStream()}} />
|
|
886
|
-
<span style="font-size:13px;">Live</span>
|
|
887
|
-
</label>
|
|
888
|
-
<button class="btn btn-sm btn-danger" style="margin-left:auto;" @click=${()=>{t.logEntries=[]}}>Clear View</button>
|
|
889
|
-
</div>
|
|
890
|
-
|
|
891
|
-
<div class="log-entries">
|
|
892
|
-
${e.length===0?o`<div style="padding:20px;color:var(--muted, var(--text-muted));text-align:center;">
|
|
893
|
-
${t.logStreaming?"Waiting for log entries...":"No log entries. Enable Live streaming to see logs."}
|
|
894
|
-
</div>`:e.map(s=>ls(s))}
|
|
895
|
-
</div>
|
|
896
|
-
</div>
|
|
897
|
-
`}function cs(t){return t.logFilter?t.logEntries.filter(e=>{const s=(e.level||"").toLowerCase();return t.logFilter==="error"?s==="error"||s==="fatal":t.logFilter==="warn"?s==="warn"||s==="error"||s==="fatal":t.logFilter==="info"?s==="info":t.logFilter==="debug"?s==="debug":!0}):t.logEntries}function ls(t){if(typeof t=="string")return o`<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 o`
|
|
898
|
-
<div class="log-line">
|
|
899
|
-
<span class="log-time">${e}</span>
|
|
900
|
-
<span class="log-level ${s}">${s.toUpperCase()}</span>
|
|
901
|
-
<span class="log-comp">${i}</span>
|
|
902
|
-
<span class="log-msg">${a}</span>
|
|
903
|
-
</div>
|
|
904
|
-
`}function ds(t){return o`
|
|
905
|
-
<div class="page-content">
|
|
906
|
-
<!-- Server Config -->
|
|
907
|
-
<div class="card">
|
|
908
|
-
<div class="card-header">
|
|
909
|
-
<h3>Server Configuration</h3>
|
|
910
|
-
<button class="btn btn-sm" @click=${()=>t.loadConfig()}>Refresh</button>
|
|
911
|
-
</div>
|
|
912
|
-
${t.configLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:o`
|
|
913
|
-
<div class="config-list" style="padding: 16px;">
|
|
914
|
-
${Object.entries(t.configData).map(([e,s])=>o`
|
|
915
|
-
<div class="config-row">
|
|
916
|
-
<span class="config-key">${e}</span>
|
|
917
|
-
<span class="config-value">${String(s)}</span>
|
|
918
|
-
</div>
|
|
919
|
-
`)}
|
|
920
|
-
</div>
|
|
921
|
-
`}
|
|
922
|
-
</div>
|
|
923
|
-
|
|
924
|
-
<!-- Environment Variables -->
|
|
925
|
-
<div class="card">
|
|
926
|
-
<div class="card-header">
|
|
927
|
-
<h3>Environment Variables</h3>
|
|
928
|
-
<div style="display: flex; gap: 8px;">
|
|
929
|
-
<button class="btn btn-sm" @click=${()=>t.loadEnv()}>Refresh</button>
|
|
930
|
-
</div>
|
|
931
|
-
</div>
|
|
932
|
-
${t.envLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:o`
|
|
933
|
-
<div class="config-list" style="padding: 16px;">
|
|
934
|
-
${Object.entries(t.envData).map(([e,s])=>o`
|
|
935
|
-
<div class="config-row">
|
|
936
|
-
<span class="config-key">${e}</span>
|
|
937
|
-
<span class="config-value">
|
|
938
|
-
${hs(e)?us(String(s)):String(s)}
|
|
939
|
-
</span>
|
|
940
|
-
</div>
|
|
941
|
-
`)}
|
|
942
|
-
${Object.keys(t.envData).length===0?o`<p class="muted-text">No environment variables loaded</p>`:h}
|
|
943
|
-
</div>
|
|
944
|
-
`}
|
|
945
|
-
</div>
|
|
946
|
-
|
|
947
|
-
<!-- UI Settings -->
|
|
948
|
-
<div class="card">
|
|
949
|
-
<div class="card-header"><h3>UI Settings</h3></div>
|
|
950
|
-
<div class="config-list" style="padding: 16px;">
|
|
951
|
-
<div class="config-row">
|
|
952
|
-
<span class="config-key">Theme</span>
|
|
953
|
-
<span class="config-value">
|
|
954
|
-
<select class="input" style="width: auto;"
|
|
955
|
-
.value=${t.theme}
|
|
956
|
-
@change=${e=>{t.setTheme(e.target.value)}}>
|
|
957
|
-
<option value="system">System</option>
|
|
958
|
-
<option value="dark">Dark</option>
|
|
959
|
-
<option value="light">Light</option>
|
|
960
|
-
</select>
|
|
961
|
-
</span>
|
|
962
|
-
</div>
|
|
963
|
-
</div>
|
|
964
|
-
</div>
|
|
965
|
-
|
|
966
|
-
<!-- Self Update -->
|
|
967
|
-
<div class="card">
|
|
968
|
-
<div class="card-header"><h3>Server Update</h3></div>
|
|
969
|
-
<div class="card-body" style="padding: 16px;">
|
|
970
|
-
<button class="btn btn-primary" @click=${()=>t.selfUpdate()} ?disabled=${t.updating}>
|
|
971
|
-
${t.updating?"Updating...":"Update Server"}
|
|
972
|
-
</button>
|
|
973
|
-
${t.updateResult?o`<pre class="code-block" style="margin-top: 12px;">${t.updateResult}</pre>`:h}
|
|
974
|
-
</div>
|
|
975
|
-
</div>
|
|
976
|
-
</div>
|
|
977
|
-
`}function hs(t){const e=t.toLowerCase();return e.includes("key")||e.includes("secret")||e.includes("token")||e.includes("password")}function us(t){return!t||t.length<8?"***":t.substring(0,6)+"..."+t.substring(t.length-4)}function vs(t){return o`
|
|
978
|
-
<div class="shell">
|
|
979
|
-
${Ne(t)}
|
|
980
|
-
${Ie(t)}
|
|
981
|
-
|
|
982
|
-
<main class="content">
|
|
983
|
-
${ps(t)}
|
|
984
|
-
</main>
|
|
985
|
-
</div>
|
|
986
|
-
|
|
987
|
-
${gs(t)}
|
|
988
|
-
`}function ps(t){switch(t.tab){case"dashboard":return Ve(t);case"chat":return We(t);case"cron":return Ke(t);case"activity":return Xe(t);case"assets":return es(t);case"projects":return ss(t);case"sessions":return is(t);case"workspace":return os(t);case"skills":return ns(t);case"logs":return rs(t);case"config":return ds(t);default:return o`<p>Unknown page</p>`}}function gs(t){return t.cronHistoryOpen?o`
|
|
989
|
-
<div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.cronHistoryOpen=!1)}}>
|
|
990
|
-
<div class="modal" style="max-width: 700px;">
|
|
991
|
-
<div class="modal-header">
|
|
992
|
-
<h3>History: ${t.cronHistoryJob}</h3>
|
|
993
|
-
<button class="btn btn-sm" @click=${()=>{t.cronHistoryOpen=!1}}>Close</button>
|
|
994
|
-
</div>
|
|
995
|
-
<div class="modal-body">
|
|
996
|
-
${t.cronHistory.length===0?o`<p class="muted-text">No run history</p>`:o`
|
|
997
|
-
<div class="table-wrap">
|
|
998
|
-
<table>
|
|
999
|
-
<thead>
|
|
1000
|
-
<tr><th>Time</th><th>Status</th><th>Duration</th><th>Summary</th></tr>
|
|
1001
|
-
</thead>
|
|
1002
|
-
<tbody>
|
|
1003
|
-
${t.cronHistory.map(e=>o`
|
|
1004
|
-
<tr>
|
|
1005
|
-
<td>${new Date(e.startedAt).toLocaleString()}</td>
|
|
1006
|
-
<td>
|
|
1007
|
-
<span class="tag ${e.status==="ok"?"tag-green":e.status==="error"?"tag-red":"tag-yellow"}">
|
|
1008
|
-
${e.status}
|
|
1009
|
-
</span>
|
|
1010
|
-
</td>
|
|
1011
|
-
<td>${e.duration?`${(e.duration/1e3).toFixed(1)}s`:"--"}</td>
|
|
1012
|
-
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
1013
|
-
${e.summary||e.error||"--"}
|
|
1014
|
-
</td>
|
|
1015
|
-
</tr>
|
|
1016
|
-
`)}
|
|
1017
|
-
</tbody>
|
|
1018
|
-
</table>
|
|
1019
|
-
</div>
|
|
1020
|
-
`}
|
|
1021
|
-
</div>
|
|
1022
|
-
</div>
|
|
1023
|
-
</div>
|
|
1024
|
-
`:h}function ys(t){t.logStreaming=!0,t.logStream=g.streamLogs({onLog:e=>{t.logEntries=[...t.logEntries.slice(-500),e]},onError:()=>{t.logStreaming=!1}})}function ms(t){t.logStream?.close(),t.logStream=null,t.logStreaming=!1}var fs=Object.defineProperty,$s=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var a=i>1?void 0:i?$s(e,s):e,n=t.length-1,r;n>=0;n--)(r=t[n])&&(a=(i?r(e,s,a):r(a))||a);return i&&a&&fs(e,s,a),a};let c=class extends T{constructor(){super(...arguments),this.settings=re(),this.tab="dashboard",this.theme="system",this.themeResolved="dark",this.serverStatus=null,this.activityStats=null,this.activeProject=null,this.projectCount=null,this.recentActivity=[],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={...$t},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.workspaceFiles=[],this.workspaceLoading=!1,this.workspaceEditingFile="",this.workspaceEditContent="",this.workspaceSaving=!1,this.skillsList=[],this.skillsLoading=!1,this.logEntries=[],this.logStreaming=!1,this.logFilter="",this.logStream=null,this.configData={},this.configLoading=!1,this.envData={},this.envLoading=!1,this.updating=!1,this.updateResult="",this.popStateHandler=null}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.popStateHandler=()=>Fe(this),window.addEventListener("popstate",this.popStateHandler),De(this)}disconnectedCallback(){Re(this),super.disconnectedCallback()}setTab(t){Me(this,t)}setTheme(t){Te(this,t)}async handleSendChat(t){await Be(this,t)}abortChat(){je(this)}async loadDashboard(){await xt(this)}async loadCronJobs(){await V(this)}async createCronJob(){await be(this)}async runCronJob(t){await we(this,t)}async deleteCronJob(t){await Se(this,t)}async showCronHistory(t,e){await xe(this,t,e)}async loadActivity(){await tt(this)}async loadMoreActivity(){await ke(this)}async searchActivity(){await _e(this)}async loadAssets(){await kt(this)}async loadProjects(){await _t(this)}async loadSessions(){await At(this)}async viewSession(t){await Ae(this,t)}async loadWorkspaceFiles(){await Ct(this)}async editWorkspaceFile(t){await Ce(this,t)}async saveWorkspaceFile(){await Le(this)}async loadSkills(){await Lt(this)}startLogStream(){ys(this)}stopLogStream(){ms(this)}async loadConfig(){await Et(this)}async loadEnv(){await Mt(this)}async selfUpdate(){await Ee(this)}render(){return vs(this)}};l([d()],c.prototype,"settings",2);l([d()],c.prototype,"tab",2);l([d()],c.prototype,"theme",2);l([d()],c.prototype,"themeResolved",2);l([d()],c.prototype,"serverStatus",2);l([d()],c.prototype,"activityStats",2);l([d()],c.prototype,"activeProject",2);l([d()],c.prototype,"projectCount",2);l([d()],c.prototype,"recentActivity",2);l([d()],c.prototype,"chatMessage",2);l([d()],c.prototype,"chatMessages",2);l([d()],c.prototype,"chatLoading",2);l([d()],c.prototype,"chatSending",2);l([d()],c.prototype,"chatStream",2);l([d()],c.prototype,"chatStreamFlow",2);l([d()],c.prototype,"chatCompacting",2);l([d()],c.prototype,"chatButtonLabel",2);l([d()],c.prototype,"cronJobs",2);l([d()],c.prototype,"cronLoading",2);l([d()],c.prototype,"cronForm",2);l([d()],c.prototype,"cronHistory",2);l([d()],c.prototype,"cronHistoryJob",2);l([d()],c.prototype,"cronHistoryOpen",2);l([d()],c.prototype,"activityList",2);l([d()],c.prototype,"activityLoading",2);l([d()],c.prototype,"activitySearch",2);l([d()],c.prototype,"activityStatusFilter",2);l([d()],c.prototype,"activityOffset",2);l([d()],c.prototype,"activityHasMore",2);l([d()],c.prototype,"activityDetail",2);l([d()],c.prototype,"assetsList",2);l([d()],c.prototype,"assetsLoading",2);l([d()],c.prototype,"assetTypeFilter",2);l([d()],c.prototype,"projectsList",2);l([d()],c.prototype,"projectsLoading",2);l([d()],c.prototype,"sessionsList",2);l([d()],c.prototype,"sessionsLoading",2);l([d()],c.prototype,"sessionDetail",2);l([d()],c.prototype,"sessionDetailName",2);l([d()],c.prototype,"workspaceFiles",2);l([d()],c.prototype,"workspaceLoading",2);l([d()],c.prototype,"workspaceEditingFile",2);l([d()],c.prototype,"workspaceEditContent",2);l([d()],c.prototype,"workspaceSaving",2);l([d()],c.prototype,"skillsList",2);l([d()],c.prototype,"skillsLoading",2);l([d()],c.prototype,"logEntries",2);l([d()],c.prototype,"logStreaming",2);l([d()],c.prototype,"logFilter",2);l([d()],c.prototype,"configData",2);l([d()],c.prototype,"configLoading",2);l([d()],c.prototype,"envData",2);l([d()],c.prototype,"envLoading",2);l([d()],c.prototype,"updating",2);l([d()],c.prototype,"updateResult",2);c=l([ie("costar-app")],c);
|
|
1025
|
-
//# sourceMappingURL=index-BT7N7LrC.js.map
|