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.
- package/dist/api/server.js +8 -5
- package/package.json +1 -1
- package/web-dist/assets/{AuditLogView-BPJtNXCS.js → AuditLogView-DDtYucjR.js} +2 -2
- package/web-dist/assets/ChatView-Cf_L3wy0.js +1 -0
- package/web-dist/assets/FeedView-D_XcxzJP.js +6 -0
- package/web-dist/assets/HistoryView-6_ykti0r.js +1 -0
- package/web-dist/assets/LoginView-DTYomLTi.js +1 -0
- package/web-dist/assets/McpView-CewsPyFJ.js +1 -0
- package/web-dist/assets/{SchedulesView-DAcPfnmZ.js → SchedulesView-BaQf3EWF.js} +2 -2
- package/web-dist/assets/SettingsView-XiEfBZXk.js +1 -0
- package/web-dist/assets/{SkillsView-DtnR6ZeP.js → SkillsView-CipFd9n-.js} +4 -4
- package/web-dist/assets/SquadDetailView-B1CqbDDD.js +26 -0
- package/web-dist/assets/{SquadHealthView-Dt_cBi_C.js → SquadHealthView-BaTpQNnY.js} +3 -3
- package/web-dist/assets/SquadsView-B1HzN-Cf.js +6 -0
- 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
- package/web-dist/assets/{UsageView-Dhuu6mVo.js → UsageView-JZ5H9i7W.js} +4 -4
- package/web-dist/assets/WikiView-BxszV6hw.js +26 -0
- package/web-dist/assets/{api-CdLJWHnn.js → api-C541TEY3.js} +1 -1
- package/web-dist/assets/{x-D82kR2fu.js → arrow-left-nhBAfMBE.js} +2 -2
- package/web-dist/assets/{git-branch-D5N3GVQo.js → git-branch-DphZXMIK.js} +1 -1
- package/web-dist/assets/index-C5YYUXmF.css +1 -0
- package/web-dist/assets/index-DziJbtpI.js +279 -0
- package/web-dist/assets/{plus-CoUrXVZm.js → plus-CpX77g5Z.js} +1 -1
- package/web-dist/assets/{save-CttKqFu3.js → save-BKKruDuc.js} +1 -1
- package/web-dist/assets/{search-CMwjTbNl.js → search-Cq5DDOqi.js} +1 -1
- package/web-dist/assets/{trash-2-C1-PiQou.js → trash-2-BFUOVlMJ.js} +1 -1
- package/web-dist/assets/{triangle-alert-BKZFqU_A.js → triangle-alert-HO1kqixB.js} +2 -2
- package/web-dist/index.html +2 -2
- package/web-dist/assets/ChatView-Brk1nps-.js +0 -11
- package/web-dist/assets/FeedView-DtpTOb4B.js +0 -6
- package/web-dist/assets/HistoryView-CErxUNk_.js +0 -1
- package/web-dist/assets/LoginView-CWiUkg95.js +0 -1
- package/web-dist/assets/McpView-C-td_je_.js +0 -1
- package/web-dist/assets/SettingsView-559gPpax.js +0 -1
- package/web-dist/assets/SquadDetailView-HYYd2HvB.js +0 -26
- package/web-dist/assets/SquadsView-DdywGIi2.js +0 -6
- package/web-dist/assets/WikiView-DWun-CTD.js +0 -31
- package/web-dist/assets/arrow-left-27p7HUxd.js +0 -6
- package/web-dist/assets/file-text-Dk0fT3q_.js +0 -6
- package/web-dist/assets/index-CZM0UQQJ.js +0 -254
- package/web-dist/assets/index-CoyYyx4A.css +0 -1
package/dist/api/server.js
CHANGED
|
@@ -87,15 +87,17 @@ export async function startApiServer(config) {
|
|
|
87
87
|
res.flushHeaders();
|
|
88
88
|
// Keepalive: send a comment every 30s to keep Cloudflare happy
|
|
89
89
|
const keepalive = setInterval(() => {
|
|
90
|
-
|
|
90
|
+
if (!finished)
|
|
91
|
+
res.write(": keepalive\n\n");
|
|
91
92
|
}, 30_000);
|
|
92
|
-
let
|
|
93
|
-
req.on("close", () => {
|
|
93
|
+
let finished = false;
|
|
94
|
+
req.on("close", () => { finished = true; clearInterval(keepalive); });
|
|
94
95
|
try {
|
|
95
96
|
await sendToOrchestrator(prompt, "web", (content, done) => {
|
|
96
|
-
if (
|
|
97
|
+
if (finished)
|
|
97
98
|
return;
|
|
98
99
|
if (done) {
|
|
100
|
+
finished = true;
|
|
99
101
|
saveMessage(conversationId, "assistant", content, "web");
|
|
100
102
|
res.write(`event: done\ndata: ${JSON.stringify({ content, conversationId })}\n\n`);
|
|
101
103
|
clearInterval(keepalive);
|
|
@@ -109,7 +111,8 @@ export async function startApiServer(config) {
|
|
|
109
111
|
}, attachments);
|
|
110
112
|
}
|
|
111
113
|
catch (err) {
|
|
112
|
-
if (!
|
|
114
|
+
if (!finished) {
|
|
115
|
+
finished = true;
|
|
113
116
|
const message = err instanceof Error ? err.message : "Unknown error";
|
|
114
117
|
res.write(`event: error\ndata: ${JSON.stringify({ error: message })}\n\n`);
|
|
115
118
|
clearInterval(keepalive);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
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,a5 as f,a0 as T,d as h,L as w,a1 as L,p as b,K as n,m as _,z as ee}from"./index-DziJbtpI.js";import{b as F}from"./api-C541TEY3.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 te=W("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),oe={class:"p-6"},se={class:"flex items-center justify-between mb-6"},ae={class:"text-2xl font-bold flex items-center gap-2"},de={class:"text-sm text-muted-foreground"},le={class:"border border-border rounded-lg p-4 mb-6 space-y-3"},re={class:"flex items-center gap-2 text-sm font-medium text-muted-foreground mb-1"},ne={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3"},ue=["value"],ie=["value"],ce=["value"],pe={key:0,class:"text-muted-foreground"},ve={key:1,class:"text-center py-12 text-muted-foreground"},me={key:2,class:"space-y-1"},ge=["onClick"],xe={class:"flex-1 min-w-0"},fe={class:"flex flex-wrap items-center gap-2 mb-1"},be={key:0,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},_e={key:1,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},ye={class:"text-sm truncate"},ke={class:"text-xs text-muted-foreground mt-0.5"},he={class:"text-xs text-muted-foreground mt-1 shrink-0"},we={key:0,class:"border-t border-border px-4 py-3"},qe={key:0,class:"text-xs text-muted-foreground mb-2"},Ce={class:"font-mono"},
|
|
6
|
+
*/const te=W("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),oe={class:"p-6"},se={class:"flex items-center justify-between mb-6"},ae={class:"text-2xl font-bold flex items-center gap-2"},de={class:"text-sm text-muted-foreground"},le={class:"border border-border rounded-lg p-4 mb-6 space-y-3"},re={class:"flex items-center gap-2 text-sm font-medium text-muted-foreground mb-1"},ne={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3"},ue=["value"],ie=["value"],ce=["value"],pe={key:0,class:"text-muted-foreground"},ve={key:1,class:"text-center py-12 text-muted-foreground"},me={key:2,class:"space-y-1"},ge=["onClick"],xe={class:"flex-1 min-w-0"},fe={class:"flex flex-wrap items-center gap-2 mb-1"},be={key:0,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},_e={key:1,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},ye={class:"text-sm truncate"},ke={class:"text-xs text-muted-foreground mt-0.5"},he={class:"text-xs text-muted-foreground mt-1 shrink-0"},we={key:0,class:"border-t border-border px-4 py-3"},qe={key:0,class:"text-xs text-muted-foreground mb-2"},Ce={class:"font-mono"},Pe={class:"text-xs bg-muted rounded p-3 overflow-x-auto whitespace-pre-wrap break-words"},Ae={key:3,class:"flex items-center justify-between mt-4"},Ne=["disabled"],Se={class:"text-xs text-muted-foreground"},Te=["disabled"],u=50,Ie=X({__name:"AuditLogView",setup(Ve){const q=n([]),c=n(0),C=n(!0),y=n(null),P=n([]),k=n([]),i=n(""),p=n(""),v=n(""),m=n(""),g=n(""),r=n(0),M=["message_received","task_delegated","task_completed","task_failed","shell_command","squad_created","squad_meeting"],I={message_received:"bg-blue-500/20 text-blue-400",task_delegated:"bg-purple-500/20 text-purple-400",task_completed:"bg-green-500/20 text-green-400",task_failed:"bg-red-500/20 text-red-400",shell_command:"bg-yellow-500/20 text-yellow-400",squad_created:"bg-indigo-500/20 text-indigo-400",squad_meeting:"bg-teal-500/20 text-teal-400"};function O(s){return I[s]??"bg-secondary text-secondary-foreground"}async function x(){C.value=!0;try{const s=new URLSearchParams;i.value&&s.set("squad_id",i.value),p.value&&s.set("agent_id",p.value),v.value&&s.set("action_type",v.value),m.value&&s.set("from",m.value),g.value&&s.set("to",g.value),s.set("limit",String(u)),s.set("offset",String(r.value));const t=await F(`/audit-log?${s.toString()}`);q.value=t.entries,c.value=t.total}finally{C.value=!1}}async function U(){const s=await F("/squads");P.value=s.squads,k.value=s.agents}function $(){r.value=0,x()}function D(){i.value="",p.value="",v.value="",m.value="",g.value="",r.value=0,x()}function E(){r.value>0&&(r.value=Math.max(0,r.value-u),x())}function R(){r.value+u<c.value&&(r.value=r.value+u,x())}function B(s){y.value=y.value===s?null:s}function J(s){try{return JSON.stringify(JSON.parse(s.payload),null,2)}catch{return s.payload}}function j(s){var t;return s?((t=P.value.find(e=>e.id===s))==null?void 0:t.name)??s.slice(0,8):""}function z(s){if(!s)return"";const t=k.value.find(e=>e.id===s);return t?`${t.character_name} (${t.role_title})`:s.slice(0,8)}const Y=_(()=>r.value+u<c.value),G=_(()=>r.value>0),K=_(()=>Math.floor(r.value/u)+1),H=_(()=>Math.max(1,Math.ceil(c.value/u))),Q=_(()=>i.value?k.value.filter(s=>s.squad_id===i.value):k.value);return Z(async()=>{await Promise.all([x(),U()])}),(s,t)=>(a(),d("div",oe,[o("div",se,[o("h1",ae,[A(N(V),{class:"w-6 h-6"}),t[6]||(t[6]=S(" Audit Log ",-1))]),o("span",de,l(c.value)+" entries",1)]),o("div",le,[o("div",re,[A(N(te),{class:"w-4 h-4"}),t[7]||(t[7]=S(" Filters ",-1))]),o("div",ne,[f(o("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background",onChange:t[1]||(t[1]=e=>p.value="")},[t[8]||(t[8]=o("option",{value:""},"All squads",-1)),(a(!0),d(h,null,w(P.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.name),9,ue))),128))],544),[[T,i.value]]),f(o("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[9]||(t[9]=o("option",{value:""},"All agents",-1)),(a(!0),d(h,null,w(Q.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.character_name),9,ie))),128))],512),[[T,p.value]]),f(o("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>v.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[10]||(t[10]=o("option",{value:""},"All action types",-1)),(a(),d(h,null,w(M,e=>o("option",{key:e,value:e},l(e),9,ce)),64))],512),[[T,v.value]]),f(o("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),type:"datetime-local",placeholder:"From",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[L,m.value]]),f(o("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>g.value=e),type:"datetime-local",placeholder:"To",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[L,g.value]])]),o("div",{class:"flex gap-2"},[o("button",{onClick:$,class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"}," Apply "),o("button",{onClick:D,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors"}," Reset ")])]),C.value?(a(),d("div",pe,"Loading...")):q.value.length===0?(a(),d("div",ve,[A(N(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),t[11]||(t[11]=o("p",null,"No audit log entries found.",-1))])):(a(),d("div",me,[(a(!0),d(h,null,w(q.value,e=>(a(),d("div",{key:e.id,class:"border border-border rounded-lg overflow-hidden"},[o("div",{onClick:Le=>B(e.id),class:"flex items-start gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[o("div",xe,[o("div",fe,[o("span",{class:ee(["text-xs px-2 py-0.5 rounded-full font-mono",O(e.action_type)])},l(e.action_type),3),e.squad_id?(a(),d("span",be,l(j(e.squad_id)),1)):b("",!0),e.agent_id?(a(),d("span",_e,l(z(e.agent_id)),1)):b("",!0)]),o("p",ye,l(e.summary),1),o("p",ke,l(e.created_at),1)]),o("span",he,l(y.value===e.id?"▲":"▼"),1)],8,ge),y.value===e.id?(a(),d("div",we,[e.task_id?(a(),d("div",qe,[t[12]||(t[12]=S(" Task ID: ",-1)),o("code",Ce,l(e.task_id),1)])):b("",!0),o("pre",Pe,l(J(e)),1)])):b("",!0)]))),128))])),c.value>u?(a(),d("div",Ae,[o("button",{disabled:!G.value,onClick:E,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," ← Previous ",8,Ne),o("span",Se," Page "+l(K.value)+" of "+l(H.value),1),o("button",{disabled:!Y.value,onClick:R,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," Next → ",8,Te)])):b("",!0)]))}});export{Ie as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as H,W as O,a3 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,a5 as J,a1 as Q,o as f,S as R,j as G,z as b,K as v,m as B,v as Z,a2 as ee,_ as te,x as S,Q as se,I as E,F as I,l as ae,X as ne,y as $}from"./index-DziJbtpI.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"],Ce=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{Ce as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
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,a7 as k,p as q,l as T}from"./index-DziJbtpI.js";import{b as C,c as E,a as P}from"./api-C541TEY3.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-BFUOVlMJ.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 A=M("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),G={class:"p-6"},J={class:"flex items-center justify-between mb-6"},K={class:"flex gap-2"},U=["onClick"],W={key:0,class:"text-muted-foreground"},H={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),v=d("all"),m=d(!0),u=d(null);async function g(){m.value=!0;try{const e=await C(`/feed?unread=${v.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 y(e){await E(`/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 P(`/feed/${e}`),r.value=r.value.filter(s=>s.id!==e)}function S(e){u.value=u.value===e?null:e,u.value===e&&y(e)}function I(e){if(!e.startsWith("squad-"))return;const s=e.slice(6);return x.value.find(t=>t.id===s)}const L=z(()=>r.value.map(e=>{const s=I(e.source);return{...e,squad:s}}));N(async()=>{await Promise.all([g(),w()])});function F(e){var s;return((s=e.squad)==null?void 0:s.name)??e.source}return(e,s)=>(o(),n("div",G,[a("div",J,[s[0]||(s[0]=a("h1",{class:"text-2xl font-bold"},"Feed",-1)),a("div",K,[(o(),n(h,null,b(["all","unread"],t=>a("button",{key:t,onClick:_=>{v.value=t,g()},class:f(["px-3 py-1.5 text-xs rounded-md border transition-colors",v.value===t?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"])},p(t==="all"?"All":`Unread (${l.value})`),11,U)),64))])]),m.value?(o(),n("div",W,"Loading...")):r.value.length===0?(o(),n("div",H,[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(h,null,b(L.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:_=>S(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(R)(t.squad.color):{})},p(F(t)),7),a("span",{class:f(["text-sm font-medium truncate",{"font-bold":!t.read}])},p(t.title),3)]),a("p",Z,p(t.created_at),1)]),a("div",ee,[t.read?q("",!0):(o(),n("button",{key:0,onClick:k(_=>y(t.id),["stop"]),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Mark as read"},[c(i(A),{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(j),{class:"w-3.5 h-3.5"})],8,se)])],8,Q),u.value===t.id?(o(),n("div",ae,[c(T,{content:t.content},null,8,["content"])])):q("",!0)],2))),128))]))]))}});export{ue as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as q,a3 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a5 as T,a1 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-DziJbtpI.js";import{b as B,a as J}from"./api-C541TEY3.js";import{S as K}from"./search-Cq5DDOqi.js";import{A as Q}from"./arrow-left-nhBAfMBE.js";import{T as I}from"./trash-2-BFUOVlMJ.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as b,V as v,J as u,q as i,n as t,t as y,a7 as w,a5 as m,a1 as p,R as f,p as V,T as g,K as d,_,Z as h}from"./index-DziJbtpI.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(),c=h(),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",S,[t("div",k,[t("div",q,[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)):V("",!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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{u as E,E as S,J as a,q as l,n as s,t as c,T as b,s as C,a5 as i,a1 as m,a0 as M,p as x,i as P,d as j,L as U,K as f,R as p}from"./index-DziJbtpI.js";import{b as $,c as I,d as N,a as L}from"./api-C541TEY3.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-CErIbExm.js";import{P as G}from"./plus-CpX77g5Z.js";import{T as K}from"./trash-2-BFUOVlMJ.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 $("/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)=>(a(),l("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?(a(),l("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"?(a(),l("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]])])):(a(),l("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?(a(),l("div",R,"Loading...")):u.value.length===0?(a(),l("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))])):(a(),l("div",W,[(a(!0),l(j,null,U(u.value,t=>{var d;return a(),l("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?(a(),l("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(a(),l("div",ee,"Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(a(),l("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,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
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,a5 as f,a0 as k,a1 as S,p as _,c as E,R as n,K as u,m as M,z as O,D as j}from"./index-DziJbtpI.js";import{b as h,c as C,d as A,a as R}from"./api-C541TEY3.js";import{g as F}from"./squad-colors-B8B_Y-lz.js";import{_ as G}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-CErIbExm.js";import{P as J}from"./plus-CpX77g5Z.js";import{T as K}from"./trash-2-BFUOVlMJ.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 H=B("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),Q={class:"p-6"},W={class:"flex items-center justify-between mb-6"},X={class:"flex gap-1 border-b border-border mb-4"},Y=["onClick"],Z={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},ee={class:"grid grid-cols-2 gap-3"},te=["value"],oe=["disabled"],se={key:1,class:"text-muted-foreground"},ae={key:2,class:"text-center py-12 text-muted-foreground"},de={key:3,class:"space-y-2"},re={class:"text-sm font-medium font-mono"},le={key:0,class:"mt-1"},ne={class:"text-xs text-muted-foreground mt-0.5"},ue={class:"text-xs text-muted-foreground mt-0.5"},ie={class:"flex items-center gap-3"},me=["onClick"],pe={key:0,class:"text-xs text-green-500 font-medium"},ce=["onClick"],qe=I({__name:"SchedulesView",setup(ve){const l=u([]),i=u([]),q=u(!0),c=u("squad"),v=u(!1),a=u({type:"squad",cron:"",squad_id:"",prompt:""}),b=u(null);L(async()=>{try{const s=await h("/squads");i.value=s.squads,i.value.length>0&&(a.value.squad_id=i.value[0].id),l.value=await h("/schedules")}finally{q.value=!1}});const w=()=>l.value.filter(s=>s.type===c.value);async function T(){const s={type:a.value.type,cron:a.value.cron,squad_id:a.value.squad_id};if(!a.value.squad_id||!a.value.prompt.trim())return;s.prompt=a.value.prompt;const e=await C("/schedules",s);l.value.push(e),v.value=!1}function V(s){if(s)return i.value.find(e=>e.id===s)}const $=M(()=>w().map(s=>({...s,squad:V(s.squad_id)})));async function P(s){const e=!s.enabled;await A(`/schedules/${s.id}`,{enabled:e}),s.enabled=e?1:0}async function N(s){await R(`/schedules/${s}`),l.value=l.value.filter(e=>e.id!==s)}async function U(s){await C(`/schedules/${s.id}/trigger`,{}),b.value=s.id;const e=l.value.findIndex(t=>t.id===s.id);e!==-1&&(l.value[e]={...l.value[e],last_run:new Date().toISOString()}),setTimeout(()=>{b.value=null},3e3)}function D(s){var e;return s?((e=i.value.find(t=>t.id===s))==null?void 0:e.name)??s:"Unknown squad"}return(s,e)=>(d(),r("div",Q,[o("div",W,[e[6]||(e[6]=o("h1",{class:"text-2xl font-bold"},"Schedules",-1)),o("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"},[m(p(J),{class:"w-4 h-4"}),e[5]||(e[5]=z(" Add Schedule ",-1))])]),o("div",X,[(d(),r(x,null,y(["squad","io"],t=>o("button",{key:t,onClick:g=>c.value=t,class:O(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",c.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},n(t==="squad"?"Squad Schedules":"IO Schedules"),11,Y)),64))]),v.value?(d(),r("div",Z,[o("div",ee,[o("div",null,[e[8]||(e[8]=o("label",{class:"text-sm font-medium"},"Type",-1)),f(o("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>a.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[7]||(e[7]=[o("option",{value:"squad"},"Squad",-1),o("option",{value:"io"},"IO",-1)])],512),[[k,a.value.type]])]),o("div",null,[e[9]||(e[9]=o("label",{class:"text-sm font-medium"},"Cron Expression",-1)),f(o("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>a.value.cron=t),placeholder:"0 9 * * 1-5",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[S,a.value.cron]])])]),o("div",null,[e[10]||(e[10]=o("label",{class:"text-sm font-medium"},"Target Squad",-1)),f(o("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>a.value.squad_id=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[(d(!0),r(x,null,y(i.value,t=>(d(),r("option",{key:t.id,value:t.id},n(t.name),9,te))),128))],512),[[k,a.value.squad_id]])]),o("div",null,[e[11]||(e[11]=o("label",{class:"text-sm font-medium"},"Prompt",-1)),f(o("textarea",{"onUpdate:modelValue":e[4]||(e[4]=t=>a.value.prompt=t),rows:"3",placeholder:"e.g. Triage issues, review PRs, ideate on features",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[S,a.value.prompt]])]),o("button",{onClick:T,disabled:!a.value.squad_id||!a.value.prompt.trim(),class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"}," Save ",8,oe)])):_("",!0),q.value?(d(),r("div",se,"Loading...")):w().length===0?(d(),r("div",ae,[m(p(E),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),o("p",null,"No "+n(c.value)+" schedules configured.",1)])):(d(),r("div",de,[(d(!0),r(x,null,y($.value,t=>(d(),r("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[o("div",null,[o("div",re,n(t.cron),1),t.squad?(d(),r("div",le,[o("span",{class:"text-xs px-2 py-0.5 rounded-full",style:j(p(F)(t.squad.color))},n(t.squad.name),5)])):_("",!0),o("div",ne,n(t.prompt?t.prompt.slice(0,80):"(no prompt)"),1),o("div",ue," Squad: "+n(D(t.squad_id)),1)]),o("div",ie,[o("button",{onClick:g=>U(t),class:"p-1.5 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary",title:"Trigger now"},[m(p(H),{class:"w-4 h-4"})],8,me),b.value===t.id?(d(),r("span",pe,"Triggered!")):_("",!0),m(G,{"model-value":!!t.enabled,"aria-label":`Toggle schedule ${t.cron}`,"onUpdate:modelValue":g=>P(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),o("button",{onClick:g=>N(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[m(p(K),{class:"w-4 h-4"})],8,ce)])]))),128))]))]))}});export{qe as default};
|
|
@@ -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,a5 as o,a1 as n,a0 as M,$ as p,p as b,K as r,z as T}from"./index-DziJbtpI.js";import{b as V,d as S}from"./api-C541TEY3.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{
|
|
1
|
+
import{r as fe,u as me,E as xe,J as l,q as a,n as t,z as j,t as u,T as d,s as q,d as p,a5 as C,a1 as M,a6 as ee,R as r,p as S,h as te,L as se,a0 as ge,X as ye,o as le,l as oe,K as n,m as be,a7 as ae}from"./index-DziJbtpI.js";import{b as z,c as J,d as ke,a as he}from"./api-C541TEY3.js";import{P as ne}from"./plus-CpX77g5Z.js";import{S as _e}from"./search-Cq5DDOqi.js";import{P as we,S as Ce}from"./save-BKKruDuc.js";import{T as Se}from"./trash-2-BFUOVlMJ.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=fe("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"},
|
|
6
|
+
*/const Q=fe("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"],lt=["onClick","disabled"],ot={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"},ft={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},mt={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
|
+
`,Ut=me({__name:"SkillsView",setup(St){const T=n([]),N=n(!0),U=n(!1),A=n("git"),g=n(""),m=n(""),y=n(re),f=n(!1),i=n(""),X=be(()=>m.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(o){A.value=o,U.value=!0,i.value=""}function E(){U.value=!1,g.value="",m.value="",y.value=re,i.value=""}async function O(){if(g.value.trim()){f.value=!0,i.value="";try{await J("/skills",{url:g.value.trim()}),E(),await w()}catch(o){i.value=o.message||"Failed to install skill"}finally{f.value=!1}}}async function ie(){if(!(!m.value.trim()||!y.value.trim())){f.value=!0,i.value="";try{await J("/skills",{slug:X.value,content:y.value}),E(),await w()}catch(o){i.value=o.message||"Failed to create skill"}finally{f.value=!1}}}async function ue(o){var e;try{await he(`/skills/${o}`),((e=v.value)==null?void 0:e.slug)===o&&(v.value=null,x.value=""),await w()}catch(s){i.value=s.message||"Failed to remove skill"}}async function de(o){v.value=o,b.value=!1,K.value=!0;try{const e=await z(`/skills/${o.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 ke(`/skills/${v.value.slug}/content`,{content:$.value}),x.value=$.value,b.value=!1,await w()}catch(o){i.value=o.message||"Failed to save skill"}}async function P(){I.value=!0,D.value="",c.value=null,h.value="";try{const o=new URLSearchParams({source:G.value});V.value.trim()&&o.set("q",V.value.trim()),L.value=await z(`/skills/discover?${o}`)}catch(o){D.value=o.message||"Failed to fetch community skills",L.value=[]}finally{I.value=!1}}async function pe(o){c.value=o,B.value=!0,h.value="";try{const e=await z(`/skills/preview?source=${o.source}&slug=${encodeURIComponent(o.slug)}`);h.value=e.content}catch(e){h.value=`Error loading preview: ${e.message}`}finally{B.value=!1}}async function W(o){_.value=o.slug,i.value="";try{await J("/skills",{source:o.source,slug:o.slug}),await w(),k.value="installed"}catch(e){i.value=e.message||"Failed to install skill"}finally{_.value=""}}function Y(o){return T.value.some(e=>e.slug===o)}function Z(o){k.value=o,v.value=null,c.value=null,x.value="",h.value="",o==="discover"&&L.value.length===0&&P()}return xe(w),(o,e)=>(l(),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"?(l(),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"?(l(),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:f.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(f.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"?(l(),a("div",De,[t("div",null,[C(t("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>m.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,m.value]]),m.value.trim()?(l(),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",
|
|
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:f.value||!m.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(f.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?(l(),a("div",Ne,"Loading...")):T.value.length===0?(l(),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),(l(!0),a(p,null,se(T.value,s=>{var F;return l(),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)):(l(),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(_e),{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?(l(),a("div",Oe,"Loading...")):D.value?(l(),a("div",We,r(D.value),1)):L.value.length===0?(l(),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),(l(!0),a(p,null,se(L.value,s=>{var F;return l(),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)?(l(),a("span",ot," Installed ")):(l(),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,lt))],10,Ze)}),128))])],64))]),t("div",at,[k.value==="installed"?(l(),a(p,{key:0},[v.value?(l(),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?(l(),a(p,{key:1},[t("button",{onClick:ve,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[u(d(Ce),{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(ye),{class:"w-4 h-4"})])],64)):(l(),a("button",{key:0,onClick:ce,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[u(d(we),{class:"w-4 h-4"})]))])]),t("div",vt,[K.value?(l(),a("div",pt,"Loading...")):b.value?C((l(),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]]):(l(),le(oe,{key:2,content:x.value},null,8,["content"]))])],64)):(l(),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)):(l(),a(p,{key:1},[c.value?(l(),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)?(l(),a("span",ht," Installed ")):(l(),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?(l(),a("div",wt,"Loading preview...")):(l(),le(oe,{key:1,content:h.value},null,8,["content"]))])],64)):(l(),a("div",ft,[t("div",mt,[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?(l(),a("p",Ct,r(i.value),1)):S("",!0)]))}});export{Ut as default};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
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,A as B,z as _,R as i,j as O,s as h,p as v,o as I,X as H,d as C,L as D,l as R,K as m,m as U,a4 as X,D as Z,Y as K,N as Q,U as W}from"./index-DziJbtpI.js";import{b as P,e as Y,c as V,a as ee}from"./api-C541TEY3.js";import{g as te}from"./squad-colors-B8B_Y-lz.js";import{G as se}from"./git-branch-DphZXMIK.js";import{T as oe}from"./trash-2-BFUOVlMJ.js";import{A as ae}from"./arrow-left-nhBAfMBE.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 re=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"},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};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as L}from"./api-C541TEY3.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,a4 as P,R as a,o as x,p,c as b,N as V}from"./index-DziJbtpI.js";import{T as w}from"./triangle-alert-HO1kqixB.js";import{G as $}from"./git-branch-DphZXMIK.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 z=I("CircleCheckBigIcon",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
|
|
7
7
|
* @license lucide-vue-next v0.474.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const C=I("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),
|
|
11
|
+
*/const C=I("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),j={class:"p-6"},F={class:"flex items-center gap-2 mb-6"},G={key:0,class:"flex items-center gap-2 text-muted-foreground"},H={key:1,class:"text-center py-12 text-muted-foreground"},R={key:2,class:"grid grid-cols-1 lg:grid-cols-2 xl:grid-cols-3 gap-4"},E={class:"flex items-start justify-between"},D={class:"text-xs text-muted-foreground mt-0.5"},J={key:1},K={key:2},O={key:3},U={class:"grid grid-cols-3 gap-2 text-center"},Q={class:"rounded-md bg-muted px-2 py-2"},W={class:"text-lg font-bold"},X={class:"rounded-md bg-muted px-2 py-2"},Y={class:"text-lg font-bold"},Z={class:"rounded-md bg-muted px-2 py-2"},q={class:"text-lg font-bold flex items-center justify-center gap-1"},ee={class:"flex flex-wrap gap-1.5 text-xs"},te={key:0,class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-blue-500/10 text-blue-500"},se={key:1,class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-yellow-500/10 text-yellow-500"},oe={key:2,class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-red-500/10 text-red-500"},ne={class:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full bg-secondary text-secondary-foreground"},re={key:0},le={class:"space-y-1"},ae={class:"font-mono truncate"},de={key:1},ie={class:"space-y-1"},ce={class:"truncate text-muted-foreground"},fe=T({__name:"SquadHealthView",setup(ue){const m=v([]),h=v(!0);B(async()=>{try{const r=await L("/squads/health");m.value=r.health}finally{h.value=!1}});function S(r){if(r===null)return"—";if(r<60)return`${Math.round(r)}m`;const s=Math.floor(r/60),c=Math.round(r%60);return c>0?`${s}h ${c}m`:`${s}h`}function i(r){return r.isStalled?"stalled":r.tasksInProgress>0?"active":"idle"}const A=N(()=>[...m.value].sort((r,s)=>{const c={stalled:0,active:1,idle:2};return c[i(r)]-c[i(s)]}));return(r,s)=>{const c=V("router-link");return o(),n("div",j,[t("div",F,[u(l(M),{class:"w-6 h-6"}),s[0]||(s[0]=t("h1",{class:"text-2xl font-bold"},"Squad Health",-1))]),h.value?(o(),n("div",G,[u(l(C),{class:"w-4 h-4 animate-spin"}),s[1]||(s[1]=g(" Loading... ",-1))])):m.value.length===0?(o(),n("div",H,[u(l(_),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s[2]||(s[2]=t("p",null,"No squads yet.",-1)),s[3]||(s[3]=t("p",{class:"text-sm mt-1"},"Ask IO to create a squad for your project.",-1))])):(o(),n("div",R,[(o(!0),n(f,null,y(A.value,e=>(o(),n("div",{key:e.id,class:k(["rounded-lg border bg-card p-4 flex flex-col gap-3",{"border-red-500/50":e.isStalled,"border-green-500/30":i(e)==="active","border-border":i(e)==="idle"}])},[t("div",E,[t("div",null,[u(c,{to:`/squads/${e.id}`,class:"font-semibold hover:underline"},{default:P(()=>[g(a(e.name),1)]),_:2},1032,["to"]),t("p",D,a(e.universe),1)]),t("span",{class:k(["text-xs px-2 py-0.5 rounded-full font-medium flex items-center gap-1",{"bg-red-500/10 text-red-500":e.isStalled,"bg-green-500/10 text-green-500":i(e)==="active","bg-secondary text-secondary-foreground":i(e)==="idle"}])},[e.isStalled?(o(),x(l(w),{key:0,class:"w-3 h-3"})):p("",!0),e.isStalled?(o(),n("span",J,"Stalled")):i(e)==="active"?(o(),n("span",K,"Active")):(o(),n("span",O,"Idle"))],2)]),t("div",U,[t("div",Q,[t("div",W,a(e.tasksCompleted),1),s[4]||(s[4]=t("div",{class:"text-xs text-muted-foreground"},"Completed",-1))]),t("div",X,[t("div",Y,a(e.tasksCompletedRecent),1),s[5]||(s[5]=t("div",{class:"text-xs text-muted-foreground"},"Last 7d",-1))]),t("div",Z,[t("div",q,[u(l(b),{class:"w-3 h-3 text-muted-foreground"}),g(" "+a(S(e.avgCycleTimeMinutes)),1)]),s[6]||(s[6]=t("div",{class:"text-xs text-muted-foreground"},"Avg cycle",-1))])]),t("div",ee,[e.tasksInProgress>0?(o(),n("span",te,a(e.tasksInProgress)+" in progress ",1)):p("",!0),e.tasksPending>0?(o(),n("span",se,a(e.tasksPending)+" pending ",1)):p("",!0),e.tasksFailed>0?(o(),n("span",oe,a(e.tasksFailed)+" failed ",1)):p("",!0),t("span",ne,[u(l(_),{class:"w-3 h-3"}),g(" "+a(e.agentCount)+" agents ",1)])]),e.activeInstanceCount>0?(o(),n("div",re,[s[7]||(s[7]=t("p",{class:"text-xs font-medium text-muted-foreground mb-1"},"Active instances",-1)),t("div",le,[(o(!0),n(f,null,y(e.activeInstances,d=>(o(),n("div",{key:d.id,class:"flex items-center gap-1.5 text-xs text-muted-foreground"},[u(l($),{class:"w-3 h-3 shrink-0"}),t("span",ae,a(d.branch),1)]))),128))])])):p("",!0),e.recentTasks.length>0?(o(),n("div",de,[s[8]||(s[8]=t("p",{class:"text-xs font-medium text-muted-foreground mb-1"},"Recent activity",-1)),t("div",ie,[(o(!0),n(f,null,y(e.recentTasks,d=>(o(),n("div",{key:d.id,class:"flex items-center gap-2 text-xs"},[d.status==="done"?(o(),x(l(z),{key:0,class:"w-3 h-3 text-green-500 shrink-0"})):d.status==="in_progress"?(o(),x(l(C),{key:1,class:"w-3 h-3 text-blue-500 shrink-0 animate-spin"})):d.status==="failed"?(o(),x(l(w),{key:2,class:"w-3 h-3 text-red-500 shrink-0"})):(o(),x(l(b),{key:3,class:"w-3 h-3 text-yellow-500 shrink-0"})),t("span",ce,a(d.description),1)]))),128))])])):p("",!0)],2))),128))]))])}}});export{fe as default};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{b as y}from"./api-C541TEY3.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,a4 as N,D as f,N as q,R as n,s as _,p as B}from"./index-DziJbtpI.js";import{G as V}from"./git-branch-DphZXMIK.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 A=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"}]]),M={class:"p-6"},j={key:0,class:"text-muted-foreground"},z={key:1,class:"text-center py-12 text-muted-foreground"},G={key:2,class:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4"},I={class:"flex items-start justify-between"},D={class:"min-w-0"},E={class:"text-sm text-muted-foreground mt-0.5"},F={class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},T={class:"mt-3 flex items-center gap-4 text-xs text-muted-foreground"},J={key:0,class:"flex items-center gap-1"},K={class:"flex items-center gap-1"},P=k({__name:"SquadsView",setup(O){const c=d([]),u=d([]),m=d({}),p=d(!0);b(async()=>{try{const a=await y("/squads");c.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=q("router-link");return o(),r("div",M,[s[2]||(s[2]=t("h1",{class:"text-2xl font-bold mb-6"},"Squads",-1)),p.value?(o(),r("div",j,"Loading...")):c.value.length===0?(o(),r("div",z,[i(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",G,[(o(!0),r(L,null,C(c.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:N(()=>[t("div",I,[t("div",D,[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",E,n(e.universe),1)]),t("span",F,n(g(e.id).length)+" agents ",1)]),t("div",T,[e.repo_url?(o(),r("span",J,[i(l(V),{class:"w-3 h-3"}),_(" "+n(e.repo_url),1)])):B("",!0),t("span",K,[i(l(A),{class:"w-3 h-3"}),_(" "+n(m.value[e.id]??0)+"/3 instances ",1)])])]),_:2},1032,["to","style"]))),128))]))])}}});export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{u as t,J as s,q as r,z as l,n as d}from"./index-DziJbtpI.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 _};
|