prjct-cli 3.95.0 → 3.97.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 (576) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-HCP5FF77.mjs +31 -0
  4. package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
  5. package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
  6. package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
  7. package/dist/bin/core-chunks/agent-switch-AVSX6SLY.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-OAQXBGH3.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-3A7ODSSI.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-EWSVMKQN.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-LLHG2NSY.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-7LQ52T6L.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-M4HM7WAI.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-4OZ3FKRE.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-CUNVCEL5.mjs +10 -0
  19. package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
  20. package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
  21. package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
  22. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  23. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  24. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  25. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  26. package/dist/bin/core-chunks/chunk-2ZPM4Z6W.mjs +17 -0
  27. package/dist/bin/core-chunks/chunk-3FXNIJCS.mjs +8 -0
  28. package/dist/bin/core-chunks/chunk-3JD6KRNJ.mjs +8 -0
  29. package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3USVY66O.mjs +7 -0
  31. package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
  32. package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
  33. package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
  34. package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
  35. package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
  36. package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
  37. package/dist/bin/core-chunks/chunk-53ZPEZLU.mjs +8 -0
  38. package/dist/bin/core-chunks/chunk-56FW4P6U.mjs +10 -0
  39. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  40. package/dist/bin/core-chunks/chunk-5MN22JFI.mjs +19 -0
  41. package/dist/bin/core-chunks/chunk-5ONMON5L.mjs +13 -0
  42. package/dist/bin/core-chunks/chunk-5UUITMRX.mjs +9 -0
  43. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  44. package/dist/bin/core-chunks/chunk-5YSPND5J.mjs +9 -0
  45. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  46. package/dist/bin/core-chunks/chunk-6AFXUX2M.mjs +9 -0
  47. package/dist/bin/core-chunks/chunk-6FFOWWH2.mjs +17 -0
  48. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  50. package/dist/bin/core-chunks/chunk-6P4GMVUZ.mjs +18 -0
  51. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  52. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  53. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  54. package/dist/bin/core-chunks/chunk-7CI4AMVO.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7QMBIMEX.mjs +64 -0
  56. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  57. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  58. package/dist/bin/core-chunks/chunk-AJTBFIH2.mjs +9 -0
  59. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  60. package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
  61. package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
  62. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  63. package/dist/bin/core-chunks/chunk-BQKDJ3U6.mjs +8 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTCCUMKI.mjs +12 -0
  66. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  67. package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
  68. package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
  69. package/dist/bin/core-chunks/chunk-CDLZLTRY.mjs +10 -0
  70. package/dist/bin/core-chunks/chunk-CEOTHJIY.mjs +10 -0
  71. package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
  72. package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
  73. package/dist/bin/core-chunks/chunk-CNWEQUB7.mjs +7 -0
  74. package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  77. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
  78. package/dist/bin/core-chunks/chunk-DCVPNFS4.mjs +8 -0
  79. package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
  80. package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
  81. package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
  82. package/dist/bin/core-chunks/chunk-DN46DLU3.mjs +10 -0
  83. package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  85. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  86. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  88. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  89. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  90. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  91. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  92. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  93. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  94. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  95. package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  98. package/dist/bin/core-chunks/chunk-GOIBJ7PV.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  100. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  102. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  103. package/dist/bin/core-chunks/chunk-HEXSVBUP.mjs +8 -0
  104. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  106. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  108. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  109. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  110. package/dist/bin/core-chunks/chunk-IFLBZKKK.mjs +14 -0
  111. package/dist/bin/core-chunks/chunk-IMQCXC3R.mjs +30 -0
  112. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  113. package/dist/bin/core-chunks/chunk-INM5COWM.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-IVGWOY3U.mjs +8 -0
  116. package/dist/bin/core-chunks/chunk-J7T5IEFJ.mjs +15 -0
  117. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  118. package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
  119. package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
  120. package/dist/bin/core-chunks/chunk-K25HGTC3.mjs +10 -0
  121. package/dist/bin/core-chunks/chunk-KIRU4QFX.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KKIJAEYU.mjs +7 -0
  123. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  124. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  125. package/dist/bin/core-chunks/chunk-KWC2PCPC.mjs +10 -0
  126. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  127. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LZC6NGB6.mjs +50 -0
  129. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  130. package/dist/bin/core-chunks/chunk-MDONTD7O.mjs +21 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  133. package/dist/bin/core-chunks/chunk-MTDCRYLP.mjs +7 -0
  134. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  135. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  137. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  139. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  140. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  141. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  142. package/dist/bin/core-chunks/chunk-OYXQRBVM.mjs +10 -0
  143. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  144. package/dist/bin/core-chunks/chunk-P53YMOKR.mjs +7 -0
  145. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  146. package/dist/bin/core-chunks/chunk-PPERWRFS.mjs +13 -0
  147. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  148. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  149. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  151. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-QLMZW4K7.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  154. package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  156. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  157. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  158. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  159. package/dist/bin/core-chunks/chunk-RXXXA7Z6.mjs +7 -0
  160. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  161. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  162. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  163. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  165. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  166. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  167. package/dist/bin/core-chunks/chunk-TGNZI4KF.mjs +28 -0
  168. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  169. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  170. package/dist/bin/core-chunks/chunk-TTN2CFZC.mjs +7 -0
  171. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  172. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  173. package/dist/bin/core-chunks/chunk-UE3XKXWM.mjs +7 -0
  174. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  175. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  176. package/dist/bin/core-chunks/chunk-UT425KVX.mjs +10 -0
  177. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  178. package/dist/bin/core-chunks/chunk-V3Y3G2DE.mjs +8 -0
  179. package/dist/bin/core-chunks/chunk-V5VCXMKO.mjs +52 -0
  180. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  181. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  182. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  183. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  184. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  185. package/dist/bin/core-chunks/chunk-VDXTMAMO.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +103 -0
  187. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  188. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  189. package/dist/bin/core-chunks/chunk-WGDE3L33.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-WP5IU4W4.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-WSVMQYYU.mjs +12 -0
  192. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WZXUFSVT.mjs +25 -0
  194. package/dist/bin/core-chunks/chunk-X35YYOFE.mjs +18 -0
  195. package/dist/bin/core-chunks/chunk-X4FR5S7E.mjs +9 -0
  196. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XPRLQIVQ.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XSZG3CBO.mjs +7 -0
  200. package/dist/bin/core-chunks/chunk-XU3BQPBU.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XYDLXF5A.mjs +8 -0
  202. package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +7 -0
  203. package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
  204. package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
  205. package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
  206. package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
  207. package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
  208. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  209. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  211. package/dist/bin/core-chunks/chunk-ZHTYSYZC.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZK7BMUMR.mjs +7 -0
  213. package/dist/bin/core-chunks/chunk-ZKJZDOPT.mjs +14 -0
  214. package/dist/bin/core-chunks/chunk-ZQHSJ6FF.mjs +20 -0
  215. package/dist/bin/core-chunks/chunk-ZS7XJUPE.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/cleanup-installs-WHXUGAHM.mjs +7 -0
  218. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  219. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  220. package/dist/bin/core-chunks/cloud-FFUJZLDV.mjs +14 -0
  221. package/dist/bin/core-chunks/code-SU7GCPH6.mjs +12 -0
  222. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  223. package/dist/bin/core-chunks/codex-hooks-GOLMCL2Q.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-mcp-K4X2UIQF.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-skill-3HNVU4T4.mjs +7 -0
  226. package/dist/bin/core-chunks/command-installer-XIQK2G6W.mjs +7 -0
  227. package/dist/bin/core-chunks/config-W3RHV3GK.mjs +8 -0
  228. package/dist/bin/core-chunks/config-manager-QVFHXIKI.mjs +7 -0
  229. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  230. package/dist/bin/core-chunks/context-4KGTUAC4.mjs +38 -0
  231. package/dist/bin/core-chunks/context-DDHC7VIC.mjs +10 -0
  232. package/dist/bin/core-chunks/context-checkpoint-4CEUPEVG.mjs +27 -0
  233. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  234. package/dist/bin/core-chunks/context-tiers-4S6H22NP.mjs +7 -0
  235. package/dist/bin/core-chunks/context7-service-AZWDYK5Z.mjs +7 -0
  236. package/dist/bin/core-chunks/core-PR5WEQCS.mjs +70 -0
  237. package/dist/bin/core-chunks/crew-JQCG6NS3.mjs +24 -0
  238. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  239. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  240. package/dist/bin/core-chunks/cwd-changed-ODKZVSPB.mjs +7 -0
  241. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  242. package/dist/bin/core-chunks/daemon-2NQTBFVR.mjs +13 -0
  243. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  244. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  245. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  246. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  247. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  248. package/dist/bin/core-chunks/developer-profile-MRPBWL2K.mjs +7 -0
  249. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  250. package/dist/bin/core-chunks/distill-MLDZG5RA.mjs +7 -0
  251. package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-service-WXLB2FEE.mjs +8 -0
  253. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  254. package/dist/bin/core-chunks/dynasty-outcomes-H2O546OL.mjs +11 -0
  255. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  256. package/dist/bin/core-chunks/embeddings-7A5Z5I67.mjs +7 -0
  257. package/dist/bin/core-chunks/enriched-recall-YXK7EIKH.mjs +7 -0
  258. package/dist/bin/core-chunks/eval-4YFUBFLV.mjs +76 -0
  259. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  260. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  261. package/dist/bin/core-chunks/format-5V6GF6JJ.mjs +7 -0
  262. package/dist/bin/core-chunks/gemini-settings-ZTU3VQU3.mjs +7 -0
  263. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  264. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  265. package/dist/bin/core-chunks/grok-mcp-F3SRFMCW.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-plugin-4CE2WUYI.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-skill-GLSBOOKW.mjs +7 -0
  268. package/dist/bin/core-chunks/guard-FJBJ6IAE.mjs +13 -0
  269. package/dist/bin/core-chunks/guards-LFUFKVVH.mjs +7 -0
  270. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  271. package/dist/bin/core-chunks/harness-FN3HASSA.mjs +43 -0
  272. package/dist/bin/core-chunks/health-W2VWME7Z.mjs +11 -0
  273. package/dist/bin/core-chunks/help-I37I3V2R.mjs +14 -0
  274. package/dist/bin/core-chunks/hooks-service-C2P5DRCH.mjs +91 -0
  275. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  276. package/dist/bin/core-chunks/install-XP4S6HWQ.mjs +9 -0
  277. package/dist/bin/core-chunks/judgment-GJE332LF.mjs +21 -0
  278. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  279. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-receipt-WT4EMCAV.mjs +7 -0
  281. package/dist/bin/core-chunks/kimi-hooks-2UEUIKXV.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-mcp-DJCXZ2JY.mjs +7 -0
  283. package/dist/bin/core-chunks/land-cue-5USQ64MS.mjs +8 -0
  284. package/dist/bin/core-chunks/land-rho-ISNVEPVC.mjs +8 -0
  285. package/dist/bin/core-chunks/land-synthesis-CHARJMUP.mjs +7 -0
  286. package/dist/bin/core-chunks/lean-L53CKZNH.mjs +34 -0
  287. package/dist/bin/core-chunks/legacy-crew-sweep-2TLKJTHI.mjs +23 -0
  288. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  289. package/dist/bin/core-chunks/llm-XMH7WTHV.mjs +18 -0
  290. package/dist/bin/core-chunks/mcp-FLVIZBV2.mjs +17 -0
  291. package/dist/bin/core-chunks/memory-dream-EJWI4FJO.mjs +14 -0
  292. package/dist/bin/core-chunks/memory-export-27HTNNFI.mjs +13 -0
  293. package/dist/bin/core-chunks/memory-index-BRZDZ2BY.mjs +7 -0
  294. package/dist/bin/core-chunks/notification-KJ4FQJAW.mjs +7 -0
  295. package/dist/bin/core-chunks/notify-76B7AICZ.mjs +9 -0
  296. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  297. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  298. package/dist/bin/core-chunks/opencode-mcp-5YSIYDI3.mjs +7 -0
  299. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  300. package/dist/bin/core-chunks/pack-integrity-GXN67LJB.mjs +9 -0
  301. package/dist/bin/core-chunks/pack-manager-46SPIPPD.mjs +7 -0
  302. package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +7 -0
  303. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  304. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  305. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  306. package/dist/bin/core-chunks/pi-skill-SDHTUK3V.mjs +7 -0
  307. package/dist/bin/core-chunks/planning-S3MYVWH6.mjs +8 -0
  308. package/dist/bin/core-chunks/post-edit-5YSNEMK7.mjs +7 -0
  309. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  310. package/dist/bin/core-chunks/pre-bash-GLDILCRF.mjs +10 -0
  311. package/dist/bin/core-chunks/pre-commit-U6HPPNIC.mjs +7 -0
  312. package/dist/bin/core-chunks/pre-edit-PEYQA6P6.mjs +8 -0
  313. package/dist/bin/core-chunks/pre-package-76JR5GLO.mjs +7 -0
  314. package/dist/bin/core-chunks/pre-search-5EHNUOP3.mjs +8 -0
  315. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  316. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  318. package/dist/bin/core-chunks/preferences-BTSYWYUM.mjs +31 -0
  319. package/dist/bin/core-chunks/primitives-IXAYLX7U.mjs +13 -0
  320. package/dist/bin/core-chunks/prjct-md-SUDFWDCS.mjs +7 -0
  321. package/dist/bin/core-chunks/product-KKGJ6MMF.mjs +68 -0
  322. package/dist/bin/core-chunks/project-agent-surfaces-I2CUZUIN.mjs +7 -0
  323. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  324. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  325. package/dist/bin/core-chunks/project-memory-GYLYIJQD.mjs +7 -0
  326. package/dist/bin/core-chunks/project-style-evolution-5W25UPPN.mjs +7 -0
  327. package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +23 -0
  328. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  329. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  331. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  332. package/dist/bin/core-chunks/purge-5EPJV25P.mjs +7 -0
  333. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  334. package/dist/bin/core-chunks/registry-LK6IQ5UX.mjs +7 -0
  335. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  336. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  337. package/dist/bin/core-chunks/retention-S22T3SPT.mjs +7 -0
  338. package/dist/bin/core-chunks/retro-CLKOHAN6.mjs +13 -0
  339. package/dist/bin/core-chunks/review-risk-LLLBKUXT.mjs +12 -0
  340. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  341. package/dist/bin/core-chunks/safe-artifacts-RW5WQUUJ.mjs +9 -0
  342. package/dist/bin/core-chunks/sdd-HE7O6N5S.mjs +9 -0
  343. package/dist/bin/core-chunks/seed-JX7W53E5.mjs +10 -0
  344. package/dist/bin/core-chunks/self-heal-DFUEKNF3.mjs +7 -0
  345. package/dist/bin/core-chunks/session-continuity-BFSW4OL6.mjs +10 -0
  346. package/dist/bin/core-chunks/session-start-HVYUKJL2.mjs +7 -0
  347. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  348. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  349. package/dist/bin/core-chunks/setup-GHS24ER5.mjs +140 -0
  350. package/dist/bin/core-chunks/setup-J4JFYT63.mjs +38 -0
  351. package/dist/bin/core-chunks/shipping-I4D4AVTE.mjs +12 -0
  352. package/dist/bin/core-chunks/signals-digest-V44KYN6Z.mjs +7 -0
  353. package/dist/bin/core-chunks/skill-adherence-MHY4BZL4.mjs +13 -0
  354. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  355. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  356. package/dist/bin/core-chunks/spec-2XXPLHUZ.mjs +27 -0
  357. package/dist/bin/core-chunks/spec-context-inference-THFMXC7S.mjs +9 -0
  358. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-service-I23KJKKP.mjs +7 -0
  360. package/dist/bin/core-chunks/spec-task-breakdown-HTG6ME6G.mjs +7 -0
  361. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  362. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  363. package/dist/bin/core-chunks/stop-2H57XCGZ.mjs +15 -0
  364. package/dist/bin/core-chunks/subagent-start-5LPASXOS.mjs +7 -0
  365. package/dist/bin/core-chunks/subagent-stop-ANLSG3KN.mjs +7 -0
  366. package/dist/bin/core-chunks/surface-attribution-WL7S53XX.mjs +7 -0
  367. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  368. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  371. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  372. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  373. package/dist/bin/core-chunks/task-service-FK7FC3PE.mjs +7 -0
  374. package/dist/bin/core-chunks/tdd-NQDHU62B.mjs +9 -0
  375. package/dist/bin/core-chunks/team-XZ4Q6UBV.mjs +42 -0
  376. package/dist/bin/core-chunks/template-loader-33OVJ4G5.mjs +7 -0
  377. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  378. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  379. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  380. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  381. package/dist/bin/core-chunks/uninstall-6NFON7FO.mjs +13 -0
  382. package/dist/bin/core-chunks/update-4IE6SA6M.mjs +11 -0
  383. package/dist/bin/core-chunks/update-checker-FK7MWNWN.mjs +7 -0
  384. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  385. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  386. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  387. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  388. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  389. package/dist/bin/core-chunks/version-252QLBN2.mjs +7 -0
  390. package/dist/bin/core-chunks/watch-service-7ZERG7RC.mjs +9 -0
  391. package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +7 -0
  392. package/dist/bin/core-chunks/weak-model-mode-DH66XMD2.mjs +7 -0
  393. package/dist/bin/core-chunks/work-graph-JGJWE3AV.mjs +16 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-scope-3LXOEIUX.mjs +7 -0
  396. package/dist/bin/core-chunks/workflow-FGJVLRQ3.mjs +61 -0
  397. package/dist/bin/core-chunks/workflows-reference-UWKRZ6BJ.mjs +7 -0
  398. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  399. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  400. package/dist/bin/core-chunks/world-model-impact-RH5WH2B3.mjs +7 -0
  401. package/dist/bin/hook-chunks/{agent-identity-45BYQBU2.mjs → agent-identity-DH6DX72X.mjs} +1 -1
  402. package/dist/bin/hook-chunks/{agent-switch-4ZJJWKMD.mjs → agent-switch-7GOGG4KG.mjs} +1 -1
  403. package/dist/bin/hook-chunks/{analysis-UGHAG2SK.mjs → analysis-UI2JRLJO.mjs} +3 -3
  404. package/dist/bin/hook-chunks/{auto-flush-CXWTU3RF.mjs → auto-flush-JKIXTI2I.mjs} +1 -1
  405. package/dist/bin/hook-chunks/{capture-gate-PS6QUXLX.mjs → capture-gate-DIPHPNIC.mjs} +1 -1
  406. package/dist/bin/hook-chunks/{chunk-YDBZO6I3.mjs → chunk-22GFTUER.mjs} +1 -1
  407. package/dist/bin/hook-chunks/chunk-25OGCQTR.mjs +69 -0
  408. package/dist/bin/hook-chunks/{chunk-DCSKTMDX.mjs → chunk-3CKNJ5RA.mjs} +1 -1
  409. package/dist/bin/hook-chunks/{chunk-ABJNOG2I.mjs → chunk-3FEXJUO2.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-22AXWLI6.mjs → chunk-3HGQPUKG.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-GLPKMG5A.mjs → chunk-63P5VOR6.mjs} +10 -10
  412. package/dist/bin/hook-chunks/{chunk-PP6DANGV.mjs → chunk-6LU777GI.mjs} +1 -1
  413. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  414. package/dist/bin/hook-chunks/{chunk-QL3NYJTW.mjs → chunk-6RS7PNAN.mjs} +1 -1
  415. package/dist/bin/hook-chunks/{chunk-PO3QDKTE.mjs → chunk-6WDRJ7J7.mjs} +1 -1
  416. package/dist/bin/hook-chunks/chunk-7PA4KPSR.mjs +51 -0
  417. package/dist/bin/hook-chunks/{chunk-QP5USCDX.mjs → chunk-7WO5CEH3.mjs} +1 -1
  418. package/dist/bin/hook-chunks/{chunk-FW4MEPTB.mjs → chunk-A6LRNS6R.mjs} +1 -1
  419. package/dist/bin/hook-chunks/{chunk-GCDLPKOH.mjs → chunk-AEDB75AK.mjs} +1 -1
  420. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  421. package/dist/bin/hook-chunks/{chunk-WGWE3CSC.mjs → chunk-ANSRNEEI.mjs} +1 -1
  422. package/dist/bin/hook-chunks/{chunk-RTEEXGEA.mjs → chunk-AORD3YDQ.mjs} +1 -1
  423. package/dist/bin/hook-chunks/chunk-B2ZA5ZAO.mjs +8 -0
  424. package/dist/bin/hook-chunks/{chunk-BOBFTVAY.mjs → chunk-B7MHIUFA.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-Z6KVLCMK.mjs → chunk-BKJHD5JI.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-4NTVXJD7.mjs → chunk-BVK7ZDLX.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-IGHY4FGS.mjs → chunk-CPR4FPXG.mjs} +1 -1
  428. package/dist/bin/hook-chunks/{chunk-5XA5RL5I.mjs → chunk-ETTDRXQ6.mjs} +1 -1
  429. package/dist/bin/hook-chunks/chunk-F3PNT2DQ.mjs +19 -0
  430. package/dist/bin/hook-chunks/{chunk-C4O243NG.mjs → chunk-FBEDUKMG.mjs} +1 -1
  431. package/dist/bin/hook-chunks/{chunk-5H3KJWQS.mjs → chunk-GER6HFWV.mjs} +2 -2
  432. package/dist/bin/hook-chunks/{chunk-IWJG7CZX.mjs → chunk-GSPDJSJ5.mjs} +1 -1
  433. package/dist/bin/hook-chunks/chunk-H5AVBDCH.mjs +8 -0
  434. package/dist/bin/hook-chunks/{chunk-HEDZA6KC.mjs → chunk-HGZQWYBL.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-GDESYWTD.mjs → chunk-HNZ24HIK.mjs} +2 -2
  436. package/dist/bin/hook-chunks/{chunk-S5ISOGDB.mjs → chunk-IDPBMN3Q.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-PTA7DMLM.mjs → chunk-IFIENAZU.mjs} +1 -1
  438. package/dist/bin/hook-chunks/chunk-IHEOOJJT.mjs +11 -0
  439. package/dist/bin/hook-chunks/{chunk-S5N2ZZDL.mjs → chunk-IL36ER4U.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-6GAFRIUQ.mjs → chunk-IWUF2LGO.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-OGIFB3OE.mjs → chunk-JF6DFOQK.mjs} +1 -1
  442. package/dist/bin/hook-chunks/{chunk-Z4X7JIAP.mjs → chunk-JGZ3QGWX.mjs} +3 -3
  443. package/dist/bin/hook-chunks/chunk-KOLXYWOA.mjs +36 -0
  444. package/dist/bin/hook-chunks/{chunk-DVDZA63F.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{chunk-J5UQVJUW.mjs → chunk-NCLONKOT.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{chunk-QBYHZX33.mjs → chunk-NJ74RHNC.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{chunk-NLKPAJND.mjs → chunk-NMB6YSAH.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{chunk-MHNWIB7B.mjs → chunk-NSTXHVTH.mjs} +2 -2
  449. package/dist/bin/hook-chunks/{chunk-N3L77UNM.mjs → chunk-ONGVBXBD.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{chunk-X5W2UYQK.mjs → chunk-PFORBQBF.mjs} +3 -3
  451. package/dist/bin/hook-chunks/{chunk-KSSRINDX.mjs → chunk-PPWPUEBH.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{chunk-76GDLA3Z.mjs → chunk-PQJ64L6U.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{chunk-PGWFGRX4.mjs → chunk-QOQZHR3E.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{chunk-2UC4DTDO.mjs → chunk-QXCEBAIA.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{chunk-I26F7TLM.mjs → chunk-RLKYEL3F.mjs} +1 -1
  456. package/dist/bin/hook-chunks/{chunk-BDOAQVIF.mjs → chunk-SQW2B7NW.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{chunk-4HAKTI36.mjs → chunk-TF6PN7IB.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{chunk-UHVYBU7F.mjs → chunk-TKXOMN4K.mjs} +4 -4
  459. package/dist/bin/hook-chunks/{chunk-BX7VKYA7.mjs → chunk-UBWUQ64A.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{chunk-OUAVSD47.mjs → chunk-UI25YRTY.mjs} +1 -1
  461. package/dist/bin/hook-chunks/{chunk-G7QQZMAO.mjs → chunk-UMJ5D5I6.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{chunk-ZOX6OV6X.mjs → chunk-V6GGH6H5.mjs} +1 -1
  463. package/dist/bin/hook-chunks/chunk-WIA6ORIY.mjs +16 -0
  464. package/dist/bin/hook-chunks/chunk-WUOVBBPC.mjs +11 -0
  465. package/dist/bin/hook-chunks/{chunk-T6ELTQZM.mjs → chunk-XSJ7SPVR.mjs} +1 -1
  466. package/dist/bin/hook-chunks/{chunk-UYQC63MC.mjs → chunk-XXVHUYL7.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{chunk-RHKF7EJW.mjs → chunk-Y7MZA2G4.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{chunk-U4OON3S7.mjs → chunk-Y7RDBMNC.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{chunk-ROA2AJXY.mjs → chunk-YATXTHDL.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{chunk-ZFLIVOFX.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{chunk-S6L3FECF.mjs → chunk-ZH2MF7H7.mjs} +1 -1
  472. package/dist/bin/hook-chunks/{chunk-3WQBTXUC.mjs → chunk-ZJW27EUC.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{chunk-J5UVRZ44.mjs → chunk-ZXON2U5F.mjs} +3 -3
  474. package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +9 -0
  475. package/dist/bin/hook-chunks/{client-CRXA774S.mjs → client-K3ZA2BLB.mjs} +1 -1
  476. package/dist/bin/hook-chunks/{code-graph-cloud-GTSLO7CD.mjs → code-graph-cloud-XGQF7XYC.mjs} +1 -1
  477. package/dist/bin/hook-chunks/{codex-skill-NUBNPSMF.mjs → codex-skill-UZZCACMB.mjs} +1 -1
  478. package/dist/bin/hook-chunks/{command-installer-UHSXC3UG.mjs → command-installer-FJ73C2ZW.mjs} +1 -1
  479. package/dist/bin/hook-chunks/{config-manager-DX5OOPW5.mjs → config-manager-XDKOTIJM.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{context7-service-GDJ3QICX.mjs → context7-service-NH4BMGSJ.mjs} +1 -1
  481. package/dist/bin/hook-chunks/{custom-workflow-storage-FD47DPA3.mjs → custom-workflow-storage-VBMWLKA7.mjs} +1 -1
  482. package/dist/bin/hook-chunks/cwd-changed-STP3LH6Y.mjs +8 -0
  483. package/dist/bin/hook-chunks/{database-ZUC7OEZG.mjs → database-ZCP76LMM.mjs} +1 -1
  484. package/dist/bin/hook-chunks/{detect-changes-OJUBWWTU.mjs → detect-changes-5W6EGEZG.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{developer-evolution-WNSTHDAA.mjs → developer-evolution-UTY3CWOK.mjs} +1 -1
  486. package/dist/bin/hook-chunks/{distill-GOGPFQFK.mjs → distill-63BHUJAC.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{enriched-recall-QF22RIK7.mjs → enriched-recall-6F6LBYAB.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{format-J3X3R225.mjs → format-VJ2YQ4XQ.mjs} +1 -1
  489. package/dist/bin/hook-chunks/{judgment-ledger-storage-FE4HXTHM.mjs → judgment-ledger-storage-7Q7AEEY6.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{judgment-orchestrator-YDJTKNV2.mjs → judgment-orchestrator-AAON4ZJ4.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{judgment-receipt-7A2DXVJA.mjs → judgment-receipt-LSJCAYBT.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{land-cue-SZWJH6XP.mjs → land-cue-DEO2AZW4.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{land-synthesis-JLYUBKHR.mjs → land-synthesis-GTMFIGDM.mjs} +1 -1
  494. package/dist/bin/hook-chunks/{legacy-crew-sweep-JXYO62UE.mjs → legacy-crew-sweep-QPKU7ITU.mjs} +2 -2
  495. package/dist/bin/hook-chunks/{memory-index-CIYDXN2G.mjs → memory-index-KCMXQGKX.mjs} +1 -1
  496. package/dist/bin/hook-chunks/{notification-UA7RTVHG.mjs → notification-DX6ZHOUC.mjs} +1 -1
  497. package/dist/bin/hook-chunks/{pack-integrity-GZC5NGFN.mjs → pack-integrity-UMLIB5RQ.mjs} +1 -1
  498. package/dist/bin/hook-chunks/{pack-manager-AF5F7PRT.mjs → pack-manager-YXRK2TJ4.mjs} +1 -1
  499. package/dist/bin/hook-chunks/{planning-M3RAOZVB.mjs → planning-JR7O5MYW.mjs} +2 -2
  500. package/dist/bin/hook-chunks/{post-edit-QRDYPZLZ.mjs → post-edit-IPTVSRVG.mjs} +1 -1
  501. package/dist/bin/hook-chunks/{pre-bash-TWWFVNQ7.mjs → pre-bash-5WWTH36N.mjs} +1 -1
  502. package/dist/bin/hook-chunks/{pre-commit-PTFF7JIN.mjs → pre-commit-KZ5TNTPW.mjs} +1 -1
  503. package/dist/bin/hook-chunks/pre-edit-XHPYBXRU.mjs +11 -0
  504. package/dist/bin/hook-chunks/{pre-package-325ALZKD.mjs → pre-package-U3HDW3SX.mjs} +1 -1
  505. package/dist/bin/hook-chunks/{pre-search-GOHVFAFH.mjs → pre-search-R5CRK66E.mjs} +1 -1
  506. package/dist/bin/hook-chunks/{pre-secrets-MYNM5KI4.mjs → pre-secrets-MWPPZPWK.mjs} +1 -1
  507. package/dist/bin/hook-chunks/{prjct-md-RCB6FWD6.mjs → prjct-md-IBQTJBK7.mjs} +1 -1
  508. package/dist/bin/hook-chunks/{project-agent-surfaces-V4P5RTUR.mjs → project-agent-surfaces-TPZO73ZV.mjs} +1 -1
  509. package/dist/bin/hook-chunks/{project-file-inventory-OKIP4LBO.mjs → project-file-inventory-HHURZTMH.mjs} +1 -1
  510. package/dist/bin/hook-chunks/project-memory-YQLZX5RG.mjs +8 -0
  511. package/dist/bin/hook-chunks/{project-style-evolution-RPGATIYJ.mjs → project-style-evolution-NOFCIIZZ.mjs} +1 -1
  512. package/dist/bin/hook-chunks/prompt-DJWONMTZ.mjs +24 -0
  513. package/dist/bin/hook-chunks/{publish-helper-SX7HEV2L.mjs → publish-helper-ZSL27HSX.mjs} +1 -1
  514. package/dist/bin/hook-chunks/{purge-XKHUAB4H.mjs → purge-5W3K2MZL.mjs} +1 -1
  515. package/dist/bin/hook-chunks/retention-GWJ4AX7I.mjs +8 -0
  516. package/dist/bin/hook-chunks/{sdd-6PF7MBAY.mjs → sdd-GWBRD4KI.mjs} +1 -1
  517. package/dist/bin/hook-chunks/{session-continuity-UEXQDGZE.mjs → session-continuity-VH645RGR.mjs} +1 -1
  518. package/dist/bin/hook-chunks/session-start-4TYTI27B.mjs +8 -0
  519. package/dist/bin/hook-chunks/settings-installer-CQKMGMRG.mjs +9 -0
  520. package/dist/bin/hook-chunks/{setup-ZOHG6MGF.mjs → setup-VF4UHUBX.mjs} +3 -3
  521. package/dist/bin/hook-chunks/{shipping-QVGTOO6U.mjs → shipping-2ULWBGRX.mjs} +4 -4
  522. package/dist/bin/hook-chunks/{skill-index-FGDQVYHM.mjs → skill-index-55I3HLAI.mjs} +1 -1
  523. package/dist/bin/hook-chunks/{spec-context-inference-6Z52BT37.mjs → spec-context-inference-HVENYOIO.mjs} +1 -1
  524. package/dist/bin/hook-chunks/{spec-service-UAQ5AEXQ.mjs → spec-service-4XGQQPGP.mjs} +2 -2
  525. package/dist/bin/hook-chunks/{spec-task-breakdown-LAXGVLMY.mjs → spec-task-breakdown-JXF556UH.mjs} +1 -1
  526. package/dist/bin/hook-chunks/{state-storage-XU35ZYNA.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  527. package/dist/bin/hook-chunks/stop-NJDYIIXR.mjs +16 -0
  528. package/dist/bin/hook-chunks/subagent-start-2YMGD4SY.mjs +8 -0
  529. package/dist/bin/hook-chunks/{subagent-stop-OUG4PR7S.mjs → subagent-stop-4TZJ2NSJ.mjs} +1 -1
  530. package/dist/bin/hook-chunks/{surface-attribution-A6GCGRFM.mjs → surface-attribution-UNK4J5W2.mjs} +1 -1
  531. package/dist/bin/hook-chunks/{symbol-graph-DMPBNBX7.mjs → symbol-graph-MH42JSPX.mjs} +1 -1
  532. package/dist/bin/hook-chunks/{sync-cursor-storage-VVLA3L2U.mjs → sync-cursor-storage-ZB7FGT6D.mjs} +1 -1
  533. package/dist/bin/hook-chunks/{task-orchestration-HFZYWYLR.mjs → task-orchestration-7NGRIISS.mjs} +1 -1
  534. package/dist/bin/hook-chunks/{task-overview-PCUZWL5Q.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  535. package/dist/bin/hook-chunks/task-service-SPUES5DO.mjs +8 -0
  536. package/dist/bin/hook-chunks/{tdd-QZL4OSM7.mjs → tdd-MYF7I5FS.mjs} +1 -1
  537. package/dist/bin/hook-chunks/{template-loader-SKXILJLJ.mjs → template-loader-4SYVR2UB.mjs} +1 -1
  538. package/dist/bin/hook-chunks/{usefulness-SZLG6LVC.mjs → usefulness-TBD5EYAL.mjs} +1 -1
  539. package/dist/bin/hook-chunks/{vault-retire-notice-HOXPURNQ.mjs → vault-retire-notice-7XHVNHU6.mjs} +1 -1
  540. package/dist/bin/hook-chunks/{velocity-storage-5J6BAMCW.mjs → velocity-storage-IOCVK2LU.mjs} +1 -1
  541. package/dist/bin/hook-chunks/{weak-model-mode-ZRNKFTFF.mjs → weak-model-mode-TYJJT6JJ.mjs} +1 -1
  542. package/dist/bin/hook-chunks/{work-graph-PGYHFLEL.mjs → work-graph-AVAOKY63.mjs} +1 -1
  543. package/dist/bin/hook-chunks/{work-scope-FIB6LBKE.mjs → work-scope-A6XPENFE.mjs} +1 -1
  544. package/dist/bin/hook-chunks/{workspace-occupancy-3D4OKQRB.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  545. package/dist/bin/hook-fast-darwin-arm64 +0 -0
  546. package/dist/bin/hook-fast-darwin-x64 +0 -0
  547. package/dist/bin/hook-fast-linux-x64 +0 -0
  548. package/dist/bin/prjct-core.mjs +9 -3311
  549. package/dist/bin/prjct-hooks.mjs +3 -3
  550. package/dist/bin/prjct.mjs +27 -8
  551. package/dist/daemon/entry.mjs +621 -606
  552. package/dist/mcp/server.mjs +317 -302
  553. package/package.json +5 -6
  554. package/scripts/install.sh +28 -496
  555. package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +0 -11
  556. package/dist/bin/hook-chunks/chunk-BU22R6JX.mjs +0 -9
  557. package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +0 -36
  558. package/dist/bin/hook-chunks/chunk-EWOK4VE7.mjs +0 -11
  559. package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +0 -69
  560. package/dist/bin/hook-chunks/chunk-GDECEHO5.mjs +0 -16
  561. package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +0 -11
  562. package/dist/bin/hook-chunks/chunk-KHLYWNHT.mjs +0 -8
  563. package/dist/bin/hook-chunks/chunk-TRMBRDKH.mjs +0 -8
  564. package/dist/bin/hook-chunks/chunk-TXSLON7M.mjs +0 -19
  565. package/dist/bin/hook-chunks/chunk-V2FR2NPL.mjs +0 -43
  566. package/dist/bin/hook-chunks/chunk-XXRAQZNC.mjs +0 -35
  567. package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +0 -8
  568. package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +0 -11
  569. package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +0 -8
  570. package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +0 -24
  571. package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +0 -8
  572. package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +0 -8
  573. package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +0 -9
  574. package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +0 -16
  575. package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +0 -8
  576. package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +0 -8
@@ -0,0 +1,12 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{f as ie}from"./chunk-TGNZI4KF.mjs";import"./chunk-Y7XOKG4O.mjs";import"./chunk-JCWA7NLM.mjs";import{a as le,b as ue}from"./chunk-TDTPDVUM.mjs";import"./chunk-CFD6CW7T.mjs";import"./chunk-IVGWOY3U.mjs";import{a as fe,b as ge}from"./chunk-ID5KE74L.mjs";import"./chunk-JT4RNQ67.mjs";import{a as B}from"./chunk-VCSESVZ4.mjs";import{b as me}from"./chunk-KIRU4QFX.mjs";import{a as U,i as Y,j as de}from"./chunk-7QMBIMEX.mjs";import"./chunk-VDXTMAMO.mjs";import{a as y}from"./chunk-NZKUCQZK.mjs";import"./chunk-H2KNJUPN.mjs";import{a as Q,d as $,e as A,g as ae,i as ce}from"./chunk-5MN22JFI.mjs";import{a as he}from"./chunk-V5VCXMKO.mjs";import{f as re}from"./chunk-FOWTB762.mjs";import{a as K}from"./chunk-6FUCOGOW.mjs";import"./chunk-7CI4AMVO.mjs";import"./chunk-Q3LUL6LL.mjs";import"./chunk-C7YBUD4K.mjs";import"./chunk-IOFCSTGM.mjs";import"./chunk-S6FBPXQL.mjs";import"./chunk-NOHSLOLL.mjs";import"./chunk-RCIWCKL7.mjs";import"./chunk-E73HSXCX.mjs";import"./chunk-76YMLNLF.mjs";import{a as pe}from"./chunk-O5N6XYPU.mjs";import"./chunk-SROBBOJB.mjs";import"./chunk-56FW4P6U.mjs";import"./chunk-BQKDJ3U6.mjs";import"./chunk-6OYLZ4NM.mjs";import"./chunk-SO3ZPNWT.mjs";import"./chunk-HYMJVHAX.mjs";import"./chunk-4T7NGLNQ.mjs";import"./chunk-P2KU4FFA.mjs";import"./chunk-V7R3L54M.mjs";import"./chunk-MG3YN3AI.mjs";import"./chunk-YEALP3WX.mjs";import"./chunk-QZ7T2EYR.mjs";import"./chunk-IFLBZKKK.mjs";import"./chunk-ZKJZDOPT.mjs";import"./chunk-YOGI4WE6.mjs";import{a as x}from"./chunk-UYMZ3NAF.mjs";import"./chunk-R7LLMJDP.mjs";import"./chunk-CNWEQUB7.mjs";import"./chunk-AJXELVNH.mjs";import"./chunk-CWLGRKA7.mjs";import"./chunk-2NI4EEK2.mjs";import"./chunk-X4FR5S7E.mjs";import"./chunk-5YLI5V3Q.mjs";import"./chunk-6AFXUX2M.mjs";import"./chunk-WSVMQYYU.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-KUQLXY2P.mjs";import"./chunk-HCPQZRR3.mjs";import"./chunk-EHVU2SMR.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{h as V}from"./chunk-ID2C2S33.mjs";import"./chunk-RACISWUV.mjs";import"./chunk-DIEPWXJJ.mjs";import"./chunk-NINFE7GS.mjs";import"./chunk-UNNY2IWZ.mjs";import{b as W}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-JPMUJY42.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-XSZG3CBO.mjs";import{f as R,i as Ae}from"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-DN46DLU3.mjs";import"./chunk-PIA26GWG.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-OYXQRBVM.mjs";import{e as I,l as Me}from"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-TIBYHZFA.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import{i as M,p as De}from"./chunk-D62TAZG6.mjs";import"./chunk-XYDLXF5A.mjs";import"./chunk-FATYLG3L.mjs";import"./chunk-2EEMQV7N.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-GDLAQV3Q.mjs";import"./chunk-UT425KVX.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import{e as z,g as Te}from"./chunk-225DWS4D.mjs";import{a as g}from"./chunk-3TRXQAU4.mjs";import{existsSync as ve}from"node:fs";import Se from"node:path";Ae();Te();Me();De();var L="ship:in_progress",we=class extends he{static{g(this,"ShippingCommands")}async ship(i,e=process.cwd(),n={}){try{let l=await me(e);if(!l.ok)return l.result;let o=l.value;try{if((await W.readConfig(e))?.delivery?.killSwitch==="on")return{success:!1,error:"Delivery kill-switch ON \u2014 mutation path removed. Lift only by setting `delivery.killSwitch` to `off` in `.prjct/prjct.config.json` (not via --no-judgment-gate / --no-spec-gate)."}}catch{}try{let t=R.getDoc(o,L);t?.version&&(await B.getByVersion(o,t.version)||(await B.addShipped(o,{name:t.feature,version:t.version}),console.log(`\u2139\uFE0F Reconciled an interrupted ship: ${t.feature} (v${t.version})`)),R.deleteDoc(o,L))}catch{}let a=await Y(o,e),d=a?.linkedSpecId,b=ye(i)??ye(a?.description??null),m=await W.readConfig(e).catch(()=>null);if(!n.noSpecGate&&!d)try{let{effectiveSddMode:t}=await import("./sdd-HE7O6N5S.mjs");if(t(m)==="strict")return{success:!1,error:"Strict SDD: this work has no linked intent/spec. Start it via `prjct intent` \u2192 `audit-spec` \u2192 `prjct work --spec <id>`, or override with `prjct ship --no-spec-gate`."}}catch{}try{let{checkPackageLegitimacy:t}=await import("./package-legitimacy-VHHGI4P7.mjs"),c=await t(e);if(c.risky&&c.message){if((m?.sdd?.mode==="strict"||m?.tdd?.mode==="strict"||m?.deliveryGeometry?.mode==="strict")&&!n.allowNewDeps)return{success:!1,error:`${c.message}
8
+ Override only with explicit consent: verify packages, then \`prjct ship --allow-new-deps\`.`};console.log(`\u26A0\uFE0F ${c.message}`)}}catch{}try{let{contextPressureBlocksExpansion:t,contextPressureVerdict:c}=await import("./context-pressure-5URQVNBC.mjs"),r=c(m,{turnCount:a?.turnCount,tokensIn:a?.tokensIn,tokensOut:a?.tokensOut,description:a?.description});if(t(r,m)&&!n.forcePressure)return{success:!1,error:r.cue??"Context density hard-block is enabled (contextPressure.hardBlockShip). Soften injection or pass --force-pressure with consent."};(r.level==="warn"||r.level==="critical")&&r.cue&&console.log(r.cue)}catch{}let u=m?.deliveryGeometry?.mode??"off";try{let{computeCommittedChangeset:t,shipGeometryVerdict:c}=await import("./delivery-geometry-GSJ6LXUC.mjs"),r=await t(e),p=c({changeset:r,mode:u,explicitGeometry:n.geometry??null,locThreshold:m?.deliveryGeometry?.locThreshold});if(p.blocked)return{success:!1,error:p.message??"Delivery geometry gate blocked ship."};p.message&&console.log(p.message)}catch(t){if(u==="strict"&&t instanceof M)return{success:!1,error:`Delivery geometry gate unevaluable: ${t.message}. Re-run when git is healthy, or ship with explicit \`--geometry\`.`}}try{let{hasSymbolIndex:t}=await import("./symbol-graph-PCS43SHZ.mjs");if(t(o)){let{detectChanges:c,shipStructuralRiskCue:r}=await import("./detect-changes-2YIEX7AY.mjs"),p=await c(e,o,{source:"auto"}),h=r(p);if(h&&console.log(h),(m?.deliveryGeometry?.mode??"off")==="strict"&&p.summary.critical>0&&!n.geometry&&!n.allowNewDeps)return{success:!1,error:`Strict delivery geometry + structural CRITICAL risk (${p.summary.critical} file(s), blast ${p.affectedFiles.length}). Review \`prjct code impact --md\`, then re-ship with explicit \`--geometry single|split|direct\`.`}}}catch(t){t instanceof M&&console.log(`\u26A0\uFE0F Structural risk cue unavailable: ${t.message}`)}let J=(m?.persona?.packs??[]).includes("code-strict");try{let{intensityFromChangeset:t,judgmentShipVerdict:c}=await import("./precision-judgment-MCX4MIIG.mjs"),{shipRequiresQuality:r}=await import("./judgment-orchestrator-E3SO3NVE.mjs"),{computeCommittedChangeset:p}=await import("./delivery-geometry-GSJ6LXUC.mjs"),{judgmentLedgerStorage:h}=await import("./judgment-ledger-storage-ZTYXPMM4.mjs"),f=await p(e),$e={harnessLevel:a?.harness?.level,harnessKind:a?.harness?.kind},Oe=t({files:f?.files??0,loc:f?.loc??0},$e).intensity,oe=J?"full":Oe,se=J||r(oe),O=h.get(o),D=c({codeStrict:se,intensity:oe,ledger:O,override:!!n.noJudgmentGate});if(D.blocked)return{success:!1,error:D.message};if(D.message&&console.log(D.message),se&&!n.noJudgmentGate&&D.reason==="approved")try{let{contentBoundDriftVerdict:C,currentTreeHashForStamp:P}=await import("./content-bound-stamp-2PJNI4JC.mjs"),T=O?.contentBound,N=T?.treeHash?await P(e,T):null,H=C({stamp:T??null,currentTreeHash:N,hard:!0,override:!1});if(H.blocked)return{success:!1,error:H.message};H.message&&console.log(H.message)}catch(C){if(C instanceof M)return{success:!1,error:`Content-bound stamp unevaluable: ${C.message}. Re-run when git is healthy, or override with \`--no-judgment-gate\`.`}}else if(O?.contentBound?.treeHash&&!n.noJudgmentGate)try{let{contentBoundDriftVerdict:C,currentTreeHashForStamp:P}=await import("./content-bound-stamp-2PJNI4JC.mjs"),T=await P(e,O.contentBound),N=C({stamp:O.contentBound,currentTreeHash:T,hard:!1,override:!1});N.message&&console.log(N.message)}catch{}}catch(t){if(J&&t instanceof M)return{success:!1,error:`Judgment ship gate unevaluable: ${t.message}. Re-run when git is healthy, or override with \`--no-judgment-gate\`.`}}if(a&&await de(o,e),d&&!n.noSpecGate)try{let{specService:t}=await import("./spec-service-I23KJKKP.mjs"),c=await t.get(e,d);if(c&&c.content.acceptance_criteria.length>0){let r=[];r.push(""),r.push(`## Spec acceptance gate \u2014 \`${c.title}\` (${c.id.slice(0,8)})`),r.push(""),r.push("Walk each criterion. STOP if any is unmet."),r.push("");for(let p of c.content.acceptance_criteria)r.push(`- [ ] ${p}`);r.push(""),r.push("Override (only with explicit user consent): `prjct ship --no-spec-gate`."),r.push(""),console.log(r.join(`
9
+ `))}}catch{}if(!n.noTestGate)try{let{effectiveTddMode:t}=await import("./tdd-NQDHU62B.mjs"),c=await W.readConfig(e).catch(()=>null),r=t(c);if(r!=="off"){let h=(await K(e).catch(()=>null))?.test?.command,f=[""];r==="strict"?(f.push("## TDD gate (strict) \u2014 tests must be green before ship"),f.push(""),f.push(h?`Run \`prjct tdd check\` (\`${h}\`). STOP and fix if RED.`:"No test command detected \u2014 add tests (strict TDD expects them)."),f.push("Override (only with explicit user consent): `prjct ship --no-test-gate`.")):(f.push("## TDD reminder (assist)"),f.push(""),f.push(h?`Did the change ship with tests? Verify green: \`prjct tdd check\` (\`${h}\`).`:"Consider adding a test for this change.")),f.push(""),console.log(f.join(`
10
+ `))}}catch{}let Ce=y.getRulesForCommand(o,"ship"),X=n.intent==="seed-code-workflow"?await ke(o,e):null;if(X===!1)return{success:!1,error:"seed-code-workflow requested but this project does not look like code (no package.json / Cargo.toml / pyproject.toml / VERSION). Add rules manually with `prjct workflow add`."};let Z=X===!0?y.getRulesForCommand(o,"ship"):Ce,ee=!Z.some(t=>t.type==="step"&&t.position==="before")&&n.intent!=="register-only"?await ke(o,e):!1;ee&&console.log("\u2139\uFE0F Auto-seeded code ship workflow (one-time migration)");let te=ee?y.getRulesForCommand(o,"ship"):Z,_=n.intent==="pr-convention-auto"?"auto":n.intent==="pr-convention-manual"?"manual":null;_&&Ee(o,_,te);let Re=_?y.getRulesForCommand(o,"ship"):te,q=await Ne(o,e,Re,n);if(q)return He(q,n.md===!0),{success:!1,clarification:q};let w=b??await Fe(e);if(!w)return{success:!1,error:'Ship needs a release description. Pass one explicitly, e.g. `prjct ship "add universal agent compatibility"`, or ship from a named feature branch.'};let F={feature:w},v=await U(o,"ship","before",{projectPath:e,skipRules:n.skipHooks,runContext:F});if(!v.success)return{success:!1,error:`Ship blocked: ${v.gatesFailed.length>0?v.gatesFailed.join(", "):"unknown step"}`};let S=typeof F.version=="string"?F.version:"unversioned";try{R.setDoc(o,L,{feature:w,version:S,startedAt:I()})}catch{}await B.addShipped(o,{name:w,version:S});try{R.deleteDoc(o,L)}catch{}if(a)try{R.run(o,"UPDATE tasks SET shipped_at = ? WHERE id = ?",I(),a.id)}catch{}await this.logToMemory(e,"feature_shipped",{feature:w,version:S,timestamp:I()});let G=await U(o,"ship","after",{projectPath:e,skipRules:n.skipHooks,runContext:F}),ne=[...v.instructions,...G.instructions];try{await ie.sync(e)}catch(t){console.warn("\u26A0\uFE0F Failed to sync AI context after shipping:",z(t))}let xe=v.stepsRun.length+G.stepsRun.length;if(a?.id)try{let{usefulnessService:t}=await import("./usefulness-A3GRKFL3.mjs");t.creditShippedTask(o,a.id)}catch{}let E=await(async()=>{try{let{synthesizeJudgmentReceipt:t}=await import("./judgment-receipt-WT4EMCAV.mjs"),c=await t({projectId:o,projectPath:e,cycleDescription:a?.description??w,cycleId:a?.id??null});return c.wrote?c.summary??"Judgment receipt written":null}catch{return null}})();if(n.md){let t=ue("ship",!0),c=Q(ce(`Shipped: ${w}`,`Version: ${S}`),$("Results",A([`Version: ${S}`,`Workflow steps run: ${xe>0?[...v.stepsRun,...G.stepsRun].join(", "):"none"}`,`Hooks failed (non-blocking): ${v.hooksFailed.length+G.hooksFailed.length}`,E?`Compound judgment: ${E}`:null].filter(r=>r!==null))),ne.length>0?$("Agent Instructions",A(ne)):null,ae([...t.map(r=>({label:r.desc,command:r.cmd})),{label:"Capture non-obvious learning (compounds next session)",command:'prjct remember learning "\u2026"'}]));console.log(c)}else V.done(`v${S} shipped`),E&&V.info(`Compound: ${E}`),le("ship");return(async()=>{try{let{flushIfLinked:t}=await import("./auto-flush-EWSVMKQN.mjs");await t(e)}catch{}})(),{success:!0,feature:w,version:S}}catch(l){return V.fail(z(l)),re(l)}}};function ye(s){let i=s?.trim();return i||null}g(ye,"normalizeShipFeature");async function Fe(s){let i=await pe(s);if(!i)return null;let e=i.replace(/^refs\/heads\//,"").trim();if(!e||/^(main|master|develop|development|dev|trunk)$/i.test(e))return null;let n=e.split("/").filter(Boolean).at(-1)??e;if(!n||/^\d+(?:\.\d+)*$/.test(n))return null;let l=n.replace(/^[a-z]+-\d+[-_]/i,"").replace(/[_-]+/g," ").replace(/[^\p{L}\p{N} ]+/gu," ").replace(/\s+/g," ").trim();return l.length>=3?l:null}g(Fe,"inferShipFeatureFromBranch");function be(s){return["package.json","Cargo.toml","pyproject.toml","go.mod","Gemfile","pom.xml","build.gradle","VERSION"].some(e=>ve(Se.join(s,e)))}g(be,"isCodeProject");function j(s){return ve(Se.join(s,".git"))}g(j,"isGitRepo");async function ke(s,i){if(!be(i))return!1;let e=new Date().toISOString(),n=y.getRulesForCommand(s,"ship"),l=new Set(n.map(u=>u.action)),o=n.reduce((u,k)=>Math.max(u,k.sortOrder??0),0),a=[];j(i)&&a.push({action:'git branch --show-current | grep -vE "^(main|master)$"',description:"Prevent shipping from main branch",timeoutMs:5e3});let d=await K(i).catch(()=>null);d?.test?.command&&a.push({action:`verify:${d.test.command}`,description:"Verify before shipping (Stop-Slop)",timeoutMs:3e5});let b=[{action:"version:bump",description:"Bump version (stack-aware)",timeoutMs:1e4},{action:"changelog:add",description:"Append CHANGELOG entry",timeoutMs:1e4}];j(i)&&(b.push({action:"git:commit",description:"Commit ship",timeoutMs:15e3}),b.push({action:"git:push",description:"Push to origin",timeoutMs:3e4}),await Ge(s,i)==="auto"&&b.push({action:"pr:ensure",description:"Open or confirm the PR",timeoutMs:3e4}));let m=[...a.map(u=>({...u,type:"gate"})),...b.map(u=>({...u,type:"step"}))].filter(u=>!l.has(u.action));for(let[u,k]of m.entries())y.addRule(s,{type:k.type,command:"ship",position:"before",action:k.action,description:k.description,enabled:!0,timeoutMs:k.timeoutMs,sortOrder:o+u+1,createdAt:e});return m.length>0}g(ke,"seedCodeShipRules");async function Ge(s,i){let e=x.getWorkflow(s,"ship"),n=e?.metadata?.prConvention;if(n==="auto"||n==="manual")return n;let l=await fe(i),o=ge(l);return x.updateWorkflow(s,"ship",{metadata:{...e?.metadata??{},prConvention:o}}),o}g(Ge,"resolvePrConvention");function Ee(s,i,e){let n=x.getWorkflow(s,"ship");if(x.updateWorkflow(s,"ship",{metadata:{...n?.metadata??{},prConvention:i}}),i==="auto"&&!e.some(l=>l.action==="pr:ensure")){let l=e.reduce((o,a)=>Math.max(o,a.sortOrder??0),0);y.addRule(s,{type:"step",command:"ship",position:"before",action:"pr:ensure",description:"Open or confirm the PR",enabled:!0,timeoutMs:3e4,sortOrder:l+1,createdAt:new Date().toISOString()})}}g(Ee,"applyPrConventionDecision");async function Ne(s,i,e,n){if(n.intent==="proceed"||n.intent==="register-only")return null;if(!e.some(d=>d.type==="step"&&d.position==="before"))return{question:"No `ship` workflow steps are configured for this project. What should ship do?",options:["register-only","seed-code-workflow","abort"],state:{rulesCount:e.length,looksLikeCode:be(i)}};if(await Y(s,i))return null;let a=await Ie(i);return a?{question:`No active work cycle, and PR #${a.number} ("${a.title}") is OPEN for this branch. Continue ship anyway?`,options:["proceed","abort"],state:{openPr:a.number,branch:a.branch}}:j(i)&&e.some(d=>d.action==="git:push")&&!e.some(d=>d.action==="pr:ensure")&&!x.getWorkflow(s,"ship")?.metadata?.prConvention?{question:"This project ships without opening/updating a PR. Want ship to handle that automatically (`gh pr create`), or do you manage PRs yourself?",options:["pr-convention-auto","pr-convention-manual"]}:null}g(Ne,"buildClarification");function He(s,i){if(i){let e=Q($("Clarification needed",s.question),$("Options",A(s.options.map(n=>`\`prjct ship --intent=${n}\``))),s.state?$("State",A(Object.entries(s.state).map(([n,l])=>`${n}: ${JSON.stringify(l)}`))):null);console.log(e);return}console.log(`
11
+ \u26A0\uFE0F ${s.question}`),console.log(`
12
+ Options:`);for(let e of s.options)console.log(` prjct ship --intent=${e}`)}g(He,"renderClarification");async function Ie(s){if(!j(s))return null;try{let{execFileAsync:i}=await import("./exec-34V6SJYO.mjs"),{stdout:e}=await i("git",["branch","--show-current"],{cwd:s,timeout:3e3}),n=e.toString().trim();if(!n)return null;let{stdout:l}=await i("gh",["pr","list","--head",n,"--state","open","--json","number,title","--limit","1"],{cwd:s,timeout:5e3}),o=JSON.parse(l.toString());return o.length===0?null:{number:o[0].number,title:o[0].title,branch:n}}catch{return null}}g(Ie,"findOpenPrForBranch");export{we as ShippingCommands,ke as seedCodeShipRules};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c}from"./chunk-X4FR5S7E.mjs";import"./chunk-5YLI5V3Q.mjs";import"./chunk-6AFXUX2M.mjs";import"./chunk-WSVMQYYU.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-DIEPWXJJ.mjs";import"./chunk-UNNY2IWZ.mjs";import"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-TIBYHZFA.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as MACHINE_SOURCES,c as buildSignalsFile,b as isSignalEntry};
@@ -0,0 +1,13 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as M}from"./chunk-V5VCXMKO.mjs";import{e as k}from"./chunk-FOWTB762.mjs";import"./chunk-7CI4AMVO.mjs";import{b as $}from"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{h as w}from"./chunk-ID2C2S33.mjs";import{b as y}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import{k as v,l as I}from"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import{e as b,g as x}from"./chunk-225DWS4D.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";x();I();var j=class extends M{static{c(this,"SkillAdherenceCommands")}async skillAdherence(r=null,i=process.cwd(),a={}){try{let l=await this.ensureProjectInit(i);if(!l.success)return l;let t=R(r);if(!t)return w.fail(`Invalid window "${r}". Use: 7d, 24h, 14d, 30d (units: h or d).`),{success:!1,error:"Invalid window"};let e=await y.readConfig(i);if(!e?.projectId)return w.fail("No prjct project here \u2014 run `prjct start` first."),{success:!1,error:"No project"};let o=Date.now()-t.hours*60*60*1e3,d=$.recall(e.projectId,{types:["improvement-signal"],tags:{source:"skill-miss-detector"},limit:300,dedupeByKey:!1}).filter(s=>Date.parse(s.rememberedAt)>=o),u=$.recall(e.projectId,{types:["decision"],tags:{resolves:"skill-miss"},limit:300,dedupeByKey:!1}).filter(s=>Date.parse(s.rememberedAt)>=o),g=new Set(u.map(s=>s.tags.relates).filter(s=>!!s)),p=d.map(s=>({memId:s.tags.relates??"\u2014",excerpt:S(s.content),file:s.tags.file??"",rememberedAt:s.rememberedAt,resolved:s.tags.relates?g.has(s.tags.relates):!1})),m=p.length,f=p.filter(s=>s.resolved).length,h=m===0?1:f/m;return a.md?console.log(B(t.label,p,m,f,h,u.length)):console.log(A(t.label,p,m,f,h)),{success:!0,window:t.label,misses:m,resolved:f,adherence:Number(h.toFixed(2))}}catch(l){return k(b(l))}}};function R(n){let r=v(n);return r?r.unit==="h"?{label:`${r.n}h`,hours:r.n}:{label:`${r.n}d`,hours:r.n*24}:null}c(R,"parseWindow");function S(n){return(n.split(`
8
+ `)[0]??"").replace(/^\[skill-miss\]\s*/,"").trim()}c(S,"firstLine");function A(n,r,i,a,l){if(i===0)return`Skill adherence \u2014 last ${n}: no skill-misses captured. Clean.`;let t=[];t.push(`Skill adherence \u2014 last ${n} \xB7 ${i} miss${i===1?"":"es"} \xB7 ${a} resolved \xB7 ${(l*100).toFixed(0)}% addressed`),t.push("");for(let e of r.slice(0,20)){let o=e.resolved?"\u2713":"\xB7",d=e.file?` (${e.file})`:"";t.push(` ${o} ${e.memId}${d} ${e.excerpt.slice(0,100)}`)}return t.join(`
9
+ `)}c(A,"formatText");function B(n,r,i,a,l,t){if(i===0)return`## Skill adherence \u2014 last ${n}
10
+
11
+ _No skill-misses captured in the window._
12
+ `;let e=[];e.push(`## Skill adherence \u2014 last ${n}`),e.push(""),e.push(`- **Skill-misses**: ${i}`),e.push(`- **Resolved**: ${a} (${(l*100).toFixed(0)}% addressed)`),e.push(`- **Resolution decisions logged**: ${t}`),e.push(""),e.push("| State | Memory | File | Signal |"),e.push("|---|---|---|---|");for(let o of r.slice(0,30)){let d=o.resolved?"\u2713 resolved":"\xB7 open",u=o.file||"\u2014",g=o.excerpt.slice(0,110).replace(/\|/g,"\\|");e.push(`| ${d} | ${o.memId} | ${u} | ${g} |`)}return e.join(`
13
+ `)}c(B,"formatMarkdown");export{j as SkillAdherenceCommands};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c,d,f as e}from"./chunk-HYMJVHAX.mjs";import"./chunk-4T7NGLNQ.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-FATYLG3L.mjs";import"./chunk-2EEMQV7N.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";e();export{a as SKILL_DEFINITIONS,c as SkillGenerator,b as skillBodyHasProjectStamp,d as skillGenerator};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{f as m,i as S}from"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";S();import k from"node:fs/promises";import E from"node:os";import g from"node:path";function I(t){return[{dir:g.join(t,".claude","skills"),scope:"project"},{dir:g.join(t,"skills"),scope:"project"},{dir:g.join(E.homedir(),".claude","skills"),scope:"global"}]}o(I,"skillRoots");function y(t){let s=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
8
+ `).match(/^---\n([\s\S]*?)\n---/);if(!s)return{};let i={},n=s[1].split(`
9
+ `),p=o(e=>{if(e>=n.length)return;let c=n[e].match(/^(name|description):\s*(.*)$/);if(!c){p(e+1);return}let u=c[1],l=c[2].trim(),d=/^[>|][+-]?$/.test(l)?n.slice(e+1).findIndex(f=>!/^\s+\S/.test(f)):0,a=d===-1?n.length-e-1:d,h=/^[>|][+-]?$/.test(l)?n.slice(e+1,e+1+a).map(f=>f.trim()).join(" "):l;h&&(i[u]=h.replace(/^["']|["']$/g,"")),p(e+1+a)},"parseLine");return p(0),i}o(y,"parseFrontmatter");async function F(t,r){let s=new Map;for(let{dir:n,scope:p}of I(r)){let e=await k.readdir(n).catch(()=>null);if(e)for(let c of e){let u=g.join(n,c,"SKILL.md"),l=await k.readFile(u,"utf-8").catch(()=>null);if(l===null)continue;let d=y(l),a=d.name||c;s.has(a)||s.set(a,{name:a,description:d.description??"",path:u,scope:p})}}let i=[...s.values()];try{m.run(t,"DELETE FROM skill_registry");for(let n of i)m.run(t,"INSERT OR REPLACE INTO skill_registry (name, description, path, scope, indexed_at) VALUES (?, ?, ?, ?, ?)",n.name,n.description,n.path,n.scope,Date.now())}catch{}return i}o(F,"refreshSkillIndex");function L(t){try{return m.query(t,"SELECT name, description, path, scope FROM skill_registry ORDER BY scope ASC, name ASC").map(r=>({...r,scope:r.scope}))}catch{return[]}}o(L,"getSkillIndex");function b(t){let r=L(t);if(r.length===0)return null;let s=["## Skill index \u2014 pass EXACT paths to subagents (they read the original SKILL.md; never summarize a skill for them)",""];for(let i of r)s.push(`- **${i.name}** (${i.scope}) \u2014 ${i.description||"no description"}
10
+ \`${i.path}\``);return s.join(`
11
+ `)}o(b,"renderSkillIndex");export{L as getSkillIndex,F as refreshSkillIndex,b as renderSkillIndex};
@@ -0,0 +1,27 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as O,b as P}from"./chunk-EFSPBB4S.mjs";import{a as b}from"./chunk-DEYAQEF5.mjs";import{a as R,b as j,c as f}from"./chunk-ZQHSJ6FF.mjs";import{c as y,d as v}from"./chunk-V7VA4EQX.mjs";import{a as S}from"./chunk-YJOC2JJK.mjs";import{a as _}from"./chunk-V5VCXMKO.mjs";import{d as a,e as p}from"./chunk-FOWTB762.mjs";import"./chunk-7CI4AMVO.mjs";import"./chunk-MXJKULJY.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import{a as C}from"./chunk-KUQLXY2P.mjs";import"./chunk-HCPQZRR3.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{h as u}from"./chunk-ID2C2S33.mjs";import{b as k}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import{e as m,g as U}from"./chunk-225DWS4D.mjs";import{a as I}from"./chunk-3TRXQAU4.mjs";import M from"node:fs/promises";import A from"node:path";U();var x=class extends _{static{I(this,"SpecCommands")}async draft(s=null,o=process.cwd(),c={}){try{if(!s||!s.trim())return u.info('Usage: prjct spec "<title>" [--goal "..."] [--tags k:v,...]'),{success:!1,error:"Title required"};let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=c.goal?.trim()||s.trim(),r=b(c.tags),n=await f.create(o,{title:s.trim(),content:{goal:e},tags:r,autoContext:!c.skipContext});return c.md?console.log(`\u2713 spec drafted: ${n.title}
8
+
9
+ spec_id: ${n.id}
10
+ status: ${n.status}
11
+ goal: ${n.content.goal}
12
+
13
+ Next: fill acceptance_criteria, scope, out_of_scope, risks, test_plan via \`prjct spec update ${n.id} --json '{...}'\` then run \`prjct spec audit ${n.id}\`.`):(u.done(`spec drafted: ${n.title}`),u.info(` id: ${n.id}`),u.info(` goal: ${n.content.goal}`),u.info(` next: prjct spec audit ${n.id}`)),{success:!0,specId:n.id,title:n.title,status:n.status}}catch(t){return p(m(t))}}async list(s=null,o=process.cwd(),c={}){try{let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=c.status;if(e&&!S.includes(e))return a(`unknown status: ${e} (valid: ${S.join(", ")})`);let r=await f.list(o,{status:e});if(c.md)if(r.length===0)console.log('# Specs\n\n_No specs yet. Start one with `prjct spec "<title>"`._');else{console.log("# Specs");for(let n of r){let i=n.content.acceptance_criteria.length,l=n.content.linked_tasks.length;console.log(`
14
+ ## ${n.title}
15
+ - id: \`${n.id}\`
16
+ - status: ${n.status}
17
+ - acceptance criteria: ${i}
18
+ - linked tasks: ${l}
19
+ - created: ${n.createdAt}`)}}else if(r.length===0)u.info('no specs yet \u2014 `prjct spec "<title>"` to start one');else for(let n of r){let i=n.content.acceptance_criteria.length;console.log(` ${n.status.padEnd(12)} ${n.id.slice(0,8)} ${n.title} (${i} AC)`)}return{success:!0,count:r.length}}catch(t){return p(m(t))}}async show(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec show <id>");let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=await f.get(o,s);if(!e)return a(`spec not found: ${s}`);if(c.md){let r=await k.getProjectId(o).catch(()=>null),n=new Map;if(r)for(let i of await C.getTasks(r))i.featureId===e.id&&i.body!=null&&n.set(i.body,{id:i.id,completed:i.completed});console.log(O(e,n))}else{if(console.log(`# ${e.title}`),console.log(`status: ${e.status}`),console.log(`goal: ${e.content.goal}`),e.content.eli10&&console.log(`eli10: ${e.content.eli10}`),e.content.acceptance_criteria.length>0){console.log(`
20
+ acceptance criteria:`);for(let r of e.content.acceptance_criteria)console.log(` - ${r}`)}if(e.content.scope.length>0){console.log(`
21
+ scope:`);for(let r of e.content.scope)console.log(` - ${r}`)}if(e.content.out_of_scope.length>0){console.log(`
22
+ out of scope:`);for(let r of e.content.out_of_scope)console.log(` - ${r}`)}if(e.content.risks.length>0){console.log(`
23
+ risks:`);for(let r of e.content.risks)console.log(` - ${r.risk} \u2192 ${r.mitigation}`)}if(e.content.test_plan.length>0){console.log(`
24
+ test plan:`);for(let r of e.content.test_plan)console.log(` - ${r}`)}}return{success:!0,spec:e}}catch(t){return p(m(t))}}async update(s=null,o=process.cwd(),c={}){try{if(!s)return a(`Usage: prjct spec update <id> --json '{"goal": "...", ...}'`);let t=typeof c.json=="string"?c.json:"";if(!t)return a("--json is required");let e=await this.ensureProjectInit(o);if(!e.success)return e;let r=(()=>{try{return JSON.parse(t)}catch{return}})();if(r===void 0)return a("--json is not valid JSON");if(r===null||typeof r!="object"||Array.isArray(r))return a("--json must decode to an object");if(!await f.get(o,s))return a(`spec not found: ${s}`);let i=await f.patch(o,s,r);return i?(c.md?console.log(`\u2713 spec updated: ${i.title}`):u.done(`spec updated: ${i.title}`),{success:!0,specId:i.id}):a(`spec not found: ${s}`)}catch(t){return p(m(t))}}async applyDelta(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec apply-delta <id> (--file <path> | --md '<delta markdown>')");let t=typeof c.md=="string"?c.md.trim():"",e=c.file?.trim()??"";if(!t&&!e)return a("provide --file <path> or --md '<delta markdown>'");if(t&&e)return a("pass either --file or --md, not both");let r=await this.ensureProjectInit(o);if(!r.success)return r;let n=e?await M.readFile(A.resolve(o,e),"utf8"):t,i=await f.applyDelta(o,s,n);if(!i)return a(`spec not found: ${s}`);let l=`\u2713 delta applied: ${i.title} (${i.content.delta_log.length} delta(s) logged)`;return c.md===!0?console.log(l):u.done(l),{success:!0,specId:i.id}}catch(t){return p(m(t))}}async validate(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec validate <id> [--strict]");let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=await f.get(o,s);if(!e)return a(`spec not found: ${s}`);let r=c.strict===!0,n=y(e,{projectPath:o}),i=n.errors.length>0||r&&n.warnings.length>0;if(c.md){if(console.log(`# spec validate \u2014 ${e.title}`),console.log(""),console.log(`spec id: \`${e.id}\` \xB7 mode: ${r?"strict":"advisory"}`),console.log(""),n.errors.length===0&&n.warnings.length===0)console.log("_No findings \u2014 structure OK._");else{console.log("## Findings");for(let l of v(n))console.log(l)}console.log(""),console.log(i?"**verdict: FAIL**":"**verdict: PASS**")}else{for(let l of n.errors)u.fail(l);for(let l of n.warnings)u.warn(l);n.errors.length===0&&n.warnings.length===0&&u.done("spec structure OK")}return i?{success:!1,error:`spec validation failed: ${n.errors.length} error(s), ${n.warnings.length} warning(s)${r?" (strict: warnings count as failures)":""}`,specId:s}:{success:!0,specId:s,errors:n.errors.length,warnings:n.warnings.length}}catch(t){return p(m(t))}}async setStatus(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec set-status <id> <status>");let t=c.status;if(!t||!S.includes(t))return a(`status must be one of: ${S.join(", ")}`);let e=await this.ensureProjectInit(o);return e.success?await f.setStatus(o,s,t)?(c.md?console.log(`\u2713 spec ${s} \u2192 ${t}`):u.done(`spec status: ${t}`),{success:!0,specId:s,status:t}):a(`spec not found: ${s}`):e}catch(t){return p(m(t))}}async recordReview(s=null,o=process.cwd(),c={}){try{if(!s)return a('Usage: prjct spec record-review <id> --reviewer <lens> --verdict <pass|fail> --notes "..."');let t=c.reviewer?.trim().toLowerCase(),e=c.verdict;if(!t)return a("--reviewer is required (the lens name, e.g. architecture, security)");if(e!=="pass"&&e!=="fail")return a("--verdict must be `pass` or `fail`");let r=await this.ensureProjectInit(o);if(!r.success)return r;let n=await f.recordReview(o,s,t,{verdict:e,notes:c.notes??""});if(!n)return a(`spec not found: ${s}`);let i=n.content.selected_reviewers;i.length>0&&!i.includes(t)&&u.warn(`lens "${t}" is not in this spec's selected set (${i.join(", ")})`);let l=`${t} \u2192 ${e}${n.status==="reviewed"?" (all selected lenses passed \u2192 status: reviewed)":""}`;return c.md?console.log(`\u2713 ${l}`):u.done(l),{success:!0,specId:s,status:n.status}}catch(t){return p(m(t))}}async linkTask(s=null,o=process.cwd(),c={}){try{if(!s||!c.taskId)return a("Usage: prjct spec link-task <spec-id> --task-id <id>");let t=await this.ensureProjectInit(o);return t.success?await f.linkTask(o,s,c.taskId)?(c.md?console.log(`\u2713 linked task ${c.taskId} to spec ${s}`):u.done("linked task \u2192 spec"),{success:!0,specId:s,taskId:c.taskId}):a(`spec not found: ${s}`):t}catch(t){return p(m(t))}}async ship(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec ship <id> [--pr <number>]");let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=c.pr!==void 0?Number(c.pr):void 0,r=await f.ship(o,s,e!==void 0&&Number.isFinite(e)?e:void 0);return r?(c.md?console.log(`\u2713 spec shipped: ${r.title}${e?` (PR #${e})`:""}`):u.done(`spec shipped${e?` (PR #${e})`:""}`),{success:!0,specId:s,status:"shipped"}):a(`spec not found: ${s}`)}catch(t){return p(m(t))}}async audit(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec audit <id> [--lenses a,b,c] [--strict]");let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=await f.get(o,s);if(!e)return a(`spec not found: ${s}`);let r=y(e,{projectPath:o});if(r.errors.length>0||r.warnings.length>0){let{effectiveSddMode:g}=await import("./sdd-HE7O6N5S.mjs"),w=await k.readConfig(o).catch(()=>null),h=(c.strict===!0||g(w)==="strict")&&r.errors.length>0;console.log(h?`## spec validation \u2014 dispatch BLOCKED (strict)
25
+ `:`## spec validation (advisory)
26
+ `);for(let T of v(r))console.log(T);if(console.log(""),h)return a(`spec validation: ${r.errors.length} error(s) block the audit dispatch in strict mode \u2014 fix the spec (see \`prjct spec validate ${s}\`) or drop strict gating`)}let n=await k.getProjectId(o).catch(()=>null),i=n?P.readDomainsSync(n)?.domains??[]:[],l=typeof c.lenses=="string"&&c.lenses.trim()!==""?c.lenses.split(",").map(g=>g.trim().toLowerCase()).filter(Boolean):R(e.content,i);await f.setSelectedReviewers(o,s,l);let d=await j(e.id,e.title,e.content,l,void 0,i);return console.log(d),{success:!0,specId:s,dispatch:"emitted"}}catch(t){return p(m(t))}}async breakdown(s=null,o=process.cwd(),c={}){try{if(!s)return a("Usage: prjct spec breakdown <id> [--force]");let t=await this.ensureProjectInit(o);if(!t.success)return t;let e=await f.get(o,s);if(!e)return a(`spec not found: ${s}`);let r=new Set(["reviewed","shipped","archived"]);if(!r.has(e.status)&&c.force!==!0)return process.stderr.write(`error: spec status is '${e.status}'; breakdown requires 'reviewed' or later. Re-run with --force if intentional.
27
+ `),process.exitCode=2,{success:!1,error:`spec status '${e.status}' is below the breakdown gate`};let n=c.force===!0&&!r.has(e.status),i=await k.getProjectId(o);if(!i)return p("No prjct project. Run `prjct init` first.");let{breakdownSpecToTasks:l}=await import("./spec-task-breakdown-HTG6ME6G.mjs"),d=await l(i,o,e),g=await(async()=>{if(!n)return null;let{projectMemory:$}=await import("./project-memory-GYLYIJQD.mjs"),h=await $.remember(o,{type:"spec",content:`prjct spec breakdown --force on '${e.title}' (status was '${e.status}')`,tags:{spec_id:e.id,event:"spec.breakdown.forced",from_status:e.status},source:e.id});return typeof h=="string"?h:null})(),w=[];if(g&&w.push(`forced-breakdown event=${g}`),d.skippedReason==="already_broken_down")w.push(`skipped: already_broken_down (spec ${s})`);else if(d.skippedReason==="no_acceptance_criteria")w.push(`skipped: no_acceptance_criteria (spec ${s})`);else{let $=d.recoveredFromPartial?" (recovered from partial)":"";w.push(`\u2713 breakdown: ${d.taskIds.length} task(s) linked${$}`)}for(let $ of w)console.log($);return{success:!0,specId:s,forced:n,forcedEventMemId:g,taskIds:d.taskIds,recoveredFromPartial:d.recoveredFromPartial===!0,skippedReason:d.skippedReason}}catch(t){return p(m(t))}}async inventory(s=null,o=process.cwd(),c={}){try{let t=await this.ensureProjectInit(o);if(!t.success)return t;let{default:e}=await import("./config-manager-QVFHXIKI.mjs"),n=(await e.readConfig(o))?.projectId;if(!n)return a("not a prjct project");let{buildInventory:i,renderInventoryMd:l}=await import("./spec-inventory-2TT7BTFZ.mjs"),d=await i(o,n);if(c.json)console.log(JSON.stringify(d,null,2));else if(c.md)console.log(l(d));else{u.info(`${d.totalSpecs} specs across ${d.modules.length} modules`);for(let g of d.modules){let w=g.coveredPct===null?"n/a":`${g.coveredPct}%`,$=g.drift===!0?" DRIFT":g.drift==="unknown"?" ?":"";console.log(` ${g.module.padEnd(20)} ${String(g.specCount).padStart(3)} specs \xB7 ${w.padStart(6)} covered${$}`)}d.uncoveredModules.length>0&&u.info(`${d.uncoveredModules.length} module(s) without specs`)}return{success:!0,totalSpecs:d.totalSpecs}}catch(t){return p(m(t))}}};export{x as SpecCommands,j as renderAuditDispatch};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as u}from"./chunk-ZBBNCCGV.mjs";import{b as l}from"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";var m=5,g=8,f=.15;async function $(n,o,s){let[t,e]=await Promise.all([u(n,s,{maxFiles:m*4,minScore:f}).catch(()=>({files:[]})),Promise.resolve(l.recall(o,{topic:n,limit:g})).catch(()=>[])]),r=h(t.files.map(a=>a.path),m);return r.length===0&&e.length===0?{notesBlock:"",paths:[],memoryHits:0,empty:!0}:{notesBlock:y(n,r,e),paths:r,memoryHits:e.length,empty:!1}}i($,"inferSpecContext");function h(n,o){let s=new Set,t=[];for(let e of n){let r=e.split("/").slice(0,2).join("/");if(!s.has(r)&&(s.add(r),t.push(e),t.length>=o))break}return t}i(h,"dedupeTopDirs");function y(n,o,s){let t=[];if(t.push("<!-- auto-context:tentative -->"),t.push("## Existing context (auto-inferred)"),t.push(""),t.push(`_Inferred from title "${n}". Validate before audit \u2014 entries tagged tentative._`),t.push(""),o.length>0){t.push("### Likely paths");for(let e of o)t.push(`- \`${e}\``);t.push("")}if(s.length>0){t.push("### Relevant prior memory");for(let e of s){let r=e.content.length>140?`${e.content.slice(0,137)}\u2026`:e.content,c=Object.entries(e.tags).map(([p,a])=>`${p}:${a}`).join(" ");t.push(`- **${e.type}**${c?` _(${c})_`:""} \u2014 ${r}`)}t.push("")}return t.push("<!-- /auto-context -->"),t.join(`
8
+ `)}i(y,"buildNotesBlock");function b(n,o){let s={level:"warn",code:"no_context_match",message:`No codebase or memory context matched "${n}"`,suggestion:o??"Fill spec.notes manually or run with `--skip-context` next time."};process.stderr.write(`${JSON.stringify(s)}
9
+ `)}i(b,"warnNoContextMatch");export{$ as inferSpecContext,b as warnNoContextMatch};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as b}from"./chunk-V7VA4EQX.mjs";import{g as v}from"./chunk-YJOC2JJK.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import{b as y,p as O}from"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as u}from"./chunk-3TRXQAU4.mjs";import $ from"node:fs/promises";import h from"node:path";O();var A=5,I=/^(chore|style|format|fmt|docs|typo)(\(|:|!)/i,k=[/(^|\/)types\.ts$/,/(^|\/)types\//,/\/__tests__\//,/\.d\.ts$/,/(^|\/)index\.ts$/,/\.test\.ts$/,/\.spec\.ts$/];async function W(e,t){let n=v.list(t,{includeArchived:!0}),s={};for(let i of n)s[i.status]=(s[i.status]??0)+1;let r=new Map,o=new Set;for(let i of n){let d=R(i);if(!d)continue;o.add(d);let m=r.get(d)??[];m.push(i),r.set(d,m)}let a=await x(e);for(let i of a)o.add(i);let c=[],l=[];for(let i of[...o].sort()){let d=r.get(i)??[],m=await E(e,i),w=await P(e,i,d),_=d.length>0?d.reduce((p,f)=>f.updatedAt>p?f.updatedAt:p,""):null,g=[];for(let p of d.filter(f=>f.status==="shipped")){let f=await T(e,p);g.push(f.drift),l.push({specId:p.id,title:p.title,status:p.status,drift:f.drift,locChanged:f.locChanged,cosmeticOnly:f.cosmeticOnly})}let F=g.includes(!0)?!0:g.includes("unknown")?"unknown":!1;c.push({module:i,specCount:d.length,coveredFiles:w,totalFiles:m,coveredPct:m===0?null:Math.round(w/m*1e4)/100,lastUpdated:_||null,drift:F})}let C=c.filter(i=>i.specCount===0).map(i=>i.module);return{generatedAt:new Date().toISOString(),projectPath:e,totalSpecs:n.length,byStatus:s,modules:c,driftDetail:l,uncoveredModules:C}}u(W,"buildInventory");function R(e){let t=e.content.scope[0];if(!t)return null;let n=b(t);if(!n)return null;let s=n.split("/").filter(Boolean).slice(0,2);return s.length===2?s.join("/"):null}u(R,"inferModule");async function x(e){let t=h.join(e,"core");try{return(await $.readdir(t,{withFileTypes:!0})).filter(s=>s.isDirectory()&&!s.name.startsWith(".")&&!s.name.startsWith("__")).map(s=>`core/${s.name}`)}catch{return[]}}u(x,"listTopLevelModules");async function E(e,t){let n=h.join(e,t),s=[];try{await S(n,async r=>{let o=h.relative(e,r);D(o)||M(o)&&s.push(o)})}catch{}return s.length}u(E,"countModuleFiles");async function P(e,t,n){let s=h.join(e,t),r=new Set;for(let a of n)for(let c of a.content.scope){let l=c.match(/[a-zA-Z0-9_./-]+\.[a-z]+/);l&&r.add(l[0])}let o=new Set;try{await S(s,async a=>{let c=h.relative(e,a);if(!D(c)&&M(c)){for(let l of r)if(c===l||c.startsWith(l.endsWith("/")?l:`${l}/`)){o.add(c);break}}})}catch{}return o.size}u(P,"countCoveredFiles");async function S(e,t){let n=await $.readdir(e,{withFileTypes:!0}).catch(()=>[]);for(let s of n){if(s.name.startsWith(".")||s.name==="node_modules"||s.name==="dist")continue;let r=h.join(e,s.name);s.isDirectory()?await S(r,t):s.isFile()&&await t(r)}}u(S,"walk");function D(e){return k.some(t=>t.test(e))}u(D,"excluded");function M(e){return/\.(ts|tsx|js|jsx|mjs|cjs)$/.test(e)}u(M,"isCodeFile");async function T(e,t){if(!t.shippedSha)return{drift:"unknown"};let n=t.content.scope.map(o=>o.match(/[a-zA-Z0-9_./-]+\.[a-z]+/)?.[0]??o.match(/[a-zA-Z0-9_./-]+\//)?.[0]).filter(o=>!!o);if(n.length===0)return{drift:"unknown"};let s=await y("git",["diff","--shortstat",`${t.shippedSha}..HEAD`,"--",...n],{cwd:e}).then(({stdout:o})=>{let a=o.match(/(\d+) insertions?/),c=o.match(/(\d+) deletions?/);return(a?Number.parseInt(a[1],10):0)+(c?Number.parseInt(c[1],10):0)}).catch(()=>null);if(s===null)return{drift:"unknown"};if(s<=A)return{drift:!1,locChanged:s,cosmeticOnly:!1};let r=await y("git",["log","--format=%s",`${t.shippedSha}..HEAD`,"--",...n],{cwd:e}).then(({stdout:o})=>o.split(`
8
+ `).filter(Boolean).every(a=>I.test(a))).catch(()=>!1);return{drift:!r,locChanged:s,cosmeticOnly:r}}u(T,"driftForSpec");function H(e){let t=[];if(t.push("# Spec inventory"),t.push(""),t.push(`_${e.totalSpecs} specs across ${e.modules.length} modules \xB7 generated ${e.generatedAt}_`),t.push(""),Object.keys(e.byStatus).length>0){t.push("## By status");for(let[n,s]of Object.entries(e.byStatus))t.push(`- ${n}: ${s}`);t.push("")}t.push("## Coverage by module"),t.push(""),t.push("| Module | Specs | Files | Covered | % | Drift | Last updated |"),t.push("|---|---|---|---|---|---|---|");for(let n of e.modules){let s=n.coveredPct===null?"n/a":`${n.coveredPct}%`,r=n.drift===!0?"\u26A0\uFE0F yes":n.drift==="unknown"?"\u2754":"\u2713",o=n.lastUpdated?n.lastUpdated.slice(0,10):"\u2014";t.push(`| \`${n.module}\` | ${n.specCount} | ${n.totalFiles} | ${n.coveredFiles} | ${s} | ${r} | ${o} |`)}if(e.uncoveredModules.length>0){t.push(""),t.push("## Modules with NO specs");for(let n of e.uncoveredModules)t.push(`- \`${n}\``)}return t.join(`
9
+ `)}u(H,"renderInventoryMd");export{W as buildInventory,H as renderInventoryMd};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as a}from"./chunk-ZQHSJ6FF.mjs";import"./chunk-V7VA4EQX.mjs";import"./chunk-YJOC2JJK.mjs";import"./chunk-MXJKULJY.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as specService};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as s}from"./chunk-YJOC2JJK.mjs";import{b as w}from"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import{a as m}from"./chunk-KUQLXY2P.mjs";import"./chunk-HCPQZRR3.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-INJ5WT2D.mjs";import{e as h,l as S}from"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as p}from"./chunk-3TRXQAU4.mjs";S();async function x(r,a,e){let o=e.content.acceptance_criteria;if(o.length===0)return{taskIds:[],skippedReason:"no_acceptance_criteria"};if(e.content.tasks_created_at!==null)return{taskIds:[],skippedReason:"already_broken_down"};let d=e.content.linked_tasks.length>0,y=(await m.getTasks(r)).filter(t=>t.featureId===e.id),g=new Set,u=o.map(t=>{let n=y.find(_=>_.body===t&&!g.has(_.id));return n&&g.add(n.id),n??null}),c=o.map((t,n)=>({ac:t,i:n})).filter(({i:t})=>u[t]===null),l=c.length>0?await m.addTasks(r,c.map(({ac:t})=>({description:I(t),body:t,priority:"medium",type:"feature",section:"backlog",featureId:e.id,groupId:e.id,groupName:e.title}))):[],b=new Map(c.map(({i:t},n)=>[t,l[n].id])),i=o.map((t,n)=>u[n]?.id??b.get(n));for(let t of i)s.linkTask(r,e.id,t);let k=s.get(r,e.id);if(k){let t={...k.content,tasks_created_at:h()};s.updateContent(r,e.id,t)}let f=i.length-l.length;return await w.remember(a,{type:"spec",content:`Auto-breakdown: ${l.length} tasks created${f>0?`, ${f} adopted`:""} from ${e.title}${d?" (recovered from partial)":""}`,tags:{spec_id:e.id,event:"auto_breakdown",task_count:String(i.length),...d?{recovered:"partial"}:{}},source:e.id}),{taskIds:i,...d?{recoveredFromPartial:!0}:{}}}p(x,"breakdownSpecToTasks");function I(r){let a=r.replace(/\s+/g," ").trim();return a.length<=140?a:`${a.slice(0,137)}\u2026`}p(I,"truncateForDescription");export{x as breakdownSpecToTasks};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as a}from"./chunk-EHVU2SMR.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as stateStorage};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as s}from"./chunk-WTDUJB4I.mjs";import"./chunk-U24YKPYX.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";import e from"node:fs";import u from"node:path";var a=3e4;function f(n){return Buffer.from(n,"utf-8").reduce((t,r)=>Math.imul(t^r,16777619)>>>0,2166136261).toString(16).padStart(8,"0")}o(f,"fnv1a32hex");function S(n){return n.toLowerCase().replace(/[^a-z0-9-]/g,"")}o(S,"sanitizeSubcommand");function l(n,i){let t=S(i);return t?u.join(s(),`hook-stdin-${f(n)}-${t}.json`):null}o(l,"hookStdinSpillPath");function h(n,i){let t=l(n,i);if(!t)return null;try{let r=e.statSync(t);if(Date.now()-r.mtimeMs>a)return e.unlinkSync(t),null;let c=e.readFileSync(t,"utf-8");return e.unlinkSync(t),c}catch{return null}}o(h,"consumeHookStdinSpill");function d(n,i,t){let r=l(n,i);if(r)try{e.mkdirSync(u.dirname(r),{recursive:!0}),e.writeFileSync(r,t,"utf-8")}catch{}}o(d,"writeHookStdinSpill");export{a as HOOK_STDIN_SPILL_MAX_AGE_MS,h as consumeHookStdinSpill,l as hookStdinSpillPath,d as writeHookStdinSpill};
@@ -0,0 +1,15 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as se}from"./chunk-4PRD4EU2.mjs";import{a as re}from"./chunk-CXNVDJNN.mjs";import{a as ne,b as S,d as G}from"./chunk-ROOCBUKH.mjs";import{b as L}from"./chunk-2JJM3YMW.mjs";import{b as ee}from"./chunk-BSR3XUBD.mjs";import{a as te}from"./chunk-MCY7OXED.mjs";import"./chunk-YQ6HM3YO.mjs";import{c as B}from"./chunk-CFD6CW7T.mjs";import"./chunk-ESB4ALH2.mjs";import{b as Q}from"./chunk-O5N6XYPU.mjs";import"./chunk-SO3ZPNWT.mjs";import{c as P}from"./chunk-F2FKQUYE.mjs";import{m as Z}from"./chunk-WSVMQYYU.mjs";import{b as h}from"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import{g as qe,h as Ve}from"./chunk-EZRNQXCC.mjs";import{b as U}from"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{b as v}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import{d as M}from"./chunk-WTDUJB4I.mjs";import{a as q,b as Ke,g as C,h as Ye,i as V}from"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import{F as Y,G as ze}from"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-TIBYHZFA.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import{e as A,g as x,l as _,p as z}from"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import{b as j,c as We}from"./chunk-DOJPSIMG.mjs";import{l as K,p as Xe}from"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a,b as W,e as X}from"./chunk-3TRXQAU4.mjs";import b from"node:fs/promises";import Be from"node:path";import Ze from"node:crypto";import Qe from"node:fs/promises";function D(n){return typeof n=="string"?n:Array.isArray(n)?n.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return typeof t=="string"?t:""}return""}).join(`
8
+ `).trim():""}a(D,"textOf");function I(n){try{let e=W("node:fs"),s=W("node:path").join(n,".prjct","prjct.config.json"),r=e.readFileSync(s,"utf-8");return JSON.parse(r).projectId??null}catch{return null}}a(I,"projectIdFromPath");var ce="friction-detector",ie="friction-promote",oe=5,ae=400,ue=160,et=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],tt=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],nt=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function le(n,e,t,s={}){let r=s.preloadedLines?s.preloadedLines:await Qe.readFile(e,"utf-8").then(rt).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=st(r);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,oe).map(f=>({category:f.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${f.category}.`,relatedRuleId:null})),c=ut(n),l=I(n)??void 0;return{...await i.slice(0,oe).reduce(async(f,d)=>{let p=await f,y=de(d.excerpt).slice(0,12);if(c.has(y))return await at(n,l,d).catch(()=>{}),{...p,signalsSkipped:p.signalsSkipped+1};try{return await h.remember(n,{type:"improvement-signal",content:ot(d),tags:{source:ce,category:d.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...t?{session:t}:{},key:y},provenance:"extracted",projectId:l}),c.add(y),{...p,signalsRecorded:p.signalsRecorded+1}}catch{return{...p,signalsSkipped:p.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}a(le,"detectFriction");function rt(n){return S(n)}a(rt,"parseJsonl");function st(n){let e={signals:[],lastAssistantText:""};for(let t of n){let s=t.role??t.message?.role,r=D(t.content??t.message?.content);if(!r)continue;if(s==="assistant"){e.lastAssistantText=r;continue}if(s!=="user")continue;let i=it(r.slice(0,300));i&&e.signals.push({excerpt:r.slice(0,ae).trim(),category:i,precedingAssistantPreview:e.lastAssistantText.slice(0,ae).trim()})}return e.signals}a(st,"extractSignals");function it(n){return nt.some(e=>e.test(n))?"complaint":et.some(e=>e.test(n))?"negation":tt.some(e=>e.test(n))?"correction":null}a(it,"classify");function ot(n){let e=ct(n.category),t=pe(n.excerpt),s=t?`Obey developer constraint: ${t}`:e.lesson,r=t?`Always: ${t}`:e.nextAction;return[`[${n.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${e.why}`,`Pattern: ${e.pattern}`,`Anti-pattern: ${e.antiPattern}`,`Next action: ${r}`].join(`
9
+ `)}a(ot,"formatSignal");function pe(n){let e=n.replace(/\s+/g," ").trim();if(!e)return null;let t=e.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=t.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return T(`Prefer ${s[1]}`);let r=t.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(r?.[1]&&r[2])return T(`Prefer ${r[1].trim()} rather than ${r[2].trim()}`);let i=t.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let u=i[2]?` instead of ${i[2].trim()}`:" instead";return T(`Use ${i[1].trim()}${u}`)}let o=t.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return T(`Avoid ${o[1].trim()}`);let c=t.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(c?.[1])return T(`Never ${c[1].trim()}`);let l=t.match(/\balways\s+(.+?)$/i);if(l?.[1])return T(`Always ${l[1].trim()}`);if(t.length>=12&&t.length<=ue&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(t)){let u=t.charAt(0).toUpperCase()+t.slice(1);return T(u.replace(/[.!?]+$/,""))}return null}a(pe,"extractSpecificConstraint");function T(n){let e=n.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,ue);return e.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(e)?null:e}a(T,"cleanConstraint");async function at(n,e,t){if(!e)return;let s=pe(t.excerpt);if(!s)return;let r=`Always: ${s}`,i=`fp:${de(s).slice(0,12)}`;try{if(h.recall(e,{types:["feedback"],tags:{source:ie,key:i},limit:1,dedupeByKey:!1}).length>0)return;await h.remember(n,{type:"feedback",content:r,tags:{source:ie,key:i,category:t.category,from:"recurring-friction"},provenance:"extracted",projectId:e})}catch{}}a(at,"maybePromoteStandingPreference");function ct(n){return n==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:n==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}a(ct,"lessonTemplate");function de(n){let e=n.toLowerCase().replace(/\s+/g," ").trim();return Ze.createHash("sha256").update(e).digest("hex")}a(de,"hashSignal");function ut(n){try{let e=I(n);if(!e)return new Set;let t=h.recall(e,{types:["improvement-signal"],tags:{source:ce},limit:100,dedupeByKey:!1}),s=new Set;for(let r of t){let i=r.tags.key;i&&s.add(i)}return s}catch{return new Set}}a(ut,"projectMemoryHashes");z();function fe(n){try{return JSON.parse(n)}catch{return null}}a(fe,"safeJsonParse");function w(n,e,t,s){let r=[];try{let{prjctDb:i}=(V(),X(Ye)),o=i.query(n,e,...t);for(let c of o){let l=fe(c.data);if(!l||typeof l!="object")continue;let u=l.tags;if(!u)continue;let f=s(u,l);f!==void 0&&r.push(f)}}catch{}return r}a(w,"collectFromPersistedEvents");var ge="lean-detector",lt="lean-debt-growth",pt=3,me=["off","lite","full","ultra"];function dt(n){let e=n?.lean?.mode;if(e&&me.includes(e))return e;let t=process.env.PRJCT_LEAN_MODE?.toLowerCase();return t&&me.includes(t)?t:"off"}a(dt,"effectiveMode");async function he(n,e){let t={active:!1,total:0,previous:0,persisted:!1},s=e!==void 0?e:await v.readConfig(n).catch(()=>null);if(!s?.projectId||dt(s)==="off")return t;t.active=!0;try{let r=await ft(n);if(t.total=r,r===0)return t;let i=mt(s.projectId);t.previous=i;let o=r-i;i>0&&o>=pt&&(await h.remember(n,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${r}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:ge,pattern:lt,total:String(r),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),t.persisted=!0)}catch{}return t}a(he,"detectAndPersistLeanDebt");async function ft(n){let e=await A(["grep","-cI","-e","lean:"],{cwd:n,maxBuffer:16777216});if(!e.ok){if(x(e,1))return 0;_(e)}return e.stdout.split(`
10
+ `).reduce((t,s)=>{let r=s.lastIndexOf(":");if(r<=0)return t;let i=Number.parseInt(s.slice(r+1),10);return Number.isFinite(i)?t+i:t},0)}a(ft,"measureLeanMarkers");function mt(n){return w(n,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50",[],t=>{if(t.source!==ge)return;let s=typeof t.total=="string"?Number.parseInt(t.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(mt,"collectPreviousSnapshot");import gt from"node:path";z();var ht="hot-file",ye="pattern-detector-auto",yt="recurring-bug",we="pattern-detector-recurring",wt="tech-debt-growth",be="pattern-detector-debt",O=7,bt=3,$=30,vt=2,St=5,kt=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function ve(n,e){let t={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=e!==void 0?e:await v.readConfig(n).catch(()=>null);if(!s?.projectId)return t.errors.push("no project config"),t;try{let r=await Tt(n);if(t.scanned+=r.length,t.hotFiles=r,r.length>0){let i=It(s.projectId);for(let o of r){if(i.has(o.path)){t.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await h.remember(n,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${O} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:ye,pattern:ht,file:o.path,touches:String(o.touches),window_days:String(O)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for ${o.path}: ${c.message}`)}}}}catch(r){t.errors.push(`hot-file detection failed: ${r.message}`)}try{let r=Et(s.projectId);if(r.length>0){let i=xt(s.projectId);for(let o of r){if(i.has(o.topic)){t.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await h.remember(n,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${$} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:we,pattern:yt,topic:o.topic,occurrences:String(o.occurrences),window_days:String($)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for recurring ${o.topic}: ${c.message}`)}}}}catch(r){t.errors.push(`recurring-bug detection failed: ${r.message}`)}try{let r=await At(n);if(r.totalCount>0){let i=_t(s.projectId),o=r.totalCount-i;if(i>0&&o>=St)try{await h.remember(n,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${r.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:be,pattern:wt,total:String(r.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for tech-debt: ${c.message}`)}}}catch(r){t.errors.push(`tech-debt detection failed: ${r.message}`)}return t}a(ve,"detectAndPersistPatterns");async function Tt(n){let e=await A(["log",`--since=${O}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:n,maxBuffer:16777216,timeoutMs:15e3});if(!e.ok){if(e.kind==="exit")return[];_(e)}let t=new Map;for(let r of e.stdout.split("\0")){let i=r.trim();i&&(Rt(i)||t.set(i,(t.get(i)??0)+1))}let s=[];for(let[r,i]of t)i<bt||s.push({path:r,touches:i});return s.sort((r,i)=>i.touches-r.touches),s}a(Tt,"detectHotFiles");function Rt(n){let e=gt.basename(n);for(let t of kt)if(t.test(n)||t.test(e))return!0;return!1}a(Rt,"isIgnored");function Et(n){let e=new Date(Date.now()-$*24*60*60*1e3).toISOString(),t=w(n,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",[e],i=>{if(i.source==="transcript-auto")return;let o=typeof i.topic=="string"?i.topic:void 0,c=typeof i.area=="string"?i.area:void 0;return(o??c)||void 0}),s=new Map;for(let i of t)s.set(i,(s.get(i)??0)+1);let r=[];for(let[i,o]of s)o<vt||r.push({topic:i,occurrences:o});return r.sort((i,o)=>o.occurrences-i.occurrences),r}a(Et,"detectRecurringBugs");async function At(n){let e=await A(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:n,maxBuffer:16777216});if(!e.ok){if(x(e,1))return{totalCount:0};_(e)}return{totalCount:e.stdout.split(`
11
+ `).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}a(At,"measureTechDebt");function _t(n){return w(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],t=>{if(t.source!==be)return;let s=typeof t.total=="string"?Number.parseInt(t.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(_t,"collectPreviousDebtSnapshot");function It(n){let e=Date.now()-O*24*60*60*1e3,t=w(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==ye)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(It,"collectAlreadyMarkedHotFiles");function xt(n){let e=Date.now()-$*24*60*60*1e3,t=w(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==we)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(xt,"collectAlreadyMarkedRecurringBugs");import k from"node:fs/promises";import J from"node:path";ze();Ke();V();var Ct={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Mt(n=process.env){let e=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Ct[e==="conservative"||e==="standard"||e==="aggressive"?e:"standard"]}a(Mt,"resolveProfile");async function Pt(n,e){let t=Date.now()-e*24*60*60*1e3,r=h.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<t);if(r.length===0)return 0;let i=[];for(let o of r)try{U.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${e}d)`});let c=o.id.startsWith("mem_")?o.id.slice(4):null;c&&C.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(c)),C.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}a(Pt,"archiveAgedInbox");async function Lt(n,e){if(e===null)return 0;let t=J.join(Y.getGlobalProjectPath(n),"checkpoints"),s=await k.readdir(t).catch(()=>null);if(!s)return 0;let r=Date.now()-e*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let c=J.join(t,o);try{(await k.stat(c)).mtimeMs<r&&(await k.unlink(c),i.push(c))}catch{}}return i.length}a(Lt,"pruneOldCheckpoints");async function Dt(){let{getVerifyCachePath:n}=await import("./context7-service-AZWDYK5Z.mjs"),e=n();try{let t=await k.stat(e);if((Date.now()-t.mtimeMs)/(1440*60*1e3)>7)return await k.unlink(e),!0}catch{}return!1}a(Dt,"rotateContext7Cache");var Ot=1440*60*1e3,$t=["prompt-state-","prompt-git-","prompt-afteremit-","stop-heavy-","kimi-session-"];async function Nt(){let n=M.runDir(),e=await k.readdir(n).catch(()=>null);if(!e)return 0;let t=Date.now()-Ot,s=[];for(let r of e){if(!$t.some(o=>r.startsWith(o)))continue;let i=J.join(n,r);try{(await k.stat(i)).mtimeMs<t&&(await k.unlink(i),s.push(i))}catch{}}return s.length}a(Nt,"sweepRunDirStamps");async function Se(n){let e=Mt(),t={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1,stampsRemoved:0};try{t.inboxArchived=await Pt(n,e.inboxDays)}catch{}try{t.archivesPruned=U.pruneOldArchives(n,e.archivesDays)}catch{}try{t.checkpointsRemoved=await Lt(n,e.checkpointsDays)}catch{}try{t.context7CacheRotated=await Dt()}catch{}try{t.stampsRemoved=await Nt()}catch{}return t}a(Se,"runSessionCleanup");async function ke(n,e){if(e.inboxArchived+e.archivesPruned+e.checkpointsRemoved+e.stampsRemoved+(e.context7CacheRotated?1:0)===0)return;let r=`Session cleanup: ${[e.inboxArchived>0?`${e.inboxArchived} inbox archived`:null,e.archivesPruned>0?`${e.archivesPruned} archives pruned`:null,e.checkpointsRemoved>0?`${e.checkpointsRemoved} checkpoints removed`:null,e.stampsRemoved>0?`${e.stampsRemoved} stale hook stamps removed`:null,e.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;C.appendEvent(n,"memory.remember.system-event",{content:r,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:q(r),project_id:n})}a(ke,"recordCleanupReport");import Ft from"node:crypto";import Ht from"node:fs/promises";var Ae="skill-miss-detector",Te=3,jt=280,Ut=["decision","gotcha","anti-pattern"],Bt=5400*1e3,Gt=360*60*1e3,Jt=2,_e=5,Wt=8,Ie=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function xe(n,e,t,s={}){let r=s.preloadedLines?s.preloadedLines:await Ht.readFile(e,"utf-8").then(zt).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=I(n);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=Kt(r);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let c=(()=>{try{return Zt(i,t)}catch{return null}})();if(!c)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(c.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let l=await Q(n).catch(()=>[]),u=(()=>{try{let m=Date.now()-Gt;return new Set(se.list(i).filter(g=>Date.parse(g.ended_at)>m).flatMap(g=>g.files_touched))}catch{return new Set}})(),f=Xt(o,l,c,u);if(f.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let d=Qt(i),p=[];for(let m of f.slice(0,Te)){let g=Vt(m.memId,m.excerpt).slice(0,12);if(d.has(g)){p.push("skipped");continue}try{await h.remember(n,{type:"improvement-signal",content:qt(m),tags:{source:Ae,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:m.memId,file:m.evidenceFile,key:g,...t?{session:t}:{}},provenance:"extracted",projectId:i}),P.penalizeSkillMiss(i,m.memId),p.push("recorded")}catch{p.push("skipped")}}let y=p.filter(m=>m==="recorded").length,E=p.filter(m=>m==="skipped").length;return{signalsRecorded:y,signalsSkipped:E,failures:f.slice(0,Te).map(m=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${m.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:m.memId}))}}a(xe,"detectSkillMisses");function Xt(n,e,t,s=new Set){let r=Re(n);if(r.size===0)return[];let i=e.filter(l=>!s.has(l)),o=N(i),c=[];for(let l of t){let u=Re(`${l.content} ${l.fileTag}`);if(u.size===0)continue;let f=l.fileTag!==""&&i.some(g=>Ee(g,l.fileTag))||[...o].some(g=>u.has(g)),d=Yt(u),p=[...u].filter(g=>!d.has(g)&&r.has(g)).length;if(!(f||p>=Jt)||[...d].some(g=>r.has(g)))continue;let m=l.fileTag!==""&&i.some(g=>Ee(g,l.fileTag))?l.fileTag:i.find(g=>[...N([g])].some(Je=>u.has(Je)))??"";c.push({miss:{memId:l.id,memType:l.type,excerpt:l.content.replace(/\s+/g," ").trim().slice(0,jt),evidenceFile:m,reason:f?"path-overlap-unused":"topic-overlap-unused"},rank:f?2:1,overlap:p})}return c.sort((l,u)=>u.rank-l.rank||u.overlap-l.overlap),c.map(l=>l.miss)}a(Xt,"analyze");function zt(n){return S(n)}a(zt,"parseJsonl");function Kt(n){let e=[];for(let t of n){let s=t.role??t.message?.role;if(s!=="user"&&s!=="assistant")continue;let r=D(t.content??t.message?.content);r&&e.push(r)}return e.join(`
12
+ `).toLowerCase()}a(Kt,"transcriptTextOf");function Re(n){let e=new Set;for(let t of n.toLowerCase().split(/[^a-z0-9]+/))t.length<_e||Ie.has(t)||e.add(t);return e}a(Re,"tokenize");function Yt(n){let e=[...n].filter(s=>s.length>=Wt);if(e.length>0)return new Set(e);let t=[...n].sort((s,r)=>r.length-s.length||s.localeCompare(r))[0]??"";return t?new Set([t]):new Set}a(Yt,"signatureOf");function N(n){let e=new Set;for(let t of n)for(let s of t.split("/")){let r=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();r.length>=_e&&!Ie.has(r)&&e.add(r)}return e}a(N,"fileStems");function Ee(n,e){let t=N([n]);for(let s of N([e]))if(t.has(s))return!0;return!1}a(Ee,"sharesStem");function qt(n){let e=n.evidenceFile!==""?`touched \`${n.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${n.memType}, ${n.memId}): "${n.excerpt}"`,`This session ${e} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${n.memId}`].join(`
13
+ `)}a(qt,"formatSkillMiss");function Vt(n,e){let t=`${n}::${e.toLowerCase().replace(/\s+/g," ").trim()}`;return Ft.createHash("sha256").update(t).digest("hex")}a(Vt,"hashKey");function Zt(n,e){let t=h.recall(n,{types:[...Ut],limit:120}),s=Date.now()-Bt,r=[];for(let i of t)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||e&&i.tags.session===e||r.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return r}a(Zt,"recallCandidates");function Qt(n){try{let e=h.recall(n,{types:["improvement-signal"],tags:{source:Ae},limit:100,dedupeByKey:!1}),t=new Set;for(let s of e)s.tags.key&&t.add(s.tags.key);return t}catch{return new Set}}a(Qt,"existingSkillMissKeys");import en from"node:crypto";import tn from"node:fs/promises";var Pe="transcript-auto",nn="v2",Le=80,De=20,F=1500,rn=12,Ce=4,sn=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],Oe=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function $e(n,e,t,s={}){let r={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await v.readConfig(n).catch(()=>null);if(!i?.projectId)return r.errors.push("no project config"),r;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return S(await tn.readFile(e,"utf-8"))}catch(p){return r.errors.push(`transcript read failed: ${p.message}`),null}})();if(o===null)return r;let c=on(o),l=an(o);if(r.scanned=c.length+l.length,c.length===0&&l.length===0)return r;let u=[...pn(c),...un(l)];if(u.length===0)return r;let f=fn(i.projectId),d=t?t.slice(0,12):"unknown";for(let p of u){if(f.has(p.hash)){r.skipped.push({reason:"duplicate",phrase:p.matchedPhrase});continue}try{await h.remember(n,{type:p.type,content:p.content,tags:{source:Pe,capture:nn,session:d,hash:p.hash,phrase:p.matchedPhrase},provenance:"inferred",projectId:i.projectId}),r.ingested+=1}catch(y){r.errors.push(`remember failed: ${y.message}`)}}return r}a($e,"ingestTranscript");function on(n){let e=[];for(let t of n){let s=Ne(t);if(s!=="assistant")continue;let r=Fe(t);!r||r.length<Le||e.push({role:s,text:r})}return e}a(on,"projectMessages");function an(n){let e=[];for(let t of n){let s=Ne(t);if(s!=="user")continue;let r=Fe(t);!r||r.length<De||e.push({role:s,text:r})}return e}a(an,"projectUserMessages");var cn=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function un(n){let e=[],t=new Set;for(let s of n){if(e.length>=Ce)break;let r=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=De),i=r.length>0?r:[s.text.trim()];for(let o of i){if(e.length>=Ce)break;let c=cn.find(f=>f.re.test(o));if(!c)continue;let l=o.length>F?`${o.slice(0,F)}\u2026`:o,u=He(l);t.has(u)||(t.add(u),e.push({type:"feedback",content:l,hash:u,matchedPhrase:c.phrase}))}}return e}a(un,"extractUserPreferenceCandidates");function Ne(n){let e=n.role;if(typeof e=="string")return Me(e);let t=n.message;if(t&&typeof t=="object"&&"role"in t){let r=t.role;if(typeof r=="string")return Me(r)}let s=n.type;return s==="assistant"||s==="user"||s==="system"?s:null}a(Ne,"inferRole");function Me(n){let e=n.toLowerCase();return e==="assistant"||e==="user"||e==="system"?e:null}a(Me,"normalizeRole");function Fe(n){let e=n.content===void 0&&n.message&&typeof n.message=="object"?n.message.content:n.content;if(typeof e=="string")return e.trim();if(Array.isArray(e)){let t=[];for(let s of e){if(!s||typeof s!="object")continue;let r=s;r.type==="text"&&typeof r.text=="string"&&t.push(r.text)}return t.join(`
14
+ `).trim()}return""}a(Fe,"extractText");function ln(n){let e=n.trim();if(e.length<Le)return null;for(let r of Oe)if(r.re.test(e))return{type:r.type,matchedPhrase:r.phrase};let t=e.toLowerCase(),s=sn.find(r=>t.includes(r.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}a(ln,"classifyCaptureParagraph");function pn(n){let e=[],t=new Set;for(let s of n){let r=dn(s.text);for(let i of r){if(e.length>=rn)return e;let o=ln(i);if(!o)continue;let c=i.length>F?`${i.slice(0,F)}\u2026`:i,l=He(c);t.has(l)||(t.add(l),e.push({type:o.type,content:c,hash:l,matchedPhrase:o.matchedPhrase}))}}return e}a(pn,"extractCandidates");function dn(n){let e=n.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),t=[];for(let s of e){let r=s.split(`
15
+ `).map(o=>o.trim()).filter(Boolean);if(r.some(o=>Oe.some(c=>c.re.test(o)))&&r.length>1)for(let o of r)t.push(o);else t.push(s)}return t}a(dn,"splitParagraphs");function He(n){return en.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}a(He,"hashContent");function fn(n){try{let{REMEMBER_EVENT_RANGE:e}=(Ve(),X(qe)),t=w(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...e],s=>{if(s.source!==Pe)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(t)}catch{return new Set}}a(fn,"collectExistingAutoHashes");We();Xe();import mn from"node:fs/promises";import je from"node:path";function gn(){return process.env.PRJCT_TEST_MODE==="1"?je.join(j(".prjct-tests"),"kimi-code","sessions"):j(".kimi-code","sessions")}a(gn,"getKimiSessionsRoot");async function Ue(n,e=gn()){let t=n.replace(/[^a-zA-Z0-9_-]/g,"");if(!t)return;let s=t.startsWith("session_")?[t]:[t,`session_${t}`],r=await mn.readdir(e,{withFileTypes:!0}).catch(()=>[]);for(let i of r)if(i.isDirectory())for(let o of s){let c=je.join(e,i.name,o,"agents","main","wire.jsonl");if(await K(c))return c}}a(Ue,"resolveKimiTranscriptPath");var H=600*1e3,R=new Map;function hn(n){let e=n.replace(/[^a-zA-Z0-9._-]/g,"_");return Be.join(M.runDir(),`stop-heavy-${e}.stamp`)}a(hn,"heavyStepStampPath");async function Ge(n,e,t=!0){if(await b.stat(n).then(i=>e-i.mtimeMs<H).catch(()=>!1))return!1;let r=`${n}.lock`;try{await b.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await b.stat(r).then(c=>e-c.mtimeMs>=H).catch(()=>!1)||!t?!1:(await b.rmdir(r).catch(()=>{}),Ge(n,e,!1))}try{return await b.stat(n).then(o=>e-o.mtimeMs<H).catch(()=>!1)?!1:(await b.writeFile(n,String(e)),!0)}finally{await b.rmdir(r).catch(()=>{})}}a(Ge,"claimHeavyStep");async function yn(n){let e=Date.now(),t=R.get(n)??0;if(e-t<H)return!1;try{let s=hn(n);await b.mkdir(Be.dirname(s),{recursive:!0});let r=await Ge(s,e);return R.size>32&&R.clear(),R.set(n,e),r}catch{}return R.size>32&&R.clear(),R.set(n,e),!0}a(yn,"heavyStepsDue");function Jr(n=process.cwd(),e){return te({event:"Stop",projectPath:n,afterEmit:a(async(t,s,r)=>{let i=await v.readConfig(s).catch(()=>null);if(!i?.projectId)return;let o=re({hookHost:r}),c=t.transcript_path??(r==="kimi"&&t.session_id?await Ue(t.session_id).catch(()=>{}):void 0),l=await yn(i.projectId),u={};if(l&&c){let d=await b.readFile(c,"utf-8").catch(()=>null);d!==null&&(u.transcriptLines=S(d))}let f=ne(u.transcriptLines??[]);if(l)try{let{collectActiveTasks:d}=await import("./task-overview-XSMK7YEN.mjs"),p=await d(i.projectId,s);u.activeTaskId=p.current?.id,u.activeTaskDescription=p.current?.description,u.activeTaskStartedAt=p.current?.startedAt}catch{}if(u.transcriptLines&&u.transcriptLines.length>0)try{if(u.transcriptUsage=G(u.transcriptLines),u.transcriptUsage.tokensIn+u.transcriptUsage.tokensOut>0){let d=u.activeTaskStartedAt?{sinceIso:u.activeTaskStartedAt}:void 0,p=G(u.transcriptLines,d);if(u.activeTaskId&&p.tokensIn+p.tokensOut>0){B(i.projectId,u.activeTaskId,p.tokensIn,p.tokensOut,{description:u.activeTaskDescription,agent:o,source:`${o}-transcript`});try{let{sumTranscriptUsageByModel:y}=await import("./transcript-jsonl-OC7TH4Q3.mjs");for(let[E,m]of y(u.transcriptLines,d))m.tokensIn+m.tokensOut<=0||B(i.projectId,u.activeTaskId,m.tokensIn,m.tokensOut,{model:E,agent:o,source:`${o}-transcript:${E}`})}catch{}}}}catch{}if(ee({projectId:i.projectId,sessionId:t.session_id,directory:s,taskId:u.activeTaskId,goal:u.activeTaskDescription,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,agent:o,model:f}),l&&c)try{await $e(s,c,t.session_id??null,{preloadedConfig:i,preloadedLines:u.transcriptLines})}catch{}if(l){try{await ve(s,i)}catch{}try{await he(s,i)}catch{}try{let d=await Se(i.projectId);await ke(i.projectId,d),L.pruneRetained(i.projectId)}catch{}}if(l&&c)try{let d=await le(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"friction-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}d.signalsRecorded>0&&u.activeTaskId&&P.penalizeSurfaced(i.projectId,u.activeTaskId)}catch{}if(l&&c)try{let d=await xe(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"skill-miss-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}}catch{}if(l)try{await Z.backfill(i.projectId,i,new Date().toISOString())}catch{}if(l&&u.activeTaskId){let d={projectId:i.projectId,projectPath:s,cycleDescription:u.activeTaskDescription??null,cycleId:u.activeTaskId,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,model:f},p=a(async y=>{try{await y()}catch{}},"runBestEffort");await p(async()=>{let{synthesizeLandHandoff:y}=await import("./land-synthesis-CHARJMUP.mjs");await y(d)}),await p(async()=>{let{synthesizeJudgmentReceipt:y}=await import("./judgment-receipt-WT4EMCAV.mjs");await y(d)})}try{let{flushIfLinked:d}=await import("./auto-flush-EWSVMKQN.mjs");await d(s,i)}catch{}},"afterEmit")},e)}a(Jr,"runStopHook");export{hn as heavyStepStampPath,yn as heavyStepsDue,Jr as runStopHook};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as a}from"./chunk-2ZPM4Z6W.mjs";import"./chunk-BSR3XUBD.mjs";import{a as i}from"./chunk-MCY7OXED.mjs";import"./chunk-YQ6HM3YO.mjs";import"./chunk-ZK7BMUMR.mjs";import"./chunk-5UUITMRX.mjs";import"./chunk-K25HGTC3.mjs";import"./chunk-45LKWJ5D.mjs";import"./chunk-6P4GMVUZ.mjs";import"./chunk-UHXV7MDW.mjs";import"./chunk-TILUQF6L.mjs";import"./chunk-Y5SEUYET.mjs";import"./chunk-MG3YN3AI.mjs";import"./chunk-YEALP3WX.mjs";import"./chunk-QZ7T2EYR.mjs";import"./chunk-5YLI5V3Q.mjs";import"./chunk-F2FKQUYE.mjs";import"./chunk-6AFXUX2M.mjs";import"./chunk-WSVMQYYU.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-DIEPWXJJ.mjs";import"./chunk-UNNY2IWZ.mjs";import{b as n}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-WTDUJB4I.mjs";import{f as e,i as m}from"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-TIBYHZFA.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-XSMK7YEN.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as f,c as p}from"./chunk-XC6YAP36.mjs";import{a as s}from"./chunk-MCY7OXED.mjs";import"./chunk-YQ6HM3YO.mjs";import{a}from"./chunk-GTG67Z45.mjs";import"./chunk-H2KNJUPN.mjs";import"./chunk-XLFEWZRA.mjs";import{a as c}from"./chunk-KUQLXY2P.mjs";import"./chunk-HCPQZRR3.mjs";import"./chunk-EHVU2SMR.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{b as r}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";function w(u=process.cwd(),g){return s({event:"SubagentStop",projectPath:u,afterEmit:i(async(d,n)=>{let o=await r.readConfig(n).catch(()=>null);if(!o?.projectId||f(o)==="off")return;let e=[];try{let t=await a(o.projectId,n);t.current&&e.push(`active: ${t.current.description}`)}catch{}try{let t=await c.getActiveTasks(o.projectId);t.length>0&&e.push(`pending: ${t.length}`)}catch{}await p("prjct \u2014 subagent finished",e.join(" \xB7 ")||"A subagent finished")},"afterEmit")},g)}i(w,"runSubagentStopHook");export{w as runSubagentStopHook};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a}from"./chunk-XU3BQPBU.mjs";import"./chunk-F2FKQUYE.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as recordSurfacedForActiveTask};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"./chunk-QZ7T2EYR.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{b as extractFile,l as fileFanIn,m as fileFanInByFile,n as filesCallingInto,e as hasSymbolIndex,c as indexSymbols,g as listAllSymbols,f as loadMeta,i as scoreFilesFromQuery,h as searchSymbols,a as stripNoise,j as symbolsInFile,k as tracePath,d as updateSymbols};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c,d}from"./chunk-P2KU4FFA.mjs";import"./chunk-RP7F67ZT.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as analyzeGit,c as detectCommands,d as detectStack,b as gatherStats};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{d as a,e as b}from"./chunk-7QTE6X4J.mjs";import"./chunk-4PPIE6GA.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{b as default,a as syncClient};
@@ -0,0 +1,18 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as s,i as a}from"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import{e as i,l as o}from"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import{a as l}from"./chunk-3TRXQAU4.mjs";o();a();var d=class{static{l(this,"SyncCursorStorage")}get(t,r=null,e=null){if(!e)return null;let n=s.get(t,`SELECT * FROM sync_cursors
8
+ WHERE project_id = ?
9
+ AND device_id = ?
10
+ AND ${r===null?"user_id IS NULL":"user_id = ?"}`,...r===null?[t,e]:[t,e,r]);return n?this.rowToCursor(n):null}touch(t,r=null,e=null){if(!e)return;let n=i();this.upsert({userId:r,deviceId:e,projectId:t,lastEventId:this.getLastEventId(t,r,e),updatedAt:n})}advance(t,r,e={}){let n=e.userId??null,u=e.deviceId??null;if(!u)return;let _=this.getLastEventId(t,n,u);r<=_||this.upsert({userId:n,deviceId:u,projectId:t,lastEventId:r,updatedAt:i()})}getLastEventId(t,r,e){return s.get(t,`SELECT last_event_id FROM sync_cursors
11
+ WHERE project_id = ?
12
+ AND device_id = ?
13
+ AND ${r===null?"user_id IS NULL":"user_id = ?"}`,...r===null?[t,e]:[t,e,r])?.last_event_id??0}backfillUser(t,r,e){s.run(t,`UPDATE sync_cursors
14
+ SET user_id = ?, updated_at = ?
15
+ WHERE project_id = ? AND device_id = ? AND user_id IS NULL`,e,i(),t,r)}upsert(t){s.run(t.projectId,`INSERT INTO sync_cursors (user_id, device_id, project_id, last_event_id, updated_at)
16
+ VALUES (?, ?, ?, ?, ?)
17
+ ON CONFLICT(user_id, device_id, project_id)
18
+ DO UPDATE SET last_event_id = excluded.last_event_id, updated_at = excluded.updated_at`,t.userId,t.deviceId,t.projectId,t.lastEventId,t.updatedAt)}rowToCursor(t){return{userId:t.user_id,deviceId:t.device_id,projectId:t.project_id,lastEventId:t.last_event_id,updatedAt:t.updated_at}}},p=new d;export{p as syncCursorStorage};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c}from"./chunk-Q3LUL6LL.mjs";import"./chunk-C7YBUD4K.mjs";import"./chunk-IOFCSTGM.mjs";import"./chunk-S6FBPXQL.mjs";import"./chunk-NOHSLOLL.mjs";import"./chunk-RCIWCKL7.mjs";import"./chunk-SO3ZPNWT.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{c as orchestrationFor,a as pointsFromDiffLines,b as renderDelegationTrigger};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c}from"./chunk-GTG67Z45.mjs";import"./chunk-H2KNJUPN.mjs";import"./chunk-EHVU2SMR.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{a as collectActiveTasks,b as formatActiveTaskLine,c as formatActiveTaskList};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i}from"./chunk-7QMBIMEX.mjs";import"./chunk-VDXTMAMO.mjs";import"./chunk-NZKUCQZK.mjs";import"./chunk-H2KNJUPN.mjs";import"./chunk-6FUCOGOW.mjs";import"./chunk-7CI4AMVO.mjs";import"./chunk-Q3LUL6LL.mjs";import"./chunk-C7YBUD4K.mjs";import"./chunk-IOFCSTGM.mjs";import"./chunk-S6FBPXQL.mjs";import"./chunk-NOHSLOLL.mjs";import"./chunk-RCIWCKL7.mjs";import"./chunk-E73HSXCX.mjs";import"./chunk-76YMLNLF.mjs";import"./chunk-O5N6XYPU.mjs";import"./chunk-SROBBOJB.mjs";import"./chunk-56FW4P6U.mjs";import"./chunk-BQKDJ3U6.mjs";import"./chunk-6OYLZ4NM.mjs";import"./chunk-SO3ZPNWT.mjs";import"./chunk-V7R3L54M.mjs";import"./chunk-YEALP3WX.mjs";import"./chunk-QZ7T2EYR.mjs";import"./chunk-UYMZ3NAF.mjs";import"./chunk-AJXELVNH.mjs";import"./chunk-CWLGRKA7.mjs";import"./chunk-2NI4EEK2.mjs";import"./chunk-6AFXUX2M.mjs";import"./chunk-WSVMQYYU.mjs";import"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-HCPQZRR3.mjs";import"./chunk-EHVU2SMR.mjs";import"./chunk-HPCSSJXH.mjs";import"./chunk-E5QQDYBR.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import"./chunk-ID2C2S33.mjs";import"./chunk-DIEPWXJJ.mjs";import"./chunk-UNNY2IWZ.mjs";import"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-TIBYHZFA.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";export{e as TASK_CONTEXT_PROMPT,h as completeActiveTask,a as formatRelatedContextForAgent,b as formatRiskForAgent,i as readLastStatus,d as recallRisksForFiles,g as resolveActiveTask,f as setTaskStatus,c as startTask};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as M,b as l}from"./chunk-GOIBJ7PV.mjs";import{a as d}from"./chunk-5MN22JFI.mjs";import{a as k}from"./chunk-V5VCXMKO.mjs";import{d as T}from"./chunk-FOWTB762.mjs";import{a as u}from"./chunk-6FUCOGOW.mjs";import"./chunk-7CI4AMVO.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{h as c}from"./chunk-ID2C2S33.mjs";import{b as h}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import{a as D,p as w}from"./chunk-D62TAZG6.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import"./chunk-HYIT7MF5.mjs";import{e as f,g as $}from"./chunk-225DWS4D.mjs";import{a as m}from"./chunk-3TRXQAU4.mjs";$();w();var i=["off","assist","strict"],C=class extends k{static{m(this,"TddCommands")}async tdd(s=null,t=process.cwd(),n={}){let e=M(s,i);return e.kind==="status"?this.showStatus(t,n):e.kind==="mode"?this.setMode(e.mode,t,n):e.sub==="check"?this.check(t,n):T(`Unknown tdd subcommand "${e.sub}". Use: check, or ${i.join("|")}.`,n)}async showStatus(s,t){let n=await l(s,t);if(!n.ok)return n.result;let e=n.value,o=y(e),a=(await u(s).catch(()=>null))?.test?.command??null,p=[`Mode: ${o}${o==="off"?" (guidance + ship TDD gate dormant)":""}`,`Test command: ${a??"none detected (add tests to enable the gate)"}`,"Set: prjct tdd off|assist|strict","Check: prjct tdd check \u2014 run the test command now (red/green)"];return t.md?console.log(d("## TDD",`> **Mode**: \`${o}\``,`- Test command: \`${a??"none detected"}\``,p.slice(2).join(`
8
+ `))):c.info(`TDD \u2014 ${p.join(`
9
+ `)}`),{success:!0,mode:o,testCommand:a}}async setMode(s,t,n){let e=await l(t,n);if(!e.ok)return e.result;let o=e.value;o.tdd={mode:s},await h.writeConfig(t,o);let r=s==="off"?"TDD mode off \u2014 test-first guidance and the ship TDD gate are dormant.":s==="assist"?"TDD mode \u2192 assist. Guidance biases test-first (red\u2192green\u2192refactor); `ship` reminds.":"TDD mode \u2192 strict. Test-first expected; `ship` surfaces a hard gate \u2014 run `prjct tdd check` and don't ship on red.";return n.md?console.log(d("## TDD",`> ${r}`)):c.done(r),{success:!0,mode:s}}async check(s,t){let e=(await u(s).catch(()=>null))?.test?.command;if(!e){let o="tdd check: no test command detected for this stack. Add a test script first.";return console.log(t.md?d("## TDD check",`> ${o}`):o),{success:!1,reason:"no_test_command"}}try{await D(e,{cwd:s,maxBuffer:32*1024*1024});let o=`tdd check: GREEN \u2014 \`${e}\` passed.`;return console.log(t.md?d("## TDD check",`> \u2705 ${o}`):o),{success:!0,green:!0,testCommand:e}}catch(o){let r=`tdd check: RED \u2014 \`${e}\` failed. Fix before shipping.`;return t.md?console.log(d("## TDD check",`> \u274C ${r}`,f(o))):(c.fail(r),c.info(f(o))),{success:!1,green:!1,testCommand:e}}}};function y(g){let s=g?.tdd?.mode;if(s&&i.includes(s))return s;let t=process.env.PRJCT_TDD_MODE?.toLowerCase();return t&&i.includes(t)?t:"off"}m(y,"effectiveTddMode");var L={effectiveTddMode:y,TDD_MODES:i};export{C as TddCommands,L as _internal,y as effectiveTddMode};
@@ -0,0 +1,42 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as D,d as $}from"./chunk-5MN22JFI.mjs";import{a as v}from"./chunk-V5VCXMKO.mjs";import{d as C,e as y}from"./chunk-FOWTB762.mjs";import"./chunk-7CI4AMVO.mjs";import{a as A,b as E}from"./chunk-2I5PUQWY.mjs";import{b as M}from"./chunk-LZC6NGB6.mjs";import"./chunk-XLFEWZRA.mjs";import"./chunk-XPRLQIVQ.mjs";import"./chunk-EZRNQXCC.mjs";import"./chunk-B7AQHL7B.mjs";import"./chunk-L4TUXFCL.mjs";import{h as g}from"./chunk-ID2C2S33.mjs";import{b as O}from"./chunk-3USVY66O.mjs";import"./chunk-OIE3AKKO.mjs";import"./chunk-Q6C27OL7.mjs";import"./chunk-NXUIMC22.mjs";import"./chunk-DZVOFEM5.mjs";import"./chunk-5EF5EOCL.mjs";import"./chunk-DMO3ZFUG.mjs";import"./chunk-NNOX3UU4.mjs";import"./chunk-INJ5WT2D.mjs";import"./chunk-HU5ERAAV.mjs";import"./chunk-6RT2P22O.mjs";import"./chunk-ZXTJLMVZ.mjs";import"./chunk-VWFVSNQT.mjs";import"./chunk-U24YKPYX.mjs";import{a as j,p as F}from"./chunk-D62TAZG6.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import{d as q,g as J}from"./chunk-TTN2CFZC.mjs";import"./chunk-DOJPSIMG.mjs";import{k as b,p as P}from"./chunk-HYIT7MF5.mjs";import{e as k,g as H}from"./chunk-225DWS4D.mjs";import{a as p}from"./chunk-3TRXQAU4.mjs";import d from"node:fs/promises";import h from"node:path";H();F();P();J();var N="<!-- prjct-team:start - DO NOT REMOVE THIS MARKER -->",L="<!-- prjct-team:end - DO NOT REMOVE THIS MARKER -->";function S(t){let o={required:t.required,minVersion:t.minVersion,enrolledAt:t.enrolledAt};return t.enrolledBy!==null&&(o.enrolledBy=t.enrolledBy),`${JSON.stringify(o,null,2)}
8
+ `}p(S,"renderTeamMirror");var x=class extends v{static{p(this,"TeamCommands")}async team(o=null,r=process.cwd(),e={}){if(o==="check")return this.check(r,e);try{let n={required:e.required===!0,minVersion:e.minVersion??q??"0.0.0",enrolledAt:new Date().toISOString(),enrolledBy:null},i=h.join(r,".prjct","team.json"),a=h.join(r,".claude","CLAUDE.md"),l=await this.ensureProjectInit(r);if(!l.success)return l;let m=await O.getProjectId(r);if(!m)return y("No prjct project. Run `prjct init` first.",e);E.set(m,n);try{await b(i,S(n))}catch(c){let T=k(c);await M.remember(r,{type:"inbox",content:`team.json mirror write failed: ${T}`,tags:{"mirror-drift":"1"},provenance:"declared"}).catch(()=>{})}await d.mkdir(h.dirname(a),{recursive:!0});let s=z(n),w=await d.readFile(a,"utf-8").catch(()=>""),u=G(w,s,N,L);await d.writeFile(a,u,"utf-8");let f=[i,a],R=await(async()=>{try{await j("git rev-parse --show-toplevel",{cwd:r});let c=e.enforce===!0?h.join(r,".githooks","pre-commit"):null;if(e.enforce===!0){if(!c)return!1;await d.mkdir(h.dirname(c),{recursive:!0}),await d.writeFile(c,U,"utf-8"),await d.chmod(c,493),await j("git config core.hooksPath .githooks",{cwd:r}),f.push(c)}return await j(`git add ${f.map(T=>JSON.stringify(T)).join(" ")}`,{cwd:r}),!0}catch{return!1}})(),_=e.enforce?" + pre-commit enforce":"",V=`${n.required?"\u2713 team mode (required)":"\u2713 team mode (optional)"}${_} \u2014 minVersion ${n.minVersion}`,B=R?`Staged: ${f.map(c=>c.replace(`${r}/`,"")).join(", ")}`:"Files written but not staged (no git repo or git missing).",I=["1. Review the diff: `git diff --staged`",'2. Commit: `git commit -m "chore: enroll repo in prjct team mode"`',"3. Push: `git push`","4. Teammates run `curl -sSL https://raw.githubusercontent.com/prjct-app/cli/main/scripts/install-standalone.sh | bash` (or `npm install -g prjct-cli@latest`).",...e.enforce?["5. **Each teammate** runs `git config core.hooksPath .githooks` once (or `prjct team --enforce` to do it automatically)."]:[]].join(`
9
+ `);return e.md?console.log(D($("Team mode enrolled",V),$("Files",B),$("Next",I))):(g.done(V),console.log(B),console.log(`
10
+ Next steps:`),console.log(I)),{success:!0,teamConfig:n,staged:R,teamPath:i,claudeMdPath:a}}catch(n){let i=k(n);return y(i)}}async check(o=process.cwd(),r={}){try{let e=await this.ensureProjectInit(o);if(!e.success)return e;let n=await O.getProjectId(o);if(!n)return y("No prjct project. Run `prjct init` first.",r);let i=h.join(o,".prjct","team.json"),a=E.get(n),l=await d.readFile(i,"utf-8").catch(()=>null);if(a===null&&l!==null){let s=(()=>{try{return JSON.parse(l)}catch{return null}})();if(s===null)return C(`cannot parse ${i} \u2014 fix or delete the file before running team check again`,r);let w={required:typeof s.required=="boolean"?s.required:!1,minVersion:typeof s.minVersion=="string"?s.minVersion:q??"0.0.0",enrolledAt:typeof s.enrolledAt=="string"?s.enrolledAt:new Date().toISOString(),enrolledBy:typeof s.enrolledBy=="string"?s.enrolledBy:null};E.set(n,w),await b(i,S(w));let u="\u2713 team check: migrated disk \u2192 DB; mirror rewritten";return r.md?console.log(`> ${u}`):g.done(u),{success:!0,healed:!0,migrated:!0}}if(a!==null){let s=A(a);if((l===null?null:K(l,a))===s){let f="\u2713 team check: mirror in sync";return r.md?console.log(`> ${f}`):g.done(f),{success:!0,healed:!1}}await b(i,S(a));let u="\u2713 team check: drift detected; mirror rewritten from DB";return r.md?console.log(`> ${u}`):g.done(u),{success:!0,healed:!0}}let m="\u2713 team check: no enrollment configured";return r.md?console.log(`> ${m}`):g.done(m),{success:!0,healed:!1,empty:!0}}catch(e){return y(k(e),r)}}};function K(t,o){let r=(()=>{try{return JSON.parse(t)}catch{return null}})();if(r===null)return null;let e=r,n={required:e.required===!0,minVersion:typeof e.minVersion=="string"?e.minVersion:"",enrolledAt:typeof e.enrolledAt=="string"?e.enrolledAt:"",enrolledBy:typeof e.enrolledBy=="string"?e.enrolledBy:o.enrolledBy};return A(n)}p(K,"canonicalizeDiskTeamJson");var U=`#!/usr/bin/env sh
11
+ # prjct team enforce \u2014 blocks commits when team.json says required:true
12
+ # and the contributor doesn't have prjct installed locally.
13
+ # Generated by 'prjct team --enforce'. Safe to delete; safe to re-run.
14
+ set -e
15
+
16
+ TEAM_FILE=".prjct/team.json"
17
+ [ -f "$TEAM_FILE" ] || exit 0
18
+
19
+ # Cheap JSON parse \u2014 match "required": true with optional whitespace
20
+ if ! grep -qE '"required"[[:space:]]*:[[:space:]]*true' "$TEAM_FILE"; then
21
+ exit 0
22
+ fi
23
+
24
+ if ! command -v prjct >/dev/null 2>&1; then
25
+ printf '\\n\\033[1;31m\u2717 prjct is required for this repo (.prjct/team.json: required=true)\\033[0m\\n' >&2
26
+ printf ' Install once:\\n' >&2
27
+ printf ' \\033[36mcurl -sSL https://raw.githubusercontent.com/prjct-app/cli/main/scripts/install-standalone.sh | bash\\033[0m\\n' >&2
28
+ printf ' Or: npm install -g prjct-cli@latest\\n' >&2
29
+ printf ' (Bypass with --no-verify if you must, but the team agreed otherwise.)\\n\\n' >&2
30
+ exit 1
31
+ fi
32
+
33
+ exit 0
34
+ `;function z(t){return[N,"# prjct (team mode)","",`This repo is enrolled in prjct team mode (required: ${t.required}, minVersion: ${t.minVersion}, enrolled: ${t.enrolledAt}).`,"",'Query prjct (`prjct search`, `prjct context memory`, MCP `prjct_*`) before re-reading source; capture analysis back via `prjct remember <type> "..."` \u2014 in ENGLISH, whatever language the contributor speaks.',"","Don't have prjct? Install once: `curl -sSL https://raw.githubusercontent.com/prjct-app/cli/main/scripts/install-standalone.sh | bash`",`${t.required?"This repo *requires* prjct \u2014 please install before contributing.":""}`,L].filter(o=>o!=="").join(`
35
+ `)}p(z,"teamClaudeMdBlock");function G(t,o,r,e){if(!t.trim())return`${o}
36
+ `;let n=t.indexOf(r),i=t.indexOf(e);if(n>=0&&i>n){let l=t.slice(0,n),m=t.slice(i+e.length);return`${`${l}${o}${m}`.replace(/\n{3,}/g,`
37
+
38
+ `).trim()}
39
+ `}return`${t.replace(/\s+$/,"")}
40
+
41
+ ${o}
42
+ `}p(G,"upsertBetweenMarkers");export{x as TeamCommands};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a,b,c,d,f as e}from"./chunk-XYDLXF5A.mjs";import"./chunk-FATYLG3L.mjs";import"./chunk-2EEMQV7N.mjs";import"./chunk-KPR5TWSN.mjs";import"./chunk-623SNKDH.mjs";import"./chunk-TTN2CFZC.mjs";import"./chunk-225DWS4D.mjs";import"./chunk-3TRXQAU4.mjs";e();export{d as default,b as getTemplateContent,c as listTemplates,a as resetBundle};