@inkeep/open-knowledge 0.43.0-beta.12 → 0.43.0-beta.13

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 (110) hide show
  1. package/dist/{acp-harness-probe-BgHjFLQm.mjs → acp-harness-probe-ByCqmbsD.mjs} +2 -2
  2. package/dist/assets/skills/discovery/SKILL.md +1 -1
  3. package/dist/assets/skills/project/SKILL.md +1 -1
  4. package/dist/cli.mjs +35 -35
  5. package/dist/constants-k1x9z874.mjs +2 -0
  6. package/dist/{git-handle-DVc_e16x.mjs → git-handle-BQBchhaT.mjs} +2 -2
  7. package/dist/git-handle-CgCHlb8d.mjs +1 -0
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-C3NPtwsW.mjs → init-DQsXw80Y.mjs} +8 -8
  10. package/dist/init-Q5f00yyT.mjs +1 -0
  11. package/dist/{launch-json-removal-CM6meUbZ.mjs → launch-json-removal-CZAv1jvE.mjs} +2 -2
  12. package/dist/{loader-C04tNzUH.mjs → loader-BeCeqNda.mjs} +2 -2
  13. package/dist/loader-D4TaTEEF.mjs +1 -0
  14. package/dist/md-manager-RI1L8gfa.mjs +2 -0
  15. package/dist/{open-browser-x3hxbl2Q.mjs → open-browser-DzAgUCZN.mjs} +2 -2
  16. package/dist/parse-worker.mjs +1 -1
  17. package/dist/preview-1B2mSgUw.mjs +1 -0
  18. package/dist/{preview-ClosMsU7.mjs → preview-_Dw3Db9A.mjs} +2 -2
  19. package/dist/public/assets/{ActivityModeContent-DTyY9FXU.js → ActivityModeContent-Caft32Vd.js} +1 -1
  20. package/dist/public/assets/{AgentDiffPane-Bxxfp6qJ.js → AgentDiffPane-Df0qkLU-.js} +1 -1
  21. package/dist/public/assets/{AgentThreadClientBinder-8RE3jaN6.js → AgentThreadClientBinder-CTEgUWNh.js} +1 -1
  22. package/dist/public/assets/{CodeMirrorPropInput-l60AOLYS.js → CodeMirrorPropInput-Cso0PRhw.js} +1 -1
  23. package/dist/public/assets/{DocumentContext-fjeyqa47.js → DocumentContext-DBWuhdCp.js} +1 -1
  24. package/dist/public/assets/{EditorModeToggle-GDxalwgx.js → EditorModeToggle-BNXpG7rF.js} +1 -1
  25. package/dist/public/assets/{EnableSyncConfirmDialog-DOhZoFqn.js → EnableSyncConfirmDialog-BTIznANH.js} +1 -1
  26. package/dist/public/assets/FeedbackForm-DDU9D8tt.js +1 -0
  27. package/dist/public/assets/{GraphPanel-CqGKHFFZ.js → GraphPanel-CgrlHWWr.js} +1 -1
  28. package/dist/public/assets/{LintConfigEditor-BeidP0ZS.js → LintConfigEditor-Ctq5lSfH.js} +1 -1
  29. package/dist/public/assets/{ManagedArtifactProperties-C2qnPc_C.js → ManagedArtifactProperties-BpYPi-b4.js} +1 -1
  30. package/dist/public/assets/{McpConsentDialogBody-DCVVVf5i.js → McpConsentDialogBody-DhngjZQA.js} +1 -1
  31. package/dist/public/assets/{MermaidDocEditor-VvwQOb4B.js → MermaidDocEditor-D2kbc4NK.js} +1 -1
  32. package/dist/public/assets/{PropertyPanel-leJifucw.js → PropertyPanel-DHZsTX3r.js} +1 -1
  33. package/dist/public/assets/{ReportBugDialogBody-COMwEXMG.js → ReportBugDialogBody-xmSVX-QG.js} +1 -1
  34. package/dist/public/assets/{SchemaConfigEditor-BRNDxRDK.js → SchemaConfigEditor-BKOYyQt7.js} +1 -1
  35. package/dist/public/assets/{SettingsDialogBody-CSDS-xUd.js → SettingsDialogBody-BGUPoYMW.js} +1 -1
  36. package/dist/public/assets/{ShareBranchSwitchDialog-Be_ikX3U.js → ShareBranchSwitchDialog-BhHuyb7L.js} +1 -1
  37. package/dist/public/assets/{ShareReceiveDialog-DCirAvNX.js → ShareReceiveDialog-5coq0aKX.js} +1 -1
  38. package/dist/public/assets/{ShareReceiveMissDialog-CKJanT1o.js → ShareReceiveMissDialog-DCoXgT3O.js} +1 -1
  39. package/dist/public/assets/{SkillEditorActions-DEUAXwsS.js → SkillEditorActions-u7-TVviY.js} +1 -1
  40. package/dist/public/assets/{SourceEditor-B3Zags19.js → SourceEditor-DYWv57uN.js} +1 -1
  41. package/dist/public/assets/{TerminalPanel-oJlqWfg_.js → TerminalPanel-GSkaDXhO.js} +1 -1
  42. package/dist/public/assets/{TerminalSessionsHost-Dmc13JMj.js → TerminalSessionsHost-DFK7SKXj.js} +2 -2
  43. package/dist/public/assets/{TerminalWindowApp-Cvp7LIIo.js → TerminalWindowApp-BE8T-nBp.js} +1 -1
  44. package/dist/public/assets/{ThreadView-Dppq800p.js → ThreadView-DXtF-UeZ.js} +1 -1
  45. package/dist/public/assets/{TimelineDiffPane-D7kfdSjy.js → TimelineDiffPane-Dd90Gidv.js} +1 -1
  46. package/dist/public/assets/{agent-diff-store-DjqU974o.js → agent-diff-store-D1nhdJoB.js} +1 -1
  47. package/dist/public/assets/{agent-visibility-DwgKcief.js → agent-visibility-BdXqjex3.js} +1 -1
  48. package/dist/public/assets/{auth-state-cache-BiS-D1lf.js → auth-state-cache-D2opY-FF.js} +1 -1
  49. package/dist/public/assets/{client-version-CiP-0dVd.js → client-version-BM5GE9Bo.js} +1 -1
  50. package/dist/public/assets/{config-provider-CjJvrDDE.js → config-provider-D0FL7RXj.js} +1 -1
  51. package/dist/public/assets/{dist-Dy_AcDw1.js → dist-DJVm0s5Q.js} +1 -1
  52. package/dist/public/assets/{doc-hash-BdV88vcj.js → doc-hash-CzVDYRfE.js} +1 -1
  53. package/dist/public/assets/{documents-events-BAIUMeoV.js → documents-events-Bo_vtEwF.js} +1 -1
  54. package/dist/public/assets/{file-tree-adapter-D0NWSXoJ.js → file-tree-adapter-BqoVN_LL.js} +1 -1
  55. package/dist/public/assets/{file-tree-utils-B8b9V0n0.js → file-tree-utils-DMD__4-l.js} +1 -1
  56. package/dist/public/assets/{index-DbaJHLyE.js → index-CWRnTo0h.js} +7 -7
  57. package/dist/public/assets/{lint-config-client-CH1qsPNu.js → lint-config-client-DHqwjtcr.js} +1 -1
  58. package/dist/public/assets/{markdownlint-rule-browser-AmXtD-fs.js → markdownlint-rule-browser-CXOqtMRz.js} +1 -1
  59. package/dist/public/assets/{navigation-targets-C3sNqw3g.js → navigation-targets-yk_ftK5e.js} +1 -1
  60. package/dist/public/assets/{open-managed-artifact-tab-C7wtEJar.js → open-managed-artifact-tab-BKDY8Ljl.js} +1 -1
  61. package/dist/public/assets/{pending-receive-nav-store-BcQmTo2I.js → pending-receive-nav-store-BFkHLr4z.js} +1 -1
  62. package/dist/public/assets/{prop-types-CAsp_PWO.js → prop-types-C4C0yVjX.js} +1 -1
  63. package/dist/public/assets/{receive-store-BIIex-pm.js → receive-store-3GZiQlZq.js} +1 -1
  64. package/dist/public/assets/{selection-context-C8e6ddQj.js → selection-context-Cb5R_n8T.js} +1 -1
  65. package/dist/public/assets/{skill-actions-D7uC669s.js → skill-actions-DrS0GWjR.js} +1 -1
  66. package/dist/public/assets/{skills-api-vWkq9Yjo.js → skills-api-CcJW9MXE.js} +1 -1
  67. package/dist/public/assets/{src-a1jjnmLx.js → src-DHoFr5NH.js} +1 -1
  68. package/dist/public/assets/{tag-pill-input-j7vcpHkn.js → tag-pill-input-6LF5Ew7c.js} +1 -1
  69. package/dist/public/assets/{target-navigation-intent-CCGRxmXY.js → target-navigation-intent-B9S3uLuM.js} +1 -1
  70. package/dist/public/assets/{terminal-launch-events-CscqI70y.js → terminal-launch-events-qFzt0nab.js} +1 -1
  71. package/dist/public/assets/{terminal-telemetry-5Zc01ltO.js → terminal-telemetry-CN5zh704.js} +1 -1
  72. package/dist/public/assets/{typing-burst-detector-Dp8-M7c1.js → typing-burst-detector-BtpWDk3c.js} +1 -1
  73. package/dist/public/assets/{uninstall-BN1Dwiyt.js → uninstall-CYjxBKsK.js} +1 -1
  74. package/dist/public/assets/{use-activity-panel-CX2qZrsh.js → use-activity-panel-CJo_D7xH.js} +1 -1
  75. package/dist/public/assets/{use-apply-config-color-theme-C2A3lnBb.js → use-apply-config-color-theme-BJoYMJ5D.js} +1 -1
  76. package/dist/public/assets/{use-collab-url-Bjga3UtC.js → use-collab-url-CaRb8gBS.js} +1 -1
  77. package/dist/public/assets/{use-live-xterm-theme-DtwirM18.js → use-live-xterm-theme-D38mA6sa.js} +1 -1
  78. package/dist/public/assets/{use-settings-route-Bj2nnlZ8.js → use-settings-route-B1YAIjw7.js} +1 -1
  79. package/dist/public/assets/{use-terminal-enabled-BPY8wWAz.js → use-terminal-enabled-Co0iiHJG.js} +1 -1
  80. package/dist/public/assets/{use-timeline-entry-diff-Ck0qhFbw.js → use-timeline-entry-diff-DVXnI1OV.js} +1 -1
  81. package/dist/public/assets/{use-workspace-OvayPn9b.js → use-workspace-JLsRReFz.js} +1 -1
  82. package/dist/public/assets/{workspace-paths-CMbhJ0Qw.js → workspace-paths-Bg75xrRc.js} +1 -1
  83. package/dist/public/index.html +35 -35
  84. package/dist/public/uninstall.html +2 -2
  85. package/dist/{repair-launch-json-nrZcDedG.mjs → repair-launch-json-By9LDC45.mjs} +2 -2
  86. package/dist/{repair-mcp-configs-B-w0_Ypd.mjs → repair-mcp-configs-CDJq4Ve2.mjs} +2 -2
  87. package/dist/{repair-skills-BFa2XhCq.mjs → repair-skills-5K_XeFog.mjs} +2 -2
  88. package/dist/repair-skills-Cjwz2l5i.mjs +1 -0
  89. package/dist/{server-lock-Bcq0DSDG.mjs → server-lock-CE0z40lI.mjs} +2 -2
  90. package/dist/server-lock-DsOeCfiP.mjs +1 -0
  91. package/dist/{src-Qy3Q9khT.mjs → src-BVK8_kFb.mjs} +4 -4
  92. package/dist/src-BmUGNQeQ.mjs +1 -0
  93. package/dist/src-DeZ1D7q7.mjs +3275 -0
  94. package/dist/{src-mKEMutrR.mjs → src-H4ZV7b5v.mjs} +2 -2
  95. package/dist/{start-DnZSgRiQ.mjs → start-CC_NUunW.mjs} +3 -3
  96. package/dist/start-CcYGWRIZ.mjs +1 -0
  97. package/dist/{write-project-skill-CxSRoBP1.mjs → write-project-skill-C6Fs5yeK.mjs} +2 -2
  98. package/package.json +4 -4
  99. package/dist/constants-DTOl3SVx.mjs +0 -2
  100. package/dist/git-handle-B6bZ5eA-.mjs +0 -1
  101. package/dist/init-jbPJEXNL.mjs +0 -1
  102. package/dist/loader-BU3hvpWJ.mjs +0 -1
  103. package/dist/md-manager-BVVrP2b0.mjs +0 -2
  104. package/dist/preview-BN_4v6qg.mjs +0 -1
  105. package/dist/public/assets/FeedbackForm-Bn8T7vX5.js +0 -1
  106. package/dist/repair-skills-BCXH2Jcm.mjs +0 -1
  107. package/dist/server-lock-DRXm0IHt.mjs +0 -1
  108. package/dist/src-BqSmDSx1.mjs +0 -3275
  109. package/dist/src-CmqNHCBD.mjs +0 -1
  110. package/dist/start-lTKiBdT-.mjs +0 -1
@@ -58,7 +58,7 @@
58
58
  -->
59
59
  <script>(() => { let t = 'system'; try { const r = localStorage.getItem('ok-theme-v1'); if (r === 'light' || r === 'dark' || r === 'system') t = r; } catch {} let ct = null; try { const c = localStorage.getItem('ok-color-theme-v1'); if (c && ['dracula', 'catppuccin-frappe', 'catppuccin-latte', 'monokai', 'gruvbox', 'solarized', 'custom'].includes(c)) ct = c; } catch {} let dark = t === 'dark'; if (t === 'system') { try { dark = window.matchMedia('(prefers-color-scheme: dark)').matches; } catch {} } let customCss = null; if (ct === 'custom') { try { const raw = localStorage.getItem('ok-custom-theme-v1'); if (raw) { const o = JSON.parse(raw); if (o?.css) { customCss = o.css; dark = !!o.dark; } } } catch {} if (!customCss) ct = null; } else if (ct) { dark = !['catppuccin-latte'].includes(ct); } if (dark) document.documentElement.classList.add('dark'); if (ct) document.documentElement.setAttribute('data-color-theme', ct); if (customCss) { const s = document.createElement('style'); s.id = 'ok-custom-theme'; s.textContent = customCss; document.head.appendChild(s); } if (window.okDesktop) { document.documentElement.classList.add('electron-mode'); document.documentElement.classList.add(`electron-platform-${window.okDesktop.platform}`); } })();</script>
60
60
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
61
- <script type="module" crossorigin src="./assets/index-DbaJHLyE.js"></script>
61
+ <script type="module" crossorigin src="./assets/index-CWRnTo0h.js"></script>
62
62
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
63
63
  <link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
64
64
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
@@ -79,14 +79,14 @@
79
79
  <link rel="modulepreload" crossorigin href="./assets/trace-api-DHyWZzIa.js">
80
80
  <link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
81
81
  <link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
82
- <link rel="modulepreload" crossorigin href="./assets/dist-Dy_AcDw1.js">
82
+ <link rel="modulepreload" crossorigin href="./assets/dist-DJVm0s5Q.js">
83
83
  <link rel="modulepreload" crossorigin href="./assets/dist-PQ5KMVDh.js">
84
84
  <link rel="modulepreload" crossorigin href="./assets/compiler-runtime-BfE3aGVn.js">
85
85
  <link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
86
- <link rel="modulepreload" crossorigin href="./assets/client-version-CiP-0dVd.js">
87
- <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-C2A3lnBb.js">
86
+ <link rel="modulepreload" crossorigin href="./assets/client-version-BM5GE9Bo.js">
87
+ <link rel="modulepreload" crossorigin href="./assets/use-apply-config-color-theme-BJoYMJ5D.js">
88
88
  <link rel="modulepreload" crossorigin href="./assets/config-context-gd3BC-iY.js">
89
- <link rel="modulepreload" crossorigin href="./assets/config-provider-CjJvrDDE.js">
89
+ <link rel="modulepreload" crossorigin href="./assets/config-provider-D0FL7RXj.js">
90
90
  <link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
91
91
  <link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
92
92
  <link rel="modulepreload" crossorigin href="./assets/createLucideIcon-DAkhoPjT.js">
@@ -124,20 +124,20 @@
124
124
  <link rel="modulepreload" crossorigin href="./assets/folder-open-wLd69QUc.js">
125
125
  <link rel="modulepreload" crossorigin href="./assets/trash-2-BUuL4OCw.js">
126
126
  <link rel="modulepreload" crossorigin href="./assets/triangle-alert-Clgvyc7B.js">
127
- <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-B8b9V0n0.js">
128
- <link rel="modulepreload" crossorigin href="./assets/doc-hash-BdV88vcj.js">
129
- <link rel="modulepreload" crossorigin href="./assets/navigation-targets-C3sNqw3g.js">
127
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-utils-DMD__4-l.js">
128
+ <link rel="modulepreload" crossorigin href="./assets/doc-hash-CzVDYRfE.js">
129
+ <link rel="modulepreload" crossorigin href="./assets/navigation-targets-yk_ftK5e.js">
130
130
  <link rel="modulepreload" crossorigin href="./assets/external-link-T4Nj1gcG.js">
131
131
  <link rel="modulepreload" crossorigin href="./assets/documents-fetch-CLL0O1of.js">
132
- <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-l60AOLYS.js">
132
+ <link rel="modulepreload" crossorigin href="./assets/CodeMirrorPropInput-Cso0PRhw.js">
133
133
  <link rel="modulepreload" crossorigin href="./assets/git-branch-CMJAiYLz.js">
134
134
  <link rel="modulepreload" crossorigin href="./assets/copy-9EDFYcyR.js">
135
135
  <link rel="modulepreload" crossorigin href="./assets/CopyButton-1Q6Wnnjb.js">
136
- <link rel="modulepreload" crossorigin href="./assets/documents-events-BAIUMeoV.js">
136
+ <link rel="modulepreload" crossorigin href="./assets/documents-events-Bo_vtEwF.js">
137
137
  <link rel="modulepreload" crossorigin href="./assets/parse-api-error-C_gwkKmG.js">
138
138
  <link rel="modulepreload" crossorigin href="./assets/startup-marks-CqVzdU1y.js">
139
- <link rel="modulepreload" crossorigin href="./assets/prop-types-CAsp_PWO.js">
140
- <link rel="modulepreload" crossorigin href="./assets/workspace-paths-CMbhJ0Qw.js">
139
+ <link rel="modulepreload" crossorigin href="./assets/prop-types-C4C0yVjX.js">
140
+ <link rel="modulepreload" crossorigin href="./assets/workspace-paths-Bg75xrRc.js">
141
141
  <link rel="modulepreload" crossorigin href="./assets/eye-CASw1HTi.js">
142
142
  <link rel="modulepreload" crossorigin href="./assets/hash-DNKDqZ18.js">
143
143
  <link rel="modulepreload" crossorigin href="./assets/info-yKMseklR.js">
@@ -148,17 +148,17 @@
148
148
  <link rel="modulepreload" crossorigin href="./assets/file-tree-rename-validation-wADtjYEi.js">
149
149
  <link rel="modulepreload" crossorigin href="./assets/badge-Dba4cvJR.js">
150
150
  <link rel="modulepreload" crossorigin href="./assets/input-D0ZW0Opq.js">
151
- <link rel="modulepreload" crossorigin href="./assets/use-collab-url-Bjga3UtC.js">
152
- <link rel="modulepreload" crossorigin href="./assets/DocumentContext-fjeyqa47.js">
151
+ <link rel="modulepreload" crossorigin href="./assets/use-collab-url-CaRb8gBS.js">
152
+ <link rel="modulepreload" crossorigin href="./assets/DocumentContext-DBWuhdCp.js">
153
153
  <link rel="modulepreload" crossorigin href="./assets/dist-ChSSPf9y.js">
154
154
  <link rel="modulepreload" crossorigin href="./assets/dist-CslAqn54.js">
155
155
  <link rel="modulepreload" crossorigin href="./assets/format-CejNFduS.js">
156
156
  <link rel="modulepreload" crossorigin href="./assets/braces-DwnwFx_V.js">
157
- <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-C7wtEJar.js">
158
- <link rel="modulepreload" crossorigin href="./assets/lint-config-client-CH1qsPNu.js">
159
- <link rel="modulepreload" crossorigin href="./assets/selection-context-C8e6ddQj.js">
160
- <link rel="modulepreload" crossorigin href="./assets/PropertyPanel-leJifucw.js">
161
- <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-DOhZoFqn.js">
157
+ <link rel="modulepreload" crossorigin href="./assets/open-managed-artifact-tab-BKDY8Ljl.js">
158
+ <link rel="modulepreload" crossorigin href="./assets/lint-config-client-DHqwjtcr.js">
159
+ <link rel="modulepreload" crossorigin href="./assets/selection-context-Cb5R_n8T.js">
160
+ <link rel="modulepreload" crossorigin href="./assets/PropertyPanel-DHZsTX3r.js">
161
+ <link rel="modulepreload" crossorigin href="./assets/EnableSyncConfirmDialog-BTIznANH.js">
162
162
  <link rel="modulepreload" crossorigin href="./assets/arrow-up-right-obRIg3Sv.js">
163
163
  <link rel="modulepreload" crossorigin href="./assets/cursor-B8rehP9c.js">
164
164
  <link rel="modulepreload" crossorigin href="./assets/RegisteredAgentIcon-C2dU04N7.js">
@@ -166,41 +166,41 @@
166
166
  <link rel="modulepreload" crossorigin href="./assets/chevron-left-BQ6OM94c.js">
167
167
  <link rel="modulepreload" crossorigin href="./assets/refresh-cw-BfeWGCsv.js">
168
168
  <link rel="modulepreload" crossorigin href="./assets/copilot-CjOGWDvv.js">
169
- <link rel="modulepreload" crossorigin href="./assets/agent-visibility-DwgKcief.js">
170
- <link rel="modulepreload" crossorigin href="./assets/use-settings-route-Bj2nnlZ8.js">
169
+ <link rel="modulepreload" crossorigin href="./assets/agent-visibility-BdXqjex3.js">
170
+ <link rel="modulepreload" crossorigin href="./assets/use-settings-route-B1YAIjw7.js">
171
171
  <link rel="modulepreload" crossorigin href="./assets/clipboard-adapter-Cxzkvc1d.js">
172
- <link rel="modulepreload" crossorigin href="./assets/skills-api-vWkq9Yjo.js">
173
- <link rel="modulepreload" crossorigin href="./assets/use-workspace-OvayPn9b.js">
174
- <link rel="modulepreload" crossorigin href="./assets/skill-actions-D7uC669s.js">
172
+ <link rel="modulepreload" crossorigin href="./assets/skills-api-CcJW9MXE.js">
173
+ <link rel="modulepreload" crossorigin href="./assets/use-workspace-JLsRReFz.js">
174
+ <link rel="modulepreload" crossorigin href="./assets/skill-actions-DrS0GWjR.js">
175
175
  <link rel="modulepreload" crossorigin href="./assets/square-pen-C1vIlMAW.js">
176
176
  <link rel="modulepreload" crossorigin href="./assets/field-DVIFAnvR.js">
177
177
  <link rel="modulepreload" crossorigin href="./assets/textarea-tdCJViKf.js">
178
- <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-BiS-D1lf.js">
178
+ <link rel="modulepreload" crossorigin href="./assets/auth-state-cache-D2opY-FF.js">
179
179
  <link rel="modulepreload" crossorigin href="./assets/miss-dialog-store-Bx4JLuKB.js">
180
- <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-BcQmTo2I.js">
181
- <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-CscqI70y.js">
180
+ <link rel="modulepreload" crossorigin href="./assets/pending-receive-nav-store-BFkHLr4z.js">
181
+ <link rel="modulepreload" crossorigin href="./assets/terminal-launch-events-qFzt0nab.js">
182
182
  <link rel="modulepreload" crossorigin href="./assets/panel-right-open-B7ziq39V.js">
183
183
  <link rel="modulepreload" crossorigin href="./assets/timeline-diff-store-CYckprSS.js">
184
184
  <link rel="modulepreload" crossorigin href="./assets/form-coxG-8Qw.js">
185
- <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-GDxalwgx.js">
185
+ <link rel="modulepreload" crossorigin href="./assets/EditorModeToggle-BNXpG7rF.js">
186
186
  <link rel="modulepreload" crossorigin href="./assets/wrench-BfoTvqT9.js">
187
187
  <link rel="modulepreload" crossorigin href="./assets/lint-plugin-meta-J-wb-uxW.js">
188
188
  <link rel="modulepreload" crossorigin href="./assets/panel-C8ZhM4q-.js">
189
189
  <link rel="modulepreload" crossorigin href="./assets/skeleton-BG12Hmzn.js">
190
- <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-Dp8-M7c1.js">
190
+ <link rel="modulepreload" crossorigin href="./assets/typing-burst-detector-BtpWDk3c.js">
191
191
  <link rel="modulepreload" crossorigin href="./assets/ConfigSharingInfoTooltip-DMbsfWD9.js">
192
192
  <link rel="modulepreload" crossorigin href="./assets/project-paths-Dwo4Of8C.js">
193
193
  <link rel="modulepreload" crossorigin href="./assets/follow-file-BghdVu5J.js">
194
- <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-D0NWSXoJ.js">
195
- <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-DjqU974o.js">
196
- <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-CCGRxmXY.js">
197
- <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-DtwirM18.js">
194
+ <link rel="modulepreload" crossorigin href="./assets/file-tree-adapter-BqoVN_LL.js">
195
+ <link rel="modulepreload" crossorigin href="./assets/agent-diff-store-D1nhdJoB.js">
196
+ <link rel="modulepreload" crossorigin href="./assets/target-navigation-intent-B9S3uLuM.js">
197
+ <link rel="modulepreload" crossorigin href="./assets/use-live-xterm-theme-D38mA6sa.js">
198
198
  <link rel="modulepreload" crossorigin href="./assets/use-installed-clis-UlK7P1aH.js">
199
- <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-5Zc01ltO.js">
199
+ <link rel="modulepreload" crossorigin href="./assets/terminal-telemetry-CN5zh704.js">
200
200
  <link rel="modulepreload" crossorigin href="./assets/agent-presence-CEfNcJUY.js">
201
201
  <link rel="modulepreload" crossorigin href="./assets/mcp-consent-store-wvrClpLC.js">
202
202
  <link rel="modulepreload" crossorigin href="./assets/overlay-layers-y-dNUWSd.js">
203
- <link rel="modulepreload" crossorigin href="./assets/receive-store-BIIex-pm.js">
203
+ <link rel="modulepreload" crossorigin href="./assets/receive-store-3GZiQlZq.js">
204
204
  <link rel="modulepreload" crossorigin href="./assets/worktree-store-LSx9q9Ga.js">
205
205
  <link rel="stylesheet" crossorigin href="./assets/globals-B1VH9dVh.css">
206
206
  <link rel="stylesheet" crossorigin href="./assets/DocumentContext-B0sQn39F.css">
@@ -32,7 +32,7 @@
32
32
  script above.
33
33
  -->
34
34
  <style>html { background-color: #fafafa } html.dark { background-color: #171717 }</style>
35
- <script type="module" crossorigin src="./assets/uninstall-BN1Dwiyt.js"></script>
35
+ <script type="module" crossorigin src="./assets/uninstall-CYjxBKsK.js"></script>
36
36
  <link rel="modulepreload" crossorigin href="./assets/chunk-CYidjpOJ.js">
37
37
  <link rel="modulepreload" crossorigin href="./assets/dist-q14fBS3T.js">
38
38
  <link rel="modulepreload" crossorigin href="./assets/react-f2sANaYj.js">
@@ -43,7 +43,7 @@
43
43
  <link rel="modulepreload" crossorigin href="./assets/lib-Iu39CNZE.js">
44
44
  <link rel="modulepreload" crossorigin href="./assets/markdownit-YwcN3EvW.js">
45
45
  <link rel="modulepreload" crossorigin href="./assets/w3c-keyname-DtWCia6R.js">
46
- <link rel="modulepreload" crossorigin href="./assets/dist-Dy_AcDw1.js">
46
+ <link rel="modulepreload" crossorigin href="./assets/dist-DJVm0s5Q.js">
47
47
  <link rel="modulepreload" crossorigin href="./assets/jsx-runtime-BUgB2tll.js">
48
48
  <link rel="modulepreload" crossorigin href="./assets/dist-Nvb76hAm.js">
49
49
  <link rel="modulepreload" crossorigin href="./assets/bundle-mjs-SHeFpKGC.js">
@@ -1,2 +1,2 @@
1
- import{t as e}from"./launch-json-removal-CM6meUbZ.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
- //# sourceMappingURL=repair-launch-json-nrZcDedG.mjs.map
1
+ import{t as e}from"./launch-json-removal-CZAv1jvE.mjs";import{join as t}from"node:path";function n(n){let i=n.logger??r,a=t(n.projectDir,`.claude`,`launch.json`);if(n.reclaimDisableEnv===`1`)return i({event:`launch-json-repair-skipped`,reason:`reclaim-disabled`}),{outcome:{configPath:a,outcome:`skipped-reclaim-disabled`},repairedCount:0};let o;try{o=e(n.projectDir)}catch(e){let t=e instanceof Error?e.message:String(e);return i({event:`launch-json-repair-write-failed`,configPath:a}),{outcome:{configPath:a,outcome:`write-failed`,error:t},repairedCount:0}}let s=o.kind===`removed`||o.kind===`removed-file`;return s&&i({event:`launch-json-repair-removed`,configPath:a}),{outcome:{configPath:a,outcome:o.kind},repairedCount:+!!s}}function r(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{n as repairLaunchJson};
2
+ //# sourceMappingURL=repair-launch-json-By9LDC45.mjs.map
@@ -1,2 +1,2 @@
1
- import{d as e,l as t,v as n}from"./write-project-skill-CxSRoBP1.mjs";import{d as r,v as i}from"./init-C3NPtwsW.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=e[o],s=c(()=>t.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let e=t.projectConfigPath,i=c(()=>e(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:t,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
- //# sourceMappingURL=repair-mcp-configs-B-w0_Ypd.mjs.map
1
+ import{d as e,l as t,v as n}from"./write-project-skill-C6Fs5yeK.mjs";import{d as r,v as i}from"./init-DQsXw80Y.mjs";import{t as a}from"./mcp-migrate-event-CWx0WLdE.mjs";import{homedir as o}from"node:os";function s(n){let r=n.logger??u,i=n.home??o(),a=[];if(n.reclaimDisableEnv===`1`)return r({event:`mcp-config-repair-skipped`,reason:`reclaim-disabled`}),{outcomes:a,repairedCount:0};for(let o of t){let t=e[o],s=c(()=>t.configPath(``,i));if(s!==null&&a.push(l({scope:`user`,editorId:o,target:t,home:i,cwd:``,configPath:s,configPathOverride:void 0,logger:r})),t.projectConfigPath){let e=t.projectConfigPath,i=c(()=>e(n.projectDir));i!==null&&a.push(l({scope:`project`,editorId:o,target:t,home:void 0,cwd:n.projectDir,configPath:i,configPathOverride:i,logger:r}))}}return{outcomes:a,repairedCount:a.filter(e=>e.outcome===`repaired`).length}}function c(e){try{return e()}catch{return null}}function l(e){let t={scope:e.scope,editorId:e.editorId,configPath:e.configPath},o=r(e.target,e.cwd,e.home,e.configPathOverride);if(o===null)return{...t,outcome:`no-entry`};if(n(o))return{...t,outcome:`canonical`};e.logger(a({scope:e.scope,surface:`cli-repair`,editorId:e.editorId,configPath:e.configPath,priorEntry:o}));let s=i(e.target,e.cwd,{mode:`published`,skipAvailabilityCheck:!0},e.home,e.configPathOverride);if(s.action===`failed`){let n=s.error??`unknown write failure`;return e.logger({event:`mcp-config-repair-write-failed`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,error:n}),{...t,outcome:`write-failed`,error:n}}return s.action===`declined`?(e.logger({event:`mcp-config-repair-declined`,scope:e.scope,editorId:e.editorId,configPath:e.configPath,reason:s.declineReason}),{...t,outcome:`declined`}):{...t,outcome:`repaired`}}function u(e){process.stderr.write(`${JSON.stringify(e)}\n`)}export{s as repairMcpConfigs};
2
+ //# sourceMappingURL=repair-mcp-configs-CDJq4Ve2.mjs.map
@@ -1,4 +1,4 @@
1
- import{C as e}from"./src-mKEMutrR.mjs";import{ar as t,cr as n,er as r,hr as i,ir as a,mr as o,or as s,tr as c,ur as l}from"./src-BqSmDSx1.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-CxSRoBP1.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:()=>l(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>l(e,{checkDesktop:!1}),readBundledVersion:()=>c(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>n(e),readBundleDecision:(e,t)=>r(e,t),writeBundleDecision:(e,n,r)=>t(e,n,r),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=r.existsSync(s),l=!1;try{I(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,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}let d=r.existsSync(u);try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,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:l}}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`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&z(l,n);if(!c&&!u){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);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`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,a){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 a({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){a({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 i)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({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 i of d){let s=o[i.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,i.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:i.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:i.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:i.id,error:e instanceof Error?e.message:String(e)})}p.push(i)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(x(t,`.agents`,`skills`,o[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===i.length,_=!0;for(let{id:e,sourceDir:n}of p){let i=R(t,o[e],n,r,a,l);h.push(...i.entries),i.centralWritten||(_=!1)}let v=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(g&&_&&v){let e=null;try{await n.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`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:e?`all-writes-failed`:`no-hosts-installed`})}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===`reclaimed`).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} reclaimed, ${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`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} 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(`
1
+ import{C as e}from"./src-H4ZV7b5v.mjs";import{ar as t,cr as n,er as r,hr as i,ir as a,mr as o,or as s,tr as c,ur as l}from"./src-DeZ1D7q7.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-C6Fs5yeK.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:()=>l(`project`,{checkDesktop:!1}),resolveUserBundledSkillDir:e=>l(e,{checkDesktop:!1}),readBundledVersion:()=>c(),readRecordedVersion:e=>a(e,`cli-hosts`),writeRecordedVersion:(e,t)=>s(e,`cli-hosts`,t,`cli-start`),recordEvent:e=>n(e),readBundleDecision:(e,t)=>r(e,t),writeBundleDecision:(e,n,r)=>t(e,n,r),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=r.existsSync(s),l=!1;try{I(n,s,r),l=!0,o.push({kind:`central`,path:s,outcome:c?`overwritten`:`written`}),i({event:`user-skill-reclaim-central-written`,scope:`user`,path:s,preexisting:c,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}let d=r.existsSync(u);try{I(n,u,r),o.push({kind:`host`,editorId:c.editorId,hostDir:c.hostDir,path:u,outcome:d?`overwritten`:`written`}),i({event:`user-skill-reclaim-host-written`,scope:`user`,editorId:c.editorId,hostDir:c.hostDir,path:u,preexisting:d,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:l}}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`),c=n.existsSync(s),l=f[t.editorId]?.projectConfigPath?.(e),u=!c&&z(l,n);if(!c&&!u){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);let s=c?`reclaimed`:`created`;a.push({editorId:t.editorId,hostDir:t.hostDir,path:o,outcome:s}),r({event:c?`project-skill-reclaim-reclaimed`:`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,a){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 a({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){a({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 i)try{d.push({id:e,sourceDir:n.resolveUserBundledSkillDir(e)})}catch(e){f=e instanceof Error?e.message:String(e)}if(d.length===0)return a({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 i of d){let s=o[i.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,i.id),a({event:`user-skill-reclaim-bundle-declined-removed`,scope:`user`,bundle:i.id})}catch(e){a({event:`user-skill-reclaim-bundle-remove-failed`,scope:`user`,bundle:i.id,error:e instanceof Error?e.message:String(e)})}continue}if(l===null&&c)try{await n.writeBundleDecision(t,s,!0)}catch(e){a({event:`user-skill-reclaim-grandfather-write-failed`,scope:`user`,bundle:i.id,error:e instanceof Error?e.message:String(e)})}p.push(i)}if(p.length===0)return{outcome:`skipped`,reason:`all-bundles-declined`};let m=p.every(e=>r.existsSync(x(t,`.agents`,`skills`,o[e.id])));if(u!==null&&u===l&&m)return a({event:`user-skill-reclaim-skipped-version-current`,scope:`user`,version:l}),{outcome:`skipped`,reason:`version-current`};let h=[],g=d.length===i.length,_=!0;for(let{id:e,sourceDir:n}of p){let i=R(t,o[e],n,r,a,l);h.push(...i.entries),i.centralWritten||(_=!1)}let v=h.some(e=>e.kind===`central`&&(e.outcome===`written`||e.outcome===`overwritten`));if(g&&_&&v){let e=null;try{await n.writeRecordedVersion(t,l),a({event:`user-skill-reclaim-version-recorded`,scope:`user`,version:l})}catch(t){e=t instanceof Error?t.message:String(t),a({event:`user-skill-reclaim-version-record-failed`,scope:`user`,version:l,error:e})}for(let{id:t}of p)s({ts:c(),surface:`cli-start`,target:`cli-hosts`,bundle:t,outcome:e===null?`installed`:`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:e?`all-writes-failed`:`no-hosts-installed`})}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===`reclaimed`).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} reclaimed, ${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`||e.outcome===`overwritten`).length,r=e.user.entries.filter(e=>e.outcome===`skipped-host-absent`||e.outcome===`skipped-collapsed-with-central`).length,i=e.user.entries.filter(e=>e.outcome===`failed`).length;t.push(` User (${e.user.version}): ${n} written, ${r} skipped, ${i} 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
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
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-BFa2XhCq.mjs.map
4
+ //# sourceMappingURL=repair-skills-5K_XeFog.mjs.map
@@ -0,0 +1 @@
1
+ import{t as e}from"./repair-skills-5K_XeFog.mjs";export{e as repairSkills};
@@ -1,2 +1,2 @@
1
- import"./src-mKEMutrR.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-Bcq0DSDG.mjs.map
1
+ import"./src-H4ZV7b5v.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-CE0z40lI.mjs.map
@@ -0,0 +1 @@
1
+ import{a as e,o as t,r as n}from"./server-lock-CE0z40lI.mjs";export{n as markServerLockDraining,e as releaseServerLock,t as updateServerLockPort};
@@ -1,4 +1,4 @@
1
- import{o as e}from"./chunk-DTipWd-i.mjs";import{F as t,I as n,vo as r,yo as i,za as a}from"./src-mKEMutrR.mjs";import{Sa as o,Wr as s,at as c,it as l,ot as u,rt as d,ui as f,un as p}from"./src-BqSmDSx1.mjs";import{K as m}from"./sleep-DDnWCWup.mjs";import{O as h,P as g}from"./fs-traced-DDm-belY.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-Bcq0DSDG.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-CxSRoBP1.mjs";import{c as te}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-BgHjFLQm.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-C3NPtwsW.mjs";import{n as ae}from"./constants-DTOl3SVx.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import"./loader-C04tNzUH.mjs";import"./preview-ClosMsU7.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: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:i,logger:a}=t,o=t.userLogsDir??F(be(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,a):null;R(P(i),{recursive:!0}),a?.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:[]};a?.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:a}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:a}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:a});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){a?.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: ${r.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{F as t,I as n,vo as r,yo as i,za as a}from"./src-H4ZV7b5v.mjs";import{Sa as o,Wr as s,at as c,it as l,ln as u,nt as d,rt as f,ui as p}from"./src-DeZ1D7q7.mjs";import{K as m}from"./sleep-DDnWCWup.mjs";import{O as h,P as g}from"./fs-traced-DDm-belY.mjs";import{S as _,u as v,v as y,x as b}from"./server-lock-CE0z40lI.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-C6Fs5yeK.mjs";import{c as te}from"./colors-BsmVIwfM.mjs";import"./acp-harness-probe-ByCqmbsD.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-DQsXw80Y.mjs";import{n as ae}from"./constants-k1x9z874.mjs";import{t as j}from"./is-object-ByG7RnjH.mjs";import"./loader-BeCeqNda.mjs";import"./preview-_Dw3Db9A.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=u){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: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:i,logger:a}=t,o=t.userLogsDir??F(be(),`.ok`,`logs`),s=t.projectDir?Ie(t.projectDir,a):null;R(P(i),{recursive:!0}),a?.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:[]};a?.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:a}),U({zipfile:h,files:u,prefix:`lockdir`,redact:n,bundleFiles:p,redactions:f,logger:a}),U({zipfile:h,files:d,prefix:`local-logs`,redact:n,bundleFiles:p,redactions:f,logger:a});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){a?.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: ${r.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(i);return h.outputStream.pipe(b),await new Promise((e,t)=>{b.on(`close`,e),b.on(`error`,t)}),a?.info({bundlePath:i,fileCount:p.length,redactionCount:v},`bundle written`),{zipPath:i,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(`
@@ -15,6 +15,6 @@ import{o as e}from"./chunk-DTipWd-i.mjs";import{F as t,I as n,vo as r,yo as i,za
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:l(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??c,a=e.resolveUsage??u,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:f(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(f(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 i=F(n,`.git`),s;try{s=_e(i)}catch{return{kind:`not-git`}}if(s.isDirectory()){let e;try{e=await V(i)}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=a(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-Qy3Q9khT.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: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??l,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:p(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(p(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 i=F(n,`.git`),s;try{s=_e(i)}catch{return{kind:`not-git`}}if(s.isDirectory()){let e;try{e=await V(i)}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=a(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-BVK8_kFb.mjs.map
@@ -0,0 +1 @@
1
+ import{C as e,Fa as t,Ia as n,Pa as r,Qa as i,So as a,Xa as o,co as s,d as c,l,y as u}from"./src-H4ZV7b5v.mjs";import{$ as d,$i as f,$n as p,$r as m,$t as h,A as g,Ai as _,An as v,At as y,B as b,Bi as x,Bn as S,Br as C,Bt as w,C as T,Ci as E,Cn as D,Cr as O,Ct as k,D as A,Di as j,Dn as M,Dt as N,E as P,Ei as F,En as I,Er 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,Tr as rt,Tt as it,U as at,Ui as ot,Un as st,Ur as ct,Ut as lt,V as ut,Vi as dt,Vn as ft,Vr as pt,Vt as mt,W as ht,Wi as gt,Wn as _t,Wr as vt,Wt as yt,X as bt,Xi as xt,Xn as St,Xr as Ct,Xt as wt,Y as Tt,Yi as Et,Yn as Dt,Yr as Ot,Yt as kt,Z as At,Zi as jt,Zn as Mt,Zr as Nt,Zt as Pt,_ as Ft,_a as It,_i as Lt,_n as Rt,_r as zt,_t as Bt,a as Vt,aa as Ht,ai as Ut,an as Wt,ar as Gt,at as Kt,b as qt,bi as Jt,bn as Yt,br as Xt,bt as Zt,c as Qt,ca as $t,ci as en,cn as tn,cr as nn,ct as rn,d as an,da as on,di as sn,dn as cn,dr as ln,ea as un,ei as dn,en as fn,er as pn,et as mn,f as hn,fa as gn,fi as _n,fn as vn,fr as yn,g as bn,ga as xn,gi as Sn,gn as Cn,gr as wn,gt as Tn,h as En,ha as Dn,hi as On,hn as kn,hr as An,ht as jn,i as Mn,ia as Nn,ii as Pn,in as Fn,ir as In,it as Ln,j as Rn,ji as zn,jn as Bn,jt as Vn,k as Hn,ki as Un,kn 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,va as Jr,vi as Yr,vn as Xr,vr as Zr,vt as Qr,w as $r,wi as ei,wn as ti,wr as ni,wt as ri,x as ii,xi as ai,xn as oi,xr as si,xt as ci,y as li,ya as ui,yi as di,yn as fi,yr as pi,yt as mi,z as hi,zi as gi,zn as _i,zr as vi,zt as yi}from"./src-DeZ1D7q7.mjs";import{C as bi,E as xi,T as Si,_ as Ci,b as wi,c as Ti,d as Ei,g as Di,i as Oi,l as ki,m as Ai,n as ji,p as Mi,s as Ni,t as Pi,u as Fi,v as Ii,w as Li,x as Ri,y as zi}from"./fs-traced-DDm-belY.mjs";import{a as Bi,d as Vi,f as Hi,i as Ui,l as Wi,n as Gi,r as Ki,t as qi,u as Ji}from"./logger-B7Z8XO-z.mjs";import{S as Yi,_ as Xi,a as Zi,c as Qi,f as $i,g as ea,h as ta,i as na,l as ra,m as ia,n as aa,o as oa,p as sa,r as ca,s as la,t as ua,u as da,v as fa,x as pa}from"./server-lock-CE0z40lI.mjs";export{Ur as AGENT_ID_MAX_LEN,on as AGENT_ID_RE,F as AGENT_WRITE_ORIGIN,It as AcpPermissionStore,Qn as AcpRegistry,E as AcpThreadManager,ai as AgentFocusBroadcaster,Jt as AgentPresenceBroadcaster,j as AgentSessionCapacityError,je as AgentSessionManager,Tn as AutoStartDisabledError,yn as BUNDLE_IDS,vr as BUNDLE_SCOPE,tr as BUNDLE_SKILL_NAME,Bn as BacklinkIndex,Ge as CC1Broadcaster,i as CC1_CONTRACT_VERSION,zr as CONFIG_FILENAME,nt as CONFLICT_MARKER_RE,re as CURSOR_BUNDLE_PATHS_BY_PLATFORM,Ft as ConfigSchema,gt as DEFAULT_CHECKPOINT_RETENTION,He as DEFAULT_EMBEDDINGS_DIMENSIONS,Re as DEFAULT_PACK_ID,ut as DocumentDurabilityState,m as EMBEDDINGS_API_KEY_ENV,Dn as FEATURED_AGENT_IDS,G as FILE_SYSTEM_WRITER,Wn as FILE_WATCHER_ORIGIN,pe as FileEmbeddingsBackend,wt as GIT_PREFLIGHT_FAIL_SPAN_NAME,de as GIT_UPSTREAM_WRITER,Jr as GitDirAccessError,Ke as GitNotAvailableError,_i as GitTooOldError,Bt as HOCUSPOCUS_AUTH_REJECTION_REASONS,Qr as HocuspocusAuthRejection,mi as HocuspocusAuthTokenSchema,Q as INSTALLED_AGENTS_SCHEMES,o as LINEAGE_EPOCH_KEY,We as LIVE_DERIVED_INDEX_DEBOUNCE_MS,U as LOG_MD_TEMPLATE,it as MANAGED_RENAME_ORIGIN,ei as MAX_ACP_THREADS,Un as MAX_AGENT_SESSIONS,Fr as MCP_CONNECTION_ID_HEADER,r as MCP_SERVER_NAME,_ as MIN_EVICTABLE_IDLE_MS,S as MIN_GIT_VERSION,Y as MISSING_OK_CONFIG_MESSAGE,ui as MalformedGitPointerError,d as McpLogger,at as MissingOkConfigError,xe as OBSERVER_SYNC_ORIGIN,ar as OK_OKIGNORE_TEMPLATE,t as ORPHAN_MODES,a as PROTOCOL_VERSION,qi as PinoLogger,Qi as ProcessLockCollisionError,Kn as ProjectGitInitError,R as ROLLBACK_ORIGIN,Dr as ROOT_GITIGNORE_TEMPLATE,ea as RUNTIME_VERSION,$n as RemoteConfigError,br as SERVICE_WRITER,Pr as SKILL_INSTALL_EVENTS_FILE_REL,u as SKILL_STATE_TARGETS,ie as STARTER_FOLDERS,ye as STARTER_FOLDER_FRONTMATTER_FILENAME,Je as STARTER_PACKS,yi as STARTER_PACK_IDS,w as STARTER_TEMPLATES,et as STATE_MANIFEST_FILENAME,Xi as STATE_SCHEMA_VERSION,s as SYSTEM_DOC_NAME,me as SeedPrerequisiteError,Cr as SeedRootDirError,ua as ServerLockCollisionError,Ir as SingleFileNotAFileError,nr as SingleFileNotFoundError,wr as SingleFileNotMarkdownError,P as StateManifestError,v as TagIndex,An as USER_GLOBAL_BUNDLE_IDS,De as UiLockCollisionError,N as __getShowAllWalkStatsForTesting,Ne as __resetShowAllWalkStatsForTesting,ra as acquireProcessLock,aa as acquireServerLock,Ie as acquireUiLock,zn as applyAgentMarkdownWrite,D as applyExternalChange,ke as applySeed,A as assertCompatibleStateManifest,ft as assertGitAvailable,cn as assertNeverDiskEvent,Xe as attachAcpThreadSocket,jn as attachIdleShutdown,qr as bootServer,St as buildAndOpenSkill,Fn as buildConfigYmlContent,ae as buildExecResult,tt as buildOkMcpStdioCommand,Xn as buildSkillZip,mt as buildStarterFolderFrontmatterYaml,oe as buildWipTree,wn as bundleSkillMdPath,Sr as canonicalProjectKey,vn as classifyEvents,Pi as classifyFsPath,ce as clearAllEmbeddingsKeys,Rr as clearContributors,$ as coercePackId,l as colorFromSeed,Et as commitUpstreamImport,xt as commitWip,jt as commitWipFromTree,Z as compareSemver,pi as composeEffectiveLinterConfig,Xt as composeFrontmatterSchemasConfig,I as containsConflictMarkers,_r as contentHash,ir as contributorCount,Pe as countShadowObjects,z as countStaleAgentWipRefs,ee as countWipRefs,Gn as createApiExtension,sn as createAssetServeMiddleware,Ce as createContentFilter,Oe as createContentFilterAsync,Ot as createEmbeddingsSecretStore,Mn as createEphemeralProjectDir,ti as createExternalChangeHandler,hn as createFileLogger,hi as createLiveDerivedIndexExtension,ue as createMcpHttpHandler,ct as createOsProbe,Te as createPersistenceExtension,T as createServer,Rn as createServerObserverExtension,B as createStreamingErrorWriter,Gi as createTestLogger,Ct as describeStoredEmbeddingsKey,bn as detectClaudeDesktopPresence,st as detectGit,Ae as detectProjectShape,Mt as detectUserSkillHosts,sr as discoverLockDirs,O as discoverMarkdownlintConfig,Pt as emitPreflightFailureSpan,Tt as encodeDocName,bt as encodeFolderRoute,At as encodeSkillRoute,Hr as ensureProjectGit,Wt as ensureProjectSkillGitignore,te as errorResponse,er as evictStaleTrackerEntries,kr as extractOkBinaryPath,Se as extractWikiLinksFromMarkdown,_t as fallbackPaths,an as findEnclosingGitRoot,Yn as findEnclosingProjectRoot,ni as findNativeMarkdownlintFile,mr as flushFileLogger,Zt as formatAuthRejectionWire,Er as formatContributors,Pn as formatContributorsFrom,Vn as formatPackRationale,Be as gcCheckpointRefs,mn as getCurrentMcpLogger,en as getLocalDir,Zn as getLogFilePath,Ki as getLogger,En as getLogsDir,fa as getMachineId,zi as getMeter,Ht as getMetrics,wi as getTracer,lr as handleCollabSocketError,ve as handleSpawnCursor,On as hasForwardingHeaders,he as hasGcLogLatch,c as iconFromClientName,jr as incrementCollabSocketFilteredError,$t as incrementServerObserverFire,dr as initContent,f as initShadowRepo,Ri as initTelemetry,qt as initToleranceTelemetryWriter,pr as installPrettyZodErrors,Ui as installTestLoggers,Ve as installUserSkill,gr as isAllowedApiOrigin,Yr as isAllowedWorkspaceHostHeader,gi as isConfigDoc,ci as isHocuspocusAuthRejectionReason,lt as isKnownPackId,x as isLinkIndexExcludedDoc,di as isLoopbackAddress,dt as isManagedArtifactDoc,n as isOrphanMode,Ee as isPairedWriteOrigin,qe as isPathWithinDir,pa as isProcessAlive,Gr as isProjectRoot,fe as isProjectSkillManaged,Sn as isRemoteAdmitted,X as isReservedForUserTree,kn as isSelfWrite,ot as isSystemDoc,ii as isToleranceTelemetryEnabled,Yi as isValidLockPid,Cn as lastKnownHash,un as listRescueCheckpoints,yt as listStarterPacks,xn as loadCustomAgents,be as loadPrincipal,da as lockFilePath,Bi as loggerFactory,Wi as logsCurrentPath,Ji as logsPreviousPath,Nt as makeLazyEmbeddingsKeyStore,ca as markServerLockDraining,ht as mountMcpAndApi,ji as normalizeFsPath,zt as originGitHubHost,Nr as packageVersionMajorMinor,$e as parseAuthRejectionWire,K as parseGitVersion,k as parseHocuspocusAuthToken,W as parseKeepaliveConnectionId,Rt as pathToDocName,we as planSeed,Vt as prepareSingleFileOpen,Ln as processCommand,Kt as processUsage,p as readAllTargets,pn as readBundleDecision,rt as readOwnNativeRules,$i as readProcessLock,sa as readProcessLockDetailed,b as readProjectHeadState,q as readProjectLocalSemanticConfig,na as readServerLock,Br as readServerPackageVersion,or as readSkillInstallStateSnapshot,xr as readSkillManagement,Hn as readStateManifest,Or as readTargetRecordedAt,In as readTargetVersion,V as readUiLock,M as reconcile,Ut as recordContributor,nn as recordSkillInstallEvent,yr as registerAllTools,Xr as registerWrite,ia as releaseProcessLock,Zi as releaseServerLock,ne as releaseUiLock,fi as removeLastKnownHash,qn as resetMetrics,e as resolveBundleEnabled,Kr as resolveBundledSkillDir,Jn as resolveContentDir,vi as resolveCursorBinaryDefault,C as resolveCursorSpawnInvocation,si as resolveEffectiveLinterConfig,dn as resolveEmbeddingsCredential,Wr as resolveLockDir,Qe as resolveNativeConfigForDoc,L as resolveNativeMarkdownlintConfig,J as resolvePack,Ar as resolvePackageVersion,Lt as resolveRemoteAccess,ze as resolveUiInfo,ur as restoreContributors,li as restoreLifecycleFromConflictsJson,Le as rewriteMarkdownLinksForDocumentRename,H as rewriteWikiLinksForDocumentRename,Ue as runAuthReposSubprocess,h as runAuthStatusSubprocess,le as runCloneSubprocess,fn as runDeviceFlowSubprocess,Vr as runWithMcpLogger,_n as safeContentPath,y as safeSubdir,Lr as safetyCheckpoint,rn as sanitizeClientName,rr as saveInMemoryCheckpoint,Tr as saveVersion,ri as seedBasenameIndex,cr as serializeError,bi as setActiveSpanAttributes,Fe as setupServerObservers,Nn as shadowGit,Li as shutdownTelemetry,se as skillManagementPath,Vi as spansCurrentPath,Hi as spansPreviousPath,pt as spawnDetached,Me as splitMarkdownBlocks,Yt as startWatcher,ge as streamingProblemEvent,Mr as swapContributors,Ye as teardownToleranceTelemetryWriter,gn as toBroadcasterKey,Oi as tracedAppendFileSync,Ni as tracedLinkSync,Ti as tracedMkdir,ki as tracedMkdirSync,Fi as tracedRename,Ei as tracedRenameSync,Mi as tracedRmSync,Ai as tracedRmdirSync,Di as tracedUnlinkSync,Ci as tracedWriteFile,Ii as tracedWriteFileSync,$r as trustSystemCertificates,Qt as untrackTrackedProjectSkillProjection,oi as updateLastKnownHash,ta as updateProcessLockPort,oa as updateServerLockPort,_e as updateUiLockPort,hr as validateAgentId,kt as validateCloneInputs,ln as validateSkillZip,la as waitForServerLockDrain,vt as withHiddenWindowsConsole,Si as withSpan,xi as withSpanSync,Gt as writeBundleDecision,Zr as writeMarkdownlintRule,tn as writeRootGitignoreForNewRepo,Dt as writeSkillManagement,g as writeStateManifest,fr as writeTargetVersion,Ze as writeTracker};