heyio 1.3.0 → 1.4.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 +22 -0
- package/dist/copilot/agents.js +41 -3
- package/dist/copilot/orchestrator.js +2 -0
- package/dist/copilot/scheduler.js +3 -2
- package/dist/copilot/squad-tools.js +102 -0
- package/dist/copilot/system-message.js +2 -1
- package/dist/copilot/trigger-schedule.js +31 -0
- package/dist/store/schedules.js +4 -0
- package/dist/store/squad-colors.js +10 -8
- package/dist/wiki/search.js +13 -2
- package/package.json +1 -1
- package/web-dist/assets/{AuditLogView-xgSZ2MOJ.js → AuditLogView-DqxVzjd_.js} +2 -2
- package/web-dist/assets/ChatView-BBopM_A3.js +1 -0
- package/web-dist/assets/FeedView-Bo4p1stx.js +6 -0
- package/web-dist/assets/HistoryView-ChTuQvXr.js +1 -0
- package/web-dist/assets/LoginView-AnOP3Mau.js +1 -0
- package/web-dist/assets/McpView-DPcihjuB.js +1 -0
- package/web-dist/assets/SchedulesView-B2o3vMm-.js +6 -0
- package/web-dist/assets/SettingsView-rtMUmH43.js +1 -0
- package/web-dist/assets/SkillsView-D_NHLk7C.js +15 -0
- package/web-dist/assets/SquadDetailView-BKXLWvwn.js +26 -0
- package/web-dist/assets/SquadHealthView-CVJiAgVW.js +11 -0
- package/web-dist/assets/SquadsView-fammrB7r.js +6 -0
- package/web-dist/assets/{UsageView-CCS6pp6n.js → UsageView-Cy5Mbprb.js} +4 -4
- package/web-dist/assets/WikiView-B5TOMnOg.js +36 -0
- package/web-dist/assets/{arrow-left-CkDjCT7Z.js → arrow-left-CGMB1w_A.js} +1 -1
- package/web-dist/assets/{git-branch-Bu9s__XL.js → git-branch-C_Hu39uh.js} +1 -1
- package/web-dist/assets/index-CQ_szaoT.css +1 -0
- package/web-dist/assets/index-CiZnRvN4.js +253 -0
- package/web-dist/assets/{plus-GvGwcjX5.js → plus-DIBAaEMT.js} +1 -1
- package/web-dist/assets/{save-fQ_rr5hX.js → save-Chqlu7QA.js} +1 -1
- package/web-dist/assets/{search-C3fxUixl.js → search-Cl8HcIsG.js} +1 -1
- package/web-dist/assets/{trash-2-Ba_1SAua.js → trash-2-CQSzbVIr.js} +1 -1
- package/web-dist/assets/{triangle-alert-BTBlX3kg.js → triangle-alert-C1OjMvP5.js} +1 -1
- package/web-dist/assets/{x-CJifAZQa.js → x-DThJHYFm.js} +1 -1
- package/web-dist/index.html +2 -2
- package/web-dist/assets/ChatView-BU3Jvu5y.js +0 -11
- package/web-dist/assets/FeedView-BwkWbe1p.js +0 -6
- package/web-dist/assets/HistoryView-Doh9Y3Na.js +0 -1
- package/web-dist/assets/LoginView-CoTEOrwE.js +0 -1
- package/web-dist/assets/MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js +0 -56
- package/web-dist/assets/McpView-ByXoAnED.js +0 -1
- package/web-dist/assets/SchedulesView-BkUdRYwk.js +0 -1
- package/web-dist/assets/SettingsView-_q-IpzFy.js +0 -1
- package/web-dist/assets/SkillsView-_FkOdD2U.js +0 -15
- package/web-dist/assets/SquadDetailView-CV6_n_If.js +0 -31
- package/web-dist/assets/SquadHealthView-DmQqPq7H.js +0 -11
- package/web-dist/assets/SquadsView-Dkhtu5MQ.js +0 -6
- package/web-dist/assets/WikiView-CpXzff_L.js +0 -31
- package/web-dist/assets/api-CaqVk-rG.js +0 -1
- package/web-dist/assets/index-D3DNfwXI.css +0 -1
- package/web-dist/assets/index-DfdD_qE4.js +0 -158
package/web-dist/index.html
CHANGED
|
@@ -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-
|
|
9
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-CiZnRvN4.js"></script>
|
|
9
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CQ_szaoT.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body class="bg-background text-foreground">
|
|
12
12
|
<div id="app"></div>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{h as k,l as b,s as u,k as w,K as h,p as S,r,g as c,d as n,x as d,f as x,F as I,t as U,N as M,J as C,e as v,m as y,n as _}from"./index-DfdD_qE4.js";import{c as D}from"./api-CaqVk-rG.js";import{_ as B}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.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 j=k("SendIcon",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
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 K=k("SquareIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),T=b("chat",()=>{const i=u([]),t=u(!1),l=u(null),o=u(crypto.randomUUID());function p(a){const e={id:crypto.randomUUID(),role:"user",content:a,timestamp:new Date};return i.value.push(e),e}async function m(a){p(a),t.value=!0;const e={id:crypto.randomUUID(),role:"assistant",content:"",timestamp:new Date,streaming:!0};i.value.push(e);try{const f=await D("/message",{prompt:a,conversationId:o.value});e.content=f.content,e.streaming=!1,f.conversationId&&(o.value=f.conversationId)}catch(f){e.content=`Error: ${f.message}`,e.streaming=!1}finally{t.value=!1}}function g(a){const e=i.value[i.value.length-1];e!=null&&e.streaming&&(e.content=a)}function s(){i.value=[],o.value=crypto.randomUUID()}return{messages:i,isStreaming:t,eventSource:l,conversationId:o,sendMessage:m,updateStreamingMessage:g,clearMessages:s}}),V={class:"flex flex-col h-full"},z={key:0,class:"flex items-center justify-center h-full"},E={key:1,class:"text-muted-foreground"},N={key:2,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},q={class:"border-t border-border p-4"},F={class:"flex gap-2 items-end"},L=["disabled"],O=w({__name:"ChatView",setup(i){const t=T(),l=u(""),o=u();async function p(){const s=l.value.trim();!s||t.isStreaming||(l.value="",await t.sendMessage(s))}function m(){o.value&&(o.value.scrollTop=o.value.scrollHeight)}function g(s){s.key==="Enter"&&!s.shiftKey&&(s.preventDefault(),p())}return h(()=>t.messages.map(s=>s.content),async()=>{await _(),m()},{deep:!0}),h(()=>t.messages.length,async()=>{await _(),m()}),S(()=>m()),(s,a)=>(r(),c("div",V,[n("div",{ref_key:"messagesContainer",ref:o,class:"flex-1 overflow-y-auto p-4 space-y-4"},[d(t).messages.length===0?(r(),c("div",z,[...a[1]||(a[1]=[n("div",{class:"text-center text-muted-foreground"},[n("div",{class:"text-4xl mb-3"},"🤖"),n("p",{class:"text-lg font-medium"},"Welcome to IO"),n("p",{class:"text-sm mt-1"},"Send a message to get started.")],-1)])])):x("",!0),(r(!0),c(I,null,U(d(t).messages,e=>(r(),c("div",{key:e.id,class:y(["flex",e.role==="user"?"justify-end":"justify-start"])},[n("div",{class:y(["max-w-[75%] rounded-lg px-4 py-2 text-sm",e.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[e.content?(r(),v(B,{key:0,content:e.content,class:y(e.role==="user"?"prose-invert":"")},null,8,["content","class"])):(r(),c("span",E,"...")),e.streaming?(r(),c("div",N)):x("",!0)],2)],2))),128))],512),n("div",q,[n("div",F,[M(n("textarea",{"onUpdate:modelValue":a[0]||(a[0]=e=>l.value=e),onKeydown:g,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),[[C,l.value]]),n("button",{onClick:p,disabled:!l.value.trim()||d(t).isStreaming,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[d(t).isStreaming?(r(),v(d(K),{key:1,class:"w-4 h-4"})):(r(),v(d(j),{key:0,class:"w-4 h-4"}))],8,L)])])]))}});export{O as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{h as M,k as N,p as V,r as o,g as n,d as a,F as y,t as b,j as c,x as i,I as B,s as d,c as D,m as f,w as p,o as j,Q as k,f as C}from"./index-DfdD_qE4.js";import{b as q,c as z,a as P}from"./api-CaqVk-rG.js";import{_ as T}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js";import{g as A}from"./squad-colors-B8B_Y-lz.js";import{T as E}from"./trash-2-Ba_1SAua.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 G=M("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Q={class:"p-6"},R={class:"flex items-center justify-between mb-6"},U={class:"flex gap-2"},W=["onClick"],H={key:0,class:"text-muted-foreground"},J={key:1,class:"text-center py-12 text-muted-foreground"},K={key:2,class:"space-y-2"},O=["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"},ce=N({__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 q(`/feed?unread=${v.value==="unread"}`);r.value=e.items,l.value=e.unreadCount}finally{m.value=!1}}async function w(){const e=await q("/squads");x.value=e.squads}async function h(e){await z(`/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 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=D(()=>r.value.map(e=>{const s=S(e.source);return{...e,squad:s}}));V(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",Q,[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:_=>{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,W)),64))])]),m.value?(o(),n("div",H,"Loading...")):r.value.length===0?(o(),n("div",J,[c(i(B),{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",K,[(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:j(t.squad?i(A)(t.squad.color):{})},p(L(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?C("",!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(G),{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(E),{class:"w-3.5 h-3.5"})],8,se)])],8,O),u.value===t.id?(o(),n("div",ae,[c(T,{content:t.content},null,8,["content"])])):C("",!0)],2))),128))]))]))}});export{ce as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as U,K as q,p as P,r,g as n,d as t,j as d,x as c,H as V,N as T,J as L,M as z,f as x,F as $,t as j,m as p,w as g,s as l,c as E,e as G}from"./index-DfdD_qE4.js";import{b as A,a as J}from"./api-CaqVk-rG.js";import{_ as K}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js";import{S as Q}from"./search-C3fxUixl.js";import{A as R}from"./arrow-left-CkDjCT7Z.js";import{T as I}from"./trash-2-Ba_1SAua.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,Me=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 D(){u.value=null,b.value=[]}async function N(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 F(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const H=E(()=>a.value.length<h.value);let S=null;return q([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),P(()=>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(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(Q),{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(z),{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(F(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=>N(s.id,M)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),H.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(R),{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(),G(K,{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{Me as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as b,y as v,r as u,g as i,d as t,j as y,Q as w,N as m,J as p,w as f,f as _,x as g,s as d,_ as h,D as S}from"./index-DfdD_qE4.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"},N={key:0,class:"text-sm text-destructive"},A=["disabled"],L=b({__name:"LoginView",setup(B){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(h,{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",N,f(s.value),1)):_("",!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,A)],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,56 +0,0 @@
|
|
|
1
|
-
var me=Object.defineProperty;var we=(n,e,t)=>e in n?me(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var d=(n,e,t)=>we(n,typeof e!="symbol"?e+"":e,t);import{k as ye,r as Re,g as Se,c as $e}from"./index-DfdD_qE4.js";function j(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var $=j();function ae(n){$=n}var z={exec:()=>null};function u(n,e=""){let t=typeof n=="string"?n:n.source;const r={replace:(s,i)=>{let c=typeof i=="string"?i:i.source;return c=c.replace(b.caret,"$1"),t=t.replace(s,c),r},getRegex:()=>new RegExp(t,e)};return r}var b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ve=/^(?:[ \t]*(?:\n|$))+/,Te=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,_e=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,A=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ze=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,H=/(?:[*+-]|\d{1,9}[.)])/,oe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ce=u(oe).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ae=u(oe).replace(/bull/g,H).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Q=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Le=/^[^\n]+/,F=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ce=u(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",F).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ie=u(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,H).getRegex(),E="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",U=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Pe=u("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",U).replace("tag",E).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),he=u(Q).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex(),Be=u(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",he).getRegex(),X={blockquote:Be,code:Te,def:Ce,fences:_e,heading:ze,hr:A,html:Pe,lheading:ce,list:Ie,newline:ve,paragraph:he,table:z,text:Le},ne=u("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex(),Ee={...X,lheading:Ae,table:ne,paragraph:u(Q).replace("hr",A).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ne).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex()},qe={...X,html:u(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",U).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:z,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:u(Q).replace("hr",A).replace("heading",` *#{1,6} *[^
|
|
2
|
-
]`).replace("lheading",ce).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,De=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,pe=/^( {2,}|\\)\n(?!\s*$)/,Me=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,q=/[\p{P}\p{S}]/u,W=/[\s\p{P}\p{S}]/u,ue=/[^\s\p{P}\p{S}]/u,Ge=u(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,W).getRegex(),ge=/(?!~)[\p{P}\p{S}]/u,Oe=/(?!~)[\s\p{P}\p{S}]/u,Ne=/(?:[^\s\p{P}\p{S}]|~)/u,je=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,fe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,He=u(fe,"u").replace(/punct/g,q).getRegex(),Qe=u(fe,"u").replace(/punct/g,ge).getRegex(),de="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Fe=u(de,"gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,q).getRegex(),Ue=u(de,"gu").replace(/notPunctSpace/g,Ne).replace(/punctSpace/g,Oe).replace(/punct/g,ge).getRegex(),Xe=u("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ue).replace(/punctSpace/g,W).replace(/punct/g,q).getRegex(),We=u(/\\(punct)/,"gu").replace(/punct/g,q).getRegex(),Je=u(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ke=u(U).replace("(?:-->|$)","-->").getRegex(),Ve=u("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ke).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),I=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ye=u(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",I).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ke=u(/^!?\[(label)\]\[(ref)\]/).replace("label",I).replace("ref",F).getRegex(),xe=u(/^!?\[(ref)\](?:\[\])?/).replace("ref",F).getRegex(),et=u("reflink|nolink(?!\\()","g").replace("reflink",ke).replace("nolink",xe).getRegex(),J={_backpedal:z,anyPunctuation:We,autolink:Je,blockSkip:je,br:pe,code:De,del:z,emStrongLDelim:He,emStrongRDelimAst:Fe,emStrongRDelimUnd:Xe,escape:Ze,link:Ye,nolink:xe,punctuation:Ge,reflink:ke,reflinkSearch:et,tag:Ve,text:Me,url:z},tt={...J,link:u(/^!?\[(label)\]\((.*?)\)/).replace("label",I).getRegex(),reflink:u(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",I).getRegex()},G={...J,emStrongRDelimAst:Ue,emStrongLDelim:Qe,url:u(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},nt={...G,br:u(pe).replace("{2,}","*").getRegex(),text:u(G.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},L={normal:X,gfm:Ee,pedantic:qe},T={normal:J,gfm:G,breaks:nt,pedantic:tt},rt={"&":"&","<":"<",">":">",'"':""","'":"'"},re=n=>rt[n];function w(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,re)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,re);return n}function se(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function ie(n,e){var i;const t=n.replace(b.findPipe,(c,l,h)=>{let a=!1,o=l;for(;--o>=0&&h[o]==="\\";)a=!a;return a?"|":" |"}),r=t.split(b.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((i=r.at(-1))!=null&&i.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(b.slashPipe,"|");return r}function _(n,e,t){const r=n.length;if(r===0)return"";let s=0;for(;s<r&&n.charAt(r-s-1)===e;)s++;return n.slice(0,r-s)}function st(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===e[0])t++;else if(n[r]===e[1]&&(t--,t<0))return r;return t>0?-2:-1}function le(n,e,t,r,s){const i=e.href,c=e.title||null,l=n[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const h={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:c,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,h}function it(n,e,t){const r=n.match(t.other.indentCodeCompensation);if(r===null)return e;const s=r[1];return e.split(`
|
|
3
|
-
`).map(i=>{const c=i.match(t.other.beginningSpace);if(c===null)return i;const[l]=c;return l.length>=s.length?i.slice(s.length):i}).join(`
|
|
4
|
-
`)}var P=class{constructor(n){d(this,"options");d(this,"rules");d(this,"lexer");this.options=n||$}space(n){const e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){const e=this.rules.block.code.exec(n);if(e){const t=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?t:_(t,`
|
|
5
|
-
`)}}}fences(n){const e=this.rules.block.fences.exec(n);if(e){const t=e[0],r=it(t,e[3]||"",this.rules);return{type:"code",raw:t,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(n){const e=this.rules.block.heading.exec(n);if(e){let t=e[2].trim();if(this.rules.other.endingHash.test(t)){const r=_(t,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(t=r.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:t,tokens:this.lexer.inline(t)}}}hr(n){const e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:_(e[0],`
|
|
6
|
-
`)}}blockquote(n){const e=this.rules.block.blockquote.exec(n);if(e){let t=_(e[0],`
|
|
7
|
-
`).split(`
|
|
8
|
-
`),r="",s="";const i=[];for(;t.length>0;){let c=!1;const l=[];let h;for(h=0;h<t.length;h++)if(this.rules.other.blockquoteStart.test(t[h]))l.push(t[h]),c=!0;else if(!c)l.push(t[h]);else break;t=t.slice(h);const a=l.join(`
|
|
9
|
-
`),o=a.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
11
|
-
${a}`:a,s=s?`${s}
|
|
12
|
-
${o}`:o;const k=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(o,i,!0),this.lexer.state.top=k,t.length===0)break;const p=i.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const x=p,g=x.raw+`
|
|
13
|
-
`+t.join(`
|
|
14
|
-
`),m=this.blockquote(g);i[i.length-1]=m,r=r.substring(0,r.length-x.raw.length)+m.raw,s=s.substring(0,s.length-x.text.length)+m.text;break}else if((p==null?void 0:p.type)==="list"){const x=p,g=x.raw+`
|
|
15
|
-
`+t.join(`
|
|
16
|
-
`),m=this.list(g);i[i.length-1]=m,r=r.substring(0,r.length-p.raw.length)+m.raw,s=s.substring(0,s.length-x.raw.length)+m.raw,t=g.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(n){let e=this.rules.block.list.exec(n);if(e){let t=e[1].trim();const r=t.length>1,s={type:"list",raw:"",ordered:r,start:r?+t.slice(0,-1):"",loose:!1,items:[]};t=r?`\\d{1,9}\\${t.slice(-1)}`:`\\${t}`,this.options.pedantic&&(t=r?t:"[*+-]");const i=this.rules.other.listItemRegex(t);let c=!1;for(;n;){let h=!1,a="",o="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;a=e[0],n=n.substring(a.length);let k=e[2].split(`
|
|
18
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,Z=>" ".repeat(3*Z.length)),p=n.split(`
|
|
19
|
-
`,1)[0],x=!k.trim(),g=0;if(this.options.pedantic?(g=2,o=k.trimStart()):x?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,o=k.slice(g),g+=e[1].length),x&&this.rules.other.blankLine.test(p)&&(a+=p+`
|
|
20
|
-
`,n=n.substring(p.length+1),h=!0),!h){const Z=this.rules.other.nextBulletRegex(g),Y=this.rules.other.hrRegex(g),ee=this.rules.other.fencesBeginRegex(g),te=this.rules.other.headingBeginRegex(g),be=this.rules.other.htmlBeginRegex(g);for(;n;){const D=n.split(`
|
|
21
|
-
`,1)[0];let v;if(p=D,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),v=p):v=p.replace(this.rules.other.tabCharGlobal," "),ee.test(p)||te.test(p)||be.test(p)||Z.test(p)||Y.test(p))break;if(v.search(this.rules.other.nonSpaceChar)>=g||!p.trim())o+=`
|
|
22
|
-
`+v.slice(g);else{if(x||k.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(k)||te.test(k)||Y.test(k))break;o+=`
|
|
23
|
-
`+p}!x&&!p.trim()&&(x=!0),a+=D+`
|
|
24
|
-
`,n=n.substring(D.length+1),k=v.slice(g)}}s.loose||(c?s.loose=!0:this.rules.other.doubleBlankLine.test(a)&&(c=!0));let m=null,V;this.options.gfm&&(m=this.rules.other.listIsTask.exec(o),m&&(V=m[0]!=="[ ] ",o=o.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:a,task:!!m,checked:V,loose:!1,text:o,tokens:[]}),s.raw+=a}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let h=0;h<s.items.length;h++)if(this.lexer.state.top=!1,s.items[h].tokens=this.lexer.blockTokens(s.items[h].text,[]),!s.loose){const a=s.items[h].tokens.filter(k=>k.type==="space"),o=a.length>0&&a.some(k=>this.rules.other.anyLine.test(k.raw));s.loose=o}if(s.loose)for(let h=0;h<s.items.length;h++)s.items[h].loose=!0;return s}}html(n){const e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){const e=this.rules.block.def.exec(n);if(e){const t=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:t,raw:e[0],href:r,title:s}}}table(n){var c;const e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;const t=ie(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(c=e[3])!=null&&c.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
|
-
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(t.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<t.length;l++)i.header.push({text:t[l],tokens:this.lexer.inline(t[l]),header:!0,align:i.align[l]});for(const l of s)i.rows.push(ie(l,i.header.length).map((h,a)=>({text:h,tokens:this.lexer.inline(h),header:!1,align:i.align[a]})));return i}}lheading(n){const e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){const e=this.rules.block.paragraph.exec(n);if(e){const t=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:t,tokens:this.lexer.inline(t)}}}text(n){const e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){const e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){const e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){const e=this.rules.inline.link.exec(n);if(e){const t=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(t)){if(!this.rules.other.endAngleBracket.test(t))return;const i=_(t.slice(0,-1),"\\");if((t.length-i.length)%2===0)return}else{const i=st(e[2],"()");if(i===-2)return;if(i>-1){const l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let r=e[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(t)?r=r.slice(1):r=r.slice(1,-1)),le(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let t;if((t=this.rules.inline.reflink.exec(n))||(t=this.rules.inline.nolink.exec(n))){const r=(t[2]||t[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=e[r.toLowerCase()];if(!s){const i=t[0].charAt(0);return{type:"text",raw:i,text:i}}return le(t,s,t[0],this.lexer,this.rules)}}emStrong(n,e,t=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!r||r[3]&&t.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!t||this.rules.inline.punctuation.exec(t)){const i=[...r[0]].length-1;let c,l,h=i,a=0;const o=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(o.lastIndex=0,e=e.slice(-1*n.length+i);(r=o.exec(e))!=null;){if(c=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!c)continue;if(l=[...c].length,r[3]||r[4]){h+=l;continue}else if((r[5]||r[6])&&i%3&&!((i+l)%3)){a+=l;continue}if(h-=l,h>0)continue;l=Math.min(l,l+h+a);const k=[...r[0]][0].length,p=n.slice(0,i+r.index+k+l);if(Math.min(i,l)%2){const g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}const x=p.slice(2,-2);return{type:"strong",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}}}codespan(n){const e=this.rules.inline.code.exec(n);if(e){let t=e[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(t),s=this.rules.other.startingSpaceChar.test(t)&&this.rules.other.endingSpaceChar.test(t);return r&&s&&(t=t.substring(1,t.length-1)),{type:"codespan",raw:e[0],text:t}}}br(n){const e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){const e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){const e=this.rules.inline.autolink.exec(n);if(e){let t,r;return e[2]==="@"?(t=e[1],r="mailto:"+t):(t=e[1],r=t),{type:"link",raw:e[0],text:t,href:r,tokens:[{type:"text",raw:t,text:t}]}}}url(n){var t;let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let i;do i=e[0],e[0]=((t=this.rules.inline._backpedal.exec(e[0]))==null?void 0:t[0])??"";while(i!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){const e=this.rules.inline.text.exec(n);if(e){const t=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:t}}}},y=class O{constructor(e){d(this,"tokens");d(this,"options");d(this,"state");d(this,"tokenizer");d(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$,this.options.tokenizer=this.options.tokenizer||new P,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:b,block:L.normal,inline:T.normal};this.options.pedantic?(t.block=L.pedantic,t.inline=T.pedantic):this.options.gfm&&(t.block=L.gfm,this.options.breaks?t.inline=T.breaks:t.inline=T.gfm),this.tokenizer.rules=t}static get rules(){return{block:L,inline:T}}static lex(e,t){return new O(t).lex(e)}static lexInline(e,t){return new O(t).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
|
|
27
|
-
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const r=this.inlineQueue[t];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],r=!1){var s,i,c;for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let l;if((i=(s=this.options.extensions)==null?void 0:s.block)!=null&&i.some(a=>(l=a.call({lexer:this},e,t))?(e=e.substring(l.raw.length),t.push(l),!0):!1))continue;if(l=this.tokenizer.space(e)){e=e.substring(l.raw.length);const a=t.at(-1);l.raw.length===1&&a!==void 0?a.raw+=`
|
|
28
|
-
`:t.push(l);continue}if(l=this.tokenizer.code(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
29
|
-
`+l.raw,a.text+=`
|
|
30
|
-
`+l.text,this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(l=this.tokenizer.fences(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.heading(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.hr(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.blockquote(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.list(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.html(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.def(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="paragraph"||(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
31
|
-
`+l.raw,a.text+=`
|
|
32
|
-
`+l.raw,this.inlineQueue.at(-1).src=a.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(e)){e=e.substring(l.raw.length),t.push(l);continue}if(l=this.tokenizer.lheading(e)){e=e.substring(l.raw.length),t.push(l);continue}let h=e;if((c=this.options.extensions)!=null&&c.startBlock){let a=1/0;const o=e.slice(1);let k;this.options.extensions.startBlock.forEach(p=>{k=p.call({lexer:this},o),typeof k=="number"&&k>=0&&(a=Math.min(a,k))}),a<1/0&&a>=0&&(h=e.substring(0,a+1))}if(this.state.top&&(l=this.tokenizer.paragraph(h))){const a=t.at(-1);r&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=`
|
|
33
|
-
`+l.raw,a.text+=`
|
|
34
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l),r=h.length!==e.length,e=e.substring(l.raw.length);continue}if(l=this.tokenizer.text(e)){e=e.substring(l.raw.length);const a=t.at(-1);(a==null?void 0:a.type)==="text"?(a.raw+=`
|
|
35
|
-
`+l.raw,a.text+=`
|
|
36
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(l);continue}if(e){const a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}else throw new Error(a)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var l,h,a;let r=e,s=null;if(this.tokens.links){const o=Object.keys(this.tokens.links);if(o.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)o.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,c="";for(;e;){i||(c=""),i=!1;let o;if((h=(l=this.options.extensions)==null?void 0:l.inline)!=null&&h.some(p=>(o=p.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.escape(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.tag(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.link(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(o.raw.length);const p=t.at(-1);o.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(o=this.tokenizer.emStrong(e,r,c)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.codespan(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.br(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.del(e)){e=e.substring(o.raw.length),t.push(o);continue}if(o=this.tokenizer.autolink(e)){e=e.substring(o.raw.length),t.push(o);continue}if(!this.state.inLink&&(o=this.tokenizer.url(e))){e=e.substring(o.raw.length),t.push(o);continue}let k=e;if((a=this.options.extensions)!=null&&a.startInline){let p=1/0;const x=e.slice(1);let g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},x),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),p<1/0&&p>=0&&(k=e.substring(0,p+1))}if(o=this.tokenizer.inlineText(k)){e=e.substring(o.raw.length),o.raw.slice(-1)!=="_"&&(c=o.raw.slice(-1)),i=!0;const p=t.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=o.raw,p.text+=o.text):t.push(o);continue}if(e){const p="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return t}},B=class{constructor(n){d(this,"options");d(this,"parser");this.options=n||$}space(n){return""}code({text:n,lang:e,escaped:t}){var i;const r=(i=(e||"").match(b.notSpaceStart))==null?void 0:i[0],s=n.replace(b.endingNewline,"")+`
|
|
37
|
-
`;return r?'<pre><code class="language-'+w(r)+'">'+(t?s:w(s,!0))+`</code></pre>
|
|
38
|
-
`:"<pre><code>"+(t?s:w(s,!0))+`</code></pre>
|
|
39
|
-
`}blockquote({tokens:n}){return`<blockquote>
|
|
40
|
-
${this.parser.parse(n)}</blockquote>
|
|
41
|
-
`}html({text:n}){return n}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
|
|
42
|
-
`}hr(n){return`<hr>
|
|
43
|
-
`}list(n){const e=n.ordered,t=n.start;let r="";for(let c=0;c<n.items.length;c++){const l=n.items[c];r+=this.listitem(l)}const s=e?"ol":"ul",i=e&&t!==1?' start="'+t+'"':"";return"<"+s+i+`>
|
|
44
|
-
`+r+"</"+s+`>
|
|
45
|
-
`}listitem(n){var t;let e="";if(n.task){const r=this.checkbox({checked:!!n.checked});n.loose?((t=n.tokens[0])==null?void 0:t.type)==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+w(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
|
|
46
|
-
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
47
|
-
`}table(n){let e="",t="";for(let s=0;s<n.header.length;s++)t+=this.tablecell(n.header[s]);e+=this.tablerow({text:t});let r="";for(let s=0;s<n.rows.length;s++){const i=n.rows[s];t="";for(let c=0;c<i.length;c++)t+=this.tablecell(i[c]);r+=this.tablerow({text:t})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
48
|
-
<thead>
|
|
49
|
-
`+e+`</thead>
|
|
50
|
-
`+r+`</table>
|
|
51
|
-
`}tablerow({text:n}){return`<tr>
|
|
52
|
-
${n}</tr>
|
|
53
|
-
`}tablecell(n){const e=this.parser.parseInline(n.tokens),t=n.header?"th":"td";return(n.align?`<${t} align="${n.align}">`:`<${t}>`)+e+`</${t}>
|
|
54
|
-
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:t}){const r=this.parser.parseInline(t),s=se(n);if(s===null)return r;n=s;let i='<a href="'+n+'"';return e&&(i+=' title="'+w(e)+'"'),i+=">"+r+"</a>",i}image({href:n,title:e,text:t,tokens:r}){r&&(t=this.parser.parseInline(r,this.parser.textRenderer));const s=se(n);if(s===null)return w(t);n=s;let i=`<img src="${n}" alt="${t}"`;return e&&(i+=` title="${w(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},K=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},R=class N{constructor(e){d(this,"options");d(this,"renderer");d(this,"textRenderer");this.options=e||$,this.options.renderer=this.options.renderer||new B,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new K}static parse(e,t){return new N(t).parse(e)}static parseInline(e,t){return new N(t).parseInline(e)}parse(e,t=!0){var s,i;let r="";for(let c=0;c<e.length;c++){const l=e[c];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const a=l,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(a.type)){r+=o||"";continue}}const h=l;switch(h.type){case"space":{r+=this.renderer.space(h);continue}case"hr":{r+=this.renderer.hr(h);continue}case"heading":{r+=this.renderer.heading(h);continue}case"code":{r+=this.renderer.code(h);continue}case"table":{r+=this.renderer.table(h);continue}case"blockquote":{r+=this.renderer.blockquote(h);continue}case"list":{r+=this.renderer.list(h);continue}case"html":{r+=this.renderer.html(h);continue}case"paragraph":{r+=this.renderer.paragraph(h);continue}case"text":{let a=h,o=this.renderer.text(a);for(;c+1<e.length&&e[c+1].type==="text";)a=e[++c],o+=`
|
|
55
|
-
`+this.renderer.text(a);t?r+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):r+=o;continue}default:{const a='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}parseInline(e,t=this.renderer){var s,i;let r="";for(let c=0;c<e.length;c++){const l=e[c];if((i=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&i[l.type]){const a=this.options.extensions.renderers[l.type].call({parser:this},l);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=a||"";continue}}const h=l;switch(h.type){case"escape":{r+=t.text(h);break}case"html":{r+=t.html(h);break}case"link":{r+=t.link(h);break}case"image":{r+=t.image(h);break}case"strong":{r+=t.strong(h);break}case"em":{r+=t.em(h);break}case"codespan":{r+=t.codespan(h);break}case"br":{r+=t.br(h);break}case"del":{r+=t.del(h);break}case"text":{r+=t.text(h);break}default:{const a='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return r}},M,C=(M=class{constructor(n){d(this,"options");d(this,"block");this.options=n||$}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}provideLexer(){return this.block?y.lex:y.lexInline}provideParser(){return this.block?R.parse:R.parseInline}},d(M,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),M),lt=class{constructor(...n){d(this,"defaults",j());d(this,"options",this.setOptions);d(this,"parse",this.parseMarkdown(!0));d(this,"parseInline",this.parseMarkdown(!1));d(this,"Parser",R);d(this,"Renderer",B);d(this,"TextRenderer",K);d(this,"Lexer",y);d(this,"Tokenizer",P);d(this,"Hooks",C);this.use(...n)}walkTokens(n,e){var r,s;let t=[];for(const i of n)switch(t=t.concat(e.call(this,i)),i.type){case"table":{const c=i;for(const l of c.header)t=t.concat(this.walkTokens(l.tokens,e));for(const l of c.rows)for(const h of l)t=t.concat(this.walkTokens(h.tokens,e));break}case"list":{const c=i;t=t.concat(this.walkTokens(c.items,e));break}default:{const c=i;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[c.type]?this.defaults.extensions.childTokens[c.type].forEach(l=>{const h=c[l].flat(1/0);t=t.concat(this.walkTokens(h,e))}):c.tokens&&(t=t.concat(this.walkTokens(c.tokens,e)))}}return t}use(...n){const e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(t=>{const r={...t};if(r.async=this.defaults.async||r.async||!1,t.extensions&&(t.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=e.renderers[s.name];i?e.renderers[s.name]=function(...c){let l=s.renderer.apply(this,c);return l===!1&&(l=i.apply(this,c)),l}:e.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=e[s.level];i?i.unshift(s.tokenizer):e[s.level]=[s.tokenizer],s.start&&(s.level==="block"?e.startBlock?e.startBlock.push(s.start):e.startBlock=[s.start]:s.level==="inline"&&(e.startInline?e.startInline.push(s.start):e.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(e.childTokens[s.name]=s.childTokens)}),r.extensions=e),t.renderer){const s=this.defaults.renderer||new B(this.defaults);for(const i in t.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const c=i,l=t.renderer[c],h=s[c];s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=h.apply(s,a)),o||""}}r.renderer=s}if(t.tokenizer){const s=this.defaults.tokenizer||new P(this.defaults);for(const i in t.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const c=i,l=t.tokenizer[c],h=s[c];s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=h.apply(s,a)),o}}r.tokenizer=s}if(t.hooks){const s=this.defaults.hooks||new C;for(const i in t.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const c=i,l=t.hooks[c],h=s[c];C.passThroughHooks.has(i)?s[c]=a=>{if(this.defaults.async)return Promise.resolve(l.call(s,a)).then(k=>h.call(s,k));const o=l.call(s,a);return h.call(s,o)}:s[c]=(...a)=>{let o=l.apply(s,a);return o===!1&&(o=h.apply(s,a)),o}}r.hooks=s}if(t.walkTokens){const s=this.defaults.walkTokens,i=t.walkTokens;r.walkTokens=function(c){let l=[];return l.push(i.call(this,c)),s&&(l=l.concat(s.call(this,c))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return y.lex(n,e??this.defaults)}parser(n,e){return R.parse(n,e??this.defaults)}parseMarkdown(n){return(t,r)=>{const s={...r},i={...this.defaults,...s},c=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&s.async===!1)return c(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return c(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return c(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=n);const l=i.hooks?i.hooks.provideLexer():n?y.lex:y.lexInline,h=i.hooks?i.hooks.provideParser():n?R.parse:R.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(t):t).then(a=>l(a,i)).then(a=>i.hooks?i.hooks.processAllTokens(a):a).then(a=>i.walkTokens?Promise.all(this.walkTokens(a,i.walkTokens)).then(()=>a):a).then(a=>h(a,i)).then(a=>i.hooks?i.hooks.postprocess(a):a).catch(c);try{i.hooks&&(t=i.hooks.preprocess(t));let a=l(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let o=h(a,i);return i.hooks&&(o=i.hooks.postprocess(o)),o}catch(a){return c(a)}}}onError(n,e){return t=>{if(t.message+=`
|
|
56
|
-
Please report this to https://github.com/markedjs/marked.`,n){const r="<p>An error occurred:</p><pre>"+w(t.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(t);throw t}}},S=new lt;function f(n,e){return S.parse(n,e)}f.options=f.setOptions=function(n){return S.setOptions(n),f.defaults=S.defaults,ae(f.defaults),f};f.getDefaults=j;f.defaults=$;f.use=function(...n){return S.use(...n),f.defaults=S.defaults,ae(f.defaults),f};f.walkTokens=function(n,e){return S.walkTokens(n,e)};f.parseInline=S.parseInline;f.Parser=R;f.parser=R.parse;f.Renderer=B;f.TextRenderer=K;f.Lexer=y;f.lexer=y.lex;f.Tokenizer=P;f.Hooks=C;f.parse=f;f.options;f.setOptions;f.use;f.walkTokens;f.parseInline;R.parse;y.lex;const at=["innerHTML"],ht=ye({__name:"MarkdownContent",props:{content:{}},setup(n){const e=n,t=$e(()=>e.content?f.parse(e.content,{async:!1}):"");return(r,s)=>(Re(),Se("div",{class:"prose prose-sm dark:prose-invert max-w-none",innerHTML:t.value},null,8,at))}});export{ht as _};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k,p as C,r as a,g as n,d as t,j as m,x as p,i as S,N as u,J as v,G as h,f as _,S as V,F as N,t as M,s as i,w as b,m as y}from"./index-DfdD_qE4.js";import{b as P,c as T,d as U,a as $}from"./api-CaqVk-rG.js";import{P as j}from"./plus-GvGwcjX5.js";import{T as B}from"./trash-2-Ba_1SAua.js";const D={class:"p-6"},L={class:"flex items-center justify-between mb-6"},A={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3"},F={class:"grid grid-cols-2 gap-3"},G={key:0},z={key:1},E={key:1,class:"text-muted-foreground"},J={key:2,class:"text-center py-12 text-muted-foreground"},R={key:3,class:"space-y-2"},q={class:"font-medium text-sm"},H={class:"ml-2 text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},I={class:"flex items-center gap-3"},K=["onClick"],O=["onClick"],ee=k({__name:"McpView",setup(Q){const d=i([]),c=i(!0),r=i(!1),o=i({name:"",type:"stdio",command:"",url:""});C(async()=>{try{d.value=await P("/mcp")}finally{c.value=!1}});async function f(l){await U(`/mcp/${l.id}`,{enabled:!l.enabled}),l.enabled=!l.enabled}async function x(l){await $(`/mcp/${l}`),d.value=d.value.filter(e=>e.id!==l)}async function g(){const l={name:o.value.name,type:o.value.type};o.value.type==="stdio"?l.command=o.value.command:l.url=o.value.url;const e=await T("/mcp",l);d.value.push(e),r.value=!1,o.value={name:"",type:"stdio",command:"",url:""}}return(l,e)=>(a(),n("div",D,[t("div",L,[e[6]||(e[6]=t("h1",{class:"text-2xl font-bold"},"MCP Servers",-1)),t("button",{onClick:e[0]||(e[0]=s=>r.value=!r.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]=S(" Add Server ",-1))])]),r.value?(a(),n("div",A,[t("div",F,[t("div",null,[e[7]||(e[7]=t("label",{class:"text-sm font-medium"},"Name",-1)),u(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>o.value.name=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.name]])]),t("div",null,[e[9]||(e[9]=t("label",{class:"text-sm font-medium"},"Type",-1)),u(t("select",{"onUpdate:modelValue":e[2]||(e[2]=s=>o.value.type=s),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[8]||(e[8]=[t("option",{value:"stdio"},"stdio",-1),t("option",{value:"http"},"http",-1)])],512),[[h,o.value.type]])])]),o.value.type==="stdio"?(a(),n("div",G,[e[10]||(e[10]=t("label",{class:"text-sm font-medium"},"Command",-1)),u(t("input",{"onUpdate:modelValue":e[3]||(e[3]=s=>o.value.command=s),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),[[v,o.value.command]])])):(a(),n("div",z,[e[11]||(e[11]=t("label",{class:"text-sm font-medium"},"URL",-1)),u(t("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>o.value.url=s),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[v,o.value.url]])])),t("button",{onClick:g,class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90"},"Save")])):_("",!0),c.value?(a(),n("div",E,"Loading...")):d.value.length===0?(a(),n("div",J,[m(p(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[12]||(e[12]=t("p",null,"No MCP servers configured.",-1))])):(a(),n("div",R,[(a(!0),n(N,null,M(d.value,s=>(a(),n("div",{key:s.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[t("div",null,[t("span",q,b(s.name),1),t("span",H,b(s.type),1)]),t("div",I,[t("button",{onClick:w=>f(s),class:y(["relative w-10 h-5 rounded-full transition-colors",s.enabled?"bg-primary":"bg-muted"])},[t("span",{class:y(["absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",s.enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,K),t("button",{onClick:w=>x(s.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[m(p(B),{class:"w-4 h-4"})],8,O)])]))),128))]))]))}});export{ee as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as U,p as z,r as d,g as l,d as o,j as b,x as c,i as A,F as f,t as g,N as p,G as x,J as w,f as S,b as B,w as n,s as u,c as D,m as y,o as j}from"./index-DfdD_qE4.js";import{b as h,c as L,d as M,a as E}from"./api-CaqVk-rG.js";import{g as F}from"./squad-colors-B8B_Y-lz.js";import{P as G}from"./plus-GvGwcjX5.js";import{T as O}from"./trash-2-Ba_1SAua.js";const I={class:"p-6"},J={class:"flex items-center justify-between mb-6"},H={class:"flex gap-1 border-b border-border mb-4"},K=["onClick"],Q={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},R={class:"grid grid-cols-2 gap-3"},W=["value"],X={key:0},Y={key:1},Z=["disabled"],ee={key:1,class:"text-muted-foreground"},te={key:2,class:"text-center py-12 text-muted-foreground"},oe={key:3,class:"space-y-2"},se={class:"text-sm font-medium font-mono"},ae={key:0,class:"mt-1"},de={class:"text-xs text-muted-foreground mt-0.5"},le={class:"text-xs text-muted-foreground mt-0.5"},ne={class:"flex items-center gap-3"},re=["onClick"],ue=["onClick"],fe=U({__name:"SchedulesView",setup(ie){const i=u([]),r=u([]),q=u(!0),m=u("squad"),v=u(!1),a=u({type:"squad",cron:"",squad_id:"",agenda:"triage",prompt:""});z(async()=>{try{const s=await h("/squads");r.value=s.squads,r.value.length>0&&(a.value.squad_id=r.value[0].id),i.value=await h("/schedules")}finally{q.value=!1}});const k=()=>i.value.filter(s=>s.type===m.value);async function C(){const s={type:a.value.type,cron:a.value.cron,squad_id:a.value.squad_id};if(a.value.type==="squad"){if(!a.value.squad_id)return;s.agenda=a.value.agenda}else s.prompt=a.value.prompt;const e=await L("/schedules",s);i.value.push(e),v.value=!1}function V(s){if(s)return r.value.find(e=>e.id===s)}const N=D(()=>k().map(s=>({...s,squad:V(s.squad_id)})));async function T(s){const e=!s.enabled;await M(`/schedules/${s.id}`,{enabled:e}),s.enabled=e?1:0}async function $(s){await E(`/schedules/${s}`),i.value=i.value.filter(e=>e.id!==s)}function P(s){var e;return s?((e=r.value.find(t=>t.id===s))==null?void 0:e.name)??s:"Unknown squad"}return(s,e)=>(d(),l("div",I,[o("div",J,[e[7]||(e[7]=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"},[b(c(G),{class:"w-4 h-4"}),e[6]||(e[6]=A(" Add Schedule ",-1))])]),o("div",H,[(d(),l(f,null,g(["squad","io"],t=>o("button",{key:t,onClick:_=>m.value=t,class:y(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",m.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},n(t==="squad"?"Squad Schedules":"IO Schedules"),11,K)),64))]),v.value?(d(),l("div",Q,[o("div",R,[o("div",null,[e[9]||(e[9]=o("label",{class:"text-sm font-medium"},"Type",-1)),p(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[8]||(e[8]=[o("option",{value:"squad"},"Squad",-1),o("option",{value:"io"},"IO",-1)])],512),[[x,a.value.type]])]),o("div",null,[e[10]||(e[10]=o("label",{class:"text-sm font-medium"},"Cron Expression",-1)),p(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),[[w,a.value.cron]])])]),o("div",null,[e[11]||(e[11]=o("label",{class:"text-sm font-medium"},"Target Squad",-1)),p(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),l(f,null,g(r.value,t=>(d(),l("option",{key:t.id,value:t.id},n(t.name),9,W))),128))],512),[[x,a.value.squad_id]])]),a.value.type==="squad"?(d(),l("div",X,[e[13]||(e[13]=o("label",{class:"text-sm font-medium"},"Agenda",-1)),p(o("select",{"onUpdate:modelValue":e[4]||(e[4]=t=>a.value.agenda=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[12]||(e[12]=[o("option",{value:"triage"},"Triage",-1),o("option",{value:"prioritize"},"Prioritize",-1),o("option",{value:"ideation"},"Ideation",-1)])],512),[[x,a.value.agenda]])])):(d(),l("div",Y,[e[14]||(e[14]=o("label",{class:"text-sm font-medium"},"Prompt",-1)),p(o("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>a.value.prompt=t),rows:"2",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[w,a.value.prompt]])])),o("button",{onClick:C,disabled:!a.value.squad_id,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,Z)])):S("",!0),q.value?(d(),l("div",ee,"Loading...")):k().length===0?(d(),l("div",te,[b(c(B),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),o("p",null,"No "+n(m.value)+" schedules configured.",1)])):(d(),l("div",oe,[(d(!0),l(f,null,g(N.value,t=>(d(),l("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[o("div",null,[o("div",se,n(t.cron),1),t.squad?(d(),l("div",ae,[o("span",{class:"text-xs px-2 py-0.5 rounded-full",style:j(c(F)(t.squad.color))},n(t.squad.name),5)])):S("",!0),o("div",de,n(t.type==="squad"?`Agenda: ${t.agenda}`:t.prompt.slice(0,60)),1),o("div",le," Squad: "+n(P(t.squad_id)),1)]),o("div",ne,[o("button",{onClick:_=>T(t),class:y(["relative w-10 h-5 rounded-full transition-colors",t.enabled?"bg-primary":"bg-muted"])},[o("span",{class:y(["absolute top-0.5 w-4 h-4 rounded-full bg-white transition-transform",t.enabled?"translate-x-5":"translate-x-0.5"])},null,2)],10,re),o("button",{onClick:_=>$(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[b(c(O),{class:"w-4 h-4"})],8,ue)])]))),128))]))]))}});export{fe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{k as w,p as E,r as d,g as s,d as t,w as g,F as x,t as U,N as a,J as n,G as M,E as p,f as b,s as r,m as T}from"./index-DfdD_qE4.js";import{b as V,d as S}from"./api-CaqVk-rG.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"},G={key:1,class:"space-y-4 max-w-lg"},L={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},F={key:3,class:"space-y-4 max-w-lg"},O={class:"flex items-center gap-3"},P={class:"flex items-center gap-3"},$=w({__name:"SettingsView",setup(R){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:q=>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",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),[[M,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",G,[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",L,[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",j,[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",F,[t("div",O,[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",P,[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{$ as default};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import{h as me,k as fe,p as xe,r as o,g as a,d as t,m as E,j as u,x as d,i as Q,F as p,N as C,J as M,O as ee,w as r,f as S,P as te,t as se,G as ge,e as oe,s as n,c as ye,Q as le}from"./index-DfdD_qE4.js";import{b as N,c as q,d as be,a as ke}from"./api-CaqVk-rG.js";import{_ as ae}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js";import{P as ne}from"./plus-GvGwcjX5.js";import{S as he}from"./search-C3fxUixl.js";import{P as _e,S as we}from"./save-fQ_rr5hX.js";import{X as Ce}from"./x-CJifAZQa.js";import{T as Se}from"./trash-2-Ba_1SAua.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 J=me("GlobeIcon",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]),$e={class:"flex h-full"},Ie={class:"w-72 border-r border-border flex flex-col shrink-0"},Le={class:"flex border-b border-border"},Fe={class:"p-3 border-b border-border space-y-2"},Me={class:"flex gap-1"},Ue={key:0,class:"space-y-1.5"},Ve={class:"flex gap-1"},De=["disabled"],Pe={key:1,class:"space-y-1.5"},Te={key:0,class:"mt-0.5 text-xs text-muted-foreground font-mono"},je={class:"flex gap-1"},Ee=["disabled"],Ne={class:"flex-1 overflow-y-auto p-2"},ze={key:0,class:"text-xs text-muted-foreground p-2"},Ae={key:1,class:"text-center py-8 text-muted-foreground"},Ge=["onClick"],Ke={class:"min-w-0 flex-1"},Be={class:"font-medium truncate"},Re={class:"text-muted-foreground truncate"},Qe=["onClick"],qe={class:"p-3 border-b border-border space-y-2"},Je={class:"relative"},Oe=["disabled"],Xe={class:"flex-1 overflow-y-auto p-2"},He={key:0,class:"text-xs text-muted-foreground p-2"},We={key:1,class:"text-xs text-destructive p-2"},Ye={key:2,class:"text-center py-8 text-muted-foreground"},Ze=["onClick"],et={class:"min-w-0 flex-1"},tt={class:"font-medium truncate"},st=["title"],ot=["onClick","disabled"],lt={key:1,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-muted text-muted-foreground"},at={class:"flex-1 flex flex-col"},nt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},rt={class:"text-center"},it={class:"flex items-center justify-between px-4 py-2 border-b border-border"},ut={class:"text-sm font-medium"},dt={class:"text-xs text-muted-foreground ml-2 font-mono"},ct={class:"flex gap-1"},vt={class:"flex-1 overflow-y-auto p-4"},pt={key:0,class:"text-muted-foreground text-sm"},mt={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},ft={class:"text-center"},xt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},gt={class:"min-w-0 flex-1"},yt={class:"text-sm font-medium"},bt={class:"text-xs text-muted-foreground ml-2"},kt=["disabled"],ht={key:1,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-muted text-muted-foreground"},_t={class:"flex-1 overflow-y-auto p-4"},wt={key:0,class:"text-muted-foreground text-sm"},Ct={key:0,class:"absolute bottom-4 left-4 text-sm text-destructive bg-background border border-destructive/30 px-3 py-2 rounded-md"},re=`# My Skill
|
|
7
|
-
|
|
8
|
-
A brief description of what this skill does.
|
|
9
|
-
|
|
10
|
-
## Usage
|
|
11
|
-
|
|
12
|
-
Instructions for how to use this skill...
|
|
13
|
-
`,Pt=fe({__name:"SkillsView",setup(St){const U=n([]),z=n(!0),V=n(!1),A=n("git"),g=n(""),f=n(""),y=n(re),m=n(!1),i=n(""),O=ye(()=>f.value.trim().replace(/[^a-z0-9-]/gi,"-").toLowerCase().replace(/-+/g,"-").replace(/^-|-$/g,"")),v=n(null),x=n(""),b=n(!1),$=n(""),G=n(!1),k=n("installed"),K=n("awesome-copilot"),D=n(""),I=n([]),L=n(!1),P=n(""),c=n(null),h=n(""),B=n(!1),_=n("");async function w(){z.value=!0;try{U.value=await N("/skills")}finally{z.value=!1}}function X(l){A.value=l,V.value=!0,i.value=""}function T(){V.value=!1,g.value="",f.value="",y.value=re,i.value=""}async function H(){if(g.value.trim()){m.value=!0,i.value="";try{await q("/skills",{url:g.value.trim()}),T(),await w()}catch(l){i.value=l.message||"Failed to install skill"}finally{m.value=!1}}}async function ie(){if(!(!f.value.trim()||!y.value.trim())){m.value=!0,i.value="";try{await q("/skills",{slug:O.value,content:y.value}),T(),await w()}catch(l){i.value=l.message||"Failed to create skill"}finally{m.value=!1}}}async function ue(l){var e;try{await ke(`/skills/${l}`),((e=v.value)==null?void 0:e.slug)===l&&(v.value=null,x.value=""),await w()}catch(s){i.value=s.message||"Failed to remove skill"}}async function de(l){v.value=l,b.value=!1,G.value=!0;try{const e=await N(`/skills/${l.slug}/content`);x.value=e.content}catch(e){x.value=`Error loading skill: ${e.message}`}finally{G.value=!1}}function ce(){$.value=x.value,b.value=!0}async function ve(){if(v.value)try{await be(`/skills/${v.value.slug}/content`,{content:$.value}),x.value=$.value,b.value=!1,await w()}catch(l){i.value=l.message||"Failed to save skill"}}async function j(){L.value=!0,P.value="",c.value=null,h.value="";try{const l=new URLSearchParams({source:K.value});D.value.trim()&&l.set("q",D.value.trim()),I.value=await N(`/skills/discover?${l}`)}catch(l){P.value=l.message||"Failed to fetch community skills",I.value=[]}finally{L.value=!1}}async function pe(l){c.value=l,B.value=!0,h.value="";try{const e=await N(`/skills/preview?source=${l.source}&slug=${encodeURIComponent(l.slug)}`);h.value=e.content}catch(e){h.value=`Error loading preview: ${e.message}`}finally{B.value=!1}}async function W(l){_.value=l.slug,i.value="";try{await q("/skills",{source:l.source,slug:l.slug}),await w(),k.value="installed"}catch(e){i.value=e.message||"Failed to install skill"}finally{_.value=""}}function Y(l){return U.value.some(e=>e.slug===l)}function Z(l){k.value=l,v.value=null,c.value=null,x.value="",h.value="",l==="discover"&&I.value.length===0&&j()}return xe(w),(l,e)=>(o(),a("div",$e,[t("div",Ie,[t("div",Le,[t("button",{onClick:e[0]||(e[0]=s=>Z("installed")),class:E(["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:E(["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(J),{class:"w-3 h-3 inline mr-1"}),e[12]||(e[12]=Q(" Discover ",-1))],2)]),k.value==="installed"?(o(),a(p,{key:0},[t("div",Fe,[t("div",Me,[t("button",{onClick:e[2]||(e[2]=s=>X("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=>X("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))])]),V.value&&A.value==="git"?(o(),a("div",Ue,[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(H,["enter"])},null,544),[[M,g.value]]),t("div",Ve,[t("button",{onClick:H,disabled:m.value||!g.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Installing...":"Install"),9,De),t("button",{onClick:T,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0),V.value&&A.value==="create"?(o(),a("div",Pe,[t("div",null,[C(t("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>f.value=s),type:"text",placeholder:"Skill title",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[M,f.value]]),f.value.trim()?(o(),a("p",Te," slug: "+r(O.value),1)):S("",!0)]),C(t("textarea",{"onUpdate:modelValue":e[6]||(e[6]=s=>y.value=s),rows:"8",placeholder:`# My Skill
|
|
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",je,[t("button",{onClick:ie,disabled:m.value||!f.value.trim()||!y.value.trim(),class:"flex-1 px-2 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(m.value?"Creating...":"Create"),9,Ee),t("button",{onClick:T,class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):S("",!0)]),t("div",Ne,[z.value?(o(),a("div",ze,"Loading...")):U.value.length===0?(o(),a("div",Ae,[u(d(te),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[15]||(e[15]=t("p",{class:"text-xs"},"No skills installed.",-1))])):S("",!0),(o(!0),a(p,null,se(U.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>de(s),class:E(["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",Ke,[t("div",Be,r(s.name),1),t("div",Re,r(s.slug),1)]),t("button",{onClick:le(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,Ge)}),128))])],64)):(o(),a(p,{key:1},[t("div",qe,[C(t("select",{"onUpdate:modelValue":e[7]||(e[7]=s=>K.value=s),onChange:j,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,K.value]]),t("div",Je,[u(d(he),{class:"absolute left-2 top-1/2 -translate-y-1/2 w-3 h-3 text-muted-foreground"}),C(t("input",{"onUpdate:modelValue":e[8]||(e[8]=s=>D.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(j,["enter"])},null,544),[[M,D.value]])]),t("button",{onClick:j,disabled:L.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(L.value?"Searching...":"Search"),9,Oe)]),t("div",Xe,[L.value?(o(),a("div",He,"Loading...")):P.value?(o(),a("div",We,r(P.value),1)):I.value.length===0?(o(),a("div",Ye,[u(d(J),{class:"w-8 h-8 mx-auto mb-2 opacity-50"}),e[17]||(e[17]=t("p",{class:"text-xs"},"No skills found.",-1))])):S("",!0),(o(!0),a(p,null,se(I.value,s=>{var F;return o(),a("div",{key:s.slug,onClick:R=>pe(s),class:E(["flex items-start justify-between px-2 py-2 text-xs rounded cursor-pointer hover:bg-accent transition-colors gap-1",{"bg-accent":((F=c.value)==null?void 0:F.slug)===s.slug}])},[t("div",et,[t("div",tt,r(s.slug),1),t("div",{class:"text-muted-foreground line-clamp-2 mt-0.5",title:s.description},r(s.description),9,st)]),Y(s.slug)?(o(),a("span",lt," Installed ")):(o(),a("button",{key:0,onClick:le(R=>W(s),["stop"]),disabled:_.value===s.slug,class:"shrink-0 mt-0.5 px-1.5 py-0.5 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",title:"Install"},r(_.value===s.slug?"...":"Install"),9,ot))],10,Ze)}),128))])],64))]),t("div",at,[k.value==="installed"?(o(),a(p,{key:0},[v.value?(o(),a(p,{key:1},[t("div",it,[t("div",null,[t("span",ut,r(v.value.name),1),t("span",dt,r(v.value.slug)+"/SKILL.md",1)]),t("div",ct,[b.value?(o(),a(p,{key:1},[t("button",{onClick:ve,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[u(d(we),{class:"w-4 h-4"})]),t("button",{onClick:e[9]||(e[9]=s=>b.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[u(d(Ce),{class:"w-4 h-4"})])],64)):(o(),a("button",{key:0,onClick:ce,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[u(d(_e),{class:"w-4 h-4"})]))])]),t("div",vt,[G.value?(o(),a("div",pt,"Loading...")):b.value?C((o(),a("textarea",{key:1,"onUpdate:modelValue":e[10]||(e[10]=s=>$.value=s),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[M,$.value]]):(o(),oe(ae,{key:2,content:x.value},null,8,["content"]))])],64)):(o(),a("div",nt,[t("div",rt,[u(d(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=t("p",null,"Select a skill to view",-1))])]))],64)):(o(),a(p,{key:1},[c.value?(o(),a(p,{key:1},[t("div",xt,[t("div",gt,[t("span",yt,r(c.value.slug),1),t("span",bt,r(c.value.source),1)]),Y(c.value.slug)?(o(),a("span",ht," Installed ")):(o(),a("button",{key:0,onClick:e[11]||(e[11]=s=>W(c.value)),disabled:_.value===c.value.slug,class:"ml-2 shrink-0 px-3 py-1 text-xs rounded bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50"},r(_.value===c.value.slug?"Installing...":"Install"),9,kt))]),t("div",_t,[B.value?(o(),a("div",wt,"Loading preview...")):(o(),oe(ae,{key:1,content:h.value},null,8,["content"]))])],64)):(o(),a("div",mt,[t("div",ft,[u(d(J),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[19]||(e[19]=t("p",null,"Select a skill to preview",-1))])]))],64))]),i.value?(o(),a("p",Ct,r(i.value),1)):S("",!0)]))}});export{Pt as default};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import{h as w,k as R,K as J,p as j,n as D,q as O,r as s,g as r,d as t,j as m,x as c,A as z,m as b,w as l,e as N,f as v,F as T,t as I,s as p,c as V,L as P,o as F,z as H,u as G,i as _}from"./index-DfdD_qE4.js";import{b as B,e as U,a as X}from"./api-CaqVk-rG.js";import{g as Z}from"./squad-colors-B8B_Y-lz.js";import{_ as q}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js";import{X as K}from"./x-CJifAZQa.js";import{G as Q}from"./git-branch-Bu9s__XL.js";import{T as W}from"./trash-2-Ba_1SAua.js";import{A as Y}from"./arrow-left-CkDjCT7Z.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 ee=w("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 te=w("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 se=w("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 re=w("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 oe=w("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"}]]);/**
|
|
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 ae=w("UserIcon",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]),le={class:"flex flex-col h-full border border-border rounded-lg overflow-hidden bg-background"},ne={class:"flex items-center justify-between px-4 py-3 border-b border-border bg-muted/30"},ie={class:"flex items-center gap-2 min-w-0"},de={class:"flex items-center gap-2"},ue=["aria-label","title"],ce={class:"px-4 py-2 text-xs text-muted-foreground border-b border-border bg-muted/10 truncate"},me={key:0,class:"text-muted-foreground text-xs"},pe={key:1,class:"text-muted-foreground text-xs"},xe={class:"flex items-center justify-between mb-1"},fe={class:"text-xs font-medium text-muted-foreground uppercase tracking-wide"},ye={class:"text-xs text-muted-foreground"},ge={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},ve={key:1},be={key:1,class:"text-sm"},he={key:2,class:"border border-border border-l-2 border-l-yellow-500 rounded-lg p-3 animate-pulse"},_e={key:0,class:"text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap break-all"},we=R({__name:"AgentActivityPreview",props:{taskId:{},taskDescription:{},taskStatus:{}},emits:["close"],setup(g,{emit:M}){const x=g,C=M,h=p([]),u=p(!1),k=p(!0),y=p();let d=null;const A=V(()=>h.value.filter(i=>i.summary.trim()!=="")),f=p("");async function S(){try{const i=await B(`/tasks/${x.taskId}/events`);h.value=i}finally{k.value=!1}}function $(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}function L(){x.taskStatus!=="pending"&&x.taskStatus!=="in_progress"||(d=U(),d.addEventListener("agent_event",i=>{const e=JSON.parse(i.data);e.taskId===x.taskId&&(e.type==="message_delta"?(f.value=e.summary??"",D($)):(S().then(()=>D($)),f.value=""))}))}function n(i){switch(i){case"status":return"Status";case"message":return"Agent message";case"message_delta":return"Streaming…";default:return i}}function o(i){return new Date(i).toLocaleTimeString()}return J(()=>x.taskStatus,i=>{(i==="done"||i==="failed")&&(f.value="",S(),d&&(d.close(),d=null))}),j(()=>{S().then(()=>D($)),L()}),O(()=>{d&&(d.close(),d=null)}),(i,e)=>(s(),r("div",le,[t("div",ne,[t("div",ie,[m(c(z),{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:b(["text-xs px-2 py-0.5 rounded-full flex-shrink-0",{"bg-yellow-500/10 text-yellow-500":g.taskStatus==="pending","bg-blue-500/10 text-blue-500":g.taskStatus==="in_progress","bg-green-500/10 text-green-500":g.taskStatus==="done","bg-red-500/10 text-red-500":g.taskStatus==="failed"}])},l(g.taskStatus),3)]),t("div",de,[t("button",{onClick:e[0]||(e[0]=a=>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(),N(c(oe),{key:1,class:"w-4 h-4 text-primary"})):(s(),N(c(re),{key:0,class:"w-4 h-4"})),t("span",null,l(u.value?"Raw JSON":"Readable"),1)],8,ue),t("button",{onClick:e[1]||(e[1]=a=>C("close")),class:"p-1 rounded hover:bg-accent text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close preview",title:"Close preview"},[m(c(K),{class:"w-4 h-4"})])])]),t("div",ce,l(g.taskDescription),1),t("div",{ref_key:"feedContainer",ref:y,class:"flex-1 overflow-y-auto p-4 space-y-3 text-sm"},[k.value?(s(),r("div",me,"Loading events…")):A.value.length===0&&!f.value?(s(),r("div",pe," No events yet. The agent will start shortly. ")):v("",!0),(s(!0),r(T,null,I(A.value,a=>(s(),r("div",{key:a.id,class:b(["border border-border rounded-lg p-3",{"border-l-2 border-l-green-500":a.type==="status"&&a.summary.includes("completed"),"border-l-2 border-l-red-500":a.type==="status"&&a.summary.includes("failed"),"border-l-2 border-l-blue-500":a.type==="message","border-l-2 border-l-primary":a.type==="status"&&!a.summary.includes("completed")&&!a.summary.includes("failed")}])},[t("div",xe,[t("span",fe,l(n(a.type)),1),t("span",ye,l(o(a.created_at)),1)]),u.value?(s(),r("pre",ge,l(JSON.stringify(JSON.parse(a.payload),null,2)),1)):(s(),r("div",ve,[a.type==="message"?(s(),N(q,{key:0,content:a.summary,class:"text-sm"},null,8,["content"])):(s(),r("p",be,l(a.summary),1))]))],2))),128)),f.value.trim()?(s(),r("div",he,[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(),r("pre",_e,l(JSON.stringify({type:"message_delta",accumulated:f.value},null,2)),1)):(s(),N(q,{key:1,content:f.value,class:"text-sm"},null,8,["content"]))])):v("",!0)],512)]))}}),ke={class:"p-6"},Se={key:0,class:"text-muted-foreground"},$e={class:"mb-6"},Te={class:"text-muted-foreground"},Ce={class:"mb-8"},Ae={class:"border border-border rounded-lg overflow-hidden"},Ne={class:"w-full text-sm"},Ie={class:"px-4 py-2 font-medium"},Me={class:"px-4 py-2 text-muted-foreground"},Le={class:"px-4 py-2"},De={class:"px-4 py-2 flex gap-1"},qe={key:0,class:"text-xs bg-primary/10 text-primary px-1.5 py-0.5 rounded"},Ee={key:1,class:"text-xs bg-blue-500/10 text-blue-500 px-1.5 py-0.5 rounded"},Re={key:2,class:"text-xs bg-purple-500/10 text-purple-500 px-1.5 py-0.5 rounded"},je={class:"mb-8"},ze={class:"flex items-center justify-between mb-3"},Be={key:0,class:"text-sm text-muted-foreground border border-border rounded-lg p-4 text-center"},Je={key:1,class:"grid grid-cols-1 md:grid-cols-3 gap-3"},Oe={class:"flex items-center justify-between gap-2"},Ve={class:"flex items-center gap-1.5 min-w-0"},Pe={class:"text-sm font-medium truncate"},Fe={class:"flex items-center gap-1 text-xs text-muted-foreground"},He=["title"],Ge={class:"pt-1 border-t border-border"},Ue=["disabled","onClick"],Xe={key:0,class:"text-sm text-muted-foreground"},Ze={key:1,class:"space-y-2"},Ke={class:"flex items-center justify-between"},Qe={class:"text-sm"},We={class:"flex items-center gap-2"},Ye=["onClick","aria-label","title"],et={key:0,class:"mt-3 h-96"},E=3,dt=R({__name:"SquadDetailView",setup(g){const M=H(),x=p(null),C=p([]),h=p([]),u=p([]),k=p(!0),y=p(null),d=p(null);function A(n){d.value=n}function f(){d.value=null}function S(n){return n==="pending"||n==="in_progress"}j(async()=>{try{const n=await B(`/squads/${M.params.id}`);x.value=n.squad,C.value=n.agents,h.value=n.tasks,u.value=n.instances}finally{k.value=!1}});async function $(n,o){if(confirm(`Destroy instance on branch "${o}"? This will remove the worktree.`)){y.value=n;try{await X(`/instances/${n}`),u.value=u.value.filter(i=>i.id!==n)}finally{y.value=null}}}function L(n){if(!n)return"never";const o=n.replace(" ","T")+(n.includes("T")||n.endsWith("Z")?"":"Z"),i=Date.now()-new Date(o).getTime(),e=Math.floor(i/6e4);if(e<1)return"just now";if(e<60)return`${e}m ago`;const a=Math.floor(e/60);return a<24?`${a}h ago`:`${Math.floor(a/24)}d ago`}return(n,o)=>{const i=G("router-link");return s(),r("div",ke,[m(i,{to:"/squads",class:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground mb-4"},{default:P(()=>[m(c(Y),{class:"w-4 h-4"}),o[0]||(o[0]=_(" Back to Squads ",-1))]),_:1}),k.value?(s(),r("div",Se,"Loading...")):x.value?(s(),r(T,{key:1},[t("div",$e,[t("span",{class:"inline-flex items-center text-sm px-2.5 py-1 rounded-full font-medium mb-2 w-fit",style:F(c(Z)(x.value.color))},l(x.value.name),5),t("p",Te,l(x.value.universe),1)]),t("section",Ce,[o[5]||(o[5]=t("h2",{class:"text-lg font-semibold mb-3"},"Agent Roster",-1)),t("div",Ae,[t("table",Ne,[o[4]||(o[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),r(T,null,I(C.value,e=>(s(),r("tr",{key:e.id,class:"border-t border-border"},[t("td",Ie,l(e.character_name),1),t("td",Me,l(e.role_title),1),t("td",Le,[t("span",{class:b(["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"}])},l(e.status),3)]),t("td",De,[e.is_lead?(s(),r("span",qe,[m(c(ae),{class:"w-3 h-3 inline"}),o[1]||(o[1]=_(" Lead ",-1))])):v("",!0),e.is_qa?(s(),r("span",Ee,[m(c(se),{class:"w-3 h-3 inline"}),o[2]||(o[2]=_(" QA ",-1))])):v("",!0),e.is_test?(s(),r("span",Re,[m(c(te),{class:"w-3 h-3 inline"}),o[3]||(o[3]=_(" Test ",-1))])):v("",!0)])]))),128))])])])]),t("section",je,[t("div",ze,[o[6]||(o[6]=t("h2",{class:"text-lg font-semibold"},"Instances",-1)),t("span",{class:b(["text-xs px-2 py-0.5 rounded-full font-medium",u.value.length>=E?"bg-red-500/10 text-red-500":"bg-secondary text-secondary-foreground"])},l(u.value.length)+" / "+l(E)+" active ",3)]),u.value.length===0?(s(),r("div",Be," No active instances. ")):(s(),r("div",Je,[(s(!0),r(T,null,I(u.value,e=>(s(),r("div",{key:e.id,class:"border border-border rounded-lg p-3 flex flex-col gap-2"},[t("div",Oe,[t("div",Ve,[m(c(Q),{class:"w-3.5 h-3.5 text-muted-foreground shrink-0"}),t("span",Pe,l(e.branch),1)]),t("span",{class:b(["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"}])},l(e.status),3)]),t("div",Fe,[m(c(z),{class:"w-3 h-3 shrink-0"}),t("span",null,l(L(e.last_activity)),1)]),t("div",{class:"font-mono text-xs text-muted-foreground truncate",title:e.worktree_path},l(e.worktree_path),9,He),t("div",Ge,[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:y.value===e.id,onClick:a=>$(e.id,e.branch)},[m(c(W),{class:"w-3 h-3"}),_(" "+l(y.value===e.id?"Destroying…":"Destroy"),1)],8,Ue)])]))),128))]))]),t("section",null,[o[8]||(o[8]=t("h2",{class:"text-lg font-semibold mb-3"},"Recent Tasks",-1)),h.value.length===0?(s(),r("div",Xe,"No tasks yet.")):(s(),r("div",Ze,[(s(!0),r(T,null,I(h.value,e=>(s(),r("div",{key:e.id,class:"border border-border rounded-lg p-3"},[t("div",Ke,[t("span",Qe,l(e.description),1),t("div",We,[S(e.status)||d.value===e.id?(s(),r("button",{key:0,onClick:a=>d.value===e.id?f():A(e.id),class:b(["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"},[m(c(ee),{class:"w-3 h-3"}),o[7]||(o[7]=_(" Preview ",-1))],10,Ye)):v("",!0),t("span",{class:b(["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"}])},l(e.status),3)])]),d.value===e.id?(s(),r("div",et,[m(we,{"task-id":e.id,"task-description":e.description,"task-status":e.status,onClose:f},null,8,["task-id","task-description","task-status"])])):v("",!0)]))),128))]))])],64)):v("",!0)])}}});export{dt as default};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{b as L}from"./api-CaqVk-rG.js";import{h as I,k as B,p as M,r as o,g as n,d as t,j as u,x as l,A as T,i as g,U as _,F as f,t as h,s as v,c as N,m as k,L as P,w as a,e as x,f as p,b,u as V}from"./index-DfdD_qE4.js";import{T as w}from"./triangle-alert-BTBlX3kg.js";import{G as $}from"./git-branch-Bu9s__XL.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 j=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
|
-
* @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 C=I("LoaderCircleIcon",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),F={class:"p-6"},z={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"},U={class:"flex items-start justify-between"},D={class:"text-xs text-muted-foreground mt-0.5"},E={key:1},O={key:2},J={key:3},K={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"},ie={key:1},de={class:"space-y-1"},ce={class:"truncate text-muted-foreground"},fe=B({__name:"SquadHealthView",setup(ue){const m=v([]),y=v(!0);M(async()=>{try{const r=await L("/squads/health");m.value=r.health}finally{y.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 d(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[d(r)]-c[d(s)]}));return(r,s)=>{const c=V("router-link");return o(),n("div",F,[t("div",z,[u(l(T),{class:"w-6 h-6"}),s[0]||(s[0]=t("h1",{class:"text-2xl font-bold"},"Squad Health",-1))]),y.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,h(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":d(e)==="active","border-border":d(e)==="idle"}])},[t("div",U,[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":d(e)==="active","bg-secondary text-secondary-foreground":d(e)==="idle"}])},[e.isStalled?(o(),x(l(w),{key:0,class:"w-3 h-3"})):p("",!0),e.isStalled?(o(),n("span",E,"Stalled")):d(e)==="active"?(o(),n("span",O,"Active")):(o(),n("span",J,"Idle"))],2)]),t("div",K,[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,h(e.activeInstances,i=>(o(),n("div",{key:i.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(i.branch),1)]))),128))])])):p("",!0),e.recentTasks.length>0?(o(),n("div",ie,[s[8]||(s[8]=t("p",{class:"text-xs font-medium text-muted-foreground mb-1"},"Recent activity",-1)),t("div",de,[(o(!0),n(f,null,h(e.recentTasks,i=>(o(),n("div",{key:i.id,class:"flex items-center gap-2 text-xs"},[i.status==="done"?(o(),x(l(j),{key:0,class:"w-3 h-3 text-green-500 shrink-0"})):i.status==="in_progress"?(o(),x(l(C),{key:1,class:"w-3 h-3 text-blue-500 shrink-0 animate-spin"})):i.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(i.description),1)]))),128))])])):p("",!0)],2))),128))]))])}}});export{fe as default};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./api-CaqVk-rG.js";import{g as v}from"./squad-colors-B8B_Y-lz.js";import{h,k,p as b,r as o,g as r,d as t,j as c,x as l,U as w,F as L,t as C,s as d,e as S,L as B,o as f,u as N,w as n,i as g,f as V}from"./index-DfdD_qE4.js";import{G as j}from"./git-branch-Bu9s__XL.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"}]]),A={class:"p-6"},M={key:0,class:"text-muted-foreground"},z={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"},U={class:"text-sm text-muted-foreground mt-0.5"},D={class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},E={class:"mt-3 flex items-center gap-4 text-xs text-muted-foreground"},O={key:0,class:"flex items-center gap-1"},T={class:"flex items-center gap-1"},Q=k({__name:"SquadsView",setup($){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 _(a){return u.value.filter(s=>s.squad_id===a)}return(a,s)=>{const x=N("router-link");return o(),r("div",A,[s[2]||(s[2]=t("h1",{class:"text-2xl font-bold mb-6"},"Squads",-1)),p.value?(o(),r("div",M,"Loading...")):i.value.length===0?(o(),r("div",z,[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",U,n(e.universe),1)]),t("span",D,n(_(e.id).length)+" agents ",1)]),t("div",E,[e.repo_url?(o(),r("span",O,[c(l(j),{class:"w-3 h-3"}),g(" "+n(e.repo_url),1)])):V("",!0),t("span",T,[c(l(q),{class:"w-3 h-3"}),g(" "+n(m.value[e.id]??0)+"/3 instances ",1)])])]),_:2},1032,["to","style"]))),128))]))])}}});export{Q as default};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import{h as q,k as se,K as oe,r as s,g as l,F as b,t as U,c as W,o as ce,m as z,e as B,x as c,j as v,d as t,w as j,s as d,p as ve,B as O,i as V,N,J as L,O as R,f as H}from"./index-DfdD_qE4.js";import{b as T,d as E,a as Z}from"./api-CaqVk-rG.js";import{_ as A}from"./MarkdownContent.vue_vue_type_script_setup_true_lang-CObjuCHH.js";import{S as pe}from"./search-C3fxUixl.js";import{P as G}from"./plus-GvGwcjX5.js";import{P as J,S as X}from"./save-fQ_rr5hX.js";import{T as Y}from"./trash-2-Ba_1SAua.js";import{X as ee}from"./x-CJifAZQa.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 fe=q("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 me=q("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=q("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 xe=q("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"}]]);/**
|
|
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 ge=q("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 he=q("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"}]]),be={class:"select-none"},ye=["onClick"],ke={class:"truncate"},we=se({__name:"WikiTree",props:{pages:{},selectedPage:{},searchQuery:{}},emits:["select"],setup(I,{emit:w}){const x=I,f=w,g=d(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 _=W(()=>{let i=x.pages;if(x.searchQuery){const u=x.searchQuery.toLowerCase();i=x.pages.filter(o=>o.toLowerCase().includes(u))}return y(i)});oe(()=>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 S(i,u){const o=[];for(const n of i)o.push({node:n,depth:u}),n.isFolder&&g.value.has(n.path)&&o.push(...S(n.children,u+1));return o}const C=W(()=>S(_.value,0));return(i,u)=>(s(),l("div",be,[(s(!0),l(b,null,U(C.value,({node:o,depth:n})=>(s(),l("button",{key:o.path,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&&I.selectedPage===o.path}]),style:ce({paddingLeft:n*12+8+"px"})},[o.isFolder?(s(),l(b,{key:0},[g.value.has(o.path)?(s(),B(c(fe),{key:0,class:"w-3 h-3 shrink-0 text-muted-foreground"})):(s(),B(c(me),{key:1,class:"w-3 h-3 shrink-0 text-muted-foreground"})),v(c(ge),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)):(s(),l(b,{key:1},[u[0]||(u[0]=t("span",{class:"w-3 shrink-0"},null,-1)),v(c(xe),{class:"w-3.5 h-3.5 shrink-0 text-muted-foreground"})],64)),t("span",ke,j(o.name),1)],14,ye))),128))]))}}),_e={class:"flex flex-col h-full"},Ce={class:"flex border-b border-border shrink-0"},$e={key:0,class:"flex flex-1 overflow-hidden"},Fe={class:"w-64 border-r border-border flex flex-col shrink-0"},Pe={class:"p-3 border-b border-border space-y-2"},Te={class:"relative"},qe={key:0,class:"space-y-1.5"},Me={class:"flex gap-1"},Se=["disabled"],Ve={class:"flex-1 overflow-y-auto p-2"},Ne={key:0,class:"text-xs text-muted-foreground p-2"},Le={class:"flex-1 flex flex-col overflow-hidden"},je={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},De={class:"text-center"},Ee={class:"flex items-center justify-between px-4 py-2 border-b border-border"},ze={class:"text-sm font-medium font-mono"},Be={class:"flex gap-1"},Ie={class:"flex-1 overflow-y-auto p-4"},He={key:0,class:"mt-8 pt-4 border-t border-border"},Ue={class:"flex items-center gap-1.5 mb-2 text-xs font-medium text-muted-foreground"},Ke={class:"space-y-1"},Qe=["onClick"],We={key:1,class:"flex flex-1 overflow-hidden"},Oe={class:"w-64 border-r border-border flex flex-col shrink-0"},Re={class:"p-3 border-b border-border space-y-2"},Ze={key:0,class:"space-y-1.5"},Ae={class:"flex gap-1"},Ge=["disabled"],Je={class:"flex-1 overflow-y-auto p-2"},Xe={key:0,class:"text-xs text-muted-foreground p-2"},Ye={key:1,class:"text-xs text-muted-foreground p-2"},et=["onClick"],tt={class:"flex-1 flex flex-col overflow-hidden"},st={key:0,class:"flex items-center justify-center h-full text-muted-foreground"},ot={class:"text-center"},lt={class:"flex items-center justify-between px-4 py-2 border-b border-border"},at={class:"text-sm font-medium font-mono"},nt={class:"flex gap-1"},rt={class:"flex-1 overflow-y-auto p-4"},xt=se({__name:"WikiView",setup(I){const w=d("pages"),x=d([]),f=d(null),g=d(""),y=d(!1),_=d(""),M=d(""),S=d(!0),C=d(!1),i=d(""),u=d([]),o=d([]),n=d(null),p=d(""),m=d(!1),h=d(""),P=d(!1),$=d(!1),k=d("");ve(async()=>{try{x.value=await T("/wiki/pages")}finally{S.value=!1}}),oe(w,async r=>{if(r==="templates"&&o.value.length===0){P.value=!0;try{o.value=await T("/wiki/templates/squad")}finally{P.value=!1}}});async function F(r){f.value=r,y.value=!1;const e=await T(`/wiki/page/${r}`);g.value=e.content,u.value=await T(`/wiki/backlinks/${r}`)}function D(){_.value=g.value,y.value=!0}async function le(){f.value&&(await E(`/wiki/page/${f.value}`,{content:_.value}),g.value=_.value,y.value=!1,u.value=await T(`/wiki/backlinks/${f.value}`))}async function ae(){f.value&&confirm(`Delete "${f.value}"?`)&&(await Z(`/wiki/page/${f.value}`),x.value=x.value.filter(r=>r!==f.value),f.value=null,g.value="",u.value=[])}async function K(){const r=i.value.trim();if(!r)return;const e=r.endsWith(".md")?r:`${r}.md`;await E(`/wiki/page/${e}`,{content:""}),x.value.includes(e)||(x.value.push(e),x.value.sort()),C.value=!1,i.value="",f.value=e,g.value="",_.value="",y.value=!0,u.value=[]}async function ne(r){n.value=r,m.value=!1;const e=await T(`/wiki/template/squad/${r}`);p.value=e.content}function re(){h.value=p.value,m.value=!0}async function ie(){n.value&&(await E(`/wiki/template/squad/${n.value}`,{content:h.value}),p.value=h.value,m.value=!1)}async function ue(){n.value&&confirm(`Delete template "${n.value}"?`)&&(await Z(`/wiki/template/squad/${n.value}`),o.value=o.value.filter(r=>r!==n.value),n.value=null,p.value="")}async function Q(){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(),l("div",_e,[t("div",Ce,[t("button",{onClick:e[0]||(e[0]=a=>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(c(O),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[14]||(e[14]=V(" Pages ",-1))],2),t("button",{onClick:e[1]||(e[1]=a=>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(c(te),{class:"inline w-4 h-4 mr-1.5 -mt-0.5"}),e[15]||(e[15]=V(" Squad Templates ",-1))],2)]),w.value==="pages"?(s(),l("div",$e,[t("div",Fe,[t("div",Pe,[t("div",Te,[v(c(pe),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),N(t("input",{"onUpdate:modelValue":e[2]||(e[2]=a=>M.value=a),placeholder:"Search pages...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,M.value]])]),t("button",{onClick:e[3]||(e[3]=a=>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(c(G),{class:"w-3.5 h-3.5"}),e[16]||(e[16]=V(" New Page ",-1))]),C.value?(s(),l("div",qe,[N(t("input",{"onUpdate:modelValue":e[4]||(e[4]=a=>i.value=a),placeholder:"path/to/page.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(K,["enter"])},null,544),[[L,i.value]]),t("div",Me,[t("button",{onClick:K,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,Se),t("button",{onClick:e[5]||(e[5]=a=>{C.value=!1,i.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):H("",!0)]),t("div",Ve,[S.value?(s(),l("div",Ne,"Loading...")):(s(),B(we,{key:1,pages:x.value,"selected-page":f.value,"search-query":M.value,onSelect:e[6]||(e[6]=a=>F(a))},null,8,["pages","selected-page","search-query"]))])]),t("div",Le,[f.value?(s(),l(b,{key:1},[t("div",Ee,[t("span",ze,j(f.value),1),t("div",Be,[y.value?(s(),l(b,{key:1},[t("button",{onClick:le,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(c(X),{class:"w-4 h-4"})]),t("button",{onClick:e[7]||(e[7]=a=>y.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(c(ee),{class:"w-4 h-4"})])],64)):(s(),l(b,{key:0},[t("button",{onClick:D,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(c(J),{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(c(Y),{class:"w-4 h-4"})])],64))])]),t("div",Ie,[y.value?N((s(),l("textarea",{key:0,"onUpdate:modelValue":e[8]||(e[8]=a=>_.value=a),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,_.value]]):(s(),l(b,{key:1},[v(A,{content:g.value},null,8,["content"]),u.value.length>0?(s(),l("div",He,[t("div",Ue,[v(c(he),{class:"w-3.5 h-3.5"}),e[18]||(e[18]=V(" Backlinks ",-1))]),t("ul",Ke,[(s(!0),l(b,null,U(u.value,a=>(s(),l("li",{key:a},[t("button",{onClick:de=>F(a),class:"text-xs text-primary hover:underline font-mono"},j(a),9,Qe)]))),128))])])):H("",!0)],64))])],64)):(s(),l("div",je,[t("div",De,[v(c(O),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[17]||(e[17]=t("p",null,"Select a page to view",-1))])]))])])):(s(),l("div",We,[t("div",Oe,[t("div",Re,[e[20]||(e[20]=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[9]||(e[9]=a=>$.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(c(G),{class:"w-3.5 h-3.5"}),e[19]||(e[19]=V(" New Template ",-1))]),$.value?(s(),l("div",Ze,[N(t("input",{"onUpdate:modelValue":e[10]||(e[10]=a=>k.value=a),placeholder:"filename.md",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring",onKeyup:R(Q,["enter"])},null,544),[[L,k.value]]),t("div",Ae,[t("button",{onClick:Q,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,Ge),t("button",{onClick:e[11]||(e[11]=a=>{$.value=!1,k.value=""}),class:"px-2 py-1 text-xs rounded border border-border hover:bg-accent"}," Cancel ")])])):H("",!0)]),t("div",Je,[P.value?(s(),l("div",Xe,"Loading...")):o.value.length===0?(s(),l("div",Ye,"No templates yet.")):(s(!0),l(b,{key:2},U(o.value,a=>(s(),l("button",{key:a,onClick:de=>ne(a),class:z(["w-full text-left px-2 py-1.5 text-xs rounded hover:bg-accent font-mono truncate",n.value===a?"bg-accent text-accent-foreground":"text-foreground"])},j(a),11,et))),128))])]),t("div",tt,[n.value?(s(),l(b,{key:1},[t("div",lt,[t("span",at,j(n.value),1),t("div",nt,[m.value?(s(),l(b,{key:1},[t("button",{onClick:ie,class:"p-1.5 rounded hover:bg-accent text-green-500",title:"Save"},[v(c(X),{class:"w-4 h-4"})]),t("button",{onClick:e[12]||(e[12]=a=>m.value=!1),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Cancel"},[v(c(ee),{class:"w-4 h-4"})])],64)):(s(),l(b,{key:0},[t("button",{onClick:re,class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Edit"},[v(c(J),{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(c(Y),{class:"w-4 h-4"})])],64))])]),t("div",rt,[m.value?N((s(),l("textarea",{key:0,"onUpdate:modelValue":e[13]||(e[13]=a=>h.value=a),class:"w-full h-full min-h-[400px] font-mono text-sm bg-background border border-input rounded-md p-3 focus:outline-none focus:ring-1 focus:ring-ring resize-none"},null,512)),[[L,h.value]]):(s(),B(A,{key:1,content:p.value},null,8,["content"]))])],64)):(s(),l("div",st,[t("div",ot,[v(c(te),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[21]||(e[21]=t("p",null,"Select a template to edit",-1)),e[22]||(e[22]=t("p",{class:"text-xs mt-1"},"Templates are copied into new squads on creation",-1))])]))])]))]))}});export{xt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{y as i,v as c}from"./index-DfdD_qE4.js";const o="/api";function u(t){try{return JSON.parse(atob(t.split(".")[1])).exp*1e3<=Date.now()+6e4}catch{return!0}}async function n(){const t=i(),e={"Content-Type":"application/json"};return t.token&&u(t.token)&&await t.refreshToken(),t.token&&(e.Authorization=`Bearer ${t.token}`),e}async function s(t,e){if(t.status===401){const r=i();try{if(await r.refreshToken(),r.token){const a=await e();if(a.status===401)throw r.logout(),c.push("/login"),new Error("Session expired");return a}}catch{}throw r.logout(),c.push("/login"),new Error("Session expired")}return t}async function w(t){const e=await s(await fetch(`${o}${t}`,{headers:await n()}),async()=>fetch(`${o}${t}`,{headers:await n()}));if(!e.ok)throw new Error(`API error: ${e.status}`);return e.json()}async function f(t,e){const r={method:"POST",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function $(t,e){const r={method:"PUT",headers:await n(),body:e?JSON.stringify(e):void 0},a=await s(await fetch(`${o}${t}`,r),async()=>fetch(`${o}${t}`,{...r,headers:await n()}));if(!a.ok)throw new Error(`API error: ${a.status}`);return a.json()}async function d(t){const e={method:"DELETE",headers:await n()},r=await s(await fetch(`${o}${t}`,e),async()=>fetch(`${o}${t}`,{...e,headers:await n()}));if(!r.ok)throw new Error(`API error: ${r.status}`);return r.json()}function p(){const t=i(),e=`${o}/stream?token=${t.token??""}`;return new EventSource(e)}export{d as a,w as b,f as c,$ as d,p as e};
|