@inkeep/open-knowledge 0.46.0-beta.7 → 0.46.0-beta.9

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 (527) hide show
  1. package/dist/THIRD_PARTY_NOTICES.md +10 -0
  2. package/dist/{acp-harness-probe-BladNRtA.mjs → acp-harness-probe-B3zP-iU3.mjs} +2 -2
  3. package/dist/assets/skills/discovery/SKILL.md +1 -2
  4. package/dist/assets/skills/packs/codebase-wiki/SKILL.md +6 -7
  5. package/dist/assets/skills/packs/codebase-wiki/references/generate-and-refresh.md +160 -0
  6. package/dist/assets/skills/packs/entity-vault/SKILL.md +2 -3
  7. package/dist/assets/skills/packs/knowledge-base/SKILL.md +26 -9
  8. package/dist/assets/skills/packs/knowledge-base/consolidate/SKILL.md +160 -0
  9. package/dist/assets/skills/packs/knowledge-base/research/SKILL.md +375 -0
  10. package/dist/assets/skills/packs/okf/SKILL.md +2 -3
  11. package/dist/assets/skills/packs/plain-notes/SKILL.md +4 -3
  12. package/dist/assets/skills/packs/software-lifecycle/SKILL.md +14 -3
  13. package/dist/assets/skills/packs/software-lifecycle/frame-a-proposal/SKILL.md +222 -0
  14. package/dist/assets/skills/packs/software-lifecycle/record-a-decision/SKILL.md +188 -0
  15. package/dist/assets/skills/packs/software-lifecycle/review-a-design/SKILL.md +137 -0
  16. package/dist/assets/skills/packs/software-lifecycle/write-a-postmortem/SKILL.md +202 -0
  17. package/dist/assets/skills/packs/software-lifecycle/write-a-spec/SKILL.md +298 -0
  18. package/dist/assets/skills/packs/worldbuilding/SKILL.md +2 -3
  19. package/dist/assets/skills/packs/writing-pipeline/SKILL.md +5 -3
  20. package/dist/assets/skills/project/SKILL.md +29 -30
  21. package/dist/assets/skills/project/references/anti-patterns.md +1 -1
  22. package/dist/assets/skills/project/references/corpus-qa.md +1 -1
  23. package/dist/assets/skills/project/references/folder-model.md +1 -1
  24. package/dist/assets/skills/project/references/ingest-and-sources.md +230 -13
  25. package/dist/assets/skills/project/references/onboard-existing-repo.md +319 -0
  26. package/dist/assets/skills/project/references/preview.md +1 -1
  27. package/dist/assets/skills/project/references/setup.md +6 -0
  28. package/dist/assets/skills/project/references/starter-packs.md +41 -0
  29. package/dist/assets/skills/write-skill/SKILL.md +69 -28
  30. package/dist/assets/skills/write-skill/references/pressure-testing.md +4 -3
  31. package/dist/cli.mjs +62 -62
  32. package/dist/constants-DJEQ5lbI.mjs +2 -0
  33. package/dist/git-handle-CZCF5f5x.mjs +1 -0
  34. package/dist/{git-handle-CK_JXuyw.mjs → git-handle-bsekfuqb.mjs} +3 -3
  35. package/dist/index.mjs +1 -1
  36. package/dist/{init-CxYfITcc.mjs → init-BSRAJcxJ.mjs} +37 -37
  37. package/dist/init-Nj3Qfja6.mjs +1 -0
  38. package/dist/{launch-json-removal-CLKYnwd0.mjs → launch-json-removal-Z49VHJab.mjs} +2 -2
  39. package/dist/{loader-Bpd9I1fg.mjs → loader-7F0JSi2o.mjs} +2 -2
  40. package/dist/loader-DEoi209o.mjs +1 -0
  41. package/dist/md-manager-DbwR9qMJ.mjs +2 -0
  42. package/dist/{open-browser-BHXl6F9O.mjs → open-browser-DOh4nE9t.mjs} +2 -2
  43. package/dist/parse-worker.mjs +1 -1
  44. package/dist/{preview-D9DiqfyY.mjs → preview-CI4qefY8.mjs} +2 -2
  45. package/dist/preview-rMognm1O.mjs +1 -0
  46. package/dist/public/assets/ActivityModeContent-DwfZoDZE.js +1 -0
  47. package/dist/public/assets/{AgentDiffPane-6bk9bV9U.js → AgentDiffPane-BwPzooAs.js} +2 -2
  48. package/dist/public/assets/{AgentThreadClientBinder-u3ZVSSHE.js → AgentThreadClientBinder-Lk-U9Zg5.js} +1 -1
  49. package/dist/public/assets/AppMenubar-7eBxIB37.js +1 -0
  50. package/dist/public/assets/{BugReportHistory-D_60pb7r.js → BugReportHistory-CaAYnGNR.js} +1 -1
  51. package/dist/public/assets/{BugReportHistoryDialog-BzJsPoev.js → BugReportHistoryDialog-DFfft492.js} +1 -1
  52. package/dist/public/assets/ChangedOutsideBadge-Colj6RSy.js +1 -0
  53. package/dist/public/assets/CodeMirrorPropInput-BPdsBH1q.js +3 -0
  54. package/dist/public/assets/{ConfigSharingInfoTooltip-BMJ7SIjf.js → ConfigSharingInfoTooltip-QTCODx7g.js} +1 -1
  55. package/dist/public/assets/{ConsentDialogBody-DWXqUhzJ.js → ConsentDialogBody-U4UzjnaQ.js} +1 -1
  56. package/dist/public/assets/CopyButton-O0Y9mXoH.js +1 -0
  57. package/dist/public/assets/DiffView-kKTjtgKq.js +3 -0
  58. package/dist/public/assets/DocumentContext-e2BbWZTU.js +38 -0
  59. package/dist/public/assets/EditorModeToggle-DLKntrL5.js +2 -0
  60. package/dist/public/assets/EnableSyncConfirmDialog-B7V1Wevc.js +1 -0
  61. package/dist/public/assets/FeedbackForm-Dx8ISPUC.js +1 -0
  62. package/dist/public/assets/{GraphPanel-DZMLD8ni.js → GraphPanel-D3gnL5o6.js} +2 -2
  63. package/dist/public/assets/ImportSkillDialog-BNwWAA09.js +1 -0
  64. package/dist/public/assets/{LintConfigEditor-k9WOKYkq.js → LintConfigEditor-BUt6XicS.js} +1 -1
  65. package/dist/public/assets/ManagedArtifactProperties-3CrCQfFo.js +2 -0
  66. package/dist/public/assets/ManagedArtifactProperties-DK6O07ZX.js +1 -0
  67. package/dist/public/assets/McpConsentDialogBody-CTl5E-Pz.js +1 -0
  68. package/dist/public/assets/{MermaidDocEditor-CGsfhioE.js → MermaidDocEditor-rdCH3a-W.js} +1 -1
  69. package/dist/public/assets/{RegisteredAgentIcon-CyQDojW_.js → RegisteredAgentIcon-CHh3fima.js} +1 -1
  70. package/dist/public/assets/{ReportBugDialogBody-CdEV6nCR.js → ReportBugDialogBody-DfS6oBiL.js} +1 -1
  71. package/dist/public/assets/SchemaConfigEditor-DaRdC9By.js +1 -0
  72. package/dist/public/assets/SettingsDialogBody-JKJ7DbBe.js +7 -0
  73. package/dist/public/assets/ShareBranchSwitchDialog-BOn9pwt8.js +1 -0
  74. package/dist/public/assets/ShareReceiveDialog-D7WQ4KbX.js +1 -0
  75. package/dist/public/assets/ShareReceiveMissDialog-AS-ub3Fc.js +1 -0
  76. package/dist/public/assets/SkillEditBanner-DPe0it-V.js +1 -0
  77. package/dist/public/assets/SkillModeBanner-CsKHM-QY.js +1 -0
  78. package/dist/public/assets/SkillOriginInline-VUn5IDZk.js +1 -0
  79. package/dist/public/assets/SkillToolbarControls-CzJ4nZzA.js +1 -0
  80. package/dist/public/assets/SourceEditor-C-cUCtJw.js +1 -0
  81. package/dist/public/assets/{TerminalPanel-BHN2VN4r.js → TerminalPanel-yzvzgUXS.js} +3 -3
  82. package/dist/public/assets/TerminalSessionsHost-dj1xA_0P.js +2 -0
  83. package/dist/public/assets/{TerminalWindowApp-CI-7rld6.js → TerminalWindowApp-B6EhrqIb.js} +1 -1
  84. package/dist/public/assets/ThreadView-aANZPCSh.js +6 -0
  85. package/dist/public/assets/TimelineDiffPane-u9qtPOhN.js +2 -0
  86. package/dist/public/assets/{abnfDiagram-VRR7QNED-Cyah47m9.js → abnfDiagram-VRR7QNED-CYyOqigz.js} +1 -1
  87. package/dist/public/assets/agent-diff-store-DKxdS6mK.js +1 -0
  88. package/dist/public/assets/agent-visibility-Dz2lrJHw.js +1 -0
  89. package/dist/public/assets/{arc-B3aheyNj.js → arc-DpnwTjlg.js} +1 -1
  90. package/dist/public/assets/architecture-TIHT7OUA-Bl7-zFAE.js +1 -0
  91. package/dist/public/assets/{architectureDiagram-ZJ3FMSHR-lZYHIfAt.js → architectureDiagram-ZJ3FMSHR-BArScuNA.js} +1 -1
  92. package/dist/public/assets/arrow-up-right-BZsQghvQ.js +1 -0
  93. package/dist/public/assets/{worktree-store-B-NxI13K.js → auth-prompt-store-CmyRhcKh.js} +1 -1
  94. package/dist/public/assets/auth-state-cache-C9Qx3bjQ.js +11 -0
  95. package/dist/public/assets/badge-DB5BJfSU.js +1 -0
  96. package/dist/public/assets/{blockDiagram-677ZJIJ3-mULu-3uH.js → blockDiagram-677ZJIJ3-BKdJnykw.js} +1 -1
  97. package/dist/public/assets/{braces-DwnwFx_V.js → braces-CqiL3TOP.js} +1 -1
  98. package/dist/public/assets/button-oSXzJYWO.js +1 -0
  99. package/dist/public/assets/{c4Diagram-LMCZKHZV-DN4YpCzk.js → c4Diagram-LMCZKHZV-BGzHBzYq.js} +1 -1
  100. package/dist/public/assets/{calendar-DqGTQwGe.js → calendar-C2lP75MI.js} +1 -1
  101. package/dist/public/assets/{case-sensitive-nl0tWMnZ.js → case-sensitive-DcowXaLf.js} +1 -1
  102. package/dist/public/assets/channel-Bf_IZmsH.js +1 -0
  103. package/dist/public/assets/check-DA7_vRdO.js +1 -0
  104. package/dist/public/assets/checkbox-DYPwCq3O.js +1 -0
  105. package/dist/public/assets/{chevron-down-Bx9f3tW-.js → chevron-down-BJumc1E_.js} +1 -1
  106. package/dist/public/assets/chevron-left-D8z-buF6.js +1 -0
  107. package/dist/public/assets/chevron-right-CgsPV9lV.js +1 -0
  108. package/dist/public/assets/chunk-2Q5K7J3B-CBNXZghD.js +1 -0
  109. package/dist/public/assets/{chunk-32BRIVSS-DqkgLIEw.js → chunk-32BRIVSS-DWFi-mYl.js} +1 -1
  110. package/dist/public/assets/{chunk-52WLFC77-9s8UsQXp.js → chunk-52WLFC77-C3ewIu0v.js} +1 -1
  111. package/dist/public/assets/{chunk-5FCAYU7R-CkSFjjQr.js → chunk-5FCAYU7R-DH0H_TSt.js} +1 -1
  112. package/dist/public/assets/{chunk-5HE753X5-C1Ig4mMr.js → chunk-5HE753X5-COZLeOUQ.js} +1 -1
  113. package/dist/public/assets/{chunk-5JV3BV7I-CIggZV0d.js → chunk-5JV3BV7I-BtSn9e5l.js} +1 -1
  114. package/dist/public/assets/{chunk-5TONJI2A-BklATmUd.js → chunk-5TONJI2A-CyVAUHQY.js} +1 -1
  115. package/dist/public/assets/{chunk-5VM5RSS4-g5HeYq-z.js → chunk-5VM5RSS4-DkfDxTnu.js} +1 -1
  116. package/dist/public/assets/{chunk-7BUUIJ7U-Dw__VSpN.js → chunk-7BUUIJ7U-Bwj5weSU.js} +1 -1
  117. package/dist/public/assets/{chunk-BIQX33UG-CRLx_yn0.js → chunk-BIQX33UG-WShnA3hi.js} +1 -1
  118. package/dist/public/assets/{chunk-BO2N2NFS-BptiXfus.js → chunk-BO2N2NFS-0fL-jnUT.js} +4 -4
  119. package/dist/public/assets/{chunk-C7G6YPKG-CmP7ozUj.js → chunk-C7G6YPKG-JOVwaeql.js} +1 -1
  120. package/dist/public/assets/{chunk-CQNSW5MT-BZUHEMrz.js → chunk-CQNSW5MT-DmFd2LFl.js} +1 -1
  121. package/dist/public/assets/{chunk-CYSBUYHQ-BRTRwmYZ.js → chunk-CYSBUYHQ-BOCWcr_T.js} +1 -1
  122. package/dist/public/assets/{chunk-EMLP6XTP-DHUO1B6Q.js → chunk-EMLP6XTP-_039-Ubh.js} +1 -1
  123. package/dist/public/assets/{chunk-EX3LRPZG-aq_XJzX2.js → chunk-EX3LRPZG-CMgFCagr.js} +1 -1
  124. package/dist/public/assets/{chunk-FWX5IMBZ-rnR9hrS_.js → chunk-FWX5IMBZ-C4vKCoUv.js} +2 -2
  125. package/dist/public/assets/{chunk-HOUHSVGY-D0096-9K.js → chunk-HOUHSVGY-CZX004Ef.js} +1 -1
  126. package/dist/public/assets/{chunk-ICXQ74PX-BUnmDgqa.js → chunk-ICXQ74PX-B_iuJAXS.js} +1 -1
  127. package/dist/public/assets/{chunk-JG7HCLWE-BwRUs0j6.js → chunk-JG7HCLWE-CtDpq51e.js} +1 -1
  128. package/dist/public/assets/{chunk-JWPE2WC7-BOwE-mq8.js → chunk-JWPE2WC7-pDBBV-ex.js} +1 -1
  129. package/dist/public/assets/{chunk-MOJQB5TN-CYyw3U64.js → chunk-MOJQB5TN-BOLftHeO.js} +1 -1
  130. package/dist/public/assets/{chunk-MOZMSUNE-_aAOLW1j.js → chunk-MOZMSUNE-B90rFhRO.js} +1 -1
  131. package/dist/public/assets/{chunk-OGEWGWER-DLH_3q-Z.js → chunk-OGEWGWER-dIUHPavN.js} +1 -1
  132. package/dist/public/assets/{chunk-OSBZ3O6U-BOkYzK-N.js → chunk-OSBZ3O6U-C8f7zxUa.js} +1 -1
  133. package/dist/public/assets/{chunk-PUDLZKDR-Co9OjZVi.js → chunk-PUDLZKDR-QPYzmUFw.js} +1 -1
  134. package/dist/public/assets/{chunk-Q4XR5HBZ-CjNiHUWo.js → chunk-Q4XR5HBZ--1adMSrR.js} +1 -1
  135. package/dist/public/assets/{chunk-QBLGF6JB-Cf-f1lin.js → chunk-QBLGF6JB-q87mQ87z.js} +1 -1
  136. package/dist/public/assets/{chunk-R7FJI6CG-C_nyMdyL.js → chunk-R7FJI6CG-B5NnR0wG.js} +1 -1
  137. package/dist/public/assets/{chunk-RYQCIY6F-DXXN4Rzo.js → chunk-RYQCIY6F-BnIBPlEn.js} +1 -1
  138. package/dist/public/assets/{chunk-U6XO7XAA-Hw5M1kkd.js → chunk-U6XO7XAA-DuxWv8i1.js} +1 -1
  139. package/dist/public/assets/{chunk-V7JOEXUC-CLdet7qK.js → chunk-V7JOEXUC-zQePb8W4.js} +1 -1
  140. package/dist/public/assets/chunk-VAUOI2AC-K9aKY8La.js +1 -0
  141. package/dist/public/assets/{chunk-VR4S4FIN-CnZ3Jw81.js → chunk-VR4S4FIN-DOfDyz67.js} +1 -1
  142. package/dist/public/assets/{chunk-WYO6CB5R-C-c-Ja6D.js → chunk-WYO6CB5R-DAcO6KqN.js} +2 -2
  143. package/dist/public/assets/chunk-XXDRQBXY-CRN6FsNM.js +1 -0
  144. package/dist/public/assets/{chunk-YOTPTUD7-CBowI675.js → chunk-YOTPTUD7-DSjCnGGQ.js} +1 -1
  145. package/dist/public/assets/{chunk-ZGVPDNZ5-DfBSa8vW.js → chunk-ZGVPDNZ5-CnXHsnX3.js} +1 -1
  146. package/dist/public/assets/{chunk-ZIRB5QZD-Cas2Em51.js → chunk-ZIRB5QZD-rA251rHW.js} +1 -1
  147. package/dist/public/assets/classDiagram-OUVF2IWQ-B8NyhReL.js +1 -0
  148. package/dist/public/assets/classDiagram-v2-EOCWNBFH-To5zrK6k.js +1 -0
  149. package/dist/public/assets/client-version-DmJhhHKP.js +1 -0
  150. package/dist/public/assets/collapsible-BTn3nxAn.js +1 -0
  151. package/dist/public/assets/{comment-chips-BYH7v5tl.js → comment-chips-i9o0Cefh.js} +2 -2
  152. package/dist/public/assets/{config-provider-B9kQH9zn.js → config-provider-CYJIA2qw.js} +2 -2
  153. package/dist/public/assets/{cose-bilkent-JH36ORCC-CzZaHQ2l.js → cose-bilkent-JH36ORCC-BO3tFb1k.js} +1 -1
  154. package/dist/public/assets/createLucideIcon-BiRV80uZ.js +1 -0
  155. package/dist/public/assets/cynefin-VYW2F7L2-DjK3ZZKp.js +1 -0
  156. package/dist/public/assets/{cynefinDiagram-TSTJHNR4-7PYslCmH.js → cynefinDiagram-TSTJHNR4-kMgUnu_c.js} +1 -1
  157. package/dist/public/assets/{dagre-BeM31D08.js → dagre-DmGue-PX.js} +1 -1
  158. package/dist/public/assets/{dagre-VKFMJZFB-DsY-o9S9.js → dagre-VKFMJZFB-CgYSDfeg.js} +1 -1
  159. package/dist/public/assets/{diagram-FQU43EPY-Cc40Oq-m.js → diagram-FQU43EPY-XRWiX7Im.js} +1 -1
  160. package/dist/public/assets/{diagram-G47NLZAW-DdbiGkJk.js → diagram-G47NLZAW-BzqAYczi.js} +1 -1
  161. package/dist/public/assets/{diagram-NH7WQ7WH-BoEA_7qN.js → diagram-NH7WQ7WH-CAOpGCwL.js} +1 -1
  162. package/dist/public/assets/{diagram-OA4YK3LP-ChsGI8c4.js → diagram-OA4YK3LP-CsYFi60N.js} +1 -1
  163. package/dist/public/assets/{diagram-WEI45ONY-znZ94tAq.js → diagram-WEI45ONY-BPyyv8e3.js} +1 -1
  164. package/dist/public/assets/dialog-CkjkuWLF.js +5 -0
  165. package/dist/public/assets/dist-1J1E9P12.js +1 -0
  166. package/dist/public/assets/{dist-D7mv9smG.js → dist-6Q9yuoli.js} +1 -1
  167. package/dist/public/assets/dist-BCIZY0Wq.js +1 -0
  168. package/dist/public/assets/{dist-Dcu3hl7e.js → dist-BK-fqCFD.js} +1 -1
  169. package/dist/public/assets/{dist-DEamjSXE.js → dist-BM4ov2mK.js} +1 -1
  170. package/dist/public/assets/dist-BVNHmhkE.js +1 -0
  171. package/dist/public/assets/{dist-B25wDFyk.js → dist-Bdhn2jv42.js} +1 -1
  172. package/dist/public/assets/{dist-P9LB04An.js → dist-BkSGIgDv.js} +1 -1
  173. package/dist/public/assets/dist-C22Eiu6U.js +1 -0
  174. package/dist/public/assets/{dist-CxGvJvCN.js → dist-C2ZNHEgX.js} +1 -1
  175. package/dist/public/assets/dist-CEBfbNax.js +1 -0
  176. package/dist/public/assets/{dist-Dolq1sN0.js → dist-CKHaw45-.js} +1 -1
  177. package/dist/public/assets/{dist-DlSSwTCj.js → dist-CTPwMRld.js} +1 -1
  178. package/dist/public/assets/{dist-DmIoqGC0.js → dist-D2AiGKcA.js} +1 -1
  179. package/dist/public/assets/dist-D57Bktz_.js +1 -0
  180. package/dist/public/assets/{dist-CsRIthsw2.js → dist-DA8rIjtg.js} +1 -1
  181. package/dist/public/assets/dist-DcPsSRVd.js +1 -0
  182. package/dist/public/assets/{dist-BMMI5Kdg.js → dist-Dqtgp0QD2.js} +1 -1
  183. package/dist/public/assets/dist-Dyi4atb6.js +1 -0
  184. package/dist/public/assets/{dist-DdFyq-YY.js → dist-FPlC48Ke.js} +1 -1
  185. package/dist/public/assets/{dist-C7VIqwIG.js → dist-MQd-Irtl.js} +1 -1
  186. package/dist/public/assets/{dist-C4Kl8QaT.js → dist-_8wb0R99.js} +1 -1
  187. package/dist/public/assets/{dist-DJbbCXtB.js → dist-fOA99pqU2.js} +184 -182
  188. package/dist/public/assets/doc-paths-C6A87aH3.js +1 -0
  189. package/dist/public/assets/documents-events-Dr9N-4vu.js +1 -0
  190. package/dist/public/assets/download-D3RTVXwv.js +1 -0
  191. package/dist/public/assets/dropdown-menu-D2umi56L.js +1 -0
  192. package/dist/public/assets/{ebnfDiagram-CCIWWBDH-DX6whEUG.js → ebnfDiagram-CCIWWBDH-CUTAjine.js} +1 -1
  193. package/dist/public/assets/{erDiagram-Q63AITRT-CgloxApp.js → erDiagram-Q63AITRT-BSu96D8g.js} +1 -1
  194. package/dist/public/assets/es2015-Du0OjwY5.js +41 -0
  195. package/dist/public/assets/{esm-QF0-_nlB.js → esm-DbmiTy2g.js} +1 -1
  196. package/dist/public/assets/eventmodeling-45OFAUF4-C3gCuhXd.js +1 -0
  197. package/dist/public/assets/{eye-CASw1HTi.js → eye-yERBaQWj.js} +1 -1
  198. package/dist/public/assets/field-i4kPdg1V.js +1 -0
  199. package/dist/public/assets/file-tree-adapter-CvmXjY-P.js +1 -0
  200. package/dist/public/assets/file-tree-utils-DL3JhHtX.js +1 -0
  201. package/dist/public/assets/flowDiagram-23GEKE2U-V8thnmzy.js +1 -0
  202. package/dist/public/assets/folder-8ceGqZIO.js +1 -0
  203. package/dist/public/assets/folder-config-api-DdtJAaIR.js +1 -0
  204. package/dist/public/assets/{folder-open-wLd69QUc.js → folder-open-CvyyCBOn.js} +1 -1
  205. package/dist/public/assets/follow-file-BpD8YozT.js +1 -0
  206. package/dist/public/assets/form-lIFpKMVU.js +1 -0
  207. package/dist/public/assets/{ganttDiagram-NO4QXBWP-BZQXYXPf.js → ganttDiagram-NO4QXBWP-Crrr-q7s.js} +1 -1
  208. package/dist/public/assets/{git-branch-CMJAiYLz.js → git-branch-oPfvsh1I.js} +1 -1
  209. package/dist/public/assets/gitGraph-TEB2WS4Q-BERn_Vnm.js +1 -0
  210. package/dist/public/assets/{gitGraphDiagram-IHSO6WYX-DnT15zfc.js → gitGraphDiagram-IHSO6WYX-BdMHODo-.js} +1 -1
  211. package/dist/public/assets/globals-C6R3KMxA.css +1 -0
  212. package/dist/public/assets/{globals-LdH7xryz.js → globals-IzHn2MUy.js} +2 -2
  213. package/dist/public/assets/{graphlib-CIYGRnfF.js → graphlib-DIVfLvlR.js} +1 -1
  214. package/dist/public/assets/{hash-DNKDqZ18.js → hash-DP25l_li.js} +1 -1
  215. package/dist/public/assets/{highlighted-body-OFNGDK62-DN5QVB2g.js → highlighted-body-OFNGDK62-Cue0vPGT.js} +1 -1
  216. package/dist/public/assets/index-BW1cVj8N.js +2092 -0
  217. package/dist/public/assets/{info-yKMseklR.js → info-Bza7Xa6D.js} +1 -1
  218. package/dist/public/assets/info-DKCQHKI2-xuBgM0S3.js +1 -0
  219. package/dist/public/assets/{infoDiagram-FWYZ7A6U-CPJF9vn1.js → infoDiagram-FWYZ7A6U-_RNxdwPC.js} +1 -1
  220. package/dist/public/assets/input-C4n4n5Hc.js +1 -0
  221. package/dist/public/assets/input-group-C_H5NgPX.js +1 -0
  222. package/dist/public/assets/{ishikawaDiagram-FXEZZL3T-CPmyb7Oh.js → ishikawaDiagram-FXEZZL3T-BbXzN7UF.js} +1 -1
  223. package/dist/public/assets/{journeyDiagram-5HDEW3XC-DHsl5S9z.js → journeyDiagram-5HDEW3XC-BqwkEnJh.js} +1 -1
  224. package/dist/public/assets/{kanban-definition-HUTT4EX6-BS2xX-qh.js → kanban-definition-HUTT4EX6-CX-ROP0U.js} +1 -1
  225. package/dist/public/assets/{label-DyipnO5I.js → label-Ds0LTB-Z.js} +1 -1
  226. package/dist/public/assets/{line-PfwSO0Y4.js → line-D0lohJ6a.js} +1 -1
  227. package/dist/public/assets/{linear-DY7zcaob.js → linear-By98wvuz.js} +1 -1
  228. package/dist/public/assets/lint-config-client-Cc5n1dKz.js +1 -0
  229. package/dist/public/assets/loader-circle-Cn2Xr4cN.js +1 -0
  230. package/dist/public/assets/{map-B5g_BAkn.js → map-XagOZNs9.js} +1 -1
  231. package/dist/public/assets/markdownlint-rule-browser-C5r1T2gD.js +1 -0
  232. package/dist/public/assets/mermaid-GHXKKRXX-CFTslKYT.js +1 -0
  233. package/dist/public/assets/{mermaid-parser.core-DtiAO5KW.js → mermaid-parser.core-DtOR1aVt.js} +2 -2
  234. package/dist/public/assets/{mermaid.core-2-fa7F6R.js → mermaid.core-DFRkYHGF.js} +3 -3
  235. package/dist/public/assets/{mindmap-definition-LN4V7U3C-CTVrQgzc.js → mindmap-definition-LN4V7U3C-BPq8CY-V.js} +1 -1
  236. package/dist/public/assets/minus-CBRjUXY7.js +1 -0
  237. package/dist/public/assets/{miss-dialog-store-Bx4JLuKB.js → miss-dialog-store-DBqQ_Nyn.js} +1 -1
  238. package/dist/public/assets/navigation-targets-CgViVl5N.js +1 -0
  239. package/dist/public/assets/{now-bAD2ZsK-.js → now-BJ6wHiq6.js} +1 -1
  240. package/dist/public/assets/open-managed-artifact-tab-B9P9gMUF.js +1 -0
  241. package/dist/public/assets/{ordinal-Dj8tTCMd.js → ordinal-BhGTF2Fp.js} +1 -1
  242. package/dist/public/assets/packet-7NZHBO7P-DhQWKabl.js +1 -0
  243. package/dist/public/assets/panel-FwLLPu5s.js +1 -0
  244. package/dist/public/assets/{panel-right-open-CWgBRlZa.js → panel-right-open-ChixO1pm.js} +1 -1
  245. package/dist/public/assets/{paperclip-FiPqbd6f.js → paperclip-CFZOhV8C.js} +1 -1
  246. package/dist/public/assets/{pegDiagram-2B236MQR-DVy6JL4F.js → pegDiagram-2B236MQR-Bs6HaUdW.js} +1 -1
  247. package/dist/public/assets/pending-receive-nav-store-lElziPqC.js +1 -0
  248. package/dist/public/assets/pie-RZYD4A2V-DaewLp2Y.js +1 -0
  249. package/dist/public/assets/{pieDiagram-ENE6RG2P-Kxbx45IP.js → pieDiagram-ENE6RG2P-BBo6EMS4.js} +1 -1
  250. package/dist/public/assets/{project-paths-DdZAF_-I.js → project-paths-Cgrv2qcw.js} +1 -1
  251. package/dist/public/assets/prop-types-Bzfc0oqg.js +1 -0
  252. package/dist/public/assets/{propagation-api-OHat7V1z.js → propagation-api-DCmicIMI.js} +1 -1
  253. package/dist/public/assets/{quadrantDiagram-ABIIQ3AL-BbCFEjhq.js → quadrantDiagram-ABIIQ3AL-qmZeOoSr.js} +1 -1
  254. package/dist/public/assets/radar-I7S5WNFK-DljmjJ2C.js +1 -0
  255. package/dist/public/assets/radio-group-DFFiLDEM.js +1 -0
  256. package/dist/public/assets/railroad-3IZDKUUU-6CgLOfBJ.js +1 -0
  257. package/dist/public/assets/railroad-abnf-AHOZXSZD-DQ60e1aW.js +1 -0
  258. package/dist/public/assets/railroad-ebnf-EBAXGLYW-Da8xQ_1N.js +1 -0
  259. package/dist/public/assets/railroad-peg-LSFZ7HO6-CDOeiUF5.js +1 -0
  260. package/dist/public/assets/{railroadDiagram-RFXS5EU6-6SEpaCgo.js → railroadDiagram-RFXS5EU6-DE_EvwtV.js} +1 -1
  261. package/dist/public/assets/{receive-store-C8NL_Ow-.js → receive-store-Bz-bzj4g.js} +1 -1
  262. package/dist/public/assets/{refresh-cw-DClG_qgN.js → refresh-cw-D3t5sdqM.js} +1 -1
  263. package/dist/public/assets/{requirementDiagram-TGXJPOKE-brbJ6VUS.js → requirementDiagram-TGXJPOKE-BZ-rKt8B.js} +1 -1
  264. package/dist/public/assets/{sankeyDiagram-HTMAVEWB-DT0MK3ep.js → sankeyDiagram-HTMAVEWB-B9AZEJIc.js} +1 -1
  265. package/dist/public/assets/{schema-fields-view-intent-CDu72Aty.js → schema-fields-view-intent-SQVE5W3s.js} +1 -1
  266. package/dist/public/assets/select-DyVZCohx.js +1 -0
  267. package/dist/public/assets/{selection-context-BNYOSYyM.js → selection-context-DdcFoUdp.js} +1 -1
  268. package/dist/public/assets/{separator-DExEeoYE.js → separator-4_yBRx-q.js} +1 -1
  269. package/dist/public/assets/{sequenceDiagram-DBY2YBRQ-BPJt9blB.js → sequenceDiagram-DBY2YBRQ-DR0l3jeO.js} +1 -1
  270. package/dist/public/assets/{sizeCapture-X5ZJPWSS-1l7G4SwD.js → sizeCapture-X5ZJPWSS-CK3vwB3X.js} +1 -1
  271. package/dist/public/assets/skeleton-BlTc8h6X.js +1 -0
  272. package/dist/public/assets/skill-actions-DCU7_Sac.js +2 -0
  273. package/dist/public/assets/skill-scope-CYrWegR8.js +1 -0
  274. package/dist/public/assets/skills-api-CC0Fy08A.js +1 -0
  275. package/dist/public/assets/square-pen-wqme9vlv.js +1 -0
  276. package/dist/public/assets/{src-U1RHfo7d.js → src-BULLuFw_.js} +1 -1
  277. package/dist/public/assets/{src-CaBa9Z1L.js → src-DsJU4LsJ.js} +1 -1
  278. package/dist/public/assets/{stateDiagram-2N3HPSRC-QGlUFt6h.js → stateDiagram-2N3HPSRC-DEWfQHsO.js} +1 -1
  279. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-aJyvpelO.js +1 -0
  280. package/dist/public/assets/{swimlanes-5IMT3BWC-BHsr6MBF.js → swimlanes-5IMT3BWC-B6x4Ld9j.js} +2 -2
  281. package/dist/public/assets/swimlanesDiagram-G3AALYLV-NoFAxBaw.js +8 -0
  282. package/dist/public/assets/switch-CsstPO-E.js +1 -0
  283. package/dist/public/assets/tabs-C8ykgpIi.js +1 -0
  284. package/dist/public/assets/tag-pill-input-7XN11_mj.js +1 -0
  285. package/dist/public/assets/target-navigation-intent-D2OBNu7k.js +1 -0
  286. package/dist/public/assets/{telemetry-impl-DV07MMfz.js → telemetry-impl-D4kQ8pzt.js} +2 -2
  287. package/dist/public/assets/telemetry-startup-B15S0fJ7.js +1 -0
  288. package/dist/public/assets/terminal-input-events-B8xUcID4.js +1 -0
  289. package/dist/public/assets/terminal-launch-events-nCAKTwef.js +1 -0
  290. package/dist/public/assets/{terminal-telemetry-CvNM4wYv.js → terminal-telemetry-vp1G0ekC.js} +1 -1
  291. package/dist/public/assets/textarea-DKb-eo87.js +1 -0
  292. package/dist/public/assets/{thread-client-CSOJeVWW.js → thread-client-KM4rZX_M.js} +1 -1
  293. package/dist/public/assets/{timeline-definition-FHXFAJF6-DitS4FqW.js → timeline-definition-FHXFAJF6-DB7l9JZO.js} +1 -1
  294. package/dist/public/assets/timeline-diff-store-C89mH-2r.js +1 -0
  295. package/dist/public/assets/{toggle-group-CjXmmTGy.js → toggle-group-DMfnQ5Pd.js} +1 -1
  296. package/dist/public/assets/tooltip-DkZ6fphS.js +1 -0
  297. package/dist/public/assets/{trash-2-DE3a7L75.js → trash-2-5vqPZUBk.js} +1 -1
  298. package/dist/public/assets/treeView-QDETBFTQ-Ds4YBLMo.js +1 -0
  299. package/dist/public/assets/treemap-6X3UGDF4-D2ccHx16.js +1 -0
  300. package/dist/public/assets/{triangle-alert-Bcc1P5yx.js → triangle-alert-BwCftF1V.js} +1 -1
  301. package/dist/public/assets/typing-burst-detector-DlPntV7a.js +8 -0
  302. package/dist/public/assets/undo-2-BRIW1mxN.js +1 -0
  303. package/dist/public/assets/uninstall-BCLudTra.js +1 -0
  304. package/dist/public/assets/use-activity-panel--7zr9R-m.js +1 -0
  305. package/dist/public/assets/use-apply-config-color-theme-CFiJF3-G.js +2 -0
  306. package/dist/public/assets/use-collab-url-CVCbUQ9-.js +1 -0
  307. package/dist/public/assets/{use-live-xterm-theme-B2MdP4nP.js → use-live-xterm-theme-CAutS4BK.js} +1 -1
  308. package/dist/public/assets/use-open-skill-CxYgcPyr.js +1 -0
  309. package/dist/public/assets/use-settings-route-b4_ubAQl.js +1 -0
  310. package/dist/public/assets/use-skill-directory-DacYw073.js +1 -0
  311. package/dist/public/assets/use-skills-CQ-I1uBW.js +1 -0
  312. package/dist/public/assets/use-terminal-enabled-Czv-AS7W.js +1 -0
  313. package/dist/public/assets/use-timeline-entry-diff--zp5POjE.js +6 -0
  314. package/dist/public/assets/use-workspace-DoTTAGcg.js +1 -0
  315. package/dist/public/assets/{vennDiagram-L72KCM5P-D7jabRjK.js → vennDiagram-L72KCM5P-D6bPpaIm.js} +1 -1
  316. package/dist/public/assets/wardley-OPB4EBWU-JuWm1scq.js +1 -0
  317. package/dist/public/assets/{wardleyDiagram-EHGQE667-C3olh_ef.js → wardleyDiagram-EHGQE667-9U25ZM8P.js} +1 -1
  318. package/dist/public/assets/{wrench-4e3jxe5l.js → wrench-CqOvU1qQ.js} +1 -1
  319. package/dist/public/assets/x-C6kVbc_i.js +1 -0
  320. package/dist/public/assets/{xychartDiagram-FW5EYKEG-WqIWQJdh.js → xychartDiagram-FW5EYKEG-WSgFIUEO.js} +1 -1
  321. package/dist/public/index.html +148 -138
  322. package/dist/public/uninstall.html +26 -25
  323. package/dist/{repair-launch-json-B4Mixg6q.mjs → repair-launch-json-Chs2wXL5.mjs} +2 -2
  324. package/dist/{repair-mcp-configs-BY5NQYB4.mjs → repair-mcp-configs-DC_Nk6wf.mjs} +2 -2
  325. package/dist/repair-skills-BW5UCBvh.mjs +4 -0
  326. package/dist/repair-skills-v_TK3DOo.mjs +1 -0
  327. package/dist/server-lock-9cnBGhAH.mjs +1 -0
  328. package/dist/{server-lock-D7crxuP7.mjs → server-lock-Cdm6cZ-8.mjs} +2 -2
  329. package/dist/src-2ftHD8eU.mjs +1 -0
  330. package/dist/{src-BSwzQ3jI.mjs → src-DrNAleIl.mjs} +6 -6
  331. package/dist/{src-DmtkLnli.mjs → src-tAuEvoB8.mjs} +121 -120
  332. package/dist/src-zLMYDmwT.mjs +2030 -0
  333. package/dist/{start-ohc8chlc.mjs → start-Bx6I5bEA.mjs} +3 -3
  334. package/dist/start-MnLPFpd0.mjs +1 -0
  335. package/dist/{write-project-skill-BzhJIXSv.mjs → write-project-skill-xt4ohzdz.mjs} +4 -4
  336. package/package.json +4 -4
  337. package/dist/assets/skills/project/references/workflow-guides.md +0 -30
  338. package/dist/constants-v-GqxIIS.mjs +0 -2
  339. package/dist/git-handle-DyS9-xsk.mjs +0 -1
  340. package/dist/init-C5SNm1km.mjs +0 -1
  341. package/dist/loader-VrQIuQYj.mjs +0 -1
  342. package/dist/md-manager-BWTSpVXC.mjs +0 -2
  343. package/dist/preview-3XOV9PP-.mjs +0 -1
  344. package/dist/public/assets/ActivityModeContent-BquAhT5x.js +0 -1
  345. package/dist/public/assets/AppMenubar-DHWqgWXl.js +0 -1
  346. package/dist/public/assets/CodeMirrorPropInput-DOcEkWLX.js +0 -3
  347. package/dist/public/assets/CopyButton-1Q6Wnnjb.js +0 -1
  348. package/dist/public/assets/DocumentContext-uE-Jpe8-.js +0 -38
  349. package/dist/public/assets/EditorModeToggle-DBmNyzRU.js +0 -2
  350. package/dist/public/assets/EnableSyncConfirmDialog-Dufpw3Xm.js +0 -1
  351. package/dist/public/assets/FeedbackForm-DuHvlb9Z.js +0 -1
  352. package/dist/public/assets/ManagedArtifactProperties-xXR4EKXf.js +0 -1
  353. package/dist/public/assets/McpConsentDialogBody-CHmK7aXE.js +0 -1
  354. package/dist/public/assets/PropertyPanel-C0kyK4Hh.js +0 -2
  355. package/dist/public/assets/SchemaConfigEditor-BFx4ZhVm.js +0 -1
  356. package/dist/public/assets/SettingsDialogBody-Chz13SZG.js +0 -7
  357. package/dist/public/assets/ShareBranchSwitchDialog-jGb4KF7T.js +0 -1
  358. package/dist/public/assets/ShareReceiveDialog-C7_nVZOF.js +0 -1
  359. package/dist/public/assets/ShareReceiveMissDialog-Dv1nzqQa.js +0 -1
  360. package/dist/public/assets/SkillEditorActions-2WrfNbQp.js +0 -1
  361. package/dist/public/assets/SourceEditor-CmpVF187.js +0 -1
  362. package/dist/public/assets/TerminalSessionsHost-BcY906Hf.js +0 -2
  363. package/dist/public/assets/ThreadView-BGvk_C1z.js +0 -6
  364. package/dist/public/assets/TimelineDiffPane-C5gRZMQN.js +0 -2
  365. package/dist/public/assets/agent-diff-store-BvRAZqCN.js +0 -1
  366. package/dist/public/assets/agent-visibility-DJ6Bc0aU.js +0 -1
  367. package/dist/public/assets/architecture-TIHT7OUA-BfFQVb2N.js +0 -1
  368. package/dist/public/assets/arrow-up-right-obRIg3Sv.js +0 -1
  369. package/dist/public/assets/auth-state-cache-CEu3ZBI_.js +0 -11
  370. package/dist/public/assets/badge-DXHoKHez.js +0 -1
  371. package/dist/public/assets/button-Gol9BgNB.js +0 -1
  372. package/dist/public/assets/channel-D04u7HkE.js +0 -1
  373. package/dist/public/assets/check-GqWaoTdV.js +0 -1
  374. package/dist/public/assets/checkbox-BkZH9Oy1.js +0 -1
  375. package/dist/public/assets/chevron-left-BQ6OM94c.js +0 -1
  376. package/dist/public/assets/chevron-right-C8oTR6gu.js +0 -1
  377. package/dist/public/assets/chunk-2Q5K7J3B-Cczs20mb.js +0 -1
  378. package/dist/public/assets/chunk-VAUOI2AC-D9H5NlkH.js +0 -1
  379. package/dist/public/assets/chunk-XXDRQBXY-BjAUTr8E.js +0 -1
  380. package/dist/public/assets/classDiagram-OUVF2IWQ-BCgYs9Pk.js +0 -1
  381. package/dist/public/assets/classDiagram-v2-EOCWNBFH-BpVLL4-U.js +0 -1
  382. package/dist/public/assets/client-version-MIkctMik.js +0 -1
  383. package/dist/public/assets/collapsible-B1mS1n9y.js +0 -1
  384. package/dist/public/assets/config-context-D3FvmHZm.js +0 -1
  385. package/dist/public/assets/copy-9EDFYcyR.js +0 -1
  386. package/dist/public/assets/createLucideIcon-DAkhoPjT.js +0 -1
  387. package/dist/public/assets/cynefin-VYW2F7L2-BVFEANjh.js +0 -1
  388. package/dist/public/assets/dialog-6-bc7qPg.js +0 -5
  389. package/dist/public/assets/dist-BJa2CfR3.js +0 -1
  390. package/dist/public/assets/dist-BNcdLYQI.js +0 -1
  391. package/dist/public/assets/dist-BjDuLI_j.js +0 -1
  392. package/dist/public/assets/dist-D6h-uzOv.js +0 -1
  393. package/dist/public/assets/dist-DAU1MdSo.js +0 -1
  394. package/dist/public/assets/dist-DPWWCZ4h.js +0 -1
  395. package/dist/public/assets/dist-nHZgBxFS.js +0 -1
  396. package/dist/public/assets/doc-hash-BbU2eA08.js +0 -1
  397. package/dist/public/assets/documents-events-C-mYs64z.js +0 -1
  398. package/dist/public/assets/dropdown-menu-xw8WTdb-.js +0 -1
  399. package/dist/public/assets/es2015-BNlmLq62.js +0 -41
  400. package/dist/public/assets/eventmodeling-45OFAUF4-usNuB_rF.js +0 -1
  401. package/dist/public/assets/field-BNyAQHKf.js +0 -1
  402. package/dist/public/assets/file-tree-adapter-c4ru9pmD.js +0 -1
  403. package/dist/public/assets/file-tree-utils-Lc0SvgnU.js +0 -1
  404. package/dist/public/assets/flowDiagram-23GEKE2U-CDs0Vlps.js +0 -1
  405. package/dist/public/assets/follow-file-BVJ6G9Hs.js +0 -1
  406. package/dist/public/assets/form-gDsa08Xi.js +0 -1
  407. package/dist/public/assets/gitGraph-TEB2WS4Q-DXc_YvuI.js +0 -1
  408. package/dist/public/assets/globals-C_YoXwVm.css +0 -1
  409. package/dist/public/assets/index-DPVeWJbL.js +0 -2014
  410. package/dist/public/assets/info-DKCQHKI2-C0DL9Ht0.js +0 -1
  411. package/dist/public/assets/input-D4OPkja2.js +0 -1
  412. package/dist/public/assets/lint-config-client-DJg7YDu3.js +0 -1
  413. package/dist/public/assets/loader-circle-Cg5SU7AZ.js +0 -1
  414. package/dist/public/assets/markdownlint-rule-browser-6yvn3dt6.js +0 -1
  415. package/dist/public/assets/mermaid-GHXKKRXX-C9klxgAS.js +0 -1
  416. package/dist/public/assets/minus-CI_HyT1V.js +0 -1
  417. package/dist/public/assets/navigation-targets-DwSgIIy0.js +0 -1
  418. package/dist/public/assets/open-managed-artifact-tab-Dpz9X1m_.js +0 -1
  419. package/dist/public/assets/packet-7NZHBO7P-BpFruX6n.js +0 -1
  420. package/dist/public/assets/panel-BbxjQP3-.js +0 -1
  421. package/dist/public/assets/pending-receive-nav-store-t5K6mYGs.js +0 -1
  422. package/dist/public/assets/pie-RZYD4A2V-lVpCCOkJ.js +0 -1
  423. package/dist/public/assets/prop-types-65NJPmd-.js +0 -1
  424. package/dist/public/assets/radar-I7S5WNFK-Bd-i9axl.js +0 -1
  425. package/dist/public/assets/radio-group-CGEdWasQ.js +0 -1
  426. package/dist/public/assets/railroad-3IZDKUUU-D6ewe_eA.js +0 -1
  427. package/dist/public/assets/railroad-abnf-AHOZXSZD-DKqyYXL-.js +0 -1
  428. package/dist/public/assets/railroad-ebnf-EBAXGLYW-CtMezBX2.js +0 -1
  429. package/dist/public/assets/railroad-peg-LSFZ7HO6-DJ-63J6n.js +0 -1
  430. package/dist/public/assets/skeleton-Mo1oLtEu.js +0 -1
  431. package/dist/public/assets/skill-actions-ByBHG3Gh.js +0 -1
  432. package/dist/public/assets/skills-api-DWPhWBud.js +0 -1
  433. package/dist/public/assets/sliders-horizontal-BNv-Koqw.js +0 -1
  434. package/dist/public/assets/square-pen-C1vIlMAW.js +0 -1
  435. package/dist/public/assets/stateDiagram-v2-6OUMAXLB-D_6D-nLI.js +0 -1
  436. package/dist/public/assets/swimlanesDiagram-G3AALYLV-cqXTLbrM.js +0 -8
  437. package/dist/public/assets/switch-DYic2V-1.js +0 -1
  438. package/dist/public/assets/tag-pill-input-BHj4spSb.js +0 -1
  439. package/dist/public/assets/target-navigation-intent-B5jnqgZ_.js +0 -1
  440. package/dist/public/assets/telemetry-startup-Cy1VVosp.js +0 -1
  441. package/dist/public/assets/terminal-input-events-C5UuEsAB.js +0 -1
  442. package/dist/public/assets/terminal-launch-events-CtZeptxC.js +0 -1
  443. package/dist/public/assets/textarea-bScbzsdX.js +0 -1
  444. package/dist/public/assets/timeline-diff-store-BwCud4Ug.js +0 -1
  445. package/dist/public/assets/tooltip-B4J7VHmA.js +0 -1
  446. package/dist/public/assets/treeView-QDETBFTQ-CuznZlQn.js +0 -1
  447. package/dist/public/assets/treemap-6X3UGDF4-DCd6umeO.js +0 -1
  448. package/dist/public/assets/typing-burst-detector-CZREoy8B.js +0 -8
  449. package/dist/public/assets/uninstall-Bw4vn3K8.js +0 -1
  450. package/dist/public/assets/use-activity-panel-DWxDopZd.js +0 -1
  451. package/dist/public/assets/use-apply-config-color-theme-DSCn9I0W.js +0 -2
  452. package/dist/public/assets/use-collab-url-CE02D4PJ.js +0 -1
  453. package/dist/public/assets/use-settings-route-BX1P2p9-.js +0 -1
  454. package/dist/public/assets/use-terminal-enabled-BlXFMDFQ.js +0 -1
  455. package/dist/public/assets/use-timeline-entry-diff-BI1BVnmy.js +0 -6
  456. package/dist/public/assets/use-workspace-DcPrrukl.js +0 -1
  457. package/dist/public/assets/wardley-OPB4EBWU-DH0Qf9r4.js +0 -1
  458. package/dist/public/assets/workspace-paths-CU85-ZRd.js +0 -1
  459. package/dist/public/assets/x-Du5jsNHa.js +0 -1
  460. package/dist/repair-skills-BHY_AeM4.mjs +0 -4
  461. package/dist/repair-skills-CUT1NbJx.mjs +0 -1
  462. package/dist/server-lock-CG809RrD.mjs +0 -1
  463. package/dist/src-D4iCDwsy.mjs +0 -1
  464. package/dist/src-T1lGYBC1.mjs +0 -3275
  465. package/dist/start-btkfqkGp.mjs +0 -1
  466. /package/dist/public/assets/{ActivityPanelDiffView-DYFlG61N.js → ActivityPanelDiffView-ZX0cv7Dl.js} +0 -0
  467. /package/dist/public/assets/{__vite-browser-external-z7jTWlYs.js → __vite-browser-external-DwydhYHF.js} +0 -0
  468. /package/dist/public/assets/{agent-presence-BdWbAeV-.js → agent-presence-BcWu61SE.js} +0 -0
  469. /package/dist/public/assets/{array-CC6md2n_.js → array-DpLqdF3L.js} +0 -0
  470. /package/dist/public/assets/{chunk-KEIR6QF5-BppCe61B.js → chunk-KEIR6QF5-Bf0oDx3Z.js} +0 -0
  471. /package/dist/public/assets/{chunk-Y2CYZVJY-CP7lNZai.js → chunk-Y2CYZVJY-PbmsUfAu.js} +0 -0
  472. /package/dist/public/assets/{clike-BAopx-wt.js → clike-BrXLgO2o.js} +0 -0
  473. /package/dist/public/assets/{clipboard-adapter-ZCy01ehf.js → clipboard-adapter-B3lKEXcw.js} +0 -0
  474. /package/dist/public/assets/{colors-QyrgP4ww.js → colors-B-WRw0bG.js} +0 -0
  475. /package/dist/public/assets/{copilot-BiqH8PgI.js → copilot-BkvifxDd.js} +0 -0
  476. /package/dist/public/assets/{cursor-BDHSyD-9.js → cursor-D-FuCbK1.js} +0 -0
  477. /package/dist/public/assets/{cytoscape.esm-Ci36Fm6r.js → cytoscape.esm-BkIkmBTc.js} +0 -0
  478. /package/dist/public/assets/{defaultLocale-ByXO85kN.js → defaultLocale-DoD61tXl.js} +0 -0
  479. /package/dist/public/assets/{desktop-bridge-types-DHaZbwZ0.js → desktop-bridge-types-5ScET3Cg.js} +0 -0
  480. /package/dist/public/assets/{diff-KHO8LkSI.js → diff-DTEjW6Ec.js} +0 -0
  481. /package/dist/public/assets/{dist-B8I5m7M1.js → dist-BVbCw0G-.js} +0 -0
  482. /package/dist/public/assets/{dist-Cljnhi3D.js → dist-CA7QPULb.js} +0 -0
  483. /package/dist/public/assets/{dist-DFt8VaPU.js → dist-CF921uP8.js} +0 -0
  484. /package/dist/public/assets/{dist-Bpk5HQQh.js → dist-D4eaXg-1.js} +0 -0
  485. /package/dist/public/assets/{dist-BCZq3DKc.js → dist-DuwTJb1j.js} +0 -0
  486. /package/dist/public/assets/{documents-fetch-Db-Ikele.js → documents-fetch-AfOPbdF_.js} +0 -0
  487. /package/dist/public/assets/{external-link-Ct0_ujyY.js → external-link-LAxhzgCI.js} +0 -0
  488. /package/dist/public/assets/{file-tree-rename-validation-DDA1ck2Y.js → file-tree-rename-validation-CkkVvtpx.js} +0 -0
  489. /package/dist/public/assets/{floating-ui.dom-DxCSXcm6.js → floating-ui.dom-DQ0F0qgY.js} +0 -0
  490. /package/dist/public/assets/{format-4tjAvLkN.js → format-Bj7zR862.js} +0 -0
  491. /package/dist/public/assets/{go-7c8IMl4m.js → go-D3-a1upg.js} +0 -0
  492. /package/dist/public/assets/{init-CL1Yxhhi.js → init-D0AX7DDe.js} +0 -0
  493. /package/dist/public/assets/{isObject-5PVyZ800.js → isObject-Bs1dF4ay.js} +0 -0
  494. /package/dist/public/assets/{katex-BlgnTlTx.js → katex-DGLcd7nU.js} +0 -0
  495. /package/dist/public/assets/{lib-Iu39CNZE.js → lib-RJCjKODX.js} +0 -0
  496. /package/dist/public/assets/{libesm-WVpTb_tB.js → libesm-D5Z2fjiR.js} +0 -0
  497. /package/dist/public/assets/{lint-plugin-meta-BoxMoaxR.js → lint-plugin-meta-DEfDN-Lf.js} +0 -0
  498. /package/dist/public/assets/{lru-string-cache-7Y9kMeow.js → lru-string-cache-CHVwK1CS.js} +0 -0
  499. /package/dist/public/assets/{lua-DnREcbBQ.js → lua-B71IklsF.js} +0 -0
  500. /package/dist/public/assets/{markdownit-YwcN3EvW.js → markdownit-BIJhOARi.js} +0 -0
  501. /package/dist/public/assets/{mcp-consent-store-CDAQY6Np.js → mcp-consent-store-B7QM8uoo.js} +0 -0
  502. /package/dist/public/assets/{min-DVq-2erP.js → min-nSRrTGDE.js} +0 -0
  503. /package/dist/public/assets/{overlay-layers-Dhz8IqAf.js → overlay-layers-cTOQ-1PW.js} +0 -0
  504. /package/dist/public/assets/{panzoom.es-D0o6IaL6.js → panzoom.es-D_Inq3Bn.js} +0 -0
  505. /package/dist/public/assets/{parse-api-error-BtEL2kxi.js → parse-api-error-CqQte8A1.js} +0 -0
  506. /package/dist/public/assets/{path-BGTOauh6.js → path-rUjnF-It.js} +0 -0
  507. /package/dist/public/assets/{pdf-DLVdEoR9.js → pdf-B6i840eQ.js} +0 -0
  508. /package/dist/public/assets/{pdf.worker-Cuhr1SjJ.js → pdf.worker-BVtQmJKT.js} +0 -0
  509. /package/dist/public/assets/{perl-D6YK7dbe.js → perl-B5Ul8OcV.js} +0 -0
  510. /package/dist/public/assets/{properties-BPzWpIa7.js → properties-CWbs0haa.js} +0 -0
  511. /package/dist/public/assets/{r-tzVlUzeq.js → r-DcrAlDW2.js} +0 -0
  512. /package/dist/public/assets/{rough.esm-kQd3CdGR.js → rough.esm-BfebUORF.js} +0 -0
  513. /package/dist/public/assets/{ruby-_eAC-08N.js → ruby-i1xYQ9jV.js} +0 -0
  514. /package/dist/public/assets/{share-metadata-rows-Ds3RIKZ4.js → share-metadata-rows-aPZCgxxk.js} +0 -0
  515. /package/dist/public/assets/{shell-CRkrz4LQ.js → shell-cUw_P8eQ.js} +0 -0
  516. /package/dist/public/assets/{sortable.esm-_jt9EfAF.js → sortable.esm-ByX1chKY.js} +0 -0
  517. /package/dist/public/assets/{sql-BtxU5QDI.js → sql-xiwUJ94E.js} +0 -0
  518. /package/dist/public/assets/{src-BJaEWo8x.js → src-DkpCd49O.js} +0 -0
  519. /package/dist/public/assets/{startup-marks-CyxDWRgR.js → startup-marks-BHZdrXwz.js} +0 -0
  520. /package/dist/public/assets/{stex-EWGki41Z.js → stex-rJmw0eOd.js} +0 -0
  521. /package/dist/public/assets/{swift-BmtuXdIg.js → swift-Cl1DeyT6.js} +0 -0
  522. /package/dist/public/assets/{thread-draft-staging-CKJIG41d.js → thread-draft-staging-t1CtDp8W.js} +0 -0
  523. /package/dist/public/assets/{toml-yD0H4nkp.js → toml-B2JpJCpy.js} +0 -0
  524. /package/dist/public/assets/{trace-api-DHyWZzIa.js → trace-api-C3cW9MnH.js} +0 -0
  525. /package/dist/public/assets/{use-installed-clis-8r2iSkgN.js → use-installed-clis-BR1AXhaE.js} +0 -0
  526. /package/dist/public/assets/{useLintConfigViewMode-CyzSEZ5z.js → useLintConfigViewMode-eMibVVkV.js} +0 -0
  527. /package/dist/public/assets/{w3c-keyname-DtWCia6R.js → w3c-keyname-DKgbz_c6.js} +0 -0
@@ -0,0 +1,4 @@
1
+ import{R as e}from"./src-tAuEvoB8.mjs";import{Qn as t,Zn as n,ar as r,dr as i,fr as a,nr as o,rr as s,sr as c,tr as l}from"./src-zLMYDmwT.mjs";import{C as u,a as d,d as f,f as p,o as m,s as h,t as g}from"./write-project-skill-xt4ohzdz.mjs";import{n as _,s as v,t as y}from"./colors-BsmVIwfM.mjs";import{dirname as b,join as x,relative as S,resolve as C}from"node:path";import{existsSync as w,mkdirSync as T,readFileSync as E,readdirSync as D,rmSync as O,statSync as k,writeFileSync as A}from"node:fs";import{homedir as j}from"node:os";import{createInterface as M}from"node:readline/promises";const N={existsSync:e=>w(e),isDirectory:e=>{try{return k(e).isDirectory()}catch(e){if(e.code===`ENOENT`)return!1;throw e}},readdirSync:e=>D(e),readFileSync:e=>E(e),writeFileSync:(e,t)=>{A(e,t)},mkdirSync:(e,t)=>{T(e,t)},rmSync:(e,t)=>{O(e,t)}},P={resolveProjectBundledSkillDir:()=>c(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>c(e,{checkDesktop:!1}),readBundledVersion:()=>t(),readRecordedVersion:e=>l(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>r(e),readBundleDecision:(e,t)=>n(e,t),writeBundleDecision:(e,t,n)=>o(e,t,n),removeBundleFromDisk:(e,t)=>h(e,t)};function F(e){process.stderr.write(`${JSON.stringify(e)}\n`)}function I(e,t,n){n.rmSync(t,{recursive:!0,force:!0}),n.mkdirSync(b(t),{recursive:!0}),L(e,t,n)}function L(e,t,n){n.mkdirSync(t,{recursive:!0});for(let r of n.readdirSync(e)){let i=x(e,r),a=x(t,r);n.isDirectory(i)?L(i,a,n):n.writeFileSync(a,n.readFileSync(i))}}function R(e,t,n,r,i,a){let o=[],s=x(e,`.agents`,`skills`,t),c=!1;if(r.existsSync(s))o.push({kind:`central`,path:s,outcome:`skipped-present`});else try{I(n,s,r),c=!0,o.push({kind:`central`,path:s,outcome:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`central`,path:s,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-central-failed`,scope:`user`,path:s,error:t})}for(let c of p){let l=x(e,c.hostDir),u=x(l,`skills`,t);if(u===s){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-collapsed-with-central`});continue}if(!r.existsSync(l)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-host-absent`});continue}if(r.existsSync(u)){o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`skipped-present`});continue}try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:!1,version:a})}catch(e){let t=e instanceof Error?e.message:String(e);o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:`failed`,error:t}),i({event:`user-skill-reclaim-host-failed`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,error:t})}}return{entries:o,centralWritten:c}}function z(e,t){if(!e)return!1;try{return t.existsSync(e)?t.readFileSync(e).toString(`utf8`).includes(`# ok-mcp-`):!1}catch{return!1}}function B(e,t,n,r){let i;try{i=t.resolveProjectBundledSkillDir()}catch(e){return r({event:`project-skill-reclaim-bundle-missing`,scope:`project`,error:e instanceof Error?e.message:String(e)}),{outcome:`skipped`,reason:`bundle-missing`}}let a=[];for(let t of p){let o=x(e,t.hostDir,`skills`,`open-knowledge`),s=x(o,`SKILL.md`);if(n.existsSync(s)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`present`});continue}let c=f[t.editorId]?.projectConfigPath?.(e);if(!z(c,n)){a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`no-token`}),r({event:`project-skill-reclaim-no-token`,scope:`project`,editorId:t.editorId,path:o});continue}try{g(o,e),I(i,o,n),a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`created`}),r({event:`project-skill-reclaim-created`,scope:`project`,editorId:t.editorId,path:o})}catch(e){let n=e instanceof Error?e.message:String(e);a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:`failed`,error:n}),r({event:`project-skill-reclaim-failed`,scope:`project`,editorId:t.editorId,path:o,error:n})}}return{outcome:`done`,entries:a}}async function V(t,n,r,o){let s=e=>{n.recordEvent(e).catch(()=>{})},c=()=>new Date().toISOString(),l;try{l=await n.readBundledVersion()}catch(e){let t=e instanceof Error?e.message:String(e);return o({event:`user-skill-reclaim-version-read-failed`,scope:`user`,error:t}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:`discovery`,outcome:`failed`,reason:`version-read-failed:${t}`}),{outcome:`skipped`,reason:`version-read-failed`}}let u;try{u=await n.readRecordedVersion(t)}catch(e){o({event:`user-skill-reclaim-version-read-error`,scope:`user`,error:e instanceof Error?e.message:String(e)}),u=null}let d=[],f=null;for(let e of a)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return o({event:`user-skill-reclaim-bundle-missing`,scope:`user`,error:f??`no user-global bundles`}),s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,reason:`bundle-missing:${f}`}),{outcome:`skipped`,reason:`bundle-missing`};let p=[];for(let a of d){let s=i[a.id],c=r.existsSync(x(t,`.agents`,`skills`,s)),l=await n.readBundleDecision(t,s).catch(()=>null);if(!e(l,{installedOnDisk:c})){if(c)try{n.removeBundleFromDisk(t,a.id),o({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:a.id})}catch(e){o({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){o({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:a.id,error:e instanceof Error?e.message:String(e)})}p.push(a)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(x(t,`.agents`,`skills`,i[e.id])));if(u!==null&&u===l&&m)return o({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===a.length,_=[];for(let{id:e,sourceDir:n}of p){let a=R(t,i[e],n,r,o,l);h.push(...a.entries),_.push({id:e,centralWritten:a.centralWritten})}let v=h.some(e=>e.kind===`central`&&e.outcome===`failed`);if(g&&!v){let e=null;try{await n.writeRecordedVersion(t,l),o({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),o({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t,centralWritten:n}of _)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?n?`installed`:`skip-current`:`failed`,version:l,...e===null?{}:{reason:`state-write-failed:${e}`}})}else{let e=h.some(e=>e.kind===`host`&&e.outcome===`failed`);s({ts:c(),surface:`cli-start`,target:`cli-hosts`,outcome:`failed`,version:l,reason:g?e?`all-writes-failed`:`central-write-failed`:`bundle-unresolved`})}return{outcome:`done`,version:l,entries:h}}async function H(e){let t=e.logger??F,n=e.fs??N,r=e.home??j(),i={...P,...e.deps};if(e.reclaimDisableEnv===`1`)return t({event:`skill-repair-skipped`,reason:`reclaim-disabled`}),{status:`skipped`,reason:`reclaim-disabled`};let a=B(e.projectDir,i,n,t),o=await V(r,i,n,t),s=m(r),c=[],l=!1,u=!1;if(s.skillDirs.length>0||s.emptyDirs.length>0)if(e.confirmLegacyCleanup&&await e.confirmLegacyCleanup(s)){try{c=d(r,s)}catch(e){u=!0,t({event:`legacy-fanout-cleanup-refused`,scope:`user`,error:e instanceof Error?e.message:String(e)})}for(let e of c)t({event:`legacy-fanout-path-removed`,scope:`user`,path:e})}else l=!0,t({event:`legacy-fanout-cleanup-declined`,scope:`user`});return{status:`done`,project:a,user:o,legacySwept:c,legacyCleanupDeclined:l,legacyCleanupFailed:u}}function U(e){return e.status===`skipped`?e.reason===`reclaim-disabled`?0:1:e.project.outcome===`skipped`||e.user.outcome===`skipped`&&e.user.reason!==`version-current`&&e.user.reason!==`all-bundles-declined`||e.project.entries.some(e=>e.outcome===`failed`)||e.user.outcome===`done`&&e.user.entries.some(e=>e.outcome===`failed`)?1:0}function W(e){if(e.status===`skipped`)return`Skipped: ${e.reason}`;let t=[`Skill reclaim complete.`];if(e.project.outcome===`done`){let n=e.project.entries.filter(e=>e.outcome===`present`).length,r=e.project.entries.filter(e=>e.outcome===`created`).length,i=e.project.entries.filter(e=>e.outcome===`no-token`).length,a=e.project.entries.filter(e=>e.outcome===`failed`).length;t.push(` Project: ${n} present, ${r} created, ${i} no-token, ${a} failed.`)}else t.push(` Project: skipped (${e.project.reason}).`);if(e.user.outcome===`done`){let n=e.user.entries.filter(e=>e.outcome===`written`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-present`).length,i=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,a=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} present, ${i} skipped, ${a} failed.`)}else t.push(` User: skipped (${e.user.reason}).`);return e.legacySwept.length>0?t.push(` Cleanup: removed ${e.legacySwept.length} path(s) from a pre-0.42 install.`):e.legacyCleanupFailed?t.push(` Cleanup: failed — see logs; pre-0.42 directories left in place.`):e.legacyCleanupDeclined&&t.push(` Cleanup: declined — pre-0.42 directories left in place.`),t.join(`
2
+ `)}function G(){return new u(`repair-skills`).description("Refresh bundled SKILL.md files for installed AI editors (project-local + user-global). Runs automatically during `ok start`; this command forces an explicit sweep.").option(`-y, --yes`,`Skip the confirmation prompt for removing directories left by a pre-0.42 install.`).action(async e=>{let t=await H({projectDir:C(process.cwd()),reclaimDisableEnv:process.env.OK_RECLAIM_DISABLE??null,confirmLegacyCleanup:t=>K(t,{yes:e.yes===!0})});process.stdout.write(`${W(t)}\n`),process.exitCode=U(t)})}async function K(e,t){let n=j(),r=e=>`~/${S(n,e)}`,i=t.input??process.stdin,a=[``,y(`A previous version of OpenKnowledge installed its skill into agent tools you may never have used.`),_(`(Versions before 0.42 wrote to every host a third-party installer knew about — see issue #820.)`)];if(e.skillDirs.length>0&&a.push(``,`${y(`Remove OpenKnowledge skills:`)} ${e.skillDirs.length}`,...e.skillDirs.map(e=>` ${r(e)}`)),e.emptyDirs.length>0){let t=e.skillDirs.length>0?`Then remove these, which hold nothing else once the above are gone:`:`Remove these empty directories, left behind by that install:`;a.push(``,`${y(t)} ${e.emptyDirs.length}`,...e.emptyDirs.map(e=>` ${r(e)}`))}if(a.push(``,_(`Nothing outside these paths is touched. A directory that still holds anything is kept.`)),process.stdout.write(`${a.join(`
3
+ `)}\n`),t.yes)return!0;if(!i.isTTY)return process.stdout.write(`${v("Not a terminal — skipping cleanup. Re-run with `ok repair-skills --yes` to remove these.")}\n`),!1;let o=M({input:i,output:process.stdout});try{let e=(await o.question(`\n${y(`Remove them?`)} ${_(`[y/N] `)}`)).trim().toLowerCase();return e===`y`||e===`yes`}finally{o.close()}}export{G as n,H as t};
4
+ //# sourceMappingURL=repair-skills-BW5UCBvh.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-BW5UCBvh.mjs";export{e as repairSkills};
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-Cdm6cZ-8.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,2 +1,2 @@
1
- import"./src-DmtkLnli.mjs";import{r as e}from"./logger-B7Z8XO-z.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{closeSync as i,existsSync as a,mkdirSync as o,openSync as s,readFileSync as c,unlinkSync as l,writeFileSync as u,writeSync as d}from"node:fs";import{homedir as f,hostname as p}from"node:os";import{fileURLToPath as m}from"node:url";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??f(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=c(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{o(t(r),{recursive:!0}),u(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(m(import.meta.url)),`..`,`package.json`),n=JSON.parse(c(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===p()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(c(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==p())continue;l(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(c(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,c=`[${t}-lock]`;o(n,{recursive:!0});let f=k(n,t),m={pid:process.pid,hostname:p(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(m,null,2);for(let e=0;e<3;e++){if(!a(f))try{let e=s(f,`wx`,384);try{d(e,h)}finally{i(e)}return j(f),I(f),z({lockName:t,lockDir:n,lockPath:f})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(f,c);if(e){if(N(e)&&e.pid===process.pid)return u(f,h,{encoding:`utf-8`,mode:384}),j(f),I(f),z({lockName:t,lockDir:n,lockPath:f});if(g(e.pid))throw new O(e,f,t);D.warn({pid:e.pid,host:e.hostname},`${c} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{l(f)}catch{}}throw Error(`${c} Failed to acquire ${f} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>G({lockName:t,lockDir:n}),updatePort:e=>B({lockName:t,lockDir:n,port:e})}}function B(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,o=k(n,t);if(!a(o)){D.warn({lockPath:o},`${i} Lock file missing at ${o} during port update — skipping`);return}let s;try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:o},`${i} Corrupt lock at ${o} during port update — skipping`);return}s=e}catch{D.warn({lockPath:o},`${i} Unreadable lock at ${o} during port update — skipping`);return}if(s.pid===process.pid&&N(s)){s.port=r;try{u(o,JSON.stringify(s,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function V(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(c(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{u(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function H(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return null;let i;try{let e=JSON.parse(c(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{l(r)}catch{}return null}return i}function U(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return{status:`absent`};let i;try{i=JSON.parse(c(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o=i;if(!_(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,machineId:typeof o.machineId==`string`?o.machineId:void 0,draining:o.draining===!0?!0:void 0,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{l(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function W(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>H({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function G(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,o=k(n,t);if(M(o)){if(r){V({lockName:t,lockDir:n});return}if(a(o))try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;l(o),P.delete(o)}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to release ${o}: ${e instanceof Error?e.message:String(e)}`)}}}var K=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function q(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new K(e.existing,e.lockPath):e}}function J(e,t){B({lockName:`server`,lockDir:e,port:t})}function Y(e){return H({lockName:`server`,lockDir:e})}function X(e,t){G({lockName:`server`,lockDir:e,...t})}function Z(e){V({lockName:`server`,lockDir:e})}function Q(e,t){return W({lockName:`server`,lockDir:e,...t})}export{_ as S,E as _,X as a,v as b,O as c,V as d,H as f,T as g,B as h,Y as i,R as l,G as m,q as n,J as o,U as p,Z as r,Q as s,K as t,k as u,C as v,g as x,y};
2
- //# sourceMappingURL=server-lock-D7crxuP7.mjs.map
1
+ import"./src-tAuEvoB8.mjs";import{r as e}from"./logger-B7Z8XO-z.mjs";import{dirname as t,join as n,resolve as r}from"node:path";import{closeSync as i,existsSync as a,mkdirSync as o,openSync as s,readFileSync as c,unlinkSync as l,writeFileSync as u,writeSync as d}from"node:fs";import{homedir as f,hostname as p}from"node:os";import{fileURLToPath as m}from"node:url";import{randomUUID as h}from"node:crypto";function g(e){try{return process.kill(e,0),!0}catch(e){return!!(e&&typeof e==`object`&&`code`in e&&e.code===`EPERM`)}}function _(e){return!(typeof e!=`number`||!Number.isInteger(e)||e<2||e>2147483647)}function v(e){return new URL(e.url??``,`http://localhost`).searchParams}function y(e){let t=e?.code;return typeof t==`string`?t:void 0}const b=/^[A-Za-z0-9-]{8,64}$/;let x=null;function S(e){return n(e??f(),`.ok`,`machine-id`)}function C(n){if(n===void 0&&x!==null)return x;let r=S(n),i=null;try{let e=c(r,`utf-8`).trim();b.test(e)&&(i=e)}catch{}if(i===null){i=h();try{o(t(r),{recursive:!0}),u(r,`${i}\n`,{encoding:`utf-8`,mode:384})}catch(t){e(`machine-id`).warn({path:r,err:t},`Failed to persist ${r} — using an ephemeral per-process id; lock ownership checks will fail closed (collision) instead of recognizing this machine: ${t instanceof Error?t.message:String(t)}`)}}return n===void 0&&(x=i),i}function w(){try{let e=r(t(m(import.meta.url)),`..`,`package.json`),n=JSON.parse(c(e,`utf-8`));if(typeof n.version==`string`&&n.version.length>0)return n.version}catch{}return`0.0.0-unknown`}const T=w(),E=1,D=e(`process-lock`);var O=class extends Error{existing;lockPath;lockName;constructor(e,t,n){super(`OpenKnowledge ${n} already running on port ${e.port} (pid ${e.pid}, started ${e.startedAt}). Stop it first or use a different directory. Lock: ${t}`),this.name=`ProcessLockCollisionError`,this.existing=e,this.lockPath=t,this.lockName=n}};function k(e,t){return r(e,`${t}.lock`)}const A=new Map;function j(e){A.set(e,(A.get(e)??0)+1)}function M(e){let t=A.get(e);return t===void 0||t<=1?(A.delete(e),!0):(A.set(e,t-1),!1)}function N(e){return typeof e.machineId==`string`?e.machineId===C():e.hostname===p()}const P=new Set;let F=!1;function I(e){P.add(e),!F&&(F=!0,process.on(`exit`,()=>{for(let e of P)try{let t=JSON.parse(c(e,`utf-8`));if(t?.pid!==process.pid||typeof t.machineId==`string`&&t.machineId!==C()||t.machineId===void 0&&typeof t.hostname==`string`&&t.hostname!==p())continue;l(e)}catch{}}))}function L(e,t){try{let n=JSON.parse(c(e,`utf-8`));return n&&typeof n==`object`&&_(n.pid)?n:(D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null)}catch{return D.warn({lockPath:e},`${t} Corrupt lock file at ${e} — replacing`),null}}function R(e){let{lockName:t,lockDir:n,metadata:r}=e,c=`[${t}-lock]`;o(n,{recursive:!0});let f=k(n,t),m={pid:process.pid,hostname:p(),port:r.port,startedAt:new Date().toISOString(),worktreeRoot:r.worktreeRoot,machineId:C(),...r.kind!==void 0&&{kind:r.kind},...r.parentPid!==void 0&&{parentPid:r.parentPid},...r.capabilities!==void 0&&{capabilities:r.capabilities},protocolVersion:r.protocolVersion??1,runtimeVersion:r.runtimeVersion??T},h=JSON.stringify(m,null,2);for(let e=0;e<3;e++){if(!a(f))try{let e=s(f,`wx`,384);try{d(e,h)}finally{i(e)}return j(f),I(f),z({lockName:t,lockDir:n,lockPath:f})}catch(e){if(y(e)!==`EEXIST`)throw e}let e=L(f,c);if(e){if(N(e)&&e.pid===process.pid)return u(f,h,{encoding:`utf-8`,mode:384}),j(f),I(f),z({lockName:t,lockDir:n,lockPath:f});if(g(e.pid))throw new O(e,f,t);D.warn({pid:e.pid,host:e.hostname},`${c} Stale lock detected (pid=${e.pid}, host=${e.hostname}) — replacing`)}try{l(f)}catch{}}throw Error(`${c} Failed to acquire ${f} after 3 attempts (concurrent acquire contention).`)}function z(e){let{lockName:t,lockDir:n,lockPath:r}=e;return{lockPath:r,release:()=>G({lockName:t,lockDir:n}),updatePort:e=>B({lockName:t,lockDir:n,port:e})}}function B(e){let{lockName:t,lockDir:n,port:r}=e,i=`[${t}-lock]`,o=k(n,t);if(!a(o)){D.warn({lockPath:o},`${i} Lock file missing at ${o} during port update — skipping`);return}let s;try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:o},`${i} Corrupt lock at ${o} during port update — skipping`);return}s=e}catch{D.warn({lockPath:o},`${i} Unreadable lock at ${o} during port update — skipping`);return}if(s.pid===process.pid&&N(s)){s.port=r;try{u(o,JSON.stringify(s,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to update port in ${o}: ${e instanceof Error?e.message:String(e)}`)}}}function V(e){let{lockName:t,lockDir:n}=e,r=`[${t}-lock]`,i=k(n,t);if((A.get(i)??0)>1)return;let a;try{let e=JSON.parse(c(i,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid)){D.warn({lockPath:i},`${r} Corrupt lock at ${i} during draining mark — skipping`);return}a=e}catch(e){y(e)!==`ENOENT`&&D.warn({lockPath:i,err:e},`${r} Unreadable lock at ${i} during draining mark — skipping: ${e instanceof Error?e.message:String(e)}`);return}if(a.pid===process.pid&&N(a)&&a.draining!==!0){a.draining=!0;try{u(i,JSON.stringify(a,null,2),{encoding:`utf-8`,mode:384})}catch(e){D.warn({lockPath:i,err:e},`${r} Failed to mark ${i} draining: ${e instanceof Error?e.message:String(e)}`)}}}function H(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return null;let i;try{let e=JSON.parse(c(r,`utf-8`));if(!e||typeof e!=`object`||!_(e.pid))return null;i=e}catch{return null}if(!N(i))return null;if(!g(i.pid)){try{l(r)}catch{}return null}return i}function U(e){let{lockName:t,lockDir:n}=e,r=k(n,t);if(!a(r))return{status:`absent`};let i;try{i=JSON.parse(c(r,`utf-8`))}catch{return{status:`incompatible`,reason:`corrupt`,raw:void 0}}if(!i||typeof i!=`object`)return{status:`incompatible`,reason:`corrupt`,raw:i};let o=i;if(!_(o.pid)||typeof o.hostname!=`string`||typeof o.port!=`number`||typeof o.startedAt!=`string`||typeof o.worktreeRoot!=`string`)return{status:`incompatible`,reason:`corrupt`,raw:i};let s={pid:o.pid,hostname:o.hostname,port:o.port,startedAt:o.startedAt,worktreeRoot:o.worktreeRoot,machineId:typeof o.machineId==`string`?o.machineId:void 0,draining:o.draining===!0?!0:void 0,protocolVersion:typeof o.protocolVersion==`number`?o.protocolVersion:void 0,runtimeVersion:typeof o.runtimeVersion==`string`?o.runtimeVersion:void 0};if(!N(s))return{status:`stale`,lock:s};if(!g(s.pid)){try{l(r)}catch{}return{status:`stale`,lock:s}}return s.protocolVersion===void 0||s.runtimeVersion===void 0?{status:`incompatible`,reason:`missing-fields`,raw:i}:{status:`live`,lock:s}}async function W(e){let{lockName:t,lockDir:n}=e,r=e.timeoutMs??1e4,i=e.pollIntervalMs??100,a=e.readLock??(()=>H({lockName:t,lockDir:n})),o=e.sleep??(e=>new Promise(t=>setTimeout(t,e))),s=a();if(s===null||s.draining!==!0)return`no-drain`;let c=Date.now()+r;for(;Date.now()<c;){await o(i);let e=a();if(e===null)return`released`;if(e.draining!==!0)return`no-drain`}return`timeout`}function G(e){let{lockName:t,lockDir:n,deferUnlinkToExit:r=!1}=e,i=`[${t}-lock]`,o=k(n,t);if(M(o)){if(r){V({lockName:t,lockDir:n});return}if(a(o))try{let e=JSON.parse(c(o,`utf-8`));if(!e||typeof e!=`object`||typeof e.pid!=`number`||e.pid!==process.pid||!N(e))return;l(o),P.delete(o)}catch(e){D.warn({lockPath:o,err:e},`${i} Failed to release ${o}: ${e instanceof Error?e.message:String(e)}`)}}}var K=class extends O{constructor(e,t){super(e,t,`server`),this.name=`ServerLockCollisionError`}};function q(e,t){try{return R({lockName:`server`,lockDir:e,metadata:t}).lockPath}catch(e){throw e instanceof O&&e.lockName===`server`?new K(e.existing,e.lockPath):e}}function J(e,t){B({lockName:`server`,lockDir:e,port:t})}function Y(e){return H({lockName:`server`,lockDir:e})}function X(e,t){G({lockName:`server`,lockDir:e,...t})}function Z(e){V({lockName:`server`,lockDir:e})}function Q(e,t){return W({lockName:`server`,lockDir:e,...t})}export{_ as S,E as _,X as a,v as b,O as c,V as d,H as f,T as g,B as h,Y as i,R as l,G as m,q as n,J as o,U as p,Z as r,Q as s,K as t,k as u,C as v,g as x,y};
2
+ //# sourceMappingURL=server-lock-Cdm6cZ-8.mjs.map
@@ -0,0 +1 @@
1
+ import{Do as e,Eo as t,Ho as n,P as r,R as i,To as a,Wo as o,_s as s,d as c,es as l,l as u}from"./src-tAuEvoB8.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,Ar as y,At as b,B as x,Bi as S,Bn as C,Br as w,Bt as T,C as E,Ci as D,Cn as O,Cr as k,Ct as A,D as j,Di as M,Dn as N,Dt as P,E as F,Ei as I,En as L,Et as R,F as z,Fi as B,Fn as V,Fr as H,Ft as U,G as W,Gi as G,Gn as K,Gr as q,Gt as J,H as Y,Hi as X,Hn as Z,Hr as Q,Ht as $,I as ee,Ii as te,In as ne,Ir as re,It as ie,J as ae,Ji as oe,Jn as se,Jr as ce,Jt as le,K as ue,Ki as de,Kn as fe,Kr as pe,Kt as me,L as he,Li as ge,Ln as _e,Lr as ve,Lt as ye,M as be,Mi as xe,Mn as Se,Mr as Ce,Mt as we,N as Te,Ni as Ee,Nn as De,Nr as Oe,Nt as ke,O as Ae,Oi as je,On as Me,Ot as Ne,P as Pe,Pi as Fe,Pn as Ie,Pr as Le,Pt as Re,Q as ze,Qi as Be,Qn as Ve,Qr as He,Qt as Ue,R as We,Ri as Ge,Rn as Ke,Rr as qe,Rt as Je,S as Ye,Si as Xe,Sn as Ze,Sr as Qe,St as $e,T as et,Ti as tt,Tn as nt,Tt as rt,U as it,Ui as at,Un as ot,Ur as st,Ut as ct,V as lt,Vi as ut,Vn as dt,Vr as ft,Vt as pt,W as mt,Wi as ht,Wn as gt,Wr as _t,Wt as vt,X as yt,Xi as bt,Xn as xt,Xr as St,Xt as Ct,Y as wt,Yi as Tt,Yn as Et,Yr as Dt,Yt as Ot,Z as kt,Zi as At,Zn as jt,Zr as Mt,Zt as Nt,_ as Pt,_a as Ft,_n as It,_r as Lt,_t as Rt,a as zt,aa as Bt,ai as Vt,an as Ht,ar as Ut,at as Wt,b as Gt,bi as Kt,bn as qt,br as Jt,bt as Yt,c as Xt,ca as Zt,ci as Qt,cn as $t,cr as en,ct as tn,d as nn,da as rn,di as an,dn as on,dr as sn,ea as cn,ei as ln,en as un,er as dn,et as fn,f as pn,fa as mn,fi as hn,fn as gn,fr as _n,g as vn,ga as yn,gi as bn,gn as xn,gr as Sn,gt as Cn,h as wn,ha as Tn,hi as En,hn as Dn,hr as On,ht as kn,i as An,ia as jn,ii as Mn,in as Nn,ir as Pn,it as Fn,j as In,ji as Ln,jn as Rn,jr as zn,jt as Bn,k as Vn,ki as Hn,kn as Un,kr as Wn,kt as Gn,l as Kn,la as qn,li as Jn,ln as Yn,lr as Xn,m as Zn,ma as Qn,mi as $n,mn as er,mr as tr,n as nr,na as rr,ni as ir,nn as ar,nr as or,nt as sr,o as cr,oa as lr,oi as ur,on as dr,or as fr,ot as pr,p as mr,pa as hr,pi as gr,pn as _r,pr as vr,q as yr,qi as br,qn as xr,qr as Sr,qt as Cr,r as wr,ra as Tr,ri as Er,rn as Dr,rr as Or,rt as kr,s as Ar,sa as jr,si as Mr,sn as Nr,sr as Pr,st as Fr,t as Ir,ta as Lr,ti as Rr,tn as zr,tr as Br,tt as Vr,u as Hr,ua as Ur,ui as Wr,un as Gr,ur as Kr,v as qr,vi as Jr,vn as Yr,vr as Xr,vt as Zr,w as Qr,wi as $r,wn as ei,wt as ti,x as ni,xi as ri,xn as ii,xr as ai,xt as oi,y as si,yi as ci,yn as li,yr as ui,yt as di,z as fi,zi as pi,zn as mi,zr as hi,zt as gi}from"./src-zLMYDmwT.mjs";import{C as _i,E as vi,T as yi,_ as bi,b as xi,c as Si,d as Ci,g as wi,i as Ti,l as Ei,m as Di,n as Oi,p as ki,s as Ai,t as ji,u as Mi,v as Ni,w as Pi,x as Fi,y as Ii}from"./fs-traced-B-x7hAhD.mjs";import{a as Li,d as Ri,f as zi,i as Bi,l as Vi,n as Hi,r as Ui,t as Wi,u as Gi}from"./logger-B7Z8XO-z.mjs";import{S as Ki,_ as qi,a as Ji,c as Yi,f as Xi,g as Zi,h as Qi,i as $i,l as ea,m as ta,n as na,o as ra,p as ia,r as aa,s as oa,t as sa,u as ca,v as la,x as ua}from"./server-lock-Cdm6cZ-8.mjs";export{Zt as AGENT_ID_MAX_LEN,qn as AGENT_ID_RE,$r as AGENT_WRITE_ORIGIN,Tn as AcpPermissionStore,mn as AcpRegistry,ri as AcpThreadManager,ci as AgentFocusBroadcaster,Jr as AgentPresenceBroadcaster,tt as AgentSessionCapacityError,I as AgentSessionManager,Cn as AutoStartDisabledError,Xn as BUNDLE_IDS,Kr as BUNDLE_SCOPE,sn as BUNDLE_SKILL_NAME,C as BacklinkIndex,te as CC1Broadcaster,o as CC1_CONTRACT_VERSION,Gr as CONFIG_FILENAME,Ie as CONFLICT_MARKER_RE,Oe as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Pt as ConfigSchema,X as DEFAULT_CHECKPOINT_RETENTION,Dt as DEFAULT_EMBEDDINGS_DIMENSIONS,U as DEFAULT_PACK_ID,lt as DocumentDurabilityState,St as EMBEDDINGS_API_KEY_ENV,hr as FEATURED_AGENT_IDS,at as FILE_SYSTEM_WRITER,Ke as FILE_WATCHER_ORIGIN,st as FileEmbeddingsBackend,Nt as GIT_PREFLIGHT_FAIL_SPAN_NAME,ht as GIT_UPSTREAM_WRITER,yn as GitDirAccessError,h as GitNotAvailableError,un as GitTooOldError,Rt as HOCUSPOCUS_AUTH_REJECTION_REASONS,Zr as HocuspocusAuthRejection,di as HocuspocusAuthTokenSchema,hi as INSTALLED_AGENTS_SCHEMES,n as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,ie as LOG_MD_TEMPLATE,rt as MANAGED_RENAME_ORIGIN,Xe as MAX_ACP_THREADS,M as MAX_AGENT_SESSIONS,Fr as MCP_CONNECTION_ID_HEADER,a as MCP_SERVER_NAME,je as MIN_EVICTABLE_IDLE_MS,zr as MIN_GIT_VERSION,Y as MISSING_OK_CONFIG_MESSAGE,Ft as MalformedGitPointerError,d as McpLogger,it as MissingOkConfigError,_ as OBSERVER_SYNC_ORIGIN,on as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,s as PROTOCOL_VERSION,Wi as PinoLogger,Yi as ProcessLockCollisionError,Kn as ProjectGitInitError,R as ROLLBACK_ORIGIN,gn as ROOT_GITIGNORE_TEMPLATE,Zi as RUNTIME_VERSION,an as RemoteConfigError,G as SERVICE_WRITER,Pn as SKILL_INSTALL_EVENTS_FILE_REL,r as SKILL_STATE_TARGETS,ye as STARTER_FOLDERS,Je as STARTER_FOLDER_FRONTMATTER_FILENAME,gi as STARTER_PACKS,T as STARTER_PACK_IDS,pt as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,qi as STATE_SCHEMA_VERSION,l as SYSTEM_DOC_NAME,Cr as SeedPrerequisiteError,le as SeedRootDirError,sa as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,F as StateManifestError,mi as TagIndex,_n as USER_GLOBAL_BUNDLE_IDS,Z as UiLockCollisionError,P as __getShowAllWalkStatsForTesting,Ne as __resetShowAllWalkStatsForTesting,ea as acquireProcessLock,na as acquireServerLock,ot as acquireUiLock,Hn as applyAgentMarkdownWrite,Se as applyExternalChange,Re as applySeed,j as assertCompatibleStateManifest,ar as assertGitAvailable,qt as assertNeverDiskEvent,Kt as attachAcpThreadSocket,kn as attachIdleShutdown,qr as bootServer,xr as buildAndOpenSkill,_r as buildConfigYmlContent,ae as buildExecResult,D as buildOkMcpStdioCommand,fr as buildSkillZip,$ as buildStarterFolderFrontmatterYaml,de as buildWipTree,vr as bundleSkillMdPath,_t as canonicalProjectKey,ii as classifyEvents,ji as classifyFsPath,q as clearAllEmbeddingsKeys,He as clearContributors,ct as coercePackId,u as colorFromSeed,br as commitUpstreamImport,oe as commitWip,Tt as commitWipFromTree,Dr as compareSemver,Sn as composeEffectiveLinterConfig,Lt as composeFrontmatterSchemasConfig,V as containsConflictMarkers,Ze as contentHash,m as contributorCount,Pe as countShadowObjects,z as countStaleAgentWipRefs,ee as countWipRefs,Gn as createApiExtension,Qt as createAssetServeMiddleware,Wn as createContentFilter,y as createContentFilterAsync,pe as createEmbeddingsSecretStore,An as createEphemeralProjectDir,De as createExternalChangeHandler,pn as createFileLogger,fi as createLiveDerivedIndexExtension,ue as createMcpHttpHandler,w as createOsProbe,Te as createPersistenceExtension,E as createServer,In as createServerObserverExtension,Ee as createStreamingErrorWriter,Hi as createTestLogger,Sr as describeStoredEmbeddingsKey,vn as detectClaudeDesktopPresence,Nn as detectGit,Ae as detectProjectShape,se as detectUserSkillHosts,sr as discoverLockDirs,Jt as discoverMarkdownlintConfig,Ue as emitPreflightFailureSpan,wt as encodeDocName,yt as encodeFolderRoute,kt as encodeSkillRoute,Hr as ensureProjectGit,er as ensureProjectSkillGitignore,Fe as errorResponse,O as evictStaleTrackerEntries,b as extractHeadings,kr as extractOkBinaryPath,dt as extractWikiLinksFromMarkdown,Ht as fallbackPaths,nn as findEnclosingGitRoot,Yr as findEnclosingProjectRoot,ai as findNativeMarkdownlintFile,mr as flushFileLogger,Yt as formatAuthRejectionWire,ln as formatContributors,Rr as formatContributorsFrom,we as formatPackRationale,bt as gcCheckpointRefs,fn as getCurrentMcpLogger,Vt as getLocalDir,Zn as getLogFilePath,Ui as getLogger,wn as getLogsDir,la as getMachineId,Ii as getMeter,Tr as getMetrics,xi as getTracer,jn as handleCollabSocketError,Le as handleSpawnCursor,hn as hasForwardingHeaders,he as hasGcLogLatch,c as iconFromClientName,Bt as incrementCollabSocketFilteredError,lr as incrementServerObserverFire,Dn as initContent,At as initShadowRepo,Fi as initTelemetry,Gt as initToleranceTelemetryWriter,pr as installPrettyZodErrors,Bi as installTestLoggers,Et as installUserSkill,Wr as isAllowedApiOrigin,En as isAllowedWorkspaceHostHeader,ge as isConfigDoc,oi as isHocuspocusAuthRejectionReason,vt as isKnownPackId,Ge as isLinkIndexExcludedDoc,bn as isLoopbackAddress,pi as isManagedArtifactDoc,e as isOrphanMode,Ln as isPairedWriteOrigin,H as isPathWithinDir,ua as isProcessAlive,li as isProjectRoot,gr as isRemoteAdmitted,S as isReservedForUserTree,ei as isSelfWrite,ut as isSystemDoc,ni as isToleranceTelemetryEnabled,Ki as isValidLockPid,nt as lastKnownHash,Be as listRescueCheckpoints,J as listStarterPacks,Qn as loadCustomAgents,be as loadPrincipal,ca as lockFilePath,Li as loggerFactory,Vi as logsCurrentPath,Gi as logsPreviousPath,ce as makeLazyEmbeddingsKeyStore,aa as markServerLockDraining,mt as mountMcpAndApi,Oi as normalizeFsPath,tr as originGitHubHost,xn as packageVersionMajorMinor,$e as parseAuthRejectionWire,dr as parseGitVersion,A as parseHocuspocusAuthToken,W as parseKeepaliveConnectionId,L as pathToDocName,ke as planSeed,zt as prepareSingleFileOpen,Fn as processCommand,Wt as processUsage,xt as readAllTargets,jt as readBundleDecision,Qe as readOwnNativeRules,Xi as readProcessLock,ia as readProcessLockDetailed,x as readProjectHeadState,Q as readProjectLocalSemanticConfig,$i as readServerLock,Ve as readServerPackageVersion,p as readSkillInstallStateSnapshot,Vn as readStateManifest,dn as readTargetRecordedAt,Br as readTargetVersion,gt as readUiLock,ne as reconcile,ir as recordContributor,Ut as recordSkillInstallEvent,yr as registerAllTools,N as registerWrite,ta as releaseProcessLock,Ji as releaseServerLock,K as releaseUiLock,Me as removeLastKnownHash,jr as resetMetrics,i as resolveBundleEnabled,Pr as resolveBundledSkillDir,ur as resolveContentDir,re as resolveCursorBinaryDefault,ve as resolveCursorSpawnInvocation,Xr as resolveEffectiveLinterConfig,Mt as resolveEmbeddingsCredential,Mr as resolveLockDir,ui as resolveNativeConfigForDoc,k as resolveNativeMarkdownlintConfig,me as resolvePack,Ar as resolvePackageVersion,$n as resolveRemoteAccess,ze as resolveUiInfo,Er as restoreContributors,si as restoreLifecycleFromConflictsJson,zn as rewriteMarkdownLinksForDocumentRename,Ce as rewriteWikiLinksForDocumentRename,Nr as runAuthReposSubprocess,$t as runAuthStatusSubprocess,Ot as runCloneSubprocess,Yn as runDeviceFlowSubprocess,Vr as runWithMcpLogger,Jn as safeContentPath,Bn as safeSubdir,f as safetyCheckpoint,tn as sanitizeClientName,cn as saveInMemoryCheckpoint,Lr as saveVersion,ti as seedBasenameIndex,cr as serializeError,_i as setActiveSpanAttributes,xe as setupServerObservers,rr as shadowGit,Pi as shutdownTelemetry,Ri as spansCurrentPath,zi as spansPreviousPath,qe as spawnDetached,_e as splitMarkdownBlocks,Un as startWatcher,B as streamingProblemEvent,Mn as swapContributors,Ye as teardownToleranceTelemetryWriter,Ur as toBroadcasterKey,Ti as tracedAppendFileSync,Ai as tracedLinkSync,Si as tracedMkdir,Ei as tracedMkdirSync,Mi as tracedRename,Ci as tracedRenameSync,ki as tracedRmSync,Di as tracedRmdirSync,wi as tracedUnlinkSync,bi as tracedWriteFile,Ni as tracedWriteFileSync,Qr as trustSystemCertificates,Xt as untrackTrackedProjectSkillProjection,v as updateLastKnownHash,Qi as updateProcessLockPort,ra as updateServerLockPort,fe as updateUiLockPort,rn as validateAgentId,Ct as validateCloneInputs,en as validateSkillZip,oa as waitForServerLockDrain,ft as withHiddenWindowsConsole,yi as withSpan,vi as withSpanSync,or as writeBundleDecision,On as writeMarkdownlintRule,It as writeRootGitignoreForNewRepo,g as writeStateManifest,Or as writeTargetVersion,Rn as writeTracker};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{I as t,L as n,Mo as r,Za as i,jo as a}from"./src-DmtkLnli.mjs";import{Ca as o,Gr as s,at as c,di as l,it as u,nt as d,rt as f,un as p}from"./src-T1lGYBC1.mjs";import{K as m}from"./sleep-IcuyYCzq.mjs";import{O as h,P as g}from"./fs-traced-B-x7hAhD.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-D7crxuP7.mjs";import{t as x}from"./yazl-BafwB467.mjs";import{C as S,d as C,i as w,v as T,y as ee}from"./write-project-skill-BzhJIXSv.mjs";import{c as te}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-BladNRtA.mjs";import{D as E,E as D,S as ne,T as O,_ as k,b as re,o as ie,v as A}from"./init-CxYfITcc.mjs";import{n as ae}from"./constants-v-GqxIIS.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import"./loader-Bpd9I1fg.mjs";import"./preview-D9DiqfyY.mjs";import{execSync as oe,spawnSync as M}from"node:child_process";import{basename as N,dirname as P,isAbsolute as se,join as F,relative as ce,resolve as I,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as L,lstatSync as fe,mkdirSync as R,mkdtempSync as pe,readFileSync as z,readdirSync as me,readlinkSync as he,rmSync as ge,statSync as _e,writeFileSync as B}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 V}from"node:fs/promises";import{createHash as Oe}from"node:crypto";var H=m();const ke=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ae(e,t,n=p){if(e!==void 0&&!ke.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let je=null;function Me(e){je=e}function Ne(){return je??process.cwd()}function Pe(){return F(be(),`.ok`,`bug-reports`)}function Fe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Pe(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Ie(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(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 L(F(e,`.ok`))?Oe(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Le(){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=oe(`sw_vers -productVersion 2>/dev/null`,s({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}function Re(e,t){return ze(e,t).files}function ze(e,t){if(!L(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return z(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let n=F(e,`.ok`,`local`);return L(n)?{files:[`server.lock`,`last-spawn-error.log`,t].map(e=>F(n,e)).filter(e=>L(e))}:{files:[]}}function Ve(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:i}=r(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:i,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}/${N(t)}`,content:z(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,o=t.userLogsDir??F(be(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,i):null;R(P(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Le();c.desktop=t.desktop??null;let{files:l}=ze(s,o),{files:u}=t.projectDir?Be(t.projectDir):{files:[]},{files:d}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:l.length,lockFileCount:u.length,localSinkFileCount:d.length},`files collected`);let f=[],p=[],{ZipFile:m}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),h=new m;U({zipfile:h,files:l,prefix:`logs`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:i});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;h.addBuffer(t,n),p.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:h,name:`note.txt`,content:t.note,redact:n,bundleFiles:p,redactions:f});let g=JSON.stringify(c,null,2);h.addBuffer(Buffer.from(g,`utf8`),`sysinfo.json`),p.push(`sysinfo.json`);let _={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:p,redactions:f,sysinfo:c};h.addBuffer(Buffer.from(JSON.stringify(_,null,2),`utf8`),`MANIFEST.json`);let v=f.reduce((e,t)=>e+t.lineCount,0),y=[`# Bug Report Bundle`,``,`Generated: ${_.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${_.disciplineVersion}`,``,`## Contents`,``,...p.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,v>0?`${v} line(s) were scrubbed across ${f.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(`
1
+ import{o as e}from"./chunk-DTipWd-i.mjs";import{Ao as t,X as n,Z as r,ms as i,ps as a}from"./src-tAuEvoB8.mjs";import{Vr as o,at as s,it as c,nt as l,rt as u,si as d,vn as f,xa as p}from"./src-zLMYDmwT.mjs";import{K as m}from"./sleep-IcuyYCzq.mjs";import{O as h,P as g}from"./fs-traced-B-x7hAhD.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-Cdm6cZ-8.mjs";import{t as x}from"./yazl-BafwB467.mjs";import{C as S,d as C,i as w,v as T,y as ee}from"./write-project-skill-xt4ohzdz.mjs";import{c as te}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-B3zP-iU3.mjs";import{D as E,E as D,S as ne,T as O,_ as k,b as re,o as ie,v as A}from"./init-BSRAJcxJ.mjs";import{n as ae}from"./constants-DJEQ5lbI.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import"./loader-7F0JSi2o.mjs";import"./preview-CI4qefY8.mjs";import{execSync as oe,spawnSync as M}from"node:child_process";import{basename as N,dirname as P,isAbsolute as se,join as F,relative as ce,resolve as I,sep as le}from"node:path";import{cpSync as ue,createWriteStream as de,existsSync as L,lstatSync as fe,mkdirSync as R,mkdtempSync as pe,readFileSync as z,readdirSync as me,readlinkSync as he,rmSync as ge,statSync as _e,writeFileSync as B}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 V}from"node:fs/promises";import{createHash as Oe}from"node:crypto";var H=m();const ke=new Set([`start`,`stop`,`status`,`clean`,`ui`,`mcp`,`preview`,`lint`,`deinit`,`auth`]);function Ae(e,t,n=f){if(e!==void 0&&!ke.has(e))return null;let r=n(t);return r===null||r.distance===0?null:r.rootPath}let je=null;function Me(e){je=e}function Ne(){return je??process.cwd()}function Pe(){return F(be(),`.ok`,`bug-reports`)}function Fe(e=new Date){let t=e.toISOString().replace(/[:.]/g,`-`),n=Pe(),r=`${t}-bugreport`,i=F(n,`${r}.zip`);for(let e=2;L(i);e+=1)i=F(n,`${r}-${e}.zip`);return i}function Ie(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let e=z(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 L(F(e,`.ok`))?Oe(`sha256`).update(I(e)).digest(`hex`).slice(0,12):null}function Le(){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=oe(`sw_vers -productVersion 2>/dev/null`,o({encoding:`utf8`})).trim()}catch{}try{let t=F(__dirname,`..`,`..`,`package.json`);L(t)&&(e.okVersion=JSON.parse(z(t,`utf8`)).version)}catch{}return e}function Re(e,t){return ze(e,t).files}function ze(e,t){if(!L(t))return{files:[]};let n=me(t).filter(e=>e.endsWith(`.log`)||/\.log\.\d+$/.test(e)).map(e=>F(t,e));if(e&&n.length>0){let t=n.filter(t=>{try{return z(t,`utf8`).includes(`"project":"${e}"`)}catch{return!0}});t.length>0&&(n=t)}return{files:n}}function Be(e){let t=F(e,`.ok`,`local`);return L(t)?{files:[`server.lock`,`last-spawn-error.log`,n].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function Ve(e){let t=F(e,`.ok`,`local`,`logs`);return L(t)?{files:[`server-current.jsonl`,`server-prev.jsonl`].map(e=>F(t,e)).filter(e=>L(e))}:{files:[]}}function He(e){if(e.redact){let{redacted:t,patterns:n,lineCount:r}=i(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}/${N(t)}`,content:z(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,o=t.userLogsDir??F(be(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,i):null;R(P(r),{recursive:!0}),i?.info({projectSlug:s},`gathering diagnostic data`);let c=Le();c.desktop=t.desktop??null;let{files:l}=ze(s,o),{files:u}=t.projectDir?Be(t.projectDir):{files:[]},{files:d}=t.projectDir?Ve(t.projectDir):{files:[]};i?.info({logFileCount:l.length,lockFileCount:u.length,localSinkFileCount:d.length},`files collected`);let f=[],p=[],{ZipFile:m}=await import(`./yazl-vwTkB7U0.mjs`).then(t=>e(t.default,1)),h=new m;U({zipfile:h,files:l,prefix:`logs`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:i}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:i});for(let e of t.extraFiles??[])try{let t=z(e.sourcePath),n=`extra/${e.zipName??N(e.sourcePath)}`;h.addBuffer(t,n),p.push(n)}catch(t){i?.warn({sourcePath:e.sourcePath,err:t},`extra file unreadable; omitted from bundle`)}t.note&&He({zipfile:h,name:`note.txt`,content:t.note,redact:n,bundleFiles:p,redactions:f});let g=JSON.stringify(c,null,2);h.addBuffer(Buffer.from(g,`utf8`),`sysinfo.json`),p.push(`sysinfo.json`);let _={generatedAt:new Date().toISOString(),disciplineVersion:`1.0.0`,projectSlug:s,files:p,redactions:f,sysinfo:c};h.addBuffer(Buffer.from(JSON.stringify(_,null,2),`utf8`),`MANIFEST.json`);let v=f.reduce((e,t)=>e+t.lineCount,0),y=[`# Bug Report Bundle`,``,`Generated: ${_.generatedAt}`,`Project: ${s??`(unscoped)`}`,`Discipline version: ${_.disciplineVersion}`,``,`## Contents`,``,...p.map(e=>`- ${e}`),``,`## Privacy`,``,...n?[`This bundle was auto-redacted before packaging.`,`Patterns checked: ${a.join(`, `)}`,v>0?`${v} line(s) were scrubbed across ${f.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(`
2
2
  `);h.addBuffer(Buffer.from(y,`utf8`),`README.md`),h.end();let b=de(r);return h.outputStream.pipe(b),await new Promise((e,t)=>{b.on(`close`,e),b.on(`error`,t)}),i?.info({bundlePath:r,fileCount:p.length,redactionCount:v},`bundle written`),{zipPath:r,summary:{projectSlug:s,files:p,redactions:f,redactedLineCount:v,generatedAt:_.generatedAt}}}var We=e(x(),1),W=e(te(),1);function G(e,t){return t.length===0||!e.includes(t)?e:e.split(t).join(`<CONTENT_DIR>`)}function Ge(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function K(e,t){if(typeof e==`string`)return G(e,t.contentDir);if(Array.isArray(e))return e.map(e=>K(e,t));if(!Ge(e))return e;let n={};for(let[r,i]of Object.entries(e))n[r]=K(i,t);return n}function Ke(e,t){let n=z(e,`utf-8`);if(n.length===0)return;let r=n.endsWith(`
3
3
  `),i=n.split(`
4
4
  `),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=K(JSON.parse(n),t);a.push(JSON.stringify(e))}catch{a.push(n)}}}B(e,r?`${a.join(`
@@ -6,8 +6,8 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{I as t,L as n,Mo as r,Za as i,jo
6
6
  `))}function qe(e,t){let n=z(e,`utf-8`);if(n.trim().length!==0)try{let r=K(JSON.parse(n),t),i=n.endsWith(`
7
7
  `)?`
8
8
  `:``;B(e,`${JSON.stringify(r,null,2)}${i}`)}catch{let r=G(n,t.contentDir);r!==n&&B(e,r)}}function Je(e,t){let n=z(e,`utf-8`),r=G(n,t.contentDir);r!==n&&B(e,r)}function Ye(e){try{return me(e,{withFileTypes:!0}).filter(e=>e.isFile()).map(t=>F(e,t.name))}catch{return[]}}const Xe=new Set([`agent-presence.json`,`agent-effects.json`,`runtime.json`]);function Ze(e){return/\.log\.\d+$/.test(e)}function Qe(e){return e.endsWith(`.jsonl`)||e.endsWith(`.log`)||Ze(e)}function $e(e){let t={contentDir:e.contentDir};for(let n of[`telemetry`,`logs`,`process`])for(let r of Ye(F(e.stagingDir,n)))Qe(r)?Ke(r,t):r.endsWith(`.json`)?qe(r,t):Je(r,t);for(let n of Ye(F(e.stagingDir,`state`))){let e=N(n);n.endsWith(`.jsonl`)?Ke(n,t):Xe.has(e)?qe(n,t):Je(n,t)}}const et=[`.ok`,`local`,`telemetry`],tt=[`.ok`,`local`,`logs`],nt=[`.ok`,`local`,`loss-capture`],rt=`spans-current.jsonl`,it=`spans-prev.jsonl`,at=`server-current.jsonl`,ot=`server-prev.jsonl`,st=`loss-current.jsonl`,ct=`loss-prev.jsonl`;function lt(e){return F(e,...et,rt)}function ut(e){return F(e,...et,it)}function dt(e){return F(e,...tt,at)}function ft(e){return F(e,...tt,ot)}function pt(e){return F(e,...nt,st)}function mt(e){return F(e,...nt,ct)}const q=1e3;async function ht(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-presence`,{signal:AbortSignal.timeout(q)});return t.ok?await t.text():null}catch{return null}}async function gt(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/agent-effects`,{signal:AbortSignal.timeout(q)});return t.ok?await t.text():null}catch{return null}}async function _t(e){try{let t=await fetch(`http://127.0.0.1:${e}/api/metrics/watcher-recent`,{signal:AbortSignal.timeout(q)});return t.ok?await t.text():null}catch{return null}}function vt(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(`
9
- `)}\n`:null}catch{return null}}function yt(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=M(`git`,[`-C`,t,`log`,`--oneline`,`-50`],s({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function bt(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=M(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],s({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function xt(){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 St(){return{nodeVersion:process.version,platform:Se(),arch:ve()}}function Ct(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function wt(e){if(!L(e))return{};let t;try{t=(0,H.parse)(z(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 Tt(e){return typeof e==`boolean`?e:void 0}function Et(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return Et(e.maxBytes)}function Dt(e){let t=wt(h(`project`,e)),n=wt(h(`project-local`,e));return{enabled:Tt(n.enabled)??Tt(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Ot(e){return Oe(`sha256`).update(e).digest(`hex`)}function kt(e){let t=z(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function At(e){let t=z(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 L(e)?(R(P(t),{recursive:!0}),ue(e,t),!0):!1}function jt(e){let t=[],n=e=>{let r=me(e,{withFileTypes:!0});for(let i of r){let r=F(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Mt=new Set([`.jsonl`]);function Nt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Mt.has(e.slice(t))}const Pt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Ft(e){if(Ze(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Pt.has(e.slice(t))}function It(e){let t=[];for(let n of jt(e)){let i=Lt(e,n);if(!Ft(i))continue;let{redacted:a,patterns:o,lineCount:s}=r(z(n,`utf-8`));o.length!==0&&(B(n,a),t.push({file:i,lineCount:s,patterns:o}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Lt(e,t){return ce(e,t).split(le).join(`/`)}async function Rt(e){let r=I(e.contentDir),i=I(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??ht,s=a.fetchAgentEffects??gt,c=a.fetchWatcherRecent??_t,l=a.readShadowHead??yt,u=a.readCheckpointRefs??bt,d=a.now??(()=>new Date),f=a.okVersion??(()=>ae),p=a.readDesktopEnv??xt,m=a.readRuntime??St,h=a.isOtlpPushEnabled??Ct,g=pe(F(we(),`ok-bundle-`));try{R(F(g,`telemetry`),{recursive:!0}),R(F(g,`logs`),{recursive:!0}),R(F(g,`state`),{recursive:!0}),X(lt(i),F(g,`telemetry`,rt)),X(ut(i),F(g,`telemetry`,it)),X(dt(i),F(g,`logs`,at)),X(ft(i),F(g,`logs`,ot));for(let t of e.userLogFiles??[])X(t,F(g,`logs`,N(t)));let _=F(i,`.ok`,`local`),v=F(_,`server.lock`),y=`not-running`,b=`no server.lock`,x=null;if(L(v)){X(v,F(g,`state`,`server.lock`));try{let e=z(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`:(B(F(g,`state`,`agent-presence.json`),e),y=`running`,b=``);let t=await s(x);t!==null&&B(F(g,`state`,`agent-effects.json`),t);let n=await c(x);if(n!==null){let e=vt(n);e!==null&&B(F(g,`state`,`watcher-recent.jsonl`),e)}}let S=l(r);S!==null&&B(F(g,`state`,`shadow-head.txt`),S);let C=u(r);C!==null&&B(F(g,`state`,`checkpoint-refs.txt`),C),X(pt(i),F(g,`state`,st)),X(mt(i),F(g,`state`,ct)),X(F(_,`last-spawn-error.log`),F(g,`state`,`last-spawn-error.log`)),X(F(_,n),F(g,`state`,n)),X(F(_,t),F(g,`state`,t));let w=m(),T=p(),ee={ok:{version:f(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T}};B(F(g,`state`,`runtime.json`),`${JSON.stringify(ee,null,2)}\n`);let te=y===`running`?`running
10
- `:`not-running (${b})\n`;if(B(F(g,`state`,`server-status.txt`),te),e.processDir&&L(e.processDir)){let t=F(g,`process`);R(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let E=e.redact===!0;E&&$e({stagingDir:g,contentDir:r}),e.note&&B(F(g,`note.txt`),e.note);let D=null;e.scrubSecrets===!0&&(D=It(g));for(let t of e.extraFiles??[])X(t.sourcePath,F(g,`extra`,t.zipName??N(t.sourcePath)))||a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ne=Dt(i),O=jt(g),k=[],re=0,ie=0;for(let e of O){let t=Lt(g,e),n=_e(e).size,r=Nt(t)?kt(e):0;k.push({path:t,bytes:n,lines:r}),re+=n,t.startsWith(`telemetry/`)&&Nt(t)&&(ie+=At(e))}let A={applied:E};D!==null&&(A.secretScrub=D);let ae={schemaVersion:2,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T},contentDir:{pathSha256:Ot(r),absolutePath:E?`<CONTENT_DIR>`:r},telemetry:{localSink:ne,otlpPushEnabled:h()},redaction:A,serverStatus:y,files:k};B(F(g,`manifest.json`),`${JSON.stringify(ae,null,2)}\n`);let j=O.some(e=>{try{return z(e,`utf-8`).includes(r)}catch{return!1}}),oe={totalBytes:re,fileCount:k.length,docNameCount:ie,contentDirVisible:j,redacted:E},M=!1;return{stagingDir:g,manifest:ae,summary:oe,cleanup:()=>{M||(M=!0,ge(g,{recursive:!0,force:!0}))}}}catch(e){throw ge(g,{recursive:!0,force:!0}),e}}async function zt(e){let{collected:t,outputPath:n}=e,r=P(n);if(!L(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new We.ZipFile,a=jt(t.stagingDir);for(let e of a){let n=Lt(t.stagingDir,e);i.addFile(e,n)}i.end();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 Bt(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let t=(0,H.parse)(z(n,`utf-8`)),r=j(t)?t.content:void 0,i=j(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return I(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 I(e)}async function Vt(e,t,n){let r=Ie(t,e.logger),i=await Rt({contentDir:Bt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:Re(r,e.userLogsDir??F(be(),`.ok`,`logs`)),deps:{readDesktopEnv:n,logger:e.logger}});try{R(P(e.outputPath),{recursive:!0}),await zt({collected:i,outputPath:e.outputPath});let t=i.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:r,files:i.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:i.manifest.createdAt}}}finally{i.cleanup()}}async function Ht(e){let{projectDir:t}=e,n=e.readDesktopEnv??xt;if(e.level===`full`&&t!==void 0)return Vt(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=v(e,t);if(!L(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(z(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!_(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??b)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??y())?{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 Ut(e){return e.replace(/:\d+$/,``)}function Wt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Ut(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Ut(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Ut(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 Gt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=i(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`).filter(e=>e.length>0);if(r.length<5||r[2]!==`blob`)return null;let a,o,s,c;try{a=decodeURIComponent(r[0]),o=decodeURIComponent(r[1]),s=decodeURIComponent(r[3]),c=r.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 Kt(e){let t;try{t=new URL(e)}catch{return null}if(t.protocol!==`https:`)return null;let n=i(t.hostname);if(n===null)return null;let r=t.pathname.split(`/`);if(r.length<5||r[0]!==``||r[3]!==`tree`)return null;let a=r.slice(5);a.length===1&&a[0]===``&&a.pop();let o,s,c,l;try{o=decodeURIComponent(r[1]),s=decodeURIComponent(r[2]),c=decodeURIComponent(r[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 qt(e){let t=Gt(e);if(t)return{kind:`doc`,...t};let n=Kt(e);return n?{kind:`folder`,...n}:null}const Jt=`# >>> open-knowledge cli >>>`,Yt=`# <<< open-knowledge cli <<<`,Xt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Zt(e){return F(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Qt={existsSync:e=>L(e),readFileSync:(e,t)=>z(e,t),lstatSync:e=>fe(e),readlinkSync:e=>he(e)};function $t(e,t=Qt){let n=Zt(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 en(e){let t=e.replace(Xt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function tn(e,t,n=Qt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function nn(e){return T(e)||ee(e)||ne(e)}const rn=10*1024*1024;function an(e,t,n,r){let i=ie(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(!nn(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`?cn(a,o):e.format===`yaml`?sn(a,e.topLevelKey,o):on(a,e.topLevelKey,e.serverMapSubKey,o)}function on(e,t,n,r){let i;try{i=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=E(i,k(t,n,r));return o?(g(e,a,{mode:O(e)}),{kind:`removed`}):{kind:`not-present`}}function sn(e,t,n){let r;try{r=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,H.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=D(a);a.trim()===``||a.endsWith(`
9
+ `)}\n`:null}catch{return null}}function yt(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=M(`git`,[`-C`,t,`log`,`--oneline`,`-50`],o({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function bt(e){let t=F(e,`.git`,`ok`);if(!L(t))return null;let n=M(`git`,[`-C`,t,`for-each-ref`,`--sort=-creatordate`,`--count=50`,`--format=%(refname)%09%(creatordate:iso-strict)%09%(contents:subject)`,`refs/checkpoints/`],o({encoding:`utf-8`,timeout:2e3}));return n.error||n.status!==0?null:n.stdout??``}function xt(){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 St(){return{nodeVersion:process.version,platform:Se(),arch:ve()}}function Ct(){return process.env.OTEL_SDK_DISABLED===`false`}function J(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function wt(e){if(!L(e))return{};let t;try{t=(0,H.parse)(z(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 Tt(e){return typeof e==`boolean`?e:void 0}function Et(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:void 0}function Y(e){if(J(e))return Et(e.maxBytes)}function Dt(e){let t=wt(h(`project`,e)),n=wt(h(`project-local`,e));return{enabled:Tt(n.enabled)??Tt(t.enabled)??!0,spansMaxBytes:Y(n.spans)??Y(t.spans)??52428800,logsMaxBytes:Y(n.logs)??Y(t.logs)??26214400}}function Ot(e){return Oe(`sha256`).update(e).digest(`hex`)}function kt(e){let t=z(e),n=0;for(let e=0;e<t.length;e++)t[e]===10&&n++;return n}function At(e){let t=z(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 L(e)?(R(P(t),{recursive:!0}),ue(e,t),!0):!1}function jt(e){let t=[],n=e=>{let r=me(e,{withFileTypes:!0});for(let i of r){let r=F(e,i.name);i.isDirectory()?n(r):i.isFile()&&t.push(r)}};return n(e),t.sort()}const Mt=new Set([`.jsonl`]);function Nt(e){let t=e.lastIndexOf(`.`);return t===-1?!1:Mt.has(e.slice(t))}const Pt=new Set([`.jsonl`,`.json`,`.txt`,`.log`,`.lock`]);function Ft(e){if(Ze(e))return!0;let t=e.lastIndexOf(`.`);return t===-1?!1:Pt.has(e.slice(t))}function It(e){let t=[];for(let n of jt(e)){let r=Lt(e,n);if(!Ft(r))continue;let{redacted:a,patterns:o,lineCount:s}=i(z(n,`utf-8`));o.length!==0&&(B(n,a),t.push({file:r,lineCount:s,patterns:o}))}return{redactions:t,redactedLineCount:t.reduce((e,t)=>e+t.lineCount,0)}}function Lt(e,t){return ce(e,t).split(le).join(`/`)}async function Rt(e){let t=I(e.contentDir),i=I(e.projectDir??e.contentDir),a=e.deps??{},o=a.fetchAgentPresence??ht,s=a.fetchAgentEffects??gt,c=a.fetchWatcherRecent??_t,l=a.readShadowHead??yt,u=a.readCheckpointRefs??bt,d=a.now??(()=>new Date),f=a.okVersion??(()=>ae),p=a.readDesktopEnv??xt,m=a.readRuntime??St,h=a.isOtlpPushEnabled??Ct,g=pe(F(we(),`ok-bundle-`));try{R(F(g,`telemetry`),{recursive:!0}),R(F(g,`logs`),{recursive:!0}),R(F(g,`state`),{recursive:!0}),X(lt(i),F(g,`telemetry`,rt)),X(ut(i),F(g,`telemetry`,it)),X(dt(i),F(g,`logs`,at)),X(ft(i),F(g,`logs`,ot));for(let t of e.userLogFiles??[])X(t,F(g,`logs`,N(t)));let _=F(i,`.ok`,`local`),v=F(_,`server.lock`),y=`not-running`,b=`no server.lock`,x=null;if(L(v)){X(v,F(g,`state`,`server.lock`));try{let e=z(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`:(B(F(g,`state`,`agent-presence.json`),e),y=`running`,b=``);let t=await s(x);t!==null&&B(F(g,`state`,`agent-effects.json`),t);let n=await c(x);if(n!==null){let e=vt(n);e!==null&&B(F(g,`state`,`watcher-recent.jsonl`),e)}}let S=l(t);S!==null&&B(F(g,`state`,`shadow-head.txt`),S);let C=u(t);C!==null&&B(F(g,`state`,`checkpoint-refs.txt`),C),X(pt(i),F(g,`state`,st)),X(mt(i),F(g,`state`,ct)),X(F(_,`last-spawn-error.log`),F(g,`state`,`last-spawn-error.log`)),X(F(_,r),F(g,`state`,r)),X(F(_,n),F(g,`state`,n));let w=m(),T=p(),ee={ok:{version:f(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T}};B(F(g,`state`,`runtime.json`),`${JSON.stringify(ee,null,2)}\n`);let te=y===`running`?`running
10
+ `:`not-running (${b})\n`;if(B(F(g,`state`,`server-status.txt`),te),e.processDir&&L(e.processDir)){let t=F(g,`process`);R(t,{recursive:!0}),ue(e.processDir,t,{recursive:!0})}let E=e.redact===!0;E&&$e({stagingDir:g,contentDir:t}),e.note&&B(F(g,`note.txt`),e.note);let D=null;e.scrubSecrets===!0&&(D=It(g));for(let t of e.extraFiles??[])X(t.sourcePath,F(g,`extra`,t.zipName??N(t.sourcePath)))||a.logger?.warn({sourcePath:t.sourcePath},`extra file missing; omitted from bundle`);let ne=Dt(i),O=jt(g),k=[],re=0,ie=0;for(let e of O){let t=Lt(g,e),n=_e(e).size,r=Nt(t)?kt(e):0;k.push({path:t,bytes:n,lines:r}),re+=n,t.startsWith(`telemetry/`)&&Nt(t)&&(ie+=At(e))}let A={applied:E};D!==null&&(A.secretScrub=D);let ae={schemaVersion:2,createdAt:d().toISOString(),ok:{version:f(),nodeVersion:w.nodeVersion,platform:w.platform,arch:w.arch},host:{desktop:T},contentDir:{pathSha256:Ot(t),absolutePath:E?`<CONTENT_DIR>`:t},telemetry:{localSink:ne,otlpPushEnabled:h()},redaction:A,serverStatus:y,files:k};B(F(g,`manifest.json`),`${JSON.stringify(ae,null,2)}\n`);let j=O.some(e=>{try{return z(e,`utf-8`).includes(t)}catch{return!1}}),oe={totalBytes:re,fileCount:k.length,docNameCount:ie,contentDirVisible:j,redacted:E},M=!1;return{stagingDir:g,manifest:ae,summary:oe,cleanup:()=>{M||(M=!0,ge(g,{recursive:!0,force:!0}))}}}catch(e){throw ge(g,{recursive:!0,force:!0}),e}}async function zt(e){let{collected:t,outputPath:n}=e,r=P(n);if(!L(r))throw Error(`ok diagnose bundle: parent directory does not exist: ${r}. Create it or pass --out with an existing parent.`);let i=new We.ZipFile,a=jt(t.stagingDir);for(let e of a){let n=Lt(t.stagingDir,e);i.addFile(e,n)}i.end();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 Bt(e,t){let n=F(e,`.ok`,`config.yml`);if(L(n))try{let t=(0,H.parse)(z(n,`utf-8`)),r=j(t)?t.content:void 0,i=j(r)?r.dir:void 0;if(typeof i==`string`&&i.length>0)return I(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 I(e)}async function Vt(e,t,n){let r=Ie(t,e.logger),i=await Rt({contentDir:Bt(t,e.logger),projectDir:t,redact:e.redact,scrubSecrets:e.redact,note:e.note,extraFiles:e.extraFiles,userLogFiles:Re(r,e.userLogsDir??F(be(),`.ok`,`logs`)),deps:{readDesktopEnv:n,logger:e.logger}});try{R(P(e.outputPath),{recursive:!0}),await zt({collected:i,outputPath:e.outputPath});let t=i.manifest.redaction.secretScrub;return{zipPath:e.outputPath,summary:{level:`full`,systemWide:!1,projectSlug:r,files:i.manifest.files.map(e=>e.path),redactions:t?.redactions??[],redactedLineCount:t?.redactedLineCount??0,generatedAt:i.manifest.createdAt}}}finally{i.cleanup()}}async function Ht(e){let{projectDir:t}=e,n=e.readDesktopEnv??xt;if(e.level===`full`&&t!==void 0)return Vt(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=v(e,t);if(!L(r))return{status:`missing`,lockPath:r};let i;try{i=JSON.parse(z(r,`utf-8`))}catch{return{status:`corrupt`,lockPath:r}}if(!i||typeof i!=`object`||!_(i.pid))return{status:`corrupt`,lockPath:r};let a=i;if(!(n.isAlive??b)(a.pid))return{status:`dead-pid`,lockPath:r,lock:a};if(typeof a.machineId==`string`)return a.machineId===(n.machineId??y())?{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 Ut(e){return e.replace(/:\d+$/,``)}function Wt(e){let t=e.trim();if(!t)return null;{let e=/^https?:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`https`,hostname:Ut(e[1]),owner:e[2],name:e[3]}}{let e=/^ssh:\/\/(?:[\w.-]+@)?([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`ssh`,hostname:Ut(e[1]),owner:e[2],name:e[3]}}{let e=/^git:\/\/([^/?#]+)\/([\w.\-~%]+)\/([\w.\-~%]+?)(?:\.git)?\/?$/.exec(t);if(e)return{protocol:`git`,hostname:Ut(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 Gt(e){let n;try{n=new URL(e)}catch{return null}if(n.protocol!==`https:`)return null;let r=t(n.hostname);if(r===null)return null;let i=n.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:r,owner:a,repo:o,branch:s,path:c.join(`/`)}}function Kt(e){let n;try{n=new URL(e)}catch{return null}if(n.protocol!==`https:`)return null;let r=t(n.hostname);if(r===null)return null;let i=n.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:r,owner:o,repo:s,branch:c,path:l.join(`/`)}}function qt(e){let t=Gt(e);if(t)return{kind:`doc`,...t};let n=Kt(e);return n?{kind:`folder`,...n}:null}const Jt=`# >>> open-knowledge cli >>>`,Yt=`# <<< open-knowledge cli <<<`,Xt=/^# >>> open-knowledge cli >>>\n[\s\S]*?^# <<< open-knowledge cli <<<\n?/m;function Zt(e){return F(e,`Library`,`Application Support`,`OpenKnowledge`,`path-install.json`)}const Qt={existsSync:e=>L(e),readFileSync:(e,t)=>z(e,t),lstatSync:e=>fe(e),readlinkSync:e=>he(e)};function $t(e,t=Qt){let n=Zt(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 en(e){let t=e.replace(Xt,``);return{text:t,changed:t!==e,emptyAfter:t.trim()===``}}function tn(e,t,n=Qt){try{return n.lstatSync(e).isSymbolicLink()?n.readlinkSync(e)===t:!1}catch{return!1}}function nn(e){return T(e)||ee(e)||ne(e)}const rn=10*1024*1024;function an(e,t,n,r){let i=ie(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(!nn(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`?cn(a,o):e.format===`yaml`?sn(a,e.topLevelKey,o):on(a,e.topLevelKey,e.serverMapSubKey,o)}function on(e,t,n,r){let i;try{i=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(i,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let{text:a,changed:o}=E(i,k(t,n,r));return o?(g(e,a,{mode:O(e)}),{kind:`removed`}):{kind:`not-present`}}function sn(e,t,n){let r;try{r=z(e,`utf-8`)}catch{return{kind:`declined`,reason:`unparseable`}}if(Buffer.byteLength(r,`utf-8`)>rn)return{kind:`declined`,reason:`oversize`};let i=r.charCodeAt(0)===65279,a=i?r.slice(1):r,o=(0,H.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=D(a);a.trim()===``||a.endsWith(`
11
11
  `)?c.endsWith(`
12
12
  `)||(c=`${c}\n`):c=c.replace(/\n+$/,``),l&&(c=c.replace(/\r\n/g,`
13
13
  `).replace(/\n/g,`\r
@@ -15,6 +15,6 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{I as t,L as n,Mo as r,Za as i,jo
15
15
  `),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(`
16
16
  `)||(l=`${l}\n`):l=l.replace(/\n+$/,``),o&&(l=l.replace(/\r\n/g,`
17
17
  `).replace(/\n/g,`\r
18
- `));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:O(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(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 dn(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:f(r),command:r,isDesktop:ln(r)}}function fn(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`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(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 hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(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,_n(e),gn(e),t,String(n),un(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=mn(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(`
19
- `)}async function yn(e={}){let t=e.discover??d,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??u,a=e.resolveUsage??c,o=await t(),s=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&s.push(o)}if(e.json){let e=s.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?s:s.filter(e=>pn.has(Q(e)))))}function bn(){return new S(`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 yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??b,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 Sn(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=xn(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 Cn(e,t=b){let n=await d(),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 wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new S(`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=Sn({lockDir:l(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 yn({});return}if(n===`all`){let e=await d();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,b)&&!$(r,b)||(wn(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 Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(l(I(Ne(),n)))})}function En(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Dn(e,t){let n,r;try{n=await V(I(e)),r=await V(I(P(e)))}catch{return{kind:`not-git`}}if(!On(n,r))return{kind:`symlink-escape`};let a=F(n,`.git`),s;try{s=_e(a)}catch{return{kind:`not-git`}}if(s.isDirectory()){let e;try{e=await V(a)}catch{return{kind:`not-git`}}if(!On(e,n))return{kind:`symlink-escape`}}else if(!s.isFile())return{kind:`not-git`};let c=o(n);if(c.kind!==`repository`)return{kind:`not-git`};let l=c.repository.readRemoteUrl(`origin`);if(l.kind===`unreadable`)return{kind:`not-git`};if(l.kind===`absent`)return l.reason===`config-missing`?{kind:`not-git`}:{kind:`no-origin`};let u=l.url,d=Wt(u);if(d===null)return{kind:`non-github`};let f=i(d.hostname);if(f===null)return{kind:`non-github`};let p=f===t.host.toLowerCase(),m=d.owner.toLowerCase()===t.owner.toLowerCase(),h=d.name.toLowerCase()===t.repo.toLowerCase();return!p&&m&&h?{kind:`wrong-host`,actualHost:f}:!p||!m||!h?{kind:`wrong-repo`,actualOwner:d.owner,actualRepo:d.name}:{kind:`ok`,gitRemoteUrl:`https://${f}/${d.owner}/${d.name}.git`}}function On(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!se(n)}const kn=[{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=A(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=w(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 An(e,t,n={},r=kn){let i=[];for(let a of t){let t=C[a];for(let a of r)i.push(a.write(t,e,n))}return i}function jn(e,t,n={}){return{integrations:An(e,t,n)}}export{Fe as C,Ae as D,Me as E,zt as S,Ne as T,Kt as _,Tn as a,Ht as b,Jt as c,tn as d,Zt as f,qt as g,Gt as h,Sn as i,Xt as l,en as m,Dn as n,bn as o,$t as p,En as r,an as s,jn as t,Yt as u,Wt as v,Pe as w,Rt as x,Z as y};
20
- //# sourceMappingURL=src-BSwzQ3jI.mjs.map
18
+ `));let u=`${i?``:``}${l}`;return u!==r&&g(e,u,{mode:O(e)}),{kind:`removed`}}function ln(e){return e==null?!1:e.includes(`--type=utility`)&&e.includes(`--utility-sub-type=node.mojom.NodeService`)}function un(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 dn(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:u(r),command:r,isDesktop:ln(r)}}function fn(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`&&fn(e)?`ui-orphan`:`stale`}const pn=new Set([`running`,`desktop`,`foreign`,`ui-orphan`]);function mn(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 hn(e){return e==null?`—`:`${e.cpuPercent.toFixed(1)}% / ${e.memPercent.toFixed(1)}%`}function gn(e){return`${hn(e.server.usage)} | ${hn(e.ui?.usage??null)}`}function _n(e){return`${e.server.port===0?`(starting)`:String(e.server.port)} / ${e.ui==null||e.ui.status===`dead-pid`?`—`:String(e.ui.port)}`}function vn(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,_n(e),gn(e),t,String(n),un(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=mn(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(`
19
+ `)}async function yn(e={}){let t=e.discover??l,n=e.inspect??Z,r=e.log??(e=>console.log(e)),i=e.resolveCommand??c,a=e.resolveUsage??s,o=await t(),u=[];for(let e of o){let t=n(e,`server`),r=n(e,`ui`),o=dn(e,t,r,t.status===`missing`||t.status===`corrupt`?null:i(t.lock.pid),t.status===`missing`||t.status===`corrupt`?null:a(t.lock.pid),r.status===`missing`||r.status===`corrupt`?null:a(r.lock.pid));o!=null&&u.push(o)}if(e.json){let e=u.map(e=>({...e,displayStatus:Q(e)}));r(JSON.stringify(e,null,2));return}r(vn(e.all?u:u.filter(e=>pn.has(Q(e)))))}function bn(){return new S(`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 yn({all:t.all===!0||e===`all`,json:t.json===!0})})}function xn(e,t,n={}){let r=n.isAlive??b,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 Sn(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=xn(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 Cn(e,t=b){let n=await l(),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 wn(e){let t=Sn({lockDir:e});return t.failed.length>0&&(process.exitCode=1),t}function Tn(e){return new S(`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=Sn({lockDir:d(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 yn({});return}if(n===`all`){let e=await l();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,b)&&!$(r,b)||(wn(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 Cn(e);if(t===null){console.log(`No running open-knowledge server found with port or PID ${e}.`);return}wn(t);return}wn(d(I(Ne(),n)))})}function En(e){return{event:`mcp-config-decline`,scope:e.scope,surface:e.surface,editorId:e.editorId,reason:e.reason}}async function Dn(e,n){let r,i;try{r=await V(I(e)),i=await V(I(P(e)))}catch{return{kind:`not-git`}}if(!On(r,i))return{kind:`symlink-escape`};let a=F(r,`.git`),o;try{o=_e(a)}catch{return{kind:`not-git`}}if(o.isDirectory()){let e;try{e=await V(a)}catch{return{kind:`not-git`}}if(!On(e,r))return{kind:`symlink-escape`}}else if(!o.isFile())return{kind:`not-git`};let s=p(r);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=Wt(l);if(u===null)return{kind:`non-github`};let d=t(u.hostname);if(d===null)return{kind:`non-github`};let f=d===n.host.toLowerCase(),m=u.owner.toLowerCase()===n.owner.toLowerCase(),h=u.name.toLowerCase()===n.repo.toLowerCase();return!f&&m&&h?{kind:`wrong-host`,actualHost:d}:!f||!m||!h?{kind:`wrong-repo`,actualOwner:u.owner,actualRepo:u.name}:{kind:`ok`,gitRemoteUrl:`https://${d}/${u.owner}/${u.name}.git`}}function On(e,t){if(e===t)return!0;let n=ce(t,e);return n.length>0&&!n.startsWith(`..`)&&!se(n)}const kn=[{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=A(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=w(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 An(e,t,n={},r=kn){let i=[];for(let a of t){let t=C[a];for(let a of r)i.push(a.write(t,e,n))}return i}function jn(e,t,n={}){return{integrations:An(e,t,n)}}export{Fe as C,Ae as D,Me as E,zt as S,Ne as T,Kt as _,Tn as a,Ht as b,Jt as c,tn as d,Zt as f,qt as g,Gt as h,Sn as i,Xt as l,en as m,Dn as n,bn as o,$t as p,En as r,an as s,jn as t,Yt as u,Wt as v,Pe as w,Rt as x,Z as y};
20
+ //# sourceMappingURL=src-DrNAleIl.mjs.map