dorkos 0.132.0 → 0.134.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 (336) hide show
  1. package/dist/bin/cli.js +545 -144
  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-Co7dVF9Z.js → AboutPage-zOZ0j1a0.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-BrTkXZ6h.js → ActivityErrorState-BlHkTJeC.js} +1 -1
  6. package/dist/client/assets/{ActivityPage-Vk3zC2wX.js → ActivityPage-LCOV7KDT.js} +1 -1
  7. package/dist/client/assets/{ActivityRow-D_zqfTtI.js → ActivityRow-CvDae84E.js} +1 -1
  8. package/dist/client/assets/{AdapterIcon-Ba90gZtO.js → AdapterIcon-Dm5QP8_9.js} +1 -1
  9. package/dist/client/assets/{AdapterSetupWizard-CzlKjgS0.js → AdapterSetupWizard-CNga-lEN.js} +1 -1
  10. package/dist/client/assets/{AgentOptionRow-YsNMoqxA.js → AgentOptionRow-CHb4ifHN.js} +1 -1
  11. package/dist/client/assets/{AgentPicker-Chtkpz5v.js → AgentPicker-B8WFWr7p.js} +1 -1
  12. package/dist/client/assets/{AgentRequestCard-BSvTh8P0.js → AgentRequestCard-Cnhi_1sr.js} +3 -3
  13. package/dist/client/assets/{AppearancePage-DQXsbxwz.js → AppearancePage-BI5qdQoW.js} +1 -1
  14. package/dist/client/assets/{ApplyToOverridesDialog-Dz4dRYKs.js → ApplyToOverridesDialog-gSHV8ggp.js} +1 -1
  15. package/dist/client/assets/{AttentionSignalRow-D9Gs4fQW.js → AttentionSignalRow-QgzOBKxa.js} +1 -1
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-frMjE1fG.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-Ck8dc5X4.js} +3 -3
  17. package/dist/client/assets/{BindingDialog-CMbJI0MX.js → BindingDialog-DX1N_tTX.js} +1 -1
  18. package/dist/client/assets/{BlintzCanvas-Dz8rAsfT.js → BlintzCanvas-FqS5vfnA.js} +3 -3
  19. package/dist/client/assets/{CanvasCsvContent-FMSGU_ae.js → CanvasCsvContent-B9h8JQsV.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-BXo8hS_n.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-BhAho9NF.js +2 -0
  22. package/dist/client/assets/{ChannelComposer-EZk2JgmU.js → ChannelComposer-DUKyoCYz.js} +5 -5
  23. package/dist/client/assets/{ChatAppsOff-CM043XGQ.js → ChatAppsOff-hxeSExhA.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorDiff-CCnDdKmg.js → CodeMirrorDiff-BoDEtyYj.js} +1 -1
  25. package/dist/client/assets/{CodeMirrorEditor-Ct5GtLSd.js → CodeMirrorEditor-CU7h0emU.js} +1 -1
  26. package/dist/client/assets/{ComputerResourceView-dXV2M5eB.js → ComputerResourceView-Dd4Kedxf.js} +1 -1
  27. package/dist/client/assets/{ComputerViewer-4Aq0_cCL.js → ComputerViewer-CssfoCBB.js} +1 -1
  28. package/dist/client/assets/{ConnectionAccessLists-DfIlofzc.js → ConnectionAccessLists-2qFBRKpv.js} +1 -1
  29. package/dist/client/assets/{ConnectionsPage-Ck4qQt1-.js → ConnectionsPage-CPyrw58B.js} +1 -1
  30. package/dist/client/assets/{ConventionPage-z4phQYn0.js → ConventionPage-B2MERyNx.js} +2 -2
  31. package/dist/client/assets/{ExtensionPageRoute-5chyBxxz.js → ExtensionPageRoute-7x-7Ad0_.js} +1 -1
  32. package/dist/client/assets/{FeatureDisabledState-DrNY_0RT.js → FeatureDisabledState-DsbRcnZ6.js} +1 -1
  33. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BeWxYbjO.js → FloatingTanStackRouterDevtools-CqogiFob-BReszru7.js} +1 -1
  34. package/dist/client/assets/{ForwardConsentHost-BVh663l5.js → ForwardConsentHost-DOwU-xQ9.js} +1 -1
  35. package/dist/client/assets/HandlePage-B7fNgSTl.js +1 -0
  36. package/dist/client/assets/HeartbeatPage-0qi56iQb.js +1 -0
  37. package/dist/client/assets/{KeyEntry-Z5hKKbef.js → KeyEntry-uKZG5d2z.js} +1 -1
  38. package/dist/client/assets/{LexicalField-C6xJGRPF.js → LexicalField-CKc8eUK3.js} +2 -2
  39. package/dist/client/assets/{ManagesPage-CgicR4Kd.js → ManagesPage-DWVLpjw2.js} +1 -1
  40. package/dist/client/assets/{Marketplace-vLgSIgdn.js → Marketplace-VBnmDEQE.js} +4 -4
  41. package/dist/client/assets/{MarketplaceSourcesView-Dth8Z9u3.js → MarketplaceSourcesView-BRuo8wIH.js} +1 -1
  42. package/dist/client/assets/{McpAppFrame-DAPJUxUi.js → McpAppFrame-IfamHBcy.js} +1 -1
  43. package/dist/client/assets/{McpSigninBody-D4j1GIhT.js → McpSigninBody-VmuxAjoo.js} +1 -1
  44. package/dist/client/assets/{Model3dViewer-BqErc378.js → Model3dViewer-CT4aYUpn.js} +1 -1
  45. package/dist/client/assets/NamePage-CFRvBLJ8.js +1 -0
  46. package/dist/client/assets/NewDirectMessageMenu-BZFyclIS.js +1 -0
  47. package/dist/client/assets/{NotificationsPage-DsO88sso.js → NotificationsPage-DMJf-hq3.js} +1 -1
  48. package/dist/client/assets/{OpenMeshSwitch-Bv623x0o.js → OpenMeshSwitch-DltP6-54.js} +1 -1
  49. package/dist/client/assets/{OperatorIdentityForm-C1knkmdh.js → OperatorIdentityForm-C8oS_fQG.js} +1 -1
  50. package/dist/client/assets/PermissionHistory-BAe31Nl3.js +1 -0
  51. package/dist/client/assets/{PermissionsPage-C74Pvkwc.js → PermissionsPage-CqvpcXTJ.js} +1 -1
  52. package/dist/client/assets/{PersonalityPopover-CD0qi79s.js → PersonalityPopover-D8l_Hfc1.js} +1 -1
  53. package/dist/client/assets/PhotoPage-DTl81tTW.js +1 -0
  54. package/dist/client/assets/{PreviewRefusedNotice-BtTsn6IU.js → PreviewRefusedNotice-DZh7zTEt.js} +1 -1
  55. package/dist/client/assets/{ProfileFields-qnjDsdIB.js → ProfileFields-T1f833SK.js} +1 -1
  56. package/dist/client/assets/{ProfilePanelContainer-B01W49_v.js → ProfilePanelContainer-BSbE5rqM.js} +1 -1
  57. package/dist/client/assets/{ProfileRolePicker-LcLX20fO.js → ProfileRolePicker-CpAhjq-e.js} +1 -1
  58. package/dist/client/assets/{PromptSuggestionChips-Cxa-xTMn.js → PromptSuggestionChips-BGZ3HP31.js} +1 -1
  59. package/dist/client/assets/{ReportsToPopover-ukRxHNsk.js → ReportsToPopover-DfmvDL7E.js} +1 -1
  60. package/dist/client/assets/{RoomSurface-CwlU4Lns.js → RoomSurface-DCYXQ79N.js} +1 -1
  61. package/dist/client/assets/{RoomsPage-CRJ7tbt0.js → RoomsPage-DTMTTWEf.js} +1 -1
  62. package/dist/client/assets/{RunsOnPopover-Bn1F_tCT.js → RunsOnPopover-CjJiJgly.js} +1 -1
  63. package/dist/client/assets/{RuntimeConnectFlow-Ddm_TBWI.js → RuntimeConnectFlow-Dinsb9em.js} +1 -1
  64. package/dist/client/assets/{RuntimeSetupDialog-BcDt-BYK.js → RuntimeSetupDialog-UhsfZRye.js} +1 -1
  65. package/dist/client/assets/{SeenDevices-mpu0OgjB.js → SeenDevices-CuXXI7Jv.js} +3 -3
  66. package/dist/client/assets/{SessionsPage-Dp_iQdpc.js → SessionsPage-Cn4rUeyL.js} +1 -1
  67. package/dist/client/assets/{SettingsDialog-TNI6sYo5.js → SettingsDialog-CZrhYejc.js} +2 -2
  68. package/dist/client/assets/{SkillsPage-k-7ycbOg.js → SkillsPage-CoanF7Jz.js} +1 -1
  69. package/dist/client/assets/{TaskDialogWrapper-Bfp5pa_r.js → TaskDialogWrapper-CU4PkcGk.js} +1 -1
  70. package/dist/client/assets/TasksEmptyState-lWVZXYPS.js +3 -0
  71. package/dist/client/assets/{TasksPage-BRVvjSR1.js → TasksPage-BPmiut-D.js} +1 -1
  72. package/dist/client/assets/{TeamComputerEntry-RQBXj6_l.js → TeamComputerEntry-2RKJhINy.js} +1 -1
  73. package/dist/client/assets/TodoPromiseList-iODTn1_b.js +1 -0
  74. package/dist/client/assets/TodoPromisesPage-BCm38YVu.js +1 -0
  75. package/dist/client/assets/{ToolsPage-D1seB8vW.js → ToolsPage-Bboa9crU.js} +2 -2
  76. package/dist/client/assets/{TopologyGraph-DdWrS7dp.js → TopologyGraph-Dw_sLFBL.js} +1 -1
  77. package/dist/client/assets/{TourHost-DmcHWh9X.js → TourHost-BUV9rMNn.js} +1 -1
  78. package/dist/client/assets/{UnlinkDialog-FQzgYxPM.js → UnlinkDialog-B7lL7sxN.js} +1 -1
  79. package/dist/client/assets/{UnreadDivider-DPMhdEbw.js → UnreadDivider-DCB47jhk.js} +1 -1
  80. package/dist/client/assets/{WidgetErrorCard-B477vOv2.js → WidgetErrorCard-D14BNvfm.js} +2 -2
  81. package/dist/client/assets/{WithheldExtensionsNotice-BQnkJvgb.js → WithheldExtensionsNotice-I0VwWxDY.js} +1 -1
  82. package/dist/client/assets/{WorkQueuePage-CwlR32Dy.js → WorkQueuePage-wVj3wlat.js} +1 -1
  83. package/dist/client/assets/{WorkView-J0V1k1Q7.js → WorkView-MSsuFZVO.js} +2 -2
  84. package/dist/client/assets/{_shell-B8mHdyV6.js → _shell-Bp1Mn6YU.js} +4 -4
  85. package/dist/client/assets/{_shell._home-CadWLlSU.js → _shell._home-CylH7Gjr.js} +1 -1
  86. package/dist/client/assets/{_shell._home.activity-Cmy3lakH.js → _shell._home.activity-BABzsE_Y.js} +1 -1
  87. package/dist/client/assets/_shell._home.index-BWXNHCGe.js +3 -0
  88. package/dist/client/assets/{_shell._home.tasks-4Vkj6L-V.js → _shell._home.tasks-BJg6t5SW.js} +1 -1
  89. package/dist/client/assets/{_shell._home.workspaces-fYlBcaoi.js → _shell._home.workspaces-B3LBf9vr.js} +1 -1
  90. package/dist/client/assets/{_shell.channels-nErO_7xf.js → _shell.channels-C0xYFINv.js} +2 -2
  91. package/dist/client/assets/_shell.connections-73FPamLr.js +6 -0
  92. package/dist/client/assets/{_shell.feedback-requests-DJxcMS1O.js → _shell.feedback-requests-BYYmQE_b.js} +1 -1
  93. package/dist/client/assets/_shell.marketplace-CiBixBHr.js +1 -0
  94. package/dist/client/assets/_shell.marketplace_.sources-DPUWEdt6.js +1 -0
  95. package/dist/client/assets/_shell.session-CJhLuYyA.js +1 -0
  96. package/dist/client/assets/{_shell.team-CXbQysNY.js → _shell.team-BbulfYAQ.js} +3 -3
  97. package/dist/client/assets/_shell.threads-CRFlslhF.js +1 -0
  98. package/dist/client/assets/_shell.todos-CmwRh6jX.js +6 -0
  99. package/dist/client/assets/_shell.x._extensionId-DdKU91-V.js +1 -0
  100. package/dist/client/assets/_shell.x._extensionId_._-DdKU91-V.js +1 -0
  101. package/dist/client/assets/{abnfDiagram-WEYOIA3C-C4khI9rY.js → abnfDiagram-WEYOIA3C-CF3eRhtw.js} +1 -1
  102. package/dist/client/assets/{access-copy-w5gryYsO.js → access-copy-EuKlRWLG.js} +1 -1
  103. package/dist/client/assets/{arc-fvrOAWql.js → arc-BqnZif1q.js} +1 -1
  104. package/dist/client/assets/{architectureDiagram-ZHVYKT53-CNH5Fhq_.js → architectureDiagram-ZHVYKT53-CQytXLkh.js} +1 -1
  105. package/dist/client/assets/{banner-CBw5pFjQ.js → banner-nfkn2OLZ.js} +1 -1
  106. package/dist/client/assets/{blockDiagram-RJAE7QA3-BxP4ZQri.js → blockDiagram-RJAE7QA3-CXieJU3q.js} +1 -1
  107. package/dist/client/assets/{c4Diagram-XDPPPE54-BhBYlCWz.js → c4Diagram-XDPPPE54-BPmgfFrI.js} +1 -1
  108. package/dist/client/assets/channel-BOMQJ9aR.js +1 -0
  109. package/dist/client/assets/{chunk-2E7WHVMD-COA0yYP4.js → chunk-2E7WHVMD-BtumkVCk.js} +1 -1
  110. package/dist/client/assets/{chunk-2Q5K7J3B-BbmrmCrP.js → chunk-2Q5K7J3B-BUsPKn6-.js} +1 -1
  111. package/dist/client/assets/{chunk-4EMNKR2T-CzA2mZv9.js → chunk-4EMNKR2T-CuRou8Oa.js} +1 -1
  112. package/dist/client/assets/{chunk-55XCU76K-DJ2x-ilD.js → chunk-55XCU76K-CafKfo9G.js} +1 -1
  113. package/dist/client/assets/{chunk-5VM5RSS4-BxznGj8M.js → chunk-5VM5RSS4-BdemtVRg.js} +1 -1
  114. package/dist/client/assets/{chunk-JWPE2WC7-DHb10Lbd.js → chunk-JWPE2WC7-C1pKIt5Q.js} +1 -1
  115. package/dist/client/assets/{chunk-VQ5W62QI-C7cjQxzr.js → chunk-VQ5W62QI-DPIQcwQZ.js} +1 -1
  116. package/dist/client/assets/{chunk-XXDRQBXY-M7RrmKQv.js → chunk-XXDRQBXY-CDtiCG5n.js} +1 -1
  117. package/dist/client/assets/{chunk-ZCHMQSOR-BZxPNYte.js → chunk-ZCHMQSOR-DsHVvsHO.js} +2 -2
  118. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-vt1g5HlO.js → classDiagram-v2-4MYWR3UA-CNKi62Mk.js} +1 -1
  119. package/dist/client/assets/{command-DU2-hlOP.js → command-D1cWVheG.js} +1 -1
  120. package/dist/client/assets/{copy-button-BodCVufV.js → copy-button-BHHQAtAH.js} +1 -1
  121. package/dist/client/assets/{cose-bilkent-JH36ORCC-Cd27g-Yx.js → cose-bilkent-JH36ORCC-CqK8lNYm.js} +1 -1
  122. package/dist/client/assets/{cpu-BXE_D43d.js → cpu-BhPT23rn.js} +1 -1
  123. package/dist/client/assets/{cynefin-EF2NZ3EQ-BnCAgdfS.js → cynefin-EF2NZ3EQ-DUFv7wAT.js} +1 -1
  124. package/dist/client/assets/{cynefinDiagram-WF24UDRP-eIO4xQHB.js → cynefinDiagram-WF24UDRP-DprACurA.js} +1 -1
  125. package/dist/client/assets/{dagre-NK4GIZVX-Bvd_3Cqy.js → dagre-NK4GIZVX-CFCbvrTm.js} +1 -1
  126. package/dist/client/assets/{detail-row-BvEUzVxe.js → detail-row-DBa1uo_y.js} +1 -1
  127. package/dist/client/assets/{diagram-CBK3MWTC-BGqDA_bh.js → diagram-CBK3MWTC-BgRgWBNs.js} +1 -1
  128. package/dist/client/assets/{diagram-I5XIIV2D-BXhbpnrE.js → diagram-I5XIIV2D-Bvmxrku7.js} +1 -1
  129. package/dist/client/assets/{diagram-ODIL2UCW-C4hWeQZn.js → diagram-ODIL2UCW-CqzUdcUW.js} +1 -1
  130. package/dist/client/assets/{diagram-PFBEJUXE-DIEuwCdA.js → diagram-PFBEJUXE-DwXryVWl.js} +1 -1
  131. package/dist/client/assets/{diagram-RJA3I4VV-C36ghYx6.js → diagram-RJA3I4VV-DqGvHPAI.js} +1 -1
  132. package/dist/client/assets/{diagram-TYUNFSNR-CSC9FLO6.js → diagram-TYUNFSNR-GOfZ43Y3.js} +1 -1
  133. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DuOLfVHI.js → ebnfDiagram-V4P3TTPT-lF7-sW99.js} +1 -1
  134. package/dist/client/assets/{elk-QONTBCTQ-NvLhZqkG.js → elk-QONTBCTQ-Cd5kFMK6.js} +1 -1
  135. package/dist/client/assets/{empty-state-B316LEXY.js → empty-state-CHse95jw.js} +1 -1
  136. package/dist/client/assets/{erDiagram-KYQIGQAA-BcTRY9y8.js → erDiagram-KYQIGQAA-BqXJlTJO.js} +1 -1
  137. package/dist/client/assets/{execution-config-D9vIc46b.js → execution-config-U_R_H28y.js} +1 -1
  138. package/dist/client/assets/{file-C_57RCIQ.js → file-DZ6-r1A3.js} +1 -1
  139. package/dist/client/assets/{file-exclamation-point-C7C2dM_w.js → file-exclamation-point-CR6qeV6m.js} +1 -1
  140. package/dist/client/assets/{file-text-CS9s0qOe.js → file-text-4-Vc22J-.js} +1 -1
  141. package/dist/client/assets/{find-latest-widget-fence-D_FwbHep.js → find-latest-widget-fence-D61kyRv5.js} +2 -2
  142. package/dist/client/assets/{flowDiagram-IUGLLWBU-DxQ31Egh.js → flowDiagram-IUGLLWBU-C18poulN.js} +1 -1
  143. package/dist/client/assets/{form-Cf49Z6eU.js → form-B51NLChW.js} +1 -1
  144. package/dist/client/assets/{format-cron-Dlp0mfqz.js → format-cron-CrDI8dcD.js} +1 -1
  145. package/dist/client/assets/{ganttDiagram-R7GPNTJY-Bxwm173A.js → ganttDiagram-R7GPNTJY-BHa77y_O.js} +1 -1
  146. package/dist/client/assets/{git-branch-DpByNz2U.js → git-branch-CzV_Mp0H.js} +1 -1
  147. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-DH8AQ76t.js → gitGraphDiagram-PDYL7XHY-DdfDaaK5.js} +1 -1
  148. package/dist/client/assets/{graph-BGzqfhJw.js → graph-stVQph_6.js} +1 -1
  149. package/dist/client/assets/{heart-DKWg_e72.js → heart-B7rSSNjF.js} +1 -1
  150. package/dist/client/assets/{highlighted-body-KPVGNVTW-Dd_spScF.js → highlighted-body-KPVGNVTW-BDppiTvx.js} +1 -1
  151. package/dist/client/assets/{image-lightbox-BtsV24zH.js → image-lightbox-DwZmxmRU.js} +1 -1
  152. package/dist/client/assets/{image-off-Czqq8ai8.js → image-off-B65OAyEw.js} +1 -1
  153. package/dist/client/assets/index-B2JoVHek.js +1066 -0
  154. package/dist/client/assets/{index-BmckK_5Q.js → index-BC7vn8oJ.js} +1 -1
  155. package/dist/client/assets/{index-CHGNCEc4.js → index-BD0bxxdG.js} +1 -1
  156. package/dist/client/assets/{index-BapT4bjy.js → index-BJE7FpeW.js} +1 -1
  157. package/dist/client/assets/{index-CX4nMOaI.js → index-BLepK8Tm.js} +1 -1
  158. package/dist/client/assets/{index-O9UP2ojb.js → index-BNMepjWi.js} +1 -1
  159. package/dist/client/assets/{index-DGKwWSrJ.js → index-B_7AgsWu.js} +1 -1
  160. package/dist/client/assets/{index-CIokV9hG.js → index-BchQNMCW.js} +1 -1
  161. package/dist/client/assets/{index-CWBtIScD.js → index-BgKo-iME.js} +2 -2
  162. package/dist/client/assets/{index-BQulbvlk.js → index-BncKYCzR.js} +1 -1
  163. package/dist/client/assets/{index-D0k8LoLP.js → index-Bocv39Dy.js} +1 -1
  164. package/dist/client/assets/{index-MCPJOxb7.js → index-Bx9vkvgI.js} +1 -1
  165. package/dist/client/assets/{index-sbmgxCMU.js → index-ByKStnc0.js} +1 -1
  166. package/dist/client/assets/index-C2FXv0W1.js +1 -0
  167. package/dist/client/assets/index-CCRFURxg.js +1 -0
  168. package/dist/client/assets/{index-BGKWKxfR.js → index-CNXWcd0h.js} +1 -1
  169. package/dist/client/assets/index-CT9qR-37.js +1 -0
  170. package/dist/client/assets/{index-GAcHtPZc.js → index-CXbvnAWk.js} +1 -1
  171. package/dist/client/assets/{index-BhIDM_HP.js → index-CaWtXSTG.js} +1 -1
  172. package/dist/client/assets/{index-BTB5QRQx.js → index-CayDBSDe.js} +1 -1
  173. package/dist/client/assets/{index-DNkWdNSz.js → index-Ci17H_nH.js} +1 -1
  174. package/dist/client/assets/{index-DHFIAKQc.js → index-CpCaGGh0.js} +1 -1
  175. package/dist/client/assets/{index-JLySVSjV.js → index-CvLTkguu.js} +1 -1
  176. package/dist/client/assets/{index-CaYgHnra.js → index-CyTJNCti.js} +1 -1
  177. package/dist/client/assets/{index-DG-iZ_7U.js → index-CzDpDW1S.js} +1 -1
  178. package/dist/client/assets/{index-CpxbjS0M.js → index-D1FZurLO.js} +1 -1
  179. package/dist/client/assets/{index-EB7hJHJY.js → index-D5HU9MN-.js} +1 -1
  180. package/dist/client/assets/index-DBjkg_lo.css +1 -0
  181. package/dist/client/assets/{index-DQ9MUhkA.js → index-DCymAWyX.js} +1 -1
  182. package/dist/client/assets/{index-aSuMCzNN.js → index-DDPQZJQz.js} +1 -1
  183. package/dist/client/assets/{index-DwAhtrb9.js → index-DK-qQXH4.js} +1 -1
  184. package/dist/client/assets/{index-N77XDvrM.js → index-DTJV1dBd.js} +1 -1
  185. package/dist/client/assets/{index-DcUcciFs.js → index-Dhj4iWHB.js} +3 -3
  186. package/dist/client/assets/index-DxqA8BnM.js +1 -0
  187. package/dist/client/assets/{index-BxNcjL67.js → index-DzVJOMZm.js} +1 -1
  188. package/dist/client/assets/{index-GZP3iUOG.js → index-FRNKkajP.js} +1 -1
  189. package/dist/client/assets/{index-B_KMn9ji.js → index-L1Tsd-wn.js} +1 -1
  190. package/dist/client/assets/{index-DXA-11hB.js → index-QaablvAu.js} +2 -2
  191. package/dist/client/assets/{index-D2gKRr6f.js → index-SawUg2NU.js} +1 -1
  192. package/dist/client/assets/{index-Deupek6J.js → index-YObNtFmj.js} +1 -1
  193. package/dist/client/assets/{index-B401rtXR.js → index-iRuOpaV9.js} +1 -1
  194. package/dist/client/assets/{index-DOFLQqXn.js → index-ulrRTPa9.js} +1 -1
  195. package/dist/client/assets/{index-DCFKleTS.js → index-wcSHU-xr.js} +1 -1
  196. package/dist/client/assets/{index-vEujcopz.js → index-yZEr0YWk.js} +3 -3
  197. package/dist/client/assets/{index.esm-B0kiCgAP.js → index.esm-gt8tvZ7J.js} +1 -1
  198. package/dist/client/assets/{infoDiagram-MVDRKAX5-CFgHv4Dm.js → infoDiagram-MVDRKAX5-DzhnMotD.js} +1 -1
  199. package/dist/client/assets/{inline-code-B3u1dOXm.js → inline-code-rYW-kJLB.js} +1 -1
  200. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-BWRvdwNW.js → ishikawaDiagram-HPEHV2GE-CfEX5E3R.js} +1 -1
  201. package/dist/client/assets/{journeyDiagram-BOSHW7O7-6zzUqSAS.js → journeyDiagram-BOSHW7O7-oPrRia7f.js} +1 -1
  202. package/dist/client/assets/{kanban-definition-FNSA4HC5-CCCFKXnc.js → kanban-definition-FNSA4HC5-c4CFmcMa.js} +1 -1
  203. package/dist/client/assets/{layers-Dbd-86dV.js → layers-D9XZggr2.js} +1 -1
  204. package/dist/client/assets/{lightbulb-C15x7OEZ.js → lightbulb-DQBO5jSg.js} +1 -1
  205. package/dist/client/assets/{link-2-D1CRDxXB.js → link-2-CZiWX9vI.js} +1 -1
  206. package/dist/client/assets/{list-runtime-types-Cyl4h4lV.js → list-runtime-types-Dry1muZ1.js} +1 -1
  207. package/dist/client/assets/{markdown-content-C1i_dR6j.js → markdown-content-FcvkqTTS.js} +1 -1
  208. package/dist/client/assets/{mention-pill-DoQBb5VU.js → mention-pill-BxASQ-6w.js} +1 -1
  209. package/dist/client/assets/{mermaid.core-BaDCR0nn.js → mermaid.core-BqACpHu4.js} +4 -4
  210. package/dist/client/assets/{message-square-off-CwB3fRn1.js → message-square-off-SMiCYjYr.js} +1 -1
  211. package/dist/client/assets/{mindmap-definition-6OY57UG3-B6g2CNRv.js → mindmap-definition-6OY57UG3-BSYcYnyL.js} +1 -1
  212. package/dist/client/assets/{more-details-DNp6DH8i.js → more-details-D9_Bn2GL.js} +1 -1
  213. package/dist/client/assets/{owner-notice-P8INt5DW.js → owner-notice-DO2xE-1L.js} +1 -1
  214. package/dist/client/assets/{package-DHEY3aDq.js → package-DpqGENzU.js} +1 -1
  215. package/dist/client/assets/{page-container-BwHVHvGF.js → page-container-Cta3RqHd.js} +1 -1
  216. package/dist/client/assets/{pane-resize-handle-BetBV5qX.js → pane-resize-handle-BJ0XV-Zg.js} +1 -1
  217. package/dist/client/assets/{paperclip-DYgUORd3.js → paperclip-CItlLyje.js} +1 -1
  218. package/dist/client/assets/{path-input-DpN1vJO-.js → path-input-CAkVS5XR.js} +1 -1
  219. package/dist/client/assets/{pegDiagram-ECIUJNBX-Db7P43aK.js → pegDiagram-ECIUJNBX-Bnc4eqtF.js} +1 -1
  220. package/dist/client/assets/{pieDiagram-GNMPY74T-Cz1jeviu.js → pieDiagram-GNMPY74T-7gG33sSR.js} +1 -1
  221. package/dist/client/assets/{plug-C5hngNbe.js → plug-Cb8qsOxJ.js} +1 -1
  222. package/dist/client/assets/primer-trigger-BG3lb31_.js +3 -0
  223. package/dist/client/assets/{profile-errors-OMPgeYKJ.js → profile-errors-T-3VgU7E.js} +1 -1
  224. package/dist/client/assets/progress-CwpnobNW.js +1 -0
  225. package/dist/client/assets/{quadrantDiagram-D57K4MC3-PD02f4Da.js → quadrantDiagram-D57K4MC3-Dr2Z6GbA.js} +1 -1
  226. package/dist/client/assets/{query-error-state-BdmBV0DG.js → query-error-state-BV8fyXBe.js} +1 -1
  227. package/dist/client/assets/{radio-BmjH89ml.js → radio-SApjvqfy.js} +1 -1
  228. package/dist/client/assets/{railroadDiagram-Y72NRBL7-x1K1Xrsr.js → railroadDiagram-Y72NRBL7-7kfKSzWs.js} +1 -1
  229. package/dist/client/assets/{registry-3K4FIIyI.js → registry-BcpatPes.js} +4 -4
  230. package/dist/client/assets/registry-BuTvvFn6.js +1 -0
  231. package/dist/client/assets/{relay-trace-schemas-CctfRKB2.js → relay-trace-schemas-eOfnfe4X.js} +2 -2
  232. package/dist/client/assets/{repeat-CK_sumJP.js → repeat-BB0attnO.js} +1 -1
  233. package/dist/client/assets/{requirementDiagram-EQYSW5RA-BM-pntyA.js → requirementDiagram-EQYSW5RA-CmOVPT7N.js} +1 -1
  234. package/dist/client/assets/{room-files-source-CKjJxFRA.js → room-files-source-C32w3dXr.js} +1 -1
  235. package/dist/client/assets/{rotate-ccw-clock-DzVWecfL.js → rotate-ccw-clock-C1SBdbZP.js} +1 -1
  236. package/dist/client/assets/{rotate-cw-CpuoCwEK.js → rotate-cw-BTqPAMgP.js} +1 -1
  237. package/dist/client/assets/{sankeyDiagram-SY24JHO5-ByCX1rfW.js → sankeyDiagram-SY24JHO5-DFcTUSd1.js} +1 -1
  238. package/dist/client/assets/{scroll-area-BO7uDl4z.js → scroll-area-rEyYMbHG.js} +1 -1
  239. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-BPB2hLY6.js → sequenceDiagram-BLEHNHQU-BNY4ALqc.js} +1 -1
  240. package/dist/client/assets/server-BCFl_ur3.js +6 -0
  241. package/dist/client/assets/{shield-x-DknrRQrV.js → shield-x-B2nLbkhR.js} +1 -1
  242. package/dist/client/assets/{signed-in-DdaXcjzY.js → signed-in-BcxH99a5.js} +1 -1
  243. package/dist/client/assets/{sizeCapture-INFHLROL-DRe6LanJ.js → sizeCapture-INFHLROL-CuNPY5HV.js} +1 -1
  244. package/dist/client/assets/{soul-file-CPL6-cba.js → soul-file-ITCKiDY9.js} +1 -1
  245. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-DZA18t3o.js → stateDiagram-v2-A6IESKWZ-CmUdZZJs.js} +1 -1
  246. package/dist/client/assets/{swimlanes-B3ENRKFQ-DRX2o4k2.js → swimlanes-B3ENRKFQ-BmNmFgsZ.js} +1 -1
  247. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-Cd_Magxj.js +8 -0
  248. package/dist/client/assets/{table-BrvyPoEL.js → table-COZ3E1UU.js} +1 -1
  249. package/dist/client/assets/{tabs-BmbzJhKE.js → tabs-CDr3zS_2.js} +1 -1
  250. package/dist/client/assets/{timeline-definition-JXYKGLGB-BL2C4v8r.js → timeline-definition-JXYKGLGB-Cq7UTNkh.js} +1 -1
  251. package/dist/client/assets/{trust-dial-tuMHO5Ug.js → trust-dial-BsEooNiu.js} +2 -2
  252. package/dist/client/assets/{trust-posture-9cC08pk5.js → trust-posture-Dk5ctS0Q.js} +1 -1
  253. package/dist/client/assets/{unplug-B8oONuTT.js → unplug-DB0xx2bf.js} +1 -1
  254. package/dist/client/assets/{unverified-catalog-notice-ofL4eYQH.js → unverified-catalog-notice-CQoKhOjQ.js} +1 -1
  255. package/dist/client/assets/{use-bindings-DVKWBz4y.js → use-bindings-CEhDyZoj.js} +1 -1
  256. package/dist/client/assets/{use-composer-prefs-DWFqxtm6.js → use-composer-prefs-uC9mUd0f.js} +1 -1
  257. package/dist/client/assets/{use-connector-management-B_RvwV0T.js → use-connector-management-54m5ZcyP.js} +1 -1
  258. package/dist/client/assets/{use-deep-link-scroll-Cahio5D0.js → use-deep-link-scroll-C4DQRnGX.js} +1 -1
  259. package/dist/client/assets/{use-delete-binding-DHiPJq9D.js → use-delete-binding-Cr9soEn-.js} +1 -1
  260. package/dist/client/assets/{use-dev-links-Cunzy9gq.js → use-dev-links-CXGFC-N0.js} +1 -1
  261. package/dist/client/assets/{use-direct-message-panel-CPyyrU4P.js → use-direct-message-panel-BxwiNzks.js} +1 -1
  262. package/dist/client/assets/{use-external-adapter-catalog-l9RzI0W5.js → use-external-adapter-catalog-D3xkw3mY.js} +1 -1
  263. package/dist/client/assets/{use-filter-state-DKALQgO9.js → use-filter-state-N0pdU49v.js} +1 -1
  264. package/dist/client/assets/{use-full-activity-feed-B7miUwr2.js → use-full-activity-feed-COuRZq_w.js} +1 -1
  265. package/dist/client/assets/use-is-below-desktop-CgAcZ8iA.js +1 -0
  266. package/dist/client/assets/{use-mesh-topology-Y9Cdja0F.js → use-mesh-topology-BSRzCO1U.js} +1 -1
  267. package/dist/client/assets/{use-mounted-ref-Bb8zNmgI.js → use-mounted-ref-pxDiCOyS.js} +1 -1
  268. package/dist/client/assets/{use-notification-prefs-DoZgirjS.js → use-notification-prefs-6N6Y4rqG.js} +1 -1
  269. package/dist/client/assets/use-pending-read-HbJdwxw1.js +1 -0
  270. package/dist/client/assets/{use-personality-commit-CDMLIF8s.js → use-personality-commit-Dl3YK7Qd.js} +1 -1
  271. package/dist/client/assets/{use-promo-activation-XWY3OSoy.js → use-promo-activation-DXRrwLes.js} +2 -2
  272. package/dist/client/assets/{use-promo-dismissals-Bg7cJFb8.js → use-promo-dismissals-DnqiKhqW.js} +1 -1
  273. package/dist/client/assets/{use-pulse-freshness-B4nO2ugg.js → use-pulse-freshness-D9uzSgz_.js} +1 -1
  274. package/dist/client/assets/{use-room-follow-claim-CpOIUcG7.js → use-room-follow-claim-Ch6ZoOAv.js} +1 -1
  275. package/dist/client/assets/{use-room-sessions-BeiAMSkk.js → use-room-sessions-C3NpXFWY.js} +1 -1
  276. package/dist/client/assets/{use-roving-tab-list-HB0egh1C.js → use-roving-tab-list-LZku4K5R.js} +1 -1
  277. package/dist/client/assets/{use-session-canvas-Cc04zSW3.js → use-session-canvas-Bub7vCaj.js} +6 -6
  278. package/dist/client/assets/{use-status-budget-GIeJAyM1.js → use-status-budget-DrAROrOw.js} +2 -2
  279. package/dist/client/assets/{use-todos-Bq9I1_Md.js → use-todos-COW66MhB.js} +1 -1
  280. package/dist/client/assets/{use-transform-DEFDL9dO.js → use-transform-CXFCVk8z.js} +1 -1
  281. package/dist/client/assets/{use-unclaimed-chats-BzDzgx9Q.js → use-unclaimed-chats-T3kskM3T.js} +1 -1
  282. package/dist/client/assets/use-update-config-BhLEnZe5.js +1 -0
  283. package/dist/client/assets/{useMutationState-Bffa43_B.js → useMutationState-6Zu1xBsZ.js} +1 -1
  284. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-BoYu8koq.js → usecaseDiagram-WPOLBNNX-CUu-YUIY.js} +1 -1
  285. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-U4E5RDf5.js → vennDiagram-Q3Y3IDCW-CfA29THe.js} +1 -1
  286. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-DYWCkm0g.js → wardleyDiagram-IVAIDKWA-CrARcH-W.js} +1 -1
  287. package/dist/client/assets/{xychartDiagram-4URNHDU4-DMf6UlJg.js → xychartDiagram-4URNHDU4-BCVaXTG3.js} +1 -1
  288. package/dist/client/assets/{zap-BmeuEI5X.js → zap-C-pr1sst.js} +1 -1
  289. package/dist/client/index.html +2 -2
  290. package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
  291. package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
  292. package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
  293. package/dist/drizzle/20261108035027_dor3547_extension_grant_subject.sql +30 -0
  294. package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
  295. package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
  296. package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
  297. package/dist/drizzle/meta/20261108035027_snapshot.json +15121 -0
  298. package/dist/drizzle/meta/_journal.json +28 -0
  299. package/dist/server/extension-child.cjs +19 -3
  300. package/dist/server/index.js +41020 -38009
  301. package/dist/server/index.js.map +2 -2
  302. package/package.json +4 -4
  303. package/dist/client/assets/CanvasFileContent-CecxcpLI.js +0 -2
  304. package/dist/client/assets/CanvasModel3dContent-C66rrYY-.js +0 -2
  305. package/dist/client/assets/CommitmentList-BXbIFc4Y.js +0 -1
  306. package/dist/client/assets/CommitmentsPage-CMKLXfbr.js +0 -1
  307. package/dist/client/assets/HandlePage-0fA-Trcw.js +0 -1
  308. package/dist/client/assets/HeartbeatPage-CByO3lLO.js +0 -1
  309. package/dist/client/assets/NamePage-BI35-ZiO.js +0 -1
  310. package/dist/client/assets/NewDirectMessageMenu-BC7MdqUz.js +0 -1
  311. package/dist/client/assets/PermissionHistory-BaQShYqE.js +0 -1
  312. package/dist/client/assets/PhotoPage-DE7tKzAB.js +0 -1
  313. package/dist/client/assets/TasksEmptyState-BlGELISr.js +0 -3
  314. package/dist/client/assets/_shell._home.index-eR2x0FUG.js +0 -3
  315. package/dist/client/assets/_shell.connections-C9URqim3.js +0 -1
  316. package/dist/client/assets/_shell.marketplace-CNUtNewz.js +0 -1
  317. package/dist/client/assets/_shell.marketplace_.sources-Cku_p8cg.js +0 -1
  318. package/dist/client/assets/_shell.session-B990EEo5.js +0 -1
  319. package/dist/client/assets/_shell.threads-CDEyGRL3.js +0 -1
  320. package/dist/client/assets/_shell.todos-8uEPusJV.js +0 -6
  321. package/dist/client/assets/_shell.x._extensionId-DXp9Wa0V.js +0 -1
  322. package/dist/client/assets/_shell.x._extensionId_._-DXp9Wa0V.js +0 -1
  323. package/dist/client/assets/channel-splVtfTe.js +0 -1
  324. package/dist/client/assets/index-BYTLOFNS.js +0 -1061
  325. package/dist/client/assets/index-BbPg1hpf.css +0 -1
  326. package/dist/client/assets/index-CUDsA_8O.js +0 -1
  327. package/dist/client/assets/index-D6jG1-Mw.js +0 -1
  328. package/dist/client/assets/index-DOZg4xUY.js +0 -1
  329. package/dist/client/assets/index-DrbZanni.js +0 -1
  330. package/dist/client/assets/primer-trigger-Bb7X-l3r.js +0 -3
  331. package/dist/client/assets/progress-CNm_pBbE.js +0 -6
  332. package/dist/client/assets/registry-DNYPNSm5.js +0 -1
  333. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-D5hU--1Q.js +0 -8
  334. package/dist/client/assets/use-is-below-desktop-DSwl4xyH.js +0 -1
  335. package/dist/client/assets/use-pending-read-DC4hUOFi.js +0 -1
  336. package/dist/client/assets/use-update-config-Bt7fMLqS.js +0 -1
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/server/index.js.map
3
- size: 67360587 bytes
4
- sha256: 51a6b2b2b0c150036bf0b0d023b941d4f24eb89d235072f3ce1ed656e87ba265
3
+ size: 67652697 bytes
4
+ sha256: 2d19d34e734803c0207755afbd37e454e62c2a5cdeaa2c0c6873e18202b2b7b2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dorkos",
3
- "version": "0.132.0",
3
+ "version": "0.134.0",
4
4
  "description": "You, multiplied. Build and run your business with an agent team. Your agents join your team chat, take on real work, and build the tools your company runs on.",
5
5
  "license": "MIT",
6
6
  "author": "Dorian Collier",
@@ -85,11 +85,11 @@
85
85
  "vitest": "^4.1.11",
86
86
  "@dorkos/browser": "0.0.0",
87
87
  "@dorkos/db": "0.0.0",
88
- "@dorkos/harness": "0.0.0",
89
88
  "@dorkos/eslint-config": "0.0.0",
90
- "@dorkos/marketplace": "0.0.0",
91
- "@dorkos/typescript-config": "0.0.0",
89
+ "@dorkos/harness": "0.0.0",
92
90
  "@dorkos/server": "0.0.0",
91
+ "@dorkos/typescript-config": "0.0.0",
92
+ "@dorkos/marketplace": "0.0.0",
93
93
  "@dorkos/shared": "0.0.0",
94
94
  "@dorkos/client": "0.0.0"
95
95
  },
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CodeMirrorEditor-Ct5GtLSd.js","assets/index-BYTLOFNS.js","assets/index-BbPg1hpf.css","assets/index-DwAhtrb9.js","assets/index-vEujcopz.js","assets/BlintzCanvas-Dz8rAsfT.js","assets/index-JLySVSjV.js","assets/BlintzCanvas-DCXOV_yN.css"])))=>i.map(i=>d[i]);
2
- import{r as a,aZ as z,hh as ce,j as t,G as O,ge as oe,gf as le,B as D,gg as ue,gh as de,gi as Z,hi as fe,dn as he,dp as pe,J as me,gv as ve,dq as xe,a7 as ge,hj as be,a_ as ee,a5 as ye,hk as je,a6 as Ce}from"./index-BYTLOFNS.js";import{u as ke,a as we,b as Re}from"./use-session-canvas-Cc04zSW3.js";import{R as Te}from"./rotate-cw-CpuoCwEK.js";import"./query-keys-DeYqUDia.js";import"./index.esm-B0kiCgAP.js";import"./WidgetErrorCard-B477vOv2.js";import"./index-D0k8LoLP.js";import"./progress-CNm_pBbE.js";import"./markdown-content-C1i_dR6j.js";import"./table-BrvyPoEL.js";import"./zap-BmeuEI5X.js";import"./package-DHEY3aDq.js";import"./heart-DKWg_e72.js";import"./git-branch-DpByNz2U.js";import"./file-text-CS9s0qOe.js";import"./file-C_57RCIQ.js";import"./McpAppFrame-DAPJUxUi.js";import"./more-details-DNp6DH8i.js";function B(e,r){return["canvas-file",e,r]}function Ne({documentId:e,sourcePath:r,binding:d,save:n,draftRef:o,revisionRef:s,finishAttemptRef:C,timerRef:y,finalSaveRef:b,invalidateConfirmedFile:p}){const x=a.useRef({binding:d,save:n,invalidateConfirmedFile:p}),_=a.useRef(null),f=a.useRef(null);return a.useLayoutEffect(()=>{x.current={binding:d,save:n,invalidateConfirmedFile:p}}),a.useLayoutEffect(()=>{const w=z.getState().openDocuments.find(m=>m.id===e);if(!w||typeof w.openedAt!="number")return;const R=ce(e,w.openedAt,r,{required:()=>!!x.current.binding,current:()=>{const m=f.current;return!!m&&m.revision===s.current&&m.attempt===C.current&&m.binding===x.current.binding&&m.save===x.current.save&&m.binding.current()},invalidateConfirmedFile:()=>x.current.invalidateConfirmedFile(),prepare:async()=>{var c;f.current=null;const{binding:m,save:T}=x.current;if(!(m!=null&&m.current()))return!1;y.current&&(clearTimeout(y.current),y.current=null);const F=o.current,g=s.current,l=++C.current,i=await T(F);return i.status!=="changed"&&i.status!=="no_op"||i.confirmed.content!==F||s.current!==g||C.current!==l||x.current.binding!==m||x.current.save!==T||!m.current()?!1:((c=b.current)==null||c.cancel(),b.current=null,f.current={revision:g,attempt:l,binding:m,save:T},!0)}});return _.current=R,()=>R.retire()},[e,r,o,s,C,y,b]),_}function M(e){return e.status==="refused"||e.status==="local_uncertain"?e.status:"unavailable"}function _e(e,r,d){var l;const n=a.useRef(e),o=a.useRef(null),s=a.useRef(null),[C,y]=a.useState({identity:e.identity,phase:"pending",busy:!1});a.useLayoutEffect(()=>{n.current=e},[e]);const b=a.useCallback((i,c)=>{o.current===i&&n.current.identity===i&&n.current.current()&&y(u=>({identity:i,...c,historical:c.historical??(u.identity===i?u.historical:void 0)}))},[]),p=a.useCallback(i=>{o.current!==i||n.current.identity!==i||y(c=>c.identity===i?{...c,phase:"unavailable",busy:!1}:{identity:i,phase:"unavailable",busy:!1})},[]),x=e.identity,_=e.supported;a.useLayoutEffect(()=>{const i=n.current;s.current=null,o.current=x;let c=!1;return _&&r==="ready"&&i.discover().then(u=>{c||(u.status==="observed"?b(x,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(x,{phase:M(u),busy:!1}):p(x))}),()=>{c=!0,s.current=null,o.current===x&&(o.current=null)}},[x,_,r,d,b,p]);const f=C.identity===e.identity?C:void 0,w=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return;s.current=null,y(j=>({identity:c,phase:"pending",busy:!0,historical:j.identity===c?j.historical:void 0}));const u=await i.discover(!0);u.status==="observed"?b(c,{phase:"ready",discovery:u.value,busy:!1}):u.status!=="idle"?b(c,{phase:M(u),busy:!1}):p(c)},[b,p]),R=a.useCallback(async i=>{const c=n.current,u=c.identity;if(o.current!==u||!c.current())return;s.current=null,y(h=>({identity:u,phase:"pending",busy:!0,discovery:h.identity===u?h.discovery:void 0,historical:h.identity===u?h.historical:void 0}));const j=await c.recover(i);j.status==="observed"?b(u,{phase:"ready",discovery:j.value.discovery,historical:j.value.result.entry,busy:!1}):j.status!=="idle"?b(u,{phase:M(j),busy:!1}):p(u)},[b,p]),m=a.useCallback(async()=>{const i=n.current,c=i.identity;if(o.current!==c||!i.current())return{status:"idle"};const u={};s.current=u,y(h=>h.identity===c?{...h,phase:"pending",busy:!0}:h);const j=await i.inspectCurrent();return s.current!==u?{status:"idle"}:(s.current=null,j.status==="idle"&&p(c),o.current===c&&n.current.identity===c&&i.current()&&j.status!=="idle"&&y(h=>h.identity===c?{...h,phase:j.status==="observed"?"ready":M(j),busy:!1}:h),j)},[p]),T=e.supported&&r==="ready",F=r==="pending"?"pending":(f==null?void 0:f.phase)??"pending",g=T&&(F!=="ready"||((l=f==null?void 0:f.discovery)==null?void 0:l.admission)==="blocked");return{supported:T,phase:F,editBlocked:g,busy:(f==null?void 0:f.busy)??F==="pending",discovery:f==null?void 0:f.discovery,historical:f==null?void 0:f.historical,refresh:w,recover:R,inspectCurrent:m}}const Fe={unavailable:"Couldn’t check previous saves, so editing is off.",refused:"This file can’t be edited from this canvas."};function Pe(e){var r,d,n;return e.supported?e.phase==="unavailable"||e.phase==="refused"||e.phase==="local_uncertain"?!0:((r=e.discovery)==null?void 0:r.admission)==="blocked"||((d=e.discovery)==null?void 0:d.entries.some(o=>o.state==="review"))===!0||((n=e.historical)==null?void 0:n.state)==="receipt":!1}function X({recovery:e,editing:r,loadCurrent:d}){var o;if(e.phase==="unavailable"||e.phase==="refused")return t.jsxs(t.Fragment,{children:[t.jsx("p",{role:"alert",className:"col-start-1 row-start-1 py-1.5",children:Fe[e.phase]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",className:"col-span-2 col-start-1 row-start-2 mb-1.5 justify-self-start @md:col-span-1 @md:col-start-2 @md:row-start-1 @md:mb-0",disabled:e.busy||r,onClick:()=>void e.refresh(),children:"Check again"})]});if(e.phase==="local_uncertain")return t.jsx("p",{role:"alert",children:"Use Retry original save. Checking previous saves won’t confirm this save."});const n=e.discovery;return t.jsxs("div",{className:"space-y-1",children:[(n==null?void 0:n.admission)==="blocked"&&t.jsx("p",{role:"alert",children:"An unresolved original save blocks this file. This list may not include the blocking operation."}),(n==null?void 0:n.hasMore)&&t.jsx("p",{children:"Only the latest 25 matching saves are shown. Older evidence is omitted."}),n&&n.entries.length>0&&t.jsx(t.Fragment,{children:t.jsx("ul",{children:n.entries.map(s=>t.jsxs("li",{children:[t.jsxs("span",{children:[s.eventId,":"," ",s.state==="receipt"?"Historical save recorded":s.state==="review"?"Original save needs review":s.state==="no_op"?"Original save made no change":"Original save failed before replacement"]}),s.state==="review"&&(s.reason==="prepared_without_replacement"?t.jsx("p",{children:"This save needs manual review. These controls won’t write the file."}):t.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsx("p",{children:"The original saved replacement must be proven before its receipt can be settled."}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:e.busy||r,onClick:()=>void e.recover(s.eventId),children:"Recover original receipt"})]}))]},s.eventId))})}),(n==null?void 0:n.admission)==="blocked"&&n.entries.length===0&&t.jsx("p",{children:"No matching recent saves."}),((o=e.historical)==null?void 0:o.state)==="receipt"&&t.jsxs("div",{role:"status",className:"flex flex-wrap items-center gap-x-3 gap-y-1",children:[t.jsxs("div",{children:[t.jsx("p",{children:"Previous save confirmed. Your current draft may differ."}),t.jsx("p",{children:e.historical.currentFileMatch==="different"?"The current file differs from that historical save.":e.historical.currentFileMatch==="same_saved_replacement"?"The saved replacement matched when checked; current bytes still require a fresh load.":"The current file was not checked."})]}),t.jsx(D,{type:"button",size:"sm",variant:"outline",disabled:r||e.editBlocked||e.busy,onClick:d,children:"Load current file"})]})]})}function Se({recovery:e,editing:r,loadCurrent:d}){return!e.supported||r?null:t.jsxs(oe,{children:[t.jsx(le,{asChild:!0,children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground","aria-label":"More file actions",children:t.jsx(ue,{className:"size-4"})})}),t.jsxs(de,{align:"end",children:[t.jsx(Z,{disabled:e.busy,onSelect:()=>void e.refresh(),children:"Check previous saves"}),t.jsx(Z,{disabled:e.editBlocked||e.busy,onSelect:()=>d(),children:"Load current file"})]})]})}function De({recovery:e,editing:r,loadCurrent:d,toolbar:n}){const o=Pe(e),s=e.phase==="unavailable"||e.phase==="refused";return t.jsxs(t.Fragment,{children:[e.supported&&e.phase==="pending"&&t.jsx("p",{role:"status",className:"sr-only",children:"Checking previous saves…"}),t.jsx("div",{...o?{role:"region","aria-label":"Previous file saves"}:{},className:O("shrink-0",o?"bg-muted text-foreground mx-2 mt-2 rounded-md py-1 pr-1 pl-3 text-sm":"flex justify-end px-2 pt-1",o&&(s?"@container":"flow-root")),children:t.jsxs("div",{className:O(o&&s&&"grid grid-cols-[1fr_auto] items-center gap-x-2 @md:grid-cols-[1fr_auto_auto]"),children:[t.jsx("div",{className:O("flex items-center gap-1",o&&!s&&"float-right ml-2",o&&s&&"col-start-2 row-start-1 @md:col-start-3"),children:n}),o&&(s?t.jsx(X,{recovery:e,editing:r,loadCurrent:d}):t.jsx("div",{className:"py-1.5",children:t.jsx(X,{recovery:e,editing:r,loadCurrent:d})}))]})})]})}function Le({editing:e,off:r,observation:d,onClick:n}){return t.jsx(fe,{children:t.jsxs(he,{...r?{}:{open:!1},children:[t.jsx(pe,{asChild:!0,children:t.jsx("span",{className:"inline-flex",children:t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:n,"aria-label":e?"Finish editing":"Edit file",disabled:r,"data-document-save-observation":d,children:e?t.jsx(me,{className:"size-4"}):t.jsx(ve,{className:"size-4"})})})}),t.jsx(xe,{children:"Editing is off"})]})})}const Ee=a.lazy(()=>ee(()=>import("./CodeMirrorEditor-Ct5GtLSd.js"),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.CodeMirrorEditor}))),ze=a.lazy(()=>ee(()=>import("./BlintzCanvas-Dz8rAsfT.js").then(e=>e.B),__vite__mapDeps([5,1,2,6,4,7])).then(e=>({default:e.BlintzCanvas}))),Be=500;function Me(e,r){return r==="markdown"||/\.(md|markdown|mdx)$/i.test(e)}function Oe(e){switch(e){case"saving":return"Saving…";case"saved":return"Saved";case"error":return"Couldn’t save";case"uncertain":return"Save not confirmed";default:return null}}function te({content:e,documentId:r,cwd:d,loaded:n,theme:o,isEditing:s,onEditingChange:C,setDocumentEditing:y,observedBinding:b,fileSaveObservation:p="unavailable",recoveryBinding:x}){const _=e.readOnly!==!0,f=Me(e.sourcePath,e.language),w=ge(),[R,m]=a.useState(n),[T,F]=a.useState(),g=a.useRef(b);a.useLayoutEffect(()=>{g.current=b},[b]);const l=ke({documentId:r,sourcePath:e.sourcePath,cwd:d,loadedContent:n,documentSaveBinding:T,documentRecoveryBinding:x}),i=_e(l.recovery,p,x),c=we({cwd:d,sourcePath:f?e.sourcePath:null,content:R,saved:l.status==="saved"}),u=a.useRef(!1),j=a.useRef(s);a.useLayoutEffect(()=>(u.current=!0,j.current=s,()=>{u.current=!1}),[s]);const h=a.useRef(null),S=a.useRef(R),L=a.useRef(0),A=a.useRef(0),I=a.useRef(l.save),K=a.useRef(l.prepareFinalSave),U=a.useRef(l.waitForCloseDrain),E=a.useRef(null),V=a.useRef(C),Y=Ne({documentId:r,sourcePath:e.sourcePath,binding:T,save:l.save,draftRef:S,revisionRef:L,finishAttemptRef:A,timerRef:h,finalSaveRef:E,invalidateConfirmedFile:()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)}).catch(()=>{})}});a.useEffect(()=>{S.current=R,I.current=l.save,K.current=l.prepareFinalSave,U.current=l.waitForCloseDrain,V.current=C});const $=a.useCallback(v=>{var k;L.current+=1,S.current=v,m(v),(k=E.current)==null||k.cancel(),E.current=K.current(v),h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{h.current=null,I.current(S.current)},Be)},[]),se=()=>{var P;if(i.editBlocked||p==="pending"||p==="ready"&&!((P=g.current)!=null&&P.current()))return;const v=g.current,k=v&&Object.freeze({...v.incarnation});F(v!=null&&v.current()&&k?{incarnation:k,current:()=>{const N=g.current;return!!N&&be(k,N.incarnation)&&N.current()}}:void 0),L.current+=1,S.current=n,m(n),C(!0),y(r,!0)},ne=async()=>{h.current&&(clearTimeout(h.current),h.current=null);const v=S.current,k=L.current,P=++A.current,N=await I.current(v);if(N.status!=="changed"&&N.status!=="no_op"||L.current!==k||A.current!==P||N.confirmed.content!==v)return;const q=N.confirmed;q.content===S.current&&w.setQueryData(B(d,e.sourcePath),Q=>Q&&{...Q,content:q.content,hash:q.hash}),C(!1),y(r,!1)},re=()=>{w.invalidateQueries({queryKey:B(d,e.sourcePath)})};a.useEffect(()=>{var v;s||(h.current&&clearTimeout(h.current),h.current=null,(v=E.current)==null||v.cancel(),E.current=null)},[s]),a.useEffect(()=>{const v=Y.current;return()=>{var N;h.current&&(clearTimeout(h.current),h.current=null);const k=(N=E.current)==null?void 0:N.flush(),P=S.current;v==null||v.settleRetirement(Promise.resolve(k).then(()=>U.current(P))),E.current=null,y(r,!1),V.current(!1)}},[r,y,Y]);const G=async()=>{if(s||!u.current||i.editBlocked)return;const v=L.current,k=await i.inspectCurrent();k.status!=="observed"||!u.current||j.current||L.current!==v||!l.recovery.current()||w.setQueryData(B(d,e.sourcePath),P=>P&&{...P,...k.value})},ae=()=>{const v=l.adoptDisk();v!=null&&m(v)},ie=()=>{l.overwrite(S.current)},J=l.status==="saved"?l.confirmedContent!==R?"Unsaved changes":l.documentReceipt?"Save recorded":"Saved to file":Oe(l.status),W=s?R:n;return t.jsxs("div",{className:"relative flex h-full flex-col",children:[t.jsx(De,{recovery:i,editing:s,loadCurrent:()=>void G(),toolbar:t.jsxs(t.Fragment,{children:[_&&J&&t.jsx("span",{className:O("mr-1 text-xs",l.status==="error"?"text-destructive":"text-muted-foreground"),"aria-live":"polite",children:J}),!s&&p==="pending"&&t.jsx("span",{role:"status",children:"Checking document…"}),!s&&t.jsx(D,{type:"button",variant:"ghost",size:"icon-md",className:"text-muted-foreground hover:text-foreground",onClick:re,"aria-label":"Refresh from disk",children:t.jsx(Te,{className:"size-4"})}),_&&t.jsx(Le,{editing:s,off:!s&&(p==="pending"||i.editBlocked),observation:p,onClick:s?()=>void ne():se}),t.jsx(Se,{recovery:i,editing:s,loadCurrent:()=>void G()})]})}),l.status==="uncertain"&&t.jsxs("div",{role:"status",className:"mx-2 mt-2 flex items-center gap-2 text-sm",children:[t.jsx("span",{children:"Save not confirmed. Retry the original save before saving another draft."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",onClick:()=>void l.retryUnconfirmed(),children:"Retry original save"})]}),l.status==="conflict"&&t.jsxs("div",{className:"bg-destructive/10 text-destructive mx-2 mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-3 py-2 text-sm",children:[t.jsx("span",{className:"flex-1",children:"This file changed on disk since you opened it."}),t.jsx(D,{type:"button",variant:"ghost",size:"sm",className:"h-7",onClick:ae,children:"Reload"}),t.jsx(D,{type:"button",variant:"destructive",size:"sm",className:"h-7",onClick:ie,children:"Overwrite"})]}),t.jsx("div",{className:"min-h-0 flex-1",children:t.jsx(a.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading editor…"}),children:f?t.jsx("div",{className:"px-2 pb-6",children:t.jsx(ze,{value:W,editable:s,onChange:s?$:void 0,wikiLinks:c})}):t.jsx(Ee,{value:W,editable:s,filename:e.sourcePath,languageHint:e.language,theme:o,onChange:s?$:void 0})})})]})}function Ae(e){const{fileSaveBinding:r,fileSaveObservation:d}=Re(e.documentId);return t.jsx(te,{...e,observedBinding:r,recoveryBinding:r,fileSaveObservation:d})}function Ie(e){switch(e==null?void 0:e.code){case"NOT_FOUND":return"This file doesn’t exist.";case"NOT_A_FILE":return"This path is a directory, not a file.";case"TOO_LARGE":return"This file is too large to open here.";case"BINARY_FILE":return"This file isn’t text, so the editor can’t show it.";default:return"This file couldn’t be loaded."}}function at({content:e,documentId:r}){const d=ye(),n=z(g=>g.selectedCwd),o=z(g=>g.setDocumentEditing),s=z(g=>{var l;return((l=g.openDocuments.find(i=>i.id===r))==null?void 0:l.editing)??!1}),C=je(),y=z(g=>g.canvasSessionId),b=z(g=>g.roomCanvasLiveRoomId),{data:p,error:x,isLoading:_}=Ce({queryKey:B(n,e.sourcePath),enabled:n!==null,queryFn:()=>d.readFileContent(n,e.sourcePath),staleTime:3e4,retry:!1}),[f,w]=a.useState(null),R=g=>{w(g&&p?{pinnedHash:p.hash}:null)};if(n===null)return t.jsx(H,{children:"Open a chat to view files."});if(_)return t.jsx(H,{children:"Loading file…"});if(x||!p)return t.jsx(H,{children:Ie(x)});const m=f!==null&&s,T=(m?f==null?void 0:f.pinnedHash:null)??p.hash,F=y&&!b?Ae:te;return t.jsx(F,{content:e,documentId:r,cwd:n,loaded:p.content,theme:C,isEditing:m,onEditingChange:R,setDocumentEditing:o},`${e.sourcePath}:${T}`)}function H({children:e}){return t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:e})})}export{at as CanvasFileContent};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Model3dViewer-BqErc378.js","assets/index-BYTLOFNS.js","assets/index-BbPg1hpf.css"])))=>i.map(i=>d[i]);
2
- import{a5 as m,aZ as n,r as s,j as t,a_ as p}from"./index-BYTLOFNS.js";import{r as u}from"./use-session-canvas-Cc04zSW3.js";import"./rotate-cw-CpuoCwEK.js";import"./query-keys-DeYqUDia.js";import"./index.esm-B0kiCgAP.js";import"./WidgetErrorCard-B477vOv2.js";import"./index-D0k8LoLP.js";import"./progress-CNm_pBbE.js";import"./markdown-content-C1i_dR6j.js";import"./table-BrvyPoEL.js";import"./zap-BmeuEI5X.js";import"./package-DHEY3aDq.js";import"./heart-DKWg_e72.js";import"./git-branch-DpByNz2U.js";import"./file-text-CS9s0qOe.js";import"./file-C_57RCIQ.js";import"./McpAppFrame-DAPJUxUi.js";import"./more-details-DNp6DH8i.js";const d=s.lazy(()=>p(()=>import("./Model3dViewer-BqErc378.js"),__vite__mapDeps([0,1,2])).then(e=>({default:e.Model3dViewer})));function f(e){var o;const r=(o=e.split(".").pop())==null?void 0:o.toLowerCase();return r==="glb"||r==="gltf"?"gltf":r==="stl"?"stl":r==="obj"?"obj":r==="3mf"?"3mf":r==="ply"?"ply":r==="fbx"?"fbx":r==="dae"?"dae":null}function A({content:e}){const r=m(),o=n(i=>i.selectedCwd),l=s.useMemo(()=>u(e.src,i=>r.mediaUrl(o??"",i)),[e.src,r,o]),a=s.useMemo(()=>f(e.src),[e.src]);return l.url===null||a===null?t.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-8 text-center",children:t.jsx("p",{children:"This 3D model can’t be displayed here."})}):t.jsx("div",{className:"bg-muted/40 h-full w-full",children:t.jsx(s.Suspense,{fallback:t.jsx("div",{className:"text-muted-foreground p-4 text-sm",children:"Loading 3D viewer…"}),children:t.jsx(d,{url:l.url,format:a,label:e.title??"Canvas 3D model"})})})}export{A as CanvasModel3dContent,f as formatOf};
@@ -1 +0,0 @@
1
- import{a5 as w,a7 as D,a8 as k,fE as E,fF as y,r as m,j as t,I as b,fG as M,B as v,G as S,fH as A,e as L,Q as I,T as $,C as _,V as P,f as z,dR as F}from"./index-BYTLOFNS.js";function q(){const e=w(),s=D();return k({mutationFn:({agentId:n,body:a})=>e.createCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:E.all})})}function R(){const e=w(),s=D();return k({mutationFn:({id:n,body:a})=>e.updateCommitment(n,a),onSettled:()=>s.invalidateQueries({queryKey:E.all})})}function W(e,s=new Date){if(!e)return null;const n=new Date(e);if(Number.isNaN(n.getTime()))return null;const a=n.getTime()<s.getTime()?"Overdue ·":"Due",l=n.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});return n.toDateString()===s.toDateString()?`${a} ${l}`:Math.abs(n.getTime()-s.getTime())/864e5<6?`${a} ${n.toLocaleDateString(void 0,{weekday:"short"})} ${l}`:`${a} ${n.toLocaleDateString(void 0,{month:"short",day:"numeric"})}`}function K(e,s){return e?e.startsWith(y)?`To ${e.slice(y.length)}`:`To ${(s==null?void 0:s(e))??e}`:null}function U(e){return{open:e.filter(s=>s.state==="open"),closed:e.filter(s=>s.state!=="open")}}const B={kept:"Kept",missed:"Missed",dropped:"Dropped"};function J(e){var n;const s=new Map;for(const a of e)s.set(a.id,a.displayName),(n=a.agent)!=null&&n.manifestId&&s.set(a.agent.manifestId,a.displayName);return a=>s.get(a)}const H=6e4;function Q(){const e=new Date;return new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)}function X({agentId:e,onDone:s}){var c;const n=q(),[a,l]=m.useState(""),[i,o]=m.useState(""),d=m.useId(),f=m.useId(),x=a.trim(),j=n.isError&&((c=n.error)==null?void 0:c.code)==="PAST_DUE",p=i?new Date(i).getTime():null,[u,N]=m.useState(!1),[C]=m.useState(Q);function r(g){if(g.preventDefault(),!x||u)return;const h=p!==null?new Date(p).toISOString():void 0;n.mutate({agentId:e,body:{what:x,...h?{dueAt:h}:{}}},{onSuccess:s})}return t.jsxs("form",{onSubmit:r,"data-slot":"add-commitment-form",className:"flex flex-col gap-2 rounded-md border p-3",children:[t.jsx("label",{htmlFor:d,className:"text-xs font-medium",children:"What was promised"}),t.jsx(b,{id:d,value:a,maxLength:M,onChange:g=>l(g.target.value),placeholder:"Send Acme the revised quote"}),t.jsx("label",{htmlFor:f,className:"text-xs font-medium",children:"Due (optional)"}),t.jsx(b,{id:f,type:"datetime-local",value:i,min:C,"aria-invalid":u||void 0,onChange:g=>{const h=g.target.value;o(h),N(h!==""&&new Date(h).getTime()<Date.now()-H)}}),(u||j)&&t.jsx("p",{className:"text-destructive text-xs",children:"That time has passed."}),n.isError&&!j&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save the commitment. Try again."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(v,{type:"button",size:"sm",variant:"ghost",onClick:s,children:"Cancel"}),t.jsx(v,{type:"submit",size:"sm",disabled:!x||u||n.isPending,children:"Add commitment"})]})]})}function T({commitment:e,agentName:s,nameOf:n,onClose:a,busy:l}){const i=e.state==="open",o=[s,K(e.to,n)].filter(Boolean).join(" · "),d=i?W(e.dueAt):null;return t.jsxs("li",{"data-slot":"commitment-row","data-state":e.state,"data-overdue":e.overdue||void 0,className:"flex flex-col gap-2 rounded-md px-2 py-2 sm:flex-row sm:items-center sm:gap-3",children:[t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:S("text-sm break-words",!i&&"text-muted-foreground",e.state==="dropped"&&"line-through"),children:e.what}),(o||d||!i)&&t.jsxs("div",{className:"text-muted-foreground mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[e.state!=="open"&&t.jsx("span",{children:B[e.state]}),o&&t.jsx("span",{className:"min-w-0 truncate",children:o}),d&&t.jsx("span",{className:S(e.overdue&&"text-destructive font-medium"),children:d})]})]}),i&&a&&t.jsxs("div",{className:"flex shrink-0 gap-1",children:[t.jsx(v,{size:"xs",variant:"outline",disabled:l,onClick:()=>a("kept"),"aria-label":`Mark kept: ${e.what}`,children:"Mark kept"}),t.jsx(v,{size:"xs",variant:"ghost",disabled:l,onClick:()=>a("dropped"),"aria-label":`Drop: ${e.what}`,children:"Drop"})]})]})}const G={kept:"Marked kept",dropped:"Commitment dropped"};function Y({agentId:e,nameOf:s,canAdd:n=!1,readOnly:a=!1,canChange:l}){var C;const i=A(e?{agentId:e}:{}),o=R(),[d,f]=m.useState(!1),x=e===void 0;function j(r,c){o.mutate({id:r.id,body:{state:c}},{onSuccess:()=>F.success(G[c],{action:{label:"Undo",onClick:()=>o.mutate({id:r.id,body:{state:"open",from:c}})}})})}if(i.isPending)return t.jsx(L,{className:"h-16 w-full"});if(i.isError)return t.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read commitments."});const{open:p,closed:u}=U(i.data),N=o.isPending?(C=o.variables)==null?void 0:C.id:void 0;return t.jsxs("div",{"data-slot":"commitment-list",className:"flex flex-col gap-2",children:[p.length===0&&u.length===0&&!d&&t.jsx("p",{className:"text-muted-foreground text-sm",children:"No commitments yet."}),p.length>0&&t.jsx("ul",{className:"flex flex-col","aria-label":"Open commitments",children:p.map(r=>t.jsx(T,{commitment:r,agentName:x?s==null?void 0:s(r.agentId):void 0,nameOf:s,busy:N===r.id,...a||l&&!l(r)?{}:{onClose:c=>j(r,c)}},r.id))}),o.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t change that commitment. Try again."}),u.length>0&&t.jsxs(I,{children:[t.jsxs($,{className:"focus-ring text-muted-foreground hover:text-foreground group flex items-center gap-1 rounded-md px-2 py-1 text-xs",children:[t.jsx(_,{"aria-hidden":!0,className:"size-3.5 transition-transform group-data-[state=open]:rotate-90"}),"Closed (",u.length,")"]}),t.jsx(P,{children:t.jsx("ul",{className:"flex flex-col","aria-label":"Closed commitments",children:u.map(r=>t.jsx(T,{commitment:r,agentName:x?s==null?void 0:s(r.agentId):void 0,nameOf:s},r.id))})})]}),n&&!a&&e&&d&&t.jsx(X,{agentId:e,onDone:()=>f(!1)}),n&&!a&&e&&!d&&t.jsxs(v,{size:"sm",variant:"ghost",className:"self-start",onClick:()=>f(!0),children:[t.jsx(z,{"aria-hidden":!0}),"Add commitment"]})]})}export{Y as C,J as r};
@@ -1 +0,0 @@
1
- import{r,d,j as m}from"./index-BYTLOFNS.js";import{r as c,C as l}from"./CommitmentList-BXbIFc4Y.js";function u({member:s,roster:t}){var o;const e=(o=s.agent)==null?void 0:o.manifestId,i=r.useMemo(()=>c(t),[t]),n=d(s,t),a=n==="managed"||n==="system";return e?m.jsx("div",{className:"min-h-0 flex-1","data-slot":"profile-commitments",children:m.jsx(l,{agentId:e,nameOf:i,canAdd:a,readOnly:!a})}):null}export{u as CommitmentsPage};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BYTLOFNS.js";import{a as t}from"./ProfileFields-qnjDsdIB.js";import"./profile-errors-OMPgeYKJ.js";import"./use-mounted-ref-Bb8zNmgI.js";function n({member:r}){return o.jsx(t,{member:r})}export{n as HandlePage};
@@ -1 +0,0 @@
1
- import{a5 as T,a7 as w,a8 as B,hl as v,hm as $,h as O,j as s,hn as A,b9 as E,ho as W,a2 as P,B as x,s as R,ab as D,hp as M,hq as H,d as L,r as h,hr as q,e as S,hs as F,ht as I,b as U,hu as z}from"./index-BYTLOFNS.js";import{M as C}from"./more-details-DNp6DH8i.js";import{HeartbeatFileEditor as Q}from"./ConventionPage-z4phQYn0.js";import"./relay-trace-schemas-CctfRKB2.js";import"./form-Cf49Z6eU.js";import"./untrusted-text-BDygHCRk.js";import"./soul-file-CPL6-cba.js";function _(){const e=T(),t=w();return B({mutationFn:n=>e.chooseTriageCredits(n),onSettled:()=>t.invalidateQueries({queryKey:v.all})})}function K(e,t){if(e.cadence==="off")return"Sends no reports.";const n=e.cadence==="weekly"?"each week":"each workday",a=e.items===0?"Nothing to report yet.":`${e.items} ${e.items===1?"item":"items"} so far.`;return`Reports to ${t} ${n}. ${a}`}function G(e,t){const n=$(e,t);return a=>{var r;return((r=e.find(l=>{var o;return((o=l.agent)==null?void 0:o.manifestId)===a}))==null?void 0:r.displayName)??n(a)}}function J(e){return Number.isNaN(e.getTime())?null:e.toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function V({beat:e,onOpenChat:t}){const n=A[e.outcome],a=J(new Date(e.startedAt));return s.jsxs("li",{"data-slot":"heartbeat-beat","data-outcome":e.outcome,className:"flex flex-col gap-1 rounded-md px-2 py-2",children:[s.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-x-2 gap-y-1 text-xs",children:[s.jsx("time",{dateTime:e.startedAt,title:a??void 0,children:E(e.startedAt)}),s.jsx("span",{children:W[e.kind]}),s.jsx(P,{variant:"outline",size:"xs",tone:n.tone,className:"ml-auto",children:n.label})]}),e.summary&&s.jsx("p",{className:"text-sm break-words",children:e.summary}),t&&s.jsx(x,{size:"xs",variant:"ghost",className:"-ml-2 self-start","aria-label":a?`Open chat from the check at ${a}`:"Open chat from this check",onClick:t,children:"Open chat"})]})}function X({beats:e,canOpenChat:t}){const n=O();return e.length===0?s.jsx("p",{className:"text-muted-foreground px-2 text-sm",children:"No checks yet."}):s.jsx("ul",{className:"flex flex-col","aria-label":"Last checks",children:e.map(a=>{const r=a.sessionId,l=t&&r&&n?()=>void n(R({session:r})):void 0;return s.jsx(V,{beat:a,...l?{onOpenChat:l}:{}},a.id)})})}function Y(e){return e.runsOn==="credits"?`Checks run on DorkOS credits. ${e.today} today.`:`Checks run on ${D(e.runtime)}.`}function Z(e){if(e.today===0)return null;const t=`${e.tokens.toLocaleString("en-US")} tokens`;return e.runsOn==="credits"?`${t} today.`:`${`${e.today} ${e.today===1?"check":"checks"}`} on credits earlier today, ${t}.`}function ee(){const e=_();return s.jsxs("div",{className:"bg-muted/40 space-y-2 rounded-md border px-3 py-3","data-slot":"heartbeat-credits-offer",children:[s.jsx("p",{className:"text-sm font-medium",children:"Run cheap checks on DorkOS credits?"}),s.jsx("p",{className:"text-muted-foreground text-xs",children:"Quick checks skip most full runs. Nothing is spent until you say yes."}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(x,{size:"sm",disabled:e.isPending,onClick:()=>e.mutate(!0),children:"Use credits"}),s.jsx(x,{size:"sm",variant:"ghost",disabled:e.isPending,onClick:()=>e.mutate(!1),children:"Not now"})]}),e.isError&&s.jsx("p",{role:"alert",className:"text-destructive text-xs",children:"Couldn’t save your answer. Try again."})]})}function se({checks:e}){const t=Z(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-checks",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Checks"}),s.jsx("p",{className:"text-sm",children:Y(e)}),t&&s.jsx("p",{className:"text-muted-foreground text-xs",children:t}),e.offer&&s.jsx(ee,{})]})}function te({held:e,nameOf:t,now:n}){return e.length===0?null:s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-held",children:[s.jsxs("h3",{className:"text-sm font-semibold",children:["Held until working hours: ",e.length,"."]}),s.jsx("ul",{className:"flex flex-col","aria-label":"Held messages",children:e.map(a=>{const r=M(a.deliverAfter,new Date(n));return s.jsxs("li",{className:"flex flex-col gap-0.5 rounded-md px-2 py-2",children:[a.text&&s.jsx("p",{className:"line-clamp-3 text-sm break-words whitespace-pre-line",children:a.text}),s.jsx("p",{className:"text-muted-foreground text-xs",children:[`To ${t(a.to)}`,r].filter(Boolean).join(" · ")})]},a.id)})})]})}function f(e){return e.value===null?null:`${Math.round(e.value*100)}%`}function p(e){return`${e.part} of ${e.whole}`}function ne(e){return`Target ${e.charAt(0).toLowerCase()}${e.slice(1)}`}function ae(e){return e.value!==null?e.value.toFixed(1):e.messages>0?`${e.messages} sent, none useful`:null}function re(e){return e.windowDays===1?"No checks in the last day.":`No checks in the last ${e.windowDays} days.`}function oe(e){return e.windowDays===1?"Last day.":`Last ${e.windowDays} days.`}function N(e,t,n){return`${e} ${e===1?t:n}`}function le(e){const{pauses:t,wakeOff:n,mutes:a}=e.mutesAndPauses,r=[t>0?N(t,"pause","pauses"):null,n>0?N(n,"switch-off","switch-offs"):null,a>0?N(a,"mute","mutes"):null].filter(l=>l!==null);return r.length===0?null:r.join(", ")}function ie(e){const t=e.supporting,n=o=>Math.round(o).toLocaleString("en-US"),a=f(t.quietBeats),r=f(t.commitmentsOnTime);return[a?`Quiet checks: ${a}, ${p(t.quietBeats)}.`:null,r?`Promises kept on time: ${r}, ${p(t.commitmentsOnTime)}.`:"No promises came due.",t.noEndBeat>0?`Ended without a summary: ${t.noEndBeat}.`:null,t.triage.checks>0?`Cheap checks: ${t.triage.checks}, ${n(t.triage.tokens)} tokens.`:null,t.turns.count>0?t.turns.tokensPerTurn===null?`Full runs: ${t.turns.count}.`:`Full runs: ${t.turns.count}, about ${n(t.turns.tokensPerTurn)} tokens each.`:null,t.bypass>0?`Posted outside a check’s summary: ${t.bypass}.`:null,t.held>0?`Held for people’s hours: ${t.held}.`:null].filter(o=>o!==null)}function u({label:e,value:t,detail:n,target:a,source:r}){return s.jsxs("div",{"data-slot":"heartbeat-measure",className:"grid grid-cols-[1fr_auto] items-baseline gap-x-2 gap-y-0.5 py-1.5",children:[s.jsx("dt",{className:"text-sm",children:e}),s.jsx("dd",{className:"text-sm font-medium tabular-nums",children:t}),(n||a)&&s.jsxs("dd",{className:"text-muted-foreground col-span-2 flex flex-wrap gap-x-2 text-xs",children:[n&&s.jsx("span",{className:"tabular-nums",children:n}),a&&s.jsx("span",{children:ne(a)})]}),s.jsx("dd",{className:"text-muted-foreground col-span-2 text-xs",children:r})]})}function k({measures:e}){const{mutesAndPauses:t}=e;return s.jsx(u,{label:"Mutes and pauses",value:String(t.total),detail:le(e),target:t.target,source:t.source})}function ce({measures:e}){const t="Nothing to count yet";if(e.supporting.beats===0)return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-measures","data-state":"empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:re(e)}),s.jsx("dl",{children:s.jsx(k,{measures:e})})]});const{keptRate:n,usefulRaiseRate:a,interruptions:r}=e,l=ie(e);return s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-measures","data-state":"measured",children:[s.jsxs("div",{className:"space-y-0.5",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Measures"}),s.jsxs("p",{className:"text-muted-foreground text-xs",children:[oe(e)," Targets are starting points, not grades."]})]}),s.jsxs("dl",{className:"divide-y",children:[s.jsx(u,{label:"Work that stuck",value:f(n)??t,detail:n.whole>0?p(n):null,target:n.target,source:n.source}),s.jsx(u,{label:"Useful messages",value:f(a)??t,detail:a.whole>0?p(a):null,target:a.target,source:a.source}),s.jsx(u,{label:"Interruptions per useful outcome",value:ae(r)??t,detail:r.value===null?null:`${r.messages} sent, ${r.usefulOutcomes} useful`,target:r.target,source:r.source}),s.jsx(u,{label:"Surprises",value:"Not measured yet",source:e.surprises.source}),s.jsx(k,{measures:e})]}),l.length>0&&s.jsx(C,{label:"Supporting measures",openLabel:"Fewer measures",children:s.jsx("ul",{className:"space-y-1 text-xs","aria-label":"Supporting measures",children:l.map(o=>s.jsx("li",{children:o},o))})})]})}function ue({status:e,now:t,readerName:n}){const a=e.enabled&&e.wake==="timed"?F(e.nextBeatAt,new Date(t)):null,r=e.enabled&&e.skippedReason===null;return s.jsxs("section",{className:"space-y-1","data-slot":"heartbeat-wake",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"How it wakes"}),s.jsx("p",{className:"text-sm",children:I(e)}),a&&s.jsx("p",{className:"text-muted-foreground text-xs",children:a}),r&&s.jsx("p",{className:"text-muted-foreground text-xs","data-slot":"heartbeat-next-report",children:K(e.report,n(e.report.to))})]})}function de({error:e}){return s.jsxs("div",{role:"alert",className:"space-y-1","data-slot":"heartbeat-file-problem",children:[s.jsx("p",{className:"text-destructive text-sm",children:"These settings don’t read. The last good ones still apply."}),s.jsx("p",{className:"text-sm",children:z(e)}),s.jsx(C,{children:s.jsx("p",{className:"font-mono break-words",children:e})})]})}function me(e){var i;const{member:t,roster:n,onPush:a,status:r}=e,l=w(),{agent:o,isPending:g}=U(t),[j,c]=h.useState(!1),d=((i=t.agent)==null?void 0:i.manifestId)??"";if(g)return s.jsx(S,{className:"h-40 w-full"});const m=!!o&&((o==null?void 0:o.heartbeatContent)??null)===null;return m&&!j?s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-file-empty",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"No HEARTBEAT.md yet"}),s.jsx("p",{className:"text-muted-foreground text-sm",children:"It wakes only when something happens."}),s.jsx(x,{size:"sm",variant:"outline",onClick:()=>c(!0),children:"Write one"})]}):s.jsxs("section",{className:"space-y-2",children:[r.fileError&&s.jsx(de,{error:r.fileError}),s.jsx(Q,{member:t,roster:n,onPush:a,...m?{onCancel:()=>c(!1)}:{},onSaved:()=>void l.invalidateQueries({queryKey:v.agent(d)})})]})}function ye(e){var y,b;const{member:t,roster:n}=e,a=((y=t.agent)==null?void 0:y.manifestId)??null,r=H(a,{live:!0}),l=L(t,n),o=l==="managed"||l==="system",g=h.useMemo(()=>$(n,t),[n,t]),j=h.useMemo(()=>G(n,t),[n,t]),c=q(3e4),[d,m]=h.useState(!1);if(o&&((b=r.data)!=null&&b.enabled)&&!d&&m(!0),!a)return null;if(r.isPending)return s.jsx(S,{className:"h-24 w-full"});if(!r.data)return s.jsx("p",{className:"text-muted-foreground text-sm",children:"Couldn’t read this heartbeat."});const i=r.data;return s.jsxs("div",{className:"space-y-6","data-slot":"profile-heartbeat",children:[s.jsx(ue,{status:i,now:c,readerName:j}),i.enabled&&s.jsx(se,{checks:i.checks}),o&&d&&s.jsx(me,{...e,status:i}),s.jsx(te,{held:i.held,nameOf:g,now:c}),s.jsx(ce,{measures:i.measures}),s.jsxs("section",{className:"space-y-2","data-slot":"heartbeat-beats",children:[s.jsx("h3",{className:"text-sm font-semibold",children:"Last checks"}),s.jsx(X,{beats:i.lastBeats,now:c,canOpenChat:i.enabled})]})]})}export{ye as HeartbeatPage};
@@ -1 +0,0 @@
1
- import{j as o}from"./index-BYTLOFNS.js";import{P as m}from"./ProfileFields-qnjDsdIB.js";import"./profile-errors-OMPgeYKJ.js";import"./use-mounted-ref-Bb8zNmgI.js";function a({member:r}){return o.jsx(m,{member:r})}export{a as NamePage};
@@ -1 +0,0 @@
1
- import{a5 as b,a7 as R,a8 as C,aQ as x,dR as P,eZ as j,r as d,j as e,d2 as E,d3 as M,d5 as T,d6 as k,d7 as L,e_ as O,eL as I,I as K,aD as N,B as D,aZ as _,aE as F,by as Q,bz as B,e$ as q,f as z,bA as H,bC as V,f0 as Y}from"./index-BYTLOFNS.js";function A(t){return Promise.all([t.invalidateQueries({queryKey:x.lists()}),t.invalidateQueries({queryKey:x.details()}),t.invalidateQueries({queryKey:x.threads()})]).then(()=>{})}function w(t){return(t==null?void 0:t.code)==="SLUG_TAKEN"}function $({isInlineErrorVisible:t}){const a=b(),r=R();return C({mutationFn:({title:n,agentPaths:l})=>a.createRoom({kind:"channel",title:n,members:[],agentPaths:l}),onSuccess:()=>A(r),meta:{suppressErrorToast:!0},onError:n=>{w(n)&&t()||P.error("Couldn’t create that channel.",{description:n.message})}})}function J(){const t=b(),a=R();return C({mutationFn:({agentPaths:r,title:n})=>t.createRoom({kind:"dm",title:n,members:[],agentPaths:r}),onSettled:()=>A(a),meta:{errorLabel:"Couldn’t start that DM"}})}const y=200;function G(){const t=_.getState();t.activeRightPanelTab==="canvas"&&t.setActiveRightPanelTabView(F)}function ee({open:t,onOpenChange:a,onCreated:r}){const n=j(),[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=$({isInlineErrorVisible:()=>u.current}),g=w(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=>{a(!1),G(),r(i)}})},S=s=>{var i;s.key==="Enter"&&(s.preventDefault(),p&&((i=c.current)==null||i.focus()))};return e.jsx(E,{open:t,onOpenChange:a,children:e.jsxs(M,{className:"sm:max-w-md",onOpenAutoFocus:s=>{var i;s.preventDefault(),(i=h.current)==null||i.focus()},children:[e.jsxs(T,{children:[e.jsx(k,{children:"New channel"}),e.jsx(L,{children:"Name it, then pick who’s in it."})]}),e.jsxs(O,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(I,{htmlFor:"channel-name",children:"Channel name"}),e.jsx(K,{ref:h,id:"channel-name",value:l,maxLength:y,placeholder:"Backend",autoComplete:"off",onChange:s=>{m(s.target.value),o.error&&o.reset()},onKeyDown:S,"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:n,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 U(t){return t.length===1}function W(t){const a=t[0];return a!==void 0&&U(t)?`Open chat with ${a.displayName}`:"Start group message"}function te({onStart:t,open:a,onOpenChange:r,hideTrigger:n=!1}){const l=j(),m=d.useRef(null),h=()=>{r(!1),Y.getState().open()};return e.jsxs(Q,{open:a,onOpenChange:r,modal:!0,fullHeight:!0,children:[e.jsx(B,{asChild:!0,children:e.jsx(q,{...n?{"aria-hidden":!0,tabIndex:-1,className:"sr-only"}:{"aria-label":"New message"},children:e.jsx(z,{})})}),e.jsxs(H,{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(V,{children:"New message"}),e.jsx(N,{inputRef:m,roster:l,onSubmit:c=>{r(!1),t(c)},submitLabel:W,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{ee as C,te as N,Z as O,U as a,W as o,J as u};
@@ -1 +0,0 @@
1
- import{j as s,eH as A,eI as P,G as k,gE as Y,a5 as E,a6 as q,h1 as R,r as N,a7 as Z,a8 as ee,aJ as se,bb as te,B as x,i2 as v,by as W,bz as U,C as L,bA as D,bC as H,U as ne,h6 as M,e as C,b9 as ae,i3 as ie,i4 as le,i5 as re}from"./index-BYTLOFNS.js";import{u as y,c as oe,a as p,l as _,S as f,P as b,s as z,d as T,r as j,f as $,b as B,e as S,g as de,A as ce}from"./ApplyToOverridesDialog-Dz4dRYKs.js";import{s as g,C as w,T as K}from"./trust-dial-tuMHO5Ug.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 ue(e){const t=E();return q({queryKey:R.agent(e??""),queryFn:()=>t.getAgentPermissions(e),enabled:!!e})}function me(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 he(e){const t=E();return q({queryKey:R.history(e),queryFn:()=>t.getPermissionHistory(e?{agentId:e,limit:50}:{limit:50})})}function xe(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 fe(){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?oe(t,e):void 0}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(te,{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=_(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,": ",f[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 pe({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(W,{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(L,{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=f[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 je({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,": ",f[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(ne,{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(je,{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 Ne({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: ${g(o)}`:`Same as everyone (${g(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 ${g(d)}`:"not set"} for ${t}?`,sentence:B(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(M,{descriptor:w.find(r=>r.stop===d),className:"pb-3"})]})}function ze({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 ${g(e.stop)}`:"not set"}?`,sentence:B(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 ",g(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(be,{agents:e.exceptions})]})]}),s.jsx(M,{descriptor:w.find(i=>i.stop===e.stop),className:"pb-3"})]})}function ve({agent:e}){const t=p({kind:"agent",agentId:e.agentId}),n=_(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,": ",g(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 be({agents:e}){return e.length===0?null:s.jsxs(W,{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(L,{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(ve,{agent:t},t.agentId))})]})]})}function O(e){return e.filter(t=>t.kind==="state")}function we({area:e,overview:t}){const n=p({kind:"default"}),a=me(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:[de(e.resolved.source,t.preset),T(l)].filter(Boolean).join(" · "),why:s.jsx(b,{question:`Why is ${e.label} set to ${f[e.resolved.state]}?`,sentence:z({...e.resolved,preset:t.preset}),...e.lastChange?{lastChange:e.lastChange}:{}}),onChange:m,disabled:n.isPending,footer:s.jsx(pe,{area:e.id,areaLabel:e.label,agents:a}),details:s.jsx(X,{scope:{kind:"default"},area:e,surface:"settings",preset:t.preset})}),s.jsx(ce,{open:o!==null,onCancel:()=>d(null),subject:e.label,next:o??"ask",agents:a.map(r=>({agentId:r.agentId,agentName:r.agentName,detail:`${f[r.state]}${r.action?" (one action)":""}`})),affectedCount:l,onKeep:()=>o&&i(o),onUpdate:r=>o&&i(o,r),pending:n.isPending})]})}function ye({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: ${f[n.inherited.state]}`:`Same as everyone (${f[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 ${f[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 Te({scope:e}){const t=y(),n=ue(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(we,{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(Ne,{agentId:e.agentId,agentName:n.data.agentName,files:n.data.filesAndCommands}),O(n.data.areas).map(a=>s.jsx(ye,{agentId:e.agentId,agentName:n.data.agentName,area:a},a.id))]}):s.jsx(C,{className:"h-20 w-full"})}function ke(e,t){if(t.key.kind==="chat")return ie(e);if(t.key.kind==="account")return le(e);if(e===null)return t.target.kind==="agent"?"the default":"the preset";switch(t.key.kind){case"files":return Ce(e)?g(e):e;case"preset":return e in S?S[e]:e;default:return e in f?f[e]:e}}function Ce(e){return re.includes(e)}function $e(e){if(e.length===1){const{change:t}=e[0];return`This has changed since. Set it back to ${ke(t.before,t)} anyway?`}return"Some of this has changed since. Set it all back anyway?"}function Se(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 Ae({item:e}){const t=fe(),[n,a]=N.useState(null),[l,o]=N.useState(null),d=e.undone,i=e.undoable&&!d,m=ae(e.occurredAt),r=u=>t.mutate({eventId:e.id,...u?{force:!0}:{}},{onSuccess:c=>{a(null),o(Se(c))},onError:c=>{const h=xe(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:$e(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 Fe({agentId:e}){const{data:t,isPending:n,isError:a}=he(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(Ae,{item:o},o.id))})}export{ze as D,Te as P,Fe as a};
@@ -1 +0,0 @@
1
- import{j as r}from"./index-BYTLOFNS.js";import{b as t}from"./ProfileFields-qnjDsdIB.js";import"./profile-errors-OMPgeYKJ.js";import"./use-mounted-ref-Bb8zNmgI.js";function s({member:o}){return r.jsx(t,{member:o})}export{s as PhotoPage};
@@ -1,3 +0,0 @@
1
- import{r as m,ej as Ve,j as e,a3 as fe,G as Y,I as Be,ew as q,ex as U,ey as G,ez as K,eA as L,Z as le,_ as ce,iV as de,iW as ue,e2 as Re,an as We,J as me,eL as R,e as ge,ak as qe,al as Ue,am as Ge,iX as Ke,a5 as Ye,ep as xe,a6 as He,iY as Qe,eu as ne,ev as Xe,iZ as Ze,a4 as Je,i_ as Ee,i$ as Oe,j0 as es,B as W,$ as ss,h7 as je,a2 as ve,eJ as ts,h6 as ns,d$ as rs,fL as as,j1 as os,j2 as is,c3 as ls,aO as cs,y as ds,h8 as us,h9 as ms,b0 as hs,b3 as fs,d2 as xs,d3 as ps,d5 as gs,em as js,d6 as vs,d7 as ys,h4 as bs,fM as Ns,fN as ws,fO as Cs,fP as Ss,fQ as ks,fR as Rs}from"./index-BYTLOFNS.js";import{a as Es,u as Os}from"./form-Cf49Z6eU.js";import{a as Ms}from"./trust-dial-tuMHO5Ug.js";import{C as As,a as Fs,b as Ds,c as $s,d as ye,e as he}from"./command-DU2-hlOP.js";import{A as Ls}from"./AgentPicker-Chtkpz5v.js";import{d as zs,k as Is,e as be}from"./execution-config-D9vIc46b.js";import{s as Ts}from"./settings-for-runtime-BoOa-ZFG.js";import{l as _s}from"./list-runtime-types-Cyl4h4lV.js";import{f as Ps,u as Vs}from"./format-cron-Dlp0mfqz.js";const I=(s,r=i=>i,t)=>Es(s,r,{compare:t});function Bs(){const[s,r]=m.useState({x:0,y:0}),[t,i]=m.useState(!1),a=Ve(),l=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(hover: none)").matches,c=a||l,d=m.useCallback(x=>{if(c)return;const j=x.currentTarget.getBoundingClientRect();r({x:x.clientX-j.left,y:x.clientY-j.top}),i(!0)},[c]),h=m.useCallback(()=>{i(!1)},[]),v=!c&&t?{background:`radial-gradient(350px circle at ${s.x}px ${s.y}px, rgba(59,130,246,0.06), transparent 80%)`}:void 0;return{position:s,isActive:t,onMouseMove:d,onMouseLeave:h,spotlightStyle:v}}function Ws({preset:s,variant:r,checked:t,onCheckedChange:i,onSelect:a,selected:l=!1,className:c}){const{onMouseMove:d,onMouseLeave:h,spotlightStyle:v}=Bs(),x=()=>{r==="toggle"?i==null||i(!t):a==null||a(s)};return e.jsxs("button",{type:"button",onClick:x,onMouseMove:d,onMouseLeave:h,"aria-label":`${s.name}: ${s.description}`,className:Y("relative flex w-full items-start gap-4 rounded-lg border p-4 text-left transition","hover:bg-accent/50 focus-ring","min-h-11",r==="toggle"&&t&&"border-primary/40 bg-accent/30",r==="selectable"&&l&&"border-primary ring-primary bg-accent/30 ring-1",c),children:[v&&e.jsx("div",{className:"pointer-events-none absolute inset-0 rounded-lg",style:v}),r==="toggle"&&e.jsx("div",{className:"flex size-11 shrink-0 items-center justify-center",children:e.jsx(fe,{checked:t??!1,onCheckedChange:i,"aria-label":`Enable ${s.name}`,onClick:j=>j.stopPropagation()})}),e.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[e.jsx("div",{className:"font-medium",children:s.name}),e.jsx("p",{className:"text-muted-foreground text-sm",children:s.description}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground text-xs",children:Ps(s.cron)}),e.jsx("p",{"aria-hidden":"true",className:"text-muted-foreground/80 line-clamp-2 text-sm",children:s.prompt})]})]})}function Me({onSelect:s,selectedId:r,className:t}){const{data:i,isLoading:a,isError:l}=Vs();return a?e.jsx("div",{className:Y("grid grid-cols-2 gap-3",t),children:[0,1,2,3].map(c=>e.jsx("div",{className:"bg-muted animate-breath h-28 rounded-lg border"},c))}):l?e.jsx("p",{className:"text-destructive text-sm",children:"Couldn’t load ready-made tasks. Start from scratch instead."}):!i||i.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:"No ready-made tasks yet."}):e.jsx("div",{className:Y("grid grid-cols-2 gap-3",t),children:i.map(c=>e.jsx(Ws,{preset:c,variant:"selectable",selected:c.id===r,onSelect:s},c.id))})}const B={frequency:"daily",hour:9,days:[1,2,3,4,5],dayOfMonth:1},qs=[{value:"15m",label:"Every 15 minutes"},{value:"hourly",label:"Every hour"},{value:"daily",label:"Every day"},{value:"weekly",label:"Every week"},{value:"monthly",label:"Every month"}],Us=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],Gs=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Ks=[1,2,3,4,5],Ys=[0,6];function Ne(s){const r=s.trim();if(!r)return null;const t=r.split(/\s+/);if(t.length!==5)return null;const[i,a,l,c,d]=t;if(c!=="*")return null;if(i==="*/15"&&a==="*"&&l==="*"&&d==="*")return{...B,frequency:"15m"};if(i!=="0")return null;if(a==="*"&&l==="*"&&d==="*")return{...B,frequency:"hourly"};const h=Number(a);if(!Number.isInteger(h)||h<0||h>23)return null;if(l!=="*"&&d==="*"){const v=Number(l);return!Number.isInteger(v)||v<1||v>31?null:{...B,frequency:"monthly",hour:h,dayOfMonth:v}}if(l==="*"&&d==="*")return{...B,frequency:"daily",hour:h};if(l==="*"&&d!=="*"){const v=Hs(d);return v?{...B,frequency:"weekly",hour:h,days:v}:null}return null}function Hs(s){const r=[];for(const t of s.split(",")){const i=t.match(/^(\d)-(\d)$/);if(i){const a=Number(i[1]),l=Number(i[2]);if(a>6||l>6||a>l)return null;for(let c=a;c<=l;c++)r.push(c)}else{const a=Number(t);if(!Number.isInteger(a)||a<0||a>6)return null;r.push(a)}}return r.length>0?r.sort((t,i)=>t-i):null}function we(s){switch(s.frequency){case"15m":return"*/15 * * * *";case"hourly":return"0 * * * *";case"daily":return`0 ${s.hour} * * *`;case"weekly":return`0 ${s.hour} * * ${s.days.join(",")}`;case"monthly":return`0 ${s.hour} ${s.dayOfMonth} * *`}}function Ae(s){const r=s<12?"AM":"PM";return`${s%12||12}:00 ${r}`}function Fe(s){const r=s%100;if(r>=11&&r<=13)return`${s}th`;const t=s%10;return t===1?`${s}st`:t===2?`${s}nd`:t===3?`${s}rd`:`${s}th`}function Ce(s,r){return s.length===r.length&&s.every((t,i)=>t===r[i])}function Qs(s){const r=Ae(s.hour);switch(s.frequency){case"15m":return"Runs every 15 minutes";case"hourly":return"Runs every hour, on the hour";case"daily":return`Runs every day at ${r}`;case"weekly":{const t=[...s.days].sort((c,d)=>c-d);if(Ce(t,Ks))return`Runs every weekday at ${r}`;if(Ce(t,Ys))return`Runs every Saturday and Sunday at ${r}`;const a=t.filter(c=>c!==0).concat(t.includes(0)?[0]:[]).map(c=>Gs[c]);if(a.length===1)return`Runs every ${a[0]} at ${r}`;if(a.length===2)return`Runs every ${a[0]} and ${a[1]} at ${r}`;const l=a.pop();return`Runs every ${a.join(", ")}, and ${l} at ${r}`}case"monthly":return`Runs on the ${Fe(s.dayOfMonth)} of every month at ${r}`}}const Xs="Can’t read this timing. Check the format.";function oe(s){const r=s.trim();if(!r)return!0;try{return Re.toString(r),!0}catch{return!1}}function Zs(s){const r=s.trim();return r?oe(r)?Re.toString(r):Xs:""}function Js({value:s,onChange:r}){const t=Ne(s),[i,a]=m.useState(t?"simple":s.trim()?"cron":"simple"),[l,c]=m.useState(t??B),d=m.useRef(s);m.useEffect(()=>{if(s===d.current)return;d.current=s;const o=Ne(s);o?(a("simple"),c(o)):s.trim()&&a("cron")},[s]);function h(o){c(o);const g=we(o);d.current=g,r(g)}function v(o){h({...l,frequency:o})}function x(o){h({...l,hour:Number(o)})}function j(o){const g=l.days.includes(o);if(g&&l.days.length<=1)return;const w=g?l.days.filter(S=>S!==o):[...l.days,o].sort((S,N)=>S-N);h({...l,days:w})}function p(o){h({...l,dayOfMonth:Number(o)})}function k(){a("cron")}function C(){a("simple");const o=we(l);d.current=o,r(o)}const u=l.frequency!=="15m"&&l.frequency!=="hourly";return i==="cron"?e.jsxs("div",{className:"space-y-2",children:[e.jsx("button",{type:"button",onClick:C,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Back to simple schedule"}),e.jsx(Be,{className:"font-mono",value:s,onChange:o=>r(o.target.value),placeholder:"0 9 * * 1-5"}),s.trim()&&e.jsx("p",{className:Y("text-xs",oe(s)?"text-muted-foreground":"text-destructive"),children:Zs(s)}),e.jsx("a",{href:"https://crontab.guru",target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground block text-xs hover:underline",children:"Learn about cron expressions"})]}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs(q,{value:l.frequency,onValueChange:v,children:[e.jsx(U,{"aria-label":"Frequency",children:e.jsx(G,{})}),e.jsx(K,{children:qs.map(o=>e.jsx(L,{value:o.value,children:o.label},o.value))})]}),e.jsx(le,{initial:!1,mode:"wait",children:u&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"at"}),e.jsxs(q,{value:String(l.hour),onValueChange:x,children:[e.jsx(U,{className:"w-32","aria-label":"Time",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:24},(o,g)=>e.jsx(L,{value:String(g),children:Ae(g)},g))})]})]})},"time")}),e.jsx(le,{initial:!1,children:l.frequency==="weekly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:Us.map(o=>{const g=l.days.includes(o.value);return e.jsx("button",{type:"button","aria-label":o.label,"aria-pressed":g,className:Y("inline-flex min-h-11 items-center justify-center rounded-md border px-2.5 py-1 text-xs font-medium transition-colors md:min-h-0",g?"border-primary bg-primary/10 text-primary":"border-input text-muted-foreground hover:bg-accent hover:text-accent-foreground"),onClick:()=>j(o.value),children:o.label},o.value)})})},"days")}),e.jsx(le,{initial:!1,children:l.frequency==="monthly"&&e.jsx(ce.div,{variants:ue,initial:"initial",animate:"animate",exit:"exit",transition:de,className:"overflow-hidden",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-sm",children:"on day"}),e.jsxs(q,{value:String(l.dayOfMonth),onValueChange:p,children:[e.jsx(U,{className:"w-20","aria-label":"Day of month",children:e.jsx(G,{})}),e.jsx(K,{children:Array.from({length:31},(o,g)=>e.jsx(L,{value:String(g+1),children:Fe(g+1)},g+1))})]})]})},"dom")}),e.jsx("p",{className:"text-muted-foreground text-xs",children:Qs(l)}),e.jsx("button",{type:"button",onClick:k,className:"text-muted-foreground hover:text-foreground text-xs underline-offset-4 hover:underline",children:"Use a cron expression"})]})}function et(s){const r=new Map;for(const t of s){const[i]=t.split("/");r.has(i)||r.set(i,[]),r.get(i).push(t)}return r}function st({value:s,onChange:r}){const[t,i]=m.useState(!1),a=m.useRef(null),l=m.useMemo(()=>{try{return Intl.supportedValuesOf("timeZone")}catch{return[]}},[]),c=m.useMemo(()=>et(l),[l]),d=m.useMemo(()=>Intl.DateTimeFormat().resolvedOptions().timeZone,[]);m.useEffect(()=>{if(!t)return;function x(j){a.current&&!a.current.contains(j.target)&&i(!1)}return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[t]);const h=s||"System default";function v(x){r(x),i(!1)}return e.jsxs("div",{ref:a,className:"relative w-full",children:[e.jsxs("button",{type:"button","aria-expanded":t,"aria-haspopup":"listbox",className:Y("border-input ring-offset-background flex h-9 w-full items-center justify-between rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs transition-colors","focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none","hover:bg-accent/50"),onClick:()=>i(x=>!x),children:[e.jsx("span",{className:"truncate",children:h}),e.jsx(We,{className:"ml-2 size-4 shrink-0 opacity-50"})]}),t&&e.jsx("div",{className:"bg-popover text-popover-foreground absolute top-full left-0 z-50 mt-1 w-full rounded-md border shadow-md",children:e.jsxs(As,{children:[e.jsx(Fs,{placeholder:"Search timezone…"}),e.jsxs(Ds,{className:"max-h-60",children:[e.jsx($s,{children:"No timezone found."}),e.jsxs(ye,{heading:"Default",children:[e.jsxs(he,{value:"system-default",onSelect:()=>v(""),children:[e.jsx("span",{children:"System default"}),s===""&&e.jsx(me,{className:"ml-auto size-4"})]}),d&&e.jsxs(he,{value:`${d}-detected`,onSelect:()=>v(d),children:[e.jsxs("span",{children:[d," (detected)"]}),s===d&&e.jsx(me,{className:"ml-auto size-4"})]})]}),[...c.entries()].map(([x,j])=>e.jsx(ye,{heading:x,children:j.map(p=>e.jsxs(he,{value:p,onSelect:()=>v(p),children:[e.jsx("span",{children:p.replace(`${x}/`,"").replace(/_/g," ")}),p===s&&e.jsx(me,{className:"ml-auto size-4"})]},p))},x))]})]})})]})}function tt({roster:s,value:r}){const t="flex h-9 w-full items-center gap-2 text-sm";if(!r)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"No agent"});if(s.unreadable)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"Couldn’t load your agents to show this one."});if(!s.answered)return e.jsxs("div",{"data-testid":"settled-agent-loading",className:t,"aria-hidden":!0,children:[e.jsx(ge,{className:"size-5 rounded-full"}),e.jsx(ge,{className:"h-4 w-32"})]});const i=s.agents.find(l=>l.id===r);if(!i)return e.jsx("p",{"data-testid":"settled-agent",className:`${t} text-muted-foreground`,children:"This agent isn’t registered any more."});const a=qe(i);return e.jsxs("p",{"data-testid":"settled-agent",className:t,children:[e.jsx(Ue,{color:a.color,emoji:a.emoji,size:"xs"}),e.jsx("span",{className:"truncate",children:Ge(i)})]})}function nt({roster:s,value:r,locked:t,onChange:i}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx(R,{children:"Agent"}),t?e.jsxs(e.Fragment,{children:[e.jsx(tt,{roster:s,value:r}),e.jsx("p",{"data-testid":"agent-locked-note",className:"text-muted-foreground text-xs leading-relaxed",children:"The agent is set once. For another agent, make a new task."})]}):e.jsx(Ls,{agents:s.agents,value:r||void 0,onValueChange:a=>i(a??"")})]})}function De(s,r){var c,d;const t=s.map(h=>h.projectPath).join(`
2
- `),i=m.useMemo(()=>t?t.split(`
3
- `):[],[t]),{data:a}=Ke(i),l=r?(c=s.find(h=>h.id===r))==null?void 0:c.projectPath:void 0;return l?((d=a==null?void 0:a[l])==null?void 0:d.runtime)??null:null}const $="__inherit__";function rt(s){var _;const{runtime:r,model:t,effort:i,agentRuntime:a}=s,l=Ye(),{data:c}=xe(),d=c?Object.keys(c.capabilities):void 0,h=(c==null?void 0:c.defaultRuntime)??null,x=(y=>y!==null&&d!==void 0&&d.includes(y))(a),j=x?a:h,p=r||j,k=p??void 0,C=k!==void 0&&d!==void 0&&d.includes(k),{data:u}=He({...Qe(l,k?{runtime:k}:{}),enabled:C,retry:!1}),o=t?u==null?void 0:u.find(y=>y.value===t):void 0,g=(_=Ts(c,p))==null?void 0:_.supportsEffort,w=p?zs({agent:{runtime:p,model:t||null,effort:i||null},defaultRuntime:p,knownRuntimes:d,knownModels:Is(u),modelSupportsEffort:o?o.supportsEffort??!1:void 0,runtimeSupportsEffort:g,runtimeLabel:y=>ne(y).label}):null,S=y=>{var b;return((b=w==null?void 0:w.breakages.find(M=>y.includes(M.kind)))==null?void 0:b.message)??null},N=d==null?void 0:d.join(","),T=m.useMemo(()=>{const y=N===void 0?[]:N.split(",").filter(Boolean),b=_s(y).filter(M=>y.includes(M));return r&&!b.includes(r)&&b.push(r),b.map(M=>({value:M,label:ne(M).label}))},[N,r]),F=m.useMemo(()=>{const y=(u??[]).map(b=>({value:b.value,label:b.displayName}));return t&&!y.some(b=>b.value===t)&&y.push({value:t,label:t}),y},[u,t]),H=m.useMemo(()=>{const y=Xe.filter(b=>!(o!=null&&o.supportedEffortLevels)||o.supportedEffortLevels.includes(b)).map(b=>({value:b,label:be(b)}));return i&&!y.some(b=>b.value===i)&&y.push({value:i,label:be(i)}),y},[o,i]),D=j===null?"Same as agent":x?`Same as agent (${ne(j).label})`:`Server default (${ne(j).label})`;return{effectiveRuntime:p,runtimeOptions:T,inheritRuntimeLabel:D,modelOptions:F,supportsEffort:g===!0,effortOptions:H,runtimeWarning:S(["runtime-not-connected"]),modelWarning:S(["model-unavailable"]),effortWarning:S(["effort-unsupported-runtime","effort-unsupported-model"])}}const re="text-xs text-status-warning-fg";function at({runtime:s,model:r,effort:t,execution:i,onRuntimeChange:a,onModelChange:l,onEffortChange:c}){const{runtimeOptions:d,inheritRuntimeLabel:h,modelOptions:v,supportsEffort:x,effortOptions:j,runtimeWarning:p,modelWarning:k,effortWarning:C}=i;return e.jsxs("fieldset",{className:"space-y-3",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Runs on"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-runtime",children:"Runs on"}),e.jsxs(q,{value:s||$,onValueChange:u=>a(u===$?"":u),children:[e.jsx(U,{id:"schedule-runtime",responsive:!1,className:"text-sm","data-testid":"task-runtime-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:h}),d.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),p&&e.jsx("p",{"data-testid":"task-runtime-warning",className:re,children:p})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-model",children:"Model"}),e.jsxs(q,{value:r||$,onValueChange:u=>l(u===$?"":u),children:[e.jsx(U,{id:"schedule-model",responsive:!1,className:"text-sm","data-testid":"task-model-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),v.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),k&&e.jsx("p",{"data-testid":"task-model-warning",className:re,children:k})]}),x?e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-effort",children:"Effort"}),e.jsxs(q,{value:t||$,onValueChange:u=>c(u===$?"":u),children:[e.jsx(U,{id:"schedule-effort",responsive:!1,className:"text-sm","data-testid":"task-effort-select",children:e.jsx(G,{})}),e.jsxs(K,{children:[e.jsx(L,{value:$,children:"Agent default"}),j.map(u=>e.jsx(L,{value:u.value,children:u.label},u.value))]})]}),C&&e.jsx("p",{"data-testid":"task-effort-warning",className:re,children:C})]}):t&&e.jsxs("div",{className:"space-y-1.5","data-testid":"task-effort-stranded",children:[e.jsx(R,{children:"Effort"}),e.jsx("p",{className:re,children:C??"No effort setting here, so this does nothing."}),e.jsx("button",{type:"button",onClick:()=>c(""),className:"focus-ring text-status-warning-fg rounded-sm text-xs underline-offset-2 hover:underline","data-testid":"task-effort-clear",children:"Clear it"})]})]})}function ot(s){return s.asks!=="never"&&s.id!==Ze}function it(){return e.jsxs("div",{role:"note","data-testid":"task-unattended-warning",className:"bg-status-warning-bg border-status-warning-border text-status-warning-fg flex gap-2 rounded-md border px-2.5 py-2 text-xs leading-relaxed",children:[e.jsx(Je,{className:"mt-0.5 size-5 shrink-0 sm:size-3.5","aria-hidden":!0}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Nobody is there to approve asks on a scheduled run."}),e.jsx("p",{children:"Each ask is refused, so the run will need attention."}),e.jsx("p",{children:"Use Never ask with an allow list for the commands it needs."}),e.jsx("p",{children:"“Run now” still asks you."})]})]})}const ae="10m";function lt(s){return`${Math.round(s/6e4)}m`}function P(s,r,t,i="acceptEdits"){return s?{name:s.name,description:s.description??"",prompt:s.prompt,cron:s.cron??"",agentId:s.agentId??"",timezone:s.timezone??"",permissionMode:s.permissionMode,maxRuntime:s.maxRuntime?lt(s.maxRuntime):ae,sticky:s.sticky,runtime:s.runtime??"",model:s.model??"",effort:s.effort??""}:r?{name:r.name,description:r.description,prompt:r.prompt,cron:r.cron,agentId:t??"",timezone:r.timezone??"",permissionMode:i,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}:{name:"",description:"",prompt:"",cron:"",agentId:t??"",timezone:"",permissionMode:i,maxRuntime:ae,sticky:!1,runtime:"",model:"",effort:""}}function Se(s){const r=s.cron.trim();return{name:s.name.trim(),description:s.description.trim(),prompt:s.prompt.trim(),cron:r||null,...r&&s.timezone?{timezone:s.timezone}:{},permissionMode:s.permissionMode,maxRuntime:s.maxRuntime.trim()||void 0,sticky:s.sticky,runtime:s.runtime||null,model:s.model||null,effort:s.effort||null}}function ct(s,r){const t=Se(s),i=Se(r);return Object.fromEntries(Object.entries(i).filter(([a,l])=>l!==t[a]))}const $e=100;function dt(s,r=[]){const t=new Set([...r].map(a=>a.toLowerCase())),i=s.name.trim();for(let a=1;;a++){const l=a===1?"-copy":`-copy-${a}`,c=`${i.slice(0,$e-l.length)}${l}`;if(!t.has(c.toLowerCase()))return{...s,name:c}}}const ut={record:["This schedule came with a package. Only the package can change what it does.","You can still turn it on or off, or change when it runs."],legacy:["This schedule came with a package from an older DorkOS.","DorkOS can’t yet tell its files from yours.","You can still turn it on or off, or change when it runs.","To edit the rest, choose Check files on its package in Marketplace › Installed."]};function ke(s){var t;const r=s;return(r==null?void 0:r.code)!==os?null:{message:r.message,ownedBy:((t=r.body)==null?void 0:t.ownedBy)==="legacy"?"legacy":"record"}}function mt({defaultValues:s,roster:r,editTask:t,onSubmitSuccess:i,onCancel:a,onDeleteClick:l,isPending:c,onMakeCopy:d,leading:h}){var ee,se;const v=Ee(),x=m.useRef(!0);m.useEffect(()=>(x.current=!0,()=>{x.current=!1}),[]);const j=Oe({isShownInline:n=>x.current&&ke(n)!==null}),p=t?ke(j.error):null,k=(t==null?void 0:t.packageOwned)??null,C=k??(p==null?void 0:p.ownedBy)??null,u=k!==null,o=Os({defaultValues:s,onSubmit:({value:n})=>{const f=n.agentId.trim()||void 0,A=n.cron.trim();if(t){const O=ct(s,n);if(Object.keys(O).length===0){i();return}j.mutate({id:t.id,...O},{onSuccess:i})}else{const O=f??"global",te={name:n.name.trim(),description:n.description.trim()||n.name.trim(),prompt:n.prompt.trim(),target:O,cron:A||void 0,...A&&n.timezone?{timezone:n.timezone}:{},permissionMode:n.permissionMode,maxRuntime:n.maxRuntime.trim()||void 0,...n.sticky?{sticky:!0}:{},...n.runtime?{runtime:n.runtime}:{},...n.model?{model:n.model}:{},...n.effort?{effort:n.effort}:{}};v.mutate(te,{onSuccess:i})}}}),g=I(o.store,n=>n.values.agentId),w=I(o.store,n=>n.values.runtime),S=I(o.store,n=>n.values.model),N=I(o.store,n=>n.values.effort),T=I(o.store,n=>n.values.permissionMode),F=I(o.store,n=>n.values.cron),[H,D]=m.useState(!!s.cron),[_,y]=m.useState(!1),b=I(o.store,n=>n.values.maxRuntime),M=I(o.store,n=>n.values.sticky),z=[w!=="",S!=="",N!=="",b!==ae,M,es(T)].filter(Boolean).length,J=De(r.agents,g),V=rt({runtime:w,model:S,effort:N,agentRuntime:J}),{data:Q}=xe(),X=(V.effectiveRuntime?(se=(ee=Q==null?void 0:Q.capabilities[V.effectiveRuntime])==null?void 0:ee.permissionModes)==null?void 0:se.values:void 0)??[];return e.jsxs(o.AppForm,{children:[e.jsx("form",{onSubmit:n=>{n.preventDefault(),o.handleSubmit()},id:"schedule-form",className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-5 px-4 py-5",children:[C!==null&&e.jsxs("div",{role:"status","data-slot":"package-owned-notice",className:"bg-muted/40 space-y-2 rounded-md border px-3 py-2 text-xs",children:[p?e.jsx("p",{children:p.message}):ut[C].map(n=>e.jsx("p",{children:n},n)),C==="record"&&d&&e.jsxs(W,{type:"button",variant:"outline",size:"xs",onClick:()=>d(o.state.values),children:[e.jsx(ss,{}),"Make a copy"]})]}),h,e.jsx(nt,{roster:r,value:g,locked:t!==void 0,onChange:n=>o.setFieldValue("agentId",n)}),e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-5",children:[e.jsx(o.AppField,{name:"name",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-name",children:"Name *"}),e.jsx("input",{id:"schedule-name",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,maxLength:$e,placeholder:"Daily code review"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})}),e.jsx(o.AppField,{name:"description",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-description",children:"Description *"}),e.jsx("input",{id:"schedule-description",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,placeholder:"A short description of this schedule"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})}),e.jsx(o.AppField,{name:"prompt",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-prompt",children:"Prompt *"}),e.jsx("textarea",{id:"schedule-prompt",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-full rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,rows:4,placeholder:"Review all pending PRs and summarize findings…"}),n.state.meta.isTouched&&n.state.meta.errors.length>0&&e.jsx("p",{className:"text-destructive text-xs",children:String(n.state.meta.errors[0])})]})})]}),e.jsx(je,{open:H,onOpenChange:D,trigger:"Schedule",badge:e.jsx(ve,{variant:"secondary",className:"text-xs",children:F?"On a schedule":"Optional"}),children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(o.AppField,{name:"cron",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"When it runs"}),e.jsx(Js,{value:n.state.value,onChange:f=>n.handleChange(f)})]})}),e.jsx(o.AppField,{name:"timezone",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{children:"Timezone"}),e.jsx(st,{value:n.state.value,onChange:f=>n.handleChange(f)})]})})]})}),e.jsx(o.Subscribe,{selector:n=>!oe(n.values.cron),children:n=>n?e.jsx("p",{role:"alert","data-testid":"cron-blocks-save",className:"text-destructive text-xs",children:"Fix the timing under Schedule before saving."}):null}),e.jsx(je,{open:_,onOpenChange:y,trigger:"Advanced settings",badge:z>0?e.jsxs(ve,{variant:"secondary",className:"text-xs",children:[z," changed"]}):void 0,children:e.jsxs("fieldset",{disabled:u,className:"min-w-0 space-y-4",children:[e.jsx(at,{runtime:w,model:S,effort:N,execution:V,onRuntimeChange:n=>o.setFieldValue("runtime",n),onModelChange:n=>o.setFieldValue("model",n),onEffortChange:n=>o.setFieldValue("effort",n)}),e.jsx(o.AppField,{name:"permissionMode",children:n=>{const f=X.find(O=>O.id===n.state.value),A=(f==null?void 0:f.label)??ts(n.state.value);return X.length===0?e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsxs("p",{"data-testid":"trust-dial-unavailable",className:"text-muted-foreground px-1 text-xs leading-relaxed",children:["Set to “",A,"”. No other options to choose yet. Saving keeps it."]})]}):e.jsxs("fieldset",{className:"space-y-2",children:[e.jsx("legend",{className:"mb-1.5 text-sm font-medium",children:"Permissions"}),e.jsx(Ms,{mode:n.state.value,descriptors:X,onChangeMode:O=>n.handleChange(O),strandsWorkingMode:!0,strandedNote:e.jsxs(e.Fragment,{children:["Set to “",A,"”, which isn’t listed. Saving keeps it. Pick a stop to change it."]})}),f!==void 0&&ot(f)&&e.jsx(it,{}),e.jsx(ns,{mode:n.state.value,...f?{descriptor:f}:{},className:"px-1"})]})}}),e.jsx(o.AppField,{name:"maxRuntime",children:n=>e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(R,{htmlFor:"schedule-max-runtime",children:"Stop after"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Ends the run if it takes longer."}),e.jsx("input",{id:"schedule-max-runtime",className:"border-input focus-visible:ring-ring disabled:bg-muted/40 w-24 rounded-md border bg-transparent px-3 py-2 text-sm shadow-xs focus-visible:ring-1 focus-visible:outline-none disabled:cursor-default",value:n.state.value,onChange:f=>n.handleChange(f.target.value),onBlur:n.handleBlur,placeholder:"10m"})]})}),e.jsx(o.AppField,{name:"sticky",children:n=>e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"schedule-sticky",children:"Remember the last run"}),e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed",children:"Pick up where the last run left off. Off starts fresh each time."})]}),e.jsx(fe,{id:"schedule-sticky",checked:n.state.value,onCheckedChange:f=>n.handleChange(f)})]})})]})})]})}),e.jsxs(rs,{className:"shrink-0 border-t px-4 py-3",children:[t&&e.jsxs(W,{type:"button",variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive mr-auto",onClick:l,children:[e.jsx(as,{className:"mr-1.5 size-4"}),"Delete"]}),e.jsx(W,{variant:"ghost",size:"sm",onClick:a,children:"Cancel"}),e.jsx(o.Subscribe,{selector:n=>n.values.name.trim()!==""&&n.values.prompt.trim()!==""&&oe(n.values.cron),children:n=>e.jsx(W,{type:"submit",size:"sm",form:"schedule-form",disabled:!n||c,children:c?"Saving…":t?"Save":"Create task"})})]})]})}function Nt({open:s,onOpenChange:r,editTask:t,initialPreset:i,initialAgentId:a}){var pe;const l=is(),c=Oe(),d=Ee(),{data:h,isError:v}=ls(),x={agents:(h==null?void 0:h.agents)??[],answered:h!==void 0,unreadable:v},{data:j}=xe(),p=De(x.agents,a),C=p!==null&&j!==void 0&&Object.hasOwn(j.capabilities,p)?p:(j==null?void 0:j.defaultRuntime)??null,{data:u}=cs(),o=ds(C),g=us(C?ms(u==null?void 0:u.executionDefaults,C):null,((pe=o==null?void 0:o.permissionModes)==null?void 0:pe.values)??[]),w=m.useRef(g);m.useLayoutEffect(()=>{w.current=g},[g]);const[S,N]=m.useState(()=>t?"form":"preset-picker"),[T,F]=m.useState(null),[H,D]=m.useState(!1),[_,y]=m.useState((t==null?void 0:t.enabled)??!0),[b,M]=m.useState(!1),z=b?void 0:t,[J,V]=m.useState(!0),{data:Q}=hs(),[X,ee]=m.useState(()=>P(t,void 0,a,g)),[se,n]=m.useState(0);function f(E,ie=!1){ee(E),n(Z=>Z+1),M(ie)}m.useEffect(()=>{if(!s){f(P(t,void 0,a,w.current)),F(null),D(!1),N(t?"form":"preset-picker");return}t?(f(P(t)),y(t.enabled),N("form")):i?(f(P(void 0,i,a,w.current)),F(i),N("form")):(f(P(void 0,void 0,a,w.current)),N("preset-picker"))},[t,s,i,a]);const{pendingTemplate:A,externalTrigger:O,clear:te}=fs();m.useEffect(()=>{O&&A&&(f(P(void 0,A,a,w.current)),F(A),N("form"),te())},[O,A,te,a]);function Le(E){f(P(void 0,E,a,w.current)),F(E),N("form")}function ze(E){const ie=(Q??[]).filter(Z=>(Z.agentId??"")===E.agentId).map(Z=>Z.name);V(!0),f(dt(E,ie),!0)}function Ie(){b&&J&&t&&c.mutate({id:t.id,enabled:!1}),r(!1)}function Te(){t&&l.mutate(t.id,{onSuccess:()=>{D(!1),r(!1)}})}function _e(E){t&&(y(E),c.mutate({id:t.id,enabled:E},{onError:()=>y(t.enabled)}))}const Pe=d.isPending||c.isPending;return e.jsxs(xs,{open:s,onOpenChange:r,children:[e.jsxs(ps,{className:"flex max-h-[85vh] max-w-lg flex-col gap-0 p-0",children:[e.jsxs(gs,{className:"shrink-0 border-b px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[S==="form"&&!z&&!b&&e.jsxs("button",{type:"button",onClick:()=>N("preset-picker"),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-sm","aria-label":"Back to preset picker",children:[e.jsx(js,{className:"size-4"}),"Back"]}),e.jsx(vs,{children:z?"Edit schedule":"New schedule"}),z&&e.jsx(fe,{className:"ml-auto",checked:_,onCheckedChange:_e,disabled:c.isPending,"aria-label":_?"Disable schedule":"Enable schedule"})]}),e.jsx(ys,{className:"sr-only",children:z?"Edit an existing schedule":"Create a new schedule"})]}),S==="preset-picker"&&e.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:e.jsxs("div",{className:"space-y-4 px-4 py-5",children:[e.jsx("p",{className:"text-muted-foreground text-sm",children:"Start from a template"}),e.jsx(Me,{onSelect:Le,selectedId:T==null?void 0:T.id}),e.jsx("button",{type:"button",onClick:()=>{F(null),N("form")},className:"text-muted-foreground hover:text-foreground w-full text-center text-sm transition-colors",children:"Start from scratch"})]})}),S==="form"&&e.jsx(mt,{defaultValues:X,roster:x,editTask:z,onSubmitSuccess:Ie,onCancel:()=>r(!1),onDeleteClick:()=>D(!0),isPending:Pe,onMakeCopy:ze,leading:b&&t?e.jsxs("div",{className:"flex items-start gap-2 rounded-md border px-3 py-2",children:[e.jsx(bs,{id:"copy-switch-off-original",checked:J,onCheckedChange:E=>V(E===!0)}),e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(R,{htmlFor:"copy-switch-off-original",className:"text-sm font-normal",children:"Switch off the package’s schedule"}),e.jsxs("p",{className:"text-muted-foreground text-xs",children:["So “",t.name,"” and your copy don’t both run."]})]})]}):void 0},se)]}),t&&e.jsx(Ns,{open:H,onOpenChange:D,children:e.jsxs(ws,{children:[e.jsxs(Cs,{children:[e.jsxs(Ss,{children:["Delete “",t.name,"”?"]}),e.jsx(ks,{children:"Its run history is deleted too. This can’t be undone."})]}),e.jsxs(Rs,{children:[e.jsx("button",{onClick:()=>D(!1),className:"border-input hover:bg-accent hover:text-accent-foreground inline-flex items-center rounded-md border bg-transparent px-3 py-1.5 text-sm font-medium shadow-xs transition-colors",children:"Cancel"}),e.jsx(W,{variant:"destructive",size:"sm",onClick:Te,loading:l.isPending,loadingLabel:"Deleting…",children:"Delete task"})]})]})})]})}function wt({onCreateWithPreset:s,onCreateBlank:r}){return e.jsxs("div",{className:"flex flex-col items-center pb-8 md:pb-12",children:[e.jsx("h3",{className:"mb-2 text-lg font-medium",children:"No schedules yet"}),e.jsx("p",{className:"text-muted-foreground mb-6 max-w-sm text-center text-sm",children:"Put a skill on a timer and it runs without you."}),e.jsx("div",{className:"w-full max-w-lg",children:e.jsx(Me,{onSelect:s})}),e.jsx(W,{variant:"ghost",className:"mt-4",onClick:r,children:"New custom schedule"})]})}export{Nt as C,wt as T};
@@ -1,3 +0,0 @@
1
- import{lg as be,lh as ye,j as t,i9 as $,ia as F,ib as L,ic as q,id as z,a2 as I,aw as A,Q as Se,T as Ne,C as ke,V as we,li as B,B as b,lj as Re,lk as Ce,cz as W,e as C,G as y,s as H,r as m,J as Ie,ll as Ae,al as Pe,am as De,eu as Me,aZ as Oe,X as oe,lm as Te,ln as Ee,aR as $e,ej as ie,ju as Fe,Z as Q,_ as R,U as Le,lo as qe,jM as ze,lp as Be,eX as We,eY as He,jK as _e,jR as Ue,lq as Ke,lr as Qe,eR as ae,eT as Ve,ls as Ge,dc as re,af as Ye,eU as Xe,jL as Je,l as le,lt as ce,lu as de,gL as Ze,lv as _,eS as et,bg as tt,b0 as st,hr as nt,hS as ot,lw as it,aO as at,gN as ue,g as rt,gM as me,lx as V,ak as G,cn as lt,ly as ct,lz as dt,lA as ut,a5 as mt,lB as ht,cv as gt,c3 as pt,k6 as ft,aQ as xt,iX as jt,fg as O,kW as vt,q as Y,eh as bt,gQ as yt,lC as St,n as Nt}from"./index-BYTLOFNS.js";import{I as kt,q as wt}from"./ChannelComposer-EZk2JgmU.js";import{b as Rt}from"./registry-3K4FIIyI.js";import{R as Ct}from"./RoomSurface-CwlU4Lns.js";import{P as he}from"./PromptSuggestionChips-Cxa-xTMn.js";import{S as U}from"./scroll-area-BO7uDl4z.js";import{d as It}from"./dead-letter-reasons-DtBHju9v.js";import{u as At}from"./use-mesh-topology-Y9Cdja0F.js";import{A as Pt}from"./AttentionSignalRow-D9Gs4fQW.js";import{u as ge}from"./use-promo-dismissals-Bg7cJFb8.js";import{u as Dt,s as Mt,P as Ot,a as Tt}from"./use-promo-activation-XWY3OSoy.js";import"./WidgetErrorCard-B477vOv2.js";import"./index-D0k8LoLP.js";import"./progress-CNm_pBbE.js";import"./markdown-content-C1i_dR6j.js";import"./table-BrvyPoEL.js";import"./zap-BmeuEI5X.js";import"./package-DHEY3aDq.js";import"./heart-DKWg_e72.js";import"./git-branch-DpByNz2U.js";import"./file-text-CS9s0qOe.js";import"./file-C_57RCIQ.js";import"./repeat-CK_sumJP.js";import"./use-room-sessions-BeiAMSkk.js";import"./find-latest-widget-fence-D_FwbHep.js";import"./format-duration-BCr6uzby.js";import"./RuntimeSetupDialog-BcDt-BYK.js";import"./inline-code-B3u1dOXm.js";import"./list-runtime-types-Cyl4h4lV.js";import"./RuntimeConnectFlow-Ddm_TBWI.js";import"./copy-button-BodCVufV.js";import"./useMutationState-Bffa43_B.js";import"./runtime-connect-Dn0T5YWv.js";import"./mention-pill-DoQBb5VU.js";import"./rotate-ccw-clock-DzVWecfL.js";import"./unplug-B8oONuTT.js";import"./message-square-off-CwB3fRn1.js";import"./registry-DNYPNSm5.js";import"./use-todos-Bq9I1_Md.js";import"./file-drag-GDx2qhdk.js";import"./paperclip-DYgUORd3.js";import"./index-CIokV9hG.js";import"./use-transform-DEFDL9dO.js";import"./pane-resize-handle-BetBV5qX.js";import"./UnreadDivider-DPMhdEbw.js";import"./use-room-follow-claim-CpOIUcG7.js";import"./use-connector-management-B_RvwV0T.js";import"./AgentRequestCard-BSvTh8P0.js";import"./access-copy-w5gryYsO.js";import"./query-error-state-BdmBV0DG.js";import"./empty-state-B316LEXY.js";import"./use-bindings-DVKWBz4y.js";import"./connection-copy--MA7AN04.js";import"./KeyEntry-Z5hKKbef.js";import"./use-update-config-Bt7fMLqS.js";function Et({open:e,itemId:n,onClose:o}){const{data:s}=be(),i=ye(),a=(n==null?void 0:n.indexOf("::"))??-1,r=a>=0?n.slice(0,a):void 0,l=a>=0?n.slice(a+2):void 0,c=s==null?void 0:s.find(h=>h.source===r&&h.reason===l),d=()=>{!r||!l||i.mutate({source:r,reason:l},{onSuccess:o})};return t.jsx($,{open:e,onOpenChange:h=>!h&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Messages that never arrived"}),t.jsx(z,{children:r??"Source unknown"})]}),t.jsx(U,{className:"flex-1 px-4",children:c?t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"text-muted-foreground text-sm",children:"These never reached an agent. Clearing them doesn’t send them."}),t.jsxs("p",{className:"text-foreground text-sm",children:[c.count," message",c.count===1?"":"s"," couldn’t be delivered"]}),t.jsx(I,{variant:"secondary",children:It(c.reason)})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[t.jsxs("p",{className:"text-muted-foreground",children:["First happened ",A(c.firstSeen)," ago"]}),t.jsxs("p",{className:"text-muted-foreground",children:["Last happened ",A(c.lastSeen)," ago"]})]}),c.sample!=null&&t.jsxs(Se,{children:[t.jsxs(Ne,{className:"text-muted-foreground hover:text-foreground group flex items-center gap-1 text-xs font-medium transition-colors",children:[t.jsx(ke,{className:"size-3 transition-transform group-data-[state=open]:rotate-90"}),"What one of them looked like"]}),t.jsx(we,{children:t.jsx("pre",{className:"bg-muted mt-1 overflow-x-auto rounded-md p-3 font-mono text-xs",children:JSON.stringify(c.sample,null,2)})})]})]}):t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"These are cleared already."})}),t.jsxs(B,{children:[c&&t.jsx(b,{variant:"destructive",onClick:d,disabled:i.isPending,children:i.isPending?"Clearing…":"Clear these"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function $t(e){const n=Math.floor(e/1e3);if(n<60)return`${n}s`;const o=Math.floor(n/60),s=n%60;if(o<60)return`${o}m ${s}s`;const i=Math.floor(o/60),a=o%60;return`${i}h ${a}m`}function Ft(e){switch(e){case"needs_attention":return{label:"Needs attention",badge:"destructive",tone:"error",heading:"What it needed",title:"Run that was refused a tool"};case"failed":return{label:"Didn’t finish",badge:"destructive",tone:"error",heading:"Error",title:"Run that didn’t finish"};case"cancelled":return{label:"Cancelled",badge:"secondary",tone:"neutral",heading:"Stopped",title:"Run that was stopped"};case"skipped":return{label:"Skipped",badge:"secondary",tone:"neutral",heading:"Why",title:"Run that never started"};case"running":return{label:"Running",badge:"secondary",tone:"neutral",heading:"Latest",title:"Run that is still going"};default:return{label:"Completed",badge:"secondary",tone:"neutral",heading:"Note",title:"Run that finished"}}}const Lt={error:{box:"bg-destructive/10 border-destructive/20",heading:"text-destructive",body:"text-destructive"},neutral:{box:"bg-muted border-border",heading:"text-foreground",body:"text-foreground/80"}};function qt({open:e,itemId:n,onClose:o}){const{data:s,isLoading:i,isError:a}=Re(e?n??null:null),r=Ce(),l=W(),c=()=>{s!=null&&s.sessionId&&l(H({session:s.sessionId}))},d=()=>{s&&r.mutate(s.id)},h=s?Ft(s.status):null,g=h?Lt[h.tone]:null;return t.jsx($,{open:e,onOpenChange:p=>!p&&o(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:(h==null?void 0:h.title)??"Run that needs a look"}),t.jsx(z,{children:n?n.slice(0,8):"Unknown"})]}),t.jsxs(U,{className:"flex-1 px-4",children:[i&&t.jsxs("div",{className:"space-y-4",children:[t.jsx(C,{className:"h-6 w-24"}),t.jsx(C,{className:"h-4 w-48"}),t.jsx(C,{className:"h-20 w-full"})]}),a&&t.jsx("p",{className:"text-destructive py-8 text-center text-sm",children:"Couldn’t load this run."}),!i&&!a&&!s&&t.jsx("p",{className:"text-muted-foreground py-8 text-center text-sm",children:"Already resolved."}),s&&t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex gap-2",children:[t.jsx(I,{variant:h.badge,children:h.label}),t.jsx(I,{variant:"secondary",children:s.trigger==="scheduled"?"Scheduled":"Manual"})]}),t.jsxs("div",{className:"space-y-1 text-sm",children:[s.startedAt&&t.jsxs("p",{className:"text-muted-foreground",children:["Started: ",A(s.startedAt)," ago"]}),s.finishedAt&&t.jsxs("p",{className:"text-muted-foreground",children:["Finished: ",A(s.finishedAt)," ago"]}),s.durationMs!=null&&t.jsxs("p",{className:"text-muted-foreground",children:["Duration: ",$t(s.durationMs)]})]}),s.error&&t.jsxs("div",{className:y("rounded-md border p-3",g.box),children:[t.jsx("p",{className:y("text-sm font-medium",g.heading),children:h.heading}),t.jsx("p",{className:y("mt-1 text-sm",g.body),children:s.error})]}),s.outputSummary&&t.jsxs("div",{className:"space-y-1",children:[t.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Output"}),t.jsx("pre",{className:"bg-muted max-h-48 overflow-auto rounded-md p-3 font-mono text-xs",children:s.outputSummary})]})]})]}),t.jsxs(B,{children:[(s==null?void 0:s.sessionId)&&t.jsx(b,{variant:"default",onClick:c,children:"View chat"}),(s==null?void 0:s.status)==="running"&&t.jsx(b,{variant:"destructive",onClick:d,disabled:r.isPending,children:r.isPending?"Cancelling…":"Cancel run"}),t.jsx(b,{variant:"outline",onClick:o,children:"Close"})]})]})})}function zt({agent:e}){const n=Ae(e,e.projectPath??"");return t.jsxs("div",{className:"flex items-center gap-3 py-2",children:[t.jsx(Pe,{color:n.color,emoji:n.emoji,size:"sm",className:"shrink-0"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground truncate text-sm font-medium",children:De(e)}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(I,{variant:"destructive",children:"Unreachable"}),e.runtime&&t.jsx(I,{variant:"secondary",children:Me(e.runtime).label})]})]}),e.lastSeenAt&&t.jsxs("span",{className:"text-muted-foreground shrink-0 text-xs",children:[A(e.lastSeenAt)," ago"]})]})}function Bt({open:e,onClose:n}){const{data:o}=At(void 0,e),s=m.useMemo(()=>o?o.namespaces.flatMap(i=>i.agents).filter(i=>i.healthStatus==="unreachable"):[],[o]);return t.jsx($,{open:e,onOpenChange:i=>!i&&n(),children:t.jsxs(F,{side:"right",children:[t.jsxs(L,{children:[t.jsx(q,{children:"Agents that aren’t answering"}),t.jsxs(z,{children:["DorkOS can’t reach ",s.length," agent",s.length===1?"":"s"," right now"]})]}),t.jsx(U,{className:"flex-1 px-4",children:s.length>0?t.jsx("div",{className:"divide-y",children:s.map(i=>t.jsx(zt,{agent:i},i.id))}):t.jsxs("div",{className:"flex flex-col items-center gap-2 py-8",children:[t.jsx(Ie,{className:"text-status-success size-6"}),t.jsx("p",{className:"text-muted-foreground text-sm",children:"All agents are online"})]})}),t.jsx(B,{children:t.jsx(b,{variant:"outline",onClick:n,children:"Close"})})]})})}function Wt(e){return e.content.suggestion!==void 0}function Ht(){const e=Dt(),{dismissedIds:n}=ge(),o=Oe(s=>s.promoEnabled);return m.useMemo(()=>{if(!o)return null;const[s]=Mt(Ot.filter(Wt),e,n,1);return s??null},[e,n,o])}function _t({suggestion:e,promoTitle:n,onAccept:o,onDismiss:s}){return t.jsxs("p",{"data-slot":"quiet-suggestion",className:"text-muted-foreground/70 text-2xs mt-1",children:[e.question," ",t.jsx("button",{type:"button",onClick:o,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm font-medium underline-offset-4 transition-colors hover:underline focus-visible:underline",children:e.action}),t.jsx("button",{type:"button","aria-label":`Dismiss suggestion: ${n}`,onClick:s,className:"text-muted-foreground/60 hover:text-foreground focus-ring -my-1.5 ml-0.5 inline-flex translate-y-[3px] items-center justify-center rounded-sm p-1.5 align-baseline transition-colors",children:t.jsx(oe,{className:"size-3"})})]})}function Ut({promo:e}){const{dismissPromo:n}=ge(),{activate:o,dialog:s}=Tt(e);return t.jsxs(t.Fragment,{children:[t.jsx(_t,{suggestion:e.content.suggestion,promoTitle:e.content.title,onAccept:o,onDismiss:()=>n(e.id)}),s]})}function Kt(){const e=Ht();return e===null?null:t.jsx(Ut,{promo:e},e.id)}const Qt=["report.daily"];function pe(){const{notifications:e}=Te({kinds:Qt,unread:!0});return m.useMemo(()=>e[0],[e])}function Vt({questions:e,requests:n,schedules:o,approvalsUnavailable:s,attention:i}){const a=[],r=[],l=e+n+o;return l>0?(a.push(`${Ee(e,n,o)} ${l===1?"is":"are"} waiting on you.`),r.push(`${l} waiting`)):s&&(a.push("Couldn’t read approvals."),r.push("Couldn’t read approvals")),i===1?(a.push("1 thing needs attention."),r.push("1 needs attention")):i>1&&(a.push(`${i} things need attention.`),r.push(`${i} need attention`)),{spoken:a.join(" "),compact:r.join(" · ")}}function Gt({notification:e,onDismiss:n}){return t.jsxs("div",{"data-slot":"shift-report-card",className:"border-border/60 bg-background/60 relative rounded-lg border p-3 pr-8",children:[t.jsxs("div",{className:"flex items-start gap-2.5",children:[t.jsx($e,{"aria-hidden":!0,className:"text-muted-foreground mt-0.5 size-3.5 shrink-0"}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("p",{className:"text-foreground text-xs font-medium",children:e.title}),e.body!==void 0&&t.jsx("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:e.body})]})]}),t.jsx("button",{type:"button",onClick:n,"aria-label":"Dismiss",className:"text-muted-foreground hover:text-foreground focus-ring absolute top-2 right-2 rounded-md p-1 transition-colors",children:t.jsx(oe,{className:"size-3.5"})})]})}const Yt="max-h-[40svh] sm:max-h-[50svh]",Xt={initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0}};function T({title:e,tone:n="waiting",children:o}){const s=m.useId();return t.jsxs("section",{"aria-labelledby":s,className:"min-w-0",children:[t.jsx("h2",{id:s,className:y("mb-2 text-xs font-medium",n==="waiting"?"text-status-warning-fg":"text-muted-foreground"),children:e}),o]})}function X({edge:e}){return t.jsx("div",{"aria-hidden":"true","data-slot":`pinned-triage-fade-${e}`,className:y("from-background/95 via-background/65 pointer-events-none absolute inset-x-0 h-6 to-transparent",e==="bottom"?"bottom-0 bg-gradient-to-t":"top-0 bg-gradient-to-b")})}const J={animate:{transition:{staggerChildren:.04}}};function Jt(e){return e?0:.18}function Zt({approvals:e,asks:n,settlingAsks:o,askAgentNames:s,onOpenSession:i,approvalsUnavailable:a,onRetryApprovals:r,scheduleApprovals:l,errorSignals:c,activityItems:d,onOpenActivity:h,shiftReport:g,presence:p,condensed:j,onExpand:x,className:u}){const f=ie(),v=m.useRef(null),N=Fe(v),k=e.length>0||n.length>0||o.length>0||l.length>0||a,P=c.length>0,w=d.length>0,je=k||P||w||g!==void 0||(p==null?void 0:p.occupied)===!0,M=Vt({questions:n.length,requests:e.length,schedules:l.length,approvalsUnavailable:a,attention:c.length+d.length}),ve=j===!0&&M.compact!=="";return t.jsxs(t.Fragment,{children:[t.jsx("div",{role:"status","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:M.spoken}),t.jsxs(Q,{initial:!1,children:[ve&&t.jsx(R.div,{"data-slot":"pinned-triage-summary",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:Jt(f===!0)},className:y("bg-background/95 border-border/60 shrink-0 border-b backdrop-blur-sm",u),children:t.jsxs("button",{type:"button",onClick:x,className:"text-muted-foreground hover:text-foreground flex min-h-11 w-full min-w-0 items-center gap-2 px-[var(--msg-padding-x)] text-left text-xs",children:[t.jsx("span",{className:"bg-status-warning-dot size-1.5 shrink-0 rounded-full","aria-hidden":!0}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:M.compact}),t.jsx(Le,{className:"size-3.5 shrink-0","aria-hidden":!0})]})},"triage-summary"),je&&j!==!0&&t.jsxs(R.div,{"data-slot":"pinned-triage-header",...Xt,transition:{duration:f?0:.25,ease:[0,0,.2,1]},className:y("bg-background/95 border-border/60 relative shrink-0 overflow-hidden border-b backdrop-blur-sm",u),children:[t.jsxs("div",{ref:v,onScroll:N.onScroll,"data-slot":"pinned-triage-scroller",className:y("flex w-full min-w-0 scroll-py-6 flex-col gap-3 overflow-y-auto overscroll-contain px-[var(--msg-padding-x)] py-3",Yt),children:[k&&t.jsxs(T,{title:"Waiting on you",children:[(n.length>0||o.length>0)&&t.jsx(qe,{asks:n,agentNames:s,onOpenSession:i,emptyState:t.jsx("p",{className:"text-muted-foreground text-xs",children:"Nothing needs you"})}),e.length>0&&t.jsx(ze,{approvals:e}),e.length===0&&a&&t.jsx(Be,{onRetry:r}),t.jsx(Q,{initial:!1,children:l.map(S=>t.jsx(We,{task:S,className:"mt-2",compact:!0},S.id))})]}),P&&t.jsx(T,{title:"Needs attention",children:t.jsx("div",{className:"border-status-warning-border/40 bg-background/60 rounded-lg border p-2",children:t.jsx(R.div,{variants:J,initial:"initial",animate:"animate",children:c.map(S=>t.jsx(Pt,{signal:S},S.id))})})}),g&&t.jsx(Gt,{notification:g.notification,onDismiss:g.onDismiss}),w&&t.jsx(T,{title:"Recent activity",tone:"neutral",children:t.jsx("div",{className:"border-border/60 bg-background/60 rounded-lg border p-2",children:t.jsx(R.div,{variants:J,initial:"initial",animate:"animate",children:d.map(S=>t.jsx(He,{notification:S,onOpen:()=>h(S)},S.id))})})}),p==null?void 0:p.node]}),N.start&&t.jsx(X,{edge:"top"}),N.end&&t.jsx(X,{edge:"bottom"})]},"triage-header")]})]})}function es({presence:e,composerFocused:n,onExpand:o,className:s}){const{approvals:i,isError:a,retry:r}=_e(),{interactions:l}=Ue(),c=Ke(),d=Qe(l),{schedules:h,errors:g,activity:p}=ae(),j=Ve(),x=pe(),{mutate:u}=Ge(),f=re({strict:!1}),v=W(),N=Ye(),k=Xe(h),P=Je(i),w=m.useCallback(()=>{v({...le.home(),search:{}})},[v]);return t.jsxs(t.Fragment,{children:[t.jsx(Zt,{approvals:P,asks:l,settlingAsks:c,askAgentNames:d,onOpenSession:K=>{v(H({session:K}))},approvalsUnavailable:a&&i.length===0,onRetryApprovals:r,scheduleApprovals:k,errorSignals:g,activityItems:p,onOpenActivity:j,shiftReport:x===void 0?void 0:{notification:x,onDismiss:()=>u(x.id)},presence:e,condensed:N&&n===!0,onExpand:o,className:s}),t.jsx(Et,{open:f.detail==="dead-letter",itemId:f.itemId,onClose:w}),t.jsx(qt,{open:f.detail==="failed-run",itemId:f.itemId,onClose:w}),t.jsx(Bt,{open:f.detail==="offline-agent",onClose:w})]})}const ts=["What can you help with?","Make my first agent","What’s in this project?","Set up a daily run"];function ss({roomId:e}){const n=m.useCallback(o=>{ce.getState().set(e,o),de.getState().requestFocus(e)},[e]);return t.jsx("div",{className:"w-full px-[var(--msg-padding-x)] pb-1",children:t.jsx(he,{suggestions:ts,onChipClick:n,ariaLabel:"Ways to start",size:"comfortable"})})}function ns(e){var a;const{data:n}=Ze(e),o=((a=n==null?void 0:n.members.find(r=>r.author.id===n.viewerAuthorId))==null?void 0:a.lastReadSeq)??null,[s,i]=m.useState({roomId:null,seq:null});return s.roomId===e?s.seq:o===null?null:(i({roomId:e,seq:o}),o)}function os(e,n){if(e===void 0)return null;let o=null,s=1/0;for(const i of e){if(!i.enabled||i.status!=="active")continue;const a=i.nextRun;if(a==null)continue;const r=Date.parse(a);Number.isNaN(r)||r<=n||r>=s||(s=r,o={name:i.displayName??i.name,at:a})}return o}function is(e,n){const o=new Date(e),s=o.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}),i=as(new Date(n),o);return i===0?`today at ${s}`:i===1?`tomorrow at ${s}`:`on ${o.toLocaleDateString(void 0,{weekday:"long",month:"short",day:"numeric"})} at ${s}`}function as(e,n){const o=s=>new Date(s.getFullYear(),s.getMonth(),s.getDate()).getTime();return Math.round((o(n)-o(e))/864e5)}function rs(e,n){return e===null?null:`Next up: ${e.name} runs ${is(e.at,n)}.`}function ls({forwardLook:e,suggestion:n}){return t.jsx(R.div,{"data-slot":"home-quiet-state",initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"border-border/60 shrink-0 border-b",children:t.jsxs("div",{className:"w-full px-[var(--msg-padding-x)] py-2",children:[t.jsxs("p",{className:"text-muted-foreground text-xs",children:[t.jsx("span",{className:"text-foreground/80 font-medium",children:"All quiet."}),e!==null&&t.jsxs(t.Fragment,{children:[" ",e]})]}),n]})})}function cs({roomId:e,presenceOccupied:n}){const o=_(e),s=ns(e),{items:i,isLoading:a,isAnyError:r}=et(),{total:l}=ae(),c=pe(),d=o!==void 0&&o.length>0,h=s!==null&&o!==void 0&&o.every(k=>k.seq<=s),g=i.length>0||a||r||l>0||c!==void 0||n,p=d&&h&&!g,[j,x]=m.useState("waiting");p&&j==="waiting"?x("shown"):!p&&j==="shown"&&x("retired");const u=p&&j!=="retired",f=tt(),{data:v}=st(f&&u),N=nt();return u?t.jsx(ls,{forwardLook:rs(os(v,N),N),suggestion:t.jsx(Kt,{})}):null}const fe="dorkos:home-opened-on";function Z(){const e=new Date,n=String(e.getMonth()+1).padStart(2,"0"),o=String(e.getDate()).padStart(2,"0");return`${e.getFullYear()}-${n}-${o}`}function ds(){try{return localStorage.getItem(fe)}catch{return null}}function us(e){try{localStorage.setItem(fe,e)}catch{}}function ms(){const[e]=m.useState(()=>ds()!==Z());return m.useEffect(()=>{e&&us(Z())},[e]),e}function hs({children:e}){const n=ms(),o=ie(),s=n&&o!==!0;return t.jsx(R.div,{className:"h-full",initial:s?{opacity:0}:!1,animate:{opacity:1},transition:{duration:.45,ease:[0,0,.2,1]},children:e})}const ee="@dorkbot",gs="Build me a tracker for my customers",ps="Make a daily plan board",xe="Something else",fs=[gs,ps,xe];function xs({roomId:e,mode:n}){const o=Rt(),s=ot(),i=m.useCallback(a=>{if(a===xe){ce.getState().set(e,`${ee} `),de.getState().requestFocus(e);return}o.mutate({roomId:e,text:`${ee} ${a}`,clientId:it()})},[e,o]);return n==="starters"?t.jsx("div",{className:"w-full px-[var(--msg-padding-x)] pb-1","data-testid":"first-run-chips",children:t.jsx(he,{suggestions:fs,onChipClick:i,ariaLabel:"First jobs for DorkBot",size:"comfortable"})}):t.jsxs("div",{className:"flex w-full flex-wrap gap-2 px-[var(--msg-padding-x)] pb-1","data-testid":"first-run-connect-chips",children:[t.jsx(b,{size:"sm",onClick:()=>s.open("account"),children:"Continue with DorkOS"}),t.jsx(b,{size:"sm",variant:"outline",onClick:()=>s.open("runtimes"),children:"Use my own AI"})]})}function js(e){var r,l;const{data:n}=at(),o=_(e),s=ue(e,null),i=((r=n==null?void 0:n.onboarding)==null?void 0:r.welcomeEntryId)??null;if(e===null||i===null||!o||s.length>0)return null;const a=o.reduce((c,d)=>c===void 0||d.seq>c.seq?d:c,void 0);return(a==null?void 0:a.id)!==i?null:((l=n==null?void 0:n.onboarding)==null?void 0:l.firstRunPath)==="none"?"connect":"starters"}const vs=5,bs="relative after:absolute after:-inset-x-1 after:-inset-y-2.5 md:after:hidden";function ys(e,n){return e===null||n===null?null:Math.max(0,n-Date.parse(e))}function Ss({row:e,onFollow:n,onViewProfile:o}){const[s,i]=m.useState(null),a=ys(e.since,s),r=e.profileMemberId,l=o===void 0||r===null?void 0:()=>o(r);return t.jsx(kt,{onViewProfile:l,identity:{kind:e.face.kind,displayName:e.name,...e.handle!==null?{handle:e.handle}:{},color:e.face.color,...e.face.emoji!==void 0?{emoji:e.face.emoji}:{},...e.face.imageUrl!==void 0?{imageUrl:e.face.imageUrl}:{},...e.face.origin!==void 0?{origin:e.face.origin}:{},...e.face.kind==="agent"?{agent:{...e.runtime!==null?{runtime:e.runtime}:{},...a!==null?{working:{...e.roomTitle!==null?{room:e.roomTitle}:{},forMs:a}}:{}}}:{}},children:t.jsxs("button",{type:"button","aria-label":e.detail===null?`Watch ${e.name}`:`Watch ${e.name}: ${e.detail}`,onClick:()=>n(e.follow),onPointerEnter:()=>i(Date.now()),onPointerLeave:()=>i(null),onFocus:()=>i(Date.now()),onBlur:()=>i(null),className:y("focus-ring group/identity hover:bg-muted/60 flex min-w-0 items-center gap-1.5 rounded-full py-1 pr-2.5 pl-1 text-xs transition-colors",bs),children:[t.jsx(rt,{size:"xs",kind:e.face.kind,color:e.face.color,...e.face.emoji!==void 0?{emoji:e.face.emoji}:{},...e.face.imageUrl!==void 0?{imageUrl:e.face.imageUrl}:{},...e.face.origin!==void 0?{origin:e.face.origin}:{},fallback:e.face.fallback,status:"working"}),t.jsx("span",{className:"text-foreground shrink-0 font-medium",children:e.name}),e.detail!==null&&t.jsxs("span",{"aria-hidden":!0,className:"text-muted-foreground truncate",children:["· ",e.detail]})]})})}function Ns({rows:e,onFollow:n,onViewProfile:o,className:s}){if(e.length===0)return null;const i=e.slice(0,vs),a=e.length-i.length;return t.jsxs("ul",{"data-testid":"presence-strip","aria-label":"Working right now",className:y("flex items-center gap-x-2 overflow-hidden",s),children:[i.map(r=>t.jsx("li",{className:"min-w-0",children:t.jsx(Ss,{row:r,onFollow:n,onViewProfile:o})},r.id)),a>0&&t.jsx("li",{"aria-label":a===1?"1 more agent is working":`${a} more agents are working`,className:"text-muted-foreground shrink-0 text-xs",children:t.jsxs("span",{"aria-hidden":!0,children:["+",a," more"]})})]})}function ks(e){return`replying in ${e}`}const ws="working in a chat";function Rs(e,n){var i;const o=n.rosters[e];if(o!==void 0)return o.members.map(a=>({author:a.author,origin:a.origin}));const s=(i=n.rooms[e])==null?void 0:i.participants;return s==null?[]:s.map(a=>({author:a}))}function Cs(e){const n=new Map;for(const[o,s]of Object.entries(e))s!==null&&n.set(lt(o),{path:o,manifest:s});return n}function te(e){return{...e,line:dt(e.name,e.binding,e.state),detail:ct(e.binding,e.state)}}function Is(e){const n=Cs(e.agents),o=new Set(e.excludeRoomIds??[]),s=[],i=new Set;for(const l of e.claims){const c=Rs(l.roomId,e).find(p=>p.author.id===l.authorId);if(c===void 0)continue;const d=c.author.agentRef===void 0?void 0:n.get(c.author.agentRef);if(d!==void 0&&i.add(d.path),o.has(l.roomId))continue;const h=e.rooms[l.roomId],g=h===void 0?null:me(h);s.push(te({id:`room:${l.roomId}:${l.authorId}`,name:c.author.displayName,handle:c.author.handle,face:V({record:c.author,override:d===void 0?null:G(d.manifest),...c.origin!==void 0?{origin:c.origin}:{}}),binding:g===null?null:ks(g),state:l.state,since:l.since,roomTitle:g,runtime:(d==null?void 0:d.manifest.runtime)??null,profileMemberId:d===void 0?null:e.meshIdByPath[d.path]??null,follow:{kind:"room",roomId:l.roomId}}))}const a=new Set(i),r=[];for(const l of e.sessions){if(a.has(l.cwd))continue;const c=e.agents[l.cwd];if(c==null)continue;a.add(l.cwd);const d=c.displayName??c.name;r.push(te({id:`session:${l.sessionId}`,name:d,handle:null,face:V({record:{id:c.id,kind:"agent",displayName:d},override:G(c)}),binding:ws,state:"working",since:null,roomTitle:null,runtime:c.runtime,profileMemberId:e.meshIdByPath[l.cwd]??null,follow:{kind:"session",sessionId:l.sessionId,cwd:l.cwd}}))}return r.sort((l,c)=>l.name.localeCompare(c.name)||l.id.localeCompare(c.id)),[...s,...r]}function As(e,n,o){var a;const s=new Set(ut(Object.keys(n),Object.values(o))),i=[];for(const[r,l]of Object.entries(n))((a=e[r])==null?void 0:a.lifecycle)==="streaming"&&s.has(r)&&i.push({sessionId:r,cwd:l});return i}const se=[],Ps=[],ne="\0",D="";function Ds(){const e=O(m.useCallback(i=>i.statuses,[])),n=O(m.useCallback(i=>i.statusCwds,[])),o=O(m.useCallback(i=>i.sessions,[])),s=m.useMemo(()=>As(e,n,o).map(i=>`${i.sessionId}${ne}${i.cwd}`).sort().join(D),[e,n,o]);return m.useMemo(()=>s.length===0?Ps:s.split(D).map(i=>{const[a,r]=i.split(ne);return{sessionId:a,cwd:r}}),[s])}function Ms(e=[]){const n=mt(),o=ht(),s=Ds(),{data:i}=gt(),{data:a}=pt(),r=m.useMemo(()=>[...new Set(o.map(u=>u.roomId))].sort().join(`
2
- `),[o]),l=m.useMemo(()=>r.length===0?[]:r.split(`
3
- `),[r]),c=ft({queries:l.map(u=>({queryKey:xt.detail(u),queryFn:()=>n.getRoom(u)})),combine:u=>{const f={};for(const v of u)v.data!==void 0&&(f[v.data.id]=v.data);return f}}),d=m.useMemo(()=>{const u={};for(const f of i??[])u[f.id]=f;return u},[i]),h=m.useMemo(()=>((a==null?void 0:a.agents)??[]).map(u=>u.projectPath),[a]),{data:g}=jt(h),p=m.useMemo(()=>g??{},[g]),j=m.useMemo(()=>{const u={};for(const f of(a==null?void 0:a.agents)??[])u[f.projectPath]=f.id;return u},[a]),x=e.join(D);return m.useMemo(()=>{if(o.length===0&&s.length===0)return se;const u=Is({claims:o,rosters:c,rooms:d,sessions:s,agents:p,meshIdByPath:j,excludeRoomIds:x.length===0?[]:x.split(D)});return u.length===0?se:u},[o,c,d,s,p,j,x])}function Os(e=[]){const n=Ms(e),o=W(),{open:s}=vt(),i=m.useCallback(r=>{if(r.kind==="room"){Y.getState().recordOpened("room",r.roomId),o({...le.channels(),search:{id:r.roomId}});return}r.cwd&&Y.getState().recordOpened("agent",r.cwd),o(H({session:r.sessionId,dir:r.cwd}))},[o]),a=m.useMemo(()=>t.jsx(Ns,{rows:n,onFollow:i,onViewProfile:s}),[n,i,s]);return{occupied:n.length>0,node:a}}function E({title:e,children:n,action:o}){return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-2 p-10 text-center text-sm",children:[t.jsx(Nt,{className:"text-muted-foreground/50 size-10","aria-hidden":!0}),t.jsx("p",{className:"text-foreground font-medium",children:e}),t.jsx("p",{className:"max-w-sm",children:n}),o]})}function Ts(){return t.jsxs(t.Fragment,{children:[t.jsx(bt,{children:"Home"}),t.jsx(Es,{})]})}function Es(){var p,j,x;const e=yt(),[n,o]=m.useState(!1),s=m.useCallback(()=>{const u=document.activeElement;wt(u)&&u.blur()},[]),{thread:i,entry:a}=re({strict:!1}),r=St(),l=Os(e.room===null?[]:[e.room.id]),c=_(((p=e.room)==null?void 0:p.id)??null),d=ue(((j=e.room)==null?void 0:j.id)??null,null),h=c!==void 0&&c.length===0&&d.length===0,g=js(((x=e.room)==null?void 0:x.id)??null);if(e.status==="loading")return t.jsxs("div",{className:"flex h-full flex-col","aria-busy":!0,children:[t.jsxs("div",{className:"flex items-center gap-3 border-b px-4 py-3",children:[t.jsx(C,{className:"size-7 rounded-full"}),t.jsx(C,{className:"h-4 w-40"})]}),t.jsx("div",{className:"flex-1"})]});if(e.status==="error")return t.jsx(E,{title:"Couldn’t load your team room",action:t.jsx(b,{variant:"outline",size:"sm",className:"mt-2",onClick:e.retry,children:"Try again"}),children:"Its messages are safe."});if(e.status==="missing")return t.jsx(E,{title:"Your team room isn’t open yet",children:"DorkOS opens it at startup. Still missing? Restart DorkOS."});if(e.status==="archived"){const u=e.room;return t.jsx(E,{title:`${me(u)} is archived`,action:t.jsx(b,{variant:"outline",size:"sm",className:"mt-2",disabled:r.isPending,onClick:()=>r.mutate({roomId:u.id}),children:r.isPending?"Bringing it back…":"Bring it back"}),children:"Its messages are safe."})}return t.jsx(hs,{children:t.jsx(Ct,{roomId:e.room.id,threadId:i,entrySeq:a,threadRoute:"/",offerJumpBackIn:!0,onComposerFocusChange:o,aboveTimeline:t.jsxs(t.Fragment,{children:[t.jsx(es,{presence:l,composerFocused:n,onExpand:s}),t.jsx(cs,{roomId:e.room.id,presenceOccupied:l.occupied})]}),aboveComposer:g?t.jsx(xs,{roomId:e.room.id,mode:g}):h?t.jsx(ss,{roomId:e.room.id}):void 0})})}const Ln=Ts;export{Ln as component};