dorkos 0.131.0 → 0.133.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 (344) hide show
  1. package/dist/bin/cli.js +499 -314
  2. package/dist/browser/fresh-verifier.mjs +13 -13
  3. package/dist/browser/native/darwin-supervisor-worker.mjs +3 -3
  4. package/dist/browser/native/package-manifest.json +1 -1
  5. package/dist/browser/source-manifest.json +1 -1
  6. package/dist/client/assets/{AboutPage-BZ2LLJ0k.js → AboutPage-D-EHHVPa.js} +1 -1
  7. package/dist/client/assets/{ActivityErrorState-BnqAwUiy.js → ActivityErrorState-BTHnE1vP.js} +1 -1
  8. package/dist/client/assets/{ActivityPage-BlZKrSVo.js → ActivityPage-BfSLPIdR.js} +1 -1
  9. package/dist/client/assets/{ActivityRow-Ch8HxQ2m.js → ActivityRow-PwUBjQw8.js} +1 -1
  10. package/dist/client/assets/{AdapterIcon-CfocFMw-.js → AdapterIcon-DgkNN6bi.js} +1 -1
  11. package/dist/client/assets/{AdapterSetupWizard-Dtjx1Oad.js → AdapterSetupWizard-DX0dzp7q.js} +2 -2
  12. package/dist/client/assets/{AgentOptionRow-BGRvUeF7.js → AgentOptionRow-ApuDEKqq.js} +1 -1
  13. package/dist/client/assets/{AgentPicker-BcURPZQp.js → AgentPicker-BDci-9aL.js} +1 -1
  14. package/dist/client/assets/{AgentRequestCard-kNq5A_IN.js → AgentRequestCard-B2gxCMGi.js} +3 -3
  15. package/dist/client/assets/{AppearancePage-Cd-k7dcc.js → AppearancePage-8SVnFe0k.js} +1 -1
  16. package/dist/client/assets/ApplyToOverridesDialog-CnL1ubxL.js +1 -0
  17. package/dist/client/assets/{AttentionSignalRow-QY8AIjf9.js → AttentionSignalRow-CCKhUtil.js} +1 -1
  18. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-Cgkvajbw.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-B7wFPzG4.js} +3 -3
  19. package/dist/client/assets/BindingDialog-C4BHVXno.js +1 -0
  20. package/dist/client/assets/{BlintzCanvas-CMzZnmWK.js → BlintzCanvas-7E5uwVms.js} +3 -3
  21. package/dist/client/assets/{CanvasCsvContent-uxMaHePf.js → CanvasCsvContent-l7lfyDGn.js} +4 -4
  22. package/dist/client/assets/CanvasFileContent-Bqd0IEfK.js +2 -0
  23. package/dist/client/assets/CanvasModel3dContent-DqL0Sy4r.js +2 -0
  24. package/dist/client/assets/{ChannelComposer-BAg0a29Q.js → ChannelComposer-CAYvz_ZB.js} +12 -17
  25. package/dist/client/assets/{ChatAppsOff-DD28V0vX.js → ChatAppsOff-CNeKBVNz.js} +2 -2
  26. package/dist/client/assets/{CodeMirrorDiff-CyoduBgM.js → CodeMirrorDiff-BZRcNFsS.js} +1 -1
  27. package/dist/client/assets/{CodeMirrorEditor-DGccoZ8Q.js → CodeMirrorEditor-DD5tArRn.js} +1 -1
  28. package/dist/client/assets/{ComputerResourceView-Dk98shko.js → ComputerResourceView-BUmsVssG.js} +1 -1
  29. package/dist/client/assets/{ComputerViewer-Broprz4q.js → ComputerViewer-BKMR5LkF.js} +1 -1
  30. package/dist/client/assets/{ConnectionAccessLists-C_qLz8GJ.js → ConnectionAccessLists-DYUiFmPY.js} +1 -1
  31. package/dist/client/assets/{ConnectionsPage-CmGgGmDO.js → ConnectionsPage-DR2Kfm9Q.js} +2 -2
  32. package/dist/client/assets/{ConventionPage-BxWLIUUC.js → ConventionPage-Do6q8873.js} +2 -2
  33. package/dist/client/assets/{ExtensionPageRoute-CyfIRaGs.js → ExtensionPageRoute-CP7NM7fw.js} +2 -2
  34. package/dist/client/assets/{FeatureDisabledState-By2dhVpu.js → FeatureDisabledState-Bi23k3rg.js} +1 -1
  35. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-B6wKQpLR.js → FloatingTanStackRouterDevtools-CqogiFob-lRlmDXYz.js} +1 -1
  36. package/dist/client/assets/{ForwardConsentHost-kDdpyBgA.js → ForwardConsentHost-DSR1pEEK.js} +1 -1
  37. package/dist/client/assets/HandlePage-aHId3bYX.js +1 -0
  38. package/dist/client/assets/HeartbeatPage-BTNVcHOI.js +1 -0
  39. package/dist/client/assets/{KeyEntry-Ctc1zp2J.js → KeyEntry-67acsEG2.js} +1 -1
  40. package/dist/client/assets/{LexicalField-7zd4B8f1.js → LexicalField-Cb68LIar.js} +2 -2
  41. package/dist/client/assets/{ManagesPage-BG1TIMP3.js → ManagesPage-ChPlBF42.js} +1 -1
  42. package/dist/client/assets/{Marketplace-C9r4jRJf.js → Marketplace-CzPhJEE1.js} +4 -4
  43. package/dist/client/assets/{MarketplaceSourcesView-C01Cdrge.js → MarketplaceSourcesView-CmQgxQmU.js} +1 -1
  44. package/dist/client/assets/{McpAppFrame-Dm7MqOhc.js → McpAppFrame-z5JUaCSA.js} +2 -2
  45. package/dist/client/assets/{McpSigninBody-CsXP_7lE.js → McpSigninBody-ZrnzwrOH.js} +1 -1
  46. package/dist/client/assets/{Model3dViewer-DOl8ZkrU.js → Model3dViewer-HJpWK-JI.js} +1 -1
  47. package/dist/client/assets/NamePage-C7F-SotG.js +1 -0
  48. package/dist/client/assets/{NewDirectMessageMenu-Dj-Qw8zA.js → NewDirectMessageMenu-CjBjzsDe.js} +1 -1
  49. package/dist/client/assets/{NotificationsPage-UExs4YE2.js → NotificationsPage-DwNUI0Z3.js} +1 -1
  50. package/dist/client/assets/{OpenMeshSwitch-Dx3M3wwS.js → OpenMeshSwitch-RNAZY1vn.js} +2 -2
  51. package/dist/client/assets/{OperatorIdentityForm-Bz5570RF.js → OperatorIdentityForm-B7S2C_eT.js} +1 -1
  52. package/dist/client/assets/PermissionHistory-D0chstxf.js +1 -0
  53. package/dist/client/assets/PermissionsPage-ToK0DZVV.js +1 -0
  54. package/dist/client/assets/{PersonalityPopover-Do-k_Hhw.js → PersonalityPopover-BvMtUQRM.js} +1 -1
  55. package/dist/client/assets/PhotoPage-Cqo3PNO_.js +1 -0
  56. package/dist/client/assets/{PreviewRefusedNotice-B-yyzQZP.js → PreviewRefusedNotice-DzbkMrUo.js} +1 -1
  57. package/dist/client/assets/{ProfileFields-DiarOK2y.js → ProfileFields-DU8dTGHT.js} +1 -1
  58. package/dist/client/assets/{ProfilePanelContainer-33Xkwoc3.js → ProfilePanelContainer-BfT-ufV7.js} +1 -1
  59. package/dist/client/assets/{ProfileRolePicker-BI6T4hj8.js → ProfileRolePicker-DrOtV-0N.js} +1 -1
  60. package/dist/client/assets/{PromptSuggestionChips-v5MScpZF.js → PromptSuggestionChips-CEnhme_V.js} +1 -1
  61. package/dist/client/assets/{ReportsToPopover-BALADuTO.js → ReportsToPopover-CwjpR1Tw.js} +1 -1
  62. package/dist/client/assets/{RoomSurface-BatV7gf5.js → RoomSurface-CChzNJKw.js} +1 -1
  63. package/dist/client/assets/{RoomsPage-DCCC3Dst.js → RoomsPage-Dbf6ijKr.js} +1 -1
  64. package/dist/client/assets/{RunsOnPopover-C7hMPyrb.js → RunsOnPopover-Bh5sSsSC.js} +1 -1
  65. package/dist/client/assets/{RuntimeConnectFlow-Dc5a8dlJ.js → RuntimeConnectFlow-BYQnY5vv.js} +1 -1
  66. package/dist/client/assets/{RuntimeSetupDialog-w90VGjJ4.js → RuntimeSetupDialog-DTO5v0dP.js} +1 -1
  67. package/dist/client/assets/{SeenDevices-BIMmbMWC.js → SeenDevices-cuY7ASEy.js} +3 -3
  68. package/dist/client/assets/{SessionsPage-0lwvSYHB.js → SessionsPage-BrqpVx-t.js} +1 -1
  69. package/dist/client/assets/{SettingsDialog-CrP6JzPg.js → SettingsDialog-DCAZX_1d.js} +4 -4
  70. package/dist/client/assets/{SkillsPage-BDgKWTfe.js → SkillsPage-D5who_ZH.js} +1 -1
  71. package/dist/client/assets/TaskDialogWrapper-BJ6XtOC5.js +1 -0
  72. package/dist/client/assets/TasksEmptyState-B3SjsxQa.js +3 -0
  73. package/dist/client/assets/{TasksPage-DjGbMGvn.js → TasksPage-B72w7J87.js} +1 -1
  74. package/dist/client/assets/{TeamComputerEntry-B_sM9Fik.js → TeamComputerEntry-B9ma5j-X.js} +1 -1
  75. package/dist/client/assets/TodoPromiseList-DDKWAfmv.js +1 -0
  76. package/dist/client/assets/TodoPromisesPage-BNXpvXzS.js +1 -0
  77. package/dist/client/assets/{ToolsPage-CeETRCd8.js → ToolsPage-DbJykCG3.js} +2 -2
  78. package/dist/client/assets/{TopologyGraph-CnpH2NjE.js → TopologyGraph-DKZS3nlr.js} +3 -3
  79. package/dist/client/assets/{TourHost-BQHrS47S.js → TourHost-Bw3Uoea5.js} +1 -1
  80. package/dist/client/assets/{UnlinkDialog-DOQLeNx4.js → UnlinkDialog-B-XCFNSd.js} +1 -1
  81. package/dist/client/assets/{UnreadDivider-DhyK6uGG.js → UnreadDivider-1aPVzwd7.js} +1 -1
  82. package/dist/client/assets/{WidgetErrorCard-Bwlfu514.js → WidgetErrorCard-C5ieVv_9.js} +6 -6
  83. package/dist/client/assets/{WithheldExtensionsNotice-BDc-CM2t.js → WithheldExtensionsNotice-CCO4ClRZ.js} +1 -1
  84. package/dist/client/assets/{WorkQueuePage-iO_DO1YK.js → WorkQueuePage-BbPKNwDg.js} +1 -1
  85. package/dist/client/assets/WorkView-BRcytACJ.js +51 -0
  86. package/dist/client/assets/_shell-EwFeSIGp.js +80 -0
  87. package/dist/client/assets/{_shell._home-BWi5YPaR.js → _shell._home-DD2mg-iK.js} +1 -1
  88. package/dist/client/assets/{_shell._home.activity-BU1NIGb7.js → _shell._home.activity-Z1QuU2M4.js} +1 -1
  89. package/dist/client/assets/_shell._home.index-BzTYr8Bw.js +3 -0
  90. package/dist/client/assets/_shell._home.tasks-BtC85Iut.js +1 -0
  91. package/dist/client/assets/{_shell._home.workspaces-wbnqJ58w.js → _shell._home.workspaces-qMG5OJYR.js} +1 -1
  92. package/dist/client/assets/{_shell.channels-D1KdvWZF.js → _shell.channels-BE4EK-iM.js} +2 -2
  93. package/dist/client/assets/_shell.connections-CBx0ogzx.js +1 -0
  94. package/dist/client/assets/{_shell.feedback-requests-DzHWC1fJ.js → _shell.feedback-requests-CwKSkkuD.js} +2 -2
  95. package/dist/client/assets/_shell.marketplace-CgWBUKSA.js +1 -0
  96. package/dist/client/assets/_shell.marketplace_.sources-8HZpKFDI.js +1 -0
  97. package/dist/client/assets/_shell.session-D6HcVbnm.js +1 -0
  98. package/dist/client/assets/{_shell.team-BMNSUpQQ.js → _shell.team-Dm5a4f8_.js} +4 -4
  99. package/dist/client/assets/_shell.threads-BavVtQOE.js +1 -0
  100. package/dist/client/assets/_shell.todos-B6uWr0zA.js +6 -0
  101. package/dist/client/assets/_shell.x._extensionId-DaELdkCH.js +1 -0
  102. package/dist/client/assets/_shell.x._extensionId_._-DaELdkCH.js +1 -0
  103. package/dist/client/assets/{abnfDiagram-WEYOIA3C-Co2k29JX.js → abnfDiagram-WEYOIA3C-Bu2T3jVw.js} +1 -1
  104. package/dist/client/assets/{access-copy-D6BUySpp.js → access-copy-tkiFMhRf.js} +1 -1
  105. package/dist/client/assets/{arc-DLZZpkuJ.js → arc-5q4SfXO9.js} +1 -1
  106. package/dist/client/assets/{architectureDiagram-ZHVYKT53-ClS9xqK5.js → architectureDiagram-ZHVYKT53-BnDMOBhV.js} +1 -1
  107. package/dist/client/assets/{banner-B8iMuXCP.js → banner-CSKUrrI0.js} +2 -2
  108. package/dist/client/assets/{blockDiagram-RJAE7QA3-DheoOELu.js → blockDiagram-RJAE7QA3-CtushlEs.js} +1 -1
  109. package/dist/client/assets/{c4Diagram-XDPPPE54-VWWZJ5x4.js → c4Diagram-XDPPPE54-7L-qYwKH.js} +1 -1
  110. package/dist/client/assets/channel-A3XT7_2L.js +1 -0
  111. package/dist/client/assets/{chunk-2E7WHVMD-BqPLJVkv.js → chunk-2E7WHVMD-ksBVyqQ3.js} +1 -1
  112. package/dist/client/assets/{chunk-2Q5K7J3B-DZn6OnKe.js → chunk-2Q5K7J3B-Bfqdkihb.js} +1 -1
  113. package/dist/client/assets/{chunk-4EMNKR2T-Dl9Poajp.js → chunk-4EMNKR2T-Brf2dH9x.js} +1 -1
  114. package/dist/client/assets/{chunk-55XCU76K-RoKuZPUc.js → chunk-55XCU76K-BlE7Cq40.js} +1 -1
  115. package/dist/client/assets/{chunk-5VM5RSS4-DV_1XHtU.js → chunk-5VM5RSS4-Bkgg3j7L.js} +1 -1
  116. package/dist/client/assets/{chunk-JWPE2WC7-B_IuS45y.js → chunk-JWPE2WC7-B9TRpN4O.js} +1 -1
  117. package/dist/client/assets/{chunk-VQ5W62QI-DkLNi45x.js → chunk-VQ5W62QI-ZoILnIYi.js} +1 -1
  118. package/dist/client/assets/{chunk-XXDRQBXY-ISM-1Dpw.js → chunk-XXDRQBXY-r2xNhaKz.js} +1 -1
  119. package/dist/client/assets/{chunk-ZCHMQSOR-MKaLMW8o.js → chunk-ZCHMQSOR-DfV3cF7d.js} +2 -2
  120. package/dist/client/assets/{classDiagram-v2-4MYWR3UA-CIWuu4ht.js → classDiagram-v2-4MYWR3UA-VOVqMNNP.js} +1 -1
  121. package/dist/client/assets/{command-CxGYZKco.js → command-CaUEAy3b.js} +1 -1
  122. package/dist/client/assets/{copy-button-DjAoGwds.js → copy-button-BOznikwM.js} +1 -1
  123. package/dist/client/assets/{cose-bilkent-JH36ORCC-HiCifRyi.js → cose-bilkent-JH36ORCC-CAdBvyLz.js} +1 -1
  124. package/dist/client/assets/{cpu-DHHTTvp_.js → cpu-j9vX9Wfk.js} +1 -1
  125. package/dist/client/assets/{cynefin-EF2NZ3EQ-DjJGZrPz.js → cynefin-EF2NZ3EQ-DcH1A9Oo.js} +1 -1
  126. package/dist/client/assets/{cynefinDiagram-WF24UDRP-DE2NdiJ2.js → cynefinDiagram-WF24UDRP-DJuKBXHi.js} +1 -1
  127. package/dist/client/assets/{dagre-NK4GIZVX-C6gDOD26.js → dagre-NK4GIZVX-D099H_0S.js} +1 -1
  128. package/dist/client/assets/{detail-row-CjwI1iuc.js → detail-row-Crl89jnh.js} +1 -1
  129. package/dist/client/assets/{diagram-CBK3MWTC-38LckcsL.js → diagram-CBK3MWTC-Cd_4W9XO.js} +1 -1
  130. package/dist/client/assets/{diagram-I5XIIV2D--8L6D9Ra.js → diagram-I5XIIV2D-Bc7aQKt3.js} +1 -1
  131. package/dist/client/assets/{diagram-ODIL2UCW-DGC2Inhd.js → diagram-ODIL2UCW-awVJZ4Bg.js} +1 -1
  132. package/dist/client/assets/{diagram-PFBEJUXE-BDHp0AyR.js → diagram-PFBEJUXE-dhsj9aeU.js} +1 -1
  133. package/dist/client/assets/{diagram-RJA3I4VV-uBatJYPi.js → diagram-RJA3I4VV-Dm59CbiV.js} +1 -1
  134. package/dist/client/assets/{diagram-TYUNFSNR-C8e1EH9X.js → diagram-TYUNFSNR-BhvcIjA9.js} +1 -1
  135. package/dist/client/assets/{ebnfDiagram-V4P3TTPT-DimRzU5B.js → ebnfDiagram-V4P3TTPT-C4wT_MTC.js} +1 -1
  136. package/dist/client/assets/{elk-QONTBCTQ-Dz6_Y2-G.js → elk-QONTBCTQ-CPI0zjmW.js} +1 -1
  137. package/dist/client/assets/{empty-state-saV209Il.js → empty-state-BHcmkSzu.js} +1 -1
  138. package/dist/client/assets/{erDiagram-KYQIGQAA-JeuTF8w6.js → erDiagram-KYQIGQAA-C_vGcbOB.js} +1 -1
  139. package/dist/client/assets/{execution-config-ClQZyDs9.js → execution-config-BS5rtvTZ.js} +1 -1
  140. package/dist/client/assets/{file-BIF-4ARS.js → file-CQGljfDT.js} +1 -1
  141. package/dist/client/assets/{file-exclamation-point-DxadH2b-.js → file-exclamation-point-B0a55VME.js} +1 -1
  142. package/dist/client/assets/{file-text-C_NPIQr4.js → file-text-Cycq_S0e.js} +1 -1
  143. package/dist/client/assets/{find-latest-widget-fence-CXai_zs0.js → find-latest-widget-fence-B6sJdG3Q.js} +4 -4
  144. package/dist/client/assets/{flowDiagram-IUGLLWBU-9FHDdK4j.js → flowDiagram-IUGLLWBU-_VNfmnxx.js} +1 -1
  145. package/dist/client/assets/{form-D3VdAYl4.js → form-BL14vwyB.js} +1 -1
  146. package/dist/client/assets/{format-cron-BqRDcFZM.js → format-cron-meJMgYNe.js} +1 -1
  147. package/dist/client/assets/{ganttDiagram-R7GPNTJY-CLMuXlHt.js → ganttDiagram-R7GPNTJY-o0gGU7X_.js} +1 -1
  148. package/dist/client/assets/{git-branch-Df7a5_fb.js → git-branch-CsLE6G0Y.js} +1 -1
  149. package/dist/client/assets/{gitGraphDiagram-PDYL7XHY-sE7Rlpr6.js → gitGraphDiagram-PDYL7XHY-DjXjUpJo.js} +1 -1
  150. package/dist/client/assets/{graph-iNVyFhBQ.js → graph-BMYee_VK.js} +1 -1
  151. package/dist/client/assets/{heart-BHMhDZ0K.js → heart-Cn3a-UQI.js} +1 -1
  152. package/dist/client/assets/{highlighted-body-KPVGNVTW-VvvsrJbu.js → highlighted-body-KPVGNVTW-DsX5yCC0.js} +1 -1
  153. package/dist/client/assets/{image-lightbox-CGEIRguA.js → image-lightbox-BZ_eBZgA.js} +1 -1
  154. package/dist/client/assets/{image-off-C5-TmSq8.js → image-off-DjR7LI5G.js} +1 -1
  155. package/dist/client/assets/{index-C3zS0ghJ.js → index-1MwES_vb.js} +1 -1
  156. package/dist/client/assets/{index-ClyRhxV_.js → index-47--OGKJ.js} +1 -1
  157. package/dist/client/assets/{index-CTgUh4p3.js → index-4rSR8lau.js} +1 -1
  158. package/dist/client/assets/{index-D9bEy8X-.js → index-B4TxpTKD.js} +1 -1
  159. package/dist/client/assets/{index-Dw-4S640.js → index-B8LqLhq7.js} +1 -1
  160. package/dist/client/assets/index-BJRgbiEd.js +1 -0
  161. package/dist/client/assets/{index-DWZ5M321.js → index-BOCclWF3.js} +1 -1
  162. package/dist/client/assets/index-BR1m9FON.js +1066 -0
  163. package/dist/client/assets/index-BcFn_S6b.js +1 -0
  164. package/dist/client/assets/{index-DRtg_sGG.js → index-BcnwvTnt.js} +1 -1
  165. package/dist/client/assets/index-BdVQOlVQ.css +1 -0
  166. package/dist/client/assets/{index-DEvpdTo6.js → index-BmKHO-FD.js} +1 -1
  167. package/dist/client/assets/{index-Bd0PAkxf.js → index-BsZkXHsH.js} +1 -1
  168. package/dist/client/assets/{index-Cudi8rs6.js → index-BxWr8Mrf.js} +1 -1
  169. package/dist/client/assets/index-C5EvpXcq.js +1 -0
  170. package/dist/client/assets/{index-CExh9cKN.js → index-Cb_p_ynP.js} +1 -1
  171. package/dist/client/assets/{index-YZbu9tke.js → index-CczLBUKI.js} +1 -1
  172. package/dist/client/assets/{index-264YDu-W.js → index-Cf4Gtxf9.js} +1 -1
  173. package/dist/client/assets/{index-Dpu2CORc.js → index-CfKSlYjb.js} +1 -1
  174. package/dist/client/assets/{index-Bzm9YMbr.js → index-Cgjq7a-8.js} +1 -1
  175. package/dist/client/assets/{index-Ci_J5Q-6.js → index-CpWxcN5D.js} +1 -1
  176. package/dist/client/assets/{index-BK5QrGfQ.js → index-Cv67OXfk.js} +1 -1
  177. package/dist/client/assets/{index-Di-MIFQG.js → index-D5Qmx1JR.js} +3 -3
  178. package/dist/client/assets/{index-LPrq0pOA.js → index-DARchye_.js} +1 -1
  179. package/dist/client/assets/{index-DMwivStD.js → index-DFb4kOjm.js} +2 -2
  180. package/dist/client/assets/{index-WeLoaNzW.js → index-DLN0kcME.js} +1 -1
  181. package/dist/client/assets/{index-BMLCfTba.js → index-DMSSN08i.js} +1 -1
  182. package/dist/client/assets/{index-Y6BDhuGt.js → index-DQ8uADJF.js} +1 -1
  183. package/dist/client/assets/index-DZhMvc9m.js +1 -0
  184. package/dist/client/assets/{index-CLsoFUml.js → index-Dfko0tSp.js} +1 -1
  185. package/dist/client/assets/{index-BgdYXP8E.js → index-DiM3QX-4.js} +3 -3
  186. package/dist/client/assets/{index-BxFLHNLg.js → index-DlvUENo4.js} +1 -1
  187. package/dist/client/assets/{index-BLUUshO9.js → index-DqZmnJED.js} +1 -1
  188. package/dist/client/assets/{index-D_bAtIJZ.js → index-DrlB9RSk.js} +1 -1
  189. package/dist/client/assets/{index-CgWzzIbx.js → index-H4e5Wpmi.js} +1 -1
  190. package/dist/client/assets/{index-k67dvyau.js → index-Joav7LQU.js} +1 -1
  191. package/dist/client/assets/{index-B0FHRkHM.js → index-KganLhU1.js} +2 -2
  192. package/dist/client/assets/{index-DFkofTx1.js → index-Kt6r3DQg.js} +1 -1
  193. package/dist/client/assets/{index-B8I1k-z9.js → index-Z2ApBQt4.js} +1 -1
  194. package/dist/client/assets/index-dY7IFpet.js +1 -0
  195. package/dist/client/assets/{index-DYVNSRDk.js → index-faSyUc2q.js} +1 -1
  196. package/dist/client/assets/{index-BgRYuqWs.js → index-gmyiXkmr.js} +1 -1
  197. package/dist/client/assets/{index-BZTLFzJp.js → index-o6kGmVGx.js} +1 -1
  198. package/dist/client/assets/{index-C_0JoCV6.js → index-vHKVYcH7.js} +1 -1
  199. package/dist/client/assets/{index.esm-CYmalBux.js → index.esm-CJIDYBqd.js} +1 -1
  200. package/dist/client/assets/{infoDiagram-MVDRKAX5-0aR9wjgO.js → infoDiagram-MVDRKAX5-B1mMyUlp.js} +1 -1
  201. package/dist/client/assets/{inline-code-DyTKSC5b.js → inline-code-mh48Uhbi.js} +1 -1
  202. package/dist/client/assets/{ishikawaDiagram-HPEHV2GE-D1lN8x2t.js → ishikawaDiagram-HPEHV2GE-efEMQ0_X.js} +1 -1
  203. package/dist/client/assets/{journeyDiagram-BOSHW7O7-CkXITXiJ.js → journeyDiagram-BOSHW7O7-DSAywiVk.js} +1 -1
  204. package/dist/client/assets/{kanban-definition-FNSA4HC5-ge33IiSq.js → kanban-definition-FNSA4HC5-B9pbU4zK.js} +1 -1
  205. package/dist/client/assets/{layers-Bx3K7OUm.js → layers-B0Z5Od3N.js} +1 -1
  206. package/dist/client/assets/{lightbulb-C5LvXkvM.js → lightbulb-Cfb5ecEd.js} +1 -1
  207. package/dist/client/assets/{link-2-Bj0_Zkvr.js → link-2-Dzy5BUL3.js} +1 -1
  208. package/dist/client/assets/{list-runtime-types-VNj1C8TB.js → list-runtime-types-DLmjtBMq.js} +1 -1
  209. package/dist/client/assets/{markdown-content-BRaPEOC7.js → markdown-content-DhAtZOfj.js} +1 -1
  210. package/dist/client/assets/{mention-pill-B_MiJWfo.js → mention-pill-DmA8FxL4.js} +1 -1
  211. package/dist/client/assets/{mermaid.core-B2hil_4a.js → mermaid.core-DUIkdbeL.js} +4 -4
  212. package/dist/client/assets/{message-square-off-T33FHpr7.js → message-square-off-BowIzJUV.js} +1 -1
  213. package/dist/client/assets/{mindmap-definition-6OY57UG3-Bu_Ia4Xz.js → mindmap-definition-6OY57UG3-Dz7ZOR4C.js} +1 -1
  214. package/dist/client/assets/{more-details-oDazWBxm.js → more-details-DV7LmY0E.js} +1 -1
  215. package/dist/client/assets/{owner-notice-VepbAQhj.js → owner-notice-DdFc2P8z.js} +1 -1
  216. package/dist/client/assets/{package-DBsl3ao5.js → package-BhKXbvU_.js} +1 -1
  217. package/dist/client/assets/{page-container-Bkarym6m.js → page-container-0sWZ3xh9.js} +1 -1
  218. package/dist/client/assets/{pane-resize-handle-gBlb5k1v.js → pane-resize-handle-Bjy4udre.js} +1 -1
  219. package/dist/client/assets/{paperclip-BeFttiUK.js → paperclip-C-7LhBfl.js} +1 -1
  220. package/dist/client/assets/{path-input-NY_yCBHb.js → path-input-BPVyI72G.js} +1 -1
  221. package/dist/client/assets/{pegDiagram-ECIUJNBX-0KmJlW0E.js → pegDiagram-ECIUJNBX-C4EOP-Fa.js} +1 -1
  222. package/dist/client/assets/{pieDiagram-GNMPY74T-IjeZXicv.js → pieDiagram-GNMPY74T-CQ1OxRkv.js} +1 -1
  223. package/dist/client/assets/{plug-CTqOZ7cA.js → plug-CIZ-wWL8.js} +1 -1
  224. package/dist/client/assets/{primer-trigger-CjaGrT2u.js → primer-trigger-XA5fLzR5.js} +2 -2
  225. package/dist/client/assets/{profile-errors-B8XkL2Rp.js → profile-errors-C1XACbc9.js} +1 -1
  226. package/dist/client/assets/{progress-Cr-4myw6.js → progress-BA2JPtb6.js} +1 -1
  227. package/dist/client/assets/{quadrantDiagram-D57K4MC3-CP6kLJKa.js → quadrantDiagram-D57K4MC3-Cw4BdkpS.js} +1 -1
  228. package/dist/client/assets/{query-error-state-DvhY-YKM.js → query-error-state-Cm-Lozlb.js} +1 -1
  229. package/dist/client/assets/{radio-CmDmmJy6.js → radio-DQ29H26H.js} +1 -1
  230. package/dist/client/assets/{railroadDiagram-Y72NRBL7-Bcto__oE.js → railroadDiagram-Y72NRBL7-CSKtYLmm.js} +1 -1
  231. package/dist/client/assets/registry-Tbt9pcZl.js +39 -0
  232. package/dist/client/assets/registry-jD9zw538.js +1 -0
  233. package/dist/client/assets/{relay-trace-schemas-ZLR1S8ft.js → relay-trace-schemas-4AAUf-Zl.js} +2 -2
  234. package/dist/client/assets/{repeat-DVTM8et8.js → repeat-B8g-x-Sc.js} +1 -1
  235. package/dist/client/assets/{requirementDiagram-EQYSW5RA-DNJrds3m.js → requirementDiagram-EQYSW5RA-BPSBZr7X.js} +1 -1
  236. package/dist/client/assets/{room-files-source-9Wdtc-bG.js → room-files-source-BkiK4-ZI.js} +2 -2
  237. package/dist/client/assets/{rotate-ccw-clock-qJSWqifh.js → rotate-ccw-clock-DRtL-2nr.js} +1 -1
  238. package/dist/client/assets/{rotate-cw-uoeBxIeM.js → rotate-cw-BbHkWN-J.js} +1 -1
  239. package/dist/client/assets/{sankeyDiagram-SY24JHO5-DNlU7xGI.js → sankeyDiagram-SY24JHO5-DVlHablQ.js} +1 -1
  240. package/dist/client/assets/{scroll-area-B1d3NfEn.js → scroll-area-DAC7NrVU.js} +1 -1
  241. package/dist/client/assets/{sequenceDiagram-BLEHNHQU-CRk71coF.js → sequenceDiagram-BLEHNHQU--wZkN8xk.js} +1 -1
  242. package/dist/client/assets/{shield-x-BpQmg1qz.js → shield-x-CEWfkzDN.js} +1 -1
  243. package/dist/client/assets/{signed-in-CTmJ3OqM.js → signed-in-CMhCR-m8.js} +1 -1
  244. package/dist/client/assets/{sizeCapture-INFHLROL-cihX3QNq.js → sizeCapture-INFHLROL-CLXc7d3S.js} +1 -1
  245. package/dist/client/assets/{soul-file-BwiyiI5v.js → soul-file-CbX7rNqz.js} +1 -1
  246. package/dist/client/assets/{stateDiagram-v2-A6IESKWZ-BAwwRsnH.js → stateDiagram-v2-A6IESKWZ-5xa1FM_X.js} +1 -1
  247. package/dist/client/assets/{swimlanes-B3ENRKFQ-CpDB6CUC.js → swimlanes-B3ENRKFQ-DKgxJxjE.js} +1 -1
  248. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-f6MOc3pl.js +8 -0
  249. package/dist/client/assets/{table-dWrfPeX-.js → table-D0EJT0uP.js} +1 -1
  250. package/dist/client/assets/{tabs-D4txthOi.js → tabs-Ctjzrm8t.js} +1 -1
  251. package/dist/client/assets/{timeline-definition-JXYKGLGB-RDrKgCoU.js → timeline-definition-JXYKGLGB-B9P7ituI.js} +1 -1
  252. package/dist/client/assets/trust-dial-D__tIhzt.js +11 -0
  253. package/dist/client/assets/{trust-posture-atZIh8tf.js → trust-posture-DaHHtOZn.js} +1 -1
  254. package/dist/client/assets/{unplug-CnevV4yX.js → unplug-B-ipHefz.js} +1 -1
  255. package/dist/client/assets/{unverified-catalog-notice-BQwT36FA.js → unverified-catalog-notice-C8swqaTn.js} +1 -1
  256. package/dist/client/assets/{use-bindings-CltfjAWW.js → use-bindings-gLHRNAFU.js} +1 -1
  257. package/dist/client/assets/{use-composer-prefs-D-Zlt6z2.js → use-composer-prefs-CjpxcBIe.js} +1 -1
  258. package/dist/client/assets/{use-connector-management-C3CLnOOt.js → use-connector-management-BLiCJMgU.js} +1 -1
  259. package/dist/client/assets/{use-deep-link-scroll-DQlz-scx.js → use-deep-link-scroll-r2nKjzA-.js} +1 -1
  260. package/dist/client/assets/{use-delete-binding-D73CLm_7.js → use-delete-binding-BSiOik_K.js} +1 -1
  261. package/dist/client/assets/{use-dev-links-BqVFsMKU.js → use-dev-links-DXcIlMf-.js} +1 -1
  262. package/dist/client/assets/use-direct-message-panel-BbH8N4mE.js +1 -0
  263. package/dist/client/assets/{use-external-adapter-catalog-DrnksH0t.js → use-external-adapter-catalog-mmKni5ui.js} +1 -1
  264. package/dist/client/assets/{use-filter-state-D4i-hDOk.js → use-filter-state-CiPZ0AIH.js} +2 -2
  265. package/dist/client/assets/{use-full-activity-feed-DdDsRg8s.js → use-full-activity-feed-DXroUzfN.js} +1 -1
  266. package/dist/client/assets/use-is-below-desktop-LUZL5z5t.js +1 -0
  267. package/dist/client/assets/{use-mesh-topology-B7aLtPkZ.js → use-mesh-topology-upehQ5Cv.js} +1 -1
  268. package/dist/client/assets/{use-mounted-ref-DSSTCJfY.js → use-mounted-ref-IHwyriaF.js} +1 -1
  269. package/dist/client/assets/{use-notification-prefs-DaF3kwmq.js → use-notification-prefs-BHOK2P2l.js} +1 -1
  270. package/dist/client/assets/use-pending-read-mVsOBTzn.js +1 -0
  271. package/dist/client/assets/{use-personality-commit-D5b90JPX.js → use-personality-commit-Chf3UX8P.js} +1 -1
  272. package/dist/client/assets/{use-promo-activation-CPAOQpfe.js → use-promo-activation-Dlw6bg7G.js} +2 -2
  273. package/dist/client/assets/{use-promo-dismissals-Bx1gz1R1.js → use-promo-dismissals-Dx_fli7I.js} +1 -1
  274. package/dist/client/assets/{use-pulse-freshness-DeulB37O.js → use-pulse-freshness-CG_I6a-O.js} +1 -1
  275. package/dist/client/assets/{use-room-follow-claim-Dwke6RFQ.js → use-room-follow-claim-Bgrpr3bO.js} +1 -1
  276. package/dist/client/assets/{use-room-sessions-iepVrIMm.js → use-room-sessions-DecGrP3E.js} +1 -1
  277. package/dist/client/assets/{use-roving-tab-list-pCPKNQKv.js → use-roving-tab-list-CDkh-Ujm.js} +1 -1
  278. package/dist/client/assets/{use-session-canvas-BvvO-_V1.js → use-session-canvas-tvLLPQcm.js} +6 -6
  279. package/dist/client/assets/{use-status-budget-Bs7MMriS.js → use-status-budget-BBl2yxLR.js} +2 -2
  280. package/dist/client/assets/{use-todos-C-eREuDS.js → use-todos-BzRauzdQ.js} +1 -1
  281. package/dist/client/assets/{use-transform-lj3TkjYO.js → use-transform-DzJeHpxm.js} +1 -1
  282. package/dist/client/assets/{use-unclaimed-chats-BF3-0jHC.js → use-unclaimed-chats--HZdmq4F.js} +1 -1
  283. package/dist/client/assets/use-update-config-DjL7-nUR.js +1 -0
  284. package/dist/client/assets/{useMutationState-B_x_4f2K.js → useMutationState-DIywUTDG.js} +1 -1
  285. package/dist/client/assets/{usecaseDiagram-WPOLBNNX-DBsRYa4J.js → usecaseDiagram-WPOLBNNX-C9aLJ03F.js} +1 -1
  286. package/dist/client/assets/{vennDiagram-Q3Y3IDCW-rFAXvcQI.js → vennDiagram-Q3Y3IDCW-ChBIWbL0.js} +1 -1
  287. package/dist/client/assets/{wardleyDiagram-IVAIDKWA-bI0JZkO3.js → wardleyDiagram-IVAIDKWA-DvQDOaTm.js} +1 -1
  288. package/dist/client/assets/{xychartDiagram-4URNHDU4-DZUd8iln.js → xychartDiagram-4URNHDU4-8FxLPP2c.js} +1 -1
  289. package/dist/client/assets/zap-DSllMMHe.js +6 -0
  290. package/dist/client/index.html +2 -2
  291. package/dist/drizzle/20261104060919_package_approval_request.sql +1 -0
  292. package/dist/drizzle/20261104081935_hook_decline_review.sql +3 -0
  293. package/dist/drizzle/20261107183323_dor3933_todos_rename.sql +64 -0
  294. package/dist/drizzle/20261108014418_dor3938_cross_agent_writer.sql +4 -0
  295. package/dist/drizzle/meta/20261104060919_snapshot.json +14889 -0
  296. package/dist/drizzle/meta/20261104081935_snapshot.json +14910 -0
  297. package/dist/drizzle/meta/20261107183323_snapshot.json +14910 -0
  298. package/dist/drizzle/meta/20261108014418_snapshot.json +14938 -0
  299. package/dist/drizzle/meta/_journal.json +28 -0
  300. package/dist/server/index.js +24875 -21931
  301. package/dist/server/index.js.map +2 -2
  302. package/package.json +5 -5
  303. package/dist/client/assets/ApplyToOverridesDialog-DE9VVQCA.js +0 -1
  304. package/dist/client/assets/BindingDialog-C_yflKOE.js +0 -1
  305. package/dist/client/assets/CanvasFileContent-C3ZKszxn.js +0 -2
  306. package/dist/client/assets/CanvasModel3dContent-CsNUuaj6.js +0 -2
  307. package/dist/client/assets/CommitmentList-DOvfnyDA.js +0 -1
  308. package/dist/client/assets/CommitmentsPage-D81vxHUk.js +0 -1
  309. package/dist/client/assets/HandlePage-vsG04kBg.js +0 -1
  310. package/dist/client/assets/HeartbeatPage-CMj1SS30.js +0 -1
  311. package/dist/client/assets/NamePage-DdX2yQ5f.js +0 -1
  312. package/dist/client/assets/PermissionHistory-Bhl2kr1R.js +0 -1
  313. package/dist/client/assets/PermissionsPage-DUbenFkt.js +0 -1
  314. package/dist/client/assets/PhotoPage-CExABoHA.js +0 -1
  315. package/dist/client/assets/TaskDialogWrapper-BVb8gAr0.js +0 -1
  316. package/dist/client/assets/TasksEmptyState-RkUEEU2r.js +0 -3
  317. package/dist/client/assets/WorkView-BDk_vwu3.js +0 -51
  318. package/dist/client/assets/_shell-CMNFxZKJ.js +0 -80
  319. package/dist/client/assets/_shell._home.index-BjR-d3_s.js +0 -3
  320. package/dist/client/assets/_shell._home.tasks-CqURPMQD.js +0 -1
  321. package/dist/client/assets/_shell.connections-D3gJrBTQ.js +0 -1
  322. package/dist/client/assets/_shell.marketplace-HdefWdN_.js +0 -1
  323. package/dist/client/assets/_shell.marketplace_.sources-wAZKfDQF.js +0 -1
  324. package/dist/client/assets/_shell.session-C0utZeSI.js +0 -1
  325. package/dist/client/assets/_shell.threads-TvzYRNMt.js +0 -1
  326. package/dist/client/assets/_shell.todos-sOFmsIPE.js +0 -6
  327. package/dist/client/assets/_shell.x._extensionId-DiEQZIvl.js +0 -1
  328. package/dist/client/assets/_shell.x._extensionId_._-DiEQZIvl.js +0 -1
  329. package/dist/client/assets/channel-B0WiEIVe.js +0 -1
  330. package/dist/client/assets/index-BwTGkJbK.js +0 -1071
  331. package/dist/client/assets/index-CCHGVclj.js +0 -1
  332. package/dist/client/assets/index-CiUmx-i3.js +0 -1
  333. package/dist/client/assets/index-Dd4JoHFP.js +0 -1
  334. package/dist/client/assets/index-DlmGvYpy.js +0 -1
  335. package/dist/client/assets/index-EXJsA5kw.js +0 -1
  336. package/dist/client/assets/index-MpS13vhQ.css +0 -1
  337. package/dist/client/assets/registry-BQTcAm5U.js +0 -39
  338. package/dist/client/assets/registry-HencHRXy.js +0 -1
  339. package/dist/client/assets/swimlanesDiagram-AYQRV4AK-nJfOIWYW.js +0 -8
  340. package/dist/client/assets/use-direct-message-panel-B3qfpDjY.js +0 -1
  341. package/dist/client/assets/use-is-below-desktop-BXHT3oPL.js +0 -1
  342. package/dist/client/assets/use-local-browser-DDWknHZE.js +0 -1
  343. package/dist/client/assets/use-pending-read-uvmEJ7H9.js +0 -1
  344. package/dist/client/assets/use-update-config-D-OGlXGR.js +0 -1
@@ -1 +1 @@
1
- import{L as s}from"./index-BLUUshO9.js";import{s as n,t as r,a as o,L as P,i as Q,c as a,f as i,l as c}from"./index-Di-MIFQG.js";import"./index-BwTGkJbK.js";const g=n({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,", :":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),p=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[g],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),T=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=l(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function l(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const u=P.define({name:"json",parser:p.configure({props:[Q.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":c})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function f(){return new o(u)}export{f as json,u as jsonLanguage,T as jsonParseLinter};
1
+ import{L as s}from"./index-DqZmnJED.js";import{s as n,t as r,a as o,L as P,i as Q,c as a,f as i,l as c}from"./index-D5Qmx1JR.js";import"./index-BR1m9FON.js";const g=n({String:r.string,Number:r.number,"True False":r.bool,PropertyName:r.propertyName,Null:r.null,", :":r.separator,"[ ]":r.squareBracket,"{ }":r.brace}),p=s.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[g],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),T=()=>t=>{try{JSON.parse(t.state.doc.toString())}catch(O){if(!(O instanceof SyntaxError))throw O;const e=l(O,t.state.doc);return[{from:e,message:O.message,severity:"error",to:e}]}return[]};function l(t,O){let e;return(e=t.message.match(/at position (\d+)/))?Math.min(+e[1],O.length):(e=t.message.match(/at line (\d+) column (\d+)/))?Math.min(O.line(+e[1]).from+ +e[2]-1,O.length):0}const u=P.define({name:"json",parser:p.configure({props:[Q.add({Object:a({except:/^\s*\}/}),Array:a({except:/^\s*\]/})}),i.add({"Object Array":c})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function f(){return new o(u)}export{f as json,u as jsonLanguage,T as jsonParseLinter};
@@ -1,4 +1,4 @@
1
- var tt=Object.defineProperty;var nt=(e,n,s)=>n in e?tt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s;var Y=(e,n,s)=>nt(e,typeof n!="symbol"?n+"":n,s);import{O as A,a5 as D,kB as st,r as h,aN as at,kC as ue,aL as rt,j as t,iR as W,kD as ot,g as Z,kE as ee,kF as te,G as O,kG as it,k8 as lt,X as ct,kH as dt,B as b,ek as ut,_ as L,aR as mt,kI as ht,a6 as ne,a7 as se,a8 as K,a2 as ye,hx as pt,hy as ft,x as xt,bz as be,bA as we,bB as je,bD as ke,ba as gt,fT as vt,kJ as yt,kK as bt,ke as wt,kL as jt,kM as kt,kN as me,J as Nt,hd as Ne,a_ as k,gC as Ct,gI as Rt,kO as Et,dS as he,kP as Tt,kQ as At,kR as Dt}from"./index-BwTGkJbK.js";import{u as _t}from"./use-roving-tab-list-pCPKNQKv.js";import{F as Ce,i as It,c as St,d as pe,e as Ot,R as zt,C as Re}from"./use-session-canvas-BvvO-_V1.js";import{f as xs,g as gs,h as vs,b as ys,j as bs}from"./use-session-canvas-BvvO-_V1.js";import{A as Mt}from"./McpAppFrame-Dm7MqOhc.js";import{F as Ut}from"./file-BIF-4ARS.js";import{F as Ee}from"./file-text-C_NPIQr4.js";import{R as Lt}from"./rotate-cw-uoeBxIeM.js";import{a as $t}from"./use-room-follow-claim-Dwke6RFQ.js";import{D as F}from"./detail-row-CjwI1iuc.js";import{R as Ft}from"./rotate-ccw-clock-qJSWqifh.js";import{c as Pt,F as Ht}from"./room-files-source-9Wdtc-bG.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CYmalBux.js";import"./WidgetErrorCard-Bwlfu514.js";import"./index-Ci_J5Q-6.js";import"./progress-Cr-4myw6.js";import"./markdown-content-BRaPEOC7.js";import"./table-dWrfPeX-.js";import"./package-DBsl3ao5.js";import"./heart-BHMhDZ0K.js";import"./git-branch-Df7a5_fb.js";import"./more-details-oDazWBxm.js";import"./copy-button-DjAoGwds.js";import"./file-exclamation-point-DxadH2b-.js";/**
1
+ var tt=Object.defineProperty;var nt=(e,n,s)=>n in e?tt(e,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[n]=s;var Y=(e,n,s)=>nt(e,typeof n!="symbol"?n+"":n,s);import{O as A,a5 as D,kE as st,r as h,aN as at,kF as ue,aL as rt,j as t,ir as W,kG as ot,g as Z,kH as ee,kI as te,G as O,kJ as it,kb as lt,X as ct,kK as dt,B as b,ej as ut,_ as L,aR as mt,kL as ht,a6 as ne,a7 as se,a8 as K,a2 as ye,eH as pt,eI as ft,x as xt,by as be,bz as we,bA as je,bC as ke,b9 as gt,f_ as vt,kM as yt,kN as bt,kh as wt,kO as jt,kP as kt,kQ as me,J as Nt,hf as Ne,aZ as k,gH as Ct,gN as Rt,kR as Et,dR as he,kS as Tt,kT as At,kU as Dt}from"./index-BR1m9FON.js";import{u as _t}from"./use-roving-tab-list-CDkh-Ujm.js";import{F as Ce,i as It,c as St,d as pe,e as Ot,R as zt,C as Re}from"./use-session-canvas-tvLLPQcm.js";import{f as gs,g as vs,h as ys,b as bs,j as ws}from"./use-session-canvas-tvLLPQcm.js";import{A as Mt}from"./McpAppFrame-z5JUaCSA.js";import{F as Ut}from"./file-CQGljfDT.js";import{F as Ee}from"./file-text-Cycq_S0e.js";import{R as Lt}from"./rotate-cw-BbHkWN-J.js";import{a as $t}from"./use-room-follow-claim-Bgrpr3bO.js";import{D as F}from"./detail-row-Crl89jnh.js";import{R as Ft}from"./rotate-ccw-clock-DRtL-2nr.js";import{c as Pt,F as Ht}from"./room-files-source-BkiK4-ZI.js";import"./query-keys-DeYqUDia.js";import"./index.esm-CJIDYBqd.js";import"./WidgetErrorCard-C5ieVv_9.js";import"./index-CpWxcN5D.js";import"./progress-BA2JPtb6.js";import"./markdown-content-DhAtZOfj.js";import"./table-D0EJT0uP.js";import"./zap-DSllMMHe.js";import"./package-BhKXbvU_.js";import"./heart-Cn3a-UQI.js";import"./git-branch-CsLE6G0Y.js";import"./more-details-DV7LmY0E.js";import"./copy-button-BOznikwM.js";import"./file-exclamation-point-B0a55VME.js";/**
2
2
  * @license lucide-react v1.48.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -40,4 +40,4 @@ var tt=Object.defineProperty;var nt=(e,n,s)=>n in e?tt(e,n,{enumerable:!0,config
40
40
  * See the LICENSE file in the root directory of this source tree.
41
41
  */const Me={name:"waypoints",size:24,node:[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]]};Me.node;const qt=A(Me);function Qt(e){const n=D(),{roomId:s,viewerAuthorId:r,documentId:l,url:m,readScrollY:o,subscribe:i}=e,a=st(s,r),g=h.useRef({roomId:s,documentId:l,url:m,readScrollY:o});g.current={roomId:s,documentId:l,url:m,readScrollY:o};const p=h.useRef(null),d=h.useRef(0);h.useEffect(()=>{if(!a||s===null||l===null)return;const x=()=>{p.current=null,d.current=Date.now();const w=g.current;if(w.roomId===null||w.documentId===null)return;const E=w.roomId,I={documentId:w.documentId,...w.url!==void 0?{url:w.url}:{},...w.readScrollY?{scrollY:Math.max(0,Math.round(w.readScrollY()))}:{}};n.publishRoomView(E,I).then(z=>{!z.followed&&r!==null&&rt.getState().noteNobodyFollowing(E,r)}).catch(()=>{})},y=()=>{if(p.current!==null)return;const w=Date.now()-d.current;if(w>=ue){x();return}p.current=setTimeout(x,ue-w)};y();const c=i==null?void 0:i(y),R=setInterval(y,at);return()=>{clearInterval(R),c==null||c()}},[n,a,s,r,l,m,i]),h.useEffect(()=>()=>{p.current!==null&&clearTimeout(p.current)},[])}const Jt={url:W,markdown:Ee,json:De,image:Vt,pdf:Ut,widget:ot,mcp_app:Mt,file:Ce,model3d:Gt,audio:Bt,video:Wt,csv:Yt,browser:W,diff:Kt},Xt="after:absolute after:inset-x-0 after:-inset-y-2 md:after:hidden";function ae(e){return e==="browser"?"browser-panel":"canvas-panel"}const Zt={canvas:"Open canvas documents",browser:"Open browser pages"};function re(e){return`canvas-tab-${e}`}const en=3;function tn(e){const n=e.map(r=>r.displayName);if(n.length===0)return null;if(n.length===1)return`${n[0]} is looking at this.`;if(n.length===2)return`${n[0]} and ${n[1]} are looking at this.`;const s=n.length-2;return`${n[0]}, ${n[1]} and ${s} ${s===1?"other":"others"} are looking at this.`}function nn({watchers:e}){const n=tn(e);if(n===null)return null;const s=e.slice(0,en),r=e.length-s.length;return t.jsxs(t.Fragment,{children:[t.jsxs("span",{"data-slot":"canvas-tab-watchers","aria-hidden":!0,className:"flex shrink-0 -space-x-1",children:[s.map(l=>t.jsx(Z,{size:"xs",className:"ring-background text-3xs size-3.5 ring-1",kind:l.kind,color:l.color??te(l.id),emoji:l.emoji,imageUrl:l.imageUrl,badge:null,fallback:ee(l.displayName)},l.id)),r>0&&t.jsxs("span",{className:"bg-muted text-muted-foreground ring-background text-3xs flex size-3.5 shrink-0 items-center justify-center rounded-full ring-1",children:["+",r]})]}),t.jsx("span",{className:"sr-only",children:n})]})}function Ue({view:e,documents:n,activeDocumentId:s,onActivate:r,onClose:l,onPin:m}){const o=ae(e),{getTabProps:i}=_t({orderedIds:n.map(a=>a.id),activeId:s,onActivate:a=>r(a),onClose:a=>l(a),getFallbackFocus:()=>document.getElementById(o)});return n.length===0?null:t.jsx("div",{role:"tablist","aria-label":Zt[e],className:"flex items-stretch gap-1 overflow-x-auto border-b px-2 py-1",children:n.map(a=>{const g=Jt[a.contentType],p=a.id===s,d=a.author;return t.jsxs("div",{role:"presentation",className:"group relative flex shrink-0",children:[t.jsxs("button",{type:"button",role:"tab","aria-selected":p,id:re(a.id),"aria-controls":p?o:void 0,...i(a.id),className:O("focus-ring flex items-center gap-1.5 rounded-md py-3 pl-2 text-xs transition-colors md:py-1",m?"pr-12":"pr-7",p?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/60 hover:text-foreground"),children:[d&&t.jsx(Z,{"aria-hidden":!0,size:"xs",className:"text-3xs size-3.5 shrink-0",kind:d.kind,color:d.color??te(d.id),emoji:d.emoji,imageUrl:d.imageUrl,badge:null,fallback:ee(d.displayName)}),t.jsx(g,{className:"size-3.5 shrink-0"}),t.jsx("span",{className:"max-w-40 truncate font-medium",children:a.sourceLabel}),a.watchers&&a.watchers.length>0&&t.jsx(nn,{watchers:a.watchers}),a.unread&&t.jsx("span",{"data-slot":"canvas-tab-unread","aria-hidden":!0,className:"bg-primary size-1.5 shrink-0 rounded-full"})]}),m&&t.jsx("button",{type:"button",tabIndex:-1,onClick:()=>m(a.id,!a.pinned),"aria-label":a.pinned?`Unpin ${a.sourceLabel}`:`Pin ${a.sourceLabel}`,className:O("focus-ring hover:bg-background/80 absolute top-1/2 right-6 -translate-y-1/2 rounded-sm p-1.5 transition-opacity md:p-0.5",a.pinned?"opacity-100":"opacity-0 group-hover:opacity-60"),children:a.pinned?t.jsx(it,{className:"size-3"}):t.jsx(lt,{className:"size-3"})}),t.jsx("button",{type:"button",tabIndex:-1,onClick:()=>l(a.id),"aria-label":`Close ${a.sourceLabel}`,className:O("focus-ring hover:bg-background/80 absolute top-1/2 right-1 -translate-y-1/2 rounded-sm p-1.5 opacity-60 transition-opacity group-hover:opacity-100 md:p-0.5",Xt),children:t.jsx(ct,{className:"size-3"})})]},a.id)})})}function sn({error:e,onRetry:n}){const s=dt(e);return t.jsxs("div",{className:"text-muted-foreground flex h-full flex-col items-center justify-center gap-3 p-8 text-center",children:[t.jsx("p",{children:"This tab hit a problem"}),s?t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-sm",children:"The app may have updated. Reloading usually fixes it."}),t.jsx(b,{type:"button",size:"sm",onClick:()=>window.location.reload(),children:"Reload DorkOS"})]}):t.jsxs(b,{type:"button",variant:"outline",size:"sm",onClick:n,children:[t.jsx(Lt,{className:"size-4"}),"Try again"]})]})}class Le extends h.Component{constructor(){super(...arguments);Y(this,"state",{error:null,retryKey:0});Y(this,"handleRetry",()=>{this.setState(s=>({error:null,retryKey:s.retryKey+1}))})}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,r){console.error(`[Canvas] Document viewer error (${this.props.documentId}):`,s,r)}render(){const{error:s,retryKey:r}=this.state;return s?t.jsx(sn,{error:s,onRetry:this.handleRetry}):t.jsx(h.Fragment,{children:this.props.children},r)}}function an({onReload:e,onKeepMine:n}){return t.jsxs("div",{role:"status",className:"border-border/60 bg-muted/40 mx-2 mt-2 space-y-2 rounded-md border px-3 py-2 text-sm",children:[t.jsx("p",{children:"Your agent changed this while you were editing. Your edit is safe."}),t.jsxs("div",{className:"flex flex-wrap gap-2",children:[t.jsx(b,{type:"button",variant:"outline",size:"sm",onClick:e,children:"Reload"}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:n,children:"Keep mine"})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Reload shows its version and ends your edit. Keep mine discards it."})]})}const rn={canvas:{heading:"A blank canvas",blurb:"Your agent can show documents, data and files here.",actions:[{icon:Ee,label:"Markdown",description:"Render a document",action:()=>({type:"markdown",content:`# Untitled
42
42
 
43
- Start writing…`,title:"Document"})},{icon:De,label:"JSON",description:"Inspect structured data",action:()=>({type:"json",data:{message:"Your data here"},title:"JSON data"})}]},browser:{heading:"No page open",blurb:"This tab shows web pages: your files, dev servers, or sites from your agent.",actions:[{icon:W,label:"Web page",description:"Open a page, then type any address",action:()=>({type:"url",url:ht.site,title:"Web Page"})}]}};function q(e,n,s,r){return e.split("").reduce((m,o)=>m+o.charCodeAt(0),0)*(n+1)*7%(r-s)+s}function $e({view:e,onAction:n}){const s=ut(),r=h.useId(),l=rn[e],m=h.useMemo(()=>Array.from({length:6},(o,i)=>({x:q(r,i*3,10,90),y:q(r,i*3+1,10,80),size:q(r,i*3+2,24,56),delay:i*.4})),[r]);return t.jsxs("div",{className:"relative flex h-full flex-col items-center justify-center overflow-hidden px-6",children:[!s&&m.map((o,i)=>t.jsx(L.div,{className:"border-border/40 absolute rounded-lg border",style:{left:`${o.x}%`,top:`${o.y}%`,width:o.size,height:o.size},initial:{opacity:0,scale:.6,rotate:-10},animate:{opacity:[0,.15,.08,.15],scale:[.6,1,.9,1],rotate:[-10,0,5,0]},transition:{duration:8,delay:o.delay,repeat:1/0,repeatType:"reverse",ease:"easeInOut"}},i)),t.jsxs(L.div,{className:"relative z-10 flex max-w-sm flex-col items-center gap-6 text-center",initial:s?!1:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut"},children:[t.jsx(L.div,{className:"bg-muted/50 text-muted-foreground flex size-14 items-center justify-center rounded-2xl",initial:s?!1:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.3,delay:.1},children:e==="browser"?t.jsx(W,{className:"size-7"}):t.jsx(mt,{className:"size-7"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:l.heading}),t.jsxs("p",{className:"text-muted-foreground text-sm leading-relaxed",children:[l.blurb,t.jsx("br",{}),"Or pick a starting point below."]})]}),t.jsx(L.div,{className:"mt-2 flex w-full flex-col gap-2",initial:"hidden",animate:"visible",variants:s?{}:{visible:{transition:{staggerChildren:.08,delayChildren:.25}}},children:l.actions.map(({icon:o,label:i,description:a,action:g})=>t.jsxs(L.button,{variants:s?{}:{hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},transition:{duration:.25},className:"border-border hover:bg-accent/50 flex items-center gap-3 rounded-lg border px-4 py-3 text-left transition-colors",onClick:()=>n(g()),children:[t.jsx(o,{className:"text-muted-foreground size-4 shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"text-sm font-medium",children:i}),t.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:a})]})]},i))})]})]})}const Fe=[{value:"hour",label:"1 hour",ms:36e5},{value:"day",label:"1 day",ms:864e5},{value:"week",label:"1 week",ms:6048e5}];function fe(e,n=Date.now()){const s=Fe.find(r=>r.value===e).ms;return new Date(Math.ceil((n+s)/6e4)*6e4).toISOString()}const on=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});function B(e){return on.format(new Date(e))}function $(e){switch(e.kind){case"log":return"Kept on this document";case"room":return e.agentName?`To ${e.agentName} in this room`:"To this room";case"owner":return e.agentName?`To ${e.agentName}`:"To the agent that opened this";case"agent":return e.agentName?`To ${e.agentName}`:"To an agent that’s gone"}}const ln={no_grant:"Off",granted:"On",waiting:"Waiting for you",suspended:"Paused",revoked:"Turned off",expired:"Ended"};function Pe(e){return ln[e]}function cn(e){const n=e.grant;switch(e.state){case"granted":return n!=null&&n.expiresAt?`Until ${B(n.expiresAt)}`:"On";case"waiting":return"An agent asked for this route.";case"suspended":return"The route or its app changed. Allow it again.";case"revoked":return n!=null&&n.revokedAt?`Turned off ${B(n.revokedAt)}`:"Turned off";case"expired":return n!=null&&n.expiresAt?`Ended ${B(n.expiresAt)}`:"Ended";case"no_grant":return e.needsPerson?"Needs your approval to start work.":"Off until someone allows it."}}function He(e){const n=`${e.turnsPerHour} ${e.turnsPerHour===1?"turn":"turns"} an hour`,s=`${e.eventsPerMinute} ${e.eventsPerMinute===1?"event":"events"} a minute`;return`${n} · ${s}`}function Ge(e){return`${Pe(e.state)}: ${$(e.destination)}`}function dn(e){const n=e==null?void 0:e.code;return typeof n=="string"&&mn.has(n)}function un(e){return{on:e.filter(n=>n.state==="granted").length,waiting:e.filter(n=>n.state==="waiting").length}}const P="This route changed. Review it again.",mn=new Set(["ROUTE_CHANGED","GRANT_BINDING_CHANGED","DECLARATION_HASH_MISMATCH","MANIFEST_CHANGED"]),H="Only a signed-in person can change routes.",xe={ROUTE_CHANGED:P,GRANT_BINDING_CHANGED:P,DECLARATION_HASH_MISMATCH:P,MANIFEST_CHANGED:P,ROUTE_UNDECLARED:"This document no longer declares that route.",ROUTE_ALREADY_ON:"This route is already on.",ROUTE_ALREADY_GRANTED:"This route is already on.",APPROVAL_NOT_RECORDED:"Couldn’t record the approval. Nothing was allowed.",TARGET_UNAVAILABLE:"The agent for this route isn’t available.",TARGET_IDENTITY_MISMATCH:"The agent for this route isn’t available.",TARGET_SCOPE_MISMATCH:"The agent for this route isn’t available.",ROOM_ROUTE_UNAVAILABLE:"This room can’t take events right now.",ORIGIN_AUTHORITY_LOST:"The agent that opened this isn’t available.",GRANT_EXPIRED:"That end time has passed. Pick another.",AGENT_CANNOT_DECIDE:H,REQUESTER_CANNOT_DECIDE:H,PERSON_REQUIRED:H,operator_cookie_required:H,AUTH_REQUIRED:"Sign in to change routes."};function Q(e){const n=e==null?void 0:e.code;return typeof n=="string"&&xe[n]?xe[n]:e instanceof TypeError?"Couldn’t reach DorkOS. Check your connection.":"Couldn’t change this route. Try again."}const J=e=>["canvas-doc-routes",e];function hn(e,n){const s=D();return ne({queryKey:J(e),queryFn:()=>s.getCanvasDocRoutes(e),retry:!1,networkMode:"always",staleTime:5e3,refetchInterval:n?15e3:6e4})}function pn(e,n,s){const r=D();return ne({queryKey:["canvas-doc-route-review",e,n,s],queryFn:()=>r.reviewCanvasDocRoute(e,n,{expiresAt:s}),enabled:s!==null,retry:!1,networkMode:"always",staleTime:1/0,gcTime:0})}function Be(e){const n=D(),s=se(),r=o=>{s.setQueryData(J(e),i=>i&&{...i,routes:i.routes.map(a=>a.id===o.route.id?o.route:a)}),s.invalidateQueries({queryKey:J(e)})},l=K({mutationFn:o=>n.approveCanvasDocRoute(e,o.routeId,{expiresAt:o.expiresAt,reviewHash:o.reviewHash}),networkMode:"always",onSuccess:r}),m=K({mutationFn:o=>n.revokeCanvasDocRoute(e,o.routeId),networkMode:"always",onSuccess:r});return{approve:l,revoke:m}}function fn(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}function xn(){return h.useSyncExternalStore(fn,()=>navigator.onLine,()=>!0)}const gn={no_grant:"neutral",granted:"success",waiting:"warning",suspended:"warning",revoked:"neutral",expired:"neutral"};function vn({documentId:e,route:n,online:s,onDone:r,onAnnounce:l}){const m=h.useId(),[o,i]=h.useState("day"),[a,g]=h.useState(()=>fe("day")),p=pn(e,n.id,a),{approve:d}=Be(e),x=p.data,y=()=>{x&&d.mutate({routeId:n.id,expiresAt:x.expiresAt,reviewHash:x.reviewHash},{onSuccess:c=>{l(Ge(c.route)),r()},onError:c=>{dn(c)&&p.refetch()}})};return t.jsxs("section",{"aria-labelledby":m,"data-testid":`doc-route-review-${n.id}`,className:"bg-background space-y-3 rounded-md p-3",children:[t.jsx("h4",{id:m,className:"text-sm font-medium",children:"Allow this route?"}),t.jsx(pt,{"aria-label":"How long",value:o,onValueChange:c=>{i(c),g(fe(c))},children:Fe.map(c=>t.jsx(ft,{value:c.value,children:c.label},c.value))}),t.jsx("div",{className:"min-h-20 space-y-1.5 text-xs",children:x?t.jsxs(t.Fragment,{children:[t.jsx(F,{label:"Goes to",align:"start",wrap:!0,children:$(x.destination)}),t.jsx(F,{label:"Events",align:"start",wrap:!0,children:t.jsx("code",{className:"font-mono",children:x.allowedTypes.join(", ")})}),t.jsx(F,{label:"Limits",align:"start",wrap:!0,children:He(x.limits)}),t.jsx(F,{label:"Ends",align:"start",wrap:!0,children:B(x.expiresAt)})]}):p.isError?t.jsx("p",{role:"alert",className:"text-destructive",children:Q(p.error)}):t.jsxs("p",{className:"text-muted-foreground flex items-center gap-2",children:[t.jsx(xt,{size:"xs"}),"Checking details…"]})}),d.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Q(d.error)}),t.jsxs("div",{className:"flex justify-end gap-2",children:[p.isError&&t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void p.refetch(),children:"Try again"}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:r,children:"Cancel"}),t.jsx(b,{type:"button",size:"sm","data-testid":`doc-route-allow-${n.id}`,disabled:!x||p.isFetching||!s||d.isPending,onClick:y,children:d.isPending?"Allowing…":"Allow route"})]})]})}function yn({documentId:e,route:n,online:s,onAnnounce:r}){const[l,m]=h.useState(!1),{revoke:o}=Be(e),i=n.state==="granted"&&n.grant!==null,a=()=>{o.mutate({routeId:n.id},{onSuccess:g=>r(Ge(g.route))})};return t.jsxs("li",{"data-testid":`doc-route-${n.id}`,"data-state":n.state,className:"bg-muted/40 space-y-2 rounded-md p-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[t.jsx("p",{className:"truncate text-sm font-medium",title:$(n.destination),children:$(n.destination)}),t.jsxs("p",{className:"text-muted-foreground truncate text-xs",children:[t.jsx("code",{className:"font-mono",children:n.on})," · ",n.id]})]}),t.jsx(ye,{shape:"pill",variant:"outline",size:"xs",tone:gn[n.state],"data-testid":`doc-route-state-${n.id}`,className:"shrink-0",children:Pe(n.state)})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:cn(n)}),i&&n.grant&&t.jsx("p",{className:"text-muted-foreground text-xs",children:He(n.grant.limits)}),o.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Q(o.error)}),l?t.jsx(vn,{documentId:e,route:n,online:s,onAnnounce:r,onDone:()=>m(!1)}):t.jsx("div",{className:"flex justify-end",children:i?t.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":`doc-route-turn-off-${n.id}`,disabled:!s||o.isPending,onClick:a,children:o.isPending?"Turning off…":"Turn off"}):t.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":`doc-route-review-button-${n.id}`,disabled:!s,onClick:()=>m(!0),children:"Review"})})]})}function bn(e){return e==="expired"?"Never started":"May have run"}function wn(e){return e==="expired"?"It waited a day and never started.":"It reached the agent, but its result is unknown."}function jn(e){switch(e.replay){case"ready":return null;case"no_grant":return"This route is off. Allow it to run this again.";case"route_changed":return"The route changed, so this can’t run again.";case"inputs_gone":return"Some of its events are no longer kept.";case"still_running":return"It may still be running. Check back once it stops.";case"route_busy":return e.status==="in_doubt"?"Newer work is waiting behind this. Clear it to continue.":"Newer work is waiting on this route. Try again after it runs."}}function kn(e){return`${e} ${e===1?"event":"events"}`}function Nn(e){return`${e} to review`}const G="Only a signed-in person can change this.",ge="This work changed. The list is up to date now.",ve={WORK_ALREADY_REVIEWED:"This was already run again or cleared.",WORK_STILL_RUNNING:"It may still be running. Try again once it stops.",WORK_NOT_FOUND:ge,WORK_NOT_REVIEWABLE:ge,CONFIRM_REPEAT_REQUIRED:"Confirm before running this again.",GRANT_REQUIRED:"This route is off. Allow it first.",GRANT_REVOKED:"This route is off. Allow it first.",GRANT_EXPIRED:"This route’s approval ended. Allow it again first.",MANIFEST_CHANGED:"The document’s app changed. Allow the route again.",ROUTE_CHANGED:"The route changed, so this can’t run again.",INPUTS_GONE:"Some of its events are no longer kept.",ROUTE_BUSY:"Newer work is waiting on this route.",AGENT_CANNOT_DECIDE:G,REQUESTER_CANNOT_DECIDE:G,PERSON_REQUIRED:G,operator_cookie_required:G,AUTH_REQUIRED:"Sign in to change this."};function Cn(e){const n=e==null?void 0:e.code;return typeof n=="string"&&ve[n]?ve[n]:e instanceof TypeError?"Couldn’t reach DorkOS. Check your connection.":"Couldn’t change this work. Try again."}const X=e=>["canvas-doc-work",e];function Rn(e,n,s){const r=D();return ne({queryKey:X(e),queryFn:()=>r.getCanvasDocWork(e),enabled:n,retry:!1,networkMode:"always",staleTime:5e3,refetchInterval:s?15e3:6e4})}function En(e){const n=D(),s=se(),r=i=>s.setQueryData(X(e),a=>a&&{...a,items:a.items.filter(g=>g.batchId!==i.batchId)}),l=()=>void s.invalidateQueries({queryKey:X(e)}),m=K({mutationFn:i=>n.replayCanvasDocWork(e,i.batchId,i.confirmRepeat?{confirmRepeat:!0}:{}),networkMode:"always",onSuccess:r,onSettled:l}),o=K({mutationFn:i=>n.clearCanvasDocWork(e,i.batchId),networkMode:"always",onSuccess:r,onSettled:l});return{replay:m,clear:o}}function Tn({documentId:e,item:n,route:s,online:r,onAnnounce:l}){const[m,o]=h.useState(!1),[i,a]=h.useState(null),g=h.useRef(null),p=h.useRef(null),{replay:d,clear:x}=En(e),y=d.isPending||x.isPending,c=n.replay==="still_running",R=jn(n),w=s?$(s.destination):n.routeId,E=n.status==="in_doubt",I=d.error??x.error;h.useEffect(()=>{var C,T;i==="cancel"&&((C=g.current)==null||C.focus()),i==="replay"&&((T=p.current)==null||T.focus())},[i,m]);const z=()=>{o(!0),a("cancel")},V=()=>{o(!1),a("replay")},N=C=>{x.reset(),d.mutate({batchId:n.batchId,...C?{confirmRepeat:C}:{}},{onSuccess:()=>l(`Running again: ${w}`)})},_=()=>{d.reset(),x.mutate({batchId:n.batchId},{onSuccess:()=>l(`Cleared: ${w}`)})};return t.jsxs("li",{"data-testid":`doc-work-${n.batchId}`,"data-status":n.status,className:"bg-muted/40 space-y-2 rounded-md p-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[t.jsx("p",{className:"truncate text-sm font-medium",title:w,children:w}),t.jsxs("p",{className:"text-muted-foreground truncate text-xs",children:[kn(n.eventCount)," · ",gt(n.since)]})]}),t.jsx(ye,{shape:"pill",variant:"outline",size:"xs",tone:E?"warning":"neutral",className:"shrink-0",children:bn(n.status)})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:wn(n.status)}),R&&t.jsx("p",{"data-testid":`doc-work-blocked-${n.batchId}`,className:"text-muted-foreground text-xs",children:R}),I&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Cn(I)}),m?t.jsxs("div",{"data-testid":`doc-work-confirm-${n.batchId}`,className:"bg-background space-y-2 rounded-md p-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Run this again?"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"It may repeat what the agent already did."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(b,{ref:g,type:"button",variant:"ghost",size:"sm",onClick:V,children:"Cancel"}),t.jsx(b,{type:"button",size:"sm","data-testid":`doc-work-confirm-replay-${n.batchId}`,disabled:!r||y,onClick:()=>N(!0),children:d.isPending?"Starting…":"Run again"})]})]}):t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(b,{type:"button",variant:"ghost",size:"sm","data-testid":`doc-work-clear-${n.batchId}`,disabled:!r||y||c,onClick:_,children:x.isPending?"Clearing…":"Clear"}),t.jsx(b,{ref:p,type:"button",variant:"outline",size:"sm","data-testid":`doc-work-replay-${n.batchId}`,disabled:!r||y||R!==null,onClick:()=>E?z():N(),children:d.isPending?"Starting…":"Run again"})]})]})}function An({documentId:e,routes:n,online:s}){var y;const[r,l]=h.useState(!1),[m,o]=h.useState(""),i=Rn(e,n.length>0,r),a=h.useCallback(c=>o(c),[]),g=((y=i.data)==null?void 0:y.items)??[],p=t.jsx("p",{"aria-live":"polite",className:"sr-only",children:m});if(g.length===0)return p;const d=Nn(g.length),x=g.some(c=>c.status==="in_doubt");return t.jsxs(t.Fragment,{children:[p,t.jsxs(be,{open:r,onOpenChange:l,modal:!0,fullHeight:!0,children:[t.jsx(we,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm","data-testid":"doc-work-trigger","aria-label":`Unfinished work: ${d}`,className:"h-6 gap-1.5 px-1.5",children:[t.jsx(Ft,{className:"size-3.5"}),t.jsxs("span",{className:O("flex items-center gap-1",x?"text-status-warning-fg":"text-muted-foreground"),children:[x&&t.jsx("span",{"aria-hidden":!0,className:"bg-status-warning size-1.5 rounded-full"}),d]})]})}),t.jsxs(je,{align:"end","aria-label":"Unfinished work","data-testid":"doc-work-panel",className:"flex max-h-[min(70vh,36rem)] w-[min(24rem,calc(100vw-2rem))] flex-col gap-3 overflow-y-auto p-3",children:[t.jsx(ke,{children:"Unfinished work"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"hidden text-sm font-medium md:block",children:"Unfinished work"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Nothing runs again until you choose."})]}),!s&&t.jsx("p",{className:"bg-status-warning-bg text-status-warning-fg rounded-md px-2 py-1.5 text-xs",children:"Offline. Changes wait until you reconnect."}),i.isError&&t.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"text-destructive",children:"Couldn’t refresh this list."}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]}),t.jsx("ul",{className:"space-y-2","aria-label":"Work to review",children:g.map(c=>t.jsx(Tn,{documentId:e,item:c,route:n.find(R=>R.id===c.routeId),online:s,onAnnounce:a},c.batchId))})]})]})]})}function Dn(e,n){return n>0?`${n} waiting`:e>0?`${e} on`:"Off"}function We({documentId:e}){var x;const[n,s]=h.useState(!1),[r,l]=h.useState(""),m=xn(),o=hn(e,n),i=h.useCallback(y=>l(y),[]),a=((x=o.data)==null?void 0:x.routes)??[];if(a.length===0)return null;const{on:g,waiting:p}=un(a),d=Dn(g,p);return t.jsxs("div",{"data-testid":"doc-routes-bar",className:"text-muted-foreground flex items-center justify-end gap-1 border-b px-3 py-1 text-xs",children:[t.jsx(An,{documentId:e,routes:a,online:m}),t.jsxs(be,{open:n,onOpenChange:s,modal:!0,fullHeight:!0,children:[t.jsx(we,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm","data-testid":"doc-routes-trigger","aria-label":`Event routes: ${d}`,className:"h-6 gap-1.5 px-1.5",children:[t.jsx(qt,{className:"size-3.5"}),"Routes",t.jsxs("span",{className:O("flex items-center gap-1",p>0?"text-status-warning-fg":"text-muted-foreground"),children:[p>0&&t.jsx("span",{"aria-hidden":!0,className:"bg-status-warning size-1.5 rounded-full"}),d]})]})}),t.jsxs(je,{align:"end","aria-label":"Event routes","data-testid":"doc-routes-panel",className:"flex max-h-[min(70vh,36rem)] w-[min(24rem,calc(100vw-2rem))] flex-col gap-3 overflow-y-auto p-3",children:[t.jsx(ke,{children:"Event routes"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"hidden text-sm font-medium md:block",children:"Event routes"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"A route does nothing until it’s allowed."})]}),!m&&t.jsx("p",{"data-testid":"doc-routes-offline",className:"bg-status-warning-bg text-status-warning-fg rounded-md px-2 py-1.5 text-xs",children:"Offline. Changes wait until you reconnect."}),o.isError&&t.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"text-destructive",children:"Couldn’t refresh routes."}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void o.refetch(),children:"Try again"})]}),t.jsx("ul",{className:"space-y-2","aria-label":"Declared routes",children:a.map(y=>t.jsx(yn,{documentId:e,route:y,online:m,onAnnounce:i},y.id))}),t.jsx("p",{role:"status","aria-live":"polite",className:"sr-only",children:r})]})]})]})}function _n({sourceLabel:e,people:n,following:s,onFollow:r,onStopFollowing:l,onDiscuss:m,discussing:o=!1}){const i=n.find(a=>a.id===s)??null;return e===void 0&&n.length===0&&m===void 0?null:t.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 border-b px-3 py-1 text-xs",children:[e!==void 0&&t.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),e===void 0&&t.jsx("span",{className:"flex-1"}),m&&t.jsxs(b,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5",disabled:o,onClick:m,children:[t.jsx(vt,{className:"size-3.5"}),"Discuss"]}),n.length>0&&t.jsxs(yt,{children:[t.jsx(bt,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm",className:O("h-6 gap-1 px-1.5",i&&"text-foreground"),children:[t.jsx(wt,{className:"size-3.5"}),i?`Following ${i.displayName}`:"Follow"]})}),t.jsxs(jt,{align:"end",children:[t.jsx(kt,{children:"Follow somebody’s browser"}),n.map(a=>t.jsxs(me,{onSelect:()=>a.id===s?l():r(a.id),children:[t.jsx(Z,{"aria-hidden":!0,size:"xs",className:"size-4 shrink-0 text-[9px]",kind:a.kind,color:a.color??te(a.id),emoji:a.emoji,imageUrl:a.imageUrl,badge:null,fallback:ee(a.displayName)}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.displayName}),a.id===s&&t.jsx(Nt,{className:"size-3.5 shrink-0"})]},a.id)),i&&t.jsx(me,{onSelect:l,children:"Stop following"})]})]})]})}function In({roomId:e,document:n,reading:s}){const r=D(),l=se(),[m,o]=h.useState(null),i=h.useMemo(()=>Pt({transport:r,queryClient:l,roomId:e}),[r,l,e]);return t.jsxs("div",{className:"flex h-full items-start justify-center p-6",children:[t.jsxs("div",{className:"bg-card shadow-soft w-full max-w-md space-y-3 rounded-lg border p-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ce,{className:"text-muted-foreground size-4 shrink-0"}),t.jsx("span",{className:"truncate text-sm font-medium",children:n.title||s.sourcePath})]}),t.jsx("p",{className:"text-muted-foreground font-mono text-xs break-all",children:s.sourcePath}),s.kind==="elsewhere"?t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.sentence}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:"A room file. Each save is recorded with your name."}),t.jsx(b,{type:"button",size:"sm",onClick:()=>o(s.sourcePath),children:"Open file"})]})]}),s.kind==="room-file"&&t.jsx(Ht,{source:i,path:m,onClose:()=>o(null)})]})}const Sn=["image","pdf","audio","video","csv","model3d"];function On(e){return/^(https?:|data:)/.test(e)||It(e)}function zn(e){if(e.type==="file"||e.type==="diff")return e.sourcePath;if(e.type==="markdown")return e.sourcePath??null;if(Sn.includes(e.type)){const n=e.src;return On(n)?null:n}return null}function Mn(e){return e.type==="file"||e.type==="diff"||e.type==="markdown"}function Un(e){const n=/^(?:in )?(.+?)['’]s /.exec(e.sourceLabel??"");return(n==null?void 0:n[1])??"another member"}function Ln(e){const n=zn(e.content);if(n===null)return{kind:"inline"};if(e.treeKind==="room-main"||e.treeKind===void 0)return Mn(e.content)?{kind:"room-file",sourcePath:n}:{kind:"elsewhere",sourcePath:n,sentence:"This file is in the room’s files. Open it from Files in the Room tab."};if(e.content.type==="diff"&&e.treeKind==="worktree"&&typeof e.aheadOfMain=="number"&&e.aheadOfMain>0)return{kind:"worktree-diff",sourcePath:n,content:e.content};if(e.content.type==="markdown")return{kind:"inline"};const s=Un(e);return{kind:"elsewhere",sourcePath:n,sentence:`${s.charAt(0).toUpperCase()}${s.slice(1)}’s project isn’t open to you. Ask them to share it, or open your copy.`}}function $n(e){return e.title||e.contentType}function Fn({roomId:e,document:n,onUpdate:s}){const r=Ln(n);return r.kind==="worktree-diff"?t.jsx(At,{roomId:e,content:r.content,documentId:n.id,authorId:n.authorId}):r.kind!=="inline"?t.jsx(In,{roomId:e,document:n,reading:r}):n.content.type==="markdown"?t.jsx(zt,{roomId:e,document:n,content:n.content,onSave:s}):t.jsx(Re,{documentId:n.id,content:n.content,onContentChange:()=>{}})}function Ke({roomId:e,view:n}){var le;const s=Ne(),r=k(u=>u.roomCanvasDocuments[e]),l=k(u=>{var f;return((f=u.roomCanvasActive[e])==null?void 0:f[n])??null}),m=k(u=>{var f;return(f=u.roomCanvasUnread[e])==null?void 0:f[n]}),o=k(u=>u.activateRoomCanvasDocument),i=k(u=>u.clearRoomCanvasUnread),a=k(u=>u.roomCanvasPresence[e]),g=St(e),p=Ct(e),d=D(),x=((le=p.data)==null?void 0:le.viewerAuthorId)??null,y=k(u=>u.roomCanvasEditing[e]??null),c=Rt(u=>u.openThread),[R,w]=h.useState(!1),E=n==="browser"?e:null,{following:I,follow:z,stop:V}=$t(E),N=Et(E),_=h.useRef(null),C=h.useCallback(async(u,f)=>{try{return await f(),!0}catch(M){return he.error(u,{description:pe(M)}),!1}},[]),T=h.useMemo(()=>Tt(r??[],n),[r,n]),j=T.find(u=>u.id===l)??null,oe=(m==null?void 0:m.length)??0;h.useEffect(()=>{oe>0&&i(e,n)},[oe,i,e,n]);const Ye=h.useMemo(()=>{var ce;const u=new Map(((ce=p.data)==null?void 0:ce.members.map(v=>[v.author.id,v.author]))??[]),f=v=>({id:v.id,displayName:v.displayName,kind:v.kind,...v.emoji?{emoji:v.emoji}:{},...v.color?{color:v.color}:{},...v.imageUrl?{imageUrl:v.imageUrl}:{}}),M=new Map;for(const[v,U]of Object.entries(a??{})){if(v===x)continue;const S=u.get(v);if(!S)continue;const de=M.get(U);de?de.push(f(S)):M.set(U,[f(S)])}return T.map(v=>{const U=u.get(v.authorId),S=M.get(v.id);return{id:v.id,sourceLabel:$n(v),contentType:v.content.type,pinned:v.pinned,unread:(m==null?void 0:m.includes(v.id))??!1,...U?{author:f(U)}:{},...S?{watchers:S}:{}}})},[T,p.data,m,a,x]);Ot(e,(j==null?void 0:j.id)??null);const qe=h.useMemo(()=>{var u;return(((u=p.data)==null?void 0:u.members)??[]).map(f=>f.author).filter(f=>f.kind==="human"&&f.id!==x).map(f=>({id:f.id,displayName:f.displayName,kind:f.kind,emoji:f.emoji,color:f.color,imageUrl:f.imageUrl}))},[p.data,x]),Qe=k(u=>{if(l===null)return;const f=u.browserHistories[l];return f?f.stack[f.cursor]:void 0}),Je=h.useCallback(()=>{var u;return((u=_.current)==null?void 0:u.scrollTop)??0},[]),Xe=h.useCallback(u=>{const f=_.current;return f?(f.addEventListener("scroll",u,{passive:!0}),()=>f.removeEventListener("scroll",u)):()=>{}},[]);Qt({roomId:E,viewerAuthorId:x,documentId:l,url:Qe,readScrollY:Je,subscribe:Xe});const ie=h.useMemo(()=>T.map(u=>u.id).join("\0"),[T]);h.useEffect(()=>{if(!(N===null||y!==null)&&ie.split("\0").includes(N.documentId)){if(N.documentId!==l){o(e,N.documentId);return}N.scrollY!==void 0&&_.current&&(_.current.scrollTop=N.scrollY)}},[N,y,l,ie,o,e]);const Ze=h.useCallback(()=>{j!==null&&(w(!0),d.discussCanvasDocument(e,j.id).then(u=>c(e,u.threadRootEntryId,!1)).catch(u=>{he.error("Couldn’t start a discussion.",{description:pe(u)})}).finally(()=>w(!1)))},[j,d,e,c]),et=ae(n);return t.jsxs(t.Fragment,{children:[!s&&t.jsx(Ue,{view:n,documents:Ye,activeDocumentId:l,onActivate:u=>o(e,u),onClose:u=>void C("Couldn’t take that off the canvas.",()=>g.close(u)),onPin:(u,f)=>void C(f?"Couldn’t pin that.":"Couldn’t unpin that.",()=>g.pin(u,f))}),t.jsx(_n,{sourceLabel:j==null?void 0:j.sourceLabel,people:n==="browser"?qe:[],following:I,onFollow:z,onStopFollowing:V,onDiscuss:j===null?void 0:Ze,discussing:R}),j&&t.jsx(We,{documentId:j.id},j.id),t.jsx("div",{id:et,ref:_,tabIndex:-1,className:"min-h-0 flex-1 overflow-auto focus-visible:outline-none",...!s&&j?{role:"tabpanel","aria-labelledby":re(j.id)}:{},children:j?t.jsx(Le,{documentId:j.id,children:t.jsx(Fn,{roomId:e,document:j,onUpdate:(u,f)=>C("Couldn’t save that for the room.",()=>g.update(u,f))})},j.id):t.jsx($e,{view:n,onAction:u=>void C("Couldn’t put that on the canvas.",()=>g.open(u))})})]})}function Ve({view:e}){const n=Ne(),s=k(c=>c.openDocuments),r=k(c=>e==="browser"?c.activeBrowserDocumentId:c.activeCanvasDocumentId),l=k(c=>c.activateCanvasDocument),m=k(c=>c.closeCanvasDocument),o=k(c=>c.setDocumentContent),i=k(c=>c.openCanvasDocument),a=k(c=>c.applyHeldUpdate),g=k(c=>c.discardHeldUpdate),p=Dt(s,e),d=p.find(c=>c.id===r)??null,x=p.map(c=>({id:c.id,sourceLabel:c.sourceLabel,contentType:c.content.type})),y=ae(e);return t.jsxs(t.Fragment,{children:[!n&&t.jsx(Ue,{view:e,documents:x,activeDocumentId:r,onActivate:l,onClose:m}),d&&t.jsx(We,{documentId:d.id},d.id),(d==null?void 0:d.heldUpdate)&&t.jsx(an,{onReload:()=>a(d.id),onKeepMine:()=>g(d.id)}),t.jsx("div",{id:y,tabIndex:-1,className:"min-h-0 flex-1 overflow-auto focus-visible:outline-none",...!n&&d?{role:"tabpanel","aria-labelledby":re(d.id)}:{},children:d?t.jsx(Le,{documentId:d.id,children:t.jsx(Re,{documentId:d.id,content:d.content,onContentChange:c=>o(d.id,c)})},d.id):t.jsx($e,{view:e,onAction:i})})]})}function ms(){const e=k(n=>n.roomCanvasLiveRoomId);return t.jsx("div",{"data-slot":"canvas",className:"flex h-full flex-col overflow-hidden",children:e?t.jsx(Ke,{roomId:e,view:"canvas"}):t.jsx(Ve,{view:"canvas"})})}function hs(){const e=k(n=>n.roomCanvasLiveRoomId);return t.jsx("div",{"data-slot":"browser",className:"flex h-full flex-col overflow-hidden",children:e?t.jsx(Ke,{roomId:e,view:"browser"}):t.jsx(Ve,{view:"browser"})})}export{hs as BrowserContent,ms as CanvasContent,xs as CanvasWidgetContent,gs as resetSessionCanvasImport,vs as useDevtoolsBridge,ys as useDocChannel,bs as useSessionCanvas};
43
+ Start writing…`,title:"Document"})},{icon:De,label:"JSON",description:"Inspect structured data",action:()=>({type:"json",data:{message:"Your data here"},title:"JSON data"})}]},browser:{heading:"No page open",blurb:"This tab shows web pages: your files, dev servers, or sites from your agent.",actions:[{icon:W,label:"Web page",description:"Open a page, then type any address",action:()=>({type:"url",url:ht.site,title:"Web Page"})}]}};function q(e,n,s,r){return e.split("").reduce((m,o)=>m+o.charCodeAt(0),0)*(n+1)*7%(r-s)+s}function $e({view:e,onAction:n}){const s=ut(),r=h.useId(),l=rn[e],m=h.useMemo(()=>Array.from({length:6},(o,i)=>({x:q(r,i*3,10,90),y:q(r,i*3+1,10,80),size:q(r,i*3+2,24,56),delay:i*.4})),[r]);return t.jsxs("div",{className:"relative flex h-full flex-col items-center justify-center overflow-hidden px-6",children:[!s&&m.map((o,i)=>t.jsx(L.div,{className:"border-border/40 absolute rounded-lg border",style:{left:`${o.x}%`,top:`${o.y}%`,width:o.size,height:o.size},initial:{opacity:0,scale:.6,rotate:-10},animate:{opacity:[0,.15,.08,.15],scale:[.6,1,.9,1],rotate:[-10,0,5,0]},transition:{duration:8,delay:o.delay,repeat:1/0,repeatType:"reverse",ease:"easeInOut"}},i)),t.jsxs(L.div,{className:"relative z-10 flex max-w-sm flex-col items-center gap-6 text-center",initial:s?!1:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut"},children:[t.jsx(L.div,{className:"bg-muted/50 text-muted-foreground flex size-14 items-center justify-center rounded-2xl",initial:s?!1:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.3,delay:.1},children:e==="browser"?t.jsx(W,{className:"size-7"}):t.jsx(mt,{className:"size-7"})}),t.jsxs("div",{className:"space-y-2",children:[t.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:l.heading}),t.jsxs("p",{className:"text-muted-foreground text-sm leading-relaxed",children:[l.blurb,t.jsx("br",{}),"Or pick a starting point below."]})]}),t.jsx(L.div,{className:"mt-2 flex w-full flex-col gap-2",initial:"hidden",animate:"visible",variants:s?{}:{visible:{transition:{staggerChildren:.08,delayChildren:.25}}},children:l.actions.map(({icon:o,label:i,description:a,action:g})=>t.jsxs(L.button,{variants:s?{}:{hidden:{opacity:0,y:8},visible:{opacity:1,y:0}},transition:{duration:.25},className:"border-border hover:bg-accent/50 flex items-center gap-3 rounded-lg border px-4 py-3 text-left transition-colors",onClick:()=>n(g()),children:[t.jsx(o,{className:"text-muted-foreground size-4 shrink-0"}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("span",{className:"text-sm font-medium",children:i}),t.jsx("span",{className:"text-muted-foreground ml-2 text-xs",children:a})]})]},i))})]})]})}const Fe=[{value:"hour",label:"1 hour",ms:36e5},{value:"day",label:"1 day",ms:864e5},{value:"week",label:"1 week",ms:6048e5}];function fe(e,n=Date.now()){const s=Fe.find(r=>r.value===e).ms;return new Date(Math.ceil((n+s)/6e4)*6e4).toISOString()}const on=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"});function B(e){return on.format(new Date(e))}function $(e){switch(e.kind){case"log":return"Kept on this document";case"room":return e.agentName?`To ${e.agentName} in this room`:"To this room";case"owner":return e.agentName?`To ${e.agentName}`:"To the agent that opened this";case"agent":return e.agentName?`To ${e.agentName}`:"To an agent that’s gone"}}const ln={no_grant:"Off",granted:"On",waiting:"Waiting for you",suspended:"Paused",revoked:"Turned off",expired:"Ended"};function Pe(e){return ln[e]}function cn(e){const n=e.grant;switch(e.state){case"granted":return n!=null&&n.expiresAt?`Until ${B(n.expiresAt)}`:"On";case"waiting":return"An agent asked for this route.";case"suspended":return"The route or its app changed. Allow it again.";case"revoked":return n!=null&&n.revokedAt?`Turned off ${B(n.revokedAt)}`:"Turned off";case"expired":return n!=null&&n.expiresAt?`Ended ${B(n.expiresAt)}`:"Ended";case"no_grant":return e.needsPerson?"Needs your approval to start work.":"Off until someone allows it."}}function He(e){const n=`${e.turnsPerHour} ${e.turnsPerHour===1?"turn":"turns"} an hour`,s=`${e.eventsPerMinute} ${e.eventsPerMinute===1?"event":"events"} a minute`;return`${n} · ${s}`}function Ge(e){return`${Pe(e.state)}: ${$(e.destination)}`}function dn(e){const n=e==null?void 0:e.code;return typeof n=="string"&&mn.has(n)}function un(e){return{on:e.filter(n=>n.state==="granted").length,waiting:e.filter(n=>n.state==="waiting").length}}const P="This route changed. Review it again.",mn=new Set(["ROUTE_CHANGED","GRANT_BINDING_CHANGED","DECLARATION_HASH_MISMATCH","MANIFEST_CHANGED"]),H="Only a signed-in person can change routes.",xe={ROUTE_CHANGED:P,GRANT_BINDING_CHANGED:P,DECLARATION_HASH_MISMATCH:P,MANIFEST_CHANGED:P,ROUTE_UNDECLARED:"This document no longer declares that route.",ROUTE_ALREADY_ON:"This route is already on.",ROUTE_ALREADY_GRANTED:"This route is already on.",APPROVAL_NOT_RECORDED:"Couldn’t record the approval. Nothing was allowed.",TARGET_UNAVAILABLE:"The agent for this route isn’t available.",TARGET_IDENTITY_MISMATCH:"The agent for this route isn’t available.",TARGET_SCOPE_MISMATCH:"The agent for this route isn’t available.",ROOM_ROUTE_UNAVAILABLE:"This room can’t take events right now.",ORIGIN_AUTHORITY_LOST:"The agent that opened this isn’t available.",GRANT_EXPIRED:"That end time has passed. Pick another.",AGENT_CANNOT_DECIDE:H,REQUESTER_CANNOT_DECIDE:H,PERSON_REQUIRED:H,operator_cookie_required:H,AUTH_REQUIRED:"Sign in to change routes."};function Q(e){const n=e==null?void 0:e.code;return typeof n=="string"&&xe[n]?xe[n]:e instanceof TypeError?"Couldn’t reach DorkOS. Check your connection.":"Couldn’t change this route. Try again."}const J=e=>["canvas-doc-routes",e];function hn(e,n){const s=D();return ne({queryKey:J(e),queryFn:()=>s.getCanvasDocRoutes(e),retry:!1,networkMode:"always",staleTime:5e3,refetchInterval:n?15e3:6e4})}function pn(e,n,s){const r=D();return ne({queryKey:["canvas-doc-route-review",e,n,s],queryFn:()=>r.reviewCanvasDocRoute(e,n,{expiresAt:s}),enabled:s!==null,retry:!1,networkMode:"always",staleTime:1/0,gcTime:0})}function Be(e){const n=D(),s=se(),r=o=>{s.setQueryData(J(e),i=>i&&{...i,routes:i.routes.map(a=>a.id===o.route.id?o.route:a)}),s.invalidateQueries({queryKey:J(e)})},l=K({mutationFn:o=>n.approveCanvasDocRoute(e,o.routeId,{expiresAt:o.expiresAt,reviewHash:o.reviewHash}),networkMode:"always",onSuccess:r}),m=K({mutationFn:o=>n.revokeCanvasDocRoute(e,o.routeId),networkMode:"always",onSuccess:r});return{approve:l,revoke:m}}function fn(e){return window.addEventListener("online",e),window.addEventListener("offline",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e)}}function xn(){return h.useSyncExternalStore(fn,()=>navigator.onLine,()=>!0)}const gn={no_grant:"neutral",granted:"success",waiting:"warning",suspended:"warning",revoked:"neutral",expired:"neutral"};function vn({documentId:e,route:n,online:s,onDone:r,onAnnounce:l}){const m=h.useId(),[o,i]=h.useState("day"),[a,g]=h.useState(()=>fe("day")),p=pn(e,n.id,a),{approve:d}=Be(e),x=p.data,y=()=>{x&&d.mutate({routeId:n.id,expiresAt:x.expiresAt,reviewHash:x.reviewHash},{onSuccess:c=>{l(Ge(c.route)),r()},onError:c=>{dn(c)&&p.refetch()}})};return t.jsxs("section",{"aria-labelledby":m,"data-testid":`doc-route-review-${n.id}`,className:"bg-background space-y-3 rounded-md p-3",children:[t.jsx("h4",{id:m,className:"text-sm font-medium",children:"Allow this route?"}),t.jsx(pt,{"aria-label":"How long",value:o,onValueChange:c=>{i(c),g(fe(c))},children:Fe.map(c=>t.jsx(ft,{value:c.value,children:c.label},c.value))}),t.jsx("div",{className:"min-h-20 space-y-1.5 text-xs",children:x?t.jsxs(t.Fragment,{children:[t.jsx(F,{label:"Goes to",align:"start",wrap:!0,children:$(x.destination)}),t.jsx(F,{label:"Events",align:"start",wrap:!0,children:t.jsx("code",{className:"font-mono",children:x.allowedTypes.join(", ")})}),t.jsx(F,{label:"Limits",align:"start",wrap:!0,children:He(x.limits)}),t.jsx(F,{label:"Ends",align:"start",wrap:!0,children:B(x.expiresAt)})]}):p.isError?t.jsx("p",{role:"alert",className:"text-destructive",children:Q(p.error)}):t.jsxs("p",{className:"text-muted-foreground flex items-center gap-2",children:[t.jsx(xt,{size:"xs"}),"Checking details…"]})}),d.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Q(d.error)}),t.jsxs("div",{className:"flex justify-end gap-2",children:[p.isError&&t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void p.refetch(),children:"Try again"}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:r,children:"Cancel"}),t.jsx(b,{type:"button",size:"sm","data-testid":`doc-route-allow-${n.id}`,disabled:!x||p.isFetching||!s||d.isPending,onClick:y,children:d.isPending?"Allowing…":"Allow route"})]})]})}function yn({documentId:e,route:n,online:s,onAnnounce:r}){const[l,m]=h.useState(!1),{revoke:o}=Be(e),i=n.state==="granted"&&n.grant!==null,a=()=>{o.mutate({routeId:n.id},{onSuccess:g=>r(Ge(g.route))})};return t.jsxs("li",{"data-testid":`doc-route-${n.id}`,"data-state":n.state,className:"bg-muted/40 space-y-2 rounded-md p-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[t.jsx("p",{className:"truncate text-sm font-medium",title:$(n.destination),children:$(n.destination)}),t.jsxs("p",{className:"text-muted-foreground truncate text-xs",children:[t.jsx("code",{className:"font-mono",children:n.on})," · ",n.id]})]}),t.jsx(ye,{shape:"pill",variant:"outline",size:"xs",tone:gn[n.state],"data-testid":`doc-route-state-${n.id}`,className:"shrink-0",children:Pe(n.state)})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:cn(n)}),i&&n.grant&&t.jsx("p",{className:"text-muted-foreground text-xs",children:He(n.grant.limits)}),o.isError&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Q(o.error)}),l?t.jsx(vn,{documentId:e,route:n,online:s,onAnnounce:r,onDone:()=>m(!1)}):t.jsx("div",{className:"flex justify-end",children:i?t.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":`doc-route-turn-off-${n.id}`,disabled:!s||o.isPending,onClick:a,children:o.isPending?"Turning off…":"Turn off"}):t.jsx(b,{type:"button",variant:"outline",size:"sm","data-testid":`doc-route-review-button-${n.id}`,disabled:!s,onClick:()=>m(!0),children:"Review"})})]})}function bn(e){return e==="expired"?"Never started":"May have run"}function wn(e){return e==="expired"?"It waited a day and never started.":"It reached the agent, but its result is unknown."}function jn(e){switch(e.replay){case"ready":return null;case"no_grant":return"This route is off. Allow it to run this again.";case"route_changed":return"The route changed, so this can’t run again.";case"inputs_gone":return"Some of its events are no longer kept.";case"still_running":return"It may still be running. Check back once it stops.";case"route_busy":return e.status==="in_doubt"?"Newer work is waiting behind this. Clear it to continue.":"Newer work is waiting on this route. Try again after it runs."}}function kn(e){return`${e} ${e===1?"event":"events"}`}function Nn(e){return`${e} to review`}const G="Only a signed-in person can change this.",ge="This work changed. The list is up to date now.",ve={WORK_ALREADY_REVIEWED:"This was already run again or cleared.",WORK_STILL_RUNNING:"It may still be running. Try again once it stops.",WORK_NOT_FOUND:ge,WORK_NOT_REVIEWABLE:ge,CONFIRM_REPEAT_REQUIRED:"Confirm before running this again.",GRANT_REQUIRED:"This route is off. Allow it first.",GRANT_REVOKED:"This route is off. Allow it first.",GRANT_EXPIRED:"This route’s approval ended. Allow it again first.",MANIFEST_CHANGED:"The document’s app changed. Allow the route again.",ROUTE_CHANGED:"The route changed, so this can’t run again.",INPUTS_GONE:"Some of its events are no longer kept.",ROUTE_BUSY:"Newer work is waiting on this route.",AGENT_CANNOT_DECIDE:G,REQUESTER_CANNOT_DECIDE:G,PERSON_REQUIRED:G,operator_cookie_required:G,AUTH_REQUIRED:"Sign in to change this."};function Cn(e){const n=e==null?void 0:e.code;return typeof n=="string"&&ve[n]?ve[n]:e instanceof TypeError?"Couldn’t reach DorkOS. Check your connection.":"Couldn’t change this work. Try again."}const X=e=>["canvas-doc-work",e];function Rn(e,n,s){const r=D();return ne({queryKey:X(e),queryFn:()=>r.getCanvasDocWork(e),enabled:n,retry:!1,networkMode:"always",staleTime:5e3,refetchInterval:s?15e3:6e4})}function En(e){const n=D(),s=se(),r=i=>s.setQueryData(X(e),a=>a&&{...a,items:a.items.filter(g=>g.batchId!==i.batchId)}),l=()=>void s.invalidateQueries({queryKey:X(e)}),m=K({mutationFn:i=>n.replayCanvasDocWork(e,i.batchId,i.confirmRepeat?{confirmRepeat:!0}:{}),networkMode:"always",onSuccess:r,onSettled:l}),o=K({mutationFn:i=>n.clearCanvasDocWork(e,i.batchId),networkMode:"always",onSuccess:r,onSettled:l});return{replay:m,clear:o}}function Tn({documentId:e,item:n,route:s,online:r,onAnnounce:l}){const[m,o]=h.useState(!1),[i,a]=h.useState(null),g=h.useRef(null),p=h.useRef(null),{replay:d,clear:x}=En(e),y=d.isPending||x.isPending,c=n.replay==="still_running",R=jn(n),w=s?$(s.destination):n.routeId,E=n.status==="in_doubt",I=d.error??x.error;h.useEffect(()=>{var C,T;i==="cancel"&&((C=g.current)==null||C.focus()),i==="replay"&&((T=p.current)==null||T.focus())},[i,m]);const z=()=>{o(!0),a("cancel")},V=()=>{o(!1),a("replay")},N=C=>{x.reset(),d.mutate({batchId:n.batchId,...C?{confirmRepeat:C}:{}},{onSuccess:()=>l(`Running again: ${w}`)})},_=()=>{d.reset(),x.mutate({batchId:n.batchId},{onSuccess:()=>l(`Cleared: ${w}`)})};return t.jsxs("li",{"data-testid":`doc-work-${n.batchId}`,"data-status":n.status,className:"bg-muted/40 space-y-2 rounded-md p-3",children:[t.jsxs("div",{className:"flex items-start justify-between gap-2",children:[t.jsxs("div",{className:"min-w-0 space-y-0.5",children:[t.jsx("p",{className:"truncate text-sm font-medium",title:w,children:w}),t.jsxs("p",{className:"text-muted-foreground truncate text-xs",children:[kn(n.eventCount)," · ",gt(n.since)]})]}),t.jsx(ye,{shape:"pill",variant:"outline",size:"xs",tone:E?"warning":"neutral",className:"shrink-0",children:bn(n.status)})]}),t.jsx("p",{className:"text-muted-foreground text-xs",children:wn(n.status)}),R&&t.jsx("p",{"data-testid":`doc-work-blocked-${n.batchId}`,className:"text-muted-foreground text-xs",children:R}),I&&t.jsx("p",{role:"alert",className:"text-destructive text-xs",children:Cn(I)}),m?t.jsxs("div",{"data-testid":`doc-work-confirm-${n.batchId}`,className:"bg-background space-y-2 rounded-md p-3",children:[t.jsx("p",{className:"text-sm font-medium",children:"Run this again?"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"It may repeat what the agent already did."}),t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(b,{ref:g,type:"button",variant:"ghost",size:"sm",onClick:V,children:"Cancel"}),t.jsx(b,{type:"button",size:"sm","data-testid":`doc-work-confirm-replay-${n.batchId}`,disabled:!r||y,onClick:()=>N(!0),children:d.isPending?"Starting…":"Run again"})]})]}):t.jsxs("div",{className:"flex justify-end gap-2",children:[t.jsx(b,{type:"button",variant:"ghost",size:"sm","data-testid":`doc-work-clear-${n.batchId}`,disabled:!r||y||c,onClick:_,children:x.isPending?"Clearing…":"Clear"}),t.jsx(b,{ref:p,type:"button",variant:"outline",size:"sm","data-testid":`doc-work-replay-${n.batchId}`,disabled:!r||y||R!==null,onClick:()=>E?z():N(),children:d.isPending?"Starting…":"Run again"})]})]})}function An({documentId:e,routes:n,online:s}){var y;const[r,l]=h.useState(!1),[m,o]=h.useState(""),i=Rn(e,n.length>0,r),a=h.useCallback(c=>o(c),[]),g=((y=i.data)==null?void 0:y.items)??[],p=t.jsx("p",{"aria-live":"polite",className:"sr-only",children:m});if(g.length===0)return p;const d=Nn(g.length),x=g.some(c=>c.status==="in_doubt");return t.jsxs(t.Fragment,{children:[p,t.jsxs(be,{open:r,onOpenChange:l,modal:!0,fullHeight:!0,children:[t.jsx(we,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm","data-testid":"doc-work-trigger","aria-label":`Unfinished work: ${d}`,className:"h-6 gap-1.5 px-1.5",children:[t.jsx(Ft,{className:"size-3.5"}),t.jsxs("span",{className:O("flex items-center gap-1",x?"text-status-warning-fg":"text-muted-foreground"),children:[x&&t.jsx("span",{"aria-hidden":!0,className:"bg-status-warning size-1.5 rounded-full"}),d]})]})}),t.jsxs(je,{align:"end","aria-label":"Unfinished work","data-testid":"doc-work-panel",className:"flex max-h-[min(70vh,36rem)] w-[min(24rem,calc(100vw-2rem))] flex-col gap-3 overflow-y-auto p-3",children:[t.jsx(ke,{children:"Unfinished work"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"hidden text-sm font-medium md:block",children:"Unfinished work"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"Nothing runs again until you choose."})]}),!s&&t.jsx("p",{className:"bg-status-warning-bg text-status-warning-fg rounded-md px-2 py-1.5 text-xs",children:"Offline. Changes wait until you reconnect."}),i.isError&&t.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"text-destructive",children:"Couldn’t refresh this list."}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void i.refetch(),children:"Try again"})]}),t.jsx("ul",{className:"space-y-2","aria-label":"Work to review",children:g.map(c=>t.jsx(Tn,{documentId:e,item:c,route:n.find(R=>R.id===c.routeId),online:s,onAnnounce:a},c.batchId))})]})]})]})}function Dn(e,n){return n>0?`${n} waiting`:e>0?`${e} on`:"Off"}function We({documentId:e}){var x;const[n,s]=h.useState(!1),[r,l]=h.useState(""),m=xn(),o=hn(e,n),i=h.useCallback(y=>l(y),[]),a=((x=o.data)==null?void 0:x.routes)??[];if(a.length===0)return null;const{on:g,waiting:p}=un(a),d=Dn(g,p);return t.jsxs("div",{"data-testid":"doc-routes-bar",className:"text-muted-foreground flex items-center justify-end gap-1 border-b px-3 py-1 text-xs",children:[t.jsx(An,{documentId:e,routes:a,online:m}),t.jsxs(be,{open:n,onOpenChange:s,modal:!0,fullHeight:!0,children:[t.jsx(we,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm","data-testid":"doc-routes-trigger","aria-label":`Event routes: ${d}`,className:"h-6 gap-1.5 px-1.5",children:[t.jsx(qt,{className:"size-3.5"}),"Routes",t.jsxs("span",{className:O("flex items-center gap-1",p>0?"text-status-warning-fg":"text-muted-foreground"),children:[p>0&&t.jsx("span",{"aria-hidden":!0,className:"bg-status-warning size-1.5 rounded-full"}),d]})]})}),t.jsxs(je,{align:"end","aria-label":"Event routes","data-testid":"doc-routes-panel",className:"flex max-h-[min(70vh,36rem)] w-[min(24rem,calc(100vw-2rem))] flex-col gap-3 overflow-y-auto p-3",children:[t.jsx(ke,{children:"Event routes"}),t.jsxs("div",{className:"space-y-1",children:[t.jsx("h3",{className:"hidden text-sm font-medium md:block",children:"Event routes"}),t.jsx("p",{className:"text-muted-foreground text-xs",children:"A route does nothing until it’s allowed."})]}),!m&&t.jsx("p",{"data-testid":"doc-routes-offline",className:"bg-status-warning-bg text-status-warning-fg rounded-md px-2 py-1.5 text-xs",children:"Offline. Changes wait until you reconnect."}),o.isError&&t.jsxs("div",{role:"alert",className:"flex items-center justify-between gap-2 text-xs",children:[t.jsx("span",{className:"text-destructive",children:"Couldn’t refresh routes."}),t.jsx(b,{type:"button",variant:"ghost",size:"sm",onClick:()=>void o.refetch(),children:"Try again"})]}),t.jsx("ul",{className:"space-y-2","aria-label":"Declared routes",children:a.map(y=>t.jsx(yn,{documentId:e,route:y,online:m,onAnnounce:i},y.id))}),t.jsx("p",{role:"status","aria-live":"polite",className:"sr-only",children:r})]})]})]})}function _n({sourceLabel:e,people:n,following:s,onFollow:r,onStopFollowing:l,onDiscuss:m,discussing:o=!1}){const i=n.find(a=>a.id===s)??null;return e===void 0&&n.length===0&&m===void 0?null:t.jsxs("div",{className:"text-muted-foreground flex items-center gap-2 border-b px-3 py-1 text-xs",children:[e!==void 0&&t.jsx("span",{className:"min-w-0 flex-1 truncate",children:e}),e===void 0&&t.jsx("span",{className:"flex-1"}),m&&t.jsxs(b,{type:"button",variant:"ghost",size:"sm",className:"h-6 gap-1 px-1.5",disabled:o,onClick:m,children:[t.jsx(vt,{className:"size-3.5"}),"Discuss"]}),n.length>0&&t.jsxs(yt,{children:[t.jsx(bt,{asChild:!0,children:t.jsxs(b,{type:"button",variant:"ghost",size:"sm",className:O("h-6 gap-1 px-1.5",i&&"text-foreground"),children:[t.jsx(wt,{className:"size-3.5"}),i?`Following ${i.displayName}`:"Follow"]})}),t.jsxs(jt,{align:"end",children:[t.jsx(kt,{children:"Follow somebody’s browser"}),n.map(a=>t.jsxs(me,{onSelect:()=>a.id===s?l():r(a.id),children:[t.jsx(Z,{"aria-hidden":!0,size:"xs",className:"size-4 shrink-0 text-[9px]",kind:a.kind,color:a.color??te(a.id),emoji:a.emoji,imageUrl:a.imageUrl,badge:null,fallback:ee(a.displayName)}),t.jsx("span",{className:"min-w-0 flex-1 truncate",children:a.displayName}),a.id===s&&t.jsx(Nt,{className:"size-3.5 shrink-0"})]},a.id)),i&&t.jsx(me,{onSelect:l,children:"Stop following"})]})]})]})}function In({roomId:e,document:n,reading:s}){const r=D(),l=se(),[m,o]=h.useState(null),i=h.useMemo(()=>Pt({transport:r,queryClient:l,roomId:e}),[r,l,e]);return t.jsxs("div",{className:"flex h-full items-start justify-center p-6",children:[t.jsxs("div",{className:"bg-card shadow-soft w-full max-w-md space-y-3 rounded-lg border p-4",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(Ce,{className:"text-muted-foreground size-4 shrink-0"}),t.jsx("span",{className:"truncate text-sm font-medium",children:n.title||s.sourcePath})]}),t.jsx("p",{className:"text-muted-foreground font-mono text-xs break-all",children:s.sourcePath}),s.kind==="elsewhere"?t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:s.sentence}):t.jsxs(t.Fragment,{children:[t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:"A room file. Each save is recorded with your name."}),t.jsx(b,{type:"button",size:"sm",onClick:()=>o(s.sourcePath),children:"Open file"})]})]}),s.kind==="room-file"&&t.jsx(Ht,{source:i,path:m,onClose:()=>o(null)})]})}const Sn=["image","pdf","audio","video","csv","model3d"];function On(e){return/^(https?:|data:)/.test(e)||It(e)}function zn(e){if(e.type==="file"||e.type==="diff")return e.sourcePath;if(e.type==="markdown")return e.sourcePath??null;if(Sn.includes(e.type)){const n=e.src;return On(n)?null:n}return null}function Mn(e){return e.type==="file"||e.type==="diff"||e.type==="markdown"}function Un(e){const n=/^(?:in )?(.+?)['’]s /.exec(e.sourceLabel??"");return(n==null?void 0:n[1])??"another member"}function Ln(e){const n=zn(e.content);if(n===null)return{kind:"inline"};if(e.treeKind==="room-main"||e.treeKind===void 0)return Mn(e.content)?{kind:"room-file",sourcePath:n}:{kind:"elsewhere",sourcePath:n,sentence:"This file is in the room’s files. Open it from Files in the Room tab."};if(e.content.type==="diff"&&e.treeKind==="worktree"&&typeof e.aheadOfMain=="number"&&e.aheadOfMain>0)return{kind:"worktree-diff",sourcePath:n,content:e.content};if(e.content.type==="markdown")return{kind:"inline"};const s=Un(e);return{kind:"elsewhere",sourcePath:n,sentence:`${s.charAt(0).toUpperCase()}${s.slice(1)}’s project isn’t open to you. Ask them to share it, or open your copy.`}}function $n(e){return e.title||e.contentType}function Fn({roomId:e,document:n,onUpdate:s}){const r=Ln(n);return r.kind==="worktree-diff"?t.jsx(At,{roomId:e,content:r.content,documentId:n.id,authorId:n.authorId}):r.kind!=="inline"?t.jsx(In,{roomId:e,document:n,reading:r}):n.content.type==="markdown"?t.jsx(zt,{roomId:e,document:n,content:n.content,onSave:s}):t.jsx(Re,{documentId:n.id,content:n.content,onContentChange:()=>{}})}function Ke({roomId:e,view:n}){var le;const s=Ne(),r=k(u=>u.roomCanvasDocuments[e]),l=k(u=>{var f;return((f=u.roomCanvasActive[e])==null?void 0:f[n])??null}),m=k(u=>{var f;return(f=u.roomCanvasUnread[e])==null?void 0:f[n]}),o=k(u=>u.activateRoomCanvasDocument),i=k(u=>u.clearRoomCanvasUnread),a=k(u=>u.roomCanvasPresence[e]),g=St(e),p=Ct(e),d=D(),x=((le=p.data)==null?void 0:le.viewerAuthorId)??null,y=k(u=>u.roomCanvasEditing[e]??null),c=Rt(u=>u.openThread),[R,w]=h.useState(!1),E=n==="browser"?e:null,{following:I,follow:z,stop:V}=$t(E),N=Et(E),_=h.useRef(null),C=h.useCallback(async(u,f)=>{try{return await f(),!0}catch(M){return he.error(u,{description:pe(M)}),!1}},[]),T=h.useMemo(()=>Tt(r??[],n),[r,n]),j=T.find(u=>u.id===l)??null,oe=(m==null?void 0:m.length)??0;h.useEffect(()=>{oe>0&&i(e,n)},[oe,i,e,n]);const Ye=h.useMemo(()=>{var ce;const u=new Map(((ce=p.data)==null?void 0:ce.members.map(v=>[v.author.id,v.author]))??[]),f=v=>({id:v.id,displayName:v.displayName,kind:v.kind,...v.emoji?{emoji:v.emoji}:{},...v.color?{color:v.color}:{},...v.imageUrl?{imageUrl:v.imageUrl}:{}}),M=new Map;for(const[v,U]of Object.entries(a??{})){if(v===x)continue;const S=u.get(v);if(!S)continue;const de=M.get(U);de?de.push(f(S)):M.set(U,[f(S)])}return T.map(v=>{const U=u.get(v.authorId),S=M.get(v.id);return{id:v.id,sourceLabel:$n(v),contentType:v.content.type,pinned:v.pinned,unread:(m==null?void 0:m.includes(v.id))??!1,...U?{author:f(U)}:{},...S?{watchers:S}:{}}})},[T,p.data,m,a,x]);Ot(e,(j==null?void 0:j.id)??null);const qe=h.useMemo(()=>{var u;return(((u=p.data)==null?void 0:u.members)??[]).map(f=>f.author).filter(f=>f.kind==="human"&&f.id!==x).map(f=>({id:f.id,displayName:f.displayName,kind:f.kind,emoji:f.emoji,color:f.color,imageUrl:f.imageUrl}))},[p.data,x]),Qe=k(u=>{if(l===null)return;const f=u.browserHistories[l];return f?f.stack[f.cursor]:void 0}),Je=h.useCallback(()=>{var u;return((u=_.current)==null?void 0:u.scrollTop)??0},[]),Xe=h.useCallback(u=>{const f=_.current;return f?(f.addEventListener("scroll",u,{passive:!0}),()=>f.removeEventListener("scroll",u)):()=>{}},[]);Qt({roomId:E,viewerAuthorId:x,documentId:l,url:Qe,readScrollY:Je,subscribe:Xe});const ie=h.useMemo(()=>T.map(u=>u.id).join("\0"),[T]);h.useEffect(()=>{if(!(N===null||y!==null)&&ie.split("\0").includes(N.documentId)){if(N.documentId!==l){o(e,N.documentId);return}N.scrollY!==void 0&&_.current&&(_.current.scrollTop=N.scrollY)}},[N,y,l,ie,o,e]);const Ze=h.useCallback(()=>{j!==null&&(w(!0),d.discussCanvasDocument(e,j.id).then(u=>c(e,u.threadRootEntryId,!1)).catch(u=>{he.error("Couldn’t start a discussion.",{description:pe(u)})}).finally(()=>w(!1)))},[j,d,e,c]),et=ae(n);return t.jsxs(t.Fragment,{children:[!s&&t.jsx(Ue,{view:n,documents:Ye,activeDocumentId:l,onActivate:u=>o(e,u),onClose:u=>void C("Couldn’t take that off the canvas.",()=>g.close(u)),onPin:(u,f)=>void C(f?"Couldn’t pin that.":"Couldn’t unpin that.",()=>g.pin(u,f))}),t.jsx(_n,{sourceLabel:j==null?void 0:j.sourceLabel,people:n==="browser"?qe:[],following:I,onFollow:z,onStopFollowing:V,onDiscuss:j===null?void 0:Ze,discussing:R}),j&&t.jsx(We,{documentId:j.id},j.id),t.jsx("div",{id:et,ref:_,tabIndex:-1,className:"min-h-0 flex-1 overflow-auto focus-visible:outline-none",...!s&&j?{role:"tabpanel","aria-labelledby":re(j.id)}:{},children:j?t.jsx(Le,{documentId:j.id,children:t.jsx(Fn,{roomId:e,document:j,onUpdate:(u,f)=>C("Couldn’t save that for the room.",()=>g.update(u,f))})},j.id):t.jsx($e,{view:n,onAction:u=>void C("Couldn’t put that on the canvas.",()=>g.open(u))})})]})}function Ve({view:e}){const n=Ne(),s=k(c=>c.openDocuments),r=k(c=>e==="browser"?c.activeBrowserDocumentId:c.activeCanvasDocumentId),l=k(c=>c.activateCanvasDocument),m=k(c=>c.closeCanvasDocument),o=k(c=>c.setDocumentContent),i=k(c=>c.openCanvasDocument),a=k(c=>c.applyHeldUpdate),g=k(c=>c.discardHeldUpdate),p=Dt(s,e),d=p.find(c=>c.id===r)??null,x=p.map(c=>({id:c.id,sourceLabel:c.sourceLabel,contentType:c.content.type})),y=ae(e);return t.jsxs(t.Fragment,{children:[!n&&t.jsx(Ue,{view:e,documents:x,activeDocumentId:r,onActivate:l,onClose:m}),d&&t.jsx(We,{documentId:d.id},d.id),(d==null?void 0:d.heldUpdate)&&t.jsx(an,{onReload:()=>a(d.id),onKeepMine:()=>g(d.id)}),t.jsx("div",{id:y,tabIndex:-1,className:"min-h-0 flex-1 overflow-auto focus-visible:outline-none",...!n&&d?{role:"tabpanel","aria-labelledby":re(d.id)}:{},children:d?t.jsx(Le,{documentId:d.id,children:t.jsx(Re,{documentId:d.id,content:d.content,onContentChange:c=>o(d.id,c)})},d.id):t.jsx($e,{view:e,onAction:i})})]})}function hs(){const e=k(n=>n.roomCanvasLiveRoomId);return t.jsx("div",{"data-slot":"canvas",className:"flex h-full flex-col overflow-hidden",children:e?t.jsx(Ke,{roomId:e,view:"canvas"}):t.jsx(Ve,{view:"canvas"})})}function ps(){const e=k(n=>n.roomCanvasLiveRoomId);return t.jsx("div",{"data-slot":"browser",className:"flex h-full flex-col overflow-hidden",children:e?t.jsx(Ke,{roomId:e,view:"browser"}):t.jsx(Ve,{view:"browser"})})}export{ps as BrowserContent,hs as CanvasContent,gs as CanvasWidgetContent,vs as resetSessionCanvasImport,ys as useDevtoolsBridge,bs as useDocChannel,ws as useSessionCanvas};
@@ -1 +1 @@
1
- import{ht as ve,j as e,hu as Ne,hv as ye,hw as T,hx as we,hy as Z,d0 as re,cw as ie,r as C,am as D,gD as E,H as _,aX as O,X as B,hz as be,hA as Se,gg as q,gh as H,B as $,f as K,gi as X,a6 as oe,a7 as de,a8 as le,hB as z,hC as ce,dS as S,hD as me,hE as Ce,hF as ue,hG as ke,hH as he,fR as Ee,a4 as $e,bf as Ae,g6 as Pe,hI as Re,g0 as Te,g1 as De,hJ as _e,hK as Oe,U as ze,G as F,eG as Ie,hL as ee,hM as Le,hN as Me,a2 as M,a3 as Fe,hO as Ue,hP as Be,hQ as qe,hR as He,hS as Ke,hT as Xe,hU as Ge,hV as Ye,hW as se,f8 as Ve,hX as Qe,hY as te}from"./index-BwTGkJbK.js";import{hZ as Rs,h_ as Ts,h$ as Ds,i0 as _s,i1 as Os,g4 as zs}from"./index-BwTGkJbK.js";import{u as Je}from"./use-deep-link-scroll-DQlz-scx.js";import{M as xe}from"./more-details-oDazWBxm.js";import{u as We,a as Ze}from"./ForwardConsentHost-kDdpyBgA.js";import{F as Ls}from"./ForwardConsentHost-kDdpyBgA.js";import{C as G,a as Y,b as V,c as Q,d as A,e as P}from"./command-CxGYZKco.js";import{F as ge}from"./file-text-C_NPIQr4.js";const es=["server_crashed","server_out_of_memory","server_unresponsive","isolation_unavailable","server_start_failed","server_start_timeout"],ss={server_crashed:s=>`${s} stopped unexpectedly 3 times. Reload it to try again.`,server_out_of_memory:s=>`${s} ran out of memory and stopped. Reload it to try again.`,server_unresponsive:s=>`${s} stopped responding, so DorkOS stopped it.`,isolation_unavailable:s=>`${s} can’t run with its limits on this computer.`,server_start_failed:s=>`${s} couldn’t start. Reload it to try again.`,server_start_timeout:s=>`${s} took too long to start. Reload it to try again.`};function U(s){return es.includes(s)}function ts(s,t){return U(s)?ss[s](t):null}function ns(s){return`Restarting ${s}…`}function as({extensionId:s}){const t=ve("right-panel").filter(n=>n.extensionId===s);return t.length===0?null:e.jsx("div",{className:"space-y-3 pt-1","data-testid":`panel-tab-placement-${s}`,children:t.map(n=>e.jsx(is,{tab:n,labelled:t.length>1},n.id))})}function rs(){var n;const s=(n=re().data)==null?void 0:n.agents,t=ie().data;return C.useMemo(()=>{const l=new Map((s??[]).map(a=>[a.id,D(a)])),i=new Map((t??[]).map(a=>[a.id,E(a)]));return{agents:s??[],rooms:t??[],agentNames:l,roomNames:i}},[s,t])}function is({tab:s,labelled:t}){const n=Ne(We(),s.id),{setPlacement:l}=Ze(),i=rs(),a=ye(n,s.declaredPlacement),h=a.show.pages.includes(T),u=d=>l(s.id,{show:d.show,hide:d.hide}),c=d=>d.kind==="agents"?i.agentNames.get(d.id)??"An agent that is gone":d.kind==="rooms"?i.roomNames.get(d.id)??"A channel that is gone":be(d.id),r=(d,f)=>["agents","rooms","pages"].flatMap(j=>d[j].filter(y=>f||y!==T).map(y=>({kind:j,id:y}))),o=(d,f)=>({...d,[f.kind]:d[f.kind].filter(j=>j!==f.id)}),v=r(a.show,!1),p=r(a.hide,!0);return e.jsxs("div",{className:"space-y-2","data-testid":`panel-tab-placement-${s.id}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm",children:t?`${s.title} tab shows`:"Panel tab shows"}),e.jsxs(we,{value:h?"everywhere":"only",onValueChange:d=>u({hide:a.hide,show:d==="everywhere"?{...a.show,pages:[T]}:{...a.show,pages:a.show.pages.filter(f=>f!==T)}}),"aria-label":`Where the ${s.title} tab shows`,children:[e.jsx(Z,{value:"everywhere",children:"Everywhere"}),e.jsx(Z,{value:"only",children:"Only in…"})]}),n&&e.jsx("button",{type:"button",onClick:()=>l(s.id,null),className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2",children:s.declaredPlacement?"Use its default":"Reset"})]}),!h&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.map(d=>e.jsx(ne,{place:d,name:c(d),removeLabel:`Remove ${c(d)}`,onRemove:()=>u({...a,show:o(a.show,d)})},`${d.kind}:${d.id}`)),e.jsx(ds,{tabTitle:s.title,names:i,taken:a.show,onAdd:d=>u({show:{...a.show,[d.kind]:[...a.show[d.kind],d.id]},hide:o(a.hide,d)})}),v.length===0&&e.jsx("span",{className:"text-muted-foreground text-xs",children:"Shows nowhere yet. Add a place."})]}),p.length>0&&e.jsxs("div",{role:"group","aria-labelledby":`${s.id}-hidden-in`,className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{id:`${s.id}-hidden-in`,className:"text-muted-foreground text-xs",children:"Hidden in"}),p.map(d=>e.jsx(ne,{place:d,name:c(d),removeLabel:`Show in ${c(d)} again`,onRemove:()=>u({...a,hide:o(a.hide,d)})},`${d.kind}:${d.id}`))]})]})}const os={agents:O,rooms:_,pages:ge};function ne({place:s,name:t,removeLabel:n,onRemove:l}){const i=os[s.kind];return e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(i,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:t}),e.jsx("button",{type:"button",onClick:l,"aria-label":n,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]})}function ds({tabTitle:s,names:t,taken:n,onAdd:l}){const[i,a]=C.useState(!1),h=o=>{l(o),a(!1)},u=Se.filter(o=>!n.pages.includes(o.key)),c=t.agents.filter(o=>!n.agents.includes(o.id)),r=t.rooms.filter(o=>!n.rooms.includes(o.id));return e.jsxs(q,{open:i,onOpenChange:a,children:[e.jsx(H,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add a place for the ${s} tab`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(X,{align:"start",className:"w-64 p-0",children:e.jsxs(G,{children:[e.jsx(Y,{placeholder:"Find an agent, channel or page"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),c.length>0&&e.jsx(A,{heading:"Agents",children:c.map(o=>e.jsxs(P,{value:`agent ${D(o)} ${o.id}`,onSelect:()=>h({kind:"agents",id:o.id}),children:[e.jsx(O,{className:"size-3.5"}),D(o)]},o.id))}),r.length>0&&e.jsx(A,{heading:"Channels and DMs",children:r.map(o=>e.jsxs(P,{value:`room ${E(o)} ${o.id}`,onSelect:()=>h({kind:"rooms",id:o.id}),children:[e.jsx(_,{className:"size-3.5"}),E(o)]},o.id))}),u.length>0&&e.jsx(A,{heading:"Pages",children:u.map(o=>e.jsxs(P,{value:`page ${o.label}`,onSelect:()=>h({kind:"pages",id:o.key}),children:[e.jsx(ge,{className:"size-3.5"}),o.label]},o.key))})]})]})})]})}const pe=s=>[...ce.detail(s),"room-access"];function ls(s){return oe({queryKey:pe(s),queryFn:async()=>{const t=await fetch(z(`/extensions/${s}/room-access`));if(!t.ok)throw new Error(`Couldn’t load the rooms. The server answered ${t.status}.`);return(await t.json()).roomIds}})}function cs(s){const t=de();return le({mutationFn:async n=>{const l=await fetch(z(`/extensions/${s}/room-access`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roomIds:n})});if(!l.ok){const i=await l.json().catch(()=>({}));throw new Error(i.message??i.error??"Couldn’t save the rooms. Try again.")}return(await l.json()).roomIds},onSuccess:n=>{t.setQueryData(pe(s),n)}})}function ms({extensionId:s,name:t}){const n=ls(s).data??[],{mutate:l}=cs(s),i=ie().data,a=C.useMemo(()=>(i??[]).filter(r=>!r.bridge),[i]),h=C.useMemo(()=>new Map((i??[]).map(r=>[r.id,E(r)])),[i]),u=r=>l(r,{onError:o=>S.error(o.message)}),c=r=>h.get(r)??"A room that is gone";return e.jsxs("div",{className:"space-y-1.5 pt-1","data-testid":`room-access-${s}`,children:[e.jsx("p",{className:"text-sm",children:"Rooms it can use"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(r=>e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(_,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:c(r)}),e.jsx("button",{type:"button",onClick:()=>u(n.filter(o=>o!==r)),"aria-label":`Remove ${c(r)}`,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]},r)),e.jsx(us,{name:t,rooms:a.filter(r=>!n.includes(r.id)),onAdd:r=>u([...n,r])})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:n.length===0?"None yet. It can’t read or reply anywhere.":"It reads and replies as you, only here."})]})}function us({name:s,rooms:t,onAdd:n}){const[l,i]=C.useState(!1);return e.jsxs(q,{open:l,onOpenChange:i,children:[e.jsx(H,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add a room for ${s}`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(X,{align:"start",className:"w-64 p-0",children:e.jsxs(G,{children:[e.jsx(Y,{placeholder:"Find a channel or DM"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),t.length>0&&e.jsx(A,{heading:"Channels and DMs",children:t.map(a=>e.jsxs(P,{value:`room ${E(a)} ${a.id}`,onSelect:()=>{n(a.id),i(!1)},children:[e.jsx(_,{className:"size-3.5"}),E(a)]},a.id))})]})]})})]})}const fe=s=>[...ce.detail(s),"forward-agents"];function hs(s){return oe({queryKey:fe(s),queryFn:async()=>{const t=await fetch(z(`/extensions/${s}/forward-agents`),{headers:{"X-Client-Id":me()}});if(!t.ok)throw new Error(`Couldn’t load the agents. The server answered ${t.status}.`);return await t.json()}})}function xs(s){const t=de();return le({mutationFn:async n=>{const l=await fetch(z(`/extensions/${s}/forward-agents`),{method:"PUT",headers:{"Content-Type":"application/json","X-Client-Id":me()},body:JSON.stringify({agentIds:n})});if(!l.ok){const i=await l.json().catch(()=>({}));throw new Error(i.message??i.error??"Couldn’t save the agents. Try again.")}return await l.json()},onSuccess:n=>{t.setQueryData(fe(s),n)}})}function gs({extensionId:s,name:t}){var c;const n=hs(s).data,{mutate:l}=xs(s),i=((c=re().data)==null?void 0:c.agents)??[],a=[...(n==null?void 0:n.agents)??[],...((n==null?void 0:n.missing)??[]).map(r=>({id:r,name:"An agent that is gone"}))],h=a.map(r=>r.id),u=r=>l(r,{onError:o=>S.error(o.message)});return e.jsxs("div",{className:"space-y-1.5 pt-1","data-testid":`forward-agents-${s}`,children:[e.jsx("p",{className:"text-sm",children:"Sends your comments to"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map(r=>e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(O,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:r.name}),e.jsx("button",{type:"button",onClick:()=>u(h.filter(o=>o!==r.id)),"aria-label":`Remove ${r.name}`,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]},r.id)),e.jsx(ps,{name:t,agents:i.filter(r=>!h.includes(r.id)).map(r=>({id:r.id,name:D(r)})),onAdd:r=>u([...h,r])})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:a.length===0?"None yet. It asks you the first time you send a comment.":"Your comments reach these agents as your own words."})]})}function ps({name:s,agents:t,onAdd:n}){const[l,i]=C.useState(!1);return e.jsxs(q,{open:l,onOpenChange:i,children:[e.jsx(H,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add an agent for ${s}`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(X,{align:"start",className:"w-64 p-0",children:e.jsxs(G,{children:[e.jsx(Y,{placeholder:"Find an agent"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),t.length>0&&e.jsx(A,{heading:"Agents",children:t.map(a=>e.jsxs(P,{value:`agent ${a.name} ${a.id}`,onSelect:()=>{n(a.id),i(!1)},children:[e.jsx(O,{className:"size-3.5"}),a.name]},a.id))})]})]})})]})}function fs({risk:s,id:t,name:n,onTurnOff:l,isToggling:i}){const a=Ce(),h=s.agentName??"an agent",u=a.isPending||i;return e.jsxs("div",{className:"text-status-warning-fg flex flex-wrap items-center gap-x-2 gap-y-1 text-sm","data-testid":`extension-step-up-risk-${t}`,children:[e.jsx("p",{children:s.reason==="agent-folder"?`${h} can edit this, so confirming is off.`:"Changed since you approved it, so confirming is off."}),s.reason==="agent-folder"?e.jsxs("button",{type:"button",onClick:()=>a.mutate({id:t,name:n}),disabled:u,className:"text-muted-foreground hover:text-foreground focus-ring min-h-11 rounded-sm text-left text-xs underline underline-offset-2 disabled:opacity-50 sm:min-h-0",children:["Move out of ",h,"’s folder"]}):e.jsx("button",{type:"button",onClick:l,disabled:u,className:"text-muted-foreground hover:text-foreground focus-ring min-h-11 rounded-sm text-left text-xs underline underline-offset-2 disabled:opacity-50 sm:min-h-0",children:"Turn off"})]})}const js=new Set(["disabled","discovered","incompatible","invalid"]),vs="/marketplace?view=installed";function Ns({extension:s,onToggle:t,isToggling:n,onSetRunApproval:l,isSettingApproval:i,onReload:a,isReloading:h,stepUpRisk:u}){var J,W;const{manifest:c,status:r,scope:o,error:v,serverError:p,origin:d,approvedToRun:f}=s,[j,y]=C.useState(!1),m=!js.has(r),x=r==="incompatible",w=r==="invalid",g=r==="compile_error"||r==="activate_error",k=!x&&!w,N=!(d==="core"&&c.canDisable===!1),R=s.hasServerEntry||s.hasDataProxy,b=ue(s),je=ke(s.id,he(b)),I=g?"Not working":x?"Incompatible":w?"Can’t load":null;return e.jsx(Ee,{"data-slot":"extension-card","data-testid":`extension-card-${s.id}`,"data-section":s.id,radius:"lg",gap:"none",className:F(g&&"border-amber-500/50",(x||w)&&"opacity-70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g&&e.jsx($e,{className:"text-status-warning-dot size-4 shrink-0","aria-hidden":"true"}),(x||w)&&!g&&e.jsx(Ae,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!g&&!x&&!w&&e.jsx(Pe,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:c.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",c.version]}),s.devLink&&e.jsx(Re,{})]}),s.devLink&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1","data-testid":`extension-dev-link-${s.id}`,children:[e.jsx(Te,{path:s.devLink.path,className:"min-w-0"}),e.jsx("button",{type:"button",onClick:()=>void De(vs),className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2",children:"Unlink or switch"})]}),c.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:c.description}),e.jsx(_e,{gifts:Oe(s),"data-testid":`extension-agent-gifts-${s.id}`}),m&&e.jsx(as,{extensionId:s.id}),((J=c.capabilities)==null?void 0:J.rooms)===!0&&e.jsx(ms,{extensionId:s.id,name:c.name}),((W=c.capabilities)==null?void 0:W.forward)===!0&&e.jsx(gs,{extensionId:s.id,name:c.name}),x&&c.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Needs DorkOS ",c.minHostVersion," or newer"]}),g&&v&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-status-warning-fg text-sm",children:[r==="compile_error"?"Couldn’t build: ":"Couldn’t start: ",v.message]}),v.details&&e.jsxs("button",{type:"button",onClick:()=>y(L=>!L),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":j,children:[e.jsx(ze,{className:F("size-3 transition-transform",j&&"rotate-180")}),j?"Hide details":"Show details"]}),j&&v.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:v.details})]}),p&&U(p.code)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1","data-testid":`extension-server-status-${s.id}`,children:[e.jsx("p",{className:"text-status-warning-fg text-sm",children:p.message||ts(p.code,c.name)}),e.jsx("button",{type:"button",onClick:a,disabled:h,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2 disabled:opacity-50",children:"Reload"})]}),s.restartingAt&&!p&&e.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:ns(c.name)}),p&&!U(p.code)&&e.jsxs("p",{className:"text-status-warning-fg text-sm",children:["Couldn’t rebuild its server part: ",p.message,". The last version still runs."]}),u&&e.jsx(fs,{risk:u,id:s.id,name:c.name,onTurnOff:()=>t(s.id,!1),isToggling:n}),d==="user"&&(f?e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs","data-testid":`extension-run-allowed-${s.id}`,children:[e.jsx(Ie,{className:"size-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{children:"You allowed this to run."}),s.originProblem==="changed"&&e.jsx("span",{children:"You approved its changed files. Any further change asks again."}),e.jsx("button",{type:"button",onClick:()=>l(s.id,!1),disabled:i,className:"hover:text-foreground underline underline-offset-2 disabled:opacity-50",children:"Stop it"}),e.jsx(ee,{permissions:b,className:"basis-full","data-testid":`extension-permissions-${s.id}`})]}):e.jsxs("div",{className:"space-y-2 rounded-lg border border-amber-500/40 bg-amber-500/5 p-3","data-testid":`extension-needs-approval-${s.id}`,children:[e.jsx("p",{className:"text-sm font-medium",children:"This extension is waiting for you"}),s.originProblem&&e.jsx("p",{className:"text-status-warning-fg text-sm","data-testid":`extension-origin-problem-${s.id}`,children:s.originProblem==="changed"?"Its files changed after install, so DorkOS can’t vouch for it. Look it over first.":s.originProblem==="dev-link"?"It runs from your folder, so DorkOS can’t vouch for its source.":"Its plugin links to files elsewhere, so DorkOS can’t vouch for its source."}),e.jsx(ee,{permissions:b,added:je,"data-testid":`extension-permissions-${s.id}`}),e.jsx("p",{className:"text-muted-foreground text-sm",children:Le(R,(b==null?void 0:b.runtime)==="subprocess")}),e.jsx("p",{className:"text-muted-foreground text-sm",children:Me}),e.jsx($,{size:"sm",onClick:()=>l(s.id,!0),disabled:i,"data-testid":`extension-approve-run-${s.id}`,children:"Turn it on"})]})),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(M,{variant:"outline",children:o}),I&&e.jsx(M,{variant:I==="Not working"?"destructive":"secondary","data-testid":`extension-health-${s.id}`,children:I}),c.author&&e.jsx("span",{children:c.author})]})]}),e.jsx("div",{className:"flex shrink-0 items-center pt-0.5",children:N?e.jsx(Fe,{checked:m,onCheckedChange:L=>t(s.id,L),disabled:!k||n,"aria-label":`${m?"Disable":"Enable"} ${c.name}`}):e.jsx(M,{variant:"secondary",title:"This extension is always on","data-testid":`extension-required-${s.id}`,children:"Required"})})]})})}function ae(s){const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function ys(){const{data:s=[]}=Ue(),{stop:t,pendingSource:n}=Be();return s.length===0?null:e.jsxs("section",{className:"space-y-3","data-testid":"trusted-sources-section",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Trusted sources"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Extensions from these sources turn on without asking."}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Stop trusting one, and extensions already on keep running."}),e.jsx(xe,{className:"text-muted-foreground text-sm",label:"If you stop trusting one",openLabel:"If you stop trusting one",children:e.jsx("p",{children:"Newer versions and new extensions from it wait for your yes."})})]}),e.jsx("ul",{className:"divide-y rounded-xl border",children:s.map(({source:l,trustedAt:i})=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-mono text-sm",children:l}),ae(i)&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Trusted ",ae(i)]})]}),e.jsx($,{type:"button",variant:"outline",size:"sm",disabled:n===l,onClick:()=>t(l),children:"Stop trusting"})]},l))})]})}function $s(){const{data:s=[],isLoading:t}=qe(),{data:n}=He(),{section:l}=Ke();Je(t?null:l);const i=Xe(),a=Ge(),h=Ye(),u=se(!0),c=se(!1),r=new Set([...i.variables?[i.variables]:[],...a.variables?[a.variables]:[]]),o=new Set([...u.isPending&&u.variables?[u.variables.id]:[],...c.isPending&&c.variables?[c.variables.id]:[]]);function v(m,x){const w=x?u:c,g=s.find(N=>N.id===m);if(!g)return;const k=x?he(ue(g)):void 0;w.mutate({id:m,version:g.manifest.version,plugin:g.sourcePlugin??null,...k?{permissions:k}:{},...x&&g.digest?{expectedDigest:g.digest}:{}},{onSuccess:N=>{x&&te.getState().forget(m);const R=N.extension.manifest.name,b=N.extension.isolation?"":" inside DorkOS";S.success(x?`${R} can now run${b}`:`${R} stopped running`)},onError:N=>{if(N instanceof Qe&&N.stale){k&&te.getState().remember(m,k),S.error(`${g.manifest.name} changed since you saw it. Check it again.`);return}S.error(x?"Couldn’t let it run.":"Couldn’t stop it running.",{description:N.message})}})}async function p(m,x){(x?i:a).mutate(m,{onError:g=>{S.error(x?"Couldn’t turn that on.":"Couldn’t turn that off.",{description:g.message})}})}function d(){h.mutate(void 0,{onSuccess:m=>{S.success(`Reloaded ${m.length} extension${m.length===1?"":"s"}`)},onError:m=>{S.error("Couldn’t reload your extensions.",{description:m.message})}})}if(t)return e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"});const f=s.filter(m=>m.origin==="core"),j=s.filter(m=>m.origin==="user"),y=m=>e.jsx(Ns,{extension:m,onToggle:p,isToggling:r.has(m.id),onSetRunApproval:v,isSettingApproval:o.has(m.id),onReload:d,isReloading:h.isPending,stepUpRisk:n==null?void 0:n.find(x=>x.id===m.id)},m.id);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-muted-foreground space-y-1 text-sm",children:[e.jsx("p",{children:"Extensions add new screens and tools to DorkOS."}),e.jsxs(xe,{children:[e.jsx("p",{children:"Core extensions come with DorkOS."}),e.jsxs("p",{children:["Installed ones live in"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:"~/.dork/extensions/"})," or your project’s"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:".dork/extensions/"}),"."]})]})]}),s.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"no-extensions",children:e.jsx("p",{children:"No extensions installed."})}):e.jsxs(e.Fragment,{children:[f.length>0&&e.jsxs("section",{className:"space-y-3","data-testid":"core-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Core extensions"}),e.jsx("div",{className:"space-y-3",children:f.map(y)})]}),e.jsxs("section",{className:"space-y-3","data-testid":"installed-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Installed extensions"}),j.length>0?e.jsx("div",{className:"space-y-3",children:j.map(y)}):e.jsxs("div",{className:"text-muted-foreground rounded-xl border border-dashed p-4 text-sm","data-testid":"no-installed-extensions",children:["No extensions installed yet. Browse"," ",e.jsx("span",{className:"text-foreground font-medium",children:"Marketplace"})," to add some."]})]})]}),e.jsx(ys,{}),e.jsx("div",{className:"flex justify-end",children:e.jsxs($,{variant:"outline",size:"sm",onClick:d,disabled:h.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(Ve,{className:F("mr-2 size-4",h.isPending&&"animate-spin")}),"Reload extensions"]})})]})}export{Rs as ExtensionEventBridge,Ts as ExtensionLoader,Ds as ExtensionProvider,$s as ExtensionsSettingsTab,Ls as ForwardConsentHost,_s as createExtensionAPI,Os as createExtensionEventBridge,zs as useExtensions};
1
+ import{hv as ve,j as e,hw as Ne,hx as ye,hy as T,eH as we,eI as Z,c$ as re,cv as ie,r as S,am as _,gI as E,H as D,aW as I,X as B,hz as be,hA as Ce,gn as H,go as q,B as $,f as K,gp as Y,a6 as oe,a7 as de,a8 as le,hB as O,hC as ce,dR as C,hD as me,hE as Se,hF as ue,hG as ke,hH as xe,fY as Ee,a4 as $e,be as Ae,gd as Pe,hI as Re,g7 as Te,g8 as _e,hJ as De,hK as Ie,U as Oe,G as F,eN as ze,hL as ee,hM as Le,hN as Me,a2 as M,a3 as Fe,hO as Ue,hP as Be,hQ as He,hR as qe,hS as Ke,hT as Ye,hU as Xe,hV as Ge,hW as se,ff as Ve,hX as Qe,hY as te}from"./index-BR1m9FON.js";import{hZ as Rs,h_ as Ts,h$ as _s,i0 as Ds,i1 as Is,gb as Os}from"./index-BR1m9FON.js";import{u as Je}from"./use-deep-link-scroll-r2nKjzA-.js";import{M as he}from"./more-details-DV7LmY0E.js";import{u as We,a as Ze}from"./ForwardConsentHost-DSR1pEEK.js";import{F as Ls}from"./ForwardConsentHost-DSR1pEEK.js";import{C as X,a as G,b as V,c as Q,d as A,e as P}from"./command-CaUEAy3b.js";import{F as ge}from"./file-text-Cycq_S0e.js";const es=["server_crashed","server_out_of_memory","server_unresponsive","isolation_unavailable","server_start_failed","server_start_timeout"],ss={server_crashed:s=>`${s} stopped unexpectedly 3 times. Reload it to try again.`,server_out_of_memory:s=>`${s} ran out of memory and stopped. Reload it to try again.`,server_unresponsive:s=>`${s} stopped responding, so DorkOS stopped it.`,isolation_unavailable:s=>`${s} can’t run with its limits on this computer.`,server_start_failed:s=>`${s} couldn’t start. Reload it to try again.`,server_start_timeout:s=>`${s} took too long to start. Reload it to try again.`};function U(s){return es.includes(s)}function ts(s,t){return U(s)?ss[s](t):null}function ns(s){return`Restarting ${s}…`}function as({extensionId:s}){const t=ve("right-panel").filter(n=>n.extensionId===s);return t.length===0?null:e.jsx("div",{className:"space-y-3 pt-1","data-testid":`panel-tab-placement-${s}`,children:t.map(n=>e.jsx(is,{tab:n,labelled:t.length>1},n.id))})}function rs(){var n;const s=(n=re().data)==null?void 0:n.agents,t=ie().data;return S.useMemo(()=>{const l=new Map((s??[]).map(a=>[a.id,_(a)])),i=new Map((t??[]).map(a=>[a.id,E(a)]));return{agents:s??[],rooms:t??[],agentNames:l,roomNames:i}},[s,t])}function is({tab:s,labelled:t}){const n=Ne(We(),s.id),{setPlacement:l}=Ze(),i=rs(),a=ye(n,s.declaredPlacement),x=a.show.pages.includes(T),u=d=>l(s.id,{show:d.show,hide:d.hide}),c=d=>d.kind==="agents"?i.agentNames.get(d.id)??"An agent that is gone":d.kind==="rooms"?i.roomNames.get(d.id)??"A channel that is gone":be(d.id),r=(d,f)=>["agents","rooms","pages"].flatMap(j=>d[j].filter(y=>f||y!==T).map(y=>({kind:j,id:y}))),o=(d,f)=>({...d,[f.kind]:d[f.kind].filter(j=>j!==f.id)}),v=r(a.show,!1),p=r(a.hide,!0);return e.jsxs("div",{className:"space-y-2","data-testid":`panel-tab-placement-${s.id}`,children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm",children:t?`${s.title} tab shows`:"Panel tab shows"}),e.jsxs(we,{value:x?"everywhere":"only",onValueChange:d=>u({hide:a.hide,show:d==="everywhere"?{...a.show,pages:[T]}:{...a.show,pages:a.show.pages.filter(f=>f!==T)}}),"aria-label":`Where the ${s.title} tab shows`,children:[e.jsx(Z,{value:"everywhere",children:"Everywhere"}),e.jsx(Z,{value:"only",children:"Only in…"})]}),n&&e.jsx("button",{type:"button",onClick:()=>l(s.id,null),className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2",children:s.declaredPlacement?"Use its default":"Reset"})]}),!x&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[v.map(d=>e.jsx(ne,{place:d,name:c(d),removeLabel:`Remove ${c(d)}`,onRemove:()=>u({...a,show:o(a.show,d)})},`${d.kind}:${d.id}`)),e.jsx(ds,{tabTitle:s.title,names:i,taken:a.show,onAdd:d=>u({show:{...a.show,[d.kind]:[...a.show[d.kind],d.id]},hide:o(a.hide,d)})}),v.length===0&&e.jsx("span",{className:"text-muted-foreground text-xs",children:"Shows nowhere yet. Add a place."})]}),p.length>0&&e.jsxs("div",{role:"group","aria-labelledby":`${s.id}-hidden-in`,className:"flex flex-wrap items-center gap-1.5",children:[e.jsx("span",{id:`${s.id}-hidden-in`,className:"text-muted-foreground text-xs",children:"Hidden in"}),p.map(d=>e.jsx(ne,{place:d,name:c(d),removeLabel:`Show in ${c(d)} again`,onRemove:()=>u({...a,hide:o(a.hide,d)})},`${d.kind}:${d.id}`))]})]})}const os={agents:I,rooms:D,pages:ge};function ne({place:s,name:t,removeLabel:n,onRemove:l}){const i=os[s.kind];return e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(i,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:t}),e.jsx("button",{type:"button",onClick:l,"aria-label":n,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]})}function ds({tabTitle:s,names:t,taken:n,onAdd:l}){const[i,a]=S.useState(!1),x=o=>{l(o),a(!1)},u=Ce.filter(o=>!n.pages.includes(o.key)),c=t.agents.filter(o=>!n.agents.includes(o.id)),r=t.rooms.filter(o=>!n.rooms.includes(o.id));return e.jsxs(H,{open:i,onOpenChange:a,children:[e.jsx(q,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add a place for the ${s} tab`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(Y,{align:"start",className:"w-64 p-0",children:e.jsxs(X,{children:[e.jsx(G,{placeholder:"Find an agent, channel or page"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),c.length>0&&e.jsx(A,{heading:"Agents",children:c.map(o=>e.jsxs(P,{value:`agent ${_(o)} ${o.id}`,onSelect:()=>x({kind:"agents",id:o.id}),children:[e.jsx(I,{className:"size-3.5"}),_(o)]},o.id))}),r.length>0&&e.jsx(A,{heading:"Channels and DMs",children:r.map(o=>e.jsxs(P,{value:`room ${E(o)} ${o.id}`,onSelect:()=>x({kind:"rooms",id:o.id}),children:[e.jsx(D,{className:"size-3.5"}),E(o)]},o.id))}),u.length>0&&e.jsx(A,{heading:"Pages",children:u.map(o=>e.jsxs(P,{value:`page ${o.label}`,onSelect:()=>x({kind:"pages",id:o.key}),children:[e.jsx(ge,{className:"size-3.5"}),o.label]},o.key))})]})]})})]})}const pe=s=>[...ce.detail(s),"room-access"];function ls(s){return oe({queryKey:pe(s),queryFn:async()=>{const t=await fetch(O(`/extensions/${s}/room-access`));if(!t.ok)throw new Error(`Couldn’t load the rooms. The server answered ${t.status}.`);return(await t.json()).roomIds}})}function cs(s){const t=de();return le({mutationFn:async n=>{const l=await fetch(O(`/extensions/${s}/room-access`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({roomIds:n})});if(!l.ok){const i=await l.json().catch(()=>({}));throw new Error(i.message??i.error??"Couldn’t save the rooms. Try again.")}return(await l.json()).roomIds},onSuccess:n=>{t.setQueryData(pe(s),n)}})}function ms({extensionId:s,name:t}){const n=ls(s).data??[],{mutate:l}=cs(s),i=ie().data,a=S.useMemo(()=>(i??[]).filter(r=>!r.bridge),[i]),x=S.useMemo(()=>new Map((i??[]).map(r=>[r.id,E(r)])),[i]),u=r=>l(r,{onError:o=>C.error(o.message)}),c=r=>x.get(r)??"A room that is gone";return e.jsxs("div",{className:"space-y-1.5 pt-1","data-testid":`room-access-${s}`,children:[e.jsx("p",{className:"text-sm",children:"Rooms it can use"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[n.map(r=>e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(D,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:c(r)}),e.jsx("button",{type:"button",onClick:()=>u(n.filter(o=>o!==r)),"aria-label":`Remove ${c(r)}`,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]},r)),e.jsx(us,{name:t,rooms:a.filter(r=>!n.includes(r.id)),onAdd:r=>u([...n,r])})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:n.length===0?"None yet. It can’t read or reply anywhere.":"It reads and replies as you, only here."})]})}function us({name:s,rooms:t,onAdd:n}){const[l,i]=S.useState(!1);return e.jsxs(H,{open:l,onOpenChange:i,children:[e.jsx(q,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add a room for ${s}`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(Y,{align:"start",className:"w-64 p-0",children:e.jsxs(X,{children:[e.jsx(G,{placeholder:"Find a channel or DM"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),t.length>0&&e.jsx(A,{heading:"Channels and DMs",children:t.map(a=>e.jsxs(P,{value:`room ${E(a)} ${a.id}`,onSelect:()=>{n(a.id),i(!1)},children:[e.jsx(D,{className:"size-3.5"}),E(a)]},a.id))})]})]})})]})}const fe=s=>[...ce.detail(s),"forward-agents"];function xs(s){return oe({queryKey:fe(s),queryFn:async()=>{const t=await fetch(O(`/extensions/${s}/forward-agents`),{headers:{"X-Client-Id":me()}});if(!t.ok)throw new Error(`Couldn’t load the agents. The server answered ${t.status}.`);return await t.json()}})}function hs(s){const t=de();return le({mutationFn:async n=>{const l=await fetch(O(`/extensions/${s}/forward-agents`),{method:"PUT",headers:{"Content-Type":"application/json","X-Client-Id":me()},body:JSON.stringify({agentIds:n})});if(!l.ok){const i=await l.json().catch(()=>({}));throw new Error(i.message??i.error??"Couldn’t save the agents. Try again.")}return await l.json()},onSuccess:n=>{t.setQueryData(fe(s),n)}})}function gs({extensionId:s,name:t}){var c;const n=xs(s).data,{mutate:l}=hs(s),i=((c=re().data)==null?void 0:c.agents)??[],a=[...(n==null?void 0:n.agents)??[],...((n==null?void 0:n.missing)??[]).map(r=>({id:r,name:"An agent that is gone"}))],x=a.map(r=>r.id),u=r=>l(r,{onError:o=>C.error(o.message)});return e.jsxs("div",{className:"space-y-1.5 pt-1","data-testid":`forward-agents-${s}`,children:[e.jsx("p",{className:"text-sm",children:"Sends your comments to"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.map(r=>e.jsxs("span",{className:"bg-muted inline-flex h-6 items-center gap-1 rounded-md pr-0.5 pl-1.5 text-xs",children:[e.jsx(I,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:r.name}),e.jsx("button",{type:"button",onClick:()=>u(x.filter(o=>o!==r.id)),"aria-label":`Remove ${r.name}`,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(B,{className:"size-3"})})]},r.id)),e.jsx(ps,{name:t,agents:i.filter(r=>!x.includes(r.id)).map(r=>({id:r.id,name:_(r)})),onAdd:r=>u([...x,r])})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:a.length===0?"None yet. It asks you the first time you send a comment.":"Your comments reach these agents as your own words."})]})}function ps({name:s,agents:t,onAdd:n}){const[l,i]=S.useState(!1);return e.jsxs(H,{open:l,onOpenChange:i,children:[e.jsx(q,{asChild:!0,children:e.jsxs($,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add an agent for ${s}`,children:[e.jsx(K,{className:"size-3"}),"Add"]})}),e.jsx(Y,{align:"start",className:"w-64 p-0",children:e.jsxs(X,{children:[e.jsx(G,{placeholder:"Find an agent"}),e.jsxs(V,{className:"max-h-64",children:[e.jsx(Q,{children:"Nothing matches."}),t.length>0&&e.jsx(A,{heading:"Agents",children:t.map(a=>e.jsxs(P,{value:`agent ${a.name} ${a.id}`,onSelect:()=>{n(a.id),i(!1)},children:[e.jsx(I,{className:"size-3.5"}),a.name]},a.id))})]})]})})]})}function fs({risk:s,id:t,name:n,onTurnOff:l,isToggling:i}){const a=Se(),x=s.agentName??"an agent",u=a.isPending||i;return e.jsxs("div",{className:"text-status-warning-fg flex flex-wrap items-center gap-x-2 gap-y-1 text-sm","data-testid":`extension-step-up-risk-${t}`,children:[e.jsx("p",{children:s.reason==="agent-folder"?`${x} can edit this, so confirming is off.`:"Changed since you approved it, so confirming is off."}),s.reason==="agent-folder"?e.jsxs("button",{type:"button",onClick:()=>a.mutate({id:t,name:n}),disabled:u,className:"text-muted-foreground hover:text-foreground focus-ring min-h-11 rounded-sm text-left text-xs underline underline-offset-2 disabled:opacity-50 sm:min-h-0",children:["Move out of ",x,"’s folder"]}):e.jsx("button",{type:"button",onClick:l,disabled:u,className:"text-muted-foreground hover:text-foreground focus-ring min-h-11 rounded-sm text-left text-xs underline underline-offset-2 disabled:opacity-50 sm:min-h-0",children:"Turn off"})]})}const js=new Set(["disabled","discovered","incompatible","invalid"]),vs="/marketplace?view=installed";function Ns({extension:s,onToggle:t,isToggling:n,onSetRunApproval:l,isSettingApproval:i,onReload:a,isReloading:x,stepUpRisk:u}){var J,W;const{manifest:c,status:r,scope:o,error:v,serverError:p,origin:d,approvedToRun:f}=s,[j,y]=S.useState(!1),m=!js.has(r),h=r==="incompatible",w=r==="invalid",g=r==="compile_error"||r==="activate_error",k=!h&&!w,N=!(d==="core"&&c.canDisable===!1),R=s.hasServerEntry||s.hasDataProxy,b=ue(s),je=ke(s.id,xe(b)),z=g?"Not working":h?"Incompatible":w?"Can’t load":null;return e.jsx(Ee,{"data-slot":"extension-card","data-testid":`extension-card-${s.id}`,"data-section":s.id,radius:"lg",gap:"none",className:F(g&&"border-amber-500/50",(h||w)&&"opacity-70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0 flex-1 space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[g&&e.jsx($e,{className:"text-status-warning-dot size-4 shrink-0","aria-hidden":"true"}),(h||w)&&!g&&e.jsx(Ae,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!g&&!h&&!w&&e.jsx(Pe,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:c.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",c.version]}),s.devLink&&e.jsx(Re,{})]}),s.devLink&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1","data-testid":`extension-dev-link-${s.id}`,children:[e.jsx(Te,{path:s.devLink.path,className:"min-w-0"}),e.jsx("button",{type:"button",onClick:()=>void _e(vs),className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2",children:"Unlink or switch"})]}),c.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:c.description}),e.jsx(De,{gifts:Ie(s),"data-testid":`extension-agent-gifts-${s.id}`}),m&&e.jsx(as,{extensionId:s.id}),((J=c.capabilities)==null?void 0:J.rooms)===!0&&e.jsx(ms,{extensionId:s.id,name:c.name}),((W=c.capabilities)==null?void 0:W.forward)===!0&&e.jsx(gs,{extensionId:s.id,name:c.name}),h&&c.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Needs DorkOS ",c.minHostVersion," or newer"]}),g&&v&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-status-warning-fg text-sm",children:[r==="compile_error"?"Couldn’t build: ":"Couldn’t start: ",v.message]}),v.details&&e.jsxs("button",{type:"button",onClick:()=>y(L=>!L),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":j,children:[e.jsx(Oe,{className:F("size-3 transition-transform",j&&"rotate-180")}),j?"Hide details":"Show details"]}),j&&v.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:v.details})]}),p&&U(p.code)&&e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1","data-testid":`extension-server-status-${s.id}`,children:[e.jsx("p",{className:"text-status-warning-fg text-sm",children:p.message||ts(p.code,c.name)}),e.jsx("button",{type:"button",onClick:a,disabled:x,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2 disabled:opacity-50",children:"Reload"})]}),s.restartingAt&&!p&&e.jsx("p",{className:"text-muted-foreground text-sm",role:"status",children:ns(c.name)}),p&&!U(p.code)&&e.jsxs("p",{className:"text-status-warning-fg text-sm",children:["Couldn’t rebuild its server part: ",p.message,". The last version still runs."]}),u&&e.jsx(fs,{risk:u,id:s.id,name:c.name,onTurnOff:()=>t(s.id,!1),isToggling:n}),d==="user"&&(f?e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs","data-testid":`extension-run-allowed-${s.id}`,children:[e.jsx(ze,{className:"size-3.5 shrink-0","aria-hidden":"true"}),e.jsx("span",{children:"You allowed this to run."}),s.originProblem==="changed"&&e.jsx("span",{children:"You approved its changed files. Any further change asks again."}),e.jsx("button",{type:"button",onClick:()=>l(s.id,!1),disabled:i,className:"hover:text-foreground underline underline-offset-2 disabled:opacity-50",children:"Stop it"}),e.jsx(ee,{permissions:b,className:"basis-full","data-testid":`extension-permissions-${s.id}`})]}):e.jsxs("div",{className:"space-y-2 rounded-lg border border-amber-500/40 bg-amber-500/5 p-3","data-testid":`extension-needs-approval-${s.id}`,children:[e.jsx("p",{className:"text-sm font-medium",children:"This extension is waiting for you"}),s.originProblem&&e.jsx("p",{className:"text-status-warning-fg text-sm","data-testid":`extension-origin-problem-${s.id}`,children:s.originProblem==="changed"?"Its files changed after install, so DorkOS can’t vouch for it. Look it over first.":s.originProblem==="dev-link"?"It runs from your folder, so DorkOS can’t vouch for its source.":"Its plugin links to files elsewhere, so DorkOS can’t vouch for its source."}),e.jsx(ee,{permissions:b,added:je,"data-testid":`extension-permissions-${s.id}`}),e.jsx("p",{className:"text-muted-foreground text-sm",children:Le(R,(b==null?void 0:b.runtime)==="subprocess")}),e.jsx("p",{className:"text-muted-foreground text-sm",children:Me}),e.jsx($,{size:"sm",onClick:()=>l(s.id,!0),disabled:i,"data-testid":`extension-approve-run-${s.id}`,children:"Turn it on"})]})),e.jsxs("div",{className:"text-muted-foreground flex flex-wrap items-center gap-2 text-xs",children:[e.jsx(M,{variant:"outline",children:o}),z&&e.jsx(M,{variant:z==="Not working"?"destructive":"secondary","data-testid":`extension-health-${s.id}`,children:z}),c.author&&e.jsx("span",{children:c.author})]})]}),e.jsx("div",{className:"flex shrink-0 items-center pt-0.5",children:N?e.jsx(Fe,{checked:m,onCheckedChange:L=>t(s.id,L),disabled:!k||n,"aria-label":`${m?"Disable":"Enable"} ${c.name}`}):e.jsx(M,{variant:"secondary",title:"This extension is always on","data-testid":`extension-required-${s.id}`,children:"Required"})})]})})}function ae(s){const t=new Date(s);return Number.isNaN(t.getTime())?"":t.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function ys(){const{data:s=[]}=Ue(),{stop:t,pendingSource:n}=Be();return s.length===0?null:e.jsxs("section",{className:"space-y-3","data-testid":"trusted-sources-section",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Trusted sources"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Extensions from these sources turn on without asking."}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Stop trusting one, and extensions already on keep running."}),e.jsx(he,{className:"text-muted-foreground text-sm",label:"If you stop trusting one",openLabel:"If you stop trusting one",children:e.jsx("p",{children:"Newer versions and new extensions from it wait for your yes."})})]}),e.jsx("ul",{className:"divide-y rounded-xl border",children:s.map(({source:l,trustedAt:i})=>e.jsxs("li",{className:"flex flex-wrap items-center justify-between gap-x-3 gap-y-1.5 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate font-mono text-sm",children:l}),ae(i)&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Trusted ",ae(i)]})]}),e.jsx($,{type:"button",variant:"outline",size:"sm",disabled:n===l,onClick:()=>t(l),children:"Stop trusting"})]},l))})]})}function $s(){const{data:s=[],isLoading:t}=He(),{data:n}=qe(),{section:l}=Ke();Je(t?null:l);const i=Ye(),a=Xe(),x=Ge(),u=se(!0),c=se(!1),r=new Set([...i.variables?[i.variables]:[],...a.variables?[a.variables]:[]]),o=new Set([...u.isPending&&u.variables?[u.variables.id]:[],...c.isPending&&c.variables?[c.variables.id]:[]]);function v(m,h){const w=h?u:c,g=s.find(N=>N.id===m);if(!g)return;const k=h?xe(ue(g)):void 0;w.mutate({id:m,version:g.manifest.version,plugin:g.sourcePlugin??null,...k?{permissions:k}:{},...h&&g.digest?{expectedDigest:g.digest}:{}},{onSuccess:N=>{h&&te.getState().forget(m);const R=N.extension.manifest.name,b=N.extension.isolation?"":" inside DorkOS";C.success(h?`${R} can now run${b}`:`${R} stopped running`)},onError:N=>{if(N instanceof Qe&&N.stale){k&&te.getState().remember(m,k),C.error(`${g.manifest.name} changed since you saw it. Check it again.`);return}C.error(h?"Couldn’t let it run.":"Couldn’t stop it running.",{description:N.message})}})}async function p(m,h){(h?i:a).mutate(m,{onError:g=>{C.error(h?"Couldn’t turn that on.":"Couldn’t turn that off.",{description:g.message})}})}function d(){x.mutate(void 0,{onSuccess:m=>{C.success(`Reloaded ${m.length} extension${m.length===1?"":"s"}`)},onError:m=>{C.error("Couldn’t reload your extensions.",{description:m.message})}})}if(t)return e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"});const f=s.filter(m=>m.origin==="core"),j=s.filter(m=>m.origin==="user"),y=m=>e.jsx(Ns,{extension:m,onToggle:p,isToggling:r.has(m.id),onSetRunApproval:v,isSettingApproval:o.has(m.id),onReload:d,isReloading:x.isPending,stepUpRisk:n==null?void 0:n.find(h=>h.id===m.id)},m.id);return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-muted-foreground space-y-1 text-sm",children:[e.jsx("p",{children:"Extensions add new screens and tools to DorkOS."}),e.jsxs(he,{children:[e.jsx("p",{children:"Core extensions come with DorkOS."}),e.jsxs("p",{children:["Installed ones live in"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:"~/.dork/extensions/"})," or your project’s"," ",e.jsx("code",{className:"bg-muted rounded px-1",children:".dork/extensions/"}),"."]})]})]}),s.length===0?e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm","data-testid":"no-extensions",children:e.jsx("p",{children:"No extensions installed."})}):e.jsxs(e.Fragment,{children:[f.length>0&&e.jsxs("section",{className:"space-y-3","data-testid":"core-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Core extensions"}),e.jsx("div",{className:"space-y-3",children:f.map(y)})]}),e.jsxs("section",{className:"space-y-3","data-testid":"installed-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Installed extensions"}),j.length>0?e.jsx("div",{className:"space-y-3",children:j.map(y)}):e.jsxs("div",{className:"text-muted-foreground rounded-xl border border-dashed p-4 text-sm","data-testid":"no-installed-extensions",children:["No extensions installed yet. Browse"," ",e.jsx("span",{className:"text-foreground font-medium",children:"Marketplace"})," to add some."]})]})]}),e.jsx(ys,{}),e.jsx("div",{className:"flex justify-end",children:e.jsxs($,{variant:"outline",size:"sm",onClick:d,disabled:x.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(Ve,{className:F("mr-2 size-4",x.isPending&&"animate-spin")}),"Reload extensions"]})})]})}export{Rs as ExtensionEventBridge,Ts as ExtensionLoader,_s as ExtensionProvider,$s as ExtensionsSettingsTab,Ls as ForwardConsentHost,Ds as createExtensionAPI,Is as createExtensionEventBridge,Os as useExtensions};
@@ -1 +1 @@
1
- import{L as g,a as P,p as l,s as q,t as r}from"./index-Di-MIFQG.js";import{html as c}from"./index-DYVNSRDk.js";import{javascriptLanguage as i}from"./index-Bd0PAkxf.js";import{L as R,E as p}from"./index-BLUUshO9.js";import"./index-BwTGkJbK.js";import"./index-CTgUh4p3.js";const b=1,m=33,$=34,v=35,x=36,W=new p(O=>{let t=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>t&&O.acceptToken(b)});function n(O,t,a){return new p(e=>{let u=e.pos;for(;e.next!=O&&e.next>=0&&(a||e.next!=38&&(e.next!=123||e.peek(1)!=123));)e.advance();e.pos>u&&e.acceptToken(t)})}const d=n(39,m,!1),f=n(34,$,!1),C=n(39,v,!0),T=n(34,x,!0),A=R.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<<GrOOQO<<Gr<<GrOOQO1G/[1G/[OOOS-E6x-E6xOOQO1G.}1G.}OOOQ-E6y-E6yOOQOAN=^AN=^",stateData:"&d~OvOS~OPROSQOVROWRO~OZTO[XO^VOaUOhWO~OR]OU^O~O[`O^aO~O[bO~O[cO~O[dO~ObeO~ObfO~ObgO~ORhO~O]kOwiO~O[lO~O_mO~OynOzoO~OysOztO~O[uO~O]wOwiO~O_yOwiO~OtzO~Os|O~OSQOV!OOW!OOr!OOy!QO~OSQOV!ROW!ROq!ROz!QO~O_!TOwiO~O]!UO~Oy!VO~Oz!VO~OSQOV!OOW!OOr!OOy!XO~OSQOV!ROW!ROq!ROz!XO~O]!ZO~O",goto:"#dyPPPPPzPPPP!WPPPPP!WPP!Z!^!a!d!dP!g!j!m!p!v#Q#WPPPPPPPP#^SROSS!Os!PT!Rt!SRYPRqeR{nR}oRZPRqfR[PRqgQSOR_SQj`SvjxRxlQ!PsR!W!PQ!StR!Y!SQpeRrf",nodeNames:"⚠ Text Content }} {{ Interpolation InterpolationContent Entity InvalidEntity Attribute BoundAttributeName [ Identifier ] ( ) ReferenceName # Is ExpressionAttributeValue AttributeInterpolation AttributeInterpolation EventName DirectiveName * StatementAttributeValue AttributeName AttributeValue",maxTerm:42,nodeProps:[["openedBy",3,"{{",15,"("],["closedBy",4,"}}",14,")"],["isolate",-4,5,19,25,27,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"0r~RyOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mqr#rrs%jst&Qtv#rvw&hwx)zxy*byz*xz{+`{}#r}!O+v!O!P-]!P!Q#r!Q![+v![!]+v!]!_#r!_!`-s!`!c#r!c!}+v!}#O.Z#O#P#r#P#Q.q#Q#R#r#R#S+v#S#T#r#T#o+v#o#p/X#p#q#r#q#r0Z#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vQ#wTUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rQ$ZSO#q#r#r;'S#r;'S;=`$g<%lO#rQ$jP;=`<%l#rR$t[UQvPOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mq#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR%qTyPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&XTaPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&oXUQWPOp'[pq#rq!]'[!]!^#r!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R'aXUQOp'[pq#rq!]'[!]!^'|!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R(TTVPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR(gXOp'[pq#rq!]'[!]!^'|!^#q'[#q#r)S#r;'S'[;'S;=`)t<%lO'[P)VUOp)Sq!])S!]!^)i!^;'S)S;'S;=`)n<%lO)SP)nOVPP)qP;=`<%l)SR)wP;=`<%l'[R*RTzPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR*iT^PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+PT_PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+gThPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+}b[PUQO}#r}!O+v!O!Q#r!Q![+v![!]+v!]!c#r!c!}+v!}#R#r#R#S+v#S#T#r#T#o+v#o#q#r#q#r$W#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vR-YP;=`<%l+vR-dTwPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR-zTUQbPO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.bTZPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.xT]PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/^VUQO#o#r#o#p/s#p#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/zTSPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#r~0^TO#q#r#q#r0m#r;'S#r;'S;=`$g<%lO#r~0rOR~",tokenizers:[W,d,f,C,T,0,1],topRules:{Content:[0,2],Attribute:[1,9]},tokenPrec:0}),V=i.parser.configure({top:"SingleExpression"}),Q=A.configure({props:[q({Text:r.content,Is:r.definitionOperator,AttributeName:r.attributeName,"AttributeValue ExpressionAttributeValue StatementAttributeValue":r.attributeValue,Entity:r.character,InvalidEntity:r.invalid,"BoundAttributeName/Identifier":r.attributeName,"EventName/Identifier":r.special(r.attributeName),"ReferenceName/Identifier":r.variableName,"DirectiveName/Identifier":r.keyword,"{{ }}":r.brace,"( )":r.paren,"[ ]":r.bracket,"# '*'":r.punctuation})]}),o={parser:V},w={parser:i.parser},U=Q.configure({wrap:l((O,t)=>O.name=="InterpolationContent"?o:null)}),y=Q.configure({wrap:l((O,t)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?w:o}),top:"Attribute"}),E={parser:U},N={parser:y},s=c({selfClosingTags:!0});function S(O){return O.configure({wrap:l(z)},"angular")}const k=S(s.language);function z(O,t){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(t.read(O.from,O.to))?N:null;case"Text":return E}return null}function j(O={}){let t=s;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof g))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new P(t.language==s.language?k:S(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/})])}export{j as angular,k as angularLanguage};
1
+ import{L as g,a as P,p as l,s as q,t as r}from"./index-D5Qmx1JR.js";import{html as c}from"./index-faSyUc2q.js";import{javascriptLanguage as i}from"./index-BsZkXHsH.js";import{L as R,E as p}from"./index-DqZmnJED.js";import"./index-BR1m9FON.js";import"./index-4rSR8lau.js";const b=1,m=33,$=34,v=35,x=36,W=new p(O=>{let t=O.pos;for(;;){if(O.next==10){O.advance();break}else if(O.next==123&&O.peek(1)==123||O.next<0)break;O.advance()}O.pos>t&&O.acceptToken(b)});function n(O,t,a){return new p(e=>{let u=e.pos;for(;e.next!=O&&e.next>=0&&(a||e.next!=38&&(e.next!=123||e.peek(1)!=123));)e.advance();e.pos>u&&e.acceptToken(t)})}const d=n(39,m,!1),f=n(34,$,!1),C=n(39,v,!0),T=n(34,x,!0),A=R.deserialize({version:14,states:"(jOVOqOOOeQpOOOvO!bO'#CaOOOP'#Cx'#CxQVOqOOO!OQpO'#CfO!WQpO'#ClO!]QpO'#CrO!bQpO'#CsOOQO'#Cv'#CvQ!gQpOOQ!lQpOOQ!qQpOOOOOV,58{,58{O!vOpO,58{OOOP-E6v-E6vO!{QpO,59QO#TQpO,59QOOQO,59W,59WO#YQpO,59^OOQO,59_,59_O#_QpOOO#_QpOOO#gQpOOOOOV1G.g1G.gO#oQpO'#CyO#tQpO1G.lOOQO1G.l1G.lO#|QpO1G.lOOQO1G.x1G.xO$UO`O'#DUO$ZOWO'#DUOOQO'#Co'#CoQOQpOOOOQO'#Cu'#CuO$`OtO'#CwO$qOrO'#CwOOQO,59e,59eOOQO-E6w-E6wOOQO7+$W7+$WO%SQpO7+$WO%[QpO7+$WOOOO'#Cp'#CpO%aOpO,59pOOOO'#Cq'#CqO%fOpO,59pOOOS'#Cz'#CzO%kOtO,59cOOQO,59c,59cOOOQ'#C{'#C{O%|OrO,59cO&_QpO<<GrOOQO<<Gr<<GrOOQO1G/[1G/[OOOS-E6x-E6xOOQO1G.}1G.}OOOQ-E6y-E6yOOQOAN=^AN=^",stateData:"&d~OvOS~OPROSQOVROWRO~OZTO[XO^VOaUOhWO~OR]OU^O~O[`O^aO~O[bO~O[cO~O[dO~ObeO~ObfO~ObgO~ORhO~O]kOwiO~O[lO~O_mO~OynOzoO~OysOztO~O[uO~O]wOwiO~O_yOwiO~OtzO~Os|O~OSQOV!OOW!OOr!OOy!QO~OSQOV!ROW!ROq!ROz!QO~O_!TOwiO~O]!UO~Oy!VO~Oz!VO~OSQOV!OOW!OOr!OOy!XO~OSQOV!ROW!ROq!ROz!XO~O]!ZO~O",goto:"#dyPPPPPzPPPP!WPPPPP!WPP!Z!^!a!d!dP!g!j!m!p!v#Q#WPPPPPPPP#^SROSS!Os!PT!Rt!SRYPRqeR{nR}oRZPRqfR[PRqgQSOR_SQj`SvjxRxlQ!PsR!W!PQ!StR!Y!SQpeRrf",nodeNames:"⚠ Text Content }} {{ Interpolation InterpolationContent Entity InvalidEntity Attribute BoundAttributeName [ Identifier ] ( ) ReferenceName # Is ExpressionAttributeValue AttributeInterpolation AttributeInterpolation EventName DirectiveName * StatementAttributeValue AttributeName AttributeValue",maxTerm:42,nodeProps:[["openedBy",3,"{{",15,"("],["closedBy",4,"}}",14,")"],["isolate",-4,5,19,25,27,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"0r~RyOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mqr#rrs%jst&Qtv#rvw&hwx)zxy*byz*xz{+`{}#r}!O+v!O!P-]!P!Q#r!Q![+v![!]+v!]!_#r!_!`-s!`!c#r!c!}+v!}#O.Z#O#P#r#P#Q.q#Q#R#r#R#S+v#S#T#r#T#o+v#o#p/X#p#q#r#q#r0Z#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vQ#wTUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rQ$ZSO#q#r#r;'S#r;'S;=`$g<%lO#rQ$jP;=`<%l#rR$t[UQvPOX#rXY$mYZ$mZ]#r]^$m^p#rpq$mq#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR%qTyPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&XTaPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR&oXUQWPOp'[pq#rq!]'[!]!^#r!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R'aXUQOp'[pq#rq!]'[!]!^'|!^#q'[#q#r(d#r;'S'[;'S;=`)t<%lO'[R(TTVPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR(gXOp'[pq#rq!]'[!]!^'|!^#q'[#q#r)S#r;'S'[;'S;=`)t<%lO'[P)VUOp)Sq!])S!]!^)i!^;'S)S;'S;=`)n<%lO)SP)nOVPP)qP;=`<%l)SR)wP;=`<%l'[R*RTzPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR*iT^PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+PT_PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+gThPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR+}b[PUQO}#r}!O+v!O!Q#r!Q![+v![!]+v!]!c#r!c!}+v!}#R#r#R#S+v#S#T#r#T#o+v#o#q#r#q#r$W#r%W#r%W;'S+v;'S;:j-V;:j;=`$g<%lO+vR-YP;=`<%l+vR-dTwPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR-zTUQbPO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.bTZPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR.xT]PUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/^VUQO#o#r#o#p/s#p#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#rR/zTSPUQO#q#r#q#r$W#r;'S#r;'S;=`$g<%lO#r~0^TO#q#r#q#r0m#r;'S#r;'S;=`$g<%lO#r~0rOR~",tokenizers:[W,d,f,C,T,0,1],topRules:{Content:[0,2],Attribute:[1,9]},tokenPrec:0}),V=i.parser.configure({top:"SingleExpression"}),Q=A.configure({props:[q({Text:r.content,Is:r.definitionOperator,AttributeName:r.attributeName,"AttributeValue ExpressionAttributeValue StatementAttributeValue":r.attributeValue,Entity:r.character,InvalidEntity:r.invalid,"BoundAttributeName/Identifier":r.attributeName,"EventName/Identifier":r.special(r.attributeName),"ReferenceName/Identifier":r.variableName,"DirectiveName/Identifier":r.keyword,"{{ }}":r.brace,"( )":r.paren,"[ ]":r.bracket,"# '*'":r.punctuation})]}),o={parser:V},w={parser:i.parser},U=Q.configure({wrap:l((O,t)=>O.name=="InterpolationContent"?o:null)}),y=Q.configure({wrap:l((O,t)=>{var a;return O.name=="InterpolationContent"?o:O.name!="AttributeInterpolation"?null:((a=O.node.parent)===null||a===void 0?void 0:a.name)=="StatementAttributeValue"?w:o}),top:"Attribute"}),E={parser:U},N={parser:y},s=c({selfClosingTags:!0});function S(O){return O.configure({wrap:l(z)},"angular")}const k=S(s.language);function z(O,t){switch(O.name){case"Attribute":return/^[*#(\[]|\{\{/.test(t.read(O.from,O.to))?N:null;case"Text":return E}return null}function j(O={}){let t=s;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof g))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new P(t.language==s.language?k:S(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/})])}export{j as angular,k as angularLanguage};