dorkos 0.115.0 → 0.116.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.
Files changed (233) hide show
  1. package/dist/bin/cli.js +130 -69
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-Cz8ijNrK.js → AboutPage-KW-6Y7Wm.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-BzmfwxSZ.js → ActivityErrorState-C5xbcrFo.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-BK7T3OiI.js → ActivityPage-DIeicP6l.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-Ig5atv15.js → ActivityRow-Drxrnyea.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-BXPv5J8h.js → AdapterIcon-BEuzKbC6.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-BEziztL3.js → AdapterSetupWizard-z_agWfDl.js} +2 -2
  10. package/dist/client/assets/{AgentOptionRow-BqFQvFeN.js → AgentOptionRow-DEwQwnKr.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-dCfEIsU-.js → AgentPicker-CmyF25Oi.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-BAhfGJxx.js → AgentRequestCard-BWtE34Nr.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-7qHhFeEv.js → AppearancePage-BJO-Q3a4.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-jqOFh0d1.js → ApplyToOverridesDialog-CsmbPbTh.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-3CgglXkd.js → AttentionSignalRow-2-aDCEdR.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMKtHI0D.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-CL7e4dO8.js} +1 -1
  17. package/dist/client/assets/{BindingDialog-DSBxRyzA.js → BindingDialog-CirNTa_m.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-CyRuqAJV.js → BlintzCanvas-bfmQpoVE.js} +1 -1
  19. package/dist/client/assets/{CanvasCsvContent-Bd1c6TGx.js → CanvasCsvContent-x86ueAZo.js} +1 -1
  20. package/dist/client/assets/{CanvasFileContent-DelYwSH8.js → CanvasFileContent-DIQbKII9.js} +2 -2
  21. package/dist/client/assets/{CanvasModel3dContent-BExIu4RY.js → CanvasModel3dContent-DTAWG8IS.js} +2 -2
  22. package/dist/client/assets/{ChatAppsOff-SWemSaUp.js → ChatAppsOff-BQiTfHe3.js} +1 -1
  23. package/dist/client/assets/{CodeMirrorDiff-0WF4ITRZ.js → CodeMirrorDiff-DhNTAsQl.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorEditor-Bg7wC_Q8.js → CodeMirrorEditor-BpIF0kLM.js} +1 -1
  25. package/dist/client/assets/{CommitmentList-CTvEGUV3.js → CommitmentList-B-B3E6yN.js} +1 -1
  26. package/dist/client/assets/{CommitmentsPage-C68etoLe.js → CommitmentsPage-BNoKIW7z.js} +1 -1
  27. package/dist/client/assets/ComputerResourceView-NMA65a8a.js +6 -0
  28. package/dist/client/assets/ComputerViewer-BjU1hfpc.js +1 -0
  29. package/dist/client/assets/{ConnectionAccessLists-9oeVn_GK.js → ConnectionAccessLists-Iy_T25Rw.js} +1 -1
  30. package/dist/client/assets/{ConnectionsPage-CJOY4-kp.js → ConnectionsPage-DPfoPshS.js} +2 -2
  31. package/dist/client/assets/{ConventionPage-DD-f5o6y.js → ConventionPage-CoLB6WVs.js} +1 -1
  32. package/dist/client/assets/{ExtensionPageRoute-C6fW17AG.js → ExtensionPageRoute-Y_Na63mr.js} +2 -2
  33. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-Zccd0fv6.js → FloatingTanStackRouterDevtools-CqogiFob-DCj2Id-d.js} +1 -1
  34. package/dist/client/assets/HandlePage-WyPrFOtj.js +1 -0
  35. package/dist/client/assets/{HeartbeatPage-cJM6NuTD.js → HeartbeatPage-zzL8W_zA.js} +1 -1
  36. package/dist/client/assets/{KeyEntry-K5k_3TfU.js → KeyEntry-DCATqdIG.js} +2 -2
  37. package/dist/client/assets/{LexicalField-DB5V20zv.js → LexicalField-B7d9UWFk.js} +1 -1
  38. package/dist/client/assets/{ManagesPage-Cj0-hwfr.js → ManagesPage-CKTb1w3G.js} +1 -1
  39. package/dist/client/assets/{Marketplace-eWEtLmd9.js → Marketplace-Deq-aTM6.js} +2 -2
  40. package/dist/client/assets/{MarketplaceSourcesView-B1h70C20.js → MarketplaceSourcesView-B2qLtCVG.js} +1 -1
  41. package/dist/client/assets/{McpAppFrame-BaJ_r-QR.js → McpAppFrame-BKgYSUH-.js} +1 -1
  42. package/dist/client/assets/{McpSigninBody-Coaq5Fkf.js → McpSigninBody-Begd1UNn.js} +1 -1
  43. package/dist/client/assets/{Model3dViewer-cKa-Jnbl.js → Model3dViewer-CK6siI6q.js} +1 -1
  44. package/dist/client/assets/NamePage-DxDcIFAo.js +1 -0
  45. package/dist/client/assets/{NewDirectMessageMenu-C4zNIv9x.js → NewDirectMessageMenu-D4ORE1Lo.js} +1 -1
  46. package/dist/client/assets/{NotificationsPage-gKNClvNU.js → NotificationsPage-CjRyxKXv.js} +1 -1
  47. package/dist/client/assets/{OpenMeshSwitch-RzB2u6-Q.js → OpenMeshSwitch-C0C-f-dF.js} +2 -2
  48. package/dist/client/assets/{OperatorIdentityForm-B_78Vqh8.js → OperatorIdentityForm-I9zvI2go.js} +1 -1
  49. package/dist/client/assets/{PermissionHistory-DrtlA4YM.js → PermissionHistory-C9vTiyw5.js} +1 -1
  50. package/dist/client/assets/{PermissionsPage-O7kUVaQv.js → PermissionsPage-BR9LM1Bo.js} +1 -1
  51. package/dist/client/assets/{PersonalityPopover-DiNuuoWu.js → PersonalityPopover-BhFUSfRe.js} +1 -1
  52. package/dist/client/assets/PhotoPage-C4OhoBR2.js +1 -0
  53. package/dist/client/assets/{PresetPicker-BUFwg8RS.js → PresetPicker-CpTnkeZt.js} +3 -3
  54. package/dist/client/assets/{PreviewRefusedNotice-DXZp669C.js → PreviewRefusedNotice-R5LB9PuV.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-BCfMzNcT.js → ProfileFields-8fFud5gT.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-BzC2MGdi.js → ProfilePanelContainer-BJFOrUov.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-f0FKXLtu.js → ProfileRolePicker-C8hpW08c.js} +1 -1
  58. package/dist/client/assets/{PromptSuggestionChips-EgeMFibt.js → PromptSuggestionChips-1su17rvx.js} +1 -1
  59. package/dist/client/assets/{ReportsToPopover-CQ4Xxslu.js → ReportsToPopover-7H3_8Brz.js} +1 -1
  60. package/dist/client/assets/{RoomSurface-oDbc6jnO.js → RoomSurface-BkoesTVz.js} +5 -5
  61. package/dist/client/assets/{RoomsPage-D_EbiSZ3.js → RoomsPage-BrMOJQpt.js} +1 -1
  62. package/dist/client/assets/{RunsOnPopover-LtmmbIsD.js → RunsOnPopover-BB7T1Zln.js} +1 -1
  63. package/dist/client/assets/{RuntimeConnectFlow-Kv2ytk2m.js → RuntimeConnectFlow-oHwqp_fn.js} +1 -1
  64. package/dist/client/assets/{RuntimeSetupDialog-CiWxlcPc.js → RuntimeSetupDialog-BTT2-FM8.js} +1 -1
  65. package/dist/client/assets/{SessionsPage-1rDO0SGV.js → SessionsPage-PpKG9Phd.js} +1 -1
  66. package/dist/client/assets/{SettingsDialog-_ctp2AfE.js → SettingsDialog-Dxtq0E9R.js} +4 -4
  67. package/dist/client/assets/{SkillsPage-gPuQHKps.js → SkillsPage-CzzuhGH2.js} +1 -1
  68. package/dist/client/assets/{TaskDialogWrapper-BPFpCgsN.js → TaskDialogWrapper-DWVo-1P7.js} +1 -1
  69. package/dist/client/assets/{TasksEmptyState-D0Jlzmed.js → TasksEmptyState-DfR9p54p.js} +2 -2
  70. package/dist/client/assets/{TasksPage-DvGfg5Bk.js → TasksPage-5_XngIV9.js} +1 -1
  71. package/dist/client/assets/TeamComputerEntry-BE_gamkp.js +1 -0
  72. package/dist/client/assets/{ToolsPage-B0qZ85pR.js → ToolsPage-CefworrO.js} +2 -2
  73. package/dist/client/assets/{TopologyGraph-q1ammgpG.js → TopologyGraph-C1DaL02H.js} +2 -2
  74. package/dist/client/assets/{TourHost-Dc8qw1Ef.js → TourHost-pT1tIPF7.js} +1 -1
  75. package/dist/client/assets/{UnlinkDialog-DXdrLsGV.js → UnlinkDialog-oMOr8e6G.js} +1 -1
  76. package/dist/client/assets/{WidgetErrorCard-ChDNC060.js → WidgetErrorCard-CBFo1SMe.js} +7 -7
  77. package/dist/client/assets/_shell-BiAMGu0F.js +90 -0
  78. package/dist/client/assets/{_shell._home-DjGunhLV.js → _shell._home-Cx7ZsoQO.js} +1 -1
  79. package/dist/client/assets/{_shell._home.activity-B014dET1.js → _shell._home.activity-C3fnNXgc.js} +1 -1
  80. package/dist/client/assets/{_shell._home.index-DEmtTHZg.js → _shell._home.index-CixksaeD.js} +2 -2
  81. package/dist/client/assets/{_shell._home.tasks-CnDEbUOd.js → _shell._home.tasks-DZWUHfK_.js} +1 -1
  82. package/dist/client/assets/{_shell._home.workspaces-AQtMUWuu.js → _shell._home.workspaces-y-DAPB_X.js} +1 -1
  83. package/dist/client/assets/{_shell.channels-C8NOhmJd.js → _shell.channels-DEErD0f0.js} +4 -4
  84. package/dist/client/assets/{_shell.connections-Bxe0wxOB.js → _shell.connections-B36f6FWi.js} +1 -1
  85. package/dist/client/assets/{_shell.feedback-requests-C6ku9F5_.js → _shell.feedback-requests-B0QiSuDC.js} +2 -2
  86. package/dist/client/assets/_shell.marketplace-CardBSA_.js +1 -0
  87. package/dist/client/assets/_shell.marketplace_.sources-CVK8YKDA.js +1 -0
  88. package/dist/client/assets/{_shell.session-Dn0C0mEZ.js → _shell.session-Cl7qfi1Z.js} +3 -3
  89. package/dist/client/assets/_shell.team-DIdgc_vn.js +28 -0
  90. package/dist/client/assets/_shell.x._extensionId-BEPW8hvh.js +1 -0
  91. package/dist/client/assets/_shell.x._extensionId_._-BEPW8hvh.js +1 -0
  92. package/dist/client/assets/{access-copy-CBGtcTk0.js → access-copy-CE5oc1d9.js} +1 -1
  93. package/dist/client/assets/{agent-browser-DbcLtsAx.js → agent-browser-DV76U8Ny.js} +1 -1
  94. package/dist/client/assets/{banner-rPsz3suJ.js → banner-DIVQNO0O.js} +1 -1
  95. package/dist/client/assets/{card-BqN3lfJn.js → card-DVdPY08b.js} +1 -1
  96. package/dist/client/assets/{command-ZTLTCj0l.js → command-BhZ8sKG4.js} +1 -1
  97. package/dist/client/assets/{cpu-D70xMHl2.js → cpu-CtmIFRqs.js} +1 -1
  98. package/dist/client/assets/{empty-state-yl1dLwLN.js → empty-state-DHuumxZB.js} +1 -1
  99. package/dist/client/assets/{execution-config-BbBEe6FO.js → execution-config-JdnxoV1P.js} +1 -1
  100. package/dist/client/assets/{file-CGg2M6ED.js → file-Bc34j1rj.js} +1 -1
  101. package/dist/client/assets/{file-exclamation-point-DZrVsShR.js → file-exclamation-point-dxJUSR3k.js} +1 -1
  102. package/dist/client/assets/{file-text-BYq_4IAt.js → file-text-BNSVr0Hh.js} +1 -1
  103. package/dist/client/assets/{find-latest-widget-fence-CWs9nr10.js → find-latest-widget-fence-oI6Sl7rV.js} +1 -1
  104. package/dist/client/assets/{form-vPuXuaYT.js → form-FbjLEM3I.js} +1 -1
  105. package/dist/client/assets/{format-cron-D02Tnupo.js → format-cron-BaE7qyNN.js} +1 -1
  106. package/dist/client/assets/{git-branch-DbjXDO_F.js → git-branch-BBKObhlk.js} +1 -1
  107. package/dist/client/assets/{heart-Dblp_miM.js → heart-BdbxexAy.js} +1 -1
  108. package/dist/client/assets/{highlighted-body-KPVGNVTW-CaMXMak-.js → highlighted-body-KPVGNVTW-R3x8mG02.js} +1 -1
  109. package/dist/client/assets/{index-vRc1D4KI.js → index-0AgY877T.js} +1 -1
  110. package/dist/client/assets/{index-D16KF-iC.js → index-1-RB7sXm.js} +3 -3
  111. package/dist/client/assets/{index-BW98owO8.js → index-4irOzx9Q.js} +1 -1
  112. package/dist/client/assets/{index-P5j6zmcN.js → index-6ZmBCm_d.js} +1 -1
  113. package/dist/client/assets/{index-DzeYt-GT.js → index-7xf1fyHe.js} +1 -1
  114. package/dist/client/assets/{index-BxqUb-n7.js → index-BCT0tkN4.js} +1 -1
  115. package/dist/client/assets/{index-BKuzoeSn.js → index-BFh_VGhh.js} +1 -1
  116. package/dist/client/assets/{index-B-WvQ24u.js → index-BKnIV8YQ.js} +6 -6
  117. package/dist/client/assets/{index-D6m2SWHr.js → index-BQgJVNUB.js} +1 -1
  118. package/dist/client/assets/{index-BiIbMZ6d.js → index-BV0RP90y.js} +1 -1
  119. package/dist/client/assets/{index-BV0tZnYg.js → index-BWHsw5Qn.js} +1 -1
  120. package/dist/client/assets/{index-CMWMhbec.js → index-BbUZazTt.js} +1 -1
  121. package/dist/client/assets/{index-CWNsRK97.js → index-BcPMhqQ_.js} +1 -1
  122. package/dist/client/assets/{index-DwUdUliR.js → index-BeKz0Z7i.js} +1 -1
  123. package/dist/client/assets/index-C481yCZ2.js +1 -0
  124. package/dist/client/assets/{index-Db2EOzA3.js → index-C4vL5hUU.js} +1 -1
  125. package/dist/client/assets/{index-DDYi817r.js → index-C5n3OkTH.js} +1 -1
  126. package/dist/client/assets/{index-Z8YcKwIB.js → index-C76UofV4.js} +1 -1
  127. package/dist/client/assets/index-CB-aY4BF.js +1 -0
  128. package/dist/client/assets/{index-CN9fywRC.js → index-CDx26Vyr.js} +1 -1
  129. package/dist/client/assets/{index-Dg_bax15.js → index-CJW9tZhq.js} +5 -5
  130. package/dist/client/assets/{index-BPwUl0Bz.js → index-CJw16oEF.js} +1 -1
  131. package/dist/client/assets/{index-CaLw69VE.js → index-C_Pquyu-.js} +1 -1
  132. package/dist/client/assets/{index-Gq3gqBhY.js → index-CpAdYUxX.js} +1 -1
  133. package/dist/client/assets/{index-XE46wAj9.js → index-D1bAoT3D.js} +1 -1
  134. package/dist/client/assets/{index-Bd23EYYT.js → index-D7MytHQN.js} +2 -2
  135. package/dist/client/assets/index-DKubbEZd.css +1 -0
  136. package/dist/client/assets/{index-BOL391En.js → index-DShpGK7T.js} +1 -1
  137. package/dist/client/assets/{index-C88NZagl.js → index-DlWFe9SD.js} +1 -1
  138. package/dist/client/assets/{index-oWLYcpm4.js → index-DluIa1Dv.js} +1 -1
  139. package/dist/client/assets/index-Dm1Ngy2r.js +38 -0
  140. package/dist/client/assets/{index-CdKpQ1hI.js → index-DxTOTFWT.js} +280 -280
  141. package/dist/client/assets/{index-lNMJBFB0.js → index-DzRQN8yx.js} +1 -1
  142. package/dist/client/assets/index-Fl8NxGfN.js +119 -0
  143. package/dist/client/assets/{index-CrK4rKAq.js → index-fe27h49h.js} +1 -1
  144. package/dist/client/assets/{index-DdbHrvr0.js → index-hIJdyL6m.js} +1 -1
  145. package/dist/client/assets/{index-BPqkuMIa.js → index-hLWqos0I.js} +1 -1
  146. package/dist/client/assets/{index-CRZXSh_q.js → index-pKhRsSRA.js} +1 -1
  147. package/dist/client/assets/{index-CHvi6xUU.js → index-sRPmoNhi.js} +1 -1
  148. package/dist/client/assets/{index-BdVOtoFr.js → index-tPf4Bia7.js} +1 -1
  149. package/dist/client/assets/{index-Bi7Um5RU.js → index-vHt--4jg.js} +1 -1
  150. package/dist/client/assets/{inline-code-Cvn43Gqu.js → inline-code-CrAiSiKW.js} +1 -1
  151. package/dist/client/assets/{layers-Bmz62WF4.js → layers-QYiauDIw.js} +1 -1
  152. package/dist/client/assets/{lightbulb-CAd6slmc.js → lightbulb-Dc3wEED9.js} +1 -1
  153. package/dist/client/assets/{link-2-C0mn8T24.js → link-2-BUnfBMCd.js} +1 -1
  154. package/dist/client/assets/{list-runtime-types-DxwGcKLx.js → list-runtime-types-H-N7VUS4.js} +1 -1
  155. package/dist/client/assets/{markdown-content-1-B7PdbY.js → markdown-content-fIydDTfa.js} +1 -1
  156. package/dist/client/assets/{mention-pill-D_-KXznh.js → mention-pill-CONiQ9Xs.js} +1 -1
  157. package/dist/client/assets/{message-square-off-Di7kQvfe.js → message-square-off-BMD4bxOr.js} +1 -1
  158. package/dist/client/assets/{more-details-C6UGVeDE.js → more-details-DMD6Pqb5.js} +1 -1
  159. package/dist/client/assets/{owner-notice-CudDDBX4.js → owner-notice-BRcpYvJk.js} +1 -1
  160. package/dist/client/assets/{package-D2eMoFCI.js → package-CGgpgsfC.js} +1 -1
  161. package/dist/client/assets/{page-container-CDHAACRA.js → page-container-uyGtbP6Z.js} +1 -1
  162. package/dist/client/assets/{paperclip-p0W24D54.js → paperclip-CUxIVlMU.js} +1 -1
  163. package/dist/client/assets/{path-input-j04LMj9z.js → path-input-CeMu6ytc.js} +1 -1
  164. package/dist/client/assets/{primer-trigger-DkCcHf2Q.js → primer-trigger-x8IfRd6U.js} +2 -2
  165. package/dist/client/assets/{profile-errors-CqflLCzu.js → profile-errors-DyrpY2ry.js} +1 -1
  166. package/dist/client/assets/{progress-BcuH4Eod.js → progress-2cuTo9I-.js} +1 -1
  167. package/dist/client/assets/{query-error-state-CEZs7dhg.js → query-error-state-Cq1O4FGq.js} +1 -1
  168. package/dist/client/assets/{radio-DGWfQ5Rf.js → radio-H5ktIFzD.js} +1 -1
  169. package/dist/client/assets/registry-DNRE0Em-.js +1 -0
  170. package/dist/client/assets/{relay-trace-schemas-y0nd8fzi.js → relay-trace-schemas-Crc4Iceb.js} +2 -2
  171. package/dist/client/assets/{room-files-source-C1TCg4W_.js → room-files-source-thCvGi0E.js} +2 -2
  172. package/dist/client/assets/{rotate-ccw-clock-DcBojy-0.js → rotate-ccw-clock-DKP7zbQr.js} +1 -1
  173. package/dist/client/assets/{rotate-cw-D0vUyeR2.js → rotate-cw-Cwv_uaU3.js} +1 -1
  174. package/dist/client/assets/{scroll-area-CQ9lO56h.js → scroll-area-CaJ1TwhG.js} +1 -1
  175. package/dist/client/assets/{search-x-EJGj73JB.js → search-x-D-Un20jR.js} +2 -2
  176. package/dist/client/assets/{shield-check-Bp58y9u7.js → shield-check-CMhrOu-d.js} +1 -1
  177. package/dist/client/assets/{shield-x-jF_NCCvp.js → shield-x-DlaUufPM.js} +1 -1
  178. package/dist/client/assets/{soul-file-Cag2i87x.js → soul-file-C5-nKCwV.js} +1 -1
  179. package/dist/client/assets/{table-D89CWVJX.js → table-C7pi-jkJ.js} +1 -1
  180. package/dist/client/assets/{terminal-BUhNMZAt.js → terminal-IYkyS2eR.js} +1 -1
  181. package/dist/client/assets/{trust-posture-15DMDZTA.js → trust-posture-BxFTuKAo.js} +1 -1
  182. package/dist/client/assets/{unplug-opnrSXAi.js → unplug-Bv5BESa4.js} +1 -1
  183. package/dist/client/assets/{unverified-catalog-notice-DHM5Coia.js → unverified-catalog-notice-B9dzvyVq.js} +1 -1
  184. package/dist/client/assets/{use-adapter-catalog-ClMqVelU.js → use-adapter-catalog-DDD8zCQo.js} +1 -1
  185. package/dist/client/assets/{use-bindings-Ch6UUBvz.js → use-bindings-BXHWfTB2.js} +1 -1
  186. package/dist/client/assets/{use-composer-prefs-Qn7KRpYe.js → use-composer-prefs-DG8dQD3D.js} +1 -1
  187. package/dist/client/assets/{use-connector-management-dX_4x0d3.js → use-connector-management-l6Ii6UIU.js} +1 -1
  188. package/dist/client/assets/{use-deep-link-scroll-BV2fY4gy.js → use-deep-link-scroll-CPgyWLMM.js} +1 -1
  189. package/dist/client/assets/{use-delete-binding-BklxjB_c.js → use-delete-binding-NPl-TzUw.js} +1 -1
  190. package/dist/client/assets/{use-dev-links-D4Bqam6F.js → use-dev-links-DYaUSRn0.js} +1 -1
  191. package/dist/client/assets/{use-external-adapter-catalog-nHiD8BKZ.js → use-external-adapter-catalog-BrmKSNvG.js} +1 -1
  192. package/dist/client/assets/{use-full-activity-feed-vYU7wQWT.js → use-full-activity-feed-CEvmRK6d.js} +1 -1
  193. package/dist/client/assets/use-is-below-desktop-Cx2BL1BK.js +1 -0
  194. package/dist/client/assets/{use-jump-back-in-BVunjzyr.js → use-jump-back-in-BMgpYhK-.js} +2 -2
  195. package/dist/client/assets/{use-mesh-topology-NaUKSKol.js → use-mesh-topology-D82_pOi9.js} +1 -1
  196. package/dist/client/assets/{use-mounted-ref-BWpQ8f91.js → use-mounted-ref-Bs5osknq.js} +1 -1
  197. package/dist/client/assets/{use-notification-prefs-qO1zRRFN.js → use-notification-prefs-Bpzt57w3.js} +1 -1
  198. package/dist/client/assets/{use-panel-tab-placements-Db6p2vLD.js → use-panel-tab-placements-COBgt4Uh.js} +1 -1
  199. package/dist/client/assets/use-pending-read-DpJbidPK.js +1 -0
  200. package/dist/client/assets/{use-personality-commit-DUEKxHt_.js → use-personality-commit-D8Fqsrzc.js} +1 -1
  201. package/dist/client/assets/{use-promo-activation-CnGaw39P.js → use-promo-activation-sHnkQjl-.js} +2 -2
  202. package/dist/client/assets/{use-promo-dismissals-bkSHhGhj.js → use-promo-dismissals-BW_429t4.js} +1 -1
  203. package/dist/client/assets/{use-pulse-freshness-Oc_1gs-Y.js → use-pulse-freshness-BkYMwuUb.js} +1 -1
  204. package/dist/client/assets/{use-relay-config-Ba-S4wxY.js → use-relay-config-CsB8Q0cK.js} +1 -1
  205. package/dist/client/assets/{use-room-follow-claim-DqE5b95Z.js → use-room-follow-claim-DqvqzwBA.js} +1 -1
  206. package/dist/client/assets/{use-roving-tab-list-DnMqliqf.js → use-roving-tab-list-iDj1p8tT.js} +1 -1
  207. package/dist/client/assets/{use-session-canvas-OdljtBE8.js → use-session-canvas-DrKA7UHs.js} +4 -4
  208. package/dist/client/assets/{use-session-diagnostics-CtjxsM8_.js → use-session-diagnostics-D6wJVzUG.js} +2 -2
  209. package/dist/client/assets/{use-unclaimed-chats-5RCD5wIp.js → use-unclaimed-chats-bLDQhIiU.js} +1 -1
  210. package/dist/client/assets/use-update-config-Dk0MthxZ.js +1 -0
  211. package/dist/client/assets/{useMutationState-Mjr_y4xX.js → useMutationState-eZMPCch6.js} +1 -1
  212. package/dist/client/index.html +2 -2
  213. package/dist/server/extension-child.cjs +772 -36
  214. package/dist/server/index.js +5533 -4697
  215. package/dist/server/index.js.map +2 -2
  216. package/package.json +6 -5
  217. package/dist/client/assets/HandlePage-DOxlquWl.js +0 -1
  218. package/dist/client/assets/NamePage-W7Frb1yy.js +0 -1
  219. package/dist/client/assets/PhotoPage-DdBke3yj.js +0 -1
  220. package/dist/client/assets/_shell-BxPza3Lx.js +0 -88
  221. package/dist/client/assets/_shell.marketplace-CEnzWFmI.js +0 -1
  222. package/dist/client/assets/_shell.marketplace_.sources-BZq1d2ih.js +0 -1
  223. package/dist/client/assets/_shell.team-DoLdOMoC.js +0 -28
  224. package/dist/client/assets/_shell.x._extensionId-DhE3OYMF.js +0 -1
  225. package/dist/client/assets/_shell.x._extensionId_._-DhE3OYMF.js +0 -1
  226. package/dist/client/assets/index-BzczIyv5.js +0 -119
  227. package/dist/client/assets/index-C6NUjpzQ.js +0 -38
  228. package/dist/client/assets/index-O_HMols_.js +0 -1
  229. package/dist/client/assets/index-kktlr1TJ.css +0 -1
  230. package/dist/client/assets/registry-ChxwU0f4.js +0 -1
  231. package/dist/client/assets/use-is-below-desktop-G-mTu2Ga.js +0 -1
  232. package/dist/client/assets/use-pending-read-DUqJZUza.js +0 -1
  233. package/dist/client/assets/use-update-config-xkznZMHr.js +0 -1
@@ -1 +1 @@
1
- import{a8 as b,aa as R,ab as j,bs as x,ae as P,ef as C,r as d,j as e,cE as E,cF as M,cH as k,cI as K,cJ as T,dB as I,e1 as L,I as F,aK as N,B as D,bG as B,bH as H,eg as O,f as Q,bI as _,bK as q,eh as G}from"./index-CdKpQ1hI.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function S(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function Y({isInlineErrorVisible:t}){const n=b(),r=R();return j({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{S(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function U(){const t=b(),n=R();return j({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function W({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=Y({isInlineErrorVisible:()=>u.current}),g=S(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},A=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(K,{children:"New channel"}),e.jsx(T,{children:"Name it, then pick who’s in it."})]}),e.jsxs(I,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(F,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:A,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const z="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function $(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function X({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),G.getState().open()};return e.jsxs(B,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(H,{asChild:!0,children:e.jsx(O,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(Q,{})})}),e.jsxs(_,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(q,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:$,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:z})]})]})}export{W as C,X as N,z as O,V as a,$ as o,U as u};
1
+ import{a8 as b,aa as R,ab as j,bs as x,ae as P,eh as C,r as d,j as e,cG as E,cH as M,cJ as k,cK as K,cL as T,dD as L,e3 as I,I as F,aK as N,B as D,bG as H,bH as O,ei as B,f as G,bI as Q,bK as _,ej as q}from"./index-DxTOTFWT.js";function w(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function S(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function Y({isInlineErrorVisible:t}){const n=b(),r=R();return j({mutationFn:({title:a,agentPaths:l})=>n.createRoom({kind:"channel",title:a,members:[],agentPaths:l}),onSuccess:()=>w(r),meta:{suppressErrorToast:!0},onError:a=>{S(a)&&t()||P.error("Couldn’t create that channel.",{description:a.message})}})}function U(){const t=b(),n=R();return j({mutationFn:({agentPaths:r,title:a})=>t.createRoom({kind:"dm",title:a,members:[],agentPaths:r}),onSettled:()=>w(n),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function W({open:t,onOpenChange:n,onCreated:r}){const a=C(),[l,m]=d.useState(""),h=d.useRef(null),c=d.useRef(null),u=d.useRef(!0);d.useEffect(()=>(u.current=!0,()=>{u.current=!1}),[]);const o=Y({isInlineErrorVisible:()=>u.current}),g=S(o.error)?o.error.message:null,f=l.trim(),p=f.length>0&&f.length<=y,v=s=>{!p||o.isPending||o.mutate({title:f,agentPaths:s.map(i=>i.agentPath)},{onSuccess:i=>{n(!1),r(i)}})},A=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:n,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(k,{children:[e.jsx(K,{children:"New channel"}),e.jsx(T,{children:"Name it, then pick who’s in it."})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(F,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:A,"aria-invalid":g?!0:void 0,"aria-describedby":g?"channel-name-error":void 0}),g&&e.jsx("p",{id:"channel-name-error",role:"alert",className:"text-destructive text-xs",children:g})]}),e.jsxs("section",{"aria-label":"Agents in this channel",className:"space-y-2 border-t pt-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:"Who’s in it"}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Agents read everything here and reply when @mentioned."}),e.jsx(N,{roster:a,onSubmit:v,submitLabel:s=>s.length===0?"Create channel":s.length===1?"Create channel with 1 agent":`Create channel with ${s.length} agents`,emptyRosterMessage:"You don’t have any agents yet. You can add them to the channel later.",allChosenMessage:"That’s every agent you have.",isSubmitting:o.isPending,submitDisabled:!p,inputRef:c})]}),e.jsx("div",{className:"flex justify-center border-t pt-3",children:e.jsx(D,{type:"button",variant:"ghost",size:"sm",disabled:!p||o.isPending,onClick:()=>v([]),children:"Create it without agents"})})]})]})})}const z="One agent opens a chat. Two or more start a group message.";function V(t){return t.length===1}function $(t){const n=t[0];return n!==void 0&&V(t)?`Open chat with ${n.displayName}`:"Start group message"}function X({onStart:t,open:n,onOpenChange:r,hideTrigger:a=!1}){const l=C(),m=d.useRef(null),h=()=>{r(!1),q.getState().open()};return e.jsxs(H,{open:n,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(O,{asChild:!0,children:e.jsx(B,{...a?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(G,{})})}),e.jsxs(Q,{side:"right",align:"start",className:"flex w-64 flex-col p-2","aria-label":"New message",onOpenAutoFocus:c=>{var u;c.preventDefault(),(u=m.current)==null||u.focus()},children:[e.jsx(_,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:$,emptyRosterMessage:"You don’t have any agents yet.",emptyRosterAction:e.jsx(D,{type:"button",size:"sm",variant:"outline",onClick:h,children:"Create agent"}),allChosenMessage:"Everyone is already here."}),e.jsx("p",{className:"text-muted-foreground mt-2 shrink-0 px-2 text-xs",children:z})]})]})}export{W as C,X as N,z as O,V as a,$ as o,U as u};
@@ -1 +1 @@
1
- import{j as t,w as s}from"./index-CdKpQ1hI.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
1
+ import{j as t,w as s}from"./index-DxTOTFWT.js";function o({member:e}){var n;const i=((n=e.agent)==null?void 0:n.manifestId)??null;return i===null?t.jsx("div",{className:"min-h-0 flex-1 px-4 py-3","data-slot":"profile-notifications",children:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Notifications are set per agent."})}):t.jsx("div",{className:"min-h-0 flex-1 px-2 py-2","data-slot":"profile-notifications",children:t.jsx(s,{lens:{agentId:i},emptyLabel:`${e.displayName} has not told you anything yet.`})})}export{o as NotificationsPage};
@@ -1,5 +1,5 @@
1
- import{ej as A,r as f,ek as K,el as T,a8 as p,a9 as _,aa as O,ab as v,em as M,j as d,en as S,cB as j,Q as R}from"./index-CdKpQ1hI.js";import{u as w}from"./use-mesh-topology-NaUKSKol.js";const m={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=m.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>m.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=T((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function F(e,t=[],s=q){const n=e.join(`
1
+ import{el as A,r as f,em as K,en as T,a8 as p,a9 as _,aa as O,ab as v,eo as M,j as d,ep as S,cD as R,Q as j}from"./index-DxTOTFWT.js";import{u as w}from"./use-mesh-topology-D82_pOi9.js";const m={activeWithinMs:3600*1e3,inactiveAfterMs:10080*60*1e3};function P(e){if(e.liveKinds.includes("pendingApproval")||e.liveKinds.includes("error")||e.hasBrokenExecutionConfig===!0)return"needs-attention";if(e.liveKinds.includes("streaming"))return"active";if(e.lastActivityAt===null)return"fresh";if(e.now-e.lastActivityAt<=m.activeWithinMs)return"active";const s=Math.max(e.lastActivityAt,e.lastInteractionAt??e.lastActivityAt);return e.now-s>m.inactiveAfterMs?"inactive":"idle"}function x(e,t,s){var a;const n=new Map;for(const[i,o]of Object.entries(e)){if(!s.has(o))continue;const r=T((a=t[i])==null?void 0:a.lifecycle);if(!r)continue;const c=n.get(o);c?c.push(r):n.set(o,[r])}return n}const q=Object.freeze({});function B(e,t=[],s=q){const n=e.join(`
2
2
  `),a=t.join(`
3
3
  `),i=A(f.useCallback(u=>u.statusCwds,[])),o=A(f.useCallback(u=>u.statuses,[])),{data:r}=K(),c=r==null?void 0:r.agentActivity;return f.useMemo(()=>{const u=n.length===0?[]:n.split(`
4
4
  `),N=new Set(a.length===0?[]:a.split(`
5
- `)),b=x(i,o,new Set(u)),k=Date.now(),y={};for(const l of u){const g=c==null?void 0:c[l];y[l]=P({liveKinds:b.get(l)??[],lastActivityAt:g?new Date(g).getTime():null,lastInteractionAt:s[l]??null,now:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function W(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function Y(){const e=p(),t=O();return v({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=O();return v({mutationFn:s=>e.updateMeshAccessRule({sourceNamespace:M,targetNamespace:M,action:s?"allow":"deny"}),onMutate:async s=>{await t.cancelQueries({queryKey:h});const n=t.getQueriesData({queryKey:h});return t.setQueriesData({queryKey:h},a=>a&&{...a,openMesh:s}),{previous:n}},onError:(s,n,a)=>{for(const[i,o]of(a==null?void 0:a.previous)??[])t.setQueryData(i,o)},onSettled:()=>{t.invalidateQueries({queryKey:h})}})}const C="Let all my agents talk to each other",L="On: any agent can message any other. Off: same project, plus pairs below.",Q="New agents reach only their own project. Change it later in Team → Access.";function D({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:n})}function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:Q,checked:e,onCheckedChange:t,disabled:s,className:R("bg-muted/40 rounded-xl px-4 py-3",n)})}function z(){const{data:e}=w(),{mutate:t,isPending:s}=E();return d.jsx(D,{checked:(e==null?void 0:e.openMesh)??!1,onCheckedChange:t,disabled:s})}function G({className:e}){const{data:t}=w(),{data:s}=j(),{mutate:n,isPending:a}=E(),i=((s==null?void 0:s.agents)??[]).filter(o=>!o.isSystem).length;return(t==null?void 0:t.openMesh)!==!1||i===0?null:d.jsx(H,{checked:!1,onCheckedChange:n,disabled:a,className:e})}export{z as O,Y as a,W as b,G as c,F as u};
5
+ `)),b=x(i,o,new Set(u)),k=Date.now(),y={};for(const l of u){const g=c==null?void 0:c[l];y[l]=P({liveKinds:b.get(l)??[],lastActivityAt:g?new Date(g).getTime():null,lastInteractionAt:s[l]??null,now:k,hasBrokenExecutionConfig:N.has(l)})}return y},[n,a,i,o,c,s])}function W(e){const t=p();return _({queryKey:["mesh","agent-health",e],queryFn:()=>t.getMeshAgentHealth(e),enabled:e!==null})}const h=["mesh","topology"];function Y(){const e=p(),t=O();return v({mutationFn:s=>e.updateMeshAccessRule(s),onSuccess:()=>{t.invalidateQueries({queryKey:h})}})}function E(){const e=p(),t=O();return v({mutationFn:s=>e.updateMeshAccessRule({sourceNamespace:M,targetNamespace:M,action:s?"allow":"deny"}),onMutate:async s=>{await t.cancelQueries({queryKey:h});const n=t.getQueriesData({queryKey:h});return t.setQueriesData({queryKey:h},a=>a&&{...a,openMesh:s}),{previous:n}},onError:(s,n,a)=>{for(const[i,o]of(a==null?void 0:a.previous)??[])t.setQueryData(i,o)},onSettled:()=>{t.invalidateQueries({queryKey:h})}})}const C="Let all my agents talk to each other",D="On: any agent can message any other. Off: same project, plus pairs below.",L="New agents reach only their own project. Change it later in Team → Access.";function Q({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:D,checked:e,onCheckedChange:t,disabled:s,className:n})}function H({checked:e,onCheckedChange:t,disabled:s,className:n}){return d.jsx(S,{label:C,description:L,checked:e,onCheckedChange:t,disabled:s,className:j("bg-muted/40 rounded-xl px-4 py-3",n)})}function z(){const{data:e}=w(),{mutate:t,isPending:s}=E();return d.jsx(Q,{checked:(e==null?void 0:e.openMesh)??!1,onCheckedChange:t,disabled:s})}function G({className:e}){const{data:t}=w(),{data:s}=R(),{mutate:n,isPending:a}=E(),i=((s==null?void 0:s.agents)??[]).filter(o=>!o.isSystem).length;return(t==null?void 0:t.openMesh)!==!1||i===0?null:d.jsx(H,{checked:!1,onCheckedChange:n,disabled:a,className:e})}export{z as O,Y as a,W as b,G as c,B as u};
@@ -1 +1 @@
1
- import{bp as j,fk as F,fl as H,b0 as x,r as g,ca as P,fm as w,fn as B,a8 as D,a9 as G,b$ as q,bW as K,fo as M,L as Y,bq as W,j as i,e1 as N,I as A,B as R}from"./index-CdKpQ1hI.js";import{d as z,c as Q,n as U,h as V}from"./profile-errors-CqflLCzu.js";import{u as $}from"./use-mounted-ref-BWpQ8f91.js";import{u as L,F as I}from"./ProfileFields-BCfMzNcT.js";function J(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function le(e){const r=J(e);return r.name||r.handle}function X(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...F,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return H(a,o)??""}function ie(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);g.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const Z="agent-hub",ee={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function te(e){return(typeof e=="string"?ee[e]:null)??void 0}const k=new Set(["identity","personality","channels","tools"]);function ce(){var n;const e=w(),r=D(),a=G({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=q(h=>h.openProfileDockedFromLink),t=x(h=>h.requestRightPanel),s=x(h=>h.setExplicitAgentPath),d=K(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=M(e.profilePage)??void 0,m=g.useRef(null);g.useEffect(()=>{!l&&c&&m.current!==c&&(m.current=c,s(c))},[l,c,s]);const f=g.useRef(new Map);g.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const h=c??d;if(h){const p=f.current.get(h);if(p!==void 0&&(u===void 0||p.has(u)))return;f.current.set(h,(p??new Set).add(u??"")),o(h,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function de(){const e=w(),r=B(),a=D(),o=e.panel===Z,t=e.dialog==="agent"||!!e.agent&&k.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;g.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const m=te(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&k.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,m?n.profilePage=m:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function ae(){var b,S;const r=((b=Y().data)==null?void 0:b.members)??[],a=r.find(y=>y.isSelf),o=$(),t=z({isShownInline:()=>o.current}),s=Q({isShownInline:()=>o.current}),[d,l]=g.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[m,f]=L(c),[n,h]=L(a?u||X(a,r):""),p=m.trim(),v=n.trim(),E=a?W(a):null,T=p.length>0&&(p!==c||E!==null),C=t.isError&&t.variables===p?U(t.error):null,O=s.isError&&((S=s.variables)==null?void 0:S.handle)===v?V(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return T&&(y=await t.mutateAsync(p).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:m,setName:f,handle:n,setHandle:h,canSave:a!==void 0&&!d&&(p.length>0||v.length>0),saving:d,nameError:C,nameSuggestion:E!==null&&p===c?E:null,handleError:O,save:_}}function ue({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=ae(),s=g.useId(),d=g.useId(),l=g.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let m=r;return t.saving?m="Saving…":u&&(m="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(A,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(I,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(A,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(I,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(R,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:m}),a&&i.jsx(R,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{ue as O,ce as a,ie as b,le as i,de as u};
1
+ import{bp as j,fm as F,fn as H,b0 as x,r as g,ca as P,fo as w,fp as B,a8 as D,a9 as q,b$ as G,bW as K,fq as M,L as Y,bq as W,j as i,e3 as N,I as A,B as R}from"./index-DxTOTFWT.js";import{d as z,c as Q,n as U,h as V}from"./profile-errors-DyrpY2ry.js";import{u as $}from"./use-mounted-ref-Bs5osknq.js";import{u as L,F as I}from"./ProfileFields-8fFud5gT.js";function J(e){return{name:e.displayName.trim()===""||e.displayName===j,handle:!e.handle}}function le(e){const r=J(e);return r.name||r.handle}function X(e,r){var t,s,d;const a=(d=(s=(t=e.person)==null?void 0:t.email)==null?void 0:s.split("@")[0])==null?void 0:d.trim();if(!a)return"";const o=new Set([...F,...r.filter(l=>l.id!==e.id&&l.handle).map(l=>l.handle.toLowerCase())]);return H(a,o)??""}function ie(){const e=x(a=>a.setRightPanelOpen),r=x(a=>a.setActiveRightPanelTab);g.useEffect(()=>{const a=o=>{if((o.metaKey||o.ctrlKey)&&o.shiftKey&&o.key==="A"){o.preventDefault();const{rightPanelOpen:t,activeRightPanelTab:s}=x.getState();t&&s===P?e(!1):(r(P),e(!0))}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,r])}const Z="agent-hub",ee={sessions:"sessions",tasks:"tasks",tools:"tools",channels:"rooms",config:null,toolkit:null,identity:null,overview:null,profile:null,personality:null};function te(e){return(typeof e=="string"?ee[e]:null)??void 0}const k=new Set(["identity","personality","channels","tools"]);function ce(){var n;const e=w(),r=D(),a=q({queryKey:["profile-location",e.profileRef],queryFn:()=>r.getSessionLocation(e.profileRef),enabled:!!e.profileRef}),o=G(h=>h.openProfileDockedFromLink),t=x(h=>h.requestRightPanel),s=x(h=>h.setExplicitAgentPath),d=K(),l=e.panel===P,c=e.agentPath??((n=a.data)==null?void 0:n.cwd)??null,u=M(e.profilePage)??void 0,m=g.useRef(null);g.useEffect(()=>{!l&&c&&m.current!==c&&(m.current=c,s(c))},[l,c,s]);const f=g.useRef(new Map);g.useEffect(()=>{if(!l){f.current.clear();return}if(e.profileRef&&!c)return;const h=c??d;if(h){const p=f.current.get(h);if(p!==void 0&&(u===void 0||p.has(u)))return;f.current.set(h,(p??new Set).add(u??"")),o(h,u);return}t(P,null)},[l,e.profileRef,c,d,u,o,t])}function de(){const e=w(),r=B(),a=D(),o=e.panel===Z,t=e.dialog==="agent"||!!e.agent&&k.has(e.agent),s=o||t,d=o?e.hubTab:e.agent;g.useEffect(()=>{if(!s&&!e.agentPath||!r)return;let l=!1;return(async()=>{const u=e.profileRef??(e.agentPath?(await a.createSessionLocation(e.agentPath)).id:void 0);if(l)return;const m=te(d);r({search:f=>{const n={...f};return e.dialog==="agent"&&delete n.dialog,typeof n.agent=="string"&&k.has(n.agent)&&delete n.agent,u&&(n.profileRef=u,delete n.agentPath),s&&(delete n.hubTab,n.panel=P,m?n.profilePage=m:delete n.profilePage),n},replace:!0})})().catch(()=>{}),()=>{l=!0}},[s,e.dialog,e.agentPath,e.profileRef,d,r,a])}function ae(){var b,S;const r=((b=Y().data)==null?void 0:b.members)??[],a=r.find(y=>y.isSelf),o=$(),t=z({isShownInline:()=>o.current}),s=Q({isShownInline:()=>o.current}),[d,l]=g.useState(!1),c=!a||a.displayName===j?"":a.displayName,u=(a==null?void 0:a.handle)??"",[m,f]=L(c),[n,h]=L(a?u||X(a,r):""),p=m.trim(),v=n.trim(),E=a?W(a):null,T=p.length>0&&(p!==c||E!==null),C=t.isError&&t.variables===p?U(t.error):null,O=s.isError&&((S=s.variables)==null?void 0:S.handle)===v?V(s.error,v):null,_=async()=>{if(!a)return!1;l(!0);let y=!0;return T&&(y=await t.mutateAsync(p).then(()=>y,()=>!1)),v&&v!==u&&(y=await s.mutateAsync({authorId:a.id,handle:v}).then(()=>y,()=>!1)),l(!1),y};return{ready:a!==void 0,name:m,setName:f,handle:n,setHandle:h,canSave:a!==void 0&&!d&&(p.length>0||v.length>0),saving:d,nameError:C,nameSuggestion:E!==null&&p===c?E:null,handleError:O,save:_}}function ue({onSaved:e,confirmLabel:r="Save",onSkip:a,skipLabel:o="Skip"}){const t=ae(),s=g.useId(),d=g.useId(),l=g.useId(),c=f=>{f.preventDefault(),t.canSave&&t.save().then(n=>{n&&e()})},u=t.nameError!==null||t.handleError!==null;let m=r;return t.saving?m="Saving…":u&&(m="Try again"),i.jsxs("form",{onSubmit:c,className:"flex flex-col gap-3","data-testid":"operator-identity-form",children:[i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:s,className:"text-xs",children:"Your name"}),i.jsx(A,{id:s,value:t.name,maxLength:80,autoComplete:"name",placeholder:"What you go by",disabled:!t.ready,onChange:f=>t.setName(f.target.value),className:"h-8 text-sm"}),t.nameSuggestion&&!t.nameError&&i.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.nameSuggestion,". Save it to make it yours."]}),t.nameError&&i.jsx(I,{tone:"error",children:t.nameError})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsx(N,{htmlFor:d,className:"text-xs",children:"Handle"}),i.jsxs("div",{className:"relative",children:[i.jsx("span",{"aria-hidden":!0,className:"text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 -translate-y-1/2 text-sm",children:"@"}),i.jsx(A,{id:d,value:t.handle,maxLength:64,autoComplete:"username",autoCapitalize:"none",spellCheck:!1,placeholder:"yourname","aria-describedby":l,disabled:!t.ready,onChange:f=>t.setHandle(f.target.value),className:"h-8 pl-6 text-sm"})]}),i.jsx("p",{id:l,className:"text-muted-foreground text-xs",children:"What others type after @ to reach you."}),t.handleError&&i.jsx(I,{tone:"error",children:t.handleError})]}),i.jsxs("div",{className:"flex flex-wrap gap-2",children:[i.jsx(R,{type:"submit",size:"sm",disabled:!t.canSave,"data-testid":"confirm-identity",children:m}),a&&i.jsx(R,{type:"button",size:"sm",variant:"ghost",onClick:a,disabled:t.saving,"data-testid":"skip-identity",children:o})]})]})}export{ue as O,ce as a,ie as b,le as i,de as u};
@@ -1 +1 @@
1
- import{j as s,eL as A,eM as P,Q as k,gf as Y,a8 as E,a9 as q,g6 as R,r as N,aa as Z,ab as ee,aA as se,ae as te,bg as ne,B as x,h5 as v,bG as L,bH as U,C as W,bI as D,bK as H,$ as ae,g7 as f,h6 as w,gv as K,gw as _,e as C,be as ie,h7 as le}from"./index-CdKpQ1hI.js";import{u as y,c as re,a as p,l as B,S as g,P as b,s as z,d as T,f as $,b as M,e as S,g as oe,A as de}from"./ApplyToOverridesDialog-jqOFh0d1.js";const I=[{value:"blocked",label:"Blocked"},{value:"ask",label:"Ask"},{value:"allowed",label:"Allowed"}];function Q({value:e,onChange:t,floor:n=!1,disabled:a=!1,className:l,"aria-label":o}){const d=n?I.filter(i=>i.value!=="allowed"):I;return s.jsx(A,{"aria-label":o,value:e??"",onValueChange:i=>t(i),disabled:a,className:k("w-full md:w-auto",l),children:d.map(i=>s.jsx(P,{value:i.value,className:k(Y,"md:min-h-0 md:min-w-16"),children:i.label},i.value))})}function ce(e){const t=E();return q({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function ue(e){const{data:t}=y();return N.useMemo(()=>{const n=new Map;for(const a of(t==null?void 0:t.exceptions)??[]){if(a.area!==e)continue;const l=n.get(a.agentId);(!l||l.action&&!a.action)&&n.set(a.agentId,a)}return[...n.values()]},[t,e])}function me(e){const t=E();return q({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function he(e){var n;const t=e;return(t==null?void 0:t.code)!=="UNDO_CONFLICT"?null:((n=t.body)==null?void 0:n.conflicts)??[]}function xe(){const e=E(),t=Z();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?re(t,e):void 0}function j(e){te.error(e instanceof Error&&e.message?e.message:"Couldn’t save that change. Try again.")}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(ne,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=B(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",g[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function fe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(L,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(W,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(H,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=g[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function pe({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function X({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",g[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ae,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(pe,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function je({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${f(o)}`:`Same as everyone (${f(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${f(d)}`:"not set"} for ${t}?`,sentence:M(d,n.source),...n.lastChange?{lastChange:n.lastChange}:{}})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:d??"",disabled:a.isPending,onValueChange:r=>{r&&r!==d&&i(r)},children:w.map(r=>s.jsxs(P,{value:r.id,"aria-label":r.label,children:[s.jsx(K,{descriptor:r,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:r.label})]},r.id))}),l?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:()=>i(null),disabled:a.isPending,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null]})]}),s.jsx(_,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function Ee({files:e,preset:t,onChange:n,disabled:a=!1,runtimeLabel:l=o=>o}){const o=F({kind:"files"}),d=e.stop===null?$("runtime-own"):e.stop===e.presetStop?`From ${S[t??"trusted"]}`:"Changed from your preset";return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:[d,o!==void 0?T(o):""].filter(Boolean).join(" · ")})," ","·"," ",s.jsx(b,{question:`Why is Files & commands ${e.stop?`set to ${f(e.stop)}`:"not set"}?`,sentence:M(e.stop,e.stop===null?"runtime-own":"default"),...e.lastChange?{lastChange:e.lastChange}:{}})]}),e.runtimes.map(i=>s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l(i.runtime)," starts at ",f(i.stop)," (Settings → Runtimes)"]},i.runtime))]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:e.stop??"",disabled:a,onValueChange:i=>{i&&i!==e.stop&&n(i)},children:w.map(i=>s.jsxs(P,{value:i.id,"aria-label":i.label,children:[s.jsx(K,{descriptor:i,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:i.label})]},i.id))}),s.jsx(ve,{agents:e.exceptions})]})]}),s.jsx(_,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function Ne({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=B(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",f(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function ve({agents:e}){return e.length===0?null:s.jsxs(L,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(W,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(H,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(Ne,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function be({area:e,overview:t}){const n=p({kind:"default"}),a=ue(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[oe(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${g[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(fe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(de,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${g[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function we({agentId:e,agentName:t,area:n}){var r;const a=((r=y().data)==null?void 0:r.preset)??null,l=p({kind:"agent",agentId:e}),o=n.resolved.source==="agent-area"||n.resolved.source==="agent-action",d=o?`Everyone else: ${g[n.inherited.state]}`:`Same as everyone (${g[n.inherited.state]})`,i=n.changedOutsideAt?`Changed outside DorkOS · ${d}`:d,m=u=>l.mutate({kind:"patch",areas:{[n.id]:u},surface:"agent-page"},{onError:j});return s.jsx(V,{areaId:n.id,label:n.label,description:n.description,floor:n.floor,value:n.resolved.state,sourceText:i,why:s.jsx(b,{question:`Why is ${n.label} set to ${g[n.resolved.state]} for ${t}?`,sentence:z({...n.resolved,preset:a}),...n.lastChange?{lastChange:n.lastChange}:{}}),changed:o,onChange:u=>{u!==n.resolved.state&&m(u)},onReset:()=>m(null),disabled:l.isPending,details:s.jsx(X,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function Re({scope:e}){const t=y(),n=ce(e.kind==="agent"?e.agentId:void 0);return e.kind==="default"?t.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."}):t.data?s.jsx("div",{className:"divide-border divide-y","data-testid":"permission-list-default",children:O(t.data.areas).map(a=>s.jsx(be,{area:a,overview:t.data},a.id))}):s.jsx(C,{className:"h-20 w-full"}):n.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s permissions."}):n.data?s.jsxs("div",{className:"divide-border divide-y","data-testid":"permission-list-agent",children:[s.jsx(je,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(we,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ye(e,t){if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return ke(e)?f(e):e;case"preset":return e in S?S[e]:e;default:return e in g?g[e]:e}}function ke(e){return le.includes(e)}function Ce(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ye(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function $e(e){if(e.suggestionRestored)return null;if(e.changes.length===0&&e.skipped.length===0)return"Nothing to undo. It was already back.";if(e.skipped.length===0)return null;const t=e.changes.length,n=`Undid ${t} ${t===1?"change":"changes"}.`,a=e.skipped.filter(i=>i.reason==="changed-since").length,l=e.skipped.filter(i=>i.reason==="floor").length,o=e.skipped.filter(i=>i.reason==="gone").length,d=[];if(a>0&&d.push(`${a} had changed since and ${a===1?"was":"were"} left alone.`),l>0&&d.push(`${l} can’t be set to Allowed and ${l===1?"was":"were"} left alone.`),o>0&&d.push(`${o} ${o===1?"was about an agent":"were about agents"} no longer here.`),d.length>1){const i=e.skipped.length;return`${n} ${i} ${i===1?"was":"were"} left alone.`}return[n,...d].join(" ")}function Se({item:e}){const t=xe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ie(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o($e(c))},onError:c=>{const h=he(c);h?a(h):j(c)}});return s.jsxs("li",{className:"space-y-1","data-testid":"permission-history-row",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0 space-y-0.5",children:[s.jsx("p",{className:"text-sm",children:e.summary}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.actorLabel," · ",m]}),e.actorDetail?s.jsx("p",{className:"text-muted-foreground text-xs",children:e.actorDetail}):null]}),d?s.jsx("span",{className:"text-muted-foreground shrink-0 pt-0.5 text-xs",children:"Undone"}):i&&n===null?s.jsx(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:t.isPending,"aria-label":`Undo: ${e.summary}, ${m}`,onClick:()=>r(!1),children:"Undo"}):null]}),n!==null?s.jsxs("div",{role:"group","aria-label":"Undo conflict",className:"bg-muted/50 flex flex-col gap-2 rounded-md p-2 @md:flex-row @md:items-center @md:justify-between",children:[s.jsx("p",{className:"text-sm",children:Ce(n)}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(x,{variant:"outline",size:"sm",disabled:t.isPending,onClick:()=>a(null),children:"Cancel"}),s.jsx(x,{size:"sm",disabled:t.isPending,onClick:()=>r(!0),children:"Set it back"})]})]}):null,l?s.jsx("p",{className:"text-muted-foreground text-xs",role:"status",children:l}):null]})}function ze({agentId:e}){const{data:t,isPending:n,isError:a}=me(e);if(a)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the history."});if(n)return s.jsx(C,{className:"h-12 w-full"});const l=(t==null?void 0:t.items)??[];return l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No permission changes yet."}):s.jsx("ul",{className:"@container space-y-3","aria-label":"Permission history",children:l.map(o=>s.jsx(Se,{item:o},o.id))})}export{Ee as D,Re as P,ze as a};
1
+ import{j as s,eN as A,eO as P,Q as k,gh as Y,a8 as E,a9 as q,g8 as R,r as N,aa as Z,ab as ee,aA as se,ae as te,bg as ne,B as x,ha as v,bG as L,bH as U,C as W,bI as D,bK as H,$ as ae,g9 as f,hb as w,gx as K,gy as _,e as C,be as ie,hc as le}from"./index-DxTOTFWT.js";import{u as y,c as re,a as p,l as B,S as g,P as b,s as z,d as T,f as $,b as M,e as S,g as oe,A as de}from"./ApplyToOverridesDialog-CsmbPbTh.js";const I=[{value:"blocked",label:"Blocked"},{value:"ask",label:"Ask"},{value:"allowed",label:"Allowed"}];function Q({value:e,onChange:t,floor:n=!1,disabled:a=!1,className:l,"aria-label":o}){const d=n?I.filter(i=>i.value!=="allowed"):I;return s.jsx(A,{"aria-label":o,value:e??"",onValueChange:i=>t(i),disabled:a,className:k("w-full md:w-auto",l),children:d.map(i=>s.jsx(P,{value:i.value,className:k(Y,"md:min-h-0 md:min-w-16"),children:i.label},i.value))})}function ce(e){const t=E();return q({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function ue(e){const{data:t}=y();return N.useMemo(()=>{const n=new Map;for(const a of(t==null?void 0:t.exceptions)??[]){if(a.area!==e)continue;const l=n.get(a.agentId);(!l||l.action&&!a.action)&&n.set(a.agentId,a)}return[...n.values()]},[t,e])}function me(e){const t=E();return q({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function he(e){var n;const t=e;return(t==null?void 0:t.code)!=="UNDO_CONFLICT"?null:((n=t.body)==null?void 0:n.conflicts)??[]}function xe(){const e=E(),t=Z();return ee({mutationFn:({eventId:n,force:a})=>e.undoPermissionChange(n,a?{force:!0}:{}),meta:{suppressErrorToast:!0},onSettled:()=>{t.invalidateQueries({queryKey:R.all}),t.invalidateQueries({queryKey:["mesh","agents"]}),t.invalidateQueries({queryKey:se.all})}})}function F(e){const{data:t}=y();return t?re(t,e):void 0}function j(e){te.error(e instanceof Error&&e.message?e.message:"Couldn’t save that change. Try again.")}function V({areaId:e,label:t,description:n,floor:a,value:l,sourceText:o,why:d,changed:i=!1,onChange:m,onReset:r,disabled:u=!1,footer:c,details:h}){return s.jsxs("div",{className:"@container","data-testid":`permission-row-${e}`,children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[i?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:t}),a?s.jsx(ne,{className:"text-muted-foreground size-3.5","aria-label":"Never Allowed"}):null]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:n}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:o}),d?s.jsxs(s.Fragment,{children:[o?" · ":null,d]}):null]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(Q,{value:l,onChange:m,floor:a,disabled:u,"aria-label":t}),i&&r?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:r,disabled:u,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null,c]})]}),h]})}function ge({area:e,exception:t}){const n=p({kind:"agent",agentId:t.agentId}),a=()=>n.mutate({kind:"patch",...t.action?{actions:{[t.action]:null}}:{areas:{[e]:null}},surface:"settings"}),l=B(t.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[t.agentName,": ",g[t.state],t.action?" (one action)":""]}),l?s.jsx("span",{className:"text-muted-foreground block text-xs",children:l}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",onClick:a,disabled:n.isPending,"aria-label":`Reset ${t.agentName} to the default`,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function fe({area:e,areaLabel:t,agents:n}){if(n.length===0)return null;const a=n.length===1?"1 agent differs":`${n.length} agents differ`;return s.jsxs(L,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start md:self-end",children:[a,s.jsx(W,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsxs(H,{className:"text-sm font-medium",children:["Set differently for ",t]}),s.jsx("ul",{className:"space-y-1",children:n.map(l=>s.jsx(ge,{area:e,exception:l},l.agentId))})]})]})}function G(e,t){return e.resolved.source===(t.kind==="agent"?"agent-action":"default-action")}function J({action:e,preset:t,agentName:n}){const a=g[e.resolved.state];return s.jsx(b,{question:`Why is ${e.title} set to ${a}${n?` for ${n}`:""}?`,sentence:z({...e.resolved,preset:t,fromExtension:e.source!==void 0}),...e.lastChange?{lastChange:e.lastChange}:{}})}function pe({action:e,area:t,scope:n,preset:a,agentName:l,disabled:o,reset:d,onSave:i}){const m=G(e,n),r=F({kind:"action",action:e.id,area:t.id}),u=m?"Set on its own":e.alwaysAsks?e.source?"Always asks: an extension tool that can delete things":"Always asks, so you see the change first":e.resolved.destructiveAsk?"Always asks unless you set it here":`Follows ${t.label}`,c=n.kind==="default"&&r!==void 0?T(r):null;return s.jsxs("li",{className:"flex flex-col gap-2 py-2 @md:flex-row @md:items-center @md:justify-between","data-testid":`permission-action-${e.id}`,children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("p",{className:"text-sm",children:e.title}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.source?s.jsxs("span",{children:["From ",e.source.name," · "]}):null,s.jsx("span",{children:u}),c?s.jsxs("span",{children:[" · ",c]}):null," ·"," ",s.jsx(J,{action:e,preset:a,...l?{agentName:l}:{}})]})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[m?d:null,s.jsx(Q,{value:e.resolved.state,floor:t.floor||e.alwaysAsks===!0,disabled:o,"aria-label":e.title,onChange:h=>{h!==e.resolved.state&&i(h)}})]})]})}function X({scope:e,area:t,surface:n,preset:a,agentName:l}){const o=p(e),[d,i]=N.useState(!1);if(t.actions.length===0)return null;const m=t.actions.filter(c=>G(c,e)),r=(c,h)=>o.mutate({kind:"patch",actions:{[c.id]:h},surface:n},{onError:j}),u=c=>s.jsxs(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:o.isPending,"aria-label":`Put ${c.title} back to ${t.label}`,onClick:()=>r(c,null),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]});return s.jsxs("div",{className:"flex flex-col items-start gap-1 pb-3","data-testid":`permission-actions-${t.id}`,children:[!d&&m.length>0?s.jsx("ul",{className:"w-full space-y-1","data-testid":`permission-action-exceptions-${t.id}`,children:m.map(c=>s.jsxs("li",{className:"flex items-center gap-2 text-xs",children:[s.jsxs("span",{className:"text-muted-foreground min-w-0",children:[s.jsxs("span",{children:["Except ",c.title,": ",g[c.resolved.state]]})," ","·"," ",s.jsx(J,{action:c,preset:a,...l?{agentName:l}:{}})]}),u(c)]},c.id))}):null,s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground -ml-2 h-7 px-2 text-xs","aria-expanded":d,onClick:()=>i(c=>!c),children:[s.jsx(ae,{className:k("size-3.5 transition-transform",d&&"rotate-180"),"aria-hidden":!0}),d?"Hide individual actions":"Show individual actions"]}),d?s.jsx("ul",{className:"divide-border w-full divide-y","aria-label":`${t.label} actions`,children:t.actions.map(c=>s.jsx(pe,{action:c,area:t,scope:e,preset:a,...l?{agentName:l}:{},disabled:o.isPending,reset:u(c),onSave:h=>r(c,h)},c.id))}):null]})}function je({agentId:e,agentName:t,files:n}){const a=p({kind:"agent",agentId:e}),l=n.source==="agent",o=n.inherited.stop,d=n.stop,i=r=>a.mutate({kind:"patch",filesAndCommands:r,surface:"agent-page"},{onError:j}),m=o?`${l?`Everyone else: ${f(o)}`:`Same as everyone (${f(o)})`}${n.inherited.source==="runtime"?` · ${$("runtime")}`:""}`:$(n.inherited.source);return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-1.5",children:[l?s.jsx("span",{className:"bg-primary size-1.5 shrink-0 rounded-full","aria-label":"Set differently for this agent",role:"img"}):null,s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"})]}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands in this agent’s chats"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:m})," ·"," ",s.jsx(b,{question:`Why is Files & commands ${d?`set to ${f(d)}`:"not set"} for ${t}?`,sentence:M(d,n.source),...n.lastChange?{lastChange:n.lastChange}:{}})]})]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:d??"",disabled:a.isPending,onValueChange:r=>{r&&r!==d&&i(r)},children:w.map(r=>s.jsxs(P,{value:r.id,"aria-label":r.label,children:[s.jsx(K,{descriptor:r,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:r.label})]},r.id))}),l?s.jsxs(x,{variant:"ghost",size:"sm",className:"self-start @lg:self-end",onClick:()=>i(null),disabled:a.isPending,children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset to default"]}):null]})]}),s.jsx(_,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function Ee({files:e,preset:t,onChange:n,disabled:a=!1,runtimeLabel:l=o=>o}){const o=F({kind:"files"}),d=e.stop===null?$("runtime-own"):e.stop===e.presetStop?`From ${S[t??"trusted"]}`:"Changed from your preset";return s.jsxs("div",{className:"@container","data-testid":"permission-row-files",children:[s.jsxs("div",{className:"flex flex-col gap-3 py-3 @lg:flex-row @lg:items-start @lg:justify-between @lg:gap-6",children:[s.jsxs("div",{className:"min-w-0 space-y-1",children:[s.jsx("span",{className:"text-sm font-medium",children:"Files & commands"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"Editing files and running commands"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[s.jsx("span",{children:[d,o!==void 0?T(o):""].filter(Boolean).join(" · ")})," ","·"," ",s.jsx(b,{question:`Why is Files & commands ${e.stop?`set to ${f(e.stop)}`:"not set"}?`,sentence:M(e.stop,e.stop===null?"runtime-own":"default"),...e.lastChange?{lastChange:e.lastChange}:{}})]}),e.runtimes.map(i=>s.jsxs("p",{className:"text-muted-foreground text-xs",children:[l(i.runtime)," starts at ",f(i.stop)," (Settings → Runtimes)"]},i.runtime))]}),s.jsxs("div",{className:"flex shrink-0 flex-col gap-2 @lg:items-end",children:[s.jsx(A,{"aria-label":"Files & commands",className:"w-full @lg:w-auto",value:e.stop??"",disabled:a,onValueChange:i=>{i&&i!==e.stop&&n(i)},children:w.map(i=>s.jsxs(P,{value:i.id,"aria-label":i.label,children:[s.jsx(K,{descriptor:i,className:"size-(--size-icon-xs) shrink-0"}),s.jsx("span",{className:"truncate",children:i.label})]},i.id))}),s.jsx(ve,{agents:e.exceptions})]})]}),s.jsx(_,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function Ne({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=B(e.lastChange);return s.jsxs("li",{className:"flex items-center justify-between gap-3",children:[s.jsxs("span",{className:"min-w-0 text-sm",children:[s.jsxs("span",{className:"block break-words",children:[e.agentName,": ",f(e.stop)]}),n?s.jsx("span",{className:"text-muted-foreground block text-xs",children:n}):null]}),s.jsxs(x,{variant:"ghost",size:"sm",disabled:t.isPending,"aria-label":`Reset ${e.agentName} to the default`,onClick:()=>t.mutate({kind:"patch",filesAndCommands:null,surface:"settings"},{onError:j}),children:[s.jsx(v,{className:"size-3.5","aria-hidden":!0}),"Reset"]})]})}function ve({agents:e}){return e.length===0?null:s.jsxs(L,{children:[s.jsx(U,{asChild:!0,children:s.jsxs(x,{variant:"ghost",size:"sm",className:"text-muted-foreground self-start @lg:self-end",children:[e.length===1?"1 agent differs":`${e.length} agents differ`,s.jsx(W,{className:"size-3.5","aria-hidden":!0})]})}),s.jsxs(D,{className:"w-80 space-y-2",children:[s.jsx(H,{className:"text-sm font-medium",children:"Set differently for Files & commands"}),s.jsx("ul",{className:"space-y-1",children:e.map(t=>s.jsx(Ne,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function be({area:e,overview:t}){const n=p({kind:"default"}),a=ue(e.id),l=F({kind:"area",area:e.id})??0,[o,d]=N.useState(null),i=(r,u)=>{n.mutate({kind:"patch",areas:{[e.id]:r},...u&&u.length>0?{applyToAgents:u}:{},surface:"settings"},{onError:j,onSettled:()=>d(null)})},m=r=>{r!==e.resolved.state&&(a.length>0?d(r):i(r))};return s.jsxs(s.Fragment,{children:[s.jsx(V,{areaId:e.id,label:e.label,description:e.description,floor:e.floor,value:e.resolved.state,sourceText:[oe(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${g[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(fe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(de,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${g[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function we({agentId:e,agentName:t,area:n}){var r;const a=((r=y().data)==null?void 0:r.preset)??null,l=p({kind:"agent",agentId:e}),o=n.resolved.source==="agent-area"||n.resolved.source==="agent-action",d=o?`Everyone else: ${g[n.inherited.state]}`:`Same as everyone (${g[n.inherited.state]})`,i=n.changedOutsideAt?`Changed outside DorkOS · ${d}`:d,m=u=>l.mutate({kind:"patch",areas:{[n.id]:u},surface:"agent-page"},{onError:j});return s.jsx(V,{areaId:n.id,label:n.label,description:n.description,floor:n.floor,value:n.resolved.state,sourceText:i,why:s.jsx(b,{question:`Why is ${n.label} set to ${g[n.resolved.state]} for ${t}?`,sentence:z({...n.resolved,preset:a}),...n.lastChange?{lastChange:n.lastChange}:{}}),changed:o,onChange:u=>{u!==n.resolved.state&&m(u)},onReset:()=>m(null),disabled:l.isPending,details:s.jsx(X,{scope:{kind:"agent",agentId:e},area:n,surface:"agent-page",preset:a,agentName:t})})}function Re({scope:e}){const t=y(),n=ce(e.kind==="agent"?e.agentId:void 0);return e.kind==="default"?t.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."}):t.data?s.jsx("div",{className:"divide-border divide-y","data-testid":"permission-list-default",children:O(t.data.areas).map(a=>s.jsx(be,{area:a,overview:t.data},a.id))}):s.jsx(C,{className:"h-20 w-full"}):n.isError?s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this agent’s permissions."}):n.data?s.jsxs("div",{className:"divide-border divide-y","data-testid":"permission-list-agent",children:[s.jsx(je,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(we,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ye(e,t){if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return ke(e)?f(e):e;case"preset":return e in S?S[e]:e;default:return e in g?g[e]:e}}function ke(e){return le.includes(e)}function Ce(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ye(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function $e(e){if(e.suggestionRestored)return null;if(e.changes.length===0&&e.skipped.length===0)return"Nothing to undo. It was already back.";if(e.skipped.length===0)return null;const t=e.changes.length,n=`Undid ${t} ${t===1?"change":"changes"}.`,a=e.skipped.filter(i=>i.reason==="changed-since").length,l=e.skipped.filter(i=>i.reason==="floor").length,o=e.skipped.filter(i=>i.reason==="gone").length,d=[];if(a>0&&d.push(`${a} had changed since and ${a===1?"was":"were"} left alone.`),l>0&&d.push(`${l} can’t be set to Allowed and ${l===1?"was":"were"} left alone.`),o>0&&d.push(`${o} ${o===1?"was about an agent":"were about agents"} no longer here.`),d.length>1){const i=e.skipped.length;return`${n} ${i} ${i===1?"was":"were"} left alone.`}return[n,...d].join(" ")}function Se({item:e}){const t=xe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ie(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o($e(c))},onError:c=>{const h=he(c);h?a(h):j(c)}});return s.jsxs("li",{className:"space-y-1","data-testid":"permission-history-row",children:[s.jsxs("div",{className:"flex items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0 space-y-0.5",children:[s.jsx("p",{className:"text-sm",children:e.summary}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[e.actorLabel," · ",m]}),e.actorDetail?s.jsx("p",{className:"text-muted-foreground text-xs",children:e.actorDetail}):null]}),d?s.jsx("span",{className:"text-muted-foreground shrink-0 pt-0.5 text-xs",children:"Undone"}):i&&n===null?s.jsx(x,{variant:"ghost",size:"sm",className:"h-7 shrink-0 px-2 text-xs",disabled:t.isPending,"aria-label":`Undo: ${e.summary}, ${m}`,onClick:()=>r(!1),children:"Undo"}):null]}),n!==null?s.jsxs("div",{role:"group","aria-label":"Undo conflict",className:"bg-muted/50 flex flex-col gap-2 rounded-md p-2 @md:flex-row @md:items-center @md:justify-between",children:[s.jsx("p",{className:"text-sm",children:Ce(n)}),s.jsxs("div",{className:"flex shrink-0 gap-2",children:[s.jsx(x,{variant:"outline",size:"sm",disabled:t.isPending,onClick:()=>a(null),children:"Cancel"}),s.jsx(x,{size:"sm",disabled:t.isPending,onClick:()=>r(!0),children:"Set it back"})]})]}):null,l?s.jsx("p",{className:"text-muted-foreground text-xs",role:"status",children:l}):null]})}function ze({agentId:e}){const{data:t,isPending:n,isError:a}=me(e);if(a)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the history."});if(n)return s.jsx(C,{className:"h-12 w-full"});const l=(t==null?void 0:t.items)??[];return l.length===0?s.jsx("p",{className:"text-muted-foreground text-sm",children:"No permission changes yet."}):s.jsx("ul",{className:"@container space-y-3","aria-label":"Permission history",children:l.map(o=>s.jsx(Se,{item:o},o.id))})}export{Ee as D,Re as P,ze as a};
@@ -1 +1 @@
1
- import{y as n,j as s}from"./index-CdKpQ1hI.js";import{P as r,a}from"./PermissionHistory-DrtlA4YM.js";import"./ApplyToOverridesDialog-jqOFh0d1.js";function d({member:t}){var o;const e=n((o=t.agent)==null?void 0:o.runtime),i=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[i?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(r,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(a,{agentId:t.id})]})]})}export{d as PermissionsPage};
1
+ import{y as n,j as s}from"./index-DxTOTFWT.js";import{P as r,a}from"./PermissionHistory-C9vTiyw5.js";import"./ApplyToOverridesDialog-CsmbPbTh.js";function d({member:t}){var o;const e=n((o=t.agent)==null?void 0:o.runtime),i=(e==null?void 0:e.supportsMcp)??!0;return s.jsxs("div",{className:"space-y-6",children:[i?null:s.jsx("p",{className:"text-muted-foreground text-sm",children:"This agent can’t use DorkOS tools, so these don’t apply."}),s.jsx(r,{scope:{kind:"agent",agentId:t.id}}),s.jsxs("section",{className:"space-y-2",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"History"}),s.jsx(a,{agentId:t.id})]})]})}export{d as PermissionsPage};
@@ -1 +1 @@
1
- import{b as n,j as t,e as i}from"./index-CdKpQ1hI.js";import{u as m,P as p}from"./use-personality-commit-DUEKxHt_.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-Cag2i87x.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};
1
+ import{b as n,j as t,e as i}from"./index-DxTOTFWT.js";import{u as m,P as p}from"./use-personality-commit-D8Fqsrzc.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./sound-D3r8dGFH.js";import"./soul-file-C5-nKCwV.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-DxTOTFWT.js";import{b as t}from"./ProfileFields-8fFud5gT.js";import"./profile-errors-DyrpY2ry.js";import"./use-mounted-ref-Bs5osknq.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
@@ -1,4 +1,4 @@
1
- import{a2 as ge,r as b,j as o,I as Ie,Q as k,ay as he,$ as je,hU as Ne,hV as we,hW as Te,B as D,e3 as Pe,hX as Ae,a8 as v,dz as ve,bY as _e,hb as $e,dU as Oe,af as P,hY as Re,dR as Me,hZ as Le,hc as Be,dC as De,a9 as U,h_ as Ue,h$ as Ke,aa as qe,aw as Fe,eL as le,i0 as xe,eM as ue,e as We,gw as Ye,h6 as ze,ae as Ge}from"./index-CdKpQ1hI.js";import{u as He}from"./use-update-config-xkznZMHr.js";import{u as Qe}from"./use-promo-dismissals-bkSHhGhj.js";import{a as Ve,d as Je,k as Xe}from"./execution-config-BbBEe6FO.js";import{s as Ze}from"./settings-for-runtime-BoOa-ZFG.js";import{u as et,a as tt,e as C,c as nt,h as st,P as rt,A as at,d as ot}from"./ApplyToOverridesDialog-jqOFh0d1.js";/**
1
+ import{a2 as ge,r as b,j as o,I as Ie,Q as k,ay as he,$ as Ne,hZ as je,h_ as we,h$ as Te,B as D,e5 as Pe,i0 as Ae,a8 as v,dB as ve,bY as _e,hg as $e,dW as Oe,af as P,i1 as Re,dT as Me,i2 as Le,hh as Be,dE as De,a9 as K,i3 as Ke,i4 as Ue,aa as qe,aw as Fe,eN as le,i5 as xe,eO as ue,e as We,gy as Ye,hb as ze,ae as Ge}from"./index-DxTOTFWT.js";import{u as He}from"./use-update-config-Dk0MthxZ.js";import{u as Qe}from"./use-promo-dismissals-BW_429t4.js";import{a as Ve,d as Je,k as Ze}from"./execution-config-JdnxoV1P.js";import{s as Xe}from"./settings-for-runtime-BoOa-ZFG.js";import{u as et,a as tt,e as C,c as nt,h as st,P as rt,A as at,d as ot}from"./ApplyToOverridesDialog-CsmbPbTh.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -8,7 +8,7 @@ import{a2 as ge,r as b,j as o,I as Ie,Q as k,ay as he,$ as je,hU as Ne,hV as we,
8
8
  *
9
9
  * This source code is licensed under the ISC license.
10
10
  * See the LICENSE file in the root directory of this source tree.
11
- */const ye={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};ye.node;const Bt=ge(ye);function Dt({value:e,min:t,max:s,onCommit:n,disabled:r,className:a,"aria-label":l,"aria-describedby":u}){const[i,m]=b.useState(null),x=b.useId(),h=i===null?e:Number(i),c=i!==null&&(i.trim()===""||!Number.isInteger(h)||h<t||h>s),y=()=>{i!==null&&(c||(m(null),h!==e&&n(h)))};return o.jsxs("div",{"data-slot":"bounded-number-input",className:"flex flex-col items-start gap-1",children:[o.jsx(Ie,{type:"number",inputMode:"numeric",min:t,max:s,step:1,disabled:r,"aria-label":l,"aria-invalid":c||void 0,"aria-describedby":[u,c?x:void 0].filter(Boolean).join(" ")||void 0,value:i??String(e),onChange:E=>m(E.target.value),onBlur:y,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),y()),E.key==="Escape"&&m(null)},className:k("w-24 tabular-nums",a)}),c&&o.jsxs("p",{id:x,className:"text-destructive text-xs",children:["Enter a whole number from ",t," to ",s,"."]})]})}function Ut(){const{data:e}=he(),t=He(),s=e==null?void 0:e.welcomeBack,n=b.useCallback(a=>{t.mutate({welcomeBack:{enabled:a}})},[t]),r=b.useCallback(a=>{t.mutate({welcomeBack:{offersEnabled:a}})},[t]);return{enabled:(s==null?void 0:s.enabled)??!1,absenceThresholdMinutes:(s==null?void 0:s.absenceThresholdMinutes)??0,maxPosts:(s==null?void 0:s.maxPosts)??0,offersEnabled:(s==null?void 0:s.offersEnabled)??!1,setEnabled:n,setOffersEnabled:r,isAvailable:s!==void 0,isPending:t.isPending}}const lt=`{
11
+ */const ye={name:"wrench",size:24,node:[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]};ye.node;const Bt=ge(ye);function Dt({value:e,min:t,max:s,onCommit:n,disabled:r,className:a,"aria-label":l,"aria-describedby":u}){const[i,m]=b.useState(null),x=b.useId(),h=i===null?e:Number(i),c=i!==null&&(i.trim()===""||!Number.isInteger(h)||h<t||h>s),y=()=>{i!==null&&(c||(m(null),h!==e&&n(h)))};return o.jsxs("div",{"data-slot":"bounded-number-input",className:"flex flex-col items-start gap-1",children:[o.jsx(Ie,{type:"number",inputMode:"numeric",min:t,max:s,step:1,disabled:r,"aria-label":l,"aria-invalid":c||void 0,"aria-describedby":[u,c?x:void 0].filter(Boolean).join(" ")||void 0,value:i??String(e),onChange:E=>m(E.target.value),onBlur:y,onKeyDown:E=>{E.key==="Enter"&&(E.preventDefault(),y()),E.key==="Escape"&&m(null)},className:k("w-24 tabular-nums",a)}),c&&o.jsxs("p",{id:x,className:"text-destructive text-xs",children:["Enter a whole number from ",t," to ",s,"."]})]})}function Kt(){const{data:e}=he(),t=He(),s=e==null?void 0:e.welcomeBack,n=b.useCallback(a=>{t.mutate({welcomeBack:{enabled:a}})},[t]),r=b.useCallback(a=>{t.mutate({welcomeBack:{offersEnabled:a}})},[t]);return{enabled:(s==null?void 0:s.enabled)??!1,absenceThresholdMinutes:(s==null?void 0:s.absenceThresholdMinutes)??0,maxPosts:(s==null?void 0:s.maxPosts)??0,offersEnabled:(s==null?void 0:s.offersEnabled)??!1,setEnabled:n,setOffersEnabled:r,isAvailable:s!==void 0,isPending:t.isPending}}const lt=`{
12
12
  "instanceId": "a1b2c3d4-...", // random, not you
13
13
  "dorkosVersion": "0.47.0",
14
14
  "os": "darwin-arm64",
@@ -16,4 +16,4 @@ import{a2 as ge,r as b,j as o,I as Ie,Q as k,ay as he,$ as je,hU as Ne,hV as we,
16
16
  "tunnelEnabled": false,
17
17
  "cloudLinked": false,
18
18
  "counts": { "agents": 4, "tasks": 2, "relayAdapters": 1 }
19
- }`;function Kt({className:e}){return o.jsxs("div",{className:k("space-y-1.5 text-left",e),children:[o.jsx("pre",{className:"text-muted-foreground bg-background/60 max-w-full overflow-x-auto rounded-md border p-3 text-xs",children:o.jsx("code",{children:lt})}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"That’s the whole daily ping."})]})}function qt({open:e,onToggle:t,className:s}){return o.jsxs("button",{type:"button",onClick:t,"aria-expanded":e,className:k("text-foreground focus-visible:ring-ring inline-flex items-center gap-1 rounded-sm text-xs font-medium underline underline-offset-2 outline-none hover:no-underline focus-visible:ring-2",s),children:["See what’s sent",o.jsx(je,{"aria-hidden":!0,className:k("size-3 transition-transform duration-200",e&&"rotate-180")})]})}const B="official-space-join";function ut(){var x;const{officialLink:e}=Ne(),t=we(e!==null),{dismissedIds:s,dismissPromo:n}=Qe(),r=Te(h=>h.ask),a=((x=t.data)==null?void 0:x.some(h=>h.official===!0))??!1,l=e!==null&&t.data!==void 0&&!a&&!s.includes(B),u=e!==null&&t.isLoading===!0&&!s.includes(B),i=b.useCallback(()=>{e!==null&&r(e)},[r,e]),m=b.useCallback(()=>n(B),[n]);return{link:e,joined:a,offered:l,pending:u,join:i,skip:m}}function Ft({className:e,onDone:t,compact:s=!1}){const n=ut(),r=b.useId();if(!n.offered)return null;const a=s?"h4":"h3";return o.jsxs("section",{"aria-labelledby":r,"data-testid":"official-space-offer",className:k("flex items-start",s?"gap-2":"gap-3 rounded-md border p-3",e),children:[o.jsx(it,{className:k("text-muted-foreground mt-0.5 shrink-0",s?"size-3.5":"size-4"),"aria-hidden":!0}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[o.jsx(a,{id:r,className:k("font-medium",s?"text-xs":"text-sm"),children:"Join the DorkOS community"}),o.jsx("p",{className:k("text-muted-foreground",s?"text-xs":"text-sm"),children:"One space for everyone using DorkOS. Your agents join only if you add them."}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(D,{size:"sm",onClick:()=>{n.join(),t==null||t()},children:"Join"}),o.jsx(D,{size:"sm",variant:"ghost",onClick:()=>{n.skip(),t==null||t()},children:"Not now"})]})]})]})}const ct="Paid plans and hosted spaces are for people in the United States, 18 or older.",dt="Paid plans are for people in the United States, 18 or older.",ft=Ae("/pricing#faq");function Wt({className:e,withSpaces:t=!0}){return o.jsxs("p",{className:k("text-muted-foreground text-xs",e),children:[t?ct:dt," ",o.jsx(Pe,{href:ft,className:"text-foreground underline underline-offset-2",children:"Who can buy a plan?"})]})}const mt=[];function ce(e,t){return t?`${e}\0credits`:e}function pt(e){const[t,s]=e.split("\0");return s?{runtime:t,account:P}:{runtime:t}}function Yt(e){var H,Q,V,J,X,Z,ee,te,ne,se;const t=(e==null?void 0:e.checkModels)??!1,s=v(),{data:n}=he(),{data:r}=ve(),{data:a}=_e(),l=b.useMemo(()=>((a==null?void 0:a.agents)??[]).map(d=>d.projectPath),[a]),{data:u}=$e(l),i=((H=n==null?void 0:n.executionDefaults)==null?void 0:H.runtime)??"claude-code",m=r?Object.keys(r.capabilities):void 0,x=(Q=n==null?void 0:n.executionDefaults)==null?void 0:Q.perRuntime,h=(V=n==null?void 0:n.claudeCode)==null?void 0:V.accounts,c=(J=n==null?void 0:n.claudeCode)==null?void 0:J.accountsUnavailable,y=h&&[...h.flatMap(d=>d.id===null?[]:[{id:d.id,label:Re(d.path,h)}]),...(X=n==null?void 0:n.claudeCode)!=null&&X.credits?[{id:P,label:Oe}]:[]],E=new Set(((ee=(Z=n==null?void 0:n.claudeCode)==null?void 0:Z.credits)==null?void 0:ee.allowedAgents)??[]),Se=d=>{var f;return((f=x==null?void 0:x.find(g=>g.runtime===d))==null?void 0:f.model)??null},M=m==null?void 0:m.join(","),Y=(te=n==null?void 0:n.claudeCode)==null?void 0:te.credits,w=(ne=Me().data)==null?void 0:ne.defaults,L=b.useCallback(d=>Ve(d,{defaultRuntime:i,runtimeDeclaresCredits:f=>{var g;return((g=r==null?void 0:r.capabilities[f])==null?void 0:g.credits)!==void 0},credits:Y,runtimeDefaultsToCredits:f=>{var g;return((g=w==null?void 0:w[f])==null?void 0:g.runsOn)==="credits"}}),[i,r,Y,w]),z=b.useMemo(()=>{if(!t||!u)return[];const d=M===void 0?null:new Set(M.split(",")),f=new Set;for(const g of Object.values(u)){if(!(g!=null&&g.model)&&!(g!=null&&g.effort))continue;const S=g.runtime??i;d&&!d.has(S)||f.add(ce(S,L(g)))}return[...f].sort()},[t,u,i,M,L]),ke=Le({queries:z.map(d=>({...Be(s,pt(d)),retry:!1}))}),G=new Map;if(z.forEach((d,f)=>{var S;const g=(S=ke[f])==null?void 0:S.data;g&&G.set(d,g)}),!u)return{exceptions:mt,brokenPaths:[],defaultRuntime:i};const T=[];for(const[d,f]of Object.entries(u)){if(!f)continue;const g=f.runtime??i,S=G.get(ce(g,L(f))),re=Se(g),ae=f.model??re,oe=ae?S==null?void 0:S.find(j=>j.value===ae):void 0,ie=Je({agent:{runtime:f.runtime,model:f.model,effort:f.effort,account:f.account},defaultRuntime:i,serverDefaultModel:re,knownRuntimes:m,knownModels:Xe(S),knownAccounts:f.account===P&&!E.has(f.id)?y==null?void 0:y.filter(j=>j.id!==P):y,accountsUnavailable:c,modelSupportsEffort:oe?oe.supportsEffort??!1:void 0,runtimeSupportsEffort:(se=Ze(r,g))==null?void 0:se.supportsEffort,runtimeLabel:j=>De(j).label});ie.isException&&T.push({path:d,agent:f,report:ie})}return T.sort((d,f)=>d.report.isBroken!==f.report.isBroken?d.report.isBroken?-1:1:d.agent.name.localeCompare(f.agent.name)),{exceptions:T,brokenPaths:T.filter(d=>d.report.isBroken).map(d=>d.path),defaultRuntime:i}}const A={all:["cloud","communities"],list:()=>[...A.all,"list"],move:e=>[...A.all,"move",e],name:e=>[...A.all,"name",e]};function zt(){var s;const e=v();return((s=U({queryKey:Ke,queryFn:()=>e.getCloudStatus(),staleTime:3e4}).data)==null?void 0:s.linked)===!0}function Gt(e){const t=v(),s=Ue();return U({queryKey:A.list(),queryFn:()=>t.listHostedCommunities(),enabled:e&&s,staleTime:15e3})}const gt=/^-?(0|[1-9][0-9]*)$/,ht=/^[1-9][0-9]*$/,xt=/^[A-Z]{3}$/,_=6,bt=BigInt(10)**BigInt(_),p=BigInt(0),$=BigInt(1),yt=BigInt(2),O=BigInt(10);function Ce(e,t){const s=e/t;return e%t!==p&&e<p?s-$:s}function K(e,t){const s=e<p?-e:e;let n=s/t;return s%t*yt>=t&&(n+=$),e<p?-n:n}function I(e){return typeof e!="string"||!gt.test(e)?null:BigInt(e)}function R(e){if(typeof e!="object"||e===null)return null;const{microPerCredit:t}=e;return typeof t!="string"||!ht.test(t)||q(e)===null?null:BigInt(t)}const de=new Map;function Ct(e){const t=de.get(e);if(t!==void 0)return t;let s=null;try{const n=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),r=n.formatToParts(0),a=new Set(["integer","group","decimal","fraction"]),l=r.findIndex(m=>a.has(m.type));let u=-1;r.forEach((m,x)=>{a.has(m.type)&&(u=x)});const i=n.resolvedOptions().maximumFractionDigits??0;if(l>=0&&i>=0&&i<=_){const m=x=>x.filter(h=>h.type!=="minusSign"&&h.type!=="plusSign").map(h=>h.value).join("");s={prefix:m(r.slice(0,l)),suffix:m(r.slice(u+1)),minorDigits:i}}}catch{s=null}return de.set(e,s),s}function q(e){if(typeof e!="object"||e===null)return null;const{currency:t}=e;return typeof t!="string"||!xt.test(t)?null:Ct(t)}function N(e){const t=e.toString();let s="";for(let n=0;n<t.length;n+=1)n>0&&(t.length-n)%3===0&&(s+=","),s+=t[n];return s}function F(e,t,s){const n=O**BigInt(t),r=e/n;let a=t>0?(e%n).toString().padStart(t,"0"):"";for(;a.length>s&&a.endsWith("0");)a=a.slice(0,-1);return a.length>0?`${N(r)}.${a}`:N(r)}function W(e){return e<p?`-${N(-e)}`:N(e)}function fe(e,t,s){const n=e<p?-e:e,r=s?N(n/O**BigInt(t.minorDigits)):F(n,t.minorDigits,t.minorDigits);return`${e<p?"-":""}${t.prefix}${r}${t.suffix}`}function Et(e,t,s){const n=I(e),r=q(t);if(n===null||r===null)return null;const a=O**BigInt(_-r.minorDigits),l=s(n,a);if(l===p&&n!==p){const u=fe($,r,r.minorDigits===0);return n<p?`-<${u}`:`<${u}`}return fe(l,r,n%bt===p)}function St(e,t){const s=I(e),n=R(t);return s===null||n===null?null:W(Ce(s,n))}function Ht(e,t){const s=I(e),n=R(t);if(s===null||n===null)return null;if(s===p)return"0";const r=K(s,n);return r===p?s<p?"-<1":"<1":W(r)}function kt(e,t){const s=I(e),n=R(t);if(s===null||n===null)return null;let r=0,a=s<p?-s:s,l=$;for(;a*l%n!==p;)if(r+=1,l*=O,r>n.toString().length*4)return null;a=a*l/n;const u=F(a,r,0);return s<p?`-${u}`:u}function me(e,t){return Et(e,t,K)}function It(e,t){const s=I(e),n=q(t);if(s===null||n===null)return null;const r=s<p?-s:s;return`${s<p?"-":""}${n.prefix}${F(r,_,n.minorDigits)}${n.suffix}`}function Qt(e,t,s){const n=I(e),r=R(t);if(n===null||r===null)return null;const a=i=>i==="1"||i==="-1"?`${i} credit`:`${i} credits`;if(s==="rate"){const i=kt(e,t),m=It(e,t);return i===null||m===null?null:`${a(i)} (${m})`}let l;if(s==="position")l=Ce(n,r);else if(l=n===p?p:K(n,r),l===p&&n!==p){const i=me(r.toString(),t);if(i===null)return null;const m=i.startsWith("<")?i:`<${i}`;return n<p?`-<1 credit (-${m})`:`<1 credit (${m})`}const u=me((l*r).toString(),t);return u===null?null:`${a(W(l))} (${u})`}function Vt(e){return St("0",e)!==null}function Jt(e){return e===null?null:`${e} ${e==="1"||e==="-1"||e==="<1"||e==="-<1"?"credit":"credits"}`}const pe=1n<<16n;function Xt(e,t){if(!/^\d+$/.test(e)||!/^\d+$/.test(t))return null;const s=BigInt(t);if(s===0n)return null;const n=BigInt(e);return n>=s?1:n<=0n?0:Number(n*pe/s)/Number(pe)}const Ee=["keep-awake"],jt=5*6e4;function Zt(){const e=v(),{data:t}=U({queryKey:[...Ee],queryFn:()=>e.getKeepAwake(),staleTime:jt});return t}function Nt(e){if(typeof e!="object"||e===null)return!1;const t=e,s=t.working;return typeof t.enabled=="boolean"&&typeof t.supported=="boolean"&&typeof t.asserted=="boolean"&&typeof s=="object"&&s!==null&&typeof s.chats=="number"&&typeof s.rooms=="number"&&typeof s.tasks=="number"}function en(){const e=qe();Fe("keep_awake_status",t=>{Nt(t)&&e.setQueryData([...Ee],t)})}const tn={tab:"tools",section:"sleep"},wt=[["chats","chat","chats"],["rooms","room","rooms"],["tasks","task","tasks"]];function Tt(e){const t=wt.filter(([s])=>e[s]>0).map(([s,n,r])=>`${e[s]} ${e[s]===1?n:r}`);return t.length===0?null:t.length===1?`${t[0]} running`:t.join(", ")}function nn(e){return(e==null?void 0:e.asserted)===!0&&Tt(e.working)!==null}const sn={container:"Not available in a container.","tool-missing":"Not available: this computer has no sleep control tool.",denied:"This computer refused to stay awake. Tries again while agents work.",platform:"Not available on this operating system."};function rn(e){return e.supported||e.reason==="denied"}const an="Closing the lid usually still sleeps. The screen still locks. Uses more battery.";function Pt(e,t){return t===0?C[e]:`${C[e]}, ${t} ${t===1?"change":"changes"}`}function At(e){const t=new Map,s=(n,r)=>{const a=t.get(n)??{agentName:r,count:0};a.count+=1,t.set(n,a)};for(const n of e.exceptions)s(n.agentId,n.agentName);for(const n of e.filesAndCommands.exceptions)s(n.agentId,n.agentName);return[...t].map(([n,{agentName:r,count:a}])=>({agentId:n,agentName:r,detail:`${a} ${a===1?"setting":"settings"} of its own`}))}function vt(e){const t=xe;return t.includes(e)?t:[...t,e]}function on({surface:e}){const t=et(),s=tt({kind:"default"}),[n,r]=b.useState(null),a=b.useMemo(()=>t.data?At(t.data):[],[t.data]);if(t.isError)return o.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."});if(!t.data)return o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"preset-picker","aria-busy":"true",children:[o.jsx(le,{"aria-label":"Preset",className:"w-full",value:"",onValueChange:()=>{},children:xe.map(c=>o.jsx(ue,{value:c,"aria-label":C[c],children:o.jsx("span",{className:"truncate",children:C[c]})},c))}),o.jsx(We,{className:"h-4 w-2/3"})]});const l=t.data,u=l.preset??"trusted",i=nt(l,{kind:"preset"}),m=`Changing it ${ot(i)}`,x=(c,y)=>s.mutate({kind:"preset",preset:c,surface:e,...y&&y.length>0?{applyToAgents:y}:{}},{onError:E=>Ge.error(E instanceof Error?E.message:"Couldn’t save that change. Try again.")}),h=c=>{c===l.preset&&l.changeCount===0||(a.length>0?r(c):x(c))};return o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"preset-picker",children:[o.jsx(le,{"aria-label":"Preset",className:"w-full",value:u,onValueChange:c=>c&&h(c),disabled:s.isPending,children:vt(u).map(c=>o.jsx(ue,{value:c,"aria-label":C[c],children:o.jsx("span",{className:"truncate",children:C[c]})},c))}),o.jsxs("div",{className:"flex flex-col gap-1 @lg:flex-row @lg:items-center @lg:justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("p",{className:"text-sm","data-testid":"permissions-preset",children:[o.jsx("span",{className:"font-medium",children:Pt(u,l.changeCount)}),o.jsxs("span",{className:"text-muted-foreground",children:[" · ",st[u]]})]}),o.jsxs("p",{className:"text-muted-foreground text-xs","data-testid":"permissions-preset-preview",children:[m," ·"," ",o.jsx(rt,{question:`Why is the preset set to ${C[u]}?`,sentence:`${C[u]} is the preset every agent starts from.`,...l.presetLastChange?{lastChange:l.presetLastChange}:{}})]})]}),l.changeCount>0?o.jsxs(D,{variant:"ghost",size:"sm",className:"self-start",disabled:s.isPending,onClick:()=>h(u),children:["Reset to ",C[u]]}):null]}),o.jsx(Ye,{descriptor:ze.find(c=>c.stop===l.filesAndCommands.stop)}),o.jsx(at,{open:n!==null,onCancel:()=>r(null),subject:"Preset",title:n?`Switch everyone to ${C[n]}?`:void 0,next:n?C[n]:"",agents:a,affectedCount:i,onKeep:()=>{n&&x(n),r(null)},onUpdate:c=>{n&&x(n,c),r(null)},pending:s.isPending})]})}export{Dt as B,Wt as C,Ee as K,Ft as O,on as P,tn as S,qt as T,sn as U,Bt as W,Kt as a,St as b,Qt as c,me as d,Ut as e,Ht as f,Zt as g,rn as h,Vt as i,an as j,Yt as k,ut as l,A as m,zt as n,it as o,nn as p,Tt as q,Xt as r,en as s,Gt as u,Jt as w};
19
+ }`;function Ut({className:e}){return o.jsxs("div",{className:k("space-y-1.5 text-left",e),children:[o.jsx("pre",{className:"text-muted-foreground bg-background/60 max-w-full overflow-x-auto rounded-md border p-3 text-xs",children:o.jsx("code",{children:lt})}),o.jsx("p",{className:"text-muted-foreground text-xs",children:"That’s the whole daily ping."})]})}function qt({open:e,onToggle:t,className:s}){return o.jsxs("button",{type:"button",onClick:t,"aria-expanded":e,className:k("text-foreground focus-visible:ring-ring inline-flex items-center gap-1 rounded-sm text-xs font-medium underline underline-offset-2 outline-none hover:no-underline focus-visible:ring-2",s),children:["See what’s sent",o.jsx(Ne,{"aria-hidden":!0,className:k("size-3 transition-transform duration-200",e&&"rotate-180")})]})}const B="official-space-join";function ut(){var x;const{officialLink:e}=je(),t=we(e!==null),{dismissedIds:s,dismissPromo:n}=Qe(),r=Te(h=>h.ask),a=((x=t.data)==null?void 0:x.some(h=>h.official===!0))??!1,l=e!==null&&t.data!==void 0&&!a&&!s.includes(B),u=e!==null&&t.isLoading===!0&&!s.includes(B),i=b.useCallback(()=>{e!==null&&r(e)},[r,e]),m=b.useCallback(()=>n(B),[n]);return{link:e,joined:a,offered:l,pending:u,join:i,skip:m}}function Ft({className:e,onDone:t,compact:s=!1}){const n=ut(),r=b.useId();if(!n.offered)return null;const a=s?"h4":"h3";return o.jsxs("section",{"aria-labelledby":r,"data-testid":"official-space-offer",className:k("flex items-start",s?"gap-2":"gap-3 rounded-md border p-3",e),children:[o.jsx(it,{className:k("text-muted-foreground mt-0.5 shrink-0",s?"size-3.5":"size-4"),"aria-hidden":!0}),o.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[o.jsx(a,{id:r,className:k("font-medium",s?"text-xs":"text-sm"),children:"Join the DorkOS community"}),o.jsx("p",{className:k("text-muted-foreground",s?"text-xs":"text-sm"),children:"One space for everyone using DorkOS. Your agents join only if you add them."}),o.jsxs("div",{className:"flex flex-wrap gap-2",children:[o.jsx(D,{size:"sm",onClick:()=>{n.join(),t==null||t()},children:"Join"}),o.jsx(D,{size:"sm",variant:"ghost",onClick:()=>{n.skip(),t==null||t()},children:"Not now"})]})]})]})}const ct="Paid plans and hosted spaces are for people in the United States, 18 or older.",dt="Paid plans are for people in the United States, 18 or older.",ft=Ae("/pricing#faq");function Wt({className:e,withSpaces:t=!0}){return o.jsxs("p",{className:k("text-muted-foreground text-xs",e),children:[t?ct:dt," ",o.jsx(Pe,{href:ft,className:"text-foreground underline underline-offset-2",children:"Who can buy a plan?"})]})}const mt=[];function ce(e,t){return t?`${e}\0credits`:e}function pt(e){const[t,s]=e.split("\0");return s?{runtime:t,account:P}:{runtime:t}}function Yt(e){var H,Q,V,J,Z,X,ee,te,ne,se;const t=(e==null?void 0:e.checkModels)??!1,s=v(),{data:n}=he(),{data:r}=ve(),{data:a}=_e(),l=b.useMemo(()=>((a==null?void 0:a.agents)??[]).map(d=>d.projectPath),[a]),{data:u}=$e(l),i=((H=n==null?void 0:n.executionDefaults)==null?void 0:H.runtime)??"claude-code",m=r?Object.keys(r.capabilities):void 0,x=(Q=n==null?void 0:n.executionDefaults)==null?void 0:Q.perRuntime,h=(V=n==null?void 0:n.claudeCode)==null?void 0:V.accounts,c=(J=n==null?void 0:n.claudeCode)==null?void 0:J.accountsUnavailable,y=h&&[...h.flatMap(d=>d.id===null?[]:[{id:d.id,label:Re(d.path,h)}]),...(Z=n==null?void 0:n.claudeCode)!=null&&Z.credits?[{id:P,label:Oe}]:[]],E=new Set(((ee=(X=n==null?void 0:n.claudeCode)==null?void 0:X.credits)==null?void 0:ee.allowedAgents)??[]),Se=d=>{var f;return((f=x==null?void 0:x.find(g=>g.runtime===d))==null?void 0:f.model)??null},M=m==null?void 0:m.join(","),Y=(te=n==null?void 0:n.claudeCode)==null?void 0:te.credits,w=(ne=Me().data)==null?void 0:ne.defaults,L=b.useCallback(d=>Ve(d,{defaultRuntime:i,runtimeDeclaresCredits:f=>{var g;return((g=r==null?void 0:r.capabilities[f])==null?void 0:g.credits)!==void 0},credits:Y,runtimeDefaultsToCredits:f=>{var g;return((g=w==null?void 0:w[f])==null?void 0:g.runsOn)==="credits"}}),[i,r,Y,w]),z=b.useMemo(()=>{if(!t||!u)return[];const d=M===void 0?null:new Set(M.split(",")),f=new Set;for(const g of Object.values(u)){if(!(g!=null&&g.model)&&!(g!=null&&g.effort))continue;const S=g.runtime??i;d&&!d.has(S)||f.add(ce(S,L(g)))}return[...f].sort()},[t,u,i,M,L]),ke=Le({queries:z.map(d=>({...Be(s,pt(d)),retry:!1}))}),G=new Map;if(z.forEach((d,f)=>{var S;const g=(S=ke[f])==null?void 0:S.data;g&&G.set(d,g)}),!u)return{exceptions:mt,brokenPaths:[],defaultRuntime:i};const T=[];for(const[d,f]of Object.entries(u)){if(!f)continue;const g=f.runtime??i,S=G.get(ce(g,L(f))),re=Se(g),ae=f.model??re,oe=ae?S==null?void 0:S.find(N=>N.value===ae):void 0,ie=Je({agent:{runtime:f.runtime,model:f.model,effort:f.effort,account:f.account},defaultRuntime:i,serverDefaultModel:re,knownRuntimes:m,knownModels:Ze(S),knownAccounts:f.account===P&&!E.has(f.id)?y==null?void 0:y.filter(N=>N.id!==P):y,accountsUnavailable:c,modelSupportsEffort:oe?oe.supportsEffort??!1:void 0,runtimeSupportsEffort:(se=Xe(r,g))==null?void 0:se.supportsEffort,runtimeLabel:N=>De(N).label});ie.isException&&T.push({path:d,agent:f,report:ie})}return T.sort((d,f)=>d.report.isBroken!==f.report.isBroken?d.report.isBroken?-1:1:d.agent.name.localeCompare(f.agent.name)),{exceptions:T,brokenPaths:T.filter(d=>d.report.isBroken).map(d=>d.path),defaultRuntime:i}}const A={all:["cloud","communities"],list:()=>[...A.all,"list"],move:e=>[...A.all,"move",e],name:e=>[...A.all,"name",e]};function zt(){var s;const e=v();return((s=K({queryKey:Ue,queryFn:()=>e.getCloudStatus(),staleTime:3e4}).data)==null?void 0:s.linked)===!0}function Gt(e){const t=v(),s=Ke();return K({queryKey:A.list(),queryFn:()=>t.listHostedCommunities(),enabled:e&&s,staleTime:15e3})}const gt=/^-?(0|[1-9][0-9]*)$/,ht=/^[1-9][0-9]*$/,xt=/^[A-Z]{3}$/,_=6,bt=BigInt(10)**BigInt(_),p=BigInt(0),$=BigInt(1),yt=BigInt(2),O=BigInt(10);function Ce(e,t){const s=e/t;return e%t!==p&&e<p?s-$:s}function U(e,t){const s=e<p?-e:e;let n=s/t;return s%t*yt>=t&&(n+=$),e<p?-n:n}function I(e){return typeof e!="string"||!gt.test(e)?null:BigInt(e)}function R(e){if(typeof e!="object"||e===null)return null;const{microPerCredit:t}=e;return typeof t!="string"||!ht.test(t)||q(e)===null?null:BigInt(t)}const de=new Map;function Ct(e){const t=de.get(e);if(t!==void 0)return t;let s=null;try{const n=new Intl.NumberFormat("en-US",{style:"currency",currency:e}),r=n.formatToParts(0),a=new Set(["integer","group","decimal","fraction"]),l=r.findIndex(m=>a.has(m.type));let u=-1;r.forEach((m,x)=>{a.has(m.type)&&(u=x)});const i=n.resolvedOptions().maximumFractionDigits??0;if(l>=0&&i>=0&&i<=_){const m=x=>x.filter(h=>h.type!=="minusSign"&&h.type!=="plusSign").map(h=>h.value).join("");s={prefix:m(r.slice(0,l)),suffix:m(r.slice(u+1)),minorDigits:i}}}catch{s=null}return de.set(e,s),s}function q(e){if(typeof e!="object"||e===null)return null;const{currency:t}=e;return typeof t!="string"||!xt.test(t)?null:Ct(t)}function j(e){const t=e.toString();let s="";for(let n=0;n<t.length;n+=1)n>0&&(t.length-n)%3===0&&(s+=","),s+=t[n];return s}function F(e,t,s){const n=O**BigInt(t),r=e/n;let a=t>0?(e%n).toString().padStart(t,"0"):"";for(;a.length>s&&a.endsWith("0");)a=a.slice(0,-1);return a.length>0?`${j(r)}.${a}`:j(r)}function W(e){return e<p?`-${j(-e)}`:j(e)}function fe(e,t,s){const n=e<p?-e:e,r=s?j(n/O**BigInt(t.minorDigits)):F(n,t.minorDigits,t.minorDigits);return`${e<p?"-":""}${t.prefix}${r}${t.suffix}`}function Et(e,t,s){const n=I(e),r=q(t);if(n===null||r===null)return null;const a=O**BigInt(_-r.minorDigits),l=s(n,a);if(l===p&&n!==p){const u=fe($,r,r.minorDigits===0);return n<p?`-<${u}`:`<${u}`}return fe(l,r,n%bt===p)}function St(e,t){const s=I(e),n=R(t);return s===null||n===null?null:W(Ce(s,n))}function Ht(e,t){const s=I(e),n=R(t);if(s===null||n===null)return null;if(s===p)return"0";const r=U(s,n);return r===p?s<p?"-<1":"<1":W(r)}function kt(e,t){const s=I(e),n=R(t);if(s===null||n===null)return null;let r=0,a=s<p?-s:s,l=$;for(;a*l%n!==p;)if(r+=1,l*=O,r>n.toString().length*4)return null;a=a*l/n;const u=F(a,r,0);return s<p?`-${u}`:u}function me(e,t){return Et(e,t,U)}function It(e,t){const s=I(e),n=q(t);if(s===null||n===null)return null;const r=s<p?-s:s;return`${s<p?"-":""}${n.prefix}${F(r,_,n.minorDigits)}${n.suffix}`}function Qt(e,t,s){const n=I(e),r=R(t);if(n===null||r===null)return null;const a=i=>i==="1"||i==="-1"?`${i} credit`:`${i} credits`;if(s==="rate"){const i=kt(e,t),m=It(e,t);return i===null||m===null?null:`${a(i)} (${m})`}let l;if(s==="position")l=Ce(n,r);else if(l=n===p?p:U(n,r),l===p&&n!==p){const i=me(r.toString(),t);if(i===null)return null;const m=i.startsWith("<")?i:`<${i}`;return n<p?`-<1 credit (-${m})`:`<1 credit (${m})`}const u=me((l*r).toString(),t);return u===null?null:`${a(W(l))} (${u})`}function Vt(e){return St("0",e)!==null}function Jt(e){return e===null?null:`${e} ${e==="1"||e==="-1"||e==="<1"||e==="-<1"?"credit":"credits"}`}const pe=1n<<16n;function Zt(e,t){if(!/^\d+$/.test(e)||!/^\d+$/.test(t))return null;const s=BigInt(t);if(s===0n)return null;const n=BigInt(e);return n>=s?1:n<=0n?0:Number(n*pe/s)/Number(pe)}const Ee=["keep-awake"],Nt=5*6e4;function Xt(){const e=v(),{data:t}=K({queryKey:[...Ee],queryFn:()=>e.getKeepAwake(),staleTime:Nt});return t}function jt(e){if(typeof e!="object"||e===null)return!1;const t=e,s=t.working;return typeof t.enabled=="boolean"&&typeof t.supported=="boolean"&&typeof t.asserted=="boolean"&&typeof s=="object"&&s!==null&&typeof s.chats=="number"&&typeof s.rooms=="number"&&typeof s.tasks=="number"}function en(){const e=qe();Fe("keep_awake_status",t=>{jt(t)&&e.setQueryData([...Ee],t)})}const tn={tab:"tools",section:"sleep"},wt=[["chats","chat","chats"],["rooms","room","rooms"],["tasks","task","tasks"]];function Tt(e){const t=wt.filter(([s])=>e[s]>0).map(([s,n,r])=>`${e[s]} ${e[s]===1?n:r}`);return t.length===0?null:t.length===1?`${t[0]} running`:t.join(", ")}function nn(e){return(e==null?void 0:e.asserted)===!0&&Tt(e.working)!==null}const sn={container:"Not available in a container.","tool-missing":"Not available: this computer has no sleep control tool.",denied:"This computer refused to stay awake. Tries again while agents work.",platform:"Not available on this operating system."};function rn(e){return e.supported||e.reason==="denied"}const an="Closing the lid usually still sleeps. The screen still locks. Uses more battery.";function Pt(e,t){return t===0?C[e]:`${C[e]}, ${t} ${t===1?"change":"changes"}`}function At(e){const t=new Map,s=(n,r)=>{const a=t.get(n)??{agentName:r,count:0};a.count+=1,t.set(n,a)};for(const n of e.exceptions)s(n.agentId,n.agentName);for(const n of e.filesAndCommands.exceptions)s(n.agentId,n.agentName);return[...t].map(([n,{agentName:r,count:a}])=>({agentId:n,agentName:r,detail:`${a} ${a===1?"setting":"settings"} of its own`}))}function vt(e){const t=xe;return t.includes(e)?t:[...t,e]}function on({surface:e}){const t=et(),s=tt({kind:"default"}),[n,r]=b.useState(null),a=b.useMemo(()=>t.data?At(t.data):[],[t.data]);if(t.isError)return o.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read the permissions."});if(!t.data)return o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"preset-picker","aria-busy":"true",children:[o.jsx(le,{"aria-label":"Preset",className:"w-full",value:"",onValueChange:()=>{},children:xe.map(c=>o.jsx(ue,{value:c,"aria-label":C[c],children:o.jsx("span",{className:"truncate",children:C[c]})},c))}),o.jsx(We,{className:"h-4 w-2/3"})]});const l=t.data,u=l.preset??"trusted",i=nt(l,{kind:"preset"}),m=`Changing it ${ot(i)}`,x=(c,y)=>s.mutate({kind:"preset",preset:c,surface:e,...y&&y.length>0?{applyToAgents:y}:{}},{onError:E=>Ge.error(E instanceof Error?E.message:"Couldn’t save that change. Try again.")}),h=c=>{c===l.preset&&l.changeCount===0||(a.length>0?r(c):x(c))};return o.jsxs("div",{className:"flex flex-col gap-3","data-testid":"preset-picker",children:[o.jsx(le,{"aria-label":"Preset",className:"w-full",value:u,onValueChange:c=>c&&h(c),disabled:s.isPending,children:vt(u).map(c=>o.jsx(ue,{value:c,"aria-label":C[c],children:o.jsx("span",{className:"truncate",children:C[c]})},c))}),o.jsxs("div",{className:"flex flex-col gap-1 @lg:flex-row @lg:items-center @lg:justify-between",children:[o.jsxs("div",{className:"space-y-0.5",children:[o.jsxs("p",{className:"text-sm","data-testid":"permissions-preset",children:[o.jsx("span",{className:"font-medium",children:Pt(u,l.changeCount)}),o.jsxs("span",{className:"text-muted-foreground",children:[" · ",st[u]]})]}),o.jsxs("p",{className:"text-muted-foreground text-xs","data-testid":"permissions-preset-preview",children:[m," ·"," ",o.jsx(rt,{question:`Why is the preset set to ${C[u]}?`,sentence:`${C[u]} is the preset every agent starts from.`,...l.presetLastChange?{lastChange:l.presetLastChange}:{}})]})]}),l.changeCount>0?o.jsxs(D,{variant:"ghost",size:"sm",className:"self-start",disabled:s.isPending,onClick:()=>h(u),children:["Reset to ",C[u]]}):null]}),o.jsx(Ye,{descriptor:ze.find(c=>c.stop===l.filesAndCommands.stop)}),o.jsx(at,{open:n!==null,onCancel:()=>r(null),subject:"Preset",title:n?`Switch everyone to ${C[n]}?`:void 0,next:n?C[n]:"",agents:a,affectedCount:i,onKeep:()=>{n&&x(n),r(null)},onUpdate:c=>{n&&x(n,c),r(null)},pending:s.isPending})]})}export{Dt as B,Wt as C,Ee as K,Ft as O,on as P,tn as S,qt as T,sn as U,Bt as W,Ut as a,St as b,Qt as c,me as d,Kt as e,Ht as f,Xt as g,rn as h,Vt as i,an as j,Yt as k,ut as l,A as m,zt as n,it as o,nn as p,Tt as q,Zt as r,en as s,Gt as u,Jt as w};
@@ -1 +1 @@
1
- import{r as b,j as n,bt as _,bw as p,bx as E,eA as k,bB as S,dr as I,di as A,eB as N,eC as R,bu as T,bC as h,eD as M,eE as D,eF as $,eG as F,a8 as O,a9 as G,ah as V}from"./index-CdKpQ1hI.js";import{S as L}from"./shield-x-jF_NCCvp.js";var K=Object.defineProperty,g=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[B,oe]=E(x,[k]),C=k(),[U,y]=B(x),q=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:v="automatic",...m}=t,u=S(l),[c,f]=I({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(U,{scope:r,baseId:A(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:v,children:n.jsx(p.div,{dir:u,"data-orientation":i,...m,ref:a})})},"Tabs")),H="TabsList",z=b.forwardRef(g(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(H,r),i=C(r);return n.jsx(N,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(p.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=C(r),v=w(i.baseId,s),m=j(i.baseId,s),u=s===i.value;return n.jsx(R,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:v,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),v=w(l.baseId,s),m=j(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:m,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}g(w,"makeTriggerId");function j(e,t){return`${e}-content-${t}`}g(j,"makeContentId");var Y=q,Z=z,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.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 ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background 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","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","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 de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-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 se(e){try{return F.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=D(e.startsEnabled);return`${t}, ${a}. This job ${$(e.permissionMode)}.`}function be(e,t){const a=O(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return G({queryKey:V.permissionPreview(e??"",o?s:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?s:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function P(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 ge(e){return P(e).checked}function ve({error:e}){const{reasons:t,checked:a}=P(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ve as P,ie as T,ce as a,ue as b,de as c,fe as d,ge as i,le as r,be as u};
1
+ import{r as b,j as n,bt as _,bw as p,bx as E,eC as j,bB as I,dt as S,dk as N,eD as R,eE as A,bu as T,bC as h,eF as M,eG as D,eH as $,eI as F,a8 as O,a9 as G,ah as V}from"./index-DxTOTFWT.js";import{S as L}from"./shield-x-DlaUufPM.js";var K=Object.defineProperty,g=(e,t)=>K(e,"name",{value:t,configurable:!0}),x="Tabs",[H,oe]=E(x,[j]),C=j(),[U,y]=H(x),q=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,onValueChange:o,defaultValue:d,orientation:i="horizontal",dir:l,activationMode:v="automatic",...m}=t,u=I(l),[c,f]=S({prop:s,onChange:o,defaultProp:d??"",caller:x});return n.jsx(U,{scope:r,baseId:N(),value:c,onValueChange:f,orientation:i,dir:u,activationMode:v,children:n.jsx(p.div,{dir:u,"data-orientation":i,...m,ref:a})})},"Tabs")),B="TabsList",z=b.forwardRef(g(function(t,a){const{__scopeTabs:r,loop:s=!0,...o}=t,d=y(B,r),i=C(r);return n.jsx(R,{asChild:!0,...i,orientation:d.orientation,dir:d.dir,loop:s,children:n.jsx(p.div,{role:"tablist","aria-orientation":d.orientation,...o,ref:a})})},"TabsList")),Q="TabsTrigger",W=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,disabled:o=!1,...d}=t,i=y(Q,r),l=C(r),v=w(i.baseId,s),m=k(i.baseId,s),u=s===i.value;return n.jsx(A,{asChild:!0,...l,focusable:!o,active:u,children:n.jsx(p.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":m,"data-state":u?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:v,...d,ref:a,onMouseDown:T(t.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?i.onValueChange(s):c.preventDefault()}),onKeyDown:T(t.onKeyDown,c=>{o||c.target!==c.currentTarget||[" ","Enter"].includes(c.key)&&i.onValueChange(s)}),onFocus:T(t.onFocus,()=>{const c=i.activationMode!=="manual";!u&&!o&&c&&i.onValueChange(s)})})})},"TabsTrigger")),X="TabsContent",J=b.forwardRef(g(function(t,a){const{__scopeTabs:r,value:s,forceMount:o,children:d,...i}=t,l=y(X,r),v=w(l.baseId,s),m=k(l.baseId,s),u=s===l.value,c=b.useRef(u);return b.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),n.jsx(_,{present:o||u,children:({present:f})=>n.jsx(p.div,{"data-state":u?"active":"inactive","data-orientation":l.orientation,role:"tabpanel","aria-labelledby":v,hidden:!f,id:m,tabIndex:0,...i,ref:a,style:{...t.style,animationDuration:c.current?"0s":void 0},children:f&&d})})},"TabsContent"));function w(e,t){return`${e}-trigger-${t}`}g(w,"makeTriggerId");function k(e,t){return`${e}-content-${t}`}g(k,"makeContentId");var Y=q,Z=z,ee=W,te=J;function ie({...e}){return n.jsx(Y,{"data-slot":"tabs",...e})}function ce({className:e,responsive:t=!0,...a}){return n.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 ue({className:e,...t}){return n.jsx(ee,{"data-slot":"tabs-trigger",className:h("ring-offset-dui-background 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","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none","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 de({className:e,...t}){return n.jsx(te,{"data-slot":"tabs-content",className:h("ring-offset-dui-background mt-2","data-[state=active]:animate-in data-[state=active]:fade-in-0 data-[state=active]:duration-150 motion-reduce:animate-none!","focus-visible:ring-dui-ring focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-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 se(e){try{return F.toString(e)}catch{return`On the schedule ${e}`}}function fe(e){const t=e.cron?se(e.cron):"Runs only when you ask",a=D(e.startsEnabled);return`${t}, ${a}. This job ${$(e.permissionMode)}.`}function be(e,t){const a=O(),{enabled:r=!0,...s}=t??{},o=Object.keys(s).length>0;return G({queryKey:V.permissionPreview(e??"",o?s:void 0),queryFn:()=>a.previewMarketplacePackage(e,o?s:void 0),enabled:r&&e!==null,staleTime:3e4,networkMode:"always"})}function P(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 ge(e){return P(e).checked}function ve({error:e}){const{reasons:t,checked:a}=P(e);return n.jsxs("div",{role:"alert",className:"border-destructive/40 bg-destructive/5 space-y-2 rounded-md border p-3 text-sm",children:[n.jsxs("p",{className:"text-destructive flex items-center gap-2 font-medium",children:[n.jsx(L,{className:"size-4 shrink-0","aria-hidden":!0}),"DorkOS won’t install this package"]}),n.jsx("p",{className:"text-muted-foreground text-xs",children:a?"What it found:":"It couldn’t check what this package does."}),t.length>0&&n.jsx("ul",{className:"text-muted-foreground list-disc space-y-1 pl-5 text-xs [overflow-wrap:anywhere]",children:t.map(r=>n.jsx("li",{children:r},r))})]})}export{ve as P,ie as T,ce as a,ue as b,de as c,fe as d,ge as i,le as r,be as u};
@@ -1 +1 @@
1
- import{r as x,t as S,j as e,bm as u,bn as h,bo as m,g as E,B as d,I as g,bp as p,bq as b}from"./index-CdKpQ1hI.js";import{u as y,a as C,b as f,c as k,h as A,d as F,n as I}from"./profile-errors-CqflLCzu.js";import{u as j}from"./use-mounted-ref-BWpQ8f91.js";function v(t){const[n,a]=x.useState(t),[r,s]=x.useState(t);return r!==t&&(s(t),a(t)),[n,a]}const D="image/png,image/jpeg,image/webp";function l({tone:t,children:n}){return e.jsx("p",{role:t==="error"?"alert":"status",className:t==="error"?"text-destructive text-xs":"text-muted-foreground text-xs",children:n})}function U({member:t}){const n=S(t),a=x.useRef(null),r=y(),s=C();function c(i){const o=i==null?void 0:i[0];o&&(r.mutate({file:o}),a.current&&(a.current.value=""))}return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{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(E,{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:a,type:"file",accept:D,className:"hidden","data-testid":"profile-photo-input",onChange:i=>c(i.target.files)}),e.jsx(d,{size:"sm",variant:"outline",disabled:r.isPending,onClick:()=>{var i;return(i=a.current)==null?void 0:i.click()},children:t.imageUrl?"Change photo":"Upload a photo"}),t.imageUrl&&e.jsx(d,{size:"sm",variant:"ghost",disabled:s.isPending,onClick:()=>s.mutate(),children:"Remove"})]})]})}),r.isError&&e.jsx(l,{tone:"error",children:f(r.error)}),s.isError&&e.jsx(l,{tone:"error",children:f(s.error)})]})})}function H({member:t}){const n=j(),a=F({isShownInline:()=>n.current}),r=t.displayName===p?"":t.displayName,[s,c]=v(r),i=b(t),o=s.trim().length>0&&s.trim()!==r,N=s.trim().length>0&&(o||i!==null);return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{label:"Display name",description:i?`${i}. Save it to make it yours.`:"What DorkOS calls you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{value:s,maxLength:80,"aria-label":"Display name",placeholder:p,onChange:P=>c(P.target.value)}),e.jsx(d,{size:"sm",disabled:!N||a.isPending,onClick:()=>a.mutate(s.trim()),children:"Save"})]})}),a.isError&&e.jsx(l,{tone:"error",children:I(a.error)}),a.isSuccess&&s.trim()===a.variables&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function w({member:t}){var i;const n=j(),a=k({isShownInline:()=>n.current}),[r,s]=v(t.handle??""),c=r.trim()!==(t.handle??"");return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{label:"Handle",description:"What others type after @ to reach you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{value:r,maxLength:64,placeholder:"yourname","aria-label":"Handle",onChange:o=>s(o.target.value)}),e.jsx(d,{size:"sm",disabled:!c||a.isPending,onClick:()=>a.mutate({authorId:t.id,handle:r.trim()}),children:"Save"})]})}),a.isError&&e.jsx(l,{tone:"error",children:A(a.error,r.trim())}),a.isSuccess&&r.trim()===((i=a.variables)==null?void 0:i.handle)&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function z({member:t}){var n,a;return e.jsx(u,{children:e.jsx(h,{children:e.jsx(m,{label:"Email",description:(n=t.person)!=null&&n.email?"From your sign-in. Change it in Settings › Login & security.":"No login on this machine. Turn one on in Settings › Login & security.",orientation:"vertical",children:e.jsx(g,{readOnly:!0,"aria-label":"Email",value:((a=t.person)==null?void 0:a.email)??"",placeholder:"No email on this machine",className:"text-muted-foreground"})})})})}export{l as F,H as P,w as a,U as b,z as c,v as u};
1
+ import{r as x,t as S,j as e,bm as u,bn as h,bo as m,g as E,B as d,I as g,bp as p,bq as b}from"./index-DxTOTFWT.js";import{u as y,a as C,b as f,c as k,h as A,d as F,n as I}from"./profile-errors-DyrpY2ry.js";import{u as j}from"./use-mounted-ref-Bs5osknq.js";function v(t){const[n,a]=x.useState(t),[r,s]=x.useState(t);return r!==t&&(s(t),a(t)),[n,a]}const D="image/png,image/jpeg,image/webp";function l({tone:t,children:n}){return e.jsx("p",{role:t==="error"?"alert":"status",className:t==="error"?"text-destructive text-xs":"text-muted-foreground text-xs",children:n})}function U({member:t}){const n=S(t),a=x.useRef(null),r=y(),s=C();function c(i){const o=i==null?void 0:i[0];o&&(r.mutate({file:o}),a.current&&(a.current.value=""))}return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{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(E,{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:a,type:"file",accept:D,className:"hidden","data-testid":"profile-photo-input",onChange:i=>c(i.target.files)}),e.jsx(d,{size:"sm",variant:"outline",disabled:r.isPending,onClick:()=>{var i;return(i=a.current)==null?void 0:i.click()},children:t.imageUrl?"Change photo":"Upload a photo"}),t.imageUrl&&e.jsx(d,{size:"sm",variant:"ghost",disabled:s.isPending,onClick:()=>s.mutate(),children:"Remove"})]})]})}),r.isError&&e.jsx(l,{tone:"error",children:f(r.error)}),s.isError&&e.jsx(l,{tone:"error",children:f(s.error)})]})})}function H({member:t}){const n=j(),a=F({isShownInline:()=>n.current}),r=t.displayName===p?"":t.displayName,[s,c]=v(r),i=b(t),o=s.trim().length>0&&s.trim()!==r,N=s.trim().length>0&&(o||i!==null);return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{label:"Display name",description:i?`${i}. Save it to make it yours.`:"What DorkOS calls you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{value:s,maxLength:80,"aria-label":"Display name",placeholder:p,onChange:P=>c(P.target.value)}),e.jsx(d,{size:"sm",disabled:!N||a.isPending,onClick:()=>a.mutate(s.trim()),children:"Save"})]})}),a.isError&&e.jsx(l,{tone:"error",children:I(a.error)}),a.isSuccess&&s.trim()===a.variables&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function w({member:t}){var i;const n=j(),a=k({isShownInline:()=>n.current}),[r,s]=v(t.handle??""),c=r.trim()!==(t.handle??"");return e.jsx(u,{children:e.jsxs(h,{className:"space-y-3",children:[e.jsx(m,{label:"Handle",description:"What others type after @ to reach you.",orientation:"vertical",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(g,{value:r,maxLength:64,placeholder:"yourname","aria-label":"Handle",onChange:o=>s(o.target.value)}),e.jsx(d,{size:"sm",disabled:!c||a.isPending,onClick:()=>a.mutate({authorId:t.id,handle:r.trim()}),children:"Save"})]})}),a.isError&&e.jsx(l,{tone:"error",children:A(a.error,r.trim())}),a.isSuccess&&r.trim()===((i=a.variables)==null?void 0:i.handle)&&e.jsx(l,{tone:"ok",children:"Saved."})]})})}function z({member:t}){var n,a;return e.jsx(u,{children:e.jsx(h,{children:e.jsx(m,{label:"Email",description:(n=t.person)!=null&&n.email?"From your sign-in. Change it in Settings › Login & security.":"No login on this machine. Turn one on in Settings › Login & security.",orientation:"vertical",children:e.jsx(g,{readOnly:!0,"aria-label":"Email",value:((a=t.person)==null?void 0:a.email)??"",placeholder:"No email on this machine",className:"text-muted-foreground"})})})})}export{l as F,H as P,w as a,U as b,z as c,v as u};
@@ -1 +1 @@
1
- import{r as f,j as t,bm as D,bn as R,bo as E,dW as _,dX as H,dY as M,dZ as Z,d_ as A,Q as V,I as v,B as P,L as Y}from"./index-CdKpQ1hI.js";import{F as j,b as B,P as K,a as $,c as G}from"./ProfileFields-BCfMzNcT.js";import{u as I,P as Q,b as X}from"./ProfileRolePicker-f0FKXLtu.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(r=>n.has(r))}function q(){const{roles:e,isLoading:s,saveRoles:n}=I(),[r,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(r).then(()=>{u("idle"),m(r)}).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:r,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(r,x)&&t.jsx(j,{tone:"ok",children:"Saved."})]})})}const J=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 r of te(s).formatToParts(new Date(e)))n[r.type]=r.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 ae(e,s,n,r,i){const l=se(r),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 re(e,s,n){const[r,i,l]=e.split("-").map(Number);return new Date(ae(r??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 r=e??X()??ee(),i=s??J;return{timezone:r,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),r):""}}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:re(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:r,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);!r&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=a=>d(c=>({...c,...a})),W=a=>g({days:o.days.includes(a)?o.days.filter(c=>c!==a):[...o.days,a]}),L=()=>{if(p)return;h("saving");const a=o;i({timezone:a.timezone,workingHours:{days:[...a.days].sort((c,S)=>c-S),start:a.start,end:a.end},away:ce(a,u,n)}).then(()=>{h("idle"),C(null),O(a)}).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(_,{value:o.timezone,onValueChange:a=>g({timezone:a}),children:[t.jsx(H,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(M,{})}),t.jsx(Z,{children:le(o.timezone).map(a=>t.jsx(A,{value:a,responsive:!1,children:a.replace(/_/g," ")},a))})]})]}),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:a,short:c,name:S})=>{const T=o.days.includes(a);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>W(a),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},a)})})]}),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:a=>g({start:a.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:a=>g({end:a.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:a=>g({awayUntil:a.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:r||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(B,{member:e}),t.jsx(K,{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=Y(),s=(n=e.data)==null?void 0:n.members.find(r=>r.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
+ import{r as f,j as t,bm as D,bn as R,bo as E,dY as _,dZ as H,d_ as M,d$ as Z,e0 as A,Q as V,I as v,B as P,L as Y}from"./index-DxTOTFWT.js";import{F as j,b as $,P as B,a as K,c as G}from"./ProfileFields-8fFud5gT.js";import{u as I,P as Q,b as q}from"./ProfileRolePicker-C8hpW08c.js";function U(e,s){if(e.length!==s.length)return!1;const n=new Set(s);return e.every(r=>n.has(r))}function J(){const{roles:e,isLoading:s,saveRoles:n}=I(),[r,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(r).then(()=>{u("idle"),m(r)}).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:r,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(r,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 r of te(s).formatToParts(new Date(e)))n[r.type]=r.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 ae(e,s,n,r,i){const l=se(r),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 re(e,s,n){const[r,i,l]=e.split("-").map(Number);return new Date(ae(r??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 r=e??q()??ee(),i=s??X;return{timezone:r,days:[...i.days],start:i.start,end:i.end,awayUntil:n!=null&&n.until?oe(new Date(n.until),r):""}}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:re(e.awayUntil,"00:00",e.timezone).toISOString()}:null}function me(){const{timezone:e,workingHours:s,away:n,isLoading:r,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);!r&&!b(u,l)&&(x(l),d(l));const p=ue(o),g=a=>d(c=>({...c,...a})),L=a=>g({days:o.days.includes(a)?o.days.filter(c=>c!==a):[...o.days,a]}),W=()=>{if(p)return;h("saving");const a=o;i({timezone:a.timezone,workingHours:{days:[...a.days].sort((c,S)=>c-S),start:a.start,end:a.end},away:ce(a,u,n)}).then(()=>{h("idle"),C(null),O(a)}).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(_,{value:o.timezone,onValueChange:a=>g({timezone:a}),children:[t.jsx(H,{id:"profile-timezone",className:"h-8 text-sm",responsive:!1,children:t.jsx(M,{})}),t.jsx(Z,{children:le(o.timezone).map(a=>t.jsx(A,{value:a,responsive:!1,children:a.replace(/_/g," ")},a))})]})]}),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:a,short:c,name:S})=>{const T=o.days.includes(a);return t.jsx("button",{type:"button","aria-label":S,"aria-pressed":T,onClick:()=>L(a),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},a)})})]}),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:a=>g({start:a.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:a=>g({end:a.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:a=>g({awayUntil:a.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:W,disabled:r||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($,{member:e}),t.jsx(B,{member:e}),t.jsx(K,{member:e}),t.jsx(G,{member:e}),t.jsx(J,{}),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=Y(),s=(n=e.data)==null?void 0:n.members.find(r=>r.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{a8 as O,aa as E,a9 as S,aA as h,ab as j,az as D,ei as T,r as b,j as l,Q as z,I as q,B as k}from"./index-CdKpQ1hI.js";function B(){var a,d,c,m,g,p;const r=O(),s=E(),{data:e,isLoading:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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 G(){const r=O(),s=E(),{data:e,isSuccess:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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 A=10,N=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),I=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=A,P=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},L=()=>{const t=p.trim().slice(0,N);if(!t)return;const n=H(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<A&&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)}),I.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:N,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,G as a,K as b,B as u};
1
+ import{a8 as O,aa as E,a9 as S,aA as h,ab as j,az as D,ek as T,r as b,j as l,Q as z,I as q,B as k}from"./index-DxTOTFWT.js";function B(){var a,d,c,m,g,p;const r=O(),s=E(),{data:e,isLoading:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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 G(){const r=O(),s=E(),{data:e,isSuccess:o}=S({queryKey:h.current(),queryFn:()=>r.getConfig(),staleTime:T}),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 A=10,N=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),I=r.filter(t=>!y.some(n=>n.id===t)),f=r.length>=A,P=t=>{v(r,t)?s(r.filter(n=>n!==t)):f||s([...r,t])},L=()=>{const t=p.trim().slice(0,N);if(!t)return;const n=H(t),R=n&&y.some(_=>_.id===n)?n:t;!v(r,R)&&r.length<A&&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)}),I.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:N,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,G as a,K as b,B as u};
@@ -1 +1 @@
1
- import{j as e,W as c,aT as l,Q as i}from"./index-CdKpQ1hI.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
+ import{j as e,W as c,aT as l,Q as i}from"./index-DxTOTFWT.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 O,L as P,j as e,e as D,N as _,O as U,Q as C,t as z,g as F,R as M,T as Y}from"./index-CdKpQ1hI.js";import{u as q}from"./use-mounted-ref-BWpQ8f91.js";const A="REPORTS_TO_CYCLE",B="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function H({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(Y,"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(M,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function W({member:a}){var y,R;const d=q(),i=g.useRef(null),p=g.useId(),x=g.useId(),{agent:c,isPending:n,isSaving:h,error:u,update:b}=O(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(D,{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()},T=m.filter(t=>t.kind==="person"),S=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(B,"px-1.5"),children:t}),r.map(o=>e.jsx(H,{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,T),w("Agents",x,S)]}),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{W as ReportsToPopover};
1
+ import{r as g,b as O,L as P,j as e,e as D,N as _,O as U,Q as C,t as z,g as F,R as M,T as Y}from"./index-DxTOTFWT.js";import{u as q}from"./use-mounted-ref-Bs5osknq.js";const A="REPORTS_TO_CYCLE",B="text-muted-foreground text-3xs font-medium tracking-wider uppercase";function H({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(Y,"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(M,{"aria-hidden":!0,className:"size-3.5 shrink-0"})]})}function W({member:a}){var y,R;const d=q(),i=g.useRef(null),p=g.useId(),x=g.useId(),{agent:c,isPending:n,isSaving:h,error:u,update:b}=O(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(D,{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()},T=m.filter(t=>t.kind==="person"),S=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(B,"px-1.5"),children:t}),r.map(o=>e.jsx(H,{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,T),w("Agents",x,S)]}),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{W as ReportsToPopover};