@qredence/fleet 0.9.0 → 0.10.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/CHANGELOG.md +59 -0
- package/dist/web/client/assets/{agents-CGjUBYX7.js → agents-BMQXA18L.js} +2 -2
- package/dist/web/client/assets/{agents-page-CTuFJL9H.js → agents-page-D2soW46O.js} +1 -1
- package/dist/web/client/assets/{chat-queries-CfZiupub.js → chat-queries-ty76G6rK.js} +1 -1
- package/dist/web/client/assets/{connectors-CFxLqG2x.js → connectors-E4KW6hBL.js} +2 -2
- package/dist/web/client/assets/{connectors-page-DQJdoAnl.js → connectors-page-CDzzjCIJ.js} +1 -1
- package/dist/web/client/assets/globals-DDDleTbS.css +2 -0
- package/dist/web/client/assets/{index-C9FHZDGw.js → index-Cf8tRpHL.js} +2 -2
- package/dist/web/client/assets/{mcp-connections-section-DEo6Kemv.js → mcp-connections-section-BsNhp1b2.js} +2 -2
- package/dist/web/client/assets/routes--tnF7d6H.js +14 -0
- package/dist/web/client/assets/settings-dialog-BomLOETY.js +3 -0
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-B6ne-00G-OFX7UD4K.js → _tanstack-start-manifest_v-Io433TLr-YWPNQWQI.js} +7 -7
- package/dist/web/server/{agents-BwzqhPjK-ANFHE5AG.js → agents-DOgCHixY-KUZP2VDO.js} +2 -2
- package/dist/web/server/{agents-page-DEqPV-eG-BR5MR74O.js → agents-page-BdiR9H8w-M6X6SXMF.js} +3 -3
- package/dist/web/server/{artifacts-panel-DLO8OfXb-B2ZWCDFP.js → artifacts-panel-cYqS54cM-K6SF3K6W.js} +5 -5
- package/dist/web/server/{chat-command-palette-CaDQAMAu-KDH7BTDS.js → chat-command-palette-BDnwcymZ-DSTFIAOD.js} +5 -5
- package/dist/web/server/{chunk-HUHUPGHT.js → chunk-2OC2FKHR.js} +5 -5
- package/dist/web/server/{chunk-V2GCVTDP.js → chunk-37EK2TYH.js} +33 -48
- package/dist/web/server/{chunk-TOJA3X5N.js → chunk-BLGKLQJG.js} +16 -5
- package/dist/web/server/{chunk-TQ2RECTH.js → chunk-C5XHGLET.js} +1 -1
- package/dist/web/server/{chunk-B5FKCW75.js → chunk-FI3UF2GW.js} +4 -4
- package/dist/web/server/{chunk-UDUG3MYZ.js → chunk-NSFKPEFI.js} +2 -2
- package/dist/web/server/{chunk-KDCSEISZ.js → chunk-NZCEQWK2.js} +2 -1
- package/dist/web/server/{chunk-VM3U6PUU.js → chunk-QOZCYKMA.js} +2 -2
- package/dist/web/server/{chunk-6AFVCERK.js → chunk-RHJEOG37.js} +4 -4
- package/dist/web/server/{chunk-TTNONWZZ.js → chunk-W2GI7NRX.js} +893 -672
- package/dist/web/server/{chunk-5IE54MRG.js → chunk-W7GGECTL.js} +3 -3
- package/dist/web/server/{connectors-C0xm91Ss-DJVBGD73.js → connectors-Dv_uPdv0-2X5VWQXK.js} +2 -2
- package/dist/web/server/{connectors-page-B6tJNZ6c-R5K4NSAT.js → connectors-page-DW75T-uH-EKRHUZ6K.js} +4 -4
- package/dist/web/server/{create-project-dialog-PFPHHWIV-GH7JR5IK.js → create-project-dialog-BS5Sva46-BO4RLW2Q.js} +5 -5
- package/dist/web/server/{openui-renderer-B9D8-Av--LFZP4U5V.js → openui-renderer-Q31y65CQ-QNVSP4NN.js} +4 -4
- package/dist/web/server/{resources-panel-CTzOOKPz-5G6RS2D6.js → resources-panel-CH8sG0Od-4BZN6SLY.js} +6 -6
- package/dist/web/server/{router-CnBux_Ld-YTVBMJFL.js → router-8EzTM9Eq-COVGJKKX.js} +2 -2
- package/dist/web/server/{routes-BUGzvQoO-WW43X7W2.js → routes-88H0fiN3-WIAZJ3RT.js} +4 -4
- package/dist/web/server/server.js +2 -2
- package/dist/web/server/{session-activity-panel-f0d3fCm7-I6L5IKFQ.js → session-activity-panel-CgSOde03-B5RCAGB4.js} +6 -6
- package/dist/web/server/{session-reasoning-panel-QIt_xjP0-FKJWMNHO.js → session-reasoning-panel-Dmny6YTk-D3HQV2YB.js} +5 -5
- package/dist/web/server/{session-tool-renderer-Cg_ZPHxS-BNQKNJNZ.js → session-tool-renderer-BrnTO2w3-V6EE6AB2.js} +5 -5
- package/dist/web/server/{session-tree-panel-B--el8O5-NZOZJM5L.js → session-tree-panel-BEqR_cAJ-TZS7VRCB.js} +5 -5
- package/dist/web/server/{settings-dialog-D_eJN2ia-W47Y474K.js → settings-dialog-DkesVBrS-BAAA3YNU.js} +145 -66
- package/dist/web/server/{subagent-chat-panel-C9nWP21E-D5C2TTYD.js → subagent-chat-panel-Bfmt1bCE-DKDVH3NJ.js} +8 -8
- package/dist/web/server/{subagents-panel-fAKvBNRG-O7QHXNE2.js → subagents-panel-ChJDDvad-GNCHDTPB.js} +8 -8
- package/dist/web/server/{workspace-panel-CZMNMU63-SYOSM3B7.js → workspace-panel-Cij_JylD-WPYSV5FA.js} +6 -6
- package/package.json +1 -1
- package/dist/web/client/assets/globals-DJhWyayo.css +0 -2
- package/dist/web/client/assets/routes-ja_liP8Z.js +0 -14
- package/dist/web/client/assets/settings-dialog-DiikSLhF.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{t as i}from"./select-DYh951qi.js";import{t as a}from"./createLucideIcon-CQY2ECfR.js";import{t as o}from"./loader-circle-BmKYM_C4.js";import{t as s}from"./plug-wCz-036u.js";import{t as c}from"./plus-DUP2JPVG.js";import{t as l}from"./rotate-ccw-DLkfsmG9.js";import{t as u}from"./trash-sm2UyOxe.js";import{t as d}from"./button-CWYjn8Zk.js";import{n as f,t as p}from"./alert-CzWGeumf.js";import{t as m}from"./input-CBoTMPC_.js";import{a as h,n as g,r as _,t as v}from"./switch-BrxDfsX6.js";import{f as y,o as b}from"./tokens-DinEQBG4.js";import{t as x}from"./spinner-B5TaKP7k.js";import{t as S}from"./notify-BIL0-CGy.js";var C={name:`save`,size:24,node:[[`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`}]]};C.node;var w=a(C),T=e(t(),1),E=n();function D({className:e,interactive:t,padding:n,tone:i,...a}){return(0,E.jsx)(`div`,{className:r(y({interactive:t,padding:n,tone:i}),e),...a})}function O({icon:e,title:t,subtitle:n,trailing:i,className:a,interactive:o=!0,tone:s=`default`,truncateSubtitle:c=!0,truncateTitle:l=!0}){return(0,E.jsxs)(D,{tone:s,padding:`md`,interactive:o,className:r(`items-center gap-3`,a),children:[e?(0,E.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-md border border-border/40 bg-background/60 text-foreground/70`,children:e}):null,(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`div`,{className:r(`text-sm font-medium text-foreground`,l&&`truncate`),children:t}),n?(0,E.jsx)(`div`,{className:r(`mt-0.5 text-xs text-muted-foreground`,c?`truncate`:`leading-normal`),children:n}):null]}),i?(0,E.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:i}):null]})}function k({actions:e,children:t,description:n,title:r}){return(0,E.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h3`,{className:`text-lg font-medium text-balance`,children:r}),(0,E.jsx)(`p`,{className:`mt-1 text-sm text-pretty text-muted-foreground`,children:n})]}),e?(0,E.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5 pt-0.5`,children:e}):null]}),(0,E.jsx)(`div`,{className:`flex flex-col gap-3`,children:t})]})}function A({dirty:e,disabled:t,onRevert:n,onSave:i,saving:a}){return(0,E.jsxs)(E.Fragment,{children:[e?(0,E.jsx)(d,{type:`button`,variant:`ghost`,size:`icon-compact`,className:`text-muted-foreground transition-transform active:scale-[0.96]`,disabled:t||a,onClick:n,"aria-label":`Revert changes`,children:(0,E.jsx)(l,{})}):null,(0,E.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,className:r(b,`transition-transform active:scale-[0.96]`,e&&`border-primary/30 text-primary`),disabled:!e||t||a,onClick:i,children:[a?(0,E.jsx)(o,{className:`animate-spin`,"data-icon":`inline-start`}):(0,E.jsx)(w,{"data-icon":`inline-start`}),`Commit`]})]})}function j({className:e,...t}){return(0,E.jsx)(`textarea`,{"data-slot":`textarea`,className:r(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function M(e){switch(e.status){case`connected`:return`Connected`;case`anonymous`:return`Available without sign-in`;case`needs_auth`:return`Sign-in required`;case`disabled`:return`Disabled`;default:return e.status}}function N(e){let t=e.transport===`http`?e.url:e.commandPreview;return[e.source===`builtin`?`Built-in`:`User`,e.transport===`http`?`HTTP`:`stdio`,M(e),t].filter(e=>!!e).join(` · `)}function P({connections:e,description:t=`Connect built-in and user MCP servers. Tokens stay on the server; this list only shows status and environment-variable names.`,isLoading:n,isPending:r,onOAuth:a,onRemove:o,onUpsert:l,title:y=`MCP`}){let[b,C]=(0,T.useState)(!1),[w,D]=(0,T.useState)(`http`),[A,M]=(0,T.useState)(``),[P,F]=(0,T.useState)(``),[I,L]=(0,T.useState)(!0),[R,z]=(0,T.useState)(``),[B,V]=(0,T.useState)(``),[H,U]=(0,T.useState)(``),[W,G]=(0,T.useState)(``),[K,q]=(0,T.useState)(``),[J,Y]=(0,T.useState)(null),X=()=>{M(``),F(``),L(!0),z(``),V(``),U(``),G(``),q(``),D(`http`),C(!1)},Z=async()=>{if(!l)return;let e=A.trim();try{if(w===`http`)await l({name:e,transport:`http`,url:P.trim(),...!I&&R.trim()?{bearerTokenEnvVar:R.trim()}:{oauth:!0},force:!0});else{let t=H.split(/\s+/).map(e=>e.trim()).filter(Boolean),n=K.split(`
|
|
2
|
-
`).map(e=>e.trim()).filter(Boolean).flatMap(e=>{let t=e.indexOf(`=`);if(t<=0)return[];let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return!n||!r?[]:[{child:n,source:r}]});await l({name:e,transport:`stdio`,command:B.trim(),...t.length>0?{args:t}:{},...W.trim()?{cwd:W.trim()}:{},...n.length>0?{env:n}:{},force:!0})}S.success(`MCP connection saved`),X()}catch(e){S.error(e instanceof Error?e.message:`Could not save MCP connection`)}},Q=async e=>{if(o)try{await o({name:e}),S.success(`Removed ${e}`),Y(null)}catch(e){S.error(e instanceof Error?e.message:`Could not remove MCP connection`)}},$=async e=>{if(a)try{await a({name:e,action:`logout`}),S.success(`Signed out of ${e}`)}catch(e){S.error(e instanceof Error?e.message:`Could not sign out`)}};return(0,E.jsxs)(k,{title:y,description:t,actions:(0,E.jsxs)(d,{type:`button`,size:`compact`,variant:`outline`,disabled:r||b,onClick:()=>C(!0),children:[(0,E.jsx)(c,{"data-icon":`inline-start`}),`Add server`]}),children:[n?(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,E.jsx)(x,{className:`size-3.5`}),`Loading MCP connections…`]}):null,b?(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border p-4`,children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Name`}),(0,E.jsx)(m,{value:A,onChange:e=>M(e.target.value),"aria-label":`MCP server name`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Transport`}),(0,E.jsx)(i,{value:w,onValueChange:e=>D(e),options:[{label:`HTTP`,value:`http`},{label:`stdio`,value:`stdio`}]})]}),w===`http`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`URL`}),(0,E.jsx)(m,{value:P,onChange:e=>F(e.target.value),"aria-label":`MCP server URL`})]}),(0,E.jsxs)(g,{orientation:`horizontal`,className:`items-center justify-between`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(h,{children:`OAuth`}),(0,E.jsx)(_,{children:`Sign in from Prime Agent's terminal after saving this server.`})]}),(0,E.jsx)(v,{checked:I,onCheckedChange:e=>{L(e),e&&z(``)},"aria-label":`Use OAuth`})]}),I?null:(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Bearer token environment variable`}),(0,E.jsx)(m,{value:R,onChange:e=>z(e.target.value),"aria-label":`Bearer token environment variable`,placeholder:`MCP_BEARER_TOKEN`})]})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Command`}),(0,E.jsx)(m,{value:B,onChange:e=>V(e.target.value),"aria-label":`MCP command`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Arguments`}),(0,E.jsx)(m,{value:H,onChange:e=>U(e.target.value),"aria-label":`MCP command arguments`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Working directory`}),(0,E.jsx)(m,{value:W,onChange:e=>G(e.target.value),"aria-label":`MCP working directory`}),(0,E.jsx)(_,{children:`Must stay inside the current workspace.`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Environment mappings`}),(0,E.jsx)(j,{value:K,onChange:e=>q(e.target.value),"aria-label":`MCP environment mappings`,placeholder:`CHILD=SOURCE`}),(0,E.jsx)(_,{children:`One CHILD=SOURCE pair per line. Only variable names are stored.`})]})]}),(0,E.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,onClick:X,children:`Cancel`}),(0,E.jsxs)(d,{type:`button`,size:`compact`,disabled:r||!A.trim(),onClick:()=>void Z(),children:[r?(0,E.jsx)(x,{"data-icon":`inline-start`}):null,`Save`]})]})]}):null,!n&&e.length===0&&!b?(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No MCP connections yet.`}):null,(0,E.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(O,{icon:(0,E.jsx)(s,{className:`size-4`}),title:e.label,subtitle:N(e),trailing:(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e.usesOAuth&&e.status!==`needs_auth`?(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,disabled:r||!a,onClick:()=>{$(e.name)},children:`Sign out`}):null,e.source===`user`?J===e.name?(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`destructive`,disabled:r,onClick:()=>{Q(e.name)},children:`Confirm remove`}):(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,disabled:r||!o,"aria-label":`Remove ${e.name}`,onClick:()=>Y(e.name),children:(0,E.jsx)(u,{className:`size-3.5`})}):null]})}),e.error?(0,E.jsx)(p,{className:`px-3 py-2`,children:(0,E.jsx)(f,{className:`text-xs text-pretty`,children:e.error})}):null,e.usesOAuth&&e.status===`needs_auth`?(0,E.jsx)(p,{className:`px-3 py-2`,children:(0,E.jsxs)(f,{className:`text-xs text-pretty`,children:[`
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{t}from"./react-Cvdyeg_0.js";import{t as n}from"./jsx-runtime-NZYk81nU.js";import{t as r}from"./utils-oBThwhjm.js";import{t as i}from"./select-DYh951qi.js";import{t as a}from"./createLucideIcon-CQY2ECfR.js";import{t as o}from"./loader-circle-BmKYM_C4.js";import{t as s}from"./plug-wCz-036u.js";import{t as c}from"./plus-DUP2JPVG.js";import{t as l}from"./rotate-ccw-DLkfsmG9.js";import{t as u}from"./trash-sm2UyOxe.js";import{t as d}from"./button-CWYjn8Zk.js";import{n as f,t as p}from"./alert-CzWGeumf.js";import{t as m}from"./input-CBoTMPC_.js";import{a as h,n as g,r as _,t as v}from"./switch-BrxDfsX6.js";import{f as y,o as b}from"./tokens-DinEQBG4.js";import{t as x}from"./spinner-B5TaKP7k.js";import{t as S}from"./notify-BIL0-CGy.js";var C={name:`save`,size:24,node:[[`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`}]]};C.node;var w=a(C),T=e(t(),1),E=n();function D({className:e,interactive:t,padding:n,tone:i,...a}){return(0,E.jsx)(`div`,{className:r(y({interactive:t,padding:n,tone:i}),e),...a})}function O({icon:e,title:t,subtitle:n,trailing:i,className:a,interactive:o=!0,tone:s=`default`,truncateSubtitle:c=!0,truncateTitle:l=!0}){return(0,E.jsxs)(D,{tone:s,padding:`md`,interactive:o,className:r(`items-center gap-3`,a),children:[e?(0,E.jsx)(`div`,{className:`flex size-8 shrink-0 items-center justify-center rounded-md border border-border/40 bg-background/60 text-foreground/70`,children:e}):null,(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`div`,{className:r(`text-sm font-medium text-foreground`,l&&`truncate`),children:t}),n?(0,E.jsx)(`div`,{className:r(`mt-0.5 text-xs text-muted-foreground`,c?`truncate`:`leading-normal`),children:n}):null]}),i?(0,E.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:i}):null]})}function k({actions:e,children:t,description:n,title:r}){return(0,E.jsxs)(`div`,{className:`flex min-w-0 max-w-full flex-col gap-4 [overflow-wrap:anywhere]`,children:[(0,E.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,E.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,E.jsx)(`h3`,{className:`text-lg font-medium text-balance`,children:r}),(0,E.jsx)(`p`,{className:`mt-1 text-sm text-pretty text-muted-foreground`,children:n})]}),e?(0,E.jsx)(`div`,{className:`flex shrink-0 items-center gap-1.5 pt-0.5`,children:e}):null]}),(0,E.jsx)(`div`,{className:`flex flex-col gap-3`,children:t})]})}function A({dirty:e,disabled:t,onRevert:n,onSave:i,saving:a}){return(0,E.jsxs)(E.Fragment,{children:[e?(0,E.jsx)(d,{type:`button`,variant:`ghost`,size:`icon-compact`,className:`text-muted-foreground transition-transform active:scale-[0.96]`,disabled:t||a,onClick:n,"aria-label":`Revert changes`,children:(0,E.jsx)(l,{})}):null,(0,E.jsxs)(d,{type:`button`,variant:`outline`,size:`compact`,className:r(b,`transition-transform active:scale-[0.96]`,e&&`border-primary/30 text-primary`),disabled:!e||t||a,onClick:i,children:[a?(0,E.jsx)(o,{className:`animate-spin`,"data-icon":`inline-start`}):(0,E.jsx)(w,{"data-icon":`inline-start`}),`Commit`]})]})}function j({className:e,...t}){return(0,E.jsx)(`textarea`,{"data-slot":`textarea`,className:r(`flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function M(e){switch(e.status){case`connected`:return`Connected`;case`anonymous`:return`Available without sign-in`;case`needs_auth`:return`Sign-in required`;case`disabled`:return`Disabled`;default:return e.status}}function N(e){let t=e.transport===`http`?e.url:e.commandPreview;return[e.source===`builtin`?`Built-in`:`User`,e.transport===`http`?`HTTP`:`stdio`,M(e),t].filter(e=>!!e).join(` · `)}function P({connections:e,description:t=`Connect built-in and user MCP servers. Tokens stay on the server; this list only shows status and environment-variable names.`,isLoading:n,isPending:r,onOAuth:a,onRemove:o,onUpsert:l,title:y=`MCP`}){let[b,C]=(0,T.useState)(!1),[w,D]=(0,T.useState)(`http`),[A,M]=(0,T.useState)(``),[P,F]=(0,T.useState)(``),[I,L]=(0,T.useState)(!0),[R,z]=(0,T.useState)(``),[B,V]=(0,T.useState)(``),[H,U]=(0,T.useState)(``),[W,G]=(0,T.useState)(``),[K,q]=(0,T.useState)(``),[J,Y]=(0,T.useState)(null),X=()=>{M(``),F(``),L(!0),z(``),V(``),U(``),G(``),q(``),D(`http`),C(!1)},Z=async()=>{if(!l)return;let e=A.trim();try{if(w===`http`)await l({name:e,transport:`http`,url:P.trim(),...!I&&R.trim()?{bearerTokenEnvVar:R.trim()}:{oauth:!0},force:!0});else{let t=H.split(/\s+/).map(e=>e.trim()).filter(Boolean),n=K.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(Boolean).flatMap(e=>{let t=e.indexOf(`=`);if(t<=0)return[];let n=e.slice(0,t).trim(),r=e.slice(t+1).trim();return!n||!r?[]:[{child:n,source:r}]});await l({name:e,transport:`stdio`,command:B.trim(),...t.length>0?{args:t}:{},...W.trim()?{cwd:W.trim()}:{},...n.length>0?{env:n}:{},force:!0})}S.success(`MCP connection saved`),X()}catch(e){S.error(e instanceof Error?e.message:`Could not save MCP connection`)}},Q=async e=>{if(o)try{await o({name:e}),S.success(`Removed ${e}`),Y(null)}catch(e){S.error(e instanceof Error?e.message:`Could not remove MCP connection`)}},$=async e=>{if(a)try{await a({name:e,action:`logout`}),S.success(`Signed out of ${e}`)}catch(e){S.error(e instanceof Error?e.message:`Could not sign out`)}};return(0,E.jsxs)(k,{title:y,description:t,actions:(0,E.jsxs)(d,{type:`button`,size:`compact`,variant:`outline`,disabled:r||b,onClick:()=>C(!0),children:[(0,E.jsx)(c,{"data-icon":`inline-start`}),`Add server`]}),children:[n?(0,E.jsxs)(`div`,{className:`flex items-center gap-2 text-sm text-muted-foreground`,children:[(0,E.jsx)(x,{className:`size-3.5`}),`Loading MCP connections…`]}):null,b?(0,E.jsxs)(`div`,{className:`flex flex-col gap-3 rounded-xl border p-4`,children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Name`}),(0,E.jsx)(m,{value:A,onChange:e=>M(e.target.value),"aria-label":`MCP server name`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Transport`}),(0,E.jsx)(i,{value:w,onValueChange:e=>D(e),options:[{label:`HTTP`,value:`http`},{label:`stdio`,value:`stdio`}]})]}),w===`http`?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`URL`}),(0,E.jsx)(m,{value:P,onChange:e=>F(e.target.value),"aria-label":`MCP server URL`})]}),(0,E.jsxs)(g,{orientation:`horizontal`,className:`items-center justify-between`,children:[(0,E.jsxs)(`div`,{children:[(0,E.jsx)(h,{children:`OAuth`}),(0,E.jsx)(_,{children:`Sign in from Prime Agent's terminal after saving this server.`})]}),(0,E.jsx)(v,{checked:I,onCheckedChange:e=>{L(e),e&&z(``)},"aria-label":`Use OAuth`})]}),I?null:(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Bearer token environment variable`}),(0,E.jsx)(m,{value:R,onChange:e=>z(e.target.value),"aria-label":`Bearer token environment variable`,placeholder:`MCP_BEARER_TOKEN`})]})]}):(0,E.jsxs)(E.Fragment,{children:[(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Command`}),(0,E.jsx)(m,{value:B,onChange:e=>V(e.target.value),"aria-label":`MCP command`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Arguments`}),(0,E.jsx)(m,{value:H,onChange:e=>U(e.target.value),"aria-label":`MCP command arguments`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Working directory`}),(0,E.jsx)(m,{value:W,onChange:e=>G(e.target.value),"aria-label":`MCP working directory`}),(0,E.jsx)(_,{children:`Must stay inside the current workspace.`})]}),(0,E.jsxs)(g,{children:[(0,E.jsx)(h,{children:`Environment mappings`}),(0,E.jsx)(j,{value:K,onChange:e=>q(e.target.value),"aria-label":`MCP environment mappings`,placeholder:`CHILD=SOURCE`}),(0,E.jsx)(_,{children:`One CHILD=SOURCE pair per line. Only variable names are stored.`})]})]}),(0,E.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,onClick:X,children:`Cancel`}),(0,E.jsxs)(d,{type:`button`,size:`compact`,disabled:r||!A.trim(),onClick:()=>void Z(),children:[r?(0,E.jsx)(x,{"data-icon":`inline-start`}):null,`Save`]})]})]}):null,!n&&e.length===0&&!b?(0,E.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`No MCP connections yet.`}):null,(0,E.jsx)(`div`,{className:`flex flex-col gap-2`,children:e.map(e=>(0,E.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,E.jsx)(O,{icon:(0,E.jsx)(s,{className:`size-4`}),title:e.label,subtitle:N(e),trailing:(0,E.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[e.usesOAuth&&e.status!==`needs_auth`?(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,disabled:r||!a,onClick:()=>{$(e.name)},children:`Sign out`}):null,e.source===`user`?J===e.name?(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`destructive`,disabled:r,onClick:()=>{Q(e.name)},children:`Confirm remove`}):(0,E.jsx)(d,{type:`button`,size:`compact`,variant:`ghost`,disabled:r||!o,"aria-label":`Remove ${e.name}`,onClick:()=>Y(e.name),children:(0,E.jsx)(u,{className:`size-3.5`})}):null]})}),e.error?(0,E.jsx)(p,{className:`px-3 py-2`,children:(0,E.jsx)(f,{className:`text-xs text-pretty`,children:e.error})}):null,e.usesOAuth&&e.status===`needs_auth`?(0,E.jsx)(p,{className:`px-3 py-2`,children:(0,E.jsxs)(f,{className:`text-xs text-pretty`,children:[`Sign-in has to run inside Prime Agent. In a terminal, start Prime Agent against the same account as Fleet, then run`,` `,(0,E.jsxs)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-caption text-foreground`,children:[`/mcp login `,e.name]}),`. Fleet picks the credential up on its next refresh, so a restart is not needed. If Fleet uses a non-default account directory, start Prime Agent with the same`,` `,(0,E.jsx)(`code`,{className:`rounded bg-muted px-1 py-0.5 font-mono text-caption text-foreground`,children:`PRIME_AGENT_CODING_AGENT_DIR`}),` `,`it uses.`]})}):null]},`${e.source}:${e.name}`))})]})}export{D as a,O as i,A as n,k as r,P as t};
|