heyio 1.10.2 → 1.10.4
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/web-dist/assets/{AuditLogView-D-TR4QEf.js → AuditLogView-5L1vXh9l.js} +1 -1
- package/web-dist/assets/ChatView-BmoUBfcQ.js +1 -0
- package/web-dist/assets/{FeedView-C16VqFS3.js → FeedView-xBZRxsAN.js} +1 -1
- package/web-dist/assets/{HistoryView-Du-QjU6l.js → HistoryView-CsEnqHvS.js} +1 -1
- package/web-dist/assets/{LoginView-CkT2M3h6.js → LoginView-D_oXjfQ0.js} +1 -1
- package/web-dist/assets/McpView-DcfHvkG-.js +1 -0
- package/web-dist/assets/{SchedulesView-BIzelIDc.js → SchedulesView-BKjd8mJY.js} +1 -1
- package/web-dist/assets/SettingsView-CQUKuTB1.js +1 -0
- package/web-dist/assets/{SkillsView-DI6NCm-G.js → SkillsView-B3tgbASM.js} +4 -4
- package/web-dist/assets/{SquadDetailView-699-2QFO.js → SquadDetailView-UmzQrE0j.js} +3 -3
- package/web-dist/assets/{SquadHealthView-CbhfwEVa.js → SquadHealthView-hqEZEHLz.js} +1 -1
- package/web-dist/assets/{SquadsView-Cyaa0a9N.js → SquadsView-t4Q9TWhX.js} +1 -1
- package/web-dist/assets/{ToggleSwitch.vue_vue_type_script_setup_true_lang-n8hmSlBi.js → ToggleSwitch.vue_vue_type_script_setup_true_lang-YaARv5SW.js} +1 -1
- package/web-dist/assets/{UsageView-kBQyW8qW.js → UsageView-BPNGL60Q.js} +1 -1
- package/web-dist/assets/{WikiView-CMM8qxZK.js → WikiView-D37JXznF.js} +2 -2
- package/web-dist/assets/{api-zy1AKNA-.js → api-BGxJOfVN.js} +1 -1
- package/web-dist/assets/{arrow-left-Bgsec4Ra.js → arrow-left-1DJHiwpX.js} +1 -1
- package/web-dist/assets/{git-branch-DkKvd9av.js → git-branch-D3wum5zq.js} +1 -1
- package/web-dist/assets/{index-OMG9Hl-W.js → index-DEUF9X23.js} +68 -68
- package/web-dist/assets/index-vcgp2T40.css +1 -0
- package/web-dist/assets/{plus-BKIC7dvz.js → plus-DhL0273d.js} +1 -1
- package/web-dist/assets/{save-C3fM1e5H.js → save-D52JPmEZ.js} +1 -1
- package/web-dist/assets/{search-Ca-tepTt.js → search-CEJRBdSx.js} +1 -1
- package/web-dist/assets/{trash-2-BRXKqOeV.js → trash-2-Cpb3QlxJ.js} +1 -1
- package/web-dist/assets/{triangle-alert-BHPhP5sg.js → triangle-alert-DHJYF3lH.js} +1 -1
- package/web-dist/assets/x-yR_yShVB.js +6 -0
- package/web-dist/index.html +2 -2
- package/web-dist/assets/ChatView-D9PirkGv.js +0 -1
- package/web-dist/assets/McpView-D5b7JtfP.js +0 -1
- package/web-dist/assets/SettingsView-Cldsrn1O.js +0 -1
- package/web-dist/assets/index-DY08f1bR.css +0 -1
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,
|
|
1
|
+
import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,a4 as f,$ as T,d as h,L as w,a0 as L,p as b,K as n,m as _,z as ee}from"./index-DEUF9X23.js";import{b as F}from"./api-BGxJOfVN.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as H,W as O,a2 as z,E as U,J as a,q as r,n as o,T as t,t as w,p as m,d as T,L as A,R as d,w as g,M as X,f as W,P as Y,a4 as J,a0 as Q,o as f,S as R,j as G,z as b,K as v,m as B,v as Z,a1 as ee,_ as te,x as S,Q as se,I as E,F as I,l as ae,y as $}from"./index-DEUF9X23.js";import{X as ne}from"./x-yR_yShVB.js";const oe={class:"flex flex-col h-full"},re={key:0,class:"flex items-center justify-center h-full"},le={class:"text-center text-muted-foreground"},ie={key:0,class:"mb-2 space-y-2"},ce=["src","alt"],ue={class:"flex items-center gap-2 text-xs"},de={class:"truncate"},pe={class:"opacity-70"},fe={key:2,class:"text-muted-foreground"},me={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ve={key:0,class:"mb-2 space-y-2"},he={class:"flex flex-wrap gap-2"},ge={class:"max-w-[170px] truncate"},xe={class:"opacity-70"},_e=["onClick"],ye={class:"text-xs text-muted-foreground"},be={key:1,class:"text-xs text-destructive mb-2"},ke={class:"flex gap-2 items-end"},we=["disabled"],Te=["disabled"],De=H({__name:"ChatView",setup(Ae){const c=O(),h=v(""),p=v(""),x=v(),_=v(),i=v([]),y=v(!1),j=B(()=>i.value.reduce((e,n)=>e+n.size,0)),C=B(()=>!c.isStreaming&&(h.value.trim().length>0||i.value.length>0));async function D(e){if(!e||e.length===0)return;p.value="";const n=[];try{for(const u of Array.from(e))n.push(await Z(u))}catch(u){p.value=(u==null?void 0:u.message)??"Unable to read one or more files.";return}const s=[...i.value,...n],l=ee(s);if(!l.ok){p.value=l.error;return}i.value=s,_.value&&(_.value.value="")}function N(e){i.value.splice(e,1),p.value=""}function P(){var e;(e=_.value)==null||e.click()}function V(e){const n=e.target;D((n==null?void 0:n.files)??null)}async function M(){if(!C.value)return;const e=h.value.trim(),n=[...i.value],s=e||"Please review the attached file(s).";h.value="",i.value=[],p.value="",await c.sendMessage(s,n)}function k(){x.value&&(x.value.scrollTop=x.value.scrollHeight)}function F(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),M())}function K(e){e.preventDefault(),y.value=!0}function L(e){e.preventDefault(),y.value=!1}async function q(e){var n;e.preventDefault(),y.value=!1,await D(((n=e.dataTransfer)==null?void 0:n.files)??null)}return z(()=>c.messages.map(e=>e.content),async()=>{await $(),k()},{deep:!0}),z(()=>c.messages.length,async()=>{await $(),k()}),U(()=>k()),(e,n)=>(a(),r("div",oe,[o("div",{ref_key:"messagesContainer",ref:x,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(c).messages.length===0?(a(),r("div",re,[o("div",le,[w(te,{size:56,class:"mx-auto mb-4"}),n[1]||(n[1]=o("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),n[2]||(n[2]=o("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):m("",!0),(a(!0),r(T,null,A(t(c).messages,s=>(a(),r("div",{key:s.id,class:b(["flex",s.role==="user"?"justify-end":"justify-start"])},[o("div",{class:b(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[s.attachments.length>0?(a(),r("div",ie,[(a(!0),r(T,null,A(s.attachments,(l,u)=>(a(),r("div",{key:`${s.id}-${u}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(S)(l)?(a(),r("img",{key:0,src:t(se)(l),alt:l.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,ce)):m("",!0),o("div",ue,[t(S)(l)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",de,d(l.name),1),o("span",pe,d(t(g)(l.size)),1)])]))),128))])):m("",!0),s.content?(a(),f(ae,{key:1,content:s.content,class:b(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),r("span",fe,"...")),s.streaming?(a(),r("div",me)):m("",!0)],2)],2))),128))],512),o("div",{class:b(["border-t border-border p-4",y.value?"bg-accent/40":""]),onDragover:K,onDragleave:L,onDrop:q},[o("input",{ref_key:"fileInput",ref:_,type:"file",multiple:"",class:"hidden",onChange:V},null,544),i.value.length>0?(a(),r("div",ve,[o("div",he,[(a(!0),r(T,null,A(i.value,(s,l)=>(a(),r("div",{key:`${s.name}-${l}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(S)(s)?(a(),f(t(E),{key:0,class:"w-3.5 h-3.5"})):(a(),f(t(I),{key:1,class:"w-3.5 h-3.5"})),o("span",ge,d(s.name),1),o("span",xe,d(t(g)(s.size)),1),o("button",{class:"hover:text-destructive",onClick:u=>N(l)},[w(t(ne),{class:"w-3.5 h-3.5"})],8,_e)]))),128))]),o("p",ye,d(t(g)(j.value))+" attached · Max per file "+d(t(g)(t(X)))+" · Max total "+d(t(g)(t(W))),1)])):m("",!0),p.value?(a(),r("p",be,d(p.value),1)):m("",!0),o("div",ke,[o("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(c).isStreaming,onClick:P,title:"Attach files"},[w(t(Y),{class:"w-4 h-4"})],8,we),J(o("textarea",{"onUpdate:modelValue":n[0]||(n[0]=s=>h.value=s),onKeydown:F,placeholder:"Send a message...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring min-h-[40px] max-h-[120px]"},null,544),[[Q,h.value]]),o("button",{onClick:M,disabled:!C.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(c).isStreaming?(a(),f(t(G),{key:1,class:"w-4 h-4"})):(a(),f(t(R),{key:0,class:"w-4 h-4"}))],8,Te)])],34)]))}});export{De as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,
|
|
1
|
+
import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,a6 as k,p as q,l as T}from"./index-DEUF9X23.js";import{b as C,c as E,a as P}from"./api-BGxJOfVN.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-Cpb3QlxJ.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as q,
|
|
1
|
+
import{u as q,a2 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a4 as T,a0 as L,g as E,p as x,d as $,L as A,z as p,R as g,K as l,m as P,o as R,l as G}from"./index-DEUF9X23.js";import{b as B,a as J}from"./api-BGxJOfVN.js";import{S as K}from"./search-CEJRBdSx.js";import{A as Q}from"./arrow-left-1DJHiwpX.js";import{T as I}from"./trash-2-Cpb3QlxJ.js";const O={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=q({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await B(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function D(){u.value=null,b.value=[]}async function H(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await J(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&D())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function N(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const U=P(()=>a.value.length<h.value);let S=null;return F([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",O,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(K),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,A(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",ae,[t("p",le,g(N(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:V=>H(s.id,V)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),U.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:D},[d(c(Q),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),R(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as b,V as v,J as u,q as i,n as t,t as y,
|
|
1
|
+
import{u as b,V as v,J as u,q as i,n as t,t as y,a6 as w,a4 as m,a0 as p,R as c,p as V,T as f,K as d,_,Y as h}from"./index-DEUF9X23.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},q={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(D){const o=v(),g=h(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),g.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",S,[t("div",k,[t("div",q,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"font-display text-4xl font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,c(s.value),1)):V("",!0),t("button",{type:"submit",disabled:f(o).loading,class:"btn-gradient w-full py-2.5"},c(f(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"}," Personal AI Assistant Daemon ",-1))])]))}});export{L as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as E,E as S,J as l,q as a,n as s,t as c,T as b,s as C,a4 as i,a0 as m,$ as M,p as x,i as P,d as $,L as j,K as f,R as p}from"./index-DEUF9X23.js";import{b as U,c as I,d as N,a as L}from"./api-BGxJOfVN.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-YaARv5SW.js";import{P as G}from"./plus-DhL0273d.js";import{T as K}from"./trash-2-Cpb3QlxJ.js";const F={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},B={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},h={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},R={key:1,class:"text-muted-foreground"},q={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},z={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=E({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});S(async()=>{try{u.value=await U("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await L(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(l(),a("div",F,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Server ",-1))])]),v.value?(l(),a("div",B,[s("div",h,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[M,o.value.type]])])]),o.value.type==="stdio"?(l(),a("div",D,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Command",-1)),i(s("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.command=t),placeholder:"npx @my/mcp-server",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.command]])])):(l(),a("div",J,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"URL",-1)),i(s("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.url=t),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.url]])])),s("div",null,[e[14]||(e[14]=s("label",{class:"text-sm font-medium"},"Command args",-1)),i(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.argsText=t),rows:"3",placeholder:"--stdio\n--figma-api-key=${FIGMA_API_KEY}",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.argsText]]),e[15]||(e[15]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Enter one arg per line or comma-separated.",-1))]),s("div",null,[e[16]||(e[16]=s("label",{class:"text-sm font-medium"},"Environment variables",-1)),i(s("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.envText=t),rows:"4",placeholder:"FIGMA_API_KEY=${FIGMA_API_KEY}\nLOG_LEVEL=debug",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono"},null,512),[[m,o.value.envText]]),e[17]||(e[17]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Use KEY=value lines, or paste JSON. Values like ${FIGMA_API_KEY} are preserved.",-1))]),s("div",{class:"flex justify-end"},[s("button",{onClick:V,class:"btn-gradient"},"Save")])])):x("",!0),g.value?(l(),a("div",R,"Loading...")):u.value.length===0?(l(),a("div",q,[c(b(P),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(l(),a("div",W,[(l(!0),a($,null,j(u.value,t=>{var d;return l(),a("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3 bg-card"},[s("div",z,[s("div",H,[s("span",Q,p(t.name),1),s("span",X,p(t.type),1)]),t.command||t.url?(l(),a("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(l(),a("div",ee,"Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(l(),a("div",te,"Env: "+p(Object.keys(t.env).join(", ")),1)):x("",!0)]),s("div",se,[c(O,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(K),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as B,u as I,E as L,J as d,q as r,n as o,t as m,T as p,s as z,d as x,L as y,
|
|
1
|
+
import{r as B,u as I,E as L,J as d,q as r,n as o,t as m,T as p,s as z,d as x,L as y,a4 as f,$ as k,a0 as S,p as _,c as E,R as n,K as u,m as M,z as O,D as j}from"./index-DEUF9X23.js";import{b as h,c as C,d as A,a as R}from"./api-BGxJOfVN.js";import{g as F}from"./squad-colors-B8B_Y-lz.js";import{_ as G}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-YaARv5SW.js";import{P as J}from"./plus-DhL0273d.js";import{T as K}from"./trash-2-Cpb3QlxJ.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as w,E,J as d,q as s,n as t,R as g,d as x,L as U,a4 as o,a0 as n,$ as M,Z as p,p as b,K as r,z as T}from"./index-DEUF9X23.js";import{b as V,d as S}from"./api-BGxJOfVN.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],K={key:0,class:"space-y-4 max-w-lg"},D={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},R={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],a=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");a.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",a.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),f.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:$=>u.value=l.id,class:T(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",K,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),o(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),o(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[M,a.value.backgroundNotifyMode]])]),t("div",D,[o(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,a.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),o(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedUserId,void 0,{number:!0}]])]),t("div",R,[o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,a.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",j,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",G,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,a.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",O,[o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,a.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{W as default};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as me,u as fe,E as xe,J as o,q as a,n as t,z as j,t as u,T as d,s as q,d as p,a4 as C,a0 as M,a5 as ee,R as r,p as S,h as te,L as se,$ as ge,o as oe,l as le,K as n,m as ye,a6 as ae}from"./index-DEUF9X23.js";import{b as z,c as J,d as be,a as ke}from"./api-BGxJOfVN.js";import{P as ne}from"./plus-DhL0273d.js";import{S as he}from"./search-CEJRBdSx.js";import{P as _e,S as we}from"./save-D52JPmEZ.js";import{X as Ce}from"./x-yR_yShVB.js";import{T as Se}from"./trash-2-Cpb3QlxJ.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const Q=
|
|
6
|
+
*/const Q=me("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),$e={class:"flex h-full"},Le={class:"w-72 border-r border-border flex flex-col shrink-0"},Ie={class:"flex border-b border-border"},Fe={class:"p-3 border-b border-border space-y-2"},Me={class:"flex gap-1"},Te={key:0,class:"space-y-1.5"},Ue={class:"flex gap-1"},Ve=["disabled"],De={key:1,class:"space-y-1.5"},Ee={key:0,class:"mt-0.5 text-xs text-muted-foreground font-mono"},Pe={class:"flex gap-1"},je=["disabled"],ze={class:"flex-1 overflow-y-auto p-2"},Ne={key:0,class:"text-xs text-muted-foreground p-2"},Ae={key:1,class:"text-center py-8 text-muted-foreground"},Ke=["onClick"],Ge={class:"min-w-0 flex-1"},Be={class:"font-medium truncate"},Re={class:"text-muted-foreground truncate"},qe=["onClick"],Je={class:"p-3 border-b border-border space-y-2"},Qe={class:"relative"},Xe=["disabled"],He={class:"flex-1 overflow-y-auto p-2"},Oe={key:0,class:"text-xs text-muted-foreground p-2"},We={key:1,class:"text-xs text-destructive p-2"},Ye={key:2,class:"text-center py-8 text-muted-foreground"},Ze=["onClick"],et={class:"min-w-0 flex-1"},tt={class:"font-medium truncate"},st=["title"],ot=["onClick","disabled"],lt={key:1,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-muted text-muted-foreground"},at={class:"flex-1 flex flex-col"},nt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},rt={class:"text-center"},it={class:"flex items-center justify-between px-4 py-2 border-b border-border"},ut={class:"text-sm font-medium"},dt={class:"text-xs text-muted-foreground ml-2 font-mono"},ct={class:"flex gap-1"},vt={class:"flex-1 overflow-y-auto p-4"},pt={key:0,class:"text-muted-foreground text-sm"},mt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},ft={class:"text-center"},xt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},gt={class:"min-w-0 flex-1"},yt={class:"text-sm font-medium"},bt={class:"text-xs text-muted-foreground ml-2"},kt=["disabled"],ht={key:1,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-muted text-muted-foreground"},_t={class:"flex-1 overflow-y-auto p-4"},wt={key:0,class:"text-muted-foreground text-sm"},Ct={key:0,class:"absolute bottom-4 left-4 text-sm text-destructive bg-background border border-destructive/30 px-3 py-2 rounded-md"},re=`# My Skill
|
|
7
7
|
|
|
8
8
|
A brief description of what this skill does.
|
|
9
9
|
|
|
10
10
|
## Usage
|
|
11
11
|
|
|
12
12
|
Instructions for how to use this skill...
|
|
13
|
-
`,
|
|
13
|
+
`,Vt=fe({__name:"SkillsView",setup(St){const T=n([]),N=n(!0),U=n(!1),A=n("git"),g=n(""),f=n(""),y=n(re),m=n(!1),i=n(""),X=ye(()=>f.value.trim().replace(/[^a-z0-9-]/gi,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")),v=n(null),x=n(""),b=n(!1),$=n(""),K=n(!1),k=n("installed"),G=n("awesome-copilot"),V=n(""),L=n([]),I=n(!1),D=n(""),c=n(null),h=n(""),B=n(!1),_=n("");async function w(){N.value=!0;try{T.value=await z("/skills")}finally{N.value=!1}}function H(l){A.value=l,U.value=!0,i.value=""}function E(){U.value=!1,g.value="",f.value="",y.value=re,i.value=""}async function O(){if(g.value.trim()){m.value=!0,i.value="";try{await J("/skills",{url:g.value.trim()}),E(),await w()}catch(l){i.value=l.message||"Failed to install skill"}finally{m.value=!1}}}async function ie(){if(!(!f.value.trim()||!y.value.trim())){m.value=!0,i.value="";try{await J("/skills",{slug:X.value,content:y.value}),E(),await w()}catch(l){i.value=l.message||"Failed to create skill"}finally{m.value=!1}}}async function ue(l){var e;try{await ke(`/skills/${l}`),((e=v.value)==null?void 0:e.slug)===l&&(v.value=null,x.value=""),await w()}catch(s){i.value=s.message||"Failed to remove skill"}}async function de(l){v.value=l,b.value=!1,K.value=!0;try{const e=await z(`/skills/${l.slug}/content`);x.value=e.content}catch(e){x.value=`Error loading skill: ${e.message}`}finally{K.value=!1}}function ce(){$.value=x.value,b.value=!0}async function ve(){if(v.value)try{await be(`/skills/${v.value.slug}/content`,{content:$.value}),x.value=$.value,b.value=!1,await w()}catch(l){i.value=l.message||"Failed to save skill"}}async function P(){I.value=!0,D.value="",c.value=null,h.value="";try{const l=new URLSearchParams({source:G.value});V.value.trim()&&l.set("q",V.value.trim()),L.value=await z(`/skills/discover?${l}`)}catch(l){D.value=l.message||"Failed to fetch community skills",L.value=[]}finally{I.value=!1}}async function pe(l){c.value=l,B.value=!0,h.value="";try{const e=await z(`/skills/preview?source=${l.source}&slug=${encodeURIComponent(l.slug)}`);h.value=e.content}catch(e){h.value=`Error loading preview: ${e.message}`}finally{B.value=!1}}async function W(l){_.value=l.slug,i.value="";try{await J("/skills",{source:l.source,slug:l.slug}),await w(),k.value="installed"}catch(e){i.value=e.message||"Failed to install skill"}finally{_.value=""}}function Y(l){return T.value.some(e=>e.slug===l)}function Z(l){k.value=l,v.value=null,c.value=null,x.value="",h.value="",l==="discover"&&L.value.length===0&&P()}return xe(w),(l,e)=>(o(),a("div",$e,[t("div",Le,[t("div",Ie,[t("button",{onClick:e[0]||(e[0]=s=>Z("installed")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="installed"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])}," Installed ",2),t("button",{onClick:e[1]||(e[1]=s=>Z("discover")),class:j(["flex-1 px-3 py-2 text-xs font-medium transition-colors",k.value==="discover"?"border-b-2 border-primary text-primary":"text-muted-foreground hover:text-foreground"])},[u(d(Q),{class:"w-3 h-3 inline mr-1"}),e[12]||(e[12]=q(" Discover ",-1))],2)]),k.value==="installed"?(o(),a(p,{key:0},[t("div",Fe,[t("div",Me,[t("button",{onClick:e[2]||(e[2]=s=>H("git")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[13]||(e[13]=q(" From Git ",-1))]),t("button",{onClick:e[3]||(e[3]=s=>H("create")),class:"flex-1 flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md border border-border hover:bg-accent"},[u(d(ne),{class:"w-3.5 h-3.5"}),e[14]||(e[14]=q(" Create New ",-1))])]),U.value&&A.value==="git"?(o(),a("div",Te,[C(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>g.value=s),type:"text",placeholder:"https://github.com/user/skill-repo.git",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:ee(O,["enter"])},null,544),[[M,g.value]]),t("div",Ue,[t("button",{onClick:O,disabled:m.value||!g.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Installing...":"Install"),9,Ve),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0),U.value&&A.value==="create"?(o(),a("div",De,[t("div",null,[C(t("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>f.value=s),type:"text",placeholder:"Skill title",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[M,f.value]]),f.value.trim()?(o(),a("p",Ee," slug: "+r(X.value),1)):S("",!0)]),C(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>y.value=s),rows:"8",placeholder:`# My Skill
|
|
14
14
|
|
|
15
|
-
Describe your skill in Markdown...`,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512),[[M,y.value]]),t("div",Pe,[t("button",{onClick:ie,disabled:
|
|
15
|
+
Describe your skill in Markdown...`,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs font-mono focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512),[[M,y.value]]),t("div",Pe,[t("button",{onClick:ie,disabled:m.value||!f.value.trim()||!y.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Creating...":"Create"),9,je),t("button",{onClick:E,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0)]),t("div",ze,[N.value?(o(),a("div",Ne,"Loading...")):T.value.length===0?(o(),a("div",Ae,[u(d(te),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[15]||(e[15]=t("p",{class:"text-xs"},"No skills installed.",-1))])):S("",!0),(o(!0),a(p,null,se(T.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>de(s),class:j(["flex items-center justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors group",{"bg-accent font-medium":((F=v.value)==null?void 0:F.slug)===s.slug}])},[t("div",Ge,[t("div",Be,r(s.name),1),t("div",Re,r(s.slug),1)]),t("button",{onClick:ae(R=>ue(s.slug),["stop"]),class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-destructive transition-opacity shrink-0",title:"Remove"},[u(d(Se),{class:"w-3.5 h-3.5"})],8,qe)],10,Ke)}),128))])],64)):(o(),a(p,{key:1},[t("div",Je,[C(t("select",{"onUpdate:modelValue":e[7]||(e[7]=s=>G.value=s),onChange:P,class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},[...e[16]||(e[16]=[t("option",{value:"awesome-copilot"},"awesome-copilot",-1),t("option",{value:"skillssh"},"skills.sh",-1)])],544),[[ge,G.value]]),t("div",Qe,[u(d(he),{class:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"}),C(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>V.value=s),type:"text",placeholder:"Search skills...",class:"w-full rounded-md border border-input bg-background pl-6 pr-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:ee(P,["enter"])},null,544),[[M,V.value]])]),t("button",{onClick:P,disabled:I.value,class:"w-full px-2 py-1.5 text-xs rounded-md bg-secondary text-secondary-foreground hover:bg-secondary/80 disabled:opacity-50"},r(I.value?"Searching...":"Search"),9,Xe)]),t("div",He,[I.value?(o(),a("div",Oe,"Loading...")):D.value?(o(),a("div",We,r(D.value),1)):L.value.length===0?(o(),a("div",Ye,[u(d(Q),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[17]||(e[17]=t("p",{class:"text-xs"},"No skills found.",-1))])):S("",!0),(o(!0),a(p,null,se(L.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>pe(s),class:j(["flex items-start justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors gap-1",{"bg-accent":((F=c.value)==null?void 0:F.slug)===s.slug}])},[t("div",et,[t("div",tt,r(s.slug),1),t("div",{class:"text-muted-foreground line-clamp-2 mt-0.5",title:s.description},r(s.description),9,st)]),Y(s.slug)?(o(),a("span",lt," Installed ")):(o(),a("button",{key:0,onClick:ae(R=>W(s),["stop"]),disabled:_.value===s.slug,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",title:"Install"},r(_.value===s.slug?"...":"Install"),9,ot))],10,Ze)}),128))])],64))]),t("div",at,[k.value==="installed"?(o(),a(p,{key:0},[v.value?(o(),a(p,{key:1},[t("div",it,[t("div",null,[t("span",ut,r(v.value.name),1),t("span",dt,r(v.value.slug)+"/SKILL.md",1)]),t("div",ct,[b.value?(o(),a(p,{key:1},[t("button",{onClick:ve,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[u(d(we),{class:"w-4 h-4"})]),t("button",{onClick:e[9]||(e[9]=s=>b.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[u(d(Ce),{class:"w-4 h-4"})])],64)):(o(),a("button",{key:0,onClick:ce,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[u(d(_e),{class:"w-4 h-4"})]))])]),t("div",vt,[K.value?(o(),a("div",pt,"Loading...")):b.value?C((o(),a("textarea",{key:1,"onUpdate:modelValue":e[10]||(e[10]=s=>$.value=s),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[M,$.value]]):(o(),oe(le,{key:2,content:x.value},null,8,["content"]))])],64)):(o(),a("div",nt,[t("div",rt,[u(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a skill to view",-1))])]))],64)):(o(),a(p,{key:1},[c.value?(o(),a(p,{key:1},[t("div",xt,[t("div",gt,[t("span",yt,r(c.value.slug),1),t("span",bt,r(c.value.source),1)]),Y(c.value.slug)?(o(),a("span",ht," Installed ")):(o(),a("button",{key:0,onClick:e[11]||(e[11]=s=>W(c.value)),disabled:_.value===c.value.slug,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(_.value===c.value.slug?"Installing...":"Install"),9,kt))]),t("div",_t,[B.value?(o(),a("div",wt,"Loading preview...")):(o(),oe(le,{key:1,content:h.value},null,8,["content"]))])],64)):(o(),a("div",mt,[t("div",ft,[u(d(Q),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[19]||(e[19]=t("p",null,"Select a skill to preview",-1))])]))],64))]),i.value?(o(),a("p",Ct,r(i.value),1)):S("",!0)]))}});export{Vt as default};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{r as A,u as J,
|
|
1
|
+
import{r as A,u as J,a2 as F,E as z,y as E,G,J as s,q as o,n as t,t as p,T as c,A as B,z as _,R as i,j as O,s as h,p as v,o as I,d as C,L as D,l as R,K as m,m as H,a3 as U,D as X,X as Z,N as K,U as Q}from"./index-DEUF9X23.js";import{b as P,e as W,c as V,a as Y}from"./api-BGxJOfVN.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-yR_yShVB.js";import{G as se}from"./git-branch-D3wum5zq.js";import{T as oe}from"./trash-2-Cpb3QlxJ.js";import{A as re}from"./arrow-left-1DJHiwpX.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
6
|
+
*/const ae=A("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
7
7
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
@@ -23,4 +23,4 @@ import{r as A,u as J,a3 as F,E as z,y as E,G,J as s,q as o,n as t,t as p,T as c,
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const de=A("ToggleRightIcon",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]),ue={class:"flex flex-col h-full border border-border rounded-lg overflow-hidden bg-background"},ce={class:"flex items-center justify-between px-4 py-3 border-b border-border bg-muted/30"},pe={class:"flex items-center gap-2 min-w-0"},me={class:"flex items-center gap-2"},xe=["disabled"],fe=["aria-label","title"],ge={class:"px-4 py-2 text-xs text-muted-foreground border-b border-border bg-muted/10 truncate"},ye={key:0,class:"text-muted-foreground text-xs"},be={key:1,class:"text-muted-foreground text-xs"},ve={class:"flex items-center justify-between mb-1"},he={class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"},we={class:"text-xs text-muted-foreground"},_e={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},ke={key:1},Se={key:1,class:"text-sm"},$e={key:2,class:"border border-border border-l-2 border-l-yellow-500 rounded-lg p-3 animate-pulse"},Te={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},Ce=J({__name:"AgentActivityPreview",props:{taskId:{},taskDescription:{},taskStatus:{}},emits:["close","stopped"],setup(f,{emit:L}){const x=f,S=L,w=m([]),u=m(!1),$=m(!0),g=m(!1),y=m();let d=null;const N=U(()=>w.value.filter(l=>l.summary.trim()!=="")),b=m("");async function k(){try{const l=await P(`/tasks/${x.taskId}/events`);w.value=l}finally{$.value=!1}}function T(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}function M(){x.taskStatus!=="pending"&&x.taskStatus!=="in_progress"||(d=Y(),d.addEventListener("agent_event",l=>{const e=JSON.parse(l.data);e.taskId===x.taskId&&(e.type==="message_delta"?(b.value=e.summary??"",E(T)):(k().then(()=>E(T)),b.value=""))}))}async function q(){if(!g.value){g.value=!0;try{await V(`/tasks/${x.taskId}/stop`),S("stopped")}catch(l){console.error("Failed to stop agent:",l)}finally{g.value=!1}}}function r(l){switch(l){case"status":return"Status";case"message":return"Agent message";case"message_delta":return"Streaming…";default:return l}}function a(l){return new Date(l).toLocaleTimeString()}return F(()=>x.taskStatus,l=>{(l==="done"||l==="failed"||l==="stopped")&&(b.value="",k(),d&&(d.close(),d=null))}),z(()=>{k().then(()=>E(T)),M()}),G(()=>{d&&(d.close(),d=null)}),(l,e)=>(s(),o("div",ue,[t("div",ce,[t("div",pe,[p(c(B),{class:"w-4 h-4 text-primary flex-shrink-0"}),e[2]||(e[2]=t("h3",{class:"text-sm font-semibold truncate"},"Activity Preview",-1)),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full flex-shrink-0",{"bg-yellow-500/10 text-yellow-500":f.taskStatus==="pending","bg-blue-500/10 text-blue-500":f.taskStatus==="in_progress","bg-green-500/10 text-green-500":f.taskStatus==="done","bg-red-500/10 text-red-500":f.taskStatus==="failed","bg-orange-500/10 text-orange-500":f.taskStatus==="stopped"}])},i(f.taskStatus),3)]),t("div",me,[f.taskStatus==="pending"||f.taskStatus==="in_progress"?(s(),o("button",{key:0,onClick:q,disabled:g.value,class:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded border border-red-500/50 text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Stop agent",title:"Stop agent"},[p(c(O),{class:"w-3 h-3"}),h(" "+i(g.value?"Stopping…":"Stop"),1)],8,xe)):v("",!0),t("button",{onClick:e[0]||(e[0]=n=>u.value=!u.value),class:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors","aria-label":u.value?"Switch to human-readable view":"Switch to raw JSON view",title:u.value?"Switch to human-readable view":"Switch to raw JSON view"},[u.value?(s(),I(c(de),{key:1,class:"w-4 h-4 text-primary"})):(s(),I(c(ie),{key:0,class:"w-4 h-4"})),t("span",null,i(u.value?"Raw JSON":"Readable"),1)],8,fe),t("button",{onClick:e[1]||(e[1]=n=>S("close")),class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close preview",title:"Close preview"},[p(c(H),{class:"w-4 h-4"})])])]),t("div",ge,i(f.taskDescription),1),t("div",{ref_key:"feedContainer",ref:y,class:"flex-1 overflow-y-auto p-4 space-y-3 text-sm"},[$.value?(s(),o("div",ye,"Loading events…")):N.value.length===0&&!b.value?(s(),o("div",be," No events yet. The agent will start shortly. ")):v("",!0),(s(!0),o(C,null,D(N.value,n=>(s(),o("div",{key:n.id,class:_(["border border-border rounded-lg p-3",{"border-l-2 border-l-green-500":n.type==="status"&&n.summary.includes("completed"),"border-l-2 border-l-red-500":n.type==="status"&&n.summary.includes("failed"),"border-l-2 border-l-blue-500":n.type==="message","border-l-2 border-l-primary":n.type==="status"&&!n.summary.includes("completed")&&!n.summary.includes("failed")}])},[t("div",ve,[t("span",he,i(r(n.type)),1),t("span",we,i(a(n.created_at)),1)]),u.value?(s(),o("pre",_e,i(JSON.stringify(JSON.parse(n.payload),null,2)),1)):(s(),o("div",ke,[n.type==="message"?(s(),I(R,{key:0,content:n.summary,class:"text-sm"},null,8,["content"])):(s(),o("p",Se,i(n.summary),1))]))],2))),128)),b.value.trim()?(s(),o("div",$e,[e[3]||(e[3]=t("div",{class:"flex items-center justify-between mb-1"},[t("span",{class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"}," Agent is responding… "),t("span",{class:"inline-block w-2 h-2 rounded-full bg-yellow-500 animate-ping"})],-1)),u.value?(s(),o("pre",Te,i(JSON.stringify({type:"message_delta",accumulated:b.value},null,2)),1)):(s(),I(R,{key:1,content:b.value,class:"text-sm"},null,8,["content"]))])):v("",!0)],512)]))}}),Ae={class:"p-6"},Ne={key:0,class:"text-muted-foreground"},Ie={class:"mb-6"},De={class:"text-muted-foreground"},Le={class:"mb-8"},Me={class:"border border-border rounded-lg overflow-hidden"},qe={class:"w-full text-sm"},Ee={class:"px-4 py-2 font-medium"},Re={class:"px-4 py-2 text-muted-foreground"},je={class:"px-4 py-2"},Je={class:"px-4 py-2 flex gap-1"},ze={key:0,class:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded"},Be={key:1,class:"text-xs bg-blue-500/10 text-blue-500 px-1.5 py-0.5 rounded"},Oe={key:2,class:"text-xs bg-purple-500/10 text-purple-500 px-1.5 py-0.5 rounded"},Pe={class:"mb-8"},Ve={class:"flex items-center justify-between mb-3"},Fe={key:0,class:"text-sm text-muted-foreground border border-border rounded-lg p-4 text-center"},Ge={key:1,class:"grid grid-cols-1 md:grid-cols-3 gap-3"},He={class:"flex items-center justify-between gap-2"},Ue={class:"flex items-center gap-1.5 min-w-0"},Xe={class:"text-sm font-medium truncate"},Ze={class:"flex items-center gap-1 text-xs text-muted-foreground"},Ke=["title"],Qe={class:"pt-1 border-t border-border"},We=["disabled","onClick"],Ye={key:0,class:"text-sm text-muted-foreground"},et={key:1,class:"space-y-2"},tt={class:"flex items-center justify-between"},st={class:"text-sm"},ot={class:"flex items-center gap-2"},at=["onClick","disabled"],rt=["onClick","aria-label","title"],lt={key:0,class:"mt-3 h-96"},j=3,mt=J({__name:"SquadDetailView",setup(f){const L=K(),x=m(null),S=m([]),w=m([]),u=m([]),$=m(!0),g=m(null),y=m(null),d=m(null);function N(r){d.value=r}function b(){d.value=null}function k(r){return r==="pending"||r==="in_progress"}async function T(r){if(!y.value){y.value=r;try{await V(`/tasks/${r}/stop`);const a=w.value.find(l=>l.id===r);a&&(a.status="stopped")}catch(a){console.error("Failed to stop task:",a)}finally{y.value=null}}}z(async()=>{try{const r=await P(`/squads/${L.params.id}`);x.value=r.squad,S.value=r.agents,w.value=r.tasks,u.value=r.instances}finally{$.value=!1}});async function M(r,a){if(confirm(`Destroy instance on branch "${a}"? This will remove the worktree.`)){g.value=r;try{await ee(`/instances/${r}`),u.value=u.value.filter(l=>l.id!==r)}finally{g.value=null}}}function q(r){if(!r)return"never";const a=r.replace(" ","T")+(r.includes("T")||r.endsWith("Z")?"":"Z"),l=Date.now()-new Date(a).getTime(),e=Math.floor(l/6e4);if(e<1)return"just now";if(e<60)return`${e}m ago`;const n=Math.floor(e/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}return(r,a)=>{const l=Q("router-link");return s(),o("div",Ae,[p(l,{to:"/squads",class:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-4"},{default:X(()=>[p(c(ae),{class:"w-4 h-4"}),a[0]||(a[0]=h(" Back to Squads ",-1))]),_:1}),$.value?(s(),o("div",Ne,"Loading...")):x.value?(s(),o(C,{key:1},[t("div",Ie,[t("span",{class:"inline-flex items-center text-sm px-2.5 py-1 rounded-full font-medium mb-2 w-fit",style:Z(c(te)(x.value.color))},i(x.value.name),5),t("p",De,i(x.value.universe),1)]),t("section",Le,[a[5]||(a[5]=t("h2",{class:"text-lg font-semibold mb-3"},"Agent Roster",-1)),t("div",Me,[t("table",qe,[a[4]||(a[4]=t("thead",{class:"bg-muted"},[t("tr",null,[t("th",{class:"text-left px-4 py-2 font-medium"},"Character"),t("th",{class:"text-left px-4 py-2 font-medium"},"Role"),t("th",{class:"text-left px-4 py-2 font-medium"},"Status"),t("th",{class:"text-left px-4 py-2 font-medium"},"Flags")])],-1)),t("tbody",null,[(s(!0),o(C,null,D(S.value,e=>(s(),o("tr",{key:e.id,class:"border-t border-border"},[t("td",Ee,i(e.character_name),1),t("td",Re,i(e.role_title),1),t("td",je,[t("span",{class:_(["inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full",{"bg-green-500/10 text-green-500":e.status==="idle","bg-yellow-500/10 text-yellow-500":e.status==="working","bg-blue-500/10 text-blue-500":e.status==="reviewing"}])},i(e.status),3)]),t("td",Je,[e.is_lead?(s(),o("span",ze,[p(c(W),{class:"w-3 h-3 inline"}),a[1]||(a[1]=h(" Lead ",-1))])):v("",!0),e.is_qa?(s(),o("span",Be,[p(c(ne),{class:"w-3 h-3 inline"}),a[2]||(a[2]=h(" QA ",-1))])):v("",!0),e.is_test?(s(),o("span",Oe,[p(c(le),{class:"w-3 h-3 inline"}),a[3]||(a[3]=h(" Test ",-1))])):v("",!0)])]))),128))])])])]),t("section",Pe,[t("div",Ve,[a[6]||(a[6]=t("h2",{class:"text-lg font-semibold"},"Instances",-1)),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full font-medium",u.value.length>=j?"bg-red-500/10 text-red-500":"bg-secondary text-secondary-foreground"])},i(u.value.length)+" / "+i(j)+" active ",3)]),u.value.length===0?(s(),o("div",Fe," No active instances. ")):(s(),o("div",Ge,[(s(!0),o(C,null,D(u.value,e=>(s(),o("div",{key:e.id,class:"border border-border rounded-lg p-3 flex flex-col gap-2"},[t("div",He,[t("div",Ue,[p(c(se),{class:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),t("span",Xe,i(e.branch),1)]),t("span",{class:_(["text-xs px-1.5 py-0.5 rounded-full shrink-0",{"bg-green-500/10 text-green-500":e.status==="active","bg-red-500/10 text-red-500":e.status==="destroyed","bg-yellow-500/10 text-yellow-500":e.status==="stale"}])},i(e.status),3)]),t("div",Ze,[p(c(B),{class:"w-3 h-3 shrink-0"}),t("span",null,i(q(e.last_activity)),1)]),t("div",{class:"font-mono text-xs text-muted-foreground truncate",title:e.worktree_path},i(e.worktree_path),9,Ke),t("div",Qe,[t("button",{class:"inline-flex items-center gap-1 text-xs text-red-500 hover:text-red-400 disabled:opacity-50 disabled:cursor-not-allowed",disabled:g.value===e.id,onClick:n=>M(e.id,e.branch)},[p(c(oe),{class:"w-3 h-3"}),h(" "+i(g.value===e.id?"Destroying…":"Destroy"),1)],8,We)])]))),128))]))]),t("section",null,[a[8]||(a[8]=t("h2",{class:"text-lg font-semibold mb-3"},"Recent Tasks",-1)),w.value.length===0?(s(),o("div",Ye,"No tasks yet.")):(s(),o("div",et,[(s(!0),o(C,null,D(w.value,e=>(s(),o("div",{key:e.id,class:"border border-border rounded-lg p-3"},[t("div",tt,[t("span",st,i(e.description),1),t("div",ot,[k(e.status)?(s(),o("button",{key:0,onClick:n=>T(e.id),disabled:y.value===e.id,class:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded border border-red-500/50 text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Stop agent",title:"Stop agent"},[p(c(O),{class:"w-3 h-3"}),h(" "+i(y.value===e.id?"Stopping…":"Stop"),1)],8,at)):v("",!0),k(e.status)||d.value===e.id?(s(),o("button",{key:1,onClick:n=>d.value===e.id?b():N(e.id),class:_(["inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors",d.value===e.id?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground hover:border-foreground"]),"aria-label":d.value===e.id?"Hide activity preview":"Show activity preview",title:d.value===e.id?"Hide preview":"Preview activity"},[p(c(re),{class:"w-3 h-3"}),a[7]||(a[7]=h(" Preview ",-1))],10,rt)):v("",!0),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full",{"bg-yellow-500/10 text-yellow-500":e.status==="pending","bg-blue-500/10 text-blue-500":e.status==="in_progress","bg-green-500/10 text-green-500":e.status==="done","bg-red-500/10 text-red-500":e.status==="failed","bg-orange-500/10 text-orange-500":e.status==="stopped"}])},i(e.status),3)])]),d.value===e.id?(s(),o("div",lt,[p(Ce,{"task-id":e.id,"task-description":e.description,"task-status":e.status,onClose:b,onStopped:n=>e.status="stopped"},null,8,["task-id","task-description","task-status","onStopped"])])):v("",!0)]))),128))]))])],64)):v("",!0)])}}});export{mt as default};
|
|
26
|
+
*/const de=A("ToggleRightIcon",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"16",cy:"12",r:"2",key:"4ma0v8"}]]),ue={class:"flex flex-col h-full border border-border rounded-lg overflow-hidden bg-background"},ce={class:"flex items-center justify-between px-4 py-3 border-b border-border bg-muted/30"},pe={class:"flex items-center gap-2 min-w-0"},me={class:"flex items-center gap-2"},xe=["disabled"],fe=["aria-label","title"],ge={class:"px-4 py-2 text-xs text-muted-foreground border-b border-border bg-muted/10 truncate"},ye={key:0,class:"text-muted-foreground text-xs"},be={key:1,class:"text-muted-foreground text-xs"},ve={class:"flex items-center justify-between mb-1"},he={class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"},we={class:"text-xs text-muted-foreground"},_e={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},ke={key:1},Se={key:1,class:"text-sm"},$e={key:2,class:"border border-border border-l-2 border-l-yellow-500 rounded-lg p-3 animate-pulse"},Te={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},Ce=J({__name:"AgentActivityPreview",props:{taskId:{},taskDescription:{},taskStatus:{}},emits:["close","stopped"],setup(f,{emit:L}){const x=f,S=L,w=m([]),u=m(!1),$=m(!0),g=m(!1),y=m();let d=null;const N=H(()=>w.value.filter(l=>l.summary.trim()!=="")),b=m("");async function k(){try{const l=await P(`/tasks/${x.taskId}/events`);w.value=l}finally{$.value=!1}}function T(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}function M(){x.taskStatus!=="pending"&&x.taskStatus!=="in_progress"||(d=W(),d.addEventListener("agent_event",l=>{const e=JSON.parse(l.data);e.taskId===x.taskId&&(e.type==="message_delta"?(b.value=e.summary??"",E(T)):(k().then(()=>E(T)),b.value=""))}))}async function q(){if(!g.value){g.value=!0;try{await V(`/tasks/${x.taskId}/stop`),S("stopped")}catch(l){console.error("Failed to stop agent:",l)}finally{g.value=!1}}}function a(l){switch(l){case"status":return"Status";case"message":return"Agent message";case"message_delta":return"Streaming…";default:return l}}function r(l){return new Date(l).toLocaleTimeString()}return F(()=>x.taskStatus,l=>{(l==="done"||l==="failed"||l==="stopped")&&(b.value="",k(),d&&(d.close(),d=null))}),z(()=>{k().then(()=>E(T)),M()}),G(()=>{d&&(d.close(),d=null)}),(l,e)=>(s(),o("div",ue,[t("div",ce,[t("div",pe,[p(c(B),{class:"w-4 h-4 text-primary flex-shrink-0"}),e[2]||(e[2]=t("h3",{class:"text-sm font-semibold truncate"},"Activity Preview",-1)),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full flex-shrink-0",{"bg-yellow-500/10 text-yellow-500":f.taskStatus==="pending","bg-blue-500/10 text-blue-500":f.taskStatus==="in_progress","bg-green-500/10 text-green-500":f.taskStatus==="done","bg-red-500/10 text-red-500":f.taskStatus==="failed","bg-orange-500/10 text-orange-500":f.taskStatus==="stopped"}])},i(f.taskStatus),3)]),t("div",me,[f.taskStatus==="pending"||f.taskStatus==="in_progress"?(s(),o("button",{key:0,onClick:q,disabled:g.value,class:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded border border-red-500/50 text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Stop agent",title:"Stop agent"},[p(c(O),{class:"w-3 h-3"}),h(" "+i(g.value?"Stopping…":"Stop"),1)],8,xe)):v("",!0),t("button",{onClick:e[0]||(e[0]=n=>u.value=!u.value),class:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors","aria-label":u.value?"Switch to human-readable view":"Switch to raw JSON view",title:u.value?"Switch to human-readable view":"Switch to raw JSON view"},[u.value?(s(),I(c(de),{key:1,class:"w-4 h-4 text-primary"})):(s(),I(c(ie),{key:0,class:"w-4 h-4"})),t("span",null,i(u.value?"Raw JSON":"Readable"),1)],8,fe),t("button",{onClick:e[1]||(e[1]=n=>S("close")),class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close preview",title:"Close preview"},[p(c(te),{class:"w-4 h-4"})])])]),t("div",ge,i(f.taskDescription),1),t("div",{ref_key:"feedContainer",ref:y,class:"flex-1 overflow-y-auto p-4 space-y-3 text-sm"},[$.value?(s(),o("div",ye,"Loading events…")):N.value.length===0&&!b.value?(s(),o("div",be," No events yet. The agent will start shortly. ")):v("",!0),(s(!0),o(C,null,D(N.value,n=>(s(),o("div",{key:n.id,class:_(["border border-border rounded-lg p-3",{"border-l-2 border-l-green-500":n.type==="status"&&n.summary.includes("completed"),"border-l-2 border-l-red-500":n.type==="status"&&n.summary.includes("failed"),"border-l-2 border-l-blue-500":n.type==="message","border-l-2 border-l-primary":n.type==="status"&&!n.summary.includes("completed")&&!n.summary.includes("failed")}])},[t("div",ve,[t("span",he,i(a(n.type)),1),t("span",we,i(r(n.created_at)),1)]),u.value?(s(),o("pre",_e,i(JSON.stringify(JSON.parse(n.payload),null,2)),1)):(s(),o("div",ke,[n.type==="message"?(s(),I(R,{key:0,content:n.summary,class:"text-sm"},null,8,["content"])):(s(),o("p",Se,i(n.summary),1))]))],2))),128)),b.value.trim()?(s(),o("div",$e,[e[3]||(e[3]=t("div",{class:"flex items-center justify-between mb-1"},[t("span",{class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"}," Agent is responding… "),t("span",{class:"inline-block w-2 h-2 rounded-full bg-yellow-500 animate-ping"})],-1)),u.value?(s(),o("pre",Te,i(JSON.stringify({type:"message_delta",accumulated:b.value},null,2)),1)):(s(),I(R,{key:1,content:b.value,class:"text-sm"},null,8,["content"]))])):v("",!0)],512)]))}}),Ae={class:"p-6"},Ne={key:0,class:"text-muted-foreground"},Ie={class:"mb-6"},De={class:"text-muted-foreground"},Le={class:"mb-8"},Me={class:"border border-border rounded-lg overflow-hidden"},qe={class:"w-full text-sm"},Ee={class:"px-4 py-2 font-medium"},Re={class:"px-4 py-2 text-muted-foreground"},je={class:"px-4 py-2"},Je={class:"px-4 py-2 flex gap-1"},ze={key:0,class:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded"},Be={key:1,class:"text-xs bg-blue-500/10 text-blue-500 px-1.5 py-0.5 rounded"},Oe={key:2,class:"text-xs bg-purple-500/10 text-purple-500 px-1.5 py-0.5 rounded"},Pe={class:"mb-8"},Ve={class:"flex items-center justify-between mb-3"},Fe={key:0,class:"text-sm text-muted-foreground border border-border rounded-lg p-4 text-center"},Ge={key:1,class:"grid grid-cols-1 md:grid-cols-3 gap-3"},He={class:"flex items-center justify-between gap-2"},Ue={class:"flex items-center gap-1.5 min-w-0"},Xe={class:"text-sm font-medium truncate"},Ze={class:"flex items-center gap-1 text-xs text-muted-foreground"},Ke=["title"],Qe={class:"pt-1 border-t border-border"},We=["disabled","onClick"],Ye={key:0,class:"text-sm text-muted-foreground"},et={key:1,class:"space-y-2"},tt={class:"flex items-center justify-between"},st={class:"text-sm"},ot={class:"flex items-center gap-2"},rt=["onClick","disabled"],at=["onClick","aria-label","title"],lt={key:0,class:"mt-3 h-96"},j=3,xt=J({__name:"SquadDetailView",setup(f){const L=Z(),x=m(null),S=m([]),w=m([]),u=m([]),$=m(!0),g=m(null),y=m(null),d=m(null);function N(a){d.value=a}function b(){d.value=null}function k(a){return a==="pending"||a==="in_progress"}async function T(a){if(!y.value){y.value=a;try{await V(`/tasks/${a}/stop`);const r=w.value.find(l=>l.id===a);r&&(r.status="stopped")}catch(r){console.error("Failed to stop task:",r)}finally{y.value=null}}}z(async()=>{try{const a=await P(`/squads/${L.params.id}`);x.value=a.squad,S.value=a.agents,w.value=a.tasks,u.value=a.instances}finally{$.value=!1}});async function M(a,r){if(confirm(`Destroy instance on branch "${r}"? This will remove the worktree.`)){g.value=a;try{await Y(`/instances/${a}`),u.value=u.value.filter(l=>l.id!==a)}finally{g.value=null}}}function q(a){if(!a)return"never";const r=a.replace(" ","T")+(a.includes("T")||a.endsWith("Z")?"":"Z"),l=Date.now()-new Date(r).getTime(),e=Math.floor(l/6e4);if(e<1)return"just now";if(e<60)return`${e}m ago`;const n=Math.floor(e/60);return n<24?`${n}h ago`:`${Math.floor(n/24)}d ago`}return(a,r)=>{const l=K("router-link");return s(),o("div",Ae,[p(l,{to:"/squads",class:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-4"},{default:U(()=>[p(c(re),{class:"w-4 h-4"}),r[0]||(r[0]=h(" Back to Squads ",-1))]),_:1}),$.value?(s(),o("div",Ne,"Loading...")):x.value?(s(),o(C,{key:1},[t("div",Ie,[t("span",{class:"inline-flex items-center text-sm px-2.5 py-1 rounded-full font-medium mb-2 w-fit",style:X(c(ee)(x.value.color))},i(x.value.name),5),t("p",De,i(x.value.universe),1)]),t("section",Le,[r[5]||(r[5]=t("h2",{class:"text-lg font-semibold mb-3"},"Agent Roster",-1)),t("div",Me,[t("table",qe,[r[4]||(r[4]=t("thead",{class:"bg-muted"},[t("tr",null,[t("th",{class:"text-left px-4 py-2 font-medium"},"Character"),t("th",{class:"text-left px-4 py-2 font-medium"},"Role"),t("th",{class:"text-left px-4 py-2 font-medium"},"Status"),t("th",{class:"text-left px-4 py-2 font-medium"},"Flags")])],-1)),t("tbody",null,[(s(!0),o(C,null,D(S.value,e=>(s(),o("tr",{key:e.id,class:"border-t border-border"},[t("td",Ee,i(e.character_name),1),t("td",Re,i(e.role_title),1),t("td",je,[t("span",{class:_(["inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded-full",{"bg-green-500/10 text-green-500":e.status==="idle","bg-yellow-500/10 text-yellow-500":e.status==="working","bg-blue-500/10 text-blue-500":e.status==="reviewing"}])},i(e.status),3)]),t("td",Je,[e.is_lead?(s(),o("span",ze,[p(c(Q),{class:"w-3 h-3 inline"}),r[1]||(r[1]=h(" Lead ",-1))])):v("",!0),e.is_qa?(s(),o("span",Be,[p(c(ne),{class:"w-3 h-3 inline"}),r[2]||(r[2]=h(" QA ",-1))])):v("",!0),e.is_test?(s(),o("span",Oe,[p(c(le),{class:"w-3 h-3 inline"}),r[3]||(r[3]=h(" Test ",-1))])):v("",!0)])]))),128))])])])]),t("section",Pe,[t("div",Ve,[r[6]||(r[6]=t("h2",{class:"text-lg font-semibold"},"Instances",-1)),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full font-medium",u.value.length>=j?"bg-red-500/10 text-red-500":"bg-secondary text-secondary-foreground"])},i(u.value.length)+" / "+i(j)+" active ",3)]),u.value.length===0?(s(),o("div",Fe," No active instances. ")):(s(),o("div",Ge,[(s(!0),o(C,null,D(u.value,e=>(s(),o("div",{key:e.id,class:"border border-border rounded-lg p-3 flex flex-col gap-2"},[t("div",He,[t("div",Ue,[p(c(se),{class:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),t("span",Xe,i(e.branch),1)]),t("span",{class:_(["text-xs px-1.5 py-0.5 rounded-full shrink-0",{"bg-green-500/10 text-green-500":e.status==="active","bg-red-500/10 text-red-500":e.status==="destroyed","bg-yellow-500/10 text-yellow-500":e.status==="stale"}])},i(e.status),3)]),t("div",Ze,[p(c(B),{class:"w-3 h-3 shrink-0"}),t("span",null,i(q(e.last_activity)),1)]),t("div",{class:"font-mono text-xs text-muted-foreground truncate",title:e.worktree_path},i(e.worktree_path),9,Ke),t("div",Qe,[t("button",{class:"inline-flex items-center gap-1 text-xs text-red-500 hover:text-red-400 disabled:opacity-50 disabled:cursor-not-allowed",disabled:g.value===e.id,onClick:n=>M(e.id,e.branch)},[p(c(oe),{class:"w-3 h-3"}),h(" "+i(g.value===e.id?"Destroying…":"Destroy"),1)],8,We)])]))),128))]))]),t("section",null,[r[8]||(r[8]=t("h2",{class:"text-lg font-semibold mb-3"},"Recent Tasks",-1)),w.value.length===0?(s(),o("div",Ye,"No tasks yet.")):(s(),o("div",et,[(s(!0),o(C,null,D(w.value,e=>(s(),o("div",{key:e.id,class:"border border-border rounded-lg p-3"},[t("div",tt,[t("span",st,i(e.description),1),t("div",ot,[k(e.status)?(s(),o("button",{key:0,onClick:n=>T(e.id),disabled:y.value===e.id,class:"inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded border border-red-500/50 text-red-500 hover:bg-red-500/10 transition-colors disabled:opacity-50 disabled:cursor-not-allowed","aria-label":"Stop agent",title:"Stop agent"},[p(c(O),{class:"w-3 h-3"}),h(" "+i(y.value===e.id?"Stopping…":"Stop"),1)],8,rt)):v("",!0),k(e.status)||d.value===e.id?(s(),o("button",{key:1,onClick:n=>d.value===e.id?b():N(e.id),class:_(["inline-flex items-center gap-1 text-xs px-2 py-0.5 rounded border transition-colors",d.value===e.id?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground hover:border-foreground"]),"aria-label":d.value===e.id?"Hide activity preview":"Show activity preview",title:d.value===e.id?"Hide preview":"Preview activity"},[p(c(ae),{class:"w-3 h-3"}),r[7]||(r[7]=h(" Preview ",-1))],10,at)):v("",!0),t("span",{class:_(["text-xs px-2 py-0.5 rounded-full",{"bg-yellow-500/10 text-yellow-500":e.status==="pending","bg-blue-500/10 text-blue-500":e.status==="in_progress","bg-green-500/10 text-green-500":e.status==="done","bg-red-500/10 text-red-500":e.status==="failed","bg-orange-500/10 text-orange-500":e.status==="stopped"}])},i(e.status),3)])]),d.value===e.id?(s(),o("div",lt,[p(Ce,{"task-id":e.id,"task-description":e.description,"task-status":e.status,onClose:b,onStopped:n=>e.status="stopped"},null,8,["task-id","task-description","task-status","onStopped"])])):v("",!0)]))),128))]))])],64)):v("",!0)])}}});export{xt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as L}from"./api-
|
|
1
|
+
import{b as L}from"./api-BGxJOfVN.js";import{r as I,u as T,E as B,J as o,q as n,n as t,t as u,T as l,A as M,s as g,k as _,d as f,L as y,K as v,m as N,z as k,a3 as P,R as a,o as x,p,c as b,N as V}from"./index-DEUF9X23.js";import{T as w}from"./triangle-alert-DHJYF3lH.js";import{G as $}from"./git-branch-D3wum5zq.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as y}from"./api-
|
|
1
|
+
import{b as y}from"./api-BGxJOfVN.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{r as h,u as k,E as b,J as o,q as r,n as t,t as i,T as l,k as w,d as L,L as C,K as d,o as S,a3 as N,D as f,N as q,R as n,s as _,p as B}from"./index-DEUF9X23.js";import{G as V}from"./git-branch-D3wum5zq.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as t,J as s,q as r,z as l,n as d}from"./index-
|
|
1
|
+
import{u as t,J as s,q as r,z as l,n as d}from"./index-DEUF9X23.js";const u=["aria-label","aria-checked","disabled"],m=t({__name:"ToggleSwitch",props:{modelValue:{type:Boolean},ariaLabel:{default:"Toggle"},disabled:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(e,{emit:o}){const a=e,i=o;function n(){a.disabled||i("update:modelValue",!a.modelValue)}return(c,b)=>(s(),r("button",{type:"button",role:"switch","aria-label":e.ariaLabel,"aria-checked":e.modelValue,disabled:e.disabled,class:l(["inline-flex h-6 w-10 shrink-0 items-center rounded-full border border-border p-0.5 transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",e.modelValue?"bg-gradient-brand shadow-[0_0_0_1px_rgba(228,58,156,0.35)]":"bg-muted"]),onClick:n},[d("span",{class:l(["pointer-events-none h-4 w-4 rounded-full bg-white shadow-sm ring-1 ring-black/10 transition-transform duration-200",e.modelValue?"translate-x-5":"translate-x-0"])},null,2)],10,u))}});export{m as _};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as L,u as j,E as Q,J as d,q as r,n as t,t as _,T as k,C as W,d as i,L as m,s as w,R as o,k as X,p as u,
|
|
1
|
+
import{r as L,u as j,E as Q,J as d,q as r,n as t,t as _,T as k,C as W,d as i,L as m,s as w,R as o,k as X,p as u,a4 as F,a0 as O,K as a,z as Y,D as Z,m as tt}from"./index-DEUF9X23.js";import{b as T,d as q}from"./api-BGxJOfVN.js";import{T as et}from"./triangle-alert-DHJYF3lH.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as j,u as se,
|
|
1
|
+
import{r as j,u as se,a2 as oe,J as o,q as a,d as b,L as K,m as A,n as t,o as I,T as d,a as ce,t as v,F as ve,R as N,D as pe,z,a6 as fe,p as B,K as c,E as me,B as H,s as S,a4 as V,a0 as L,a5 as R,l as Z}from"./index-DEUF9X23.js";import{b as T,d as E,a as G}from"./api-BGxJOfVN.js";import{S as xe}from"./search-CEJRBdSx.js";import{P as J}from"./plus-DhL0273d.js";import{P as O,S as X}from"./save-D52JPmEZ.js";import{T as Y}from"./trash-2-Cpb3QlxJ.js";import{X as ee}from"./x-yR_yShVB.js";/**
|
|
2
2
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -23,4 +23,4 @@ import{r as j,u as se,a3 as oe,J as o,q as a,d as b,L as K,m as A,n as t,o as I,
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const ye=j("LinkIcon",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),ke={class:"select-none"},we=["onClick"],_e={class:"truncate"},Ce=["onClick"],$e=se({__name:"WikiTree",props:{pages:{},selectedPage:{},searchQuery:{}},emits:["select","addFile"],setup(U,{emit:w}){const x=U,f=w,g=c(new Set);function y(i){const u=[];for(const n of i){const p=n.split("/");let m=u;for(let h=0;h<p.length;h++){const P=p[h],$=p.slice(0,h+1).join("/"),k=h<p.length-1;let F=m.find(D=>D.name===P&&D.isFolder===k);F||(F={name:P,path:$,children:[],isFolder:k},m.push(F)),m=F.children}}const s=n=>{n.sort((p,m)=>p.isFolder!==m.isFolder?p.isFolder?-1:1:p.name.localeCompare(m.name)),n.forEach(p=>s(p.children))};return s(u),u}const _=A(()=>{let i=x.pages;if(x.searchQuery){const u=x.searchQuery.toLowerCase();i=x.pages.filter(s=>s.toLowerCase().includes(u))}return y(i)});oe(()=>x.selectedPage,i=>{if(!i)return;const u=i.split("/");for(let s=1;s<u.length;s++)g.value.add(u.slice(0,s).join("/"))},{immediate:!0});function q(i){g.value.has(i)?g.value.delete(i):g.value.add(i)}function M(i,u){const s=[];for(const n of i)s.push({node:n,depth:u}),n.isFolder&&g.value.has(n.path)&&s.push(...M(n.children,u+1));return s}const C=A(()=>M(_.value,0));return(i,u)=>(o(),a("div",ke,[(o(!0),a(b,null,K(C.value,({node:s,depth:n})=>(o(),a("div",{key:s.path,class:"group relative"},[t("button",{onClick:p=>s.isFolder?q(s.path):f("select",s.path),class:z(["w-full text-left flex items-center gap-1 py-1 text-xs rounded hover:bg-accent transition-colors",{"bg-accent font-medium":!s.isFolder&&U.selectedPage===s.path}]),style:pe({paddingLeft:n*12+8+"px"})},[s.isFolder?(o(),a(b,{key:0},[g.value.has(s.path)?(o(),I(d(ce),{key:0,class:"w-3 h-3 shrink-0 text-muted-foreground"})):(o(),I(d(ge),{key:1,class:"w-3 h-3 shrink-0 text-muted-foreground"})),v(d(be),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)):(o(),a(b,{key:1},[u[0]||(u[0]=t("span",{class:"w-3 shrink-0"},null,-1)),v(d(ve),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)),t("span",_e,N(s.name),1)],14,we),s.isFolder?(o(),a("button",{key:0,onClick:fe(p=>f("addFile",s.path),["stop"]),class:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-primary/10 text-muted-foreground hover:text-primary transition-all",title:"Add file here"},[v(d(he),{class:"w-3.5 h-3.5"})],8,Ce)):B("",!0)]))),128))]))}}),Fe={class:"flex flex-col h-full"},Pe={class:"flex border-b border-border shrink-0"},Te={key:0,class:"flex flex-1 overflow-hidden"},qe={class:"w-64 border-r border-border flex flex-col shrink-0"},Me={class:"p-3 border-b border-border space-y-2"},Se={class:"relative"},Ve={key:0,class:"space-y-1.5"},Le={class:"flex gap-1"},Ne=["disabled"],je={class:"flex-1 overflow-y-auto p-2"},De={key:0,class:"text-xs text-muted-foreground p-2"},Ee={class:"flex-1 flex flex-col overflow-hidden"},ze={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},Be={class:"text-center"},Ie={class:"flex items-center justify-between px-4 py-2 border-b border-border"},Ue={class:"text-sm font-medium font-mono"},Ke={class:"flex gap-1"},Qe={class:"flex-1 overflow-y-auto p-4"},We={key:0,class:"mt-8 pt-4 border-t border-border"},Ae={class:"flex items-center gap-1.5 mb-2 text-xs font-medium text-muted-foreground"},He={class:"space-y-1"},Re=["onClick"],Ze={key:1,class:"flex flex-1 overflow-hidden"},Ge={class:"w-64 border-r border-border flex flex-col shrink-0"},Je={class:"p-3 border-b border-border space-y-2"},Oe={key:0,class:"space-y-1.5"},Xe={class:"flex gap-1"},Ye=["disabled"],et={class:"flex-1 overflow-y-auto p-2"},tt={key:0,class:"text-xs text-muted-foreground p-2"},st={key:1,class:"text-xs text-muted-foreground p-2"},ot=["onClick"],lt={class:"flex-1 flex flex-col overflow-hidden"},at={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},nt={class:"text-center"},rt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},it={class:"text-sm font-medium font-mono"},ut={class:"flex gap-1"},dt={class:"flex-1 overflow-y-auto p-4"},gt=se({__name:"WikiView",setup(U){const w=c("pages"),x=c([]),f=c(null),g=c(""),y=c(!1),_=c(""),q=c(""),M=c(!0),C=c(!1),i=c(""),u=c([]),s=c([]),n=c(null),p=c(""),m=c(!1),h=c(""),P=c(!1),$=c(!1),k=c("");me(async()=>{try{x.value=await T("/wiki/pages")}finally{M.value=!1}}),oe(w,async r=>{if(r==="templates"&&s.value.length===0){P.value=!0;try{s.value=await T("/wiki/templates/squad")}finally{P.value=!1}}});async function F(r){f.value=r,y.value=!1;const e=await T(`/wiki/page/${r}`);g.value=e.content,u.value=await T(`/wiki/backlinks/${r}`)}function D(){_.value=g.value,y.value=!0}async function le(){f.value&&(await E(`/wiki/page/${f.value}`,{content:_.value}),g.value=_.value,y.value=!1,u.value=await T(`/wiki/backlinks/${f.value}`))}async function ae(){f.value&&confirm(`Delete "${f.value}"?`)&&(await J(`/wiki/page/${f.value}`),x.value=x.value.filter(r=>r!==f.value),f.value=null,g.value="",u.value=[])}async function Q(){const r=i.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/page/${e}`,{content:""}),x.value.includes(e)||(x.value.push(e),x.value.sort()),C.value=!1,i.value="",f.value=e,g.value="",_.value="",y.value=!0,u.value=[]}async function ne(r){n.value=r,m.value=!1;const e=await T(`/wiki/template/squad/${r}`);p.value=e.content}function re(){h.value=p.value,m.value=!0}async function ie(){n.value&&(await E(`/wiki/template/squad/${n.value}`,{content:h.value}),p.value=h.value,m.value=!1)}async function ue(){n.value&&confirm(`Delete template "${n.value}"?`)&&(await J(`/wiki/template/squad/${n.value}`),s.value=s.value.filter(r=>r!==n.value),n.value=null,p.value="")}async function W(){const r=k.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/template/squad/${e}`,{content:""}),s.value.includes(e)||(s.value.push(e),s.value.sort()),$.value=!1,k.value="",n.value=e,p.value="",h.value="",m.value=!0}return(r,e)=>(o(),a("div",Fe,[t("div",Pe,[t("button",{onClick:e[0]||(e[0]=l=>w.value="pages"),class:z(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",w.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},[v(d(H),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[15]||(e[15]=S(" Pages ",-1))],2),t("button",{onClick:e[1]||(e[1]=l=>w.value="templates"),class:z(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",w.value==="templates"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},[v(d(te),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[16]||(e[16]=S(" Squad Templates ",-1))],2)]),w.value==="pages"?(o(),a("div",Te,[t("div",qe,[t("div",Me,[t("div",Se,[v(d(xe),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),V(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>q.value=l),placeholder:"Search pages...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,q.value]])]),t("button",{onClick:e[3]||(e[3]=l=>C.value=!C.value),class:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[v(d(O),{class:"w-3.5 h-3.5"}),e[17]||(e[17]=S(" New Page ",-1))]),C.value?(o(),a("div",Ve,[V(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>i.value=l),placeholder:"path/to/page.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(Q,["enter"])},null,544),[[L,i.value]]),t("div",Le,[t("button",{onClick:Q,disabled:!i.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}," Create ",8,Ne),t("button",{onClick:e[5]||(e[5]=l=>{C.value=!1,i.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):B("",!0)]),t("div",je,[M.value?(o(),a("div",De,"Loading...")):(o(),I($e,{key:1,pages:x.value,"selected-page":f.value,"search-query":q.value,onSelect:e[6]||(e[6]=l=>F(l)),onAddFile:e[7]||(e[7]=l=>{C.value=!0,i.value=l+"/"})},null,8,["pages","selected-page","search-query"]))])]),t("div",Ee,[f.value?(o(),a(b,{key:1},[t("div",Ie,[t("span",Ue,N(f.value),1),t("div",Ke,[y.value?(o(),a(b,{key:1},[t("button",{onClick:le,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(Y),{class:"w-4 h-4"})]),t("button",{onClick:e[8]||(e[8]=l=>y.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(d(Z),{class:"w-4 h-4"})])],64)):(o(),a(b,{key:0},[t("button",{onClick:D,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(d(X),{class:"w-4 h-4"})]),t("button",{onClick:ae,class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[v(d(ee),{class:"w-4 h-4"})])],64))])]),t("div",Qe,[y.value?V((o(),a("textarea",{key:0,"onUpdate:modelValue":e[9]||(e[9]=l=>_.value=l),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,_.value]]):(o(),a(b,{key:1},[v(G,{content:g.value},null,8,["content"]),u.value.length>0?(o(),a("div",We,[t("div",Ae,[v(d(ye),{class:"w-3.5 h-3.5"}),e[19]||(e[19]=S(" Backlinks ",-1))]),t("ul",He,[(o(!0),a(b,null,K(u.value,l=>(o(),a("li",{key:l},[t("button",{onClick:de=>F(l),class:"text-xs text-primary hover:underline font-mono"},N(l),9,Re)]))),128))])])):B("",!0)],64))])],64)):(o(),a("div",ze,[t("div",Be,[v(d(H),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a page to view",-1))])]))])])):(o(),a("div",Ze,[t("div",Ge,[t("div",Je,[e[21]||(e[21]=t("p",{class:"text-xs text-muted-foreground"}," Files copied verbatim into each new squad's wiki directory on creation. ",-1)),t("button",{onClick:e[10]||(e[10]=l=>$.value=!$.value),class:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[v(d(O),{class:"w-3.5 h-3.5"}),e[20]||(e[20]=S(" New Template ",-1))]),$.value?(o(),a("div",Oe,[V(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>k.value=l),placeholder:"filename.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(W,["enter"])},null,544),[[L,k.value]]),t("div",Xe,[t("button",{onClick:W,disabled:!k.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}," Create ",8,Ye),t("button",{onClick:e[12]||(e[12]=l=>{$.value=!1,k.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):B("",!0)]),t("div",et,[P.value?(o(),a("div",tt,"Loading...")):s.value.length===0?(o(),a("div",st,"No templates yet.")):(o(!0),a(b,{key:2},K(s.value,l=>(o(),a("button",{key:l,onClick:de=>ne(l),class:z(["w-full text-left px-2 py-1.5 text-xs rounded hover:bg-accent font-mono truncate",n.value===l?"bg-accent text-accent-foreground":"text-foreground"])},N(l),11,ot))),128))])]),t("div",lt,[n.value?(o(),a(b,{key:1},[t("div",rt,[t("span",it,N(n.value),1),t("div",ut,[m.value?(o(),a(b,{key:1},[t("button",{onClick:ie,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(Y),{class:"w-4 h-4"})]),t("button",{onClick:e[13]||(e[13]=l=>m.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(d(Z),{class:"w-4 h-4"})])],64)):(o(),a(b,{key:0},[t("button",{onClick:re,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(d(X),{class:"w-4 h-4"})]),t("button",{onClick:ue,class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[v(d(ee),{class:"w-4 h-4"})])],64))])]),t("div",dt,[m.value?V((o(),a("textarea",{key:0,"onUpdate:modelValue":e[14]||(e[14]=l=>h.value=l),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,h.value]]):(o(),I(G,{key:1,content:p.value},null,8,["content"]))])],64)):(o(),a("div",at,[t("div",nt,[v(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[22]||(e[22]=t("p",null,"Select a template to edit",-1)),e[23]||(e[23]=t("p",{class:"text-xs mt-1"},"Templates are copied into new squads on creation",-1))])]))])]))]))}});export{gt as default};
|
|
26
|
+
*/const ye=j("LinkIcon",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),ke={class:"select-none"},we=["onClick"],_e={class:"truncate"},Ce=["onClick"],$e=se({__name:"WikiTree",props:{pages:{},selectedPage:{},searchQuery:{}},emits:["select","addFile"],setup(U,{emit:w}){const x=U,f=w,g=c(new Set);function y(i){const u=[];for(const n of i){const p=n.split("/");let m=u;for(let h=0;h<p.length;h++){const P=p[h],$=p.slice(0,h+1).join("/"),k=h<p.length-1;let F=m.find(D=>D.name===P&&D.isFolder===k);F||(F={name:P,path:$,children:[],isFolder:k},m.push(F)),m=F.children}}const s=n=>{n.sort((p,m)=>p.isFolder!==m.isFolder?p.isFolder?-1:1:p.name.localeCompare(m.name)),n.forEach(p=>s(p.children))};return s(u),u}const _=A(()=>{let i=x.pages;if(x.searchQuery){const u=x.searchQuery.toLowerCase();i=x.pages.filter(s=>s.toLowerCase().includes(u))}return y(i)});oe(()=>x.selectedPage,i=>{if(!i)return;const u=i.split("/");for(let s=1;s<u.length;s++)g.value.add(u.slice(0,s).join("/"))},{immediate:!0});function q(i){g.value.has(i)?g.value.delete(i):g.value.add(i)}function M(i,u){const s=[];for(const n of i)s.push({node:n,depth:u}),n.isFolder&&g.value.has(n.path)&&s.push(...M(n.children,u+1));return s}const C=A(()=>M(_.value,0));return(i,u)=>(o(),a("div",ke,[(o(!0),a(b,null,K(C.value,({node:s,depth:n})=>(o(),a("div",{key:s.path,class:"group relative"},[t("button",{onClick:p=>s.isFolder?q(s.path):f("select",s.path),class:z(["w-full text-left flex items-center gap-1 py-1 text-xs rounded hover:bg-accent transition-colors",{"bg-accent font-medium":!s.isFolder&&U.selectedPage===s.path}]),style:pe({paddingLeft:n*12+8+"px"})},[s.isFolder?(o(),a(b,{key:0},[g.value.has(s.path)?(o(),I(d(ce),{key:0,class:"w-3 h-3 shrink-0 text-muted-foreground"})):(o(),I(d(ge),{key:1,class:"w-3 h-3 shrink-0 text-muted-foreground"})),v(d(be),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)):(o(),a(b,{key:1},[u[0]||(u[0]=t("span",{class:"w-3 shrink-0"},null,-1)),v(d(ve),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)),t("span",_e,N(s.name),1)],14,we),s.isFolder?(o(),a("button",{key:0,onClick:fe(p=>f("addFile",s.path),["stop"]),class:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 rounded opacity-0 group-hover:opacity-100 hover:bg-primary/10 text-muted-foreground hover:text-primary transition-all",title:"Add file here"},[v(d(he),{class:"w-3.5 h-3.5"})],8,Ce)):B("",!0)]))),128))]))}}),Fe={class:"flex flex-col h-full"},Pe={class:"flex border-b border-border shrink-0"},Te={key:0,class:"flex flex-1 overflow-hidden"},qe={class:"w-64 border-r border-border flex flex-col shrink-0"},Me={class:"p-3 border-b border-border space-y-2"},Se={class:"relative"},Ve={key:0,class:"space-y-1.5"},Le={class:"flex gap-1"},Ne=["disabled"],je={class:"flex-1 overflow-y-auto p-2"},De={key:0,class:"text-xs text-muted-foreground p-2"},Ee={class:"flex-1 flex flex-col overflow-hidden"},ze={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},Be={class:"text-center"},Ie={class:"flex items-center justify-between px-4 py-2 border-b border-border"},Ue={class:"text-sm font-medium font-mono"},Ke={class:"flex gap-1"},Qe={class:"flex-1 overflow-y-auto p-4"},We={key:0,class:"mt-8 pt-4 border-t border-border"},Ae={class:"flex items-center gap-1.5 mb-2 text-xs font-medium text-muted-foreground"},He={class:"space-y-1"},Re=["onClick"],Ze={key:1,class:"flex flex-1 overflow-hidden"},Ge={class:"w-64 border-r border-border flex flex-col shrink-0"},Je={class:"p-3 border-b border-border space-y-2"},Oe={key:0,class:"space-y-1.5"},Xe={class:"flex gap-1"},Ye=["disabled"],et={class:"flex-1 overflow-y-auto p-2"},tt={key:0,class:"text-xs text-muted-foreground p-2"},st={key:1,class:"text-xs text-muted-foreground p-2"},ot=["onClick"],lt={class:"flex-1 flex flex-col overflow-hidden"},at={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},nt={class:"text-center"},rt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},it={class:"text-sm font-medium font-mono"},ut={class:"flex gap-1"},dt={class:"flex-1 overflow-y-auto p-4"},ht=se({__name:"WikiView",setup(U){const w=c("pages"),x=c([]),f=c(null),g=c(""),y=c(!1),_=c(""),q=c(""),M=c(!0),C=c(!1),i=c(""),u=c([]),s=c([]),n=c(null),p=c(""),m=c(!1),h=c(""),P=c(!1),$=c(!1),k=c("");me(async()=>{try{x.value=await T("/wiki/pages")}finally{M.value=!1}}),oe(w,async r=>{if(r==="templates"&&s.value.length===0){P.value=!0;try{s.value=await T("/wiki/templates/squad")}finally{P.value=!1}}});async function F(r){f.value=r,y.value=!1;const e=await T(`/wiki/page/${r}`);g.value=e.content,u.value=await T(`/wiki/backlinks/${r}`)}function D(){_.value=g.value,y.value=!0}async function le(){f.value&&(await E(`/wiki/page/${f.value}`,{content:_.value}),g.value=_.value,y.value=!1,u.value=await T(`/wiki/backlinks/${f.value}`))}async function ae(){f.value&&confirm(`Delete "${f.value}"?`)&&(await G(`/wiki/page/${f.value}`),x.value=x.value.filter(r=>r!==f.value),f.value=null,g.value="",u.value=[])}async function Q(){const r=i.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/page/${e}`,{content:""}),x.value.includes(e)||(x.value.push(e),x.value.sort()),C.value=!1,i.value="",f.value=e,g.value="",_.value="",y.value=!0,u.value=[]}async function ne(r){n.value=r,m.value=!1;const e=await T(`/wiki/template/squad/${r}`);p.value=e.content}function re(){h.value=p.value,m.value=!0}async function ie(){n.value&&(await E(`/wiki/template/squad/${n.value}`,{content:h.value}),p.value=h.value,m.value=!1)}async function ue(){n.value&&confirm(`Delete template "${n.value}"?`)&&(await G(`/wiki/template/squad/${n.value}`),s.value=s.value.filter(r=>r!==n.value),n.value=null,p.value="")}async function W(){const r=k.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/template/squad/${e}`,{content:""}),s.value.includes(e)||(s.value.push(e),s.value.sort()),$.value=!1,k.value="",n.value=e,p.value="",h.value="",m.value=!0}return(r,e)=>(o(),a("div",Fe,[t("div",Pe,[t("button",{onClick:e[0]||(e[0]=l=>w.value="pages"),class:z(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",w.value==="pages"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},[v(d(H),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[15]||(e[15]=S(" Pages ",-1))],2),t("button",{onClick:e[1]||(e[1]=l=>w.value="templates"),class:z(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",w.value==="templates"?"border-primary text-primary":"border-transparent text-muted-foreground hover:text-foreground"])},[v(d(te),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[16]||(e[16]=S(" Squad Templates ",-1))],2)]),w.value==="pages"?(o(),a("div",Te,[t("div",qe,[t("div",Me,[t("div",Se,[v(d(xe),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),V(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>q.value=l),placeholder:"Search pages...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,q.value]])]),t("button",{onClick:e[3]||(e[3]=l=>C.value=!C.value),class:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[v(d(J),{class:"w-3.5 h-3.5"}),e[17]||(e[17]=S(" New Page ",-1))]),C.value?(o(),a("div",Ve,[V(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>i.value=l),placeholder:"path/to/page.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(Q,["enter"])},null,544),[[L,i.value]]),t("div",Le,[t("button",{onClick:Q,disabled:!i.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}," Create ",8,Ne),t("button",{onClick:e[5]||(e[5]=l=>{C.value=!1,i.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):B("",!0)]),t("div",je,[M.value?(o(),a("div",De,"Loading...")):(o(),I($e,{key:1,pages:x.value,"selected-page":f.value,"search-query":q.value,onSelect:e[6]||(e[6]=l=>F(l)),onAddFile:e[7]||(e[7]=l=>{C.value=!0,i.value=l+"/"})},null,8,["pages","selected-page","search-query"]))])]),t("div",Ee,[f.value?(o(),a(b,{key:1},[t("div",Ie,[t("span",Ue,N(f.value),1),t("div",Ke,[y.value?(o(),a(b,{key:1},[t("button",{onClick:le,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(X),{class:"w-4 h-4"})]),t("button",{onClick:e[8]||(e[8]=l=>y.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(d(ee),{class:"w-4 h-4"})])],64)):(o(),a(b,{key:0},[t("button",{onClick:D,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(d(O),{class:"w-4 h-4"})]),t("button",{onClick:ae,class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[v(d(Y),{class:"w-4 h-4"})])],64))])]),t("div",Qe,[y.value?V((o(),a("textarea",{key:0,"onUpdate:modelValue":e[9]||(e[9]=l=>_.value=l),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,_.value]]):(o(),a(b,{key:1},[v(Z,{content:g.value},null,8,["content"]),u.value.length>0?(o(),a("div",We,[t("div",Ae,[v(d(ye),{class:"w-3.5 h-3.5"}),e[19]||(e[19]=S(" Backlinks ",-1))]),t("ul",He,[(o(!0),a(b,null,K(u.value,l=>(o(),a("li",{key:l},[t("button",{onClick:de=>F(l),class:"text-xs text-primary hover:underline font-mono"},N(l),9,Re)]))),128))])])):B("",!0)],64))])],64)):(o(),a("div",ze,[t("div",Be,[v(d(H),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a page to view",-1))])]))])])):(o(),a("div",Ze,[t("div",Ge,[t("div",Je,[e[21]||(e[21]=t("p",{class:"text-xs text-muted-foreground"}," Files copied verbatim into each new squad's wiki directory on creation. ",-1)),t("button",{onClick:e[10]||(e[10]=l=>$.value=!$.value),class:"w-full flex items-center justify-center gap-1.5 px-2 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},[v(d(J),{class:"w-3.5 h-3.5"}),e[20]||(e[20]=S(" New Template ",-1))]),$.value?(o(),a("div",Oe,[V(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>k.value=l),placeholder:"filename.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(W,["enter"])},null,544),[[L,k.value]]),t("div",Xe,[t("button",{onClick:W,disabled:!k.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"}," Create ",8,Ye),t("button",{onClick:e[12]||(e[12]=l=>{$.value=!1,k.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):B("",!0)]),t("div",et,[P.value?(o(),a("div",tt,"Loading...")):s.value.length===0?(o(),a("div",st,"No templates yet.")):(o(!0),a(b,{key:2},K(s.value,l=>(o(),a("button",{key:l,onClick:de=>ne(l),class:z(["w-full text-left px-2 py-1.5 text-xs rounded hover:bg-accent font-mono truncate",n.value===l?"bg-accent text-accent-foreground":"text-foreground"])},N(l),11,ot))),128))])]),t("div",lt,[n.value?(o(),a(b,{key:1},[t("div",rt,[t("span",it,N(n.value),1),t("div",ut,[m.value?(o(),a(b,{key:1},[t("button",{onClick:ie,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(X),{class:"w-4 h-4"})]),t("button",{onClick:e[13]||(e[13]=l=>m.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(d(ee),{class:"w-4 h-4"})])],64)):(o(),a(b,{key:0},[t("button",{onClick:re,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(d(O),{class:"w-4 h-4"})]),t("button",{onClick:ue,class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[v(d(Y),{class:"w-4 h-4"})])],64))])]),t("div",dt,[m.value?V((o(),a("textarea",{key:0,"onUpdate:modelValue":e[14]||(e[14]=l=>h.value=l),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,h.value]]):(o(),I(Z,{key:1,content:p.value},null,8,["content"]))])],64)):(o(),a("div",at,[t("div",nt,[v(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[22]||(e[22]=t("p",null,"Select a template to edit",-1)),e[23]||(e[23]=t("p",{class:"text-xs mt-1"},"Templates are copied into new squads on creation",-1))])]))])]))]))}});export{ht as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{V as i,O as c}from"./index-
|
|
1
|
+
import{V as i,O as c}from"./index-DEUF9X23.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
|