@openork/cli 0.1.0 → 0.2.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/README.md +33 -0
- package/dist/commands/doctor.d.ts +12 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +110 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/gateway/start.d.ts +7 -0
- package/dist/commands/gateway/start.d.ts.map +1 -1
- package/dist/commands/gateway/start.js +64 -6
- package/dist/commands/gateway/start.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +19 -0
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/uninstall.d.ts.map +1 -1
- package/dist/commands/uninstall.js +51 -31
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/lib/doctor.d.ts +28 -0
- package/dist/lib/doctor.d.ts.map +1 -0
- package/dist/lib/doctor.js +227 -0
- package/dist/lib/doctor.js.map +1 -0
- package/dist/openapi.yml +770 -0
- package/dist/prisma/migrations/20260401085053_schema_sync/migration.sql +178 -0
- package/dist/prisma/migrations/20260401135027_add_auth_rbac_multitenancy/migration.sql +211 -0
- package/dist/prisma/schema.prisma +101 -0
- package/dist/server.js +74899 -175525
- package/dist/server.js.map +1 -1
- package/dist/web/assets/{activity-feed-D_eonDKG.js → activity-feed-CNgi7Qb_.js} +1 -1
- package/dist/web/assets/agent-edit-CgbnHiT5.js +98 -0
- package/dist/web/assets/agent-sessions-Bpay1_ZH.js +1 -0
- package/dist/web/assets/agent-use-BaBxQ2fx.js +1 -0
- package/dist/web/assets/agents-Dwbd6TQx.js +1 -0
- package/dist/web/assets/api-DNWoqIPN.js +1 -0
- package/dist/web/assets/arrow-down-upU5tcpi.js +1 -0
- package/dist/web/assets/arrow-left-BiNeYcK0.js +1 -0
- package/dist/web/assets/auth-client-ys1jC854.js +1 -0
- package/dist/web/assets/chat-BP5H9CWl.js +4 -0
- package/dist/web/assets/{chat-input-BepRPV_L.js → chat-input-CKAtAtgG.js} +2 -2
- package/dist/web/assets/{chat-message-CbcDeDcb.js → chat-message-CW-HnO3f.js} +3 -3
- package/dist/web/assets/chat-new-BQp9Bn7Q.js +1 -0
- package/dist/web/assets/chat-sessions-D3bS5vba.js +1 -0
- package/dist/web/assets/chats-DJolHH4e.js +1 -0
- package/dist/web/assets/{circle-alert-W8QX9LOG.js → circle-alert-D040vPU_.js} +1 -1
- package/dist/web/assets/circle-check-CW3adL8A.js +1 -0
- package/dist/web/assets/{circle-x-D_8Tcgt1.js → circle-x-34c-1fVL.js} +1 -1
- package/dist/web/assets/code-BFUT4gGT.js +1 -0
- package/dist/web/assets/{code-editor-x9L6nkh4.js → code-editor-I6vK5q_W.js} +1 -1
- package/dist/web/assets/commands-DBI4Bb2N.js +8 -0
- package/dist/web/assets/{copy-C87mjn_Y.js → copy-DI5qjA1p.js} +1 -1
- package/dist/web/assets/credentials-D8VN8A5M.js +1 -0
- package/dist/web/assets/{crown-BJEsQkh4.js → crown-DWB5bSnq.js} +1 -1
- package/dist/web/assets/dashboard-Cc6KWs62.js +1 -0
- package/dist/web/assets/{database-BohjTljV.js → database-5jczNGML.js} +1 -1
- package/dist/web/assets/debug-DewdHeoW.js +1 -0
- package/dist/web/assets/{download-B2UOiYAS.js → download-CwO6xusv.js} +1 -1
- package/dist/web/assets/{eye-DN-Km5vf.js → eye-BQGasWwb.js} +1 -1
- package/dist/web/assets/{file-plus-B8qWemgt.js → file-plus-kHgvf9P8.js} +1 -1
- package/dist/web/assets/file-tree-CTe61XCg.js +1 -0
- package/dist/web/assets/{folder-plus-DsmP6Mur.js → folder-plus-mZAz-QpJ.js} +1 -1
- package/dist/web/assets/{globe-fwFSeXZn.js → globe-C0WHVFW_.js} +1 -1
- package/dist/web/assets/{grip-vertical-Djo-yR-o.js → grip-vertical-CdhrWSnV.js} +1 -1
- package/dist/web/assets/{history-CyBBboEp.js → history-w7qYglj5.js} +1 -1
- package/dist/web/assets/index-9X_UIor3.css +2 -0
- package/dist/web/assets/index-DWNLSHpo.js +4 -0
- package/dist/web/assets/key-DJEQ_jUi.js +1 -0
- package/dist/web/assets/{layers-ephyCrDm.js → layers-KZu6CpGE.js} +1 -1
- package/dist/web/assets/{layout-grid-DCVGg8ZA.js → layout-grid-U17jhSjz.js} +1 -1
- package/dist/web/assets/login-DoSA7KtI.js +1 -0
- package/dist/web/assets/mcp-setup-Cyj1YAiY.js +17 -0
- package/dist/web/assets/memory-DWZU2Tfl.js +1 -0
- package/dist/web/assets/new-chat-BRS3DM8Z.js +1 -0
- package/dist/web/assets/play-BzkxV_O-.js +1 -0
- package/dist/web/assets/{refresh-cw-RFYUf5GB.js → refresh-cw-D3_GZ86i.js} +1 -1
- package/dist/web/assets/register-BS5OkCgS.js +1 -0
- package/dist/web/assets/rotate-ccw-CkJIdGxi.js +1 -0
- package/dist/web/assets/{save-Dewm93H6.js → save-BXEZF80P.js} +1 -1
- package/dist/web/assets/search-BmZSwFnA.js +1 -0
- package/dist/web/assets/{send-FWvygYFQ.js → send-CNiXC6KO.js} +1 -1
- package/dist/web/assets/server-C5bKQLDi.js +1 -0
- package/dist/web/assets/settings-CBAhSOZM.js +1 -0
- package/dist/web/assets/shield-CMMTdOiM.js +1 -0
- package/dist/web/assets/{shield-check-Dt7sXtBF.js → shield-check-BmphmMlD.js} +1 -1
- package/dist/web/assets/{shuffle-DjvBJ7XV.js → shuffle-Dv_-PFl5.js} +1 -1
- package/dist/web/assets/src-CaF63bXY.js +24 -0
- package/dist/web/assets/sse-url-qohTy4Sw.js +1 -0
- package/dist/web/assets/team-edit-BW1bePKn.js +1 -0
- package/dist/web/assets/team-sessions-GspGc7zN.js +1 -0
- package/dist/web/assets/team-use-BVC7nt9K.js +3 -0
- package/dist/web/assets/terminal-CjSFIwMK.js +1 -0
- package/dist/web/assets/{timer-C9X20mTO.js → timer-3siC9tpd.js} +1 -1
- package/dist/web/assets/{useMutation-BlOHt3MR.js → useMutation-DA8-TvTt.js} +1 -1
- package/dist/web/assets/{utils-DHTPP40O.js → utils-D1nRmcA6.js} +1 -1
- package/dist/web/assets/workflow-edit-DkmsARCv.js +4 -0
- package/dist/web/assets/workflow-runs-DcJPL7Bo.js +1 -0
- package/dist/web/assets/workflows-Dnx0dwJn.js +1 -0
- package/dist/web/assets/{wrench-DZBtSPP8.js → wrench-u8B_fDwT.js} +1 -1
- package/dist/web/assets/{zap-CbT5plGA.js → zap-hOn7wkXe.js} +1 -1
- package/dist/web/index.html +9 -7
- package/package.json +1 -1
- package/dist/web/assets/agent-edit-CblZItU5.js +0 -98
- package/dist/web/assets/agent-sessions-COpCcffa.js +0 -1
- package/dist/web/assets/agent-use-F4pOt3KJ.js +0 -1
- package/dist/web/assets/agents-Av7w2wHE.js +0 -1
- package/dist/web/assets/arrow-down-XHN5PD1k.js +0 -1
- package/dist/web/assets/arrow-left-wtNmm6Le.js +0 -1
- package/dist/web/assets/chat-CQvfLy7Y.js +0 -4
- package/dist/web/assets/chat-new-BOtDuYij.js +0 -1
- package/dist/web/assets/chat-sessions-CaCaK_PC.js +0 -1
- package/dist/web/assets/chats-64IReeGV.js +0 -1
- package/dist/web/assets/circle-check-DLl9fl65.js +0 -1
- package/dist/web/assets/code-Brz4KHlI.js +0 -1
- package/dist/web/assets/commands-DT9K8bae.js +0 -8
- package/dist/web/assets/credentials-DC-HOVxW.js +0 -1
- package/dist/web/assets/dashboard-OfnNUjFX.js +0 -1
- package/dist/web/assets/debug-Et9rgBM8.js +0 -1
- package/dist/web/assets/file-tree-DkLQ1z0I.js +0 -1
- package/dist/web/assets/index-YgjFlLLv.css +0 -2
- package/dist/web/assets/index-dc8HGqTp.js +0 -2
- package/dist/web/assets/mcp-setup-BfMdYdsI.js +0 -17
- package/dist/web/assets/memory-DAQ474-p.js +0 -1
- package/dist/web/assets/new-chat-DtMw6FMg.js +0 -1
- package/dist/web/assets/play-DXJMtO-K.js +0 -1
- package/dist/web/assets/search-Ww0msJQz.js +0 -1
- package/dist/web/assets/settings-Auyn4Z5T.js +0 -1
- package/dist/web/assets/src-DUhGoAQb.js +0 -24
- package/dist/web/assets/team-edit-DO-RX3lC.js +0 -1
- package/dist/web/assets/team-sessions-DSw8MTtZ.js +0 -1
- package/dist/web/assets/team-use-BfNvsFcO.js +0 -3
- package/dist/web/assets/terminal-CIapYonS.js +0 -1
- package/dist/web/assets/workflow-edit-D0FNyl64.js +0 -4
- package/dist/web/assets/workflow-runs-CPVvaVzN.js +0 -1
- package/dist/web/assets/workflows-C9jurJiE.js +0 -1
- /package/dist/web/assets/{api-docs-BQzn4-6U.js → api-docs-DgRFxVfh.js} +0 -0
- /package/dist/web/assets/{bi-gM8sIAZV.js → bi-Da3wz7XD.js} +0 -0
- /package/dist/web/assets/{cron-COUPKvGu.js → cron-3VyztcE9.js} +0 -0
- /package/dist/web/assets/{vendor-editor-BORFA-rZ.js → vendor-editor-Cx3Ogh9u.js} +0 -0
- /package/dist/web/assets/{vendor-ui-Dpw9mBc-.js → vendor-ui-DnL9d3od.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`key`,[[`path`,{d:`m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4`,key:`g0fldk`}],[`path`,{d:`m21 2-9.6 9.6`,key:`1j0ho8`}],[`circle`,{cx:`7.5`,cy:`15.5`,r:`5.5`,key:`yqb3hr`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`layers`,[[`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`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`layout-grid`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{h as t,l as n,r,t as i}from"./vendor-react-BJ8SIkmN.js";import{B as a,F as o,I as s,L as c,V as l,w as u,z as d}from"./src-CaF63bXY.js";import{t as f}from"./key-DJEQ_jUi.js";import{n as p,t as m}from"./index-DWNLSHpo.js";var h=o(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),g=e(t(),1),_=i();function v(){let e=n(),[t,i]=(0,g.useState)(``),[o,v]=(0,g.useState)(``),[y,b]=(0,g.useState)(``),[x,S]=(0,g.useState)(!1),[C,w]=(0,g.useState)(`credentials`);async function T(n){n.preventDefault(),S(!0);try{let n=await p.signIn.email({email:t,password:o});if(n.error){m.error(n.error.message??`Login failed`);return}e(`/dashboard`)}catch{m.error(`Login failed`)}finally{S(!1)}}function E(t){if(t.preventDefault(),!y.trim()){m.error(`Please enter a token`);return}sessionStorage.setItem(`gatewayToken`,y.trim()),e(`/dashboard`)}return(0,_.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,_.jsxs)(s,{className:`w-full max-w-md`,children:[(0,_.jsx)(d,{className:`text-center`,children:(0,_.jsx)(a,{className:`text-2xl`,children:`Sign in to OpenOrk`})}),(0,_.jsxs)(c,{children:[(0,_.jsxs)(`div`,{className:`flex gap-2 mb-6`,children:[(0,_.jsxs)(l,{variant:C===`credentials`?`default`:`outline`,className:`flex-1 gap-2`,onClick:()=>w(`credentials`),children:[(0,_.jsx)(h,{className:`h-4 w-4`}),` Email`]}),(0,_.jsxs)(l,{variant:C===`token`?`default`:`outline`,className:`flex-1 gap-2`,onClick:()=>w(`token`),children:[(0,_.jsx)(f,{className:`h-4 w-4`}),` Access Token`]})]}),C===`credentials`?(0,_.jsxs)(`form`,{onSubmit:T,className:`space-y-4`,children:[(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`label`,{htmlFor:`email`,className:`text-sm font-medium`,children:`Email`}),(0,_.jsx)(u,{id:`email`,type:`email`,placeholder:`you@example.com`,value:t,onChange:e=>i(e.target.value),required:!0})]}),(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`label`,{htmlFor:`password`,className:`text-sm font-medium`,children:`Password`}),(0,_.jsx)(u,{id:`password`,type:`password`,placeholder:`••••••••`,value:o,onChange:e=>v(e.target.value),required:!0})]}),(0,_.jsx)(l,{type:`submit`,className:`w-full`,disabled:x,children:x?`Signing in...`:`Sign in`})]}):(0,_.jsxs)(`form`,{onSubmit:E,className:`space-y-4`,children:[(0,_.jsxs)(`div`,{className:`space-y-2`,children:[(0,_.jsx)(`label`,{htmlFor:`token`,className:`text-sm font-medium`,children:`Gateway Token`}),(0,_.jsx)(u,{id:`token`,type:`password`,placeholder:`Paste your gateway token`,value:y,onChange:e=>b(e.target.value),required:!0}),(0,_.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Find your token in the terminal output of `,(0,_.jsx)(`code`,{children:`openork gateway start`})]})]}),(0,_.jsx)(l,{type:`submit`,className:`w-full`,children:`Connect`})]}),(0,_.jsxs)(`div`,{className:`mt-4 text-center text-sm text-muted-foreground`,children:[`Don't have an account?`,` `,(0,_.jsx)(r,{to:`/register`,className:`text-primary hover:underline`,children:`Register`})]})]})]})})}export{v as Login};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{h as t,t as n}from"./vendor-react-BJ8SIkmN.js";import{r,t as i}from"./useQuery-DvovkaPT.js";import{t as a}from"./useMutation-DA8-TvTt.js";import{n as o,t as s}from"./api-DNWoqIPN.js";import{A as c,B as l,D as u,E as d,I as f,L as p,N as m,O as h,P as g,T as _,U as v,V as y,a as b,c as x,d as S,i as C,k as w,l as T,n as E,o as D,r as O,s as k,t as A,u as j,w as M,z as N}from"./src-CaF63bXY.js";import{t as P}from"./copy-DI5qjA1p.js";import{t as F}from"./globe-C0WHVFW_.js";import{t as I}from"./search-BmZSwFnA.js";import{t as L}from"./server-C5bKQLDi.js";import{t as R}from"./terminal-CjSFIwMK.js";import{A as z,F as B,G as V,H,N as U,P as W,T as G,U as K}from"./index-DWNLSHpo.js";var q=e(t(),1),J=n();function Y({value:e,onChange:t,keyPlaceholder:n=`Key`,valuePlaceholder:r=`Value`}){let i=Object.entries(e),a=(n,r)=>{let i={};for(let[t,a]of Object.entries(e))i[t===n?r:t]=a;t(i)},o=(n,r)=>{t({...e,[n]:r})},s=n=>{let r={...e};delete r[n],t(r)};return(0,J.jsxs)(`div`,{className:`space-y-1.5`,children:[i.map(([e,t])=>(0,J.jsxs)(`div`,{className:`flex gap-1.5 items-center`,children:[(0,J.jsx)(M,{className:`flex-1 h-8 text-xs font-mono`,placeholder:n,value:e,onChange:t=>a(e,t.target.value)}),(0,J.jsx)(M,{className:`flex-1 h-8 text-xs font-mono`,placeholder:r,value:t,onChange:t=>o(e,t.target.value)}),(0,J.jsx)(y,{type:`button`,variant:`ghost`,size:`icon-xs`,onClick:()=>s(e),children:(0,J.jsx)(z,{className:`h-3.5 w-3.5 text-muted-foreground`})})]},e)),(0,J.jsxs)(y,{type:`button`,variant:`outline`,size:`sm`,className:`text-xs h-7`,onClick:()=>{let n=0,r=``;for(;r===``||r in e;)r=`KEY_${n++}`;t({...e,[r]:``})},children:[(0,J.jsx)(U,{className:`h-3 w-3 mr-1`}),`Add`]})]})}function ee(){let{t:e}=G(),{data:t,isLoading:n}=i({queryKey:[`mcp-clis`],queryFn:()=>s.mcpConfigs.detectClis()}),r=t?.clis.filter(e=>e.detected)??[];return n?(0,J.jsx)(`div`,{className:`space-y-2 pt-4`,children:Array.from({length:3}).map((e,t)=>(0,J.jsx)(`div`,{className:`h-10 bg-muted animate-pulse rounded-md`},t))}):r.length===0?(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground py-8 text-center`,children:e(`mcp.noConfigFiles`)}):(0,J.jsxs)(E,{defaultValue:r[0].id,className:`pt-2`,children:[(0,J.jsx)(C,{variant:`line`,children:r.map(e=>(0,J.jsx)(b,{value:e.id,children:e.label},e.id))}),r.map(e=>(0,J.jsx)(O,{value:e.id,children:(0,J.jsx)(te,{cli:e})},e.id))]})}function te({cli:e}){let{t}=G(),n=r(),{data:o,isLoading:c}=i({queryKey:[`mcp-servers`,e.id],queryFn:()=>s.mcpConfigs.getServers(e.id)}),l=a({mutationFn:({name:t,projectPath:n})=>s.mcpConfigs.deleteServer(e.id,t,n),onSuccess:()=>n.invalidateQueries({queryKey:[`mcp-servers`,e.id]})}),[u,d]=(0,q.useState)(!1),[f,p]=(0,q.useState)(null),m=e=>{p(e?{name:``,entry:{command:``,args:[]},projectPath:e}:null),d(!0)},h=(e,t,n)=>{p({name:e,entry:t,projectPath:n}),d(!0)},g=(e,n)=>{confirm(t(`mcp.deleteConfirm`,{name:e}))&&l.mutate({name:e,projectPath:n})};if(c)return(0,J.jsx)(`div`,{className:`space-y-2 pt-4`,children:Array.from({length:3}).map((e,t)=>(0,J.jsx)(`div`,{className:`h-10 bg-muted animate-pulse rounded-md`},t))});if(e.id===`claude-code`){let n=o?.projects??{};return(0,J.jsxs)(`div`,{className:`pt-4 space-y-4`,children:[(0,J.jsx)(`div`,{className:`flex items-center justify-between`,children:(0,J.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[t(`mcp.serversPerProject`),` `,(0,J.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`~/.claude.json`})]})}),Object.keys(n).length===0&&(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:t(`mcp.noServersProject`)}),Object.entries(n).map(([e,t])=>(0,J.jsx)(ne,{projectPath:e,servers:t,onEdit:(t,n)=>h(t,n,e),onDelete:t=>g(t,e),onAdd:()=>m(e)},e)),(0,J.jsx)(Z,{open:u,onOpenChange:d,cliId:e.id,initialName:f?.name??``,initialEntry:f?.entry,projectPath:f?.projectPath,isClaudeCode:!0})]})}let _=o?.servers??{};return(0,J.jsxs)(`div`,{className:`pt-4 space-y-3`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:t(`mcp.serverCount`,{count:Object.keys(_).length})}),(0,J.jsxs)(y,{size:`sm`,className:`text-xs h-7`,onClick:()=>m(),children:[(0,J.jsx)(U,{className:`h-3 w-3 mr-1`}),t(`mcp.addMcpServer`)]})]}),(0,J.jsx)(X,{servers:_,onEdit:(e,t)=>h(e,t),onDelete:e=>g(e)}),(0,J.jsx)(Z,{open:u,onOpenChange:d,cliId:e.id,initialName:f?.name??``,initialEntry:f?.entry})]})}function ne({projectPath:e,servers:t,onEdit:n,onDelete:r,onAdd:i}){let{t:a}=G(),[o,s]=(0,q.useState)(!0),c=e.split(`/`).filter(Boolean).slice(-2).join(`/`);return(0,J.jsxs)(`div`,{className:`border rounded-md`,children:[(0,J.jsxs)(`button`,{onClick:()=>s(!o),className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/50 transition-colors`,children:[o?(0,J.jsx)(m,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,J.jsx)(V,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(H,{className:`h-3.5 w-3.5 text-muted-foreground`}),(0,J.jsx)(`span`,{className:`text-sm font-medium truncate`,children:c}),(0,J.jsx)(`span`,{className:`text-xs text-muted-foreground truncate hidden sm:inline`,children:e}),(0,J.jsx)(v,{variant:`secondary`,className:`ml-auto text-[10px]`,children:Object.keys(t).length})]}),o&&(0,J.jsxs)(`div`,{className:`px-3 pb-3 pt-1 border-t space-y-2`,children:[(0,J.jsx)(`div`,{className:`flex justify-end`,children:(0,J.jsxs)(y,{size:`sm`,variant:`outline`,className:`text-xs h-7`,onClick:i,children:[(0,J.jsx)(U,{className:`h-3 w-3 mr-1`}),a(`mcp.add`)]})}),(0,J.jsx)(X,{servers:t,onEdit:n,onDelete:r})]})]})}function X({servers:e,onEdit:t,onDelete:n}){let{t:r}=G();return Object.keys(e).length===0?(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-4`,children:r(`mcp.noServers`)}):(0,J.jsxs)(D,{children:[(0,J.jsx)(j,{children:(0,J.jsxs)(S,{children:[(0,J.jsx)(T,{className:`text-xs`,children:r(`mcp.tableHeaderName`)}),(0,J.jsx)(T,{className:`text-xs`,children:r(`mcp.tableHeaderType`)}),(0,J.jsx)(T,{className:`text-xs`,children:r(`mcp.tableHeaderCommand`)}),(0,J.jsx)(T,{className:`text-xs w-[80px]`,children:r(`mcp.tableHeaderActions`)})]})}),(0,J.jsx)(k,{children:Object.entries(e).map(([e,r])=>{let i=o(r);return(0,J.jsxs)(S,{children:[(0,J.jsx)(x,{className:`font-mono text-xs`,children:e}),(0,J.jsx)(x,{children:(0,J.jsxs)(v,{variant:`outline`,className:`text-[10px] gap-1`,children:[i?(0,J.jsx)(F,{className:`h-3 w-3`}):(0,J.jsx)(R,{className:`h-3 w-3`}),i?`http`:`stdio`]})}),(0,J.jsx)(x,{className:`font-mono text-xs text-muted-foreground truncate max-w-[300px]`,children:i?r.url:`${r.command} ${(r.args??[]).join(` `)}`}),(0,J.jsx)(x,{children:(0,J.jsxs)(`div`,{className:`flex gap-1`,children:[(0,J.jsx)(y,{variant:`ghost`,size:`icon-xs`,onClick:()=>t(e,r),children:(0,J.jsx)(B,{className:`h-3.5 w-3.5`})}),(0,J.jsx)(y,{variant:`ghost`,size:`icon-xs`,onClick:()=>n(e),children:(0,J.jsx)(z,{className:`h-3.5 w-3.5 text-destructive`})})]})})]},e)})})]})}function Z({open:e,onOpenChange:t,cliId:n,initialName:i,initialEntry:l,projectPath:f,isClaudeCode:p}){let{t:m}=G(),g=!!i,v=r(),[b,x]=(0,q.useState)(i),[S,C]=(0,q.useState)(l&&o(l)?`http`:`stdio`),[T,E]=(0,q.useState)(l?.command??``),[D,O]=(0,q.useState)((l?.args??[]).join(`
|
|
2
|
+
`)),[k,j]=(0,q.useState)(l?.env??{}),[N,P]=(0,q.useState)(l?.url??``),[I,L]=(0,q.useState)(l?.headers??{}),[z,B]=(0,q.useState)(f??``),V=()=>{x(i),C(l&&o(l)?`http`:`stdio`),E(l?.command??``),O((l?.args??[]).join(`
|
|
3
|
+
`)),j(l?.env??{}),P(l?.url??``),L(l?.headers??{}),B(f??``)},H=e=>{e&&V(),t(e)},U=a({mutationFn:()=>{let e=S===`http`?{url:N,...Object.keys(I).length>0?{headers:I}:{}}:{command:T,args:D.split(`
|
|
4
|
+
`).map(e=>e.trim()).filter(Boolean),...Object.keys(k).length>0?{env:k}:{}};return p&&(e.projectPath=z,S===`stdio`&&(e.type=`stdio`)),s.mcpConfigs.putServer(n,b,e)},onSuccess:()=>{v.invalidateQueries({queryKey:[`mcp-servers`,n]}),t(!1)}}),W=b.trim()!==``&&(S===`http`?N.trim()!==``:T.trim()!==``)&&(!p||z.trim()!==``),K;return K=U.isPending?m(`common.saving`):m(g?`common.update`:`mcp.add`),(0,J.jsx)(_,{open:e,onOpenChange:H,children:(0,J.jsxs)(u,{className:`max-w-lg`,children:[(0,J.jsx)(w,{children:(0,J.jsx)(c,{children:m(g?`mcp.editMcpServer`:`mcp.addMcpServer`)})}),(0,J.jsxs)(`div`,{className:`space-y-4 py-2`,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`mcp.serverName`)}),(0,J.jsx)(M,{placeholder:`my-mcp-server`,value:b,onChange:e=>x(e.target.value),disabled:g,className:`font-mono text-sm`})]}),p&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`mcp.projectPath`)}),(0,J.jsx)(M,{placeholder:`/Users/me/my-project`,value:z,onChange:e=>B(e.target.value),disabled:g,className:`font-mono text-sm`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`mcp.transport`)}),(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsxs)(y,{type:`button`,variant:S===`stdio`?`default`:`outline`,size:`sm`,className:`text-xs`,onClick:()=>C(`stdio`),children:[(0,J.jsx)(R,{className:`h-3 w-3 mr-1`}),`stdio`]}),(0,J.jsxs)(y,{type:`button`,variant:S===`http`?`default`:`outline`,size:`sm`,className:`text-xs`,onClick:()=>C(`http`),children:[(0,J.jsx)(F,{className:`h-3 w-3 mr-1`}),`http`]})]})]}),S===`stdio`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`mcp.command`)}),(0,J.jsx)(M,{placeholder:`npx`,value:T,onChange:e=>E(e.target.value),className:`font-mono text-sm`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`label`,{className:`text-xs font-medium mb-1 block`,children:[m(`mcp.arguments`),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground font-normal`,children:m(`mcp.onePerLine`)})]}),(0,J.jsx)(A,{placeholder:`-y
|
|
5
|
+
@namespace/server@latest`,value:D,onChange:e=>O(e.target.value),className:`font-mono text-sm min-h-[80px]`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`mcp.envVars`)}),(0,J.jsx)(Y,{value:k,onChange:j,keyPlaceholder:`ENV_VAR`,valuePlaceholder:`value`})]})]}):(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:`URL`}),(0,J.jsx)(M,{placeholder:`https://mcp.example.com/mcp`,value:N,onChange:e=>P(e.target.value),className:`font-mono text-sm`})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`label`,{className:`text-xs font-medium mb-1 block`,children:m(`credentials.headers`)}),(0,J.jsx)(Y,{value:I,onChange:L,keyPlaceholder:`Header-Name`,valuePlaceholder:`value`})]})]})]}),(0,J.jsxs)(h,{children:[(0,J.jsx)(d,{children:(0,J.jsx)(y,{variant:`outline`,size:`sm`,children:m(`common.cancel`)})}),(0,J.jsx)(y,{size:`sm`,disabled:!W||U.isPending,onClick:()=>U.mutate(),children:K})]})]})})}var Q=`${window.location.protocol}//${window.location.hostname}:3001/mcp`;function $({value:e,label:t}){let[n,r]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:`relative group`,children:[t&&(0,J.jsx)(`p`,{className:`text-xs text-muted-foreground mb-1`,children:t}),(0,J.jsx)(`pre`,{className:`bg-muted rounded-md p-3 pr-10 text-sm overflow-x-auto whitespace-pre-wrap break-all`,children:e}),(0,J.jsx)(y,{size:`icon`,variant:`ghost`,className:`absolute top-1 right-1 h-7 w-7 opacity-0 group-hover:opacity-100 transition-opacity`,onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},children:n?(0,J.jsx)(g,{className:`h-3.5 w-3.5 text-green-500`}):(0,J.jsx)(P,{className:`h-3.5 w-3.5`})})]})}var re={GET:`bg-blue-500/10 text-blue-600 dark:text-blue-400`,POST:`bg-green-500/10 text-green-600 dark:text-green-400`,PUT:`bg-amber-500/10 text-amber-600 dark:text-amber-400`,PATCH:`bg-orange-500/10 text-orange-600 dark:text-orange-400`,DELETE:`bg-red-500/10 text-red-600 dark:text-red-400`};function ie({tool:e}){let{t}=G(),[n,r]=(0,q.useState)(!1),i=Object.keys(e.inputSchema.properties??{}),a=new Set(e.inputSchema.required??[]);return(0,J.jsxs)(`div`,{className:`border rounded-md`,children:[(0,J.jsxs)(`button`,{onClick:()=>r(!n),className:`w-full flex items-center gap-2 px-3 py-2 text-left hover:bg-muted/50 transition-colors`,children:[n?(0,J.jsx)(m,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}):(0,J.jsx)(V,{className:`h-3.5 w-3.5 shrink-0 text-muted-foreground`}),(0,J.jsx)(`span`,{className:`text-[10px] font-mono font-bold px-1.5 py-0.5 rounded ${re[e.method]??`bg-muted`}`,children:e.method}),(0,J.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono truncate`,children:e.path}),(0,J.jsx)(`span`,{className:`ml-auto text-xs text-muted-foreground shrink-0`,children:e.name})]}),n&&(0,J.jsxs)(`div`,{className:`px-3 pb-3 pt-1 border-t space-y-2`,children:[(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e.description}),i.length>0&&(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`p`,{className:`text-xs font-medium mb-1`,children:t(`mcp.parameters`)}),(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:i.map(e=>(0,J.jsxs)(v,{variant:a.has(e)?`default`:`outline`,className:`text-[10px] font-mono`,children:[e,a.has(e)&&` *`]},e))})]})]})]})}var ae=e=>JSON.stringify({mcpServers:{"agents-orchestrator":{url:e}}},null,2),oe=e=>JSON.stringify({mcpServers:{"agents-orchestrator":{command:`npx`,args:[`mcp-remote`,e]}}},null,2);function se(){let{t:e}=G();return(0,J.jsxs)(`div`,{className:`p-6 max-w-4xl`,children:[(0,J.jsxs)(`div`,{className:`mb-6`,children:[(0,J.jsx)(`h1`,{className:`text-2xl font-bold mb-1`,children:`MCP`}),(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`mcp.description`)})]}),(0,J.jsxs)(E,{defaultValue:`manage`,children:[(0,J.jsxs)(C,{children:[(0,J.jsx)(b,{value:`manage`,children:e(`mcp.manageMcps`)}),(0,J.jsx)(b,{value:`setup`,children:e(`mcp.mcpSetup`)})]}),(0,J.jsx)(O,{value:`manage`,children:(0,J.jsx)(ee,{})}),(0,J.jsx)(O,{value:`setup`,children:(0,J.jsx)(ce,{})})]})]})}function ce(){let{t:e}=G(),[t,n]=(0,q.useState)(``),{data:r=[],isLoading:a}=i({queryKey:[`mcp-tools`],queryFn:async()=>{let e=await fetch(`/api/mcp/tools`);if(!e.ok)throw Error(`Failed to fetch tools`);return e.json()}}),o=t?r.filter(e=>e.name.toLowerCase().includes(t.toLowerCase())||e.path.toLowerCase().includes(t.toLowerCase())||e.method.toLowerCase().includes(t.toLowerCase())):r,s=o.reduce((e,t)=>{let n=t.path.split(`/`).filter(Boolean)[0]??`other`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,J.jsxs)(`div`,{className:`pt-4`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 mb-4`,children:[(0,J.jsx)(v,{variant:`secondary`,children:e(`mcp.streamableHttp`)}),(0,J.jsx)(v,{variant:`outline`,children:e(`mcp.tools`,{count:r.length})})]}),(0,J.jsxs)(f,{className:`mb-6`,children:[(0,J.jsx)(N,{children:(0,J.jsxs)(l,{className:`flex items-center gap-2 text-base`,children:[(0,J.jsx)(L,{className:`h-4 w-4`}),e(`mcp.endpoint`)]})}),(0,J.jsxs)(p,{children:[(0,J.jsx)($,{value:Q}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground mt-2`,children:[`Supports POST (tool calls), GET (SSE streaming), and DELETE (session teardown). Sessions are managed via the`,` `,(0,J.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`mcp-session-id`}),` `,`header.`]})]})]}),(0,J.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:e(`mcp.quickSetup`)}),(0,J.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2 lg:grid-cols-3 mb-6`,children:[(0,J.jsxs)(f,{children:[(0,J.jsx)(N,{children:(0,J.jsxs)(l,{className:`flex items-center gap-2 text-base`,children:[(0,J.jsx)(W,{className:`h-4 w-4`}),`Cursor`]})}),(0,J.jsxs)(p,{className:`space-y-3`,children:[(0,J.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Add to`,` `,(0,J.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`.cursor/mcp.json`}),` `,`in your project root:`]}),(0,J.jsx)($,{value:ae(Q)}),(0,J.jsx)(`div`,{className:`flex gap-2`,children:(0,J.jsxs)(y,{variant:`outline`,size:`sm`,className:`text-xs`,onClick:()=>window.open(`https://docs.cursor.com/context/model-context-protocol`,`_blank`,`noopener,noreferrer`),children:[(0,J.jsx)(K,{className:`h-3 w-3 mr-1`}),`Cursor MCP Docs`]})})]})]}),(0,J.jsxs)(f,{children:[(0,J.jsx)(N,{children:(0,J.jsxs)(l,{className:`flex items-center gap-2 text-base`,children:[(0,J.jsx)(R,{className:`h-4 w-4`}),`Claude Desktop`]})}),(0,J.jsxs)(p,{className:`space-y-3`,children:[(0,J.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Add to`,` `,(0,J.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`~/Library/Application Support/Claude/claude_desktop_config.json`}),`:`]}),(0,J.jsx)($,{value:oe(Q)}),(0,J.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Uses`,` `,(0,J.jsx)(`code`,{className:`text-xs bg-muted px-1 rounded`,children:`mcp-remote`}),` `,`to bridge HTTP Streamable → stdio (required by Claude Desktop).`]}),(0,J.jsx)(`div`,{className:`flex gap-2`,children:(0,J.jsxs)(y,{variant:`outline`,size:`sm`,className:`text-xs`,onClick:()=>window.open(`https://modelcontextprotocol.io/quickstart/user`,`_blank`,`noopener,noreferrer`),children:[(0,J.jsx)(K,{className:`h-3 w-3 mr-1`}),`Claude Desktop MCP Docs`]})})]})]}),(0,J.jsxs)(f,{children:[(0,J.jsx)(N,{children:(0,J.jsxs)(l,{className:`flex items-center gap-2 text-base`,children:[(0,J.jsx)(R,{className:`h-4 w-4`}),`Claude Code`]})}),(0,J.jsxs)(p,{className:`space-y-3`,children:[(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Add via CLI:`}),(0,J.jsx)($,{value:`claude mcp add agents-orchestrator --transport http ${Q}`}),(0,J.jsx)(`div`,{className:`flex gap-2`,children:(0,J.jsxs)(y,{variant:`outline`,size:`sm`,className:`text-xs`,onClick:()=>window.open(`https://docs.anthropic.com/en/docs/claude-code/mcp`,`_blank`,`noopener,noreferrer`),children:[(0,J.jsx)(K,{className:`h-3 w-3 mr-1`}),`Claude Code MCP Docs`]})})]})]})]}),(0,J.jsx)(`h2`,{className:`text-lg font-semibold mb-3`,children:e(`mcp.availableTools`)}),(0,J.jsxs)(`div`,{className:`relative mb-3`,children:[(0,J.jsx)(I,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,J.jsx)(M,{placeholder:e(`mcp.searchPlaceholder`),value:t,onChange:e=>n(e.target.value),className:`pl-9`})]}),a?(0,J.jsx)(`div`,{className:`space-y-2`,children:Array.from({length:5}).map((e,t)=>(0,J.jsx)(`div`,{className:`h-10 bg-muted animate-pulse rounded-md`},t))}):(0,J.jsxs)(`div`,{className:`space-y-4`,children:[Object.entries(s).map(([e,t])=>(0,J.jsxs)(`div`,{children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 mb-2`,children:[(0,J.jsx)(`h3`,{className:`text-sm font-medium capitalize`,children:e}),(0,J.jsx)(v,{variant:`secondary`,className:`text-[10px]`,children:t.length})]}),(0,J.jsx)(`div`,{className:`space-y-1`,children:t.map(e=>(0,J.jsx)(ie,{tool:e},e.name))})]},e)),o.length===0&&(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:e(`mcp.noToolsMatching`,{search:t})})]}),(0,J.jsx)(`h2`,{className:`text-lg font-semibold mt-6 mb-3`,children:e(`mcp.testConnection`)}),(0,J.jsx)(f,{children:(0,J.jsxs)(p,{className:`pt-6`,children:[(0,J.jsx)(`p`,{className:`text-sm text-muted-foreground mb-2`,children:e(`mcp.verifyEndpoint`)}),(0,J.jsx)($,{value:`curl -X POST ${Q} \\
|
|
6
|
+
-H "Content-Type: application/json" \\
|
|
7
|
+
-H "Accept: application/json, text/event-stream" \\
|
|
8
|
+
-d '{
|
|
9
|
+
"jsonrpc": "2.0",
|
|
10
|
+
"id": 1,
|
|
11
|
+
"method": "initialize",
|
|
12
|
+
"params": {
|
|
13
|
+
"protocolVersion": "2025-03-26",
|
|
14
|
+
"capabilities": {},
|
|
15
|
+
"clientInfo": { "name": "test", "version": "1.0.0" }
|
|
16
|
+
}
|
|
17
|
+
}'`})]})})]})}export{se as McpSetup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{h as t,t as n}from"./vendor-react-BJ8SIkmN.js";import{r,t as i}from"./useQuery-DvovkaPT.js";import{t as a}from"./useMutation-DA8-TvTt.js";import{t as o}from"./api-DNWoqIPN.js";import{A as s,D as c,F as l,I as u,L as d,O as ee,T as f,U as p,V as m,a as h,i as te,k as ne,n as re,r as g,w as _}from"./src-CaF63bXY.js";import{t as v}from"./circle-alert-D040vPU_.js";import{t as ie}from"./circle-check-CW3adL8A.js";import{t as ae}from"./database-5jczNGML.js";import{t as oe}from"./globe-C0WHVFW_.js";import{t as se}from"./refresh-cw-D3_GZ86i.js";import{t as ce}from"./search-BmZSwFnA.js";import{A as y,K as b,N as le,O as x,T as S,W as C,q as w,t as T}from"./index-DWNLSHpo.js";var E=l(`circle-arrow-down`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 8v8`,key:`napkw2`}],[`path`,{d:`m8 12 4 4 4-4`,key:`k98ssh`}]]),D=l(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),O=l(`tag`,[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]),k=e(t(),1),A=n(),ue={working:{label:`memory.tierWorking`,color:`bg-yellow-500/15 text-yellow-700 dark:text-yellow-400`},"short-term":{label:`memory.tierShortTerm`,color:`bg-blue-500/15 text-blue-700 dark:text-blue-400`},"long-term":{label:`memory.tierLongTerm`,color:`bg-green-500/15 text-green-700 dark:text-green-400`}},j={global:{label:`memory.scopeGlobal`,icon:oe},agent:{label:`memory.scopeAgent`,icon:w},team:{label:`memory.scopeTeam`,icon:x}},M={insight:`memory.categoryInsight`,decision:`memory.categoryDecision`,fact:`memory.categoryFact`,preference:`memory.categoryPreference`,"error-pattern":`memory.categoryErrorPattern`,summary:`memory.categorySummary`,other:`memory.categoryOther`},de={"team-run":`memory.sourceTeamRun`,"agent-self":`memory.sourceAgent`,human:`memory.sourceHuman`,system:`memory.sourceSystem`,external:`memory.sourceExternal`},N=`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`;function P(e,t){return new Date(e).toLocaleDateString(t,{day:`numeric`,month:`short`,year:`numeric`,hour:`2-digit`,minute:`2-digit`})}function F({value:e}){return(0,A.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,A.jsx)(`div`,{className:`h-1.5 w-16 rounded-full bg-muted overflow-hidden`,children:(0,A.jsx)(`div`,{className:`h-full rounded-full bg-primary transition-all`,style:{width:`${Math.round(e*100)}%`}})}),(0,A.jsxs)(`span`,{className:`text-[10px] text-muted-foreground tabular-nums`,children:[(e*100).toFixed(0),`%`]})]})}function fe({entry:e,onDelete:t,onPromote:n,onDemote:r,dateLocale:i}){let{t:a}=S(),o=ue[e.tier],s=j[e.scope],c=s.icon;return(0,A.jsx)(u,{className:`group`,children:(0,A.jsxs)(d,{className:`p-4 space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,A.jsx)(p,{variant:`secondary`,className:`text-[10px] ${o.color}`,children:a(o.label)}),(0,A.jsxs)(p,{variant:`outline`,className:`text-[10px] gap-1`,children:[(0,A.jsx)(c,{className:`h-3 w-3`}),a(s.label),e.agentId&&(0,A.jsxs)(`span`,{className:`opacity-60`,children:[`:`,e.agentId.slice(0,8)]}),e.teamId&&(0,A.jsxs)(`span`,{className:`opacity-60`,children:[`:`,e.teamId.slice(0,8)]})]}),e.category&&(0,A.jsx)(p,{variant:`secondary`,className:`text-[10px]`,children:a(M[e.category])}),e.approvedBy&&(0,A.jsxs)(p,{variant:`secondary`,className:`text-[10px] gap-0.5`,children:[(0,A.jsx)(ie,{className:`h-2.5 w-2.5`}),e.approvedBy]})]}),(0,A.jsxs)(`div`,{className:`flex gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity shrink-0`,children:[e.tier===`short-term`&&(0,A.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,title:a(`memory.promoteToLongTerm`),onClick:()=>n(e),children:(0,A.jsx)(D,{className:`h-3.5 w-3.5 text-green-600`})}),e.tier===`long-term`&&(0,A.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0`,title:a(`memory.demoteToShortTerm`),onClick:()=>r(e),children:(0,A.jsx)(E,{className:`h-3.5 w-3.5 text-orange-500`})}),(0,A.jsx)(m,{variant:`ghost`,size:`sm`,className:`h-7 w-7 p-0 text-destructive`,title:a(`common.delete`),onClick:()=>t(e),children:(0,A.jsx)(y,{className:`h-3.5 w-3.5`})})]})]}),(0,A.jsx)(`p`,{className:`text-sm leading-relaxed line-clamp-3`,children:e.content}),e.summary&&(0,A.jsx)(`p`,{className:`text-xs text-muted-foreground italic line-clamp-2`,children:e.summary}),e.tags.length>0&&(0,A.jsxs)(`div`,{className:`flex items-center gap-1 flex-wrap`,children:[(0,A.jsx)(O,{className:`h-3 w-3 text-muted-foreground`}),e.tags.map(e=>(0,A.jsx)(`span`,{className:`text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground`,children:e},e))]}),(0,A.jsxs)(`div`,{className:`flex items-center justify-between text-[11px] text-muted-foreground pt-1`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsx)(F,{value:e.importance}),(0,A.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,A.jsx)(C,{className:`h-3 w-3`}),P(e.createdAt,i)]}),(0,A.jsx)(`span`,{children:a(de[e.source.type])??e.source.type})]}),(0,A.jsx)(`span`,{className:`tabular-nums`,children:a(`memory.accessCount`,{count:e.accessCount})})]})]})})}function pe({pending:e,onApprove:t,dateLocale:n}){let{t:r}=S();return(0,A.jsx)(u,{className:`border-dashed border-orange-500/40`,children:(0,A.jsxs)(d,{className:`p-4 space-y-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,A.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,A.jsx)(v,{className:`h-4 w-4 text-orange-500`}),(0,A.jsx)(`span`,{className:`text-xs font-medium text-orange-600 dark:text-orange-400`,children:r(`memory.pendingApproval`)}),(0,A.jsx)(p,{variant:`secondary`,className:`text-[10px]`,children:r(`memory.score`,{value:(e.classificationScore*100).toFixed(0)})})]}),(0,A.jsxs)(m,{size:`sm`,variant:`outline`,onClick:()=>t(e.entry.id),children:[(0,A.jsx)(D,{className:`h-3.5 w-3.5 mr-1`}),r(`memory.approve`)]})]}),(0,A.jsx)(`p`,{className:`text-sm leading-relaxed line-clamp-3`,children:e.entry.content}),(0,A.jsx)(`div`,{className:`text-[11px] text-muted-foreground`,children:P(e.createdAt,n)})]})})}var I={content:``,scope:`global`,agentId:``,teamId:``,tier:`long-term`,category:`fact`,tags:``,importance:.5};function L(){let{t:e,getDateLocale:t}=S(),n=t(),l=r(),[y,C]=(0,k.useState)(`all`),[E,D]=(0,k.useState)(``),[O,ue]=(0,k.useState)(``),[j,de]=(0,k.useState)(``),[P,F]=(0,k.useState)(!1),[L,R]=(0,k.useState)({...I}),[z,B]=(0,k.useState)(null),V=i({queryKey:[`memory`,`global`],queryFn:()=>o.memory.listGlobal(),staleTime:3e4}),H=i({queryKey:[`memory`,`search`,E,O,j],queryFn:()=>o.memory.search({text:E||void 0,tiers:O||void 0,category:j||void 0,limit:50}),enabled:!!(E||O||j),staleTime:1e4}),U=i({queryKey:[`memory`,`pending`],queryFn:()=>o.memory.getPending(),staleTime:3e4}),W=()=>{l.invalidateQueries({queryKey:[`memory`]})},G=a({mutationFn:()=>o.memory.create({content:L.content,scope:L.scope,agentId:L.scope===`agent`?L.agentId:void 0,teamId:L.scope===`team`?L.teamId:void 0,tier:L.tier,category:L.category,tags:L.tags.split(`,`).map(e=>e.trim()).filter(Boolean),importance:L.importance}),onSuccess:()=>{W(),F(!1),R({...I}),T.success(e(`memory.created`))},onError:t=>T.error(t instanceof Error?t.message:e(`common.error`))}),K=a({mutationFn:e=>{let t;return e.scope===`agent`?t=e.agentId:e.scope===`team`&&(t=e.teamId),o.memory.delete(e.id,e.scope,t)},onSuccess:()=>{W(),B(null),T.success(e(`memory.deleted`))},onError:t=>T.error(t instanceof Error?t.message:e(`common.error`))}),q=a({mutationFn:e=>o.memory.promote(e.id),onSuccess:()=>{W(),T.success(e(`memory.promoted`))},onError:t=>T.error(t instanceof Error?t.message:e(`common.error`))}),me=a({mutationFn:e=>{let t;return e.scope===`agent`?t=e.agentId:e.scope===`team`&&(t=e.teamId),o.memory.demote(e.id,e.scope,t)},onSuccess:()=>{W(),T.success(e(`memory.demoted`))},onError:t=>T.error(t instanceof Error?t.message:e(`common.error`))}),J=a({mutationFn:()=>o.memory.rebuildIndex(),onSuccess:()=>{W(),T.success(e(`memory.indexRebuilt`))},onError:t=>T.error(t instanceof Error?t.message:e(`common.error`))}),Y=!!(E||O||j),X=(0,k.useMemo)(()=>Y&&H.data?H.data.results.map(e=>e.entry):V.data?.entries??[],[Y,H.data,V.data]),he=(0,k.useMemo)(()=>y===`all`?X:y===`global`?X.filter(e=>e.scope===`global`):y===`agent`?X.filter(e=>e.scope===`agent`):y===`team`?X.filter(e=>e.scope===`team`):X,[y,X]),Z=U.data?.pending??[],Q=Y?H.isLoading:V.isLoading,$=e=>R(t=>({...t,...e}));return(0,A.jsxs)(`div`,{className:`p-6 max-w-5xl mx-auto space-y-6`,children:[(0,A.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsxs)(`h1`,{className:`text-2xl font-bold flex items-center gap-2`,children:[(0,A.jsx)(b,{className:`h-6 w-6`}),e(`memory.title`)]}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:e(`memory.description`)})]}),(0,A.jsxs)(`div`,{className:`flex gap-2`,children:[(0,A.jsxs)(m,{variant:`outline`,size:`sm`,onClick:()=>J.mutate(),disabled:J.isPending,children:[(0,A.jsx)(se,{className:`h-3.5 w-3.5 mr-1.5 ${J.isPending?`animate-spin`:``}`}),e(`memory.rebuildIndex`)]}),(0,A.jsxs)(m,{onClick:()=>F(!0),children:[(0,A.jsx)(le,{className:`h-4 w-4 mr-1.5`}),e(`memory.newMemory`)]})]})]}),(0,A.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,A.jsxs)(`div`,{className:`relative flex-1`,children:[(0,A.jsx)(ce,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,A.jsx)(_,{value:E,onChange:e=>D(e.target.value),placeholder:e(`memory.searchPlaceholder`),className:`pl-9`})]}),(0,A.jsxs)(`select`,{value:O,onChange:e=>ue(e.target.value),className:`${N} w-40`,children:[(0,A.jsx)(`option`,{value:``,children:e(`memory.allTiers`)}),(0,A.jsx)(`option`,{value:`working`,children:e(`memory.tierWorking`)}),(0,A.jsx)(`option`,{value:`short-term`,children:e(`memory.tierShortTerm`)}),(0,A.jsx)(`option`,{value:`long-term`,children:e(`memory.tierLongTerm`)})]}),(0,A.jsxs)(`select`,{value:j,onChange:e=>de(e.target.value),className:`${N} w-40`,children:[(0,A.jsx)(`option`,{value:``,children:e(`memory.allCategories`)}),Object.keys(M).map(t=>(0,A.jsx)(`option`,{value:t,children:e(M[t])},t))]})]}),(0,A.jsxs)(re,{value:y,onValueChange:C,children:[(0,A.jsxs)(te,{children:[(0,A.jsxs)(h,{value:`all`,className:`gap-1.5`,children:[(0,A.jsx)(ae,{className:`h-3.5 w-3.5`}),e(`memory.all`),(0,A.jsx)(p,{variant:`secondary`,className:`text-[10px] ml-1 px-1.5 py-0`,children:X.length})]}),(0,A.jsxs)(h,{value:`global`,className:`gap-1.5`,children:[(0,A.jsx)(oe,{className:`h-3.5 w-3.5`}),e(`memory.scopeGlobal`)]}),(0,A.jsxs)(h,{value:`agent`,className:`gap-1.5`,children:[(0,A.jsx)(w,{className:`h-3.5 w-3.5`}),e(`memory.scopeAgent`)]}),(0,A.jsxs)(h,{value:`team`,className:`gap-1.5`,children:[(0,A.jsx)(x,{className:`h-3.5 w-3.5`}),e(`memory.scopeTeam`)]}),(0,A.jsxs)(h,{value:`pending`,className:`gap-1.5`,children:[(0,A.jsx)(v,{className:`h-3.5 w-3.5`}),e(`memory.pending`),Z.length>0&&(0,A.jsx)(p,{variant:`destructive`,className:`text-[10px] ml-1 px-1.5 py-0`,children:Z.length})]})]}),[`all`,`global`,`agent`,`team`].map(t=>(0,A.jsxs)(g,{value:t,className:`mt-4 space-y-3`,children:[Q&&(0,A.jsx)(`div`,{className:`grid gap-3`,children:[1,2,3].map(e=>(0,A.jsx)(u,{className:`animate-pulse`,children:(0,A.jsx)(d,{className:`p-4 h-28`})},e))}),!Q&&(he.length===0?(0,A.jsx)(u,{children:(0,A.jsxs)(d,{className:`p-8 text-center text-muted-foreground`,children:[(0,A.jsx)(b,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,A.jsx)(`p`,{children:e(`memory.noMemories`)}),(0,A.jsx)(`p`,{className:`text-xs mt-1`,children:e(Y?`memory.tryFilters`:`memory.autoCreate`)})]})}):(0,A.jsx)(`div`,{className:`grid gap-3`,children:he.map(e=>(0,A.jsx)(fe,{entry:e,onDelete:B,onPromote:e=>q.mutate(e),onDemote:e=>me.mutate(e),dateLocale:n},e.id))}))]},t)),(0,A.jsxs)(g,{value:`pending`,className:`mt-4 space-y-3`,children:[U.isLoading&&(0,A.jsx)(`div`,{className:`grid gap-3`,children:[1,2].map(e=>(0,A.jsx)(u,{className:`animate-pulse`,children:(0,A.jsx)(d,{className:`p-4 h-24`})},e))}),!Q&&(Z.length===0?(0,A.jsx)(u,{children:(0,A.jsxs)(d,{className:`p-8 text-center text-muted-foreground`,children:[(0,A.jsx)(ie,{className:`h-12 w-12 mx-auto mb-3 opacity-30`}),(0,A.jsx)(`p`,{children:e(`memory.noPending`)}),(0,A.jsx)(`p`,{className:`text-xs mt-1`,children:e(`memory.pendingHelp`)})]})}):(0,A.jsx)(`div`,{className:`grid gap-3`,children:Z.map(e=>(0,A.jsx)(pe,{pending:e,onApprove:e=>q.mutate({id:e}),dateLocale:n},e.entry.id))}))]})]}),(0,A.jsx)(f,{open:P,onOpenChange:F,children:(0,A.jsxs)(c,{className:`sm:max-w-lg`,children:[(0,A.jsx)(ne,{children:(0,A.jsx)(s,{children:e(`memory.newMemory`)})}),(0,A.jsxs)(`div`,{className:`space-y-4`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.content`)}),(0,A.jsx)(`textarea`,{value:L.content,onChange:e=>$({content:e.target.value}),placeholder:e(`memory.contentPlaceholder`),rows:4,className:`flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring resize-none`})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.scope`)}),(0,A.jsxs)(`select`,{value:L.scope,onChange:e=>$({scope:e.target.value}),className:N,children:[(0,A.jsx)(`option`,{value:`global`,children:e(`memory.scopeGlobal`)}),(0,A.jsx)(`option`,{value:`agent`,children:e(`memory.scopeAgent`)}),(0,A.jsx)(`option`,{value:`team`,children:e(`memory.scopeTeam`)})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.tier`)}),(0,A.jsxs)(`select`,{value:L.tier,onChange:e=>$({tier:e.target.value}),className:N,children:[(0,A.jsx)(`option`,{value:`long-term`,children:e(`memory.tierLongTerm`)}),(0,A.jsx)(`option`,{value:`short-term`,children:e(`memory.tierShortTerm`)}),(0,A.jsx)(`option`,{value:`working`,children:e(`memory.tierWorking`)})]})]})]}),L.scope===`agent`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.agentIdLabel`)}),(0,A.jsx)(_,{value:L.agentId,onChange:e=>$({agentId:e.target.value}),placeholder:e(`memory.agentIdPlaceholder`)})]}),L.scope===`team`&&(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.teamIdLabel`)}),(0,A.jsx)(_,{value:L.teamId,onChange:e=>$({teamId:e.target.value}),placeholder:e(`memory.teamIdPlaceholder`)})]}),(0,A.jsxs)(`div`,{className:`grid grid-cols-2 gap-3`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.category`)}),(0,A.jsx)(`select`,{value:L.category,onChange:e=>$({category:e.target.value}),className:N,children:Object.keys(M).map(t=>(0,A.jsx)(`option`,{value:t,children:e(M[t])},t))})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.importance`,{value:(L.importance*100).toFixed(0)})}),(0,A.jsx)(`input`,{type:`range`,min:0,max:1,step:.05,value:L.importance,onChange:e=>$({importance:parseFloat(e.target.value)}),className:`w-full mt-2`})]})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`label`,{className:`text-xs font-medium text-muted-foreground`,children:e(`memory.tagsLabel`)}),(0,A.jsx)(_,{value:L.tags,onChange:e=>$({tags:e.target.value}),placeholder:`tag1, tag2, tag3`})]})]}),(0,A.jsxs)(ee,{children:[(0,A.jsx)(m,{variant:`outline`,onClick:()=>F(!1),children:e(`common.cancel`)}),(0,A.jsx)(m,{onClick:()=>G.mutate(),disabled:G.isPending||!L.content.trim(),children:G.isPending?e(`common.creating`):e(`common.create`)})]})]})}),(0,A.jsx)(f,{open:!!z,onOpenChange:()=>B(null),children:(0,A.jsxs)(c,{className:`sm:max-w-sm`,children:[(0,A.jsx)(ne,{children:(0,A.jsx)(s,{children:e(`memory.deleteTitle`)})}),(0,A.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`memory.deleteWarning`)}),(0,A.jsxs)(ee,{children:[(0,A.jsx)(m,{variant:`outline`,onClick:()=>B(null),children:e(`common.cancel`)}),(0,A.jsx)(m,{variant:`destructive`,disabled:K.isPending,onClick:()=>z&&K.mutate(z),children:K.isPending?e(`common.deleting`):e(`common.delete`)})]})]})})]})}export{L as Memory};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{h as t,l as n,t as r}from"./vendor-react-BJ8SIkmN.js";import{t as i}from"./useQuery-DvovkaPT.js";import{t as a}from"./api-DNWoqIPN.js";import{V as o}from"./src-CaF63bXY.js";import{H as s,R as c,T as l,W as u,g as d}from"./index-DWNLSHpo.js";var f=e(t(),1),p=r();function m(){let{t:e}=l(),t=n(),[r,m]=(0,f.useState)(!1),{data:g,isLoading:_}=i({queryKey:[`chat-workspaces`],queryFn:()=>a.chat.getWorkspaces({page:1,pageSize:100})}),v=[...g?.data??[]].sort((e,t)=>t.sessionCount-e.sessionCount),y=e=>{t(`/chat/new?workspace=${encodeURIComponent(e)}`)};return(0,p.jsx)(`div`,{className:`flex h-full items-start justify-center overflow-auto`,children:(0,p.jsxs)(`div`,{className:`w-full max-w-lg px-6 py-12`,children:[(0,p.jsxs)(`div`,{className:`text-center mb-8`,children:[(0,p.jsx)(c,{className:`h-10 w-10 mx-auto mb-3 text-muted-foreground`}),(0,p.jsx)(`h1`,{className:`text-2xl font-bold`,children:e(`newChat.title`)}),(0,p.jsx)(`p`,{className:`text-sm text-muted-foreground mt-1`,children:e(`newChat.selectWorkspace`)})]}),(0,p.jsx)(`div`,{className:`mb-6`,children:(0,p.jsxs)(o,{variant:`outline`,className:`w-full justify-start gap-2`,onClick:async()=>{m(!0);try{let e=await a.fs.pickFolder();e.path&&y(e.path)}finally{m(!1)}},disabled:r,children:[(0,p.jsx)(s,{className:`h-4 w-4`}),e(r?`newChat.selecting`:`newChat.selectFolder`)]})}),(0,p.jsxs)(`div`,{children:[(0,p.jsxs)(`h2`,{className:`flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground mb-3`,children:[(0,p.jsx)(u,{className:`h-3 w-3`}),e(`newChat.recentWorkspaces`)]}),_&&(0,p.jsx)(d,{count:3}),!_&&(v.length===0?(0,p.jsx)(`div`,{className:`text-sm text-muted-foreground text-center py-4`,children:e(`newChat.noHistory`)}):(0,p.jsx)(`div`,{className:`space-y-1`,children:v.map(e=>(0,p.jsx)(h,{workspace:e,onSelect:()=>y(e.workspacePath),onViewSessions:()=>t(`/chat/${e.projectHash}`)},e.projectHash))}))]})]})})}function h({workspace:e,onSelect:t,onViewSessions:n}){let{t:r}=l();return(0,p.jsxs)(`div`,{className:`group flex items-center gap-2 rounded-md border px-3 py-2.5 hover:border-primary/50 transition-colors`,children:[(0,p.jsxs)(`button`,{onClick:t,className:`flex items-center gap-2 flex-1 min-w-0 text-left`,children:[(0,p.jsx)(s,{className:`h-4 w-4 shrink-0 text-muted-foreground`}),(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`div`,{className:`text-sm font-medium truncate`,children:e.workspaceName}),(0,p.jsx)(`div`,{className:`text-xs text-muted-foreground truncate`,children:e.workspacePath})]})]}),(0,p.jsxs)(`button`,{onClick:n,className:`text-xs text-muted-foreground hover:text-foreground transition-colors shrink-0`,title:r(`newChat.viewPastSessions`),children:[e.sessionCount,` session`,e.sessionCount>1?`s`:``]})]})}export{m as NewChat};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{h as t,l as n,r,t as i}from"./vendor-react-BJ8SIkmN.js";import{B as a,I as o,L as s,V as c,w as l,z as u}from"./src-CaF63bXY.js";import{n as d,t as f}from"./index-DWNLSHpo.js";var p=e(t(),1),m=i();function h(){let e=n(),[t,i]=(0,p.useState)(``),[h,g]=(0,p.useState)(``),[_,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(!1);async function x(n){if(n.preventDefault(),_.length<8){f.error(`Password must be at least 8 characters`);return}b(!0);try{let n=await d.signUp.email({name:t,email:h,password:_});if(n.error){f.error(n.error.message??`Registration failed`);return}f.success(`Account created`),e(`/dashboard`)}catch{f.error(`Registration failed`)}finally{b(!1)}}return(0,m.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,m.jsxs)(o,{className:`w-full max-w-md`,children:[(0,m.jsx)(u,{className:`text-center`,children:(0,m.jsx)(a,{className:`text-2xl`,children:`Create an account`})}),(0,m.jsxs)(s,{children:[(0,m.jsxs)(`form`,{onSubmit:x,className:`space-y-4`,children:[(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{htmlFor:`name`,className:`text-sm font-medium`,children:`Name`}),(0,m.jsx)(l,{id:`name`,type:`text`,placeholder:`Your name`,value:t,onChange:e=>i(e.target.value),required:!0})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{htmlFor:`email`,className:`text-sm font-medium`,children:`Email`}),(0,m.jsx)(l,{id:`email`,type:`email`,placeholder:`you@example.com`,value:h,onChange:e=>g(e.target.value),required:!0})]}),(0,m.jsxs)(`div`,{className:`space-y-2`,children:[(0,m.jsx)(`label`,{htmlFor:`password`,className:`text-sm font-medium`,children:`Password`}),(0,m.jsx)(l,{id:`password`,type:`password`,placeholder:`Min. 8 characters`,value:_,onChange:e=>v(e.target.value),required:!0,minLength:8})]}),(0,m.jsx)(c,{type:`submit`,className:`w-full`,disabled:y,children:y?`Creating account...`:`Create account`})]}),(0,m.jsxs)(`div`,{className:`mt-4 text-center text-sm text-muted-foreground`,children:[`Already have an account?`,` `,(0,m.jsx)(r,{to:`/login`,className:`text-primary hover:underline`,children:`Sign in`})]})]})]})})}export{h as Register};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),n=e(`panel-top`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]),r=e(`send`,[[`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`}]]);export{n,t as r,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-Dw2cE7zH.js";import{d as t,h as n,l as r,t as i}from"./vendor-react-BJ8SIkmN.js";import{r as a,t as o}from"./useQuery-DvovkaPT.js";import{t as s}from"./useMutation-DA8-TvTt.js";import{t as c}from"./api-DNWoqIPN.js";import{A as l,B as u,D as d,F as f,G as p,I as m,K as h,L as g,O as _,P as v,R as y,T as b,U as x,V as S,k as C,p as w,w as T,z as E}from"./src-CaF63bXY.js";import{t as D}from"./circle-alert-D040vPU_.js";import{t as O}from"./circle-check-CW3adL8A.js";import{t as k}from"./circle-x-34c-1fVL.js";import{t as ee}from"./copy-DI5qjA1p.js";import{t as te}from"./eye-BQGasWwb.js";import{t as ne}from"./globe-C0WHVFW_.js";import{t as A}from"./refresh-cw-D3_GZ86i.js";import{t as j}from"./rotate-ccw-CkJIdGxi.js";import{t as M}from"./search-BmZSwFnA.js";import{t as N}from"./server-C5bKQLDi.js";import{t as P}from"./shield-CMMTdOiM.js";import{t as F}from"./terminal-CjSFIwMK.js";import"./utils-D1nRmcA6.js";import{n as re,t as ie}from"./bi-Da3wz7XD.js";import{A as I,F as L,N as R,O as z,T as B,t as V,w as H}from"./index-DWNLSHpo.js";var U=f(`eye-off`,[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),W=f(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),G=f(`palette`,[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]),K=f(`settings-2`,[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]),q=f(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),J=e(n(),1),Y=i(),X=[{id:`general`,label:`General`,icon:K},{id:`appearance`,label:`Appearance`,icon:G},{id:`cli`,label:`CLI Agents`,icon:F},{id:`gateway`,label:`Gateway`,icon:N},{id:`users`,label:`Users`,icon:z},{id:`roles`,label:`Roles`,icon:P}],ae={"claude-code":re,cursor:ie};function oe(){let{t:e}=B(),[n]=t(),i=r(),a=n.get(`tab`),o=a&&X.some(e=>e.id===a)?a:`general`;function s(e){i(`/settings?tab=${e}`,{replace:!0})}return(0,Y.jsxs)(`div`,{className:`flex h-full`,children:[(0,Y.jsxs)(`nav`,{className:`w-52 shrink-0 border-r p-4 space-y-1`,children:[(0,Y.jsx)(`h1`,{className:`text-lg font-bold tracking-tight mb-4`,children:e(`settings.title`)}),X.map(e=>(0,Y.jsxs)(`button`,{onClick:()=>s(e.id),className:h(`flex w-full items-center gap-2 rounded-md px-3 py-2 text-sm transition-colors`,o===e.id?`bg-accent text-accent-foreground font-medium`:`text-muted-foreground hover:bg-muted hover:text-foreground`),children:[(0,Y.jsx)(e.icon,{className:`h-4 w-4 shrink-0`}),e.label]},e.id))]}),(0,Y.jsxs)(`div`,{className:`flex-1 overflow-auto p-6 max-w-4xl`,children:[o===`general`&&(0,Y.jsx)(se,{}),o===`appearance`&&(0,Y.jsx)(ce,{}),o===`cli`&&(0,Y.jsx)(ue,{}),o===`gateway`&&(0,Y.jsx)(fe,{}),o===`users`&&(0,Y.jsx)(me,{}),o===`roles`&&(0,Y.jsx)(_e,{})]})]})}function se(){let{t:e}=B(),t=H(e=>e.locale),n=H(e=>e.setLocale);return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(`settings.general`)}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`settings.generalDescription`)})]}),(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-md bg-muted`,children:(0,Y.jsx)(ne,{className:`h-4 w-4 text-muted-foreground`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e(`settings.language`)}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e(`settings.languageDescription`)})]})]}),(0,Y.jsxs)(`select`,{value:t,onChange:e=>n(e.target.value),className:`flex h-9 w-40 rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,children:[(0,Y.jsx)(`option`,{value:`en`,children:`English`}),(0,Y.jsx)(`option`,{value:`fr`,children:`Français`}),(0,Y.jsx)(`option`,{value:`zh`,children:`中文`}),(0,Y.jsx)(`option`,{value:`ja`,children:`日本語`})]})]})})]})}function ce(){let{t:e}=B(),t=H(e=>e.colorTheme),n=H(e=>e.setColorTheme);return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(`settings.colorTheme`)}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`settings.colorThemeDescription`)})]}),(0,Y.jsx)(`div`,{className:`grid gap-4 sm:grid-cols-2 md:grid-cols-3`,children:p.map(e=>(0,Y.jsx)(le,{theme:e,active:t===e.id,onSelect:()=>n(e.id)},e.id))})]})}function le({theme:e,active:t,onSelect:n}){let{dark:r,light:i}=e;return(0,Y.jsxs)(`button`,{onClick:n,className:`relative rounded-lg border-2 p-1 text-left transition-colors ${t?`border-primary`:`border-border hover:border-primary/50`}`,children:[t&&(0,Y.jsx)(`div`,{className:`absolute top-2 right-2 rounded-full bg-primary p-0.5 text-primary-foreground`,children:(0,Y.jsx)(v,{className:`h-3 w-3`})}),(0,Y.jsxs)(`div`,{className:`flex rounded-md overflow-hidden h-24`,children:[(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col p-2 gap-1.5`,style:{background:i.background,color:i.foreground},children:[(0,Y.jsx)(`div`,{className:`text-[8px] font-medium opacity-50`,children:`Light`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(`div`,{className:`h-2 w-6 rounded-sm`,style:{background:i.primary}}),(0,Y.jsx)(`div`,{className:`h-2 flex-1 rounded-sm`,style:{background:i.secondary}})]}),(0,Y.jsx)(`div`,{className:`h-1.5 w-10 rounded-sm`,style:{background:i.muted}}),(0,Y.jsxs)(`div`,{className:`flex gap-1 mt-auto`,children:[(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:i.primary}}),(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:i.accent}}),(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:i.destructive}})]})]}),(0,Y.jsxs)(`div`,{className:`flex-1 flex flex-col p-2 gap-1.5`,style:{background:r.background,color:r.foreground},children:[(0,Y.jsx)(`div`,{className:`text-[8px] font-medium opacity-50`,children:`Dark`}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(`div`,{className:`h-2 w-6 rounded-sm`,style:{background:r.primary}}),(0,Y.jsx)(`div`,{className:`h-2 flex-1 rounded-sm`,style:{background:r.secondary}})]}),(0,Y.jsx)(`div`,{className:`h-1.5 w-10 rounded-sm`,style:{background:r.muted}}),(0,Y.jsxs)(`div`,{className:`flex gap-1 mt-auto`,children:[(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:r.primary}}),(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:r.accent}}),(0,Y.jsx)(`div`,{className:`h-2 w-2 rounded-full`,style:{background:r.destructive}})]})]})]}),(0,Y.jsx)(`div`,{className:`mt-2 px-1 pb-1`,children:(0,Y.jsx)(`span`,{className:`text-sm font-medium`,children:e.name})})]})}function ue(){let{t:e}=B(),{data:t,isLoading:n,refetch:r,isFetching:i}=o({queryKey:[`settings`,`cli-agents`],queryFn:()=>c.settings.getCliAgents()}),a=t?.agents??[],s=a.filter(e=>e.installed).length;return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:e(`settings.cliAgents`)}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:e(`settings.cliAgentsDescription`)})]}),(0,Y.jsxs)(S,{variant:`outline`,size:`sm`,onClick:()=>r(),disabled:i,className:`gap-1.5`,children:[(0,Y.jsx)(A,{className:`h-3.5 w-3.5 ${i?`animate-spin`:``}`}),e(`common.refresh`)]})]}),!n&&a.length>0&&(0,Y.jsx)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:(0,Y.jsx)(`span`,{children:e(`settings.agentsDetected`,{installed:s,total:a.length})})}),n?(0,Y.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:[1,2].map(e=>(0,Y.jsxs)(m,{children:[(0,Y.jsxs)(E,{className:`flex flex-row items-center justify-between space-y-0 pb-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(w,{className:`h-10 w-10 rounded-lg`}),(0,Y.jsxs)(`div`,{className:`space-y-1`,children:[(0,Y.jsx)(w,{className:`h-4 w-24`}),(0,Y.jsx)(w,{className:`h-3 w-16`})]})]}),(0,Y.jsx)(w,{className:`h-5 w-16 rounded-full`})]}),(0,Y.jsx)(g,{children:(0,Y.jsx)(w,{className:`h-4 w-40`})})]},e))}):(0,Y.jsx)(`div`,{className:`grid gap-4 md:grid-cols-2`,children:a.map(e=>(0,Y.jsx)(de,{agent:e},e.id))})]})}function de({agent:e}){let{t}=B();return(0,Y.jsxs)(m,{children:[(0,Y.jsxs)(E,{className:`flex flex-row items-center justify-between space-y-0 pb-2`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex h-10 w-10 items-center justify-center rounded-lg bg-muted`,children:(0,Y.jsx)(ae[e.id]??F,{className:`h-5 w-5`})}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(u,{className:`text-base`,children:e.label}),(0,Y.jsx)(y,{className:`text-xs font-mono`,children:e.id})]})]}),(0,Y.jsx)(x,{variant:e.installed?`default`:`destructive`,className:`gap-1`,children:e.installed?(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(O,{className:`h-3 w-3`}),` `,t(`settings.active`)]}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(k,{className:`h-3 w-3`}),` `,t(`settings.notFound`)]})})]}),(0,Y.jsx)(g,{children:e.installed?(0,Y.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,Y.jsx)(`span`,{children:t(`settings.version`)}),(0,Y.jsx)(`code`,{className:`rounded bg-muted px-1.5 py-0.5 text-xs font-mono`,children:e.version})]}):(0,Y.jsxs)(`div`,{className:`flex items-start gap-2 text-sm text-muted-foreground`,children:[(0,Y.jsx)(D,{className:`h-4 w-4 mt-0.5 shrink-0 text-destructive`}),(0,Y.jsx)(`span`,{children:e.error??t(`settings.notFoundError`)})]})})]})}function fe(){let e=a(),[t,n]=(0,J.useState)(!1),[r,i]=(0,J.useState)(``),[u,f]=(0,J.useState)(!1),{data:p,isLoading:h}=o({queryKey:[`gateway-config`],queryFn:()=>c.gateway.getConfig(!0)}),{data:v}=o({queryKey:[`gateway-status`],queryFn:()=>c.gateway.getStatus(),refetchInterval:3e4}),y=s({mutationFn:e=>c.gateway.updateConfig(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`gateway-config`]}),V.success(`Gateway config updated`)},onError:e=>V.error(e.message)}),E=s({mutationFn:()=>c.gateway.restart(),onSuccess:()=>{V.success(`Gateway restarting...`),f(!1)}});function D(){!r.trim()||!p||(y.mutate({trustedOrigins:[...p.trustedOrigins,r.trim()]}),i(``))}function O(e){p&&y.mutate({trustedOrigins:p.trustedOrigins.filter(t=>t!==e)})}return h?(0,Y.jsx)(w,{className:`h-48`}):(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Gateway`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage CORS origins, access token, and gateway status`})]}),v&&(0,Y.jsxs)(x,{variant:`outline`,className:`gap-1.5`,children:[(0,Y.jsx)(`span`,{className:`h-2 w-2 rounded-full ${v.connected?`bg-green-500`:`bg-red-500`}`}),v.connected?`Connected`:`Disconnected`]})]}),(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:`Port`}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Gateway listening port (read-only)`})]}),(0,Y.jsx)(`code`,{className:`rounded bg-muted px-2 py-1 text-sm font-mono`,children:p?.port})]})}),(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 space-y-3`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:`Access Token`}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Quick access token for CLI and API`})]}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>n(!t),children:t?(0,Y.jsx)(U,{className:`h-3.5 w-3.5`}):(0,Y.jsx)(te,{className:`h-3.5 w-3.5`})}),(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>{p?.token&&(navigator.clipboard.writeText(p.token),V.success(`Token copied`))},children:(0,Y.jsx)(ee,{className:`h-3.5 w-3.5`})})]})]}),(0,Y.jsx)(`code`,{className:`block rounded bg-muted px-3 py-2 text-xs font-mono break-all`,children:t?p?.token:`••••••••••••••••••••••••••••••••`})]})}),(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 space-y-3`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:`Trusted Origins (CORS)`}),(0,Y.jsx)(`div`,{className:`space-y-2`,children:p?.trustedOrigins.map(e=>(0,Y.jsxs)(`div`,{className:`flex items-center justify-between rounded bg-muted px-3 py-2`,children:[(0,Y.jsx)(`code`,{className:`text-xs font-mono`,children:e}),(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>O(e),children:(0,Y.jsx)(I,{className:`h-3 w-3 text-destructive`})})]},e))}),(0,Y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,Y.jsx)(T,{placeholder:`https://example.com`,value:r,onChange:e=>i(e.target.value),className:`text-xs`,onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),D())}}),(0,Y.jsxs)(S,{variant:`outline`,size:`sm`,onClick:D,className:`gap-1`,children:[(0,Y.jsx)(R,{className:`h-3 w-3`}),` Add`]})]})]})}),(0,Y.jsxs)(S,{variant:`outline`,className:`gap-2`,onClick:()=>f(!0),children:[(0,Y.jsx)(j,{className:`h-4 w-4`}),` Restart Gateway`]}),(0,Y.jsx)(b,{open:u,onOpenChange:f,children:(0,Y.jsxs)(d,{children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:`Restart Gateway`})}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`This will restart the gateway process. The UI will briefly disconnect. Are you sure?`}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,onClick:()=>f(!1),children:`Cancel`}),(0,Y.jsx)(S,{onClick:()=>E.mutate(),disabled:E.isPending,children:E.isPending?`Restarting...`:`Restart`})]})]})})]})}var pe={owner:`bg-amber-500/15 text-amber-500`,admin:`bg-blue-500/15 text-blue-500`,member:`bg-green-500/15 text-green-500`};function me(){let e=a(),[t,n]=(0,J.useState)(``),[r,i]=(0,J.useState)(!1),[u,f]=(0,J.useState)(null),[p,h]=(0,J.useState)(null),{data:v,isLoading:y}=o({queryKey:[`users`],queryFn:()=>c.users.list()}),{data:w}=o({queryKey:[`roles`],queryFn:()=>c.roles.list()}),E=s({mutationFn:e=>c.users.delete(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`users`]}),V.success(`User deleted`),h(null)},onError:e=>V.error(e.message)}),D=(v?.users??[]).filter(e=>!t||e.name.toLowerCase().includes(t.toLowerCase())||e.email.toLowerCase().includes(t.toLowerCase()));return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Users`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage user accounts and roles`})]}),(0,Y.jsxs)(S,{className:`gap-2`,onClick:()=>i(!0),children:[(0,Y.jsx)(q,{className:`h-4 w-4`}),` Invite User`]})]}),(0,Y.jsxs)(`div`,{className:`relative`,children:[(0,Y.jsx)(M,{className:`absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground`}),(0,Y.jsx)(T,{placeholder:`Search by name or email...`,className:`pl-9`,value:t,onChange:e=>n(e.target.value)})]}),y?(0,Y.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading users...`}):(0,Y.jsxs)(`div`,{className:`space-y-2`,children:[D.map(e=>(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(`div`,{className:`flex h-9 w-9 items-center justify-center rounded-full bg-muted text-sm font-medium`,children:e.name.charAt(0).toUpperCase()}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:e.email})]})]}),(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Y.jsx)(x,{className:pe[e.roleName]??``,children:e.roleName}),(0,Y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>f(e),children:(0,Y.jsx)(L,{className:`h-3.5 w-3.5`})}),e.roleName!==`owner`&&(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>h(e),children:(0,Y.jsx)(I,{className:`h-3.5 w-3.5 text-destructive`})})]})]})]})},e.id)),D.length===0&&(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground text-center py-8`,children:`No users found`})]}),(0,Y.jsx)(b,{open:!!p,onOpenChange:()=>h(null),children:(0,Y.jsxs)(d,{children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:`Delete user`})}),(0,Y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Are you sure you want to delete `,(0,Y.jsx)(`strong`,{children:p?.name}),` (`,p?.email,`)? This action cannot be undone.`]}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,onClick:()=>h(null),children:`Cancel`}),(0,Y.jsx)(S,{variant:`destructive`,onClick:()=>p&&E.mutate(p.id),disabled:E.isPending,children:E.isPending?`Deleting...`:`Delete`})]})]})}),(0,Y.jsx)(he,{open:r,onOpenChange:i,roles:w?.roles??[],onSuccess:()=>e.invalidateQueries({queryKey:[`users`]})}),u&&(0,Y.jsx)(Z,{user:u,onOpenChange:e=>!e&&f(null),roles:w?.roles??[],onSuccess:()=>{e.invalidateQueries({queryKey:[`users`]}),f(null)}})]})}function he({open:e,onOpenChange:t,roles:n,onSuccess:r}){let[i,a]=(0,J.useState)({email:``,name:``,password:``,roleId:``}),o=s({mutationFn:()=>c.users.invite({...i}),onSuccess:()=>{V.success(`User invited`),t(!1),a({email:``,name:``,password:``,roleId:``}),r()},onError:e=>V.error(e.message)});return(0,Y.jsx)(b,{open:e,onOpenChange:t,children:(0,Y.jsxs)(d,{children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:`Invite User`})}),(0,Y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),o.mutate()},className:`space-y-4`,children:[(0,Y.jsx)(T,{placeholder:`Name`,value:i.name,onChange:e=>a(t=>({...t,name:e.target.value})),required:!0}),(0,Y.jsx)(T,{placeholder:`Email`,type:`email`,value:i.email,onChange:e=>a(t=>({...t,email:e.target.value})),required:!0}),(0,Y.jsx)(T,{placeholder:`Password (min 8 chars)`,type:`password`,value:i.password,onChange:e=>a(t=>({...t,password:e.target.value})),required:!0,minLength:8}),(0,Y.jsxs)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,value:i.roleId,onChange:e=>a(t=>({...t,roleId:e.target.value})),required:!0,children:[(0,Y.jsx)(`option`,{value:``,children:`Select role`}),n.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.name},e.id))]}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,type:`button`,onClick:()=>t(!1),children:`Cancel`}),(0,Y.jsx)(S,{type:`submit`,disabled:o.isPending,children:o.isPending?`Inviting...`:`Invite`})]})]})]})})}function Z({user:e,onOpenChange:t,roles:n,onSuccess:r}){let[i,a]=(0,J.useState)({name:e.name,email:e.email,roleId:e.roleId}),o=s({mutationFn:()=>c.users.update(e.id,i),onSuccess:()=>{V.success(`User updated`),t(!1),r()},onError:e=>V.error(e.message)});return(0,Y.jsx)(b,{open:!0,onOpenChange:t,children:(0,Y.jsxs)(d,{children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:`Edit User`})}),(0,Y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),o.mutate()},className:`space-y-4`,children:[(0,Y.jsx)(T,{placeholder:`Name`,value:i.name,onChange:e=>a(t=>({...t,name:e.target.value})),required:!0}),(0,Y.jsx)(T,{placeholder:`Email`,type:`email`,value:i.email,onChange:e=>a(t=>({...t,email:e.target.value})),required:!0}),(0,Y.jsx)(`select`,{className:`flex h-9 w-full rounded-md border border-input bg-background px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring`,value:i.roleId,onChange:e=>a(t=>({...t,roleId:e.target.value})),required:!0,disabled:e.roleName===`owner`,children:n.map(e=>(0,Y.jsx)(`option`,{value:e.id,children:e.name},e.id))}),e.roleName===`owner`&&(0,Y.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Owner role cannot be changed`}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,type:`button`,onClick:()=>t(!1),children:`Cancel`}),(0,Y.jsx)(S,{type:`submit`,disabled:o.isPending,children:o.isPending?`Saving...`:`Save`})]})]})]})})}var ge=[`workflow`,`credential`,`agent`,`team`,`user`,`settings`,`analytics`,`memory`,`command`,`mcp`],Q=[`read`,`create`,`update`,`delete`,`execute`];function _e(){let e=a(),[t,n]=(0,J.useState)(!1),[r,i]=(0,J.useState)(null),[u,f]=(0,J.useState)(null),{data:p,isLoading:h}=o({queryKey:[`roles`],queryFn:()=>c.roles.list()}),v=s({mutationFn:e=>c.roles.delete(e),onSuccess:()=>{e.invalidateQueries({queryKey:[`roles`]}),V.success(`Role deleted`),f(null)},onError:e=>V.error(e.message)}),y=p?.roles??[];return(0,Y.jsxs)(`div`,{className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`h2`,{className:`text-lg font-semibold`,children:`Roles`}),(0,Y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Manage roles and their permissions`})]}),(0,Y.jsxs)(S,{className:`gap-2`,onClick:()=>n(!0),children:[(0,Y.jsx)(R,{className:`h-4 w-4`}),` Create Role`]})]}),h?(0,Y.jsx)(`div`,{className:`text-muted-foreground text-sm`,children:`Loading roles...`}):(0,Y.jsx)(`div`,{className:`space-y-3`,children:y.map(e=>(0,Y.jsx)(m,{children:(0,Y.jsxs)(g,{className:`p-4 flex items-center justify-between`,children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-3`,children:[e.isSystem?(0,Y.jsx)(W,{className:`h-4 w-4 text-muted-foreground`}):(0,Y.jsx)(P,{className:`h-4 w-4 text-muted-foreground`}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium`,children:e.name}),e.isSystem&&(0,Y.jsx)(x,{variant:`outline`,className:`text-xs`,children:`System`})]}),(0,Y.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[e.description??`No description`,` · `,e.permissions.length,` permissions · `,e.userCount,` user`,e.userCount===1?``:`s`]})]})]}),(0,Y.jsx)(`div`,{className:`flex gap-1`,children:!e.isSystem&&(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>i(e),children:(0,Y.jsx)(L,{className:`h-3.5 w-3.5`})}),(0,Y.jsx)(S,{variant:`ghost`,size:`sm`,onClick:()=>f(e),children:(0,Y.jsx)(I,{className:`h-3.5 w-3.5 text-destructive`})})]})})]})},e.id))}),(0,Y.jsx)(b,{open:!!u,onOpenChange:()=>f(null),children:(0,Y.jsxs)(d,{children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:`Delete role`})}),(0,Y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Are you sure you want to delete the role `,(0,Y.jsx)(`strong`,{children:u?.name}),`?`,(u?.userCount??0)>0&&(0,Y.jsxs)(`span`,{className:`text-destructive`,children:[` This role is assigned to `,u?.userCount,` user(s). Reassign them first.`]})]}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,onClick:()=>f(null),children:`Cancel`}),(0,Y.jsx)(S,{variant:`destructive`,onClick:()=>u&&v.mutate(u.id),disabled:v.isPending||(u?.userCount??0)>0,children:v.isPending?`Deleting...`:`Delete`})]})]})}),(0,Y.jsx)($,{open:t,onOpenChange:n,onSuccess:()=>e.invalidateQueries({queryKey:[`roles`]})}),r&&(0,Y.jsx)($,{role:r,open:!0,onOpenChange:e=>!e&&i(null),onSuccess:()=>{e.invalidateQueries({queryKey:[`roles`]}),i(null)}})]})}function $({role:e,open:t,onOpenChange:n,onSuccess:r}){let i=!!e,[a,o]=(0,J.useState)(e?.name??``),[u,f]=(0,J.useState)(e?.description??``),[p,m]=(0,J.useState)(()=>{let t={};if(e)for(let n of e.permissions)t[`${n.entity}:${n.action}`]={entity:n.entity,action:n.action,scope:n.scope};return t});function h(e,t){let n=`${e}:${t}`;m(r=>{let i={...r};return i[n]?delete i[n]:i[n]={entity:e,action:t,scope:`all`},i})}function g(e,t){let n=`${e}:${t}`;m(e=>{let t={...e};return t[n]&&(t[n]={...t[n],scope:t[n].scope===`all`?`own`:`all`}),t})}let v=s({mutationFn:()=>{let t=Object.values(p);return i?c.roles.update(e.id,{name:a,description:u,permissions:t}):c.roles.create({name:a,description:u,permissions:t})},onSuccess:()=>{V.success(i?`Role updated`:`Role created`),n(!1),r()},onError:e=>V.error(e.message)}),y=i?`Save`:`Create`;return(0,Y.jsx)(b,{open:t,onOpenChange:n,children:(0,Y.jsxs)(d,{className:`max-w-3xl max-h-[80vh] overflow-y-auto`,children:[(0,Y.jsx)(C,{children:(0,Y.jsx)(l,{children:i?`Edit Role`:`Create Role`})}),(0,Y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),v.mutate()},className:`space-y-4`,children:[(0,Y.jsxs)(`div`,{className:`grid grid-cols-2 gap-4`,children:[(0,Y.jsx)(T,{placeholder:`Role name`,value:a,onChange:e=>o(e.target.value),required:!0}),(0,Y.jsx)(T,{placeholder:`Description (optional)`,value:u,onChange:e=>f(e.target.value)})]}),(0,Y.jsxs)(`div`,{children:[(0,Y.jsx)(`p`,{className:`text-sm font-medium mb-2`,children:`Permissions`}),(0,Y.jsx)(`div`,{className:`border rounded-md overflow-hidden`,children:(0,Y.jsxs)(`table`,{className:`w-full text-sm`,children:[(0,Y.jsx)(`thead`,{children:(0,Y.jsxs)(`tr`,{className:`border-b bg-muted/50`,children:[(0,Y.jsx)(`th`,{className:`text-left p-2 font-medium`,children:`Entity`}),Q.map(e=>(0,Y.jsx)(`th`,{className:`text-center p-2 font-medium capitalize`,children:e},e))]})}),(0,Y.jsx)(`tbody`,{children:ge.map(e=>(0,Y.jsxs)(`tr`,{className:`border-b last:border-0`,children:[(0,Y.jsx)(`td`,{className:`p-2 font-mono text-xs`,children:e}),Q.map(t=>{let n=p[`${e}:${t}`];return(0,Y.jsx)(`td`,{className:`text-center p-2`,children:(0,Y.jsxs)(`div`,{className:`flex flex-col items-center gap-0.5`,children:[(0,Y.jsx)(`input`,{type:`checkbox`,checked:!!n,onChange:()=>h(e,t),className:`h-4 w-4`}),n&&(0,Y.jsx)(`button`,{type:`button`,onClick:()=>g(e,t),className:`text-[10px] text-muted-foreground hover:text-foreground`,children:n.scope})]})},t)})]},e))})]})})]}),(0,Y.jsxs)(_,{children:[(0,Y.jsx)(S,{variant:`outline`,type:`button`,onClick:()=>n(!1),children:`Cancel`}),(0,Y.jsx)(S,{type:`submit`,disabled:v.isPending,children:v.isPending?`Saving...`:y})]})]})]})})}export{oe as Settings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`shield`,[[`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`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`fingerprint-pattern`,[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]]),n=e(`shield-check`,[[`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`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as e}from"./src-
|
|
1
|
+
import{F as e}from"./src-CaF63bXY.js";var t=e(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),n=e(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),r=e(`shuffle`,[[`path`,{d:`m18 14 4 4-4 4`,key:`10pe0f`}],[`path`,{d:`m18 2 4 4-4 4`,key:`pucp1d`}],[`path`,{d:`M2 18h1.973a4 4 0 0 0 3.3-1.7l5.454-8.6a4 4 0 0 1 3.3-1.7H22`,key:`1ailkh`}],[`path`,{d:`M2 6h1.972a4 4 0 0 1 3.6 2.2`,key:`km57vx`}],[`path`,{d:`M22 18h-6.041a4 4 0 0 1-3.3-1.8l-.359-.45`,key:`os18l9`}]]);export{n,t as r,r as t};
|