@inkeep/open-knowledge 0.53.1 → 0.53.2

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 (225) hide show
  1. package/dist/{acp-harness-probe-CwhklR1t.mjs → acp-harness-probe-BnGJfP5G.mjs} +2 -2
  2. package/dist/assets/skills/project/references/linking.md +1 -1
  3. package/dist/cli.mjs +62 -62
  4. package/dist/constants-CibuukV7.mjs +2 -0
  5. package/dist/git-handle-CEoe8TIl.mjs +1 -0
  6. package/dist/{git-handle-CH1DpBYP.mjs → git-handle-VuHcNtS4.mjs} +2 -2
  7. package/dist/index.mjs +173 -173
  8. package/dist/{init-DryQvpzo.mjs → init-BbAtilzZ.mjs} +4 -4
  9. package/dist/init-OoQjBgC9.mjs +1 -0
  10. package/dist/{launch-json-removal-C04K7xd0.mjs → launch-json-removal-DfpCmQT9.mjs} +2 -2
  11. package/dist/{loader-DAyo63Sq.mjs → loader-BOUyv05v.mjs} +2 -2
  12. package/dist/loader-P0nrGvJv.mjs +1 -0
  13. package/dist/md-manager-45eVlaBq.mjs +2 -0
  14. package/dist/{open-browser-DF0vEOcg.mjs → open-browser-BA50pLLQ.mjs} +2 -2
  15. package/dist/parse-worker.mjs +1 -1
  16. package/dist/preview-D2AT6aBO.mjs +1 -0
  17. package/dist/{preview-Dvl3K5Z6.mjs → preview-DoBitDZ-.mjs} +2 -2
  18. package/dist/public/assets/{ActivityModeContent-rgEhhGgw.js → ActivityModeContent-BmQRzJZw.js} +1 -1
  19. package/dist/public/assets/{AgentDiffPane-DtG18o1u.js → AgentDiffPane-DCXp5E1P.js} +1 -1
  20. package/dist/public/assets/{AgentThreadClientBinder-DkD2M_dd.js → AgentThreadClientBinder-B7pwGsKU.js} +1 -1
  21. package/dist/public/assets/{BugReportHistory-C59fSH13.js → BugReportHistory-CDRTpJV0.js} +1 -1
  22. package/dist/public/assets/{BugReportHistoryDialog-C2b4xA3d.js → BugReportHistoryDialog--YdGm_GJ.js} +1 -1
  23. package/dist/public/assets/{ChangedOutsideBadge-DdpCQcxq.js → ChangedOutsideBadge-J6l1plFR.js} +1 -1
  24. package/dist/public/assets/CodeMirrorPropInput-DiDkBTg6.js +3 -0
  25. package/dist/public/assets/{ConfigSharingInfoTooltip-4T5uhyyt.js → ConfigSharingInfoTooltip-CuqrTakc.js} +1 -1
  26. package/dist/public/assets/{ConsentDialogBody-DfhGpXdb.js → ConsentDialogBody-CmMu4IpT.js} +1 -1
  27. package/dist/public/assets/{DiffView-C-imhjB8.js → DiffView-BcZip7m3.js} +1 -1
  28. package/dist/public/assets/DocumentContext-J495RUh0.js +38 -0
  29. package/dist/public/assets/{EditorModeToggle-CrnEz11k.js → EditorModeToggle-BsFjeEn4.js} +1 -1
  30. package/dist/public/assets/{EnableSyncConfirmDialog-623sSYbd.js → EnableSyncConfirmDialog-DNDI39lu.js} +1 -1
  31. package/dist/public/assets/FeedbackForm-BwQovorQ.js +1 -0
  32. package/dist/public/assets/{GraphPanel-C-3KrSdC.js → GraphPanel-CsRKre3D.js} +1 -1
  33. package/dist/public/assets/{ImportSkillDialog-B7gKx_GY.js → ImportSkillDialog-DNZi7-O6.js} +1 -1
  34. package/dist/public/assets/{LintConfigEditor-B-XaVu0m.js → LintConfigEditor-nq2Ekm-O.js} +1 -1
  35. package/dist/public/assets/{ManagedArtifactProperties-iclZPRJv.js → ManagedArtifactProperties-CeSsPfJA.js} +1 -1
  36. package/dist/public/assets/ManagedArtifactProperties-D5Q8gGkr.js +1 -0
  37. package/dist/public/assets/{McpConsentDialogBody-BS3RE3LY.js → McpConsentDialogBody-DEhSeOSg.js} +1 -1
  38. package/dist/public/assets/{Mermaid-BHfANkja.js → Mermaid-mUyEEsA0.js} +1 -1
  39. package/dist/public/assets/{MermaidDocEditor-CI90q10w.js → MermaidDocEditor-DceTAjtX.js} +1 -1
  40. package/dist/public/assets/{RegisteredAgentIcon-gjOJZp_B.js → RegisteredAgentIcon-BxpJAHOj.js} +1 -1
  41. package/dist/public/assets/{ReportBugDialogBody-BWXO0gto.js → ReportBugDialogBody-DO7eotFd.js} +1 -1
  42. package/dist/public/assets/{SchemaConfigEditor-eh-ijdLu.js → SchemaConfigEditor-D23bGRYq.js} +1 -1
  43. package/dist/public/assets/{SessionsHost-BOgQOcv6.js → SessionsHost-BD8Io20F.js} +2 -2
  44. package/dist/public/assets/SettingsDialogBody-D_2SfOcL.js +12 -0
  45. package/dist/public/assets/{ShareBranchSwitchDialog-DpmQmmrq.js → ShareBranchSwitchDialog-B7Bl6qR0.js} +1 -1
  46. package/dist/public/assets/{ShareReceiveDialog-C3fS1Ax2.js → ShareReceiveDialog-BmMkjWTr.js} +1 -1
  47. package/dist/public/assets/{ShareReceiveMissDialog-DzeOwnyS.js → ShareReceiveMissDialog-BDYU64bD.js} +1 -1
  48. package/dist/public/assets/{SkillEditBanner-DGB_nnDm.js → SkillEditBanner-B2U7UdOB.js} +1 -1
  49. package/dist/public/assets/{SkillOriginInline-C4x3nMIH.js → SkillOriginInline-B3wOLT3t.js} +1 -1
  50. package/dist/public/assets/{SkillToolbarControls-DXBGIWug.js → SkillToolbarControls-BP8iught.js} +1 -1
  51. package/dist/public/assets/{SlidesToolbarControls-Buv-SEot.js → SlidesToolbarControls-56-P71vE.js} +1 -1
  52. package/dist/public/assets/{SourceEditor-B64VJl_F.js → SourceEditor-8vj7fGo1.js} +1 -1
  53. package/dist/public/assets/{TerminalPanel-Bch10p1r.js → TerminalPanel-Clr6j-jo.js} +3 -3
  54. package/dist/public/assets/{TerminalWindowApp-s4mNyUki.js → TerminalWindowApp-Bzu1XJoP.js} +1 -1
  55. package/dist/public/assets/{TextDocEditor-DtDvo7eF.js → TextDocEditor-Kaj3NBL9.js} +1 -1
  56. package/dist/public/assets/{ThreadView-CGOz1ms_.js → ThreadView-C0oxDyxf.js} +1 -1
  57. package/dist/public/assets/{TimelineDiffPane-B7aD7QN-.js → TimelineDiffPane-CG6Z1uma.js} +1 -1
  58. package/dist/public/assets/{agent-diff-store-BJiYj2BI.js → agent-diff-store-DxMs0J9Y.js} +1 -1
  59. package/dist/public/assets/{auth-state-cache-5wocICj2.js → auth-state-cache-CGY7eNch.js} +3 -3
  60. package/dist/public/assets/{checkbox-vidgONxv.js → checkbox-Bxl4H4lV.js} +1 -1
  61. package/dist/public/assets/client-version-BenFW72U.js +1 -0
  62. package/dist/public/assets/{cm-theme-DZT10ikr.js → cm-theme-BygK2tYf.js} +1 -1
  63. package/dist/public/assets/comment-chips-Q0_SZK9C.js +5 -0
  64. package/dist/public/assets/{config-provider-DGQwNZtP.js → config-provider-B6fsarOv.js} +3 -3
  65. package/dist/public/assets/{dialog-DztIj-ZS.js → dialog-R8GugqUq.js} +1 -1
  66. package/dist/public/assets/{dist-BgBcg3TP.js → dist-BE8rPie-.js} +1 -1
  67. package/dist/public/assets/{dist-CkFATl39.js → dist-BR5M-SiF.js} +1 -1
  68. package/dist/public/assets/{dist-DfLFtHzK.js → dist-BTo1AB3U.js} +1 -1
  69. package/dist/public/assets/{dist-BRmJz2fY.js → dist-BZW14CKf.js} +1 -1
  70. package/dist/public/assets/{dist-z-y_5Bgj.js → dist-CElLQlwI.js} +1 -1
  71. package/dist/public/assets/{dist-DsH7eETa.js → dist-CUhsr-gg.js} +1 -1
  72. package/dist/public/assets/{dist-dO0W-CVt.js → dist-CcIAtWVJ.js} +1 -1
  73. package/dist/public/assets/{dist-DM6osNK2.js → dist-Cfmj7R4I.js} +1 -1
  74. package/dist/public/assets/{dist-ofeGnIBD.js → dist-D7MIhDGJ.js} +1 -1
  75. package/dist/public/assets/{dist-DQyQPRvE.js → dist-DBhufbLS.js} +1 -1
  76. package/dist/public/assets/{dist-BVpMlVG3.js → dist-DRufJFR7.js} +1 -1
  77. package/dist/public/assets/{dist-BiwzWInZ.js → dist-Dm-VLxvd.js} +1 -1
  78. package/dist/public/assets/{dist-GenOktAv.js → dist-ILlrHFKs.js} +183 -183
  79. package/dist/public/assets/{doc-paths-CB3USVY1.js → doc-paths-DAh95jxf.js} +1 -1
  80. package/dist/public/assets/{documents-events-rgFBXE2Z.js → documents-events-CCW6R-r2.js} +1 -1
  81. package/dist/public/assets/{file-tree-adapter-4JTjxhHS.js → file-tree-adapter-Bf1ZqkPA.js} +1 -1
  82. package/dist/public/assets/{file-tree-utils-CYn1f82_.js → file-tree-utils-CgJ4lrP9.js} +1 -1
  83. package/dist/public/assets/{folder-config-api-ByqyyP9w.js → folder-config-api-CKV5STj1.js} +1 -1
  84. package/dist/public/assets/follow-file-D4LD9UAw.js +4 -0
  85. package/dist/public/assets/i18n-C3d0M4ue.js +1 -0
  86. package/dist/public/assets/{index-DmXrGqKD.js → index-Du6HTehY.js} +17 -17
  87. package/dist/public/assets/{input-group-BiaQ-rIw.js → input-group-ClrIuhWi.js} +1 -1
  88. package/dist/public/assets/{lint-config-client-DydgEnDK.js → lint-config-client-xawAT1mQ.js} +1 -1
  89. package/dist/public/assets/lint-plugin-meta-CsGPauME.js +1 -0
  90. package/dist/public/assets/{markdownlint-rule-browser-DwEGxp2H.js → markdownlint-rule-browser-B3UPVPG_.js} +1 -1
  91. package/dist/public/assets/messages-B6wDP6_L.js +1 -0
  92. package/dist/public/assets/messages-BS6hWxWK.js +1 -0
  93. package/dist/public/assets/messages-Bg44_w_B.js +1 -0
  94. package/dist/public/assets/messages-D9hQcSkC.js +1 -0
  95. package/dist/public/assets/messages-DAPhT0w6.js +1 -0
  96. package/dist/public/assets/messages-DaVac3jo.js +1 -0
  97. package/dist/public/assets/messages-Dbqu7ts9.js +1 -0
  98. package/dist/public/assets/messages-DdoJCt_r.js +1 -0
  99. package/dist/public/assets/messages-Djc_MIS0.js +1 -0
  100. package/dist/public/assets/messages-DmHqd1yQ.js +1 -0
  101. package/dist/public/assets/messages-xKq8BSm6.js +1 -0
  102. package/dist/public/assets/navigation-targets-C1boWExT.js +1 -0
  103. package/dist/public/assets/{open-managed-artifact-tab-DpfEVLG-.js → open-managed-artifact-tab-G7xdjHph.js} +1 -1
  104. package/dist/public/assets/{pending-receive-nav-store-BHeTqy0Z.js → pending-receive-nav-store-BZigj_ik.js} +1 -1
  105. package/dist/public/assets/{project-paths-_w2mRvRX.js → project-paths-DOOtPmjl.js} +1 -1
  106. package/dist/public/assets/prop-types-BIrEWnOv.js +1 -0
  107. package/dist/public/assets/{receive-store-R5sEQn80.js → receive-store-BrOspwat.js} +1 -1
  108. package/dist/public/assets/{schema-fields-view-intent-DiE8NL9y.js → schema-fields-view-intent-D0jz38_6.js} +1 -1
  109. package/dist/public/assets/{selection-context-CHJ-gfRx.js → selection-context-PgPm0oHr.js} +1 -1
  110. package/dist/public/assets/{skill-actions-B9BGbzJZ.js → skill-actions-Btw-8DsB.js} +2 -2
  111. package/dist/public/assets/{skill-scope-CFwClOyk.js → skill-scope-8PP6d5Gw.js} +1 -1
  112. package/dist/public/assets/{skills-api-B41p5sp3.js → skills-api-DQ0PK-8O.js} +1 -1
  113. package/dist/public/assets/{src-gXOrH5MP.js → src-DoCu_Oe2.js} +1 -1
  114. package/dist/public/assets/{tag-pill-input-BTKlFD92.js → tag-pill-input-BHj2SAnj.js} +1 -1
  115. package/dist/public/assets/{target-navigation-intent-CIjVZTkZ.js → target-navigation-intent-DpIU3fe6.js} +1 -1
  116. package/dist/public/assets/{telemetry-startup-C8JOSRcr.js → telemetry-startup-htUA83Zn.js} +1 -1
  117. package/dist/public/assets/{terminal-cli-display-CW7j5kqb.js → terminal-cli-display-CgJpdKCI.js} +1 -1
  118. package/dist/public/assets/{terminal-launch-events-CW7Dk9L6.js → terminal-launch-events-DQ0KtteM.js} +1 -1
  119. package/dist/public/assets/{terminal-telemetry-CxkpCpp5.js → terminal-telemetry-CE1yzjKD.js} +1 -1
  120. package/dist/public/assets/{text-viewer-languages-oVDGEYYY.js → text-viewer-languages-epnUVwhY.js} +2 -2
  121. package/dist/public/assets/{typing-burst-detector-fIHJv2J1.js → typing-burst-detector-XmZhxL72.js} +4 -4
  122. package/dist/public/assets/{uninstall-CYpAgTNE.js → uninstall-CDJGY7Qx.js} +1 -1
  123. package/dist/public/assets/{use-activity-panel-BEnqyFcJ.js → use-activity-panel-DeQ1S88x.js} +1 -1
  124. package/dist/public/assets/{use-apply-config-color-theme-Dw8J4H8Z.js → use-apply-config-color-theme-BatIDUX7.js} +1 -1
  125. package/dist/public/assets/{use-collab-url-CbdhvhFJ.js → use-collab-url-7XE2_0_k.js} +1 -1
  126. package/dist/public/assets/{use-live-xterm-theme-B_qB957b.js → use-live-xterm-theme-DS89T4Os.js} +1 -1
  127. package/dist/public/assets/{use-open-skill-Ca4D1I53.js → use-open-skill-CgnR7yXa.js} +1 -1
  128. package/dist/public/assets/{use-popular-skills-ByV4BHXd.js → use-popular-skills-BefXxEcp.js} +1 -1
  129. package/dist/public/assets/{use-settings-route-4qI--CpZ.js → use-settings-route-DN0TWdfX.js} +1 -1
  130. package/dist/public/assets/{use-skill-origin-DGj0sj4C.js → use-skill-origin-COh1_mOK.js} +1 -1
  131. package/dist/public/assets/{use-skills-WWbAKl3q.js → use-skills-C_HuRxth.js} +1 -1
  132. package/dist/public/assets/{use-terminal-enabled-Dz_qAFuD.js → use-terminal-enabled-DPQRp9bB.js} +1 -1
  133. package/dist/public/assets/use-timeline-entry-diff-Bw_6uLLl.js +6 -0
  134. package/dist/public/assets/{use-workspace-BRfhPAI8.js → use-workspace-CNCW4CS8.js} +1 -1
  135. package/dist/public/index.html +102 -102
  136. package/dist/public/uninstall.html +10 -10
  137. package/dist/{repair-launch-json-CMlO4J6-.mjs → repair-launch-json-r4ZvDSZL.mjs} +2 -2
  138. package/dist/{repair-mcp-configs-C5d_qH2p.mjs → repair-mcp-configs-8YO27I4W.mjs} +2 -2
  139. package/dist/repair-skills-BWNXcIRv.mjs +1 -0
  140. package/dist/{repair-skills-hlHv35hU.mjs → repair-skills-Dk0Hee-r.mjs} +2 -2
  141. package/dist/server-lock-CDm0H6LS.mjs +1 -0
  142. package/dist/{server-lock-D8tFCW-G.mjs → server-lock-CeKMy65H.mjs} +2 -2
  143. package/dist/{skill-teardown-BCQ-qH0I.mjs → skill-teardown-DtXC2fAI.mjs} +2 -2
  144. package/dist/{src-C3V2v4Fb.mjs → src--XQg-7vm.mjs} +1 -1
  145. package/dist/{src-BZC89n0v.mjs → src-BwjoUUIl.mjs} +4 -4
  146. package/dist/src-DK8qZiyv.mjs +1 -0
  147. package/dist/{src-RGB2pEts.mjs → src-Dj6UxpKM.mjs} +124 -124
  148. package/dist/{src-Bev_iKqg.mjs → src-DvuwJKkU.mjs} +405 -405
  149. package/dist/start-D_Gfcl0_.mjs +12 -0
  150. package/dist/start-ZpOYP9oW.mjs +1 -0
  151. package/dist/{ui-CXX6eedF.mjs → ui-7z12LoCq.mjs} +3 -3
  152. package/dist/{write-project-skill-CTfu6uzb.mjs → write-project-skill-DUj7e5tZ.mjs} +3 -3
  153. package/package.json +4 -4
  154. package/dist/constants-ggtyHegG.mjs +0 -2
  155. package/dist/git-handle-D_uW8fTU.mjs +0 -1
  156. package/dist/init-DzEphcZj.mjs +0 -1
  157. package/dist/loader-tHonavs_.mjs +0 -1
  158. package/dist/md-manager-CUGZ0GRt.mjs +0 -2
  159. package/dist/preview-CbOTxxpX.mjs +0 -1
  160. package/dist/public/assets/CodeMirrorPropInput-Cydg0jHr.js +0 -3
  161. package/dist/public/assets/DocumentContext-BN8gSwJ-.js +0 -38
  162. package/dist/public/assets/FeedbackForm-CiQQiFp-.js +0 -1
  163. package/dist/public/assets/ManagedArtifactProperties-CUMQh4tz.js +0 -1
  164. package/dist/public/assets/SettingsDialogBody-BaYDHshm.js +0 -12
  165. package/dist/public/assets/client-version---DsZj2h.js +0 -1
  166. package/dist/public/assets/comment-chips-BjkVSykR.js +0 -5
  167. package/dist/public/assets/follow-file-kuGZjRsi.js +0 -4
  168. package/dist/public/assets/i18n-CrYaxckE.js +0 -1
  169. package/dist/public/assets/lint-plugin-meta-FPoTE-0t.js +0 -1
  170. package/dist/public/assets/messages-7cAk2vbZ.js +0 -1
  171. package/dist/public/assets/messages-BNv51jKY.js +0 -1
  172. package/dist/public/assets/messages-BS_zCLy8.js +0 -1
  173. package/dist/public/assets/messages-BmYExk_R.js +0 -1
  174. package/dist/public/assets/messages-C3vvvgBK.js +0 -1
  175. package/dist/public/assets/messages-CmD7dBQ3.js +0 -1
  176. package/dist/public/assets/messages-CpVNkvrj.js +0 -1
  177. package/dist/public/assets/messages-CxF28E4J.js +0 -1
  178. package/dist/public/assets/messages-D9UyuwOS.js +0 -1
  179. package/dist/public/assets/messages-DQ5yKIrs.js +0 -1
  180. package/dist/public/assets/messages-DdBrUUBf.js +0 -1
  181. package/dist/public/assets/navigation-targets-iVnea4YK.js +0 -1
  182. package/dist/public/assets/prop-types-ClS-DLuz.js +0 -1
  183. package/dist/public/assets/use-timeline-entry-diff-RrvwSA9l.js +0 -6
  184. package/dist/repair-skills-Bjx_4xAb.mjs +0 -1
  185. package/dist/server-lock-CTrzO_5l.mjs +0 -1
  186. package/dist/src-DChs1wj2.mjs +0 -1
  187. package/dist/start-B8fRTezu.mjs +0 -12
  188. package/dist/start-CZ-kN2jU.mjs +0 -1
  189. /package/dist/public/assets/{CopyButton-ByR_1gcU.js → CopyButton-CKyZY1PL.js} +0 -0
  190. /package/dist/public/assets/{asset-dispatch-Cz1weVX3.js → asset-dispatch-Ccnji1rt.js} +0 -0
  191. /package/dist/public/assets/{auth-prompt-store-BYOv6_8O.js → auth-prompt-store-C4YJf5De.js} +0 -0
  192. /package/dist/public/assets/{badge-DFX4S3a5.js → badge-BYteLKha.js} +0 -0
  193. /package/dist/public/assets/{copilot-Dh1BU6kS.js → copilot-CmkvU8CH.js} +0 -0
  194. /package/dist/public/assets/{cursor-B6reg1lS.js → cursor-CIl_AjI1.js} +0 -0
  195. /package/dist/public/assets/{dist-DAqA-GDU.js → dist-sSZdzHur.js} +0 -0
  196. /package/dist/public/assets/{documents-fetch-CV8lWh8v.js → documents-fetch-DnpUYK4R.js} +0 -0
  197. /package/dist/public/assets/{download-C3PYuI1f.js → download-Dn5ulvxm.js} +0 -0
  198. /package/dist/public/assets/{external-link-BIMZpgNa.js → external-link-3El87eIe.js} +0 -0
  199. /package/dist/public/assets/{eye-CSz7ogHo.js → eye-DmhHKPNd.js} +0 -0
  200. /package/dist/public/assets/{field-CtVP3IIV.js → field-CvwbVfuf.js} +0 -0
  201. /package/dist/public/assets/{file-tree-rename-validation-CCqiFGp1.js → file-tree-rename-validation-C2Ibtqn6.js} +0 -0
  202. /package/dist/public/assets/{folder-CopDpuy5.js → folder-CWlDik9N.js} +0 -0
  203. /package/dist/public/assets/{folder-open-DUSc8NL8.js → folder-open-BTTec8yg.js} +0 -0
  204. /package/dist/public/assets/{hash-DI30zEBt.js → hash-PyoMEEnH.js} +0 -0
  205. /package/dist/public/assets/{info-CV59RycV.js → info-w0kv2CeC.js} +0 -0
  206. /package/dist/public/assets/{input-BYiOK210.js → input-BFt4qZaV.js} +0 -0
  207. /package/dist/public/assets/{list-plus-DBdmIc6v.js → list-plus-2r7_ATZj.js} +0 -0
  208. /package/dist/public/assets/{minus-D07ZsfDZ.js → minus-DNhR60ON.js} +0 -0
  209. /package/dist/public/assets/{miss-dialog-store-sSyy54tn.js → miss-dialog-store-DzXIxgCB.js} +0 -0
  210. /package/dist/public/assets/{panel-CbGx_cRv.js → panel-D2VXQC58.js} +0 -0
  211. /package/dist/public/assets/{panel-right-open-B66oA9M1.js → panel-right-open-DAyUhiQN.js} +0 -0
  212. /package/dist/public/assets/{paperclip-BlKB6Xwa.js → paperclip-B6sgPA4f.js} +0 -0
  213. /package/dist/public/assets/{refresh-cw-DQervzDZ.js → refresh-cw-CR2QWccs.js} +0 -0
  214. /package/dist/public/assets/{spinner-BqySY7qY.js → spinner-CHTY-VE-.js} +0 -0
  215. /package/dist/public/assets/{square-pen-Cb57Y3fg.js → square-pen-DdAKbKU7.js} +0 -0
  216. /package/dist/public/assets/{startup-marks-Cdkh8q3E.js → startup-marks-CTM7uDIJ.js} +0 -0
  217. /package/dist/public/assets/{stex-PMopVeEZ.js → stex-s_JxeNEZ.js} +0 -0
  218. /package/dist/public/assets/{terminal-Cvoe7pfU.js → terminal-DRi0ugpC.js} +0 -0
  219. /package/dist/public/assets/{textarea-yZk4yd9U.js → textarea-CzW0aR0j.js} +0 -0
  220. /package/dist/public/assets/{trash-2-N0ilsnnr.js → trash-2-BWJWOK8-.js} +0 -0
  221. /package/dist/public/assets/{triangle-alert-COo6wbUK.js → triangle-alert-DV20-jn9.js} +0 -0
  222. /package/dist/public/assets/{undo-2-WGCwknr8.js → undo-2-CMyZc9mZ.js} +0 -0
  223. /package/dist/public/assets/{use-installed-clis-Cydpb5jd.js → use-installed-clis-DmyaQmU9.js} +0 -0
  224. /package/dist/public/assets/{wrench-CP2MIQHF.js → wrench-C3BL-uHg.js} +0 -0
  225. /package/dist/public/assets/{x-DS57FvHW.js → x-BaJrHZK_.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{ft as r}from"./sleep-A0G7hOuG.mjs";import{Ro as i,W as a,os as o,q as s,xs as c}from"./src-RGB2pEts.mjs";import{Br as l,Cr as u,Ea as d,Ir as f,Lr as p,Pn as m,Rr as h,Sn as g,Zr as _,an as v,ar as y,bn as b,c as x,hr as S,in as C,ir as ee,l as te,or as ne,pr as re,u as ie,wr as ae,yn as oe}from"./src-Bev_iKqg.mjs";import{F as w,N as se}from"./fs-traced-DV9uD41t.mjs";import{_ as ce,a as le,b as T,c as E,d as ue,i as de,l as fe,o as D,r as pe,t as me,u as he,v as ge}from"./write-project-skill-CTfu6uzb.mjs";import{i as O,n as k,o as A,r as j,s as M,t as N}from"./colors-BsmVIwfM.mjs";import{t as _e}from"./constants-ggtyHegG.mjs";import{t as P}from"./is-object-ByG7RnjH.mjs";import{t as ve}from"./preview-Dvl3K5Z6.mjs";import{createRequire as ye}from"node:module";import{execFileSync as be}from"node:child_process";import xe,{dirname as F,isAbsolute as I,join as L,relative as R,resolve as Se,sep as Ce}from"node:path";import z from"node:process";import{fileURLToPath as we}from"node:url";import{existsSync as B,lstatSync as Te,mkdirSync as Ee,readFileSync as V,readlinkSync as De,realpathSync as Oe,statSync as ke,writeFileSync as Ae}from"node:fs";import{homedir as je}from"node:os";import*as Me from"node:readline";import{inspect as Ne,stripVTControlCharacters as Pe,styleText as H}from"node:util";import{AsyncLocalStorage as Fe,AsyncResource as Ie}from"node:async_hooks";const Le=new Set([`emacs`,`vim`]);function Re(e){return Le.has(e)}function ze(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Re))):[]}const U=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Be=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ve=e=>e.name===`space`,He=e=>e.name===`backspace`,Ue=e=>`1234567890`.includes(e.name),We=e=>e.name===`enter`||e.name===`return`;var Ge=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Ke=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},qe=class extends Error{name=`ExitPromptError`},Je=class extends Error{name=`HookError`},Ye=class extends Error{name=`ValidationError`};const Xe=new Fe;function Ze(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Qe(e,t){let n=Ze(e);return Xe.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function W(){let e=Xe.getStore();if(!e)throw new Je(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function $e(){return W().rl}function et(e){return Ie.bind((...t)=>{let n=W(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function tt(e){let t=W(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function nt(){W().handleChange()}const rt={queue(e){let t=W(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e($e());if(r!=null&&typeof r!=`function`)throw new Ye(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=W();et(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=W();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function it(e){return typeof e==`function`}function G(e){return tt(t=>{let n=Ie.bind(function(e){t.get()!==e&&(t.set(e),nt())});if(t.initialized)return[t.get(),n];let r=it(e)?e():e;return t.set(r),[r,n]})}function at(e,t){tt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&rt.queue(e),n.set(t)})}function ot(){return z.platform.startsWith(`win`)?!!z.env.CI||!!z.env.WT_SESSION||!!z.env.TERMINUS_SUBLIME||z.env.ConEmuTask===`{cmd::Cmder}`||z.env.TERM_PROGRAM===`Terminus-Sublime`||z.env.TERM_PROGRAM===`vscode`||z.env.TERM===`xterm-256color`||z.env.TERM===`alacritty`||z.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:z.env.TERM!==`linux`}const st={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ct={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},lt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ut={...st,...ct},dt={...st,...lt},K=ot()?ut:dt;Object.entries(ct);const ft={prefix:{idle:H(`blue`,`?`),done:H(`green`,K.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>H(`yellow`,e))},keybindings:[],style:{answer:e=>H(`cyan`,e),message:e=>H(`bold`,e),error:e=>H(`red`,`> ${e}`),defaultAnswer:e=>H(`dim`,`(${e})`),help:e=>H(`dim`,e),highlight:e=>H(`cyan`,e),key:e=>H(`cyan`,H(`bold`,`<${e}>`))}};function pt(){return{...ft,keybindings:ze()}}function mt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ht(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=mt(n)&&mt(r)?ht(n,r):r}return t}function gt(...e){return ht(pt(),...e.filter(e=>e!=null))}function _t({status:e=`idle`,theme:t}){let[n,r]=G(!1),[i,a]=G(0),{prefix:o,spinner:s}=gt(t);return at(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function vt(e,t){return tt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function yt(e){return G({current:e})[0]}function bt(e){let t=yt(e);t.current=e,at(e=>{let n=!1,r=et((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var xt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const St=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ct=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,wt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Tt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Et=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ot=/\t{1,1000}/y,kt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,At=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,jt=/\p{M}+/gu,Mt={limit:1/0,ellipsis:``},Nt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Nt(i,Mt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[At,l],[Tt,0],[Et,o],[Ot,s],[kt,c],[Dt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(jt,``)){let t=e.codePointAt(0)||0;if(S=Ct(t)?2:wt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Dt?St(e.slice(p,n.lastIndex)):n===kt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pt={limit:1/0,ellipsis:``,ellipsisWidth:0},q=(e,t={})=>Nt(e,Pt,t).width,Ft=`]8;;`,It=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ft}(?<uri>.*))`,`y`),Lt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Rt=e=>`[${e}m`,zt=e=>`${Ft}${e}`,Bt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:q(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=q(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Ft,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Vt=e=>{let t=e.split(` `),n=t.length;for(;n&&!q(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ht=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=q(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=q(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Bt(s,r,t),c=q(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Bt(s,r,t),c=q(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Bt(s,r,t),c=q(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Vt(e)));let l=s.join(`
1
+ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{ft as r}from"./sleep-A0G7hOuG.mjs";import{Ho as i,J as a,Ts as o,Z as s,us as c}from"./src-Dj6UxpKM.mjs";import{Br as l,Cr as u,Ea as d,Ir as f,Lr as p,Pn as m,Rr as h,Sn as g,Zr as _,an as v,ar as y,bn as b,c as x,hr as S,in as C,ir as ee,l as te,or as ne,pr as re,u as ie,wr as ae,yn as oe}from"./src-DvuwJKkU.mjs";import{F as w,N as se}from"./fs-traced-DV9uD41t.mjs";import{_ as ce,a as le,b as T,c as E,d as ue,i as de,l as fe,o as D,r as pe,t as me,u as he,v as ge}from"./write-project-skill-DUj7e5tZ.mjs";import{i as O,n as k,o as A,r as j,s as M,t as N}from"./colors-BsmVIwfM.mjs";import{t as _e}from"./constants-CibuukV7.mjs";import{t as P}from"./is-object-ByG7RnjH.mjs";import{t as ve}from"./preview-DoBitDZ-.mjs";import{createRequire as ye}from"node:module";import{execFileSync as be}from"node:child_process";import xe,{dirname as F,isAbsolute as I,join as L,relative as R,resolve as Se,sep as Ce}from"node:path";import z from"node:process";import{fileURLToPath as we}from"node:url";import{existsSync as B,lstatSync as Te,mkdirSync as Ee,readFileSync as V,readlinkSync as De,realpathSync as Oe,statSync as ke,writeFileSync as Ae}from"node:fs";import{homedir as je}from"node:os";import*as Me from"node:readline";import{inspect as Ne,stripVTControlCharacters as Pe,styleText as H}from"node:util";import{AsyncLocalStorage as Fe,AsyncResource as Ie}from"node:async_hooks";const Le=new Set([`emacs`,`vim`]);function Re(e){return Le.has(e)}function ze(){let e=process.env.INQUIRER_KEYBINDINGS;return e?Array.from(new Set(e.toLowerCase().split(/[\s,]+/).filter(Re))):[]}const U=(e,t=[])=>e.name===`up`||t.includes(`vim`)&&e.name===`k`||t.includes(`emacs`)&&e.ctrl&&e.name===`p`,Be=(e,t=[])=>e.name===`down`||t.includes(`vim`)&&e.name===`j`||t.includes(`emacs`)&&e.ctrl&&e.name===`n`,Ve=e=>e.name===`space`,He=e=>e.name===`backspace`,Ue=e=>`1234567890`.includes(e.name),We=e=>e.name===`enter`||e.name===`return`;var Ge=class extends Error{name=`AbortPromptError`;message=`Prompt was aborted`;constructor(e){super(),this.cause=e?.cause}},Ke=class extends Error{name=`CancelPromptError`;message=`Prompt was canceled`},qe=class extends Error{name=`ExitPromptError`},Je=class extends Error{name=`HookError`},Ye=class extends Error{name=`ValidationError`};const Xe=new Fe;function Ze(e){return{rl:e,hooks:[],hooksCleanup:[],hooksEffect:[],index:0,handleChange(){}}}function Qe(e,t){let n=Ze(e);return Xe.run(n,()=>{function e(e){n.handleChange=()=>{n.index=0,e()},n.handleChange()}return t(e)})}function W(){let e=Xe.getStore();if(!e)throw new Je(`[Inquirer] Hook functions can only be called from within a prompt`);return e}function $e(){return W().rl}function et(e){return Ie.bind((...t)=>{let n=W(),r=!1,i=n.handleChange;n.handleChange=()=>{r=!0};let a=e(...t);return r&&i(),n.handleChange=i,a})}function tt(e){let t=W(),{index:n}=t,r=e({get(){return t.hooks[n]},set(e){t.hooks[n]=e},initialized:n in t.hooks});return t.index++,r}function nt(){W().handleChange()}const rt={queue(e){let t=W(),{index:n}=t;t.hooksEffect.push(()=>{t.hooksCleanup[n]?.();let r=e($e());if(r!=null&&typeof r!=`function`)throw new Ye(`useEffect return value must be a cleanup function or nothing.`);t.hooksCleanup[n]=r})},run(){let e=W();et(()=>{e.hooksEffect.forEach(e=>{e()}),e.hooksEffect.length=0})()},clearAll(){let e=W();e.hooksCleanup.forEach(e=>{e?.()}),e.hooksEffect.length=0,e.hooksCleanup.length=0}};function it(e){return typeof e==`function`}function G(e){return tt(t=>{let n=Ie.bind(function(e){t.get()!==e&&(t.set(e),nt())});if(t.initialized)return[t.get(),n];let r=it(e)?e():e;return t.set(r),[r,n]})}function at(e,t){tt(n=>{let r=n.get();(!Array.isArray(r)||t.some((e,t)=>!Object.is(e,r[t])))&&rt.queue(e),n.set(t)})}function ot(){return z.platform.startsWith(`win`)?!!z.env.CI||!!z.env.WT_SESSION||!!z.env.TERMINUS_SUBLIME||z.env.ConEmuTask===`{cmd::Cmder}`||z.env.TERM_PROGRAM===`Terminus-Sublime`||z.env.TERM_PROGRAM===`vscode`||z.env.TERM===`xterm-256color`||z.env.TERM===`alacritty`||z.env.TERMINAL_EMULATOR===`JetBrains-JediTerm`:z.env.TERM!==`linux`}const st={circleQuestionMark:`(?)`,questionMarkPrefix:`(?)`,square:`█`,squareDarkShade:`▓`,squareMediumShade:`▒`,squareLightShade:`░`,squareTop:`▀`,squareBottom:`▄`,squareLeft:`▌`,squareRight:`▐`,squareCenter:`■`,bullet:`●`,dot:`․`,ellipsis:`…`,pointerSmall:`›`,triangleUp:`▲`,triangleUpSmall:`▴`,triangleDown:`▼`,triangleDownSmall:`▾`,triangleLeftSmall:`◂`,triangleRightSmall:`▸`,home:`⌂`,heart:`♥`,musicNote:`♪`,musicNoteBeamed:`♫`,arrowUp:`↑`,arrowDown:`↓`,arrowLeft:`←`,arrowRight:`→`,arrowLeftRight:`↔`,arrowUpDown:`↕`,almostEqual:`≈`,notEqual:`≠`,lessOrEqual:`≤`,greaterOrEqual:`≥`,identical:`≡`,infinity:`∞`,subscriptZero:`₀`,subscriptOne:`₁`,subscriptTwo:`₂`,subscriptThree:`₃`,subscriptFour:`₄`,subscriptFive:`₅`,subscriptSix:`₆`,subscriptSeven:`₇`,subscriptEight:`₈`,subscriptNine:`₉`,oneHalf:`½`,oneThird:`⅓`,oneQuarter:`¼`,oneFifth:`⅕`,oneSixth:`⅙`,oneEighth:`⅛`,twoThirds:`⅔`,twoFifths:`⅖`,threeQuarters:`¾`,threeFifths:`⅗`,threeEighths:`⅜`,fourFifths:`⅘`,fiveSixths:`⅚`,fiveEighths:`⅝`,sevenEighths:`⅞`,line:`─`,lineBold:`━`,lineDouble:`═`,lineDashed0:`┄`,lineDashed1:`┅`,lineDashed2:`┈`,lineDashed3:`┉`,lineDashed4:`╌`,lineDashed5:`╍`,lineDashed6:`╴`,lineDashed7:`╶`,lineDashed8:`╸`,lineDashed9:`╺`,lineDashed10:`╼`,lineDashed11:`╾`,lineDashed12:`−`,lineDashed13:`–`,lineDashed14:`‐`,lineDashed15:`⁃`,lineVertical:`│`,lineVerticalBold:`┃`,lineVerticalDouble:`║`,lineVerticalDashed0:`┆`,lineVerticalDashed1:`┇`,lineVerticalDashed2:`┊`,lineVerticalDashed3:`┋`,lineVerticalDashed4:`╎`,lineVerticalDashed5:`╏`,lineVerticalDashed6:`╵`,lineVerticalDashed7:`╷`,lineVerticalDashed8:`╹`,lineVerticalDashed9:`╻`,lineVerticalDashed10:`╽`,lineVerticalDashed11:`╿`,lineDownLeft:`┐`,lineDownLeftArc:`╮`,lineDownBoldLeftBold:`┓`,lineDownBoldLeft:`┒`,lineDownLeftBold:`┑`,lineDownDoubleLeftDouble:`╗`,lineDownDoubleLeft:`╖`,lineDownLeftDouble:`╕`,lineDownRight:`┌`,lineDownRightArc:`╭`,lineDownBoldRightBold:`┏`,lineDownBoldRight:`┎`,lineDownRightBold:`┍`,lineDownDoubleRightDouble:`╔`,lineDownDoubleRight:`╓`,lineDownRightDouble:`╒`,lineUpLeft:`┘`,lineUpLeftArc:`╯`,lineUpBoldLeftBold:`┛`,lineUpBoldLeft:`┚`,lineUpLeftBold:`┙`,lineUpDoubleLeftDouble:`╝`,lineUpDoubleLeft:`╜`,lineUpLeftDouble:`╛`,lineUpRight:`└`,lineUpRightArc:`╰`,lineUpBoldRightBold:`┗`,lineUpBoldRight:`┖`,lineUpRightBold:`┕`,lineUpDoubleRightDouble:`╚`,lineUpDoubleRight:`╙`,lineUpRightDouble:`╘`,lineUpDownLeft:`┤`,lineUpBoldDownBoldLeftBold:`┫`,lineUpBoldDownBoldLeft:`┨`,lineUpDownLeftBold:`┥`,lineUpBoldDownLeftBold:`┩`,lineUpDownBoldLeftBold:`┪`,lineUpDownBoldLeft:`┧`,lineUpBoldDownLeft:`┦`,lineUpDoubleDownDoubleLeftDouble:`╣`,lineUpDoubleDownDoubleLeft:`╢`,lineUpDownLeftDouble:`╡`,lineUpDownRight:`├`,lineUpBoldDownBoldRightBold:`┣`,lineUpBoldDownBoldRight:`┠`,lineUpDownRightBold:`┝`,lineUpBoldDownRightBold:`┡`,lineUpDownBoldRightBold:`┢`,lineUpDownBoldRight:`┟`,lineUpBoldDownRight:`┞`,lineUpDoubleDownDoubleRightDouble:`╠`,lineUpDoubleDownDoubleRight:`╟`,lineUpDownRightDouble:`╞`,lineDownLeftRight:`┬`,lineDownBoldLeftBoldRightBold:`┳`,lineDownLeftBoldRightBold:`┯`,lineDownBoldLeftRight:`┰`,lineDownBoldLeftBoldRight:`┱`,lineDownBoldLeftRightBold:`┲`,lineDownLeftRightBold:`┮`,lineDownLeftBoldRight:`┭`,lineDownDoubleLeftDoubleRightDouble:`╦`,lineDownDoubleLeftRight:`╥`,lineDownLeftDoubleRightDouble:`╤`,lineUpLeftRight:`┴`,lineUpBoldLeftBoldRightBold:`┻`,lineUpLeftBoldRightBold:`┷`,lineUpBoldLeftRight:`┸`,lineUpBoldLeftBoldRight:`┹`,lineUpBoldLeftRightBold:`┺`,lineUpLeftRightBold:`┶`,lineUpLeftBoldRight:`┵`,lineUpDoubleLeftDoubleRightDouble:`╩`,lineUpDoubleLeftRight:`╨`,lineUpLeftDoubleRightDouble:`╧`,lineUpDownLeftRight:`┼`,lineUpBoldDownBoldLeftBoldRightBold:`╋`,lineUpDownBoldLeftBoldRightBold:`╈`,lineUpBoldDownLeftBoldRightBold:`╇`,lineUpBoldDownBoldLeftRightBold:`╊`,lineUpBoldDownBoldLeftBoldRight:`╉`,lineUpBoldDownLeftRight:`╀`,lineUpDownBoldLeftRight:`╁`,lineUpDownLeftBoldRight:`┽`,lineUpDownLeftRightBold:`┾`,lineUpBoldDownBoldLeftRight:`╂`,lineUpDownLeftBoldRightBold:`┿`,lineUpBoldDownLeftBoldRight:`╃`,lineUpBoldDownLeftRightBold:`╄`,lineUpDownBoldLeftBoldRight:`╅`,lineUpDownBoldLeftRightBold:`╆`,lineUpDoubleDownDoubleLeftDoubleRightDouble:`╬`,lineUpDoubleDownDoubleLeftRight:`╫`,lineUpDownLeftDoubleRightDouble:`╪`,lineCross:`╳`,lineBackslash:`╲`,lineSlash:`╱`},ct={tick:`✔`,info:`ℹ`,warning:`⚠`,cross:`✘`,squareSmall:`◻`,squareSmallFilled:`◼`,circle:`◯`,circleFilled:`◉`,circleDotted:`◌`,circleDouble:`◎`,circleCircle:`ⓞ`,circleCross:`ⓧ`,circlePipe:`Ⓘ`,radioOn:`◉`,radioOff:`◯`,checkboxOn:`☒`,checkboxOff:`☐`,checkboxCircleOn:`ⓧ`,checkboxCircleOff:`Ⓘ`,pointer:`❯`,triangleUpOutline:`△`,triangleLeft:`◀`,triangleRight:`▶`,lozenge:`◆`,lozengeOutline:`◇`,hamburger:`☰`,smiley:`㋡`,mustache:`෴`,star:`★`,play:`▶`,nodejs:`⬢`,oneSeventh:`⅐`,oneNinth:`⅑`,oneTenth:`⅒`},lt={tick:`√`,info:`i`,warning:`‼`,cross:`×`,squareSmall:`□`,squareSmallFilled:`■`,circle:`( )`,circleFilled:`(*)`,circleDotted:`( )`,circleDouble:`( )`,circleCircle:`(○)`,circleCross:`(×)`,circlePipe:`(│)`,radioOn:`(*)`,radioOff:`( )`,checkboxOn:`[×]`,checkboxOff:`[ ]`,checkboxCircleOn:`(×)`,checkboxCircleOff:`( )`,pointer:`>`,triangleUpOutline:`∆`,triangleLeft:`◄`,triangleRight:`►`,lozenge:`♦`,lozengeOutline:`◊`,hamburger:`≡`,smiley:`☺`,mustache:`┌─┐`,star:`✶`,play:`►`,nodejs:`♦`,oneSeventh:`1/7`,oneNinth:`1/9`,oneTenth:`1/10`},ut={...st,...ct},dt={...st,...lt},K=ot()?ut:dt;Object.entries(ct);const ft={prefix:{idle:H(`blue`,`?`),done:H(`green`,K.tick)},spinner:{interval:80,frames:[`⠋`,`⠙`,`⠹`,`⠸`,`⠼`,`⠴`,`⠦`,`⠧`,`⠇`,`⠏`].map(e=>H(`yellow`,e))},keybindings:[],style:{answer:e=>H(`cyan`,e),message:e=>H(`bold`,e),error:e=>H(`red`,`> ${e}`),defaultAnswer:e=>H(`dim`,`(${e})`),help:e=>H(`dim`,e),highlight:e=>H(`cyan`,e),key:e=>H(`cyan`,H(`bold`,`<${e}>`))}};function pt(){return{...ft,keybindings:ze()}}function mt(e){if(typeof e!=`object`||!e)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function ht(...e){let t={};for(let n of e)for(let[e,r]of Object.entries(n)){let n=t[e];t[e]=mt(n)&&mt(r)?ht(n,r):r}return t}function gt(...e){return ht(pt(),...e.filter(e=>e!=null))}function _t({status:e=`idle`,theme:t}){let[n,r]=G(!1),[i,a]=G(0),{prefix:o,spinner:s}=gt(t);return at(()=>{if(e===`loading`){let e,t=-1,n=setTimeout(()=>{r(!0),e=setInterval(()=>{t+=1,a(t%s.frames.length)},s.interval)},300);return()=>{clearTimeout(n),clearInterval(e)}}else r(!1)},[e]),n?s.frames[i]:typeof o==`string`?o:o[e===`loading`?`idle`:e]??o.idle}function vt(e,t){return tt(n=>{let r=n.get();if(!r||r.dependencies.length!==t.length||r.dependencies.some((e,n)=>e!==t[n])){let r=e();return n.set({value:r,dependencies:t}),r}return r.value})}function yt(e){return G({current:e})[0]}function bt(e){let t=yt(e);t.current=e,at(e=>{let n=!1,r=et((r,i)=>{n||t.current(i,e)});return e.input.on(`keypress`,r),()=>{n=!0,e.input.removeListener(`keypress`,r)}},[])}var xt=t(n(((t,n)=>{n.exports=i;function r(t){let n={defaultWidth:0,output:process.stdout,tty:e(`tty`)};return t?(Object.keys(n).forEach(function(e){t[e]||(t[e]=n[e])}),t):n}function i(e){let t=r(e);if(t.output.getWindowSize)return t.output.getWindowSize()[0]||t.defaultWidth;if(t.tty.getWindowSize)return t.tty.getWindowSize()[1]||t.defaultWidth;if(t.output.columns)return t.output.columns;if(process.env.CLI_WIDTH){let e=parseInt(process.env.CLI_WIDTH,10);if(!isNaN(e)&&e!==0)return e}return t.defaultWidth}}))(),1);const St=(()=>{let e=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g;return t=>{let n=0;for(e.lastIndex=0;e.test(t);)n+=1;return t.length-n}})(),Ct=e=>e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510,wt=e=>e===8987||e===9001||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12771||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=19903||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e>=131072&&e<=196605||e>=196608&&e<=262141,Tt=/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y,Et=/[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y,Dt=/(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy,Ot=/\t{1,1000}/y,kt=/[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy,At=/(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y,jt=/\p{M}+/gu,Mt={limit:1/0,ellipsis:``},Nt=(e,t={},n={})=>{let r=t.limit??1/0,i=t.ellipsis??``,a=t?.ellipsisWidth??(i?Nt(i,Mt,n).width:0),o=n.controlWidth??0,s=n.tabWidth??8,c=n.emojiWidth??2,l=n.regularWidth??1,u=n.wideWidth??2,d=[[At,l],[Tt,0],[Et,o],[Ot,s],[kt,c],[Dt,u]],f=0,p=0,m=e.length,h=0,g=!1,_=m,v=Math.max(0,r-a),y=0,b=0,x=0,S=0;outer:for(;;){if(b>y||p>=m&&p>f){let t=e.slice(y,b)||e.slice(f,p);h=0;for(let e of t.replaceAll(jt,``)){let t=e.codePointAt(0)||0;if(S=Ct(t)?2:wt(t)?u:l,x+S>v&&(_=Math.min(_,Math.max(y,f)+h)),x+S>r){g=!0;break outer}h+=e.length,x+=S}y=b=0}if(p>=m)break outer;for(let t=0,n=d.length;t<n;t++){let[n,i]=d[t];if(n.lastIndex=p,n.test(e)){if(h=n===Dt?St(e.slice(p,n.lastIndex)):n===kt?1:n.lastIndex-p,S=h*i,x+S>v&&(_=Math.min(_,p+Math.floor((v-x)/i))),x+S>r){g=!0;break outer}x+=S,y=f,b=p,p=f=n.lastIndex;continue outer}}p+=1}return{width:g?v:x,index:g?_:m,truncated:g,ellipsed:g&&r>=a}},Pt={limit:1/0,ellipsis:``,ellipsisWidth:0},q=(e,t={})=>Nt(e,Pt,t).width,Ft=`]8;;`,It=RegExp(`(?:\\[(?<code>\\d+)m|\\${Ft}(?<uri>.*))`,`y`),Lt=e=>{if(e>=30&&e<=37||e>=90&&e<=97)return 39;if(e>=40&&e<=47||e>=100&&e<=107)return 49;if(e===1||e===2)return 22;if(e===3)return 23;if(e===4)return 24;if(e===7)return 27;if(e===8)return 28;if(e===9)return 29;if(e===0)return 0},Rt=e=>`[${e}m`,zt=e=>`${Ft}${e}`,Bt=(e,t,n)=>{let r=t[Symbol.iterator](),i=!1,a=!1,o=e.at(-1),s=o===void 0?0:q(o),c=r.next(),l=r.next(),u=0;for(;!c.done;){let o=c.value,d=q(o);s+d<=n?e[e.length-1]+=o:(e.push(o),s=0),(o===`\x1B`||o===`›`)&&(i=!0,a=t.startsWith(Ft,u+1)),i?a?o===`\x07`&&(i=!1,a=!1):o===`m`&&(i=!1):(s+=d,s===n&&!l.done&&(e.push(``),s=0)),c=l,l=r.next(),u+=o.length}o=e.at(-1),!s&&o!==void 0&&o.length&&e.length>1&&(e[e.length-2]+=e.pop())},Vt=e=>{let t=e.split(` `),n=t.length;for(;n&&!q(t[n-1]);)n--;return n===t.length?e:t.slice(0,n).join(` `)+t.slice(n).join(``)},Ht=(e,t,n={})=>{if(n.trim!==!1&&e.trim()===``)return``;let r=``,i,a,o=e.split(` `),s=[``],c=0;for(let e=0;e<o.length;e++){let r=o[e];if(n.trim!==!1){let e=s.at(-1)??``,t=e.trimStart();e.length!==t.length&&(s[s.length-1]=t,c=q(t))}e!==0&&(c>=t&&(n.wordWrap===!1||n.trim===!1)&&(s.push(``),c=0),(c||n.trim===!1)&&(s[s.length-1]+=` `,c++));let i=q(r);if(n.hard&&i>t){let e=t-c,n=1+Math.floor((i-e-1)/t);Math.floor((i-1)/t)<n&&s.push(``),Bt(s,r,t),c=q(s.at(-1)??``);continue}if(c+i>t&&c&&i){if(n.wordWrap===!1&&c<t){Bt(s,r,t),c=q(s.at(-1)??``);continue}s.push(``),c=0}if(c+i>t&&n.wordWrap===!1){Bt(s,r,t),c=q(s.at(-1)??``);continue}s[s.length-1]+=r,c+=i}n.trim!==!1&&(s=s.map(e=>Vt(e)));let l=s.join(`
2
2
  `),u=!1;for(let e=0;e<l.length;e++){let t=l[e];if(r+=t,u)u=!1;else if(u=t>=`\ud800`&&t<=`\udbff`,u)continue;if(t===`\x1B`||t===`›`){It.lastIndex=e+1;let t=It.exec(l)?.groups;if(t?.code!==void 0){let e=Number.parseFloat(t.code);i=e===39?void 0:e}else t?.uri!==void 0&&(a=t.uri.length===0?void 0:t.uri)}if(l[e+1]===`
3
3
  `){a&&(r+=zt(``));let e=i?Lt(i):void 0;i&&e&&(r+=Rt(e))}else t===`
4
4
  `&&(i&&Lt(i)&&(r+=Rt(i)),a&&(r+=zt(a)))}return r},Ut=/\r?\n/;function Wt(e,t,n){return String(e).normalize().split(Ut).map(e=>Ht(e,t,n)).join(`
@@ -12,7 +12,7 @@ import{i as e,o as t,t as n}from"./chunk-DTipWd-i.mjs";import{ft as r}from"./sle
12
12
  `).pop()??``;var vn=class{height=0;extraLinesUnderPrompt=0;cursorPos;rl;constructor(e){this.rl=e,this.cursorPos=e.getCursorPos()}write(e){this.rl.output.unmute(),this.rl.output.write(e),this.rl.output.mute()}render(e,t=``){let n=Pe(_n(e)),r=n;this.rl.line.length>0&&(r=r.slice(0,-this.rl.line.length)),this.rl.setPrompt(r),this.cursorPos=this.rl.getCursorPos();let i=Kt();e=Gt(e,i),t=Gt(t,i),n.length%i===0&&(e+=`
13
13
  `);let a=e+(t?`
14
14
  `+t:``),o=Math.floor(n.length/i)-this.cursorPos.rows+(t?gn(t):0);o>0&&(a+=dn(o)),a+=pn(this.cursorPos.cols),this.write(fn(this.extraLinesUnderPrompt)+hn(this.height)+a),this.extraLinesUnderPrompt=o,this.height=gn(a)}checkCursorPos(){let e=this.rl.getCursorPos();e.cols!==this.cursorPos.cols&&(this.write(pn(e.cols)),this.cursorPos=e)}done({clearContent:e}){this.rl.setPrompt(``);let t=fn(this.extraLinesUnderPrompt);t+=e?hn(this.height):`
15
- `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},yn=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}};const bn=globalThis.setImmediate;function xn(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(e,n)=>{let r=n.slice(1);return t=r,r},Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Sn(e){let t=xn();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new Yt.default;s.pipe(r.output??process.stdout);let c=Me.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new vn(c),{promise:u,resolve:d,reject:f}=yn.withResolver(),p=()=>f(new Ke);if(a){let e=()=>f(new Ge({cause:a.reason}));if(a.aborted)return e(),Object.assign(u,{cancel:p});a.addEventListener(`abort`,e),o.add(()=>a.removeEventListener(`abort`,e))}o.add(sn((e,t)=>{f(new qe(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new qe(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Qe(c,a=>{let m=Ie.bind(()=>rt.clearAll());c.on(`close`,m),o.add(()=>c.removeListener(`close`,m));let h=()=>{let r=()=>l.checkCursorPos();c.input.on(`keypress`,r),o.add(()=>c.input.removeListener(`keypress`,r));let i=null;a(()=>{let r=!1;try{let a=e(n,e=>{r?d(e):i={value:e}});if(a===void 0){let e=t[1]?.getFileName();throw e&&!e.startsWith(`file://`)&&(e=xe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),rt.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?bn(h):h(),Object.assign(u.then(e=>(rt.clearAll(),e),e=>{throw rt.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var Y=class{separator=H(`dim`,Array.from({length:15}).join(K.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}},Cn=r();const wn=`**/.ok/*`,Tn=`!**/${c}/`;function En(e){let t=[`.ok/`,`.okignore`];for(let n of de){let r=D[n];r.projectConfigPath&&t.push(Rn(r.projectConfigPath(e),e))}t.push(`.claude/launch.json`);let n=L(e,...a);if(B(n))try{let e=s(V(n,`utf-8`));if(e){for(let[n,r]of Object.entries(e.skills))if(n!==`open-knowledge`)for(let e of r.hosts){let r=o[e];r&&t.push(`${r}/${n}/`)}}}catch{}return Array.from(new Set(t))}function Dn(e,t){let n=Mn(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:Nn(n)};let r=Pn(e);if(r.kind!==`ok`)return r.result;let i=B(r.path)?V(r.path,`utf-8`):``,a=Ln(i),o=[],s=[];for(let e of t)In(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
15
+ `,t+=`\x1B[G`,t+=`\x1B[?25h`,this.write(t),this.rl.close()}},yn=class extends Promise{static withResolver(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}};const bn=globalThis.setImmediate;function xn(){let e=Error.prepareStackTrace,t=[];try{Error.prepareStackTrace=(e,n)=>{let r=n.slice(1);return t=r,r},Error().stack}catch{return t}return Error.prepareStackTrace=e,t}function Sn(e){let t=xn();return(n,r={})=>{let{input:i=process.stdin,signal:a}=r,o=new Set,s=new Yt.default;s.pipe(r.output??process.stdout);let c=Me.createInterface({terminal:!0,input:i,output:s});s.mute();let l=new vn(c),{promise:u,resolve:d,reject:f}=yn.withResolver(),p=()=>f(new Ke);if(a){let e=()=>f(new Ge({cause:a.reason}));if(a.aborted)return e(),Object.assign(u,{cancel:p});a.addEventListener(`abort`,e),o.add(()=>a.removeEventListener(`abort`,e))}o.add(sn((e,t)=>{f(new qe(`User force closed the prompt with ${e} ${t}`))}));let m=()=>f(new qe(`User force closed the prompt with SIGINT`));return c.on(`SIGINT`,m),o.add(()=>c.removeListener(`SIGINT`,m)),Qe(c,a=>{let m=Ie.bind(()=>rt.clearAll());c.on(`close`,m),o.add(()=>c.removeListener(`close`,m));let h=()=>{let r=()=>l.checkCursorPos();c.input.on(`keypress`,r),o.add(()=>c.input.removeListener(`keypress`,r));let i=null;a(()=>{let r=!1;try{let a=e(n,e=>{r?d(e):i={value:e}});if(a===void 0){let e=t[1]?.getFileName();throw e&&!e.startsWith(`file://`)&&(e=xe.resolve(e)),Error(`Prompt functions must return a string.\n at ${e}`)}let[o,s]=typeof a==`string`?[a]:a;l.render(o,s),rt.run()}catch(e){f(e)}if(r=!0,i!==null){let{value:e}=i;i=null,d(e)}})};return`readableFlowing`in i?bn(h):h(),Object.assign(u.then(e=>(rt.clearAll(),e),e=>{throw rt.clearAll(),e}).finally(()=>{o.forEach(e=>e()),l.done({clearContent:!!r.clearPromptOnDone}),s.end()}).then(()=>u),{cancel:p})})}}var Y=class{separator=H(`dim`,Array.from({length:15}).join(K.line));type=`separator`;constructor(e){e&&(this.separator=e)}static isSeparator(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`separator`)}},Cn=r();const wn=`**/.ok/*`,Tn=`!**/${o}/`;function En(e){let t=[`.ok/`,`.okignore`];for(let n of de){let r=D[n];r.projectConfigPath&&t.push(Rn(r.projectConfigPath(e),e))}t.push(`.claude/launch.json`);let n=L(e,...a);if(B(n))try{let e=s(V(n,`utf-8`));if(e){for(let[n,r]of Object.entries(e.skills))if(n!==`open-knowledge`)for(let e of r.hosts){let r=c[e];r&&t.push(`${r}/${n}/`)}}}catch{}return Array.from(new Set(t))}function Dn(e,t){let n=Mn(e,t).tracked;if(n.length>0)return{kind:`refused-tracked`,tracked:n,remediation:Nn(n)};let r=Pn(e);if(r.kind!==`ok`)return r.result;let i=B(r.path)?V(r.path,`utf-8`):``,a=Ln(i),o=[],s=[];for(let e of t)In(a,e)?s.push(e):o.push(e);if(o.length===0)return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]};let c=i.length===0||i.endsWith(`
16
16
  `)?``:`
17
17
  `,l=`${o.join(`
18
18
  `)}\n`;try{Ae(r.path,`${i}${c}${l}`,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}return{kind:`updated`,appended:o,alreadyPresent:s,removed:[]}}function On(e,t){let n=Pn(e);if(n.kind!==`ok`)return n.result;if(!B(n.path))return{kind:`updated`,appended:[],alreadyPresent:[],removed:[]};let r=t.map(e=>Fn(e)),i=new Set;for(let e of r)for(let t of e)i.add(t);i.add(wn),i.add(Tn);let a;try{a=V(n.path,`utf-8`)}catch{return{kind:`no-exclude`,reason:`inaccessible`}}let o=a.split(`
@@ -633,6 +633,6 @@ export default function okBridge(pi: {
633
633
  `));let f=`${a?``:``}${u}`;return f!==i&&w(e,f,{mode:Hn(e)}),{kind:l?`overwritten`:`written`}}const bi=e=>e!==`project`,xi=e=>e!==`user`;async function Si(){let e=await Zn({message:`Where should the MCP server be configured?
634
634
  `,required:!1,theme:{icon:{checked:`[x]`,unchecked:`[ ]`}},choices:[{name:`User-level (~/.claude.json, ~/.cursor/mcp.json, …)`,value:`user`,checked:!0},{name:`Project-level (.mcp.json, .cursor/mcp.json, …)`,value:`project`,checked:!0}]});return e.includes(`user`)&&e.includes(`project`)?`both`:e.includes(`user`)?`user`:e.includes(`project`)?`project`:null}async function Ci(e){return e.mcp===!1?null:e.scope?e.scope:e.isTTY??process.stdout.isTTY?(e.promptFn??Si)():`both`}async function wi(e){return nr({message:`How do you want to handle OpenKnowledge config files (.ok/, .mcp.json, project skills)?`,default:e,choices:[{name:`Share with my team (commit alongside content)`,value:`shared`,description:`OK config gets committed alongside your project content.`},{name:`Local only (keep out of git via .git/info/exclude)`,value:`local-only`,description:"OK config stays on this machine only; teammates do not see it. Safe escape hatch via `ok config-sharing share`."}]})}async function Ti(e){if(e.sharing!==void 0)return e.sharing;let t=kn(e.projectRoot)===`local-only`?`local-only`:`shared`;return e.isTTY??process.stdout.isTTY?(e.promptFn??wi)(t):t}var $=class extends Error{constructor(e){super(e),this.name=`ContentDirError`}};function Ei(e){if(e===void 0||e===!0)return new Set(ae);if(e===!1)return new Set;let t=e.split(`,`).map(e=>e.trim()).filter(Boolean);return new Set(ae.filter(e=>t.includes(e)))}function Di(e,t,n){let r=Se(n,e),i;try{i=ke(r)}catch(e){let t=e.code;throw t===`ENOENT`?new $(`--content-dir path does not exist: ${r}`):new $(`--content-dir path is not accessible (${t??`unknown error`}): ${r}`)}if(!i.isDirectory())throw new $(`--content-dir must be a directory: ${r}`);let a=R(Oi(t),Oi(r));if(a.startsWith(`..`)||I(a))throw new $(`--content-dir must be inside the project root (${t}); got ${r}`);return a===``?`.`:a}function Oi(e){try{return Oe(e)}catch{return e}}const ki=`open-knowledge-ui`;function Ai(e,t,n){try{return B(e.detectPath?.(t,n)??F(e.configPath(t,n)))}catch{return!1}}function ji(e,t,n,r,i){let a=e.serverName(t),o;try{o=i??e.configPath(t,r)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:``,serverName:a,error:t instanceof Error?t.message:String(t)}}let s=!n.skipAvailabilityCheck||e.offerOnlyWhenDetected===!0;if(!i&&s&&!Ai(e,t,r))return{editorId:e.id,label:e.label,action:`skipped-missing`,configPath:o,serverName:a};if(i!==void 0)try{me(o,t)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),configScope:`project`}}if(e.format===`file`)return Ni(e,o,a,n,{isProjectScope:i!==void 0});let c;try{c=e.buildEntry(t,n)}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}try{Ee(F(o),{recursive:!0})}catch(t){return{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:t instanceof Error?t.message:String(t),...i===void 0?{}:{configScope:`project`}}}let l={action:`written`},u;try{se(`${o}.lock`,()=>{let t=Yr(o).writePath;if(Ee(F(t),{recursive:!0}),e.format===`toml`){let n=vi(ri(),t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}if(e.format===`yaml`){let n=yi(t,e.topLevelKey,a,c);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason);return}let n=_i(t,e.topLevelKey,a,c,e.serverMapSubKey);l.action=n.kind,n.kind===`declined`&&(l.declineReason=n.reason)},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){u=e instanceof Error?e:Error(String(e))}return u?{editorId:e.id,label:e.label,action:`failed`,configPath:o,serverName:a,error:u.message,...i===void 0?{}:{configScope:`project`}}:l.action===`declined`?{editorId:e.id,label:e.label,action:`declined`,configPath:o,serverName:a,declineReason:l.declineReason,...i===void 0?{}:{configScope:`project`}}:{editorId:e.id,label:e.label,action:l.action,configPath:o,serverName:a,...i===void 0?{}:{configScope:`project`}}}const Mi={pi:Lr};function Ni(e,t,n,r,i){let a=i.isProjectScope?{configScope:`project`}:{},o=r=>({editorId:e.id,label:e.label,action:`failed`,configPath:t,serverName:n,error:r instanceof Error?r.message:String(r),...a}),s=Mi[e.id];if(!s)return o(Error(`No managed-file builder registered for editor "${e.id}" (format: 'file' targets need a MANAGED_FILE_BUILDERS entry).`));let c;try{c=s(r)}catch(e){return o(e)}try{Ee(F(t),{recursive:!0})}catch(e){return o(e)}let l={action:`written`};try{se(`${t}.lock`,()=>{let e=null;try{e=V(t,`utf-8`)}catch{e=null}if(e===c){l.action=`overwritten`;return}w(t,c,e===null?void 0:{mode:Hn(t)}),l.action=e===null?`written`:`overwritten`},{onWarn:(e,t)=>process.stderr.write(`[ok] ${e} ${JSON.stringify(t)}\n`)})}catch(e){return o(e)}return{editorId:e.id,label:e.label,action:l.action,configPath:t,serverName:n,...a}}function Pi(e,t){let n=e.projectConfigPath?.(t);if(!(!n||!B(n)))return{editorId:e.id,label:e.label,path:n}}function Fi(e,t,n,r){let i=Li(e,t,n,r);return i.kind===`present`?i.entry:null}function Ii(e,t,n,r){let i=gi(e,t,r);if(!P(i))return{kind:`no-entry`};let a=i[n];return P(a)?{kind:`present`,entry:a}:{kind:`no-entry`}}function Li(e,t,n,r){let i;try{i=r??e.configPath(t,n)}catch{return{kind:`absent`}}if(!B(i))return{kind:`absent`};try{if(ke(i).size>di)return{kind:`decline`,reason:`oversize`}}catch{return{kind:`decline`,reason:`unparseable`}}let a;try{a=V(i,`utf-8`)}catch{return{kind:`decline`,reason:`unparseable`}}if(a.trim()===``)return{kind:`absent`};if(e.format===`file`)return{kind:`present`,entry:Ir(a)};let o=e.serverName(t);if(e.format===`toml`){let t;try{t=ri().parseToObject(a)}catch{return{kind:`decline`,reason:`unparseable`}}return Ii(t,e.topLevelKey,o,e.serverMapSubKey)}if(e.format===`yaml`){let t=(0,Cn.parseDocument)(a.charCodeAt(0)===65279?a.slice(1):a);return t.errors.length>0?{kind:`decline`,reason:`unparseable`}:Ii(t.toJS()??{},e.topLevelKey,o,e.serverMapSubKey)}let s=oi(a);return s?si(s,e.topLevelKey)>1?{kind:`decline`,reason:`duplicate-container`}:Ii(p(s),e.topLevelKey,o,e.serverMapSubKey):{kind:`decline`,reason:`unparseable`}}async function Ri(e={}){let t=Se(e.cwd??process.cwd()),n=Vr(t,{homeDir:e.home}),r=n.projectRoot,a=!B(L(r,`.ok`)),o=n.gitRootPromoted?R(r,t):void 0,s=e.contentDir===void 0?n.defaultContentDir:Di(e.contentDir,r,t);n.ancestorPromoted?console.log(`[ok] Opened existing project at ${r}`):n.gitRootPromoted&&a&&s===`.`&&process.stderr.write(`${M(`[ok] Content scope promoted to the git repo root: ${r}`)}\n Ran in ${o}/, but .ok/ lives at the git root (one .ok/ per git repo),\n so the whole repo is now the content scope. To narrow it, re-run with\n \`ok init --content-dir .\`, or set content.dir: ${o} in .ok/config.yml.\n`);let c={mode:e.devMcp?`dev`:`published`},l=await ie(r),d;try{d=b(r,{contentDir:s})}catch(t){let i=D.claude.configPath(r,e.home);return{projectRoot:r,contentCreated:[],contentUpdated:[],contentSkipped:[],editors:[],projectSkills:[],legacyProjectConfigs:[],didGitInit:l.didInit,rootGitignoreCreated:!1,gitRootPromoted:n.gitRootPromoted,promotedFromDir:o,contentDirRequested:e.contentDir,contentScaffoldFailed:!0,mcpAction:`failed`,mcpPath:i,mcpError:`Content scaffolding failed: ${t instanceof Error?t.message:String(t)}`,sharing:{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:!1}}}let f=d.created.includes(_e),p=!1;if(l.didInit)try{p=g(r)===`created`}catch(e){console.warn(`[ok] Skipping .gitignore seed at ${r}: ${e instanceof Error?e.message:String(e)}`)}try{oe(r)}catch(e){console.warn(`[ok] Skipping project-skill .gitignore entry at ${r}: ${e instanceof Error?e.message:String(e)}`)}let m=await x(r);m.kind===`untracked`&&console.warn(`[ok] Untracked the OpenKnowledge project skill (${m.dirs.join(`, `)}) — it is now local-only. Teammates will see this as a deletion on their next pull.`);let h=await Ci({scope:e.scope,mcp:e.mcp,isTTY:e.isTTY,promptFn:e.promptFn}),_=e.editors??Wi(r,e.home),v=e.editors??de.filter(e=>D[e].projectConfigPath!==void 0||D[e].projectSkillPath!==void 0),C=ce(_),te=ce(v),w=e.mcp===!1||h===null,se=Array.from(new Map([...C,...w?[]:te].map(e=>[e.id,e])).values()),le=C.filter(t=>Ai(t,r,e.home)),T=[],E=[],ue=new Set;for(let t of se){if(w){let n=``;try{n=t.configPath(r,e.home)}catch{}T.push({editorId:t.id,label:t.label,action:`skipped-flag`,configPath:n,serverName:t.serverName(r)});continue}if(bi(h)&&C.includes(t)&&t.scope===`global`&&T.push(ji(t,r,c,e.home)),xi(h)&&te.includes(t)&&t.projectConfigPath){let n=t.projectConfigPath(r),i=ji(t,r,c,e.home,n);T.push(i),(i.action===`written`||i.action===`overwritten`)&&ue.add(n)}}let fe=new Set;for(let t of te){let n=t.projectSkillPath?.(r);!n||fe.has(n)||(fe.add(n),E.push(pe(t,r,{home:e.home})))}let me=E.filter(e=>e.action===`written`||e.action===`overwritten`).map(e=>e.editorId);if(me.length>0){let t=e.home??je();ne({source:i,skills:[u.project],agents:me,scope:r},{home:t,enabled:S(t).enabled})}let he=!w&&h!==null&&xi(h)?te.filter(e=>!e.projectConfigPath&&!e.projectSkillPath).map(e=>e.label):void 0,ge=w?[]:le.map(e=>Pi(e,r)).filter(e=>e!==void 0).filter(e=>!ue.has(e.path)),O=e.installUserSkill??y,k=e.home??je(),A=Ei(e.skills),j=!1,N=!1,P=!1,ve=!1,ye=!1;for(let t of ae){if(!A.has(t))continue;await re(k,u[t],!0).catch(()=>{}),j=!0;let n=await O({home:e.home,bundleId:t,force:!0});n===`installed`?N=!0:n===`failed`?P=!0:n===`no-hosts`?ye=!0:ve=!0}let be=P?`failed`:N?`installed`:j&&ve?`skip-current`:j&&ye?`no-hosts`:`declined`,xe=N?ee(k).map(e=>e.editorId):[],F=w?`skipped-flag`:`skipped-missing`,I=T.find(e=>e.editorId===`claude`)??T[0]??{action:F,configPath:D.claude.configPath(r,e.home)},Ce=await zi({projectRoot:r,desiredMode:await Ti({sharing:e.sharing,projectRoot:r,isTTY:e.isTTY,promptFn:e.sharingPromptFn}),explicitFlag:e.sharing});return{projectRoot:r,contentCreated:d.created,contentUpdated:d.updated,contentSkipped:d.skipped,editors:T,projectSkills:E,legacyProjectConfigs:ge,skillInstall:be,skillHosts:xe,didGitInit:l.didInit,rootGitignoreCreated:p,gitRootPromoted:n.gitRootPromoted,promotedFromDir:o,contentDir:f?s:void 0,contentDirRequested:e.contentDir,contentScaffoldFailed:!1,mcpAction:I.action,mcpPath:I.configPath,mcpError:`error`in I?I.error:void 0,projectScopeUnsupportedLabels:he,sharing:Ce}}async function zi(e){let{projectRoot:t,desiredMode:n,explicitFlag:r}=e,i=kn(t);if(i===`no-git`)return{kind:`no-exclude`,reason:`no-git`,localOnlyRequested:r===`local-only`};let a=En(t);if(n===`local-only`){let e=Dn(t,a);if(e.kind===`refused-tracked`){let t=e;return{kind:`refused-tracked`,tracked:t.tracked,remediation:t.remediation}}return e.kind===`no-exclude`?{kind:`no-exclude`,reason:e.reason,localOnlyRequested:r===`local-only`}:Bi(t,e,`add`)}if(i===`shared`)return{kind:`applied`,mode:`shared`,action:`noop`,appended:[],alreadyPresent:[],removed:[]};let o=On(t,a);return o.kind===`no-exclude`?{kind:`no-exclude`,reason:o.reason,localOnlyRequested:!1}:Bi(t,o,`remove`)}function Bi(e,t,n){let r=kn(e);return n===`add`?{kind:`applied`,mode:r,action:t.appended.length>0?`added`:`noop`,appended:t.appended,alreadyPresent:t.alreadyPresent,removed:[]}:{kind:`applied`,mode:r,action:`removed`,appended:[],alreadyPresent:[],removed:t.removed}}function Vi(e){switch(e){case`oversize`:return`config too large to edit safely`;case`duplicate-container`:return`duplicate server block`;case`no-native-writer`:return`no format-preserving writer available`;default:return`config not readable`}}function Hi(e,t){let n=[],r=e.editors.some(e=>e.action===`written`||e.action===`overwritten`),i=e.editors.some(e=>e.action===`failed`)||e.projectSkills.some(e=>e.action===`failed`),a=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-flag`),o=e.editors.length>0&&e.editors.every(e=>e.action===`skipped-missing`);e.didGitInit&&n.push(`Initialized git repo at ${t}/.git/ (default branch: main)`),e.rootGitignoreCreated&&n.push(`Seeded .gitignore at ${t}/.gitignore (.DS_Store)`);let s=L(t,`.ok`);if(e.contentCreated.length>0||e.contentUpdated.length>0?(n.push(N(`Content scaffolded at ${s}/`)),e.contentCreated.length>0&&n.push(` Created: ${e.contentCreated.join(`, `)}`),e.contentUpdated.length>0&&n.push(` Updated: ${e.contentUpdated.join(`, `)}`)):n.push(N(`Content already present at ${s}/`)),e.contentSkipped.length>0&&n.push(` Skipped (already exist): ${e.contentSkipped.join(`, `)}`),n.push(``),e.mcpError&&e.editors.length===0)n.push(`Warning: ${e.mcpError}`);else if(e.editors.length===0)if(n.push(N(`MCP server configuration:`)),e.mcpAction===`skipped-flag`)n.push(` MCP config not written — use without --no-mcp to configure editors`);else if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}else n.push(` No supported editor config directories detected; skipped MCP registration`);else if(a)n.push(`MCP config not written — use without --no-mcp to configure editors`);else if(o)n.push(N(`MCP server configuration:`)),n.push(` No supported editor config directories detected; skipped MCP registration`);else{n.push(N(`MCP server configuration:`));for(let r of e.editors){let e=r.configPath.startsWith(t)?R(t,r.configPath):r.configPath.replace(/^\/Users\/[^/]+/,`~`),i=r.serverName===`open-knowledge`?``:` (${r.serverName})`,a=r.configScope===`project`?` (project)`:``,o=`${r.label}${a}`,s=` `.repeat(Math.max(1,20-o.length)),c=r.editorId===`claude-desktop`&&(r.action===`written`||r.action===`overwritten`)?` — quit and relaunch Claude Desktop to activate`:``;switch(r.action){case`written`:n.push(` ${o}${s}${e} ${A(`registered`)}${i}${c}`);break;case`overwritten`:n.push(` ${o}${s}${e} ${A(`updated`)}${i}${c}`);break;case`skipped-missing`:n.push(` ${o}${s}${e} config root missing; skipped`);break;case`failed`:n.push(` ${o}${s}${e} ${j(`FAILED`)}: ${r.error}`);break;case`declined`:n.push(` ${o}${s}${e} left unchanged (${Vi(r.declineReason)})`);break;case`skipped-flag`:break;default:r.action}}if(e.projectScopeUnsupportedLabels&&e.projectScopeUnsupportedLabels.length>0){let t=e.projectScopeUnsupportedLabels.join(`, `),r=e.projectScopeUnsupportedLabels.length===1?`does`:`do`;n.push(` ${t} ${r} not support project-level config; skipped`)}}if(e.projectSkills.length>0){n.push(``),n.push(N(`Project-local skills:`));for(let r of e.projectSkills){let e=`${r.label} (project)`,i=` `.repeat(Math.max(1,20-e.length)),a=r.path?R(t,r.path):``;switch(r.action){case`written`:n.push(` ${e}${i}${a} ${A(`installed`)}`);break;case`overwritten`:n.push(` ${e}${i}${a} ${A(`updated`)}`);break;case`skipped-unsupported`:n.push(` ${e}${i}no known project skill surface; skipped`);break;case`skipped-prerequisite`:n.push(` ${e}${i}OpenKnowledge MCP is not configured; skipped`);break;case`failed`:n.push(` ${e}${i}${a} ${j(`FAILED`)}: ${r.error}`);break}}}if(i&&(n.push(``),n.push(`For failed editors, add the MCP server entry or project skill manually. See:`),n.push(` https://github.com/inkeep/open-knowledge#mcp-setup`)),e.legacyProjectConfigs.length>0){n.push(``),n.push(`Project MCP configs found:`);for(let r of e.legacyProjectConfigs)n.push(` ${r.label} ${R(t,r.path)}`);n.push(` These project-local files may override the global config. Remove them if you want fully user-scoped MCP setup in this project.`)}if(e.skillInstall)switch(n.push(``),n.push(N(`User-global skill:`)),e.skillInstall){case`installed`:{let t=(e.skillHosts??[]).map(e=>le[e]??e),r=t.length>0?t.join(`, `):`the shared ~/.agents store`;n.push(` open-knowledge ${A(`installed for ${r}`)}`),n.push(` ${k(`Counted on skills.sh (skill name + source repo, once per machine).`)}`),n.push(` ${k(`Opt out: DO_NOT_TRACK=1, or Settings → Preferences.`)}`);break}case`skip-current`:n.push(` open-knowledge ${A(`already installed at current version`)}`);break;case`declined`:n.push(` open-knowledge ${k(`skipped for this run (--no-skills)`)}`),n.push(` ${k(`Nothing was installed or removed. Any built-in skills already on this`)}`),n.push(` ${k(`machine are untouched. Run init without the flag to install them:`)}`),n.push(` ${k(` ok init`)}`);break;case`no-hosts`:n.push(` open-knowledge ${k(`skipped — no supported agent host detected in your home directory`)}`);break;case`failed`:n.push(` ${M(`open-knowledge install failed — MCP still configured; retry with:`)}`),n.push(` ${M(` ok repair-skills`)}`);break}if(e.contentDirRequested!==void 0&&e.contentDir===void 0&&!e.contentScaffoldFailed?(n.push(``),n.push(M(`⚠ --content-dir ${e.contentDirRequested} ignored — .ok/config.yml already exists`)),n.push(` Edit .ok/config.yml → content.dir directly to change the content scope.`)):e.contentDir!==void 0&&e.contentDir!==`.`?(n.push(``),n.push(`Content scope set to ${e.contentDir}/ (content.dir in .ok/config.yml).`)):e.gitRootPromoted&&e.contentDir===`.`&&e.contentDirRequested===void 0&&(n.push(``),n.push(M(`⚠ Content scope promoted to the git repo root`)),n.push(` .ok/ was initialized at ${t} because it contains a .git folder (one .ok/ per git repo),`),n.push(` not the sub-folder you ran \`ok init\` in${e.promotedFromDir?` (${e.promotedFromDir})`:``}. The whole repo is now the content scope.`),e.promotedFromDir&&(n.push(" To scope to just that sub-folder, re-run `ok init --content-dir .` from there, or set"),n.push(` content.dir: ${e.promotedFromDir} in .ok/config.yml.`))),e.preview?(n.push(``),n.push(ve(e.preview,t))):e.previewWarning&&(n.push(``),n.push(`Content preview unavailable: ${e.previewWarning}`)),n.push(``),n.push(...qi(e.sharing,t)),r){let t=new Set,r=e.editors.filter(e=>e.action===`written`||e.action===`overwritten`).filter(e=>!t.has(e.editorId)&&t.add(e.editorId)).map(e=>e.label);n.push(``),n.push(`${A(`✓`)} ${N(`Next steps:`)}`),n.push(` 1. Open your editor (${O(r.join(` / `))})`),n.push(` 2. Approve the MCP server when prompted`),n.push(` 3. (Optional) scaffold the starter knowledge-base structure:`),n.push(` - ${O(`ok seed --list-packs`)} — browse the starter packs`),n.push(` - ${O(`ok seed`)} — scaffold an empty repo`),n.push(` 4. Ask your agent to capture a source, research a topic, or build a wiki —`),n.push(` the procedures ship as skills alongside the MCP tools.`)}return n.join(`
635
635
  `)}function Ui(e,t){return{projectRoot:e.projectRoot,gitRootPromoted:e.gitRootPromoted,promotedFromDir:e.promotedFromDir??null,contentDir:t.contentDir,contentDirRequested:e.contentDirRequested??null,contentDirApplied:e.contentDir!==void 0,contentFileCount:t.contentFileCount,previewError:e.previewWarning??null,didGitInit:e.didGitInit,mcpAction:e.mcpAction,editors:e.editors.map(e=>({editorId:e.editorId,label:e.label,action:e.action,configPath:e.configPath,scope:e.configScope===`project`?`project`:`user`}))}}function Wi(e,t){let n=[];for(let r of de)Ai(D[r],e,t)&&n.push(r);return n}function Gi(){let e={log:console.log,info:console.info,debug:console.debug},t=(...e)=>{process.stderr.write(`${e.map(e=>typeof e==`string`?e:Ne(e)).join(` `)}\n`)};return console.log=t,console.info=t,console.debug=t,()=>{console.log=e.log,console.info=e.info,console.debug=e.debug}}function Ki(){return new ge(`init`).description(`Scaffold .ok/ in the current directory and register the MCP server for your editor(s)`).option(`--mcp`,`Register the MCP server for selected editors (default: true)`,!0).option(`--no-mcp`,`Scaffold the .ok/ directory but do not touch MCP config`).option(`--dev-mcp`,`Register a local dev MCP entry using node + packages/cli/dist/cli.mjs with debug logging`).option(`--content-dir <dir>`,`Limit content to <dir> instead of the whole project. <dir> is interpreted relative to your current directory (e.g. "." = the folder you run the command in), then saved to .ok/config.yml as content.dir.`).option(`--json`,`Emit a structured JSON summary to stdout (diagnostics stay on stderr)`).option(`--skills <ids>`,`Install only the named user-global skill bundles (comma list: discovery,write-skill)`).option(`--no-skills`,`Do not install any user-global skill bundles`).addOption(new T(`--scope <scope>`,`Write MCP config at user level, project level, or both`).choices([`user`,`project`,`both`])).addOption(new T(`--shared`,`Commit OK config alongside content (the default for fresh repos)`).conflicts(`localOnly`)).addOption(new T(`--local-only`,`Keep OK config out of git via .git/info/exclude (per-clone, not committed)`).conflicts(`shared`)).action(async e=>{let t=process.cwd(),n=e.shared?`shared`:e.localOnly?`local-only`:void 0,r=e.json?Gi():null;try{let r;try{r=await Ri({cwd:t,mcp:e.mcp,devMcp:e.devMcp,scope:e.scope,sharing:n,contentDir:e.contentDir,skills:e.skills})}catch(e){if(e instanceof $){process.stderr.write(`${e.message}\n`),process.exitCode=64;return}if(e instanceof C||e instanceof v){process.stderr.write(`${e.message}\n`),process.exitCode=78;return}if(e instanceof te){process.stderr.write(`open-knowledge could not initialize a git repo for this project. Re-run, or run 'git init' yourself in the project folder.
636
- `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-tHonavs_.mjs`),{resolveContentDir:s}=await import(`./src-C3V2v4Fb.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-CbOTxxpX.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Ui(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Hi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function qi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(N(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${A(`local-only`)} — appended ${e.appended.length} path(s) to ${N(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${A(`local-only`)} — already excluded; nothing to do.`):n.push(` ${A(`local-only`)}`):e.action===`removed`?n.push(` ${A(`shared`)} — removed OK paths from ${N(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${A(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(M(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
636
+ `),e.stderr&&process.stderr.write(`${e.stderr.trim()}\n`),process.exitCode=1;return}throw e}let i=r.contentDir??`.`,a=null,{loadConfig:o}=await import(`./loader-P0nrGvJv.mjs`),{resolveContentDir:s}=await import(`./src--XQg-7vm.mjs`),c;try{c=o(r.projectRoot).config,i=c.content.dir}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}if(c)try{let{previewContent:e}=await import(`./preview-D2AT6aBO.mjs`),t=s(c,r.projectRoot);r.preview=e({projectDir:r.projectRoot,contentDir:t}),a=r.preview.totalCount}catch(e){r.previewWarning=e instanceof Error?e.message:String(e)}e.json?process.stdout.write(`${JSON.stringify(Ui(r,{contentDir:i,contentFileCount:a}),null,2)}\n`):process.stdout.write(`${Hi(r,r.projectRoot)}\n`),(r.editors.some(e=>e.action===`failed`)||r.mcpAction===`failed`)&&(process.exitCode=1)}finally{r?.()}})}function qi(e,t){let n=[];switch(e.kind){case`applied`:return n.push(N(`Sharing mode:`)),e.mode===`local-only`?e.action===`added`?n.push(` ${A(`local-only`)} — appended ${e.appended.length} path(s) to ${N(`${t}/.git/info/exclude`)} (per-clone, not committed).`):e.action===`noop`&&e.alreadyPresent.length>0?n.push(` ${A(`local-only`)} — already excluded; nothing to do.`):n.push(` ${A(`local-only`)}`):e.action===`removed`?n.push(` ${A(`shared`)} — removed OK paths from ${N(`${t}/.git/info/exclude`)}; commit the files to share with teammates.`):n.push(` ${A(`shared`)} — OK config will be committed alongside content.`),n;case`refused-tracked`:n.push(M(`Sharing mode: switch to local-only deferred`));for(let t of e.remediation.split(`
637
637
  `))n.push(t.length>0?` ${t}`:``);return n.push(` Re-run ${O(`ok config-sharing unshare`)} after resolving to complete the switch.`),n;case`no-exclude`:if(e.localOnlyRequested)n.push(M(`Sharing mode: --local-only requested but no git repo found — option ignored`)),n.push(` Run ${O(`git init`)} (or open this folder via OK Desktop, which can scaffold a repo) and then ${O(`ok config-sharing unshare`)}.`);else if(e.reason===`no-git`)return[];else n.push(M(`Sharing mode unavailable: ${e.reason}.`));return n}}export{En as A,G as B,Zn as C,Dn as D,Un as E,Sn as F,un as I,bt as L,kn as M,jn as N,Nn as O,On as P,_t as R,nr as S,Vn as T,We as V,mi as _,Ui as a,Vr as b,Hi as c,Fi as d,Ei as f,Ri as g,Ti as h,zi as i,Mn as j,An as k,qi as l,Di as m,ki as n,Li as o,Ci as p,Mi as r,Wi as s,$ as t,Ki as u,ji as v,Hn as w,Fr as x,ri as y,gt as z};
638
- //# sourceMappingURL=init-DryQvpzo.mjs.map
638
+ //# sourceMappingURL=init-BbAtilzZ.mjs.map
@@ -0,0 +1 @@
1
+ import{g as e}from"./init-BbAtilzZ.mjs";export{e as runInit};
@@ -1,2 +1,2 @@
1
- import{Br as e,Lr as t}from"./src-Bev_iKqg.mjs";import{F as n}from"./fs-traced-DV9uD41t.mjs";import{E as r,w as i}from"./init-DryQvpzo.mjs";import{t as a}from"./is-object-ByG7RnjH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=e(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=t(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
- //# sourceMappingURL=launch-json-removal-C04K7xd0.mjs.map
1
+ import{Br as e,Lr as t}from"./src-DvuwJKkU.mjs";import{F as n}from"./fs-traced-DV9uD41t.mjs";import{E as r,w as i}from"./init-BbAtilzZ.mjs";import{t as a}from"./is-object-ByG7RnjH.mjs";import{join as o}from"node:path";import{existsSync as s,readFileSync as c,rmSync as l}from"node:fs";const u={allowTrailingComma:!0,disallowComments:!1};function d(e,t){return e.error===1&&e.offset===0&&t.charCodeAt(0)===65279}function f(f){let p=o(f,`.claude`,`launch.json`);if(!s(p))return{kind:`not-present`};let m;try{m=c(p,`utf-8`)}catch{return{kind:`declined`}}let h=[],g=e(m,h,u)??void 0;if(h.some(e=>!d(e,m))||!g||g.type!==`object`)return{kind:`declined`};let _=t(g).configurations;if(!Array.isArray(_))return{kind:`not-present`};let v=_.findIndex(e=>a(e)&&e.name===`open-knowledge-ui`);if(v===-1)return{kind:`not-present`};if(_.length===1)return l(p,{force:!0}),{kind:`removed-file`};let{text:y,changed:b}=r(m,[`configurations`,v]);return b?(n(p,y,{mode:i(p)}),{kind:`removed`}):{kind:`not-present`}}export{f as t};
2
+ //# sourceMappingURL=launch-json-removal-DfpCmQT9.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as e,ft as t,l as n,m as r,u as i}from"./sleep-A0G7hOuG.mjs";import{Vs as a}from"./src-RGB2pEts.mjs";import{_ as o}from"./src-Bev_iKqg.mjs";import{I as s,k as c}from"./fs-traced-DV9uD41t.mjs";import{t as l}from"./constants-ggtyHegG.mjs";import{t as u}from"./is-object-ByG7RnjH.mjs";import{resolve as d}from"node:path";import{existsSync as f,readFileSync as p}from"node:fs";import{realpath as m}from"node:fs/promises";var h=t();async function g(e){let t=d(e);try{return await m(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function _(e){if(!f(e))return{value:null,path:e,source:null,doc:null};let t;try{t=p(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,h.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function v(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function y(e){let t=e??process.cwd(),u=[],f=[],p=[],m=c(`user`,t),h=s({absPath:m});f.push(...h.diagnostics),!h.valid&&h.sidelinedTo!==void 0&&p.push({from:m,to:h.sidelinedTo}),h.valid&&h.source!==void 0&&u.push(m);let g=e=>{let t=_(e);if(t.diagnostic!==void 0&&f.push(t.diagnostic),t.value===null)return{};let r=n({value:t.value,file:t.path,source:t.source,doc:t.doc});return f.push(...r),u.push(e),r.length>0?i(t.value):t.value},y=d(t,`.ok`,l),b=g(y),x=g(c(`project-local`,t)),S=a(h.value,b,x),C=o.safeParse(S);if(!C.success){let e=_(y),t={code:`SCHEMA_INVALID`,issues:v(C.error.issues,e)};throw Error(r(t))}return{config:C.data,sources:u,diagnostics:f,sidelined:p}}function b(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??y,r=new Map,i=new Map,a=g(e.startupCwd);return async o=>{let s=await g(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{y as n,b as t};
2
- //# sourceMappingURL=loader-DAyo63Sq.mjs.map
1
+ import{d as e,ft as t,l as n,m as r,u as i}from"./sleep-A0G7hOuG.mjs";import{Gs as a}from"./src-Dj6UxpKM.mjs";import{_ as o}from"./src-DvuwJKkU.mjs";import{I as s,k as c}from"./fs-traced-DV9uD41t.mjs";import{t as l}from"./constants-CibuukV7.mjs";import{t as u}from"./is-object-ByG7RnjH.mjs";import{resolve as d}from"node:path";import{existsSync as f,readFileSync as p}from"node:fs";import{realpath as m}from"node:fs/promises";var h=t();async function g(e){let t=d(e);try{return await m(t)}catch(e){if(e.code!==`ENOENT`){let n=e instanceof Error?e.message:String(e);console.warn(`[normalize-cwd] realpath failed for ${t}: ${n}`)}return t}}function _(e){if(!f(e))return{value:null,path:e,source:null,doc:null};let t;try{t=p(e,`utf-8`)}catch(t){let n=t instanceof Error?t.message:String(t);return console.warn(`[config] Failed to read ${e}: ${n}`),{value:null,path:e,source:null,doc:null,diagnostic:{code:`UNREADABLE`,detail:`${e}: ${n}`}}}let n=(0,h.parseDocument)(t);if(n.errors.length>0){let r=n.errors.map(e=>e.message).join(`; `);return console.warn(`[config] Failed to parse ${e}: ${r}`),{value:null,path:e,source:t,doc:null,diagnostic:{code:`YAML_PARSE`,detail:`${e}: ${r}`}}}let r=n.toJSON();return u(r)?{value:r,path:e,source:t,doc:n}:{value:null,path:e,source:t,doc:n}}function v(t,n){return t.map(t=>{let r=t.path.map(e=>typeof e==`symbol`?String(e):e),i={path:r,message:t.message,issueCode:t.code};if(n.doc!==null&&n.source!==null){let t=e({file:n.path,source:n.source,doc:n.doc,path:r});if(t!==void 0)return{...i,source:t}}return i})}function y(e){let t=e??process.cwd(),u=[],f=[],p=[],m=c(`user`,t),h=s({absPath:m});f.push(...h.diagnostics),!h.valid&&h.sidelinedTo!==void 0&&p.push({from:m,to:h.sidelinedTo}),h.valid&&h.source!==void 0&&u.push(m);let g=e=>{let t=_(e);if(t.diagnostic!==void 0&&f.push(t.diagnostic),t.value===null)return{};let r=n({value:t.value,file:t.path,source:t.source,doc:t.doc});return f.push(...r),u.push(e),r.length>0?i(t.value):t.value},y=d(t,`.ok`,l),b=g(y),x=g(c(`project-local`,t)),S=a(h.value,b,x),C=o.safeParse(S);if(!C.success){let e=_(y),t={code:`SCHEMA_INVALID`,issues:v(C.error.issues,e)};throw Error(r(t))}return{config:C.data,sources:u,diagnostics:f,sidelined:p}}function b(e){let t=e.cacheMs??1e3,n=e.loadConfigFn??y,r=new Map,i=new Map,a=g(e.startupCwd);return async o=>{let s=await g(o??e.startupCwd),c=Date.now(),l=r.get(s);if(l&&l.expiresAt>c)return l.config;let u=i.get(s);if(u)return await u;let d=(async()=>{if(s===await a)return r.set(s,{config:e.startupConfig,expiresAt:Date.now()+t}),e.startupConfig;let i=n(s).config;return r.set(s,{config:i,expiresAt:Date.now()+t}),i})();i.set(s,d);try{return await d}finally{i.delete(s)}}}export{y as n,b as t};
2
+ //# sourceMappingURL=loader-BOUyv05v.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e}from"./loader-BOUyv05v.mjs";export{e as loadConfig};
@@ -0,0 +1,2 @@
1
+ import{Ka as e,Lo as t,Mo as n}from"./src-Dj6UxpKM.mjs";const r=new e({extensions:n,deriveStructuralFreshness:!0}),i=t(n);export{i as n,r as t};
2
+ //# sourceMappingURL=md-manager-45eVlaBq.mjs.map
@@ -1,2 +1,2 @@
1
- import{Zr as e}from"./src-Bev_iKqg.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
2
- //# sourceMappingURL=open-browser-DF0vEOcg.mjs.map
1
+ import{Zr as e}from"./src-DvuwJKkU.mjs";import{execFile as t}from"node:child_process";const n=new Set([`http:`,`https:`]),r=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function i(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function a(a){let o;try{o=new URL(a)}catch{i(a,`invalid URL`);return}if(!n.has(o.protocol)){i(a,`unsupported scheme '${o.protocol}'`);return}if(r.test(a)){i(a,`URL contains unsafe characters`);return}t(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,a]:[a],e({}),e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${a} manually`)})}export{a as openBrowser};
2
+ //# sourceMappingURL=open-browser-BA50pLLQ.mjs.map
@@ -1,2 +1,2 @@
1
- import{t as e}from"./md-manager-CUGZ0GRt.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
1
+ import{t as e}from"./md-manager-45eVlaBq.mjs";import{parentPort as t}from"node:worker_threads";function n(t){try{let n,r;if(t.embedTable!==void 0&&t.sourcePath!==void 0){let e=t.embedTable;r={sourcePath:t.sourcePath,resolveEmbed:t=>e[t]?.path??null,...t.wantSizes?{resolveSize:t=>e[t]?.size??null}:{}}}else if(t.recordEmbeds&&t.sourcePath!==void 0){let e=new Set;n=e,r={sourcePath:t.sourcePath,resolveEmbed:t=>(e.add(t),null),...t.wantSizes?{resolveSize:t=>(e.add(t),null)}:{}}}let i=e.parseWithFallback(t.body,r);return n!==void 0&&n.size>0?{id:t.id,ok:!0,parsedJson:i,requestedTargets:[...n]}:{id:t.id,ok:!0,parsedJson:i}}catch(e){return{id:t.id,ok:!1,message:e instanceof Error?e.message.slice(0,500):String(e).slice(0,500)}}}t?.on(`message`,e=>{t?.postMessage(n(e))});export{};
2
2
  //# sourceMappingURL=parse-worker.mjs.map
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./preview-DoBitDZ-.mjs";export{t as formatPreviewBlock,e as previewContent};
@@ -1,3 +1,3 @@
1
- import{Vr as e}from"./src-Bev_iKqg.mjs";import"./constants-ggtyHegG.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
1
+ import{Vr as e}from"./src-DvuwJKkU.mjs";import"./constants-CibuukV7.mjs";import{join as t,relative as n}from"node:path";import{existsSync as r,lstatSync as i,readdirSync as a,realpathSync as o,statSync as s}from"node:fs";function c(r){let{projectDir:c,contentDir:l,sampleCap:u=5}=r,d=[],f=[];try{i(l)}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[`cannot access content directory ${l}: ${e instanceof Error?e.message:String(e)}`]}}let p;try{p=e({projectDir:c,contentDir:l})}catch(e){return{totalCount:0,sample:[],contentDir:l,warnings:[e instanceof Error?e.message:String(e)]}}function m(e){let r;try{r=a(e,{withFileTypes:!0})}catch(t){let r=t instanceof Error?t.message:String(t);d.push(`could not read directory ${n(l,e)||`.`}: ${r}`);return}for(let i of r){let r=t(e,i.name);if(i.isSymbolicLink()){let e;try{e=o(r)}catch(e){let t=e.code;t===`ENOENT`||t===`ELOOP`?d.push(`broken or cyclic symlink: ${n(l,r)}`):d.push(`cannot resolve symlink ${n(l,r)}: ${t??`unknown error`}`);continue}let t;try{t=s(e)}catch{continue}if(t.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(t.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}else if(i.isDirectory()){let e=n(l,r);if(p.isDirExcluded(e))continue;m(r)}else if(i.isFile()){let e=n(l,r);if(p.isExcluded(e))continue;f.push(e)}}}return m(l),{totalCount:f.length,sample:f.slice(0,u),contentDir:l,warnings:d}}function l(e,i){let a=[],o=n(i,e.contentDir),s=o===``?`./`:`./${o}`;if(a.push(`Content:`),a.push(` Found ${e.totalCount} markdown files in ${s}`),e.sample.length>0){let t=e.sample.join(`, `),n=e.totalCount>e.sample.length?`, …`:``;a.push(` Sample: ${t}${n}`)}if(e.warnings.length>0)for(let t of e.warnings)a.push(` Warning: ${t}`);return a.push(``),r(t(i,`.ok`,`config.yml`))?(a.push(` To adjust scope, add patterns to .okignore at the project root.`),a.push(` To change the content root, edit .ok/config.yml → content.dir.`)):a.push(" Run `open-knowledge init` to scaffold config + .okignore."),a.push(``),a.push(` Re-check anytime: open-knowledge preview`),a.join(`
2
2
  `)}export{c as n,l as t};
3
- //# sourceMappingURL=preview-Dvl3K5Z6.mjs.map
3
+ //# sourceMappingURL=preview-DoBitDZ-.mjs.map
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,o as r}from"./DocumentContext-BN8gSwJ-.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-CA0dewJJ.js";import{i as l,n as u,t as d}from"./tooltip-DHXgxWLL.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-DztIj-ZS.js";import{t as v}from"./dist-DUfEoSbR.js";import{n as y}from"./dist-B6jB2qbD2.js";import{c as b}from"./Mermaid-BHfANkja.js";import{r as x}from"./CopyButton-ByR_1gcU.js";import{i as S}from"./prop-types-ClS-DLuz.js";import{t as C}from"./spinner-BqySY7qY.js";import{t as w}from"./undo-2-WGCwknr8.js";import{c as T}from"./navigation-targets-iVnea4YK.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-BJiYj2BI.js";import{t as j}from"./timeline-diff-store-DnRthkM7.js";import{n as M}from"./use-activity-panel-BEnqyFcJ.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:x}=o(),[S,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==x||t[9]!==M||t[10]!==r?(z=x({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=x,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==S?(B=I(n.ts,S),t[14]=n.ts,t[15]=S,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==x||t[35]!==M||t[36]!==r?(K=x({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=x,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(C,{className:`size-3`,"aria-hidden":`true`}):(0,F.jsx)(w,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==x||t[46]!==L||t[47]!==s?(Y=x(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=x,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===x?de=t[60]:(de=x({id:`a4FRQv`}),t[59]=x,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return v._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(x,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(b,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return v._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=n(),{openTargetTransition:d}=r(),{pageMeta:f}=S(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let b;t[9]!==d||t[10]!==f?(b=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=b):b=t[11];let x=b,C;t[12]!==p||t[13]!==l?(C=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=C):C=t[14];let w=C,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),y.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);y.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{a as n,o as r}from"./DocumentContext-J495RUh0.js";import{t as i}from"./react-f2sANaYj.js";import{n as a,r as o}from"./dist-Nvb76hAm.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{t as c}from"./button-CA0dewJJ.js";import{i as l,n as u,t as d}from"./tooltip-DHXgxWLL.js";import{a as f,c as p,i as m,o as h,s as g,t as _}from"./dialog-R8GugqUq.js";import{t as v}from"./dist-DUfEoSbR.js";import{n as y}from"./dist-B6jB2qbD2.js";import{c as b}from"./Mermaid-mUyEEsA0.js";import{r as x}from"./CopyButton-CKyZY1PL.js";import{i as S}from"./prop-types-BIrEWnOv.js";import{t as C}from"./spinner-CHTY-VE-.js";import{t as w}from"./undo-2-CMyZc9mZ.js";import{c as T}from"./navigation-targets-C1boWExT.js";import{a as E,i as D,n as O,o as k,t as A}from"./agent-diff-store-DxMs0J9Y.js";import{t as j}from"./timeline-diff-store-DnRthkM7.js";import{n as M}from"./use-activity-panel-DeQ1S88x.js";var N=s(),P=e(i(),1),F=t();function I(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}return new Date(e).toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,second:`2-digit`})}function ee(e){let t=(0,N.c)(86),{burst:n,docName:r,editCount:i,sessionAlive:s,inFlight:v,onOpenDiff:y,onRestore:b}=e,{_:x}=o(),[S,T]=(0,P.useState)(te),D,O;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>{let e=setInterval(()=>T(Date.now()),3e4);return()=>clearInterval(e)},O=[],t[0]=D,t[1]=O):(D=t[0],O=t[1]),(0,P.useEffect)(D,O);let[k,A]=(0,P.useState)(!1),j=E(),M=n.stackIndex+1,ee=j?.docName===r&&j.keptCount===M,L=i-M,ne=!s||v||L<=0,re;t[2]!==L||t[3]!==b?(re=function(){A(!1),b(L)},t[2]=L,t[3]=b,t[4]=re):re=t[4];let ie=re,R;t[5]!==n||t[6]!==y?(R=()=>y(n),t[5]=n,t[6]=y,t[7]=R):R=t[7];let z;t[8]!==x||t[9]!==M||t[10]!==r?(z=x({id:`Z79bnE`,values:{burstNumber:M,docName:r}}),t[8]=x,t[9]=M,t[10]=r,t[11]=z):z=t[11];let ae=ee?`bg-muted`:`hover:bg-muted/40`,oe;t[12]===ae?oe=t[13]:(oe=[`flex min-w-0 flex-1 items-center gap-2 px-4 py-1.5 text-xs text-muted-foreground transition-colors`,ae],t[12]=ae,t[13]=oe);let se=oe.join(` `),B;t[14]!==n.ts||t[15]!==S?(B=I(n.ts,S),t[14]=n.ts,t[15]=S,t[16]=B):B=t[16];let V;t[17]===B?V=t[18]:(V=(0,F.jsx)(`span`,{className:`font-mono`,children:B}),t[17]=B,t[18]=V);let H;t[19]===n.additions?H=t[20]:(H=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additions]}),t[19]=n.additions,t[20]=H);let U;t[21]===n.deletions?U=t[22]:(U=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletions]}),t[21]=n.deletions,t[22]=U);let W;t[23]!==H||t[24]!==U?(W=(0,F.jsxs)(`span`,{className:`ml-auto font-mono`,children:[H,` `,U]}),t[23]=H,t[24]=U,t[25]=W):W=t[25];let G;t[26]!==ee||t[27]!==V||t[28]!==W||t[29]!==R||t[30]!==z||t[31]!==se?(G=(0,F.jsxs)(`button`,{type:`button`,onClick:R,"aria-pressed":ee,"aria-label":z,"data-testid":`activity-panel-burst-open`,className:se,children:[V,W]}),t[26]=ee,t[27]=V,t[28]=W,t[29]=R,t[30]=z,t[31]=se,t[32]=G):G=t[32];let ce;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,F.jsx)(`span`,{"aria-hidden":`true`,className:`mx-1.5 h-3 w-px shrink-0 bg-border`}),t[33]=ce):ce=t[33];let K;t[34]!==x||t[35]!==M||t[36]!==r?(K=x({id:`Zhe80e`,values:{burstNumber:M,docName:r}}),t[34]=x,t[35]=M,t[36]=r,t[37]=K):K=t[37];let le;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>A(!0),t[38]=le):le=t[38];let q;t[39]===v?q=t[40]:(q=v?(0,F.jsx)(C,{className:`size-3`,"aria-hidden":`true`}):(0,F.jsx)(w,{className:`size-3`,"aria-hidden":`true`}),t[39]=v,t[40]=q);let J;t[41]!==ne||t[42]!==K||t[43]!==q?(J=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-6 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`activity-panel-burst-restore`,"aria-label":K,disabled:ne,onClick:le,children:q})}),t[41]=ne,t[42]=K,t[43]=q,t[44]=J):J=t[44];let Y;t[45]!==x||t[46]!==L||t[47]!==s?(Y=x(s?L>0?{id:`SOPwPh`}:{id:`62bOuM`}:{id:`NzFvyK`}),t[45]=x,t[46]=L,t[47]=s,t[48]=Y):Y=t[48];let X;t[49]===Y?X=t[50]:(X=(0,F.jsx)(u,{side:`left`,children:Y}),t[49]=Y,t[50]=X);let Z;t[51]!==J||t[52]!==X?(Z=(0,F.jsxs)(d,{children:[J,X]}),t[51]=J,t[52]=X,t[53]=Z):Z=t[53];let Q;t[54]!==G||t[55]!==Z?(Q=(0,F.jsxs)(`div`,{className:`flex items-center border-t border-border/50 pr-3`,children:[G,ce,Z]}),t[54]=G,t[55]=Z,t[56]=Q):Q=t[56];let ue;t[57]===v?ue=t[58]:(ue=e=>{!e&&!v?A(!1):e&&A(!0)},t[57]=v,t[58]=ue);let de;t[59]===x?de=t[60]:(de=x({id:`a4FRQv`}),t[59]=x,t[60]=de);let fe;t[61]===de?fe=t[62]:(fe=(0,F.jsx)(p,{children:de}),t[61]=de,t[62]=fe);let pe;t[63]===L?pe=t[64]:(pe=(0,F.jsx)(f,{children:(0,F.jsx)(a,{id:`LKIPzv`,values:{laterEdits:L}})}),t[63]=L,t[64]=pe);let $;t[65]!==fe||t[66]!==pe?($=(0,F.jsxs)(g,{children:[fe,pe]}),t[65]=fe,t[66]=pe,t[67]=$):$=t[67];let me;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,F.jsx)(c,{variant:`outline`,"data-testid":`activity-panel-burst-restore-cancel`,onClick:()=>A(!1),children:(0,F.jsx)(a,{id:`dEgA5A`})}),t[68]=me):me=t[68];let he;t[69]===v?he=t[70]:(he=v?(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}):null,t[69]=v,t[70]=he);let ge;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,F.jsx)(a,{id:`9uI_rE`}),t[71]=ge):ge=t[71];let _e;t[72]!==ie||t[73]!==v||t[74]!==he?(_e=(0,F.jsxs)(h,{children:[me,(0,F.jsxs)(c,{variant:`destructive`,"data-testid":`activity-panel-burst-restore-confirm`,disabled:v,onClick:ie,children:[he,ge]})]}),t[72]=ie,t[73]=v,t[74]=he,t[75]=_e):_e=t[75];let ve;t[76]!==$||t[77]!==_e?(ve=(0,F.jsxs)(m,{children:[$,_e]}),t[76]=$,t[77]=_e,t[78]=ve):ve=t[78];let ye;t[79]!==k||t[80]!==ue||t[81]!==ve?(ye=(0,F.jsx)(_,{open:k,onOpenChange:ue,children:ve}),t[79]=k,t[80]=ue,t[81]=ve,t[82]=ye):ye=t[82];let be;return t[83]!==Q||t[84]!==ye?(be=(0,F.jsxs)(F.Fragment,{children:[Q,ye]}),t[83]=Q,t[84]=ye,t[85]=be):be=t[85],be}function te(){return Date.now()}function L(e,t){let n=Math.max(0,t-e);if(n<6e4){let e=Math.round(n/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(n<36e5){let e=Math.round(n/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}let r=Math.round(n/36e5);return v._({id:`nYeBmY`,values:{hours:r}})}function ne(e){let t=(0,N.c)(56),{file:n,sessionAlive:r,isWriting:i,onNavigate:s,onUndoDrop:c,onSetVersion:l}=e,{_:u}=o(),{docName:d}=n,[f,p]=(0,P.useState)(!1),[m,h]=(0,P.useState)(re),g,_;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{let e=setInterval(()=>h(Date.now()),3e4);return()=>clearInterval(e)},_=[],t[0]=g,t[1]=_):(g=t[0],_=t[1]),(0,P.useEffect)(g,_);let v=n.bursts.length,y;t[2]!==n.docName||t[3]!==c||t[4]!==r||t[5]!==f?(y=e=>{e<=0||!r||f||(p(!0),Promise.resolve(c(n.docName,e)).finally(()=>{p(!1),A()}))},t[2]=n.docName,t[3]=c,t[4]=r,t[5]=f,t[6]=y):y=t[6];let b=y;if(n.bursts.length===0)return null;let x;t[7]!==n.docName||t[8]!==s?(x=()=>s(n.docName),t[7]=n.docName,t[8]=s,t[9]=x):x=t[9];let S;t[10]!==u||t[11]!==d?(S=u({id:`QcpeeE`,values:{docName:d}}),t[10]=u,t[11]=d,t[12]=S):S=t[12];let C;t[13]!==n.docName||t[14]!==x||t[15]!==S?(C=(0,F.jsx)(`button`,{type:`button`,onClick:x,className:`min-w-0 flex-1 truncate text-left text-foreground hover:underline focus-visible:outline-ring`,"aria-label":S,"data-testid":`activity-panel-file-row-filename`,title:n.docName,children:n.docName}),t[13]=n.docName,t[14]=x,t[15]=S,t[16]=C):C=t[16];let w;t[17]===n.additionsTotal?w=t[18]:(w=(0,F.jsxs)(`span`,{className:`text-green-600 dark:text-green-400`,children:[`+`,n.additionsTotal]}),t[17]=n.additionsTotal,t[18]=w);let T;t[19]===n.deletionsTotal?T=t[20]:(T=(0,F.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,n.deletionsTotal]}),t[19]=n.deletionsTotal,t[20]=T);let E;t[21]!==w||t[22]!==T?(E=(0,F.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[w,` `,T]}),t[21]=w,t[22]=T,t[23]=E):E=t[23];let D;t[24]!==n.lastTs||t[25]!==m?(D=L(n.lastTs,m),t[24]=n.lastTs,t[25]=m,t[26]=D):D=t[26];let O;t[27]===D?O=t[28]:(O=(0,F.jsx)(`span`,{className:`shrink-0 font-mono text-[11px] text-muted-foreground`,children:D}),t[27]=D,t[28]=O);let k;t[29]===i?k=t[30]:(k=i?(0,F.jsx)(`span`,{className:`shrink-0 text-[11px] text-primary animate-pulse`,role:`status`,children:(0,F.jsx)(a,{id:`6q0rnH`})}):null,t[29]=i,t[30]=k);let j;t[31]!==O||t[32]!==k||t[33]!==C||t[34]!==E?(j=(0,F.jsxs)(`div`,{className:`flex items-center gap-2 px-3 py-2 text-sm`,children:[C,E,O,k]}),t[31]=O,t[32]=k,t[33]=C,t[34]=E,t[35]=j):j=t[35];let M;if(t[36]!==b||t[37]!==v||t[38]!==n.bursts||t[39]!==n.docName||t[40]!==l||t[41]!==r||t[42]!==f){let e;t[44]!==b||t[45]!==v||t[46]!==n.docName||t[47]!==l||t[48]!==r||t[49]!==f?(e=e=>(0,F.jsx)(ee,{burst:e,docName:n.docName,editCount:v,sessionAlive:r,inFlight:f,onOpenDiff:e=>l(e.stackIndex+1),onRestore:b},`${n.docName}:${e.stackIndex}`),t[44]=b,t[45]=v,t[46]=n.docName,t[47]=l,t[48]=r,t[49]=f,t[50]=e):e=t[50],M=n.bursts.map(e),t[36]=b,t[37]=v,t[38]=n.bursts,t[39]=n.docName,t[40]=l,t[41]=r,t[42]=f,t[43]=M}else M=t[43];let I;t[51]===M?I=t[52]:(I=(0,F.jsx)(`div`,{children:M}),t[51]=M,t[52]=I);let te;return t[53]!==j||t[54]!==I?(te=(0,F.jsxs)(`div`,{className:`border-b border-border`,"data-testid":`activity-panel-file-row`,children:[j,I]}),t[53]=j,t[54]=I,t[55]=te):te=t[55],te}function re(){return Date.now()}async function ie(e){let t=await fetch(`/api/agent-undo`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...e,agentId:e.connectionId})});if(!t.ok)throw Error(`agent-undo failed: HTTP ${t.status}`)}function R(e){return`#/${e.split(`/`).map(e=>encodeURIComponent(e)).join(`/`)}`}function z(e){typeof window>`u`||(window.location.hash=R(e))}function ae(){let e=(0,N.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(C,{className:`mr-2 size-4`,"aria-hidden":`true`}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,F.jsxs)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,role:`status`,"aria-busy":`true`,children:[t,(0,F.jsx)(`span`,{className:`text-sm`,children:(0,F.jsx)(a,{id:`ONPvOb`})})]}),e[1]=n):n=e[1],n}function oe(e){let t=(0,N.c)(10),{error:n,onRetry:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,F.jsx)(x,{className:`size-6 text-destructive`,"aria-hidden":`true`}),t[0]=i):i=t[0];let o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,F.jsx)(`p`,{className:`text-sm font-medium`,children:(0,F.jsx)(a,{id:`DhLHEb`})}),t[1]=o):o=t[1];let s;t[2]===n?s=t[3]:(s=(0,F.jsxs)(`div`,{className:`space-y-1`,children:[o,(0,F.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n})]}),t[2]=n,t[3]=s);let l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(a,{id:`6gRgw8`}),t[4]=l):l=t[4];let u;t[5]===r?u=t[6]:(u=(0,F.jsx)(c,{type:`button`,variant:`outline`,size:`sm`,onClick:r,children:l}),t[5]=r,t[6]=u);let d;return t[7]!==s||t[8]!==u?(d=(0,F.jsxs)(`div`,{className:`flex flex-col items-center gap-3 p-6 text-center`,role:`alert`,"data-testid":`activity-panel-error`,children:[i,s,u]}),t[7]=s,t[8]=u,t[9]=d):d=t[9],d}function se(){let e=(0,N.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,F.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-muted-foreground`,"data-testid":`activity-panel-empty`,children:(0,F.jsx)(`p`,{className:`text-sm italic`,children:(0,F.jsx)(a,{id:`iuTKci`})})}),e[0]=t):t=e[0],t}function B(e){let t=(0,N.c)(12),{onExit:n,showBackButton:r}=e,{_:i}=o(),s;t[0]===i?s=t[1]:(s=i({id:`kYL1lH`}),t[0]=i,t[1]=s);let c;t[2]!==n||t[3]!==r?(c=r?(0,F.jsx)(V,{onClick:n}):null,t[2]=n,t[3]=r,t[4]=c):c=t[4];let l;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})}),t[5]=l):l=t[5];let u;t[6]===c?u=t[7]:(u=(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-row items-center gap-2 border-b border-border px-3 py-2`,children:[c,l]}),t[6]=c,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,F.jsx)(`div`,{className:`flex flex-1 items-center justify-center p-6 text-muted-foreground`,children:(0,F.jsx)(`p`,{className:`text-center text-sm italic`,children:(0,F.jsx)(a,{id:`D_WKe_`})})}),t[8]=d):d=t[8];let f;return t[9]!==s||t[10]!==u?(f=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel-no-agent`,"aria-label":s,children:[u,d]}),t[9]=s,t[10]=u,t[11]=f):f=t[11],f}function V(e){let t=(0,N.c)(9),{onClick:n}=e,{_:r}=o(),i;t[0]===r?i=t[1]:(i=r({id:`ogAuyr`}),t[0]=r,t[1]=i);let s;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(b,{}),t[2]=s):s=t[2];let f;t[3]!==n||t[4]!==i?(f=(0,F.jsx)(l,{asChild:!0,children:(0,F.jsx)(c,{type:`button`,variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,onClick:n,"aria-label":i,"data-testid":`docpanel-exit-agent-mode`,children:s})}),t[3]=n,t[4]=i,t[5]=f):f=t[5];let p;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,F.jsx)(u,{side:`bottom`,children:(0,F.jsx)(a,{id:`ogAuyr`})}),t[6]=p):p=t[6];let m;return t[7]===f?m=t[8]:(m=(0,F.jsxs)(d,{children:[f,p]}),t[7]=f,t[8]=m),m}function H(e){let t=(0,N.c)(9),{lastTs:n}=e,[r]=(0,P.useState)(U),i;t[0]!==n||t[1]!==r?(i=n?W(r-n):null,t[0]=n,t[1]=r,t[2]=i):i=t[2];let o=i,s;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,F.jsx)(`span`,{className:`font-medium`,children:(0,F.jsx)(a,{id:`LCUy_N`})}),t[3]=s):s=t[3];let c;t[4]===o?c=t[5]:(c=o?(0,F.jsxs)(`span`,{children:[` · `,o]}):null,t[4]=o,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,F.jsx)(`div`,{className:`mt-1 opacity-80`,children:(0,F.jsx)(a,{id:`GK-IRZ`})}),t[6]=l):l=t[6];let u;return t[7]===c?u=t[8]:(u=(0,F.jsxs)(`div`,{className:`border-b border-border bg-muted/40 px-4 py-3 text-xs text-muted-foreground`,"data-testid":`activity-panel-session-ended`,children:[s,c,l]}),t[7]=c,t[8]=u),u}function U(){return Date.now()}function W(e){let t=Math.max(0,e);if(t<6e4){let e=Math.round(t/1e3);return v._({id:`pbwTg6`,values:{seconds:e}})}if(t<36e5){let e=Math.round(t/6e4);return v._({id:`_rP3HI`,values:{minutes:e}})}let n=Math.round(t/36e5);return v._({id:`nYeBmY`,values:{hours:n}})}function G(e){let t=(0,N.c)(10),{agent:n,size:r}=e,i=r===void 0?28:r,a;t[0]!==n.color||t[1]!==i?(a={backgroundColor:n.color,width:i,height:i},t[0]=n.color,t[1]=i,t[2]=a):a=t[2];let o=i*.57,s=i*.57,c;t[3]!==n.icon||t[4]!==o||t[5]!==s?(c=(0,F.jsx)(k,{icon:n.icon,width:o,height:s}),t[3]=n.icon,t[4]=o,t[5]=s,t[6]=c):c=t[6];let l;return t[7]!==a||t[8]!==c?(l=(0,F.jsx)(`span`,{className:`inline-flex shrink-0 items-center justify-center rounded-full text-white ring-2 ring-background`,style:a,"aria-hidden":`true`,children:c}),t[7]=a,t[8]=c,t[9]=l):l=t[9],l}function ce(e){let t=(0,N.c)(25),{data:n,status:r,error:i,reload:s,onExit:c,onNavigate:l,onUndoDrop:u,onSetVersion:d,showBackButton:f}=e,{_:p}=o(),m=n?.files?.[0]?.lastTs??null,h=n?.files?.length??0,g;t[0]===p?g=t[1]:(g=p({id:`kYL1lH`}),t[0]=p,t[1]=g);let _;t[2]!==c||t[3]!==f?(_=f?(0,F.jsx)(V,{onClick:c}):null,t[2]=c,t[3]=f,t[4]=_):_=t[4];let v;t[5]!==n||t[6]!==h||t[7]!==m?(v=n?.agent?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(G,{agent:n.agent}),(0,F.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:n.agent.displayName}),(0,F.jsxs)(`p`,{className:`truncate text-xs text-muted-foreground`,children:[n.sessionAlive?(0,F.jsx)(a,{id:`F6pfE9`}):m===null?(0,F.jsx)(a,{id:`PMyJ9C`}):(0,F.jsx)(a,{id:`237hSL`}),n.files.length>0?(0,F.jsxs)(F.Fragment,{children:[` · `,(0,F.jsx)(a,{id:`u3BOHd`,values:{fileCount:h}})]}):null]})]})]}):(0,F.jsx)(`div`,{className:`min-w-0 flex-1`,children:(0,F.jsx)(`h2`,{className:`truncate text-sm font-medium`,children:(0,F.jsx)(a,{id:`kYL1lH`})})}),t[5]=n,t[6]=h,t[7]=m,t[8]=v):v=t[8];let y;t[9]!==_||t[10]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-row items-center gap-2 border-b border-border px-3 py-2 shrink-0`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]!==n||t[13]!==i||t[14]!==m||t[15]!==l||t[16]!==d||t[17]!==u||t[18]!==s||t[19]!==r?(b=(0,F.jsx)(`div`,{className:`flex-1 overflow-y-auto`,"data-testid":`activity-panel-body`,children:r===`loading`&&n===null?(0,F.jsx)(ae,{}):r===`error`&&i?(0,F.jsx)(oe,{error:i,onRetry:s}):n===null?(0,F.jsx)(se,{}):(0,F.jsxs)(F.Fragment,{children:[!n.sessionAlive&&m!==null?(0,F.jsx)(H,{lastTs:m}):null,n.files.length===0?(0,F.jsx)(se,{}):n.files.map(e=>(0,F.jsx)(ne,{file:e,sessionAlive:n.sessionAlive,isWriting:n.writingDocs.has(e.docName),onNavigate:l,onUndoDrop:u,onSetVersion:t=>d(e,t)},e.docName))]})}),t[12]=n,t[13]=i,t[14]=m,t[15]=l,t[16]=d,t[17]=u,t[18]=s,t[19]=r,t[20]=b):b=t[20];let x;return t[21]!==g||t[22]!==y||t[23]!==b?(x=(0,F.jsxs)(`section`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`activity-panel`,"aria-label":g,children:[y,b]}),t[21]=g,t[22]=y,t[23]=b,t[24]=x):x=t[24],x}function K(e){let t=(0,N.c)(30),i;t[0]===e?i=t[1]:(i=e===void 0?{}:e,t[0]=e,t[1]=i);let{showBackButton:a}=i,s=a===void 0?!0:a,{_:c}=o(),{docPanelAgentId:l,closeActivityPanel:u}=n(),{openTargetTransition:d}=r(),{pageMeta:f}=S(),{data:p,status:m,error:h,reload:g}=M(l),_,v;if(t[2]!==p||t[3]!==l?(_=()=>{if(!(!p||l===null))for(let e of p.files)D(l,e.docName,e.bursts.length)},v=[p,l],t[2]=p,t[3]=l,t[4]=_,t[5]=v):(_=t[4],v=t[5]),(0,P.useEffect)(_,v),l===null){let e;return t[6]!==u||t[7]!==s?(e=(0,F.jsx)(B,{onExit:u,showBackButton:s}),t[6]=u,t[7]=s,t[8]=e):e=t[8],e}let b;t[9]!==d||t[10]!==f?(b=e=>{d(T({kind:`doc`,target:e,docName:e},f),{disposition:`permanent`,consumeActiveNewTab:!0}),z(e)},t[9]=d,t[10]=f,t[11]=b):b=t[11];let x=b,C;t[12]!==p||t[13]!==l?(C=(e,t)=>{if(!p?.agent||l===null)return;j();let n=e.bursts.length;O({agentId:l,agentName:p.agent.displayName,agentColor:p.agent.color,agentIcon:p.agent.icon,docName:e.docName,keptCount:Math.max(0,Math.min(t,n)),maxVersions:n})},t[12]=p,t[13]=l,t[14]=C):C=t[14];let w=C,E;t[15]!==c||t[16]!==p||t[17]!==l||t[18]!==g?(E=async(e,t)=>{if(!(t<=0))try{await ie({connectionId:l,docName:e,scope:`count`,count:t,agentName:p?.agent?.displayName}),y.success(c(t===1?{id:`-dNlfM`,values:{docName:e}}:{id:`ApeA0n`,values:{dropCount:t,docName:e}})),g()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);y.error(c({id:`EqrC_R`,values:{message:n}})),g()}},t[15]=c,t[16]=p,t[17]=l,t[18]=g,t[19]=E):E=t[19];let k=E,A;return t[20]!==u||t[21]!==p||t[22]!==h||t[23]!==x||t[24]!==w||t[25]!==k||t[26]!==g||t[27]!==s||t[28]!==m?(A=(0,F.jsx)(ce,{data:p,status:m,error:h,reload:g,onExit:u,onNavigate:x,onUndoDrop:k,onSetVersion:w,showBackButton:s}),t[20]=u,t[21]=p,t[22]=h,t[23]=x,t[24]=w,t[25]=k,t[26]=g,t[27]=s,t[28]=m,t[29]=A):A=t[29],A}export{K as ActivityModeContent};
@@ -1,2 +1,2 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ActivityPanelDiffView-GFnvFJPJ.js","./chunk-CYidjpOJ.js","./dist-Nvb76hAm.js","./jsx-runtime-BUgB2tll.js","./react-f2sANaYj.js","./compiler-runtime-BfE3aGVn.js","./ActivityPanelDiffView-legcy4jI.css"])))=>i.map(i=>d[i]);
2
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-Bj-TVfKw.js";import{t as ee}from"./button-CA0dewJJ.js";import{i as te,n as ne,t as re}from"./tooltip-DHXgxWLL.js";import{n as c,t as l}from"./toggle-group-CZcn-1gX.js";import{t as u}from"./spinner-BqySY7qY.js";import{n as d,t as ie}from"./panel-right-open-B66oA9M1.js";import{t as ae}from"./x-DS57FvHW.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-BJiYj2BI.js";import{t as f}from"./lru-string-cache-Ckr1Pjrr.js";import{t as le}from"./use-activity-panel-BEnqyFcJ.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-RrvwSA9l.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-GFnvFJPJ.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let s=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(s)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ae,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(l,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(ie,{className:`size-4`}):(0,m.jsx)(d,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};
2
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./preload-helper-Chd9yIcd.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./overlay-layers-Bj-TVfKw.js";import{t as ee}from"./button-CA0dewJJ.js";import{i as te,n as ne,t as re}from"./tooltip-DHXgxWLL.js";import{n as c,t as l}from"./toggle-group-CZcn-1gX.js";import{t as u}from"./spinner-CHTY-VE-.js";import{n as d,t as ie}from"./panel-right-open-DAyUhiQN.js";import{t as ae}from"./x-BaJrHZK_.js";import{o as oe,r as se,t as ce}from"./agent-diff-store-DxMs0J9Y.js";import{t as f}from"./lru-string-cache-Ckr1Pjrr.js";import{t as le}from"./use-activity-panel-DeQ1S88x.js";import{a as ue,o as de,r as fe,t as pe}from"./use-timeline-entry-diff-Bw_6uLLl.js";var me=o(),p=e(r(),1),m=n(),he=(0,p.lazy)(async()=>({default:(await t(()=>import(`./ActivityPanelDiffView-GFnvFJPJ.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)).ActivityPanelDiffView})),h=64;function g(e){let t=(0,me.c)(115),{view:n,isPanelCollapsed:r,onTogglePanel:o}=e,{_:f}=a(),{agentId:h,agentName:g,agentColor:_,agentIcon:v,docName:y,keptCount:b}=n,[x]=(0,p.useState)(_e),ve=(0,p.useRef)(null),[S,ye]=(0,p.useState)(`rendered`),be;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(be={status:`loading`,diff:``,before:``,after:``},t[0]=be):be=t[0];let[C,xe]=(0,p.useState)(be),Se,Ce;t[1]!==h||t[2]!==x||t[3]!==y||t[4]!==b?(Se=()=>{let e=!1;xe({status:`loading`,diff:``,before:``,after:``});let t=`${y}\0${b}`,n=x.get(t);if(n!==void 0){xe({status:`ready`,...JSON.parse(n)});return}return le(h,y,b).then(n=>{e||(x.set(t,JSON.stringify(n)),xe({status:`ready`,...n}))}).catch(t=>{e||(console.error(`[agent-diff] failed to load burst diff`,{agentId:h,docName:y,keptCount:b,err:t}),xe({status:`error`,diff:``,before:``,after:``}))}),()=>{e=!0}},Ce=[h,y,b,x],t[1]=h,t[2]=x,t[3]=y,t[4]=b,t[5]=Se,t[6]=Ce):(Se=t[5],Ce=t[6]),(0,p.useEffect)(Se,Ce);let w;t[7]!==C.after||t[8]!==C.before||t[9]!==C.status?(w=C.status===`ready`?de(C.before,C.after):null,t[7]=C.after,t[8]=C.before,t[9]=C.status,t[10]=w):w=t[10];let T=w,E=C.status===`ready`&&C.diff!==``?`${S}:${C.diff}`:``,D,O;t[11]===E?(D=t[12],O=t[13]):(D=()=>{let e=ve.current;if(E===``||!e)return;let t=!1,n=null,r,i,a=()=>{if(t)return;let r=e.querySelector(`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`)??fe(e)[0];if(!r)return;t=!0,n?.disconnect();let i=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches;r.scrollIntoView({block:`center`,behavior:i?`auto`:`smooth`})},o=()=>{t||(r!==void 0&&clearTimeout(r),r=setTimeout(()=>{i!==void 0&&cancelAnimationFrame(i),i=requestAnimationFrame(()=>{i=requestAnimationFrame(a)})},120))};n=new MutationObserver(o),n.observe(e,{childList:!0,subtree:!0}),o();let s=setTimeout(()=>n?.disconnect(),5e3);return()=>{n?.disconnect(),r!==void 0&&clearTimeout(r),i!==void 0&&cancelAnimationFrame(i),clearTimeout(s)}},O=[E],t[11]=E,t[12]=D,t[13]=O),(0,p.useEffect)(D,O);let k,A;t[14]===b?(k=t[15],A=t[16]):(k=()=>{let e=e=>{if(e.key===`Escape`&&e.defaultPrevented||s())return;let t=e.target;t&&(t.tagName===`INPUT`||t.tagName===`TEXTAREA`||t.isContentEditable)||(e.key===`Escape`?ce():e.key===`j`||e.key===`ArrowRight`?(e.preventDefault(),se(b+1)):(e.key===`k`||e.key===`ArrowLeft`)&&(e.preventDefault(),se(b-1)))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},A=[b],t[14]=b,t[15]=k,t[16]=A),(0,p.useEffect)(k,A);let j,M,N,P,F,I,L,R;if(t[17]!==f||t[18]!==_||t[19]!==v||t[20]!==g||t[21]!==y||t[22]!==C.diff||t[23]!==C.status){let e=C.status===`ready`?pe(C.diff):{additions:0,deletions:0},n=e.additions>0||e.deletions>0;I=`absolute inset-0 z-20 flex flex-col bg-background`,L=`agent-diff-pane`,M=`flex flex-wrap items-center gap-x-2 gap-y-1.5 border-b border-border px-3 py-2`;let r;t[32]===f?r=t[33]:(r=f({id:`b18t0_`}),t[32]=f,t[33]=r);let i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,m.jsx)(ae,{className:`size-4`}),t[34]=i):i=t[34];let a;t[35]===r?a=t[36]:(a=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-close`,"aria-label":r,onClick:ge,children:i})}),t[35]=r,t[36]=a);let o;t[37]===f?o=t[38]:(o=f({id:`b18t0_`}),t[37]=f,t[38]=o);let s;t[39]===o?s=t[40]:(s=(0,m.jsx)(ne,{side:`bottom`,children:o}),t[39]=o,t[40]=s),t[41]!==a||t[42]!==s?(N=(0,m.jsxs)(re,{children:[a,s]}),t[41]=a,t[42]=s,t[43]=N):N=t[43];let c;t[44]===_?c=t[45]:(c={backgroundColor:_},t[44]=_,t[45]=c);let l;t[46]===v?l=t[47]:(l=(0,m.jsx)(oe,{icon:v,width:13,height:13}),t[46]=v,t[47]=l),t[48]!==c||t[49]!==l?(P=(0,m.jsx)(`span`,{className:`flex size-6 shrink-0 items-center justify-center rounded-full text-white`,style:c,children:l}),t[48]=c,t[49]=l,t[50]=P):P=t[50];let u;t[51]===y?u=t[52]:(u=(0,m.jsx)(`div`,{className:`truncate text-sm font-medium text-foreground`,children:y}),t[51]=y,t[52]=u);let d;t[53]===g?d=t[54]:(d=(0,m.jsx)(`div`,{className:`truncate text-xs text-muted-foreground`,children:g}),t[53]=g,t[54]=d),t[55]!==u||t[56]!==d?(F=(0,m.jsxs)(`div`,{className:`min-w-0 max-w-[14rem] shrink`,children:[u,d]}),t[55]=u,t[56]=d,t[57]=F):F=t[57],R=`ml-auto flex flex-wrap items-center justify-end gap-2`,j=n&&(0,m.jsxs)(`span`,{role:`img`,className:`shrink-0 text-xs tabular-nums`,"data-testid":`agent-diff-stat`,"aria-label":f({id:`8lwQlE`,values:{0:e.additions,1:e.deletions}}),children:[(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,e.additions]}),` `,(0,m.jsxs)(`span`,{"aria-hidden":`true`,className:`text-red-600 dark:text-red-500`,children:[`−`,e.deletions]})]}),t[17]=f,t[18]=_,t[19]=v,t[20]=g,t[21]=y,t[22]=C.diff,t[23]=C.status,t[24]=j,t[25]=M,t[26]=N,t[27]=P,t[28]=F,t[29]=I,t[30]=L,t[31]=R}else j=t[24],M=t[25],N=t[26],P=t[27],F=t[28],I=t[29],L=t[30],R=t[31];let z;t[58]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{(e===`rendered`||e===`source`)&&ye(e)},t[58]=z):z=t[58];let B;t[59]===f?B=t[60]:(B=f({id:`ZW3mlR`}),t[59]=f,t[60]=B);let we;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,m.jsx)(c,{value:`rendered`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-rendered`,children:(0,m.jsx)(i,{id:`4z_1j2`})}),t[61]=we):we=t[61];let Te;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,m.jsx)(c,{value:`source`,className:`h-6 px-2 text-xs`,"data-testid":`agent-diff-render-source`,children:(0,m.jsx)(i,{id:`wdxz7K`})}),t[62]=Te):Te=t[62];let V;t[63]!==S||t[64]!==B?(V=(0,m.jsxs)(l,{type:`single`,value:S,onValueChange:z,"aria-label":B,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 rounded-md bg-muted p-0.5 dark:bg-background`,children:[we,Te]}),t[63]=S,t[64]=B,t[65]=V):V=t[65];let H;t[66]!==f||t[67]!==r?(H=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[66]=f,t[67]=r,t[68]=H):H=t[68];let Ee=!r,U;t[69]===r?U=t[70]:(U=r?(0,m.jsx)(ie,{className:`size-4`}):(0,m.jsx)(d,{className:`size-4`}),t[69]=r,t[70]=U);let W;t[71]!==o||t[72]!==H||t[73]!==Ee||t[74]!==U?(W=(0,m.jsx)(te,{asChild:!0,children:(0,m.jsx)(ee,{variant:`ghost`,size:`icon`,className:`size-7 shrink-0`,"data-testid":`agent-diff-toggle-panel`,"aria-label":H,"aria-expanded":Ee,onClick:o,children:U})}),t[71]=o,t[72]=H,t[73]=Ee,t[74]=U,t[75]=W):W=t[75];let G;t[76]!==f||t[77]!==r?(G=f(r?{id:`6iDEWA`}:{id:`170Js2`}),t[76]=f,t[77]=r,t[78]=G):G=t[78];let K;t[79]===G?K=t[80]:(K=(0,m.jsx)(ne,{side:`bottom`,children:G}),t[79]=G,t[80]=K);let q;t[81]!==W||t[82]!==K?(q=(0,m.jsxs)(re,{children:[W,K]}),t[81]=W,t[82]=K,t[83]=q):q=t[83];let J;t[84]!==j||t[85]!==V||t[86]!==q||t[87]!==R?(J=(0,m.jsxs)(`div`,{className:R,children:[j,V,q]}),t[84]=j,t[85]=V,t[86]=q,t[87]=R,t[88]=J):J=t[88];let Y;t[89]!==M||t[90]!==N||t[91]!==P||t[92]!==F||t[93]!==J?(Y=(0,m.jsxs)(`div`,{className:M,children:[N,P,F,J]}),t[89]=M,t[90]=N,t[91]=P,t[92]=F,t[93]=J,t[94]=Y):Y=t[94];let X;t[95]===C.status?X=t[96]:(X=C.status===`loading`&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,m.jsx)(i,{id:`38foVZ`})]}),t[95]=C.status,t[96]=X);let Z;t[97]===C.status?Z=t[98]:(Z=C.status===`error`&&(0,m.jsx)(`p`,{className:`px-4 py-3 text-xs text-destructive`,children:(0,m.jsx)(i,{id:`vvWZnu`})}),t[97]=C.status,t[98]=Z);let Q;t[99]!==b||t[100]!==S||t[101]!==T||t[102]!==C.after||t[103]!==C.diff||t[104]!==C.status?(Q=C.status===`ready`&&(S===`rendered`&&T?.ok?(0,m.jsx)(ue,{diff:T}):C.diff===``?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`p`,{className:`border-b border-border px-4 py-2 text-xs text-muted-foreground italic`,children:b===0?(0,m.jsx)(i,{id:`klPS-L`}):(0,m.jsx)(i,{id:`k7Hoig`})}),(0,m.jsx)(`pre`,{className:`whitespace-pre-wrap px-4 py-3 font-mono text-xs text-foreground/90`,children:C.after})]}):(0,m.jsx)(p.Suspense,{fallback:(0,m.jsxs)(`div`,{className:`flex items-center gap-2 px-4 py-3 text-xs text-muted-foreground`,children:[(0,m.jsx)(u,{"aria-hidden":`true`,className:`size-3`}),(0,m.jsx)(i,{id:`EDm3wJ`})]}),children:(0,m.jsx)(he,{diff:C.diff,viewType:`unified`})})),t[99]=b,t[100]=S,t[101]=T,t[102]=C.after,t[103]=C.diff,t[104]=C.status,t[105]=Q):Q=t[105];let $;t[106]!==X||t[107]!==Z||t[108]!==Q?($=(0,m.jsxs)(`div`,{ref:ve,className:`min-h-0 flex-1 overflow-auto subtle-scrollbar`,children:[X,Z,Q]}),t[106]=X,t[107]=Z,t[108]=Q,t[109]=$):$=t[109];let De;return t[110]!==I||t[111]!==L||t[112]!==Y||t[113]!==$?(De=(0,m.jsxs)(`div`,{className:I,"data-testid":L,children:[Y,$]}),t[110]=I,t[111]=L,t[112]=Y,t[113]=$,t[114]=De):De=t[114],De}function ge(){return ce()}function _e(){return new f(h)}export{g as AgentDiffPane};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-CbdhvhFJ.js";import{i,r as a}from"./thread-client-DnaLPSLV.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./react-f2sANaYj.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{n as r}from"./use-collab-url-7XE2_0_k.js";import{i,r as a}from"./thread-client-DnaLPSLV.js";var o=n(),s=e(t(),1);function c(){let e=(0,o.c)(3),{collabUrl:t}=r(),n,c;return e[0]===t?(n=e[1],c=e[2]):(n=()=>{a().setUrl(i(t))},c=[t],e[0]=t,e[1]=n,e[2]=c),(0,s.useEffect)(n,c),null}export{c as AgentThreadClientBinder};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{n as s,r as c,t as l}from"./collapsible-COrqeoHr.js";import{t as u}from"./createLucideIcon-Bhw2PmPp.js";import{t as d}from"./chevron-down-DabHDQTe.js";import{t as f}from"./folder-open-DUSc8NL8.js";import{t as p}from"./spinner-BqySY7qY.js";import{t as m}from"./trash-2-N0ilsnnr.js";import{t as h}from"./badge-DFX4S3a5.js";import{n as g}from"./platform-labels-glrfxkSh.js";var _=u(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),v=a(),y=e(n(),1),b=t();function x(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function S(){let e=(0,v.c)(13),[t,n]=(0,y.useState)(`loading`),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let[i,a]=(0,y.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={},e[1]=o):o=e[1];let[s,c]=(0,y.useState)(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async function(){let e=window.okDesktop?.bugReport;if(!e){n(`error`);return}try{let t=await e.list();t.ok?(a(t.reports),n(`ready`)):n(`error`)}catch{n(`error`)}},e[2]=l):l=e[2];let u=l,d,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[3]=d,e[4]=f):(d=e[3],f=e[4]),(0,y.useEffect)(d,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(e){c(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},e[5]=p):p=e[5];let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=async function(e){let t=window.okDesktop?.bugReport;if(!t||!e.retryable)return;c(t=>({...t,[e.id]:`retrying`}));let n=await t.send({zipPath:e.zipPath,metadata:{level:e.bundleLevel===`unknown`?`standard`:e.bundleLevel,systemWide:e.systemWide,projectSlug:e.projectSlug}}).catch(w);n&&!n.ok&&n.reason===`email-draft`&&window.okDesktop?.shell.openExternal(n.fallback.mailtoUrl),await u(),m(e.id)},e[6]=h):h=e[6];let g=h,_;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=async function(e){let t=window.okDesktop?.bugReport;t&&(c(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(C),await u(),m(e.id))},e[7]=_):_=e[7];let b=_,x;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=x):x=e[8];let S=x,T;return e[9]!==s||e[10]!==i||e[11]!==t?(T={status:t,reports:i,pending:s,retry:g,remove:b,reveal:S},e[9]=s,e[10]=i,e[11]=t,e[12]=T):T=e[12],T}function C(){}function w(){return null}function T(e){let t=(0,v.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`primary`,children:(0,b.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`destructive`,children:(0,b.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`warning`,children:(0,b.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`secondary`,children:(0,b.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`gray`,children:(0,b.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`outline`,children:(0,b.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function E(e){let t=(0,v.c)(50),{row:n,pending:a,onRetry:s,onReveal:c,onDelete:l}=e,{_:u,i18n:d}=i(),y=a!==void 0,S;t[0]!==u||t[1]!==d||t[2]!==n.createdAt?(S=n.createdAt===``?u({id:`wF2wqQ`}):new Intl.DateTimeFormat(d.locale||void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[0]=u,t[1]=d,t[2]=n.createdAt,t[3]=S):S=t[3];let C=S,w;t[4]===n.state?w=t[5]:(w=(0,b.jsx)(T,{state:n.state}),t[4]=n.state,t[5]=w);let E;t[6]===n.bundleLevel?E=t[7]:(E=n.bundleLevel===`unknown`?null:(0,b.jsx)(h,{variant:`gray`,children:n.bundleLevel}),t[6]=n.bundleLevel,t[7]=E);let D;t[8]===C?D=t[9]:(D=(0,b.jsx)(`span`,{className:`truncate text-1sm text-muted-foreground`,children:C}),t[8]=C,t[9]=D);let O;t[10]!==w||t[11]!==E||t[12]!==D?(O=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[w,E,D]}),t[10]=w,t[11]=E,t[12]=D,t[13]=O):O=t[13];let k;t[14]!==n.lastError||t[15]!==n.reference||t[16]!==n.state||t[17]!==n.zipBytes?(k=(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.state===`sent`&&n.reference!==void 0?(0,b.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,b.jsx)(`span`,{className:`font-mono text-foreground`})}}):n.state===`upload-failed`&&n.lastError!==void 0?(0,b.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason}):(0,b.jsx)(`span`,{children:x(n.zipBytes)})}),t[14]=n.lastError,t[15]=n.reference,t[16]=n.state,t[17]=n.zipBytes,t[18]=k):k=t[18];let A;t[19]!==O||t[20]!==k?(A=(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[O,k]}),t[19]=O,t[20]=k,t[21]=A):A=t[21];let j;t[22]!==y||t[23]!==s||t[24]!==a||t[25]!==n?(j=n.retryable?(0,b.jsxs)(o,{variant:`outline`,size:`xs`,disabled:y,onClick:()=>s(n),children:[a===`retrying`?(0,b.jsx)(p,{"aria-hidden":`true`}):(0,b.jsx)(_,{"aria-hidden":`true`}),(0,b.jsx)(r,{id:`6gRgw8`})]}):null,t[22]=y,t[23]=s,t[24]=a,t[25]=n,t[26]=j):j=t[26];let M;t[27]!==y||t[28]!==c||t[29]!==n?(M=n.zipExists?(0,b.jsx)(o,{variant:`ghost`,size:`icon-xs`,disabled:y,"aria-label":g(typeof window<`u`?window.okDesktop?.platform:void 0),onClick:()=>c(n),children:(0,b.jsx)(f,{"aria-hidden":`true`})}):null,t[27]=y,t[28]=c,t[29]=n,t[30]=M):M=t[30];let N;t[31]===u?N=t[32]:(N=u({id:`rUWrSE`}),t[31]=u,t[32]=N);let P;t[33]!==l||t[34]!==n?(P=()=>l(n),t[33]=l,t[34]=n,t[35]=P):P=t[35];let F;t[36]===a?F=t[37]:(F=a===`deleting`?(0,b.jsx)(p,{"aria-hidden":`true`}):(0,b.jsx)(m,{"aria-hidden":`true`}),t[36]=a,t[37]=F);let I;t[38]!==y||t[39]!==N||t[40]!==P||t[41]!==F?(I=(0,b.jsx)(o,{variant:`ghost`,size:`icon-xs`,disabled:y,"aria-label":N,onClick:P,children:F}),t[38]=y,t[39]=N,t[40]=P,t[41]=F,t[42]=I):I=t[42];let L;t[43]!==I||t[44]!==j||t[45]!==M?(L=(0,b.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[j,M,I]}),t[43]=I,t[44]=j,t[45]=M,t[46]=L):L=t[46];let R;return t[47]!==L||t[48]!==A?(R=(0,b.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[A,L]}),t[47]=L,t[48]=A,t[49]=R):R=t[49],R}function D(e){let t=(0,v.c)(13),{reports:n,pending:r,retry:i,remove:a,reveal:o}=e,s;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i||t[4]!==o){let e;t[6]!==r||t[7]!==a||t[8]!==i||t[9]!==o?(e=e=>(0,b.jsx)(E,{row:e,pending:r[e.id],onRetry:i,onReveal:o,onDelete:a},e.id),t[6]=r,t[7]=a,t[8]=i,t[9]=o,t[10]=e):e=t[10],s=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];let c;return t[11]===s?c=t[12]:(c=(0,b.jsx)(`div`,{className:`flex flex-col gap-2`,children:s}),t[11]=s,t[12]=c),c}function O(e){let t=(0,v.c)(9),{onReportABug:n}=e,i=S();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,b.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,b.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,b.jsx)(o,{onClick:n,children:(0,b.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,b.jsx)(D,{...i}),t[7]=i,t[8]=a),a}function k(){let e=(0,v.c)(14),[t,n]=(0,y.useState)(!1),i=S();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,b.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let u;e[1]===i.reports.length?u=e[2]:(u=(0,b.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,b.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=u);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,b.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==u||e[6]!==p?(m=(0,b.jsx)(c,{asChild:!0,children:(0,b.jsxs)(o,{variant:`ghost`,size:`sm`,className:`-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted`,children:[u,p]})}),e[5]=u,e[6]=p,e[7]=m):m=e[7];let h;e[8]===i?h=e[9]:(h=(0,b.jsx)(s,{className:`pt-2`,children:(0,b.jsx)(D,{...i})}),e[8]=i,e[9]=h);let g;return e[10]!==t||e[11]!==m||e[12]!==h?(g=(0,b.jsxs)(l,{open:t,onOpenChange:n,children:[m,h]}),e[10]=t,e[11]=m,e[12]=h,e[13]=g):g=e[13],g}export{k as n,O as t};
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{t as n}from"./react-f2sANaYj.js";import{n as r,r as i}from"./dist-Nvb76hAm.js";import{t as a}from"./compiler-runtime-BfE3aGVn.js";import{t as o}from"./button-CA0dewJJ.js";import{n as s,r as c,t as l}from"./collapsible-COrqeoHr.js";import{t as u}from"./createLucideIcon-Bhw2PmPp.js";import{t as d}from"./chevron-down-DabHDQTe.js";import{t as f}from"./folder-open-BTTec8yg.js";import{t as p}from"./spinner-CHTY-VE-.js";import{t as m}from"./trash-2-BWJWOK8-.js";import{t as h}from"./badge-BYteLKha.js";import{n as g}from"./platform-labels-glrfxkSh.js";var _=u(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),v=a(),y=e(n(),1),b=t();function x(e){return e>=1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:e>=1024?`${Math.max(1,Math.round(e/1024))} KB`:`${e} B`}function S(){let e=(0,v.c)(13),[t,n]=(0,y.useState)(`loading`),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],e[0]=r):r=e[0];let[i,a]=(0,y.useState)(r),o;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o={},e[1]=o):o=e[1];let[s,c]=(0,y.useState)(o),l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=async function(){let e=window.okDesktop?.bugReport;if(!e){n(`error`);return}try{let t=await e.list();t.ok?(a(t.reports),n(`ready`)):n(`error`)}catch{n(`error`)}},e[2]=l):l=e[2];let u=l,d,f;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{u()},f=[],e[3]=d,e[4]=f):(d=e[3],f=e[4]),(0,y.useEffect)(d,f);let p;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(p=function(e){c(t=>{if(!(e in t))return t;let n={...t};return delete n[e],n})},e[5]=p):p=e[5];let m=p,h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=async function(e){let t=window.okDesktop?.bugReport;if(!t||!e.retryable)return;c(t=>({...t,[e.id]:`retrying`}));let n=await t.send({zipPath:e.zipPath,metadata:{level:e.bundleLevel===`unknown`?`standard`:e.bundleLevel,systemWide:e.systemWide,projectSlug:e.projectSlug}}).catch(w);n&&!n.ok&&n.reason===`email-draft`&&window.okDesktop?.shell.openExternal(n.fallback.mailtoUrl),await u(),m(e.id)},e[6]=h):h=e[6];let g=h,_;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(_=async function(e){let t=window.okDesktop?.bugReport;t&&(c(t=>({...t,[e.id]:`deleting`})),await t.delete(e.id).catch(C),await u(),m(e.id))},e[7]=_):_=e[7];let b=_,x;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(x=function(e){window.okDesktop?.shell.showItemInFolder(e.zipPath)},e[8]=x):x=e[8];let S=x,T;return e[9]!==s||e[10]!==i||e[11]!==t?(T={status:t,reports:i,pending:s,retry:g,remove:b,reveal:S},e[9]=s,e[10]=i,e[11]=t,e[12]=T):T=e[12],T}function C(){}function w(){return null}function T(e){let t=(0,v.c)(6),{state:n}=e;switch(n){case`sent`:{let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`primary`,children:(0,b.jsx)(r,{id:`h69WC6`})}),t[0]=e):e=t[0],e}case`upload-failed`:{let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`destructive`,children:(0,b.jsx)(r,{id:`7Bj3x9`})}),t[1]=e):e=t[1],e}case`uploading`:{let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`warning`,children:(0,b.jsx)(r,{id:`9bG48P`})}),t[2]=e):e=t[2],e}case`email-drafted`:{let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`secondary`,children:(0,b.jsx)(r,{id:`cPAWbl`})}),t[3]=e):e=t[3],e}case`generated`:{let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`gray`,children:(0,b.jsx)(r,{id:`2C-6zf`})}),t[4]=e):e=t[4],e}default:{let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(h,{variant:`outline`,children:(0,b.jsx)(r,{id:`Ef7StM`})}),t[5]=e):e=t[5],e}}}function E(e){let t=(0,v.c)(50),{row:n,pending:a,onRetry:s,onReveal:c,onDelete:l}=e,{_:u,i18n:d}=i(),y=a!==void 0,S;t[0]!==u||t[1]!==d||t[2]!==n.createdAt?(S=n.createdAt===``?u({id:`wF2wqQ`}):new Intl.DateTimeFormat(d.locale||void 0,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.createdAt)),t[0]=u,t[1]=d,t[2]=n.createdAt,t[3]=S):S=t[3];let C=S,w;t[4]===n.state?w=t[5]:(w=(0,b.jsx)(T,{state:n.state}),t[4]=n.state,t[5]=w);let E;t[6]===n.bundleLevel?E=t[7]:(E=n.bundleLevel===`unknown`?null:(0,b.jsx)(h,{variant:`gray`,children:n.bundleLevel}),t[6]=n.bundleLevel,t[7]=E);let D;t[8]===C?D=t[9]:(D=(0,b.jsx)(`span`,{className:`truncate text-1sm text-muted-foreground`,children:C}),t[8]=C,t[9]=D);let O;t[10]!==w||t[11]!==E||t[12]!==D?(O=(0,b.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:[w,E,D]}),t[10]=w,t[11]=E,t[12]=D,t[13]=O):O=t[13];let k;t[14]!==n.lastError||t[15]!==n.reference||t[16]!==n.state||t[17]!==n.zipBytes?(k=(0,b.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:n.state===`sent`&&n.reference!==void 0?(0,b.jsx)(r,{id:`SInSnF`,values:{0:n.reference},components:{0:(0,b.jsx)(`span`,{className:`font-mono text-foreground`})}}):n.state===`upload-failed`&&n.lastError!==void 0?(0,b.jsx)(`span`,{className:`text-destructive`,children:n.lastError.reason}):(0,b.jsx)(`span`,{children:x(n.zipBytes)})}),t[14]=n.lastError,t[15]=n.reference,t[16]=n.state,t[17]=n.zipBytes,t[18]=k):k=t[18];let A;t[19]!==O||t[20]!==k?(A=(0,b.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-1`,children:[O,k]}),t[19]=O,t[20]=k,t[21]=A):A=t[21];let j;t[22]!==y||t[23]!==s||t[24]!==a||t[25]!==n?(j=n.retryable?(0,b.jsxs)(o,{variant:`outline`,size:`xs`,disabled:y,onClick:()=>s(n),children:[a===`retrying`?(0,b.jsx)(p,{"aria-hidden":`true`}):(0,b.jsx)(_,{"aria-hidden":`true`}),(0,b.jsx)(r,{id:`6gRgw8`})]}):null,t[22]=y,t[23]=s,t[24]=a,t[25]=n,t[26]=j):j=t[26];let M;t[27]!==y||t[28]!==c||t[29]!==n?(M=n.zipExists?(0,b.jsx)(o,{variant:`ghost`,size:`icon-xs`,disabled:y,"aria-label":g(typeof window<`u`?window.okDesktop?.platform:void 0),onClick:()=>c(n),children:(0,b.jsx)(f,{"aria-hidden":`true`})}):null,t[27]=y,t[28]=c,t[29]=n,t[30]=M):M=t[30];let N;t[31]===u?N=t[32]:(N=u({id:`rUWrSE`}),t[31]=u,t[32]=N);let P;t[33]!==l||t[34]!==n?(P=()=>l(n),t[33]=l,t[34]=n,t[35]=P):P=t[35];let F;t[36]===a?F=t[37]:(F=a===`deleting`?(0,b.jsx)(p,{"aria-hidden":`true`}):(0,b.jsx)(m,{"aria-hidden":`true`}),t[36]=a,t[37]=F);let I;t[38]!==y||t[39]!==N||t[40]!==P||t[41]!==F?(I=(0,b.jsx)(o,{variant:`ghost`,size:`icon-xs`,disabled:y,"aria-label":N,onClick:P,children:F}),t[38]=y,t[39]=N,t[40]=P,t[41]=F,t[42]=I):I=t[42];let L;t[43]!==I||t[44]!==j||t[45]!==M?(L=(0,b.jsxs)(`div`,{className:`flex shrink-0 items-center gap-1`,children:[j,M,I]}),t[43]=I,t[44]=j,t[45]=M,t[46]=L):L=t[46];let R;return t[47]!==L||t[48]!==A?(R=(0,b.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-md border px-3 py-2.5`,children:[A,L]}),t[47]=L,t[48]=A,t[49]=R):R=t[49],R}function D(e){let t=(0,v.c)(13),{reports:n,pending:r,retry:i,remove:a,reveal:o}=e,s;if(t[0]!==r||t[1]!==a||t[2]!==n||t[3]!==i||t[4]!==o){let e;t[6]!==r||t[7]!==a||t[8]!==i||t[9]!==o?(e=e=>(0,b.jsx)(E,{row:e,pending:r[e.id],onRetry:i,onReveal:o,onDelete:a},e.id),t[6]=r,t[7]=a,t[8]=i,t[9]=o,t[10]=e):e=t[10],s=n.map(e),t[0]=r,t[1]=a,t[2]=n,t[3]=i,t[4]=o,t[5]=s}else s=t[5];let c;return t[11]===s?c=t[12]:(c=(0,b.jsx)(`div`,{className:`flex flex-col gap-2`,children:s}),t[11]=s,t[12]=c),c}function O(e){let t=(0,v.c)(9),{onReportABug:n}=e,i=S();if(i.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsxs)(`div`,{role:`status`,className:`flex items-center gap-2.5 py-6 text-sm text-muted-foreground`,children:[(0,b.jsx)(p,{className:`size-4`,"aria-hidden":`true`}),(0,b.jsx)(r,{id:`VmJT51`})]}),t[0]=e):e=t[0],e}if(i.status===`error`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`py-6 text-sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`FgQ7XZ`})}),t[1]=e):e=t[1],e}if(i.reports.length===0){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,b.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,b.jsx)(r,{id:`wcfO9r`})}),t[2]=e):e=t[2];let i;t[3]===n?i=t[4]:(i=n?(0,b.jsx)(o,{onClick:n,children:(0,b.jsx)(r,{id:`cd5EXh`})}):null,t[3]=n,t[4]=i);let a;return t[5]===i?a=t[6]:(a=(0,b.jsxs)(`div`,{className:`flex flex-col items-center gap-3 py-6 text-center`,children:[e,i]}),t[5]=i,t[6]=a),a}let a;return t[7]===i?a=t[8]:(a=(0,b.jsx)(D,{...i}),t[7]=i,t[8]=a),a}function k(){let e=(0,v.c)(14),[t,n]=(0,y.useState)(!1),i=S();if(i.status!==`ready`||i.reports.length===0)return null;let a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,b.jsx)(r,{id:`c2ktXL`}),e[0]=a):a=e[0];let u;e[1]===i.reports.length?u=e[2]:(u=(0,b.jsxs)(`span`,{className:`text-sm font-medium`,children:[a,` `,(0,b.jsxs)(`span`,{className:`font-normal text-muted-foreground`,children:[`(`,i.reports.length,`)`]})]}),e[1]=i.reports.length,e[2]=u);let f=`transition-transform motion-reduce:transition-none ${t?`rotate-180`:``}`,p;e[3]===f?p=e[4]:(p=(0,b.jsx)(d,{className:f,"aria-hidden":`true`}),e[3]=f,e[4]=p);let m;e[5]!==u||e[6]!==p?(m=(0,b.jsx)(c,{asChild:!0,children:(0,b.jsxs)(o,{variant:`ghost`,size:`sm`,className:`-mx-2 -my-0.5 h-auto w-[calc(100%+1rem)] justify-between px-2 py-1.5 data-[state=open]:bg-transparent data-[state=open]:hover:bg-muted`,children:[u,p]})}),e[5]=u,e[6]=p,e[7]=m):m=e[7];let h;e[8]===i?h=e[9]:(h=(0,b.jsx)(s,{className:`pt-2`,children:(0,b.jsx)(D,{...i})}),e[8]=i,e[9]=h);let g;return e[10]!==t||e[11]!==m||e[12]!==h?(g=(0,b.jsxs)(l,{open:t,onOpenChange:n,children:[m,h]}),e[10]=t,e[11]=m,e[12]=h,e[13]=g):g=e[13],g}export{k as n,O as t};
@@ -1 +1 @@
1
- import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-DztIj-ZS.js";import{t as l}from"./BugReportHistory-C59fSH13.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(s,{children:[h,(0,d.jsx)(r,{children:(0,d.jsx)(t,{id:`5ss1kT`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(l,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(a,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(o,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(c,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
1
+ import{t as e}from"./jsx-runtime-BUgB2tll.js";import{n as t}from"./dist-Nvb76hAm.js";import{t as n}from"./compiler-runtime-BfE3aGVn.js";import{a as r,c as i,i as a,n as o,s,t as c}from"./dialog-R8GugqUq.js";import{t as l}from"./BugReportHistory-CDRTpJV0.js";var u=n(),d=e();function f(e){let n=(0,u.c)(11),{open:f,onOpenChange:p,onReportABug:m}=e,h;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,d.jsx)(i,{children:(0,d.jsx)(t,{id:`QHCx0c`})}),n[0]=h):h=n[0];let g;n[1]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,d.jsxs)(s,{children:[h,(0,d.jsx)(r,{children:(0,d.jsx)(t,{id:`5ss1kT`})})]}),n[1]=g):g=n[1];let _;n[2]!==m||n[3]!==f?(_=f?(0,d.jsx)(l,{onReportABug:m}):null,n[2]=m,n[3]=f,n[4]=_):_=n[4];let v;n[5]===_?v=n[6]:(v=(0,d.jsxs)(a,{className:`sm:max-w-md`,children:[g,(0,d.jsx)(o,{className:`max-h-[60vh] overflow-y-auto`,children:_})]}),n[5]=_,n[6]=v);let y;return n[7]!==p||n[8]!==f||n[9]!==v?(y=(0,d.jsx)(c,{open:f,onOpenChange:p,children:v}),n[7]=p,n[8]=f,n[9]=v,n[10]=y):y=n[10],y}export{f as default};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Tn as n}from"./DocumentContext-BN8gSwJ-.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-DztIj-ZS.js";import{p as D,r as O}from"./terminal-cli-display-CW7j5kqb.js";import{Ba as k}from"./dist-GenOktAv.js";import{t as A}from"./createLucideIcon-Bhw2PmPp.js";import{t as j}from"./folder-CopDpuy5.js";import{t as ee}from"./spinner-BqySY7qY.js";var M=t(),N=e(r(),1),P=o(),te=3100,ne=3;function re(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ne;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ie={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ae=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function oe(e,t={}){let n=t.rng??Math.random,r=t.colors??ae,i=ie[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var se=1.8,ce=90,le=16,ue=380,de=.025,fe=.1,pe=.18,me=400,he=9.2736,ge=18.1799,F=14.5244,_e={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function ve(e,t){let{halfWidth:n,apexLift:r}=_e[t];return`M${e-n} ${F+.3} Q${e} ${F-r}, ${e+n} ${F+.3}`}function ye(e){let t=1.5,n=.3;return`M${e-t} ${F-n} Q${e} ${F+1.4}, ${e+t} ${F-n}`}var be=15,xe=15;function I(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function L(e){let t=(0,P.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,N.useRef)(null),g=(0,N.useRef)(null),_=(0,N.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,N.useRef)(v),[b,x]=(0,N.useState)(0),[S,C]=(0,N.useState)(0),w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[1]=w):w=t[1];let[T,E]=(0,N.useState)(w),D=(0,N.useRef)(0),O=(0,N.useRef)(void 0),k=p===`sleeping`,A;t[2]!==b||t[3]!==k||t[4]!==u?(A=function(){if(k)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=D.current===0?1/0:e-D.current;D.current=e;let n=re(b,t);n===3&&u?.(),x(n),C(Te),E(oe(n)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},te)},t[2]=b,t[3]=k,t[4]=u,t[5]=A):A=t[5];let j=A,ee,ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>()=>clearTimeout(O.current),ne=[],t[6]=ee,t[7]=ne):(ee=t[6],ne=t[7]),(0,N.useEffect)(ee,ne);let ie,ae;t[8]!==m||t[9]!==k?(ie=()=>{m===0||k||(x(3),C(we),E(oe(3)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},te))},ae=[m,k],t[8]=m,t[9]=k,t[10]=ie,t[11]=ae):(ie=t[10],ae=t[11]),(0,N.useEffect)(ie,ae);let _e,be;t[12]!==k||t[13]!==f?(_e=()=>{if(!f||k||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/ue)),C=-Math.max(-1,Math.min(1,b/ue))*le,w=S*le,T=0,E=0;if(x>=1){let e=Math.min(x/ce,1)*se;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*fe,i+=(w-i)*fe,u.style.transform=`perspective(${me}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*pe,o+=(E-o)*pe;let O=i*de,k=-r*de,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},be=[f,k],t[12]=k,t[13]=f,t[14]=_e,t[15]=be):(_e=t[14],be=t[15]),(0,N.useEffect)(_e,be);let xe;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=xe):xe=t[16],(0,N.useLayoutEffect)(xe);let I=b>0,L=I?b:1,Ee=I?`ok-blob-clicked-${b}`:null,R;t[17]===r?R=t[18]:(R=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=R);let De=k?`cursor-default`:`cursor-pointer`,z=`body-${S}`,Oe=k&&`ok-blob-sleeping`,B;t[19]!==Ee||t[20]!==Oe?(B=s(`ok-blob-group`,Oe,Ee),t[19]=Ee,t[20]=Oe,t[21]=B):B=t[21];let ke;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,M.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=ke):ke=t[22];let Ae=(I||k)&&`ok-blob-eye-hidden`,V;t[23]===Ae?V=t[24]:(V=s(`ok-blob-eye`,Ae),t[23]=Ae,t[24]=V);let H;t[25]===V?H=t[26]:(H=(0,M.jsx)(`ellipse`,{cx:he,cy:F,rx:1.2722,ry:1.9083,className:V}),t[25]=V,t[26]=H);let je=(I||k)&&`ok-blob-eye-hidden`,U;t[27]===je?U=t[28]:(U=s(`ok-blob-eye ok-blob-eye-right`,je),t[27]=je,t[28]=U);let W;t[29]===U?W=t[30]:(W=(0,M.jsx)(`ellipse`,{cx:ge,cy:F,rx:1.2722,ry:1.9083,className:U}),t[29]=U,t[30]=W);let G;t[31]===L?G=t[32]:(G=ve(he,L),t[31]=L,t[32]=G);let Me=(!I||k)&&`ok-blob-eye-hidden`,K;t[33]===Me?K=t[34]:(K=s(`ok-blob-happy-eye`,Me),t[33]=Me,t[34]=K);let q;t[35]!==G||t[36]!==K?(q=(0,M.jsx)(`path`,{d:G,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:K}),t[35]=G,t[36]=K,t[37]=q):q=t[37];let J;t[38]===L?J=t[39]:(J=ve(ge,L),t[38]=L,t[39]=J);let Ne=(!I||k)&&`ok-blob-eye-hidden`,Y;t[40]===Ne?Y=t[41]:(Y=s(`ok-blob-happy-eye`,Ne),t[40]=Ne,t[41]=Y);let X;t[42]!==J||t[43]!==Y?(X=(0,M.jsx)(`path`,{d:J,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Y}),t[42]=J,t[43]=Y,t[44]=X):X=t[44];let Z;t[45]===k?Z=t[46]:(Z=k?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`path`,{d:ye(he),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,M.jsx)(`path`,{d:ye(ge),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=k,t[46]=Z);let Q;t[47]!==H||t[48]!==W||t[49]!==q||t[50]!==X||t[51]!==Z?(Q=(0,M.jsxs)(`g`,{ref:_,children:[H,W,q,X,Z]}),t[47]=H,t[48]=W,t[49]=q,t[50]=X,t[51]=Z,t[52]=Q):Q=t[52];let $;t[53]!==z||t[54]!==B||t[55]!==Q?($=(0,M.jsxs)(`g`,{className:B,children:[ke,Q]},z),t[53]=z,t[54]=B,t[55]=Q,t[56]=$):$=t[56];let Pe;t[57]===k?Pe=t[58]:(Pe=k?(0,M.jsxs)(`g`,{children:[(0,M.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,M.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=k,t[58]=Pe);let Fe;t[59]!==S||t[60]!==T?(Fe=T.length>0&&(0,M.jsx)(`g`,{children:T.map(Se)},`firework-${S}`),t[59]=S,t[60]=T,t[61]=Fe):Fe=t[61];let Ie;t[62]!==j||t[63]!==d||t[64]!==De||t[65]!==$||t[66]!==Pe||t[67]!==Fe?(Ie=(0,M.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:De,"aria-hidden":`true`,onClick:j,onMouseDown:Ce,children:[$,Pe,Fe]}),t[62]=j,t[63]=d,t[64]=De,t[65]=$,t[66]=Pe,t[67]=Fe,t[68]=Ie):Ie=t[68];let Le;return t[69]!==i||t[70]!==R||t[71]!==Ie?(Le=(0,M.jsx)(`span`,{ref:h,className:R,style:i,children:Ie}),t[69]=i,t[70]=R,t[71]=Ie,t[72]=Le):Le=t[72],Le}function Se(e){return(0,M.jsx)(`circle`,{cx:be+e.originDx,cy:xe+e.originDy,r:e.size,className:`ok-blob-firework`,style:I(e)},e.id)}function Ce(e){return e.preventDefault()}function we(e){return e+1}function Te(e){return e+1}var Ee=`AlertDialog`,[R,De]=f(Ee,[E]),z=E(),Oe=e=>{let{__scopeAlertDialog:t,...n}=e,r=z(t);return(0,M.jsx)(C,{...r,...n,modal:!0})};Oe.displayName=Ee;var B=`AlertDialogTrigger`,ke=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(b,{...i,...r,ref:t})});ke.displayName=B;var Ae=`AlertDialogPortal`,V=e=>{let{__scopeAlertDialog:t,...n}=e,r=z(t);return(0,M.jsx)(w,{...r,...n})};V.displayName=Ae;var H=`AlertDialogOverlay`,je=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(y,{...i,...r,ref:t})});je.displayName=H;var U=`AlertDialogContent`,[W,G]=R(U),Me=d(`AlertDialogContent`),K=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=z(n),o=N.useRef(null),s=u(t,o),c=N.useRef(null);return(0,M.jsx)(_,{contentName:U,titleName:q,docsSlug:`alert-dialog`,children:(0,M.jsx)(W,{scope:n,cancelRef:c,children:(0,M.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,M.jsx)(Me,{children:r}),(0,M.jsx)(Pe,{contentRef:o})]})})})});K.displayName=U;var q=`AlertDialogTitle`,J=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(x,{...i,...r,ref:t})});J.displayName=q;var Ne=`AlertDialogDescription`,Y=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(v,{...i,...r,ref:t})});Y.displayName=Ne;var X=`AlertDialogAction`,Z=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(S,{...i,...r,ref:t})});Z.displayName=X;var Q=`AlertDialogCancel`,$=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=G(Q,n),a=z(n),o=u(t,i);return(0,M.jsx)(S,{...a,...r,ref:o})});$.displayName=Q;var Pe=({contentRef:e})=>{let t=`\`${U}\` requires a description for the component to be accessible for screen reader users.
1
+ import{o as e}from"./chunk-CYidjpOJ.js";import{t}from"./jsx-runtime-BUgB2tll.js";import{Tn as n}from"./DocumentContext-J495RUh0.js";import{t as r}from"./react-f2sANaYj.js";import{n as i,r as a}from"./dist-Nvb76hAm.js";import{t as o}from"./compiler-runtime-BfE3aGVn.js";import{t as s}from"./utils-CPqDy6Hr.js";import{t as c}from"./mascot-outline-CtS592mc.js";import{t as l}from"./button-CA0dewJJ.js";import{a as u,r as d}from"./dist-mv8e6dBX.js";import{c as f,o as p}from"./dist-DsLZcVyZ.js";import{i as m,n as h,t as g}from"./tooltip-DHXgxWLL.js";import{_,d as v,f as y,g as b,h as x,l as S,m as C,p as w,u as T,v as E}from"./dialog-R8GugqUq.js";import{p as D,r as O}from"./terminal-cli-display-CgJpdKCI.js";import{Ja as k}from"./dist-ILlrHFKs.js";import{t as A}from"./createLucideIcon-Bhw2PmPp.js";import{t as j}from"./folder-CWlDik9N.js";import{t as ee}from"./spinner-CHTY-VE-.js";var M=t(),N=e(r(),1),P=o(),te=3100,ne=3;function re(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??ne;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var ie={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},ae=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function oe(e,t={}){let n=t.rng??Math.random,r=t.colors??ae,i=ie[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var se=1.8,ce=90,le=16,ue=380,de=.025,fe=.1,pe=.18,me=400,he=9.2736,ge=18.1799,F=14.5244,_e={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function ve(e,t){let{halfWidth:n,apexLift:r}=_e[t];return`M${e-n} ${F+.3} Q${e} ${F-r}, ${e+n} ${F+.3}`}function ye(e){let t=1.5,n=.3;return`M${e-t} ${F-n} Q${e} ${F+1.4}, ${e+t} ${F-n}`}var be=15,xe=15;function I(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function L(e){let t=(0,P.c)(73),{size:n,className:r,style:i,trackMouse:a,variant:o,celebrateSignal:l,onRage:u}=e,d=n===void 0?48:n,f=a===void 0?!0:a,p=o===void 0?`default`:o,m=l===void 0?0:l,h=(0,N.useRef)(null),g=(0,N.useRef)(null),_=(0,N.useRef)(null),v;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(v={x:0,y:0},t[0]=v):v=t[0];let y=(0,N.useRef)(v),[b,x]=(0,N.useState)(0),[S,C]=(0,N.useState)(0),w;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(w=[],t[1]=w):w=t[1];let[T,E]=(0,N.useState)(w),D=(0,N.useRef)(0),O=(0,N.useRef)(void 0),k=p===`sleeping`,A;t[2]!==b||t[3]!==k||t[4]!==u?(A=function(){if(k)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=D.current===0?1/0:e-D.current;D.current=e;let n=re(b,t);n===3&&u?.(),x(n),C(Te),E(oe(n)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},te)},t[2]=b,t[3]=k,t[4]=u,t[5]=A):A=t[5];let j=A,ee,ne;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(ee=()=>()=>clearTimeout(O.current),ne=[],t[6]=ee,t[7]=ne):(ee=t[6],ne=t[7]),(0,N.useEffect)(ee,ne);let ie,ae;t[8]!==m||t[9]!==k?(ie=()=>{m===0||k||(x(3),C(we),E(oe(3)),clearTimeout(O.current),O.current=setTimeout(()=>{x(0),E([])},te))},ae=[m,k],t[8]=m,t[9]=k,t[10]=ie,t[11]=ae):(ie=t[10],ae=t[11]),(0,N.useEffect)(ie,ae);let _e,be;t[12]!==k||t[13]!==f?(_e=()=>{if(!f||k||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,c=function(){s===0&&(s=requestAnimationFrame(u))},l=function(r){e=r.clientX,t=r.clientY,n=!0,c()};function u(){s=0;let l=g.current,u=h.current;if(!l||!u){c();return}let d=n;n=!1;let f=l.getBoundingClientRect(),p=f.left+f.width/2,m=f.top+f.height*.48,v=e-p,b=t-m,x=Math.hypot(v,b),S=Math.max(-1,Math.min(1,v/ue)),C=-Math.max(-1,Math.min(1,b/ue))*le,w=S*le,T=0,E=0;if(x>=1){let e=Math.min(x/ce,1)*se;T=v/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!d&&D)return;c(),r+=(C-r)*fe,i+=(w-i)*fe,u.style.transform=`perspective(${me}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*pe,o+=(E-o)*pe;let O=i*de,k=-r*de,A=a+O,j=o+k;y.current.x=A,y.current.y=j,_.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,l,{passive:!0}),c(),()=>{document.removeEventListener(`mousemove`,l),s!==0&&cancelAnimationFrame(s),s=0,h.current&&(h.current.style.transform=``),y.current={x:0,y:0},_.current?.removeAttribute(`transform`)}},be=[f,k],t[12]=k,t[13]=f,t[14]=_e,t[15]=be):(_e=t[14],be=t[15]),(0,N.useEffect)(_e,be);let xe;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(xe=()=>{let e=_.current;if(!e)return;let{x:t,y:n}=y.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[16]=xe):xe=t[16],(0,N.useLayoutEffect)(xe);let I=b>0,L=I?b:1,Ee=I?`ok-blob-clicked-${b}`:null,R;t[17]===r?R=t[18]:(R=s(`ok-blob-3d-wrapper`,r),t[17]=r,t[18]=R);let De=k?`cursor-default`:`cursor-pointer`,z=`body-${S}`,Oe=k&&`ok-blob-sleeping`,B;t[19]!==Ee||t[20]!==Oe?(B=s(`ok-blob-group`,Oe,Ee),t[19]=Ee,t[20]=Oe,t[21]=B):B=t[21];let ke;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,M.jsx)(`path`,{d:c,className:`ok-blob-body`}),t[22]=ke):ke=t[22];let Ae=(I||k)&&`ok-blob-eye-hidden`,V;t[23]===Ae?V=t[24]:(V=s(`ok-blob-eye`,Ae),t[23]=Ae,t[24]=V);let H;t[25]===V?H=t[26]:(H=(0,M.jsx)(`ellipse`,{cx:he,cy:F,rx:1.2722,ry:1.9083,className:V}),t[25]=V,t[26]=H);let je=(I||k)&&`ok-blob-eye-hidden`,U;t[27]===je?U=t[28]:(U=s(`ok-blob-eye ok-blob-eye-right`,je),t[27]=je,t[28]=U);let W;t[29]===U?W=t[30]:(W=(0,M.jsx)(`ellipse`,{cx:ge,cy:F,rx:1.2722,ry:1.9083,className:U}),t[29]=U,t[30]=W);let G;t[31]===L?G=t[32]:(G=ve(he,L),t[31]=L,t[32]=G);let Me=(!I||k)&&`ok-blob-eye-hidden`,K;t[33]===Me?K=t[34]:(K=s(`ok-blob-happy-eye`,Me),t[33]=Me,t[34]=K);let q;t[35]!==G||t[36]!==K?(q=(0,M.jsx)(`path`,{d:G,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:K}),t[35]=G,t[36]=K,t[37]=q):q=t[37];let J;t[38]===L?J=t[39]:(J=ve(ge,L),t[38]=L,t[39]=J);let Ne=(!I||k)&&`ok-blob-eye-hidden`,Y;t[40]===Ne?Y=t[41]:(Y=s(`ok-blob-happy-eye`,Ne),t[40]=Ne,t[41]=Y);let X;t[42]!==J||t[43]!==Y?(X=(0,M.jsx)(`path`,{d:J,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:Y}),t[42]=J,t[43]=Y,t[44]=X):X=t[44];let Z;t[45]===k?Z=t[46]:(Z=k?(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(`path`,{d:ye(he),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,M.jsx)(`path`,{d:ye(ge),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[45]=k,t[46]=Z);let Q;t[47]!==H||t[48]!==W||t[49]!==q||t[50]!==X||t[51]!==Z?(Q=(0,M.jsxs)(`g`,{ref:_,children:[H,W,q,X,Z]}),t[47]=H,t[48]=W,t[49]=q,t[50]=X,t[51]=Z,t[52]=Q):Q=t[52];let $;t[53]!==z||t[54]!==B||t[55]!==Q?($=(0,M.jsxs)(`g`,{className:B,children:[ke,Q]},z),t[53]=z,t[54]=B,t[55]=Q,t[56]=$):$=t[56];let Pe;t[57]===k?Pe=t[58]:(Pe=k?(0,M.jsxs)(`g`,{children:[(0,M.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,M.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[57]=k,t[58]=Pe);let Fe;t[59]!==S||t[60]!==T?(Fe=T.length>0&&(0,M.jsx)(`g`,{children:T.map(Se)},`firework-${S}`),t[59]=S,t[60]=T,t[61]=Fe):Fe=t[61];let Ie;t[62]!==j||t[63]!==d||t[64]!==De||t[65]!==$||t[66]!==Pe||t[67]!==Fe?(Ie=(0,M.jsxs)(`svg`,{ref:g,width:d,height:d,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:De,"aria-hidden":`true`,onClick:j,onMouseDown:Ce,children:[$,Pe,Fe]}),t[62]=j,t[63]=d,t[64]=De,t[65]=$,t[66]=Pe,t[67]=Fe,t[68]=Ie):Ie=t[68];let Le;return t[69]!==i||t[70]!==R||t[71]!==Ie?(Le=(0,M.jsx)(`span`,{ref:h,className:R,style:i,children:Ie}),t[69]=i,t[70]=R,t[71]=Ie,t[72]=Le):Le=t[72],Le}function Se(e){return(0,M.jsx)(`circle`,{cx:be+e.originDx,cy:xe+e.originDy,r:e.size,className:`ok-blob-firework`,style:I(e)},e.id)}function Ce(e){return e.preventDefault()}function we(e){return e+1}function Te(e){return e+1}var Ee=`AlertDialog`,[R,De]=f(Ee,[E]),z=E(),Oe=e=>{let{__scopeAlertDialog:t,...n}=e,r=z(t);return(0,M.jsx)(C,{...r,...n,modal:!0})};Oe.displayName=Ee;var B=`AlertDialogTrigger`,ke=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(b,{...i,...r,ref:t})});ke.displayName=B;var Ae=`AlertDialogPortal`,V=e=>{let{__scopeAlertDialog:t,...n}=e,r=z(t);return(0,M.jsx)(w,{...r,...n})};V.displayName=Ae;var H=`AlertDialogOverlay`,je=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(y,{...i,...r,ref:t})});je.displayName=H;var U=`AlertDialogContent`,[W,G]=R(U),Me=d(`AlertDialogContent`),K=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:r,...i}=e,a=z(n),o=N.useRef(null),s=u(t,o),c=N.useRef(null);return(0,M.jsx)(_,{contentName:U,titleName:q,docsSlug:`alert-dialog`,children:(0,M.jsx)(W,{scope:n,cancelRef:c,children:(0,M.jsxs)(T,{role:`alertdialog`,...a,...i,ref:s,onOpenAutoFocus:p(i.onOpenAutoFocus,e=>{e.preventDefault(),c.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,M.jsx)(Me,{children:r}),(0,M.jsx)(Pe,{contentRef:o})]})})})});K.displayName=U;var q=`AlertDialogTitle`,J=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(x,{...i,...r,ref:t})});J.displayName=q;var Ne=`AlertDialogDescription`,Y=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(v,{...i,...r,ref:t})});Y.displayName=Ne;var X=`AlertDialogAction`,Z=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,i=z(n);return(0,M.jsx)(S,{...i,...r,ref:t})});Z.displayName=X;var Q=`AlertDialogCancel`,$=N.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=G(Q,n),a=z(n),o=u(t,i);return(0,M.jsx)(S,{...a,...r,ref:o})});$.displayName=Q;var Pe=({contentRef:e})=>{let t=`\`${U}\` requires a description for the component to be accessible for screen reader users.
2
2
 
3
3
  You can add a description to the \`${U}\` by passing a \`${Ne}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
4
4