heyio 1.6.0 → 1.7.0

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.
Files changed (41) hide show
  1. package/dist/api/server.js +8 -5
  2. package/package.json +1 -1
  3. package/web-dist/assets/{AuditLogView-BPJtNXCS.js → AuditLogView-DDtYucjR.js} +2 -2
  4. package/web-dist/assets/ChatView-Cf_L3wy0.js +1 -0
  5. package/web-dist/assets/FeedView-D_XcxzJP.js +6 -0
  6. package/web-dist/assets/HistoryView-6_ykti0r.js +1 -0
  7. package/web-dist/assets/LoginView-DTYomLTi.js +1 -0
  8. package/web-dist/assets/McpView-CewsPyFJ.js +1 -0
  9. package/web-dist/assets/{SchedulesView-DAcPfnmZ.js → SchedulesView-BaQf3EWF.js} +2 -2
  10. package/web-dist/assets/SettingsView-XiEfBZXk.js +1 -0
  11. package/web-dist/assets/{SkillsView-DtnR6ZeP.js → SkillsView-CipFd9n-.js} +4 -4
  12. package/web-dist/assets/SquadDetailView-B1CqbDDD.js +26 -0
  13. package/web-dist/assets/{SquadHealthView-Dt_cBi_C.js → SquadHealthView-BaTpQNnY.js} +3 -3
  14. package/web-dist/assets/SquadsView-B1HzN-Cf.js +6 -0
  15. package/web-dist/assets/{ToggleSwitch.vue_vue_type_script_setup_true_lang-qLsSQnXV.js → ToggleSwitch.vue_vue_type_script_setup_true_lang-CErIbExm.js} +1 -1
  16. package/web-dist/assets/{UsageView-Dhuu6mVo.js → UsageView-JZ5H9i7W.js} +4 -4
  17. package/web-dist/assets/WikiView-BxszV6hw.js +26 -0
  18. package/web-dist/assets/{api-CdLJWHnn.js → api-C541TEY3.js} +1 -1
  19. package/web-dist/assets/{x-D82kR2fu.js → arrow-left-nhBAfMBE.js} +2 -2
  20. package/web-dist/assets/{git-branch-D5N3GVQo.js → git-branch-DphZXMIK.js} +1 -1
  21. package/web-dist/assets/index-C5YYUXmF.css +1 -0
  22. package/web-dist/assets/index-DziJbtpI.js +279 -0
  23. package/web-dist/assets/{plus-CoUrXVZm.js → plus-CpX77g5Z.js} +1 -1
  24. package/web-dist/assets/{save-CttKqFu3.js → save-BKKruDuc.js} +1 -1
  25. package/web-dist/assets/{search-CMwjTbNl.js → search-Cq5DDOqi.js} +1 -1
  26. package/web-dist/assets/{trash-2-C1-PiQou.js → trash-2-BFUOVlMJ.js} +1 -1
  27. package/web-dist/assets/{triangle-alert-BKZFqU_A.js → triangle-alert-HO1kqixB.js} +2 -2
  28. package/web-dist/index.html +2 -2
  29. package/web-dist/assets/ChatView-Brk1nps-.js +0 -11
  30. package/web-dist/assets/FeedView-DtpTOb4B.js +0 -6
  31. package/web-dist/assets/HistoryView-CErxUNk_.js +0 -1
  32. package/web-dist/assets/LoginView-CWiUkg95.js +0 -1
  33. package/web-dist/assets/McpView-C-td_je_.js +0 -1
  34. package/web-dist/assets/SettingsView-559gPpax.js +0 -1
  35. package/web-dist/assets/SquadDetailView-HYYd2HvB.js +0 -26
  36. package/web-dist/assets/SquadsView-DdywGIi2.js +0 -6
  37. package/web-dist/assets/WikiView-DWun-CTD.js +0 -31
  38. package/web-dist/assets/arrow-left-27p7HUxd.js +0 -6
  39. package/web-dist/assets/file-text-Dk0fT3q_.js +0 -6
  40. package/web-dist/assets/index-CZM0UQQJ.js +0 -254
  41. package/web-dist/assets/index-CoyYyx4A.css +0 -1
@@ -1,4 +1,4 @@
1
- import{l as e}from"./index-CZM0UQQJ.js";/**
1
+ import{r as e}from"./index-DziJbtpI.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{l as a}from"./index-CZM0UQQJ.js";/**
1
+ import{r as a}from"./index-DziJbtpI.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{l as c}from"./index-CZM0UQQJ.js";/**
1
+ import{r as c}from"./index-DziJbtpI.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{l as e}from"./index-CZM0UQQJ.js";/**
1
+ import{r as e}from"./index-DziJbtpI.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,6 +1,6 @@
1
- import{l as e}from"./index-CZM0UQQJ.js";/**
1
+ import{r as e}from"./index-DziJbtpI.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 t=e("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);export{t as T};
6
+ */const r=e("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);export{r as T};
@@ -5,8 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>IO — Dashboard</title>
7
7
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
8
- <script type="module" crossorigin src="/assets/index-CZM0UQQJ.js"></script>
9
- <link rel="stylesheet" crossorigin href="/assets/index-CoyYyx4A.css">
8
+ <script type="module" crossorigin src="/assets/index-DziJbtpI.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-C5YYUXmF.css">
10
10
  </head>
11
11
  <body class="bg-background text-foreground">
12
12
  <div id="app"></div>
@@ -1,11 +0,0 @@
1
- import{l as U,o as R,G as W,Q as B,s as Y,u as a,k as l,h as r,D as t,n as T,j as y,F as A,w as S,z as v,T as G,O as Q,i as h,S as J,d as Z,q as k,v as x,g as I,_ as ee,f as te,p as z}from"./index-CZM0UQQJ.js";import{F as E}from"./file-text-Dk0fT3q_.js";import{X as se}from"./x-D82kR2fu.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const F=U("ImageIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
7
- * @license lucide-vue-next v0.474.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ae=U("PaperclipIcon",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]),L=10*1024*1024,P=25*1024*1024;function _(n){return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:`${(n/(1024*1024)).toFixed(1)} MB`}function D(n){return n.mimeType.startsWith("image/")}function ne(n){return`data:${n.mimeType};base64,${n.content}`}async function oe(n){const i=await new Promise((d,g)=>{const m=new FileReader;m.onload=()=>d(String(m.result??"")),m.onerror=()=>g(new Error("Unable to read file")),m.readAsDataURL(n)}),c=i.indexOf(",");if(c===-1)throw new Error(`Unable to parse file content for ${n.name}`);return{name:n.name,mimeType:n.type||"application/octet-stream",size:n.size,content:i.slice(c+1)}}function re(n){for(const c of n)if(c.size>L)return{ok:!1,error:`"${c.name}" exceeds the 10MB per-file limit.`};return n.reduce((c,d)=>c+d.size,0)>P?{ok:!1,error:"Attachments exceed the 25MB per-message limit."}:{ok:!0}}const le={class:"flex flex-col h-full"},ce={key:0,class:"flex items-center justify-center h-full"},ie={class:"text-center text-muted-foreground"},ue={key:0,class:"mb-2 space-y-2"},de=["src","alt"],me={class:"flex items-center gap-2 text-xs"},pe={class:"truncate"},fe={class:"opacity-70"},ve={key:2,class:"text-muted-foreground"},he={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ge={key:0,class:"mb-2 space-y-2"},ye={class:"flex flex-wrap gap-2"},xe={class:"max-w-[170px] truncate"},_e={class:"opacity-70"},be=["onClick"],ke={class:"text-xs text-muted-foreground"},we={key:1,class:"text-xs text-destructive mb-2"},Te={class:"flex gap-2 items-end"},Ae=["disabled"],Se=["disabled"],$e=R({__name:"ChatView",setup(n){const i=W(),c=x(""),d=x(""),g=x(),m=x(),p=x([]),b=x(!1),j=I(()=>p.value.reduce((e,o)=>e+o.size,0)),C=I(()=>!i.isStreaming&&(c.value.trim().length>0||p.value.length>0));async function M(e){if(!e||e.length===0)return;d.value="";const o=[];try{for(const f of Array.from(e))o.push(await oe(f))}catch(f){d.value=(f==null?void 0:f.message)??"Unable to read one or more files.";return}const s=[...p.value,...o],u=re(s);if(!u.ok){d.value=u.error;return}p.value=s,m.value&&(m.value.value="")}function N(e){p.value.splice(e,1),d.value=""}function O(){var e;(e=m.value)==null||e.click()}function V(e){const o=e.target;M((o==null?void 0:o.files)??null)}async function $(){if(!C.value)return;const e=c.value.trim(),o=[...p.value],s=e||"Please review the attached file(s).";c.value="",p.value=[],d.value="",await i.sendMessage(s,o)}function w(){g.value&&(g.value.scrollTop=g.value.scrollHeight)}function K(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),$())}function q(e){e.preventDefault(),b.value=!0}function H(e){e.preventDefault(),b.value=!1}async function X(e){var o;e.preventDefault(),b.value=!1,await M(((o=e.dataTransfer)==null?void 0:o.files)??null)}return B(()=>i.messages.map(e=>e.content),async()=>{await z(),w()},{deep:!0}),B(()=>i.messages.length,async()=>{await z(),w()}),Y(()=>w()),(e,o)=>(a(),l("div",le,[r("div",{ref_key:"messagesContainer",ref:g,class:"flex-1 overflow-y-auto p-4 space-y-4"},[t(i).messages.length===0?(a(),l("div",ce,[r("div",ie,[T(ee,{size:56,class:"mx-auto mb-4"}),o[1]||(o[1]=r("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),o[2]||(o[2]=r("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):y("",!0),(a(!0),l(A,null,S(t(i).messages,s=>(a(),l("div",{key:s.id,class:k(["flex",s.role==="user"?"justify-end":"justify-start"])},[r("div",{class:k(["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(),l("div",ue,[(a(!0),l(A,null,S(s.attachments,(u,f)=>(a(),l("div",{key:`${s.id}-${f}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[t(D)(u)?(a(),l("img",{key:0,src:t(ne)(u),alt:u.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,de)):y("",!0),r("div",me,[t(D)(u)?(a(),h(t(F),{key:0,class:"w-3.5 h-3.5"})):(a(),h(t(E),{key:1,class:"w-3.5 h-3.5"})),r("span",pe,v(u.name),1),r("span",fe,v(t(_)(u.size)),1)])]))),128))])):y("",!0),s.content?(a(),h(te,{key:1,content:s.content,class:k(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):(a(),l("span",ve,"...")),s.streaming?(a(),l("div",he)):y("",!0)],2)],2))),128))],512),r("div",{class:k(["border-t border-border p-4",b.value?"bg-accent/40":""]),onDragover:q,onDragleave:H,onDrop:X},[r("input",{ref_key:"fileInput",ref:m,type:"file",multiple:"",class:"hidden",onChange:V},null,544),p.value.length>0?(a(),l("div",ge,[r("div",ye,[(a(!0),l(A,null,S(p.value,(s,u)=>(a(),l("div",{key:`${s.name}-${u}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[t(D)(s)?(a(),h(t(F),{key:0,class:"w-3.5 h-3.5"})):(a(),h(t(E),{key:1,class:"w-3.5 h-3.5"})),r("span",xe,v(s.name),1),r("span",_e,v(t(_)(s.size)),1),r("button",{class:"hover:text-destructive",onClick:f=>N(u)},[T(t(se),{class:"w-3.5 h-3.5"})],8,be)]))),128))]),r("p",ke,v(t(_)(j.value))+" attached · Max per file "+v(t(_)(t(L)))+" · Max total "+v(t(_)(t(P))),1)])):y("",!0),d.value?(a(),l("p",we,v(d.value),1)):y("",!0),r("div",Te,[r("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:t(i).isStreaming,onClick:O,title:"Attach files"},[T(t(ae),{class:"w-4 h-4"})],8,Ae),G(r("textarea",{"onUpdate:modelValue":o[0]||(o[0]=s=>c.value=s),onKeydown:K,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,c.value]]),r("button",{onClick:$,disabled:!C.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[t(i).isStreaming?(a(),h(t(Z),{key:1,class:"w-4 h-4"})):(a(),h(t(J),{key:0,class:"w-4 h-4"}))],8,Se)])],34)]))}});export{$e as default};
@@ -1,6 +0,0 @@
1
- import{l as M,o as D,s as N,u as o,k as n,h as a,F as y,w as b,n as c,D as i,I as V,v as d,g as z,q as f,z as v,r as B,W as k,j as q,f as j}from"./index-CZM0UQQJ.js";import{b as C,c as P,a as T}from"./api-CdLJWHnn.js";import{g as W}from"./squad-colors-B8B_Y-lz.js";import{T as A}from"./trash-2-C1-PiQou.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const E=M("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),G={class:"p-6"},R={class:"flex items-center justify-between mb-6"},U={class:"flex gap-2"},H=["onClick"],J={key:0,class:"text-muted-foreground"},K={key:1,class:"text-center py-12 text-muted-foreground"},O={key:2,class:"space-y-2"},Q=["onClick"],X={class:"flex-1 min-w-0"},Y={class:"flex items-center gap-2"},Z={class:"text-xs text-muted-foreground mt-0.5"},ee={class:"flex gap-1"},te=["onClick"],se=["onClick"],ae={key:0,class:"px-4 pb-3 border-t border-border pt-3"},ue=D({__name:"FeedView",setup(oe){const r=d([]),x=d([]),l=d(0),p=d("all"),m=d(!0),u=d(null);async function g(){m.value=!0;try{const e=await C(`/feed?unread=${p.value==="unread"}`);r.value=e.items,l.value=e.unreadCount}finally{m.value=!1}}async function w(){const e=await C("/squads");x.value=e.squads}async function h(e){await P(`/feed/${e}/read`);const s=r.value.find(t=>t.id===e);s&&(s.read=1,l.value=Math.max(0,l.value-1))}async function $(e){await T(`/feed/${e}`),r.value=r.value.filter(s=>s.id!==e)}function I(e){u.value=u.value===e?null:e,u.value===e&&h(e)}function S(e){if(!e.startsWith("squad-"))return;const s=e.slice(6);return x.value.find(t=>t.id===s)}const F=z(()=>r.value.map(e=>{const s=S(e.source);return{...e,squad:s}}));N(async()=>{await Promise.all([g(),w()])});function L(e){var s;return((s=e.squad)==null?void 0:s.name)??e.source}return(e,s)=>(o(),n("div",G,[a("div",R,[s[0]||(s[0]=a("h1",{class:"text-2xl font-bold"},"Feed",-1)),a("div",U,[(o(),n(y,null,b(["all","unread"],t=>a("button",{key:t,onClick:_=>{p.value=t,g()},class:f(["px-3 py-1.5 text-xs rounded-md border transition-colors",p.value===t?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"])},v(t==="all"?"All":`Unread (${l.value})`),11,H)),64))])]),m.value?(o(),n("div",J,"Loading...")):r.value.length===0?(o(),n("div",K,[c(i(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s[1]||(s[1]=a("p",null,"No feed items.",-1))])):(o(),n("div",O,[(o(!0),n(y,null,b(F.value,t=>(o(),n("div",{key:t.id,class:f(["border border-border rounded-lg overflow-hidden",{"border-l-2 border-l-primary":!t.read}])},[a("div",{onClick:_=>I(t.id),class:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[a("div",X,[a("div",Y,[a("span",{class:f(["text-xs px-2 py-0.5 rounded-full",{"bg-secondary text-secondary-foreground":!t.squad}]),style:B(t.squad?i(W)(t.squad.color):{})},v(L(t)),7),a("span",{class:f(["text-sm font-medium truncate",{"font-bold":!t.read}])},v(t.title),3)]),a("p",Z,v(t.created_at),1)]),a("div",ee,[t.read?q("",!0):(o(),n("button",{key:0,onClick:k(_=>h(t.id),["stop"]),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Mark as read"},[c(i(E),{class:"w-3.5 h-3.5"})],8,te)),a("button",{onClick:k(_=>$(t.id),["stop"]),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[c(i(A),{class:"w-3.5 h-3.5"})],8,se)])],8,Q),u.value===t.id?(o(),n("div",ae,[c(j,{content:t.content},null,8,["content"])])):q("",!0)],2))),128))]))]))}});export{ue as default};
@@ -1 +0,0 @@
1
- import{o as U,Q as q,s as z,u as r,k as n,h as t,n as d,D as c,H as V,T,O as D,M as P,j as x,F as $,w as j,q as p,z as g,v as l,g as Q,i as E,f as G}from"./index-CZM0UQQJ.js";import{b as A,a as O}from"./api-CdLJWHnn.js";import{S as R}from"./search-CMwjTbNl.js";import{A as I}from"./arrow-left-27p7HUxd.js";import{T as J}from"./trash-2-C1-PiQou.js";const K={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,Le=U({__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 A(`/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 B(o){u.value=o,_.value=!0;try{b.value=await A(`/history/${o}`)}finally{_.value=!1}}function L(){u.value=null,b.value=[]}async function F(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await O(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&L())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function H(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const N=Q(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",K,[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(V),{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(R),{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),[[D,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),[[D,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),[[D,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(P),{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,j(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:M=>B(s.id)},[t("div",ae,[t("p",le,g(H(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:M=>F(s.id,M)},[d(c(J),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),N.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:L},[d(c(I),{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,j(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(),E(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(V),{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{Le as default};
@@ -1 +0,0 @@
1
- import{o as b,E as v,u,k as i,h as t,n as y,W as w,T as m,O as p,z as f,j as h,D as g,v as d,_,K as S}from"./index-CZM0UQQJ.js";const V={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},D={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(E){const o=v(),c=S(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),c.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",V,[t("div",k,[t("div",D,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"text-2xl font-bold 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,f(s.value),1)):h("",!0),t("button",{type:"submit",disabled:g(o).loading,class:"btn-gradient w-full py-2.5"},f(g(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};
@@ -1 +0,0 @@
1
- import{o as S,s as C,u as l,k as a,h as s,n as c,D as b,m as E,T as i,O as m,N as j,j as x,c as M,F as P,w as U,v as f,z as p}from"./index-CZM0UQQJ.js";import{b as $,c as I,d as N,a as O}from"./api-CdLJWHnn.js";import{_ as F}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-qLsSQnXV.js";import{P as G}from"./plus-CoUrXVZm.js";import{T as L}from"./trash-2-C1-PiQou.js";const K={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},h={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},B={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},z={key:1,class:"text-muted-foreground"},R={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},q={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=S({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});C(async()=>{try{u.value=await $("/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 O(`/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",K,[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]=E(" Add Server ",-1))])]),v.value?(l(),a("div",h,[s("div",B,[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),[[j,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",z,"Loading...")):u.value.length===0?(l(),a("div",R,[c(b(M),{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(P,null,U(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",q,[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(F,{"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(L),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
@@ -1 +0,0 @@
1
- import{o as w,s as E,u as d,k as s,h as t,z as g,F as x,w as U,T as a,O as n,N as T,L as p,j as b,v as r,q as M}from"./index-CZM0UQQJ.js";import{b as V,d as S}from"./api-CdLJWHnn.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},N=["disabled"],B={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],D={key:0,class:"space-y-4 max-w-lg"},K={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},j={class:"flex items-center gap-3"},O={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},F={class:"flex items-center gap-3"},G={class:"flex items-center gap-3"},H=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"}],o=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");o.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",o.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,N)]),f.value?(d(),s("div",B,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:R=>u.value=l.id,class:M(["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",D,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),a(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>o.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,o.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),a(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>o.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,o.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)),a(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>o.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),[[T,o.value.backgroundNotifyMode]])]),t("div",K,[a(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>o.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,o.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)),a(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>o.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,o.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),a(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>o.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,o.value.authorizedUserId,void 0,{number:!0}]])]),t("div",j,[a(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>o.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,o.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",O,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),a(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>o.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,o.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),a(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>o.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,o.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),a(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>o.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,o.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",F,[a(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>o.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,o.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",G,[a(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>o.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,o.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{H as default};
@@ -1,26 +0,0 @@
1
- import{l as A,o as J,Q as V,s as z,p as R,t as H,u as s,k as o,h as t,n as p,D as c,A as B,q as _,z as i,d as F,m as h,j as v,i as I,F as C,w as D,f as E,v as m,g as G,R as U,r as Q,J as X,x as Z,U as W}from"./index-CZM0UQQJ.js";import{b as O,e as K,c as P,a as Y}from"./api-CdLJWHnn.js";import{g as ee}from"./squad-colors-B8B_Y-lz.js";import{X as te}from"./x-D82kR2fu.js";import{G as se}from"./git-branch-D5N3GVQo.js";import{T as oe}from"./trash-2-C1-PiQou.js";import{A as re}from"./arrow-left-27p7HUxd.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
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
- * @license lucide-vue-next v0.474.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const le=A("FlaskConicalIcon",[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]]);/**
12
- * @license lucide-vue-next v0.474.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const ne=A("ShieldIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/**
17
- * @license lucide-vue-next v0.474.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const ie=A("ToggleLeftIcon",[["rect",{width:"20",height:"12",x:"2",y:"6",rx:"6",ry:"6",key:"f2vt7d"}],["circle",{cx:"8",cy:"12",r:"2",key:"1nvbw3"}]]);/**
22
- * @license lucide-vue-next v0.474.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
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"},be={key:0,class:"text-muted-foreground text-xs"},ye={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:M}){const x=f,S=M,w=m([]),u=m(!1),$=m(!0),g=m(!1),b=m();let d=null;const N=G(()=>w.value.filter(l=>l.summary.trim()!=="")),y=m("");async function k(){try{const l=await O(`/tasks/${x.taskId}/events`);w.value=l}finally{$.value=!1}}function T(){b.value&&(b.value.scrollTop=b.value.scrollHeight)}function q(){x.taskStatus!=="pending"&&x.taskStatus!=="in_progress"||(d=K(),d.addEventListener("agent_event",l=>{const e=JSON.parse(l.data);e.taskId===x.taskId&&(e.type==="message_delta"?(y.value=e.summary??"",R(T)):(k().then(()=>R(T)),y.value=""))}))}async function L(){if(!g.value){g.value=!0;try{await P(`/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 V(()=>x.taskStatus,l=>{(l==="done"||l==="failed"||l==="stopped")&&(y.value="",k(),d&&(d.close(),d=null))}),z(()=>{k().then(()=>R(T)),q()}),H(()=>{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:L,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(F),{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:b,class:"flex-1 overflow-y-auto p-4 space-y-3 text-sm"},[$.value?(s(),o("div",be,"Loading events…")):N.value.length===0&&!y.value?(s(),o("div",ye," 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(E,{key:0,content:n.summary,class:"text-sm"},null,8,["content"])):(s(),o("p",Se,i(n.summary),1))]))],2))),128)),y.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:y.value},null,2)),1)):(s(),I(E,{key:1,content:y.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"},Me={class:"mb-8"},qe={class:"border border-border rounded-lg overflow-hidden"},Le={class:"w-full text-sm"},Re={class:"px-4 py-2 font-medium"},Ee={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"},Fe={key:2,class:"text-xs bg-purple-500/10 text-purple-500 px-1.5 py-0.5 rounded"},Oe={class:"mb-8"},Pe={class:"flex items-center justify-between mb-3"},Ve={key:0,class:"text-sm text-muted-foreground border border-border rounded-lg p-4 text-center"},He={key:1,class:"grid grid-cols-1 md:grid-cols-3 gap-3"},Ge={class:"flex items-center justify-between gap-2"},Ue={class:"flex items-center gap-1.5 min-w-0"},Qe={class:"text-sm font-medium truncate"},Xe={class:"flex items-center gap-1 text-xs text-muted-foreground"},Ze=["title"],We={class:"pt-1 border-t border-border"},Ke=["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 M=X(),x=m(null),S=m([]),w=m([]),u=m([]),$=m(!0),g=m(null),b=m(null),d=m(null);function N(a){d.value=a}function y(){d.value=null}function k(a){return a==="pending"||a==="in_progress"}async function T(a){if(!b.value){b.value=a;try{await P(`/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{b.value=null}}}z(async()=>{try{const a=await O(`/squads/${M.params.id}`);x.value=a.squad,S.value=a.agents,w.value=a.tasks,u.value=a.instances}finally{$.value=!1}});async function q(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 L(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=Z("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:Q(c(ee)(x.value.color))},i(x.value.name),5),t("p",De,i(x.value.universe),1)]),t("section",Me,[r[5]||(r[5]=t("h2",{class:"text-lg font-semibold mb-3"},"Agent Roster",-1)),t("div",qe,[t("table",Le,[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",Re,i(e.character_name),1),t("td",Ee,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"}),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",Fe,[p(c(le),{class:"w-3 h-3 inline"}),r[3]||(r[3]=h(" Test ",-1))])):v("",!0)])]))),128))])])])]),t("section",Oe,[t("div",Pe,[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",Ve," No active instances. ")):(s(),o("div",He,[(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",Ge,[t("div",Ue,[p(c(se),{class:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),t("span",Qe,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",Xe,[p(c(B),{class:"w-3 h-3 shrink-0"}),t("span",null,i(L(e.last_activity)),1)]),t("div",{class:"font-mono text-xs text-muted-foreground truncate",title:e.worktree_path},i(e.worktree_path),9,Ze),t("div",We,[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=>q(e.id,e.branch)},[p(c(oe),{class:"w-3 h-3"}),h(" "+i(g.value===e.id?"Destroying…":"Destroy"),1)],8,Ke)])]))),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:b.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(F),{class:"w-3 h-3"}),h(" "+i(b.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?y():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:y,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,6 +0,0 @@
1
- import{b as y}from"./api-CdLJWHnn.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{l as h,o as k,s as b,u as o,k as r,h as t,n as c,D as l,e as w,F as L,w as C,v as d,i as S,R as B,r as f,x as N,z as n,m as _,j as V}from"./index-CZM0UQQJ.js";import{G as j}from"./git-branch-D5N3GVQo.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const q=h("LayersIcon",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),z={class:"p-6"},A={key:0,class:"text-muted-foreground"},M={key:1,class:"text-center py-12 text-muted-foreground"},F={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},G={class:"flex items-start justify-between"},I={class:"min-w-0"},D={class:"text-sm text-muted-foreground mt-0.5"},E={class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},O={class:"mt-3 flex items-center gap-4 text-xs text-muted-foreground"},R={key:0,class:"flex items-center gap-1"},T={class:"flex items-center gap-1"},P=k({__name:"SquadsView",setup(U){const i=d([]),u=d([]),m=d({}),p=d(!0);b(async()=>{try{const a=await y("/squads");i.value=a.squads,u.value=a.agents,m.value=a.instanceCounts??{}}finally{p.value=!1}});function g(a){return u.value.filter(s=>s.squad_id===a)}return(a,s)=>{const x=N("router-link");return o(),r("div",z,[s[2]||(s[2]=t("h1",{class:"text-2xl font-bold mb-6"},"Squads",-1)),p.value?(o(),r("div",A,"Loading...")):i.value.length===0?(o(),r("div",M,[c(l(w),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s[0]||(s[0]=t("p",null,"No squads yet.",-1)),s[1]||(s[1]=t("p",{class:"text-sm mt-1"},"Ask IO to create a squad for your project.",-1))])):(o(),r("div",F,[(o(!0),r(L,null,C(i.value,e=>(o(),S(x,{key:e.id,to:`/squads/${e.id}`,class:"block rounded-lg border border-border bg-card p-4 hover:border-primary/50 transition-colors border-l-4",style:f({borderLeftColor:e.color})},{default:B(()=>[t("div",G,[t("div",I,[t("span",{class:"inline-flex items-center text-xs px-2 py-0.5 rounded-full font-medium",style:f(l(v)(e.color))},n(e.name),5),t("p",D,n(e.universe),1)]),t("span",E,n(g(e.id).length)+" agents ",1)]),t("div",O,[e.repo_url?(o(),r("span",R,[c(l(j),{class:"w-3 h-3"}),_(" "+n(e.repo_url),1)])):V("",!0),t("span",T,[c(l(q),{class:"w-3 h-3"}),_(" "+n(m.value[e.id]??0)+"/3 instances ",1)])])]),_:2},1032,["to","style"]))),128))]))])}}});export{P as default};
@@ -1,31 +0,0 @@
1
- import{l as T,o as oe,Q as se,u as s,k as a,F as b,w as U,g as H,h as t,i as I,D as d,n as v,z as j,r as ce,q as z,W as ve,j as B,v as c,s as pe,B as K,m as S,T as L,O as N,V as O,f as R}from"./index-CZM0UQQJ.js";import{b as q,d as E,a as Z}from"./api-CdLJWHnn.js";import{F as fe}from"./file-text-Dk0fT3q_.js";import{S as me}from"./search-CMwjTbNl.js";import{P as G}from"./plus-CoUrXVZm.js";import{P as X,S as J}from"./save-CttKqFu3.js";import{T as Y}from"./trash-2-C1-PiQou.js";import{X as ee}from"./x-D82kR2fu.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const xe=T("ChevronDownIcon",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
7
- * @license lucide-vue-next v0.474.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const ge=T("ChevronRightIcon",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
12
- * @license lucide-vue-next v0.474.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const te=T("FileCodeIcon",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]]);/**
17
- * @license lucide-vue-next v0.474.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const he=T("FilePlusIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]);/**
22
- * @license lucide-vue-next v0.474.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const be=T("FolderIcon",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
27
- * @license lucide-vue-next v0.474.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const ye=T("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=oe({__name:"WikiTree",props:{pages:{},selectedPage:{},searchQuery:{}},emits:["select","addFile"],setup(Q,{emit:w}){const x=Q,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 o=n=>{n.sort((p,m)=>p.isFolder!==m.isFolder?p.isFolder?-1:1:p.name.localeCompare(m.name)),n.forEach(p=>o(p.children))};return o(u),u}const _=H(()=>{let i=x.pages;if(x.searchQuery){const u=x.searchQuery.toLowerCase();i=x.pages.filter(o=>o.toLowerCase().includes(u))}return y(i)});se(()=>x.selectedPage,i=>{if(!i)return;const u=i.split("/");for(let o=1;o<u.length;o++)g.value.add(u.slice(0,o).join("/"))},{immediate:!0});function M(i){g.value.has(i)?g.value.delete(i):g.value.add(i)}function V(i,u){const o=[];for(const n of i)o.push({node:n,depth:u}),n.isFolder&&g.value.has(n.path)&&o.push(...V(n.children,u+1));return o}const C=H(()=>V(_.value,0));return(i,u)=>(s(),a("div",ke,[(s(!0),a(b,null,U(C.value,({node:o,depth:n})=>(s(),a("div",{key:o.path,class:"group relative"},[t("button",{onClick:p=>o.isFolder?M(o.path):f("select",o.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":!o.isFolder&&Q.selectedPage===o.path}]),style:ce({paddingLeft:n*12+8+"px"})},[o.isFolder?(s(),a(b,{key:0},[g.value.has(o.path)?(s(),I(d(xe),{key:0,class:"w-3 h-3 shrink-0 text-muted-foreground"})):(s(),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)):(s(),a(b,{key:1},[u[0]||(u[0]=t("span",{class:"w-3 shrink-0"},null,-1)),v(d(fe),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)),t("span",_e,j(o.name),1)],14,we),o.isFolder?(s(),a("button",{key:0,onClick:ve(p=>f("addFile",o.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"},qe={key:0,class:"flex flex-1 overflow-hidden"},Te={class:"w-64 border-r border-border flex flex-col shrink-0"},Me={class:"p-3 border-b border-border space-y-2"},Ve={class:"relative"},Se={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"},Qe={class:"text-sm font-medium font-mono"},Ue={class:"flex gap-1"},We={class:"flex-1 overflow-y-auto p-4"},Ae={key:0,class:"mt-8 pt-4 border-t border-border"},He={class:"flex items-center gap-1.5 mb-2 text-xs font-medium text-muted-foreground"},Ke={class:"space-y-1"},Oe=["onClick"],Re={key:1,class:"flex flex-1 overflow-hidden"},Ze={class:"w-64 border-r border-border flex flex-col shrink-0"},Ge={class:"p-3 border-b border-border space-y-2"},Xe={key:0,class:"space-y-1.5"},Je={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"},ot={key:1,class:"text-xs text-muted-foreground p-2"},st=["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"},bt=oe({__name:"WikiView",setup(Q){const w=c("pages"),x=c([]),f=c(null),g=c(""),y=c(!1),_=c(""),M=c(""),V=c(!0),C=c(!1),i=c(""),u=c([]),o=c([]),n=c(null),p=c(""),m=c(!1),h=c(""),P=c(!1),$=c(!1),k=c("");pe(async()=>{try{x.value=await q("/wiki/pages")}finally{V.value=!1}}),se(w,async r=>{if(r==="templates"&&o.value.length===0){P.value=!0;try{o.value=await q("/wiki/templates/squad")}finally{P.value=!1}}});async function F(r){f.value=r,y.value=!1;const e=await q(`/wiki/page/${r}`);g.value=e.content,u.value=await q(`/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 q(`/wiki/backlinks/${f.value}`))}async function ae(){f.value&&confirm(`Delete "${f.value}"?`)&&(await Z(`/wiki/page/${f.value}`),x.value=x.value.filter(r=>r!==f.value),f.value=null,g.value="",u.value=[])}async function W(){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 q(`/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 Z(`/wiki/template/squad/${n.value}`),o.value=o.value.filter(r=>r!==n.value),n.value=null,p.value="")}async function A(){const r=k.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/template/squad/${e}`,{content:""}),o.value.includes(e)||(o.value.push(e),o.value.sort()),$.value=!1,k.value="",n.value=e,p.value="",h.value="",m.value=!0}return(r,e)=>(s(),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(K),{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"?(s(),a("div",qe,[t("div",Te,[t("div",Me,[t("div",Ve,[v(d(me),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),L(t("input",{"onUpdate:modelValue":e[2]||(e[2]=l=>M.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),[[N,M.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(G),{class:"w-3.5 h-3.5"}),e[17]||(e[17]=S(" New Page ",-1))]),C.value?(s(),a("div",Se,[L(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:O(W,["enter"])},null,544),[[N,i.value]]),t("div",Le,[t("button",{onClick:W,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,[V.value?(s(),a("div",De,"Loading...")):(s(),I($e,{key:1,pages:x.value,"selected-page":f.value,"search-query":M.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?(s(),a(b,{key:1},[t("div",Ie,[t("span",Qe,j(f.value),1),t("div",Ue,[y.value?(s(),a(b,{key:1},[t("button",{onClick:le,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(J),{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)):(s(),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(Y),{class:"w-4 h-4"})])],64))])]),t("div",We,[y.value?L((s(),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)),[[N,_.value]]):(s(),a(b,{key:1},[v(R,{content:g.value},null,8,["content"]),u.value.length>0?(s(),a("div",Ae,[t("div",He,[v(d(ye),{class:"w-3.5 h-3.5"}),e[19]||(e[19]=S(" Backlinks ",-1))]),t("ul",Ke,[(s(!0),a(b,null,U(u.value,l=>(s(),a("li",{key:l},[t("button",{onClick:de=>F(l),class:"text-xs text-primary hover:underline font-mono"},j(l),9,Oe)]))),128))])])):B("",!0)],64))])],64)):(s(),a("div",ze,[t("div",Be,[v(d(K),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a page to view",-1))])]))])])):(s(),a("div",Re,[t("div",Ze,[t("div",Ge,[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(G),{class:"w-3.5 h-3.5"}),e[20]||(e[20]=S(" New Template ",-1))]),$.value?(s(),a("div",Xe,[L(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:O(A,["enter"])},null,544),[[N,k.value]]),t("div",Je,[t("button",{onClick:A,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?(s(),a("div",tt,"Loading...")):o.value.length===0?(s(),a("div",ot,"No templates yet.")):(s(!0),a(b,{key:2},U(o.value,l=>(s(),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"])},j(l),11,st))),128))])]),t("div",lt,[n.value?(s(),a(b,{key:1},[t("div",rt,[t("span",it,j(n.value),1),t("div",ut,[m.value?(s(),a(b,{key:1},[t("button",{onClick:ie,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(d(J),{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)):(s(),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(Y),{class:"w-4 h-4"})])],64))])]),t("div",dt,[m.value?L((s(),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)),[[N,h.value]]):(s(),I(R,{key:1,content:p.value},null,8,["content"]))])],64)):(s(),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{bt as default};
@@ -1,6 +0,0 @@
1
- import{l as e}from"./index-CZM0UQQJ.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const r=e("ArrowLeftIcon",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);export{r as A};
@@ -1,6 +0,0 @@
1
- import{l as e}from"./index-CZM0UQQJ.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const t=e("FileTextIcon",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);export{t as F};