nolzu 0.0.1 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/LICENSE +105 -0
  2. package/README.md +24 -7
  3. package/build/client/_app/immutable/assets/0.SPD4wYkc.css +1 -0
  4. package/build/client/_app/immutable/assets/1.BRilEoOO.css +1 -0
  5. package/build/client/_app/immutable/assets/10.DwLiBGDj.css +1 -0
  6. package/build/client/_app/immutable/assets/11.D_TtWT3D.css +1 -0
  7. package/build/client/_app/immutable/assets/12.CSVGmtUY.css +1 -0
  8. package/build/client/_app/immutable/assets/13.qTa7IHbg.css +1 -0
  9. package/build/client/_app/immutable/assets/19.CbCFXKb8.css +1 -0
  10. package/build/client/_app/immutable/assets/2.CfHhgI77.css +1 -0
  11. package/build/client/_app/immutable/assets/20.C5CSZhyT.css +1 -0
  12. package/build/client/_app/immutable/assets/21.BBpYkZcc.css +1 -0
  13. package/build/client/_app/immutable/assets/22.C9RgY9kl.css +1 -0
  14. package/build/client/_app/immutable/assets/23.B6Dp9RJO.css +1 -0
  15. package/build/client/_app/immutable/assets/24.C7g2abUW.css +1 -0
  16. package/build/client/_app/immutable/assets/26.DTMI6ROV.css +1 -0
  17. package/build/client/_app/immutable/assets/27.AxXMpDkB.css +1 -0
  18. package/build/client/_app/immutable/assets/28.939ac-98.css +1 -0
  19. package/build/client/_app/immutable/assets/3.3lqex1t-.css +1 -0
  20. package/build/client/_app/immutable/assets/4.C52MzO_d.css +1 -0
  21. package/build/client/_app/immutable/assets/5.CsfJAwvS.css +1 -0
  22. package/build/client/_app/immutable/assets/8.ByspUp-s.css +1 -0
  23. package/build/client/_app/immutable/assets/9.BCSFZmce.css +1 -0
  24. package/build/client/_app/immutable/assets/Banner.DDqfpWLD.css +1 -0
  25. package/build/client/_app/immutable/assets/BoardOff.mpX08-Be.css +1 -0
  26. package/build/client/_app/immutable/assets/Button.BlwsEgUc.css +1 -0
  27. package/build/client/_app/immutable/assets/Chip.qAAa6_e5.css +1 -0
  28. package/build/client/_app/immutable/assets/Dialog.D5Ln60a8.css +1 -0
  29. package/build/client/_app/immutable/assets/FeaturePanels.DZ_Mth5M.css +1 -0
  30. package/build/client/_app/immutable/assets/FolderBrowser.DBmRWDCH.css +1 -0
  31. package/build/client/_app/immutable/assets/Geist-Variable.Bj2R_7yk.woff2 +0 -0
  32. package/build/client/_app/immutable/assets/GeistMono-Variable.Dispecij.woff2 +0 -0
  33. package/build/client/_app/immutable/assets/HelpTip.DF6T9nns.css +1 -0
  34. package/build/client/_app/immutable/assets/InfoBox.CpavOykF.css +1 -0
  35. package/build/client/_app/immutable/assets/KeyCaps.D2t-lY-8.css +1 -0
  36. package/build/client/_app/immutable/assets/LogLine.Bu4feLn5.css +1 -0
  37. package/build/client/_app/immutable/assets/Markdown.DI6AtWAc.css +1 -0
  38. package/build/client/_app/immutable/assets/ModelPicker.DQzj7Nj8.css +1 -0
  39. package/build/client/_app/immutable/assets/OptionButtons.BYiyOXOE.css +1 -0
  40. package/build/client/_app/immutable/assets/PeekPanel.DzMdHoqg.css +1 -0
  41. package/build/client/_app/immutable/assets/ScoutPage.CVIiLy5c.css +1 -0
  42. package/build/client/_app/immutable/assets/SetupSteps.B6pZP1Bk.css +1 -0
  43. package/build/client/_app/immutable/assets/Skeleton.BC-1_U5d.css +1 -0
  44. package/build/client/_app/immutable/assets/SlotsMeter.Dq7GGYlD.css +1 -0
  45. package/build/client/_app/immutable/assets/StartConfirm.DxNN2AOb.css +1 -0
  46. package/build/client/_app/immutable/assets/StatePill.CGWFVUUg.css +1 -0
  47. package/build/client/_app/immutable/assets/Streamed.DpZ6wgO2.css +1 -0
  48. package/build/client/_app/immutable/assets/card-pulls.C5uGMuAh.css +1 -0
  49. package/build/client/_app/immutable/assets/next-step.CKg1w06J.css +1 -0
  50. package/build/client/_app/immutable/chunks/-B5EclhK.js +1 -0
  51. package/build/client/_app/immutable/chunks/-Q3zApAy.js +1 -0
  52. package/build/client/_app/immutable/chunks/6-hwN_Ik.js +3 -0
  53. package/build/client/_app/immutable/chunks/B16UF4PA.js +11 -0
  54. package/build/client/_app/immutable/chunks/B1V3h1VF.js +1 -0
  55. package/build/client/_app/immutable/chunks/B2d2Mkuz.js +68 -0
  56. package/build/client/_app/immutable/chunks/B2yzhiEa.js +1 -0
  57. package/build/client/_app/immutable/chunks/B5zDDQUU.js +2 -0
  58. package/build/client/_app/immutable/chunks/B8DHSiWf.js +1 -0
  59. package/build/client/_app/immutable/chunks/B8z33EzI.js +1 -0
  60. package/build/client/_app/immutable/chunks/BCRkrH6c.js +1 -0
  61. package/build/client/_app/immutable/chunks/BCScjOxu.js +1 -0
  62. package/build/client/_app/immutable/chunks/BMUQtCEC.js +1 -0
  63. package/build/client/_app/immutable/chunks/BNnfkvZM.js +1 -0
  64. package/build/client/_app/immutable/chunks/BelWyZaW.js +1 -0
  65. package/build/client/_app/immutable/chunks/BhZpqODT.js +1 -0
  66. package/build/client/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  67. package/build/client/_app/immutable/chunks/BmafI-Bs.js +1 -0
  68. package/build/client/_app/immutable/chunks/BvRk9kiK.js +0 -0
  69. package/build/client/_app/immutable/chunks/C4i6bdQg.js +1 -0
  70. package/build/client/_app/immutable/chunks/C8u5TyIB.js +1 -0
  71. package/build/client/_app/immutable/chunks/CFs2xhoy.js +1 -0
  72. package/build/client/_app/immutable/chunks/CIm2DioU.js +1 -0
  73. package/build/client/_app/immutable/chunks/CONqGBXC.js +1 -0
  74. package/build/client/_app/immutable/chunks/CSOz40qO.js +1 -0
  75. package/build/client/_app/immutable/chunks/CXxuD1ef.js +3 -0
  76. package/build/client/_app/immutable/chunks/CarrGsZA.js +2 -0
  77. package/build/client/_app/immutable/chunks/CdrmTD44.js +1 -0
  78. package/build/client/_app/immutable/chunks/CfJRH9gh.js +2 -0
  79. package/build/client/_app/immutable/chunks/Ci7C9Cki.js +1 -0
  80. package/build/client/_app/immutable/chunks/CkOTL1vK.js +1 -0
  81. package/build/client/_app/immutable/chunks/CngTtGc_.js +1 -0
  82. package/build/client/_app/immutable/chunks/Cp3A1zR8.js +1 -0
  83. package/build/client/_app/immutable/chunks/CwtMnwNL.js +3 -0
  84. package/build/client/_app/immutable/chunks/Cy7f_oXg.js +1 -0
  85. package/build/client/_app/immutable/chunks/D-wwLm5t.js +1 -0
  86. package/build/client/_app/immutable/chunks/D2imbgaf.js +1 -0
  87. package/build/client/_app/immutable/chunks/D32mip60.js +1 -0
  88. package/build/client/_app/immutable/chunks/D46Vk19W.js +1 -0
  89. package/build/client/_app/immutable/chunks/DCUUgo-6.js +1 -0
  90. package/build/client/_app/immutable/chunks/DFjnjJjy.js +1 -0
  91. package/build/client/_app/immutable/chunks/DHMbSbMg.js +1 -0
  92. package/build/client/_app/immutable/chunks/DJOFx2wx.js +1 -0
  93. package/build/client/_app/immutable/chunks/DV4tvxHp.js +3 -0
  94. package/build/client/_app/immutable/chunks/DXk_5YEw.js +1 -0
  95. package/build/client/_app/immutable/chunks/DjgnRLJt.js +1 -0
  96. package/build/client/_app/immutable/chunks/DlWlQ_vP.js +1 -0
  97. package/build/client/_app/immutable/chunks/DpIAei2y.js +2 -0
  98. package/build/client/_app/immutable/chunks/Dt-HX3Vu.js +1 -0
  99. package/build/client/_app/immutable/chunks/DuSthUWX.js +1 -0
  100. package/build/client/_app/immutable/chunks/Ecfl8TOn.js +2 -0
  101. package/build/client/_app/immutable/chunks/ITHE99Aa.js +1 -0
  102. package/build/client/_app/immutable/chunks/Khdge0KS.js +1 -0
  103. package/build/client/_app/immutable/chunks/LMEKNlm0.js +1 -0
  104. package/build/client/_app/immutable/chunks/OnIeaiuO.js +1 -0
  105. package/build/client/_app/immutable/chunks/VFQLu55q.js +1 -0
  106. package/build/client/_app/immutable/chunks/ZsUxKnQw.js +1 -0
  107. package/build/client/_app/immutable/chunks/aWP8DVhV.js +1 -0
  108. package/build/client/_app/immutable/chunks/bB04Xp1f.js +1 -0
  109. package/build/client/_app/immutable/chunks/eylBqhv8.js +3 -0
  110. package/build/client/_app/immutable/chunks/hx0ssLL_.js +2 -0
  111. package/build/client/_app/immutable/chunks/mumDj17t.js +1 -0
  112. package/build/client/_app/immutable/chunks/pZYp3_TE.js +1 -0
  113. package/build/client/_app/immutable/chunks/tImwjqWn.js +1 -0
  114. package/build/client/_app/immutable/chunks/uBIymjUX.js +1 -0
  115. package/build/client/_app/immutable/chunks/xihTtKlq.js +1 -0
  116. package/build/client/_app/immutable/entry/app.DVZ1wE36.js +2 -0
  117. package/build/client/_app/immutable/entry/start.DluCc61B.js +1 -0
  118. package/build/client/_app/immutable/nodes/0.CwNFevXf.js +1 -0
  119. package/build/client/_app/immutable/nodes/1.BR6FYiC-.js +1 -0
  120. package/build/client/_app/immutable/nodes/10.wNwBFtom.js +2 -0
  121. package/build/client/_app/immutable/nodes/11.DpoIbMNF.js +2 -0
  122. package/build/client/_app/immutable/nodes/12.CWdUJ8l3.js +2 -0
  123. package/build/client/_app/immutable/nodes/13.CZ2uTvNS.js +1 -0
  124. package/build/client/_app/immutable/nodes/14.CzgyXuvL.js +1 -0
  125. package/build/client/_app/immutable/nodes/15.CzgyXuvL.js +1 -0
  126. package/build/client/_app/immutable/nodes/16.odL9eB2N.js +1 -0
  127. package/build/client/_app/immutable/nodes/17.B-RnUeVU.js +1 -0
  128. package/build/client/_app/immutable/nodes/18.BLYKxyq2.js +1 -0
  129. package/build/client/_app/immutable/nodes/19.CgyFfPqF.js +3 -0
  130. package/build/client/_app/immutable/nodes/2.CCWT41Qr.js +1 -0
  131. package/build/client/_app/immutable/nodes/20.BBk5-krg.js +1 -0
  132. package/build/client/_app/immutable/nodes/21.CJoU3s1A.js +2 -0
  133. package/build/client/_app/immutable/nodes/22.CoRvPh8m.js +1 -0
  134. package/build/client/_app/immutable/nodes/23.zXO3NjnM.js +3 -0
  135. package/build/client/_app/immutable/nodes/24.CmO27TED.js +1 -0
  136. package/build/client/_app/immutable/nodes/26.TVKNr_xX.js +18 -0
  137. package/build/client/_app/immutable/nodes/27.RojtGU_o.js +1 -0
  138. package/build/client/_app/immutable/nodes/28.CVTdeeSI.js +2 -0
  139. package/build/client/_app/immutable/nodes/3.Cgib7Vi6.js +1 -0
  140. package/build/client/_app/immutable/nodes/4.CnMwOCec.js +1 -0
  141. package/build/client/_app/immutable/nodes/5.-NqYtQj_.js +1 -0
  142. package/build/client/_app/immutable/nodes/6.D5xk-UBM.js +1 -0
  143. package/build/client/_app/immutable/nodes/7.IL4b-DII.js +1 -0
  144. package/build/client/_app/immutable/nodes/8.DJrguHjO.js +11 -0
  145. package/build/client/_app/immutable/nodes/9.DTUSzWiK.js +1 -0
  146. package/build/client/_app/version.json +1 -0
  147. package/build/client/favicon.svg +7 -0
  148. package/build/env.js +70 -0
  149. package/build/handler.js +26 -0
  150. package/build/index.js +149 -0
  151. package/build/server/chunks/chunks/Banner.js-D4mtxUfF.js +17 -0
  152. package/build/server/chunks/chunks/BoardOff.js-Dg5-LoR3.js +1627 -0
  153. package/build/server/chunks/chunks/Button.js-Buh9rnpu.js +43 -0
  154. package/build/server/chunks/chunks/Chip.js-xZ7vFkHx.js +12 -0
  155. package/build/server/chunks/chunks/Dialog.js-CGpwdpM-.js +60 -0
  156. package/build/server/chunks/chunks/FeaturePanels.js-B2sKozgF.js +84 -0
  157. package/build/server/chunks/chunks/FolderBrowser.js-DUHFhDaX.js +28 -0
  158. package/build/server/chunks/chunks/HelpTip.js-CzemvmjC.js +19 -0
  159. package/build/server/chunks/chunks/InfoBox.js-BJiVzZgw.js +10 -0
  160. package/build/server/chunks/chunks/KeyCaps.js-BMI2Hrh2.js +37 -0
  161. package/build/server/chunks/chunks/LogLine.js-2b7uX__H.js +35 -0
  162. package/build/server/chunks/chunks/Markdown.js-Clud88KU.js +4233 -0
  163. package/build/server/chunks/chunks/ModelPicker.js-FuBgyKIA.js +141 -0
  164. package/build/server/chunks/chunks/OptionButtons.js-LQKrAwUX.js +28 -0
  165. package/build/server/chunks/chunks/PeekPanel.js-aZ-r_v3N.js +375 -0
  166. package/build/server/chunks/chunks/ScoutPage.js-2DcNia96.js +733 -0
  167. package/build/server/chunks/chunks/SetupSteps.js-D7TAF7xa.js +66 -0
  168. package/build/server/chunks/chunks/Skeleton.js-diCP2sd5.js +30 -0
  169. package/build/server/chunks/chunks/SlotsMeter.js-BV_sAGf5.js +18 -0
  170. package/build/server/chunks/chunks/StartConfirm.js-CzEdFtbO.js +124 -0
  171. package/build/server/chunks/chunks/StatePill.js-CM7-HXNM.js +27 -0
  172. package/build/server/chunks/chunks/Streamed.js-_NgwNMMs.js +43 -0
  173. package/build/server/chunks/chunks/_page.server.js-BaGoctEY.js +1419 -0
  174. package/build/server/chunks/chunks/activity.js-CSoPUQLq.js +84 -0
  175. package/build/server/chunks/chunks/add-repo.js-DtHEobfm.js +305 -0
  176. package/build/server/chunks/chunks/app-header.js-CCflgeEQ.js +13 -0
  177. package/build/server/chunks/chunks/app.js-CuPn8jtk.js +12 -0
  178. package/build/server/chunks/chunks/bin.js-Cyb2cYLc.js +58 -0
  179. package/build/server/chunks/chunks/board-keys.js-CW3qw-MC.js +32 -0
  180. package/build/server/chunks/chunks/board-page.js-D0tdsE9J.js +860 -0
  181. package/build/server/chunks/chunks/board.js-BxL3CjB1.js +203 -0
  182. package/build/server/chunks/chunks/browser-test.js-DJEpOoVz.js +170 -0
  183. package/build/server/chunks/chunks/card-pulls.js-d_uGmBB3.js +229 -0
  184. package/build/server/chunks/chunks/card-repos.js-QaMCxiyV.js +59 -0
  185. package/build/server/chunks/chunks/chain-store.js-D42m8DUo.js +91 -0
  186. package/build/server/chunks/chunks/chain.js-CJFRywIC.js +52 -0
  187. package/build/server/chunks/chunks/changes.js-D8ITRMgU.js +513 -0
  188. package/build/server/chunks/chunks/checkout.js-Ys5L_gA4.js +319 -0
  189. package/build/server/chunks/chunks/client.js-B7jIMDuS.js +68 -0
  190. package/build/server/chunks/chunks/clipboard.js-qXskOBim.js +12 -0
  191. package/build/server/chunks/chunks/cloud-status.js-hy-9zUVX.js +95 -0
  192. package/build/server/chunks/chunks/coach.js-BhNB14rV.js +296 -0
  193. package/build/server/chunks/chunks/comments.js-1nWJQptB.js +311 -0
  194. package/build/server/chunks/chunks/commit-message.js-CMcNZUZw.js +8 -0
  195. package/build/server/chunks/chunks/create-card.js-DKtprMG6.js +498 -0
  196. package/build/server/chunks/chunks/db.js-pqoVpAzG.js +80 -0
  197. package/build/server/chunks/chunks/diff-comments.js-BSCuay_U.js +95 -0
  198. package/build/server/chunks/chunks/discussion.js-rJ5OMfvX.js +355 -0
  199. package/build/server/chunks/chunks/display.js-Bf-vGQ7Q.js +61 -0
  200. package/build/server/chunks/chunks/elapsed.js-DikkNhaD.js +27 -0
  201. package/build/server/chunks/chunks/engine.js-DS5zUwsE.js +115 -0
  202. package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
  203. package/build/server/chunks/chunks/estimate.js-BHTYVTaQ.js +2484 -0
  204. package/build/server/chunks/chunks/evidence-timeline.js-Dk0dTZIy.js +253 -0
  205. package/build/server/chunks/chunks/evidence.js-CT3tWdbB.js +257 -0
  206. package/build/server/chunks/chunks/exports.js-Hn-WQRMB.js +150 -0
  207. package/build/server/chunks/chunks/features.svelte.js-DNsFmFZb.js +10 -0
  208. package/build/server/chunks/chunks/files.js-V46lE0-6.js +46 -0
  209. package/build/server/chunks/chunks/filter.js-CsmCtJMd.js +11 -0
  210. package/build/server/chunks/chunks/forms.js-03E8qnFz.js +35 -0
  211. package/build/server/chunks/chunks/gate.js-Cbqo8Yy0.js +82 -0
  212. package/build/server/chunks/chunks/getting-started.js-DKbHofN5.js +55 -0
  213. package/build/server/chunks/chunks/git.js-l43vBHqs.js +16 -0
  214. package/build/server/chunks/chunks/home-path.js-BXgrl3TP.js +11 -0
  215. package/build/server/chunks/chunks/hub-link.js-B5kjLyyd.js +1532 -0
  216. package/build/server/chunks/chunks/internal.js-DaSBO6jY.js +1239 -0
  217. package/build/server/chunks/chunks/internal2.js-D6AKyUgY.js +27 -0
  218. package/build/server/chunks/chunks/knowledge-page.js-D2ALB3v9.js +292 -0
  219. package/build/server/chunks/chunks/knowledge-revert.js-2eyN9Lcb.js +109 -0
  220. package/build/server/chunks/chunks/knowledge.js--eAgdzNx.js +394 -0
  221. package/build/server/chunks/chunks/last-board.js-BemeiK3t.js +23 -0
  222. package/build/server/chunks/chunks/log.js-R2zUph6T.js +228 -0
  223. package/build/server/chunks/chunks/loop.js-D3guWKLp.js +4038 -0
  224. package/build/server/chunks/chunks/loop2.js-B_Qd2m4y.js +67 -0
  225. package/build/server/chunks/chunks/navigation.js-DQJMz-SM.js +2 -0
  226. package/build/server/chunks/chunks/new-project.js-DNcr9JpB.js +305 -0
  227. package/build/server/chunks/chunks/next-step.js-B8Kl0Iv9.js +522 -0
  228. package/build/server/chunks/chunks/node.js-Bz2jT5wt.js +3381 -0
  229. package/build/server/chunks/chunks/now-live.svelte.js-hIaDgjJ3.js +13 -0
  230. package/build/server/chunks/chunks/now-snapshot.js-zGKLIzox.js +207 -0
  231. package/build/server/chunks/chunks/now.js-Dfm-o0Ha.js +765 -0
  232. package/build/server/chunks/chunks/onboard.js-LBqPOxyU.js +1525 -0
  233. package/build/server/chunks/chunks/ordinal.js-Bm_9QEBD.js +12 -0
  234. package/build/server/chunks/chunks/overview.js-C32iHkXD.js +1108 -0
  235. package/build/server/chunks/chunks/page-keys.svelte.js-D8vXA_8Z.js +14 -0
  236. package/build/server/chunks/chunks/patch.js-Bl7vwsUj.js +62 -0
  237. package/build/server/chunks/chunks/paths.js-DVRjNYFW.js +19 -0
  238. package/build/server/chunks/chunks/peek.js-D9sSjT9t.js +95 -0
  239. package/build/server/chunks/chunks/plan.js-DFq5ntMM.js +143 -0
  240. package/build/server/chunks/chunks/project-files-notice.js-CcqcBgUP.js +19 -0
  241. package/build/server/chunks/chunks/project-files.js-DTC4jUxy.js +52 -0
  242. package/build/server/chunks/chunks/project-folder.js-CoKgPiM0.js +22 -0
  243. package/build/server/chunks/chunks/projects.js-bw2V11od.js +989 -0
  244. package/build/server/chunks/chunks/prs.js-CLfImauu.js +118 -0
  245. package/build/server/chunks/chunks/publish.js-D2vWpIJU.js +195 -0
  246. package/build/server/chunks/chunks/pull-list.js-BCIBJdyz.js +691 -0
  247. package/build/server/chunks/chunks/qa-ask.svelte.js-8Hf1JWW2.js +47 -0
  248. package/build/server/chunks/chunks/qa-setup.js-DFOEcNxH.js +1241 -0
  249. package/build/server/chunks/chunks/quiet.js-1GKY40Ay.js +104 -0
  250. package/build/server/chunks/chunks/rail.js-BePBwOqZ.js +135 -0
  251. package/build/server/chunks/chunks/review.js-MPqnq9Gy.js +98 -0
  252. package/build/server/chunks/chunks/routing.js-B8s1QwSP.js +265 -0
  253. package/build/server/chunks/chunks/run-log.js-CnN2jOcg.js +94 -0
  254. package/build/server/chunks/chunks/run.js-COSejjLl.js +34 -0
  255. package/build/server/chunks/chunks/scout-findings.js-CqJti10a.js +940 -0
  256. package/build/server/chunks/chunks/scout.js-Bm7wQLX2.js +62 -0
  257. package/build/server/chunks/chunks/sentinels.js-BXvpnzr3.js +13 -0
  258. package/build/server/chunks/chunks/server.js-BR0D07DR.js +3803 -0
  259. package/build/server/chunks/chunks/settings-sections.js-V70W7BkZ.js +103 -0
  260. package/build/server/chunks/chunks/shared.js-BgfCUZUJ.js +776 -0
  261. package/build/server/chunks/chunks/sign-in.js-O-pBhi19.js +14 -0
  262. package/build/server/chunks/chunks/snapshot.js-BekzL_He.js +38 -0
  263. package/build/server/chunks/chunks/spend.js-BabnR69T.js +63 -0
  264. package/build/server/chunks/chunks/src.js-Cm8RAH_q.js +609 -0
  265. package/build/server/chunks/chunks/src2.js-CV8tsClO.js +1186 -0
  266. package/build/server/chunks/chunks/src3.js-h9tTEbVb.js +11222 -0
  267. package/build/server/chunks/chunks/stack.js-CMWXhMZS.js +13 -0
  268. package/build/server/chunks/chunks/standup.js-D-qBnMx4.js +103 -0
  269. package/build/server/chunks/chunks/state.js-BTDrgu7s.js +71 -0
  270. package/build/server/chunks/chunks/stream.js-D6r6iqjD.js +66 -0
  271. package/build/server/chunks/chunks/terms.js-DPZztSEn.js +88 -0
  272. package/build/server/chunks/chunks/ticket-system.js-Dj9R3XJw.js +147 -0
  273. package/build/server/chunks/chunks/ticket.js-6sj-2ZEM.js +110 -0
  274. package/build/server/chunks/chunks/timesheet.js-DfhIokoE.js +212 -0
  275. package/build/server/chunks/chunks/timesheet2.js-Cu95ddl3.js +84 -0
  276. package/build/server/chunks/chunks/to-workspace.js-DiOJP59J.js +308 -0
  277. package/build/server/chunks/chunks/toast-stack.svelte.js-CXIg3_KT.js +10 -0
  278. package/build/server/chunks/chunks/uneval.js-VnZcgzZr.js +488 -0
  279. package/build/server/chunks/chunks/utils.js-DQTBh7_6.js +1006 -0
  280. package/build/server/chunks/chunks/when-said.js-0F9asAma.js +35 -0
  281. package/build/server/chunks/chunks/workspace.js-BBdJRon9.js +212 -0
  282. package/build/server/chunks/entries/endpoints/api/board/_server.ts.js-BlYC_lpV.js +69 -0
  283. package/build/server/chunks/entries/endpoints/api/board/minimize/_server.ts.js-Wddt9YPR.js +68 -0
  284. package/build/server/chunks/entries/endpoints/api/board/move/_server.ts.js-BwZpCKx0.js +68 -0
  285. package/build/server/chunks/entries/endpoints/api/board/promote/_server.ts.js-Cw6kvkMq.js +68 -0
  286. package/build/server/chunks/entries/endpoints/api/board/pulls/_server.ts.js-DFhpbiMo.js +71 -0
  287. package/build/server/chunks/entries/endpoints/api/board/stop/_server.ts.js-D5eylDMw.js +68 -0
  288. package/build/server/chunks/entries/endpoints/api/card/_key_/answer/_server.ts.js-CG8xh52y.js +68 -0
  289. package/build/server/chunks/entries/endpoints/api/card/_key_/branch/_server.ts.js-a5_P9voA.js +40 -0
  290. package/build/server/chunks/entries/endpoints/api/card/_key_/chain/_server.ts.js-tJvQy6RK.js +70 -0
  291. package/build/server/chunks/entries/endpoints/api/card/_key_/checkouts/_server.ts.js-B2_gx6vF.js +41 -0
  292. package/build/server/chunks/entries/endpoints/api/card/_key_/choice/_server.ts.js-pmAdIQkK.js +34 -0
  293. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_id_/_server.ts.js-C5NxGWw3.js +68 -0
  294. package/build/server/chunks/entries/endpoints/api/card/_key_/comments/_server.ts.js-0rw7UNv8.js +64 -0
  295. package/build/server/chunks/entries/endpoints/api/card/_key_/commit/_server.ts.js-_yXWCOlQ.js +68 -0
  296. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-diff/_server.ts.js-CRPV3z-g.js +61 -0
  297. package/build/server/chunks/entries/endpoints/api/card/_key_/commit-message/_server.ts.js-CO9mD3u6.js +82 -0
  298. package/build/server/chunks/entries/endpoints/api/card/_key_/context/_server.ts.js-7kzrigFz.js +42 -0
  299. package/build/server/chunks/entries/endpoints/api/card/_key_/delete/_server.ts.js-DH0nO9wG.js +516 -0
  300. package/build/server/chunks/entries/endpoints/api/card/_key_/file/_server.ts.js-D80SvJDi.js +35 -0
  301. package/build/server/chunks/entries/endpoints/api/card/_key_/files/_...path_/_server.ts.js-GxFjb2H0.js +34 -0
  302. package/build/server/chunks/entries/endpoints/api/card/_key_/fix/_server.ts.js-B-HAB050.js +68 -0
  303. package/build/server/chunks/entries/endpoints/api/card/_key_/knowledge/_server.ts.js-D4fN-j7X.js +81 -0
  304. package/build/server/chunks/entries/endpoints/api/card/_key_/link/_other_/_server.ts.js-C00pQDCu.js +42 -0
  305. package/build/server/chunks/entries/endpoints/api/card/_key_/log/_server.ts.js-BXW_tG-I.js +32 -0
  306. package/build/server/chunks/entries/endpoints/api/card/_key_/log/raw/_server.ts.js-pT8StZGR.js +32 -0
  307. package/build/server/chunks/entries/endpoints/api/card/_key_/message/_server.ts.js-ZMno2Hu6.js +68 -0
  308. package/build/server/chunks/entries/endpoints/api/card/_key_/models/_server.ts.js-DEZVpqO3.js +73 -0
  309. package/build/server/chunks/entries/endpoints/api/card/_key_/patch/_server.ts.js-BxfLi-Zs.js +61 -0
  310. package/build/server/chunks/entries/endpoints/api/card/_key_/peek/_server.ts.js-CsTKWIP_.js +169 -0
  311. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/_server.ts.js-CsOeAXkf.js +53 -0
  312. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/comments/_server.ts.js-DZ2XHOhF.js +71 -0
  313. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discuss/_server.ts.js-CO8eM0e8.js +72 -0
  314. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/discussions/_server.ts.js-Lp7l0Yqv.js +71 -0
  315. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix/_server.ts.js-CeIhjpQ4.js +68 -0
  316. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/fix-all/_server.ts.js-D-DKoCpQ.js +68 -0
  317. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/links/_server.ts.js-B_q3jUP3.js +72 -0
  318. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/qa/_server.ts.js-BulVcJY9.js +68 -0
  319. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/seen/_server.ts.js-Z06A6MS1.js +71 -0
  320. package/build/server/chunks/entries/endpoints/api/card/_key_/pr/triage/_server.ts.js-qADU4URF.js +68 -0
  321. package/build/server/chunks/entries/endpoints/api/card/_key_/pull/_server.ts.js-CHnTH9WK.js +58 -0
  322. package/build/server/chunks/entries/endpoints/api/card/_key_/push/_server.ts.js-BPdPwPo2.js +83 -0
  323. package/build/server/chunks/entries/endpoints/api/card/_key_/repos/_server.ts.js-Bjqa3Uoo.js +73 -0
  324. package/build/server/chunks/entries/endpoints/api/card/_key_/research/_server.ts.js-DzQjoHOZ.js +138 -0
  325. package/build/server/chunks/entries/endpoints/api/card/_key_/retry/_server.ts.js-CAodrXqd.js +68 -0
  326. package/build/server/chunks/entries/endpoints/api/card/_key_/send-back/_server.ts.js-CmJSnvTx.js +68 -0
  327. package/build/server/chunks/entries/endpoints/api/card/_key_/stack/_server.ts.js-DjI8S94J.js +82 -0
  328. package/build/server/chunks/entries/endpoints/api/card/_key_/tasks/_server.ts.js-BzX_nNJk.js +71 -0
  329. package/build/server/chunks/entries/endpoints/api/card/_key_/thread/_server.ts.js-Dn36Guxk.js +33 -0
  330. package/build/server/chunks/entries/endpoints/api/cards/_server.ts.js-DPMOBsvp.js +77 -0
  331. package/build/server/chunks/entries/endpoints/api/cards/context/_server.ts.js-D6y-g2O-.js +52 -0
  332. package/build/server/chunks/entries/endpoints/api/cards/next/_server.ts.js-C2se67rf.js +55 -0
  333. package/build/server/chunks/entries/endpoints/api/chain/_server.ts.js-DKO5Q8GV.js +70 -0
  334. package/build/server/chunks/entries/endpoints/api/clones/_server.ts.js-Bgcc_Beg.js +56 -0
  335. package/build/server/chunks/entries/endpoints/api/current-project/_server.ts.js-DZCtSlXs.js +81 -0
  336. package/build/server/chunks/entries/endpoints/api/evidence/timesheet/_server.ts.js-xJwzSrcl.js +32 -0
  337. package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-BdcE7k8S.js +83 -0
  338. package/build/server/chunks/entries/endpoints/api/gh/_server.ts.js-CGvM8fn7.js +66 -0
  339. package/build/server/chunks/entries/endpoints/api/gh/name/_server.ts.js-CHh3tAu7.js +36 -0
  340. package/build/server/chunks/entries/endpoints/api/health/_server.ts.js-DLUfrHo6.js +22 -0
  341. package/build/server/chunks/entries/endpoints/api/login-item/_server.ts.js-Cya7S7W6.js +77 -0
  342. package/build/server/chunks/entries/endpoints/api/notes/_server.ts.js-DaUFVqSM.js +26 -0
  343. package/build/server/chunks/entries/endpoints/api/notifications/_server.ts.js-DK6NFnII.js +76 -0
  344. package/build/server/chunks/entries/endpoints/api/now/_server.ts.js-xW0jeJdy.js +83 -0
  345. package/build/server/chunks/entries/endpoints/api/package/entry/_server.ts.js-DQyZanpo.js +35 -0
  346. package/build/server/chunks/entries/endpoints/api/projects/_server.ts.js-CzXJTj_l.js +58 -0
  347. package/build/server/chunks/entries/endpoints/api/qa-setup/_server.ts.js-DujrYbEP.js +76 -0
  348. package/build/server/chunks/entries/endpoints/api/remove-check/_server.ts.js-1KAi9LDi.js +58 -0
  349. package/build/server/chunks/entries/endpoints/api/setup/_server.ts.js-D0MKtjR7.js +69 -0
  350. package/build/server/chunks/entries/endpoints/api/tickets/jira/_server.ts.js-Z2LdOr5l.js +39 -0
  351. package/build/server/chunks/entries/endpoints/api/tickets/read/_server.ts.js-BziHtc8Y.js +68 -0
  352. package/build/server/chunks/entries/endpoints/api/tools/_server.ts.js-oyvq8i1y.js +30 -0
  353. package/build/server/chunks/entries/endpoints/api/workspace/_server.ts.js-CMGBL5cX.js +58 -0
  354. package/build/server/chunks/entries/endpoints/api/workspace/commit/_server.ts.js-BZQQJ1YG.js +66 -0
  355. package/build/server/chunks/entries/endpoints/api/workspace/patch/_server.ts.js-xrjgHECx.js +64 -0
  356. package/build/server/chunks/entries/endpoints/api/workspace/push/_server.ts.js-CTdia7Uz.js +66 -0
  357. package/build/server/chunks/entries/hooks.server.js-B0jE-ELC.js +211 -0
  358. package/build/server/chunks/entries/pages/_error.svelte.js-DPcKI5sX.js +25 -0
  359. package/build/server/chunks/entries/pages/_layout.server.ts.js-Jj3i2Th9.js +134 -0
  360. package/build/server/chunks/entries/pages/_layout.svelte.js-Cu3ghN80.js +1251 -0
  361. package/build/server/chunks/entries/pages/_page.svelte.js-DEYydBCm.js +662 -0
  362. package/build/server/chunks/entries/pages/accept/_page.server.ts.js-BF7MrA5s.js +29 -0
  363. package/build/server/chunks/entries/pages/accept/_page.svelte.js-8yPsedd-.js +54 -0
  364. package/build/server/chunks/entries/pages/b/_board_/_page.svelte.js-S9acLF3f.js +68 -0
  365. package/build/server/chunks/entries/pages/b/_board_/_page.ts.js-BcKdG_Tp.js +21 -0
  366. package/build/server/chunks/entries/pages/b/research/_page.svelte.js-FW6Hw9g5.js +68 -0
  367. package/build/server/chunks/entries/pages/b/research/_page.ts.js-Ds2AjFFK.js +13 -0
  368. package/build/server/chunks/entries/pages/evidence/_page.server.ts.js-uwu2X7bA.js +1382 -0
  369. package/build/server/chunks/entries/pages/evidence/_page.svelte.js-DBCjiT59.js +594 -0
  370. package/build/server/chunks/entries/pages/f/_...path_/_page.svelte.js-DxwJaJzh.js +58 -0
  371. package/build/server/chunks/entries/pages/knowledge/_page.server.ts.js-BAUvFEcM.js +80 -0
  372. package/build/server/chunks/entries/pages/knowledge/_page.svelte.js-D9117gHM.js +732 -0
  373. package/build/server/chunks/entries/pages/new/_page.server.ts.js-BNCQQpyw.js +110 -0
  374. package/build/server/chunks/entries/pages/new/_page.svelte.js-Ben8-N_h.js +503 -0
  375. package/build/server/chunks/entries/pages/new/idea/_page.server.ts.js-jssA29y3.js +46 -0
  376. package/build/server/chunks/entries/pages/new/idea/_page.svelte.js-XoKspqAc.js +210 -0
  377. package/build/server/chunks/entries/pages/new/task/_page.server.ts.js-CmZgfvyt.js +66 -0
  378. package/build/server/chunks/entries/pages/new/task/_page.svelte.js-BKpERKvm.js +169 -0
  379. package/build/server/chunks/entries/pages/onboard/_page.server.ts.js-pmc_pXvs.js +12 -0
  380. package/build/server/chunks/entries/pages/onboard/_page.svelte.js-C7LNK-ba.js +5 -0
  381. package/build/server/chunks/entries/pages/projects/_page.server.ts.js-BEhLRfJ_.js +12 -0
  382. package/build/server/chunks/entries/pages/projects/_page.svelte.js-OraOjsyb.js +5 -0
  383. package/build/server/chunks/entries/pages/scout/_page.server.ts.js-hQYnMHwY.js +10 -0
  384. package/build/server/chunks/entries/pages/scout/_page.svelte.js-7q4d044Z.js +40 -0
  385. package/build/server/chunks/entries/pages/scout/f/_id_/_page.server.ts.js-BN4TnSpB.js +22 -0
  386. package/build/server/chunks/entries/pages/scout/f/_id_/_page.svelte.js-GzpLhARi.js +40 -0
  387. package/build/server/chunks/entries/pages/settings/_layout.server.ts.js-B5LgqMMT.js +12 -0
  388. package/build/server/chunks/entries/pages/settings/_layout.svelte.js-CSCpV6qA.js +81 -0
  389. package/build/server/chunks/entries/pages/settings/_page.svelte.js-DNpsNFo0.js +25 -0
  390. package/build/server/chunks/entries/pages/settings/_section_/_page.server.ts.js-nRDEV3i_.js +348 -0
  391. package/build/server/chunks/entries/pages/settings/_section_/_page.svelte.js-BihUf-nY.js +1052 -0
  392. package/build/server/chunks/entries/pages/settings/integrations/_page.server.ts.js-BTuRpg8m.js +58 -0
  393. package/build/server/chunks/entries/pages/settings/integrations/_page.svelte.js-C8i8ZmZR.js +161 -0
  394. package/build/server/chunks/entries/pages/settings/mcp/_page.server.ts.js-TFISfO1a.js +925 -0
  395. package/build/server/chunks/entries/pages/settings/mcp/_page.svelte.js-D1X0TNOm.js +433 -0
  396. package/build/server/chunks/entries/pages/settings/phases/_page.server.ts.js-CgK7MTZf.js +48 -0
  397. package/build/server/chunks/entries/pages/settings/phases/_page.svelte.js-u-sTQ-ue.js +80 -0
  398. package/build/server/chunks/entries/pages/settings/project/_page.server.ts.js-CCnk9WbO.js +363 -0
  399. package/build/server/chunks/entries/pages/settings/project/_page.svelte.js-MxvNqYlQ.js +1269 -0
  400. package/build/server/chunks/entries/pages/settings/wall/_page.server.ts.js-Bt5siY_N.js +12 -0
  401. package/build/server/chunks/entries/pages/settings/wall/_page.svelte.js-CMR4zSAt.js +43 -0
  402. package/build/server/chunks/entries/pages/t/_key_/_layout.server.ts.js-W6YPvOCA.js +124 -0
  403. package/build/server/chunks/entries/pages/t/_key_/_layout.svelte.js-CK0PiWsz.js +543 -0
  404. package/build/server/chunks/entries/pages/t/_key_/_page.server.ts.js-CdB7v0WX.js +15 -0
  405. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.server.ts.js-Bksaje8R.js +75 -0
  406. package/build/server/chunks/entries/pages/t/_key_/_tab_/_page.svelte.js-9OQ2eQxu.js +4607 -0
  407. package/build/server/chunks/entries/pages/team/_page.svelte.js-BdUSXC04.js +18 -0
  408. package/build/server/chunks/entries/pages/team/_page.ts.js-DfhJmoZI.js +20 -0
  409. package/build/server/chunks/entries/pages/workspace/_page.svelte.js-DLaWe23r.js +579 -0
  410. package/build/server/chunks/handler-Dlwmumt5.js +1735 -0
  411. package/build/server/chunks/index.js-BX0fZD5G.js +3701 -0
  412. package/build/server/chunks/manifest.js-B2Of6Dj7.js +761 -0
  413. package/build/server/chunks/nodes/0.js-DSzhdY0D.js +87 -0
  414. package/build/server/chunks/nodes/1.js-j4osL1br.js +9 -0
  415. package/build/server/chunks/nodes/10.js-jkvevEFY.js +75 -0
  416. package/build/server/chunks/nodes/11.js-plyiDP2n.js +72 -0
  417. package/build/server/chunks/nodes/12.js-DwtvDAyM.js +78 -0
  418. package/build/server/chunks/nodes/13.js-BpxwqFh4.js +72 -0
  419. package/build/server/chunks/nodes/14.js-B5iNIKGy.js +15 -0
  420. package/build/server/chunks/nodes/15.js-CXCAqUsG.js +15 -0
  421. package/build/server/chunks/nodes/16.js-oxkLEH0n.js +76 -0
  422. package/build/server/chunks/nodes/17.js-B-ZJEo9K.js +76 -0
  423. package/build/server/chunks/nodes/18.js-C0OUCEux.js +9 -0
  424. package/build/server/chunks/nodes/19.js-M8EAQJdW.js +76 -0
  425. package/build/server/chunks/nodes/2.js-ZedduK-3.js +33 -0
  426. package/build/server/chunks/nodes/20.js-BHvsLNjD.js +72 -0
  427. package/build/server/chunks/nodes/21.js-eOaW4si1.js +76 -0
  428. package/build/server/chunks/nodes/22.js-CbJ6tQSs.js +38 -0
  429. package/build/server/chunks/nodes/23.js-DXk8ejlx.js +81 -0
  430. package/build/server/chunks/nodes/24.js-C4qGJc4X.js +33 -0
  431. package/build/server/chunks/nodes/25.js-Cal8uT5V.js +21 -0
  432. package/build/server/chunks/nodes/26.js-Cp5jBcrN.js +80 -0
  433. package/build/server/chunks/nodes/27.js-Do55o_cb.js +17 -0
  434. package/build/server/chunks/nodes/28.js-SNz3QVix.js +9 -0
  435. package/build/server/chunks/nodes/3.js-DyivQ5dN.js +75 -0
  436. package/build/server/chunks/nodes/4.js-BGgTTQFR.js +9 -0
  437. package/build/server/chunks/nodes/5.js-DQYA2BBI.js +31 -0
  438. package/build/server/chunks/nodes/6.js-BVTi2KFL.js +24 -0
  439. package/build/server/chunks/nodes/7.js-CnprIn3p.js +12 -0
  440. package/build/server/chunks/nodes/8.js-Bdicn369.js +50 -0
  441. package/build/server/chunks/nodes/9.js-DVclPGXf.js +9 -0
  442. package/build/shims.js +33 -0
  443. package/dist/THIRD-PARTY-NOTICES.md +659 -0
  444. package/dist/detect-BmI_gskA.js +585 -0
  445. package/dist/fonts/OFL.txt +92 -0
  446. package/dist/nolzu.js +48 -0
  447. package/dist/package-vezZOzhD.js +181 -0
  448. package/dist/shared/finish.md +110 -0
  449. package/dist/shared/knowledge.md +72 -0
  450. package/dist/shared/verdict.md +42 -0
  451. package/dist/skills/.gitkeep +0 -0
  452. package/dist/skills/nolzu-architecture/SKILL.md +140 -0
  453. package/dist/skills/nolzu-architecture/finish.md +110 -0
  454. package/dist/skills/nolzu-assess/SKILL.md +99 -0
  455. package/dist/skills/nolzu-assess/finish.md +110 -0
  456. package/dist/skills/nolzu-design/SKILL.md +115 -0
  457. package/dist/skills/nolzu-design/finish.md +110 -0
  458. package/dist/skills/nolzu-feedback/SKILL.md +107 -0
  459. package/dist/skills/nolzu-feedback/finish.md +110 -0
  460. package/dist/skills/nolzu-implement/SKILL.md +138 -0
  461. package/dist/skills/nolzu-implement/finish.md +110 -0
  462. package/dist/skills/nolzu-investigate/SKILL.md +139 -0
  463. package/dist/skills/nolzu-investigate/finish.md +110 -0
  464. package/dist/skills/nolzu-learn-repo/SKILL.md +115 -0
  465. package/dist/skills/nolzu-learn-repo/finish.md +110 -0
  466. package/dist/skills/nolzu-learn-repo/knowledge.md +72 -0
  467. package/dist/skills/nolzu-optimize/SKILL.md +82 -0
  468. package/dist/skills/nolzu-optimize/finish.md +110 -0
  469. package/dist/skills/nolzu-optimize/knowledge.md +72 -0
  470. package/dist/skills/nolzu-orient/SKILL.md +115 -0
  471. package/dist/skills/nolzu-orient/finish.md +110 -0
  472. package/dist/skills/nolzu-orient/knowledge.md +72 -0
  473. package/dist/skills/nolzu-plan/SKILL.md +165 -0
  474. package/dist/skills/nolzu-plan/finish.md +110 -0
  475. package/dist/skills/nolzu-pr-review/SKILL.md +150 -0
  476. package/dist/skills/nolzu-pr-review/finish.md +110 -0
  477. package/dist/skills/nolzu-qa/SKILL.md +177 -0
  478. package/dist/skills/nolzu-qa/finish.md +110 -0
  479. package/dist/skills/nolzu-qa/verdict.md +42 -0
  480. package/dist/skills/nolzu-refine/SKILL.md +145 -0
  481. package/dist/skills/nolzu-refine/finish.md +110 -0
  482. package/dist/skills/nolzu-research/SKILL.md +140 -0
  483. package/dist/skills/nolzu-research/finish.md +110 -0
  484. package/dist/skills/nolzu-wrapup/SKILL.md +126 -0
  485. package/dist/skills/nolzu-wrapup/finish.md +110 -0
  486. package/dist/skills/nolzu-wrapup/knowledge.md +72 -0
  487. package/dist/src-BG8LaXLS.js +723 -0
  488. package/dist/src-DPfcvRqs.js +4 -0
  489. package/dist/start-ItZOcBtM.js +362 -0
  490. package/package.json +49 -9
  491. package/bin/nolzu.js +0 -8
@@ -0,0 +1,1525 @@
1
+ import { e as projectRepos, D as DEEP_FILES, E as proposeAllowedCommands, F as needsOnboarding, G as prefixProblem, t as isFolderName } from './estimate.js-BHTYVTaQ.js';
2
+ import { g as getSetting, w as writeSetting, p as pendingKnowledgeChanges } from './node.js-Bz2jT5wt.js';
3
+ import { k as resolveKnowledgeDir, r as repoKnowledgePath, l as repoKnowledge, R as RUN_RECIPE_FILE, m as runRecipe, p as planKnowledgeMoves } from './src2.js-CV8tsClO.js';
4
+ import { p as planProjectFiles, b as phaseInstructionsPath, d as detectEngines, c as runVersion, l as loginShellPath, e as applyPlan, w as writablePath, g as git, a as gitEnv, f as checkKnowledgeDir, k as knowledgeState, h as commitKnowledgeFiles, i as cloneTarget, O as OLD_WORKSPACE, G as GUARD_PATH, S as SETTINGS_PATH, s as scanProject } from './src3.js-h9tTEbVb.js';
5
+ import { s as skillsFolder, A as AGENTS_MD, p as pointerFile } from './project-files.js-DTC4jUxy.js';
6
+ import { k as knowledgeFiles } from './knowledge-page.js-D2ALB3v9.js';
7
+ import { u as unsavedLine } from './project-files-notice.js-CcqcBgUP.js';
8
+ import { readdirSync, existsSync, readFileSync, mkdirSync, rmSync, writeFileSync, renameSync, rmdirSync, mkdtempSync, statSync, lstatSync } from 'node:fs';
9
+ import { dirname, join, resolve, sep, basename, relative } from 'node:path';
10
+ import { tmpdir, homedir } from 'node:os';
11
+ import { createHash } from 'node:crypto';
12
+
13
+ //#region ../../packages/runner/src/project/skill-sync.ts
14
+ var SYNC_RECORD = ".nolzu-skills.json";
15
+ var RECORD_VERSION = "version";
16
+ var RECORD_KEPT = "kept";
17
+ var SKILL_FOLDERS = [".agents/skills", ".claude/skills"];
18
+ var EXTRA_SKILLS = ".nolzu/skills";
19
+ var hash = (text) => createHash("sha256").update(text).digest("hex");
20
+ function filesOf(root) {
21
+ const found = [];
22
+ const walk = (dir) => {
23
+ for (const entry of readdirSync(dir, { withFileTypes: true })) {
24
+ if (entry.name.startsWith(".")) continue;
25
+ const at = join(dir, entry.name);
26
+ if (entry.isDirectory()) walk(at);
27
+ else if (entry.isFile()) found.push(relative(root, at).split(sep).join("/"));
28
+ }
29
+ };
30
+ for (const entry of readdirSync(root, { withFileTypes: true })) if (entry.isDirectory() && !entry.name.startsWith(".")) walk(join(root, entry.name));
31
+ return found.sort();
32
+ }
33
+ function readRecord(target) {
34
+ try {
35
+ const parsed = JSON.parse(readFileSync(join(target, SYNC_RECORD), "utf8"));
36
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return {
37
+ files: {},
38
+ version: null,
39
+ kept: {}
40
+ };
41
+ const { [RECORD_VERSION]: version, [RECORD_KEPT]: kept, ...files } = parsed;
42
+ const strings = (from) => Object.fromEntries(Object.entries(typeof from === "object" && from !== null ? from : {}).filter((entry) => typeof entry[1] === "string"));
43
+ return {
44
+ files: strings(files),
45
+ version: typeof version === "string" ? version : null,
46
+ kept: strings(kept)
47
+ };
48
+ } catch {
49
+ return {
50
+ files: {},
51
+ version: null,
52
+ kept: {}
53
+ };
54
+ }
55
+ }
56
+ function writeRecord(target, { files, version, kept }) {
57
+ const record = `${JSON.stringify({
58
+ ...version === null ? {} : { [RECORD_VERSION]: version },
59
+ ...Object.keys(kept).length === 0 ? {} : { [RECORD_KEPT]: kept },
60
+ ...files
61
+ }, null, 2)}\n`;
62
+ const recordAt = join(target, SYNC_RECORD);
63
+ if (!isFile(recordAt) || readFileSync(recordAt, "utf8") !== record) writeFileSync(recordAt, record);
64
+ }
65
+ var shippedMark = (shipped) => shipped === null ? "gone" : hash(Buffer.from(shipped));
66
+ function newerVersion(a, b) {
67
+ const parse = (version) => /^(\d+)\.(\d+)\.(\d+)(?:-(.+))?$/.exec(version);
68
+ const x = parse(a);
69
+ const y = parse(b);
70
+ if (x === null || y === null) return false;
71
+ for (const at of [
72
+ 1,
73
+ 2,
74
+ 3
75
+ ]) if (Number(x[at]) !== Number(y[at])) return Number(x[at]) > Number(y[at]);
76
+ if (x[4] === void 0 || y[4] === void 0) return x[4] === void 0 && y[4] !== void 0;
77
+ return x[4] > y[4];
78
+ }
79
+ var isFile = (at) => {
80
+ try {
81
+ return lstatSync(at).isFile();
82
+ } catch {
83
+ return false;
84
+ }
85
+ };
86
+ function frontmatterName(file) {
87
+ try {
88
+ const head = /^---\n([\s\S]*?)\n---/.exec(readFileSync(file, "utf8").replace(/\r\n/g, "\n"))?.[1] ?? "";
89
+ return /^name:\s*['"]?([^'"\n]+?)['"]?\s*$/m.exec(head)?.[1] ?? null;
90
+ } catch {
91
+ return null;
92
+ }
93
+ }
94
+ var isFolder$1 = (at) => {
95
+ try {
96
+ return lstatSync(at).isDirectory();
97
+ } catch {
98
+ return false;
99
+ }
100
+ };
101
+ var hashOf = (at) => isFile(at) ? hash(readFileSync(at)) : null;
102
+ function pruneEmpty(dir, target) {
103
+ for (let at = dir; at !== target && at.startsWith(target + sep); at = dirname(at)) {
104
+ if (readdirSync(at).length > 0) return;
105
+ rmdirSync(at);
106
+ }
107
+ }
108
+ function syncSkills(source, targetFolder, { version, dryRun = false } = {}) {
109
+ const target = resolve(targetFolder);
110
+ const { files: recorded, version: wroteIt, kept: keptBefore } = readRecord(target);
111
+ if (version !== void 0 && wroteIt !== null && newerVersion(wroteIt, version)) return {
112
+ copied: [],
113
+ removed: [],
114
+ conflicts: [],
115
+ kept: [],
116
+ newer: wroteIt
117
+ };
118
+ const next = {};
119
+ const kept = { ...keptBefore };
120
+ const result = {
121
+ copied: [],
122
+ removed: [],
123
+ conflicts: [],
124
+ kept: []
125
+ };
126
+ const origin = /* @__PURE__ */ new Map();
127
+ const [own, ...extra] = [source].flat();
128
+ for (const path of filesOf(own ?? "")) origin.set(path, own ?? "");
129
+ const shipped = new Set([...origin.keys()].map((path) => (path.split("/")[0] ?? "").toLowerCase()));
130
+ for (const root of extra) {
131
+ const clashes = /* @__PURE__ */ new Set();
132
+ const named = (skill) => shipped.has(skill.toLowerCase()) || shipped.has((frontmatterName(join(root, skill, "SKILL.md")) ?? "").toLowerCase());
133
+ for (const path of filesOf(root)) {
134
+ const skill = path.split("/")[0] ?? "";
135
+ if (named(skill)) clashes.add(skill);
136
+ else origin.set(path, root);
137
+ }
138
+ for (const skill of [...clashes].sort()) (result.refused ??= []).push(`The skill ${skill} in ${EXTRA_SKILLS} has the name of a skill Nolzu ships, in its folder or its SKILL.md, so it was not copied. Rename its folder and its name.`);
139
+ }
140
+ const wanted = [...origin.keys()].sort();
141
+ const wantedFolded = new Set(wanted.map((path) => path.toLowerCase()));
142
+ const keep = (path, mark) => {
143
+ if (kept[path] === mark) result.kept.push(path);
144
+ else {
145
+ result.conflicts.push(path);
146
+ delete kept[path];
147
+ }
148
+ if (typeof recorded[path] === "string") next[path] = recorded[path];
149
+ };
150
+ for (const path of wanted) {
151
+ const content = readFileSync(join(origin.get(path) ?? "", path));
152
+ const fresh = hash(content);
153
+ const at = writablePath(target, path);
154
+ if (at === null) {
155
+ keep(path, fresh);
156
+ continue;
157
+ }
158
+ const missing = !isFile(at);
159
+ const there = hashOf(at);
160
+ if (there === fresh) {
161
+ next[path] = fresh;
162
+ delete kept[path];
163
+ continue;
164
+ }
165
+ if (missing || there !== null && there === recorded[path]) {
166
+ if (!dryRun) {
167
+ mkdirSync(dirname(at), { recursive: true });
168
+ writeFileSync(at, content);
169
+ }
170
+ next[path] = fresh;
171
+ delete kept[path];
172
+ result.copied.push(path);
173
+ continue;
174
+ }
175
+ keep(path, fresh);
176
+ }
177
+ for (const path of Object.keys(recorded).sort()) {
178
+ if (wanted.includes(path) || wantedFolded.has(path.toLowerCase())) continue;
179
+ const at = writablePath(target, path);
180
+ if (at === null) continue;
181
+ const there = hashOf(at);
182
+ if (there === null) {
183
+ delete kept[path];
184
+ continue;
185
+ }
186
+ if (there !== recorded[path]) {
187
+ keep(path, shippedMark(null));
188
+ continue;
189
+ }
190
+ if (!dryRun) {
191
+ rmSync(at);
192
+ pruneEmpty(dirname(at), target);
193
+ }
194
+ delete kept[path];
195
+ result.removed.push(path);
196
+ }
197
+ result.conflicts.sort();
198
+ result.kept.sort();
199
+ if (dryRun) return result;
200
+ mkdirSync(target, { recursive: true });
201
+ writeRecord(target, {
202
+ files: next,
203
+ version: version ?? null,
204
+ kept
205
+ });
206
+ return result;
207
+ }
208
+ function takeShippedSkill(targetFolder, path, shipped) {
209
+ const target = resolve(targetFolder);
210
+ const at = writablePath(target, path);
211
+ if (at === null) return false;
212
+ const record = readRecord(target);
213
+ delete record.kept[path];
214
+ if (shipped === null) {
215
+ if (isFile(at)) {
216
+ rmSync(at);
217
+ pruneEmpty(dirname(at), target);
218
+ }
219
+ delete record.files[path];
220
+ } else {
221
+ mkdirSync(dirname(at), { recursive: true });
222
+ writeFileSync(at, shipped);
223
+ record.files[path] = hash(shipped);
224
+ }
225
+ writeRecord(target, record);
226
+ return true;
227
+ }
228
+ function keepForShipped(targetFolder, path, mark) {
229
+ const target = resolve(targetFolder);
230
+ const record = readRecord(target);
231
+ if (mark === null) delete record.kept[path];
232
+ else record.kept[path] = mark;
233
+ mkdirSync(target, { recursive: true });
234
+ writeRecord(target, record);
235
+ }
236
+ var keptMark = (targetFolder, path) => readRecord(resolve(targetFolder)).kept[path] ?? null;
237
+ function personsSkillText(targetFolder, path, shipped) {
238
+ const target = resolve(targetFolder);
239
+ const at = join(target, path);
240
+ if (!isFile(at)) return null;
241
+ const bytes = readFileSync(at);
242
+ const text = bytes.toString("utf8");
243
+ if (text === shipped) return null;
244
+ return readRecord(target).files[path] === hash(bytes) ? null : text;
245
+ }
246
+ function syncSkillFolders(source, project, options = {}) {
247
+ const extra = join(resolve(project), EXTRA_SKILLS);
248
+ const sources = writablePath(resolve(project), `.nolzu/skills/.nolzu-skills.json`) !== null && isFolder$1(extra) ? [source, extra] : [source];
249
+ return SKILL_FOLDERS.map((folder) => ({
250
+ folder,
251
+ synced: writablePath(resolve(project), `${folder}/.nolzu-skills.json`) === null ? null : syncSkills(sources, join(project, folder), options)
252
+ }));
253
+ }
254
+ function personsSkillEdit(project, path, shipped) {
255
+ for (const folder of SKILL_FOLDERS) {
256
+ const text = personsSkillText(join(project, folder), path, shipped);
257
+ if (text !== null) return {
258
+ text,
259
+ folder
260
+ };
261
+ }
262
+ return null;
263
+ }
264
+ //#endregion
265
+ //#region src/lib/manifest.ts
266
+ /**
267
+ * The tracked list of a project's clones, so a teammate who clones the workspace can clone the rest.
268
+ *
269
+ * The file travels with the workspace, so every entry is read as untrusted: its URL passes the same
270
+ * rules as a URL a person types, and a bad entry is named rather than thrown.
271
+ */
272
+ var MANIFEST = ".nolzu/repositories.json";
273
+ function entries(text) {
274
+ let parsed;
275
+ try {
276
+ parsed = JSON.parse(text);
277
+ } catch {
278
+ return { why: `${MANIFEST} is not JSON` };
279
+ }
280
+ const list = typeof parsed === "object" && parsed !== null ? parsed.repositories : void 0;
281
+ return Array.isArray(list) ? { list } : { why: `${MANIFEST} has no list of repositories` };
282
+ }
283
+ var isBase = (value) => typeof value === "string" && value !== "" && !value.startsWith("-") && !/\s/.test(value);
284
+ /** The good entries of the file, and one sentence for each bad one. No file is no repository. */
285
+ function parseManifest(text) {
286
+ if (text === null) return {
287
+ repos: [],
288
+ problems: []
289
+ };
290
+ const read = entries(text);
291
+ if ("why" in read) return {
292
+ repos: [],
293
+ problems: [`${read.why}, so Nolzu reads no repository from it.`]
294
+ };
295
+ const repos = [];
296
+ const problems = [];
297
+ for (const [index, row] of read.list.entries()) {
298
+ if (typeof row !== "object" || row === null || Array.isArray(row)) {
299
+ problems.push(`Entry ${index + 1} of ${MANIFEST} is not a folder, a URL and a base branch.`);
300
+ continue;
301
+ }
302
+ const { folder, url, base } = row;
303
+ if (typeof folder !== "string" || !isFolderName(folder)) {
304
+ problems.push(`Entry ${index + 1} of ${MANIFEST} names no folder Nolzu can clone into.`);
305
+ continue;
306
+ }
307
+ const entry = `In ${MANIFEST}, the entry ${JSON.stringify(folder)}`;
308
+ const target = cloneTarget(typeof url === "string" ? url : "");
309
+ if (!target.ok) problems.push(`${entry} cannot be cloned. ${target.reason}`);
310
+ else if (target.name !== folder) problems.push(`${entry} has a URL that clones into ${JSON.stringify(target.name)}, not into ${JSON.stringify(folder)}.`);
311
+ else if (!isBase(base)) problems.push(`${entry} has no base branch Nolzu can use.`);
312
+ else if (repos.some((one) => one.folder.toLowerCase() === folder.toLowerCase())) problems.push(`${entry} is there twice.`);
313
+ else repos.push({
314
+ folder,
315
+ url: url.trim(),
316
+ base
317
+ });
318
+ }
319
+ return {
320
+ repos,
321
+ problems
322
+ };
323
+ }
324
+ /**
325
+ * The file with this entry in it, null when it is there already, or why the file was left alone.
326
+ *
327
+ * An entry of the same folder in any case is replaced. Every other entry stays as it is, a bad one
328
+ * included, because it is a person's to fix. A workspace's file says so at the top, because a root
329
+ * repository that holds code keeps a manifest too, and only a workspace drops its root from the list.
330
+ */
331
+ function manifestWith(text, repo, workspace = false) {
332
+ const read = text === null ? { list: [] } : entries(text);
333
+ if ("why" in read) return { problem: `${read.why}, so Nolzu left it alone and did not add ${repo.folder} to it.` };
334
+ const kept = text === null ? {} : JSON.parse(text);
335
+ const same = (row) => typeof row === "object" && row !== null && String(row.folder).toLowerCase() === repo.folder.toLowerCase();
336
+ const was = read.list.find(same);
337
+ if ((!workspace || kept.workspace === true) && was !== void 0 && was.folder === repo.folder && was.url === repo.url && was.base === repo.base) return null;
338
+ const list = was === void 0 ? [...read.list, repo] : read.list.map((row) => row === was ? repo : row);
339
+ return { text: `${JSON.stringify({
340
+ ...kept,
341
+ ...workspace ? { workspace: true } : {},
342
+ repositories: list
343
+ }, null, 2)}\n` };
344
+ }
345
+ /** The .gitignore with `/<folder>/` added, or null when a line ignores the folder already. */
346
+ function ignoreWith(text, folder) {
347
+ const forms = [
348
+ `/${folder}/`,
349
+ `/${folder}`,
350
+ `${folder}/`,
351
+ folder
352
+ ];
353
+ if ((text ?? "").split("\n").map((line) => line.trim()).some((line) => forms.includes(line))) return null;
354
+ return `${text === null || text === "" ? "" : text.endsWith("\n") ? text : `${text}\n`}/${folder}/\n`;
355
+ }
356
+ /** The file without the entry of this folder, in any case, null when it has none, or why it was left alone. */
357
+ function manifestWithout(text, folder) {
358
+ if (text === null) return null;
359
+ const read = entries(text);
360
+ if ("why" in read) return { problem: `${read.why}, so Nolzu left it alone and did not take ${folder} out of it.` };
361
+ const same = (row) => typeof row === "object" && row !== null && String(row.folder).toLowerCase() === folder.toLowerCase();
362
+ if (!read.list.some(same)) return null;
363
+ const kept = JSON.parse(text);
364
+ return { text: `${JSON.stringify({
365
+ ...kept,
366
+ repositories: read.list.filter((row) => !same(row))
367
+ }, null, 2)}\n` };
368
+ }
369
+ /** The .gitignore without the line that ignores the folder at the top, or null when no line does. */
370
+ function ignoreWithout(text, folder) {
371
+ if (text === null) return null;
372
+ const forms = [`/${folder}/`, `/${folder}`];
373
+ const lines = text.split("\n");
374
+ const kept = lines.filter((line) => !forms.includes(line.trim()));
375
+ return kept.length === lines.length ? null : kept.join("\n");
376
+ }
377
+ var readText = (path) => {
378
+ try {
379
+ return readFileSync(path, "utf8");
380
+ } catch {
381
+ return null;
382
+ }
383
+ };
384
+ /** The manifest of a project folder, read the way `parseManifest` reads it. */
385
+ function readManifest(project) {
386
+ const path = writablePath(project, MANIFEST);
387
+ if (path === null) return {
388
+ repos: [],
389
+ problems: [`${MANIFEST} is a link or sits in a linked folder, so Nolzu reads no repository from it.`]
390
+ };
391
+ return parseManifest(readText(path));
392
+ }
393
+ var turns = /* @__PURE__ */ new Map();
394
+ function inTurn(project, work) {
395
+ const run = (turns.get(project) ?? Promise.resolve()).then(work);
396
+ turns.set(project, run.catch(() => void 0));
397
+ return run;
398
+ }
399
+ /**
400
+ * Gives each new clone its .gitignore line and its manifest entry, and commits both in the project
401
+ * folder's own repository. A clone with no URL Nolzu can clone from gets the line only.
402
+ *
403
+ * A project folder that is not its own repository has nothing to commit to, so it gets neither. When
404
+ * the manifest cannot take the entry, nothing is written. A refused commit leaves both files changed
405
+ * on disk, and the sentence says so.
406
+ */
407
+ async function recordInRoot(project, clones, workspace, env, subject) {
408
+ const run = (args) => git(args, {
409
+ cwd: project,
410
+ env: gitEnv(env)
411
+ });
412
+ const top = await run(["rev-parse", "--show-prefix"]);
413
+ if (top.code !== 0 || top.stdout.trim() !== "" || clones.length === 0) return {
414
+ recorded: false,
415
+ problem: null
416
+ };
417
+ const names = clones.map((clone) => clone.folder).join(", ");
418
+ const ignore = writablePath(project, ".gitignore");
419
+ if (ignore === null) return {
420
+ recorded: false,
421
+ problem: `.gitignore in the project folder is a link or not a plain file, so Nolzu did not add ${names} to it.`
422
+ };
423
+ const listed = clones.some((clone) => clone.url !== null);
424
+ const manifest = writablePath(project, MANIFEST);
425
+ if (listed && manifest === null) return {
426
+ recorded: false,
427
+ problem: `${MANIFEST} is a link or sits in a linked folder, so Nolzu did not add ${names} to it.`
428
+ };
429
+ const ignoreBefore = readText(ignore);
430
+ let ignoreText = ignoreBefore;
431
+ const manifestBefore = listed && manifest !== null ? readText(manifest) : null;
432
+ let manifestText = manifestBefore;
433
+ for (const clone of clones) {
434
+ ignoreText = ignoreWith(ignoreText, clone.folder) ?? ignoreText;
435
+ if (clone.url === null) continue;
436
+ const next = manifestWith(manifestText, {
437
+ folder: clone.folder,
438
+ url: clone.url,
439
+ base: clone.base
440
+ }, workspace);
441
+ if (next !== null && "problem" in next) return {
442
+ recorded: false,
443
+ problem: next.problem
444
+ };
445
+ if (next !== null) manifestText = next.text;
446
+ }
447
+ const writes = [{
448
+ name: ".gitignore",
449
+ path: ignore,
450
+ text: ignoreText,
451
+ before: ignoreBefore
452
+ }, {
453
+ name: MANIFEST,
454
+ path: manifest,
455
+ text: manifestText,
456
+ before: manifestBefore
457
+ }].filter((one) => one.path !== null && one.text !== null && one.text !== one.before);
458
+ if (writes.length === 0) return {
459
+ recorded: true,
460
+ problem: null
461
+ };
462
+ const theirs = await run([
463
+ "status",
464
+ "--porcelain",
465
+ "--",
466
+ ...writes.map((one) => one.name)
467
+ ]);
468
+ const changed = [];
469
+ let writing = "";
470
+ try {
471
+ for (const one of writes) {
472
+ writing = one.name;
473
+ mkdirSync(dirname(one.path), { recursive: true });
474
+ writeFileSync(one.path, one.text);
475
+ changed.push(one.name);
476
+ }
477
+ } catch (error) {
478
+ if (changed.includes(".gitignore") && ignoreBefore === null) rmSync(ignore, { force: true });
479
+ else if (changed.includes(".gitignore") && ignoreBefore !== null) writeFileSync(ignore, ignoreBefore);
480
+ return {
481
+ recorded: false,
482
+ problem: `Nolzu could not write ${writing} in the project folder. ${error.message}`
483
+ };
484
+ }
485
+ if (theirs.code !== 0 || theirs.stdout.trim() !== "") return {
486
+ recorded: true,
487
+ problem: `${changed.join(" and ")} name ${names} now. Nolzu did not commit them, because they held changes of yours that were not committed.`
488
+ };
489
+ try {
490
+ await commitKnowledgeFiles(run, subject ?? `chore: add ${names}`, changed);
491
+ } catch (error) {
492
+ return {
493
+ recorded: true,
494
+ problem: `${changed.join(" and ")} name ${names} now, but git could not commit them. ${error.message}`
495
+ };
496
+ }
497
+ return {
498
+ recorded: true,
499
+ problem: null
500
+ };
501
+ }
502
+ /**
503
+ * Takes a removed clone out of the root's .gitignore and manifest, and commits both, in two steps.
504
+ *
505
+ * The check runs before the folder goes, so a file Nolzu cannot change stops the remove while
506
+ * nothing is lost. `finish` writes after the folder went, and answers what it could not do. A
507
+ * project folder that is not its own repository keeps neither file. Edits of the person that are
508
+ * not committed stop the commit, not the write, as they do on an add.
509
+ */
510
+ async function forgetInRoot(project, folder, env) {
511
+ const nothing = { finish: async () => null };
512
+ if (!existsSync(project)) return nothing;
513
+ const run = (args) => git(args, {
514
+ cwd: project,
515
+ env: gitEnv(env)
516
+ });
517
+ const top = await run(["rev-parse", "--show-prefix"]);
518
+ if (top.code !== 0 || top.stdout.trim() !== "") return nothing;
519
+ const ignore = writablePath(project, ".gitignore");
520
+ if (ignore === null) return { problem: `.gitignore in the project folder is a link or not a plain file, so Nolzu cannot take ${folder} out of it.` };
521
+ const manifest = writablePath(project, MANIFEST);
522
+ if (manifest === null) return { problem: `${MANIFEST} is a link or sits in a linked folder, so Nolzu cannot take ${folder} out of it.` };
523
+ let ignoreBefore = null;
524
+ const next = () => {
525
+ const manifestNext = manifestWithout(readText(manifest), folder);
526
+ if (manifestNext !== null && "problem" in manifestNext) return manifestNext;
527
+ ignoreBefore = readText(ignore);
528
+ return [{
529
+ name: ".gitignore",
530
+ path: ignore,
531
+ text: ignoreWithout(ignoreBefore, folder)
532
+ }, {
533
+ name: MANIFEST,
534
+ path: manifest,
535
+ text: manifestNext?.text ?? null
536
+ }].filter((one) => one.text !== null);
537
+ };
538
+ const first = next();
539
+ if ("problem" in first) return first;
540
+ return { finish: async () => {
541
+ if (first.length === 0) return null;
542
+ const theirs = await run([
543
+ "status",
544
+ "--porcelain",
545
+ "--",
546
+ ...first.map((one) => one.name)
547
+ ]);
548
+ const writes = next();
549
+ if ("problem" in writes) return writes.problem;
550
+ const changed = [];
551
+ try {
552
+ for (const one of writes) {
553
+ writeFileSync(one.path, one.text);
554
+ changed.push(one.name);
555
+ }
556
+ } catch (error) {
557
+ if (changed.includes(".gitignore") && ignoreBefore !== null) writeFileSync(ignore, ignoreBefore);
558
+ return `Nolzu could not take ${folder} out of ${writes[changed.length]?.name} in the project folder. ${error.message}`;
559
+ }
560
+ if (changed.length === 0) return null;
561
+ const names = changed.join(" and ");
562
+ if (theirs.code !== 0 || theirs.stdout.trim() !== "") return `${names} no longer name ${folder}. Nolzu did not commit them, because they held changes of yours that were not committed.`;
563
+ try {
564
+ await commitKnowledgeFiles(run, `chore: remove ${folder}`, changed);
565
+ } catch (error) {
566
+ return `${names} no longer name ${folder}, but git could not commit them. ${error.message}`;
567
+ }
568
+ return null;
569
+ } };
570
+ }
571
+ //#endregion
572
+ //#region src/lib/onboard.ts
573
+ var NOLZU_VERSION = {
574
+ version: "0.1.0"}.version;
575
+ function onboardRedirect(db, pathname) {
576
+ if (pathname === "/new" || pathname.startsWith("/new/")) return null;
577
+ return needsOnboarding({
578
+ projectPath: getSetting(db, "projectPath"),
579
+ onboarding: getSetting(db, "onboarding")
580
+ }) ? "/new" : null;
581
+ }
582
+ function engineCheck(run = runVersion({
583
+ ...process.env,
584
+ PATH: loginShellPath(process.env)
585
+ })) {
586
+ return detectEngines(run);
587
+ }
588
+ function resolveProjectPath(input, home) {
589
+ const typed = input.trim();
590
+ if (typed === "~") return home;
591
+ if (typed.startsWith("~/")) return join(home, typed.slice(2));
592
+ return resolve(home, typed);
593
+ }
594
+ var plainEnv = (env) => Object.fromEntries(Object.entries(env).filter((entry) => entry[1] !== void 0));
595
+ async function checkProject(answer) {
596
+ if (answer.path.trim() === "") return {
597
+ path: "",
598
+ scan: {
599
+ ok: false,
600
+ reason: "Type the folder that holds your project."
601
+ }
602
+ };
603
+ const path = resolveProjectPath(answer.path, answer.home ?? homedir());
604
+ return {
605
+ path,
606
+ scan: await scanProject(path, {
607
+ branchTemplate: answer.template,
608
+ env: plainEnv(answer.env ?? process.env)
609
+ })
610
+ };
611
+ }
612
+ /**
613
+ * Stores the project folder, and lets go of the team when the folder is another one.
614
+ *
615
+ * `teamProjectId` is one value for the machine and not one per project, and a `project.join` job is
616
+ * the only thing that writes it. So a machine that joined a team and was then pointed at a folder
617
+ * of its own kept the old id, and the wrap-up run on that folder read it: nothing was committed to
618
+ * the person's own knowledge files, the note was held aside, and a proposal carrying it went up the
619
+ * old team's socket. The id goes with the folder it was joined for.
620
+ *
621
+ * The job mark is not reset here. `project.join` already zeroes it for an id that is not the stored
622
+ * one, and after this there is none stored.
623
+ *
624
+ * A repository list saved before goes too, or a project of one repository would read the old
625
+ * project's repositories. A caller that saves several writes its own list after this. Only a list
626
+ * that is there is cleared, so a single repository writes what it always wrote. The workspace flag
627
+ * goes the same way.
628
+ */
629
+ function saveProjectPath(db, path, keepTeam = false) {
630
+ if (!keepTeam && getSetting(db, "projectPath") !== path) {
631
+ writeSetting(db, "teamProjectId", null);
632
+ writeSetting(db, "qaApp", null);
633
+ }
634
+ writeSetting(db, "projectPath", path);
635
+ if (getSetting(db, "repos") !== null) writeSetting(db, "repos", null);
636
+ if (getSetting(db, "workspace") !== null) writeSetting(db, "workspace", null);
637
+ }
638
+ var repoLabel = (path) => path === "." ? "the repository in the project folder" : `the repository ${path}`;
639
+ var capital = (text) => text.charAt(0).toUpperCase() + text.slice(1);
640
+ /**
641
+ * The branch a scanned repository's cards start from, or the sentence that names why it has none.
642
+ *
643
+ * Onboarding and the rescan on the Projects page both ask here, so both say the same sentence. Only
644
+ * the last words differ, because one page has a Save button and the other a Scan again button.
645
+ */
646
+ async function scannedBase(project, repo, env = process.env, again = "save again") {
647
+ const name = repoLabel(repo.path);
648
+ if (repo.base.kind === "unborn") return { reason: `In ${name}, the branch ${repo.base.name} has no commit yet, so a card has nothing to start from. Make a first commit there, then ${again}.` };
649
+ if (repo.base.kind === "detached") return { reason: `${capital(name)} is on no branch. Check out the branch cards should start from there, then ${again}.` };
650
+ const base = repo.base.name;
651
+ if (await baseBranchProblem(join(project, repo.path), base, env, repo.path) !== null) return { reason: `There is no local branch ${base} in ${name}. Make it there with git branch ${base} origin/${base}, then ${again}.` };
652
+ return { base };
653
+ }
654
+ /**
655
+ * Why cards cannot start from this branch, or null when they can.
656
+ *
657
+ * Checked while the person is here, rather than when the first card fails to start. Every save of a
658
+ * base asks here, so each says the same sentence.
659
+ */
660
+ async function baseBranchProblem(path, base, env = process.env, repo = null) {
661
+ const run = (ref) => git([
662
+ "rev-parse",
663
+ "--verify",
664
+ "--quiet",
665
+ ref
666
+ ], {
667
+ cwd: path,
668
+ env: gitEnv(plainEnv(env))
669
+ });
670
+ const where = repo === null ? "this repository" : repoLabel(repo);
671
+ if (base.startsWith("-")) return `There is no branch ${base} in ${where}. Type a branch it has, such as the one it is on.`;
672
+ if ((await run(`refs/heads/${base}`)).code === 0) return null;
673
+ if ((await run(`refs/remotes/origin/${base}`)).code === 0) return `There is no local branch ${base} in ${where}. Make it there with git branch ${base} origin/${base}, then save again.`;
674
+ return `There is no branch ${base} in ${where}. Type a branch it has, such as the one it is on.`;
675
+ }
676
+ /**
677
+ * baseBranchProblem for a base picked from origin's branches: one only origin has gets its local
678
+ * tracking branch first, so a fresh clone can start cards from any branch origin had.
679
+ *
680
+ * `git branch --track` writes one ref. It changes no file and moves no checkout, and a local branch of
681
+ * that name is used as it is. When git refuses the name, the sentence with the git step stays.
682
+ */
683
+ async function trackBaseBranch(path, base, env = process.env, repo = null) {
684
+ if (!base.startsWith("-")) await git([
685
+ "branch",
686
+ "--quiet",
687
+ "--track",
688
+ base,
689
+ `refs/remotes/origin/${base}`
690
+ ], {
691
+ cwd: path,
692
+ env: gitEnv(plainEnv(env))
693
+ });
694
+ return baseBranchProblem(path, base, env, repo);
695
+ }
696
+ var WORKSPACE_GITIGNORE = "/worktrees/\n/.tasks/\n";
697
+ var isFolder = (path) => {
698
+ try {
699
+ return statSync(path).isDirectory();
700
+ } catch {
701
+ return false;
702
+ }
703
+ };
704
+ var taken = (path) => {
705
+ try {
706
+ lstatSync(path);
707
+ return true;
708
+ } catch {
709
+ return false;
710
+ }
711
+ };
712
+ function workspaceTarget(answer) {
713
+ const name = answer.name.trim();
714
+ if (name === "") return {
715
+ ok: false,
716
+ reason: "Type a name for the workspace. It becomes the name of its folder."
717
+ };
718
+ if (!isFolderName(name)) return {
719
+ ok: false,
720
+ reason: `The name ${JSON.stringify(name)} cannot name a folder. Use one folder name with no slash that does not start with "-" and is not worktrees, .tasks or .nolzu.`
721
+ };
722
+ if (answer.parent.trim() === "") return {
723
+ ok: false,
724
+ reason: "Type the folder the workspace goes in."
725
+ };
726
+ const parent = resolveProjectPath(answer.parent, answer.home ?? homedir());
727
+ if (!isFolder(parent)) return {
728
+ ok: false,
729
+ reason: `The folder ${parent} is not there. Make it first, or type a folder that is.`
730
+ };
731
+ const path = join(parent, name);
732
+ if (taken(path)) return {
733
+ ok: false,
734
+ reason: `${path} is there already. Pick another name, or another folder to put it in.`
735
+ };
736
+ return {
737
+ ok: true,
738
+ path,
739
+ parent
740
+ };
741
+ }
742
+ var withMissing = (target) => target.ok ? {
743
+ ...target,
744
+ missing: [target.path]
745
+ } : target;
746
+ /**
747
+ * Where a project folder typed as the folder itself goes, or why it cannot go there. Nothing is written.
748
+ *
749
+ * `missing` lists the folders a create makes, the top one first, and `parent` is the nearest folder
750
+ * that is there. A folder that is there must be empty, so Nolzu only ever writes into a folder it made
751
+ * or one with nothing in it.
752
+ */
753
+ function folderTarget(answer) {
754
+ if (answer.folder.trim() === "") return {
755
+ ok: false,
756
+ reason: "Type the project folder. Nolzu makes it if it is not there."
757
+ };
758
+ const path = resolve(resolveProjectPath(answer.folder, answer.home ?? homedir()));
759
+ const name = basename(path);
760
+ if (!isFolderName(name)) return {
761
+ ok: false,
762
+ reason: `The folder name ${JSON.stringify(name)} cannot be used. Use a name that does not start with "-" and is not worktrees, .tasks or .nolzu.`
763
+ };
764
+ const missing = [];
765
+ let at = path;
766
+ while (!taken(at)) {
767
+ missing.unshift(at);
768
+ at = dirname(at);
769
+ }
770
+ if (!isFolder(at)) return {
771
+ ok: false,
772
+ reason: `${at} is a file, not a folder. Type another folder for the project.`
773
+ };
774
+ if (missing.length === 0 && readdirSync(path).length > 0) return {
775
+ ok: false,
776
+ reason: `${path} has files in it already. Type a new folder, or an empty one.`
777
+ };
778
+ return {
779
+ ok: true,
780
+ path,
781
+ parent: at,
782
+ missing
783
+ };
784
+ }
785
+ function removeMade(made) {
786
+ for (const folder of [...made].reverse()) try {
787
+ rmdirSync(folder);
788
+ } catch {
789
+ return;
790
+ }
791
+ }
792
+ /**
793
+ * Makes a new workspace at <parent>/<name>, or at the folder typed: a git repository that holds the
794
+ * Nolzu files and the knowledge folder, ignores the checkouts, and has no repository of its own to
795
+ * change yet.
796
+ *
797
+ * With <parent>/<name> the folder must not be there yet, and a typed folder must be empty or not
798
+ * there, so Nolzu only ever writes into a folder it made or an empty one. Everything
799
+ * that can be asked is asked before that folder is made: the name, the parent, and whether git has
800
+ * a name to commit with. Those refusals leave nothing behind. If git still refuses the commit, the
801
+ * files stay and the reason says so.
802
+ */
803
+ async function makeWorkspace(db, answer, keepTeam = false) {
804
+ const target = "folder" in answer ? folderTarget(answer) : withMissing(workspaceTarget(answer));
805
+ if (!target.ok) return target;
806
+ const { path, parent, missing } = target;
807
+ const env = gitEnv(plainEnv(answer.env ?? process.env));
808
+ const version = await git(["--version"], {
809
+ cwd: parent,
810
+ env
811
+ }).catch((error) => ({
812
+ code: 127,
813
+ stdout: "",
814
+ stderr: error.message
815
+ }));
816
+ if (version.code !== 0) return {
817
+ ok: false,
818
+ reason: `git does not run on this machine, so nothing was written. ${process.platform === "darwin" ? "Install the Command Line Tools with xcode-select --install" : "Install git"}, then try again. ${version.stderr.trim()}`.trim()
819
+ };
820
+ const who = await git(["var", "GIT_AUTHOR_IDENT"], {
821
+ cwd: parent,
822
+ env
823
+ });
824
+ if (who.code !== 0) return {
825
+ ok: false,
826
+ reason: `git has no name and email to commit with, so nothing was written. ${who.stderr.trim()}`
827
+ };
828
+ const madeHere = [];
829
+ try {
830
+ for (const folder of missing) {
831
+ mkdirSync(folder);
832
+ madeHere.push(folder);
833
+ }
834
+ } catch {
835
+ removeMade(madeHere);
836
+ return {
837
+ ok: false,
838
+ reason: `${path} could not be made. Check that you can write in ${parent}.`
839
+ };
840
+ }
841
+ const started = await git([
842
+ "init",
843
+ "-q",
844
+ "-b",
845
+ "main",
846
+ path
847
+ ], {
848
+ cwd: path,
849
+ env
850
+ });
851
+ if (started.code !== 0) {
852
+ removeMade(madeHere);
853
+ return {
854
+ ok: false,
855
+ reason: `git could not start a repository in ${path}. ${started.stderr.trim()}`
856
+ };
857
+ }
858
+ writeFileSync(join(path, ".gitignore"), WORKSPACE_GITIGNORE, { flag: "wx" });
859
+ saveProjectPath(db, path, keepTeam);
860
+ writeSetting(db, "workspace", true);
861
+ writeSetting(db, "repos", []);
862
+ writeSetting(db, "baseBranch", "main");
863
+ const report = await applySetup(db, skillsFolder(), answer.env ?? process.env);
864
+ if (report.failed !== null) return {
865
+ ok: false,
866
+ reason: report.failed.message
867
+ };
868
+ const added = await git(["add", "-A"], {
869
+ cwd: path,
870
+ env
871
+ });
872
+ const made = added.code !== 0 ? added : await git([
873
+ "commit",
874
+ "-q",
875
+ "--cleanup=verbatim",
876
+ "-m",
877
+ "chore: start the workspace"
878
+ ], {
879
+ cwd: path,
880
+ env,
881
+ hooks: true
882
+ });
883
+ if (made.code !== 0) {
884
+ const said = made.stderr.trim();
885
+ return {
886
+ ok: false,
887
+ reason: `The workspace files are written, but git could not commit them in ${path}. ${said === "" ? "git said nothing about why." : said}`
888
+ };
889
+ }
890
+ return {
891
+ ok: true,
892
+ path,
893
+ report
894
+ };
895
+ }
896
+ async function createWorkspace(db, answer, keepTeam = false) {
897
+ return makeWorkspace(db, answer, keepTeam);
898
+ }
899
+ var counters = (db) => db.prepare("SELECT name FROM seq WHERE name LIKE 'ticket:%'").all().map((row) => {
900
+ const [, project, prefix] = row.name.split(":");
901
+ return {
902
+ project,
903
+ prefix: prefix ?? ""
904
+ };
905
+ });
906
+ var usedPrefixes = (db) => counters(db).filter((row) => row.project !== "1").map((row) => row.prefix);
907
+ var storedPrefix = (db) => db.prepare("SELECT key FROM settings WHERE key = 'localKeyPrefix'").get() === void 0 ? null : getSetting(db, "localKeyPrefix");
908
+ var prefixFree = (db, prefix) => prefixProblem(prefix, usedPrefixes(db), storedPrefix(db)) === null;
909
+ function storeTickets(db, prefix) {
910
+ const typed = prefix.trim();
911
+ const problem = prefixProblem(typed, usedPrefixes(db), storedPrefix(db));
912
+ if (problem !== null) return problem;
913
+ writeSetting(db, "ticketSystem", getSetting(db, "ticketSystem"));
914
+ writeSetting(db, "localKeyPrefix", typed);
915
+ return null;
916
+ }
917
+ /**
918
+ * The project's list of allowed commands, filled from its stack the first time.
919
+ *
920
+ * Only while the setting is null: an empty list is the person's own answer and stays empty. A
921
+ * project with no stack to propose from is left unfilled, so the list fills once one appears.
922
+ */
923
+ function fillAllowedCommands(db) {
924
+ const stored = getSetting(db, "allowedCommands");
925
+ if (stored !== null) return stored;
926
+ const proposed = proposedCommands(db);
927
+ if (proposed.length === 0) return [];
928
+ writeSetting(db, "allowedCommands", proposed);
929
+ return proposed;
930
+ }
931
+ /**
932
+ * The commands every repository of the project proposes, each once, in repository order.
933
+ *
934
+ * The list is one per project, so a workspace of several stacks gets the commands of each, run
935
+ * in that repository's folder.
936
+ */
937
+ function proposedCommands(db) {
938
+ const project = getSetting(db, "projectPath");
939
+ if (project === null) return [];
940
+ const repos = projectRepos({
941
+ repos: getSetting(db, "repos"),
942
+ baseBranch: getSetting(db, "baseBranch")
943
+ });
944
+ return [...new Set(repos.flatMap(({ path }) => {
945
+ const folder = join(project, path);
946
+ let files = [];
947
+ try {
948
+ files = readdirSync(folder);
949
+ } catch {}
950
+ const deep = DEEP_FILES.filter((file) => existsSync(join(folder, file)));
951
+ return proposeAllowedCommands(files.includes("package.json") ? packageScripts(folder) ?? {} : null, [...files, ...deep]);
952
+ }))];
953
+ }
954
+ function packageScripts(folder) {
955
+ try {
956
+ return JSON.parse(readFileSync(join(folder, "package.json"), "utf8")).scripts ?? null;
957
+ } catch {
958
+ return null;
959
+ }
960
+ }
961
+ function setupSaid(report) {
962
+ const said = [report.written.length === 0 && report.removed.length === 0 ? "Every project file was there already." : report.written.length === 0 ? null : `Wrote ${report.written.join(", ")}.`].filter((one) => one !== null);
963
+ if (report.removed.length > 0) said.push(`Removed ${report.removed.join(", ")}, as AGENTS.md holds its text now.`);
964
+ if (report.kept.length > 0) said.push(`Kept ${report.kept.join(", ")} as you wrote ${report.kept.length === 1 ? "it" : "them"}.`);
965
+ for (const one of report.refused) said.push(one.message);
966
+ const into = (report.skills ?? []).filter((one) => one.copied.length > 0);
967
+ const copied = into.reduce((sum, one) => sum + one.copied.length, 0);
968
+ const folders = into.map((one) => one.folder);
969
+ const named = folders.length > 1 ? `${folders.slice(0, -1).join(", ")} and ${folders.at(-1)}` : folders.join("");
970
+ if ((report.skills?.length ?? 0) > 0) said.push(copied === 0 ? "The skills were up to date." : `Copied ${copied === 1 ? "1 skill file" : `${copied} skill files`} into ${named}.`);
971
+ if (report.knowledgeMove?.refused) said.push(report.knowledgeMove.refused);
972
+ if (report.knowledgeMove?.said) said.push(report.knowledgeMove.said);
973
+ if (report.knowledge?.problem) said.push(report.knowledge.problem);
974
+ return said.join(" ");
975
+ }
976
+ function recipeFacts(projectPath, path) {
977
+ const folder = join(projectPath, path);
978
+ let files = [];
979
+ try {
980
+ files = readdirSync(folder, { withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => entry.name);
981
+ } catch {}
982
+ const deep = DEEP_FILES.filter((file) => existsSync(join(folder, file)));
983
+ return {
984
+ path,
985
+ files: [...files, ...deep],
986
+ scripts: files.includes("package.json") ? packageScripts(folder) ?? {} : null
987
+ };
988
+ }
989
+ /**
990
+ * Writes the first knowledge file of each repository that has none and the run recipe's section for
991
+ * it, and commits what is new.
992
+ *
993
+ * They are committed because a knowledge run sees its own work through `git status`, and an
994
+ * untracked file it edits would still read as the same new file. A repository file already there
995
+ * is never touched, and the run recipe only gets a section for a repository it has none for. A
996
+ * knowledge folder in no git repository still gets the files, with no commit, because every run's
997
+ * knowledge index reads them.
998
+ */
999
+ async function writeRepoKnowledge(db, repos, env = process.env) {
1000
+ const projectPath = getSetting(db, "projectPath");
1001
+ const picked = getSetting(db, "knowledgeDir");
1002
+ const folder = resolveKnowledgeDir({
1003
+ knowledgeDir: picked,
1004
+ projectPath
1005
+ });
1006
+ if (projectPath === null || folder === null) return {
1007
+ written: [],
1008
+ problem: "There is no project set, so no repository file was written."
1009
+ };
1010
+ let made;
1011
+ try {
1012
+ made = picked === null ? mkdirSync(folder, { recursive: true }) : void 0;
1013
+ } catch (error) {
1014
+ return {
1015
+ written: [],
1016
+ problem: `Could not make the knowledge folder ${folder}. ${error.message}`
1017
+ };
1018
+ }
1019
+ const run = (args) => git(args, {
1020
+ cwd: folder,
1021
+ env: gitEnv(plainEnv(env))
1022
+ });
1023
+ const check = await checkKnowledgeDir(folder, {
1024
+ projectPath,
1025
+ run,
1026
+ repos: projectRepos({
1027
+ repos: getSetting(db, "repos"),
1028
+ baseBranch: getSetting(db, "baseBranch")
1029
+ }).map((repo) => repo.path)
1030
+ });
1031
+ if (!check.ok && check.problem !== "no-repository") {
1032
+ if (made !== void 0) rmSync(made, {
1033
+ recursive: true,
1034
+ force: true
1035
+ });
1036
+ return {
1037
+ written: [],
1038
+ problem: check.reason
1039
+ };
1040
+ }
1041
+ const written = [];
1042
+ let problem = null;
1043
+ for (const repo of repos) {
1044
+ const path = repoKnowledgePath(repo.path);
1045
+ const target = writablePath(resolve(folder), path);
1046
+ if (target === null) {
1047
+ problem = `Nolzu did not write ${path} in the knowledge folder, because it or a folder on its way is a link or not a plain file.`;
1048
+ continue;
1049
+ }
1050
+ if (existsSync(target)) continue;
1051
+ try {
1052
+ mkdirSync(dirname(target), { recursive: true });
1053
+ writeFileSync(target, repoKnowledge(repo), { flag: "wx" });
1054
+ } catch (error) {
1055
+ if (error.code === "EEXIST") continue;
1056
+ problem = `Could not write ${path} in the knowledge folder. ${error.message}`;
1057
+ break;
1058
+ }
1059
+ written.push(path);
1060
+ }
1061
+ const recipe = writablePath(resolve(folder), RUN_RECIPE_FILE);
1062
+ if (recipe === null) problem ??= `Nolzu did not write ${RUN_RECIPE_FILE} in the knowledge folder, because it is a link or not a plain file.`;
1063
+ else try {
1064
+ const text = runRecipe(repos.map((repo) => recipeFacts(projectPath, repo.path)), existsSync(recipe) ? readFileSync(recipe, "utf8") : null);
1065
+ if (text !== null) {
1066
+ writeFileSync(recipe, text);
1067
+ written.push(RUN_RECIPE_FILE);
1068
+ }
1069
+ } catch (error) {
1070
+ problem ??= `Could not write ${RUN_RECIPE_FILE} in the knowledge folder. ${error.message}`;
1071
+ }
1072
+ if (written.length === 0) return {
1073
+ written,
1074
+ problem
1075
+ };
1076
+ if (!check.ok) return {
1077
+ written,
1078
+ problem: problem ?? "The knowledge folder is in no git repository, so Nolzu wrote the knowledge files without a commit. A wrap-up needs one to add knowledge."
1079
+ };
1080
+ try {
1081
+ const prefix = (await run(["rev-parse", "--show-prefix"])).stdout.trim();
1082
+ await commitKnowledgeFiles(run, "knowledge: repository files", written.map((path) => prefix + path));
1083
+ } catch (error) {
1084
+ return {
1085
+ written,
1086
+ problem: `The repository files are written, but git could not commit them. ${error.message}`
1087
+ };
1088
+ }
1089
+ return {
1090
+ written,
1091
+ problem
1092
+ };
1093
+ }
1094
+ function knowledgeMovePlan(db) {
1095
+ const folder = resolveKnowledgeDir({
1096
+ knowledgeDir: getSetting(db, "knowledgeDir"),
1097
+ projectPath: getSetting(db, "projectPath")
1098
+ });
1099
+ if (folder === null || !existsSync(folder)) return null;
1100
+ const files = knowledgeFiles(folder).map((path) => {
1101
+ let text = "";
1102
+ try {
1103
+ text = path.includes("/") ? "" : readFileSync(join(folder, path), "utf8");
1104
+ } catch {}
1105
+ return {
1106
+ path,
1107
+ text
1108
+ };
1109
+ });
1110
+ return {
1111
+ folder,
1112
+ plan: planKnowledgeMoves(files, projectRepos({
1113
+ repos: getSetting(db, "repos"),
1114
+ baseBranch: getSetting(db, "baseBranch")
1115
+ }).map((repo) => repo.path))
1116
+ };
1117
+ }
1118
+ function knowledgeMovesPending(db) {
1119
+ const plan = knowledgeMovePlan(db)?.plan;
1120
+ return {
1121
+ moves: plan?.moves.length ?? 0,
1122
+ kept: plan?.taken.length ?? 0
1123
+ };
1124
+ }
1125
+ var KNOWLEDGE_RUN = "SELECT 1 FROM runs WHERE phase IN ('wrapup', 'optimize', 'orient', 'learn-repo') AND state IN ('queued', 'running') LIMIT 1";
1126
+ var filesWord = (count) => count === 1 ? "1 knowledge file" : `${count} knowledge files`;
1127
+ var rmdirQuiet = (dir) => {
1128
+ try {
1129
+ rmdirSync(dir);
1130
+ } catch {}
1131
+ };
1132
+ var NOT_MOVED = "Nolzu moved no knowledge file into the folders of their repositories.";
1133
+ var AGAIN = "Then write the project files again.";
1134
+ var takenLine = (taken) => `${taken.join(", ")} ${taken.length === 1 ? "stays" : "stay"} where ${taken.length === 1 ? "it is" : "they are"}, because a file is at ${taken.length === 1 ? "its" : "their"} new place already. Merge ${taken.length === 1 ? "it" : "them"} by hand.`;
1135
+ /**
1136
+ * Moves a knowledge folder of the older layout into the one grouped by repository, in one commit.
1137
+ *
1138
+ * Code does it, not a run, so nothing is guessed: a note moves only to the folder its paths name. It
1139
+ * is refused while a knowledge run or a change that waits for review could write the same files, while
1140
+ * the folder has changes git has not committed, so the commit holds the move and nothing else, and
1141
+ * while git ignores a folder the files would move into. A file already at the new place is never
1142
+ * overwritten. A rename or the commit that fails puts every moved file back, so the folder is never
1143
+ * left half moved, which the next write would not see as a move.
1144
+ */
1145
+ async function moveOldKnowledge(db, env = process.env) {
1146
+ const found = knowledgeMovePlan(db);
1147
+ if (found === null || found.plan.moves.length === 0 && found.plan.taken.length === 0) return {
1148
+ said: null,
1149
+ refused: null
1150
+ };
1151
+ const { folder, plan } = found;
1152
+ if (plan.moves.length === 0) return {
1153
+ said: takenLine(plan.taken),
1154
+ refused: null
1155
+ };
1156
+ const refuse = (why) => ({
1157
+ said: null,
1158
+ refused: `${NOT_MOVED} ${why} ${AGAIN}`
1159
+ });
1160
+ const run = (args) => git(args, {
1161
+ cwd: folder,
1162
+ env: gitEnv(plainEnv(env))
1163
+ });
1164
+ const repos = projectRepos({
1165
+ repos: getSetting(db, "repos"),
1166
+ baseBranch: getSetting(db, "baseBranch")
1167
+ }).map((repo) => repo.path);
1168
+ const check = await checkKnowledgeDir(folder, {
1169
+ projectPath: getSetting(db, "projectPath"),
1170
+ run,
1171
+ repos
1172
+ });
1173
+ if (!check.ok && check.problem !== "no-repository") return refuse(check.reason ?? "");
1174
+ const inGit = check.ok;
1175
+ try {
1176
+ if (inGit && (await knowledgeState(run)).length > 0) return refuse("The knowledge folder has changes git has not committed. Commit or drop them.");
1177
+ } catch (error) {
1178
+ return refuse(`git could not read the knowledge folder. ${error.message}`);
1179
+ }
1180
+ if (pendingKnowledgeChanges(db).length > 0) return refuse("A knowledge change waits for review. Apply or return it on Knowledge.");
1181
+ if (db.prepare(KNOWLEDGE_RUN).get() !== void 0) return refuse("A knowledge run is queued or running. Wait until it ends.");
1182
+ const root = resolve(folder);
1183
+ const linked = plan.moves.find((move) => writablePath(root, move.from) === null || writablePath(root, move.to) === null);
1184
+ if (linked !== void 0) return refuse(`${linked.from} or its new place ${linked.to} is a link, or a folder on the way is.`);
1185
+ const moved = [];
1186
+ const made = [];
1187
+ const taken = [...plan.taken];
1188
+ const back = () => {
1189
+ for (const move of [...moved].reverse()) renameSync(join(root, move.to), join(root, move.from));
1190
+ for (const dir of [...made].reverse()) rmdirQuiet(dir);
1191
+ };
1192
+ try {
1193
+ for (const move of plan.moves) {
1194
+ const to = join(root, move.to);
1195
+ if (existsSync(to)) {
1196
+ taken.push(move.from);
1197
+ continue;
1198
+ }
1199
+ const first = mkdirSync(dirname(to), { recursive: true });
1200
+ if (first !== void 0) made.push(first);
1201
+ renameSync(join(root, move.from), to);
1202
+ moved.push(move);
1203
+ }
1204
+ } catch (error) {
1205
+ back();
1206
+ return refuse(`A file could not be moved, so every file went back. ${error.message}`);
1207
+ }
1208
+ if (moved.length > 0 && inGit) {
1209
+ const prefix = (await run(["rev-parse", "--show-prefix"])).stdout.trim();
1210
+ const paths = moved.flatMap((move) => [prefix + move.from, prefix + move.to]);
1211
+ try {
1212
+ await commitKnowledgeFiles(run, "knowledge: group the files by repository", paths);
1213
+ } catch (error) {
1214
+ back();
1215
+ await run([
1216
+ "reset",
1217
+ "-q",
1218
+ "--",
1219
+ ...paths.map((path) => `:(top,literal)${path}`)
1220
+ ]);
1221
+ return refuse(`git could not commit the move, so every file went back. ${error.message}`);
1222
+ }
1223
+ }
1224
+ try {
1225
+ rmdirSync(join(root, "repositories"));
1226
+ } catch {}
1227
+ const said = moved.length === 0 ? [] : [`Moved ${filesWord(moved.length)} into the folders of their repositories${inGit ? " and committed the move" : ""}.`];
1228
+ if (moved.length > 0 && !inGit) said.push("The knowledge folder is in no git repository, so nothing was committed.");
1229
+ if (plan.left.length > 0) said.push(`${plan.left.join(", ")} ${plan.left.length === 1 ? "stays" : "stay"} at the top of the knowledge folder, because ${plan.left.length === 1 ? "its" : "their"} paths name no repository. Move ${plan.left.length === 1 ? "it" : "them"} by hand.`);
1230
+ if (taken.length > 0) said.push(takenLine(taken));
1231
+ return {
1232
+ said: said.join(" "),
1233
+ refused: null
1234
+ };
1235
+ }
1236
+ function existingFiles(projectPath) {
1237
+ const wanted = [
1238
+ OLD_WORKSPACE,
1239
+ "AGENTS.md",
1240
+ POINTER,
1241
+ GUARD_PATH,
1242
+ SETTINGS_PATH
1243
+ ];
1244
+ const found = {};
1245
+ for (const path of wanted) try {
1246
+ found[path] = readFileSync(join(projectPath, path), "utf8");
1247
+ } catch {}
1248
+ return found;
1249
+ }
1250
+ var POINTER = "CLAUDE.md";
1251
+ var NOLZU_FILES = [
1252
+ ...planProjectFiles({
1253
+ existing: {},
1254
+ agents: "",
1255
+ pointer: "",
1256
+ pointerPath: POINTER
1257
+ }).writes.map((write) => write.path),
1258
+ ...SKILL_FOLDERS.map((folder) => `${folder}/`),
1259
+ `${dirname(phaseInstructionsPath("plan"))}/`
1260
+ ];
1261
+ var projectFilesPlan = (projectPath) => planProjectFiles({
1262
+ existing: existingFiles(projectPath),
1263
+ agents: AGENTS_MD,
1264
+ pointer: pointerFile(POINTER),
1265
+ pointerPath: POINTER
1266
+ });
1267
+ async function applySetup(db, skills = skillsFolder(), env = process.env) {
1268
+ const nothing = (message) => ({
1269
+ written: [],
1270
+ removed: [],
1271
+ kept: [],
1272
+ alreadyRight: [],
1273
+ refused: [],
1274
+ skills: null,
1275
+ failed: {
1276
+ path: "",
1277
+ message
1278
+ },
1279
+ knowledge: null
1280
+ });
1281
+ const projectPath = getSetting(db, "projectPath");
1282
+ if (projectPath === null) return nothing("There is no project set, so nothing was written.");
1283
+ if (!existsSync(projectPath)) return nothing(`The folder ${projectPath} is not there any more, so nothing was written.`);
1284
+ const newer = syncSkillFolders(skills, projectPath, {
1285
+ version: NOLZU_VERSION,
1286
+ dryRun: true
1287
+ }).find((one) => one.synced?.newer !== void 0)?.synced?.newer;
1288
+ if (newer !== void 0) return nothing(newerLine(newer));
1289
+ const plan = projectFilesPlan(projectPath);
1290
+ const applied = applyPlan(projectPath, projectPath, plan);
1291
+ const yours = new Set(plan.writes.filter((write) => write.kind === "keep").map((write) => write.path));
1292
+ const refused = [...applied.refused];
1293
+ const folders = applied.failed === null ? syncSkillFolders(skills, projectPath, { version: NOLZU_VERSION }) : null;
1294
+ filesStatus = null;
1295
+ for (const message of new Set(folders?.flatMap((one) => one.synced?.refused ?? []) ?? [])) refused.push({
1296
+ path: EXTRA_SKILLS,
1297
+ message
1298
+ });
1299
+ for (const { folder } of folders?.filter((one) => one.synced === null) ?? []) refused.push({
1300
+ path: folder,
1301
+ message: `${folder.split("/")[0]} or ${folder} is a link, or something other than a folder, so the skills were not copied there. Move it away, or copy the skills by hand.`
1302
+ });
1303
+ const synced = folders?.flatMap(({ folder, synced }) => synced === null ? [] : [{
1304
+ folder,
1305
+ ...synced
1306
+ }]) ?? null;
1307
+ const repos = getSetting(db, "repos");
1308
+ const knowledgeMove = applied.failed === null ? await moveOldKnowledge(db, env) : null;
1309
+ const knowledge = applied.failed === null && knowledgeMove?.refused === null ? await writeRepoKnowledge(db, projectRepos({
1310
+ repos,
1311
+ baseBranch: getSetting(db, "baseBranch")
1312
+ }), env) : null;
1313
+ return {
1314
+ written: [...applied.written],
1315
+ removed: [...applied.removed],
1316
+ kept: applied.kept.filter((path) => yours.has(path)),
1317
+ alreadyRight: applied.kept.filter((path) => !yours.has(path)),
1318
+ refused,
1319
+ skills: synced,
1320
+ failed: applied.failed,
1321
+ knowledge,
1322
+ knowledgeMove
1323
+ };
1324
+ }
1325
+ var newerLine = (wrote, version = NOLZU_VERSION) => `These project files come from Nolzu ${wrote}, newer than this Nolzu ${version}. Update Nolzu.`;
1326
+ function projectFilesStatus(projectPath, skills = skillsFolder(), version = NOLZU_VERSION) {
1327
+ if (!SKILL_FOLDERS.some((folder) => isFileAt(join(projectPath, folder, ".nolzu-skills.json")))) return null;
1328
+ const writes = projectFilesPlan(projectPath).writes;
1329
+ const root = resolve(projectPath);
1330
+ const updates = writes.filter((write) => (write.kind === "create" || write.kind === "replace" || write.kind === "append" || write.kind === "remove") && writablePath(root, write.path) !== null).map((write) => write.path);
1331
+ const keptFor = join(projectPath, SKILL_FOLDERS[0]);
1332
+ const yours = writes.filter((write) => write.kind === "keep" && keptMark(keptFor, write.path) !== shippedMark(freshProjectFile(write.path))).map((write) => write.path);
1333
+ let newer = null;
1334
+ for (const { folder, synced } of syncSkillFolders(skills, projectPath, {
1335
+ version,
1336
+ dryRun: true
1337
+ })) {
1338
+ if (synced === null) continue;
1339
+ if (synced.newer !== void 0) {
1340
+ newer ??= newerLine(synced.newer, version);
1341
+ continue;
1342
+ }
1343
+ updates.push(...[...synced.copied, ...synced.removed].map((path) => `${folder}/${path}`));
1344
+ yours.push(...synced.conflicts.map((path) => `${folder}/${path}`));
1345
+ }
1346
+ return {
1347
+ updates,
1348
+ yours,
1349
+ newer
1350
+ };
1351
+ }
1352
+ var isFileAt = (at) => {
1353
+ try {
1354
+ return statSync(at).isFile();
1355
+ } catch {
1356
+ return false;
1357
+ }
1358
+ };
1359
+ var filesStatus = null;
1360
+ function projectFilesNotice(db) {
1361
+ const path = getSetting(db, "projectPath");
1362
+ if (path === null) return null;
1363
+ if (filesStatus?.path !== path) {
1364
+ let status = null;
1365
+ try {
1366
+ const read = existsSync(path) ? projectFilesStatus(path) : null;
1367
+ status = read === null ? null : {
1368
+ ...read,
1369
+ ...knowledgeMovesPending(db)
1370
+ };
1371
+ } catch {}
1372
+ filesStatus = {
1373
+ path,
1374
+ status
1375
+ };
1376
+ }
1377
+ return filesStatus.status;
1378
+ }
1379
+ var freshProjectFile = (path) => planProjectFiles({
1380
+ existing: {},
1381
+ agents: AGENTS_MD,
1382
+ pointer: pointerFile(POINTER),
1383
+ pointerPath: POINTER
1384
+ }).writes.find((write) => write.path === path)?.content ?? null;
1385
+ function shippedFor(path, skills, projectPath) {
1386
+ const folder = SKILL_FOLDERS.find((one) => path.startsWith(`${one}/`)) ?? null;
1387
+ if (folder === null) {
1388
+ const fresh = freshProjectFile(path);
1389
+ return {
1390
+ folder,
1391
+ inFolder: path,
1392
+ shipped: fresh === null ? null : Buffer.from(fresh)
1393
+ };
1394
+ }
1395
+ const inFolder = path.slice(folder.length + 1);
1396
+ const at = [join(skills, inFolder), join(projectPath, EXTRA_SKILLS, inFolder)].find(isFileAt);
1397
+ return {
1398
+ folder,
1399
+ inFolder,
1400
+ shipped: at === void 0 ? null : readFileSync(at)
1401
+ };
1402
+ }
1403
+ async function unsavedIn(projectPath, path) {
1404
+ const status = await git([
1405
+ "status",
1406
+ "--porcelain",
1407
+ "--ignored",
1408
+ "--",
1409
+ path
1410
+ ], {
1411
+ cwd: projectPath,
1412
+ env: gitEnv(plainEnv(process.env))
1413
+ });
1414
+ return status.code !== 0 || status.stdout.trim() !== "";
1415
+ }
1416
+ async function patchOf(projectPath, at, shipped) {
1417
+ const scratch = mkdtempSync(join(tmpdir(), "nolzu-shipped-"));
1418
+ try {
1419
+ const from = join(scratch, "shipped");
1420
+ if (shipped !== null) writeFileSync(from, shipped);
1421
+ const diff = await git([
1422
+ "diff",
1423
+ "--no-color",
1424
+ "--no-ext-diff",
1425
+ "--no-textconv",
1426
+ "--no-index",
1427
+ "--",
1428
+ shipped === null ? "/dev/null" : from,
1429
+ at
1430
+ ], {
1431
+ cwd: projectPath,
1432
+ env: gitEnv(plainEnv(process.env))
1433
+ });
1434
+ const hunk = diff.stdout.search(/^@@/m);
1435
+ return hunk === -1 ? "" : diff.stdout.slice(hunk);
1436
+ } finally {
1437
+ rmSync(scratch, {
1438
+ recursive: true,
1439
+ force: true
1440
+ });
1441
+ }
1442
+ }
1443
+ async function handEditedFiles(db, skills = skillsFolder()) {
1444
+ const projectPath = getSetting(db, "projectPath");
1445
+ if (projectPath === null || !existsSync(projectPath)) return [];
1446
+ let status;
1447
+ try {
1448
+ status = projectFilesStatus(projectPath, skills);
1449
+ } catch {
1450
+ return [];
1451
+ }
1452
+ filesStatus = {
1453
+ path: projectPath,
1454
+ status: status === null ? null : {
1455
+ ...status,
1456
+ ...knowledgeMovesPending(db)
1457
+ }
1458
+ };
1459
+ const root = resolve(projectPath);
1460
+ return Promise.all((status?.yours ?? []).map(async (path) => {
1461
+ const { shipped } = shippedFor(path, skills, projectPath);
1462
+ const at = writablePath(root, path);
1463
+ const [patch, unsaved] = await Promise.all([at === null ? null : patchOf(projectPath, at, shipped), unsavedIn(projectPath, path)]);
1464
+ return {
1465
+ path,
1466
+ patch,
1467
+ gone: shipped === null,
1468
+ unsaved
1469
+ };
1470
+ }));
1471
+ }
1472
+ function handEdit(db, path, skills) {
1473
+ const projectPath = getSetting(db, "projectPath");
1474
+ if (projectPath === null || !existsSync(projectPath)) return { problem: "The project folder is not there any more, so nothing was written." };
1475
+ const status = projectFilesStatus(projectPath, skills);
1476
+ if (status !== null && status.newer !== null) return { problem: status.newer };
1477
+ if (!(status?.yours.includes(path) ?? false)) return { problem: `${path} is not a file you changed, so nothing was written.` };
1478
+ const file = shippedFor(path, skills, projectPath);
1479
+ const record = `${file.folder ?? SKILL_FOLDERS[0]}/${SYNC_RECORD}`;
1480
+ if (writablePath(resolve(projectPath), record) === null) return { problem: `${record.split("/")[0]} is a link, or something other than a folder, so Nolzu did not write there.` };
1481
+ return {
1482
+ projectPath,
1483
+ file
1484
+ };
1485
+ }
1486
+ async function takeShipped(db, path, sure, skills = skillsFolder()) {
1487
+ const found = handEdit(db, path, skills);
1488
+ if ("problem" in found) return found;
1489
+ const { projectPath, file } = found;
1490
+ if (!sure && await unsavedIn(projectPath, path)) return {
1491
+ problem: unsavedLine(path),
1492
+ ask: true
1493
+ };
1494
+ const link = `${path} is a link, or something other than a plain file, so Nolzu did not write through it.`;
1495
+ if (file.folder !== null) {
1496
+ if (!takeShippedSkill(join(projectPath, file.folder), file.inFolder, file.shipped)) return { problem: link };
1497
+ } else {
1498
+ const applied = applyPlan(projectPath, projectPath, {
1499
+ writes: [{
1500
+ path,
1501
+ kind: "replace",
1502
+ content: file.shipped?.toString("utf8") ?? "",
1503
+ note: ""
1504
+ }],
1505
+ dirs: [],
1506
+ refused: []
1507
+ });
1508
+ if (applied.failed !== null) return { problem: applied.failed.message };
1509
+ if (applied.refused.length > 0) return { problem: link };
1510
+ keepForShipped(join(projectPath, SKILL_FOLDERS[0]), path, null);
1511
+ }
1512
+ filesStatus = null;
1513
+ return { said: file.shipped === null ? `Removed ${path}, which Nolzu no longer ships. Commit it.` : `Wrote Nolzu's text to ${path}. Commit it.` };
1514
+ }
1515
+ function keepMine(db, path, skills = skillsFolder()) {
1516
+ const found = handEdit(db, path, skills);
1517
+ if ("problem" in found) return found;
1518
+ const { projectPath, file } = found;
1519
+ keepForShipped(join(projectPath, file.folder ?? SKILL_FOLDERS[0]), file.inFolder, shippedMark(file.shipped));
1520
+ filesStatus = null;
1521
+ return { said: `Kept your ${path}. Nolzu asks again when it ships a new text for it.` };
1522
+ }
1523
+
1524
+ export { MANIFEST as M, NOLZU_FILES as N, SKILL_FOLDERS as S, personsSkillEdit as a, recordInRoot as b, forgetInRoot as c, checkProject as d, scannedBase as e, fillAllowedCommands as f, createWorkspace as g, workspaceTarget as h, inTurn as i, projectFilesNotice as j, engineCheck as k, keepMine as l, takeShipped as m, applySetup as n, onboardRedirect as o, prefixFree as p, setupSaid as q, readManifest as r, storeTickets as s, trackBaseBranch as t, handEditedFiles as u, proposedCommands as v, writeRepoKnowledge as w };
1525
+ //# sourceMappingURL=onboard.js-LBqPOxyU.js.map