ryco-cli 0.1.30 → 0.1.31
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/{AcpAdapter-DjP0IHpH.cjs → AcpAdapter-ByUp9-wk.cjs} +71 -51
- package/dist/{AcpAdapter-CKWzfB3Q.mjs → AcpAdapter-CY_ANTKu.mjs} +73 -53
- package/dist/{AcpNativeLogging-Do0LktDb.mjs → AcpNativeLogging-C7PC6imv.mjs} +30 -4
- package/dist/{AcpNativeLogging-5gTPK9Fq.cjs → AcpNativeLogging-OQeAya9d.cjs} +33 -1
- package/dist/{AcpRegistryDriver-BblCFfev.cjs → AcpRegistryDriver-CD9GN7rI.cjs} +3 -3
- package/dist/{AcpRegistryDriver-BzohT-PC.mjs → AcpRegistryDriver-DMZ5VBWJ.mjs} +4 -4
- package/dist/AzureDevOpsSourceControlProvider-5giVYoNi.mjs +2053 -0
- package/dist/AzureDevOpsSourceControlProvider-BKMXEUaN.cjs +2055 -0
- package/dist/{BitbucketSourceControlProvider-D5UVAc9z.mjs → BitbucketSourceControlProvider-BVUBsEUF.mjs} +63 -23
- package/dist/{BitbucketSourceControlProvider-Bvl_q1o2.cjs → BitbucketSourceControlProvider-BWnnrbch.cjs} +62 -22
- package/dist/{BunPTY-Dcl1Lp62.mjs → BunPTY-CMbDQ1Xb.mjs} +1 -1
- package/dist/{ClaudeDriver-DZkz0QPr.cjs → ClaudeDriver-DCrqouOR.cjs} +1373 -191
- package/dist/{ClaudeDriver-BuQ_azDw.mjs → ClaudeDriver-DVOss8cC.mjs} +1375 -193
- package/dist/{CodexDriver-6Ph2cjAW.cjs → CodexDriver-CBQPHJqU.cjs} +258 -28
- package/dist/{CodexDriver-Bi49RIL4.mjs → CodexDriver-DJoTky7Z.mjs} +261 -31
- package/dist/{CodexTextGeneration-C5TIspJA.mjs → CodexTextGeneration-BSgNgfZv.mjs} +6 -6
- package/dist/{CodexTextGeneration-sXPR9eld.cjs → CodexTextGeneration-C9MDQmZm.cjs} +7 -7
- package/dist/{CopilotDriver-Bcdpz6U_.mjs → CopilotDriver-CUkdPXcH.mjs} +78 -20
- package/dist/{CopilotDriver-D6P0xgRX.cjs → CopilotDriver-DbaMDH16.cjs} +76 -18
- package/dist/{CursorDriver-CRnDGwEv.mjs → CursorDriver-B-ZilXJB.mjs} +114 -97
- package/dist/{CursorDriver-DMJ7sGSx.cjs → CursorDriver-DKQqPbKH.cjs} +114 -97
- package/dist/{ForgejoSourceControlProvider-D4jGdaJX.cjs → ForgejoSourceControlProvider-CgpjFECj.cjs} +94 -60
- package/dist/{ForgejoSourceControlProvider-Dl_Fk3RY.mjs → ForgejoSourceControlProvider-DemMYUye.mjs} +95 -61
- package/dist/{GitHubSourceControlProvider-QMe-zymI.cjs → GitHubSourceControlProvider-C4un6hOK.cjs} +218 -119
- package/dist/{GitHubSourceControlProvider-DnwKf0ap.mjs → GitHubSourceControlProvider-CRSDYcjc.mjs} +206 -108
- package/dist/GitLabSourceControlProvider-D8W1ZLPh.cjs +2260 -0
- package/dist/GitLabSourceControlProvider-DpWkJ0M3.mjs +2258 -0
- package/dist/{GrokDriver-jy8JIvYY.cjs → GrokDriver-BQ6G_7ZZ.cjs} +6 -7
- package/dist/{GrokDriver-Bvq1jP3S.mjs → GrokDriver-Buvas9-q.mjs} +5 -6
- package/dist/{Metrics-CnmjpbWk.mjs → Metrics-C3vLS9rz.mjs} +123 -13
- package/dist/{Metrics-C0LSU8s7.cjs → Metrics-DjRPLE98.cjs} +170 -12
- package/dist/{NodePTY-D7tFWuQe.mjs → NodePTY-DgnuBruq.mjs} +1 -1
- package/dist/{OpenCodeDriver-DhyVaBMT.mjs → OpenCodeDriver-BWEZD841.mjs} +183 -49
- package/dist/{OpenCodeDriver-Bu5D19tl.cjs → OpenCodeDriver-qUiX0RLH.cjs} +183 -49
- package/dist/{SideQuestionIsolation-B-aE6aBz.mjs → SideQuestionIsolation-B1T-DsR0.mjs} +1 -1
- package/dist/{SideQuestionIsolation-CtJ4wX83.cjs → SideQuestionIsolation-BPC-Bxsz.cjs} +1 -1
- package/dist/bin.cjs +37021 -10253
- package/dist/bin.mjs +36892 -10178
- package/dist/client/assets/AccountSettings-B88Q_w9Y.js +1 -0
- package/dist/client/assets/AiFocusSettings-Bb0TrCPn.js +1 -0
- package/dist/client/assets/{AnimatedHeight-UXn4-nUd.js → AnimatedHeight-epXOsgdm.js} +1 -1
- package/dist/client/assets/AppearanceSettings-XS9WRVPU.js +1 -0
- package/dist/client/assets/AutomationsDialog-bZckh4Y3.js +1 -0
- package/dist/client/assets/AutomationsSummary-wPFZCF49.js +1 -0
- package/dist/client/assets/BranchToolbar.logic-DjzLKbbB.js +3 -0
- package/dist/client/assets/BrowserPanel-CdBLnnfz.js +1 -0
- package/dist/client/assets/ChatRightPanel-BCINd0vP.js +34 -0
- package/dist/client/assets/ChatThreadRouteView-BFZ0Si-l.js +1 -0
- package/dist/client/assets/ColorSwatchPicker-CGyo99o0.js +1 -0
- package/dist/client/assets/CommandPalette.logic-BIOMtnEQ.js +1 -0
- package/dist/client/assets/CommandPaletteDialog-Db4LH--z.js +2 -0
- package/dist/client/assets/CompositeRoot-DtnwMJKj.js +1 -0
- package/dist/client/assets/ComputerUseSettings-CkqCqDsU.js +1 -0
- package/dist/client/assets/ConnectionsSettings-B9mxExdG.js +7 -0
- package/dist/client/assets/CreatePullRequestDialog-CJ7pNCue.js +1 -0
- package/dist/client/assets/CreatePullRequestDialogHost-n4ZjdSr4.js +1 -0
- package/dist/client/assets/DiagnosticsSettings-f9rFG9re.js +2 -0
- package/dist/client/assets/DiagnosticsSettings.logic-Byf-Bu4S.js +1 -0
- package/dist/client/assets/DialogHandle-C0c_rK3I.js +1 -0
- package/dist/client/assets/{DialogPopup-NfwDyR5c.js → DialogPopup-BKW1PEEa.js} +1 -1
- package/dist/client/assets/DialogRoot-BIubqrv0.js +1 -0
- package/dist/client/assets/DialogTitle-BAX_FLoG.js +1 -0
- package/dist/client/assets/{DialogViewport-B6w_ROOE.js → DialogViewport-C2iOUx0O.js} +1 -1
- package/dist/client/assets/DiffPanel-BkqDt_SS.js +25 -0
- package/dist/client/assets/DisclosureRegion-B8556yU0.js +1 -0
- package/dist/client/assets/DraftChatThreadRouteView-BKgRKJ2w.js +1 -0
- package/dist/client/assets/{ExternalIdentityWeb.logic-BlKX8J9h.js → ExternalIdentityWeb.logic-Cu6suNrN.js} +1 -1
- package/dist/client/assets/GlassSurface-DLYYzRdP.js +1 -0
- package/dist/client/assets/HostedConnectionControls-CoVqtnrK.js +1 -0
- package/dist/client/assets/HostedHubRoot-CM2CwPUr.js +2 -0
- package/dist/client/assets/{HostedNativeAuthorizationRoute-j7oSlakZ.js → HostedNativeAuthorizationRoute-Bizmqrh_.js} +2 -2
- package/dist/client/assets/HostedNodeRenameDialog-SXWMsTO0.js +1 -0
- package/dist/client/assets/HostedRelayTrustNotice-BfTyrBi5.js +1 -0
- package/dist/client/assets/InboxStatusGlyph-BPTqzp7l.js +1 -0
- package/dist/client/assets/IntegrationsSettingsPanel-DAPvkV4i.js +1 -0
- package/dist/client/assets/KeybindingsSettings-B8g-YI2O.js +1 -0
- package/dist/client/assets/LazyBrowserPanel-Ds9cdOC_.js +2 -0
- package/dist/client/assets/McpServersSettings-Dw6G3ff3.js +6 -0
- package/dist/client/assets/MobileSheet-DfgXNWbd.js +1 -0
- package/dist/client/assets/ModelTuningDial-DQBAbuNL.js +1 -0
- package/dist/client/assets/NewWorktreeDialog-CDZAJmK6.js +4 -0
- package/dist/client/assets/NodeSecuritySettings-3MELA9ru.js +1 -0
- package/dist/client/assets/NullStore-gT_6_xZE.js +1 -0
- package/dist/client/assets/OnboardingDialog-CAAtNnJf.js +1 -0
- package/dist/client/assets/OpinionatedPluginsSettings-AiDB0Vl4.js +1 -0
- package/dist/client/assets/{PdfAttachmentPreview-C8-hT8KQ.js → PdfAttachmentPreview-BFNW2wjN.js} +2 -2
- package/dist/client/assets/{PhoneGetAppInterstitial-Zh0zpBgT.js → PhoneGetAppInterstitial-D8fwZ8E9.js} +1 -1
- package/dist/client/assets/PhoneHome-YHgHljA0.js +1 -0
- package/dist/client/assets/PhoneSettingsSurface-BVxJppvK.js +2 -0
- package/dist/client/assets/PreviewPanel-BYcEnkv9.js +643 -0
- package/dist/client/assets/ProjectScriptDialog-K34K2Kzm.js +1 -0
- package/dist/client/assets/ProjectsPage-DXnMYLjb.js +1 -0
- package/dist/client/assets/PromoteChatDialog-CAY7_wJ-.js +1 -0
- package/dist/client/assets/ProviderLimitWindow-CK04BSkM.js +1 -0
- package/dist/client/assets/ProviderUpdateLaunchNotification.logic-BMBrDDOC.js +1 -0
- package/dist/client/assets/ProvidersSettingsPanel-C85PX9Es.js +1 -0
- package/dist/client/assets/PullRequestsPage-C0rgfGwB.js +1 -0
- package/dist/client/assets/{QuitShortcutFeedback-Qs9XsuZ4.js → QuitShortcutFeedback-DSkKqETs.js} +1 -1
- package/dist/client/assets/RedactedSensitiveText-DQ0YveQd.js +1 -0
- package/dist/client/assets/RollingText-BzvpP5fa.js +1 -0
- package/dist/client/assets/RootAppShell-BYQ-eGNT.js +6 -0
- package/dist/client/assets/{Separator-B6Esv57Y.js → Separator-DpiW19Vw.js} +1 -1
- package/dist/client/assets/SettingsPage-BCFN7Ju2.js +2 -0
- package/dist/client/assets/SettingsPanels-CP6z2b1x.js +3 -0
- package/dist/client/assets/SettingsPanels.editor-D8U-TWWG.js +1 -0
- package/dist/client/assets/SettingsSelect-DEhNaz3E.js +1 -0
- package/dist/client/assets/Sidebar.logic-D_ODfSpl.js +1 -0
- package/dist/client/assets/SimulatorPanel-DCT6fZ0X.js +1 -0
- package/dist/client/assets/SourceControlSettings-DxUtvPMK.js +1 -0
- package/dist/client/assets/StatisticsPage-C9SrwtM4.js +1 -0
- package/dist/client/assets/StatisticsPanel-BMYLETs0.js +1 -0
- package/dist/client/assets/ThreadLinkList-BN5z5EpS.js +169 -0
- package/dist/client/assets/ThreadTerminalDrawer-CgIFOlR-.js +18 -0
- package/dist/client/assets/ThreadWorkspacePanel-DvXoqQPF.js +3 -0
- package/dist/client/assets/ToolbarRootContext-8FsV9Cpj.js +1 -0
- package/dist/client/assets/TraitsPicker-DcrpJahy.js +1 -0
- package/dist/client/assets/Virtualizer-CwXeUPla.js +1345 -0
- package/dist/client/assets/WorkspacePullRequestPanel-3mlcJn9G.js +1 -0
- package/dist/client/assets/WorkspaceReview-UGbCgXeK.js +2 -0
- package/dist/client/assets/{abnfDiagram-N423BO3Z-ByEe3mC0.js → abnfDiagram-N423BO3Z-DVEM6Scc.js} +1 -1
- package/dist/client/assets/{activity-CwTUF6lv.js → activity-DVCuAejY.js} +1 -1
- package/dist/client/assets/{alert-DQEkrtUJ.js → alert-FV7ZIit_.js} +1 -1
- package/dist/client/assets/alert-dialog-CgXR9tED.js +1 -0
- package/dist/client/assets/app-window-3xtwqZgI.js +1 -0
- package/dist/client/assets/appChrome-COCz-T7w.js +1 -0
- package/dist/client/assets/{appearancePreferences-nFx4MHoI.js → appearancePreferences-NnsvXwBe.js} +1 -1
- package/dist/client/assets/architecture-7GRP2DOG-DXXb_0_g.js +1 -0
- package/dist/client/assets/{architectureDiagram-T3A2C74G-Bd-yxaTr.js → architectureDiagram-T3A2C74G-B6pcKiCj.js} +1 -1
- package/dist/client/assets/{arrow-left-DUOpzEbP.js → arrow-left-Blu3LSE2.js} +1 -1
- package/dist/client/assets/{arrow-right-HOYJnPKw.js → arrow-right-CO3CH0ne.js} +1 -1
- package/dist/client/assets/arrow-up-B69gV2Bq.js +1 -0
- package/dist/client/assets/{arrow-up-right-DHnMKuVA.js → arrow-up-right-BbPGFOLA.js} +1 -1
- package/dist/client/assets/authorization-Ob6YwWiI.js +1 -0
- package/dist/client/assets/autocomplete-RVpjsrDv.js +1 -0
- package/dist/client/assets/ban-BIm2PVkE.js +1 -0
- package/dist/client/assets/{blockDiagram-VBNYF7ZC-CPDBonMC.js → blockDiagram-VBNYF7ZC-WNerGp9V.js} +1 -1
- package/dist/client/assets/{bot-DxjPA7Bw.js → bot-C9nWtaWq.js} +1 -1
- package/dist/client/assets/browserState-jt47YsqD.js +1 -0
- package/dist/client/assets/{c4Diagram-5PPSVZJV-BM6pAiqT.js → c4Diagram-5PPSVZJV-wp1ioOoM.js} +1 -1
- package/dist/client/assets/camera-C13VoW3c.js +1 -0
- package/dist/client/assets/capabilities-CfOhq009.js +1 -0
- package/dist/client/assets/channel-56r2qL2v.js +1 -0
- package/dist/client/assets/{chart-column-Cg7d41tb.js → chart-column-DRv0YtL_.js} +1 -1
- package/dist/client/assets/checkbox-CIIIY9FA.js +1 -0
- package/dist/client/assets/checks-Dw022Bvy.js +1 -0
- package/dist/client/assets/{chunk-2GRJ4B5K-DVKozJ41.js → chunk-2GRJ4B5K-DRl3ILpc.js} +1 -1
- package/dist/client/assets/{chunk-4I5QYGJK-BRoMwPkW.js → chunk-4I5QYGJK-CYTRl4bo.js} +1 -1
- package/dist/client/assets/{chunk-5RXB4S5H-DFMKyoqP.js → chunk-5RXB4S5H-VCNwRsOa.js} +1 -1
- package/dist/client/assets/{chunk-6Q2QTUOP-Ba6UENe9.js → chunk-6Q2QTUOP-DnSeKGPG.js} +1 -1
- package/dist/client/assets/{chunk-7Z6QIM7H-B87gYLWH.js → chunk-7Z6QIM7H-Cjilh9TF.js} +1 -1
- package/dist/client/assets/{chunk-GF5L2VYU-DZ840GRQ.js → chunk-GF5L2VYU-CGR7AW0t.js} +1 -1
- package/dist/client/assets/{chunk-I66GZJ75-BO6p4Aqg.js → chunk-I66GZJ75-CXSn8dDu.js} +1 -1
- package/dist/client/assets/{chunk-JQJVKLGR-5dTfVinz.js → chunk-JQJVKLGR-Dro-75lU.js} +1 -1
- package/dist/client/assets/{chunk-KBJHAD2P-BeWfBZdP.js → chunk-KBJHAD2P-BDqN2kVf.js} +1 -1
- package/dist/client/assets/{chunk-NSK5VX7P-DuRkdn5k.js → chunk-NSK5VX7P-DGo5UczH.js} +1 -1
- package/dist/client/assets/{chunk-QR6OTTB3-Duz4Y_uE.js → chunk-QR6OTTB3-RWuyWnBI.js} +1 -1
- package/dist/client/assets/{chunk-UBXNYLIW-D-z8URgN.js → chunk-UBXNYLIW-BPRzeB0w.js} +1 -1
- package/dist/client/assets/{chunk-W5SLKNZC-AGjFjjoJ.js → chunk-W5SLKNZC-DYWocTFi.js} +1 -1
- package/dist/client/assets/{chunk-WRU74C26-BgY3UiXB.js → chunk-WRU74C26-ChbB1jY3.js} +1 -1
- package/dist/client/assets/circle-stop-D8B4hRpY.js +1 -0
- package/dist/client/assets/circle-x-CNLfrTqR.js +1 -0
- package/dist/client/assets/classDiagram-JCYQIIEL-DGvmFev3.js +1 -0
- package/dist/client/assets/classDiagram-v2-OCEON4UE-DGvmFev3.js +1 -0
- package/dist/client/assets/{clipboard-copy-BWf3JuTE.js → clipboard-copy-DGi8FKNO.js} +1 -1
- package/dist/client/assets/clock-3-DmJ4_XPI.js +1 -0
- package/dist/client/assets/clock-DZIuPtNG.js +1 -0
- package/dist/client/assets/color-picker-BdBXje-a.js +1 -0
- package/dist/client/assets/columns-2-CWlMOClK.js +1 -0
- package/dist/client/assets/combobox-Dtjtf7AB.js +1 -0
- package/dist/client/assets/{cynefin-OW5HDTMX-BuOAGqlK.js → cynefin-OW5HDTMX-TuShvMuM.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-MW4NZA55-DqV0Aokp.js → cynefinDiagram-MW4NZA55-B0Edt2Em.js} +1 -1
- package/dist/client/assets/{dagre-VZM6K2ZE-D_GFquDW.js → dagre-VZM6K2ZE-D-eiuqHx.js} +1 -1
- package/dist/client/assets/{data-list-BJCq3CVP.js → data-list-BAx6jBY1.js} +1 -1
- package/dist/client/assets/desktopUpdateAtoms-BjrLa3tl.js +1 -0
- package/dist/client/assets/desktopWorkspace-C2wXVBhc.js +1 -0
- package/dist/client/assets/{deviceName-C2N8ZRX3.js → deviceName-B4youG0v.js} +1 -1
- package/dist/client/assets/{diagram-7IWD3JNH-B1wlsNg2.js → diagram-7IWD3JNH-DgM6lMlR.js} +1 -1
- package/dist/client/assets/{diagram-B4RE2ZJO-D-CYoym7.js → diagram-B4RE2ZJO-CyHNDjzV.js} +1 -1
- package/dist/client/assets/{diagram-LBJQPF4R-DqJ9NCqt.js → diagram-LBJQPF4R-DDzuLIN5.js} +1 -1
- package/dist/client/assets/{diagram-Q27KOJAE-3yp1D2u4.js → diagram-Q27KOJAE-BaBvK9QB.js} +1 -1
- package/dist/client/assets/{diagram-UB23O5K3-Byp25nGC.js → diagram-UB23O5K3-CzZ2ewuZ.js} +1 -1
- package/dist/client/assets/dialogWords-Cg0YkJVg.js +1 -0
- package/dist/client/assets/diffRouteSearch-D2MKN_ah.js +1 -0
- package/dist/client/assets/disclosureMotion-cbMJn5-z.js +1 -0
- package/dist/client/assets/{download-DsYNYJeu.js → download-TvtXS4hE.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-BXEA7PRR-B_IM1l6o.js → ebnfDiagram-BXEA7PRR-CL1vdOKi.js} +1 -1
- package/dist/client/assets/editorPreferences-DqKyA-2Z.js +1 -0
- package/dist/client/assets/ellipsis-CDK1dNFZ.js +1 -0
- package/dist/client/assets/ellipsis-vertical-CwzEUTwV.js +1 -0
- package/dist/client/assets/{empty-BbJHvskr.js → empty-BovKoxbn.js} +1 -1
- package/dist/client/assets/{erDiagram-JOGREHBK--OtcrCRJ.js → erDiagram-JOGREHBK-DmQR2if6.js} +1 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-D272GIcY.js +1 -0
- package/dist/client/assets/external-link-CJeVJZ7s.js +1 -0
- package/dist/client/assets/eye-BUmrXqzg.js +1 -0
- package/dist/client/assets/file-diff-BWc3mYsz.js +1 -0
- package/dist/client/assets/flowDiagram-UKHOOZJN-DLyS38Mm.js +1 -0
- package/dist/client/assets/folder-git-2-CPxg5wKP.js +1 -0
- package/dist/client/assets/folder-open-DcMymvp1.js +1 -0
- package/dist/client/assets/formatCount-B4KLI651.js +1 -0
- package/dist/client/assets/{ganttDiagram-PKOTCBZU-w0seBi3Q.js → ganttDiagram-PKOTCBZU-1q2nUL92.js} +1 -1
- package/dist/client/assets/git-pull-request-BFPwpm3c.js +1 -0
- package/dist/client/assets/{gitGraph-4MIJSDKK-BOJ0lcSW.js → gitGraph-4MIJSDKK-COtwmv2S.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-DS77QQ5N-BMfOCCYn.js → gitGraphDiagram-DS77QQ5N-ChsvaxX4.js} +1 -1
- package/dist/client/assets/{group-tVMKGp7Q.js → group-DWWn0dTx.js} +1 -1
- package/dist/client/assets/hammer-BXo-EU88.js +1 -0
- package/dist/client/assets/hostedConnectionCoordinator-BkAE-RhA.js +1 -0
- package/dist/client/assets/{index-BqZvnGNr.js → index-DARIYokI.js} +2 -2
- package/dist/client/assets/{info-A6RAGUB7-acjBTQ5o.js → info-A6RAGUB7-CI2qZ9wW.js} +1 -1
- package/dist/client/assets/{infoDiagram-6WML65LV-DB01Nc2m.js → infoDiagram-6WML65LV-BPmgcTPH.js} +1 -1
- package/dist/client/assets/{input-BDWSVClC.js → input-CCie4mm1.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-WSZJBQD7-KhZTvm-J.js → ishikawaDiagram-WSZJBQD7-LyS9p3Yg.js} +1 -1
- package/dist/client/assets/{journeyDiagram-NVQOT4AX-C3JCYk-2.js → journeyDiagram-NVQOT4AX-BYaAmN65.js} +1 -1
- package/dist/client/assets/{kanban-definition-27J2QSJJ-Dbo0C1s6.js → kanban-definition-27J2QSJJ-D-pwzqFt.js} +1 -1
- package/dist/client/assets/{key-round-CETZqe3h.js → key-round-BlrUTfxB.js} +1 -1
- package/dist/client/assets/keyboard-DlBdq6sz.js +1 -0
- package/dist/client/assets/label-ChtVI9lp.js +1 -0
- package/dist/client/assets/layers-BB-ruGvd.js +1 -0
- package/dist/client/assets/lifecycleSuggestionPolicy-0ERe_O53.js +1 -0
- package/dist/client/assets/list-checks-BkM_ZRsj.js +1 -0
- package/dist/client/assets/loader-3vQnfqIT.js +1 -0
- package/dist/client/assets/{log-out-D5-aSBAz.js → log-out-CKq9YiLY.js} +1 -1
- package/dist/client/assets/{logging-B_qXVrk6.js → logging-CCg76rgn.js} +1 -1
- package/dist/client/assets/main-Ch0bwS-M.js +9 -0
- package/dist/client/assets/main-Di0isH9D.css +2 -0
- package/dist/client/assets/{mermaid-parser.core-B6Q-3x_q.js → mermaid-parser.core-RK9ah5RM.js} +2 -2
- package/dist/client/assets/{mermaidEngine-DksLcesB.js → mermaidEngine-Dr8UsPhH.js} +3 -3
- package/dist/client/assets/message-circle-dashed-BrjwqS7-.js +1 -0
- package/dist/client/assets/messageQueueDrain-B7R7Qmq6.js +1 -0
- package/dist/client/assets/messages-square-cDTkDJv_.js +1 -0
- package/dist/client/assets/{mindmap-definition-FAOFIHXS-LaMzRxqw.js → mindmap-definition-FAOFIHXS-DVudWasx.js} +1 -1
- package/dist/client/assets/{packet-AYTQ26CC-BHhg59Si.js → packet-AYTQ26CC-DnkTsVhD.js} +1 -1
- package/dist/client/assets/panels-top-left-B7jZiLth.js +1 -0
- package/dist/client/assets/path-text-3Rfu6lt8.js +1 -0
- package/dist/client/assets/{pegDiagram-VL7TDLO6-s7l7UD9d.js → pegDiagram-VL7TDLO6-Do5PIp8B.js} +1 -1
- package/dist/client/assets/pencil-Bzg-nc6d.js +1 -0
- package/dist/client/assets/{pie-WAS4IAKB-DygX31Z9.js → pie-WAS4IAKB-B_nNQOzn.js} +1 -1
- package/dist/client/assets/{pieDiagram-7S7Q4E2Y-bb6I9TtZ.js → pieDiagram-7S7Q4E2Y-D_IG4xwA.js} +1 -1
- package/dist/client/assets/{play-DUvOxTpL.js → play-DpXXQ1qB.js} +1 -1
- package/dist/client/assets/popover-OWEv6cQz.js +48 -0
- package/dist/client/assets/presentationTier-DPVAxTK4.js +1 -0
- package/dist/client/assets/previewRouteSearch-BjZdTuSf.js +1 -0
- package/dist/client/assets/primary-Cf-xJExj.js +4 -0
- package/dist/client/assets/primitives-CxTBN7D4.js +1 -0
- package/dist/client/assets/projectCheckouts.logic-DUT4AxXr.js +1 -0
- package/dist/client/assets/projectPaths-B8aVmOZX.js +1 -0
- package/dist/client/assets/projectPreferences-CzWBItFj.js +1 -0
- package/dist/client/assets/providerCapabilities-B2YOPsLN.js +1 -0
- package/dist/client/assets/providerDriverMeta-BHHL9uw0.js +1 -0
- package/dist/client/assets/providerModels-v9PYbzRE.js +1 -0
- package/dist/client/assets/providerStatus-CDPaqb0S.js +1 -0
- package/dist/client/assets/pullRequestsModel.logic-Dv_om_C4.js +1 -0
- package/dist/client/assets/{qr-code-dbkTo07n.js → qr-code-BlbiBIwH.js} +1 -1
- package/dist/client/assets/{qr-code-D4CtBq2F.js → qr-code-DywzVgQC.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-CIZ2JOQS-Cj1Y68ZF.js → quadrantDiagram-CIZ2JOQS-DY6fJyrM.js} +1 -1
- package/dist/client/assets/{radar-RG4KPBEZ-FHM3ftPp.js → radar-RG4KPBEZ-D9689I5m.js} +1 -1
- package/dist/client/assets/radio-group-DVwD6Cuy.js +1 -0
- package/dist/client/assets/{railroad-74A4TZTK-CPMn18Cm.js → railroad-74A4TZTK-DVzWbQnl.js} +1 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-C_2P6umA.js +1 -0
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-aGlR3R3z.js +1 -0
- package/dist/client/assets/railroad-peg-WCYAUIDC-DCB9oE8y.js +1 -0
- package/dist/client/assets/{railroadDiagram-AXF67PYL-DyV3SuDj.js → railroadDiagram-AXF67PYL-D1oJ6Jtl.js} +1 -1
- package/dist/client/assets/readCache-B7cDPz2O.js +1 -0
- package/dist/client/assets/{refresh-cw-CgDa2Ok_.js → refresh-cw-CRUTivd6.js} +1 -1
- package/dist/client/assets/{requirementDiagram-LRYGKXZP-_xEAGWaH.js → requirementDiagram-LRYGKXZP-7RM8iREp.js} +1 -1
- package/dist/client/assets/rotate-ccw-BE2ZCwL6.js +1 -0
- package/dist/client/assets/roving-radio-group-NMPWrDqe.js +1 -0
- package/dist/client/assets/rows-2-DDS4dGTX.js +1 -0
- package/dist/client/assets/runtime-DjjjAcTE.js +18 -0
- package/dist/client/assets/safePolygon-C1AzMRS4.js +1 -0
- package/dist/client/assets/{sankeyDiagram-W5VNT64P-Clf6oTLi.js → sankeyDiagram-W5VNT64P-C1tKAPGN.js} +1 -1
- package/dist/client/assets/{save-C8h0AMdl.js → save-OZdkPs_y.js} +1 -1
- package/dist/client/assets/scroll-area-80P7vbjw.js +1 -0
- package/dist/client/assets/{scrollEdges-BXYnwntN.js → scrollEdges-C0Oc-5qi.js} +1 -1
- package/dist/client/assets/select-Cb9FUPHD.js +1 -0
- package/dist/client/assets/separator-CO8bC7Wc.js +1 -0
- package/dist/client/assets/{sequenceDiagram-SI44F4Z6-CcYtQLSe.js → sequenceDiagram-SI44F4Z6-DGVpb7jL.js} +1 -1
- package/dist/client/assets/settings-2-PrRDu6Lc.js +1 -0
- package/dist/client/assets/settingsLayout-CRFNCk_D.js +1 -0
- package/dist/client/assets/sheet-C5DW7qVO.js +1 -0
- package/dist/client/assets/{shield-DPC4oHTi.js → shield-CBHYqlkR.js} +1 -1
- package/dist/client/assets/{shield-alert-CwH36qZb.js → shield-alert-Dc2cGwyR.js} +1 -1
- package/dist/client/assets/{shield-check-CGD7sEeF.js → shield-check-_wl7R4Js.js} +1 -1
- package/dist/client/assets/sidebar-0BBaFNm3.js +1 -0
- package/dist/client/assets/sidebarProjectFolders-BjWzbt8C.js +3 -0
- package/dist/client/assets/sidebarProjectGrouping-nQRStWrZ.js +1 -0
- package/dist/client/assets/sidebarStatusText-BBKuNies.js +1 -0
- package/dist/client/assets/sidebarUndo-Dfq1lvyF.js +1 -0
- package/dist/client/assets/{skeleton-rS3IgBob.js → skeleton-DfUe6VV_.js} +1 -1
- package/dist/client/assets/sliders-horizontal-BGXkwvKv.js +1 -0
- package/dist/client/assets/sliding-tabs-BnDSjRU3.js +39 -0
- package/dist/client/assets/{smartphone-DgVJfbv3.js → smartphone-OEAQOTdv.js} +1 -1
- package/dist/client/assets/spinner-lHRJWsym.js +1 -0
- package/dist/client/assets/square-B05NKv3e.js +1 -0
- package/dist/client/assets/{star-Cqay-Cae.js → star-C8mHmfZu.js} +1 -1
- package/dist/client/assets/{stateDiagram-OKZ733FA-DEKURpRP.js → stateDiagram-OKZ733FA-CCOAegCG.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-D60qqBed.js +1 -0
- package/dist/client/assets/storeSelectors-BichCKDC.js +1 -0
- package/dist/client/assets/surfaceMorph-BTRijmlU.js +1 -0
- package/dist/client/assets/{swimlanes-SLNWSIFB-DrR6sbi6.js → swimlanes-SLNWSIFB-CFsLYT4h.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-D0SaJgSn.js +8 -0
- package/dist/client/assets/switch-oQc7Ifbl.js +1 -0
- package/dist/client/assets/text-wrap-DSRdSfDm.js +1 -0
- package/dist/client/assets/textarea-VyiIZ0wQ.js +1 -0
- package/dist/client/assets/threadPriorityRefreshRuntime-H656C1J_.js +1 -0
- package/dist/client/assets/ticker-CPutfhZ4.js +1 -0
- package/dist/client/assets/{timeline-definition-Z64GVDOM-bQJvmJx5.js → timeline-definition-Z64GVDOM-B4agmO7R.js} +1 -1
- package/dist/client/assets/toggle-DFqtCPt-.js +1 -0
- package/dist/client/assets/toggle-group-C5ICmqkI.js +1 -0
- package/dist/client/assets/{tokenModePresentation-BkS-mry_.js → tokenModePresentation-umDRm4k1.js} +1 -1
- package/dist/client/assets/tooltip-DbqhseXd.js +1 -0
- package/dist/client/assets/{treeView-Q6P3EWNA-D4Ex5QTp.js → treeView-Q6P3EWNA-C_S3udFB.js} +1 -1
- package/dist/client/assets/{treemap-WGGIJYW6-C4B6Y6qM.js → treemap-WGGIJYW6-B-kUSAkE.js} +1 -1
- package/dist/client/assets/undo-2-lyluTGMW.js +1 -0
- package/dist/client/assets/{unplug-B1dczi-t.js → unplug-D6iu-qlh.js} +1 -1
- package/dist/client/assets/usage-ClF-eUmy.js +1 -0
- package/dist/client/assets/useActiveIndicator-R5NWu8Fg.js +1 -0
- package/dist/client/assets/useAppSidebarCollapsed-BbMxfio5.js +1 -0
- package/dist/client/assets/useAppearancePreference-Ix13pMKy.js +1 -0
- package/dist/client/assets/useAtlassian-BYDCc9lv.js +0 -0
- package/dist/client/assets/useCheckoutResolution-CR-oOp5-.js +1 -0
- package/dist/client/assets/useDesktopRelaunchGuard-Jmh615iZ.js +1 -0
- package/dist/client/assets/useDiffFileNavigation-DeuzdD5E.js +15 -0
- package/dist/client/assets/useDiffLayout-DhcXwhBL.js +1 -0
- package/dist/client/assets/useEnvironmentSettingsTarget-DM6BRDT7.js +1 -0
- package/dist/client/assets/useFocus-CV0KIZwg.js +1 -0
- package/dist/client/assets/useGit-CUcs7h5_.js +1 -0
- package/dist/client/assets/useGitBranchSearch-CeKFtnCL.js +1 -0
- package/dist/client/assets/useHostedDraftExecutionTarget-DvQU5UOq.js +1 -0
- package/dist/client/assets/useLabelableId-CEgCRi6q.js +1 -0
- package/dist/client/assets/useLandingFlash-BfOOlFtW.js +1 -0
- package/dist/client/assets/useLogicalProjectSnapshots-CRNZke74.js +1 -0
- package/dist/client/assets/useNavigate-sQZthdyT.js +1 -0
- package/dist/client/assets/usePageLeadingInsetClass-Bf4nUvx4.js +1 -0
- package/dist/client/assets/usePhoneThreadActions-VaQ-mZex.js +1 -0
- package/dist/client/assets/usePopupHandleStore-DimKo2Yy.js +1 -0
- package/dist/client/assets/usePopupViewport-YeqX_UM3.js +1 -0
- package/dist/client/assets/usePresentationTier-B9kCQ4YH.js +1 -0
- package/dist/client/assets/useProject-Kt74Z12J.js +1 -0
- package/dist/client/assets/useProviderOptionsUpdater-CTzNh2B7.js +2 -0
- package/dist/client/assets/usePullRequestFilesViewed-D5Snmzys.js +1 -0
- package/dist/client/assets/usePullRequestsModel-DJL5HHbP.js +40 -0
- package/dist/client/assets/useScrollLock-CLZ31xsK.js +1 -0
- package/dist/client/assets/useSidebarThreadActions-n6EkLATf.js +6 -0
- package/dist/client/assets/{useStatistics-B76_r68I.js → useStatistics-DD0mYS4J.js} +14 -14
- package/dist/client/assets/{useTheme-B441xg4F.js → useTheme-Bdy-BDs-.js} +1 -1
- package/dist/client/assets/useValueChanged-DoumqMnV.js +1 -0
- package/dist/client/assets/{user-round-CLy1Qy1Y.js → user-round-BPDXr8Gq.js} +1 -1
- package/dist/client/assets/{vennDiagram-T6HMQDX7-8iiroXim.js → vennDiagram-T6HMQDX7-B1UEn_j_.js} +1 -1
- package/dist/client/assets/{vscode-icons-CJBVQtq5.js → vscode-icons-Ccy-gzFN.js} +1 -1
- package/dist/client/assets/{wardley-WFR3VGLG-DpyNUbTc.js → wardley-WFR3VGLG-gPdyDc-7.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-T6FBY63Y-CI7is3QO.js → wardleyDiagram-T6FBY63Y-2aDcwOA4.js} +1 -1
- package/dist/client/assets/workspaceLifecycle-OJ1aKksw.js +3 -0
- package/dist/client/assets/workspaceMetadataProjection-CyEyJhUa.js +1 -0
- package/dist/client/assets/workspaceRouteSearch-CCavUdbH.js +1 -0
- package/dist/client/assets/{wrench-7pbbxqrZ.js → wrench-CPUCA_rn.js} +1 -1
- package/dist/client/assets/wsTransport-C88seBPA.js +15 -0
- package/dist/client/assets/{xychartDiagram-ELKLHX3M-BTEX3m2y.js → xychartDiagram-ELKLHX3M-C1_7Q-1i.js} +1 -1
- package/dist/client/favicon.svg +1 -1
- package/dist/client/index.html +1 -1
- package/dist/collectUint8StreamText-BsLSgI8i.mjs +710 -0
- package/dist/collectUint8StreamText-D5olwfpM.cjs +757 -0
- package/dist/{deviceHostWorker-L8C9wy38.mjs → deviceHostWorker-B-Dn-6An.mjs} +1 -1
- package/dist/{makeManagedServerProvider-CF776SAO.cjs → makeManagedServerProvider-B5tP7tvg.cjs} +1 -1
- package/dist/{makeManagedServerProvider-B90UKjnv.mjs → makeManagedServerProvider-B65ipCxM.mjs} +2 -2
- package/dist/resource-monitor/linux-arm64/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor +0 -0
- package/dist/resource-monitor/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-arm64/ryco-resource-monitor.exe +0 -0
- package/dist/resource-monitor/win32-x64/ryco-resource-monitor.exe +0 -0
- package/dist/{runtimeSession-V3RIy8Ao.mjs → runtimeSession-D_BZ-wRH.mjs} +1 -1
- package/dist/{src-CARHuYkT.cjs → src-FmeCeBJ9.cjs} +2291 -72
- package/dist/{src-CtsgPPhb.mjs → src-VTj60bUm.mjs} +1974 -61
- package/package.json +1 -1
- package/dist/AzureDevOpsSourceControlProvider-CKSvfuDS.cjs +0 -190
- package/dist/AzureDevOpsSourceControlProvider-DRWSXTml.mjs +0 -188
- package/dist/GitLabSourceControlProvider-Cj07OTBD.mjs +0 -186
- package/dist/GitLabSourceControlProvider-CvvN5pHt.cjs +0 -188
- package/dist/client/assets/AccountSettings-v6-r6gYl.js +0 -1
- package/dist/client/assets/AiFocusSettings-BVdLON0q.js +0 -1
- package/dist/client/assets/AppearanceSettings-DRChsQnN.js +0 -1
- package/dist/client/assets/BranchToolbar.logic-YN3KjVr9.js +0 -3
- package/dist/client/assets/BrowserPanel-Dxw3stFP.js +0 -1
- package/dist/client/assets/ChatRightPanel-CygpcJiF.js +0 -201
- package/dist/client/assets/ChatThreadRouteView-DYLZFHu0.js +0 -1
- package/dist/client/assets/CommandPaletteDialog-BRvBzP1R.js +0 -1
- package/dist/client/assets/CompositeRoot-BeEGGWwn.js +0 -1
- package/dist/client/assets/ComputerUseSettings-Cq8Pi0ZU.js +0 -1
- package/dist/client/assets/ConnectionsSettings-RSYtexxd.js +0 -7
- package/dist/client/assets/ContextHandoffEndpointLabel-CeGDLNA4.js +0 -4
- package/dist/client/assets/DiagnosticsSettings-CDa6MVx4.js +0 -2
- package/dist/client/assets/DialogHandle-BE7egDQQ.js +0 -1
- package/dist/client/assets/DialogRoot-C4mtzigX.js +0 -1
- package/dist/client/assets/DialogTitle-B_Q4DykI.js +0 -1
- package/dist/client/assets/DialogTrigger-BSqd4Crj.js +0 -1
- package/dist/client/assets/DraftChatThreadRouteView-JW_bXVrM.js +0 -1
- package/dist/client/assets/GlassSurface-DDG4eTlj.js +0 -1
- package/dist/client/assets/HostedConnectionControls-CscV6hm1.js +0 -1
- package/dist/client/assets/HostedHubRoot-gp7-ClBP.js +0 -2
- package/dist/client/assets/HostedNodeRenameDialog-D1DSiTpx.js +0 -1
- package/dist/client/assets/HostedRelayTrustNotice-B9jp4SRh.js +0 -1
- package/dist/client/assets/IntegrationsSettingsPanel-DH7SfWtV.js +0 -2
- package/dist/client/assets/KeybindingsSettings-DkgYYSHS.js +0 -7
- package/dist/client/assets/LazyBrowserPanel-D4e76vc_.js +0 -2
- package/dist/client/assets/McpServersSettings-Dc1kPa-X.js +0 -6
- package/dist/client/assets/MobileSheet-lT--mLEz.js +0 -1
- package/dist/client/assets/NodeSecuritySettings-DcfSx4KT.js +0 -1
- package/dist/client/assets/NullStore-8d2s-Re3.js +0 -1
- package/dist/client/assets/OnboardingDialog-CnLjwM6Z.js +0 -1
- package/dist/client/assets/OpinionatedPluginsSettings-BTJyS3rN.js +0 -1
- package/dist/client/assets/PhoneHome-CIMkuDJF.js +0 -1
- package/dist/client/assets/PhoneSettingsSurface-CfZQxJNI.js +0 -2
- package/dist/client/assets/ProvidersSettingsPanel-DAVSiwE1.js +0 -1
- package/dist/client/assets/RedactedSensitiveText-BHGbQJwB.js +0 -1
- package/dist/client/assets/RootAppShell-T056pByH.js +0 -7
- package/dist/client/assets/SettingsDialog-BERU2Qg7.js +0 -2
- package/dist/client/assets/SettingsPanels-De_XZOQF.js +0 -3
- package/dist/client/assets/SettingsPanels.editor-Dkva9gX_.js +0 -2
- package/dist/client/assets/SourceControlSettings-B4HS17cB.js +0 -1
- package/dist/client/assets/StatisticsPage-Bj2ftFdH.js +0 -1
- package/dist/client/assets/StatisticsPanel-Dw7GBBmd.js +0 -1
- package/dist/client/assets/StatisticsSettingsLink-_XL3ABoI.js +0 -1
- package/dist/client/assets/ThreadTerminalDrawer-CPPzQSXN.js +0 -18
- package/dist/client/assets/ThreadWorkspacePanel-DWKU7Omm.js +0 -2073
- package/dist/client/assets/appChrome-TkWLAGxk.js +0 -1
- package/dist/client/assets/architecture-7GRP2DOG-HS59zfrk.js +0 -1
- package/dist/client/assets/authorization-D8dOcEYq.js +0 -1
- package/dist/client/assets/badge-2AZ3HfVS.js +0 -1
- package/dist/client/assets/capabilities-CsHjxjab.js +0 -1
- package/dist/client/assets/channel-Dn3_cOkm.js +0 -1
- package/dist/client/assets/chevron-right-Dsw16yGn.js +0 -1
- package/dist/client/assets/classDiagram-JCYQIIEL-ZQvrS8No.js +0 -1
- package/dist/client/assets/classDiagram-v2-OCEON4UE-ZQvrS8No.js +0 -1
- package/dist/client/assets/compiler-runtime-C4g8XhC5.js +0 -1
- package/dist/client/assets/desktopWorkspace-_iM6B9Kf.js +0 -1
- package/dist/client/assets/editorPreferences-D8q1ItMW.js +0 -1
- package/dist/client/assets/eventmodeling-NTZA5JFV-Dj71kuPV.js +0 -1
- package/dist/client/assets/flowDiagram-UKHOOZJN-BaAiwuvL.js +0 -1
- package/dist/client/assets/hostedConnectionCoordinator-BuRWCvUG.js +0 -1
- package/dist/client/assets/hubRoutes-jcMPIFy3.js +0 -1
- package/dist/client/assets/kbd-Dxm5Elqj.js +0 -1
- package/dist/client/assets/layers-Dqez1Uq8.js +0 -1
- package/dist/client/assets/liquidGlass-CA2o_Cq0.js +0 -1
- package/dist/client/assets/liquidGlass.worker-icvLJKHf.js +0 -1
- package/dist/client/assets/main-BqSANuAs.css +0 -2
- package/dist/client/assets/main-DAbEANjY.js +0 -9
- package/dist/client/assets/motion-BdscFixQ.js +0 -1
- package/dist/client/assets/palette-92ylWqeC.js +0 -1
- package/dist/client/assets/perfInstrumentation-BT27w4tn.js +0 -1
- package/dist/client/assets/presentationTier-xlIjcFab.js +0 -1
- package/dist/client/assets/primary-DZjgHvyf.js +0 -5
- package/dist/client/assets/providerDriverMeta-T2YbXzuS.js +0 -1
- package/dist/client/assets/providerStatus-DBGvvkyF.js +0 -1
- package/dist/client/assets/radio-group-CRnHYWa8.js +0 -1
- package/dist/client/assets/railroad-abnf-HS5TGJTU-DxU7Mt1k.js +0 -1
- package/dist/client/assets/railroad-ebnf-LZEXJU2U-BYAPVjRd.js +0 -1
- package/dist/client/assets/railroad-peg-WCYAUIDC-BOqgR_X7.js +0 -1
- package/dist/client/assets/runtime-BwHA1GUS.js +0 -18
- package/dist/client/assets/scroll-area-7n2X_RLQ.js +0 -1
- package/dist/client/assets/separator-CL1qjMqJ.js +0 -1
- package/dist/client/assets/settingsLayout-DxsFwhF0.js +0 -1
- package/dist/client/assets/sheet-CGiaw8-i.js +0 -1
- package/dist/client/assets/sidebar-Cc6ANbOP.js +0 -1
- package/dist/client/assets/sidebarProjectFolders-DO2Uv84F.js +0 -4
- package/dist/client/assets/sidebarStatusText-B4AtFXZo.js +0 -1
- package/dist/client/assets/sidebarUndo-gdSrfa4O.js +0 -1
- package/dist/client/assets/square-Cr9X8U6y.js +0 -1
- package/dist/client/assets/src-C3Y_imaX.js +0 -14
- package/dist/client/assets/stateDiagram-v2-UEYNNEHI-CWtHILqh.js +0 -1
- package/dist/client/assets/storeSelectors-CTDWheMy.js +0 -1
- package/dist/client/assets/swimlanesDiagram-ULZ7WXOC-DuaPce9O.js +0 -8
- package/dist/client/assets/switch-DnpJB2xv.js +0 -48
- package/dist/client/assets/toggle-D10FsFoE.js +0 -1
- package/dist/client/assets/toggle-group-BhzbQPEQ.js +0 -1
- package/dist/client/assets/tooltip-BlweKBxc.js +0 -1
- package/dist/client/assets/usage-BBwaxMif.js +0 -1
- package/dist/client/assets/useAppSidebarCollapsed-CFy476E3.js +0 -1
- package/dist/client/assets/useAppearancePreference-Dlh9P8iu.js +0 -1
- package/dist/client/assets/useBaseUiId-DKOjzmu3.js +0 -1
- package/dist/client/assets/useLabelableId-DQbY2GG1.js +0 -1
- package/dist/client/assets/useNavigate-B8oXtF30.js +0 -1
- package/dist/client/assets/usePhoneThreadActions-6DCLiyJ5.js +0 -1
- package/dist/client/assets/usePopupViewport-CNWcP7Od.js +0 -1
- package/dist/client/assets/usePresentationTier-hxB7Yv_Q.js +0 -1
- package/dist/client/assets/useScrollLock-BbKeKZdj.js +0 -1
- package/dist/client/assets/useTriggerFocusGuards-BC4Wb3GI.js +0 -1
- package/dist/client/assets/useValueChanged-BkTbyZdO.js +0 -1
- package/dist/client/assets/workspaceMetadataProjection-aqZEXDrQ.js +0 -1
- package/dist/collectUint8StreamText-BAUF-vzz.mjs +0 -37
- package/dist/collectUint8StreamText-vagpNUMJ.cjs +0 -42
- package/dist/git-9xWsJYIH.mjs +0 -132
- package/dist/git-xIkXFy_l.cjs +0 -218
- package/dist/sourceControl-B0D1Op29.cjs +0 -253
- package/dist/sourceControl-BiEBxN01.mjs +0 -224
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{A as t,k as n}from"./wsTransport-C88seBPA.js";import{$i as r,Gi as i,Ss as a,Zi as o,Zr as s,ad as c,id as l,jo as u,si as d,ws as f,ys as p}from"./runtime-DjjjAcTE.js";import{t as m}from"./react-CwJFpaho.js";import{A as h,D as g,M as _,N as v,P as y,j as b,k as x}from"./popover-OWEv6cQz.js";import{i as S}from"./presentationTier-DPVAxTK4.js";import{a as ee,r as te,t as ne}from"./tooltip-DbqhseXd.js";import{t as re}from"./checkbox-CIIIY9FA.js";import{B as ie,V as C}from"./workspaceLifecycle-OJ1aKksw.js";import{t as w}from"./loader-3vQnfqIT.js";import{t as T}from"./refresh-cw-CRUTivd6.js";import{t as E}from"./save-OZdkPs_y.js";import{V as ae}from"./combobox-Dtjtf7AB.js";import{t as D}from"./wrench-CPUCA_rn.js";import{t as O}from"./toastHelpers-CSQRKo4F.js";import{t as k}from"./input-CCie4mm1.js";import"./providerModels-v9PYbzRE.js";import{a as A,c as j,i as M,o as N,s as P,t as F}from"./select-Cb9FUPHD.js";import{t as I}from"./textarea-VyiIZ0wQ.js";import{t as L}from"./switch-oQc7Ifbl.js";import{c as R,d as z,i as B,l as V,n as oe,o as H,u as U}from"./settingsLayout-CRFNCk_D.js";import{i as W}from"./providerDriverMeta-BHHL9uw0.js";import{Ut as G}from"./main-Ch0bwS-M.js";var K={name:`earth`,size:24,node:[[`path`,{d:`M21.54 15H17a2 2 0 0 0-2 2v4.54`,key:`1djwo0`}],[`path`,{d:`M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17`,key:`1tzkfa`}],[`path`,{d:`M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05`,key:`14pb5j`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]],aliases:[`globe-2`]};K.node;var se=f(K),q={name:`log-in`,size:24,node:[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]};q.node;var ce=f(q),J=e(m(),1),Y=S(),le=/^[a-zA-Z][a-zA-Z0-9_-]*$/;function ue(){return{name:``,transport:`stdio`,command:``,argsText:``,cwd:``,url:``,bearerTokenEnvVar:``,envText:``,envVarsText:``,httpHeadersText:``,envHttpHeadersText:``,enabled:!0,required:!1,startupTimeoutSec:``,toolTimeoutSec:``,enabledToolsText:``,disabledToolsText:``,oauthScopesText:``,secretFields:[],clearedSecretFields:[]}}function de(e){return e.join(`
|
|
2
|
+
`)}function fe(e){return Object.entries(e).map(([e,t])=>`${e}=${t}`).join(`
|
|
3
|
+
`)}function pe(e){let t=e.config;return{name:e.name,transport:t.transport===`http`?`http`:`stdio`,command:t.command??``,argsText:de(t.args),cwd:t.cwd??``,url:t.url??``,bearerTokenEnvVar:t.bearerTokenEnvVar??``,envText:fe(t.env),envVarsText:de(t.envVars),httpHeadersText:fe(t.httpHeaders),envHttpHeadersText:fe(t.envHttpHeaders),enabled:t.enabled,required:t.required??!1,startupTimeoutSec:t.startupTimeoutSec?.toString()??``,toolTimeoutSec:t.toolTimeoutSec?.toString()??``,enabledToolsText:de(t.enabledTools),disabledToolsText:de(t.disabledTools),oauthScopesText:de(t.oauthScopes),secretFields:Object.entries(t.secretFields??{}).filter(([,e])=>e===`present`).map(([e])=>e).toSorted(),clearedSecretFields:[]}}function me(e){return e.split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0)}function he(e){let t={};for(let n of me(e)){let e=n.indexOf(`=`);if(e<=0)continue;let r=n.slice(0,e).trim(),i=n.slice(e+1).trim();r.length>0&&(t[r]=i)}return t}function ge(e){let t=e.trim();if(!t)return;let n=Number(t);return Number.isFinite(n)&&n>0?n:NaN}function _e(e){let t=e.name.trim();if(!le.test(t))return`Server name must start with a letter and use only letters, numbers, dashes, and underscores.`;if(e.transport===`stdio`&&e.command.trim().length===0)return`Stdio servers need a command.`;if(e.transport===`http`&&e.url.trim().length===0)return`HTTP servers need a URL.`;for(let[t,n]of[[`Startup timeout`,e.startupTimeoutSec],[`Tool timeout`,e.toolTimeoutSec]]){let e=ge(n);if(Number.isNaN(e))return`${t} must be a positive number.`}return null}function ve(e){let t=ge(e.startupTimeoutSec),n=ge(e.toolTimeoutSec);return{transport:e.transport,command:e.command.trim(),args:me(e.argsText),cwd:e.cwd.trim()||null,url:e.url.trim(),bearerTokenEnvVar:e.bearerTokenEnvVar.trim()||null,env:he(e.envText),envVars:me(e.envVarsText),httpHeaders:he(e.httpHeadersText),envHttpHeaders:he(e.envHttpHeadersText),enabled:e.enabled,required:e.required,...t===void 0||Number.isNaN(t)?{}:{startupTimeoutSec:t},...n===void 0||Number.isNaN(n)?{}:{toolTimeoutSec:n},enabledTools:me(e.enabledToolsText),disabledTools:me(e.disabledToolsText),oauthScopes:me(e.oauthScopesText)}}function ye(e){return Object.fromEntries(e.secretFields.map(t=>[t,e.clearedSecretFields.includes(t)?{action:`clear`}:{action:`retain`}]))}function be(e){let t=e.config;return t.transport===`http`?t.url||`HTTP`:t.transport===`stdio`?[t.command,...t.args].filter(Boolean).join(` `)||`stdio`:`Configured outside the known MCP schema`}var X=c(),xe=[],Se=[];function Z(e){if(!e)throw Error(`MCP settings are unavailable before a backend is paired.`);return e}function Q(e,t){i.add(O({type:`error`,title:e,description:t instanceof Error?t.message:`An error occurred.`}))}function Ce(e){switch(e){case`user`:return`User config`;case`project`:return`Project`;case`system`:return`System`;case`managed`:return`Managed`;case`mixed`:return`Mixed`;case`unknown`:return`Unknown`}}function we(e){return e.startupStatus===`failed`?`error`:e.startupStatus===`disabled`?`outline`:e.authStatus===`notLoggedIn`?`warning`:e.startupStatus===`ready`?`success`:`outline`}function Te(e){return e.startupStatus===`disabled`?`Disabled`:e.startupStatus===`failed`?`Failed`:e.authStatus===`notLoggedIn`?`Login needed`:e.startupStatus===`ready`?`Ready`:`Unknown`}function Ee(e){return e.enabled?e.status===`managed`?`success`:e.status===`external`?`warning`:`outline`:`outline`}function De(e){if(!e.enabled)return`Disabled`;switch(e.status){case`managed`:return`Managed`;case`external`:return`External config`;case`unsupported`:return`Not wired`}}function Oe(e){return e.displayName??W(e.driver)?.label??u(e.driver)}function ke(e){return e?e.providerDisplayName??W(e.driver)?.label??u(e.driver):`the provider`}function $(e){let t=(0,Y.c)(5),n;t[0]===e.label?n=t[1]:(n=(0,X.jsx)(`span`,{children:e.label}),t[0]=e.label,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,X.jsxs)(`label`,{className:`grid gap-1.5 text-xs font-medium text-foreground/80`,children:[n,e.children]}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}function Ae(e){let t=(0,Y.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,X.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground/70`,children:n}),t[0]=n,t[1]=r),r}function je(e){let t=(0,Y.c)(5),{value:n,onChange:i}=e,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={value:`stdio`,label:`Stdio`,icon:ie},t[0]=a):a=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=[a,{value:`http`,label:`HTTP`,icon:se}],t[1]=o):o=t[1];let s;return t[2]!==i||t[3]!==n?(s=(0,X.jsx)(`div`,{className:`grid grid-cols-2 rounded-[min(var(--radius-lg),0.625rem)] bg-muted/70 p-0.5`,children:o.map(e=>{let t=e.icon,a=n===e.value;return(0,X.jsxs)(`button`,{type:`button`,onClick:()=>i(e.value),className:r(`flex h-7 items-center justify-center gap-2 rounded-[min(var(--radius-md),0.5rem)] text-xs font-medium transition-[background-color,color,box-shadow] duration-(--app-motion-duration-chip)`,a?`bg-background text-foreground shadow-xs`:`text-muted-foreground hover:text-foreground`),children:[(0,X.jsx)(t,{className:`size-3.5`}),e.label]},e.value)})}),t[2]=i,t[3]=n,t[4]=s):s=t[4],s}function Me({open:e,server:t,providerName:n,onOpenChange:r,onSubmit:i}){let[a,s]=(0,J.useState)(()=>ue()),[c,l]=(0,J.useState)(null),[u,d]=(0,J.useState)(!1),f=t!==null,p=(0,J.useRef)(null);(0,J.useEffect)(()=>{e&&(p.current=null,s(t?pe(t):ue()),l(null))},[e,t]);let m=(e,t)=>{s(n=>({...n,[e]:t}))},S=async()=>{let e=_e(a);if(e){l(e);return}d(!0);try{await i(a),p.current=a.name.trim(),r(!1)}catch(e){Q(`Failed to save MCP server`,e)}finally{d(!1)}};return(0,X.jsx)(g,{open:e,onOpenChange:r,children:(0,X.jsxs)(v,{className:`max-w-2xl`,bottomStickOnMobile:!1,morph:{target:e=>{let t=p.current;return t?document.querySelector(`[data-mcp-server="${CSS.escape(t)}"]`)??e:e}},children:[(0,X.jsxs)(b,{children:[(0,X.jsx)(y,{children:f?`Edit MCP server`:`Add MCP server`}),(0,X.jsxs)(x,{children:[`Configuration is written through `,n,`'s native MCP management surface. Existing secret values are never loaded into this form and are retained unless you enter replacements with the same keys.`]})]}),(0,X.jsxs)(_,{className:`space-y-5`,children:[(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-[1fr_12rem]`,children:[(0,X.jsx)($,{label:`Server name`,children:(0,X.jsx)(k,{value:a.name,disabled:f,onChange:e=>m(`name`,e.target.value),placeholder:`github`,spellCheck:!1})}),(0,X.jsx)($,{label:`Transport`,children:(0,X.jsx)(je,{value:a.transport,onChange:e=>m(`transport`,e)})})]}),a.transport===`stdio`?(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)($,{label:`Command`,children:(0,X.jsx)(k,{value:a.command,onChange:e=>m(`command`,e.target.value),placeholder:`npx`,spellCheck:!1})}),(0,X.jsxs)($,{label:`Arguments`,children:[(0,X.jsx)(I,{value:a.argsText,onChange:e=>m(`argsText`,e.target.value),placeholder:`-y
|
|
4
|
+
@modelcontextprotocol/server-filesystem
|
|
5
|
+
/tmp/project`,spellCheck:!1}),(0,X.jsx)(Ae,{children:`One argument per line.`})]}),(0,X.jsx)($,{label:`Working directory`,children:(0,X.jsx)(k,{value:a.cwd,onChange:e=>m(`cwd`,e.target.value),placeholder:`/path/to/project`,spellCheck:!1})})]}):(0,X.jsxs)(`div`,{className:`grid gap-4`,children:[(0,X.jsx)($,{label:`URL`,children:(0,X.jsx)(k,{value:a.url,onChange:e=>m(`url`,e.target.value),placeholder:`https://mcp.example.com/mcp`,spellCheck:!1})}),(0,X.jsx)($,{label:`Bearer token env var`,children:(0,X.jsx)(k,{value:a.bearerTokenEnvVar,onChange:e=>m(`bearerTokenEnvVar`,e.target.value),placeholder:`MCP_TOKEN`,spellCheck:!1})}),(0,X.jsxs)($,{label:`HTTP headers`,children:[(0,X.jsx)(I,{value:a.httpHeadersText,onChange:e=>m(`httpHeadersText`,e.target.value),placeholder:`X-Client=ryco`,spellCheck:!1}),(0,X.jsx)(Ae,{children:`Static headers as KEY=VALUE lines.`})]}),(0,X.jsxs)($,{label:`Env-backed HTTP headers`,children:[(0,X.jsx)(I,{value:a.envHttpHeadersText,onChange:e=>m(`envHttpHeadersText`,e.target.value),placeholder:`Authorization=GITHUB_TOKEN`,spellCheck:!1}),(0,X.jsx)(Ae,{children:`Header name to environment variable name, one per line.`})]})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,X.jsxs)($,{label:`Environment values`,children:[(0,X.jsx)(I,{value:a.envText,onChange:e=>m(`envText`,e.target.value),placeholder:`API_BASE=https://example.com`,spellCheck:!1}),(0,X.jsx)(Ae,{children:`KEY=VALUE lines stored by the selected provider.`})]}),(0,X.jsxs)($,{label:`Environment allow-list`,children:[(0,X.jsx)(I,{value:a.envVarsText,onChange:e=>m(`envVarsText`,e.target.value),placeholder:`GITHUB_TOKEN
|
|
6
|
+
SENTRY_AUTH_TOKEN`,spellCheck:!1}),(0,X.jsx)(Ae,{children:`One env var name per line.`})]})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-2`,children:[(0,X.jsx)($,{label:`Startup timeout seconds`,children:(0,X.jsx)(k,{value:a.startupTimeoutSec,onChange:e=>m(`startupTimeoutSec`,e.target.value),inputMode:`decimal`,placeholder:`10`})}),(0,X.jsx)($,{label:`Tool timeout seconds`,children:(0,X.jsx)(k,{value:a.toolTimeoutSec,onChange:e=>m(`toolTimeoutSec`,e.target.value),inputMode:`decimal`,placeholder:`60`})})]}),(0,X.jsxs)(`div`,{className:`grid gap-4 sm:grid-cols-3`,children:[(0,X.jsx)($,{label:`Enabled tools`,children:(0,X.jsx)(I,{value:a.enabledToolsText,onChange:e=>m(`enabledToolsText`,e.target.value),spellCheck:!1})}),(0,X.jsx)($,{label:`Disabled tools`,children:(0,X.jsx)(I,{value:a.disabledToolsText,onChange:e=>m(`disabledToolsText`,e.target.value),spellCheck:!1})}),(0,X.jsx)($,{label:`OAuth scopes`,children:(0,X.jsx)(I,{value:a.oauthScopesText,onChange:e=>m(`oauthScopesText`,e.target.value),spellCheck:!1})})]}),(0,X.jsxs)(`div`,{className:`flex flex-wrap items-center gap-5 border-t pt-4`,children:[(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-medium text-foreground/80`,children:[(0,X.jsx)(L,{checked:a.enabled,onCheckedChange:e=>m(`enabled`,!!e)}),`Enabled`]}),(0,X.jsxs)(`label`,{className:`flex items-center gap-2 text-xs font-medium text-foreground/80`,children:[(0,X.jsx)(L,{checked:a.required,onCheckedChange:e=>m(`required`,!!e)}),`Required`]})]}),a.secretFields.length>0?(0,X.jsxs)(`fieldset`,{className:`grid gap-2 border-t pt-4`,children:[(0,X.jsx)(`legend`,{className:`text-xs font-medium`,children:`Stored secret fields`}),(0,X.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground/70`,children:`Values remain inside the provider configuration and are never loaded by this page. Select a field only when you want it removed on save.`}),a.secretFields.map(e=>(0,X.jsxs)(`div`,{className:`flex items-center gap-2 text-xs`,children:[(0,X.jsx)(re,{"aria-label":`Clear ${e}`,checked:a.clearedSecretFields.includes(e),onCheckedChange:t=>m(`clearedSecretFields`,t===!0?[...a.clearedSecretFields,e]:a.clearedSecretFields.filter(t=>t!==e))}),(0,X.jsxs)(`span`,{"aria-hidden":!0,children:[`Clear `,(0,X.jsx)(`code`,{className:`font-mono`,children:e})]})]},e))]}):null,c?(0,X.jsx)(R,{tone:`error`,children:c}):null]}),(0,X.jsxs)(h,{children:[(0,X.jsx)(o,{variant:`outline`,onClick:()=>r(!1),disabled:u,children:`Cancel`}),(0,X.jsxs)(o,{onClick:()=>void S(),disabled:u,children:[u?(0,X.jsx)(w,{className:`animate-spin`}):(0,X.jsx)(E,{}),`Save`]})]})]})})}function Ne(e){return`${ke(e)} · ${e.nativeScope} scope`}function Pe(e){let t=(0,Y.c)(35),{workspaces:n,selectedWorkspaceId:r,onChange:i}=e;if(n.length<=1||!r)return null;let a,o,s,c,l,u,d,f,p;if(t[0]!==i||t[1]!==r||t[2]!==n){let e;t[12]===r?e=t[13]:(e=e=>e.id===r,t[12]=r,t[13]=e);let m=n.find(e);s=F,f=r,t[14]===i?p=t[15]:(p=e=>{e&&i(e)},t[14]=i,t[15]=p),o=N,l=`sm`,u=`w-full sm:w-56`,d=`MCP workspace`,a=P,c=m?Ne(m):`Select workspace`,t[0]=i,t[1]=r,t[2]=n,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p}else a=t[3],o=t[4],s=t[5],c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11];let m;t[16]!==a||t[17]!==c?(m=(0,X.jsx)(a,{children:c}),t[16]=a,t[17]=c,t[18]=m):m=t[18];let h;t[19]!==o||t[20]!==l||t[21]!==u||t[22]!==d||t[23]!==m?(h=(0,X.jsx)(o,{size:l,className:u,"aria-label":d,children:m}),t[19]=o,t[20]=l,t[21]=u,t[22]=d,t[23]=m,t[24]=h):h=t[24];let g;t[25]===n?g=t[26]:(g=n.map(Fe),t[25]=n,t[26]=g);let _;t[27]===g?_=t[28]:(_=(0,X.jsx)(A,{align:`end`,alignItemWithTrigger:!1,children:g}),t[27]=g,t[28]=_);let v;return t[29]!==s||t[30]!==_||t[31]!==f||t[32]!==p||t[33]!==h?(v=(0,X.jsxs)(s,{value:f,onValueChange:p,children:[h,_]}),t[29]=s,t[30]=_,t[31]=f,t[32]=p,t[33]=h,t[34]=v):v=t[34],v}function Fe(e){return(0,X.jsx)(M,{hideIndicator:!0,value:e.id,children:(0,X.jsxs)(`span`,{className:`flex min-w-0 flex-col`,children:[(0,X.jsx)(`span`,{className:`truncate`,children:Ne(e)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-[11px] text-muted-foreground`,children:e.displayPath})]})},e.id)}function Ie(e){let t=(0,Y.c)(9),{providers:n,selectedWorkspaceId:r,onSelectWorkspace:i}=e;if(n.length===0)return null;let a;if(t[0]!==i||t[1]!==n||t[2]!==r){let e;t[4]!==i||t[5]!==r?(e=e=>{let t=W(e.driver)?.icon??C,n=e.workspaceId!==void 0&&e.workspaceId===r,a=e.workspaceId!==void 0&&!n;return(0,X.jsx)(U,{title:(0,X.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,X.jsxs)(`span`,{className:`relative flex size-5 shrink-0 items-center justify-center`,children:[(0,X.jsx)(t,{className:`size-4 text-muted-foreground`}),e.accentColor?(0,X.jsx)(`span`,{className:`absolute -right-0.5 -bottom-0.5 size-2 rounded-full ring-2 ring-card`,style:{backgroundColor:e.accentColor}}):null]}),(0,X.jsx)(`span`,{className:`truncate`,children:Oe(e)}),(0,X.jsx)(`span`,{className:`truncate font-mono text-[11px] font-normal text-muted-foreground/70`,children:e.instanceId})]}),description:e.message,control:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(j,{size:`sm`,variant:Ee(e),children:De(e)}),e.workspaceId?(0,X.jsx)(o,{size:`xs`,variant:n?`secondary`:`outline`,disabled:!a,onClick:()=>{e.workspaceId&&i(e.workspaceId)},children:n?`Showing`:`Show servers`}):null]})},e.instanceId)},t[4]=i,t[5]=r,t[6]=e):e=t[6],a=n.map(e),t[0]=i,t[1]=n,t[2]=r,t[3]=a}else a=t[3];let s;return t[7]===a?s=t[8]:(s=(0,X.jsx)(z,{title:`Provider support`,description:`Each agent manages MCP servers in its own configuration. Pick one to view its servers.`,children:a}),t[7]=a,t[8]=s),s}function Le(e){let t=(0,Y.c)(10),{title:n,items:r}=e,i;t[0]===r.length?i=t[1]:(i=(0,X.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:r.length}),t[0]=r.length,t[1]=i);let a;t[2]!==i||t[3]!==n?(a=(0,X.jsxs)(`h4`,{className:`mb-1.5 text-xs font-medium text-foreground`,children:[n,` `,i]}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;t[5]===r?o=t[6]:(o=r.length===0?(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`None`}):(0,X.jsx)(`ul`,{className:`space-y-1.5`,children:r.map(Re)}),t[5]=r,t[6]=o);let s;return t[7]!==a||t[8]!==o?(s=(0,X.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Re(e){return(0,X.jsxs)(`li`,{className:`min-w-0`,children:[(0,X.jsx)(`p`,{className:`truncate text-xs text-foreground`,children:e.name}),e.detail?(0,X.jsx)(`p`,{className:`line-clamp-2 text-[11px] text-muted-foreground`,children:e.detail}):null]},e.key)}function ze(e){let t=(0,Y.c)(17),{server:n}=e;if(n.tools.length===0&&n.resources.length===0&&n.resourceTemplates.length===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,X.jsx)(`p`,{className:`text-xs text-muted-foreground/70`,children:`No tools or resources reported.`}),t[0]=e):e=t[0],e}let r;t[1]===n.tools?r=t[2]:(r=n.tools.slice(0,12).map(He),t[1]=n.tools,t[2]=r);let i;t[3]===r?i=t[4]:(i=(0,X.jsx)(Le,{title:`Tools`,items:r}),t[3]=r,t[4]=i);let a;t[5]===n.resources?a=t[6]:(a=n.resources.slice(0,10).map(Ve),t[5]=n.resources,t[6]=a);let o;t[7]===a?o=t[8]:(o=(0,X.jsx)(Le,{title:`Resources`,items:a}),t[7]=a,t[8]=o);let s;t[9]===n.resourceTemplates?s=t[10]:(s=n.resourceTemplates.slice(0,10).map(Be),t[9]=n.resourceTemplates,t[10]=s);let c;t[11]===s?c=t[12]:(c=(0,X.jsx)(Le,{title:`Templates`,items:s}),t[11]=s,t[12]=c);let l;return t[13]!==i||t[14]!==o||t[15]!==c?(l=(0,X.jsxs)(`div`,{className:`grid gap-5 md:grid-cols-3`,children:[i,o,c]}),t[13]=i,t[14]=o,t[15]=c,t[16]=l):l=t[16],l}function Be(e){return{key:e.uriTemplate,name:e.title??e.name,detail:e.uriTemplate}}function Ve(e){return{key:e.uri,name:e.title??e.name,detail:e.uri}}function He(e){return{key:e.name,name:e.title??e.name,detail:e.description??void 0}}var Ue={unsupported:null,notLoggedIn:`Signed out`,bearerToken:`Bearer token`,oAuth:`OAuth`,unknown:null};function We(e){let t=(0,Y.c)(85),{server:n,capabilities:i,writable:s,mutating:c,onToggleEnabled:l,onEdit:u,onRemove:d,onOauthLogin:f}=e,[p,m]=(0,J.useState)(!1),h;t[0]===n?h=t[1]:(h=be(n),t[0]=n,t[1]=h);let g=h,_=i.inventory===`available`,v=_?`${n.tools.length} tools · ${n.resources.length+n.resourceTemplates.length} resources`:`Inventory not available`,y=Ue[n.authStatus],b;t[2]===n.config.transport?b=t[3]:(b=n.config.transport.toUpperCase(),t[2]=n.config.transport,t[3]=b);let x;t[4]!==y||t[5]!==v||t[6]!==b?(x=[b,v,y].filter(Boolean),t[4]=y,t[5]=v,t[6]=b,t[7]=x):x=t[7];let S=x,re=n.name,C,w;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(C=r(`min-w-0 border-t border-border/60 first:border-t-0`),w=r(`flex min-w-0 flex-col gap-3 py-3.5 sm:flex-row sm:items-center`,oe),t[8]=C,t[9]=w):(C=t[8],w=t[9]);let T;t[10]===n.config.transport?T=t[11]:(T=n.config.transport===`http`?(0,X.jsx)(se,{className:`size-3.5 shrink-0 text-muted-foreground`}):(0,X.jsx)(ie,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[10]=n.config.transport,t[11]=T);let E;t[12]===n.name?E=t[13]:(E=(0,X.jsx)(`h3`,{className:`min-w-0 truncate text-[13px] font-medium text-foreground`,children:n.name}),t[12]=n.name,t[13]=E);let D;t[14]===n?D=t[15]:(D=we(n),t[14]=n,t[15]=D);let O;t[16]===n?O=t[17]:(O=Te(n),t[16]=n,t[17]=O);let k;t[18]!==O||t[19]!==D?(k=(0,X.jsx)(j,{size:`sm`,variant:D,children:O}),t[18]=O,t[19]=D,t[20]=k):k=t[20];let A;t[21]===n.source?A=t[22]:(A=Ce(n.source),t[21]=n.source,t[22]=A);let M;t[23]===A?M=t[24]:(M=(0,X.jsx)(j,{size:`sm`,variant:`outline`,children:A}),t[23]=A,t[24]=M);let N;t[25]!==k||t[26]!==M||t[27]!==T||t[28]!==E?(N=(0,X.jsxs)(`div`,{className:`flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1`,children:[T,E,k,M]}),t[25]=k,t[26]=M,t[27]=T,t[28]=E,t[29]=N):N=t[29];let P;t[30]===g?P=t[31]:(P=(0,X.jsx)(`p`,{className:`mt-1 truncate font-mono text-[11px] text-muted-foreground`,title:g,children:g}),t[30]=g,t[31]=P);let F=S.join(` · `),I;t[32]===F?I=t[33]:(I=(0,X.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground/80`,children:F}),t[32]=F,t[33]=I);let R;t[34]===n.error?R=t[35]:(R=n.error?(0,X.jsx)(`p`,{className:`mt-1.5 break-words text-xs text-destructive-foreground`,children:n.error}):null,t[34]=n.error,t[35]=R);let z;t[36]!==N||t[37]!==P||t[38]!==I||t[39]!==R?(z=(0,X.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[N,P,I,R]}),t[36]=N,t[37]=P,t[38]=I,t[39]=R,t[40]=z):z=t[40];let B;t[41]!==i.oauth||t[42]!==c||t[43]!==f||t[44]!==n?(B=i.oauth===`available`&&n.authStatus===`notLoggedIn`?(0,X.jsxs)(o,{size:`xs`,variant:`outline`,disabled:c,onClick:()=>f(n),"aria-label":`Log in to ${n.name}`,children:[(0,X.jsx)(ce,{}),`Log in`]}):null,t[41]=i.oauth,t[42]=c,t[43]=f,t[44]=n,t[45]=B):B=t[45];let V;t[46]!==i.upsert||t[47]!==c||t[48]!==u||t[49]!==n||t[50]!==s?(V=s&&i.upsert===`available`?(0,X.jsx)(o,{size:`xs`,variant:`outline`,onClick:()=>u(n),disabled:c,children:`Edit`}):null,t[46]=i.upsert,t[47]=c,t[48]=u,t[49]=n,t[50]=s,t[51]=V):V=t[51];let H;t[52]!==i.remove||t[53]!==c||t[54]!==d||t[55]!==n||t[56]!==s?(H=s&&i.remove===`available`?(0,X.jsxs)(ne,{children:[(0,X.jsx)(ee,{render:(0,X.jsx)(o,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-destructive-foreground`,disabled:c,onClick:()=>d(n),"aria-label":`Remove ${n.name}`,children:(0,X.jsx)(ae,{})})}),(0,X.jsx)(te,{children:`Remove server`})]}):null,t[52]=i.remove,t[53]=c,t[54]=d,t[55]=n,t[56]=s,t[57]=H):H=t[57];let U;t[58]!==i.enableDisable||t[59]!==c||t[60]!==l||t[61]!==n||t[62]!==s?(U=s&&i.enableDisable===`available`?(0,X.jsx)(L,{checked:n.config.enabled,disabled:c,onCheckedChange:e=>l(n,!!e),"aria-label":`Enable ${n.name}`}):null,t[58]=i.enableDisable,t[59]=c,t[60]=l,t[61]=n,t[62]=s,t[63]=U):U=t[63];let W;t[64]!==p||t[65]!==_||t[66]!==n.name?(W=_?(0,X.jsx)(o,{size:`icon-xs`,variant:`ghost`,onClick:()=>m(Ge),"aria-expanded":p,"aria-label":`Toggle ${n.name} inventory`,children:(0,X.jsx)(a,{className:r(`transition-transform duration-(--app-motion-duration-chip)`,p&&`rotate-180`)})}):null,t[64]=p,t[65]=_,t[66]=n.name,t[67]=W):W=t[67];let G;t[68]!==B||t[69]!==V||t[70]!==H||t[71]!==U||t[72]!==W?(G=(0,X.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1.5`,children:[B,V,H,U,W]}),t[68]=B,t[69]=V,t[70]=H,t[71]=U,t[72]=W,t[73]=G):G=t[73];let K;t[74]!==z||t[75]!==G?(K=(0,X.jsxs)(`div`,{className:w,children:[z,G]}),t[74]=z,t[75]=G,t[76]=K):K=t[76];let q;t[77]!==p||t[78]!==_||t[79]!==n?(q=p&&_?(0,X.jsx)(`div`,{className:r(`settings-subsections-enter border-t border-border/60 bg-muted/30 py-3.5`,oe),children:(0,X.jsx)(ze,{server:n})}):null,t[77]=p,t[78]=_,t[79]=n,t[80]=q):q=t[80];let le;return t[81]!==n.name||t[82]!==K||t[83]!==q?(le=(0,X.jsxs)(`div`,{"data-mcp-server":re,className:C,children:[K,q]}),t[81]=n.name,t[82]=K,t[83]=q,t[84]=le):le=t[84],le}function Ge(e){return!e}function Ke(){let e=l(),a=(0,J.useMemo)(()=>e?s(e.environmentId)?.mcp:d().mcp,[e]),[c,u]=(0,J.useState)(null),[f,m]=(0,J.useState)(null),[h,g]=(0,J.useState)(null),[_,v]=(0,J.useState)(!0),[y,b]=(0,J.useState)(!1),[x,S]=(0,J.useState)(null),[re,ie]=(0,J.useState)(!1),[E,ae]=(0,J.useState)(null),[k,A]=(0,J.useState)(null),j=c?.workspaces??xe,M=c?.providers??Se,N=(0,J.useMemo)(()=>j.find(e=>e.id===f)??null,[f,j]),P=N?.capabilities,F=ke(N),I=(0,J.useCallback)(async(e,n)=>{n?.quiet||b(!0),A(null);try{let n=await Z(a).listServers({workspaceId:t.make(e),detail:`full`});g(n)}catch(e){A(e instanceof Error?e.message:`Failed to load MCP servers.`),Q(`Failed to load MCP servers`,e)}finally{b(!1)}},[a]),L=(0,J.useCallback)(async()=>{v(!0),A(null);try{let e=await Z(a).listWorkspaces();u(e);let t=e.workspaces.find(e=>e.id===f)?.id??e.workspaces[0]?.id??null;m(t),t?await I(t,{quiet:!0}):g(null)}catch(e){A(e instanceof Error?e.message:`Failed to load MCP workspaces.`),Q(`Failed to load MCP workspaces`,e)}finally{v(!1)}},[I,a,f]);(0,J.useEffect)(()=>{L()},[L]);let oe=async()=>{if(!f){await L();return}await I(f)},U=async()=>{if(f){b(!0);try{let e=await Z(a).reloadServers({workspaceId:t.make(f)});g(e),i.add(O({type:`success`,title:`MCP servers reloaded`}))}catch(e){Q(`Failed to reload MCP servers`,e)}finally{b(!1)}}},W=async e=>{if(!f)return;let r=await Z(a).upsertServer({workspaceId:t.make(f),name:n.make(e.name.trim()),config:ve(e),secretMutations:ye(e)});g(r),i.add(O({type:`success`,title:`MCP server saved`}))},K=async(e,n)=>{if(f){S(e.name);try{let r=await Z(a).setServerEnabled({workspaceId:t.make(f),name:e.name,enabled:n});g(r)}catch(e){Q(`Failed to update MCP server`,e)}finally{S(null)}}},se=async e=>{if(f&&await d().dialogs.confirm(`Remove MCP server "${e.name}"?`)){S(e.name);try{let n=await Z(a).removeServer({workspaceId:t.make(f),name:e.name});g(n),i.add(O({type:`success`,title:`MCP server removed`}))}catch(e){Q(`Failed to remove MCP server`,e)}finally{S(null)}}},q=async e=>{if(f){S(e.name);try{let n=await Z(a).startOauthLogin({workspaceId:t.make(f),serverName:e.name,scopes:e.config.oauthScopes});await d().shell.openExternal(n.authorizationUrl),i.add(O({type:`success`,title:`OAuth login opened`}))}catch(e){Q(`Failed to start OAuth login`,e)}finally{S(null)}}},ce=()=>{ae(null),ie(!0)},Y=e=>{ae(e),ie(!0)},le=N?[N.capabilities.health===`available`?null:`${F} doesn't report live health`,N.capabilities.inventory===`available`?null:`tool inventory unavailable`,N.capabilities.enableDisable===`available`?null:`no per-server toggle`].filter(e=>e!==null):[];return(0,X.jsxs)(V,{children:[(0,X.jsxs)(z,{title:`Servers`,description:N?`Read from ${F}'s own configuration. Controls appear only where it exposes a reliable operation.`:`Read from each agent's own configuration.`,headerAction:(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(Pe,{workspaces:j,selectedWorkspaceId:f,onChange:e=>{m(e),I(e)}}),(0,X.jsxs)(ne,{children:[(0,X.jsx)(ee,{render:(0,X.jsx)(o,{size:`icon-xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,onClick:()=>void oe(),disabled:_||y,"aria-label":`Refresh MCP servers`,children:(0,X.jsx)(T,{className:r((_||y)&&`animate-spin`)})})}),(0,X.jsx)(te,{children:`Refresh`})]}),P?.reload===`available`?(0,X.jsxs)(o,{size:`xs`,variant:`outline`,disabled:!f||y,onClick:()=>void U(),children:[(0,X.jsx)(D,{}),`Reload`]}):null,P?.upsert===`available`?(0,X.jsxs)(o,{size:`xs`,disabled:!f,onClick:ce,children:[(0,X.jsx)(G,{}),`Add server`]}):null]}),children:[N?(0,X.jsxs)(B,{className:`bg-muted/30 py-3`,children:[(0,X.jsx)(`p`,{className:`truncate font-mono text-[11px] text-foreground`,title:h?.configPath??N.displayPath,children:h?.configPath??N.displayPath}),(0,X.jsx)(`p`,{className:`mt-1 text-[11px] text-muted-foreground`,children:[`${N.nativeScope} scope`,`used by ${N.providerInstances.map(e=>e.displayName??e.instanceId).join(`, `)}`,...le].join(` · `)})]}):null,c?.issues.length||k?(0,X.jsxs)(B,{className:`flex flex-col gap-2`,children:[c?.issues.map(e=>(0,X.jsxs)(R,{tone:`warning`,children:[(0,X.jsx)(`span`,{className:`font-medium text-foreground`,children:e.instanceId}),`:`,` `,e.message]},`${e.instanceId}:${e.message}`)),k?(0,X.jsx)(R,{tone:`error`,children:k}):null]}):null,_?(0,X.jsx)(B,{className:`flex min-h-40 items-center justify-center`,children:(0,X.jsx)(w,{className:`size-5 animate-spin text-muted-foreground`})}):j.length===0?(0,X.jsx)(H,{icon:(0,X.jsx)(C,{}),title:`No MCP provider profiles`,description:`Add or enable a provider instance with a supported MCP configuration surface.`}):h?.servers.length===0?(0,X.jsx)(H,{icon:(0,X.jsx)(p,{}),title:`No MCP servers configured`,description:`Add a stdio or HTTP server to make its tools available to ${F} sessions.`,action:P?.upsert===`available`?(0,X.jsxs)(o,{size:`sm`,onClick:ce,children:[(0,X.jsx)(G,{}),`Add server`]}):null}):(0,X.jsx)(`div`,{className:`min-w-0 border-t border-border/60 first:border-t-0`,children:h?.servers.map(e=>(0,X.jsx)(We,{server:e,capabilities:P??{readConfiguration:`unavailable`,upsert:`unavailable`,remove:`unavailable`,enableDisable:`unavailable`,reload:`unavailable`,health:`unavailable`,inventory:`unavailable`,oauth:`unavailable`,externalAgentControl:`unavailable`,automaticAgentControl:`unavailable`,scopes:[]},writable:e.source===`user`||e.source===`project`&&N?.nativeScope===`project`,mutating:x===e.name,onToggleEnabled:(e,t)=>void K(e,t),onEdit:Y,onRemove:e=>void se(e),onOauthLogin:e=>void q(e)},e.name))})]}),(0,X.jsx)(Ie,{providers:M,selectedWorkspaceId:f,onSelectWorkspace:e=>{m(e),I(e)}}),(0,X.jsx)(Me,{open:re,server:E,providerName:F,onOpenChange:ie,onSubmit:W})]})}export{Ke as McpServersSettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$i as t,Au as n,Cu as r,Fc as i,Fu as a,Gc as o,Gl as s,Hu as c,Jc as l,Kc as u,Lu as d,Su as f,Uu as p,Xc as m,Zc as h,Zi as g,ad as _,al as v,bc as y,cu as b,hc as x,hu as S,ku as C,lu as w,ms as T,ol as E,qc as D,qu as O,tl as k,tu as A,uu as j,xu as M}from"./runtime-DjjjAcTE.js";import{t as N}from"./react-CwJFpaho.js";import{i as P}from"./presentationTier-DPVAxTK4.js";import{a as F}from"./NullStore-gT_6_xZE.js";import{p as I,s as L}from"./useScrollLock-CLZ31xsK.js";import{i as R,n as z,o as B,s as V,t as ee}from"./DialogViewport-C2iOUx0O.js";import{n as H,r as te,t as ne}from"./DialogTitle-BAX_FLoG.js";import{t as re}from"./useControlled-CgAAWIy9.js";import{t as ie}from"./GlassSurface-DLYYzRdP.js";var U=e(N(),1),W=P(),G=120;function K(e){let t=e.replace(/\s+/gu,` `).trim();return t.length<=G?t:`${t.slice(0,119)}…`}var q=_();function J(e){let n=(0,W.c)(37),{label:r,icon:i,secondaryText:a,trailing:o,disabled:s,disabledReason:c,destructive:l,selected:u,onClick:d,className:f}=e,p=s!==void 0&&s,m=l!==void 0&&l,h=(0,U.useId)(),g;n[0]!==p||n[1]!==c?(g=p&&c?K(c):null,n[0]=p,n[1]=c,n[2]=g):g=n[2];let _=g,v=`${h}-label`,y=`${h}-secondary`,b=`${h}-trailing`,x=`${h}-reason`,S=a?y:null,C=o?b:null,w;n[3]!==v||n[4]!==S||n[5]!==C?(w=[v,S,C].filter(Y),n[3]=v,n[4]=S,n[5]=C,n[6]=w):w=n[6];let T=w.join(` `),E=_?T:void 0,D=_?x:void 0,O=m&&!p&&`text-destructive`,k=u&&`bg-accent/60 font-medium`,A;n[7]!==f||n[8]!==k||n[9]!==O?(A=t(`flex min-h-11 w-full items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:text-muted-foreground/60`,O,k,f),n[7]=f,n[8]=k,n[9]=O,n[10]=A):A=n[10];let j;n[11]!==r||n[12]!==v?(j=(0,q.jsx)(`span`,{id:v,className:`truncate`,children:r}),n[11]=r,n[12]=v,n[13]=j):j=n[13];let M;n[14]!==y||n[15]!==a?(M=a?(0,q.jsx)(`span`,{id:y,className:`truncate text-xs text-muted-foreground`,children:a}):null,n[14]=y,n[15]=a,n[16]=M):M=n[16];let N;n[17]!==_||n[18]!==x?(N=_?(0,q.jsx)(`span`,{id:x,className:`truncate text-xs text-muted-foreground/80`,children:_}):null,n[17]=_,n[18]=x,n[19]=N):N=n[19];let P;n[20]!==j||n[21]!==M||n[22]!==N?(P=(0,q.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[j,M,N]}),n[20]=j,n[21]=M,n[22]=N,n[23]=P):P=n[23];let F;n[24]!==o||n[25]!==b?(F=o?(0,q.jsx)(`span`,{id:b,className:`flex shrink-0 items-center gap-2`,children:o}):null,n[24]=o,n[25]=b,n[26]=F):F=n[26];let I;return n[27]!==p||n[28]!==i||n[29]!==d||n[30]!==u||n[31]!==A||n[32]!==P||n[33]!==F||n[34]!==E||n[35]!==D?(I=(0,q.jsxs)(`button`,{type:`button`,disabled:p,"aria-labelledby":E,"aria-describedby":D,"aria-pressed":u,className:A,"data-slot":`mobile-list-row`,onClick:d,children:[i,P,F]}),n[27]=p,n[28]=i,n[29]=d,n[30]=u,n[31]=A,n[32]=P,n[33]=F,n[34]=E,n[35]=D,n[36]=I):I=n[36],I}function Y(e){return e!==null}var ae=`--nested-drawers`,oe=`--drawer-height`,se=`--drawer-frontmost-height`,ce=`--drawer-swipe-movement-x`,le=`--drawer-swipe-movement-y`,X=`--drawer-snap-point-offset`,ue=`--drawer-swipe-strength`,de=`--drawer-swipe-progress`,fe=U.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,c=V(),l=c.useState(`open`),u=c.useState(`nested`),d=c.useState(`mounted`),f={open:l,transitionStatus:c.useState(`transitionStatus`)};return v(`div`,e,{state:f,ref:[c.context.backdropRef,t],stateAttributesMapping:s,props:[{role:`presentation`,hidden:!d,style:{pointerEvents:l?void 0:`none`,userSelect:`none`,WebkitUserSelect:`none`,[de]:`0`,[ue]:`1`}},o],enabled:a||!u})}),pe=te,me=`data-drawer-content`,he=U.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return V(),v(`div`,e,{ref:t,props:[{[me]:``},a]})}),ge=H,_e=U.createContext(void 0);function ve(){return U.useContext(_e)}var ye=`data-expanded`,be=`data-nested-drawer-open`,Z=`data-nested-drawer-swiping`,xe=`data-swipe-dismiss`,Se=`data-swipe-direction`,Ce=`data-swiping`,we=U.createContext(void 0);function Te(e){let t=U.useContext(we);if(e!==!0&&t===void 0)throw Error(c(90));return t}function Ee(e,t){let n=e+t;return n>=0?t:-Math.sqrt(-n)-e}function Q(e,t,n){if(!Number.isFinite(t)||t<=0)return null;if(typeof e==`number`)return Number.isFinite(e)?e<=1?m(e,0,1)*t:e:null;let r=e.trim();if(r.endsWith(`px`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e:null}if(r.endsWith(`rem`)){let e=Number.parseFloat(r);return Number.isFinite(e)?e*n:null}return null}function De(e,t){let n=-1,r=1/0;for(let i=0;i<e.length;i+=1){let a=Math.abs(e[i]-t);a<r&&(r=a,n=i)}return n}function Oe(){let e=V(),{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:i,popupHeight:a}=Te(),o=e.useState(`viewportElement`),[s,c]=U.useState(0),[l,u]=U.useState(16),f=d(()=>{let e=r(o).documentElement;c(o?o.offsetHeight:e.clientHeight);let t=parseFloat(getComputedStyle(e).fontSize);Number.isFinite(t)&&u(t)});p(()=>{if(f(),!o||typeof ResizeObserver!=`function`)return;let e=new ResizeObserver(f);return e.observe(o),()=>{e.disconnect()}},[f,o]);let h=U.useMemo(()=>{if(!t||t.length===0||s<=0||a<=0)return[];let e=Math.min(a,s),n=t.map(t=>{let n=Q(t,s,l);if(n===null)return null;let r=m(n,0,e);return{value:t,height:r,offset:Math.max(0,a-r)}}).filter(e=>!!e);if(n.length<=1)return n;let r=[],i=[];for(let e=n.length-1;e>=0;--e){let t=n[e];i.some(e=>Math.abs(e-t.height)<=1)||(i.push(t.height),r.push(t))}return r.reverse(),r},[a,l,t,s]);return{snapPoints:t,activeSnapPoint:n,setActiveSnapPoint:i,popupHeight:a,viewportHeight:s,resolvedSnapPoints:h,activeSnapPointOffset:U.useMemo(()=>{if(n===null)return;let e=h.find(e=>Object.is(e.value,n));if(e)return e;let t=Math.min(a,s),r=Q(n,s,l);if(r===null)return;let i=m(r,0,t);return h[De(h.map(e=>e.height),i)]},[n,a,h,l,s])?.offset??null}}var ke=U.createContext(null);function Ae(){return U.useContext(ke)}var je=!1;function Me(){je||=(typeof CSS<`u`&&`registerProperty`in CSS&&([ce,le,X].forEach(e=>{try{CSS.registerProperty({name:e,syntax:`<length>`,inherits:!1,initialValue:`0px`})}catch{}}),[{name:de,initialValue:`0`},{name:ue,initialValue:`1`}].forEach(({name:e,initialValue:t})=>{try{CSS.registerProperty({name:e,syntax:`<number>`,inherits:!1,initialValue:t})}catch{}})),!0)}var Ne={...s,expanded(e){return e?{[ye]:``}:null},nestedDrawerOpen(e){return e?{[be]:``}:null},nestedDrawerSwiping(e){return e?{[Z]:``}:null},swipeDirection(e){return{[Se]:e}},swiping(e){return e?{[Ce]:``}:null}},$=U.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=V(),l=c.context.popupRef,{swipeDirection:u,frontmostHeight:f,hasNestedDrawer:m,nestedSwiping:h,nestedSwipeProgressStore:g,onPopupHeightChange:_,notifyParentFrontmostHeight:y,notifyParentHasNestedDrawer:b}=Te(),x=c.useState(`descriptionElementId`),S=c.useState(`disablePointerDismissal`),C=c.useState(`floatingRootContext`),w=c.useState(`popupProps`),T=c.useState(`modal`),E=c.useState(`mounted`),D=c.useState(`nested`),A=c.useState(`nestedOpenDrawerCount`),j=c.useState(`transitionStatus`),M=c.useState(`open`),N=c.useState(`openMethod`),P=c.useState(`titleElementId`),R=c.useState(`role`),z=C.useState(`floatingId`),ee=s.id??z,H=Ae();B();let{snapPoints:te,activeSnapPoint:ne,activeSnapPointOffset:re}=Oe(),ie=A>0,W=H?.swiping??!1,G=H?.swipeStrength??null,[K,J]=U.useState(0),Y=U.useRef(0),ce=d(()=>{let e=l.current;if(!e)return;let t=e.offsetHeight;if(Y.current>0&&f>Y.current&&t>Y.current)return;if(Y.current>0&&m){let e=Y.current;J(e),_(e);return}let n=t;n!==Y.current&&(Y.current=n,J(n),_(n))});p(()=>{if(!E){Y.current=0,J(0),_(0);return}let e=l.current;if(!e||(Me(),ce(),typeof ResizeObserver!=`function`))return;let t=new ResizeObserver(ce);return t.observe(e),()=>{t.disconnect()}},[ce,E,ie,_,l]),p(()=>{let e=()=>{let e=l.current;if(!e)return;let t=g.getSnapshot();t>0?e.style.setProperty(de,`${t}`):e.style.setProperty(de,`0`)};e();let t=g.subscribe(e),n=l.current;return()=>{t(),n&&n.style.setProperty(de,`0`)}},[g,l]),p(()=>{if(M)return y?.(f),()=>{y?.(0)}},[f,M,y]),p(()=>{if(b)return b(M||j===`ending`),()=>{b(!1)}},[b,M,j]),k({open:M,ref:l,onComplete(){M&&c.context.onOpenChangeComplete?.(!0)}});let fe=o===void 0?l:o,pe=c.useStateSetter(`popupElement`),me={open:M,nested:D,transitionStatus:j,expanded:ne===1,nestedDrawerOpen:ie,nestedDrawerSwiping:h,swipeDirection:u,swiping:W},he;K&&(m||j===`ending`)&&(he=`${K}px`);let ge=te&&te.length>0&&(u===`down`||u===`up`),_e=null;ge&&re!==null&&(_e=u===`up`?-re:re);let ve=H?H.getDragStyles():O;if(ge&&u===`down`){let e=re??0,t=Number.parseFloat(String(ve[le]));ve=W&&Number.isFinite(t)?{...ve,transform:void 0,[le]:`${Ee(e,t)}px`}:{...ve,transform:void 0}}let ye=v(`div`,e,{state:me,props:[w,{id:ee,"aria-labelledby":P,"aria-describedby":x,role:R,...F,hidden:!E,onKeyDown(e){L.has(e.key)&&e.stopPropagation()},style:{...ve,[de]:`0`,[ae]:A,[oe]:he,[X]:typeof _e==`number`?`${_e}px`:`0px`,[se]:f?`${f}px`:void 0,[ue]:typeof G==`number`&&Number.isFinite(G)&&G>0?`${G}`:`1`}},s],ref:[t,l,pe],stateAttributesMapping:Ne});return(0,q.jsx)(I,{context:C,openInteractionType:N,disabled:!E,closeOnFocusOut:!S,initialFocus:fe,returnFocus:a,modal:T!==!1,restoreFocus:`popup`,children:ye})}),Pe=R,Fe,Ie;function Le(e){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:i,onOpenChangeComplete:a,disablePointerDismissal:o=!1,modal:s=!0,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f=null,swipeDirection:p=`down`,snapToSequentialPoints:m=!1,snapPoints:h,snapPoint:g,defaultSnapPoint:_,onSnapPointChange:v}=e,y=Te(!0),b=y?.onNestedSwipeProgressChange,S=y?.onNestedFrontmostHeightChange,C=y?.onNestedSwipingChange,w=y?.onNestedDrawerPresenceChange,[T,E]=U.useState(0),[D,O]=U.useState(0),[k,A]=U.useState(!1),[j,M]=U.useState(!1),[N]=U.useState(Re),P=_===void 0?h?.[0]??null:_,F=g!==void 0,[I,L]=re({controlled:g,default:P,name:`Drawer`,state:`snapPoint`}),R=U.useRef(!1),B=U.useRef(!1),V=d((e,t)=>{let n=t??x(`none`);v?.(e,n),!n.isCanceled&&L(e)}),ee=U.useMemo(()=>F||!h||h.length===0?I:I===null||!h.some(e=>Object.is(e,I))?P:I,[I,F,P,h]),H=d(e=>{E(e),!R.current&&e>0&&O(e)}),te=d(e=>{if(e>0){R.current=!0,O(e);return}R.current=!1,T>0&&O(T)}),ne=d(e=>{A(e)}),ie=d(e=>{N.set(e),b?.(e)}),W=d(e=>{M(e),C?.(e)}),G=d((e,t)=>{i?.(e,t),!t.isCanceled&&!e&&h&&h.length>0&&V(P,x(t.reason,t.event,t.trigger))}),K=U.useMemo(()=>({swipeDirection:p,swipeAreaActiveRef:B,snapToSequentialPoints:m,snapPoints:h,activeSnapPoint:ee,setActiveSnapPoint:V,frontmostHeight:D,popupHeight:T,hasNestedDrawer:k,nestedSwiping:j,nestedSwipeProgressStore:N,onNestedDrawerPresenceChange:ne,onPopupHeightChange:H,onNestedFrontmostHeightChange:te,onNestedSwipingChange:W,onNestedSwipeProgressChange:ie,notifyParentFrontmostHeight:S,notifyParentSwipingChange:C,notifyParentSwipeProgressChange:b,notifyParentHasNestedDrawer:w}),[ee,D,k,j,N,w,b,C,S,ne,te,ie,W,H,T,V,h,m,B,p]),J=typeof t==`function`?e=>(0,q.jsxs)(U.Fragment,{children:[Fe||=(0,q.jsx)(ze,{}),t(e)]}):(0,q.jsxs)(U.Fragment,{children:[Ie||=(0,q.jsx)(ze,{}),t]}),Y=z(`drawer`,{open:n,defaultOpen:r,onOpenChange:G,onOpenChangeComplete:a,disablePointerDismissal:o,modal:s,actionsRef:c,handle:l,triggerId:u,defaultTriggerId:f,children:J});return(0,q.jsx)(we.Provider,{value:K,children:Y})}function Re(){let e=0,t=new Set;return{getSnapshot:()=>e,set(n){let r=Number.isFinite(n)?n:0;r!==e&&(e=r,t.forEach(e=>{e()}))},subscribe(e){return t.add(e),()=>{t.delete(e)}}}}function ze(){let e=ve(),t=V(!1),n=e?.setDrawerOpen,r=e?.removeDrawer,i=t.useState(`open`),a=t.useState(`nestedOpenDialogCount`),o=t.useState(`popupElement`),s=a===0;return p(()=>{if(r)return()=>{r(t)}},[r,t]),p(()=>{n?.(t,i)},[i,n,t]),U.useEffect(()=>{if(!i||!s||!S)return;let e=C(o).CloseWatcher;if(!e)return;function n(e){t.select(`open`)&&t.setOpen(!1,x(y,e))}let r=new e,a=f(r,`close`,n);return()=>{a(),r.destroy()}},[t,s,i,o]),null}var Be=ne,Ve=e(a(),1),He=`data-nested-dialog-open`,Ue=U.createContext(void 0);function We(){return U.useContext(Ue)}var Ge=10,Ke=.5,qe=.5,Je=300,Ye=4,Xe=.2,Ze=4,Qe=80,$e=360,et=.1,tt=6,nt=2,rt=`[${me}]`,it=U.forwardRef(function(e,t){let{render:a,className:s,style:c,children:h,...g}=e,_=V(),v=_.context.popupRef,y=_.context.backdropRef,{swipeDirection:b,notifyParentSwipingChange:S,notifyParentSwipeProgressChange:C,frontmostHeight:T,snapToSequentialPoints:O,swipeAreaActiveRef:k}=Te(),N=ve(),{snapPoints:P,resolvedSnapPoints:F,activeSnapPoint:I,activeSnapPointOffset:L,setActiveSnapPoint:R,popupHeight:z}=Oe(),B=_.useState(`open`),H=_.useState(`mounted`),te=_.useState(`nested`),ne=_.useState(`nestedOpenDrawerCount`),re=_.useState(`viewportElement`),ie=_.useState(`popupElement`),W=N?.visualStateStore,G=ne>0,K=b===`left`||b===`right`?`horizontal`:`vertical`,J=K===`vertical`,Y=J?`horizontal`:`vertical`,[ae,se]=U.useState(null),X=U.useRef(void 0),ue=U.useRef(null),fe=M(),pe=U.useRef(!1),me=U.useRef(!1),he=U.useRef(``),ge=U.useRef(!1),_e=U.useRef(!1),ye=U.useRef(null),be=We(),Z=U.useMemo(()=>{if(!P||P.length<2||F.length<2||b!==`down`&&b!==`up`)return null;let e=F.map(e=>e.offset).sort((e,t)=>e-t),t=e[0];return{minOffset:t,range:e[1]-t}},[F,P,b]),Se=U.useMemo(()=>!Z||L===null?null:m((L-Z.minOffset)/Z.range,0,1),[L,Z]),Ce=U.useMemo(()=>P&&P.length>0&&(b===`down`||b===`up`)?b===`down`?[`down`,`up`]:[`up`,`down`]:[b],[P,b]),we=d(e=>{v.current?.toggleAttribute(xe,e),y.current?.toggleAttribute(xe,e)}),Q=d(()=>{we(!1),v.current?.removeAttribute(A),se(null)}),Ae=d(()=>{me.current&&(me.current=!1,S?.(!1))}),je=d((e,t,n)=>{let r=B&&!te&&t,i=r?e:0,a=B&&t?e:0;n&&C&&(C(a),a<=0&&Ae()),W?.set({swipeProgress:i,frontmostHeight:i>0?T:0});let o=y.current;if(!o)return;let s=r&&i>0;o.style.setProperty(de,s?`${i}`:`0`),s&&T>0?o.style.setProperty(oe,`${T}px`):o.style.removeProperty(oe)});function Me(e,t,n,r,i,a,s,c){let l=ct(e,t);if(l<=0)return null;let u=((t===`down`||t===`up`)&&P&&P.length>0?L??0:0)+o(t,n,r),d=Math.max(0,l-u);if(d<=0)return null;let f=o(t,s,c),p=Math.abs(f)>0?f:o(t,i,a);if(p<=Xe)return null;let h=m(p,Xe,Ze);return et+(m(d/h,Qe,$e)-Qe)/280*.9}function Ne(e){if(me.current||!e)return;let t=e.direction??b,n=o(t,e.deltaX,e.deltaY);Math.abs(n)<Ge||(me.current=!0,S?.(!0))}let $=u({enabled:H&&!G,directions:Ce,elementRef:_.context.popupRef,ignoreSelectorWhenTouch:!1,ignoreScrollableAncestors:!0,movementCssVars:{x:ce,y:le},onSwipeStart(e){if(`touches`in e||e.pointerType===`touch`)return;let t=v.current,i=r(t).getSelection?.();if(!i||i.isCollapsed)return;let a=n(i.anchorNode)?i.anchorNode:i.anchorNode?.parentElement,o=n(i.focusNode)?i.focusNode:i.focusNode?.parentElement;(w(t,a)||w(t,o))&&i.removeAllRanges()},onSwipingChange(e){pe.current=e,at(_.context.backdropRef.current,e),!e&&!C&&Ae()},swipeThreshold({element:e,direction:t}){return lt(e,t)},canStart(e,t){let n=_.context.popupRef.current;if(!n)return!1;let r=n.ownerDocument,i=D(n.getRootNode(),e.x,e.y);if(!i||!w(n,i))return!1;let a=t.nativeEvent;return!((`touches`in a||a.pointerType===`touch`)&&pt(r,n))},onProgress(e,t){let n=pe.current;n&&Ne(t);let r=!!(P&&P.length>0);if(n&&b===`down`&&r&&t){let e=_.context.popupRef.current;e&&(e.style.removeProperty(`transform`),e.style.setProperty(le,`${Ee(L??0,t.deltaY)}px`))}let i=e;if(Z&&z>0){let e=L??Z.minOffset;n&&t&&Number.isFinite(t.deltaY)?i=(e=>m((e-Z.minOffset)/Z.range,0,1))(m(e+t.deltaY,0,z)):Se!==null&&(i=Se)}n||(C?.(0),Ae()),je(i,!0,n)},onRelease({event:e,deltaX:t,deltaY:n,direction:r,velocityX:a,velocityY:s,releaseVelocityX:c,releaseVelocityY:l}){let u=_.context.popupRef.current;if(!u){Q();return}let d=u;function f(e){Ae(),we(!0),d.style.removeProperty(`transition`),d.setAttribute(A,``),Ve.flushSync(()=>{se(Me(d,e,t,n,a,s,c,l))})}if(!P||P.length===0){if(!r){Q();return}let e=o(r,t,n);if(e<=0)return Q(),!1;if(o(r,a,s)>=Ke)return f(r),!0;let i=e>lt(d,r);return i?f(r):Q(),i}if(b!==`down`&&b!==`up`){Q();return}if(!z)return Q(),!1;if(F.length===0){Q();return}let p=b===`down`?n:-n,h=Math.sign(p),g=b===`down`?l:-l,v=b===`down`?s:-s,y=g;if(h!==0&&Math.abs(p)>=Ge){let e=Math.sign(y);e!==0&&e!==h&&(y=v)}let S=L??0,C=m(S+p,0,z),w=Math.abs(y)>=qe?m(y,-4,Ye)*Je:0,T=O?C:m(C+w,0,z),E=x(i,e),D=()=>(je(0,!0,!0),Q(),!1),k=e=>(R(e.value,E),D()),j=e=>r?(R(null,E),E.isCanceled?D():(X.current=I,f(b),!0)):k(e);if(O){let e=[...F].sort((e,t)=>e.offset-t.offset),t=e.map(e=>e.offset),n=De(t,S),r=e[De(t,T)],i=Math.sign(y),a=h!==0&&i!==0&&i===h&&Math.abs(y)>=qe,o=T;if(a){let t=m(n+h,0,e.length-1);if(t!==n){let n=e[t];(h>0?T<n.offset:T>n.offset)&&(r=n,o=n.offset)}else if(h>0)return j(r)}return Math.abs(o-z)<Math.abs(o-r.offset)?j(r):k(r)}let M=F[De(F.map(e=>e.offset),T)];return y>=Ke&&p>0||Math.abs(T-z)<Math.abs(T-M.offset)?j(M):k(M)},onDismiss(e){W?.set({swipeProgress:0,frontmostHeight:0});let t=_.context.backdropRef.current;t&&(t.style.setProperty(de,`0`),t.style.removeProperty(oe));let n=x(i,e);if(_.setOpen(!1,n),n.isCanceled){let t=X.current;t!==void 0&&R(t,x(i,e)),X.current=void 0,ue.current?.(),Q();return}if(_.select(`open`)){let t=e;fe.request(()=>{if(_.select(`open`)){let e=X.current;e!==void 0&&R(e,x(i,t)),X.current=void 0,Q(),ue.current?.()}else X.current=void 0});return}X.current=void 0,we(!0)}}),Pe=$.getPointerProps(),Fe=$.getTouchProps(),{moveNative:Ie,reset:Le}=$;ue.current=Le,U.useEffect(()=>{let e=re??ie;if(!e)return;let t=e,n=r(t);function i(e,r,i){let a=J?i.clientY-r.lastY:i.clientX-r.lastX;if(e.touches.length===2||pt(n,t)||!B||!H||G||_t(r,e,i,J))return;let o=r.scrollTarget;if(!o||o===n.documentElement||o===n.body){e.cancelable&&e.preventDefault(),e.stopPropagation(),Ie(e,t);return}if(!vt(o,K)){e.cancelable&&e.preventDefault(),e.stopPropagation();return}if(a!==0){let t=xt(o,K,b,a);r.allowSwipe?e.cancelable&&e.preventDefault():e.cancelable&&t?(r.allowSwipe=!0,e.preventDefault()):r.allowSwipe=!1}r.allowSwipe===!0&&(e.stopPropagation(),Ie(e,t))}function a(e){if(be?.onTouchMove(e),_e.current)return;let t=ye.current,n=e.touches[0];n&&t&&(i(e,t,n),gt(t,n))}return f(n,`touchmove`,a,{passive:!1,capture:!0})},[H,G,B,ie,J,K,b,Ie,re,be]),p(()=>{Z&&!$.swiping&&je(!B||te?0:Se??0,!0,!1)},[je,T,te,C,B,Se,Z,$.swiping,_,W]),p(()=>{if(C)return B||C(0),()=>{C(0)}},[C,B]),p(()=>{B&&(k.current||Le(),Q())},[Q,B,Le,k]),p(()=>{let e=y.current;return()=>{W?.set({swipeProgress:0,frontmostHeight:0}),at(e,!1);let t=y.current;t!==e&&at(t,!1),Ae()}},[y,Ae,W]);let Re=U.useMemo(()=>({swiping:$.swiping,getDragStyles:$.getDragStyles,swipeStrength:ae??null,setSwipeDismissed:we}),[we,$.getDragStyles,$.swiping,ae]);function ze(e){_e.current=e,ye.current=null}function Be(){ze(!1),he.current=``,ge.current=!1}function Ue(e){return he.current=``,e.pointerType!==`touch`}return(0,q.jsx)(ee,{ref:t,className:s,style:c,render:a,...E(g,{onPointerDown(e){if(he.current=e.pointerType,ge.current=e.pointerType===`pen`,!B||!H||G)return;let t=D(e.currentTarget.getRootNode(),e.clientX,e.clientY);ot(t)||st(t)||e.pointerType!==`touch`&&Pe.onPointerDown?.(e)},onPointerMove(e){e.pointerType!==`touch`&&Pe.onPointerMove?.(e)},onPointerUp(e){Ue(e)&&Pe.onPointerUp?.(e)},onPointerCancel(e){Ue(e)&&Pe.onPointerCancel?.(e)},onTouchStart(e){if(he.current===`pen`&&ge.current){ge.current=!1,ze(!1);return}if(!B||!H||G){ze(!1);return}let t=e.touches[0];if(!t)return;if(ht(e)){ze(!1);return}let r=e.currentTarget,i=D(r.getRootNode(),t.clientX,t.clientY),a=j(e.nativeEvent),o=n(a)?a:r;if(!w(r,o)){ze(!0);return}if(be?.onTouchStart(e),ot(i)){ze(!0);return}_e.current=!1;let s=l(o,r,K),c=l(o,r,Y)!=null,u=null;s&&(u=bt(s,K,b)?null:!1),ye.current={startX:t.clientX,startY:t.clientY,lastX:t.clientX,lastY:t.clientY,scrollTarget:s,hasCrossAxisScrollableContent:c,allowSwipe:u,preserveNativeCrossAxisScroll:!1,drawerAxisAttributed:!1},Fe.onTouchStart?.(e)},onTouchEnd(e){be?.onTouchEnd(e),Be(),Fe.onTouchEnd?.(e)},onTouchCancel(e){be?.onTouchCancel(),Be(),Fe.onTouchCancel?.(e)},[He]:void 0}),children:(0,q.jsx)(ke.Provider,{value:Re,children:h})})});function at(e,t){e?.toggleAttribute(Ce,t)}function ot(e){return!!e?.closest(h)}function st(e){return!!e?.closest(rt)}function ct(e,t){return t===`left`||t===`right`?e.offsetWidth:e.offsetHeight}function lt(e,t){return Math.max(ct(e,t)*.5,Ge)}function ut(e,t){return e instanceof t.HTMLInputElement&&e.type===`range`}function dt(e){return e.tagName===`INPUT`||e.tagName===`TEXTAREA`}function ft(e,t){let r=n(e.anchorNode)?e.anchorNode:e.anchorNode?.parentElement,i=n(e.focusNode)?e.focusNode:e.focusNode?.parentElement;return e.containsNode(t,!0)||w(t,r)||w(t,i)}function pt(e,t){let n=b(e);if(n&&w(t,n)&&dt(n)){let{selectionStart:e,selectionEnd:t}=n;if(e!=null&&t!=null&&e<t)return!0}let r=e.getSelection?.();return!r||r.isCollapsed?!1:ft(r,t)}function mt(e,t){return e.composedPath().some(e=>ut(e,t))}function ht(e){return mt(e.nativeEvent,C(e.currentTarget))}function gt(e,t){e.lastX=t.clientX,e.lastY=t.clientY}function _t(e,t,n,r){if(e.preserveNativeCrossAxisScroll)return!0;if(e.drawerAxisAttributed||e.allowSwipe===!0||!e.hasCrossAxisScrollableContent)return!1;if(!t.cancelable)return e.preserveNativeCrossAxisScroll=!0,!0;let i=r?n.clientY-e.startY:n.clientX-e.startX,a=r?n.clientX-e.startX:n.clientY-e.startY,o=Math.abs(i),s=Math.abs(a);return s>=tt&&s>o+nt?(e.preserveNativeCrossAxisScroll=!0,!0):o>=tt?(e.drawerAxisAttributed=!0,!1):!0}function vt(e,t){return yt(e,t).max>0}function yt(e,t){if(t===`vertical`){let t=Math.max(0,e.scrollHeight-e.clientHeight);return{offset:e.scrollTop,max:t}}let n=Math.max(0,e.scrollWidth-e.clientWidth);return{offset:e.scrollLeft,max:n}}function bt(e,t,n){let r=St(n,t),{offset:i,max:a}=yt(e,t);return r?i<=0:i>=a}function xt(e,t,n,r){return(St(n,t)?r>0:r<0)&&bt(e,t,n)}function St(e,t){return t===`vertical`?e===`down`:e===`right`}var Ct=.5,wt=1,Tt=[Ct,wt];function Et(e){return e===`medium`?Ct:wt}function Dt(e){return e==null?null:e===Ct?`medium`:`large`}function Ot(e){let n=(0,W.c)(23),{open:r,onOpenChange:i,label:a,detent:o,onDetentChange:s,activeDetent:c,className:l,children:u}=e,d=o===void 0?`large`:o,f;n[0]===d?f=n[1]:(f=Et(d),n[0]=d,n[1]=f);let p;n[2]===c?p=n[3]:(p=c===void 0?{}:{snapPoint:c===null?null:Et(c)},n[2]=c,n[3]=p);let m;n[4]===s?m=n[5]:(m=e=>s?.(Dt(e)),n[4]=s,n[5]=m);let h;n[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,q.jsx)(fe,{className:t(`app-sheet-backdrop fixed inset-0 z-50 backdrop-blur-sm`,`transition-opacity duration-[var(--app-motion-duration-sheet)] ease-[var(--app-motion-ease)] data-ending-style:opacity-0 data-starting-style:opacity-0 motion-reduce:transition-none`),"data-slot":`mobile-sheet-backdrop`}),n[6]=h):h=n[6];let _;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=t(`pointer-events-auto fixed inset-0 z-50 flex flex-col justify-end pt-12`,`pb-[var(--app-keyboard-inset,0px)]`),n[7]=_):_=n[7];let v;n[8]===l?v=n[9]:(v=t(ie(`sheet`),`pointer-events-auto flex max-h-full min-h-0 w-full min-w-0 flex-col rounded-t-2xl border-t not-dark:bg-clip-padding text-popover-foreground shadow-lg/5`,`pb-safe pl-safe pr-safe`,`translate-y-[calc(var(--drawer-snap-point-offset,0px)+var(--drawer-swipe-movement-y,0px))] data-ending-style:translate-y-full data-starting-style:translate-y-full`,`transition-[translate,scale] duration-[var(--app-motion-duration-sheet)] ease-[var(--app-motion-ease)] will-change-transform motion-reduce:transition-none`,`data-nested-drawer-open:scale-96`,l),n[8]=l,n[9]=v);let y;n[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,q.jsx)(`span`,{"aria-hidden":!0,className:`mx-auto mt-2 mb-1 h-1 w-9 shrink-0 rounded-full bg-muted-foreground/32`,"data-slot":`mobile-sheet-grabber`}),n[10]=y):y=n[10];let b;n[11]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,q.jsx)(pe,{"aria-label":`Close`,className:`absolute end-2 top-2 z-20`,"data-slot":`mobile-sheet-close`,render:(0,q.jsx)(g,{size:`icon`,variant:`ghost`}),children:(0,q.jsx)(T,{})}),n[11]=b):b=n[11];let x;n[12]!==u||n[13]!==a||n[14]!==v?(x=(0,q.jsxs)(Pe,{children:[h,(0,q.jsx)(it,{className:_,"data-slot":`mobile-sheet-viewport`,children:(0,q.jsxs)($,{"aria-label":a,className:v,"data-slot":`sheet-popup`,"data-mobile-sheet":``,onKeyDown:kt,children:[y,u,b]})})]}),n[12]=u,n[13]=a,n[14]=v,n[15]=x):x=n[15];let S;return n[16]!==i||n[17]!==r||n[18]!==x||n[19]!==f||n[20]!==p||n[21]!==m?(S=(0,q.jsx)(Le,{open:r,onOpenChange:i,swipeDirection:`down`,snapPoints:Tt,defaultSnapPoint:f,...p,onSnapPointChange:m,children:x}),n[16]=i,n[17]=r,n[18]=x,n[19]=f,n[20]=p,n[21]=m,n[22]=S):S=n[22],S}function kt(e){e.stopPropagation()}function At(e){let n=(0,W.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`flex shrink-0 flex-col gap-1 px-4 pt-2 pe-11 pb-3`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,q.jsx)(`div`,{className:a,"data-slot":`mobile-sheet-header`,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}function jt(e){let n=(0,W.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`truncate font-heading font-semibold text-base leading-tight`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,q.jsx)(Be,{className:a,"data-slot":`mobile-sheet-title`,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}function Mt(e){let n=(0,W.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`text-muted-foreground text-sm`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,q.jsx)(ge,{className:a,"data-slot":`mobile-sheet-description`,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}function Nt(e){let n=(0,W.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`min-h-0 flex-1 overflow-y-auto overscroll-contain px-4 pb-2`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,q.jsx)(he,{className:a,"data-slot":`mobile-sheet-panel`,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}function Pt(e){let n=(0,W.c)(8),r,i;n[0]===e?(r=n[1],i=n[2]):({className:r,...i}=e,n[0]=e,n[1]=r,n[2]=i);let a;n[3]===r?a=n[4]:(a=t(`flex shrink-0 flex-col-reverse gap-2 px-4 pt-3 pb-2 sm:flex-row`,r),n[3]=r,n[4]=a);let o;return n[5]!==i||n[6]!==a?(o=(0,q.jsx)(`div`,{className:a,"data-slot":`mobile-sheet-footer`,...i}),n[5]=i,n[6]=a,n[7]=o):o=n[7],o}export{Nt as a,K as c,At as i,Mt as n,jt as o,Pt as r,J as s,Ot as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$i as t,No as n,ad as r,sd as i,ws as a}from"./runtime-DjjjAcTE.js";import{t as o}from"./react-CwJFpaho.js";import{et as s}from"./popover-OWEv6cQz.js";import{i as c}from"./presentationTier-DPVAxTK4.js";import{gt as l}from"./messageQueueDrain-B7R7Qmq6.js";import{t as u}from"./hammer-BXo-EU88.js";import{t as d}from"./rotate-ccw-BE2ZCwL6.js";import{t as f}from"./shield-check-_wl7R4Js.js";import{_ as p,a as m,g as h,h as g,i as _,m as v,n as y,p as b,r as x,s as S,t as C,u as ee,x as te,y as w}from"./useProviderOptionsUpdater-CTzNh2B7.js";import"./providerModels-v9PYbzRE.js";import{v as T}from"./appearancePreferences-NnsvXwBe.js";import{n as ne,t as re}from"./RollingText-BzvpP5fa.js";var E={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4`,key:`1e3is1`}],[`path`,{d:`M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5`,key:`1gqd8o`}],[`path`,{d:`M17.997 5.125a4 4 0 0 1 2.526 5.77`,key:`iwvgf7`}],[`path`,{d:`M18 18a4 4 0 0 0 2-7.464`,key:`efp6ie`}],[`path`,{d:`M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517`,key:`1gq6am`}],[`path`,{d:`M6 18a4 4 0 0 1-2-7.464`,key:`k1g0md`}],[`path`,{d:`M6.003 5.125a4 4 0 0 0-2.526 5.77`,key:`q97ue3`}]]};E.node;var ie=a(E),D={name:`clipboard-list`,size:24,node:[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}],[`path`,{d:`M12 11h4`,key:`1jrz19`}],[`path`,{d:`M12 16h4`,key:`n85exb`}],[`path`,{d:`M8 11h.01`,key:`1dfujw`}],[`path`,{d:`M8 16h.01`,key:`18s6g9`}]]};D.node;var O=a(D),k={name:`lock-open`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 9.9-1`,key:`1mm8w8`}]],aliases:[`unlock`]};k.node;var A=a(k),j={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};j.node;var M=a(j),N={name:`message-circle-question-mark`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`message-circle-question`]};N.node;var P=a(N),ae={"approval-required":{label:`Supervised`,triggerLabel:`Supervised`,description:`Ask before commands and file changes.`,icon:M},"auto-accept-edits":{label:`Auto-accept edits`,triggerLabel:`Auto-accept`,description:`Auto-approve edits, ask before other actions.`,icon:l},auto:{label:`Auto`,triggerLabel:`Auto`,description:`Routine actions proceed without you; risky ones still ask.`,icon:f},"full-access":{label:`Full access`,triggerLabel:`Full access`,description:`Allow commands and edits without prompts.`,icon:A}},oe=Object.keys(ae),F=`full-access`,se=`text-orange-700 hover:text-orange-800 dark:text-orange-400 dark:hover:text-orange-300`,I={default:{label:`Build`,triggerLabel:`Build`,description:`Make changes and run commands.`,icon:u},plan:{label:`Plan`,triggerLabel:`Plan`,description:`Chat toward a plan before making changes.`,icon:O},ask:{label:`Ask`,triggerLabel:`Ask`,description:`Read-only — answer questions without editing files.`,icon:P}},ce=Object.keys(I),L=c(),R=e(o(),1),z=r(),B=15,le=/^Ultrathink:\s*/i,V=(0,R.memo)(function(e){let n=(0,L.c)(87),{tuning:r}=e,i=te(),a,o,c,l,u,f;n[0]!==e.disabled||n[1]!==r?(c=ee(r),a=e.disabled??!1,o=c?.kind===`effort`&&r.ultrathinkInBodyText,l=a||o,u=c?c.stops[c.index]:void 0,f=c?.kind===`thinking`?u?.id===`on`?`thinking`:`off`:v(u?.id),n[0]=e.disabled,n[1]=r,n[2]=a,n[3]=o,n[4]=c,n[5]=l,n[6]=u,n[7]=f):(a=n[2],o=n[3],c=n[4],l=n[5],u=n[6],f=n[7]);let h=f,g=r.speed,y=g!==`standard`,x;n[8]===r.descriptors?x=n[9]:(x=b(r.descriptors),n[8]=r.descriptors,n[9]=x);let C=x,{onSelectEffort:w,onSetThinking:T}=e,E;n[10]!==w||n[11]!==T||n[12]!==c||n[13]!==l?(E=e=>{if(!c||l)return;let t=c.stops[e];t&&e!==c.index&&(c.kind===`effort`?w(t.id):T(t.id===`on`))},n[10]=w,n[11]=T,n[12]=c,n[13]=l,n[14]=E):E=n[14];let D=E,O,k;n[15]!==i||n[16]!==D||n[17]!==c||n[18]!==l?(O=()=>{if(i)return i.registerStepper(e=>{if(!c||l)return!1;let t=p(c,e);return t!==null&&D(t),!0}),()=>i.registerStepper(null)},k=[i,D,c,l],n[15]=i,n[16]=D,n[17]=c,n[18]=l,n[19]=O,n[20]=k):(O=n[19],k=n[20]),(0,R.useEffect)(O,k);let A=(0,R.useRef)(null),j=c?.kind??`none`,M=c?.stops.length??0,N;n[21]===r.speedTiers?N=n[22]:(N=r.speedTiers.join(`,`),n[21]=r.speedTiers,n[22]=N);let P;n[23]===r.contextWindow?.options?P=n[24]:(P=r.contextWindow?.options.map(pe).join(`,`)??``,n[23]=r.contextWindow?.options,n[24]=P);let ae=r.thinking?`thinking`:``,oe;n[25]!==j||n[26]!==M||n[27]!==N||n[28]!==P||n[29]!==ae?(oe=[j,M,N,P,ae],n[25]=j,n[26]=M,n[27]=N,n[28]=P,n[29]=ae,n[30]=oe):oe=n[30],fe(A,oe.join(`|`));let[F,se]=(0,R.useState)(0),[I,ce]=(0,R.useState)(0),B=i?.activeModelLabel??null,le=ne(c?.index??0),V;n[31]!==a||n[32]!==C||n[33]!==e||n[34]!==g||n[35]!==F||n[36]!==y||n[37]!==r.speedTiers.length?(V=r.speedTiers.length>1?(0,z.jsxs)(`button`,{type:`button`,"aria-label":`Speed`,"aria-pressed":y,"data-speed-tier":g,title:`${S[g]} speed · click for ${S[C]}`,disabled:a,className:t(`relative grid size-7 shrink-0 place-items-center rounded-md outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50`,m(g)??`text-muted-foreground hover:bg-accent hover:text-foreground`),onClick:()=>{C!==`standard`&&se(me),e.onSetSpeed(C)},children:[(0,z.jsx)(_,{tier:g,filled:y,className:t(`size-4`,F>0&&`model-dial-pop`)},`bolt-${F}`),F>0&&y?(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`model-dial-burst`},`burst-${F}`):null]}):null,n[31]=a,n[32]=C,n[33]=e,n[34]=g,n[35]=F,n[36]=y,n[37]=r.speedTiers.length,n[38]=V):V=n[38];let H;n[39]!==le||n[40]!==u||n[41]!==h?(H=u?(0,z.jsx)(re,{text:u.label,direction:le,className:`shrink-0 font-semibold text-(--reasoning-tone) text-sm leading-5 transition-colors`,...h===`ultracode`?{itemClassName:`reasoning-tone-shimmer`}:{}}):null,n[39]=le,n[40]=u,n[41]=h,n[42]=H):H=n[42];let U;n[43]!==i||n[44]!==B?(U=B?(0,z.jsxs)(`button`,{type:`button`,"aria-label":`Show ${B} in the list`,title:`Show in list`,className:`inline-flex min-w-0 items-center gap-0.5 rounded px-0.5 text-muted-foreground text-xs outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring`,onClick:()=>i?.revealActiveModel(),children:[(0,z.jsx)(`span`,{className:`truncate`,children:B}),(0,z.jsx)(s,{"aria-hidden":`true`,className:`size-3 shrink-0 opacity-70`})]}):null,n[43]=i,n[44]=B,n[45]=U):U=n[45];let W;n[46]!==H||n[47]!==U?(W=(0,z.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1.5 pl-0.5`,children:[H,U]}),n[46]=H,n[47]=U,n[48]=W):W=n[48];let G;n[49]!==a||n[50]!==e.onSelectContextWindow||n[51]!==r.contextWindow?(G=r.contextWindow?(0,z.jsx)(de,{label:`Context window`,value:typeof r.contextWindow.currentValue==`string`?r.contextWindow.currentValue:r.contextWindow.options.find(he)?.id??``,options:r.contextWindow.options,disabled:a,onChange:e.onSelectContextWindow}):null,n[49]=a,n[50]=e.onSelectContextWindow,n[51]=r.contextWindow,n[52]=G):G=n[52];let K;n[53]!==a||n[54]!==e||n[55]!==c?.kind||n[56]!==r.thinking?(K=r.thinking&&c?.kind===`effort`?(0,z.jsx)(`button`,{type:`button`,"aria-label":`Thinking`,"aria-pressed":r.thinking.currentValue===!0,title:r.thinking.currentValue===!0?`Thinking on`:`Thinking off`,disabled:a,className:t(`grid size-7 shrink-0 place-items-center rounded-md outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`,r.thinking.currentValue===!0?`bg-sky-500/15 text-sky-700 dark:text-sky-300`:`text-muted-foreground hover:bg-accent hover:text-foreground`),onClick:()=>e.onSetThinking(r.thinking?.currentValue!==!0),children:(0,z.jsx)(ie,{"aria-hidden":`true`,className:`size-4`})}):null,n[53]=a,n[54]=e,n[55]=c?.kind,n[56]=r.thinking,n[57]=K):K=n[57];let _e=a||r.isDefault,q;n[58]===e?q=n[59]:(q=()=>{ce(ge),e.onReset()},n[58]=e,n[59]=q);let ve=I>0&&`model-dial-spin`,J;n[60]===ve?J=n[61]:(J=t(`size-4`,ve),n[60]=ve,n[61]=J);let Y;n[62]!==I||n[63]!==J?(Y=(0,z.jsx)(d,{"aria-hidden":`true`,className:J},I),n[62]=I,n[63]=J,n[64]=Y):Y=n[64];let X;n[65]!==_e||n[66]!==q||n[67]!==Y?(X=(0,z.jsx)(`button`,{type:`button`,"aria-label":`Reset to model defaults`,title:`Reset to model defaults`,disabled:_e,className:`grid size-7 shrink-0 place-items-center rounded-md text-muted-foreground outline-none transition-colors hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-30`,onClick:q,children:Y}),n[65]=_e,n[66]=q,n[67]=Y,n[68]=X):X=n[68];let Z;n[69]!==V||n[70]!==W||n[71]!==G||n[72]!==K||n[73]!==X?(Z=(0,z.jsxs)(`div`,{className:`flex h-7 items-center gap-1`,children:[V,W,G,K,X]}),n[69]=V,n[70]=W,n[71]=G,n[72]=K,n[73]=X,n[74]=Z):Z=n[74];let Q;n[75]!==D||n[76]!==c||n[77]!==l||n[78]!==h?(Q=c&&c.stops.length>1?(0,z.jsx)(ue,{stops:c.stops,index:c.index,tone:h,kind:c.kind,disabled:l,onCommit:D}):null,n[75]=D,n[76]=c,n[77]=l,n[78]=h,n[79]=Q):Q=n[79];let $;n[80]===o?$=n[81]:($=o?(0,z.jsx)(`p`,{className:`mt-1 text-muted-foreground text-[11px]`,children:`Your prompt contains “ultrathink”. Remove it to change effort.`}):null,n[80]=o,n[81]=$);let ye;return n[82]!==Z||n[83]!==Q||n[84]!==$||n[85]!==h?(ye=(0,z.jsxs)(`div`,{ref:A,className:`model-dial overflow-clip px-3 pt-2 pb-2.5`,"data-reasoning-tone":h,"data-slot":`model-tuning-dial`,children:[Z,Q,$]}),n[82]=Z,n[83]=Q,n[84]=$,n[85]=h,n[86]=ye):ye=n[86],ye}),ue=(0,R.memo)(function(e){let t=(0,L.c)(48),n=(0,R.useRef)(null),r=(0,R.useRef)(null),i=(0,R.useRef)(!1),a=(0,R.useRef)(e.index),[o,s]=(0,R.useState)(!1),c=e.stops.length,l=c>1?e.index/(c-1):0,[u]=(0,R.useState)(l),d,f;t[0]!==l||t[1]!==e.index?(d=()=>{a.current=e.index,i.current||n.current?.style.setProperty(`--model-dial-t`,String(l))},f=[l,e.index],t[0]=l,t[1]=e.index,t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,R.useLayoutEffect)(d,f);let p;t[4]===l?p=t[5]:(p=e=>{let t=n.current;if(!t)return l;let r=t.getBoundingClientRect(),i=r.width-30;return i>0?Math.min(1,Math.max(0,(e-r.left-B)/i)):0},t[4]=l,t[5]=p);let m=p,h;t[6]!==c||t[7]!==e?(h=t=>{let n=Math.round(t*(c-1));n!==a.current&&(a.current=n,e.onCommit(n))},t[6]=c,t[7]=e,t[8]=h):h=t[8];let g=h,_;t[9]!==g||t[10]!==m||t[11]!==e.disabled?(_=t=>{if(e.disabled||t.button!==0)return;t.preventDefault();let n=t.currentTarget;n.focus({preventScroll:!0}),n.setPointerCapture(t.pointerId),i.current=!0,s(!0);let r=m(t.clientX);n.style.setProperty(`--model-dial-t`,String(r)),g(r)},t[9]=g,t[10]=m,t[11]=e.disabled,t[12]=_):_=t[12];let v=_,y;t[13]!==g||t[14]!==m?(y=e=>{if(!i.current)return;let t=m(e.clientX);e.currentTarget.style.setProperty(`--model-dial-t`,String(t)),g(t)},t[13]=g,t[14]=m,t[15]=y):y=t[15];let b=y,x;t[16]===c?x=t[17]:(x=()=>{if(!i.current)return;i.current=!1,s(!1);let e=c>1?a.current/(c-1):0;n.current?.style.setProperty(`--model-dial-t`,String(e))},t[16]=c,t[17]=x);let S=x,C;t[18]!==c||t[19]!==e?(C=t=>{if(e.disabled)return;let n=t.key===`ArrowLeft`||t.key===`ArrowDown`?-1:+(t.key===`ArrowRight`||t.key===`ArrowUp`),r=null;n===0?t.key===`Home`?r=0:t.key===`End`&&(r=c-1):r=Math.min(c-1,Math.max(0,e.index+n)),r!==null&&(t.preventDefault(),t.stopPropagation(),r!==e.index&&e.onCommit(r))},t[18]=c,t[19]=e,t[20]=C):C=t[20];let ee=C,te=e.stops[e.index]?.label??``,w=e.disabled?-1:0,T=e.kind===`effort`?`Reasoning effort`:`Thinking`,ne=c-1,re=e.index,E=e.disabled||void 0,ie=o||void 0,D;t[21]===u?D=t[22]:(D={"--model-dial-t":u},t[21]=u,t[22]=D);let O=D,k=e.tone===`ultracode`,A;t[23]===k?A=t[24]:(A=(0,z.jsx)(`div`,{ref:r,className:`model-dial-fill`,children:(0,z.jsx)(H,{active:k,fillRef:r})}),t[23]=k,t[24]=A);let j;if(t[25]!==c||t[26]!==e.index||t[27]!==e.stops){let n;t[29]!==c||t[30]!==e.index?(n=(t,n)=>(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`model-dial-notch`,"data-lit":n<=e.index||void 0,style:{"--model-dial-i":c>1?n/(c-1):0}},t.id),t[29]=c,t[30]=e.index,t[31]=n):n=t[31],j=e.stops.map(n),t[25]=c,t[26]=e.index,t[27]=e.stops,t[28]=j}else j=t[28];let M;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,z.jsx)(`span`,{"aria-hidden":`true`,className:`model-dial-thumb`}),t[32]=M):M=t[32];let N;return t[33]!==S||t[34]!==ee||t[35]!==v||t[36]!==b||t[37]!==te||t[38]!==e.index||t[39]!==ne||t[40]!==E||t[41]!==ie||t[42]!==O||t[43]!==A||t[44]!==j||t[45]!==w||t[46]!==T?(N=(0,z.jsxs)(`div`,{ref:n,role:`slider`,tabIndex:w,"aria-label":T,"aria-valuemin":0,"aria-valuemax":ne,"aria-valuenow":re,"aria-valuetext":te,"aria-disabled":E,"data-dragging":ie,title:`Drag, or use ← → to adjust`,className:`model-dial-track mt-2`,style:O,onPointerDown:v,onPointerMove:b,onPointerUp:S,onPointerCancel:S,onLostPointerCapture:S,onKeyDown:ee,children:[A,j,M]}),t[33]=S,t[34]=ee,t[35]=v,t[36]=b,t[37]=te,t[38]=e.index,t[39]=ne,t[40]=E,t[41]=ie,t[42]=O,t[43]=A,t[44]=j,t[45]=w,t[46]=T,t[47]=N):N=t[47],N});function H(e){let t=(0,L.c)(7),n=(0,R.useRef)(null),r;t[0]!==e.active||t[1]!==e.fillRef.current?(r=()=>{let t=n.current,r=e.fillRef.current,i=r?.parentElement,a=t?.getContext(`2d`);if(!e.active||!t||!r||!i||!a||T())return;let o=Math.min(2,window.devicePixelRatio||1),s=[],c=0,l=performance.now(),u=e=>{let n=Math.min(50,e-l)/16.67;l=e;let d=i.clientWidth,f=i.clientHeight;t.width!==Math.round(d*o)&&(t.width=Math.round(d*o),t.height=Math.round(f*o),t.style.width=`${d}px`),a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,d,f);let p=r.clientWidth;s.length<Math.min(34,p/7)&&Math.random()<.6&&s.push({x:5+Math.random()*Math.max(8,p-34),y:f*(.2+Math.random()*.6),vx:.2+Math.random()*.55,vy:(Math.random()-.5)*.1,life:0,max:45+Math.random()*70,r:.55+Math.random()*.95}),a.fillStyle=`#ffffff`;for(let e=s.length-1;e>=0;--e){let t=s[e];if(t.life+=n,t.x+=t.vx*n,t.y+=t.vy*n,t.life>t.max||t.x>p-16){s.splice(e,1);continue}let r=Math.sin(Math.PI*t.life/t.max);a.globalAlpha=r*.95,a.beginPath(),a.arc(t.x,t.y,t.r,0,Math.PI*2),a.fill(),t.r>1.25&&(a.globalAlpha=r*.45,a.fillRect(t.x-t.r*2.6,t.y-.35,t.r*5.2,.7),a.fillRect(t.x-.35,t.y-t.r*2.6,.7,t.r*5.2))}a.globalAlpha=1,c=window.requestAnimationFrame(u)};return c=window.requestAnimationFrame(u),()=>{window.cancelAnimationFrame(c),a.clearRect(0,0,t.width,t.height)}},t[0]=e.active,t[1]=e.fillRef.current,t[2]=r):r=t[2];let i;t[3]!==e.active||t[4]!==e.fillRef?(i=[e.active,e.fillRef],t[3]=e.active,t[4]=e.fillRef,t[5]=i):i=t[5],(0,R.useEffect)(r,i);let a;return t[6]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,z.jsx)(`canvas`,{ref:n,"aria-hidden":`true`,className:`model-dial-sparks`}),t[6]=a):a=t[6],a}function de(e){let n=(0,L.c)(8),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=new Map,n[0]=r):r=n[0];let i=(0,R.useRef)(r),a=(0,R.useRef)(null),o=(0,R.useRef)(!1),{options:s,value:c}=e,l,u;n[1]!==s||n[2]!==c?(l=()=>{let e=s.some(e=>e.id===c)?i.current.get(c):void 0,t=a.current;if(!e||!t)return;let n=!o.current;n&&(t.style.transition=`none`),t.style.width=`${e.offsetWidth}px`,t.style.transform=`translateX(${e.offsetLeft}px)`,n&&(t.style.transition=``,o.current=!0)},u=[s,c],n[1]=s,n[2]=c,n[3]=l,n[4]=u):(l=n[3],u=n[4]),(0,R.useLayoutEffect)(l,u);let d;if(n[5]!==e){let r=t=>{let n=e.options[t];n&&!e.disabled&&(n.id!==e.value&&e.onChange(n.id),i.current.get(n.id)?.focus())},o;n[7]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,z.jsx)(`span`,{ref:a,"aria-hidden":`true`,className:`absolute inset-y-0.5 left-0 rounded-[5px] bg-background shadow-xs ring-1 ring-border transition-[transform,width] duration-(--app-motion-duration-stack) ease-(--app-motion-spring-snappy) dark:bg-white/12`}),n[7]=o):o=n[7],d=(0,z.jsxs)(`div`,{role:`radiogroup`,"aria-label":e.label,className:`relative inline-flex rounded-md bg-foreground/6 p-0.5`,onKeyDown:t=>{let n=e.options.findIndex(t=>t.id===e.value);(t.key===`ArrowLeft`||t.key===`ArrowRight`)&&(t.preventDefault(),t.stopPropagation(),r(n+(t.key===`ArrowLeft`?-1:1)))},children:[o,e.options.map(n=>{let a=n.id===e.value;return(0,z.jsx)(`button`,{ref:e=>{e?i.current.set(n.id,e):i.current.delete(n.id)},type:`button`,role:`radio`,"aria-checked":a,tabIndex:a?0:-1,disabled:e.disabled,className:t(`relative z-10 h-5 rounded-[5px] px-2 font-medium text-[11px] tabular-nums outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50`,a?`text-foreground`:`text-muted-foreground hover:text-foreground`),onClick:()=>r(e.options.indexOf(n)),children:n.label},n.id)})]}),n[5]=e,n[6]=d}else d=n[6];return d}function fe(e,t){let n=(0,L.c)(3),r=(0,R.useRef)(null),i=(0,R.useRef)(t),a;n[0]!==t||n[1]!==e?(a=()=>{let n=e.current;if(!n)return;let a=n.getBoundingClientRect().height,o=r.current,s=i.current!==t;r.current=a,i.current=t,!(!s||o===null||Math.abs(o-a)<1)&&(T()||n.animate([{height:`${o}px`},{height:`${a}px`}],{duration:300,easing:`cubic-bezier(0.22, 1, 0.36, 1)`}))},n[0]=t,n[1]=e,n[2]=a):a=n[2],(0,R.useLayoutEffect)(a)}var U=(0,R.memo)(function(e){let t=(0,L.c)(51),r=e.disabled??!1,a=C(e),o,s;t[0]!==e.model||t[1]!==e.modelOptions||t[2]!==e.models||t[3]!==e.prompt||t[4]!==e.provider?(o=n(e.models,e.model,e.provider),s=h({caps:o,selections:e.modelOptions,prompt:e.prompt}),t[0]=e.model,t[1]=e.modelOptions,t[2]=e.models,t[3]=e.prompt,t[4]=e.provider,t[5]=o,t[6]=s):(o=t[5],s=t[6]);let c=s;if(!c)return null;let l;t[7]===a?l=t[8]:(l=e=>{a(i(e))},t[7]=a,t[8]=l);let u=l,d;t[9]!==r||t[10]!==u||t[11]!==c.descriptors?(d=(e,t)=>{e&&!r&&u(x(c.descriptors,e,t))},t[9]=r,t[10]=u,t[11]=c.descriptors,t[12]=d):d=t[12];let f=d,p;t[13]!==r||t[14]!==u||t[15]!==e.onPromptChange||t[16]!==e.prompt||t[17]!==c.descriptors||t[18]!==c.effort||t[19]!==c.primarySelectDescriptorId||t[20]!==c.ultrathinkInBodyText||t[21]!==c.ultrathinkPromptControlled?(p=t=>{c.effort&&!r&&y({descriptors:c.descriptors,descriptor:c.effort,value:t,prompt:e.prompt,primarySelectDescriptorId:c.primarySelectDescriptorId,ultrathinkInBodyText:c.ultrathinkInBodyText,ultrathinkPromptControlled:c.ultrathinkPromptControlled,onChangeDescriptors:u,onPromptChange:e.onPromptChange})},t[13]=r,t[14]=u,t[15]=e.onPromptChange,t[16]=e.prompt,t[17]=c.descriptors,t[18]=c.effort,t[19]=c.primarySelectDescriptorId,t[20]=c.ultrathinkInBodyText,t[21]=c.ultrathinkPromptControlled,t[22]=p):p=t[22];let m;t[23]!==f||t[24]!==c.thinking?.id?(m=e=>f(c.thinking?.id,e),t[23]=f,t[24]=c.thinking?.id,t[25]=m):m=t[25];let _;t[26]!==r||t[27]!==u||t[28]!==c.descriptors?(_=e=>{r||u(w(c.descriptors,e))},t[26]=r,t[27]=u,t[28]=c.descriptors,t[29]=_):_=t[29];let v;t[30]!==r||t[31]!==u||t[32]!==c.contextWindow||t[33]!==c.descriptors?(v=e=>{c.contextWindow&&!r&&u(x(c.descriptors,c.contextWindow.id,e))},t[30]=r,t[31]=u,t[32]=c.contextWindow,t[33]=c.descriptors,t[34]=v):v=t[34];let b;t[35]!==o||t[36]!==r||t[37]!==u||t[38]!==e||t[39]!==c.descriptors||t[40]!==c.ultrathinkInBodyText||t[41]!==c.ultrathinkPromptControlled?(b=()=>{r||(c.ultrathinkPromptControlled&&!c.ultrathinkInBodyText&&e.onPromptChange(e.prompt.replace(le,``)),u(g({caps:o,descriptors:c.descriptors})))},t[35]=o,t[36]=r,t[37]=u,t[38]=e,t[39]=c.descriptors,t[40]=c.ultrathinkInBodyText,t[41]=c.ultrathinkPromptControlled,t[42]=b):b=t[42];let S;return t[43]!==r||t[44]!==p||t[45]!==m||t[46]!==_||t[47]!==v||t[48]!==b||t[49]!==c?(S=(0,z.jsx)(V,{tuning:c,disabled:r,onSelectEffort:p,onSetThinking:m,onSetSpeed:_,onSelectContextWindow:v,onReset:b}),t[43]=r,t[44]=p,t[45]=m,t[46]=_,t[47]=v,t[48]=b,t[49]=c,t[50]=S):S=t[50],S});function pe(e){return e.id}function me(e){return e+1}function he(e){return e.isDefault}function ge(e){return e+1}export{ce as a,M as c,I as i,ie as l,F as n,ae as o,se as r,oe as s,U as t};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{an as t}from"./primary-Cf-xJExj.js";import{$i as n,Ss as r,Zi as i,Zr as a,ad as o,g as s,gr as c,wr as l,ws as u}from"./runtime-DjjjAcTE.js";import{t as d}from"./react-CwJFpaho.js";import{At as f,k as p}from"./sliding-tabs-BnDSjRU3.js";import{A as m,D as h,M as g,N as _,P as v,Q as y,j as b,k as x}from"./popover-OWEv6cQz.js";import{i as S}from"./presentationTier-DPVAxTK4.js";import{Ft as ee,Rt as te,Sn as C,an as ne,in as re,ln as ie,nn as w,rn as ae,zt as oe}from"./formatCount-B4KLI651.js";import{_ as se}from"./InboxStatusGlyph-BPTqzp7l.js";import{m as T}from"./workspaceLifecycle-OJ1aKksw.js";import{i as E}from"./capabilities-CfOhq009.js";import{a as D,i as O,l as k,n as A,r as j,s as ce,t as le,u as ue}from"./combobox-Dtjtf7AB.js";import{t as de}from"./shallow-B--PNURq.js";import{t as M}from"./input-CCie4mm1.js";import{Y as fe,nt as pe}from"./main-Ch0bwS-M.js";var me={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};me.node;var he=u(me),N=S(),P=e(d(),1),F=o(),I=100;function ge(e){return`${e.provider}:${e.number}`}function _e(e){return e?e.kind===`workItem`?`${e.item.provider}:${e.item.key}`:ge(e.item):null}function L(e){let t=e?.trim();return t&&t.length>0?t:`branch`}function ve(e){let t=[`Create a branch name for issue #${e.number}.`],n=e.title?.trim(),r=e.body?.trim();return n&&t.push(``,`Title: ${n}`),r&&t.push(``,`Body: ${r}`),t.join(`
|
|
2
|
+
`)}function ye(e){return[`Create a branch name for Jira work item ${e.key}.`,``,`Title: ${e.title?.trim()||e.key}`,``,`The branch name should include the Jira key ${e.key}.`].join(`
|
|
3
|
+
`)}function be(e){return[`Create a short git branch name for a new coding-agent worktree.`,`Base branch: ${L(e.baseBranch)}`].join(`
|
|
4
|
+
`)}function xe(e){let[t,n]=(0,P.useState)([]),[r,i]=(0,P.useState)(!1),[o,s]=(0,P.useState)(null),c=(0,P.useRef)(0),l=(0,P.useCallback)(async()=>{if(!e.open||e.enabled===!1)return;let t=c.current+1;c.current=t;let r=e.environmentId?a(e.environmentId):null;if(!r||!e.cwd){n([]),s(`Project is unavailable.`),i(!1);return}i(!0),s(null);try{let i=e.query.trim(),a=await r.vcs.listRefs({cwd:e.cwd,limit:I,...i?{query:i}:{}});c.current===t&&n([...a.refs])}catch(e){c.current===t&&(n([]),s(e instanceof Error?e.message:`Failed to load branches.`))}finally{c.current===t&&i(!1)}},[e.cwd,e.enabled,e.environmentId,e.open,e.query]);return(0,P.useEffect)(()=>{l()},[l]),{refs:t,isLoading:r,error:o,refresh:l}}function Se(e){let[n,r]=(0,P.useState)(e.initialTab??`branches`),[o,u]=(0,P.useState)(``),[d,f]=(0,P.useState)(``),[p,y]=(0,P.useState)(`manual`),[S,C]=(0,P.useState)(`main`),[w,T]=(0,P.useState)(`ai`),[E,D]=(0,P.useState)(``),[O,k]=(0,P.useState)(`ai`),[A,j]=(0,P.useState)(``),[ce,le]=(0,P.useState)(``),[ue,M]=(0,P.useState)(``),[me,he]=(0,P.useState)(``),[N,I]=(0,P.useState)(`open`),[Se,Ee]=(0,P.useState)(`open`),[De,Oe]=(0,P.useState)(`open`),[R,z]=(0,P.useState)(null),[B,V]=(0,P.useState)(null),[H,U]=(0,P.useState)(null),[W,G]=(0,P.useState)(null),[ke,Ae]=(0,P.useState)(null),[K,q]=(0,P.useState)(null),[J,je]=(0,P.useState)(!1),[Me,Y]=(0,P.useState)(null),Ne=(0,P.useRef)(null),Pe=(0,P.useRef)(null),Fe=(0,P.useRef)(null),Ie=(0,P.useRef)(null),Le=(0,P.useRef)(null),X=`${e.projectId??``}\0${e.environmentId??``}\0${e.cwd??``}`,Re=(0,P.useRef)(X),ze=(0,P.useRef)(0),Be=(0,P.useRef)({activeTab:n,baseBranch:S,cwd:e.cwd,environmentId:e.environmentId,selectionBody:void 0,selectionIssueKey:void 0,selectionKey:null,selectionKind:null,selectionTitle:void 0,targetKey:X});Be.current={activeTab:n,baseBranch:S,cwd:e.cwd,environmentId:e.environmentId,selectionBody:R?.kind===`issue`?R.item.body:void 0,selectionIssueKey:R?.kind===`workItem`?R.item.key:void 0,selectionKey:_e(R),selectionKind:R?.kind??null,selectionTitle:R?.item.title,targetKey:X};let Z=xe({open:e.open,enabled:n===`branches`,environmentId:e.environmentId,cwd:e.cwd,query:o});(0,P.useEffect)(()=>{if(e.open){let t=Re.current!==X;Re.current=X,r(e.initialTab??`branches`),z(null),Y(null),G(null),q(null),Ae(null),t&&(V(null),C(`main`),f(``),y(`manual`),D(``),T(`ai`),j(``),k(`ai`),u(``),le(``),M(``),he(``))}},[X,e.initialTab,e.open]),(0,P.useEffect)(()=>{if(e.open&&n===`branches`){if(Z.error){V(null);return}V(e=>e&&Z.refs.some(t=>t.name===e)?e:Z.refs[0]?.name??null)}},[n,Z.error,Z.refs,e.open]),(0,P.useEffect)(()=>{if(!e.open||!e.projectId||!e.environmentId){G(null);return}if(R?.kind!==`pr`&&R?.kind!==`issue`&&R?.kind!==`workItem`){G(null);return}let t=a(e.environmentId)?.git.findWorktreeForOrigin;if(!t){G(null);return}let n=!1;return t(R.kind===`workItem`?{projectId:e.projectId,kind:`workItem`,provider:R.item.provider,key:R.item.key}:{projectId:e.projectId,kind:R.kind,number:R.item.number}).then(e=>{n||G(e)}).catch(()=>{n||G(null)}),()=>{n=!0}},[e.environmentId,e.open,e.projectId,R]),(0,P.useEffect)(()=>{if(!e.open){z(null);return}let t=window.requestAnimationFrame(()=>{n===`branches`&&Ne.current?.focus(),n===`issues`&&Pe.current?.focus(),n===`jira`&&Fe.current?.focus(),n===`prs`&&Ie.current?.focus(),n===`newBranch`&&Le.current?.focus()});return()=>window.cancelAnimationFrame(t)},[n,e.open]);let Ve=(0,P.useMemo)(()=>[{id:`branches`,label:`From branch`},{id:`newBranch`,label:`New branch`},{id:`prs`,label:`Pull requests`},{id:`issues`,label:`Issues`},{id:`jira`,label:`Jira`}],[]),He=(0,P.useCallback)(e=>{C(t=>t.trim()===`main`?e:t)},[]),Ue=(0,P.useCallback)(e=>{if(fe(e.target))return;let t=Object.entries({1:`branches`,2:`newBranch`,3:`prs`,4:`issues`,5:`jira`}).find(([t])=>pe(e,t))?.[1];t&&(e.preventDefault(),r(t),z(null))},[]),We=(0,P.useCallback)(async t=>{if(!e.environmentId||!e.cwd){q(`Branch name generation is unavailable.`);return}let n=t===`workItem`?R?.kind===`workItem`?ye({key:R.item.key,title:R.item.title}):null:t===`issue`?R?.kind===`issue`?ve({number:R.item.number,title:R.item.title,body:R.item.body}):null:be({baseBranch:S});if(!n){q(`Select an item before generating a branch name.`);return}let r=ze.current+1;ze.current=r;let i=Be.current,a=()=>{let e=Be.current;return ze.current===r&&e.cwd===i.cwd&&e.environmentId===i.environmentId&&e.targetKey===i.targetKey&&(t===`issue`?e.activeTab===`issues`&&e.selectionKind===`issue`&&e.selectionKey===i.selectionKey&&e.selectionTitle===i.selectionTitle&&e.selectionBody===i.selectionBody:t===`workItem`?e.activeTab===`jira`&&e.selectionKind===`workItem`&&e.selectionIssueKey===i.selectionIssueKey&&e.selectionTitle===i.selectionTitle:e.activeTab===`newBranch`&&e.baseBranch===i.baseBranch)};Ae(t),q(null);try{let r=(await s(e.environmentId).client.textGeneration.generateBranchName({cwd:e.cwd,message:n})).branch.trim();if(!r)throw Error(`AI returned an empty branch name.`);if(!a())return;t===`issue`?(T(`custom`),D(r)):t===`workItem`?(k(`custom`),j(r)):(y(`ai`),f(r))}catch(e){if(!a())return;q(e instanceof Error?e.message:`Failed to generate branch name.`)}finally{ze.current===r&&Ae(null)}},[S,e.cwd,e.environmentId,R]),Ge=R?.kind===`pr`?ge(R.item):null,Ke=R?.kind===`issue`?ge(R.item):null,Q=R?.kind===`workItem`?R.item:null,qe=l(de(n=>e.environmentId&&e.projectId?c(n,t(e.environmentId,e.projectId)):[])),Je=xe({open:e.open,enabled:n===`jira`&&Q!==null,environmentId:e.environmentId,cwd:e.cwd,query:Q?.key??``}),Ye=(0,P.useMemo)(()=>Q?re({key:Q.key,refs:Je.refs}):[],[Q,Je.refs]),Xe=(0,P.useMemo)(()=>Q?ne({key:Q.key,worktrees:qe}):[],[qe,Q]),$=(0,P.useMemo)(()=>ae({branches:Ye,worktrees:Xe}),[Ye,Xe]);(0,P.useEffect)(()=>{if(!e.open||n!==`jira`||!Q){U(null);return}U(e=>e&&$.some(t=>t.branchName===e)?e:$[0]?.branchName??null)},[n,e.open,Q,$]);let Ze=(0,P.useMemo)(()=>{if(!e.projectId||!e.environmentId||J)return!1;let t=S.trim();return n===`branches`?B!==null&&B.length>0:n===`prs`?R?.kind===`pr`:n===`issues`?R?.kind===`issue`?W?!0:t.length>0&&(w===`ai`||E.trim().length>0):!1:n===`jira`?R?.kind===`workItem`?W?!0:$.length>0?H!==null&&H.length>0:t.length>0&&(O===`ai`||A.trim().length>0):!1:t.length>0&&d.trim().length>0},[n,S,J,W,w,E,d,e.environmentId,e.projectId,B,H,R,O,$.length,A]),Qe=(0,P.useMemo)(()=>{if(J)return`Creating...`;if(W)return`Open existing worktree`;if(n===`branches`&&B)return`Create worktree from ${B}`;if(n===`newBranch`){let e=d.trim();return e?`Create worktree from ${L(S)} as ${e}`:`Create worktree from ${L(S)}`}return n===`issues`?w===`custom`&&E.trim()?`Create worktree from ${L(S)} as ${E.trim()}`:`Create worktree from ${L(S)}`:n===`jira`?H?`Create worktree from ${H}`:O===`custom`&&A.trim()?`Create worktree from ${L(S)} as ${A.trim()}`:`Create worktree from ${L(S)}`:n===`prs`&&R?.kind===`pr`?`Create worktree for PR #${R.item.number}`:`Create worktree`},[n,S,J,W,w,E,d,B,H,R,O,A]),$e=(0,P.useCallback)(async()=>{if(!e.projectId||!e.environmentId){Y(`Project is unavailable.`);return}let t=a(e.environmentId)?.git.createWorktreeForProject;if(!t){Y(`Worktree creation is unavailable in this environment.`);return}let r=B??``,i=d.trim(),o=E.trim(),s=A.trim(),c=S.trim(),l=n===`branches`?r?{kind:`branch`,branchName:r}:null:n===`prs`&&R?.kind===`pr`?{kind:`pr`,number:R.item.number}:n===`issues`&&R?.kind===`issue`?{kind:`issue`,number:R.item.number,...c.length>0?{baseBranch:c}:{},...w===`custom`&&o.length>0?{branchName:o}:{},title:R.item.title,...R.item.body===void 0?{}:{body:R.item.body}}:n===`newBranch`&&i.length>0?{kind:`newBranch`,branchName:i,...c.length>0?{baseBranch:c}:{}}:n===`jira`&&R?.kind===`workItem`?{kind:`workItem`,provider:R.item.provider,key:R.item.key,title:R.item.title,state:R.item.state,...R.item.stateName?{stateName:R.item.stateName}:{},url:R.item.url,...H?{branchSource:`existing`,branchName:H}:{...c.length>0?{baseBranch:c}:{},...O===`custom`&&s.length>0?{branchSource:`new`,branchName:s}:{}}}:null;if(!l){Y(`Select a worktree target first.`);return}je(!0),Y(null);try{let n=await t({projectId:e.projectId,intent:l});se(n.submoduleInitialization),e.onCreated?.(n),e.onOpenChange(!1)}catch(e){Y(e instanceof Error?e.message:`Failed to create worktree.`)}finally{je(!1)}},[n,S,w,E,d,e,B,H,R,O,A]);return(0,F.jsx)(h,{open:e.open,onOpenChange:e.onOpenChange,children:(0,F.jsxs)(_,{className:`flex h-[90vh] max-h-[980px] w-full max-w-7xl flex-col p-0 sm:max-w-7xl`,onKeyDown:Ue,children:[(0,F.jsxs)(b,{className:`border-border/60 border-b px-5 py-3`,children:[(0,F.jsx)(v,{className:`text-base`,children:`New worktree`}),(0,F.jsx)(x,{className:`text-xs`,children:e.cwd??`Select a project worktree target.`})]}),(0,F.jsx)(ie,{tabs:Ve,activeId:n,onSelect:e=>{r(e),z(null),Y(null),q(null)}}),(0,F.jsx)(g,{className:`min-h-0 flex-1 p-0`,scrollFade:!1,children:(0,F.jsxs)(`div`,{className:`grid h-full min-h-0 grid-cols-1 md:grid-cols-[minmax(0,1fr)_22rem]`,children:[(0,F.jsx)(`div`,{className:`min-h-[24rem] min-w-0 md:min-h-0`,children:n===`branches`?(0,F.jsx)(Ce,{branches:Z.refs,error:Z.error,isLoading:Z.isLoading,query:o,selectedBranchName:B,searchInputRef:Ne,onQueryChange:u,onRefresh:Z.refresh,onSelectBranch:V}):n===`prs`?(0,F.jsx)(te,{environmentId:e.environmentId,cwd:e.cwd,searchInputRef:Ie,query:me,onQueryChange:he,selectedKey:Ge,stateFilter:De,onStateFilterChange:Oe,onSelect:e=>z({kind:`pr`,item:e})}):n===`issues`?(0,F.jsx)(oe,{environmentId:e.environmentId,cwd:e.cwd,searchInputRef:Pe,query:ce,onQueryChange:le,selectedKey:Ke,stateFilter:N,onStateFilterChange:I,onSelect:e=>z({kind:`issue`,item:e})}):n===`jira`?(0,F.jsx)(ee,{environmentId:e.environmentId,cwd:e.cwd,projectId:e.projectId??null,searchInputRef:Fe,query:ue,onQueryChange:M,stateFilter:Se,onStateFilterChange:Ee,onSelect:e=>z({kind:`workItem`,item:e})}):(0,F.jsx)(we,{baseBranch:S,branchName:d,branchNameInputRef:Le,branchNameMode:p,cwd:e.cwd,dialogOpen:e.open,environmentId:e.environmentId,generationError:K,isGenerating:ke===`newBranch`,onBaseBranchChange:C,onBranchNameChange:e=>{f(e),y(`manual`)},onBranchNameModeChange:y,onDefaultBranchDiscovered:He,onGenerateBranchName:()=>void We(`newBranch`)})}),(0,F.jsx)(Te,{activeTab:n,baseBranch:S,branchNameGenerationError:K,cwd:e.cwd,dialogOpen:e.open,environmentId:e.environmentId,existingWorktreeId:W,generationTarget:ke,issueBranchMode:w,issueBranchName:E,linkedWorkItemBranches:Ye,linkedWorkItemBranchesError:Je.error,linkedWorkItemBranchesLoading:Je.isLoading,linkedWorkItemWorktrees:Xe,newBranchName:d,selection:R,selectedBranchName:B,selectedWorkItemBranchName:H,workItemBranchChoices:$,workItemBranchMode:O,workItemBranchName:A,onBaseBranchChange:C,onDefaultBranchDiscovered:He,onGenerateIssueBranchName:()=>void We(`issue`),onGenerateWorkItemBranchName:()=>void We(`workItem`),onIssueBranchModeChange:T,onIssueBranchNameChange:D,onSelectWorkItemBranchName:U,onWorkItemBranchModeChange:k,onWorkItemBranchNameChange:j})]})}),(0,F.jsxs)(m,{className:`border-border/60 border-t px-5 py-3`,children:[Me?(0,F.jsx)(`span`,{className:`mr-auto min-w-0 truncate text-xs text-destructive`,children:Me}):K?(0,F.jsx)(`span`,{className:`mr-auto min-w-0 truncate text-xs text-destructive`,children:K}):null,(0,F.jsx)(i,{variant:`outline`,onClick:()=>e.onOpenChange(!1),children:`Cancel`}),(0,F.jsx)(i,{className:`max-w-[min(34rem,64vw)]`,disabled:!Ze,onClick:()=>void $e(),children:(0,F.jsx)(`span`,{className:`truncate`,children:Qe})})]})]})})}function Ce(e){return(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2 border-border/60 border-b px-4 py-2.5`,children:[(0,F.jsxs)(`div`,{className:`relative flex-1`,children:[(0,F.jsx)(y,{className:`-translate-y-1/2 absolute top-1/2 left-2 size-3.5 text-muted-foreground`}),(0,F.jsx)(M,{ref:e.searchInputRef,value:e.query,onChange:t=>e.onQueryChange(t.target.value),placeholder:`Search branches...`,className:`h-8 pl-7 text-sm`})]}),(0,F.jsx)(i,{type:`button`,size:`icon`,variant:`ghost`,disabled:e.isLoading,onClick:e.onRefresh,"aria-label":`Refresh branches`,children:(0,F.jsx)(f,{className:e.isLoading?`size-3.5 animate-spin`:`size-3.5`})})]}),(0,F.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:e.error?(0,F.jsx)(`p`,{className:`px-4 py-6 text-destructive text-sm`,children:e.error}):e.isLoading&&e.branches.length===0?(0,F.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:`Loading branches...`}):e.branches.length===0?(0,F.jsx)(`p`,{className:`px-4 py-6 text-sm text-muted-foreground`,children:e.query.trim().length>0?`No branches match this search.`:`No branches to show.`}):(0,F.jsx)(`div`,{role:`listbox`,className:`divide-y divide-border/60`,children:e.branches.map(t=>{let r=e.selectedBranchName===t.name;return(0,F.jsxs)(`button`,{type:`button`,role:`option`,"aria-selected":r,className:n(`flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-muted/60 focus-visible:bg-accent/60 focus-visible:outline-none`,r&&`bg-muted/80`),onClick:()=>e.onSelectBranch(t.name),children:[(0,F.jsx)(y,{className:`size-4 shrink-0 text-muted-foreground`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate text-sm text-foreground`,children:t.name}),(0,F.jsx)(`span`,{className:`block truncate text-xs text-muted-foreground`,children:t.current?`Current branch`:t.worktreePath?t.worktreePath:t.isRemote?t.remoteName??`Remote branch`:`Local branch`})]}),r?(0,F.jsx)(`span`,{className:`rounded border border-primary/30 bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary uppercase`,children:`selected`}):t.isDefault?(0,F.jsx)(`span`,{className:`rounded border border-border px-1.5 py-0.5 text-[10px] text-muted-foreground uppercase`,children:`default`}):null]},t.name)})})})]})}function we(e){return(0,F.jsxs)(`div`,{className:`grid gap-5 p-5`,children:[(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`From branch`}),(0,F.jsx)(U,{cwd:e.cwd,dialogOpen:e.dialogOpen,environmentId:e.environmentId,value:e.baseBranch,onChange:e.onBaseBranchChange,onDefaultBranchDiscovered:e.onDefaultBranchDiscovered})]}),(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Create branch`}),(0,F.jsx)(H,{value:e.branchNameMode,left:{value:`manual`,label:`Manual`},right:{value:`ai`,label:`AI name`},onChange:e.onBranchNameModeChange})]}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M,{ref:e.branchNameInputRef,value:e.branchName,onChange:t=>e.onBranchNameChange(t.target.value),placeholder:`task/short-name`,className:`font-mono text-xs`}),(0,F.jsx)(i,{type:`button`,size:`icon`,variant:`ghost`,disabled:e.isGenerating,onClick:e.onGenerateBranchName,"aria-label":`Generate branch name`,children:e.branchNameMode===`ai`?(0,F.jsx)(E,{className:e.isGenerating?`size-3.5 animate-status-pulse`:`size-3.5`}):(0,F.jsx)(E,{className:`size-3.5`})})]}),e.generationError?(0,F.jsx)(`span`,{className:`text-destructive text-xs`,children:e.generationError}):(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`AI names are editable before the worktree is created.`})]})]})}function Te(e){let t=(0,N.c)(37),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(`span`,{className:`font-medium text-muted-foreground text-xs uppercase`,children:`Worktree target`}),t[0]=n):n=t[0];let r=e.activeTab===`branches`?`Existing branch`:e.activeTab===`newBranch`?`New branch`:e.activeTab===`prs`?`Pull request`:e.activeTab===`issues`?`Issue`:`Jira work item`,i;t[1]===r?i=t[2]:(i=(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[n,(0,F.jsx)(`span`,{className:`text-sm text-foreground`,children:r})]}),t[1]=r,t[2]=i);let a;t[3]!==e.activeTab||t[4]!==e.baseBranch||t[5]!==e.branchNameGenerationError||t[6]!==e.cwd||t[7]!==e.dialogOpen||t[8]!==e.environmentId||t[9]!==e.existingWorktreeId||t[10]!==e.generationTarget||t[11]!==e.issueBranchMode||t[12]!==e.issueBranchName||t[13]!==e.linkedWorkItemBranches||t[14]!==e.linkedWorkItemBranchesError||t[15]!==e.linkedWorkItemBranchesLoading||t[16]!==e.linkedWorkItemWorktrees||t[17]!==e.newBranchName||t[18]!==e.onBaseBranchChange||t[19]!==e.onDefaultBranchDiscovered||t[20]!==e.onGenerateIssueBranchName||t[21]!==e.onGenerateWorkItemBranchName||t[22]!==e.onIssueBranchModeChange||t[23]!==e.onIssueBranchNameChange||t[24]!==e.onSelectWorkItemBranchName||t[25]!==e.onWorkItemBranchModeChange||t[26]!==e.onWorkItemBranchNameChange||t[27]!==e.selectedBranchName||t[28]!==e.selectedWorkItemBranchName||t[29]!==e.selection||t[30]!==e.workItemBranchChoices||t[31]!==e.workItemBranchMode||t[32]!==e.workItemBranchName?(a=e.activeTab===`branches`?(0,F.jsx)(Ee,{branchName:e.selectedBranchName}):e.activeTab===`newBranch`?(0,F.jsx)(De,{baseBranch:e.baseBranch,branchName:e.newBranchName}):e.activeTab===`prs`?(0,F.jsx)(Oe,{existingWorktreeId:e.existingWorktreeId,selection:e.selection?.kind===`pr`?e.selection.item:null}):e.activeTab===`issues`?(0,F.jsx)(R,{baseBranch:e.baseBranch,branchName:e.issueBranchName,branchMode:e.issueBranchMode,cwd:e.cwd,dialogOpen:e.dialogOpen,environmentId:e.environmentId,existingWorktreeId:e.existingWorktreeId,generationError:e.branchNameGenerationError,isGenerating:e.generationTarget===`issue`,selection:e.selection?.kind===`issue`?e.selection.item:null,onBaseBranchChange:e.onBaseBranchChange,onBranchModeChange:e.onIssueBranchModeChange,onBranchNameChange:e.onIssueBranchNameChange,onDefaultBranchDiscovered:e.onDefaultBranchDiscovered,onGenerateBranchName:e.onGenerateIssueBranchName}):(0,F.jsx)(z,{baseBranch:e.baseBranch,branchName:e.workItemBranchName,branchMode:e.workItemBranchMode,cwd:e.cwd,dialogOpen:e.dialogOpen,environmentId:e.environmentId,existingWorktreeId:e.existingWorktreeId,generationError:e.branchNameGenerationError,isGenerating:e.generationTarget===`workItem`,linkedBranches:e.linkedWorkItemBranches,linkedBranchesError:e.linkedWorkItemBranchesError,linkedBranchesLoading:e.linkedWorkItemBranchesLoading,linkedWorktrees:e.linkedWorkItemWorktrees,selection:e.selection?.kind===`workItem`?e.selection.item:null,selectedExistingBranchName:e.selectedWorkItemBranchName,workItemBranchChoices:e.workItemBranchChoices,onBaseBranchChange:e.onBaseBranchChange,onBranchModeChange:e.onWorkItemBranchModeChange,onBranchNameChange:e.onWorkItemBranchNameChange,onDefaultBranchDiscovered:e.onDefaultBranchDiscovered,onGenerateBranchName:e.onGenerateWorkItemBranchName,onSelectExistingBranchName:e.onSelectWorkItemBranchName}),t[3]=e.activeTab,t[4]=e.baseBranch,t[5]=e.branchNameGenerationError,t[6]=e.cwd,t[7]=e.dialogOpen,t[8]=e.environmentId,t[9]=e.existingWorktreeId,t[10]=e.generationTarget,t[11]=e.issueBranchMode,t[12]=e.issueBranchName,t[13]=e.linkedWorkItemBranches,t[14]=e.linkedWorkItemBranchesError,t[15]=e.linkedWorkItemBranchesLoading,t[16]=e.linkedWorkItemWorktrees,t[17]=e.newBranchName,t[18]=e.onBaseBranchChange,t[19]=e.onDefaultBranchDiscovered,t[20]=e.onGenerateIssueBranchName,t[21]=e.onGenerateWorkItemBranchName,t[22]=e.onIssueBranchModeChange,t[23]=e.onIssueBranchNameChange,t[24]=e.onSelectWorkItemBranchName,t[25]=e.onWorkItemBranchModeChange,t[26]=e.onWorkItemBranchNameChange,t[27]=e.selectedBranchName,t[28]=e.selectedWorkItemBranchName,t[29]=e.selection,t[30]=e.workItemBranchChoices,t[31]=e.workItemBranchMode,t[32]=e.workItemBranchName,t[33]=a):a=t[33];let o;return t[34]!==i||t[35]!==a?(o=(0,F.jsxs)(`aside`,{className:`flex min-h-0 flex-col gap-4 border-border/60 border-t bg-muted/20 p-4 md:border-t-0 md:border-l`,children:[i,a]}),t[34]=i,t[35]=a,t[36]=o):o=t[36],o}function Ee(e){let t=(0,N.c)(6),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsx)(y,{className:`size-4 shrink-0 text-muted-foreground`}),t[0]=n):n=t[0];let r=e.branchName??`Select a branch`,i;t[1]===r?i=t[2]:(i=(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[n,(0,F.jsx)(`span`,{className:`min-w-0 truncate font-mono text-sm`,children:r})]}),t[1]=r,t[2]=i);let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,F.jsx)(`p`,{className:`mt-2 text-muted-foreground text-xs`,children:`A new worktree branch will be created from this ref.`}),t[3]=a):a=t[3];let o;return t[4]===i?o=t[5]:(o=(0,F.jsxs)(`div`,{className:`rounded-md border border-border/60 bg-background/70 p-3`,children:[i,a]}),t[4]=i,t[5]=o),o}function De(e){let t=(0,N.c)(11),n;t[0]===e.baseBranch?n=t[1]:(n=L(e.baseBranch),t[0]=e.baseBranch,t[1]=n);let r;t[2]===n?r=t[3]:(r=(0,F.jsx)(V,{label:`From`,value:n,mono:!0}),t[2]=n,t[3]=r);let i;t[4]===e.branchName?i=t[5]:(i=e.branchName.trim()||`Enter or generate a branch name`,t[4]=e.branchName,t[5]=i);let a;t[6]===i?a=t[7]:(a=(0,F.jsx)(V,{label:`Create`,value:i,mono:!0}),t[6]=i,t[7]=a);let o;return t[8]!==r||t[9]!==a?(o=(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-border/60 bg-background/70 p-3`,children:[r,a]}),t[8]=r,t[9]=a,t[10]=o):o=t[10],o}function Oe(e){let t=(0,N.c)(27);if(!e.selection){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(`p`,{className:`rounded-md border border-dashed border-border/70 p-3 text-muted-foreground text-sm`,children:`Select a pull request from the list.`}),t[0]=e):e=t[0],e}let n;t[1]!==e.selection.isDraft||t[2]!==e.selection.state?(n=p(e.selection.state,e.selection.isDraft),t[1]=e.selection.isDraft,t[2]=e.selection.state,t[3]=n):n=t[3];let r;t[4]===n?r=t[5]:(r=(0,F.jsx)(C,{kind:n,className:`mt-0.5 shrink-0`}),t[4]=n,t[5]=r);let i;t[6]===e.selection.number?i=t[7]:(i=(0,F.jsxs)(`div`,{className:`text-muted-foreground text-xs`,children:[`PR #`,e.selection.number]}),t[6]=e.selection.number,t[7]=i);let a;t[8]===e.selection.title?a=t[9]:(a=(0,F.jsx)(`div`,{className:`line-clamp-2 font-medium text-sm`,children:e.selection.title}),t[8]=e.selection.title,t[9]=a);let o;t[10]!==i||t[11]!==a?(o=(0,F.jsxs)(`div`,{className:`min-w-0`,children:[i,a]}),t[10]=i,t[11]=a,t[12]=o):o=t[12];let s;t[13]!==r||t[14]!==o?(s=(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[r,o]}),t[13]=r,t[14]=o,t[15]=s):s=t[15];let c=`${e.selection.headRefName} -> ${e.selection.baseRefName}`,l;t[16]===c?l=t[17]:(l=(0,F.jsx)(V,{label:`Branch`,value:c,mono:!0}),t[16]=c,t[17]=l);let u;t[18]===e.selection.author?u=t[19]:(u=e.selection.author?(0,F.jsx)(V,{label:`Author`,value:e.selection.author}):null,t[18]=e.selection.author,t[19]=u);let d;t[20]===e.existingWorktreeId?d=t[21]:(d=e.existingWorktreeId?(0,F.jsx)(`span`,{className:`rounded border border-primary/30 bg-primary/10 px-2 py-1 text-primary text-xs`,children:`Existing worktree found`}):null,t[20]=e.existingWorktreeId,t[21]=d);let f;return t[22]!==s||t[23]!==l||t[24]!==u||t[25]!==d?(f=(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-border/60 bg-background/70 p-3`,children:[s,l,u,d]}),t[22]=s,t[23]=l,t[24]=u,t[25]=d,t[26]=f):f=t[26],f}function R(e){let t=(0,N.c)(49);if(!e.selection){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(`p`,{className:`rounded-md border border-dashed border-border/70 p-3 text-muted-foreground text-sm`,children:`Select an issue from the list.`}),t[0]=e):e=t[0],e}let n=e.selection.state===`open`?`issue-open`:`issue-closed`,r;t[1]===n?r=t[2]:(r=(0,F.jsx)(C,{kind:n,className:`mt-0.5 shrink-0`}),t[1]=n,t[2]=r);let a;t[3]===e.selection.number?a=t[4]:(a=(0,F.jsxs)(`div`,{className:`text-muted-foreground text-xs`,children:[`Issue #`,e.selection.number]}),t[3]=e.selection.number,t[4]=a);let o;t[5]===e.selection.title?o=t[6]:(o=(0,F.jsx)(`div`,{className:`line-clamp-2 font-medium text-sm`,children:e.selection.title}),t[5]=e.selection.title,t[6]=o);let s;t[7]!==a||t[8]!==o?(s=(0,F.jsxs)(`div`,{className:`min-w-0`,children:[a,o]}),t[7]=a,t[8]=o,t[9]=s):s=t[9];let c;t[10]!==r||t[11]!==s?(c=(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[r,s]}),t[10]=r,t[11]=s,t[12]=c):c=t[12];let l;t[13]===e.selection.author?l=t[14]:(l=e.selection.author?(0,F.jsx)(V,{label:`Author`,value:e.selection.author}):null,t[13]=e.selection.author,t[14]=l);let u;t[15]===e.existingWorktreeId?u=t[16]:(u=e.existingWorktreeId?(0,F.jsx)(`span`,{className:`rounded border border-primary/30 bg-primary/10 px-2 py-1 text-primary text-xs`,children:`Existing worktree found`}):null,t[15]=e.existingWorktreeId,t[16]=u);let d;t[17]!==c||t[18]!==l||t[19]!==u?(d=(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-border/60 bg-background/70 p-3`,children:[c,l,u]}),t[17]=c,t[18]=l,t[19]=u,t[20]=d):d=t[20];let f;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`From branch`}),t[21]=f):f=t[21];let p;t[22]!==e.baseBranch||t[23]!==e.cwd||t[24]!==e.dialogOpen||t[25]!==e.environmentId||t[26]!==e.onBaseBranchChange||t[27]!==e.onDefaultBranchDiscovered?(p=(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[f,(0,F.jsx)(U,{cwd:e.cwd,dialogOpen:e.dialogOpen,environmentId:e.environmentId,value:e.baseBranch,onChange:e.onBaseBranchChange,onDefaultBranchDiscovered:e.onDefaultBranchDiscovered})]}),t[22]=e.baseBranch,t[23]=e.cwd,t[24]=e.dialogOpen,t[25]=e.environmentId,t[26]=e.onBaseBranchChange,t[27]=e.onDefaultBranchDiscovered,t[28]=p):p=t[28];let m;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Branch name`}),t[29]=m):m=t[29];let h,g;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(h={value:`ai`,label:`AI`},g={value:`custom`,label:`Custom`},t[30]=h,t[31]=g):(h=t[30],g=t[31]);let _;t[32]!==e.branchMode||t[33]!==e.onBranchModeChange?(_=(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[m,(0,F.jsx)(H,{value:e.branchMode,left:h,right:g,onChange:e.onBranchModeChange})]}),t[32]=e.branchMode,t[33]=e.onBranchModeChange,t[34]=_):_=t[34];let v;t[35]===e?v=t[36]:(v=e.branchMode===`ai`?(0,F.jsx)(`p`,{className:`rounded-md border border-border/60 bg-background/60 px-3 py-2 text-muted-foreground text-xs`,children:`The branch name will be generated from the selected issue when the worktree is created.`}):(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M,{value:e.branchName,onChange:t=>e.onBranchNameChange(t.target.value),placeholder:`issue/short-name`,className:`font-mono text-xs`}),(0,F.jsx)(i,{type:`button`,size:`icon`,variant:`ghost`,disabled:e.isGenerating,onClick:e.onGenerateBranchName,"aria-label":`Generate issue branch name`,children:(0,F.jsx)(E,{className:e.isGenerating?`size-3.5 animate-status-pulse`:`size-3.5`})})]}),t[35]=e,t[36]=v);let y;t[37]===e.generationError?y=t[38]:(y=e.generationError?(0,F.jsx)(`span`,{className:`text-destructive text-xs`,children:e.generationError}):null,t[37]=e.generationError,t[38]=y);let b;t[39]!==_||t[40]!==v||t[41]!==y?(b=(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[_,v,y]}),t[39]=_,t[40]=v,t[41]=y,t[42]=b):b=t[42];let x;t[43]!==p||t[44]!==b?(x=(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[p,b]}),t[43]=p,t[44]=b,t[45]=x):x=t[45];let S;return t[46]!==x||t[47]!==d?(S=(0,F.jsxs)(`div`,{className:`grid gap-4`,children:[d,x]}),t[46]=x,t[47]=d,t[48]=S):S=t[48],S}function z(e){let t=(0,N.c)(30);if(!e.selection){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,F.jsx)(`p`,{className:`rounded-md border border-dashed border-border/70 p-3 text-muted-foreground text-sm`,children:`Select a Jira work item from the list.`}),t[0]=e):e=t[0],e}let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,F.jsxs)(`span`,{className:`mt-0.5 inline-flex items-center gap-1 rounded-full bg-violet-500/10 px-2 py-0.5 font-medium text-violet-600 text-xs dark:text-violet-300`,children:[(0,F.jsx)(T,{className:`size-3`}),`Jira`]}),t[1]=r):r=t[1];let a;t[2]===e.selection.key?a=t[3]:(a=(0,F.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:e.selection.key}),t[2]=e.selection.key,t[3]=a);let o;t[4]===e.selection.title?o=t[5]:(o=(0,F.jsx)(`div`,{className:`line-clamp-2 font-medium text-sm`,children:e.selection.title}),t[4]=e.selection.title,t[5]=o);let s;t[6]!==a||t[7]!==o?(s=(0,F.jsxs)(`div`,{className:`flex items-start gap-2`,children:[r,(0,F.jsxs)(`div`,{className:`min-w-0`,children:[a,o]})]}),t[6]=a,t[7]=o,t[8]=s):s=t[8];let c;t[9]===e.selection?c=t[10]:(c=w(e.selection),t[9]=e.selection,t[10]=c);let l;t[11]===c?l=t[12]:(l=(0,F.jsx)(V,{label:`State`,value:c}),t[11]=c,t[12]=l);let u;t[13]===e.selection.issueType?u=t[14]:(u=e.selection.issueType?(0,F.jsx)(V,{label:`Type`,value:e.selection.issueType}):null,t[13]=e.selection.issueType,t[14]=u);let d;t[15]===e.existingWorktreeId?d=t[16]:(d=e.existingWorktreeId?(0,F.jsx)(`span`,{className:`rounded border border-primary/30 bg-primary/10 px-2 py-1 text-primary text-xs`,children:`Existing worktree found`}):null,t[15]=e.existingWorktreeId,t[16]=d);let f;t[17]===e.linkedWorktrees?f=t[18]:(f=e.linkedWorktrees.length>0?(0,F.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,F.jsx)(`span`,{className:`text-muted-foreground text-[11px] uppercase`,children:`Linked worktrees`}),(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1`,children:e.linkedWorktrees.map(B)})]}):null,t[17]=e.linkedWorktrees,t[18]=f);let p;t[19]!==s||t[20]!==l||t[21]!==u||t[22]!==d||t[23]!==f?(p=(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-border/60 bg-background/70 p-3`,children:[s,l,u,d,f]}),t[19]=s,t[20]=l,t[21]=u,t[22]=d,t[23]=f,t[24]=p):p=t[24];let m;t[25]===e?m=t[26]:(m=e.workItemBranchChoices.length>0?(0,F.jsxs)(`div`,{className:`grid gap-3 rounded-md border border-primary/25 bg-primary/8 p-3`,children:[(0,F.jsxs)(`div`,{className:`grid gap-1`,children:[(0,F.jsx)(`span`,{className:`font-medium text-primary text-xs`,children:`Branch already exists for this Jira ticket`}),(0,F.jsx)(`span`,{className:`text-muted-foreground text-xs`,children:`Select which matching branch should get a new worktree.`})]}),(0,F.jsx)(`div`,{className:`grid gap-1.5`,children:e.workItemBranchChoices.map(t=>{let r=e.selectedExistingBranchName===t.branchName;return(0,F.jsxs)(`button`,{type:`button`,className:n(`flex min-w-0 items-start gap-2 rounded-md border px-2 py-2 text-left transition-colors`,r?`border-primary/40 bg-background text-foreground`:`border-border/70 bg-background/60 hover:bg-background`),onClick:()=>e.onSelectExistingBranchName(t.branchName),children:[(0,F.jsx)(y,{className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}),(0,F.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`span`,{className:`block truncate font-mono text-xs`,children:t.label}),(0,F.jsx)(`span`,{className:`block truncate text-[11px] text-muted-foreground`,children:t.description})]}),t.hasWorktree?(0,F.jsx)(`span`,{className:`shrink-0 rounded border border-border/70 px-1 py-0.5 text-[9px] text-muted-foreground uppercase`,children:`worktree`}):null]},t.branchName)})})]}):(0,F.jsxs)(`div`,{className:`grid gap-3`,children:[e.linkedBranchesLoading?(0,F.jsx)(`p`,{className:`rounded-md border border-border/60 bg-background/60 px-3 py-2 text-muted-foreground text-xs`,children:`Checking for existing Jira branches…`}):e.linkedBranchesError?(0,F.jsxs)(`p`,{className:`rounded-md border border-border/60 bg-background/60 px-3 py-2 text-muted-foreground text-xs`,children:[`Could not check existing Jira branches: `,e.linkedBranchesError]}):null,(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`From branch`}),(0,F.jsx)(U,{cwd:e.cwd,dialogOpen:e.dialogOpen,environmentId:e.environmentId,value:e.baseBranch,onChange:e.onBaseBranchChange,onDefaultBranchDiscovered:e.onDefaultBranchDiscovered})]}),(0,F.jsxs)(`div`,{className:`grid gap-2`,children:[(0,F.jsxs)(`div`,{className:`flex items-center justify-between gap-3`,children:[(0,F.jsx)(`span`,{className:`text-xs font-medium text-foreground`,children:`Branch name`}),(0,F.jsx)(H,{value:e.branchMode,left:{value:`ai`,label:`AI`},right:{value:`custom`,label:`Custom`},onChange:e.onBranchModeChange})]}),e.branchMode===`ai`?(0,F.jsx)(`p`,{className:`rounded-md border border-border/60 bg-background/60 px-3 py-2 text-muted-foreground text-xs`,children:`The branch name will be generated from the selected Jira item when the worktree is created.`}):(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(M,{value:e.branchName,onChange:t=>e.onBranchNameChange(t.target.value),placeholder:`KAN-4-short-name`,className:`font-mono text-xs`}),(0,F.jsx)(i,{type:`button`,size:`icon`,variant:`ghost`,disabled:e.isGenerating,onClick:e.onGenerateBranchName,"aria-label":`Generate Jira branch name`,children:(0,F.jsx)(E,{className:e.isGenerating?`size-3.5 animate-status-pulse`:`size-3.5`})})]}),e.generationError?(0,F.jsx)(`span`,{className:`text-destructive text-xs`,children:e.generationError}):null]})]}),t[25]=e,t[26]=m);let h;return t[27]!==m||t[28]!==p?(h=(0,F.jsxs)(`div`,{className:`grid gap-4`,children:[p,m]}),t[27]=m,t[28]=p,t[29]=h):h=t[29],h}function B(e){return(0,F.jsx)(`span`,{className:`max-w-full truncate rounded border border-border/70 bg-background/70 px-1.5 py-0.5 font-mono text-[10px] text-muted-foreground`,title:e.worktreePath??e.branch,children:e.branch},e.id)}function V(e){let t=(0,N.c)(10),r;t[0]===e.label?r=t[1]:(r=(0,F.jsx)(`span`,{className:`text-muted-foreground text-[11px] uppercase`,children:e.label}),t[0]=e.label,t[1]=r);let i=e.mono&&`font-mono text-xs`,a;t[2]===i?a=t[3]:(a=n(`min-w-0 truncate text-sm`,i),t[2]=i,t[3]=a);let o;t[4]!==e.value||t[5]!==a?(o=(0,F.jsx)(`span`,{className:a,children:e.value}),t[4]=e.value,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,F.jsxs)(`div`,{className:`grid gap-0.5`,children:[r,o]}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function H(e){let t=(0,N.c)(6),r;t[0]!==e.left||t[1]!==e.right?(r=[e.left,e.right],t[0]=e.left,t[1]=e.right,t[2]=r):r=t[2];let i;return t[3]!==e||t[4]!==r?(i=(0,F.jsx)(`div`,{className:`inline-flex rounded-md border border-border/60 bg-muted/40 p-0.5`,children:r.map(t=>(0,F.jsx)(`button`,{type:`button`,"aria-pressed":e.value===t.value,onClick:()=>e.onChange(t.value),className:n(`rounded px-2 py-0.5 text-xs transition-colors`,e.value===t.value?`bg-background text-foreground shadow-sm`:`text-muted-foreground hover:text-foreground`),children:t.label},t.value))}),t[3]=e,t[4]=r,t[5]=i):i=t[5],i}function U(e){let[t,n]=(0,P.useState)(!1),[a,o]=(0,P.useState)(``),s=(0,P.useRef)(null),c=xe({cwd:e.cwd,enabled:!0,environmentId:e.environmentId,open:e.dialogOpen,query:t?a:``}),{onDefaultBranchDiscovered:l}=e;(0,P.useEffect)(()=>{let e=c.refs.find(e=>e.isDefault)?.name;e&&l(e)},[c.refs,l]);let u=(0,P.useMemo)(()=>c.refs.map(e=>e.name),[c.refs]),d=(0,P.useMemo)(()=>new Map(c.refs.map(e=>[e.name,e])),[c.refs]),f=(0,P.useCallback)(e=>{n(e),e||o(``)},[]);return(0,F.jsxs)(le,{items:u,filteredItems:u,open:t,value:e.value,onOpenChange:f,children:[(0,F.jsxs)(ue,{ref:s,render:(0,F.jsx)(i,{variant:`outline`}),className:`h-8 w-full justify-between px-2 font-mono text-xs`,children:[(0,F.jsx)(`span`,{className:`min-w-0 truncate`,children:e.value||`Select branch`}),(0,F.jsx)(r,{className:`size-3.5 shrink-0 text-muted-foreground`})]}),(0,F.jsxs)(ce,{anchor:s,className:`w-[min(42rem,var(--available-width))] overflow-hidden`,children:[(0,F.jsx)(`div`,{className:`border-b p-1`,children:(0,F.jsx)(j,{className:`[&_input]:font-sans rounded-md`,inputClassName:`ring-0`,placeholder:`Search refs...`,showTrigger:!1,size:`sm`,value:a,onChange:e=>o(e.target.value)})}),(0,F.jsx)(A,{children:`No refs found.`}),(0,F.jsx)(D,{className:`max-h-56`,children:u.map((t,r)=>{let i=d.get(t),a=i?.current?`current`:i?.worktreePath?`worktree`:i?.isRemote?`remote`:i?.isDefault?`default`:null;return(0,F.jsx)(O,{index:r,value:t,onClick:()=>{e.onChange(t),n(!1),o(``)},children:(0,F.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,F.jsx)(`span`,{className:`truncate font-mono text-xs`,children:t}),a?(0,F.jsx)(`span`,{className:`shrink-0 text-[10px] text-muted-foreground/55`,children:a}):null]})},t)})}),(0,F.jsx)(k,{children:c.error?c.error:c.isLoading?`Loading refs...`:u.length>=I?`Showing first ${I} refs`:``})]})]})}export{he as n,Se as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{C as t,D as n,E as r,N as i,O as a,P as o,S as s,_ as c,b as l,c as u,d,f,l as p,m,q as h,s as g,v as ee,x as te,y as ne}from"./primary-Cf-xJExj.js";import{$i as _,Kt as re,Oi as v,P as y,Xi as ie,Zi as b,ad as x,hs as S,id as C,vs as w}from"./runtime-DjjjAcTE.js";import{t as T}from"./react-CwJFpaho.js";import{A as E,D,M as O,N as k,O as A,P as j,j as M,k as N}from"./popover-OWEv6cQz.js";import{i as P}from"./presentationTier-DPVAxTK4.js";import{t as ae}from"./checkbox-CIIIY9FA.js";import{t as oe}from"./qr-code-DywzVgQC.js";import{t as F}from"./refresh-cw-CRUTivd6.js";import{tt as I}from"./authorization-Ob6YwWiI.js";import{t as L}from"./input-CCie4mm1.js";import{c as R}from"./select-Cb9FUPHD.js";import{i as z,r as se,t as ce}from"./alert-FV7ZIit_.js";import{a as le,i as ue,n as de,o as fe,r as pe,s as me,t as he}from"./alert-dialog-CgXR9tED.js";import{t as B}from"./switch-oQc7Ifbl.js";import{d as V,f as ge,l as _e,u as H}from"./settingsLayout-CRFNCk_D.js";import{a as ve,i as ye,n as U,o as be,s as xe,t as Se}from"./HostedRelayTrustNotice-BfTyrBi5.js";import{t as Ce}from"./qr-code-BlbiBIwH.js";var W=e(T(),1),G=P();function we(e){return e?`hosted`:`local`}function Te(e,t){return e===`local`?{headline:`Direct to a node on this machine`,body:`This window talks to a Ryco node running here, on this machine. No Ryco Hub sits between them and nothing you send leaves this machine on its way to the node.`}:{headline:t===null?`Through the Ryco Hub`:t.shortLabel,body:`This browser reaches a node through the Ryco Hub relay. What that channel is worth is stated with the channel itself, below.`}}function Ee(e,t=`owner`){return e===`local`?t===`owner`?{available:!0,unavailableBody:``}:t===`checking`?{available:!1,unavailableBody:`Checking whether this session can administer the node's security state.`}:t===`client`?{available:!1,unavailableBody:"This browser is paired as a client. Node security administration is owner-only; open Ryco Desktop on this machine or run `ryco e2ee` on the node. This direct client connection remains available."}:{available:!1,unavailableBody:"Ryco could not verify that this session may administer the node's security state. Reconnect from Ryco Desktop on this machine or run `ryco e2ee` on the node."}:{available:!1,unavailableBody:"Your node's client list, live sessions, admission policy, prekey and fallback counters are held on the node and read over its own local interface, which the relay does not carry. Open Ryco on that machine to see them, or run `ryco e2ee` there."}}var De=[`clients`,`sessions`,`policy`,`prekey`,`continuity`,`fallback`],Oe=`Unable to read the node's security state.`;function ke(e,t){let n=(e,t)=>e.status===`fulfilled`?e.value:t;return{clients:n(t.clients,e.clients),sessions:n(t.sessions,e.sessions),policy:n(t.policy,e.policy),prekey:n(t.prekey,e.prekey),continuity:n(t.continuity,e.continuity),fallback:n(t.fallback,e.fallback)}}function Ae(e){for(let t of De){let n=e[t];if(n.status===`rejected`)return n.reason instanceof Error?n.reason.message:Oe}return null}function je(e){return e===`local`?{kind:`available`}:{kind:`blocked`,reason:"This one can only be changed from the node itself. It admits approved native client keys and closes browser and legacy access — including this browser, which is how you are reading this — so turning it on from here would end this session and leave no way back in through it. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node, where you can still reach it if the result is not what you wanted."}}var Me="This build cannot change whether the node admits only approved native client keys. Run `ryco e2ee policy set --require-approved-client-e2ee` on the machine running the node.";function Ne(e,t){if(e===`hosted`&&t.requireApprovedClientE2EE!==void 0){let t=je(e);return{allowed:!1,refusal:t.kind===`blocked`?t.reason:Me}}return{allowed:!0,proposal:t}}function K(e){let t=e.split(I.separator);if(t.length!==I.groups)return[];for(let e of t){if(e.length!==I.digitsPerGroup)return[];for(let t of e)if(t<`0`||t>`9`)return[]}return t}var Pe=`${I.digits} digits, in ${I.groups} groups of ${I.digitsPerGroup}. The length and the grouping are the only check there is, so read all ${I.digits} in order.`,Fe=`Compare this with the number the device itself shows, on the device, before approving it. They match only for this key pair under this Hub account — the same device under a different account reads differently. Approve nothing whose number you have not read off the other screen yourself.`,Ie=`This number matches the phone`,Le=`Read all ${I.digits} digits off the phone's own screen and tick this only if every group is the same; the approve action appears once you have. The characters in this row's title only tell rows apart and are no comparison.`;function Re(e){let t=K(e);return t.length===0?null:{groups:t,display:t.join(I.separator),caption:Pe,advisory:Fe}}var q=`No comparison number is readable for this record, so there is nothing here to check against the device.`;function ze(e){return e===null?{available:!1,fingerprint:null,caption:"This node's identity fingerprint is shown here only while an enrollment is waiting for approval. At other times, read it from the node with `ryco hub status` on the machine running it."}:{available:!0,fingerprint:e,caption:`This node's identity fingerprint, from the enrollment now waiting for approval. Compare it character for character wherever you are asked to confirm this machine.`}}var J=`unknown`;function Y(e){if(e===void 0)return`never`;let t=new Date(e);return Number.isNaN(t.getTime())?J:t.toLocaleString()}function Be(e){return e===null?[{label:`Agreement prekey`,value:J}]:e.present?[{label:`Prekey`,value:e.prekeyId??J,mono:!0},{label:`Fingerprint`,value:e.fingerprint??J,mono:!0},{label:`Validity`,value:e.validity??J},{label:`Created`,value:Y(e.createdAt)},{label:`Expires`,value:Y(e.expiresAt)}]:[{label:`Agreement prekey`,value:`none held`}]}function Ve(e){return e===null?null:e.present?e.remedy??null:`This node holds no agreement prekey for its Hub origin. It re-signs one at startup; rotate to issue one now.`}function He(e){return e===null?[{label:`Continuity`,value:J}]:e.status===`identity_in_use`?[{label:`Continuity`,value:`not read here`}]:e.status===`unavailable`?[{label:`Continuity`,value:`unresolvable`},{label:`Reason`,value:e.reason??J}]:[{label:`Continuity`,value:`advertisable`},{label:`Lineage`,value:e.continuityId??J,mono:!0},{label:`Rotation generation`,value:String(e.generation??0)},{label:`Retained chain length`,value:String(e.chainLength??0)},...e.repair===void 0?[]:[{label:`Startup repair`,value:e.repair}],...e.lastBreakReason===void 0?[]:[{label:`Last break`,value:`${e.lastBreakReason} at ${Y(e.lastBreakAt)}`}]]}function Ue(e){return e?.remedy??null}function We(e){switch(e){case`pending`:return`warning`;case`approved`:return`success`;case`revoked`:return`error`}}function Ge(e){let t=e.displayLabel?.trim()??``;return t===``?`Client key …${e.fingerprint.slice(-8)}`:t}function Ke(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Hub origin`,value:e.hubOrigin},{label:`Account`,value:e.accountId},{label:`Maximum role`,value:e.maxRole===``?`none granted`:e.maxRole},{label:e.status===`pending`?`Connects as`:`Connected as (when introduced)`,value:e.observedRole??`not recorded`},{label:`Capabilities`,value:e.capabilitySet.length===0?`none`:e.capabilitySet.join(`, `)},{label:`Created`,value:Y(e.createdAt)},...e.approvedAt===void 0?[]:[{label:`Approved`,value:Y(e.approvedAt)}],...e.revokedAt===void 0?[]:[{label:`Revoked`,value:Y(e.revokedAt)}],{label:`Last seen`,value:Y(e.lastSeenAt)},...e.pairingReserved?[{label:`Pairing reservation`,value:`held`}]:[]]}function qe(e){if(e===null)return[];let t=[];return(e.pendingGlobalSaturated||e.saturatedAccounts.length>0)&&t.push(`Pending pairing is saturated, so a new device may not be able to introduce itself. Purge a pending record, or read the fingerprint off the device and open a pairing window naming it.`),e.refusedPairingAttempts>0&&t.push(`${e.refusedPairingAttempts} pairing attempt(s) were refused because the pending list was full. Clear the count once you have dealt with them, or later readings will be dominated by history.`),t}function Je(e){if(e===null)return[{label:`Pairing window`,value:J}];let t=e.pairingWindow;return t===void 0?[{label:`Pairing window`,value:`closed`}]:[{label:`Pairing window`,value:`open`},{label:`Only this fingerprint`,value:t.fingerprint,mono:!0},{label:`Expires`,value:Y(t.expiresAt)},{label:`Reservation`,value:t.spent?`spent`:`unspent`}]}function Ye(e){return e===null?`How many pairing attempts this node refused because the pending list was full has not been read here.`:`${e.refusedPairingAttempts} attempt(s) refused because the pending list was full.`}var Xe=`A window lets exactly one device introduce itself, and only the one whose fingerprint you name.`;function Ze(e){return[{label:`Tier`,value:e.tier===`native`?`native (IK)`:`browser (NX)`},{label:`Suite`,value:String(e.suite)},{label:`Established`,value:Y(e.establishedAt)}]}var Qe=`Native sessions have no per-session code. Compare this device's long-term number on its record above instead.`,$e=`Compare this code with the one that browser is showing for this session, on that screen. A match catches accidental wrong-node routing and some network interposition — anyone standing in for this node who is not also serving that browser its page — while the code that browser loaded is honest; it cannot protect against whoever served that page, and a match does not rule out someone sitting in the middle.`,et=`No session code reached this listing for that channel, so there is nothing here to compare against the browser holding it.`;function tt(e){let t=ye(e,`inline`);return t===null?null:{groups:t.groups,display:t.display,advisory:$e,more:null}}var nt=`A browser channel this node has open. Its per-session code is below.`;function rt(e){return e===null?[{label:`Admission policy`,value:J}]:[{label:`requireE2EE`,value:String(e.requireE2EE),mono:!0},{label:`requireApprovedClientE2EE`,value:String(e.requireApprovedClientE2EE),mono:!0},{label:`Effective requireE2EE`,value:String(e.effectiveRequireE2EE),mono:!0},{label:`Admitted patterns`,value:e.admittedPatterns.join(`, `)||`none`},{label:`Suite registry`,value:e.suiteRegistry.join(`, `)||`none`},{label:`Policy generation`,value:String(e.generation)}]}function it(e,t,n){let r=[];t.requireApprovedClientE2EE===!0&&r.push(`requireApprovedClientE2EE closes browser and legacy access entirely. Only approved native client keys reach application payload after this, and losing every approved key strands remote access to this node until someone recovers it at the machine — which never relaxes admission policy.`);for(let e of X(t,n))r.push(e);return e.withdrawal&&r.push(`This narrows what the node admits, so it closes live channels. Roughly matching now: ${e.counts.legacy} legacy, ${e.counts.nxE2ee} browser, ${e.counts.suiteWithdrawn} on a withdrawn suite, and ${e.counts.abortedHandshakes} handshake(s) in flight. These move while you read them.`),e.changed||r.push(`This changes nothing: the node already admits exactly this.`),r.length===0&&r.push(at),r}function X(e,t){let n=[];return e.requireE2EE===!1&&t?.requireE2EE!==!1&&n.push(`Turning this off re-admits plaintext. The node goes back to accepting relay payload it has not encrypted, for browsers and for legacy clients, and the Hub carries that in a form it can read. It closes nothing now — what changes is what the node accepts next.`),e.requireApprovedClientE2EE===!1&&t?.requireApprovedClientE2EE!==!1&&n.push(`Clearing this re-admits the browser and legacy tiers. Client keys this node has not approved reach it again on their next connection, under whatever the remaining policy allows.`),n}var at=`The node reports that this closes no channel it has open now. That is a statement about the live channels and not about what the node will admit afterwards.`;function ot(e,t,n){return e.withdrawal||X(t,n).length>0}function st(e){return[e.changed?`Policy committed.`:`Policy unchanged.`,`Closed ${e.counts.legacy} legacy channel(s), ${e.counts.nxE2ee} browser channel(s), ${e.counts.suiteWithdrawn} suite-withdrawn channel(s); aborted ${e.counts.abortedHandshakes} handshake(s) in flight.`].join(` `)}var ct=`This advances the policy generation past every value this node may already have advertised, and the jump is deliberate. Clients accept only a higher generation than the one they remember, so nothing below the new value can be advertised again. If a restore rolled the record back, recovery does not restore the old values: it commits the fail-closed policy, which admits only approved native client keys and so closes browser and legacy access entirely, including every remote browser session open now. There is no way to tell from here which of the two this will be. Widening it back is a separate, explicit policy change, and if this node's only remaining access was a browser it has to be made at the machine.`;function lt(e){if(e===null)return null;let t=e.peerLegacy.ringOverflows>0||e.advertisementUnavailable.ringOverflows>0;return{windowStarted:Y(e.windowStartedAt),classes:[{label:`Peer spoke legacy`,meaning:`The other end did not take the encrypted channel, so this one carried readable payload.`,occurrences:e.peerLegacy.occurrences,lastOccurrence:Y(e.peerLegacy.lastOccurrenceAt),ringOverflows:e.peerLegacy.ringOverflows},{label:`No advertisement`,meaning:`This node could not offer an encrypted channel, or the offer did not survive the path. It cannot tell which.`,occurrences:e.advertisementUnavailable.occurrences,lastOccurrence:Y(e.advertisementUnavailable.lastOccurrenceAt),ringOverflows:e.advertisementUnavailable.ringOverflows}],entries:[...e.ring].toSorted((e,t)=>e.occurredAt-t.occurredAt).map((e,t)=>({ordinal:t,at:Y(e.occurredAt),reason:e.reason})),overflowNotice:t?`The retained list overflowed, so it is an incomplete account of this window. The shape of what is left is not evidence in either direction.`:null,undersizedNotice:e.undersizedConnection===void 0?null:`This connection asserts a maximum chunk of ${e.undersizedConnection.assertedMaxDataChunkBytes} bytes, below the ${e.undersizedConnection.advertisementMinChunkBytes} bytes an offer needs. Nothing that fits can carry one, so this node offers nothing on this connection.`,quiet:e.peerLegacy.occurrences===0&&e.advertisementUnavailable.occurrences===0&&e.ring.length===0}}var ut=`Nothing has fallen back in this window. This counts what happened, not what could — a quiet window is not a statement about the next one.`,dt={approve:{title:`Approve this client key?`,body:`The device holding this key may then reach this node, at most with the role and capability this approval names. Compare its number against the device first. It takes effect on its next connection, not on anything open now.`,confirmLabel:`Approve key`,destructive:!1},narrow:{title:`Reduce what this client may do?`,body:`Anything this device has open under the wider authority closes immediately — the node will not confirm the change until those channels are shut. It can reconnect only while the role it connects with fits under the new ceiling. The role it introduced itself with does; if the Hub has raised its account's role since, it is refused, not limited. Its capability grant is left exactly as it is; only the ceiling drops, and changing the capabilities is a separate command on the node.`,confirmLabel:`Reduce authority`,destructive:!0},revoke:{title:`Revoke this client key?`,body:"The device loses access now: every channel it has open closes before this is confirmed. It cannot reconnect unless the key is approved again on the node itself (`ryco e2ee client approve`), or its record is deleted and the device introduces itself again — this panel does not re-approve a revoked key. The record stays, so you can see it was revoked.",confirmLabel:`Revoke key`,destructive:!0},purge:{title:`Delete this client record?`,body:`The same immediate disconnection as revoking, and the record goes with it — there will be nothing left showing this device was ever here. If it connects again it arrives as a stranger and pairs from scratch.`,confirmLabel:`Delete record`,destructive:!0},"open-window":{title:`Open a pairing window for this fingerprint?`,body:`For a short time this node will accept one introduction, and only from the key whose fingerprint you name. Read that fingerprint off the device itself — a window naming the wrong one lets the wrong device in.`,confirmLabel:`Open window`,destructive:!1},"close-window":{title:`Close the pairing window?`,body:`No new device can introduce itself until you open another. Anything already introduced keeps its record.`,confirmLabel:`Close window`,destructive:!1},"clear-refusals":{title:`Clear the refused-attempt count?`,body:`The count goes back to zero. Do this once you have dealt with what caused it, so the next reading is about the next thing rather than about history.`,confirmLabel:`Clear count`,destructive:!1},"rotate-prekey":{title:`Issue a new agreement prekey?`,body:`The node makes a fresh key pair and certificate immediately. Clients pick the new one up on their next connection; nothing already open is disturbed.`,confirmLabel:`Rotate prekey`,destructive:!1},"recover-policy":{title:`Advance the policy generation?`,body:ct,confirmLabel:`Advance generation`,destructive:!0},"reset-fallback":{title:`Reset the fallback counters?`,body:`Both counts and the retained list go back to empty and a new observation window starts. What was recorded is gone; nothing else changes.`,confirmLabel:`Reset counters`,destructive:!1},"remint-continuity":{title:`Break continuity and mint a fresh lineage?`,body:`Every device that has paired with this node has to go through the whole pairing ceremony again, in person, before it can reconnect. Do this when you believe the lineage is wrong, not to tidy it up.`,confirmLabel:`Mint fresh lineage`,destructive:!0},"break-continuity":{title:`Break the continuity chain?`,body:`The lineage keeps its name, but every device that pinned this node has to go through the pairing ceremony again before it can reconnect.`,confirmLabel:`Break chain`,destructive:!0}};function ft(e){return dt[e]}var Z=`This is a request nothing has approved yet. Revoking it blocks this key here; to turn the request away without blocking the device, delete it instead — it can then introduce itself again.`,pt=`It applies to the key below and to no other. Check the fingerprint against the device you meant: two devices paired under one account are told apart by nothing else here.`;function mt(e){return[{label:`Fingerprint`,value:e.fingerprint,mono:!0},{label:`Account`,value:e.accountId},{label:`Hub origin`,value:e.hubOrigin}]}function ht(e,t){let n=dt[e],r=e===`revoke`&&t.status===`pending`?[Z]:[];return{...n,body:[n.body,...r,pt].join(` `),facts:mt(t)}}function gt(e){let t=dt[`open-window`];return{...t,body:`${t.body} Read the value below off the device now, before confirming.`,facts:[{label:`Only this fingerprint`,value:e,mono:!0}]}}var _t=[`viewer`,`operator`,`owner`];function vt(e){return _t.indexOf(e)}function yt(e){if(e.status!==`pending`)return null;let t=vt(e.observedRole);return t<0?null:_t[t]}var bt=`This request does not say which role the device connects with, so no approval here could let it in. Have the device try again: its next attempt records the role, and the approve action appears on this row.`,xt="A revoked key is not re-approved from here. The role on this record is the one the device introduced itself with, and the Hub may open its channels under another now — a smaller ceiling would refuse the device, a larger one would grant what the Hub no longer assigns. Delete the record and let the device introduce itself again, then approve the new request here, or name the role on the node with `ryco e2ee client approve --max-role`.";function St(e){switch(e.status){case`approved`:return null;case`revoked`:return xt;case`pending`:return yt(e)===null?bt:null}}function Ct(e,t){return e===null||t.status!==`pending`?0:e.records.filter(e=>e.status===`pending`&&e.hubOrigin===t.hubOrigin&&e.accountId===t.accountId).length}function wt(e){return e<=1?null:`${e} requests are waiting under this account at this Hub. A Hub can open one under this account from a key of its own, and it reads exactly like the phone's except for the fingerprint and the number. Approve only the row whose number matches the phone in your hand, and delete any you cannot account for.`}function Tt(e,t){if(e.status!==`approved`)return!1;let n=vt(t),r=vt(e.observedRole);return vt(e.maxRole)>n&&r>=0&&r<=n}var Et={viewer:`read what is there`,operator:`edit files and run terminals`,owner:`also change credentials and server policy`},Dt=[`ryco.rpc`],Ot=`The number below is the one you matched against the phone; read it once more before confirming.`;function kt(e,t){let n=dt.approve,r=Dt.join(`, `),i=t===void 0?null:Re(t.safetyNumber),a=t===void 0?null:wt(t.pendingInPartition),o=t===void 0?[]:[...i===null?[]:[Ot],...a===null?[]:[a],pt];return{title:`Approve this client key as ${e}?`,body:[`${n.body} This device connects as ${e}, so that is the ceiling it is approved at: at most it will be able to ${Et[e]}. A smaller ceiling would refuse the device rather than limit it — if this account should not hold that much on this node, revoke the key instead.`,`It is granted the one capability a relay channel carries, ${r} — a key approved with none is admitted by nothing and could not connect at all.`,...o].join(` `),confirmLabel:`Approve as ${e}`,destructive:!1,...t===void 0?{}:{facts:[...mt(t),...i===null?[]:[{label:`Comparison number`,value:i.display,mono:!0}]]}}}Object.keys(dt);var At=`What this node will admit, and which client keys it has on file.`,jt=`Require an encrypted channel`,Mt=`Refuse plaintext, including for browsers.`,Nt=`Only approved native client keys`,Pt=`Closes browser and legacy access entirely. Only approved native client keys reach application payload.`,Ft=`Recover a generation that a restore rolled back.`,It=`Its current value on the node has not been read here, so nothing on this row states what it is.`,Lt=`No device has introduced itself to this node yet.`,Rt=`Nothing is connected right now.`,Q=x(),zt=5e3,Bt=6e4,Vt={clients:null,sessions:null,policy:null,prekey:null,continuity:null,fallback:null,enrollmentFingerprint:null};function $(e){let t=(0,G.c)(4),{rows:n}=e,r;t[0]===n?r=t[1]:(r=n.map(Ht),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(`dl`,{className:`grid gap-x-4 gap-y-1.5 sm:grid-cols-[12rem_minmax(0,1fr)]`,children:r}),t[2]=r,t[3]=i),i}function Ht(e){return(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-[11px] text-muted-foreground`,children:e.label}),(0,Q.jsx)(`dd`,{className:e.mono?`min-w-0 font-mono text-[12px] break-all text-foreground`:`min-w-0 text-[12px] text-foreground`,children:e.value})]},e.label)}function Ut(e){let t=(0,G.c)(14),{value:n}=e,r;t[0]===n?r=t[1]:(r=Re(n),t[0]=n,t[1]=r);let i=r;if(!i){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number`,"data-value":`absent`,className:`text-[11px] text-muted-foreground`,children:q}),t[2]=e):e=t[2],e}let a;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(`p`,{className:`text-[11px] font-medium`,children:`Comparison number`}),t[3]=a):a=t[3];let o;t[4]===i.display?o=t[5]:(o=(0,Q.jsx)(`p`,{"data-testid":`node-safety-number-value`,className:`font-mono text-[13px] leading-relaxed font-semibold tracking-[0.08em] select-all`,children:i.display}),t[4]=i.display,t[5]=o);let s;t[6]===i.caption?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.caption}),t[6]=i.caption,t[7]=s);let c;t[8]===i.advisory?c=t[9]:(c=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:i.advisory}),t[8]=i.advisory,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Q.jsxs)(`div`,{"data-testid":`node-safety-number`,"data-value":`present`,className:`space-y-1.5`,children:[a,o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function Wt(e){let t=(0,G.c)(15),{view:n,unavailable:r,testId:i}=e;if(!n){let e;return t[0]!==i||t[1]!==r?(e=(0,Q.jsx)(`p`,{"data-testid":i,"data-code":`absent`,className:`text-[11px] text-muted-foreground`,children:r}),t[0]=i,t[1]=r,t[2]=e):e=t[2],e}let a=`${i}-value`,o;t[3]!==a||t[4]!==n.display?(o=(0,Q.jsx)(`p`,{"data-testid":a,className:`font-mono text-sm leading-none font-semibold tracking-[0.2em] whitespace-nowrap select-all`,children:n.display}),t[3]=a,t[4]=n.display,t[5]=o):o=t[5];let s;t[6]===n.advisory?s=t[7]:(s=(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.advisory}),t[6]=n.advisory,t[7]=s);let c;t[8]===n.more?c=t[9]:(c=n.more===null?null:(0,Q.jsx)(`p`,{className:`text-[11px] leading-relaxed text-muted-foreground`,children:n.more}),t[8]=n.more,t[9]=c);let l;return t[10]!==o||t[11]!==s||t[12]!==c||t[13]!==i?(l=(0,Q.jsxs)(`div`,{"data-testid":i,"data-code":`present`,className:`space-y-1.5`,children:[o,s,c]}),t[10]=o,t[11]=s,t[12]=c,t[13]=i,t[14]=l):l=t[14],l}function Gt(e){let t=(0,G.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=ye(n,`settings`),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Wt,{view:r,unavailable:U,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function Kt(e){let t=(0,G.c)(4),{code:n}=e,r;t[0]===n?r=t[1]:(r=tt(n),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Q.jsx)(Wt,{view:r,unavailable:et,testId:`node-session-code`}),t[2]=r,t[3]=i),i}function qt(){let e=(0,G.c)(21),t=ve(),n=be(),r=y(Zt),i=y(Xt),a=y(Yt),o=y(Jt),s,c;e[0]!==r||e[1]!==t||e[2]!==a||e[3]!==i||e[4]!==o?(s=xe({browserStatus:r,sessionStatus:i,selectionStatus:a,transportStatus:o,e2eeStatus:t}),c=Te(`hosted`,s),e[0]=r,e[1]=t,e[2]=a,e[3]=i,e[4]=o,e[5]=s,e[6]=c):(s=e[5],c=e[6]);let l=c,u=s.guarantee===`e2ee`?`success`:s.guarantee===`web`?`info`:s.guarantee===`legacy`?`warning`:`outline`,d;e[7]!==s.shortLabel||e[8]!==u?(d=(0,Q.jsx)(R,{size:`sm`,variant:u,"data-testid":`node-connection-claim`,children:s.shortLabel}),e[7]=s.shortLabel,e[8]=u,e[9]=d):d=e[9];let f;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Q.jsx)(Se,{}),e[10]=f):f=e[10];let p;e[11]!==t||e[12]!==n?(p=t===`web-unsigned`?(0,Q.jsx)(Gt,{code:n}):null,e[11]=t,e[12]=n,e[13]=p):p=e[13];let m;e[14]===p?m=e[15]:(m=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[f,p]}),e[14]=p,e[15]=m);let h;return e[16]!==l.body||e[17]!==l.headline||e[18]!==d||e[19]!==m?(h=(0,Q.jsx)(V,{title:`This connection`,children:(0,Q.jsx)(H,{title:l.headline,description:l.body,status:d,children:m})}),e[16]=l.body,e[17]=l.headline,e[18]=d,e[19]=m,e[20]=h):h=e[20],h}function Jt(e){return e.transportStatus}function Yt(e){return e.selectionStatus}function Xt(e){return e.sessionStatus}function Zt(e){return e.browserStatus}function Qt(){let e=we(h()),a=typeof window<`u`&&window.desktopBridge!=null,[y,x]=(0,W.useState)(()=>a?`owner`:`checking`),C=Ee(e,y),T=je(e),[P,ae]=(0,W.useState)(Vt),[oe,I]=(0,W.useState)(null),[R,B]=(0,W.useState)(!1),[ve,ye]=(0,W.useState)(null),[U,be]=(0,W.useState)(null),[xe,Se]=(0,W.useState)(null),[G,De]=(0,W.useState)(null),[Oe,Me]=(0,W.useState)(``),K=(0,W.useRef)(!0),Pe=(0,W.useRef)(0),Fe=(0,W.useRef)(null),{copyToClipboard:Ie}=ie();(0,W.useEffect)(()=>(K.current=!0,()=>{K.current=!1}),[]),(0,W.useEffect)(()=>{if(e!==`local`||a)return;let n=!1;return t().then(e=>{n||x(e.authenticated&&e.role===`owner`?`owner`:`client`)}).catch(()=>{n||x(`unavailable`)}),()=>{n=!0}},[a,e]);let Le=(0,W.useCallback)(async()=>{if(!C.available)return;let[e,t,n,r,i,a]=await Promise.allSettled([c(),s(),l(),te(),ee(),ne()]),o={clients:e,sessions:t,policy:n,prekey:r,continuity:i,fallback:a},u=await m().then(e=>e?.fingerprint??null,()=>void 0);if(!K.current)return;let d=Ae(o);Pe.current=d===null?0:Pe.current+1,ae(e=>({...ke(e,o),enrollmentFingerprint:u===void 0?e.enrollmentFingerprint:u})),I(d)},[C.available]);(0,W.useEffect)(()=>{if(!C.available)return;let e=re({lifecycle:v,run:Le,resolveDelayMs:()=>Math.min(zt*2**Math.max(0,Pe.current-1),Bt),jitterRatio:.1});return Fe.current=e,()=>{Fe.current===e&&(Fe.current=null),e.stop()}},[C.available,Le]);let Re=(0,W.useCallback)(()=>Fe.current?.refresh()??Le(),[Le]),q=(0,W.useCallback)(async(e,t)=>{B(!0),I(null),ye(null);try{let n=await e();K.current&&ye(typeof n==`string`?n:t),await Re()}catch(e){if(!K.current)return;I(e instanceof Error?e.message:`That didn't work.`)}finally{K.current&&B(!1)}},[Re]),J=(0,W.useCallback)((e,t,n)=>{Se({copy:ft(e),run:()=>q(t,n)})},[q]),Y=(0,W.useCallback)((e,t,n)=>{Se({copy:e,run:()=>q(t,n)})},[q]),We=(0,W.useCallback)(async t=>{let n=Ne(e,t);if(!n.allowed){I(n.refusal);return}B(!0),I(null),ye(null);try{let e=await r(n.proposal);if(!K.current)return;be({proposal:n.proposal,warnings:it(e,n.proposal,P.policy),destructive:ot(e,n.proposal,P.policy)})}catch(e){if(!K.current)return;I(e instanceof Error?e.message:`Unable to preview that change.`)}finally{K.current&&B(!1)}},[e,P.policy]),Ge=(0,W.useCallback)(async()=>{if(U===null)return;let t=Ne(e,U.proposal);if(!t.allowed){I(t.refusal),be(null);return}let n=t.proposal;be(null),await q(async()=>st(await p(n)),`Policy applied.`)},[e,U,q]),Ke=(0,W.useCallback)((e,t,n,r)=>{let i={fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin,status:r};Y(ht(t,i),()=>g(e),n)},[Y]),$e=(0,W.useCallback)((e,t)=>{let{role:n}=t;Se({copy:kt(n,{fingerprint:e.fingerprint,accountId:e.accountId,hubOrigin:e.hubOrigin,safetyNumber:t.safetyNumber,pendingInPartition:t.pendingInPartition}),run:()=>q(async()=>{await g(e);try{let t=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});return K.current&&De({approval:t,label:e.fingerprint}),`Client approved as ${n}. Scan the code on the new device.`}catch{return`Client approved as ${n}. The QR code was not created; use Show phone QR to retry.`}},`Client approved as ${n}.`)})},[q]),et=(0,W.useCallback)(async e=>{B(!0),I(null);try{let t=await f({hubOrigin:e.hubOrigin,accountId:e.accountId,fingerprint:e.fingerprint});K.current&&De({approval:t,label:e.displayLabel??e.fingerprint})}catch(e){K.current&&I(e instanceof Error?e.message:`Unable to create the phone QR code.`)}finally{K.current&&B(!1)}},[]),tt=ze(P.enrollmentFingerprint),X=(0,W.useMemo)(()=>lt(P.fallback),[P.fallback]),at=qe(P.clients),ct=Ve(P.prekey),dt=Ue(P.continuity),Z=xe?.copy??null,pt=typeof window<`u`&&window.isSecureContext&&navigator.clipboard?.writeText!=null;return(0,Q.jsxs)(_e,{children:[(0,Q.jsx)(ge,{actions:C.available?(0,Q.jsxs)(b,{size:`xs`,variant:`ghost`,className:`text-muted-foreground hover:text-foreground`,disabled:R,onClick:()=>void Re(),children:[(0,Q.jsx)(F,{className:_(`size-3.5`,R&&`animate-spin`)}),`Refresh`]}):null,children:At}),oe===null?null:(0,Q.jsxs)(ce,{variant:`error`,children:[(0,Q.jsx)(S,{}),(0,Q.jsx)(z,{children:`That didn't work`}),(0,Q.jsx)(se,{children:oe})]}),ve?(0,Q.jsxs)(ce,{variant:`info`,children:[(0,Q.jsx)(z,{children:`Done`}),(0,Q.jsx)(se,{children:ve})]}):null,e===`hosted`?(0,Q.jsx)(qt,{}):null,C.available?(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(V,{title:`This node's identity`,children:[(0,Q.jsx)(H,{title:`Enrollment fingerprint`,description:tt.caption,control:tt.fingerprint!==null&&pt?(0,Q.jsxs)(b,{size:`xs`,variant:`outline`,onClick:()=>Ie(tt.fingerprint),children:[(0,Q.jsx)(w,{className:`size-3.5`}),`Copy`]}):null,children:tt.fingerprint===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-enrollment-fingerprint`,className:`pb-3.5 font-mono text-[13px] break-all select-all`,children:tt.fingerprint})}),(0,Q.jsx)(H,{title:`Agreement prekey`,description:ct??`The key this node offers for new channels.`,control:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:R,onClick:()=>J(`rotate-prekey`,i,`Prekey rotated.`),children:`Rotate`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Be(P.prekey)})})}),(0,Q.jsx)(H,{title:`Continuity`,description:dt??`The lineage paired clients remember this node by.`,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:R,onClick:()=>J(`break-continuity`,()=>u({action:`break`}),`Continuity chain broken.`),children:`Break chain`}),(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:R,onClick:()=>J(`remint-continuity`,()=>u({action:`remint`}),`Fresh lineage minted.`),children:`Mint fresh`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:He(P.continuity)})})})]}),(0,Q.jsxs)(V,{title:`Authorized clients`,children:[at.map(e=>(0,Q.jsx)(H,{title:`Pairing`,description:e},e)),(0,Q.jsx)(H,{title:`Pairing window`,description:Xe,control:(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(L,{value:Oe,disabled:R,placeholder:`SHA256:…`,"aria-label":`Pairing window fingerprint`,className:`w-56 font-mono text-xs`,onChange:e=>Me(e.currentTarget.value)}),(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:R||Oe.trim()===``,onClick:()=>Y(gt(Oe.trim()),()=>o({action:`open`,fingerprint:Oe.trim()}),`Pairing window opened.`),children:`Open`}),(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:R||P.clients?.pairingWindow===void 0,onClick:()=>J(`close-window`,()=>o({action:`close`}),`Pairing window closed.`),children:`Close`})]}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:Je(P.clients)})})}),(0,Q.jsx)(H,{title:`Refused attempts`,description:Ye(P.clients),control:(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:R||(P.clients?.refusedPairingAttempts??0)===0,onClick:()=>J(`clear-refusals`,d,`Refusal count cleared.`),children:`Clear`})}),(P.clients?.records??[]).map(e=>(0,Q.jsx)(rn,{record:e,pendingInPartition:Ct(P.clients,e),busy:R,onAuthorize:Ke,onApprove:$e,onShowApprovalQr:et},`${e.hubOrigin}\u0000${e.accountId}\u0000${e.fingerprint}`)),P.clients!==null&&P.clients.records.length===0?(0,Q.jsx)(H,{title:`No client keys on file`,description:Lt}):null]}),(0,Q.jsxs)(V,{title:`Live sessions`,children:[(P.sessions?.sessions??[]).map(e=>(0,Q.jsx)(H,{title:`Session ${e.sessionIndex}`,description:e.tier===`native`?Qe:nt,children:(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[(0,Q.jsx)($,{rows:Ze(e)}),e.tier===`web`?(0,Q.jsx)(Kt,{code:e.verificationCode??null}):null]})},e.sessionIndex)),P.sessions!==null&&P.sessions.sessions.length===0?(0,Q.jsx)(H,{title:`No sessions`,description:Rt}):null]}),(0,Q.jsxs)(V,{title:`Admission policy`,children:[(0,Q.jsx)(tn,{title:jt,description:Mt,checked:P.policy===null?null:P.policy.requireE2EE,busy:R,ariaLabel:`Require E2EE`,testId:`require-e2ee`,onChange:e=>void We({requireE2EE:e})}),(0,Q.jsx)(en,{disposition:T,checked:P.policy===null?null:P.policy.requireApprovedClientE2EE,busy:R,onChange:e=>void We({requireApprovedClientE2EE:e})}),(0,Q.jsx)(H,{title:`Policy generation`,description:Ft,control:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:R,onClick:()=>J(`recover-policy`,n,`Policy generation advanced.`),children:`Advance`}),children:(0,Q.jsx)(`div`,{className:`pb-3.5`,children:(0,Q.jsx)($,{rows:rt(P.policy)})})})]}),(0,Q.jsx)(V,{title:`Fallback`,children:X===null?(0,Q.jsx)(H,{title:`Fallback`,description:`Waiting for the node.`}):X.quiet?(0,Q.jsx)(H,{title:`Nothing has fallen back`,description:ut,control:(0,Q.jsx)(nn,{busy:R,onConfirm:J})}):(0,Q.jsxs)(Q.Fragment,{children:[X.classes.map(e=>(0,Q.jsx)(H,{title:e.label,description:e.meaning,status:`Last ${e.lastOccurrence}${e.ringOverflows>0?` · ${e.ringOverflows} overflow(s)`:``}`,control:(0,Q.jsx)(`span`,{className:`font-mono text-sm font-semibold`,children:e.occurrences})},e.label)),(0,Q.jsx)(H,{title:`Retained occurrences`,description:X.overflowNotice??`Observation window started ${X.windowStarted}.`,control:(0,Q.jsx)(nn,{busy:R,onConfirm:J}),children:(0,Q.jsx)(`ul`,{className:`space-y-1 pb-3.5`,children:X.entries.map(e=>(0,Q.jsxs)(`li`,{className:`font-mono text-[11px] text-muted-foreground`,children:[e.at,` · `,e.reason]},e.ordinal))})}),X.undersizedNotice?(0,Q.jsx)(H,{title:`Undersized connection`,description:X.undersizedNotice}):null]})})]}):(0,Q.jsxs)(V,{title:e===`hosted`?`This node`:`This session`,children:[(0,Q.jsx)(H,{title:Te(e,null).headline,description:C.unavailableBody}),e===`hosted`?(0,Q.jsx)(en,{disposition:T,checked:null,busy:R,onChange:e=>void We({requireApprovedClientE2EE:e})}):null]}),(0,Q.jsx)(he,{open:U!==null,onOpenChange:e=>!e&&be(null),children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(le,{children:[(0,Q.jsx)(me,{children:`Apply this policy change?`}),(0,Q.jsx)(pe,{children:U?.warnings.map(e=>(0,Q.jsx)(`span`,{className:`block pb-2`,children:e},e))})]}),(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Leave it`}),(0,Q.jsx)(b,{variant:U?.destructive?`destructive`:`default`,"data-testid":`policy-apply`,disabled:R,onClick:()=>void Ge(),children:`Apply`})]})]})}),(0,Q.jsx)(he,{open:xe!==null,onOpenChange:e=>!e&&Se(null),children:(0,Q.jsxs)(fe,{children:[(0,Q.jsxs)(le,{children:[(0,Q.jsx)(me,{children:Z?.title}),(0,Q.jsx)(pe,{children:Z?.body})]}),Z?.facts?(0,Q.jsx)(`div`,{"data-testid":`node-confirmation-facts`,className:`pb-1`,children:(0,Q.jsx)($,{rows:Z.facts})}):null,(0,Q.jsxs)(ue,{children:[(0,Q.jsx)(de,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Cancel`}),(0,Q.jsx)(b,{variant:Z?.destructive?`destructive`:`default`,"data-testid":`node-confirmation-confirm`,disabled:R,onClick:()=>{let e=xe;Se(null),e&&e.run()},children:Z?.confirmLabel})]})]})}),(0,Q.jsx)(D,{open:G!==null,onOpenChange:e=>!e&&De(null),children:(0,Q.jsxs)(k,{className:`max-w-sm`,children:[(0,Q.jsxs)(M,{children:[(0,Q.jsx)(j,{children:`Verify this phone`}),(0,Q.jsx)(N,{children:`On the new phone, open node verification and scan this code. It is bound to that phone's key and expires after five minutes.`})]}),(0,Q.jsxs)(O,{className:`space-y-4`,children:[G?(0,Q.jsxs)(`div`,{className:`flex flex-col items-center gap-3`,children:[(0,Q.jsx)(`div`,{className:`rounded-2xl bg-white p-3`,children:(0,Q.jsx)(Ce,{value:G.approval.payload,size:240,level:`M`,marginSize:2,title:`Node approval — scan with Ryco on the new phone`})}),(0,Q.jsx)(`p`,{className:`max-w-full break-all text-center font-mono text-[11px] text-muted-foreground`,children:G.label})]}):null,(0,Q.jsx)(`p`,{className:`text-xs leading-relaxed text-muted-foreground`,children:`The code contains no secret and grants no access by itself. Ryco will reconnect and prove both device keys after the scan.`})]}),(0,Q.jsx)(E,{variant:`bare`,children:(0,Q.jsx)(A,{render:(0,Q.jsx)(b,{variant:`outline`}),children:`Done`})})]})})]})}function $t(){let e=(0,G.c)(7),t=C();if(t&&!t.primary){let n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(S,{}),e[0]=n):n=e[0];let r;e[1]===t.nodeLabel?r=e[2]:(r=(0,Q.jsxs)(z,{children:[`Open Security on `,t.nodeLabel]}),e[1]=t.nodeLabel,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Q.jsx)(se,{children:`Security administration requires that node's direct local operator channel. Ryco has disabled these controls here so an action can never be applied to this Mac by mistake.`}),e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a=(0,Q.jsx)(_e,{children:(0,Q.jsxs)(ce,{variant:`warning`,children:[n,r,i]})}),e[4]=r,e[5]=a),a}let n;return e[6]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Qt,{}),e[6]=n):n=e[6],n}function en(e){let t=(0,G.c)(6),{disposition:n,checked:r,busy:i,onChange:a}=e,o=n.kind===`blocked`,s=n.kind===`blocked`?n.reason:Pt,c;return t[0]!==o||t[1]!==i||t[2]!==r||t[3]!==a||t[4]!==s?(c=(0,Q.jsx)(tn,{title:Nt,description:s,checked:r,busy:i,blocked:o,ariaLabel:`Require approved client E2EE`,testId:`require-approved-client-e2ee`,onChange:a}),t[0]=o,t[1]=i,t[2]=r,t[3]=a,t[4]=s,t[5]=c):c=t[5],c}function tn(e){let t=(0,G.c)(11),{title:n,description:r,checked:i,busy:a,blocked:o,ariaLabel:s,testId:c,onChange:l}=e,u=o!==void 0&&o,d=i===null?`${r} ${It}`:r,f;t[0]!==s||t[1]!==u||t[2]!==a||t[3]!==i||t[4]!==l||t[5]!==c?(f=i===null?(0,Q.jsx)(`span`,{"data-testid":c,"data-policy":`unknown`,"data-blocked":u?`hosted`:void 0,className:`text-[11px] text-muted-foreground`,children:`unknown`}):(0,Q.jsx)(B,{checked:i,disabled:u||a,"aria-label":s,"data-testid":c,"data-policy":String(i),"data-blocked":u?`hosted`:void 0,onCheckedChange:l}),t[0]=s,t[1]=u,t[2]=a,t[3]=i,t[4]=l,t[5]=c,t[6]=f):f=t[6];let p;return t[7]!==d||t[8]!==f||t[9]!==n?(p=(0,Q.jsx)(H,{title:n,description:d,control:f}),t[7]=d,t[8]=f,t[9]=n,t[10]=p):p=t[10],p}function nn(e){let t=(0,G.c)(5),{busy:n,onConfirm:r}=e,i;t[0]===r?i=t[1]:(i=()=>r(`reset-fallback`,a,`Fallback counters reset.`),t[0]=r,t[1]=i);let o;return t[2]!==n||t[3]!==i?(o=(0,Q.jsx)(b,{size:`xs`,variant:`outline`,disabled:n,onClick:i,children:`Reset`}),t[2]=n,t[3]=i,t[4]=o):o=t[4],o}function rn(e){let t=(0,G.c)(86),{record:n,pendingInPartition:r,busy:i,onAuthorize:a,onApprove:o,onShowApprovalQr:s}=e,c;t[0]!==n.accountId||t[1]!==n.fingerprint||t[2]!==n.hubOrigin?(c={hubOrigin:n.hubOrigin,accountId:n.accountId,fingerprint:n.fingerprint},t[0]=n.accountId,t[1]=n.fingerprint,t[2]=n.hubOrigin,t[3]=c):c=t[3];let l=c,u;t[4]===n.status?u=t[5]:(u=We(n.status),t[4]=n.status,t[5]=u);let d=u,f;t[6]===n?f=t[7]:(f=yt(n),t[6]=n,t[7]=f);let p=f,m;t[8]===n?m=t[9]:(m=St(n),t[8]=n,t[9]=m);let h=m,g;t[10]===r?g=t[11]:(g=wt(r),t[10]=r,t[11]=g);let ee=g,[te,ne]=(0,W.useState)(null),_=te!==null&&te.status===n.status&&te.safetyNumber===n.safetyNumber;te!==null&&!_&&ne(null);let re;t[12]!==p||t[13]!==n.safetyNumber?(re=p!==null&&Re(n.safetyNumber)!==null,t[12]=p,t[13]=n.safetyNumber,t[14]=re):re=t[14];let v=re,y;t[15]===n?y=t[16]:(y=Ge(n),t[15]=n,t[16]=y);let ie=d===`success`?`success`:d,x;t[17]!==n.status||t[18]!==ie?(x=(0,Q.jsx)(R,{size:`sm`,variant:ie,children:n.status}),t[17]=n.status,t[18]=ie,t[19]=x):x=t[19];let S;t[20]!==y||t[21]!==x?(S=(0,Q.jsxs)(`span`,{className:`flex items-center gap-2`,children:[y,x]}),t[20]=y,t[21]=x,t[22]=S):S=t[22];let C=`${n.accountId} at ${n.hubOrigin}`,w;t[23]!==p||t[24]!==i||t[25]!==v||t[26]!==l||t[27]!==_||t[28]!==o||t[29]!==r||t[30]!==n.safetyNumber?(w=p===null||!v||!_?null:(0,Q.jsxs)(b,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>o({...l,action:`approve`,maxRole:p,capabilitySet:Dt},{role:p,safetyNumber:n.safetyNumber,pendingInPartition:r}),children:[`Approve as `,p]}),t[23]=p,t[24]=i,t[25]=v,t[26]=l,t[27]=_,t[28]=o,t[29]=r,t[30]=n.safetyNumber,t[31]=w):w=t[31];let T;t[32]!==i||t[33]!==l||t[34]!==a||t[35]!==n?(T=Tt(n,`viewer`)?(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:i,onClick:()=>a({...l,action:`narrow`,maxRole:`viewer`},`narrow`,`Authority reduced.`,n.status),children:`Reduce to viewer`}):null,t[32]=i,t[33]=l,t[34]=a,t[35]=n,t[36]=T):T=t[36];let E;t[37]!==i||t[38]!==s||t[39]!==n?(E=n.status===`approved`?(0,Q.jsxs)(b,{size:`xs`,variant:`outline`,disabled:i,onClick:()=>s(n),children:[(0,Q.jsx)(oe,{className:`size-3.5`}),`Show phone QR`]}):null,t[37]=i,t[38]=s,t[39]=n,t[40]=E):E=t[40];let D;t[41]!==i||t[42]!==l||t[43]!==a||t[44]!==n.status?(D=n.status===`revoked`?null:(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:i,onClick:()=>a({...l,action:`revoke`},`revoke`,`Client revoked.`,n.status),children:`Revoke`}),t[41]=i,t[42]=l,t[43]=a,t[44]=n.status,t[45]=D):D=t[45];let O;t[46]!==l||t[47]!==a||t[48]!==n.status?(O=()=>a({...l,action:`purge`},`purge`,`Record deleted.`,n.status),t[46]=l,t[47]=a,t[48]=n.status,t[49]=O):O=t[49];let k;t[50]!==i||t[51]!==O?(k=(0,Q.jsx)(b,{size:`xs`,variant:`destructive-outline`,disabled:i,onClick:O,children:`Delete`}),t[50]=i,t[51]=O,t[52]=k):k=t[52];let A;t[53]!==w||t[54]!==T||t[55]!==E||t[56]!==D||t[57]!==k?(A=(0,Q.jsxs)(Q.Fragment,{children:[w,T,E,D,k]}),t[53]=w,t[54]=T,t[55]=E,t[56]=D,t[57]=k,t[58]=A):A=t[58];let j;t[59]===n?j=t[60]:(j=Ke(n),t[59]=n,t[60]=j);let M;t[61]===j?M=t[62]:(M=(0,Q.jsx)($,{rows:j}),t[61]=j,t[62]=M);let N;t[63]===h?N=t[64]:(N=h===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-approval-withheld`,className:`text-[11px] leading-relaxed text-muted-foreground`,children:h}),t[63]=h,t[64]=N);let P;t[65]===ee?P=t[66]:(P=ee===null?null:(0,Q.jsx)(`p`,{"data-testid":`node-pending-partition-warning`,className:`text-[11px] leading-relaxed font-medium text-warning`,children:ee}),t[65]=ee,t[66]=P);let F;t[67]===n.safetyNumber?F=t[68]:(F=(0,Q.jsx)(Ut,{value:n.safetyNumber}),t[67]=n.safetyNumber,t[68]=F);let I;t[69]!==i||t[70]!==v||t[71]!==_||t[72]!==n.safetyNumber||t[73]!==n.status?(I=v?(0,Q.jsxs)(`label`,{"data-testid":`node-safety-number-match`,className:`flex items-start gap-2`,children:[(0,Q.jsx)(ae,{className:`mt-0.5`,checked:_,disabled:i,onCheckedChange:e=>ne(e===!0?{status:n.status,safetyNumber:n.safetyNumber}:null)}),(0,Q.jsxs)(`span`,{className:`space-y-0.5`,children:[(0,Q.jsx)(`span`,{className:`block text-[12px] font-medium`,children:Ie}),(0,Q.jsx)(`span`,{className:`block text-[11px] leading-relaxed text-muted-foreground`,children:Le})]})]}):null,t[69]=i,t[70]=v,t[71]=_,t[72]=n.safetyNumber,t[73]=n.status,t[74]=I):I=t[74];let L;t[75]!==M||t[76]!==N||t[77]!==P||t[78]!==F||t[79]!==I?(L=(0,Q.jsxs)(`div`,{className:`space-y-3 pb-3.5`,children:[M,N,P,F,I]}),t[75]=M,t[76]=N,t[77]=P,t[78]=F,t[79]=I,t[80]=L):L=t[80];let z;return t[81]!==S||t[82]!==C||t[83]!==A||t[84]!==L?(z=(0,Q.jsx)(H,{title:S,description:C,control:A,children:L}),t[81]=S,t[82]=C,t[83]=A,t[84]=L,t[85]=z):z=t[85],z}export{$t as NodeSecuritySettings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Au as t,Cu as n,Fu as r,Hu as i,Il as a,Iu as o,Lc as s,Lu as c,Mc as l,Ml as u,Mu as d,Ou as f,Pu as p,Rc as m,Rl as ee,Sc as te,Su as h,Tu as ne,Uu as g,Wc as _,Wu as re,bu as v,cc as y,hc as b,jc as x,jl as ie,ju as ae,lu as S,mc as oe,mu as se,nc as C,qu as w,sc as T,su as E,tl as D,uu as ce,vu as le,wc as O,wu as ue,yu as de}from"./runtime-DjjjAcTE.js";import{t as k}from"./react-CwJFpaho.js";var A=e(k(),1);function j(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...j(e,t.id,n)])}function fe(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function M(){return!1}function pe(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function N(e,r={}){let{enabled:i=!0,escapeKey:o=!0,outsidePress:s=!0,outsidePressEvent:g=`sloppy`,referencePress:_=M,bubbles:re,externalTree:v}=r,x=`rootStore`in e?e.rootStore:e,C=x.useState(`open`),w=x.useState(`floatingElement`),{dataRef:T,events:E}=x.context,D=y(v),O=c(typeof s==`function`?s:()=>!1),k=typeof s==`function`?O:s,fe=k!==!1,N=c(()=>g),{escapeKey:P,outsidePress:me}=pe(re),F=A.useRef(!1),I=A.useRef(!1),L=A.useRef(!1),R=A.useRef(!1),z=A.useRef(!1),B=A.useRef(``),V=A.useRef(null),H=de(),U=de(),W=c(()=>{U.clear(),T.current.insideReactTree=!1}),G=c(e=>{let t=T.current.floatingContext?.nodeId;return(D?j(D.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),K=c(e=>a(e,x.select(`floatingElement`))||a(e,x.select(`domReferenceElement`))),q=c(e=>{_()&&x.setOpen(!1,b(m,e.nativeEvent))}),J=c(e=>{if(!C||!i||!o||e.key!==`Escape`||z.current||!P&&G(`__escapeKeyBubbles`))return;let t=ie(e)?e.nativeEvent:e,n=b(te,t);x.setOpen(!1,n),n.isCanceled||e.preventDefault(),!P&&!n.isPropagationAllowed&&e.stopPropagation()}),Y=c(()=>{T.current.insideReactTree=!0,U.start(0,W)}),X=c(e=>{if(!C||!i||e.button!==0)return;let t=ce(e.nativeEvent);S(x.select(`floatingElement`),t)&&(F.current||(F.current=!0,I.current=!1))}),Z=c(e=>{C&&i&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&F.current&&(I.current=!0)});A.useEffect(()=>{function e(e){e.open||(R.current=!1)}return E.on(`openchange`,e),()=>{E.off(`openchange`,e)}},[E]),A.useEffect(()=>{if(!C||!i)return C||(R.current=!1),W;T.current.__escapeKeyBubbles=P,T.current.__outsidePressBubbles=me;let e=new le,r=new le,s=n(w);function c(){e.clear(),z.current=!0}function m(){e.start(se?5:0,()=>{z.current=!1})}function te(){L.current=!0,r.start(0,()=>{L.current=!1})}function g(){F.current=!1,I.current=!1}function _(){let e=B.current,t=e===`pen`||!e?`mouse`:e,n=N(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function re(e){let t=_();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function v(e){let t=T.current.floatingContext?.nodeId,n=D&&j(D.nodesRef.current,t).some(t=>a(e,t.context?.elements.floating));return K(e)||n}function y(e){if(re(e)){e.type!==`click`&&!K(e)&&(r.clear(),L.current=!1),W();return}if(T.current.insideReactTree){W();return}let i=ce(e),a=`[${oe(`inert`)}]`,o=t(i)?i.getRootNode():null,s=Array.from((p(o)?o:n(x.select(`floatingElement`))).querySelectorAll(a)),c=x.context.triggerElements;if(i&&(c.hasElement(i)||c.hasMatchingElement(e=>S(e,i))))return;let m=t(i)?i:null;for(;m&&!d(m);){let e=f(m);if(d(e)||!t(e))break;m=e}if(!(s.length&&t(i)&&!ee(i)&&!S(i,x.select(`floatingElement`))&&s.every(e=>!S(m,e)))){if(ae(i)&&!(`touches`in e)){let t=d(i),n=ne(i),r=/auto|scroll/,a=t||r.test(n.overflowX),o=t||r.test(n.overflowY),s=a&&i.clientWidth>0&&i.scrollWidth>i.clientWidth,c=o&&i.clientHeight>0&&i.scrollHeight>i.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=i.offsetWidth-i.clientWidth:e.offsetX>i.clientWidth),f=s&&e.offsetY>i.clientHeight;if(u||f)return}if(!v(e)){if(_()===`intentional`){if(e.detail!==0&&!u(e)&&!R.current)return;if(L.current){r.clear(),L.current=!1;return}}(typeof k!=`function`||k(e))&&(G(`__outsidePressBubbles`)||(x.setOpen(!1,b(l,e)),W()))}}}function ie(e){_()===`sloppy`&&e.pointerType!==`touch`&&x.select(`open`)&&i&&!K(e)&&y(e)}function E(e){if(_()!==`sloppy`||!x.select(`open`)||!i||K(e))return;let t=e.touches[0];t&&(V.current={startTime:Date.now(),startX:t.clientX,startY:t.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},H.start(1e3,()=>{V.current&&(V.current.dismissOnTouchEnd=!1,V.current.dismissOnMouseDown=!1)}))}function O(e,t){let n=ce(e);if(!n)return;let r=h(n,e.type,()=>{t(e),r()})}function de(e){B.current=`touch`,O(e,E)}function A(e){H.clear(),e.type===`pointerdown`&&(e.button===0&&(R.current=!0),B.current=e.pointerType),(e.type!==`mousedown`||!V.current||V.current.dismissOnMouseDown)&&O(e,e=>{e.type===`pointerdown`?ie(e):y(e)})}function M(e){if(e.type===`pointercancel`&&(R.current=!1),!F.current)return;let t=I.current;if(g(),_()===`intentional`){if(e.type===`pointercancel`){t&&te();return}if(!v(e)){if(t){te();return}(typeof k!=`function`||k(e))&&(r.clear(),L.current=!0,W())}}}function pe(e){if(_()!==`sloppy`||!V.current||K(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-V.current.startX),r=Math.abs(t.clientY-V.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(V.current.dismissOnTouchEnd=!0),i>10&&(y(e),H.clear(),V.current=null)}function U(e){O(e,pe)}function q(e){_()===`sloppy`&&V.current&&!K(e)&&(V.current.dismissOnTouchEnd&&y(e),H.clear(),V.current=null)}function Y(e){O(e,q)}let X=ue(o&&ue(h(s,`keydown`,J),h(s,`compositionstart`,c),h(s,`compositionend`,m)),fe&&ue(h(s,`click`,A,!0),h(s,`pointerdown`,A,!0),h(s,`pointerup`,M,!0),h(s,`pointercancel`,M,!0),h(s,`mousedown`,A,!0),h(s,`mouseup`,M,!0),h(s,`touchstart`,de,{capture:!0,passive:!0}),h(s,`touchmove`,U,{capture:!0,passive:!0}),h(s,`touchend`,Y,{capture:!0,passive:!0})));return()=>{X(),e.clear(),r.clear(),g(),L.current=!1,W()}},[T,w,o,fe,k,C,i,P,me,J,W,N,G,K,D,x,H]);let Q=A.useMemo(()=>({onKeyDown:J,onPointerDown:q,onClick:q}),[J,q]),$=A.useMemo(()=>({onKeyDown:J,onPointerDown:Z,onMouseDown:Z,onClickCapture:Y,onMouseDownCapture(e){Y(),X(e)},onPointerDownCapture(e){Y(),X(e)},onMouseUpCapture:Y,onTouchEndCapture:Y,onTouchMoveCapture:Y}),[J,Y,X,Z]);return A.useMemo(()=>i?{reference:Q,floating:$,trigger:Q}:{},[i,Q,$])}var P=class{attachedStores=[];attachedStoreValue=null;storeListeners=new Set;constructor(e,t,n=!0){this.fallbackStore=e,this.componentName=t,this.throwOnMissingTrigger=n}get attachedStore(){return this.attachedStoreValue}get store(){return this.attachedStoreValue??this.fallbackStore}get serverStore(){return this.fallbackStore}subscribeStore(e){return this.storeListeners.add(e),()=>{this.storeListeners.delete(e)}}attachStore(e){return this.attachedStores.push(e),this.setActiveStore(e),()=>{let t=this.attachedStores.lastIndexOf(e);t!==-1&&this.attachedStores.splice(t,1),this.setActiveStore(this.attachedStores[this.attachedStores.length-1]??null)}}setActiveStore(e){this.attachedStoreValue!==e&&(this.attachedStoreValue=e,this.storeListeners.forEach(e=>{e()}))}openByTrigger(e){let t=this.attachedStore;if(t===null)return;let n;if(e){for(let t=this.attachedStores.length-1;t>=0&&!n;--t)n=this.attachedStores[t].context.triggerElements.getById(e);n??=this.fallbackStore.context.triggerElements.getById(e)}if(e&&!n&&this.throwOnMissingTrigger)throw Error(i(99,this.componentName,e,this.componentName));t.setOpen(!0,b(O,void 0,n))}closePopup(){let e=this.attachedStore;e!==null&&e.setOpen(!1,b(O))}},me=e(r(),1);function F(e){let{popupStore:n,treatPopupAsFloatingElement:r=!1,floatingRootContext:i,floatingId:a,nested:o,onOpenChange:s}=e,c=n.useState(`open`),l=n.useState(`activeTriggerElement`),u=n.useState(r?`popupElement`:`positionerElement`),d=n.context.triggerElements,f=s,p=A.useRef(null);i===void 0&&p.current===null&&(p.current=new C({open:c,transitionStatus:void 0,referenceElement:l,floatingElement:u,triggerElements:d,onOpenChange:f,floatingId:a,syncOnly:!0,nested:o}));let m=i??p.current;return n.useSyncedValue(`floatingId`,a),g(()=>{let e={open:c,floatingId:a,referenceElement:l,floatingElement:u};t(l)&&(e.domReferenceElement=l),m.state.positionReference===m.state.referenceElement&&(e.positionReference=l),m.update(e)},[c,a,l,u,m]),m.context.onOpenChange=f,m.context.nested=o,m}function I(e,t=!1,n=!1,r=!1){let[i,a]=A.useState(e&&t?`idle`:void 0),[o,s]=A.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),g(()=>{if(!e&&o&&i!==`ending`&&n){let e=v.request(()=>{a(`ending`)});return()=>{v.cancel(e)}}},[e,o,i,n]),g(()=>{if(!e||t)return;let n=v.request(()=>{a(void 0)});return()=>{v.cancel(n)}},[t,e]),g(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=v.request(()=>{a(`idle`)});return()=>{v.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}var L={tabIndex:-1,[E]:``};function R(e){return t=>t!==`touch`||e.current}function z(e,t=!1){let n=_(),r=T()!=null,i=re(()=>e(n,r)).current;return F({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function B({handle:e,store:t}){return g(()=>e.attachStore(t),[e,t]),null}function V(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function H(e,t){let n=A.useRef(null);return c(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),V(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),V(t))})}function U(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s}}function W(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function G(e,t,n,r={}){let i=n.reason,a=i===s,o=t&&i===`trigger-focus`,c=!t&&(i===`trigger-press`||i===`escape-key`),l=W(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let u=()=>{let i=U(e.state,t,n.trigger,l()),s={...r.extraState,...i};o?s.instantType=`focus`:c?s.instantType=`dismiss`:a&&(s.instantType=void 0),e.update(s)};a?me.flushSync(u):u()}function K(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=H(e,n),o=c(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e);return}if(a==null&&i){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=c(e=>{a(e),e&&o(e)});return g(()=>(s(t.current),()=>s(null)),[s,t,n,e]),g(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function q(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=A.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);g(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=b(x);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function J(e,t,n,r){let{mounted:i,setMounted:a,transitionStatus:o}=I(e,!1,!1,r),s=t.useState(`preventUnmountingOnClose`),l=!e&&s;t.useSyncedValues({mounted:i,transitionStatus:o,preventUnmountingOnClose:l});let u=c(()=>{a(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return D({enabled:i&&!e&&!l,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:o}}function Y(e,t){e.useSyncedValues(t),g(()=>()=>{e.update({activeTriggerProps:w,inactiveTriggerProps:w,popupProps:w})},[e])}function X(e,t){g(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),g(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}function Z(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new C({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:w,inactiveTriggerProps:w,popupProps:w}}var Q=e=>e.triggerIdProp??e.activeTriggerId,$=e=>e.openProp??e.open,he=e=>(e.popupElement?.id??e.floatingId)||void 0;function ge(e,t){return t!==void 0&&$(e)&&Q(e)===t}function _e(e,t){return ge(e,t)?!0:t!==void 0&&$(e)&&Q(e)==null&&e.triggerCount===1}var ve={open:$,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Q,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:he,isTriggerActive:(e,t)=>t!==void 0&&Q(e)===t,isOpenedByTrigger:(e,t)=>ge(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Q(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>_e(e,t)?he(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function ye(e){return _(e,`base-ui`)}var be=class extends o{setState(e){}update(e){}set(e,t){}notifyAll(){}};export{j as C,fe as S,H as _,L as a,P as b,W as c,q as d,J as f,K as g,X as h,ve as i,R as l,z as m,ye as n,B as o,Y as p,Z as r,G as s,be as t,U as u,I as v,N as x,F as y};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Dt as t}from"./primary-Cf-xJExj.js";import{Gi as n,l as r}from"./wsTransport-C88seBPA.js";import{Cs as i,J as a,Mt as o,Zi as s,Zr as c,ad as l}from"./runtime-DjjjAcTE.js";import{t as u}from"./react-CwJFpaho.js";import{Mt as d}from"./sliding-tabs-BnDSjRU3.js";import{A as f,D as p,M as m,N as h,P as g,Q as _,j as v,k as y}from"./popover-OWEv6cQz.js";import{E as b}from"./useSidebarThreadActions-n6EkLATf.js";import{t as x}from"./folder-open-DcMymvp1.js";import{r as S}from"./capabilities-CfOhq009.js";import{p as C}from"./desktopUpdateAtoms-BjrLa3tl.js";import{r as w}from"./providerStatus-CDPaqb0S.js";import{r as T}from"./providerDriverMeta-BHHL9uw0.js";var E=e(u(),1),D=l(),O={providers:`Providers`,project:`Project`,tour:`Quick tour`},k={codex:`https://github.com/saka-gg/ryco/blob/main/docs/providers/codex.md`,claudeAgent:`https://github.com/saka-gg/ryco/blob/main/docs/providers/claude.md`};function A({environmentId:e,providers:l,projectCount:u,ready:A,connectionGeneration:j,open:M,onComplete:N}){let[P,F]=(0,E.useState)(`providers`),[I,L]=(0,E.useState)(!1),[R,z]=(0,E.useState)(null),B=(0,E.useRef)(!1),V=(0,E.useRef)(0),H=S(r.serverRefreshProviders),U=S(r.serverUpdateSettings),W=S(r.projectsAdd),G=C.indexOf(P);(0,E.useEffect)(()=>(V.current+=1,B.current=!1,L(!1),z(null),()=>{V.current+=1}),[j,e,A]);let K=async()=>{if(!A||!H.allowed||B.current)return;let r=c(e);if(!r?.server){z(`This machine is unavailable. Wait for it to reconnect, then refresh.`);return}let i=V.current,a=()=>{let t=n(e);return i===V.current&&t.phase===`connected`&&t.connectedAt===j};B.current=!0,L(!0),z(null);try{let e=await r.server.refreshProviders();a()&&t(e)}catch{a()&&z(`Provider discovery failed. Try refreshing again or open Provider settings.`)}finally{i===V.current&&(B.current=!1,L(!1))}};return(0,D.jsx)(p,{open:M,onOpenChange:e=>{e||N(`skipped`)},children:(0,D.jsxs)(h,{className:`max-w-2xl`,bottomStickOnMobile:!1,children:[(0,D.jsxs)(v,{children:[(0,D.jsxs)(`p`,{className:`text-xs font-medium tracking-wide text-muted-foreground`,children:[`WELCOME TO RYCO · `,G+1,` OF 3`]}),(0,D.jsx)(g,{children:P===`providers`?`Bring your coding agent`:P===`project`?`Choose a place to work`:`Your first task, in three moves`}),(0,D.jsx)(y,{children:P===`providers`?`Ryco uses the providers on this machine. Set one up now or come back later.`:P===`project`?`Add an existing folder or use the project picker to create or clone a project.`:`You’re ready to start. These essentials are always within reach.`}),(0,D.jsx)(`ol`,{"aria-label":`Setup progress`,className:`mt-2 flex gap-5 text-xs text-muted-foreground`,children:C.map((e,t)=>(0,D.jsxs)(`li`,{"aria-current":P===e?`step`:void 0,className:P===e?`font-semibold text-foreground`:``,children:[t+1,`. `,O[e]]},e))})]}),(0,D.jsxs)(m,{className:`space-y-4`,children:[!A&&(0,D.jsx)(`p`,{role:`status`,className:`rounded-lg border p-3 text-sm text-muted-foreground`,children:`Reconnecting to this machine. Setup actions will be available when its current workspace is ready.`}),P===`providers`&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsxs)(`ul`,{"aria-label":`Detected providers`,className:`divide-y rounded-xl border px-4`,children:[l.map(e=>{let t=e.availability===`unavailable`?{headline:`Driver unavailable`}:w(e),n=T.find(t=>t.value===e.driver),r=e.displayName??n?.label??e.driver,i=k[e.driver];return(0,D.jsxs)(`li`,{className:`flex items-start justify-between gap-4 py-3`,children:[(0,D.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,D.jsx)(`p`,{className:`text-sm font-medium`,children:r}),(0,D.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[t.headline,e.enabled&&e.installed&&e.auth.status===`unknown`?` · Authentication not verified`:``]})]}),i&&(0,D.jsxs)(`a`,{href:i,target:`_blank`,rel:`noreferrer`,className:`shrink-0 text-xs underline underline-offset-4`,children:[`Setup guide`,(0,D.jsxs)(`span`,{className:`sr-only`,children:[` for `,r]})]})]},e.instanceId)}),l.length===0&&(0,D.jsx)(`li`,{className:`py-4 text-sm text-muted-foreground`,children:`No provider status yet. Refresh discovery or add an instance in Provider settings.`})]}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`Install and sign in with your provider’s own CLI on this machine, then refresh. Use Provider settings for custom binary paths, separate accounts, or API keys.`}),(0,D.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,D.jsx)(s,{variant:`outline`,disabled:!A||I||!H.allowed,onClick:()=>void K(),children:I?`Checking providers…`:`Refresh discovery`}),(0,D.jsx)(s,{variant:`ghost`,disabled:!A||!U.allowed,onClick:()=>a.getState().openSettings(`providers`,e),children:`Provider settings`})]}),R&&(0,D.jsx)(`p`,{role:`alert`,className:`text-sm text-destructive`,children:R})]}),P===`project`&&(0,D.jsxs)(`div`,{className:`space-y-5 py-5`,children:[(0,D.jsx)(x,{className:`size-9 text-muted-foreground`,"aria-hidden":!0}),(0,D.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:`The project picker handles folders, Git repositories, and existing projects. Close it to return here; your setup progress stays in place.`}),u>0&&(0,D.jsxs)(`p`,{role:`status`,className:`flex items-center gap-2 text-sm`,children:[(0,D.jsx)(i,{"aria-hidden":!0,className:`size-4`}),u===1?`Your project is ready.`:`${u} projects are ready.`]}),(0,D.jsx)(s,{disabled:!A||!W.allowed,onClick:()=>o.getState().openAddProject(),children:`Add project`}),(0,D.jsx)(s,{variant:`outline`,disabled:!A,onClick:()=>a.getState().openSettings(`general`,e),children:`Import Codex or Claude conversations`})]}),P===`tour`&&(0,D.jsx)(`ol`,{className:`divide-y`,children:[{icon:d,title:`Start a task`,text:`Choose a project, open a new task, and pick your provider and model before sending a request.`},{icon:_,title:`Review the work`,text:`Follow the conversation, answer approval requests, and inspect changes in the workspace panel.`},{icon:b,title:`Make it yours`,text:`Use Settings for providers and preferences. Replay this tour from This app or This browser → General.`}].map(({icon:e,title:t,text:n})=>(0,D.jsxs)(`li`,{className:`flex gap-4 py-5`,children:[(0,D.jsx)(e,{"aria-hidden":!0,className:`mt-0.5 size-5 shrink-0 text-muted-foreground`}),(0,D.jsxs)(`div`,{children:[(0,D.jsx)(`h3`,{className:`text-sm font-medium`,children:t}),(0,D.jsx)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:n})]})]},t))})]}),(0,D.jsxs)(f,{children:[(0,D.jsx)(s,{variant:`ghost`,className:`sm:mr-auto`,onClick:()=>N(`skipped`),children:`Skip setup`}),G>0&&(0,D.jsx)(s,{variant:`outline`,onClick:()=>F(C[G-1]),children:`Back`}),(0,D.jsx)(s,{onClick:()=>P===`tour`?N(`completed`):F(C[G+1]),children:P===`tour`?`Finish setup`:`Continue`})]})]})})}export{A as OnboardingDialog};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./rolldown-runtime-hePW80VL.js";import"./wsTransport-C88seBPA.js";import{Bi as t,Gi as n,Vi as r,Zi as i,Zr as a,ad as o,bs as s,id as c,si as l,ys as u}from"./runtime-DjjjAcTE.js";import{t as d}from"./react-CwJFpaho.js";import{i as f}from"./presentationTier-DPVAxTK4.js";import{a as p,r as m,t as h}from"./tooltip-DbqhseXd.js";import{n as g,t as _}from"./external-link-CJeVJZ7s.js";import{n as v,t as y}from"./tokenModePresentation-umDRm4k1.js";import{t as b}from"./download-TvtXS4hE.js";import{t as ee}from"./loader-3vQnfqIT.js";import{t as te}from"./refresh-cw-CRUTivd6.js";import{t as x}from"./toastHelpers-CSQRKo4F.js";import{a as ne,c as S,i as C,o as re,s as ie,t as ae}from"./select-Cb9FUPHD.js";import{d as oe,i as se,l as ce,u as le}from"./settingsLayout-CRFNCk_D.js";var ue=f(),w=e(d(),1),T=o();function E(e){return`${e.pluginId}:${e.targetKind}:${e.providerInstanceId??`global`}`}function de(e){switch(e.state){case`installed`:return`Installed`;case`not-installed`:return`Not installed`;case`unsupported`:return`Unsupported`;case`error`:return`Error`}}function D(e){switch(e.state){case`installed`:return`success`;case`not-installed`:return`outline`;case`unsupported`:return`warning`;case`error`:return`error`}}function fe(e){switch(e.state){case`installed`:return(0,T.jsx)(u,{className:`size-3.5 text-success-foreground`});case`not-installed`:return(0,T.jsx)(g,{className:`size-3.5 text-muted-foreground`});case`unsupported`:case`error`:return(0,T.jsx)(s,{className:`size-3.5 text-warning-foreground`})}}function pe(e){return e.targetKind===`global`?`System`:e.providerDisplayName??String(e.providerInstanceId??`Provider`)}function me(e){return e.impact===`tool-output`?`Tool output`:`Assistant output`}function he(e){return e.scope===`global`?`Global`:`Provider`}function ge(e){switch(e){case`rtk`:return 0;case`caveman`:return 1;case`token-optimizer`:return 2;case`token-savior`:return 3;case`lean-ctx`:return 4}}function O(e){return`${e.targetKind===`global`?`0`:`1`}:${pe(e).toLowerCase()}`}function _e(e){let t=(0,ue.c)(36),{status:n,isInstalling:r,onInstall:a}=e,o=n.canInstall&&n.state!==`installed`,s;t[0]===n?s=t[1]:(s=fe(n),t[0]=n,t[1]=s);let c;t[2]===n?c=t[3]:(c=pe(n),t[2]=n,t[3]=c);let l;t[4]===c?l=t[5]:(l=(0,T.jsx)(`span`,{className:`truncate text-[13px] font-medium text-foreground`,children:c}),t[4]=c,t[5]=l);let u;t[6]===n?u=t[7]:(u=D(n),t[6]=n,t[7]=u);let d;t[8]===n?d=t[9]:(d=de(n),t[8]=n,t[9]=d);let f;t[10]!==u||t[11]!==d?(f=(0,T.jsx)(S,{variant:u,size:`sm`,children:d}),t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]===n.version?p=t[14]:(p=n.version?(0,T.jsx)(`span`,{className:`font-mono text-[11px] text-muted-foreground/70`,children:n.version}):null,t[13]=n.version,t[14]=p);let m;t[15]!==s||t[16]!==l||t[17]!==f||t[18]!==p?(m=(0,T.jsxs)(`div`,{className:`flex min-h-5 flex-wrap items-center gap-2`,children:[s,l,f,p]}),t[15]=s,t[16]=l,t[17]=f,t[18]=p,t[19]=m):m=t[19];let h;t[20]===n.detail?h=t[21]:(h=n.detail?(0,T.jsx)(`p`,{className:`max-w-2xl text-xs leading-relaxed text-muted-foreground/80`,children:n.detail}):null,t[20]=n.detail,t[21]=h);let g;t[22]===n.manualSteps?g=t[23]:(g=n.manualSteps.length>0?(0,T.jsx)(`div`,{className:`space-y-1 pt-1`,children:n.manualSteps.map(k)}):null,t[22]=n.manualSteps,t[23]=g);let _;t[24]!==g||t[25]!==m||t[26]!==h?(_=(0,T.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[m,h,g]}),t[24]=g,t[25]=m,t[26]=h,t[27]=_):_=t[27];let v;t[28]!==o||t[29]!==r||t[30]!==a||t[31]!==n?(v=o?(0,T.jsxs)(i,{size:`xs`,variant:`outline`,disabled:r,className:`self-start sm:self-auto`,onClick:()=>a(n),children:[r?(0,T.jsx)(ee,{className:`size-3.5 animate-spin`}):(0,T.jsx)(b,{className:`size-3.5`}),`Install`]}):null,t[28]=o,t[29]=r,t[30]=a,t[31]=n,t[32]=v):v=t[32];let y;return t[33]!==_||t[34]!==v?(y=(0,T.jsxs)(`div`,{className:`flex flex-col gap-3 border-t border-border/60 py-3 first:border-t-0 sm:flex-row sm:items-center sm:justify-between`,children:[_,v]}),t[33]=_,t[34]=v,t[35]=y):y=t[35],y}function k(e){return(0,T.jsx)(`p`,{className:`break-words font-mono text-[11px] leading-relaxed text-muted-foreground`,children:e},e)}function A(){let e=(0,ue.c)(56),o=t(),{updateSettings:s}=r(),u=c(),d=o.defaultAgentTokenMode??`off`,f=v[d],g=f.icon,b;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],e[0]=b):b=e[0];let[C,de]=(0,w.useState)(b),D;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(D=[],e[1]=D):D=e[1];let[fe,ge]=(0,w.useState)(D),[O,k]=(0,w.useState)(!1),[A,Ce]=(0,w.useState)(null),j=(0,w.useRef)(!1),M;e[2]===u?M=e[3]:(M=()=>{if(j.current)return;j.current=!0,k(!0);let e=u?a(u.environmentId)?.server:l().server;if(!e){k(!1),j.current=!1;return}Promise.all([e.listOpinionatedPlugins(),e.checkOpinionatedPlugins()]).then(e=>{let[t,n]=e;de(t.plugins.toSorted(Ee)),ge(n.statuses)}).catch(Te).finally(()=>{j.current=!1,k(!1)})},e[2]=u,e[3]=M);let N=M,P,F;e[4]===N?(P=e[5],F=e[6]):(P=()=>{N()},F=[N],e[4]=N,e[5]=P,e[6]=F),(0,w.useEffect)(P,F);let I;if(e[7]!==fe){let t=new Map;for(let e of fe){let n=t.get(e.pluginId)??[];n.push(e),t.set(e.pluginId,n)}I=new Map;for(let[e,n]of t)I.set(e,n.toSorted(we));e[7]=fe,e[8]=I}else I=e[8];let L=I,De=Se,R;e[9]!==N||e[10]!==u?(R=e=>{let t=l(),r=u?a(u.environmentId)?.server:t.server;if(!r){n.add(x({type:`error`,title:`Plugin install unavailable`,description:`Node ${u?.nodeLabel??`server`} is not connected.`}));return}let i=pe(e);t.dialogs.confirm(`Install ${e.pluginId===`rtk`?`RTK`:`Caveman`} for ${i}?\n\nThis may run networked CLI installation commands on this machine.`).then(t=>{if(!t)return;let a=E(e);return Ce(a),r.installOpinionatedPlugin({pluginId:e.pluginId,...e.providerInstanceId?{providerInstanceId:e.providerInstanceId}:{}}).then(t=>{ge(e=>[...e.filter(e=>E(e)!==a),t.status]),n.add({type:`success`,title:`${e.pluginId===`rtk`?`RTK`:`Caveman`} installed`,description:t.commands.length>0?t.commands[t.commands.length-1]:i}),N()}).catch(xe).finally(()=>Ce(null))}).catch(be)},e[9]=N,e[10]=u,e[11]=R):R=e[11];let z=R,B;e[12]===s?B=e[13]:(B=e=>s({defaultAgentTokenMode:e}),e[12]=s,e[13]=B);let V;e[14]===g?V=e[15]:(V=(0,T.jsx)(g,{className:`size-4 shrink-0 text-muted-foreground`}),e[14]=g,e[15]=V);let H;e[16]===f.triggerLabel?H=e[17]:(H=(0,T.jsx)(ie,{children:f.triggerLabel}),e[16]=f.triggerLabel,e[17]=H);let U;e[18]!==V||e[19]!==H?(U=(0,T.jsx)(re,{className:`w-full sm:w-52`,"aria-label":`Default token mode`,children:(0,T.jsxs)(`span`,{className:`inline-flex min-w-0 items-center gap-2`,children:[V,H]})}),e[18]=V,e[19]=H,e[20]=U):U=e[20];let W;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,T.jsx)(ne,{align:`end`,alignItemWithTrigger:!1,className:`w-60`,children:y.map(ye)}),e[21]=W):W=e[21];let G;e[22]!==d||e[23]!==B||e[24]!==U?(G=(0,T.jsx)(oe,{title:`Token mode`,children:(0,T.jsx)(le,{title:`Default token mode`,description:`Applied to new threads and draft sessions. Existing threads keep their own mode.`,control:(0,T.jsxs)(ae,{value:d,onValueChange:B,children:[U,W]})})}),e[22]=d,e[23]=B,e[24]=U,e[25]=G):G=e[25];let K;e[26]===N?K=e[27]:(K=()=>N(),e[26]=N,e[27]=K);let q;e[28]===O?q=e[29]:(q=O?(0,T.jsx)(ee,{className:`size-3 animate-spin`}):(0,T.jsx)(te,{className:`size-3`}),e[28]=O,e[29]=q);let J;e[30]!==O||e[31]!==K||e[32]!==q?(J=(0,T.jsx)(p,{render:(0,T.jsx)(i,{size:`icon-xs`,variant:`ghost`,className:`size-5 rounded-sm p-0 text-muted-foreground hover:text-foreground`,disabled:O,onClick:K,"aria-label":`Refresh plugin status`,children:q})}),e[30]=O,e[31]=K,e[32]=q,e[33]=J):J=e[33];let Y;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Y=(0,T.jsx)(m,{side:`top`,children:`Refresh plugin status`}),e[34]=Y):Y=e[34];let X;e[35]===J?X=e[36]:(X=(0,T.jsxs)(h,{children:[J,Y]}),e[35]=J,e[36]=X);let Z;e[37]!==O||e[38]!==C.length?(Z=C.length===0&&O?(0,T.jsxs)(se,{className:`flex items-center gap-2 text-xs text-muted-foreground`,children:[(0,T.jsx)(ee,{className:`size-3.5 animate-spin`}),`Loading plugin status`]}):null,e[37]=O,e[38]=C.length,e[39]=Z):Z=e[39];let Q;if(e[40]!==z||e[41]!==A||e[42]!==C||e[43]!==L){let t;e[45]!==z||e[46]!==A||e[47]!==L?(t=e=>{let t=L.get(e.id)??[],n=t.filter(ve).length;return(0,T.jsx)(le,{title:(0,T.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[(0,T.jsx)(`span`,{className:`truncate`,children:e.name}),(0,T.jsx)(S,{variant:n>0?`success`:`outline`,size:`sm`,children:n>0?`${n} installed`:`Available`})]}),description:e.summary,status:(0,T.jsxs)(`span`,{className:`flex flex-wrap gap-1.5`,children:[(0,T.jsx)(S,{variant:`info`,size:`sm`,children:me(e)}),(0,T.jsx)(S,{variant:`outline`,size:`sm`,children:he(e)})]}),control:(0,T.jsxs)(i,{size:`xs`,variant:`ghost`,onClick:()=>De(e),children:[(0,T.jsx)(_,{className:`size-3.5`}),`Docs`]}),children:(0,T.jsx)(`div`,{className:`rounded-[min(var(--radius-lg),0.625rem)] bg-muted/40 px-3`,children:t.length===0?(0,T.jsx)(`p`,{className:`py-3 text-xs text-muted-foreground`,children:`No compatible provider instances detected.`}):t.map(e=>(0,T.jsx)(_e,{status:e,isInstalling:A===E(e),onInstall:z},E(e)))})},e.id)},e[45]=z,e[46]=A,e[47]=L,e[48]=t):t=e[48],Q=C.map(t),e[40]=z,e[41]=A,e[42]=C,e[43]=L,e[44]=Q}else Q=e[44];let $;e[49]!==X||e[50]!==Z||e[51]!==Q?($=(0,T.jsxs)(oe,{title:`Opinionated plugins`,headerAction:X,children:[Z,Q]}),e[49]=X,e[50]=Z,e[51]=Q,e[52]=$):$=e[52];let Oe;return e[53]!==G||e[54]!==$?(Oe=(0,T.jsxs)(ce,{children:[G,$]}),e[53]=G,e[54]=$,e[55]=Oe):Oe=e[55],Oe}function ve(e){return e.state===`installed`}function ye(e){let t=v[e],n=t.icon;return(0,T.jsx)(C,{hideIndicator:!0,value:e,children:(0,T.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-1.5 font-medium text-foreground`,children:[(0,T.jsx)(n,{className:`size-3.5 shrink-0 text-muted-foreground`}),t.label]}),(0,T.jsx)(`span`,{className:`text-muted-foreground text-xs leading-4`,children:t.description})]})},e)}function be(e){n.add(x({type:`error`,title:`Install confirmation failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function xe(e){n.add(x({type:`error`,title:`Plugin install failed`,description:e instanceof Error?e.message:`An error occurred.`}))}function Se(e){let t=e.docsUrl??e.homepageUrl;l().shell.openExternal(t).catch(Ce)}function Ce(e){n.add(x({type:`error`,title:`Failed to open plugin docs`,description:e instanceof Error?e.message:`An error occurred.`}))}function we(e,t){return O(e).localeCompare(O(t))}function Te(e){n.add(x({type:`error`,title:`Failed to load plugins`,description:e instanceof Error?e.message:`An error occurred.`}))}function Ee(e,t){return ge(e.id)-ge(t.id)}export{A as OpinionatedPluginsSettingsPanel};
|