dorkos 0.128.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/cli.js +766 -517
- package/dist/browser/native/package-manifest.json +1 -1
- package/dist/browser/source-manifest.json +1 -1
- package/dist/client/assets/{AboutPage-CmQERFxo.js → AboutPage-B2CzVj5W.js} +1 -1
- package/dist/client/assets/{ActivityErrorState-Dw231W2w.js → ActivityErrorState-Dl-P-e0R.js} +1 -1
- package/dist/client/assets/{ActivityPage-DVfeyA9u.js → ActivityPage-CW7tqLHb.js} +1 -1
- package/dist/client/assets/ActivityRow-Vy4aXWk-.js +1 -0
- package/dist/client/assets/{AdapterIcon-NqCDzgCI.js → AdapterIcon-aabKVZmM.js} +1 -1
- package/dist/client/assets/AdapterSetupWizard-C5Hs0xkG.js +2 -0
- package/dist/client/assets/{AgentOptionRow-BRJfZo2y.js → AgentOptionRow-CqIMxq9S.js} +1 -1
- package/dist/client/assets/{AgentPicker-B7upjYRk.js → AgentPicker-C6mbTDJJ.js} +1 -1
- package/dist/client/assets/{AgentRequestCard-DXJnLk6q.js → AgentRequestCard-C8GV5Sxn.js} +4 -4
- package/dist/client/assets/AppearancePage-C0JKrHsO.js +1 -0
- package/dist/client/assets/{ApplyToOverridesDialog-C_QQhNIf.js → ApplyToOverridesDialog-DWEi0MNt.js} +1 -1
- package/dist/client/assets/AttentionSignalRow-Cpu0lKYg.js +1 -0
- package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-G7vrCqeA.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-_zVrHu5s.js} +3 -3
- package/dist/client/assets/BindingDialog-4UeaJfUu.js +1 -0
- package/dist/client/assets/BlintzCanvas-DCXIQZM_.js +1231 -0
- package/dist/client/assets/{CanvasCsvContent-CtLpZnTs.js → CanvasCsvContent-D-0TuvVs.js} +4 -4
- package/dist/client/assets/CanvasFileContent-DqSx7lz9.js +2 -0
- package/dist/client/assets/CanvasModel3dContent-zTx660yQ.js +2 -0
- package/dist/client/assets/ChannelComposer-D4TYVkvO.js +45 -0
- package/dist/client/assets/{ChatAppsOff-CCZUzDIH.js → ChatAppsOff-BzfyQc55.js} +2 -2
- package/dist/client/assets/{CodeMirrorDiff-BCpYdhgZ.js → CodeMirrorDiff-BLWBYGLp.js} +1 -1
- package/dist/client/assets/{CodeMirrorEditor-BeCubxHV.js → CodeMirrorEditor-D0q3ETxK.js} +1 -1
- package/dist/client/assets/{CommitmentList-BZtfTnwg.js → CommitmentList-BoMiLsRe.js} +1 -1
- package/dist/client/assets/{CommitmentsPage-DmurDgxV.js → CommitmentsPage-_7mNJVUZ.js} +1 -1
- package/dist/client/assets/{ComputerResourceView-Bik6GLKp.js → ComputerResourceView-Bo2LaCJf.js} +1 -1
- package/dist/client/assets/{ComputerViewer-CksBDqdu.js → ComputerViewer-a4VSdAw_.js} +1 -1
- package/dist/client/assets/ConnectionAccessLists-Dvv0YO31.js +1 -0
- package/dist/client/assets/{ConnectionsPage-Cgg36gDY.js → ConnectionsPage-oO8pNgbc.js} +2 -2
- package/dist/client/assets/{ConventionPage-CNhpF6Z1.js → ConventionPage-CFJjwhBd.js} +2 -2
- package/dist/client/assets/{ExtensionPageRoute-C2zue_Pw.js → ExtensionPageRoute-BqZN9q7M.js} +2 -2
- package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-3v1TfY1P.js → FloatingTanStackRouterDevtools-CqogiFob-CnSp2ZEM.js} +1 -1
- package/dist/client/assets/{ForwardConsentHost-Mbo0D-zk.js → ForwardConsentHost-4LhRvCdu.js} +1 -1
- package/dist/client/assets/HandlePage-BjoYPqme.js +1 -0
- package/dist/client/assets/HeartbeatPage-rJzICayy.js +1 -0
- package/dist/client/assets/{KeyEntry-C43vkwpA.js → KeyEntry-BTTuXleL.js} +1 -1
- package/dist/client/assets/{LexicalField-iAHcvRmI.js → LexicalField-Dk_SDrjk.js} +1 -1
- package/dist/client/assets/{ManagesPage-BUIJvLmv.js → ManagesPage-Cvu3CQDn.js} +1 -1
- package/dist/client/assets/Marketplace-DPjPPlZz.js +36 -0
- package/dist/client/assets/{MarketplaceSourcesView-BZODwhxu.js → MarketplaceSourcesView-ChCys0on.js} +1 -1
- package/dist/client/assets/{McpAppFrame-D15nxVaI.js → McpAppFrame-DNamtzOp.js} +2 -2
- package/dist/client/assets/{McpSigninBody-DmBxqgxN.js → McpSigninBody-DLw3ZdZE.js} +1 -1
- package/dist/client/assets/{Model3dViewer-RGXeJd6a.js → Model3dViewer-IwCBCPZ2.js} +1 -1
- package/dist/client/assets/NamePage-FY_D0eA2.js +1 -0
- package/dist/client/assets/NewDirectMessageMenu-BB0gvClR.js +1 -0
- package/dist/client/assets/{NotificationsPage-NRfyiinS.js → NotificationsPage-aCF0AtqL.js} +1 -1
- package/dist/client/assets/{OpenMeshSwitch-CgQ6uefo.js → OpenMeshSwitch-DjCWF2Vy.js} +2 -2
- package/dist/client/assets/OperatorIdentityForm-Bcveds6f.js +1 -0
- package/dist/client/assets/{PermissionHistory-DPEPq8D9.js → PermissionHistory-CYsxFYmV.js} +1 -1
- package/dist/client/assets/{PermissionsPage--k-xutbJ.js → PermissionsPage-sxHkY92V.js} +1 -1
- package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BZ20JTnJ.js} +1 -1
- package/dist/client/assets/PhotoPage-KBzkb0sT.js +1 -0
- package/dist/client/assets/PreviewRefusedNotice-BFQPYcUG.js +1 -0
- package/dist/client/assets/{ProfileFields-DbPJ7fvN.js → ProfileFields-sp17IFo8.js} +1 -1
- package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-mA44jh5A.js} +1 -1
- package/dist/client/assets/{ProfileRolePicker-CZEXvlJm.js → ProfileRolePicker-Chh4_ZMB.js} +1 -1
- package/dist/client/assets/PromptSuggestionChips-CEi_-fHF.js +1 -0
- package/dist/client/assets/{ReportsToPopover-YOwGLJy5.js → ReportsToPopover-D1uknwnk.js} +1 -1
- package/dist/client/assets/RoomSurface-Clf1yLrr.js +1 -0
- package/dist/client/assets/{RoomsPage-CoXjZMWL.js → RoomsPage-BtCNzvhQ.js} +1 -1
- package/dist/client/assets/RunsOnPopover-LCvBpe9J.js +1 -0
- package/dist/client/assets/RuntimeConnectFlow-C5UDeHUC.js +1 -0
- package/dist/client/assets/RuntimeSetupDialog-Bqh67Vqb.js +1 -0
- package/dist/client/assets/{SeenDevices-Bh2yh-PW.js → SeenDevices-DvCfdeDo.js} +3 -3
- package/dist/client/assets/{SessionsPage-CFvkbT9X.js → SessionsPage-DLByE-re.js} +1 -1
- package/dist/client/assets/SettingsDialog-Co-Oxtyw.js +12 -0
- package/dist/client/assets/SkillsPage-Cc79IstM.js +1 -0
- package/dist/client/assets/TaskDialogWrapper-DuYV7Zch.js +1 -0
- package/dist/client/assets/TasksEmptyState-CfmPtBra.js +3 -0
- package/dist/client/assets/{TasksPage-D0Zi6Mve.js → TasksPage-DGk0zUhO.js} +1 -1
- package/dist/client/assets/{TeamComputerEntry-CY9eLVad.js → TeamComputerEntry-CLHbeX5i.js} +1 -1
- package/dist/client/assets/{ToolsPage-0_vx5P-F.js → ToolsPage-CSkDE7rZ.js} +2 -2
- package/dist/client/assets/{TopologyGraph-DUZLZZrB.js → TopologyGraph-pBC37k5P.js} +14 -14
- package/dist/client/assets/TourHost-CS9RsLj_.js +1 -0
- package/dist/client/assets/{UnlinkDialog-ptZy3IN4.js → UnlinkDialog-CelhOUZ0.js} +1 -1
- package/dist/client/assets/{UnreadDivider-Ckey1IWn.js → UnreadDivider-B_OMR0mQ.js} +1 -1
- package/dist/client/assets/WidgetErrorCard-CsMqCyCb.js +108 -0
- package/dist/client/assets/{WithheldExtensionsNotice-7Vu1Jctn.js → WithheldExtensionsNotice-GiKb0iQu.js} +1 -1
- package/dist/client/assets/WorkQueuePage-Cu721KyM.js +1 -0
- package/dist/client/assets/WorkView-CpWEaxMr.js +51 -0
- package/dist/client/assets/_shell-CmGG8Ysk.js +80 -0
- package/dist/client/assets/{_shell._home-BRIXhYLg.js → _shell._home-BnKkAeSp.js} +1 -1
- package/dist/client/assets/_shell._home.activity-DaaLJbvO.js +1 -0
- package/dist/client/assets/_shell._home.index-CNPasFxP.js +3 -0
- package/dist/client/assets/_shell._home.tasks-DXEOJ5Nq.js +1 -0
- package/dist/client/assets/_shell._home.workspaces-UeSvmquR.js +1 -0
- package/dist/client/assets/{_shell.channels-Bx6q9xVH.js → _shell.channels-NUbf5mcb.js} +4 -4
- package/dist/client/assets/_shell.connections-BEns4DKb.js +1 -0
- package/dist/client/assets/{_shell.feedback-requests-DFznTGbN.js → _shell.feedback-requests-NyjHNdnj.js} +2 -2
- package/dist/client/assets/_shell.marketplace-BEYqsDKe.js +1 -0
- package/dist/client/assets/_shell.marketplace_.sources-D6Ls30FY.js +1 -0
- package/dist/client/assets/_shell.session-CVc6i3eN.js +1 -0
- package/dist/client/assets/{_shell.team-DmA09abY.js → _shell.team-CXeOt4XD.js} +6 -6
- package/dist/client/assets/_shell.threads-BYdN1UtZ.js +1 -0
- package/dist/client/assets/_shell.x._extensionId-DtJYSfvG.js +1 -0
- package/dist/client/assets/_shell.x._extensionId_._-DtJYSfvG.js +1 -0
- package/dist/client/assets/{abnfDiagram-WEYOIA3C-DxgtVd9I.js → abnfDiagram-WEYOIA3C-BLCVDt6M.js} +1 -1
- package/dist/client/assets/{access-copy-Dqct36mi.js → access-copy-BSQ3QECN.js} +1 -1
- package/dist/client/assets/{arc-C-67Ef0p.js → arc-t4OhsI5R.js} +1 -1
- package/dist/client/assets/{architectureDiagram-ZHVYKT53-B7TjdT-_.js → architectureDiagram-ZHVYKT53-BcIfbGZR.js} +1 -1
- package/dist/client/assets/{banner-C9qTs6-C.js → banner-B6xfuDA7.js} +2 -2
- package/dist/client/assets/{blockDiagram-RJAE7QA3-DNqxJ3Ww.js → blockDiagram-RJAE7QA3-DTOlrcEZ.js} +1 -1
- package/dist/client/assets/{c4Diagram-XDPPPE54-D3jNLV0j.js → c4Diagram-XDPPPE54-CHGqwaxa.js} +1 -1
- package/dist/client/assets/channel-CSk6LhO2.js +1 -0
- package/dist/client/assets/{chunk-2E7WHVMD-C6OKx0ty.js → chunk-2E7WHVMD-Bh4L_7yX.js} +1 -1
- package/dist/client/assets/{chunk-2Q5K7J3B-Dr_6hHrZ.js → chunk-2Q5K7J3B-BmouLl8r.js} +1 -1
- package/dist/client/assets/{chunk-4EMNKR2T-CSrZVDEt.js → chunk-4EMNKR2T-BVhtiAdG.js} +1 -1
- package/dist/client/assets/{chunk-55XCU76K-CIazeRXO.js → chunk-55XCU76K-BdbLnE56.js} +1 -1
- package/dist/client/assets/{chunk-5VM5RSS4-C8IJ3zTR.js → chunk-5VM5RSS4-Qg9lQpPO.js} +1 -1
- package/dist/client/assets/{chunk-JWPE2WC7-D9DGXb79.js → chunk-JWPE2WC7-CfIrQaMW.js} +1 -1
- package/dist/client/assets/{chunk-VQ5W62QI-B0LNYdif.js → chunk-VQ5W62QI-BP9oQzc0.js} +1 -1
- package/dist/client/assets/{chunk-XXDRQBXY-C7IAIbvZ.js → chunk-XXDRQBXY-DKzIjnsB.js} +1 -1
- package/dist/client/assets/{chunk-ZCHMQSOR-C79hvjlu.js → chunk-ZCHMQSOR-DsvG6BGY.js} +2 -2
- package/dist/client/assets/{classDiagram-v2-4MYWR3UA-0Di1C2ZB.js → classDiagram-v2-4MYWR3UA-BSiSmGgP.js} +1 -1
- package/dist/client/assets/{command-BVQb6I3_.js → command-B_FPXirc.js} +1 -1
- package/dist/client/assets/copy-button-Bp75zBSh.js +1 -0
- package/dist/client/assets/{cose-bilkent-JH36ORCC-rZumaV4b.js → cose-bilkent-JH36ORCC-CXgyrZix.js} +1 -1
- package/dist/client/assets/{cpu-DeRuDMl4.js → cpu-DpkNIYeK.js} +1 -1
- package/dist/client/assets/{cynefin-EF2NZ3EQ-CI9l9xhM.js → cynefin-EF2NZ3EQ-DkmPO3hK.js} +1 -1
- package/dist/client/assets/{cynefinDiagram-WF24UDRP-C8CdorJJ.js → cynefinDiagram-WF24UDRP-BDknJT17.js} +1 -1
- package/dist/client/assets/{dagre-NK4GIZVX-AHpsTq1O.js → dagre-NK4GIZVX-BR4J5E3b.js} +1 -1
- package/dist/client/assets/detail-row-C8zz6mAC.js +1 -0
- package/dist/client/assets/{diagram-CBK3MWTC-BpPLL30n.js → diagram-CBK3MWTC-CvLKqPry.js} +1 -1
- package/dist/client/assets/{diagram-I5XIIV2D-D6loMn3G.js → diagram-I5XIIV2D-CVtE60X9.js} +1 -1
- package/dist/client/assets/{diagram-ODIL2UCW-BaGNd5eN.js → diagram-ODIL2UCW-B--CpfLk.js} +1 -1
- package/dist/client/assets/{diagram-PFBEJUXE-BnDdKu_g.js → diagram-PFBEJUXE-08gch1t1.js} +1 -1
- package/dist/client/assets/{diagram-RJA3I4VV-UXagB0_c.js → diagram-RJA3I4VV-C2e-ubaD.js} +1 -1
- package/dist/client/assets/{diagram-TYUNFSNR-C-whBP-S.js → diagram-TYUNFSNR-DcpK4OXX.js} +1 -1
- package/dist/client/assets/{ebnfDiagram-V4P3TTPT-BbG481iS.js → ebnfDiagram-V4P3TTPT-DM44BkBt.js} +1 -1
- package/dist/client/assets/{elk-QONTBCTQ-FtssIxOc.js → elk-QONTBCTQ-maYS1Zzm.js} +1 -1
- package/dist/client/assets/{empty-state-CACt-76q.js → empty-state-HtOTBAoq.js} +1 -1
- package/dist/client/assets/{erDiagram-KYQIGQAA-PpFgUf4C.js → erDiagram-KYQIGQAA-BR7z9r2M.js} +1 -1
- package/dist/client/assets/{execution-config-CGL73sRn.js → execution-config-DYYeJyJh.js} +1 -1
- package/dist/client/assets/{file-D80JE_L0.js → file-VtGYNr9E.js} +1 -1
- package/dist/client/assets/{file-exclamation-point-CcJ_e4_m.js → file-exclamation-point-eBlQssyW.js} +1 -1
- package/dist/client/assets/{file-text-Ds9edaTZ.js → file-text-DvNAxTGZ.js} +1 -1
- package/dist/client/assets/{find-latest-widget-fence-BtqFMP_f.js → find-latest-widget-fence-C2qXvASs.js} +5 -5
- package/dist/client/assets/{flowDiagram-IUGLLWBU-BIva66g9.js → flowDiagram-IUGLLWBU-DiuMtMbj.js} +1 -1
- package/dist/client/assets/form-CGIIzr1u.js +1 -0
- package/dist/client/assets/{format-cron-BpGrgPLu.js → format-cron-BzJ6ekoo.js} +1 -1
- package/dist/client/assets/format-tokens-DymkROvy.js +1 -0
- package/dist/client/assets/{ganttDiagram-R7GPNTJY-CZqips_4.js → ganttDiagram-R7GPNTJY-Cf_z8Ri1.js} +1 -1
- package/dist/client/assets/{git-branch-B8JNwQ6q.js → git-branch-BVzjBPW-.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DoIc3lda.js → gitGraphDiagram-PDYL7XHY-RZXACCBr.js} +1 -1
- package/dist/client/assets/{graph-yizM0vwL.js → graph-DfAV_ObD.js} +1 -1
- package/dist/client/assets/{heart-BavUIV45.js → heart-BMOCYMFT.js} +1 -1
- package/dist/client/assets/{highlighted-body-KPVGNVTW-CGr3AgaU.js → highlighted-body-KPVGNVTW-DrrsaKBc.js} +1 -1
- package/dist/client/assets/image-lightbox-tAwBNBhm.js +1 -0
- package/dist/client/assets/{image-off-C1uTDs9-.js → image-off-BpagBHk1.js} +1 -1
- package/dist/client/assets/{index-CrTmY12y.js → index-0uCJUW_h.js} +2 -2
- package/dist/client/assets/index-0y0K3rYv.js +1 -0
- package/dist/client/assets/{index-CJXMgnYp.js → index-2GjydAcS.js} +1 -1
- package/dist/client/assets/index-6dsaPQ7-.js +1 -0
- package/dist/client/assets/{index-X282DRZf.js → index-7-yzdcAx.js} +3 -3
- package/dist/client/assets/{index-C8ZpJXTQ.js → index-A7HgzxSw.js} +1 -1
- package/dist/client/assets/{index-DW4KUPHp.js → index-BEqKTiCR.js} +1 -1
- package/dist/client/assets/{index-56EOd-zy.js → index-BIN0yv4s.js} +1 -1
- package/dist/client/assets/{index-FhWMRBQP.js → index-BL5Vmq62.js} +1 -1
- package/dist/client/assets/index-BOvFXsF_.js +1 -0
- package/dist/client/assets/index-BbcfxnHC.js +1 -0
- package/dist/client/assets/{index-DqkFtcGQ.js → index-BdKIijqB.js} +1 -1
- package/dist/client/assets/{index-BOEPL6hN.js → index-BfAymWoj.js} +1 -1
- package/dist/client/assets/{index-BKWJiERs.js → index-Bgts5its.js} +1 -1
- package/dist/client/assets/{index-n_pnc-CO.js → index-BiL3chP7.js} +1 -1
- package/dist/client/assets/{index-FI_y_dND.js → index-Bu3PEVA_.js} +1 -1
- package/dist/client/assets/{index-BOhSPP-6.js → index-C6DTV4h3.js} +1 -1
- package/dist/client/assets/{index-Cdod8zEY.js → index-CCH9c-nB.js} +1 -1
- package/dist/client/assets/{index-BkJlIXqM.js → index-CH4NJ8dD.js} +1 -1
- package/dist/client/assets/{index-CiGYtR9O.js → index-CKGJp3Cm.js} +1 -1
- package/dist/client/assets/{index-DEiSJbvu.js → index-CeqI4FFw.js} +1 -1
- package/dist/client/assets/{index-C4t0UTU-.js → index-Cj9-XXKl.js} +1 -1
- package/dist/client/assets/{index-ZR5f82z2.js → index-Cu8tnfM_.js} +1 -1
- package/dist/client/assets/{index-Dcd4NqFB.js → index-D4OWRMsG.js} +1 -1
- package/dist/client/assets/{index-Br6xDNvu.js → index-D8SP73Xw.js} +1 -1
- package/dist/client/assets/{index-CoNMlH37.js → index-DEJXVqcY.js} +1 -1
- package/dist/client/assets/{index-CoKNU2F9.js → index-DEMZynQt.js} +1 -1
- package/dist/client/assets/index-DGzMwE1Z.js +1 -0
- package/dist/client/assets/{index-1QfQImuJ.js → index-DIJdZqg2.js} +3 -3
- package/dist/client/assets/{index-YSHcMqHa.js → index-DIRqrOEK.js} +1 -1
- package/dist/client/assets/{index-CeDn1Ak1.js → index-DNbdGvs9.js} +1 -1
- package/dist/client/assets/{index-7XeZCCDI.js → index-DOBjxRe9.js} +1 -1
- package/dist/client/assets/{index-BJEt9R_G.js → index-DcBlHsnC.js} +1 -1
- package/dist/client/assets/index-DdsaTuqO.js +1 -0
- package/dist/client/assets/index-Dt4H9Tms.js +17 -0
- package/dist/client/assets/{index-DYEmUa5t.js → index-HXC63Ry8.js} +1 -1
- package/dist/client/assets/index-MHIn2TC9.js +1063 -0
- package/dist/client/assets/{index-tgbcsB6H.js → index-OjJ_8uMM.js} +1 -1
- package/dist/client/assets/index-P4Wos1Gi.css +1 -0
- package/dist/client/assets/{index-QSXJR98z.js → index-U5jTIqzv.js} +1 -1
- package/dist/client/assets/{index-CXBYgGja.js → index-ZzPr9GUI.js} +1 -1
- package/dist/client/assets/index-d9cqTUAj.js +1 -0
- package/dist/client/assets/{index-LwL5BpE4.js → index-fcfCRITA.js} +1 -1
- package/dist/client/assets/{index-SOKlO1zZ.js → index-onQlu3UR.js} +1 -1
- package/dist/client/assets/{index.esm-CAeUe7uQ.js → index.esm-DSKTDEoH.js} +1 -1
- package/dist/client/assets/{infoDiagram-MVDRKAX5-DweUdYSy.js → infoDiagram-MVDRKAX5-B8dulOBe.js} +1 -1
- package/dist/client/assets/{inline-code-SYHTKcle.js → inline-code-B3qpjdZ2.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-DKNQIv7P.js → ishikawaDiagram-HPEHV2GE-Cy8aIg0O.js} +1 -1
- package/dist/client/assets/{journeyDiagram-BOSHW7O7-DPD7F4VO.js → journeyDiagram-BOSHW7O7-BZAlejG3.js} +1 -1
- package/dist/client/assets/{kanban-definition-FNSA4HC5-B_uPSwxC.js → kanban-definition-FNSA4HC5-BxS1edpe.js} +1 -1
- package/dist/client/assets/{layers-F4mvrI2l.js → layers-ByCM7XO5.js} +1 -1
- package/dist/client/assets/{lightbulb-a6nNsrzy.js → lightbulb-KjW8YTXH.js} +1 -1
- package/dist/client/assets/{link-2-yI2Tlm7Q.js → link-2-CtFfuMO5.js} +1 -1
- package/dist/client/assets/{list-runtime-types-CsGil5te.js → list-runtime-types-DrzHejZo.js} +1 -1
- package/dist/client/assets/{markdown-content-Cjhsscbn.js → markdown-content-DgiSdNwz.js} +1 -1
- package/dist/client/assets/mention-pill-CHPHlu-U.js +1 -0
- package/dist/client/assets/{mermaid.core-9PwG-9fN.js → mermaid.core-ovqlC4PC.js} +4 -4
- package/dist/client/assets/{message-square-off-aV4NMCjd.js → message-square-off-CEOyy4Pq.js} +1 -1
- package/dist/client/assets/{mindmap-definition-6OY57UG3-BRbWmQkj.js → mindmap-definition-6OY57UG3-CsngqLzI.js} +1 -1
- package/dist/client/assets/{more-details-CRLU2HN4.js → more-details-BW9mauVT.js} +1 -1
- package/dist/client/assets/{owner-notice-CTJbhUak.js → owner-notice-BRUVafHC.js} +1 -1
- package/dist/client/assets/{package-sPggO7Dr.js → package-Bbs99yqi.js} +1 -1
- package/dist/client/assets/{page-container-CnfDuiDC.js → page-container-BVfGgaaJ.js} +1 -1
- package/dist/client/assets/{pane-resize-handle-63OC5vfI.js → pane-resize-handle-BL7Meu5R.js} +1 -1
- package/dist/client/assets/{paperclip-WhPo3_WD.js → paperclip-QOWXs8-5.js} +1 -1
- package/dist/client/assets/path-input-BDRHmgzW.js +1 -0
- package/dist/client/assets/{pegDiagram-ECIUJNBX-Ct9Li_PA.js → pegDiagram-ECIUJNBX-DPsWmWqw.js} +1 -1
- package/dist/client/assets/{pieDiagram-GNMPY74T-BAB5RA5v.js → pieDiagram-GNMPY74T-BdOIDv4F.js} +1 -1
- package/dist/client/assets/{plug-_q5iqunq.js → plug-BrsPyUhu.js} +1 -1
- package/dist/client/assets/primer-trigger-C97fRm1v.js +3 -0
- package/dist/client/assets/{profile-errors-COcBx7w5.js → profile-errors-nPLX60ha.js} +1 -1
- package/dist/client/assets/{progress-77FCPL2y.js → progress-C9TALtIa.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-D57K4MC3-BqPJVmMS.js → quadrantDiagram-D57K4MC3-MzMEunU7.js} +1 -1
- package/dist/client/assets/{query-error-state-5236P3z0.js → query-error-state-BJjgx-WC.js} +1 -1
- package/dist/client/assets/{radio-C8xmfoqO.js → radio-Biql29-B.js} +1 -1
- package/dist/client/assets/{railroadDiagram-Y72NRBL7-B8U11nT6.js → railroadDiagram-Y72NRBL7-Dzx_PYVW.js} +1 -1
- package/dist/client/assets/registry-B0HgbN69.js +1 -0
- package/dist/client/assets/registry-fiUD5cv6.js +39 -0
- package/dist/client/assets/{relay-trace-schemas-B80E4EUn.js → relay-trace-schemas-BJ4MfChd.js} +2 -2
- package/dist/client/assets/{repeat-CHmB_vD7.js → repeat-CKufDGoQ.js} +1 -1
- package/dist/client/assets/{requirementDiagram-EQYSW5RA-CzJ1gzTh.js → requirementDiagram-EQYSW5RA-J0pg6FEt.js} +1 -1
- package/dist/client/assets/{room-files-source-B0gc97Ri.js → room-files-source-iaYdshKo.js} +2 -2
- package/dist/client/assets/{rotate-ccw-clock-CCU6SVnv.js → rotate-ccw-clock-CnARSw5V.js} +1 -1
- package/dist/client/assets/{rotate-cw-B8WQa8O-.js → rotate-cw-BAn_5-Gq.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-SY24JHO5-D4vQwyve.js → sankeyDiagram-SY24JHO5-6V_uy-zQ.js} +1 -1
- package/dist/client/assets/scroll-area-XDq7yL_d.js +1 -0
- package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BVnIsPQe.js → sequenceDiagram-BLEHNHQU-C4jZi3N4.js} +1 -1
- package/dist/client/assets/{shield-x-ijIbRppV.js → shield-x-CpiXuMbN.js} +1 -1
- package/dist/client/assets/signed-in-Rv3Sjk8n.js +1 -0
- package/dist/client/assets/{sizeCapture-INFHLROL-DGb1rAJL.js → sizeCapture-INFHLROL-B7nxFreb.js} +1 -1
- package/dist/client/assets/{soul-file-CXgYs25S.js → soul-file-BQz4TtHo.js} +1 -1
- package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DeX3IKTm.js → stateDiagram-v2-A6IESKWZ-B5rvc4n2.js} +1 -1
- package/dist/client/assets/{swimlanes-B3ENRKFQ-DN5ljYhG.js → swimlanes-B3ENRKFQ-DnElusDo.js} +1 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-DLpKz5fF.js +8 -0
- package/dist/client/assets/{table-D9ww_3Ij.js → table-NGiWzPO4.js} +1 -1
- package/dist/client/assets/{timeline-definition-JXYKGLGB-DpRthC3r.js → timeline-definition-JXYKGLGB-DMgyn3XX.js} +1 -1
- package/dist/client/assets/{trust-posture-Dn2ciEE0.js → trust-posture-BArJ9H4j.js} +1 -1
- package/dist/client/assets/{unplug-BZ8zSvfB.js → unplug-MSjeZ0tJ.js} +1 -1
- package/dist/client/assets/{unverified-catalog-notice-CGy05tAO.js → unverified-catalog-notice-DA96H8Df.js} +1 -1
- package/dist/client/assets/{use-bindings-BLAWQRpe.js → use-bindings-BojBqRJS.js} +1 -1
- package/dist/client/assets/{use-composer-prefs-ICOpilWK.js → use-composer-prefs-BDl8aMme.js} +1 -1
- package/dist/client/assets/{use-connector-management-DEMGZy9N.js → use-connector-management-FONU6FK8.js} +1 -1
- package/dist/client/assets/{use-deep-link-scroll-DxGYrks3.js → use-deep-link-scroll-CtbBPBgi.js} +1 -1
- package/dist/client/assets/{use-delete-binding-Bnv3J5Fu.js → use-delete-binding-COhBv6X3.js} +1 -1
- package/dist/client/assets/{use-dev-links-BOcktLiE.js → use-dev-links-Dh0MCiGY.js} +1 -1
- package/dist/client/assets/{use-direct-message-panel-D38tSozW.js → use-direct-message-panel-CYnWunqk.js} +1 -1
- package/dist/client/assets/{use-external-adapter-catalog-9qiNBqpc.js → use-external-adapter-catalog-RTDOW8Yi.js} +1 -1
- package/dist/client/assets/use-filter-state-CSFTDx7z.js +6 -0
- package/dist/client/assets/use-full-activity-feed-DlY_ZbRZ.js +1 -0
- package/dist/client/assets/use-is-below-desktop-ClzGXlRb.js +1 -0
- package/dist/client/assets/{use-local-browser-B1huJhdg.js → use-local-browser-WwZd-FOP.js} +1 -1
- package/dist/client/assets/{use-mesh-topology-BTYAy6zc.js → use-mesh-topology-WnFkjq41.js} +1 -1
- package/dist/client/assets/{use-mounted-ref-CaPc6Prv.js → use-mounted-ref-Dz1h70pz.js} +1 -1
- package/dist/client/assets/{use-notification-prefs-u76DPoP0.js → use-notification-prefs-IrF5_cko.js} +1 -1
- package/dist/client/assets/use-pending-read-CnAnzOt_.js +1 -0
- package/dist/client/assets/use-personality-commit-C4hYkSPy.js +1 -0
- package/dist/client/assets/use-promo-activation-CPVANFBh.js +6 -0
- package/dist/client/assets/{use-promo-dismissals-CO7-qhEl.js → use-promo-dismissals-B9m0HT6L.js} +1 -1
- package/dist/client/assets/{use-pulse-freshness-D07Mv-Sa.js → use-pulse-freshness-DMySxN8D.js} +1 -1
- package/dist/client/assets/{use-room-follow-claim-DRQBuAIe.js → use-room-follow-claim-ByaYVY0o.js} +1 -1
- package/dist/client/assets/{use-room-sessions-Bzk7rM40.js → use-room-sessions-DPB29acU.js} +1 -1
- package/dist/client/assets/{use-roving-tab-list-CcznVldj.js → use-roving-tab-list-BO8kbs-w.js} +1 -1
- package/dist/client/assets/{use-session-canvas-CpgE7tFb.js → use-session-canvas-Cunag2K7.js} +9 -9
- package/dist/client/assets/use-status-budget-jt-9aQR0.js +21 -0
- package/dist/client/assets/{use-transform-ByJGn3hq.js → use-transform-ydtuYUNp.js} +1 -1
- package/dist/client/assets/{use-unclaimed-chats-C-z5fstJ.js → use-unclaimed-chats-ClBWJgNm.js} +1 -1
- package/dist/client/assets/use-update-config-ZHtOtve0.js +1 -0
- package/dist/client/assets/{useMutationState-BF1EFtIZ.js → useMutationState-B8ArIqeH.js} +1 -1
- package/dist/client/assets/{usecaseDiagram-WPOLBNNX-efVKbRIX.js → usecaseDiagram-WPOLBNNX-C5JdAkG9.js} +1 -1
- package/dist/client/assets/{vennDiagram-Q3Y3IDCW-Bravmwce.js → vennDiagram-Q3Y3IDCW-CqLCy7LU.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-IVAIDKWA-fR77zByv.js → wardleyDiagram-IVAIDKWA-C9FlHLTd.js} +1 -1
- package/dist/client/assets/{xychartDiagram-4URNHDU4-BphORSLh.js → xychartDiagram-4URNHDU4-BIm-RUWd.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/drizzle/20261031012841_dor3309_file_turn_on_offer.sql +2 -0
- package/dist/drizzle/20261101122330_schedule_declined_content_key.sql +1 -0
- package/dist/drizzle/20261101195529_work_queue.sql +38 -0
- package/dist/drizzle/20261101233656_dor3644_session_launched_by.sql +1 -0
- package/dist/drizzle/20261102041558_dor3070_marketplace_summary.sql +2 -0
- package/dist/drizzle/20261102051715_dor3440_clear_origin_holds.sql +10 -0
- package/dist/drizzle/20261102135442_agent_browser_profiles.sql +15 -0
- package/dist/drizzle/meta/20261031012841_snapshot.json +14116 -0
- package/dist/drizzle/meta/20261101122330_snapshot.json +14123 -0
- package/dist/drizzle/meta/20261101195529_snapshot.json +14363 -0
- package/dist/drizzle/meta/20261101233656_snapshot.json +14370 -0
- package/dist/drizzle/meta/20261102041558_snapshot.json +14384 -0
- package/dist/drizzle/meta/20261102051715_snapshot.json +14384 -0
- package/dist/drizzle/meta/20261102135442_snapshot.json +14483 -0
- package/dist/drizzle/meta/_journal.json +49 -0
- package/dist/server/extension-child.cjs +1147 -572
- package/dist/server/index.js +45678 -38894
- package/dist/server/index.js.map +2 -2
- package/package.json +5 -5
- package/dist/client/assets/ActivityRow-DIBH4v9c.js +0 -1
- package/dist/client/assets/AdapterSetupWizard-Dle_b9qc.js +0 -2
- package/dist/client/assets/AppearancePage-DXbhUt2e.js +0 -1
- package/dist/client/assets/AttentionSignalRow-5E7TkG98.js +0 -1
- package/dist/client/assets/BindingDialog-q--8SDJF.js +0 -1
- package/dist/client/assets/BlintzCanvas-DruVZcDU.js +0 -1231
- package/dist/client/assets/CanvasFileContent-BThy5fjD.js +0 -2
- package/dist/client/assets/CanvasModel3dContent-BbgR73jh.js +0 -2
- package/dist/client/assets/ChannelComposer-qhk0KtW7.js +0 -44
- package/dist/client/assets/ConnectionAccessLists-DRwO1v0V.js +0 -1
- package/dist/client/assets/HandlePage-B4qbFi40.js +0 -1
- package/dist/client/assets/HeartbeatPage-BnNbQLCW.js +0 -1
- package/dist/client/assets/Marketplace-DbdLWz0-.js +0 -36
- package/dist/client/assets/NamePage-fhxyWDDY.js +0 -1
- package/dist/client/assets/NewDirectMessageMenu-DBAdvv5p.js +0 -1
- package/dist/client/assets/OperatorIdentityForm-Bls5Vo_u.js +0 -1
- package/dist/client/assets/PhotoPage-CNHcXbz4.js +0 -1
- package/dist/client/assets/PreviewRefusedNotice-Ds4IO32o.js +0 -1
- package/dist/client/assets/PromptSuggestionChips-BXxC799Q.js +0 -1
- package/dist/client/assets/RoomSurface-DgH3a_Fv.js +0 -1
- package/dist/client/assets/RunsOnPopover-CEkkjrGg.js +0 -1
- package/dist/client/assets/RuntimeConnectFlow-DXWGgvCW.js +0 -1
- package/dist/client/assets/RuntimeSetupDialog-D6L1QhMF.js +0 -1
- package/dist/client/assets/SettingsDialog-BOOqWKcj.js +0 -12
- package/dist/client/assets/SkillsPage-ntCEhUIM.js +0 -1
- package/dist/client/assets/TaskDialogWrapper-vBWAWwTY.js +0 -1
- package/dist/client/assets/TasksEmptyState-C_3UkAbA.js +0 -3
- package/dist/client/assets/TourHost-B69XAKpE.js +0 -1
- package/dist/client/assets/WidgetErrorCard-BlqaIsPK.js +0 -108
- package/dist/client/assets/WorkView-BekLkR4O.js +0 -51
- package/dist/client/assets/_shell-Du0F-5fK.js +0 -80
- package/dist/client/assets/_shell._home.activity-5rihXoYF.js +0 -1
- package/dist/client/assets/_shell._home.index-BsLNqt4f.js +0 -3
- package/dist/client/assets/_shell._home.tasks-Cxs5tLWA.js +0 -1
- package/dist/client/assets/_shell._home.workspaces-CEHDdfbP.js +0 -1
- package/dist/client/assets/_shell.connections-Bm0WmgXH.js +0 -1
- package/dist/client/assets/_shell.marketplace-CsQ60Mlc.js +0 -1
- package/dist/client/assets/_shell.marketplace_.sources-DNyShS1x.js +0 -1
- package/dist/client/assets/_shell.session-BN42bV3w.js +0 -1
- package/dist/client/assets/_shell.threads-HH4EvufJ.js +0 -1
- package/dist/client/assets/_shell.x._extensionId-3ZlJV1iu.js +0 -1
- package/dist/client/assets/_shell.x._extensionId_._-3ZlJV1iu.js +0 -1
- package/dist/client/assets/card-DUmTNXJJ.js +0 -1
- package/dist/client/assets/channel-B7zgJbnU.js +0 -1
- package/dist/client/assets/form-D93N5lrK.js +0 -1
- package/dist/client/assets/image-lightbox-vgPEvSCc.js +0 -1
- package/dist/client/assets/index-B36osK_S.js +0 -17
- package/dist/client/assets/index-B446r3dL.js +0 -1
- package/dist/client/assets/index-BGo1YiUE.js +0 -1
- package/dist/client/assets/index-BO3yPJt-.js +0 -1
- package/dist/client/assets/index-DE6uOpn4.js +0 -1
- package/dist/client/assets/index-Dag1qeZI.js +0 -1
- package/dist/client/assets/index-Dm0Tav7v.js +0 -1
- package/dist/client/assets/index-Dry_agqN.css +0 -1
- package/dist/client/assets/index-OQuvRZTD.js +0 -1058
- package/dist/client/assets/index-eVrGefuq.js +0 -1
- package/dist/client/assets/mention-pill-BsOeTJ2f.js +0 -1
- package/dist/client/assets/path-input-C2KIXdON.js +0 -1
- package/dist/client/assets/primer-trigger-B2tjuHBx.js +0 -3
- package/dist/client/assets/registry-BzXBOE9h.js +0 -34
- package/dist/client/assets/registry-sfhDu9q2.js +0 -1
- package/dist/client/assets/scroll-area-FwZwM74Q.js +0 -1
- package/dist/client/assets/search-x-Q18Wm-C5.js +0 -6
- package/dist/client/assets/signed-in-DEOMBWVX.js +0 -1
- package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D8kHFWtL.js +0 -8
- package/dist/client/assets/use-full-activity-feed-CtQquOBW.js +0 -1
- package/dist/client/assets/use-is-below-desktop-CAGEAsCC.js +0 -1
- package/dist/client/assets/use-pending-read-D0y6i7G9.js +0 -1
- package/dist/client/assets/use-personality-commit-C3h8upDo.js +0 -1
- package/dist/client/assets/use-promo-activation-5HG08FlB.js +0 -11
- package/dist/client/assets/use-status-budget-Xn2sIeM1.js +0 -16
- package/dist/client/assets/use-update-config-L5NCTj3t.js +0 -1
package/dist/client/assets/{PersonalityPopover-DMMptmPS.js → PersonalityPopover-BZ20JTnJ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as n,j as t,e as i}from"./index-
|
|
1
|
+
import{b as n,j as t,e as i}from"./index-MHIn2TC9.js";import{u as m,P as p}from"./use-personality-commit-C4hYkSPy.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-BQz4TtHo.js";function P({member:r}){const{agent:e,isPending:o,update:a}=n(r),s=m(e,a);return o?t.jsx(i,{className:"h-40 w-full"}):e?t.jsx(p,{traits:s.traits,onTraitsChange:s.onTraitsChange,compact:!0,className:"p-1"}):t.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s personality."})}export{P as PersonalityPopover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./index-MHIn2TC9.js";import{b as t}from"./ProfileFields-sp17IFo8.js";import"./profile-errors-nPLX60ha.js";import"./use-mounted-ref-Dz1h70pz.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as b,j as s,bn as _,bq as p,br as S,fw as C,bu as E,eP as I,dW as A,fx as N,fy as R,bo as T,bw as h,fz as M,fA as $,fB as D,fC as O,a5 as F,a6 as V,ac as G}from"./index-MHIn2TC9.js";import{S as L}from"./shield-x-CpiXuMbN.js";var K=Object.defineProperty,v=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[q,oe]=S(x,[C]),P=C(),[U,y]=q(x),z=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:n,onValueChange:o,defaultValue:u,orientation:i="horizontal",dir:l,activationMode:g="automatic",...m}=t,d=E(l),[c,f]=I({prop:n,onChange:o,defaultProp:u??"",caller:x});return s.jsx(U,{scope:r,baseId:A(),value:c,onValueChange:f,orientation:i,dir:d,activationMode:g,children:s.jsx(p.div,{dir:d,"data-orientation":i,...m,ref:a})})},"Tabs")),B="TabsList",H=b.forwardRef(v(function(t,a){const{__scopeTabs:r,loop:n=!0,...o}=t,u=y(B,r),i=P(r);return s.jsx(N,{asChild:!0,...i,orientation:u.orientation,dir:u.dir,loop:n,children:s.jsx(p.div,{role:"tablist","aria-orientation":u.orientation,...o,ref:a})})},"TabsList")),W="TabsTrigger",Q=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:n,disabled:o=!1,...u}=t,i=y(W,r),l=P(r),g=w(i.baseId,n),m=j(i.baseId,n),d=n===i.value;return s.jsx(R,{asChild:!0,...l,focusable:!o,active:d,children:s.jsx(p.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":m,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:g,...u,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(n):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(n)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!d&&!o&&c&&i.onValueChange(n)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(v(function(t,a){const{__scopeTabs:r,value:n,forceMount:o,children:u,...i}=t,l=y(X,r),g=w(l.baseId,n),m=j(l.baseId,n),d=n===l.value,c=b.useRef(d);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),s.jsx(_,{present:o||d,children:({present:f})=>s.jsx(p.div,{"data-state":d?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":g,hidden:!f,id:m,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&u})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}v(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}v(j,"makeContentId");var Y=z,Z=H,ee=Q,te=J;function ie({...e}){return s.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return s.jsx(Z,{"data-slot":"tabs-list",className:h("bg-dui-muted text-dui-muted-foreground inline-flex items-center justify-center rounded-lg p-1",t?M:"h-9",e),...a})}function de({className:e,...t}){return s.jsx(ee,{"data-slot":"tabs-trigger",className:h("focus-ring inline-flex items-center justify-center rounded-md px-3 py-1.5 text-sm font-medium whitespace-nowrap transition-[color,background-color,box-shadow,opacity] motion-reduce:transition-none! md:py-1","disabled:pointer-events-none disabled:opacity-50","data-[state=active]:bg-dui-background data-[state=active]:text-dui-foreground data-[state=active]:shadow",e),...t})}function ue({className:e,...t}){return s.jsx(te,{"data-slot":"tabs-content",className:h("focus-ring mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!",e),...t})}const ae={default:!1,plan:!1,acceptEdits:!1,dontAsk:!0,bypassPermissions:!0,auto:!0};function le(e){return ae[e]??!1}function ne(e){try{return O.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?ne(e.cron):"Runs only when you ask",a=$(e.startsEnabled);return`${t}, ${a}. This job ${D(e.permissionMode)}.`}function be(e,t){const a=F(),{enabled:r=!0,...n}=t??{},o=Object.keys(n).length>0;return V({queryKey:G.permissionPreview(e??"",o?n:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?n:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function k(e){const t=e==null?void 0:e.body,a=Array.isArray(t==null?void 0:t.errors)?t.errors.filter(r=>typeof r=="string"):[];return a.length>0?{reasons:a,checked:!0}:{reasons:e instanceof Error&&e.message?[e.message]:[],checked:!1}}function ve(e){return k(e).checked}function ge({error:e}){const{reasons:t,checked:a}=k(e);return s.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[s.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[s.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),s.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&s.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>s.jsx("li",{children:r},r))})]})}export{ge as P,ie as T,ce as a,de as b,ue as c,fe as d,ve as i,le as r,be as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as p,t as E,j as e,
|
|
1
|
+
import{r as p,t as E,j as e,bh as m,bi as g,bj as x,g as y,B as u,I as f,bk as j,bl as b}from"./index-MHIn2TC9.js";import{u as k,a as C,b as v,c as A,h as I,d as F,n as D}from"./profile-errors-nPLX60ha.js";import{u as N}from"./use-mounted-ref-Dz1h70pz.js";function P(a){const[n,t]=p.useState(a),[r,i]=p.useState(a);return r!==a&&(i(a),t(a)),[n,t]}const M="image/png,image/jpeg,image/webp";function l({tone:a,children:n}){return e.jsx("p",{role:a==="error"?"alert":"status",className:a==="error"?"text-destructive text-xs":"text-muted-foreground text-xs",children:n})}function H({member:a}){const n=E(a),t=p.useRef(null),r=k(),i=C();function c(s){const o=s==null?void 0:s[0];o&&(r.mutate({file:o}),t.current&&(t.current.value=""))}return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Photo",description:"PNG, JPEG or WebP, up to 2 MB.",orientation:"vertical",children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(y,{size:"lg",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("input",{ref:t,type:"file",accept:M,className:"hidden","data-testid":"profile-photo-input",onChange:s=>c(s.target.files)}),e.jsx(u,{size:"sm",variant:"outline",disabled:r.isPending,onClick:()=>{var s;return(s=t.current)==null?void 0:s.click()},children:a.imageUrl?"Change photo":"Upload a photo"}),a.imageUrl&&e.jsx(u,{size:"sm",variant:"ghost",disabled:i.isPending,onClick:()=>i.mutate(),children:"Remove"})]})]})}),r.isError&&e.jsx(l,{tone:"error",children:v(r.error)}),i.isError&&e.jsx(l,{tone:"error",children:v(i.error)})]})})}function L({member:a}){const n=N(),t=F({isShownInline:()=>n.current}),r=a.displayName===j?"":a.displayName,[i,c]=P(r),s=b(a),o=i.trim().length>0&&i.trim()!==r,d=i.trim().length>0&&(o||s!==null);return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Display name",description:s?`${s}. Save it to make it yours.`:"What DorkOS calls you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{value:i,maxLength:80,"aria-label":"Display name",placeholder:j,onChange:h=>c(h.target.value)}),e.jsx(u,{size:"sm",disabled:!d||t.isPending,onClick:()=>t.mutate(i.trim()),children:"Save"})]})}),t.isError&&e.jsx(l,{tone:"error",children:D(t.error)}),t.isSuccess&&i.trim()===t.variables&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function z({member:a}){var d,h;const n=N(),t=A({isShownInline:()=>n.current}),[r,i]=P(a.handle??""),c=r.trim()!==(a.handle??""),s=a.kind==="agent",o=s?(d=a.agent)==null?void 0:d.authorId:a.id;return e.jsx(m,{children:e.jsxs(g,{className:"space-y-3",children:[e.jsx(x,{label:"Handle",description:s?"What others type after @ to reach this agent.":"What others type after @ to reach you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(f,{value:r,maxLength:64,placeholder:s?"agentname":"yourname","aria-label":"Handle",disabled:!o,onChange:S=>i(S.target.value)}),e.jsx(u,{size:"sm",disabled:!o||!c||t.isPending,onClick:()=>o&&t.mutate({authorId:o,handle:r.trim()}),children:"Save"})]})}),!o&&e.jsx(l,{tone:"ok",children:"It gets a handle when it first joins a room."}),t.isError&&e.jsx(l,{tone:"error",children:I(t.error,r.trim())}),t.isSuccess&&r.trim()===((h=t.variables)==null?void 0:h.handle)&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function T({member:a}){var n,t;return e.jsx(m,{children:e.jsx(g,{children:e.jsx(x,{label:"Email",description:(n=a.person)!=null&&n.email?"Your sign-in email. It stays fixed.":"No login on this machine. Turn one on in Settings › Login & security.",orientation:"vertical",children:e.jsx(f,{readOnly:!0,"aria-label":"Email",value:((t=a.person)==null?void 0:t.email)??"",placeholder:"No email on this machine",className:"text-muted-foreground"})})})})}export{l as F,L as P,z as a,H as b,T as c,P as u};
|
package/dist/client/assets/{ProfilePanelContainer-CzwhrIlw.js → ProfilePanelContainer-mA44jh5A.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as f,j as t,
|
|
1
|
+
import{r as f,j as t,bh as D,bi as R,bj as E,eo as H,ep as M,eq as _,er as Z,es as A,G as V,I as v,B as P,z as B}from"./index-MHIn2TC9.js";import{F as j,b as K,P as Y,a as $,c as G}from"./ProfileFields-sp17IFo8.js";import{u as I,P as q,b as J}from"./ProfileRolePicker-Chh4_ZMB.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(a=>n.has(a))}function Q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[a,i]=f.useState(e),[l,o]=f.useState(e),[d,u]=f.useState("idle"),[x,m]=f.useState(null);!s&&!U(l,e)&&(o(e),i(e));const h=()=>{u("saving"),n(a).then(()=>{u("idle"),m(a)}).catch(()=>u("error"))};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-3",children:[t.jsx(E,{label:"What kind of work you do",description:"Only DorkBot and your agents read this. It stays on this machine.",orientation:"vertical",children:t.jsx(q,{selected:a,onChange:i,onConfirm:h,confirmLabel:d==="saving"?"Saving…":"Save",busy:d==="saving"||s})}),d==="error"&&t.jsx(j,{tone:"error",children:"Couldn’t save that. Try again."}),d!=="error"&&x&&U(a,x)&&t.jsx(j,{tone:"ok",children:"Saved."})]})})}const X=Object.freeze({days:[1,2,3,4,5],start:"09:00",end:"17:00"});function ee(){return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}const k=new Map;function te(e){let s=k.get(e);return s||(s=new Intl.DateTimeFormat("en-US",{timeZone:e,hourCycle:"h23",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",weekday:"short"}),k.set(e,s)),s}const ne={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function w(e,s){const n={};for(const a of te(s).formatToParts(new Date(e)))n[a.type]=a.value;return{year:Number(n.year),month:Number(n.month),day:Number(n.day),hour:Number(n.hour),minute:Number(n.minute),second:Number(n.second),weekday:ne[n.weekday??""]??0}}function z(e,s){const n=w(e,s);return Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,n.second)-Math.floor(e/1e3)*1e3}function se(e){const[s,n]=e.split(":").map(Number);return(s??0)*60+(n??0)}function re(e,s,n,a,i){const l=se(a),o=Date.UTC(e,s-1,n,Math.floor(l/60),l%60),d=o-z(o-864e5,i),u=o-z(o+864e5,i),x=h=>{const y=w(h,i);return y.year===e&&y.month===s&&y.day===n&&y.hour*60+y.minute===l},m=[d,u].filter(x);return m.length>0?Math.min(...m):Math.max(d,u)}function ae(e,s,n){const[a,i,l]=e.split("-").map(Number);return new Date(re(a??1970,i??1,l??1,s,n))}function oe(e,s){const n=w(e.getTime(),s);return`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`}const ie=[{day:1,short:"M",name:"Monday"},{day:2,short:"T",name:"Tuesday"},{day:3,short:"W",name:"Wednesday"},{day:4,short:"T",name:"Thursday"},{day:5,short:"F",name:"Friday"},{day:6,short:"S",name:"Saturday"},{day:0,short:"S",name:"Sunday"}];function le(e){const s=typeof Intl.supportedValuesOf=="function"?Intl.supportedValuesOf("timeZone"):[];return s.includes(e)?s:[e,...s]}function de(e,s,n){const a=e??J()??ee(),i=s??X;return{timezone:a,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),a):""}}function b(e,s){return e.timezone===s.timezone&&e.start===s.start&&e.end===s.end&&e.awayUntil===s.awayUntil&&[...e.days].sort().join()===[...s.days].sort().join()}function ue(e){return e.days.length===0?"Pick at least one working day.":!e.start||!e.end?"Set a start and an end time.":e.end<=e.start?"The day has to end after it starts.":null}function ce(e,s,n){return e.awayUntil===s.awayUntil?n:e.awayUntil?{...n,until:ae(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:a,saveHours:i}=I(),l=de(e,s,n),[o,d]=f.useState(l),[u,x]=f.useState(l),[m,h]=f.useState("idle"),[y,C]=f.useState(null),[F,O]=f.useState(null);!a&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=r=>d(c=>({...c,...r})),W=r=>g({days:o.days.includes(r)?o.days.filter(c=>c!==r):[...o.days,r]}),L=()=>{if(p)return;h("saving");const r=o;i({timezone:r.timezone,workingHours:{days:[...r.days].sort((c,S)=>c-S),start:r.start,end:r.end},away:ce(r,u,n)}).then(()=>{h("idle"),C(null),O(r)}).catch(c=>{h("error"),C(c instanceof Error?c.message:null)})};return t.jsx(D,{children:t.jsxs(R,{className:"space-y-4",children:[t.jsx(E,{label:"Your hours",description:"Your time zone and working hours.",orientation:"vertical",children:t.jsxs("div",{className:"space-y-3",children:[t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-timezone",className:"text-muted-foreground text-xs",children:"Time zone"}),t.jsxs(H,{value:o.timezone,onValueChange:r=>g({timezone:r}),children:[t.jsx(M,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(_,{})}),t.jsx(Z,{children:le(o.timezone).map(r=>t.jsx(A,{value:r,responsive:!1,children:r.replace(/_/g," ")},r))})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("div",{id:"profile-days-label",className:"text-muted-foreground text-xs",children:"Working days"}),t.jsx("div",{role:"group","aria-labelledby":"profile-days-label",className:"flex gap-1",children:ie.map(({day:r,short:c,name:S})=>{const T=o.days.includes(r);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(r),className:V("size-8 rounded-md border text-xs font-medium",T?"bg-primary text-primary-foreground border-transparent":"text-muted-foreground hover:bg-accent"),children:c},r)})})]}),t.jsxs("div",{className:"flex gap-3",children:[t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-start",className:"text-muted-foreground text-xs",children:"Start"}),t.jsx(v,{id:"profile-hours-start",type:"time",value:o.start,onChange:r=>g({start:r.target.value})})]}),t.jsxs("div",{className:"flex-1 space-y-1",children:[t.jsx("label",{htmlFor:"profile-hours-end",className:"text-muted-foreground text-xs",children:"End"}),t.jsx(v,{id:"profile-hours-end",type:"time",value:o.end,onChange:r=>g({end:r.target.value})})]})]}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("label",{htmlFor:"profile-away-until",className:"text-muted-foreground text-xs",children:"Away until"}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(v,{id:"profile-away-until",type:"date",value:o.awayUntil,onChange:r=>g({awayUntil:r.target.value})}),o.awayUntil&&t.jsx(P,{type:"button",variant:"ghost",size:"sm",onClick:()=>g({awayUntil:""}),children:"Clear"})]})]})]})}),t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx(P,{type:"button",size:"sm",onClick:L,disabled:a||m==="saving"||p!==null||b(o,u),children:m==="saving"?"Saving…":"Save"}),p&&t.jsx(j,{tone:"error",children:p}),!p&&m==="error"&&t.jsx(j,{tone:"error",children:y??"Couldn’t save that. Try again."}),!p&&m!=="error"&&F&&b(o,F)&&t.jsx(j,{tone:"ok",children:"Saved."})]})]})})}function fe({member:e}){return t.jsxs("div",{className:"space-y-4",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"How you appear on your team page, in rooms and beside your messages."}),t.jsx(K,{member:e}),t.jsx(Y,{member:e}),t.jsx($,{member:e}),t.jsx(G,{member:e}),t.jsx(Q,{}),t.jsx(me,{})]})}function N({children:e}){return t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:e})}function pe(){var n;const e=B(),s=(n=e.data)==null?void 0:n.members.find(a=>a.isSelf);return e.isPending?t.jsx(N,{children:"Loading your profile…"}):e.isError?t.jsx(N,{children:"Couldn’t load your profile. Reopen this tab to try again."}):s?t.jsx(fe,{member:s}):t.jsx(N,{children:"Couldn’t find your profile. Reopen this tab to try again."})}export{fe as P,pe as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a5 as O,a7 as E,a6 as I,aJ as h,a8 as j,aI as D,eN as S,r as b,j as l,G as z,I as q,B as k}from"./index-MHIn2TC9.js";function B(){var a,d,c,m,g,p;const r=O(),s=E(),{data:e,isLoading:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=j({mutationKey:D,mutationFn:u=>r.updateConfig({profile:u}),onSuccess:()=>{s.invalidateQueries({queryKey:h.all})}});return{roles:((a=e==null?void 0:e.profile)==null?void 0:a.roles)??[],rolePromptDismissedAt:((d=e==null?void 0:e.profile)==null?void 0:d.rolePromptDismissedAt)??null,identityPromptDismissedAt:((c=e==null?void 0:e.profile)==null?void 0:c.identityPromptDismissedAt)??null,timezone:((m=e==null?void 0:e.profile)==null?void 0:m.timezone)??null,workingHours:((g=e==null?void 0:e.profile)==null?void 0:g.workingHours)??null,away:((p=e==null?void 0:e.profile)==null?void 0:p.away)??null,isLoading:o,saveHours:u=>i.mutateAsync(u).then(()=>{}),saveRoles:u=>i.mutateAsync({roles:u}).then(()=>{}),dismissRolePrompt:()=>i.mutateAsync({rolePromptDismissedAt:new Date().toISOString()}).then(()=>{}),dismissIdentityPrompt:()=>i.mutateAsync({identityPromptDismissedAt:new Date().toISOString()}).then(()=>{})}}let x=!1;function K(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||null}catch{return null}}function Q(){const r=O(),s=E(),{data:e,isSuccess:o}=I({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:S}),i=e==null?void 0:e.profile;b.useEffect(()=>{if(x||!o||!i)return;if(i.timezone!=null){x=!0;return}const a=K();a&&(x=!0,r.updateConfig({profile:{timezone:a}}).then(()=>s.invalidateQueries({queryKey:h.all})).catch(()=>{}))},[o,i,r,s])}const w=[{id:"software-development",label:"Building software"},{id:"hiring",label:"Hiring people"},{id:"marketing",label:"Marketing"},{id:"writing",label:"Writing"},{id:"research",label:"Research"},{id:"business-ops",label:"Running a business"},{id:"design",label:"Design"},{id:"sales",label:"Sales"}],M=6,F={developer:"software-development",engineer:"software-development",programmer:"software-development",coder:"software-development","software engineer":"software-development",recruiter:"hiring",recruiting:"hiring",talent:"hiring",marketer:"marketing",growth:"marketing",writer:"writing",author:"writing",researcher:"research",scientist:"research",founder:"business-ops",entrepreneur:"business-ops",operations:"business-ops",ops:"business-ops",designer:"design",seller:"sales",salesperson:"sales"};function H(r){var i;const s=r.trim().toLowerCase();if(s.length===0)return;const e=w.find(a=>a.id===s);if(e)return e.id;const o=F[s];return o||((i=w.find(a=>a.label.toLowerCase()===s))==null?void 0:i.id)}const N=10,A=60;function v(r,s){const e=s.trim().toLowerCase();return r.some(o=>o.trim().toLowerCase()===e)}function W({selected:r,onChange:s,onConfirm:e,confirmLabel:o,onSkip:i,skipLabel:a,busy:d=!1,error:c=null}){const[m,g]=b.useState(!1),[p,u]=b.useState(""),C=b.useRef(null),y=w.slice(0,M),T=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=N,P=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},L=()=>{const t=p.trim().slice(0,A);if(!t)return;const n=H(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<N&&s([...r,R]),u("")};return l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex flex-wrap gap-1.5",role:"group","aria-label":"What kind of work you do",children:[y.map(t=>{const n=v(r,t.id);return l.jsx("button",{type:"button","aria-pressed":n,disabled:f&&!n,onClick:()=>P(t.id),className:z("focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",n?"border-primary bg-primary text-primary-foreground":"border-input bg-background text-foreground hover:bg-accent"),children:t.label},t.id)}),T.map(t=>l.jsx("button",{type:"button","aria-pressed":!0,onClick:()=>s(r.filter(n=>n!==t)),className:"border-primary bg-primary text-primary-foreground focus-visible:ring-ring rounded-md border px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none",children:t},t)),!m&&l.jsx("button",{type:"button",disabled:f,onClick:()=>{g(!0),setTimeout(()=>{var t;return(t=C.current)==null?void 0:t.focus()},0)},className:"border-input text-muted-foreground hover:bg-accent hover:text-foreground focus-visible:ring-ring rounded-md border border-dashed px-2.5 py-1 text-xs transition-colors duration-150 focus-visible:ring-2 focus-visible:outline-none disabled:opacity-50",children:"Something else"})]}),f&&l.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"profile-role-cap-hint",children:"Ten at most. Remove a role to add another."}),m&&!f&&l.jsx(q,{ref:C,value:p,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),L())},maxLength:A,placeholder:"Type your work and press Enter","aria-label":"Something else: describe your work",className:"h-8 text-xs"}),c&&l.jsx("p",{className:"text-destructive text-sm",role:"alert","data-testid":"profile-save-error",children:c}),l.jsxs("div",{className:"flex flex-wrap gap-2",children:[l.jsx(k,{size:"sm",onClick:e,disabled:d||r.length===0,"data-testid":"confirm-profile",children:o}),i&&l.jsx(k,{size:"sm",variant:"ghost",onClick:i,disabled:d,"data-testid":"skip-profile",children:a})]})]})}export{W as P,Q as a,K as b,B as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,_ as c,aR as l,G as i}from"./index-MHIn2TC9.js";const p=4,m={compact:"max-w-[200px] gap-1.5 px-2.5 py-1 text-xs",comfortable:"min-h-9 max-w-[280px] gap-2 px-3 py-1.5 text-sm"};function u({suggestions:o,onChipClick:s,ariaLabel:r="Suggested follow-ups",size:a="compact"}){const n=o.slice(0,p);return e.jsx(c.div,{"data-slot":"prompt-suggestion-chips",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":r,className:"mt-1.5 flex flex-wrap items-center gap-2",children:n.map(t=>e.jsxs("button",{type:"button","aria-label":t,title:t,onClick:()=>s(t),className:i("bg-secondary text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:ring-ring inline-flex items-center truncate rounded-md transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-offset-2",m[a]),children:[e.jsx(l,{className:i("shrink-0",a==="compact"?"size-3":"size-3.5")}),e.jsx("span",{className:"truncate",children:t})]},t))})}export{u as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,b as D,z as P,j as e,e as O,D as _,F as U,G as C,t as z,g as F,J as K,K as M}from"./index-
|
|
1
|
+
import{r as g,b as D,z as P,j as e,e as O,D as _,F as U,G as C,t as z,g as F,J as K,K as M}from"./index-MHIn2TC9.js";import{u as Y}from"./use-mounted-ref-Dz1h70pz.js";const A="REPORTS_TO_CYCLE",q="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function B({option:a,selected:d,focusable:i,isDefault:p,disabled:x,onPick:c}){const n=z(a.member);return e.jsxs("button",{type:"button",role:"radio","aria-checked":d,tabIndex:i?0:-1,disabled:x,onClick:c,className:C(M,"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 text-left text-sm","hover:bg-accent disabled:opacity-60"),children:[e.jsx(F,{size:"xs",kind:n.kind,color:n.color,emoji:n.emoji,imageUrl:n.imageUrl,fallback:n.fallback,origin:n.origin,badge:null}),e.jsxs("span",{className:"min-w-0 flex-1 truncate",children:[a.label,p&&e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"text-muted-foreground",children:"(default)"})]})]}),d&&e.jsx(K,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function J({member:a}){var y,R;const d=Y(),i=g.useRef(null),p=g.useId(),x=g.useId(),{agent:c,isPending:n,isSaving:h,error:u,update:b}=D(a,{errorLabel:"Couldn’t change who this agent reports to",isShownInline:t=>d.current===!0&&t.code===A}),j=P();if(n||j.isPending)return e.jsx(O,{className:"h-24 w-full"});if(!c)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const I=((y=j.data)==null?void 0:y.members)??[],l=_(c,I,a),m=U(c.id,I,a),E=m.some(t=>t.accountId===l.accountId)?l.accountId:((R=m[0])==null?void 0:R.accountId)??null,L=t=>{var v;const s=Array.from(((v=i.current)==null?void 0:v.querySelectorAll('[role="radio"]'))??[]),r=s.indexOf(document.activeElement),o={ArrowDown:r+1,ArrowRight:r+1,ArrowUp:r-1,ArrowLeft:r-1,Home:0,End:s.length-1}[t.key];if(o===void 0||s.length===0)return;t.preventDefault();const f=s[(o+s.length)%s.length];s.forEach(N=>N.tabIndex=N===f?0:-1),f==null||f.focus()},S=m.filter(t=>t.kind==="person"),T=m.filter(t=>t.kind==="agent"),k=(u==null?void 0:u.code)===A?u.message:null,w=(t,s,r)=>r.length>0&&e.jsxs("div",{role:"group","aria-labelledby":s,className:"space-y-0.5",children:[e.jsx("div",{id:s,className:C(q,"px-1.5"),children:t}),r.map(o=>e.jsx(B,{option:o,selected:l.accountId===o.accountId,focusable:E===o.accountId,isDefault:l.isDefault&&l.accountId===o.accountId,disabled:h,onPick:()=>{o.accountId!==c.reportsTo&&b({reportsTo:o.accountId})}},o.accountId))]});return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-reports-to",children:[e.jsxs("div",{ref:i,role:"radiogroup","aria-label":"Reports to",onKeyDown:L,className:"max-h-72 space-y-2 overflow-y-auto",children:[w("People",p,S),w("Agents",x,T)]}),k&&e.jsx("p",{role:"alert",className:"text-status-error px-1.5 text-xs",children:k}),!l.isDefault&&e.jsx("button",{type:"button",disabled:h,onClick:()=>b({reportsTo:null}),className:"text-muted-foreground hover:text-foreground px-1.5 text-xs underline-offset-2 hover:underline",children:"Use the default"})]})}export{J as ReportsToPopover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a5 as he,a8 as pe,a7 as Ke,j4 as Ge,j5 as le,j6 as je,j7 as Ue,j8 as Xe,j9 as Ye,aQ as Qe,r as n,j as t,G as ae,B as ge,x as Ve,aZ as we,ja as Ze,e as se,gA as Ee,hk as Je,gz as Pe,jb as et,jc as tt,_ as xe,jd as _e,je as Le,C as nt,n as st,gD as Z,dL as ot,fF as rt,jf as at,jg as it,jh as dt,ct as lt,ji as ut,jj as ct,jk as ft,jl as mt,cp as ht,jm as pt,gy as te,jn as gt,l as xt,s as ke,jo as vt,jp as Rt,ee as yt,X as bt,eb as jt,jq as wt,jr as Ne,js as kt,af as Nt,jt as It,gx as At,gw as St,ju as Ct,aG as Ie,Z as Mt}from"./index-MHIn2TC9.js";import{P as Tt,u as Ot}from"./pane-resize-handle-BL7Meu5R.js";import{D as Et,U as Pt,u as _t}from"./UnreadDivider-B_OMR0mQ.js";import{u as Lt}from"./use-room-follow-claim-ByaYVY0o.js";import{i as Dt,a as ve,e as Re,g as Ft,f as De,h as zt,j as Fe,c as V,d as oe,k as Ht,l as ce,b as fe,m as me,A as ze,n as He,t as ye,r as $t,o as re,R as be,u as $e,C as qe,p as qt}from"./ChannelComposer-D4TYVkvO.js";import{u as Wt,f as Bt,a as Kt,F as Gt,C as J,d as Ut,M as Xt}from"./registry-fiUD5cv6.js";import{u as Yt}from"./use-connector-management-FONU6FK8.js";import{A as Qt}from"./AgentRequestCard-C8GV5Sxn.js";import{u as Vt}from"./use-room-sessions-DPB29acU.js";function Zt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.haltRoomAgent(s,o),meta:{errorLabel:"Couldn’t stop this agent"}})}function Jt(){const e=he();return pe({mutationFn:({roomId:s,authorId:o})=>e.promoteHold(s,o),meta:{errorLabel:"Couldn’t ask to be answered first"}})}function en(e){const s=he(),o=Ke(),a=Ge(e),b=le(m=>{var f;return e===null?null:((f=m.paging[e])==null?void 0:f.cursor)??null}),r=pe({mutationFn:async m=>{var g;const f=(g=le.getState().paging[m])==null?void 0:g.cursor;if(f==null)return;const j=await s.listRoomEntries(m,{before:f,limit:je}),k=Qe.entries(m),I=o.getQueryData(k),A=Ue(I,j);o.setQueryData(k,A),le.getState().notePage(m,Xe(j)??f,Ye(j,je)||A.length===((I==null?void 0:I.length)??0))},meta:{errorLabel:"Couldn't load older messages"}}),{mutateAsync:i,isPending:p}=r,v=n.useRef(!1),h=n.useCallback(async()=>{if(!(e===null||v.current)){v.current=!0;try{await i(e).catch(()=>{})}finally{v.current=!1}}},[e,i]);return{canLoadOlder:a,isLoadingOlder:p,cursor:b,loadOlder:h}}function tn({id:e,summary:s,open:o,onOpen:a,endsGroup:b}){const{capabilities:r}=Wt(),{count:i,lastAt:p,unread:v}=s,h=Bt(p),[m,f]=n.useState({count:i,bumped:!1});m.count!==i&&f({count:i,bumped:!0});const j=m.count===i&&m.bumped;return r.threads?t.jsx("button",{type:"button",id:e,"data-slot":"thread-reply-row","data-testid":"room-thread-replies","data-unread":v>0?"":void 0,"aria-expanded":o,onClick:a,className:ae("focus-ring ml-[calc(var(--msg-padding-x)_+_var(--msg-gutter-width)_+_var(--msg-gap))]","hover:bg-row-hover flex w-fit items-center rounded-md text-left text-xs transition-colors",b===void 0?"mb-1":"mt-2",b===!0&&"mb-[var(--msg-padding-y-end)]",b===!1&&"mb-1","h-11 px-2 md:h-7",v>0?"text-foreground font-medium":"text-muted-foreground hover:text-foreground"),children:t.jsxs("span",{children:[t.jsx("span",{"aria-hidden":!0,className:"mr-1",children:"↳"}),t.jsx("span",{className:ae(j&&"motion-safe:animate-count-flip"),"data-testid":"room-thread-reply-count",children:i},i),i===1?" reply":" replies",h.length>0&&t.jsxs(t.Fragment,{children:[" · last ",t.jsx("time",{dateTime:p,title:Kt(p),children:h})]}),v>0&&` · ${v} new`]})}):null}const nn=3;function sn(e,s){const o=[],a=new Map,b=new Map;let r=0;for(;r<e.length;){const i=r;for(;r<e.length&&e[r].kind==="notice";)r++;const p=e.slice(i,r);if(p.length===0){o.push(e[r]),r++;continue}const v=p[p.length-1],h=p.filter(g=>g!==v&&!Dt(g.body.notice));if(p.length<nn||h.length===0){o.push(...p);continue}const m=p[0].id,f=s.has(m),j={runId:m,count:h.length,expanded:f},k=new Set(h);for(const g of h)b.set(g.id,m);if(f){a.set(p[0].id,j),o.push(...p);continue}const I=p.findIndex(g=>k.has(g)),A=p.slice(I).find(g=>!k.has(g));a.set(A.id,j),o.push(...p.filter(g=>!k.has(g)))}return{visible:o,foldBefore:a,runOf:b}}function on({loading:e,onLoad:s}){return t.jsx("div",{className:"flex justify-center px-4 py-3",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"sm",onClick:s,disabled:e,"data-testid":"room-load-older",className:"text-muted-foreground hover:text-foreground h-7 gap-2 text-xs",children:[e&&t.jsx(Ve,{size:"xs"}),e?"Loading older messages…":"Older messages"]})})}const rn="ROOM.md";function an(e){return e==null?void 0:e.find(s=>s.pinned&&s.content.type==="file"&&s.content.sourcePath===rn)}function dn({roomId:e}){const s=we(a=>an(a.roomCanvasDocuments[e]));if(!s)return null;const o=()=>{const a=we.getState();a.activateRoomCanvasDocument(e,s.id),Ze(a,"user")};return t.jsxs("p",{className:"max-w-sm text-xs","data-testid":"room-md-hint",children:["This channel has a ROOM.md for its goal and rules."," ",t.jsx("button",{type:"button",onClick:o,className:"text-foreground focus-ring rounded-sm underline underline-offset-2",children:"Open"})]})}const ln="room-load-older",un=4;function We({roomName:e}){return t.jsx(Gt,{label:e===void 0?"Messages":`Messages in ${e}`,busy:!0,className:"flex flex-col gap-4 p-4","data-testid":"room-timeline-loading",children:Array.from({length:un},(s,o)=>t.jsxs("div",{className:"flex gap-3",children:[t.jsx(se,{className:"size-7 shrink-0 rounded-full"}),t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-2",children:[t.jsx(se,{className:"h-3 w-24"}),t.jsx(se,{className:"h-3 w-full max-w-md"})]})]},`room-skeleton-${o}`))})}function cn({roomId:e,roomName:s,viewerAuthorId:o,entries:a,members:b,formerAuthors:r,lastReadSeq:i,reactionFrequents:p,streamStalled:v,isLoading:h,error:m,onAddAgents:f,openThreadId:j,onOpenThread:k,resumeRow:I,landOnRow:A,onTopRow:g,canLoadOlder:C=!1,isLoadingOlder:d=!1,onLoadOlder:u,ref:O,roomKind:_}){const S=n.useMemo(()=>ve(b,r),[b,r]),B=Ee(b,o),T=Re(),P=n.useMemo(()=>new Map([...S].map(([y,Y])=>[y,Y.displayName])),[S]),D=Je(),Q=Pe(e,null),{topLevel:H,repliesByRoot:$,orphaned:K}=n.useMemo(()=>Ft(a),[a]),[F,G]=n.useState(()=>new Set),[X,L]=n.useState(null),q=n.useMemo(()=>sn(H,F),[H,F]),W=q.visible,c=n.useCallback(y=>{const Y=!F.has(y),N=new Set(F);Y?N.add(y):N.delete(y),G(N),L(Y?y:null)},[F]),x=n.useMemo(()=>new Map(a.map(y=>[y.id,y])),[a]),z=n.useMemo(()=>{const y=et(W,i),Y=tt(W.map(M=>({id:M.id,authorId:M.body.moment?`moment:${M.id}`:M.authorId,timestamp:M.createdAt})),{now:D,lastSeenId:y.lastSeenId,unreadFromStart:y.fromStart}),N=[];C&&!h&&N.push({kind:"load-older",id:ln});for(const M of Y){if(M.kind==="day-divider"){N.push({kind:"day-divider",id:M.key,label:M.label});continue}if(M.kind==="unread-divider"){N.push({kind:"unread-divider",id:M.key});continue}const U=W[M.index],ne=q.foldBefore.get(U.id);ne&&N.push({kind:"notice-fold",id:`notice-fold:${ne.runId}`,fold:ne});const de=$.get(U.id);N.push({kind:"message",id:U.id,entry:U,grouping:M.grouping,position:M.index+1,answers:De(U,W[M.index-1],x.get.bind(x)),headsThread:de!==void 0}),de&&N.push({kind:"thread-reply",id:zt(U.id),rootId:U.id,replies:de,totalReplies:U.threadReplyCount,endsGroup:M.grouping.position==="last"||M.grouping.position==="only"})}return N},[W,q,$,x,i,D,C,h]),l=n.useMemo(()=>z.map(y=>y.kind==="load-older"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="notice-fold"?{kind:"notice",id:y.id,at:"",body:null}:y.kind==="day-divider"?{kind:"day-divider",id:y.id,label:y.label}:y.kind==="unread-divider"?{kind:"unread-divider",id:y.id}:y.kind==="thread-reply"?{kind:"thread-reply",id:y.id,rootId:y.rootId,replyCount:Fe(y.replies.length,y.totalReplies),lastAt:y.replies[y.replies.length-1].createdAt}:{kind:"message",id:y.id,payload:y.entry,grouping:y.grouping,author:V(oe(y.entry,S),S,T.faces),at:y.entry.createdAt}),[z,S,T.faces]),w=n.useCallback((y,Y)=>{const N=z[Y.index];if(N.kind==="load-older")return u===void 0?null:t.jsx(on,{loading:d,onLoad:u});if(N.kind==="notice-fold")return t.jsx(fn,{fold:N.fold,onToggle:()=>c(N.fold.runId)});if(N.kind==="day-divider")return t.jsx(Et,{label:N.label});if(N.kind==="unread-divider")return t.jsx(Pt,{});if(N.kind==="thread-reply"){if(Y.onOpenThread===void 0)return null;const ne=Y.onOpenThread;return t.jsx(tn,{id:ce(N.rootId),summary:Ht(N.replies,i,N.totalReplies),open:j===N.rootId,onOpen:()=>ne(N.rootId),endsGroup:N.endsGroup})}const M=oe(N.entry,S),U=t.jsx(fe,{roomId:e,entry:N.entry,author:V(M,S,T.faces),authorRef:S.get(M),authors:S,viewerAuthorId:o,authorNames:P,reactionFrequents:p,streamStalled:v,isMember:B,grouping:N.grouping,orphanedReply:K.has(N.entry.id),answers:N.answers,feedPosition:{index:N.position,total:-1},rowId:me(N.entry.id),roomKind:_,headsThread:N.headsThread});return X!==null&&q.runOf.get(N.entry.id)===X?t.jsx(xe.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:Le.normal,ease:_e.out},onAnimationComplete:()=>L(null),children:U}):U},[z,e,_,S,T.faces,o,P,p,v,B,K,i,j,d,u,q,X,c]),R=n.useCallback(y=>{if(y.kind==="message")return me(y.id);if(y.kind==="thread-reply")return ce(y.rootId)},[]);if(m)return t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load these messages"}),t.jsx("p",{className:"max-w-sm",children:"Nothing was lost. Reload to try again."})]});const E=b.some(y=>y.author.kind==="agent"),ee=t.jsxs("div",{className:"text-muted-foreground flex flex-col items-center gap-2 p-10 text-center text-sm",children:[t.jsx(st,{className:"text-muted-foreground size-8 md:size-6","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:"Nothing said here yet"}),t.jsx("p",{className:"max-w-sm",children:E?"Say something to get it going.":"Nothing answers until you add an agent."}),t.jsx(ge,{type:"button",size:"sm",variant:E?"ghost":"default",onClick:f,className:"mt-1",children:E?"Add more agents":"Add agents"}),t.jsx(dn,{roomId:e})]});return t.jsx(ze,{known:T,children:t.jsx(J.Timeline,{ref:O,conversationId:e,label:`Messages in ${s}`,rows:l,renderRow:w,onOpenThread:k,domIdOf:R,...I===void 0?{}:{resumeRow:I},...A===void 0?{}:{landOnRow:A},...g===void 0?{}:{onTopRow:g},pending:Q,viewerAuthorId:o,loading:h?t.jsx(We,{roomName:s}):void 0,empty:ee,feedTestId:"room-timeline"})})}function fn({fold:e,onToggle:s}){const o=e.count===1?"notice":"notices";return t.jsx("div",{"data-testid":"room-notice-fold",className:"py-0.5 pr-[var(--msg-padding-x)] pl-[calc(var(--msg-padding-x)+var(--msg-gutter-width)+var(--msg-gap))]",children:t.jsxs(ge,{type:"button",variant:"ghost",size:"xs","aria-expanded":e.expanded,"aria-label":`${e.expanded?"Hide":"Show"} ${e.count} earlier ${o}`,onClick:s,className:"text-muted-foreground hover:text-foreground -ml-2 font-normal",children:[t.jsx(xe.span,{"aria-hidden":!0,className:"inline-flex",initial:!1,animate:{rotate:e.expanded?90:0},transition:{duration:Le.fast,ease:_e.out},children:t.jsx(nt,{className:"size-(--size-icon-xs)"})}),e.expanded?`Hide ${e.count} earlier`:`${e.count} earlier`]})})}function mn(e){const{roomId:s,entrySeq:o,entries:a,historyLoaded:b}=e,r=o===void 0?null:`${s}:${o}`,i=n.useMemo(()=>{if(o===void 0)return null;const I=a.find(d=>d.seq===o);if(I===void 0)return null;const A=He(a,I.id);if(A===null)return null;const g=ye(I)??null,C=g!==null&&A.rowId!==I.id;return{roomRowId:A.rowId,threadRootId:C?g:null,entryId:I.id}},[a,o]),p=n.useRef(null),v=(i==null?void 0:i.threadRootId)??null;n.useEffect(()=>{r===null||v===null||p.current!==r&&(p.current=r,Z.getState().openThread(s,v))},[r,s,v]);const h=n.useRef(null);n.useEffect(()=>{r===null||!b||i===null&&h.current!==r&&(h.current=r,ot.info("That message isn’t in the loaded history",{description:"Only recent messages are open. Nothing was lost."}))},[r,b,i]);const m=n.useRef(null),f=n.useCallback(()=>{if(!(r===null||m.current===r))return m.current=r,i==null?void 0:i.roomRowId},[r,i]),j=n.useRef(null),k=n.useCallback(()=>{if(!(r===null||j.current===r))return j.current=r,(i==null?void 0:i.threadRootId)===null||i==null?void 0:i.entryId},[r,i]);return{roomRow:o===void 0?void 0:f,threadRow:o===void 0?void 0:k}}function hn(e,s){const[o,a]=n.useState({roomId:null,seq:null});return o.roomId===e?o.seq:e===null?(a({roomId:null,seq:null}),null):s===null?null:(a({roomId:e,seq:s}),s)}const pn=600;function gn(e){return document.getElementById(ce(e))??document.getElementById(me(e))}function xn(){const e=n.useRef(null);return n.useEffect(()=>()=>{var o;return(o=e.current)==null?void 0:o.call(e)},[]),{arm:n.useCallback(o=>{var p;(p=e.current)==null||p.call(e);let a=0;const b=Date.now()+pn;let r=!1;const i=()=>{if(r)return;const v=document.activeElement;if(v===null||v===document.body||!v.isConnected){const m=gn(o);if(m!==null){m.focus();return}}Date.now()>=b||(a=requestAnimationFrame(i))};a=requestAnimationFrame(i),e.current=()=>{r=!0,cancelAnimationFrame(a)}},[])}}function vn({roomId:e,route:s,urlThreadId:o,openThreadId:a,entries:b,historyLoaded:r}){const i=rt(),p=n.useRef(null);n.useEffect(()=>{if(e!==null){if(p.current!==e&&(p.current=e,o!==void 0)){Z.getState().openThread(e,o);return}if(r&&a!==void 0){const v=b.find(m=>m.id===a),h=v===void 0?void 0:$t(v);if(h!==void 0&&h!==a){const m=Z.getState().open[e];Z.getState().openThread(e,h,(m==null?void 0:m.focusComposer)??!1);return}}a!==o&&(i==null||i({to:s,search:v=>({...v,thread:a}),replace:!0}))}},[e,s,a,o,b,r,i])}function Rn(e){return e.kind!=="channel"||e.bridge!=null||e.archived?!1:!e.members.some(s=>s.author.kind==="agent")}function yn({room:e,hasEntries:s,onAddAgents:o}){return!s||!Rn(e)?null:t.jsxs("p",{className:"text-muted-foreground shrink-0 px-4 pb-1 text-xs","data-testid":"no-agent-hint",children:["No agent is in this channel to answer."," ",t.jsx("button",{type:"button",onClick:o,className:"text-foreground focus-visible:ring-ring rounded-sm underline underline-offset-2 focus-visible:ring-2 focus-visible:outline-none",children:"Add one"})," ","to get answers here."]})}function bn({roomId:e}){const{approvals:s}=at(),o=it(s).filter(a=>a.roomId===e);return o.length===0?null:t.jsx("section",{"data-slot":"room-approvals","aria-label":"Requests waiting on you",className:"shrink-0 px-3 pb-2 md:px-4",children:t.jsx(dt,{approvals:o})})}function jn({roomId:e}){const{data:s}=Yt("pending"),o=(s??[]).filter(a=>a.roomId===e);return o.length===0?null:t.jsx("section",{"data-slot":"room-agent-requests","aria-label":"Apps agents are asking for",className:"shrink-0 space-y-2 px-3 pb-2 md:px-4",children:o.map(a=>t.jsx(Qt,{request:a},a.requestId))})}const wn="An agent",Ae=64,ue=3,kn=new Set;function Be({room:e,entries:s,scope:o,laneScope:a,stalled:b,unavailable:r=!1,onRetry:i,onScrollToRow:p}){const v=lt(),h=ut(e.id,o),m=ct(e.id,o),f=ft(e.id,o),[j,k]=n.useState(!1),I=Vt(e.id,{enabled:j}),A=mt(),{mutate:g}=Zt(),[C,d]=n.useState(kn),u=n.useCallback(l=>{d(w=>new Set(w).add(l)),g({roomId:e.id,authorId:l},{onSettled:()=>d(w=>{const R=new Set(w);return R.delete(l),R})})},[g,e.id]),O=Jt(),[_,S]=n.useState(()=>new Map),B=ht(),T=Re(),P=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),D=n.useCallback(l=>{var w;return((w=P.get(l))==null?void 0:w.displayName)??wn},[P]),{interactions:Q}=pt(),H=n.useMemo(()=>Q.filter(l=>l.roomId===e.id),[Q,e.id]),$=n.useMemo(()=>{var w;const l={};for(const R of H){if(R.roomAuthorId===void 0)continue;const E=(w=P.get(R.roomAuthorId))==null?void 0:w.displayName;E!==void 0&&(l[R.sessionId]=E)}return l},[H,P]),K=n.useMemo(()=>h.map(l=>({authorId:l.authorId,name:D(l.authorId),state:l.state,since:l.since,activity:l.activity??null})),[h,D]),F=n.useMemo(()=>m.map(l=>{var R;const w=(R=B.data)==null?void 0:R.find(E=>E.id===l.behindRoomId);return{authorId:l.authorId,name:D(l.authorId),since:l.since,behind:{roomId:l.behindRoomId,title:w===void 0?null:te(w)},othersWaiting:l.othersWaiting,severalInTheWay:l.severalInTheWay}}),[m,D,B.data]),G=n.useMemo(()=>{const l=new Set;for(const w of m)_.get(w.authorId)===w.entryId&&l.add(w.authorId);return l},[m,_]),X=n.useMemo(()=>f===null?null:{authorId:f.authorId,name:D(f.authorId)},[f,D]),L=n.useMemo(()=>Ut({capabilities:be,asks:H,agentNames:$,stalled:b,presence:K,held:F,silentFinish:X,turn:null}),[H,$,K,F,X,b]),q=n.useMemo(()=>{var w;const l=new Map;for(const R of((w=I.data)==null?void 0:w.bindings)??[])l.set(R.authorId,R.sessionId);return l},[I.data]),W=n.useCallback(l=>{const w=s.find(E=>E.id===l);if(w===void 0)return null;const R=w.body.text.replace(/\s+/gu," ").trim();return R.length===0?null:R.length>Ae?`${R.slice(0,Ae).trimEnd()}…`:R},[s]),c=n.useCallback(l=>{var w;return a==="thread"?re(l):((w=He(s,l))==null?void 0:w.domId)??null},[s,a]),x=n.useMemo(()=>{const l=h.map(R=>{const E=W(R.entryId),ee=c(R.entryId);return{authorId:R.authorId,author:V(R.authorId,P,T.faces),state:R.state,since:R.since,doing:gt(R.activity),replyingTo:E===null||ee===null?null:{entryId:R.entryId,excerpt:E,rowId:ee},sessionId:q.get(R.authorId)??null}}),w=F.map(R=>({authorId:R.authorId,author:V(R.authorId,P,T.faces),state:"held",since:R.since,doing:null,replyingTo:null,sessionId:null,behind:R.behind,othersWaiting:R.othersWaiting}));return[...l,...w]},[h,F,P,T.faces,W,c,q]),z=n.useMemo(()=>{if(h.length===0)return null;const l=h.slice(0,ue);return t.jsxs("span",{"aria-hidden":"true",className:"flex shrink-0 -space-x-1",children:[l.map(w=>t.jsx(Xt,{author:V(w.authorId,P,T.faces),className:"ring-background size-4 ring-2"},w.authorId)),h.length>ue&&t.jsx("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-4 items-center justify-center rounded-full ring-2",children:`+${h.length-ue}`})]})},[h,P,T.faces]);return t.jsx(J.LiveLane,{state:L,scope:a,onRetry:i,unavailable:r,faces:z,onPeekOpenChange:k,askCard:L.kind==="ask"?t.jsx(vt,{ask:L.ask,...$[L.ask.sessionId]?{agentName:$[L.ask.sessionId]}:{},onOpenSession:l=>{v(ke({session:l}))},className:"border-l-0"}):void 0,peek:t.jsx(J.LivePeek,{rows:x,onScrollToRow:p,onOpenSession:l=>{v(ke({session:l}))},onOpenRoom:l=>{v({...xt.channels(),search:{id:l}})},onAnswerFirst:l=>{const w=m.find(R=>R.authorId===l);w!==void 0&&S(R=>new Map(R).set(l,w.entryId)),O.mutate({roomId:e.id,authorId:l})},promoted:G,onStopAll:()=>A.mutate({roomId:e.id}),stopping:A.isPending,onStopAgent:u,stoppingAgents:C})})}const Se=3e3;function Nn(e,s,o,a=Date.now){const b=n.useRef(null),r=n.useRef(new Map),i=n.useRef(new Map),p=b.current,v=r.current,h=i.current,m=a();for(const f of e){if(h.has(f.id))continue;if(p===null){h.set(f.id,"at-rest");continue}const j=v.get(f.authorId);h.set(f.id,j!==void 0&&m-j<Se?"handed-off":"dropped")}return n.useEffect(()=>{if(!o)return;b.current=new Set(e.map(j=>j.id));const f=a();for(const j of s)r.current.set(j,f);for(const[j,k]of r.current)f-k>Se&&r.current.delete(j);for(const j of i.current.keys())b.current.has(j)||i.current.delete(j)}),h}function In({kind:e}){return e==="thread-error"?t.jsxs("div",{"data-slot":"thread-notice","data-testid":"room-thread-error",className:"text-muted-foreground flex flex-col items-center gap-2 px-[var(--msg-padding-x)] py-6 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"Couldn’t load this thread"}),t.jsx("p",{className:"max-w-sm text-xs",children:"Nothing was lost. Reload to try again."})]}):e==="thread-waiting"?t.jsxs("div",{"data-slot":"thread-notice",className:"flex flex-col gap-2 px-[var(--msg-padding-x)]",children:[t.jsx(se,{className:"h-3 w-24"}),t.jsx(se,{className:"h-3 w-full max-w-sm"})]}):t.jsx("p",{"data-slot":"thread-notice","data-testid":"room-thread-orphan",className:"text-muted-foreground border-b px-[var(--msg-padding-x)] pb-3 text-xs",children:"This thread’s first message is gone. Its replies remain."})}function An({room:e,rootEntryId:s,focusComposer:o,entries:a,reactionFrequents:b,streamStalled:r,streamUnavailable:i,onRetryStream:p,historyLoaded:v,historyFailed:h=!1,landOnRow:m,pushed:f,onClose:j}){const k=n.useMemo(()=>ve(e.members,e.formerAuthors),[e.members,e.formerAuthors]),I=$e({room:e,threadRootId:s}),A=Ee(e.members,e.viewerAuthorId),g=Re(),C=n.useMemo(()=>new Map([...k].map(([c,x])=>[c,x.displayName])),[k]),{root:d,replies:u}=n.useMemo(()=>{let c;const x=[];for(const z of a)z.id===s?c=z:ye(z)===s&&x.push(z);return{root:c,replies:x}},[a,s]),O=d==null?void 0:d.threadReplyCount,_=O!==void 0&&O>u.length,S=!f,B=d===void 0||_?-1:(S?1:0)+u.length,T=Fe(u.length,O),P=n.useMemo(()=>new Set(u.map(c=>c.id)),[u]),D=n.useMemo(()=>({replyIds:P,inside:!0}),[P]),Q=Rt(e.id,D),H=Pe(e.id,s),$=Nn(u,Q,v),K=n.useRef(null),F=n.useCallback(c=>{var x;(x=K.current)==null||x.scrollToRow(c)},[]),G=n.useRef(null);n.useEffect(()=>{var c;o||(c=G.current)==null||c.focus()},[s,o]);const X=c=>{c.key!=="Escape"||c.defaultPrevented||(c.stopPropagation(),j())},L=n.useMemo(()=>{const c=[];if(d===void 0){const x=h?"thread-error":v?"thread-orphan":"thread-waiting";c.push({kind:"notice",id:x,at:"",body:null})}else S&&c.push({kind:"message",id:d.id,payload:d,grouping:{position:"only"},author:V(oe(d,k),k,g.faces),at:d.createdAt});for(const x of u)c.push({kind:"message",id:x.id,payload:x,grouping:{position:"only"},author:V(oe(x,k),k,g.faces),at:x.createdAt});return c},[d,S,u,k,g.faces,h,v]),q=n.useCallback(c=>{if(c.kind==="notice")return t.jsx(In,{kind:c.id});if(c.kind!=="message")return null;const x=c.payload,z=d!==void 0&&x.id===d.id,l=u.findIndex(E=>E.id===x.id),w=t.jsx(fe,{roomId:e.id,entry:x,rowId:re(x.id),roomKind:e.kind,author:c.author,authorRef:k.get(x.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"},answers:De(x,l<=0?d:u[l-1],E=>(d==null?void 0:d.id)===E?d:u.find(ee=>ee.id===E)),feedPosition:{index:z?1:(d===void 0||!S?0:1)+l+1,total:B}});if(z)return t.jsxs(t.Fragment,{children:[w,t.jsx(Ce,{count:T})]});const R=$.get(x.id)??"at-rest";return t.jsx("div",{className:ae(R==="dropped"&&"motion-safe:animate-thread-reply-in",R==="handed-off"&&"motion-safe:animate-reply-settle"),children:w})},[d,S,u,T,$,e.id,e.kind,e.viewerAuthorId,k,C,b,r,A,B]),W=n.useCallback(c=>c.kind==="message"?re(c.id):void 0,[]);return t.jsx(ze,{known:g,children:t.jsx(J.Root,{surface:"room",capabilities:be,target:I.target,anchor:"rail",children:t.jsxs("section",{ref:G,"aria-label":"Thread","data-testid":"room-thread-panel",tabIndex:-1,onKeyDown:X,className:ae("bg-card flex min-h-0 flex-col outline-none",f?"h-full w-full":"w-full border-l"),children:[f?t.jsxs("header",{className:"flex items-center gap-2 border-b px-1 py-1",children:[t.jsxs("button",{type:"button",onClick:j,"aria-label":`Back to ${te(e)}`,"data-testid":"room-thread-back",className:"focus-ring text-muted-foreground hover:text-foreground flex h-11 min-w-0 items-center gap-1 rounded px-2 text-sm",children:[t.jsx(yt,{"aria-hidden":!0,className:"size-4 shrink-0"}),t.jsx("span",{className:"truncate",children:te(e)})]}),t.jsx("p",{className:"ml-auto shrink-0 pr-3 text-sm font-medium",children:"Thread"})]}):t.jsxs("header",{className:"flex items-center gap-2 border-b px-3 py-2",children:[t.jsx("button",{type:"button",onClick:j,"aria-label":"Close thread",className:"focus-ring text-muted-foreground hover:text-foreground relative -ml-1 rounded p-1",children:t.jsx(bt,{"aria-hidden":!0,className:"size-4"})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-sm font-medium",children:"Thread"}),t.jsx("p",{className:"text-muted-foreground truncate text-xs",children:te(e)})]})]}),f&&d!==void 0&&t.jsxs("div",{"data-testid":"room-thread-pinned-root",className:"max-h-[40%] shrink-0 overflow-y-auto border-b pt-2",children:[t.jsx(fe,{roomId:e.id,entry:d,rowId:re(d.id),roomKind:e.kind,author:V(oe(d,k),k,g.faces),authorRef:k.get(d.authorId),authors:k,viewerAuthorId:e.viewerAuthorId,authorNames:C,reactionFrequents:b,streamStalled:r,isMember:A,grouping:{position:"only"}}),t.jsx(Ce,{count:T})]}),t.jsx(J.Timeline,{ref:K,conversationId:`thread-${s}`,label:`Thread in ${te(e)}`,busy:!v&&!h,rows:L,renderRow:q,domIdOf:W,...m===void 0?{}:{landOnRow:m},pending:H,viewerAuthorId:e.viewerAuthorId,className:"py-3",feedTestId:"room-thread-feed"}),t.jsx(Be,{room:e,entries:a,scope:D,laneScope:"thread",stalled:f&&r===!0,unavailable:i,onRetry:f?p:void 0,onScrollToRow:F}),t.jsx(qe,{room:e,threadRootId:s,attachments:I.attachments,focusOnMount:o},s)]})})})}function Ce({count:e}){return e===0?null:t.jsxs("div",{"aria-hidden":!0,"data-testid":"room-thread-divider",className:"flex items-center gap-2 px-[var(--msg-padding-x)] pt-1 pb-2",children:[t.jsx("span",{className:"text-muted-foreground shrink-0 text-xs",children:e===1?"1 reply":`${e} replies`}),t.jsx("span",{className:"bg-border h-px flex-1"})]})}const Sn=96,Cn=500;function Mn(e){return e.offset.x>Sn||e.velocity.x>Cn}function Tn({children:e,onClose:s}){const o=jt()===!0,a=o?{x:0}:{x:"100%"};return t.jsx(xe.div,{"data-testid":"room-thread-sheet",className:"bg-card absolute inset-0 z-10 flex flex-col shadow-xl",initial:a,animate:{x:0},exit:a,transition:o?{duration:0}:{duration:.22,ease:[.32,.72,0,1]},drag:"x",dragDirectionLock:!0,dragConstraints:{left:0,right:0},dragElastic:{left:0,right:.9},dragMomentum:!1,onDragEnd:(b,r)=>{Mn(r)&&s()},children:e})}const ie="room-thread-split",On=320,En=360,Pn=40,_n=50,Ln=25;function Me(e,s){return s<=0?Ln:Math.min(Math.round(e/s*1e3)/10,_n)}function Dn(e){const s=Me(On,e),o=Math.round((100-Me(En,e))*10)/10;return{minPct:s,maxPct:o,defaultPct:Math.min(Math.max(Pn,s),o)}}function Fn(e,s,o){if(e===null||s===null||s<=0)return o.defaultPct;const a=e/s*100;return Math.round(Math.min(Math.max(a,o.minPct),o.maxPct)*10)/10}function zn(e){try{const s=localStorage.getItem(e),o=s===null?NaN:Number(s);return Number.isFinite(o)&&o>0?o:null}catch{return null}}function Hn(e,s){try{localStorage.setItem(e,String(Math.round(s)))}catch{}}const $n="react-resizable-panels:room-thread-split";function qn(){try{localStorage.removeItem($n)}catch{}}function Wn(){const[e,s]=n.useState(null),[o,a]=n.useState(null);return{ref:n.useCallback(r=>{if(r===null)return;s(r);const i=()=>a(r.offsetWidth);i();const p=new ResizeObserver(i);return p.observe(r),()=>{p.disconnect(),s(null),a(null)}},[]),element:e,width:o,sizing:Dn(o??0)}}const Bn=`${ie}-room`,Te=`${ie}-thread`,Oe=`${ie}-handle`,Kn=4;function Gn({room:e,thread:s,storageKey:o=kt.ROOM_THREAD_WIDTH}){const{ref:a,element:b,width:r,sizing:i}=Wn(),[p,v]=n.useState(()=>zn(o)),[h,m]=n.useState(null),f=n.useRef(null),j=Fn(p,r,i),k=r===null||(i.maxPct-i.minPct)/100*r<Kn,I=s!==!1;n.useEffect(qn,[]);const A=n.useRef(!1);n.useLayoutEffect(()=>{var u;A.current&&((u=f.current)==null||u.resize(j))},[j,I]);const g=n.useRef(null),C=()=>{var S;const u=(S=f.current)==null?void 0:S.getSize(),O=g.current;if(g.current=null,u===void 0||r===null||r<=0||O===u)return;const _=Math.round(u/100*r);v(_),Hn(o,_)},d=h??j;return n.useLayoutEffect(()=>{const u=b==null?void 0:b.querySelector(`[data-panel-resize-handle-id="${Oe}"]`);u&&(u.setAttribute("aria-controls",Te),u.setAttribute("aria-valuenow",String(Math.round(d))),u.setAttribute("aria-valuemin",String(Math.round(i.minPct))),u.setAttribute("aria-valuemax",String(Math.round(i.maxPct))))}),t.jsx("div",{ref:a,className:"h-full overflow-hidden",children:t.jsxs(wt,{direction:"horizontal",id:ie,onLayout:u=>{A.current=u.length>1,m(A.current?u[1]:null)},children:[t.jsx(Ne,{id:Bn,order:1,className:"flex",children:e}),I&&t.jsxs(t.Fragment,{children:[t.jsx(Tt,{id:Oe,"aria-label":"Resize thread","data-testid":"room-thread-resize-handle",disabled:k,onDragging:u=>{var O;u&&(g.current=((O=f.current)==null?void 0:O.getSize())??null)},onKeyDownCapture:u=>{var O,_;k||(g.current=((O=f.current)==null?void 0:O.getSize())??null,!(u.key!=="Home"&&u.key!=="End")&&(u.preventDefault(),(_=f.current)==null||_.resize(u.key==="Home"?i.minPct:i.maxPct)))},onResizeEnd:C}),t.jsx(Ne,{ref:f,id:Te,order:2,defaultSize:j,minSize:i.minPct,maxSize:i.maxPct,className:"flex",children:s})]})]})})}function ns({roomId:e,threadId:s,entrySeq:o,threadRoute:a,aboveTimeline:b,aboveComposer:r,offerJumpBackIn:i,onComposerFocusChange:p}){const v=Nt(),h=Ot(),m=It(e),f=m==null?void 0:m.rootEntryId,j=xn(),k=n.useCallback(()=>{var x;const c=(x=Z.getState().open[e])==null?void 0:x.rootEntryId;Z.getState().closeThread(e),c!==void 0&&j.arm(c)},[e,j]),I=n.useCallback(c=>{Z.getState().openThread(e,c)},[e]),A=At(e),g=St(e),C=_t(e,g.isSuccess);Lt(e);const d=A.data,u=n.useMemo(()=>g.data??[],[g.data]),O=$e({room:d});vn({roomId:e,route:a,urlThreadId:s,openThreadId:f,entries:u,historyLoaded:g.isSuccess});const _=n.useMemo(()=>{var c;return((c=d==null?void 0:d.members.find(x=>x.author.id===d.viewerAuthorId))==null?void 0:c.lastReadSeq)??null},[d]),S=hn(e,_);Ct(d,u);const B=n.useRef(null),T=n.useRef(void 0),P=n.useCallback(c=>{T.current=c},[]),D=n.useCallback(()=>T.current,[]);n.useLayoutEffect(()=>{T.current=void 0},[e]);const Q=n.useCallback(c=>{var x;(x=B.current)==null||x.scrollToRow(c)},[]),H=en(e),{loadOlder:$,cursor:K}=H,F=n.useCallback(()=>{const c=qt(u,K);$().then(()=>{c!==null&&requestAnimationFrame(()=>{var x;return(x=B.current)==null?void 0:x.scrollToRow(c.domId)})})},[u,K,$]),G=mn({roomId:e,entrySeq:o,entries:u,historyLoaded:g.isSuccess}),X=n.useMemo(()=>f===void 0?void 0:{replyIds:new Set(u.filter(x=>ye(x)===f).map(x=>x.id)),inside:!1},[u,f]);if(A.isLoading)return t.jsx("div",{className:"flex h-full flex-col","aria-busy":!0,children:t.jsx(We,{})});if(A.isError||!d)return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx("p",{className:"text-foreground font-medium",children:"That channel or DM isn’t here"}),t.jsx("p",{className:"max-w-sm",children:"It may be archived, or the link is old."})]});const L=m!==void 0&&t.jsx(An,{room:d,rootEntryId:m.rootEntryId,focusComposer:m.focusComposer,entries:u,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,streamUnavailable:C.unavailable,onRetryStream:C.retry,historyLoaded:g.isSuccess,historyFailed:g.isError,...G.threadRow===void 0?{}:{landOnRow:G.threadRow},pushed:v,onClose:k},m.rootEntryId),q=t.jsxs("div",{className:"flex min-w-0 flex-1 flex-col overflow-hidden",children:[b,t.jsx(cn,{ref:B,roomId:d.id,roomKind:d.kind,roomName:te(d),viewerAuthorId:d.viewerAuthorId,entries:u,members:d.members,formerAuthors:d.formerAuthors,lastReadSeq:S,reactionFrequents:d.reactionFrequents,streamStalled:C.stalled,isLoading:g.isLoading,error:g.error,onAddAgents:()=>Ie("add",d.id),openThreadId:f,onOpenThread:I,resumeRow:D,...G.roomRow===void 0?{}:{landOnRow:G.roomRow},onTopRow:P,canLoadOlder:H.canLoadOlder,isLoadingOlder:H.isLoadingOlder,onLoadOlder:F}),r,t.jsx(bn,{roomId:d.id}),t.jsx(jn,{roomId:d.id}),t.jsx(Be,{room:d,entries:u,scope:X,laneScope:"room",stalled:C.stalled,unavailable:C.unavailable,onRetry:C.retry,onScrollToRow:Q}),t.jsx(yn,{room:d,hasEntries:u.length>0,onAddAgents:()=>Ie("add",d.id)}),t.jsx(qe,{room:d,attachments:O.attachments,offerJumpBackIn:i,onFocusChange:p},d.id)]}),W={surface:"room",capabilities:be,target:O.target,anchor:"rail"};return v?t.jsx(J.Root,{...W,children:t.jsx("div",{style:{paddingBottom:h},"data-testid":"room-surface",className:"flex h-full flex-col overflow-hidden",children:t.jsxs("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",inert:L!==!1,"data-testid":"room-under-thread",children:q}),t.jsx(Mt,{initial:!1,children:L!==!1&&t.jsx(Tn,{onClose:k,children:L},`thread-${f}`)})]})})}):t.jsx(J.Root,{...W,children:t.jsx(Gn,{room:q,thread:L})})}export{ns as R,tn as T,We as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-
|
|
1
|
+
import{h as d,i as l,j as e,e as m,k as u,C as c,l as x,n as h,H as f}from"./index-MHIn2TC9.js";function g({kind:s}){const r="text-muted-foreground size-3.5 shrink-0";return s==="dm"?e.jsx(h,{"aria-hidden":!0,className:r}):e.jsx(f,{"aria-hidden":!0,className:r})}function p(s){return s===1?"1 member":`${s} members`}function N({member:s}){var i;const r=d(),n=l(s.id);if(n.isPending)return e.jsx(m,{className:"h-16 w-full"});if(n.isError)return e.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this member’s rooms."});const a=((i=n.data)==null?void 0:i.rooms)??[];return a.length===0?e.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.isSelf?"You aren’t":`${s.displayName} isn’t`," in any rooms yet."]}):e.jsx("div",{className:"flex flex-col",children:a.map(t=>{const o=e.jsxs(e.Fragment,{children:[e.jsx(g,{kind:t.kind}),e.jsx("span",{className:"min-w-0 truncate text-sm",children:u({kind:t.kind,slug:t.slug,title:t.name})}),e.jsx("span",{className:"text-muted-foreground ml-auto shrink-0 text-xs",children:p(t.memberCount)})]});return r?e.jsxs("button",{type:"button","data-slot":"profile-room-row",onClick:()=>void r({...x.channels(),search:{id:t.id}}),className:"focus-ring hover:bg-muted/50 flex h-9 items-center gap-2 rounded-md px-2 text-left transition-colors",children:[o,e.jsx(c,{"aria-hidden":!0,className:"text-muted-foreground/70 size-3.5 shrink-0"})]},t.id):e.jsx("div",{"data-slot":"profile-room-row",className:"flex h-9 items-center gap-2 rounded-md px-2",children:o},t.id)})})}export{N as RoomsPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as D,eb as Ee,j as e,Z as ye,_ as we,a2 as ke,G as C,by as ue,bz as fe,ef as Ae,eg as de,a4 as Le,bA as me,bC as xe,a5 as De,a7 as Te,a8 as Oe,af as pe,aO as $e,eh as he,ei as Ie,ej as Pe,ek as _e,aa as N,el as Ue,em as R,en as Me,ao as be,B as Re,U as Be,b as He,e as ze,eo as Ke,ep as qe,eq as Qe,er as Ve,es as Fe,et as Ge}from"./index-MHIn2TC9.js";import{C as ce}from"./runtime-connect-Dn0T5YWv.js";import{a as We,d as Xe,k as Ye,e as L}from"./execution-config-DYYeJyJh.js";import{U as Ze}from"./unverified-catalog-notice-DA96H8Df.js";import{s as Je}from"./settings-for-runtime-BoOa-ZFG.js";const et={duration:.12,ease:"easeOut"};function ve({isSetHere:a,serverDefault:l,onUseServerDefault:d,warning:r,className:s,"data-testid":i}){const[u,f]=D.useState(!1),o=a?"Set here":`Server default · ${l??"none"}`,n=a&&!!d,v=Ee(),p=e.jsx(ye,{mode:"wait",initial:!1,children:e.jsx(we.span,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:v?{duration:0}:et,className:"block truncate",children:o},o)});return n?e.jsxs(ue,{open:u,onOpenChange:f,children:[e.jsx(fe,{asChild:!0,children:e.jsx(Ae,{size:"sm",icon:r?Le:void 0,iconClassName:r?de.warning:void 0,"aria-label":`Set here${r?`: ${r}`:""}`,title:r?`${o}: ${r}`:o,className:s,"data-testid":i,children:p})}),e.jsxs(me,{className:"w-64 p-2",align:"start",children:[e.jsx(xe,{children:"Where this value comes from"}),r&&e.jsx("p",{className:C("px-2 pt-1 text-xs",de.warning),children:r}),e.jsxs("button",{type:"button",onClick:()=>{d(),f(!1)},className:"hover:bg-accent mt-1 w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors","data-testid":i?`${i}-reset`:void 0,children:["Use server default",l?e.jsxs("span",{className:"text-muted-foreground block text-xs",children:["Currently ",l]}):e.jsx("span",{className:"text-muted-foreground block text-xs",children:"Not set. Uses the built-in default."})]})]})]}):e.jsx(ke,{size:"xs",tone:r?"warning":"neutral",title:r?`${o}: ${r}`:o,"aria-label":r?`${o}: ${r}`:void 0,className:C("max-w-56",s),"data-testid":i,children:p})}const tt=["agents"];function st(a){const l=De(),d=Te();return Oe({...a!=null&&a.errorLabel?{meta:{errorLabel:a.errorLabel}}:{},mutationFn:r=>l.updateMeshAgent(r.id,r.updates),onSuccess:()=>{d.invalidateQueries({queryKey:["mesh","agents"]})},onSettled:()=>{d.invalidateQueries({queryKey:tt})}})}const je="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function U({label:a,valueLabel:l,options:d,selected:r,isSetHere:s,serverDefault:i,warning:u,onSelect:f,onInherit:o,testId:n,showHeader:v=!0,className:p,describedBy:m,inheritText:T}){const w=pe(),[S,h]=D.useState(!1);return e.jsxs("div",{className:C("space-y-1",p),children:[v&&e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:je,children:a}),!w&&e.jsx(ve,{isSetHere:s,serverDefault:i,warning:u,onUseServerDefault:o,"data-testid":`${n}-chip`})]}),e.jsxs(ue,{open:S,onOpenChange:h,children:[e.jsx(fe,{asChild:!0,children:e.jsxs("button",{type:"button",className:"border-input hover:bg-accent flex h-8 w-full items-center gap-1 rounded-md border px-2 text-sm transition-colors",...m?{"aria-describedby":m}:{},"data-testid":n,children:[e.jsx("span",{className:C("truncate",u?"text-status-warning-fg":s?"md:text-foreground text-status-warning-fg":"md:text-foreground text-status-success-fg"),children:l}),e.jsx(Be,{className:"text-muted-foreground ml-auto size-3.5 shrink-0"})]})}),e.jsxs(me,{className:"w-64 p-1",align:"start",children:[e.jsx(xe,{children:a}),e.jsx("div",{className:"max-h-72 overflow-y-auto",children:d.map(c=>e.jsxs("button",{type:"button","data-testid":`${n}-option-${c.value}`,onClick:()=>{f(c.value),h(!1)},className:C("hover:bg-accent w-full rounded-md px-2 py-1.5 text-left text-sm transition-colors",c.value===r&&"bg-accent"),children:[c.label,c.hint&&e.jsx("span",{className:"text-muted-foreground block text-xs",children:c.hint})]},c.value))}),e.jsx("button",{type:"button",onClick:()=>{o(),h(!1)},className:"hover:bg-accent border-border text-muted-foreground mt-1 w-full border-t px-2 py-2 text-left text-xs transition-colors","data-testid":`${n}-inherit`,children:T??(i?`Use server default: ${i}`:"Use server default")})]})]})]})}function at({agent:a,onUpdate:l,className:d}){var ee,te,se,ae,ne,oe,le,re,ie;const r=pe(),{data:s}=$e(),{data:i,isPending:u}=he(),f=((ee=s==null?void 0:s.executionDefaults)==null?void 0:ee.runtime)??"claude-code",o=a.runtime??f,n=(te=s==null?void 0:s.executionDefaults)==null?void 0:te.perRuntime.find(t=>t.runtime===o),{data:v}=Ie(),p=We(a,{defaultRuntime:f,runtimeDeclaresCredits:t=>{var b;return((b=i==null?void 0:i.capabilities[t])==null?void 0:b.credits)!==void 0},credits:(se=s==null?void 0:s.claudeCode)==null?void 0:se.credits,runtimeDefaultsToCredits:t=>{var b,A;return((A=(b=v==null?void 0:v.defaults)==null?void 0:b[t])==null?void 0:A.runsOn)==="credits"}}),{data:m,isError:T}=Pe({runtime:o,...p?{account:N}:{}}),w=a.model!=null,S=a.effort!=null,h=(n==null?void 0:n.model)??null,c=p&&(m??[]).some(t=>t.paidFromCredits),E=c?(m??[]).find(t=>t.isDefault):void 0,k=a.model??h??(E==null?void 0:E.value)??null,B=o==="doe"&&c&&!w&&!h,x=k?(m??[]).find(t=>t.value===k):void 0,O=(n==null?void 0:n.supportsEffort)??((ae=Je(i,o))==null?void 0:ae.supportsEffort),H=O===void 0&&u,z=O!==!1,K=x?x.supportsEffort??!1:void 0,q=(ne=s==null?void 0:s.claudeCode)==null?void 0:ne.accounts,{nameFor:Q,creditsEntry:ge,resolvedAccount:V}=_e(),F=ge??(a.account===N&&((oe=s==null?void 0:s.claudeCode)!=null&&oe.credits)?{path:s.claudeCode.credits.path}:null),j=q&&[...q.flatMap(t=>t.id===null?[]:[{id:t.id,label:Q(t.path),path:t.path}]),...F?[{id:N,label:Ue,path:F.path}]:[]],g=a.account??null,G=g!==null,W=o==="claude-code"&&g===N&&((le=s==null?void 0:s.claudeCode)==null?void 0:le.credits)!==void 0&&!s.claudeCode.credits.allowedAgents.includes(a.id),$=s!=null&&s.claudeCode&&V?Q(V):null,I=st({errorLabel:"Couldn’t change this agent’s account"}),P=D.useCallback(t=>{I.mutate({id:a.id,updates:{account:t}})},[a.id,I]),Ne=Xe({agent:{runtime:a.runtime,model:a.model,effort:a.effort,account:a.account},defaultRuntime:f,serverDefaultModel:h,knownModels:Ye(m),knownAccounts:j,accountsUnavailable:(re=s==null?void 0:s.claudeCode)==null?void 0:re.accountsUnavailable,modelSupportsEffort:K,runtimeSupportsEffort:O,runtimeLabel:t=>R(t).label}),y=t=>{var b;return((b=Ne.breakages.find(A=>t.includes(A.kind)))==null?void 0:b.message)??null},_=!H&&z&&K!==!1,X=a.effort??(n==null?void 0:n.effort)??null,Y=R(o).label,Ce=o==="claude-code"&&j!==void 0&&(j.length>1||G),Se=y(["account-unregistered"]),Z=(m??[]).some(t=>t.unverified),J=D.useId();return e.jsxs("div",{className:C("grid grid-cols-2 gap-3",d),children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(U,{label:"Model",valueLabel:B?ce:(x==null?void 0:x.displayName)??k??(c?"Default":"Automatic"),options:[...(m??[]).map(t=>({value:t.value,label:t.displayName,hint:t.description}))],selected:k,isSetHere:w,serverDefault:(n==null?void 0:n.model)??null,warning:y(["model-unavailable"]),onSelect:t=>l({model:t}),onInherit:()=>l({model:null}),testId:"agent-model-row",describedBy:Z?J:void 0,inheritText:B?ce:c&&!h?E?`Use the suggested model: ${E.displayName}`:"Use the default model":void 0}),Z&&e.jsx(Ze,{id:J}),c&&(m??[]).some(t=>t.creditsListOutOfDate)&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-out-of-date",children:"The models your DorkOS credits cover may be out of date."}),p&&T&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"agent-credits-models-unavailable",children:"Couldn’t load the models DorkOS credits cover. Try again in a moment."})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:je,children:"Effort"}),(!r||!_)&&(S||_)&&e.jsx(ve,{isSetHere:S,serverDefault:n!=null&&n.effort?L(n.effort):null,warning:y(["effort-unsupported-runtime","effort-unsupported-model"]),onUseServerDefault:()=>l({effort:null}),"data-testid":"agent-effort-row-chip"})]}),H?e.jsx(M,{testId:"agent-effort-pending",text:`Checking what ${Y} supports`,warning:null}):z?_?e.jsx(U,{label:"Effort",valueLabel:L(X),options:Me.filter(t=>!(x!=null&&x.supportedEffortLevels)||x.supportedEffortLevels.includes(t)).map(t=>({value:t,label:L(t)})),selected:X,isSetHere:S,serverDefault:n!=null&&n.effort?L(n.effort):null,warning:null,showHeader:!1,onSelect:t=>l({effort:t}),onInherit:()=>l({effort:null}),testId:"agent-effort-row"}):e.jsx(M,{testId:"agent-effort-unsupported-model",text:"This model doesn’t take an effort setting",warning:y(["effort-unsupported-model"])}):e.jsx(M,{testId:"agent-effort-unsupported-runtime",text:`Not supported by ${Y}`,warning:y(["effort-unsupported-runtime"])})]}),Ce&&e.jsx(U,{label:"Account",valueLabel:W?$??"Default":g!==null?((ie=j==null?void 0:j.find(t=>t.id===g))==null?void 0:ie.label)??g:$??"Default",options:(j??[]).map(t=>({value:t.id,label:t.label,hint:t.id===N?"Paid from your DorkOS account":be(t.path)})),selected:g,isSetHere:G,serverDefault:$,warning:Se,onSelect:t=>P(t),onInherit:()=>P(null),testId:"agent-account-row",className:"col-span-full"}),W&&e.jsxs("div",{className:"text-muted-foreground col-span-full flex flex-wrap items-center gap-2 text-xs","data-testid":"agent-credits-not-allowed",children:[e.jsx("span",{children:"This agent’s settings name DorkOS credits. It uses your default until you allow it."}),e.jsx(Re,{size:"sm",variant:"outline",className:"h-6 px-2 text-xs",disabled:I.isPending,onClick:()=>P(N),children:"Allow"})]})]})}function M({text:a,warning:l,testId:d}){return e.jsxs("div",{className:"flex h-8 flex-col justify-center","data-testid":d,children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:a}),l&&e.jsx("p",{className:"text-status-warning-fg text-xs",children:l})]})}const nt="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function ct({member:a}){const{agent:l,projectPath:d,isPending:r,update:s}=He(a),{data:i}=he();if(r)return e.jsx(ze,{className:"h-24 w-full"});if(!l)return e.jsx("p",{className:"text-muted-foreground p-1 text-sm",children:"Couldn’t read this agent’s settings."});const u=i?Object.keys(i.capabilities):[l.runtime],f=u.includes(l.runtime)?u:[l.runtime,...u];return e.jsxs("div",{className:"space-y-3 p-1","data-slot":"profile-runs-on",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:nt,children:"Runs on"}),e.jsxs(Ke,{value:l.runtime??"claude-code",onValueChange:o=>s({runtime:o}),children:[e.jsx(qe,{className:"h-8 text-sm",responsive:!1,children:e.jsx(Qe,{})}),e.jsx(Ve,{children:f.map(o=>e.jsx(Fe,{value:o,responsive:!1,children:R(o).label},o))})]})]}),e.jsx(at,{agent:l,onUpdate:s,className:"grid-cols-1"}),d&&e.jsxs("div",{className:"text-muted-foreground flex min-w-0 items-center gap-1.5",children:[e.jsx(Ge,{"aria-hidden":!0,className:"size-3.5 shrink-0"}),e.jsx("span",{className:"min-w-0 truncate font-mono text-xs",children:be(d)})]})]})}export{ct as RunsOnPopover};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aO as Ee,a5 as b,a7 as T,r as u,a8 as I,jW as q,jX as M,ek as Be,jY as Ge,a6 as Q,j as e,jZ as We,ey as Ye,ez as V,Q as we,T as Re,V as Ie,B as O,hZ as Ve,G as H,eX as He,ei as Je,j_ as Ze,j$ as Xe,eb as Le,_ as te,x as de,Z as es,J as ue,em as me,ev as C,ew as ne,aJ as ss,k0 as ts,I as U,k1 as ns,k2 as Ae,k3 as rs,a2 as Ke,fI as as,eo as is,ep as os,eq as ls,er as cs,es as be,ee as ds,C as us,k4 as ms,k5 as xs,k6 as hs,U as fs}from"./index-MHIn2TC9.js";import{C as De}from"./copy-button-Bp75zBSh.js";import{I as gs}from"./inline-code-B3qpjdZ2.js";import{u as ps}from"./useMutationState-B8ArIqeH.js";import{O as ys,a as Y}from"./runtime-connect-Dn0T5YWv.js";function js(){var s;return((s=Ee().data)==null?void 0:s.isLocalCaller)!==!1}function Ot(){const s=Ee().data;return((s==null?void 0:s.onTrustedConnection)??(s==null?void 0:s.isLocalCaller))!==!1}function Pt(s){var d,m;const t=b(),n=T(),[i,a]=u.useState(null),r=I({mutationFn:()=>(a(null),t.provisionRuntime(s,x=>a(x))),onSuccess:x=>{x.ok&&(n.invalidateQueries({queryKey:[...q]}),n.invalidateQueries({queryKey:[...M]}))}}),l=r.isError||((d=r.data)==null?void 0:d.ok)===!1,o=r.isError?r.error.message:((m=r.data)==null?void 0:m.error)??null,c=(o==null?void 0:o.trim().toLowerCase())==="not found"?"One-click install isn’t available here.":o;return{provision:()=>r.mutate(),isPending:r.isPending,isError:l,errorMessage:l?c??"Couldn’t install. Try again.":null,progress:i,result:r.data}}function Te(s){return["runtime-key-status",s]}function vs(s,t=!0){const n=b();return Q({queryKey:Te(s),queryFn:()=>n.getRuntimeKeyStatus(s),enabled:t,staleTime:3e4})}function ks(s){const t=b(),n=I({mutationFn:a=>t.checkRuntimeCredential(s,a.trim().length>0?a:null),meta:{suppressErrorToast:!0}}),i=n.data??(n.isError?{ok:!1,reason:"unexpected",message:n.error.message||"Couldn’t check the key."}:null);return{check:a=>n.mutate(a),isPending:n.isPending,result:i,checkedSavedKey:i!==null&&(n.variables??"").trim().length===0,reset:n.reset}}function Ns(s){var o,c,d;const t=b(),n=T(),[i,a]=u.useState(null),r=I({mutationFn:async m=>{a("checking");const x=await t.checkRuntimeCredential(s,m);return x.ok?(a("saving"),await t.storeRuntimeCredential(s,m),{saved:!0,message:null}):{saved:!1,message:x.message}},onSettled:()=>a(null),meta:{suppressErrorToast:!0},onSuccess:m=>{m.saved&&(n.invalidateQueries({queryKey:[...q]}),n.invalidateQueries({queryKey:[...M]}),n.invalidateQueries({queryKey:[...Te(s)]}))}}),l=((o=r.data)==null?void 0:o.saved)===!1;return{store:m=>{m.trim().length!==0&&r.mutate(m)},isPending:r.isPending,phase:i,isSuccess:((c=r.data)==null?void 0:c.saved)===!0,isError:r.isError||l,errorMessage:l?((d=r.data)==null?void 0:d.message)??null:r.isError?r.error.message??"Couldn’t save the API key.":null,reset:r.reset}}const Se=new WeakMap;function bs(s){const t=Se.get(s);if(t)return t;const n=new Set;return Se.set(s,n),n}function Ss(s,t){var E,K,L,S,v;const n=b(),i=T(),{sessionId:a,accountRoot:r,accountId:l,onCompleted:o}=t??{},c=Be(),d=l??(r?((E=c.accounts.find(N=>N.path===r))==null?void 0:E.id)??(c.ownResolvedAccount===r?"default":void 0):a?void 0:"default"),m=u.useMemo(()=>["runtime-login",s,a??"",d??r??""],[s,a,d,r]),x=I({mutationKey:m,mutationFn:()=>{if(s==="claude-code"&&r&&!d&&!a)throw new Error("Choose this account in Runtimes.");return n.delegateRuntimeLogin(s,s==="claude-code"?{sessionId:a,accountId:d}:a?{sessionId:a}:void 0)},onSuccess:N=>{i.invalidateQueries({queryKey:["claude-signin-policy"]}),N.ok&&(i.invalidateQueries({queryKey:Ge.all}),i.invalidateQueries({queryKey:[...q]}),i.invalidateQueries({queryKey:[...M]}))}}),p=ps({filters:{mutationKey:m,exact:!0},select:N=>({id:N.mutationId,state:N.state})}),y=p.some(N=>N.state.status==="pending"),f=p[p.length-1],h=y||f==null?void 0:f.state,k=y||f==null?void 0:f.id,w=!y&&((h==null?void 0:h.status)==="error"||((K=h==null?void 0:h.data)==null?void 0:K.ok)===!1),F=(h==null?void 0:h.status)==="error"?((L=h.error)==null?void 0:L.message)??null:((S=h==null?void 0:h.data)==null?void 0:S.error)??null,R=((v=h==null?void 0:h.data)==null?void 0:v.ok)===!0,P=u.useRef(o);return P.current=o,u.useEffect(()=>{var _;if(!R||k===void 0)return;const N=bs(i);N.has(k)||(N.add(k),(_=P.current)==null||_.call(P))},[R,k,i]),{login:()=>{y||x.mutate()},isPending:y,isSuccess:R,isError:w,errorMessage:w?F??"Couldn’t sign in. Try again.":null}}const Ce={"claude-code":{signInLabel:"Sign in",otherWayLabel:"Sign in with Claude",signInHint:"Use your Claude subscription or Anthropic account.",signInPending:"Waiting for sign-in to complete…",keyLabel:"Anthropic API key",keyPlaceholder:"sk-ant-…",getKeyUrl:"https://console.anthropic.com/settings/keys"},codex:{signInLabel:"Sign in with ChatGPT",otherWayLabel:"Sign in with ChatGPT",signInHint:"Use your ChatGPT account.",signInPending:"Waiting for sign-in to complete…",keyLabel:"OpenAI API key",keyPlaceholder:"sk-…",getKeyUrl:"https://platform.openai.com/api-keys"}};function Cs(s){return Ce[s]??Ce["claude-code"]}function Os({command:s,infoUrl:t,copyLabel:n}){return!s&&!t?null:e.jsxs("div",{className:"space-y-2",children:[s&&e.jsxs("div",{className:"bg-muted flex items-center justify-between gap-2 rounded-lg px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[e.jsx(We,{className:"text-muted-foreground size-3.5 shrink-0"}),e.jsx("code",{className:"truncate text-xs",children:s})]}),e.jsx(De,{value:s,label:n??"Copy install command",className:"shrink-0"})]}),t&&e.jsxs(Ye,{href:t,className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Learn more ",e.jsx(V,{className:"size-3"})]})]})}function Et({command:s,runtimeLabel:t}){const[n,i]=u.useState(!1);return e.jsxs(we,{open:n,onOpenChange:i,className:"mt-2",children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:["DorkOS installs ",t," for you."," ",e.jsx(Re,{className:"hover:text-foreground underline decoration-dotted underline-offset-2 transition-colors",children:n?"Hide command":"What runs?"})]}),e.jsxs(Ie,{className:"mt-1.5 flex items-center gap-1.5",children:[e.jsx(gs,{children:s}),e.jsx(De,{value:s,label:`Copy command: ${s}`,className:"shrink-0"})]})]})}function Oe({onRetry:s}){return e.jsxs("div",{"data-testid":"remote-signin-notice",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Signing in needs the computer DorkOS runs on."}),e.jsx("p",{className:"text-muted-foreground mt-1 text-sm",children:s?"Sign in to DorkOS there, then press Retry.":"Sign in to DorkOS there."}),e.jsx("p",{className:"text-muted-foreground/80 mt-2 text-xs",children:"Already on that computer? Open DorkOS at localhost instead."}),s&&e.jsxs(O,{variant:"outline",size:"sm",onClick:s,className:"mt-3 gap-1.5",children:[e.jsx(Ve,{className:"size-3"}),"Retry"]})]})}function Ps({ollama:s=!1,remote:t=!1,className:n}){return e.jsxs("p",{className:H("text-muted-foreground text-xs",n),"data-testid":"keep-it-local-note",children:[t?"Prefer everything on the computer DorkOS runs on? Use your own sign-in there":"Prefer to keep everything on this computer? Use your own sign-in",s?", or Ollama":"","."]})}function Es(s){const t=He(),{data:n}=Je();return s?Ze(Xe(t.data,s),n,s):"none"}const xe="OpenCode is connected",he="This chat uses OpenCode. Change models from the model menu.",ws={title:xe,body:`Frontier models are unlocked. ${he}`},Rs={title:xe,body:he},Pe={title:xe,body:`Your local models are ready. ${he}`};function Me(s){return{title:`${s} is connected`,body:`This chat uses ${s}. Change models from the model menu.`}}function Is(s){return{title:`${s} is ready`,body:`New work on ${s} runs on your DorkOS credits. Change it any time in Settings › Runtimes.`}}function A({message:s}){const t=Le();return e.jsxs(te.div,{role:"status",className:"bg-muted flex items-center gap-2 rounded-lg px-3 py-2.5",initial:t?!1:{opacity:0},animate:{opacity:1},"data-testid":"connect-progress",children:[e.jsx(de,{size:"xs",className:H("text-muted-foreground shrink-0",t&&"animate-none")}),e.jsx(es,{mode:"wait",children:e.jsx(te.span,{className:"truncate text-xs",initial:t?!1:{opacity:0},animate:{opacity:1},exit:t?void 0:{opacity:0},transition:{duration:.2},children:s},s)})]})}function z({message:s="Connected"}){return e.jsxs("div",{role:"status",className:"text-status-success-fg flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs","data-testid":"connect-connected",children:[e.jsx(ue,{className:"size-3.5"}),s]})}function B({message:s,onRetry:t}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:s}),e.jsx(O,{size:"sm",onClick:t,children:"Try again"})]})}function Ls({type:s,onConnected:t,asOtherWay:n=!1}){const i=Cs(s),a=Ss(s),[r,l]=u.useState(!1),o=u.useRef(!1);return u.useEffect(()=>{!a.isSuccess||o.current||(o.current=!0,t==null||t(Me(me(s).label)))},[a.isSuccess,t,s]),e.jsxs("div",{className:"space-y-4","data-testid":`login-connect-${s}`,children:[e.jsx("div",{className:"space-y-2",children:a.isPending?e.jsx(A,{message:i.signInPending}):a.isSuccess?e.jsx(z,{message:"Signed in"}):a.isError?e.jsx(B,{message:a.errorMessage??"Couldn’t sign in.",onRetry:a.login}):e.jsxs(e.Fragment,{children:[e.jsx(O,{size:"sm",variant:n?"outline":"default",className:"w-full",onClick:a.login,children:n?i.otherWayLabel:i.signInLabel}),e.jsx("p",{className:"text-muted-foreground text-xs",children:i.signInHint})]})}),r?e.jsxs("div",{className:"space-y-3","data-testid":`login-connect-key-${s}`,children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"bg-border h-px flex-1"}),e.jsx("span",{className:"text-muted-foreground text-2xs tracking-wide uppercase",children:"or"}),e.jsx("span",{className:"bg-border h-px flex-1"})]}),e.jsx(As,{type:s,copy:i,onConnected:t}),e.jsx("button",{type:"button",onClick:()=>l(!1),className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors",children:"Back to sign in"})]}):n?e.jsx(O,{size:"sm",variant:"outline",className:"w-full",onClick:()=>l(!0),"data-testid":`login-connect-use-key-${s}`,children:"Paste a key"}):e.jsx("button",{type:"button",onClick:()=>l(!0),className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors","data-testid":`login-connect-use-key-${s}`,children:"Use an API key instead"})]})}function As({type:s,copy:t,onConnected:n}){var f,h;const[i,a]=u.useState(""),r=Ns(s),l=vs(s),o=ks(s),c=u.useRef(!1),d=u.useRef(null);if(u.useEffect(()=>{!r.isSuccess||c.current||(c.current=!0,n==null||n(Me(me(s).label)))},[r.isSuccess,n,s]),u.useEffect(()=>{var k;r.isError&&((k=d.current)==null||k.focus())},[r.isError]),r.isSuccess)return e.jsx(z,{});const m=(f=l.data)!=null&&f.key.saved?l.data.key:null,x=i.trim().length>0,p=r.isPending||o.isPending,y=()=>{o.reset(),r.reset()};return e.jsxs("form",{className:"space-y-2",onSubmit:k=>{k.preventDefault(),o.reset(),r.store(i)},children:[e.jsx(C,{htmlFor:`api-key-${s}`,className:"text-xs",children:t.keyLabel}),e.jsx(ne,{id:`api-key-${s}`,ref:d,value:i,disabled:p,onChange:k=>{a(k.target.value),y()},placeholder:m?`Saved key ends in ${m.last4}. Paste to replace.`:t.keyPlaceholder,autoComplete:"off",spellCheck:!1}),r.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:r.errorMessage}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[t.getKeyUrl?e.jsxs("a",{href:t.getKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an API key ",e.jsx(V,{className:"size-3"})]}):e.jsx("span",{}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{type:"button",size:"sm",variant:"ghost",disabled:!x&&m===null||p,"data-testid":`api-key-test-${s}`,onClick:()=>{r.reset(),o.reset(),o.check(i)},children:"Test key"}),e.jsx(O,{type:"submit",size:"sm",variant:"outline",disabled:!x||p,children:"Save key"})]})]}),p?e.jsx(A,{message:r.phase==="saving"?"Saving…":"Checking your key…"}):((h=o.result)==null?void 0:h.ok)===!0?e.jsx(z,{message:o.checkedSavedKey?"Your saved key works":"Key works"}):o.result?e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:o.result.message}):null]})}function Ks(s){const t=b(),n=Q({queryKey:["doe-inference"],queryFn:()=>t.getDoeInference()});return n.isPending?e.jsx(de,{"aria-label":"Loading model settings"}):n.isError?e.jsx("p",{role:"alert",children:"Couldn’t load model settings. Try again."}):e.jsx(Ds,{saved:n.data,...s},JSON.stringify(n.data))}function Ds({saved:s,onConnected:t,onSave:n}){var D,Z,W,X,j,$,fe,ge,pe,ye,je,ve;const i=b(),a=T(),r=u.useId(),l=((D=s.inference)==null?void 0:D.source)??"api-key",[o,c]=u.useState(n&&l==="dorkos-credits"?"api-key":l),[d,m]=u.useState(((Z=s.inference)==null?void 0:Z.protocol)??"openai-chat-completions"),[x,p]=u.useState(((W=s.inference)==null?void 0:W.endpoint)??""),[y,f]=u.useState(((X=s.inference)==null?void 0:X.provider)??""),[h,k]=u.useState(((j=s.inference)==null?void 0:j.model)??""),[w,F]=u.useState(String((($=s.inference)==null?void 0:$.contextWindow)??8192)),[R,P]=u.useState(String(((fe=s.inference)==null?void 0:fe.maxOutputTokens)??1024)),[E,K]=u.useState(""),[L,S]=u.useState(null),v=Q({queryKey:["doe-credits-models",d],queryFn:()=>i.getDoeCreditsModels(d),enabled:o==="dorkos-credits"}),N=o==="dorkos-credits"?(ge=v.data)==null?void 0:ge.models.find(g=>g.id===h):void 0,_=s.hasKey&&((pe=s.inference)==null?void 0:pe.endpoint)===x&&s.inference.source==="api-key",J=I({mutationFn:async g=>{if(n)return n(g,E.trim()||null);o==="api-key"&&E.trim()?await i.storeDoeCredential(g,E.trim()):await i.setDoeInference(g),(await i.getCloudCredits()).linked&&await i.setCloudCreditsDefault("doe",o==="dorkos-credits")},onSuccess:()=>{K("");for(const g of[["doe-inference"],q,M,ss.all,ts.status()])a.invalidateQueries({queryKey:g});t==null||t({title:"DorkOS model settings saved",body:"New chats use this source and model."})},onError:g=>S(n&&g instanceof Error&&g.message?g.message:"Couldn’t save model settings. Try again.")});function re(g){var ke,Ne;if(g.preventDefault(),S(null),E.trim().startsWith("sk-ant-oat")){S("Anthropic subscription tokens cannot run DorkOS agents. Use an API key.");return}if(o==="api-key"&&!E.trim()&&!_){S("Enter an API key.");return}if(o==="dorkos-credits"&&(!N||!((ke=v.data)!=null&&ke.endpoint))){S("Link DorkOS credits and choose an available model.");return}const ae=ns.safeParse({source:o,protocol:d,provider:o==="dorkos-credits"?"dorkos":y,endpoint:o==="dorkos-credits"?(Ne=v.data)==null?void 0:Ne.endpoint:x,model:h,contextWindow:(N==null?void 0:N.contextWindow)??Number(w),maxOutputTokens:(N==null?void 0:N.maxOutputTokens)??Number(R)});if(!ae.success){S("Check the model, endpoint, and token limits.");return}J.mutate(ae.data)}const G="bg-background border-input focus-visible:ring-ring h-11 w-full rounded-md md:h-9 border px-3 text-sm focus-visible:ring-2";return e.jsxs("form",{onSubmit:re,className:"space-y-3","aria-label":"DorkOS model settings",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-source`,children:"Runs on"}),e.jsxs("select",{id:`${r}-source`,className:G,value:o,onChange:g=>{c(g.target.value),k("")},children:[e.jsx("option",{value:"api-key",children:"My API key"}),e.jsx("option",{value:"local",children:"Local model"}),!n&&e.jsx("option",{value:"dorkos-credits",children:"DorkOS credits"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-protocol`,children:"Model protocol"}),e.jsxs("select",{id:`${r}-protocol`,className:G,value:d,onChange:g=>{m(g.target.value),o==="dorkos-credits"&&k("")},children:[e.jsx("option",{value:"openai-chat-completions",children:"OpenAI Chat Completions"}),e.jsx("option",{value:"openai-responses",children:"OpenAI Responses"}),e.jsx("option",{value:"anthropic-messages",children:"Anthropic Messages"})]})]}),o==="dorkos-credits"?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-model`,children:"Model"}),e.jsxs("select",{id:`${r}-model`,className:G,value:h,onChange:g=>k(g.target.value),disabled:v.isPending||!((ye=v.data)!=null&&ye.endpoint),children:[e.jsx("option",{value:"",children:"Choose a model"}),(je=v.data)==null?void 0:je.models.map(g=>e.jsx("option",{value:g.id,children:g.displayName},g.id))]}),!((ve=v.data)!=null&&ve.endpoint)&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Link DorkOS credits in Settings to choose a model."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-service`,children:"Service name"}),e.jsx(U,{id:`${r}-service`,value:y,onChange:g=>f(g.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-endpoint`,children:"Model endpoint"}),e.jsx(U,{id:`${r}-endpoint`,type:"url",value:x,onChange:g=>p(g.target.value),required:!0}),o==="local"&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"Use a loopback address. No API key is needed."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-model`,children:"Model ID"}),e.jsx(U,{id:`${r}-model`,value:h,onChange:g=>k(g.target.value),required:!0})]}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-context`,children:"Context tokens"}),e.jsx(U,{id:`${r}-context`,type:"number",min:1,value:w,onChange:g=>F(g.target.value),required:!0})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-output`,children:"Output tokens"}),e.jsx(U,{id:`${r}-output`,type:"number",min:1,value:R,onChange:g=>P(g.target.value),required:!0})]})]}),o==="api-key"&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:`${r}-key`,children:"API key"}),e.jsx(ne,{id:`${r}-key`,value:E,onChange:g=>K(g.target.value),autoComplete:"off"}),_&&e.jsx("p",{className:"text-muted-foreground text-xs",children:"API key saved. Leave blank to keep it."})]})]}),L&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:L}),e.jsx(O,{type:"submit",disabled:J.isPending,children:J.isPending?"Saving…":n?"Save":"Save model settings"})]})}const Ts={openai:"OpenAI",anthropic:"Anthropic"};function Ms(s){return Ts[s]??s}function qs(s){switch(s){case"ollama":return"On your computer (Ollama)";case"openrouter":return"Cloud via OpenRouter";default:return`Your own API key (${Ms(s)})`}}const qe="ollama",Fe=["runtime-connect","ollama"];function Fs(s){const t=b();return Q({queryKey:Fe,queryFn:()=>t.detectOllama(),enabled:s,staleTime:3e4})}function $s(){const s=b(),t=T(),n=I({mutationFn:i=>s.updateConfig({runtimes:{opencode:{provider:qe}}}),onSuccess:()=>{t.invalidateQueries({queryKey:[...q]}),t.invalidateQueries({queryKey:[...M]})}});return{connect:i=>n.mutate(i),isPending:n.isPending,isSuccess:n.isSuccess,isError:n.isError,errorMessage:n.isError?n.error.message??"Couldn’t connect to Ollama.":null}}const $e=["runtime-connect","opencode","direct"];function _s(){const s=b();return Q({queryKey:$e,queryFn:()=>s.getOpenCodeDirectSetup(),staleTime:3e4})}function Us(){var i;const s=b(),t=I({mutationFn:({providerId:a,key:r,baseURL:l})=>s.checkProviderCredential(a,r.trim().length>0?r:null,(l==null?void 0:l.trim())||null),meta:{suppressErrorToast:!0}}),n=t.data??(t.isError?{ok:!1,reason:"unexpected",message:t.error.message||"Couldn’t check the key."}:null);return{check:a=>t.mutate(a),isPending:t.isPending,result:n,checkedSavedKey:n!==null&&(((i=t.variables)==null?void 0:i.key)??"").trim().length===0,reset:t.reset}}function zs(){var l,o,c;const s=b(),t=T(),[n,i]=u.useState(null),a=I({mutationFn:async({providerId:d,key:m,baseURL:x})=>{const p=(x==null?void 0:x.trim())||null;i("checking");const y=await s.checkProviderCredential(d,m.trim().length>0?m:null,p);return y.ok?(i("saving"),await s.storeProviderCredential(d,m,p),{saved:!0,message:null}):{saved:!1,message:y.message}},onSettled:()=>i(null),meta:{suppressErrorToast:!0},onSuccess:d=>{d.saved&&(t.invalidateQueries({queryKey:[...q]}),t.invalidateQueries({queryKey:[...M]}),t.invalidateQueries({queryKey:[...$e]}))}}),r=((l=a.data)==null?void 0:l.saved)===!1;return{connect:d=>{d.providerId.trim().length!==0&&a.mutate(d)},isPending:a.isPending,phase:n,isSuccess:((o=a.data)==null?void 0:o.saved)===!0,isError:a.isError||r,errorMessage:r?((c=a.data)==null?void 0:c.message)??null:a.isError?a.error.message??"Couldn’t save your key.":null,reset:a.reset}}function Qs(s){const t=b();return Q({queryKey:["runtime-connect","ollama","catalog"],queryFn:()=>t.getOllamaModelCatalog(),enabled:s,staleTime:6e4})}function Bs(){var o,c;const s=b(),t=T(),[n,i]=u.useState(null),a=I({mutationFn:async d=>{i(null);const m=await s.pullOllamaModel(d,x=>i(x));return m.ok&&await s.updateConfig({runtimes:{opencode:{provider:qe}}}),m},onSuccess:d=>{d.ok&&(t.invalidateQueries({queryKey:[...q]}),t.invalidateQueries({queryKey:[...M]}))}}),r=a.isError||((o=a.data)==null?void 0:o.ok)===!1,l=a.isError?a.error.message:((c=a.data)==null?void 0:c.error)??null;return{pull:d=>a.mutate(d),isPending:a.isPending,isError:r,errorMessage:r?l??"Couldn’t download the model.":null,progress:n,result:a.data}}function Gs(){var o,c;const s=b(),t=T(),[n,i]=u.useState(null),a=I({mutationFn:()=>(i(null),s.provisionOllama(d=>i(d))),onSuccess:d=>{d.ok&&(t.invalidateQueries({queryKey:Fe}),t.invalidateQueries({queryKey:[...M]}))}}),r=a.isError||((o=a.data)==null?void 0:o.ok)===!1,l=a.isError?a.error.message:((c=a.data)==null?void 0:c.error)??null;return{provision:()=>a.mutate(),isPending:a.isPending,isError:r,errorMessage:r?l??"Couldn’t install Ollama.":null,progress:n,result:a.data}}const Ws="https://ollama.com/download",Ys="curl -fsSL https://ollama.com/install.sh | sh";function Vs({installMethod:s}){const t=Gs(),n=s==="brew"||s==="winget";return e.jsxs("div",{className:"space-y-3","data-testid":"ollama-absent",children:[e.jsx(Hs,{}),n?e.jsx(Js,{provision:t}):e.jsx(Zs,{}),e.jsx(Xs,{})]})}function Hs(){const s=Ae();return e.jsxs("div",{className:"space-y-1.5","data-testid":"ollama-explainer",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Run AI models on ",s]}),e.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Ollama is a free app that runs AI models on ",s,"."]}),e.jsxs("p",{className:"text-muted-foreground text-xs leading-relaxed",children:["Nothing you type leaves ",s,"."]})]})}function Js({provision:s}){var t,n,i;return s.isPending?e.jsx(A,{message:((t=s.progress)==null?void 0:t.message)??"Installing Ollama…"}):(n=s.result)!=null&&n.ok?(i=s.result.status)!=null&&i.running?e.jsx(A,{message:"Ollama is ready…"}):e.jsx("p",{className:"text-xs","data-testid":"ollama-installed-not-running",children:"Ollama isn’t running. Open the Ollama app to start it."}):s.isError?e.jsx(B,{message:s.errorMessage??"Couldn’t install Ollama.",onRetry:s.provision}):e.jsx(O,{size:"sm",onClick:s.provision,"data-testid":"ollama-install-oneclick",children:"Install Ollama"})}function Zs(){return e.jsxs("div",{className:"space-y-2","data-testid":"ollama-manual-install",children:[e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Installing Ollama needs administrator access. Run this in a terminal:"}),e.jsx(Os,{command:Ys,copyLabel:"Copy the Ollama install command"})]})}function Xs(){return e.jsxs("a",{href:Ws,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Or download Ollama from ollama.com ",e.jsx(V,{className:"size-3"})]})}const et="https://ollama.com/library",st={"runs-well":{label:"Runs well on your machine",tone:"text-status-success-fg"},"may-be-slow":{label:"May be slow on your machine",tone:"text-status-warning-fg"},"too-large":{label:"Too large for your machine",tone:"text-destructive"}},tt={frontier:"Frontier","solid-coder":"Solid coder","quick-helper":"Quick helper"};function nt({active:s,onConnected:t,onConnectDirectly:n}){var R,P,E,K,L,S;const i=Fs(s),a=$s(),r=Bs(),l=((R=i.data)==null?void 0:R.running)??!1,o=Qs(l),[c,d]=u.useState(null),[m,x]=u.useState(null);u.useEffect(()=>{a.isSuccess&&(t==null||t(Pe))},[a.isSuccess,t]),u.useEffect(()=>{var v;(v=r.result)!=null&&v.ok&&(t==null||t(Pe))},[(P=r.result)==null?void 0:P.ok,t]);const p=v=>{d(v),a.connect(v)},y=v=>{x(v),r.pull(v)};if(i.isPending)return e.jsx(A,{message:"Looking for Ollama on your machine…"});if(!l)return e.jsx(Vs,{installMethod:(E=i.data)==null?void 0:E.installMethod});if(a.isSuccess)return t?null:e.jsx(z,{message:"Connected to Ollama"});if((K=r.result)!=null&&K.ok)return t?null:e.jsxs("div",{className:"text-status-success-fg flex items-center gap-2 rounded-lg px-3 py-2.5 text-xs","data-testid":"guided-pull-connected",children:[e.jsx(ue,{className:"size-3.5 shrink-0"}),e.jsx("span",{children:"Connected:"}),e.jsx(rs,{runtime:"opencode",model:r.result.model,className:"text-xs"})]});const f=i.data,h=(f==null?void 0:f.installed)??[],k=((L=f==null?void 0:f.installed)==null?void 0:L.length)??(f==null?void 0:f.models.length)??0,w=((S=o.data)==null?void 0:S.models.some(v=>v.model.id===m))??!1,F=m!==null&&!w?m:null;return e.jsxs("div",{className:"space-y-4","data-testid":"ollama-running",children:[e.jsx(rt,{count:k}),h.length>0&&e.jsx(at,{installed:h,connect:a,connectingId:c,onUse:p}),e.jsx(it,{catalogQuery:o,pull:r,pullingId:m,onGet:y}),e.jsx(ot,{pull:r,activePull:F,onSubmit:y}),e.jsx(lt,{}),n&&e.jsxs("button",{type:"button",onClick:n,"data-testid":"local-connect-directly",className:"focus-ring text-muted-foreground hover:text-foreground block rounded-md text-left text-xs transition-colors",children:["Using LM Studio or another server? ",e.jsx("span",{className:"underline",children:"Connect it directly"})]})]})}function rt({count:s}){return e.jsxs("p",{className:"flex items-center gap-1.5 text-xs","data-testid":"ollama-status-line",children:[e.jsx("span",{className:"size-1.5 shrink-0 rounded-full bg-emerald-500","aria-hidden":!0}),e.jsxs("span",{children:["Ollama is running · ",s," ",s===1?"model":"models"," installed"]})]})}function _e({verdict:s,explanation:t}){const n=st[s];return e.jsxs("div",{"data-testid":"ollama-verdict","data-verdict":s,children:[e.jsx("p",{className:H("text-xs font-medium",n.tone),children:n.label}),e.jsx("p",{className:"text-muted-foreground/80 text-2xs leading-snug",children:t})]})}function Ue({tier:s}){return e.jsx(Ke,{size:"xs",variant:"outline",className:"font-normal",children:tt[s]})}function at({installed:s,connect:t,connectingId:n,onUse:i}){return e.jsxs("div",{className:"space-y-2","data-testid":"ollama-installed",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Installed"}),e.jsx("ul",{className:"space-y-1.5",children:s.map(a=>{const r=n===a.id&&t.isPending,l=n===a.id&&t.isError,o=()=>i(a.id);let c=e.jsx(O,{size:"sm",onClick:o,children:"Use"});return r?c=e.jsx(A,{message:"Connecting…"}):l&&(c=e.jsx(B,{message:t.errorMessage??"Couldn’t connect to Ollama.",onRetry:o})),e.jsxs("li",{className:"border-border flex items-center justify-between gap-3 rounded-lg border p-3","data-testid":"ollama-installed-item",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:a.id}),a.assessment.model.tier&&e.jsx(Ue,{tier:a.assessment.model.tier})]}),e.jsx(_e,{verdict:a.assessment.verdict,explanation:a.assessment.explanation})]}),c]},a.id)})})]})}function it({catalogQuery:s,pull:t,pullingId:n,onGet:i}){var r;if(s.isPending)return e.jsx(A,{message:"Checking which models fit your machine…"});const a=((r=s.data)==null?void 0:r.models)??[];return s.isError||a.length===0?null:e.jsxs("div",{className:"space-y-2","data-testid":"ollama-shelf",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Add a model"}),e.jsx("ul",{className:"space-y-1.5",children:a.map(({model:l,verdict:o,explanation:c})=>{const d=n===l.id,m=()=>i(l.id);return d&&(t.isPending||t.isError)?e.jsxs("li",{className:"border-border rounded-lg border p-3","data-testid":"shelf-item",children:[e.jsx("p",{className:"mb-2 text-sm font-medium",children:l.label}),t.isPending?e.jsx(ze,{progress:t.progress}):e.jsx(B,{message:t.errorMessage??"Couldn’t download the model.",onRetry:m})]},l.id):e.jsxs("li",{className:"border-border flex items-center justify-between gap-3 rounded-lg border p-3","data-testid":"shelf-item",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"truncate text-sm font-medium",children:l.label}),l.tier&&e.jsx(Ue,{tier:l.tier}),e.jsx("span",{className:"text-muted-foreground text-xs",children:l.sizeLabel})]}),e.jsx(_e,{verdict:o,explanation:c})]}),e.jsx(O,{size:"sm",variant:"outline",disabled:o==="too-large"||t.isPending,onClick:m,children:"Get"})]},l.id)})})]})}function ot({pull:s,activePull:t,onSubmit:n}){const[i,a]=u.useState(""),r=i.trim(),l=ys.test(r);if(t&&s.isPending)return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-medium",children:["Downloading ",t,"…"]}),e.jsx(ze,{progress:s.progress})]});const o=c=>{c.preventDefault(),l&&n(r)};return e.jsxs("form",{onSubmit:o,className:"space-y-1.5",children:[e.jsx(C,{htmlFor:"ollama-pull-tag",className:"text-xs font-normal",children:"Download any model by name"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(U,{id:"ollama-pull-tag","data-testid":"ollama-pull-by-name",value:i,onChange:c=>a(c.target.value),placeholder:"qwen2.5-coder:32b","aria-invalid":r.length>0&&!l}),e.jsx(O,{type:"submit",size:"sm",disabled:!l||s.isPending,children:"Download"})]}),r.length>0&&!l&&e.jsxs("p",{className:"text-muted-foreground text-2xs",children:["Use a tag like ",e.jsx("code",{className:"text-2xs",children:"qwen2.5-coder:32b"}),"."]}),t&&s.isError&&e.jsx(B,{message:s.errorMessage??"Couldn’t download the model.",onRetry:()=>n(t)})]})}function lt(){return e.jsxs("a",{href:et,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Browse the library ",e.jsx(V,{className:"size-3"})]})}function ze({progress:s}){const t=Le(),n=s==null?void 0:s.percent,i=(s==null?void 0:s.status)??"Starting download…";return e.jsxs("div",{className:"space-y-2","data-testid":"guided-pull-progress",children:[e.jsx("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:n===void 0?e.jsx(te.div,{className:"bg-primary/70 h-full w-1/3 rounded-full",animate:t?{}:{x:["-100%","300%"]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"}}):e.jsx(te.div,{className:"bg-primary h-full rounded-full",initial:!1,animate:{width:`${Math.min(100,Math.max(0,n))}%`},transition:t?{duration:0}:{duration:.3,ease:"easeOut"},"data-testid":"guided-pull-bar"})}),e.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 text-xs",children:[e.jsx(de,{size:"xs",className:H("shrink-0",t&&"animate-none")}),e.jsxs("span",{className:"truncate",children:[i,n!==void 0?` · ${Math.round(n)}%`:""]})]})]})}function ct(){var r,l,o;const s=b(),t=T(),n=I({mutationFn:c=>s.storeOpenRouterKey(c),onSuccess:c=>{c.ok&&(t.invalidateQueries({queryKey:[...q]}),t.invalidateQueries({queryKey:[...M]}))}}),i=n.isError||((r=n.data)==null?void 0:r.ok)===!1,a=n.isError?n.error.message:((l=n.data)==null?void 0:l.error)??null;return{store:c=>{c.trim().length!==0&&n.mutate(c)},isPending:n.isPending,isSuccess:((o=n.data)==null?void 0:o.ok)===!0,isError:i,errorMessage:i?a??"Couldn’t save the OpenRouter key.":null}}function dt(){var p,y;const s=b(),t=T(),[n,i]=u.useState(null),[a,r]=u.useState(null),l=I({mutationFn:()=>s.startOpenRouterOAuth(),onMutate:()=>r(null),onSuccess:({authorizeUrl:f,state:h})=>{if(!as(f)){r("Couldn’t open the OpenRouter sign-in page.");return}i(h)},onError:f=>r(f.message??"Couldn’t start OpenRouter sign-in.")}),o=Q({queryKey:["runtime-connect","openrouter","oauth",n],queryFn:()=>s.getOpenRouterOAuthStatus(n),enabled:n!==null,refetchInterval:f=>{var h;return((h=f.state.data)==null?void 0:h.status)==="pending"?1500:!1},refetchOnWindowFocus:f=>{var h;return((h=f.state.data)==null?void 0:h.status)==="error"}}),c=(p=o.data)==null?void 0:p.status;u.useEffect(()=>{c==="connected"&&(t.invalidateQueries({queryKey:[...q]}),t.invalidateQueries({queryKey:[...M]}))},[c,t]);const d=l.isPending||n!==null&&c==="pending",m=!!a||c==="error",x=m?a??((y=o.data)==null?void 0:y.error)??"Couldn’t sign in to OpenRouter. Try again.":null;return{begin:()=>l.mutate(),isPending:d,isSuccess:c==="connected",isError:m,errorMessage:x}}const ut="https://openrouter.ai/keys";function mt({onConnected:s}){const[t,n]=u.useState(""),i=ct(),a=dt(),r=i.isSuccess||a.isSuccess;return u.useEffect(()=>{r&&(s==null||s(ws))},[r,s]),r?e.jsx(z,{message:"Connected to OpenRouter"}):e.jsxs("div",{className:"space-y-4","data-testid":"openrouter-gateway",children:[e.jsx("div",{className:"space-y-2",children:a.isPending?e.jsx(A,{message:"Sign in to OpenRouter in the new tab…"}):a.isError?e.jsx(B,{message:a.errorMessage??"Couldn’t sign in to OpenRouter.",onRetry:a.begin}):e.jsxs(e.Fragment,{children:[e.jsx(O,{size:"sm",className:"w-full",onClick:a.begin,children:"Connect OpenRouter"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Makes a limited key for you."})]})}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"bg-border h-px flex-1"}),e.jsx("span",{className:"text-muted-foreground text-2xs tracking-wide uppercase",children:"or"}),e.jsx("span",{className:"bg-border h-px flex-1"})]}),i.isPending?e.jsx(A,{message:"Checking your OpenRouter key…"}):e.jsxs("form",{className:"space-y-2",onSubmit:l=>{l.preventDefault(),i.store(t)},children:[e.jsx(C,{htmlFor:"openrouter-key",className:"text-xs",children:"OpenRouter key"}),e.jsx(ne,{id:"openrouter-key",value:t,onChange:l=>n(l.target.value),placeholder:"sk-or-…",autoComplete:"off",spellCheck:!1}),i.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:i.errorMessage}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("a",{href:ut,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an OpenRouter key ",e.jsx(V,{className:"size-3"})]}),e.jsx(O,{type:"submit",size:"sm",variant:"outline",disabled:t.trim().length===0,children:"Save key"})]})]})]})}const se="other";function ee(s){return Y.find(t=>t.id===s)}function xt(s){var t;return((t=ee(s))==null?void 0:t.id)??"openai"}function ce(s){var t;return((t=Y.find(n=>n.id===s))==null?void 0:t.defaultBaseURL)??Y[0].defaultBaseURL}function Qe(s){return Y.some(t=>t.id===s.providerId)}function ie(s){return Qe(s)?s.providerId==="anthropic"?"anthropic":s.baseURL===null||s.baseURL===ce(s.providerId)?s.providerId:se:"openai"}function ht({onConnected:s}){const t=_s();return t.isError&&!t.data?e.jsx(B,{message:"Couldn’t load your saved settings.",onRetry:()=>void t.refetch()}):t.data?e.jsx(ft,{setup:t.data,onConnected:s},`${t.data.providerId??""}|${t.data.baseURL??""}`):e.jsx(A,{message:"Loading what you saved…"})}function ft({setup:s,onConnected:t}){var X;const n=Qe(s)?s:null,[i,a]=u.useState(()=>ie(s)),[r,l]=u.useState(""),[o,c]=u.useState(()=>{var j;return(n==null?void 0:n.baseURL)??((j=ee(ie(s)))==null?void 0:j.defaultBaseURL)??""}),[d,m]=u.useState(()=>{var $;const j=ie(s);return j!==se&&n!==null&&n.baseURL!==null&&n.baseURL!==(($=ee(j))==null?void 0:$.defaultBaseURL)}),x=zs(),p=Us(),y=ee(i),f=xt(i),h=n!=null&&n.key.saved&&n.providerId===f?n.key.last4:null,k=o.trim(),w=i===se,F=!w||k.length>0,R=ce(f),P=k||R,E=P===R?"":P,K=n===null?null:n.baseURL??ce(n.providerId),L=f!==((n==null?void 0:n.providerId)??null)||P!==K,S=r.trim().length>0,N=(S||h!==null&&!L)&&F,_=S&&F,J=!S&&h!==null&&L,re=P.startsWith("http://"),G={providerId:f,key:r,baseURL:E},D=x.isPending||p.isPending,Z=u.useRef(null),W=()=>{p.reset(),x.reset()};return u.useEffect(()=>{x.isSuccess&&(t==null||t(Rs))},[x.isSuccess,t]),u.useEffect(()=>{var j;x.isError&&((j=Z.current)==null||j.focus())},[x.isError]),x.isSuccess?e.jsx(z,{}):e.jsxs("form",{className:"space-y-3","data-testid":"direct-provider",onSubmit:j=>{j.preventDefault(),p.reset(),x.connect(G)},children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:"direct-provider-source",className:"text-xs",children:"Power source"}),e.jsxs(is,{value:i,disabled:D,onValueChange:j=>{var $;a(j),c((($=ee(j))==null?void 0:$.defaultBaseURL)??""),W()},children:[e.jsx(os,{id:"direct-provider-source","data-testid":"direct-provider-source",children:e.jsx(ls,{})}),e.jsxs(cs,{children:[Y.map(j=>e.jsx(be,{value:j.id,children:j.label},j.id)),e.jsx(be,{value:se,children:"Other (OpenAI-compatible)"})]})]})]}),(w||d)&&e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs(C,{htmlFor:"direct-provider-base-url",className:"text-xs",children:["Base URL ",!w&&e.jsx("span",{className:"text-muted-foreground",children:"(optional)"})]}),e.jsx(U,{id:"direct-provider-base-url",value:o,disabled:D,onChange:j=>{c(j.target.value),W()},placeholder:"https://api.example.com/v1",autoComplete:"off",spellCheck:!1})]}),!w&&!d&&e.jsx("button",{type:"button",onClick:()=>m(!0),disabled:D,"data-testid":"direct-provider-advanced",className:"text-muted-foreground hover:text-foreground text-xs underline decoration-dotted underline-offset-2 transition-colors",children:"Advanced"}),re&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"direct-provider-insecure",children:"This address isn’t encrypted. Your key travels in the open."}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(C,{htmlFor:"direct-provider-key",className:"text-xs",children:"API key"}),e.jsx(ne,{id:"direct-provider-key",ref:Z,value:r,disabled:D,onChange:j=>{l(j.target.value),W()},placeholder:h===null?(y==null?void 0:y.keyPlaceholder)??Y[0].keyPlaceholder:`Saved key ends in ${h}. Paste to replace.`,autoComplete:"off",spellCheck:!1})]}),x.isError&&e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:x.errorMessage}),J&&e.jsx("p",{className:"text-muted-foreground text-xs","data-testid":"direct-provider-repaste",children:"Paste your key again to change the address."}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[y===void 0?e.jsx("span",{}):e.jsxs("a",{href:y.getKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:["Get an API key ",e.jsx(V,{className:"size-3"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(O,{type:"button",size:"sm",variant:"outline",disabled:!N||D,"data-testid":"direct-provider-test",onClick:()=>{x.reset(),p.reset(),p.check(G)},children:"Test key"}),e.jsx(O,{type:"submit",size:"sm",disabled:!_||D,children:"Save & connect"})]})]}),D?e.jsx(A,{message:x.phase==="saving"?"Saving…":"Checking your key…"}):((X=p.result)==null?void 0:X.ok)===!0?e.jsx(z,{message:p.checkedSavedKey?"Your saved key works":"Key works"}):p.result?e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:p.result.message}):null]})}function gt({currentProvider:s,onConnected:t}){const[n,i]=u.useState("choose"),a=pt();if(n==="choose")return e.jsx(yt,{sources:a,onChoose:i,currentProvider:s});const r=()=>i("choose");return n==="cloud"?e.jsx(oe,{source:a.cloud,onBack:r,children:e.jsx(mt,{onConnected:t})}):n==="local"?e.jsx(oe,{source:a.local,onBack:r,children:e.jsx(nt,{active:!0,onConnected:t,onConnectDirectly:()=>i("direct")})}):e.jsx(oe,{source:a.direct,onBack:r,children:e.jsx(ht,{onConnected:t})})}function pt(){return{cloud:{step:"cloud",title:"Best models, zero setup",description:"Claude, GPT, Gemini and 300+ more, in the cloud.",sub:"One OpenRouter account covers them all. Pay for what you use.",tradeOff:"Your prompts and code are sent to the model’s provider.",recommended:!0},local:{step:"local",title:"Private and free, on your computer",description:`Models run on ${Ae()}. Nothing you type ever leaves it.`,sub:"Runs Quick helpers and Solid coders. Frontier models stay cloud-only.",tradeOff:"Smaller models: good for edits and quick help."},direct:{step:"direct",title:"Use your own API key",stepTitle:"Your own API key",description:"Anthropic, OpenAI, or any OpenAI-compatible server, like LM Studio.",sub:"",quiet:!0}}}function yt({sources:s,onChoose:t,currentProvider:n}){return e.jsxs("div",{className:"space-y-2","data-testid":"opencode-power-sources",children:[n&&e.jsxs("p",{className:"text-muted-foreground text-xs","data-testid":"opencode-current-source",children:["Currently: ",qs(n)]}),Object.values(s).map(i=>e.jsx(jt,{source:i,onChoose:t},i.step))]})}function jt({source:s,onChoose:t}){return e.jsxs("button",{type:"button",onClick:()=>t(s.step),"data-testid":`power-source-${s.step}`,className:H("card-interactive focus-ring group flex w-full items-start gap-3 rounded-lg border p-3 text-left",s.recommended?"border-primary/40 bg-card shadow-soft":"border-border bg-card shadow-soft",s.quiet&&"shadow-none"),children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-medium",children:s.title}),s.recommended&&e.jsx(Ke,{size:"xs",variant:"secondary",children:"Recommended"})]}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:s.description})]}),e.jsx(us,{className:"text-muted-foreground/60 mt-0.5 size-4 shrink-0"})]})}function oe({source:s,onBack:t,children:n}){const i=!!(s.sub||s.tradeOff);return e.jsxs("div",{className:"space-y-3","data-testid":"opencode-connect-step",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("button",{type:"button",onClick:t,className:"focus-ring text-muted-foreground hover:text-foreground -ml-1 inline-flex items-center gap-1 rounded-md px-1 py-0.5 text-xs transition-colors","data-testid":"connect-step-back",children:[e.jsx(ds,{className:"size-3.5"}),"Back"]}),e.jsx("span",{className:"text-muted-foreground/40",children:"·"}),e.jsx("span",{className:"text-sm font-medium",children:s.stepTitle??s.title})]}),i&&e.jsxs("div",{className:"space-y-1","data-testid":"connect-step-details",children:[s.sub&&e.jsx("p",{className:"text-muted-foreground/80 text-xs",children:s.sub}),s.tradeOff&&e.jsxs("p",{className:"text-muted-foreground/70 text-2xs leading-snug",children:[e.jsx("span",{className:"font-medium",children:"Trade-off:"})," ",s.tradeOff]})]}),n]})}function vt({type:s,connect:t,currentProvider:n,onConnected:i}){const a=js(),r=Es(s),l=ms(),o=xs(),c=hs([s]);if(s==="doe")return a?e.jsx(Ks,{onConnected:i}):e.jsx(Oe,{});const d=r==="lead"&&l!==null,m=a?t.kind==="provider-picker"?e.jsx(gt,{currentProvider:n,onConnected:i}):t.kind==="login"?e.jsx(Ls,{type:s,onConnected:i,asOtherWay:d}):null:e.jsx(Oe,{});if(m===null)return null;const x=me(s).label,p=t.kind==="provider-picker";if(r==="on-credits")return e.jsxs("div",{className:"space-y-3","data-testid":`credits-ready-${s}`,children:[e.jsxs("div",{role:"status",children:[e.jsxs("p",{className:"text-status-success-fg flex items-center gap-1.5 text-sm font-medium",children:[e.jsx(ue,{className:"size-3.5","aria-hidden":!0}),"You’re ready"]}),e.jsxs("p",{className:"text-muted-foreground mt-1 text-xs",children:["New work on ",x," runs on your DorkOS credits.",c.map(f=>` ${f}`).join("")]})]}),e.jsx(le,{collapsed:!0,children:m})]});const y=f=>l==null?void 0:l({runtime:s,origin:`runtime-connect:${s}`,fullWidth:f,onChoose:async()=>{await o.mutateAsync({runtime:s,useCredits:!0}),i==null||i(Is(x))}});return d?e.jsxs("div",{className:"space-y-4","data-testid":`default-first-${s}`,children:[y(!0),e.jsx(le,{children:m}),e.jsx(Ps,{ollama:p,remote:!a})]}):r==="other-way"&&l!==null?e.jsxs("div",{className:"space-y-4","data-testid":`credits-other-way-${s}`,children:[m,e.jsx(le,{children:y(!1)})]}):m}function le({collapsed:s=!1,children:t}){const[n,i]=u.useState(!s);return s?e.jsxs(we,{open:n,onOpenChange:i,children:[e.jsxs(Re,{className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:[e.jsx(fs,{className:H("size-3.5 transition-transform",n&&"rotate-180")}),"Other ways"]}),e.jsx(Ie,{className:"mt-3",children:t})]}):e.jsxs("section",{className:"space-y-2","aria-label":"Other ways",children:[e.jsx("p",{className:"text-muted-foreground text-2xs font-medium tracking-wide uppercase",children:"Other ways"}),t]})}const wt=s=>e.jsx(vt,{...s});export{Et as C,Os as D,Ps as K,Oe as R,Ss as a,js as b,Ot as c,qs as d,Es as e,Ks as f,Cs as g,wt as r,Pt as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as l,br as Y,eO as I,eP as W,j as e,eQ as G,eR as Q,bq as V,bo as C,bn as z,eS as Z,bp as J,eT as X,eU as q,eV as ee,bw as te,eW as ne,aK as se,ab as re,eX as ae,eh as oe,eY as A,cY as ie,cZ as ce,c$ as le,d0 as de,d1 as ue,eK as fe,em as y,J as D,B as S,eb as M,eZ as me,G as E,Q as xe,T as pe,U as ve,V as he,bW as ge,_ as U,x as Ce,Z as be}from"./index-MHIn2TC9.js";import{I as je}from"./inline-code-B3qpjdZ2.js";import{l as Re}from"./list-runtime-types-DrzHejZo.js";import{D as O,u as Ne,C as Pe}from"./RuntimeConnectFlow-C5UDeHUC.js";var Se=Object.defineProperty,b=(t,n)=>Se(t,"name",{value:n,configurable:!0}),H,_="HoverCard",[F,Xe]=Y(_,[I]),L=I(),[we,T]=F(_),Te=b(t=>{const{__scopeHoverCard:n,children:r,open:o,defaultOpen:s,onOpenChange:c,openDelay:a=700,closeDelay:f=300}=t,x=L(n),i=l.useRef(0),p=l.useRef(0),v=l.useRef(!1),g=l.useRef(!1),[u,m]=W({prop:o,defaultProp:s??!1,onChange:c,caller:_}),d=l.useCallback(()=>{clearTimeout(p.current),i.current=window.setTimeout(()=>m(!0),a)},[a,m]),j=l.useCallback(()=>{clearTimeout(i.current),!v.current&&!g.current&&(p.current=window.setTimeout(()=>m(!1),f))},[f,m]),h=l.useCallback(()=>m(!1),[m]);return l.useEffect(()=>()=>{clearTimeout(i.current),clearTimeout(p.current)},[]),e.jsx(we,{scope:n,open:u,onOpenChange:m,onOpen:d,onClose:j,onDismiss:h,hasSelectionRef:v,isPointerDownOnContentRef:g,children:e.jsx(G,{...x,children:r})})},"HoverCard"),He="HoverCardTrigger",ke=l.forwardRef(b(function(n,r){const{__scopeHoverCard:o,...s}=n,c=T(He,o),a=L(o);return e.jsx(Q,{asChild:!0,...a,children:e.jsx(V.a,{"data-state":c.open?"open":"closed",...s,ref:r,onPointerEnter:C(n.onPointerEnter,w(c.onOpen)),onPointerLeave:C(n.onPointerLeave,w(c.onClose)),onFocus:C(n.onFocus,c.onOpen),onBlur:C(n.onBlur,c.onClose),onTouchStart:C(n.onTouchStart,f=>f.preventDefault())})})},"HoverCardTrigger")),B="HoverCardPortal",[ye,De]=F(B,{forceMount:void 0}),Ee=b(t=>{const{__scopeHoverCard:n,forceMount:r,children:o,container:s}=t,c=T(B,n);return e.jsx(ye,{scope:n,forceMount:r,children:e.jsx(z,{present:r||c.open,children:e.jsx(Z,{asChild:!0,container:s,children:o})})})},"HoverCardPortal"),k="HoverCardContent",Oe=l.forwardRef(b(function(n,r){const o=De(k,n.__scopeHoverCard),{forceMount:s=o.forceMount,...c}=n,a=T(k,n.__scopeHoverCard);return e.jsx(z,{present:s||a.open,children:e.jsx(_e,{"data-state":a.open?"open":"closed",...c,onPointerEnter:C(n.onPointerEnter,w(a.onOpen)),onPointerLeave:C(n.onPointerLeave,w(a.onClose)),ref:r})})},"HoverCardContent")),_e=l.forwardRef(b(function(n,r){const{__scopeHoverCard:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:a,onInteractOutside:f,...x}=n,i=T(k,o),p=L(o),v=l.useRef(null),g=J(r,v),[u,m]=l.useState(!1);return l.useEffect(()=>{if(u){const d=document.body;return H=d.style.userSelect||d.style.webkitUserSelect,d.style.userSelect="none",d.style.webkitUserSelect="none",()=>{d.style.userSelect=H,d.style.webkitUserSelect=H}}},[u]),l.useEffect(()=>{if(v.current){const d=b(()=>{m(!1),i.isPointerDownOnContentRef.current=!1,setTimeout(()=>{var h;((h=document.getSelection())==null?void 0:h.toString())!==""&&(i.hasSelectionRef.current=!0)})},"handlePointerUp");return document.addEventListener("pointerup",d),()=>{document.removeEventListener("pointerup",d),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!1}}},[i.isPointerDownOnContentRef,i.hasSelectionRef]),l.useEffect(()=>{v.current&&K(v.current).forEach(j=>j.setAttribute("tabindex","-1"))}),e.jsx(X,{asChild:!0,disableOutsidePointerEvents:!1,onInteractOutside:f,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:C(a,d=>{d.preventDefault()}),onDismiss:i.onDismiss,children:e.jsx(q,{...p,...x,onPointerDown:C(x.onPointerDown,d=>{d.currentTarget.contains(d.target)&&m(!0),i.hasSelectionRef.current=!1,i.isPointerDownOnContentRef.current=!0}),ref:g,style:{...x.style,userSelect:u?"text":void 0,WebkitUserSelect:u?"text":void 0,"--radix-hover-card-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-hover-card-content-available-width":"var(--radix-popper-available-width)","--radix-hover-card-content-available-height":"var(--radix-popper-available-height)","--radix-hover-card-trigger-width":"var(--radix-popper-anchor-width)","--radix-hover-card-trigger-height":"var(--radix-popper-anchor-height)"}})})},"HoverCardContentImpl"));function w(t){return n=>n.pointerType==="touch"?void 0:t()}b(w,"excludeTouch");function K(t){const n=[],r=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:b(o=>o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP,"acceptNode")});for(;r.nextNode();)n.push(r.currentNode);return n}b(K,"getTabbableNodes");var Le=Te,$e=ke,Ue=Ee,Ie=Oe;function qe({...t}){return e.jsx(Le,{"data-slot":"hover-card",...t})}function et({...t}){return e.jsx($e,{"data-slot":"hover-card-trigger",...t})}function tt({className:t,align:n="center",sideOffset:r=4,...o}){const s=ee();return e.jsx(Ue,{"data-slot":"hover-card-portal",container:s,children:e.jsx(Ie,{"data-slot":"hover-card-content",align:n,sideOffset:r,className:te("bg-dui-popover text-dui-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dui-dark:border dui-dark:border-dui-border z-(--z-overlay) w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md p-4 shadow-lg outline-hidden motion-reduce:animate-none!",t),...o})})}function ze(t,n,r){return r?ne(t)==="provider-picker"?n?{idPrefix:"change",triggerLabel:"Change",cancelLabel:"Keep current source",connect:{kind:"provider-picker",label:"Change power source"},currentProvider:n}:null:se.includes(t)?{idPrefix:"reconnect",triggerLabel:"Fix sign-in",cancelLabel:"Keep current sign-in",connect:{kind:"login",label:`Reconnect ${re(t)}`}}:null:null}function Ae(t,n,r){return t?[t]:n||Re(r)}function Me({runtime:t,types:n,requirements:r,registeredTypes:o=[],onRecheck:s,isRechecking:c=!1,renderConnect:a}){const f=M(),x=Ae(t,n,o);return e.jsxs("div",{className:"space-y-4","data-testid":"runtime-setup-panel",children:[x.map(i=>e.jsx(Fe,{type:i,requirements:r,registered:o.includes(i),renderConnect:a},i)),s&&e.jsxs("div",{className:"flex items-center justify-end gap-3 pt-1",children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"Refresh after connecting."}),e.jsxs(S,{variant:"outline",size:"sm",className:"gap-2",onClick:s,disabled:c,children:[e.jsx(me,{className:E("size-3.5",c&&!f&&"animate-spin")}),"Check again"]})]})]})}function Fe({type:t,requirements:n,registered:r,renderConnect:o}){var N,P,$;const s=y(t),c=s.icon,a=n==null?void 0:n.runtimes[t],f=A(n,t,r),x=f.state==="ready",[i,p]=l.useState(!1),[v,g]=l.useState(!1);!x&&v&&g(!1);const u=x?ze(t,a==null?void 0:a.provider,!!o):null,m=a==null?void 0:a.dependencies.find(R=>R.status!=="satisfied"&&R.installHint),d=(m==null?void 0:m.installHint)??((N=s.setup)==null?void 0:N.installCommand),j=(m==null?void 0:m.infoUrl)??((P=s.setup)==null?void 0:P.infoUrl),h=!!a||!!s.setup;return e.jsxs("section",{className:"border-border rounded-xl border p-4","data-testid":`runtime-section-${t}`,children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(c,{className:"size-4"}),e.jsx("span",{className:"text-sm font-medium",children:s.label})]}),x&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("span",{className:"text-status-success-fg inline-flex items-center gap-1 text-xs","data-testid":`runtime-ready-${t}`,children:[e.jsx(D,{className:"size-3.5"})," Ready"]}),u&&!v&&e.jsx("button",{type:"button",onClick:()=>g(!0),className:"text-muted-foreground hover:text-foreground text-xs underline-offset-2 transition-colors hover:underline","data-testid":`runtime-${u.idPrefix}-${t}`,children:u.triggerLabel})]})]}),u&&v&&e.jsxs("div",{className:"mt-3 space-y-2","data-testid":`runtime-${u.idPrefix}-panel-${t}`,children:[o==null?void 0:o({type:t,connect:u.connect,...u.currentProvider?{currentProvider:u.currentProvider}:{},onConnected:()=>g(!1)}),e.jsx("button",{type:"button",onClick:()=>g(!1),className:"text-muted-foreground hover:text-foreground text-xs transition-colors","data-testid":`runtime-${u.idPrefix}-cancel-${t}`,children:u.cancelLabel})]}),f.state==="unknown"&&e.jsx("p",{className:"text-muted-foreground mt-3 text-sm",children:($=a==null?void 0:a.dependencies.find(R=>R.status==="unknown"))==null?void 0:$.description}),!x&&f.connect&&e.jsx("div",{className:"mt-3",children:e.jsx(Be,{type:t,connect:f.connect,renderConnect:o,installCommand:d,installInfoUrl:j,onShowDetails:()=>p(!0)})}),h&&e.jsxs(xe,{open:i,onOpenChange:p,className:"mt-3",children:[e.jsxs(pe,{className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors",children:[e.jsx(ve,{className:E("size-3.5 transition-transform",i&&"rotate-180")}),"Setup details"]}),e.jsx(he,{className:"mt-3 space-y-3",children:a?a.dependencies.map(R=>e.jsx(We,{dep:R},R.name)):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Not registered with this server. Install it, then enable"," ",e.jsxs(je,{children:["runtimes.",t]})," in your DorkOS config."]}),s.setup&&e.jsx(O,{command:s.setup.installCommand,infoUrl:s.setup.infoUrl,copyLabel:`Copy install command for ${s.label}`})]})})]})]})}function Be({type:t,connect:n,renderConnect:r,installCommand:o,installInfoUrl:s,onShowDetails:c}){return n.kind==="install"?e.jsx(Ke,{type:t,label:n.label,installCommand:o,installInfoUrl:s}):r&&(n.kind==="login"||n.kind==="provider-picker")?e.jsx(e.Fragment,{children:r({type:t,connect:n})}):e.jsx(S,{size:"sm",onClick:c,children:n.label})}function Ke({type:t,label:n,installCommand:r,installInfoUrl:o}){const s=y(t),{provision:c,isPending:a,isError:f,errorMessage:x,progress:i,result:p}=Ne(t);return a||p!=null&&p.ok?e.jsx(Ye,{message:(i==null?void 0:i.message)??`Installing ${s.label}…`}):f?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-destructive text-xs",role:"alert",children:x}),r&&e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:"You can install it yourself instead:"}),e.jsx(O,{command:r,infoUrl:o,copyLabel:`Copy install command for ${s.label}`})]}),e.jsx(S,{size:"sm",onClick:c,children:"Try again"})]}):e.jsxs("div",{children:[e.jsx(S,{size:"sm",onClick:c,children:n}),r&&e.jsx(Pe,{command:r,runtimeLabel:s.label})]})}function Ye({message:t}){const n=M();return e.jsxs(U.div,{className:"bg-muted flex items-center gap-2 rounded-lg px-3 py-2.5",initial:n?!1:{opacity:0},animate:{opacity:1},"data-testid":"provision-progress",children:[e.jsx(Ce,{size:"xs",className:E("text-muted-foreground shrink-0",n&&"animate-none")}),e.jsx(be,{mode:"wait",children:e.jsx(U.span,{className:"truncate text-xs",initial:n?!1:{opacity:0},animate:{opacity:1},exit:n?void 0:{opacity:0},transition:{duration:.2},children:t},t)})]})}function We({dep:t}){const n=t.status==="satisfied";return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-[auto_1fr] items-center gap-x-2",children:[n?e.jsx(D,{className:"text-status-success size-3.5 shrink-0"}):e.jsx(ge,{className:"text-status-warning-dot size-3.5 shrink-0"}),e.jsx("span",{className:"text-sm",children:t.name}),e.jsx("p",{className:"text-muted-foreground col-start-2 mt-1 text-xs",children:n&&t.version?`v${t.version}`:t.description})]}),!n&&(t.installHint||t.infoUrl)&&e.jsx(O,{command:t.installHint,infoUrl:t.infoUrl,copyLabel:`Copy install command for ${t.name}`})]})}function nt({runtime:t,open:n,onOpenChange:r,renderConnect:o,onRuntimeReady:s,showConnectSuccess:c=!1}){const a=ae(),{data:f}=oe(),x=t?y(t):null,i=A(a.data,t??"",f?t!==void 0&&t in f.capabilities:!0),p=a.data!==void 0,v=x!==null&&p&&i.state==="ready",g=l.useRef(null);l.useEffect(()=>{if(!n){g.current=null;return}if(t===void 0||!p)return;const h=g.current;g.current={runtime:t,ready:v},h!==null&&h.runtime===t&&!h.ready&&v&&(s==null||s(t))},[n,p,v,t,s]);const[u,m]=l.useState(null),d=l.useRef(n);l.useEffect(()=>{d.current&&!n&&m(null),d.current=n},[n]);const j=o&&(c?h=>o({...h,onConnected:N=>{var P;(P=h.onConnected)==null||P.call(h,N),m(N)}}):o);return e.jsx(ie,{open:n,onOpenChange:r,children:e.jsxs(ce,{className:"sm:max-w-md",children:[e.jsxs(le,{children:[e.jsx(de,{children:x?x.label:"Your runtimes"}),e.jsx(ue,{children:u?"Connected.":x?v?"Ready to use.":"Connect it to start a chat.":"Connect one to start a chat."})]}),e.jsx(fe,{children:u?e.jsx(Ge,{success:u,onDone:()=>r(!1)}):e.jsx(Me,{runtime:t,requirements:a.data,registeredTypes:f?Object.keys(f.capabilities):void 0,onRecheck:()=>void a.refetch(),isRechecking:a.isFetching,renderConnect:j})})]})})}function Ge({success:t,onDone:n}){return e.jsxs("div",{className:"space-y-4","data-testid":"runtime-connected-panel",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(D,{className:"text-status-success mt-0.5 size-4 shrink-0"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium",children:t.title}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:t.body})]})]}),e.jsx(S,{size:"sm",className:"w-full",onClick:n,"data-testid":"runtime-connected-done",children:"Done"})]})}export{qe as H,nt as R,et as a,tt as b,Me as c};
|