prjct-cli 3.96.0 → 3.98.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 (511) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-3N2MSSGT.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-4SE6GF7R.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-ZPNNCOH7.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-OARMM4AH.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-XA3V7BJ6.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-FYID6EYI.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-3JJPWIF3.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-G5LGVDME.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-B565WDCA.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-LPJ4GKB6.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-2FRLIQKX.mjs +10 -0
  23. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  24. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  25. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  26. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  27. package/dist/bin/core-chunks/chunk-2VRS5CUH.mjs +9 -0
  28. package/dist/bin/core-chunks/chunk-2VXPFULA.mjs +7 -0
  29. package/dist/bin/core-chunks/chunk-3OWKIRK6.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3TRXQAU4.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-5DZ2LTII.mjs +52 -0
  38. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  39. package/dist/bin/core-chunks/chunk-5OWPZWEU.mjs +13 -0
  40. package/dist/bin/core-chunks/chunk-5TGZSK4C.mjs +10 -0
  41. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  42. package/dist/bin/core-chunks/chunk-5ZBACKED.mjs +14 -0
  43. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  44. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  45. package/dist/bin/core-chunks/chunk-6KNMT46X.mjs +18 -0
  46. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  47. package/dist/bin/core-chunks/chunk-6POAOY5C.mjs +19 -0
  48. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6U3CYLY5.mjs +7 -0
  50. package/dist/bin/core-chunks/chunk-6U3MV7KZ.mjs +15 -0
  51. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  52. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  53. package/dist/bin/core-chunks/chunk-7BU6SJBC.mjs +17 -0
  54. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  56. package/dist/bin/core-chunks/chunk-ACIOJQSI.mjs +14 -0
  57. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  58. package/dist/bin/core-chunks/chunk-ALTQ3KL4.mjs +7 -0
  59. package/dist/bin/core-chunks/chunk-ANBDOI53.mjs +8 -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-B2HY22OD.mjs +50 -0
  63. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  66. package/dist/bin/core-chunks/chunk-BUD3R6LF.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-CA2VFWFP.mjs +21 -0
  70. package/dist/bin/core-chunks/chunk-CB3CNJTL.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-CUIB6CTG.mjs +20 -0
  74. package/dist/bin/core-chunks/chunk-CVKMV22J.mjs +17 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXKDKMYE.mjs +9 -0
  77. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  78. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -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-DOJPSIMG.mjs +7 -0
  83. package/dist/bin/core-chunks/chunk-DTMZBK4E.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DW4QMD6J.mjs +10 -0
  85. package/dist/bin/core-chunks/chunk-DZDEBDAB.mjs +10 -0
  86. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  88. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  89. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  90. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  91. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  92. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  93. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  94. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  95. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-FOUBHU4X.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  98. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  100. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  102. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  103. package/dist/bin/core-chunks/chunk-HA7Y76GF.mjs +7 -0
  104. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  106. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HVXWQ2XZ.mjs +7 -0
  108. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  109. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  110. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  111. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  112. package/dist/bin/core-chunks/chunk-IJNKHQIS.mjs +10 -0
  113. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-J6Y7IVFQ.mjs +7 -0
  116. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  117. package/dist/bin/core-chunks/chunk-JGGQSMZC.mjs +8 -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-KI4OY3UQ.mjs +18 -0
  121. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  123. package/dist/bin/core-chunks/chunk-L3DJN3XD.mjs +12 -0
  124. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  125. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  126. package/dist/bin/core-chunks/chunk-LFOQ7FCR.mjs +10 -0
  127. package/dist/bin/core-chunks/chunk-LGX2GM45.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LTKUTRRL.mjs +7 -0
  129. package/dist/bin/core-chunks/chunk-LZILSE5H.mjs +8 -0
  130. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MPU3VM6Z.mjs +7 -0
  133. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  134. package/dist/bin/core-chunks/chunk-MXJF3FA7.mjs +7 -0
  135. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  137. package/dist/bin/core-chunks/chunk-NNILF7R3.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  139. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  140. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  141. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  142. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  143. package/dist/bin/core-chunks/chunk-O5VCBMEK.mjs +25 -0
  144. package/dist/bin/core-chunks/chunk-OE27RFLJ.mjs +8 -0
  145. package/dist/bin/core-chunks/chunk-OGM34Z6W.mjs +8 -0
  146. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  147. package/dist/bin/core-chunks/chunk-OXKGN3HG.mjs +7 -0
  148. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  149. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  151. package/dist/bin/core-chunks/chunk-PQTR6XVW.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  154. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-Q7GJIU6D.mjs +8 -0
  156. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  157. package/dist/bin/core-chunks/chunk-QWRPJARA.mjs +14 -0
  158. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  159. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  160. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  161. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  162. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  163. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  165. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  166. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  167. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  168. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  169. package/dist/bin/core-chunks/chunk-STFUT7R7.mjs +28 -0
  170. package/dist/bin/core-chunks/chunk-SUXIKMTS.mjs +30 -0
  171. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  172. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  173. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  174. package/dist/bin/core-chunks/chunk-TOORPP6K.mjs +7 -0
  175. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  176. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  177. package/dist/bin/core-chunks/chunk-UAYTDSYG.mjs +64 -0
  178. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  179. package/dist/bin/core-chunks/chunk-UNIBFM6J.mjs +13 -0
  180. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  181. package/dist/bin/core-chunks/chunk-UX2ORID4.mjs +9 -0
  182. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  183. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  184. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  185. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  187. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  188. package/dist/bin/core-chunks/chunk-VJCTTFKP.mjs +8 -0
  189. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-W23JLJJZ.mjs +109 -0
  192. package/dist/bin/core-chunks/chunk-WCTVZQBG.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  194. package/dist/bin/core-chunks/chunk-WZ6W5ZQ5.mjs +7 -0
  195. package/dist/bin/core-chunks/chunk-X433BB6F.mjs +7 -0
  196. package/dist/bin/core-chunks/chunk-XBR63NJA.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XJTEPHLC.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XLAGA5B7.mjs +10 -0
  200. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XSZOHNL4.mjs +7 -0
  202. package/dist/bin/core-chunks/chunk-XWLTEAGN.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-YOWW4LHK.mjs +8 -0
  209. package/dist/bin/core-chunks/chunk-YPLFWN62.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  211. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZAUJWUUN.mjs +20 -0
  213. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  214. package/dist/bin/core-chunks/chunk-ZQ2XH76U.mjs +12 -0
  215. package/dist/bin/core-chunks/chunk-ZSANMA7K.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/chunk-ZZR3LXCK.mjs +9 -0
  218. package/dist/bin/core-chunks/cleanup-installs-LD43GI4K.mjs +7 -0
  219. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  220. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  221. package/dist/bin/core-chunks/cloud-RXHFZ7MX.mjs +14 -0
  222. package/dist/bin/core-chunks/code-IYK65A62.mjs +12 -0
  223. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-hooks-N5UHKK5B.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-mcp-G7WNAT6T.mjs +7 -0
  226. package/dist/bin/core-chunks/codex-skill-IZNP76BJ.mjs +7 -0
  227. package/dist/bin/core-chunks/command-installer-4ENM4GZR.mjs +7 -0
  228. package/dist/bin/core-chunks/config-UVF7YOR6.mjs +8 -0
  229. package/dist/bin/core-chunks/config-manager-QY73WM5U.mjs +7 -0
  230. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  231. package/dist/bin/core-chunks/context-4GB6ICXK.mjs +38 -0
  232. package/dist/bin/core-chunks/context-MPHOQPXF.mjs +10 -0
  233. package/dist/bin/core-chunks/context-checkpoint-NBI5HKPV.mjs +27 -0
  234. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  235. package/dist/bin/core-chunks/context-tiers-NOKJ75QP.mjs +7 -0
  236. package/dist/bin/core-chunks/context7-service-2MYRUNKY.mjs +7 -0
  237. package/dist/bin/core-chunks/core-WMEHDCOK.mjs +70 -0
  238. package/dist/bin/core-chunks/crew-EYVSIX4L.mjs +24 -0
  239. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  240. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  241. package/dist/bin/core-chunks/cwd-changed-EUJZOBIC.mjs +7 -0
  242. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  243. package/dist/bin/core-chunks/daemon-QARP3RVX.mjs +13 -0
  244. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  245. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  246. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  247. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  248. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  249. package/dist/bin/core-chunks/developer-profile-2VSFJGCU.mjs +7 -0
  250. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  251. package/dist/bin/core-chunks/distill-ZF7WHGCZ.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-heal-XFSVPSEY.mjs +7 -0
  253. package/dist/bin/core-chunks/doctor-service-6ZJBWIXR.mjs +8 -0
  254. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  255. package/dist/bin/core-chunks/dynasty-outcomes-KDWIEA4Y.mjs +11 -0
  256. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  257. package/dist/bin/core-chunks/embeddings-354ZYFKX.mjs +7 -0
  258. package/dist/bin/core-chunks/enriched-recall-MKBOXB7M.mjs +7 -0
  259. package/dist/bin/core-chunks/eval-O4YD6YOV.mjs +76 -0
  260. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  261. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  262. package/dist/bin/core-chunks/format-SYVL4CV5.mjs +7 -0
  263. package/dist/bin/core-chunks/gemini-settings-RGD7JLSP.mjs +7 -0
  264. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  265. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-mcp-IE2RRRRW.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-plugin-SSANHBS7.mjs +7 -0
  268. package/dist/bin/core-chunks/grok-skill-7ZP7R7KO.mjs +7 -0
  269. package/dist/bin/core-chunks/guard-RT7U3LJX.mjs +13 -0
  270. package/dist/bin/core-chunks/guards-AXH6V2IJ.mjs +7 -0
  271. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  272. package/dist/bin/core-chunks/harness-V7J7WIT2.mjs +43 -0
  273. package/dist/bin/core-chunks/health-TNB5OC37.mjs +11 -0
  274. package/dist/bin/core-chunks/help-P7EYELVK.mjs +14 -0
  275. package/dist/bin/core-chunks/hooks-service-REI56DDC.mjs +91 -0
  276. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  277. package/dist/bin/core-chunks/install-FZQJJWT5.mjs +9 -0
  278. package/dist/bin/core-chunks/judgment-G5KH6QFC.mjs +21 -0
  279. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  281. package/dist/bin/core-chunks/judgment-receipt-GO6QEZQC.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-hooks-TR6J3OVG.mjs +7 -0
  283. package/dist/bin/core-chunks/kimi-mcp-ETG7O6O5.mjs +7 -0
  284. package/dist/bin/core-chunks/land-cue-3BUD3KJJ.mjs +8 -0
  285. package/dist/bin/core-chunks/land-rho-MCTQDPRH.mjs +8 -0
  286. package/dist/bin/core-chunks/land-synthesis-MU4EZEYL.mjs +7 -0
  287. package/dist/bin/core-chunks/lean-26BWCUOR.mjs +34 -0
  288. package/dist/bin/core-chunks/legacy-crew-sweep-G5UJT2PM.mjs +23 -0
  289. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  290. package/dist/bin/core-chunks/llm-KMVXVBHG.mjs +18 -0
  291. package/dist/bin/core-chunks/mcp-BD5TOTCK.mjs +17 -0
  292. package/dist/bin/core-chunks/memory-dream-6GFV2GXN.mjs +14 -0
  293. package/dist/bin/core-chunks/memory-export-WJ4H7CFV.mjs +13 -0
  294. package/dist/bin/core-chunks/memory-index-7NIU34EI.mjs +7 -0
  295. package/dist/bin/core-chunks/notification-G654IX3O.mjs +7 -0
  296. package/dist/bin/core-chunks/notify-EWYUBKGO.mjs +9 -0
  297. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  298. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  299. package/dist/bin/core-chunks/opencode-mcp-L7NC77JF.mjs +7 -0
  300. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  301. package/dist/bin/core-chunks/pack-integrity-X277OVRB.mjs +9 -0
  302. package/dist/bin/core-chunks/pack-manager-VN7F6R47.mjs +7 -0
  303. package/dist/bin/core-chunks/package-R4FUTGOE.mjs +7 -0
  304. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  305. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  306. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  307. package/dist/bin/core-chunks/pi-skill-IZQEUILZ.mjs +7 -0
  308. package/dist/bin/core-chunks/planning-NOWLKZDS.mjs +8 -0
  309. package/dist/bin/core-chunks/post-edit-GTBY32JU.mjs +7 -0
  310. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  311. package/dist/bin/core-chunks/pre-bash-32ZOGNSP.mjs +10 -0
  312. package/dist/bin/core-chunks/pre-commit-7TU2A7H4.mjs +7 -0
  313. package/dist/bin/core-chunks/pre-edit-ASEWA5TS.mjs +8 -0
  314. package/dist/bin/core-chunks/pre-package-ZTZACEBB.mjs +7 -0
  315. package/dist/bin/core-chunks/pre-search-MKDRFJSE.mjs +8 -0
  316. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  318. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  319. package/dist/bin/core-chunks/preferences-KO5U2ELK.mjs +31 -0
  320. package/dist/bin/core-chunks/primitives-GNUMBYOK.mjs +13 -0
  321. package/dist/bin/core-chunks/prjct-md-BSFV7OQQ.mjs +7 -0
  322. package/dist/bin/core-chunks/product-GUHSUNIH.mjs +68 -0
  323. package/dist/bin/core-chunks/project-agent-surfaces-BXCJJXB7.mjs +7 -0
  324. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  325. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  326. package/dist/bin/core-chunks/project-memory-L5MDZYST.mjs +7 -0
  327. package/dist/bin/core-chunks/project-style-evolution-HIMSJQQB.mjs +7 -0
  328. package/dist/bin/core-chunks/prompt-47YP5JIR.mjs +25 -0
  329. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  331. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  332. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  333. package/dist/bin/core-chunks/purge-6SJKHKIY.mjs +7 -0
  334. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  335. package/dist/bin/core-chunks/registry-YM2EYUXY.mjs +7 -0
  336. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  337. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  338. package/dist/bin/core-chunks/retention-QSXWKE4H.mjs +7 -0
  339. package/dist/bin/core-chunks/retro-B2EBN4TA.mjs +13 -0
  340. package/dist/bin/core-chunks/review-risk-LBPY5M3K.mjs +12 -0
  341. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  342. package/dist/bin/core-chunks/safe-artifacts-PE2TMEZQ.mjs +9 -0
  343. package/dist/bin/core-chunks/sdd-3WNZJ6FU.mjs +9 -0
  344. package/dist/bin/core-chunks/seed-MMDJE2UO.mjs +10 -0
  345. package/dist/bin/core-chunks/self-heal-R5FBXEVQ.mjs +7 -0
  346. package/dist/bin/core-chunks/session-continuity-OQDB5UYI.mjs +10 -0
  347. package/dist/bin/core-chunks/session-start-FM6UL7MT.mjs +7 -0
  348. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  349. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  350. package/dist/bin/core-chunks/setup-BL36ZWPW.mjs +140 -0
  351. package/dist/bin/core-chunks/setup-V75BWRHU.mjs +38 -0
  352. package/dist/bin/core-chunks/shipping-NZVM57JJ.mjs +12 -0
  353. package/dist/bin/core-chunks/signals-digest-P5BG6MZF.mjs +7 -0
  354. package/dist/bin/core-chunks/skill-adherence-JE3N3Y67.mjs +13 -0
  355. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  356. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  357. package/dist/bin/core-chunks/spec-VC3VTUI3.mjs +27 -0
  358. package/dist/bin/core-chunks/spec-context-inference-KOINWBC7.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  360. package/dist/bin/core-chunks/spec-service-UZ53XL6X.mjs +7 -0
  361. package/dist/bin/core-chunks/spec-task-breakdown-3Y7YXCIQ.mjs +7 -0
  362. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  363. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  364. package/dist/bin/core-chunks/stop-6SH36ULT.mjs +15 -0
  365. package/dist/bin/core-chunks/subagent-start-TVGBV2V2.mjs +7 -0
  366. package/dist/bin/core-chunks/subagent-stop-APWY6KMX.mjs +7 -0
  367. package/dist/bin/core-chunks/surface-attribution-CQVM2SWY.mjs +7 -0
  368. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  371. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  372. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  373. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  374. package/dist/bin/core-chunks/task-service-KFYL5NT4.mjs +7 -0
  375. package/dist/bin/core-chunks/tdd-P2PP4RR4.mjs +9 -0
  376. package/dist/bin/core-chunks/team-WKAAOEFE.mjs +42 -0
  377. package/dist/bin/core-chunks/template-loader-H4FE37HV.mjs +7 -0
  378. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  379. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  380. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  381. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  382. package/dist/bin/core-chunks/uninstall-W6EAUS7N.mjs +13 -0
  383. package/dist/bin/core-chunks/update-PSHEJJI5.mjs +11 -0
  384. package/dist/bin/core-chunks/update-checker-LZCUPWQB.mjs +7 -0
  385. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  386. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  387. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  388. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  389. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  390. package/dist/bin/core-chunks/version-B5DBRVGQ.mjs +7 -0
  391. package/dist/bin/core-chunks/watch-service-7V3O52TW.mjs +9 -0
  392. package/dist/bin/core-chunks/weak-frontier-demo-ZCDTMYRO.mjs +7 -0
  393. package/dist/bin/core-chunks/weak-model-mode-LOAPFJPQ.mjs +7 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-graph-ZNV7S6EU.mjs +16 -0
  396. package/dist/bin/core-chunks/work-scope-XXPUH6TU.mjs +7 -0
  397. package/dist/bin/core-chunks/workflow-XM77QYRF.mjs +61 -0
  398. package/dist/bin/core-chunks/workflows-reference-T7RH7IGJ.mjs +7 -0
  399. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  400. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  401. package/dist/bin/core-chunks/world-model-impact-FAGGNUGN.mjs +7 -0
  402. package/dist/bin/hook-chunks/{agent-switch-I4MTVE56.mjs → agent-switch-TAJWH2ZD.mjs} +1 -1
  403. package/dist/bin/hook-chunks/{analysis-VN7APBHR.mjs → analysis-34WDLUXK.mjs} +2 -2
  404. package/dist/bin/hook-chunks/{auto-flush-DX3FVSQE.mjs → auto-flush-7TIEBPPQ.mjs} +1 -1
  405. package/dist/bin/hook-chunks/{capture-gate-MEIQD7ZS.mjs → capture-gate-JFVGG7RB.mjs} +1 -1
  406. package/dist/bin/hook-chunks/{chunk-UVATSTRF.mjs → chunk-22CBVTZ3.mjs} +1 -1
  407. package/dist/bin/hook-chunks/{chunk-MW54MTLB.mjs → chunk-3JOZN7YJ.mjs} +1 -1
  408. package/dist/bin/hook-chunks/{chunk-E7NA34VQ.mjs → chunk-4X3KUIXK.mjs} +1 -1
  409. package/dist/bin/hook-chunks/{chunk-3AHW4XQH.mjs → chunk-5ALQBNIZ.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-H2DGDAQP.mjs → chunk-5VPZI2ZF.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-XYKVWO23.mjs → chunk-6EHYPQ5U.mjs} +1 -1
  412. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  413. package/dist/bin/hook-chunks/chunk-7H5UVM6X.mjs +9 -0
  414. package/dist/bin/hook-chunks/{chunk-LR24AIEW.mjs → chunk-A3R47SP6.mjs} +1 -1
  415. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  416. package/dist/bin/hook-chunks/{chunk-64ZEBHDX.mjs → chunk-CGAKJDKT.mjs} +1 -1
  417. package/dist/bin/hook-chunks/{chunk-EI6VQZOX.mjs → chunk-CJY4Y5SO.mjs} +1 -1
  418. package/dist/bin/hook-chunks/chunk-FSFURDAE.mjs +16 -0
  419. package/dist/bin/hook-chunks/{chunk-ZZBNFNMG.mjs → chunk-FTBBQHI4.mjs} +1 -1
  420. package/dist/bin/hook-chunks/chunk-G4VJKPG7.mjs +69 -0
  421. package/dist/bin/hook-chunks/{chunk-7PBWIO4K.mjs → chunk-GAJOSSB4.mjs} +2 -2
  422. package/dist/bin/hook-chunks/{chunk-DB226JIV.mjs → chunk-GER6HFWV.mjs} +1 -1
  423. package/dist/bin/hook-chunks/{chunk-LQLCYBFF.mjs → chunk-H3GIYI4Q.mjs} +2 -2
  424. package/dist/bin/hook-chunks/{chunk-KDNUQPAK.mjs → chunk-HRU2KNEB.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-33BHU4OM.mjs → chunk-LCGWETJ6.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-WL6PKX3U.mjs → chunk-MG2DNP4Z.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-XV2LJVYB.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  428. package/dist/bin/hook-chunks/chunk-NGB6JNSB.mjs +18 -0
  429. package/dist/bin/hook-chunks/{chunk-IJ523YO2.mjs → chunk-OALZUWC6.mjs} +1 -1
  430. package/dist/bin/hook-chunks/{chunk-EGCYDLSO.mjs → chunk-PZMBZ6GE.mjs} +1 -1
  431. package/dist/bin/hook-chunks/{chunk-RT2DFIWF.mjs → chunk-QIB6Y6AH.mjs} +2 -2
  432. package/dist/bin/hook-chunks/{chunk-ZQI4TJ5C.mjs → chunk-QMNZPNVY.mjs} +1 -1
  433. package/dist/bin/hook-chunks/{chunk-YLOK4WRR.mjs → chunk-R4YDE3GU.mjs} +1 -1
  434. package/dist/bin/hook-chunks/{chunk-WJV24WE6.mjs → chunk-RFKRKUHB.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-SWJ7TLBD.mjs → chunk-RGOTJCZU.mjs} +1 -1
  436. package/dist/bin/hook-chunks/{chunk-FZS3XGEA.mjs → chunk-RLKYEL3F.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-LF3S3MYE.mjs → chunk-T2KVL6PZ.mjs} +1 -1
  438. package/dist/bin/hook-chunks/{chunk-NLL5AV2G.mjs → chunk-T7DRHVK3.mjs} +2 -2
  439. package/dist/bin/hook-chunks/{chunk-KV4NXLPT.mjs → chunk-TWFLW6OJ.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-ADYTBOCZ.mjs → chunk-UJIOGFNP.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-Y3RHBU2R.mjs → chunk-UK24P7PV.mjs} +2 -2
  442. package/dist/bin/hook-chunks/{chunk-OLQAMCYV.mjs → chunk-ULNGKZB6.mjs} +5 -5
  443. package/dist/bin/hook-chunks/{chunk-UMJ5D5I6.mjs → chunk-UWHVPO6X.mjs} +2 -2
  444. package/dist/bin/hook-chunks/{chunk-YHOZTAZH.mjs → chunk-V6GGH6H5.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{chunk-EXVL2OFE.mjs → chunk-XC2BSGWF.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{chunk-JZDZH6IV.mjs → chunk-YATXTHDL.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{chunk-DCHIPMOG.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{chunk-PVCEWFHS.mjs → chunk-ZPAY2NSF.mjs} +2 -2
  449. package/dist/bin/hook-chunks/{codex-skill-6CRFUF3A.mjs → codex-skill-BFRU5FTP.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{command-installer-MUHZWDZA.mjs → command-installer-3XOZGKOQ.mjs} +1 -1
  451. package/dist/bin/hook-chunks/{config-manager-2JJPCLKC.mjs → config-manager-UPB7NEXF.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{context7-service-NH4BMGSJ.mjs → context7-service-7VFXEQVN.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{cwd-changed-UTD6Y4MS.mjs → cwd-changed-USNJYUH7.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{distill-5TNAM3LY.mjs → distill-47YVL7IH.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{enriched-recall-6VOIUNLN.mjs → enriched-recall-CVYI52NO.mjs} +1 -1
  456. package/dist/bin/hook-chunks/{format-IIOFTSBF.mjs → format-DPIN45EG.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{judgment-receipt-QLV3MYFT.mjs → judgment-receipt-G2DKQR7U.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{land-cue-57B23PEL.mjs → land-cue-3JD2TXFP.mjs} +1 -1
  459. package/dist/bin/hook-chunks/{land-synthesis-ZVPFJERV.mjs → land-synthesis-5C4KGCTB.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{legacy-crew-sweep-GR6HRSHX.mjs → legacy-crew-sweep-XQNXNZES.mjs} +2 -2
  461. package/dist/bin/hook-chunks/{memory-index-XE2MWKQS.mjs → memory-index-LL6SQJ2N.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{notification-GU2ZJP5K.mjs → notification-ACQBRJG3.mjs} +1 -1
  463. package/dist/bin/hook-chunks/{pack-integrity-WV5U3AFF.mjs → pack-integrity-DCXVRRJZ.mjs} +1 -1
  464. package/dist/bin/hook-chunks/{pack-manager-QLFQKP24.mjs → pack-manager-KYWKNYUY.mjs} +1 -1
  465. package/dist/bin/hook-chunks/{planning-VPAX5DZL.mjs → planning-KOU3XKWS.mjs} +2 -2
  466. package/dist/bin/hook-chunks/{post-edit-UXCFSR3Y.mjs → post-edit-CK2MYQEN.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{pre-bash-MB4JNNYG.mjs → pre-bash-W5A5CTR3.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{pre-commit-U7TRFKWX.mjs → pre-commit-5Q24RM4S.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{pre-edit-MDCQXI5F.mjs → pre-edit-YIJ4BCYL.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{pre-package-A6ZI5R64.mjs → pre-package-O4RMVA4T.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{pre-search-ZZO3LGXJ.mjs → pre-search-WYOWC3D6.mjs} +1 -1
  472. package/dist/bin/hook-chunks/{prjct-md-MS52YLI2.mjs → prjct-md-2UVHFYTJ.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{project-agent-surfaces-6AIW7KL6.mjs → project-agent-surfaces-BKFYUMRV.mjs} +1 -1
  474. package/dist/bin/hook-chunks/{project-memory-UDH56VFP.mjs → project-memory-OC5GTJPY.mjs} +1 -1
  475. package/dist/bin/hook-chunks/{project-style-evolution-IJXT2MCP.mjs → project-style-evolution-2IFJCACQ.mjs} +1 -1
  476. package/dist/bin/hook-chunks/prompt-JIWMP563.mjs +26 -0
  477. package/dist/bin/hook-chunks/{purge-N2WN6NDB.mjs → purge-FQK3Z4QS.mjs} +1 -1
  478. package/dist/bin/hook-chunks/{retention-RET4P2RO.mjs → retention-2FETBJFG.mjs} +1 -1
  479. package/dist/bin/hook-chunks/{sdd-PB6WKSLE.mjs → sdd-V43TSJ2P.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{session-continuity-BIJXMN44.mjs → session-continuity-RO2ACICF.mjs} +1 -1
  481. package/dist/bin/hook-chunks/{session-start-R2VMKW2L.mjs → session-start-FKKFMKQ5.mjs} +1 -1
  482. package/dist/bin/hook-chunks/{setup-PPIZHVXS.mjs → setup-YV2DKG5L.mjs} +2 -2
  483. package/dist/bin/hook-chunks/{shipping-C637PCOF.mjs → shipping-SCNFEXBY.mjs} +4 -4
  484. package/dist/bin/hook-chunks/{spec-context-inference-RTTDOZZO.mjs → spec-context-inference-BD3ANTXA.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{spec-service-ENLAAMVL.mjs → spec-service-OWYOAGXS.mjs} +2 -2
  486. package/dist/bin/hook-chunks/{spec-task-breakdown-RUDEP3AY.mjs → spec-task-breakdown-HOTLUFDM.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{state-storage-AJUPG7J5.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{stop-DPXAWJFN.mjs → stop-MIXT7WXA.mjs} +3 -3
  489. package/dist/bin/hook-chunks/{subagent-start-AFHPXL2S.mjs → subagent-start-NO3TN65K.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{subagent-stop-5BMV63ML.mjs → subagent-stop-CKWIXX7W.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{surface-attribution-EGIKCVMF.mjs → surface-attribution-BYESPLXM.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{task-overview-F3GB77OA.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{task-service-FZABHPFV.mjs → task-service-5ONSBKKP.mjs} +1 -1
  494. package/dist/bin/hook-chunks/{tdd-TAMBOPN3.mjs → tdd-SESB4IG3.mjs} +1 -1
  495. package/dist/bin/hook-chunks/{template-loader-MXOMU4XH.mjs → template-loader-KO67FVHO.mjs} +1 -1
  496. package/dist/bin/hook-chunks/{weak-model-mode-BMSPGEQY.mjs → weak-model-mode-HPXBKXJT.mjs} +1 -1
  497. package/dist/bin/hook-chunks/{work-scope-YCS4GTXW.mjs → work-scope-RNPGACPA.mjs} +1 -1
  498. package/dist/bin/hook-chunks/{workspace-occupancy-JOBYNNXV.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  499. package/dist/bin/prjct-core.mjs +9 -3323
  500. package/dist/bin/prjct-hooks.mjs +1 -1
  501. package/dist/bin/prjct.mjs +7 -1
  502. package/dist/daemon/entry.mjs +591 -582
  503. package/dist/mcp/server.mjs +320 -313
  504. package/package.json +4 -2
  505. package/dist/bin/hook-chunks/chunk-3UB6SFRA.mjs +0 -11
  506. package/dist/bin/hook-chunks/chunk-D7DQABWO.mjs +0 -35
  507. package/dist/bin/hook-chunks/chunk-IWUF2LGO.mjs +0 -18
  508. package/dist/bin/hook-chunks/chunk-M4YM7Z3F.mjs +0 -69
  509. package/dist/bin/hook-chunks/chunk-TB57OYGW.mjs +0 -16
  510. package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +0 -9
  511. package/dist/bin/hook-chunks/prompt-7VZLYONO.mjs +0 -24
@@ -5,6 +5,6 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as S}from"./chunk-ETTDRXQ6.mjs";import{a as m,b as c,c as g}from"./chunk-FZS3XGEA.mjs";import{d as p,g as D}from"./chunk-TKXOMN4K.mjs";import{b as d,c as l,h as b}from"./chunk-A6K4H3YT.mjs";import{a as o}from"./chunk-E66B27AL.mjs";import{z as e}from"zod";var F=e.enum(["feature","fix","improvement","refactor"]),E=e.enum(["pass","warning","fail","skipped"]),_=e.enum(["added","changed","fixed","removed"]),v=e.object({hours:e.number(),minutes:e.number(),totalMinutes:e.number()}),O=e.object({filesChanged:e.number().nullable().optional(),linesAdded:e.number().nullable().optional(),linesRemoved:e.number().nullable().optional(),commits:e.number().nullable().optional()}),A=e.object({description:e.string(),type:_.optional()}),C=e.object({lintStatus:E.nullable().optional(),lintDetails:e.string().optional(),testStatus:E.nullable().optional(),testDetails:e.string().optional()}),T=e.object({hash:e.string().optional(),message:e.string().optional(),branch:e.string().optional()}),I=e.object({id:e.string(),name:e.string(),version:e.string().nullable().optional(),type:F,agent:e.string().optional(),description:e.string().optional(),changes:e.array(A).optional(),codeSnippets:e.array(e.string()).optional(),commit:T.optional(),codeMetrics:O.optional(),qualityMetrics:C.optional(),quantitativeImpact:e.string().optional(),duration:v.optional(),tasksCompleted:e.number().nullable().optional(),shippedAt:e.string(),featureId:e.string().optional()}),y=e.object({shipped:e.array(I),lastUpdated:e.string()});b();D();var f="shipped:backfilled:v1";function r(a){let s={...(()=>{if(!a.data)return{};try{return JSON.parse(a.data)}catch{return{}}})(),id:a.id,name:a.name,shippedAt:a.shipped_at,version:a.version};return a.description!=null&&(s.description=a.description),a.type!=null&&(s.type=a.type),a.duration!=null&&(s.duration=a.duration),s}o(r,"rowToFeature");var u=class extends S{static{o(this,"ShippedStorage")}constructor(){super("shipped.json",y)}getDefault(){return{shipped:[],lastUpdated:""}}getEventType(t){return`shipped.${t}d`}async getAll(t){return p.query(t,"SELECT * FROM shipped_features ORDER BY shipped_at DESC").map(r)}async republishShips(t){if(p.getDoc(t,f))return 0;let s=await this.getAll(t);for(let i of s)await this.publishEvent(t,"shipped_item.created",{id:i.id,shipId:i.id,name:i.name,version:i.version,shippedAt:i.shippedAt});return p.setDoc(t,f,{at:d(),count:s.length}),s.length}async getRecent(t,s=5){return p.query(t,"SELECT * FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",s).map(r)}async addShipped(t,s,i){let n={...s,id:m(),shippedAt:i||d()};if(p.run(t,`INSERT OR IGNORE INTO shipped_features
8
+ import{a as S}from"./chunk-ETTDRXQ6.mjs";import{a as m,b as c,c as g}from"./chunk-RLKYEL3F.mjs";import{d as p,g as D}from"./chunk-TKXOMN4K.mjs";import{b as d,c as l,h as b}from"./chunk-A6K4H3YT.mjs";import{a as o}from"./chunk-E66B27AL.mjs";import{z as e}from"zod";var F=e.enum(["feature","fix","improvement","refactor"]),E=e.enum(["pass","warning","fail","skipped"]),_=e.enum(["added","changed","fixed","removed"]),v=e.object({hours:e.number(),minutes:e.number(),totalMinutes:e.number()}),O=e.object({filesChanged:e.number().nullable().optional(),linesAdded:e.number().nullable().optional(),linesRemoved:e.number().nullable().optional(),commits:e.number().nullable().optional()}),A=e.object({description:e.string(),type:_.optional()}),C=e.object({lintStatus:E.nullable().optional(),lintDetails:e.string().optional(),testStatus:E.nullable().optional(),testDetails:e.string().optional()}),T=e.object({hash:e.string().optional(),message:e.string().optional(),branch:e.string().optional()}),I=e.object({id:e.string(),name:e.string(),version:e.string().nullable().optional(),type:F,agent:e.string().optional(),description:e.string().optional(),changes:e.array(A).optional(),codeSnippets:e.array(e.string()).optional(),commit:T.optional(),codeMetrics:O.optional(),qualityMetrics:C.optional(),quantitativeImpact:e.string().optional(),duration:v.optional(),tasksCompleted:e.number().nullable().optional(),shippedAt:e.string(),featureId:e.string().optional()}),y=e.object({shipped:e.array(I),lastUpdated:e.string()});b();D();var f="shipped:backfilled:v1";function r(a){let s={...(()=>{if(!a.data)return{};try{return JSON.parse(a.data)}catch{return{}}})(),id:a.id,name:a.name,shippedAt:a.shipped_at,version:a.version};return a.description!=null&&(s.description=a.description),a.type!=null&&(s.type=a.type),a.duration!=null&&(s.duration=a.duration),s}o(r,"rowToFeature");var u=class extends S{static{o(this,"ShippedStorage")}constructor(){super("shipped.json",y)}getDefault(){return{shipped:[],lastUpdated:""}}getEventType(t){return`shipped.${t}d`}async getAll(t){return p.query(t,"SELECT * FROM shipped_features ORDER BY shipped_at DESC").map(r)}async republishShips(t){if(p.getDoc(t,f))return 0;let s=await this.getAll(t);for(let i of s)await this.publishEvent(t,"shipped_item.created",{id:i.id,shipId:i.id,name:i.name,version:i.version,shippedAt:i.shippedAt});return p.setDoc(t,f,{at:d(),count:s.length}),s.length}async getRecent(t,s=5){return p.query(t,"SELECT * FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",s).map(r)}async addShipped(t,s,i){let n={...s,id:m(),shippedAt:i||d()};if(p.run(t,`INSERT OR IGNORE INTO shipped_features
9
9
  (id, name, shipped_at, version, description, type, duration, data)
10
10
  VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,n.id,n.name,n.shippedAt,n.version??"",n.description??null,n.type??null,n.duration??null,JSON.stringify(n)).changes===0){let h=p.get(t,"SELECT * FROM shipped_features WHERE name = ? AND version = ? AND shipped_at = ?",n.name,n.version??"",n.shippedAt);return h?r(h):n}return await this.publishEvent(t,"shipped_item.created",{id:n.id,shipId:n.id,name:n.name,version:n.version,shippedAt:n.shippedAt}),n}async getByVersion(t,s){let i=p.get(t,"SELECT * FROM shipped_features WHERE version = ? ORDER BY shipped_at DESC LIMIT 1",s);return i?r(i):void 0}async getCount(t){return p.get(t,"SELECT COUNT(*) AS c FROM shipped_features")?.c??0}async getByDateRange(t,s,i){return p.query(t,"SELECT * FROM shipped_features WHERE shipped_at >= ? AND shipped_at <= ? ORDER BY shipped_at DESC",s.toISOString(),i.toISOString()).map(r)}async getStats(t,s="month"){let i=new Date,n=s==="week"?new Date(i.getTime()-10080*60*1e3):s==="month"?new Date(i.getFullYear(),i.getMonth(),1):new Date(i.getFullYear(),0,1);return{count:(await this.getByDateRange(t,n,i)).length,period:s}}async archiveOldShipped(t){let s=l(c.SHIPPED_RETENTION_DAYS).toISOString(),i=p.query(t,"SELECT * FROM shipped_features WHERE shipped_at < ? ORDER BY shipped_at DESC",s).map(r);return i.length===0?0:(g.archiveMany(t,i.map(n=>({entityType:"shipped",entityId:n.id,entityData:n,summary:`${n.name} v${n.version}`,reason:"age"}))),p.run(t,"DELETE FROM shipped_features WHERE shipped_at < ?",s),await this.publishEvent(t,"shipped.archived",{count:i.length,oldestShippedAt:i[i.length-1]?.shippedAt}),i.length)}},Y=new u;export{Y as a};
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{b as y,c as re,d as se}from"./chunk-JQE2F2RK.mjs";import{a as N,b as te}from"./chunk-WUHGODSQ.mjs";import{g as P,o as V}from"./chunk-UH4MD3F3.mjs";import{b as A,p as ne}from"./chunk-QWQFF2UG.mjs";import{a as D,e as g,f as I}from"./chunk-BUDZL4DW.mjs";import{a as o,b as R}from"./chunk-E66B27AL.mjs";se();te();I();import{constants as ge}from"node:fs";import d from"node:fs/promises";import j from"node:os";import a from"node:path";re();import k from"node:fs/promises";import ue from"node:path";I();V();import m from"node:fs";import M from"node:fs/promises";import _ from"node:os";import p from"node:path";var w="mcp-remote@0.1.38";var E="prjct: agentic harness with project memory, workflow gates, intent briefs, and performance context. Use prjct_task_start as the MCP entrypoint for a work cycle; prjct retrieves focused context, persists evidence stations, and keeps humans in the loop for risky gates. Agents resume from prjct_task_status/workflow output, create or link reviewed intent/spec briefs when required, and persist synthesized learning instead of raw transcript fragments.";function oe(){let e=ie();if(e)return e;if(process.env.PRJCT_MCP_ALLOW_LOCAL==="1"){let t=ce();if(t)return{command:t,args:["mcp-server"],description:E}}return{command:"npx",args:["-y","prjct-cli@latest","mcp-server"],description:E}}o(oe,"getPrjctMcpConfig");function $(e){let t=e.replace(/\\/g,"/");return!!(t.includes("/.worktrees/")||t.includes("/prjct-cli/bin/prjct")&&!t.includes("/node_modules/prjct-cli/"))}o($,"isNonProductionPrjctPath");function ie(){let e=[];try{e.push(p.dirname(R.resolve("prjct-cli/package.json")))}catch{}let t=_.homedir();for(let n of[process.env.NVM_BIN?p.resolve(process.env.NVM_BIN,".."):"",p.join(t,".nvm","versions","node",process.version,"lib"),"/opt/homebrew/lib","/usr/local/lib"].filter(Boolean))e.push(p.join(n,"node_modules","prjct-cli"));for(let n of e){if($(n))continue;let r=p.join(n,"bin","prjct.cjs"),i=m.existsSync(p.join(n,"dist","bin","prjct.mjs"))||m.existsSync(p.join(n,"dist","bin","prjct-core.mjs"));if(!m.existsSync(r)||!i)continue;let c=[process.execPath,p.join(p.dirname(process.execPath),"node"),p.join(n,"..","..","bin","node")].find(x=>x&&m.existsSync(x)),u=p.resolve(n,"..","..","..","bin","node"),f=m.existsSync(u)?u:c??process.execPath;return{command:f,args:[r,"mcp-server"],env:{PATH:`${p.dirname(f)}${p.delimiter}/usr/bin${p.delimiter}/bin`},description:E}}return null}o(ie,"resolvePublishedPrjctMcpConfig");function ce(){let e=process.argv[1],t=[e?p.resolve(p.dirname(e),"prjct"):"",e?p.resolve(p.dirname(e),"..","bin","prjct"):"",p.resolve(process.cwd(),"bin","prjct")].filter(Boolean);for(let n of t){if(!m.existsSync(n))continue;let r=(()=>{try{return m.realpathSync(n)}catch{return n}})();if(!$(r))return r}return null}o(ce,"resolveLocalPrjctBin");function L(){let e=C.prjct;return{...e,env:{...e.env??{},PRJCT_MCP_TOOLS:"lean"}}}o(L,"getPrjctLeanMcpConfig");var C={context7:{command:"npx",args:["-y","@upstash/context7-mcp@latest"],description:"Library documentation lookup"},prjct:oe(),linear:{command:"npx",args:["-y",w,"https://mcp.linear.app/mcp"],description:"Linear MCP server (OAuth)"},jira:{command:"npx",args:["-y",w,"https://mcp.atlassian.com/v1/mcp"],description:"Atlassian MCP server for Jira (OAuth)"}};function S(){return process.env.PRJCT_TEST_MODE==="1"?p.join(_.tmpdir(),"prjct-context7-test","mcp.json"):p.join(_.homedir(),".claude","mcp.json")}o(S,"getClaudeMcpConfigPath");async function J(e=S()){try{let t=await M.readFile(e,"utf-8");return JSON.parse(t)}catch(t){let n=g(t).toLowerCase();if(n.includes("no such file")||n.includes("enoent"))return{};throw new Error(`Failed to read MCP config at ${e}: ${g(t)}`)}}o(J,"readMcpConfig");async function ae(e,t=S()){await P(t,e)}o(ae,"writeMcpConfig");async function Ne(e,t,n=S()){let r=await J(n),i={...r.mcpServers||{}},s=i[e];i[e]=t,r.mcpServers=i;let c=JSON.stringify(s)!==JSON.stringify(t);return await ae(r,n),{path:n,changed:c}}o(Ne,"upsertMcpServer");async function Ae(e,t=S()){return!!(await J(t)).mcpServers?.[e]}o(Ae,"hasMcpServer");function b(e,t,n,r,i){let s=e.indexOf(n),c=e.indexOf(r);if(s!==-1&&c!==-1&&c>s){let u=e.slice(0,s),f=e.slice(c+r.length),x=f.startsWith(`
9
+ `)?f.slice(1):f;return{next:u+t+x}}return new RegExp(`^\\s*\\[mcp_servers\\.${i}\\]`,"m").test(e)?{next:e,skipped:"user-managed"}:e.trim().length>0?{next:`${e.trimEnd()}
10
+
11
+ ${t}`}:{next:t}}o(b,"upsertMarkedBlock");async function T(e,t,n){return n===t?{path:e,changed:!1}:(await M.mkdir(p.dirname(e),{recursive:!0}),await M.writeFile(e,n,"utf-8"),{path:e,changed:!0})}o(T,"writeConfigIfChanged");var F="# prjct:mcp:start - managed by prjct, do not edit between markers",B="# prjct:mcp:end",X="# prjct:mcp:context7:start - managed by prjct, do not edit between markers",H="# prjct:mcp:context7:end",K=["model-with-reasoning","current-dir","git-branch","context-remaining","five-hour-limit","weekly-limit","task-progress"];function v(){return process.env.PRJCT_TEST_MODE==="1"?ue.join(y(".prjct-tests"),"codex","config.toml"):y(".codex","config.toml")}o(v,"getCodexConfigTomlPath");function h(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}o(h,"tomlString");function U(e,t,n,r){let i=(t.args??[]).map(h).join(", "),s=[n,`[mcp_servers.${e}]`,`command = ${h(t.command)}`,`args = [${i}]`];if(t.env&&Object.keys(t.env).length>0){let c=Object.entries(t.env).map(([u,f])=>`${u} = ${h(f)}`).join(", ");s.push(`env = { ${c} }`)}return s.push(r,""),s.join(`
12
+ `)}o(U,"buildMcpTomlBlock");function pe(e=L()){return U("prjct",e,F,B)}o(pe,"buildPrjctMcpTomlBlock");function fe(e=C.context7){return U("context7",e,X,H)}o(fe,"buildContext7McpTomlBlock");function le(){return["[tui]",`status_line = [${K.map(h).join(", ")}]`,""].join(`
13
+ `)}o(le,"buildCodexStatusLineToml");function me(e){return/^\s*(?:tui\.)?status_line\s*=/m.test(e)}o(me,"hasCodexStatusLine");function de(e){if(me(e))return{toml:e,changed:!1};let n=`status_line = [${K.map(h).join(", ")}]
14
+ `,r=/^\s*\[tui\]\s*$/m.exec(e);if(r){let s=r.index+r[0].length,c=e.slice(0,s),u=e.slice(s),f=u.startsWith(`
15
+ `)?u.slice(1):u;return{toml:`${c}
16
+ ${n}${f}`,changed:!0}}let i=le();return{toml:e.trim().length>0?`${e.trimEnd()}
17
+
18
+ ${i}`:i,changed:!0}}o(de,"ensureCodexStatusLineToml");async function Fe(e=v()){let t=await k.readFile(e,"utf-8").catch(()=>""),n=pe(),r=b(t,n,F,B,"prjct"),i=r.skipped,s=de(r.next),c=s.toml,u=await T(e,t,c);return{...u,skipped:i,...u.changed?{statusLineChanged:s.changed}:{}}}o(Fe,"ensureCodexMcpServer");async function q(e=v()){let t=await k.readFile(e,"utf-8").catch(()=>""),n=fe(),{next:r,skipped:i}=b(t,n,X,H,"context7");return{...await T(e,t,r),skipped:i}}o(q,"ensureCodexContext7Server");async function W(e=v()){try{let t=await k.readFile(e,"utf-8");return/^\s*\[mcp_servers\.context7\]/m.test(t)}catch{return!1}}o(W,"codexHasContext7Server");ne();V();function Z(){return process.env.NODE_ENV==="test"?a.join(j.tmpdir(),"prjct-context7-test","verify-cache.json"):a.join(N(),"state","context7-verify.json")}o(Z,"getVerifyCachePath");async function Ce(){try{let e=await d.readFile(Z(),"utf-8"),t=JSON.parse(e);if(typeof t?.at=="number"&&t.status)return{...t,provider:t.provider??"claude"}}catch{}return null}o(Ce,"readPersistedVerify");async function he(e,t,n){let r=Z();try{await d.mkdir(a.dirname(r),{recursive:!0}),await d.writeFile(r,JSON.stringify({at:e,provider:t,status:n}),"utf-8")}catch{}}o(he,"writePersistedVerify");var ee=C.context7,l={value:null},ve=[a.dirname(process.execPath),"/opt/homebrew/bin","/usr/local/bin","/opt/local/bin","/usr/bin","/bin"],xe=[[".bun","bin"],[".local","bin"],[".volta","bin"],[".asdf","shims"],[".local","share","mise","shims"],[".rtx","shims"],[".npm-global","bin"]];async function Y(e){try{return(await d.readdir(e,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>n.name)}catch{return[]}}o(Y,"listChildDirs");async function Pe(e){let t=[],n=process.env.NVM_DIR||a.join(e,".nvm"),r=a.join(n,"versions","node");for(let c of await Y(r))t.push(a.join(r,c,"bin"));let i=process.env.FNM_DIR||a.join(e,".local","share","fnm"),s=a.join(i,"node-versions");for(let c of await Y(s))t.push(a.join(s,c,"installation","bin"));return t}o(Pe,"discoverNodeManagerBinDirs");async function Se(e=process.env.PATH||"",t=j.homedir()){let n=new Set,r=[],i=xe.map(c=>a.join(t,...c)),s=[...ve,...i,...process.env.NVM_BIN?[process.env.NVM_BIN]:[],...process.env.VOLTA_HOME?[a.join(process.env.VOLTA_HOME,"bin")]:[],...process.env.ASDF_DIR?[a.join(process.env.ASDF_DIR,"shims")]:[],...process.env.MISE_DATA_DIR?[a.join(process.env.MISE_DATA_DIR,"shims")]:[],...await Pe(t)];for(let c of[...e.split(a.delimiter),...s]){let u=c.trim();!u||n.has(u)||(n.add(u),r.push(u))}return r.join(a.delimiter)}o(Se,"buildContext7SmokePath");async function je(e,t){if(a.isAbsolute(e)||e.includes(a.sep))return e;let n=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean):[""];for(let r of t.split(a.delimiter))if(r)for(let i of n){let s=a.join(r,e+i);try{return await d.access(s,ge.X_OK),s}catch{}}return e}o(je,"resolveExecutable");function z(){return process.env.PRJCT_CONTEXT7_CONFIG?process.env.PRJCT_CONTEXT7_CONFIG:process.env.NODE_ENV==="test"?a.join(j.tmpdir(),"prjct-context7-test","mcp.json"):a.join(j.homedir(),".claude","mcp.json")}o(z,"getConfigPath");async function Q(e){try{let t=await d.readFile(e,"utf-8");return JSON.parse(t)}catch(t){if(D(t))return{};throw t}}o(Q,"readConfig");async function ye(){if(process.env.PRJCT_SKIP_CONTEXT7_SMOKE==="1"||process.env.NODE_ENV==="test")return;let e=ee,t=[...e.args||[],"--help"],n=await Se(),r=await je(e.command||"npx",n);await A(r,t,{timeout:15e3,env:{...process.env,PATH:n}})}o(ye,"runSmokeCheck");var O=class{static{o(this,"Context7Service")}async install(t="claude"){if(t==="codex")return this.installCodex();if(t!=="claude")return{installed:!1,verified:!1,configPath:"",message:`Context7 auto-config not supported for ${t}; skipping`};let n=z(),r=a.dirname(n);await d.mkdir(r,{recursive:!0});let i=await Q(n),s=i.mcpServers||{},c=ee,u=s.context7;return u&&JSON.stringify(u)===JSON.stringify(c)?{installed:!0,verified:!1,configPath:n,message:"Context7 MCP already configured"}:(s.context7=c,i.mcpServers=s,await P(n,i),l.value=null,{installed:!0,verified:!1,configPath:n,message:"Context7 MCP configured"})}async installCodex(){let t=await q();return t.changed&&(l.value=null),{installed:!0,verified:!1,configPath:t.path,message:t.skipped==="user-managed"?"Context7 MCP user-managed in config.toml":"Context7 MCP configured in config.toml"}}async resolveConfigured(t){if(t==="codex"){let c=v();return await W(c)?{ok:!0,configPath:c}:{ok:!1,configPath:c,message:"Context7 MCP not configured in ~/.codex/config.toml"}}if(t!=="claude")return{ok:!1,configPath:"",message:`Context7 not managed for ${t}`};let n=z(),s=((await Q(n)).mcpServers||{}).context7;return!s?.command||!Array.isArray(s.args)||s.args.length===0?{ok:!1,configPath:n,message:"Context7 MCP not configured in ~/.claude/mcp.json"}:{ok:!0,configPath:n}}async verify(t="claude"){let n=Date.now();if(l.value&&l.value.provider===t&&n-l.value.at<864e5)return l.value.status;let r=await Ce();if(r?.status.verified&&r.provider===t&&n-r.at<864e5)return l.value=r,r.status;let i=await this.resolveConfigured(t);if(!i.ok)return{installed:!1,verified:!1,configPath:i.configPath,message:i.message};try{await ye();let s={installed:!0,verified:!0,configPath:i.configPath};return l.value={at:n,provider:t,status:s},await he(n,t,s),s}catch(s){let c={installed:!0,verified:!1,configPath:i.configPath,message:`Context7 smoke check failed: ${g(s)}`};return l.value={at:n,provider:t,status:c},c}}async ensureReady(t="claude"){await this.install(t);let n=await this.verify(t);if(!n.verified){let r=n.message||"Context7 MCP is required but not ready. Run `prjct start` to repair configuration.";throw new Error(r)}return n}},we=new O,tt=we;export{L as a,C as b,S as c,Ne as d,Ae as e,Fe as f,q as g,Z as h,Se as i,tt as j};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{e as g,f as l}from"./chunk-BUDZL4DW.mjs";import{a as r,c as u,d as f}from"./chunk-E66B27AL.mjs";var m={};f(m,{PACKAGE_ROOT:()=>d,VERSION:()=>R,getPackageRoot:()=>i,getVersion:()=>p,resetPackageRoot:()=>v});import a from"node:fs";import s from"node:path";function i(){if(n.packageRoot)return n.packageRoot;let o=r((e,t)=>{if(t>=5)return null;let c=s.join(e,"package.json");if(a.existsSync(c))try{if(JSON.parse(a.readFileSync(c,"utf-8")).name==="prjct-cli")return e}catch{}return o(s.dirname(e),t+1)},"findPackageRoot");return n.packageRoot=o(__dirname,0)??s.join(__dirname,"..","..",".."),n.packageRoot}function p(){if(n.version)return n.version;let o="3.96.0";if(o&&/^\d+\.\d+\.\d+/.test(o))return n.version=o,n.version;try{let e=s.join(i(),"package.json"),t=JSON.parse(a.readFileSync(e,"utf-8"));return n.version=t.version,n.version}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",g(e)),"0.0.0"}}function v(o){n.packageRoot=o,n.version=null}var n,R,d,P=u(()=>{"use strict";l();n={version:null,packageRoot:null};r(i,"getPackageRoot");r(p,"getVersion");r(v,"resetPackageRoot");R=p(),d=i()});export{p as a,R as b,d as c,m as d,P as e};
8
+ import{e as g,f as l}from"./chunk-BUDZL4DW.mjs";import{a as r,c as u,d as f}from"./chunk-E66B27AL.mjs";var m={};f(m,{PACKAGE_ROOT:()=>d,VERSION:()=>R,getPackageRoot:()=>i,getVersion:()=>p,resetPackageRoot:()=>v});import a from"node:fs";import s from"node:path";function i(){if(n.packageRoot)return n.packageRoot;let o=r((e,t)=>{if(t>=5)return null;let c=s.join(e,"package.json");if(a.existsSync(c))try{if(JSON.parse(a.readFileSync(c,"utf-8")).name==="prjct-cli")return e}catch{}return o(s.dirname(e),t+1)},"findPackageRoot");return n.packageRoot=o(__dirname,0)??s.join(__dirname,"..","..",".."),n.packageRoot}function p(){if(n.version)return n.version;let o="3.98.0";if(o&&/^\d+\.\d+\.\d+/.test(o))return n.version=o,n.version;try{let e=s.join(i(),"package.json"),t=JSON.parse(a.readFileSync(e,"utf-8"));return n.version=t.version,n.version}catch(e){return process.env.PRJCT_DEBUG==="1"&&console.error("Failed to read version from package.json:",g(e)),"0.0.0"}}function v(o){n.packageRoot=o,n.version=null}var n,R,d,P=u(()=>{"use strict";l();n={version:null,packageRoot:null};r(i,"getPackageRoot");r(p,"getVersion");r(v,"resetPackageRoot");R=p(),d=i()});export{p as a,R as b,d as c,m as d,P as e};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as x,c as h}from"./chunk-7PBWIO4K.mjs";import{a as M,h as I}from"./chunk-DXQMKW2B.mjs";import{e as b}from"./chunk-RT2DFIWF.mjs";import{b as S}from"./chunk-PVCEWFHS.mjs";import{a as l,b as D}from"./chunk-TKXOMN4K.mjs";import{b as R}from"./chunk-GCKILEXJ.mjs";import{a as c}from"./chunk-E66B27AL.mjs";D();var F=.92,v=.18;function d(e){let r=new Map,n=[];for(let s of e){r.set(l(s.content),s.id);let o=x(s.content);n.push(Float64Array.from(o))}return{entries:e,fingerprints:r,vectors:n}}c(d,"buildReferenceIndex");function g(e,r,n){if(!r||r.entries.length===0)return{excess:1,maxSim:0,nearestId:null,exactDup:!1,nearDup:!1};let s=l(e),o=r.fingerprints.get(s);if(o&&o!==n)return{excess:0,maxSim:1,nearestId:o,exactDup:!0,nearDup:!0};let f=x(e),a=r.entries.reduce((t,m,_)=>{if(n&&m.id===n)return t;let E=h(f,r.vectors[_]);return E>t.maxSim?{maxSim:E,nearestId:m.id}:t},{maxSim:0,nearestId:null}),i=Math.max(0,Math.min(1,a.maxSim)),u=a.nearestId,p=i>=F;return{excess:p?0:Math.max(0,Math.min(1,1-i)),maxSim:i,nearestId:u,exactDup:!1,nearDup:p}}c(g,"excessAgainstIndex");function L(e,r,n){return g(e,d(r),n)}c(L,"computeExcess");var $=new Set(["decision","gotcha","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","context"]),k=150,N={declared:3,extracted:2,ambiguous:1,inferred:0};function T(e){return e.tags?.context_schema==="living-v2"||e.tags?.synthesis==="model-authored"||e.tags?.synthesis==="deterministic"||e.tags?.source==="land-auto"||e.tags?.capture==="land-v2"}c(T,"isLivingV2");function w(e){return!(!R(e)||e.content.trim().length<40||!$.has(e.type)||e.type==="context"&&!T(e)||e.type==="inbox"||e.type==="todo"||e.type==="idea")}c(w,"isReferenceEligible");function A(e){let r=N[e.provenance]??1,n=e.type==="decision"||e.type==="gotcha"?100:e.type==="learning"||e.type==="fact"?50:e.type==="context"?30:20,s=Date.parse(e.rememberedAt),o=Number.isFinite(s)?s/1e13:0;return n*10+r*3+o}c(A,"referenceRank");function C(e){let r=e.filter(w);return r.sort((n,s)=>A(s)-A(n)),r.slice(0,k)}c(C,"buildReferenceModel");var P=new Set(["decision","gotcha","red-herring","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","shipped"]),j=.28;function Q(e,r,n,s){let o=n.trim();if(o.length===0)return{accept:!1,reason:"empty content"};let f=M(o,r);if(f.junk)return{accept:!1,reason:`junk capture: ${f.reason}`};let a=I(o,r,{force:s?.force==="true"||s?.["precision:force"]==="true"});if(a.action==="refuse")return{accept:!1,reason:`precision: ${a.reason}`};if(a.action==="demote")return{accept:!1,reason:`precision demote\u2192${a.demoteTo??"context"}: ${a.reason}`};let i=b(s?.source);if(P.has(r)&&!i)return{accept:!0,reason:"judgment type \u2014 always accept novel content"};let u=(()=>{try{return S.allEntriesForIndex(e)}catch{return null}})();if(!u)return{accept:!0,reason:"gate skipped (read failure)"};if(u.length===0)return{accept:!0,reason:"empty vault \u2014 seed accepted"};let p=C(u);if(p.length===0)return{accept:!0,reason:"empty reference \u2014 accept"};let y=d(p),t=g(o,y),m=i?j:v;return t.exactDup||t.nearDup||t.excess<m?{accept:!1,reason:t.exactDup?`redundant exact match of ${t.nearestId}`:i?`auto-source low excess ${t.excess.toFixed(2)} (floor ${m}) vs R nearest ${t.nearestId}`:`low excess ${t.excess.toFixed(2)} vs reference (nearest ${t.nearestId}, sim ${t.maxSim.toFixed(2)})`,excess:t.excess,nearestId:t.nearestId}:{accept:!0,reason:i?`auto-source excess ${t.excess.toFixed(2)} above floor`:`excess ${t.excess.toFixed(2)} above capture floor`,excess:t.excess,nearestId:t.nearestId}}c(Q,"captureGate");export{k as a,w as b,C as c,F as d,v as e,d as f,g,L as h,Q as i};
8
+ import{a as x,c as h}from"./chunk-GAJOSSB4.mjs";import{a as M,h as I}from"./chunk-DXQMKW2B.mjs";import{e as b}from"./chunk-QIB6Y6AH.mjs";import{b as S}from"./chunk-ZPAY2NSF.mjs";import{a as l,b as D}from"./chunk-TKXOMN4K.mjs";import{b as R}from"./chunk-GCKILEXJ.mjs";import{a as c}from"./chunk-E66B27AL.mjs";D();var F=.92,v=.18;function d(e){let r=new Map,n=[];for(let s of e){r.set(l(s.content),s.id);let o=x(s.content);n.push(Float64Array.from(o))}return{entries:e,fingerprints:r,vectors:n}}c(d,"buildReferenceIndex");function g(e,r,n){if(!r||r.entries.length===0)return{excess:1,maxSim:0,nearestId:null,exactDup:!1,nearDup:!1};let s=l(e),o=r.fingerprints.get(s);if(o&&o!==n)return{excess:0,maxSim:1,nearestId:o,exactDup:!0,nearDup:!0};let f=x(e),a=r.entries.reduce((t,m,_)=>{if(n&&m.id===n)return t;let E=h(f,r.vectors[_]);return E>t.maxSim?{maxSim:E,nearestId:m.id}:t},{maxSim:0,nearestId:null}),i=Math.max(0,Math.min(1,a.maxSim)),u=a.nearestId,p=i>=F;return{excess:p?0:Math.max(0,Math.min(1,1-i)),maxSim:i,nearestId:u,exactDup:!1,nearDup:p}}c(g,"excessAgainstIndex");function L(e,r,n){return g(e,d(r),n)}c(L,"computeExcess");var $=new Set(["decision","gotcha","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","context"]),k=150,N={declared:3,extracted:2,ambiguous:1,inferred:0};function T(e){return e.tags?.context_schema==="living-v2"||e.tags?.synthesis==="model-authored"||e.tags?.synthesis==="deterministic"||e.tags?.source==="land-auto"||e.tags?.capture==="land-v2"}c(T,"isLivingV2");function w(e){return!(!R(e)||e.content.trim().length<40||!$.has(e.type)||e.type==="context"&&!T(e)||e.type==="inbox"||e.type==="todo"||e.type==="idea")}c(w,"isReferenceEligible");function A(e){let r=N[e.provenance]??1,n=e.type==="decision"||e.type==="gotcha"?100:e.type==="learning"||e.type==="fact"?50:e.type==="context"?30:20,s=Date.parse(e.rememberedAt),o=Number.isFinite(s)?s/1e13:0;return n*10+r*3+o}c(A,"referenceRank");function C(e){let r=e.filter(w);return r.sort((n,s)=>A(s)-A(n)),r.slice(0,k)}c(C,"buildReferenceModel");var P=new Set(["decision","gotcha","red-herring","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","shipped"]),j=.28;function Q(e,r,n,s){let o=n.trim();if(o.length===0)return{accept:!1,reason:"empty content"};let f=M(o,r);if(f.junk)return{accept:!1,reason:`junk capture: ${f.reason}`};let a=I(o,r,{force:s?.force==="true"||s?.["precision:force"]==="true"});if(a.action==="refuse")return{accept:!1,reason:`precision: ${a.reason}`};if(a.action==="demote")return{accept:!1,reason:`precision demote\u2192${a.demoteTo??"context"}: ${a.reason}`};let i=b(s?.source);if(P.has(r)&&!i)return{accept:!0,reason:"judgment type \u2014 always accept novel content"};let u=(()=>{try{return S.allEntriesForIndex(e)}catch{return null}})();if(!u)return{accept:!0,reason:"gate skipped (read failure)"};if(u.length===0)return{accept:!0,reason:"empty vault \u2014 seed accepted"};let p=C(u);if(p.length===0)return{accept:!0,reason:"empty reference \u2014 accept"};let y=d(p),t=g(o,y),m=i?j:v;return t.exactDup||t.nearDup||t.excess<m?{accept:!1,reason:t.exactDup?`redundant exact match of ${t.nearestId}`:i?`auto-source low excess ${t.excess.toFixed(2)} (floor ${m}) vs R nearest ${t.nearestId}`:`low excess ${t.excess.toFixed(2)} vs reference (nearest ${t.nearestId}, sim ${t.maxSim.toFixed(2)})`,excess:t.excess,nearestId:t.nearestId}:{accept:!0,reason:i?`auto-source excess ${t.excess.toFixed(2)} above floor`:`excess ${t.excess.toFixed(2)} above capture floor`,excess:t.excess,nearestId:t.nearestId}}c(Q,"captureGate");export{k as a,w as b,C as c,F as d,v as e,d as f,g,L as h,Q as i};
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{b as d}from"./chunk-PVCEWFHS.mjs";import{c as l}from"./chunk-FZS3XGEA.mjs";import{e as a,g as _}from"./chunk-TKXOMN4K.mjs";import{a as m}from"./chunk-E66B27AL.mjs";_();var E=7,A=90,f=20,T=["pattern-detector","transcript-auto","skill-miss","friction","land-auto","sync-context-quality"];function D(e){return e?T.some(t=>e===t||e.startsWith(`${t}-`)||e.startsWith(t)):!1}m(D,"isAutoSource");function O(e,t=E,o=500){let u=Date.now()-t*864e5;try{let n=a.query(e,`SELECT id FROM memory_entries
8
+ import{b as d}from"./chunk-ZPAY2NSF.mjs";import{c as l}from"./chunk-RLKYEL3F.mjs";import{e as a,g as _}from"./chunk-TKXOMN4K.mjs";import{a as m}from"./chunk-E66B27AL.mjs";_();var E=7,A=90,f=20,T=["pattern-detector","transcript-auto","skill-miss","friction","land-auto","sync-context-quality"];function D(e){return e?T.some(t=>e===t||e.startsWith(`${t}-`)||e.startsWith(t)):!1}m(D,"isAutoSource");function O(e,t=E,o=500){let u=Date.now()-t*864e5;try{let n=a.query(e,`SELECT id FROM memory_entries
9
9
  WHERE deleted_at IS NOT NULL AND deleted_at < ?
10
10
  ORDER BY deleted_at ASC
11
11
  LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM memory_embeddings WHERE memory_id = ?"),r=s.prepare("DELETE FROM memory_entries WHERE id = ?");for(let c of n){try{i.run(c.id)}catch{}r.run(c.id)}}),n.length)}catch{return 0}}m(O,"purgeSoftDeleted");function L(e,t=E,o=500){let u=new Date(Date.now()-t*864e5).toISOString();try{let n=a.query(e,`SELECT e.id FROM events e
@@ -16,4 +16,4 @@ import{b as d}from"./chunk-PVCEWFHS.mjs";import{c as l}from"./chunk-FZS3XGEA.mjs
16
16
  WHERE m.id = 'mem_' || e.id AND m.deleted_at IS NULL
17
17
  )
18
18
  ORDER BY e.id ASC
19
- LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM events WHERE id = ?");for(let r of n)i.run(r.id)}),n.length)}catch{return 0}}m(L,"purgeOrphanRememberEvents");function g(e,t=f){if(t<=0)return 0;let o=[];try{let u=d.allEntriesForIndex(e),n=new Map;for(let s of u){let i=s.tags?.source;if(!D(i))continue;let r=i,c=n.get(r)??[];c.push(s),n.set(r,c)}for(let[,s]of n){if(s.length<=t)continue;s.sort((r,c)=>r.rememberedAt.localeCompare(c.rememberedAt));let i=s.slice(0,s.length-t);for(let r of i){try{l.archive(e,{entityType:"memory_entry",entityId:r.id,entityData:{id:r.id,type:r.type,content:r.content,tags:r.tags,rememberedAt:r.rememberedAt},summary:r.content.slice(0,80),reason:`auto-source-cap (>${t})`})}catch{}d.forget(e,r.id)&&o.push(r)}}}catch{return o.length}return o.length}m(g,"trimAutoSourceCap");function C(e){let t=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NULL")?.c??0,o=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NOT NULL")?.c??0,u=a.get(e,"SELECT COUNT(*) AS c FROM archives")?.c??0,n=a.get(e,"SELECT COUNT(*) AS c FROM events WHERE type >= 'memory.remember.' AND type < 'memory.remember/'")?.c??0,s=(()=>{try{return d.allEntriesForIndex(e).filter(i=>D(i.tags?.source)).length}catch{return 0}})();return{live:t,softDeleted:o,archives:u,rememberEvents:n,autoSourceLive:s}}m(C,"vaultHealth");async function F(e,t={}){let o=t.softDeletedPurgeDays??E,u=t.archivePruneDays??A,n=t.autoSourceMaxLive??f;if(t.dryRun===!0)return{softDeletedPurged:0,orphanEventsPurged:0,archivesPruned:0,autoSourceTrimmed:0,distilledDiscarded:0,digestsWritten:0};let i=await(async()=>{if(t.projectPath)try{let{distillAndDiscardAllAutoSources:p}=await import("./distill-5TNAM3LY.mjs"),y=await p(t.projectPath,e,n);return{distilledDiscarded:y.discarded,digestsWritten:y.digests}}catch{return g(e,n),{distilledDiscarded:0,digestsWritten:0}}else return g(e,n),{distilledDiscarded:0,digestsWritten:0}})(),{distilledDiscarded:r,digestsWritten:c}=i,{eliminateSoftDeletedNoValue:b}=await import("./distill-5TNAM3LY.mjs"),h=b(e,o).purged||O(e,o),S=L(e,o),R=(()=>{try{return l.pruneOldArchives(e,u)}catch{return 0}})();return{softDeletedPurged:h,orphanEventsPurged:S,archivesPruned:R,autoSourceTrimmed:r,distilledDiscarded:r,digestsWritten:c}}m(F,"runVaultPurge");export{E as a,A as b,f as c,T as d,D as e,O as f,L as g,g as h,C as i,F as j};
19
+ LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM events WHERE id = ?");for(let r of n)i.run(r.id)}),n.length)}catch{return 0}}m(L,"purgeOrphanRememberEvents");function g(e,t=f){if(t<=0)return 0;let o=[];try{let u=d.allEntriesForIndex(e),n=new Map;for(let s of u){let i=s.tags?.source;if(!D(i))continue;let r=i,c=n.get(r)??[];c.push(s),n.set(r,c)}for(let[,s]of n){if(s.length<=t)continue;s.sort((r,c)=>r.rememberedAt.localeCompare(c.rememberedAt));let i=s.slice(0,s.length-t);for(let r of i){try{l.archive(e,{entityType:"memory_entry",entityId:r.id,entityData:{id:r.id,type:r.type,content:r.content,tags:r.tags,rememberedAt:r.rememberedAt},summary:r.content.slice(0,80),reason:`auto-source-cap (>${t})`})}catch{}d.forget(e,r.id)&&o.push(r)}}}catch{return o.length}return o.length}m(g,"trimAutoSourceCap");function C(e){let t=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NULL")?.c??0,o=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NOT NULL")?.c??0,u=a.get(e,"SELECT COUNT(*) AS c FROM archives")?.c??0,n=a.get(e,"SELECT COUNT(*) AS c FROM events WHERE type >= 'memory.remember.' AND type < 'memory.remember/'")?.c??0,s=(()=>{try{return d.allEntriesForIndex(e).filter(i=>D(i.tags?.source)).length}catch{return 0}})();return{live:t,softDeleted:o,archives:u,rememberEvents:n,autoSourceLive:s}}m(C,"vaultHealth");async function F(e,t={}){let o=t.softDeletedPurgeDays??E,u=t.archivePruneDays??A,n=t.autoSourceMaxLive??f;if(t.dryRun===!0)return{softDeletedPurged:0,orphanEventsPurged:0,archivesPruned:0,autoSourceTrimmed:0,distilledDiscarded:0,digestsWritten:0};let i=await(async()=>{if(t.projectPath)try{let{distillAndDiscardAllAutoSources:p}=await import("./distill-47YVL7IH.mjs"),y=await p(t.projectPath,e,n);return{distilledDiscarded:y.discarded,digestsWritten:y.digests}}catch{return g(e,n),{distilledDiscarded:0,digestsWritten:0}}else return g(e,n),{distilledDiscarded:0,digestsWritten:0}})(),{distilledDiscarded:r,digestsWritten:c}=i,{eliminateSoftDeletedNoValue:b}=await import("./distill-47YVL7IH.mjs"),h=b(e,o).purged||O(e,o),S=L(e,o),R=(()=>{try{return l.pruneOldArchives(e,u)}catch{return 0}})();return{softDeletedPurged:h,orphanEventsPurged:S,archivesPruned:R,autoSourceTrimmed:r,distilledDiscarded:r,digestsWritten:c}}m(F,"runVaultPurge");export{E as a,A as b,f as c,T as d,D as e,O as f,L as g,g as h,C as i,F as j};
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{c as j}from"./chunk-SWJ7TLBD.mjs";import{n as w}from"./chunk-A6K4H3YT.mjs";import{c as C}from"./chunk-JQE2F2RK.mjs";import{k as r,o as u}from"./chunk-UH4MD3F3.mjs";import{c as A}from"./chunk-EXVL2OFE.mjs";import{b as l,c,d as h,e as d}from"./chunk-SYHDEUVU.mjs";import{c as R,e as b}from"./chunk-IJ523YO2.mjs";import{a as s}from"./chunk-E66B27AL.mjs";u();import a from"node:path";var G=`${h}
8
+ import{c as j}from"./chunk-RGOTJCZU.mjs";import{n as w}from"./chunk-A6K4H3YT.mjs";import{c as C}from"./chunk-JQE2F2RK.mjs";import{k as r,o as u}from"./chunk-UH4MD3F3.mjs";import{c as A}from"./chunk-XC2BSGWF.mjs";import{b as l,c,d as h,e as d}from"./chunk-SYHDEUVU.mjs";import{c as R,e as b}from"./chunk-OALZUWC6.mjs";import{a as s}from"./chunk-E66B27AL.mjs";u();import a from"node:path";var G=`${h}
9
9
  - project facts (stack/commands): see \`PRJCT.md\``,P=`${l}
10
10
  ${G}
11
11
  ${c}
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{b as x}from"./chunk-SJ75V4WG.mjs";import{d as M}from"./chunk-XYKVWO23.mjs";import{b as f}from"./chunk-PVCEWFHS.mjs";import{a as C}from"./chunk-7WO5CEH3.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var q=new Set(["pattern-detector-auto","pattern-detector-recurring","skill-miss-detector","friction-detector"]);function E(t){if(t.type==="improvement-signal")return!0;let e=t.tags?.source;return e!==void 0&&q.has(e)}o(E,"isSignalEntry");var R=85,S=2;async function K(t,e,n={}){let a=n.threshold??R,d=n.maxIterations??S,i=await import("./retention-RET4P2RO.mjs").then(({evaluateRetentionShared:s})=>s(e,Date.now()).byId).catch(()=>null),h=o(async(s,c,g,m)=>{if(s>=d||c.score>=a)return{...c,irrelevantRemoved:g,repairEntriesCreated:m};let r=f.allEntriesForIndex(e),p=r.filter(l=>{if(!w(l))return!1;let b=i?.get(l.id);return!(b&&b.verdict==="active"&&b.score>=70)}),u=I(r)?0:1;u>0&&await f.remember(t,{type:"context",content:_(r,c),tags:{context_schema:"living-v2",synthesis:"model-authored",feature:"context-quality-cleanup",key_data:`quality_score=${c.score}; threshold=${a}; irrelevant=${p.length}`,model:"prjct sync context-quality analyzer",token_usage:"0 deterministic sync tokens",source:"sync-context-quality"},provenance:"inferred",projectId:e});let y=[];for(let l of p)f.forget(e,l.id)&&(y.push(l.id),await C({projectId:e,entityType:"memories",entityId:l.id,eventType:"delete",data:{id:l.id,type:l.type,content:l.content,tags:l.tags,reason:"context-quality-cleanup"}}));let $={...k(e,a),iterations:s+1,irrelevantRemoved:g+y.length,repairEntriesCreated:m+u};return p.length===0&&u===0?$:h(s+1,$,g+y.length,m+u)},"repairIteration");return h(0,k(e,a),0,0)}o(K,"repairContextQuality");function k(t,e=R){let n=f.allEntriesForIndex(t),a=n.filter(r=>r.type==="context"),d=a.filter(v),i=a.filter(r=>!v(r)),h=n.filter(w),s=[],c=[];n.length>0&&d.length===0&&(c.push(35),s.push("missing living-v2 context synthesis")),h.length>0&&(c.push(Math.min(40,h.length*8)),s.push(`${h.length} irrelevant generated entries in active context`)),i.length>0&&(c.push(Math.min(20,i.length*5)),s.push(`${i.length} legacy context entries need cleanup`));let g=d[0];if(g){let r=x(g.content),u=[r.contextSynthesis,r.keyData,r.model,r.tokenUsage,r.nextImplication].filter(y=>!y).length;u>0&&(c.push(u*4),s.push("latest living context is missing structured UI/LLM fields"))}let m=Math.max(0,Math.min(100,100-c.reduce((r,p)=>r+p,0)));return{score:m,threshold:e,passed:m>=e,iterations:0,livingContextCount:d.length,legacyContextCount:i.length,irrelevantRemoved:0,repairEntriesCreated:0,issues:s}}o(k,"evaluateContextQuality");function w(t){return E(t)?!0:t.tags?.source==="sync-context-quality"||t.type!=="context"||v(t)?!1:L(t)}o(w,"isIrrelevantGeneratedContext");function v(t){if(t.tags?.context_schema==="living-v2")return!0;let e=x(t.content);return!!(e.contextSynthesis&&e.keyData)}o(v,"isLivingV2Context");function I(t){return t.some(e=>e.type==="context"&&v(e))}o(I,"hasUsableLivingContext");function L(t){let e=t.content.trim();if(e.length<260||/User pushback:|raw quote|transcript|hot file|skill-miss/i.test(e))return!0;let n=x(e);return[n.whatHappened,n.whyItMattered,n.pattern,n.antiPattern,n.outcome,n.nextImplication].filter(Boolean).length<3}o(L,"isLowValueLegacyContext");function _(t,e){let n=t.filter(i=>!w(i)).filter(i=>["decision","gotcha","learning","context","shipped"].includes(i.type)).slice(0,8),a=n.length>0?n.map(i=>`${i.type}:${M(i)}`).join("; "):"No high-quality prior context survived cleanup.";return["Context synthesis: Sync repaired historical low-quality project context by removing generated telemetry and preserving the useful project knowledge as a living-v2 synthesis. Future agents should trust this synthesized layer over old raw detector rows or legacy context snippets.",`Key data: ${[`quality_score=${e.score}`,`threshold=${e.threshold}`,`legacy_context=${e.legacyContextCount}`,`issues=${e.issues.join("|")||"none"}`].join("; ")}`,"What happened: prjct sync detected that active context quality was below the required threshold and generated a replacement synthesis before deleting irrelevant generated entries.","Why it mattered: Existing users had accumulated low-signal context over time; leaving it active makes the second brain noisy for both the UI and LLM retrieval.","Who/author: prjct sync","Model: prjct sync context-quality analyzer","Token usage: 0 deterministic sync tokens","Sentiment: cleanup required because raw generated context had become product debt","Related files: generated from existing project memory during sync","Feature/domain: context-quality-cleanup","Pattern: Keep structured key data for UI representation and synthesized context for humans/LLMs.","Anti-pattern: Surfacing raw detector rows, hot-file counters, or short legacy snippets as durable project knowledge.","Decision/trap: Generated garbage is hard-deleted from active recall/vault/search; user-authored decisions, gotchas, learnings, and facts are preserved.",`Outcome: Repair synthesis created from surviving highlights: ${a}`,"Next implication: If quality remains below threshold, run full sync/analysis and inspect remaining user-authored entries manually instead of deleting them blindly."].join(" \xB7 ")}o(_,"buildRepairContext");export{K as a,w as b};
8
+ import{b as x}from"./chunk-SJ75V4WG.mjs";import{d as M}from"./chunk-6EHYPQ5U.mjs";import{b as f}from"./chunk-ZPAY2NSF.mjs";import{a as C}from"./chunk-7WO5CEH3.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var q=new Set(["pattern-detector-auto","pattern-detector-recurring","skill-miss-detector","friction-detector"]);function E(t){if(t.type==="improvement-signal")return!0;let e=t.tags?.source;return e!==void 0&&q.has(e)}o(E,"isSignalEntry");var R=85,S=2;async function K(t,e,n={}){let a=n.threshold??R,d=n.maxIterations??S,i=await import("./retention-2FETBJFG.mjs").then(({evaluateRetentionShared:s})=>s(e,Date.now()).byId).catch(()=>null),h=o(async(s,c,g,m)=>{if(s>=d||c.score>=a)return{...c,irrelevantRemoved:g,repairEntriesCreated:m};let r=f.allEntriesForIndex(e),p=r.filter(l=>{if(!w(l))return!1;let b=i?.get(l.id);return!(b&&b.verdict==="active"&&b.score>=70)}),u=I(r)?0:1;u>0&&await f.remember(t,{type:"context",content:_(r,c),tags:{context_schema:"living-v2",synthesis:"model-authored",feature:"context-quality-cleanup",key_data:`quality_score=${c.score}; threshold=${a}; irrelevant=${p.length}`,model:"prjct sync context-quality analyzer",token_usage:"0 deterministic sync tokens",source:"sync-context-quality"},provenance:"inferred",projectId:e});let y=[];for(let l of p)f.forget(e,l.id)&&(y.push(l.id),await C({projectId:e,entityType:"memories",entityId:l.id,eventType:"delete",data:{id:l.id,type:l.type,content:l.content,tags:l.tags,reason:"context-quality-cleanup"}}));let $={...k(e,a),iterations:s+1,irrelevantRemoved:g+y.length,repairEntriesCreated:m+u};return p.length===0&&u===0?$:h(s+1,$,g+y.length,m+u)},"repairIteration");return h(0,k(e,a),0,0)}o(K,"repairContextQuality");function k(t,e=R){let n=f.allEntriesForIndex(t),a=n.filter(r=>r.type==="context"),d=a.filter(v),i=a.filter(r=>!v(r)),h=n.filter(w),s=[],c=[];n.length>0&&d.length===0&&(c.push(35),s.push("missing living-v2 context synthesis")),h.length>0&&(c.push(Math.min(40,h.length*8)),s.push(`${h.length} irrelevant generated entries in active context`)),i.length>0&&(c.push(Math.min(20,i.length*5)),s.push(`${i.length} legacy context entries need cleanup`));let g=d[0];if(g){let r=x(g.content),u=[r.contextSynthesis,r.keyData,r.model,r.tokenUsage,r.nextImplication].filter(y=>!y).length;u>0&&(c.push(u*4),s.push("latest living context is missing structured UI/LLM fields"))}let m=Math.max(0,Math.min(100,100-c.reduce((r,p)=>r+p,0)));return{score:m,threshold:e,passed:m>=e,iterations:0,livingContextCount:d.length,legacyContextCount:i.length,irrelevantRemoved:0,repairEntriesCreated:0,issues:s}}o(k,"evaluateContextQuality");function w(t){return E(t)?!0:t.tags?.source==="sync-context-quality"||t.type!=="context"||v(t)?!1:L(t)}o(w,"isIrrelevantGeneratedContext");function v(t){if(t.tags?.context_schema==="living-v2")return!0;let e=x(t.content);return!!(e.contextSynthesis&&e.keyData)}o(v,"isLivingV2Context");function I(t){return t.some(e=>e.type==="context"&&v(e))}o(I,"hasUsableLivingContext");function L(t){let e=t.content.trim();if(e.length<260||/User pushback:|raw quote|transcript|hot file|skill-miss/i.test(e))return!0;let n=x(e);return[n.whatHappened,n.whyItMattered,n.pattern,n.antiPattern,n.outcome,n.nextImplication].filter(Boolean).length<3}o(L,"isLowValueLegacyContext");function _(t,e){let n=t.filter(i=>!w(i)).filter(i=>["decision","gotcha","learning","context","shipped"].includes(i.type)).slice(0,8),a=n.length>0?n.map(i=>`${i.type}:${M(i)}`).join("; "):"No high-quality prior context survived cleanup.";return["Context synthesis: Sync repaired historical low-quality project context by removing generated telemetry and preserving the useful project knowledge as a living-v2 synthesis. Future agents should trust this synthesized layer over old raw detector rows or legacy context snippets.",`Key data: ${[`quality_score=${e.score}`,`threshold=${e.threshold}`,`legacy_context=${e.legacyContextCount}`,`issues=${e.issues.join("|")||"none"}`].join("; ")}`,"What happened: prjct sync detected that active context quality was below the required threshold and generated a replacement synthesis before deleting irrelevant generated entries.","Why it mattered: Existing users had accumulated low-signal context over time; leaving it active makes the second brain noisy for both the UI and LLM retrieval.","Who/author: prjct sync","Model: prjct sync context-quality analyzer","Token usage: 0 deterministic sync tokens","Sentiment: cleanup required because raw generated context had become product debt","Related files: generated from existing project memory during sync","Feature/domain: context-quality-cleanup","Pattern: Keep structured key data for UI representation and synthesized context for humans/LLMs.","Anti-pattern: Surfacing raw detector rows, hot-file counters, or short legacy snippets as durable project knowledge.","Decision/trap: Generated garbage is hard-deleted from active recall/vault/search; user-authored decisions, gotchas, learnings, and facts are preserved.",`Outcome: Repair synthesis created from surviving highlights: ${a}`,"Next implication: If quality remains below threshold, run full sync/analysis and inspect remaining user-authored entries manually instead of deleting them blindly."].join(" \xB7 ")}o(_,"buildRepairContext");export{K as a,w as b};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{b as s}from"./chunk-MW54MTLB.mjs";import{b as i}from"./chunk-ZZBNFNMG.mjs";import{a as e}from"./chunk-E66B27AL.mjs";function d(t,n){let o=((t??"").trim().split(/\s+/).filter(Boolean)[0]??"").toLowerCase();return!o||o==="status"||o==="show"?{kind:"status"}:n.includes(o)?{kind:"mode",mode:o}:{kind:"unknown",sub:o}}e(d,"parseModeSubcommand");async function m(t,n={}){let r=await i.readConfig(t).catch(()=>null);return r?.projectId?{ok:!0,value:r}:{ok:!1,result:s("No prjct project here \u2014 run `prjct init` first.",n)}}e(m,"requireProjectConfig");export{d as a,m as b};
8
+ import{b as s}from"./chunk-3JOZN7YJ.mjs";import{b as i}from"./chunk-FTBBQHI4.mjs";import{a as e}from"./chunk-E66B27AL.mjs";function d(t,n){let o=((t??"").trim().split(/\s+/).filter(Boolean)[0]??"").toLowerCase();return!o||o==="status"||o==="show"?{kind:"status"}:n.includes(o)?{kind:"mode",mode:o}:{kind:"unknown",sub:o}}e(d,"parseModeSubcommand");async function m(t,n={}){let r=await i.readConfig(t).catch(()=>null);return r?.projectId?{ok:!0,value:r}:{ok:!1,result:s("No prjct project here \u2014 run `prjct init` first.",n)}}e(m,"requireProjectConfig");export{d as a,m as b};
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as y,b as N}from"./chunk-KEJ5RMAI.mjs";import{b as u}from"./chunk-ZZBNFNMG.mjs";import{f as d,h as l,k as m,o as j}from"./chunk-UH4MD3F3.mjs";import{b as f,c as g,d as p,e as k}from"./chunk-SYHDEUVU.mjs";import{a}from"./chunk-E66B27AL.mjs";j();import c from"node:path";var P=[{scriptName:"typecheck",kind:"typecheck"},{scriptName:"lint",kind:"lint"},{scriptName:"test",kind:"test"},{scriptName:"build",kind:"build"},{scriptName:"dev",kind:"dev"},{scriptName:"format",kind:"format"}],A=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];async function R(t){for(let{file:n,manager:e}of A)if(await m(c.join(t,n)))return e;return null}a(R,"detectPackageManager");async function w(t){let n=c.join(t,"package.json");if(!await m(n))return[];let r=(await d(n,null))?.scripts??{};return P.filter(({scriptName:i})=>!!r[i]).map(({scriptName:i,kind:o})=>{let s=r[i];return{scriptName:i,command:s,kind:o,mutating:S(s)}})}a(w,"detectNodeCommands");async function M(t){return await m(c.join(t,"Cargo.toml"))?[{scriptName:"test",command:"cargo test",kind:"test",mutating:!1},{scriptName:"build",command:"cargo build",kind:"build",mutating:!1},{scriptName:"lint",command:"cargo clippy",kind:"lint",mutating:!1},{scriptName:"format",command:"cargo fmt",kind:"format",mutating:!0}]:[]}a(M,"detectCargoCommands");async function _(t){return await m(c.join(t,"go.mod"))?[{scriptName:"test",command:"go test ./...",kind:"test",mutating:!1},{scriptName:"build",command:"go build ./...",kind:"build",mutating:!1},{scriptName:"format",command:"gofmt -l .",kind:"format",mutating:!1}]:[]}a(_,"detectGoCommands");var h=[{marker:/\[tool\.pytest\b/,scriptName:"test",command:"pytest",kind:"test",mutating:!1},{marker:/\[tool\.ruff\b/,scriptName:"lint",command:"ruff check .",kind:"lint",mutating:!1},{marker:/\[tool\.black\b/,scriptName:"format",command:"black .",kind:"format",mutating:!0},{marker:/\[tool\.mypy\b/,scriptName:"typecheck",command:"mypy .",kind:"typecheck",mutating:!1}];async function V(t){let n=c.join(t,"pyproject.toml");if(!await m(n))return[];let e=await l(n,"");return h.filter(({marker:r})=>r.test(e)).map(({marker:r,...i})=>i)}a(V,"detectPythonCommands");async function C(t){let[n,e,r,i,o]=await Promise.all([w(t),M(t),_(t),V(t),R(t)]);return{packageManager:o,commands:[...n,...e,...r,...i]}}a(C,"detectVerifiedCommands");var T=/^(?:--fix|--write|--update|-w|--fix-type)$/,E=new Set(["migrate","push","publish","deploy","release","commit"]);function S(t){for(let n of y(t)){let e=N(n);if(e.some(r=>T.test(r))||e.some(r=>E.has(r.toLowerCase())))return!0}return!1}a(S,"classifyCommandMutation");var x=6,O=3,I=80;function G(t){let n=new Set;return t.filter(e=>n.has(e.kind)?!1:(n.add(e.kind),!0))}a(G,"dedupeByKind");function K(t,n){let e=t.replace(/\s+/g," ").trim();return e.length>n?`${e.slice(0,n-1)}\u2026`:e}a(K,"truncate");async function L(t){try{let n=await u.getProjectId(t),{getActiveProjectStyle:e}=await import("./project-style-evolution-IJXT2MCP.mjs"),r=e(n);if(!r)return null;let i=r.payload.stack,o=[i.ecosystem&&i.ecosystem!=="unknown"?i.ecosystem:null,i.languages.slice(0,O).join(", ")||null,i.frameworks.slice(0,x).join(", ")||null].filter(s=>!!s);return o.length>0?o.join(" \xB7 "):null}catch{return null}}a(L,"buildStackLine");async function b(t){let[n,e]=await Promise.all([L(t),C(t)]),r=G(e.commands);if(!n&&r.length===0)return null;let i=[];n&&i.push(`- stack: ${n}`);for(let o of r){let s=o.mutating?"mutating":"read-only";i.push(`- ${o.kind}: \`${K(o.command,I)}\` (${s})`)}return i.push("- deeper: `prjct context --md` \xB7 `prjct_analysis` MCP \xB7 `prjct_relevant_files` MCP"),i.join(`
8
+ import{a as y,b as N}from"./chunk-KEJ5RMAI.mjs";import{b as u}from"./chunk-FTBBQHI4.mjs";import{f as d,h as l,k as m,o as j}from"./chunk-UH4MD3F3.mjs";import{b as f,c as g,d as p,e as k}from"./chunk-SYHDEUVU.mjs";import{a}from"./chunk-E66B27AL.mjs";j();import c from"node:path";var P=[{scriptName:"typecheck",kind:"typecheck"},{scriptName:"lint",kind:"lint"},{scriptName:"test",kind:"test"},{scriptName:"build",kind:"build"},{scriptName:"dev",kind:"dev"},{scriptName:"format",kind:"format"}],A=[{file:"bun.lock",manager:"bun"},{file:"bun.lockb",manager:"bun"},{file:"pnpm-lock.yaml",manager:"pnpm"},{file:"yarn.lock",manager:"yarn"},{file:"package-lock.json",manager:"npm"}];async function R(t){for(let{file:n,manager:e}of A)if(await m(c.join(t,n)))return e;return null}a(R,"detectPackageManager");async function w(t){let n=c.join(t,"package.json");if(!await m(n))return[];let r=(await d(n,null))?.scripts??{};return P.filter(({scriptName:i})=>!!r[i]).map(({scriptName:i,kind:o})=>{let s=r[i];return{scriptName:i,command:s,kind:o,mutating:S(s)}})}a(w,"detectNodeCommands");async function M(t){return await m(c.join(t,"Cargo.toml"))?[{scriptName:"test",command:"cargo test",kind:"test",mutating:!1},{scriptName:"build",command:"cargo build",kind:"build",mutating:!1},{scriptName:"lint",command:"cargo clippy",kind:"lint",mutating:!1},{scriptName:"format",command:"cargo fmt",kind:"format",mutating:!0}]:[]}a(M,"detectCargoCommands");async function _(t){return await m(c.join(t,"go.mod"))?[{scriptName:"test",command:"go test ./...",kind:"test",mutating:!1},{scriptName:"build",command:"go build ./...",kind:"build",mutating:!1},{scriptName:"format",command:"gofmt -l .",kind:"format",mutating:!1}]:[]}a(_,"detectGoCommands");var h=[{marker:/\[tool\.pytest\b/,scriptName:"test",command:"pytest",kind:"test",mutating:!1},{marker:/\[tool\.ruff\b/,scriptName:"lint",command:"ruff check .",kind:"lint",mutating:!1},{marker:/\[tool\.black\b/,scriptName:"format",command:"black .",kind:"format",mutating:!0},{marker:/\[tool\.mypy\b/,scriptName:"typecheck",command:"mypy .",kind:"typecheck",mutating:!1}];async function V(t){let n=c.join(t,"pyproject.toml");if(!await m(n))return[];let e=await l(n,"");return h.filter(({marker:r})=>r.test(e)).map(({marker:r,...i})=>i)}a(V,"detectPythonCommands");async function C(t){let[n,e,r,i,o]=await Promise.all([w(t),M(t),_(t),V(t),R(t)]);return{packageManager:o,commands:[...n,...e,...r,...i]}}a(C,"detectVerifiedCommands");var T=/^(?:--fix|--write|--update|-w|--fix-type)$/,E=new Set(["migrate","push","publish","deploy","release","commit"]);function S(t){for(let n of y(t)){let e=N(n);if(e.some(r=>T.test(r))||e.some(r=>E.has(r.toLowerCase())))return!0}return!1}a(S,"classifyCommandMutation");var x=6,O=3,I=80;function G(t){let n=new Set;return t.filter(e=>n.has(e.kind)?!1:(n.add(e.kind),!0))}a(G,"dedupeByKind");function K(t,n){let e=t.replace(/\s+/g," ").trim();return e.length>n?`${e.slice(0,n-1)}\u2026`:e}a(K,"truncate");async function L(t){try{let n=await u.getProjectId(t),{getActiveProjectStyle:e}=await import("./project-style-evolution-2IFJCACQ.mjs"),r=e(n);if(!r)return null;let i=r.payload.stack,o=[i.ecosystem&&i.ecosystem!=="unknown"?i.ecosystem:null,i.languages.slice(0,O).join(", ")||null,i.frameworks.slice(0,x).join(", ")||null].filter(s=>!!s);return o.length>0?o.join(" \xB7 "):null}catch{return null}}a(L,"buildStackLine");async function b(t){let[n,e]=await Promise.all([L(t),C(t)]),r=G(e.commands);if(!n&&r.length===0)return null;let i=[];n&&i.push(`- stack: ${n}`);for(let o of r){let s=o.mutating?"mutating":"read-only";i.push(`- ${o.kind}: \`${K(o.command,I)}\` (${s})`)}return i.push("- deeper: `prjct context --md` \xB7 `prjct_analysis` MCP \xB7 `prjct_relevant_files` MCP"),i.join(`
9
9
  `)}a(b,"buildProjectFactsSection");async function $(t){let n=await b(t),e=[p];return n&&e.push("","## This project",n),e.join(`
10
10
  `)}a($,"buildPrjctMdBody");async function J(t){let n=await $(t),e=`${f}
11
11
  ${n}
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{b as u}from"./chunk-7WO5CEH3.mjs";import{d as i,g as T}from"./chunk-TKXOMN4K.mjs";import{b as y,h as _}from"./chunk-A6K4H3YT.mjs";import{a as o}from"./chunk-E66B27AL.mjs";import g from"node:crypto";function E(){return g.randomUUID()}o(E,"generateUUID");_();T();function v(d,t,e){return{id:d,entity_type:t.entityType,entity_id:t.entityId,entity_data:JSON.stringify(t.entityData),summary:t.summary??null,reason:t.reason,archived_at:e,created_at:e}}o(v,"archiveSyncPayload");var l={SHIPPED_RETENTION_DAYS:90,IDEA_DORMANT_DAYS:180,QUEUE_COMPLETED_DAYS:7,PAUSED_TASK_DAYS:30,MEMORY_MAX_ENTRIES:500},h=class{static{o(this,"ArchiveStorage")}archive(t,e){let r=E(),n=y();return i.run(t,"INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)",r,e.entityType,e.entityId,JSON.stringify(e.entityData),e.summary??null,n,e.reason),u({projectId:t,entityType:"archives",entityId:r,eventType:"upsert",data:v(r,e,n)}),r}archiveMany(t,e){if(e.length===0)return 0;let r=y(),n=[];i.transaction(t,a=>{let c=a.prepare("INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)");for(let s of e){let p=E();c.run(p,s.entityType,s.entityId,JSON.stringify(s.entityData),s.summary??null,r,s.reason),n.push({id:p,item:s})}});for(let{id:a,item:c}of n)u({projectId:t,entityType:"archives",entityId:a,eventType:"upsert",data:v(a,c,r)});return e.length}getArchived(t,e,r=50){return e?i.query(t,"SELECT * FROM archives WHERE entity_type = ? ORDER BY archived_at DESC LIMIT ?",e,r):i.query(t,"SELECT * FROM archives ORDER BY archived_at DESC LIMIT ?",r)}getStats(t){let e=i.query(t,"SELECT entity_type, COUNT(*) as count FROM archives GROUP BY entity_type"),r={shipped:0,idea:0,queue_task:0,paused_task:0,memory_entry:0,total:0};for(let n of e){let a=n.entity_type;a in r&&(r[a]=n.count),r.total+=n.count}return r}restore(t,e){let r=i.get(t,"SELECT * FROM archives WHERE id = ?",e);return r?(i.run(t,"DELETE FROM archives WHERE id = ?",e),JSON.parse(r.entity_data)):null}pruneOldArchives(t,e){let r=new Date(Date.now()-e*24*60*60*1e3).toISOString(),n=this.getTotalCount(t);i.run(t,"DELETE FROM archives WHERE archived_at < ?",r);let a=this.getTotalCount(t);return n-a}getTotalCount(t){return i.get(t,"SELECT COUNT(*) as count FROM archives")?.count??0}},I=new h;export{E as a,l as b,I as c};
8
+ import{b as u}from"./chunk-7WO5CEH3.mjs";import{d as i,g as T}from"./chunk-TKXOMN4K.mjs";import{b as y,h as _}from"./chunk-A6K4H3YT.mjs";import{a as o}from"./chunk-E66B27AL.mjs";import g from"node:crypto";function E(){return g.randomUUID()}o(E,"generateUUID");_();T();function v(p,t,e){return{id:p,entity_type:t.entityType,entity_id:t.entityId,entity_data:JSON.stringify(t.entityData),summary:t.summary??null,reason:t.reason,archived_at:e,created_at:e}}o(v,"archiveSyncPayload");var l={SHIPPED_RETENTION_DAYS:90,IDEA_DORMANT_DAYS:180,QUEUE_COMPLETED_DAYS:7,PAUSED_TASK_DAYS:30,MEMORY_MAX_ENTRIES:500},h=class{static{o(this,"ArchiveStorage")}archive(t,e){let r=E(),n=y();return i.run(t,"INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)",r,e.entityType,e.entityId,JSON.stringify(e.entityData),e.summary??null,n,e.reason),u({projectId:t,entityType:"archives",entityId:r,eventType:"upsert",data:v(r,e,n)}),r}archiveMany(t,e){if(e.length===0)return 0;let r=y(),n=[];i.transaction(t,a=>{let c=a.prepare("INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)");for(let s of e){let d=E();c.run(d,s.entityType,s.entityId,JSON.stringify(s.entityData),s.summary??null,r,s.reason),n.push({id:d,item:s})}});for(let{id:a,item:c}of n)u({projectId:t,entityType:"archives",entityId:a,eventType:"upsert",data:v(a,c,r)});return e.length}getArchived(t,e,r=50){return e?i.query(t,"SELECT * FROM archives WHERE entity_type = ? ORDER BY archived_at DESC LIMIT ?",e,r):i.query(t,"SELECT * FROM archives ORDER BY archived_at DESC LIMIT ?",r)}getStats(t){let e=i.query(t,"SELECT entity_type, COUNT(*) as count FROM archives GROUP BY entity_type"),r={shipped:0,idea:0,queue_task:0,paused_task:0,memory_entry:0,workspace_task:0,total:0};for(let n of e){let a=n.entity_type;a in r&&(r[a]=n.count),r.total+=n.count}return r}restore(t,e){let r=i.get(t,"SELECT * FROM archives WHERE id = ?",e);return r?(i.run(t,"DELETE FROM archives WHERE id = ?",e),JSON.parse(r.entity_data)):null}pruneOldArchives(t,e){let r=new Date(Date.now()-e*24*60*60*1e3).toISOString(),n=this.getTotalCount(t);i.run(t,"DELETE FROM archives WHERE archived_at < ?",r);let a=this.getTotalCount(t);return n-a}getTotalCount(t){return i.get(t,"SELECT COUNT(*) as count FROM archives")?.count??0}},I=new h;export{E as a,l as b,I as c};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{c as r,g as o}from"./chunk-NLL5AV2G.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var s=8;function g(t,e,n=s){return o(r(t,e,n).files)}i(g,"rankLikelyFiles");function u(t,e){let n=r(t,e,s);return n.files.length===0?null:n.agentBlock||null}i(u,"buildIndexedFileCue");export{g as a,u as b};
8
+ import{c as r,g as o}from"./chunk-T7DRHVK3.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var s=8;function g(t,e,n=s){return o(r(t,e,n).files)}i(g,"rankLikelyFiles");function u(t,e){let n=r(t,e,s);return n.files.length===0?null:n.agentBlock||null}i(u,"buildIndexedFileCue");export{g as a,u as b};
@@ -5,10 +5,10 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{e as D,g as O,h as v,i as G,j as q}from"./chunk-BKJHD5JI.mjs";import{a as W,b as C}from"./chunk-CPR4FPXG.mjs";import{g as z,k as T}from"./chunk-3HGQPUKG.mjs";import{a as B,e as H}from"./chunk-3CKNJ5RA.mjs";import{c as A}from"./chunk-R4ILCXKE.mjs";import{b as I}from"./chunk-PVCEWFHS.mjs";import{e as w,g as se}from"./chunk-TKXOMN4K.mjs";import{a as L,p as oe}from"./chunk-QWQFF2UG.mjs";import{a as c}from"./chunk-E66B27AL.mjs";se();oe();async function ce(e,t=100){try{let{stdout:r}=await L(`git log --name-only --pretty=format:'---COMMIT---' -${t}`,{cwd:e,maxBuffer:10485760}),n=r.split(`
8
+ import{e as D,g as O,h as v,i as G,j as q}from"./chunk-BKJHD5JI.mjs";import{a as W,b as C}from"./chunk-CPR4FPXG.mjs";import{g as z,k as T}from"./chunk-3HGQPUKG.mjs";import{a as B,e as H}from"./chunk-3CKNJ5RA.mjs";import{c as A}from"./chunk-R4ILCXKE.mjs";import{b as I}from"./chunk-ZPAY2NSF.mjs";import{e as w,g as se}from"./chunk-TKXOMN4K.mjs";import{a as L,p as oe}from"./chunk-QWQFF2UG.mjs";import{a as c}from"./chunk-E66B27AL.mjs";se();oe();async function ce(e,t=100){try{let{stdout:r}=await L(`git log --name-only --pretty=format:'---COMMIT---' -${t}`,{cwd:e,maxBuffer:10485760}),n=r.split(`
9
9
  `).reduce((o,i)=>{let m=i.trim();return m==="---COMMIT---"?(o.currentFiles&&o.currentFiles.size>0&&o.currentFiles.size<=30&&o.commits.push(o.currentFiles),o.currentFiles=new Set):m&&o.currentFiles&&ae(m)&&o.currentFiles.add(m),o},{commits:[],currentFiles:null});return n.currentFiles&&n.currentFiles.size>0&&n.currentFiles.size<=30&&n.commits.push(n.currentFiles),n.commits}catch{return[]}}c(ce,"parseGitLog");function ae(e){return/\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|cs|rb|php|vue|svelte)$/i.test(e)&&!e.includes("node_modules/")}c(ae,"isSourceFile");async function le(e,t=100){let r=await ce(e,t),n=new Map,o=new Map;for(let m of r){let p=Array.from(m);for(let g of p)n.set(g,(n.get(g)||0)+1);for(let[g,f]of p.entries())for(let h of p.slice(g+1)){let d=me(f,h);o.set(d,(o.get(d)||0)+1)}}let i={};for(let[m,p]of o){let[g,f]=m.split("\0"),h=n.get(g)||0,d=n.get(f)||0;if(h<2||d<2)continue;let s=h+d-p,a=s>0?p/s:0;a<.1||(i[g]||(i[g]={}),i[f]||(i[f]={}),i[g][f]=a,i[f][g]=a)}return{matrix:i,commitsAnalyzed:r.length,filesAnalyzed:n.size,builtAt:new Date().toISOString()}}c(le,"buildMatrix");function me(e,t){return e<t?`${e}\0${t}`:`${t}\0${e}`}c(me,"pairKey");function _(e,t){let r=new Set(e),n=new Map;for(let o of e){let i=t.matrix[o];if(i)for(let[m,p]of Object.entries(i)){if(r.has(m))continue;let g=n.get(m)||0;p>g&&n.set(m,p)}}return A(n)}c(_,"scoreFromSeeds");var N="cochange-index",R=new Map;function ge(e,t){w.setDoc(e,N,t),R.delete(e)}c(ge,"saveMatrix");function F(e){let t=w.get(e,"SELECT updated_at FROM kv_store WHERE key = ?",N);if(!t)return R.delete(e),null;let r=R.get(e);if(r&&r.updatedAt===t.updated_at)return r.matrix;let n=w.getDoc(e,N);return n&&R.set(e,{matrix:n,updatedAt:t.updated_at}),n}c(F,"loadMatrix");async function pe(e,t){try{let{stdout:r}=await L(`git rev-list --max-count=${t} HEAD`,{cwd:e,maxBuffer:1048576}),n=r.split(`
10
10
  `).map(o=>o.trim()).filter(Boolean);return n.length>0?n.join(`
11
- `):null}catch{return null}}c(pe,"recentHistoryFingerprint");async function Se(e,t,r=100){let n=await pe(e,r),o=n?F(t):null;if(o?.historyFingerprint===n)return o;let i=await le(e,r);return n&&(i.historyFingerprint=n),ge(t,i),i}c(Se,"indexCoChanges");function E(e){if(e.length===0)return[];let t=e[0]?.score||1;return e.map(r=>({path:r.path,score:r.score/t}))}c(E,"normalize");var M=[{name:"bm25",kind:"query",defaultWeight:.45,hasIndex:c(e=>B(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(H(e,t,r)),"scoreFromQuery")},{name:"symbols",kind:"query",defaultWeight:.2,hasIndex:c(e=>z(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(T(e,t,r)),"scoreFromQuery")},{name:"imports",kind:"seed",defaultWeight:.2,hasIndex:c(e=>C(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t,r)=>{let n=C(e);return n?E(W(t,n,r.importDepth)):[]},"scoreFromSeeds")},{name:"cochange",kind:"seed",defaultWeight:.15,hasIndex:c(e=>F(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t)=>{let r=F(e);return r?E(_(t,r)):[]},"scoreFromSeeds")}];var ue={bm25Weight:.45,importWeight:.2,cochangeWeight:.15,symbolsWeight:.2,topN:15,importDepth:2},Q=10;function U(e,t,r={}){let n={...ue,...r},o={bm25:n.bm25Weight,symbols:n.symbolsWeight,imports:n.importWeight,cochange:n.cochangeWeight},i=M.filter(s=>s.kind==="query"),m=M.filter(s=>s.kind==="seed"),p=new Map,g=new Map;for(let s of i){let a=s.scoreFromQuery(e,t,n.topN*3);if(a.length!==0){p.set(s.name,new Map(a.map(u=>[u.path,u.score])));for(let u of a.slice(0,Q))g.set(u.path,Math.max(g.get(u.path)??0,u.score))}}if(p.size===0)return[];let f=[...g.entries()].sort((s,a)=>a[1]-s[1]).slice(0,Q).map(([s])=>s);for(let s of m){let a=s.scoreFromSeeds(e,f,{importDepth:n.importDepth});a.length!==0&&p.set(s.name,new Map(a.map(u=>[u.path,u.score])))}let h=new Set;for(let s of p.values())for(let a of s.keys())h.add(a);let d=[];for(let s of h){let a=[...p].reduce((u,[l,y])=>{let b=y.get(s)??0,k=o[l]??M.find(S=>S.name===l)?.defaultWeight??0;return u+b*k},0);d.push({path:s,finalScore:a,signals:{bm25:p.get("bm25")?.get(s)??0,imports:p.get("imports")?.get(s)??0,cochange:p.get("cochange")?.get(s)??0,symbols:p.get("symbols")?.get(s)??0}})}return d.sort((s,a)=>a.finalScore-s.finalScore),d.slice(0,n.topN)}c(U,"rankFiles");function K(e){let t={};for(let r of M)t[r.name]=r.hasIndex(e);return{bm25:t.bm25??!1,imports:t.imports??!1,cochange:t.cochange??!1,symbols:t.symbols??!1}}c(K,"hasIndexes");function X(e,t,r=8){let n=t.map(s=>s.trim()).filter(Boolean),o=!!C(e),i=!!F(e),m=new Map;if(n.length>0&&o)try{for(let s of W(n,C(e),2)){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("imports"),m.set(s.path,a)}}catch{}if(n.length>0&&i)try{for(let s of _(n,F(e))){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("cochange"),m.set(s.path,a)}}catch{}let p=[...m.entries()].map(([s,a])=>({path:s,score:a.score,via:a.via.size>1?"both":[...a.via][0]??"imports"})).sort((s,a)=>a.score-s.score).slice(0,r),g=[];for(let s of n.slice(0,5))try{let a=I.recallForFile(e,s,2,{preventiveOnly:!0});for(let u of a)g.push({id:u.id,type:u.type,title:u.content.replace(/\s+/g," ").trim().slice(0,100),file:s})}catch{}let f=p.length>0?`related=${p.slice(0,3).map(s=>s.path.split("/").pop()).join(",")}`:o||i?"related=none-strong":"indexes=cold",h=g.length>0?`traps=${g.length}`:"traps=0",d=n.length===0?"World model: no seed files":`World model impact: seeds=${n.length} \xB7 ${f} \xB7 ${h}`;return{seeds:n,neighbors:p,traps:g.slice(0,r),line:d,hasIndexes:{imports:o,cochange:i}}}c(X,"breakImpact");var J=8,Y=/(?:^|[\s`"'(])((?:@?[\w.-]+\/)+[\w.-]+\.[\w.-]+)(?:$|[\s`"'),;:])/g;function Oe(e,t,r=J){let n=t.trim();if(!n)return re();let o=Z(e,n);return V(e,n,o,r)}c(Oe,"resolveWorkScopeSync");async function Ge(e,t,r,n=J){let o=r.trim();if(!o)return re();let i=new Set(Z(t,o));try{let{enrichedRecall:m}=await import("./enriched-recall-6VOIUNLN.mjs"),p=await m(e,t,{topic:o,types:["context","decision","gotcha","anti-pattern","learning"],limit:12});for(let g of ee(p,t))i.add(g)}catch{}return V(t,o,i,n)}c(Ge,"resolveWorkScope");function V(e,t,r,n){let o=K(e),i=new Map,m=D(e),p=O(e),g=c((l,y,b,k)=>{if(!v(e,l))return;let S=y*G(e,l),x=i.get(l);if(!x){i.set(l,{path:l,score:S,signals:[b],reason:k});return}x.score+=S,x.signals.includes(b)||x.signals.push(b),S>=.4&&(x.reason=k)},"bump");for(let l of r)g(l,fe(l,p),"memory","linked from project judgment memory (decision/gotcha/context)");let f=(()=>{if(!(o.bm25||o.symbols))return[];try{return U(e,t,{topN:Math.max(n*2,12)})}catch{return[]}})();for(let l of f){let y=l.signals.symbols??0,b=[l.signals.bm25>0?"bm25":null,y>0?"symbols":null,l.signals.imports>0?"imports":null,l.signals.cochange>0?"cochange":null].filter(x=>x!==null),k=Math.max(l.signals.bm25,y,l.signals.imports,l.signals.cochange),S=y>=k&&y>0?"matches function/class/route symbols in code graph":l.signals.bm25>=l.signals.imports&&l.signals.bm25>=l.signals.cochange?"matches task terms in code index (BM25)":l.signals.imports>=l.signals.cochange?"import-graph neighbor of matched files":"historically co-changes with matched files";g(l.path,l.finalScore,b[0]??"bm25",S);for(let x of b.slice(1)){let $=i.get(l.path);$&&!$.signals.includes(x)&&$.signals.push(x)}}let h=f.length,d=[...i.keys()].slice(0,5);d.length===0&&r.size>0&&d.push(...[...r].slice(0,5));let s=(()=>{if(d.length===0)return null;try{return X(e,d,n)}catch{return null}})();if(s)for(let l of s.neighbors)g(l.path,.35*Math.min(1,l.score+.1),l.via==="both"?"imports":l.via,l.via==="cochange"?"historically co-changes with seed files":"import-graph neighbor of seed files");let a=s?.neighbors.length??0,u=[...i.values()].sort((l,y)=>y.score-l.score).slice(0,n);return{files:u,indexesReady:o.bm25||o.imports||o.cochange||o.symbols,sources:{memorySeeds:r.size,indexHits:h,graphNeighbors:a},agentBlock:de(u,{indexesReady:o.bm25||o.imports||o.cochange||o.symbols,memorySeeds:r.size,inventoryLine:q(m)})}}c(V,"mergeScope");function Z(e,t){let r=new Set;try{let n=t.split(/\s+/).filter(m=>m.length>2).slice(0,12),o=n.length>0?(()=>{try{return I.searchFts(e,n,15)}catch{return[]}})():[],i=o.length>0?o:I.recall(e,{types:["gotcha","decision","anti-pattern","context"],limit:20});for(let m of ee(i,e))r.add(m)}catch{}return r}c(Z,"memoryFileSeedsSync");function ee(e,t){let r=new Set,n=c(o=>{let i=te(o);i&&(t?v(t,i)&&r.add(i):ne(i)&&r.add(i))},"accept");for(let o of e){let i=o.tags?.file?.trim();i&&n(i);let m=o.tags?.files?.trim();if(m)for(let g of m.split(",")){let f=g.trim();f&&n(f)}let p=o.content??"";Y.lastIndex=0;for(let g of p.matchAll(Y))n(g[1])}return[...r]}c(ee,"extractFilePathsFromEntries");function te(e){return e.replace(/^\.\//,"").replace(/\\/g,"/")}c(te,"normalizePath");function ne(e){let t=te(e).trim();return!t||t.length<3?!1:t.includes("/")&&t.includes(".")}c(ne,"looksLikeRepoPath");function fe(e,t){let r=(e.split("/").pop()??e).toLowerCase(),n=r.includes(".")?`.${r.split(".").pop()}`:"";return r==="package.json"||r==="cargo.toml"||r==="go.mod"?.4:t.size>0&&n&&t.has(n)?e.includes("/")?.9:.75:e.includes("/")&&r.includes(".")?.7:.5}c(fe,"memorySeedWeight");function re(){return{files:[],indexesReady:!1,sources:{memorySeeds:0,indexHits:0,graphNeighbors:0},agentBlock:""}}c(re,"emptyResult");function de(e,t){if(e.length===0)return t?.indexesReady===!1?["**Work scope (prjct):** indexes cold \u2014 run `prjct sync` once, then re-resolve scope.",t.inventoryLine?`_${t.inventoryLine}_`:"","Until then: prefer `prjct search` / `prjct context memory <topic>` over raw Grep/Glob walks."].filter(Boolean).join(`
11
+ `):null}catch{return null}}c(pe,"recentHistoryFingerprint");async function Se(e,t,r=100){let n=await pe(e,r),o=n?F(t):null;if(o?.historyFingerprint===n)return o;let i=await le(e,r);return n&&(i.historyFingerprint=n),ge(t,i),i}c(Se,"indexCoChanges");function E(e){if(e.length===0)return[];let t=e[0]?.score||1;return e.map(r=>({path:r.path,score:r.score/t}))}c(E,"normalize");var M=[{name:"bm25",kind:"query",defaultWeight:.45,hasIndex:c(e=>B(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(H(e,t,r)),"scoreFromQuery")},{name:"symbols",kind:"query",defaultWeight:.2,hasIndex:c(e=>z(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(T(e,t,r)),"scoreFromQuery")},{name:"imports",kind:"seed",defaultWeight:.2,hasIndex:c(e=>C(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t,r)=>{let n=C(e);return n?E(W(t,n,r.importDepth)):[]},"scoreFromSeeds")},{name:"cochange",kind:"seed",defaultWeight:.15,hasIndex:c(e=>F(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t)=>{let r=F(e);return r?E(_(t,r)):[]},"scoreFromSeeds")}];var ue={bm25Weight:.45,importWeight:.2,cochangeWeight:.15,symbolsWeight:.2,topN:15,importDepth:2},Q=10;function U(e,t,r={}){let n={...ue,...r},o={bm25:n.bm25Weight,symbols:n.symbolsWeight,imports:n.importWeight,cochange:n.cochangeWeight},i=M.filter(s=>s.kind==="query"),m=M.filter(s=>s.kind==="seed"),p=new Map,g=new Map;for(let s of i){let a=s.scoreFromQuery(e,t,n.topN*3);if(a.length!==0){p.set(s.name,new Map(a.map(u=>[u.path,u.score])));for(let u of a.slice(0,Q))g.set(u.path,Math.max(g.get(u.path)??0,u.score))}}if(p.size===0)return[];let f=[...g.entries()].sort((s,a)=>a[1]-s[1]).slice(0,Q).map(([s])=>s);for(let s of m){let a=s.scoreFromSeeds(e,f,{importDepth:n.importDepth});a.length!==0&&p.set(s.name,new Map(a.map(u=>[u.path,u.score])))}let h=new Set;for(let s of p.values())for(let a of s.keys())h.add(a);let d=[];for(let s of h){let a=[...p].reduce((u,[l,y])=>{let b=y.get(s)??0,k=o[l]??M.find(S=>S.name===l)?.defaultWeight??0;return u+b*k},0);d.push({path:s,finalScore:a,signals:{bm25:p.get("bm25")?.get(s)??0,imports:p.get("imports")?.get(s)??0,cochange:p.get("cochange")?.get(s)??0,symbols:p.get("symbols")?.get(s)??0}})}return d.sort((s,a)=>a.finalScore-s.finalScore),d.slice(0,n.topN)}c(U,"rankFiles");function K(e){let t={};for(let r of M)t[r.name]=r.hasIndex(e);return{bm25:t.bm25??!1,imports:t.imports??!1,cochange:t.cochange??!1,symbols:t.symbols??!1}}c(K,"hasIndexes");function X(e,t,r=8){let n=t.map(s=>s.trim()).filter(Boolean),o=!!C(e),i=!!F(e),m=new Map;if(n.length>0&&o)try{for(let s of W(n,C(e),2)){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("imports"),m.set(s.path,a)}}catch{}if(n.length>0&&i)try{for(let s of _(n,F(e))){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("cochange"),m.set(s.path,a)}}catch{}let p=[...m.entries()].map(([s,a])=>({path:s,score:a.score,via:a.via.size>1?"both":[...a.via][0]??"imports"})).sort((s,a)=>a.score-s.score).slice(0,r),g=[];for(let s of n.slice(0,5))try{let a=I.recallForFile(e,s,2,{preventiveOnly:!0});for(let u of a)g.push({id:u.id,type:u.type,title:u.content.replace(/\s+/g," ").trim().slice(0,100),file:s})}catch{}let f=p.length>0?`related=${p.slice(0,3).map(s=>s.path.split("/").pop()).join(",")}`:o||i?"related=none-strong":"indexes=cold",h=g.length>0?`traps=${g.length}`:"traps=0",d=n.length===0?"World model: no seed files":`World model impact: seeds=${n.length} \xB7 ${f} \xB7 ${h}`;return{seeds:n,neighbors:p,traps:g.slice(0,r),line:d,hasIndexes:{imports:o,cochange:i}}}c(X,"breakImpact");var J=8,Y=/(?:^|[\s`"'(])((?:@?[\w.-]+\/)+[\w.-]+\.[\w.-]+)(?:$|[\s`"'),;:])/g;function Oe(e,t,r=J){let n=t.trim();if(!n)return re();let o=Z(e,n);return V(e,n,o,r)}c(Oe,"resolveWorkScopeSync");async function Ge(e,t,r,n=J){let o=r.trim();if(!o)return re();let i=new Set(Z(t,o));try{let{enrichedRecall:m}=await import("./enriched-recall-CVYI52NO.mjs"),p=await m(e,t,{topic:o,types:["context","decision","gotcha","anti-pattern","learning"],limit:12});for(let g of ee(p,t))i.add(g)}catch{}return V(t,o,i,n)}c(Ge,"resolveWorkScope");function V(e,t,r,n){let o=K(e),i=new Map,m=D(e),p=O(e),g=c((l,y,b,k)=>{if(!v(e,l))return;let S=y*G(e,l),x=i.get(l);if(!x){i.set(l,{path:l,score:S,signals:[b],reason:k});return}x.score+=S,x.signals.includes(b)||x.signals.push(b),S>=.4&&(x.reason=k)},"bump");for(let l of r)g(l,fe(l,p),"memory","linked from project judgment memory (decision/gotcha/context)");let f=(()=>{if(!(o.bm25||o.symbols))return[];try{return U(e,t,{topN:Math.max(n*2,12)})}catch{return[]}})();for(let l of f){let y=l.signals.symbols??0,b=[l.signals.bm25>0?"bm25":null,y>0?"symbols":null,l.signals.imports>0?"imports":null,l.signals.cochange>0?"cochange":null].filter(x=>x!==null),k=Math.max(l.signals.bm25,y,l.signals.imports,l.signals.cochange),S=y>=k&&y>0?"matches function/class/route symbols in code graph":l.signals.bm25>=l.signals.imports&&l.signals.bm25>=l.signals.cochange?"matches task terms in code index (BM25)":l.signals.imports>=l.signals.cochange?"import-graph neighbor of matched files":"historically co-changes with matched files";g(l.path,l.finalScore,b[0]??"bm25",S);for(let x of b.slice(1)){let $=i.get(l.path);$&&!$.signals.includes(x)&&$.signals.push(x)}}let h=f.length,d=[...i.keys()].slice(0,5);d.length===0&&r.size>0&&d.push(...[...r].slice(0,5));let s=(()=>{if(d.length===0)return null;try{return X(e,d,n)}catch{return null}})();if(s)for(let l of s.neighbors)g(l.path,.35*Math.min(1,l.score+.1),l.via==="both"?"imports":l.via,l.via==="cochange"?"historically co-changes with seed files":"import-graph neighbor of seed files");let a=s?.neighbors.length??0,u=[...i.values()].sort((l,y)=>y.score-l.score).slice(0,n);return{files:u,indexesReady:o.bm25||o.imports||o.cochange||o.symbols,sources:{memorySeeds:r.size,indexHits:h,graphNeighbors:a},agentBlock:de(u,{indexesReady:o.bm25||o.imports||o.cochange||o.symbols,memorySeeds:r.size,inventoryLine:q(m)})}}c(V,"mergeScope");function Z(e,t){let r=new Set;try{let n=t.split(/\s+/).filter(m=>m.length>2).slice(0,12),o=n.length>0?(()=>{try{return I.searchFts(e,n,15)}catch{return[]}})():[],i=o.length>0?o:I.recall(e,{types:["gotcha","decision","anti-pattern","context"],limit:20});for(let m of ee(i,e))r.add(m)}catch{}return r}c(Z,"memoryFileSeedsSync");function ee(e,t){let r=new Set,n=c(o=>{let i=te(o);i&&(t?v(t,i)&&r.add(i):ne(i)&&r.add(i))},"accept");for(let o of e){let i=o.tags?.file?.trim();i&&n(i);let m=o.tags?.files?.trim();if(m)for(let g of m.split(",")){let f=g.trim();f&&n(f)}let p=o.content??"";Y.lastIndex=0;for(let g of p.matchAll(Y))n(g[1])}return[...r]}c(ee,"extractFilePathsFromEntries");function te(e){return e.replace(/^\.\//,"").replace(/\\/g,"/")}c(te,"normalizePath");function ne(e){let t=te(e).trim();return!t||t.length<3?!1:t.includes("/")&&t.includes(".")}c(ne,"looksLikeRepoPath");function fe(e,t){let r=(e.split("/").pop()??e).toLowerCase(),n=r.includes(".")?`.${r.split(".").pop()}`:"";return r==="package.json"||r==="cargo.toml"||r==="go.mod"?.4:t.size>0&&n&&t.has(n)?e.includes("/")?.9:.75:e.includes("/")&&r.includes(".")?.7:.5}c(fe,"memorySeedWeight");function re(){return{files:[],indexesReady:!1,sources:{memorySeeds:0,indexHits:0,graphNeighbors:0},agentBlock:""}}c(re,"emptyResult");function de(e,t){if(e.length===0)return t?.indexesReady===!1?["**Work scope (prjct):** indexes cold \u2014 run `prjct sync` once, then re-resolve scope.",t.inventoryLine?`_${t.inventoryLine}_`:"","Until then: prefer `prjct search` / `prjct context memory <topic>` over raw Grep/Glob walks."].filter(Boolean).join(`
12
12
  `):["**Work scope (prjct):** no high-confidence file hits for this query.",t?.inventoryLine?`_${t.inventoryLine}_`:"","MUST still try `prjct context memory <topic>` + `prjct search` before a broad Grep/Glob walk."].filter(Boolean).join(`
13
13
  `);let r=["**Work scope \u2014 prjct (MUST read before Grep/Glob):**","> Do NOT walk the tree. Open these first. Expand only via `prjct guard <file>` (graph neighbors + traps) or MCP `prjct_relevant_files` / `prjct_impact_analysis`.",...e.map(n=>{let o=n.signals.length>0?` (${n.signals.join("+")})`:"";return`- \`${n.path}\` \u2014 ${n.reason}${o}`})];return t?.memorySeeds&&t.memorySeeds>0&&r.push(`_Seeded from ${t.memorySeeds} memory path hit(s) + code index + graph._`),t?.inventoryLine&&r.push(`_${t.inventoryLine}_`),r.join(`
14
14
  `)}c(de,"formatWorkScopeBlock");function qe(e){return e.map(({path:t,signals:r,reason:n})=>({path:t,signals:r,reason:n}))}c(qe,"toLikelyFileHits");function je(e,t){return t?v(t,e):ne(e)}c(je,"isUsefulScopePath");export{F as a,Se as b,Oe as c,Ge as d,ee as e,de as f,qe as g,je as h};
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{p as j,t as L,u as I}from"./chunk-A6K4H3YT.mjs";import{a as A,b as a,c as S}from"./chunk-JQE2F2RK.mjs";import{i as R,k,o as E}from"./chunk-UH4MD3F3.mjs";import{c as M}from"./chunk-EXVL2OFE.mjs";import{a as O}from"./chunk-SYHDEUVU.mjs";import{d as N,e as G}from"./chunk-IJ523YO2.mjs";import{e as l,f as b}from"./chunk-BUDZL4DW.mjs";import{a as c,e as C}from"./chunk-E66B27AL.mjs";b();E();I();import s from"node:fs/promises";import o from"node:path";import P from"node:fs/promises";import D from"node:path";b();E();var y='<!-- prjct:start - DO NOT REMOVE THIS MARKER -->\n# p/ \u2014 Project knowledge layer\n\nprjct stores project memory (decisions, learnings, gotchas, patterns, ships, analyses) per project in SQLite and serves it to you through tools. **Query it \u2014 don\'t re-read source from scratch.**\n\nprjct remembers and shows the path; it does not own execution. Treat prjct output as durable signals (task state, memories, specs, workflows, risks, recent learnings). Claude, GPT, and other agents decide the concrete HOW with their own native tools and judgment, then persist meaningful outcomes back to prjct.\n\nYou are in a prjct project when `.prjct/` is in cwd OR `~/.prjct-cli/projects/` has an entry for the current path.\n\n## Lookup FIRST, source LAST\n\nBefore reading source code or running broad searches for ANY question about the project (architecture, conventions, decisions, recent ships, bugs, patterns, tech debt, past analyses), QUERY prjct first \u2014 bounded, ranked answers from SQLite, no markdown trees to wade through:\n\n- `prjct context memory <topic>` / `prjct search "<q>"` \u2014 captured decisions, gotchas, learnings, facts\n- `prjct context --md` \u2014 current state: active cycle, ships, recent learnings\n- architecture / conventions / patterns / anti-patterns / tech-debt / insights \u2192 MCP `prjct_analysis` (add `mode:archive` for history)\n- developer preferences \u2192 MCP `prjct_developer`; machine signals \u2192 MCP `prjct_signals`\n- specs \u2192 MCP `prjct_spec_list` / `prjct_spec_get`; per-file traps before editing \u2192 `prjct guard <file>`\n\nOnly fall through to source/repo reading when prjct does not contain the answer.\n\n**Skill \u2260 project identity.** The prjct skill is a portable multi-LLM contract (L0). Live name/stack/branch come from SessionStart + `prjct context --md` for **this cwd**. If skill text and the tree disagree, trust the cwd and the tree.\n\n## Capture analyses BACK to prjct\n\nWhen you complete substantive work \u2014 analysis, decision, learning, gotcha \u2014 persist it: `prjct remember <decision|learning|gotcha|fact> "..."` or `prjct capture "<text>" --tags k:v`. **Author every entry in ENGLISH**, whatever language the user speaks. **Default to capturing \u2014 under-capture is the failure mode that makes prjct useless.** The full verb map and task workflow live in the `prjct` skill.\n\n## Where things live\n\n- Source of truth: SQLite at `~/.prjct-cli/projects/<id>/` (don\'t read directly \u2014 use `prjct` CLI / MCP tools)\n- Project config: `.prjct/prjct.config.json` in repo root\n\n**Auto-managed by prjct-cli** | https://prjct.app\n<!-- prjct:end - DO NOT REMOVE THIS MARKER -->\n';async function v(d){let t=(I(),C(L)),e=d??await t.getActiveProvider(),i=e.name;if(d){if(!e.configDir)return{success:!1,error:`${e.displayName} not detected`,action:"skipped"}}else if(!(await t.detectProvider(i)).installed&&!e.configDir)return{success:!1,error:`${e.displayName} not detected`,action:"skipped"};try{await P.mkdir(e.configDir,{recursive:!0});let n=D.join(e.configDir,e.contextFile),m=await(async()=>{if(i==="claude")return y;let u=M(`global/${e.contextFile}`);if(u)return u;let{PACKAGE_ROOT:g}=(G(),C(N)),T=D.join(g,"templates","global",e.contextFile);return P.readFile(T,"utf-8").catch(()=>i==="gemini"?y.replace(/Claude/g,"Gemini"):y)})(),r=await R(n),p="<!-- prjct-project:start - DO NOT REMOVE THIS MARKER -->",f="<!-- prjct-project:end - DO NOT REMOVE THIS MARKER -->",x=(()=>{if(!r.content.includes(p)||!r.content.includes(f))return r.content;let u=r.content.substring(0,r.content.indexOf(p)),g=r.content.substring(r.content.indexOf(f)+f.length);return`${(u+g).replace(/\n{3,}/g,`
8
+ import{p as j,t as L,u as I}from"./chunk-A6K4H3YT.mjs";import{a as A,b as a,c as S}from"./chunk-JQE2F2RK.mjs";import{i as R,k,o as E}from"./chunk-UH4MD3F3.mjs";import{c as M}from"./chunk-XC2BSGWF.mjs";import{a as O}from"./chunk-SYHDEUVU.mjs";import{d as N,e as G}from"./chunk-OALZUWC6.mjs";import{e as l,f as b}from"./chunk-BUDZL4DW.mjs";import{a as c,e as C}from"./chunk-E66B27AL.mjs";b();E();I();import s from"node:fs/promises";import o from"node:path";import P from"node:fs/promises";import D from"node:path";b();E();var y='<!-- prjct:start - DO NOT REMOVE THIS MARKER -->\n# p/ \u2014 Project knowledge layer\n\nprjct stores project memory (decisions, learnings, gotchas, patterns, ships, analyses) per project in SQLite and serves it to you through tools. **Query it \u2014 don\'t re-read source from scratch.**\n\nprjct remembers and shows the path; it does not own execution. Treat prjct output as durable signals (task state, memories, specs, workflows, risks, recent learnings). Claude, GPT, and other agents decide the concrete HOW with their own native tools and judgment, then persist meaningful outcomes back to prjct.\n\nYou are in a prjct project when `.prjct/` is in cwd OR `~/.prjct-cli/projects/` has an entry for the current path.\n\n## Lookup FIRST, source LAST\n\nBefore reading source code or running broad searches for ANY question about the project (architecture, conventions, decisions, recent ships, bugs, patterns, tech debt, past analyses), QUERY prjct first \u2014 bounded, ranked answers from SQLite, no markdown trees to wade through:\n\n- `prjct context memory <topic>` / `prjct search "<q>"` \u2014 captured decisions, gotchas, learnings, facts\n- `prjct context --md` \u2014 current state: active cycle, ships, recent learnings\n- architecture / conventions / patterns / anti-patterns / tech-debt / insights \u2192 MCP `prjct_analysis` (add `mode:archive` for history)\n- developer preferences \u2192 MCP `prjct_developer`; machine signals \u2192 MCP `prjct_signals`\n- specs \u2192 MCP `prjct_spec_list` / `prjct_spec_get`; per-file traps before editing \u2192 `prjct guard <file>`\n\nOnly fall through to source/repo reading when prjct does not contain the answer.\n\n**Skill \u2260 project identity.** The prjct skill is a portable multi-LLM contract (L0). Live name/stack/branch come from SessionStart + `prjct context --md` for **this cwd**. If skill text and the tree disagree, trust the cwd and the tree.\n\n## Capture analyses BACK to prjct\n\nWhen you complete substantive work \u2014 analysis, decision, learning, gotcha \u2014 persist it: `prjct remember <decision|learning|gotcha|fact> "..."` or `prjct capture "<text>" --tags k:v`. **Author every entry in ENGLISH**, whatever language the user speaks. **Default to capturing \u2014 under-capture is the failure mode that makes prjct useless.** The full verb map and task workflow live in the `prjct` skill.\n\n## Where things live\n\n- Source of truth: SQLite at `~/.prjct-cli/projects/<id>/` (don\'t read directly \u2014 use `prjct` CLI / MCP tools)\n- Project config: `.prjct/prjct.config.json` in repo root\n\n**Auto-managed by prjct-cli** | https://prjct.app\n<!-- prjct:end - DO NOT REMOVE THIS MARKER -->\n';async function v(d){let t=(I(),C(L)),e=d??await t.getActiveProvider(),i=e.name;if(d){if(!e.configDir)return{success:!1,error:`${e.displayName} not detected`,action:"skipped"}}else if(!(await t.detectProvider(i)).installed&&!e.configDir)return{success:!1,error:`${e.displayName} not detected`,action:"skipped"};try{await P.mkdir(e.configDir,{recursive:!0});let n=D.join(e.configDir,e.contextFile),m=await(async()=>{if(i==="claude")return y;let u=M(`global/${e.contextFile}`);if(u)return u;let{PACKAGE_ROOT:g}=(G(),C(N)),T=D.join(g,"templates","global",e.contextFile);return P.readFile(T,"utf-8").catch(()=>i==="gemini"?y.replace(/Claude/g,"Gemini"):y)})(),r=await R(n),p="<!-- prjct-project:start - DO NOT REMOVE THIS MARKER -->",f="<!-- prjct-project:end - DO NOT REMOVE THIS MARKER -->",x=(()=>{if(!r.content.includes(p)||!r.content.includes(f))return r.content;let u=r.content.substring(0,r.content.indexOf(p)),g=r.content.substring(r.content.indexOf(f)+f.length);return`${(u+g).replace(/\n{3,}/g,`
9
9
 
10
10
  `).trim()}
11
11
  `})(),h=O(r.exists?x:"",m,"<!-- prjct:start - DO NOT REMOVE THIS MARKER -->","<!-- prjct:end - DO NOT REMOVE THIS MARKER -->");return r.exists&&r.content===h.content?{success:!0,action:"unchanged",path:n}:(await P.writeFile(n,h.content,"utf-8"),{success:!0,action:h.action,path:n})}catch(n){return{success:!1,error:l(n),action:"failed"}}}c(v,"installGlobalConfig");S();async function rt(d){return v(d)}c(rt,"installGlobalConfig");var w=class{static{c(this,"CommandInstaller")}commandsPath="";configPath="";_initialized=!1;async ensureInit(t){if(this._initialized)return;let e=t??await j();this.configPath=e.configDir??"",this.commandsPath=this.configPath?o.join(this.configPath,"commands"):"",this._initialized=!0}async detectActiveProvider(t){return await this.ensureInit(t),k(this.configPath)}async installCommands(){let t=await this.detectActiveProvider(),e=await j();return t?(await this.cleanupRouter(),{success:!0,installed:[],path:this.commandsPath}):{success:!1,error:`${e.displayName} not detected. Please install it first.`}}async uninstallCommands(){try{let t=[];await this.ensureInit();for(let e of["p.md","p.toml"]){let i=o.join(this.commandsPath,e);try{await s.unlink(i),t.push(e)}catch(n){if(n.code!=="ENOENT")return{success:!1,error:l(n)}}}return{success:!0,uninstalled:t}}catch(t){return{success:!1,error:l(t)}}}async checkInstallation(){return await this.detectActiveProvider()?{installed:!0,providerDetected:!0,commands:[],path:this.commandsPath}:{installed:!1,providerDetected:!1}}async getInstallPath(){return await this.ensureInit(),this.commandsPath}async syncCommands(t){if(!await this.detectActiveProvider(t))return{success:!1,error:"AI agent not detected",added:0,updated:0,removed:0};try{return{success:!0,added:0,updated:0,removed:await this.cleanupRouter()?1:0}}catch(i){return{success:!1,error:l(i),added:0,updated:0,removed:0}}}async cleanupRouter(){return await this.ensureInit(),(await Promise.all(["p.md","p.toml"].map(async e=>{try{return await s.unlink(o.join(this.commandsPath,e)),!0}catch{return!1}}))).some(Boolean)}async cleanupLegacyCommands(){await this.ensureInit();let t=o.join(this.commandsPath,"p");try{if((await s.stat(t).catch(()=>null))?.isDirectory())return await s.rm(t,{recursive:!0,force:!0}),!0}catch{}return!1}async installGlobalConfig(t){return v(t)}async cleanupAllLegacy(){let t=A(),e=[],i=[o.join(t,".claude","commands","p.md"),o.join(t,".claude","commands","p.toml"),o.join(t,".gemini","commands","p.md"),o.join(t,".gemini","commands","p.toml")];for(let r of i)try{await s.unlink(r),e.push(r)}catch{}let n=[o.join(t,".claude","commands","p"),o.join(t,".gemini","commands","p")];for(let r of n)try{(await s.stat(r).catch(()=>null))?.isDirectory()&&(await s.rm(r,{recursive:!0,force:!0}),e.push(r))}catch{}let m=[o.join(t,".prjct-cli","config","homebrew-migrated")];for(let r of m)try{await s.unlink(r),e.push(r)}catch{}return{cleaned:e}}};function nt(){return{claude:{commands:a(".claude","commands"),config:a(".claude"),router:a(".claude","commands","p.md")},gemini:{commands:a(".gemini","commands"),config:a(".gemini"),router:a(".gemini","commands","p.toml")}}}c(nt,"getProviderPaths");var _=new w,ot=_;export{rt as a,w as b,nt as c,ot as d};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{c as t}from"./chunk-TF6PN7IB.mjs";import{a as e}from"./chunk-E66B27AL.mjs";async function f(r,o,i){if(i.length!==0)try{let{resolveActiveTask:s}=await import("./task-service-FZABHPFV.mjs"),c=await s(r,o);c?.id&&t.recordSurfaced(r,i,c.id);for(let n of i)t.recordFetch(r,n)}catch{}}e(f,"recordSurfacedForActiveTask");export{f as a};
8
+ import{c as t}from"./chunk-TF6PN7IB.mjs";import{a as e}from"./chunk-E66B27AL.mjs";async function f(r,o,i){if(i.length!==0)try{let{resolveActiveTask:s}=await import("./task-service-5ONSBKKP.mjs"),c=await s(r,o);c?.id&&t.recordSurfaced(r,i,c.id);for(let n of i)t.recordFetch(r,n)}catch{}}e(f,"recordSurfacedForActiveTask");export{f as a};
@@ -5,9 +5,9 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{b as u}from"./chunk-3FBCOCPD.mjs";import{a as N,b as f}from"./chunk-ZZBNFNMG.mjs";import{q as E,u as _,v as T,w as S}from"./chunk-A6K4H3YT.mjs";import{n as I,o as P}from"./chunk-UH4MD3F3.mjs";import{a as A}from"./chunk-PKDYFXMI.mjs";import{a as y,e as $,f as O}from"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import i from"chalk";_();import m from"chalk";var j=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],x=80,v={name:"prjct",icon:"\u26A1",signature:"\u26A1 prjct",spinner:{frames:j,speed:x},cli:{header:c(()=>`${m.cyan.bold("\u26A1")} ${m.cyan("prjct")}`,"header"),footer:c(()=>m.dim("\u26A1 prjct"),"footer"),spin:c((e,t)=>`${m.cyan("\u26A1")} ${m.cyan("prjct")} ${m.cyan(j[e%10])} ${m.dim(t||"")}`,"spin")},template:{header:"\u26A1 prjct",footer:"\u26A1 prjct"},commitFooter:"Generated with [p/](https://www.prjct.app/)",urls:{website:"https://prjct.app",docs:"https://prjct.app/docs"},getCommitFooter:c((e="claude")=>E(e).commitFooter,"getCommitFooter"),getSignature:c((e="claude")=>E(e).signature,"getSignature")},l=v;var w={NO_PROJECT:{message:"No prjct project found in this directory",hint:"Run 'prjct init' to set up a new project",file:".prjct/prjct.config.json"},NO_PROJECT_ID:{message:"Project ID not found",hint:"Run 'prjct init' or check .prjct/prjct.config.json",file:".prjct/prjct.config.json"},CONFIG_NOT_FOUND:{message:"Configuration file not found",hint:"Run 'prjct init' to create project configuration",file:".prjct/prjct.config.json"},CONFIG_INVALID:{message:"Invalid configuration file",hint:"Check JSON syntax or delete .prjct/ and run init again",file:".prjct/prjct.config.json"},GIT_NOT_FOUND:{message:"Git repository not detected",hint:"Run 'git init' first, then 'prjct init'"},GIT_NO_COMMITS:{message:"No commits in repository",hint:"Make an initial commit before using prjct"},GIT_DIRTY:{message:"Working directory has uncommitted changes",hint:"Commit or stash changes, or use '--force' to override"},GIT_ON_MAIN:{message:"Cannot ship from main/master branch",hint:"Create a feature branch first: git checkout -b feature/your-feature"},GIT_OPERATION_FAILED:{message:"Git operation failed",hint:"Check git status and resolve any conflicts"},GH_NOT_AUTHENTICATED:{message:"GitHub CLI not authenticated",hint:"Run 'gh auth login' to authenticate",docs:"https://cli.github.com/manual/gh_auth_login"},LINEAR_NOT_CONFIGURED:{message:"Linear integration not configured",hint:"Configure the Linear MCP server in your AI client"},LINEAR_API_ERROR:{message:"Linear API error",hint:"Check your API key or network connection"},NO_ACTIVE_TASK:{message:"No active work cycle",hint:`Start work with 'p. work "intent"'`},TASK_ALREADY_ACTIVE:{message:"A work cycle is already in progress",hint:"Use 'p. work' to inspect it or ship when complete"},SYNC_FAILED:{message:"Project sync failed",hint:"Check file permissions and try again"},NOTHING_TO_SHIP:{message:"Nothing to ship",hint:"Make some changes first, then run ship"},PR_CREATE_FAILED:{message:"Failed to create pull request",hint:"Check GitHub auth and remote configuration"},NO_AI_PROVIDER:{message:"No AI provider detected",hint:"Install Claude Code or Gemini CLI, then run 'prjct start'",docs:"https://prjct.app/docs"},PROVIDER_NOT_CONFIGURED:{message:"AI provider not configured for prjct",hint:"Run 'prjct start' to configure your provider"},UNKNOWN_COMMAND:{message:"Unknown command",hint:"Run 'prjct --help' to see available commands"},MISSING_PARAM:{message:"Missing required parameter",hint:"Check command usage below"},UNKNOWN:{message:"An unexpected error occurred",hint:"Check the error details and try again"}};function R(e,t){return{...w[e],...t}}c(R,"getError");var b=l.spinner.speed,L={silent:{maxLines:0,maxCharsPerLine:0,showMetrics:!1},minimal:{maxLines:1,maxCharsPerLine:65,showMetrics:!1},compact:{maxLines:4,maxCharsPerLine:80,showMetrics:!0},verbose:{maxLines:1/0,maxCharsPerLine:1/0,showMetrics:!0}},s={currentTier:"compact",interval:null,frame:0,quietMode:!1};function k(){return L[s.currentTier]}c(k,"getTierConfig");var h={success:i.green("\u2713"),fail:i.red("\u2717"),warn:i.yellow("\u26A0"),info:i.blue("\u2139"),debug:i.dim("\u{1F527}"),bullet:i.dim("\u2022"),arrow:i.dim("\u2192"),check:i.green("\u2713"),cross:i.red("\u2717"),spinner:i.cyan("\u25D0")};var g=c((e,t)=>{if(!process.stdout.isTTY&&!process.stderr.isTTY)return e||"";let r=t??(k().maxCharsPerLine||u.FALLBACK_TRUNCATE);return e&&e.length>r?`${e.slice(0,r-1)}\u2026`:e||""},"truncate");var G=c(()=>process.stdout.isTTY?process.stdout.write(`\r${" ".repeat(u.CLEAR_WIDTH)}\r`):!0,"clear"),D={start(){return s.quietMode||console.log(l.cli.header()),this},end(){return s.quietMode||console.log(l.cli.footer()),this},spin(e){return s.quietMode?this:(this.stop(),process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,g(e,u.SPINNER_MSG))}`)},b),this):(process.stdout.write(`${l.cli.spin(0,g(e,u.SPINNER_MSG))}
8
+ import{b as u}from"./chunk-3FBCOCPD.mjs";import{a as N,b as f}from"./chunk-FTBBQHI4.mjs";import{q as E,u as _,v as T,w as S}from"./chunk-A6K4H3YT.mjs";import{n as I,o as P}from"./chunk-UH4MD3F3.mjs";import{a as A}from"./chunk-PKDYFXMI.mjs";import{a as y,e as $,f as O}from"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import i from"chalk";_();import m from"chalk";var j=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],x=80,v={name:"prjct",icon:"\u26A1",signature:"\u26A1 prjct",spinner:{frames:j,speed:x},cli:{header:c(()=>`${m.cyan.bold("\u26A1")} ${m.cyan("prjct")}`,"header"),footer:c(()=>m.dim("\u26A1 prjct"),"footer"),spin:c((e,t)=>`${m.cyan("\u26A1")} ${m.cyan("prjct")} ${m.cyan(j[e%10])} ${m.dim(t||"")}`,"spin")},template:{header:"\u26A1 prjct",footer:"\u26A1 prjct"},commitFooter:"Generated with [p/](https://www.prjct.app/)",urls:{website:"https://prjct.app",docs:"https://prjct.app/docs"},getCommitFooter:c((e="claude")=>E(e).commitFooter,"getCommitFooter"),getSignature:c((e="claude")=>E(e).signature,"getSignature")},l=v;var w={NO_PROJECT:{message:"No prjct project found in this directory",hint:"Run 'prjct init' to set up a new project",file:".prjct/prjct.config.json"},NO_PROJECT_ID:{message:"Project ID not found",hint:"Run 'prjct init' or check .prjct/prjct.config.json",file:".prjct/prjct.config.json"},CONFIG_NOT_FOUND:{message:"Configuration file not found",hint:"Run 'prjct init' to create project configuration",file:".prjct/prjct.config.json"},CONFIG_INVALID:{message:"Invalid configuration file",hint:"Check JSON syntax or delete .prjct/ and run init again",file:".prjct/prjct.config.json"},GIT_NOT_FOUND:{message:"Git repository not detected",hint:"Run 'git init' first, then 'prjct init'"},GIT_NO_COMMITS:{message:"No commits in repository",hint:"Make an initial commit before using prjct"},GIT_DIRTY:{message:"Working directory has uncommitted changes",hint:"Commit or stash changes, or use '--force' to override"},GIT_ON_MAIN:{message:"Cannot ship from main/master branch",hint:"Create a feature branch first: git checkout -b feature/your-feature"},GIT_OPERATION_FAILED:{message:"Git operation failed",hint:"Check git status and resolve any conflicts"},GH_NOT_AUTHENTICATED:{message:"GitHub CLI not authenticated",hint:"Run 'gh auth login' to authenticate",docs:"https://cli.github.com/manual/gh_auth_login"},LINEAR_NOT_CONFIGURED:{message:"Linear integration not configured",hint:"Configure the Linear MCP server in your AI client"},LINEAR_API_ERROR:{message:"Linear API error",hint:"Check your API key or network connection"},NO_ACTIVE_TASK:{message:"No active work cycle",hint:`Start work with 'p. work "intent"'`},TASK_ALREADY_ACTIVE:{message:"A work cycle is already in progress",hint:"Use 'p. work' to inspect it or ship when complete"},SYNC_FAILED:{message:"Project sync failed",hint:"Check file permissions and try again"},NOTHING_TO_SHIP:{message:"Nothing to ship",hint:"Make some changes first, then run ship"},PR_CREATE_FAILED:{message:"Failed to create pull request",hint:"Check GitHub auth and remote configuration"},NO_AI_PROVIDER:{message:"No AI provider detected",hint:"Install Claude Code or Gemini CLI, then run 'prjct start'",docs:"https://prjct.app/docs"},PROVIDER_NOT_CONFIGURED:{message:"AI provider not configured for prjct",hint:"Run 'prjct start' to configure your provider"},UNKNOWN_COMMAND:{message:"Unknown command",hint:"Run 'prjct --help' to see available commands"},MISSING_PARAM:{message:"Missing required parameter",hint:"Check command usage below"},UNKNOWN:{message:"An unexpected error occurred",hint:"Check the error details and try again"}};function R(e,t){return{...w[e],...t}}c(R,"getError");var b=l.spinner.speed,L={silent:{maxLines:0,maxCharsPerLine:0,showMetrics:!1},minimal:{maxLines:1,maxCharsPerLine:65,showMetrics:!1},compact:{maxLines:4,maxCharsPerLine:80,showMetrics:!0},verbose:{maxLines:1/0,maxCharsPerLine:1/0,showMetrics:!0}},s={currentTier:"compact",interval:null,frame:0,quietMode:!1};function k(){return L[s.currentTier]}c(k,"getTierConfig");var h={success:i.green("\u2713"),fail:i.red("\u2717"),warn:i.yellow("\u26A0"),info:i.blue("\u2139"),debug:i.dim("\u{1F527}"),bullet:i.dim("\u2022"),arrow:i.dim("\u2192"),check:i.green("\u2713"),cross:i.red("\u2717"),spinner:i.cyan("\u25D0")};var g=c((e,t)=>{if(!process.stdout.isTTY&&!process.stderr.isTTY)return e||"";let r=t??(k().maxCharsPerLine||u.FALLBACK_TRUNCATE);return e&&e.length>r?`${e.slice(0,r-1)}\u2026`:e||""},"truncate");var G=c(()=>process.stdout.isTTY?process.stdout.write(`\r${" ".repeat(u.CLEAR_WIDTH)}\r`):!0,"clear"),D={start(){return s.quietMode||console.log(l.cli.header()),this},end(){return s.quietMode||console.log(l.cli.footer()),this},spin(e){return s.quietMode?this:(this.stop(),process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,g(e,u.SPINNER_MSG))}`)},b),this):(process.stdout.write(`${l.cli.spin(0,g(e,u.SPINNER_MSG))}
9
9
  `),this))},done(e,t){if(this.stop(),!s.quietMode){let r=[];t?.agents!==void 0&&r.push(`${t.agents}a`),t?.reduction!==void 0&&r.push(`${t.reduction}%`),t?.tokens!==void 0&&r.push(`${Math.round(t.tokens)}K`);let o=r.length>0?i.dim(` [${r.join(" | ")}]`):"";console.log(`${h.success} ${g(e,u.DONE_MSG)}${o}`)}return this},fail(e){return this.stop(),console.error(`${h.fail} ${g(e,u.FAIL_MSG)}`),this},failWithHint(e){this.stop();let t=typeof e=="string"?R(e):e;return console.error(),console.error(`${h.fail} ${t.message}`),t.file&&console.error(i.dim(` File: ${t.file}`)),t.hint&&console.error(i.yellow(` \u{1F4A1} ${t.hint}`)),t.docs&&console.error(i.dim(` Docs: ${t.docs}`)),console.error(),this},warn(e){return this.stop(),s.quietMode||console.log(`${h.warn} ${g(e,u.WARN_MSG)}`),this},info(e){return this.stop(),s.quietMode||console.log(`${h.info} ${e}`),this},debug(e){this.stop();let t=process.env.DEBUG==="1"||process.env.DEBUG==="true";return!s.quietMode&&t&&console.log(`${h.debug} ${i.dim(e)}`),this},success(e,t){return this.done(e,t)},list(e,t={}){if(this.stop(),s.quietMode)return this;let r=t.bullet||h.bullet,o=" ".repeat(t.indent||0);for(let n of e)console.log(`${o}${r} ${n}`);return this},table(e,t={}){if(this.stop(),s.quietMode||e.length===0)return this;let r=Object.keys(e[0]),o={};for(let n of r){o[n]=n.length;for(let a of e){let p=String(a[n]??"");p.length>o[n]&&(o[n]=p.length)}}if(t.header!==!1){let n=r.map(a=>a.padEnd(o[a])).join(" ");console.log(i.dim(n)),console.log(i.dim("\u2500".repeat(n.length)))}for(let n of e){let a=r.map(p=>String(n[p]??"").padEnd(o[p])).join(" ");console.log(a)}return this},box(e,t){if(this.stop(),s.quietMode)return this;let r=t.split(`
10
10
  `),o=Math.max(e.length,...r.map(a=>a.length)),n="\u2500".repeat(o+2);console.log(i.dim(`\u250C${n}\u2510`)),console.log(`${i.dim("\u2502")} ${i.bold(e.padEnd(o))} ${i.dim("\u2502")}`),console.log(i.dim(`\u251C${n}\u2524`));for(let a of r)console.log(`${i.dim("\u2502")} ${a.padEnd(o)} ${i.dim("\u2502")}`);return console.log(i.dim(`\u2514${n}\u2518`)),this},section(e){return this.stop(),s.quietMode?this:(console.log(`
11
11
  ${i.bold(e)}`),console.log(i.dim("\u2500".repeat(e.length))),this)},stop(){return s.interval&&(clearInterval(s.interval),s.interval=null,G()),this},step(e,t,r){if(s.quietMode)return this;this.stop();let o=i.dim(`[${e}/${t}]`);return process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,`${o} ${g(r,u.STEP_MSG)}`)}`)},b),this):(process.stdout.write(`${l.cli.spin(0,`${o} ${g(r,u.STEP_MSG)}`)}
12
12
  `),this)},progress(e,t,r){if(s.quietMode)return this;this.stop();let o=Math.round(e/t*100),n=Math.round(o/10),a=10-n,p=i.cyan("\u2588".repeat(n))+i.dim("\u2591".repeat(a)),d=r?` ${g(r,u.PROGRESS_TEXT)}`:"";return process.stdout.isTTY?(s.interval=setInterval(()=>{process.stdout.write(`\r${l.cli.spin(s.frame++,`[${p}] ${o}%${d}`)}`)},b),this):(process.stdout.write(`${l.cli.spin(0,`[${p}] ${o}%${d}`)}
13
- `),this)}},M=D;S();O();P();var C=class{static{c(this,"ProjectService")}currentAuthor=null;async ensureInit(t){if(await f.isConfigured(t))return{success:!0};try{let{worktreeService:a}=await import("./worktree-service-AS7JVBK5.mjs");if(await a.detect(t)){let d=await a.getMainWorktree(t);if(d&&d!==t&&await f.isConfigured(d))return await a.setup(t,d),{success:!0}}}catch{}M.spin("initializing project...");let{PlanningCommands:r}=await import("./planning-VPAX5DZL.mjs"),n=await new r().init(null,t);return n.success?{success:!0}:n}async getProjectId(t){let r=await f.getProjectId(t);if(!r)throw A.notInitialized();return r}async getGlobalPath(t){let r=await this.getProjectId(t);return await T.ensureProjectStructure(r),T.getGlobalProjectPath(r)}async ensureAuthor(){if(this.currentAuthor)return this.currentAuthor;let t=await N();return this.currentAuthor={name:t.name??void 0,email:t.email??void 0,github:t.github??void 0},this.currentAuthor}getCurrentAuthor(){return this.currentAuthor}clearAuthorCache(){this.currentAuthor=null}async isEmptyDirectory(t){try{return(await I(t)).filter(n=>!n.startsWith(".")&&n!=="node_modules"&&n!=="package.json"&&n!=="package-lock.json"&&n!=="README.md").length===0}catch(r){return y(r)||console.error(`Directory check error: ${$(r)}`),!0}}async hasExistingCode(t){try{let r=["src","lib","app","components","pages","api","main.go","main.rs","main.py"];return(await I(t)).some(n=>r.includes(n))}catch(r){return y(r)||console.error(`Code check error: ${$(r)}`),!1}}async isConfigured(t){return await f.isConfigured(t)}async needsMigration(t){return await f.needsMigration(t)}},F=new C,ct=F;export{M as a,F as b,ct as c};
13
+ `),this)}},M=D;S();O();P();var C=class{static{c(this,"ProjectService")}currentAuthor=null;async ensureInit(t){if(await f.isConfigured(t))return{success:!0};try{let{worktreeService:a}=await import("./worktree-service-AS7JVBK5.mjs");if(await a.detect(t)){let d=await a.getMainWorktree(t);if(d&&d!==t&&await f.isConfigured(d))return await a.setup(t,d),{success:!0}}}catch{}M.spin("initializing project...");let{PlanningCommands:r}=await import("./planning-KOU3XKWS.mjs"),n=await new r().init(null,t);return n.success?{success:!0}:n}async getProjectId(t){let r=await f.getProjectId(t);if(!r)throw A.notInitialized();return r}async getGlobalPath(t){let r=await this.getProjectId(t);return await T.ensureProjectStructure(r),T.getGlobalProjectPath(r)}async ensureAuthor(){if(this.currentAuthor)return this.currentAuthor;let t=await N();return this.currentAuthor={name:t.name??void 0,email:t.email??void 0,github:t.github??void 0},this.currentAuthor}getCurrentAuthor(){return this.currentAuthor}clearAuthorCache(){this.currentAuthor=null}async isEmptyDirectory(t){try{return(await I(t)).filter(n=>!n.startsWith(".")&&n!=="node_modules"&&n!=="package.json"&&n!=="package-lock.json"&&n!=="README.md").length===0}catch(r){return y(r)||console.error(`Directory check error: ${$(r)}`),!0}}async hasExistingCode(t){try{let r=["src","lib","app","components","pages","api","main.go","main.rs","main.py"];return(await I(t)).some(n=>r.includes(n))}catch(r){return y(r)||console.error(`Code check error: ${$(r)}`),!1}}async isConfigured(t){return await f.isConfigured(t)}async needsMigration(t){return await f.needsMigration(t)}},F=new C,ct=F;export{M as a,F as b,ct as c};
@@ -5,14 +5,14 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as z}from"./chunk-NJ74RHNC.mjs";import{a as V}from"./chunk-WUOVBBPC.mjs";import{a as X,j as L}from"./chunk-KDNUQPAK.mjs";import{a as q}from"./chunk-33BHU4OM.mjs";import{e as J}from"./chunk-ZYCNW75E.mjs";import{c as P}from"./chunk-TF6PN7IB.mjs";import{d as H,e as I}from"./chunk-XYKVWO23.mjs";import{b as k}from"./chunk-PVCEWFHS.mjs";import{i as b}from"./chunk-JGZ3QGWX.mjs";import{c as W}from"./chunk-QXCEBAIA.mjs";import{b as E}from"./chunk-ZZBNFNMG.mjs";import{d as p,g as K}from"./chunk-TKXOMN4K.mjs";import{b as A,g as M,h as mt,i as G,k as pt,v as Y,w as ht}from"./chunk-A6K4H3YT.mjs";import{d as ft}from"./chunk-JQE2F2RK.mjs";import{e as x,p as ut}from"./chunk-QWQFF2UG.mjs";import{b as T,e as gt}from"./chunk-IJ523YO2.mjs";import{e as B,f as dt}from"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import $ from"node:fs/promises";import at from"node:path";ht();import N from"node:fs";import yt from"node:path";var Z=l(()=>Y.getStatePath(),"stampDir"),Q=l(()=>yt.join(Z(),"installed-version"),"stampPath");function St(){try{return N.readFileSync(Q(),"utf-8").trim()}catch{return null}}l(St,"readStamp");function wt(i){try{N.mkdirSync(Z(),{recursive:!0}),N.writeFileSync(Q(),i,"utf-8")}catch{}}l(wt,"writeStamp");function tt(i){return i?St()===i:!0}l(tt,"isSyncCurrent");async function nt(i){if(i&&process.env.PRJCT_NO_SELF_SYNC!=="1"){try{let{installGlobalConfig:n}=await import("./command-installer-MUHZWDZA.mjs");await n()}catch{}try{await(await import("./settings-installer-CQKMGMRG.mjs")).install()}catch{}try{let{SetupCommands:n}=await import("./setup-PPIZHVXS.mjs");await new n().installStatusLine()}catch{}wt(i)}}l(nt,"runSelfHeal");K();dt();ut();ft();K();pt();mt();var Ct=50,F=class{static{l(this,"SessionTracker")}currentRow(n){try{return p.get(n,"SELECT * FROM cli_sessions WHERE status = 'active' ORDER BY last_activity DESC LIMIT 1")??null}catch{return null}}isExpired(n){return G(n,18e5)}toSessionData(n,t){return{id:t.id,projectId:n,status:t.status,createdAt:t.created_at,lastActivity:t.last_activity,commands:[],files:[]}}async touch(n){let t=A(),e=this.currentRow(n);if(e&&!this.isExpired(e.last_activity))return p.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",t,e.id),this.toSessionData(n,{...e,last_activity:t});e&&p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",e.id);let s=crypto.randomUUID();return p.run(n,"INSERT INTO cli_sessions (id, status, created_at, last_activity) VALUES (?, 'active', ?, ?)",s,t,t),this.toSessionData(n,{id:s,status:"active",created_at:t,last_activity:t})}async trackCommand(n,t,e){let s=this.currentRow(n);if(!s)return;let o=A();try{p.run(n,"INSERT INTO cli_session_commands (session_id, command, timestamp, duration_ms) VALUES (?, ?, ?, ?)",s.id,t,o,Math.round(e)),p.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",o,s.id)}catch{}}async getInfo(n){let t=this.currentRow(n);if(!t||this.isExpired(t.last_activity))return{active:!1,id:null,duration:null,idleSince:null,idleMs:0,expiresIn:null,commandCount:0,commands:[],filesRead:0,filesWritten:0};let e=Date.now(),s=new Date(t.created_at).getTime(),o=new Date(t.last_activity).getTime(),c=e-o,a=Math.max(0,18e5-c),r=p.query(n,"SELECT command FROM cli_session_commands WHERE session_id = ? ORDER BY timestamp DESC LIMIT ?",t.id,Ct);return{active:!0,id:t.id,duration:M(e-s),idleSince:t.last_activity,idleMs:c,expiresIn:M(a),commandCount:r.length,commands:r.map(u=>u.command).reverse(),filesRead:0,filesWritten:0}}async expire(n){try{p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE status = 'active'")}catch{}}async expireIfStale(n){let t=this.currentRow(n);return t&&this.isExpired(t.last_activity)?(p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",t.id),!0):!1}},st=new F;var vt={commitThreshold:10,dayThreshold:3,significantFiles:["package.json","tsconfig.json","Cargo.toml","go.mod","requirements.txt","pyproject.toml",".env.example","docker-compose.yml","Dockerfile"]},O=class{static{l(this,"StalenessChecker")}projectPath;config;constructor(n,t={}){this.projectPath=n,this.config={...vt,...t}}async check(n){let t={isStale:!1,reason:null,lastSyncCommit:null,currentCommit:null,commitsSinceSync:0,daysSinceSync:0,changedFiles:[],significantChanges:[]};try{let e=(()=>{try{return p.getDoc(n,"project")}catch{return null}})();if(!e)return t.isStale=!0,t.reason="No sync history found. Run `prjct sync` to initialize.",t;t.lastSyncCommit=e.lastSyncCommit||null;let s=e.lastSync;if(!t.lastSyncCommit)return t.isStale=!0,t.reason="No sync commit recorded. Run `prjct sync` to track.",t;let c={cwd:this.projectPath,timeoutMs:3e3,maxBuffer:1024*256},a=`${t.lastSyncCommit}..HEAD`,[r,u]=await Promise.all([x(["rev-parse","--short","HEAD"],c),x(["rev-list","--count",a],c)]);if(!r.ok)return t.reason=r.kind==="exit"?"Not a git repository":`git ${r.kind} \u2014 staleness unknown`,t;if(t.currentCommit=r.stdout.trim(),t.lastSyncCommit===t.currentCommit)return t.reason="Context is up to date",t;if(!u.ok)return u.kind==="exit"?(t.isStale=!0,t.reason="Sync commit no longer exists (history changed). Run `prjct sync`."):t.reason=`git ${u.kind} reading history \u2014 staleness unknown. Retry shortly.`,t;if(t.commitsSinceSync=parseInt(u.stdout.trim(),10)||0,s){let y=new Date(s),g=new Date;t.daysSinceSync=Math.floor((g.getTime()-y.getTime())/(1e3*60*60*24))}if(t.commitsSinceSync>0&&t.commitsSinceSync<this.config.commitThreshold){let y=await x(["diff","--name-only",a],c),g=y.ok?y.stdout.trim().split(`
8
+ import{a as z}from"./chunk-NJ74RHNC.mjs";import{a as V}from"./chunk-WUOVBBPC.mjs";import{a as X,j as L}from"./chunk-HRU2KNEB.mjs";import{a as q}from"./chunk-LCGWETJ6.mjs";import{e as J}from"./chunk-7H5UVM6X.mjs";import{c as P}from"./chunk-TF6PN7IB.mjs";import{d as H,e as I}from"./chunk-6EHYPQ5U.mjs";import{b as k}from"./chunk-ZPAY2NSF.mjs";import{i as b}from"./chunk-JGZ3QGWX.mjs";import{c as W}from"./chunk-QXCEBAIA.mjs";import{b as E}from"./chunk-FTBBQHI4.mjs";import{d as p,g as K}from"./chunk-TKXOMN4K.mjs";import{b as A,g as M,h as mt,i as G,k as pt,v as Y,w as ht}from"./chunk-A6K4H3YT.mjs";import{d as ft}from"./chunk-JQE2F2RK.mjs";import{e as x,p as ut}from"./chunk-QWQFF2UG.mjs";import{b as T,e as gt}from"./chunk-OALZUWC6.mjs";import{e as B,f as dt}from"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import $ from"node:fs/promises";import at from"node:path";ht();import N from"node:fs";import yt from"node:path";var Z=l(()=>Y.getStatePath(),"stampDir"),Q=l(()=>yt.join(Z(),"installed-version"),"stampPath");function St(){try{return N.readFileSync(Q(),"utf-8").trim()}catch{return null}}l(St,"readStamp");function wt(i){try{N.mkdirSync(Z(),{recursive:!0}),N.writeFileSync(Q(),i,"utf-8")}catch{}}l(wt,"writeStamp");function tt(i){return i?St()===i:!0}l(tt,"isSyncCurrent");async function nt(i){if(i&&process.env.PRJCT_NO_SELF_SYNC!=="1"){try{let{installGlobalConfig:n}=await import("./command-installer-3XOZGKOQ.mjs");await n()}catch{}try{await(await import("./settings-installer-CQKMGMRG.mjs")).install()}catch{}try{let{SetupCommands:n}=await import("./setup-YV2DKG5L.mjs");await new n().installStatusLine()}catch{}wt(i)}}l(nt,"runSelfHeal");K();dt();ut();ft();K();pt();mt();var Ct=50,F=class{static{l(this,"SessionTracker")}currentRow(n){try{return p.get(n,"SELECT * FROM cli_sessions WHERE status = 'active' ORDER BY last_activity DESC LIMIT 1")??null}catch{return null}}isExpired(n){return G(n,18e5)}toSessionData(n,t){return{id:t.id,projectId:n,status:t.status,createdAt:t.created_at,lastActivity:t.last_activity,commands:[],files:[]}}async touch(n){let t=A(),e=this.currentRow(n);if(e&&!this.isExpired(e.last_activity))return p.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",t,e.id),this.toSessionData(n,{...e,last_activity:t});e&&p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",e.id);let s=crypto.randomUUID();return p.run(n,"INSERT INTO cli_sessions (id, status, created_at, last_activity) VALUES (?, 'active', ?, ?)",s,t,t),this.toSessionData(n,{id:s,status:"active",created_at:t,last_activity:t})}async trackCommand(n,t,e){let s=this.currentRow(n);if(!s)return;let o=A();try{p.run(n,"INSERT INTO cli_session_commands (session_id, command, timestamp, duration_ms) VALUES (?, ?, ?, ?)",s.id,t,o,Math.round(e)),p.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",o,s.id)}catch{}}async getInfo(n){let t=this.currentRow(n);if(!t||this.isExpired(t.last_activity))return{active:!1,id:null,duration:null,idleSince:null,idleMs:0,expiresIn:null,commandCount:0,commands:[],filesRead:0,filesWritten:0};let e=Date.now(),s=new Date(t.created_at).getTime(),o=new Date(t.last_activity).getTime(),c=e-o,a=Math.max(0,18e5-c),r=p.query(n,"SELECT command FROM cli_session_commands WHERE session_id = ? ORDER BY timestamp DESC LIMIT ?",t.id,Ct);return{active:!0,id:t.id,duration:M(e-s),idleSince:t.last_activity,idleMs:c,expiresIn:M(a),commandCount:r.length,commands:r.map(u=>u.command).reverse(),filesRead:0,filesWritten:0}}async expire(n){try{p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE status = 'active'")}catch{}}async expireIfStale(n){let t=this.currentRow(n);return t&&this.isExpired(t.last_activity)?(p.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",t.id),!0):!1}},st=new F;var vt={commitThreshold:10,dayThreshold:3,significantFiles:["package.json","tsconfig.json","Cargo.toml","go.mod","requirements.txt","pyproject.toml",".env.example","docker-compose.yml","Dockerfile"]},O=class{static{l(this,"StalenessChecker")}projectPath;config;constructor(n,t={}){this.projectPath=n,this.config={...vt,...t}}async check(n){let t={isStale:!1,reason:null,lastSyncCommit:null,currentCommit:null,commitsSinceSync:0,daysSinceSync:0,changedFiles:[],significantChanges:[]};try{let e=(()=>{try{return p.getDoc(n,"project")}catch{return null}})();if(!e)return t.isStale=!0,t.reason="No sync history found. Run `prjct sync` to initialize.",t;t.lastSyncCommit=e.lastSyncCommit||null;let s=e.lastSync;if(!t.lastSyncCommit)return t.isStale=!0,t.reason="No sync commit recorded. Run `prjct sync` to track.",t;let c={cwd:this.projectPath,timeoutMs:3e3,maxBuffer:1024*256},a=`${t.lastSyncCommit}..HEAD`,[r,u]=await Promise.all([x(["rev-parse","--short","HEAD"],c),x(["rev-list","--count",a],c)]);if(!r.ok)return t.reason=r.kind==="exit"?"Not a git repository":`git ${r.kind} \u2014 staleness unknown`,t;if(t.currentCommit=r.stdout.trim(),t.lastSyncCommit===t.currentCommit)return t.reason="Context is up to date",t;if(!u.ok)return u.kind==="exit"?(t.isStale=!0,t.reason="Sync commit no longer exists (history changed). Run `prjct sync`."):t.reason=`git ${u.kind} reading history \u2014 staleness unknown. Retry shortly.`,t;if(t.commitsSinceSync=parseInt(u.stdout.trim(),10)||0,s){let y=new Date(s),g=new Date;t.daysSinceSync=Math.floor((g.getTime()-y.getTime())/(1e3*60*60*24))}if(t.commitsSinceSync>0&&t.commitsSinceSync<this.config.commitThreshold){let y=await x(["diff","--name-only",a],c),g=y.ok?y.stdout.trim().split(`
9
9
  `).filter(Boolean).slice(0,200):[];t.changedFiles=g,t.significantChanges=g.filter(d=>this.config.significantFiles.some(f=>d.endsWith(f)||d.includes(f)))}else t.changedFiles=[],t.significantChanges=[];return t.commitsSinceSync>=this.config.commitThreshold?(t.isStale=!0,t.reason=`${t.commitsSinceSync} commits since last sync (threshold: ${this.config.commitThreshold})`):t.daysSinceSync>=this.config.dayThreshold?(t.isStale=!0,t.reason=`${t.daysSinceSync} days since last sync (threshold: ${this.config.dayThreshold})`):t.significantChanges.length>0?(t.isStale=!0,t.reason=`Significant files changed: ${t.significantChanges.join(", ")}`):t.commitsSinceSync>0?t.reason=`${t.commitsSinceSync} commits since sync (threshold: ${this.config.commitThreshold})`:t.reason="Context is up to date",t}catch(e){return t.reason=`Error checking staleness: ${B(e)}`,t}}formatStatus(n){let t=[];n.isStale?t.push("CLAUDE.md status: \u26A0\uFE0F STALE"):t.push("CLAUDE.md status: \u2713 Fresh");let e=[];if(n.lastSyncCommit&&e.push(`Last sync: ${n.lastSyncCommit}`),n.currentCommit&&e.push(`Current: ${n.currentCommit}`),n.commitsSinceSync>0&&e.push(`Commits since: ${n.commitsSinceSync}`),n.daysSinceSync>0&&e.push(`Days since: ${n.daysSinceSync}`),n.changedFiles.length>0&&e.push(`Files changed: ${n.changedFiles.length}`),e.length>0&&t.push(...it(e)),n.significantChanges.length>0){t.push(""),t.push("Significant changes:");for(let s of n.significantChanges.slice(0,5))t.push(` \u2022 ${s}`);n.significantChanges.length>5&&t.push(` ... and ${n.significantChanges.length-5} more`)}return n.reason&&(t.push(""),t.push(n.reason)),n.isStale&&(t.push(""),t.push("Run `prjct sync` to update context")),t.join(`
10
10
  `)}async getSessionInfo(n){return st.getInfo(n)}formatSessionInfo(n){let t=[];if(!n.active)return t.push("Session: \u25CB No active session"),t.join(`
11
11
  `);t.push(`Session: \u25B6 Active (${n.duration})`);let e=[];if(n.commandCount>0){let s=new Set,o=[];for(let c of n.commands)s.has(c)||(s.add(c),o.push(c));e.push(`Commands: ${o.join(" \u2192 ")} (${n.commandCount} total)`)}return(n.filesRead>0||n.filesWritten>0)&&e.push(`Files: ${n.filesRead} read, ${n.filesWritten} written`),e.push(`Idle: ${n.expiresIn} until timeout`),e.length>0&&t.push(...it(e)),t.join(`
12
- `)}getWarning(n){return n.isStale?n.commitsSinceSync>0?`\u26A0\uFE0F Context stale (${n.commitsSinceSync} commits behind). Run \`prjct sync\``:n.daysSinceSync>0?`\u26A0\uFE0F Context stale (${n.daysSinceSync} days old). Run \`prjct sync\``:"\u26A0\uFE0F Context may be stale. Run `prjct sync`":null}};function it(i){let n=Math.max(...i.map(e=>e.length)),t="\u2500".repeat(n+2);return[`\u250C${t}\u2510`,...i.map(e=>`\u2502 ${e.padEnd(n)} \u2502`),`\u2514${t}\u2518`]}l(it,"boxLines");var rt=l((i,n)=>new O(i,n),"createStalenessChecker");gt();var Et=1600,j=3,kt=4,U={minTeaser:24,maxTeaser:90};async function _t(i,n,t={}){let e=n??await E.readConfig(i);if(!e?.projectId)return null;let s=e.persona,o=t.digest?await(async()=>{try{let{memoryL0IndexForSession:h}=await import("./memory-index-XE2MWKQS.mjs");return h(e.projectId,{rebuildIfStale:!0})||ot(e.projectId)}catch{return ot(e.projectId)}})():null,c=xt(i,e.projectId),a=import("./vault-retire-notice-7XHVNHU6.mjs").then(({vaultRetirementNotice:h})=>h(e,e.projectId)),r=(async()=>{try{let{buildLandCue:h}=await import("./land-cue-57B23PEL.mjs");return await h(e.projectId,i,e)}catch{return null}})(),u=(async()=>{try{let{effectiveWeakModelMode:h,weakModelBanner:w}=await import("./weak-model-mode-BMSPGEQY.mjs");return h(e)==="on"?w():null}catch{return null}})(),C=t.digest?(async()=>{try{let{formatPendingHandoffCue:h}=await import("./agent-switch-I4MTVE56.mjs"),w=h(e.projectId);return w?`# prjct: pending handoff
13
- ${w}`:null}catch{return null}})():Promise.resolve(null),y=t.digest?(async()=>{try{let{loadSessionContinuity:h,formatContinuitySessionCue:w}=await import("./session-continuity-BIJXMN44.mjs");return w(h(e.projectId))}catch{return null}})():Promise.resolve(null),g=Pt(i,e.projectId),[d,f,S,v,_,D,R]=await Promise.all([c,a,r,u,C,y,g]);if(!R&&!s&&!o&&!d&&!f&&!S&&!v&&!_&&!D)return null;let m=["# prjct: project context",""];return R&&m.push(R,""),s&&m.push(It(s),"","> Exposed as state, not prescription. Decide whether any of this matters for the current turn."),o&&(s&&m.push(""),m.push(o)),d&&((s||o)&&m.push(""),m.push(d)),f&&((s||o||d)&&m.push(""),m.push(f)),S&&((s||o||d||f)&&m.push(""),m.push(S)),v&&((s||o||d||f||S)&&m.push(""),m.push(v)),_&&((s||o||d||f||S||v)&&m.push(""),m.push(_)),D&&((s||o||d||f||S||v||_)&&m.push(""),m.push(D)),m.join(`
12
+ `)}getWarning(n){return n.isStale?n.commitsSinceSync>0?`\u26A0\uFE0F Context stale (${n.commitsSinceSync} commits behind). Run \`prjct sync\``:n.daysSinceSync>0?`\u26A0\uFE0F Context stale (${n.daysSinceSync} days old). Run \`prjct sync\``:"\u26A0\uFE0F Context may be stale. Run `prjct sync`":null}};function it(i){let n=Math.max(...i.map(e=>e.length)),t="\u2500".repeat(n+2);return[`\u250C${t}\u2510`,...i.map(e=>`\u2502 ${e.padEnd(n)} \u2502`),`\u2514${t}\u2518`]}l(it,"boxLines");var rt=l((i,n)=>new O(i,n),"createStalenessChecker");gt();var Et=1600,j=3,kt=4,U={minTeaser:24,maxTeaser:90};async function _t(i,n,t={}){let e=n??await E.readConfig(i);if(!e?.projectId)return null;let s=e.persona,o=t.digest?await(async()=>{try{let{memoryL0IndexForSession:h}=await import("./memory-index-LL6SQJ2N.mjs");return h(e.projectId,{rebuildIfStale:!0})||ot(e.projectId)}catch{return ot(e.projectId)}})():null,c=xt(i,e.projectId),a=import("./vault-retire-notice-7XHVNHU6.mjs").then(({vaultRetirementNotice:h})=>h(e,e.projectId)),r=(async()=>{try{let{buildLandCue:h}=await import("./land-cue-3JD2TXFP.mjs");return await h(e.projectId,i,e)}catch{return null}})(),u=(async()=>{try{let{effectiveWeakModelMode:h,weakModelBanner:w}=await import("./weak-model-mode-HPXBKXJT.mjs");return h(e)==="on"?w():null}catch{return null}})(),C=t.digest?(async()=>{try{let{formatPendingHandoffCue:h}=await import("./agent-switch-TAJWH2ZD.mjs"),w=h(e.projectId);return w?`# prjct: pending handoff
13
+ ${w}`:null}catch{return null}})():Promise.resolve(null),y=t.digest?(async()=>{try{let{loadSessionContinuity:h,formatContinuitySessionCue:w}=await import("./session-continuity-RO2ACICF.mjs");return w(h(e.projectId))}catch{return null}})():Promise.resolve(null),g=Pt(i,e.projectId),[d,f,S,v,_,D,R]=await Promise.all([c,a,r,u,C,y,g]);if(!R&&!s&&!o&&!d&&!f&&!S&&!v&&!_&&!D)return null;let m=["# prjct: project context",""];return R&&m.push(R,""),s&&m.push(It(s),"","> Exposed as state, not prescription. Decide whether any of this matters for the current turn."),o&&(s&&m.push(""),m.push(o)),d&&((s||o)&&m.push(""),m.push(d)),f&&((s||o||d)&&m.push(""),m.push(f)),S&&((s||o||d||f)&&m.push(""),m.push(S)),v&&((s||o||d||f||S)&&m.push(""),m.push(v)),_&&((s||o||d||f||S||v)&&m.push(""),m.push(_)),D&&((s||o||d||f||S||v||_)&&m.push(""),m.push(D)),m.join(`
14
14
  `)}l(_t,"buildSessionContext");async function xt(i,n){try{let t=rt(i),e=await t.check(n);if(!e.isStale||e.commitsSinceSync<=0)return null;let s=t.getWarning(e);if(!s)return null;try{let c=await import("node:path"),a=await import("node:os"),{maybeDetachDriftRefresh:r,readDriftStamp:u,formatDriftNotice:C,driftStaleResolved:y}=await import("./drift-refresh-TD3PYPJN.mjs"),g=process.env.PRJCT_CLI_HOME?c.resolve(process.env.PRJCT_CLI_HOME):c.join(a.homedir(),".prjct-cli"),d=u(g);if(y(d))return C({warning:s,commitsSinceSync:e.commitsSinceSync,stamp:d,refreshScheduled:!1});let f=r({projectPath:i,cliHome:g,commitsSinceSync:e.commitsSinceSync}),S=u(g);return C({warning:s,commitsSinceSync:e.commitsSinceSync,stamp:S,refreshScheduled:f})}catch{}let o=await(async()=>{try{let{hasSymbolIndex:c,loadMeta:a}=await import("./symbol-graph-MH42JSPX.mjs");if(!c(n))return" Code graph empty \u2014 `prjct code reindex` (or `prjct sync`) before trace/impact.";if(e.commitsSinceSync<5)return"";let r=a(n);return` Symbol index may lag${r?.builtAt?` (index ${r.builtAt.slice(0,10)})`:""} \u2014 prefer \`prjct code reindex\` after big pulls.`}catch{return""}})();return`**Understanding may be stale:** ${s} \u2014 run \`prjct sync\` before big calls.${o}`}catch{return null}}l(xt,"buildStalenessNotice");function ot(i){let n=(()=>{try{let r=P.rerank(i,k.recall(i,{types:["gotcha","anti-pattern"],limit:j*4})).slice(0,j),u=P.rerank(i,k.recall(i,{types:["decision"],limit:j*4})).slice(0,j);return{gotchas:r,decisions:u}}catch{return null}})();if(!n)return null;let{gotchas:t,decisions:e}=n,s=(()=>{try{let r=k.recall(i,{types:["feedback","improvement-signal"],limit:40,dedupeByKey:!1});return X(r,kt)}catch{return[]}})(),o=L(i,new Set([...t,...e].map(r=>r.id))),c=(()=>{try{let r=q(i);return r?J(r,{maxConventions:4,maxPatterns:3,maxAnti:2}):null}catch{return null}})();if(t.length===0&&e.length===0&&!o&&s.length===0&&!c)return null;let a=["## What this project already knows",""];if(a.push("> Carried across sessions and model updates \u2014 this survived even if your conversation context did not. Apply these; do not re-derive from source."),s.length>0){a.push("","**How this developer works (act as them):**");for(let r of s){let u=r.rule.length>140?`${r.rule.slice(0,139)}\u2026`:r.rule;a.push(`- ${u} \`${r.sourceId}\``)}}if(c){let r=c.replace(/^## How this repo works \(project style\)\n?/,"").trim();r&&a.push("","**How this repo works (match house style):**",r)}if(t.length>0){a.push("","**Traps to avoid:**");for(let r of t)a.push(`- ${I(r,U)}`)}if(e.length>0){a.push("","**Decisions in force:**");for(let r of e)a.push(`- ${I(r,U)}`)}return o&&a.push("","**Keeps being missed:**",`- ${I(o.entry,U)} \u2014 flagged relevant-but-unused ${o.count}\xD7. Apply it or supersede it.`),a.push("","> Resolve any `mem_id` with `prjct search <id>`. Full developer model: MCP `prjct_developer`. Project style: `prjct analysis` / sync evolution."),b(a.join(`
15
- `),Et)}l(ot,"buildKnowledgeDigest");var Tt=500,ct=2;async function un(i){let n=await E.readConfig(i).catch(()=>null);if(!n?.projectId)return null;let t=["# prjct: subagent context"];n.persona?.role&&t.push(`Role in this project: ${n.persona.role}`);try{let{resolveActiveTask:e}=await import("./task-service-FZABHPFV.mjs"),s=await e(n.projectId,i);s&&t.push(`Active work cycle (this worktree): ${s.description}`)}catch{}try{let e=P.rerank(n.projectId,k.recall(n.projectId,{types:["gotcha","anti-pattern"],limit:ct*4})).slice(0,ct);if(e.length>0){t.push("Traps to avoid:");for(let o of e)t.push(`- ${H(o)} \`${o.id}\``)}let s=L(n.projectId,new Set(e.map(o=>o.id)));s&&t.push(`Keeps being missed: ${H(s.entry)} \`${s.entry.id}\``)}catch{}return t.length<=1?null:b(t.join(`
15
+ `),Et)}l(ot,"buildKnowledgeDigest");var Tt=500,ct=2;async function un(i){let n=await E.readConfig(i).catch(()=>null);if(!n?.projectId)return null;let t=["# prjct: subagent context"];n.persona?.role&&t.push(`Role in this project: ${n.persona.role}`);try{let{resolveActiveTask:e}=await import("./task-service-5ONSBKKP.mjs"),s=await e(n.projectId,i);s&&t.push(`Active work cycle (this worktree): ${s.description}`)}catch{}try{let e=P.rerank(n.projectId,k.recall(n.projectId,{types:["gotcha","anti-pattern"],limit:ct*4})).slice(0,ct);if(e.length>0){t.push("Traps to avoid:");for(let o of e)t.push(`- ${H(o)} \`${o.id}\``)}let s=L(n.projectId,new Set(e.map(o=>o.id)));s&&t.push(`Keeps being missed: ${H(s.entry)} \`${s.entry.id}\``)}catch{}return t.length<=1?null:b(t.join(`
16
16
  `),Tt)}l(un,"buildSubagentDigest");function It(i){let n=[];return n.push(`## Your role in this project: **${i.role}**`),i.focus&&n.push(`Focus: ${i.focus}`),i.mcps&&i.mcps.length>0&&n.push(`Available MCPs this project expects: ${i.mcps.join(", ")}`),i.packs&&i.packs.length>0&&n.push(`Active packs: ${i.packs.join(", ")}`),n.join(`
17
17
  `)}l(It,"formatPersona");async function Pt(i,n){try{let t=await import("node:path"),{execFileAsync:e}=await import("./exec-2P5VOBHM.mjs"),s=t.basename(i),o=await(async()=>{try{let{stdout:r}=await e("git",["branch","--show-current"],{cwd:i});return r.trim()}catch{return""}})(),c=n.length>12?`${n.slice(0,8)}\u2026`:n,a=["## Project identity (cwd)",`- **${s}** \xB7 id \`${c}\``];return o&&a.push(`- Branch: \`${o}\``),a.push("- Skill is portable L0 \u2014 if skill text names another project, ignore it; trust this block + `prjct context --md`."),a.join(`
18
- `)}catch{return null}}l(Pt,"buildProjectIdentityLine");function lt(i,n,t="kimi"){let e=i.replace(/[^a-zA-Z0-9._-]/g,"_"),s=(n??`nosession-${t}`).replace(/[^a-zA-Z0-9._-]/g,"_");return at.join(W.runDir(),`kimi-session-${e}-${s}.pending`)}l(lt,"kimiSessionStampPath");async function mn(i,n,t="kimi"){let e=lt(i,n,t),s=await $.readFile(e,"utf-8").catch(()=>null);return s===null?null:(await $.rm(e,{force:!0}).catch(()=>{}),s.trim()==="digest"?"digest":"persona")}l(mn,"consumeKimiSessionInjection");function dn(i=process.cwd(),n){let t=E.readConfig(i).catch(()=>null);return V({event:"SessionStart",projectPath:i,build:l(async(e,s,o)=>{let c=s===i?await t:await E.readConfig(s).catch(()=>null),a=e.source??"startup",r=a==="startup"||a==="clear"||a==="compact";if(o==="kimi"){if(c?.projectId){let u=lt(c.projectId,e.session_id,o);await $.mkdir(at.dirname(u),{recursive:!0}).then(()=>$.writeFile(u,r?"digest":"persona")).catch(()=>{})}return null}return _t(s,c,{digest:r})},"build"),afterEmit:l(async(e,s)=>{let o=await t;if(o?.projectId){let c=await(async()=>{try{let{collectActiveTasks:a}=await import("./task-overview-F3GB77OA.mjs"),r=await a(o.projectId,s);return{taskId:r.current?.id??null,goal:r.current?.description??e.source??null}}catch{return{taskId:null,goal:e.source??null}}})();z({projectId:o.projectId,sessionId:e.session_id,directory:s,taskId:c.taskId,goal:c.goal})}tt(T)||await nt(T).catch(()=>{});try{let{maybeAutoUpdate:c}=await import("./auto-updater-4TIXYSEX.mjs");c(T)}catch{}},"afterEmit")},n)}l(dn,"runSessionStartHook");export{_t as a,un as b,Pt as c,mn as d,dn as e};
18
+ `)}catch{return null}}l(Pt,"buildProjectIdentityLine");function lt(i,n,t="kimi"){let e=i.replace(/[^a-zA-Z0-9._-]/g,"_"),s=(n??`nosession-${t}`).replace(/[^a-zA-Z0-9._-]/g,"_");return at.join(W.runDir(),`kimi-session-${e}-${s}.pending`)}l(lt,"kimiSessionStampPath");async function mn(i,n,t="kimi"){let e=lt(i,n,t),s=await $.readFile(e,"utf-8").catch(()=>null);return s===null?null:(await $.rm(e,{force:!0}).catch(()=>{}),s.trim()==="digest"?"digest":"persona")}l(mn,"consumeKimiSessionInjection");function dn(i=process.cwd(),n){let t=E.readConfig(i).catch(()=>null);return V({event:"SessionStart",projectPath:i,build:l(async(e,s,o)=>{let c=s===i?await t:await E.readConfig(s).catch(()=>null),a=e.source??"startup",r=a==="startup"||a==="clear"||a==="compact";if(o==="kimi"){if(c?.projectId){let u=lt(c.projectId,e.session_id,o);await $.mkdir(at.dirname(u),{recursive:!0}).then(()=>$.writeFile(u,r?"digest":"persona")).catch(()=>{})}return null}return _t(s,c,{digest:r})},"build"),afterEmit:l(async(e,s)=>{let o=await t;if(o?.projectId){let c=await(async()=>{try{let{collectActiveTasks:a}=await import("./task-overview-P3VRH2FD.mjs"),r=await a(o.projectId,s);return{taskId:r.current?.id??null,goal:r.current?.description??e.source??null}}catch{return{taskId:null,goal:e.source??null}}})();z({projectId:o.projectId,sessionId:e.session_id,directory:s,taskId:c.taskId,goal:c.goal})}tt(T)||await nt(T).catch(()=>{});try{let{maybeAutoUpdate:c}=await import("./auto-updater-4TIXYSEX.mjs");c(T)}catch{}},"afterEmit")},n)}l(dn,"runSessionStartHook");export{_t as a,un as b,Pt as c,mn as d,dn as e};
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as c,b as p,c as a,d as f,e as g,f as u,i as l}from"./chunk-IWUF2LGO.mjs";import{r as d,s as m,u as j}from"./chunk-A6K4H3YT.mjs";import{b as i,c as h}from"./chunk-JQE2F2RK.mjs";import{e as n,f as y}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";j();y();h();import{existsSync as x}from"node:fs";import M from"node:path";function S(){return process.env.PRJCT_TEST_MODE==="1"?[i(".prjct-tests","kimi-code"),i(".prjct-tests","kimi")]:[i(".kimi-code"),i(".kimi")]}o(S,"kimiHomeDirs");function P(){let[t,e]=S(),r=x(e)&&!x(t)?e:t;return M.join(r,"mcp.json")}o(P,"getKimiMcpConfigPath");async function v(t=P()){let e=await a("context7",c.context7,t),r=await a("prjct",c.prjct,t);return{path:t,changed:e.changed||r.changed}}o(v,"ensureKimiMcpServer");var w=[{name:"prjct",ready:"\u2705 prjct MCP already configured",added:"\u2705 prjct MCP added to mcp.json",failed:"prjct MCP setup failed",manual:" Run `prjct start` again to retry."}];async function F(t={}){t.silent||console.log(`
9
- \u{1F50C} Configuring MCP servers...`);try{await l.install();let e=t.verifyContext7===!1?null:await l.verify();t.silent||(e?.verified?console.log("\u2705 Context7 MCP ready (framework API lookups)"):(console.log(`\u26A0\uFE0F Context7 configured but not yet verified: ${e?.message||""}`),console.log(" It will activate on the next time you open your AI client.")))}catch(e){t.silent||(console.log(`\u26A0\uFE0F Context7 MCP setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}for(let e of w)try{let r=p(),s=await f(e.name,r),C=await a(e.name,c[e.name],r);s&&!C.changed?t.silent||console.log(e.ready):t.silent||console.log(e.added)}catch(r){t.silent||(console.log(`\u26A0\uFE0F ${e.failed}: ${n(r)}`),console.log(e.manual))}try{if((await d()).installed){let r=await g(),s=await u();t.silent||(r.skipped==="user-managed"?console.log("\u2705 prjct Codex config ready (MCP user-managed)"):r.changed||s.changed?console.log("\u2705 prjct Codex config updated in ~/.codex/config.toml"):console.log("\u2705 prjct Codex config already ready"))}}catch(e){t.silent||(console.log(`\u26A0\uFE0F Codex config setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}try{if((await m()).installed){let r=await v();t.silent||console.log(r.changed?`\u2705 prjct Kimi config updated in ${r.path}`:"\u2705 prjct Kimi config already ready")}}catch(e){t.silent||(console.log(`\u26A0\uFE0F Kimi config setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}}o(F,"setupMcpServers");export{F as a};
8
+ import{a as p,b as a,c as f,d as c,e as g,f as u,g as x,j as l}from"./chunk-NGB6JNSB.mjs";import{r as d,s as m,u as M}from"./chunk-A6K4H3YT.mjs";import{b as i,c as j}from"./chunk-JQE2F2RK.mjs";import{e as n,f as h}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";M();h();j();import{existsSync as C}from"node:fs";import S from"node:path";function P(){return process.env.PRJCT_TEST_MODE==="1"?[i(".prjct-tests","kimi-code"),i(".prjct-tests","kimi")]:[i(".kimi-code"),i(".kimi")]}o(P,"kimiHomeDirs");function w(){let[t,e]=P(),r=C(e)&&!C(t)?e:t;return S.join(r,"mcp.json")}o(w,"getKimiMcpConfigPath");async function v(t=w()){let e=await c("context7",a.context7,t),r=await c("prjct",p(),t);return{path:t,changed:e.changed||r.changed}}o(v,"ensureKimiMcpServer");var R=[{name:"prjct",ready:"\u2705 prjct MCP already configured",added:"\u2705 prjct MCP added to mcp.json",failed:"prjct MCP setup failed",manual:" Run `prjct start` again to retry."}];async function F(t={}){t.silent||console.log(`
9
+ \u{1F50C} Configuring MCP servers...`);try{await l.install();let e=t.verifyContext7===!1?null:await l.verify();t.silent||(e?.verified?console.log("\u2705 Context7 MCP ready (framework API lookups)"):(console.log(`\u26A0\uFE0F Context7 configured but not yet verified: ${e?.message||""}`),console.log(" It will activate on the next time you open your AI client.")))}catch(e){t.silent||(console.log(`\u26A0\uFE0F Context7 MCP setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}for(let e of R)try{let r=f(),s=await g(e.name,r),y=await c(e.name,a[e.name],r);s&&!y.changed?t.silent||console.log(e.ready):t.silent||console.log(e.added)}catch(r){t.silent||(console.log(`\u26A0\uFE0F ${e.failed}: ${n(r)}`),console.log(e.manual))}try{if((await d()).installed){let r=await u(),s=await x();t.silent||(r.skipped==="user-managed"?console.log("\u2705 prjct Codex config ready (MCP user-managed)"):r.changed||s.changed?console.log("\u2705 prjct Codex config updated in ~/.codex/config.toml"):console.log("\u2705 prjct Codex config already ready"))}}catch(e){t.silent||(console.log(`\u26A0\uFE0F Codex config setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}try{if((await m()).installed){let r=await v();t.silent||console.log(r.changed?`\u2705 prjct Kimi config updated in ${r.path}`:"\u2705 prjct Kimi config already ready")}}catch(e){t.silent||(console.log(`\u26A0\uFE0F Kimi config setup failed: ${n(e)}`),console.log(" Run `prjct start` again to retry."))}}o(F,"setupMcpServers");export{F as a};
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as f}from"./chunk-R4ILCXKE.mjs";import{c as _}from"./chunk-OUAS3LZ3.mjs";import{a as k}from"./chunk-ETTDRXQ6.mjs";import{a as d,b as E,c as y}from"./chunk-FZS3XGEA.mjs";import{d as r,g as R}from"./chunk-TKXOMN4K.mjs";import{b as a,c as T,h as A}from"./chunk-A6K4H3YT.mjs";import{a as c}from"./chunk-E66B27AL.mjs";A();R();function o(s){let e={id:s.id,description:s.description,priority:s.priority??"medium",type:s.type??"feature",section:s.section??"backlog",completed:s.completed===1,createdAt:s.created_at};return s.completed_at!=null&&(e.completedAt=s.completed_at),s.feature_id!=null&&(e.featureId=s.feature_id),s.feature_name!=null&&(e.originFeature=s.feature_name),s.body!=null&&(e.body=s.body),s.agent!=null&&(e.agent=s.agent),s.group_name!=null&&(e.groupName=s.group_name),s.group_id!=null&&(e.groupId=s.group_id),e}c(o,"rowToTask");var p=`INSERT INTO queue_tasks
8
+ import{a as f}from"./chunk-R4ILCXKE.mjs";import{c as _}from"./chunk-OUAS3LZ3.mjs";import{a as k}from"./chunk-ETTDRXQ6.mjs";import{a as d,b as E,c as y}from"./chunk-RLKYEL3F.mjs";import{d as r,g as R}from"./chunk-TKXOMN4K.mjs";import{b as a,c as T,h as A}from"./chunk-A6K4H3YT.mjs";import{a as c}from"./chunk-E66B27AL.mjs";A();R();function o(s){let e={id:s.id,description:s.description,priority:s.priority??"medium",type:s.type??"feature",section:s.section??"backlog",completed:s.completed===1,createdAt:s.created_at};return s.completed_at!=null&&(e.completedAt=s.completed_at),s.feature_id!=null&&(e.featureId=s.feature_id),s.feature_name!=null&&(e.originFeature=s.feature_name),s.body!=null&&(e.body=s.body),s.agent!=null&&(e.agent=s.agent),s.group_name!=null&&(e.groupName=s.group_name),s.group_id!=null&&(e.groupId=s.group_id),e}c(o,"rowToTask");var p=`INSERT INTO queue_tasks
9
9
  (id, description, type, priority, section, created_at, completed, completed_at,
10
10
  feature_id, feature_name, body, agent, group_name, group_id)
11
11
  VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`;function m(s){return[s.id,s.description,s.type??null,s.priority??null,s.section??"backlog",s.createdAt,s.completed?1:0,s.completedAt??null,s.featureId??null,s.originFeature??null,s.body??null,s.agent??null,s.groupName??null,s.groupId??null]}c(m,"insertParams");var g=class extends k{static{c(this,"QueueStorage")}constructor(){super("queue.json",_)}getDefault(){return{tasks:[],lastUpdated:""}}getEventType(e){return`queue.${e}d`}async getTasks(e){return r.query(e,"SELECT * FROM queue_tasks ORDER BY created_at ASC").map(o)}async getActiveTasks(e){return r.query(e,"SELECT * FROM queue_tasks WHERE section = 'active' AND completed = 0 ORDER BY created_at ASC").map(o)}async getBacklog(e){return r.query(e,"SELECT * FROM queue_tasks WHERE section = 'backlog' AND completed = 0 ORDER BY created_at ASC").map(o)}async getNextTask(e){let t=await this.getActiveTasks(e);return f(t)[0]||null}async addTask(e,t){let i={...t,id:d(),createdAt:a(),completed:!1};return r.run(e,p,...m(i)),await this.publishEvent(e,"queue.task_added",{taskId:i.id,description:i.description,priority:i.priority,section:i.section,created_at:i.createdAt}),i}async addTasks(e,t){let i=a(),u=t.map(n=>({...n,id:d(),createdAt:i,completed:!1}));for(let n of u)r.run(e,p,...m(n));return await this.publishEvent(e,"queue.tasks_added",{count:u.length,tasks:u.map(n=>({id:n.id,description:n.description,created_at:n.createdAt}))}),u}async upsertTask(e,t){let i=await this.getTask(e,t.id);if(i){let n={...i};for(let l of["description","type","priority","section"])t[l]!==void 0&&(n[l]=t[l]);r.run(e,`UPDATE queue_tasks SET description = ?, type = ?, priority = ?, section = ?
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{d as b}from"./chunk-SYHDEUVU.mjs";import{a as j}from"./chunk-GCKILEXJ.mjs";import{c as p,e as A}from"./chunk-IJ523YO2.mjs";import{b as w}from"./chunk-PKDYFXMI.mjs";import{a as e}from"./chunk-E66B27AL.mjs";import g from"node:fs";import H from"node:fs/promises";import m from"node:path";var I=j.join("/"),R="Generated with [p/](https://www.prjct.app/)",P="<!-- prjct:start - DO NOT REMOVE THIS MARKER -->",L="<!-- prjct:end - DO NOT REMOVE THIS MARKER -->",n={rag:"prjct is a RAG-backed project memory harness; do not preload project history.",entrypoint:'Tasks \u2192 `prjct work "\u2026"`. Known cmds (`sync`/`search`/`remember`/\u2026) \u2192 `prjct <cmd>` \u2014 never work-wrap.',pull:"Pull only what surfaces: `prjct search` / `context memory` / `guard` / MCP \u2014 not something to load wholesale.",remember:'Save synthesized memory in English: `prjct remember <decision|learning|gotcha|context> "<text>"`.',kb:`KB (\`${I}\`): \`remember <facet>\` / \`context memory <facet>\` \u2014 on demand, never injected here.`,ship:"Ship only after user OKs: `prjct ship --md`.",loop:"Loop: land; H2+ intent; tip\u2192user SoT; close.",identity:"L0 portable; id=cwd."};function S(){return`${["---","name: prjct","description: prjct work cycles + memory; run prjct verbs, do not preload context.","---","","# prjct","","Run `prjct <cmd> --md` and follow it.","",`- ${n.rag}`,`- ${n.entrypoint}`,`- ${n.pull}`,`- ${n.remember}`,`- ${n.kb}`,`- ${n.ship}`,`- ${n.loop}`,`- ${n.identity}`,"",`Commit footer: \`${R}\``].join(`
8
+ import{d as b}from"./chunk-SYHDEUVU.mjs";import{a as j}from"./chunk-GCKILEXJ.mjs";import{c as p,e as A}from"./chunk-OALZUWC6.mjs";import{b as w}from"./chunk-PKDYFXMI.mjs";import{a as e}from"./chunk-E66B27AL.mjs";import g from"node:fs";import H from"node:fs/promises";import m from"node:path";var I=j.join("/"),R="Generated with [p/](https://www.prjct.app/)",P="<!-- prjct:start - DO NOT REMOVE THIS MARKER -->",L="<!-- prjct:end - DO NOT REMOVE THIS MARKER -->",n={rag:"prjct is a RAG-backed project memory harness; do not preload project history.",entrypoint:'Tasks \u2192 `prjct work "\u2026"`. Known cmds (`sync`/`search`/`remember`/\u2026) \u2192 `prjct <cmd>` \u2014 never work-wrap.',pull:"Pull only what surfaces: `prjct search` / `context memory` / `guard` / MCP \u2014 not something to load wholesale.",remember:'Save synthesized memory in English: `prjct remember <decision|learning|gotcha|context> "<text>"`.',kb:`KB (\`${I}\`): \`remember <facet>\` / \`context memory <facet>\` \u2014 on demand, never injected here.`,ship:"Ship only after user OKs: `prjct ship --md`.",loop:"Loop: land; H2+ intent; tip\u2192user SoT; close.",identity:"L0 portable; id=cwd."};function S(){return`${["---","name: prjct","description: prjct work cycles + memory; run prjct verbs, do not preload context.","---","","# prjct","","Run `prjct <cmd> --md` and follow it.","",`- ${n.rag}`,`- ${n.entrypoint}`,`- ${n.pull}`,`- ${n.remember}`,`- ${n.kb}`,`- ${n.ship}`,`- ${n.loop}`,`- ${n.identity}`,"",`Commit footer: \`${R}\``].join(`
9
9
  `)}
10
10
  `}e(S,"buildCompactSkill");var M=S,_=S;function O(t){return`${["<!-- prjct:start - DO NOT REMOVE THIS MARKER -->","# p/ \u2014 Context layer for AI agents","","Skills auto-activate for: work, intent, ship, sync, guard, remember, search, insights, performance","Other commands: run `prjct <command> --md` and follow CLI output","","Flow: known verbs run as `prjct <cmd> --md` (sync, search, remember, ship, guard, land, prime\u2026).",'`prjct work` is only for task/work cycles \u2014 never wrap a bare verb as work "sync".',"Substantive implementation follows the persisted work-cycle station from `prjct work --md`:","reviewed intent, evidence, tests when required, then code.","Sync analysis: prefer schema v1 JSON via `prjct analysis-save-llm` (markdown = thin notes only).","","Data:","- Persist everything (memories, context, intents) in ENGLISH, whatever language the user speaks",`- ${n.rag}`,`- ${n.entrypoint}`,`- ${n.pull}`,`- Sovereign knowledge base \u2014 ${n.kb}`,`- ${n.remember}`,`- ${n.loop}`,"- On close, save synthesized context; raw quotes, counters, detector rows, and transcript chunks are inputs, not final memory","- prjct remembers and shows the path; the agent decides how to execute with its own native tools","- Treat prjct output as signals, not a prescriptive harness",`- Commit footer: \`${R}\``,"- Path resolution: `.prjct/prjct.config.json` \u2192 `~/.prjct-cli/projects/{projectId}`","- Storage: `prjct` CLI (SQLite internally)","- Worktree hygiene: if working in a git worktree, remove it AFTER its PR merges \u2014 `git worktree remove` from the main worktree; never with uncommitted/unpushed work, never `--force`","",`Crew (opt-in via \`prjct crew install\`): Leader (blue) \xB7 Implementer (purple) \xB7 Reviewer (pink). Subagent dispatch is Claude-Code-only; in ${t}, identify the role you are playing explicitly.`,"","**Auto-managed by prjct-cli** | https://prjct.app","<!-- prjct:end - DO NOT REMOVE THIS MARKER -->"].join(`
11
11
  `)}