dorkos 0.114.0 → 0.115.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 (270) hide show
  1. package/dist/bin/cli.js +39739 -38935
  2. package/dist/browser/native/package-manifest.json +1 -1
  3. package/dist/browser/source-manifest.json +1 -1
  4. package/dist/client/assets/{AboutPage-mErbIY0l.js → AboutPage-Cz8ijNrK.js} +1 -1
  5. package/dist/client/assets/{ActivityErrorState-AlI4F82u.js → ActivityErrorState-BzmfwxSZ.js} +1 -1
  6. package/dist/client/assets/ActivityPage-BK7T3OiI.js +1 -0
  7. package/dist/client/assets/{ActivityRow-Baqdr6cP.js → ActivityRow-Ig5atv15.js} +1 -1
  8. package/dist/client/assets/AdapterIcon-BXPv5J8h.js +1 -0
  9. package/dist/client/assets/{AdapterSetupWizard-BL70qy2J.js → AdapterSetupWizard-BEziztL3.js} +2 -2
  10. package/dist/client/assets/AgentOptionRow-BqFQvFeN.js +1 -0
  11. package/dist/client/assets/AgentPicker-dCfEIsU-.js +1 -0
  12. package/dist/client/assets/{AgentRequestCard-CcMh6JyE.js → AgentRequestCard-BAhfGJxx.js} +3 -3
  13. package/dist/client/assets/AppearancePage-7qHhFeEv.js +1 -0
  14. package/dist/client/assets/ApplyToOverridesDialog-jqOFh0d1.js +1 -0
  15. package/dist/client/assets/AttentionSignalRow-3CgglXkd.js +1 -0
  16. package/dist/client/assets/{BaseTanStackRouterDevtoolsPanel-B-iktbLX-DHr_AhUv.js → BaseTanStackRouterDevtoolsPanel-B-iktbLX-BMKtHI0D.js} +3 -3
  17. package/dist/client/assets/BindingDialog-DSBxRyzA.js +1 -0
  18. package/dist/client/assets/{BlintzCanvas-Bq4e7n__.js → BlintzCanvas-CyRuqAJV.js} +1 -1
  19. package/dist/client/assets/{CanvasCsvContent-OR226CLS.js → CanvasCsvContent-Bd1c6TGx.js} +4 -4
  20. package/dist/client/assets/CanvasFileContent-DelYwSH8.js +2 -0
  21. package/dist/client/assets/CanvasModel3dContent-BExIu4RY.js +2 -0
  22. package/dist/client/assets/ChatAppsOff-SWemSaUp.js +6 -0
  23. package/dist/client/assets/{CodeMirrorDiff-D7BWMOim.js → CodeMirrorDiff-0WF4ITRZ.js} +1 -1
  24. package/dist/client/assets/{CodeMirrorEditor-BodwsIG7.js → CodeMirrorEditor-Bg7wC_Q8.js} +1 -1
  25. package/dist/client/assets/CommitmentList-CTvEGUV3.js +1 -0
  26. package/dist/client/assets/{CommitmentsPage-DL_jJQbw.js → CommitmentsPage-C68etoLe.js} +1 -1
  27. package/dist/client/assets/ConnectionAccessLists-9oeVn_GK.js +1 -0
  28. package/dist/client/assets/ConnectionsPage-CJOY4-kp.js +6 -0
  29. package/dist/client/assets/ConventionPage-DD-f5o6y.js +11 -0
  30. package/dist/client/assets/{ExtensionPageRoute-CzXGvVRm.js → ExtensionPageRoute-C6fW17AG.js} +2 -2
  31. package/dist/client/assets/{FloatingTanStackRouterDevtools-CqogiFob-BV3h0rFa.js → FloatingTanStackRouterDevtools-CqogiFob-Zccd0fv6.js} +1 -1
  32. package/dist/client/assets/HandlePage-DOxlquWl.js +1 -0
  33. package/dist/client/assets/HeartbeatPage-cJM6NuTD.js +1 -0
  34. package/dist/client/assets/KeyEntry-K5k_3TfU.js +6 -0
  35. package/dist/client/assets/{LexicalField-Cc6wFZAZ.js → LexicalField-DB5V20zv.js} +2 -2
  36. package/dist/client/assets/{ManagesPage-BxHSb65X.js → ManagesPage-Cj0-hwfr.js} +1 -1
  37. package/dist/client/assets/{Marketplace-EgG6JmBG.js → Marketplace-eWEtLmd9.js} +2 -2
  38. package/dist/client/assets/{MarketplaceSourcesView-D9kq9hl6.js → MarketplaceSourcesView-B1h70C20.js} +1 -1
  39. package/dist/client/assets/{McpAppFrame-6zxszx9A.js → McpAppFrame-BaJ_r-QR.js} +2 -2
  40. package/dist/client/assets/McpSigninBody-Coaq5Fkf.js +1 -0
  41. package/dist/client/assets/{Model3dViewer-CgeJ2v-F.js → Model3dViewer-cKa-Jnbl.js} +1 -1
  42. package/dist/client/assets/NamePage-W7Frb1yy.js +1 -0
  43. package/dist/client/assets/{NewDirectMessageMenu-BnBO4aGI.js → NewDirectMessageMenu-C4zNIv9x.js} +1 -1
  44. package/dist/client/assets/{NotificationsPage-C5aRITCd.js → NotificationsPage-gKNClvNU.js} +1 -1
  45. package/dist/client/assets/{OpenMeshSwitch-UKMQeS7-.js → OpenMeshSwitch-RzB2u6-Q.js} +2 -2
  46. package/dist/client/assets/OperatorIdentityForm-B_78Vqh8.js +1 -0
  47. package/dist/client/assets/PermissionHistory-DrtlA4YM.js +1 -0
  48. package/dist/client/assets/PermissionsPage-O7kUVaQv.js +1 -0
  49. package/dist/client/assets/{PersonalityPopover-vLDfndfo.js → PersonalityPopover-DiNuuoWu.js} +1 -1
  50. package/dist/client/assets/PhotoPage-DdBke3yj.js +1 -0
  51. package/dist/client/assets/PresetPicker-BUFwg8RS.js +19 -0
  52. package/dist/client/assets/{PreviewRefusedNotice-Dh3SCC_A.js → PreviewRefusedNotice-DXZp669C.js} +1 -1
  53. package/dist/client/assets/ProfileFields-BCfMzNcT.js +1 -0
  54. package/dist/client/assets/ProfilePanelContainer-BzC2MGdi.js +1 -0
  55. package/dist/client/assets/ProfileRolePicker-f0FKXLtu.js +1 -0
  56. package/dist/client/assets/PromptSuggestionChips-EgeMFibt.js +1 -0
  57. package/dist/client/assets/ReportsToPopover-CQ4Xxslu.js +1 -0
  58. package/dist/client/assets/RoomSurface-oDbc6jnO.js +44 -0
  59. package/dist/client/assets/{RoomsPage-pPw8vrsB.js → RoomsPage-D_EbiSZ3.js} +1 -1
  60. package/dist/client/assets/RunsOnPopover-LtmmbIsD.js +1 -0
  61. package/dist/client/assets/RuntimeConnectFlow-Kv2ytk2m.js +1 -0
  62. package/dist/client/assets/RuntimeSetupDialog-CiWxlcPc.js +1 -0
  63. package/dist/client/assets/{SessionsPage-BASybh9v.js → SessionsPage-1rDO0SGV.js} +1 -1
  64. package/dist/client/assets/SettingsDialog-_ctp2AfE.js +12 -0
  65. package/dist/client/assets/SkillsPage-gPuQHKps.js +1 -0
  66. package/dist/client/assets/TaskDialogWrapper-BPFpCgsN.js +1 -0
  67. package/dist/client/assets/TasksEmptyState-D0Jlzmed.js +3 -0
  68. package/dist/client/assets/TasksPage-DvGfg5Bk.js +1 -0
  69. package/dist/client/assets/{ToolsPage-C3xfGWdb.js → ToolsPage-B0qZ85pR.js} +2 -2
  70. package/dist/client/assets/{TopologyGraph-D7Ik1Xt6.js → TopologyGraph-q1ammgpG.js} +3 -3
  71. package/dist/client/assets/TourHost-Dc8qw1Ef.js +1 -0
  72. package/dist/client/assets/{UnlinkDialog-TTK5Z_QD.js → UnlinkDialog-DXdrLsGV.js} +1 -1
  73. package/dist/client/assets/{WidgetErrorCard-D--KcgW1.js → WidgetErrorCard-ChDNC060.js} +23 -23
  74. package/dist/client/assets/_shell-BxPza3Lx.js +88 -0
  75. package/dist/client/assets/{_shell._home-CzpVyTzo.js → _shell._home-DjGunhLV.js} +1 -1
  76. package/dist/client/assets/_shell._home.activity-B014dET1.js +1 -0
  77. package/dist/client/assets/_shell._home.index-DEmtTHZg.js +3 -0
  78. package/dist/client/assets/_shell._home.tasks-CnDEbUOd.js +1 -0
  79. package/dist/client/assets/_shell._home.workspaces-AQtMUWuu.js +1 -0
  80. package/dist/client/assets/{_shell.channels-CCGSs0Bn.js → _shell.channels-C8NOhmJd.js} +4 -4
  81. package/dist/client/assets/_shell.connections-Bxe0wxOB.js +1 -0
  82. package/dist/client/assets/{_shell.feedback-requests-C6alx2ox.js → _shell.feedback-requests-C6ku9F5_.js} +2 -2
  83. package/dist/client/assets/_shell.marketplace-CEnzWFmI.js +1 -0
  84. package/dist/client/assets/_shell.marketplace_.sources-BZq1d2ih.js +1 -0
  85. package/dist/client/assets/_shell.session-Dn0C0mEZ.js +66 -0
  86. package/dist/client/assets/{_shell.team-BIwJNdkd.js → _shell.team-DoLdOMoC.js} +4 -4
  87. package/dist/client/assets/_shell.x._extensionId-DhE3OYMF.js +1 -0
  88. package/dist/client/assets/_shell.x._extensionId_._-DhE3OYMF.js +1 -0
  89. package/dist/client/assets/access-copy-CBGtcTk0.js +1 -0
  90. package/dist/client/assets/{agent-browser-CO5haI5Y.js → agent-browser-DbcLtsAx.js} +1 -1
  91. package/dist/client/assets/{banner-Dh5mO27l.js → banner-rPsz3suJ.js} +2 -2
  92. package/dist/client/assets/{card-CKZCX8ol.js → card-BqN3lfJn.js} +1 -1
  93. package/dist/client/assets/command-ZTLTCj0l.js +1 -0
  94. package/dist/client/assets/cpu-D70xMHl2.js +11 -0
  95. package/dist/client/assets/dead-letter-reasons-DtBHju9v.js +1 -0
  96. package/dist/client/assets/empty-state-yl1dLwLN.js +1 -0
  97. package/dist/client/assets/execution-config-BbBEe6FO.js +1 -0
  98. package/dist/client/assets/{file-CMPbZedq.js → file-CGg2M6ED.js} +1 -1
  99. package/dist/client/assets/{file-exclamation-point-emLeXvmw.js → file-exclamation-point-DZrVsShR.js} +1 -1
  100. package/dist/client/assets/{file-text-9a0DChCq.js → file-text-BYq_4IAt.js} +1 -1
  101. package/dist/client/assets/{find-latest-widget-fence--3kWMT1F.js → find-latest-widget-fence-CWs9nr10.js} +3 -3
  102. package/dist/client/assets/form-vPuXuaYT.js +1 -0
  103. package/dist/client/assets/format-cron-D02Tnupo.js +1 -0
  104. package/dist/client/assets/{git-branch-hfu8isLA.js → git-branch-DbjXDO_F.js} +1 -1
  105. package/dist/client/assets/{heart-SRafwnSd.js → heart-Dblp_miM.js} +1 -1
  106. package/dist/client/assets/{highlighted-body-KPVGNVTW-Dxwd3mxT.js → highlighted-body-KPVGNVTW-CaMXMak-.js} +1 -1
  107. package/dist/client/assets/index-B-WvQ24u.js +23 -0
  108. package/dist/client/assets/{index-Ch41JOI2.js → index-BKuzoeSn.js} +1 -1
  109. package/dist/client/assets/{index-DdsKmfEH.js → index-BOL391En.js} +1 -1
  110. package/dist/client/assets/{index-DLZi_nae.js → index-BPqkuMIa.js} +1 -1
  111. package/dist/client/assets/{index-BTXBESRm.js → index-BPwUl0Bz.js} +1 -1
  112. package/dist/client/assets/{index-DIlV08Vw.js → index-BV0tZnYg.js} +1 -1
  113. package/dist/client/assets/{index-3GDQSKet.js → index-BW98owO8.js} +1 -1
  114. package/dist/client/assets/{index-BTreBsWa.js → index-Bd23EYYT.js} +2 -2
  115. package/dist/client/assets/{index-BYp9xcmS.js → index-BdVOtoFr.js} +1 -1
  116. package/dist/client/assets/{index-CpYs0Lli.js → index-Bi7Um5RU.js} +1 -1
  117. package/dist/client/assets/{index-BRGOMmOM.js → index-BiIbMZ6d.js} +36 -36
  118. package/dist/client/assets/{index-C7BTAdSc.js → index-BxqUb-n7.js} +1 -1
  119. package/dist/client/assets/{index-DmTI5Hye.js → index-BzczIyv5.js} +1 -1
  120. package/dist/client/assets/index-C6NUjpzQ.js +38 -0
  121. package/dist/client/assets/{index-D67aFWxz.js → index-C88NZagl.js} +1 -1
  122. package/dist/client/assets/{index-BDfoFNcA.js → index-CHvi6xUU.js} +1 -1
  123. package/dist/client/assets/{index-CbFo-7kM.js → index-CMWMhbec.js} +1 -1
  124. package/dist/client/assets/{index-BB18IeC2.js → index-CN9fywRC.js} +1 -1
  125. package/dist/client/assets/{index-iD0epmn3.js → index-CRZXSh_q.js} +1 -1
  126. package/dist/client/assets/{index-YswfjpmW.js → index-CWNsRK97.js} +1 -1
  127. package/dist/client/assets/index-CaLw69VE.js +1 -0
  128. package/dist/client/assets/index-CdKpQ1hI.js +1018 -0
  129. package/dist/client/assets/{index-Cp7oifSs.js → index-CrK4rKAq.js} +1 -1
  130. package/dist/client/assets/{index-D_Wc_qTa.js → index-D16KF-iC.js} +3 -3
  131. package/dist/client/assets/index-D6m2SWHr.js +1 -0
  132. package/dist/client/assets/index-DDYi817r.js +1 -0
  133. package/dist/client/assets/{index-BokDvdOG.js → index-Db2EOzA3.js} +1 -1
  134. package/dist/client/assets/index-DdbHrvr0.js +1 -0
  135. package/dist/client/assets/index-Dg_bax15.js +17 -0
  136. package/dist/client/assets/index-DwUdUliR.js +1 -0
  137. package/dist/client/assets/{index-D0Nd2LA-.js → index-DzeYt-GT.js} +1 -1
  138. package/dist/client/assets/{index-lJc8v0Z3.js → index-Gq3gqBhY.js} +1 -1
  139. package/dist/client/assets/index-O_HMols_.js +1 -0
  140. package/dist/client/assets/{index-Cow815Qa.js → index-P5j6zmcN.js} +1 -1
  141. package/dist/client/assets/{index-BNn3-chz.js → index-XE46wAj9.js} +1 -1
  142. package/dist/client/assets/{index-C4nEz6I-.js → index-Z8YcKwIB.js} +1 -1
  143. package/dist/client/assets/{index-DFEF2MFy.css → index-kktlr1TJ.css} +1 -1
  144. package/dist/client/assets/{index-CAlXjm0N.js → index-lNMJBFB0.js} +1 -1
  145. package/dist/client/assets/{index-DX7V94qe.js → index-oWLYcpm4.js} +1 -1
  146. package/dist/client/assets/{index-DRqEM5Wb.js → index-vRc1D4KI.js} +1 -1
  147. package/dist/client/assets/inline-code-Cvn43Gqu.js +1 -0
  148. package/dist/client/assets/{layers-Cy8Tme6i.js → layers-Bmz62WF4.js} +1 -1
  149. package/dist/client/assets/{lightbulb-tNm7gLYi.js → lightbulb-CAd6slmc.js} +1 -1
  150. package/dist/client/assets/link-2-C0mn8T24.js +6 -0
  151. package/dist/client/assets/list-runtime-types-DxwGcKLx.js +1 -0
  152. package/dist/client/assets/{markdown-content-CoK3F0c0.js → markdown-content-1-B7PdbY.js} +1 -1
  153. package/dist/client/assets/{mention-pill-Bgs_yujj.js → mention-pill-D_-KXznh.js} +1 -1
  154. package/dist/client/assets/{message-square-off-CF2Bzen3.js → message-square-off-Di7kQvfe.js} +1 -1
  155. package/dist/client/assets/more-details-C6UGVeDE.js +1 -0
  156. package/dist/client/assets/{owner-notice-cgCWG4hG.js → owner-notice-CudDDBX4.js} +1 -1
  157. package/dist/client/assets/{package-DE8sQpId.js → package-D2eMoFCI.js} +1 -1
  158. package/dist/client/assets/{page-container-BoXmmBSs.js → page-container-CDHAACRA.js} +1 -1
  159. package/dist/client/assets/{paperclip-IgDeVFea.js → paperclip-p0W24D54.js} +1 -1
  160. package/dist/client/assets/path-input-j04LMj9z.js +1 -0
  161. package/dist/client/assets/primer-trigger-DkCcHf2Q.js +3 -0
  162. package/dist/client/assets/profile-errors-CqflLCzu.js +1 -0
  163. package/dist/client/assets/progress-BcuH4Eod.js +6 -0
  164. package/dist/client/assets/query-error-state-CEZs7dhg.js +1 -0
  165. package/dist/client/assets/{radio-BzTkFBDD.js → radio-DGWfQ5Rf.js} +1 -1
  166. package/dist/client/assets/registry-ChxwU0f4.js +1 -0
  167. package/dist/client/assets/relay-trace-schemas-y0nd8fzi.js +6 -0
  168. package/dist/client/assets/{room-files-source-CIIDTSTA.js → room-files-source-C1TCg4W_.js} +2 -2
  169. package/dist/client/assets/{rotate-ccw-clock-CGcSqHnk.js → rotate-ccw-clock-DcBojy-0.js} +1 -1
  170. package/dist/client/assets/{rotate-cw-DaduzRfP.js → rotate-cw-D0vUyeR2.js} +1 -1
  171. package/dist/client/assets/runtime-connect-Dn0T5YWv.js +1 -0
  172. package/dist/client/assets/{scroll-area-DW0-Liri.js → scroll-area-CQ9lO56h.js} +1 -1
  173. package/dist/client/assets/{search-x-Sme5ElYi.js → search-x-EJGj73JB.js} +2 -2
  174. package/dist/client/assets/settings-for-runtime-BoOa-ZFG.js +1 -0
  175. package/dist/client/assets/shield-check-Bp58y9u7.js +6 -0
  176. package/dist/client/assets/{shield-x-Bh5xap8N.js → shield-x-jF_NCCvp.js} +1 -1
  177. package/dist/client/assets/soul-file-Cag2i87x.js +1 -0
  178. package/dist/client/assets/{table-BEtvgYmW.js → table-D89CWVJX.js} +1 -1
  179. package/dist/client/assets/terminal-BUhNMZAt.js +6 -0
  180. package/dist/client/assets/trust-posture-15DMDZTA.js +1 -0
  181. package/dist/client/assets/unplug-opnrSXAi.js +6 -0
  182. package/dist/client/assets/unverified-catalog-notice-DHM5Coia.js +1 -0
  183. package/dist/client/assets/use-adapter-catalog-ClMqVelU.js +1 -0
  184. package/dist/client/assets/use-bindings-Ch6UUBvz.js +1 -0
  185. package/dist/client/assets/use-composer-prefs-Qn7KRpYe.js +1 -0
  186. package/dist/client/assets/{use-connector-management-Cohvs7jD.js → use-connector-management-dX_4x0d3.js} +1 -1
  187. package/dist/client/assets/use-deep-link-scroll-BV2fY4gy.js +1 -0
  188. package/dist/client/assets/use-delete-binding-BklxjB_c.js +1 -0
  189. package/dist/client/assets/{use-dev-links-DRnLdl--.js → use-dev-links-D4Bqam6F.js} +1 -1
  190. package/dist/client/assets/use-external-adapter-catalog-nHiD8BKZ.js +1 -0
  191. package/dist/client/assets/use-full-activity-feed-vYU7wQWT.js +1 -0
  192. package/dist/client/assets/use-is-below-desktop-G-mTu2Ga.js +1 -0
  193. package/dist/client/assets/{use-jump-back-in-CkFErfWY.js → use-jump-back-in-BVunjzyr.js} +3 -3
  194. package/dist/client/assets/use-mesh-topology-NaUKSKol.js +1 -0
  195. package/dist/client/assets/use-mounted-ref-BWpQ8f91.js +1 -0
  196. package/dist/client/assets/use-notification-prefs-qO1zRRFN.js +1 -0
  197. package/dist/client/assets/{use-panel-tab-placements-AFrWTQ0a.js → use-panel-tab-placements-Db6p2vLD.js} +1 -1
  198. package/dist/client/assets/use-pending-read-DUqJZUza.js +1 -0
  199. package/dist/client/assets/use-personality-commit-DUEKxHt_.js +1 -0
  200. package/dist/client/assets/{use-promo-activation-Dxt-1yuT.js → use-promo-activation-CnGaw39P.js} +2 -2
  201. package/dist/client/assets/use-promo-dismissals-bkSHhGhj.js +1 -0
  202. package/dist/client/assets/{use-pulse-freshness-DRRM5Hza.js → use-pulse-freshness-Oc_1gs-Y.js} +1 -1
  203. package/dist/client/assets/use-relay-config-Ba-S4wxY.js +1 -0
  204. package/dist/client/assets/{use-room-follow-claim-huRfaa4e.js → use-room-follow-claim-DqE5b95Z.js} +1 -1
  205. package/dist/client/assets/{use-roving-tab-list-BZIBAGgJ.js → use-roving-tab-list-DnMqliqf.js} +1 -1
  206. package/dist/client/assets/{use-session-canvas-CZIsr9qL.js → use-session-canvas-OdljtBE8.js} +4 -4
  207. package/dist/client/assets/{use-session-diagnostics-C41hV7rK.js → use-session-diagnostics-CtjxsM8_.js} +4 -4
  208. package/dist/client/assets/use-unclaimed-chats-5RCD5wIp.js +1 -0
  209. package/dist/client/assets/use-update-config-xkznZMHr.js +1 -0
  210. package/dist/client/assets/useMutationState-Mjr_y4xX.js +1 -0
  211. package/dist/client/index.html +2 -2
  212. package/dist/server/index.js +11367 -9690
  213. package/dist/server/index.js.map +2 -2
  214. package/package.json +4 -4
  215. package/dist/client/assets/ActivityPage-CHUqb-8c.js +0 -1
  216. package/dist/client/assets/AdapterIcon-C_fBZXHQ.js +0 -1
  217. package/dist/client/assets/AppearancePage-t9SnSRs-.js +0 -1
  218. package/dist/client/assets/AttentionSignalRow-jlgWaSSd.js +0 -1
  219. package/dist/client/assets/CanvasFileContent-BejM-9Wg.js +0 -2
  220. package/dist/client/assets/CanvasModel3dContent-BD-eCVsX.js +0 -2
  221. package/dist/client/assets/CommitmentList-YVb3yTvO.js +0 -1
  222. package/dist/client/assets/ConnectionAccessLists-BPsgToSR.js +0 -1
  223. package/dist/client/assets/ConnectionsPage-D7vlYnjf.js +0 -6
  224. package/dist/client/assets/ConventionPage-BR7I3AdE.js +0 -11
  225. package/dist/client/assets/HandlePage-B33P0oh0.js +0 -1
  226. package/dist/client/assets/HeartbeatPage-CfjZuvtQ.js +0 -1
  227. package/dist/client/assets/McpSigninBody-DBWSc6bm.js +0 -1
  228. package/dist/client/assets/NamePage-MfybpnwN.js +0 -1
  229. package/dist/client/assets/OperatorIdentityForm-DH2au7QU.js +0 -1
  230. package/dist/client/assets/PermissionsPage-BgLLmdg2.js +0 -1
  231. package/dist/client/assets/PhotoPage-BgyB3B2_.js +0 -1
  232. package/dist/client/assets/PromptSuggestionChips-EO_0zbzq.js +0 -1
  233. package/dist/client/assets/ReportsToPopover-C9Ceg1AW.js +0 -1
  234. package/dist/client/assets/RoomSurface-B8ec3_at.js +0 -44
  235. package/dist/client/assets/RunsOnPopover-CJoSj8w7.js +0 -1
  236. package/dist/client/assets/RuntimeSetupDialog-Cqn_Grel.js +0 -1
  237. package/dist/client/assets/SkillsPage-DL0909et.js +0 -1
  238. package/dist/client/assets/TasksPage-BwUW6dia.js +0 -1
  239. package/dist/client/assets/TourHost-Db0fxAXo.js +0 -1
  240. package/dist/client/assets/_shell-CGWsN6Gs.js +0 -88
  241. package/dist/client/assets/_shell._home.activity-BbWquOK0.js +0 -1
  242. package/dist/client/assets/_shell._home.index-Cg0nRFMN.js +0 -3
  243. package/dist/client/assets/_shell._home.tasks-BpoOVihw.js +0 -1
  244. package/dist/client/assets/_shell._home.workspaces-DVF1rM3t.js +0 -1
  245. package/dist/client/assets/_shell.connections-0_34lXIQ.js +0 -1
  246. package/dist/client/assets/_shell.marketplace-Dp-p8E3V.js +0 -1
  247. package/dist/client/assets/_shell.marketplace_.sources-SN2Fb1eb.js +0 -1
  248. package/dist/client/assets/_shell.session-Bt3jdQdD.js +0 -66
  249. package/dist/client/assets/_shell.x._extensionId-Bjn-MKsP.js +0 -1
  250. package/dist/client/assets/_shell.x._extensionId_._-Bjn-MKsP.js +0 -1
  251. package/dist/client/assets/index-BBQMqcO_.js +0 -1
  252. package/dist/client/assets/index-BUVKya1M.js +0 -23
  253. package/dist/client/assets/index-C3xuhmPa.js +0 -38
  254. package/dist/client/assets/index-C63bLSO4.js +0 -1099
  255. package/dist/client/assets/index-CTxEG5rD.js +0 -1
  256. package/dist/client/assets/index-CkknQ52Q.js +0 -17
  257. package/dist/client/assets/index-DLNwEM2Q.js +0 -1
  258. package/dist/client/assets/index-DX-j3Ul0.js +0 -1
  259. package/dist/client/assets/index-g_5oOlG6.js +0 -1
  260. package/dist/client/assets/index-t7gsOfUI.js +0 -1
  261. package/dist/client/assets/kickoff-xkt4LpIP.js +0 -3
  262. package/dist/client/assets/soul-file-NcuTUIiB.js +0 -1
  263. package/dist/client/assets/use-delete-binding-C19umm_i.js +0 -1
  264. package/dist/client/assets/use-external-adapter-catalog-BOn9aj72.js +0 -1
  265. package/dist/client/assets/use-full-activity-feed-BpQANbns.js +0 -1
  266. package/dist/client/assets/use-is-below-desktop-5LlietdR.js +0 -1
  267. package/dist/client/assets/use-mesh-topology-CIsDeAY0.js +0 -1
  268. package/dist/client/assets/use-pending-read-Dol8yvIx.js +0 -1
  269. package/dist/client/assets/use-personality-commit-fUtuc2lC.js +0 -1
  270. package/dist/client/assets/use-unclaimed-chats-BMlFQ2v1.js +0 -1
@@ -0,0 +1 @@
1
+ import{u as m,C as x,a as h,c as p,p as g}from"./use-session-diagnostics-CtjxsM8_.js";import{A as he,b as pe,d as ge,e as fe,G as je,M as Se,f as be,P as ve,g as ke,R as Ne,h as Ie,S as Ce,i as we,j as ye,U as Ae,k as Me,l as Pe,m as Re,n as Te,o as Ue,q as De,r as Ee,s as Ge,t as Oe,v as $e,w as Le,x as Be,y as qe,z as ze,B as Fe,D as _e}from"./use-session-diagnostics-CtjxsM8_.js";import{cd as f,j as s,l as j,B as S,ce as b,b0 as v,cf as k,cg as t,Q as N,ch as r,ci as I,cj as C,r as l,ck as w,a5 as y}from"./index-CdKpQ1hI.js";import{cl as He,cm as Ve,cn as Ke,co as Je,cp as We,cq as Xe,cr as Ye,cs as Ze,ct as es,cu as ss,cv as ts,cw as ns,cx as as,cy as os,cz as rs,cA as is}from"./index-CdKpQ1hI.js";import{f as A}from"./format-duration-BCr6uzby.js";import{r as M}from"./composer-insert-BpyATrmR.js";import{S as P}from"./ConnectionAccessLists-9oeVn_GK.js";import"./git-branch-DbjXDO_F.js";import"./use-update-config-xkznZMHr.js";import"./settings-for-runtime-BoOa-ZFG.js";import"./card-BqN3lfJn.js";import"./RuntimeSetupDialog-CiWxlcPc.js";import"./inline-code-Cvn43Gqu.js";import"./list-runtime-types-DxwGcKLx.js";import"./RuntimeConnectFlow-Kv2ytk2m.js";import"./useMutationState-Mjr_y4xX.js";import"./runtime-connect-Dn0T5YWv.js";import"./terminal-BUhNMZAt.js";import"./unverified-catalog-notice-DHM5Coia.js";import"./layers-Bmz62WF4.js";import"./cpu-D70xMHl2.js";import"./access-copy-CBGtcTk0.js";import"./query-error-state-CEZs7dhg.js";import"./empty-state-yl1dLwLN.js";const R="I need access to another service. Ask me which service and actions you need, then request only that access.";function T({sessionId:e}){const a=f(),o=s.jsx(S,{variant:"secondary",size:"sm","data-testid":`ask-agent-for-connection-${e}`,onClick:()=>M(R),children:"Ask your agent"});return s.jsx(P,{sessionId:e,onManage:()=>void a({...j.connections()}),emptyAction:o,footer:s.jsx("div",{className:"pt-1",children:o})})}const U=1e3;function de(){const[e]=b(),a=m(e??""),o=v(n=>n.rightPanelOpen);return e?s.jsx(D,{diagnostics:a,live:o,connectors:s.jsx(T,{sessionId:e})}):s.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-xs",children:"Open a chat to inspect it."})}function D({diagnostics:e,live:a=!0,connectors:o}){return s.jsxs("div",{"data-slot":"session-inspector",className:"flex h-full min-w-0 flex-col gap-4 overflow-y-auto p-3",children:[s.jsx(E,{diagnostics:e,live:a}),s.jsx(G,{diagnostics:e}),s.jsx(O,{diagnostics:e}),s.jsx($,{diagnostics:e}),o,s.jsxs("div",{className:"mt-auto pt-2",children:[s.jsx(k,{className:"mb-2"}),s.jsx(x,{diagnostics:e,className:"w-full justify-center"})]})]})}function E({diagnostics:e,live:a}){const o=z(e.lastEventAt,a),n=h[e.connectionState];return s.jsxs(c,{label:"Live",children:[s.jsx(t,{label:"Live updates",children:s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx("span",{"aria-hidden":!0,className:N("inline-block size-1.5 rounded-full",n.color,n.tasks&&"animate-breath")}),n.shortLabel]})}),s.jsx(t,{label:"Turn",children:L(e)}),s.jsx(t,{label:"Last event",children:e.lastEventSeq===0?"none yet":`seq ${e.lastEventSeq}`}),s.jsx(t,{label:"Resumed from",children:e.snapshotCursor===null?"not hydrated":`cursor ${e.snapshotCursor}`}),s.jsx(t,{label:"Last update",children:o===null?"—":`${A(o)} ago`}),s.jsx(t,{label:"Queued messages",children:String(e.queueDepth)})]})}function G({diagnostics:e}){return s.jsxs(c,{label:"Resolved",children:[s.jsx(t,{label:"Directory",wrap:!0,children:e.cwd??"—"}),s.jsx(t,{label:"Git",children:q(e.git)}),s.jsx(t,{label:"Runs on",children:e.runtime??"—"}),s.jsx(t,{label:"Model",wrap:!0,children:e.model??"—"}),e.selectedModel!==null&&e.selectedModel!==e.model&&s.jsx(t,{label:"Model selected",children:e.selectedModel}),s.jsx(t,{label:"Effort",children:e.effort??"—"}),s.jsx(t,{label:"Fast mode",children:e.fastMode?"on":"off"}),s.jsx(t,{label:"Permissions",children:e.permissionMode}),s.jsx(t,{label:"Chat ID",wrap:!0,children:e.sessionId}),s.jsx(t,{label:"DorkOS version",children:e.clientVersion??"—"})]})}function O({diagnostics:e}){var o;const a=(((o=e.contextUsage)==null?void 0:o.categories)??[]).filter(n=>n.tokens>0).sort((n,i)=>i.tokens-n.tokens);return s.jsxs(c,{label:"Usage",children:[s.jsx(t,{label:"Context",children:e.contextPercent===null?"—":`${e.contextPercent}% full`}),e.contextUsage&&s.jsxs(t,{label:"Tokens",children:[r(e.contextUsage.totalTokens)," / ",r(e.contextUsage.maxTokens)]}),a.map(n=>s.jsx(t,{label:n.name,indent:!0,swatch:n.color,"data-testid":`context-category-${n.name}`,children:r(n.tokens)},n.name)),e.cache===null?s.jsx(t,{label:"Cache",children:"nothing cached yet"}):s.jsxs(s.Fragment,{children:[s.jsx(t,{label:"Cache hit",children:`${p(e.cache)}%`}),s.jsx(t,{label:"Cache read",indent:!0,children:r(e.cache.readTokens)}),s.jsx(t,{label:"Cache written",indent:!0,children:r(e.cache.creationTokens)})]}),e.usage!==null&&I(e.usage)?s.jsx("div",{className:"pt-1",children:s.jsx(C,{usage:e.usage})}):s.jsx(t,{label:"Usage & cost",children:"no usage reported"})]})}function $({diagnostics:e}){const{running:a,finished:o}=g(e.activeSubagents);return s.jsxs(c,{label:"Subagents",children:[s.jsx(t,{label:"Running",children:B(a.length,e.runningSubagentCount)}),a.map(n=>s.jsx(u,{subagent:n},n.taskId)),o.length>0&&s.jsxs(s.Fragment,{children:[s.jsx(t,{label:"Finished this turn",children:String(o.length)}),o.map(n=>s.jsx(u,{subagent:n},n.taskId))]}),s.jsx(t,{label:"Available",children:e.subagents.length===0?"none":e.subagents.map(n=>n.name).join(", ")})]})}function u({subagent:e}){return s.jsxs("div",{"data-testid":`active-subagent-${e.taskId}`,"data-status":e.status,className:"space-y-0.5 py-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(w,{className:"text-muted-foreground size-3.5 shrink-0","aria-hidden":!0}),s.jsx("span",{className:"min-w-0 flex-1 truncate",children:e.description??e.taskId}),s.jsx(y,{size:"xs",variant:"secondary",className:"shrink-0",children:e.status})]}),s.jsxs("p",{className:"text-muted-foreground text-3xs pl-5 leading-tight",children:[e.toolUses??0," tool",e.toolUses===1?"":"s",e.lastToolName?` · last ${e.lastToolName}`:""]})]})}function c({label:e,children:a}){return s.jsxs("section",{className:"min-w-0",children:[s.jsx("h3",{className:"text-muted-foreground px-1 pb-1 text-xs font-medium tracking-wide uppercase",children:e}),s.jsx("div",{className:"space-y-1 px-1 text-xs",children:a})]})}function L(e){return e.triggerPending?"sending":e.streaming?"streaming":e.lifecycle??"not hydrated"}function B(e,a){const o=e===0?"none":String(e);return a===null||a===e?o:`${o} · server says ${a}`}function q(e){return e.state==="unknown"?"—":e.state==="no-repo"?"no repo":e.dirty?`${e.branch} · changed`:`${e.branch} · clean`}function z(e,a){const[o,n]=l.useState(()=>Date.now());return l.useEffect(()=>{if(e===null||!a)return;const i=()=>n(Date.now());i();const d=setInterval(i,U);return()=>clearInterval(d)},[e,a]),e===null?null:Math.max(0,o-e)}export{He as AccountBadge,Ve as AccountBadgeView,Ke as AccountItem,Je as AccountMenuRow,We as AccountPopover,Xe as AccountTrigger,he as AutoModeConfirmDialog,pe as ConnectionItem,ge as ContextItem,fe as CwdItem,je as GitStatusItem,Se as MakeDefaultStopLine,be as ModelConfigPopover,ve as PermissionModeItem,ke as PlanModeItem,Ne as ReadOnlyModeNotice,Ie as RuntimeItem,de as SessionInspector,Ce as SessionPopover,D as SessionReadout,we as StatusLine,ye as SubagentsItem,Ae as UsageRevealPopover,Ye as UsageStatusItem,Ze as accountChipPromotion,Me as applyStatusBudget,es as canOfferContinue,ss as chipToneFor,Pe as evaluateExtensionStatusItems,ts as formatCost,Re as formatDiagnostics,Te as gitPromotionState,I as hasRenderableUsage,Ue as isGitStatusOk,De as isUsageAbsorbed,g as partitionSubagents,Ee as resolveStatusBudget,Ge as selectPromotedItems,ns as showsStaleMark,Oe as useExtensionStatusItems,$e as useGitStatus,Le as useMakeDefaultStop,Be as useReadOnlyModeHint,as as useResolvedSessionRuntime,os as useRuntimeChip,rs as useSessionAccount,m as useSessionDiagnostics,is as useSessionPermissionPicker,qe as useSessionPopoverShortcut,ze as useStatusBarPins,Fe as useStatusBudget,_e as useStatusUsage};
@@ -0,0 +1 @@
1
+ import{j as e,cd as j,e6 as w,e7 as T,e8 as L,e9 as O,b0 as E,ea as z,B as u,eb as F,ec as B,bF as Q,ed as _,W as M,ee as W,l as y,ak as q}from"./index-CdKpQ1hI.js";import{u as D}from"./use-is-below-desktop-G-mTu2Ga.js";import{u as b}from"./use-pending-read-DUqJZUza.js";import{A as H}from"./AttentionSignalRow-3CgglXkd.js";import{T as U,a as V}from"./table-D89CWVJX.js";import{u as Y}from"./use-pulse-freshness-Oc_1gs-Y.js";import{a as de}from"./use-pulse-freshness-Oc_1gs-Y.js";import{A as G}from"./ActivityRow-Ig5atv15.js";import"./use-full-activity-feed-vYU7wQWT.js";function A({label:a,empty:i,allClear:n,action:o,children:l}){return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-2 flex min-h-6 items-center justify-between gap-2",children:[e.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-widest uppercase",children:a}),!i&&o]}),i?e.jsx("p",{className:"text-muted-foreground/70 text-xs",children:n}):l]})}const d=5,J={animate:{transition:{staggerChildren:.04}}};function K(){const a=j(),i=w(),{schedules:n,errors:o,activity:l,isLoading:m,total:c}=T(),t=L(),h=D(),N=b(m||t.isLoading),S=O(),C=E(s=>s.setRightPanelOpen),x=z(n),P=i==="/"&&!h,r=x.slice(0,d),p=o.slice(0,d-r.length),k=l.slice(0,d-r.length-p.length),I=new Set(n.map(s=>s.id)),g=x.slice(d).filter(s=>I.has(s.id)),R={...t,schedules:g},f=t.items.filter(s=>s.kind!=="schedule-approval").length+g.length,v=t.isAnyError;return P?null:e.jsxs(A,{label:"Needs attention",empty:!N&&c===0&&r.length===0&&f===0&&!v,allClear:"All quiet. Nothing needs you.",action:e.jsx(u,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>a({...y.home()}),children:"View all →"}),children:[v&&e.jsxs("div",{"data-slot":"pulse-waiting-unreadable",className:"mb-2 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1",children:[e.jsx("span",{className:"text-muted-foreground min-w-0 flex-1 text-xs",children:"Couldn’t check everything waiting on you."}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:t.retryFailed,children:"Try again"})]}),f>0&&e.jsxs("div",{"data-slot":"pulse-waiting-line",className:"mb-2 flex min-w-0 items-center gap-2.5 rounded-md px-2 py-1",children:[e.jsx("span",{className:"bg-status-warning size-1.5 shrink-0 rounded-full","aria-hidden":!0}),e.jsx("span",{className:"text-foreground/90 min-w-0 flex-1 text-xs",children:F(R)}),e.jsx(u,{variant:"ghost",size:"sm",className:"h-6 shrink-0 px-2 text-xs",onClick:()=>{h&&C(!1),B()},children:"Open Inbox"})]}),e.jsx(Q,{initial:!1,children:r.map(s=>e.jsx(_,{task:s,className:"mb-2"},s.id))}),e.jsxs(M.div,{variants:J,initial:"initial",animate:"animate",children:[p.map(s=>e.jsx(H,{signal:s},s.id)),k.map(s=>e.jsx(W,{notification:s,onOpen:()=>S(s)},s.id))]})]})}const X=5;function Z(){const a=j(),i=w(),n=q(),{groups:o,isLoading:l}=Y(),m=b(l);if(i==="/activity"&&!n)return null;const c=o.flatMap(t=>t.items).slice(0,X);return e.jsx(A,{label:"Activity",empty:!m&&c.length===0,allClear:"No recent activity.",action:e.jsx(u,{variant:"ghost",size:"sm",className:"h-6 text-xs",onClick:()=>a({...y.activity()}),children:"Open activity →"}),children:e.jsx(U,{children:e.jsx(V,{children:c.map(t=>e.jsx(G,{item:t},t.id))})})})}function le(){return e.jsxs("div",{"data-slot":"pulse",className:"flex h-full flex-col gap-6 overflow-y-auto p-4",children:[e.jsx(K,{}),e.jsx(Z,{})]})}export{le as PulsePanel,de as usePulseFreshness};
@@ -1 +1 @@
1
- import{L as G,E as A,C as N}from"./index-CAlXjm0N.js";import{s as I,t as p,E as Y,e as k,j,a as U,L as Z,i as B,f as D,O as M}from"./index-D_Wc_qTa.js";import"./index-C63bLSO4.js";const h=1,F=2,L=3,K=4,H=5,J=36,ee=37,te=38,Oe=11,oe=13;function re(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ne(e){return e==9||e==10||e==13||e==32}let Q=null,V=null,X=0;function W(e,t){let o=e.pos+t;if(V==e&&X==o)return Q;for(;ne(e.peek(t));)t++;let O="";for(;;){let r=e.peek(t);if(!re(r))break;O+=String.fromCharCode(r),t++}return V=e,X=o,Q=O||null}function _(e,t){this.name=e,this.parent=t}const ae=new N({start:null,shift(e,t,o,O){return t==h?new _(W(O,1)||"",e):e},reduce(e,t){return t==Oe&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==oe?new _(W(O,1)||"",e):e},strict:!1}),le=new A((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let o=W(e,0);if(!o)return e.acceptToken(H);if(t.context&&o==t.context.name)return e.acceptToken(F);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(K)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)}},{contextual:!0});function y(e,t){return new A(o=>{let O=0,r=t.charCodeAt(0);e:for(;!(o.next<0);o.advance(),O++)if(o.next==r){for(let a=1;a<t.length;a++)if(o.peek(a)!=t.charCodeAt(a))continue e;break}O&&o.acceptToken(e)})}const se=y(J,"-->"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$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f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:ae,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["openedBy",12,"StartTag StartCloseTag",19,"OpenTag",20,"StartTag"],["isolate",-6,13,18,19,21,22,24,""]],propSources:[me],skippedNodes:[0],repeatNodeCount:9,tokenData:"!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO%gP&YTVPOv&Tw!^&T!_;'S&T;'S;=`&i<%lO&TP&lP;=`<%l&T`&tS!O`Ov&ox;'S&o;'S;=`'Q<%lO&o`'TP;=`<%l&oa'ZP;=`<%l%gX'eWVP|WOr'^r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oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class ue{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let u=new ue(n,$,c);f[u.name]=u,a.push(u),n.top&&s.push(u)}s.length||(s=a);for(let n=0;n<a.length;n++){let $=e[n],c=a[n];if($.children)for(let u of $.children)f[u]&&c.children.push(f[u]);else c.children=a}return n=>{var $;let{doc:c}=n.state,u=ge(n.state,n.pos);if(!u||u.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=u;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"</"+i+">",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=Z.define({name:"xml",parser:$e.configure({props:[B.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),D.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),M.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Te(e={}){let t=[w.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new U(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=Y.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,u;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`</${i}>`;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((u=m.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:j.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,pe as completeFromSchema,Te as xml,w as xmlLanguage};
1
+ import{L as G,E as A,C as N}from"./index-lNMJBFB0.js";import{s as I,t as p,E as Y,e as k,j,a as U,L as Z,i as B,f as D,O as M}from"./index-D16KF-iC.js";import"./index-CdKpQ1hI.js";const h=1,F=2,L=3,K=4,H=5,J=36,ee=37,te=38,Oe=11,oe=13;function re(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ne(e){return e==9||e==10||e==13||e==32}let Q=null,V=null,X=0;function W(e,t){let o=e.pos+t;if(V==e&&X==o)return Q;for(;ne(e.peek(t));)t++;let O="";for(;;){let r=e.peek(t);if(!re(r))break;O+=String.fromCharCode(r),t++}return V=e,X=o,Q=O||null}function _(e,t){this.name=e,this.parent=t}const ae=new N({start:null,shift(e,t,o,O){return t==h?new _(W(O,1)||"",e):e},reduce(e,t){return t==Oe&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==oe?new _(W(O,1)||"",e):e},strict:!1}),le=new A((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let o=W(e,0);if(!o)return e.acceptToken(H);if(t.context&&o==t.context.name)return e.acceptToken(F);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(K)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)}},{contextual:!0});function y(e,t){return new A(o=>{let O=0,r=t.charCodeAt(0);e:for(;!(o.next<0);o.advance(),O++)if(o.next==r){for(let a=1;a<t.length;a++)if(o.peek(a)!=t.charCodeAt(a))continue e;break}O&&o.acceptToken(e)})}const se=y(J,"-->"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:p.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,AttributeValue:p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta,Cdata:p.special(p.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<<GuOOOP<<Gu<<GuOOOP<<G}<<G}O'bOpO1G.qO'bOpO1G.qO(hO#tO'#CnO(vO&jO'#CnOOOO1G.q1G.qO)UOpO7+$aOOOP7+$a7+$aOOOP<<HQ<<HQOOOPAN=aAN=aOOOPAN=iAN=iO'bOpO7+$]OOOO7+$]7+$]OOOO'#Cz'#CzO)^O#tO,59YOOOO,59Y,59YOOOO'#C{'#C{O)lO&jO,59YOOOP<<G{<<G{OOOO<<Gw<<GwOOOO-E6x-E6xOOOO1G.t1G.tOOOO-E6y-E6y",stateData:")z~OPQOSVOTWOVWOWWOXWOiXOyPO!QTO!SUO~OvZOx]O~O^`Oz^O~OPQOQcOSVOTWOVWOWWOXWOyPO!QTO!SUO~ORdO~P!SOteO!PgO~OuhO!RjO~O^lOz^O~OvZOxoO~O^qOz^O~O[vO`sOdwOz^O~ORyO~P!SO^{Oz^O~OteO!P}O~OuhO!R!PO~O^!QOz^O~O[!SOz^O~O[!VO`sOd!WOz^O~Oa!YOz^O~Oz^O[mX`mXdmX~O[!VO`sOd!WO~O^!]Oz^O~O[!_Oz^O~O[!aOz^O~O[!cO`sOd!dOz^O~O[!cO`sOd!dO~Oa!eOz^O~Oz^O{!gO}!hO~Oz^O[ma`madma~O[!kOz^O~O[!lOz^O~O[!mO`sOd!nO~OW!qOX!qO{!sO|!qO~OW!tOX!tO}!sO!O!tO~O[!vOz^O~OW!qOX!qO{!yO|!qO~OW!tOX!tO}!yO!O!tO~O",goto:"%cxPPPPPPPPPPyyP!PP!VPP!`!jP!pyyyP!v!|#S$[$k$q$w$}%TPPPP%ZXWORYbXRORYb_t`qru!T!U!bQ!i!YS!p!e!fR!w!oQdRRybXSORYbQYORmYQ[PRn[Q_QQkVjp_krz!R!T!X!Z!^!`!f!j!oQr`QzcQ!RlQ!TqQ!XsQ!ZtQ!^{Q!`!QQ!f!YQ!j!]R!o!eQu`S!UqrU![u!U!bR!b!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",nodeNames:"⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",maxTerm:50,context:ae,nodeProps:[["closedBy",1,"SelfCloseEndTag EndTag",13,"CloseTag MissingCloseTag"],["opened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O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class ue{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"</"+this.name+">",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function pe(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let u=new ue(n,$,c);f[u.name]=u,a.push(u),n.top&&s.push(u)}s.length||(s=a);for(let n=0;n<a.length;n++){let $=e[n],c=a[n];if($.children)for(let u of $.children)f[u]&&c.children.push(f[u]);else c.children=a}return n=>{var $;let{doc:c}=n.state,u=ge(n.state,n.pos);if(!u||u.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=u;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"</"+i+">",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=Z.define({name:"xml",parser:$e.configure({props:[B.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),D.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),M.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/$/}});function Te(e={}){let t=[w.data.of({autocomplete:pe(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new U(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=Y.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,u;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`</${i}>`;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((u=m.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:j.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,pe as completeFromSchema,Te as xml,w as xmlLanguage};
@@ -0,0 +1 @@
1
+ import{u as n,D as r}from"./TourHost-Dc8qw1Ef.js";import{T as j,a as N,b as k}from"./TourHost-Dc8qw1Ef.js";import{j as e,W as l,B as a}from"./index-CdKpQ1hI.js";import"./dorkbot-templates-8Yu9POWJ.js";import"./use-relay-config-Ba-S4wxY.js";import"./use-external-adapter-catalog-nHiD8BKZ.js";import"./use-adapter-catalog-ClMqVelU.js";function u(){const{pendingOffer:s,pendingOfferId:i,acceptOffer:o,declineOffer:t}=n();return!s||i===null||!s.offerLine?null:e.jsxs(l.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},role:"group","aria-label":"DorkBot suggestion",className:"bg-secondary/60 mt-1.5 flex flex-col gap-2 rounded-lg border p-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs("span",{className:"mt-0.5 shrink-0",children:[e.jsx(r,{size:18,className:"dark:hidden"}),e.jsx(r,{variant:"white",size:18,className:"hidden dark:block"})]}),e.jsx("p",{className:"text-sm leading-relaxed",children:s.offerLine})]}),e.jsxs("div",{className:"flex items-center gap-2 pl-6",children:[e.jsx(a,{size:"sm",onClick:()=>o(i),children:"Show me"}),e.jsx(a,{size:"sm",variant:"ghost",onClick:()=>t(i),children:"Later"})]})]})}export{j as TOUR_DEFINITIONS,N as TourHost,u as TourOfferChips,k as useTourOccasions,n as useTours};
@@ -0,0 +1,17 @@
1
+ import{a2 as Se,aX as Me,a8 as ne,r as s,it as Ie,iu as Q,iv as G,iw as H,gb as ie,ix as Ce,ae as X,iy as ee,ay as it,iq as lt,aa as oe,iz as ct,iA as dt,hZ as ut,iB as ft,b0 as Te,iC as ht,j as e,x as Fe,$ as pt,C as Ke,ax as mt,d$ as be,hy as xt,Q as Oe,iD as gt,iE as yt,iF as vt,iG as J,iH as ue,fY as fe,fZ as he,f_ as pe,f$ as me,g0 as xe,g1 as ge,g2 as ye,g3 as ve,B as W,be as Ct,e5 as _e,hD as bt,iI as kt,a9 as ce,iJ as He,dE as jt,iK as wt,iL as Et,iM as Dt,iN as Nt,bs as De,iO as Ue,ab as Rt,g9 as St,a7 as Tt,g8 as Ft,dO as Ot,hH as Pt,iP as Mt,cE as _t,cF as At,cH as Lt,cI as zt,cJ as $t,dB as It,I as Kt,dh as Ht}from"./index-CdKpQ1hI.js";import{t as ae,g as Ut,C as qt,n as qe,r as Qe,a as Qt,p as Bt,F as Yt,w as Wt,c as Be,b as Gt}from"./room-files-source-C1TCg4W_.js";import{N as ss,R as as}from"./room-files-source-C1TCg4W_.js";import{r as Vt,c as Zt}from"./composer-insert-BpyATrmR.js";import{u as Jt}from"./index-CHvi6xUU.js";import{r as Ye,h as We,F as Xt}from"./file-drag-GDx2qhdk.js";import{R as Ge}from"./rotate-cw-D0vUyeR2.js";import{L as en}from"./link-2-C0mn8T24.js";import{F as Ve}from"./file-CGg2M6ED.js";import{G as Ze}from"./git-branch-DbjXDO_F.js";import{M as tn}from"./more-details-C6UGVeDE.js";import"./markdown-content-1-B7PdbY.js";import"./file-exclamation-point-DZrVsShR.js";/**
2
+ * @license lucide-react v1.48.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const Je={name:"corner-left-up",size:24,node:[["path",{d:"M14 9 9 4 4 9",key:"1af5af"}],["path",{d:"M20 20h-7a4 4 0 0 1-4-4V4",key:"1blwi3"}]]};Je.node;const nn=Se(Je);/**
7
+ * @license lucide-react v1.48.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const Xe={name:"file-plus",size:24,node:[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]};Xe.node;const et=Se(Xe);/**
12
+ * @license lucide-react v1.48.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const tt={name:"upload",size:24,node:[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]};tt.node;const sn=Se(tt);function le(t,n,a){return["file-explorer","tree",t.scopeKey,n,t.filtersHidden?a:null]}function je(t,n,a,x){return{queryKey:le(t,n,a),queryFn:()=>t.list(n,{showHidden:a}),staleTime:Me.FILE_TREE_STALE_TIME_MS,gcTime:Me.FILE_TREE_GC_TIME_MS,refetchOnWindowFocus:!0,placeholderData:p=>p??x.getQueryData(le(t,n,!a))}}const an=[".git",".dork",".claude",".agents","node_modules"];function rn(t){return t.startsWith(".")||an.includes(t)}const Ne=["ROOM.md","README.md"];function Re(t){return Ne.some(n=>n.toLowerCase()===t.toLowerCase())}function nt(t){return t.filter(n=>!rn(n.name))}function on(t){if(t.reduce((p,c)=>c.type==="file"&&Re(c.name)?p+1:p,0)===0)return t;const a=[],x=[];for(const p of t)p.type==="file"&&Re(p.name)?a.push(p):x.push(p);return a.sort((p,c)=>Ne.findIndex(o=>o.toLowerCase()===p.name.toLowerCase())-Ne.findIndex(o=>o.toLowerCase()===c.name.toLowerCase())),[...a,...x]}const ln=/ copy(?: \d+)?$/;function Pe({name:t,isDir:n,taken:a}){const x=new Set(a);if(!x.has(t))return t;const p=n?-1:t.lastIndexOf("."),c=p>0,o=c?t.slice(p):"",m=(c?t.slice(0,p):t).replace(ln,"");for(let r=1;;r+=1){const i=r===1?`${m} copy${o}`:`${m} copy ${r}${o}`;if(!x.has(i))return i}}function Ae(t,n,a){return{name:n,path:t,type:a,size:0,mtime:Date.now(),isSymlink:!1}}function cn(t){const n=ne(),{source:a,showHidden:x,queryClient:p,inFlightRef:c}=t,o=a.cwd??"",[m,r]=s.useState(null),i=s.useCallback(async h=>{c.current+=1;try{return await h()}finally{c.current-=1}},[c]),u=s.useMemo(()=>{const h=g=>le(a,g,x);return{getChildren:g=>{var w;return((w=p.getQueryData(h(g)))==null?void 0:w.entries)??[]},isLoaded:g=>p.getQueryData(h(g))!==void 0,takenNames:async g=>(await n.readFileTree(o,{path:g===Q?void 0:g,showHidden:!0})).entries.map(b=>b.name),snapshot:g=>p.getQueryData(h(g)),setChildren:(g,w)=>{p.setQueryData(h(g),b=>({entries:Ie(w((b==null?void 0:b.entries)??[]))}))},restore:(g,w)=>{p.setQueryData(h(g),w)},invalidate:g=>{p.invalidateQueries({queryKey:h(g),exact:!0})}}},[p,n,o,a,x]),N=s.useCallback((h,g,w)=>i(async()=>{const b=ee(h,g),S=!u.getChildren(h).some(A=>A.path===b),K=u.snapshot(h);S&&u.setChildren(h,A=>[...A,Ae(b,g,w)]);try{return await n.createEntry(o,b,w),!0}catch(A){return S&&u.restore(h,K),ae(A,`Couldn’t create ${w==="dir"?"folder":"file"}`),!1}finally{u.invalidate(h)}}),[n,o,u,i]),F=s.useCallback((h,g)=>i(async()=>{if(g===h.name||g.length===0)return!0;const w=G(h.path),b=ee(w,g),S=u.getChildren(w).some(_=>_.path===b),K=u.snapshot(w),A={...h,name:g,path:b};S||u.setChildren(w,_=>_.map($=>$.path===h.path?A:$));try{return await n.renameEntry(o,h.path,b),H.getState().remapExpandedPaths(h.path,b),!0}catch(_){return S||u.restore(w,K),ae(_,"Couldn’t rename"),!1}finally{u.invalidate(w)}}),[n,o,u,i]),D=s.useCallback(h=>i(async()=>{const g=G(h.path),w=u.snapshot(g);u.setChildren(g,b=>b.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path,{recursive:!0}),H.getState().dropExpandedPaths(h.path)}catch(b){u.restore(g,w),ae(b,"Couldn’t delete")}finally{u.invalidate(g)}}),[n,o,u,i]),L=s.useCallback(h=>i(async()=>{const g=G(h.path);if(h.type==="file"){const w=u.snapshot(g);u.setChildren(g,b=>b.filter(S=>S.path!==h.path));try{await n.deleteEntry(o,h.path),H.getState().dropExpandedPaths(h.path)}catch(b){u.restore(g,w),ae(b,"Couldn’t delete")}finally{u.invalidate(g)}return}try{await n.deleteEntry(o,h.path),u.setChildren(g,w=>w.filter(b=>b.path!==h.path)),H.getState().dropExpandedPaths(h.path),u.invalidate(g)}catch(w){if(Ut(w)==="DIR_NOT_EMPTY"){r(h);return}ae(w,"Couldn’t delete")}}),[n,o,u,i]),C=s.useCallback(async()=>{const h=m;r(null),h&&await D(h)},[m,D]),U=s.useCallback(()=>r(null),[]),I=s.useCallback((h,g)=>i(async()=>{const w=G(h),b=ie(h),S=ee(g,b);if(g===w||S===h||Ce(g,h))return;const K=u.getChildren(w).find(v=>v.path===h);if(!K)return;const A=u.isLoaded(g),_=A&&u.getChildren(g).some(v=>v.path===S),$={...K,name:b,path:S},Y=u.snapshot(w),O=A?u.snapshot(g):void 0;u.setChildren(w,v=>v.filter(z=>z.path!==h)),A&&!_&&u.setChildren(g,v=>[...v,$]);try{await n.renameEntry(o,h,S),H.getState().remapExpandedPaths(h,S)}catch(v){u.restore(w,Y),A&&!_&&u.restore(g,O),ae(v,"Couldn’t move")}finally{u.invalidate(w),A&&u.invalidate(g)}}),[n,o,u,i]),j=s.useCallback((h,g)=>i(async()=>{if(h.isDir&&Ce(g,h.path)){X.error(qt);return}let w;try{w=await u.takenNames(g)}catch(_){ae(_,"Couldn’t copy");return}const b=Pe({name:ie(h.path),isDir:h.isDir,taken:w}),S=ee(g,b),K=u.isLoaded(g),A=K?u.snapshot(g):void 0;if(K){const _=u.getChildren(G(h.path)).find(Y=>Y.path===h.path),$=_?{..._,name:b,path:S}:Ae(S,b,h.isDir?"dir":"file");u.setChildren(g,Y=>[...Y,$])}try{await n.copyEntry(o,h.path,S)}catch(_){K&&u.restore(g,A),ae(_,"Couldn’t copy")}finally{u.invalidate(g)}}),[n,o,u,i]);return{createEntry:N,renameEntry:F,removeEntry:L,moveEntry:I,copyEntry:j,pendingRecursiveDelete:m,confirmRecursiveDelete:C,cancelRecursiveDelete:U}}function dn(t){return t!=null&&t.startsWith("darwin")?"Reveal in Finder":t!=null&&t.startsWith("win32")?"Reveal in File Explorer":"Show in file manager"}function un(t,n){const a=t.includes("\\")&&!t.includes("/"),x=t.replace(/[\\/]+$/,""),p=a?n.split("/").join("\\"):n;return`${x}${a?"\\":"/"}${p}`}function fn(t){const n=ne(),{data:a}=it(),x=s.useMemo(()=>n.supportsReveal?dn(a==null?void 0:a.platform):null,[n.supportsReveal,a==null?void 0:a.platform]),p=s.useCallback(async i=>{if(t)try{await n.revealEntry(t,i.path)}catch(u){ae(u,"Couldn’t open the file manager")}},[n,t]),{copy:c}=lt(),o=s.useCallback(async(i,u)=>{const N=u==="absolute"&&t?un(t,i.path):i.path;await c(N)||X.error("Couldn’t copy to the clipboard")},[t,c]),m=s.useCallback(i=>{Vt(Zt(i.path))||X.error("Open a chat to add this file")},[]),r=s.useCallback(i=>{H.getState().setClipboard({path:i.path,isDir:i.type==="dir"});try{navigator.clipboard.writeText(i.path).catch(()=>{})}catch{}},[]);return{revealLabel:x,reveal:p,copyPath:o,addToChat:m,copyToClipboard:r}}const hn=1e3;function pn(t){const{source:n,showHidden:a,queryClient:x,inFlightRef:p}=t,c=n.changes,[o,m]=s.useState(null),[r,i]=s.useState(null),[u,N]=s.useState(null),[F,D]=s.useState(0),L=s.useCallback(async d=>{p.current+=1,D(f=>f+1);try{return await d()}finally{p.current-=1,D(f=>f-1)}},[p]),C=s.useMemo(()=>{const d=f=>le(n,f,a);return{listing:f=>x.getQueryData(d(f)),isLoaded:f=>x.getQueryData(d(f))!==void 0,entries:f=>{var T;return((T=x.getQueryData(d(f)))==null?void 0:T.entries)??[]},setEntries:(f,T)=>x.setQueryData(d(f),y=>({...y,entries:Ie(T((y==null?void 0:y.entries)??[]))})),restore:(f,T)=>x.setQueryData(d(f),T),fetch:f=>n.list(f,{showHidden:!0}),refreshAll:()=>{x.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),x.invalidateQueries({queryKey:["file-explorer","preview",n.scopeKey]})}}},[x,n,a]),U=s.useCallback(async d=>{const f=C.listing(d);return(f==null?void 0:f.commit)!==void 0?f.commit:(await C.fetch(d)).commit??null},[C]),I=s.useCallback((d,f,T,y)=>{switch(d.status){case"changed":return!0;case"conflict":return N({kind:f,path:d.path,lastCommit:d.lastCommit,retry:()=>T(d.commit)}),!1;case"exists":return X.error(y===void 0?d.reason:qe(y)),!1;case"refused":return X.error(d.reason),!1}},[]),j=s.useCallback((d,f)=>{X.error(Qe(d)??f)},[]),h=s.useCallback((d,f,T)=>{const y=P=>L(async()=>{if(c===void 0)return!1;const E=G(d.path),R=G(f),k=ie(f),q=C.isLoaded(R),te=q&&C.entries(R).some(Z=>Z.path===f),V=C.listing(E),de=R===E?void 0:C.listing(R),l={...d,name:k,path:f};te||(R===E?C.setEntries(E,Z=>Z.map(se=>se.path===d.path?l:se)):(C.setEntries(E,Z=>Z.filter(se=>se.path!==d.path)),q&&C.setEntries(R,Z=>[...Z,l])));const M=()=>{C.restore(E,V),R!==E&&q&&C.restore(R,de)};try{const Z=P??await U(E);if(Z===null)return M(),X.error("This room has no files to change yet."),!1;const se=await c.move({from:d.path,to:f,baseCommit:Z}),we=I(se,T,async re=>{await y(re)},k);return we?H.getState().remapExpandedPaths(d.path,f):M(),we}catch(Z){return M(),j(Z,T==="rename"?"Couldn’t rename":"Couldn’t move"),!1}finally{C.refreshAll()}});return y(null)},[c,C,L,U,I,j]),g=s.useCallback(async(d,f)=>f===d.name||f.length===0?!0:h(d,ee(G(d.path),f),"rename"),[h]),w=s.useCallback(async(d,f)=>{const T=G(d),y=ee(f,ie(d));if(f===T||y===d||Ce(f,d))return;const P=C.entries(T).find(E=>E.path===d);P&&await h(P,y,"move")},[C,h]),b=s.useCallback(async d=>{let f=0;const T=[d];for(;T.length>0;){const y=T.shift(),P=await C.fetch(y);for(const E of P.entries)if(E.type==="dir"?T.push(E.path):f+=1,f>=hn)return{count:f,moreThan:!0}}return{count:f,moreThan:!1}},[C]),S=s.useCallback(d=>{if(d.type!=="dir"){m({entry:d,fileCount:1,moreThan:!1});return}m({entry:d,fileCount:null,moreThan:!1}),b(d.path).then(({count:f,moreThan:T})=>m(y=>(y==null?void 0:y.entry.path)===d.path?{entry:d,fileCount:f,moreThan:T}:y),()=>{})},[b]),K=s.useCallback(d=>{const f=T=>L(async()=>{if(c===void 0)return;const y=G(d.path),P=C.listing(y);C.setEntries(y,E=>E.filter(R=>R.path!==d.path));try{const E=T??await U(y);if(E===null){C.restore(y,P);return}const R=await c.remove({path:d.path,baseCommit:E});I(R,"delete",q=>f(q))?H.getState().dropExpandedPaths(d.path):C.restore(y,P)}catch(E){C.restore(y,P),j(E,"Couldn’t delete")}finally{C.refreshAll()}});return f(null)},[c,C,L,U,I,j]),A=s.useCallback(async()=>{const d=o;m(null),d&&await K(d.entry)},[o,K]),_=s.useCallback(()=>m(null),[]),$=s.useCallback((d,f,T,y)=>{const P=E=>L(async()=>{if(c===void 0)return;const R=C.isLoaded(d),k=R?C.listing(d):void 0;if(R){const q=new Set(C.entries(d).map(V=>V.name)),te=f.filter(V=>!q.has(V.name)).map(V=>({name:V.name,path:ee(d,V.name),type:"file",size:V.size}));te.length>0&&C.setEntries(d,V=>[...V,...te])}try{const q=await c.upload({dir:d,baseCommit:E,replace:T,files:f});!I(q,"upload",V=>P(V))&&R&&C.restore(d,k)}catch(q){R&&C.restore(d,k),j(q,"Couldn’t upload")}finally{C.refreshAll()}});return P(y)},[c,C,L,I,j]),Y=s.useCallback(async(d,f)=>{if(c===void 0||f.length===0)return;if(f.length>c.maxUploadFiles){X.error(`Nothing was uploaded. One upload takes up to ${c.maxUploadFiles} files.`);return}let T;try{T=await C.fetch(d)}catch(k){j(k,"Couldn’t upload");return}const y=T.entries.map(k=>k.name),P=new Set(y),E=f.map(k=>k.name).filter(k=>P.has(k)),R=T.commit??null;if(E.length===0){await $(d,f,[],R);return}i({dir:d,files:f,names:E,taken:y,baseCommit:R})},[c,C,j,$]),O=s.useCallback(async d=>{const f=r;if(i(null),f===null)return;if(d==="replace"){await $(f.dir,f.files,f.names,f.baseCommit);return}const T=new Set([...f.taken,...f.files.map(E=>E.name)]),y=new Set(f.names),P=f.files.map(E=>{if(!y.has(E.name))return E;const R=Pe({name:E.name,isDir:!1,taken:T});return T.add(R),new File([E],R,{type:E.type,lastModified:E.lastModified})});await $(f.dir,P,[],f.baseCommit)},[r,$]),v=s.useCallback(()=>i(null),[]),z=s.useCallback(()=>N(null),[]),B=s.useMemo(()=>r===null?null:{dir:r.dir,names:r.names},[r]);return{renameEntry:g,moveEntry:w,requestDelete:S,pendingDelete:o,confirmDelete:A,cancelDelete:_,upload:Y,pendingClash:B,resolveClash:O,cancelClash:v,conflict:u,dismissConflict:z,busy:F>0}}const Le={scopeKey:"",cwd:null,writable:!1,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list:()=>Promise.resolve({entries:[]})};function mn(t){var d,f,T;const n=ne(),a=oe(),{setTheme:x}=ct(),p=H(y=>y.showHidden),c=H(y=>y.expanded),o=H(y=>y.loadExplorerForCwd),m=H(y=>y.pruneMissing),r=(t==null?void 0:t.scopeKey)??null,i=(t==null?void 0:t.cwd)??null;s.useEffect(()=>{o(r)},[r,o]);const u=s.useMemo(()=>[Q,...dt(c)],[c]),N=ut({queries:t?u.map(y=>je(t,y,p,a)):[]}),F=(t==null?void 0:t.filtersHidden)??!0,D=s.useMemo(()=>{const y={};return u.forEach((P,E)=>{var q;const R=N[E];let k=((q=R==null?void 0:R.data)==null?void 0:q.entries)??[];!p&&!F&&(k=nt(k)),P===Q&&(k=on(k)),y[P]={entries:k,loading:(R==null?void 0:R.isLoading)??!1,error:(R==null?void 0:R.isError)??!1}}),y},[u,N,p,F]),L=s.useRef(0),C=s.useRef({});s.useEffect(()=>{L.current>0||u.forEach((y,P)=>{var R,k,q;const E=(k=(R=N[P])==null?void 0:R.data)==null?void 0:k.entries;!E||(q=N[P])!=null&&q.isError||C.current[y]!==E&&(C.current[y]=E,m(y,E.map(te=>te.name)))})},[u,N,m]);const U=s.useMemo(()=>ft(c,D),[c,D]),I=!!t&&!!((d=D[Q])!=null&&d.loading),j=!!t&&!!((f=D[Q])!=null&&f.error),h=(T=N[0])==null?void 0:T.error,g=j&&h?Qt(h):void 0,w=(g==null?void 0:g.message)??null,b=(g==null?void 0:g.command)??null,S=s.useMemo(()=>{var P;const y=new Set;for(const E of u)E!==Q&&((P=D[E])!=null&&P.error)&&y.add(E);return y},[u,D]),K=s.useCallback(y=>{if(y.type!=="dir")return;const P=H.getState();P.setDirExpanded(y.path,!P.expanded[y.path])},[]),A=s.useCallback(y=>{if(y===Q)return;const P=H.getState();P.expanded[y]||P.setDirExpanded(y,!0)},[]),_=(t==null?void 0:t.preview)==="canvas",$=s.useCallback(y=>{if(y.type!=="file"||!_)return;const P={getStore:Te.getState,setTheme:x,supportsTerminal:n.supportsTerminal};ht(P,{action:"open_file",sourcePath:y.path},"user")},[_,x,n]),Y=s.useCallback(()=>{r!==null&&a.invalidateQueries({queryKey:["file-explorer","tree",r]})},[a,r]),O=s.useCallback(y=>{t!==null&&a.invalidateQueries({queryKey:le(t,y,p),exact:!0})},[a,t,p]);s.useEffect(()=>{if(t!=null&&t.events)return t.events(Y)},[t,Y]);const v=cn({source:t??Le,showHidden:p,queryClient:a,inFlightRef:L}),z=pn({source:t??Le,showHidden:p,queryClient:a,inFlightRef:L}),B=fn(i);return{rows:U,rootLoading:I,rootError:j,rootErrorMessage:w,rootErrorCommand:b,errorPaths:S,toggleExpand:K,ensureExpanded:A,openFile:$,reload:Y,retryDir:O,changes:t!=null&&t.changes?z:null,...v,...B}}function xn(t){const{transport:n,cwd:a}=t;return{scopeKey:a,cwd:a,writable:!0,provenance:!1,filtersHidden:!0,preview:"canvas",editable:!1,list(x,p){return n.readFileTree(a,{path:x===""?void 0:x,showHidden:p.showHidden})}}}function ke(t){return Array.from(t).includes("Files")}function st(t){const n=Array.from(t.items??[]);if(!(n.length>0&&n.every(c=>"webkitGetAsEntry"in c)))return{files:Array.from(t.files??[]),folders:0};const x=[];let p=0;for(const c of n){if(c.kind!=="file")continue;const o=c.webkitGetAsEntry();if(o!=null&&o.isDirectory){p+=1;continue}const m=c.getAsFile();m&&x.push(m)}return{files:x,folders:p}}const gn=12;function yn({row:t,selected:n,renaming:a,error:x,onSelect:p,onActivate:c,onRetry:o,onSubmitRename:m,onCancelRename:r,onNewFile:i,onNewFolder:u,onStartRename:N,onDelete:F,onMove:D,onCopyInto:L,onCopy:C,onPaste:U,onDuplicate:I,canPasteInto:j,revealLabel:h,onReveal:g,onAddToChat:w,onCopyPath:b,readOnly:S=!1,provenance:K=!1,copyable:A=!0,onDisk:_=!0,onUpload:$,onPickUpload:Y}){const{entry:O,depth:v,expanded:z,loading:B}=t,d=O.type==="dir",f=d?O.path:G(O.path),[T,y]=s.useState(!1),P=!d&&v===0&&Re(O.name),E=Bt(O.lastCommit),R=e.jsxs("div",{role:"treeitem","aria-label":O.name,"aria-expanded":d?z:void 0,"aria-selected":n,tabIndex:-1,onKeyDown:k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),p(O),c(O))},draggable:!a&&!S,onDragStart:k=>{S||(k.dataTransfer.setData("text/plain",O.path),k.dataTransfer.setData(Xt,O.path),k.dataTransfer.effectAllowed="copyMove")},onDragOver:k=>{if(k.stopPropagation(),!S&&$&&ke(k.dataTransfer.types)){k.preventDefault(),k.dataTransfer.dropEffect="copy",y(!0);return}S||!d||!We(k.dataTransfer.types)||(k.preventDefault(),k.dataTransfer.dropEffect=k.altKey&&A?"copy":"move",y(!0))},onDragLeave:()=>y(!1),onDrop:k=>{if(k.stopPropagation(),S)return;if(y(!1),$&&ke(k.dataTransfer.types)){k.preventDefault();const{files:te}=st(k.dataTransfer);$(f,te);return}if(!d)return;const q=Ye(k.dataTransfer);q!==null&&(k.preventDefault(),k.altKey&&A?L(q,O.path):D(q,O.path))},onClick:()=>{p(O),c(O)},className:Oe("flex w-full cursor-pointer items-center gap-1 py-1 pr-2 text-sm transition-colors",n?"bg-accent text-foreground":"hover:bg-accent/50",T&&"ring-ring/60 bg-accent ring-1"),style:{paddingLeft:v*gn+8},children:[e.jsx("span",{className:"flex size-4 flex-shrink-0 items-center justify-center",children:d&&(B?e.jsx(Fe,{size:"xs",className:"text-muted-foreground"}):x?e.jsx("button",{type:"button","aria-label":"Retry loading",title:"Couldn’t load. Retry",onClick:k=>{k.stopPropagation(),o()},className:"flex items-center justify-center",children:e.jsx(Ge,{className:"text-destructive size-3.5"})}):z?e.jsx(pt,{className:"text-muted-foreground size-3.5"}):e.jsx(Ke,{className:"text-muted-foreground size-3.5"}))}),d?z?e.jsx(mt,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):e.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):O.isSymlink===!0?e.jsx(en,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}):e.jsx(Ve,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),a?e.jsx(vn,{initialName:O.name,onSubmit:k=>m(O,k),onCancel:r}):e.jsx("span",{className:"min-w-0 flex-1 truncate",children:O.name}),P&&!a&&e.jsx(xt,{"aria-label":"Pinned to the top",className:"text-muted-foreground/60 size-3 flex-shrink-0"}),K&&!a&&e.jsx("span",{className:"text-muted-foreground/70 text-2xs max-w-[45%] flex-shrink-0 truncate tabular-nums",title:E.title??void 0,children:E.label})]});return S?R:e.jsxs(gt,{children:[e.jsx(yt,{asChild:!0,children:R}),e.jsxs(vt,{className:"w-52",children:[e.jsx(J,{movesFocus:!0,onClick:()=>i(f),children:"New file"}),e.jsx(J,{movesFocus:!0,onClick:()=>u(f),children:"New folder"}),Y&&e.jsx(J,{onClick:()=>Y(f),children:"Upload files…"}),_&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{}),h&&e.jsx(J,{onClick:()=>g(O),children:h}),e.jsx(J,{movesFocus:!0,onClick:()=>w(O),children:"Add to chat"})]}),A&&e.jsxs(e.Fragment,{children:[e.jsx(ue,{}),e.jsx(J,{onClick:()=>C(O),children:"Copy"}),e.jsx(J,{disabled:!j(f),onClick:()=>U(f),children:"Paste"}),e.jsx(J,{onClick:()=>I(O),children:"Duplicate"})]}),e.jsx(ue,{}),_?e.jsxs(e.Fragment,{children:[e.jsx(J,{onClick:()=>b(O,"absolute"),children:"Copy path"}),e.jsx(J,{onClick:()=>b(O,"relative"),children:"Copy relative path"})]}):e.jsx(J,{onClick:()=>b(O,"relative"),children:"Copy path"}),e.jsx(ue,{}),e.jsx(J,{movesFocus:!0,onClick:()=>N(O),children:"Rename"}),e.jsx(J,{variant:"destructive",onClick:()=>F(O),children:"Delete"})]})]})}function vn({initialName:t,onSubmit:n,onCancel:a}){const x=s.useRef(null),[p,c]=s.useState(t);s.useEffect(()=>{const m=x.current;if(!m)return;m.focus();const r=t.lastIndexOf(".");m.setSelectionRange(0,r>0?r:t.length)},[t]);const o=()=>{const m=p.trim();m&&m!==t?n(m):a()};return e.jsx("input",{ref:x,type:"text",value:p,"aria-label":"New name",onChange:m=>c(m.target.value),onClick:m=>m.stopPropagation(),onBlur:o,onKeyDown:m=>{m.stopPropagation(),m.key==="Enter"?o():m.key==="Escape"&&a()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})}const Cn=100,bn=28,kn=250;function jn(t){const{rows:n,selectedPath:a,renamingPath:x,errorPaths:p,onSelectPath:c,onRetryDir:o}=t,m=s.useRef(null),r=H(v=>v.setScrollTop),i=H(v=>v.scopeKey),u=s.useCallback(v=>v.type==="dir"?t.onToggle(v):t.onOpen(v),[t]),N=En(t,u),F=n.length>Cn,D=Jt({count:n.length,getScrollElement:()=>m.current,estimateSize:()=>bn,overscan:12,enabled:F}),L=s.useRef({scope:void 0,done:!1}),C=s.useRef(null);s.useLayoutEffect(()=>{const v=L.current;if(v.scope!==i&&(v.scope=i,v.done=!1),v.done||n.length===0)return;const z=m.current;if(!z)return;const B=H.getState().scrollTop;if(B<=0){v.done=!0;return}F?D.scrollToOffset(B):z.scrollTop=B,C.current=z.scrollTop,z.scrollTop>=B&&(v.done=!0)},[n.length,i,F,D]);const U=s.useRef(null),I=s.useRef(null),j=s.useCallback(()=>{const v=m.current;v&&v.scrollTop!==C.current&&(L.current.done=!0,U.current=v.scrollTop,I.current&&clearTimeout(I.current),I.current=setTimeout(()=>{I.current=null,U.current!==null&&r(U.current)},kn))},[r]);s.useEffect(()=>()=>{I.current&&clearTimeout(I.current),U.current!==null&&r(U.current)},[r]);const h=s.useRef(void 0);s.useEffect(()=>{var d,f;const v=h.current;if(h.current=a,v===void 0||a===v||a===null)return;const z=n.findIndex(T=>T.entry.path===a);if(z<0)return;const B=m.current;B&&(F?D.scrollToIndex(z,{align:"auto"}):(f=(d=B.querySelector(`[data-row-index="${z}"]`))==null?void 0:d.scrollIntoView)==null||f.call(d,{block:"nearest"}),C.current=B.scrollTop)},[a,n,F,D]);const[g,w]=s.useState(!1),{onCopyInto:b,onMove:S}=t,K=t.readOnly===!0,A=t.copyable!==!1,_=s.useCallback(v=>{K||!We(v.dataTransfer.types)||(v.preventDefault(),v.dataTransfer.dropEffect=v.altKey&&A?"copy":"move",w(!0))},[K,A]),$=s.useCallback((v,z)=>{const B=n.find(d=>d.entry.path===v);B&&b({path:v,isDir:B.entry.type==="dir"},z)},[n,b]),Y=s.useCallback(v=>{if(w(!1),K)return;const z=Ye(v.dataTransfer);z!==null&&(v.preventDefault(),v.altKey&&A?$(z,Q):S(z,Q))},[$,S,K,A]),O=v=>e.jsx(yn,{row:v,selected:v.entry.path===a,renaming:v.entry.path===x,error:v.entry.type==="dir"&&v.expanded&&p.has(v.entry.path),onSelect:z=>c(z.path),onActivate:u,onRetry:()=>o(v.entry.path),onSubmitRename:t.onSubmitRename,onCancelRename:t.onCancelRename,onStartRename:t.onStartRename,onNewFile:t.onNewFile,onNewFolder:t.onNewFolder,onDelete:t.onDelete,onMove:t.onMove,onCopyInto:$,onCopy:t.onCopy,onPaste:t.onPaste,onDuplicate:t.onDuplicate,canPasteInto:t.canPasteInto,revealLabel:t.revealLabel,onReveal:t.onReveal,onAddToChat:t.onAddToChat,onCopyPath:t.onCopyPath,readOnly:t.readOnly,provenance:t.provenance,copyable:t.copyable,onDisk:t.onDisk,onUpload:t.onUpload,onPickUpload:t.onPickUpload});return e.jsx("div",{ref:m,role:"tree","aria-label":"File explorer",tabIndex:0,onKeyDown:N,onScroll:j,onDragOver:_,onDragLeave:()=>w(!1),onDrop:Y,className:Oe("focus-visible:ring-ring h-full overflow-auto outline-none focus-visible:ring-1 focus-visible:ring-inset",g&&"ring-ring/60 bg-accent/30 ring-1 ring-inset"),children:F?e.jsx("div",{style:{height:D.getTotalSize()},className:"relative w-full",children:D.getVirtualItems().map(v=>e.jsx("div",{"data-row-index":v.index,className:"absolute top-0 left-0 w-full",style:{transform:`translateY(${v.start}px)`},children:O(n[v.index])},n[v.index].entry.path))}):n.map((v,z)=>e.jsx("div",{"data-row-index":z,children:O(v)},v.entry.path))})}function wn(t){return t?t.type==="dir"?t.path:G(t.path):Q}function En(t,n){const{rows:a,selectedPath:x,renamingPath:p,onSelectPath:c}=t;return s.useCallback(o=>{var i,u,N,F;if(p!==null)return;const m=a.findIndex(D=>D.entry.path===x),r=m>=0?a[m]:void 0;if(o.metaKey||o.ctrlKey){if(t.readOnly===!0||t.copyable===!1)return;const D=o.key.toLowerCase();if(D==="c"&&r){o.preventDefault(),t.onCopy(r.entry);return}if(D==="v"){o.preventDefault(),t.onPaste(wn(r==null?void 0:r.entry));return}return}switch(o.key){case"ArrowDown":o.preventDefault(),c(((i=a[Math.min(m+1,a.length-1)])==null?void 0:i.entry.path)??((u=a[0])==null?void 0:u.entry.path));break;case"ArrowUp":o.preventDefault(),c(((N=a[Math.max(m-1,0)])==null?void 0:N.entry.path)??((F=a[0])==null?void 0:F.entry.path));break;case"ArrowRight":(r==null?void 0:r.entry.type)==="dir"&&!r.expanded&&(o.preventDefault(),t.onToggle(r.entry));break;case"ArrowLeft":if(!r)break;if(o.preventDefault(),r.entry.type==="dir"&&r.expanded)t.onToggle(r.entry);else{const D=G(r.entry.path);D&&c(D)}break;case"Enter":r&&(o.preventDefault(),n(r.entry));break;case"F2":r&&t.readOnly!==!0&&(o.preventDefault(),t.onStartRename(r.entry));break;case"Delete":case"Backspace":r&&t.readOnly!==!0&&(o.preventDefault(),t.onDelete(r.entry));break}},[a,x,p,c,t,n])}const Dn={rename:"Rename it anyway",move:"Move it anyway",delete:"Delete it anyway",upload:"Upload mine over it"},Nn={rename:"nothing was renamed",move:"nothing was moved",delete:"nothing was deleted",upload:"nothing was uploaded"};function Rn(t){const{entry:n,fileCount:a,moreThan:x}=t;if(n.type!=="dir")return`“${n.name}” leaves the room’s files.`;const p=a===null?"everything in it":x?`the more than ${a.toLocaleString()} files in it`:a===1?"the 1 file in it":`the ${a.toLocaleString()} files in it`;return`“${n.name}” and ${p} leave the room’s files.`}const Sn="The room’s history keeps a copy. An agent can restore it.";function Tn({changes:t,onOpenTheirs:n,onReturnFocus:a}){var D;const x=L=>{L.preventDefault();const C=document.activeElement;C!==null&&C!==document.body||a()},{pendingDelete:p,pendingClash:c,conflict:o}=t,[m,r]=s.useState(p);p!==null&&p!==m&&r(p);const[i,u]=s.useState(c);c!==null&&c!==i&&u(c);const N=i===null?"":i.dir===Q?"The top folder":`“${i.dir}”`,F=(i==null?void 0:i.names.length)===1;return e.jsxs(e.Fragment,{children:[e.jsx(fe,{open:p!==null,onOpenChange:L=>!L&&t.cancelDelete(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:m===null?"":`Delete “${m.entry.name}”?`}),e.jsx(xe,{asChild:!0,children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{children:m===null?"":Rn(m)}),e.jsx("p",{children:Sn})]})})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.cancelDelete,children:"Cancel"}),e.jsx(ve,{onClick:()=>void t.confirmDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:(m==null?void 0:m.entry.type)==="dir"?"Delete folder":"Delete file"})]})]})}),e.jsx(fe,{open:c!==null,onOpenChange:L=>!L&&t.cancelClash(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:F?`Replace “${i==null?void 0:i.names[0]}”?`:`Replace ${(i==null?void 0:i.names.length)??0} files?`}),e.jsx(xe,{children:F?`${N} already has a file with this name. Replace it, or keep both.`:`${N} already has files named ${(i==null?void 0:i.names.join(", "))??""}. Replace them, or keep both.`})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.cancelClash,children:"Cancel"}),e.jsx(W,{variant:"outline",onClick:()=>void t.resolveClash("keep-both"),children:"Keep both"}),e.jsx(ve,{onClick:()=>void t.resolveClash("replace"),children:"Replace"})]})]})}),e.jsx(fe,{open:o!==null,onOpenChange:L=>!L&&t.dismissConflict(),children:e.jsxs(he,{onCloseAutoFocus:x,children:[e.jsxs(pe,{children:[e.jsx(me,{children:"Somebody changed this first"}),e.jsx(xe,{children:o===null?"":`${((D=o.lastCommit)==null?void 0:D.author)??"Somebody"} changed “${o.path}” after you opened it, so ${Nn[o.kind]}.`})]}),(o==null?void 0:o.lastCommit)&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:[o.lastCommit.subject," · ",Ct(o.lastCommit.at)]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:t.dismissConflict,children:"Cancel"}),e.jsx(W,{variant:"outline",onClick:()=>{o!==null&&(t.dismissConflict(),n(o.path))},children:"Open their version"}),e.jsx(ve,{onClick:()=>{o!==null&&(t.dismissConflict(),o.retry())},className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:o===null?"":Dn[o.kind]})]})]})})]})}function ze(t,n){return n.name===t?qe(t):`“${n.name}” is already there. Some computers ignore capital letters in names. Pick another name.`}const Fn="Folders can’t be uploaded. Drop the files inside instead.";function On({source:t,className:n,onCommands:a}={}){var de;const x=ne(),p=Te(l=>l.selectedCwd),c=s.useMemo(()=>p?xn({transport:x,cwd:p}):null,[x,p]),o=t===void 0?c:t,m=o!==null&&!o.writable,r=mn(o),i=r.changes,u=oe(),N=H(l=>l.showHidden),{rows:F,rootLoading:D,rootError:L,rootErrorMessage:C,rootErrorCommand:U,errorPaths:I}=r,j=H(l=>l.setCommands),h=H(l=>l.selectedPath),g=H(l=>l.setSelectedPath),w=H(l=>l.clipboard),[b,S]=s.useState(null),[K,A]=s.useState(null),[_,$]=s.useState(null),Y=s.useCallback(l=>$(l===null?null:{path:l,isNew:!1}),[]),O=s.useRef(null),v=s.useRef(Q),[z,B]=s.useState(!1),d=s.useCallback((l,M)=>{if(i!==null){if(M.length===0){X.error(Fn);return}r.ensureExpanded(l),i.upload(l,M)}},[i,r]),f=s.useRef(null),T=s.useCallback(()=>{var l,M;(M=(l=f.current)==null?void 0:l.querySelector('[role="tree"]'))==null||M.focus()},[]),y=s.useCallback(l=>{var M;v.current=l,(M=O.current)==null||M.click()},[]),P=s.useCallback(l=>w!==null&&!(w.isDir&&Ce(l,w.path)),[w]),E=s.useCallback((l,M)=>{r.ensureExpanded(l),_e.flushSync(()=>{A(null),S({parent:l,type:M})})},[r]),R=s.useCallback(l=>{_e.flushSync(()=>A(l.path))},[]),k=s.useRef({startCreate:E,reload:r.reload,pickUpload:y});s.useEffect(()=>{k.current={startCreate:E,reload:r.reload,pickUpload:y}});const q=i!==null;s.useEffect(()=>{if(m||a===void 0&&q)return;const l=a??j;return l({newFile:()=>k.current.startCreate(Q,"file"),newFolder:()=>k.current.startCreate(Q,"dir"),refresh:()=>k.current.reload(),...q&&{upload:()=>k.current.pickUpload(Q)}}),()=>l(null)},[j,a,m,q]);const te=s.useCallback(async l=>{var se;if(!b||o===null)return;const M=b;if(S(null),i!==null){const re=(((se=u.getQueryData(le(o,M.parent,N)))==null?void 0:se.entries)??[]).find(ot=>ot.name.toLowerCase()===l.toLowerCase());if(M.type==="dir"){if(re!==void 0&&!(re.type==="dir"&&re.name===l)){X.error(ze(l,re));return}S({parent:ee(M.parent,l),type:"file",firstInFolder:l});return}if(re!==void 0){X.error(ze(l,re));return}const rt=ee(M.parent,l);$({path:rt,isNew:!0});return}await r.createEntry(M.parent,l,M.type)&&g(ee(M.parent,l))},[b,o,i,u,N,r,g]),V=s.useCallback(async(l,M)=>{A(null),(i?await i.renameEntry(l,M):await r.renameEntry(l,M))&&g(ee(G(l.path),M))},[i,r,g]);return o===null?t!==void 0?null:e.jsx("div",{className:"text-muted-foreground flex h-full items-center justify-center p-6 text-center text-sm",children:"Pick a folder to see its files."}):e.jsxs("div",{ref:f,className:Oe("flex h-full flex-col",z&&"ring-ring/60 bg-accent/30 ring-1 ring-inset",n),onDragOver:l=>{i===null||!ke(l.dataTransfer.types)||(l.preventDefault(),l.dataTransfer.dropEffect="copy",B(!0))},onDragLeave:l=>{l.currentTarget.contains(l.relatedTarget)||B(!1)},onDrop:l=>{B(!1),!(i===null||!ke(l.dataTransfer.types))&&(l.preventDefault(),d(Q,st(l.dataTransfer).files))},children:[i!==null&&e.jsx("input",{ref:O,type:"file",multiple:!0,hidden:!0,"aria-hidden":!0,tabIndex:-1,"data-testid":"room-files-upload-input",onChange:l=>{const M=Array.from(l.target.files??[]);l.target.value="",d(v.current,M)}}),e.jsxs("div",{className:"min-h-0 flex-1",children:[b&&e.jsx(Pn,{type:b.type,firstInFolder:b.firstInFolder,onSubmit:l=>void te(l),onCancel:()=>S(null)},`${b.parent}:${b.type}:${b.firstInFolder??""}`),D&&F.length===0?e.jsx("div",{className:"flex h-20 items-center justify-center",children:e.jsx(Fe,{size:"md",className:"text-muted-foreground",label:"Loading files"})}):L&&F.length===0?e.jsxs("div",{className:"text-muted-foreground flex min-h-20 flex-col items-center justify-center gap-2 px-4 py-3 text-center text-xs [overflow-wrap:anywhere]",children:[e.jsx("span",{children:C??"Couldn’t load files."}),U!==null&&e.jsx("code",{"aria-label":"Command that removes the settings",className:"bg-muted text-foreground block w-full rounded px-2 py-1.5 text-left font-mono select-all",children:U}),e.jsxs(W,{variant:"outline",size:"xs",onClick:r.reload,children:[e.jsx(Ge,{}),"Retry"]})]}):F.length===0&&!b?e.jsx("div",{className:"text-muted-foreground/60 flex h-20 items-center justify-center px-4 text-center text-xs",children:i!==null?"No files yet. Drop files here, or use Upload.":"Empty folder"}):e.jsx(jn,{rows:F,selectedPath:h,renamingPath:K,errorPaths:I,onSelectPath:g,onToggle:r.toggleExpand,onOpen:l=>{o.preview==="inline"?Y(l.path):r.openFile(l)},onRetryDir:r.retryDir,onSubmitRename:(l,M)=>void V(l,M),onCancelRename:()=>A(null),onStartRename:R,onNewFile:l=>E(l,"file"),onNewFolder:l=>E(l,"dir"),onDelete:l=>i?i.requestDelete(l):void r.removeEntry(l),onMove:(l,M)=>void(i?i.moveEntry(l,M):r.moveEntry(l,M)),onCopyInto:(l,M)=>void r.copyEntry(l,M),onCopy:r.copyToClipboard,onPaste:l=>{w&&r.copyEntry(w,l)},onDuplicate:l=>void r.copyEntry({path:l.path,isDir:l.type==="dir"},G(l.path)),canPasteInto:P,readOnly:m,provenance:o.provenance,copyable:i===null,onDisk:o.cwd!==null,onUpload:i?d:void 0,onPickUpload:i?y:void 0,revealLabel:r.revealLabel,onReveal:l=>void r.reveal(l),onAddToChat:r.addToChat,onCopyPath:(l,M)=>void r.copyPath(l,M)})]}),o.preview==="inline"&&e.jsx(Yt,{source:o,path:(_==null?void 0:_.path)??null,isNew:(_==null?void 0:_.isNew)??!1,onCreated:()=>{_!==null&&($({path:_.path,isNew:!1}),g(_.path))},onClose:()=>$(null)}),i!==null&&e.jsx(Tn,{changes:i,onOpenTheirs:l=>Y(l),onReturnFocus:T}),e.jsx(fe,{open:r.pendingRecursiveDelete!==null,onOpenChange:l=>!l&&r.cancelRecursiveDelete(),children:e.jsxs(he,{children:[e.jsxs(pe,{children:[e.jsxs(me,{children:["Delete “",(de=r.pendingRecursiveDelete)==null?void 0:de.name,"”?"]}),e.jsx(xe,{children:"This folder isn’t empty. Everything inside is deleted. This can’t be undone."})]}),e.jsxs(ge,{children:[e.jsx(ye,{onClick:r.cancelRecursiveDelete,children:"Cancel"}),e.jsx(ve,{onClick:()=>void r.confirmRecursiveDelete(),className:"bg-destructive hover:bg-destructive/90 dark:bg-destructive/60 text-white",children:"Delete folder"})]})]})})]})}function Pn({type:t,firstInFolder:n,onSubmit:a,onCancel:x}){const p=s.useRef(null),[c,o]=s.useState("");s.useEffect(()=>{var i;(i=p.current)==null||i.focus()},[]);const m=()=>{const i=c.trim();i?a(i):x()},r=e.jsxs("div",{className:"flex items-center gap-1",children:[t==="dir"?e.jsx(be,{className:"size-(--size-icon-sm) flex-shrink-0 text-sky-500"}):e.jsx(Ve,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),e.jsx("input",{ref:p,type:"text",value:c,"aria-label":n!==void 0?`First file in ${n}`:t==="dir"?"New folder name":"New file name",placeholder:t==="dir"?"folder-name":"file-name",onChange:i=>o(i.target.value),onBlur:m,onKeyDown:i=>{i.key==="Enter"?m():i.key==="Escape"&&x()},className:"border-border bg-background min-w-0 flex-1 rounded border px-1 py-0 text-sm outline-none"})]});return n===void 0?e.jsx("div",{className:"px-3 py-1",children:r}):e.jsxs("div",{className:"space-y-1 px-3 py-1",children:[e.jsxs("p",{className:"text-muted-foreground flex min-w-0 items-center gap-1 text-xs",children:[e.jsx(be,{className:"size-(--size-icon-xs) flex-shrink-0 text-sky-500"}),e.jsx("span",{className:"truncate",children:n})]}),r,e.jsx("p",{className:"text-muted-foreground text-2xs",children:"Name its first file. The folder appears on save."})]})}function at(){const t=H(x=>x.showHidden),n=H(x=>x.setShowHidden),a=t?"Hide hidden files":"Show hidden files";return e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":a,title:a,onClick:()=>n(!t),children:t?e.jsx(bt,{className:"text-muted-foreground"}):e.jsx(kt,{className:"text-muted-foreground"})})}function Mn({cwd:t}){const n=ne(),{data:a}=ce({queryKey:["file-explorer","workspace",t],queryFn:()=>n.resolveWorkspace(t),staleTime:6e4});return a!=null&&a.branch?e.jsxs("span",{className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",title:`Workspace ${a.key} on ${a.branch}`,children:[e.jsx(Ze,{className:"size-3 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:a.branch})]}):null}function Jn(){const t=Te(a=>a.selectedCwd),n=H(a=>a.commands);return t?e.jsxs(e.Fragment,{children:[e.jsx(Mn,{cwd:t}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"New file",title:"New file",onClick:()=>n==null?void 0:n.newFile(),children:e.jsx(et,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"New folder",title:"New folder",onClick:()=>n==null?void 0:n.newFolder(),children:e.jsx(He,{className:"text-muted-foreground"})}),e.jsx(at,{}),e.jsx(W,{variant:"ghost",size:"icon-xs","aria-label":"Refresh",title:"Refresh",onClick:()=>n==null?void 0:n.refresh(),children:e.jsx(jt,{className:"text-muted-foreground"})})]}):null}function _n({roomId:t}){const n=ne(),a=oe(),x=ce(Ue(n,t));s.useEffect(()=>Wt(a,t,()=>{a.invalidateQueries({queryKey:De.repoStatus(t)})}),[a,t]);const p=s.useMemo(()=>{var r;return((r=x.data)==null?void 0:r.kind)==="ok"?wt(x.data.status):[]},[x.data]),c=Et(p),o=Dt(p);if(!o)return null;const m=p.map((r,i)=>`${c[i]}: ${Nt(r)}`);return e.jsxs("span",{"data-slot":"pending-work-badge",title:m.join(`
17
+ `),className:"text-muted-foreground bg-muted/50 text-2xs inline-flex min-w-0 items-center gap-1 rounded px-1.5 py-0.5",children:[e.jsx(Ze,{className:"size-3 flex-shrink-0"}),e.jsxs("span",{className:"sr-only",children:["Not merged into the room yet. ",m.join(". "),"."]}),e.jsx("span",{"aria-hidden":"true",className:"truncate",children:o})]})}const An={added:"added",modified:"changed",deleted:"deleted",untracked:"new"},Ln=new Map([["OPERATOR_ONLY","Only the owner of this DorkOS can keep or discard these."],["ROOM_FILE_NOT_FOUND","One of those changes is gone, so nothing was discarded. The list is refreshed."],["MERGE_IN_FLIGHT","Something else is writing to these files. Nothing changed. Try again in a moment."],["MAIN_CHECKOUT_DIRTY","These files are on another branch. Switch them back to main yourself."],["ROOM_REPO_GIT_UNAVAILABLE","Room files need git, and git isn’t installed on this computer."],["ROOM_HAS_NO_REPO","This room no longer has its own files."],["ROOM_REPOS_DISABLED","Room files are turned off on this install."]]);function zn({roomId:t}){var U,I;const n=ne(),a=oe(),x=ce(Ue(n,t)),[p,c]=s.useState([]),[o,m]=s.useState(!1),[r,i]=s.useState(null),u=Rt({mutationFn:j=>n.repairRoomMain(t,j),onSuccess:()=>{c([]),m(!1),i(null),a.invalidateQueries({queryKey:De.repoStatus(t)})},onError:j=>{m(!1);const h=Ln.get(St(j)??"");i(h??"Couldn’t update the files. Try again in a moment."),a.invalidateQueries({queryKey:De.repoStatus(t)})}});if(((U=x.data)==null?void 0:U.kind)==="unavailable")return e.jsx("p",{role:"alert","data-slot":"room-main-warning",className:"border-border/60 text-muted-foreground rounded-lg border px-3 py-2.5 text-xs",children:"Couldn’t check this room’s files. Saves may not work. Try again soon."});const N=((I=x.data)==null?void 0:I.kind)==="ok"?x.data.status.main:void 0;if(N===void 0||!N.dirty)return null;const F=N.branch!=="main",D=p.filter(j=>N.strays.some(h=>h.path===j)),L=o&&D.length>0,C=j=>c(h=>h.includes(j)?h.filter(g=>g!==j):[...h,j]);return e.jsxs("div",{"data-slot":"room-main-warning",className:"border-border/60 bg-muted/40 space-y-3 rounded-lg border px-3 py-2.5 text-sm",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsx(Tt,{className:"text-muted-foreground mt-0.5 size-(--size-icon-sm) flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsxs("div",{role:"alert",className:"space-y-1",children:[e.jsx("p",{className:"font-medium",children:"Somebody changed this room’s files outside DorkOS"}),F?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"text-muted-foreground text-xs",children:`This room’s files are on ${N.branch??"no branch"}, not main.`}),e.jsx("p",{className:"text-muted-foreground text-xs",children:"Saves and agent merges wait until they’re back on main."})]}):e.jsx("p",{className:"text-muted-foreground text-xs",children:"Saves and agent merges wait until you keep or discard these."})]}),F&&e.jsx(tn,{className:"text-xs",children:e.jsx("p",{children:"DorkOS won’t switch the branch for you. There may be work on it."})})]})]}),!F&&e.jsxs(e.Fragment,{children:[e.jsx("ul",{className:"space-y-1.5",children:N.strays.map(j=>e.jsxs("li",{className:"flex items-center gap-2",children:[e.jsx(Ft,{id:`stray-${t}-${j.path}`,checked:D.includes(j.path),onCheckedChange:()=>C(j.path),disabled:u.isPending}),e.jsx("label",{htmlFor:`stray-${t}-${j.path}`,className:"min-w-0 flex-1 cursor-pointer truncate font-mono text-xs",title:j.path,children:j.path}),e.jsx("span",{className:"text-muted-foreground flex-shrink-0 text-xs",children:An[j.kind]})]},j.path))}),N.strayCount>N.strays.length&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["…and ",N.strayCount-N.strays.length," more not shown. “Keep them all” keeps these too."]}),L?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs",children:D.length===1?"Discard this change? It can’t be undone.":`Discard these ${D.length} changes? They can’t be undone.`}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(W,{type:"button",variant:"ghost",size:"sm",disabled:u.isPending,onClick:()=>m(!1),children:"Cancel"}),e.jsx(W,{type:"button",variant:"destructive",size:"sm",disabled:u.isPending,onClick:()=>u.mutate({action:"discard",paths:[...D]}),children:D.length===1?"Discard change":`Discard ${D.length} changes`})]})]}):e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(W,{type:"button",variant:"outline",size:"sm",disabled:u.isPending,onClick:()=>u.mutate({action:"commit"}),children:"Keep them all"}),e.jsx(W,{type:"button",variant:"ghost",size:"sm",disabled:u.isPending||D.length===0,onClick:()=>m(!0),children:D.length===0?"Discard…":`Discard ${D.length}`})]})]}),r!==null&&e.jsx("p",{role:"alert",className:"text-destructive text-xs",children:r})]})}const Ee="pointer-coarse:size-11";function Xn({roomId:t,canChange:n}){const a=ne(),x=oe(),p=H(F=>F.showHidden),[c,o]=s.useState(null),m=s.useMemo(()=>Be({transport:a,queryClient:x,roomId:t,canChange:n}),[a,x,t,n]),r=ce(je(m,Q,p,x)),i=r.isSuccess&&r.data.absent!==!0||r.isError,[u,N]=s.useState(null);return i&&u!==t&&N(t),!i&&u!==t?null:e.jsxs("section",{"aria-label":"Room files",className:"space-y-2",children:[e.jsxs("header",{className:"flex items-center gap-2",children:[e.jsx(Ot,{className:"text-muted-foreground size-(--size-icon-sm) flex-shrink-0"}),e.jsx("h3",{className:"text-muted-foreground text-xs font-medium tracking-wide uppercase",children:"Files"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(_n,{roomId:t})}),n&&e.jsxs(e.Fragment,{children:[e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New file",title:"New file",disabled:c===null,onClick:()=>c==null?void 0:c.newFile(),children:e.jsx(et,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"New folder",title:"New folder",disabled:c===null,onClick:()=>c==null?void 0:c.newFolder(),children:e.jsx(He,{className:"text-muted-foreground"})}),e.jsx(W,{variant:"ghost",size:"icon-xs",className:Ee,"aria-label":"Upload files",title:"Upload files",disabled:(c==null?void 0:c.upload)===void 0,onClick:()=>{var F;return(F=c==null?void 0:c.upload)==null?void 0:F.call(c)},children:e.jsx(sn,{className:"text-muted-foreground"})})]}),e.jsx(at,{})]}),e.jsx(zn,{roomId:t}),e.jsx("div",{"data-slot":"room-files-body",className:"border-border/60 h-72 overflow-hidden rounded-lg border",children:e.jsx(On,{source:m,onCommands:o})})]})}function es({roomId:t,attachment:n}){var i;const a=ne(),x=oe(),p=s.useMemo(()=>Be({transport:a,queryClient:x,roomId:t}),[a,x,t]),c=ce(je(p,Q,!1,x)),[o,m]=s.useState(!1),r=Pt(t);return!c.isSuccess||c.data.absent===!0||((i=r.data)==null?void 0:i.archived)!==!1?null:e.jsxs(e.Fragment,{children:[e.jsx(W,{type:"button",variant:"ghost",size:"icon-xs","aria-label":`Save ${n.name} to the room’s files`,title:"Save to room files",className:"text-muted-foreground hover:text-foreground mt-0.5 pointer-coarse:size-11",onClick:()=>m(!0),children:e.jsx(Mt,{})}),o&&e.jsx($n,{roomId:t,source:p,attachment:n,onClose:()=>m(!1)})]})}function $n({roomId:t,source:n,attachment:a,onClose:x}){const p=ne(),c=oe(),[o,m]=s.useState(Q),[r,i]=s.useState(a.name),[u,N]=s.useState(null),[F,D]=s.useState(!1),L=s.useId(),C=ce(je(n,o,!1,c)),U=s.useMemo(()=>{var j;return nt(((j=C.data)==null?void 0:j.entries)??[]).filter(h=>h.type==="dir")},[C.data]),I=async()=>{var h,g;const j=r.trim();if(j!==""){D(!0),N(null);try{await p.saveAttachmentToRoomFiles(t,{attachmentId:a.id,dir:o,name:j,baseCommit:((h=C.data)==null?void 0:h.commit)??null}),c.invalidateQueries({queryKey:["file-explorer","tree",n.scopeKey]}),X.success(`Saved ${j} to the room’s files`),x()}catch(w){let b;try{b=Gt(w,c,t)}catch{b={status:"refused",reason:Qe(w)??"Couldn’t save. Try again in a moment."}}if(b.status==="exists"){const S=(((g=C.data)==null?void 0:g.entries)??[]).map(K=>K.name);N({reason:`This folder already has a file called “${j}”. Pick another name.`,suggestion:Pe({name:j,isDir:!1,taken:[...S,j]})})}else b.status==="conflict"?(N({reason:"This folder changed while you chose, so nothing was saved. Try again."}),C.refetch()):b.status==="refused"&&N({reason:b.reason})}finally{D(!1)}}};return e.jsx(_t,{open:!0,onOpenChange:j=>!j&&x(),children:e.jsxs(At,{className:"sm:max-w-md",children:[e.jsxs(Lt,{children:[e.jsx(zt,{children:"Save to room files"}),e.jsx($t,{children:"Everyone in the room, and their agents, can find it there."})]}),e.jsxs(It,{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-muted-foreground text-xs font-medium",children:"Folder"}),e.jsxs("div",{role:"group","aria-label":"Folders",className:"border-border/60 max-h-56 overflow-auto rounded-md border",children:[e.jsx("p",{className:"bg-muted/40 truncate px-3 py-1.5 font-mono text-xs",children:o===Q?"Top folder":`${o}/`}),o!==Q&&e.jsx($e,{label:"Up one folder",icon:e.jsx(nn,{className:"text-muted-foreground size-(--size-icon-sm)"}),onClick:()=>m(G(o))}),C.isPending?e.jsx("div",{className:"flex h-12 items-center justify-center",children:e.jsx(Fe,{size:"sm",className:"text-muted-foreground",label:"Loading folders"})}):U.length===0?e.jsx("p",{className:"text-muted-foreground px-3 py-2 text-xs",children:"No folders in here."}):U.map(j=>e.jsx($e,{label:j.name,icon:e.jsx(be,{className:"size-(--size-icon-sm) text-sky-500"}),chevron:!0,onClick:()=>m(ee(o,ie(j.path)))},j.path))]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:L,className:"text-muted-foreground text-xs font-medium",children:"Name"}),e.jsx(Kt,{id:L,value:r,onChange:j=>{i(j.target.value),N(null)},spellCheck:!1,autoComplete:"off"})]}),u!==null&&e.jsxs("div",{role:"alert",className:"text-destructive space-y-1 text-xs",children:[e.jsx("p",{children:u.reason}),u.suggestion!==void 0&&e.jsxs(W,{type:"button",variant:"outline",size:"xs",onClick:()=>{i(u.suggestion),N(null)},children:["Use “",u.suggestion,"”"]})]})]}),e.jsxs(Ht,{className:"gap-2",children:[e.jsx(W,{type:"button",variant:"ghost",onClick:x,children:"Cancel"}),e.jsx(W,{type:"button",disabled:F||r.trim()===""||C.isPending,onClick:()=>void I(),children:F?"Saving…":o===Q?"Save to the top folder":`Save to ${ie(o)}`})]})]})})}function $e({label:t,icon:n,chevron:a=!1,onClick:x}){return e.jsxs("button",{type:"button",onClick:x,className:"hover:bg-accent/50 focus-visible:bg-accent flex w-full items-center gap-2 px-3 py-1.5 text-left text-sm outline-none",children:[n,e.jsx("span",{className:"min-w-0 flex-1 truncate",children:t}),a&&e.jsx(Ke,{className:"text-muted-foreground size-3.5"})]})}export{On as FileExplorer,Jn as FileExplorerActions,Yt as FilePreviewDialog,an as HIDDEN_ENTRY_NAMES,at as HiddenEntriesToggle,ss as NO_PROVENANCE,Ne as PINNED_ENTRY_NAMES,as as ROOM_FILES_REFRESH_INTERVAL_MS,Xn as RoomFilesSection,es as SaveToRoomFilesButton,Be as createRoomFilesSource,xn as createSessionCwdSource,le as explorerDirQueryKey,je as explorerDirQueryOptions,rn as isHiddenEntryName,Re as isPinnedEntryName,on as pinnedFirst,Bt as provenanceLine,Ue as roomRepoStatusQueryOptions,nt as withoutHidden};
@@ -0,0 +1 @@
1
+ import{eH as W,j as e,eI as J,eJ as Z,eK as E,eL as ee,eM as z,cB as se,eN as te,r as O,ar as A,eO as D,H as V,aY as U,X as ne,eP as ae,eQ as ie,eR as re,eS as oe,B as C,f as de,eT as le,eU as X,eV as ce,eW as G,a7 as me,bj as ue,eX as xe,eY as he,eZ as ge,e_ as pe,e$ as fe,f0 as je,$ as ve,Q as I,f1 as M,f2 as Ne,f3 as be,a5 as T,a6 as we,f4 as ye,f5 as Se,f6 as ke,f7 as Ee,f8 as Ce,f9 as $e,fa as Pe,fb as B,dE as Te,ae as S,fc as Re,fd as F}from"./index-CdKpQ1hI.js";import{fe as ms,ff as us,fg as xs,fh as hs,fi as gs,fj as ps}from"./index-CdKpQ1hI.js";import{u as _e}from"./use-deep-link-scroll-BV2fY4gy.js";import{M as K}from"./more-details-C6UGVeDE.js";import{C as Ae}from"./card-BqN3lfJn.js";import{u as De,a as Ie}from"./use-panel-tab-placements-Db6p2vLD.js";import{C as Le,a as Oe,b as ze,c as Me,d as R,e as _}from"./command-ZTLTCj0l.js";import{F as q}from"./file-text-BYq_4IAt.js";import{S as Be}from"./shield-check-Bp58y9u7.js";const Fe=["server_crashed","server_out_of_memory","server_unresponsive","isolation_unavailable","server_start_failed","server_start_timeout"],He={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 L(s){return Fe.includes(s)}function Ye(s,r){return L(s)?He[s](r):null}function Ve(s){return`Restarting ${s}…`}function Ue({extensionId:s}){const r=W("right-panel").filter(d=>d.extensionId===s);return r.length===0?null:e.jsx("div",{className:"space-y-3 pt-1","data-testid":`panel-tab-placement-${s}`,children:r.map(d=>e.jsx(Ge,{tab:d,labelled:r.length>1},d.id))})}function Xe(){var d;const s=(d=se().data)==null?void 0:d.agents,r=te().data;return O.useMemo(()=>{const l=new Map((s??[]).map(a=>[a.id,A(a)])),c=new Map((r??[]).map(a=>[a.id,D(a)]));return{agents:s??[],rooms:r??[],agentNames:l,roomNames:c}},[s,r])}function Ge({tab:s,labelled:r}){const d=J(De(),s.id),{setPlacement:l}=Ie(),c=Xe(),a=Z(d,s.declaredPlacement),g=a.show.pages.includes(E),o=t=>l(s.id,{show:t.show,hide:t.hide}),m=t=>t.kind==="agents"?c.agentNames.get(t.id)??"An agent that is gone":t.kind==="rooms"?c.roomNames.get(t.id)??"A channel that is gone":ae(t.id),j=(t,u)=>["agents","rooms","pages"].flatMap(v=>t[v].filter(i=>u||i!==E).map(i=>({kind:v,id:i}))),n=(t,u)=>({...t,[u.kind]:t[u.kind].filter(v=>v!==u.id)}),p=j(a.show,!1),N=j(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:r?`${s.title} tab shows`:"Panel tab shows"}),e.jsxs(ee,{value:g?"everywhere":"only",onValueChange:t=>o({hide:a.hide,show:t==="everywhere"?{...a.show,pages:[E]}:{...a.show,pages:a.show.pages.filter(u=>u!==E)}}),"aria-label":`Where the ${s.title} tab shows`,children:[e.jsx(z,{value:"everywhere",children:"Everywhere"}),e.jsx(z,{value:"only",children:"Only in…"})]}),d&&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"})]}),!g&&e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.map(t=>e.jsx(H,{place:t,name:m(t),removeLabel:`Remove ${m(t)}`,onRemove:()=>o({...a,show:n(a.show,t)})},`${t.kind}:${t.id}`)),e.jsx(qe,{tabTitle:s.title,names:c,taken:a.show,onAdd:t=>o({show:{...a.show,[t.kind]:[...a.show[t.kind],t.id]},hide:n(a.hide,t)})}),p.length===0&&e.jsx("span",{className:"text-muted-foreground text-xs",children:"Shows nowhere yet. Add a place."})]}),N.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"}),N.map(t=>e.jsx(H,{place:t,name:m(t),removeLabel:`Show in ${m(t)} again`,onRemove:()=>o({...a,hide:n(a.hide,t)})},`${t.kind}:${t.id}`))]})]})}const Ke={agents:U,rooms:V,pages:q};function H({place:s,name:r,removeLabel:d,onRemove:l}){const c=Ke[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(c,{className:"text-muted-foreground size-3","aria-hidden":!0}),e.jsx("span",{className:"max-w-40 truncate",children:r}),e.jsx("button",{type:"button",onClick:l,"aria-label":d,className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm p-0.5",children:e.jsx(ne,{className:"size-3"})})]})}function qe({tabTitle:s,names:r,taken:d,onAdd:l}){const[c,a]=O.useState(!1),g=n=>{l(n),a(!1)},o=ie.filter(n=>!d.pages.includes(n.key)),m=r.agents.filter(n=>!d.agents.includes(n.id)),j=r.rooms.filter(n=>!d.rooms.includes(n.id));return e.jsxs(re,{open:c,onOpenChange:a,children:[e.jsx(oe,{asChild:!0,children:e.jsxs(C,{variant:"ghost",size:"sm",className:"h-6 px-1.5 text-xs","aria-label":`Add a place for the ${s} tab`,children:[e.jsx(de,{className:"size-3"}),"Add"]})}),e.jsx(le,{align:"start",className:"w-64 p-0",children:e.jsxs(Le,{children:[e.jsx(Oe,{placeholder:"Find an agent, channel or page"}),e.jsxs(ze,{className:"max-h-64",children:[e.jsx(Me,{children:"Nothing matches."}),m.length>0&&e.jsx(R,{heading:"Agents",children:m.map(n=>e.jsxs(_,{value:`agent ${A(n)} ${n.id}`,onSelect:()=>g({kind:"agents",id:n.id}),children:[e.jsx(U,{className:"size-3.5"}),A(n)]},n.id))}),j.length>0&&e.jsx(R,{heading:"Channels and DMs",children:j.map(n=>e.jsxs(_,{value:`room ${D(n)} ${n.id}`,onSelect:()=>g({kind:"rooms",id:n.id}),children:[e.jsx(V,{className:"size-3.5"}),D(n)]},n.id))}),o.length>0&&e.jsx(R,{heading:"Pages",children:o.map(n=>e.jsxs(_,{value:`page ${n.label}`,onSelect:()=>g({kind:"pages",id:n.key}),children:[e.jsx(q,{className:"size-3.5"}),n.label]},n.key))})]})]})})]})}const Qe=new Set(["disabled","discovered","incompatible","invalid"]),We="/marketplace?view=installed";function Je({extension:s,onToggle:r,isToggling:d,onSetRunApproval:l,isSettingApproval:c,onReload:a,isReloading:g}){const{manifest:o,status:m,scope:j,error:n,serverError:p,origin:N,approvedToRun:t}=s,[u,v]=O.useState(!1),i=!Qe.has(m),x=m==="incompatible",b=m==="invalid",h=m==="compile_error"||m==="activate_error",y=!x&&!b,f=!(N==="core"&&o.canDisable===!1),k=s.hasServerEntry||s.hasDataProxy,w=X(s),Q=ce(s.id,G(w)),$=h?"Not working":x?"Incompatible":b?"Can’t load":null;return e.jsx(Ae,{"data-slot":"extension-card","data-testid":`extension-card-${s.id}`,"data-section":s.id,radius:"lg",gap:"none",className:I(h&&"border-amber-500/50",(x||b)&&"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:[h&&e.jsx(me,{className:"text-status-warning-dot size-4 shrink-0","aria-hidden":"true"}),(x||b)&&!h&&e.jsx(ue,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),!h&&!x&&!b&&e.jsx(xe,{className:"text-muted-foreground size-4 shrink-0","aria-hidden":"true"}),e.jsx("span",{className:"font-medium",children:o.name}),e.jsxs("span",{className:"text-muted-foreground text-sm",children:["v",o.version]}),s.devLink&&e.jsx(he,{})]}),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(ge,{path:s.devLink.path,className:"min-w-0"}),e.jsx("button",{type:"button",onClick:()=>void pe(We),className:"text-muted-foreground hover:text-foreground focus-ring rounded-sm text-xs underline underline-offset-2",children:"Unlink or switch"})]}),o.description&&e.jsx("p",{className:"text-muted-foreground text-sm",children:o.description}),e.jsx(fe,{gifts:je(s),"data-testid":`extension-agent-gifts-${s.id}`}),i&&e.jsx(Ue,{extensionId:s.id}),x&&o.minHostVersion&&e.jsxs("p",{className:"text-muted-foreground text-sm",children:["Needs DorkOS ",o.minHostVersion," or newer"]}),h&&n&&e.jsxs("div",{className:"space-y-1",children:[e.jsxs("p",{className:"text-status-warning-fg text-sm",children:[m==="compile_error"?"Couldn’t build: ":"Couldn’t start: ",n.message]}),n.details&&e.jsxs("button",{type:"button",onClick:()=>v(P=>!P),className:"text-muted-foreground hover:text-foreground flex items-center gap-1 text-xs transition-colors","aria-expanded":u,children:[e.jsx(ve,{className:I("size-3 transition-transform",u&&"rotate-180")}),u?"Hide details":"Show details"]}),u&&n.details&&e.jsx("pre",{className:"bg-muted mt-1 max-h-32 overflow-auto rounded-md p-2 text-xs",children:n.details})]}),p&&L(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||Ye(p.code,o.name)}),e.jsx("button",{type:"button",onClick:a,disabled:g,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:Ve(o.name)}),p&&!L(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."]}),N==="user"&&(t?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(Be,{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:c,className:"hover:text-foreground underline underline-offset-2 disabled:opacity-50",children:"Stop it"}),e.jsx(M,{permissions:w,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(M,{permissions:w,added:Q,"data-testid":`extension-permissions-${s.id}`}),e.jsx("p",{className:"text-muted-foreground text-sm",children:Ne(k,(w==null?void 0:w.runtime)==="subprocess")}),e.jsx("p",{className:"text-muted-foreground text-sm",children:be}),e.jsx(C,{size:"sm",onClick:()=>l(s.id,!0),disabled:c,"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(T,{variant:"outline",children:j}),$&&e.jsx(T,{variant:$==="Not working"?"destructive":"secondary","data-testid":`extension-health-${s.id}`,children:$}),o.author&&e.jsx("span",{children:o.author})]})]}),e.jsx("div",{className:"flex shrink-0 items-center pt-0.5",children:f?e.jsx(we,{checked:i,onCheckedChange:P=>r(s.id,P),disabled:!y||d,"aria-label":`${i?"Disable":"Enable"} ${o.name}`}):e.jsx(T,{variant:"secondary",title:"This extension is always on","data-testid":`extension-required-${s.id}`,children:"Required"})})]})})}function Y(s){const r=new Date(s);return Number.isNaN(r.getTime())?"":r.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})}function Ze(){const{data:s=[]}=ye(),{stop:r,pendingSource:d}=Se();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(K,{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:c})=>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}),Y(c)&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:["Trusted ",Y(c)]})]}),e.jsx(C,{type:"button",variant:"outline",size:"sm",disabled:d===l,onClick:()=>r(l),children:"Stop trusting"})]},l))})]})}function ds(){const{data:s=[],isLoading:r}=ke(),{section:d}=Ee();_e(r?null:d);const l=Ce(),c=$e(),a=Pe(),g=B(!0),o=B(!1),m=new Set([...l.variables?[l.variables]:[],...c.variables?[c.variables]:[]]),j=new Set([...g.isPending&&g.variables?[g.variables.id]:[],...o.isPending&&o.variables?[o.variables.id]:[]]);function n(i,x){const b=x?g:o,h=s.find(f=>f.id===i);if(!h)return;const y=x?G(X(h)):void 0;b.mutate({id:i,version:h.manifest.version,plugin:h.sourcePlugin??null,...y?{permissions:y}:{}},{onSuccess:f=>{x&&F.getState().forget(i);const k=f.extension.manifest.name,w=f.extension.isolation?"":" inside DorkOS";S.success(x?`${k} can now run${w}`:`${k} stopped running`)},onError:f=>{if(f instanceof Re&&f.stale){y&&F.getState().remember(i,y),S.error(`${h.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:f.message})}})}async function p(i,x){(x?l:c).mutate(i,{onError:h=>{S.error(x?"Couldn’t turn that on.":"Couldn’t turn that off.",{description:h.message})}})}function N(){a.mutate(void 0,{onSuccess:i=>{S.success(`Reloaded ${i.length} extension${i.length===1?"":"s"}`)},onError:i=>{S.error("Couldn’t reload your extensions.",{description:i.message})}})}if(r)return e.jsx("div",{className:"text-muted-foreground py-8 text-center text-sm",children:"Loading extensions…"});const t=s.filter(i=>i.origin==="core"),u=s.filter(i=>i.origin==="user"),v=i=>e.jsx(Je,{extension:i,onToggle:p,isToggling:m.has(i.id),onSetRunApproval:n,isSettingApproval:j.has(i.id),onReload:N,isReloading:a.isPending},i.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(K,{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:[t.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:t.map(v)})]}),e.jsxs("section",{className:"space-y-3","data-testid":"installed-extensions-section",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Installed extensions"}),u.length>0?e.jsx("div",{className:"space-y-3",children:u.map(v)}):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(Ze,{}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(C,{variant:"outline",size:"sm",onClick:N,disabled:a.isPending,"data-testid":"reload-extensions-button",children:[e.jsx(Te,{className:I("mr-2 size-4",a.isPending&&"animate-spin")}),"Reload extensions"]})})]})}export{ms as ExtensionEventBridge,us as ExtensionLoader,xs as ExtensionProvider,ds as ExtensionsSettingsTab,hs as createExtensionAPI,gs as createExtensionEventBridge,ps as useExtensions};