@microvac/ui 0.0.0-stage → 0.1.0-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -2
- package/dist/android-chrome-192x192.png +0 -0
- package/dist/android-chrome-512x512.png +0 -0
- package/dist/announcement-preview.svg +11 -0
- package/dist/apple-touch-icon.png +0 -0
- package/dist/assets/ActiveAgentsPanel-C9AP9hJu.js +1 -0
- package/dist/assets/AdapterManager-CmxTUKJH.js +1 -0
- package/dist/assets/AdvancedToolsRoute-CXsQnTei.js +39 -0
- package/dist/assets/AgentActionButtons-DWq2OuVK.js +1 -0
- package/dist/assets/AgentAdvancedTab-dhBDxF-H.js +131 -0
- package/dist/assets/AgentBulkSettingsSheet-DYT4ovDg.js +1 -0
- package/dist/assets/AgentChat-r0TPOfPK.js +1 -0
- package/dist/assets/AgentDetailPage-Bc_okBuS.js +39 -0
- package/dist/assets/AgentIdentityChip-CB2NBXkZ.js +1 -0
- package/dist/assets/AgentRosterFilters-b7qMLv8-.js +2 -0
- package/dist/assets/Agents-BsvXy3pZ.js +2 -0
- package/dist/assets/Agents.production-BeOZmzaF.js +2 -0
- package/dist/assets/AnimatedDialogContent-CWshmxP2.js +1 -0
- package/dist/assets/AppDetail-DbqENTF_.js +1 -0
- package/dist/assets/AppNotConnected-BhnCqL0F.js +1 -0
- package/dist/assets/ApprovalDetail-B2KiYLTj.js +1 -0
- package/dist/assets/Approvals-j-wRmqKj.js +1 -0
- package/dist/assets/AppsConnect-CcPVEZ0C.js +1 -0
- package/dist/assets/AppsReview-B8eWvKkS.js +1 -0
- package/dist/assets/ArtifactEmptyGraphic-5mdkS5jj.js +1 -0
- package/dist/assets/Artifacts-Bz7Oo6VX.js +1 -0
- package/dist/assets/AssigneePickerInner-DdpF7hck.js +1 -0
- package/dist/assets/AssistantConnection-BpaaJDc_.js +1 -0
- package/dist/assets/AttentionInlineVerbs-DlPQVCO-.js +1 -0
- package/dist/assets/AttentionQueueRow-BC6ezctS.js +1 -0
- package/dist/assets/AuditHub-BVP7LKL9.js +1 -0
- package/dist/assets/AuditRuns-DqizHgX1.js +1 -0
- package/dist/assets/Auth-DOF0snjp.js +3 -0
- package/dist/assets/BoardChat-BYAbDtfd.js +18 -0
- package/dist/assets/BoardClaim-7y41Pr8e.js +1 -0
- package/dist/assets/BootstrapSetupUxLab-BftH1vOv.js +1 -0
- package/dist/assets/Browse-Ck01W1Yl.js +1 -0
- package/dist/assets/BudgetPolicyCard-CKhrzfgy.js +1 -0
- package/dist/assets/CaseDetail-qlXKJ66D.js +1 -0
- package/dist/assets/CaseStatus-B3RiZVDH.js +1 -0
- package/dist/assets/Cases-CFV3V-5X.js +1 -0
- package/dist/assets/ChatEndpointDetail-7Hi5TJNt.js +5 -0
- package/dist/assets/ChatEndpointSetup-CtwgH6sg.js +1 -0
- package/dist/assets/ChatIdentityConfirm-CXjksBwX.js +1 -0
- package/dist/assets/CliAuth-KVjrGMfZ.js +1 -0
- package/dist/assets/Companies-oeJem3De.js +1 -0
- package/dist/assets/CompanyAccess-vWT6G-n_.js +1 -0
- package/dist/assets/CompanyActivity-zOzzeN1B.js +1 -0
- package/dist/assets/CompanyActivity.production-DbaFBsM0.js +1 -0
- package/dist/assets/CompanyConnections-llSEaVa2.js +1 -0
- package/dist/assets/CompanyEnvironments-BrP-ENHg.css +1 -0
- package/dist/assets/CompanyEnvironments-DNyyGC_S.js +35 -0
- package/dist/assets/CompanyExport-CFa-F8Es.js +4 -0
- package/dist/assets/CompanyImport-DG6qwQ8F.js +1 -0
- package/dist/assets/CompanySettings-Dv5Z3ZQi.js +1 -0
- package/dist/assets/CompanySettingsPluginPage-CZk1d_0d.js +1 -0
- package/dist/assets/CompanySkills-CdzWhJfQ.js +10 -0
- package/dist/assets/CompanySkills.production-IoCRW5FQ.js +10 -0
- package/dist/assets/ConfigureBuiltInAgentModal-BwW7XQ1O.js +1 -0
- package/dist/assets/CopyableGatewayUrl-PTn061ft.js +1 -0
- package/dist/assets/CordisPluginSettings-C_BeeGEc.js +1 -0
- package/dist/assets/Costs-DhuNxwSj.js +1 -0
- package/dist/assets/CrossIssueCollaborationUxLab-ZaAXq46r.js +1 -0
- package/dist/assets/Dashboard-BaDnqiKo.js +2 -0
- package/dist/assets/DashboardLive-D-Ed7osd.js +1 -0
- package/dist/assets/DecisionDateChips-D3pl_mLn.js +1 -0
- package/dist/assets/DecisionHistoryPanel-D5MzyrOh.js +1 -0
- package/dist/assets/DecisionQueuePage-D3UZ9oRk.js +1 -0
- package/dist/assets/DesignGuide-COTo7ICj.js +25 -0
- package/dist/assets/DesignSandboxTaskThread-CMeCSQid.js +28 -0
- package/dist/assets/EmailConnectionAccess-kCL7obSr.js +1 -0
- package/dist/assets/EmailEndpointSetup-BGrksR_u.js +1 -0
- package/dist/assets/EnforcementBanner-_Eb_nK3M.js +1 -0
- package/dist/assets/EntityRow-gpsOgEtu.js +1 -0
- package/dist/assets/ExecutionWorkspaceDetail-DwGkH6d3.js +19 -0
- package/dist/assets/ExternalAgentInviteDialog-CGid6pM9.js +50 -0
- package/dist/assets/FilterBar-1D-VhrvG.js +1 -0
- package/dist/assets/FolderControls-CQ6kef3c.js +1 -0
- package/dist/assets/GatewayDetail-CCqekM1J.js +2 -0
- package/dist/assets/GatewaysList-nFsRcszh.js +1 -0
- package/dist/assets/GitHubConnectionRecovery-B9sFWJup.js +1 -0
- package/dist/assets/GoalDetail-BQ8y55P-.js +1 -0
- package/dist/assets/GoalTree-laRjXp0P.js +1 -0
- package/dist/assets/Goals-Cm14EaeP.js +1 -0
- package/dist/assets/InstanceAccess-DxQ-Akt_.js +1 -0
- package/dist/assets/InstanceExperimentalSettings-BxwqbXNw.js +1 -0
- package/dist/assets/InviteLanding-Cf0L_u6s.js +1 -0
- package/dist/assets/IssueChatLongThreadPerf-BfsF6FdF.js +2 -0
- package/dist/assets/JoinRequestQueue-BXCdTFG_.js +1 -0
- package/dist/assets/Layout.production-CqzU0qMi.js +1 -0
- package/dist/assets/McpConnect-COWnZ9Eb.js +1 -0
- package/dist/assets/MembershipAction-C9i9Sdmi.js +1 -0
- package/dist/assets/MetricCard-Bwnt3_p3.js +1 -0
- package/dist/assets/MissingPluginTabPlaceholder-B0Zxv1Kx.js +1 -0
- package/dist/assets/NewAgent-BIlJ5Dyt.js +1 -0
- package/dist/assets/NewAgentDialog-CJdMxxYL.js +1 -0
- package/dist/assets/NewGoalDialog-B8izfKLm.js +1 -0
- package/dist/assets/NewProjectDialog-DXqjTYFK.js +1 -0
- package/dist/assets/OnboardingPrimitives-DHYBqn_0.js +1 -0
- package/dist/assets/OnboardingWizard-DqSfZ13V.js +2 -0
- package/dist/assets/OrgChart.production-DrSFUf7i.js +1 -0
- package/dist/assets/PaperclipCloudOAuthHandoff-jPUvjJ8q.js +1 -0
- package/dist/assets/PluginManager-h3LFPaUq.js +1 -0
- package/dist/assets/PluginPage-E5Im4454.js +1 -0
- package/dist/assets/PluginSettings-BBO0jAgo.js +1 -0
- package/dist/assets/ProfileDetailRoute-CQBD7fms.js +1 -0
- package/dist/assets/ProfileSettings-BwnVEHLp.js +1 -0
- package/dist/assets/ProfileWizardRoute-By_SC6Gn.js +1 -0
- package/dist/assets/ProjectDetail-CbiwFBAE.js +1 -0
- package/dist/assets/ProjectRepositoryInput-DZF9bX4E.js +1 -0
- package/dist/assets/ProjectWorkspaceDetail-DPsl_4bD.js +29 -0
- package/dist/assets/ProjectWorkspacesContent-COH4dOWK.js +1 -0
- package/dist/assets/Projects-Ch9Qu7sn.js +1 -0
- package/dist/assets/QuotaBar-DIFOT9Uh.js +1 -0
- package/dist/assets/RepositoryEditor-DHB1bqId.js +1 -0
- package/dist/assets/Responsibilities-C5O0JXXG.js +4 -0
- package/dist/assets/ResponsibilityDetail-D6NpZpkm.js +1 -0
- package/dist/assets/ResponsibleUserDenialUxLab-CFrIWYwe.js +1 -0
- package/dist/assets/ReviewQueueCard-BPC4Lm67.js +1 -0
- package/dist/assets/RoutineAuditActivity-sKyzMajz.js +1 -0
- package/dist/assets/RoutineDetail-CG8HF5fp.js +2 -0
- package/dist/assets/RoutineRunVariablesDialog-CKh3CmLD.js +1 -0
- package/dist/assets/Routines-tF2qfUKo.js +1 -0
- package/dist/assets/Routines.production-BTyj1Ljr.js +1 -0
- package/dist/assets/RoutinesToolbar-CvUFVCGN.js +1 -0
- package/dist/assets/Search-Z9D0NuS1.js +1 -0
- package/dist/assets/Secrets-DgmbLOJK.js +4 -0
- package/dist/assets/SkillBinaryFile-F3_9qcaM.js +1 -0
- package/dist/assets/SkillCardIcon-CXHUCMej.js +2 -0
- package/dist/assets/SkillFolderTree-CB3lrTIE.js +1 -0
- package/dist/assets/SkillSourceTree-BbuciCo6.js +2 -0
- package/dist/assets/SkillSources-Dlo6Cew3.js +2 -0
- package/dist/assets/SkillStudio-ZO-Nf7eI.js +9 -0
- package/dist/assets/SkillsNavigationTabs-B9Iqnlqt.js +1 -0
- package/dist/assets/SpekoPhoneCallback-C4VnMiZh.js +1 -0
- package/dist/assets/SpekoProviderSetup-I4evPZb3.js +1 -0
- package/dist/assets/StatusCards-D0MVzbsw.js +1 -0
- package/dist/assets/SummarySlotCard-DUXgZPxG.js +1 -0
- package/dist/assets/TailscaleConnector-CMhT73gj.js +1 -0
- package/dist/assets/TaskChatLab-D9-KAE-7.js +11 -0
- package/dist/assets/TaskSummaryList-CUxieFNe.js +1 -0
- package/dist/assets/Timeline-BNMoRbtK.js +1 -0
- package/dist/assets/ToolsAdminGate-CEr0zy2T.js +1 -0
- package/dist/assets/TrustPresetSection-B9YXZtkh.js +1 -0
- package/dist/assets/UserProfile-D-tnW96X.js +1 -0
- package/dist/assets/WebhookUrlWarning-Ba_DixKh.js +1 -0
- package/dist/assets/WhatNeedsMe-B-Jzj8_M.js +1 -0
- package/dist/assets/Workspaces-BqhDI_Bl.js +1 -0
- package/dist/assets/abnfDiagram-YUKMZFIV-Bn9P-nUW.js +1 -0
- package/dist/assets/apl-MHzTCvfx.js +1 -0
- package/dist/assets/arc-Dnq9Aszq.js +1 -0
- package/dist/assets/architecture-WOLXFQ4H-V1ldsZlt.js +1 -0
- package/dist/assets/architectureDiagram-47P4ROYG-BkYxt-Gc.js +36 -0
- package/dist/assets/array-CL5Tisss.js +1 -0
- package/dist/assets/arrow-down-left-o81ENfeW.js +1 -0
- package/dist/assets/asciiarmor-DFLNSgns.js +1 -0
- package/dist/assets/asn1-CfPVWRYE.js +1 -0
- package/dist/assets/asterisk-CJ4OeA7Y.js +1 -0
- package/dist/assets/blockDiagram-E7TT5TSB-BO7pPYbp.js +140 -0
- package/dist/assets/brainfuck-NEHkmXMc.js +1 -0
- package/dist/assets/budgets-0Dw6TH1A.js +1 -0
- package/dist/assets/building-complex-DciZTnys.js +1 -0
- package/dist/assets/c4Diagram-CRA5TL53-D4EpmmzV.js +38 -0
- package/dist/assets/channel-BQh2vFIU.js +1 -0
- package/dist/assets/character-CguPM7IG.js +1 -0
- package/dist/assets/chat-channels-DWyry-9M.js +1 -0
- package/dist/assets/chunk-2BW5OAIV-DFXIyCJy.js +10 -0
- package/dist/assets/chunk-2Q5K7J3B-CkPHWFj-.js +1 -0
- package/dist/assets/chunk-3YJQHVM4-Dj5wEKIw.js +2 -0
- package/dist/assets/chunk-4EA7E6EY-5XiUVgzK.js +1 -0
- package/dist/assets/chunk-5VM5RSS4-2H3r6wq0.js +15 -0
- package/dist/assets/chunk-7TKQ45FW-D0opKcsy.js +1 -0
- package/dist/assets/chunk-AW2ZBBNX-DnjsTe04.js +88 -0
- package/dist/assets/chunk-DBDB3WZW-DNqSQPZ0.js +1 -0
- package/dist/assets/chunk-DUW6YSOI-slPglwIh.js +1 -0
- package/dist/assets/chunk-E2ZNV5FY-cjSf_BTz.js +70 -0
- package/dist/assets/chunk-EU5HNXII-CZYBiaSw.js +213 -0
- package/dist/assets/chunk-FVRAUYC3-DSc0-wJA.js +2 -0
- package/dist/assets/chunk-HJ2JQQFS-MXK0gYSP.js +1 -0
- package/dist/assets/chunk-HTAEGDNF-BjDZm_5k.js +1 -0
- package/dist/assets/chunk-J5ZVWO5B-ClU583ja.js +1 -0
- package/dist/assets/chunk-JWPE2WC7--HEGjv3t.js +1 -0
- package/dist/assets/chunk-KQW6MTUR-Bfj0tDmO.js +1 -0
- package/dist/assets/chunk-NGNAAXSQ-e5XI1hSt.js +128 -0
- package/dist/assets/chunk-NTY3LDVX-Bpz5TkVb.js +1 -0
- package/dist/assets/chunk-VPRB5NB3-CfeHjtbb.js +129 -0
- package/dist/assets/chunk-XC4XBNZT-FBCWmi6K.js +62 -0
- package/dist/assets/chunk-XXDRQBXY-BdWplhUD.js +1 -0
- package/dist/assets/chunk-Y2CYZVJY-OvsAdhaO.js +1 -0
- package/dist/assets/circle-slash-DqKFFqfb.js +1 -0
- package/dist/assets/classDiagram-v2-K4WV4PDN-DbC_J0kK.js +217 -0
- package/dist/assets/clike-CIx9nZSv.js +1 -0
- package/dist/assets/clojure-DFaIEz5O.js +1 -0
- package/dist/assets/cmake-koz-qBlo.js +1 -0
- package/dist/assets/cobol-Bo8Zw9gB.js +1 -0
- package/dist/assets/coffeescript-CXYzYf-Y.js +1 -0
- package/dist/assets/coins-BztUbqyl.js +1 -0
- package/dist/assets/collections-BxrcELwt.js +3 -0
- package/dist/assets/commonlisp-C4OOCwkD.js +1 -0
- package/dist/assets/company-skill-routes-D5LJ1l8M.js +1 -0
- package/dist/assets/company-skill-summary-DnWVmP1S.js +1 -0
- package/dist/assets/configuration-warnings-CZKSfHJv.js +2 -0
- package/dist/assets/connection-owner-D-ikSHyR.js +1 -0
- package/dist/assets/cose-bilkent-JH36ORCC-DFyVDb92.js +1 -0
- package/dist/assets/crystal-BlJXQDvy.js +1 -0
- package/dist/assets/css-DEZwfVpY.js +1 -0
- package/dist/assets/cynefin-EF2NZ3EQ-COwSJ4qP.js +1 -0
- package/dist/assets/cynefinDiagram-3GCD6N5R-diaEJq9Y.js +62 -0
- package/dist/assets/cypher-z2oFsVv2.js +1 -0
- package/dist/assets/cytoscape.esm-C2vp4vBx.js +321 -0
- package/dist/assets/d-Dkt6y7AQ.js +1 -0
- package/dist/assets/dagre-W4DXFKR2-BPAMRuIj.js +4 -0
- package/dist/assets/defaultLocale-C2Bpu8Ih.js +1 -0
- package/dist/assets/definition-DxwMBXnu.js +1 -0
- package/dist/assets/diagram-2UJZ2QOL-BvRnO1Id.js +200 -0
- package/dist/assets/diagram-OVF4WLC6-CDgBeD0m.js +24 -0
- package/dist/assets/diagram-PFPMY2P6-DAw9lREG.js +30 -0
- package/dist/assets/diagram-UMYRVEAY-ZQqQn22t.js +24 -0
- package/dist/assets/diagram-YEKJPTXX-CoJtGgWs.js +41 -0
- package/dist/assets/diagram-ZIFT7M5P-qW_Zn_bO.js +3 -0
- package/dist/assets/diff-C60bAYOU.js +1 -0
- package/dist/assets/dist-B2E6oBK1.js +1 -0
- package/dist/assets/dist-B6Qde8KJ.js +1 -0
- package/dist/assets/dist-BCJybC91.js +1 -0
- package/dist/assets/dist-CG-phytt.js +1 -0
- package/dist/assets/dist-CG6fC1Db.js +1 -0
- package/dist/assets/dist-CPgRB-NQ.js +1 -0
- package/dist/assets/dist-CTlCK4Pe.js +1 -0
- package/dist/assets/dist-CYRzGbSY.js +7 -0
- package/dist/assets/dist-Cd7wdKYE.js +39 -0
- package/dist/assets/dist-CdmdXwCZ.js +1 -0
- package/dist/assets/dist-CeSzCyeG.js +1 -0
- package/dist/assets/dist-CjRqeLFz.js +2 -0
- package/dist/assets/dist-CuwPDbnL.js +1 -0
- package/dist/assets/dist-CvRpZH53.js +1 -0
- package/dist/assets/dist-DKyBHaH2.js +1 -0
- package/dist/assets/dist-DML0cJH3.js +13 -0
- package/dist/assets/dist-DXjkgaZX.js +1 -0
- package/dist/assets/dist-DZIxMHOT.js +1 -0
- package/dist/assets/dist-DZruZxAk.js +1 -0
- package/dist/assets/dist-DbXGl-wj.js +3 -0
- package/dist/assets/dist-Dl94YqeS.js +1 -0
- package/dist/assets/dist-DylHAy-6.js +1 -0
- package/dist/assets/dist-IcdxEhjC.js +1 -0
- package/dist/assets/dist-_EtfntKJ.js +6 -0
- package/dist/assets/dist-ptDa9fKh.js +1 -0
- package/dist/assets/dockerfile-BttNdtK0.js +1 -0
- package/dist/assets/dtd-CCVZU5Da.js +1 -0
- package/dist/assets/dylan-3pmV5wzs.js +1 -0
- package/dist/assets/ebnf-bm-I2WIh.js +1 -0
- package/dist/assets/ebnfDiagram-VR2GEFS7-DA4UvKXV.js +1 -0
- package/dist/assets/ecl-BIv3PrZb.js +1 -0
- package/dist/assets/eiffel-DuLnr4-r.js +1 -0
- package/dist/assets/elk-IJKZMXRS-CM74d3mJ.js +25 -0
- package/dist/assets/elm-njbaCU-L.js +1 -0
- package/dist/assets/erDiagram-O2IAPWRE-d869V0qL.js +99 -0
- package/dist/assets/erlang-CuhOC2I8.js +1 -0
- package/dist/assets/eventmodeling-K75KTNOO-C-oz_eyI.js +1 -0
- package/dist/assets/factor-CM3-9V3b.js +1 -0
- package/dist/assets/fcl-nWsMJ92o.js +1 -0
- package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +1 -0
- package/dist/assets/folder-plus-CxWXoYCi.js +1 -0
- package/dist/assets/forth-BQ9HrCVY.js +1 -0
- package/dist/assets/fortran-DHJe28ev.js +1 -0
- package/dist/assets/ganttDiagram-R7TSEDQI-BBul4Kpm.js +292 -0
- package/dist/assets/gas-ByO0qYMr.js +1 -0
- package/dist/assets/gherkin-CwOmHL5K.js +1 -0
- package/dist/assets/gitGraph-VSP46ZUC-BriEZgAq.js +1 -0
- package/dist/assets/gitGraphDiagram-XJZIOB7I-I12rg8s1.js +106 -0
- package/dist/assets/goals-CvMWzjH4.js +1 -0
- package/dist/assets/googleAccessRemoval-CQIi1dvu.js +1 -0
- package/dist/assets/graphlib-DHhK3saS.js +1 -0
- package/dist/assets/groovy-ByXGF8cx.js +1 -0
- package/dist/assets/haskell-CHSpCNOy.js +1 -0
- package/dist/assets/haxe-P2jh68ck.js +1 -0
- package/dist/assets/http-0jwMmfWP.js +1 -0
- package/dist/assets/idl-DTVVj6r5.js +1 -0
- package/dist/assets/index-Bt31d8ga.js +706 -0
- package/dist/assets/index-z7lcCz2I.css +1 -0
- package/dist/assets/info-OHQRW6UA-CxrcGiem.js +1 -0
- package/dist/assets/infoDiagram-5W2HQ5XZ-4Sm0LiOu.js +2 -0
- package/dist/assets/init-BXPE0p7i.js +1 -0
- package/dist/assets/invite-memory-BKdqfr5K.js +1 -0
- package/dist/assets/ishikawaDiagram-K3B6WC7H-CKXvKV-s.js +70 -0
- package/dist/assets/issue-detail-4PCbYpdv.js +119 -0
- package/dist/assets/javascript-Cblpdx44.js +1 -0
- package/dist/assets/journeyDiagram-COXZFDF6-BHsrZLvQ.js +139 -0
- package/dist/assets/julia-KVJvUu_F.js +1 -0
- package/dist/assets/kanban-definition-P3RFRI5V-8HhnIs_l.js +89 -0
- package/dist/assets/katex-Du_FPwxl.js +257 -0
- package/dist/assets/line-rrKrpB-b.js +1 -0
- package/dist/assets/linear-BRQgexd0.js +1 -0
- package/dist/assets/link-BecLzmfo.js +1 -0
- package/dist/assets/list-filter-BC3D4IoX.js +1 -0
- package/dist/assets/livescript-DSHsJPcD.js +1 -0
- package/dist/assets/log-in-BJCGwGGT.js +1 -0
- package/dist/assets/lua-Vher-70I.js +1 -0
- package/dist/assets/mathematica-CE9SaVsW.js +1 -0
- package/dist/assets/mbox-JGl1Fgvq.js +1 -0
- package/dist/assets/mcpSkills-DRs3pGKn.js +1 -0
- package/dist/assets/mermaid-parser.core-DmG0b4S0.js +7 -0
- package/dist/assets/mermaid.core-D1vILTuF.js +42 -0
- package/dist/assets/mindmap-definition-LZFPQGKD-DIMpL0de.js +96 -0
- package/dist/assets/mirc-BGWbO906.js +1 -0
- package/dist/assets/mllike-DuNQsEw8.js +1 -0
- package/dist/assets/model-DL5biheO.js +1 -0
- package/dist/assets/modelica-5XCgKQt8.js +1 -0
- package/dist/assets/mscgen-mVFg19ri.js +1 -0
- package/dist/assets/mumps-C7oS353s.js +1 -0
- package/dist/assets/nginx-DXVlpyCz.js +1 -0
- package/dist/assets/nsis-KFC6hioG.js +1 -0
- package/dist/assets/ntriples-5ckCopnn.js +1 -0
- package/dist/assets/octave-D1J2QQNt.js +1 -0
- package/dist/assets/onboarding-state-C5_mIw3o.js +1 -0
- package/dist/assets/ordinal-BJyFM1v8.js +1 -0
- package/dist/assets/oz-CPsllMDD.js +1 -0
- package/dist/assets/packet-JDAUHWVQ-BnbYht3G.js +1 -0
- package/dist/assets/palette-tokens-CL5ZDrEd.js +1 -0
- package/dist/assets/pascal-B-I6JP0Y.js +1 -0
- package/dist/assets/path-D6mommQw.js +1 -0
- package/dist/assets/pegDiagram-BGZESJAR-BUjtJVjT.js +1 -0
- package/dist/assets/perl-CI8WIWBi.js +1 -0
- package/dist/assets/pie-XZMESJXO-CM4VXUb-.js +1 -0
- package/dist/assets/pieDiagram-CAPJLFHJ-B3v8ryvG.js +39 -0
- package/dist/assets/pig-FQI0W3S3.js +1 -0
- package/dist/assets/portable-files-CloN_vbk.js +1 -0
- package/dist/assets/power-0mw59G-l.js +1 -0
- package/dist/assets/powershell-BAu6x78A.js +1 -0
- package/dist/assets/prod-C6Q7tISe.js +495 -0
- package/dist/assets/profile-summary-B5rPf8v-.js +1 -0
- package/dist/assets/properties-BKTTDgau.js +1 -0
- package/dist/assets/protobuf-UWh8gh_j.js +1 -0
- package/dist/assets/pug-C20tNwmy.js +1 -0
- package/dist/assets/puppet-BAHVzCkO.js +1 -0
- package/dist/assets/python-C2DOnsac.js +1 -0
- package/dist/assets/q-Cooe-Nh8.js +1 -0
- package/dist/assets/quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js +7 -0
- package/dist/assets/r-CktBKya9.js +1 -0
- package/dist/assets/radar-ABXABTNO-v6yZj4Fk.js +1 -0
- package/dist/assets/railroad-I3PHUGI6-D-U8Cs0m.js +1 -0
- package/dist/assets/railroad-abnf-LNEFI6M7-Dw3fkrVy.js +1 -0
- package/dist/assets/railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js +1 -0
- package/dist/assets/railroad-peg-JR7BVNR7-Bf8u1-RZ.js +1 -0
- package/dist/assets/railroadDiagram-SM67HX2B-Drr5UhQI.js +1 -0
- package/dist/assets/requirementDiagram-X7JNWC4A-D5ef6_ac.js +84 -0
- package/dist/assets/rolldown-runtime-DhZMWcEn.js +1 -0
- package/dist/assets/rough.esm-DnC5Tr1g.js +1 -0
- package/dist/assets/rpm-Csj9nLHl.js +1 -0
- package/dist/assets/ruby-bGx9eo-K.js +1 -0
- package/dist/assets/runtime-IAg0vdY9.js +4137 -0
- package/dist/assets/sankeyDiagram-UM26HJRW-DncJWIz_.js +40 -0
- package/dist/assets/sas-Drou_EQ9.js +1 -0
- package/dist/assets/saved-permissions-CizWg8-P.js +1 -0
- package/dist/assets/scheme-DcjG9bAf.js +1 -0
- package/dist/assets/scroll-text-Ck6HB7eM.js +1 -0
- package/dist/assets/sdk-CWyUlmcn.js +1 -0
- package/dist/assets/search-DkTqg7ab.js +1 -0
- package/dist/assets/send-CYVi50sh.js +1 -0
- package/dist/assets/sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js +169 -0
- package/dist/assets/shared-CIwISWMj.js +1 -0
- package/dist/assets/shell-BSKClwid.js +1 -0
- package/dist/assets/sieve-CcvsXPZo.js +1 -0
- package/dist/assets/simple-mode-B79cVo-x.js +1 -0
- package/dist/assets/sizeCapture-INFHLROL-XURNLuv_.js +1 -0
- package/dist/assets/skill-source-connect-return-eFTeuj7y.js +1 -0
- package/dist/assets/smalltalk-Cmg-4mjQ.js +1 -0
- package/dist/assets/smoke-lab-matrix-A7ubFpfk.js +1 -0
- package/dist/assets/solr-Dj8ahEwG.js +1 -0
- package/dist/assets/sparql-LAJYmgfk.js +1 -0
- package/dist/assets/spreadsheet-B8doD_pL.js +1 -0
- package/dist/assets/sql-C3kWxFGw.js +1 -0
- package/dist/assets/src-DYjgETqR.js +1 -0
- package/dist/assets/stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js +291 -0
- package/dist/assets/stex-CW6K5Nmu.js +1 -0
- package/dist/assets/stylus-BS-Ienrc.js +1 -0
- package/dist/assets/swift-BD82LMDK.js +1 -0
- package/dist/assets/swimlanes-N4OXWK64-NXVbx1w8.js +1 -0
- package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +8 -0
- package/dist/assets/tcl-RZa1cqc-.js +1 -0
- package/dist/assets/textile-C-BY_OGF.js +1 -0
- package/dist/assets/tiddlywiki-C9bm_Oju.js +1 -0
- package/dist/assets/tiki-DJOT-rFT.js +1 -0
- package/dist/assets/timeline-definition-YOQAKGHF-DqI-Mv2e.js +120 -0
- package/dist/assets/toml-Civ2fTsu.js +1 -0
- package/dist/assets/treeView-D4JQ5SDB-CZBlE7ya.js +1 -0
- package/dist/assets/treemap-SAJKECNS-BlueznID.js +1 -0
- package/dist/assets/troff-Lns35Xcq.js +1 -0
- package/dist/assets/ttcn-7vlxVTUK.js +1 -0
- package/dist/assets/ttcn-cfg-B8qhhp6o.js +1 -0
- package/dist/assets/turtle-DTIS1YQ7.js +1 -0
- package/dist/assets/useAgentlessOnboardingAutoOpen-CnFwEQ-H.js +1 -0
- package/dist/assets/useAuthorizationWindow-DnFQsiFj.js +1 -0
- package/dist/assets/useDateRange-9EbqkWXy.js +1 -0
- package/dist/assets/useFastResponsesEnabled-D8dunm4j.js +1 -0
- package/dist/assets/usePageView-BiX5i8ck.js +1 -0
- package/dist/assets/useProfilesData-0VYQ4lAT.js +1 -0
- package/dist/assets/useReviewCount-WBWxwKI3.js +1 -0
- package/dist/assets/useRoutineFormOptions-DnX5DBn1.js +3 -0
- package/dist/assets/useSummaryDraftStream-DPQRvaXT.js +3 -0
- package/dist/assets/useTailscaleConnections-BDff6dWx.js +1 -0
- package/dist/assets/usecaseDiagram-VIAY4XPW-BSDn8OaJ.js +362 -0
- package/dist/assets/vb-BO8UacKu.js +1 -0
- package/dist/assets/vbscript-DWLru3lT.js +1 -0
- package/dist/assets/velocity-BIIn-Nl2.js +1 -0
- package/dist/assets/vennDiagram-BLWOH2XV-BBSA9KNN.js +34 -0
- package/dist/assets/verilog-BVYlmXGg.js +1 -0
- package/dist/assets/vhdl-Cn8cC8Yb.js +1 -0
- package/dist/assets/wardley-7MLQ67FV-CsT-rTZ9.js +1 -0
- package/dist/assets/wardleyDiagram-YMQ3BMBF-BLClsIjw.js +78 -0
- package/dist/assets/webidl-ChvzbZ5-.js +1 -0
- package/dist/assets/xquery-BKN7qEbU.js +1 -0
- package/dist/assets/xychartDiagram-TAQBALBS-2x4wB0gq.js +7 -0
- package/dist/assets/yacas-BG9ha7tU.js +1 -0
- package/dist/assets/z80-CB2cGLew.js +1 -0
- package/dist/brands/adapters/LICENSE +21 -0
- package/dist/brands/adapters/README.md +7 -0
- package/dist/brands/adapters/cursor-dark.svg +1 -0
- package/dist/brands/adapters/cursor.svg +1 -0
- package/dist/brands/adapters/gemini-color.svg +1 -0
- package/dist/brands/adapters/grok-dark.svg +1 -0
- package/dist/brands/adapters/grok.svg +1 -0
- package/dist/brands/adapters/hermesagent-dark.svg +1 -0
- package/dist/brands/adapters/hermesagent.svg +1 -0
- package/dist/brands/adapters/kimi-color-light.svg +1 -0
- package/dist/brands/adapters/kimi-color.svg +1 -0
- package/dist/brands/adapters/openai-dot.README.md +7 -0
- package/dist/brands/adapters/openai-dot.svg +3 -0
- package/dist/brands/adapters/pi-dark.svg +1 -0
- package/dist/brands/adapters/pi.svg +1 -0
- package/dist/brands/apps/1password-dark.svg +1 -0
- package/dist/brands/apps/1password.svg +1 -0
- package/dist/brands/apps/LOBE-LICENSE +21 -0
- package/dist/brands/apps/agentmail-dark.svg +16 -0
- package/dist/brands/apps/agentmail.svg +17 -0
- package/dist/brands/apps/airtable.svg +1 -0
- package/dist/brands/apps/anthropic-dark.svg +1 -0
- package/dist/brands/apps/anthropic.svg +1 -0
- package/dist/brands/apps/antigravity.svg +31 -0
- package/dist/brands/apps/api-key-generic.svg +1 -0
- package/dist/brands/apps/arcade.png +0 -0
- package/dist/brands/apps/asana.svg +12 -0
- package/dist/brands/apps/aws-dark.svg +1 -0
- package/dist/brands/apps/aws.svg +1 -0
- package/dist/brands/apps/bedrock.svg +1 -0
- package/dist/brands/apps/beehiiv.png +0 -0
- package/dist/brands/apps/bitly.svg +1 -0
- package/dist/brands/apps/box.svg +1 -0
- package/dist/brands/apps/braintrust-dark.png +0 -0
- package/dist/brands/apps/braintrust.png +0 -0
- package/dist/brands/apps/brex-dark.svg +1 -0
- package/dist/brands/apps/brex.svg +1 -0
- package/dist/brands/apps/browser-use.svg +6 -0
- package/dist/brands/apps/calendly.png +0 -0
- package/dist/brands/apps/candid.png +0 -0
- package/dist/brands/apps/circleback.png +0 -0
- package/dist/brands/apps/clickhouse-dark.svg +1 -0
- package/dist/brands/apps/clickhouse.svg +1 -0
- package/dist/brands/apps/clickup.png +0 -0
- package/dist/brands/apps/cloudflare.svg +1 -0
- package/dist/brands/apps/cloudinary-dark.svg +1 -0
- package/dist/brands/apps/cloudinary.svg +3 -0
- package/dist/brands/apps/coda.svg +1 -0
- package/dist/brands/apps/cognee.png +0 -0
- package/dist/brands/apps/composio-dark.svg +11 -0
- package/dist/brands/apps/composio.svg +16 -0
- package/dist/brands/apps/connection-pool.svg +1 -0
- package/dist/brands/apps/context7-dark.svg +8 -0
- package/dist/brands/apps/context7.svg +8 -0
- package/dist/brands/apps/daytona-dark.svg +1 -0
- package/dist/brands/apps/daytona.svg +1 -0
- package/dist/brands/apps/discord-dark.svg +1 -0
- package/dist/brands/apps/discord.svg +1 -0
- package/dist/brands/apps/ditto.png +0 -0
- package/dist/brands/apps/egnyte.svg +1 -0
- package/dist/brands/apps/embat.svg +1 -0
- package/dist/brands/apps/enterpret.png +0 -0
- package/dist/brands/apps/exa.svg +5 -0
- package/dist/brands/apps/executor.png +0 -0
- package/dist/brands/apps/firecrawl.svg +12 -0
- package/dist/brands/apps/fireflies.svg +76 -0
- package/dist/brands/apps/gauge.png +0 -0
- package/dist/brands/apps/github-copilot-dark.svg +1 -0
- package/dist/brands/apps/github-copilot.svg +1 -0
- package/dist/brands/apps/github-dark.svg +10 -0
- package/dist/brands/apps/github.svg +10 -0
- package/dist/brands/apps/gmail.svg +1 -0
- package/dist/brands/apps/google-calendar.svg +1 -0
- package/dist/brands/apps/google-chat.svg +1 -0
- package/dist/brands/apps/google-docs.svg +1 -0
- package/dist/brands/apps/google-drive.svg +1 -0
- package/dist/brands/apps/google-people.svg +1 -0
- package/dist/brands/apps/google-sheets.svg +1 -0
- package/dist/brands/apps/google-slides.svg +1 -0
- package/dist/brands/apps/google-workspace-search.svg +1 -0
- package/dist/brands/apps/google.svg +1 -0
- package/dist/brands/apps/gsc-wizard.png +0 -0
- package/dist/brands/apps/honcho.svg +33 -0
- package/dist/brands/apps/hugging-face.svg +8 -0
- package/dist/brands/apps/imessage-photon.png +0 -0
- package/dist/brands/apps/jam-dev-dark.svg +1 -0
- package/dist/brands/apps/jam-dev.svg +1 -0
- package/dist/brands/apps/jira-dark.svg +1 -0
- package/dist/brands/apps/jira.svg +4 -0
- package/dist/brands/apps/kernel.svg +3 -0
- package/dist/brands/apps/klaviyo.png +0 -0
- package/dist/brands/apps/linear-dark.svg +5 -0
- package/dist/brands/apps/linear.svg +5 -0
- package/dist/brands/apps/local-falcon.png +0 -0
- package/dist/brands/apps/make-dark.svg +1 -0
- package/dist/brands/apps/make.svg +1 -0
- package/dist/brands/apps/manifest.json +756 -0
- package/dist/brands/apps/manufact-dark.svg +6 -0
- package/dist/brands/apps/manufact.svg +5 -0
- package/dist/brands/apps/mem0.svg +1 -0
- package/dist/brands/apps/microsoft-teams.svg +68 -0
- package/dist/brands/apps/miro-dark.svg +1 -0
- package/dist/brands/apps/miro.svg +4 -0
- package/dist/brands/apps/mixpanel-dark.svg +1 -0
- package/dist/brands/apps/mixpanel.svg +1 -0
- package/dist/brands/apps/monday-dark.png +0 -0
- package/dist/brands/apps/monday.png +0 -0
- package/dist/brands/apps/neon.png +0 -0
- package/dist/brands/apps/netlify-dark.svg +1 -0
- package/dist/brands/apps/netlify.svg +16 -0
- package/dist/brands/apps/notion-dark.svg +1 -0
- package/dist/brands/apps/notion.svg +1 -0
- package/dist/brands/apps/oauth-generic.svg +1 -0
- package/dist/brands/apps/openai-dark.svg +1 -0
- package/dist/brands/apps/openai.svg +1 -0
- package/dist/brands/apps/openrouter-dark.svg +3 -0
- package/dist/brands/apps/openrouter.svg +3 -0
- package/dist/brands/apps/oreilly.svg +1 -0
- package/dist/brands/apps/pagerduty.svg +4 -0
- package/dist/brands/apps/paperclip-notebook-dark.svg +1 -0
- package/dist/brands/apps/paperclip-notebook.svg +1 -0
- package/dist/brands/apps/parallel-dark.svg +11 -0
- package/dist/brands/apps/parallel.svg +11 -0
- package/dist/brands/apps/planetscale-dark.svg +1 -0
- package/dist/brands/apps/planetscale.svg +1 -0
- package/dist/brands/apps/posthog-dark.svg +1 -0
- package/dist/brands/apps/posthog.svg +1 -0
- package/dist/brands/apps/postman.svg +1 -0
- package/dist/brands/apps/railway-dark.svg +1 -0
- package/dist/brands/apps/railway.svg +1 -0
- package/dist/brands/apps/razorpay-dark.svg +1 -0
- package/dist/brands/apps/razorpay.svg +1 -0
- package/dist/brands/apps/resend-dark.svg +1 -0
- package/dist/brands/apps/resend.svg +1 -0
- package/dist/brands/apps/sanity-dark.svg +1 -0
- package/dist/brands/apps/sanity.svg +1 -0
- package/dist/brands/apps/sentry-dark.svg +1 -0
- package/dist/brands/apps/sentry.svg +1 -0
- package/dist/brands/apps/shopify.svg +24 -0
- package/dist/brands/apps/similarweb-dark.svg +1 -0
- package/dist/brands/apps/similarweb.svg +1 -0
- package/dist/brands/apps/slack.png +0 -0
- package/dist/brands/apps/slack.svg +17 -0
- package/dist/brands/apps/speko.svg +16 -0
- package/dist/brands/apps/stripe.svg +11 -0
- package/dist/brands/apps/supabase.svg +15 -0
- package/dist/brands/apps/superagent.png +0 -0
- package/dist/brands/apps/supermemory.png +0 -0
- package/dist/brands/apps/tailscale.png +0 -0
- package/dist/brands/apps/tavily.png +0 -0
- package/dist/brands/apps/telegram.svg +12 -0
- package/dist/brands/apps/telem-dark.svg +9 -0
- package/dist/brands/apps/telem.svg +9 -0
- package/dist/brands/apps/ticket-tailor-dark.svg +1 -0
- package/dist/brands/apps/ticket-tailor.svg +1 -0
- package/dist/brands/apps/ticktick.svg +1 -0
- package/dist/brands/apps/todoist.svg +1 -0
- package/dist/brands/apps/unikraft.svg +1 -0
- package/dist/brands/apps/vercel-dark.svg +1 -0
- package/dist/brands/apps/vercel.svg +1 -0
- package/dist/brands/apps/webflow.svg +1 -0
- package/dist/brands/apps/windsor-ai.png +0 -0
- package/dist/brands/apps/wix-dark.svg +12 -0
- package/dist/brands/apps/wix.svg +12 -0
- package/dist/brands/apps/xai-dark.svg +1 -0
- package/dist/brands/apps/xai.svg +1 -0
- package/dist/brands/apps/xero.svg +1 -0
- package/dist/brands/apps/youcom-dark.svg +13 -0
- package/dist/brands/apps/youcom.svg +13 -0
- package/dist/brands/apps/zapier.svg +1 -0
- package/dist/brands/apps/zep.png +0 -0
- package/dist/brands/claude-color.svg +17 -0
- package/dist/brands/codex-color.svg +17 -0
- package/dist/brands/opencode-logo-dark-square.svg +18 -0
- package/dist/brands/opencode-logo-light-square.svg +18 -0
- package/dist/favicon-16x16.png +0 -0
- package/dist/favicon-32x32.png +0 -0
- package/dist/favicon.ico +0 -0
- package/dist/favicon.svg +7 -0
- package/dist/fonts/InterVariable-Italic.woff2 +0 -0
- package/dist/fonts/InterVariable.woff2 +0 -0
- package/dist/fonts/NOTICE.md +30 -0
- package/dist/fonts/PaperMono-OFL.txt +93 -0
- package/dist/fonts/PaperMono-Variable.woff2 +0 -0
- package/dist/index.html +165 -0
- package/dist/microvac-push-sw.js +37 -0
- package/dist/paperclip-thinking.svg +17 -0
- package/dist/site.webmanifest +30 -0
- package/dist/storybook/grok-comparison.csv +4 -0
- package/dist/sw.js +176 -0
- package/dist/worktree-favicon-16x16.png +0 -0
- package/dist/worktree-favicon-32x32.png +0 -0
- package/dist/worktree-favicon.ico +0 -0
- package/dist/worktree-favicon.svg +9 -0
- package/package.json +20 -4
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
var Sr=Object.defineProperty;var n=(t,l)=>Sr(t,"name",{value:l,configurable:!0});import{a as In}from"./rolldown-runtime-DhZMWcEn.js";import{R as Cr,di as Ir,mi as Fr,vi as Lr}from"./issue-detail-4PCbYpdv.js";import{a as Dr,c as Br,d as Fn,f as Ct,i as Tr,l as Ar,n as Mr,o as Pr,r as Kr,t as qr,u as ys}from"./SkillFolderTree-CB3lrTIE.js";import{$A as Er,$S as At,$w as Rr,AC as $r,AT as un,BC as Ln,Cw as _r,Ev as Ms,Fu as zr,GS as g,Gb as be,Gw as Mt,HC as Js,H_ as oe,Hm as Vr,IC as Ur,IT as je,Iw as Qr,Kw as Dn,LC as yt,LS as Or,ME as Hr,MT as Bn,Mi as Ps,NC as Gr,NE as v,Nw as Wr,QC as Yr,Qw as Xr,Sp as Zr,To as Pt,Wm as z,Ww as Kt,XC as Tn,YC as Jr,Yb as ea,Yw as qt,ZC as It,__ as $e,_v as ss,aE as sa,ab as An,bE as Y,bp as Mn,bv as As,cT as Pn,cv as ta,dy as Ft,fy as vs,gC as na,g_ as Lt,hC as Kn,hE as W,hv as Ks,hw as ra,iC as aa,iD as la,ib as ia,jT as bs,jb as mn,ji as qn,kT as En,ki as Rn,ly as ks,my as Ns,nT as oa,nj as da,oE as ca,on as ns,pb as Ae,pv as qs,qC as Dt,rT as Bt,rb as Xs,sC as ua,sy as ws,tT as js,tl as ma,ub as Es,uy as Rs,vT as xa,vb as _e,x as Tt,xC as $n,xE as ie,xb as ze,xv as ha,xw as pa,yb as Ve,yl as ga,yv as vt,zE as K}from"./index-Bt31d8ga.js";import{t as _n}from"./company-skill-summary-DnWVmP1S.js";import{a as Zs,c as fa,i as ba,l as zn,n as ja,o as kt,r as Nt,t as Et}from"./SkillCardIcon-CXHUCMej.js";import{t as ya}from"./SkillBinaryFile-F3_9qcaM.js";import{_ as va,a as ka,b as ts,c as Na,d as wa,g as Sa,i as Ca,l as Ia,m as Fa,n as La,p as Da,r as Ba,s as Ta,t as Aa,u as Ma,v as Vn,x as fe,y as xn}from"./FolderControls-CQ6kef3c.js";import{a as Un,i as wt,n as Pa,o as Ka,r as $s,t as qa}from"./company-skill-routes-D5LJ1l8M.js";var d=In(da(),1),e=In(Er(),1),hn=16,pn=24,gn="min-h-9";function fn(t){return(0,e.jsx)("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:(0,e.jsx)("path",{d:"M12 4 21 19H3z"})})}n(fn,"VercelMark");function Qn(t){const l=t.replace(/\r\n/g,`
|
|
2
|
+
`);if(!l.startsWith(`---
|
|
3
|
+
`))return l.trim();const a=l.indexOf(`
|
|
4
|
+
---
|
|
5
|
+
`,4);return a<0?l.trim():l.slice(a+5).trim()}n(Qn,"stripFrontmatter");function et(t){const l=t.replace(/\r\n/g,`
|
|
6
|
+
`);if(!l.startsWith(`---
|
|
7
|
+
`))return{frontmatter:null,body:l};const a=l.indexOf(`
|
|
8
|
+
---
|
|
9
|
+
`,4);return a<0?{frontmatter:null,body:l}:{frontmatter:l.slice(4,a).trim(),body:l.slice(a+5).trimStart()}}n(et,"splitFrontmatter");function Ea(t,l){const a=et(t);return a.frontmatter?["---",a.frontmatter,"---","",l].join(`
|
|
10
|
+
`):l}n(Ea,"mergeFrontmatter");function On(t){const l={name:"",path:null,kind:"dir",children:[]};for(const u of t){const x=u.path.split("/").filter(Boolean);let r=l,f="";for(const[o,m]of x.entries()){f=f?`${f}/${m}`:m;const N=o===x.length-1;let k=r.children.find(F=>F.name===m);k||(k={name:m,path:N?u.path:f,kind:N?"file":"dir",fileKind:N?u.kind:void 0,children:[]},r.children.push(k)),r=k}}function a(u){u.children.sort((x,r)=>x.kind!==r.kind?x.kind==="dir"?-1:1:x.name==="SKILL.md"?-1:r.name==="SKILL.md"?1:x.name.localeCompare(r.name)),u.children.forEach(a)}return n(a,"sortNode"),a(l),l.children}n(On,"buildTree");function st(t,l){const a=l?.toLowerCase()??"",u=a.includes("skills.sh")||a.includes("vercel-labs/skills");switch(t){case"skills_sh":return{icon:fn,label:l??"skills.sh",managedLabel:"skills.sh managed"};case"github":return u?{icon:fn,label:l??"skills.sh",managedLabel:"skills.sh managed"}:{icon:Pt,label:l??"GitHub",managedLabel:"GitHub managed"};case"url":return{icon:pa,label:l??"URL",managedLabel:"URL managed"};case"local":return{icon:Kt,label:l??"Folder",managedLabel:"Folder managed"};case"paperclip":return{icon:Yr,label:l??"Microvac",managedLabel:"Microvac managed"};default:return{icon:je,label:l??"Catalog",managedLabel:"Catalog managed"}}}n(st,"sourceMeta");function tt(t){return t?t.slice(0,7):null}n(tt,"shortRef");function Ra(t){const l=[`${t.discovered} found`,`${t.imported.length} imported`,`${t.updated.length} updated`];return t.conflicts.length>0&&l.push(`${t.conflicts.length} conflicts`),t.skipped.length>0&&l.push(`${t.skipped.length} skipped`),`${l.join(", ")} across ${t.scannedWorkspaces} workspace${t.scannedWorkspaces===1?"":"s"}.`}n(Ra,"formatProjectScanSummary");function $a(t){return t==="script"||t==="reference"?Xr:qt}n($a,"fileIcon");function bn(t){const l=t.split("/").filter(Boolean),a=[];for(let u=0;u<l.length-1;u+=1)a.push(l.slice(0,u+1).join("/"));return a}n(bn,"parentDirectoryPaths");function jn(t,l){if(!t||typeof t!="object")return null;const a=t[l];if(typeof a!="string")return null;const u=a.trim();return u.length>0?u:null}n(jn,"readonlyMetadataValue");function _a(t){const l=jn(t,"sourceKind")??jn(t,"catalogKind");return l==="bundled"?"bundled":l==="optional"?"optional":null}n(_a,"readonlyMetadataKind");function za(t){if(t.sourceBadge==="paperclip"||t.sourceType==="local_path"&&!t.sourceBadge.toString().includes("github"))return"company";if(t.sourceType==="catalog"||t.sourceBadge==="catalog"){const l=t.catalogKind??_a(t.metadata);return l==="bundled"?"bundled":l==="optional"?"optional":"company"}return t.sourceBadge==="github"||t.sourceBadge==="skills_sh"||t.sourceBadge==="url"||t.sourceBadge==="local"?"external":"company"}n(za,"classifySource");function Hn({level:t}){const l={markdown_only:{icon:$r,label:"Markdown only",tooltip:"Text only — no scripts, no binaries, no assets.",className:"border-border bg-muted/40 text-muted-foreground"},assets:{icon:Kt,label:"Includes assets",tooltip:"Ships images, fonts, or other non-script files.",className:"border-cyan-500/30 bg-cyan-500/10 text-cyan-800 dark:text-cyan-200"},scripts_executables:{icon:Kn,label:"Includes scripts",tooltip:"Ships executable scripts. Review before installing.",className:"border-amber-500/40 bg-amber-500/10 text-amber-800 dark:text-amber-200"}},a=l[t]??l.markdown_only,u=a.icon;return(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsxs)(oe,{variant:"outline",className:K("text-(length:--text-micro)",a.className),children:[(0,e.jsx)(u,{className:"h-3 w-3","aria-hidden":"true"}),a.label]})}),(0,e.jsx)(Ve,{children:a.tooltip})]})}n(Hn,"TrustChip");function Gn({compatibility:t}){if(t==="compatible")return null;const l={unknown:{icon:xa,label:"Unknown format",tooltip:"Microvac could not validate this skill as Agent Skills markdown. Install at your own risk.",className:"border-yellow-500/40 bg-yellow-500/10 text-yellow-800 dark:text-yellow-200"},invalid:{icon:Ir,label:"Invalid",tooltip:"This skill cannot be installed — content is not valid Agent Skills markdown.",className:"border-destructive/40 bg-destructive/10 text-destructive"}}[t],a=l.icon;return(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsxs)(oe,{variant:"outline",className:K("text-(length:--text-micro)",l.className),children:[(0,e.jsx)(a,{className:"h-3 w-3","aria-hidden":"true"}),l.label]})}),(0,e.jsx)(Ve,{children:l.tooltip})]})}n(Gn,"CompatChip");function Va({packageName:t,packageVersion:l}){return t?(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded border border-border bg-muted/30 px-1.5 py-0.5 font-mono text-(length:--text-nano) text-muted-foreground",children:[(0,e.jsx)(je,{className:"h-3 w-3","aria-hidden":"true"}),(0,e.jsxs)("span",{children:[t,l?` v${l}`:""]})]})}),(0,e.jsx)(Ve,{children:"Installed from the app-shipped skills catalog. Provenance is signed by package version and content hash."})]}):null}n(Va,"ProvenanceBadge");function Ua(t){return t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`}n(Ua,"formatBytes");var Qa=["all","installed","catalog","bundled"];function Oa(t){return Qa.includes(t)?t:"installed"}n(Oa,"resolveDiscoveryTab");function Ha(t,l){const a=new URLSearchParams(t);return l==="installed"?a.delete("tab"):a.set("tab",l),a.delete("category"),l!=="installed"&&a.delete("folder"),a}n(Ha,"withDiscoveryTab");function Ga(t,l){return[{label:"Skills",href:"/skills"},...(t.folderId?Da(ts(l),t.folderId):[]).map((a,u)=>({label:u===0?Sa(a):a.name,href:`/skills?folder=${encodeURIComponent(a.id)}`})),{label:t.name}]}n(Ga,"skillDetailBreadcrumbs");var yn={agents:"Most agents",stars:"Most stars",forks:"Most forks",recent:"Recently updated",alphabetical:"Alphabetical"},Wa=["agents","stars","forks","recent","alphabetical"];function vn(t,l){return t.packageVersion?`v${t.packageVersion}`:l?"core":t.sourceRef?tt(t.sourceRef):null}n(vn,"discoveryVersionLabel");function kn(t){const l=[],a=new Set;for(const u of t){const x=u?.trim();!x||a.has(x)||(a.add(x),l.push(x))}return l}n(kn,"uniqueCategories");function Nn(t){return[...t].sort().join(",")}n(Nn,"categorySetKey");function Ya(t){return`${t.sharingScope==="private"?"Sharing: private":"Sharing: company"} | ${t.categories.length?`Categories: ${t.categories.join(", ")}`:"Categories: none"}`}n(Ya,"skillSettingsToastBody");function Xa(t,l){const a=new Map(l.map(r=>[r.key,r])),u=[],x=new Set;for(const r of t){x.add(r.key);const f=a.get(r.key)??null,o=r.catalogKind==="bundled"||f?.kind==="bundled";u.push({key:r.key,skillId:r.id,folderId:r.folderId??null,catalogRef:f?f.id:null,name:r.name,slug:r.slug,author:r.authorName??r.sourceLabel??"you",version:vn(r,o),tagline:r.tagline??null,description:r.description??null,categories:kn([...r.categories??[],f?.category]),iconUrl:r.iconUrl,color:r.color,starCount:r.starCount??0,agentCount:r.attachedAgentCount??0,forkCount:r.forkCount??0,installed:!0,required:o,forkedFrom:!!r.forkedFromSkillId,updatedAt:new Date(r.updatedAt).getTime()||0,sourceBadge:r.sourceBadge,sourceLabel:r.sourceLabel})}for(const r of l){if(x.has(r.key))continue;const f=r.kind==="bundled";u.push({key:r.key,skillId:null,folderId:null,catalogRef:r.id,name:r.name,slug:r.slug,author:r.packageName??"Microvac",version:vn({packageVersion:r.packageVersion??null,sourceRef:null},f),tagline:null,description:r.description,categories:kn([r.category,...r.tags??[]]),iconUrl:null,color:null,starCount:0,agentCount:0,forkCount:0,installed:!1,required:f,forkedFrom:!1,updatedAt:0,sourceBadge:"catalog",sourceLabel:r.packageName??"Catalog"})}return u}n(Xa,"buildDiscoveryCards");function Za(t,l){switch(l){case"installed":return t.filter(a=>a.installed);case"catalog":return t.filter(a=>a.catalogRef!=null);case"bundled":return t.filter(a=>a.required);default:return t}}n(Za,"cardsForTab");function Ja(t,l,a){const u=n((x,r)=>x.name.localeCompare(r.name),"byName");return[...t].sort((x,r)=>{if(a&&x.required!==r.required)return x.required?1:-1;switch(l){case"stars":return r.starCount-x.starCount||u(x,r);case"forks":return r.forkCount-x.forkCount||u(x,r);case"recent":return r.updatedAt-x.updatedAt||u(x,r);case"alphabetical":return u(x,r);default:return r.agentCount-x.agentCount||u(x,r)}})}n(Ja,"sortDiscoveryCards");function wn(t,l){return l?[t.name,t.slug,t.author,t.tagline??"",t.description??"",t.categories.join(" ")].join(" ").toLowerCase().includes(l.toLowerCase()):!0}n(wn,"discoveryMatchesSearch");function Sn({icon:t,value:l}){return(0,e.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,e.jsx)(t,{className:"h-3 w-3","aria-hidden":"true"}),l]})}n(Sn,"SkillStat");function Wn({label:t}){return(0,e.jsx)(oe,{variant:"outline",className:"border-border bg-muted/40 text-(length:--text-nano) capitalize text-muted-foreground",children:t})}n(Wn,"SkillCategoryChip");function el({card:t,folders:l,selected:a=!1,selectMode:u=!1,showFolderBadge:x=!1,onOpen:r,onSelectChange:f,onMove:o,onCreateFolderAndMove:m,onOpenMove:N}){const k=x&&t.installed?t.folderId?l?.find(h=>h.id===t.folderId)??null:null:void 0,F=t.folderId?l?.find(h=>h.id===t.folderId)??null:null,y=t.installed&&!t.required&&!(F&&Fa(F));return(0,e.jsxs)("div",{onClick:n(()=>r(t),"onClick"),onKeyDown:n(h=>{h.target===h.currentTarget&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),r(t))},"onKeyDown"),role:"button",tabIndex:0,className:K("group flex h-full min-h-(--sz-11_5rem) flex-col rounded-lg border border-border bg-card p-4 text-left cursor-pointer transition-colors hover:border-foreground/20 hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",t.required&&"bg-muted/30"),children:[(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[u&&y?(0,e.jsx)("input",{type:"checkbox",className:"mt-1 h-4 w-4 rounded border-border",checked:a,"aria-label":`Select ${t.name}`,onClick:n(h=>h.stopPropagation(),"onClick"),onChange:n(h=>f?.(t,h.target.checked),"onChange")}):null,(0,e.jsx)(Et,{card:t}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsx)("div",{className:"truncate font-mono text-sm font-medium text-foreground",children:t.name}),(0,e.jsxs)("div",{className:"truncate text-xs text-muted-foreground",children:["by ",t.author,t.version?` · ${t.version}`:""]}),k!==void 0?(0,e.jsxs)("div",{className:"mt-1 flex min-w-0 items-center gap-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)(Ta,{color:k?.color,className:"h-2 w-2"}),(0,e.jsx)("span",{className:"truncate",children:k?k.name:"Unfiled"})]}):null]}),(()=>{const h=st(t.sourceBadge??"catalog",t.sourceLabel??null),T=h.icon;return(0,e.jsx)("span",{className:"shrink-0 text-muted-foreground",title:`From ${h.label}`,"aria-label":`From ${h.label}`,children:(0,e.jsx)(T,{className:"h-3.5 w-3.5","aria-hidden":"true"})})})(),y&&l&&o&&m?(0,e.jsxs)(qs,{children:[(0,e.jsx)(Ms,{asChild:!0,children:(0,e.jsx)(v,{variant:"ghost",size:"icon-sm",className:"-mr-1 -mt-1 opacity-70 group-hover:opacity-100","aria-label":`More actions for ${t.name}`,onClick:n(h=>h.stopPropagation(),"onClick"),children:(0,e.jsx)(oa,{className:"h-4 w-4"})})}),(0,e.jsxs)(Ks,{align:"end",onClick:n(h=>h.stopPropagation(),"onClick"),children:[N?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(ss,{onSelect:n(()=>N(t),"onSelect"),children:[(0,e.jsx)(Fn,{className:"h-3.5 w-3.5"}),"Move to folder…"]}),(0,e.jsx)(ha,{})]}):null,(0,e.jsx)(Ia,{folders:l,currentFolderId:t.folderId,onMove:n(h=>o(t,h),"onMove"),onCreateAndMove:n(()=>m(t),"onCreateAndMove")})]})]}):null]}),t.forkedFrom?(0,e.jsxs)("div",{className:"mt-2 inline-flex items-center gap-1 text-(length:--text-micro) text-muted-foreground",children:[(0,e.jsx)(ys,{className:"h-3 w-3","aria-hidden":"true"}),"Forked"]}):null,(0,e.jsx)("p",{className:"mt-2 line-clamp-2 min-h-8 text-xs text-muted-foreground",children:_n({tagline:t.tagline,description:t.description,key:t.key,name:t.name})??""}),(0,e.jsxs)("div",{className:"mt-auto pt-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-(length:--text-micro) text-muted-foreground",children:[(0,e.jsxs)("span",{children:[t.agentCount," ",t.agentCount===1?"agent":"agents"]}),t.starCount>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,e.jsx)(Sn,{icon:$n,value:String(t.starCount)})]}):null,t.forkCount>0?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{"aria-hidden":"true",children:"·"}),(0,e.jsx)(Sn,{icon:ys,value:String(t.forkCount)})]}):null]}),(0,e.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1",children:[t.installed?(0,e.jsx)(oe,{variant:"outline",className:"border-emerald-500/30 bg-emerald-500/10 text-(length:--text-nano) text-emerald-700 dark:text-emerald-300",children:"Installed"}):null,t.categories.slice(0,2).map(h=>(0,e.jsx)(Wn,{label:h},h)),t.required?(0,e.jsxs)(oe,{variant:"outline",className:"ml-auto border-border bg-muted/60 text-(length:--text-nano) text-muted-foreground",children:[(0,e.jsx)(ra,{className:"h-3 w-3","aria-hidden":"true"}),"Bundled"]}):null]})]})]})}n(el,"SkillCard");function sl({categories:t,total:l,active:a,onSelect:u}){return(0,e.jsxs)("nav",{className:"flex flex-col gap-0.5 px-2",children:[(0,e.jsxs)("button",{type:"button",onClick:n(()=>u(null),"onClick"),className:K("flex items-center justify-between rounded-md px-2 py-1.5 text-sm transition-colors hover:bg-accent/40",a==null?"bg-accent/60 font-medium text-foreground":"text-muted-foreground"),children:[(0,e.jsx)("span",{children:"All"}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:l})]}),t.map(x=>(0,e.jsxs)("button",{type:"button",onClick:n(()=>u(x.slug),"onClick"),className:K("flex items-center justify-between rounded-md px-2 py-1.5 text-sm capitalize transition-colors hover:bg-accent/40",a===x.slug?"bg-accent/60 font-medium text-foreground":"text-muted-foreground"),children:[(0,e.jsx)("span",{className:"truncate",children:x.slug}),(0,e.jsx)("span",{className:"ml-2 shrink-0 text-xs text-muted-foreground",children:x.count})]},x.slug))]})}n(sl,"CategoryNav");function tl({tab:t,tabCounts:l,onTabChange:a,categories:u,categoryTotal:x,activeCategory:r,onCategoryChange:f,search:o,onSearchChange:m,sort:N,onSortChange:k,cards:F,onOpenCard:y,loading:h,error:T,onRetry:q,retrying:Q=!1,totalCount:j,onCreate:D,onImport:de,onImportFromProject:te,onBrowseCatalog:ce,onScan:ue,scanPending:b,scanStatus:E,folderResult:P,folderSelection:C="all",foldersLoading:X=!1,selectMode:Se=!1,selectedSkillIds:Ue=[],onFolderSelect:pe,onCreateFolder:Ce,onRenameFolder:Ie,onEditFolder:rs,onMoveFolder:Fe,onDeleteFolder:ne,onToggleSelectMode:re,onSelectCard:ye,onMoveCard:as,onCreateFolderAndMoveCard:Ss,onMoveSelected:Cs,onCreateFolderAndMoveSelected:Is,onClearSelected:Qe,onOpenMobileFolders:ls,onCreateFolderIn:is,onEnsureMyFolder:Z,onOpenMoveCard:Le,folderNudgeStorageKey:os}){const[O,Me]=(0,d.useState)("all"),me=(0,d.useMemo)(()=>{const w=new Set;for(const ge of F)ge.sourceBadge&&w.add(ge.sourceBadge);return Array.from(w).sort()},[F]);(0,d.useEffect)(()=>{O!=="all"&&!me.includes(O)&&Me("all")},[me,O]);const $=(0,d.useMemo)(()=>O==="all"?F:F.filter(w=>w.sourceBadge===O),[F,O]),De=O!=="all",ve=!!(is&&Ie&&rs&&Fe&&ne),xe=!!(P&&P.folders.length>0&&pe&&ve),ke=(0,d.useMemo)(()=>{if(!P||C==="all"||C==="unfiled")return null;const w=P.folders.find(ge=>ge.id===C);return w?.systemKey?.startsWith("project:")?w:null},[P,C]),Oe=ke?.systemKey?.slice(8)||null;return(0,e.jsxs)("div",{className:"flex min-h-(--sz-calc-30) md:h-(--sz-calc-33) md:min-h-0 md:overflow-hidden",children:[xe?(0,e.jsx)("div",{className:"hidden shrink-0 pl-4 pt-4 md:block",children:(0,e.jsx)(Kr,{result:P,selection:C,loading:X,tags:u,activeTag:r,onSelect:pe,onSelectTag:f,onCreateFolder:is,onRenameFolder:Ie,onEditFolder:rs,onMoveFolder:Fe,onDeleteFolder:ne,onEnsureMyFolder:Z})}):null,(0,e.jsxs)("aside",{className:K("hidden w-60 shrink-0 flex-col overflow-hidden border-r border-border md:flex",xe&&"md:hidden"),children:[(0,e.jsxs)("div",{className:"border-b border-border px-4 py-4",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold text-foreground",children:"Skills Store"}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Discover, install, fork, share"})]}),(0,e.jsx)("div",{className:"px-4 pb-1 pt-3 text-(length:--text-micro) font-medium uppercase tracking-wide text-muted-foreground",children:"Categories"}),(0,e.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto pb-4",children:(0,e.jsx)(sl,{categories:u,total:x,active:r,onSelect:f})})]}),(0,e.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[(0,e.jsxs)("div",{"data-canonical-toolbar":"skill-catalog",role:"toolbar","aria-label":"Skill catalog controls",className:"flex flex-wrap items-center gap-2 border-b border-border px-4 py-3",children:[(0,e.jsxs)("div",{"data-toolbar-control":!0,className:"design-task-search flex min-w-(--sz-12rem) flex-1 items-center gap-2 rounded-md border border-border px-2.5",children:[(0,e.jsx)(Ur,{className:"h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,e.jsx)("input",{value:o,onChange:n(w=>m(w.target.value),"onChange"),placeholder:"Search skills, authors, categories…",className:"h-full w-full bg-transparent text-base outline-none placeholder:text-muted-foreground sm:text-sm"})]}),(0,e.jsxs)(qs,{children:[(0,e.jsx)(Ms,{asChild:!0,children:(0,e.jsxs)(v,{variant:"outline",size:"sm",children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"Sort"}),(0,e.jsx)("span",{className:"ml-1.5",children:yn[N]}),(0,e.jsx)(bs,{className:"ml-1 h-3.5 w-3.5"})]})}),(0,e.jsx)(Ks,{align:"end",children:(0,e.jsx)(vt,{value:N,onValueChange:n(w=>k(w),"onValueChange"),children:Wa.map(w=>(0,e.jsx)(As,{value:w,children:yn[w]},w))})})]}),me.length>1?(0,e.jsxs)(qs,{children:[(0,e.jsx)(Ms,{asChild:!0,children:(0,e.jsxs)(v,{variant:"outline",size:"sm",children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"Source"}),(0,e.jsx)("span",{className:"ml-1.5 capitalize",children:O==="all"?"All":st(O,null).label}),(0,e.jsx)(bs,{className:"ml-1 h-3.5 w-3.5"})]})}),(0,e.jsx)(Ks,{align:"end",children:(0,e.jsxs)(vt,{value:O,onValueChange:Me,children:[(0,e.jsx)(As,{value:"all",children:"All sources"}),me.map(w=>(0,e.jsx)(As,{value:w,children:st(w,null).label},w))]})})]}):null,(0,e.jsx)(v,{variant:"ghost",size:"icon-sm",onClick:n(()=>ue(),"onClick"),disabled:b,"aria-label":"Scan project workspaces for skills",title:"Scan project workspaces for skills",children:(0,e.jsx)(Js,{className:K("h-4 w-4",b&&"animate-spin")})}),(0,e.jsx)(v,{asChild:!0,variant:"outline",size:"sm",children:(0,e.jsxs)(be,{to:"/skills/studio",children:[(0,e.jsx)(Dn,{className:"h-3.5 w-3.5"}),"Studio"]})}),(0,e.jsxs)(qs,{children:[(0,e.jsx)(Ms,{asChild:!0,children:(0,e.jsxs)(v,{size:"sm",variant:"default",children:[(0,e.jsx)(Dt,{className:"mr-1 h-3.5 w-3.5"}),"New",(0,e.jsx)(bs,{className:"ml-1 h-3.5 w-3.5"})]})}),(0,e.jsxs)(Ks,{align:"end",children:[(0,e.jsxs)(ss,{onSelect:D,children:[(0,e.jsx)(Tn,{className:"mr-2 h-4 w-4"}),"Create new skill"]}),(0,e.jsxs)(ss,{onSelect:ce,children:[(0,e.jsx)(je,{className:"mr-2 h-4 w-4"}),"Browse catalog"]}),(0,e.jsx)(ss,{asChild:!0,children:(0,e.jsxs)(be,{to:"/skills/sources/new",children:[(0,e.jsx)(Pt,{className:"mr-2 h-4 w-4"}),"Import from GitHub"]})}),(0,e.jsx)(ss,{asChild:!0,children:(0,e.jsx)(be,{to:"/skills/sources",children:"Manage sources"})}),(0,e.jsxs)(ss,{onSelect:de,children:[(0,e.jsx)(Qr,{className:"mr-2 h-4 w-4"}),"Import from path or URL"]}),(0,e.jsxs)(ss,{onSelect:te,children:[(0,e.jsx)(Fr,{className:"mr-2 h-4 w-4"}),"Import skills from project"]})]})]}),P&&pe?(0,e.jsx)("div",{className:"w-full md:hidden",children:(0,e.jsx)(Ca,{result:P,selection:C,allLabel:"All skills",onClick:ls??(()=>{})})}):null,Ce&&!xe?(0,e.jsxs)(v,{variant:"outline",size:"sm",onClick:Ce,children:[(0,e.jsx)(Dt,{className:"mr-1 h-3.5 w-3.5"}),"New folder"]}):null,re?(0,e.jsx)(v,{variant:"ghost",size:"sm",onClick:re,children:Se?"Done":"Select"}):null]}),u.length>0?(0,e.jsx)("div",{className:"border-b border-border px-4 py-2 md:hidden",children:(0,e.jsxs)(qs,{children:[(0,e.jsx)(Ms,{asChild:!0,children:(0,e.jsxs)(v,{variant:"outline",size:"sm",className:"w-full justify-between",children:[(0,e.jsx)("span",{className:"capitalize",children:r??"All categories"}),(0,e.jsx)(bs,{className:"h-3.5 w-3.5"})]})}),(0,e.jsx)(Ks,{align:"start",className:"max-h-72 overflow-auto",children:(0,e.jsxs)(vt,{value:r??"__all__",onValueChange:n(w=>f(w==="__all__"?null:w),"onValueChange"),children:[(0,e.jsxs)(As,{value:"__all__",children:["All (",x,")"]}),u.map(w=>(0,e.jsxs)(As,{value:w.slug,className:"capitalize",children:[w.slug," (",w.count,")"]},w.slug))]})})]})}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border px-4",children:[(0,e.jsx)(Rn,{value:t,onValueChange:n(w=>a(w),"onValueChange"),children:(0,e.jsxs)(qn,{variant:"line",className:"p-0",children:[(0,e.jsxs)(Ps,{value:"all",className:"px-3",children:[(0,e.jsx)("span",{children:"All"}),(0,e.jsx)("span",{className:"ml-1.5 text-(length:--text-micro) text-muted-foreground",children:l.all})]}),(0,e.jsxs)(Ps,{value:"installed",className:"px-3",children:[(0,e.jsx)("span",{children:"Installed"}),(0,e.jsx)("span",{className:"ml-1.5 text-(length:--text-micro) text-muted-foreground",children:l.installed})]}),(0,e.jsxs)(Ps,{value:"catalog",className:"px-3",children:[(0,e.jsx)("span",{children:"Catalog"}),(0,e.jsx)("span",{className:"ml-1.5 text-(length:--text-micro) text-muted-foreground",children:l.catalog})]}),(0,e.jsxs)(Ps,{value:"bundled",className:"px-3",children:[(0,e.jsx)("span",{children:"Bundled"}),(0,e.jsx)("span",{className:"ml-1.5 text-(length:--text-micro) text-muted-foreground",children:l.bundled})]})]})}),(0,e.jsx)(v,{variant:"ghost",size:"sm",asChild:!0,children:(0,e.jsx)(be,{to:"/skills/sources",children:"Sources"})})]}),(0,e.jsxs)("div",{className:"min-h-0 flex-1 overflow-auto p-4",children:[E?(0,e.jsx)("p",{className:"mb-3 text-xs text-muted-foreground",children:E}):null,xe&&pe?(0,e.jsxs)("div",{className:"mb-4 flex items-center justify-between gap-2",children:[(0,e.jsx)(qr,{result:P,selection:C,onSelect:pe}),ke&&Oe?(0,e.jsxs)(v,{variant:"ghost",size:"sm",onClick:n(()=>ue(Oe),"onClick"),disabled:b,"aria-label":`Refresh ${ke.name} project skills`,title:`Refresh skills from ${ke.name}`,children:[(0,e.jsx)(Js,{className:K("h-3.5 w-3.5",b&&"animate-spin")}),"Refresh"]}):null]}):null,os&&Ce&&P&&P.folders.length===0&&!h&&F.length>0?(0,e.jsx)(Aa,{storageKey:os,itemLabelPlural:"skills",onCreateFolder:Ce}):null,Se&&Cs&&Is&&Qe?(0,e.jsx)("div",{className:"mb-3",children:(0,e.jsx)(La,{selectedCount:Ue.length,folders:P?.folders??[],onMove:Cs,onCreateAndMove:Is,onClear:Qe,onDone:re??Qe})}):null,T?(0,e.jsx)("div",{className:"py-6",children:(0,e.jsx)(An,{error:T,action:"load skills",onRetry:q,retrying:Q})}):h?(0,e.jsx)(Ae,{variant:"list"}):$.length===0?(0,e.jsxs)("div",{className:"py-12",children:[(0,e.jsx)(ns,{icon:_r,message:j===0?"No skills yet. Create one or install from the catalog.":o||r||De?"No skills match your filters.":"No skills in this tab yet."}),j===0?(0,e.jsxs)("div",{className:"mt-3 flex flex-col items-center gap-2",children:[(0,e.jsxs)(v,{size:"sm",onClick:ce,children:[(0,e.jsx)(je,{className:"mr-1.5 h-3.5 w-3.5"})," Browse catalog"]}),(0,e.jsx)(v,{size:"sm",variant:"outline",asChild:!0,children:(0,e.jsx)(be,{to:"/skills/sources/new",children:"Import from GitHub"})}),(0,e.jsx)(v,{size:"sm",variant:"ghost",onClick:D,children:"Create a skill"})]}):o||r||De?(0,e.jsx)("div",{className:"mt-3 flex justify-center",children:(0,e.jsx)(v,{size:"sm",variant:"ghost",onClick:n(()=>{m(""),f(null),Me("all")},"onClick"),children:"Clear filters"})}):null]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("p",{className:"mb-3 text-xs text-muted-foreground",children:[$.length," ",$.length===1?"skill":"skills",r?(0,e.jsxs)("span",{className:"capitalize",children:[" · ",r]}):null]}),(0,e.jsx)("div",{className:"grid gap-3 [grid-template-columns:repeat(auto-fill,minmax(19rem,1fr))]",children:$.map(w=>(0,e.jsx)(el,{card:w,folders:P?.folders,selected:Ue.includes(w.skillId??""),selectMode:Se,showFolderBadge:!!(P&&o.trim()),onOpen:y,onSelectChange:ye,onMove:as,onCreateFolderAndMove:Ss,onOpenMove:Le},w.key))})]})]})]})]})}n(tl,"DiscoveryGrid");function nl({initialDraft:t,onCreate:l,isPending:a,error:u,onCancel:x}){const[r,f]=(0,d.useState)(0),[o,m]=(0,d.useState)(t),[N,k]=(0,d.useState)(t.slug.trim().length>0),F=o.categories.join(", "),y=["Basics","Design","Content","Review"];(0,d.useEffect)(()=>{f(0),m(t),k(t.slug.trim().length>0)},[t]);function h(j){m(D=>({...D,...j}))}n(h,"patchDraft");const T=o.name.trim().length>0,q=o.slug.trim()||kt(o.name);function Q(){l(fa(o))}return n(Q,"submit"),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"flex items-center gap-2 border-b border-border pb-3",children:y.map((j,D)=>(0,e.jsx)("button",{type:"button",onClick:n(()=>f(D),"onClick"),className:K("rounded-md px-2 py-1 text-xs",r===D?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground"),children:j},j))}),o.forkedFromName?(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/30 px-3 py-2 text-xs text-muted-foreground",children:[(0,e.jsx)(ys,{className:"h-3.5 w-3.5"}),"Forking ",o.forkedFromName]}):null,r===0?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)($e,{value:o.name,onChange:n(j=>{const D=j.target.value;h({name:D,slug:N?o.slug:kt(D),markdown:o.markdown===Zs(o.name,o.tagline)?Zs(D,o.tagline):o.markdown})},"onChange"),placeholder:"Skill name",className:"h-9"}),(0,e.jsx)($e,{value:o.slug,onChange:n(j=>{const D=kt(j.target.value);k(D.length>0),h({slug:D})},"onChange"),placeholder:"skill-shortname",className:"h-9 font-mono"}),(0,e.jsx)(Lt,{value:o.tagline,onChange:n(j=>{const D=j.target.value;h({tagline:D,description:o.description?o.description:D,markdown:o.markdown===Zs(o.name,o.tagline)?Zs(o.name,D):o.markdown})},"onChange"),placeholder:"One-line promise for the skill",className:"min-h-20"})]}):r===1?(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)(Et,{size:48,card:{key:q||o.name||"new-skill",name:o.name||"New Skill",slug:q||"skill",iconUrl:null,color:o.color}}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate text-sm font-medium",children:o.name||"New Skill"}),(0,e.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:o.tagline||"No tagline yet."})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"mb-2 block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Color"}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[ja.map(j=>(0,e.jsx)("button",{type:"button",onClick:n(()=>h({color:j}),"onClick"),className:K("h-7 w-7 rounded-md border",o.color===j?"border-foreground":"border-border"),style:{backgroundColor:j},"aria-label":`Use ${j}`},j)),(0,e.jsx)($e,{value:o.color,onChange:n(j=>h({color:j.target.value}),"onChange"),className:"h-7 w-28 font-mono text-xs"})]})]}),(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"mb-2 block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Categories"}),(0,e.jsx)($e,{value:F,onChange:n(j=>h({categories:zn(j.target.value)}),"onChange"),placeholder:"engineering, review, memory",className:"h-9"})]})]}):r===2?(0,e.jsx)("div",{className:"space-y-2",children:(0,e.jsx)(Lt,{value:o.markdown,onChange:n(j=>h({markdown:j.target.value}),"onChange"),className:"h-(--sz-calc-34) resize-y font-mono text-xs"})}):(0,e.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,e.jsxs)("div",{className:"grid grid-cols-(--gtc-26) gap-y-2",children:[(0,e.jsx)("span",{className:"text-muted-foreground",children:"Name"}),(0,e.jsx)("span",{children:o.name||"Untitled"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"Slug"}),(0,e.jsx)("span",{className:"font-mono",children:q||"skill"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"Scope"}),(0,e.jsx)("span",{children:o.sharingScope==="private"?"Private":"Company"}),(0,e.jsx)("span",{className:"text-muted-foreground",children:"Categories"}),(0,e.jsx)("span",{children:o.categories.length?o.categories.join(", "):"none"})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("label",{className:"block text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Sharing"}),(0,e.jsxs)("div",{className:"grid gap-2 sm:grid-cols-3",children:[["company","private"].map(j=>(0,e.jsxs)("button",{type:"button",onClick:n(()=>h({sharingScope:j}),"onClick"),className:K("rounded-md border px-3 py-2 text-left text-sm",o.sharingScope===j?"border-foreground bg-accent/50":"border-border"),children:[(0,e.jsx)("span",{className:"block font-medium",children:j==="company"?"Company":"Private"}),(0,e.jsx)("span",{className:"mt-1 block text-xs text-muted-foreground",children:j==="company"?"Visible inside this company.":"Only visible in your library."})]},j)),(0,e.jsxs)("button",{type:"button",disabled:!0,className:"rounded-md border border-dashed border-border px-3 py-2 text-left text-sm text-muted-foreground",children:[(0,e.jsx)("span",{className:"block font-medium",children:"Public link"}),(0,e.jsx)("span",{className:"mt-1 block text-xs",children:"Coming later."})]})]})]})]}),u?(0,e.jsx)("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 px-3 py-2 text-sm text-destructive",children:u}):null,(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2 border-t border-border pt-3",children:[(0,e.jsx)(v,{variant:"ghost",size:"sm",onClick:x,disabled:a,children:"Cancel"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(v,{variant:"ghost",size:"sm",onClick:n(()=>f(j=>Math.max(0,j-1)),"onClick"),disabled:a||r===0,children:"Back"}),r<y.length-1?(0,e.jsx)(v,{size:"sm",onClick:n(()=>f(j=>Math.min(y.length-1,j+1)),"onClick"),disabled:!T,children:"Next"}):(0,e.jsx)(v,{size:"sm",onClick:Q,disabled:a||!T,children:a?"Creating...":o.forkedFromSkillId?"Create fork":"Create skill"})]})]})]})}n(nl,"NewSkillWizard");function rl({skill:t,packageName:l,packageVersion:a,installedSkill:u,installedSkillId:x,fileQuery:r,selectedPath:f,onInstall:o,onUpdate:m,onOpenInstalled:N,loadingPrimaryAction:k}){const F=Es(r);if(!t)return(0,e.jsx)(ns,{icon:je,message:"Select a catalog skill to inspect."});const y=u?.originHash??null,h=!!(u&&y&&y!==t.contentHash),T=!!u;let q;t.compatibility==="invalid"?q=(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsx)("span",{children:(0,e.jsxs)(v,{disabled:!0,children:[(0,e.jsx)(Bt,{className:"mr-1.5 h-3.5 w-3.5"}),"Install skill"]})})}),(0,e.jsx)(Ve,{children:"This skill cannot be installed — its content is not valid Agent Skills markdown."})]}):T?h?q=(0,e.jsxs)(v,{onClick:m,disabled:k,className:"border-amber-500/40 bg-amber-500/20 text-amber-900 dark:text-amber-100 hover:bg-amber-500/30",children:[(0,e.jsx)(Ct,{className:"mr-1.5 h-3.5 w-3.5"}),"Update from catalog"]}):q=(0,e.jsxs)(v,{variant:"ghost",onClick:n(()=>x&&N(x),"onClick"),children:[(0,e.jsx)(Bn,{className:"mr-1.5 h-3.5 w-3.5"}),"Installed · Open in library"]}):q=(0,e.jsxs)(v,{onClick:o,disabled:k,children:[t.trustLevel==="scripts_executables"?(0,e.jsx)(Kn,{className:"mr-1.5 h-3.5 w-3.5"}):(0,e.jsx)(Bt,{className:"mr-1.5 h-3.5 w-3.5"}),k?"Preparing...":"Install skill in this organization"]});const Q=r.data?.markdown?Qn(r.data.content):r.data?.content??"";return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"border-b border-border px-5 py-4",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("h1",{className:"flex items-center gap-2 truncate text-2xl font-semibold",children:[(0,e.jsx)(je,{className:K("h-5 w-5 shrink-0 text-muted-foreground",t.kind==="optional"&&"opacity-70"),"aria-hidden":"true"}),t.name]}),(0,e.jsx)("p",{className:"mt-2 max-w-3xl text-sm text-muted-foreground",children:t.description}),(0,e.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"rounded border border-border bg-muted/40 px-1.5 py-0.5 uppercase tracking-wide",children:t.kind}),(0,e.jsx)("span",{children:"·"}),(0,e.jsx)("span",{children:t.category}),(0,e.jsx)("span",{children:"·"}),(0,e.jsx)(Va,{packageName:l,packageVersion:a})]})]}),(0,e.jsx)("div",{className:"flex flex-wrap items-center gap-2",children:q})]}),(0,e.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-2 border-t border-border pt-4",children:[(0,e.jsx)(Hn,{level:t.trustLevel}),(0,e.jsx)(Gn,{compatibility:t.compatibility}),h?(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsxs)(oe,{variant:"outline",className:"border-amber-500/40 bg-amber-500/10 text-(length:--text-micro) text-amber-800 dark:text-amber-200",children:[(0,e.jsx)(Ct,{className:"h-3 w-3","aria-hidden":"true"}),"Update available"]})}),(0,e.jsx)(Ve,{children:"Catalog content hash has changed since this skill was installed."})]}):null,t.requires.length>0?(0,e.jsxs)(oe,{variant:"outline",className:"border-border bg-muted/40 text-(length:--text-micro) text-muted-foreground",children:["Requires: ",t.requires.join(", ")]}):null,t.recommendedForRoles.length>0?(0,e.jsxs)(oe,{variant:"outline",className:"border-border bg-muted/40 text-(length:--text-micro) text-muted-foreground",children:["Roles: ",t.recommendedForRoles.join(" · ")]}):null,t.tags.length>0?(0,e.jsxs)(oe,{variant:"outline",className:"border-border bg-muted/40 text-(length:--text-micro) text-muted-foreground",children:["Tags: ",t.tags.join(" · ")]}):null]}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)("span",{className:"uppercase tracking-(--tracking-caps)",children:"Key"}),(0,e.jsx)("span",{className:"font-mono",children:t.key}),(0,e.jsx)("span",{className:"uppercase tracking-(--tracking-caps)",children:"·"}),(0,e.jsx)("span",{className:"uppercase tracking-(--tracking-caps)",children:"Hash"}),(0,e.jsxs)("span",{className:"font-mono",children:[t.contentHash.slice(0,24),"…"]}),(0,e.jsx)(zr,{text:t.contentHash,copiedLabel:"Copied hash",ariaLabel:"Copy content hash",title:"Copy content hash",className:"inline-flex h-6 w-6 items-center justify-center rounded-sm border border-border text-muted-foreground hover:bg-accent hover:text-foreground",children:(0,e.jsx)(Pn,{className:"h-3 w-3"})})]})]}),(0,e.jsx)("div",{className:"border-b border-border px-5 py-3",children:(0,e.jsx)("div",{className:"truncate font-mono text-sm",children:f})}),(0,e.jsx)("div",{className:"min-h-(--sz-400px) px-5 py-5",children:r.isLoading||F.kind==="reconnecting"?(0,e.jsx)(Ae,{variant:"detail"}):F.kind==="error"?(0,e.jsx)(An,{error:r.error,action:"load the file",onRetry:F.retry,retrying:F.isFetching}):r.data?r.data.markdown?(0,e.jsx)(Tt,{softBreaks:!1,linkIssueReferences:!1,children:Q}):(0,e.jsx)("pre",{className:K("overflow-x-auto whitespace-pre-wrap wrap-break-word border-0 bg-transparent p-0 font-mono text-sm text-foreground",At),children:(0,e.jsx)("code",{children:r.data.content})}):(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"Select a file to inspect."})})]})}n(rl,"CatalogDetailPane");function al(t){return new Set(t.filter(l=>l.supportsSkills&&!l.required).map(l=>l.id))}n(al,"defaultInstallAgentSelection");function ll({open:t,onOpenChange:l,skill:a,packageName:u,packageVersion:x,conflict:r,defaultSlug:f,defaultForce:o,defaultAction:m,agents:N,isPending:k,error:F,onConfirm:y}){const[h,T]=(0,d.useState)(""),[q,Q]=(0,d.useState)(!1),[j,D]=(0,d.useState)(!1),[de,te]=(0,d.useState)(new Set),[ce,ue]=(0,d.useState)(!1),b=(0,d.useRef)(!1);if((0,d.useEffect)(()=>{t&&(T(f??""),Q(o),D(m==="replace"||o))},[t,f,o,m]),(0,d.useEffect)(()=>{t&&!b.current&&ue(!1),b.current=t},[t]),(0,d.useEffect)(()=>{!t||ce||te(m==="install"?al(N):new Set)},[t,ce,m,N]),!a)return null;let E="Install skill",P="default";return m==="update"?E="Install update":m==="replace"&&(E="Replace existing skill",P="destructive"),k&&(E="Installing…"),(0,e.jsx)(ws,{open:t,onOpenChange:n(C=>k?null:l(C),"onOpenChange"),children:(0,e.jsxs)(ks,{className:"sm:max-w-2xl",showCloseButton:!k,children:[(0,e.jsxs)(vs,{children:[(0,e.jsxs)(Ns,{children:[m==="update"?"Update":m==="replace"?"Replace":"Install"," · ",a.name]}),(0,e.jsxs)(Rs,{children:[(0,e.jsx)("span",{className:"capitalize",children:a.kind})," · ",a.category,u?(0,e.jsxs)(e.Fragment,{children:[" · ",u,x?` v${x}`:""]}):null]})]}),(0,e.jsxs)("div",{className:"space-y-4 text-sm",children:[(0,e.jsx)("div",{className:"rounded-md border border-border p-3",children:(0,e.jsxs)("div",{className:"grid grid-cols-(--gtc-26) gap-y-2 text-xs",children:[(0,e.jsx)("div",{className:"text-muted-foreground",children:"Trust"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(Hn,{level:a.trustLevel}),a.trustLevel==="markdown_only"?(0,e.jsx)("span",{className:"text-muted-foreground",children:"Safe"}):a.trustLevel==="scripts_executables"?(0,e.jsx)("span",{className:"text-amber-800 dark:text-amber-200",children:"Review required"}):(0,e.jsx)("span",{className:"text-muted-foreground",children:"Non-script assets"})]}),(0,e.jsx)("div",{className:"text-muted-foreground",children:"Compatibility"}),(0,e.jsx)("div",{className:"flex items-center gap-2",children:a.compatibility==="compatible"?(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,e.jsx)(Bn,{className:"h-3 w-3","aria-hidden":"true"}),"Compatible"]}):(0,e.jsx)(Gn,{compatibility:a.compatibility})}),(0,e.jsx)("div",{className:"text-muted-foreground",children:"Requires"}),(0,e.jsx)("div",{className:"text-foreground",children:a.requires.length===0?"none":a.requires.join(", ")}),(0,e.jsx)("div",{className:"text-muted-foreground",children:"Roles"}),(0,e.jsx)("div",{className:"text-foreground",children:a.recommendedForRoles.length===0?"any":a.recommendedForRoles.join(" · ")}),(0,e.jsx)("div",{className:"text-muted-foreground",children:"Provenance"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"truncate",children:[u??"—",x?` v${x}`:""]}),(0,e.jsx)("div",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground",children:a.contentHash})]})]})}),(0,e.jsxs)("div",{className:"rounded-md border border-border",children:[(0,e.jsxs)("div",{className:"border-b border-border px-3 py-2 text-xs uppercase tracking-wide text-muted-foreground",children:["Files (",a.files.length,")"]}),(0,e.jsx)("div",{className:"max-h-48 overflow-y-auto",children:a.files.map(C=>(0,e.jsxs)("div",{className:"grid grid-cols-(--gtc-27) items-center gap-x-3 border-b border-border/50 px-3 py-1.5 text-xs last:border-b-0",children:[(0,e.jsx)("span",{className:"truncate font-mono text-muted-foreground",children:C.path}),(0,e.jsx)("span",{className:"rounded border border-border bg-muted/40 px-1 py-0.5 text-(length:--text-nano) uppercase text-muted-foreground",children:C.kind}),(0,e.jsx)("span",{className:"text-(length:--text-micro) text-muted-foreground",children:Ua(C.sizeBytes)})]},C.path))})]}),r?(0,e.jsxs)("div",{className:"rounded-md border border-amber-500/40 bg-amber-500/10 p-3 text-xs text-amber-800 dark:text-amber-200",children:["An existing skill with key ",(0,e.jsx)("span",{className:"font-mono",children:r.key})," is installed (",r.sourceLabel??r.sourceType,"). Installing will ",m==="update"?"overwrite the catalog content":"replace the existing skill","."]}):null,m==="install"?(0,e.jsxs)("div",{className:"rounded-md border border-border p-3",children:[(0,e.jsx)("div",{className:"mb-1 text-xs uppercase tracking-wide text-muted-foreground",children:"Enable for agents"}),(0,e.jsx)("p",{className:"mb-2 text-xs text-muted-foreground",children:"Installing adds the skill to the company library. Agents can only use it once it is enabled for them."}),(0,e.jsx)(Mn,{agents:N,selectedAgentIds:de,onChange:n(C=>{ue(!0),te(C)},"onChange"),showSelectionPreview:!1,emptyMessage:"No agents in this company support skills yet.",isAgentDisabled:n(C=>{const X=C;return X.required||!X.supportsSkills},"isAgentDisabled"),getDescription:n(C=>{const X=C;return`${X.adapterType}${X.required?" · required":""}${X.supportsSkills?"":" · skills not supported"}`},"getDescription")})]}):null,(0,e.jsxs)("button",{type:"button",onClick:n(()=>D(C=>!C),"onClick"),className:"inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground",children:[j?(0,e.jsx)(bs,{className:"h-3 w-3"}):(0,e.jsx)(En,{className:"h-3 w-3"}),"Advanced"]}),j?(0,e.jsxs)("div",{className:"space-y-3 rounded-md border border-border p-3 text-xs",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"mb-1 block uppercase tracking-wide text-muted-foreground",children:"Slug override"}),(0,e.jsx)($e,{value:h,onChange:n(C=>T(C.target.value),"onChange"),placeholder:f??a.slug,className:"h-8"})]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)(Zr,{checked:q,onCheckedChange:n(C=>Q(!!C),"onCheckedChange")}),(0,e.jsx)("span",{children:"Force replace existing same-key skill"})]})]}):null,F?(0,e.jsx)("div",{className:"rounded-md border border-destructive/40 bg-destructive/10 p-3 text-xs text-destructive",children:F}):null]}),(0,e.jsxs)(Ft,{children:[(0,e.jsx)(v,{variant:"ghost",onClick:n(()=>l(!1),"onClick"),disabled:k,children:"Cancel"}),(0,e.jsx)(v,{variant:P,onClick:n(()=>y({slug:h.trim().length>0?h.trim():null,force:q,agentIds:m==="install"?Array.from(de):[]}),"onClick"),disabled:k,children:E})]})]})})}n(ll,"InstallPreviewDialog");function Cn({agents:t,attachedAgentIds:l,versions:a,selectedVersionId:u,pending:x,onSubmit:r,fullWidth:f=!1}){const[o,m]=(0,d.useState)(u),N=(0,d.useMemo)(()=>new Set(l),[l]),k=t.filter(y=>y.supportsSkills),F=[...a].sort((y,h)=>h.revisionNumber-y.revisionNumber);return(0,e.jsx)(Mn,{agents:t,selectedAgentIds:N,onSave:n(y=>r(Array.from(y),o),"onSave"),pending:x,triggerLabel:"Add to agent",triggerIcon:(0,e.jsx)(Dt,{className:"mr-1.5 h-3.5 w-3.5"}),triggerVariant:"default",triggerSize:"sm",triggerFullWidth:f,triggerClassName:K(f&&"w-full"),contentAlign:"end",showSelectionPreview:!1,onOpenChange:n(y=>{y&&m(u)},"onOpenChange"),headerContent:F.length>0?(0,e.jsxs)("div",{className:"mt-2 flex items-center gap-2 text-xs",children:[(0,e.jsx)("span",{className:"shrink-0 text-muted-foreground",children:"Version"}),(0,e.jsxs)("select",{value:o??"__latest__",onChange:n(y=>m(y.target.value==="__latest__"?null:y.target.value),"onChange"),className:"h-8 min-w-0 flex-1 rounded-md border border-border bg-background px-2 text-xs text-foreground",children:[(0,e.jsx)("option",{value:"__latest__",children:"Latest"}),F.map(y=>(0,e.jsxs)("option",{value:y.id,children:["v",y.revisionNumber,y.label?` · ${y.label}`:""]},y.id))]})]}):null,emptyMessage:k.length===0?"No agents in this company support skills yet.":"No agents yet.",isAgentDisabled:n(y=>{const h=y;return h.required||!h.supportsSkills},"isAgentDisabled"),getDescription:n(y=>{const h=y;return`${h.adapterType}${h.required?" · required":""}${h.supportsSkills?"":" · skills not supported"}`},"getDescription"),renderNameSuffix:n(y=>y.paused?(0,e.jsxs)(oe,{variant:"outline",className:"[&>svg]:size-2.5 border-amber-500/30 bg-amber-500/10 px-1.5 text-(length:--text-nano) uppercase tracking-wide text-amber-500",children:[(0,e.jsx)(It,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Paused"]}):null,"renderNameSuffix")})}n(Cn,"AttachAgentsPopover");function Rt({nodes:t,skillId:l,selectedPath:a,expandedDirs:u,onToggleDir:x,onSelectPath:r,fileHref:f=n((m,N)=>$s(m,N),"fileHref"),depth:o=0}){return(0,e.jsx)("div",{children:t.map(m=>{const N=m.kind==="dir"&&m.path?u.has(m.path):!1;if(m.kind==="dir")return(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:K("group grid w-full grid-cols-(--gtc-3) items-center gap-x-1 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground",gn),children:[(0,e.jsxs)("button",{type:"button",className:"flex min-w-0 items-center gap-2 py-1 text-left",style:{paddingLeft:`${hn+o*pn}px`},onClick:n(()=>m.path&&x(m.path),"onClick"),children:[(0,e.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:N?(0,e.jsx)(Mt,{className:"h-3.5 w-3.5"}):(0,e.jsx)(Kt,{className:"h-3.5 w-3.5"})}),(0,e.jsx)("span",{className:"truncate",children:m.name})]}),(0,e.jsx)("button",{type:"button",className:"flex h-9 w-9 items-center justify-center self-center rounded-sm text-muted-foreground opacity-70 transition-(--tp-background-color-color-opacity) hover:bg-accent hover:text-foreground group-hover:opacity-100",onClick:n(()=>m.path&&x(m.path),"onClick"),children:N?(0,e.jsx)(bs,{className:"h-3.5 w-3.5"}):(0,e.jsx)(En,{className:"h-3.5 w-3.5"})})]}),N&&(0,e.jsx)(Rt,{nodes:m.children,skillId:l,selectedPath:a,expandedDirs:u,onToggleDir:x,onSelectPath:r,fileHref:f,depth:o+1})]},m.path??m.name);const k=$a(m.fileKind??"other");return(0,e.jsxs)(be,{className:K("flex w-full items-center gap-2 pr-3 text-left text-sm text-muted-foreground hover:bg-accent/30 hover:text-foreground",gn,m.path===a&&"text-foreground"),style:{paddingInlineStart:`${hn+o*pn}px`},to:f(l,m.path),onClick:n(()=>m.path&&r(m.path),"onClick"),children:[(0,e.jsx)("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:(0,e.jsx)(k,{className:"h-3.5 w-3.5"})}),(0,e.jsx)("span",{className:"truncate",children:m.name})]},m.path??m.name)})})}n(Rt,"SkillTree");var il=[{value:"overview",label:"Overview",icon:qt},{value:"files",label:"Files",icon:Mt},{value:"versions",label:"Versions",icon:Ln},{value:"agents",label:"Agents",icon:ua}];function St(t){return t?.usedByAgents.find(l=>l.versionId)?.versionId??null}n(St,"currentVersionSelection");function _s(t){return t?`v${t.revisionNumber}${t.label?` · ${t.label}`:""}`:"Latest"}n(_s,"versionLabel");function ol(t,l){const a=[...t].sort((x,r)=>r.revisionNumber-x.revisionNumber),u=l?a.find(x=>x.id===l)??null:a[0]??null;return u?{leftVersionId:(a.find(x=>x.revisionNumber<u.revisionNumber)??null)?.id??null,rightVersionId:u.id}:{leftVersionId:null,rightVersionId:null}}n(ol,"getSkillVersionDiffSelection");function dl({open:t,onOpenChange:l,versions:a,leftVersionId:u,rightVersionId:x,onLeftVersionChange:r,onRightVersionChange:f}){const o=[...a].sort((b,E)=>E.revisionNumber-b.revisionNumber),m=o.find(b=>b.id===u),N=o.find(b=>b.id===x),k=ie({queryKey:[...g.companySkills.versions(m?.companyId??"",m?.companySkillId??""),u],queryFn:n(()=>z.version(m.companyId,m.companySkillId,m.id),"queryFn"),enabled:t&&!!m}),F=ie({queryKey:[...g.companySkills.versions(N?.companyId??"",N?.companySkillId??""),x],queryFn:n(()=>z.version(N.companyId,N.companySkillId,N.id),"queryFn"),enabled:t&&!!N}),y=k.data??null,h=F.data??null,T=(0,d.useMemo)(()=>{const b=new Set;for(const E of y?.fileInventory??[])b.add(E.path);for(const E of h?.fileInventory??[])b.add(E.path);return Array.from(b).sort((E,P)=>E==="SKILL.md"?-1:P==="SKILL.md"?1:E.localeCompare(P))},[y,h]),[q,Q]=(0,d.useState)("SKILL.md"),j=T.includes(q)?q:T[0]??"SKILL.md",D=y?.fileInventory.find(b=>b.path===j),de=h?.fileInventory.find(b=>b.path===j),te=(0,d.useMemo)(()=>Cr(D?.content??"",de?.content??""),[D?.content,de?.content]),ce={context:"bg-transparent",removed:"bg-red-500/10 text-red-900 dark:text-red-100",added:"bg-green-500/10 text-green-900 dark:text-green-100"},ue={context:" ",removed:"-",added:"+"};return(0,d.useEffect)(()=>{t&&T.length>0&&!T.includes(q)&&Q(T[0])},[T,t,q]),(0,e.jsx)(ws,{open:t,onOpenChange:l,children:(0,e.jsxs)(ks,{className:"flex max-h-(--sz-85vh) w-full !max-w-(--pct-90) flex-col overflow-hidden",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,e.jsxs)(vs,{className:"shrink-0",children:[(0,e.jsx)(Ns,{children:"Diff · skill files"}),(k.error||F.error)&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:(k.error??F.error)?.message}),(k.isLoading||F.isLoading)&&(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading selected versions…"})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs",children:[(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)(oe,{variant:"outline",className:"border-red-500/30 bg-red-500/10 uppercase tracking-wider text-red-400",children:"Old"}),(0,e.jsxs)("select",{value:u??"",onChange:n(b=>r(b.target.value||null),"onChange"),className:"h-8 w-44 rounded-md border border-border bg-background px-2 text-xs",children:[(0,e.jsx)("option",{value:"",children:"Initial"}),o.map(b=>(0,e.jsx)("option",{value:b.id,children:_s(b)},b.id))]})]}),(0,e.jsxs)("label",{className:"flex items-center gap-2",children:[(0,e.jsx)(oe,{variant:"outline",className:"border-green-500/30 bg-green-500/10 uppercase tracking-wider text-green-400",children:"New"}),(0,e.jsx)("select",{value:h?.id??"",onChange:n(b=>f(b.target.value||null),"onChange"),className:"h-8 w-44 rounded-md border border-border bg-background px-2 text-xs",children:o.map(b=>(0,e.jsx)("option",{value:b.id,children:_s(b)},b.id))})]})]})]}),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 gap-3",children:[(0,e.jsx)("aside",{className:"hidden w-56 shrink-0 overflow-auto border-r border-border pr-3 md:block",children:T.map(b=>(0,e.jsxs)("button",{type:"button",onClick:n(()=>Q(b),"onClick"),className:K("flex w-full items-center gap-2 px-2 py-1.5 text-left font-mono text-xs text-muted-foreground hover:bg-accent/40 hover:text-foreground",j===b&&"bg-accent/50 text-foreground"),children:[(0,e.jsx)(qt,{className:"h-3.5 w-3.5 shrink-0"}),(0,e.jsx)("span",{className:"truncate",children:b})]},b))}),(0,e.jsx)("div",{className:"min-w-0 flex-1 overflow-auto rounded-md border border-border text-xs",children:h?y?.id===h.id?(0,e.jsx)("div",{className:"p-6 text-center text-sm text-muted-foreground",children:"Both sides are the same version."}):(0,e.jsxs)("div",{className:"font-mono text-xs leading-6",children:[(0,e.jsxs)("div",{className:"grid grid-cols-(--gtc-1) border-b border-border/60 bg-muted/30 px-3 py-2 text-(length:--text-micro) uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)("span",{children:"Old"}),(0,e.jsx)("span",{children:"New"}),(0,e.jsx)("span",{}),(0,e.jsx)("span",{children:j})]}),te.map((b,E)=>(0,e.jsxs)("div",{className:K("grid grid-cols-(--gtc-1) gap-0 border-b border-border/30 px-3",ce[b.kind]),children:[(0,e.jsx)("span",{className:"select-none border-r border-border/30 pr-3 text-right text-muted-foreground",children:b.oldLineNumber??""}),(0,e.jsx)("span",{className:"select-none border-r border-border/30 px-3 text-right text-muted-foreground",children:b.newLineNumber??""}),(0,e.jsx)("span",{className:"select-none px-3 text-center text-muted-foreground",children:ue[b.kind]}),(0,e.jsx)("pre",{className:K("overflow-x-auto whitespace-pre-wrap break-words px-3 py-0 text-inherit",At),children:b.text.length>0?b.text:" "})]},`${b.kind}-${E}-${b.oldLineNumber??"x"}-${b.newLineNumber??"x"}`))]}):(0,e.jsx)("div",{className:"p-6 text-center text-sm text-muted-foreground",children:"Select a version to compare."})})]})]})})}n(dl,"SkillVersionDiffDialog");function cl({folderPath:t,onMove:l}){const{copied:a,failed:u,copy:x}=ma(),r=t&&t.length>0?t:"Unfiled";return(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Location"}),(0,e.jsxs)("div",{className:"flex items-center gap-2 rounded-md border border-border bg-muted/30 px-2.5 py-1.5",children:[(0,e.jsx)(Mt,{className:"h-3.5 w-3.5 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono text-xs text-foreground",title:r,children:r})]}),(0,e.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,e.jsxs)(v,{size:"sm",variant:"outline",onClick:n(()=>{x(r)},"onClick"),children:[(0,e.jsx)(Pn,{className:"mr-1.5 h-3.5 w-3.5"}),a?"Copied":u?"Copy failed":"Copy path"]}),l?(0,e.jsxs)(v,{size:"sm",variant:"outline",onClick:l,children:[(0,e.jsx)(Fn,{className:"mr-1.5 h-3.5 w-3.5"}),"Move"]}):null]})]})}n(cl,"SkillLocationCard");function ul({categories:t,pending:l,onSave:a}){const[u,x]=(0,d.useState)("");function r(f){const o=f.trim().toLowerCase();if(!o||t.includes(o)){x("");return}a([...t,o]),x("")}return n(r,"addTag"),(0,e.jsxs)("section",{children:[(0,e.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)(Wr,{className:"h-3 w-3"}),"Tags"]}),(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[t.map(f=>(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border bg-accent/40 px-2 py-0.5 text-xs text-foreground",children:[f,(0,e.jsx)("button",{type:"button","aria-label":`Remove tag ${f}`,disabled:l,onClick:n(()=>a(t.filter(o=>o!==f)),"onClick"),className:"text-muted-foreground hover:text-foreground disabled:opacity-50",children:(0,e.jsx)(aa,{className:"h-3 w-3"})})]},f)),t.length===0?(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"No tags yet."}):null]}),(0,e.jsx)($e,{value:u,onChange:n(f=>x(f.target.value),"onChange"),onKeyDown:n(f=>{f.key==="Enter"&&(f.preventDefault(),r(u))},"onKeyDown"),onBlur:n(()=>u.trim()&&r(u),"onBlur"),placeholder:"Add a tag…",disabled:l,className:"mt-2 h-8 text-sm"})]})}n(ul,"SkillTagsEditor");function ml({detail:t,folderDisplayPath:l,catalogSource:a,routeSkills:u,loading:x,activeTab:r,onTabChange:f,selectedPath:o,file:m,fileLoading:N,viewMode:k,editMode:F,draft:y,setViewMode:h,setEditMode:T,setDraft:q,onSave:Q,savePending:j,versions:D,versionsLoading:de,attachAgents:te,onSubmitAttach:ce,attachPending:ue,expandedDirs:b,onToggleDir:E,onSelectPath:P,updateStatus:C,updateStatusLoading:X,onCheckUpdates:Se,checkUpdatesPending:Ue,onInstallUpdate:pe,installUpdatePending:Ce,onToggleStar:Ie,starPending:rs,onFork:Fe,onUpdateSettings:ne,updateSettingsPending:re,onMoveToFolder:ye,onDelete:as,deletePending:Ss,studioHref:Cs}){const[Is,Qe]=(0,d.useState)(!1),[ls,is]=(0,d.useState)(!1),[Z,Le]=(0,d.useState)("company"),[os,O]=(0,d.useState)(""),Me=(0,d.useRef)(null),[me,$]=(0,d.useState)(!1),[De,ve]=(0,d.useState)(!1);(0,d.useEffect)(()=>{const p=Me.current;!p||me||ve(p.scrollHeight-p.clientHeight>1)},[t?.description,t?.tagline,t?.id,me]),(0,d.useEffect)(()=>{$(!1)},[t?.id]),(0,d.useEffect)(()=>{!t||ls||(Le(t.sharingScope==="public_link"?"company":t.sharingScope),O(t.categories.join(", ")))},[t,ls]);const xe=[...D].sort((p,A)=>A.revisionNumber-p.revisionNumber),[ke,Oe]=(0,d.useState)(null),[w,ge]=(0,d.useState)(null);function zs(p){const A=ol(xe,p);Oe(A.leftVersionId),ge(A.rightVersionId),Qe(!!A.rightVersionId)}n(zs,"openVersionDiff");const ds=m?.markdown?et(m.content).body:m?.content??"",cs=F&&!!m?.editable&&y!==ds;if((0,d.useEffect)(()=>{if(!cs)return;const p=n(A=>{A.preventDefault(),A.returnValue=""},"handler");return window.addEventListener("beforeunload",p),()=>window.removeEventListener("beforeunload",p)},[cs]),!t)return x?(0,e.jsx)(Ae,{variant:"detail"}):(0,e.jsx)(ns,{icon:je,message:"Skill not found."});const I=t,nt=Cs??Un(I.id),ae=st(I.sourceBadge,I.sourceLabel),us=ae.icon,He=m?.markdown?Qn(m.content):m?.content??"",rt=tt(I.sourceRef),ms=tt(C?.latestRef),Ge=D.find(p=>p.id===St(I))??null,xs=_n(I)??ae.label,Vs=zn(os),Us=Nn(Vs)!==Nn(I.categories),Pe=Z!==(I.sharingScope==="public_link"?"company":I.sharingScope),We=Us||Pe,Fs=new Map(te.map(p=>[p.id,p])),R=a&&a.type==="github"?a:null,Ls=R?R.hostname==="github.com"?"GitHub":R.hostname:null,Ke=R?`${R.owner}/${R.repo}${R.path?`/${R.path}`:""}`:null,Qs=R?R.url??`https://${R.hostname}/${R.owner}/${R.repo}/tree/${R.ref}/${R.path}`.replace(/\/$/,""):null,J=I.sourcePath||I.sourceLocator||null,hs=I.homepageUrl??(J&&/^(https?:\/\/|[\w.-]+\.[a-z]{2,}\/)/i.test(J)?J.startsWith("http")?J:`https://${J}`:null);function ee(){return(0,e.jsxs)("div",{className:"grid min-h-(--sz-560px) gap-0 lg:grid-cols-(--gtc-28)",children:[(0,e.jsxs)("aside",{className:"border-b border-border pb-3 lg:border-b-0 lg:border-r lg:pb-0 lg:pr-3",children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Files"}),(0,e.jsx)(Rt,{nodes:On(I.fileInventory),skillId:I.id,selectedPath:o,expandedDirs:b,onToggleDir:E,onSelectPath:P,fileHref:n((p,A)=>$s(I,u??[I],A),"fileHref")})]}),(0,e.jsxs)("section",{className:"min-w-0 lg:pl-5",children:[(0,e.jsxs)("div",{className:"mb-3 flex flex-wrap items-center justify-between gap-3 border-b border-border pb-3",children:[(0,e.jsx)("div",{className:"min-w-0 truncate font-mono text-sm",children:m?.path??o}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[m?.markdown&&!F?(0,e.jsxs)("div",{className:"flex items-center border border-border",children:[(0,e.jsx)("button",{className:K("px-3 py-1.5 text-sm",k==="preview"?"text-foreground":"text-muted-foreground"),onClick:n(()=>h("preview"),"onClick"),children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(Rr,{className:"h-3.5 w-3.5"})," View"]})}),(0,e.jsx)("button",{className:K("border-l border-border px-3 py-1.5 text-sm",k==="code"?"text-foreground":"text-muted-foreground"),onClick:n(()=>h("code"),"onClick"),children:(0,e.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(Lr,{className:"h-3.5 w-3.5"})," Code"]})})]}):null,I.editable&&m?.editable?F?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(v,{variant:"ghost",size:"sm",onClick:n(()=>T(!1),"onClick"),disabled:j,children:"Cancel"}),(0,e.jsxs)(v,{size:"sm",onClick:Q,disabled:j||!cs,children:[(0,e.jsx)(yt,{className:"mr-1.5 h-3.5 w-3.5"}),j?"Saving...":"Save"]})]}):(0,e.jsxs)(v,{variant:"ghost",size:"sm",onClick:n(()=>T(!0),"onClick"),children:[(0,e.jsx)(Tn,{className:"mr-1.5 h-3.5 w-3.5"})," Edit"]}):I.editable?null:(0,e.jsxs)(v,{type:"button",variant:"outline",size:"sm",onClick:Fe,title:I.editableReason??"Fork this skill to edit it.",children:[(0,e.jsx)(ys,{className:"mr-1.5 h-3.5 w-3.5"}),I.sourceType==="github"?"Make a copy":"Fork"]})]})]}),N?(0,e.jsx)(Ae,{variant:"detail"}):m?m.encoding==="base64"?(0,e.jsx)(ya,{file:m}):F&&m.editable?m.markdown?(0,e.jsx)(Vr,{value:y,onChange:q,bordered:!1,className:"min-h-(--sz-520px)"}):(0,e.jsx)(Lt,{value:y,onChange:n(p=>q(p.target.value),"onChange"),className:"min-h-(--sz-520px) rounded-none border-0 bg-transparent px-0 py-0 font-mono text-sm shadow-none focus-visible:ring-0"}):m.markdown&&k==="preview"?(0,e.jsx)(Tt,{softBreaks:!1,linkIssueReferences:!1,children:He}):(0,e.jsx)("pre",{className:K("overflow-x-auto whitespace-pre-wrap wrap-break-word border-0 bg-transparent p-0 font-mono text-sm text-foreground",At),children:(0,e.jsx)("code",{children:m.content})}):(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"Select a file to inspect."})]})]})}n(ee,"renderFilesBody");function qe(){return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("section",{children:[(0,e.jsx)("h2",{className:"mb-2 text-sm font-medium",children:"About"}),N?(0,e.jsx)(Ae,{variant:"detail"}):m?.markdown?(0,e.jsx)(Tt,{softBreaks:!1,linkIssueReferences:!1,children:He||I.description||"No overview yet."}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:I.description??"No overview yet."})]}),(0,e.jsxs)("section",{className:"grid min-w-0 gap-3 text-sm sm:grid-cols-2",children:[(0,e.jsxs)("div",{className:"min-w-0 border-b border-border py-2",children:[(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"Key"}),(0,e.jsx)("div",{className:"mt-1 truncate font-mono",children:I.key})]}),(0,e.jsxs)("div",{className:"min-w-0 border-b border-border py-2",children:[(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"Source"}),(0,e.jsx)("div",{className:"mt-1 min-w-0 [overflow-wrap:anywhere]",children:J??ae.label})]}),(0,e.jsxs)("div",{className:"min-w-0 border-b border-border py-2",children:[(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"Version"}),(0,e.jsx)("div",{className:"mt-1",children:_s(I.currentVersion??null)})]}),(0,e.jsxs)("div",{className:"min-w-0 border-b border-border py-2",children:[(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"Mode"}),(0,e.jsx)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:I.editable?"Editable":(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{children:"Read only"}),(0,e.jsxs)(v,{type:"button",variant:"outline",size:"xs",onClick:Fe,children:[(0,e.jsx)(ys,{className:"mr-1 h-3 w-3"}),I.sourceType==="github"?"Make a copy":"Fork"]})]})})]})]})]})}n(qe,"renderOverviewBody");function U(){return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:de?"Loading versions...":`${D.length} ${D.length===1?"version":"versions"}`}),(0,e.jsxs)(v,{type:"button",variant:"outline",size:"sm",onClick:n(()=>zs(),"onClick"),disabled:xe.length<2,children:[(0,e.jsx)(Ln,{className:"mr-1.5 h-3.5 w-3.5"})," Compare"]})]}),(0,e.jsx)("div",{className:"border-y border-border",children:de?(0,e.jsx)(Ae,{variant:"list"}):xe.length===0?(0,e.jsx)("div",{className:"py-6 text-sm text-muted-foreground",children:"No saved versions yet."}):xe.map(p=>(0,e.jsxs)("div",{className:"grid gap-2 border-b border-border px-0 py-3 text-sm last:border-b-0 sm:grid-cols-(--gtc-13)",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"font-medium",children:_s(p)}),(0,e.jsxs)("div",{className:"mt-1 text-xs text-muted-foreground",children:[la(p.createdAt)," · ",p.fileInventory.length," files"]})]}),(0,e.jsx)(v,{type:"button",variant:"ghost",size:"sm",onClick:n(()=>zs(p.id),"onClick"),children:"View diff"})]},p.id))}),(0,e.jsx)(dl,{open:Is,onOpenChange:Qe,versions:xe,leftVersionId:ke,rightVersionId:w,onLeftVersionChange:Oe,onRightVersionChange:ge})]})}n(U,"renderVersionsBody");function at(){const p=I.usedByAgents;return(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:[p.length," ",p.length===1?"agent":"agents"," attached",Ge?` · ${_s(Ge)}`:" · Latest"]}),(0,e.jsx)(Cn,{agents:te,attachedAgentIds:p.map(A=>A.id),versions:D,selectedVersionId:St(I),pending:ue,onSubmit:ce})]}),p.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border py-8 text-center text-sm text-muted-foreground",children:"No agents are using this skill yet. Use “Add to agent” to attach it."}):(0,e.jsx)("div",{className:"border-y border-border",children:p.map(A=>{const le=Fs.get(A.id);return(0,e.jsxs)("div",{className:"flex items-center gap-3 border-b border-border py-3 text-sm last:border-b-0",children:[(0,e.jsx)(mn,{agent:le,size:16,className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"truncate font-medium",children:A.name}),le?.paused?(0,e.jsxs)(oe,{variant:"outline",className:"[&>svg]:size-2.5 border-amber-500/30 bg-amber-500/10 px-1.5 text-(length:--text-nano) uppercase tracking-wide text-amber-500",children:[(0,e.jsx)(It,{className:"h-2.5 w-2.5","aria-hidden":"true"}),"Paused"]}):null]}),(0,e.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:A.adapterType})]}),(0,e.jsx)(be,{to:`/agents/${A.urlKey}/skills`,className:"shrink-0 text-xs text-muted-foreground no-underline hover:text-foreground",children:"View"})]},A.id)})})]})}n(at,"renderAgentsBody");const lt=r==="files"?ee():r==="versions"?U():r==="agents"?at():qe();return(0,e.jsxs)("div",{className:"min-h-(--sz-calc-30)",children:[(0,e.jsx)("div",{className:"border-b border-border px-4 py-5",children:(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-start gap-3",children:[(0,e.jsx)(Et,{card:{key:t.key,name:t.name,slug:t.slug,iconUrl:t.iconUrl,color:t.color},size:44}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,e.jsx)("h1",{className:"truncate text-2xl font-semibold",children:t.name}),(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:text-foreground","aria-label":`Installed from ${ae.label}`,children:(0,e.jsx)(us,{className:"h-4 w-4"})})}),(0,e.jsxs)(Ve,{children:["Installed from ",ae.label]})]})]}),t.authorName?(0,e.jsxs)("p",{className:"mt-0.5 text-sm text-muted-foreground",children:["by ",(0,e.jsx)("span",{className:"text-foreground",children:t.authorName})]}):null,xs?(0,e.jsxs)("div",{className:"mt-1 max-w-2xl",children:[(0,e.jsx)("p",{ref:Me,className:K("text-sm text-muted-foreground",!me&&"line-clamp-4"),children:xs}),De?(0,e.jsx)("button",{type:"button",onClick:n(()=>$(p=>!p),"onClick"),className:"mt-0.5 text-xs font-medium text-muted-foreground transition-colors hover:text-foreground",children:me?"Show less":"View all"}):null]}):null]})]}),(0,e.jsx)("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:t.categories.slice(0,4).map(p=>(0,e.jsx)(Wn,{label:p},p))})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-1",children:[(0,e.jsx)(v,{variant:"outline",size:"sm",asChild:!0,children:(0,e.jsxs)(be,{to:nt,children:[(0,e.jsx)(Dn,{className:"mr-1.5 h-3.5 w-3.5"}),"Open in Studio"]})}),(0,e.jsxs)("div",{className:"flex items-center overflow-hidden rounded-md border border-border",children:[(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs text-muted-foreground",children:[(0,e.jsx)(Bt,{className:"h-3.5 w-3.5","aria-hidden":"true"}),(0,e.jsx)("span",{className:"font-medium text-foreground",children:t.attachedAgentCount}),(0,e.jsx)("span",{className:"hidden sm:inline",children:t.attachedAgentCount===1?"install":"installs"})]})}),(0,e.jsx)(Ve,{children:"Agents in this company that currently have this skill installed."})]}),(0,e.jsxs)("button",{type:"button",onClick:Ie,disabled:rs,className:"inline-flex items-center gap-1.5 border-l border-border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground disabled:opacity-50",title:t.starredByCurrentActor?"Unstar this skill":"Star this skill",children:[(0,e.jsx)($n,{className:K("h-3.5 w-3.5",t.starredByCurrentActor&&"fill-current text-yellow-400")}),(0,e.jsx)("span",{className:"hidden sm:inline",children:t.starredByCurrentActor?"Starred":"Star"}),(0,e.jsx)("span",{className:"font-medium text-foreground",children:t.starCount})]}),(0,e.jsxs)("button",{type:"button",onClick:Fe,className:"inline-flex items-center gap-1.5 border-l border-border px-2.5 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent/40 hover:text-foreground",title:"Fork this skill",children:[(0,e.jsx)(ys,{className:"h-3.5 w-3.5"}),(0,e.jsx)("span",{className:"hidden sm:inline",children:I.sourceType==="github"?"Make a copy":"Fork"}),(0,e.jsx)("span",{className:"font-medium text-foreground",children:t.forkCount})]})]})]})]})}),(0,e.jsxs)("div",{className:"grid gap-6 px-4 py-4 xl:grid-cols-(--gtc-29)",children:[(0,e.jsxs)("main",{className:"min-w-0",children:[(0,e.jsx)(Rn,{value:r,onValueChange:n(p=>f(p),"onValueChange"),children:(0,e.jsx)(qn,{variant:"line",className:"mb-5 w-full max-w-full justify-start overflow-x-auto border-b border-border p-0 pb-1.5 [scrollbar-width:none]",children:il.map(p=>{const A=p.icon;return(0,e.jsxs)(Ps,{value:p.value,className:"px-3",children:[(0,e.jsx)(A,{className:"mr-1.5 h-3.5 w-3.5"}),p.label]},p.value)})})}),lt]}),(0,e.jsxs)("aside",{className:"min-w-0 space-y-6 border-t border-border pt-4 xl:border-l xl:border-t-0 xl:pl-5 xl:pt-0",children:[(0,e.jsx)(Ar,{skill:t}),(0,e.jsx)(cl,{folderPath:l??Vn(t.folderPath),onMove:ye}),(0,e.jsx)(ul,{categories:t.categories,pending:re,onSave:n(p=>ne({categories:p,sharingScope:t.sharingScope==="public_link"?"company":t.sharingScope}),"onSave")}),(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Agents"}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)(Cn,{agents:te,attachedAgentIds:t.usedByAgents.map(p=>p.id),versions:D,selectedVersionId:St(t),pending:ue,onSubmit:ce,fullWidth:!0}),t.usedByAgents.length===0?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"No agents attached yet."}):(0,e.jsxs)("div",{className:"space-y-0.5",children:[t.usedByAgents.slice(0,3).map(p=>{const A=Fs.get(p.id);return(0,e.jsxs)(be,{to:`/agents/${p.urlKey}/skills`,className:"flex items-center gap-2 rounded-md px-1.5 py-1 text-sm no-underline hover:bg-accent/40",children:[(0,e.jsx)(mn,{agent:A,size:16,className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-foreground",children:p.name}),A?.paused?(0,e.jsx)(It,{className:"h-3 w-3 shrink-0 text-amber-500","aria-label":"Paused"}):null]},p.id)}),t.usedByAgents.length>3?(0,e.jsxs)("p",{className:"px-1.5 pt-0.5 text-xs text-muted-foreground",children:["and ",t.usedByAgents.length-3," more"]}):null]})]})]}),(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Source"}),R?(0,e.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[(0,e.jsx)(Pt,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-foreground",children:Ls}),(0,e.jsxs)("a",{href:Qs??void 0,target:"_blank",rel:"noreferrer",title:Ke??void 0,className:"mt-0.5 flex max-w-full items-start gap-1 text-xs text-muted-foreground no-underline transition-colors [overflow-wrap:anywhere] hover:text-foreground",children:[(0,e.jsx)("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:Ke}),(0,e.jsx)(js,{className:"h-3 w-3 shrink-0","aria-hidden":"true"})]}),(0,e.jsxs)("div",{className:"mt-0.5 truncate font-mono text-(length:--text-micro) text-muted-foreground",title:R.commit,children:[R.ref,R.commit?` · ${R.commit.slice(0,7)}`:""]})]})]}):(0,e.jsxs)("div",{className:"flex items-start gap-2 text-sm",children:[(0,e.jsx)(us,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-foreground",children:ae.label}),J?hs?(0,e.jsxs)("a",{href:hs,target:"_blank",rel:"noreferrer",title:J??void 0,className:"mt-0.5 flex max-w-full items-start gap-1 text-xs text-muted-foreground no-underline transition-colors [overflow-wrap:anywhere] hover:text-foreground",children:[(0,e.jsx)("span",{className:"min-w-0 [overflow-wrap:anywhere]",children:J}),(0,e.jsx)(js,{className:"h-3 w-3 shrink-0","aria-hidden":"true"})]}):(0,e.jsx)("div",{className:"mt-0.5 min-w-0 text-xs text-muted-foreground [overflow-wrap:anywhere]",title:J??void 0,children:J}):(0,e.jsx)("div",{className:"mt-0.5 text-xs text-muted-foreground",children:ae.managedLabel})]})]})]}),t.sourceType==="github"?(0,e.jsxs)("section",{children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Updates"}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsxs)(_e,{children:[(0,e.jsx)(ze,{asChild:!0,children:(0,e.jsx)(Jr,{className:"h-3.5 w-3.5 shrink-0","aria-label":"Pinned source revision"})}),(0,e.jsx)(Ve,{children:"Pinned source revision"})]}),(0,e.jsx)("span",{className:"truncate font-mono text-foreground",children:rt??"untracked"})]}),(0,e.jsxs)(v,{variant:"outline",size:"sm",className:"w-full",onClick:Se,disabled:Ue||X,children:[(0,e.jsx)(Js,{className:K("mr-1.5 h-3.5 w-3.5",(Ue||X)&&"animate-spin")}),"Check for updates"]}),C?.supported&&C.hasUpdate?(0,e.jsxs)(v,{size:"sm",className:"w-full",onClick:pe,disabled:Ce,children:[(0,e.jsx)(Ct,{className:K("mr-1.5 h-3.5 w-3.5",Ce&&"animate-spin")}),"Install update",ms?` ${ms}`:""]}):C?.supported&&!C.hasUpdate&&!X?(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Up to date."}):null]})]}):null,(0,e.jsx)("section",{children:(0,e.jsxs)("button",{type:"button",onClick:n(()=>{Le(t.sharingScope==="public_link"?"company":t.sharingScope),O(t.categories.join(", ")),is(!0)},"onClick"),className:"flex w-full items-center gap-2 rounded-md px-3 py-2 text-left text-sm text-muted-foreground transition-colors hover:bg-accent/30 hover:text-foreground",children:[(0,e.jsx)(Gr,{className:"h-4 w-4 shrink-0"}),(0,e.jsx)("span",{className:"flex-1",children:"Settings"})]})})]})]}),cs?(0,e.jsxs)("div",{className:"fixed bottom-6 left-1/2 z-40 flex -translate-x-1/2 items-center gap-3 rounded-full border border-border bg-background/95 px-4 py-2 shadow-lg backdrop-blur",children:[(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"Unsaved changes"}),(0,e.jsx)(v,{variant:"ghost",size:"sm",onClick:n(()=>{q(ds),T(!1)},"onClick"),disabled:j,children:"Discard"}),(0,e.jsxs)(v,{size:"sm",onClick:Q,disabled:j,children:[(0,e.jsx)(yt,{className:"mr-1.5 h-3.5 w-3.5"}),j?"Saving…":"Save changes"]})]}):null,(0,e.jsx)(ws,{open:ls,onOpenChange:is,children:(0,e.jsxs)(ks,{className:"sm:max-w-md",children:[(0,e.jsxs)(vs,{children:[(0,e.jsx)(Ns,{children:"Skill settings"}),(0,e.jsxs)(Rs,{children:["Manage how ",t.name," is grouped and shared."]})]}),(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Categories"}),(0,e.jsx)($e,{value:os,onChange:n(p=>O(p.target.value),"onChange"),placeholder:"engineering, review, memory",className:"h-9",disabled:re}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Separate categories with commas. Leave empty to clear categories."})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Sharing"}),(0,e.jsxs)("select",{value:Z,onChange:n(p=>Le(p.target.value),"onChange"),disabled:re,className:"h-9 w-full rounded-md border border-border bg-background px-2 text-sm text-foreground",children:[(0,e.jsx)("option",{value:"company",children:"Company — visible inside this company"}),(0,e.jsx)("option",{value:"private",children:"Private — only visible in your library"})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Public link sharing is coming later."})]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[(0,e.jsx)(v,{type:"button",variant:"ghost",size:"sm",onClick:n(()=>{Le(I.sharingScope==="public_link"?"company":I.sharingScope),O(I.categories.join(", "))},"onClick"),disabled:!We||re,children:"Reset"}),(0,e.jsxs)(v,{type:"button",size:"sm",onClick:n(()=>ne({sharingScope:Z,categories:Vs}),"onClick"),disabled:!We||re,children:[(0,e.jsx)(yt,{className:"mr-1.5 h-3.5 w-3.5"}),re?"Saving…":"Save settings"]})]}),t.editable?(0,e.jsxs)("div",{className:"rounded-md border border-destructive/40 p-3",children:[(0,e.jsx)("div",{className:"text-xs font-semibold uppercase tracking-wide text-destructive",children:"Danger zone"}),(0,e.jsxs)("div",{className:"mt-2 flex items-center justify-between gap-3",children:[(0,e.jsx)("p",{className:"min-w-0 text-xs text-muted-foreground",children:"Remove this skill from the company library."}),(0,e.jsxs)(v,{variant:"destructive",size:"sm",className:"shrink-0",onClick:as,disabled:Ss,title:t.usedByAgents.length>0?"Detach this skill from all agents before removing it.":void 0,children:[(0,e.jsx)(na,{className:"mr-1.5 h-3.5 w-3.5"}),Ss?"Removing…":"Remove"]})]})]}):null]})]})})]})}n(ml,"SkillDetailPage");function Nl(){const{"*":t}=sa(),l=ea(),a=Hr(),[u,x]=ca(),{selectedCompanyId:r}=Or(),{setBreadcrumbs:f}=ia(),{pushToast:o}=ta(),m=ga(),N=Pr(),k=n((s,i,c,L)=>{N.capture(s,L)||o({tone:"error",title:i,body:s instanceof Error?W(s).body:c})},"reportSkillError"),[F,y]=(0,d.useState)(""),[h,T]=(0,d.useState)(""),[q,Q]=(0,d.useState)(!1),[j,D]=(0,d.useState)(null),[de,te]=(0,d.useState)({}),[ce,ue]=(0,d.useState)("preview"),[b,E]=(0,d.useState)(!1),[P,C]=(0,d.useState)(""),[X,Se]=(0,d.useState)(null),[Ue,pe]=(0,d.useState)(null),[Ce,Ie]=(0,d.useState)(null),[rs,Fe]=(0,d.useState)(!1),[ne,re]=(0,d.useState)(null),[ye,as]=(0,d.useState)(null),[Ss,Cs]=(0,d.useState)(""),[Is,Qe]=(0,d.useState)("all"),[ls,is]=(0,d.useState)(""),[Z,Le]=(0,d.useState)("SKILL.md"),[os,O]=(0,d.useState)(null),[Me,me]=(0,d.useState)({}),[$,De]=(0,d.useState)({open:!1,catalogSkill:null,conflict:null,defaultSlug:null,defaultForce:!1,defaultAction:"install",error:null}),[ve,xe]=(0,d.useState)(""),[ke,Oe]=(0,d.useState)("agents"),[w,ge]=(0,d.useState)(null),[zs,ds]=(0,d.useState)(!1),[cs,I]=(0,d.useState)(!1),[nt,ae]=(0,d.useState)(!1),[us,He]=(0,d.useState)(null),[rt,ms]=(0,d.useState)(null),[Ge,xs]=(0,d.useState)(null),[Vs,Us]=(0,d.useState)(!1),[Pe,We]=(0,d.useState)(null),[Fs,R]=(0,d.useState)(!1),[Ls,Ke]=(0,d.useState)([]),[Qs,J]=(0,d.useState)([]),hs=(0,d.useMemo)(()=>qa(t),[t]),ee=t==="studio/new",qe=ee?null:hs.skillToken,U=hs.filePath,at=u.get("view")==="catalog"?"catalog":"installed",lt=u.get("source")??"all";["all","company","bundled","optional","external"].includes(lt);const p=u.get("catalog"),A=u.get("tab"),le=Oa(A),Yn=["overview","files","versions","agents"].includes(A)?A:hs.hasExplicitFilePath||U!=="SKILL.md"?"files":"overview",Ye=u.get("category"),he=ee&&u.get("forkFrom")?.trim()||null,it=ee&&u.get("folderId")?.trim()||null,ot=!ee&&!qe&&!p,H=wa(u.get("folder"));function $t(s){x(i=>Ha(i,s))}n($t,"setDiscoveryTab");function ps(s){x(i=>{const c=new URLSearchParams(i);c.set("tab","installed"),c.delete("category");const L=Ma(s);return L?c.set("folder",L):c.delete("folder"),c})}n(ps,"setFolderSelection");function gs(s=[],i=null){J(s),He(null),ms(i),ae(!0)}n(gs,"openCreateFolder");function _t(s){x(i=>{const c=new URLSearchParams(i);return s==="overview"?c.delete("tab"):c.set("tab",s),c})}n(_t,"setDetailTab");function Xn(s){x(i=>{const c=new URLSearchParams(i);return s?c.set("category",s):c.delete("category"),c})}n(Xn,"setDiscoveryCategory");function Zn(s,i="SKILL.md"){x(c=>{const L=new URLSearchParams(c);return s?L.set("catalog",s):L.delete("catalog"),L}),Le(i)}n(Zn,"selectCatalog"),(0,d.useEffect)(()=>{ee&&ge(null)},[ee,he]),(0,d.useEffect)(()=>{u.has("view")&&x(s=>{const i=new URLSearchParams(s);return i.delete("view"),i},{replace:!0})},[u,x]);const Xe=ie({queryKey:g.companySkills.list(r??""),queryFn:n(()=>z.list(r),"queryFn"),enabled:!!r}),Ne=ie({queryKey:g.folders.list(r??"","skill"),queryFn:n(()=>fe.list(r,"skill"),"queryFn"),enabled:!!(r&&(ot&&le==="installed"||qe))}),Os=Es(Xe),se=Xe.data??[],Ds=(0,d.useMemo)(()=>Pa(qe,se),[qe,se]),S=Ds.skill?.id??null,Ze=ie({queryKey:g.companySkills.detail(r??"",S??""),queryFn:n(()=>z.detail(r,S),"queryFn"),enabled:!!(r&&S)}),Jn=Es(Ze),Ee=ie({queryKey:g.companySkills.file(r??"",S??"",U),queryFn:n(()=>z.file(r,S,U),"queryFn"),enabled:!!(r&&S&&U)}),zt=ie({queryKey:g.companySkills.versions(r??"",S??""),queryFn:n(()=>z.versions(r,S),"queryFn"),enabled:!!(r&&S)}),Je=ie({queryKey:g.companySkills.detail(r??"",he??""),queryFn:n(()=>z.detail(r,he),"queryFn"),enabled:!!(r&&ee&&he)}),er=(0,d.useMemo)(()=>{if(!ee)return Nt();const s=he?Je.data?ba(Je.data):Nt():Nt();return it?{...s,folderId:it}:s},[ee,Je.data,he,it]),sr=(0,d.useMemo)(()=>{if(H==="all"||H==="unfiled")return null;const s=ts(Ne.data).byId.get(H);return!s||s.path==="bundled"||s.path.startsWith("bundled/")||s.path==="projects"||s.path.startsWith("projects/")?null:s.id},[H,Ne.data]),Hs=ie({queryKey:g.companySkills.updateStatus(r??"",S??""),queryFn:n(()=>z.updateStatus(r,S),"queryFn"),enabled:!!(r&&S&&(Ze.data?.sourceType==="github"||X?.sourceType==="github")),staleTime:6e4});(0,d.useEffect)(()=>{if(!Ds.skill||!Ds.shouldRedirect||Xe.isLoading)return;const s=u.toString();l({pathname:$s(Ds.skill,se,U),search:s?`?${s}`:""},{replace:!0})},[se,l,Ds,u,U,Xe.isLoading]),(0,d.useEffect)(()=>{D(S)},[S]),(0,d.useEffect)(()=>{if(!S||U==="SKILL.md")return;const s=bn(U);s.length!==0&&te(i=>{const c=new Set(i[S]??[]);let L=!1;for(const M of s)c.has(M)||(c.add(M),L=!0);return L?{...i,[S]:c}:i})},[U,S]),(0,d.useEffect)(()=>{E(!1)},[S,U]),(0,d.useEffect)(()=>{Ze.data&&Se(Ze.data)},[Ze.data]),(0,d.useEffect)(()=>{Ee.data&&(pe(Ee.data),C(Ee.data.markdown?et(Ee.data.content).body:Ee.data.content))},[Ee.data]),(0,d.useEffect)(()=>{S||(Se(null),pe(null))},[S]);const B=Ze.data??X;(0,d.useEffect)(()=>{f([{label:"Skills",href:"/skills"},...ee?[{label:he?"Fork skill":"New skill"}]:B?Ga(B,Ne.data).slice(1):qe?[{label:"Detail"}]:[]])},[B,ee,qe,f,Ne.data,he]);const Gs=Ee.data??Ue;function fs(s,i){return $s(s,Ka(se,s),i)}n(fs,"routeForSkill");function dt(s,i){const c=se.find(L=>L.id===s)??(B?.id===s?B:null);return c?fs(c,i):$s(s,i)}n(dt,"routeForSkillId");function tr(){re(S),as(B??null),Fe(!0)}n(tr,"openDeleteDialog");function Ws(s){Fe(s),s||(re(null),as(null))}n(Ws,"closeDeleteDialog");const ct=Y({mutationFn:n(s=>z.importFromSource(r,s),"mutationFn"),onSuccess:n(async s=>{await a.invalidateQueries({queryKey:g.companySkills.list(r)}),s.imported[0]&&l(fs(s.imported[0])),o({tone:"success",title:"Skills imported",body:`${s.imported.length} skill${s.imported.length===1?"":"s"} added.`}),s.warnings[0]&&o({tone:"warn",title:"Import warnings",body:s.warnings[0]}),T("")},"onSuccess"),onError:n(s=>{k(s,"Skill import failed","Failed to import skill source.","Importing skills")},"onError")}),Vt=Y({mutationFn:n(s=>z.scanProjects(r,s?{projectIds:[s]}:{}),"mutationFn"),onMutate:n(s=>{Ie(s?"Refreshing project skills...":"Scanning project workspaces for skills...")},"onMutate"),onSuccess:n(async s=>{Ie("Refreshing skills list..."),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")})]);const i=Ra(s);Ie(i),o({tone:"success",title:"Project skill scan complete",body:i}),s.conflicts[0]?o({tone:"warn",title:"Skill conflicts found",body:s.conflicts[0].reason}):s.warnings[0]&&o({tone:"warn",title:"Scan warnings",body:s.warnings[0]})},"onSuccess"),onError:n(s=>{Ie(null),k(s,"Project skill scan failed","Failed to scan project workspaces.","Scanning projects for skills")},"onError")}),Ut=Y({mutationFn:n(s=>z.create(r,s),"mutationFn"),onSuccess:n(async s=>{await a.invalidateQueries({queryKey:g.companySkills.list(r)}),l(fs(s)),ge(null),o({tone:"success",title:s.forkedFromSkillId?"Skill fork created":"Skill created",body:`${s.name} is now editable in the Microvac workspace.`})},"onSuccess"),onError:n(s=>{const i=W(s).body;ge(i),k(s,"Skill creation failed","Failed to create skill.","Creating a skill")},"onError")}),Qt=Y({mutationFn:n(()=>z.updateFile(r,S,U,Gs?.markdown?Ea(Gs.content,P):P),"mutationFn"),onSuccess:n(async s=>{await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,S)}),a.invalidateQueries({queryKey:g.companySkills.file(r,S,U)})]),C(s.markdown?et(s.content).body:s.content),E(!1),o({tone:"success",title:"Skill saved",body:s.path})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Save failed",body:W(s).body})},"onError")}),Ot=Y({mutationFn:n(()=>{if(!B)throw new Error("Select a skill first.");return B.starredByCurrentActor?z.unstar(r,B.id):z.star(r,B.id)},"mutationFn"),onSuccess:n(async()=>{B&&await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,B.id)})])},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Star failed",body:W(s).body})},"onError")}),Ht=Y({mutationFn:n(s=>z.update(r,s.skillId,s.updates),"mutationFn"),onSuccess:n(async s=>{a.setQueryData(g.companySkills.detail(r,s.id),i=>i&&{...i,...s}),a.setQueryData(g.companySkills.list(r),i=>i?.map(c=>c.id===s.id?{...c,...s}:c)),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,s.id)})]),o({tone:"success",title:"Skill settings updated",body:Ya(s)})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Skill settings update failed",body:W(s).body})},"onError")}),Gt=Y({mutationFn:n(()=>z.installUpdate(r,S),"mutationFn"),onSuccess:n(async s=>{await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,S)}),a.invalidateQueries({queryKey:g.companySkills.updateStatus(r,S)}),a.invalidateQueries({queryKey:g.companySkills.file(r,S,U)})]),l(fs(s,U)),o({tone:"success",title:"Skill updated",body:s.sourceRef?`Pinned to ${tt(s.sourceRef)}`:s.name})},"onSuccess"),onError:n(s=>{k(s,"Update failed","Failed to install skill update.","Updating this skill")},"onError")}),Be=ie({queryKey:g.companySkills.catalog(),queryFn:n(()=>z.catalogList(),"queryFn"),enabled:!!r,staleTime:6e4}),ut=Es(Be),mt=[Os,ut].find(s=>s.kind==="error"),xt=ie({queryKey:g.companySkills.catalogDetail(p??""),queryFn:n(()=>z.catalogDetail(p),"queryFn"),enabled:!!(r&&p),staleTime:6e4}),nr=Es(xt),rr=ie({queryKey:g.companySkills.catalogFile(p??"",Z),queryFn:n(()=>z.catalogFile(p,Z),"queryFn"),enabled:!!(r&&p&&Z),staleTime:6e4}),Wt=ie({queryKey:g.agents.list(r??""),queryFn:n(()=>Xs.list(r),"queryFn"),enabled:!!r}),Bs=(0,d.useMemo)(()=>new Map(se.map(s=>[s.key,s])),[se]);(0,d.useMemo)(()=>{const s=new Set;for(const i of Be.data??[])s.add(i.category);return Array.from(s).sort()},[Be.data]);const Re=(0,d.useMemo)(()=>Xa(se,Be.data??[]),[se,Be.data]),ar=(0,d.useMemo)(()=>({all:Re.length,installed:Re.filter(s=>s.installed).length,catalog:Re.filter(s=>s.catalogRef!=null).length,bundled:Re.filter(s=>s.required).length}),[Re]),es=(0,d.useMemo)(()=>Za(Re,le),[Re,le]),lr=(0,d.useMemo)(()=>{const s=new Map;for(const i of es)for(const c of i.categories)s.set(c,(s.get(c)??0)+1);return Array.from(s.entries()).map(([i,c])=>({slug:i,count:c})).sort((i,c)=>c.count-i.count||i.slug.localeCompare(c.slug))},[es]),Yt=ve.trim().length>0,ht=(0,d.useMemo)(()=>{if(H==="all"||H==="unfiled")return null;const s=ts(Ne.data);return s.byId.has(H)?xn(s,H):null},[H,Ne.data]),ir=(0,d.useMemo)(()=>Ja(es.filter(s=>Ye&&!s.categories.includes(Ye)||le==="installed"&&!Yt&&(H==="unfiled"&&s.folderId||ht&&(!s.folderId||!ht.has(s.folderId)))?!1:wn(s,ve.trim())),ke,le!=="bundled"),[es,Ye,ve,Yt,ke,le,H,ht]),_=xt.data??(Be.data??[]).find(s=>s.id===p||s.key===p)??null;(0,d.useEffect)(()=>{O(_?.id??null)},[_?.id]),(0,d.useEffect)(()=>{if(!_||Z==="SKILL.md")return;const s=bn(Z);s.length!==0&&me(i=>{const c=new Set(i[_.id]??[]);let L=!1;for(const M of s)c.has(M)||(c.add(M),L=!0);return L?{...i,[_.id]:c}:i})},[Z,_]),(0,d.useMemo)(()=>{const s={all:se.length,company:0,bundled:0,optional:0,external:0};for(const i of se){const c=za(i);s[c]+=1}return s},[se]);const pt=Y({mutationFn:n(s=>z.installCatalog(r,{catalogSkillId:s.catalogSkillId,slug:s.slug,force:s.force}),"mutationFn"),onSuccess:n(async(s,i)=>{const c=s.action==="created"?i.agentIds:[];let L=0,M=0;for(const Te of c)try{await Xs.syncSkills(Te,[{key:s.skill.key,versionId:null}],"add",r??void 0),L+=1}catch{M+=1}await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,s.skill.id)})]),De(Te=>({...Te,open:!1,error:null})),o({tone:"success",title:s.action==="created"?"Skill installed":s.action==="updated"?"Skill updated":"Skill is up to date",body:s.action==="created"?L>0?`${s.skill.name} — enabled for ${L} agent${L===1?"":"s"}.`:`${s.skill.name} is in the library but not enabled for any agent yet. Use "Add to agent" to enable it.`:s.skill.name}),M>0&&o({tone:"warn",title:"Skill installed, but enabling failed",body:`Could not enable ${s.skill.name} for ${M} agent${M===1?"":"s"}. Use "Add to agent" on the skill page.`}),s.warnings[0]&&o({tone:"warn",title:"Install warnings",body:s.warnings[0]}),s.action==="created"&&l(fs(s.skill))},"onSuccess"),onError:n(s=>{const i=W(s).body;De(c=>({...c,error:i})),N.capture(s,"Installing this skill")},"onError")}),Xt=Y({mutationFn:n(s=>fe.create(r,{kind:"skill",parentId:rt,...s}),"mutationFn"),onSuccess:n(async s=>{if(ae(!1),He(null),ms(null),await a.invalidateQueries({queryKey:g.folders.list(r,"skill")}),Qs.length>0){const i=Qs;J([]);try{await Promise.all(i.map(c=>fe.moveItem(r,{kind:"skill",itemId:c,folderId:s.id}))),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")})])}catch(c){o({tone:"error",title:"Folder created, move failed",body:W(c).body});return}}else ps(s.id);o({tone:"success",title:"Folder created",body:s.name})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Folder save failed",body:W(s).body})},"onError")}),gt=Y({mutationFn:n(({folderId:s,payload:i})=>fe.update(r,s,i),"mutationFn"),onSuccess:n(async()=>{ae(!1),He(null),await a.invalidateQueries({queryKey:g.folders.list(r,"skill")})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Folder save failed",body:W(s).body})},"onError")}),Zt=Y({mutationFn:n(({folderId:s,parentId:i})=>fe.moveFolder(r,s,{parentId:i,position:0}),"mutationFn"),onSuccess:n(async s=>{await a.invalidateQueries({queryKey:g.folders.list(r,"skill")}),ps(s.id),o({tone:"success",title:"Folder moved",body:Vn(s.path)??s.name})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Folder move failed",body:W(s).body})},"onError")}),Jt=Y({mutationFn:n(s=>fe.delete(r,s),"mutationFn"),onSuccess:n(async(s,i)=>{H===i&&ps("all"),xs(null),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")})]),o({tone:"success",title:"Folder deleted",body:"Skills moved to Unfiled."})},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Folder delete failed",body:W(s).body})},"onError")}),en=Y({mutationFn:n(({itemId:s,folderId:i})=>fe.moveItem(r,{kind:"skill",itemId:s,folderId:i}),"mutationFn"),onSuccess:n(async()=>{await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")})])},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Move failed",body:W(s).body})},"onError")});async function or(s){const i=Ls;if(i.length!==0)try{await Promise.all(i.map(c=>fe.moveItem(r,{kind:"skill",itemId:c,folderId:s}))),Ke([]),R(!1),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")})]),o({tone:"success",title:"Skills moved",body:`${i.length} skill${i.length===1?"":"s"} filed.`})}catch(c){o({tone:"error",title:"Failed to move skills",body:W(c).body})}}n(or,"moveSelectedSkills");const Ys=Y({mutationFn:n(()=>fe.ensureMy(r),"mutationFn"),onSuccess:n(async s=>{await a.invalidateQueries({queryKey:g.folders.list(r,"skill")}),ps(s.id)},"onSuccess"),onError:n(s=>{o({tone:"error",title:"Couldn't open My Skills",body:W(s).body})},"onError")});async function dr(){const s=ts(Ne.data);if((H==="all"||H==="unfiled"?null:s.byId.get(H)??null)?.systemKey==="my"){try{const i=await Ys.mutateAsync();l(wt(null,i.id))}catch{return}return}l(wt(null,sr))}n(dr,"openNewSkill");async function cr(s){if((s?ts(Ne.data).byId.get(s):null)?.systemKey==="my"){try{gs([],(await Ys.mutateAsync()).id)}catch{return}return}gs([],s)}n(cr,"openCreateFolderIn");async function ur(s,i){if(i==="company"){Zt.mutate({folderId:s.id,parentId:null});return}try{const c=await Ys.mutateAsync();Zt.mutate({folderId:s.id,parentId:c.id})}catch{return}}n(ur,"moveFolderBetweenScopes");async function mr(s,i){try{const c=await fe.create(r,{kind:"skill",parentId:s,name:i,color:null});return await a.invalidateQueries({queryKey:g.folders.list(r,"skill")}),c.id}catch(c){return o({tone:"error",title:"Folder create failed",body:W(c).body}),null}}n(mr,"createFolderInline");async function xr(s){if(!Pe)return;const i=Pe.skillIds;try{await Promise.all(i.map(c=>fe.moveItem(r,{kind:"skill",itemId:c,folderId:s}))),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.folders.list(r,"skill")}),...i.map(c=>a.invalidateQueries({queryKey:g.companySkills.detail(r,c)}))]),We(null),Ke([]),R(!1),o({tone:"success",title:i.length===1?"Skill moved":"Skills moved",body:s?`Filed under ${we?.folders.find(c=>c.id===s)?.name??"folder"}.`:"Moved to Unfiled."})}catch(c){o({tone:"error",title:"Move failed",body:W(c).body})}}n(xr,"performDialogMove");const sn=(0,d.useMemo)(()=>(Wt.data??[]).map(s=>{const i=m(s.adapterType),c=[],L=new Set((B?.usedByAgents??[]).map(M=>M.id));return{id:s.id,name:s.name,adapterType:s.adapterType,supportsSkills:!!i.supportsSkills,required:!1,icon:s.icon,paused:s.status==="paused"||s.pausedAt!=null,attached:L.has(s.id),requiredKeys:c}}),[Wt.data,m,B]),tn=Y({mutationFn:n(async s=>Xs.syncSkills(s.agentId,s.desiredSkills,"replace",r??void 0),"mutationFn"),onSuccess:n(async()=>{await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),a.invalidateQueries({queryKey:g.companySkills.detail(r,S??"")}),a.invalidateQueries({queryKey:g.companySkills.versions(r,S??"")})])},"onSuccess")});async function hr(s,i=null){if(!B)return;const c=B.key,L=new Set(s),M=(B.usedByAgents??[]).map(G=>G.id),Te=new Set(M),bt=new Map((B.usedByAgents??[]).map(G=>[G.id,G.versionId??null])),kr=s.filter(G=>!Te.has(G)),Nr=M.filter(G=>!L.has(G)),wr=s.filter(G=>Te.has(G)&&(bt.get(G)??null)!==i),on=new Set([...kr,...Nr,...wr]);if(on.size!==0)try{for(const G of on){const dn=await Xs.skills(G,r??void 0),cn=(dn.desiredSkillEntries??dn.desiredSkills.map(jt=>({key:jt,versionId:null}))).filter(jt=>jt.key!==c);L.has(G)&&cn.push({key:c,versionId:i}),await tn.mutateAsync({agentId:G,desiredSkills:cn})}o({tone:"success",title:"Agents updated",body:`${s.length} agent(s) attached.`})}catch(G){o({tone:"error",title:"Update failed",body:W(G).body})}}n(hr,"handleAttachSubmit");function nn(s){const i=Bs.get(s.key)??null,c=i?.originHash??null,L=i?c&&c!==s.contentHash?"update":i.sourceType!=="catalog"?"replace":"update":"install";De({open:!0,catalogSkill:s,conflict:i,defaultSlug:i?.slug??s.slug,defaultForce:L==="replace",defaultAction:L,error:null})}n(nn,"openInstallDialog");const Ts=Y({mutationFn:n(()=>z.delete(r,ne),"mutationFn"),onSuccess:n(async s=>{Ws(!1),Se(null),pe(null),await Promise.all([a.invalidateQueries({queryKey:g.companySkills.list(r)}),...ne?[a.invalidateQueries({queryKey:g.companySkills.detail(r,ne)}),a.invalidateQueries({queryKey:g.companySkills.updateStatus(r,ne)})]:[],...ne?[a.invalidateQueries({queryKey:g.companySkills.file(r,ne,U)})]:[]]),await a.refetchQueries({queryKey:g.companySkills.list(r),type:"active"}),l("/skills",{replace:!0}),o({tone:"success",title:"Skill removed",body:`${s.name} was removed from the company skill library.`})},"onSuccess"),onError:n(s=>{k(s,"Remove failed","Failed to remove skill.","Removing this skill")},"onError")}),we=Ne.data??null,V=ot&&le==="installed",ft=(0,d.useMemo)(()=>{if(!we||le!=="installed")return we;const s=es.filter(M=>Ye&&!M.categories.includes(Ye)?!1:wn(M,ve.trim())),i=new Map;let c=0;for(const M of s)M.folderId?i.set(M.folderId,(i.get(M.folderId)??0)+1):c+=1;const L=ts(we);return{...we,allCount:s.length,unfiledCount:c,folders:we.folders.map(M=>{let Te=0;for(const bt of xn(L,M.id))Te+=i.get(bt)??0;return{...M,itemCount:Te}})}},[we,le,es,Ye,ve]),pr=(0,d.useMemo)(()=>va(ts(we),B?.folderId),[we,B?.folderId]);if(!r)return(0,e.jsx)(ns,{icon:je,message:"Select a company to manage skills."});function gr(){const s=h.trim();if(s.length===0){Q(!0);return}ct.mutate(s)}n(gr,"handleAddSkillSource");function fr(s){if(s.skillId){l(dt(s.skillId));return}s.catalogRef&&Zn(s.catalogRef)}n(fr,"openDiscoveryCard");const rn=new URLSearchParams(u);rn.delete("catalog");const an=rn.toString(),br=an?`/skills?${an}`:"/skills",jr=B?(Be.data??[]).find(s=>s.key===B.key)?.source??null:null,ln=Je.data?fs(Je.data):"/skills",yr=he?"Fork skill":"Create a new skill",vr=he?"Review the fork metadata and create an editable company copy.":"Create an editable company skill in the Microvac workspace.";return(0,e.jsxs)(e.Fragment,{children:[N.denial?(0,e.jsx)("div",{className:"px-4 pt-4",children:(0,e.jsx)(Dr,{denial:N.denial,onDismiss:N.reset})}):null,(0,e.jsx)(ws,{open:rs,onOpenChange:Ws,children:(0,e.jsxs)(ks,{className:"sm:max-w-md",children:[(0,e.jsxs)(vs,{children:[(0,e.jsx)(Ns,{children:"Remove skill"}),(0,e.jsx)(Rs,{children:"Remove this skill from the company library. If any agents still use it, removal will be blocked until it is detached."})]}),(0,e.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,e.jsx)("p",{children:ye?`You are about to remove ${ye.name}.`:"You are about to remove this skill."}),ye?.usedByAgents?.length?(0,e.jsxs)("div",{className:"rounded-md border border-border px-3 py-3 text-muted-foreground",children:["Currently used by ",ye.usedByAgents.map(s=>s.name).join(", "),"."]}):null,(ye?.usedByAgents.length??0)>0?(0,e.jsx)("p",{className:"text-muted-foreground",children:"Detach this skill from all agents to enable removal."}):null]}),(0,e.jsx)(Ft,{children:(ye?.usedByAgents.length??0)>0?(0,e.jsx)(v,{variant:"ghost",onClick:n(()=>Ws(!1),"onClick"),children:"Close"}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(v,{variant:"ghost",onClick:n(()=>Ws(!1),"onClick"),disabled:Ts.isPending,children:"Cancel"}),(0,e.jsx)(v,{variant:"destructive",onClick:n(()=>Ts.mutate(),"onClick"),disabled:Ts.isPending||!ne,children:Ts.isPending?"Removing...":"Remove skill"})]})})]})}),(0,e.jsx)(ws,{open:q,onOpenChange:Q,children:(0,e.jsxs)(ks,{className:"sm:max-w-md",children:[(0,e.jsxs)(vs,{children:[(0,e.jsx)(Ns,{children:"Add a skill source"}),(0,e.jsx)(Rs,{children:"Paste a local path, GitHub URL, or `skills.sh` command into the field first."})]}),(0,e.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,e.jsxs)("a",{href:"https://skills.sh",target:"_blank",rel:"noreferrer",className:"flex items-start justify-between rounded-md border border-border px-3 py-3 text-foreground no-underline transition-colors hover:bg-accent/40",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block font-medium",children:"Browse skills.sh"}),(0,e.jsx)("span",{className:"mt-1 block text-muted-foreground",children:"Find install commands and paste one here."})]}),(0,e.jsx)(js,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),(0,e.jsxs)("a",{href:"https://github.com/search?q=SKILL.md&type=code",target:"_blank",rel:"noreferrer",className:"flex items-start justify-between rounded-md border border-border px-3 py-3 text-foreground no-underline transition-colors hover:bg-accent/40",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block font-medium",children:"Search GitHub"}),(0,e.jsx)("span",{className:"mt-1 block text-muted-foreground",children:"Look for repositories with `SKILL.md`, then paste the repo URL here."})]}),(0,e.jsx)(js,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]})]}),(0,e.jsx)(Ft,{showCloseButton:!0})]})}),(0,e.jsx)(ll,{open:$.open,onOpenChange:n(s=>De(i=>({...i,open:s,error:s?i.error:null})),"onOpenChange"),skill:$.catalogSkill,packageName:$.catalogSkill?.packageName??$.conflict?.packageName??null,packageVersion:$.catalogSkill?.packageVersion??$.conflict?.packageVersion??null,conflict:$.conflict,defaultSlug:$.defaultSlug,defaultForce:$.defaultForce,defaultAction:$.defaultAction,agents:sn,isPending:pt.isPending,error:$.error,onConfirm:n(({slug:s,force:i,agentIds:c})=>{$.catalogSkill&&pt.mutate({catalogSkillId:$.catalogSkill.id,slug:s,force:i,agentIds:c})},"onConfirm")}),(0,e.jsx)(ws,{open:zs,onOpenChange:ds,children:(0,e.jsxs)(ks,{className:"sm:max-w-md",children:[(0,e.jsxs)(vs,{children:[(0,e.jsx)(Ns,{children:"Import a skill"}),(0,e.jsx)(Rs,{children:"Paste a local path, GitHub URL, or `skills.sh` command to import a skill into this company."})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 border-b border-border pb-2",children:[(0,e.jsx)($e,{value:h,onChange:n(s=>T(s.target.value),"onChange"),placeholder:"Paste path, GitHub URL, or skills.sh command",className:"h-9 rounded-none border-0 px-0 shadow-none focus-visible:ring-0"}),(0,e.jsx)(v,{size:"sm",onClick:gr,disabled:ct.isPending,children:ct.isPending?(0,e.jsx)(Js,{className:"h-4 w-4 animate-spin"}):"Import"})]}),(0,e.jsxs)("a",{href:"https://skills.sh",target:"_blank",rel:"noreferrer",className:"flex items-start justify-between rounded-md border border-border px-3 py-3 text-sm text-foreground no-underline transition-colors hover:bg-accent/40",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block font-medium",children:"Browse skills.sh"}),(0,e.jsx)("span",{className:"mt-1 block text-muted-foreground",children:"Find install commands and paste one here."})]}),(0,e.jsx)(js,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),(0,e.jsxs)("a",{href:"https://github.com/search?q=SKILL.md&type=code",target:"_blank",rel:"noreferrer",className:"flex items-start justify-between rounded-md border border-border px-3 py-3 text-sm text-foreground no-underline transition-colors hover:bg-accent/40",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)("span",{className:"block font-medium",children:"Search GitHub"}),(0,e.jsx)("span",{className:"mt-1 block text-muted-foreground",children:"Look for repositories with `SKILL.md`, then paste the repo URL."})]}),(0,e.jsx)(js,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]})]})]})}),r?(0,e.jsx)(Tr,{open:cs,onOpenChange:I,companyId:r,onImportFromPath:n(()=>{I(!1),ds(!0)},"onImportFromPath")}):null,(0,e.jsx)(ka,{open:nt,kind:"skill",folder:us,pending:Xt.isPending||gt.isPending,onOpenChange:n(s=>{ae(s),s||ms(null)},"onOpenChange"),onSubmit:n(s=>{us?gt.mutate({folderId:us.id,payload:s}):Xt.mutate(s)},"onSubmit")}),(0,e.jsx)(Ba,{open:Ge!==null,folder:Ge,itemLabelPlural:"skills",pending:Jt.isPending,onOpenChange:n(s=>{s||xs(null)},"onOpenChange"),onConfirm:n(()=>{Ge&&Jt.mutate(Ge.id)},"onConfirm")}),(0,e.jsx)(Na,{open:Vs,onOpenChange:Us,result:ft,selection:H,allLabel:"All skills",itemLabelPlural:"Skills",onSelect:ps,onCreate:n(()=>gs(),"onCreate")}),(0,e.jsx)(Mr,{open:Pe!==null,onOpenChange:n(s=>{s||We(null)},"onOpenChange"),result:ft,title:Pe?.title??"Move to folder",subtitle:Pe?.subtitle??null,currentFolderId:Pe?.currentFolderId??null,onMove:n(s=>{xr(s)},"onMove"),onCreateFolder:mr}),ee?(0,e.jsxs)("div",{className:"min-h-(--sz-calc-30)",children:[(0,e.jsxs)("div",{className:"border-b border-border px-4 py-5",children:[(0,e.jsxs)(be,{to:ln,className:"mb-3 inline-flex items-center gap-1.5 text-sm text-muted-foreground no-underline transition-colors hover:text-foreground",children:[(0,e.jsx)(un,{className:"h-4 w-4"}),"Back"]}),(0,e.jsx)("h1",{className:"text-2xl font-semibold",children:yr}),(0,e.jsx)("p",{className:"mt-1 max-w-2xl text-sm text-muted-foreground",children:vr})]}),(0,e.jsx)("div",{className:"px-4 py-4",children:(0,e.jsx)("div",{className:"max-w-3xl",children:he&&Je.isLoading?(0,e.jsx)(Ae,{variant:"detail"}):he&&!Je.data?(0,e.jsx)(ns,{icon:je,message:"Fork source skill not found."}):(0,e.jsx)(nl,{initialDraft:er,onCreate:n(s=>Ut.mutate(s),"onCreate"),isPending:Ut.isPending,error:w,onCancel:n(()=>l(ln),"onCancel")})})})]}):ot?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Br,{companyId:r}),(0,e.jsx)(tl,{tab:le,tabCounts:ar,onTabChange:$t,categories:lr,categoryTotal:es.length,activeCategory:Ye,onCategoryChange:Xn,search:ve,onSearchChange:xe,sort:ke,onSortChange:Oe,cards:ir,onOpenCard:fr,loading:Xe.isLoading||Be.isLoading||Os.kind==="reconnecting"||ut.kind==="reconnecting",error:mt?.error,onRetry:mt?.retry,retrying:mt?.isFetching,totalCount:Re.length,onCreate:n(()=>{dr()},"onCreate"),onImport:n(()=>ds(!0),"onImport"),onImportFromProject:n(()=>I(!0),"onImportFromProject"),onBrowseCatalog:n(()=>$t("catalog"),"onBrowseCatalog"),onScan:n(s=>Vt.mutate(s),"onScan"),scanPending:Vt.isPending,scanStatus:Ce,folderResult:V?ft:null,folderSelection:H,foldersLoading:Ne.isLoading,selectMode:V&&Fs,selectedSkillIds:Ls,onFolderSelect:V?ps:void 0,onOpenMobileFolders:V?()=>Us(!0):void 0,onCreateFolder:V?()=>gs():void 0,onCreateFolderIn:V?s=>{cr(s)}:void 0,onEnsureMyFolder:V?()=>Ys.mutate():void 0,onOpenMoveCard:V?s=>{s.skillId&&We({skillIds:[s.skillId],title:`Move "${s.name}"`,subtitle:"Choose a destination folder.",currentFolderId:s.folderId??null})}:void 0,onRenameFolder:V?(s,i)=>gt.mutate({folderId:s.id,payload:{name:i}}):void 0,onEditFolder:V?s=>{He(s),ae(!0)}:void 0,onMoveFolder:V?(s,i)=>{ur(s,i)}:void 0,onDeleteFolder:V?xs:void 0,onToggleSelectMode:V?()=>{R(s=>!s),Fs&&Ke([])}:void 0,onSelectCard:V?(s,i)=>{s.skillId&&Ke(c=>i?Array.from(new Set([...c,s.skillId])):c.filter(L=>L!==s.skillId))}:void 0,onMoveCard:V?(s,i)=>{if(!s.skillId)return;const c=s.skillId,L=s.folderId??null;en.mutate({itemId:c,folderId:i}),o({tone:"success",title:"Skill moved",body:i?`Moved "${s.name}" to ${we?.folders.find(M=>M.id===i)?.name??"folder"}.`:`Moved "${s.name}" to Unfiled.`,action:{label:"Undo",onClick:n(()=>en.mutate({itemId:c,folderId:L}),"onClick")}})}:void 0,onCreateFolderAndMoveCard:V?s=>{s.skillId&&gs([s.skillId])}:void 0,onMoveSelected:V?s=>{or(s)}:void 0,onCreateFolderAndMoveSelected:V?()=>gs(Ls):void 0,onClearSelected:V?()=>Ke([]):void 0,folderNudgeStorageKey:V?`paperclip:skills-folder-nudge:${r??"none"}`:void 0})]}):at==="installed"&&S?(0,e.jsx)(ml,{detail:B,folderDisplayPath:pr,catalogSource:jr,routeSkills:se,loading:Xe.isLoading||Ze.isLoading||Os.kind==="reconnecting"||Jn.kind==="reconnecting",activeTab:Yn,onTabChange:_t,selectedPath:U,file:Gs,fileLoading:Ee.isLoading&&!Gs,viewMode:ce,editMode:b,draft:P,setViewMode:ue,setEditMode:E,setDraft:C,onSave:n(()=>Qt.mutate(),"onSave"),savePending:Qt.isPending,versions:zt.data??[],versionsLoading:zt.isLoading,attachAgents:sn,onSubmitAttach:hr,attachPending:tn.isPending,expandedDirs:de[S]??new Set,onToggleDir:n(s=>{te(i=>{const c=new Set(i[S]??[]);return c.has(s)?c.delete(s):c.add(s),{...i,[S]:c}})},"onToggleDir"),onSelectPath:n(s=>{_t("files"),l(dt(S,s))},"onSelectPath"),updateStatus:Hs.data,updateStatusLoading:Hs.isLoading,onCheckUpdates:n(()=>{Hs.refetch()},"onCheckUpdates"),checkUpdatesPending:Hs.isFetching,onInstallUpdate:n(()=>Gt.mutate(),"onInstallUpdate"),installUpdatePending:Gt.isPending,onToggleStar:n(()=>Ot.mutate(),"onToggleStar"),starPending:Ot.isPending,onFork:n(()=>B&&l(wt(B.id)),"onFork"),onUpdateSettings:n(s=>B&&Ht.mutate({skillId:B.id,updates:s}),"onUpdateSettings"),onMoveToFolder:B?()=>We({skillIds:[B.id],title:`Move "${B.name}"`,subtitle:"Choose a destination folder.",currentFolderId:B.folderId??null}):void 0,updateSettingsPending:Ht.isPending,onDelete:tr,deletePending:Ts.isPending,studioHref:Un(S)}):p?(0,e.jsxs)("div",{className:"min-h-(--sz-calc-30)",children:[(0,e.jsx)("div",{className:"border-b border-border px-4 py-3",children:(0,e.jsxs)(be,{to:br,className:"inline-flex items-center gap-1.5 text-sm text-muted-foreground no-underline transition-colors hover:text-foreground",children:[(0,e.jsx)(un,{className:"h-4 w-4"}),"Back to store"]})}),Be.isLoading||xt.isLoading||ut.kind==="reconnecting"||nr.kind==="reconnecting"?(0,e.jsx)(Ae,{variant:"detail"}):_?(0,e.jsxs)("div",{className:"grid gap-0 xl:grid-cols-(--gtc-30)",children:[(0,e.jsxs)("aside",{className:"border-b border-border px-3 py-4 xl:border-b-0 xl:border-r",children:[(0,e.jsx)("div",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-muted-foreground",children:"Files"}),(0,e.jsx)(Rt,{nodes:On(_.files.map(s=>({path:s.path,kind:s.kind}))),skillId:_.id,selectedPath:Z,expandedDirs:Me[_.id]??new Set,onToggleDir:n(s=>me(i=>{const c=new Set(i[_.id]??[]);return c.has(s)?c.delete(s):c.add(s),{...i,[_.id]:c}}),"onToggleDir"),onSelectPath:n(s=>Le(s),"onSelectPath"),fileHref:n(()=>`/skills?catalog=${encodeURIComponent(p)}`,"fileHref")})]}),(0,e.jsx)("div",{className:"min-w-0",children:(0,e.jsx)(rl,{skill:_,packageName:_.packageName??Bs.get(_.key)?.packageName??null,packageVersion:_.packageVersion??Bs.get(_.key)?.packageVersion??null,installedSkill:Bs.get(_.key)??null,installedSkillId:Bs.get(_.key)?.id??null,fileQuery:rr,selectedPath:Z,onInstall:n(()=>nn(_),"onInstall"),onUpdate:n(()=>nn(_),"onUpdate"),onOpenInstalled:n(s=>l(dt(s)),"onOpenInstalled"),loadingPrimaryAction:pt.isPending})})]}):(0,e.jsx)(ns,{icon:je,message:"Catalog skill not found."})]}):(0,e.jsx)("div",{className:"min-h-(--sz-calc-30)",children:Xe.isLoading||Os.kind==="reconnecting"?(0,e.jsx)(Ae,{variant:"detail"}):(0,e.jsx)(ns,{icon:je,message:"Skill not found."})})]})}n(Nl,"CompanySkills");export{Nl as CompanySkills};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var z=Object.defineProperty;var s=(a,n)=>z(a,"name",{value:n,configurable:!0});import{a as B,n as L}from"./rolldown-runtime-DhZMWcEn.js";import{$A as G,Bd as N,Cl as R,GS as f,ME as Y,NE as S,Yu as J,__ as U,as as V,bE as W,dy as X,fy as Z,gD as b,gl as ee,ly as te,ml as ne,my as ae,nj as se,pE as oe,pm as q,rb as re,sy as ie,uy as le,xE as de}from"./index-Bt31d8ga.js";var ye=L({ConfigureBuiltInAgentModal:s(()=>ge,"ConfigureBuiltInAgentModal")}),d=B(se(),1),t=B(G(),1);function ue(a){return!["process","command","http","openclaw_gateway","hermes_gateway"].includes(a)}s(ue,"isModelBasedAdapter");function ce(a){return a.definition.defaultAdapterType??a.definition.allowedAdapterTypes?.[0]??"codex_local"}s(ce,"defaultAdapterType");function pe(a){const n=a.trim();if(!n)return;const l=Math.round(Number(n)*100);return Number.isFinite(l)&&l>=0?l:void 0}s(pe,"parseBudgetMonthlyCents");function ge({companyId:a,state:n,open:l,onOpenChange:h,onConfigured:D}){const y=Y(),{definition:r}=n,[i,E]=(0,d.useState)(()=>n.agent&&["codex_local","claude_local","opencode_local","pi_local"].includes(b(n.agent.adapterType,n.agent.adapterConfig))?b(n.agent.adapterType,n.agent.adapterConfig):n.agent?.adapterType??ce(n)),[m,j]=(0,d.useState)(()=>{const e=n.agent?.adapterConfig,o=typeof e=="object"&&e!==null?e.model:null;if(typeof o=="string")return o;const g=n.definition.defaultAdapterConfig?.model;return typeof g=="string"?g:""}),[P,F]=(0,d.useState)(!1),[x,I]=(0,d.useState)(()=>{const e=r.defaultBudgetMonthlyCents??0;return e>0?String(e/100):""}),[M,w]=(0,d.useState)(null),K=(0,d.useMemo)(()=>{const e=new Set(r.allowedAdapterTypes??[]);return new Set(R().map(o=>o.value).filter(o=>e.size>0&&!e.has(o)))},[r.allowedAdapterTypes]),u=ue(i),{data:O}=de({queryKey:f.agents.adapterModels(a,i,null),queryFn:s(()=>re.adapterModels(a,i,{}),"queryFn"),enabled:l&&!!a&&u}),v=O??[],_=u,c=m.trim(),A=!c||v.length===0||v.some(e=>e.id===c),T=A?null:`Model “${c}” is not available for ${i}. Choose a known model.`,C=pe(x),$=(!x.trim()||C!==void 0)&&A&&(u?!_||c.length>0:!0),k=u?`Configure & enable ${r.displayName}`:`Provision ${r.displayName}`,p=W({mutationFn:s(async()=>{const e={};m.trim()&&(e.model=m.trim());const o=n.agent,g=o&&b(o.adapterType,o.adapterConfig)===i,Q=typeof o?.adapterConfig.model=="string"?o.adapterConfig.model.trim():"",H=(n.status==="ready"||n.status==="paused")&&g&&c===Q?{}:g?{adapterType:o.adapterType,adapterConfig:{...o.adapterConfig,...e}}:{adapterType:i,adapterConfig:e};return await V.provision(a,r.key,{...H,...C!==void 0?{budgetMonthlyCents:C}:{}})},"mutationFn"),onSuccess:s(e=>{y.invalidateQueries({queryKey:f.builtInAgents.list(a)}),y.invalidateQueries({queryKey:f.agents.list(a)}),e.agentId&&y.invalidateQueries({queryKey:f.agents.detail(e.agentId)}),D?.(e),h(!1)},"onSuccess"),onError:s(e=>{w(e instanceof oe?e.message:"Failed to configure the built-in agent.")},"onError")});return(0,t.jsx)(ie,{open:l,onOpenChange:s(e=>p.isPending?void 0:h(e),"onOpenChange"),children:(0,t.jsxs)(te,{className:"sm:max-w-lg",children:[(0,t.jsxs)(Z,{children:[(0,t.jsxs)(ae,{children:["Set up the ",r.displayName]}),(0,t.jsx)(le,{children:r.shortPurpose})]}),(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)(q,{tone:"info",compact:!0,children:["Creates ",(0,t.jsx)("strong",{children:r.displayName})," in your roster, badged"," ",(0,t.jsx)("strong",{children:"Built-in"}),". Organizations that require hire approval will queue this for the board."]}),(0,t.jsx)(N,{label:"Harness",children:(0,t.jsx)(ne,{value:i,onChange:s(e=>{E(e),j("")},"onChange"),disabledTypes:K})}),_&&(0,t.jsx)(ee,{models:v,value:m,onChange:j,open:P,onOpenChange:F,allowDefault:i!=="opencode_local",required:!0,groupByProvider:!1,preserveOrder:J(i),creatable:!0}),T&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:T}),!u&&(0,t.jsx)(q,{tone:"warning",compact:!0,children:"This adapter needs command or endpoint fields before it can run. Provision the built-in row now, then finish those fields from the full agent configuration."}),(0,t.jsx)(N,{label:"Monthly budget (optional)",hint:"Leave blank for no cap.",children:(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"$"}),(0,t.jsx)(U,{type:"number",min:"0",step:"1",inputMode:"decimal",placeholder:"0",value:x,onChange:s(e=>I(e.target.value),"onChange"),className:"w-32"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"/ month"})]})}),M&&(0,t.jsx)("p",{className:"text-sm text-destructive",role:"alert",children:M})]}),(0,t.jsxs)(X,{children:[(0,t.jsx)(S,{variant:"ghost",onClick:s(()=>h(!1),"onClick"),disabled:p.isPending,children:"Not now"}),(0,t.jsx)(S,{onClick:s(()=>{w(null),p.mutate()},"onClick"),disabled:!$||p.isPending,children:p.isPending?"Configuring…":k})]})]})})}s(ge,"ConfigureBuiltInAgentModal");export{ye as n,ge as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var $=Object.defineProperty;var n=(e,t)=>$(e,"name",{value:t,configurable:!0});import{a as k}from"./rolldown-runtime-DhZMWcEn.js";import{$A as L,$S as M,Cw as P,Ew as G,GS as O,IT as q,Jp as C,ME as B,NE as S,ZT as R,__ as K,aC as U,bE as H,cT as Q,dy as F,fy as z,hE as W,ly as Y,my as J,nj as V,oA as Z,qp as X,rO as j,sv as N,sy as ee,uy as te,xE as ne,zE as I}from"./index-Bt31d8ga.js";var oe=[{key:"overview",label:"Overview",icon:P},{key:"apps",label:"Apps & tools",icon:q},{key:"tokens",label:"Tokens",icon:G},{key:"activity",label:"Activity",icon:R},{key:"advanced",label:"Advanced",icon:U}];function ue(e,t){return`/apps/gateways/${e}/${t}`}n(ue,"gatewayTabHref");function de(e){return oe.some(t=>t.key===e)}n(de,"isGatewayTabKey");var b=k(V(),1);function _(e){if(!e)return null;const t=e instanceof Date?e:new Date(e);return Number.isNaN(t.getTime())?null:t}n(_,"toDate");function pe(e){return`${e.tokenPrefix}•••`}n(pe,"maskedTokenLabel");function D(e,t=Date.now()){if(e.revokedAt)return"revoked";const o=_(e.expiresAt),s=o?o.getTime()-t:1/0;return s<=0?"expired":e.pendingReveal?"pending":o&&s<=12096e5?"expiring":"active"}n(D,"tokenStatus");var fe={pending:"Not revealed",active:"Active",expiring:"Expiring",expired:"Expired",revoked:"Revoked"};function xe(e,t=Date.now()){return e.tokens.filter(o=>{const s=D(o,t);return s==="active"||s==="expiring"}).length}n(xe,"activeTokenCount");function ye(e,t=Date.now()){return e.tokens.filter(o=>D(o,t)==="expiring").length}n(ye,"expiringTokenCount");function me(e){return e.tokens.reduce((t,o)=>{const s=_(o.lastUsedAt);return s&&(!t||s.getTime()>t.getTime())?s:t},null)}n(me,"latestTokenActivity");function g(e){return e?e.length>12?`${e.slice(0,8)}…`:e:null}n(g,"shortId");function ge(e,t,o){return e.contextScopeType!=="none"&&e.contextScopeId?e.contextScopeType==="project"?`Project · ${t.get(e.contextScopeId)??g(e.contextScopeId)}`:e.contextScopeType==="agent"?`Agent · ${o.get(e.contextScopeId)??g(e.contextScopeId)}`:`${e.contextScopeType} · ${g(e.contextScopeId)}`:e.projectId?`Project · ${t.get(e.projectId)??g(e.projectId)}`:e.agentId?`Agent · ${o.get(e.agentId)??g(e.agentId)}`:"Organization"}n(ge,"formatScope");function he(e){return e.status==="active"}n(he,"isGatewayOn");function ie(e){if(!e)return"Profile unavailable";const{accessMode:t,allowedToolCount:o,totalToolCount:s,excludedToolCount:p}=e.summary,l=t==="all_except"?Math.max(s-p,0):o;return l===0?"No tools allowed":`${l} ${l===1?"tool":"tools"}`}n(ie,"allowedToolsLabel");function be(e,t,o){if(!e)return[];const s=new Map(t.map(i=>[i.id,i])),p=new Map(o.map(i=>[i.id,i])),l=new Map;for(const i of o)l.set(i.applicationId,[...l.get(i.applicationId)??[],i]);const u=new Map,y=new Set;for(const i of e.entries??[]){if(i.effect!=="include")continue;let r=i.applicationId??null;!r&&i.connectionId&&(r=p.get(i.connectionId)?.applicationId??null),r&&(y.add(r),(i.catalogEntryId||i.toolName)&&u.set(r,(u.get(r)??0)+1))}const m=[];for(const i of y){const r=s.get(i);if(!r||r.status==="archived")continue;const x=l.get(i)??[],h=x.find(f=>f.status!=="archived")??x[0]??null,d=x.find(f=>Z(f.healthStatus));m.push({application:r,connection:h,toolCount:u.get(i)??0,needsAttention:!!d,attentionReason:d?"Sign-in expired — reconnect to restore access.":null})}return m.sort((i,r)=>i.application.name.localeCompare(r.application.name))}n(be,"deriveGatewayApps");function we(e){return e.connection?j(e.connection):j(e.application.name)}n(we,"gatewayAppDisplayName");var A=["cursor","claude_desktop","vscode","claude_code","opencode"];function Te(e){return[...e].sort((t,o)=>A.indexOf(t.client)-A.indexOf(o.client))}n(Te,"orderedSnippets");function ve(e,t=new Date){const o=t.toISOString().slice(0,16).replace(/[-:T]/g,"");return`${e.displaySlug}-${o}`}n(ve,"defaultGatewayTokenName");function T(e,t){return typeof e=="string"?e.split(t.endpointPath).join(t.endpoint).replaceAll("pcgw_...",t.token):Array.isArray(e)?e.map(o=>T(o,t)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([o,s])=>[o,T(s,t)])):e}n(T,"replaceSnippetConfigValue");function Ce(e,t){return JSON.stringify(T(e,t),null,2)}n(Ce,"formatHydratedSnippetConfig");var a=k(L(),1),ae=n(e=>["tools","gateways",e],"gatewaysQueryKey");function Se({companyId:e,open:t,onOpenChange:o,onCreated:s}){const p=B(),{pushToast:l}=N(),[u,y]=(0,b.useState)(""),[m,i]=(0,b.useState)(""),[r,x]=(0,b.useState)(""),h=ne({queryKey:O.tools.profiles(e),queryFn:n(()=>C.listProfiles(e),"queryFn"),enabled:t}),d=(h.data?.profiles??[]).filter(c=>c.status!=="archived");(0,b.useEffect)(()=>{t&&!r&&d[0]&&x(d[0].id)},[t,r,d]);const f=H({mutationFn:n(()=>C.createGateway(e,{name:u.trim(),description:m.trim()||null,profileId:r,defaultProfileMode:"gateway_only",contextScopeType:"company"}),"mutationFn"),onSuccess:n(async c=>{l({title:"Gateway created",body:c.name,tone:"success"}),await p.invalidateQueries({queryKey:ae(e)}),y(""),i(""),o(!1),s?.(c.id)},"onSuccess"),onError:n(c=>{l({title:"Gateway was not created",body:W(c).body,tone:"error"})},"onError")});function E(c){c.preventDefault(),!(!u.trim()||!r)&&f.mutate()}n(E,"submit");const v=h.isLoading,w=!v&&d.length===0;return(0,a.jsx)(ee,{open:t,onOpenChange:o,children:(0,a.jsxs)(Y,{className:I("sm:max-w-lg",M),children:[(0,a.jsxs)(z,{children:[(0,a.jsx)(J,{children:"New gateway"}),(0,a.jsx)(te,{children:"One safe MCP endpoint that exposes only the apps in its access profile. Hand it to a client like Cursor or Claude Desktop."})]}),(0,a.jsxs)("form",{className:"space-y-4",onSubmit:E,children:[(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),(0,a.jsx)(K,{value:u,onChange:n(c=>y(c.target.value),"onChange"),placeholder:"CTO agents",required:!0,autoFocus:!0})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Access profile"}),(0,a.jsxs)("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:r,onChange:n(c=>x(c.target.value),"onChange"),required:!0,disabled:w,children:[(0,a.jsx)("option",{value:"",disabled:!0,children:v?"Loading profiles…":"Choose a profile"}),d.map(c=>(0,a.jsxs)("option",{value:c.id,children:[c.name," — ",ie(c)]},c.id))]}),(0,a.jsx)("span",{className:"text-xs text-muted-foreground",children:"The profile decides which tools this gateway allows. You can change it later."})]}),(0,a.jsxs)("label",{className:"block space-y-1.5",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Description (optional)"}),(0,a.jsx)("textarea",{className:"min-h-16 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:m,onChange:n(c=>i(c.target.value),"onChange"),placeholder:"Who this endpoint is for and when it should be rotated."})]}),w?(0,a.jsx)("p",{className:"text-xs text-destructive",children:"Create an access profile under Advanced before adding a gateway."}):null,(0,a.jsxs)(F,{children:[(0,a.jsx)(S,{type:"button",variant:"ghost",onClick:n(()=>o(!1),"onClick"),children:"Cancel"}),(0,a.jsx)(S,{type:"submit",disabled:f.isPending||w||!u.trim()||!r,children:f.isPending?"Creating…":"Create gateway"})]})]})]})})}n(Se,"NewGatewayDialog");function se(e){if(typeof window>"u")return e;try{return new URL(e,window.location.origin).toString()}catch{return e}}n(se,"gatewayEndpointUrl");function je({endpointPath:e,className:t}){const{pushToast:o}=N(),s=se(e);async function p(){try{await X(s),o({title:"Gateway URL copied",tone:"success"})}catch{o({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}}return n(p,"copy"),(0,a.jsxs)("button",{type:"button",onClick:n(l=>{l.stopPropagation(),p()},"onClick"),className:I("flex min-w-0 max-w-full items-center gap-1 text-left font-mono text-xs text-muted-foreground hover:text-foreground",t),title:`${s} — click to copy`,"aria-label":"Copy gateway URL",children:[(0,a.jsx)("span",{className:"min-w-0 truncate",children:s}),(0,a.jsx)(Q,{className:"h-3.5 w-3.5 shrink-0","aria-hidden":"true"})]})}n(je,"CopyableGatewayUrl");export{_,xe as a,ue as b,be as c,ge as d,we as f,Te as g,pe as h,fe as i,ye as l,me as m,Se as n,ie as o,he as p,ae as r,ve as s,je as t,Ce as u,D as v,de as x,oe as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var le=Object.defineProperty;var t=(s,l)=>le(s,"name",{value:l,configurable:!0});import{a as ee}from"./rolldown-runtime-DhZMWcEn.js";import{$A as ce,AC as oe,A_ as se,Ai as J,BT as de,Cb as ue,Db as me,Dp as pe,E_ as q,Eb as he,Ep as te,GS as v,Gb as ae,H_ as w,IC as xe,ME as _,M_ as R,Mi as W,NE as j,O_ as M,Ob as ge,PE as fe,Sb as ve,Sp as ne,Tb as ye,Yb as je,__ as A,ab as be,b as Ne,bE as I,cD as ke,dy as Se,fy as Ce,hE as C,ib as we,jC as Pe,j_ as K,ji as Ie,kT as Le,k_ as B,kb as Ae,ki as De,lv as H,ly as Ee,my as Te,nj as Fe,oE as _e,op as D,pE as $e,qT as qe,sy as Re,tv as Me,uE as k,ub as Ke,uy as Be,wb as Oe,xE as S,y as Ue,yf as ie}from"./index-Bt31d8ga.js";var Qe={internal:"Internal","official-microvac":"Official Microvac","official-dsh":"Official DSH","official-paperclip":"Official Paperclip","community-microvac":"Microvac community","community-dsh":"DSH community","community-paperclip":"Paperclip community",custom:"Custom"};function Q({packageName:s,ecosystem:l,internal:a,microvacProvenance:i}){if(a)return"internal";if(s.startsWith("@microvac/")&&i)return"official-microvac";if(s.startsWith("@deepseek-ai/"))return"official-dsh";if(s.startsWith("@paperclipai/"))return"official-paperclip";switch(l){case"microvac":return"community-microvac";case"dsh":return"community-dsh";case"paperclip":return"community-paperclip";default:return"custom"}}t(Q,"classifyTrust");function V(s){return s.startsWith("community-")||s==="custom"}t(V,"trustNeedsConsent");function He(s){const l=(s.replace(/^cordis:/,"").split("/").at(-1)??s).replace(/^(?:paperclip-|dsh-|microvac-)?plugin-/,"").split(/[-_.]+/).filter(Boolean);if(l.length===0)return s;const a=l.join(" ");return a.charAt(0).toUpperCase()+a.slice(1)}t(He,"pluginDisplayName");var Ve="https://cdn.jsdelivr.net/npm/dsh-plugin-catalog/index.json",Ge=[{id:"npm-microvac-plugin",kind:"npm-keyword",label:"npm: microvac-plugin",keyword:"microvac-plugin",url:"",ecosystem:"microvac",packageKind:"microvac",enabled:!0},{id:"paperclip-catalog",kind:"paperclip-catalog",label:"Paperclip catalog",keyword:"",url:"",ecosystem:"paperclip",packageKind:"isolated",enabled:!0},{id:"npm-paperclip-plugin",kind:"npm-keyword",label:"npm: paperclip-plugin",keyword:"paperclip-plugin",url:"",ecosystem:"paperclip",packageKind:"isolated",enabled:!0},{id:"npm-paperclip-adapter",kind:"npm-keyword",label:"npm: paperclip-adapter",keyword:"paperclip-adapter",url:"",ecosystem:"paperclip",packageKind:"adapter",enabled:!0},{id:"dsh-index",kind:"index",label:"DSH plugin index",keyword:"",url:Ve,ecosystem:"dsh",packageKind:"microvac",enabled:!0}],f=ee(Fe(),1),y={list:t(()=>k.get("/microvac/plugins"),"list"),listBuiltIns:t(()=>k.get("/microvac/plugins/builtins"),"listBuiltIns"),updateConfig:t((s,l)=>k.put(`/microvac/plugins/${encodeURIComponent(s)}/config`,l),"updateConfig"),installPolicy:t(()=>k.get("/microvac/plugins/install/policy"),"installPolicy"),previewInstall:t(s=>k.post("/microvac/plugins/install/preview",s),"previewInstall"),install:t(s=>k.post("/microvac/plugins/install",s),"install"),setDisabled:t((s,l)=>k.put(`/microvac/plugins/${encodeURIComponent(s)}/disabled`,{disabled:l}),"setDisabled"),remove:t(s=>k.delete(`/microvac/plugins/${encodeURIComponent(s)}`),"remove"),changeVersion:t((s,l)=>k.put(`/microvac/plugins/${encodeURIComponent(s)}/version`,l),"changeVersion"),searchMarketplace:t((s,l=!1)=>k.get(`/microvac/marketplace?${new URLSearchParams({q:s,incompatible:String(l)})}`),"searchMarketplace"),marketplaceSources:t(()=>k.get("/microvac/marketplace/sources"),"marketplaceSources"),saveMarketplaceSources:t(s=>k.put("/microvac/marketplace/sources",{sources:s}),"saveMarketplaceSources"),updates:t(()=>k.get("/microvac/marketplace/updates"),"updates")},e=ee(ce(),1);function ze(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}t(ze,"isRecord");function Je(s,l,a){const i={...s};return a===void 0?delete i[l]:i[l]=a,i}t(Je,"withKey");function U(s){return typeof s=="string"?s:JSON.stringify(s)}t(U,"formatDefault");function We({id:s,path:l,node:a,value:i,secretsSet:c,onChange:r,disabled:n}){switch(a.type){case"string":{const o=a.secret&&c.includes(l);return(0,e.jsx)(A,{id:s,type:a.secret?"password":"text",autoComplete:a.secret?"new-password":"off",value:typeof i=="string"?i:"",placeholder:o?"Configured — leave empty to keep it":a.default!==void 0?U(a.default):void 0,required:a.required,disabled:n,onChange:t(d=>r(d.target.value===""?void 0:d.target.value),"onChange")})}case"number":return(0,e.jsx)(A,{id:s,type:"number",className:"font-mono",value:typeof i=="number"?String(i):"",placeholder:a.default!==void 0?U(a.default):void 0,min:a.min,max:a.max,step:a.step,required:a.required,disabled:n,onChange:t(o=>{const d=o.target.value;r(d===""||Number.isNaN(Number(d))?void 0:Number(d))},"onChange")});case"boolean":return(0,e.jsx)(te,{id:s,checked:typeof i=="boolean"?i:a.default===!0,disabled:n,onCheckedChange:t(o=>r(o),"onCheckedChange")});case"choice":{const o=a.options.findIndex(d=>d===i);return(0,e.jsxs)(pe,{id:s,value:o===-1?"":String(o),disabled:n,onChange:t(d=>r(d.target.value===""?void 0:a.options[Number(d.target.value)]),"onChange"),children:[(0,e.jsx)("option",{value:"",children:a.default!==void 0?`Default (${U(a.default)})`:"Not set"}),a.options.map((d,m)=>(0,e.jsx)("option",{value:String(m),children:String(d)},String(d)))]})}case"unsupported":return(0,e.jsxs)("p",{id:s,className:"font-mono text-sm text-muted-foreground",children:[i===void 0?"Not set":JSON.stringify(i),(0,e.jsx)("span",{className:"ml-2 font-sans",children:"(edit in microvac.yml)"})]});case"object":return null}}t(We,"FieldControl");function Xe(s){const{id:l,path:a,name:i,node:c,value:r,secretsSet:n,onChange:o,disabled:d}=s;return c.type==="object"?(0,e.jsxs)("fieldset",{className:"space-y-4",children:[(0,e.jsx)("legend",{className:"text-sm font-medium",children:i}),c.description?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}):null,(0,e.jsx)("div",{className:"space-y-4 border-l border-border pl-4",children:(0,e.jsx)(re,{idPrefix:l,pathPrefix:`${a}.`,fields:c.fields,value:ze(r)?r:{},secretsSet:n,onChange:t(m=>o(Object.keys(m).length===0?void 0:m),"onChange"),disabled:d})})]}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(D,{htmlFor:l,children:i}),(0,e.jsx)(We,{...s}),c.description?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:c.description}):null]})}t(Xe,"Field");function re({idPrefix:s,pathPrefix:l,fields:a,value:i,secretsSet:c,onChange:r,disabled:n}){return(0,e.jsx)(e.Fragment,{children:a.map(({key:o,node:d})=>(0,e.jsx)(Xe,{id:`${s}-${o}`,path:`${l}${o}`,name:o,node:d,value:i[o],secretsSet:c,onChange:t(m=>r(Je(i,o,m)),"onChange"),disabled:n},o))})}t(re,"Fields");function Ye({idPrefix:s,schema:l,value:a,secretsSet:i,onChange:c,disabled:r}){return l.type!=="object"?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"This plugin's config is not an object; edit it in microvac.yml."}):(0,e.jsx)("div",{className:"space-y-4",children:(0,e.jsx)(re,{idPrefix:s,pathPrefix:"",fields:l.fields,value:a,secretsSet:i,onChange:c,disabled:r})})}t(Ye,"PluginConfigForm");function O({level:s}){const l=!V(s);return(0,e.jsxs)(w,{variant:l?"secondary":"outline","data-trust-level":s,className:"gap-1",children:[(0,e.jsx)(l?oe:Pe,{className:"h-3 w-3","aria-hidden":!0}),Qe[s]]})}t(O,"TrustBadge");var Ze={internal:"Ships with Microvac.","official-microvac":"Published by Microvac, with npm provenance from github.com/microvac-ai.","official-dsh":"Published under the @deepseek-ai scope.","official-paperclip":"Published under the @paperclipai scope.","community-microvac":"Published by someone else for Microvac. Nobody reviewed this code.","community-dsh":"Published by someone else for DSH. Nobody reviewed this code.","community-paperclip":"Published by someone else for Microvac. Nobody reviewed this code.",custom:"From a package or source you named. Nobody reviewed this code."};function es(s){return s==="isolated"?"This plugin gets the rights listed below":"This code gets full server rights"}t(es,"consentLabel");function G({level:s,kind:l,consent:a,onConsentChange:i}){const c=(0,f.useId)();return(0,e.jsxs)("div",{className:"space-y-3","data-testid":"trust-consent",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-sm",children:[(0,e.jsx)(O,{level:s}),(0,e.jsx)("span",{className:"text-muted-foreground",children:Ze[s]})]}),l==="isolated"?(0,e.jsxs)("ul",{className:"list-disc space-y-1 pl-5 text-sm text-muted-foreground",children:[(0,e.jsx)("li",{children:"Runs in its own worker process, not inside the server."}),(0,e.jsx)("li",{children:"Gets the capabilities its manifest declares; its settings page lists them after install."})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"It runs inside the Microvac server, with access to its data, secrets and network."}),V(s)?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ne,{id:c,checked:a,onCheckedChange:t(r=>i(r===!0),"onCheckedChange")}),(0,e.jsx)(D,{htmlFor:c,className:"text-sm font-medium",children:es(l)})]}):null]})}t(G,"TrustConsent");function z(s,l){return!V(s)||l}t(z,"consentGiven");function ss(){const s=_(),l=S({queryKey:[...v.instance.cordisPlugins,"install-policy"],queryFn:t(()=>y.installPolicy(),"queryFn")}),[a,i]=(0,f.useState)(""),[c,r]=(0,f.useState)(""),[n,o]=(0,f.useState)(null),[d,m]=(0,f.useState)(!1),h=I({mutationFn:t(()=>y.previewInstall({name:a.trim(),version:c.trim()}),"mutationFn"),onSuccess:o}),g=I({mutationFn:t(p=>y.install({name:p.name,version:p.version,integrity:p.integrity}),"mutationFn"),onSuccess:t(async()=>{o(null),m(!1),i(""),r(""),await s.invalidateQueries({queryKey:v.instance.cordisPlugins})},"onSuccess")});if(!l.data?.enabled)return null;const x=h.isPending||g.isPending,b=t(p=>{p(),o(null),m(!1),h.reset(),g.reset()},"edit"),N=h.error?C(h.error,{action:"read the package"}).body:g.error?C(g.error,{action:"install the plugin"}).body:null;return(0,e.jsxs)(q,{children:[(0,e.jsxs)(K,{children:[(0,e.jsx)(R,{children:"Install a plugin"}),(0,e.jsxs)(B,{children:["Installs an exact npm version next to microvac.yml and adds it to the file."," ",l.data.allowInstallScripts?"This instance runs npm install scripts.":"npm install scripts are skipped on this instance."]})]}),(0,e.jsxs)(M,{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"grid gap-4 sm:grid-cols-[2fr_1fr]",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(D,{htmlFor:"plugin-install-name",children:"Package"}),(0,e.jsx)(A,{id:"plugin-install-name",className:"font-mono",placeholder:"@acme/cordis-plugin",value:a,disabled:x,onChange:t(p=>b(()=>i(p.target.value)),"onChange")})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(D,{htmlFor:"plugin-install-version",children:"Exact version"}),(0,e.jsx)(A,{id:"plugin-install-version",className:"font-mono",placeholder:"1.0.0",value:c,disabled:x,onChange:t(p=>b(()=>r(p.target.value)),"onChange")})]})]}),n?(0,e.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm","data-testid":"plugin-install-preview",children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Package"}),(0,e.jsxs)("dd",{className:"font-mono",children:[n.name,"@",n.version]}),n.description?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Description"}),(0,e.jsx)("dd",{children:n.description})]}):null,(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Integrity"}),(0,e.jsx)("dd",{className:"break-all font-mono text-xs",children:n.integrity}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Install scripts"}),(0,e.jsxs)("dd",{className:"flex flex-wrap items-center gap-2",children:[n.installScripts.length===0?"None":n.installScripts.map(p=>(0,e.jsx)(w,{variant:"outline",className:"font-mono",children:p},p)),n.installScriptsBlocked?(0,e.jsx)("span",{className:"text-muted-foreground",children:"skipped; the plugin may not work without them"}):null]})]}):null,n?(0,e.jsx)(G,{level:n.trustLevel,kind:"microvac",consent:d,onConsentChange:m}):null,n?.alreadyListed?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"microvac.yml already lists this package. Change its version in the file."}):null,N?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:N}):null]}),(0,e.jsx)(se,{className:"flex items-center justify-end gap-2",children:n?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j,{type:"button",variant:"ghost",disabled:x,onClick:t(()=>b(()=>{}),"onClick"),children:"Cancel"}),(0,e.jsx)(j,{type:"button",disabled:x||n.alreadyListed||!z(n.trustLevel,d),onClick:t(()=>g.mutate(n),"onClick"),children:g.isPending?"Installing…":"Approve and install"})]}):(0,e.jsx)(j,{type:"button",disabled:x||!a.trim()||!c.trim(),onClick:t(()=>h.mutate(),"onClick"),children:h.isPending?"Reading…":"Review package"})})]})}t(ss,"PluginInstallCard");var ts={microvac:"Microvac plugin",builtin:"Built-in",isolated:"Isolated plugin",adapter:"Adapter"},X={running:"Running",starting:"Starting",failed:"Failed",stopped:"Stopped"},as={installed:"Installed",ready:"Running",disabled:"Disabled",error:"Error",upgrade_pending:"Upgrade pending",uninstalled:"Uninstalled"},$="/company/settings/instance/cordis-plugins",ns="/company/settings/instance/plugins",is="/company/settings/instance/adapters";function rs(s){return`${$}?plugin=${encodeURIComponent(s)}`}t(rs,"microvacPluginHref");function ls({microvac:s,builtIns:l=[],isolated:a=[],adapters:i=[]}){const c=[];for(const r of s)c.push({key:`microvac:${r.id}`,kind:"microvac",name:r.displayName,packageName:r.name,description:r.description,version:r.version,trustLevel:r.trustLevel,status:r.disabled?"Disabled":X[r.state],failing:r.state==="failed",href:rs(r.id)});for(const r of l)c.push({key:`builtin:${r.id}`,kind:"builtin",name:r.displayName,packageName:r.name,description:r.description||null,version:r.version,trustLevel:r.trustLevel,status:X[r.state],failing:r.state==="failed",href:null});for(const r of a)r.status!=="uninstalled"&&c.push({key:`isolated:${r.id}`,kind:"isolated",name:r.manifestJson?.displayName||He(r.packageName),packageName:r.packageName,description:r.manifestJson?.description||null,version:r.version,trustLevel:r.packagePath?"custom":Q({packageName:r.packageName,ecosystem:"paperclip"}),status:as[r.status],failing:r.status==="error",href:`${ns}/${encodeURIComponent(r.id)}`});for(const r of i){if(r.source!=="external")continue;const n=r.packageName??r.type;c.push({key:`adapter:${r.type}`,kind:"adapter",name:r.label,packageName:n,description:null,version:r.version??null,trustLevel:r.isLocalPath?"custom":Q({packageName:n,ecosystem:"paperclip"}),status:r.disabled?"Disabled":r.loaded?"Running":"Not loaded",failing:!1,href:is})}return c}t(ls,"installedRows");function cs({plugin:s}){const l=_(),a=je(),i=S({queryKey:[...v.instance.cordisPlugins,"install-policy"],queryFn:t(()=>y.installPolicy(),"queryFn")}),[c,r]=(0,f.useState)(""),[n,o]=(0,f.useState)(null),[d,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),x=t(()=>l.invalidateQueries({queryKey:v.instance.cordisPlugins}),"refresh"),b=I({mutationFn:t(()=>y.setDisabled(s.id,!s.disabled),"mutationFn"),onSuccess:x}),N=I({mutationFn:t(()=>y.remove(s.id),"mutationFn"),onSuccess:t(async()=>{await x(),a($)},"onSuccess")}),p=I({mutationFn:t(()=>y.previewInstall({name:s.name,version:c.trim()}),"mutationFn"),onSuccess:o}),P=I({mutationFn:t(F=>y.changeVersion(s.id,{version:F.version,integrity:F.integrity}),"mutationFn"),onSuccess:t(async()=>{o(null),g(!1),r(""),await x()},"onSuccess")}),L=b.isPending||N.isPending||p.isPending||P.isPending,u=s.source==="npm"&&i.data?.enabled===!0,E=t(F=>{r(F),o(null),g(!1),p.reset(),P.reset()},"editVersion"),T=b.error?C(b.error,{action:s.disabled?"enable the plugin":"disable the plugin"}).body:N.error?C(N.error,{action:"remove the plugin"}).body:p.error?C(p.error,{action:"read the package"}).body:P.error?C(P.error,{action:"change the version"}).body:null;return(0,e.jsxs)(q,{"data-testid":"plugin-lifecycle",children:[(0,e.jsxs)(K,{children:[(0,e.jsx)(R,{children:"Manage"}),(0,e.jsx)(B,{children:s.source==="npm"?"Installed from npm next to microvac.yml.":"Ships with Microvac and changes version with it."})]}),(0,e.jsxs)(M,{className:"space-y-6",children:[s.restartRequired?(0,e.jsx)("p",{role:"status",className:"text-sm text-muted-foreground",children:"A new version is installed. It runs from the next server restart; until then the previous version keeps running."}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4",children:[(0,e.jsxs)("div",{className:"space-y-1 text-sm",children:[(0,e.jsx)("p",{className:"font-medium",children:s.disabled?"Disabled":"Enabled"}),(0,e.jsx)("p",{className:"text-muted-foreground",children:s.disabled?"The plugin is stopped. Its settings are kept.":"Disabling stops the plugin and keeps its settings."})]}),(0,e.jsx)(j,{type:"button",variant:"outline",disabled:L,onClick:t(()=>b.mutate(),"onClick"),children:b.isPending?"Saving…":s.disabled?"Enable":"Disable"})]}),u?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-end gap-2",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(D,{htmlFor:`plugin-${s.id}-version`,children:"Change version"}),(0,e.jsx)(A,{id:`plugin-${s.id}-version`,className:"w-40 font-mono",placeholder:s.version??"1.0.0",value:c,disabled:L,onChange:t(F=>E(F.target.value),"onChange")})]}),n?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(j,{type:"button",variant:"ghost",disabled:L,onClick:t(()=>E(c),"onClick"),children:"Cancel"}),(0,e.jsx)(j,{type:"button",disabled:L||!z(n.trustLevel,h),onClick:t(()=>P.mutate(n),"onClick"),children:P.isPending?"Installing…":`Approve and install ${n.version}`})]}):(0,e.jsx)(j,{type:"button",variant:"outline",disabled:L||!c.trim()||c.trim()===s.version,onClick:t(()=>p.mutate(),"onClick"),children:p.isPending?"Reading…":"Review version"})]}),n?(0,e.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm","data-testid":"plugin-version-preview",children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Package"}),(0,e.jsxs)("dd",{className:"font-mono",children:[n.name,"@",n.version]}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Integrity"}),(0,e.jsx)("dd",{className:"break-all font-mono text-xs",children:n.integrity}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Install scripts"}),(0,e.jsxs)("dd",{className:"font-mono",children:[n.installScripts.length===0?"None":n.installScripts.join(", "),n.installScriptsBlocked?(0,e.jsx)("span",{className:"font-sans text-muted-foreground",children:" (skipped)"}):null]})]}):null,n?(0,e.jsx)(G,{level:n.trustLevel,kind:"microvac",consent:h,onConsentChange:g}):null,(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"The new version is checked before it is kept: if it does not start with these settings, the current version is installed back."})]}):null,(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-4 border-t border-border pt-4",children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["Removing deletes the entry and its settings from microvac.yml",s.source==="npm"?", and its npm package":"","."]}),(0,e.jsx)(j,{type:"button",variant:"destructive",disabled:L,onClick:t(()=>m(!0),"onClick"),children:N.isPending?"Removing…":"Remove"})]}),T?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:T}):null]}),(0,e.jsx)(ve,{open:d,onOpenChange:m,children:(0,e.jsxs)(ye,{children:[(0,e.jsxs)(ge,{children:[(0,e.jsxs)(Ae,{children:["Remove ",s.displayName,"?"]}),(0,e.jsx)(he,{children:"The plugin stops and its settings, secrets included, are deleted from microvac.yml. This cannot be undone."})]}),(0,e.jsxs)(me,{children:[(0,e.jsx)(Oe,{children:"Cancel"}),(0,e.jsx)(ue,{className:fe({variant:"destructive"}),onClick:t(()=>N.mutate(),"onClick"),children:"Remove plugin"})]})]})})]})}t(cs,"PluginLifecycleCard");function Y({row:s,update:l}){return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"min-w-0 flex-1 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:s.name}),s.version?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:s.version}):null,(0,e.jsx)(w,{variant:s.failing?"destructive":"outline",children:s.status}),l?(0,e.jsxs)(w,{variant:"secondary",children:["Update available: ",l]}):null]}),s.description?(0,e.jsx)("p",{className:"truncate text-sm text-muted-foreground",children:s.description}):null]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,e.jsx)("span",{className:"hidden text-xs text-muted-foreground sm:inline",children:ts[s.kind]}),(0,e.jsx)(O,{level:s.trustLevel}),s.href?(0,e.jsx)(Le,{className:"h-4 w-4 text-muted-foreground","aria-hidden":!0}):null]})]})}t(Y,"RowBody");function os({rows:s,updates:l={}}){return(0,e.jsx)("ul",{className:"divide-y divide-border rounded-md border border-border","aria-label":"Installed plugins",children:s.map(a=>(0,e.jsx)("li",{"data-plugin-row":a.key,children:a.href?(0,e.jsx)(ae,{to:a.href,className:"flex items-center gap-4 px-4 py-3 hover:bg-accent/50",children:(0,e.jsx)(Y,{row:a,update:l[a.key]})}):(0,e.jsx)("div",{className:"flex items-center gap-4 px-4 py-3",title:"Ships with Microvac",children:(0,e.jsx)(Y,{row:a})})},a.key))})}t(os,"InstalledPluginList");function ds({listing:s,onClose:l}){return(0,e.jsx)(Re,{open:s!==null,onOpenChange:t(a=>a?void 0:l(),"onOpenChange"),children:s?(0,e.jsx)(us,{listing:s,onClose:l},`${s.sourceId}:${s.name}`):null})}t(ds,"InstallListingDialog");function us({listing:s,onClose:l}){const a=_(),[i,c]=(0,f.useState)(!1),r=s.packageKind==="microvac",n=S({queryKey:[...v.instance.cordisPlugins,"preview",s.name,s.version],queryFn:t(()=>y.previewInstall({name:s.name,version:s.version}),"queryFn"),enabled:r,retry:!1}),o=r?n.data?.trustLevel??s.trustLevel:s.trustLevel,d=I({mutationFn:t(async x=>{if(s.packageKind==="microvac"){if(!x)throw new Error("The package was not reviewed");await y.install({name:x.name,version:x.version,integrity:x.integrity})}else s.packageKind==="isolated"?await H.install(s.localPath?{packageName:s.localPath,isLocalPath:!0}:{packageName:s.name,version:s.version}):await ie.install({packageName:s.name,version:s.version})},"mutationFn"),onSuccess:t(async()=>{await Promise.all([a.invalidateQueries({queryKey:v.instance.cordisPlugins}),a.invalidateQueries({queryKey:v.plugins.all}),a.invalidateQueries({queryKey:v.adapters.all})]),l()},"onSuccess")}),m=n.data,h=r&&(!m||m.alreadyListed),g=n.error?C(n.error,{action:"read the package"}).body:d.error?C(d.error,{action:"install the plugin"}).body:null;return(0,e.jsxs)(Ee,{children:[(0,e.jsxs)(Ce,{children:[(0,e.jsxs)(Te,{children:["Install ",s.displayName,"?"]}),(0,e.jsx)(Be,{className:"font-mono",children:s.localPath?s.name:`${s.name}@${s.version}`})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[s.description?(0,e.jsx)("p",{className:"text-sm",children:s.description}):null,r&&n.isPending?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Reading the package…"}):null,m?(0,e.jsxs)("dl",{className:"grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-sm","data-testid":"listing-preview",children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Integrity"}),(0,e.jsx)("dd",{className:"break-all font-mono text-xs",children:m.integrity}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Install scripts"}),(0,e.jsxs)("dd",{className:"font-mono",children:[m.installScripts.length===0?"None":m.installScripts.join(", "),m.installScriptsBlocked?(0,e.jsx)("span",{className:"font-sans text-muted-foreground",children:" (skipped)"}):null]})]}):null,m?.alreadyListed?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Already installed. Change its version from its page."}):null,!r||m?(0,e.jsx)(G,{level:o,kind:s.packageKind,consent:i,onConsentChange:c}):null,g?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:g}):null]}),(0,e.jsxs)(Se,{children:[(0,e.jsx)(j,{type:"button",variant:"ghost",disabled:d.isPending,onClick:l,children:"Cancel"}),(0,e.jsx)(j,{type:"button",disabled:d.isPending||h||!z(o,i),onClick:t(()=>d.mutate(m),"onClick"),children:d.isPending?"Installing…":"Install"})]})]})}t(us,"InstallListingContent");var ms={microvac:"Microvac plugins",isolated:"Isolated plugins",adapter:"Adapters"},ps=new Set(Ge.map(s=>s.id));function Z(s,l){const a=s.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,56)||"source";let i=a;for(let c=2;l.has(i);c+=1)i=`${a}-${c}`;return i}t(Z,"sourceId");function hs(s,l){const a=s.trim();if(/^https:\/\//i.test(a)){const c=new URL(a).host;return{id:Z(c,l),kind:"index",label:c,keyword:"",url:a,ecosystem:"custom",packageKind:"microvac",enabled:!0}}const i=a.toLowerCase();return{id:Z(`npm-${i}`,l),kind:"npm-keyword",label:`npm: ${i}`,keyword:i,url:"",ecosystem:"custom",packageKind:"microvac",enabled:!0}}t(hs,"sourceFromInput");function xs({sources:s}){const l=_(),[a,i]=(0,f.useState)(""),c=I({mutationFn:t(n=>y.saveMarketplaceSources(n),"mutationFn"),onSuccess:t(async n=>{l.setQueryData([...v.instance.cordisPlugins,"marketplace-sources"],n),await l.invalidateQueries({queryKey:[...v.instance.cordisPlugins,"marketplace"]}),i("")},"onSuccess")}),r=t(n=>{n.preventDefault(),a.trim()&&c.mutate([...s,hs(a,new Set(s.map(o=>o.id)))])},"add");return(0,e.jsxs)(q,{children:[(0,e.jsxs)(K,{children:[(0,e.jsx)(R,{className:"text-base",children:"Sources"}),(0,e.jsx)(B,{children:"Saved in microvac.yml. A source only lists packages; installing still shows the trust level and asks before it runs code."})]}),(0,e.jsxs)(M,{className:"space-y-4",children:[(0,e.jsx)("ul",{className:"space-y-3","data-testid":"marketplace-sources",children:s.map(n=>(0,e.jsxs)("li",{className:"flex items-center justify-between gap-4",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:n.label}),(0,e.jsxs)("div",{className:"truncate text-xs text-muted-foreground",children:[ms[n.packageKind],n.kind==="index"?` · ${n.url}`:""]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[ps.has(n.id)?null:(0,e.jsx)(j,{type:"button",variant:"ghost",size:"sm",disabled:c.isPending,onClick:t(()=>c.mutate(s.filter(o=>o.id!==n.id)),"onClick"),children:"Remove"}),(0,e.jsx)(te,{"aria-label":`Search ${n.label}`,checked:n.enabled,disabled:c.isPending,onCheckedChange:t(o=>c.mutate(s.map(d=>d.id===n.id?{...d,enabled:o}:d)),"onCheckedChange")})]})]},n.id))}),(0,e.jsxs)("form",{className:"space-y-2",onSubmit:r,children:[(0,e.jsx)(D,{htmlFor:"marketplace-source",children:"Add a source"}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(A,{id:"marketplace-source",placeholder:"https://…/index.json or an npm keyword",value:a,maxLength:2048,onChange:t(n=>i(n.target.value),"onChange")}),(0,e.jsx)(j,{type:"submit",variant:"outline",disabled:c.isPending||!a.trim(),children:"Add"})]}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"An index must use format 1, like the DSH plugin index."})]}),c.error?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:C(c.error,{action:"save the sources"}).body}):null]})]})}t(xs,"MarketplaceSources");function gs(s,l,a){const i=a.trim().toLowerCase();return l.filter(c=>c.hasBuiltEntrypoints).filter(c=>!i||`${c.packageName} ${c.displayName} ${c.description}`.toLowerCase().includes(i)).map(c=>({name:c.packageName,displayName:c.displayName,description:c.description||null,version:"",sourceId:s.id,packageKind:"isolated",trustLevel:Q({packageName:c.packageName,ecosystem:s.ecosystem}),homepage:null,category:c.tag==="example"?"Example":null,localPath:c.localPath}))}t(gs,"paperclipCatalogListings");function fs({listing:s}){return s.compatibility==="unknown"?(0,e.jsx)(w,{variant:"outline",children:"Compatibility unknown"}):s.compatibility==="incompatible"?(0,e.jsx)(w,{variant:"destructive",children:"Incompatible"}):null}t(fs,"CompatibilityBadge");function vs({installedNames:s}){const[l,a]=(0,f.useState)(""),[i,c]=(0,f.useState)(""),[r,n]=(0,f.useState)(null),[o,d]=(0,f.useState)(!1),m=S({queryKey:[...v.instance.cordisPlugins,"marketplace-sources"],queryFn:t(()=>y.marketplaceSources(),"queryFn")}),h=S({queryKey:[...v.instance.cordisPlugins,"marketplace",i,o],queryFn:t(()=>y.searchMarketplace(i,o),"queryFn"),staleTime:6e4}),g=m.data?.find(u=>u.kind==="paperclip-catalog"&&u.enabled),x=S({queryKey:v.plugins.examples,queryFn:t(()=>H.listBundled(),"queryFn"),enabled:!!g}),b=(0,f.useMemo)(()=>{const u=g&&x.data?gs(g,x.data,i):[],E=new Set(u.map(T=>T.name));return[...u,...(h.data?.listings??[]).filter(T=>!E.has(T.name))]},[g,x.data,h.data,i]),N=t(u=>m.data?.find(E=>E.id===u)?.label??u,"sourceLabel"),p=h.data?.hiddenIncompatible??0,P=[...(h.data?.errors??[]).map(u=>`${N(u.sourceId)} (${u.message})`),...x.error&&g?[g.label]:[]],L=t(u=>{u.preventDefault(),c(l.trim())},"submit");return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("form",{className:"flex gap-2",onSubmit:L,role:"search",children:[(0,e.jsx)(A,{"aria-label":"Search the marketplace",placeholder:"Search plugins",value:l,maxLength:100,onChange:t(u=>a(u.target.value),"onChange")}),(0,e.jsxs)(j,{type:"submit",variant:"outline",children:[(0,e.jsx)(xe,{className:"h-4 w-4","aria-hidden":!0}),"Search"]})]}),p>0||o?(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(ne,{id:"marketplace-show-incompatible","aria-label":"Show incompatible plugins",checked:o,onCheckedChange:t(u=>d(u===!0),"onCheckedChange")}),(0,e.jsxs)(D,{htmlFor:"marketplace-show-incompatible",className:"text-sm font-normal",children:["Show incompatible plugins",p>0?(0,e.jsxs)("span",{className:"text-muted-foreground",children:[" (",p," incompatible hidden)"]}):null]})]}):null,h.error?(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:C(h.error,{action:"search the marketplace"}).body}):h.isPending?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Searching…"}):b.length===0?(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No plugin matches",i?` "${i}"`:"","."]}):(0,e.jsx)("ul",{className:"divide-y divide-border rounded-md border border-border","data-testid":"marketplace-listings",children:b.map(u=>(0,e.jsxs)("li",{className:"flex items-start justify-between gap-4 p-4",children:[(0,e.jsxs)("div",{className:"min-w-0 space-y-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("span",{className:"font-medium",children:u.displayName}),(0,e.jsx)(O,{level:u.trustLevel}),u.category?(0,e.jsx)(w,{variant:"outline",children:u.category}):null,(0,e.jsx)(fs,{listing:u})]}),(0,e.jsxs)("p",{className:"truncate font-mono text-xs text-muted-foreground",children:[u.name,u.version?`@${u.version}`:""," · ",N(u.sourceId)]}),u.description?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:u.description}):null,u.missingServices?.length?(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Needs ",u.missingServices.join(", "),", which Microvac does not provide."]}):null]}),s.has(u.name)?(0,e.jsx)(w,{variant:"secondary",children:"Installed"}):(0,e.jsx)(j,{type:"button",size:"sm",onClick:t(()=>n(u),"onClick"),children:"Install"})]},`${u.sourceId}:${u.name}`))}),P.length>0?(0,e.jsxs)("p",{role:"status",className:"text-sm text-muted-foreground",children:["Not searched: ",P.join("; "),"."]}):null,m.data?(0,e.jsx)(xs,{sources:m.data}):null,(0,e.jsx)(ds,{listing:r,onClose:t(()=>n(null),"onClose")})]})}t(vs,"MarketplaceTab");var ys={running:"Running",starting:"Starting",failed:"Failed",stopped:"Stopped"};function js(s){const l=s instanceof $e&&typeof s.body=="object"&&s.body!==null?s.body.details:void 0,a=Array.isArray(l?.issues)?l.issues.filter(i=>typeof i=="string"):[];return{body:C(s,{action:"save the plugin config"}).body,issues:a}}t(js,"saveErrorMessage");function bs({plugin:s}){const l=_(),[a,i]=(0,f.useState)(s.config),[c,r]=(0,f.useState)(!1);(0,f.useEffect)(()=>{c||i(s.config)},[s.config,c]);const n=I({mutationFn:t(()=>y.updateConfig(s.id,{config:a}),"mutationFn"),onSuccess:t(async h=>{r(!1),i(h.config),await l.invalidateQueries({queryKey:v.instance.cordisPlugins})},"onSuccess")}),o=n.error?js(n.error):null,d=(0,f.useMemo)(()=>({pluginName:s.name}),[s.name]),m=(0,f.useSyncExternalStore)(Ne,Ue).get(s.name);return(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2","data-testid":"plugin-detail-header",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,e.jsx)("h2",{className:"text-lg font-semibold",children:s.displayName}),s.version?(0,e.jsx)("span",{className:"font-mono text-sm text-muted-foreground",children:s.version}):null,(0,e.jsx)(w,{variant:s.state==="failed"?"destructive":"outline",children:ys[s.state]}),s.disabled?(0,e.jsx)(w,{variant:"secondary",children:"Disabled"}):null,s.restartRequired?(0,e.jsx)(w,{variant:"secondary",children:"Restart needed"}):null,(0,e.jsx)(O,{level:s.trustLevel})]}),s.description?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:s.description}):null]}),(0,e.jsxs)(q,{children:[(0,e.jsxs)(K,{children:[(0,e.jsx)(R,{children:"Settings"}),(0,e.jsx)(B,{children:"Saved to microvac.yml and applied without a restart."})]}),(0,e.jsxs)(M,{className:"space-y-6",children:[m?(0,e.jsxs)("p",{role:"alert",className:"text-sm text-destructive",children:["Its page code did not start: ",m]}):null,s.schema?(0,e.jsx)(Ye,{idPrefix:`plugin-${s.id}`,schema:s.schema,value:a,secretsSet:s.secretsSet,disabled:n.isPending,onChange:t(h=>{i(h),r(!0),n.reset()},"onChange")}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:s.state==="running"?"This plugin has no settings.":"Settings appear once the plugin runs."}),(0,e.jsx)(Me,{slotKey:ke,context:d}),o?(0,e.jsxs)("div",{role:"alert",className:"space-y-1 text-sm text-destructive",children:[(0,e.jsx)("p",{children:o.body}),o.issues.length>0?(0,e.jsx)("ul",{className:"list-disc pl-5 font-mono",children:o.issues.map(h=>(0,e.jsx)("li",{children:h},h))}):null]}):null]}),s.schema?(0,e.jsxs)(se,{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)(j,{type:"button",variant:"ghost",disabled:!c||n.isPending,onClick:t(()=>{i(s.config),r(!1),n.reset()},"onClick"),children:"Discard changes"}),(0,e.jsx)(j,{type:"button",disabled:!c||n.isPending,onClick:t(()=>n.mutate(),"onClick"),children:n.isPending?"Saving…":"Save settings"})]}):null]}),(0,e.jsx)(cs,{plugin:s}),(0,e.jsxs)("details",{className:"rounded-md border border-border px-4 py-3 text-sm","data-testid":"plugin-technical-details",children:[(0,e.jsx)("summary",{className:"cursor-pointer font-medium",children:"Technical details"}),(0,e.jsxs)("dl",{className:"mt-3 grid grid-cols-[max-content_1fr] gap-x-4 gap-y-2",children:[(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Package"}),(0,e.jsx)("dd",{className:"font-mono break-all",children:s.name}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Entry id"}),(0,e.jsx)("dd",{className:"font-mono break-all",children:s.id}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Integrity"}),(0,e.jsx)("dd",{className:"font-mono break-all",children:s.integrity??(s.source==="npm"?"Unknown":"Ships with Microvac")}),(0,e.jsx)("dt",{className:"text-muted-foreground",children:"Last error"}),(0,e.jsx)("dd",{className:"font-mono break-all whitespace-pre-wrap",children:s.lastError??"None"})]})]})]})}t(bs,"MicrovacPluginDetail");function Ns(s){return Object.fromEntries(Object.entries(s??{}).map(([l,a])=>[`microvac:${l}`,a]))}t(Ns,"updateBadges");function ks(s,l,a){return new Set([...s.map(i=>i.name),...(l??[]).map(i=>i.packageName),...(a??[]).flatMap(i=>i.packageName?[i.packageName]:[])])}t(ks,"installedNames");function Ss({errors:s}){return s.length===0?null:(0,e.jsxs)("p",{role:"status",className:"text-sm text-muted-foreground",children:["Not listed: ",s.join("; "),"."]})}t(Ss,"OptionalListNote");function Is(){const{setBreadcrumbs:s}=we(),[l,a]=_e(),i=l.get("plugin"),c=S({queryKey:v.instance.cordisPlugins,queryFn:t(()=>y.list(),"queryFn")}),r=S({queryKey:v.instance.builtInPlugins,queryFn:t(()=>y.listBuiltIns(),"queryFn"),enabled:!i}),n=S({queryKey:v.plugins.all,queryFn:t(()=>H.list(),"queryFn"),enabled:!i}),o=S({queryKey:v.adapters.all,queryFn:t(()=>ie.list(),"queryFn"),enabled:!i}),d=S({queryKey:[...v.instance.cordisPlugins,"updates"],queryFn:t(()=>y.updates(),"queryFn"),enabled:!i,staleTime:6e5}),m=l.get("tab")==="marketplace"?"marketplace":"installed",h=t(p=>a(p==="marketplace"?{tab:"marketplace"}:{},{replace:!0}),"setTab"),g=Ke(c),x=i?c.data?.find(p=>p.id===i):void 0;(0,f.useEffect)(()=>{s(x?[{label:"Settings",href:"/company/settings"},{label:"Plugins",href:$},{label:x.displayName}]:[{label:"Settings",href:"/company/settings"},{label:"Plugins"}])},[s,x]);const b=(0,f.useMemo)(()=>c.data?ls({microvac:c.data,builtIns:r.data,isolated:n.data,adapters:o.data}):[],[c.data,r.data,n.data,o.data]),N=[r.error?"built-in plugins":null,n.error?"isolated plugins":null,o.error?"adapters":null].filter(p=>p!==null);return(0,e.jsxs)("div",{className:"max-w-4xl space-y-8",children:[i?(0,e.jsxs)(ae,{to:$,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground",children:[(0,e.jsx)(qe,{className:"h-4 w-4","aria-hidden":!0}),"All plugins"]}):(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(de,{className:"h-5 w-5 text-muted-foreground"}),(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Plugins"})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Everything this instance runs. Open a Microvac plugin to change its settings; saved changes apply without a restart."})]}),c.error?(0,e.jsx)(be,{size:"page",error:c.error,action:"load the plugins",onRetry:g.retry,retrying:g.isFetching}):c.data?i?x?(0,e.jsx)(bs,{plugin:x},x.id):(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["No plugin with the id ",i," is listed in microvac.yml."]}):(0,e.jsxs)(De,{value:m,onValueChange:h,children:[(0,e.jsxs)(Ie,{children:[(0,e.jsx)(W,{value:"installed",children:"Installed"}),(0,e.jsx)(W,{value:"marketplace",children:"Marketplace"})]}),(0,e.jsxs)(J,{value:"installed",className:"space-y-4",children:[b.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No plugin is installed. Find one in the marketplace or add an entry to microvac.yml."}):(0,e.jsx)(os,{rows:b,updates:Ns(d.data)}),(0,e.jsx)(Ss,{errors:N})]}),(0,e.jsxs)(J,{value:"marketplace",className:"space-y-6",children:[(0,e.jsx)(vs,{installedNames:ks(c.data,n.data,o.data)}),(0,e.jsx)(ss,{})]})]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading plugins…"})]})}t(Is,"CordisPluginSettings");export{Is as CordisPluginSettings};
|