prjct-cli 3.96.0 → 3.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (503) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-HCP5FF77.mjs +31 -0
  4. package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
  5. package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
  6. package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
  7. package/dist/bin/core-chunks/agent-switch-AVSX6SLY.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-OAQXBGH3.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-3A7ODSSI.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-EWSVMKQN.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-LLHG2NSY.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-7LQ52T6L.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-M4HM7WAI.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-4OZ3FKRE.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-CUNVCEL5.mjs +10 -0
  19. package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
  20. package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
  21. package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
  22. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  23. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  24. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  25. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  26. package/dist/bin/core-chunks/chunk-2ZPM4Z6W.mjs +17 -0
  27. package/dist/bin/core-chunks/chunk-3FXNIJCS.mjs +8 -0
  28. package/dist/bin/core-chunks/chunk-3JD6KRNJ.mjs +8 -0
  29. package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3USVY66O.mjs +7 -0
  31. package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
  32. package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
  33. package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
  34. package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
  35. package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
  36. package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
  37. package/dist/bin/core-chunks/chunk-53ZPEZLU.mjs +8 -0
  38. package/dist/bin/core-chunks/chunk-56FW4P6U.mjs +10 -0
  39. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  40. package/dist/bin/core-chunks/chunk-5MN22JFI.mjs +19 -0
  41. package/dist/bin/core-chunks/chunk-5ONMON5L.mjs +13 -0
  42. package/dist/bin/core-chunks/chunk-5UUITMRX.mjs +9 -0
  43. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  44. package/dist/bin/core-chunks/chunk-5YSPND5J.mjs +9 -0
  45. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  46. package/dist/bin/core-chunks/chunk-6AFXUX2M.mjs +9 -0
  47. package/dist/bin/core-chunks/chunk-6FFOWWH2.mjs +17 -0
  48. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  50. package/dist/bin/core-chunks/chunk-6P4GMVUZ.mjs +18 -0
  51. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  52. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  53. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  54. package/dist/bin/core-chunks/chunk-7CI4AMVO.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7QMBIMEX.mjs +64 -0
  56. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  57. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  58. package/dist/bin/core-chunks/chunk-AJTBFIH2.mjs +9 -0
  59. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  60. package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
  61. package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
  62. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  63. package/dist/bin/core-chunks/chunk-BQKDJ3U6.mjs +8 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTCCUMKI.mjs +12 -0
  66. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  67. package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
  68. package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
  69. package/dist/bin/core-chunks/chunk-CDLZLTRY.mjs +10 -0
  70. package/dist/bin/core-chunks/chunk-CEOTHJIY.mjs +10 -0
  71. package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
  72. package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
  73. package/dist/bin/core-chunks/chunk-CNWEQUB7.mjs +7 -0
  74. package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  77. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
  78. package/dist/bin/core-chunks/chunk-DCVPNFS4.mjs +8 -0
  79. package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
  80. package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
  81. package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
  82. package/dist/bin/core-chunks/chunk-DN46DLU3.mjs +10 -0
  83. package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  85. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  86. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  88. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  89. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  90. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  91. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  92. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  93. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  94. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  95. package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  98. package/dist/bin/core-chunks/chunk-GOIBJ7PV.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  100. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  102. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  103. package/dist/bin/core-chunks/chunk-HEXSVBUP.mjs +8 -0
  104. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  106. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  108. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  109. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  110. package/dist/bin/core-chunks/chunk-IFLBZKKK.mjs +14 -0
  111. package/dist/bin/core-chunks/chunk-IMQCXC3R.mjs +30 -0
  112. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  113. package/dist/bin/core-chunks/chunk-INM5COWM.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-IVGWOY3U.mjs +8 -0
  116. package/dist/bin/core-chunks/chunk-J7T5IEFJ.mjs +15 -0
  117. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  118. package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
  119. package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
  120. package/dist/bin/core-chunks/chunk-K25HGTC3.mjs +10 -0
  121. package/dist/bin/core-chunks/chunk-KIRU4QFX.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KKIJAEYU.mjs +7 -0
  123. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  124. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  125. package/dist/bin/core-chunks/chunk-KWC2PCPC.mjs +10 -0
  126. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  127. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LZC6NGB6.mjs +50 -0
  129. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  130. package/dist/bin/core-chunks/chunk-MDONTD7O.mjs +21 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  133. package/dist/bin/core-chunks/chunk-MTDCRYLP.mjs +7 -0
  134. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  135. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  137. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  139. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  140. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  141. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  142. package/dist/bin/core-chunks/chunk-OYXQRBVM.mjs +10 -0
  143. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  144. package/dist/bin/core-chunks/chunk-P53YMOKR.mjs +7 -0
  145. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  146. package/dist/bin/core-chunks/chunk-PPERWRFS.mjs +13 -0
  147. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  148. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  149. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  151. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-QLMZW4K7.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  154. package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  156. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  157. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  158. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  159. package/dist/bin/core-chunks/chunk-RXXXA7Z6.mjs +7 -0
  160. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  161. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  162. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  163. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  165. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  166. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  167. package/dist/bin/core-chunks/chunk-TGNZI4KF.mjs +28 -0
  168. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  169. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  170. package/dist/bin/core-chunks/chunk-TTN2CFZC.mjs +7 -0
  171. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  172. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  173. package/dist/bin/core-chunks/chunk-UE3XKXWM.mjs +7 -0
  174. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  175. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  176. package/dist/bin/core-chunks/chunk-UT425KVX.mjs +10 -0
  177. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  178. package/dist/bin/core-chunks/chunk-V3Y3G2DE.mjs +8 -0
  179. package/dist/bin/core-chunks/chunk-V5VCXMKO.mjs +52 -0
  180. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  181. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  182. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  183. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  184. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  185. package/dist/bin/core-chunks/chunk-VDXTMAMO.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +103 -0
  187. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  188. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  189. package/dist/bin/core-chunks/chunk-WGDE3L33.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-WP5IU4W4.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-WSVMQYYU.mjs +12 -0
  192. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WZXUFSVT.mjs +25 -0
  194. package/dist/bin/core-chunks/chunk-X35YYOFE.mjs +18 -0
  195. package/dist/bin/core-chunks/chunk-X4FR5S7E.mjs +9 -0
  196. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XPRLQIVQ.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XSZG3CBO.mjs +7 -0
  200. package/dist/bin/core-chunks/chunk-XU3BQPBU.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XYDLXF5A.mjs +8 -0
  202. package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +7 -0
  203. package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
  204. package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
  205. package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
  206. package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
  207. package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
  208. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  209. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  211. package/dist/bin/core-chunks/chunk-ZHTYSYZC.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZK7BMUMR.mjs +7 -0
  213. package/dist/bin/core-chunks/chunk-ZKJZDOPT.mjs +14 -0
  214. package/dist/bin/core-chunks/chunk-ZQHSJ6FF.mjs +20 -0
  215. package/dist/bin/core-chunks/chunk-ZS7XJUPE.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/cleanup-installs-WHXUGAHM.mjs +7 -0
  218. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  219. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  220. package/dist/bin/core-chunks/cloud-FFUJZLDV.mjs +14 -0
  221. package/dist/bin/core-chunks/code-SU7GCPH6.mjs +12 -0
  222. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  223. package/dist/bin/core-chunks/codex-hooks-GOLMCL2Q.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-mcp-K4X2UIQF.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-skill-3HNVU4T4.mjs +7 -0
  226. package/dist/bin/core-chunks/command-installer-XIQK2G6W.mjs +7 -0
  227. package/dist/bin/core-chunks/config-W3RHV3GK.mjs +8 -0
  228. package/dist/bin/core-chunks/config-manager-QVFHXIKI.mjs +7 -0
  229. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  230. package/dist/bin/core-chunks/context-4KGTUAC4.mjs +38 -0
  231. package/dist/bin/core-chunks/context-DDHC7VIC.mjs +10 -0
  232. package/dist/bin/core-chunks/context-checkpoint-4CEUPEVG.mjs +27 -0
  233. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  234. package/dist/bin/core-chunks/context-tiers-4S6H22NP.mjs +7 -0
  235. package/dist/bin/core-chunks/context7-service-AZWDYK5Z.mjs +7 -0
  236. package/dist/bin/core-chunks/core-PR5WEQCS.mjs +70 -0
  237. package/dist/bin/core-chunks/crew-JQCG6NS3.mjs +24 -0
  238. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  239. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  240. package/dist/bin/core-chunks/cwd-changed-ODKZVSPB.mjs +7 -0
  241. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  242. package/dist/bin/core-chunks/daemon-2NQTBFVR.mjs +13 -0
  243. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  244. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  245. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  246. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  247. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  248. package/dist/bin/core-chunks/developer-profile-MRPBWL2K.mjs +7 -0
  249. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  250. package/dist/bin/core-chunks/distill-MLDZG5RA.mjs +7 -0
  251. package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-service-WXLB2FEE.mjs +8 -0
  253. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  254. package/dist/bin/core-chunks/dynasty-outcomes-H2O546OL.mjs +11 -0
  255. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  256. package/dist/bin/core-chunks/embeddings-7A5Z5I67.mjs +7 -0
  257. package/dist/bin/core-chunks/enriched-recall-YXK7EIKH.mjs +7 -0
  258. package/dist/bin/core-chunks/eval-4YFUBFLV.mjs +76 -0
  259. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  260. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  261. package/dist/bin/core-chunks/format-5V6GF6JJ.mjs +7 -0
  262. package/dist/bin/core-chunks/gemini-settings-ZTU3VQU3.mjs +7 -0
  263. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  264. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  265. package/dist/bin/core-chunks/grok-mcp-F3SRFMCW.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-plugin-4CE2WUYI.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-skill-GLSBOOKW.mjs +7 -0
  268. package/dist/bin/core-chunks/guard-FJBJ6IAE.mjs +13 -0
  269. package/dist/bin/core-chunks/guards-LFUFKVVH.mjs +7 -0
  270. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  271. package/dist/bin/core-chunks/harness-FN3HASSA.mjs +43 -0
  272. package/dist/bin/core-chunks/health-W2VWME7Z.mjs +11 -0
  273. package/dist/bin/core-chunks/help-I37I3V2R.mjs +14 -0
  274. package/dist/bin/core-chunks/hooks-service-C2P5DRCH.mjs +91 -0
  275. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  276. package/dist/bin/core-chunks/install-XP4S6HWQ.mjs +9 -0
  277. package/dist/bin/core-chunks/judgment-GJE332LF.mjs +21 -0
  278. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  279. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-receipt-WT4EMCAV.mjs +7 -0
  281. package/dist/bin/core-chunks/kimi-hooks-2UEUIKXV.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-mcp-DJCXZ2JY.mjs +7 -0
  283. package/dist/bin/core-chunks/land-cue-5USQ64MS.mjs +8 -0
  284. package/dist/bin/core-chunks/land-rho-ISNVEPVC.mjs +8 -0
  285. package/dist/bin/core-chunks/land-synthesis-CHARJMUP.mjs +7 -0
  286. package/dist/bin/core-chunks/lean-L53CKZNH.mjs +34 -0
  287. package/dist/bin/core-chunks/legacy-crew-sweep-2TLKJTHI.mjs +23 -0
  288. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  289. package/dist/bin/core-chunks/llm-XMH7WTHV.mjs +18 -0
  290. package/dist/bin/core-chunks/mcp-FLVIZBV2.mjs +17 -0
  291. package/dist/bin/core-chunks/memory-dream-EJWI4FJO.mjs +14 -0
  292. package/dist/bin/core-chunks/memory-export-27HTNNFI.mjs +13 -0
  293. package/dist/bin/core-chunks/memory-index-BRZDZ2BY.mjs +7 -0
  294. package/dist/bin/core-chunks/notification-KJ4FQJAW.mjs +7 -0
  295. package/dist/bin/core-chunks/notify-76B7AICZ.mjs +9 -0
  296. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  297. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  298. package/dist/bin/core-chunks/opencode-mcp-5YSIYDI3.mjs +7 -0
  299. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  300. package/dist/bin/core-chunks/pack-integrity-GXN67LJB.mjs +9 -0
  301. package/dist/bin/core-chunks/pack-manager-46SPIPPD.mjs +7 -0
  302. package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +7 -0
  303. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  304. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  305. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  306. package/dist/bin/core-chunks/pi-skill-SDHTUK3V.mjs +7 -0
  307. package/dist/bin/core-chunks/planning-S3MYVWH6.mjs +8 -0
  308. package/dist/bin/core-chunks/post-edit-5YSNEMK7.mjs +7 -0
  309. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  310. package/dist/bin/core-chunks/pre-bash-GLDILCRF.mjs +10 -0
  311. package/dist/bin/core-chunks/pre-commit-U6HPPNIC.mjs +7 -0
  312. package/dist/bin/core-chunks/pre-edit-PEYQA6P6.mjs +8 -0
  313. package/dist/bin/core-chunks/pre-package-76JR5GLO.mjs +7 -0
  314. package/dist/bin/core-chunks/pre-search-5EHNUOP3.mjs +8 -0
  315. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  316. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  318. package/dist/bin/core-chunks/preferences-BTSYWYUM.mjs +31 -0
  319. package/dist/bin/core-chunks/primitives-IXAYLX7U.mjs +13 -0
  320. package/dist/bin/core-chunks/prjct-md-SUDFWDCS.mjs +7 -0
  321. package/dist/bin/core-chunks/product-KKGJ6MMF.mjs +68 -0
  322. package/dist/bin/core-chunks/project-agent-surfaces-I2CUZUIN.mjs +7 -0
  323. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  324. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  325. package/dist/bin/core-chunks/project-memory-GYLYIJQD.mjs +7 -0
  326. package/dist/bin/core-chunks/project-style-evolution-5W25UPPN.mjs +7 -0
  327. package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +23 -0
  328. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  329. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  331. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  332. package/dist/bin/core-chunks/purge-5EPJV25P.mjs +7 -0
  333. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  334. package/dist/bin/core-chunks/registry-LK6IQ5UX.mjs +7 -0
  335. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  336. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  337. package/dist/bin/core-chunks/retention-S22T3SPT.mjs +7 -0
  338. package/dist/bin/core-chunks/retro-CLKOHAN6.mjs +13 -0
  339. package/dist/bin/core-chunks/review-risk-LLLBKUXT.mjs +12 -0
  340. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  341. package/dist/bin/core-chunks/safe-artifacts-RW5WQUUJ.mjs +9 -0
  342. package/dist/bin/core-chunks/sdd-HE7O6N5S.mjs +9 -0
  343. package/dist/bin/core-chunks/seed-JX7W53E5.mjs +10 -0
  344. package/dist/bin/core-chunks/self-heal-DFUEKNF3.mjs +7 -0
  345. package/dist/bin/core-chunks/session-continuity-BFSW4OL6.mjs +10 -0
  346. package/dist/bin/core-chunks/session-start-HVYUKJL2.mjs +7 -0
  347. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  348. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  349. package/dist/bin/core-chunks/setup-GHS24ER5.mjs +140 -0
  350. package/dist/bin/core-chunks/setup-J4JFYT63.mjs +38 -0
  351. package/dist/bin/core-chunks/shipping-I4D4AVTE.mjs +12 -0
  352. package/dist/bin/core-chunks/signals-digest-V44KYN6Z.mjs +7 -0
  353. package/dist/bin/core-chunks/skill-adherence-MHY4BZL4.mjs +13 -0
  354. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  355. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  356. package/dist/bin/core-chunks/spec-2XXPLHUZ.mjs +27 -0
  357. package/dist/bin/core-chunks/spec-context-inference-THFMXC7S.mjs +9 -0
  358. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-service-I23KJKKP.mjs +7 -0
  360. package/dist/bin/core-chunks/spec-task-breakdown-HTG6ME6G.mjs +7 -0
  361. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  362. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  363. package/dist/bin/core-chunks/stop-2H57XCGZ.mjs +15 -0
  364. package/dist/bin/core-chunks/subagent-start-5LPASXOS.mjs +7 -0
  365. package/dist/bin/core-chunks/subagent-stop-ANLSG3KN.mjs +7 -0
  366. package/dist/bin/core-chunks/surface-attribution-WL7S53XX.mjs +7 -0
  367. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  368. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  371. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  372. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  373. package/dist/bin/core-chunks/task-service-FK7FC3PE.mjs +7 -0
  374. package/dist/bin/core-chunks/tdd-NQDHU62B.mjs +9 -0
  375. package/dist/bin/core-chunks/team-XZ4Q6UBV.mjs +42 -0
  376. package/dist/bin/core-chunks/template-loader-33OVJ4G5.mjs +7 -0
  377. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  378. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  379. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  380. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  381. package/dist/bin/core-chunks/uninstall-6NFON7FO.mjs +13 -0
  382. package/dist/bin/core-chunks/update-4IE6SA6M.mjs +11 -0
  383. package/dist/bin/core-chunks/update-checker-FK7MWNWN.mjs +7 -0
  384. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  385. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  386. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  387. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  388. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  389. package/dist/bin/core-chunks/version-252QLBN2.mjs +7 -0
  390. package/dist/bin/core-chunks/watch-service-7ZERG7RC.mjs +9 -0
  391. package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +7 -0
  392. package/dist/bin/core-chunks/weak-model-mode-DH66XMD2.mjs +7 -0
  393. package/dist/bin/core-chunks/work-graph-JGJWE3AV.mjs +16 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-scope-3LXOEIUX.mjs +7 -0
  396. package/dist/bin/core-chunks/workflow-FGJVLRQ3.mjs +61 -0
  397. package/dist/bin/core-chunks/workflows-reference-UWKRZ6BJ.mjs +7 -0
  398. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  399. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  400. package/dist/bin/core-chunks/world-model-impact-RH5WH2B3.mjs +7 -0
  401. package/dist/bin/hook-chunks/{agent-switch-I4MTVE56.mjs → agent-switch-7GOGG4KG.mjs} +1 -1
  402. package/dist/bin/hook-chunks/{analysis-VN7APBHR.mjs → analysis-UI2JRLJO.mjs} +2 -2
  403. package/dist/bin/hook-chunks/{auto-flush-DX3FVSQE.mjs → auto-flush-JKIXTI2I.mjs} +1 -1
  404. package/dist/bin/hook-chunks/{capture-gate-MEIQD7ZS.mjs → capture-gate-DIPHPNIC.mjs} +1 -1
  405. package/dist/bin/hook-chunks/chunk-25OGCQTR.mjs +69 -0
  406. package/dist/bin/hook-chunks/{chunk-OLQAMCYV.mjs → chunk-63P5VOR6.mjs} +5 -5
  407. package/dist/bin/hook-chunks/{chunk-EI6VQZOX.mjs → chunk-6LU777GI.mjs} +1 -1
  408. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  409. package/dist/bin/hook-chunks/{chunk-3AHW4XQH.mjs → chunk-6RS7PNAN.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-ZZBNFNMG.mjs → chunk-6WDRJ7J7.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-PVCEWFHS.mjs → chunk-7PA4KPSR.mjs} +2 -2
  412. package/dist/bin/hook-chunks/{chunk-EXVL2OFE.mjs → chunk-A6LRNS6R.mjs} +1 -1
  413. package/dist/bin/hook-chunks/{chunk-IJ523YO2.mjs → chunk-AEDB75AK.mjs} +1 -1
  414. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  415. package/dist/bin/hook-chunks/{chunk-LF3S3MYE.mjs → chunk-ANSRNEEI.mjs} +1 -1
  416. package/dist/bin/hook-chunks/{chunk-YLOK4WRR.mjs → chunk-B2ZA5ZAO.mjs} +1 -1
  417. package/dist/bin/hook-chunks/{chunk-KDNUQPAK.mjs → chunk-B7MHIUFA.mjs} +1 -1
  418. package/dist/bin/hook-chunks/{chunk-RT2DFIWF.mjs → chunk-F3PNT2DQ.mjs} +2 -2
  419. package/dist/bin/hook-chunks/{chunk-XYKVWO23.mjs → chunk-FBEDUKMG.mjs} +1 -1
  420. package/dist/bin/hook-chunks/{chunk-DB226JIV.mjs → chunk-GER6HFWV.mjs} +1 -1
  421. package/dist/bin/hook-chunks/{chunk-NLL5AV2G.mjs → chunk-HNZ24HIK.mjs} +2 -2
  422. package/dist/bin/hook-chunks/{chunk-LR24AIEW.mjs → chunk-IDPBMN3Q.mjs} +1 -1
  423. package/dist/bin/hook-chunks/{chunk-EGCYDLSO.mjs → chunk-IFIENAZU.mjs} +1 -1
  424. package/dist/bin/hook-chunks/{chunk-KV4NXLPT.mjs → chunk-IHEOOJJT.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-H2DGDAQP.mjs → chunk-IL36ER4U.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-33BHU4OM.mjs → chunk-JF6DFOQK.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-LQLCYBFF.mjs → chunk-KOLXYWOA.mjs} +2 -2
  428. package/dist/bin/hook-chunks/{chunk-XV2LJVYB.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  429. package/dist/bin/hook-chunks/{chunk-SWJ7TLBD.mjs → chunk-NMB6YSAH.mjs} +1 -1
  430. package/dist/bin/hook-chunks/{chunk-Y3RHBU2R.mjs → chunk-NSTXHVTH.mjs} +2 -2
  431. package/dist/bin/hook-chunks/{chunk-ADYTBOCZ.mjs → chunk-ONGVBXBD.mjs} +1 -1
  432. package/dist/bin/hook-chunks/{chunk-7PBWIO4K.mjs → chunk-PFORBQBF.mjs} +2 -2
  433. package/dist/bin/hook-chunks/{chunk-WL6PKX3U.mjs → chunk-PQJ64L6U.mjs} +1 -1
  434. package/dist/bin/hook-chunks/{chunk-FZS3XGEA.mjs → chunk-RLKYEL3F.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-WJV24WE6.mjs → chunk-UBWUQ64A.mjs} +1 -1
  436. package/dist/bin/hook-chunks/{chunk-64ZEBHDX.mjs → chunk-UI25YRTY.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-YHOZTAZH.mjs → chunk-V6GGH6H5.mjs} +1 -1
  438. package/dist/bin/hook-chunks/chunk-WIA6ORIY.mjs +16 -0
  439. package/dist/bin/hook-chunks/{chunk-UVATSTRF.mjs → chunk-XXVHUYL7.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-E7NA34VQ.mjs → chunk-Y7RDBMNC.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-JZDZH6IV.mjs → chunk-YATXTHDL.mjs} +1 -1
  442. package/dist/bin/hook-chunks/{chunk-DCHIPMOG.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  443. package/dist/bin/hook-chunks/{chunk-MW54MTLB.mjs → chunk-ZH2MF7H7.mjs} +1 -1
  444. package/dist/bin/hook-chunks/{chunk-ZQI4TJ5C.mjs → chunk-ZXON2U5F.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{codex-skill-6CRFUF3A.mjs → codex-skill-UZZCACMB.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{command-installer-MUHZWDZA.mjs → command-installer-FJ73C2ZW.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{config-manager-2JJPCLKC.mjs → config-manager-XDKOTIJM.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{cwd-changed-UTD6Y4MS.mjs → cwd-changed-STP3LH6Y.mjs} +1 -1
  449. package/dist/bin/hook-chunks/{distill-5TNAM3LY.mjs → distill-63BHUJAC.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{enriched-recall-6VOIUNLN.mjs → enriched-recall-6F6LBYAB.mjs} +1 -1
  451. package/dist/bin/hook-chunks/{format-IIOFTSBF.mjs → format-VJ2YQ4XQ.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{judgment-receipt-QLV3MYFT.mjs → judgment-receipt-LSJCAYBT.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{land-cue-57B23PEL.mjs → land-cue-DEO2AZW4.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{land-synthesis-ZVPFJERV.mjs → land-synthesis-GTMFIGDM.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{legacy-crew-sweep-GR6HRSHX.mjs → legacy-crew-sweep-QPKU7ITU.mjs} +2 -2
  456. package/dist/bin/hook-chunks/{memory-index-XE2MWKQS.mjs → memory-index-KCMXQGKX.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{notification-GU2ZJP5K.mjs → notification-DX6ZHOUC.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{pack-integrity-WV5U3AFF.mjs → pack-integrity-UMLIB5RQ.mjs} +1 -1
  459. package/dist/bin/hook-chunks/{pack-manager-QLFQKP24.mjs → pack-manager-YXRK2TJ4.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{planning-VPAX5DZL.mjs → planning-JR7O5MYW.mjs} +2 -2
  461. package/dist/bin/hook-chunks/{post-edit-UXCFSR3Y.mjs → post-edit-IPTVSRVG.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{pre-bash-MB4JNNYG.mjs → pre-bash-5WWTH36N.mjs} +1 -1
  463. package/dist/bin/hook-chunks/{pre-commit-U7TRFKWX.mjs → pre-commit-KZ5TNTPW.mjs} +1 -1
  464. package/dist/bin/hook-chunks/{pre-edit-MDCQXI5F.mjs → pre-edit-XHPYBXRU.mjs} +1 -1
  465. package/dist/bin/hook-chunks/{pre-package-A6ZI5R64.mjs → pre-package-U3HDW3SX.mjs} +1 -1
  466. package/dist/bin/hook-chunks/{pre-search-ZZO3LGXJ.mjs → pre-search-R5CRK66E.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{prjct-md-MS52YLI2.mjs → prjct-md-IBQTJBK7.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{project-agent-surfaces-6AIW7KL6.mjs → project-agent-surfaces-TPZO73ZV.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{project-memory-UDH56VFP.mjs → project-memory-YQLZX5RG.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{project-style-evolution-IJXT2MCP.mjs → project-style-evolution-NOFCIIZZ.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{prompt-7VZLYONO.mjs → prompt-DJWONMTZ.mjs} +2 -2
  472. package/dist/bin/hook-chunks/{purge-N2WN6NDB.mjs → purge-5W3K2MZL.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{retention-RET4P2RO.mjs → retention-GWJ4AX7I.mjs} +1 -1
  474. package/dist/bin/hook-chunks/{sdd-PB6WKSLE.mjs → sdd-GWBRD4KI.mjs} +1 -1
  475. package/dist/bin/hook-chunks/{session-continuity-BIJXMN44.mjs → session-continuity-VH645RGR.mjs} +1 -1
  476. package/dist/bin/hook-chunks/{session-start-R2VMKW2L.mjs → session-start-4TYTI27B.mjs} +1 -1
  477. package/dist/bin/hook-chunks/{setup-PPIZHVXS.mjs → setup-VF4UHUBX.mjs} +2 -2
  478. package/dist/bin/hook-chunks/{shipping-C637PCOF.mjs → shipping-2ULWBGRX.mjs} +4 -4
  479. package/dist/bin/hook-chunks/{spec-context-inference-RTTDOZZO.mjs → spec-context-inference-HVENYOIO.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{spec-service-ENLAAMVL.mjs → spec-service-4XGQQPGP.mjs} +2 -2
  481. package/dist/bin/hook-chunks/{spec-task-breakdown-RUDEP3AY.mjs → spec-task-breakdown-JXF556UH.mjs} +1 -1
  482. package/dist/bin/hook-chunks/{state-storage-AJUPG7J5.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  483. package/dist/bin/hook-chunks/{stop-DPXAWJFN.mjs → stop-NJDYIIXR.mjs} +2 -2
  484. package/dist/bin/hook-chunks/{subagent-start-AFHPXL2S.mjs → subagent-start-2YMGD4SY.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{subagent-stop-5BMV63ML.mjs → subagent-stop-4TZJ2NSJ.mjs} +1 -1
  486. package/dist/bin/hook-chunks/{surface-attribution-EGIKCVMF.mjs → surface-attribution-UNK4J5W2.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{task-overview-F3GB77OA.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{task-service-FZABHPFV.mjs → task-service-SPUES5DO.mjs} +1 -1
  489. package/dist/bin/hook-chunks/{tdd-TAMBOPN3.mjs → tdd-MYF7I5FS.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{template-loader-MXOMU4XH.mjs → template-loader-4SYVR2UB.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{weak-model-mode-BMSPGEQY.mjs → weak-model-mode-TYJJT6JJ.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{work-scope-YCS4GTXW.mjs → work-scope-A6XPENFE.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{workspace-occupancy-JOBYNNXV.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  494. package/dist/bin/prjct-core.mjs +9 -3323
  495. package/dist/bin/prjct-hooks.mjs +1 -1
  496. package/dist/bin/prjct.mjs +7 -1
  497. package/dist/daemon/entry.mjs +514 -513
  498. package/dist/mcp/server.mjs +234 -233
  499. package/package.json +3 -2
  500. package/dist/bin/hook-chunks/chunk-3UB6SFRA.mjs +0 -11
  501. package/dist/bin/hook-chunks/chunk-D7DQABWO.mjs +0 -35
  502. package/dist/bin/hook-chunks/chunk-M4YM7Z3F.mjs +0 -69
  503. package/dist/bin/hook-chunks/chunk-TB57OYGW.mjs +0 -16
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as y}from"./chunk-NOHSLOLL.mjs";import{e as O}from"./chunk-RCIWCKL7.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";var q=/(^|\/)(auth|security|crypto|migration|migrations|password|oauth|payment|billing|secret|token|session|rbac|acl)(\/|\.|$)/i;function T(e){return e?.length?e.some(n=>q.test(n)):!1}s(T,"isHotPath");function X(e,n={}){return n.harnessLevel==="H3"||n.harnessKind==="security"||T(n.paths)?"full":e==="trivial"?"skip":e==="normal"?"standard":"full"}s(X,"routeIntensity");function ge(e,n={}){let t=O(e);return{tier:t,intensity:X(t,n)}}s(ge,"intensityFromChangeset");function b(e){let n=e.title.toLowerCase().replace(/[^a-z0-9\s]/g," ").replace(/\s+/g," ").trim().slice(0,120),t=(e.file??"").toLowerCase().replace(/\\/g,"/"),i=e.line&&e.line>0?String(Math.floor(e.line/5)*5):"";return`dna:${Y(`${n}|${t}|${i}`)}`}s(b,"findingDna");function Y(e){return(e.split("").reduce((t,i)=>Math.imul(t^i.charCodeAt(0),16777619),2166136261)>>>0).toString(16).padStart(8,"0")}s(Y,"hash32");function F(e){let n=!!e.file?.trim(),t=typeof e.line=="number"&&e.line>0,i=!!(e.evidence&&e.evidence.trim().length>=12);return n&&t&&i?3:n&&t?2:n?1:0}s(F,"evidenceScore");function _(e){let n=F(e),t=e.severity,i=t==="blocker"&&n<2?"critical":t==="critical"&&n===0?"warning":t,r=i==="warning"||i==="suggestion"?"info":e.status==="info"?"candidate":e.status;return{...e,severity:i,status:r,evidenceScore:n,dna:e.dna??b(e),blast:e.blast??S({...e,severity:i,evidenceScore:n})}}s(_,"applyEvidenceTax");var Q=/\b(prefer[- ]const|use const|should be const|can be const|const instead|instead of let|never reassigned|not reassigned|let\s*→\s*const|change let to const|let is unnecessary|why let|por qu[eé] let)\b/i;function Z(e){return Q.test(e)}s(Z,"isPreferConstClaim");function fe(e){let n=`${e.title}
8
+ ${e.evidence??""}`;if(!Z(n))return e;if(F(e)<3){let i="[CONST-ONLY TAX: include file:line + snippet and propose an immutable rewrite; title-only findings are noise]";return _({...e,severity:"suggestion",status:"info",evidence:e.evidence?`${e.evidence}
9
+ ${i}`:i})}return e}s(fe,"applyMechanicalStyleRefute");var R={blocker:100,critical:70,warning:20,suggestion:5};function S(e){return(R[e.severity]??0)+(e.evidenceScore??0)*5+(e.file&&T([e.file])?25:0)+(e.status==="stands"?10:0)+(e.status==="open"?15:0)}s(S,"blastRank");function N(e,n){return[...e].filter(t=>f(t.severity)&&(t.status==="stands"||t.status==="candidate"||t.status==="open"||t.status==="fixed")&&A(t.file,n)).sort((t,i)=>(i.blast??S(i))-(t.blast??S(t)))}s(N,"rankFindingsForFix");function f(e){return e==="blocker"||e==="critical"}s(f,"isActionableSeverity");function j(e){let n=_(e);return f(n.severity)?n.status==="info"?{...n,status:"candidate"}:n:{...n,status:"info"}}s(j,"applySeverityFloor");function pe(e){return e.map(j)}s(pe,"applySeverityFloorAll");function ee(e,n,t,i){let r=n.dna;return r?{ghosts:(e.ghosts.find(d=>d.dna===r)?e.ghosts.map(d=>d.dna===r?{...d,times:d.times+1,lastSeenAt:t,lastReason:i??d.lastReason,title:n.title||d.title}:d):[...e.ghosts,{dna:r,title:n.title,times:1,lastSeenAt:t,lastReason:i}]).sort((d,p)=>p.times-d.times).slice(0,200),updatedAt:t}:e}s(ee,"markGhost");function me(e,n,t){return n.reduce((i,r)=>r.status==="refuted"&&r.dna?ee(i,r,t,"refuted by panel"):i,e)}s(me,"recordRefutedAsGhosts");function he(e,n){if(!n?.ghosts.length)return e;let t=new Map(n.ghosts.map(i=>[i.dna,i]));return e.map(i=>{let r=i.dna??b(i),o=t.get(r);return o?{...i,dna:r,knownFalsePositive:!0,evidence:i.evidence?`${i.evidence} [GHOST: refuted ${o.times}\xD7 in this project]`:`[GHOST: refuted ${o.times}\xD7 here \u2014 challenge hard]`}:{...i,dna:r}})}s(he,"applyGhostFilter");function ve(e,n,t=se){let i=new Map,r=s(c=>{for(let m of c.findings){let h=b(m),v=i.get(h)??[];v.push({role:c.role,raw:m}),i.set(h,v)}},"ingest");r({...e,role:"red"}),r({...n,role:"blue"});let o=[...i].map(([c,m])=>{let h=new Set(m.map(l=>l.role)),v=h.has("red"),P=h.has("blue"),H=m.filter(l=>l.role==="red"),V=m.filter(l=>l.role==="blue"),x=[...m].sort((l,B)=>{let W=R[l.raw.severity]+F(l.raw)*5;return R[B.raw.severity]+F(B.raw)*5-W})[0].raw,z=[...h],M=H.some(l=>f(l.raw.severity)),U=V.some(l=>f(l.raw.severity)),K=v&&P?M!==U?"contradicted":"agreed":v?"onlyRed":"onlyBlue";return{finding:j({id:t(),severity:x.severity,status:"candidate",title:x.title,file:x.file,line:x.line,evidence:x.evidence,judge:x.judge??[...h].join("+"),role:v&&P?void 0:v?"red":"blue",dna:c,agreedBy:z}),outcome:K}}),a=o.map(({finding:c})=>c),u=o.filter(({outcome:c})=>c==="agreed").length,d=o.filter(({outcome:c})=>c==="onlyRed").length,p=o.filter(({outcome:c})=>c==="onlyBlue").length,g=o.filter(({outcome:c})=>c==="contradicted").length,C=g>0;return{findings:a,agreed:u,onlyRed:d,onlyBlue:p,contradicted:g,shouldEscalate:C,escalateReason:C?`${g} dual-blind contradiction(s): red says actionable, blue says not (or reverse). Do not tie-break \u2014 escalate to user.`:""}}s(ve,"mergeDualJudges");function D(e){return e==="full"?3:1}s(D,"refutePanelSize");function te(e,n){let t=e??[];if(t.length===0)return"stands";if(n===1)return t[0]==="refuted"?"refuted":"stands";let i=[...t];for(;i.length<3;)i.push("stands");return i.slice(0,3).filter(o=>o==="refuted").length>=2?"refuted":"stands"}s(te,"resolveRefuteVotes");function xe(e,n,t){let i=D(t);return e.map(r=>{if(r.status==="info"||r.status==="refuted"||r.status==="verified")return r;if(!f(r.severity))return{...r,status:"info"};if(r.status!=="candidate"&&r.status!=="stands")return r;let o=n[r.id],a=te(o,i);return{...r,status:a,refuteVotes:o??r.refuteVotes}})}s(xe,"applyBatchRefutation");function k(e){return e.filter(n=>f(n.severity)&&(n.status==="stands"||n.status==="candidate"||n.status==="open"))}s(k,"actionableOpen");function ye(e){return k(e.findings).length===0?{ok:!1,reason:"no actionable open findings"}:e.fixRound>=e.maxFixRounds?{ok:!1,reason:`convergence budget exhausted (${e.fixRound}/${e.maxFixRounds}) \u2014 leftover stays open; do not start round 3`}:{ok:!0,reason:""}}s(ye,"canStartFixRound");function be(e,n){let t=e.fixRound+1;return t>e.maxFixRounds?ne(e,n):{...e,fixRound:t,updatedAt:n,verdict:"in_progress"}}s(be,"advanceFixRound");function ne(e,n){let t=e.findings.map(r=>f(r.severity)&&(r.status==="stands"||r.status==="candidate")?{...r,status:"open"}:r),i=k(t).length>0||t.some(r=>r.status==="open");return{...e,findings:t,fixRound:e.maxFixRounds,updatedAt:n,verdict:i?"blocked":"approved",precisionHint:E(t)}}s(ne,"markLeftoversOpen");function Re(e,n,t,i){let r=new Set(n),o=e.findings.map(a=>!r.has(a.id)||(t==="fixed"||t==="verified")&&!G(a,e.scopePaths)?a:{...a,status:t});return{...e,findings:o,updatedAt:i,precisionHint:E(o)}}s(Re,"markFindings");function Fe(e,n,t){if(t!=="fixed"&&t!=="verified")return[];let i=new Set(n);return e.findings.filter(r=>i.has(r.id)&&!G(r,e.scopePaths)).map(r=>r.id)}s(Fe,"markFindingsSkippedByScope");function E(e){let n=e.filter(r=>r.status==="verified").length,t=e.filter(r=>r.status==="refuted").length,i=n+t;if(i!==0)return Math.round(n/i*1e3)/1e3}s(E,"computePrecisionHint");function L(e){if(e.verdict==="escalated")return"escalated";if(e.verdict==="approved")return"approved";if(e.findings.length===0)return"in_progress";let n=k(e.findings),t=e.findings.some(r=>r.status==="open");return n.length>0||t?"blocked":e.findings.some(r=>f(r.severity)&&r.status==="candidate")?"in_progress":"approved"}s(L,"computeVerdict");function je(e,n){let t=L(e);return{...e,verdict:t,updatedAt:n,precisionHint:E(e.findings)}}s(je,"finalizeLedger");function ke(e){let t=N(e.findings.filter(i=>f(i.severity)&&(i.status==="fixed"||i.status==="stands"||i.status==="open")),e.scopePaths).map(({id:i,severity:r,status:o,title:a,file:u,line:d,blast:p,dna:g})=>({id:i,severity:r,status:o,title:a,file:u,line:d,blast:p,dna:g}));return{intensity:e.intensity,fixRound:e.fixRound,maxFixRounds:e.maxFixRounds,findings:t,fixOrder:t.map(i=>i.id),scope:(()=>{let i=e.scopePaths??[];return`Re-judge ONLY the persisted ledger findings below plus the fix-diff for those items. Confirm each fixed finding is actually resolved; report regressions on those lines only. Fix order is blast-ranked \u2014 do not reorder by preference.${i.length>0?` Frozen scope (${i.length} paths): ${i.slice(0,12).join(", ")}${i.length>12?"\u2026":""}.`:""}`})(),outOfScope:"Do NOT reopen the original full PR diff. Do NOT invent new WARNING/SUGGESTION loops. Findings whose file is outside the frozen git scope are follow-up only (info) \u2014 they do not enter fix loops. New BLOCKER/CRITICAL on in-scope fix-diff may be added as candidates (evidence tax + severity floor + challenge still apply)."}}s(ke,"buildReReviewBrief");var w="RED (attack): assume the change is hostile. Hunt production killers \u2014 races, auth holes, data loss, silent fail. Prefer over-calling; blue + refuters will kill FPs. Output severity + file:line + 1-line repro. Enforce const-only bindings with a concrete immutable rewrite when reassignment exists.",J="BLUE (defense): assume the author is competent. Only report defects you can reproduce from the code. Challenge red overclaims. Same schema: severity + file:line + evidence. For const-only findings, require a viable immutable rewrite rather than a keyword-only suggestion.";function Se(e,n){if(n==="skip"&&!e)return{kind:"skip_ship",directive:"Intensity skip \u2014 ship without judgment tax.",steps:["prjct ship"],intensity:n,fixRound:0,maxFixRounds:0,counts:$(),rankedFixIds:[]};if(!e)return{kind:"open_ledger",directive:`Open a judgment ledger (intensity=${n}).`,steps:["prjct judgment open","prjct judgment next"],intensity:n,fixRound:0,maxFixRounds:y,counts:$(),rankedFixIds:[],judgeCharters:n==="full"?{red:w,blue:J}:void 0};let t=ie(e.findings),i=N(e.findings),r={intensity:e.intensity,fixRound:e.fixRound,maxFixRounds:e.maxFixRounds,counts:t,rankedFixIds:i.map(o=>o.id),judgeCharters:e.intensity==="full"?{red:w,blue:J}:void 0};if(e.verdict==="escalated")return{...r,kind:"escalate",directive:`ESCALATED: ${e.escalateReason??"judges contradict"}. Surface to user.`,steps:["Present both judge verdicts to the user","Do not ship"]};if(e.verdict==="approved")return{...r,kind:"approve",directive:"Ledger APPROVED \u2014 ship is clear for judgment gate.",steps:["prjct ship"]};if(e.findings.length===0)return{...r,kind:"dispatch_reviewers",directive:e.intensity==="full"?"Dispatch RED + BLUE judges in parallel (blind). Then prjct judgment merge. If both find nothing: prjct judgment approve.":"Dispatch ONE focused reviewer. Record findings with prjct judgment add (or approve if truly clean).",steps:e.intensity==="full"?["Spawn RED judge (attack charter) + BLUE judge (defense charter) in parallel","prjct judgment merge --red '[...]' --blue '[...]'","prjct judgment next"]:["Spawn one fresh-context reviewer (model: sonnet)","prjct judgment add --severity \u2026 --title \u2026 --file \u2026 --line \u2026","prjct judgment challenge --verdicts \u2026"]};if(t.candidates>0&&t.stands===0&&t.fixed===0)return{...r,kind:"dispatch_refuters",directive:`Batch-challenge ${t.candidates} candidate(s). Ceiling: ${D(e.intensity)} vote(s) total \u2014 never per-finding tasks.`,steps:["Spawn ONE batched refuter (or 3-lens panel on full) over ALL candidates","prjct judgment challenge --verdicts id:stands|refuted[,\u2026]","prjct judgment next"]};if(t.stands>0||t.open>0){if(e.fixRound>=e.maxFixRounds)return{...r,kind:"blocked_budget",directive:"Convergence budget exhausted with leftovers \u2014 report open, no round 3.",steps:["prjct judgment fix-round # marks leftovers open","Surface open findings to user or escalate"]};let o=i.slice(0,5).map(a=>`${a.id}(${a.severity})`).join(", ");return{...r,kind:"fix_ranked",directive:`Fix blast-ranked stands (${t.stands} open). Top: ${o||"\u2014"}`,steps:["prjct judgment fix-round",`Implementer fixes ONLY stands \u2014 order: ${r.rankedFixIds.join(" \u2192 ")||"\u2014"}`,`prjct judgment fixed ${r.rankedFixIds.join(" ")}`,"prjct judgment brief # scoped re-judge",`prjct judgment verify ${r.rankedFixIds.join(" ")}`]}}return t.fixed>0?{...r,kind:"rejudge_scoped",directive:`Re-judge ${t.fixed} fixed finding(s) with scoped brief only.`,steps:["prjct judgment brief","Fresh judge on ledger+fix-diff only","prjct judgment verify <ids>","prjct judgment approve"]}:L(e)==="approved"?{...r,kind:"approve",directive:"Clean ledger \u2014 approve and ship.",steps:["prjct judgment approve","prjct ship"]}:{...r,kind:"idle",directive:"Ledger in progress \u2014 run prjct judgment status.",steps:["prjct judgment status","prjct judgment next"]}}s(Se,"buildNextAction");function $(){return{candidates:0,stands:0,refuted:0,fixed:0,verified:0,info:0,open:0,ghosts:0}}s($,"emptyCounts");function ie(e){let n=$();for(let t of e)t.status==="candidate"?n.candidates++:t.status==="stands"?n.stands++:t.status==="refuted"?n.refuted++:t.status==="fixed"?n.fixed++:t.status==="verified"?n.verified++:t.status==="info"?n.info++:t.status==="open"&&n.open++,t.knownFalsePositive&&n.ghosts++;return n}s(ie,"countStatuses");function we(e){switch(e){case"skip":return{intensity:e,reviewers:"none \u2014 trivial/docs-only changeset",refuters:"none",severityFloor:"n/a",evidenceTax:"n/a",maxFixRounds:0,shipExpectation:"ship without judgment ledger"};case"standard":return{intensity:e,reviewers:"exactly ONE focused review pass (fresh-context subagent)",refuters:"exactly ONE batched refuter over all BLOCKER/CRITICAL candidates",severityFloor:"only verified BLOCKER/CRITICAL enter fix loops; WARNING/SUGGESTION = info once",evidenceTax:"blocker without file:line demoted to critical; title-only critical \u2192 info",maxFixRounds:y,shipExpectation:"ledger verdict approved (or --no-spec-gate override)"};case"full":return{intensity:e,reviewers:"dual-blind RED (attack) + BLUE (defense) in parallel \u2014 merge via prjct judgment merge",refuters:"exactly THREE batched refuter votes (correctness/impact/repro); 2-of-3 kills; fail-closed stands",severityFloor:"only verified BLOCKER/CRITICAL enter fix loops; WARNING/SUGGESTION = info once",evidenceTax:"blocker without file:line demoted to critical; title-only critical \u2192 info",maxFixRounds:y,shipExpectation:"ledger verdict approved after \u22642 fix rounds (or escalate)",redCharter:w,blueCharter:J}}}s(we,"intensityProtocol");function Je(e){let{codeStrict:n,intensity:t,ledger:i,override:r}=e;if(r)return{blocked:!1,mode:"none",message:"",reason:"override"};if(t==="skip")return{blocked:!1,mode:"none",message:"",reason:"skip-intensity"};if(!i){let d=`Precision judgment required (intensity=${t}): run \`prjct judgment plan\` \u2192 \`prjct judgment open\` \u2192 follow \`prjct judgment next\`.${t==="full"?" Dual-blind RED+BLUE required (code-strict default).":""} Override only with explicit consent: \`prjct ship --no-judgment-gate\`.`;return n?{blocked:!0,mode:"hard",message:d,reason:"missing-ledger"}:{blocked:!1,mode:"soft",message:`\u2696\uFE0F ${d}`,reason:"soft-reminder"}}let o=L(i);if(o==="approved"){let u=i.precisionHint!==void 0?`, precision\u2248${Math.round(i.precisionHint*100)}%`:"";return{blocked:!1,mode:"none",message:`\u2696\uFE0F judgment ${i.id.slice(0,8)} \u2192 APPROVED (intensity=${i.intensity}, rounds=${i.fixRound}/${i.maxFixRounds}${u})`,reason:"approved"}}if(o==="escalated"){let u=`Judgment escalated: ${i.escalateReason??"judges contradict"}. Resolve with the user before ship.`;return n?{blocked:!0,mode:"hard",message:u,reason:"escalated"}:{blocked:!1,mode:"soft",message:`\u2696\uFE0F ${u}`,reason:"escalated"}}if(o==="blocked"){let u=[...k(i.findings),...i.findings.filter(g=>g.status==="open")],d=u.slice(0,5).map(g=>`${g.severity}:${g.title}`).join("; "),p=`Judgment blocked \u2014 open actionable (${u.length}): ${d||"see ledger"}. Fix blast-ranked + re-judge (\u2264${y} rounds) or escalate. \u2192 \`prjct judgment next\``;return n?{blocked:!0,mode:"hard",message:p,reason:"blocked-findings"}:{blocked:!1,mode:"soft",message:`\u2696\uFE0F ${p}`,reason:"blocked-findings"}}let a=`Judgment in progress (round ${i.fixRound}/${i.maxFixRounds}, ${i.findings.length} findings). \u2192 \`prjct judgment next\``;return n?{blocked:!0,mode:"hard",message:a,reason:"in-progress"}:{blocked:!1,mode:"soft",message:`\u2696\uFE0F ${a}`,reason:"in-progress"}}s(Je,"judgmentShipVerdict");function $e(e,n){let t=j(n),i=t.dna??b(t),r=e.findIndex(d=>(d.dna??b(d))===i);if(r<0){let d={...t,dna:i};return{findings:[...e,d],finding:d,deduped:!1}}let o=e[r],a=j({...o,severity:R[t.severity]>R[o.severity]?t.severity:o.severity,title:t.title.length>=o.title.length?t.title:o.title,file:t.file??o.file,line:t.line??o.line,evidence:(t.evidence?.length??0)>(o.evidence?.length??0)?t.evidence:o.evidence,judge:[o.judge,t.judge].filter(Boolean).join("+")||o.judge,agreedBy:[...new Set([...o.agreedBy??[],...t.agreedBy??[],t.judge].filter(Boolean))],dna:i}),u=[...e];return u[r]=a,{findings:u,finding:a,deduped:!0}}s($e,"upsertFinding");function I(e){return e.replace(/\\/g,"/").replace(/^\.\//,"").replace(/\/+/g,"/").replace(/\/$/,"").trim()}s(I,"normalizeScopePath");function A(e,n){if(!n||n.length===0||!e||!e.trim())return!0;let t=I(e);if(!t)return!0;for(let i of n){let r=I(i);if(r&&(t===r||t.startsWith(`${r}/`)))return!0}return!1}s(A,"pathInScope");function re(e,n){return A(e.file,n)||e.status==="info"||e.status==="refuted"?e:{...e,status:"info",evidence:(e.evidence?`${e.evidence} \xB7 `:"")+"out of frozen review scope (follow-up only; does not enter fix loops or block ship)"}}s(re,"applyScopeFreeze");function Ie(e,n){return e.map(t=>re(t,n))}s(Ie,"applyScopeFreezeAll");function G(e,n){return e.status==="info"||e.status==="refuted"?!1:A(e.file,n)}s(G,"findingInFixScope");function se(){return`jf_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}s(se,"newFindingId");function oe(){return`jl_${Date.now().toString(36)}_${Math.random().toString(36).slice(2,8)}`}s(oe,"newLedgerId");function Ee(e){let n=e.scopePaths&&e.scopePaths.length>0?[...new Set(e.scopePaths.map(I).filter(Boolean))]:void 0;return{id:oe(),target:e.target,intensity:e.intensity,maxFixRounds:y,fixRound:0,findings:[],verdict:"in_progress",createdAt:e.now,updatedAt:e.now,baseSha:e.baseSha,headSha:e.headSha,deliveryTier:e.deliveryTier,scopePaths:n,scopeFrozenAt:n?e.now:void 0}}s(Ee,"createLedger");export{q as a,T as b,X as c,ge as d,b as e,F as f,_ as g,Q as h,Z as i,fe as j,S as k,N as l,f as m,j as n,pe as o,ee as p,me as q,he as r,ve as s,D as t,te as u,xe as v,k as w,ye as x,be as y,ne as z,Re as A,Fe as B,E as C,L as D,je as E,ke as F,Se as G,we as H,Je as I,$e as J,I as K,A as L,re as M,Ie as N,G as O,se as P,oe as Q,Ee as R};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as v,c as C}from"./chunk-YLYAYRSJ.mjs";import{b as p,c as j}from"./chunk-DOJPSIMG.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";j();import k from"node:fs/promises";import E from"node:path";var h="_prjctManaged";function b(){return process.env.PRJCT_TEST_MODE==="1"?E.join(p(".prjct-tests"),"cursor","hooks.json"):p(".cursor","hooks.json")}s(b,"getCursorHooksJsonPath");function H(){let r=[];for(let e of C)e.event==="SessionStart"?r.push({cursorEvent:"sessionStart",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="UserPromptSubmit"?r.push({cursorEvent:"beforeSubmitPrompt",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="PreToolUse"&&e.matcher==="Bash"?r.push({cursorEvent:"preToolUse",matcher:"Shell|Bash",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="PreToolUse"&&e.matcher==="Edit|Write"?r.push({cursorEvent:"preToolUse",matcher:"Write|StrReplace|Edit",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="PostToolUse"&&e.matcher==="Edit|Write"?r.push({cursorEvent:"postToolUse",matcher:"Write|StrReplace|Edit",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="Stop"?r.push({cursorEvent:"stop",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="SubagentStart"?r.push({cursorEvent:"subagentStart",subcommand:e.subcommand,name:`prjct-${e.subcommand}`}):e.event==="SubagentStop"&&r.push({cursorEvent:"subagentStop",subcommand:e.subcommand,name:`prjct-${e.subcommand}`});return r}s(H,"cursorHookMaps");function R(r){return v(r,"PRJCT_HOOK_HOST=cursor")}s(R,"hookCommand");function l(r){return r[h]===!0||(r.name?.startsWith("prjct-")??!1)||/PRJCT_HOOK_HOST=cursor/.test(r.command)}s(l,"isPrjctHandler");function d(r){return r[h]===!0?!1:/(^|\/|\s)prjct\s+hook\s+\S+/.test(r.command??"")}s(d,"isLegacyPrjctHandler");async function g(r){try{let e=await k.readFile(r,"utf-8"),t=JSON.parse(e);return t&&typeof t=="object"?t:{version:1}}catch(e){if(e.code==="ENOENT")return{version:1};throw e}}s(g,"readHooksFile");async function S(r,e){await k.mkdir(E.dirname(r),{recursive:!0}),e.version=e.version??1,await k.writeFile(r,`${JSON.stringify(e,null,2)}
8
+ `,"utf-8")}s(S,"writeHooksFile");function O(r){let e={command:R(r.subcommand),timeout:30,name:r.name,[h]:!0};return r.matcher&&(e.matcher=r.matcher),e}s(O,"handlerFor");function P(r){let e=new Set(H().map(o=>o.name)),t=[];for(let o of Object.keys(r))r[o]=(r[o]??[]).filter(a=>!l(a)&&!d(a)||a.name&&e.has(a.name)?!0:(t.push(a),!1)),r[o].length===0&&delete r[o];return t.length}s(P,"pruneOrphans");async function _(r=b()){let e=await g(r),t={...e.hooks??{}},o=[],a=[];for(let u of H()){let i=(t[u.cursorEvent]??[]).filter(n=>!(d(n)&&!l(n))),m=O(u),f=i.findIndex(n=>l(n)?n.name?n.name===u.name:n.command.includes(`hook ${u.subcommand}`)&&(n.matcher??"")===(u.matcher??""):!1);if(f>=0){let n=i[f];n.command===m.command&&n.matcher===m.matcher&&n.timeout===m.timeout?a.push(u):(i[f]={...n,...m},o.push(u))}else i.push(m),o.push(u);t[u.cursorEvent]=i}let c=P(t);return e.version=1,e.hooks=t,await S(r,e),{hooksPath:r,hooksWritten:o.length,alreadyPresent:a.length,hooksPruned:c}}s(_,"installCursorHooks");async function $(r=b()){let e=await g(r);if(!e.hooks)return{hooksPath:r,hooksRemoved:0};let t=[];for(let o of Object.keys(e.hooks)){let a=e.hooks[o]?.length??0;e.hooks[o]=(e.hooks[o]??[]).filter(c=>l(c)||d(c)?(t.push(c),!1):!0),e.hooks[o].length===0&&delete e.hooks[o]}return Object.keys(e.hooks).length===0&&delete e.hooks,await S(r,e),{hooksPath:r,hooksRemoved:t.length}}s($,"uninstallCursorHooks");async function F(r=b()){let e=await g(r);return{installed:Object.values(e.hooks??{}).flat().filter(o=>l(o)||d(o)).length,expected:H().length,path:r}}s(F,"cursorHooksStatus");export{b as a,H as b,_ as c,$ as d,F as e};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as r}from"./chunk-3TRXQAU4.mjs";var c=["Popper","Copernicus","McClintock","Volta","Ada","Turing","Hypatia","Feynman","Lovelace","Curie","Hopper","Tesla","Noether","Faraday","Kepler","Mendel","Dirac","Shannon","Babbage","Boole","Planck","Hubble","Sagan","Meitner","Ramanujan","Euclid","Gauss","Fourier","Pascal","Archimedes"];function u(e){return e.split("").reduce((t,n)=>Math.imul(t^n.charCodeAt(0),16777619),2166136261)>>>0}r(u,"hashSeed");function g(e,t=[]){let n=new Set([...t].map(i=>i.toLowerCase())),a=c.filter(i=>!n.has(i.toLowerCase())),s=a.length>0?a:[...c],o=u(e)%s.length;return s[o]}r(g,"pickCodename");function l(e,t){let n=new Set;return e.map((a,s)=>{let o=g(`${t}::${a}::${s}`,n);return n.add(o.toLowerCase()),{role:a,name:o}})}r(l,"assignAgentCast");var p=["explore","implement","review"],m=["leader","implementer","reviewer"];function C(e){return e.length===0?"":`Cast: ${e.map(t=>`${t.role}\u2192${t.name}`).join(" \xB7 ")}`}r(C,"formatAgentCastLine");function h(e){return e.length===0?"":`Name each subagent when you dispatch: ${e.map(n=>`\`${n.name}\` (${n.role})`).join(", ")}. Reuse these labels in logs/claims so the cast stays legible.`}r(h,"formatAgentCastDispatchHint");function A(e,t){return e==="parallel"?l([...p],t):e==="crew"?l([...m],t):[]}r(A,"castForFanout");export{c as a,u as b,g as c,l as d,p as e,m as f,C as g,h,A as i};
@@ -0,0 +1,12 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as c,h as f,i as p}from"./chunk-QZ7T2EYR.mjs";import{g as u,i as C}from"./chunk-DMO3ZFUG.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";C();var g=/^(main|index|app|server|cli|handler|router|bootstrap|init|start|run|default|setup|config|plugin|middleware|layout|page|loader|action)$/i,h=/(?:^|\/)(?:bin\/|scripts\/|cli\.|main\.|index\.|app\.|server\.|page\.|layout\.|route\.|middleware\.)/i;function m(e){return!!(e.kind==="route"||g.test(e.name)&&e.exported||h.test(e.file)&&e.exported||/__tests__|\.test\.|\.spec\.|fixtures?\//i.test(e.file)||e.kind==="type"||e.kind==="interface"||e.kind==="enum"||e.kind==="const")}s(m,"isEntryPoint");function x(e){let t=new Set;try{let n=u.query(e,"SELECT DISTINCT dst FROM code_symbol_edges WHERE edge_type = 'CALLS'");for(let o of n)t.add(o.dst)}catch{}return t}s(x,"loadCallersOf");function D(e,t={}){let n=t.limit??50;if(!c(e))return{ready:!1,totalSymbols:0,dead:[],skippedEntries:0,note:"No symbol index. Run `prjct sync` or `prjct code reindex`."};let o=p(e),y=x(e),i=[],b=o.filter(m).length;for(let r of o)if(!m(r)&&!(r.kind!=="function"&&r.kind!=="method"&&r.kind!=="class")&&!y.has(r.id)&&(i.push({symbol:r,reason:r.exported?"exported but no inbound CALLS in graph":"no inbound CALLS in graph"}),i.length>=n))break;return i.sort((r,d)=>{let a=r.symbol.exported?0:1,l=d.symbol.exported?0:1;return a!==l?a-l:r.symbol.file.localeCompare(d.symbol.file)}),{ready:!0,totalSymbols:f(e)?.symbolCount??o.length,dead:i,skippedEntries:b,note:"Best-effort: regex CALLS graph. Dynamic dispatch / reflection may false-positive. Entry points + tests + types excluded."}}s(D,"findDeadCode");function E(e){if(!e.ready)return`## Dead code
8
+
9
+ > ${e.note}
10
+ `;let t=["## Dead code (zero inbound CALLS)","",`- **Candidates**: ${e.dead.length} (cap)`,`- **Symbols scanned**: ${e.totalSymbols}`,`- **Skipped entry/types/tests**: ${e.skippedEntries}`,""];if(e.dead.length===0)t.push("_None found (or all have callers / are entries)._");else for(let n of e.dead){let o=n.symbol;t.push(`- \`${o.kind}\` **${o.name}** \u2014 \`${o.file}:${o.startLine}\`${o.exported?" (exported)":""}`),t.push(` - ${n.reason}`)}return t.push("",`_${e.note}_`),t.join(`
11
+ `)}s(E,"formatDeadCodeMd");function L(e){if(!e.ready)return`dead-code: ${e.note}`;let t=[`Dead code: ${e.dead.length} candidate(s) (of ${e.totalSymbols} symbols)`];for(let n of e.dead.slice(0,30))t.push(` ${n.symbol.kind} ${n.symbol.name} ${n.symbol.file}:${n.symbol.startLine}`);return t.join(`
12
+ `)}s(L,"formatDeadCodeText");export{D as a,E as b,L as c};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as o}from"./chunk-L4TUXFCL.mjs";import{g as a,i as c}from"./chunk-DMO3ZFUG.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";c();function E(n,e,r){try{let s=o();return a.run(n,`INSERT INTO workflow_runs
8
+ (id, project_id, command, work_cycle_id, status, iteration, max_iterations, started_at)
9
+ VALUES (?, ?, ?, ?, 'running', 0, NULL, ?)`,s,n,e,r??null,Date.now()),s}catch{return null}}i(E,"startWorkflowRun");function w(n,e,r,s,u){if(e)try{a.run(n,`INSERT INTO gate_evaluation (id, run_id, rule_id, passed, reason, evaluated_at)
10
+ VALUES (?, ?, ?, ?, ?, ?)`,o(),e,String(r),s?1:0,u??null,Date.now())}catch{}}i(w,"recordGateEvaluation");function R(n,e,r,s,u,l){if(e)try{a.run(n,`INSERT INTO workflow_run_step (id, run_id, rule_id, seq, status, attempt, output, ended_at)
11
+ VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,o(),e,String(r),s,u,l??null,Date.now())}catch{}}i(R,"recordRunStep");function b(n,e=20){try{let r=a.query(n,"SELECT id, command, status, started_at, ended_at FROM workflow_runs ORDER BY started_at DESC LIMIT ?",e);if(r.length===0)return[];let s=r.map(()=>"?").join(","),u=r.map(t=>t.id),l=a.query(n,`SELECT run_id, COUNT(*) AS n FROM workflow_run_step WHERE run_id IN (${s}) GROUP BY run_id`,...u),m=a.query(n,`SELECT run_id, passed, COUNT(*) AS n FROM gate_evaluation WHERE run_id IN (${s}) GROUP BY run_id, passed`,...u),_=new Map(l.map(t=>[t.run_id,t.n])),d=new Map;for(let t of m){let g=d.get(t.run_id)??{passed:0,failed:0};t.passed?g.passed=t.n:g.failed=t.n,d.set(t.run_id,g)}return r.map(t=>({id:t.id,command:t.command,status:t.status,startedAt:t.started_at,endedAt:t.ended_at,steps:_.get(t.id)??0,gatesPassed:d.get(t.id)?.passed??0,gatesFailed:d.get(t.id)?.failed??0}))}catch{return[]}}i(b,"getRecentWorkflowRuns");function S(n,e,r){if(e)try{a.run(n,"UPDATE workflow_runs SET status = ?, ended_at = ? WHERE id = ?",r,Date.now(),e)}catch{}}i(S,"finishWorkflowRun");export{E as a,w as b,R as c,b as d,S as e};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as i}from"./chunk-EHVU2SMR.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";import r from"chalk";var c={task:"Start new work cycle",done:"Complete current work",pause:"Pause and switch context",resume:"Continue paused task",ship:"Ship the feature",reopen:"Reopen for rework",next:"View task queue",sync:"Analyze project",bug:"Report a bug",idea:"Capture an idea"},g={task:"work"};function p(e){return g[e]??e}s(p,"publicCommand");var l={task:"working",done:"completed","done-subtask":"working",pause:"paused",resume:"working",ship:"shipped",reopen:"working",next:"idle",sync:"idle",init:"idle",bug:"working",idea:"idle"};function w(e,n={}){if(n.quiet)return;let a=l[e]||"idle",d=i.getValidCommands(a);if(d.length===0)return;let t=d.map(o=>({cmd:`p. ${p(o)}`,desc:c[o]||o}));console.log(r.dim(`
8
+ Next:`));for(let o of t){let u=r.cyan(o.cmd.padEnd(12));console.log(r.dim(` ${u} \u2192 ${o.desc}`))}}s(w,"showNextSteps");function k(e,n=!1){let a=l[e]||"idle";return i.getValidCommands(a).map(t=>({cmd:n?`prjct ${p(t)} --md`:`p. ${p(t)}`,desc:c[t]||t}))}s(k,"getNextSteps");function S(e){let n=i.getStateInfo(e);console.log(r.dim(`\u{1F4CD} State: ${r.white(e.toUpperCase())} - ${n.description}`))}s(S,"showStateInfo");export{w as a,k as b,S as c};
@@ -0,0 +1,28 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as ct,d as lt,e as dt}from"./chunk-Y7XOKG4O.mjs";import{a as mt,b as pt}from"./chunk-JCWA7NLM.mjs";import{e as St}from"./chunk-CFD6CW7T.mjs";import{a as at}from"./chunk-IVGWOY3U.mjs";import{a as Ge}from"./chunk-JT4RNQ67.mjs";import{a as We}from"./chunk-VCSESVZ4.mjs";import{b as it,c as ot}from"./chunk-6OYLZ4NM.mjs";import{d as ut,f as cs}from"./chunk-HYMJVHAX.mjs";import{a as ft,b as ht,c as gt,d as yt}from"./chunk-P2KU4FFA.mjs";import{a as nt}from"./chunk-MG3YN3AI.mjs";import{b as Xe,c as Ze,d as et}from"./chunk-YEALP3WX.mjs";import{e as tt,f as st}from"./chunk-QZ7T2EYR.mjs";import{a as rt}from"./chunk-IFLBZKKK.mjs";import{a as Qe}from"./chunk-CNWEQUB7.mjs";import{b as Ke,c as qe,d as Ye}from"./chunk-AJXELVNH.mjs";import{a as Be}from"./chunk-XPRLQIVQ.mjs";import{a as Je}from"./chunk-KUQLXY2P.mjs";import{b as se}from"./chunk-HCPQZRR3.mjs";import{b as j}from"./chunk-EHVU2SMR.mjs";import{a as Ue}from"./chunk-E5QQDYBR.mjs";import{b as ze}from"./chunk-B7AQHL7B.mjs";import{b as H}from"./chunk-3USVY66O.mjs";import{b as Ve}from"./chunk-Q6C27OL7.mjs";import{c as Re}from"./chunk-XSZG3CBO.mjs";import{f as k,g as _,i as ee}from"./chunk-DMO3ZFUG.mjs";import{d as Le}from"./chunk-DN46DLU3.mjs";import{a as f,b as $}from"./chunk-RP7F67ZT.mjs";import{a as Oe,b as Ne}from"./chunk-INJ5WT2D.mjs";import{d as te}from"./chunk-OYXQRBVM.mjs";import{A as $e,E as is,F as He,G as os,e as P,l as Z,x as _e}from"./chunk-HU5ERAAV.mjs";import{e as Ae,i as rs}from"./chunk-VWFVSNQT.mjs";import{a as je,p as as}from"./chunk-D62TAZG6.mjs";import{d as w,e as Ie}from"./chunk-623SNKDH.mjs";import{d as Me,e as Fe,f as Te,l as R,p as J}from"./chunk-HYIT7MF5.mjs";import{a as M,d as Ee,e as v,g as T}from"./chunk-225DWS4D.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";function vt(n,t){let e=[];O("Languages",n.languages,t.languages,e),O("Frameworks",n.frameworks,t.frameworks,e),(n.packageManager??"")!==(t.packageManager??"")&&e.push({field:"Package manager",type:"changed",before:n.packageManager??"(none)",after:t.packageManager??"(none)"}),(n.sourceDir??"")!==(t.sourceDir??"")&&e.push({field:"Source directory",type:"changed",before:n.sourceDir??"(none)",after:t.sourceDir??"(none)"}),(n.testDir??"")!==(t.testDir??"")&&e.push({field:"Test directory",type:"changed",before:n.testDir??"(none)",after:t.testDir??"(none)"}),O("Config files",n.configFiles,t.configFiles,e),n.fileCount!==t.fileCount&&e.push({field:"File count",type:"changed",before:String(n.fileCount),after:String(t.fileCount)});let s=n.patterns.map(c=>c.name),a=t.patterns.map(c=>c.name);O("Patterns",s,a,e);let i=n.antiPatterns.map(c=>c.issue),r=t.antiPatterns.map(c=>c.issue);return O("Anti-patterns",i,r,e),nt(e,n.commitHash??null,t.commitHash??null)}o(vt,"generateAnalysisDiff");function Vs(n){if(!n.hasChanges)return`## Analysis Diff
8
+
9
+ No changes between runs.`;let t=[];t.push("## Analysis Diff"),(n.beforeCommit||n.afterCommit)&&t.push(`> \`${n.beforeCommit?.substring(0,7)??"(none)"}\` \u2192 \`${n.afterCommit?.substring(0,7)??"(none)"}\``),t.push(""),t.push("| Change | Field | Detail |"),t.push("|--------|-------|--------|");for(let s of n.items){let a=s.type==="added"?"+":s.type==="removed"?"-":"~",i=s.type==="changed"?`${s.before} \u2192 ${s.after}`:s.after??s.before??"";t.push(`| ${a} | ${s.field} | ${i} |`)}t.push("");let e=[];return n.summary.added>0&&e.push(`${n.summary.added} added`),n.summary.removed>0&&e.push(`${n.summary.removed} removed`),n.summary.changed>0&&e.push(`${n.summary.changed} changed`),t.push(`**Summary**: ${e.join(", ")}`),t.join(`
10
+ `)}o(Vs,"formatAnalysisDiffMd");function zs(n){if(!n.hasChanges)return"No changes between analysis runs.";let t=[];(n.beforeCommit||n.afterCommit)&&(t.push(` ${n.beforeCommit?.substring(0,7)??"(none)"} \u2192 ${n.afterCommit?.substring(0,7)??"(none)"}`),t.push(""));for(let e of n.items)e.type==="added"?t.push(` + ${e.field}: ${e.after}`):e.type==="removed"?t.push(` - ${e.field}: ${e.before}`):t.push(` ~ ${e.field}: ${e.before} \u2192 ${e.after}`);return t.join(`
11
+ `)}o(zs,"formatAnalysisDiffText");function O(n,t,e,s){let a=new Set(t),i=new Set(e);for(let r of e)a.has(r)||s.push({field:n,type:"added",after:r});for(let r of t)i.has(r)||s.push({field:n,type:"removed",before:r})}o(O,"diffStringArray");T();J();import ne from"node:fs/promises";import I from"node:path";import{z as h}from"zod";function B(n,t){let e=n.filter(a=>!a.passed).length,s=n.filter(a=>a.passed).length;return{passed:e===0,checks:n,totalMs:Date.now()-t,failedCount:e,passedCount:s}}o(B,"summarizeChecks");rs();var ls=h.enum(["draft","verified","sealed"]),wt=h.object({severity:h.enum(["low","medium","high"]).optional(),language:h.string().optional(),framework:h.string().optional(),source:h.enum(["baseline","repo","context7","feedback"]).optional(),confidence:h.number().min(0).max(1).optional()}),ds=h.object({name:h.string(),description:h.string(),location:h.string().optional()}).extend(wt.shape),us=h.object({issue:h.string(),file:h.string(),suggestion:h.string()}).extend(wt.shape),re=h.object({projectId:h.string(),languages:h.array(h.string()),frameworks:h.array(h.string()),packageManager:h.string().optional(),sourceDir:h.string().optional(),testDir:h.string().optional(),configFiles:h.array(h.string()),fileCount:h.number(),patterns:h.array(ds),antiPatterns:h.array(us),analyzedAt:h.string(),modelMetadata:Ae.optional(),status:ls.default("draft"),commitHash:h.string().optional(),signature:h.string().optional(),sealedAt:h.string().optional(),verifiedAt:h.string().optional()});var ms={TypeScript:[".ts",".tsx",".mts",".cts"],JavaScript:[".js",".jsx",".mjs",".cjs"],Python:[".py",".pyw"],Java:[".java"],Go:[".go"],Rust:[".rs"],Ruby:[".rb"],PHP:[".php"],Swift:[".swift"],Kotlin:[".kt",".kts"],"C++":[".cpp",".cc",".cxx",".hpp",".h"],C:[".c",".h"],"C#":[".cs"],Elixir:[".ex",".exs"],Scala:[".scala"]};async function ps(n,t){let e=Date.now();if(n.frameworks.length===0)return{name:"Framework verification",passed:!0,output:"No frameworks declared (skipped)",durationMs:Date.now()-e};try{let s=I.join(t,"package.json"),a=await ne.readFile(s,"utf-8"),i=JSON.parse(a),r={...i.dependencies,...i.devDependencies},c=[],l=[];for(let d of n.frameworks){let m=d.toLowerCase();Object.keys(r).some(y=>y.toLowerCase().includes(m))?l.push(d):c.push(d)}return c.length===0?{name:"Framework verification",passed:!0,output:`${l.length} framework(s) verified in dependencies`,durationMs:Date.now()-e}:{name:"Framework verification",passed:!1,error:`Frameworks not found in dependencies: ${c.join(", ")}`,durationMs:Date.now()-e}}catch(s){return M(s)?{name:"Framework verification",passed:!1,error:"package.json not found (cannot verify frameworks)",durationMs:Date.now()-e}:{name:"Framework verification",passed:!1,error:`Failed to read package.json: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-e}}}o(ps,"verifyFrameworks");async function fs(n,t){let e=Date.now();if(n.languages.length===0)return{name:"Language verification",passed:!0,output:"No languages declared (skipped)",durationMs:Date.now()-e};try{let s=await Ss(t),a=new Set(s),i=[],r=[];for(let c of n.languages){let l=ms[c];if(!l)continue;l.some(m=>a.has(m))?i.push(c):r.push(c)}return r.length===0?{name:"Language verification",passed:!0,output:`${i.length} language(s) verified with matching files`,durationMs:Date.now()-e}:{name:"Language verification",passed:!1,error:`Languages without matching files: ${r.join(", ")}`,durationMs:Date.now()-e}}catch(s){return{name:"Language verification",passed:!1,error:`Failed to scan project files: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-e}}}o(fs,"verifyLanguages");async function hs(n,t){let e=Date.now(),s=n.patterns.filter(r=>r.location);if(s.length===0)return{name:"Pattern location verification",passed:!0,output:"No pattern locations specified (skipped)",durationMs:Date.now()-e};let a=[],i=[];for(let r of s){let c=r.location,l=I.join(t,c);await R(l)?i.push(c):a.push(`${r.name} (${c})`)}return a.length===0?{name:"Pattern location verification",passed:!0,output:`${i.length} pattern location(s) verified`,durationMs:Date.now()-e}:{name:"Pattern location verification",passed:!1,error:`Pattern locations not found: ${a.join(", ")}`,durationMs:Date.now()-e}}o(hs,"verifyPatternLocations");async function gs(n,t){let e=Date.now();try{let s=await vs(t),a=n.fileCount,i=.1,r=Math.abs(s-a),c=a*i;return r<=c?{name:"File count verification",passed:!0,output:`File count accurate (declared: ${a}, actual: ${s})`,durationMs:Date.now()-e}:{name:"File count verification",passed:!1,error:`File count mismatch: declared ${a}, actual ${s} (diff: ${r})`,durationMs:Date.now()-e}}catch(s){return{name:"File count verification",passed:!1,error:`Failed to count files: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-e}}}o(gs,"verifyFileCount");async function ys(n,t){let e=Date.now();if(n.antiPatterns.length===0)return{name:"Anti-pattern file verification",passed:!0,output:"No anti-patterns declared (skipped)",durationMs:Date.now()-e};let s=[],a=[];for(let i of n.antiPatterns){let r=I.join(t,i.file);await R(r)?a.push(i.file):s.push(`${i.issue} (${i.file})`)}return s.length===0?{name:"Anti-pattern file verification",passed:!0,output:`${a.length} anti-pattern file(s) verified`,durationMs:Date.now()-e}:{name:"Anti-pattern file verification",passed:!1,error:`Anti-pattern files not found: ${s.join(", ")}`,durationMs:Date.now()-e}}o(ys,"verifyAntiPatternFiles");async function Pt(n,t){let e=Date.now(),s=await Promise.all([ps(n,t),fs(n,t),hs(n,t),gs(n,t),ys(n,t)]);return B(s,e)}o(Pt,"semanticVerify");async function Ss(n){let t=new Set,e=[/node_modules/,/\.git/,/dist/,/build/,/\.next/,/\.turbo/,/coverage/];async function s(a){try{let i=await ne.readdir(a,{withFileTypes:!0});for(let r of i){let c=I.join(a,r.name),l=I.relative(n,c);if(!e.some(d=>d.test(l))){if(r.isDirectory())await s(c);else if(r.isFile()){let d=I.extname(r.name);d&&t.add(d)}}}}catch{}}return o(s,"scanDir"),await s(n),Array.from(t)}o(Ss,"getProjectExtensions");async function vs(n){let t=[/node_modules/,/\.git/,/dist/,/build/,/\.next/,/\.turbo/,/coverage/];async function e(s){try{let a=await ne.readdir(s,{withFileTypes:!0});return(await Promise.all(a.map(async r=>{let c=I.join(s,r.name),l=I.relative(n,c);return t.some(d=>d.test(l))?0:r.isDirectory()?e(c):r.isFile()?1:0}))).reduce((r,c)=>r+c,0)}catch{return 0}}return o(e,"scanDir"),e(n)}o(vs,"countProjectFiles");Z();var ae=class extends Ue{static{o(this,"AnalysisStorage")}constructor(){super("analysis.json")}getDefault(){return{draft:null,sealed:null,previousSealed:null,lastUpdated:""}}getEventType(t){return`analysis.${t}d`}async saveDraft(t,e){let s={...e,status:"draft"};re.parse(s),await this.update(t,a=>({...a,draft:s,lastUpdated:P()})),this.publishAnalysis(t,s)}publishAnalysis(t,e){Ve({projectId:t,entityType:"analysis",entityId:t,eventType:"upsert",data:{...e,id:t}})}async seal(t){let e=await this.read(t);if(!e.draft)return{success:!1,error:"No draft analysis to seal. Run `p. sync` first."};if(e.draft.status==="sealed")return{success:!1,error:"Draft is already sealed."};let s=this.computeSignature(e.draft),a=P(),i={...e.draft,status:"sealed",signature:s,sealedAt:a};return re.parse(i),await this.write(t,{draft:null,sealed:i,previousSealed:e.sealed,lastUpdated:a}),this.publishAnalysis(t,i),{success:!0,signature:s}}async getSealed(t){return(await this.read(t)).sealed}async getDraft(t){return(await this.read(t)).draft}async getActive(t){let e=await this.read(t);return e.sealed??e.draft}async getStatus(t){let e=await this.read(t);return{hasSealed:e.sealed!==null,hasDraft:e.draft!==null,hasPreviousSealed:e.previousSealed!==null,sealedCommit:e.sealed?.commitHash??null,draftCommit:e.draft?.commitHash??null,previousSealedCommit:e.previousSealed?.commitHash??null,sealedAt:e.sealed?.sealedAt??null}}async rollback(t){let e=await this.read(t);if(!e.previousSealed)return{success:!1,error:"No previous sealed version to rollback to."};let s=P();return await this.write(t,{draft:e.sealed,sealed:e.previousSealed,previousSealed:null,lastUpdated:s}),this.publishAnalysis(t,e.previousSealed),{success:!0,restoredSignature:e.previousSealed.signature}}async diff(t){let e=await this.read(t);return!e.sealed||!e.draft?null:vt(e.sealed,e.draft)}checkStaleness(t,e){return t?e?t!==e?{isStale:!0,sealedCommit:t,currentCommit:e,message:`Analysis is stale: sealed at ${t}, HEAD is ${e}. Run \`p. sync\` + \`p. seal\` to update.`}:{isStale:!1,sealedCommit:t,currentCommit:e,message:"Analysis is current."}:{isStale:!0,sealedCommit:t,currentCommit:null,message:"Cannot determine current commit. Analysis may be stale."}:{isStale:!1,sealedCommit:null,currentCommit:e,message:"No sealed analysis. Run `p. sync` then `p. seal`."}}async verify(t){let e=await this.read(t);if(!e.sealed)return{valid:!1,message:"No sealed analysis to verify."};if(!e.sealed.signature)return{valid:!1,message:"Sealed analysis has no signature."};let s=this.computeSignature({...e.sealed,signature:void 0,sealedAt:void 0});return s===e.sealed.signature?{valid:!0,message:"Signature verified. Analysis integrity confirmed."}:{valid:!1,message:`Signature mismatch. Expected ${s}, got ${e.sealed.signature}. Analysis may have been modified.`}}async semanticVerify(t,e){let s=await this.read(t),a=s.sealed??s.draft;return a?await Pt(a,e):{passed:!1,checks:[{name:"Analysis availability",passed:!1,error:"No analysis available. Run `p. sync` to generate.",durationMs:0}],totalMs:0,failedCount:1,passedCount:0}}computeSignature(t){let e={projectId:t.projectId,languages:t.languages,frameworks:t.frameworks,packageManager:t.packageManager,sourceDir:t.sourceDir,testDir:t.testDir,configFiles:t.configFiles,fileCount:t.fileCount,patterns:t.patterns,antiPatterns:t.antiPatterns,analyzedAt:t.analyzedAt,commitHash:t.commitHash};return Oe(JSON.stringify(e))}},K=new ae;import Os from"node:fs/promises";import Q from"node:path";Ie();is();os();J();$();cs();function ie(){return{branch:"main",commits:0,contributors:0,hasChanges:!1,stagedFiles:[],modifiedFiles:[],untrackedFiles:[],recentCommits:[],weeklyCommits:0}}o(ie,"emptyGitData");function oe(){return{fileCount:0,version:"0.0.0",name:"unknown",ecosystem:"unknown",projectType:"simple",languages:[],frameworks:[]}}o(oe,"emptyStats");function ce(){return{install:"npm install",run:"npm run",test:"npm test",build:"npm run build",dev:"npm run dev",lint:"npm run lint",format:"npm run format"}}o(ce,"emptyCommands");function le(){return{hasFrontend:!1,hasBackend:!1,hasDatabase:!1,hasDocker:!1,hasTesting:!1,frontendType:null,frameworks:[]}}o(le,"emptyStack");ee();J();import kt from"node:fs/promises";import ws from"node:path";function Ps(n){return typeof Bun<"u"&&Bun.hash?`xxh64:${Bun.hash(n).toString(36)}`:`fnv1a:${([...n].reduce((e,s)=>Math.imul(e^s.charCodeAt(0),16777619),2166136261)>>>0).toString(36)}`}o(Ps,"hashContent");async function ks(n,t={}){let e=await Me(n,{skipDotfiles:!0,dotfileAllowlist:[".env.example"]}),s=new Map,a=t.changedFilesHint?.length?new Set(t.changedFilesHint):null,i=await Fe(e,100,async r=>{try{let c=ws.join(n,r),l=await kt.stat(c),d=l.mtime.toISOString(),m=t.storedHashes?.get(r),g=a?.has(r)??!1;if(m&&!g&&m.size===l.size&&m.mtime===d&&m.hash)return{path:r,hash:m.hash,size:l.size,mtime:d};let y=await kt.readFile(c,"utf-8");return{path:r,hash:Ps(y),size:l.size,mtime:d}}catch{return null}});for(let r of i)s.set(r.path,r);return s}o(ks,"computeHashes");function bs(n,t){let e=[],s=[],a=[];for(let[r,c]of n){let l=t.get(r);l?l.hash!==c.hash?s.push(r):a.push(r):e.push(r)}let i=[];for(let r of t.keys())n.has(r)||i.push(r);return{added:e,modified:s,deleted:i,unchanged:a}}o(bs,"diffHashes");function de(n,t){let e=_.getDb(n);e.transaction(()=>{e.prepare("DELETE FROM index_checksums").run();let s=e.prepare("INSERT INTO index_checksums (path, checksum, size, mtime) VALUES (?, ?, ?, ?)");for(let[,a]of t)s.run(a.path,a.hash,a.size,a.mtime)})(),_.setDoc(n,"file-hashes-meta",{fileCount:t.size,builtAt:new Date().toISOString()})}o(de,"saveHashes");function Cs(n){let t=new Map;try{let e=_.query(n,"SELECT path, checksum, size, mtime FROM index_checksums");for(let s of e)t.set(s.path,{path:s.path,hash:s.checksum,size:s.size||0,mtime:s.mtime||""})}catch{}return t}o(Cs,"loadHashes");async function ue(n,t,e){let s=Cs(t),a=await ks(n,{storedHashes:s,changedFilesHint:e});return{diff:bs(a,s),currentHashes:a}}o(ue,"detectChanges");function bt(n){return _.hasDoc(n,"file-hashes-meta")}o(bt,"hasHashRegistry");T();$();var xs=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs"]);async function Ct(n){let{projectId:t,projectPath:e,isFullSync:s,changedFilesHint:a}=n,i={shouldRebuildIndexes:!0,changedDomains:new Set,incrementalInfo:void 0,changedSourceFiles:[],deletedSourceFiles:[]};if(!s&&bt(t)){try{let{diff:r,currentHashes:c}=await ue(e,t,a),l=r.added.length+r.modified.length+r.deleted.length,d=(()=>{if(l===0&&!a?.length)return{shouldRebuildIndexes:!1,changedDomains:new Set,incrementalInfo:{isIncremental:!0,filesChanged:0,filesUnchanged:r.unchanged.length,indexesRebuilt:!1,affectedDomains:[]},changedSourceFiles:[],deletedSourceFiles:[]};let m=mt(r,t),g=pt(m.allAffected),y=m.allAffected.some(me);return{shouldRebuildIndexes:y,changedDomains:g,incrementalInfo:{isIncremental:!0,filesChanged:l,filesUnchanged:r.unchanged.length,indexesRebuilt:y,affectedDomains:Array.from(g)},changedSourceFiles:[...r.added,...r.modified].filter(me),deletedSourceFiles:r.deleted.filter(me)}})();return l>0&&de(t,c),d}catch(r){f.debug("Incremental detection failed, falling back to full sync",{error:v(r)})}return i}try{let{currentHashes:r}=await ue(e,t,a);de(t,r)}catch(r){f.debug("Hash computation failed (non-critical)",{error:v(r)})}return i}o(Ct,"detectIncrementalChanges");function me(n){let t=n.substring(n.lastIndexOf("."));return xs.has(t)}o(me,"isSourceFile");import{z as D}from"zod";var Dn=D.object({date:D.string(),tokensSaved:D.number(),syncs:D.number(),avgCompressionRate:D.number(),totalDuration:D.number()}),An=D.object({agentName:D.string(),usageCount:D.number(),tokensSaved:D.number()}),xt={"claude-opus-4.5":.005,"claude-sonnet-4.5":.003,"claude-haiku-4.5":.001,"claude-opus-4":.015,"claude-sonnet-4":.003,"gpt-4o":.0025,"gemini-pro":.00125,default:.003};function Dt(n,t="default"){let e=xt[t]||xt.default;return n/1e3*e}o(Dt,"estimateCostSaved");function jn(n){return n<.01?`$${(n*100).toFixed(2)}\xA2`:`$${n.toFixed(2)}`}o(jn,"formatCost");ee();var Ds=o(n=>({date:n.date,tokensSaved:n.tokens_saved,syncs:n.syncs,avgCompressionRate:n.avg_compression_rate,totalDuration:n.total_duration}),"rowToDaily"),q=o(n=>{let t=new Date;return t.setDate(t.getDate()-n),t.toISOString().split("T")[0]},"dayCutoff"),pe=class{static{o(this,"MetricsStorage")}async recordSync(t,e){let s=Math.max(0,e.originalSize-e.filteredSize),a=e.originalSize>0?s/e.originalSize:0,i=new Date().toISOString().split("T")[0];if(k.run(t,`INSERT INTO metrics_daily (date, tokens_saved, syncs, avg_compression_rate, total_duration)
12
+ VALUES (?, ?, 1, ?, ?)
13
+ ON CONFLICT(date) DO UPDATE SET
14
+ tokens_saved = metrics_daily.tokens_saved + excluded.tokens_saved,
15
+ avg_compression_rate =
16
+ (metrics_daily.avg_compression_rate * metrics_daily.syncs + excluded.avg_compression_rate)
17
+ / (metrics_daily.syncs + 1),
18
+ syncs = metrics_daily.syncs + 1,
19
+ total_duration = metrics_daily.total_duration + excluded.total_duration`,i,s,a,e.duration),e.agents?.length){let r=Math.floor(s/e.agents.length);for(let c of e.agents)k.run(t,`INSERT INTO metrics_agent_usage (agent_name, usage_count, tokens_saved)
20
+ VALUES (?, 1, ?)
21
+ ON CONFLICT(agent_name) DO UPDATE SET
22
+ usage_count = metrics_agent_usage.usage_count + 1,
23
+ tokens_saved = metrics_agent_usage.tokens_saved + excluded.tokens_saved`,c,r)}}async getSummary(t){let e=k.get(t,`SELECT COALESCE(SUM(tokens_saved), 0) AS tokens,
24
+ COALESCE(SUM(syncs), 0) AS syncs,
25
+ COALESCE(SUM(total_duration), 0) AS duration,
26
+ COALESCE(SUM(avg_compression_rate * syncs), 0) AS weighted_rate
27
+ FROM metrics_daily`),s=e?.syncs??0,a=e?.tokens??0,i=o((m,g)=>k.get(t,g?"SELECT COALESCE(SUM(tokens_saved), 0) AS t FROM metrics_daily WHERE date >= ? AND date < ?":"SELECT COALESCE(SUM(tokens_saved), 0) AS t FROM metrics_daily WHERE date >= ?",...g?[m,g]:[m])?.t??0,"rangeTokens"),r=i(q(30)),c=i(q(60),q(30)),l=c>0?(r-c)/c*100:0,d=k.query(t,"SELECT * FROM metrics_agent_usage ORDER BY usage_count DESC LIMIT 5").map(m=>({agentName:m.agent_name,usageCount:m.usage_count,tokensSaved:m.tokens_saved}));return{totalTokensSaved:a,estimatedCostSaved:Dt(a),compressionRate:s>0?(e?.weighted_rate??0)/s:0,syncCount:s,avgSyncDuration:s>0?(e?.duration??0)/s:0,topAgents:d,last30DaysTokens:r,trend:l}}async getDailyStats(t,e=30){return k.query(t,"SELECT * FROM metrics_daily WHERE date >= ? ORDER BY date ASC",q(e)).map(Ds)}async getFirstSyncDate(t){return k.get(t,"SELECT MIN(date) AS d FROM metrics_daily")?.d??""}},At=new pe;T();Z();$();import As from"node:path";function js(n){return Ne(As.resolve(n))}o(js,"repoHash");function N(n){return n.toLowerCase().replace(/[^a-z0-9]+/g,"")}o(N,"normalizeKey");function Is(n){return se(n,t=>`${N(t.name)}::${N(t.source)}`)}o(Is,"dedupePatterns");function Es(n){return se(n,t=>`${N(t.issue)}::${N(t.file)}::${N(t.source)}`)}o(Es,"dedupeAntiPatterns");var fe=class{static{o(this,"PatternExtractor")}async extract(t){let e=js(t.projectPath),s=[];if(t.context7Verified)for(let l of t.frameworks)s.push({name:`${l} API validation via Context7`,description:`Validate ${l} APIs against current documentation through Context7 before implementation.`,framework:l,source:"context7",confidence:.7});let a=(t.feedback?.patternsDiscovered||[]).map(l=>({name:l,description:`Confirmed during completed tasks: ${l}`,source:"feedback",confidence:.75})),i=(t.feedback?.knownGotchas||[]).map(l=>({issue:l,file:"multiple",suggestion:`Recurring gotcha. Prevent this pattern during implementation: ${l}`,source:"feedback",severity:"medium",confidence:.7})),r=Is([...s,...a]),c=Es([...i]);return{patterns:r,antiPatterns:c,repoPathHash:e}}},Ms=new fe,jt=Ms;var It=200;async function Et(n,t,e){let{bm25Index:s,originalSize:a}=(()=>{try{let d=Ke(n),m=d?Object.values(d.documents).reduce((g,y)=>g+y.length,0):0;return{bm25Index:d,originalSize:m||t.fileCount*It}}catch(d){return f.debug("Could not load BM25 index for metrics",{error:v(d)}),{bm25Index:null,originalSize:t.fileCount*It}}})(),i=0,r=a>0?Math.max(0,(a-i)/a):0;try{await At.recordSync(n,{originalSize:a,filteredSize:i,duration:e,isWatch:!1})}catch(d){f.debug("Failed to record sync metrics",{error:v(d)})}try{let{velocityStorage:d}=await import("./velocity-storage-5T7RYOWH.mjs");await d.recompute(n)}catch(d){f.debug("Failed to recompute velocity",{error:v(d)})}let c=await import("./developer-evolution-AVAXGDKQ.mjs").then(({captureDeveloperSnapshot:d})=>d(n)).catch(d=>(f.debug("Failed to capture dev snapshot",{error:v(d)}),!1)),l={};try{let d=s;d&&(l.bm25Files=d.totalDocs,l.bm25AvgTokens=Math.round(d.avgDocLength),l.bm25VocabSize=Object.keys(d.invertedIndex).length);let m=Xe(n);m&&(l.importEdges=m.edgeCount,l.importFiles=m.fileCount);let g=it(n);g&&(l.cochangeCommits=g.commitsAnalyzed,l.cochangeFiles=g.filesAnalyzed)}catch(d){f.debug("Could not load index stats",{error:v(d)})}return{duration:e,originalSize:a,filteredSize:i,compressionRate:r,indexes:l,developerSnapshotCaptured:c}}o(Et,"recordSyncMetrics");async function Mt(n,t,e,s,a,i){try{let r=e.recentCommits[0]?.hash||null,c=await j.getAggregatedFeedback(n).catch(()=>{});try{let{refreshSkillIndex:d}=await import("./skill-index-L4UWQCQE.mjs");await d(n,t)}catch{}let l=await jt.extract({projectId:n,projectPath:t,languages:s.languages,frameworks:Array.from(new Set([...s.frameworks,...a.frameworks])),feedback:c,context7Verified:i});await K.saveDraft(n,{projectId:n,languages:s.languages,frameworks:s.frameworks,configFiles:[],fileCount:s.fileCount,patterns:l.patterns,antiPatterns:l.antiPatterns,analyzedAt:P(),status:"draft",commitHash:r??void 0})}catch(r){f.debug("Failed to save draft analysis (non-critical)",{error:v(r)})}}o(Mt,"saveDraftAnalysis");async function Ft(n){try{let[t,e,s,a,i]=await Promise.all([We.archiveOldShipped(n).catch(()=>0),Ge.markDormantIdeas(n).catch(()=>0),Je.removeStaleCompleted(n).catch(()=>0),j.archiveStalePausedTasks(n).catch(()=>[]),Be.capEntries(n).catch(()=>0)]),r=t+e+s+a.length+i;if(r>0){f.info("Archived stale data",{shipped:t,dormant:e,staleQueue:s,stalePaused:a.length,memoryCapped:i,total:r});let c=ze.getStats(n);f.debug("Archive stats",c)}}catch(t){f.debug("Archival failed (non-critical)",{error:v(t)})}}o(Ft,"archiveStaleData");Ie();$();var Ts=6e4,he=class extends Error{static{o(this,"SyncPhaseTimeoutError")}phase;timeoutMs;constructor(t,e){super(`sync phase '${t}' timed out after ${e}ms. Set PRJCT_SYNC_PHASE_TIMEOUT_MS to tune this guard, or run \`prjct sync --full --md\` if incremental state looks stale.`),this.name="SyncPhaseTimeoutError",this.phase=t,this.timeoutMs=e}};function Rs(){return Number(process.env.PRJCT_SYNC_PHASE_TIMEOUT_MS)||Ts}o(Rs,"syncPhaseTimeoutMs");function Tt(n,t){let e=Rs(),s=(()=>{let a=Promise.withResolvers(),i=setTimeout(()=>a.reject(new he(t,e)),e);return{promise:a.promise,cancel:o(()=>clearTimeout(i),"cancel")}})();return Promise.race([n,s.promise]).finally(s.cancel)}o(Tt,"withPhaseTimeout");async function Rt(n,t,e){let s=Date.now();f.debug("sync phase start",{phase:n});try{let a=await t(),i=Date.now()-s;return f.debug("sync phase done",{phase:n,ms:i}),e?.push({phase:n,ms:i}),a}catch(a){let i=Date.now()-s;throw f.debug("sync phase failed",{phase:n,ms:i,error:w(a)}),e?.push({phase:n,ms:i}),a}}o(Rt,"runSyncPhase");function ge(n,t={}){let e=t.now??Date.now,s=e(),i=(()=>{try{return n().then(()=>({}),r=>({error:r}))}catch(r){return Promise.resolve({error:r})}})().then(r=>{try{t.onComplete?.({totalMs:e()-s,...r})}catch{}});return{async settle(){await i}}}o(ge,"startPostIndexWork");ee();import _s from"node:fs/promises";import $s from"node:path";T();Z();$();T();J();import ye from"node:fs/promises";import Y from"node:path";var Se=".prjct/.prjct-state.md",ve=class{static{o(this,"LocalStateGenerator")}async generate(t,e){let s=Y.join(t,Se);await ye.mkdir(Y.dirname(s),{recursive:!0});let a=this.toMarkdown(e);await ye.writeFile(s,a,"utf-8")}async remove(t){try{await ye.unlink(Y.join(t,Se))}catch(e){if(!M(e))throw e}}async exists(t){let e=Y.join(t,Se);return R(e)}toMarkdown(t){let e=["<!-- Auto-generated by prjct - DO NOT EDIT -->","<!-- This file provides local state persistence for AI tools -->","","# prjct State",""];if(t.currentTask){let s=t.currentTask;if(e.push("## Current Work Cycle"),e.push(""),e.push(`**${s.description}**`),e.push(""),e.push(`- Started: ${s.startedAt}`),s.linearId&&e.push(`- Linear: ${s.linearId}`),s.branch&&e.push(`- Branch: ${s.branch}`),e.push(`- Status: ${s.status||"active"}`),e.push(""),s.subtasks&&s.subtasks.length>0){e.push("### Subtasks"),e.push(""),s.subtasks.forEach((c,l)=>{let d=c.status==="completed"?"\u2705":c.status==="in_progress"?"\u25B6\uFE0F":"\u23F3",m=l===s.currentSubtaskIndex?" \u2190 **Active**":"";e.push(`${l+1}. ${d} ${c.description}${m}`)}),e.push("");let a=s.subtasks.filter(c=>c.status==="completed").length,i=s.subtasks.length,r=Math.round(a/i*100);e.push(`**Progress**: ${a}/${i} (${r}%)`),e.push("")}}else e.push("*No active work cycle*"),e.push(""),e.push('Start work with `p. work "intent"`'),e.push("");if(t.previousTask){let s=t.previousTask;e.push("---"),e.push(""),e.push("## Previous Work Cycle"),e.push(""),e.push(`**${s.description}**`),e.push(""),e.push(`- Status: ${s.status}`),s.prUrl&&e.push(`- PR: ${s.prUrl}`),e.push("")}return e.push("---"),e.push(`*Last updated: ${t.lastUpdated||new Date().toISOString()}*`),e.push(""),e.join(`
28
+ `)}},_t=new ve;var Hs=["storage","context","memory","analysis","config","sync"];async function $t(n){try{await Promise.all(Hs.map(t=>_s.mkdir($s.join(n,t),{recursive:!0})))}catch(t){throw new Error(Ee(t,n,"project directories"))}}o($t,"ensureProjectDirectories");async function Ht(n){let{projectId:t,projectPath:e,cliVersion:s,git:a,stats:i}=n,r=k.getDoc(t,"project")||{},c={...r,projectId:t,repoPath:e,name:i.name,version:i.version,cliVersion:s,techStack:i.frameworks,fileCount:i.fileCount,commitCount:a.commits,stack:i.ecosystem,currentBranch:a.branch,hasUncommittedChanges:a.hasChanges,createdAt:r.createdAt||P(),lastSync:P(),lastSyncCommit:a.recentCommits[0]?.hash||null,lastSyncBranch:a.branch};k.setDoc(t,"project",c)}o(Ht,"updateProjectDoc");async function Ot(n){let{projectId:t,projectPath:e,stats:s,stack:a}=n,r={...await j.read(t)};r.projectId=t,r.stack={language:s.languages[0]||"Unknown",framework:s.frameworks[0]||null},r.domains={hasFrontend:a.hasFrontend,hasBackend:a.hasBackend,hasDatabase:a.hasDatabase,hasTesting:a.hasTesting,hasDocker:a.hasDocker},r.projectType=s.projectType,r.metrics={totalFiles:s.fileCount},r.lastSync=P(),r.lastUpdated=P(),r.context={...r.context||{},lastSession:P(),lastAction:"Synced project",nextAction:'Run `p. work "intent"` to start a work cycle'},await j.write(t,r);try{await _t.remove(e)}catch(c){f.debug("Legacy local state cleanup failed (optional)",{error:v(c)})}}o(Ot,"updateStateDoc");function Nt(n,t,e){k.appendEvent(n,"sync",{branch:t.branch,uncommitted:t.hasChanges,fileCount:e.fileCount,commitCount:t.commits})}o(Nt,"logSyncEvent");import Lt from"node:fs/promises";import we from"node:path";T();as();var Vt={async jsonFilesValid(n){let t=Date.now(),e=[],s=we.basename(n);try{await j.read(s)}catch(a){M(a)||e.push(`state: ${v(a)}`)}return{name:"State data valid",passed:e.length===0,output:e.length===0?"1 store validated":void 0,error:e.length>0?e.join("; "):void 0,durationMs:Date.now()-t}},async noSensitiveData(n){let t=Date.now(),e=we.join(n,"context"),s=[/(?:api[_-]?key|apikey)\s*[:=]\s*['"][^'"]{10,}/i,/(?:password|passwd|pwd)\s*[:=]\s*['"][^'"]{4,}/i,/(?:secret|token)\s*[:=]\s*['"][^'"]{10,}/i],a=[];try{let i=await Lt.readdir(e);for(let r of i){if(!r.endsWith(".md"))continue;let c=await Lt.readFile(we.join(e,r),"utf-8");for(let l of s)if(l.test(c)){a.push(`${r}: potential sensitive data detected`);break}}}catch(i){if(!M(i))return{name:"No sensitive data",passed:!1,error:`Could not scan: ${v(i)}`,durationMs:Date.now()-t}}return{name:"No sensitive data",passed:a.length===0,output:a.length===0?"No sensitive patterns found":void 0,error:a.length>0?a.join("; "):void 0,durationMs:Date.now()-t}}},Pe=class{static{o(this,"SyncVerifier")}async verify(t,e,s){let a=Date.now(),i=[],r=s?.failFast??!1,c=[],l=[Vt.jsonFilesValid(e),Vt.noSensitiveData(e)];for(let m of l){let g=await m;if(i.push(g),!g.passed&&r){c.push(...s?.checks?.filter(y=>y.enabled!==!1).map(y=>y.name)??[]);break}}if((!r||i.every(m=>m.passed))&&s?.checks)for(let m of s.checks){if(m.enabled===!1){c.push(m.name);continue}let g=await this.runCustomCheck(m,t);if(i.push(g),!g.passed&&r){let y=s.checks.slice(s.checks.indexOf(m)+1);c.push(...y.filter(b=>b.enabled!==!1).map(b=>b.name));break}}return{...B(i,a),skippedCount:c.length}}async runCustomCheck(t,e){let s=Date.now(),a=t.command||(t.script?`sh ${t.script}`:null);if(!a)return{name:t.name,passed:!1,error:"No command or script specified",durationMs:Date.now()-s};try{let{stdout:i,stderr:r}=await je(a,{cwd:e,timeout:3e4});return{name:t.name,passed:!0,output:(i.trim()||r.trim()).slice(0,200)||void 0,durationMs:Date.now()-s}}catch(i){let r=i;return{name:t.name,passed:!1,error:(r.stderr?.trim()||r.message).slice(0,200),durationMs:Date.now()-s}}}},zt=new Pe;var ke=class{static{o(this,"SyncService")}projectPath;projectId=null;globalPath="";cliVersion="0.0.0";constructor(){this.projectPath=process.cwd()}async sync(t=process.cwd(),e={}){this.projectPath=t;let s=Date.now(),a=[],i=o((l,d)=>Rt(l,d,a),"phase"),r={installed:!1,verified:!1,configPath:"",message:""},c=[];try{if(this.projectId=await H.getProjectId(t),!this.projectId)return{success:!1,projectId:"",cliVersion:"",git:ie(),stats:oe(),commands:ce(),stack:le(),context7:{installed:!1,verified:!1},error:"No prjct project. Run p. init first."};if(this.globalPath=He.getGlobalProjectPath(this.projectId),this.cliVersion=await this.getCliVersion(),await Os.rm(Q.join(this.globalPath,"agents"),{recursive:!0,force:!0}).catch(()=>{}),(await $e()).installed){let u=await Le({autoRepair:!0});u.verified||f.warn(`Codex p. router not ready: ${u.message||"verification failed"}`)}await i("mcp-defaults",()=>at({silent:!0,verifyContext7:!1}));let d=await _e().catch(()=>null),m=d?.name??"claude";try{Object.assign(r,await i("context7",()=>Re.ensureReady(m)))}catch(u){let p=w(u);f.warn(`Context7 MCP not ready (continuing sync): ${p}`),Object.assign(r,{verified:!1,message:p})}await $t(this.globalPath),process.env.PRJCT_SKIP_CREW_SWEEP!=="1"&&await i("legacy-crew-sweep",async()=>{try{let{legacyCrewSweep:u}=await import("./legacy-crew-sweep-2TLKJTHI.mjs"),p=await u(this.projectPath,this.projectId);(p.checkpointsMigrated||p.teamMigrated||p.checkpointsHandEditWarned||p.teamHandEditWarned||p.ghostDirsPurged.length>0||p.agentFilesRepaired.length>0||p.clientPrjctJunkPurged.length>0||p.errors.length>0)&&f.info("Legacy crew sweep ran",{checkpointsMigrated:p.checkpointsMigrated,teamMigrated:p.teamMigrated,checkpointsHandEditWarned:p.checkpointsHandEditWarned,teamHandEditWarned:p.teamHandEditWarned,ghostDirsPurged:p.ghostDirsPurged,agentFilesRepaired:p.agentFilesRepaired,ghostFilesIngested:p.ghostFilesIngested,clientPrjctJunkPurged:p.clientPrjctJunkPurged,errors:p.errors.length})}catch(u){f.debug("Legacy crew sweep failed (non-critical)",{error:w(u)})}});let[y,b,be,L]=await i("gather",()=>Tt(Promise.all([ft(this.projectPath),ht(this.projectPath),gt(this.projectPath),yt(this.projectPath)]),"gather")),{shouldRebuildIndexes:Ut,changedDomains:Ns,incrementalInfo:Ce,changedSourceFiles:V,deletedSourceFiles:z}=await i("incremental",()=>Ct({projectId:this.projectId,projectPath:this.projectPath,isFullSync:e.full===!0,changedFilesHint:e.changedFiles}));try{let{refreshFileInventory:u}=await import("./project-file-inventory-XIHHJZUP.mjs");await u(this.projectId,this.projectPath)}catch{}try{await ct(this.projectId)}catch{}Ut&&await i("index",async()=>{try{let u=Ce?.isIncremental&&(V.length>0||z.length>0);await Promise.all([u?Ye(this.projectPath,this.projectId,V,z):qe(this.projectPath,this.projectId),u?et(this.projectPath,this.projectId,V,z):Ze(this.projectPath,this.projectId),u?st(this.projectPath,this.projectId,V,z):tt(this.projectPath,this.projectId),ot(this.projectPath,this.projectId)]);let p=this.projectId,S=this.projectPath,E=await H.readConfig(S).catch(()=>null),C=lt(E);c.push(ge(()=>dt(p,{uploadToCloud:C}),{onComplete:o(({totalMs:x,error:G})=>{f.debug("sync post-index work settled",{projectId:p,uploadToCloud:C,totalMs:x,...G===void 0?{}:{error:w(G)}})},"onComplete")}))}catch(u){f.debug("File ranking index build failed (non-critical)",{error:w(u)})}});let Wt=Date.now();f.debug("sync phase start",{phase:"skills"});let Gt=await ut.generateAndInstall().catch(u=>{f.debug("Native skill generation failed (non-critical)",{error:w(u)})});f.debug("sync phase done",{phase:"skills",ms:Date.now()-Wt}),await i("update-files",()=>Promise.all([Ht({projectId:this.projectId,projectPath:this.projectPath,cliVersion:this.cliVersion,git:y,stats:b}),Ot({projectId:this.projectId,projectPath:this.projectPath,stats:b,stack:L}),Promise.resolve(Nt(this.projectId,y,b)),Mt(this.projectId,this.projectPath,y,b,L,r.verified)]));let X=await K.getActive(this.projectId),Jt={patterns:X?.patterns?.length||0,antiPatterns:X?.antiPatterns?.length||0,criticalAntiPatterns:X?.antiPatterns?.filter(u=>u.severity==="high").length||0},Bt=await(async()=>{try{let{recomputeProjectStyle:u,formatProjectStyleForSync:p}=await import("./project-style-evolution-5W25UPPN.mjs"),S=await i("project-style",()=>u({projectId:this.projectId,projectPath:this.projectPath,stats:b,stack:L,commands:be,commitHash:y.recentCommits[0]?.hash??null,source:"sync-mechanical"})),E=p(S),C=S.snapshot.payload.metrics.styleCoverage;return{summary:S.snapshot.summary,evolutionMd:E.evolutionMd,patternCount:S.snapshot.patternCount,antiPatternCount:S.snapshot.antiPatternCount,conventionCount:S.snapshot.conventionCount,styleCoverage:typeof C=="number"?C:Number(C)||0,isFirst:S.isFirst,hasChanges:S.delta.hasChanges}}catch(u){f.debug("Project style recompute failed (non-critical)",{error:w(u)});return}})(),xe=[],U={},W=o((u,p,S)=>{xe.push(ge(async()=>{S(await i(u,p))},{onComplete:o(({totalMs:E,error:C})=>{f.debug("sync floating phase settled",{phase:u,overlapped:!0,totalMs:E,...C===void 0?{}:{error:w(C)}})},"onComplete")}))},"floatPhase"),Kt=Date.now()-s;W("metrics",()=>Et(this.projectId,b,Kt),u=>{U.syncMetrics=u}),W("install-global",async()=>{await te.installGlobalConfig(d??void 0),await te.syncCommands(d??void 0)},()=>{}),W("install-agent-surfaces",async()=>{let{detectInstalledAgents:u}=await import("./detection-KKDZYWVD.mjs"),p=await u(this.projectPath).catch(()=>[]);await rt(this.projectPath,{refreshIfAdopted:!0,agents:p})},()=>{}),W("verify",async()=>{try{let u=await H.readConfig(this.projectPath);return await zt.verify(this.projectPath,this.globalPath,u?.verification)}catch(u){f.debug("Verification failed (non-critical)",{error:w(u)});return}},u=>{U.verification=u});let qt=await i("work-cost",()=>St(this.projectId));await i("archive",()=>Ft(this.projectId));let Yt=await i("context-quality",()=>Qe(this.projectPath,this.projectId)),Qt=await i("retention",async()=>{try{let u=await H.readConfig(this.projectPath).catch(()=>null),p=u?.retention?.mode??"apply";if(p==="off")return;let S=p==="dry-run",{applyRetention:E,triageInbox:C}=await import("./retention-S22T3SPT.mjs"),x=E(this.projectId,{dryRun:S,maxArchive:u?.retention?.maxArchive,maxDelete:u?.retention?.maxDelete}),{inboxMerged:G,inboxArchived:es}=S?{inboxMerged:0,inboxArchived:0}:(()=>{let A=C(this.projectId);return{inboxMerged:A.merged,inboxArchived:A.archived}})(),{runVaultPurge:ts,vaultHealth:ss}=await import("./purge-5EPJV25P.mjs"),F=await ts(this.projectId,{projectPath:this.projectPath,dryRun:S,softDeletedPurgeDays:u?.retention?.softDeletedPurgeDays,archivePruneDays:u?.retention?.archivePruneDays,autoSourceMaxLive:u?.retention?.autoSourceMaxLive}),ns=ss(this.projectId);return{evaluated:x.evaluated,active:x.active,archive:x.wouldArchive,delete:x.wouldDelete,archived:x.archived,deleted:x.deleted,inboxMerged:G,inboxArchived:es,dryRun:S,samples:x.samples.map(A=>({id:A.id,type:A.type,verdict:A.verdict,score:A.score,reasons:A.reasons,excess:A.excess})),referenceSize:x.referenceSize,vault:{...ns,softDeletedPurged:F.softDeletedPurged,orphanEventsPurged:F.orphanEventsPurged,archivesPruned:F.archivesPruned,autoSourceTrimmed:F.autoSourceTrimmed,distilledDiscarded:F.distilledDiscarded,digestsWritten:F.digestsWritten}}}catch(u){f.debug("retention phase failed",{error:w(u)});return}});if(process.env.PRJCT_WORLD_MODEL_REFRESH==="1"||process.env.PRJCT_DRIFT_REFRESH==="1")try{let u=await import("node:os"),{markDriftRefreshApplied:p}=await import("./drift-refresh-XPJAO2B3.mjs"),S=process.env.PRJCT_CLI_HOME?Q.resolve(process.env.PRJCT_CLI_HOME):Q.join(u.homedir(),".prjct-cli");p(S)}catch{}await Promise.all([...c.map(u=>u.settle()),...xe.map(u=>u.settle())]);let De=U.syncMetrics,Xt=U.verification,Zt=De?.developerSnapshotCaptured===!0;return{success:!0,projectId:this.projectId,cliVersion:this.cliVersion,git:y,stats:b,commands:be,stack:L,context7:{installed:r.installed,verified:r.verified,message:r.message},analysisSummary:Jt,contextQuality:Yt,retentionDryRun:Qt,syncMetrics:De,workCost:qt,verification:Xt,incremental:Ce,projectStyle:Bt,developerSnapshotCaptured:Zt,generatedSkills:Gt,phaseTimings:a}}catch(l){return{success:!1,projectId:this.projectId||"",cliVersion:this.cliVersion,git:ie(),stats:oe(),commands:ce(),stack:le(),context7:{installed:r.installed,verified:r.verified,message:r.message},error:w(l)}}}async getCliVersion(){try{let t=Q.join(__dirname,"..","..","package.json");return(await Te(t))?.version||"0.0.0"}catch(t){return f.debug("Failed to read CLI version",{error:w(t)}),"0.0.0"}}},oa=new ke;export{Vs as a,zs as b,K as c,jn as d,At as e,oa as f};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as s,b as p}from"./chunk-U24YKPYX.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";p();import f from"node:fs";import g from"node:path";function c(){return g.join(s(),"config")}o(c,"configDir");function l(){return g.join(c(),"global.json")}o(l,"configFilePath");var i={config:null,stamp:""};function u(n){try{let t=f.statSync(n);return`${n}|${t.mtimeMs}|${t.size}`}catch{return`${n}|absent`}}o(u,"fileStamp");function a(){let n=l(),t=u(n);if(i.config!==null&&t===i.stamp)return i.config;let e=(()=>{try{let r=JSON.parse(f.readFileSync(n,"utf-8"));return r&&typeof r=="object"&&!Array.isArray(r)?r:{}}catch{return{}}})();return i.config=e,i.stamp=t,e}o(a,"readRaw");function b(n){f.mkdirSync(c(),{recursive:!0}),f.writeFileSync(l(),`${JSON.stringify(n,null,2)}
8
+ `,"utf-8"),i.config=n,i.stamp=u(l())}o(b,"writeRaw");function G(n){return a()[n]}o(G,"getConfig");function h(){return a()}o(h,"getAll");function C(n,t){let e=a();t===void 0?delete e[n]:e[n]=t,b(e)}o(C,"setConfig");function x(n){C(n,void 0)}o(x,"unsetConfig");function S(){return l()}o(S,"configPath");export{G as a,h as b,C as c,x as d,S as e};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{e as m,l as k}from"./chunk-HU5ERAAV.mjs";import{a}from"./chunk-3TRXQAU4.mjs";k();var p=["zod","better-sqlite3","@modelcontextprotocol/sdk","@modelcontextprotocol/client","@modelcontextprotocol/server","chalk","chokidar","commander","express","fastify","hono","react","next","vue","vitest","jest","typescript","biome","lefthook","drizzle-orm","prisma","@prisma/client"];function l(t){return t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)||"item"}a(l,"stableStyleKey");function f(t){return t?!!(t.architecture?.style&&t.architecture.style!=="unknown"||(t.patterns?.length??0)>0||(t.conventions?.length??0)>0||(t.antiPatterns?.length??0)>0||(t.stack?.frameworks?.length??0)>0||(t.stack?.languages?.length??0)>0):!1}a(f,"isRichLlmAnalysis");function A(t){return!f(t)}a(A,"isThinLlmAnalysis");function P(t){let n=h(t),s=S(t.commands),r=f(t.llmAnalysis)?t.llmAnalysis:null,i=b(r?.conventions?.map(e=>({key:l(e.category?`${e.category}-${e.rule}`:e.rule),rule:e.rule,category:e.category}))??[],t.memoryConventions?.map(e=>({key:l(e.category?`${e.category}-${e.rule}`:e.rule),rule:e.rule,category:e.category}))??[]),o=x(r?.patterns?.map(e=>({key:l(e.name),name:e.name,description:e.description,locations:e.locations,category:e.category}))??[],t.memoryPatterns?.map(e=>({key:l(e.name),name:e.name,description:e.description}))??[]),c=C(r?.antiPatterns?.map(e=>({key:l(e.issue),issue:e.issue,suggestion:e.suggestion,severity:e.severity}))??[],t.memoryAntiPatterns?.map(e=>({key:l(e.issue),issue:e.issue,suggestion:e.suggestion}))??[]);if(r?.stack?.languages?.length)for(let e of r.stack.languages)n.languages.includes(e)||n.languages.push(e);if(r?.stack?.frameworks?.length)for(let e of r.stack.frameworks)n.frameworks.includes(e)||n.frameworks.push(e);r?.stack?.packageManager&&!n.packageManager&&(n.packageManager=r.stack.packageManager);let u={symbols:t.structural?.symbols??0,files:t.structural?.files??t.stats.fileCount??0,packages:t.structural?.packages??[]};return{payloadVersion:1,stack:n,commands:s,conventions:i,patterns:o,antiPatterns:c,structural:u,metrics:{...t.metrics??{}}}}a(P,"buildProjectStylePayload");function $(t){let n=P(t),s=t.capturedAt??m();return{id:t.id??`style_${s.replace(/[^0-9]/g,"").slice(0,14)}_${Math.random().toString(36).slice(2,8)}`,capturedAt:s,commitHash:t.commitHash??null,source:t.source??"sync-mechanical",patternCount:n.patterns.length,antiPatternCount:n.antiPatterns.length,conventionCount:n.conventions.length,frameworkCount:n.stack.frameworks.length,symbolCount:n.structural.symbols,fileCount:n.structural.files,summary:d(n),payload:n}}a($,"buildProjectStyleSnapshot");function d(t){let n=[t.stack.ecosystem!=="unknown"?t.stack.ecosystem:null,t.stack.languages.slice(0,2).join("+")||null,t.stack.frameworks.slice(0,3).join(", ")||null].filter(Boolean);return`${n.length>0?n.join(" \xB7 "):"stack unknown"}; ${t.patterns.length} patterns, ${t.antiPatterns.length} anti-patterns, ${t.conventions.length} conventions; ${t.structural.files} files`+(t.structural.symbols>0?`, ${t.structural.symbols} symbols`:"")}a(d,"buildStyleSummary");function h(t){let n=g([...t.stack.frameworks??[],...t.stats.frameworks??[]]),s=g([...t.stats.languages??[]]),r=j(t.packageDeps??{}),i=t.packageDeps??{};for(let c of r)["Hono","Express","Fastify","React","Next.js","Vue","NestJS"].includes(c)&&!n.includes(c)&&n.push(c);let o=t.stack.hasTesting===!0||!!(i.vitest||i.jest||i.mocha||i["bun-types"]||i["@types/bun"]||r.includes("Vitest")||r.includes("Jest"))||!!(t.commands?.test&&/test/i.test(t.commands.test));return{ecosystem:t.stats.ecosystem||"unknown",languages:s,frameworks:n,packageManager:t.packageManager??void 0,keyLibraries:r,hasTests:o,hasDocker:t.stack.hasDocker===!0}}a(h,"buildStack");function S(t){return t?{test:t.test,lint:t.lint,build:t.build,dev:t.dev,install:t.install,format:t.format}:{}}a(S,"buildCommands");function j(t){let n=new Set;for(let s of p)t[s]&&n.add(v(s));return[...n].slice(0,16)}a(j,"collectKeyLibraries");function v(t){return{hono:"Hono",express:"Express",fastify:"Fastify",react:"React",next:"Next.js",vue:"Vue",vitest:"Vitest",jest:"Jest",typescript:"TypeScript",zod:"Zod","better-sqlite3":"better-sqlite3","@modelcontextprotocol/sdk":"MCP SDK","@modelcontextprotocol/client":"MCP SDK","@modelcontextprotocol/server":"MCP SDK",biome:"Biome",lefthook:"Lefthook","drizzle-orm":"Drizzle",prisma:"Prisma","@prisma/client":"Prisma"}[t]??t}a(v,"displayLibName");function b(t,n){let s=new Map;for(let r of[...t,...n])s.has(r.key)||s.set(r.key,r);return[...s.values()].slice(0,40)}a(b,"mergeConventions");function x(t,n){let s=new Map;for(let r of[...t,...n])s.has(r.key)||s.set(r.key,r);return[...s.values()].slice(0,40)}a(x,"mergePatterns");function C(t,n){let s=new Map;for(let r of[...t,...n])s.has(r.key)||s.set(r.key,r);return[...s.values()].slice(0,40)}a(C,"mergeAntiPatterns");function g(t){let n=[],s=new Set;for(let r of t){let i=r.trim();if(!i)continue;let o=i.toLowerCase();s.has(o)||(s.add(o),n.push(i))}return n}a(g,"unique");function L(t,n={}){if(!t)return null;let s=n.maxConventions??5,r=n.maxPatterns??4,i=n.maxAnti??3,o=t.payload,c=["## How this repo works (project style)",""],u=[o.stack.ecosystem!=="unknown"?o.stack.ecosystem:null,o.stack.languages.join(", ")||null,o.stack.frameworks.join(", ")||null,o.stack.keyLibraries.slice(0,6).join(", ")||null].filter(Boolean);if(u.length>0&&c.push(`**Stack:** ${u.join(" \xB7 ")}`),o.conventions.length>0){c.push("","**Conventions (match):**");for(let e of o.conventions.slice(0,s))c.push(`- ${e.rule}`)}if(o.patterns.length>0){c.push("","**Patterns (match):**");for(let e of o.patterns.slice(0,r))c.push(`- **${e.name}** \u2014 ${y(e.description,120)}`)}if(o.antiPatterns.length>0){c.push("","**Anti-patterns (avoid):**");for(let e of o.antiPatterns.slice(0,i))c.push(`- ${e.issue}${e.suggestion?` \u2192 ${y(e.suggestion,80)}`:""}`)}return o.conventions.length===0&&o.patterns.length===0&&o.antiPatterns.length===0&&c.push("","_No durable house patterns yet \u2014 open a neighbor file and match local idiom. Prefer `prjct sync` + structured analysis-save-llm JSON to enrich._"),c.push("",`_${t.summary}_`),c.join(`
8
+ `)}a(L,"formatProjectStyleDigest");function y(t,n){let s=t.replace(/\s+/g," ").trim();return s.length>n?`${s.slice(0,n-1)}\u2026`:s}a(y,"truncate");export{f as a,A as b,$ as c,L as d};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{e as g,g as l}from"./chunk-225DWS4D.mjs";import{a as r,c as u,d as f}from"./chunk-3TRXQAU4.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.97.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(()=>{l();n={version:null,packageRoot:null};r(i,"getPackageRoot");r(p,"getVersion");r(v,"resetPackageRoot");R=p(),d=i()});export{i as a,p as b,v as c,R as d,d as e,m as f,P as g};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as o,c as i}from"./chunk-3TRXQAU4.mjs";import t from"node:os";import e from"node:path";function p(){let r=process.env.PRJCT_CLI_HOME?.trim();return r?e.resolve(r):e.join(t.homedir(),".prjct-cli")}var m=i(()=>{"use strict";o(p,"resolveCliHome")});export{p as a,m as b};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{i as c,n as f,p as S}from"./chunk-D62TAZG6.mjs";import{a as n}from"./chunk-3TRXQAU4.mjs";S();import{createHash as C}from"node:crypto";import B from"node:fs/promises";import g from"node:path";var x="missing",T=1,u=200;function H(t){return C("sha256").update(t).digest("hex")}n(H,"sha256Hex");function v(t){return t===null?x:H(typeof t=="string"?Buffer.from(t,"utf8"):t)}n(v,"hashBlobContent");function w(t){let e=[...t].map(r=>({path:h(r.path),blobHash:r.blobHash})).filter(r=>r.path.length>0).sort((r,s)=>r.path<s.path?-1:r.path>s.path?1:0).map(r=>`${r.path}\0${r.blobHash}`);return H(e.join(`
8
+ `))}n(w,"buildTreeHash");function h(t){return t.replace(/\\/g,"/").replace(/^\.\//,"").trim()}n(h,"normalizeStampPath");function A(t,e){let r=e.maxPaths??u,s=t.map(o=>({path:h(o.path),blobHash:v(o.content)})).filter(o=>o.path.length>0),i=new Map;for(let o of s)i.set(o.path,o.blobHash);let a=[...i.entries()].map(([o,m])=>({path:o,blobHash:m})).sort((o,m)=>o.path<m.path?-1:o.path>m.path?1:0),p=w(a);return{version:T,treeHash:p,pathCount:a.length,paths:a.slice(0,r),stampedAt:e.stampedAt,headSha:e.headSha}}n(A,"stampFromContents");function _(t){if(t.override)return{blocked:!1,reason:"override",message:""};if(!t.stamp?.treeHash)return t.hard?{blocked:!0,reason:"no-stamp",message:"Content-bound stamp missing: re-run `prjct judgment approve` so ship binds to the reviewed tree. Override only with consent: `prjct ship --no-judgment-gate`."}:{blocked:!1,reason:"no-stamp",message:""};if(t.stamp.pathCount===0)return{blocked:!1,reason:"empty-scope",message:"Content-bound stamp empty (no scoped paths) \u2014 advisory only.",stampedTreeHash:t.stamp.treeHash};if(t.currentTreeHash===null)return{blocked:!1,reason:"unverified",message:`\u2696\uFE0F Content-bound stamp ${d(t.stamp.treeHash)} not re-verified (IO).`,stampedTreeHash:t.stamp.treeHash};if(t.currentTreeHash===t.stamp.treeHash)return{blocked:!1,reason:"match",message:`\u2696\uFE0F Content-bound match tree=${d(t.stamp.treeHash)} (${t.stamp.pathCount} paths)`,stampedTreeHash:t.stamp.treeHash,currentTreeHash:t.currentTreeHash};let e=`Content-bound drift: approved tree=${d(t.stamp.treeHash)} now=${d(t.currentTreeHash)} (${t.stamp.pathCount} paths). Re-run \`prjct judgment approve\` after re-review. Override only with consent: \`prjct ship --no-judgment-gate\`.`;return{blocked:t.hard,reason:"drift",message:t.hard?e:`\u2696\uFE0F ${e}`,stampedTreeHash:t.stamp.treeHash,currentTreeHash:t.currentTreeHash}}n(_,"contentBoundDriftVerdict");function d(t){return t.slice(0,12)}n(d,"shortHash");async function l(t,e){return f(t,e,{timeoutMs:5e3})}n(l,"safeGit");async function b(t,e){if(e&&e.length>0)return[...new Set(e.map(h).filter(a=>a.length>0&&!a.endsWith("/")))].slice(0,u);let r=await l(t,["diff","--name-only","HEAD"])??await l(t,["diff","--name-only","--cached"])??"",s=await l(t,["diff","--name-only","HEAD~1..HEAD"])??"",i=r.trim()||s.trim();return i?[...new Set(i.split(`
9
+ `).map(h).filter(a=>a.length>0))].slice(0,u):[]}n(b,"resolveStampPaths");async function N(t){try{return await B.readFile(t)}catch{return null}}n(N,"readFileOrNull");async function y(t,e,r){let s=[];for(let i of e){let a=h(i);if(!a||a.includes(".."))continue;let p=g.join(t,a);p.startsWith(g.resolve(t))&&s.push({path:a,content:await N(p)})}return A(s,r)}n(y,"stampProjectPaths");async function $(t,e,r){let s=await b(t,e),i=await l(t,["rev-parse","HEAD"])??void 0;return y(t,s,{stampedAt:r,headSha:i})}n($,"stampForApprove");async function k(t,e){try{let r=e.paths.length>0?e.paths.map(i=>i.path):await b(t,null);return(await y(t,r,{stampedAt:e.stampedAt,headSha:e.headSha})).treeHash}catch(r){if(r instanceof c)throw r;return null}}n(k,"currentTreeHashForStamp");export{x as a,T as b,u as c,v as d,w as e,h as f,A as g,_ as h,d as i,b as j,y as k,$ as l,k as m};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as e,i as f}from"./chunk-DMO3ZFUG.mjs";import{e as i,l as w}from"./chunk-HU5ERAAV.mjs";import{b as u,f as g}from"./chunk-XYDLXF5A.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";g();w();f();import{z as n}from"zod";var r="crew:checkpoints",m="crew/CHECKPOINTS.md",h=n.object({content:n.string(),source:n.enum(["default","user","migrated"]),updated_at:n.string().min(1)});function l(){let s=u(m);if(!s)throw new Error(`Missing bundled crew checkpoints template: ${m}`);return s}c(l,"getBundledDefault");var p=class{static{c(this,"CheckpointsStorage")}get(t){let o=e.getDoc(t,r);return o===null?{content:l(),source:"default",updated_at:i()}:h.parse(o)}hasCustomization(t){return e.hasDoc(t,r)}set(t,o,d="user"){let a={content:o,source:d,updated_at:i()};return e.setDoc(t,r,a),a}reset(t){e.deleteDoc(t,r)}},C=new p,R=C;export{C as a,R as b};
@@ -0,0 +1,12 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as h}from"./chunk-YEALP3WX.mjs";import{g as b,h as p,i as k,j as $,o as A}from"./chunk-QZ7T2EYR.mjs";import{a}from"./chunk-3TRXQAU4.mjs";var _=/^(main|index|app|server|cli|handler|router|bootstrap|init|start|run|default)$/i;function j(t){let i=p(t);if(!b(t))return{ready:!1,builtAt:i?.builtAt??null,symbols:0,edges:0,files:0,languages:[],kinds:[],routes:[],hotspots:[],entryCandidates:[],packages:[],note:"No symbol index. Run `prjct sync` or `prjct code reindex`."};let c=k(t),u=new Map,r=new Map,d=new Map,g=[],o=[];for(let e of c){u.set(e.kind,(u.get(e.kind)??0)+1),r.set(e.file,(r.get(e.file)??0)+1);let n=e.file.includes(".")?e.file.slice(e.file.lastIndexOf(".")):"(none)";d.set(n,(d.get(n)??0)+1),e.kind==="route"&&g.push({name:e.name,file:e.file,line:e.startLine}),e.exported&&_.test(e.name)&&(e.kind==="function"||e.kind==="class")&&!/__tests__|\.test\.|\.spec\.|fixtures?\//i.test(e.file)&&o.push({name:e.name,file:e.file,kind:e.kind})}let l=[...r.keys()],f=[],x=A(t),S=l.length>400?l.slice(0,400):l;for(let e of S){let n=x.get(e)??0;n>0&&f.push({file:e,fanIn:n,symbolCount:r.get(e)??0})}f.sort((e,n)=>n.fanIn-e.fanIn);let m=new Set,y=h(t);if(y)for(let e of Object.keys(y.forward).slice(0,2e3)){let n=e.includes("/")?e.slice(0,e.indexOf("/")):e;n&&!n.startsWith(".")&&m.add(n)}for(let e of l.slice(0,2e3)){let n=e.includes("/")?e.slice(0,e.indexOf("/")):".";n&&n!=="."&&m.add(n)}if(o.length<8)for(let e of c){if(o.length>=12)break;e.exported&&e.kind==="class"&&!o.some(n=>n.file===e.file)&&o.push({name:e.name,file:e.file,kind:e.kind})}return{ready:!0,builtAt:i?.builtAt??null,symbols:i?.symbolCount??c.length,edges:i?.edgeCount??0,files:i?.fileCount??r.size,languages:[...d.entries()].map(([e,n])=>({ext:e,count:n})).sort((e,n)=>n.count-e.count).slice(0,12),kinds:[...u.entries()].map(([e,n])=>({kind:e,count:n})).sort((e,n)=>n.count-e.count),routes:g.slice(0,30),hotspots:f.slice(0,15),entryCandidates:o.slice(0,15),packages:[...m].sort().slice(0,40),note:"Structural only (symbol + import graphs). Narrative architecture lives in prjct analysis / memory decisions."}}a(j,"buildArchitectureSnapshot");function I(t){return t.ready?["## Architecture (structural)","",`- **Symbols**: ${t.symbols} \xB7 **Edges**: ${t.edges} \xB7 **Files**: ${t.files}`,t.builtAt?`- **Index built**: ${t.builtAt}`:"","","### Languages (by symbol files)",...t.languages.map(s=>`- \`${s.ext}\`: ${s.count}`),"","### Symbol kinds",...t.kinds.map(s=>`- **${s.kind}**: ${s.count}`),"","### Top-level packages / dirs",t.packages.length?t.packages.map(s=>`\`${s}\``).join(", "):"_none detected_","","### Hotspots (call fan-in)",...t.hotspots.length?t.hotspots.map(s=>`- \`${s.file}\` \u2014 fan-in **${s.fanIn}** \xB7 ${s.symbolCount} symbol(s)`):["_no call edges yet_"],"","### Entry candidates",...t.entryCandidates.length?t.entryCandidates.map(s=>`- **${s.name}** (${s.kind}) \u2014 \`${s.file}\``):["_none_"],"","### Routes",...t.routes.length?t.routes.map(s=>`- \`${s.name}\` \u2014 \`${s.file}:${s.line}\``):["_no HTTP route nodes detected_"],"",`_${t.note}_`].filter(s=>s!=="").join(`
8
+ `):`## Architecture
9
+
10
+ > ${t.note}
11
+ `}a(I,"formatArchitectureMd");function v(t){return t.ready?[`Architecture: ${t.symbols} symbols \xB7 ${t.edges} edges \xB7 ${t.files} files`,`Kinds: ${t.kinds.map(i=>`${i.kind}=${i.count}`).join(" ")}`,`Hotspots: ${t.hotspots.slice(0,5).map(i=>`${i.file}(${i.fanIn})`).join(", ")||"\u2014"}`,`Packages: ${t.packages.slice(0,12).join(", ")}`,"Detail: prjct code architecture --md"].join(`
12
+ `):`architecture: ${t.note}`}a(v,"formatArchitectureText");export{j as a,I as b,v as c};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as o}from"./chunk-3TRXQAU4.mjs";var k=/^(current work|wip|todo|misc|n\/a|none|latest|unreleased|changelog|ok|yes|no|test|asdf|xxx|foo|bar|baz|null|undefined)$/i,w=/^(todo_write|todo_read|judgment status|judgment next|mem get|memory get|spec_get|analysis-get|prjct (work|ship|sync|land|prime|status|help)|p\.\s*\w+)$/i,y=/^(mem[_-]?\d+|mem get mem[_-]?\d+)$/i,R=new Set(["inbox","todo","idea","question"]);function _(r,e){let t=r.trim().replace(/\s+/g," ");if(t.length===0)return{junk:!0,reason:"empty content"};if(k.test(t))return{junk:!0,reason:"noise phrase"};if(w.test(t))return{junk:!0,reason:"tool/command dump"};if(y.test(t))return{junk:!0,reason:"bare mem id dump"};let n=!e||R.has(e);if(n&&t.length<=12)return{junk:!0,reason:"too short (\u226412 chars)"};if(!/[\s.:;,—–\-/?!]/.test(t)&&t.length<40){if(t.includes("_")&&/^[a-z][a-z0-9_]*$/i.test(t))return{junk:!0,reason:"single-token dump / tool name"};if(n&&/^[a-z][a-z0-9_]*$/i.test(t)&&t.length<=24)return{junk:!0,reason:"single-token dump / tool name"}}if(n){let a=t.split(" ");if(a.length<=3&&t.length<=32&&/^[a-z0-9_ -]+$/i.test(t)){let s=a[0]?.toLowerCase()??"";if(["todo","judgment","insights","workflow","spec","analysis","harness","memory","prjct"].includes(s))return{junk:!0,reason:"short command-like dump"}}}return{junk:!1,reason:"ok"}}o(_,"isJunkCaptureContent");var C=new Set(["inbox","todo","idea","question"]),g=/^(?:get\s+)?[0-9a-f]{8}(?:-[0-9a-f]{4}){3}-[0-9a-f]{12}$|^[0-9a-f]{16,64}$|^[a-z]*[_-]?[0-9a-f]{8,}$/i,d=/\b(add|build|create|fix|implement|migrate|refactor|remove|replace|ship|support|enable|disable|update|upgrade|design|audit|verify|ensure|prevent|allow|block|wire|integrate|document|test|measure|reduce|increase|hacer|agregar|crear|arreglar|implementar|migrar|eliminar|actualizar|soportar|permitir|bloquear|integrar|documentar|verificar|evitar)\b/i,c=/\b(was|were|wasn't|weren't|had been|used to|era|eran|fue|fueron|estaba|estaban|fixed|fix:|resolved|root cause|because|caused|broke|broken|failed|failure|don't|do not|never|always|must not|must never|sin\s+eso|no era|no fue|no es rls|wasn't|instead|rather than|anti-pattern|gotcha:|trap:)\b/i,x=/^(reviso|revisando|voy a|estoy|vamos a|i('ll| will)|i am |i'm |checking|looking at|let me |need to |tengo que |hay que |todo:|wip:)/i,E=/\b(no era necesario|no era necesaria|no fue necesario|wasn't hard|was not hard|wasn't easy|was not easy|wasn't difficult|no fue difícil|wasn't necessary|was not necessary)\b/i,S=/\b(no era rls|no fue rls|no es rls|not the cause|red herring|false lead|not an? rls\b|not a(?:n)? rls\b|is not (?:an? )?rls(?:\s+bug)?|was not (?:an? )?rls(?:\s+bug)?|this is not (?:an? )?(?:rls|auth)|is not the bottleneck|not the bottleneck)\b/i,j=/\b(?:no era|no fue)\s+(?!necesario|necesaria|difícil|facil|fácil)([a-z][\w-]{1,40})\b/i,v=/\b(?:wasn't|was not|weren't|were not)\s+(?!hard|easy|difficult|necessary|needed)((?:an?\s+)?[a-z][\w-]{1,40})\b/i,T=/\b(causa real|root cause|fix:|real cause|was correct|were correct|estaban (?:perfectas|correctas|bien)|already (?:wraps|wrapped)|declare|volatile|instead|en realidad|coincidencia|misleading|actually|policies (?:were|estaban)|can_access_company)\b/i;function m(r){return r.trim().replace(/\s+/g," ").toLowerCase()}o(m,"normalize");function h(r){return r.replace(/^goal:\s*/i,"").trim()}o(h,"stripGoalPrefix");function p(r){let e=r.trim().match(/^([\s\S]*?)\n\nGoal:\s*([\s\S]+)$/i);return e?{title:e[1].trim(),goal:e[2].trim()}:null}o(p,"parseSpecMirrorContent");function u(r,e){let t=m(r),n=m(h(e));return!!(!t||!n||t===n||t.replace(/^get\s+/i,"")===n.replace(/^get\s+/i,"")&&g.test(n.replace(/^get\s+/i,"")))}o(u,"isEmptySpecMirror");function l(r){let e=m(h(r));if(!e||g.test(e))return!0;if(/^(get|show|open|fetch|load|ver|obtener)\s+\S+$/i.test(e)&&!d.test(e)){let t=e.replace(/^(get|show|open|fetch|load|ver|obtener)\s+/i,"");if(g.test(t)||/^[a-z0-9_-]{8,}$/i.test(t))return!0}return!1}o(l,"isBareIdBody");function $(r){let e=r.trim();if(!e)return!0;let t=e.replace(/\s+/g," ");return!!(/:\s*$/.test(t)&&!c.test(t)||x.test(t)&&!c.test(t)||!c.test(t)&&t.length<80&&/^(reviso|checking|looking)\b/i.test(t))}o($,"isOpenGotchaNarration");function N(r){let e=r.trim().replace(/\s+/g," ");return!e||E.test(e)||/\bno es\s+[\w-]+-related\b/i.test(e)&&!/\b(causa real|root cause|fix:|was correct|were correct|policies)\b/i.test(e)||!(S.test(e)||j.test(e)||v.test(e)&&!/\bwasn't hard\b/i.test(e))?!1:/\b(no era rls|no fue rls|not the cause|red herring|false lead|not an? rls\b|is not (?:an? )?rls(?:\s+bug)?|this is not (?:an? )?rls)\b/i.test(e)?!0:T.test(e)||c.test(e)}o(N,"looksLikeRedHerring");function O(r){let e=r.trim().replace(/\s+/g," ");if(e.length<12)return!0;let t=e.split(" ").filter(s=>s.length>1);if(t.length<2)return!0;let n=new Set(["the","a","an","to","for","and","or","of","in","on","it","this","that","el","la","de","en","y","o","un","una","por","para"]);return t.filter(s=>!n.has(s.toLowerCase())).length<2}o(O,"lacksInboxSubstance");function P(r,e,t={}){let n=(r??"").trim();if(!n)return{action:"refuse",reasonCode:"empty_content",reason:"empty content"};if(t.force)return{action:"accept",reasonCode:"forced",reason:"force override"};let a=_(n,e);if(a.junk)return{action:"refuse",reasonCode:"junk",reason:`junk capture: ${a.reason}`};if(e==="spec"){let s=t.title??p(n)?.title??"",f=t.goal??p(n)?.goal??n;if(s&&f&&u(s,f))return{action:"refuse",reasonCode:"empty_spec_mirror",reason:"empty spec: goal identical to title (lookup, not a goal)"};let i=p(n);if(i&&u(i.title,i.goal))return{action:"refuse",reasonCode:"empty_spec_mirror",reason:"empty spec: goal identical to title (lookup, not a goal)"};let b=i?.goal??f??n;if(l(b)&&!d.test(b))return{action:"refuse",reasonCode:"bare_id_body",reason:"empty spec: body is an id/lookup without an action verb"}}if(t.title!==void 0&&t.goal,e==="gotcha"){if($(n))return{action:"demote",reasonCode:"gotcha_open_narration",reason:"open narration is not a gotcha \u2014 demote to context",demoteTo:"context"};if(N(n))return{action:"demote",reasonCode:"gotcha_is_red_herring",reason:"negative knowledge (not-the-cause) \u2014 store as red-herring",demoteTo:"red-herring"}}return e&&C.has(e)&&O(n)?{action:"refuse",reasonCode:"inbox_no_substance",reason:"sub-substance low-stakes capture \u2014 keep out of brief"}:{action:"accept",reasonCode:"ok",reason:"ok"}}o(P,"classifyCapturePrecision");function D(r,e){let t=r.trim(),n=e.trim();return!t||!n?{action:"refuse",reasonCode:"empty_content",reason:"empty title or goal"}:l(n)&&!d.test(n)?{action:"refuse",reasonCode:"bare_id_body",reason:"empty spec: goal is an id/lookup without an action verb"}:u(t,n)&&l(t)?{action:"refuse",reasonCode:"empty_spec_mirror",reason:"empty spec: goal identical to title (lookup, not a goal)"}:{action:"accept",reasonCode:"ok",reason:"ok"}}o(D,"classifySpecCreate");function H(r,e){return u(r,e)||l(e)&&!d.test(e)?!1:P(`${r}
8
+
9
+ Goal: ${e}`,"spec",{title:r,goal:e}).action==="accept"}o(H,"shouldMirrorSpecToMemory");function G(r){return r&&r.replace(/^Context synthesis:\s*/i,"").replace(/(\s*[·|]\s*)Context synthesis:\s*/gi,"$1").replace(/^\s*[·|]\s*/,"").trim()}o(G,"stripPipelineLabelsForHuman");export{_ as a,p as b,u as c,l as d,$ as e,N as f,O as g,P as h,D as i,H as j,G as k};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as y,p as w}from"./chunk-HYIT7MF5.mjs";import{e as l,g as x}from"./chunk-225DWS4D.mjs";import{a as o,b as S}from"./chunk-3TRXQAU4.mjs";x();w();import p from"node:fs";import v from"node:fs/promises";import h from"node:os";import t from"node:path";var g="mcp-remote@0.1.38";var C="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 b(){let e=_();if(e)return e;if(process.env.PRJCT_MCP_ALLOW_LOCAL==="1"){let r=k();if(r)return{command:r,args:["mcp-server"],description:C}}return{command:"npx",args:["-y","prjct-cli@latest","mcp-server"],description:C}}o(b,"getPrjctMcpConfig");function P(e){let r=e.replace(/\\/g,"/");return!!(r.includes("/.worktrees/")||r.includes("/prjct-cli/bin/prjct")&&!r.includes("/node_modules/prjct-cli/"))}o(P,"isNonProductionPrjctPath");function _(){let e=[];try{e.push(t.dirname(S.resolve("prjct-cli/package.json")))}catch{}let r=h.homedir();for(let n of[process.env.NVM_BIN?t.resolve(process.env.NVM_BIN,".."):"",t.join(r,".nvm","versions","node",process.version,"lib"),"/opt/homebrew/lib","/usr/local/lib"].filter(Boolean))e.push(t.join(n,"node_modules","prjct-cli"));for(let n of e){if(P(n))continue;let s=t.join(n,"bin","prjct.cjs"),i=p.existsSync(t.join(n,"dist","bin","prjct.mjs"))||p.existsSync(t.join(n,"dist","bin","prjct-core.mjs"));if(!p.existsSync(s)||!i)continue;let a=[process.execPath,t.join(t.dirname(process.execPath),"node"),t.join(n,"..","..","bin","node")].find(m=>m&&p.existsSync(m)),f=t.resolve(n,"..","..","..","bin","node"),d=p.existsSync(f)?f:a??process.execPath;return{command:d,args:[s,"mcp-server"],env:{PATH:`${t.dirname(d)}${t.delimiter}/usr/bin${t.delimiter}/bin`},description:C}}return null}o(_,"resolvePublishedPrjctMcpConfig");function k(){let e=process.argv[1],r=[e?t.resolve(t.dirname(e),"prjct"):"",e?t.resolve(t.dirname(e),"..","bin","prjct"):"",t.resolve(process.cwd(),"bin","prjct")].filter(Boolean);for(let n of r){if(!p.existsSync(n))continue;let s=(()=>{try{return p.realpathSync(n)}catch{return n}})();if(!P(s))return s}return null}o(k,"resolveLocalPrjctBin");var L={context7:{command:"npx",args:["-y","@upstash/context7-mcp@latest"],description:"Library documentation lookup"},prjct:b(),linear:{command:"npx",args:["-y",g,"https://mcp.linear.app/mcp"],description:"Linear MCP server (OAuth)"},jira:{command:"npx",args:["-y",g,"https://mcp.atlassian.com/v1/mcp"],description:"Atlassian MCP server for Jira (OAuth)"}};function u(){return process.env.PRJCT_TEST_MODE==="1"?t.join(h.tmpdir(),"prjct-context7-test","mcp.json"):t.join(h.homedir(),".claude","mcp.json")}o(u,"getClaudeMcpConfigPath");async function j(e=u()){try{let r=await v.readFile(e,"utf-8");return JSON.parse(r)}catch(r){let n=l(r).toLowerCase();if(n.includes("no such file")||n.includes("enoent"))return{};throw new Error(`Failed to read MCP config at ${e}: ${l(r)}`)}}o(j,"readMcpConfig");async function M(e,r=u()){await y(r,e)}o(M,"writeMcpConfig");async function $(e,r,n=u()){let s=await j(n),i={...s.mcpServers||{}},c=i[e];i[e]=r,s.mcpServers=i;let a=JSON.stringify(c)!==JSON.stringify(r);return await M(s,n),{path:n,changed:a}}o($,"upsertMcpServer");async function A(e,r=u()){return!!(await j(r)).mcpServers?.[e]}o(A,"hasMcpServer");async function V(e,r=u(),n){let s=await j(r),i=s.mcpServers,c=i?.[e];return!i||!c?{path:r,changed:!1}:n&&JSON.stringify(c)!==JSON.stringify(n)?{path:r,changed:!1}:(delete i[e],Object.keys(i).length===0&&delete s.mcpServers,await M(s,r),{path:r,changed:!0})}o(V,"removeMcpServer");function D(e,r,n,s,i){let c=e.indexOf(n),a=e.indexOf(s);if(c!==-1&&a!==-1&&a>c){let f=e.slice(0,c),d=e.slice(a+s.length),m=d.startsWith(`
8
+ `)?d.slice(1):d;return{next:f+r+m}}return new RegExp(`^\\s*\\[mcp_servers\\.${i}\\]`,"m").test(e)?{next:e,skipped:"user-managed"}:e.trim().length>0?{next:`${e.trimEnd()}
9
+
10
+ ${r}`}:{next:r}}o(D,"upsertMarkedBlock");async function F(e,r,n){return n===r?{path:e,changed:!1}:(await v.mkdir(t.dirname(e),{recursive:!0}),await v.writeFile(e,n,"utf-8"),{path:e,changed:!0})}o(F,"writeConfigIfChanged");export{L as a,u as b,$ as c,A as d,V as e,D as f,F as g};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as d}from"./chunk-Q6C27OL7.mjs";import{g as r,i as f}from"./chunk-DMO3ZFUG.mjs";import{a as m}from"./chunk-3TRXQAU4.mjs";f();var u=class{static{m(this,"CustomWorkflowStorage")}createWorkflow(t,e){let n=new Date().toISOString();r.run(t,`INSERT INTO custom_workflows (name, description, created_at, updated_at, is_builtin, enabled, metadata)
8
+ VALUES (?, ?, ?, ?, 0, 1, ?)`,e.name,e.description??null,n,n,e.metadata?JSON.stringify(e.metadata):null);let o=r.get(t,"SELECT id FROM custom_workflows WHERE name = ?",e.name);if(!o)throw new Error(`Failed to create workflow: ${e.name}`);return d({projectId:t,entityType:"custom_workflows",entityId:String(o.id),eventType:"upsert",data:{id:o.id,name:e.name,description:e.description??null,metadata:e.metadata??null,created_at:n,updated_at:n,is_builtin:0,enabled:1}}),o.id}getWorkflow(t,e){let n=r.get(t,"SELECT * FROM custom_workflows WHERE name = ?",e);return n?this.rowToWorkflow(n):null}getAllWorkflows(t,e=!1){let n=e?"SELECT * FROM custom_workflows ORDER BY is_builtin DESC, name ASC":"SELECT * FROM custom_workflows WHERE enabled = 1 ORDER BY is_builtin DESC, name ASC";return r.query(t,n).map(l=>this.rowToWorkflow(l))}updateWorkflow(t,e,n){if(!this.getWorkflow(t,e))return!1;let l=new Date().toISOString(),s=[],a=[];if(n.description!==void 0&&(s.push("description = ?"),a.push(n.description)),n.enabled!==void 0&&(s.push("enabled = ?"),a.push(n.enabled?1:0)),n.metadata!==void 0&&(s.push("metadata = ?"),a.push(JSON.stringify(n.metadata))),s.length===0)return!1;s.push("updated_at = ?"),a.push(l),a.push(e),r.run(t,`UPDATE custom_workflows SET ${s.join(", ")} WHERE name = ?`,...a);let i=this.getWorkflow(t,e);return i&&d({projectId:t,entityType:"custom_workflows",entityId:String(i.id),eventType:"upsert",data:{id:i.id,name:i.name,description:i.description??null,enabled:i.enabled?1:0,metadata:i.metadata??null,updated_at:l}}),!0}deleteWorkflow(t,e){let n=this.getWorkflow(t,e);if(!n)return!1;if(n.isBuiltin)throw new Error(`Cannot delete built-in workflow: ${e}`);return r.run(t,"UPDATE custom_workflows SET enabled = 0 WHERE name = ?",e),d({projectId:t,entityType:"custom_workflows",entityId:String(n.id),eventType:"delete",data:{id:n.id,name:e}}),!0}isBuiltin(t,e){return this.getWorkflow(t,e)?.isBuiltin??!1}isReservedName(t){let e=["task","done","ship","sync"],n=["add","rm","gate","list","create","delete","run","help","reset","init"];return e.includes(t)||n.includes(t)}isValidName(t){return/^[a-z0-9-]+$/.test(t)}rowToWorkflow(t){return{id:t.id,name:t.name,description:t.description,createdAt:t.created_at,updatedAt:t.updated_at,isBuiltin:t.is_builtin===1,enabled:t.enabled===1,metadata:t.metadata?JSON.parse(t.metadata):null}}},p=new u;export{p as a};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as te}from"./chunk-5ONMON5L.mjs";import{a as re}from"./chunk-SLYLGDX7.mjs";import{a as ce}from"./chunk-3FXNIJCS.mjs";import{a as ee}from"./chunk-WZXUFSVT.mjs";import{a as oe,b as ne,e as _}from"./chunk-CDLZLTRY.mjs";import{a as ie}from"./chunk-CEOTHJIY.mjs";import{a as Z}from"./chunk-KWC2PCPC.mjs";import{a as X}from"./chunk-MTDCRYLP.mjs";import{d as a,e as co}from"./chunk-6RT2P22O.mjs";import{a as V}from"./chunk-GDLAQV3Q.mjs";import{a as z,c as ro}from"./chunk-DOJPSIMG.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";import ae from"node:fs/promises";import n from"node:path";ro();co();async function t(e){try{return await ae.access(e),!0}catch{return!1}}r(t,"fileExists");async function c(e){try{return await ae.readFile(e,"utf-8")}catch{return null}}r(c,"readText");function h(e){return e?e.includes("_prjctManaged")||e.includes("PRJCT_HOOK_HOST="):!1}r(h,"hasPrjctManagedJson");function p(e){return e?/prjct\s+hook\s+/.test(e):!1}r(p,"hasPrjctHookCommand");function G(e){if(!e)return!1;try{return!!JSON.parse(e).mcpServers?.prjct}catch{return e.includes('"prjct"')&&e.includes("mcp-server")}}r(G,"hasPrjctMcpJson");function se(e){return e?/\[mcp_servers\.prjct\]/.test(e)||/# prjct:mcp:start/.test(e):!1}r(se,"hasPrjctMcpToml");function so(e){return e?e.includes("# prjct-managed")||e.includes("PRJCT_HOOK_HOST="):!1}r(so,"hasPrjctManagedToml");function g(e,o,i,L=!1){return e?L&&(o||i)?"inherited":o&&i?"full":o||i?"partial":"none":"absent"}r(g,"organicOf");function ao(e,o,i){return i===0||o>=4&&e>=90?5:o>=3&&e>=75?4.5:o>=2&&e>=50?4:o>=1?3:1.5}r(ao,"gradeFrom");async function bo(e=process.cwd()){let o=z(),i=n.join(o,".claude","settings.json"),L=n.join(o,".claude","mcp.json"),le=te(),de=V(),me=ce(),ue=re(),pe=n.join(o,".grok"),ge=X(),ke=Z(),fe=n.join(ee(),"plugin.json"),ve=n.join(e,".cursor"),je=oe(),Ce=ne(),he=n.join(o,".config","opencode"),Le=n.join(e,".opencode"),Pe=n.join(o,".pi"),be=n.join(o,".pi","agent"),He=ie(),xe=n.join(e,".pi"),P=n.join(o,".kimi-code"),ye=n.join(P,"config.toml"),Me=n.join(P,"mcp.json"),Se=n.join(o,".agents","skills","prjct","SKILL.md"),[Te,Oe,Be,De,$e,we,E,Ne,K,Je,b,A,Re,Ie,_e,Ge,Ee,Ke,Ae,Fe,Qe,Ue,We,Ye,qe,ze,F,Ve,Xe,Ze]=await Promise.all([a("claude"),a("codex"),a("gemini"),a("grok"),a("opencode"),a("pi"),c(i),c(L),c(le),c(de),c(me),c(ue),c(ge),t(ke),t(fe),t(pe),t(ve),c(je),c(Ce),t(he),t(Le),t(Pe),t(be),t(He),t(xe),a("kimi"),c(ye),c(Me),t(Se),t(P)]),H=Te||await t(n.join(o,".claude")),l=h(E)||p(E),d=G(Ne),x=Oe||await t(n.join(o,".codex")),y=h(K)||p(K),M=se(Je),S=Be||await t(n.join(o,".gemini")),T=h(b)||p(b),O=G(b),B=Ee||await t(n.join(o,".cursor")),D=h(A)||p(A),$=De||Ge,k=se(Re),w=!!Ie,u=!!_e,eo=k||w||u,Q=!!l,U=k||d,N=!!($e||Fe||Qe),J=_(Ke)||_(Ae),R=!!(we||Ue||We||qe),W=!!Ye,I=!!(ze||Ze),f=so(F)||p(F),v=G(Ve),oo=!!Xe,Y=[{id:"claude",displayName:"Claude Code",detected:!!H,hooksLive:l,mcpLive:d,organic:g(!!H,l,d),evidence:l&&d?"~/.claude/settings.json + mcp.json":l?"hooks only":d?"mcp only":H?"detected, not wired":"not installed"},{id:"codex",displayName:"OpenAI Codex",detected:!!x,hooksLive:y,mcpLive:M,organic:g(!!x,y,M),evidence:y&&M?"~/.codex/hooks.json + config.toml MCP":x?"detected, incomplete wire":"not installed"},{id:"gemini",displayName:"Gemini CLI",detected:!!S,hooksLive:T,mcpLive:O,organic:g(!!S,T,O),evidence:T&&O?"~/.gemini/settings.json (hooks+MCP)":S?"detected, incomplete wire":"not installed"},{id:"cursor",displayName:"Cursor",detected:!!B,hooksLive:D,mcpLive:!1,organic:B?D?"full":"none":"absent",evidence:D?"~/.cursor/hooks.json":B?"detected, hooks not wired":"not installed"},{id:"grok",displayName:"xAI Grok Build",detected:!!$,hooksLive:Q,mcpLive:U,organic:g(!!$,Q,U,!eo&&(l||d)),evidence:$?k&&(w||u)?`~/.grok/config.toml MCP + ${u?"plugins/prjct":"skills/prjct"} (hooks via Claude compat)`:k?"~/.grok/config.toml MCP (hooks via Claude compat)":w||u?`${u?"plugins/prjct":"skills/prjct"} (MCP via Claude compat or missing)`:l||d?"Claude-compat only \u2014 run prjct install for native Grok MCP+skill+plugin":"detected \u2014 run prjct install":"not installed"},{id:"opencode",displayName:"OpenCode",detected:N,hooksLive:!1,mcpLive:J,organic:N?J?"full":"none":"absent",evidence:J?"~/.config/opencode/opencode.json mcp.prjct":N?"detected \u2014 run prjct install for OpenCode MCP":"not installed"},{id:"pi",displayName:"Pi",detected:R,hooksLive:!1,mcpLive:!1,organic:R?W?"full":"none":"absent",evidence:W?"~/.pi/agent/skills/prjct/SKILL.md":R?"detected \u2014 run prjct install for Pi skill":"not installed"},{id:"kimi-cli",displayName:"Kimi Code CLI",detected:I,hooksLive:f,mcpLive:v,organic:g(I,f,v),evidence:f&&v?`~/.kimi-code/config.toml [[hooks]] + mcp.json${oo?" + ~/.agents/skills":""}`:f||v?"partial wire \u2014 run prjct install":I?"detected, not wired \u2014 run prjct install":"not installed"}],q=Y.filter(C=>C.detected),no=q.filter(C=>C.organic==="full"||C.organic==="inherited"),s=q.length,m=no.length,j=s===0?100:Math.round(m/s*100),io=ao(j,m,s),to=s===0?"No benchmark CLI/IDE detected \u2014 install Claude, Codex, Gemini, Cursor, OpenCode, Pi, Kimi Code, or Grok, then `prjct install`.":m===s?`Organic full board: ${m}/${s} detected runtimes live (${j}%). Same SQLite brain, multi-surface wire.`:`Organic board ${m}/${s} live (${j}%). Run \`prjct install\` to close gaps \u2014 one command, all surfaces.`;return{runtimes:Y,detectedCount:s,liveCount:m,organicPct:j,grade:io,summary:to}}r(bo,"probeHarnessCoverage");function Ho(e){let o=["## Organic multi-runtime board","",`_Same judgment memory + code gates \xB7 ${e.liveCount}/${e.detectedCount} live \xB7 ${e.organicPct}% \xB7 grade ${e.grade}/5_`,"","| Runtime | Detected | Hooks | MCP | Organic | Evidence |","|---|---:|---:|---:|---|---|"];for(let i of e.runtimes)o.push(`| ${i.displayName} | ${i.detected?"yes":"\u2014"} | ${i.hooksLive?"\u25CF":"\u25CB"} | ${i.mcpLive?"\u25CF":i.id==="cursor"?"IDE":i.id==="pi"?"skill":"\u25CB"} | \`${i.organic}\` | ${i.evidence} |`);return o.push("",e.summary,""),o.push("_Moat: not \u201Canother skill pack\u201D \u2014 compound WHY in SQLite, code-enforced gates, and one install that lights every agent surface without ceremony._",""),o.join(`
8
+ `)}r(Ho,"renderHarnessCoverageMd");export{bo as a,Ho as b};
@@ -0,0 +1,52 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a}from"./chunk-7CI4AMVO.mjs";import{a as v}from"./chunk-XPRLQIVQ.mjs";import{c as d,e as N}from"./chunk-623SNKDH.mjs";import{l as c,p as A}from"./chunk-HYIT7MF5.mjs";import{e as l,g as O}from"./chunk-225DWS4D.mjs";import{a as n}from"./chunk-3TRXQAU4.mjs";N();A();import k from"node:path";var f={value:null},_={type:"claude",name:"Claude (Code + Desktop)",isSupported:!0,capabilities:{mcp:!0,filesystem:"mcp",markdown:!0,emojis:!0,colors:!0,interactive:!0,agents:!0},config:{configFile:"CLAUDE.md",commandPrefix:"p.",responseStyle:"rich",dataDir:".prjct",commandsDir:"~/.claude/commands/p"},environment:{hasMCP:!0,sandboxed:!1,persistent:!0,agentSystem:!0}},F={type:"terminal",name:"Terminal/CLI",isSupported:!0,capabilities:{mcp:!1,filesystem:"native",markdown:!1,emojis:!0,colors:!0,interactive:!0,agents:!1},config:{configFile:null,commandPrefix:"prjct",responseStyle:"cli",dataDir:".prjct",commandsDir:null},environment:{hasMCP:!1,sandboxed:!1,persistent:!0,agentSystem:!1}};async function B(){if(process.env.CLAUDE_AGENT||process.env.ANTHROPIC_CLAUDE||global.mcp||process.env.MCP_AVAILABLE)return!0;let r=process.cwd();if(await c(k.join(r,"CLAUDE.md")))return!0;let e=process.env.HOME||process.env.USERPROFILE||"";if(await c(k.join(e,".claude")))return!0;let t=process.cwd();return!!(t.includes("/.claude/")||t.includes("/claude-workspace/"))}n(B,"isClaudeEnvironment");function $(){return{..._}}n($,"getClaudeAgent");function j(){return{...F}}n(j,"getTerminalAgent");function L(){return!!(process.env.CODEX_SANDBOX||process.env.PRJCT_SANDBOX==="1")}n(L,"isSandboxed");async function E(){if(f.value)return f.value;let r=await B()?$():j();return r.environment={...r.environment,sandboxed:L()},f.value=r,r}n(E,"detect");O();A();import p from"node:fs/promises";var y=class{static{n(this,"RuntimeClaude")}name;type;constructor(){this.name="Claude Code",this.type="claude"}formatResponse(e,t="info"){let i={success:"\u2705",error:"\u274C",warning:"\u26A0\uFE0F",info:"\u2139\uFE0F",celebrate:"\u{1F389}",ship:"\u{1F680}",focus:"\u{1F3AF}",idea:"\u{1F4A1}",progress:"\u{1F4CA}",task:"\u{1F4DD}"};return`${i[t]||i.info} ${e}`}async readFile(e){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.read(e)}catch(t){console.warn(`MCP readFile failed, falling back to fs: ${l(t)}`)}return await p.readFile(e,"utf8")}async writeFile(e,t){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.write(e,t)}catch(i){console.warn(`MCP writeFile failed, falling back to fs: ${l(i)}`)}await p.writeFile(e,t,"utf8")}async listDirectory(e){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.list(e)}catch(t){console.warn(`MCP listDirectory failed, falling back to fs: ${l(t)}`)}return await p.readdir(e)}async fileExists(e){return c(e)}async createDirectory(e){await p.mkdir(e,{recursive:!0})}getTimestamp(){return new Date().toISOString()}formatTaskList(e){return!e||e.length===0?"\u{1F4CB} No tasks queued":`\u{1F4CB} Queue:
8
+ ${e.map((t,i)=>`${i+1}. ${t}`).join(`
9
+ `)}`}formatRecap(e){return`\u{1F4CA} Recap
10
+
11
+ \u{1F3AF} Current: ${e.currentTask||"None"}
12
+ \u{1F680} Shipped: ${e.shippedCount}
13
+ \u{1F4DD} Queue: ${e.queuedCount}
14
+ \u{1F4A1} Ideas: ${e.ideasCount}
15
+ ${e.recentActivity?`
16
+ ${e.recentActivity}`:""}`}formatProgress(e){let t=e.velocity>e.previousVelocity?"\u{1F4C8}":e.velocity<e.previousVelocity?"\u{1F4C9}":"\u27A1\uFE0F";return`\u{1F4CA} ${e.period}
17
+
18
+ Shipped: ${e.count}
19
+ Velocity: ${e.velocity.toFixed(1)}/day ${t}
20
+ ${e.recentFeatures||""}`}getHelpContent(e){let t={debugging:`\u{1F50D} 1. Isolate code causing error
21
+ 2. Add logs at key points
22
+ 3. Search exact error message`,design:`\u{1F3A8} 1. Define problem clearly
23
+ 2. Start with simplest solution
24
+ 3. Ship MVP, iterate`,performance:`\u26A1 1. Profile/measure first
25
+ 2. Optimize slowest parts
26
+ 3. Cache expensive operations`,default:`\u{1F4A1} 1. Break into smaller tasks
27
+ 2. Start with simplest part
28
+ 3. Ship it`},i=Object.keys(t).find(s=>e.toLowerCase().includes(s))||"default";return t[i]}suggestNextAction(e){return{taskCompleted:`What's next?
29
+ \u2022 "start [task]" \u2192 Begin working
30
+ \u2022 "ship feature" \u2192 Track & celebrate
31
+ \u2022 "add idea" \u2192 Brainstorm
32
+
33
+ Or: p. work | p. ship | p. remember`,featureShipped:`Keep the momentum!
34
+ \u2022 "start next task" \u2192 Keep building
35
+ \u2022 "see progress" \u2192 View stats
36
+ \u2022 "plan ahead" \u2192 Strategic thinking
37
+
38
+ Or: p. work | p. insights | p. performance`,ideaCaptured:`Ready to start?
39
+ \u2022 "start this" \u2192 Begin now
40
+ \u2022 "plan more" \u2192 Keep brainstorming
41
+ \u2022 "see ideas" \u2192 View backlog
42
+
43
+ Or: p. work | p. remember | p. insights`,initialized:`Ready to start? Tell me what you want to build!
44
+
45
+ Or type p. help to see all options`,stuck:`Let's break it down:
46
+ \u2022 "start the first part"
47
+ \u2022 "add as tasks"
48
+ \u2022 "think more"
49
+
50
+ Or: p. work | p. remember | p. insights`}[e]||`What would you like to do?
51
+
52
+ Type p. help to see all options`}detectIntent(e){let t=e.toLowerCase();return/^(start|empez|begin|quiero|want|let'?s|voy)/i.test(t)?{intent:"start",command:"now"}:/^(done|termin|finish|acab|complete|listo|ya)/i.test(t)?{intent:"complete",command:"done"}:/^(ship|deploy|launch|public)/i.test(t)?{intent:"ship",command:"ship"}:/^(idea|think|thought|ocurr|tengo)/i.test(t)?{intent:"idea",command:"idea"}:/(show|see|view|muestra|ver).*(progress|status|recap|avance)/i.test(t)||/^(progress|status|recap|avance)/i.test(t)?{intent:"status",command:"recap"}:/^(stuck|help|ayud|atascado|perdido)/i.test(t)?{intent:"stuck",command:"stuck"}:/(what|que).*(next|sigue|after|despues)/i.test(t)||/^(next|sigue)/i.test(t)?{intent:"next",command:"next"}:{intent:"unknown",command:null}}},C=y;var U=new Set(["EBUSY","EAGAIN","ETIMEDOUT","ECONNRESET","ECONNREFUSED","ENOTFOUND","EAI_AGAIN"]),x=new Set(["ENOENT","EACCES","EPERM","EISDIR","ENOTDIR","EINVAL"]);function D(r){if(!r||typeof r!="object")return!1;let e=r;if(e.code&&U.has(e.code))return!0;if(e.code&&x.has(e.code))return!1;if(e.message){let t=e.message.toLowerCase();if(t.includes("timeout")||t.includes("timed out"))return!0}return!1}n(D,"isTransientError");function G(r){if(!r||typeof r!="object")return!1;let e=r;return!!(e.code&&x.has(e.code))}n(G,"isPermanentError");var o=new Map;function T(r,e,t){let i=o.get(r);return i&&i.consecutiveFailures>=e&&i.openedAt?Date.now()-i.openedAt>=t?(o.delete(r),!1):!0:!1}n(T,"isCircuitOpen");function S(r,e){let t=o.get(r)||{consecutiveFailures:0,openedAt:null};t.consecutiveFailures++,t.consecutiveFailures>=e&&!t.openedAt&&(t.openedAt=Date.now()),o.set(r,t)}n(S,"recordFailure");function z(r){o.delete(r)}n(z,"recordSuccess");var m=class{static{n(this,"RetryPolicy")}options;constructor(e={}){this.options={maxAttempts:e.maxAttempts??3,baseDelayMs:e.baseDelayMs??1e3,maxDelayMs:e.maxDelayMs??8e3,circuitBreakerThreshold:e.circuitBreakerThreshold??5,circuitBreakerTimeoutMs:e.circuitBreakerTimeoutMs??6e4}}async execute(e,t="default"){if(T(t,this.options.circuitBreakerThreshold,this.options.circuitBreakerTimeoutMs))throw new Error(`Circuit breaker is open for operation: ${t}. Too many consecutive failures.`);let i=n(async s=>{try{let u=await e();return z(t),u}catch(u){if(G(u))throw S(t,this.options.circuitBreakerThreshold),u;if(!(D(u)&&s<this.options.maxAttempts))throw S(t,this.options.circuitBreakerThreshold),u;let I=Math.min(this.options.baseDelayMs*2**(s-1),this.options.maxDelayMs);return await new Promise(M=>setTimeout(M,I)),i(s+1)}},"executeAttempt");return i(1)}isTransientError(e){return D(e)}isCircuitOpen(e){return T(e,this.options.circuitBreakerThreshold,this.options.circuitBreakerTimeoutMs)}getCircuitState(e){return o.get(e)}resetCircuit(e){o.delete(e)}resetAllCircuits(){o.clear()}},P=new m({maxAttempts:3,baseDelayMs:1e3,maxDelayMs:8e3}),te=new m({maxAttempts:2,baseDelayMs:500,maxDelayMs:2e3});var q=["claude"],h=class{static{n(this,"AgentService")}agent=null;agentInfo=null;async initialize(){return this.agent?this.agent:await P.execute(async()=>{if(this.agentInfo=await E(),!this.agentInfo?.isSupported)throw d.notSupported(this.agentInfo?.type??"unknown");let e=this.agentInfo.type;if(!e||!q.includes(e))throw d.notSupported(this.agentInfo?.type??"unknown");return this.agent=new C,this.agent},"agent-initialization")}getInfo(){return this.agentInfo}getAgent(){return this.agent}isInitialized(){return this.agent!==null}reset(){this.agent=null,this.agentInfo=null}},g=new h;var w=class{static{n(this,"BreakdownService")}breakdownFeature(e){return[]}detectBugSeverity(e){return"medium"}estimateComplexity(e){return{level:"medium",hours:4}}detectTaskType(e){return"feature"}},b=new w;var R=class{static{n(this,"PrjctCommandsBase")}prjctDir;updateNotificationShown;constructor(){this.prjctDir=".prjct",this.updateNotificationShown=!1}get agent(){return g.getAgent()}get agentInfo(){return g.getInfo()}get currentAuthor(){return a.getCurrentAuthor()}async initializeAgent(){return g.initialize()}async ensureProjectInit(e){return a.ensureInit(e)}async ensureAuthor(){return a.ensureAuthor()}async getGlobalProjectPath(e){return a.getGlobalPath(e)}async logToMemory(e,t,i){let s=await this.ensureAuthor();await v.log(e,t,i,s.name)}async _detectEmptyDirectory(e){return a.isEmptyDirectory(e)}async _detectExistingCode(e){return a.hasExistingCode(e)}_breakdownFeatureTasks(e){return b.breakdownFeature(e)}_detectBugSeverity(e){return b.detectBugSeverity(e)}};export{R as a};
@@ -0,0 +1,18 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as S}from"./chunk-YEALP3WX.mjs";import{g as A,l as k,n as x,p as E}from"./chunk-QZ7T2EYR.mjs";import{n as H,p as T}from"./chunk-D62TAZG6.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";import{createHash as W}from"node:crypto";import G from"node:fs/promises";import U from"node:path";T();var B=20,p=new Map;function v(e){return W("sha256").update(e).digest("hex")}o(v,"sha256Hex");async function N(e,n,t){if(t.length===0)return`${n}:empty`;let s=await M(e,n),a=s?await f(e,["diff",s,"--",...t])??"":"",i=await f(e,["ls-files","--others","--exclude-standard","--",...t])??"",c=[];for(let l of i.split(`
8
+ `).filter(Boolean)){let u=await G.readFile(U.join(e,l)).catch(()=>null);c.push(`${l}:${u?v(u.toString("utf8")):"missing"}`)}let g=[n,[...t].sort().join(","),a,c.sort().join(",")];return v(g.join(`
9
+ `))}o(N,"computeDiffSignature");async function f(e,n){return H(e,n)}o(f,"safeGit");async function z(e){let n=await f(e,["diff","--name-only","HEAD"])??"",t=await f(e,["diff","--name-only","--cached"])??"",s=await f(e,["ls-files","--others","--exclude-standard"])??"",a=new Set;for(let i of[n,t,s])for(let c of i.split(`
10
+ `))c.trim()&&a.add(c.trim());return[...a]}o(z,"listWorkingTreeFiles");async function K(e){let n=await _(e);if(!n)return[];let t=await f(e,["merge-base",n,"HEAD"]);return t?(await f(e,["diff","--name-only",`${t}..HEAD`])??"").split(`
11
+ `).filter(Boolean):[]}o(K,"listCommittedFiles");async function _(e){let n=await f(e,["rev-parse","--abbrev-ref","origin/HEAD"]);return n&&n!=="origin/HEAD"?n:(await Promise.all(["main","master"].map(async s=>({candidate:s,exists:await f(e,["rev-parse","--verify","--quiet",s])!==null})))).find(({exists:s})=>s)?.candidate??""}o(_,"resolveDefaultRef");async function M(e,n){if(n==="working-tree"||n==="explicit")return"HEAD";let t=await _(e);return t?await f(e,["merge-base",t,"HEAD"])??"HEAD":"HEAD"}o(M,"resolveDiffBase");function q(e){let n=new Map,t={currentFile:null,newLine:0};for(let s of e.split(`
12
+ `)){if(s.startsWith("+++ ")){let i=s.slice(4).trim();if(i==="/dev/null"){t.currentFile=null;continue}t.currentFile=i.replace(/^b\//,""),n.has(t.currentFile)||n.set(t.currentFile,new Set);continue}if(!t.currentFile)continue;let a=s.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@/);if(a){t.newLine=Number.parseInt(a[1],10);continue}s.startsWith("\\")||(s.startsWith("+")&&!s.startsWith("+++")?(n.get(t.currentFile)?.add(t.newLine),t.newLine++):s.startsWith("-")&&!s.startsWith("---")||(s.startsWith(" ")||s==="")&&t.newLine++)}return n}o(q,"parseChangedLinesFromUnifiedDiff");async function X(e,n,t){if(t.length===0)return new Map;let s=await M(e,n);if(!s)return new Map;let a=n==="committed"?["diff","-U0",`${s}..HEAD`,"--",...t]:["diff","-U0","HEAD","--",...t],i=await f(e,a)??"",c=n!=="committed"?await f(e,["diff","-U0","--cached","--",...t])??"":"";return q(`${i}
13
+ ${c}`)}o(X,"loadHunkLines");function J(e,n,t){let s=k(e,n);if(s.length===0)return[];if(!t||t.size===0)return s.slice(0,12).map(c=>c.name);let a=[...t].sort((c,g)=>c-g),i=new Set;for(let c of a){let g=s.reduce((l,u)=>u.startLine<=c?u:l,s[0]);i.add(g.name);for(let l of s)t.has(l.startLine)&&i.add(l.name)}return[...i].slice(0,12)}o(J,"symbolsTouchedByHunks");var O=/(?:^|\/)(?:auth|security|crypto|billing|payment|migrate|schema|migrations?)(?:\/|$)/i,P=/(?:^|\/)(?:storage|database|db|sync|daemon|mcp|hooks?|session)(?:\/|$)/i;function Q(e,n,t,s,a){let i=[],c=O.test(e)?"critical":P.test(e)?"high":"low";c==="critical"?i.push("touches auth/security/billing/schema path"):c==="high"&&i.push("touches storage/sync/hooks/mcp path");let g=n>=15?"critical":n>=5?"high":n>0?"medium":"low";n>=15?i.push(`high call fan-in (${n} callers)`):n>=5?i.push(`moderate call fan-in (${n} callers)`):n>0&&i.push(`${n} caller(s) via symbol graph`);let l=t>=10?"high":t>=3?"medium":"low";t>=10?i.push(`${t} importers`):t>=3&&i.push(`${t} importers`),a>0&&i.push(`${a} symbol(s) in changed hunks`),!s&&t===0&&n===0&&i.push("leaf change (no graph neighbors)");let u={low:0,medium:1,high:2,critical:3},m=[c,g,l].reduce((w,d)=>u[d]>u[w]?d:w);return i.length===0&&i.push("isolated or low connectivity"),{risk:m,reasons:i}}o(Q,"classifyRisk");async function te(e,n,t={}){let s=await(async()=>{if(t.files&&t.files.length>0)return{changedFiles:t.files,source:"explicit"};let r=t.source??"auto";if(r==="working-tree"||r==="auto"){let h=await z(e);if(h.length>0||r==="working-tree")return{changedFiles:h,source:"working-tree"}}return r==="committed"||r==="auto"?{changedFiles:await K(e),source:"committed"}:{changedFiles:[],source:"explicit"}})(),{changedFiles:a,source:i}=s,c=`${n}:${i}:${t.files?[...t.files].sort().join(","):""}`,g=await N(e,i,a),l=p.get(c);if(l&&l.signature===g)return l.result;let u=S(n),m=A(n),w=m?await X(e,i,a.slice(0,80)):new Map,d=new Set(a);for(let r of a){let h=u?.reverse[r]??[];for(let y of h)d.add(y)}if(m)for(let r of E(n,a,2))d.add(r);let $=[],C={critical:0,high:0,medium:0,low:0};for(let r of a){let h=u?.reverse[r]??[],y=m?x(n,r):0,b=m?J(n,r,w.get(r)):[],{risk:R,reasons:L}=Q(r,y,h.length,b.length>0||m&&k(n,r).length>0,b.length);C[R]++,$.push({file:r,risk:R,touchedSymbols:b,fanIn:y,reasons:L})}let F={critical:0,high:1,medium:2,low:3};$.sort((r,h)=>F[r.risk]-F[h.risk]||r.file.localeCompare(h.file));let D={changedFiles:a,affectedFiles:[...d].sort(),changes:$,summary:C,source:i};if(p.size>=B){let r=p.keys().next().value;r!==void 0&&p.delete(r)}return p.set(c,{signature:g,result:D}),D}o(te,"detectChanges");function ne(e){if(e.changedFiles.length===0)return`## Detect changes
14
+
15
+ _No changes detected (clean tree / no base range)._
16
+ `;let n=["## Detect changes","",`- **Source**: ${e.source}`,`- **Changed**: ${e.changedFiles.length} file(s)`,`- **Blast radius**: ${e.affectedFiles.length} file(s) (imports + call-graph)`,`- **Risk**: critical ${e.summary.critical} \xB7 high ${e.summary.high} \xB7 medium ${e.summary.medium} \xB7 low ${e.summary.low}`,"","### Per-file risk",""];for(let t of e.changes){let s=t.touchedSymbols.length>0?` \xB7 symbols: ${t.touchedSymbols.slice(0,6).join(", ")}`:"";n.push(`- **${t.risk.toUpperCase()}** \`${t.file}\`${s}`,` - ${t.reasons.join("; ")}`)}if(e.affectedFiles.length>e.changedFiles.length){n.push("","### Affected beyond diff","");let t=e.affectedFiles.filter(s=>!e.changedFiles.includes(s)).slice(0,25);for(let s of t)n.push(`- \`${s}\``);e.affectedFiles.length-e.changedFiles.length>25&&n.push(`- _\u2026+${e.affectedFiles.length-e.changedFiles.length-25} more_`)}return n.push("","_Advisory. Expand with `prjct code trace <symbol>` or MCP `prjct_trace_path`._"),n.join(`
17
+ `)}o(ne,"formatDetectChangesMd");function se(e){if(e.changedFiles.length===0)return"detect-changes: no changes detected";let n=[`Detect changes (${e.source}): ${e.changedFiles.length} changed \u2192 blast ${e.affectedFiles.length}`,`Risk: critical=${e.summary.critical} high=${e.summary.high} medium=${e.summary.medium} low=${e.summary.low}`];for(let t of e.changes.slice(0,30)){let s=t.touchedSymbols.length?` [${t.touchedSymbols.slice(0,4).join(",")}]`:"";n.push(` [${t.risk.toUpperCase()}] ${t.file}${s} \u2014 ${t.reasons[0]??""}`)}return n.join(`
18
+ `)}o(se,"formatDetectChangesText");function ie(e){return e.changedFiles.length===0?null:e.summary.critical>0?`\u26A0\uFE0F Structural risk CRITICAL (${e.summary.critical} file(s), blast ${e.affectedFiles.length}). Review: \`prjct code impact --md\`.`:e.summary.high>0?`\u26A0\uFE0F Structural risk HIGH (${e.summary.high} file(s), blast ${e.affectedFiles.length}). Consider \`prjct code impact --md\`.`:null}o(ie,"shipStructuralRiskCue");export{q as a,J as b,te as c,ne as d,se as e,ie as f};