@testver/testver 1.4.3 → 1.5.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/LICENSE +88 -69
- package/README.md +6 -2
- package/bin/testver.js +9 -1
- package/dist/index.js +52200 -35695
- package/package.json +179 -178
- package/src/ui/static/agents/antigravity.svg +76 -0
- package/src/ui/static/agents/codex.svg +3 -0
- package/src/ui/static/agents/gemini.svg +1 -0
- package/src/ui/static/agents/opencode.svg +4 -0
- package/src/ui/static/agents/vscode.svg +17 -0
- package/src/ui/static/assets/{AIPanel-KQFq4c0Q.js → AIPanel-RWO8Cd9w.js} +32 -32
- package/src/ui/static/assets/{AIRecordPanel-CAs8fXyS.js → AIRecordPanel-DnreS585.js} +40 -40
- package/src/ui/static/assets/{AIStreamUI-p_sMTEDQ.js → AIStreamUI-C1gHJtlF.js} +9 -9
- package/src/ui/static/assets/{AITestGenPage-CHaHfmu4.js → AITestGenPage-C8bWUelu.js} +5 -5
- package/src/ui/static/assets/{APITestingPage-BSGJY_hd.js → APITestingPage-DwL67hqL.js} +19 -19
- package/src/ui/static/assets/AboutPage-CynLB95E.js +1 -0
- package/src/ui/static/assets/AccessTokensTab-BdevOmpE.js +1 -0
- package/src/ui/static/assets/AdvancedPage-BeM7aB8b.js +3 -0
- package/src/ui/static/assets/{AnalyticsPage-Lm8noJqC.js → AnalyticsPage-C5ddYfRk.js} +1 -1
- package/src/ui/static/assets/AuditLogPage-DYcUdJoj.js +1 -0
- package/src/ui/static/assets/{ChangesSummary-Cu0_4Ucf.js → ChangesSummary-BjNMwGIZ.js} +3 -3
- package/src/ui/static/assets/{CodeMapPage-uEjuo3fk.js → CodeMapPage-BQOEtv-R.js} +3 -3
- package/src/ui/static/assets/{ConfirmDialog-DtotgVmI.js → ConfirmDialog-D_N9188T.js} +1 -1
- package/src/ui/static/assets/{CoveragePage-jNkQJA1P.js → CoveragePage-8bDSphY1.js} +2 -2
- package/src/ui/static/assets/{CronBuilder-D2fERHt9.js → CronBuilder-C7_JADb7.js} +1 -1
- package/src/ui/static/assets/{Dashboard-BaIj_IdQ.js → Dashboard-B22yRPyV.js} +1 -1
- package/src/ui/static/assets/{DefectsPage-DH0njYFG.js → DefectsPage-Arv4Ac-b.js} +72 -72
- package/src/ui/static/assets/{EmptyState-utxlJ0fu.js → EmptyState-BShNSbLf.js} +1 -1
- package/src/ui/static/assets/{ExportButton-ouKqn9CU.js → ExportButton-xrS_AnfS.js} +1 -1
- package/src/ui/static/assets/{FileViewer-mU3JloJ6.js → FileViewer-Bcr9T1jW.js} +18 -18
- package/src/ui/static/assets/{GitPage-TrX-RqNC.js → GitPage-DXL2Sv40.js} +12 -12
- package/src/ui/static/assets/{ImportExportPage-CIhK_raX.js → ImportExportPage-BcjzRd7T.js} +36 -36
- package/src/ui/static/assets/{JiraPushDialog-DgEZS-0u.js → JiraPushDialog-DNYU9Ce0.js} +1 -1
- package/src/ui/static/assets/{KpiTile-BHLE3HVj.js → KpiTile-BKlWqjgN.js} +1 -1
- package/src/ui/static/assets/{LiveExecutionView-CaIf7Jux.js → LiveExecutionView-1LlyEDEe.js} +1 -1
- package/src/ui/static/assets/{MediaModal-DNM45Uz2.js → MediaModal-Dyy_iHl9.js} +1 -1
- package/src/ui/static/assets/MobileRunPicker-Cf5rm469.js +1 -0
- package/src/ui/static/assets/MobileRunTarget-C4M4YJJh.js +6 -0
- package/src/ui/static/assets/{ModuleExplorer-rni7JbsL.js → ModuleExplorer-BKVbxFZK.js} +1 -1
- package/src/ui/static/assets/{OutputPage-Cn2WCpJ6.js → OutputPage-Bi-28tJi.js} +1 -1
- package/src/ui/static/assets/PipelinesPanel-BtO3iSJ4.js +1 -0
- package/src/ui/static/assets/{ProfilePage-BKNdkSnx.js → ProfilePage-BgZ4VDC-.js} +1 -1
- package/src/ui/static/assets/{ProjectExplorer-5e7J8t-o.js → ProjectExplorer-BVGbmVP7.js} +1 -1
- package/src/ui/static/assets/{RemoteFileStrip-C1S2aclP.js → RemoteFileStrip-dzPInzgb.js} +1 -1
- package/src/ui/static/assets/{ReportCard-D4EElEe9.js → ReportCard-LOf1PXlb.js} +2 -2
- package/src/ui/static/assets/{ReportFullView-2w2ysKRg.js → ReportFullView-Ce4OI8lf.js} +1 -1
- package/src/ui/static/assets/{ReportsPage-9Fx-IEwV.js → ReportsPage-DFxCQ8cY.js} +48 -48
- package/src/ui/static/assets/{ResultsPage-DPkfGh-K.js → ResultsPage-DD-uj8gk.js} +115 -115
- package/src/ui/static/assets/{RunState-CRuS_bC2.js → RunState-DDwFB4tA.js} +1 -1
- package/src/ui/static/assets/{RunTargets-CPKBrefj.js → RunTargets-CkIpY3v3.js} +1 -1
- package/src/ui/static/assets/ScriptMappingPage-DQQoR6sR.js +1 -0
- package/src/ui/static/assets/{SearchableDevicePicker-DubIldKj.js → SearchableDevicePicker-CenIxD7b.js} +1 -1
- package/src/ui/static/assets/{SettingsPage-BuZrrlW2.js → SettingsPage-DAV_0y0m.js} +83 -83
- package/src/ui/static/assets/{SharedReportView-ig5hECRk.js → SharedReportView-CqSLFKT1.js} +1 -1
- package/src/ui/static/assets/{SourcesPage-BPkqRqkC.js → SourcesPage-BvqC9oKw.js} +14 -14
- package/src/ui/static/assets/TestExplorerPage-Bdnll77k.js +7 -0
- package/src/ui/static/assets/{TestManagementPage-DJiWpCne.js → TestManagementPage-CCNE688A.js} +10 -10
- package/src/ui/static/assets/{TestPlansPage-G1lvK1C0.js → TestPlansPage-T6D25i6-.js} +5 -5
- package/src/ui/static/assets/{TestverCreditsRing-CEBSy3w3.js → TestverCreditsRing-CoDk5eAS.js} +1 -1
- package/src/ui/static/assets/TestverMcpPage-Dte0qSXp.js +34 -0
- package/src/ui/static/assets/{UncommittedDiffViewer-FKvUZcRi.js → UncommittedDiffViewer-BNroxCoo.js} +2 -2
- package/src/ui/static/assets/{UserManagementPage-gDGhaHE4.js → UserManagementPage-BU4MuDJZ.js} +10 -10
- package/src/ui/static/assets/{WorkflowsPage-BACdnU-1.js → WorkflowsPage-BP5k7AqE.js} +83 -83
- package/src/ui/static/assets/clipboard-BIEd7Ccc.js +1 -0
- package/src/ui/static/assets/{hiddenLlmProviders-DzwaR-b9.js → hiddenLlmProviders-BPORgy-e.js} +1 -1
- package/src/ui/static/assets/index-BlA8ntjb.js +47 -0
- package/src/ui/static/assets/index-Co4_SlGD.css +1 -0
- package/src/ui/static/assets/{reportMeta-3kxT7BIT.js → reportMeta-B9ZRW6ts.js} +1 -1
- package/src/ui/static/assets/runSelected-BoPm1sz-.js +1 -0
- package/src/ui/static/assets/{useFeatureFlags-DrhvBp0C.js → useFeatureFlags-B4Otsv-N.js} +1 -1
- package/src/ui/static/assets/{useJiraConnector-Dwj69Rfh.js → useJiraConnector--JZhbYrT.js} +1 -1
- package/src/ui/static/assets/{useOwnership-C1CmzcvJ.js → useOwnership-BhPOiYzy.js} +1 -1
- package/src/ui/static/assets/useSuites-GN_K2mHc.js +1 -0
- package/src/ui/static/assets/{useTestExplorer-CUqC18DV.js → useTestExplorer-BGhkGHKy.js} +1 -1
- package/src/ui/static/assets/{useTestLifecycle-C2S_vaX2.js → useTestLifecycle-DX5ES6x8.js} +1 -1
- package/src/ui/static/assets/{useTestManagement-DW6AW2mt.js → useTestManagement-ommXjx0q.js} +2 -2
- package/src/ui/static/assets/{useTestResults-yjH1aUy-.js → useTestResults-DWjvm8gm.js} +1 -1
- package/src/ui/static/assets/{vendor-icons-D_Dmmj8d.js → vendor-icons-Cm92aSc5.js} +1426 -1416
- package/src/ui/static/index.html +479 -479
- package/src/ui/static/assets/AboutPage-CDa24SCJ.js +0 -1
- package/src/ui/static/assets/AdvancedPage-BqXP0FLg.js +0 -3
- package/src/ui/static/assets/AuditLogPage-BvldSIik.js +0 -1
- package/src/ui/static/assets/MobileRunPicker-DFKm6_nU.js +0 -1
- package/src/ui/static/assets/MobileRunTarget-DHDoDZ_F.js +0 -6
- package/src/ui/static/assets/PipelinesPanel-D6zWcLtD.js +0 -1
- package/src/ui/static/assets/ScriptMappingPage-C3K_uyf0.js +0 -1
- package/src/ui/static/assets/TestExplorerPage-C_jl93GR.js +0 -7
- package/src/ui/static/assets/index-D6sQYc_0.js +0 -47
- package/src/ui/static/assets/index-aInN0yoR.css +0 -1
- package/src/ui/static/assets/runSelected-WlgnZcSF.js +0 -1
- package/src/ui/static/assets/useSuites-V0AxZYex.js +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{r as C,j as t,L as F}from"./vendor-react-DOVfxdUy.js";import{a as me,u as te}from"./vendor-query-DkZSMtfn.js";import{bP as ge,bQ as he,o as ve,bR as xe}from"./index-BlA8ntjb.js";import{C as ue}from"./AccessTokensTab-BdevOmpE.js";import{C as ye}from"./ConfirmDialog-D_N9188T.js";import{c as fe}from"./clipboard-BIEd7Ccc.js";import{$ as je,c4 as we,O as be,c5 as Ce,p as ne,ah as G,ai as ae,i as ke,V as Ne,b5 as Se,a1 as se,a9 as Ae,X as $e}from"./vendor-icons-Cm92aSc5.js";import"./formatDate-T65-Y6Mi.js";const Ee={claude:{hex:"#D97757",mono:!1,path:"m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"},anthropic:{hex:"#191919",mono:!0,path:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"},gemini:{hex:"#8E75B2",mono:!1,path:"M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"},cursor:{hex:"#000000",mono:!0,path:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"},windsurf:{hex:"#0B100F",mono:!0,path:"M23.55 5.067c-1.2038-.002-2.1806.973-2.1806 2.1765v4.8676c0 .972-.8035 1.7594-1.7597 1.7594-.568 0-1.1352-.286-1.4718-.7659l-4.9713-7.1003c-.4125-.5896-1.0837-.941-1.8103-.941-1.1334 0-2.1533.9635-2.1533 2.153v4.8957c0 .972-.7969 1.7594-1.7596 1.7594-.57 0-1.1363-.286-1.4728-.7658L.4076 5.1598C.2822 4.9798 0 5.0688 0 5.2882v4.2452c0 .2147.0656.4228.1884.599l5.4748 7.8183c.3234.462.8006.8052 1.3509.9298 1.3771.313 2.6446-.747 2.6446-2.0977v-4.893c0-.972.7875-1.7593 1.7596-1.7593h.003a1.798 1.798 0 0 1 1.4718.7658l4.9723 7.0994c.4135.5905 1.05.941 1.8093.941 1.1587 0 2.1515-.9645 2.1515-2.153v-4.8948c0-.972.7875-1.7594 1.7596-1.7594h.194a.22.22 0 0 0 .2204-.2202v-4.622a.22.22 0 0 0-.2203-.2203Z"},jetbrains:{hex:"#000000",mono:!0,path:"M2.345 23.997A2.347 2.347 0 0 1 0 21.652V10.988C0 9.665.535 8.37 1.473 7.433l5.965-5.961A5.01 5.01 0 0 1 10.989 0h10.666A2.347 2.347 0 0 1 24 2.345v10.664a5.056 5.056 0 0 1-1.473 3.554l-5.965 5.965A5.017 5.017 0 0 1 13.007 24v-.003H2.345Zm8.969-6.854H5.486v1.371h5.828v-1.371ZM3.963 6.514h13.523v13.519l4.257-4.257a3.936 3.936 0 0 0 1.146-2.767V2.345c0-.678-.552-1.234-1.234-1.234H10.989a3.897 3.897 0 0 0-2.767 1.145L3.963 6.514Zm-.192.192L2.256 8.22a3.944 3.944 0 0 0-1.145 2.768v10.664c0 .678.552 1.234 1.234 1.234h10.666a3.9 3.9 0 0 0 2.767-1.146l1.512-1.511H3.771V6.706Z"},zed:{hex:"#084CCF",mono:!1,path:"M2.25 1.5a.75.75 0 0 0-.75.75v16.5H0V2.25A2.25 2.25 0 0 1 2.25 0h20.095c1.002 0 1.504 1.212.795 1.92L10.764 14.298h3.486V12.75h1.5v1.922a1.125 1.125 0 0 1-1.125 1.125H9.264l-2.578 2.578h11.689V9h1.5v9.375a1.5 1.5 0 0 1-1.5 1.5H5.185L2.562 22.5H21.75a.75.75 0 0 0 .75-.75V5.25H24v16.5A2.25 2.25 0 0 1 21.75 24H1.655C.653 24 .151 22.788.86 22.08L13.19 9.75H9.75v1.5h-1.5V9.375A1.125 1.125 0 0 1 9.375 8.25h5.314l2.625-2.625H5.625V15h-1.5V5.625a1.5 1.5 0 0 1 1.5-1.5h13.19L21.438 1.5z"},copilot:{hex:"#000000",mono:!0,path:"M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"},cline:{hex:"#18181B",mono:!0,path:"m23.365 13.556-1.442-2.895V8.994c0-2.764-2.218-5.002-4.954-5.002h-2.464c.178-.367.276-.779.276-1.213A2.77 2.77 0 0 0 12.018 0a2.77 2.77 0 0 0-2.763 2.779c0 .434.098.846.276 1.213H7.067c-2.736 0-4.954 2.238-4.954 5.002v1.667L.64 13.549c-.149.29-.149.636 0 .927l1.472 2.855v1.667C2.113 21.762 4.33 24 7.067 24h9.902c2.736 0 4.954-2.238 4.954-5.002V17.33l1.44-2.865c.143-.286.143-.622.002-.91m-12.854 2.36a2.27 2.27 0 0 1-2.261 2.273 2.27 2.27 0 0 1-2.261-2.273v-4.042A2.27 2.27 0 0 1 8.249 9.6a2.267 2.267 0 0 1 2.262 2.274zm7.285 0a2.27 2.27 0 0 1-2.26 2.273 2.27 2.27 0 0 1-2.262-2.273v-4.042A2.267 2.267 0 0 1 15.535 9.6a2.267 2.267 0 0 1 2.261 2.274z"},mcp:{hex:"#000000",mono:!0,path:"M13.85 0a4.16 4.16 0 0 0-2.95 1.217L1.456 10.66a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l9.442-9.442a2.49 2.49 0 0 1 3.541 0 2.49 2.49 0 0 1 0 3.541L8.59 12.97l-.1.1a.835.835 0 0 0 0 1.18.835.835 0 0 0 1.18 0l.1-.098 7.03-7.034a2.49 2.49 0 0 1 3.542 0l.049.05a2.49 2.49 0 0 1 0 3.54l-8.54 8.54a1.96 1.96 0 0 0 0 2.755l1.753 1.753a.835.835 0 0 0 1.18 0 .835.835 0 0 0 0-1.18l-1.753-1.753a.266.266 0 0 1 0-.394l8.54-8.54a4.185 4.185 0 0 0 0-5.9l-.05-.05a4.16 4.16 0 0 0-2.95-1.218c-.2 0-.401.02-.6.048a4.17 4.17 0 0 0-1.17-3.552A4.16 4.16 0 0 0 13.85 0m0 3.333a.84.84 0 0 0-.59.245L6.275 10.56a4.186 4.186 0 0 0 0 5.902 4.186 4.186 0 0 0 5.902 0L19.16 9.48a.835.835 0 0 0 0-1.18.835.835 0 0 0-1.18 0l-6.985 6.984a2.49 2.49 0 0 1-3.54 0 2.49 2.49 0 0 1 0-3.54l6.983-6.985a.835.835 0 0 0 0-1.18.84.84 0 0 0-.59-.245"}},Te={server:"https://testver.example.com",token:"tvpat_…",project:"/path/to/your/project",projectWin:"C:\\work\\shop",npx:!1,windows:"fold"},V=a=>a.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">"),r=a=>JSON.stringify(a,null,2),K=a=>`[${a.map(d=>JSON.stringify(d)).join(", ")}]`,f=a=>({code:a,lang:"sh",frame:"terminal"}),s=(a,d,i="json")=>({code:d,lang:i,title:a});function ce(a){const d=a.server.replace(/\/+$/,""),i=`${d}/mcp`,m=a.token,w=a.windows==="fold",A=a.windows===!0,k=a.npx?["npx","-y","@testver/testver"]:["testver"],L=e=>e?a.projectWin:a.project,g=e=>["mcp","--project",L(e)],h=()=>["mcp","--server",d],N=(e,v)=>v?["cmd","/c",...k,...e]:[...k,...e],n=(e,v,o={},u={})=>{const[b,...$]=N(e,v);return{...u,command:b,args:$,...o}},j=(e,v)=>N(e,v).join(" "),E=(e,v)=>{const[o,...u]=N(e,v),b=u.findIndex($=>$.startsWith("-"));return b<0?[o,...u].join(" "):[o,...u.slice(0,b),"--",...u.slice(b)].join(" ")},y={TESTVER_ACCESS_TOKEN:m},l=e=>e(A),T=`If the agent can’t start <code>${V(k[0])}</code> on Windows (it is a <code>.cmd</code> file), start it through <code>cmd</code>:`,p=e=>w?[{summary:"On Windows",text:T,snippets:[e(!0)]}]:[],x="Ask your agent: “What does Testver know about this project?” It answers from Testver’s <code>about</code> tool: the project, its test frameworks and what is on.",I=`<code>${V(i)}</code>`;return[{id:"claude-code",name:"Claude Code",kind:"CLI",icon:"claude",docs:"https://code.claude.com/docs/en/mcp",check:x,ways:[{way:"local",snippets:[l(e=>f(`claude mcp add testver -- ${j(g(e),e)}`))],extras:p(e=>f(`claude mcp add testver -- ${j(g(e),e)}`)),steps:["Run the command in a terminal. It adds Testver for this project; add <code>--scope user</code> for every project, or <code>--scope project</code> to share it with your team in <code>.mcp.json</code>.","Start Claude Code and run <code>/mcp</code>: <strong>testver</strong> shows as connected. Or run <code>claude mcp list</code>."]},{way:"server",snippets:[f(`claude mcp add --transport http testver ${i} --header "Authorization: Bearer ${m}"`)],steps:["Run the command with the server’s address and your token.","Start Claude Code and run <code>/mcp</code>: <strong>testver</strong> shows as connected."]},{way:"bridge",snippets:[l(e=>f(`claude mcp add --env TESTVER_ACCESS_TOKEN=${m} --transport stdio testver -- ${j(h(),e)}`))],extras:p(e=>f(`claude mcp add --env TESTVER_ACCESS_TOKEN=${m} --transport stdio testver -- ${j(h(),e)}`)),steps:["Run the command. Keep another option, like <code>--transport</code>, between <code>--env</code> and the name <code>testver</code>.","Start Claude Code and run <code>/mcp</code>: <strong>testver</strong> shows as connected."]}]},{id:"codex",name:"Codex",kind:"CLI · IDE · app",image:"/agents/codex.svg",docs:"https://learn.chatgpt.com/docs/extend/mcp",intro:"The Codex CLI, its IDE extension and the Codex app share one configuration: <code>~/.codex/config.toml</code>.",check:x,ways:[{way:"local",snippets:[l(e=>f(`codex mcp add testver -- ${j(g(e),e)}`))],extras:[{summary:"Or in config.toml",snippets:[l(e=>{const v=n(g(e),e);return s("~/.codex/config.toml",`[mcp_servers.testver]
|
|
2
|
+
command = ${JSON.stringify(v.command)}
|
|
3
|
+
args = ${K(v.args)}`,"toml")})]},...p(e=>f(`codex mcp add testver -- ${j(g(e),e)}`))],steps:["Run the command, or add the table to <code>~/.codex/config.toml</code> (or <code>.codex/config.toml</code> in a trusted project).","Run <code>codex mcp list</code>, or <code>/mcp</code> in Codex: <strong>testver</strong> is listed. In the IDE extension or the app, restart it after saving."]},{way:"server",lead:"Codex sends the token from an environment variable you name:",snippets:[A?{code:`$env:TESTVER_ACCESS_TOKEN = "${m}"
|
|
4
|
+
codex mcp add testver --url ${i} --bearer-token-env-var TESTVER_ACCESS_TOKEN`,lang:"powershell",frame:"terminal"}:f(`export TESTVER_ACCESS_TOKEN=${m}
|
|
5
|
+
codex mcp add testver --url ${i} --bearer-token-env-var TESTVER_ACCESS_TOKEN`)],extras:[{summary:"Or in config.toml, with the header written out",snippets:[s("~/.codex/config.toml",`[mcp_servers.testver]
|
|
6
|
+
url = "${i}"
|
|
7
|
+
http_headers = { "Authorization" = "Bearer ${m}" }`,"toml")]}],steps:['Set <code>TESTVER_ACCESS_TOKEN</code> where Codex runs (in PowerShell: <code>$env:TESTVER_ACCESS_TOKEN = "…"</code>), then run the command. Or write the header in <code>config.toml</code>.',"Run <code>codex mcp list</code>, or <code>/mcp</code> in Codex: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[l(e=>f(`codex mcp add testver --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`))],extras:[{summary:"Or in config.toml",snippets:[l(e=>{const v=n(h(),e);return s("~/.codex/config.toml",`[mcp_servers.testver]
|
|
8
|
+
command = ${JSON.stringify(v.command)}
|
|
9
|
+
args = ${K(v.args)}
|
|
10
|
+
env = { TESTVER_ACCESS_TOKEN = "${m}" }`,"toml")})]},...p(e=>f(`codex mcp add testver --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`))],steps:["Run the command, or add the table to <code>config.toml</code>. The token goes in the server’s own <code>env</code>: Codex passes on only the variables you list.","Run <code>codex mcp list</code>, or <code>/mcp</code> in Codex: <strong>testver</strong> is listed."]}]},{id:"gemini-cli",name:"Gemini CLI",kind:"CLI",image:"/agents/gemini.svg",docs:"https://geminicli.com/docs/tools/mcp-server/",check:x,ways:[{way:"local",snippets:[l(e=>f(`gemini mcp add -s user testver ${E(g(e),e)}`))],extras:[{summary:"Or in settings.json",snippets:[l(e=>s("~/.gemini/settings.json",r({mcpServers:{testver:n(g(e),e)}})))]},...p(e=>s("~/.gemini/settings.json",r({mcpServers:{testver:n(g(e),e)}})))],steps:["Run the command. <code>-s user</code> adds it for every project; without it, to this project’s <code>.gemini/settings.json</code>.","Run <code>gemini mcp list</code>, or <code>/mcp</code> in Gemini CLI: <strong>testver</strong> shows Connected. A server on your computer connects only in a trusted folder (<code>gemini trust</code>)."]},{way:"server",snippets:[f(`gemini mcp add -s user --transport http --header "Authorization: Bearer ${m}" testver ${i}`)],extras:[{summary:"Or in settings.json",text:"<code>httpUrl</code> is the server’s address (<code>url</code> would mean the older SSE transport):",snippets:[s("~/.gemini/settings.json",r({mcpServers:{testver:{httpUrl:i,headers:{Authorization:`Bearer ${m}`}}}}))]}],steps:["Run the command, or add it to <code>settings.json</code>.","Run <code>gemini mcp list</code>, or <code>/mcp</code> in Gemini CLI: <strong>testver</strong> shows Connected."]},{way:"bridge",snippets:[l(e=>f(`gemini mcp add -s user -e TESTVER_ACCESS_TOKEN=${m} testver ${E(h(),e)}`))],extras:[{summary:"Or in settings.json",snippets:[l(e=>s("~/.gemini/settings.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))]},...p(e=>s("~/.gemini/settings.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],steps:["Run the command, or add it to <code>settings.json</code>. The token goes in the server’s own <code>env</code>: Gemini CLI doesn’t pass variables named like <code>*TOKEN*</code> from your shell.","Run <code>gemini mcp list</code>, or <code>/mcp</code> in Gemini CLI: <strong>testver</strong> shows Connected."]}]},{id:"antigravity",name:"Antigravity",kind:"App · IDE · CLI",image:"/agents/antigravity.svg",docs:"https://antigravity.google/docs/mcp",intro:"The Antigravity app, IDE and CLI (<code>agy</code>) share one <code>mcp_config.json</code>: <code>~/.gemini/config/mcp_config.json</code> for every workspace, or <code>.agents/mcp_config.json</code> in a workspace. In the app, <strong>Copy Config File Path</strong> gives its exact place, on Windows too.",check:x,ways:[{way:"local",snippets:[l(e=>s("mcp_config.json",r({mcpServers:{testver:n(g(e),e)}})))],extras:p(e=>s("mcp_config.json",r({mcpServers:{testver:n(g(e),e)}}))),steps:["Open the config. App: <strong>Customizations → Installed → MCP Servers</strong> (<strong>Copy Config File Path</strong> is in its header). IDE: <strong>… → MCP Servers → Manage MCP Servers → View raw config</strong>. CLI: edit the file.","Add <code>testver</code> under <code>mcpServers</code> and save.","In the app, <strong>testver</strong> shows a green dot and its tools (<strong>⋮ → Restart</strong> if it doesn’t). In the CLI, <code>/mcp</code> shows it active and reloads the servers."]},{way:"server",lead:"Antigravity takes a server’s address as <code>serverUrl</code>:",snippets:[s("mcp_config.json",r({mcpServers:{testver:{serverUrl:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Open the config (app: <strong>Customizations → Installed → MCP Servers</strong>; IDE: <strong>Manage MCP Servers → View raw config</strong>), add <code>testver</code> and save.","In the app, <strong>testver</strong> shows a green dot; a red dot with “Unauthorized” means the token is wrong. In the CLI: <code>/mcp</code>."]},{way:"bridge",snippets:[l(e=>s("mcp_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("mcp_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}}))),steps:["Open the config, add <code>testver</code> under <code>mcpServers</code> and save.","In the app, <strong>testver</strong> shows a green dot and its tools. In the CLI: <code>/mcp</code>."]}]},{id:"vscode",name:"VS Code",kind:"GitHub Copilot",image:"/agents/vscode.svg",docs:"https://code.visualstudio.com/docs/copilot/customization/mcp-servers",intro:"Copilot in VS Code reads <code>~/.copilot/mcp-config.json</code> (every workspace, shared with Copilot CLI) and <code>.mcp.json</code> at the workspace root.",check:`${x} VS Code shows the tool call in the chat.`,ways:[{way:"local",snippets:[l(e=>s("~/.copilot/mcp-config.json",r({mcpServers:{testver:n(g(e),e,{tools:["*"]},{type:"stdio"})}})))],extras:[...p(e=>s("~/.copilot/mcp-config.json",r({mcpServers:{testver:n(g(e),e,{tools:["*"]},{type:"stdio"})}}))),{summary:"Older setup: .vscode/mcp.json",text:"VS Code’s own <code>mcp.json</code> (in <code>.vscode/</code>, or <strong>MCP: Open User Configuration</strong>) still works until VS Code removes it in 2027; its key is <code>servers</code>:",snippets:[l(e=>{const v=n(["mcp","--project","${workspaceFolder}"],e);return s(".vscode/mcp.json",r({servers:{testver:{type:"stdio",...v}}}))})]}],steps:["Add <code>testver</code> under <code>mcpServers</code> in <code>~/.copilot/mcp-config.json</code>, or in <code>.mcp.json</code> at the workspace root, and save.","In the Chat view, open <strong>Customizations → MCP Servers</strong>, or run <strong>MCP: List Servers</strong>: <strong>testver</strong> is listed."]},{way:"server",snippets:[s("~/.copilot/mcp-config.json",r({mcpServers:{testver:{type:"http",url:i,headers:{Authorization:`Bearer ${m}`},tools:["*"]}}}))],extras:[{summary:"Older setup: .vscode/mcp.json, asking for the token",text:"VS Code asks for the token the first time and keeps it, so it isn’t in the file:",snippets:[s(".vscode/mcp.json",r({inputs:[{type:"promptString",id:"testver-token",description:"Testver access token",password:!0}],servers:{testver:{type:"http",url:i,headers:{Authorization:"Bearer ${input:testver-token}"}}}}))]}],steps:["Add <code>testver</code> to <code>~/.copilot/mcp-config.json</code> with the server’s address and your token, and save. (<code>${TESTVER_ACCESS_TOKEN}</code> in place of the token reads it from the environment.)","Open <strong>Customizations → MCP Servers</strong>, or run <strong>MCP: List Servers</strong>: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[l(e=>s("~/.copilot/mcp-config.json",r({mcpServers:{testver:n(h(),e,{env:y,tools:["*"]},{type:"stdio"})}})))],extras:p(e=>s("~/.copilot/mcp-config.json",r({mcpServers:{testver:n(h(),e,{env:y,tools:["*"]},{type:"stdio"})}}))),steps:["Add <code>testver</code> to <code>~/.copilot/mcp-config.json</code> and save.","Open <strong>Customizations → MCP Servers</strong>, or run <strong>MCP: List Servers</strong>: <strong>testver</strong> is listed."]}]},{id:"cursor",name:"Cursor",kind:"Editor",icon:"cursor",docs:"https://cursor.com/docs/mcp",check:x,ways:[{way:"local",lead:"<code>${workspaceFolder}</code> is the project open in Cursor:",snippets:[l(e=>s(".cursor/mcp.json",r({mcpServers:{testver:n(["mcp","--project","${workspaceFolder}"],e,{},{type:"stdio"})}})))],extras:p(e=>s(".cursor/mcp.json",r({mcpServers:{testver:n(["mcp","--project","${workspaceFolder}"],e,{},{type:"stdio"})}}))),steps:["Add it to <code>.cursor/mcp.json</code> in your project, or to <code>~/.cursor/mcp.json</code> for every project.","Restart Cursor. <strong>testver</strong> is listed with its tools in Cursor’s MCP settings, where you can switch it on or off; errors are under <strong>Output → MCP Logs</strong>."]},{way:"server",snippets:[s("~/.cursor/mcp.json",r({mcpServers:{testver:{url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add it to <code>~/.cursor/mcp.json</code> (or the project’s <code>.cursor/mcp.json</code>; <code>${env:TESTVER_ACCESS_TOKEN}</code> in place of the token reads it from the environment).","Restart Cursor: <strong>testver</strong> is listed in its MCP settings."]},{way:"bridge",snippets:[l(e=>s("~/.cursor/mcp.json",r({mcpServers:{testver:n(h(),e,{env:y},{type:"stdio"})}})))],extras:p(e=>s("~/.cursor/mcp.json",r({mcpServers:{testver:n(h(),e,{env:y},{type:"stdio"})}}))),steps:["Add it to <code>~/.cursor/mcp.json</code>.","Restart Cursor: <strong>testver</strong> is listed in its MCP settings."]}]},{id:"claude-desktop",name:"Claude desktop",kind:"Desktop app",icon:"anthropic",docs:"https://modelcontextprotocol.io/docs/develop/connect-local-servers",check:x,ways:[{way:"local",snippets:[l(e=>s("claude_desktop_config.json",r({mcpServers:{testver:n(g(e),e)}})))],extras:p(e=>s("claude_desktop_config.json",r({mcpServers:{testver:n(g(e),e)}}))),steps:["In Claude, open <strong>Settings → Developer → Edit Config</strong>: it opens <code>claude_desktop_config.json</code>.","Add <code>testver</code> under <code>mcpServers</code> (keep any servers already there) and save.","Quit Claude fully and open it again. <strong>testver</strong> is listed under <strong>+ → Connectors</strong>."]},{way:"server",lead:"Claude desktop starts servers on your computer from its config file. A server’s address is added as a <strong>custom connector</strong> instead, which Claude reaches from Anthropic’s side: your Testver server must be reachable from the internet, and a token header is available only to some organizations so far. For most teams, <strong>Team server via testver</strong> is the way.",snippets:[],steps:[`Where your plan offers it: <strong>Settings → Connectors → Add custom connector</strong>, with the name <code>Testver</code> and the address ${I}.`,`Choose no sign-in, and add the request header <code>authorization</code> with the value <code>Bearer ${V(m)}</code> (the word <code>Bearer</code> isn’t added for you).`],check:!1},{way:"bridge",snippets:[l(e=>s("claude_desktop_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("claude_desktop_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}}))),steps:["Open <strong>Settings → Developer → Edit Config</strong>, add <code>testver</code> under <code>mcpServers</code> and save.","Quit Claude fully and open it again: <strong>testver</strong> is listed under <strong>+ → Connectors</strong>."]}]},{id:"copilot-cli",name:"GitHub Copilot CLI",kind:"CLI",icon:"copilot",docs:"https://docs.github.com/en/copilot/how-tos/copilot-cli/customize-copilot/add-mcp-servers",check:x,ways:[{way:"local",snippets:[l(e=>f(`copilot mcp add testver -- ${j(g(e),e)}`))],extras:[{summary:"Or in mcp-config.json",snippets:[l(e=>s("~/.copilot/mcp-config.json",r({mcpServers:{testver:n(g(e),e,{tools:["*"]},{type:"local"})}})))]},...p(e=>f(`copilot mcp add testver -- ${j(g(e),e)}`))],steps:["Run the command: it takes effect at once, no restart.","Run <code>/mcp</code> in Copilot CLI, or <code>copilot mcp list</code>: <strong>testver</strong> is listed."]},{way:"server",snippets:[f(`copilot mcp add --transport http --header "Authorization: Bearer ${m}" testver ${i}`)],steps:["Run the command.","Run <code>/mcp</code> in Copilot CLI, or <code>copilot mcp list</code>: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[l(e=>f(`copilot mcp add testver --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`))],extras:p(e=>f(`copilot mcp add testver --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`)),steps:["Run the command. The token goes in the server’s own environment: Copilot CLI passes on only <code>PATH</code> and a few system variables.","Run <code>/mcp</code> in Copilot CLI, or <code>copilot mcp list</code>: <strong>testver</strong> is listed."]}]},{id:"windsurf",name:"Windsurf",kind:"Devin Desktop",icon:"windsurf",docs:"https://docs.devin.ai/desktop/cascade/mcp",intro:"Windsurf is now Devin Desktop. Its MCP servers are under <strong>Customize → MCPs</strong>, which opens <code>~/.config/devin/mcp_config.json</code> (on Windows <code>%APPDATA%\\devin\\mcp_config.json</code>).",check:x,ways:[{way:"local",snippets:[l(e=>s("mcp_config.json",r({mcpServers:{testver:n(g(e),e)}})))],extras:p(e=>s("mcp_config.json",r({mcpServers:{testver:n(g(e),e)}}))),steps:["Open <strong>Customize → MCPs</strong>, open the config file, add <code>testver</code> and save.","Refresh the list: <strong>testver</strong> is listed under <strong>This computer</strong>; switch it on."]},{way:"server",snippets:[s("mcp_config.json",r({mcpServers:{testver:{url:i,transport:"http",headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add <code>testver</code> to the config file and save.","Refresh the list in <strong>Customize → MCPs</strong>: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[l(e=>s("mcp_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("mcp_config.json",r({mcpServers:{testver:n(h(),e,{env:y})}}))),steps:["Add <code>testver</code> to the config file and save.","Refresh the list in <strong>Customize → MCPs</strong>: <strong>testver</strong> is listed."]}]},{id:"jetbrains",name:"JetBrains Junie",kind:"IntelliJ, PyCharm…",icon:"jetbrains",docs:"https://junie.jetbrains.com/docs/junie-plugin-mcp-settings.html",intro:"Junie (the IDE plugin and Junie CLI) reads <code>~/.junie/mcp/mcp.json</code>, or <code>.junie/mcp/mcp.json</code> in the project. AI Assistant takes the same JSON for a server on your computer in <strong>Settings | Tools | AI Assistant | Model Context Protocol (MCP)</strong>; its docs don’t cover headers or <code>env</code>, so use Junie for a team server.",check:x,ways:[{way:"local",snippets:[l(e=>s("~/.junie/mcp/mcp.json",r({mcpServers:{testver:n(g(e),e)}})))],extras:p(e=>s("~/.junie/mcp/mcp.json",r({mcpServers:{testver:n(g(e),e)}}))),steps:["Add <code>testver</code> to <code>mcp.json</code> and save.","Junie’s MCP settings list <strong>testver</strong> with its status (in Junie CLI: <code>/mcp</code>)."]},{way:"server",snippets:[s("~/.junie/mcp/mcp.json",r({mcpServers:{testver:{url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add <code>testver</code> to <code>mcp.json</code> and save.","Junie’s MCP settings list <strong>testver</strong> as active."]},{way:"bridge",snippets:[l(e=>s("~/.junie/mcp/mcp.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("~/.junie/mcp/mcp.json",r({mcpServers:{testver:n(h(),e,{env:y})}}))),steps:["Add <code>testver</code> to <code>mcp.json</code> and save.","Junie’s MCP settings list <strong>testver</strong> as active."]}]},{id:"cline",name:"Cline",kind:"Extension · CLI",icon:"cline",docs:"https://docs.cline.bot/mcp/configuring-mcp-servers",check:x,ways:[{way:"local",snippets:[l(e=>s("cline_mcp_settings.json",r({mcpServers:{testver:n(g(e),e,{disabled:!1,autoApprove:[]})}})))],extras:[{summary:"Or with Cline CLI",snippets:[l(e=>f(`cline mcp add testver --yes -- ${j(g(e),e)}`))]},...p(e=>s("cline_mcp_settings.json",r({mcpServers:{testver:n(g(e),e,{disabled:!1,autoApprove:[]})}})))],steps:["In Cline, click the <strong>MCP Servers</strong> icon → <strong>Configure</strong> → <strong>Configure MCP Servers</strong>, add <code>testver</code> and save.","<strong>testver</strong> is listed with its tools; restart it there if it doesn’t answer."]},{way:"server",lead:'Give <code>"type": "streamableHttp"</code>: without it, Cline uses the older SSE transport.',snippets:[s("cline_mcp_settings.json",r({mcpServers:{testver:{type:"streamableHttp",url:i,headers:{Authorization:`Bearer ${m}`},disabled:!1,autoApprove:[]}}}))],extras:[{summary:"Or with Cline CLI",snippets:[f(`cline mcp add testver ${i} --transport http --header "Authorization: Bearer ${m}" --yes`)]}],steps:["Open <strong>Configure MCP Servers</strong>, add <code>testver</code> and save.","<strong>testver</strong> is listed with its tools."]},{way:"bridge",snippets:[l(e=>s("cline_mcp_settings.json",r({mcpServers:{testver:n(h(),e,{env:y,disabled:!1,autoApprove:[]})}})))],extras:p(e=>s("cline_mcp_settings.json",r({mcpServers:{testver:n(h(),e,{env:y,disabled:!1,autoApprove:[]})}}))),steps:["Open <strong>Configure MCP Servers</strong>, add <code>testver</code> and save.","<strong>testver</strong> is listed with its tools."]}]},{id:"zed",name:"Zed",kind:"Editor",icon:"zed",docs:"https://zed.dev/docs/ai/mcp",check:x,ways:[{way:"local",snippets:[l(e=>s("settings.json",r({context_servers:{testver:n(g(e),e,{env:{}})}})))],extras:p(e=>s("settings.json",r({context_servers:{testver:n(g(e),e,{env:{}})}}))),steps:["Run <strong>zed: open settings file</strong> and add <code>testver</code> under <code>context_servers</code> (or use <strong>Settings → AI → MCP Servers → Add Server</strong>).","In <strong>Settings → AI → MCP Servers</strong>, <strong>testver</strong> has a green dot: the server is active. A server in a project’s <code>.zed/settings.json</code> starts once you trust the project."]},{way:"server",snippets:[s("settings.json",r({context_servers:{testver:{url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add <code>testver</code> under <code>context_servers</code> and save.","In <strong>Settings → AI → MCP Servers</strong>, <strong>testver</strong> has a green dot."]},{way:"bridge",snippets:[l(e=>s("settings.json",r({context_servers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("settings.json",r({context_servers:{testver:n(h(),e,{env:y})}}))),steps:["Add <code>testver</code> under <code>context_servers</code> and save.","In <strong>Settings → AI → MCP Servers</strong>, <strong>testver</strong> has a green dot."]}]},{id:"opencode",name:"opencode",kind:"CLI",image:"/agents/opencode.svg",invertDark:!0,docs:"https://opencode.ai/docs/mcp-servers/",check:x,ways:[{way:"local",snippets:[l(e=>f(`opencode mcp add testver --global -- ${j(g(e),e)}`))],extras:[{summary:"Or in opencode.json",snippets:[l(e=>s("opencode.json",r({$schema:"https://opencode.ai/config.json",mcp:{servers:{testver:{type:"local",command:N(g(e),e)}}}})))]},...p(e=>f(`opencode mcp add testver --global -- ${j(g(e),e)}`))],steps:["Run the command (<code>--global</code>: every project; without it, this project’s <code>opencode.json</code>).","Run <code>opencode mcp list</code>: <strong>testver</strong> shows connected. In opencode, <code>/mcps</code> lists it too."]},{way:"server",lead:"opencode’s <code>--header</code> takes <code>NAME=VALUE</code>:",snippets:[f(`opencode mcp add testver --global --url ${i} --header 'Authorization=Bearer ${m}'`)],extras:[{summary:"Or in opencode.json",text:'Turn OAuth off (<code>"oauth": false</code>): Testver uses the token header.',snippets:[s("opencode.json",r({$schema:"https://opencode.ai/config.json",mcp:{servers:{testver:{type:"remote",url:i,oauth:!1,headers:{Authorization:`Bearer ${m}`}}}}}))]}],steps:["Run the command.","Run <code>opencode mcp list</code>: <strong>testver</strong> shows connected."]},{way:"bridge",snippets:[l(e=>f(`opencode mcp add testver --global --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`))],extras:[{summary:"Or in opencode.json",snippets:[l(e=>s("opencode.json",r({$schema:"https://opencode.ai/config.json",mcp:{servers:{testver:{type:"local",command:N(h(),e),environment:y}}}})))]},...p(e=>f(`opencode mcp add testver --global --env TESTVER_ACCESS_TOKEN=${m} -- ${j(h(),e)}`))],steps:["Run the command.","Run <code>opencode mcp list</code>: <strong>testver</strong> shows connected."]}]},{id:"amp",name:"Amp",kind:"CLI · editor",letters:"Amp",docs:"https://ampcode.com/docs/customize/mcp",intro:"Amp reads <code>amp.mcpServers</code> in <code>~/.config/amp/settings.json</code> (on Windows <code>%USERPROFILE%\\.config\\amp\\settings.json</code>), or <code>.amp/settings.json</code> in the project.",check:x,ways:[{way:"local",snippets:[l(e=>f(`amp mcp add testver -- ${j(g(e),e)}`))],extras:[{summary:"Or in settings.json",snippets:[l(e=>s("~/.config/amp/settings.json",r({"amp.mcpServers":{testver:n(g(e),e)}})))]},...p(e=>s("settings.json",r({"amp.mcpServers":{testver:n(g(e),e)}})))],steps:["Run the command, or add <code>testver</code> to <code>settings.json</code>.","Run <code>amp mcp doctor</code>: <strong>testver</strong> is listed. A server in the project’s <code>.amp/settings.json</code> needs <code>amp mcp approve testver</code> first."]},{way:"server",snippets:[s("~/.config/amp/settings.json",r({"amp.mcpServers":{testver:{url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add <code>testver</code> to <code>settings.json</code> and save.","Run <strong>Reload MCP</strong> in a thread, or <code>amp mcp doctor</code>: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[l(e=>s("~/.config/amp/settings.json",r({"amp.mcpServers":{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("settings.json",r({"amp.mcpServers":{testver:n(h(),e,{env:y})}}))),steps:["Add <code>testver</code> to <code>settings.json</code> and save.","Run <code>amp mcp doctor</code>: <strong>testver</strong> is listed."]}]},{id:"kiro",name:"Kiro",kind:"IDE · CLI",letters:"K",docs:"https://kiro.dev/docs/mcp/configuration/",intro:"Kiro reads <code>~/.kiro/settings/mcp.json</code> (every workspace) or <code>.kiro/settings/mcp.json</code>. It starts <code>testver</code> on Windows as it is, no <code>cmd</code> needed.",check:x,ways:[{way:"local",snippets:[s("~/.kiro/settings/mcp.json",r({mcpServers:{testver:n(g(A),!1)}}))],extras:[{summary:"Or with Kiro CLI",snippets:[f(`kiro-cli mcp add --name testver --command ${k[0]} --args '${JSON.stringify([...k.slice(1),...g(A)])}' --scope global`)]}],steps:["Add <code>testver</code> to <code>mcp.json</code> and save: Kiro reconnects its servers, no restart.","Open the <strong>MCP servers</strong> tab in the Kiro panel (in Kiro CLI: <code>/mcp</code>): <strong>testver</strong> is listed."]},{way:"server",snippets:[s("~/.kiro/settings/mcp.json",r({mcpServers:{testver:{url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add <code>testver</code> to <code>mcp.json</code> and save.","Open the <strong>MCP servers</strong> tab: <strong>testver</strong> is listed."]},{way:"bridge",snippets:[s("~/.kiro/settings/mcp.json",r({mcpServers:{testver:n(h(),!1,{env:y})}}))],extras:[{summary:"Or with Kiro CLI",snippets:[f(`kiro-cli mcp add --name testver --command ${k[0]} --args '${JSON.stringify([...k.slice(1),...h()])}' --env TESTVER_ACCESS_TOKEN=${m} --scope global`)]}],steps:["Add <code>testver</code> to <code>mcp.json</code> and save.","Open the <strong>MCP servers</strong> tab: <strong>testver</strong> is listed."]}]},{id:"goose",name:"Goose",kind:"CLI · desktop",letters:"G",docs:"https://goose-docs.ai/docs/getting-started/using-extensions/",intro:"Goose calls MCP servers extensions: <code>goose configure</code> → <strong>Add Extension</strong>, or <code>~/.config/goose/config.yaml</code> (on Windows <code>%APPDATA%\\Block\\goose\\config\\config.yaml</code>).",check:x,ways:[{way:"local",snippets:[l(e=>{const v=n(g(e),e);return s("~/.config/goose/config.yaml",`extensions:
|
|
11
|
+
testver:
|
|
12
|
+
type: stdio
|
|
13
|
+
name: testver
|
|
14
|
+
enabled: true
|
|
15
|
+
cmd: ${v.command}
|
|
16
|
+
args: ${K(v.args)}
|
|
17
|
+
envs: {}
|
|
18
|
+
timeout: 300`,"yaml")})],extras:p(e=>{const v=n(g(e),e);return s("~/.config/goose/config.yaml",`extensions:
|
|
19
|
+
testver:
|
|
20
|
+
type: stdio
|
|
21
|
+
name: testver
|
|
22
|
+
enabled: true
|
|
23
|
+
cmd: ${v.command}
|
|
24
|
+
args: ${K(v.args)}
|
|
25
|
+
envs: {}
|
|
26
|
+
timeout: 300`,"yaml")}),steps:[`Run <code>goose configure</code> → <strong>Add Extension</strong> → <strong>Command-line Extension</strong>, name it <code>testver</code> with the command <code>${V(j(g(A),A))}</code>. Or add it to <code>config.yaml</code>.`,"Restart Goose after editing the file. <code>goose info -v</code> (or the Extensions page) lists <strong>testver</strong>."]},{way:"server",lead:"Goose’s docs don’t show a token header for a server’s address yet: use <strong>Team server via testver</strong>.",snippets:[],steps:[],check:!1},{way:"bridge",snippets:[l(e=>{const v=n(h(),e);return s("~/.config/goose/config.yaml",`extensions:
|
|
27
|
+
testver:
|
|
28
|
+
type: stdio
|
|
29
|
+
name: testver
|
|
30
|
+
enabled: true
|
|
31
|
+
cmd: ${v.command}
|
|
32
|
+
args: ${K(v.args)}
|
|
33
|
+
envs: { "TESTVER_ACCESS_TOKEN": "${m}" }
|
|
34
|
+
timeout: 300`,"yaml")})],steps:["Add <code>testver</code> under <code>extensions</code> and save (or add it with <code>goose configure</code>, with the variable <code>TESTVER_ACCESS_TOKEN</code>).","Restart Goose: <code>goose info -v</code> lists <strong>testver</strong>."]}]},{id:"other",name:"Other",kind:"Any MCP client",icon:"mcp",docs:"https://modelcontextprotocol.io/clients",intro:"Any agent that speaks MCP. Most read this <code>mcpServers</code> shape; look up your agent’s file and key names.",check:x,ways:[{way:"local",lead:`A server the agent starts (stdio): the command <code>${V(k.join(" "))}</code> with the arguments <code>mcp --project <folder></code>.`,snippets:[l(e=>s("mcp.json",r({mcpServers:{testver:n(g(e),e)}})))],extras:p(e=>s("mcp.json",r({mcpServers:{testver:n(g(e),e)}}))),steps:["Add it where your agent keeps its MCP servers.","Restart or reload the agent’s MCP servers: <strong>testver</strong> is listed with its tools."]},{way:"server",lead:`MCP’s Streamable HTTP transport, the address ${I} and the header <code>Authorization: Bearer <token></code>. Agents name the fields a little differently (<code>url</code> or <code>serverUrl</code>, <code>"type": "http"</code> or <code>"streamable-http"</code>).`,snippets:[s("mcp.json",r({mcpServers:{testver:{type:"http",url:i,headers:{Authorization:`Bearer ${m}`}}}}))],steps:["Add it where your agent keeps its MCP servers.","Reload the agent’s MCP servers: <strong>testver</strong> is listed. If the agent can’t send a header, use <strong>Team server via testver</strong>."]},{way:"bridge",lead:"For an agent that can only start programs: the token goes in the server’s own environment.",snippets:[l(e=>s("mcp.json",r({mcpServers:{testver:n(h(),e,{env:y})}})))],extras:p(e=>s("mcp.json",r({mcpServers:{testver:n(h(),e,{env:y})}}))),steps:["Add it where your agent keeps its MCP servers.","Reload the agent’s MCP servers: <strong>testver</strong> is listed."]}]}]}ce(Te);const O=[{id:"local",label:"On your computer",hint:"Testver runs the tests on the agent’s computer",icon:we},{id:"server",label:"This server's address",hint:"Nothing to install: the address and a token",icon:be},{id:"bridge",label:"This server, through testver",hint:"For agents that can only start programs",icon:Ce}],oe="testver-mcp-agent",W=a=>a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&");function D({html:a}){const d=[],i=/<(code|strong)>([\s\S]*?)<\/\1>/g;let m=0,w;for(;w=i.exec(a);)w.index>m&&d.push(t.jsx(C.Fragment,{children:W(a.slice(m,w.index))},d.length)),d.push(w[1]==="code"?t.jsx("code",{className:"px-1 py-0.5 rounded bg-surface-2 font-mono text-[12px] text-gray-800 dark:text-gray-200",children:W(w[2])},d.length):t.jsx("strong",{className:"font-semibold text-gray-900 dark:text-gray-100",children:W(w[2])},d.length)),m=i.lastIndex;return m<a.length&&d.push(t.jsx(C.Fragment,{children:W(a.slice(m))},d.length)),t.jsx(t.Fragment,{children:d})}function re({agent:a}){if(a.image)return t.jsx("img",{src:a.image,alt:"",width:28,height:28,className:`w-7 h-7 object-contain ${a.invertDark?"dark:invert":""}`});const d=a.icon?Ee[a.icon]:void 0;return d?t.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:`w-7 h-7 ${d.mono?"text-gray-900 dark:text-gray-100":""}`,style:d.mono?void 0:{color:d.hex},children:t.jsx("path",{d:d.path,fill:"currentColor"})}):t.jsx("span",{"aria-hidden":"true",className:"w-7 h-7 grid place-items-center rounded-lg bg-surface-3 text-[11px] font-bold text-gray-800 dark:text-gray-200",children:a.letters})}function _e({server:a,token:d,project:i,tokenControl:m,way:w,onWay:A,tokenMissing:k,copied:L,onCopy:g}){var v;const[h,N]=C.useState(()=>{try{return localStorage.getItem(oe)||"claude-code"}catch{return"claude-code"}}),[n,j]=C.useState(()=>/win/i.test(navigator.platform||navigator.userAgent)),[E,y]=C.useState(!1),l=A,T=C.useMemo(()=>ce({server:a,token:d,project:i??"/path/to/your/project",projectWin:i??"C:\\work\\your-project",npx:E,windows:n}),[a,d,i,E,n]),p=T.find(o=>o.id===h)??T[0],x=p.ways.find(o=>o.way===w)??p.ways[0],I=o=>{N(o);try{localStorage.setItem(oe,o)}catch{}},e=(o,u)=>t.jsxs("div",{className:"rounded-xl border border-white/5 bg-surface-0 overflow-hidden min-w-0",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3 px-3.5 py-2 border-b border-white/5",children:[t.jsx("span",{className:"text-xs text-gray-500 font-mono truncate",children:o.title??(o.frame==="terminal"?"Terminal":"")}),t.jsxs("button",{type:"button",onClick:()=>g(u,o.code),className:"flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-white/10 text-xs text-gray-700 dark:text-gray-200 hover:bg-white/5 shrink-0",children:[L===u?t.jsx(G,{size:13,className:"text-emerald-400"}):t.jsx(ae,{size:13})," Copy"]})]}),t.jsx("pre",{className:"p-3.5 font-mono text-[12.5px] leading-relaxed text-gray-800 dark:text-gray-300 overflow-x-auto whitespace-pre",children:o.code})]},u);return t.jsxs("div",{className:"space-y-4",children:[t.jsx("div",{role:"group","aria-label":"Your agent",className:"grid gap-2 grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-6",children:T.map(o=>t.jsxs("button",{type:"button","aria-pressed":o.id===p.id,onClick:()=>I(o.id),className:`flex flex-col items-center justify-center gap-1 min-h-[92px] px-2 py-3 rounded-xl border text-center transition-colors ${o.id===p.id?"border-brand-500 ring-1 ring-brand-500 bg-brand-500/5":"border-white/5 bg-surface-2/60 hover:border-white/15"}`,children:[t.jsx(re,{agent:o}),t.jsx("span",{className:"text-[13px] font-semibold text-gray-900 dark:text-gray-100 leading-tight",children:o.name}),t.jsx("span",{className:"text-[11px] text-gray-500",children:o.kind})]},o.id))}),t.jsxs("div",{className:"p-4 sm:p-5 rounded-xl bg-surface-2/60 border border-white/5 space-y-4 min-w-0",children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsxs("p",{className:"flex items-center gap-2.5 text-base font-semibold text-gray-900 dark:text-gray-100",children:[t.jsx(re,{agent:p})," ",p.name]}),p.docs&&t.jsxs("a",{href:p.docs,target:"_blank",rel:"noreferrer",className:"flex items-center gap-1 text-xs text-brand-500 hover:underline",children:[p.name,"’s MCP docs ",t.jsx(je,{size:12})]})]}),p.intro&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 leading-relaxed",children:t.jsx(D,{html:p.intro})}),t.jsx("div",{role:"tablist","aria-label":"How it connects",className:"grid gap-2 sm:grid-cols-3",onKeyDown:o=>{var $;const u=O.findIndex(_=>_.id===w),b=o.key==="ArrowRight"?(u+1)%O.length:o.key==="ArrowLeft"?(u+O.length-1)%O.length:-1;b<0||(o.preventDefault(),l(O[b].id),($=document.getElementById(`mcp-way-${O[b].id}`))==null||$.focus())},children:O.map(o=>{const u=w===o.id,b=o.icon;return t.jsxs("button",{id:`mcp-way-${o.id}`,type:"button",role:"tab","aria-selected":u,"aria-controls":"mcp-way-panel",tabIndex:u?0:-1,onClick:()=>l(o.id),className:`flex items-start gap-3 px-3.5 py-3 rounded-xl border text-left transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-brand-500 ${u?"border-brand-500 ring-1 ring-brand-500 bg-surface-1 shadow-sm":"border-white/10 bg-surface-1/50 hover:border-white/20 hover:bg-surface-1"}`,children:[t.jsx("span",{className:`w-8 h-8 shrink-0 grid place-items-center rounded-lg ${u?"bg-brand-600 text-white":"bg-surface-2 text-gray-500"}`,children:t.jsx(b,{size:16})}),t.jsxs("span",{className:"min-w-0",children:[t.jsx("span",{className:`block text-sm font-semibold ${u?"text-gray-900 dark:text-gray-100":"text-gray-700 dark:text-gray-300"}`,children:o.label}),t.jsx("span",{className:"block text-xs text-gray-500 mt-0.5 leading-snug",children:o.hint})]})]},o.id)})}),t.jsxs("div",{id:"mcp-way-panel",role:"tabpanel","aria-labelledby":`mcp-way-${w}`,className:"space-y-4",children:[t.jsxs("div",{className:"flex flex-wrap items-end gap-x-6 gap-y-3",children:[w!=="local"&&t.jsx("div",{className:"min-w-[260px] flex-1 max-w-md",children:m}),t.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-2 pb-1",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("input",{type:"checkbox",checked:n,onChange:o=>j(o.target.checked),className:"accent-brand-500"}),"The agent runs on Windows"]}),w!=="server"&&t.jsxs("label",{className:"flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[t.jsx("input",{type:"checkbox",checked:E,onChange:o=>y(o.target.checked),className:"accent-brand-500"}),"Testver isn’t installed there (use npx)"]})]})]}),w==="local"&&t.jsxs("p",{className:"text-xs text-gray-500",children:[i?"The folder is this project’s, on this computer.":"Replace the folder with your project’s on the agent’s computer."," ","No token: the agent works as that computer’s user, and the project’s own test tools must be there already."]}),E&&w!=="server"&&t.jsxs("p",{className:"text-xs text-gray-500",children:["npx fetches Testver the first time (Node.js 22.14 or newer): run ",t.jsx("code",{className:"font-mono",children:"npx -y @testver/testver --version"})," once first, so the agent doesn’t wait."]}),k&&w!=="local"&&x.snippets.length>0&&t.jsxs("p",{role:"status",className:"flex items-start gap-2 px-3.5 py-2.5 rounded-xl border border-amber-500/30 bg-amber-500/10 text-sm text-amber-700 dark:text-amber-300",children:[t.jsx(ne,{size:15,className:"mt-0.5 shrink-0"}),t.jsxs("span",{children:["What to paste holds ",t.jsx("code",{className:"font-mono",children:"tvpat_…"})," in place of your token: paste the token’s value above to fill it in, or put it in yourself after copying."]})]}),x.lead&&t.jsx("p",{className:"text-sm text-gray-700 dark:text-gray-300 leading-relaxed",children:t.jsx(D,{html:x.lead})}),x.snippets.map((o,u)=>e(o,`${p.id}-${x.way}-${u}`)),(v=x.extras)==null?void 0:v.map((o,u)=>t.jsxs("details",{className:"rounded-xl border border-white/5 bg-surface-1 px-3.5 py-2.5 [&[open]>summary]:mb-2.5",children:[t.jsx("summary",{className:"cursor-pointer text-sm font-medium text-gray-700 dark:text-gray-300",children:o.summary}),t.jsxs("div",{className:"space-y-2.5",children:[o.text&&t.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.jsx(D,{html:o.text})}),o.snippets.map((b,$)=>e(b,`${p.id}-${x.way}-x${u}-${$}`))]})]},`${p.id}-${x.way}-x${u}`)),x.steps.length>0&&t.jsx("ol",{className:"space-y-2",children:x.steps.map((o,u)=>t.jsxs("li",{className:"flex gap-3 text-sm text-gray-700 dark:text-gray-300 leading-relaxed",children:[t.jsx("span",{className:"w-6 h-6 shrink-0 grid place-items-center rounded-full border border-white/10 bg-surface-1 text-xs font-semibold text-gray-600 dark:text-gray-400",children:u+1}),t.jsx("span",{className:"pt-0.5",children:t.jsx(D,{html:o})})]},u))}),x.check!==!1&&t.jsxs("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:[t.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:"Check it works: "}),t.jsx(D,{html:x.check??p.check})]})]})]})]})}const Ie=[{name:"list_tests",what:"The project's tests, their latest results, the flaky ones"},{name:"affected_tests",what:"The tests a change, a method or a class reaches"},{name:"run_tests",what:"Runs named tests: why each failed, its screenshot",needs:"run"},{name:"test_results",what:"Past runs, and each test's own runs"},{name:"run_configuration",what:"Browsers and environments to run with"},{name:"save_environment",what:"Saves an environment, a localhost too",needs:"run"},{name:"what_if",what:"Tests while an outside service is down or slow",needs:"run"},{name:"about",what:"This Testver, the project, what is on"},{name:"write_test",what:"A new test, the way the project writes them",needs:"ai"},{name:"repair_test",what:"Fixes a test the app outgrew, shown first",needs:"ai"}];function Oe(a){const d=Math.floor((Date.now()-a)/6e4);if(d<1)return"just now";if(d<60)return`${d} min ago`;const i=Math.floor(d/60);return i<24?`${i} h ago`:`${Math.floor(i/24)} d ago`}const Me=a=>new Date(a).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"});function Re(a,d,i,m){return a.needs?m!=="server"?a.needs==="run"?{text:"runs tests",tone:"run"}:{text:"uses AI · while one is connected",tone:"ai"}:a.needs==="run"?d!=null&&d.scopes.includes("run")?{text:"runs tests",tone:"run"}:{text:"not with this token",tone:"off"}:d!=null&&d.scopes.includes("ai")?i!=null&&i.on?{text:"uses AI · your credits",tone:"ai"}:{text:"off — no AI connected",tone:"off"}:{text:"not with this token",tone:"off"}:null}const Le={run:"bg-amber-500/10 text-amber-300",ai:"bg-violet-500/10 text-violet-300",off:"bg-white/5 text-gray-400"},Pe={about:"what is on here",list_tests:"the list of tests",affected_tests:"the tests a change reaches",run_tests:"a run",test_results:"past runs",what_if:"a what-if run",write_test:"a new test",repair_test:"a repair",run_configuration:"the browsers and environments",save_environment:"an environment saved"};function ze(a){return a.refused?`Refused: ${a.refused}`:[a.tests!==void 0?`${a.tests} test${a.tests===1?"":"s"}`:"",a.files!==void 0?`${a.files} changed file${a.files===1?"":"s"}`:"",a.runId?`run ${a.runId.slice(0,8)}`:""].filter(Boolean).join(" · ")||Pe[a.tool]||"asked"}function Je(){var q,Z,U,Q,Y,X,ee;const a=me(),d=te({queryKey:["testver-mcp"],queryFn:ge,refetchInterval:15e3}),i=te({queryKey:["access-tokens"],queryFn:he}),m=ve(),[w,A]=C.useState("server"),k=w==="local"?"local":"server",[L,g]=C.useState(""),[h,N]=C.useState(!1),[n,j]=C.useState(null),[E,y]=C.useState(null),[l,T]=C.useState(null),[p,x]=C.useState(null),I=`${window.location.origin}/mcp`,e=window.location.protocol==="http:"&&!/^(localhost|127\.0\.0\.1|\[::1\])$/.test(window.location.hostname),v=C.useMemo(()=>{var c;return(((c=i.data)==null?void 0:c.tokens)??[]).filter(S=>!S.expired)},[i.data]),o=v.find(c=>c.id===L)??v[0],[u,b]=C.useState(""),$=!!(n&&o&&n.accessToken.id===o.id),_=u.trim(),P=!_||!o?null:_.startsWith("tvpat_")?_.startsWith(o.prefix)?null:`That isn’t the value of ${o.name}: it starts with ${o.prefix}.`:"A token’s value starts with tvpat_.",H=$&&n?n.token:_&&!P?_:"tvpat_…",ie=c=>{b(c);const S=c.trim(),R=v.find(pe=>S.startsWith(pe.prefix));R&&R.id!==(o==null?void 0:o.id)&&g(R.id)},de=/^(localhost|127\.0\.0\.1|\[::1\])$/.test(window.location.hostname),J=async(c,S)=>{await fe(S)?(y(c),setTimeout(()=>y(R=>R===c?null:R),1500)):x("Copying isn't available here — select the text and copy it by hand.")},le=async()=>{if(l){x(null);try{await xe(l.id),a.invalidateQueries({queryKey:["testver-mcp"]})}catch(c){x((c==null?void 0:c.message)||String(c))}finally{T(null)}}},z=(q=d.data)==null?void 0:q.ai,M=(Z=d.data)==null?void 0:Z.limits,B="p-5 rounded-xl bg-surface-1 border border-white/5";return t.jsxs("div",{className:"h-full flex flex-col bg-surface-0 text-gray-200 animate-fade-in",children:[t.jsx("div",{className:"border-b border-white/5 bg-surface-1",children:t.jsxs("div",{className:"max-w-[1400px] mx-auto w-full px-6 py-6 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[t.jsx(ke,{size:24,className:"text-brand-300"}),"Testver MCP"]}),t.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Connect an AI coding agent to this Testver: it finds the tests a change reaches, runs them, reads why one failed, and writes or repairs tests."})]}),t.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[t.jsxs("a",{href:"https://docs.testver.com/build/mcp",target:"_blank",rel:"noreferrer",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-sm font-medium bg-surface-2 hover:bg-surface-3 text-gray-300 border border-white/5 transition-colors",children:[t.jsx(Ne,{size:13})," Docs"]}),t.jsxs("button",{type:"button",onClick:()=>N(!0),disabled:!i.data,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 rounded-lg transition-colors disabled:opacity-50",children:[t.jsx(Se,{size:16})," Make a token for an agent"]})]})]})}),t.jsx("div",{className:"flex-1 overflow-y-auto",children:t.jsxs("div",{className:"max-w-[1400px] mx-auto w-full px-6 py-6 space-y-6",children:[p&&t.jsx("p",{role:"alert",className:"px-4 py-3 rounded-xl bg-red-500/10 border border-red-500/30 text-sm text-red-300",children:p}),t.jsxs("section",{"aria-label":"Status",className:"grid gap-3 sm:grid-cols-3",children:[t.jsxs("div",{className:"p-4 rounded-xl bg-surface-1 border border-white/5 space-y-2 min-w-0",children:[t.jsx("p",{className:"text-xs text-gray-500",children:"This server's MCP address"}),t.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[t.jsx("code",{className:"text-[13px] text-gray-200 truncate",children:I}),t.jsx("button",{type:"button",onClick:()=>void J("address",I),"aria-label":"Copy the address",className:"p-1.5 rounded-lg border border-white/10 text-gray-400 hover:text-gray-200 shrink-0",children:E==="address"?t.jsx(G,{size:14,className:"text-emerald-400"}):t.jsx(ae,{size:14})})]}),e&&t.jsx("p",{className:"text-xs text-amber-300",children:"Reach it over https: a token travels in a header."})]}),t.jsxs("div",{className:"p-4 rounded-xl bg-surface-1 border border-white/5 space-y-2",children:[t.jsx("p",{className:"text-xs text-gray-500",children:"AI tools (write_test, repair_test)"}),z?z.on?t.jsxs("p",{className:"text-sm text-gray-200 flex items-center gap-2",children:[t.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-400"})," On — an AI is connected for you"]}):t.jsxs("p",{className:"text-sm text-gray-200 flex items-start gap-2",children:[t.jsx("span",{className:"w-2 h-2 mt-1.5 rounded-full bg-amber-400 shrink-0"}),t.jsxs("span",{children:["Off — ",z.why," ",/Settings → LLM/.test(z.why??"")&&t.jsx(F,{to:"/settings?tab=llm",className:"underline",children:"Open"})]})]}):t.jsx("p",{className:"text-sm text-gray-500",children:"…"})]}),t.jsxs("div",{className:"p-4 rounded-xl bg-surface-1 border border-white/5 space-y-2",children:[t.jsx("p",{className:"text-xs text-gray-500",children:"Your tokens"}),t.jsxs("p",{className:"text-sm text-gray-200",children:[i.data?`${v.length} token${v.length===1?"":"s"}`:"…"," · ",t.jsx(F,{to:"/settings?tab=access-tokens",className:"underline",children:"Manage in Access Tokens"})]})]})]}),t.jsxs("section",{"aria-labelledby":"mcp-connect",className:`${B} space-y-4`,children:[t.jsxs("div",{children:[t.jsx("h2",{id:"mcp-connect",className:"text-base font-semibold text-gray-100",children:"Connect an agent"}),t.jsxs("p",{className:"text-sm text-gray-400 mt-1",children:["Pick your agent and how it connects: what to paste has this server's address filled in",H!=="tvpat_…"?", and your token":"","."]})]}),t.jsx(_e,{server:window.location.origin,token:H,project:de?(U=m.data)==null?void 0:U.rootPath:void 0,way:w,onWay:A,tokenMissing:H==="tvpat_…",copied:E,onCopy:(c,S)=>void J(c,S),tokenControl:t.jsxs("div",{className:"space-y-2",children:[i.isLoading?t.jsxs("p",{className:"text-sm text-gray-500",children:[t.jsx(se,{size:14,className:"animate-spin inline mr-1.5"}),"Loading your tokens…"]}):v.length===0?t.jsxs("p",{className:"text-sm text-gray-400",children:["You have no token yet: ",t.jsx("button",{type:"button",onClick:()=>N(!0),className:"underline",children:"make one for the agent"}),"."]}):t.jsxs("label",{className:"flex flex-col gap-1.5 text-xs text-gray-500",children:["The agent's token: it may do what the token may do",t.jsx("select",{value:(o==null?void 0:o.id)??"",onChange:c=>{g(c.target.value),b("")},className:"px-3 py-2 rounded-xl bg-surface-1 border border-white/10 text-sm text-gray-900 dark:text-gray-200 focus:outline-none focus:border-brand-500/50",children:v.map(c=>t.jsxs("option",{value:c.id,children:[c.name," — ",["reads",...c.scopes.includes("run")?["runs tests"]:[],...c.scopes.includes("ai")?["uses AI"]:[]].join(", ")]},c.id))})]}),$?t.jsxs("p",{className:"text-xs text-amber-300 flex items-start gap-1.5",children:[t.jsx(ne,{size:13,className:"mt-0.5 shrink-0"}),"The settings below hold this token's value: copy them now. It is not shown again."]}):v.length>0&&o&&t.jsxs(t.Fragment,{children:[t.jsxs("label",{className:"flex flex-col gap-1.5 text-xs text-gray-500",children:["Its value — shown only when it was made; paste it to fill it in below (it stays on this page)",t.jsx("input",{type:"password",autoComplete:"off",spellCheck:!1,value:u,onChange:c=>ie(c.target.value),placeholder:`${o.prefix}…`,"aria-invalid":P?!0:void 0,className:`px-3 py-2 rounded-xl bg-surface-1 border text-sm font-mono text-gray-900 dark:text-gray-200 focus:outline-none ${P?"border-red-500/50":"border-white/10 focus:border-brand-500/50"}`})]}),P?t.jsx("p",{role:"alert",className:"text-xs text-red-400",children:P}):_?t.jsxs("p",{className:"text-xs text-emerald-400 flex items-center gap-1.5",children:[t.jsx(G,{size:13})," Filled in below."]}):t.jsxs("p",{className:"text-xs text-gray-500",children:["Don’t have it? ",t.jsx("button",{type:"button",onClick:()=>N(!0),className:"underline",children:"Make a token for the agent"}),": its value is filled in for you."]})]})]})})]}),t.jsxs("section",{"aria-labelledby":"mcp-tools",className:`${B} space-y-3`,children:[t.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-3",children:[t.jsx("h2",{id:"mcp-tools",className:"text-base font-semibold text-gray-100",children:"What the agent can do"}),t.jsx("span",{className:"text-xs text-gray-500",children:k==="server"?o?`With the token ${o.name}`:"With a token":"On the agent's computer"})]}),t.jsx("div",{className:"grid gap-2.5 sm:grid-cols-2 xl:grid-cols-4",children:Ie.map(c=>{const S=Re(c,o,z,k);return t.jsxs("div",{className:"px-3.5 py-3 rounded-xl bg-surface-2 space-y-1",children:[t.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.jsx("code",{className:"text-[13px] text-gray-200",children:c.name}),S&&t.jsx("span",{className:`text-xs px-2 py-0.5 rounded-md ${Le[S.tone]}`,children:S.text})]}),t.jsx("p",{className:"text-[13px] text-gray-400",children:c.what})]},c.name)})})]}),t.jsxs("section",{"aria-labelledby":"mcp-agents",className:`${B} space-y-3`,children:[t.jsxs("h2",{id:"mcp-agents",className:"text-base font-semibold text-gray-100",children:["Connected agents ",t.jsxs("span",{className:"font-normal text-gray-500",children:["· ",((Q=d.data)==null?void 0:Q.sessions.length)??0]})]}),d.isError?t.jsxs("p",{className:"text-sm text-red-300",children:["Could not load: ",(Y=d.error)==null?void 0:Y.message]}):d.data?d.data.sessions.length===0?t.jsxs("p",{className:"text-sm text-gray-500",children:["No agent is connected to this server's address now. Agents running ",t.jsx("code",{children:"testver mcp"})," on their own computer are not listed here."]}):t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-[13px]",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"text-left text-gray-500",children:[t.jsx("th",{className:"py-2 pr-3 font-medium",children:"Agent"}),t.jsx("th",{className:"py-2 pr-3 font-medium",children:"Token"}),d.data.isAdmin&&t.jsx("th",{className:"py-2 pr-3 font-medium",children:"Owner"}),t.jsx("th",{className:"py-2 pr-3 font-medium",children:"From"}),t.jsx("th",{className:"py-2 pr-3 font-medium",children:"Last active"}),t.jsx("th",{className:"py-2 pr-3 font-medium",children:"Tool calls"}),t.jsx("th",{className:"py-2"})]})}),t.jsx("tbody",{children:d.data.sessions.map(c=>t.jsxs("tr",{className:"border-t border-white/5",children:[t.jsx("td",{className:"py-2.5 pr-3 text-gray-200",children:c.agent??"An agent"}),t.jsx("td",{className:"py-2.5 pr-3 font-mono text-[12.5px] text-gray-300",children:c.tokenName}),d.data.isAdmin&&t.jsx("td",{className:"py-2.5 pr-3 text-gray-400",children:c.mine?"You":c.owner??"—"}),t.jsx("td",{className:"py-2.5 pr-3 text-gray-400",children:c.ip??"—"}),t.jsx("td",{className:"py-2.5 pr-3 text-gray-400",children:Oe(c.lastSeen)}),t.jsx("td",{className:"py-2.5 pr-3 text-gray-200",children:c.calls}),t.jsx("td",{className:"py-2.5 text-right",children:c.canEnd&&t.jsx("button",{type:"button",onClick:()=>T(c),className:"px-2.5 py-1 rounded-lg border border-white/10 text-xs text-red-300 hover:bg-red-500/10",children:"End"})})]},c.id))})]})}):t.jsxs("p",{className:"text-sm text-gray-500",children:[t.jsx(se,{size:14,className:"animate-spin inline mr-1.5"}),"Loading…"]})]}),t.jsxs("section",{"aria-labelledby":"mcp-activity",className:`${B} space-y-2`,children:[t.jsxs("div",{className:"flex flex-wrap items-baseline justify-between gap-3",children:[t.jsx("h2",{id:"mcp-activity",className:"text-base font-semibold text-gray-100",children:"Recent activity"}),((X=d.data)==null?void 0:X.isAdmin)&&t.jsx(F,{to:"/audit",className:"text-sm text-gray-400 hover:text-gray-200 underline",children:"All in the Audit Log"})]}),d.data&&d.data.activity.length===0?t.jsx("p",{className:"text-sm text-gray-500",children:"Nothing yet: what agents ask for through this server's address shows here."}):t.jsx("div",{children:(((ee=d.data)==null?void 0:ee.activity)??[]).map((c,S)=>t.jsxs("div",{className:"grid grid-cols-[76px_130px_minmax(0,1fr)_auto] gap-3 items-center py-2.5 border-t border-white/5 text-[13px]",children:[t.jsx("span",{className:"text-gray-500 whitespace-nowrap",children:Me(c.at)}),t.jsx("code",{className:"text-gray-200",children:c.tool}),t.jsxs("span",{className:"text-gray-300 truncate",children:[ze(c)," · ",c.token,c.owner?` (${c.owner})`:""]}),c.refused?t.jsx("span",{className:"text-xs px-2 py-0.5 rounded-md bg-white/5 text-gray-300",children:"refused"}):t.jsx("span",{})]},`${c.at}-${S}`))})]}),t.jsxs("section",{"aria-label":"Rules",className:"grid gap-3 sm:grid-cols-3 text-[13px] text-gray-400 leading-relaxed",children:[t.jsxs("div",{className:"p-4 rounded-xl border border-white/5",children:[t.jsx("p",{className:"font-semibold text-gray-200 mb-1",children:"Never the whole suite"}),"Naming every test, or more than 100, is refused: run it from Test Explorer → Suites."]}),t.jsxs("div",{className:"p-4 rounded-xl border border-white/5",children:[t.jsx("p",{className:"font-semibold text-gray-200 mb-1",children:"The token's limits"}),M?`${M.perMinute} requests a minute, ${M.runsAtOnce} run${M.runsAtOnce===1?"":"s"} at once, ${M.aiPerDay} AI requests and ${M.aiCreditsPerDay} credits a day.`:"…"]}),t.jsxs("div",{className:"p-4 rounded-xl border border-white/5",children:[t.jsx("p",{className:"font-semibold text-gray-200 mb-1",children:"In the Audit Log"}),"Every operation, under the token's owner, marked MCP."]})]})]})}),h&&i.data&&t.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 p-4",children:t.jsxs("div",{role:"dialog","aria-modal":"true","aria-labelledby":"mcp-make-token",className:"w-full max-w-2xl rounded-2xl bg-surface-1 border border-white/10 p-6",children:[t.jsxs("div",{className:"flex items-center justify-between mb-3",children:[t.jsxs("h3",{id:"mcp-make-token",className:"text-base font-semibold text-gray-100 flex items-center gap-2",children:[t.jsx(Ae,{size:16})," Make a token for an agent"]}),t.jsx("button",{type:"button",onClick:()=>N(!1),"aria-label":"Close",className:"p-1.5 rounded-lg text-gray-400 hover:text-gray-200",children:t.jsx($e,{size:16})})]}),t.jsx(ue,{defaultName:"AI agent",days:i.data.days,defaultDays:i.data.defaultDays,canRun:i.data.canRun,canUseAi:i.data.canUseAi===!0,aiOff:i.data.aiOff===!0,aiLimits:i.data.aiLimits,serverLimits:i.data.limits,onCreated:c=>{j(c),g(c.accessToken.id),w==="local"&&A("server"),N(!1),a.invalidateQueries({queryKey:["access-tokens"]})}}),t.jsx("p",{className:"text-xs text-gray-500",children:"Its value goes into the settings on this page, once. It is also listed in Settings → Access Tokens."})]})}),l&&t.jsx(ye,{open:!0,title:`End ${l.agent??"this agent"}'s session?`,description:"The agent is disconnected now. It can connect again with its token; to stop that, revoke the token in Access Tokens.",confirmLabel:"End session",variant:"danger",onCancel:()=>T(null),onConfirm:()=>void le()})]})}export{Je as TestverMcpPage};
|
package/src/ui/static/assets/{UncommittedDiffViewer-FKvUZcRi.js → UncommittedDiffViewer-BNroxCoo.js}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,j as t}from"./vendor-react-DOVfxdUy.js";import{
|
|
2
|
-
`),l=
|
|
1
|
+
import{r as p,j as t}from"./vendor-react-DOVfxdUy.js";import{ay as T,s as _,h as B,z as F,u as I,b5 as R,cA as H,b8 as K,ac as V,d6 as X,d7 as q,b$ as G}from"./vendor-icons-Cm92aSc5.js";const $=200,x=r=>`${r.staged?"s":"u"}:${r.path}`;function Y({files:r,showGroups:P=!0,defaultExpanded:g=!1,onStageFile:u,onUnstageFile:b,onStageAll:j,onUnstageAll:f,onDiscardFile:N,busy:c=!1}){const[E,w]=p.useState(()=>{if(g){const e={};return r.forEach(s=>{e[x(s)]=!0}),e}return{}}),[v,U]=p.useState(g),[A,D]=p.useState({});if(r.length===0)return null;const y=r.filter(e=>e.staged),C=r.filter(e=>!e.staged),W=()=>{const e=!v;U(e);const s={};r.forEach(n=>{s[x(n)]=e}),w(s)},L=e=>{w(s=>({...s,[e]:!s[e]}))},M=e=>{switch(e){case"added":case"untracked":return t.jsx(G,{size:13,className:"text-emerald-400"});case"deleted":return t.jsx(q,{size:13,className:"text-red-400"});case"renamed":return t.jsx(X,{size:13,className:"text-sky-400"});default:return t.jsx(V,{size:13,className:"text-amber-400"})}},k=(e,s)=>{const n=E[s]??!1,h=!e.staged&&u,m=e.staged&&b;return t.jsxs("div",{className:"rounded-lg border border-white/5 bg-black/20 overflow-hidden",children:[t.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 hover:bg-surface-2/50 transition-colors",children:[t.jsxs("button",{onClick:()=>L(s),"aria-expanded":n,className:"flex items-center gap-2 flex-1 text-left min-w-0",children:[t.jsx("span",{className:"text-gray-500 flex-shrink-0",children:n?t.jsx(F,{size:13}):t.jsx(I,{size:13})}),M(e.status),t.jsx("span",{className:"text-sm text-gray-200 font-mono truncate flex-1",children:e.path}),e.additions>0&&t.jsxs("span",{className:"text-xs text-emerald-500 flex-shrink-0 font-medium",children:["+",e.additions]}),e.deletions>0&&t.jsxs("span",{className:"text-xs text-red-500 flex-shrink-0 font-medium",children:["-",e.deletions]}),t.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full flex-shrink-0 font-medium ${e.status==="untracked"||e.status==="added"?"bg-emerald-500/10 text-emerald-500":e.status==="deleted"?"bg-red-500/10 text-red-500":"bg-amber-500/10 text-amber-500"}`,children:e.status})]}),h&&t.jsxs("button",{onClick:a=>{a.stopPropagation(),u(e.path)},disabled:c,className:"flex items-center gap-1 px-2.5 py-1.5 rounded text-xs font-medium text-emerald-500 hover:bg-emerald-500/10 border border-emerald-500/20 flex-shrink-0 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:`Stage ${e.path} — put its changes into the next commit`,"aria-label":`Stage ${e.path}`,children:[t.jsx(R,{size:12})," Stage"]}),m&&t.jsxs("button",{onClick:a=>{a.stopPropagation(),b(e.path)},disabled:c,className:"flex items-center gap-1 px-2.5 py-1.5 rounded text-xs font-medium text-gray-400 hover:bg-gray-500/10 border border-white/10 flex-shrink-0 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:`Unstage ${e.path} — take it out of the next commit (your edits stay)`,"aria-label":`Unstage ${e.path}`,children:[t.jsx(H,{size:12})," Unstage"]}),N&&!e.staged&&t.jsxs("button",{onClick:a=>{a.stopPropagation(),N(e)},disabled:c,className:"flex items-center gap-1 px-2.5 py-1.5 rounded text-xs font-medium text-red-500 hover:bg-red-500/10 border border-red-500/20 flex-shrink-0 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",title:`Discard changes to ${e.path} — throw the edits away for good (can't be undone)`,"aria-label":`Discard changes to ${e.path}`,children:[t.jsx(K,{size:12})," Discard"]})]}),n&&e.patch&&(()=>{const a=e.patch.split(`
|
|
2
|
+
`),l=A[s]??!1,z=l?0:Math.max(0,a.length-$);return t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"border-t border-white/5 max-h-[440px] overflow-auto",children:t.jsx("pre",{className:"text-sm font-mono leading-[1.6] whitespace-pre",children:(l?a:a.slice(0,$)).map((d,O)=>{let o="",i="text-gray-400";return d.startsWith("+++")||d.startsWith("---")?(i="text-gray-500 font-bold",o="bg-white/[0.02]"):d.startsWith("@@")?(i="text-sky-400/50",o="bg-sky-500/5"):d.startsWith("+")?(i="text-emerald-500",o="bg-emerald-500/10"):d.startsWith("-")&&(i="text-red-500",o="bg-red-500/10"),t.jsx("div",{className:`px-3 ${o} ${i}`,children:d||" "},O)})})}),z>0&&t.jsxs("button",{onClick:()=>D(d=>({...d,[s]:!0})),className:"w-full px-3 py-1.5 text-xs font-medium text-brand-400 hover:text-brand-300 hover:bg-brand-500/5 border-t border-white/5 transition-colors",children:["Show all ",a.length," lines (",z," more)"]}),e.truncated&&t.jsx("div",{className:"border-t border-white/5 px-3 py-1.5 text-xs text-amber-600 dark:text-amber-400",children:"This diff is too large to show in full — the rest is cut off. Open the file to see all of it."})]})})(),n&&!e.patch&&t.jsx("div",{className:"border-t border-white/5 px-3 py-2 text-xs text-gray-500",children:e.noPreview?"No preview — only the first 50 new files are previewed. Stage and commit work as usual.":"No diff content available."})]},s)},S=(e,s,n,h,m,a)=>e.length===0?null:t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[h,t.jsxs("span",{className:`text-[11px] font-semibold uppercase flex-1 ${m}`,children:[n," (",e.length,")"]}),a&&t.jsx("button",{onClick:a.onClick,disabled:c,className:"text-[11px] text-gray-500 hover:text-gray-300 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:a.label})]}),t.jsx("div",{className:"space-y-1",children:e.map(l=>k(l,x(l)))})]});return t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("span",{className:"text-[11px] font-semibold text-gray-400 uppercase",children:[r.length," changed file",r.length!==1?"s":""]}),t.jsxs("button",{onClick:W,className:"flex items-center gap-1 text-[11px] text-gray-500 hover:text-gray-300 transition-colors",children:[t.jsx(T,{size:11}),v?"Collapse All":"Expand All"]})]}),P?t.jsxs("div",{className:"space-y-4",children:[S(y,"s","Staged",t.jsx(_,{size:12,className:"text-emerald-400"}),"text-emerald-400",f&&y.length>0?{label:"Unstage All",onClick:f}:void 0),S(C,"u","Unstaged",t.jsx(B,{size:12,className:"text-amber-400"}),"text-amber-400",j&&C.length>0?{label:"Stage All",onClick:j}:void 0)]}):t.jsx("div",{className:"space-y-1",children:r.map(e=>k(e,x(e)))})]})}export{Y as U};
|
package/src/ui/static/assets/{UserManagementPage-gDGhaHE4.js → UserManagementPage-BU4MuDJZ.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{r as c,j as e,d as N}from"./vendor-react-DOVfxdUy.js";import{a as W}from"./formatDate-T65-Y6Mi.js";import{a as Y,u as Z,c as m}from"./vendor-query-DkZSMtfn.js";import{ae as ee,b as se,
|
|
2
|
-
focus:outline-none focus:border-brand-500/50 disabled:opacity-50`,placeholder:"username"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Display Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.displayName,onChange:s=>d({...a,displayName:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-100\r
|
|
3
|
-
focus:outline-none focus:border-brand-500/50`,placeholder:"Display Name"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Email ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"email",required:!0,value:a.email,onChange:s=>d({...a,email:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-lg text-sm text-gray-100\r
|
|
4
|
-
focus:outline-none focus:border-brand-500/50`,placeholder:"user@example.com"})]}),n==="create"&&e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Password ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(D,{value:a.password,onChange:s=>d({...a,password:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-lg text-sm text-gray-100\r
|
|
5
|
-
focus:outline-none focus:border-brand-500/50`,placeholder:"Min. 6 characters"})]}),n==="edit"&&(r==null?void 0:r.role)==="superadmin"?e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Role"}),e.jsx("p",{className:"text-xs text-gray-500 border border-white/5 rounded-lg p-2.5",children:"Super admin — the account created at setup. This role cannot be changed."})]}):e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Role"}),e.jsx("div",{className:"space-y-2",children:pe.filter(s=>C||s.value!=="admin"||(r==null?void 0:r.role)==="admin").map(s=>{const U=!C&&(r==null?void 0:r.role)==="admin";return e.jsxs("label",{className:`flex items-center gap-3 p-2.5 rounded-lg border transition-colors
|
|
6
|
-
${U?"cursor-not-allowed opacity-60":"cursor-pointer"}
|
|
7
|
-
${a.role===s.value?"border-brand-500/50 bg-brand-500/5":"border-white/5 hover:border-white/10"}`,children:[e.jsx("input",{type:"radio",name:"role",value:s.value,checked:a.role===s.value,disabled:U,onChange:()=>d({...a,role:s.value}),className:"accent-brand-500"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm text-gray-200",children:s.label}),e.jsx("p",{className:"text-xs text-gray-500",children:s.description})]})]},s.value)})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 rounded-lg hover:bg-surface-2",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:
|
|
8
|
-
disabled:opacity-50 transition-colors`,children:[e.jsx(M,{size:14}),n==="create"?"Create":"Save"]})]})]}),n==="reset-password"&&r&&e.jsxs("form",{onSubmit:s=>{s.preventDefault(),
|
|
9
|
-
focus:outline-none focus:border-brand-500/50`,placeholder:"Min. 6 characters",autoFocus:!0})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 rounded-lg hover:bg-surface-2",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:
|
|
10
|
-
disabled:opacity-50 transition-colors`,children:[e.jsx(L,{size:14}),"Reset Password"]})]})]})]})]}),document.body),i&&N.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>g(null)}),e.jsxs("div",{className:"relative z-10 bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4",children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-white/5",children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center shrink-0 ${i.isActive?"bg-amber-500/10":"bg-emerald-500/10"}`,children:i.isActive?e.jsx(P,{size:20,className:"text-amber-400"}):e.jsx(z,{size:20,className:"text-emerald-400"})}),e.jsx("h3",{className:"text-base font-semibold text-gray-100",children:i.isActive?"Disable User":"Enable User"})]}),e.jsx("div",{className:"px-6 py-4",children:e.jsx("p",{className:"text-sm text-gray-300",children:i.isActive?e.jsxs(e.Fragment,{children:["Are you sure you want to disable ",e.jsxs("strong",{className:"text-gray-100",children:['"',i.displayName,'"']}),"? They will not be able to log in and all active sessions will be revoked."]}):e.jsxs(e.Fragment,{children:["Are you sure you want to re-enable ",e.jsxs("strong",{className:"text-gray-100",children:['"',i.displayName,'"']}),"? They will be able to log in again."]})})}),e.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>g(null),className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors rounded-lg",children:"Cancel"}),e.jsx("button",{onClick:
|
|
1
|
+
import{r as c,j as e,d as N}from"./vendor-react-DOVfxdUy.js";import{a as W}from"./formatDate-T65-Y6Mi.js";import{a as Y,u as Z,c as m}from"./vendor-query-DkZSMtfn.js";import{ae as ee,b as se,fL as te,fM as ae,fN as re,fO as le,fP as ie,fQ as ne,fR as de,B as oe,eS as D}from"./index-BlA8ntjb.js";import{U as ce,b5 as xe,d8 as z,d9 as P,ad as M,p as q,b7 as me,a9 as L,an as O,D as ue,b8 as he,X as be}from"./vendor-icons-Cm92aSc5.js";const pe=[{value:"admin",label:"Admin",description:"Full access + user management (created by the super admin)"},{value:"tester",label:"Tester",description:"Run tests, edit files, use tools"},{value:"viewer",label:"Viewer",description:"Read-only dashboard access"}],ye=t=>t==="superadmin"?"super admin":t,fe=t=>t==="superadmin"?"yellow":t==="admin"?"brand":t==="tester"?"green":"gray";function ke(){const{user:t}=ee(),{toast:l}=se(),u=Y(),{data:v,isLoading:Q}=Z({queryKey:["users"],queryFn:te}),[n,p]=c.useState(null),[r,w]=c.useState(null),[h,y]=c.useState(null),[b,f]=c.useState(null),[i,g]=c.useState(null),[a,d]=c.useState({username:"",displayName:"",email:"",password:"",role:"tester"}),[k,S]=c.useState(""),R=(v==null?void 0:v.users)??[],C=(t==null?void 0:t.role)==="superadmin",F=m({mutationFn:()=>ae(a),onSuccess:()=>{u.invalidateQueries({queryKey:["users"]}),l("success","User created successfully"),o()},onError:s=>l("error",s.message)}),A=m({mutationFn:s=>re(s.id,s.updates),onSuccess:()=>{u.invalidateQueries({queryKey:["users"]}),l("success","User updated"),o()},onError:s=>l("error",s.message)}),$=m({mutationFn:le,onSuccess:()=>{u.invalidateQueries({queryKey:["users"]}),l("success","User deleted")},onError:s=>l("error",s.message)}),T=m({mutationFn:()=>ie(r.id,k),onSuccess:()=>{l("success","Password reset successfully"),o()},onError:s=>l("error",s.message)}),E=m({mutationFn:ne,onSuccess:()=>{u.invalidateQueries({queryKey:["users"]}),l("success","Two-factor authentication reset"),f(null)},onError:s=>l("error",s.message)}),K=m({mutationFn:de,onSuccess:s=>{u.invalidateQueries({queryKey:["users"]}),l("success",`Revoked ${s.sessionsRevoked} session(s)`)},onError:s=>l("error",s.message)});function I(){d({username:"",displayName:"",email:"",password:"",role:"tester"}),p("create")}function B(s){w(s),d({username:s.username,displayName:s.displayName,email:s.email||"",password:"",role:s.role}),p("edit")}function X(s){w(s),S(""),p("reset-password")}function o(){p(null),w(null)}function V(s){y(s)}function _(){h&&($.mutate(h.id),y(null))}function G(s){g(s)}function H(){i&&(A.mutate({id:i.id,updates:{isActive:!i.isActive}}),g(null))}const x=s=>s.id===(t==null?void 0:t.id)?!0:!(s.role==="superadmin"||s.role==="admin"&&!C),j=s=>s.role==="superadmin",J=s=>!!s.twoFactorEnabled&&s.id!==(t==null?void 0:t.id)&&!j(s)&&x(s);return e.jsxs("div",{className:"min-h-screen bg-surface-0 text-gray-200",children:[e.jsx("div",{className:"border-b border-white/5 bg-surface-1",children:e.jsx("div",{className:"max-w-[1400px] mx-auto px-6 py-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold text-gray-100 flex items-center gap-3",children:[e.jsx(ce,{size:24,className:"text-brand-300"}),"User Management",e.jsxs("span",{className:"text-sm font-normal bg-brand-500/15 text-brand-300 px-2.5 py-0.5 rounded-full",children:[R.length," users"]})]}),e.jsx("p",{className:"text-sm text-gray-400 mt-1",children:"Manage user accounts, roles, and access"})]}),e.jsxs("button",{onClick:I,className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-brand-600 hover:bg-brand-500 rounded-lg transition-colors",children:[e.jsx(xe,{size:16}),"Add User"]})]})})}),e.jsxs("div",{className:"max-w-[1400px] mx-auto px-6 py-8 space-y-6",children:[Q?e.jsx("div",{className:"text-sm text-gray-500",children:"Loading users..."}):e.jsx("div",{className:"bg-surface-1 rounded-xl border border-white/5 overflow-hidden",children:e.jsxs("table",{className:"w-full",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-white/5 text-sm text-gray-500",children:[e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"User"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Email"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Role"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Status"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"2FA"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Last Login"}),e.jsx("th",{className:"text-left px-4 py-3 font-medium",children:"Sessions"}),e.jsx("th",{className:"text-right px-4 py-3 font-medium",children:"Actions"})]})}),e.jsx("tbody",{className:"divide-y divide-white/5",children:R.map(s=>e.jsxs("tr",{className:"hover:bg-white/[0.02]",children:[e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-8 h-8 rounded-full bg-brand-500/20 flex items-center justify-center text-brand-300 text-sm font-semibold",children:s.displayName.charAt(0).toUpperCase()}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-gray-200 font-medium",children:s.displayName}),e.jsxs("p",{className:"text-xs text-gray-500",children:["@",s.username]})]}),s.id===(t==null?void 0:t.id)&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 bg-brand-500/10 text-brand-400 rounded",children:"you"})]})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx("span",{className:"text-sm text-gray-400",children:s.email||e.jsx("span",{className:"text-gray-600 italic",children:"—"})})}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(oe,{label:ye(s.role),color:fe(s.role)})}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("span",{className:`flex items-center gap-1.5 text-xs ${s.isActive?"text-emerald-400":"text-gray-500"}`,children:[s.isActive?e.jsx(z,{size:14}):e.jsx(P,{size:14}),s.isActive?"Active":"Disabled"]})}),e.jsx("td",{className:"px-4 py-3","data-testid":`two-factor-${s.username}`,children:s.twoFactorEnabled?e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400 whitespace-nowrap",children:[e.jsx(M,{size:14})," On"]}):s.twoFactorRequired?e.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-amber-400 whitespace-nowrap",title:"Required by the workspace — they set it up at their next sign-in",children:[e.jsx(q,{size:13,className:"flex-shrink-0"})," Not set up"]}):e.jsx("span",{className:"text-xs text-gray-500",children:"Off"})}),e.jsx("td",{className:"px-4 py-3 text-xs text-gray-500",children:s.lastLoginAt?W(s.lastLoginAt):"Never"}),e.jsx("td",{className:"px-4 py-3 text-xs text-gray-500",children:s.sessions}),e.jsx("td",{className:"px-4 py-3",children:e.jsxs("div",{className:"flex items-center justify-end gap-1",children:[e.jsx("button",{onClick:()=>B(s),className:"p-1.5 rounded hover:bg-surface-2 text-gray-400 hover:text-gray-200 disabled:opacity-30",title:"Edit user",disabled:!x(s),children:e.jsx(me,{size:14})}),e.jsx("button",{onClick:()=>X(s),className:"p-1.5 rounded hover:bg-surface-2 text-gray-400 hover:text-gray-200 disabled:opacity-30",title:"Reset password",disabled:!x(s),children:e.jsx(L,{size:14})}),e.jsx("button",{onClick:()=>f(s),className:"p-1.5 rounded hover:bg-surface-2 text-gray-400 hover:text-amber-400 disabled:opacity-30",title:s.twoFactorEnabled?s.id===(t==null?void 0:t.id)?"Turn your own off from Profile":j(s)?"The super admin's two-factor authentication cannot be reset here":"Reset two-factor authentication":"Two-factor authentication is off",disabled:!J(s),children:e.jsx(O,{size:14})}),e.jsx("button",{onClick:()=>K.mutate(s.id),className:"p-1.5 rounded hover:bg-surface-2 text-gray-400 hover:text-gray-200 disabled:opacity-30",title:"Revoke sessions",disabled:s.sessions===0||!x(s),children:e.jsx(ue,{size:14})}),e.jsx("button",{onClick:()=>G(s),className:`p-1.5 rounded hover:bg-surface-2 disabled:opacity-30 ${s.isActive?"text-gray-400 hover:text-amber-400":"text-gray-400 hover:text-emerald-400"}`,title:s.isActive?"Disable user":"Enable user",disabled:j(s)||!x(s),children:s.isActive?e.jsx(P,{size:14}):e.jsx(z,{size:14})}),e.jsx("button",{onClick:()=>V(s),className:"p-1.5 rounded hover:bg-surface-2 text-gray-400 hover:text-red-400 disabled:opacity-30",title:"Delete user",disabled:s.id===(t==null?void 0:t.id)||j(s)||!x(s),children:e.jsx(he,{size:14})})]})})]},s.id))})]})}),n&&N.createPortal(e.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:o}),e.jsxs("div",{className:"relative bg-surface-1 rounded-xl border border-white/10 p-6 w-full max-w-md animate-fade-in",children:[e.jsxs("div",{className:"flex items-center justify-between mb-5",children:[e.jsx("h3",{className:"text-xl font-bold text-gray-100",children:n==="create"?"Create User":n==="edit"?"Edit User":"Reset Password"}),e.jsx("button",{onClick:o,className:"p-1 rounded hover:bg-surface-2 text-gray-400",children:e.jsx(be,{size:18})})]}),(n==="create"||n==="edit")&&e.jsxs("form",{onSubmit:s=>{s.preventDefault(),n==="create"?F.mutate():r&&A.mutate({id:r.id,updates:{displayName:a.displayName,email:a.email,role:a.role}})},className:"space-y-4",children:[e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Username ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.username,onChange:s=>d({...a,username:s.target.value}),disabled:n==="edit",className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-100\r
|
|
2
|
+
focus:outline-none focus:border-brand-500/50 disabled:opacity-50`,placeholder:"username"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Display Name ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"text",value:a.displayName,onChange:s=>d({...a,displayName:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-100\r
|
|
3
|
+
focus:outline-none focus:border-brand-500/50`,placeholder:"Display Name"})]}),e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Email ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx("input",{type:"email",required:!0,value:a.email,onChange:s=>d({...a,email:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-lg text-sm text-gray-100\r
|
|
4
|
+
focus:outline-none focus:border-brand-500/50`,placeholder:"user@example.com"})]}),n==="create"&&e.jsxs("div",{children:[e.jsxs("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:["Password ",e.jsx("span",{className:"text-red-400",children:"*"})]}),e.jsx(D,{value:a.password,onChange:s=>d({...a,password:s.target.value}),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-lg text-sm text-gray-100\r
|
|
5
|
+
focus:outline-none focus:border-brand-500/50`,placeholder:"Min. 6 characters"})]}),n==="edit"&&(r==null?void 0:r.role)==="superadmin"?e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Role"}),e.jsx("p",{className:"text-xs text-gray-500 border border-white/5 rounded-lg p-2.5",children:"Super admin — the account created at setup. This role cannot be changed."})]}):e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"Role"}),e.jsx("div",{className:"space-y-2",children:pe.filter(s=>C||s.value!=="admin"||(r==null?void 0:r.role)==="admin").map(s=>{const U=!C&&(r==null?void 0:r.role)==="admin";return e.jsxs("label",{className:`flex items-center gap-3 p-2.5 rounded-lg border transition-colors
|
|
6
|
+
${U?"cursor-not-allowed opacity-60":"cursor-pointer"}
|
|
7
|
+
${a.role===s.value?"border-brand-500/50 bg-brand-500/5":"border-white/5 hover:border-white/10"}`,children:[e.jsx("input",{type:"radio",name:"role",value:s.value,checked:a.role===s.value,disabled:U,onChange:()=>d({...a,role:s.value}),className:"accent-brand-500"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-sm text-gray-200",children:s.label}),e.jsx("p",{className:"text-xs text-gray-500",children:s.description})]})]},s.value)})})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 rounded-lg hover:bg-surface-2",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:F.isPending||A.isPending,className:`flex items-center gap-2 px-5 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium rounded-xl\r
|
|
8
|
+
disabled:opacity-50 transition-colors`,children:[e.jsx(M,{size:14}),n==="create"?"Create":"Save"]})]})]}),n==="reset-password"&&r&&e.jsxs("form",{onSubmit:s=>{s.preventDefault(),T.mutate()},className:"space-y-4",children:[e.jsxs("p",{className:"text-sm text-gray-400",children:["Set a new password for ",e.jsx("span",{className:"text-gray-200 font-medium",children:r.username})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium text-gray-400 mb-1",children:"New Password"}),e.jsx(D,{value:k,onChange:s=>S(s.target.value),className:`w-full px-3 py-2 bg-surface-2 border border-white/10 rounded-xl text-[15px] text-gray-100\r
|
|
9
|
+
focus:outline-none focus:border-brand-500/50`,placeholder:"Min. 6 characters",autoFocus:!0})]}),e.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[e.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-sm text-gray-400 hover:text-gray-200 rounded-lg hover:bg-surface-2",children:"Cancel"}),e.jsxs("button",{type:"submit",disabled:T.isPending||k.length<6,className:`flex items-center gap-2 px-5 py-2.5 bg-brand-600 hover:bg-brand-500 text-white text-[15px] font-medium rounded-xl\r
|
|
10
|
+
disabled:opacity-50 transition-colors`,children:[e.jsx(L,{size:14}),"Reset Password"]})]})]})]})]}),document.body),i&&N.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>g(null)}),e.jsxs("div",{className:"relative z-10 bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4",children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-white/5",children:[e.jsx("div",{className:`w-10 h-10 rounded-full flex items-center justify-center shrink-0 ${i.isActive?"bg-amber-500/10":"bg-emerald-500/10"}`,children:i.isActive?e.jsx(P,{size:20,className:"text-amber-400"}):e.jsx(z,{size:20,className:"text-emerald-400"})}),e.jsx("h3",{className:"text-base font-semibold text-gray-100",children:i.isActive?"Disable User":"Enable User"})]}),e.jsx("div",{className:"px-6 py-4",children:e.jsx("p",{className:"text-sm text-gray-300",children:i.isActive?e.jsxs(e.Fragment,{children:["Are you sure you want to disable ",e.jsxs("strong",{className:"text-gray-100",children:['"',i.displayName,'"']}),"? They will not be able to log in and all active sessions will be revoked."]}):e.jsxs(e.Fragment,{children:["Are you sure you want to re-enable ",e.jsxs("strong",{className:"text-gray-100",children:['"',i.displayName,'"']}),"? They will be able to log in again."]})})}),e.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>g(null),className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors rounded-lg",children:"Cancel"}),e.jsx("button",{onClick:H,className:`px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors ${i.isActive?"bg-amber-600 hover:bg-amber-500":"bg-emerald-600 hover:bg-emerald-500"}`,children:i.isActive?"Disable User":"Enable User"})]})]})]}),document.body),b&&N.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center","data-testid":"reset-two-factor-dialog",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>f(null)}),e.jsxs("div",{className:"relative z-10 bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4",children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-white/5",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-amber-500/10 flex items-center justify-center shrink-0",children:e.jsx(O,{size:20,className:"text-amber-400"})}),e.jsx("h3",{className:"text-base font-semibold text-gray-100",children:"Reset two-factor authentication"})]}),e.jsxs("div",{className:"px-6 py-4 space-y-2",children:[e.jsxs("p",{className:"text-sm text-gray-300",children:["Turn off two-factor authentication for ",e.jsx("strong",{className:"text-gray-100",children:b.displayName})," (@",b.username,")?"]}),e.jsxs("p",{className:"text-xs text-gray-500",children:["Use this when they lost their phone and their recovery codes. Their authenticator entry, recovery codes and trusted browsers stop working.",b.twoFactorRequired?" The workspace requires two-factor authentication, so they set it up again at their next sign-in.":" They sign in with their password only until they turn it on again."," ","If email is set up, they are told by email."]})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>f(null),className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors rounded-lg",children:"Cancel"}),e.jsx("button",{onClick:()=>E.mutate(b.id),disabled:E.isPending,className:"px-4 py-2 text-sm font-medium text-white bg-amber-600 hover:bg-amber-500 rounded-lg transition-colors disabled:opacity-50",children:"Reset 2FA"})]})]})]}),document.body),h&&N.createPortal(e.jsxs("div",{className:"fixed inset-0 z-[70] flex items-center justify-center",children:[e.jsx("div",{className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>y(null)}),e.jsxs("div",{className:"relative z-10 bg-surface-1 rounded-xl border border-white/10 shadow-2xl w-full max-w-md mx-4",children:[e.jsxs("div",{className:"flex items-center gap-3 px-6 py-4 border-b border-white/5",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-red-500/10 flex items-center justify-center shrink-0",children:e.jsx(q,{size:20,className:"text-red-400"})}),e.jsx("h3",{className:"text-base font-semibold text-gray-100",children:"Delete User"})]}),e.jsxs("div",{className:"px-6 py-4",children:[e.jsxs("p",{className:"text-sm text-gray-300",children:["Are you sure you want to permanently delete ",e.jsxs("strong",{className:"text-gray-100",children:['"',h.displayName,'"']})," (@",h.username,")?"]}),e.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"This action cannot be undone. The user will be permanently removed along with all their sessions."})]}),e.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-white/5",children:[e.jsx("button",{onClick:()=>y(null),className:"px-4 py-2 text-sm text-gray-400 hover:text-gray-200 transition-colors rounded-lg",children:"Cancel"}),e.jsx("button",{onClick:_,className:"px-4 py-2 text-sm font-medium text-white bg-red-600 hover:bg-red-500 rounded-lg transition-colors",children:"Delete Permanently"})]})]})]}),document.body)]})]})}export{ke as UserManagementPage};
|