@farazirfan/costar-server-executor 1.7.69 → 1.7.71
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-ChihPAzQ.js +988 -0
- package/public/assets/index-ChihPAzQ.js.map +1 -0
- package/public/assets/index-J_MuBktV.css +1 -0
- package/public/index.html +2 -2
- package/public/assets/index-DnNU5Z1l.js +0 -960
- package/public/assets/index-DnNU5Z1l.js.map +0 -1
- package/public/assets/index-p0BMQzJL.css +0 -1
|
@@ -0,0 +1,988 @@
|
|
|
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,Z=B.ShadowRoot&&(B.ShadyCSS===void 0||B.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,pt=Symbol(),st=new WeakMap;let Dt=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(Z&&e===void 0){const i=s!==void 0&&s.length===1;i&&(e=st.get(s)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&st.set(s,e))}return e}toString(){return this.cssText}};const Ft=t=>new Dt(typeof t=="string"?t:t+"",void 0,pt),Ht=(t,e)=>{if(Z)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)}},it=Z?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let s="";for(const i of e.cssRules)s+=i.cssText;return Ft(s)})(t):t;const{is:Pt,defineProperty:Ot,getOwnPropertyDescriptor:Rt,getOwnPropertyNames:Bt,getOwnPropertySymbols:Nt,getPrototypeOf:jt}=Object,z=globalThis,at=z.trustedTypes,Ut=at?at.emptyScript:"",Jt=z.reactiveElementPolyfillSupport,M=(t,e)=>t,j={toAttribute(t,e){switch(e){case Boolean:t=t?Ut: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}},G=(t,e)=>!Pt(t,e),ot={attribute:!0,type:String,converter:j,reflect:!1,useDefault:!1,hasChanged:G};Symbol.metadata??=Symbol("metadata"),z.litPropertyMetadata??=new WeakMap;let k=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=ot){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&&Ot(this.prototype,e,a)}}static getPropertyDescriptor(e,s,i){const{get:a,set:n}=Rt(this.prototype,e)??{get(){return this[s]},set(r){this[s]=r}};return{get:a,set(r){const u=a?.call(this);n?.call(this,r),this.requestUpdate(e,u,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ot}static _$Ei(){if(this.hasOwnProperty(M("elementProperties")))return;const e=jt(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=[...Bt(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(it(a))}else e!==void 0&&s.push(it(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 Ht(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:j).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:j;this._$Em=a;const u=r.fromAttribute(s,n.type);this[a]=u??this._$Ej?.get(a)??u,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??G)(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,u=this[a];r!==!0||this._$AL.has(a)||u===void 0||this.C(a,void 0,n,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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[M("elementProperties")]=new Map,k[M("finalized")]=new Map,Jt?.({ReactiveElement:k}),(z.reactiveElementVersions??=[]).push("2.1.2");const K=globalThis,nt=t=>t,U=K.trustedTypes,rt=U?U.createPolicy("lit-html",{createHTML:t=>t}):void 0,gt="$lit$",b=`lit$${Math.random().toFixed(9).slice(2)}$`,yt="?"+b,zt=`<${yt}>`,x=document,D=()=>x.createComment(""),F=t=>t===null||typeof t!="object"&&typeof t!="function",Q=Array.isArray,Vt=t=>Q(t)||typeof t?.[Symbol.iterator]=="function",W=`[
|
|
2
|
+
\f\r]`,L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ct=/-->/g,lt=/>/g,w=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^
|
|
3
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),dt=/'/g,ht=/"/g,ft=/^(?:script|style|textarea|title)$/i,It=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),o=It(1),C=Symbol.for("lit-noChange"),v=Symbol.for("lit-nothing"),vt=new WeakMap,_=x.createTreeWalker(x,129);function mt(t,e){if(!Q(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return rt!==void 0?rt.createHTML(e):e}const Wt=(t,e)=>{const s=t.length-1,i=[];let a,n=e===2?"<svg>":e===3?"<math>":"",r=L;for(let u=0;u<s;u++){const h=t[u];let f,m,p=-1,$=0;for(;$<h.length&&(r.lastIndex=$,m=r.exec(h),m!==null);)$=r.lastIndex,r===L?m[1]==="!--"?r=ct:m[1]!==void 0?r=lt:m[2]!==void 0?(ft.test(m[2])&&(a=RegExp("</"+m[2],"g")),r=w):m[3]!==void 0&&(r=w):r===w?m[0]===">"?(r=a??L,p=-1):m[1]===void 0?p=-2:(p=r.lastIndex-m[2].length,f=m[1],r=m[3]===void 0?w:m[3]==='"'?ht:dt):r===ht||r===dt?r=w:r===ct||r===lt?r=L:(r=w,a=void 0);const y=r===w&&t[u+1].startsWith("/>")?" ":"";n+=r===L?h+zt:p>=0?(i.push(f),h.slice(0,p)+gt+h.slice(p)+b+y):h+b+(p===-2?u:y)}return[mt(t,n+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};class H{constructor({strings:e,_$litType$:s},i){let a;this.parts=[];let n=0,r=0;const u=e.length-1,h=this.parts,[f,m]=Wt(e,s);if(this.el=H.createElement(f,i),_.currentNode=this.el.content,s===2||s===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(a=_.nextNode())!==null&&h.length<u;){if(a.nodeType===1){if(a.hasAttributes())for(const p of a.getAttributeNames())if(p.endsWith(gt)){const $=m[r++],y=a.getAttribute(p).split(b),O=/([.?@])?(.*)/.exec($);h.push({type:1,index:n,name:O[2],strings:y,ctor:O[1]==="."?Zt:O[1]==="?"?Gt:O[1]==="@"?Kt:V}),a.removeAttribute(p)}else p.startsWith(b)&&(h.push({type:6,index:n}),a.removeAttribute(p));if(ft.test(a.tagName)){const p=a.textContent.split(b),$=p.length-1;if($>0){a.textContent=U?U.emptyScript:"";for(let y=0;y<$;y++)a.append(p[y],D()),_.nextNode(),h.push({type:2,index:++n});a.append(p[$],D())}}}else if(a.nodeType===8)if(a.data===yt)h.push({type:2,index:n});else{let p=-1;for(;(p=a.data.indexOf(b,p+1))!==-1;)h.push({type:7,index:n}),p+=b.length-1}n++}}static createElement(e,s){const i=x.createElement("template");return i.innerHTML=e,i}}function E(t,e,s=t,i){if(e===C)return e;let a=i!==void 0?s._$Co?.[i]:s._$Cl;const n=F(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=E(t,a._$AS(t,e.values),a,i)),e}class qt{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??x).importNode(s,!0);_.currentNode=a;let n=_.nextNode(),r=0,u=0,h=i[0];for(;h!==void 0;){if(r===h.index){let f;h.type===2?f=new P(n,n.nextSibling,this,e):h.type===1?f=new h.ctor(n,h.name,h.strings,this,e):h.type===6&&(f=new Qt(n,this,e)),this._$AV.push(f),h=i[++u]}r!==h?.index&&(n=_.nextNode(),r++)}return _.currentNode=x,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 P{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,i,a){this.type=2,this._$AH=v,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=E(this,e,s),F(e)?e===v||e==null||e===""?(this._$AH!==v&&this._$AR(),this._$AH=v):e!==this._$AH&&e!==C&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Vt(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!==v&&F(this._$AH)?this._$AA.nextSibling.data=e:this.T(x.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=H.createElement(mt(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===a)this._$AH.p(s);else{const n=new qt(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 H(e)),s}k(e){Q(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 P(this.O(D()),this.O(D()),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=nt(e).nextSibling;nt(e).remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class V{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,i,a,n){this.type=1,this._$AH=v,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=v}_$AI(e,s=this,i,a){const n=this.strings;let r=!1;if(n===void 0)e=E(this,e,s,0),r=!F(e)||e!==this._$AH&&e!==C,r&&(this._$AH=e);else{const u=e;let h,f;for(e=n[0],h=0;h<n.length-1;h++)f=E(this,u[i+h],s,h),f===C&&(f=this._$AH[h]),r||=!F(f)||f!==this._$AH[h],f===v?e=v:e!==v&&(e+=(f??"")+n[h+1]),this._$AH[h]=f}r&&!a&&this.j(e)}j(e){e===v?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Zt extends V{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===v?void 0:e}}class Gt extends V{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==v)}}class Kt extends V{constructor(e,s,i,a,n){super(e,s,i,a,n),this.type=5}_$AI(e,s=this){if((e=E(this,e,s,0)??v)===C)return;const i=this._$AH,a=e===v&&i!==v||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==v&&(i===v||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 Qt{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){E(this,e)}}const Yt=K.litHtmlPolyfillSupport;Yt?.(H,P),(K.litHtmlVersions??=[]).push("3.3.2");const Xt=(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 P(e.insertBefore(D(),n),n,void 0,s??{})}return a._$AI(t),a};const Y=globalThis;class T extends k{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=Xt(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,Y.litElementHydrateSupport?.({LitElement:T});const te=Y.litElementPolyfillSupport;te?.({LitElement:T});(Y.litElementVersions??=[]).push("4.2.2");const ee=t=>(e,s)=>{s!==void 0?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)};const se={attribute:!0,type:String,converter:j,reflect:!1,hasChanged:G},ie=(t=se,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(u){const h=e.get.call(this);e.set.call(this,u),this.requestUpdate(r,h,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 h=this[r];e.call(this,u),this.requestUpdate(r,h,t,!0,u)}}throw Error("Unsupported decorator location: "+i)};function ae(t){return(e,s)=>typeof s=="object"?ie(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 ae({...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 oe(){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 ne(t){try{localStorage.setItem(bt,JSON.stringify(t))}catch{}}const re=[{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"},ce={dashboard:"Dashboard",chat:"Chat",cron:"Cron Jobs",activity:"Activity",sessions:"Sessions",assets:"Assets",projects:"Projects",workspace:"Workspace",skills:"Skills",logs:"Logs",config:"Config"},le={dashboard:"home",chat:"messageSquare",cron:"clock",activity:"activity",sessions:"fileText",assets:"package",projects:"folder",workspace:"edit",skills:"zap",logs:"terminal",config:"settings"},de={main:"Main",agent:"Agent",data:"Data",system:"System"};function he(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 ve(t){return le[t]}function ue(t){return ce[t]}function pe(t){return de[t]||t}function ge(){return typeof window>"u"||typeof window.matchMedia!="function"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function St(t){return t==="system"?ge():t}class ye{constructor(e=""){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{const a=await fetch(this.url("/api/chat"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e}),signal:i.signal});if(!a.ok||!a.body){s.onError?.(`HTTP ${a.status}: ${a.statusText}`);return}const n=a.body.getReader(),r=new TextDecoder;let u="";for(;;){const{done:h,value:f}=await n.read();if(h)break;u+=r.decode(f,{stream:!0});const m=u.split(`
|
|
4
|
+
`);u=m.pop()||"";for(const p of m){if(!p.startsWith("data: "))continue;const $=p.slice(6);if($==="[DONE]"){s.onDone?.({});continue}try{const y=JSON.parse($);y.type==="text_delta"||y.type==="content_block_delta"?s.onDelta(y.text||y.delta?.text||""):y.type==="tool_start"||y.type==="content_block_start"?s.onToolStart?.(y):y.type==="tool_end"||y.type==="content_block_stop"?s.onToolEnd?.(y):y.type==="message_stop"||y.type==="done"?s.onDone?.(y):y.type==="error"&&s.onError?.(y.error||"Unknown error")}catch{s.onDelta($)}}}s.onDone?.({})}catch(a){if(a.name==="AbortError")return;s.onError?.(a.message||"Stream error")}})(),{abort:()=>i.abort()}}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 ye;async function fe(t){try{t.serverStatus=await g.get("/api/status")}catch{t.serverStatus={status:"offline",version:"?",uptime:0,userId:"",sandboxId:""}}}async function _t(t){const[e,s,i,a]=await Promise.allSettled([g.get("/api/status"),g.get("/api/db/activity/stats"),g.get("/api/db/projects",{limit:"100"}),g.get("/api/db/activity",{limit:"5"})]);e.status==="fulfilled"&&(t.serverStatus=e.value),s.status==="fulfilled"&&(t.activityStats=s.value),i.status==="fulfilled"&&(t.projectCount=i.value.length,t.activeProject=i.value.find(n=>n.is_active)||null),a.status==="fulfilled"&&(t.recentActivity=a.value)}async function I(t){t.cronLoading=!0;try{t.cronJobs=await g.get("/api/cron/jobs")}catch{t.cronJobs=[]}t.cronLoading=!1}async function me(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 I(t)}catch(e){alert(`Failed to create job: ${e.message}`)}t.cronLoading=!1}async function $e(t,e){try{await g.post(`/api/cron/jobs/${e}/run`)}catch(s){alert(`Failed to run job: ${s.message}`)}}async function be(t,e){if(confirm("Delete this cron job?"))try{await g.del(`/api/cron/jobs/${e}`),await I(t)}catch(s){alert(`Failed to delete job: ${s.message}`)}}async function we(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 X(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 Se(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 X(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 xt(t){t.assetsLoading=!0;try{t.assetsList=await g.get("/api/db/assets",{limit:"100"})}catch{t.assetsList=[]}t.assetsLoading=!1}async function At(t){t.projectsLoading=!0;try{t.projectsList=await g.get("/api/db/projects",{limit:"100"})}catch{t.projectsList=[]}t.projectsLoading=!1}async function kt(t){t.sessionsLoading=!0;try{const e=await g.get("/api/sessions");t.sessionsList=e.sessions||[]}catch{t.sessionsList=[]}t.sessionsLoading=!1}async function xe(t,e){t.sessionDetailName=e;try{const s=await g.get("/api/session/messages");t.sessionDetail=s.messages||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 Ae(t,e){t.workspaceEditingFile=e;try{const s=await g.get("/api/workspace/file",{name:e});t.workspaceEditContent=s.content||""}catch{t.workspaceEditContent="(Failed to load file)"}}async function ke(t){t.workspaceSaving=!0;try{await g.put("/api/workspace/file",{name:t.workspaceEditingFile,content:t.workspaceEditContent})}catch(e){alert(`Failed to save: ${e.message}`)}t.workspaceSaving=!1}async function Et(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 Lt(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 Ce(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 Ee(t,e){if(e===t.tab)return;t.tab=e;const s=he(e);history.pushState(null,"",s),tt(t)}function Le(t,e){t.theme=e,t.themeResolved=St(e),Tt(t.themeResolved),t.settings={...t.settings,theme:e},ne(t.settings)}function Me(t){const e=wt(window.location.pathname);e&&e!==t.tab&&(t.tab=e,tt(t))}async function tt(t){switch(t.tab){case"dashboard":await _t(t);break;case"cron":await I(t);break;case"activity":await X(t);break;case"assets":await xt(t);break;case"projects":await At(t);break;case"sessions":await kt(t);break;case"workspace":await Ct(t);break;case"skills":await Et(t);break;case"config":await Lt(t),await Mt(t);break}}function Te(t){t.theme=t.settings.theme,t.themeResolved=St(t.theme),Tt(t.themeResolved);const e=wt(window.location.pathname);e&&(t.tab=e),fe(t),tt(t)}function De(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 Fe(t){return t.chatSending||t.chatLoading}async function He(t,e){const s=e||t.chatMessage.trim();!s||Fe(t)||(t.chatMessages=[...t.chatMessages,{role:"user",content:s}],t.chatMessage="",t.chatSending=!0,t.chatStream="",t.chatAbort=g.streamChat(s,{onDelta:i=>{t.chatStream=(t.chatStream||"")+i},onToolStart:i=>{},onToolEnd:i=>{},onDone:()=>{t.chatStream&&(t.chatMessages=[...t.chatMessages,{role:"assistant",content:t.chatStream}]),t.chatStream=null,t.chatSending=!1,t.chatAbort=null},onError:i=>{t.chatMessages=[...t.chatMessages,{role:"assistant",content:`Error: ${i}`}],t.chatStream=null,t.chatSending=!1,t.chatAbort=null}}))}function Pe(t){t.chatAbort?.abort(),t.chatStream=null,t.chatSending=!1,t.chatAbort=null}async function Oe(t,e){await He(t,e)}function Re(t){Pe(t)}const Be={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 N(t,e="nav-item__icon"){return o`<span class=${e} aria-hidden="true">${Be[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>`:v}
|
|
282
|
+
</div>
|
|
283
|
+
<div class="topbar__right">
|
|
284
|
+
${Je(t)}
|
|
285
|
+
<span class="topbar__status ${t.serverStatus?.status==="running"?"status--ok":""}">
|
|
286
|
+
${t.serverStatus?.status||"..."}
|
|
287
|
+
</span>
|
|
288
|
+
</div>
|
|
289
|
+
</header>
|
|
290
|
+
`}function je(t){return o`
|
|
291
|
+
<nav class="nav">
|
|
292
|
+
${re.map(e=>o`
|
|
293
|
+
<div class="nav-group">
|
|
294
|
+
<div class="nav-group__label">${pe(e.label)}</div>
|
|
295
|
+
${e.tabs.map(s=>Ue(t,s))}
|
|
296
|
+
</div>
|
|
297
|
+
`)}
|
|
298
|
+
</nav>
|
|
299
|
+
`}function Ue(t,e){return o`
|
|
300
|
+
<button
|
|
301
|
+
class="nav-item ${t.tab===e?"active":""}"
|
|
302
|
+
@click=${()=>t.setTab(e)}
|
|
303
|
+
>
|
|
304
|
+
${N(ve(e))}
|
|
305
|
+
<span>${ue(e)}</span>
|
|
306
|
+
</button>
|
|
307
|
+
`}function Je(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
|
+
${N("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
|
+
${N("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
|
+
${N("monitor","btn-icon")}
|
|
329
|
+
</button>
|
|
330
|
+
</div>
|
|
331
|
+
`}function A(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 et(t,e=120){return t.length<=e?t:`${t.slice(0,Math.max(0,e-1))}…`}function ze(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
|
+
${R("Status",t.serverStatus?.status||"...",t.serverStatus?.version?`v${t.serverStatus.version}`:"")}
|
|
336
|
+
${R("Uptime",t.serverStatus?.uptime?J(t.serverStatus.uptime*1e3):"...","")}
|
|
337
|
+
${R("Activities",t.activityStats?String(t.activityStats.total):"...",t.activityStats?`${t.activityStats.completed} completed, ${t.activityStats.failed} failed`:"")}
|
|
338
|
+
${R("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;">${A(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
|
+
`:v}
|
|
393
|
+
</div>
|
|
394
|
+
`}function R(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>`:v}
|
|
399
|
+
</div>
|
|
400
|
+
`}function Ve(t){return o`
|
|
401
|
+
<div class="chat-layout">
|
|
402
|
+
<!-- Messages -->
|
|
403
|
+
<div class="chat-messages" id="chat-messages">
|
|
404
|
+
${t.chatMessages.length===0&&!t.chatLoading?o`
|
|
405
|
+
<div class="empty-state">
|
|
406
|
+
<div class="empty-icon">💬</div>
|
|
407
|
+
<p>Send a message to start chatting with your agent.</p>
|
|
408
|
+
</div>
|
|
409
|
+
`:v}
|
|
410
|
+
|
|
411
|
+
${t.chatMessages.map(e=>Ie(e))}
|
|
412
|
+
|
|
413
|
+
${t.chatStream?o`
|
|
414
|
+
<div class="chat-msg chat-msg--assistant">
|
|
415
|
+
<div class="chat-msg__role">Assistant</div>
|
|
416
|
+
<div class="chat-msg__body">${t.chatStream}</div>
|
|
417
|
+
</div>
|
|
418
|
+
`:v}
|
|
419
|
+
|
|
420
|
+
${t.chatLoading&&!t.chatStream?o`<div class="chat-msg chat-msg--assistant"><div class="chat-msg__body"><span class="typing-indicator">Thinking...</span></div></div>`:v}
|
|
421
|
+
</div>
|
|
422
|
+
|
|
423
|
+
<!-- Compose -->
|
|
424
|
+
<div class="chat-compose">
|
|
425
|
+
<div class="chat-compose__inner">
|
|
426
|
+
<textarea
|
|
427
|
+
class="chat-input"
|
|
428
|
+
placeholder="Type a message..."
|
|
429
|
+
.value=${t.chatMessage}
|
|
430
|
+
@input=${e=>{t.chatMessage=e.target.value}}
|
|
431
|
+
@keydown=${e=>{e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),t.handleSendChat())}}
|
|
432
|
+
?disabled=${t.chatSending}
|
|
433
|
+
rows="1"
|
|
434
|
+
></textarea>
|
|
435
|
+
<div class="chat-compose__actions">
|
|
436
|
+
${t.chatSending?o`<button class="btn btn-sm btn-danger" @click=${()=>t.abortChat()}>Stop</button>`:o`<button class="btn btn-sm btn-primary" @click=${()=>t.handleSendChat()} ?disabled=${!t.chatMessage.trim()}>Send</button>`}
|
|
437
|
+
</div>
|
|
438
|
+
</div>
|
|
439
|
+
</div>
|
|
440
|
+
</div>
|
|
441
|
+
`}function Ie(t){const e=t.role==="user";return o`
|
|
442
|
+
<div class="chat-msg chat-msg--${t.role}">
|
|
443
|
+
<div class="chat-msg__role">${e?"You":"Assistant"}</div>
|
|
444
|
+
<div class="chat-msg__body">${t.content}</div>
|
|
445
|
+
${t.tool_calls&&Array.isArray(t.tool_calls)&&t.tool_calls.length>0?o`
|
|
446
|
+
<div class="chat-msg__tools">
|
|
447
|
+
${t.tool_calls.map(s=>o`
|
|
448
|
+
<div class="tool-card">
|
|
449
|
+
<div class="tool-card__name">${s.name||s.function?.name||"tool"}</div>
|
|
450
|
+
</div>
|
|
451
|
+
`)}
|
|
452
|
+
</div>
|
|
453
|
+
`:v}
|
|
454
|
+
</div>
|
|
455
|
+
`}function We(t){return o`
|
|
456
|
+
<div class="page-content">
|
|
457
|
+
<!-- Create Form -->
|
|
458
|
+
<div class="card">
|
|
459
|
+
<div class="card-header">
|
|
460
|
+
<h3>Create Cron Job</h3>
|
|
461
|
+
</div>
|
|
462
|
+
<div class="card-body" style="padding: 16px;">
|
|
463
|
+
<div class="form-grid">
|
|
464
|
+
<div class="form-field">
|
|
465
|
+
<label>Name</label>
|
|
466
|
+
<input type="text" class="input" placeholder="Job name" .value=${t.cronForm.name}
|
|
467
|
+
@input=${e=>{t.cronForm={...t.cronForm,name:e.target.value}}} />
|
|
468
|
+
</div>
|
|
469
|
+
<div class="form-field">
|
|
470
|
+
<label>Schedule Type</label>
|
|
471
|
+
<select class="input" .value=${t.cronForm.scheduleType}
|
|
472
|
+
@change=${e=>{t.cronForm={...t.cronForm,scheduleType:e.target.value}}}>
|
|
473
|
+
<option value="every">Every (interval)</option>
|
|
474
|
+
<option value="cron">Cron expression</option>
|
|
475
|
+
<option value="at">At (one-time)</option>
|
|
476
|
+
</select>
|
|
477
|
+
</div>
|
|
478
|
+
${t.cronForm.scheduleType==="every"?o`
|
|
479
|
+
<div class="form-field">
|
|
480
|
+
<label>Interval (e.g. 30m, 2h, 1d)</label>
|
|
481
|
+
<input type="text" class="input" placeholder="30m" .value=${t.cronForm.every}
|
|
482
|
+
@input=${e=>{t.cronForm={...t.cronForm,every:e.target.value}}} />
|
|
483
|
+
</div>
|
|
484
|
+
`:t.cronForm.scheduleType==="cron"?o`
|
|
485
|
+
<div class="form-field">
|
|
486
|
+
<label>Cron Expression</label>
|
|
487
|
+
<input type="text" class="input" placeholder="0 */6 * * *" .value=${t.cronForm.cronExpression}
|
|
488
|
+
@input=${e=>{t.cronForm={...t.cronForm,cronExpression:e.target.value}}} />
|
|
489
|
+
</div>
|
|
490
|
+
`:o`
|
|
491
|
+
<div class="form-field">
|
|
492
|
+
<label>Run At (ISO datetime)</label>
|
|
493
|
+
<input type="datetime-local" class="input" .value=${t.cronForm.at}
|
|
494
|
+
@input=${e=>{t.cronForm={...t.cronForm,at:e.target.value}}} />
|
|
495
|
+
</div>
|
|
496
|
+
`}
|
|
497
|
+
<div class="form-field" style="grid-column: 1 / -1;">
|
|
498
|
+
<label>Instruction</label>
|
|
499
|
+
<textarea class="input" rows="3" placeholder="What should the agent do?"
|
|
500
|
+
.value=${t.cronForm.instruction}
|
|
501
|
+
@input=${e=>{t.cronForm={...t.cronForm,instruction:e.target.value}}}></textarea>
|
|
502
|
+
</div>
|
|
503
|
+
<div>
|
|
504
|
+
<button class="btn btn-primary" @click=${()=>t.createCronJob()} ?disabled=${t.cronLoading}>
|
|
505
|
+
Create Job
|
|
506
|
+
</button>
|
|
507
|
+
</div>
|
|
508
|
+
</div>
|
|
509
|
+
</div>
|
|
510
|
+
</div>
|
|
511
|
+
|
|
512
|
+
<!-- Jobs List -->
|
|
513
|
+
<div class="card">
|
|
514
|
+
<div class="card-header">
|
|
515
|
+
<h3>Cron Jobs</h3>
|
|
516
|
+
<button class="btn btn-sm" @click=${()=>t.loadCronJobs()}>Refresh</button>
|
|
517
|
+
</div>
|
|
518
|
+
${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`
|
|
519
|
+
<div class="table-wrap">
|
|
520
|
+
<table>
|
|
521
|
+
<thead>
|
|
522
|
+
<tr><th>Name</th><th>Schedule</th><th>Status</th><th>Next Run</th><th>Instruction</th><th>Actions</th></tr>
|
|
523
|
+
</thead>
|
|
524
|
+
<tbody>
|
|
525
|
+
${t.cronJobs.map(e=>qe(t,e))}
|
|
526
|
+
</tbody>
|
|
527
|
+
</table>
|
|
528
|
+
</div>
|
|
529
|
+
`}
|
|
530
|
+
</div>
|
|
531
|
+
</div>
|
|
532
|
+
`}function qe(t,e){const s=Ze(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`
|
|
533
|
+
<tr>
|
|
534
|
+
<td><strong>${e.name}</strong></td>
|
|
535
|
+
<td><code>${s}</code></td>
|
|
536
|
+
<td>${i}</td>
|
|
537
|
+
<td>${e.next_run_at?A(e.next_run_at):"--"}</td>
|
|
538
|
+
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
539
|
+
${(e.instruction||"").substring(0,80)}
|
|
540
|
+
</td>
|
|
541
|
+
<td style="white-space: nowrap;">
|
|
542
|
+
<button class="btn btn-sm btn-primary" @click=${()=>t.runCronJob(e.id)}>Run</button>
|
|
543
|
+
<button class="btn btn-sm" @click=${()=>t.showCronHistory(e.id,e.name)}>History</button>
|
|
544
|
+
<button class="btn btn-sm btn-danger" @click=${()=>t.deleteCronJob(e.id)}>Delete</button>
|
|
545
|
+
</td>
|
|
546
|
+
</tr>
|
|
547
|
+
`}function Ze(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 Ge(t){return o`
|
|
548
|
+
<div class="page-content">
|
|
549
|
+
<!-- Stats Bar -->
|
|
550
|
+
${t.activityStats?o`
|
|
551
|
+
<div class="stats-row">
|
|
552
|
+
<div class="stat-card"><div class="stat-label">Total</div><div class="stat-value">${t.activityStats.total}</div></div>
|
|
553
|
+
<div class="stat-card"><div class="stat-label">Completed</div><div class="stat-value" style="color: var(--ok);">${t.activityStats.completed}</div></div>
|
|
554
|
+
<div class="stat-card"><div class="stat-label">Failed</div><div class="stat-value" style="color: var(--danger);">${t.activityStats.failed}</div></div>
|
|
555
|
+
<div class="stat-card"><div class="stat-label">Avg Duration</div><div class="stat-value">${J(t.activityStats.avgDuration||0)}</div></div>
|
|
556
|
+
</div>
|
|
557
|
+
`:v}
|
|
558
|
+
|
|
559
|
+
<!-- Toolbar -->
|
|
560
|
+
<div class="toolbar">
|
|
561
|
+
<input type="text" class="input" placeholder="Search activity..."
|
|
562
|
+
style="max-width: 300px;"
|
|
563
|
+
.value=${t.activitySearch}
|
|
564
|
+
@input=${e=>{t.activitySearch=e.target.value}}
|
|
565
|
+
@keydown=${e=>{e.key==="Enter"&&t.searchActivity()}} />
|
|
566
|
+
<select class="input" style="max-width: 150px;"
|
|
567
|
+
.value=${t.activityStatusFilter}
|
|
568
|
+
@change=${e=>{t.activityStatusFilter=e.target.value,t.loadActivity()}}>
|
|
569
|
+
<option value="">All Status</option>
|
|
570
|
+
<option value="completed">Completed</option>
|
|
571
|
+
<option value="pending">Pending</option>
|
|
572
|
+
<option value="failed">Failed</option>
|
|
573
|
+
</select>
|
|
574
|
+
<button class="btn btn-sm" @click=${()=>t.loadActivity()}>Refresh</button>
|
|
575
|
+
</div>
|
|
576
|
+
|
|
577
|
+
<!-- Table -->
|
|
578
|
+
<div class="card">
|
|
579
|
+
<div class="card-header">
|
|
580
|
+
<h3>Activity Log</h3>
|
|
581
|
+
</div>
|
|
582
|
+
${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`
|
|
583
|
+
<div class="table-wrap">
|
|
584
|
+
<table>
|
|
585
|
+
<thead>
|
|
586
|
+
<tr><th>Time</th><th>Request</th><th>Status</th><th>Executor</th><th>Duration</th></tr>
|
|
587
|
+
</thead>
|
|
588
|
+
<tbody>
|
|
589
|
+
${t.activityList.map(e=>Ke(t,e))}
|
|
590
|
+
</tbody>
|
|
591
|
+
</table>
|
|
592
|
+
</div>
|
|
593
|
+
${t.activityHasMore?o`<div style="padding: 16px; text-align: center;"><button class="btn btn-sm" @click=${()=>t.loadMoreActivity()}>Load More</button></div>`:v}
|
|
594
|
+
`}
|
|
595
|
+
</div>
|
|
596
|
+
</div>
|
|
597
|
+
|
|
598
|
+
<!-- Detail Modal -->
|
|
599
|
+
${t.activityDetail?o`
|
|
600
|
+
<div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.activityDetail=null)}}>
|
|
601
|
+
<div class="modal" style="max-width: 800px;">
|
|
602
|
+
<div class="modal-header">
|
|
603
|
+
<h3>Activity Detail</h3>
|
|
604
|
+
<button class="btn btn-sm" @click=${()=>{t.activityDetail=null}}>Close</button>
|
|
605
|
+
</div>
|
|
606
|
+
<div class="modal-body">
|
|
607
|
+
<div class="config-list">
|
|
608
|
+
<div class="config-row"><span class="config-key">ID</span><span class="config-value"><code>${t.activityDetail.id}</code></span></div>
|
|
609
|
+
<div class="config-row"><span class="config-key">Status</span><span class="config-value">${t.activityDetail.status}</span></div>
|
|
610
|
+
<div class="config-row"><span class="config-key">Executor</span><span class="config-value">${t.activityDetail.executor}</span></div>
|
|
611
|
+
<div class="config-row"><span class="config-key">Created</span><span class="config-value">${new Date(t.activityDetail.created_at).toLocaleString()}</span></div>
|
|
612
|
+
${t.activityDetail.duration?o`<div class="config-row"><span class="config-key">Duration</span><span class="config-value">${J(t.activityDetail.duration)}</span></div>`:v}
|
|
613
|
+
${t.activityDetail.keywords?o`<div class="config-row"><span class="config-key">Keywords</span><span class="config-value">${t.activityDetail.keywords}</span></div>`:v}
|
|
614
|
+
</div>
|
|
615
|
+
<h4 style="margin-top: 16px;">Request</h4>
|
|
616
|
+
<pre class="code-block">${t.activityDetail.request||"(empty)"}</pre>
|
|
617
|
+
${t.activityDetail.response?o`<h4 style="margin-top: 16px;">Response</h4><pre class="code-block">${t.activityDetail.response}</pre>`:v}
|
|
618
|
+
${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>`:v}
|
|
619
|
+
</div>
|
|
620
|
+
</div>
|
|
621
|
+
</div>
|
|
622
|
+
`:v}
|
|
623
|
+
`}function Ke(t,e){return o`
|
|
624
|
+
<tr style="cursor: pointer;" @click=${()=>{t.activityDetail=e}}>
|
|
625
|
+
<td style="white-space: nowrap;">${A(e.created_at)}</td>
|
|
626
|
+
<td style="max-width: 400px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
627
|
+
${et(e.request||"",80)}
|
|
628
|
+
</td>
|
|
629
|
+
<td>
|
|
630
|
+
<span class="tag ${e.status==="completed"?"tag-green":e.status==="failed"?"tag-red":"tag-yellow"}">${e.status}</span>
|
|
631
|
+
</td>
|
|
632
|
+
<td>
|
|
633
|
+
<span class="tag ${e.executor==="client"?"tag-blue":"tag-muted"}">${e.executor}</span>
|
|
634
|
+
</td>
|
|
635
|
+
<td>${e.duration?J(e.duration):"--"}</td>
|
|
636
|
+
</tr>
|
|
637
|
+
`}function Qe(t){const e=t.assetTypeFilter?t.assetsList.filter(s=>s.type===t.assetTypeFilter):t.assetsList;return o`
|
|
638
|
+
<div class="page-content">
|
|
639
|
+
<div class="toolbar">
|
|
640
|
+
<select class="input" style="max-width: 150px;"
|
|
641
|
+
.value=${t.assetTypeFilter}
|
|
642
|
+
@change=${s=>{t.assetTypeFilter=s.target.value}}>
|
|
643
|
+
<option value="">All Types</option>
|
|
644
|
+
<option value="image">Image</option>
|
|
645
|
+
<option value="document">Document</option>
|
|
646
|
+
<option value="audio">Audio</option>
|
|
647
|
+
<option value="video">Video</option>
|
|
648
|
+
<option value="code">Code</option>
|
|
649
|
+
<option value="other">Other</option>
|
|
650
|
+
</select>
|
|
651
|
+
<button class="btn btn-sm" @click=${()=>t.loadAssets()}>Refresh</button>
|
|
652
|
+
<span class="muted-text" style="margin-left: auto;">${e.length} assets</span>
|
|
653
|
+
</div>
|
|
654
|
+
|
|
655
|
+
<div class="card">
|
|
656
|
+
<div class="card-header"><h3>Assets</h3></div>
|
|
657
|
+
${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`
|
|
658
|
+
<div class="table-wrap">
|
|
659
|
+
<table>
|
|
660
|
+
<thead><tr><th>Name</th><th>Type</th><th>Path / URL</th><th>Created</th></tr></thead>
|
|
661
|
+
<tbody>
|
|
662
|
+
${e.map(s=>o`
|
|
663
|
+
<tr>
|
|
664
|
+
<td>
|
|
665
|
+
<strong>${s.name}</strong>
|
|
666
|
+
${s.description?o`<br /><span class="muted-text">${et(s.description,60)}</span>`:v}
|
|
667
|
+
</td>
|
|
668
|
+
<td><span class="tag tag-blue">${s.type||"unknown"}</span></td>
|
|
669
|
+
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
670
|
+
${s.remote_url||s.local_file_path||"--"}
|
|
671
|
+
</td>
|
|
672
|
+
<td style="white-space: nowrap;">${A(s.created_at)}</td>
|
|
673
|
+
</tr>
|
|
674
|
+
`)}
|
|
675
|
+
</tbody>
|
|
676
|
+
</table>
|
|
677
|
+
</div>
|
|
678
|
+
`}
|
|
679
|
+
</div>
|
|
680
|
+
</div>
|
|
681
|
+
`}function Ye(t){return o`
|
|
682
|
+
<div class="page-content">
|
|
683
|
+
<div class="card">
|
|
684
|
+
<div class="card-header">
|
|
685
|
+
<h3>Projects</h3>
|
|
686
|
+
<button class="btn btn-sm" @click=${()=>t.loadProjects()}>Refresh</button>
|
|
687
|
+
</div>
|
|
688
|
+
${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`
|
|
689
|
+
<div class="table-wrap">
|
|
690
|
+
<table>
|
|
691
|
+
<thead><tr><th>Name</th><th>Description</th><th>Path</th><th>Status</th><th>Created</th></tr></thead>
|
|
692
|
+
<tbody>
|
|
693
|
+
${t.projectsList.map(e=>o`
|
|
694
|
+
<tr style="${e.is_active?"border-left: 3px solid var(--ok);":""}">
|
|
695
|
+
<td><strong>${e.name}</strong></td>
|
|
696
|
+
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
697
|
+
${et(e.description||"",80)}
|
|
698
|
+
</td>
|
|
699
|
+
<td><code>${e.project_path||"--"}</code></td>
|
|
700
|
+
<td>
|
|
701
|
+
${e.is_active?o`<span class="tag tag-green">Active</span>`:o`<span class="tag tag-muted">Inactive</span>`}
|
|
702
|
+
</td>
|
|
703
|
+
<td style="white-space: nowrap;">${A(e.created_at)}</td>
|
|
704
|
+
</tr>
|
|
705
|
+
`)}
|
|
706
|
+
</tbody>
|
|
707
|
+
</table>
|
|
708
|
+
</div>
|
|
709
|
+
`}
|
|
710
|
+
</div>
|
|
711
|
+
</div>
|
|
712
|
+
`}function Xe(t){return o`
|
|
713
|
+
<div class="page-content">
|
|
714
|
+
<div class="card">
|
|
715
|
+
<div class="card-header">
|
|
716
|
+
<h3>Sessions</h3>
|
|
717
|
+
<button class="btn btn-sm" @click=${()=>t.loadSessions()}>Refresh</button>
|
|
718
|
+
</div>
|
|
719
|
+
${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`
|
|
720
|
+
<div class="table-wrap">
|
|
721
|
+
<table>
|
|
722
|
+
<thead><tr><th>Name</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
|
|
723
|
+
<tbody>
|
|
724
|
+
${t.sessionsList.map(e=>o`
|
|
725
|
+
<tr>
|
|
726
|
+
<td><code>${e.name}</code></td>
|
|
727
|
+
<td>${ts(e.size)}</td>
|
|
728
|
+
<td>${e.modified?A(e.modified):"--"}</td>
|
|
729
|
+
<td>
|
|
730
|
+
<button class="btn btn-sm" @click=${()=>t.viewSession(e.name)}>View</button>
|
|
731
|
+
</td>
|
|
732
|
+
</tr>
|
|
733
|
+
`)}
|
|
734
|
+
</tbody>
|
|
735
|
+
</table>
|
|
736
|
+
</div>
|
|
737
|
+
`}
|
|
738
|
+
</div>
|
|
739
|
+
|
|
740
|
+
${t.sessionDetail?o`
|
|
741
|
+
<div class="card">
|
|
742
|
+
<div class="card-header">
|
|
743
|
+
<h3>${t.sessionDetailName}</h3>
|
|
744
|
+
<button class="btn btn-sm" @click=${()=>{t.sessionDetail=null,t.sessionDetailName=""}}>Close</button>
|
|
745
|
+
</div>
|
|
746
|
+
<div class="card-body" style="padding: 16px;">
|
|
747
|
+
<div class="chat-messages" style="max-height: 500px; overflow-y: auto;">
|
|
748
|
+
${t.sessionDetail.map(e=>o`
|
|
749
|
+
<div class="chat-msg chat-msg--${e.role}">
|
|
750
|
+
<div class="chat-msg__role">${e.role==="user"?"User":e.role==="assistant"?"Assistant":"System"}</div>
|
|
751
|
+
<div class="chat-msg__body">${typeof e.content=="string"?e.content:JSON.stringify(e.content)}</div>
|
|
752
|
+
</div>
|
|
753
|
+
`)}
|
|
754
|
+
</div>
|
|
755
|
+
</div>
|
|
756
|
+
</div>
|
|
757
|
+
`:v}
|
|
758
|
+
</div>
|
|
759
|
+
`}function ts(t){return t<1024?`${t}B`:t<1024*1024?`${(t/1024).toFixed(1)}KB`:`${(t/(1024*1024)).toFixed(1)}MB`}function es(t){return o`
|
|
760
|
+
<div class="page-content">
|
|
761
|
+
<div class="card">
|
|
762
|
+
<div class="card-header">
|
|
763
|
+
<h3>Workspace Files</h3>
|
|
764
|
+
<button class="btn btn-sm" @click=${()=>t.loadWorkspaceFiles()}>Refresh</button>
|
|
765
|
+
</div>
|
|
766
|
+
${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`
|
|
767
|
+
<div class="table-wrap">
|
|
768
|
+
<table>
|
|
769
|
+
<thead><tr><th>File</th><th>Size</th><th>Modified</th><th>Actions</th></tr></thead>
|
|
770
|
+
<tbody>
|
|
771
|
+
${t.workspaceFiles.map(e=>o`
|
|
772
|
+
<tr class="${t.workspaceEditingFile===e.name?"row-active":""}">
|
|
773
|
+
<td><code>${e.name}</code></td>
|
|
774
|
+
<td>${e.size}B</td>
|
|
775
|
+
<td>${e.modified?A(e.modified):"--"}</td>
|
|
776
|
+
<td>
|
|
777
|
+
<button class="btn btn-sm" @click=${()=>t.editWorkspaceFile(e.name)}>
|
|
778
|
+
${t.workspaceEditingFile===e.name?"Refresh":"Edit"}
|
|
779
|
+
</button>
|
|
780
|
+
</td>
|
|
781
|
+
</tr>
|
|
782
|
+
`)}
|
|
783
|
+
</tbody>
|
|
784
|
+
</table>
|
|
785
|
+
</div>
|
|
786
|
+
`}
|
|
787
|
+
</div>
|
|
788
|
+
|
|
789
|
+
${t.workspaceEditingFile?o`
|
|
790
|
+
<div class="card">
|
|
791
|
+
<div class="card-header">
|
|
792
|
+
<h3>${t.workspaceEditingFile}</h3>
|
|
793
|
+
<div style="display: flex; gap: 8px;">
|
|
794
|
+
<button class="btn btn-sm btn-primary" @click=${()=>t.saveWorkspaceFile()} ?disabled=${t.workspaceSaving}>
|
|
795
|
+
${t.workspaceSaving?"Saving...":"Save"}
|
|
796
|
+
</button>
|
|
797
|
+
<button class="btn btn-sm" @click=${()=>{t.workspaceEditingFile="",t.workspaceEditContent=""}}>Close</button>
|
|
798
|
+
</div>
|
|
799
|
+
</div>
|
|
800
|
+
<div class="card-body" style="padding: 0;">
|
|
801
|
+
<textarea
|
|
802
|
+
class="workspace-editor"
|
|
803
|
+
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;"
|
|
804
|
+
.value=${t.workspaceEditContent}
|
|
805
|
+
@input=${e=>{t.workspaceEditContent=e.target.value}}
|
|
806
|
+
></textarea>
|
|
807
|
+
</div>
|
|
808
|
+
</div>
|
|
809
|
+
`:v}
|
|
810
|
+
</div>
|
|
811
|
+
`}function ss(t){return o`
|
|
812
|
+
<div class="page-content">
|
|
813
|
+
<div class="card">
|
|
814
|
+
<div class="card-header">
|
|
815
|
+
<h3>Skills</h3>
|
|
816
|
+
<button class="btn btn-sm" @click=${()=>t.loadSkills()}>Refresh</button>
|
|
817
|
+
</div>
|
|
818
|
+
${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 registered</p></div>`:o`
|
|
819
|
+
<div class="table-wrap">
|
|
820
|
+
<table>
|
|
821
|
+
<thead><tr><th>Name</th><th>Description</th><th>Status</th></tr></thead>
|
|
822
|
+
<tbody>
|
|
823
|
+
${t.skillsList.map(e=>o`
|
|
824
|
+
<tr>
|
|
825
|
+
<td><strong>${e.name}</strong></td>
|
|
826
|
+
<td>${e.description}</td>
|
|
827
|
+
<td>
|
|
828
|
+
${e.enabled?o`<span class="tag tag-green">Enabled</span>`:o`<span class="tag tag-muted">Disabled</span>`}
|
|
829
|
+
</td>
|
|
830
|
+
</tr>
|
|
831
|
+
`)}
|
|
832
|
+
</tbody>
|
|
833
|
+
</table>
|
|
834
|
+
</div>
|
|
835
|
+
`}
|
|
836
|
+
</div>
|
|
837
|
+
</div>
|
|
838
|
+
`}function is(t){return o`
|
|
839
|
+
<div class="page-content">
|
|
840
|
+
<div class="toolbar">
|
|
841
|
+
<label style="display: flex; align-items: center; gap: 8px;">
|
|
842
|
+
<input type="checkbox" ?checked=${t.logStreaming}
|
|
843
|
+
@change=${e=>{e.target.checked?t.startLogStream():t.stopLogStream()}} />
|
|
844
|
+
Live streaming
|
|
845
|
+
</label>
|
|
846
|
+
<select class="input" style="max-width: 150px;"
|
|
847
|
+
.value=${t.logFilter}
|
|
848
|
+
@change=${e=>{t.logFilter=e.target.value}}>
|
|
849
|
+
<option value="">All levels</option>
|
|
850
|
+
<option value="error">Errors only</option>
|
|
851
|
+
<option value="warn">Warnings+</option>
|
|
852
|
+
</select>
|
|
853
|
+
<button class="btn btn-sm" @click=${()=>{t.logEntries=[]}}>Clear</button>
|
|
854
|
+
<span class="muted-text" style="margin-left: auto;">${t.logEntries.length} entries</span>
|
|
855
|
+
</div>
|
|
856
|
+
|
|
857
|
+
<div class="card">
|
|
858
|
+
<div class="card-header"><h3>Server Logs</h3></div>
|
|
859
|
+
<div class="log-container" style="max-height: 600px; overflow-y: auto; padding: 0;">
|
|
860
|
+
${ut(t).length===0?o`<div class="empty-state"><div class="empty-icon">📋</div><p>${t.logStreaming?"Waiting for log entries...":"Start streaming to see logs"}</p></div>`:o`
|
|
861
|
+
<pre class="log-pre" style="margin: 0; padding: 16px; font-size: 12px; line-height: 1.6; white-space: pre-wrap; word-break: break-all;">${ut(t).map(e=>as(e)).join(`
|
|
862
|
+
`)}</pre>
|
|
863
|
+
`}
|
|
864
|
+
</div>
|
|
865
|
+
</div>
|
|
866
|
+
</div>
|
|
867
|
+
`}function ut(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":!0}):t.logEntries}function as(t){if(typeof t=="string")return t;const e=t.timestamp?new Date(t.timestamp).toLocaleTimeString():"",s=t.level||"info",i=t.component?`[${t.component}]`:"",a=t.message||JSON.stringify(t);return`${e} ${s.toUpperCase().padEnd(5)} ${i} ${a}`}function os(t){return o`
|
|
868
|
+
<div class="page-content">
|
|
869
|
+
<!-- Server Config -->
|
|
870
|
+
<div class="card">
|
|
871
|
+
<div class="card-header">
|
|
872
|
+
<h3>Server Configuration</h3>
|
|
873
|
+
<button class="btn btn-sm" @click=${()=>t.loadConfig()}>Refresh</button>
|
|
874
|
+
</div>
|
|
875
|
+
${t.configLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:o`
|
|
876
|
+
<div class="config-list" style="padding: 16px;">
|
|
877
|
+
${Object.entries(t.configData).map(([e,s])=>o`
|
|
878
|
+
<div class="config-row">
|
|
879
|
+
<span class="config-key">${e}</span>
|
|
880
|
+
<span class="config-value">${String(s)}</span>
|
|
881
|
+
</div>
|
|
882
|
+
`)}
|
|
883
|
+
</div>
|
|
884
|
+
`}
|
|
885
|
+
</div>
|
|
886
|
+
|
|
887
|
+
<!-- Environment Variables -->
|
|
888
|
+
<div class="card">
|
|
889
|
+
<div class="card-header">
|
|
890
|
+
<h3>Environment Variables</h3>
|
|
891
|
+
<div style="display: flex; gap: 8px;">
|
|
892
|
+
<button class="btn btn-sm" @click=${()=>t.loadEnv()}>Refresh</button>
|
|
893
|
+
</div>
|
|
894
|
+
</div>
|
|
895
|
+
${t.envLoading?o`<div class="loading-center"><div class="spinner"></div></div>`:o`
|
|
896
|
+
<div class="config-list" style="padding: 16px;">
|
|
897
|
+
${Object.entries(t.envData).map(([e,s])=>o`
|
|
898
|
+
<div class="config-row">
|
|
899
|
+
<span class="config-key">${e}</span>
|
|
900
|
+
<span class="config-value">
|
|
901
|
+
${ns(e)?rs(String(s)):String(s)}
|
|
902
|
+
</span>
|
|
903
|
+
</div>
|
|
904
|
+
`)}
|
|
905
|
+
${Object.keys(t.envData).length===0?o`<p class="muted-text">No environment variables loaded</p>`:v}
|
|
906
|
+
</div>
|
|
907
|
+
`}
|
|
908
|
+
</div>
|
|
909
|
+
|
|
910
|
+
<!-- UI Settings -->
|
|
911
|
+
<div class="card">
|
|
912
|
+
<div class="card-header"><h3>UI Settings</h3></div>
|
|
913
|
+
<div class="config-list" style="padding: 16px;">
|
|
914
|
+
<div class="config-row">
|
|
915
|
+
<span class="config-key">Theme</span>
|
|
916
|
+
<span class="config-value">
|
|
917
|
+
<select class="input" style="width: auto;"
|
|
918
|
+
.value=${t.theme}
|
|
919
|
+
@change=${e=>{t.setTheme(e.target.value)}}>
|
|
920
|
+
<option value="system">System</option>
|
|
921
|
+
<option value="dark">Dark</option>
|
|
922
|
+
<option value="light">Light</option>
|
|
923
|
+
</select>
|
|
924
|
+
</span>
|
|
925
|
+
</div>
|
|
926
|
+
</div>
|
|
927
|
+
</div>
|
|
928
|
+
|
|
929
|
+
<!-- Self Update -->
|
|
930
|
+
<div class="card">
|
|
931
|
+
<div class="card-header"><h3>Server Update</h3></div>
|
|
932
|
+
<div class="card-body" style="padding: 16px;">
|
|
933
|
+
<button class="btn btn-primary" @click=${()=>t.selfUpdate()} ?disabled=${t.updating}>
|
|
934
|
+
${t.updating?"Updating...":"Update Server"}
|
|
935
|
+
</button>
|
|
936
|
+
${t.updateResult?o`<pre class="code-block" style="margin-top: 12px;">${t.updateResult}</pre>`:v}
|
|
937
|
+
</div>
|
|
938
|
+
</div>
|
|
939
|
+
</div>
|
|
940
|
+
`}function ns(t){const e=t.toLowerCase();return e.includes("key")||e.includes("secret")||e.includes("token")||e.includes("password")}function rs(t){return!t||t.length<8?"***":t.substring(0,6)+"..."+t.substring(t.length-4)}function cs(t){return o`
|
|
941
|
+
<div class="shell">
|
|
942
|
+
${Ne(t)}
|
|
943
|
+
${je(t)}
|
|
944
|
+
|
|
945
|
+
<main class="content">
|
|
946
|
+
${ls(t)}
|
|
947
|
+
</main>
|
|
948
|
+
</div>
|
|
949
|
+
|
|
950
|
+
${ds(t)}
|
|
951
|
+
`}function ls(t){switch(t.tab){case"dashboard":return ze(t);case"chat":return Ve(t);case"cron":return We(t);case"activity":return Ge(t);case"assets":return Qe(t);case"projects":return Ye(t);case"sessions":return Xe(t);case"workspace":return es(t);case"skills":return ss(t);case"logs":return is(t);case"config":return os(t);default:return o`<p>Unknown page</p>`}}function ds(t){return t.cronHistoryOpen?o`
|
|
952
|
+
<div class="modal-overlay open" @click=${e=>{e.target===e.currentTarget&&(t.cronHistoryOpen=!1)}}>
|
|
953
|
+
<div class="modal" style="max-width: 700px;">
|
|
954
|
+
<div class="modal-header">
|
|
955
|
+
<h3>History: ${t.cronHistoryJob}</h3>
|
|
956
|
+
<button class="btn btn-sm" @click=${()=>{t.cronHistoryOpen=!1}}>Close</button>
|
|
957
|
+
</div>
|
|
958
|
+
<div class="modal-body">
|
|
959
|
+
${t.cronHistory.length===0?o`<p class="muted-text">No run history</p>`:o`
|
|
960
|
+
<div class="table-wrap">
|
|
961
|
+
<table>
|
|
962
|
+
<thead>
|
|
963
|
+
<tr><th>Time</th><th>Status</th><th>Duration</th><th>Summary</th></tr>
|
|
964
|
+
</thead>
|
|
965
|
+
<tbody>
|
|
966
|
+
${t.cronHistory.map(e=>o`
|
|
967
|
+
<tr>
|
|
968
|
+
<td>${new Date(e.startedAt).toLocaleString()}</td>
|
|
969
|
+
<td>
|
|
970
|
+
<span class="tag ${e.status==="ok"?"tag-green":e.status==="error"?"tag-red":"tag-yellow"}">
|
|
971
|
+
${e.status}
|
|
972
|
+
</span>
|
|
973
|
+
</td>
|
|
974
|
+
<td>${e.duration?`${(e.duration/1e3).toFixed(1)}s`:"--"}</td>
|
|
975
|
+
<td style="max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">
|
|
976
|
+
${e.summary||e.error||"--"}
|
|
977
|
+
</td>
|
|
978
|
+
</tr>
|
|
979
|
+
`)}
|
|
980
|
+
</tbody>
|
|
981
|
+
</table>
|
|
982
|
+
</div>
|
|
983
|
+
`}
|
|
984
|
+
</div>
|
|
985
|
+
</div>
|
|
986
|
+
</div>
|
|
987
|
+
`:v}function hs(t){t.logStreaming=!0,t.logStream=g.streamLogs({onLog:e=>{t.logEntries=[...t.logEntries.slice(-500),e]},onError:()=>{t.logStreaming=!1}})}function vs(t){t.logStream?.close(),t.logStream=null,t.logStreaming=!1}var us=Object.defineProperty,ps=Object.getOwnPropertyDescriptor,l=(t,e,s,i)=>{for(var a=i>1?void 0:i?ps(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&&us(e,s,a),a};let c=class extends T{constructor(){super(...arguments),this.settings=oe(),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.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=()=>Me(this),window.addEventListener("popstate",this.popStateHandler),Te(this)}disconnectedCallback(){De(this),super.disconnectedCallback()}setTab(t){Ee(this,t)}setTheme(t){Le(this,t)}async handleSendChat(t){await Oe(this,t)}abortChat(){Re(this)}async loadDashboard(){await _t(this)}async loadCronJobs(){await I(this)}async createCronJob(){await me(this)}async runCronJob(t){await $e(this,t)}async deleteCronJob(t){await be(this,t)}async showCronHistory(t,e){await we(this,t,e)}async loadActivity(){await X(this)}async loadMoreActivity(){await Se(this)}async searchActivity(){await _e(this)}async loadAssets(){await xt(this)}async loadProjects(){await At(this)}async loadSessions(){await kt(this)}async viewSession(t){await xe(this,t)}async loadWorkspaceFiles(){await Ct(this)}async editWorkspaceFile(t){await Ae(this,t)}async saveWorkspaceFile(){await ke(this)}async loadSkills(){await Et(this)}startLogStream(){hs(this)}stopLogStream(){vs(this)}async loadConfig(){await Lt(this)}async loadEnv(){await Mt(this)}async selfUpdate(){await Ce(this)}render(){return cs(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,"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([ee("costar-app")],c);
|
|
988
|
+
//# sourceMappingURL=index-ChihPAzQ.js.map
|