@microvac/ui 0.1.0-rc.14 → 0.1.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ActiveAgentsPanel-C9AP9hJu.js → ActiveAgentsPanel-BEx06tMt.js} +1 -1
- package/dist/assets/{AdapterManager-CmxTUKJH.js → AdapterManager-3kEEQWFJ.js} +1 -1
- package/dist/assets/{AdvancedToolsRoute-CXsQnTei.js → AdvancedToolsRoute-CgS6B-oh.js} +1 -1
- package/dist/assets/{AgentActionButtons-DWq2OuVK.js → AgentActionButtons-Cz3jCEd7.js} +1 -1
- package/dist/assets/{AgentAdvancedTab-dhBDxF-H.js → AgentAdvancedTab-BG6ZIAuN.js} +1 -1
- package/dist/assets/{AgentBulkSettingsSheet-DYT4ovDg.js → AgentBulkSettingsSheet-BrrbvspS.js} +1 -1
- package/dist/assets/{AgentChat-r0TPOfPK.js → AgentChat-Dw9iXD6H.js} +1 -1
- package/dist/assets/{AgentDetailPage-Bc_okBuS.js → AgentDetailPage-CuVIHv_q.js} +3 -3
- package/dist/assets/{AgentIdentityChip-CB2NBXkZ.js → AgentIdentityChip-BrVCcuHQ.js} +1 -1
- package/dist/assets/{AgentRosterFilters-b7qMLv8-.js → AgentRosterFilters-GQ2bdXfW.js} +2 -2
- package/dist/assets/{Agents-BsvXy3pZ.js → Agents-clrVQnvc.js} +2 -2
- package/dist/assets/{Agents.production-BeOZmzaF.js → Agents.production-DTopo7XB.js} +2 -2
- package/dist/assets/{AnimatedDialogContent-CWshmxP2.js → AnimatedDialogContent-CDLfw-dJ.js} +1 -1
- package/dist/assets/{AppDetail-DbqENTF_.js → AppDetail-BcWBg5yW.js} +1 -1
- package/dist/assets/{AppNotConnected-BhnCqL0F.js → AppNotConnected-NgfyHZ4L.js} +1 -1
- package/dist/assets/{ApprovalDetail-B2KiYLTj.js → ApprovalDetail-Dm_1V4tC.js} +1 -1
- package/dist/assets/{Approvals-j-wRmqKj.js → Approvals-i5AB3JPj.js} +1 -1
- package/dist/assets/{AppsConnect-CcPVEZ0C.js → AppsConnect-D660Tpuo.js} +1 -1
- package/dist/assets/{AppsReview-B8eWvKkS.js → AppsReview-DdTqOisY.js} +1 -1
- package/dist/assets/{ArtifactEmptyGraphic-5mdkS5jj.js → ArtifactEmptyGraphic-DzxCruYA.js} +1 -1
- package/dist/assets/{Artifacts-Bz7Oo6VX.js → Artifacts-CkXBz6nh.js} +1 -1
- package/dist/assets/{AssigneePickerInner-DdpF7hck.js → AssigneePickerInner-BNjyABBe.js} +1 -1
- package/dist/assets/{AssistantConnection-BpaaJDc_.js → AssistantConnection-CNF6mDmO.js} +1 -1
- package/dist/assets/{AttentionInlineVerbs-DlPQVCO-.js → AttentionInlineVerbs-BiyZ1ekZ.js} +1 -1
- package/dist/assets/{AttentionQueueRow-BC6ezctS.js → AttentionQueueRow-Bh0dKHpF.js} +1 -1
- package/dist/assets/{AuditHub-BVP7LKL9.js → AuditHub-BK848cb4.js} +1 -1
- package/dist/assets/{AuditRuns-DqizHgX1.js → AuditRuns-CUdlbP7S.js} +1 -1
- package/dist/assets/{Auth-DOF0snjp.js → Auth-DDqxm5gD.js} +1 -1
- package/dist/assets/{BoardChat-BYAbDtfd.js → BoardChat-fvKqk0R7.js} +1 -1
- package/dist/assets/{BoardClaim-7y41Pr8e.js → BoardClaim-BEC5BZfz.js} +1 -1
- package/dist/assets/{BootstrapSetupUxLab-BftH1vOv.js → BootstrapSetupUxLab-CXzErrin.js} +1 -1
- package/dist/assets/{Browse-Ck01W1Yl.js → Browse-DoovSMuF.js} +1 -1
- package/dist/assets/{BudgetPolicyCard-CKhrzfgy.js → BudgetPolicyCard-BYMlczCq.js} +1 -1
- package/dist/assets/{CaseDetail-qlXKJ66D.js → CaseDetail-UMAcSH_x.js} +1 -1
- package/dist/assets/{CaseStatus-B3RiZVDH.js → CaseStatus-BI0aMl9l.js} +1 -1
- package/dist/assets/{Cases-CFV3V-5X.js → Cases-CMTkGghU.js} +1 -1
- package/dist/assets/{ChatEndpointDetail-7Hi5TJNt.js → ChatEndpointDetail-CocNEInH.js} +1 -1
- package/dist/assets/{ChatEndpointSetup-CtwgH6sg.js → ChatEndpointSetup-Cyi2tI9K.js} +1 -1
- package/dist/assets/{ChatIdentityConfirm-CXjksBwX.js → ChatIdentityConfirm-Ba3JuTX1.js} +1 -1
- package/dist/assets/{CliAuth-KVjrGMfZ.js → CliAuth-D2jnueGH.js} +1 -1
- package/dist/assets/{Companies-oeJem3De.js → Companies-K75I9dJs.js} +1 -1
- package/dist/assets/{CompanyAccess-vWT6G-n_.js → CompanyAccess-Cw6nLUhE.js} +1 -1
- package/dist/assets/{CompanyActivity-zOzzeN1B.js → CompanyActivity-BsgmVpWS.js} +1 -1
- package/dist/assets/CompanyActivity.production-w-KGxvo6.js +1 -0
- package/dist/assets/{CompanyConnections-llSEaVa2.js → CompanyConnections-yRPYSdm7.js} +1 -1
- package/dist/assets/{CompanyEnvironments-DNyyGC_S.js → CompanyEnvironments-BA7kWdOJ.js} +1 -1
- package/dist/assets/{CompanyExport-CFa-F8Es.js → CompanyExport-DfsK4b9c.js} +1 -1
- package/dist/assets/{CompanyImport-DG6qwQ8F.js → CompanyImport-DJHAsmSF.js} +1 -1
- package/dist/assets/{CompanySettings-Dv5Z3ZQi.js → CompanySettings-DwzHGXec.js} +1 -1
- package/dist/assets/{CompanySettingsPluginPage-CZk1d_0d.js → CompanySettingsPluginPage-Bpa81PF3.js} +1 -1
- package/dist/assets/{CompanySkills-CdzWhJfQ.js → CompanySkills-eTqgbqQN.js} +1 -1
- package/dist/assets/{CompanySkills.production-IoCRW5FQ.js → CompanySkills.production-CQSWfH0r.js} +1 -1
- package/dist/assets/{ConfigureBuiltInAgentModal-BwW7XQ1O.js → ConfigureBuiltInAgentModal-DgeD7t_i.js} +1 -1
- package/dist/assets/{CopyableGatewayUrl-PTn061ft.js → CopyableGatewayUrl-B6K3rOal.js} +1 -1
- package/dist/assets/{CordisPluginSettings-C_BeeGEc.js → CordisPluginSettings-DD3AnD2G.js} +1 -1
- package/dist/assets/{Costs-DhuNxwSj.js → Costs-orBM8T-a.js} +1 -1
- package/dist/assets/{CrossIssueCollaborationUxLab-ZaAXq46r.js → CrossIssueCollaborationUxLab-Bv9y9-NE.js} +1 -1
- package/dist/assets/{Dashboard-BaDnqiKo.js → Dashboard-CrSBNKX1.js} +1 -1
- package/dist/assets/{DashboardLive-D-Ed7osd.js → DashboardLive-Cg8C9RiS.js} +1 -1
- package/dist/assets/{DecisionDateChips-D3pl_mLn.js → DecisionDateChips-BLZKZH71.js} +1 -1
- package/dist/assets/{DecisionHistoryPanel-D5MzyrOh.js → DecisionHistoryPanel-yK-CP7Qg.js} +1 -1
- package/dist/assets/{DecisionQueuePage-D3UZ9oRk.js → DecisionQueuePage-BKXbERai.js} +1 -1
- package/dist/assets/{DesignGuide-COTo7ICj.js → DesignGuide-2FswNsXz.js} +1 -1
- package/dist/assets/{DesignSandboxTaskThread-CMeCSQid.js → DesignSandboxTaskThread-CGU--FXR.js} +1 -1
- package/dist/assets/{EmailConnectionAccess-kCL7obSr.js → EmailConnectionAccess-CZ5QRKyg.js} +1 -1
- package/dist/assets/{EmailEndpointSetup-BGrksR_u.js → EmailEndpointSetup-BI2vsd8Y.js} +1 -1
- package/dist/assets/{EnforcementBanner-_Eb_nK3M.js → EnforcementBanner-B-iX466h.js} +1 -1
- package/dist/assets/{EntityRow-gpsOgEtu.js → EntityRow-BsICt6pd.js} +1 -1
- package/dist/assets/{ExecutionWorkspaceDetail-DwGkH6d3.js → ExecutionWorkspaceDetail-CMqR9puh.js} +1 -1
- package/dist/assets/{ExternalAgentInviteDialog-CGid6pM9.js → ExternalAgentInviteDialog-De30ZrLP.js} +1 -1
- package/dist/assets/{FilterBar-1D-VhrvG.js → FilterBar-rCmsTtG4.js} +1 -1
- package/dist/assets/{FolderControls-CQ6kef3c.js → FolderControls-CmnB7Ap-.js} +1 -1
- package/dist/assets/{GatewayDetail-CCqekM1J.js → GatewayDetail-Duw9pJ10.js} +1 -1
- package/dist/assets/{GatewaysList-nFsRcszh.js → GatewaysList-BBhVGhRq.js} +1 -1
- package/dist/assets/{GitHubConnectionRecovery-B9sFWJup.js → GitHubConnectionRecovery-6VshLoNV.js} +1 -1
- package/dist/assets/{GoalDetail-BQ8y55P-.js → GoalDetail-CahntjlI.js} +1 -1
- package/dist/assets/{GoalTree-laRjXp0P.js → GoalTree-CU4GBFCh.js} +1 -1
- package/dist/assets/{Goals-Cm14EaeP.js → Goals-CzM2NDFR.js} +1 -1
- package/dist/assets/{InstanceAccess-DxQ-Akt_.js → InstanceAccess-CZzkE65W.js} +1 -1
- package/dist/assets/{InstanceExperimentalSettings-BxwqbXNw.js → InstanceExperimentalSettings-DWumKtOK.js} +1 -1
- package/dist/assets/{InviteLanding-Cf0L_u6s.js → InviteLanding-BIy2z50u.js} +1 -1
- package/dist/assets/{IssueChatLongThreadPerf-BfsF6FdF.js → IssueChatLongThreadPerf-D4DJvdOG.js} +1 -1
- package/dist/assets/{JoinRequestQueue-BXCdTFG_.js → JoinRequestQueue-C5rauGYm.js} +1 -1
- package/dist/assets/{Layout.production-CqzU0qMi.js → Layout.production-BSDWnupa.js} +1 -1
- package/dist/assets/{McpConnect-COWnZ9Eb.js → McpConnect-BN8ST0RS.js} +1 -1
- package/dist/assets/{MembershipAction-C9i9Sdmi.js → MembershipAction-DTjhGn-L.js} +1 -1
- package/dist/assets/{MetricCard-Bwnt3_p3.js → MetricCard-CeL9Pdn5.js} +1 -1
- package/dist/assets/{MissingPluginTabPlaceholder-B0Zxv1Kx.js → MissingPluginTabPlaceholder-CbQiSVnZ.js} +1 -1
- package/dist/assets/{NewAgent-BIlJ5Dyt.js → NewAgent-BszrNpQk.js} +1 -1
- package/dist/assets/{NewAgentDialog-CJdMxxYL.js → NewAgentDialog-U9qAcTzc.js} +1 -1
- package/dist/assets/{NewGoalDialog-B8izfKLm.js → NewGoalDialog-DqKbk4-i.js} +1 -1
- package/dist/assets/{NewProjectDialog-DXqjTYFK.js → NewProjectDialog-DrlUAF-N.js} +1 -1
- package/dist/assets/{OnboardingPrimitives-DHYBqn_0.js → OnboardingPrimitives-BkgPF4Mu.js} +1 -1
- package/dist/assets/{OnboardingWizard-DqSfZ13V.js → OnboardingWizard-CMBMcuXv.js} +1 -1
- package/dist/assets/{OrgChart.production-DrSFUf7i.js → OrgChart.production-BLczTjRj.js} +1 -1
- package/dist/assets/{PaperclipCloudOAuthHandoff-jPUvjJ8q.js → PaperclipCloudOAuthHandoff-BTtF8UPD.js} +1 -1
- package/dist/assets/{PluginManager-h3LFPaUq.js → PluginManager-CCcqlfgK.js} +1 -1
- package/dist/assets/{PluginPage-E5Im4454.js → PluginPage-B1empV69.js} +1 -1
- package/dist/assets/{PluginSettings-BBO0jAgo.js → PluginSettings-DtopaRqR.js} +1 -1
- package/dist/assets/{ProfileDetailRoute-CQBD7fms.js → ProfileDetailRoute-BqvVpBZi.js} +1 -1
- package/dist/assets/{ProfileSettings-BwnVEHLp.js → ProfileSettings-5__tVfGi.js} +1 -1
- package/dist/assets/{ProfileWizardRoute-By_SC6Gn.js → ProfileWizardRoute-vt-MRLuD.js} +1 -1
- package/dist/assets/{ProjectDetail-CbiwFBAE.js → ProjectDetail-DJ4zjube.js} +1 -1
- package/dist/assets/{ProjectRepositoryInput-DZF9bX4E.js → ProjectRepositoryInput-BJcnj3At.js} +1 -1
- package/dist/assets/{ProjectWorkspaceDetail-DPsl_4bD.js → ProjectWorkspaceDetail-DEAO3q6v.js} +1 -1
- package/dist/assets/{ProjectWorkspacesContent-COH4dOWK.js → ProjectWorkspacesContent-CZvO7p0i.js} +1 -1
- package/dist/assets/{Projects-Ch9Qu7sn.js → Projects-Dm7-zXUH.js} +1 -1
- package/dist/assets/{QuotaBar-DIFOT9Uh.js → QuotaBar-Drp3CaxX.js} +1 -1
- package/dist/assets/{RepositoryEditor-DHB1bqId.js → RepositoryEditor-BT_VAkJu.js} +1 -1
- package/dist/assets/{Responsibilities-C5O0JXXG.js → Responsibilities-DbUEtGZu.js} +1 -1
- package/dist/assets/{ResponsibilityDetail-D6NpZpkm.js → ResponsibilityDetail--S8_GOkb.js} +1 -1
- package/dist/assets/{ResponsibleUserDenialUxLab-CFrIWYwe.js → ResponsibleUserDenialUxLab-1PB3JNG0.js} +1 -1
- package/dist/assets/{ReviewQueueCard-BPC4Lm67.js → ReviewQueueCard-B8w9aXKU.js} +1 -1
- package/dist/assets/{RoutineAuditActivity-sKyzMajz.js → RoutineAuditActivity-BCo7pYe5.js} +1 -1
- package/dist/assets/{RoutineDetail-CG8HF5fp.js → RoutineDetail-C9Dwn5G9.js} +1 -1
- package/dist/assets/{RoutineRunVariablesDialog-CKh3CmLD.js → RoutineRunVariablesDialog-Baomcbe3.js} +1 -1
- package/dist/assets/{Routines-tF2qfUKo.js → Routines-Dkv4gJno.js} +1 -1
- package/dist/assets/{Routines.production-BTyj1Ljr.js → Routines.production-Cs2Y-lpt.js} +1 -1
- package/dist/assets/{RoutinesToolbar-CvUFVCGN.js → RoutinesToolbar-BNKfCrTo.js} +1 -1
- package/dist/assets/{Search-Z9D0NuS1.js → Search-CVx4cl2o.js} +1 -1
- package/dist/assets/{Secrets-DgmbLOJK.js → Secrets-C2qv2HKZ.js} +1 -1
- package/dist/assets/{SkillBinaryFile-F3_9qcaM.js → SkillBinaryFile-DDkhLlfC.js} +1 -1
- package/dist/assets/{SkillCardIcon-CXHUCMej.js → SkillCardIcon-Cp_hws0N.js} +1 -1
- package/dist/assets/{SkillFolderTree-CB3lrTIE.js → SkillFolderTree-Cv0CmfYx.js} +1 -1
- package/dist/assets/{SkillSourceTree-BbuciCo6.js → SkillSourceTree-DmjlUswf.js} +1 -1
- package/dist/assets/{SkillSources-Dlo6Cew3.js → SkillSources-nmlYypUU.js} +1 -1
- package/dist/assets/{SkillStudio-ZO-Nf7eI.js → SkillStudio-BK3y_3zr.js} +1 -1
- package/dist/assets/{SkillsNavigationTabs-B9Iqnlqt.js → SkillsNavigationTabs-DRwMP1eu.js} +1 -1
- package/dist/assets/{SpekoPhoneCallback-C4VnMiZh.js → SpekoPhoneCallback-Cqi7AIyH.js} +1 -1
- package/dist/assets/{SpekoProviderSetup-I4evPZb3.js → SpekoProviderSetup-CJI4oXk5.js} +1 -1
- package/dist/assets/{StatusCards-D0MVzbsw.js → StatusCards-DKyyY81S.js} +1 -1
- package/dist/assets/{SummarySlotCard-DUXgZPxG.js → SummarySlotCard-f3RomdZS.js} +1 -1
- package/dist/assets/{TailscaleConnector-CMhT73gj.js → TailscaleConnector-yQWLR1Ra.js} +1 -1
- package/dist/assets/{TaskChatLab-D9-KAE-7.js → TaskChatLab-Dsr7eyj4.js} +1 -1
- package/dist/assets/{TaskSummaryList-CUxieFNe.js → TaskSummaryList-eFDfK_QH.js} +1 -1
- package/dist/assets/{Timeline-BNMoRbtK.js → Timeline-BWA9dyk6.js} +1 -1
- package/dist/assets/{ToolsAdminGate-CEr0zy2T.js → ToolsAdminGate-DpBg30hQ.js} +1 -1
- package/dist/assets/{TrustPresetSection-B9YXZtkh.js → TrustPresetSection-DtWjK9Kp.js} +1 -1
- package/dist/assets/{UserProfile-D-tnW96X.js → UserProfile-C66UI5xx.js} +1 -1
- package/dist/assets/{WebhookUrlWarning-Ba_DixKh.js → WebhookUrlWarning-CDygVnDH.js} +1 -1
- package/dist/assets/{WhatNeedsMe-B-Jzj8_M.js → WhatNeedsMe-BQ82RHus.js} +1 -1
- package/dist/assets/{Workspaces-BqhDI_Bl.js → Workspaces-DrjJes30.js} +1 -1
- package/dist/assets/{abnfDiagram-YUKMZFIV-Bn9P-nUW.js → abnfDiagram-YUKMZFIV-Crkksu2D.js} +1 -1
- package/dist/assets/{architecture-WOLXFQ4H-V1ldsZlt.js → architecture-WOLXFQ4H-bHU8FW0c.js} +1 -1
- package/dist/assets/{architectureDiagram-47P4ROYG-BkYxt-Gc.js → architectureDiagram-47P4ROYG-Bj5Styf9.js} +1 -1
- package/dist/assets/{arrow-down-left-o81ENfeW.js → arrow-down-left-Ck9VQyqQ.js} +1 -1
- package/dist/assets/{blockDiagram-E7TT5TSB-BO7pPYbp.js → blockDiagram-E7TT5TSB-OeHpNCQ-.js} +1 -1
- package/dist/assets/{budgets-0Dw6TH1A.js → budgets-CAWPqcn4.js} +1 -1
- package/dist/assets/{building-complex-DciZTnys.js → building-complex-Dxiyk_pH.js} +1 -1
- package/dist/assets/{c4Diagram-CRA5TL53-D4EpmmzV.js → c4Diagram-CRA5TL53-QbK5p76P.js} +1 -1
- package/dist/assets/channel-BSmZkKA8.js +1 -0
- package/dist/assets/{chat-channels-DWyry-9M.js → chat-channels-CzTZV2fr.js} +1 -1
- package/dist/assets/{chunk-2BW5OAIV-DFXIyCJy.js → chunk-2BW5OAIV-Ckr4HfBO.js} +1 -1
- package/dist/assets/{chunk-3YJQHVM4-Dj5wEKIw.js → chunk-3YJQHVM4-C_uoPpLR.js} +1 -1
- package/dist/assets/{chunk-4EA7E6EY-5XiUVgzK.js → chunk-4EA7E6EY-BeMEfIRS.js} +1 -1
- package/dist/assets/{chunk-7TKQ45FW-D0opKcsy.js → chunk-7TKQ45FW-DiwqWHvN.js} +1 -1
- package/dist/assets/{chunk-AW2ZBBNX-DnjsTe04.js → chunk-AW2ZBBNX-Cf57K3PO.js} +1 -1
- package/dist/assets/{chunk-DBDB3WZW-DNqSQPZ0.js → chunk-DBDB3WZW-B2qouVQO.js} +1 -1
- package/dist/assets/{chunk-E2ZNV5FY-cjSf_BTz.js → chunk-E2ZNV5FY-DG8wQ_NS.js} +1 -1
- package/dist/assets/{chunk-EU5HNXII-CZYBiaSw.js → chunk-EU5HNXII-cxRrXRGV.js} +1 -1
- package/dist/assets/{chunk-FVRAUYC3-DSc0-wJA.js → chunk-FVRAUYC3-Dizswk0V.js} +1 -1
- package/dist/assets/{chunk-HJ2JQQFS-MXK0gYSP.js → chunk-HJ2JQQFS-DL4lnpSv.js} +1 -1
- package/dist/assets/{chunk-HTAEGDNF-BjDZm_5k.js → chunk-HTAEGDNF-Zxjdb6kj.js} +1 -1
- package/dist/assets/{chunk-KQW6MTUR-Bfj0tDmO.js → chunk-KQW6MTUR-BsVaJdnu.js} +1 -1
- package/dist/assets/{chunk-NTY3LDVX-Bpz5TkVb.js → chunk-NTY3LDVX-DyT9N5sM.js} +1 -1
- package/dist/assets/{chunk-VPRB5NB3-CfeHjtbb.js → chunk-VPRB5NB3-BNz5CtBn.js} +1 -1
- package/dist/assets/{chunk-XC4XBNZT-FBCWmi6K.js → chunk-XC4XBNZT-CCgIhjYS.js} +1 -1
- package/dist/assets/{circle-slash-DqKFFqfb.js → circle-slash-uNv_ha0X.js} +1 -1
- package/dist/assets/{classDiagram-v2-K4WV4PDN-DbC_J0kK.js → classDiagram-v2-K4WV4PDN-Cdh3CEl4.js} +1 -1
- package/dist/assets/{coins-BztUbqyl.js → coins-BDAh8hDQ.js} +1 -1
- package/dist/assets/{collections-BxrcELwt.js → collections-B58p51lw.js} +1 -1
- package/dist/assets/{connection-owner-D-ikSHyR.js → connection-owner-D8fNrFqC.js} +1 -1
- package/dist/assets/{cynefin-EF2NZ3EQ-COwSJ4qP.js → cynefin-EF2NZ3EQ-BkwhfqJ0.js} +1 -1
- package/dist/assets/{cynefinDiagram-3GCD6N5R-diaEJq9Y.js → cynefinDiagram-3GCD6N5R-DuGb_wq2.js} +1 -1
- package/dist/assets/{dagre-W4DXFKR2-BPAMRuIj.js → dagre-W4DXFKR2-Bxq_Mhia.js} +1 -1
- package/dist/assets/{diagram-2UJZ2QOL-BvRnO1Id.js → diagram-2UJZ2QOL-B-P_hrXV.js} +1 -1
- package/dist/assets/{diagram-OVF4WLC6-CDgBeD0m.js → diagram-OVF4WLC6-Ds0BqQWH.js} +1 -1
- package/dist/assets/{diagram-PFPMY2P6-DAw9lREG.js → diagram-PFPMY2P6-Dpqb2-Cb.js} +1 -1
- package/dist/assets/{diagram-UMYRVEAY-ZQqQn22t.js → diagram-UMYRVEAY-BJSoxjiu.js} +1 -1
- package/dist/assets/{diagram-YEKJPTXX-CoJtGgWs.js → diagram-YEKJPTXX-BxaG_9tT.js} +1 -1
- package/dist/assets/{diagram-ZIFT7M5P-qW_Zn_bO.js → diagram-ZIFT7M5P-6acvVOtc.js} +1 -1
- package/dist/assets/{dist-B2E6oBK1.js → dist-0EWXio4m.js} +1 -1
- package/dist/assets/{dist-IcdxEhjC.js → dist-BGvZP_Cl.js} +1 -1
- package/dist/assets/{dist-DXjkgaZX.js → dist-BZ7AbEhN.js} +1 -1
- package/dist/assets/{dist-_EtfntKJ.js → dist-BlosHr86.js} +1 -1
- package/dist/assets/{dist-DylHAy-6.js → dist-Bmr4uhSk.js} +1 -1
- package/dist/assets/{dist-DML0cJH3.js → dist-C6yMfMNS.js} +1 -1
- package/dist/assets/{dist-Dl94YqeS.js → dist-CMZQedYl.js} +1 -1
- package/dist/assets/{dist-DKyBHaH2.js → dist-C_N_-eaT.js} +1 -1
- package/dist/assets/{dist-CvRpZH53.js → dist-CaUbG4Hl.js} +1 -1
- package/dist/assets/{dist-ptDa9fKh.js → dist-Cn7-nxjU.js} +1 -1
- package/dist/assets/{dist-CG-phytt.js → dist-Cnj95_pX.js} +1 -1
- package/dist/assets/{dist-DbXGl-wj.js → dist-D9DR7k9k.js} +1 -1
- package/dist/assets/{dist-CjRqeLFz.js → dist-DIwsVdS2.js} +1 -1
- package/dist/assets/{dist-BCJybC91.js → dist-DVE0lLId.js} +1 -1
- package/dist/assets/{dist-CPgRB-NQ.js → dist-DkAPL4CQ.js} +1 -1
- package/dist/assets/{dist-CeSzCyeG.js → dist-Dl6N3kpQ.js} +1 -1
- package/dist/assets/{dist-DZruZxAk.js → dist-DmBvXBzK.js} +1 -1
- package/dist/assets/{dist-CdmdXwCZ.js → dist-DpgXK0aZ.js} +1 -1
- package/dist/assets/{dist-CYRzGbSY.js → dist-gMRyU9GJ.js} +1 -1
- package/dist/assets/{dist-CG6fC1Db.js → dist-jQQX2kOU.js} +1 -1
- package/dist/assets/{dist-DZIxMHOT.js → dist-lUaUoFTq.js} +1 -1
- package/dist/assets/{dist-CuwPDbnL.js → dist-qw1ZF2vD.js} +1 -1
- package/dist/assets/{dist-B6Qde8KJ.js → dist-rH4qrNAn.js} +1 -1
- package/dist/assets/{ebnfDiagram-VR2GEFS7-DA4UvKXV.js → ebnfDiagram-VR2GEFS7-Ytj3Z5qC.js} +1 -1
- package/dist/assets/{elk-IJKZMXRS-CM74d3mJ.js → elk-IJKZMXRS-CJurNqqK.js} +1 -1
- package/dist/assets/{erDiagram-O2IAPWRE-d869V0qL.js → erDiagram-O2IAPWRE-hyXckW2d.js} +1 -1
- package/dist/assets/{eventmodeling-K75KTNOO-C-oz_eyI.js → eventmodeling-K75KTNOO-D3xQujrh.js} +1 -1
- package/dist/assets/flowDiagram-OXPTDLAJ-D4ojBTuY.js +1 -0
- package/dist/assets/{folder-plus-CxWXoYCi.js → folder-plus-BJZSMzuj.js} +1 -1
- package/dist/assets/{ganttDiagram-R7TSEDQI-BBul4Kpm.js → ganttDiagram-R7TSEDQI-C8U_ITl4.js} +1 -1
- package/dist/assets/{gitGraph-VSP46ZUC-BriEZgAq.js → gitGraph-VSP46ZUC-CDeq3yKT.js} +1 -1
- package/dist/assets/{gitGraphDiagram-XJZIOB7I-I12rg8s1.js → gitGraphDiagram-XJZIOB7I-CST3EWE9.js} +1 -1
- package/dist/assets/{goals-CvMWzjH4.js → goals-BNJZ4nzg.js} +1 -1
- package/dist/assets/{index-Bt31d8ga.js → index-BJtnP7H1.js} +8 -8
- package/dist/assets/{info-OHQRW6UA-CxrcGiem.js → info-OHQRW6UA-CPvTWk7J.js} +1 -1
- package/dist/assets/{infoDiagram-5W2HQ5XZ-4Sm0LiOu.js → infoDiagram-5W2HQ5XZ-BPUiNdxI.js} +1 -1
- package/dist/assets/{ishikawaDiagram-K3B6WC7H-CKXvKV-s.js → ishikawaDiagram-K3B6WC7H-D5Z3rmaA.js} +1 -1
- package/dist/assets/{issue-detail-4PCbYpdv.js → issue-detail-CZfjXs0M.js} +3 -3
- package/dist/assets/{journeyDiagram-COXZFDF6-BHsrZLvQ.js → journeyDiagram-COXZFDF6-CEkwEYdR.js} +1 -1
- package/dist/assets/{kanban-definition-P3RFRI5V-8HhnIs_l.js → kanban-definition-P3RFRI5V-8h_R6Qjq.js} +1 -1
- package/dist/assets/{line-rrKrpB-b.js → line-Ljt_vfsb.js} +1 -1
- package/dist/assets/{link-BecLzmfo.js → link-DvgFK0mz.js} +1 -1
- package/dist/assets/{list-filter-BC3D4IoX.js → list-filter-BR4_dvwm.js} +1 -1
- package/dist/assets/{log-in-BJCGwGGT.js → log-in-Dvx9-FMC.js} +1 -1
- package/dist/assets/{mcpSkills-DRs3pGKn.js → mcpSkills-76szK_k1.js} +1 -1
- package/dist/assets/{mermaid-parser.core-DmG0b4S0.js → mermaid-parser.core-BjFu937m.js} +3 -3
- package/dist/assets/{mermaid.core-D1vILTuF.js → mermaid.core-B0t95EIS.js} +4 -4
- package/dist/assets/{mindmap-definition-LZFPQGKD-DIMpL0de.js → mindmap-definition-LZFPQGKD-TVnHYUR4.js} +1 -1
- package/dist/assets/{packet-JDAUHWVQ-BnbYht3G.js → packet-JDAUHWVQ-aNGiRWLy.js} +1 -1
- package/dist/assets/{pegDiagram-BGZESJAR-BUjtJVjT.js → pegDiagram-BGZESJAR-DDadxqWQ.js} +1 -1
- package/dist/assets/{pie-XZMESJXO-CM4VXUb-.js → pie-XZMESJXO-CydFP1hd.js} +1 -1
- package/dist/assets/{pieDiagram-CAPJLFHJ-B3v8ryvG.js → pieDiagram-CAPJLFHJ-KhdUDwDS.js} +1 -1
- package/dist/assets/{power-0mw59G-l.js → power-sYV-WuqQ.js} +1 -1
- package/dist/assets/{profile-summary-B5rPf8v-.js → profile-summary-D4LPX-Dv.js} +1 -1
- package/dist/assets/{quadrantDiagram-GDMTTRAM-Cv-dS2Rn.js → quadrantDiagram-GDMTTRAM-B1X8K2Fs.js} +1 -1
- package/dist/assets/{radar-ABXABTNO-v6yZj4Fk.js → radar-ABXABTNO-BqodkLpx.js} +1 -1
- package/dist/assets/{railroad-I3PHUGI6-D-U8Cs0m.js → railroad-I3PHUGI6-HmRKXDJj.js} +1 -1
- package/dist/assets/{railroad-abnf-LNEFI6M7-Dw3fkrVy.js → railroad-abnf-LNEFI6M7-CkBttaHp.js} +1 -1
- package/dist/assets/{railroad-ebnf-DWYD2UWJ-_ln-e3Tx.js → railroad-ebnf-DWYD2UWJ-C6DBawFA.js} +1 -1
- package/dist/assets/{railroad-peg-JR7BVNR7-Bf8u1-RZ.js → railroad-peg-JR7BVNR7-Z9df3u5o.js} +1 -1
- package/dist/assets/{railroadDiagram-SM67HX2B-Drr5UhQI.js → railroadDiagram-SM67HX2B-2vDUUppL.js} +1 -1
- package/dist/assets/{requirementDiagram-X7JNWC4A-D5ef6_ac.js → requirementDiagram-X7JNWC4A-DAuP39Hc.js} +1 -1
- package/dist/assets/{sankeyDiagram-UM26HJRW-DncJWIz_.js → sankeyDiagram-UM26HJRW-ByS54QZK.js} +1 -1
- package/dist/assets/{saved-permissions-CizWg8-P.js → saved-permissions-CPiYtxkZ.js} +1 -1
- package/dist/assets/{scroll-text-Ck6HB7eM.js → scroll-text-CVSt6aO2.js} +1 -1
- package/dist/assets/{sdk-CWyUlmcn.js → sdk-vrG4HtB4.js} +1 -1
- package/dist/assets/{search-DkTqg7ab.js → search-CG-QtPVH.js} +1 -1
- package/dist/assets/{send-CYVi50sh.js → send-CH-0xdLm.js} +1 -1
- package/dist/assets/{sequenceDiagram-ZO4K6R2Y-Cs0nGCCg.js → sequenceDiagram-ZO4K6R2Y-DvWxKTLK.js} +1 -1
- package/dist/assets/{shared-CIwISWMj.js → shared-D37zfckm.js} +1 -1
- package/dist/assets/{smoke-lab-matrix-A7ubFpfk.js → smoke-lab-matrix-C5gR81E3.js} +1 -1
- package/dist/assets/{stateDiagram-v2-TBUQTH76-Dpp3m5Wq.js → stateDiagram-v2-TBUQTH76-DtiiZIXq.js} +1 -1
- package/dist/assets/{swimlanes-N4OXWK64-NXVbx1w8.js → swimlanes-N4OXWK64-BWSEtCbX.js} +1 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-Bl_9DvHU.js +8 -0
- package/dist/assets/{timeline-definition-YOQAKGHF-DqI-Mv2e.js → timeline-definition-YOQAKGHF-U4QcniMh.js} +1 -1
- package/dist/assets/{treeView-D4JQ5SDB-CZBlE7ya.js → treeView-D4JQ5SDB-B2tdrtsj.js} +1 -1
- package/dist/assets/{treemap-SAJKECNS-BlueznID.js → treemap-SAJKECNS-DodN8j4n.js} +1 -1
- package/dist/assets/{useAgentlessOnboardingAutoOpen-CnFwEQ-H.js → useAgentlessOnboardingAutoOpen-DSWW7Juw.js} +1 -1
- package/dist/assets/{useAuthorizationWindow-DnFQsiFj.js → useAuthorizationWindow-tg3aKEU7.js} +1 -1
- package/dist/assets/{useDateRange-9EbqkWXy.js → useDateRange-CnZQr2KO.js} +1 -1
- package/dist/assets/{useFastResponsesEnabled-D8dunm4j.js → useFastResponsesEnabled-B8tHSJ1y.js} +1 -1
- package/dist/assets/{usePageView-BiX5i8ck.js → usePageView-CtFMs34g.js} +1 -1
- package/dist/assets/{useProfilesData-0VYQ4lAT.js → useProfilesData-CWHdMSuL.js} +1 -1
- package/dist/assets/{useReviewCount-WBWxwKI3.js → useReviewCount-W_bCZ2Hz.js} +1 -1
- package/dist/assets/{useRoutineFormOptions-DnX5DBn1.js → useRoutineFormOptions-CCLMmVSF.js} +1 -1
- package/dist/assets/{useSummaryDraftStream-DPQRvaXT.js → useSummaryDraftStream-NVNYNt72.js} +1 -1
- package/dist/assets/{useTailscaleConnections-BDff6dWx.js → useTailscaleConnections-Dy52nCY3.js} +1 -1
- package/dist/assets/{usecaseDiagram-VIAY4XPW-BSDn8OaJ.js → usecaseDiagram-VIAY4XPW-kEHhqgOj.js} +1 -1
- package/dist/assets/{vennDiagram-BLWOH2XV-BBSA9KNN.js → vennDiagram-BLWOH2XV-NPJU0aCU.js} +1 -1
- package/dist/assets/{wardley-7MLQ67FV-CsT-rTZ9.js → wardley-7MLQ67FV-bUGKvIPT.js} +1 -1
- package/dist/assets/{wardleyDiagram-YMQ3BMBF-BLClsIjw.js → wardleyDiagram-YMQ3BMBF-qtUDHfhb.js} +1 -1
- package/dist/assets/{xychartDiagram-TAQBALBS-2x4wB0gq.js → xychartDiagram-TAQBALBS-C-z57aZj.js} +1 -1
- package/dist/index.html +4 -4
- package/dist/sw.js +1 -1
- package/package.json +1 -1
- package/dist/assets/CompanyActivity.production-DbaFBsM0.js +0 -1
- package/dist/assets/channel-BQh2vFIU.js +0 -1
- package/dist/assets/flowDiagram-OXPTDLAJ-Be1xLbJu.js +0 -1
- package/dist/assets/swimlanesDiagram-K3J5GTZL-Ct3LnXZt.js +0 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var Ge=Object.defineProperty;var t=(s,a)=>Ge(s,"name",{value:a,configurable:!0});import{a as ve}from"./rolldown-runtime-DhZMWcEn.js";import{vi as Oe,yi as Fe}from"./issue-detail-4PCbYpdv.js";import{C as Le,b as Qe}from"./collections-BxrcELwt.js";import{t as Ke}from"./link-BecLzmfo.js";import{t as Ue}from"./send-CYVi50sh.js";import{$A as Be,$S as H,AT as He,B_ as Ve,CC as We,Ep as Je,Ew as Ye,GS as J,Gb as Y,Jp as P,LS as Ze,ME as Z,MT as Xe,NE as c,OT as es,RT as ss,VS as ts,V_ as as,XC as ns,Yb as Ne,__ as U,aE as rs,ab as we,bE as F,cT as L,dy as ke,eC as os,fy as Ce,hE as $,ib as is,jT as Te,kT as Ae,ly as Se,mb as B,my as Pe,nj as ls,nw as ds,qC as cs,qb as us,qp as ae,rb as ms,sv as W,sy as _e,ub as Ee,uy as Ie,vT as xs,vb as hs,vm as ps,xE as K,x_ as fs,xb as gs,yb as bs,zE as A,z_ as js}from"./index-Bt31d8ga.js";import{a as O}from"./shared-CIwISWMj.js";import{_ as ys,a as vs,b as he,c as Ns,d as ws,f as De,g as ks,h as R,i as Cs,l as Ts,o as ue,p as Me,r as V,s as ze,t as As,u as pe,v as te,x as Ss,y as Ps}from"./CopyableGatewayUrl-PTn061ft.js";var l=ve(ls(),1),e=ve(Be(),1),_s={cursor:ds,claude_desktop:ss,vscode:Oe,claude_code:We,opencode:Fe};function Es({gateway:s,open:a,onOpenChange:r,createdTokens:m,onTokenCreated:u}){const i=Z(),{pushToast:j}=W(),x=(0,l.useMemo)(()=>ks(s.clientSnippets??[]),[s.clientSnippets]),y=(0,l.useMemo)(()=>`${typeof window<"u"?window.location.origin:""}${s.endpointPath}`,[s.endpointPath]),f=(0,l.useMemo)(()=>m.filter(o=>{const C=s.tokens.find(G=>G.id===o.id),I=te(C??o);return I==="active"||I==="expiring"}),[m,s.tokens]),w=(0,l.useMemo)(()=>[{id:"tokens",label:"Available this session",options:f.map(o=>({key:o.id,value:o.id,label:o.name,title:o.clientLabel,searchText:`${o.name} ${o.clientLabel} ${o.tokenPrefix}`,token:o}))}],[f]),[g,k]=(0,l.useState)(x[0]?.client??"raw_url"),[p,N]=(0,l.useState)(""),b=f.find(o=>o.id===p)??null;(0,l.useEffect)(()=>{a&&(k(x[0]?.client??"raw_url"),N(o=>f.some(C=>C.id===o)?o:f[0]?.id??""))},[f,a,x]);const d=F({mutationFn:t(()=>{const o=ze(s);return P.createGatewayToken(s.companyId,s.id,{name:o,clientLabel:o,ownerNote:"",allowedActions:["tools/list","tools/call"],expiresAt:new Date(Date.now()+7776e6).toISOString()})},"mutationFn"),onSuccess:t(async o=>{u(o),N(o.id),j({title:"Token issued",body:"The copy buttons now include its full Authorization header.",tone:"success"}),await i.invalidateQueries({queryKey:V(s.companyId)})},"onSuccess"),onError:t(o=>j({title:"Token was not issued",body:$(o).body,tone:"error"}),"onError")});async function M(o,C){try{await ae(o),j({title:"Copied",body:C,tone:"success"})}catch(I){j({title:"Copy failed",body:$(I).body,tone:"error"})}}t(M,"copyText");const T=x.find(o=>o.client===g)??null,E=T?pe(T.config,{endpointPath:s.endpointPath,endpoint:y,token:b?R(b):"pcgw_•••"}):"",S=T&&b?pe(T.config,{endpointPath:s.endpointPath,endpoint:y,token:b.token}):null;function v(){d.isPending||d.mutate()}return t(v,"issueToken"),(0,e.jsx)(_e,{open:a,onOpenChange:r,children:(0,e.jsxs)(Se,{className:A("sm:max-w-2xl",H),children:[(0,e.jsxs)(Ce,{children:[(0,e.jsxs)(Pe,{className:"flex items-center gap-2",children:["Client snippets",(0,e.jsxs)(hs,{children:[(0,e.jsx)(gs,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"About client snippets",className:"text-muted-foreground hover:text-foreground",children:(0,e.jsx)(xs,{className:"h-4 w-4"})})}),(0,e.jsx)(bs,{className:A("max-w-xs text-xs",H),children:"Give this MCP gateway configuration to your tool. It does not give it access to Microvac or skills; it only gateways calls between the client and the tools exposed here."})]})]}),(0,e.jsx)(Ie,{children:"Choose a client and copy a complete, authenticated configuration."})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border pb-3",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Authorization"}),f.length>0?(0,e.jsx)(ps,{value:p,groups:w,onValueChange:N,placeholder:"Issue a token",searchPlaceholder:"Search tokens…",emptyMessage:"No copyable tokens.",contentWidth:"auto",triggerClassName:"h-8 w-auto max-w-xs rounded-full px-3",renderValue:t(o=>o?`${o.label} · ${R(o.token)}`:"Issue a token","renderValue"),renderOption:t(o=>(0,e.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,e.jsx)("span",{className:"truncate",children:o.label}),(0,e.jsx)("span",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground",children:R(o.token)})]}),"renderOption"),createItem:{render:t(()=>(0,e.jsx)("span",{children:"+ Issue a new token"}),"render"),onSelect:v}}):(0,e.jsx)(c,{type:"button",variant:"outline",size:"sm",className:"rounded-full",disabled:d.isPending,onClick:v,children:d.isPending?"Issuing…":"Issue a token"}),b?(0,e.jsxs)(c,{type:"button",variant:"ghost",size:"sm",onClick:t(()=>{M(`Authorization: Bearer ${b.token}`,"Authorization header")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy header"]}):null]}),b?null:(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Issue a token before copying a snippet; the full ",(0,e.jsx)("code",{children:"Authorization: Bearer …"})," header is required. Existing token secrets cannot be retrieved again, so only tokens issued in this page session can fill a snippet."]}),(0,e.jsxs)("div",{className:"grid gap-4 sm:grid-cols-(--gtc-10)",children:[(0,e.jsxs)("nav",{className:"flex gap-1 overflow-x-auto sm:flex-col","aria-label":"Clients",children:[x.map(o=>{const C=_s[o.client];return(0,e.jsxs)("button",{type:"button",onClick:t(()=>k(o.client),"onClick"),className:A("flex shrink-0 items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors",g===o.client?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60"),children:[(0,e.jsx)(C,{className:"h-4 w-4 shrink-0"}),o.label]},o.client)}),(0,e.jsxs)("button",{type:"button",onClick:t(()=>k("raw_url"),"onClick"),className:A("flex shrink-0 items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors",g==="raw_url"?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60"),children:[(0,e.jsx)(Ke,{className:"h-4 w-4 shrink-0"}),"Raw URL"]})]}),(0,e.jsxs)("div",{className:"min-w-0 space-y-3",children:[g==="raw_url"?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Endpoint URL"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-3 py-2 font-mono text-xs text-muted-foreground",children:y}),(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{M(y,"Endpoint URL")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Authorization header"}),(0,e.jsx)("code",{className:"block truncate rounded-md bg-muted px-3 py-2 font-mono text-xs text-muted-foreground",children:b?`Authorization: Bearer ${R(b)}`:"Authorization: Bearer pcgw_•••"})]})]}):T?(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:T.label}),(0,e.jsxs)(c,{variant:"outline",size:"sm",disabled:!S,onClick:t(()=>S&&void M(S,`${T.label} config`),"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]}),(0,e.jsx)("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",children:E}),T.notes.length>0?(0,e.jsx)("ul",{className:"space-y-1 text-xs text-muted-foreground",children:T.notes.map(o=>(0,e.jsx)("li",{children:o},o))}):null]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No client snippets available for this gateway."}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Treat the token like a password. Anyone holding it can call the tools this gateway allows. Revoke it if it leaks."})]})]}),(0,e.jsx)(ke,{children:(0,e.jsxs)(c,{onClick:t(()=>r(!1),"onClick"),children:[(0,e.jsx)(Xe,{className:"mr-1.5 h-4 w-4"}),"Done"]})})]})})}t(Es,"ConnectClientDialog");function Is({companyId:s,gateway:a,profiles:r,open:m,onOpenChange:u}){const i=Z(),{pushToast:j}=W(),[x,y]=(0,l.useState)(a.name),[f,w]=(0,l.useState)(a.description??""),[g,k]=(0,l.useState)(a.profileId);(0,l.useEffect)(()=>{m&&(y(a.name),w(a.description??""),k(a.profileId))},[a,m]);const p=r.filter(d=>d.status!=="archived"),N=F({mutationFn:t(()=>P.updateGateway(s,a.id,{name:x.trim(),description:f.trim()||null,profileId:g}),"mutationFn"),onSuccess:t(async d=>{j({title:"Gateway updated",body:d.name,tone:"success"}),await i.invalidateQueries({queryKey:V(s)}),u(!1)},"onSuccess"),onError:t(d=>{j({title:"Gateway was not updated",body:$(d).body,tone:"error"})},"onError")});function b(d){d.preventDefault(),!(!x.trim()||!g)&&N.mutate()}return t(b,"submit"),(0,e.jsx)(_e,{open:m,onOpenChange:u,children:(0,e.jsxs)(Se,{className:A("sm:max-w-lg",H),children:[(0,e.jsxs)(Ce,{children:[(0,e.jsx)(Pe,{children:"Edit gateway"}),(0,e.jsx)(Ie,{children:"Change the label or the access profile that controls which tools this endpoint exposes."})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:b,children:[(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),(0,e.jsx)(U,{value:x,onChange:t(d=>y(d.target.value),"onChange"),required:!0,autoFocus:!0})]}),(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Access profile"}),(0,e.jsx)("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:g,onChange:t(d=>k(d.target.value),"onChange"),required:!0,children:p.map(d=>(0,e.jsxs)("option",{value:d.id,children:[d.name," — ",ue(d)]},d.id))})]}),(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Description (optional)"}),(0,e.jsx)("textarea",{className:"min-h-16 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:f,onChange:t(d=>w(d.target.value),"onChange"),placeholder:"Who this endpoint is for."})]}),(0,e.jsxs)(ke,{children:[(0,e.jsx)(c,{type:"button",variant:"ghost",onClick:t(()=>u(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(c,{type:"submit",disabled:N.isPending||!x.trim()||!g,children:N.isPending?"Saving…":"Save changes"})]})]})]})})}t(Is,"EditGatewayDialog");function Ds({gateway:s,profile:a,apps:r,agentNames:m,projectNames:u,toggleDisabled:i,onToggle:j}){const{pushToast:x}=W(),y=`${typeof window<"u"?window.location.origin:""}${s.endpointPath}`,f=vs(s),w=Ts(s),g=r.filter(b=>b.needsAttention),k=Me(s),p=["{",' "mcpServers": {',` "paperclip-${s.displaySlug}": {`,` "url": "${y}",`,' "headers": { "Authorization": "Bearer pcgw_•••_TOKEN" }'," }"," }","}"].join(`
|
|
1
|
+
var Ge=Object.defineProperty;var t=(s,a)=>Ge(s,"name",{value:a,configurable:!0});import{a as ve}from"./rolldown-runtime-DhZMWcEn.js";import{vi as Oe,yi as Fe}from"./issue-detail-CZfjXs0M.js";import{C as Le,b as Qe}from"./collections-B58p51lw.js";import{t as Ke}from"./link-DvgFK0mz.js";import{t as Ue}from"./send-CH-0xdLm.js";import{$A as Be,$S as H,AT as He,B_ as Ve,CC as We,Ep as Je,Ew as Ye,GS as J,Gb as Y,Jp as P,LS as Ze,ME as Z,MT as Xe,NE as c,OT as es,RT as ss,VS as ts,V_ as as,XC as ns,Yb as Ne,__ as U,aE as rs,ab as we,bE as F,cT as L,dy as ke,eC as os,fy as Ce,hE as $,ib as is,jT as Te,kT as Ae,ly as Se,mb as B,my as Pe,nj as ls,nw as ds,qC as cs,qb as us,qp as ae,rb as ms,sv as W,sy as _e,ub as Ee,uy as Ie,vT as xs,vb as hs,vm as ps,xE as K,x_ as fs,xb as gs,yb as bs,zE as A,z_ as js}from"./index-BJtnP7H1.js";import{a as O}from"./shared-D37zfckm.js";import{_ as ys,a as vs,b as he,c as Ns,d as ws,f as De,g as ks,h as R,i as Cs,l as Ts,o as ue,p as Me,r as V,s as ze,t as As,u as pe,v as te,x as Ss,y as Ps}from"./CopyableGatewayUrl-B6K3rOal.js";var l=ve(ls(),1),e=ve(Be(),1),_s={cursor:ds,claude_desktop:ss,vscode:Oe,claude_code:We,opencode:Fe};function Es({gateway:s,open:a,onOpenChange:r,createdTokens:m,onTokenCreated:u}){const i=Z(),{pushToast:j}=W(),x=(0,l.useMemo)(()=>ks(s.clientSnippets??[]),[s.clientSnippets]),y=(0,l.useMemo)(()=>`${typeof window<"u"?window.location.origin:""}${s.endpointPath}`,[s.endpointPath]),f=(0,l.useMemo)(()=>m.filter(o=>{const C=s.tokens.find(G=>G.id===o.id),I=te(C??o);return I==="active"||I==="expiring"}),[m,s.tokens]),w=(0,l.useMemo)(()=>[{id:"tokens",label:"Available this session",options:f.map(o=>({key:o.id,value:o.id,label:o.name,title:o.clientLabel,searchText:`${o.name} ${o.clientLabel} ${o.tokenPrefix}`,token:o}))}],[f]),[g,k]=(0,l.useState)(x[0]?.client??"raw_url"),[p,N]=(0,l.useState)(""),b=f.find(o=>o.id===p)??null;(0,l.useEffect)(()=>{a&&(k(x[0]?.client??"raw_url"),N(o=>f.some(C=>C.id===o)?o:f[0]?.id??""))},[f,a,x]);const d=F({mutationFn:t(()=>{const o=ze(s);return P.createGatewayToken(s.companyId,s.id,{name:o,clientLabel:o,ownerNote:"",allowedActions:["tools/list","tools/call"],expiresAt:new Date(Date.now()+7776e6).toISOString()})},"mutationFn"),onSuccess:t(async o=>{u(o),N(o.id),j({title:"Token issued",body:"The copy buttons now include its full Authorization header.",tone:"success"}),await i.invalidateQueries({queryKey:V(s.companyId)})},"onSuccess"),onError:t(o=>j({title:"Token was not issued",body:$(o).body,tone:"error"}),"onError")});async function M(o,C){try{await ae(o),j({title:"Copied",body:C,tone:"success"})}catch(I){j({title:"Copy failed",body:$(I).body,tone:"error"})}}t(M,"copyText");const T=x.find(o=>o.client===g)??null,E=T?pe(T.config,{endpointPath:s.endpointPath,endpoint:y,token:b?R(b):"pcgw_•••"}):"",S=T&&b?pe(T.config,{endpointPath:s.endpointPath,endpoint:y,token:b.token}):null;function v(){d.isPending||d.mutate()}return t(v,"issueToken"),(0,e.jsx)(_e,{open:a,onOpenChange:r,children:(0,e.jsxs)(Se,{className:A("sm:max-w-2xl",H),children:[(0,e.jsxs)(Ce,{children:[(0,e.jsxs)(Pe,{className:"flex items-center gap-2",children:["Client snippets",(0,e.jsxs)(hs,{children:[(0,e.jsx)(gs,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"About client snippets",className:"text-muted-foreground hover:text-foreground",children:(0,e.jsx)(xs,{className:"h-4 w-4"})})}),(0,e.jsx)(bs,{className:A("max-w-xs text-xs",H),children:"Give this MCP gateway configuration to your tool. It does not give it access to Microvac or skills; it only gateways calls between the client and the tools exposed here."})]})]}),(0,e.jsx)(Ie,{children:"Choose a client and copy a complete, authenticated configuration."})]}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 border-b border-border pb-3",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Authorization"}),f.length>0?(0,e.jsx)(ps,{value:p,groups:w,onValueChange:N,placeholder:"Issue a token",searchPlaceholder:"Search tokens…",emptyMessage:"No copyable tokens.",contentWidth:"auto",triggerClassName:"h-8 w-auto max-w-xs rounded-full px-3",renderValue:t(o=>o?`${o.label} · ${R(o.token)}`:"Issue a token","renderValue"),renderOption:t(o=>(0,e.jsxs)("span",{className:"flex min-w-0 flex-col",children:[(0,e.jsx)("span",{className:"truncate",children:o.label}),(0,e.jsx)("span",{className:"truncate font-mono text-(length:--text-micro) text-muted-foreground",children:R(o.token)})]}),"renderOption"),createItem:{render:t(()=>(0,e.jsx)("span",{children:"+ Issue a new token"}),"render"),onSelect:v}}):(0,e.jsx)(c,{type:"button",variant:"outline",size:"sm",className:"rounded-full",disabled:d.isPending,onClick:v,children:d.isPending?"Issuing…":"Issue a token"}),b?(0,e.jsxs)(c,{type:"button",variant:"ghost",size:"sm",onClick:t(()=>{M(`Authorization: Bearer ${b.token}`,"Authorization header")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy header"]}):null]}),b?null:(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Issue a token before copying a snippet; the full ",(0,e.jsx)("code",{children:"Authorization: Bearer …"})," header is required. Existing token secrets cannot be retrieved again, so only tokens issued in this page session can fill a snippet."]}),(0,e.jsxs)("div",{className:"grid gap-4 sm:grid-cols-(--gtc-10)",children:[(0,e.jsxs)("nav",{className:"flex gap-1 overflow-x-auto sm:flex-col","aria-label":"Clients",children:[x.map(o=>{const C=_s[o.client];return(0,e.jsxs)("button",{type:"button",onClick:t(()=>k(o.client),"onClick"),className:A("flex shrink-0 items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors",g===o.client?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60"),children:[(0,e.jsx)(C,{className:"h-4 w-4 shrink-0"}),o.label]},o.client)}),(0,e.jsxs)("button",{type:"button",onClick:t(()=>k("raw_url"),"onClick"),className:A("flex shrink-0 items-center gap-2 rounded-md px-3 py-1.5 text-left text-sm transition-colors",g==="raw_url"?"bg-muted font-medium text-foreground":"text-muted-foreground hover:bg-muted/60"),children:[(0,e.jsx)(Ke,{className:"h-4 w-4 shrink-0"}),"Raw URL"]})]}),(0,e.jsxs)("div",{className:"min-w-0 space-y-3",children:[g==="raw_url"?(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Endpoint URL"}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-3 py-2 font-mono text-xs text-muted-foreground",children:y}),(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{M(y,"Endpoint URL")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]})]}),(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Authorization header"}),(0,e.jsx)("code",{className:"block truncate rounded-md bg-muted px-3 py-2 font-mono text-xs text-muted-foreground",children:b?`Authorization: Bearer ${R(b)}`:"Authorization: Bearer pcgw_•••"})]})]}):T?(0,e.jsxs)("div",{className:"space-y-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium text-foreground",children:T.label}),(0,e.jsxs)(c,{variant:"outline",size:"sm",disabled:!S,onClick:t(()=>S&&void M(S,`${T.label} config`),"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]}),(0,e.jsx)("pre",{className:"max-h-64 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",children:E}),T.notes.length>0?(0,e.jsx)("ul",{className:"space-y-1 text-xs text-muted-foreground",children:T.notes.map(o=>(0,e.jsx)("li",{children:o},o))}):null]}):(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No client snippets available for this gateway."}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Treat the token like a password. Anyone holding it can call the tools this gateway allows. Revoke it if it leaks."})]})]}),(0,e.jsx)(ke,{children:(0,e.jsxs)(c,{onClick:t(()=>r(!1),"onClick"),children:[(0,e.jsx)(Xe,{className:"mr-1.5 h-4 w-4"}),"Done"]})})]})})}t(Es,"ConnectClientDialog");function Is({companyId:s,gateway:a,profiles:r,open:m,onOpenChange:u}){const i=Z(),{pushToast:j}=W(),[x,y]=(0,l.useState)(a.name),[f,w]=(0,l.useState)(a.description??""),[g,k]=(0,l.useState)(a.profileId);(0,l.useEffect)(()=>{m&&(y(a.name),w(a.description??""),k(a.profileId))},[a,m]);const p=r.filter(d=>d.status!=="archived"),N=F({mutationFn:t(()=>P.updateGateway(s,a.id,{name:x.trim(),description:f.trim()||null,profileId:g}),"mutationFn"),onSuccess:t(async d=>{j({title:"Gateway updated",body:d.name,tone:"success"}),await i.invalidateQueries({queryKey:V(s)}),u(!1)},"onSuccess"),onError:t(d=>{j({title:"Gateway was not updated",body:$(d).body,tone:"error"})},"onError")});function b(d){d.preventDefault(),!(!x.trim()||!g)&&N.mutate()}return t(b,"submit"),(0,e.jsx)(_e,{open:m,onOpenChange:u,children:(0,e.jsxs)(Se,{className:A("sm:max-w-lg",H),children:[(0,e.jsxs)(Ce,{children:[(0,e.jsx)(Pe,{children:"Edit gateway"}),(0,e.jsx)(Ie,{children:"Change the label or the access profile that controls which tools this endpoint exposes."})]}),(0,e.jsxs)("form",{className:"space-y-4",onSubmit:b,children:[(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Name"}),(0,e.jsx)(U,{value:x,onChange:t(d=>y(d.target.value),"onChange"),required:!0,autoFocus:!0})]}),(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Access profile"}),(0,e.jsx)("select",{className:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:g,onChange:t(d=>k(d.target.value),"onChange"),required:!0,children:p.map(d=>(0,e.jsxs)("option",{value:d.id,children:[d.name," — ",ue(d)]},d.id))})]}),(0,e.jsxs)("label",{className:"block space-y-1.5",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Description (optional)"}),(0,e.jsx)("textarea",{className:"min-h-16 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",value:f,onChange:t(d=>w(d.target.value),"onChange"),placeholder:"Who this endpoint is for."})]}),(0,e.jsxs)(ke,{children:[(0,e.jsx)(c,{type:"button",variant:"ghost",onClick:t(()=>u(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(c,{type:"submit",disabled:N.isPending||!x.trim()||!g,children:N.isPending?"Saving…":"Save changes"})]})]})]})})}t(Is,"EditGatewayDialog");function Ds({gateway:s,profile:a,apps:r,agentNames:m,projectNames:u,toggleDisabled:i,onToggle:j}){const{pushToast:x}=W(),y=`${typeof window<"u"?window.location.origin:""}${s.endpointPath}`,f=vs(s),w=Ts(s),g=r.filter(b=>b.needsAttention),k=Me(s),p=["{",' "mcpServers": {',` "paperclip-${s.displaySlug}": {`,` "url": "${y}",`,' "headers": { "Authorization": "Bearer pcgw_•••_TOKEN" }'," }"," }","}"].join(`
|
|
2
2
|
`);async function N(b,d){try{await ae(b),x({title:"Copied",body:d,tone:"success"})}catch{x({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}}return t(N,"copy"),(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,e.jsxs)("div",{className:"rounded-lg border border-border p-4",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:k?"On":"Off"}),(0,e.jsx)("div",{className:"mt-2",children:(0,e.jsx)(Je,{checked:k,disabled:i,onCheckedChange:j,"aria-label":"Toggle gateway"})}),(0,e.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:"Toggle the whole gateway off here."})]}),(0,e.jsxs)(oe,{label:"Apps",children:[r.length," ",r.length===1?"app":"apps",a?` · ${ue(a)}`:""]}),(0,e.jsxs)(oe,{label:"Tokens",children:[f," active",w>0?` · ${w} expiring`:""]}),(0,e.jsx)(oe,{label:"Health",children:g.length===0?"All green":`${g.length} needs attention`})]}),(0,e.jsxs)("section",{className:"rounded-lg border border-border p-4",children:[(0,e.jsx)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Who can use it"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"Anyone holding an active token below, restricted by the rules in the bound profile."})]})}),(0,e.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,e.jsxs)(ie,{children:["Scope · ",ws(s,u,m)]}),(0,e.jsxs)(ie,{children:["Profile · ",a?.name??"Unavailable"]}),(0,e.jsxs)(ie,{children:[f," active ",f===1?"token":"tokens"]})]})]}),(0,e.jsxs)("section",{className:"rounded-lg border border-border p-4",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Apps in this gateway"}),r.length===0?(0,e.jsx)("p",{className:"mt-2 text-sm text-muted-foreground",children:"This gateway’s profile doesn’t include any apps yet."}):(0,e.jsx)("ul",{className:"mt-3 divide-y divide-border",children:r.map(b=>(0,e.jsx)(Ms,{app:b},b.application.id))})]}),(0,e.jsxs)("section",{className:"rounded-lg border border-border bg-muted/30 p-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"How clients connect"}),(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{N(p,"Client config")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]}),(0,e.jsx)("pre",{className:"mt-3 overflow-auto whitespace-pre-wrap break-words rounded bg-background p-3 font-mono text-xs text-muted-foreground",children:p})]})]})}t(Ds,"OverviewPanel");function oe({label:s,children:a}){return(0,e.jsxs)("div",{className:"rounded-lg border border-border p-4",children:[(0,e.jsx)("div",{className:"text-xs font-medium text-muted-foreground",children:s}),(0,e.jsx)("div",{className:"mt-2 text-sm font-semibold text-foreground",children:a})]})}t(oe,"StatCard");function ie({children:s}){return(0,e.jsx)("span",{className:"inline-flex items-center rounded-full border border-border px-3 py-1 text-xs font-medium text-foreground",children:s})}t(ie,"Chip");function Ms({app:s}){const a=s.connection?`/apps/${s.connection.id}/permissions`:`/apps/app/${s.application.id}/permissions`;return(0,e.jsxs)("li",{className:"flex items-center justify-between gap-3 py-2.5",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)(Y,{to:a,className:"font-medium text-foreground hover:underline",children:De(s)}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[s.toolCount," ",s.toolCount===1?"tool":"tools",s.needsAttention&&s.attentionReason?` · ${s.attentionReason}`:""]})]}),(0,e.jsx)("span",{className:A("shrink-0 rounded-full border px-2 py-0.5 text-xs font-medium",s.needsAttention?"border-foreground bg-foreground text-background":"border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"),children:s.needsAttention?"Needs attention":"Healthy"})]})}t(Ms,"AppRow");function zs({apps:s,profile:a}){return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("p",{className:"text-sm text-muted-foreground",children:["These apps go through this gateway. The bound profile",a?` (${a.name})`:""," decides which tools are allowed",a?` — ${ue(a)}.`:"."," Change the profile under Advanced."]}),s.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No apps are assigned to this gateway’s profile yet."}):(0,e.jsx)("div",{className:"overflow-x-auto rounded-lg border border-border",children:(0,e.jsxs)("table",{className:"w-full min-w-(--sz-32rem) text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-border bg-muted/40 text-left text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)("th",{className:"px-4 py-2.5",children:"App"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Tools"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Status"}),(0,e.jsx)("th",{className:"px-4 py-2.5 text-right"})]})}),(0,e.jsx)("tbody",{children:s.map(r=>{const m=r.connection?`/apps/${r.connection.id}/permissions`:`/apps/app/${r.application.id}/permissions`;return(0,e.jsxs)("tr",{className:"border-b border-border last:border-0",children:[(0,e.jsxs)("td",{className:"px-4 py-3",children:[(0,e.jsx)(Y,{to:m,className:"font-medium text-foreground hover:underline",children:De(r)}),r.needsAttention&&r.attentionReason?(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:r.attentionReason}):null]}),(0,e.jsxs)("td",{className:"px-4 py-3 text-muted-foreground",children:[r.toolCount," ",r.toolCount===1?"tool":"tools"]}),(0,e.jsx)("td",{className:"px-4 py-3",children:(0,e.jsx)("span",{className:A("inline-flex items-center rounded-full border px-2 py-0.5 text-xs font-medium",r.needsAttention?"border-foreground bg-foreground text-background":"border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300"),children:r.needsAttention?"Needs attention":"Healthy"})}),(0,e.jsx)("td",{className:"px-4 py-3 text-right",children:(0,e.jsx)(Y,{to:m,className:"text-xs font-medium text-primary hover:underline",children:"Open →"})})]},r.application.id)})})]})})]})}t(zs,"AppsToolsPanel");var $s=["tools/list","tools/call"],le=10;function fe(){return new Date(Date.now()+7776e6).toISOString().slice(0,10)}t(fe,"defaultExpiry");var qs={pending:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300",active:"border-emerald-500/40 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",expiring:"border-amber-500/40 bg-amber-500/10 text-amber-700 dark:text-amber-300",expired:"border-border bg-muted text-muted-foreground",revoked:"border-foreground bg-foreground text-background"};function ge({status:s}){return(0,e.jsx)("span",{className:A("inline-flex shrink-0 items-center rounded-full border px-2 py-0.5 text-xs font-medium",qs[s]),children:Cs[s]})}t(ge,"StatusBadge");function ee({label:s,value:a}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("dt",{className:"text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:s}),(0,e.jsx)("dd",{className:"mt-0.5 truncate text-foreground",children:a})]})}t(ee,"TokenField");function de({token:s}){const a=ys(s.expiresAt);return a?a.getTime()<=Date.now()?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("span",{className:"font-medium text-foreground",children:"Expired"})," ",(0,e.jsx)(O,{value:s.expiresAt})]}):(0,e.jsxs)(e.Fragment,{children:["Expires ",(0,e.jsx)(O,{value:s.expiresAt})]}):(0,e.jsx)(e.Fragment,{children:"No expiry"})}t(de,"ExpiryValue");function Rs({companyId:s,gateway:a,onTokenCreated:r}){const m=Z(),{pushToast:u}=W(),[i,j]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),[f,w]=(0,l.useState)(""),[g,k]=(0,l.useState)(fe()),[p,N]=(0,l.useState)(null),[b,d]=(0,l.useState)(!1),[M,T]=(0,l.useState)(!1),[E,S]=(0,l.useState)(1),[v,o]=(0,l.useState)(""),[C,I]=(0,l.useState)(null),G=t(()=>m.invalidateQueries({queryKey:V(s)}),"invalidate"),D=(0,l.useMemo)(()=>[...a.tokens].sort((n,z)=>new Date(z.createdAt).getTime()-new Date(n.createdAt).getTime()),[a.tokens]),{userId:Q}=ts(),h=(0,l.useMemo)(()=>D.filter(n=>te(n)==="pending"&&(!n.responsibleUserId||!Q||n.responsibleUserId===Q)),[D,Q]),_=Math.max(1,Math.ceil(D.length/le)),X=D.slice((E-1)*le,E*le);(0,l.useEffect)(()=>{S(n=>Math.min(n,_))},[_]);const ne=F({mutationFn:t(()=>P.createGatewayToken(s,a.id,{name:x.trim(),clientLabel:x.trim(),ownerNote:f.trim(),allowedActions:$s,expiresAt:g?`${g}T23:59:59.000Z`:null}),"mutationFn"),onSuccess:t(async n=>{N(n),d(!0),j(!1),y(""),w(""),k(fe()),u({title:"Token issued",body:"Copy it now — you won’t see the full value again after leaving this page.",tone:"success"}),r?.(n),await G()},"onSuccess"),onError:t(n=>u({title:"Token was not issued",body:$(n).body,tone:"error"}),"onError")}),me=F({mutationFn:t(n=>P.revealGatewayToken(s,n),"mutationFn"),onSuccess:t(async n=>{N(n),d(!0),u({title:"Token revealed",body:"Copy it now — you won’t see the full value again after leaving this page.",tone:"success"}),r?.(n),await G()},"onSuccess"),onError:t(n=>u({title:"Token was not revealed",body:$(n).body,tone:"error"}),"onError")}),re=F({mutationFn:t(n=>P.revokeGatewayToken(s,n),"mutationFn"),onSuccess:t(async n=>{I(null),o(""),u({title:"Token revoked",body:`${n.name} can no longer connect.`,tone:"success"}),await G()},"onSuccess"),onError:t(n=>u({title:"Token was not revoked",body:$(n).body,tone:"error"}),"onError")});async function $e(n){try{await ae(n),u({title:"Copied",body:"Access token",tone:"success"})}catch(z){u({title:"Copy failed",body:$(z).body,tone:"error"})}}t($e,"copyToken");function qe(){!i&&!x.trim()&&y(ze(a)),j(n=>!n)}t(qe,"startIssuing");function Re(n){n.preventDefault(),x.trim()&&ne.mutate()}t(Re,"submit");function xe(n){I({id:n.id,name:n.name}),o("")}return t(xe,"startRevoke"),(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"max-w-2xl space-y-1",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Issue a reusable token for an external client. Its name is also used as the client label."}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:"Microvac creates a fresh one-hour runtime token when an agent run starts, then revokes it when the run ends. Codex can receive the same gateway through both an app connection and the managed-gateway path, so one run may leave two revoked rows. These are audit history, not repeated manual tokens."})]}),(0,e.jsxs)(c,{size:"sm",onClick:qe,children:[(0,e.jsx)(cs,{className:"mr-1.5 h-3.5 w-3.5"}),"Issue token"]})]}),i?(0,e.jsxs)("form",{className:"space-y-3",onSubmit:Re,children:[(0,e.jsxs)("div",{className:"grid gap-3 md:grid-cols-[1fr_auto]",children:[(0,e.jsxs)("label",{className:"space-y-1.5 text-sm",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Token name"}),(0,e.jsx)(U,{value:x,onChange:t(n=>y(n.target.value),"onChange"),required:!0,autoFocus:!0}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground",children:"Also used as the client label."})]}),(0,e.jsxs)("label",{className:"space-y-1.5 text-sm",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Expires"}),(0,e.jsx)(U,{type:"date",value:g,onChange:t(n=>k(n.target.value),"onChange"),required:!0})]})]}),(0,e.jsxs)("label",{className:"block space-y-1.5 text-sm",children:[(0,e.jsx)("span",{className:"text-xs font-medium text-muted-foreground",children:"Owner note (optional)"}),(0,e.jsx)(U,{value:f,onChange:t(n=>w(n.target.value),"onChange"),placeholder:"Who uses this token or why it exists"})]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(c,{type:"button",variant:"ghost",size:"sm",onClick:t(()=>j(!1),"onClick"),children:"Cancel"}),(0,e.jsx)(c,{type:"submit",size:"sm",disabled:ne.isPending||!x.trim(),children:ne.isPending?"Issuing…":"Issue token"})]})]}):null,h.length>0?(0,e.jsxs)("section",{className:"space-y-2 border-y border-border py-4","aria-label":"Tokens waiting to be revealed",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-foreground",children:"Waiting for you to reveal"}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"An agent created these tokens for you. A value is generated when you reveal it and is shown only once."})]}),h.map(n=>(0,e.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate font-medium text-foreground",children:n.name}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground",children:[R(n)," · ",(0,e.jsx)(de,{token:n})]})]}),(0,e.jsx)(c,{size:"sm",disabled:me.isPending,onClick:t(()=>me.mutate(n.id),"onClick"),"aria-label":`Reveal token ${n.name}`,children:"Reveal token"})]},n.id))]}):null,p?(0,e.jsxs)("div",{className:"space-y-2 border-y border-border py-4",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-foreground",children:"New token — copy now"}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:"It is now available in Client snippets for a copy-ready configuration."})]}),(0,e.jsx)(c,{variant:"ghost",size:"sm",onClick:t(()=>N(null),"onClick"),"aria-label":"Dismiss new token",children:"Dismiss"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("code",{className:A("min-w-0 flex-1 truncate rounded bg-muted px-3 py-2 font-mono text-xs text-foreground",os),children:b?p.token:R(p)}),b?(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{$e(p.token)},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]}):(0,e.jsx)(c,{variant:"outline",size:"sm",onClick:t(()=>d(!0),"onClick"),children:"Show"})]})]}):null,(0,e.jsxs)(js,{open:M,onOpenChange:T,children:[(0,e.jsx)(as,{asChild:!0,children:(0,e.jsxs)(c,{variant:"ghost",className:"h-auto w-full justify-between px-0 py-1 hover:bg-transparent",children:[(0,e.jsxs)("span",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[(0,e.jsx)(Ye,{className:"h-4 w-4 text-muted-foreground"}),"Token history",(0,e.jsx)("span",{className:"font-normal text-muted-foreground",children:D.length})]}),M?(0,e.jsx)(es,{className:"h-4 w-4"}):(0,e.jsx)(Te,{className:"h-4 w-4"})]})}),(0,e.jsx)(Ve,{className:"space-y-3 pt-3",children:D.length===0?(0,e.jsx)("p",{className:"py-4 text-sm text-muted-foreground",children:"No tokens have been issued for this gateway."}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"hidden overflow-x-auto rounded-lg border border-border sm:block",children:(0,e.jsxs)("table",{className:"w-full min-w-(--sz-44rem) text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-border bg-muted/40 text-left text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Token"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Owner"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Created"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Last used"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Expiry"}),(0,e.jsx)("th",{className:"px-4 py-2.5",children:"Status"}),(0,e.jsx)("th",{className:"px-4 py-2.5 text-right"})]})}),(0,e.jsx)("tbody",{children:X.map(n=>{const z=te(n);return(0,e.jsxs)("tr",{className:"border-b border-border last:border-0",children:[(0,e.jsxs)("td",{className:"px-4 py-3",children:[(0,e.jsx)("div",{className:"font-medium text-foreground",children:n.name}),(0,e.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:R(n)})]}),(0,e.jsx)("td",{className:"px-4 py-3 text-muted-foreground",children:n.clientLabel||n.ownerNote||"—"}),(0,e.jsx)("td",{className:"px-4 py-3 text-muted-foreground",children:(0,e.jsx)(O,{value:n.createdAt})}),(0,e.jsx)("td",{className:"px-4 py-3 text-muted-foreground",children:n.lastUsedAt?(0,e.jsx)(O,{value:n.lastUsedAt}):"—"}),(0,e.jsx)("td",{className:"px-4 py-3 text-muted-foreground",children:(0,e.jsx)(de,{token:n})}),(0,e.jsx)("td",{className:"px-4 py-3",children:(0,e.jsx)(ge,{status:z})}),(0,e.jsx)("td",{className:"px-4 py-3 text-right",children:z!=="revoked"?(0,e.jsx)(c,{variant:"ghost",size:"sm",className:"h-7 px-2 text-xs text-destructive hover:text-destructive",onClick:t(()=>xe(n),"onClick"),children:"Revoke"}):null})]},n.id)})})]})}),(0,e.jsx)("div",{className:"space-y-3 sm:hidden",children:X.map(n=>{const z=te(n);return(0,e.jsxs)("div",{className:"border-b border-border py-3 last:border-0",children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"font-medium text-foreground",children:n.name}),(0,e.jsx)("div",{className:"font-mono text-xs text-muted-foreground",children:R(n)})]}),(0,e.jsx)(ge,{status:z})]}),(0,e.jsxs)("dl",{className:"mt-3 grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[(0,e.jsx)(ee,{label:"Owner",value:n.clientLabel||n.ownerNote||"—"}),(0,e.jsx)(ee,{label:"Created",value:(0,e.jsx)(O,{value:n.createdAt})}),(0,e.jsx)(ee,{label:"Last used",value:n.lastUsedAt?(0,e.jsx)(O,{value:n.lastUsedAt}):"—"}),(0,e.jsx)(ee,{label:"Expiry",value:(0,e.jsx)(de,{token:n})})]}),z!=="revoked"?(0,e.jsx)(c,{variant:"ghost",size:"sm",className:"mt-3 w-full text-xs text-destructive hover:text-destructive",onClick:t(()=>xe(n),"onClick"),children:"Revoke"}):null]},n.id)})}),_>1?(0,e.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Page ",E," of ",_," · ",D.length," tokens"]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(c,{variant:"ghost",size:"sm",disabled:E===1,onClick:t(()=>S(n=>Math.max(1,n-1)),"onClick"),"aria-label":"Previous token page",children:(0,e.jsx)(He,{className:"h-4 w-4"})}),(0,e.jsx)(c,{variant:"ghost",size:"sm",disabled:E===_,onClick:t(()=>S(n=>Math.min(_,n+1)),"onClick"),"aria-label":"Next token page",children:(0,e.jsx)(Ae,{className:"h-4 w-4"})})]})]}):null]})})]}),C?(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",role:"dialog","aria-modal":"true",children:(0,e.jsxs)("div",{className:"w-full max-w-md space-y-3 rounded-lg border border-border bg-card p-5 shadow-lg",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Revoke this token?"}),(0,e.jsxs)("p",{className:"mt-1 text-sm text-muted-foreground",children:["Any client using ",(0,e.jsx)("span",{className:"font-medium text-foreground",children:C.name})," goes silent immediately. This can’t be undone. Type the token name to confirm."]})]}),(0,e.jsx)(U,{value:v,onChange:t(n=>o(n.target.value),"onChange"),placeholder:C.name,"aria-label":"Type the token name to confirm",autoFocus:!0}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(c,{variant:"ghost",size:"sm",onClick:t(()=>{I(null),o("")},"onClick"),children:"Cancel"}),(0,e.jsx)(c,{variant:"destructive",size:"sm",disabled:v.trim()!==C.name||re.isPending,onClick:t(()=>re.mutate(C.id),"onClick"),children:re.isPending?"Revoking…":"Revoke token"})]})]})}):null]})}t(Rs,"TokensPanel");var Gs=25,be={allowed:{label:"Allowed",status:"allowed"},blocked:{label:"Blocked",status:"denied"},asked_first:{label:"Asked first",status:"require-approval"},waiting:{label:"Waiting",status:"deferred"},failed:{label:"Failed",status:"failed"},unknown:{label:"Recorded",status:"unchecked"}};function ce(s,a){const r=s?.[a];return typeof r=="string"&&r.trim().length>0?r:null}t(ce,"detailString");function je(s){if(!s?.summary)return null;try{return JSON.stringify(JSON.parse(s.summary),null,2)}catch{return s.summary}}t(je,"formatSummary");function ye(s,a){const r=s?.[a];if(!r||typeof r!="object"||Array.isArray(r))return null;const m=r.summary;return typeof m=="string"?{summary:m}:null}t(ye,"summaryFromDetails");function Os(s){const a=s.invocation?.startedAt?new Date(s.invocation.startedAt).getTime():NaN,r=s.invocation?.completedAt?new Date(s.invocation.completedAt).getTime():NaN;return!Number.isFinite(a)||!Number.isFinite(r)||r<a?null:`${r-a} ms`}t(Os,"durationLabel");function q({label:s,value:a,mono:r=!1}){return(0,e.jsxs)("div",{className:"flex gap-3 py-1",children:[(0,e.jsx)("dt",{className:"w-28 shrink-0 text-muted-foreground",children:s}),(0,e.jsx)("dd",{className:r?"min-w-0 break-all font-mono text-(length:--text-micro) text-foreground":"min-w-0 text-foreground",children:a})]})}t(q,"Fact");function Fs({event:s}){const[a,r]=(0,l.useState)(!1),m=be[s.normalizedOutcome]??be.unknown,u=s.agentDisplayName??"Client",i=s.appDisplayName??s.connectionDisplayName??s.applicationDisplayName??"App",j=s.toolDisplayName??s.invocation?.toolName??"Tool call",x=s.invocation?.toolName??ce(s.details,"tool")??ce(s.details,"toolName"),y=ce(s.details,"reasonCode"),f=je(s.invocation?.argumentsSummary??ye(s.details,"argumentsSummary")),w=je(s.invocation?.resultSummary??ye(s.details,"resultSummary")),g=Os(s);return(0,e.jsxs)("li",{className:"text-sm",children:[(0,e.jsxs)("button",{type:"button",onClick:t(()=>r(k=>!k),"onClick"),className:"flex w-full items-start gap-2.5 px-4 py-3 text-left hover:bg-accent/50","aria-expanded":a,children:[a?(0,e.jsx)(Te,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}):(0,e.jsx)(Ae,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"}),(0,e.jsx)("span",{className:"min-w-0 flex-1",children:(0,e.jsxs)("span",{className:"block text-foreground",children:[(0,e.jsx)("span",{className:"font-medium",children:u})," used ",(0,e.jsx)("span",{className:"font-medium",children:j})," in ",i]})}),(0,e.jsxs)("span",{className:"flex shrink-0 items-center gap-2 whitespace-nowrap",children:[(0,e.jsx)(Qe,{status:m.status,label:m.label}),(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["· ",(0,e.jsx)(O,{value:s.createdAt})]})]})]}),a?(0,e.jsxs)("div",{className:"border-t border-border bg-muted/30 px-4 py-3 pl-10 text-xs",children:[(0,e.jsxs)("dl",{children:[x?(0,e.jsx)(q,{label:"Tool",value:x,mono:!0}):null,s.invocation?.status?(0,e.jsx)(q,{label:"Call status",value:s.invocation.status}):null,s.invocation?.policyDecision?(0,e.jsx)(q,{label:"Decision",value:s.invocation.policyDecision}):null,y?(0,e.jsx)(q,{label:"Reason",value:y,mono:!0}):null,g?(0,e.jsx)(q,{label:"Duration",value:g}):null,s.invocation?.id?(0,e.jsx)(q,{label:"Invocation ID",value:s.invocation.id,mono:!0}):null,s.invocation?.errorCode?(0,e.jsx)(q,{label:"Error code",value:s.invocation.errorCode,mono:!0}):null,s.invocation?.errorMessage?(0,e.jsx)(q,{label:"Error",value:s.invocation.errorMessage}):null]}),f?(0,e.jsxs)("div",{className:"mt-2 space-y-1",children:[(0,e.jsx)("div",{className:"text-muted-foreground",children:"Arguments (redacted)"}),(0,e.jsx)("pre",{className:A("overflow-x-auto whitespace-pre-wrap break-words rounded-md border border-border bg-background p-3 font-mono text-xs text-foreground",H),children:f})]}):null,w?(0,e.jsxs)("div",{className:"mt-3 space-y-1",children:[(0,e.jsx)("div",{className:"text-muted-foreground",children:"Result (redacted)"}),(0,e.jsx)("pre",{className:A("overflow-x-auto whitespace-pre-wrap break-words rounded-md border border-border bg-background p-3 font-mono text-xs text-foreground",H),children:w})]}):null]}):null]})}t(Fs,"ActivityRow");function Ls({companyId:s,gateway:a}){const r=Le({queryKey:J.tools.activity(s,{gateway:a.id,window:"30d"}),queryFn:t(({pageParam:i})=>P.listActivity(s,{gateway:a.id,window:"30d",limit:Gs,cursor:i??void 0}),"queryFn"),initialPageParam:null,getNextPageParam:t(i=>i.nextCursor??void 0,"getNextPageParam")}),m=Ee(r),u=(0,l.useMemo)(()=>r.data?.pages.flatMap(i=>i.events)??[],[r.data]);return r.isLoading||m.kind==="reconnecting"?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(B,{className:"h-12 w-full"}),(0,e.jsx)(B,{className:"h-12 w-full"}),(0,e.jsx)(B,{className:"h-12 w-full"})]}):m.kind==="error"?(0,e.jsx)(we,{error:r.error,action:"load gateway activity",onRetry:m.retry,retrying:m.isFetching}):(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Calls through this gateway from the last 30 days. Open a row to inspect its tool, redacted arguments, result, and decision."}),u.length===0?(0,e.jsx)("div",{className:"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground",children:"No calls have gone through this gateway yet."}):(0,e.jsx)("ul",{className:"divide-y divide-border rounded-lg border border-border",children:u.map(i=>(0,e.jsx)(Fs,{event:i},i.id))}),r.hasNextPage?(0,e.jsx)("div",{className:"flex justify-center",children:(0,e.jsx)(c,{variant:"outline",size:"sm",onClick:t(()=>r.fetchNextPage(),"onClick"),disabled:r.isFetchingNextPage,children:r.isFetchingNextPage?"Loading…":"Load more"})}):null]})}t(Ls,"GatewayActivityPanel");function Qs({companyId:s,gateway:a}){const r=Z(),m=Ne(),{pushToast:u}=W(),[i,j]=(0,l.useState)(!1),[x,y]=(0,l.useState)(""),f=`${typeof window<"u"?window.location.origin:""}${a.endpointPath}`,w=JSON.stringify({gatewayPublicId:a.gatewayPublicId,displaySlug:a.displaySlug,status:a.status,profileId:a.profileId,defaultProfileMode:a.defaultProfileMode,contextScopeType:a.contextScopeType,contextScopeId:a.contextScopeId,endpointPath:a.endpointPath,authConfig:a.authConfig,headerPolicy:a.headerPolicy,metadataPolicy:a.metadataPolicy,onDemandToolsConfig:a.onDemandToolsConfig},null,2),g=F({mutationFn:t(()=>P.updateGateway(s,a.id,{status:"archived"}),"mutationFn"),onSuccess:t(async()=>{u({title:"Gateway archived",body:`${a.name} is no longer reachable.`,tone:"success"}),await r.invalidateQueries({queryKey:V(s)}),m("/apps/gateways")},"onSuccess"),onError:t(p=>u({title:"Couldn't archive the gateway",body:$(p).body,tone:"error"}),"onError")});async function k(p,N){try{await ae(p),u({title:"Copied",body:N,tone:"success"})}catch{u({title:"Copy failed",body:"Clipboard access is unavailable.",tone:"error"})}}return t(k,"copy"),(0,e.jsxs)("div",{className:"space-y-5",children:[(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Transport"}),(0,e.jsxs)("dl",{className:"grid gap-x-6 gap-y-2 text-sm sm:grid-cols-2",children:[(0,e.jsx)(se,{label:"Transport",value:"streamable_http"}),(0,e.jsx)(se,{label:"Authentication",value:"bearer"}),(0,e.jsx)(se,{label:"Protocol version",value:"2025-03-26"}),(0,e.jsx)(se,{label:"Public ID",value:a.gatewayPublicId,mono:!0})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-md bg-muted px-3 py-2 font-mono text-xs text-muted-foreground",children:f}),(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{k(f,"Endpoint URL")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy"]})]})]}),(0,e.jsxs)("section",{className:"space-y-2",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Raw configuration"}),(0,e.jsxs)(c,{variant:"outline",size:"sm",onClick:t(()=>{k(w,"Gateway config JSON")},"onClick"),children:[(0,e.jsx)(L,{className:"mr-1 h-3.5 w-3.5"}),"Copy JSON"]})]}),(0,e.jsx)("pre",{className:A("max-h-96 overflow-auto whitespace-pre-wrap break-words rounded-md bg-muted p-3 font-mono text-xs text-muted-foreground",H),children:w})]}),(0,e.jsxs)("section",{className:"space-y-2 rounded-lg border border-destructive/40 p-4",children:[(0,e.jsx)("h3",{className:"text-sm font-semibold text-destructive",children:"Danger zone"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Archiving takes the gateway offline for every client. Existing tokens stop working. Type the gateway name to confirm."}),i?(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(U,{value:x,onChange:t(p=>y(p.target.value),"onChange"),placeholder:a.name,"aria-label":"Type the gateway name to confirm archive"}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(c,{variant:"destructive",size:"sm",disabled:x.trim()!==a.name||g.isPending,onClick:t(()=>g.mutate(),"onClick"),children:g.isPending?"Archiving…":"Archive gateway"}),(0,e.jsx)(c,{variant:"ghost",size:"sm",onClick:t(()=>{j(!1),y("")},"onClick"),children:"Cancel"})]})]}):(0,e.jsx)(c,{variant:"outline",size:"sm",className:"text-destructive",onClick:t(()=>j(!0),"onClick"),children:"Archive gateway"})]})]})}t(Qs,"GatewayAdvancedPanel");function se({label:s,value:a,mono:r}){return(0,e.jsxs)("div",{children:[(0,e.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:s}),(0,e.jsx)("dd",{className:r?"mt-0.5 font-mono text-foreground":"mt-0.5 text-foreground",children:a})]})}t(se,"Row");function Xs(){const{gatewayId:s="",tab:a}=rs(),r=Ne(),m=Z(),{pushToast:u}=W(),{selectedCompanyId:i}=Ze(),{setBreadcrumbs:j}=is(),[x,y]=(0,l.useState)(!1),[f,w]=(0,l.useState)(!1),[g,k]=(0,l.useState)([]),p=Ss(a)?a:null,N=K({queryKey:V(i??"__none__"),queryFn:t(()=>P.listGateways(i),"queryFn"),enabled:!!i}),b=K({queryKey:J.tools.profiles(i??"__none__"),queryFn:t(()=>P.listProfiles(i),"queryFn"),enabled:!!i}),d=K({queryKey:J.tools.connections(i??"__none__"),queryFn:t(()=>P.listConnections(i),"queryFn"),enabled:!!i}),M=K({queryKey:J.tools.applications(i??"__none__"),queryFn:t(()=>P.listApplications(i),"queryFn"),enabled:!!i}),T=K({queryKey:J.agents.list(i??"__none__"),queryFn:t(()=>ms.list(i),"queryFn"),enabled:!!i}),E=K({...fs(i??"__none__",{includeArchived:!0}),enabled:!!i}),S=Ee(N),v=(0,l.useMemo)(()=>(N.data?.gateways??[]).find(h=>h.id===s),[N.data,s]),o=(0,l.useMemo)(()=>(b.data?.profiles??[]).find(h=>h.id===v?.profileId),[b.data,v?.profileId]),C=(0,l.useMemo)(()=>Ns(o,M.data?.applications??[],d.data?.connections??[]),[o,M.data,d.data]),I=(0,l.useMemo)(()=>new Map((T.data??[]).map(h=>[h.id,h.name])),[T.data]),G=(0,l.useMemo)(()=>new Map((E.data??[]).map(h=>[h.id,h.name])),[E.data]);function D(h){k(_=>[h,..._.filter(X=>X.id!==h.id)])}t(D,"rememberCreatedToken"),(0,l.useEffect)(()=>{if(v)return j([{label:"Connectors",href:"/apps"},{label:"Gateways",href:"/apps/gateways"},{label:v.name}]),()=>j([])},[j,v]);const Q=F({mutationFn:t(()=>P.updateGateway(i,s,{status:v&&Me(v)?"disabled":"active"}),"mutationFn"),onSuccess:t(async h=>{u({title:h.status==="active"?"Gateway on":"Gateway off",body:h.status==="active"?`${h.name} is exposing its tools again.`:`${h.name} is off — every client goes silent.`,tone:"success"}),await m.invalidateQueries({queryKey:V(i)})},"onSuccess"),onError:t(h=>u({title:"Couldn't update the gateway",body:$(h).body,tone:"error"}),"onError")});return i?p?N.isLoading||S.kind==="reconnecting"?(0,e.jsxs)("div",{className:"max-w-4xl space-y-4",children:[(0,e.jsx)(B,{className:"h-10 w-64"}),(0,e.jsx)(B,{className:"h-9 w-full max-w-lg"}),(0,e.jsx)(B,{className:"h-64 w-full"})]}):S.kind==="error"?(0,e.jsx)(we,{size:"page",error:N.error,action:"load the gateway",onRetry:S.retry,retrying:S.isFetching}):v?(0,e.jsxs)("div",{className:"max-w-4xl space-y-5 pb-12",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:(0,e.jsx)(Y,{to:"/apps/gateways",className:"hover:underline",children:"Apps · Gateways"})}),(0,e.jsx)("h1",{className:"mt-1 text-2xl font-bold tracking-tight",children:v.name}),(0,e.jsx)(As,{endpointPath:v.endpointPath,className:"mt-1 max-w-xl"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(c,{variant:"outline",onClick:t(()=>w(!0),"onClick"),children:[(0,e.jsx)(ns,{className:"mr-1.5 h-4 w-4"}),"Edit"]}),(0,e.jsxs)(c,{onClick:t(()=>y(!0),"onClick"),children:[(0,e.jsx)(Ue,{className:"mr-1.5 h-4 w-4"}),"Client snippets"]})]})]}),(0,e.jsx)("nav",{className:"flex items-center gap-6 overflow-x-auto border-b border-border text-sm","aria-label":"Gateway tabs",children:Ps.map(h=>{const _=h.key===p;return(0,e.jsx)(Y,{to:he(s,h.key),className:A("-mb-px shrink-0 border-b-2 pb-2.5 pt-1 font-medium transition-colors",_?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),"aria-current":_?"page":void 0,children:h.label},h.key)})}),p==="overview"&&(0,e.jsx)(Ds,{gateway:v,profile:o,apps:C,agentNames:I,projectNames:G,toggleDisabled:Q.isPending,onToggle:t(()=>Q.mutate(),"onToggle")}),p==="apps"&&(0,e.jsx)(zs,{apps:C,profile:o}),p==="tokens"&&(0,e.jsx)(Rs,{companyId:i,gateway:v,onTokenCreated:D}),p==="activity"&&(0,e.jsx)(Ls,{companyId:i,gateway:v}),p==="advanced"&&(0,e.jsx)(Qs,{companyId:i,gateway:v}),(0,e.jsx)(Es,{gateway:v,open:x,onOpenChange:y,createdTokens:g,onTokenCreated:D}),(0,e.jsx)(Is,{companyId:i,gateway:v,profiles:b.data?.profiles??[],open:f,onOpenChange:w})]}):(0,e.jsxs)("div",{className:"max-w-3xl p-6",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"We couldn’t find that gateway."}),(0,e.jsx)(c,{className:"mt-4",variant:"outline",onClick:t(()=>r("/apps/gateways"),"onClick"),children:"Back to gateways"})]}):(0,e.jsx)(us,{replace:!0,to:he(s,"overview")}):(0,e.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"Select an organization to manage gateways."})}t(Xs,"GatewayDetail");export{Xs as GatewayDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var W=Object.defineProperty;var r=(o,d)=>W(o,"name",{value:d,configurable:!0});import{a as B}from"./rolldown-runtime-DhZMWcEn.js";import{$A as U,Ep as X,GS as g,IC as Z,Jp as u,LS as ee,ME as se,NE as O,Yb as ae,__ as te,ab as re,bE as ne,hE as oe,ib as ie,mb as L,nj as le,qC as R,rb as ce,sv as de,ub as pe,xE as l,x_ as me}from"./index-
|
|
1
|
+
var W=Object.defineProperty;var r=(o,d)=>W(o,"name",{value:d,configurable:!0});import{a as B}from"./rolldown-runtime-DhZMWcEn.js";import{$A as U,Ep as X,GS as g,IC as Z,Jp as u,LS as ee,ME as se,NE as O,Yb as ae,__ as te,ab as re,bE as ne,hE as oe,ib as ie,mb as L,nj as le,qC as R,rb as ce,sv as de,ub as pe,xE as l,x_ as me}from"./index-BJtnP7H1.js";import{a as A}from"./shared-D37zfckm.js";import{a as ue,b as P,c as xe,d as F,l as he,m as ye,n as be,o as ge,p as k,r as K,t as I}from"./CopyableGatewayUrl-B6K3rOal.js";var c=B(le(),1),e=B(U(),1);function Ce(){const o=ae(),d=se(),{pushToast:S}=de(),{selectedCompanyId:t}=ee(),{setBreadcrumbs:w}=ie(),[f,z]=(0,c.useState)(""),[D,N]=(0,c.useState)(!1);(0,c.useEffect)(()=>(w([{label:"Connectors",href:"/apps"},{label:"Gateways"}]),()=>w([])),[w]);const x=l({queryKey:K(t??"__none__"),queryFn:r(()=>u.listGateways(t),"queryFn"),enabled:!!t}),q=l({queryKey:g.tools.profiles(t??"__none__"),queryFn:r(()=>u.listProfiles(t),"queryFn"),enabled:!!t}),H=l({queryKey:g.tools.connections(t??"__none__"),queryFn:r(()=>u.listConnections(t),"queryFn"),enabled:!!t}),V=l({queryKey:g.tools.applications(t??"__none__"),queryFn:r(()=>u.listApplications(t),"queryFn"),enabled:!!t}),G=l({queryKey:g.agents.list(t??"__none__"),queryFn:r(()=>ce.list(t),"queryFn"),enabled:!!t}),Q=l({...me(t??"__none__"),enabled:!!t}),h=pe(x),Y=(0,c.useMemo)(()=>new Map((q.data?.profiles??[]).map(s=>[s.id,s])),[q.data]),$=(0,c.useMemo)(()=>new Map((G.data??[]).map(s=>[s.id,s.name])),[G.data]),E=(0,c.useMemo)(()=>new Map((Q.data??[]).map(s=>[s.id,s.name])),[Q.data]),M=ne({mutationFn:r(({gateway:s})=>u.updateGateway(t,s.id,{status:k(s)?"disabled":"active"}),"mutationFn"),onSuccess:r(async s=>{S({title:s.status==="active"?"Gateway on":"Gateway off",body:s.status==="active"?`${s.name} is exposing its tools again.`:`${s.name} is off — every client goes silent.`,tone:"success"}),await d.invalidateQueries({queryKey:K(t)})},"onSuccess"),onError:r(s=>S({title:"Couldn't update the gateway",body:oe(s).body,tone:"error"}),"onError")});if(!t)return(0,e.jsx)("div",{className:"p-6 text-sm text-muted-foreground",children:"Select an organization to manage gateways."});const v=x.data?.gateways??[],y=f.trim().toLowerCase(),J=y?v.filter(s=>{const b=F(s,E,$).toLowerCase();return s.name.toLowerCase().includes(y)||s.displaySlug.toLowerCase().includes(y)||b.includes(y)}):v;return(0,e.jsxs)("div",{className:"max-w-5xl space-y-5",children:[(0,e.jsxs)("header",{className:"space-y-1",children:[(0,e.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Apps"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"A gateway is one safe MCP endpoint that exposes only the apps you assign. Hand it to a client like Cursor or Claude Desktop."})]}),x.isLoading||h.kind==="reconnecting"?(0,e.jsxs)("div",{className:"space-y-3 pt-2",children:[(0,e.jsx)(L,{className:"h-9 w-full max-w-sm"}),(0,e.jsx)(L,{className:"h-52 w-full"})]}):h.kind==="error"?(0,e.jsx)(re,{error:x.error,action:"load gateways",onRetry:h.retry,retrying:h.isFetching}):v.length===0?(0,e.jsx)(je,{onCreate:r(()=>N(!0),"onCreate")}):(0,e.jsxs)("div",{className:"space-y-4 pt-1",children:[(0,e.jsxs)("div",{"data-canonical-toolbar":"gateways",role:"toolbar","aria-label":"Gateway controls",className:"flex flex-wrap items-center justify-between gap-3",children:[(0,e.jsxs)("div",{className:"relative w-full max-w-sm",children:[(0,e.jsx)(Z,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,e.jsx)(te,{value:f,onChange:r(s=>z(s.target.value),"onChange"),placeholder:"Search by name, app, or owner",className:"pl-9","aria-label":"Search gateways"})]}),(0,e.jsxs)(O,{"data-toolbar-primary":!0,className:"ml-auto",onClick:r(()=>N(!0),"onClick"),children:[(0,e.jsx)(R,{className:"mr-1.5 h-4 w-4"}),"New gateway"]})]}),(()=>{const s=J.map(a=>{const n=Y.get(a.profileId),i=xe(n,V.data?.applications??[],H.data?.connections??[]);return{gateway:a,profile:n,scope:F(a,E,$),appsLabel:`${i.length} ${i.length===1?"app":"apps"}${n?` · ${ge(n)}`:""}`,active:ue(a),expiring:he(a),lastUsed:ye(a),href:P(a.id,"overview")}}),b=r(a=>(0,e.jsx)(X,{checked:k(a),disabled:M.isPending,onClick:r(n=>n.stopPropagation(),"onClick"),onCheckedChange:r(()=>M.mutate({gateway:a}),"onCheckedChange"),"aria-label":`Turn ${a.name} ${k(a)?"off":"on"}`}),"toggle"),T=(0,e.jsxs)("div",{className:"px-4 py-8 text-center text-sm text-muted-foreground",children:["No gateways match “",f.trim(),"”."]});return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"hidden overflow-x-auto rounded-lg border border-border sm:block",children:(0,e.jsxs)("table",{className:"w-full min-w-(--sz-40rem) text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-border bg-muted/40 text-left text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:[(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5",children:"Gateway"}),(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5",children:"Scope"}),(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5",children:"Apps"}),(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5",children:"Tokens"}),(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5",children:"Last used"}),(0,e.jsx)("th",{className:"whitespace-nowrap px-4 py-2.5 text-right",children:"On"})]})}),(0,e.jsxs)("tbody",{children:[s.map(({gateway:a,scope:n,appsLabel:i,active:_,expiring:p,lastUsed:m,href:C})=>(0,e.jsxs)("tr",{onClick:r(()=>o(C),"onClick"),className:"cursor-pointer border-b border-border transition-colors last:border-0 hover:bg-muted/30",children:[(0,e.jsxs)("td",{className:"w-64 max-w-64 whitespace-nowrap px-4 py-3",children:[(0,e.jsx)("div",{className:"font-medium text-foreground",children:a.name}),(0,e.jsx)(I,{endpointPath:a.endpointPath})]}),(0,e.jsx)("td",{className:"whitespace-nowrap px-4 py-3 text-muted-foreground",children:n}),(0,e.jsx)("td",{className:"whitespace-nowrap px-4 py-3 text-muted-foreground",children:i}),(0,e.jsxs)("td",{className:"whitespace-nowrap px-4 py-3 text-muted-foreground",children:[_," active",p>0?` · ${p} expiring`:""]}),(0,e.jsx)("td",{className:"whitespace-nowrap px-4 py-3 text-muted-foreground",children:m?(0,e.jsx)(A,{value:m}):"—"}),(0,e.jsx)("td",{className:"px-4 py-3",children:(0,e.jsx)("div",{className:"flex justify-end",children:b(a)})})]},a.id)),s.length===0?(0,e.jsx)("tr",{children:(0,e.jsx)("td",{colSpan:6,children:T})}):null]})]})}),(0,e.jsxs)("div",{className:"space-y-3 sm:hidden",children:[s.map(({gateway:a,scope:n,appsLabel:i,active:_,expiring:p,lastUsed:m,href:C})=>(0,e.jsxs)("div",{onClick:r(()=>o(C),"onClick"),className:"cursor-pointer rounded-lg border border-border p-4 transition-colors hover:bg-muted/30",children:[(0,e.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"font-medium text-foreground",children:a.name}),(0,e.jsx)(I,{endpointPath:a.endpointPath})]}),(0,e.jsx)("div",{className:"shrink-0",children:b(a)})]}),(0,e.jsxs)("dl",{className:"mt-3 grid grid-cols-2 gap-x-4 gap-y-2 text-sm",children:[(0,e.jsx)(j,{label:"Scope",value:n}),(0,e.jsx)(j,{label:"Apps",value:i}),(0,e.jsx)(j,{label:"Tokens",value:`${_} active${p>0?` · ${p} expiring`:""}`}),(0,e.jsx)(j,{label:"Last used",value:m?(0,e.jsx)(A,{value:m}):"—"})]})]},a.id)),s.length===0?(0,e.jsx)("div",{className:"rounded-lg border border-border",children:T}):null]})]})})(),(0,e.jsxs)("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3",children:[(0,e.jsx)("div",{className:"text-sm font-semibold text-foreground",children:"Why a gateway?"}),(0,e.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:"You pick which apps go through it, who can use it, and how. Revoke the token, the whole gateway goes silent — no app-by-app cleanup."})]})]}),(0,e.jsx)(be,{companyId:t,open:D,onOpenChange:N,onCreated:r(s=>o(P(s,"overview")),"onCreated")})]})}r(Ce,"GatewaysList");function j({label:o,value:d}){return(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("dt",{className:"text-(length:--text-micro) font-semibold uppercase tracking-wide text-muted-foreground",children:o}),(0,e.jsx)("dd",{className:"mt-0.5 truncate text-foreground",children:d})]})}r(j,"MobileField");function je({onCreate:o}){return(0,e.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-12 text-center",children:[(0,e.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"No gateways yet"}),(0,e.jsx)("p",{className:"mx-auto mt-2 max-w-sm text-sm text-muted-foreground",children:"Group your connected apps into one safe endpoint you can hand to a client, then revoke it in one move."}),(0,e.jsxs)(O,{className:"mt-5",onClick:o,children:[(0,e.jsx)(R,{className:"mr-1.5 h-4 w-4"}),"New gateway"]})]})}r(je,"EmptyGateways");export{Ce as GatewaysList};
|
package/dist/assets/{GitHubConnectionRecovery-B9sFWJup.js → GitHubConnectionRecovery-6VshLoNV.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var pe=Object.defineProperty;var a=(t,s)=>pe(t,"name",{value:s,configurable:!0});import{a as V}from"./rolldown-runtime-DhZMWcEn.js";import{a as ue}from"./chat-channels-DWyry-9M.js";import{$A as he,$S as Q,Fu as W,Gb as E,HC as me,NE as h,Ti as Y,Wf as ge,__ as f,_w as Z,hC as xe,kT as F,nj as be,op as J,rT as ve,tT as S,vT as X,vb as ee,xb as te,yb as se,zE as ae}from"./index-Bt31d8ga.js";function we(t,s){const i=t.setup?.slackAccount;return s&&i?.status==="linked"&&i.paperclipUserId===s&&i.dmChannelId&&t.providerAccountId?`https://app.slack.com/client/${encodeURIComponent(t.providerAccountId)}/${encodeURIComponent(i.dmChannelId)}`:t.setup?.providerUrl??"https://app.slack.com"}a(we,"slackConversationUrl");var e=V(he(),1);function Ce({children:t,label:s="Advanced"}){return(0,e.jsxs)("details",{className:"group text-sm",children:[(0,e.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,e.jsx)(F,{className:"size-4 transition-transform group-open:rotate-90","aria-hidden":"true"}),s]}),(0,e.jsx)("div",{className:"mt-4 space-y-4",children:t})]})}a(Ce,"SlackSetupAdvanced");function Ae({value:t,readOnly:s,onChange:i,onBlur:g}){const c=ue.safeParse(t);return(0,e.jsxs)("div",{className:"space-y-3 text-sm",children:[[["appName","Slack app name",35,"The name of your app in Slack’s app directory and settings."],["botName","Bot display name",80,"The name people see when your bot sends a message."],["command","Slash command",32,"The command people type in Slack to talk to this agent."]].map(([d,x,N,o])=>(0,e.jsxs)("div",{className:"grid items-center gap-2 sm:grid-cols-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("label",{htmlFor:`slack-${d}`,children:x}),(0,e.jsxs)(ee,{children:[(0,e.jsx)(te,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":`Help with ${x.toLowerCase()}`,className:"rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(X,{className:"size-3.5","aria-hidden":"true"})})}),(0,e.jsx)(se,{className:ae("max-w-xs",Q),children:o})]})]}),(0,e.jsx)(f,{id:`slack-${d}`,value:t[d],maxLength:N,readOnly:s,"aria-invalid":!c.success&&c.error.issues.some(m=>m.path[0]===d),onChange:a(m=>i({...t,[d]:m.target.value}),"onChange"),onBlur:g})]},d)),!c.success&&(0,e.jsx)("p",{role:"alert",className:"text-destructive",children:c.error.issues[0].message})]})}a(Ae,"SlackAppDetails");var p=V(be(),1);function q(t){return`${t.replace(/[^a-zA-Z0-9_-]+/g,"-")||"agent"}-avatar.png`}a(q,"agentAvatarFilename");function ie({avatarUrl:t,name:s,iconOnly:i=!1}){const[g,c]=(0,p.useState)(!1),[d,x]=(0,p.useState)(!1),N=a(async()=>{if(!g){c(!0),x(!1);try{const o=await fetch(t);if(!o.ok||!o.headers.get("content-type")?.startsWith("image/png"))throw new Error("Avatar unavailable");const m=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=m,n.download=q(s),document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(m),1e3)}catch{x(!0)}finally{c(!1)}}},"download");return(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(h,{variant:i?"ghost":"outline",size:i?"icon":"default",asChild:!0,children:(0,e.jsxs)("a",{"aria-label":"Download avatar",title:"Download avatar",href:t,download:q(s),"aria-disabled":g,onClick:a(o=>{o.preventDefault(),N()},"onClick"),children:[g?(0,e.jsx)(Z,{className:"size-4 animate-spin"}):(0,e.jsx)(ve,{className:"size-4"}),!i&&"Download avatar"]})}),d&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Couldn’t download the avatar. Try downloading it again."})]})}a(ie,"AgentAvatarDownload");function fe({title:t,children:s}){return(0,e.jsxs)("details",{className:"group/disclosure text-sm",children:[(0,e.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-sm py-2 font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[(0,e.jsx)(F,{className:"size-4 shrink-0 transition-transform group-open/disclosure:rotate-90"}),t]}),(0,e.jsx)("div",{className:"space-y-4 pb-2 pt-3",children:s})]})}a(fe,"GitHubSettingsDisclosure");function ne(t){const s=t.botUsername?.replace(/^@/,"").replace(/\[bot\]$/,"");return s?`@${s}`:null}a(ne,"gitHubBotMention");function H(t){const s=t.setup?.github,i=ne(t)?.slice(1);return i?s?.appOwnerType==="organization"&&s.appOwnerLogin?`https://github.com/organizations/${encodeURIComponent(s.appOwnerLogin)}/settings/apps/${encodeURIComponent(i)}`:s?.appOwnerType==="personal"?`https://github.com/settings/apps/${encodeURIComponent(i)}`:"https://github.com/settings/apps":"https://github.com/settings/apps"}a(H,"gitHubAppSettingsUrl");function Ge({endpoint:t}){const s=ne(t);return s?(0,e.jsx)(W,{text:s,ariaLabel:"Copy GitHub mention",title:"Copy GitHub mention",className:"break-all font-mono text-xs",children:s}):null}a(Ge,"GitHubBotMention");function Se({endpoint:t,avatarUrl:s}){return(0,e.jsx)(fe,{title:"GitHub App name and logo",children:(0,e.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Change the name or upload a logo in the App’s Display information settings on GitHub."}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[s&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("img",{src:s,alt:`${t.assignedAgentName}’s avatar for download`,className:"size-12 shrink-0 object-contain"}),(0,e.jsx)(ie,{avatarUrl:s,name:t.botLabel??t.assignedAgentName})]}),(0,e.jsx)(h,{variant:"outline",asChild:!0,children:(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer","aria-label":"Edit App name and logo on GitHub",children:["Edit on GitHub ",(0,e.jsx)(S,{className:"size-4"})]})})]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Renaming also changes its @mention."," ",(0,e.jsx)(E,{className:"underline underline-offset-4",to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,children:"Reconnect afterward"})," ","to update it here."]})]})})}a(Se,"GitHubAppBranding");function He({endpoint:t,avatarUrl:s}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[s&&(0,e.jsx)(ie,{avatarUrl:s,name:t.botLabel??t.assignedAgentName,iconOnly:!0}),(0,e.jsx)(h,{variant:"ghost",size:"sm",asChild:!0,children:(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer","aria-label":"Edit App name and logo on GitHub",title:"Change the App name or upload its logo on GitHub",children:["Edit App ",(0,e.jsx)(S,{className:"size-3.5"})]})}),(0,e.jsx)(h,{variant:"ghost",size:"icon",asChild:!0,children:(0,e.jsx)(E,{to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,"aria-label":"Refresh GitHub App identity",title:"Reconnect after renaming the App to refresh its @mention",children:(0,e.jsx)(me,{className:"size-3.5"})})})]})}a(He,"GitHubAppIdentityActions");function Ie({endpoint:t}){return["attention","revoked"].includes(t.status)?(0,e.jsxs)("section",{"aria-label":"GitHub connection needs repair",className:"flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/5 p-4",children:[(0,e.jsx)(xe,{className:"mt-0.5 size-5 shrink-0 text-destructive","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:t.status==="revoked"?"GitHub bot is disconnected":"GitHub connection needs repair"}),(0,e.jsx)("p",{className:"text-sm",children:"Reconnect this bot to restore GitHub reviews and @mentions. Start with the App already saved in Microvac."})]}),(0,e.jsx)(h,{asChild:!0,children:(0,e.jsx)(E,{to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,children:"Reconnect GitHub"})}),(t.lastError||t.healthMessage)&&(0,e.jsxs)("details",{className:"text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"Connection details"}),(0,e.jsx)("p",{className:"mt-2 break-words",children:t.lastError??t.healthMessage})]})]})]}):null}a(Ie,"GitHubConnectionRecoveryNotice");var Re=["privateKey","webhookSecret","clientSecret"];function G({id:t,label:s,help:i}){return(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(J,{htmlFor:t,children:s}),(0,e.jsxs)(ee,{children:[(0,e.jsx)(te,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":`Help with ${s}`,className:"rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(X,{className:"size-3.5","aria-hidden":"true"})})}),(0,e.jsx)(se,{className:ae("max-w-xs",Q),children:i})]})]})}a(G,"CredentialLabel");function Ee({endpoint:t,reconnect:s,credentialFields:i,requireAllCredentialFields:g=!1,rotateWebhookSecret:c=!1,rotationAlreadyCommitted:d=!1,onConnect:x,onExit:N}){const[o,m]=(0,p.useState)(!!i||!s),[n,j]=(0,p.useState)({appId:t.botExternalId??"",privateKey:"",webhookSecret:""}),[T,I]=(0,p.useState)(""),[l,y]=(0,p.useState)(!1),[D,b]=(0,p.useState)(""),[z,R]=(0,p.useState)(""),[v,L]=(0,p.useState)(""),[_,U]=(0,p.useState)(null),[w,C]=(0,p.useState)(!1),$=!i||i.includes("privateKey"),P=i?i.includes("webhookSecret"):!s&&!["active","paused","revoked"].includes(t.status),K=t.botLabel??t.setup?.github?.appName??"your existing App",A=!!n.appId.trim()&&!/^\d+$/.test(n.appId.trim()),k=!!n.privateKey.trim()&&!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(n.privateKey),M=!!n.privateKey.trim()&&!k&&!T,re=i?!i.length||A||k||(g?i.some(r=>!n[r]?.trim()):i.every(r=>!n[r]?.trim())):o&&(!n.appId.trim()||!n.privateKey.trim()||A||k||P&&!n.webhookSecret.trim()),O=l?"Checking GitHub…":o?s?"Verify and reconnect":"Connect existing App":"Reconnect saved App";async function oe(){y(!0),b("");try{await x(o?n:void 0)}catch(r){b(r instanceof Error?r.message:"Could not reconnect GitHub. Try again.")}finally{y(!1)}}a(oe,"connect");async function B(r){try{const u=await Y.get(t.id);if(r!==void 0&&(u.setup?.credentialRotationId??null)===r)return C(!1),!0;L(""),U(null),b("The webhook secret changed, but this page did not receive it. Generate another secret and update GitHub.")}catch{}return C(!0),!1}a(B,"checkSavedRotation");async function le(){const r=_??(v?void 0:t.setup?.credentialRotationId??null);y(!0),b("");try{const u=await Y.generateSetupSecret(t.id);L(u.webhookSecret),U(u.credentialRotationId??null),C(!1)}catch(u){b(u instanceof Error?u.message:"Could not generate the webhook secret. Try again."),C(!0),await B(r)}finally{y(!1)}}return a(le,"generateSecret"),(0,e.jsxs)("div",{className:"space-y-6",children:[s&&(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("p",{className:"text-sm",children:["Restore ",(0,e.jsx)("strong",{children:K})," using its saved credentials. Microvac will check the App and its installation, then repair event delivery."]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your agent, repository choices, review settings, and task history stay attached to this connection. You don’t need to create another GitHub App."})]}),c&&(0,e.jsxs)("section",{"aria-label":"Rotate webhook secret",className:"space-y-3",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Rotate the webhook secret"}),(0,e.jsx)("p",{className:"text-sm",children:d?"The rotated secret is saved. Reconnect using that value; Microvac will check GitHub’s signed delivery.":(0,e.jsxs)(e.Fragment,{children:["Generate a new secret, then replace the webhook secret in ",(0,e.jsx)("a",{href:H(t),target:"_blank",rel:"noreferrer",className:"underline",children:"GitHub App settings"}),". GitHub must verify the new secret before you reconnect."]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating immediately invalidates the previous secret. This value is shown only here; keep this page open until you have copied it."}),(0,e.jsx)(h,{type:"button",variant:"outline",disabled:l,onClick:a(()=>{le()},"onClick"),children:v||d?"Generate another secret":"Generate webhook secret"}),w&&(0,e.jsx)("p",{role:"status",className:"text-sm",children:"The active secret is not confirmed. Check its saved status before using an earlier value."}),w&&v&&(0,e.jsx)(h,{type:"button",variant:"outline",disabled:l,onClick:a(async()=>{y(!0);try{await B(_??void 0)&&b("")}finally{y(!1)}},"onClick"),children:"Check saved secret status"}),v&&!w&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(J,{htmlFor:"github-rotation-secret",children:"New webhook secret"}),(0,e.jsx)(f,{id:"github-rotation-secret",type:"password",autoComplete:"off",disabled:l,readOnly:!0,value:v}),!l&&(0,e.jsx)(W,{text:v,ariaLabel:"Copy webhook secret",className:"text-sm underline",children:"Copy webhook secret"})]})]}),D&&(0,e.jsxs)("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm",children:[(0,e.jsx)("p",{className:"font-medium",children:c?"Could not finish secret rotation":o?"Could not reconnect this App":"Could not reconnect the saved App"}),(0,e.jsx)("p",{className:"break-words",children:D}),(0,e.jsx)("p",{children:c?"Use the newest secret in GitHub App settings, then retry reconnecting after GitHub verifies delivery.":"Try again if the service is temporarily unavailable. If GitHub rejected the saved key, replace the credentials for this same App below."})]}),s&&!c&&!i&&(0,e.jsx)(h,{variant:"link",className:"h-auto p-0",disabled:l,onClick:a(()=>{m(!o),b("")},"onClick"),children:o?"Use saved credentials instead":"Replace App credentials…"}),o&&(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:s?"Replace credentials for the same App":"Connect your existing GitHub App"}),(0,e.jsxs)("p",{children:[(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 underline",children:["Open GitHub App settings",(0,e.jsx)(S,{className:"size-3.5"})]})," and choose ",(0,e.jsx)("strong",{children:K}),"."]}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"If it’s owned by an organization, open that organization’s Settings → Developer settings → GitHub Apps → Edit. You’ll need permission to manage the App."}),i&&(0,e.jsx)("p",{className:"text-muted-foreground",children:"Enter the requested credentials below. Other saved credentials stay in place."})]}),$&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-app-id",label:"App ID",help:"The numeric App ID on the GitHub App’s settings page. This is different from its Client ID or installation ID."}),(0,e.jsxs)("p",{id:"github-app-id-help",className:"text-sm text-muted-foreground",children:["Copy ",(0,e.jsx)("strong",{children:"App ID"})," from the App’s settings page. ",s&&"The saved ID is filled in when available."]}),(0,e.jsx)(f,{id:"github-app-id","aria-describedby":"github-app-id-help",inputMode:"numeric",value:n.appId,disabled:l,"aria-invalid":A,onChange:a(r=>j({...n,appId:r.target.value}),"onChange")}),A&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Use the numeric App ID, not the Client ID."})]}),$&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-private-key",label:"Private key",help:"Upload the .pem file downloaded from this GitHub App, or paste its entire contents, including the BEGIN and END lines."}),(0,e.jsxs)("ol",{id:"github-private-key-help",className:"list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,e.jsxs)("li",{children:["In the same App’s settings, open ",(0,e.jsx)("strong",{children:"Credentials → Key pairs → New key"}),". On the older settings page, use ",(0,e.jsx)("strong",{children:"Private keys → Generate a private key"}),"."]}),(0,e.jsxs)("li",{children:["Upload the downloaded ",(0,e.jsx)("strong",{children:".pem"})," file below, or paste its entire contents."]})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You can reuse a .pem file you already saved. GitHub cannot show an old private key again. Creating a new key for the same App keeps its installation."}),(0,e.jsx)(f,{type:"file",accept:".pem","aria-label":"Upload private key PEM file",disabled:l,onChange:a(async r=>{const u=r.target.files?.[0];if(u){R("");try{const ce=await u.text();j(de=>({...de,privateKey:ce})),I("")}catch{R("Could not read this file. Try again or paste the key below.")}}},"onChange")}),(0,e.jsx)(f,{id:"github-private-key",type:"password",autoComplete:"off",placeholder:M?"Paste a replacement PEM key":"Or paste the complete PEM key","aria-describedby":"github-private-key-help",disabled:l,value:T,"aria-invalid":k,onPaste:a(r=>{r.preventDefault(),j({...n,privateKey:r.clipboardData.getData("text")}),I(""),R("")},"onPaste"),onChange:a(r=>{I(r.target.value),j({...n,privateKey:r.target.value})},"onChange")}),M&&(0,e.jsx)("p",{role:"status",className:"text-sm",children:"Private key loaded. Paste or upload another key to replace it."}),k&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Use a PEM private key, including its BEGIN and END lines. A token or client secret won’t work here."}),z&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:z}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-sm underline",href:"https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps",target:"_blank",rel:"noreferrer",children:["GitHub’s private key instructions",(0,e.jsx)(S,{className:"size-3.5"})]})]}),P&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-webhook-secret",label:"Webhook secret",help:"The secret configured for this App’s webhook. It must match GitHub exactly."}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Use the secret saved when you configured this App’s webhook. If you no longer have it, change the webhook secret in GitHub App settings and enter the same value here."}),(0,e.jsx)(f,{id:"github-webhook-secret",type:"password",autoComplete:"off",disabled:l,value:n.webhookSecret,onChange:a(r=>j({...n,webhookSecret:r.target.value}),"onChange")})]}),i?.includes("clientSecret")&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-client-secret",label:"Client secret",help:"The client secret for this GitHub App’s user authentication. Leave the saved private key in place."}),(0,e.jsx)(f,{id:"github-client-secret",type:"password",autoComplete:"off",disabled:l,value:n.clientSecret??"",onChange:a(r=>j({...n,clientSecret:r.target.value}),"onChange")})]})]}),(0,e.jsx)(ge,{onSaveExit:N,disabled:l,children:(0,e.jsxs)(h,{"aria-label":O,disabled:l||re||w||c&&!v&&!d,onClick:a(()=>{oe()},"onClick"),children:[l&&(0,e.jsx)(Z,{className:"size-4 animate-spin","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sm:hidden","aria-hidden":"true",children:l?"Checking…":s?"Reconnect":"Connect"}),(0,e.jsx)("span",{className:"hidden sm:inline","aria-hidden":"true",children:O})]})})]})}a(Ee,"GitHubAppRecovery");export{He as a,fe as c,we as d,Se as i,Ae as l,Ee as n,Ge as o,Ie as r,ne as s,Re as t,Ce as u};
|
|
1
|
+
var pe=Object.defineProperty;var a=(t,s)=>pe(t,"name",{value:s,configurable:!0});import{a as V}from"./rolldown-runtime-DhZMWcEn.js";import{a as ue}from"./chat-channels-CzTZV2fr.js";import{$A as he,$S as Q,Fu as W,Gb as E,HC as me,NE as h,Ti as Y,Wf as ge,__ as f,_w as Z,hC as xe,kT as F,nj as be,op as J,rT as ve,tT as S,vT as X,vb as ee,xb as te,yb as se,zE as ae}from"./index-BJtnP7H1.js";function we(t,s){const i=t.setup?.slackAccount;return s&&i?.status==="linked"&&i.paperclipUserId===s&&i.dmChannelId&&t.providerAccountId?`https://app.slack.com/client/${encodeURIComponent(t.providerAccountId)}/${encodeURIComponent(i.dmChannelId)}`:t.setup?.providerUrl??"https://app.slack.com"}a(we,"slackConversationUrl");var e=V(he(),1);function Ce({children:t,label:s="Advanced"}){return(0,e.jsxs)("details",{className:"group text-sm",children:[(0,e.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-1.5 text-muted-foreground hover:text-foreground",children:[(0,e.jsx)(F,{className:"size-4 transition-transform group-open:rotate-90","aria-hidden":"true"}),s]}),(0,e.jsx)("div",{className:"mt-4 space-y-4",children:t})]})}a(Ce,"SlackSetupAdvanced");function Ae({value:t,readOnly:s,onChange:i,onBlur:g}){const c=ue.safeParse(t);return(0,e.jsxs)("div",{className:"space-y-3 text-sm",children:[[["appName","Slack app name",35,"The name of your app in Slack’s app directory and settings."],["botName","Bot display name",80,"The name people see when your bot sends a message."],["command","Slash command",32,"The command people type in Slack to talk to this agent."]].map(([d,x,N,o])=>(0,e.jsxs)("div",{className:"grid items-center gap-2 sm:grid-cols-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("label",{htmlFor:`slack-${d}`,children:x}),(0,e.jsxs)(ee,{children:[(0,e.jsx)(te,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":`Help with ${x.toLowerCase()}`,className:"rounded-sm text-muted-foreground hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(X,{className:"size-3.5","aria-hidden":"true"})})}),(0,e.jsx)(se,{className:ae("max-w-xs",Q),children:o})]})]}),(0,e.jsx)(f,{id:`slack-${d}`,value:t[d],maxLength:N,readOnly:s,"aria-invalid":!c.success&&c.error.issues.some(m=>m.path[0]===d),onChange:a(m=>i({...t,[d]:m.target.value}),"onChange"),onBlur:g})]},d)),!c.success&&(0,e.jsx)("p",{role:"alert",className:"text-destructive",children:c.error.issues[0].message})]})}a(Ae,"SlackAppDetails");var p=V(be(),1);function q(t){return`${t.replace(/[^a-zA-Z0-9_-]+/g,"-")||"agent"}-avatar.png`}a(q,"agentAvatarFilename");function ie({avatarUrl:t,name:s,iconOnly:i=!1}){const[g,c]=(0,p.useState)(!1),[d,x]=(0,p.useState)(!1),N=a(async()=>{if(!g){c(!0),x(!1);try{const o=await fetch(t);if(!o.ok||!o.headers.get("content-type")?.startsWith("image/png"))throw new Error("Avatar unavailable");const m=URL.createObjectURL(await o.blob()),n=document.createElement("a");n.href=m,n.download=q(s),document.body.append(n),n.click(),n.remove(),setTimeout(()=>URL.revokeObjectURL(m),1e3)}catch{x(!0)}finally{c(!1)}}},"download");return(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(h,{variant:i?"ghost":"outline",size:i?"icon":"default",asChild:!0,children:(0,e.jsxs)("a",{"aria-label":"Download avatar",title:"Download avatar",href:t,download:q(s),"aria-disabled":g,onClick:a(o=>{o.preventDefault(),N()},"onClick"),children:[g?(0,e.jsx)(Z,{className:"size-4 animate-spin"}):(0,e.jsx)(ve,{className:"size-4"}),!i&&"Download avatar"]})}),d&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Couldn’t download the avatar. Try downloading it again."})]})}a(ie,"AgentAvatarDownload");function fe({title:t,children:s}){return(0,e.jsxs)("details",{className:"group/disclosure text-sm",children:[(0,e.jsxs)("summary",{className:"flex cursor-pointer list-none items-center gap-2 rounded-sm py-2 font-medium text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:[(0,e.jsx)(F,{className:"size-4 shrink-0 transition-transform group-open/disclosure:rotate-90"}),t]}),(0,e.jsx)("div",{className:"space-y-4 pb-2 pt-3",children:s})]})}a(fe,"GitHubSettingsDisclosure");function ne(t){const s=t.botUsername?.replace(/^@/,"").replace(/\[bot\]$/,"");return s?`@${s}`:null}a(ne,"gitHubBotMention");function H(t){const s=t.setup?.github,i=ne(t)?.slice(1);return i?s?.appOwnerType==="organization"&&s.appOwnerLogin?`https://github.com/organizations/${encodeURIComponent(s.appOwnerLogin)}/settings/apps/${encodeURIComponent(i)}`:s?.appOwnerType==="personal"?`https://github.com/settings/apps/${encodeURIComponent(i)}`:"https://github.com/settings/apps":"https://github.com/settings/apps"}a(H,"gitHubAppSettingsUrl");function Ge({endpoint:t}){const s=ne(t);return s?(0,e.jsx)(W,{text:s,ariaLabel:"Copy GitHub mention",title:"Copy GitHub mention",className:"break-all font-mono text-xs",children:s}):null}a(Ge,"GitHubBotMention");function Se({endpoint:t,avatarUrl:s}){return(0,e.jsx)(fe,{title:"GitHub App name and logo",children:(0,e.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Change the name or upload a logo in the App’s Display information settings on GitHub."}),(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[s&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("img",{src:s,alt:`${t.assignedAgentName}’s avatar for download`,className:"size-12 shrink-0 object-contain"}),(0,e.jsx)(ie,{avatarUrl:s,name:t.botLabel??t.assignedAgentName})]}),(0,e.jsx)(h,{variant:"outline",asChild:!0,children:(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer","aria-label":"Edit App name and logo on GitHub",children:["Edit on GitHub ",(0,e.jsx)(S,{className:"size-4"})]})})]}),(0,e.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Renaming also changes its @mention."," ",(0,e.jsx)(E,{className:"underline underline-offset-4",to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,children:"Reconnect afterward"})," ","to update it here."]})]})})}a(Se,"GitHubAppBranding");function He({endpoint:t,avatarUrl:s}){return(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-1",children:[s&&(0,e.jsx)(ie,{avatarUrl:s,name:t.botLabel??t.assignedAgentName,iconOnly:!0}),(0,e.jsx)(h,{variant:"ghost",size:"sm",asChild:!0,children:(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer","aria-label":"Edit App name and logo on GitHub",title:"Change the App name or upload its logo on GitHub",children:["Edit App ",(0,e.jsx)(S,{className:"size-3.5"})]})}),(0,e.jsx)(h,{variant:"ghost",size:"icon",asChild:!0,children:(0,e.jsx)(E,{to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,"aria-label":"Refresh GitHub App identity",title:"Reconnect after renaming the App to refresh its @mention",children:(0,e.jsx)(me,{className:"size-3.5"})})})]})}a(He,"GitHubAppIdentityActions");function Ie({endpoint:t}){return["attention","revoked"].includes(t.status)?(0,e.jsxs)("section",{"aria-label":"GitHub connection needs repair",className:"flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/5 p-4",children:[(0,e.jsx)(xe,{className:"mt-0.5 size-5 shrink-0 text-destructive","aria-hidden":"true"}),(0,e.jsxs)("div",{className:"min-w-0 space-y-3",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:t.status==="revoked"?"GitHub bot is disconnected":"GitHub connection needs repair"}),(0,e.jsx)("p",{className:"text-sm",children:"Reconnect this bot to restore GitHub reviews and @mentions. Start with the App already saved in Microvac."})]}),(0,e.jsx)(h,{asChild:!0,children:(0,e.jsx)(E,{to:`/apps/chat/connect?provider=github&resume=${t.id}&reconnect=1`,children:"Reconnect GitHub"})}),(t.lastError||t.healthMessage)&&(0,e.jsxs)("details",{className:"text-sm",children:[(0,e.jsx)("summary",{className:"cursor-pointer text-muted-foreground",children:"Connection details"}),(0,e.jsx)("p",{className:"mt-2 break-words",children:t.lastError??t.healthMessage})]})]})]}):null}a(Ie,"GitHubConnectionRecoveryNotice");var Re=["privateKey","webhookSecret","clientSecret"];function G({id:t,label:s,help:i}){return(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)(J,{htmlFor:t,children:s}),(0,e.jsxs)(ee,{children:[(0,e.jsx)(te,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":`Help with ${s}`,className:"rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:(0,e.jsx)(X,{className:"size-3.5","aria-hidden":"true"})})}),(0,e.jsx)(se,{className:ae("max-w-xs",Q),children:i})]})]})}a(G,"CredentialLabel");function Ee({endpoint:t,reconnect:s,credentialFields:i,requireAllCredentialFields:g=!1,rotateWebhookSecret:c=!1,rotationAlreadyCommitted:d=!1,onConnect:x,onExit:N}){const[o,m]=(0,p.useState)(!!i||!s),[n,j]=(0,p.useState)({appId:t.botExternalId??"",privateKey:"",webhookSecret:""}),[T,I]=(0,p.useState)(""),[l,y]=(0,p.useState)(!1),[D,b]=(0,p.useState)(""),[z,R]=(0,p.useState)(""),[v,L]=(0,p.useState)(""),[_,U]=(0,p.useState)(null),[w,C]=(0,p.useState)(!1),$=!i||i.includes("privateKey"),P=i?i.includes("webhookSecret"):!s&&!["active","paused","revoked"].includes(t.status),K=t.botLabel??t.setup?.github?.appName??"your existing App",A=!!n.appId.trim()&&!/^\d+$/.test(n.appId.trim()),k=!!n.privateKey.trim()&&!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(n.privateKey),M=!!n.privateKey.trim()&&!k&&!T,re=i?!i.length||A||k||(g?i.some(r=>!n[r]?.trim()):i.every(r=>!n[r]?.trim())):o&&(!n.appId.trim()||!n.privateKey.trim()||A||k||P&&!n.webhookSecret.trim()),O=l?"Checking GitHub…":o?s?"Verify and reconnect":"Connect existing App":"Reconnect saved App";async function oe(){y(!0),b("");try{await x(o?n:void 0)}catch(r){b(r instanceof Error?r.message:"Could not reconnect GitHub. Try again.")}finally{y(!1)}}a(oe,"connect");async function B(r){try{const u=await Y.get(t.id);if(r!==void 0&&(u.setup?.credentialRotationId??null)===r)return C(!1),!0;L(""),U(null),b("The webhook secret changed, but this page did not receive it. Generate another secret and update GitHub.")}catch{}return C(!0),!1}a(B,"checkSavedRotation");async function le(){const r=_??(v?void 0:t.setup?.credentialRotationId??null);y(!0),b("");try{const u=await Y.generateSetupSecret(t.id);L(u.webhookSecret),U(u.credentialRotationId??null),C(!1)}catch(u){b(u instanceof Error?u.message:"Could not generate the webhook secret. Try again."),C(!0),await B(r)}finally{y(!1)}}return a(le,"generateSecret"),(0,e.jsxs)("div",{className:"space-y-6",children:[s&&(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("p",{className:"text-sm",children:["Restore ",(0,e.jsx)("strong",{children:K})," using its saved credentials. Microvac will check the App and its installation, then repair event delivery."]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Your agent, repository choices, review settings, and task history stay attached to this connection. You don’t need to create another GitHub App."})]}),c&&(0,e.jsxs)("section",{"aria-label":"Rotate webhook secret",className:"space-y-3",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:"Rotate the webhook secret"}),(0,e.jsx)("p",{className:"text-sm",children:d?"The rotated secret is saved. Reconnect using that value; Microvac will check GitHub’s signed delivery.":(0,e.jsxs)(e.Fragment,{children:["Generate a new secret, then replace the webhook secret in ",(0,e.jsx)("a",{href:H(t),target:"_blank",rel:"noreferrer",className:"underline",children:"GitHub App settings"}),". GitHub must verify the new secret before you reconnect."]})}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Generating immediately invalidates the previous secret. This value is shown only here; keep this page open until you have copied it."}),(0,e.jsx)(h,{type:"button",variant:"outline",disabled:l,onClick:a(()=>{le()},"onClick"),children:v||d?"Generate another secret":"Generate webhook secret"}),w&&(0,e.jsx)("p",{role:"status",className:"text-sm",children:"The active secret is not confirmed. Check its saved status before using an earlier value."}),w&&v&&(0,e.jsx)(h,{type:"button",variant:"outline",disabled:l,onClick:a(async()=>{y(!0);try{await B(_??void 0)&&b("")}finally{y(!1)}},"onClick"),children:"Check saved secret status"}),v&&!w&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(J,{htmlFor:"github-rotation-secret",children:"New webhook secret"}),(0,e.jsx)(f,{id:"github-rotation-secret",type:"password",autoComplete:"off",disabled:l,readOnly:!0,value:v}),!l&&(0,e.jsx)(W,{text:v,ariaLabel:"Copy webhook secret",className:"text-sm underline",children:"Copy webhook secret"})]})]}),D&&(0,e.jsxs)("div",{role:"alert",className:"space-y-2 rounded-lg border border-destructive/40 bg-destructive/5 p-4 text-sm",children:[(0,e.jsx)("p",{className:"font-medium",children:c?"Could not finish secret rotation":o?"Could not reconnect this App":"Could not reconnect the saved App"}),(0,e.jsx)("p",{className:"break-words",children:D}),(0,e.jsx)("p",{children:c?"Use the newest secret in GitHub App settings, then retry reconnecting after GitHub verifies delivery.":"Try again if the service is temporarily unavailable. If GitHub rejected the saved key, replace the credentials for this same App below."})]}),s&&!c&&!i&&(0,e.jsx)(h,{variant:"link",className:"h-auto p-0",disabled:l,onClick:a(()=>{m(!o),b("")},"onClick"),children:o?"Use saved credentials instead":"Replace App credentials…"}),o&&(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2 text-sm",children:[(0,e.jsx)("h2",{className:"text-base font-semibold",children:s?"Replace credentials for the same App":"Connect your existing GitHub App"}),(0,e.jsxs)("p",{children:[(0,e.jsxs)("a",{href:H(t),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 underline",children:["Open GitHub App settings",(0,e.jsx)(S,{className:"size-3.5"})]})," and choose ",(0,e.jsx)("strong",{children:K}),"."]}),(0,e.jsx)("p",{className:"text-muted-foreground",children:"If it’s owned by an organization, open that organization’s Settings → Developer settings → GitHub Apps → Edit. You’ll need permission to manage the App."}),i&&(0,e.jsx)("p",{className:"text-muted-foreground",children:"Enter the requested credentials below. Other saved credentials stay in place."})]}),$&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-app-id",label:"App ID",help:"The numeric App ID on the GitHub App’s settings page. This is different from its Client ID or installation ID."}),(0,e.jsxs)("p",{id:"github-app-id-help",className:"text-sm text-muted-foreground",children:["Copy ",(0,e.jsx)("strong",{children:"App ID"})," from the App’s settings page. ",s&&"The saved ID is filled in when available."]}),(0,e.jsx)(f,{id:"github-app-id","aria-describedby":"github-app-id-help",inputMode:"numeric",value:n.appId,disabled:l,"aria-invalid":A,onChange:a(r=>j({...n,appId:r.target.value}),"onChange")}),A&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Use the numeric App ID, not the Client ID."})]}),$&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-private-key",label:"Private key",help:"Upload the .pem file downloaded from this GitHub App, or paste its entire contents, including the BEGIN and END lines."}),(0,e.jsxs)("ol",{id:"github-private-key-help",className:"list-decimal space-y-2 pl-5 text-sm text-muted-foreground",children:[(0,e.jsxs)("li",{children:["In the same App’s settings, open ",(0,e.jsx)("strong",{children:"Credentials → Key pairs → New key"}),". On the older settings page, use ",(0,e.jsx)("strong",{children:"Private keys → Generate a private key"}),"."]}),(0,e.jsxs)("li",{children:["Upload the downloaded ",(0,e.jsx)("strong",{children:".pem"})," file below, or paste its entire contents."]})]}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"You can reuse a .pem file you already saved. GitHub cannot show an old private key again. Creating a new key for the same App keeps its installation."}),(0,e.jsx)(f,{type:"file",accept:".pem","aria-label":"Upload private key PEM file",disabled:l,onChange:a(async r=>{const u=r.target.files?.[0];if(u){R("");try{const ce=await u.text();j(de=>({...de,privateKey:ce})),I("")}catch{R("Could not read this file. Try again or paste the key below.")}}},"onChange")}),(0,e.jsx)(f,{id:"github-private-key",type:"password",autoComplete:"off",placeholder:M?"Paste a replacement PEM key":"Or paste the complete PEM key","aria-describedby":"github-private-key-help",disabled:l,value:T,"aria-invalid":k,onPaste:a(r=>{r.preventDefault(),j({...n,privateKey:r.clipboardData.getData("text")}),I(""),R("")},"onPaste"),onChange:a(r=>{I(r.target.value),j({...n,privateKey:r.target.value})},"onChange")}),M&&(0,e.jsx)("p",{role:"status",className:"text-sm",children:"Private key loaded. Paste or upload another key to replace it."}),k&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:"Use a PEM private key, including its BEGIN and END lines. A token or client secret won’t work here."}),z&&(0,e.jsx)("p",{role:"alert",className:"text-sm text-destructive",children:z}),(0,e.jsxs)("a",{className:"inline-flex items-center gap-1 text-sm underline",href:"https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/managing-private-keys-for-github-apps",target:"_blank",rel:"noreferrer",children:["GitHub’s private key instructions",(0,e.jsx)(S,{className:"size-3.5"})]})]}),P&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-webhook-secret",label:"Webhook secret",help:"The secret configured for this App’s webhook. It must match GitHub exactly."}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Use the secret saved when you configured this App’s webhook. If you no longer have it, change the webhook secret in GitHub App settings and enter the same value here."}),(0,e.jsx)(f,{id:"github-webhook-secret",type:"password",autoComplete:"off",disabled:l,value:n.webhookSecret,onChange:a(r=>j({...n,webhookSecret:r.target.value}),"onChange")})]}),i?.includes("clientSecret")&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(G,{id:"github-client-secret",label:"Client secret",help:"The client secret for this GitHub App’s user authentication. Leave the saved private key in place."}),(0,e.jsx)(f,{id:"github-client-secret",type:"password",autoComplete:"off",disabled:l,value:n.clientSecret??"",onChange:a(r=>j({...n,clientSecret:r.target.value}),"onChange")})]})]}),(0,e.jsx)(ge,{onSaveExit:N,disabled:l,children:(0,e.jsxs)(h,{"aria-label":O,disabled:l||re||w||c&&!v&&!d,onClick:a(()=>{oe()},"onClick"),children:[l&&(0,e.jsx)(Z,{className:"size-4 animate-spin","aria-hidden":"true"}),(0,e.jsx)("span",{className:"sm:hidden","aria-hidden":"true",children:l?"Checking…":s?"Reconnect":"Connect"}),(0,e.jsx)("span",{className:"hidden sm:inline","aria-hidden":"true",children:O})]})})]})}a(Ee,"GitHubAppRecovery");export{He as a,fe as c,we as d,Se as i,Ae as l,Ee as n,Ge as o,Ie as r,ne as s,Re as t,Ce as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var H=Object.defineProperty;var t=(s,n)=>H(s,"name",{value:n,configurable:!0});import{a as L}from"./rolldown-runtime-DhZMWcEn.js";import{et as E}from"./issue-detail-
|
|
1
|
+
var H=Object.defineProperty;var t=(s,n)=>H(s,"name",{value:n,configurable:!0});import{a as L}from"./rolldown-runtime-DhZMWcEn.js";import{et as E}from"./issue-detail-CZfjXs0M.js";import{b,i as R}from"./collections-B58p51lw.js";import{$A as J,Ai as G,Cx as W,DC as F,Dy as X,Ex as Y,Fd as Z,GS as m,Gb as k,IE as ee,LS as O,ME as se,Mi as A,NE as v,Tx as ae,UE as q,_ as te,aE as ne,ab as re,bE as _,ci as le,d as ie,eD as oe,ei as ce,fk as de,g as ue,ib as me,ji as pe,ki as xe,nj as he,p as je,pb as fe,pk as ge,qC as ye,rb as be,ub as ve,xE as j,x_ as Ne,zE as Q}from"./index-BJtnP7H1.js";import{t as y}from"./goals-BNJZ4nzg.js";import{t as Se}from"./EntityRow-BsICt6pd.js";import{t as we}from"./GoalTree-CU4GBFCh.js";var h=L(he(),1),e=L(J(),1);function u({label:s,children:n}){return(0,e.jsxs)("div",{className:"flex items-start gap-3 py-1.5",children:[(0,e.jsx)("span",{className:"text-xs text-muted-foreground shrink-0 w-20 mt-0.5",children:s}),(0,e.jsx)("div",{className:"flex items-center gap-1.5 min-w-0 flex-1 flex-wrap",children:n})]})}t(u,"PropertyRow");function Pe(s){return s.replace(/_/g," ").replace(/\b\w/g,n=>n.toUpperCase())}t(Pe,"label");function z({current:s,options:n,onChange:l,children:p}){const[x,c]=(0,h.useState)(!1);return(0,e.jsxs)(W,{open:x,onOpenChange:c,children:[(0,e.jsx)(Y,{asChild:!0,children:(0,e.jsx)("button",{className:"cursor-pointer hover:opacity-80 transition-opacity",children:p})}),(0,e.jsx)(ae,{className:"w-40 p-1",align:"end",children:n.map(d=>(0,e.jsx)(v,{variant:"ghost",size:"sm",className:Q("w-full justify-start text-xs",d===s&&"bg-accent"),onClick:t(()=>{l(d),c(!1)},"onClick"),children:Pe(d)},d))})]})}t(z,"PickerButton");function T({goal:s,onUpdate:n}){const{selectedCompanyId:l}=O(),{data:p}=j({queryKey:m.agents.list(l),queryFn:t(()=>be.list(l),"queryFn"),enabled:!!l}),{data:x}=j({queryKey:m.goals.list(l),queryFn:t(()=>y.list(l),"queryFn"),enabled:!!l}),c=s.ownerAgentId?p?.find(i=>i.id===s.ownerAgentId):null,d=s.parentId?x?.find(i=>i.id===s.parentId):null;return(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(u,{label:"Status",children:n?(0,e.jsx)(z,{current:s.status,options:ge,onChange:t(i=>n({status:i}),"onChange"),children:(0,e.jsx)(b,{status:s.status})}):(0,e.jsx)(b,{status:s.status})}),(0,e.jsx)(u,{label:"Level",children:n?(0,e.jsx)(z,{current:s.level,options:de,onChange:t(i=>n({level:i}),"onChange"),children:(0,e.jsx)("span",{className:"text-sm capitalize",children:s.level})}):(0,e.jsx)("span",{className:"text-sm capitalize",children:s.level})}),(0,e.jsx)(u,{label:"Owner",children:c?(0,e.jsx)(k,{to:ee(c),className:"text-sm hover:underline",children:c.name}):(0,e.jsx)("span",{className:"text-sm text-muted-foreground",children:"None"})}),s.parentId&&(0,e.jsx)(u,{label:"Parent Goal",children:(0,e.jsx)(k,{to:`/goals/${s.parentId}`,className:"text-sm hover:underline",children:d?.title??s.parentId.slice(0,8)})})]}),(0,e.jsx)(R,{}),(0,e.jsxs)("div",{className:"space-y-1",children:[(0,e.jsx)(u,{label:"Created",children:(0,e.jsx)("span",{className:"text-sm",children:q(s.createdAt)})}),(0,e.jsx)(u,{label:"Updated",children:(0,e.jsx)("span",{className:"text-sm",children:q(s.updatedAt)})})]})]})}t(T,"GoalProperties");function Ie({panelVisible:s,onShowProperties:n}){return(0,e.jsx)(v,{variant:"ghost",size:"icon-xs",className:Q("hidden md:inline-flex shrink-0 transition-opacity duration-200",s?"opacity-0 pointer-events-none w-0 overflow-hidden":"opacity-100"),onClick:n,"aria-label":"Show properties",title:"Show properties",children:(0,e.jsx)(F,{className:"h-4 w-4"})})}t(Ie,"GoalPropertiesToggleButton");function Te(){const{goalId:s}=ne(),{selectedCompanyId:n,setSelectedCompanyId:l}=O(),{openNewGoal:p}=X(),{openPanel:x,closePanel:c,panelVisible:d,setPanelVisible:i}=le(),{setBreadcrumbs:w}=me(),P=se(),[K,I]=(0,h.useState)(!1),C=j({queryKey:m.goals.detail(s),queryFn:t(()=>y.get(s),"queryFn"),enabled:!!s}),{data:r,isLoading:B,error:D}=C,f=ve(C),o=r?.companyId??n,{data:U}=j({queryKey:m.goals.list(o),queryFn:t(()=>y.list(o),"queryFn"),enabled:!!o}),{data:V}=j({...Ne(o,{includeArchived:!0}),enabled:!!o});(0,h.useEffect)(()=>{!r?.companyId||r.companyId===n||l(r.companyId,{source:"route_sync"})},[r?.companyId,n,l]);const g=_({mutationFn:t(a=>y.update(s,a),"mutationFn"),onSuccess:t(()=>{P.invalidateQueries({queryKey:m.goals.detail(s)}),o&&P.invalidateQueries({queryKey:m.goals.list(o)})},"onSuccess")}),M=_({mutationFn:t(async a=>{if(!o)throw new Error("No organization selected");return Z.uploadImage(o,a,`goals/${s??"draft"}`)},"mutationFn")}),N=(U??[]).filter(a=>a.parentId===s),S=(V??[]).filter(a=>s?a.goalIds.includes(s)||a.goals.some($=>$.id===s)?!0:a.goalId===s:!1);return(0,h.useEffect)(()=>{w([{label:"Goals",href:"/goals"},{label:r?.title??s??"Goal"}])},[w,r,s]),(0,h.useEffect)(()=>(r&&x((0,e.jsx)(T,{goal:r,onUpdate:t(a=>g.mutate(a),"onUpdate")})),()=>c()),[r]),B||f.kind==="reconnecting"?(0,e.jsx)(fe,{variant:"detail"}):f.kind==="error"?(0,e.jsx)(re,{size:"page",error:D,action:"load this goal",onRetry:f.retry,retrying:f.isFetching}):r?(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:"text-xs uppercase text-muted-foreground",children:r.level}),(0,e.jsx)(b,{status:r.status}),(0,e.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,e.jsx)(v,{variant:"ghost",size:"icon-xs",className:"inline-flex md:hidden shrink-0",onClick:t(()=>I(!0),"onClick"),"aria-label":"Properties",title:"Properties",children:(0,e.jsx)(F,{className:"h-4 w-4"})}),(0,e.jsx)(Ie,{panelVisible:d,onShowProperties:t(()=>i(!0),"onShowProperties")})]})]}),(0,e.jsx)(E,{value:r.title,onSave:t(a=>g.mutate({title:a}),"onSave"),as:"h2",className:"text-xl font-bold"}),(0,e.jsx)(E,{value:r.description??"",onSave:t(a=>g.mutate({description:a}),"onSave"),as:"p",className:"text-sm text-muted-foreground",placeholder:"Add a description...",multiline:!0,imageUploadHandler:t(async a=>(await M.mutateAsync(a)).contentPath,"imageUploadHandler")})]}),(0,e.jsxs)(xe,{defaultValue:"children",children:[(0,e.jsxs)(pe,{children:[(0,e.jsxs)(A,{value:"children",children:["Sub-Goals (",N.length,")"]}),(0,e.jsxs)(A,{value:"projects",children:["Projects (",S.length,")"]})]}),(0,e.jsxs)(G,{value:"children",className:"mt-4 space-y-3",children:[(0,e.jsx)("div",{className:"flex items-center justify-start",children:(0,e.jsxs)(v,{size:"sm",variant:"outline",onClick:t(()=>p({parentId:s}),"onClick"),children:[(0,e.jsx)(ye,{className:"h-3.5 w-3.5 mr-1.5"}),"Sub Goal"]})}),N.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No sub-goals."}):(0,e.jsx)(we,{goals:N,goalLink:t(a=>`/goals/${a.id}`,"goalLink")})]}),(0,e.jsx)(G,{value:"projects",className:"mt-4",children:S.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No linked projects."}):(0,e.jsx)("div",{className:"border border-border",children:S.map(a=>(0,e.jsx)(Se,{title:a.name,subtitle:a.description??void 0,to:oe(a),trailing:(0,e.jsx)(b,{status:a.status})},a.id))})})]}),(0,e.jsx)(ie,{open:K,onOpenChange:I,children:(0,e.jsxs)(je,{side:"bottom",className:"max-h-(--sz-85dvh) pb-(--sz-safe-bottom)","data-testid":"mobile-goal-properties-sheet",children:[(0,e.jsx)(ue,{children:(0,e.jsx)(te,{className:"text-sm",children:"Properties"})}),(0,e.jsx)(ce,{className:"flex-1 overflow-y-auto",children:(0,e.jsx)("div",{className:"px-4 pb-4",children:(0,e.jsx)(T,{goal:r,onUpdate:t(a=>g.mutate(a),"onUpdate")})})})]})})]}):null}t(Te,"GoalDetail");export{Te as GoalDetail};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var d=(t,s)=>v(t,"name",{value:s,configurable:!0});import{a as h}from"./rolldown-runtime-DhZMWcEn.js";import{b}from"./collections-
|
|
1
|
+
var v=Object.defineProperty;var d=(t,s)=>v(t,"name",{value:s,configurable:!0});import{a as h}from"./rolldown-runtime-DhZMWcEn.js";import{b}from"./collections-B58p51lw.js";import{$A as _,Gb as I,kT as k,nj as y,zE as l}from"./index-BJtnP7H1.js";var C=h(y(),1),e=h(_(),1);function j({goal:t,children:s,allGoals:o,depth:i,goalLink:c,onSelect:r}){const[n,f]=(0,C.useState)(!0),p=s.length>0,x=c?.(t),m=(0,e.jsxs)(e.Fragment,{children:[p?(0,e.jsx)("button",{className:"p-0.5",onClick:d(a=>{a.preventDefault(),a.stopPropagation(),f(!n)},"onClick"),"aria-label":`${t.title} subtree`,"aria-expanded":n,children:(0,e.jsx)(k,{className:l("h-3 w-3 transition-transform",n&&"rotate-90")})}):(0,e.jsx)("span",{className:"w-4"}),(0,e.jsx)("span",{className:"text-xs text-muted-foreground capitalize",children:t.level}),(0,e.jsx)("span",{className:"flex-1 truncate",children:t.title}),(0,e.jsx)(b,{status:t.status})]}),u=l("flex items-center gap-2 px-3 py-1.5 text-sm transition-colors cursor-pointer hover:bg-accent/50");return(0,e.jsxs)("div",{children:[x?(0,e.jsx)(I,{to:x,className:l(u,"no-underline text-inherit"),style:{paddingLeft:`${i*16+12}px`},children:m}):(0,e.jsx)("div",{className:u,style:{paddingLeft:`${i*16+12}px`},onClick:d(()=>r?.(t),"onClick"),children:m}),p&&n&&(0,e.jsx)("div",{children:s.map(a=>(0,e.jsx)(j,{goal:a,children:o.filter(N=>N.parentId===a.id),allGoals:o,depth:i+1,goalLink:c,onSelect:r},a.id))})]})}d(j,"GoalNode");function S({goals:t,goalLink:s,onSelect:o}){const i=new Set(t.map(r=>r.id)),c=t.filter(r=>!r.parentId||!i.has(r.parentId));return t.length===0?(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"No goals."}):(0,e.jsx)("div",{className:"border border-border py-1",children:c.map(r=>(0,e.jsx)(j,{goal:r,children:t.filter(n=>n.parentId===r.id),allGoals:t,depth:0,goalLink:s,onSelect:o},r.id))})}d(S,"GoalTree");export{S as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var p=Object.defineProperty;var a=(s,o)=>p(s,"name",{value:o,configurable:!0});import{a as u}from"./rolldown-runtime-DhZMWcEn.js";import{$A as d,Dy as y,GS as x,LS as j,NE as f,ab as b,ib as h,nj as v,on as l,pb as _,qC as G,ub as N,vC as c,xE as S}from"./index-
|
|
1
|
+
var p=Object.defineProperty;var a=(s,o)=>p(s,"name",{value:o,configurable:!0});import{a as u}from"./rolldown-runtime-DhZMWcEn.js";import{$A as d,Dy as y,GS as x,LS as j,NE as f,ab as b,ib as h,nj as v,on as l,pb as _,qC as G,ub as N,vC as c,xE as S}from"./index-BJtnP7H1.js";import{t as q}from"./goals-BNJZ4nzg.js";import{t as w}from"./GoalTree-CU4GBFCh.js";var E=u(v(),1),e=u(d(),1);function B(){const{selectedCompanyId:s}=j(),{openNewGoal:o}=y(),{setBreadcrumbs:n}=h();(0,E.useEffect)(()=>{n([{label:"Goals"}])},[n]);const i=S({queryKey:x.goals.list(s),queryFn:a(()=>q.list(s),"queryFn"),enabled:!!s}),{data:r,isLoading:m}=i,t=N(i);return s?m||t.kind==="reconnecting"?(0,e.jsx)(_,{variant:"list"}):t.kind==="error"?(0,e.jsx)(b,{size:"page",error:t.error,action:"load goals",onRetry:t.retry,retrying:t.isFetching}):(0,e.jsxs)("div",{className:"space-y-4",children:[r&&r.length===0&&(0,e.jsx)(l,{placement:"upper",icon:c,message:"No goals yet.",action:"Add Goal",onAction:a(()=>o(),"onAction")}),r&&r.length>0&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex items-center justify-start",children:(0,e.jsxs)(f,{size:"sm",variant:"outline",onClick:a(()=>o(),"onClick"),children:[(0,e.jsx)(G,{className:"h-3.5 w-3.5 mr-1.5"}),"New Goal"]})}),(0,e.jsx)(w,{goals:r,goalLink:a(g=>`/goals/${g.id}`,"goalLink")})]})]}):(0,e.jsx)(l,{placement:"upper",icon:c,message:"Select an organization to view goals."})}a(B,"Goals");export{B as Goals};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var M=Object.defineProperty;var t=(y,x)=>M(y,"name",{value:x,configurable:!0});import{a as z}from"./rolldown-runtime-DhZMWcEn.js";import{$A as P,AC as L,E_ as q,GS as c,ME as R,NE as Q,OC as V,Sp as O,VS as B,ab as b,ay as u,bE as E,ib as D,nj as T,sv as $,ub as v,xE as N,zS as G}from"./index-
|
|
1
|
+
var M=Object.defineProperty;var t=(y,x)=>M(y,"name",{value:x,configurable:!0});import{a as z}from"./rolldown-runtime-DhZMWcEn.js";import{$A as P,AC as L,E_ as q,GS as c,ME as R,NE as Q,OC as V,Sp as O,VS as B,ab as b,ay as u,bE as E,ib as D,nj as T,sv as $,ub as v,xE as N,zS as G}from"./index-BJtnP7H1.js";var i=z(T(),1),e=z(P(),1);function X(){const{userId:y,settled:x}=B(),{setBreadcrumbs:S}=D(),{pushToast:w}=$(),o=R(),[l,U]=(0,i.useState)(""),[a,A]=(0,i.useState)(null),[C,I]=(0,i.useState)(new Set);(0,i.useEffect)(()=>{S([{label:"Settings",href:"/company/settings"},{label:"Instance settings",href:"/company/settings/instance/general"},{label:"Access"}])},[S]);const n=N({queryKey:c.access.adminUsers(l),queryFn:t(()=>u.searchAdminUsers(l),"queryFn")}),m=v(n),h=N({...G(y),enabled:x&&n.isSuccess}),g=v(h),K=h.data??[],d=(0,i.useMemo)(()=>n.data?.find(s=>s.id===a)??null,[a,n.data]),r=N({queryKey:c.access.userCompanyAccess(a??""),queryFn:t(()=>u.getUserCompanyAccess(a),"queryFn"),enabled:!!a}),p=v(r);(0,i.useEffect)(()=>{!a&&n.data?.[0]&&A(n.data[0].id)},[a,n.data]),(0,i.useEffect)(()=>{r.data&&I(new Set(r.data.companyAccess.filter(s=>s.status==="active").map(s=>s.companyId)))},[r.data]);const f=E({mutationFn:t(()=>u.setUserCompanyAccess(a,[...C]),"mutationFn"),onSuccess:t(async()=>{await o.invalidateQueries({queryKey:c.access.userCompanyAccess(a)}),await o.invalidateQueries({queryKey:c.access.adminUsers(l)}),await o.invalidateQueries({queryKey:c.companies.all}),w({title:"Organization access updated",tone:"success"})},"onSuccess")}),k=E({mutationFn:t(async s=>{if(!a)throw new Error("No user selected");return s?u.promoteInstanceAdmin(a):u.demoteInstanceAdmin(a)},"mutationFn"),onSuccess:t(async()=>{await o.invalidateQueries({queryKey:c.access.adminUsers(l)}),a&&await o.invalidateQueries({queryKey:c.access.userCompanyAccess(a)}),w({title:"Instance role updated",tone:"success"})},"onSuccess")});return n.isLoading||m.kind==="reconnecting"||!x||n.isSuccess&&(h.isPending||g.kind==="reconnecting")?(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading instance access…"}):m.kind==="error"?m.errorKind==="forbidden"?(0,e.jsx)("div",{className:"text-sm text-destructive",children:"Instance admin access is required to manage users."}):(0,e.jsx)(b,{size:"page",error:n.error,action:"load users",onRetry:m.retry,retrying:m.isFetching}):g.kind==="error"?(0,e.jsx)(b,{size:"page",error:h.error,action:"load organizations",onRetry:g.retry,retrying:g.isFetching}):(0,e.jsxs)("div",{className:"max-w-6xl space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(V,{className:"h-5 w-5 text-muted-foreground"}),(0,e.jsx)("h1",{className:"text-lg font-semibold",children:"Instance Access"})]}),(0,e.jsx)("p",{className:"max-w-3xl text-sm text-muted-foreground",children:"Search users, manage instance-admin status, and control which organizations they can access."})]}),(0,e.jsxs)("div",{className:"grid gap-6 lg:grid-cols-(--gtc-34)",children:[(0,e.jsxs)(q,{className:"block space-y-4 p-4",children:[(0,e.jsxs)("label",{className:"block space-y-2 text-sm",children:[(0,e.jsx)("span",{className:"font-medium",children:"Search users"}),(0,e.jsx)("input",{className:"w-full rounded-md border border-border bg-background px-3 py-2",value:l,onChange:t(s=>U(s.target.value),"onChange"),placeholder:"Search by name or email"})]}),(0,e.jsx)("div",{className:"space-y-2",children:(n.data??[]).map(s=>(0,e.jsxs)("button",{type:"button",onClick:t(()=>A(s.id),"onClick"),className:`w-full rounded-lg border px-3 py-3 text-left transition-colors ${s.id===a?"border-foreground bg-accent":"border-border hover:bg-accent/40"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsx)("div",{className:"truncate font-medium",children:s.name||s.email||s.id}),(0,e.jsx)("div",{className:"truncate text-sm text-muted-foreground",children:s.email||s.id})]}),s.isInstanceAdmin?(0,e.jsx)(L,{className:"h-4 w-4 text-emerald-600"}):null]}),(0,e.jsxs)("div",{className:"mt-2 text-xs text-muted-foreground",children:[s.activeCompanyMembershipCount," active organization memberships"]})]},s.id))})]}),(0,e.jsx)(q,{className:"block space-y-4 p-5",children:a?r.isLoading||p.kind==="reconnecting"?(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"Loading user access…"}):p.kind==="error"?(0,e.jsx)(b,{error:r.error,action:"load user access",onRetry:p.retry,retrying:p.isFetching}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-lg font-semibold",children:d?.name||d?.email||a}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:d?.email||a})]}),(0,e.jsx)(Q,{variant:d?.isInstanceAdmin?"outline":"default",onClick:t(()=>k.mutate(!(d?.isInstanceAdmin??!1)),"onClick"),disabled:k.isPending,children:d?.isInstanceAdmin?"Remove instance admin":"Promote to instance admin"})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Organization access"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"Toggle organization membership for this user. New access defaults to an active operator membership."})]}),(0,e.jsx)("div",{className:"grid gap-3 md:grid-cols-2",children:K.map(s=>(0,e.jsxs)("label",{className:"flex items-start gap-3 rounded-lg border border-border px-3 py-3",children:[(0,e.jsx)(O,{checked:C.has(s.id),onCheckedChange:t(_=>{I(F=>{const j=new Set(F);return _?j.add(s.id):j.delete(s.id),j})},"onCheckedChange")}),(0,e.jsxs)("span",{className:"space-y-1",children:[(0,e.jsx)("span",{className:"block text-sm font-medium",children:s.name}),(0,e.jsx)("span",{className:"block text-xs text-muted-foreground",children:s.issuePrefix})]})]},s.id))}),(0,e.jsx)("div",{className:"flex justify-end",children:(0,e.jsx)(Q,{onClick:t(()=>f.mutate(),"onClick"),disabled:f.isPending,children:f.isPending?"Saving…":"Save organization access"})})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("h2",{className:"text-sm font-semibold",children:"Current memberships"}),(0,e.jsx)("div",{className:"space-y-2",children:(r.data?.companyAccess??[]).map(s=>(0,e.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-border px-3 py-2 text-sm",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"font-medium",children:s.companyName||s.companyId}),(0,e.jsxs)("div",{className:"text-muted-foreground",children:[s.membershipRole||"unset"," • ",s.status]})]}),(0,e.jsx)("div",{className:"text-xs text-muted-foreground",children:new Date(s.updatedAt).toLocaleDateString()})]},s.id))})]})]}):(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"Select a user to inspect instance access."})})]})]})}t(X,"InstanceAccess");export{X as InstanceAccess};
|