@inkeep/open-knowledge 0.42.1 → 0.43.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (354) hide show
  1. package/dist/{acp-harness-probe-BC8-tjIs.mjs → acp-harness-probe-BI6bXf3a.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/assets/skills/write-skill/SKILL.md +1 -1
  5. package/dist/{build-fAc55Z_L.mjs → build-DYQrG4v7.mjs} +1 -1
  6. package/dist/build-DcqN8tua.mjs +1 -0
  7. package/dist/{chunk-TLSUDHID-BOrmK-jg.mjs → chunk-TLSUDHID-B0bd8ZfM.mjs} +2 -2
  8. package/dist/cli.mjs +60 -60
  9. package/dist/config-schema.json +154 -0
  10. package/dist/config.project.schema.json +154 -0
  11. package/dist/constants-BKJ7B5iw.mjs +2 -0
  12. package/dist/{diff-HJF2MPDN-BvwqXcA5.mjs → diff-HJF2MPDN-DhZaF2MX.mjs} +1 -1
  13. package/dist/{flag-coverage-6JEX67RU-D3X0I2ha.mjs → flag-coverage-6JEX67RU-D1byxsyF.mjs} +2 -2
  14. package/dist/fs-traced-B9Czc2nP.mjs +1 -0
  15. package/dist/{fs-traced-Cc6WsRtP.mjs → fs-traced-BmZQL7v9.mjs} +2 -2
  16. package/dist/git-handle-B1uGukUi.mjs +1 -0
  17. package/dist/{git-handle-BFhoHYr0.mjs → git-handle-bosCq-DO.mjs} +2 -2
  18. package/dist/index.d.mts +37 -13
  19. package/dist/index.mjs +1 -1
  20. package/dist/{init-D7cD6zok.mjs → init-BUp3cQ_4.mjs} +37 -37
  21. package/dist/init-CIt3KTw5.mjs +1 -0
  22. package/dist/{launch-json-removal-CTJjliTF.mjs → launch-json-removal-CwOqJJze.mjs} +2 -2
  23. package/dist/{lib-CE7ieLC-.mjs → lib-BS_oZ9bm.mjs} +4 -4
  24. package/dist/{libesm-CG75CrN9.mjs → libesm-DzwC_yFw.mjs} +1 -1
  25. package/dist/loader-Bofa7u1n.mjs +1 -0
  26. package/dist/{loader-CiE2EBJO.mjs → loader-y7Mn8M-Z.mjs} +2 -2
  27. package/dist/md-manager-DPw-b4lt.mjs +2 -0
  28. package/dist/{open-browser-Be1y1t9d.mjs → open-browser-CkLowmAw.mjs} +2 -2
  29. package/dist/parse-worker.mjs +1 -1
  30. package/dist/{preview-DXg4YbDp.mjs → preview-BV8bR51k.mjs} +2 -2
  31. package/dist/preview-CUhu4iSu.mjs +1 -0
  32. package/dist/public/assets/ActivityModeContent-CCFHLlT9.js +1 -0
  33. package/dist/public/assets/AgentDiffPane-CQfhJYfr.js +2 -0
  34. package/dist/public/assets/{AgentThreadClientBinder-MaSL3zla.js → AgentThreadClientBinder-DZwzRPDa.js} +1 -1
  35. package/dist/public/assets/CodeMirrorPropInput-BqDZpzvH.js +3 -0
  36. package/dist/public/assets/{ConsentDialogBody-BjbzWR8D.js → ConsentDialogBody-CiXNBNFL.js} +1 -1
  37. package/dist/public/assets/DocumentContext-WcIs30H8.js +38 -0
  38. package/dist/public/assets/{EditorModeToggle-D0Db8Ydu.js → EditorModeToggle-1xLWvnWd.js} +2 -2
  39. package/dist/public/assets/{EnableSyncConfirmDialog-B2sHRtLY.js → EnableSyncConfirmDialog-CPuodmd5.js} +1 -1
  40. package/dist/public/assets/FeedbackForm-DXei5e26.js +1 -0
  41. package/dist/public/assets/GraphPanel-U2ZyS1Aa.js +44 -0
  42. package/dist/public/assets/{LintConfigEditor-DKgxJcvl.js → LintConfigEditor-DEUL9rFl.js} +1 -1
  43. package/dist/public/assets/ManagedArtifactProperties-EDghUFni.js +1 -0
  44. package/dist/public/assets/{McpConsentDialogBody-CYOKF_sf.js → McpConsentDialogBody-C8VSVSPz.js} +1 -1
  45. package/dist/public/assets/MermaidDocEditor-BwjUe5g_.js +1 -0
  46. package/dist/public/assets/PropertyPanel-F1tECi8I.js +2 -0
  47. package/dist/public/assets/{RegisteredAgentIcon-8Tcfr3WP.js → RegisteredAgentIcon-C2dU04N7.js} +1 -1
  48. package/dist/public/assets/ReportBugDialogBody-Cz_kN3Qc.js +3 -0
  49. package/dist/public/assets/{SchemaConfigEditor-D7xbhgl6.js → SchemaConfigEditor-C_t3p7aQ.js} +1 -1
  50. package/dist/public/assets/SettingsDialogBody-_7c5ty2t.js +7 -0
  51. package/dist/public/assets/{ShareBranchSwitchDialog-C6G5A_aK.js → ShareBranchSwitchDialog-Dj6PdkLL.js} +1 -1
  52. package/dist/public/assets/{ShareReceiveDialog-DLEkjmkI.js → ShareReceiveDialog-Cmfia-Vl.js} +1 -1
  53. package/dist/public/assets/{ShareReceiveMissDialog-Ls1ECEge.js → ShareReceiveMissDialog-xHTJ1V_2.js} +1 -1
  54. package/dist/public/assets/{SkillEditorActions-AGeWFFyT.js → SkillEditorActions-Cw7itVro.js} +1 -1
  55. package/dist/public/assets/SourceEditor-DGpQCfDe.js +1 -0
  56. package/dist/public/assets/{TerminalPanel-Bf_h8SIB.js → TerminalPanel-Dfvz7JrY.js} +3 -3
  57. package/dist/public/assets/TerminalSessionsHost-D6vvdN1I.js +2 -0
  58. package/dist/public/assets/{TerminalWindowApp-2yCXBcQc.js → TerminalWindowApp-CfeLvqLD.js} +1 -1
  59. package/dist/public/assets/ThreadView-S_XJwwbZ.js +6 -0
  60. package/dist/public/assets/TimelineDiffPane-DgS-xWyU.js +2 -0
  61. package/dist/public/assets/{abnfDiagram-VRR7QNED-BN6xOaJK.js → abnfDiagram-VRR7QNED-BA0sca5y.js} +1 -1
  62. package/dist/public/assets/{agent-diff-store-Bi0IQPgd.js → agent-diff-store-Cn0Zbsuy.js} +1 -1
  63. package/dist/public/assets/{agent-visibility-HpfSUFqP.js → agent-visibility-B4n6jrOx.js} +1 -1
  64. package/dist/public/assets/{arc-DXLgvp45.js → arc-DIcYIkPb.js} +1 -1
  65. package/dist/public/assets/architecture-TIHT7OUA-DhKVyAdC.js +1 -0
  66. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-sAL9H8K0.js → architectureDiagram-ZJ3FMSHR-CyZsfJqr.js} +1 -1
  67. package/dist/public/assets/auth-state-cache-PC5ml3gS.js +11 -0
  68. package/dist/public/assets/awareness-heartbeat.worker-BYkbsKQ2.js +1 -0
  69. package/dist/public/assets/{blockDiagram-677ZJIJ3-CecPiwgF.js → blockDiagram-677ZJIJ3-BL4J4ddi.js} +1 -1
  70. package/dist/public/assets/{c4Diagram-LMCZKHZV-D8mdqYYS.js → c4Diagram-LMCZKHZV-DtpyWL_l.js} +1 -1
  71. package/dist/public/assets/{calendar-DEDeJBdZ.js → calendar-2iQWonjM.js} +1 -1
  72. package/dist/public/assets/channel-D7XYjy4a.js +1 -0
  73. package/dist/public/assets/chunk-2Q5K7J3B-BpVQiBsM.js +1 -0
  74. package/dist/public/assets/{chunk-32BRIVSS-JpxGJ5ji.js → chunk-32BRIVSS-J_rdnOiy.js} +1 -1
  75. package/dist/public/assets/{chunk-52WLFC77-C_iSxcYL.js → chunk-52WLFC77-BOMCKXNP.js} +1 -1
  76. package/dist/public/assets/{chunk-5FCAYU7R-Bq8uZn8B.js → chunk-5FCAYU7R-8Y9BJKC-.js} +1 -1
  77. package/dist/public/assets/{chunk-5HE753X5-Canmf8DQ.js → chunk-5HE753X5-CQEApaqU.js} +1 -1
  78. package/dist/public/assets/{chunk-5JV3BV7I-Dtexaqo4.js → chunk-5JV3BV7I-Wp4ieThX.js} +1 -1
  79. package/dist/public/assets/{chunk-5TONJI2A-QaNyDyr1.js → chunk-5TONJI2A-Dht2oB5p.js} +1 -1
  80. package/dist/public/assets/{chunk-5VM5RSS4-DnRDZx9C.js → chunk-5VM5RSS4-BtUIXst7.js} +1 -1
  81. package/dist/public/assets/{chunk-7BUUIJ7U-CjwBXrEk.js → chunk-7BUUIJ7U-B7ItXXvn.js} +1 -1
  82. package/dist/public/assets/{chunk-BIQX33UG-CwPTWPTQ.js → chunk-BIQX33UG-B4CjyNhu.js} +1 -1
  83. package/dist/public/assets/{chunk-BO2N2NFS-BTXsfKML.js → chunk-BO2N2NFS-DMgXoikU.js} +3 -3
  84. package/dist/public/assets/{chunk-C7G6YPKG-yRQSkwCz.js → chunk-C7G6YPKG-Bhzd4FsL.js} +1 -1
  85. package/dist/public/assets/{chunk-CQNSW5MT-BzGo9Za_.js → chunk-CQNSW5MT-CVrDoms_.js} +1 -1
  86. package/dist/public/assets/{chunk-CYSBUYHQ-CKmnpHug.js → chunk-CYSBUYHQ-N9puYKAt.js} +1 -1
  87. package/dist/public/assets/{chunk-EMLP6XTP-_x7IkQoS.js → chunk-EMLP6XTP-ACA6yW7o.js} +1 -1
  88. package/dist/public/assets/{chunk-EX3LRPZG-Dp9dLoos.js → chunk-EX3LRPZG-BIvLDOrf.js} +1 -1
  89. package/dist/public/assets/{chunk-FWX5IMBZ-DS2bi_oI.js → chunk-FWX5IMBZ-1CESfm5O.js} +2 -2
  90. package/dist/public/assets/{chunk-HOUHSVGY-CiAzcmEO.js → chunk-HOUHSVGY-DTcG17JD.js} +1 -1
  91. package/dist/public/assets/{chunk-ICXQ74PX-COjRz7aI.js → chunk-ICXQ74PX-CDyWyZCQ.js} +1 -1
  92. package/dist/public/assets/{chunk-JG7HCLWE-BIqqOtX1.js → chunk-JG7HCLWE-gt52jYPR.js} +1 -1
  93. package/dist/public/assets/{chunk-JWPE2WC7-DKmcMFEN.js → chunk-JWPE2WC7-BIGkO1cG.js} +1 -1
  94. package/dist/public/assets/{chunk-MOJQB5TN-BJQv3CxF.js → chunk-MOJQB5TN-dX_Ns_6-.js} +1 -1
  95. package/dist/public/assets/{chunk-MOZMSUNE-Cy6wrRA7.js → chunk-MOZMSUNE-DtIvb1II.js} +1 -1
  96. package/dist/public/assets/{chunk-OGEWGWER-C7C3Oiaz.js → chunk-OGEWGWER-BgCGYbch.js} +1 -1
  97. package/dist/public/assets/{chunk-OSBZ3O6U-DmX-gaPq.js → chunk-OSBZ3O6U-BjU8eaT1.js} +1 -1
  98. package/dist/public/assets/{chunk-PUDLZKDR-ZoTPQ917.js → chunk-PUDLZKDR-BtLyPGmD.js} +1 -1
  99. package/dist/public/assets/{chunk-Q4XR5HBZ-sjes-Yon.js → chunk-Q4XR5HBZ-B32WTAPs.js} +1 -1
  100. package/dist/public/assets/{chunk-QBLGF6JB-BiU9LEk8.js → chunk-QBLGF6JB-CprENtRb.js} +1 -1
  101. package/dist/public/assets/{chunk-R7FJI6CG-BAfUnNIm.js → chunk-R7FJI6CG-DCV9Dvbs.js} +1 -1
  102. package/dist/public/assets/{chunk-RYQCIY6F-IRvgwbUs.js → chunk-RYQCIY6F-DAyLri1b.js} +1 -1
  103. package/dist/public/assets/{chunk-U6XO7XAA-2Ds3FX_A.js → chunk-U6XO7XAA-DSdpZQB7.js} +1 -1
  104. package/dist/public/assets/{chunk-V7JOEXUC-Xkrljz-l.js → chunk-V7JOEXUC-9lX7N0EN.js} +1 -1
  105. package/dist/public/assets/chunk-VAUOI2AC-buA1NS7h.js +1 -0
  106. package/dist/public/assets/{chunk-VR4S4FIN-Db6y0lij.js → chunk-VR4S4FIN-CcTJJ1HA.js} +1 -1
  107. package/dist/public/assets/{chunk-WYO6CB5R-WjatCbeP.js → chunk-WYO6CB5R-9yPqK9ib.js} +1 -1
  108. package/dist/public/assets/chunk-XXDRQBXY-Dpdm1nrz.js +1 -0
  109. package/dist/public/assets/{chunk-YOTPTUD7-BDIMzFfd.js → chunk-YOTPTUD7-DBti7bK5.js} +1 -1
  110. package/dist/public/assets/{chunk-ZGVPDNZ5-DKtGLh__.js → chunk-ZGVPDNZ5-5ruaVNfo.js} +1 -1
  111. package/dist/public/assets/{chunk-ZIRB5QZD-JvsKOaWe.js → chunk-ZIRB5QZD-DmY1977n.js} +1 -1
  112. package/dist/public/assets/classDiagram-OUVF2IWQ-BdRcUr99.js +1 -0
  113. package/dist/public/assets/classDiagram-v2-EOCWNBFH-4fffeoHu.js +1 -0
  114. package/dist/public/assets/client-version-BmlQC9U8.js +1 -0
  115. package/dist/public/assets/{config-provider-DIuwNlqX.js → config-provider-GshVNiWq.js} +2 -2
  116. package/dist/public/assets/{cose-bilkent-JH36ORCC-B5xjEHuC.js → cose-bilkent-JH36ORCC-D8nyC_t4.js} +1 -1
  117. package/dist/public/assets/cynefin-VYW2F7L2-BlrdxSfe.js +1 -0
  118. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-BeGFvfoc.js → cynefinDiagram-TSTJHNR4-B4B58YEO.js} +1 -1
  119. package/dist/public/assets/{dagre-CLVncoxl.js → dagre-DjTdhlGF.js} +1 -1
  120. package/dist/public/assets/{dagre-VKFMJZFB-D98i06T_.js → dagre-VKFMJZFB-DQHmtQOE.js} +1 -1
  121. package/dist/public/assets/{diagram-FQU43EPY--u6SeKWp.js → diagram-FQU43EPY-B28ABQG6.js} +1 -1
  122. package/dist/public/assets/{diagram-G47NLZAW-BqkpNwsF.js → diagram-G47NLZAW-1MthGQcj.js} +1 -1
  123. package/dist/public/assets/{diagram-NH7WQ7WH-eeVqGH2O.js → diagram-NH7WQ7WH-B_Fhjw29.js} +1 -1
  124. package/dist/public/assets/{diagram-OA4YK3LP-D_SnUALW.js → diagram-OA4YK3LP-1B7_yz5p.js} +1 -1
  125. package/dist/public/assets/{diagram-WEI45ONY-DKlVw8je.js → diagram-WEI45ONY-DzfuKRxf.js} +1 -1
  126. package/dist/public/assets/{dist-Cal4LUep.js → dist-Cgpf3BIr.js} +170 -168
  127. package/dist/public/assets/dist-ChSSPf9y.js +2 -0
  128. package/dist/public/assets/dist-CslAqn54.js +1 -0
  129. package/dist/public/assets/{dist-DQ4RxLMf.js → dist-DL8cni8v.js} +1 -1
  130. package/dist/public/assets/{doc-hash-BSK-KaTu.js → doc-hash-Bso39bSh.js} +1 -1
  131. package/dist/public/assets/{documents-events-1HWCdfoh.js → documents-events-CtKncdGv.js} +1 -1
  132. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-d0cDPEQB.js → ebnfDiagram-CCIWWBDH-BjazoYYO.js} +1 -1
  133. package/dist/public/assets/{erDiagram-Q63AITRT-BsZ0tL6Z.js → erDiagram-Q63AITRT-DvgiLWl5.js} +1 -1
  134. package/dist/public/assets/eventmodeling-45OFAUF4-D8s6Yevv.js +1 -0
  135. package/dist/public/assets/{file-tree-adapter-Dw7Dgyj1.js → file-tree-adapter-SJF4yRd-.js} +1 -1
  136. package/dist/public/assets/{file-tree-utils-DiUPuK3N.js → file-tree-utils-llNa05uo.js} +1 -1
  137. package/dist/public/assets/flowDiagram-23GEKE2U-hlKdkNzZ.js +1 -0
  138. package/dist/public/assets/{ganttDiagram-NO4QXBWP-DPxkIh3b.js → ganttDiagram-NO4QXBWP-CJgOU-j1.js} +1 -1
  139. package/dist/public/assets/gitGraph-TEB2WS4Q-B-5iqxxO.js +1 -0
  140. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-vSvxugX5.js → gitGraphDiagram-IHSO6WYX-DYP87cJL.js} +1 -1
  141. package/dist/public/assets/globals-88oPHAs4.css +1 -0
  142. package/dist/public/assets/{globals-CXEWtNVL.js → globals-BzYms-F0.js} +1 -1
  143. package/dist/public/assets/{graphlib-C4UD57Nn.js → graphlib-DYCc0Y9o.js} +1 -1
  144. package/dist/public/assets/{highlighted-body-OFNGDK62-DCKUiY8r.js → highlighted-body-OFNGDK62-C9GzQB8c.js} +1 -1
  145. package/dist/public/assets/index-BVWeqqNi.js +2014 -0
  146. package/dist/public/assets/info-DKCQHKI2-CkzkGEPY.js +1 -0
  147. package/dist/public/assets/{infoDiagram-FWYZ7A6U-Crh0f5aw.js → infoDiagram-FWYZ7A6U-CbZOQ254.js} +1 -1
  148. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-DBJ4jEKk.js → ishikawaDiagram-FXEZZL3T-CUWPHUOP.js} +1 -1
  149. package/dist/public/assets/{journeyDiagram-5HDEW3XC-CUDo0rzP.js → journeyDiagram-5HDEW3XC-RLUp44OU.js} +1 -1
  150. package/dist/public/assets/{kanban-definition-HUTT4EX6-CJD8Oexf.js → kanban-definition-HUTT4EX6-D4TPhDQW.js} +1 -1
  151. package/dist/public/assets/{line-ClsiHw5g.js → line-KTG0S8eM.js} +1 -1
  152. package/dist/public/assets/{linear-BklRBRnp.js → linear-D6fTctUn.js} +1 -1
  153. package/dist/public/assets/lint-config-client-BYECwWuu.js +1 -0
  154. package/dist/public/assets/{map-CMaVsxPf.js → map-Rw6uJqFR.js} +1 -1
  155. package/dist/public/assets/{markdownlint-rule-browser-rS3aDGOb.js → markdownlint-rule-browser-BR80y6ho.js} +1 -1
  156. package/dist/public/assets/mermaid-GHXKKRXX-WtDC9WMV.js +1 -0
  157. package/dist/public/assets/{mermaid-parser.core-D-rj2UdW.js → mermaid-parser.core-CusxBOjy.js} +2 -2
  158. package/dist/public/assets/{mermaid.core-DZGNq3YZ.js → mermaid.core-okCkIUps.js} +3 -3
  159. package/dist/public/assets/{mindmap-definition-LN4V7U3C-Drk1V3-q.js → mindmap-definition-LN4V7U3C-D-eGlMvq.js} +1 -1
  160. package/dist/public/assets/{navigation-targets-Ci2h-vaL.js → navigation-targets-SdStq-nY.js} +1 -1
  161. package/dist/public/assets/{now-Ck_JVNC2.js → now-DRL8tqfF.js} +1 -1
  162. package/dist/public/assets/{open-managed-artifact-tab-DfGutPkc.js → open-managed-artifact-tab-CgQ5akUh.js} +1 -1
  163. package/dist/public/assets/{ordinal-DrDHGs3t.js → ordinal-DnmHW-WD.js} +1 -1
  164. package/dist/public/assets/overlay-layers-y-dNUWSd.js +1 -0
  165. package/dist/public/assets/packet-7NZHBO7P-DDIvLOTX.js +1 -0
  166. package/dist/public/assets/{pegDiagram-2B236MQR-CM3AjMbx.js → pegDiagram-2B236MQR-Bjnm3xCN.js} +1 -1
  167. package/dist/public/assets/{pending-receive-nav-store-BuGLGemz.js → pending-receive-nav-store-DTqMgVXW.js} +1 -1
  168. package/dist/public/assets/pie-RZYD4A2V-DnssmCEa.js +1 -0
  169. package/dist/public/assets/{pieDiagram-ENE6RG2P-D8wIwdwS.js → pieDiagram-ENE6RG2P-BkLpbnFN.js} +1 -1
  170. package/dist/public/assets/{prop-types-B-N3_i3c.js → prop-types-CU-rIGvv.js} +1 -1
  171. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-h2Dtd1uI.js → quadrantDiagram-ABIIQ3AL-eMGNkhp-.js} +1 -1
  172. package/dist/public/assets/radar-I7S5WNFK-0J5y2_MO.js +1 -0
  173. package/dist/public/assets/railroad-3IZDKUUU-BgsONsxl.js +1 -0
  174. package/dist/public/assets/railroad-abnf-AHOZXSZD-BhBo_9j9.js +1 -0
  175. package/dist/public/assets/railroad-ebnf-EBAXGLYW-B5mHA2IL.js +1 -0
  176. package/dist/public/assets/railroad-peg-LSFZ7HO6-BV4uZ4WL.js +1 -0
  177. package/dist/public/assets/{railroadDiagram-RFXS5EU6-CLc68_Sv.js → railroadDiagram-RFXS5EU6-Cs70gdc4.js} +1 -1
  178. package/dist/public/assets/{receive-store-CL0RH8Oa.js → receive-store-C5uRDARd.js} +1 -1
  179. package/dist/public/assets/{requirementDiagram-TGXJPOKE-DtJA-6Zq.js → requirementDiagram-TGXJPOKE-yQhnovOU.js} +1 -1
  180. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-Dw4-_oAZ.js → sankeyDiagram-HTMAVEWB-C7R3anws.js} +1 -1
  181. package/dist/public/assets/{selection-context-zsjvL-8N.js → selection-context-DtzxXWAX.js} +1 -1
  182. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-B4Af8Tp3.js → sequenceDiagram-DBY2YBRQ-CEdbVotz.js} +1 -1
  183. package/dist/public/assets/{sizeCapture-X5ZJPWSS-B7J9pg7l.js → sizeCapture-X5ZJPWSS-DAh96RVo.js} +1 -1
  184. package/dist/public/assets/skill-actions-PBEWDc_3.js +1 -0
  185. package/dist/public/assets/{skills-api-ChYiP1Zv.js → skills-api-Cd3IvPjQ.js} +1 -1
  186. package/dist/public/assets/{src-D9eynQ26.js → src--OxBHrEw.js} +1 -1
  187. package/dist/public/assets/{src-D8jPu2QV.js → src-Dum6a22K.js} +2 -2
  188. package/dist/public/assets/{stateDiagram-2N3HPSRC-L3VR_LMr.js → stateDiagram-2N3HPSRC-q96Dmt4i.js} +1 -1
  189. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-BCNHhMpC.js +1 -0
  190. package/dist/public/assets/{swimlanes-5IMT3BWC-CRfWYpqt.js → swimlanes-5IMT3BWC--g7Ac5Wk.js} +2 -2
  191. package/dist/public/assets/swimlanesDiagram-G3AALYLV-hRuoLGg3.js +8 -0
  192. package/dist/public/assets/{tag-pill-input-B27HgfRy.js → tag-pill-input-CS-2Qx-_.js} +1 -1
  193. package/dist/public/assets/{target-navigation-intent-ClG4AlV8.js → target-navigation-intent-D3w-HLu3.js} +1 -1
  194. package/dist/public/assets/{telemetry-impl-DXiL3sBk.js → telemetry-impl-Z8PmW_aL.js} +2 -2
  195. package/dist/public/assets/{telemetry-startup-Db44p95P.js → telemetry-startup-Cy7C8oSF.js} +1 -1
  196. package/dist/public/assets/{terminal-launch-events-N4CMVbPT.js → terminal-launch-events-CTVJjVZG.js} +1 -1
  197. package/dist/public/assets/{terminal-telemetry-DxTZB2oZ.js → terminal-telemetry-pdIn1zDv.js} +1 -1
  198. package/dist/public/assets/thread-client-C0O75Kza.js +1 -0
  199. package/dist/public/assets/{timeline-definition-FHXFAJF6-C1Qc7Dba.js → timeline-definition-FHXFAJF6-DqrkK_6w.js} +1 -1
  200. package/dist/public/assets/treeView-QDETBFTQ-N2YNex2I.js +1 -0
  201. package/dist/public/assets/treemap-6X3UGDF4-DkzYKeau.js +1 -0
  202. package/dist/public/assets/{typing-burst-detector-BP7d86JP.js → typing-burst-detector-BEbZgL9-.js} +2 -2
  203. package/dist/public/assets/{uninstall-DHjtqCbn.js → uninstall-BpVYvA3J.js} +1 -1
  204. package/dist/public/assets/use-activity-panel-B8RDBgok.js +1 -0
  205. package/dist/public/assets/use-apply-config-color-theme-A0jx7vnI.js +2 -0
  206. package/dist/public/assets/{use-collab-url-D0INpn_f.js → use-collab-url-bpUtly6S.js} +1 -1
  207. package/dist/public/assets/{use-live-xterm-theme-C-fHLeXw.js → use-live-xterm-theme-w8QeNUlq.js} +1 -1
  208. package/dist/public/assets/{use-settings-route-CXFzIfYo.js → use-settings-route-CFvCFlXS.js} +1 -1
  209. package/dist/public/assets/{use-terminal-enabled-fhwpyN81.js → use-terminal-enabled-CuFAAh8J.js} +1 -1
  210. package/dist/public/assets/use-timeline-entry-diff-DlW9hmrR.js +6 -0
  211. package/dist/public/assets/{use-workspace-3T40FR83.js → use-workspace-CNWEPWim.js} +1 -1
  212. package/dist/public/assets/{vennDiagram-L72KCM5P-C4cNDPVl.js → vennDiagram-L72KCM5P-DFSXk11G.js} +1 -1
  213. package/dist/public/assets/wardley-OPB4EBWU-OOiOMSoP.js +1 -0
  214. package/dist/public/assets/{wardleyDiagram-EHGQE667-B2UY3KQf.js → wardleyDiagram-EHGQE667-Bw65HviB.js} +1 -1
  215. package/dist/public/assets/{workspace-paths-B-NChZS2.js → workspace-paths-DQOJHVhV.js} +1 -1
  216. package/dist/public/assets/{xychartDiagram-FW5EYKEG-CMsrwnL2.js → xychartDiagram-FW5EYKEG-CEVfZ0d5.js} +1 -1
  217. package/dist/public/index.html +55 -53
  218. package/dist/public/uninstall.html +5 -5
  219. package/dist/{repair-launch-json-CyiLC6sz.mjs → repair-launch-json-_2TGq22B.mjs} +2 -2
  220. package/dist/{repair-mcp-configs-MZhuDeWK.mjs → repair-mcp-configs-Cf6t84yK.mjs} +2 -2
  221. package/dist/repair-skills-CtpTVpw_.mjs +1 -0
  222. package/dist/{repair-skills-CBmnNSO7.mjs → repair-skills-DwQqF8O8.mjs} +2 -2
  223. package/dist/schemas/v0/config.project.schema.json +154 -0
  224. package/dist/server-lock-CZMSbPZ0.mjs +1 -0
  225. package/dist/{server-lock-vdpThyb4.mjs → server-lock-DpWXnrNF.mjs} +2 -2
  226. package/dist/{sleep-B2L0pvp4.mjs → sleep-DTzPXGtM.mjs} +5 -5
  227. package/dist/src-BFcAqZ_V.mjs +1 -0
  228. package/dist/src-BkP5u3RK.mjs +3269 -0
  229. package/dist/{src-DtcKZLt0.mjs → src-DY417osM.mjs} +120 -116
  230. package/dist/src-JZ7OJ1TB.mjs +20 -0
  231. package/dist/start-0twfe-vW.mjs +1 -0
  232. package/dist/{start-BRjY-38U.mjs → start-BcTJLNem.mjs} +2 -2
  233. package/dist/{write-project-skill-B_HecSEZ.mjs → write-project-skill-cxdqSDsT.mjs} +4 -4
  234. package/package.json +5 -5
  235. package/dist/build-L3kflBeC.mjs +0 -1
  236. package/dist/constants-DafFdWJR.mjs +0 -2
  237. package/dist/fs-traced-BpCA6YXG.mjs +0 -1
  238. package/dist/git-handle-CRnnMEIm.mjs +0 -1
  239. package/dist/init-CY3jgzP0.mjs +0 -1
  240. package/dist/loader-BjQNNJAX.mjs +0 -1
  241. package/dist/md-manager-CAqfesEA.mjs +0 -2
  242. package/dist/preview-BMVXzzrS.mjs +0 -1
  243. package/dist/public/assets/ActivityModeContent-CnhDNi-c.js +0 -1
  244. package/dist/public/assets/AgentDiffPane-BKvov9S5.js +0 -2
  245. package/dist/public/assets/CodeMirrorPropInput-ZGACWLSy.js +0 -3
  246. package/dist/public/assets/DocumentContext-DDkluS7D.js +0 -38
  247. package/dist/public/assets/FeedbackForm-DuEQbMOb.js +0 -1
  248. package/dist/public/assets/GraphPanel-1CKwHElx.js +0 -44
  249. package/dist/public/assets/ManagedArtifactProperties-9e_jj3hZ.js +0 -1
  250. package/dist/public/assets/MermaidDocEditor-BNURUYJE.js +0 -1
  251. package/dist/public/assets/PropertyPanel-BMIcO_AS.js +0 -2
  252. package/dist/public/assets/ReportBugDialogBody-ByMe7BRT.js +0 -2
  253. package/dist/public/assets/SettingsDialogBody-Bkz3Bpgp.js +0 -7
  254. package/dist/public/assets/SourceEditor-DI6JkRTr.js +0 -1
  255. package/dist/public/assets/TerminalSessionsHost-B2cWbpj-.js +0 -2
  256. package/dist/public/assets/ThreadView-D2BFrI_O.js +0 -6
  257. package/dist/public/assets/TimelineDiffPane-B9KqEt7q.js +0 -2
  258. package/dist/public/assets/architecture-TIHT7OUA-D0qm7G-3.js +0 -1
  259. package/dist/public/assets/auth-state-cache-BUVYaS5m.js +0 -11
  260. package/dist/public/assets/channel-DA_5WVVG.js +0 -1
  261. package/dist/public/assets/chunk-2Q5K7J3B-CZvundFv.js +0 -1
  262. package/dist/public/assets/chunk-VAUOI2AC-CzpwkaIj.js +0 -1
  263. package/dist/public/assets/chunk-XXDRQBXY-aujsIsPx.js +0 -1
  264. package/dist/public/assets/classDiagram-OUVF2IWQ-DaJYvXbz.js +0 -1
  265. package/dist/public/assets/classDiagram-v2-EOCWNBFH-naGS_xxO.js +0 -1
  266. package/dist/public/assets/client-version-FVbajnsJ.js +0 -1
  267. package/dist/public/assets/cynefin-VYW2F7L2-BIoIBt-C.js +0 -1
  268. package/dist/public/assets/dist-B1qkpf98.js +0 -2
  269. package/dist/public/assets/eventmodeling-45OFAUF4-DJJWSxES.js +0 -1
  270. package/dist/public/assets/flowDiagram-23GEKE2U-BDvIWhMq.js +0 -1
  271. package/dist/public/assets/gitGraph-TEB2WS4Q-DbaUaLPe.js +0 -1
  272. package/dist/public/assets/globals-GYHxaktb.css +0 -1
  273. package/dist/public/assets/index-Bh6-_Nba.js +0 -2014
  274. package/dist/public/assets/info-DKCQHKI2-t_ReTPP2.js +0 -1
  275. package/dist/public/assets/lint-config-client-G_mrikOJ.js +0 -1
  276. package/dist/public/assets/mermaid-GHXKKRXX-Cj1_l2m9.js +0 -1
  277. package/dist/public/assets/packet-7NZHBO7P-DvVA7lgt.js +0 -1
  278. package/dist/public/assets/pie-RZYD4A2V-THg35hJ6.js +0 -1
  279. package/dist/public/assets/radar-I7S5WNFK-Cnae5YqF.js +0 -1
  280. package/dist/public/assets/railroad-3IZDKUUU-z19uKrUP.js +0 -1
  281. package/dist/public/assets/railroad-abnf-AHOZXSZD-BUg9AO49.js +0 -1
  282. package/dist/public/assets/railroad-ebnf-EBAXGLYW-DuBtfJ_K.js +0 -1
  283. package/dist/public/assets/railroad-peg-LSFZ7HO6-BSfcErEJ.js +0 -1
  284. package/dist/public/assets/skill-actions-C_5-d4BC.js +0 -1
  285. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-DM5o7mT7.js +0 -1
  286. package/dist/public/assets/swimlanesDiagram-G3AALYLV-BTrTvdTh.js +0 -8
  287. package/dist/public/assets/thread-client-CurKSSA8.js +0 -1
  288. package/dist/public/assets/treeView-QDETBFTQ-nC4bzLZB.js +0 -1
  289. package/dist/public/assets/treemap-6X3UGDF4-D1MGcMAJ.js +0 -1
  290. package/dist/public/assets/use-activity-panel-35_3901z.js +0 -1
  291. package/dist/public/assets/use-apply-config-color-theme-CK97Jvup.js +0 -2
  292. package/dist/public/assets/use-timeline-entry-diff-CHWJnnz2.js +0 -6
  293. package/dist/public/assets/wardley-OPB4EBWU-Dt2lEMaH.js +0 -1
  294. package/dist/repair-skills-B1Zc-g_X.mjs +0 -1
  295. package/dist/server-lock-DKRUWCqU.mjs +0 -1
  296. package/dist/src--Oy-0xgD.mjs +0 -22
  297. package/dist/src-mOlBaMpr.mjs +0 -3267
  298. package/dist/src-o9XsfdYT.mjs +0 -1
  299. package/dist/start-BnM87E8e.mjs +0 -1
  300. /package/dist/public/assets/{ActivityPanelDiffView-CSOgz1F9.js → ActivityPanelDiffView-B03Wzvap.js} +0 -0
  301. /package/dist/public/assets/{AppMenubar-CXadCCMc.js → AppMenubar-Bisp0k8X.js} +0 -0
  302. /package/dist/public/assets/{BugReportHistoryDialog-B5Yf5rAM.js → BugReportHistoryDialog-Bp4PHyEI.js} +0 -0
  303. /package/dist/public/assets/{__vite-browser-external-T_MG5_bv.js → __vite-browser-external-BckCY-VI.js} +0 -0
  304. /package/dist/public/assets/{agent-presence-CTJkQnoU.js → agent-presence-CEfNcJUY.js} +0 -0
  305. /package/dist/public/assets/{array-BAI_NyvG.js → array-D9gZmznT.js} +0 -0
  306. /package/dist/public/assets/{chunk-KEIR6QF5-BSqm2tNO.js → chunk-KEIR6QF5-zkgbDrf9.js} +0 -0
  307. /package/dist/public/assets/{chunk-Y2CYZVJY-BCLrJxO_.js → chunk-Y2CYZVJY-BAUBUeAF.js} +0 -0
  308. /package/dist/public/assets/{clike-CkWR_Slw.js → clike-ccBqxK3t.js} +0 -0
  309. /package/dist/public/assets/{clipboard-adapter--Ja4oXEM.js → clipboard-adapter-Cxzkvc1d.js} +0 -0
  310. /package/dist/public/assets/{colors-C1oQkVlI.js → colors-BZ7r12jC.js} +0 -0
  311. /package/dist/public/assets/{copilot-BAzfPGty.js → copilot-CjOGWDvv.js} +0 -0
  312. /package/dist/public/assets/{cursor-C1n4GZG0.js → cursor-B8rehP9c.js} +0 -0
  313. /package/dist/public/assets/{cytoscape.esm-ewu4kfMU.js → cytoscape.esm-GtliGICm.js} +0 -0
  314. /package/dist/public/assets/{defaultLocale-C0VJf-tm.js → defaultLocale-CqKPYlUZ.js} +0 -0
  315. /package/dist/public/assets/{diff-BsdYbIgD.js → diff-oW0nWZgn.js} +0 -0
  316. /package/dist/public/assets/{dist-DDqBNQiG.js → dist-B1Jbz0yl.js} +0 -0
  317. /package/dist/public/assets/{dist-d-7NE8aL.js → dist-Cqbn6bM9.js} +0 -0
  318. /package/dist/public/assets/{dist-BF6U-ayK.js → dist-D1zECWv_.js} +0 -0
  319. /package/dist/public/assets/{dist-BocybIB-.js → dist-zCmaEyrL.js} +0 -0
  320. /package/dist/public/assets/{follow-file-DBnmqlyk.js → follow-file-BghdVu5J.js} +0 -0
  321. /package/dist/public/assets/{form-D-z6QdLf.js → form-coxG-8Qw.js} +0 -0
  322. /package/dist/public/assets/{format-BVhfvqw3.js → format-CejNFduS.js} +0 -0
  323. /package/dist/public/assets/{go-D-ZJPtwk.js → go-CCS4kWKN.js} +0 -0
  324. /package/dist/public/assets/{init-BX0_4ZBD.js → init-CMTNTj66.js} +0 -0
  325. /package/dist/public/assets/{isObject-BkQ5hIlp.js → isObject-Ho9jn-6g.js} +0 -0
  326. /package/dist/public/assets/{libesm-CHqp8owk.js → libesm-Db-3Gx3Z.js} +0 -0
  327. /package/dist/public/assets/{lint-plugin-meta-B3N1DKgL.js → lint-plugin-meta-J-wb-uxW.js} +0 -0
  328. /package/dist/public/assets/{lru-string-cache-hwDoWobi.js → lru-string-cache-BZxOuxTi.js} +0 -0
  329. /package/dist/public/assets/{lua-Cx3bDzQk.js → lua-DgAwqJ0D.js} +0 -0
  330. /package/dist/public/assets/{mcp-consent-store-Xk9UA_MB.js → mcp-consent-store-wvrClpLC.js} +0 -0
  331. /package/dist/public/assets/{min-Bd9Lorof.js → min-BQPeeNfF.js} +0 -0
  332. /package/dist/public/assets/{panel-Cyobla0Z.js → panel-C8ZhM4q-.js} +0 -0
  333. /package/dist/public/assets/{panzoom.es-B9Lp3OVt.js → panzoom.es-CxTS7ZPP.js} +0 -0
  334. /package/dist/public/assets/{path-C1_RvjGX.js → path-DoEWlp6O.js} +0 -0
  335. /package/dist/public/assets/{pdf-B7Y_z-D1.js → pdf-Da_O_GF5.js} +0 -0
  336. /package/dist/public/assets/{pdf.worker-B6TdDPWM.js → pdf.worker-Pbs_-93C.js} +0 -0
  337. /package/dist/public/assets/{perl-CV3dlsd7.js → perl-DMwerdcj.js} +0 -0
  338. /package/dist/public/assets/{properties-D1GaCcfv.js → properties-Du1Kuwqc.js} +0 -0
  339. /package/dist/public/assets/{r-CHRF940O.js → r-wSvpRg5h.js} +0 -0
  340. /package/dist/public/assets/{rough.esm-B1nzhEZO.js → rough.esm-esi5HKC4.js} +0 -0
  341. /package/dist/public/assets/{ruby-YzQuyklS.js → ruby-DuM6hMQW.js} +0 -0
  342. /package/dist/public/assets/{schema-fields-view-intent-Dz1ZzVCe.js → schema-fields-view-intent-BeD8vY0v.js} +0 -0
  343. /package/dist/public/assets/{share-metadata-rows-BlaR96La.js → share-metadata-rows-CbXHISQ4.js} +0 -0
  344. /package/dist/public/assets/{shell-BvVJAeXE.js → shell-BZ7mgeL0.js} +0 -0
  345. /package/dist/public/assets/{skeleton-HLkcMp95.js → skeleton-BG12Hmzn.js} +0 -0
  346. /package/dist/public/assets/{sortable.esm-B6whf_t-.js → sortable.esm-C565D25d.js} +0 -0
  347. /package/dist/public/assets/{sql-CECtKdDi.js → sql-BXdRuz6d.js} +0 -0
  348. /package/dist/public/assets/{src-BaTc8y5c.js → src-DNE52RZP.js} +0 -0
  349. /package/dist/public/assets/{swift-DLct3DJs.js → swift-DZwxTp-L.js} +0 -0
  350. /package/dist/public/assets/{textarea-RSYJwPz9.js → textarea-tdCJViKf.js} +0 -0
  351. /package/dist/public/assets/{thread-draft-staging-B4_1TigQ.js → thread-draft-staging-BuvCYJwg.js} +0 -0
  352. /package/dist/public/assets/{toml-Bl-Vp4wG.js → toml-C5KR4pi6.js} +0 -0
  353. /package/dist/public/assets/{use-installed-clis-B_nDAq7A.js → use-installed-clis-UlK7P1aH.js} +0 -0
  354. /package/dist/public/assets/{useLintConfigViewMode-BYm6FwC5.js → useLintConfigViewMode-DKPENttR.js} +0 -0
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-BIQX33UG-CwPTWPTQ.js";export{e as createInfoServices};
@@ -1 +0,0 @@
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{$ as r,Q as i,V as a}from"./dist-Cal4LUep.js";var o=n(),s=e(t(),1),c=`open-knowledge:lint-config-changed`;function l(){window.dispatchEvent(new CustomEvent(c))}function u(e){let t=()=>e();return window.addEventListener(c,t),()=>window.removeEventListener(c,t)}async function d(e){try{let t=e===void 0?``:`?doc=${encodeURIComponent(e)}`,n=await fetch(`/api/lint/config${t}`);if(!n.ok)return null;let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?a.data:(console.warn(`[lint] lint-config response failed schema validation`,a.error.issues),null)}catch{return null}}async function f(e){return(await d(e))?.effective??null}async function p(e){try{let t=await fetch(`/api/lint/fix`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({docName:e})});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=await t.json().catch(()=>null),i=r.safeParse(n);return i.success?{ok:!0,result:i.data}:(console.warn(`[lint] fix response failed schema validation`,i.error.issues),{ok:!1,errorDetail:null})}catch{return{ok:!1,errorDetail:null}}}async function m(e,t){try{let n=await fetch(`/api/lint/markdownlint-config`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ruleId:e,value:t})});if(!n.ok){let e=await n.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let r=await n.json().catch(()=>null),a=i.safeParse(r);return a.success?{ok:!0,response:a.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}async function h(e){try{let t=await fetch(`/api/lint/frontmatter-schema`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>null);return{ok:!1,errorDetail:typeof e?.title==`string`?e.title:null}}let n=i.safeParse(await t.json().catch(()=>null));return n.success?{ok:!0,response:n.data}:{ok:!1,errorDetail:null}}catch{return{ok:!1,errorDetail:null}}}function g(e){return e.length>0?e:void 0}async function _(e,t,n,r=[]){return h({file:e,field:t,constraint:n,parentPath:g(r)})}async function v(){try{let e=await fetch(`/api/lint/frontmatter-schemas`);if(!e.ok)return[];let t=await e.json().catch(()=>null),n=a.safeParse(t);return n.success?n.data.schemas:(console.warn(`[lint] frontmatter-schemas response failed schema validation`,n.error.issues),[])}catch{return[]}}async function y(e){let t=await h({file:e});return t.ok&&l(),t}async function b(e,t,n=[]){return h({file:e,field:t,removeField:!0,parentPath:g(n)})}async function x(e,t,n,r=[]){return h({file:e,field:t,renameTo:n,parentPath:g(r)})}async function S(e){let t=await h({file:e,delete:!0});return t.ok&&l(),t}function C(){let e=(0,o.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0];let[n,r]=(0,s.useState)(t),i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{v().then(r)},e[1]=i):i=e[1];let a=i,c,l;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1,t=()=>{v().then(t=>{e||r(t)})};t();let n=u(t);return()=>{e=!0,n()}},l=[],e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,s.useEffect)(c,l);let d;return e[4]===n?d=e[5]:(d={schemas:n,refresh:a},e[4]=n,e[5]=d),d}function w(e){let t=(0,o.c)(5),[n,r]=(0,s.useState)(null),i,a;t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(null);return}let t=!1,n=()=>{d(e).then(e=>{t||r(e)})};n();let i=u(n);return()=>{t=!0,i()}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,s.useEffect)(i,a);let c;return t[3]===n?c=t[4]:(c={data:n},t[3]=n,t[4]=c),c}function T(){let e=(0,o.c)(4),[t,n]=(0,s.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=!1,t=()=>{d().then(t=>{e||n(t)})};t();let r=u(t);return()=>{e=!0,r()}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,s.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={data:t},e[2]=t,e[3]=a),a}export{p as a,u as c,T as d,_ as f,f as i,w as l,S as n,b as o,m as p,l as r,x as s,y as t,C as u};
@@ -1 +0,0 @@
1
- import{a as e}from"./chunk-BO2N2NFS-BTXsfKML.js";export{e as Mermaid};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-EMLP6XTP-_x7IkQoS.js";export{e as createPacketServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-YOTPTUD7-BDIMzFfd.js";export{e as createPieServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-QBLGF6JB-BiU9LEk8.js";export{e as createRadarServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-5TONJI2A-QaNyDyr1.js";export{e as createRailroadServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-5HE753X5-Canmf8DQ.js";export{e as createRailroadAbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-U6XO7XAA-2Ds3FX_A.js";export{e as createRailroadEbnfServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-JG7HCLWE-BIqqOtX1.js";export{e as createRailroadPegServices};
@@ -1 +0,0 @@
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"./createLucideIcon-DAkhoPjT.js";import{t as s}from"./button-Gol9BgNB.js";import{a as c,c as l,i as u,n as d,o as f,r as p,s as m,t as h}from"./dialog-TkFkuYVg.js";import{a as g,d as _,f as v,i as y,o as b,p as x,u as S}from"./dropdown-menu-xw8WTdb-.js";import{t as C}from"./label-DyipnO5I.js";import{C as w,a as T,f as E,h as D,m as O,n as k,o as A,p as j,r as M,s as N,t as P}from"./agent-visibility-HpfSUFqP.js";import{Cn as F,Dt as I,It as L,P as R,Rt as z,Sn as B,Tn as V,Xt as H,_n as U,bn as W,fi as G,gn as K,in as q,ot as J,rn as ee,st as te,tn as Y,vn as ne,wn as re,yn as ie,zt as ae}from"./dist-Cal4LUep.js";import{t as oe}from"./RegisteredAgentIcon-8Tcfr3WP.js";import{a as se,d as ce,l as le,n as ue,r as de,t as fe,u as pe}from"./workspace-paths-B-NChZS2.js";import{t as me}from"./copy-9EDFYcyR.js";import{t as he}from"./folder-open-wLd69QUc.js";import{t as ge}from"./loader-circle-Cg5SU7AZ.js";import{t as _e}from"./refresh-cw-BfeWGCsv.js";import{t as ve}from"./sliders-horizontal-34K0eDW2.js";import{t as ye}from"./trash-2-BUuL4OCw.js";import{n as X}from"./dist-BLAMau9Z.js";import{t as be}from"./input-D0ZW0Opq.js";import{t as xe}from"./dist-q14fBS3T.js";import{i as Se}from"./use-settings-route-CXFzIfYo.js";import{t as Ce}from"./parse-api-error-C_gwkKmG.js";import{c as we,l as Te}from"./documents-events-1HWCdfoh.js";import{n as Ee}from"./config-context-gd3BC-iY.js";import{t as De}from"./use-workspace-3T40FR83.js";import{n as Oe}from"./clipboard-adapter--Ja4oXEM.js";import{a as ke,d as Ae,f as je,n as Me,s as Ne,t as Pe}from"./skills-api-ChYiP1Zv.js";var Fe=o(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),Ie=o(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]),Le=o(`pencil-line`,[[`path`,{d:`M13 21h8`,key:`1jsn5i`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),Re=o(`power-off`,[[`path`,{d:`M18.36 6.64A9 9 0 0 1 20.77 15`,key:`dxknvb`}],[`path`,{d:`M6.16 6.16a9 9 0 1 0 12.68 12.68`,key:`1x7qb5`}],[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Z=t(),Q=e(n(),1),$=a();function ze(e){return{async install(t){let n;try{n=await e.buildAndOpen(t?.force?{force:!0}:void 0)}catch(e){return{ok:!1,reason:`bridge-error`,message:e instanceof Error?e.message:String(e)}}return n.ok?{ok:!0,path:n.path}:{ok:!1,reason:n.reason,message:n.message}}}}function Be(e={}){let t=e.fetch??globalThis.fetch,n=`${e.apiOrigin??``}/api/install-skill`;return{async install(e){let r;try{r=await t(n,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e?.force?{force:!0}:{})})}catch(e){return{ok:!1,reason:`network-error`,message:e instanceof Error?e.message:String(e)}}if(!r.ok){let e=`HTTP ${r.status}`;try{let t=Ce(await r.json());t&&(e=t)}catch{}return{ok:!1,reason:`http-error`,message:e}}let i;try{i=await r.json()}catch(e){return{ok:!1,reason:`parse-error`,message:e instanceof Error?e.message:`Invalid server response`}}return!i||typeof i.status!=`string`?{ok:!1,reason:`parse-error`,message:`Invalid server response shape`}:i.status===`failed`?{ok:!1,reason:`build-failed`,message:i.buildError??`unknown build failure`}:{ok:!0,path:i.outputPath,handoffWarning:i.handoffError?.message}}}}function Ve(){if(typeof window>`u`)return null;let e=window.okDesktop?.skill;return e?ze(e):Be()}var He=`ok:skill:cowork:installed`,Ue=`1`,We=250,Ge=`/api/skill/install-state`;function Ke(e){return`${He}:v${e}`}var qe=new Map;async function Je(e={},t={}){let n=t.force?`__force__`:`__default__`,r=qe.get(n);if(r)return r;let i=Ye(e,t);return qe.set(n,i),i.finally(()=>{qe.get(n)===i&&qe.delete(n)}),i}async function Ye(e,t){let n=e.installer===void 0?Ve():e.installer,r=Xe(e.storage),i=e.fetchSnapshot??Qe,a=e.serverTimeoutMs??We,o=null;if(!t.force){try{o=await $e(i(),a)}catch(e){console.warn(`[cowork-skill] server install-state check failed; falling through:`,e)}if(o){let e=o.targets[`claude-cowork`]??null;if(e&&e.version===o.currentVersion)return{kind:`already-installed`,source:`server`}}}let s=Ke(o?.currentVersion??e.fallbackSkillVersion??Ze());if(!t.force&&r?.getItem(s)===Ue)return{kind:`already-installed`,source:`local`};if(!n)return{kind:`host-unsupported`};let c=await n.install({force:t.force??!1});if(!c.ok)return{kind:`install-failed`,reason:c.reason,message:c.message};try{r?.setItem(s,Ue)}catch(e){console.warn(`[cowork-skill] storage.setItem failed (guard will not persist):`,e)}return{kind:`installed-now`,path:c.path,handoffWarning:c.handoffWarning}}function Xe(e){if(e!==void 0)return e;if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}function Ze(){return typeof window>`u`?`unknown`:window.okDesktop?.appVersion??`unknown`}async function Qe(){let e;try{e=await fetch(Ge,{method:`GET`,cache:`no-store`})}catch{return null}if(!e.ok)return null;try{let t=await e.json();return typeof t?.currentVersion==`string`?t:null}catch{return null}}async function $e(e,t){return Promise.race([e,new Promise(e=>{setTimeout(()=>e(null),t)})])}function et(e){return Je({},e)}function tt(){return Je({},{force:!0})}async function nt(e,t){let n;try{n=await t(`/api/handoff`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)})}catch(e){return{ok:!1,reason:`dispatch-error`,detail:e instanceof Error?e.message:String(e)}}return n.status===200?{ok:!0}:n.status===404?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned 404`}:n.status===422?{ok:!1,reason:`not-installed`,detail:`POST /api/handoff returned ${n.status}`}:{ok:!1,reason:`dispatch-error`,detail:`POST /api/handoff returned ${n.status}`}}async function rt(e,t={}){let n=t.fetch??globalThis.fetch.bind(globalThis);switch(e.target){case`claude-cowork`:return nt({target:`claude-cowork`,url:Y({mode:`cowork`},e)},n);case`claude-code`:return nt({target:`claude-code`,url:Y({mode:`code`},e)},n);case`codex`:return nt({target:`codex`,url:ee(e)},n);case`cursor`:return nt({target:`cursor`,url:q(e),workspacePath:e.projectDir},n);case`copilot`:return{ok:!1,reason:`invalid-payload`,detail:`copilot is terminal-only; launch via requestTerminalLaunch`};case`opencode`:return{ok:!1,reason:`invalid-payload`,detail:`opencode is terminal-only; launch via requestTerminalLaunch`};case`pi`:return{ok:!1,reason:`invalid-payload`,detail:`pi is terminal-only; launch via requestTerminalLaunch`};case`antigravity`:return{ok:!1,reason:`invalid-payload`,detail:`antigravity is terminal-only; launch via requestTerminalLaunch`};case`openclaw`:return{ok:!1,reason:`invalid-payload`,detail:`openclaw is terminal-only; launch via requestTerminalLaunch`};case`hermes`:return{ok:!1,reason:`invalid-payload`,detail:`hermes is terminal-only; launch via requestTerminalLaunch`};default:{let t=e.target;return{ok:!1,reason:`invalid-payload`,detail:`unknown target: ${String(t)}`}}}}async function it(e,t={}){let n=t.okDesktop??(typeof window<`u`?window.okDesktop:void 0);if(n?.shell?.recordHandoff)try{await n.shell.recordHandoff(e)}catch(e){(t.warn??(e=>console.warn(e)))(`[handoff] recordHandoff IPC rejected (telemetry skipped): ${e instanceof Error?e.message:String(e)}`)}}var at=`open-knowledge:agent-thread-launch`;function ot(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(at,{detail:e}))}function st(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.agentId==`string`&&e(n)};return t.addEventListener(at,n),()=>t.removeEventListener(at,n)}function ct(e){if(!e.docName||!e.workspace)return null;let t=fe(e.docName),{contentDir:n,pathSeparator:r}=e.workspace;return{docContext:{relativePath:t},projectDir:n,docPath:ue(n,t,r)}}function lt(e){return e.workspace?.contentDir?{docContext:null,projectDir:e.workspace.contentDir,docPath:``}:null}function ut(e){return e.workspace?.contentDir?{docContext:null,createDescription:e.description,createScenario:e.scenario,createMentions:e.mentions,projectDir:e.workspace.contentDir,docPath:``}:null}function dt(e){return j(e.installUrl).then(()=>void 0)}function ft(e){return!e.workspace?.contentDir||!e.folderRelativePath?null:{docContext:null,folderRelativePath:e.folderRelativePath,projectDir:e.workspace.contentDir,docPath:``}}function pt(e){return!e.workspace?.contentDir||!e.skillName?null:{docContext:null,skill:{name:e.skillName,scope:e.scope},projectDir:e.workspace.contentDir,docPath:``}}function mt(e){if(!e.workspace?.contentDir)return null;let{contentDir:t,pathSeparator:n}=e.workspace;if(e.docName){let r=e.docRelativePath??fe(e.docName),i={scope:`doc`,docRelativePath:r,instruction:e.instruction,mentions:e.mentions};return{docContext:null,compose:e.selection===void 0?i:{...i,selection:e.selection},projectDir:t,docPath:ue(t,r,n)}}return e.folderRelativePath?{docContext:null,compose:{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}:{docContext:null,compose:{scope:`project`,instruction:e.instruction,mentions:e.mentions},projectDir:t,docPath:``}}function ht(e){return`Opened in ${e}.`}function gt(e,t=1){return t>=3?`Couldn't reach ${e} — please try again later.`:t===2?`Still couldn't reach ${e} — try one more time?`:`Couldn't reach ${e} — try again?`}function _t(e){return e>=3?null:e===2?`Try one more time`:`Retry`}function vt(e,t,n,r,i){let a=i===void 0?{}:{scope:i};return t.ok?{target:e,host:n,outcome:`ok`,ts:r,...a}:{target:e,host:n,outcome:`error`,ts:r,reason:t.reason,...a}}function yt(e,t,n,r){if(e.scope===`doc`){let i={scope:`doc`,docRelativePath:e.docRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r};return e.selection===void 0?i:{...i,selection:e.selection}}return e.scope===`folder`?{scope:`folder`,folderRelativePath:e.folderRelativePath,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}:{scope:`project`,instruction:e.instruction,mentions:e.mentions,target:t,autoOpen:n,transport:r}}function bt(e,t,n,r){return e.compose?H(yt(e.compose,t,n,r)):e.selection?B({...e.selection,target:t,transport:r}):e.skill?F(e.skill.name,e.skill.scope,n):e.ask?K(e.ask.relativePath,e.ask.instruction,n,t,r):G(e.docContext===null?e.folderRelativePath?W(e.folderRelativePath,n,e.instruction,r):e.createDescription===void 0?ne(n,e.instruction,r):U(e.createDescription,n,e.createScenario??`new-project`,e.createMentions??[],r):ie(e.docContext.relativePath,n,e.instruction,r))}function xt(e,t){let n=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||n?`${J} ${bt(e,z[t].handoffTarget,!1,`terminal`)}`:re(e.docContext?.relativePath??null)}function St(e){let t=typeof e.instruction==`string`&&e.instruction.trim()!==``;return e.compose!==void 0||e.createDescription!==void 0||t?`${te} ${bt(e,`claude-code`,!1,`terminal`)}`:V(e.docContext?.relativePath??null)}function Ct(e){let t=e.docContext?.relativePath;return typeof t!=`string`||t===``?null:t.replace(/\.(md|mdx)$/,``)}function wt(e){let t=[e.compose?.instruction,e.selection?.instruction,e.ask?.instruction,e.createDescription,e.instruction];for(let e of t)if(typeof e==`string`&&e.trim()!==``)return e;return null}function Tt(e,t){ot({agentSource:t?.agent?.source??`registry`,agentId:t?.agent?.id??``,prompt:St(e),docName:Ct(e),titleHint:wt(e)})}async function Et(e,t,n,r=1){if(e===`claude-cowork`&&r===1){let e;try{e=await n.ensureCoworkSkillInstalled()}catch(e){let t=e instanceof Error?e.message:String(e);return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-error: ${t}`}}if(e.kind===`installed-now`)return n.toast.success(`OpenKnowledge skill saved. Upload it in Claude Desktop, then click Cowork again.`),{ok:!0};if(e.kind===`install-failed`){let t=e.message??e.reason;return n.toast.error(`Couldn't install OpenKnowledge skill — ${t}`),{ok:!1,reason:`dispatch-error`,detail:`install-failed: ${t}`}}}let i={target:e,projectDir:t.projectDir,docPath:t.docPath,prompt:bt(t,e,n.autoOpen,`url`)},a=await n.dispatchHandoff(i),o=n.isElectronHost()?`electron`:`web`,s=n.now().toISOString(),c=t.compose,l=vt(e,a,o,s,t.selection!=null||c?.scope===`doc`&&c.selection!==void 0?`selection`:void 0);await n.recordHandoff(l);let u=n.getDisplayName(e);if(a.ok)n.toast.success(ht(u));else{let i=_t(r),a=gt(u,r);i===null?n.toast.error(a):n.toast.error(a,{action:{label:i,onClick:()=>{Et(e,t,n,r+1)}}})}return a}function Dt(e){return O.find(t=>t.id===e)?.displayName??e}function Ot(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function kt(){return{dispatchHandoff:rt,recordHandoff:it,toast:{success:e=>{X.success(e)},error:(e,t)=>{X.error(e,t?{action:t.action}:void 0)}},now:()=>new Date,isElectronHost:()=>Ot(),getDisplayName:Dt,ensureCoworkSkillInstalled:et,autoOpen:!0}}function At(){let e=(0,$.c)(2),{merged:t}=Ee(),n=t?.appearance?.preview?.autoOpen??!0,r;return e[0]===n?r=e[1]:(r={dispatch:(e,t)=>Et(e,t,{...kt(),autoOpen:n}),reinstallCoworkSkill:tt},e[0]=n,e[1]=r),r}var jt=[...new Set(O.flatMap(e=>e.schemes))];function Mt(e,t){let n=t.now?.()??Date.now(),r={};for(let t of O){let i=t.schemes[0],a=i===void 0?void 0:e[i];if(!a){r[t.id]={installed:null};continue}r[t.id]={installed:a.installed,...a.displayName===void 0?{}:{displayName:a.displayName},lastChecked:n}}return r}function Nt(e){return Mt({},e)}async function Pt(e){let t=e.schemes??jt,n=await Promise.all(t.map(async t=>{let n=t.replace(/:$/,``);try{return[t,await e.detectProtocol(n)]}catch{return[t,{installed:!1}]}}));return Object.fromEntries(n)}var Ft=Object.fromEntries(jt.map(e=>[e,{installed:!1}]));async function It(e){let t;try{t=await e.fetch(`/api/installed-agents`,{signal:e.signal,headers:{Accept:`application/json`}})}catch(e){if(e.name===`AbortError`)throw e;return Ft}if(!t.ok)return Ft;let n;try{n=await t.json()}catch{return Ft}if(typeof n!=`object`||!n||Array.isArray(n))return Ft;let r=n,i={};for(let e of jt)i[e]={installed:r[e.replace(/:$/,``)]===!0};return i}function Lt(e,t){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n){let n=e[r],i=t[r];if(!n||!i||n.installed!==i.installed||n.displayName!==i.displayName)return!1}return!0}function Rt(e){let t=e.throttleMs??1e4,n=!1,r=null,i=null,a={},o=Nt({isElectronHost:e.isElectronHost(),now:e.now}),s=new Set,c=()=>{if(!n)for(let e of s)e(o)},l=()=>{o=Mt(a,{isElectronHost:e.isElectronHost(),now:e.now})};return{probe:async()=>{if(n)return;if(i)return i;if(r!==null&&e.now()-r<t)return;let o=(async()=>{try{let t=await e.probe();if(n)return;let i=!Lt(a,t);a=t,i&&(l(),c()),r=e.now()}catch{}finally{i=null}})();return i=o,o},getTargetStates:()=>o,subscribe:e=>(s.add(e),()=>{s.delete(e)}),cancel:()=>{n=!0,s.clear()}}}function zt(e=typeof window<`u`?window:void 0){return e?.okDesktop!=null}function Bt(){let e=typeof window<`u`?window.okDesktop:void 0;if(e){let t=t=>e.shell.detectProtocol(t);return{probe:()=>Pt({detectProtocol:t}),isElectronHost:()=>!0,now:Date.now}}let t=globalThis.fetch.bind(globalThis);return{probe:()=>It({fetch:t}),isElectronHost:()=>!1,now:Date.now}}function Vt(){let e=(0,$.c)(5),[t,n]=(0,Q.useState)(Ht),r=(0,Q.useRef)(null),i,a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{let e=Rt(Bt());r.current=e;let t=e.subscribe(n);e.probe();let i=()=>{e.probe()};return window.addEventListener(`focus`,i),()=>{window.removeEventListener(`focus`,i),t(),e.cancel(),r.current=null}},a=[],e[0]=i,e[1]=a):(i=e[0],a=e[1]),(0,Q.useEffect)(i,a);let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>r.current?.probe()??Promise.resolve(),e[2]=o):o=e[2];let s;return e[3]===t?s=e[4]:(s={states:t,refresh:o},e[3]=t,e[4]=s),s}function Ht(){return Nt({isElectronHost:zt(),now:Date.now})}var Ut=(0,Q.createContext)(null);function Wt(e){let t=(0,$.c)(3),{value:n,children:r}=e,i;return t[0]!==r||t[1]!==n?(i=(0,Z.jsx)(Ut,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=i):i=t[2],i}function Gt(){return(0,Q.use)(Ut)}function Kt(e){let t=(0,$.c)(48),{itemName:n,isSubmitting:a,onDelete:o,customTitle:h,customDescription:g,customDetail:_,customConfirmLabel:v,customConfirmLabelBusy:y,children:b}=e,{_:x}=i(),S;t[0]!==x||t[1]!==n?(S=n??x({id:`L3CEC1`}),t[0]=x,t[1]=n,t[2]=S):S=t[2];let C=S,w;t[3]!==x||t[4]!==v?(w=v??x({id:`cnGeoo`}),t[3]=x,t[4]=v,t[5]=w):w=t[5];let T=w,E;t[6]!==x||t[7]!==v||t[8]!==y?(E=y??v??x({id:`s3caR3`}),t[6]=x,t[7]=v,t[8]=y,t[9]=E):E=t[9];let D=E,O;t[10]!==x||t[11]!==h||t[12]!==C?(O=h??x({id:`77SdEP`,values:{itemName:C}}),t[10]=x,t[11]=h,t[12]=C,t[13]=O):O=t[13];let k;t[14]===O?k=t[15]:(k=(0,Z.jsx)(l,{children:O}),t[14]=O,t[15]=k);let A;t[16]!==x||t[17]!==g||t[18]!==C?(A=g??x({id:`16D5Zj`,values:{itemName:C}}),t[16]=x,t[17]=g,t[18]=C,t[19]=A):A=t[19];let j;t[20]===A?j=t[21]:(j=(0,Z.jsx)(c,{className:`whitespace-pre-wrap`,children:A}),t[20]=A,t[21]=j);let M;t[22]===_?M=t[23]:(M=_?(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,"data-testid":`delete-confirmation-detail`,children:_}):null,t[22]=_,t[23]=M);let N;t[24]!==k||t[25]!==j||t[26]!==M?(N=(0,Z.jsxs)(m,{children:[k,j,M]}),t[24]=k,t[25]=j,t[26]=M,t[27]=N):N=t[27];let P;t[28]===b?P=t[29]:(P=b?(0,Z.jsx)(d,{children:b}):null,t[28]=b,t[29]=P);let F;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(r,{id:`dEgA5A`}),t[30]=F):F=t[30];let I;t[31]===a?I=t[32]:(I=(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(s,{variant:`outline`,disabled:a,children:F})}),t[31]=a,t[32]=I);let L;t[33]!==T||t[34]!==D||t[35]!==a?(L=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ge,{className:`size-4 animate-spin`}),` `,D]}):T,t[33]=T,t[34]=D,t[35]=a,t[36]=L):L=t[36];let R;t[37]!==a||t[38]!==o||t[39]!==L?(R=(0,Z.jsx)(s,{variant:`destructive`,onClick:o,disabled:a,children:L}),t[37]=a,t[38]=o,t[39]=L,t[40]=R):R=t[40];let z;t[41]!==I||t[42]!==R?(z=(0,Z.jsxs)(f,{children:[I,R]}),t[41]=I,t[42]=R,t[43]=z):z=t[43];let B;return t[44]!==P||t[45]!==z||t[46]!==N?(B=(0,Z.jsxs)(u,{children:[N,P,z]}),t[44]=P,t[45]=z,t[46]=N,t[47]=B):B=t[47],B}function qt(e){return e?xe._({id:`wTcjov`}):null}function Jt(e){let t=(0,$.c)(47),{_:n}=i(),a=de(),o=Gt(),s=w(),c=E();if(a)return null;let{input:l,installStates:u,dispatch:d,onBeforeLaunch:f}=e,p=l===null,m,h,C,O,j,F,I,L,R,B,V;if(t[0]!==n||t[1]!==d||t[2]!==l||t[3]!==p||t[4]!==u||t[5]!==f||t[6]!==c||t[7]!==s||t[8]!==o){let e=qt(p),i;t[20]===c?i=t[21]:(i=e=>P(c,e.id),t[20]=c,t[21]=i);let a=D.filter(i),w;t[22]===c?w=t[23]:(w=e=>k(c,e.source,e.id,!0,e.supported),t[22]=c,t[23]=w);let E=s.filter(w),H=o?ae.filter(e=>M(c,e,o.installedClis)):[];C=a.length>0,O=o!==null&&H.length>0,j=E.length>0,h=_,t[24]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(le,{"aria-hidden":`true`}),(0,Z.jsx)(r,{id:`O7_W_a`})]}),t[24]=V):V=t[24],m=v,F=`max-h-80`,I=j?(0,Z.jsxs)(y,{"aria-label":n({id:`vPKX2i`}),children:[(0,Z.jsxs)(b,{className:`flex items-center gap-1.5`,children:[(0,Z.jsx)(r,{id:`RXEbZy`}),(0,Z.jsx)(N,{})]}),E.map(t=>{let i=t.name;return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),Tt(l,{agent:{source:t.source,id:t.id}}))},disabled:p,"data-testid":`file-tree-open-in-thread-${t.id}`,"aria-label":e?n({id:`gtGQ9S`,values:{agentName:i,hint:e}}):void 0,children:[(0,Z.jsx)(oe,{agentId:t.id,iconUrl:t.iconUrl,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`5PrrYw`,values:{agentName:i}})}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},`${t.source}:${t.id}`)})]}):null,t[25]!==C||t[26]!==O||t[27]!==j?(L=j&&(O||C)?(0,Z.jsx)(S,{}):null,t[25]=C,t[26]=O,t[27]=j,t[28]=L):L=t[28],R=O?(0,Z.jsxs)(y,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`ALhMYW`})}),H.map(t=>{let{displayName:r}=z[t];return(0,Z.jsxs)(g,{onSelect:()=>{l!==null&&(f?.(),o.launchInTerminal(l,t))},disabled:p,"data-testid":`file-tree-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(A,{id:T(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,B=C?(0,Z.jsxs)(Z.Fragment,{children:[O?(0,Z.jsx)(S,{}):null,(0,Z.jsxs)(y,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(b,{children:(0,Z.jsx)(r,{id:`BBqGS9`})}),a.map(t=>{let r=!p,{displayName:i}=t,a=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(g,{disabled:!r,onSelect:()=>{if(l){if(f?.(),u[t.id]?.installed!==!0){dt(t);return}d(t.id,l)}},"data-testid":`file-tree-open-in-${t.id}`,"aria-label":a,children:[(0,Z.jsx)(A,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null,t[0]=n,t[1]=d,t[2]=l,t[3]=p,t[4]=u,t[5]=f,t[6]=c,t[7]=s,t[8]=o,t[9]=m,t[10]=h,t[11]=C,t[12]=O,t[13]=j,t[14]=F,t[15]=I,t[16]=L,t[17]=R,t[18]=B,t[19]=V}else m=t[9],h=t[10],C=t[11],O=t[12],j=t[13],F=t[14],I=t[15],L=t[16],R=t[17],B=t[18],V=t[19];let H;t[29]!==C||t[30]!==O||t[31]!==j?(H=j||O||C?(0,Z.jsx)(S,{}):null,t[29]=C,t[30]=O,t[31]=j,t[32]=H):H=t[32];let U;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(ve,{"aria-hidden":`true`}),t[33]=U):U=t[33];let W;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsxs)(g,{onSelect:Se,"data-testid":`file-tree-open-in-settings`,children:[U,(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(r,{id:`jRAGrQ`})})]}),t[34]=W):W=t[34];let G;t[35]!==m||t[36]!==F||t[37]!==I||t[38]!==L||t[39]!==R||t[40]!==B||t[41]!==H?(G=(0,Z.jsxs)(m,{className:F,children:[I,L,R,B,H,W]}),t[35]=m,t[36]=F,t[37]=I,t[38]=L,t[39]=R,t[40]=B,t[41]=H,t[42]=G):G=t[42];let K;return t[43]!==h||t[44]!==V||t[45]!==G?(K=(0,Z.jsxs)(h,{children:[V,G]}),t[43]=h,t[44]=V,t[45]=G,t[46]=K):K=t[46],K}function Yt(e){let t=(0,$.c)(8),n=e?.enabled??!0,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),[o,s]=(0,Q.useState)(0),c,l;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=()=>s($t),t=Te(e),n=we(t=>{t.includes(`files`)&&e()});return()=>{t(),n()}},l=[],t[1]=c,t[2]=l):(c=t[1],l=t[2]),(0,Q.useEffect)(c,l);let u;t[3]===n?u=t[4]:(u=()=>{if(!n)return;let e=!1;return a(Qt),fetch(`/api/skills`).then(Xt).then(t=>{if(e)return;let n=L.safeParse(t);if(!n.success){console.error(`[ok-skills] /api/skills response failed schema validation:`,n.error.issues),a({status:`error`,message:`Server returned an incomplete skills response.`});return}a({status:`ready`,data:n.data.skills})}).catch(t=>{e||a({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},t[3]=n,t[4]=u);let d;return t[5]!==n||t[6]!==o?(d=[o,n],t[5]=n,t[6]=o,t[7]=d):d=t[7],(0,Q.useEffect)(u,d),i}async function Xt(e){if(!e.ok){let t=await e.json().catch(Zt);throw Error(Ce(t)??`HTTP ${e.status}`)}return e.json()}function Zt(){return null}function Qt(e){return e.status===`ready`?e:{status:`loading`}}function $t(e){return e+1}function en(e){let t=(0,$.c)(16),{skill:n,onOpenChange:r,onDeleted:a}=e,{_:o}=i(),[s,c]=(0,Q.useState)(!1),l;t[0]!==o||t[1]!==a||t[2]!==r?(l=async function(e){c(!0);let t=await Pe(e.scope,e.name);if(c(!1),!t.ok){let{error:e}=t;X.error(o({id:`AtBdnD`,values:{error:e}}));return}X.success(o({id:`h9QFb9`,values:{0:e.name}})),a(),r(!1)},t[0]=o,t[1]=a,t[2]=r,t[3]=l):l=t[3];let u=l,d=n!==null,f;t[4]!==s||t[5]!==r?(f=e=>{!e&&!s&&r(!1)},t[4]=s,t[5]=r,t[6]=f):f=t[6];let p;t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==n?(p=n?(0,Z.jsx)(Kt,{itemName:o({id:`ExUzM4`,values:{0:n.name}}),isSubmitting:s,onDelete:()=>u(n),customDescription:o({id:`E1Da_b`,values:{0:n.path}})}):null,t[7]=o,t[8]=s,t[9]=u,t[10]=n,t[11]=p):p=t[11];let m;return t[12]!==d||t[13]!==f||t[14]!==p?(m=(0,Z.jsx)(h,{open:d,onOpenChange:f,children:p}),t[12]=d,t[13]=f,t[14]=p,t[15]=m):m=t[15],m}function tn(e){let t=(0,$.c)(68),{skill:n,existingNames:a,onOpenChange:o,onRenamed:d}=e,{_:p}=i(),g=n!==null,_=(0,Q.useId)(),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(!1),S;t[0]===n?S=t[1]:(S=()=>{n&&y(n.name)},t[0]=n,t[1]=S);let w=n?.scope,T=n?.name,E;if(t[2]!==w||t[3]!==T?(E=[w,T],t[2]=w,t[3]=T,t[4]=E):E=t[4],(0,Q.useEffect)(S,E),!n)return null;let D,O,k,A;t[5]!==a||t[6]!==v||t[7]!==n.name?(k=v.trim(),A=k===n.name,D=k===``||!I.test(k),O=!D&&!A&&a.has(k),t[5]=a,t[6]=v,t[7]=n.name,t[8]=D,t[9]=O,t[10]=k,t[11]=A):(D=t[8],O=t[9],k=t[10],A=t[11]);let j=O,M=!D&&!j&&!A&&!b,N;t[12]!==p||t[13]!==M||t[14]!==o||t[15]!==d||t[16]!==n||t[17]!==k?(N=async function(){if(!n||!M)return;x(!0);let e=await Ne({scope:n.scope,fromName:n.name,toName:k});if(x(!1),!e.ok){X.error(p({id:`zKxoPm`,values:{0:n.name,1:e.error}}));return}X.success(p({id:`dUCQo4`,values:{trimmed:k}})),d?.(k),o(!1)},t[12]=p,t[13]=M,t[14]=o,t[15]=d,t[16]=n,t[17]=k,t[18]=N):N=t[18];let P=N,F;t[19]===o?F=t[20]:(F=e=>e?null:o(!1),t[19]=o,t[20]=F);let L;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`dw_3cv`})}),t[21]=L):L=t[21];let R;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsxs)(m,{children:[L,(0,Z.jsx)(c,{children:(0,Z.jsx)(r,{id:`R9IDFz`})})]}),t[22]=R):R=t[22];let z;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsx)(r,{id:`6YtxFj`}),t[23]=z):z=t[23];let B;t[24]===_?B=t[25]:(B=(0,Z.jsx)(C,{htmlFor:_,children:z}),t[24]=_,t[25]=B);let V;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(V=e=>y(e.target.value),t[26]=V):V=t[26];let H;t[27]===P?H=t[28]:(H=e=>{e.key===`Enter`&&P()},t[27]=P,t[28]=H);let U=D||j,W=D&&k!==``||j?`${_}-error`:void 0,G;t[29]!==_||t[30]!==v||t[31]!==H||t[32]!==U||t[33]!==W?(G=(0,Z.jsx)(be,{id:_,value:v,onChange:V,onKeyDown:H,spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-invalid":U,"aria-describedby":W,className:`font-mono`}),t[29]=_,t[30]=v,t[31]=H,t[32]=U,t[33]=W,t[34]=G):G=t[34];let K;t[35]!==j||t[36]!==_||t[37]!==D||t[38]!==k?(K=D&&k!==``?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`A50vr3`,components:{0:(0,Z.jsx)(`code`,{className:`font-mono`})}})}):j?(0,Z.jsx)(`p`,{id:`${_}-error`,className:`text-xs text-destructive`,children:(0,Z.jsx)(r,{id:`YJ1BTp`})}):null,t[35]=j,t[36]=_,t[37]=D,t[38]=k,t[39]=K):K=t[39];let q;t[40]!==B||t[41]!==G||t[42]!==K?(q=(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[B,G,K]}),t[40]=B,t[41]=G,t[42]=K,t[43]=q):q=t[43];let J;t[44]===o?J=t[45]:(J=()=>o(!1),t[44]=o,t[45]=J);let ee;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(r,{id:`dEgA5A`}),t[46]=ee):ee=t[46];let te;t[47]!==b||t[48]!==J?(te=(0,Z.jsx)(s,{variant:`ghost`,onClick:J,disabled:b,children:ee}),t[47]=b,t[48]=J,t[49]=te):te=t[49];let Y;t[50]===P?Y=t[51]:(Y=()=>void P(),t[50]=P,t[51]=Y);let ne=!M,re;t[52]===b?re=t[53]:(re=b?(0,Z.jsx)(r,{id:`tHKQ6j`}):(0,Z.jsx)(r,{id:`2wxgft`}),t[52]=b,t[53]=re);let ie;t[54]!==Y||t[55]!==ne||t[56]!==re?(ie=(0,Z.jsx)(s,{onClick:Y,disabled:ne,children:re}),t[54]=Y,t[55]=ne,t[56]=re,t[57]=ie):ie=t[57];let ae;t[58]!==te||t[59]!==ie?(ae=(0,Z.jsxs)(f,{children:[te,ie]}),t[58]=te,t[59]=ie,t[60]=ae):ae=t[60];let oe;t[61]!==q||t[62]!==ae?(oe=(0,Z.jsxs)(u,{children:[R,q,ae]}),t[61]=q,t[62]=ae,t[63]=oe):oe=t[63];let se;return t[64]!==g||t[65]!==oe||t[66]!==F?(se=(0,Z.jsx)(h,{open:g,onOpenChange:F,children:oe}),t[64]=g,t[65]=oe,t[66]=F,t[67]=se):se=t[67],se}function nn(e){let t=(0,$.c)(15),{skill:n,onOpenChange:a,onUpdated:o}=e,{_:g}=i(),[_,v]=(0,Q.useState)(!1),y;t[0]!==g||t[1]!==a||t[2]!==o?(y=async function(e){v(!0);let t=await je({scope:e.scope,name:e.name});v(!1);let n=se(e.name);if(!t.ok){X.error(g({id:`FRqZ9v`,values:{0:t.error}}));return}X.success(t.checkpointRef?g({id:`My9uXI`,values:{0:t.version,display:n}}):g({id:`mPneVR`,values:{0:t.version,display:n}})),o(),a(!1)},t[0]=g,t[1]=a,t[2]=o,t[3]=y):y=t[3];let b=y,x=n!==null,S;t[4]!==a||t[5]!==_?(S=e=>{!e&&!_&&a(!1)},t[4]=a,t[5]=_,t[6]=S):S=t[6];let C;t[7]!==b||t[8]!==n||t[9]!==_?(C=n?(0,Z.jsxs)(u,{className:`sm:max-w-lg`,children:[(0,Z.jsxs)(m,{children:[(0,Z.jsx)(l,{children:(0,Z.jsx)(r,{id:`iAoh55`,values:{0:se(n.name)}})}),(0,Z.jsx)(c,{children:n.installedVersion?(0,Z.jsx)(r,{id:`47EXvY`,values:{0:n.bundledVersion??``,1:n.installedVersion}}):(0,Z.jsx)(r,{id:`nD7Fx9`,values:{0:n.bundledVersion??``}})})]}),(0,Z.jsx)(d,{}),(0,Z.jsxs)(f,{children:[(0,Z.jsx)(p,{asChild:!0,children:(0,Z.jsx)(s,{variant:`outline`,disabled:_,children:(0,Z.jsx)(r,{id:`dEgA5A`})})}),(0,Z.jsx)(s,{onClick:()=>void b(n),disabled:_,children:_?(0,Z.jsx)(r,{id:`JL3si7`}):(0,Z.jsx)(r,{id:`EkH9pt`})})]})]}):null,t[7]=b,t[8]=n,t[9]=_,t[10]=C):C=t[10];let w;return t[11]!==x||t[12]!==S||t[13]!==C?(w=(0,Z.jsx)(h,{open:x,onOpenChange:S,children:C}),t[11]=x,t[12]=S,t[13]=C,t[14]=w):w=t[14],w}function rn(){let e=(0,$.c)(30),{_:t}=i(),[n,r]=(0,Q.useState)(null),[a,o]=(0,Q.useState)(null),[s,c]=(0,Q.useState)(null),[l,u]=(0,Q.useState)(null),d;e[0]===t?d=e[1]:(d=async function(e,n){u(e.name);let r=await ke({scope:e.scope,name:e.name,...n?{targets:[...n]}:{}});if(u(null),!r.ok)return X.error(t({id:`Mj8R8K`,values:{0:r.error}})),r;let i=an,a=new Set(r.hosts),o=r.hosts.filter(t=>!e.hosts.includes(t)),s=e.hosts.filter(e=>!a.has(e)),c=e=>{let t=r.warningCodes.indexOf(e);return t>=0?r.warnings[t]:void 0},l=c(`no-targets`);if(l)return X.warning(l),r;if(o.length>0){let e=c(`scripts-present`);e&&X.warning(e)}return r.hosts.length===0?X.success(t({id:`0LBDjY`,values:{0:e.name}})):o.length>0&&s.length===0?X.success(t({id:`PPFQ3o`,values:{0:e.name,1:i(o)}})):s.length>0&&o.length===0?X.success(t({id:`OOIVJo`,values:{0:e.name,1:i(s)}})):o.length>0&&s.length>0?X.success(t({id:`OxplNM`,values:{0:e.name,1:i(o),2:i(s)}})):X.success(t({id:`wDgmsr`,values:{0:e.name,1:i(r.hosts)}})),r},e[0]=t,e[1]=d);let f=d,p;e[2]===t?p=e[3]:(p=async function(e){u(e.name);let n=await Ae({scope:e.scope,name:e.name});return u(null),n.ok?X.success(t({id:`0LBDjY`,values:{0:e.name}})):X.error(t({id:`nJq7et`,values:{0:n.error}})),n},e[2]=t,e[3]=p);let m=p,h;e[4]===t?h=e[5]:(h=async function(e,n){let r=await Me({scope:e.scope,name:e.name,existingNames:n});if(!r.ok){X.error(t({id:`UPjaXD`,values:{0:e.name,1:r.error}}));return}X.success(t({id:`0g7rCZ`,values:{0:r.name}}))},e[4]=t,e[5]=h);let g=h,_,v;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{e||r(null)},v=()=>r(null),e[6]=_,e[7]=v):(_=e[6],v=e[7]);let y;e[8]===n?y=e[9]:(y=(0,Z.jsx)(en,{skill:n,onOpenChange:_,onDeleted:v}),e[8]=n,e[9]=y);let b=a?.skill??null,x=a?.existingNames??sn,S,C;e[10]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e||o(null)},C=()=>o(null),e[10]=S,e[11]=C):(S=e[10],C=e[11]);let w;e[12]!==b||e[13]!==x?(w=(0,Z.jsx)(tn,{skill:b,existingNames:x,onOpenChange:S,onRenamed:C}),e[12]=b,e[13]=x,e[14]=w):w=e[14];let T,E;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(T=e=>{e||c(null)},E=()=>c(null),e[15]=T,e[16]=E):(T=e[15],E=e[16]);let D;e[17]===s?D=e[18]:(D=(0,Z.jsx)(nn,{skill:s,onOpenChange:T,onUpdated:E}),e[17]=s,e[18]=D);let O;e[19]!==w||e[20]!==D||e[21]!==y?(O=(0,Z.jsxs)(Z.Fragment,{children:[y,w,D]}),e[19]=w,e[20]=D,e[21]=y,e[22]=O):O=e[22];let k=O,A;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=(e,t)=>o({skill:e,existingNames:t}),e[23]=A):A=e[23];let j;return e[24]!==k||e[25]!==g||e[26]!==f||e[27]!==l||e[28]!==m?(j={installingName:l,install:f,uninstall:m,duplicate:g,requestDelete:r,requestRename:A,requestUpdate:c,dialogs:k},e[24]=k,e[25]=g,e[26]=f,e[27]=l,e[28]=m,e[29]=j):j=e[29],j}function an(e){return e.map(on).join(`, `)}function on(e){return R[e]??e}var sn=new Set;function cn(e){let t=(0,$.c)(19),{skill:n,onEdit:i,onInstall:a,onUninstall:o,onDelete:s}=e,c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(pe,{"aria-hidden":!0}),l=(0,Z.jsx)(r,{id:`ePK91l`}),t[0]=c,t[1]=l):(c=t[0],l=t[1]);let u;t[2]===i?u=t[3]:(u=(0,Z.jsxs)(g,{onSelect:i,children:[c,l]}),t[2]=i,t[3]=u);let d;t[4]!==a||t[5]!==n.installed?(d=a&&!n.installed?(0,Z.jsxs)(g,{onSelect:a,children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}):null,t[4]=a,t[5]=n.installed,t[6]=d):d=t[6];let f;t[7]!==o||t[8]!==n.installed?(f=n.installed?(0,Z.jsxs)(g,{onSelect:o,children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):null,t[7]=o,t[8]=n.installed,t[9]=f):f=t[9];let p,m;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(ye,{"aria-hidden":!0}),m=(0,Z.jsx)(r,{id:`cnGeoo`}),t[10]=p,t[11]=m):(p=t[10],m=t[11]);let h;t[12]===s?h=t[13]:(h=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:s,children:[p,m]}),t[12]=s,t[13]=h);let _;return t[14]!==u||t[15]!==d||t[16]!==f||t[17]!==h?(_=(0,Z.jsxs)(Z.Fragment,{children:[u,d,f,h]}),t[14]=u,t[15]=d,t[16]=f,t[17]=h,t[18]=_):_=t[18],_}function ln(e){let t=(0,$.c)(94),{skill:n,actions:a,existingNames:o}=e,{_:s}=i(),c=De(),l=Vt().states,{dispatch:u}=At(),d=typeof window<`u`?window.okDesktop:void 0,f=n.absolutePath,p;t[0]===s?p=t[1]:(p=async function(e){try{await Oe(e),X.success(s({id:`SXCSQd`}))}catch{X.error(s({id:`cRHuuI`}))}},t[0]=s,t[1]=p);let m=p;if(n.managed){let e,i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(b,{className:`flex items-center gap-1.5 text-muted-foreground`,children:[(0,Z.jsx)(Ie,{className:`size-3`,"aria-hidden":!0}),(0,Z.jsx)(r,{id:`VITWk5`})]}),i=(0,Z.jsx)(S,{}),t[2]=e,t[3]=i):(e=t[2],i=t[3]);let a;t[4]===f?a=t[5]:(a=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[4]=f,t[5]=a);let o;t[6]!==n.name||t[7]!==n.scope||t[8]!==c?(o=pt({skillName:n.name,scope:n.scope,workspace:c}),t[6]=n.name,t[7]=n.scope,t[8]=c,t[9]=o):o=t[9];let s;t[10]!==u||t[11]!==l||t[12]!==o?(s=(0,Z.jsx)(Jt,{input:o,installStates:l,isElectronHost:d!=null,dispatch:u}),t[10]=u,t[11]=l,t[12]=o,t[13]=s):s=t[13];let p;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(me,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[14]=p):p=t[14];let h;t[15]!==f||t[16]!==m?(h=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[15]=f,t[16]=m,t[17]=h):h=t[17];let y;t[18]!==m||t[19]!==n.path?(y=()=>void m(n.path),t[18]=m,t[19]=n.path,t[20]=y):y=t[20];let C;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(r,{id:`xloBjn`}),t[21]=C):C=t[21];let w;t[22]===y?w=t[23]:(w=(0,Z.jsx)(g,{onSelect:y,children:C}),t[22]=y,t[23]=w);let T;t[24]!==w||t[25]!==h?(T=(0,Z.jsxs)(_,{children:[p,(0,Z.jsxs)(v,{children:[h,w]})]}),t[24]=w,t[25]=h,t[26]=T):T=t[26];let E;return t[27]!==T||t[28]!==a||t[29]!==s?(E=(0,Z.jsxs)(Z.Fragment,{children:[e,i,a,s,T]}),t[27]=T,t[28]=a,t[29]=s,t[30]=E):E=t[30],E}let h;t[31]===f?h=t[32]:(h=d&&f?(0,Z.jsxs)(g,{onSelect:()=>void d.shell.showItemInFolder(f),children:[(0,Z.jsx)(he,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`LtSYdi`})]}):null,t[31]=f,t[32]=h);let y;t[33]!==n.name||t[34]!==n.scope||t[35]!==c?(y=pt({skillName:n.name,scope:n.scope,workspace:c}),t[33]=n.name,t[34]=n.scope,t[35]=c,t[36]=y):y=t[36];let C;t[37]!==u||t[38]!==l||t[39]!==y?(C=(0,Z.jsx)(Jt,{input:y,installStates:l,isElectronHost:d!=null,dispatch:u}),t[37]=u,t[38]=l,t[39]=y,t[40]=C):C=t[40];let w;t[41]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsxs)(x,{children:[(0,Z.jsx)(me,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`zd00pH`})]}),t[41]=w):w=t[41];let T;t[42]!==f||t[43]!==m?(T=f?(0,Z.jsx)(g,{onSelect:()=>void m(f),children:(0,Z.jsx)(r,{id:`z2funE`})}):null,t[42]=f,t[43]=m,t[44]=T):T=t[44];let E;t[45]!==m||t[46]!==n.path?(E=()=>void m(n.path),t[45]=m,t[46]=n.path,t[47]=E):E=t[47];let D;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(r,{id:`xloBjn`}),t[48]=D):D=t[48];let O;t[49]===E?O=t[50]:(O=(0,Z.jsx)(g,{onSelect:E,children:D}),t[49]=E,t[50]=O);let k;t[51]!==T||t[52]!==O?(k=(0,Z.jsxs)(_,{children:[w,(0,Z.jsxs)(v,{children:[T,O]})]}),t[51]=T,t[52]=O,t[53]=k):k=t[53];let A;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(S,{}),t[54]=A):A=t[54];let j;t[55]!==a||t[56]!==o||t[57]!==n?(j=()=>void a.duplicate(n,o),t[55]=a,t[56]=o,t[57]=n,t[58]=j):j=t[58];let M,N;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(M=(0,Z.jsx)(ce,{"aria-hidden":!0}),N=(0,Z.jsx)(r,{id:`euc6Ns`}),t[59]=M,t[60]=N):(M=t[59],N=t[60]);let P;t[61]===j?P=t[62]:(P=(0,Z.jsxs)(g,{onSelect:j,children:[M,N]}),t[61]=j,t[62]=P);let F;t[63]!==a||t[64]!==o||t[65]!==n?(F=()=>a.requestRename(n,o),t[63]=a,t[64]=o,t[65]=n,t[66]=F):F=t[66];let I,L;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(Le,{"aria-hidden":!0}),L=(0,Z.jsx)(r,{id:`2wxgft`}),t[67]=I,t[68]=L):(I=t[67],L=t[68]);let R;t[69]===F?R=t[70]:(R=(0,Z.jsxs)(g,{onSelect:F,children:[I,L]}),t[69]=F,t[70]=R);let z;t[71]!==a||t[72]!==n?(z=n.updateAvailable?(0,Z.jsxs)(g,{onSelect:()=>a.requestUpdate(n),children:[(0,Z.jsx)(_e,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`6g2jsp`})]}):null,t[71]=a,t[72]=n,t[73]=z):z=t[73];let B;t[74]!==a||t[75]!==n?(B=n.installed?(0,Z.jsxs)(g,{onSelect:()=>void a.uninstall(n),children:[(0,Z.jsx)(Re,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`fo0VXg`})]}):(0,Z.jsxs)(g,{onSelect:()=>void a.install(n),children:[(0,Z.jsx)(Fe,{"aria-hidden":!0}),(0,Z.jsx)(r,{id:`TKQ7K-`})]}),t[74]=a,t[75]=n,t[76]=B):B=t[76];let V;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsx)(S,{}),t[77]=V):V=t[77];let H;t[78]!==a||t[79]!==n?(H=()=>a.requestDelete(n),t[78]=a,t[79]=n,t[80]=H):H=t[80];let U,W;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(ye,{"aria-hidden":!0}),W=(0,Z.jsx)(r,{id:`cnGeoo`}),t[81]=U,t[82]=W):(U=t[81],W=t[82]);let G;t[83]===H?G=t[84]:(G=(0,Z.jsxs)(g,{variant:`destructive`,onSelect:H,children:[U,W]}),t[83]=H,t[84]=G);let K;return t[85]!==k||t[86]!==P||t[87]!==R||t[88]!==h||t[89]!==z||t[90]!==B||t[91]!==G||t[92]!==C?(K=(0,Z.jsxs)(Z.Fragment,{children:[h,C,k,A,P,R,z,B,V,G]}),t[85]=k,t[86]=P,t[87]=R,t[88]=h,t[89]=z,t[90]=B,t[91]=G,t[92]=C,t[93]=K):K=t[93],K}export{Fe as C,Ie as S,Dt as _,Jt as a,At as b,Gt as c,ut as d,ft as f,xt as g,pt as h,Yt as i,Vt as l,lt as m,ln as n,Kt as o,ct as p,rn as r,Wt as s,cn as t,mt as u,dt as v,st as x,Tt as y};
@@ -1 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BCLrJxO_.js";import"./src-D9eynQ26.js";import"./chunk-WYO6CB5R-WjatCbeP.js";import"./chunk-ICXQ74PX-COjRz7aI.js";import"./chunk-HOUHSVGY-CiAzcmEO.js";import"./chunk-Q4XR5HBZ-sjes-Yon.js";import"./chunk-7BUUIJ7U-CjwBXrEk.js";import"./chunk-OGEWGWER-C7C3Oiaz.js";import"./chunk-32BRIVSS-JpxGJ5ji.js";import"./chunk-XXDRQBXY-aujsIsPx.js";import"./chunk-VR4S4FIN-Db6y0lij.js";import"./chunk-C7G6YPKG-yRQSkwCz.js";import"./chunk-ZGVPDNZ5-DKtGLh__.js";import"./chunk-52WLFC77-C_iSxcYL.js";import"./chunk-FWX5IMBZ-DS2bi_oI.js";import{i as t,n,r,t as i}from"./chunk-EX3LRPZG-Dp9dLoos.js";var a={parser:n,get db(){return new i(2)},renderer:r,styles:t,init:e(e=>{e.state||={},e.state.arrowMarkerAbsolute=e.arrowMarkerAbsolute},`init`)};export{a as diagram};
@@ -1,8 +0,0 @@
1
- import{n as e}from"./chunk-Y2CYZVJY-BCLrJxO_.js";import"./src-D9eynQ26.js";import"./chunk-WYO6CB5R-WjatCbeP.js";import"./chunk-ICXQ74PX-COjRz7aI.js";import"./chunk-HOUHSVGY-CiAzcmEO.js";import"./chunk-Q4XR5HBZ-sjes-Yon.js";import"./chunk-7BUUIJ7U-CjwBXrEk.js";import"./chunk-OGEWGWER-C7C3Oiaz.js";import"./chunk-32BRIVSS-JpxGJ5ji.js";import"./chunk-XXDRQBXY-aujsIsPx.js";import"./chunk-VR4S4FIN-Db6y0lij.js";import"./chunk-C7G6YPKG-yRQSkwCz.js";import"./chunk-ZGVPDNZ5-DKtGLh__.js";import"./chunk-52WLFC77-C_iSxcYL.js";import"./chunk-FWX5IMBZ-DS2bi_oI.js";import"./chunk-ZIRB5QZD-JvsKOaWe.js";import{r as t,t as n}from"./chunk-PUDLZKDR-ZoTPQ917.js";var r=n({defaultLayout:`swimlane`,styles:e(e=>`${t(e)}
2
- .swimlane.cluster rect {
3
- stroke: ${e.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,`getStyles`)});export{r as diagram};
@@ -1 +0,0 @@
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"./dist-BLAMau9Z.js";import{t as i}from"./dist-q14fBS3T.js";var a=e(t(),1),o=n(),s=64e3;function c(e){if(typeof e!=`object`||!e)return null;let t=e;return t.type===`text`&&typeof t.text==`string`?t.text:null}var l=class{items=[];plan=[];turnActive=!1;tokenUsage=null;terminals={};toolCallIndex=new Map;permissionIndex=new Map;permissionByToolCall=new Map;permissionsByToolCall={};messageIndex=new Map;runtimeConsentIndex=new Map;lastConsentIndex=null;appliedCount=0;dirty=!1;snapshot={items:[],plan:[],turnActive:!1,tokenUsage:null,terminals:{},permissionsByToolCall:{}};sync(e){e.length<this.appliedCount&&this.reset();for(let t=this.appliedCount;t<e.length;t++)this.applyEvent(e[t]);return this.appliedCount=e.length,this.dirty&&=(this.snapshot={items:[...this.items],plan:this.plan,turnActive:this.turnActive,tokenUsage:this.tokenUsage,terminals:{...this.terminals},permissionsByToolCall:{...this.permissionsByToolCall}},!1),this.snapshot}reset(){this.items=[],this.plan=[],this.turnActive=!1,this.tokenUsage=null,this.terminals={},this.toolCallIndex=new Map,this.permissionIndex=new Map,this.permissionByToolCall=new Map,this.permissionsByToolCall={},this.messageIndex=new Map,this.runtimeConsentIndex=new Map,this.lastConsentIndex=null,this.appliedCount=0,this.dirty=!0}applyEvent(e){switch(this.dirty=!0,e.kind){case`user_message`:this.items.push({kind:`message`,role:`user`,text:e.content,messageId:`user-${this.items.length}`}),this.messageIndex.clear();break;case`turn_started`:this.turnActive=!0;break;case`turn_ended`:this.turnActive=!1,this.messageIndex.clear();break;case`status`:if(e.status===`exited`&&(this.turnActive=!1),this.lastConsentIndex!==null){let t=this.items[this.lastConsentIndex];t?.kind===`runtime_consent`&&t.install===`running`&&(e.status===`spawning`||e.status===`ready`||e.status===`running`?this.items[this.lastConsentIndex]={...t,install:`done`}:(e.status===`error`||e.status===`exited`)&&(this.items[this.lastConsentIndex]={...t,install:`failed`}))}e.status===`error`&&e.detail?this.items.push({kind:`notice`,text:e.detail,tone:`error`}):e.status===`auth_required`&&e.detail&&this.items.push({kind:`notice`,text:e.detail,tone:`info`});break;case`permission_request`:{let t=e.toolCall.toolCallId??null,n={kind:`permission`,requestId:e.requestId,title:e.toolCall.title??`Permission required`,toolKind:e.toolCall.kind??`other`,options:e.options,resolved:null,toolCallId:t,mergedIntoToolCall:t!==null&&this.toolCallIndex.has(t)};this.permissionIndex.set(e.requestId,this.items.length),t!==null&&(this.permissionByToolCall.set(t,this.items.length),this.permissionsByToolCall[t]=n),this.items.push(n);break}case`permission_resolved`:{let t=this.permissionIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`permission`)break;let r={...n,resolved:{optionId:e.optionId,auto:e.auto}};this.items[t]=r,r.toolCallId!==null&&(this.permissionsByToolCall[r.toolCallId]=r);break}case`runtime_consent_request`:this.runtimeConsentIndex.set(e.requestId,this.items.length),this.lastConsentIndex=this.items.length,this.items.push({kind:`runtime_consent`,requestId:e.requestId,runtime:e.runtime,displayName:e.displayName,provides:e.provides,version:e.version,approxSizeMB:e.approxSizeMB,sourceHost:e.sourceHost,agentName:e.agentName,resolved:null,install:null,progress:null});break;case`runtime_consent_resolved`:{let t=this.runtimeConsentIndex.get(e.requestId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`runtime_consent`)break;this.items[t]={...n,resolved:e.decision,install:e.decision===`granted`?`running`:null};break}case`runtime_install_progress`:{if(this.lastConsentIndex===null)break;let t=this.items[this.lastConsentIndex];if(t===void 0||t.kind!==`runtime_consent`)break;this.items[this.lastConsentIndex]={...t,progress:{receivedBytes:e.receivedBytes??0,totalBytes:e.totalBytes??null}};break}case`terminal_created`:this.terminals[e.terminalId]={terminalId:e.terminalId,command:e.command,args:e.args,output:``,truncated:!1,exit:null};break;case`terminal_output`:{let t=this.terminals[e.terminalId];if(t===void 0)break;let n=t.output+e.chunk,r=t.truncated;n.length>s&&(n=n.slice(-s),r=!0),this.terminals[e.terminalId]={...t,output:n,truncated:r};break}case`terminal_exit`:{let t=this.terminals[e.terminalId];if(t===void 0)break;this.terminals[e.terminalId]={...t,exit:{exitCode:e.exitCode,signal:e.signal}};break}case`session_update`:this.applyUpdate(e.update);break;default:break}}mergePermissionInto(e){let t=this.permissionByToolCall.get(e);if(t===void 0)return;let n=this.items[t];if(n===void 0||n.kind!==`permission`||n.mergedIntoToolCall)return;let r={...n,mergedIntoToolCall:!0};this.items[t]=r,this.permissionsByToolCall[e]=r}pushMessageChunk(e,t,n){let r=`${e}:${t}`,i=this.messageIndex.get(r);if(i!==void 0&&i===this.items.length-1){let e=this.items[i];this.items[i]={...e,text:e.text+n};return}this.messageIndex.set(r,this.items.length),this.items.push({kind:`message`,role:e,text:n,messageId:t})}applyUpdate(e){switch(e.sessionUpdate){case`agent_message_chunk`:{let t=c(e.content);t!==null&&this.pushMessageChunk(`agent`,d(e),t);break}case`agent_thought_chunk`:{let t=c(e.content);t!==null&&this.pushMessageChunk(`thought`,d(e),t);break}case`user_message_chunk`:{let t=c(e.content);t!==null&&this.pushMessageChunk(`user`,d(e),t);break}case`tool_call`:{let t={kind:`tool_call`,toolCallId:e.toolCallId,title:e.title??`Tool call`,toolKind:e.kind??`other`,status:e.status??`pending`,diffs:[],terminalIds:[],content:[],locations:f(e.locations),rawInput:e.rawInput};p(t,e.content),this.toolCallIndex.set(e.toolCallId,this.items.length),this.items.push(t),this.mergePermissionInto(e.toolCallId);break}case`tool_call_update`:{let t=this.toolCallIndex.get(e.toolCallId);if(t===void 0)break;let n=this.items[t];if(n.kind!==`tool_call`)break;let r={...n,diffs:[...n.diffs],terminalIds:[...n.terminalIds],content:[...n.content]};e.status&&(r.status=e.status),e.title&&(r.title=e.title),e.locations&&(r.locations=f(e.locations));let i=e.rawInput;i!==void 0&&(r.rawInput=i),p(r,e.content),this.items[t]=r;break}case`plan`:{let t=e.entries;Array.isArray(t)&&(this.plan=t.map(e=>e).filter(e=>typeof e.content==`string`).map(e=>({content:e.content,priority:typeof e.priority==`string`?e.priority:void 0,status:typeof e.status==`string`?e.status:void 0})));break}case`usage_update`:{let t=e;this.tokenUsage={used:typeof t.used==`number`?t.used:void 0,size:typeof t.size==`number`?t.size:void 0};break}default:{let t=e.usage;t!==void 0&&(this.tokenUsage={used:t.used,size:t.size});break}}}};function u(e){let t=e.resolved;if(t===null)return null;if(t.optionId===null)return t.auto?{kind:`dismissed`}:{kind:`denied`,auto:!1,optionName:null};let n=e.options.find(e=>e.optionId===t.optionId);if(n===void 0)return{kind:`dismissed`};let r=n.kind.startsWith(`reject`),i=n.kind.startsWith(`allow`);return!r&&!i?{kind:`dismissed`}:{kind:r?`denied`:`approved`,auto:t.auto,optionName:n.name}}function d(e){let t=e.messageId;return typeof t==`string`?t:`default`}function f(e){return Array.isArray(e)?e.map(e=>e).filter(e=>typeof e.path==`string`).map(e=>({path:e.path,line:typeof e.line==`number`?e.line:void 0})):[]}function p(e,t){if(Array.isArray(t))for(let n of t){let t=n;if(t.type===`diff`&&typeof t.path==`string`&&typeof t.newText==`string`)e.diffs.push({path:t.path,oldText:typeof t.oldText==`string`?t.oldText:null,newText:t.newText});else if(t.type===`terminal`&&typeof t.terminalId==`string`)e.terminalIds.includes(t.terminalId)||e.terminalIds.push(t.terminalId);else if(t.type===`content`){let n=c(t.content);n!==null&&e.content.push(n)}else{let n=c(t);n!==null&&e.content.push(n)}}}var m=500,h=15e3,g=3e4,_=9e4,v=8e3,y=class extends Error{code;constructor(e,t){super(t),this.name=`ThreadResumeError`,this.code=e}},b=class extends Error{constructor(){super(`agent-thread channel is not connected`),this.name=`ThreadChannelUnavailableError`}},x=class{url=null;ws=null;reconnectDelay=m;reconnectTimer=null;threads=new Map;listeners=new Set;pendingCreates=new Map;pendingResumes=new Map;openedArchived=new Set;reqCounter=0;status=`idle`;version=0;setUrl(e){e!==this.url&&(this.url=e,this.teardownSocket(),e===null?this.setStatus(`idle`):this.connect())}subscribe=e=>(this.listeners.add(e),()=>this.listeners.delete(e));threadsSnapshot=[];threadsSnapshotVersion=-1;getThreads=()=>(this.threadsSnapshotVersion!==this.version&&(this.threadsSnapshot=[...this.threads.values()].map(e=>e.info).sort((e,t)=>e.createdAt-t.createdAt),this.threadsSnapshotVersion=this.version),this.threadsSnapshot);openTabsSnapshot=[];openTabsSnapshotVersion=-1;getOpenTabs=()=>(this.openTabsSnapshotVersion!==this.version&&(this.openTabsSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived!==!0||this.openedArchived.has(e.threadId)).sort((e,t)=>e.createdAt-t.createdAt),this.openTabsSnapshotVersion=this.version),this.openTabsSnapshot);archivedSnapshot=[];archivedSnapshotVersion=-1;getArchivedThreads=()=>(this.archivedSnapshotVersion!==this.version&&(this.archivedSnapshot=[...this.threads.values()].map(e=>e.info).filter(e=>e.archived===!0).sort((e,t)=>t.lastActivityAt-e.lastActivityAt),this.archivedSnapshotVersion=this.version),this.archivedSnapshot);getThread=e=>this.threads.get(e)??null;modelBuilders=new Map;getThreadModel=e=>{let t=this.threads.get(e);if(t===void 0)return null;let n=this.modelBuilders.get(e);return n===void 0&&(n=new l,this.modelBuilders.set(e,n)),n.sync(t.events)};getConnectionStatus=()=>this.status;async createThread(e){this.connectNow(),await this.waitForOpen(v),this.reqCounter+=1;let t=`create-${this.reqCounter}`,n=new Promise((e,n)=>{let r=setTimeout(()=>{this.pendingCreates.delete(t),n(Error(`thread creation timed out`))},g);this.pendingCreates.set(t,{resolve:e,reject:n,timer:r})});return this.send({op:`create`,reqId:t,...e}),n}prompt(e,t){this.reqCounter+=1,this.send({op:`prompt`,threadId:e,reqId:`prompt-${this.reqCounter}`,content:t})}respondPermission(e,t,n){this.send({op:`permission_response`,threadId:e,requestId:t,outcome:n})}respondRuntimeConsent(e,t,n){this.send({op:`runtime_consent_response`,threadId:e,requestId:t,outcome:n})}cancel(e){this.send({op:`cancel`,threadId:e})}setMode(e,t){this.send({op:`set_mode`,threadId:e,modeId:t})}renameThread(e,t){let n=t.trim();n!==``&&this.send({op:`rename`,threadId:e,title:n})}setConfigOption(e,t,n){this.send({op:`set_config_option`,threadId:e,configId:t,value:n})}closeThread(e){let t=this.threads.get(e);if(t?.info.archived===!0){this.send({op:`unsubscribe`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.set(e,{info:t.info,events:[],lastSeq:-1}),this.bump();return}this.send({op:`close`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}openArchivedThread(e){let t=this.threads.get(e);t===void 0||t.info.archived!==!0||this.openedArchived.has(e)||(this.openedArchived.add(e),this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1}),this.bump())}deleteThread(e){this.send({op:`delete`,threadId:e}),this.openedArchived.delete(e),this.modelBuilders.delete(e),this.threads.delete(e)&&this.bump()}async resumeThread(e,t){this.connectNow(),await this.waitForOpen(v),this.reqCounter+=1;let n=`resume-${this.reqCounter}`,r=new Promise((e,t)=>{let r=setTimeout(()=>{this.pendingResumes.delete(n),t(new y(`timeout`,`resume timed out`))},_);this.pendingResumes.set(n,{resolve:e,reject:t,timer:r})});return this.send({op:`resume`,threadId:e,reqId:n,prompt:t}),r}connectNow(){this.url===null||this.ws!==null||(this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.reconnectDelay=m,this.connect())}waitForOpen(e){return this.ws!==null&&this.ws.readyState===WebSocket.OPEN?Promise.resolve():new Promise((t,n)=>{let r=e=>{clearTimeout(a),i(),e?t():n(new b)},i=this.subscribe(()=>{this.ws!==null&&this.ws.readyState===WebSocket.OPEN&&r(!0)}),a=setTimeout(()=>r(!1),e)})}connect(){if(this.url===null)return;this.setStatus(`connecting`);let e;try{e=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{if(this.ws===e){this.reconnectDelay=m,this.setStatus(`open`),this.send({op:`list`});for(let[e,t]of this.threads)t.info.archived===!0&&!this.openedArchived.has(e)||this.send({op:`subscribe`,threadId:e,sinceSeq:t.lastSeq+1})}},e.onmessage=t=>{if(this.ws!==e||typeof t.data!=`string`)return;let n;try{n=JSON.parse(t.data)}catch{return}this.handleFrame(n)},e.onclose=()=>{this.ws===e&&(this.ws=null,this.setStatus(`closed`),this.scheduleReconnect())},e.onerror=()=>{}}teardownSocket(){this.reconnectTimer!==null&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null);for(let e of this.pendingCreates.values())clearTimeout(e.timer),e.reject(new b);this.pendingCreates.clear();for(let e of this.pendingResumes.values())clearTimeout(e.timer),e.reject(new b);this.pendingResumes.clear();let e=this.ws;if(this.ws=null,e!==null)try{e.close()}catch{}}scheduleReconnect(){if(this.url===null||this.reconnectTimer!==null)return;let e=this.reconnectDelay;this.reconnectDelay=Math.min(this.reconnectDelay*2,h),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}send(e){let t=this.ws;if(!(t===null||t.readyState!==WebSocket.OPEN))try{t.send(JSON.stringify(e))}catch{}}handleFrame(e){switch(e.op){case`created`:{let t=this.pendingCreates.get(e.reqId);t!==void 0&&(this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`threads`:{let t=new Set;for(let n of e.threads){t.add(n.threadId);let e=this.threads.has(n.threadId);this.upsertInfo(n),!e&&n.archived!==!0&&this.send({op:`subscribe`,threadId:n.threadId,sinceSeq:0})}let n=!1;for(let e of Array.from(this.threads.keys()))t.has(e)||(this.threads.delete(e),this.modelBuilders.delete(e),this.openedArchived.delete(e),n=!0);n&&this.bump();return}case`resumed`:{let t=this.pendingResumes.get(e.reqId);t!==void 0&&(this.pendingResumes.delete(e.reqId),clearTimeout(t.timer),t.resolve(e.info)),this.upsertInfo(e.info);return}case`subscribed`:this.upsertInfo(e.info);return;case`info`:this.upsertInfo(e.info);return;case`event`:this.appendEvents(e.threadId,e.seq,[e.event]);return;case`events`:this.appendEvents(e.threadId,e.fromSeq,e.events);return;case`error`:if(e.reqId!==void 0){let t=this.pendingCreates.get(e.reqId);if(t!==void 0){this.pendingCreates.delete(e.reqId),clearTimeout(t.timer),t.reject(Error(e.message));return}let n=this.pendingResumes.get(e.reqId);if(n!==void 0){this.pendingResumes.delete(e.reqId),clearTimeout(n.timer),n.reject(new y(e.code,e.message));return}if(e.reqId.startsWith(`prompt-`)){r.error(i._({id:`XNBGZw`,values:{0:e.message}}));return}}console.warn(`[agent-threads] server error frame:`,e.code,e.message);return;default:return}}appendEvents(e,t,n){let r=this.threads.get(e);if(r===void 0||n.length===0)return;let i=Math.max(r.lastSeq+1-t,0);if(i>=n.length)return;let a=i===0?n:n.slice(i),o=r.info;for(let e of a)o=S(o,e);this.threads.set(e,{info:o,events:[...r.events,...a],lastSeq:t+n.length-1}),this.bump()}upsertInfo(e){let t=this.threads.get(e.threadId);t===void 0?this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1}):e.archived===!0&&t.info.archived!==!0?(this.openedArchived.delete(e.threadId),this.modelBuilders.delete(e.threadId),this.threads.set(e.threadId,{info:e,events:[],lastSeq:-1})):this.threads.set(e.threadId,{...t,info:e}),this.bump()}setStatus(e){this.status!==e&&(this.status=e,this.bump())}bump(){this.version+=1;for(let e of this.listeners)e()}};function S(e,t){switch(t.kind){case`status`:return{...e,status:t.status,lastActivityAt:t.ts};case`title_changed`:return{...e,title:t.title,lastActivityAt:t.ts};default:return{...e,lastActivityAt:t.ts}}}var C=new x;function w(){return C}function T(){return(0,a.useSyncExternalStore)(C.subscribe,C.getOpenTabs,C.getOpenTabs)}function E(){return(0,a.useSyncExternalStore)(C.subscribe,C.getArchivedThreads,C.getArchivedThreads)}function D(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>C.getThread(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(C.subscribe,r,r)}function O(e){let t=(0,o.c)(2),n;t[0]===e?n=t[1]:(n=()=>C.getThreadModel(e),t[0]=e,t[1]=n);let r=n;return(0,a.useSyncExternalStore)(C.subscribe,r,r)}function k(){return(0,a.useSyncExternalStore)(C.subscribe,C.getConnectionStatus,C.getConnectionStatus)}function A(e){if(e===null)return null;try{let t=new URL(e);return t.pathname=`/collab/thread`,t.search=``,t.toString()}catch{return null}}export{D as a,E as c,A as i,T as l,y as n,k as o,w as r,O as s,b as t,u};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-CQNSW5MT-BzGo9Za_.js";export{e as createTreeViewServices};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-R7FJI6CG-BAfUnNIm.js";export{e as createTreemapServices};
@@ -1 +0,0 @@
1
- import{o as e}from"./chunk-CYidjpOJ.js";import{n as t}from"./DocumentContext-DDkluS7D.js";import{t as n}from"./react-f2sANaYj.js";import{t as r}from"./compiler-runtime-BfE3aGVn.js";import{N as i}from"./CodeMirrorPropInput-ZGACWLSy.js";import{_t as a,a as o,i as s}from"./dist-Cal4LUep.js";import{c}from"./documents-events-1HWCdfoh.js";import{n as l}from"./agent-presence-CTJkQnoU.js";import{t as u}from"./lru-string-cache-hwDoWobi.js";var d=r(),f=e(n(),1),p=500,m=64;async function h(e){let t=`/api/agent-activity?agentId=${encodeURIComponent(e)}`,n=await fetch(t),r;try{r=await n.json()}catch(e){throw new i(`Could not parse /api/agent-activity response.`,{cause:e,status:n.status})}if(!n.ok){let e=a.safeParse(r);throw e.success?Error(e.data.title):new i(`/api/agent-activity returned a non-RFC-9457 error response.`,{cause:e.error,status:n.status})}let o=s.safeParse(r);if(!o.success)throw new i(`/api/agent-activity returned a body that did not match AgentActivitySuccessSchema.`,{cause:o.error,status:n.status});return o.data}async function g(e,t,n){let r=`/api/agent-burst-diff?agentId=${encodeURIComponent(e)}&docName=${encodeURIComponent(t)}&keptCount=${n}`,s=await fetch(r),c;try{c=await s.json()}catch(e){throw new i(`Could not parse /api/agent-burst-diff response.`,{cause:e,status:s.status})}if(!s.ok){let e=a.safeParse(c);throw e.success?Error(e.data.title):new i(`/api/agent-burst-diff returned a non-RFC-9457 error response.`,{cause:e.error,status:s.status})}let l=o.safeParse(c);if(!l.success)throw new i(`/api/agent-burst-diff returned a body that did not match AgentBurstDiffSuccessSchema.`,{cause:l.error,status:s.status});let{diff:u,before:d,after:f}=l.data;return{diff:u,before:d,after:f}}function _(e){let n=(0,d.c)(23),{systemProvider:r}=t(),[i,a]=(0,f.useState)(null),[o,s]=(0,f.useState)(`idle`),[l,_]=(0,f.useState)(null),b;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=new u(m),n[0]=b):b=n[0];let x=(0,f.useRef)(b),S=(0,f.useRef)(0),C;n[1]===r?C=n[2]:(C=e=>{let t=S.current+=1;s(`loading`),_(null),h(e).then(n=>{if(S.current!==t)return;let i=y(r,e);a({...n,writingDocs:i}),s(`ready`)}).catch(e=>{S.current===t&&(_(e instanceof Error?e.message:String(e)),s(`error`))})},n[1]=r,n[2]=C);let w=C,T;n[3]!==e||n[4]!==w?(T=()=>{if(!e){S.current+=1,a(null),s(`idle`),_(null),x.current.clear();return}x.current.clear(),w(e);let t=null,n=c(n=>{n.includes(`session-activity`)&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,w(e)},p))});return()=>{t&&clearTimeout(t),n()}},n[3]=e,n[4]=w,n[5]=T):T=n[5];let E;n[6]===e?E=n[7]:(E=[e],n[6]=e,n[7]=E),(0,f.useEffect)(T,E);let D,O;n[8]!==e||n[9]!==r?(D=()=>{if(!e||!r)return;let t=()=>{if(!r.awareness)return;let t=y(r,e);a(e=>!e||v(e.writingDocs,t)?e:{...e,writingDocs:t})},n=r.awareness;if(!n||typeof n.on!=`function`){t();return}n.on(`update`,t),t();let i=setInterval(t,1e3);return()=>{clearInterval(i),typeof n.off==`function`&&n.off(`update`,t)}},O=[e,r],n[8]=e,n[9]=r,n[10]=D,n[11]=O):(D=n[10],O=n[11]),(0,f.useEffect)(D,O);let k;n[12]===e?k=n[13]:(k=async(t,n)=>{if(!e)return``;let r=`${t}\0${n}`,i=x.current.get(r);if(i!==void 0)return i;let{diff:a}=await g(e,t,n);return x.current.set(r,a),a},n[12]=e,n[13]=k);let A=k,j;n[14]!==e||n[15]!==w?(j=()=>{e&&w(e)},n[14]=e,n[15]=w,n[16]=j):j=n[16];let M=j,N;return n[17]!==i||n[18]!==l||n[19]!==A||n[20]!==M||n[21]!==o?(N={data:i,status:o,error:l,reload:M,fetchBurstDiff:A},n[17]=i,n[18]=l,n[19]=A,n[20]=M,n[21]=o,n[22]=N):N=n[22],N}function v(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function y(e,t){let n=new Set;if(!e)return n;let r=e.awareness;if(!l(r))return n;let i=[t,t.startsWith(`agent-`)?t.slice(6):`agent-${t}`];for(let e of r.getStates().values()){let t=e.agentPresence;if(t)for(let e of i){let r=t[e];r&&r.mode===`writing`&&r.currentDoc&&n.add(r.currentDoc)}}return n}export{_ as n,g as t};
@@ -1,2 +0,0 @@
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{Ka as r,Ma as i}from"./dist-Cal4LUep.js";var a=e(t(),1),o=n(),s=/^#[0-9a-fA-F]{6}$/,c={background:`#0f172a`,surface:`#1e293b`,foreground:`#e2e8f0`,primary:`#6366f1`,accent:`#22d3ee`,border:`#334155`};function l(e){return typeof e==`string`&&s.test(e)}function u(e){let t={...c};if(e)for(let n of Object.keys(c)){let r=e[n];l(r)&&(t[n]=r)}return t}function d(e){let t=l(e)?e:`#000000`,n=e=>{let n=Number.parseInt(t.slice(1+e*2,3+e*2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4};return .2126*n(0)+.7152*n(1)+.0722*n(2)}function f(e){return d(e.background)<.5?`dark`:`light`}function p(e){return d(e)<.5?`#ffffff`:`#0a0a0a`}function m(e){return{bg:e.background,bgElevated:e.surface,bgSubtle:e.surface,fg:e.foreground,fgMuted:`color-mix(in oklab, ${e.foreground} 55%, ${e.background})`,border:e.border,primary:e.primary,primaryFg:p(e.primary),red:`#e5534b`,green:`#3fb950`,yellow:`#d29922`,blue:e.accent,cyan:e.accent,orange:`#db8d3f`,purple:e.accent}}function h(e){let t=i(m(e)),n=Object.entries(t).map(([e,t])=>` --${e}: ${t};`);return`html[data-color-theme="custom"] {\n color-scheme: ${f(e)};\n${n.join(`
2
- `)}\n}`}var g=`ok-color-theme-v1`,_=`ok-custom-theme-v1`,v=`data-color-theme`,y=`ok-custom-theme`;function b(e){let t=document.getElementById(y);t||(t=document.createElement(`style`),t.id=y,document.head.appendChild(t)),t.textContent!==e&&(t.textContent=e)}function x(){document.getElementById(y)?.remove()}function S(e,t,n=!0){if(typeof document>`u`)return;let i=r(n?e:`default`),a=document.documentElement;i.id===`default`?a.removeAttribute(v):a.setAttribute(v,i.id);let o=null;if(i.id===`custom`){let e=u(t),n=h(e);b(n),o=JSON.stringify({css:n,dark:f(e)===`dark`})}else x();try{i.id===`default`?localStorage.removeItem(g):localStorage.setItem(g,i.id),o?localStorage.setItem(_,o):localStorage.removeItem(_)}catch{}}function C(e,t,n){let r=(0,o.c)(12),i=n===void 0?!0:n,s;r[0]!==e||r[1]!==t||r[2]!==i?(s=i&&e===`custom`?JSON.stringify(t??null):``,r[0]=e,r[1]=t,r[2]=i,r[3]=s):s=r[3];let c=s,l;r[4]!==e||r[5]!==t||r[6]!==i?(l=()=>{S(e,t,i)},r[4]=e,r[5]=t,r[6]=i,r[7]=l):l=r[7];let u;r[8]!==e||r[9]!==i||r[10]!==c?(u=[e,c,i],r[8]=e,r[9]=i,r[10]=c,r[11]=u):u=r[11],(0,a.useEffect)(l,u)}export{f as a,u as c,c as i,S as n,m as o,C as r,l as s,v as t};
@@ -1,6 +0,0 @@
1
- import{o as e,t}from"./chunk-CYidjpOJ.js";import{t as n}from"./jsx-runtime-BUgB2tll.js";import{n as r,p as i}from"./DocumentContext-DDkluS7D.js";import{t as a}from"./react-f2sANaYj.js";import{t as o}from"./react-dom-DPxgxlDT.js";import{t as s}from"./compiler-runtime-BfE3aGVn.js";import{et as c,k as l,q as u}from"./CodeMirrorPropInput-ZGACWLSy.js";import{Li as d,Xi as f,Yi as p,aa as m,da as h,ea as g,la as _,ni as v,q as y,sa as b,ta as x,ua as S,wi as ee}from"./dist-Cal4LUep.js";import{t as te}from"./libesm-CHqp8owk.js";var C=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.unescapeToken=t,e.escapeToken=n;function t(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function n(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.Pointer=function(){function e(e){e===void 0&&(e=[``]),this.tokens=e}return e.fromJSON=function(n){var r=n.split(`/`).map(t);if(r[0]!==``)throw Error(`Invalid JSON Pointer: ${n}`);return new e(r)},e.prototype.toString=function(){return this.tokens.map(n).join(`/`)},e.prototype.evaluate=function(e){for(var t=null,n=``,r=e,i=1,a=this.tokens.length;i<a;i++)t=r,n=this.tokens[i],!(n==`__proto__`||n==`constructor`||n==`prototype`)&&(r=(t||{})[n]);return{parent:t,key:n,value:r}},e.prototype.get=function(e){return this.evaluate(e).value},e.prototype.set=function(e,t){var n=this.evaluate(e);n.parent&&(n.parent[n.key]=t)},e.prototype.push=function(e){this.tokens.push(e)},e.prototype.add=function(t){return new e(this.tokens.concat(String(t)))},e.prototype.parent=function(){return new e(this.tokens.length>1?this.tokens.slice(0,-1):[``])},e}()})),w=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.hasOwnProperty=void 0,e.objectType=t,e.clone=r,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(e){return e===void 0?`undefined`:e===null?`null`:Array.isArray(e)?`array`:typeof e}function n(e){return typeof e==`object`&&!!e}function r(t){if(!n(t))return t;if(t.constructor==Array){for(var i=t.length,a=Array(i),o=0;o<i;o++)a[o]=r(t[o]);return a}if(t.constructor==Date)return new Date(+t);var s={};for(var c in t)e.hasOwnProperty.call(t,c)&&(s[c]=r(t[c]));return s}})),T=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.isDestructive=n,e.subtract=r,e.intersection=i,e.diffArrays=l,e.diffObjects=u,e.diffAny=d;var t=w();function n(e){var t=e.op;return t===`remove`||t===`replace`||t===`copy`||t===`move`}function r(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&!(t.hasOwnProperty.call(n,i)&&n[i]!==void 0)&&r.push(i);return r}function i(e){for(var n=e.length,r={},i=0;i<n;i++){var a=e[i];for(var o in a)t.hasOwnProperty.call(a,o)&&a[o]!==void 0&&(r[o]=(r[o]||0)+1)}for(var o in r)r[o]<n&&delete r[o];return Object.keys(r)}function a(e,n){var r=[];for(var i in e)t.hasOwnProperty.call(e,i)&&e[i]!==void 0&&t.hasOwnProperty.call(n,i)&&n[i]!==void 0&&r.push(i);return r}function o(e){return e.op===`add`}function s(e){return e.op===`remove`}function c(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function l(e,t,n,r){r===void 0&&(r=d);var i=Math.max(e.length,t.length),a=new Map([[0,{operations:[],cost:0}]]);function l(o,s){var u=o*i+s,d=a.get(u);if(d===void 0){if(o>0&&s>0&&!r(e[o-1],t[s-1],n.add(String(o-1))).length)d=l(o-1,s-1);else{var f=[];if(o>0){var p=l(o-1,s),m={op:`remove`,index:o-1};f.push(c(p,m))}if(s>0){var h=l(o,s-1),g={op:`add`,index:o-1,value:t[s-1]};f.push(c(h,g))}if(o>0&&s>0){var _=l(o-1,s-1),v={op:`replace`,index:o-1,original:e[o-1],value:t[s-1]};f.push(c(_,v))}d=f.sort(function(e,t){return e.cost-t.cost})[0]}a.set(u,d)}return d}var u=isNaN(e.length)||e.length<=0?0:e.length;return l(u,isNaN(t.length)||t.length<=0?0:t.length).operations.reduce(function(e,t){var i=e[0],a=e[1];if(o(t)){var c=t.index+1+a,l=c<u+a?String(c):`-`,d={op:t.op,path:n.add(l).toString(),value:t.value};return[i.concat(d),a+1]}else if(s(t)){var d={op:t.op,path:n.add(String(t.index+a)).toString()};return[i.concat(d),a-1]}else{var f=n.add(String(t.index+a)),p=r(t.original,t.value,f);return[i.concat.apply(i,p),a]}},[[],0])[0]}function u(e,t,n,i){i===void 0&&(i=d);var o=[];return r(e,t).forEach(function(e){o.push({op:`remove`,path:n.add(e).toString()})}),r(t,e).forEach(function(e){o.push({op:`add`,path:n.add(e).toString(),value:t[e]})}),a(e,t).forEach(function(r){o.push.apply(o,i(e[r],t[r],n.add(r)))}),o}function d(e,n,r,i){if(i===void 0&&(i=d),e===n)return[];var a=(0,t.objectType)(e),o=(0,t.objectType)(n);return a==`array`&&o==`array`?l(e,n,r,i):a==`object`&&o==`object`?u(e,n,r,i):[{op:`replace`,path:r.toString(),value:n}]}})),ne=t((e=>{var t=e&&e.__extends||(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})();Object.defineProperty(e,`__esModule`,{value:!0}),e.InvalidOperationError=e.TestError=e.MissingError=void 0,e.add=l,e.remove=u,e.replace=d,e.move=f,e.copy=p,e.test=m,e.apply=g;var n=C(),r=w(),i=T(),a=function(e){t(n,e);function n(t){var n=e.call(this,`Value required at path: ${t}`)||this;return n.path=t,n.name=`MissingError`,n}return n}(Error);e.MissingError=a;var o=function(e){t(n,e);function n(t,n){var r=e.call(this,`Test failed: ${t} != ${n}`)||this;return r.actual=t,r.expected=n,r.name=`TestError`,r}return n}(Error);e.TestError=o;function s(e,t,n){if(Array.isArray(e))if(t==`-`)e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function c(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function l(e,t,i){var o=n.Pointer.fromJSON(t.path);if(i?.implicitArrayCreation&&o.tokens[o.tokens.length-1]===`-`){var c=o.parent().evaluate(e);c.value===void 0&&(0,r.objectType)(c.parent)===`object`&&(c.parent[c.key]=[])}var l=o.evaluate(e);return l.parent===void 0||i?.implicitArrayCreation&&l.key===`-`&&!Array.isArray(l.parent)?new a(t.path):(s(l.parent,l.key,(0,r.clone)(t.value)),null)}function u(e,t,r){var i=n.Pointer.fromJSON(t.path).evaluate(e);return i.value===void 0?new a(t.path):(c(i.parent,i.key),null)}function d(e,t,i){var o=n.Pointer.fromJSON(t.path).evaluate(e);if(o.parent===null)return new a(t.path);if(Array.isArray(o.parent)){if(parseInt(o.key,10)>=o.parent.length)return new a(t.path)}else if(o.value===void 0)return new a(t.path);return o.parent[o.key]=(0,r.clone)(t.value),null}function f(e,t,r){var i=n.Pointer.fromJSON(t.from).evaluate(e);if(i.value===void 0)return new a(t.from);var o=n.Pointer.fromJSON(t.path).evaluate(e);return o.parent===void 0?new a(t.path):(c(i.parent,i.key),s(o.parent,o.key,i.value),null)}function p(e,t,i){var o=n.Pointer.fromJSON(t.from).evaluate(e);if(o.value===void 0)return new a(t.from);var c=n.Pointer.fromJSON(t.path).evaluate(e);return c.parent===void 0?new a(t.path):(s(c.parent,c.key,(0,r.clone)(o.value)),null)}function m(e,t,r){var a=n.Pointer.fromJSON(t.path).evaluate(e);return(0,i.diffAny)(a.value,t.value,new n.Pointer).length?new o(a.value,t.value):null}var h=function(e){t(n,e);function n(t){var n=e.call(this,`Invalid operation: ${t.op}`)||this;return n.operation=t,n.name=`InvalidOperationError`,n}return n}(Error);e.InvalidOperationError=h;function g(e,t,n){switch(t.op){case`add`:return l(e,t,n);case`remove`:return u(e,t,n);case`replace`:return d(e,t,n);case`move`:return f(e,t,n);case`copy`:return p(e,t,n);case`test`:return m(e,t,n)}return new h(t)}})),re=t((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.Pointer=void 0,e.applyPatch=i,e.createPatch=o;var t=C();Object.defineProperty(e,`Pointer`,{enumerable:!0,get:function(){return t.Pointer}});var n=ne(),r=T();function i(e,t,r){return t.map(function(t){return(0,n.apply)(e,t,r)})}function a(e){function t(n,i,a){var o=e(n,i,a);return Array.isArray(o)?o:(0,r.diffAny)(n,i,a,t)}return t}function o(e,n,i){var o=new t.Pointer;return(i?a(i):r.diffAny)(e,n,o)}})),E=e(a(),1),ie=e(o(),1),D=s(),O=re();function k(){}k.prototype={diff:function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.callback;typeof n==`function`&&(r=n,n={}),this.options=n;var i=this;function a(e){return r?(setTimeout(function(){r(void 0,e)},0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e)),t=this.removeEmpty(this.tokenize(t));var o=t.length,s=e.length,c=1,l=o+s;n.maxEditLength&&(l=Math.min(l,n.maxEditLength));var u=n.timeout??1/0,d=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}],p=this.extractCommon(f[0],t,e,0);if(f[0].oldPos+1>=s&&p+1>=o)return a([{value:this.join(t),count:t.length}]);var m=-1/0,h=1/0;function g(){for(var n=Math.max(m,-c);n<=Math.min(h,c);n+=2){var r=void 0,l=f[n-1],u=f[n+1];l&&(f[n-1]=void 0);var d=!1;if(u){var g=u.oldPos-n;d=u&&0<=g&&g<o}var _=l&&l.oldPos+1<s;if(!d&&!_){f[n]=void 0;continue}if(r=!_||d&&l.oldPos+1<u.oldPos?i.addToPath(u,!0,void 0,0):i.addToPath(l,void 0,!0,1),p=i.extractCommon(r,t,e,n),r.oldPos+1>=s&&p+1>=o)return a(ae(i,r.lastComponent,t,e,i.useLongestToken));f[n]=r,r.oldPos+1>=s&&(h=Math.min(h,n-1)),p+1>=o&&(m=Math.max(m,n+1))}c++}if(r)(function e(){setTimeout(function(){if(c>l||Date.now()>d)return r();g()||e()},0)})();else for(;c<=l&&Date.now()<=d;){var _=g();if(_)return _}},addToPath:function(e,t,n,r){var i=e.lastComponent;return i&&i.added===t&&i.removed===n?{oldPos:e.oldPos+r,lastComponent:{count:i.count+1,added:t,removed:n,previousComponent:i.previousComponent}}:{oldPos:e.oldPos+r,lastComponent:{count:1,added:t,removed:n,previousComponent:i}}},extractCommon:function(e,t,n,r){for(var i=t.length,a=n.length,o=e.oldPos,s=o-r,c=0;s+1<i&&o+1<a&&this.equals(t[s+1],n[o+1]);)s++,o++,c++;return c&&(e.lastComponent={count:c,previousComponent:e.lastComponent}),e.oldPos=o,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split(``)},join:function(e){return e.join(``)}};function ae(e,t,n,r,i){for(var a=[],o;t;)a.push(t),o=t.previousComponent,delete t.previousComponent,t=o;a.reverse();for(var s=0,c=a.length,l=0,u=0;s<c;s++){var d=a[s];if(!d.removed){if(!d.added&&i){var f=n.slice(l,l+d.count);f=f.map(function(e,t){var n=r[u+t];return n.length>e.length?n:e}),d.value=e.join(f)}else d.value=e.join(n.slice(l,l+d.count));l+=d.count,d.added||(u+=d.count)}else if(d.value=e.join(r.slice(u,u+d.count)),u+=d.count,s&&a[s-1].added){var p=a[s-1];a[s-1]=a[s],a[s]=p}}var m=a[c-1];return c>1&&typeof m.value==`string`&&(m.added||m.removed)&&e.equals(``,m.value)&&(a[c-2].value+=m.value,a.pop()),a}var A=new k;function oe(e,t,n){return A.diff(e,t,n)}var j=/^[A-Za-z\xC0-\u02C6\u02C8-\u02D7\u02DE-\u02FF\u1E00-\u1EFF]+$/,M=/\S/,N=new k;N.equals=function(e,t){return this.options.ignoreCase&&(e=e.toLowerCase(),t=t.toLowerCase()),e===t||this.options.ignoreWhitespace&&!M.test(e)&&!M.test(t)},N.tokenize=function(e){for(var t=e.split(/([^\S\r\n]+|[()[\]{}'"\r\n]|\b)/),n=0;n<t.length-1;n++)!t[n+1]&&t[n+2]&&j.test(t[n])&&j.test(t[n+2])&&(t[n]+=t[n+2],t.splice(n+1,2),n--);return t};function se(e,t,n){return N.diff(e,t,n)}var P=new k;P.tokenize=function(e){this.options.stripTrailingCr&&(e=e.replace(/\r\n/g,`
2
- `));var t=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(var r=0;r<n.length;r++){var i=n[r];r%2&&!this.options.newlineIsToken?t[t.length-1]+=i:(this.options.ignoreWhitespace&&(i=i.trim()),t.push(i))}return t};var F=new k;F.tokenize=function(e){return e.split(/(\S.+?[.!?])(?=\s+|$)/)};var ce=new k;ce.tokenize=function(e){return e.split(/([{}:;,]|\s+)/)};function I(e){"@babel/helpers - typeof";return I=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},I(e)}var le=Object.prototype.toString,L=new k;L.useLongestToken=!0,L.tokenize=P.tokenize,L.castInput=function(e){var t=this.options,n=t.undefinedReplacement,r=t.stringifyReplacer,i=r===void 0?function(e,t){return t===void 0?n:t}:r;return typeof e==`string`?e:JSON.stringify(R(e,null,null,i),i,` `)},L.equals=function(e,t){return k.prototype.equals.call(L,e.replace(/,([\r\n])/g,`$1`),t.replace(/,([\r\n])/g,`$1`))};function R(e,t,n,r,i){t||=[],n||=[],r&&(e=r(i,e));var a;for(a=0;a<t.length;a+=1)if(t[a]===e)return n[a];var o;if(le.call(e)===`[object Array]`){for(t.push(e),o=Array(e.length),n.push(o),a=0;a<e.length;a+=1)o[a]=R(e[a],t,n,r,i);return t.pop(),n.pop(),o}if(e&&e.toJSON&&(e=e.toJSON()),I(e)===`object`&&e!==null){t.push(e),o={},n.push(o);var s=[],c;for(c in e)e.hasOwnProperty(c)&&s.push(c);for(s.sort(),a=0;a<s.length;a+=1)c=s[a],o[c]=R(e[c],t,n,r,c);t.pop(),n.pop()}else o=e;return o}var z=new k;z.tokenize=function(e){return e.slice()},z.join=z.removeEmpty=function(e){return e};function B(e,t){let n=t.content.findDiffStart(e.content);if(n===null)return!1;let{a:r,b:i}=t.content.findDiffEnd(e.content),a=n-Math.min(r,i);return a>0&&(e.resolve(n-a).depth<t.resolve(r+a).depth?n-=a:(r+=a,i+=a)),new _(n,i,t.slice(n,r))}function V(e){if(!e.steps.length)return;let t=new S(e.docs[0]),n=e.steps.slice();for(;n.length;){let e=n.shift();for(;n.length&&e.merge(n[0]);){let r=n.shift();e=e instanceof _&&r instanceof _?B(t.doc,r.apply(e.apply(t.doc).doc).doc):e.merge(r)}t.step(e)}return t}function H(e){let t=new S(e);return t.removeMark(0,e.nodeSize-2),t.doc}function U(e,t){let n=t.split(`/`);for(n.shift();n.length;){if(typeof e!=`object`)throw Error();let t=n.shift();e=e[t]}return e}function W(e){return JSON.parse(JSON.stringify(e))}var ue=class{fromDoc;toDoc;complexSteps;wordDiffs;simplifyDiff;schema;tr;currentJSON;finalJSON;ops;constructor(e,t,n={}){let r={complexSteps:!0,wordDiffs:!1,simplifyDiff:!0,...n};this.fromDoc=e,this.toDoc=t,this.complexSteps=r.complexSteps,this.wordDiffs=r.wordDiffs,this.simplifyDiff=r.simplifyDiff,this.schema=e.type.schema,this.tr=new S(e),this.currentJSON={},this.finalJSON={},this.ops=[]}init(){return this.complexSteps?(this.currentJSON=H(this.fromDoc).toJSON(),this.finalJSON=H(this.toDoc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps(),this.recreateChangeMarkSteps()):(this.currentJSON=this.fromDoc.toJSON(),this.finalJSON=this.toDoc.toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),this.recreateChangeContentSteps()),this.simplifyDiff&&(this.tr=V(this.tr)||this.tr),this.tr}recreateChangeContentSteps(){let e=[];for(;this.ops.length;){let t=this.ops.shift();e.push(t);let n,r=W(this.currentJSON),i=t.path.split(`/`);for(;n==null;){(0,O.applyPatch)(r,[t]);try{n=this.schema.nodeFromJSON(r),n.check()}catch{if(n=null,this.ops.length>0)t=this.ops.shift(),e.push(t);else throw Error(`No valid diff possible applying ${t.path}`)}}this.complexSteps&&e.length===1&&(i.includes(`attrs`)||i.includes(`type`))?(this.addSetNodeMarkup(),e=[]):e.length===1&&t.op===`replace`&&i[i.length-1]===`text`?(this.addReplaceTextSteps(t,r),e=[]):this.addReplaceStep(n,r)&&(e=[])}}addSetNodeMarkup(){let e=this.schema.nodeFromJSON(this.currentJSON),t=this.schema.nodeFromJSON(this.finalJSON),n=t.content.findDiffStart(e.content),r=e.nodeAt(n),i=t.nodeAt(n);if(n!=null){let e=r.type===i.type?null:i.type;try{this.tr.setNodeMarkup(n,e,i.attrs,i.marks)}catch(t){if(e&&t.message.includes(`Invalid content`))this.tr.replaceWith(n,n+r.nodeSize,i);else throw t}return this.currentJSON=H(this.tr.doc).toJSON(),this.ops=(0,O.createPatch)(this.currentJSON,this.finalJSON),!0}return!1}recreateChangeMarkSteps(){this.toDoc.descendants((e,t)=>{if(!e.isInline)return!0;this.tr.doc.nodesBetween(t,t+e.nodeSize,(n,r)=>{if(!n.isInline)return!0;let i=Math.max(t,r),a=Math.min(t+e.nodeSize,r+n.nodeSize);n.marks.forEach(t=>{t.isInSet(e.marks)||this.tr.removeMark(i,a,t)}),e.marks.forEach(e=>{e.isInSet(n.marks)||this.tr.addMark(i,a,e)})})})}addReplaceStep(e,t){let n=B(this.schema.nodeFromJSON(this.currentJSON),e);if(!n)return!1;if(!this.tr.maybeStep(n).failed)return this.currentJSON=t,!0;throw Error(`No valid step found.`)}addReplaceTextSteps(e,t){let n={...e,value:`xx`},r={...e,value:`yy`},i=W(this.currentJSON),a=W(this.currentJSON);(0,O.applyPatch)(i,[n]),(0,O.applyPatch)(a,[r]);let o=this.schema.nodeFromJSON(i),s=this.schema.nodeFromJSON(a),c=e.value,l=U(this.currentJSON,e.path),u=this.wordDiffs?se(l,c):oe(l,c),d=o.content.findDiffStart(s.content),f=o.resolve(d+1).marks();for(;u.length;){let e=u.shift();if(e.added){let t=this.schema.nodeFromJSON({type:`text`,text:e.value}).mark(f);if(u.length&&u[0].removed){let e=u.shift();this.tr.replaceWith(d,d+e.value.length,t)}else this.tr.insert(d,t);d+=e.value.length}else if(e.removed)if(u.length&&u[0].added){let t=u.shift(),n=this.schema.nodeFromJSON({type:`text`,text:t.value}).mark(f);this.tr.replaceWith(d,d+e.value.length,n),d+=t.value.length}else this.tr.delete(d,d+e.value.length);else d+=e.value.length}this.currentJSON=t}};function de(e,t,n={}){return new ue(e,t,n).init()}var G=new Set([`list`,`bulletList`,`orderedList`,`taskList`]);function K(e){let t=[];return e.forEach((e,n)=>{if(G.has(e.type.name)){let r=n+1,i=0;e.forEach(e=>{let n=r+i;t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`}),i+=e.nodeSize})}else t.push({from:n,to:n+e.nodeSize,key:`${e.type.name}:${e.textContent}`})}),t}function fe(e,t){let n=e.length,r=t.length,i=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let a=n-1;a>=0;a--)for(let n=r-1;n>=0;n--)i[a][n]=e[a].key===t[n].key?i[a+1][n+1]+1:Math.max(i[a+1][n],i[a][n+1]);let a=[],o=0,s=0;for(;o<n&&s<r;)e[o].key===t[s].key?(a.push({type:`same`,b:t[s]}),o++,s++):i[o+1][s]>=i[o][s+1]?(a.push({type:`del`,a:e[o]}),o++):(a.push({type:`ins`,b:t[s]}),s++);for(;o<n;)a.push({type:`del`,a:e[o++]});for(;s<r;)a.push({type:`ins`,b:t[s++]});return a}function pe(e,t){let n=fe(K(e),K(t)),r=[],i=0;for(let e of n)e.type===`same`?i=e.b.to:e.type===`ins`?(r.push({fromA:0,toA:0,fromB:e.b.from,toB:e.b.to}),i=e.b.to):r.push({fromA:e.a.from,toA:e.a.to,fromB:i,toB:i});return r}var me=400;function q(e,t,n){return t.nodeFromJSON(e.parseWithFallback(n))}function he(e,t){let n=t.filter(e=>e.toB>e.fromB),r=[];return e.steps.forEach((t,i)=>{let a=t instanceof m?`add`:t instanceof b?`remove`:null;if(a===null)return;let o=t,s=e.mapping.slice(i+1),c=s.map(o.from,-1),l=s.map(o.to,1);if(l<=c||n.some(e=>e.fromB<=c&&l<=e.toB))return;let u=e.mapping.slice(0,i).invert(),d=u.map(o.from),f=u.map(o.to);f<=d||r.push({fromA:d,toA:f,fromB:c,toB:l,markName:o.mark.type.name,kind:a})}),r}function ge(e,t,n,r){if(e.length>2e5||t.length>2e5)return{ok:!1,reason:`ceiling`};let i,a;try{i=q(r,n,e),a=q(r,n,t)}catch{return{ok:!1,reason:`parse`}}let o=a,s=null;try{s=de(i,a,{complexSteps:!0,wordDiffs:!0,simplifyDiff:!0}),o=s.doc}catch{}let c=pe(i,o),l=s?he(s,c):[];return c.length+l.length>me?{ok:!1,reason:`ceiling`}:{ok:!0,afterDoc:o,beforeDoc:i,changes:c,markChanges:l}}var _e=`.ok-diff-ins, .ok-diff-ins-block, [data-diff-deleted]`;function ve(e){return e.changes.length+2*e.markChanges.length}function J(e){let t=!1;return e.forEach(e=>{e.isBlock&&(t=!0)}),t}function ye(e){if(e.childCount===0)return!1;let t=!0;return e.forEach(e=>{e.type.name!==`listItem`&&e.type.name!==`taskItem`&&(t=!1)}),t}function Y(e,t,n){let r=document.createElement(n?`div`:`span`);r.className=n?`ok-diff-del ok-diff-del-block`:`ok-diff-del`,r.setAttribute(`data-diff-deleted`,``);let i=e.serializeFragment(t);if(n&&ye(t)){let e=document.createElement(`ul`);e.appendChild(i),r.appendChild(e)}else r.appendChild(i);return r}function be(e,t,n,r,i){let a=h.fromSchema(i),o=[];for(let e of r){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(p.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]})),o.push(p.inline(e.fromB,e.toB,{class:`ok-diff-ins`},{inclusiveEnd:!0}))}for(let e of n)if(e.toB>e.fromB&&o.push(p.node(e.fromB,e.toB,{class:`ok-diff-ins-block`})),e.toA>e.fromA){let n=t.slice(e.fromA,e.toA),r=J(n.content);o.push(p.widget(e.fromB,()=>Y(a,n.content,r),{side:-1,ignoreSelection:!0,marks:[]}))}return f.create(e,o)}var xe=new Set([`slashCommand`,`blockDragHandle`,`blockMover`,`tableInsertControls`,`fileHandler`,`gfmAutolink`,`inlineLinkInputRule`,`keyboardNav`,`tiptapFindReplace`,`selectionState`,`sourceDirtyObserver`,`tabFocusTrap`]),X=i.filter(e=>!xe.has(e.name)).map(e=>e.name===`jsxComponent`?y:e),Z=n(),Q=d(X);function Se(e,t){return ge(e,t,Q,l())}var Ce=ee.create({name:`renderedDiffDecorations`,addOptions(){return{decorations:f.empty}},addProseMirrorPlugins(){let e=this.options.decorations;return[new g({key:new x(`renderedDiffDecorations`),props:{decorations:()=>e}})]}});function we(e){let t=(0,D.c)(31),{diff:n}=e,r,i,a,o;if(t[0]!==n.afterDoc||t[1]!==n.beforeDoc||t[2]!==n.changes||t[3]!==n.markChanges){let e=be(n.afterDoc,n.beforeDoc,n.changes,n.markChanges,Q);o=c,a=!1,r=X,i=Ce.configure({decorations:e}),t[0]=n.afterDoc,t[1]=n.beforeDoc,t[2]=n.changes,t[3]=n.markChanges,t[4]=r,t[5]=i,t[6]=a,t[7]=o}else r=t[4],i=t[5],a=t[6],o=t[7];let s;t[8]!==r||t[9]!==i?(s=[...r,i],t[8]=r,t[9]=i,t[10]=s):s=t[10];let l;t[11]===n.afterDoc?l=t[12]:(l=n.afterDoc.toJSON(),t[11]=n.afterDoc,t[12]=l);let d;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(d={attributes:{class:`pt-4`}},t[13]=d):d=t[13];let f;t[14]!==a||t[15]!==s||t[16]!==l?(f={editable:a,extensions:s,content:l,editorProps:d},t[14]=a,t[15]=s,t[16]=l,t[17]=f):f=t[17];let p;t[18]===n?p=t[19]:(p=[n],t[18]=n,t[19]=p);let m=o(f,p),[h]=(0,E.useState)(Te),g=(0,E.useRef)(null),_,v;t[20]===h?(_=t[21],v=t[22]):(_=()=>{let e=g.current;if(e)return e.appendChild(h),()=>{h.parentNode===e&&e.removeChild(h)}},v=[h],t[20]=h,t[21]=_,t[22]=v),(0,E.useLayoutEffect)(_,v);let y;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:g,style:{display:`contents`}})}),t[23]=y):y=t[23];let b;t[24]===m?b=t[25]:(b=(0,Z.jsx)(u,{editor:m,className:`tiptap-editor-portal-content`}),t[24]=m,t[25]=b);let x;t[26]!==h||t[27]!==b?(x=(0,ie.createPortal)(b,h),t[26]=h,t[27]=b,t[28]=x):x=t[28];let S;return t[29]===x?S=t[30]:(S=(0,Z.jsxs)(`div`,{className:`editor-doc-scroll min-h-0 flex-1`,"data-testid":`rendered-diff-view`,children:[y,x]}),t[29]=x,t[30]=S),S}function Te(){let e=document.createElement(`div`);return e.style.display=`contents`,e}function Ee(e){let t=0,n=!1;for(let r of e.split(`
3
- `)){let e=r.startsWith(`+`)&&!r.startsWith(`+++`)||r.startsWith(`-`)&&!r.startsWith(`---`);e&&!n&&(t+=1),n=e}return t}function De(e){let t=Array.from(e.querySelectorAll(`.diff-code-insert, .diff-code-delete`)),n=[],r=null;for(let e of t){let t=e.closest(`tr`);t&&((r===null||t.previousElementSibling!==r)&&n.push(e),r=t)}return n}function $(e){let t=0,n=0;for(let r of e.split(`
4
- `))r.startsWith(`+`)&&!r.startsWith(`+++`)?t++:r.startsWith(`-`)&&!r.startsWith(`---`)&&n++;return{additions:t,deletions:n}}function Oe(e,t){return`${e}\u0000${t}`}function ke(e,t,n){let r=v(e).body,i=v(t).body;return r===i?``:te(n,r,i,``,``,{context:Math.max(r.split(`
5
- `).length,i.split(`
6
- `).length)})}function Ae(e,t,n,i,a){let o=(0,D.c)(10),s=i===void 0?`vs-live`:i,c=a===void 0?null:a,{activeProvider:l}=r(),u;o[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`idle`,diff:null},o[0]=u):u=o[0];let[d,f]=(0,E.useState)(u),p=(0,E.useRef)(l),m;o[1]===l?m=o[2]:(m=()=>{p.current=l},o[1]=l,o[2]=m),(0,E.useEffect)(m);let h,g;return o[3]!==n||o[4]!==t||o[5]!==s||o[6]!==c||o[7]!==e?(h=()=>{if(!e){f({status:`idle`,diff:null});return}let r=e,i=!1;f({status:`loading`,diff:null});let a=async function(e){let r=Oe(t,e),i=n.get(r);if(i!==void 0)return i;let a=await fetch(`/api/history/${e}?docName=${encodeURIComponent(t)}`);if(!a.ok)return console.error(`[timeline-diff] history fetch returned non-ok response`,{sha:e,docName:t,status:a.status}),null;let o=(await a.json()).content??``;return n.set(r,o),o};return(async function(){try{let e=await a(r);if(i)return;if(e===null){f({status:`error`,diff:null});return}let n,o;if(s===`vs-parent`){let t=c?await a(c):``;if(i)return;if(t===null){f({status:`error`,diff:null});return}n=t,o=e}else n=e,o=p.current?.document.getText(`source`).toString()??``;let l=v(n).body,u=v(o).body,d=ke(n,o,t);if(i)return;let{additions:m,deletions:h}=$(d);f({status:`ready`,diff:d,additions:m,deletions:h,before:l,after:u})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,mode:s,err:e}),f({status:`error`,diff:null}))}})(),()=>{i=!0}},g=[e,t,n,s,c],o[3]=n,o[4]=t,o[5]=s,o[6]=c,o[7]=e,o[8]=h,o[9]=g):(h=o[8],g=o[9]),(0,E.useEffect)(h,g),d}export{we as a,ve as c,Ee as i,Ae as n,Se as o,De as r,_e as s,$ as t};
@@ -1 +0,0 @@
1
- import"./chunk-KEIR6QF5-BSqm2tNO.js";import{n as e}from"./chunk-5FCAYU7R-Bq8uZn8B.js";export{e as createWardleyServices};
@@ -1 +0,0 @@
1
- import{t as e}from"./repair-skills-CBmnNSO7.mjs";export{e as repairSkills};
@@ -1 +0,0 @@
1
- import{a as e,o as t,r as n}from"./server-lock-vdpThyb4.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,22 +0,0 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{F as t,I as n,Na as r}from"./src-DtcKZLt0.mjs";import{Ai as i,ct as a,hn as o,lt as s,ot as c,st as l,ui as u,ya as d}from"./src-mOlBaMpr.mjs";import{K as f}from"./sleep-B2L0pvp4.mjs";import{O as p,P as m}from"./fs-traced-Cc6WsRtP.mjs";import{b as h,u as g,v as _,y as v}from"./server-lock-vdpThyb4.mjs";import{t as y}from"./yazl-BafwB467.mjs";import{C as b,d as x,i as ee,v as te,y as S}from"./write-project-skill-B_HecSEZ.mjs";import{c as ne}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-BC8-tjIs.mjs";import{D as re,E as ie,S as C,T as w,_ as ae,b as oe,o as T,v as E}from"./init-D7cD6zok.mjs";import{n as D}from"./constants-DafFdWJR.mjs";import{t as O}from"./is-object-ByG7RnjH.mjs";import"./loader-CiE2EBJO.mjs";import"./preview-DXg4YbDp.mjs";import{execSync as se,spawnSync as k}from"node:child_process";import{basename as A,dirname as j,isAbsolute as M,join as N,relative as ce,resolve as P,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as F,lstatSync as fe,mkdirSync as I,mkdtempSync as pe,readFileSync as L,readdirSync as me,readlinkSync as he,rmSync as ge,statSync as _e,writeFileSync as R}from"node:fs";import{arch as ve,freemem as ye,homedir as be,hostname as xe,platform as Se,release as Ce,tmpdir as we,totalmem as Te,type as Ee,uptime as De}from"node:os";import{realpath as z}from"node:fs/promises";import{createHash as B}from"node:crypto";var V=f();const Oe=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function ke(e,t,n=o){if(e!==void 0&&!Oe.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let Ae=null;function je(e){Ae=e}function Me(){return Ae??process.cwd()}const Ne=[{name:`macos-home-path`,regex:/\/Users\/[^/]+\//g,replacement:`~/`},{name:`linux-home-path`,regex:/\/home\/[^/]+\//g,replacement:`~/`},{name:`github-pat`,regex:/\b(ghp_|gho_|ghu_|ghs_|ghr_)[A-Za-z0-9]{36,}\b/g,replacement:`[REDACTED-GH-PAT]`},{name:`aws-access-key`,regex:/\b(AKIA|ASIA|ABIA)[A-Z2-7]{16}\b/g,replacement:`[REDACTED-AWS-KEY]`},{name:`anthropic-key`,regex:/\bsk-ant-api03-[A-Za-z0-9_-]{20,}\b/g,replacement:`[REDACTED-ANTHROPIC]`},{name:`openai-key`,regex:/\bsk-[A-Za-z0-9]{20,}\b/g,replacement:`[REDACTED-OPENAI]`},{name:`bearer-token`,regex:/([Aa]uthorization:\s*[Bb]earer\s+)\S+/g,replacement:`$1[REDACTED]`},{name:`jwt`,regex:/eyJ[A-Za-z0-9_-]{8,}\.eyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}/g,replacement:`[REDACTED-JWT]`},{name:`url-credentials`,regex:/:\/\/[^/\s:@]+:[^/\s:@]+@/g,replacement:`://[REDACTED]@`}],Pe=Ne.map(e=>e.name);function H(e){let t=new Set,n=0;return{redacted:e.split(`
2
- `).map(e=>{let r=e;for(let{name:e,regex:i,replacement:a}of Ne)i.lastIndex=0,i.test(r)&&(t.add(e),n++,i.lastIndex=0,r=r.replace(i,a));return r}).join(`
3
- `),patterns:[...t],lineCount:n}}function Fe(){return N(be(),`.ok`,`bug-reports`)}function Ie(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Fe(),r=`${t}-bugreport`,i=N(n,`${r}.zip`);for(let e=2;F(i);e+=1)i=N(n,`${r}-${e}.zip`);return i}function Le(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let e=L(n,`utf8`).match(/^\s*name:\s*['"]?(.+?)['"]?\s*$/m);if(e?.[1])return e[1]}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml for project slug; using path-hash fallback`)}return F(N(e,`.ok`))?B(`sha256`).update(P(e)).digest(`hex`).slice(0,12):null}function Re(){let e={timestamp:new Date().toISOString(),platform:Se(),osType:Ee(),osRelease:Ce(),hostname:`[redacted]`,uptime:De(),freeMem:ye(),totalMem:Te(),nodeVersion:process.version,bunVersion:process.versions.bun??null,v8Version:process.versions.v8??null,pid:process.pid};try{e.macosVersion=se(`sw_vers -productVersion 2>/dev/null`,u({encoding:`utf8`})).trim()}catch{}try{let t=N(__dirname,`..`,`..`,`package.json`);F(t)&&(e.okVersion=JSON.parse(L(t,`utf8`)).version)}catch{}return e}function ze(e,t){if(!F(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>N(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return L(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let n=N(e,`.ok`,`local`);return F(n)?{files:[`server.lock`,`last-spawn-error.log`,t].map(e=>N(n,e)).filter(e=>F(e))}:{files:[]}}function Ve(e){let t=N(e,`.ok`,`local`,`logs`);return F(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>N(t,e)).filter(e=>F(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=H(e.content);e.zipfile.addBuffer(Buffer.from(t,`utf8`),e.name),e.bundleFiles.push(e.name),n.length>0&&e.redactions.push({file:e.name,lineCount:r,patterns:n})}else e.zipfile.addBuffer(Buffer.from(e.content,`utf8`),e.name),e.bundleFiles.push(e.name)}function U(e){for(let t of e.files)try{He({zipfile:e.zipfile,name:`${e.prefix}/${A(t)}`,content:L(t,`utf8`),redact:e.redact,bundleFiles:e.bundleFiles,redactions:e.redactions})}catch(n){e.logger?.warn({file:t,prefix:e.prefix,err:n},`bug-report: skipped unreadable file`)}}async function Ue(t){let{redact:n,outputPath:r,logger:i}=t,a=t.userLogsDir??N(be(),`.ok`,`logs`),o=t.projectDir?Le(t.projectDir,i):null;I(j(r),{recursive:!0}),i?.info({projectSlug:o},`gathering diagnostic data`);let s=Re();s.desktop=t.desktop??null;let{files:c}=ze(o,a),{files:l}=t.projectDir?Be(t.projectDir):{files:[]},{files:u}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:c.length,lockFileCount:l.length,localSinkFileCount:u.length},`files collected`);let d=[],f=[],{ZipFile:p}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),m=new p;U({zipfile:m,files:c,prefix:`logs`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:l,prefix:`lockdir`,redact:n,bundleFiles:f,redactions:d,logger:i}),U({zipfile:m,files:u,prefix:`local-logs`,redact:n,bundleFiles:f,redactions:d,logger:i});for(let e of t.extraFiles??[])try{let t=L(e.sourcePath),n=`extra/${e.zipName??A(e.sourcePath)}`;m.addBuffer(t,n),f.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:m,name:`note.txt`,content:t.note,redact:n,bundleFiles:f,redactions:d});let h=JSON.stringify(s,null,2);m.addBuffer(Buffer.from(h,`utf8`),`sysinfo.json`),f.push(`sysinfo.json`);let g={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:o,files:f,redactions:d,sysinfo:s};m.addBuffer(Buffer.from(JSON.stringify(g,null,2),`utf8`),`MANIFEST.json`);let _=d.reduce((e,t)=>e+t.lineCount,0),v=[`# Bug Report Bundle`,``,`Generated: ${g.generatedAt}`,`Project: ${o??`(unscoped)`}`,`Discipline version: ${g.disciplineVersion}`,``,`## Contents`,``,...f.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${Pe.join(`, `)}`,_>0?`${_} line(s) were scrubbed across ${d.length} file(s).`:`No redactions were needed.`,`See MANIFEST.json for the full redaction audit report.`,``,`This bundle is safe to attach to a GitHub issue.`]:[`Redaction was disabled for this bundle; file contents are unmodified.`]].join(`
4
- `);m.addBuffer(Buffer.from(v,`utf8`),`README.md`),m.end();let y=de(r);return m.outputStream.pipe(y),await new Promise((e,t)=>{y.on(`close`,e),y.on(`error`,t)}),i?.info({bundlePath:r,fileCount:f.length,redactionCount:_},`bundle written`),{zipPath:r,summary:{projectSlug:o,files:f,redactions:d,redactedLineCount:_,generatedAt:g.generatedAt}}}var We=e(y(),1),W=e(ne(),1);const Ge=new Set([`doc.name`,`currentDoc`]);function Ke(e){return`doc:${B(`sha256`).update(e).digest(`hex`).slice(0,8)}`}function qe(e,t,n){let r=e.docNameMap[n];if(r===void 0){e.docNameMap[n]=t;return}if(r===t)return;let i=e.docNameCollisions[n];i?i.includes(t)||i.push(t):e.docNameCollisions[n]=[t]}function Je(e,t){let n=t.originalToHashed.get(e);if(n!==void 0)return n;let r=Ke(e);return t.originalToHashed.set(e,r),qe(t,e,r),r}function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function q(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>q(e,t));if(!K(e))return e;let n=typeof e.key==`string`&&Ge.has(e.key)&&K(e.value)&&typeof e.value.stringValue==`string`?e.value.stringValue:null,r={};for(let[i,a]of Object.entries(e))if(n!==null&&i===`value`&&K(a)){let e=Je(n,t);r[i]={...a,stringValue:e}}else Ge.has(i)&&typeof a==`string`?r[i]=Je(a,t):r[i]=q(a,t);return r}function Ye(e,t){if(t.originalToHashed.size===0)return e;let n=Array.from(t.originalToHashed.entries()).sort(([e],[t])=>t.length-e.length),r=e;for(let[e,t]of n)e.length!==0&&r.includes(e)&&(r=r.split(e).join(t));return r}function Xe(e,t){let n=L(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
5
- `),i=n.split(`
6
- `),a=[];for(let e=0;e<i.length;e++){let n=i[e]??``;if(!(e===i.length-1&&n===``)){if(n.length===0){a.push(``);continue}try{let e=q(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}R(e,r?`${a.join(`
7
- `)}\n`:a.join(`
8
- `))}function Ze(e,t){let n=L(e,`utf-8`);if(n.trim().length!==0)try{let r=q(JSON.parse(n),t),i=n.endsWith(`
9
- `)?`
10
- `:``;R(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=Ye(G(n,t.contentDir),t);r!==n&&R(e,r)}}function Qe(e,t){let n=L(e,`utf-8`),r=G(n,t.contentDir);r!==n&&R(e,r)}function $e(e){try{return me(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>N(e,t.name))}catch{return[]}}const et=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function tt(e){let t={contentDir:e.contentDir,docNameMap:{},originalToHashed:new Map,docNameCollisions:{}};for(let n of[`telemetry`,`logs`,`process`])for(let r of $e(N(e.stagingDir,n)))r.endsWith(`.jsonl`)?Xe(r,t):r.endsWith(`.json`)?Ze(r,t):Qe(r,t);for(let n of $e(N(e.stagingDir,`state`))){let e=A(n);n.endsWith(`.jsonl`)?Xe(n,t):et.has(e)?Ze(n,t):Qe(n,t)}return{docNameMap:t.docNameMap,docNameCollisions:t.docNameCollisions}}const nt=[`.ok`,`local`,`telemetry`],rt=[`.ok`,`local`,`logs`],it=`spans-current.jsonl`,at=`spans-prev.jsonl`,ot=`server-current.jsonl`,st=`server-prev.jsonl`;function ct(e){return N(e,...nt,it)}function lt(e){return N(e,...nt,at)}function ut(e){return N(e,...rt,ot)}function dt(e){return N(e,...rt,st)}const ft=1e3;async function pt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(ft)});return t.ok?await t.text():null}catch{return null}}async function mt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(ft)});return t.ok?await t.text():null}catch{return null}}async function ht(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(ft)});return t.ok?await t.text():null}catch{return null}}function gt(e){try{let t=JSON.parse(e);if(typeof t!=`object`||!t)return null;let n=t.decisions;return Array.isArray(n)?n.length===0?``:`${n.map(e=>JSON.stringify(e)).join(`
11
- `)}\n`:null}catch{return null}}function _t(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`log`,`--oneline`,`-50`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function vt(e){let t=N(e,`.git`,`ok`);if(!F(t))return null;let n=k(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],u({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function yt(){let e=process.env.OK_DESKTOP_VERSION,t=process.env.OK_DESKTOP_PACKAGED,n=process.env.OK_DESKTOP_CHANNEL;return e===void 0||t===void 0||n===void 0?null:{electronVersion:e,packaged:t===`1`||t.toLowerCase()===`true`,channel:n}}function bt(){return{nodeVersion:process.version,platform:Se(),arch:ve()}}function xt(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function St(e){if(!F(e))return{};let t;try{t=(0,V.parse)(L(e,`utf-8`))}catch(t){return console.warn(`[ok diagnose bundle] failed to parse ${e} for manifest config; manifest will report schema defaults. Reason: ${t instanceof Error?t.message:String(t)}`),{}}if(!J(t))return{};let n=t.telemetry;if(!J(n))return{};let r=n.localSink;return J(r)?r:{}}function Ct(e){return typeof e==`boolean`?e:void 0}function wt(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return wt(e.maxBytes)}function Tt(e){let t=St(p(`project`,e)),n=St(p(`project-local`,e));return{enabled:Ct(n.enabled)??Ct(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Et(e){return B(`sha256`).update(e).digest(`hex`)}function Dt(e){let t=L(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function Ot(e){let t=L(e,`utf-8`),n=`"doc.name"`,r=0,i=t.indexOf(n);for(;i!==-1;)r++,i=t.indexOf(n,i+10);return r}function X(e,t){return F(e)?(I(j(t),{recursive:!0}),ue(e,t),!0):!1}function kt(e){let t=[],n=e=>{let r=me(e,{withFileTypes:!0});for(let i of r){let r=N(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const At=new Set([`.jsonl`]);function jt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:At.has(e.slice(t))}const Mt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Nt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Mt.has(e.slice(t))}function Pt(e){let t=[];for(let n of kt(e)){let r=Ft(e,n);if(!Nt(r))continue;let{redacted:i,patterns:a,lineCount:o}=H(L(n,`utf-8`));a.length!==0&&(R(n,i),t.push({file:r,lineCount:o,patterns:a}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Ft(e,t){return ce(e,t).split(le).join(`/`)}async function It(e){let r=P(e.contentDir),i=P(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??pt,s=a.fetchAgentEffects??mt,c=a.fetchWatcherRecent??ht,l=a.readShadowHead??_t,u=a.readCheckpointRefs??vt,d=a.now??(()=>new Date),f=a.okVersion??(()=>D),p=a.readDesktopEnv??yt,m=a.readRuntime??bt,h=a.isOtlpPushEnabled??xt,g=pe(N(we(),`ok-bundle-`));try{I(N(g,`telemetry`),{recursive:!0}),I(N(g,`logs`),{recursive:!0}),I(N(g,`state`),{recursive:!0}),X(ct(i),N(g,`telemetry`,it)),X(lt(i),N(g,`telemetry`,at)),X(ut(i),N(g,`logs`,ot)),X(dt(i),N(g,`logs`,st));let _=N(i,`.ok`,`local`),v=N(_,`server.lock`),y=`not-running`,b=`no server.lock`,x=null;if(F(v)){X(v,N(g,`state`,`server.lock`));try{let e=L(v,`utf-8`),t=JSON.parse(e);typeof t.port==`number`?x=t.port:b=`lock present but no port`}catch{b=`lock present but unparseable`}}if(x!==null){let e=await o(x);e===null?b=`agent-presence endpoint at :${x} unreachable`:(R(N(g,`state`,`agent-presence.json`),e),y=`running`,b=``);let t=await s(x);t!==null&&R(N(g,`state`,`agent-effects.json`),t);let n=await c(x);if(n!==null){let e=gt(n);e!==null&&R(N(g,`state`,`watcher-recent.jsonl`),e)}}let ee=l(r);ee!==null&&R(N(g,`state`,`shadow-head.txt`),ee);let te=u(r);te!==null&&R(N(g,`state`,`checkpoint-refs.txt`),te),X(N(_,`last-spawn-error.log`),N(g,`state`,`last-spawn-error.log`)),X(N(_,n),N(g,`state`,n)),X(N(_,t),N(g,`state`,t));let S=m(),ne=p(),re={ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:ne}};R(N(g,`state`,`runtime.json`),`${JSON.stringify(re,null,2)}\n`);let ie=y===`running`?`running
12
- `:`not-running (${b})\n`;if(R(N(g,`state`,`server-status.txt`),ie),e.processDir&&F(e.processDir)){let t=N(g,`process`);I(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let C=null;e.redact===!0&&(C=tt({stagingDir:g,contentDir:r})),e.note&&R(N(g,`note.txt`),e.note);let w=null;e.scrubSecrets===!0&&(w=Pt(g));for(let t of e.extraFiles??[])X(t.sourcePath,N(g,`extra`,t.zipName??A(t.sourcePath)))||a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ae=Tt(i),oe=kt(g),T=[],E=0,D=0;for(let e of oe){let t=Ft(g,e),n=_e(e).size,r=jt(t)?Dt(e):0;T.push({path:t,bytes:n,lines:r}),E+=n,t.startsWith(`telemetry/`)&&jt(t)&&(D+=Ot(e))}let O=C===null?{applied:!1,docNameMapSidecar:null}:Object.keys(C.docNameCollisions).length>0?{applied:!0,docNameMapSidecar:null,docNameCollisions:C.docNameCollisions}:{applied:!0,docNameMapSidecar:null};w!==null&&(O.secretScrub=w);let se={schemaVersion:1,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:S.nodeVersion,platform:S.platform,arch:S.arch},host:{desktop:ne},contentDir:{pathSha256:Et(r),absolutePath:C===null?r:`<CONTENT_DIR>`},telemetry:{localSink:ae,otlpPushEnabled:h()},redaction:O,serverStatus:y,files:T};R(N(g,`manifest.json`),`${JSON.stringify(se,null,2)}\n`);let k=oe.some(e=>{try{return L(e,`utf-8`).includes(r)}catch{return!1}}),j={totalBytes:E,fileCount:T.length,docNameCount:D,contentDirVisible:k,redacted:C!==null},M=!1;return{stagingDir:g,manifest:se,summary:j,redactionMapPayload:C===null?null:{docNameMap:C.docNameMap,docNameCollisions:C.docNameCollisions},cleanup:()=>{M||(M=!0,ge(g,{recursive:!0,force:!0}))}}}catch(e){throw ge(g,{recursive:!0,force:!0}),e}}async function Lt(e){let{collected:t,outputPath:n}=e,r=j(n);if(!F(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);if(t.redactionMapPayload!==null){let e=`${A(n,`.zip`)}.docnames.json`,r={...t.manifest,redaction:{...t.manifest.redaction,applied:!0,docNameMapSidecar:e}};R(N(t.stagingDir,`manifest.json`),`${JSON.stringify(r,null,2)}\n`)}let i=new We.ZipFile,a=kt(t.stagingDir);for(let e of a){let n=Ft(t.stagingDir,e);i.addFile(e,n)}i.end(),t.redactionMapPayload!==null&&R(N(r,`${A(n,`.zip`)}.docnames.json`),`${JSON.stringify({docNameMap:t.redactionMapPayload.docNameMap,docNameCollisions:t.redactionMapPayload.docNameCollisions},null,2)}\n`,{mode:384});let o=de(n);return i.outputStream.pipe(o),await new Promise((e,t)=>{o.on(`close`,e),o.on(`error`,t),i.outputStream.on(`error`,t)}),n}function Rt(e,t){let n=N(e,`.ok`,`config.yml`);if(F(n))try{let t=(0,V.parse)(L(n,`utf-8`)),r=O(t)?t.content:void 0,i=O(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return P(e,i)}catch(e){t?.warn({configPath:n,err:e},`bug-report: failed to read .ok/config.yml; falling back to project root as content dir`)}return P(e)}async function zt(e,t,n){let r=await It({contentDir:Rt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,deps:{readDesktopEnv:n,logger:e.logger}});try{I(j(e.outputPath),{recursive:!0}),await Lt({collected:r,outputPath:e.outputPath});let n=r.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:Le(t,e.logger),files:r.manifest.files.map(e=>e.path),redactions:n?.redactions??[],redactedLineCount:n?.redactedLineCount??0,generatedAt:r.manifest.createdAt}}}finally{r.cleanup()}}async function Bt(e){let{projectDir:t}=e,n=e.readDesktopEnv??yt;if(e.level===`full`&&t!==void 0)return zt(e,t,n);let{zipPath:r,summary:i}=await Ue({projectDir:t,redact:e.redact,outputPath:e.outputPath,userLogsDir:e.userLogsDir,logger:e.logger,note:e.note,extraFiles:e.extraFiles,desktop:n()});return{zipPath:r,summary:{level:e.level,systemWide:t===void 0,projectSlug:i.projectSlug,files:i.files,redactions:i.redactions,redactedLineCount:i.redactedLineCount,generatedAt:i.generatedAt}}}function Z(e,t,n={}){let r=g(e,t);if(!F(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(L(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!v(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??_)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??h())?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a};let o=n.host??xe();return a.hostname===o?{status:`alive`,lockPath:r,lock:a}:{status:`foreign-host`,lockPath:r,lock:a}}function Vt(e){return e.replace(/:\d+$/,``)}function Ht(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Vt(e[1]),owner:e[2],name:e[3]}}{let e=/^(?:[\w.-]+@)?([\w.-]+):([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e?.[1].includes(`.`)||e&&t.startsWith(`git@`))return{protocol:`ssh`,hostname:e[1],owner:e[2],name:e[3]}}{let e=/^git:([\w.-]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:e[1],owner:e[2],name:e[3]}}if(!t.includes(`://`)&&!t.includes(`@`)&&!t.startsWith(`/`)){let e=/^([\w.-]+)\/([\w.\-~%]+?)(?:\.git)?$/.exec(t);if(e)return{protocol:`https`,hostname:`github.com`,owner:e[1],name:e[2]}}return null}function Ut(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`).filter(e=>e.length>0);if(i.length<5||i[2]!==`blob`)return null;let a,o,s,c;try{a=decodeURIComponent(i[0]),o=decodeURIComponent(i[1]),s=decodeURIComponent(i[3]),c=i.slice(4).map(e=>decodeURIComponent(e))}catch{return null}return!a||!o||!s||c.length===0||c.some(e=>e.length===0)?null:{host:n,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Wt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=r(t.hostname);if(n===null)return null;let i=t.pathname.split(`/`);if(i.length<5||i[0]!==``||i[3]!==`tree`)return null;let a=i.slice(5);a.length===1&&a[0]===``&&a.pop();let o,s,c,l;try{o=decodeURIComponent(i[1]),s=decodeURIComponent(i[2]),c=decodeURIComponent(i[4]),l=a.map(e=>decodeURIComponent(e))}catch{return null}return!o||!s||!c||l.some(e=>e.length===0)?null:{host:n,owner:o,repo:s,branch:c,path:l.join(`/`)}}function Gt(e){let t=Ut(e);if(t)return{kind:`doc`,...t};let n=Wt(e);return n?{kind:`folder`,...n}:null}const Kt=`# >>> open-knowledge cli >>>`,qt=`# <<< open-knowledge cli <<<`,Jt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Yt(e){return N(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Xt={existsSync:e=>F(e),readFileSync:(e,t)=>L(e,t),lstatSync:e=>fe(e),readlinkSync:e=>he(e)};function Zt(e,t=Xt){let n=Yt(e);if(!t.existsSync(n))return null;try{let e=JSON.parse(t.readFileSync(n,`utf8`));return e?.version===1?e:null}catch{return null}}function Qt(e){let t=e.replace(Jt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function $t(e,t,n=Xt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function en(e){return te(e)||S(e)||C(e)}const tn=10*1024*1024;function nn(e,t,n,r){let i=T(e,t,n,r);if(i.kind===`absent`||i.kind===`no-entry`)return{kind:`not-present`};if(i.kind===`decline`)return{kind:`declined`,reason:i.reason};if(!en(i.entry))return{kind:`left-foreign`};let a;try{a=r??e.configPath(t,n)}catch{return{kind:`not-present`}}let o=e.serverName(t);return e.format===`file`?(ge(a,{force:!0}),{kind:`removed`}):e.format===`toml`?on(a,o):e.format===`yaml`?an(a,e.topLevelKey,o):rn(a,e.topLevelKey,e.serverMapSubKey,o)}function rn(e,t,n,r){let i;try{i=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>tn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=re(i,ae(t,n,r));return o?(m(e,a,{mode:w(e)}),{kind:`removed`}):{kind:`not-present`}}function an(e,t,n){let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>tn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,V.parseDocument)(a);if(o.errors.length>0)return{kind:`declined`,reason:`unparseable`};let s=[t,n];if(!o.hasIn(s))return{kind:`not-present`};o.deleteIn(s);let c=o.toString(),l=ie(a);a.trim()===``||a.endsWith(`
13
- `)?c.endsWith(`
14
- `)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
15
- `).replace(/\n/g,`\r
16
- `));let u=`${i?``:``}${c}`;return u!==r&&m(e,u,{mode:w(e)}),{kind:`removed`}}function on(e,t){let n=oe();if(n.backend===`fallback`)return{kind:`declined`,reason:`no-native-writer`};let r;try{r=L(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=ie(a),s=a.trim()===``||a.endsWith(`
17
- `),c;try{c=n.removeEntry(a,t)}catch{return{kind:`declined`,reason:`unparseable`}}if(!c.existed)return{kind:`not-present`};let l=c.text;s?l.endsWith(`
18
- `)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
19
- `).replace(/\n/g,`\r
20
- `));let u=`${i?``:``}${l}`;return u!==r&&m(e,u,{mode:w(e)}),{kind:`removed`}}function sn(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function cn(e,t=Date.now()){let n=new Date(e).getTime();if(Number.isNaN(n))return`—`;let r=t-n,i=Math.floor(r/1e3);if(i<60)return`${i}s`;let a=Math.floor(i/60);if(a<60)return`${a}m ago`;let o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function ln(e,t,n,r,i,a){if(t.status===`missing`||t.status===`corrupt`)return null;let o=t.lock,s=null;if(n.status!==`missing`&&n.status!==`corrupt`){let e=n.lock;s={port:e.port,status:n.status,pid:e.pid,startedAt:e.startedAt,usage:a}}return{directory:o.worktreeRoot,server:{port:o.port,status:t.status,pid:o.pid,startedAt:o.startedAt,usage:i},ui:s,hostname:o.hostname,lockPath:t.lockPath,binary:r==null?null:l(r),command:r,isDesktop:sn(r)}}function un(e){return e.ui==null?!1:e.ui.status===`alive`||e.ui.status===`foreign-host`}function Q(e){let t=e.server.status;return t===`alive`||t===`foreign-host`?e.isDesktop?`desktop`:t===`alive`?`running`:`foreign`:t===`dead-pid`&&un(e)?`ui-orphan`:`stale`}const dn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function fn(e){switch(e){case`running`:return W.default.green(e);case`desktop`:return W.default.blue(e);case`foreign`:return W.default.cyan(e);case`ui-orphan`:return W.default.magenta(e);case`stale`:return W.default.yellow(e)}}function pn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function mn(e){return`${pn(e.server.usage)} | ${pn(e.ui?.usage??null)}`}function hn(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function gn(e){if(e.length===0)return`No open-knowledge servers found.`;let t=[`DIRECTORY`,`PORTS (API/UI)`,`CPU/MEM (API | UI)`,`STATUS`,`PID`,`STARTED`,`BINARY`],n=e.map(e=>{let t=Q(e),n=t===`ui-orphan`&&e.ui!=null?e.ui.pid:e.server.pid;return[e.directory,hn(e),mn(e),t,String(n),cn(e.server.startedAt),e.binary??`—`]}),r=t.length,i=t.map(e=>e.length);for(let e of n)for(let t=0;t<r;t++)i[t]=Math.max(i[t]??0,(e[t]??``).length);let a=t.map((e,t)=>e.padEnd(i[t]??0)).join(` `).trimEnd(),o=e.map((e,t)=>{let a=n[t]??[],o=[];for(let t=0;t<r;t++){let n=(a[t]??``).padEnd(i[t]??0);if(t===3){let r=a[t]??``;n=fn(Q(e))+` `.repeat(Math.max(0,(i[t]??0)-r.length))}o.push(n)}return o.join(` `).trimEnd()}),s=W.default.dim(`To stop a server: ok stop <port|pid|directory|all>`);return[a,...o,``,s].join(`
21
- `)}async function _n(e={}){let t=e.discover??c,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??a,o=e.resolveUsage??s,l=await t(),u=[];for(let e of l){let t=n(e,`server`),r=n(e,`ui`),a=ln(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:o(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:o(r.lock.pid));a!=null&&u.push(a)}if(e.json){let e=u.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(gn(e.all?u:u.filter(e=>dn.has(Q(e)))))}function vn(){return new b(`ps`).description(`List all running open-knowledge servers`).argument(`[modifier]`,`"all" to include stale (dead-pid) entries`).option(`--all`,`Include stale (dead-pid) entries (foreign-host shows by default)`).option(`--json`,`Emit structured JSON (always includes all statuses)`).action(async(e,t)=>{await _n({all:t.all===!0||e===`all`,json:t.json===!0})})}function yn(e,t,n={}){let r=n.isAlive??_,i=[];for(let[n,a]of[[`server`,e],[`ui`,t]])(a.status===`alive`||a.status===`foreign-host`&&r(a.lock.pid))&&i.push({name:n,pid:a.lock.pid,port:a.lock.port});return{targets:i}}function bn(e){let t=e.inspect??(t=>Z(e.lockDir,t)),n=e.kill??((e,t)=>process.kill(e,t)),r=e.log??(e=>console.log(e)),i=e.error??(e=>console.error(e)),a=yn(t(`server`),t(`ui`),{isAlive:e.isAlive});if(a.targets.length===0)return r(`No running open-knowledge processes.`),{stopped:[],failed:[],hadTargets:!1};let o=[],s=[];for(let e of a.targets)try{n(e.pid,`SIGTERM`),o.push(e)}catch(t){s.push({target:e,error:t instanceof Error?t.message:String(t)})}return o.length>0&&r(`Stopped: ${o.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `)}`),s.length>0&&i(`Failed to stop: ${s.map(({target:e,error:t})=>`${e.name} (pid=${e.pid}): ${t}`).join(`; `)}`),{stopped:o,failed:s,hadTargets:!0}}function $(e,t){return e.status===`alive`?!0:e.status===`foreign-host`?t(e.lock.pid):!1}async function xn(e,t=_){let n=await c(),r=null;for(let i of n){let n=Z(i,`server`),a=Z(i,`ui`);if($(n,t)&&n.lock.port===e||$(a,t)&&a.lock.port===e)return i;r===null&&($(n,t)&&n.lock.pid===e||$(a,t)&&a.lock.pid===e)&&(r=i)}return r}function Sn(e){let t=bn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Cn(e){return new b(`stop`).description(`Stop open-knowledge server(s). With no argument: stops the server for the current directory. Pass a port number, a directory path, or "all" to target globally.`).argument(`[target...]`,`port number, directory path (spaces OK), or "all"`).action(async t=>{let n=t.length===0?void 0:t.join(` `);if(n===void 0){e();let t=bn({lockDir:i(process.cwd()),log:()=>{}});if(t.hadTargets){if(t.stopped.length>0){let e=t.stopped.map(e=>`${e.name} (pid=${e.pid}, port=${e.port})`).join(`, `);console.log(`Stopped: ${e}`)}t.failed.length>0&&(process.exitCode=1)}else await _n({});return}if(n===`all`){let e=await c();if(e.length===0){console.log(`No running open-knowledge servers found.`);return}let t=0;for(let n of e){let e=Z(n,`server`),r=Z(n,`ui`);!$(e,_)&&!$(r,_)||(Sn(n),t++)}t===0&&console.log(`No running open-knowledge servers found.`);return}if(/^\d+$/.test(n)){let e=Number.parseInt(n,10),t=await xn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}Sn(t);return}Sn(i(P(Me(),n)))})}function wn(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Tn(e,t){let n,i;try{n=await z(P(e)),i=await z(P(j(e)))}catch{return{kind:`not-git`}}if(!En(n,i))return{kind:`symlink-escape`};let a=N(n,`.git`),o;try{o=_e(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await z(a)}catch{return{kind:`not-git`}}if(!En(e,n))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=d(n);if(s.kind!==`repository`)return{kind:`not-git`};let c=s.repository.readRemoteUrl(`origin`);if(c.kind===`unreadable`)return{kind:`not-git`};if(c.kind===`absent`)return c.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let l=c.url,u=Ht(l);if(u===null)return{kind:`non-github`};let f=r(u.hostname);if(f===null)return{kind:`non-github`};let p=f===t.host.toLowerCase(),m=u.owner.toLowerCase()===t.owner.toLowerCase(),h=u.name.toLowerCase()===t.repo.toLowerCase();return!p&&m&&h?{kind:`wrong-host`,actualHost:f}:!p||!m||!h?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://${f}/${u.owner}/${u.name}.git`}}function En(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!M(n)}const Dn=[{id:`mcp-config`,write(e,t,n){let r=e.projectConfigPath?.(t);if(!r)return{integration:`mcp-config`,editorId:e.id,action:`skipped-unsupported`};try{let i=E(e,t,n,void 0,r);return i.action===`written`||i.action===`overwritten`?{integration:`mcp-config`,editorId:e.id,action:i.action,path:i.configPath}:i.action===`failed`?{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:i.error??`unknown failure`}:i.action===`declined`?{integration:`mcp-config`,editorId:e.id,action:`declined`,path:i.configPath,...i.declineReason===void 0?{}:{reason:i.declineReason}}:{integration:`mcp-config`,editorId:e.id,action:`failed`,path:i.configPath,error:`unexpected project-scope action: ${i.action}`}}catch(t){return{integration:`mcp-config`,editorId:e.id,action:`failed`,path:r,error:t instanceof Error?t.message:String(t)}}}},{id:`project-skill`,write(e,t,n){try{let r=ee(e,t,{home:n.home});return{integration:`project-skill`,editorId:e.id,action:r.action,...r.path?{path:r.path}:{},...r.error?{error:r.error}:{}}}catch(t){return{integration:`project-skill`,editorId:e.id,action:`failed`,error:t instanceof Error?t.message:String(t)}}}}];function On(e,t,n={},r=Dn){let i=[];for(let a of t){let t=x[a];for(let a of r)i.push(a.write(t,e,n))}return i}function kn(e,t,n={}){return{integrations:On(e,t,n)}}export{Ie as C,je as D,Me as E,ke as O,Lt as S,H as T,Wt as _,Cn as a,Bt as b,Kt as c,$t as d,Yt as f,Gt as g,Ut as h,bn as i,Jt as l,Qt as m,Tn as n,vn as o,Zt as p,wn as r,nn as s,kn as t,qt as u,Ht as v,Fe as w,It as x,Z as y};
22
- //# sourceMappingURL=src--Oy-0xgD.mjs.map