prjct-cli 3.95.0 → 3.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-HCP5FF77.mjs +31 -0
  4. package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
  5. package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
  6. package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
  7. package/dist/bin/core-chunks/agent-switch-AVSX6SLY.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-OAQXBGH3.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-3A7ODSSI.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-EWSVMKQN.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-LLHG2NSY.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-7LQ52T6L.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-M4HM7WAI.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-4OZ3FKRE.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-CUNVCEL5.mjs +10 -0
  19. package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
  20. package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
  21. package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
  22. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  23. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  24. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  25. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  26. package/dist/bin/core-chunks/chunk-2ZPM4Z6W.mjs +17 -0
  27. package/dist/bin/core-chunks/chunk-3FXNIJCS.mjs +8 -0
  28. package/dist/bin/core-chunks/chunk-3JD6KRNJ.mjs +8 -0
  29. package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3USVY66O.mjs +7 -0
  31. package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
  32. package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
  33. package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
  34. package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
  35. package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
  36. package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
  37. package/dist/bin/core-chunks/chunk-53ZPEZLU.mjs +8 -0
  38. package/dist/bin/core-chunks/chunk-56FW4P6U.mjs +10 -0
  39. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  40. package/dist/bin/core-chunks/chunk-5MN22JFI.mjs +19 -0
  41. package/dist/bin/core-chunks/chunk-5ONMON5L.mjs +13 -0
  42. package/dist/bin/core-chunks/chunk-5UUITMRX.mjs +9 -0
  43. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  44. package/dist/bin/core-chunks/chunk-5YSPND5J.mjs +9 -0
  45. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  46. package/dist/bin/core-chunks/chunk-6AFXUX2M.mjs +9 -0
  47. package/dist/bin/core-chunks/chunk-6FFOWWH2.mjs +17 -0
  48. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  50. package/dist/bin/core-chunks/chunk-6P4GMVUZ.mjs +18 -0
  51. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  52. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  53. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  54. package/dist/bin/core-chunks/chunk-7CI4AMVO.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7QMBIMEX.mjs +64 -0
  56. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  57. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  58. package/dist/bin/core-chunks/chunk-AJTBFIH2.mjs +9 -0
  59. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  60. package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
  61. package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
  62. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  63. package/dist/bin/core-chunks/chunk-BQKDJ3U6.mjs +8 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTCCUMKI.mjs +12 -0
  66. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  67. package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
  68. package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
  69. package/dist/bin/core-chunks/chunk-CDLZLTRY.mjs +10 -0
  70. package/dist/bin/core-chunks/chunk-CEOTHJIY.mjs +10 -0
  71. package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
  72. package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
  73. package/dist/bin/core-chunks/chunk-CNWEQUB7.mjs +7 -0
  74. package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  77. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
  78. package/dist/bin/core-chunks/chunk-DCVPNFS4.mjs +8 -0
  79. package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
  80. package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
  81. package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
  82. package/dist/bin/core-chunks/chunk-DN46DLU3.mjs +10 -0
  83. package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  85. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  86. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  88. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  89. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  90. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  91. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  92. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  93. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  94. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  95. package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  98. package/dist/bin/core-chunks/chunk-GOIBJ7PV.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  100. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  102. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  103. package/dist/bin/core-chunks/chunk-HEXSVBUP.mjs +8 -0
  104. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  106. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  108. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  109. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  110. package/dist/bin/core-chunks/chunk-IFLBZKKK.mjs +14 -0
  111. package/dist/bin/core-chunks/chunk-IMQCXC3R.mjs +30 -0
  112. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  113. package/dist/bin/core-chunks/chunk-INM5COWM.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-IVGWOY3U.mjs +8 -0
  116. package/dist/bin/core-chunks/chunk-J7T5IEFJ.mjs +15 -0
  117. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  118. package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
  119. package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
  120. package/dist/bin/core-chunks/chunk-K25HGTC3.mjs +10 -0
  121. package/dist/bin/core-chunks/chunk-KIRU4QFX.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KKIJAEYU.mjs +7 -0
  123. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  124. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  125. package/dist/bin/core-chunks/chunk-KWC2PCPC.mjs +10 -0
  126. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  127. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LZC6NGB6.mjs +50 -0
  129. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  130. package/dist/bin/core-chunks/chunk-MDONTD7O.mjs +21 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  133. package/dist/bin/core-chunks/chunk-MTDCRYLP.mjs +7 -0
  134. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  135. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  137. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  139. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  140. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  141. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  142. package/dist/bin/core-chunks/chunk-OYXQRBVM.mjs +10 -0
  143. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  144. package/dist/bin/core-chunks/chunk-P53YMOKR.mjs +7 -0
  145. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  146. package/dist/bin/core-chunks/chunk-PPERWRFS.mjs +13 -0
  147. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  148. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  149. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  151. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-QLMZW4K7.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  154. package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  156. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  157. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  158. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  159. package/dist/bin/core-chunks/chunk-RXXXA7Z6.mjs +7 -0
  160. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  161. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  162. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  163. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  165. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  166. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  167. package/dist/bin/core-chunks/chunk-TGNZI4KF.mjs +28 -0
  168. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  169. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  170. package/dist/bin/core-chunks/chunk-TTN2CFZC.mjs +7 -0
  171. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  172. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  173. package/dist/bin/core-chunks/chunk-UE3XKXWM.mjs +7 -0
  174. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  175. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  176. package/dist/bin/core-chunks/chunk-UT425KVX.mjs +10 -0
  177. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  178. package/dist/bin/core-chunks/chunk-V3Y3G2DE.mjs +8 -0
  179. package/dist/bin/core-chunks/chunk-V5VCXMKO.mjs +52 -0
  180. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  181. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  182. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  183. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  184. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  185. package/dist/bin/core-chunks/chunk-VDXTMAMO.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +103 -0
  187. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  188. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  189. package/dist/bin/core-chunks/chunk-WGDE3L33.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-WP5IU4W4.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-WSVMQYYU.mjs +12 -0
  192. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WZXUFSVT.mjs +25 -0
  194. package/dist/bin/core-chunks/chunk-X35YYOFE.mjs +18 -0
  195. package/dist/bin/core-chunks/chunk-X4FR5S7E.mjs +9 -0
  196. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XPRLQIVQ.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XSZG3CBO.mjs +7 -0
  200. package/dist/bin/core-chunks/chunk-XU3BQPBU.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XYDLXF5A.mjs +8 -0
  202. package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +7 -0
  203. package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
  204. package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
  205. package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
  206. package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
  207. package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
  208. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  209. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  211. package/dist/bin/core-chunks/chunk-ZHTYSYZC.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZK7BMUMR.mjs +7 -0
  213. package/dist/bin/core-chunks/chunk-ZKJZDOPT.mjs +14 -0
  214. package/dist/bin/core-chunks/chunk-ZQHSJ6FF.mjs +20 -0
  215. package/dist/bin/core-chunks/chunk-ZS7XJUPE.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/cleanup-installs-WHXUGAHM.mjs +7 -0
  218. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  219. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  220. package/dist/bin/core-chunks/cloud-FFUJZLDV.mjs +14 -0
  221. package/dist/bin/core-chunks/code-SU7GCPH6.mjs +12 -0
  222. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  223. package/dist/bin/core-chunks/codex-hooks-GOLMCL2Q.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-mcp-K4X2UIQF.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-skill-3HNVU4T4.mjs +7 -0
  226. package/dist/bin/core-chunks/command-installer-XIQK2G6W.mjs +7 -0
  227. package/dist/bin/core-chunks/config-W3RHV3GK.mjs +8 -0
  228. package/dist/bin/core-chunks/config-manager-QVFHXIKI.mjs +7 -0
  229. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  230. package/dist/bin/core-chunks/context-4KGTUAC4.mjs +38 -0
  231. package/dist/bin/core-chunks/context-DDHC7VIC.mjs +10 -0
  232. package/dist/bin/core-chunks/context-checkpoint-4CEUPEVG.mjs +27 -0
  233. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  234. package/dist/bin/core-chunks/context-tiers-4S6H22NP.mjs +7 -0
  235. package/dist/bin/core-chunks/context7-service-AZWDYK5Z.mjs +7 -0
  236. package/dist/bin/core-chunks/core-PR5WEQCS.mjs +70 -0
  237. package/dist/bin/core-chunks/crew-JQCG6NS3.mjs +24 -0
  238. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  239. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  240. package/dist/bin/core-chunks/cwd-changed-ODKZVSPB.mjs +7 -0
  241. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  242. package/dist/bin/core-chunks/daemon-2NQTBFVR.mjs +13 -0
  243. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  244. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  245. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  246. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  247. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  248. package/dist/bin/core-chunks/developer-profile-MRPBWL2K.mjs +7 -0
  249. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  250. package/dist/bin/core-chunks/distill-MLDZG5RA.mjs +7 -0
  251. package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-service-WXLB2FEE.mjs +8 -0
  253. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  254. package/dist/bin/core-chunks/dynasty-outcomes-H2O546OL.mjs +11 -0
  255. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  256. package/dist/bin/core-chunks/embeddings-7A5Z5I67.mjs +7 -0
  257. package/dist/bin/core-chunks/enriched-recall-YXK7EIKH.mjs +7 -0
  258. package/dist/bin/core-chunks/eval-4YFUBFLV.mjs +76 -0
  259. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  260. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  261. package/dist/bin/core-chunks/format-5V6GF6JJ.mjs +7 -0
  262. package/dist/bin/core-chunks/gemini-settings-ZTU3VQU3.mjs +7 -0
  263. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  264. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  265. package/dist/bin/core-chunks/grok-mcp-F3SRFMCW.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-plugin-4CE2WUYI.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-skill-GLSBOOKW.mjs +7 -0
  268. package/dist/bin/core-chunks/guard-FJBJ6IAE.mjs +13 -0
  269. package/dist/bin/core-chunks/guards-LFUFKVVH.mjs +7 -0
  270. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  271. package/dist/bin/core-chunks/harness-FN3HASSA.mjs +43 -0
  272. package/dist/bin/core-chunks/health-W2VWME7Z.mjs +11 -0
  273. package/dist/bin/core-chunks/help-I37I3V2R.mjs +14 -0
  274. package/dist/bin/core-chunks/hooks-service-C2P5DRCH.mjs +91 -0
  275. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  276. package/dist/bin/core-chunks/install-XP4S6HWQ.mjs +9 -0
  277. package/dist/bin/core-chunks/judgment-GJE332LF.mjs +21 -0
  278. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  279. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-receipt-WT4EMCAV.mjs +7 -0
  281. package/dist/bin/core-chunks/kimi-hooks-2UEUIKXV.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-mcp-DJCXZ2JY.mjs +7 -0
  283. package/dist/bin/core-chunks/land-cue-5USQ64MS.mjs +8 -0
  284. package/dist/bin/core-chunks/land-rho-ISNVEPVC.mjs +8 -0
  285. package/dist/bin/core-chunks/land-synthesis-CHARJMUP.mjs +7 -0
  286. package/dist/bin/core-chunks/lean-L53CKZNH.mjs +34 -0
  287. package/dist/bin/core-chunks/legacy-crew-sweep-2TLKJTHI.mjs +23 -0
  288. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  289. package/dist/bin/core-chunks/llm-XMH7WTHV.mjs +18 -0
  290. package/dist/bin/core-chunks/mcp-FLVIZBV2.mjs +17 -0
  291. package/dist/bin/core-chunks/memory-dream-EJWI4FJO.mjs +14 -0
  292. package/dist/bin/core-chunks/memory-export-27HTNNFI.mjs +13 -0
  293. package/dist/bin/core-chunks/memory-index-BRZDZ2BY.mjs +7 -0
  294. package/dist/bin/core-chunks/notification-KJ4FQJAW.mjs +7 -0
  295. package/dist/bin/core-chunks/notify-76B7AICZ.mjs +9 -0
  296. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  297. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  298. package/dist/bin/core-chunks/opencode-mcp-5YSIYDI3.mjs +7 -0
  299. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  300. package/dist/bin/core-chunks/pack-integrity-GXN67LJB.mjs +9 -0
  301. package/dist/bin/core-chunks/pack-manager-46SPIPPD.mjs +7 -0
  302. package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +7 -0
  303. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  304. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  305. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  306. package/dist/bin/core-chunks/pi-skill-SDHTUK3V.mjs +7 -0
  307. package/dist/bin/core-chunks/planning-S3MYVWH6.mjs +8 -0
  308. package/dist/bin/core-chunks/post-edit-5YSNEMK7.mjs +7 -0
  309. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  310. package/dist/bin/core-chunks/pre-bash-GLDILCRF.mjs +10 -0
  311. package/dist/bin/core-chunks/pre-commit-U6HPPNIC.mjs +7 -0
  312. package/dist/bin/core-chunks/pre-edit-PEYQA6P6.mjs +8 -0
  313. package/dist/bin/core-chunks/pre-package-76JR5GLO.mjs +7 -0
  314. package/dist/bin/core-chunks/pre-search-5EHNUOP3.mjs +8 -0
  315. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  316. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  318. package/dist/bin/core-chunks/preferences-BTSYWYUM.mjs +31 -0
  319. package/dist/bin/core-chunks/primitives-IXAYLX7U.mjs +13 -0
  320. package/dist/bin/core-chunks/prjct-md-SUDFWDCS.mjs +7 -0
  321. package/dist/bin/core-chunks/product-KKGJ6MMF.mjs +68 -0
  322. package/dist/bin/core-chunks/project-agent-surfaces-I2CUZUIN.mjs +7 -0
  323. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  324. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  325. package/dist/bin/core-chunks/project-memory-GYLYIJQD.mjs +7 -0
  326. package/dist/bin/core-chunks/project-style-evolution-5W25UPPN.mjs +7 -0
  327. package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +23 -0
  328. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  329. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  331. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  332. package/dist/bin/core-chunks/purge-5EPJV25P.mjs +7 -0
  333. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  334. package/dist/bin/core-chunks/registry-LK6IQ5UX.mjs +7 -0
  335. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  336. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  337. package/dist/bin/core-chunks/retention-S22T3SPT.mjs +7 -0
  338. package/dist/bin/core-chunks/retro-CLKOHAN6.mjs +13 -0
  339. package/dist/bin/core-chunks/review-risk-LLLBKUXT.mjs +12 -0
  340. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  341. package/dist/bin/core-chunks/safe-artifacts-RW5WQUUJ.mjs +9 -0
  342. package/dist/bin/core-chunks/sdd-HE7O6N5S.mjs +9 -0
  343. package/dist/bin/core-chunks/seed-JX7W53E5.mjs +10 -0
  344. package/dist/bin/core-chunks/self-heal-DFUEKNF3.mjs +7 -0
  345. package/dist/bin/core-chunks/session-continuity-BFSW4OL6.mjs +10 -0
  346. package/dist/bin/core-chunks/session-start-HVYUKJL2.mjs +7 -0
  347. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  348. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  349. package/dist/bin/core-chunks/setup-GHS24ER5.mjs +140 -0
  350. package/dist/bin/core-chunks/setup-J4JFYT63.mjs +38 -0
  351. package/dist/bin/core-chunks/shipping-I4D4AVTE.mjs +12 -0
  352. package/dist/bin/core-chunks/signals-digest-V44KYN6Z.mjs +7 -0
  353. package/dist/bin/core-chunks/skill-adherence-MHY4BZL4.mjs +13 -0
  354. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  355. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  356. package/dist/bin/core-chunks/spec-2XXPLHUZ.mjs +27 -0
  357. package/dist/bin/core-chunks/spec-context-inference-THFMXC7S.mjs +9 -0
  358. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-service-I23KJKKP.mjs +7 -0
  360. package/dist/bin/core-chunks/spec-task-breakdown-HTG6ME6G.mjs +7 -0
  361. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  362. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  363. package/dist/bin/core-chunks/stop-2H57XCGZ.mjs +15 -0
  364. package/dist/bin/core-chunks/subagent-start-5LPASXOS.mjs +7 -0
  365. package/dist/bin/core-chunks/subagent-stop-ANLSG3KN.mjs +7 -0
  366. package/dist/bin/core-chunks/surface-attribution-WL7S53XX.mjs +7 -0
  367. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  368. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  371. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  372. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  373. package/dist/bin/core-chunks/task-service-FK7FC3PE.mjs +7 -0
  374. package/dist/bin/core-chunks/tdd-NQDHU62B.mjs +9 -0
  375. package/dist/bin/core-chunks/team-XZ4Q6UBV.mjs +42 -0
  376. package/dist/bin/core-chunks/template-loader-33OVJ4G5.mjs +7 -0
  377. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  378. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  379. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  380. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  381. package/dist/bin/core-chunks/uninstall-6NFON7FO.mjs +13 -0
  382. package/dist/bin/core-chunks/update-4IE6SA6M.mjs +11 -0
  383. package/dist/bin/core-chunks/update-checker-FK7MWNWN.mjs +7 -0
  384. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  385. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  386. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  387. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  388. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  389. package/dist/bin/core-chunks/version-252QLBN2.mjs +7 -0
  390. package/dist/bin/core-chunks/watch-service-7ZERG7RC.mjs +9 -0
  391. package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +7 -0
  392. package/dist/bin/core-chunks/weak-model-mode-DH66XMD2.mjs +7 -0
  393. package/dist/bin/core-chunks/work-graph-JGJWE3AV.mjs +16 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-scope-3LXOEIUX.mjs +7 -0
  396. package/dist/bin/core-chunks/workflow-FGJVLRQ3.mjs +61 -0
  397. package/dist/bin/core-chunks/workflows-reference-UWKRZ6BJ.mjs +7 -0
  398. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  399. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  400. package/dist/bin/core-chunks/world-model-impact-RH5WH2B3.mjs +7 -0
  401. package/dist/bin/hook-chunks/{agent-identity-45BYQBU2.mjs → agent-identity-DH6DX72X.mjs} +1 -1
  402. package/dist/bin/hook-chunks/{agent-switch-4ZJJWKMD.mjs → agent-switch-7GOGG4KG.mjs} +1 -1
  403. package/dist/bin/hook-chunks/{analysis-UGHAG2SK.mjs → analysis-UI2JRLJO.mjs} +3 -3
  404. package/dist/bin/hook-chunks/{auto-flush-CXWTU3RF.mjs → auto-flush-JKIXTI2I.mjs} +1 -1
  405. package/dist/bin/hook-chunks/{capture-gate-PS6QUXLX.mjs → capture-gate-DIPHPNIC.mjs} +1 -1
  406. package/dist/bin/hook-chunks/{chunk-YDBZO6I3.mjs → chunk-22GFTUER.mjs} +1 -1
  407. package/dist/bin/hook-chunks/chunk-25OGCQTR.mjs +69 -0
  408. package/dist/bin/hook-chunks/{chunk-DCSKTMDX.mjs → chunk-3CKNJ5RA.mjs} +1 -1
  409. package/dist/bin/hook-chunks/{chunk-ABJNOG2I.mjs → chunk-3FEXJUO2.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-22AXWLI6.mjs → chunk-3HGQPUKG.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-GLPKMG5A.mjs → chunk-63P5VOR6.mjs} +10 -10
  412. package/dist/bin/hook-chunks/{chunk-PP6DANGV.mjs → chunk-6LU777GI.mjs} +1 -1
  413. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  414. package/dist/bin/hook-chunks/{chunk-QL3NYJTW.mjs → chunk-6RS7PNAN.mjs} +1 -1
  415. package/dist/bin/hook-chunks/{chunk-PO3QDKTE.mjs → chunk-6WDRJ7J7.mjs} +1 -1
  416. package/dist/bin/hook-chunks/chunk-7PA4KPSR.mjs +51 -0
  417. package/dist/bin/hook-chunks/{chunk-QP5USCDX.mjs → chunk-7WO5CEH3.mjs} +1 -1
  418. package/dist/bin/hook-chunks/{chunk-FW4MEPTB.mjs → chunk-A6LRNS6R.mjs} +1 -1
  419. package/dist/bin/hook-chunks/{chunk-GCDLPKOH.mjs → chunk-AEDB75AK.mjs} +1 -1
  420. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  421. package/dist/bin/hook-chunks/{chunk-WGWE3CSC.mjs → chunk-ANSRNEEI.mjs} +1 -1
  422. package/dist/bin/hook-chunks/{chunk-RTEEXGEA.mjs → chunk-AORD3YDQ.mjs} +1 -1
  423. package/dist/bin/hook-chunks/chunk-B2ZA5ZAO.mjs +8 -0
  424. package/dist/bin/hook-chunks/{chunk-BOBFTVAY.mjs → chunk-B7MHIUFA.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-Z6KVLCMK.mjs → chunk-BKJHD5JI.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-4NTVXJD7.mjs → chunk-BVK7ZDLX.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-IGHY4FGS.mjs → chunk-CPR4FPXG.mjs} +1 -1
  428. package/dist/bin/hook-chunks/{chunk-5XA5RL5I.mjs → chunk-ETTDRXQ6.mjs} +1 -1
  429. package/dist/bin/hook-chunks/chunk-F3PNT2DQ.mjs +19 -0
  430. package/dist/bin/hook-chunks/{chunk-C4O243NG.mjs → chunk-FBEDUKMG.mjs} +1 -1
  431. package/dist/bin/hook-chunks/{chunk-5H3KJWQS.mjs → chunk-GER6HFWV.mjs} +2 -2
  432. package/dist/bin/hook-chunks/{chunk-IWJG7CZX.mjs → chunk-GSPDJSJ5.mjs} +1 -1
  433. package/dist/bin/hook-chunks/chunk-H5AVBDCH.mjs +8 -0
  434. package/dist/bin/hook-chunks/{chunk-HEDZA6KC.mjs → chunk-HGZQWYBL.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-GDESYWTD.mjs → chunk-HNZ24HIK.mjs} +2 -2
  436. package/dist/bin/hook-chunks/{chunk-S5ISOGDB.mjs → chunk-IDPBMN3Q.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-PTA7DMLM.mjs → chunk-IFIENAZU.mjs} +1 -1
  438. package/dist/bin/hook-chunks/chunk-IHEOOJJT.mjs +11 -0
  439. package/dist/bin/hook-chunks/{chunk-S5N2ZZDL.mjs → chunk-IL36ER4U.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-6GAFRIUQ.mjs → chunk-IWUF2LGO.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-OGIFB3OE.mjs → chunk-JF6DFOQK.mjs} +1 -1
  442. package/dist/bin/hook-chunks/{chunk-Z4X7JIAP.mjs → chunk-JGZ3QGWX.mjs} +3 -3
  443. package/dist/bin/hook-chunks/chunk-KOLXYWOA.mjs +36 -0
  444. package/dist/bin/hook-chunks/{chunk-DVDZA63F.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{chunk-J5UQVJUW.mjs → chunk-NCLONKOT.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{chunk-QBYHZX33.mjs → chunk-NJ74RHNC.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{chunk-NLKPAJND.mjs → chunk-NMB6YSAH.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{chunk-MHNWIB7B.mjs → chunk-NSTXHVTH.mjs} +2 -2
  449. package/dist/bin/hook-chunks/{chunk-N3L77UNM.mjs → chunk-ONGVBXBD.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{chunk-X5W2UYQK.mjs → chunk-PFORBQBF.mjs} +3 -3
  451. package/dist/bin/hook-chunks/{chunk-KSSRINDX.mjs → chunk-PPWPUEBH.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{chunk-76GDLA3Z.mjs → chunk-PQJ64L6U.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{chunk-PGWFGRX4.mjs → chunk-QOQZHR3E.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{chunk-2UC4DTDO.mjs → chunk-QXCEBAIA.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{chunk-I26F7TLM.mjs → chunk-RLKYEL3F.mjs} +1 -1
  456. package/dist/bin/hook-chunks/{chunk-BDOAQVIF.mjs → chunk-SQW2B7NW.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{chunk-4HAKTI36.mjs → chunk-TF6PN7IB.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{chunk-UHVYBU7F.mjs → chunk-TKXOMN4K.mjs} +4 -4
  459. package/dist/bin/hook-chunks/{chunk-BX7VKYA7.mjs → chunk-UBWUQ64A.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{chunk-OUAVSD47.mjs → chunk-UI25YRTY.mjs} +1 -1
  461. package/dist/bin/hook-chunks/{chunk-G7QQZMAO.mjs → chunk-UMJ5D5I6.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{chunk-ZOX6OV6X.mjs → chunk-V6GGH6H5.mjs} +1 -1
  463. package/dist/bin/hook-chunks/chunk-WIA6ORIY.mjs +16 -0
  464. package/dist/bin/hook-chunks/chunk-WUOVBBPC.mjs +11 -0
  465. package/dist/bin/hook-chunks/{chunk-T6ELTQZM.mjs → chunk-XSJ7SPVR.mjs} +1 -1
  466. package/dist/bin/hook-chunks/{chunk-UYQC63MC.mjs → chunk-XXVHUYL7.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{chunk-RHKF7EJW.mjs → chunk-Y7MZA2G4.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{chunk-U4OON3S7.mjs → chunk-Y7RDBMNC.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{chunk-ROA2AJXY.mjs → chunk-YATXTHDL.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{chunk-ZFLIVOFX.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{chunk-S6L3FECF.mjs → chunk-ZH2MF7H7.mjs} +1 -1
  472. package/dist/bin/hook-chunks/{chunk-3WQBTXUC.mjs → chunk-ZJW27EUC.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{chunk-J5UVRZ44.mjs → chunk-ZXON2U5F.mjs} +3 -3
  474. package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +9 -0
  475. package/dist/bin/hook-chunks/{client-CRXA774S.mjs → client-K3ZA2BLB.mjs} +1 -1
  476. package/dist/bin/hook-chunks/{code-graph-cloud-GTSLO7CD.mjs → code-graph-cloud-XGQF7XYC.mjs} +1 -1
  477. package/dist/bin/hook-chunks/{codex-skill-NUBNPSMF.mjs → codex-skill-UZZCACMB.mjs} +1 -1
  478. package/dist/bin/hook-chunks/{command-installer-UHSXC3UG.mjs → command-installer-FJ73C2ZW.mjs} +1 -1
  479. package/dist/bin/hook-chunks/{config-manager-DX5OOPW5.mjs → config-manager-XDKOTIJM.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{context7-service-GDJ3QICX.mjs → context7-service-NH4BMGSJ.mjs} +1 -1
  481. package/dist/bin/hook-chunks/{custom-workflow-storage-FD47DPA3.mjs → custom-workflow-storage-VBMWLKA7.mjs} +1 -1
  482. package/dist/bin/hook-chunks/cwd-changed-STP3LH6Y.mjs +8 -0
  483. package/dist/bin/hook-chunks/{database-ZUC7OEZG.mjs → database-ZCP76LMM.mjs} +1 -1
  484. package/dist/bin/hook-chunks/{detect-changes-OJUBWWTU.mjs → detect-changes-5W6EGEZG.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{developer-evolution-WNSTHDAA.mjs → developer-evolution-UTY3CWOK.mjs} +1 -1
  486. package/dist/bin/hook-chunks/{distill-GOGPFQFK.mjs → distill-63BHUJAC.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{enriched-recall-QF22RIK7.mjs → enriched-recall-6F6LBYAB.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{format-J3X3R225.mjs → format-VJ2YQ4XQ.mjs} +1 -1
  489. package/dist/bin/hook-chunks/{judgment-ledger-storage-FE4HXTHM.mjs → judgment-ledger-storage-7Q7AEEY6.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{judgment-orchestrator-YDJTKNV2.mjs → judgment-orchestrator-AAON4ZJ4.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{judgment-receipt-7A2DXVJA.mjs → judgment-receipt-LSJCAYBT.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{land-cue-SZWJH6XP.mjs → land-cue-DEO2AZW4.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{land-synthesis-JLYUBKHR.mjs → land-synthesis-GTMFIGDM.mjs} +1 -1
  494. package/dist/bin/hook-chunks/{legacy-crew-sweep-JXYO62UE.mjs → legacy-crew-sweep-QPKU7ITU.mjs} +2 -2
  495. package/dist/bin/hook-chunks/{memory-index-CIYDXN2G.mjs → memory-index-KCMXQGKX.mjs} +1 -1
  496. package/dist/bin/hook-chunks/{notification-UA7RTVHG.mjs → notification-DX6ZHOUC.mjs} +1 -1
  497. package/dist/bin/hook-chunks/{pack-integrity-GZC5NGFN.mjs → pack-integrity-UMLIB5RQ.mjs} +1 -1
  498. package/dist/bin/hook-chunks/{pack-manager-AF5F7PRT.mjs → pack-manager-YXRK2TJ4.mjs} +1 -1
  499. package/dist/bin/hook-chunks/{planning-M3RAOZVB.mjs → planning-JR7O5MYW.mjs} +2 -2
  500. package/dist/bin/hook-chunks/{post-edit-QRDYPZLZ.mjs → post-edit-IPTVSRVG.mjs} +1 -1
  501. package/dist/bin/hook-chunks/{pre-bash-TWWFVNQ7.mjs → pre-bash-5WWTH36N.mjs} +1 -1
  502. package/dist/bin/hook-chunks/{pre-commit-PTFF7JIN.mjs → pre-commit-KZ5TNTPW.mjs} +1 -1
  503. package/dist/bin/hook-chunks/pre-edit-XHPYBXRU.mjs +11 -0
  504. package/dist/bin/hook-chunks/{pre-package-325ALZKD.mjs → pre-package-U3HDW3SX.mjs} +1 -1
  505. package/dist/bin/hook-chunks/{pre-search-GOHVFAFH.mjs → pre-search-R5CRK66E.mjs} +1 -1
  506. package/dist/bin/hook-chunks/{pre-secrets-MYNM5KI4.mjs → pre-secrets-MWPPZPWK.mjs} +1 -1
  507. package/dist/bin/hook-chunks/{prjct-md-RCB6FWD6.mjs → prjct-md-IBQTJBK7.mjs} +1 -1
  508. package/dist/bin/hook-chunks/{project-agent-surfaces-V4P5RTUR.mjs → project-agent-surfaces-TPZO73ZV.mjs} +1 -1
  509. package/dist/bin/hook-chunks/{project-file-inventory-OKIP4LBO.mjs → project-file-inventory-HHURZTMH.mjs} +1 -1
  510. package/dist/bin/hook-chunks/project-memory-YQLZX5RG.mjs +8 -0
  511. package/dist/bin/hook-chunks/{project-style-evolution-RPGATIYJ.mjs → project-style-evolution-NOFCIIZZ.mjs} +1 -1
  512. package/dist/bin/hook-chunks/prompt-DJWONMTZ.mjs +24 -0
  513. package/dist/bin/hook-chunks/{publish-helper-SX7HEV2L.mjs → publish-helper-ZSL27HSX.mjs} +1 -1
  514. package/dist/bin/hook-chunks/{purge-XKHUAB4H.mjs → purge-5W3K2MZL.mjs} +1 -1
  515. package/dist/bin/hook-chunks/retention-GWJ4AX7I.mjs +8 -0
  516. package/dist/bin/hook-chunks/{sdd-6PF7MBAY.mjs → sdd-GWBRD4KI.mjs} +1 -1
  517. package/dist/bin/hook-chunks/{session-continuity-UEXQDGZE.mjs → session-continuity-VH645RGR.mjs} +1 -1
  518. package/dist/bin/hook-chunks/session-start-4TYTI27B.mjs +8 -0
  519. package/dist/bin/hook-chunks/settings-installer-CQKMGMRG.mjs +9 -0
  520. package/dist/bin/hook-chunks/{setup-ZOHG6MGF.mjs → setup-VF4UHUBX.mjs} +3 -3
  521. package/dist/bin/hook-chunks/{shipping-QVGTOO6U.mjs → shipping-2ULWBGRX.mjs} +4 -4
  522. package/dist/bin/hook-chunks/{skill-index-FGDQVYHM.mjs → skill-index-55I3HLAI.mjs} +1 -1
  523. package/dist/bin/hook-chunks/{spec-context-inference-6Z52BT37.mjs → spec-context-inference-HVENYOIO.mjs} +1 -1
  524. package/dist/bin/hook-chunks/{spec-service-UAQ5AEXQ.mjs → spec-service-4XGQQPGP.mjs} +2 -2
  525. package/dist/bin/hook-chunks/{spec-task-breakdown-LAXGVLMY.mjs → spec-task-breakdown-JXF556UH.mjs} +1 -1
  526. package/dist/bin/hook-chunks/{state-storage-XU35ZYNA.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  527. package/dist/bin/hook-chunks/stop-NJDYIIXR.mjs +16 -0
  528. package/dist/bin/hook-chunks/subagent-start-2YMGD4SY.mjs +8 -0
  529. package/dist/bin/hook-chunks/{subagent-stop-OUG4PR7S.mjs → subagent-stop-4TZJ2NSJ.mjs} +1 -1
  530. package/dist/bin/hook-chunks/{surface-attribution-A6GCGRFM.mjs → surface-attribution-UNK4J5W2.mjs} +1 -1
  531. package/dist/bin/hook-chunks/{symbol-graph-DMPBNBX7.mjs → symbol-graph-MH42JSPX.mjs} +1 -1
  532. package/dist/bin/hook-chunks/{sync-cursor-storage-VVLA3L2U.mjs → sync-cursor-storage-ZB7FGT6D.mjs} +1 -1
  533. package/dist/bin/hook-chunks/{task-orchestration-HFZYWYLR.mjs → task-orchestration-7NGRIISS.mjs} +1 -1
  534. package/dist/bin/hook-chunks/{task-overview-PCUZWL5Q.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  535. package/dist/bin/hook-chunks/task-service-SPUES5DO.mjs +8 -0
  536. package/dist/bin/hook-chunks/{tdd-QZL4OSM7.mjs → tdd-MYF7I5FS.mjs} +1 -1
  537. package/dist/bin/hook-chunks/{template-loader-SKXILJLJ.mjs → template-loader-4SYVR2UB.mjs} +1 -1
  538. package/dist/bin/hook-chunks/{usefulness-SZLG6LVC.mjs → usefulness-TBD5EYAL.mjs} +1 -1
  539. package/dist/bin/hook-chunks/{vault-retire-notice-HOXPURNQ.mjs → vault-retire-notice-7XHVNHU6.mjs} +1 -1
  540. package/dist/bin/hook-chunks/{velocity-storage-5J6BAMCW.mjs → velocity-storage-IOCVK2LU.mjs} +1 -1
  541. package/dist/bin/hook-chunks/{weak-model-mode-ZRNKFTFF.mjs → weak-model-mode-TYJJT6JJ.mjs} +1 -1
  542. package/dist/bin/hook-chunks/{work-graph-PGYHFLEL.mjs → work-graph-AVAOKY63.mjs} +1 -1
  543. package/dist/bin/hook-chunks/{work-scope-FIB6LBKE.mjs → work-scope-A6XPENFE.mjs} +1 -1
  544. package/dist/bin/hook-chunks/{workspace-occupancy-3D4OKQRB.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  545. package/dist/bin/hook-fast-darwin-arm64 +0 -0
  546. package/dist/bin/hook-fast-darwin-x64 +0 -0
  547. package/dist/bin/hook-fast-linux-x64 +0 -0
  548. package/dist/bin/prjct-core.mjs +9 -3311
  549. package/dist/bin/prjct-hooks.mjs +3 -3
  550. package/dist/bin/prjct.mjs +27 -8
  551. package/dist/daemon/entry.mjs +621 -606
  552. package/dist/mcp/server.mjs +317 -302
  553. package/package.json +5 -6
  554. package/scripts/install.sh +28 -496
  555. package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +0 -11
  556. package/dist/bin/hook-chunks/chunk-BU22R6JX.mjs +0 -9
  557. package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +0 -36
  558. package/dist/bin/hook-chunks/chunk-EWOK4VE7.mjs +0 -11
  559. package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +0 -69
  560. package/dist/bin/hook-chunks/chunk-GDECEHO5.mjs +0 -16
  561. package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +0 -11
  562. package/dist/bin/hook-chunks/chunk-KHLYWNHT.mjs +0 -8
  563. package/dist/bin/hook-chunks/chunk-TRMBRDKH.mjs +0 -8
  564. package/dist/bin/hook-chunks/chunk-TXSLON7M.mjs +0 -19
  565. package/dist/bin/hook-chunks/chunk-V2FR2NPL.mjs +0 -43
  566. package/dist/bin/hook-chunks/chunk-XXRAQZNC.mjs +0 -35
  567. package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +0 -8
  568. package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +0 -11
  569. package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +0 -8
  570. package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +0 -24
  571. package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +0 -8
  572. package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +0 -8
  573. package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +0 -9
  574. package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +0 -16
  575. package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +0 -8
  576. package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +0 -8
@@ -1,36 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{b as jt}from"./chunk-PGWFGRX4.mjs";import{a as St,b as wt,c as kt,d as vt,e as bt}from"./chunk-TXJT3G53.mjs";import{a as ft}from"./chunk-G7QQZMAO.mjs";import{a as Ke}from"./chunk-ROA2AJXY.mjs";import{a as qe}from"./chunk-DVDZA63F.mjs";import{a as Ye}from"./chunk-ZOX6OV6X.mjs";import{a as Qe,b as At}from"./chunk-MHNWIB7B.mjs";import{a as gt,b as ht}from"./chunk-GDESYWTD.mjs";import{d as yt}from"./chunk-UYQC63MC.mjs";import{a as Pt,b as Ct,c as xt,d as Dt}from"./chunk-LNB2GLYI.mjs";import{a as p}from"./chunk-DYHYDHCW.mjs";import{a as ut}from"./chunk-JR542RI2.mjs";import{b as q,c as st,d as nt}from"./chunk-IGHY4FGS.mjs";import{a as at,b as ot,e as it,f as ct,g as ae,h as lt,i as dt}from"./chunk-22AXWLI6.mjs";import{a as mt}from"./chunk-J5UVRZ44.mjs";import{i as pt}from"./chunk-6GAFRIUQ.mjs";import{a as rt}from"./chunk-KHLYWNHT.mjs";import{b as Ze,c as et,d as tt}from"./chunk-DCSKTMDX.mjs";import{b as se}from"./chunk-R4ILCXKE.mjs";import{a as Xe}from"./chunk-S5ISOGDB.mjs";import{a as ne,b as I}from"./chunk-XXRAQZNC.mjs";import{a as Be}from"./chunk-5XA5RL5I.mjs";import{c as Je}from"./chunk-I26F7TLM.mjs";import{b as Ve}from"./chunk-QP5USCDX.mjs";import{a as We,b as Ue}from"./chunk-M5E2YOZ4.mjs";import{b as M}from"./chunk-PO3QDKTE.mjs";import{d as b,e as T,g as B}from"./chunk-UHVYBU7F.mjs";import{d as re}from"./chunk-4KXXDQYI.mjs";import{b as v,h as te,p as He,r as Le,u as Ar,v as J,w as Ge}from"./chunk-A6K4H3YT.mjs";import{b as Ne,f as jr}from"./chunk-HDSS6UB3.mjs";import{d as _e,e as $e,f as Oe,k as N,o as V}from"./chunk-UH4MD3F3.mjs";import{a as Me,p as Dr}from"./chunk-QWQFF2UG.mjs";import{a as ze}from"./chunk-FW4MEPTB.mjs";import{d as w}from"./chunk-PKDYFXMI.mjs";import{a as R,d as Fe,e as k,f as $}from"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";function It(r,e){let t=[];H("Languages",r.languages,e.languages,t),H("Frameworks",r.frameworks,e.frameworks,t),(r.packageManager??"")!==(e.packageManager??"")&&t.push({field:"Package manager",type:"changed",before:r.packageManager??"(none)",after:e.packageManager??"(none)"}),(r.sourceDir??"")!==(e.sourceDir??"")&&t.push({field:"Source directory",type:"changed",before:r.sourceDir??"(none)",after:e.sourceDir??"(none)"}),(r.testDir??"")!==(e.testDir??"")&&t.push({field:"Test directory",type:"changed",before:r.testDir??"(none)",after:e.testDir??"(none)"}),H("Config files",r.configFiles,e.configFiles,t),r.fileCount!==e.fileCount&&t.push({field:"File count",type:"changed",before:String(r.fileCount),after:String(e.fileCount)});let s=r.patterns.map(c=>c.name),a=e.patterns.map(c=>c.name);H("Patterns",s,a,t);let o=r.antiPatterns.map(c=>c.issue),n=e.antiPatterns.map(c=>c.issue);return H("Anti-patterns",o,n,t),ut(t,r.commitHash??null,e.commitHash??null)}i(It,"generateAnalysisDiff");function vs(r){if(!r.hasChanges)return`## Analysis Diff
9
-
10
- No changes between runs.`;let e=[];e.push("## Analysis Diff"),(r.beforeCommit||r.afterCommit)&&e.push(`> \`${r.beforeCommit?.substring(0,7)??"(none)"}\` \u2192 \`${r.afterCommit?.substring(0,7)??"(none)"}\``),e.push(""),e.push("| Change | Field | Detail |"),e.push("|--------|-------|--------|");for(let s of r.items){let a=s.type==="added"?"+":s.type==="removed"?"-":"~",o=s.type==="changed"?`${s.before} \u2192 ${s.after}`:s.after??s.before??"";e.push(`| ${a} | ${s.field} | ${o} |`)}e.push("");let t=[];return r.summary.added>0&&t.push(`${r.summary.added} added`),r.summary.removed>0&&t.push(`${r.summary.removed} removed`),r.summary.changed>0&&t.push(`${r.summary.changed} changed`),e.push(`**Summary**: ${t.join(", ")}`),e.join(`
11
- `)}i(vs,"formatAnalysisDiffMd");function bs(r){if(!r.hasChanges)return"No changes between analysis runs.";let e=[];(r.beforeCommit||r.afterCommit)&&(e.push(` ${r.beforeCommit?.substring(0,7)??"(none)"} \u2192 ${r.afterCommit?.substring(0,7)??"(none)"}`),e.push(""));for(let t of r.items)t.type==="added"?e.push(` + ${t.field}: ${t.after}`):t.type==="removed"?e.push(` - ${t.field}: ${t.before}`):e.push(` ~ ${t.field}: ${t.before} \u2192 ${t.after}`);return e.join(`
12
- `)}i(bs,"formatAnalysisDiffText");function H(r,e,t,s){let a=new Set(e),o=new Set(t);for(let n of t)a.has(n)||s.push({field:r,type:"added",after:n});for(let n of e)o.has(n)||s.push({field:r,type:"removed",before:n})}i(H,"diffStringArray");$();V();import oe from"node:fs/promises";import E from"node:path";import{z as f}from"zod";function K(r,e){let t=r.filter(a=>!a.passed).length,s=r.filter(a=>a.passed).length;return{passed:t===0,checks:r,totalMs:Date.now()-e,failedCount:t,passedCount:s}}i(K,"summarizeChecks");jr();var Ir=f.enum(["draft","verified","sealed"]),Et=f.object({severity:f.enum(["low","medium","high"]).optional(),language:f.string().optional(),framework:f.string().optional(),source:f.enum(["baseline","repo","context7","feedback"]).optional(),confidence:f.number().min(0).max(1).optional()}),Er=f.object({name:f.string(),description:f.string(),location:f.string().optional()}).extend(Et.shape),Rr=f.object({issue:f.string(),file:f.string(),suggestion:f.string()}).extend(Et.shape),ie=f.object({projectId:f.string(),languages:f.array(f.string()),frameworks:f.array(f.string()),packageManager:f.string().optional(),sourceDir:f.string().optional(),testDir:f.string().optional(),configFiles:f.array(f.string()),fileCount:f.number(),patterns:f.array(Er),antiPatterns:f.array(Rr),analyzedAt:f.string(),modelMetadata:Ne.optional(),status:Ir.default("draft"),commitHash:f.string().optional(),signature:f.string().optional(),sealedAt:f.string().optional(),verifiedAt:f.string().optional()});var Tr={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 Mr(r,e){let t=Date.now();if(r.frameworks.length===0)return{name:"Framework verification",passed:!0,output:"No frameworks declared (skipped)",durationMs:Date.now()-t};try{let s=E.join(e,"package.json"),a=await oe.readFile(s,"utf-8"),o=JSON.parse(a),n={...o.dependencies,...o.devDependencies},c=[],l=[];for(let d of r.frameworks){let m=d.toLowerCase();Object.keys(n).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()-t}:{name:"Framework verification",passed:!1,error:`Frameworks not found in dependencies: ${c.join(", ")}`,durationMs:Date.now()-t}}catch(s){return R(s)?{name:"Framework verification",passed:!1,error:"package.json not found (cannot verify frameworks)",durationMs:Date.now()-t}:{name:"Framework verification",passed:!1,error:`Failed to read package.json: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-t}}}i(Mr,"verifyFrameworks");async function Fr(r,e){let t=Date.now();if(r.languages.length===0)return{name:"Language verification",passed:!0,output:"No languages declared (skipped)",durationMs:Date.now()-t};try{let s=await Nr(e),a=new Set(s),o=[],n=[];for(let c of r.languages){let l=Tr[c];if(!l)continue;l.some(m=>a.has(m))?o.push(c):n.push(c)}return n.length===0?{name:"Language verification",passed:!0,output:`${o.length} language(s) verified with matching files`,durationMs:Date.now()-t}:{name:"Language verification",passed:!1,error:`Languages without matching files: ${n.join(", ")}`,durationMs:Date.now()-t}}catch(s){return{name:"Language verification",passed:!1,error:`Failed to scan project files: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-t}}}i(Fr,"verifyLanguages");async function _r(r,e){let t=Date.now(),s=r.patterns.filter(n=>n.location);if(s.length===0)return{name:"Pattern location verification",passed:!0,output:"No pattern locations specified (skipped)",durationMs:Date.now()-t};let a=[],o=[];for(let n of s){let c=n.location,l=E.join(e,c);await N(l)?o.push(c):a.push(`${n.name} (${c})`)}return a.length===0?{name:"Pattern location verification",passed:!0,output:`${o.length} pattern location(s) verified`,durationMs:Date.now()-t}:{name:"Pattern location verification",passed:!1,error:`Pattern locations not found: ${a.join(", ")}`,durationMs:Date.now()-t}}i(_r,"verifyPatternLocations");async function $r(r,e){let t=Date.now();try{let s=await Hr(e),a=r.fileCount,o=.1,n=Math.abs(s-a),c=a*o;return n<=c?{name:"File count verification",passed:!0,output:`File count accurate (declared: ${a}, actual: ${s})`,durationMs:Date.now()-t}:{name:"File count verification",passed:!1,error:`File count mismatch: declared ${a}, actual ${s} (diff: ${n})`,durationMs:Date.now()-t}}catch(s){return{name:"File count verification",passed:!1,error:`Failed to count files: ${s instanceof Error?s.message:"unknown error"}`,durationMs:Date.now()-t}}}i($r,"verifyFileCount");async function Or(r,e){let t=Date.now();if(r.antiPatterns.length===0)return{name:"Anti-pattern file verification",passed:!0,output:"No anti-patterns declared (skipped)",durationMs:Date.now()-t};let s=[],a=[];for(let o of r.antiPatterns){let n=E.join(e,o.file);await N(n)?a.push(o.file):s.push(`${o.issue} (${o.file})`)}return s.length===0?{name:"Anti-pattern file verification",passed:!0,output:`${a.length} anti-pattern file(s) verified`,durationMs:Date.now()-t}:{name:"Anti-pattern file verification",passed:!1,error:`Anti-pattern files not found: ${s.join(", ")}`,durationMs:Date.now()-t}}i(Or,"verifyAntiPatternFiles");async function Rt(r,e){let t=Date.now(),s=await Promise.all([Mr(r,e),Fr(r,e),_r(r,e),$r(r,e),Or(r,e)]);return K(s,t)}i(Rt,"semanticVerify");async function Nr(r){let e=new Set,t=[/node_modules/,/\.git/,/dist/,/build/,/\.next/,/\.turbo/,/coverage/];async function s(a){try{let o=await oe.readdir(a,{withFileTypes:!0});for(let n of o){let c=E.join(a,n.name),l=E.relative(r,c);if(!t.some(d=>d.test(l))){if(n.isDirectory())await s(c);else if(n.isFile()){let d=E.extname(n.name);d&&e.add(d)}}}}catch{}}return i(s,"scanDir"),await s(r),Array.from(e)}i(Nr,"getProjectExtensions");async function Hr(r){let e=[/node_modules/,/\.git/,/dist/,/build/,/\.next/,/\.turbo/,/coverage/];async function t(s){try{let a=await oe.readdir(s,{withFileTypes:!0});return(await Promise.all(a.map(async n=>{let c=E.join(s,n.name),l=E.relative(r,c);return e.some(d=>d.test(l))?0:n.isDirectory()?t(c):n.isFile()?1:0}))).reduce((n,c)=>n+c,0)}catch{return 0}}return i(t,"scanDir"),t(r)}i(Hr,"countProjectFiles");te();var ce=class extends Be{static{i(this,"AnalysisStorage")}constructor(){super("analysis.json")}getDefault(){return{draft:null,sealed:null,previousSealed:null,lastUpdated:""}}getEventType(e){return`analysis.${e}d`}async saveDraft(e,t){let s={...t,status:"draft"};ie.parse(s),await this.update(e,a=>({...a,draft:s,lastUpdated:v()})),this.publishAnalysis(e,s)}publishAnalysis(e,t){Ve({projectId:e,entityType:"analysis",entityId:e,eventType:"upsert",data:{...t,id:e}})}async seal(e){let t=await this.read(e);if(!t.draft)return{success:!1,error:"No draft analysis to seal. Run `p. sync` first."};if(t.draft.status==="sealed")return{success:!1,error:"Draft is already sealed."};let s=this.computeSignature(t.draft),a=v(),o={...t.draft,status:"sealed",signature:s,sealedAt:a};return ie.parse(o),await this.write(e,{draft:null,sealed:o,previousSealed:t.sealed,lastUpdated:a}),this.publishAnalysis(e,o),{success:!0,signature:s}}async getSealed(e){return(await this.read(e)).sealed}async getDraft(e){return(await this.read(e)).draft}async getActive(e){let t=await this.read(e);return t.sealed??t.draft}async getStatus(e){let t=await this.read(e);return{hasSealed:t.sealed!==null,hasDraft:t.draft!==null,hasPreviousSealed:t.previousSealed!==null,sealedCommit:t.sealed?.commitHash??null,draftCommit:t.draft?.commitHash??null,previousSealedCommit:t.previousSealed?.commitHash??null,sealedAt:t.sealed?.sealedAt??null}}async rollback(e){let t=await this.read(e);if(!t.previousSealed)return{success:!1,error:"No previous sealed version to rollback to."};let s=v();return await this.write(e,{draft:t.sealed,sealed:t.previousSealed,previousSealed:null,lastUpdated:s}),this.publishAnalysis(e,t.previousSealed),{success:!0,restoredSignature:t.previousSealed.signature}}async diff(e){let t=await this.read(e);return!t.sealed||!t.draft?null:It(t.sealed,t.draft)}checkStaleness(e,t){return e?t?e!==t?{isStale:!0,sealedCommit:e,currentCommit:t,message:`Analysis is stale: sealed at ${e}, HEAD is ${t}. Run \`p. sync\` + \`p. seal\` to update.`}:{isStale:!1,sealedCommit:e,currentCommit:t,message:"Analysis is current."}:{isStale:!0,sealedCommit:e,currentCommit:null,message:"Cannot determine current commit. Analysis may be stale."}:{isStale:!1,sealedCommit:null,currentCommit:t,message:"No sealed analysis. Run `p. sync` then `p. seal`."}}async verify(e){let t=await this.read(e);if(!t.sealed)return{valid:!1,message:"No sealed analysis to verify."};if(!t.sealed.signature)return{valid:!1,message:"Sealed analysis has no signature."};let s=this.computeSignature({...t.sealed,signature:void 0,sealedAt:void 0});return s===t.sealed.signature?{valid:!0,message:"Signature verified. Analysis integrity confirmed."}:{valid:!1,message:`Signature mismatch. Expected ${s}, got ${t.sealed.signature}. Analysis may have been modified.`}}async semanticVerify(e,t){let s=await this.read(e),a=s.sealed??s.draft;return a?await Rt(a,t):{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(e){let t={projectId:e.projectId,languages:e.languages,frameworks:e.frameworks,packageManager:e.packageManager,sourceDir:e.sourceDir,testDir:e.testDir,configFiles:e.configFiles,fileCount:e.fileCount,patterns:e.patterns,antiPatterns:e.antiPatterns,analyzedAt:e.analyzedAt,commitHash:e.commitHash};return We(JSON.stringify(t))}},Y=new ce;import hs from"node:fs/promises";import Z from"node:path";Ar();Ge();V();import le from"node:fs/promises";import Tt from"node:path";import{gunzipSync as Lr,gzipSync as Gr}from"node:zlib";Ge();B();var zr="code-graph.json.gz";function Mt(r){return Tt.join(J.getGlobalProjectPath(r),zr)}i(Mt,"artifactPath");async function Wr(r){if(!ae(r))return null;let e=dt(r),t=ot(r),s=lt(r)??{symbolCount:e.length,edgeCount:t.length,fileCount:new Set(e.map(l=>l.file)).size,builtAt:new Date().toISOString()},a={version:1,projectId:r,exportedAt:new Date().toISOString(),meta:s,symbols:e,edges:t},o=Buffer.from(JSON.stringify(a),"utf-8"),n=Gr(o,{level:6}),c=Mt(r);return await le.mkdir(Tt.dirname(c),{recursive:!0}),await le.writeFile(c,n),{path:c,bytes:n.length,symbols:e.length,edges:t.length}}i(Wr,"exportCodeGraphArtifact");async function Ur(r){let e=Mt(r),t=await le.readFile(e).catch(()=>null);if(!t)return{imported:!1,symbols:0,edges:0,reason:"no per-project artifact"};let s=(()=>{try{let o=Lr(t).toString("utf-8");return{payload:JSON.parse(o)}}catch(o){return{error:`corrupt artifact: ${o instanceof Error?o.message:String(o)}`}}})();if("error"in s)return{imported:!1,symbols:0,edges:0,reason:s.error};let a=s.payload;return a.version!==1||!Array.isArray(a.symbols)?{imported:!1,symbols:0,edges:0,reason:"unsupported artifact version"}:a.projectId&&a.projectId!==r?{imported:!1,symbols:0,edges:0,reason:`artifact projectId mismatch (got ${a.projectId}, expected ${r})`}:(at(r,{symbols:a.symbols,edges:a.edges}),T.setDoc(r,"symbol-graph",{...a.meta,builtAt:a.meta.builtAt??a.exportedAt}),{imported:!0,symbols:a.symbols.length,edges:a.edges.length})}i(Ur,"importCodeGraphArtifact");async function Ft(r){if(ae(r))return{bootstrapped:!1,detail:"local index already present"};let e=await Ur(r);return e.imported?{bootstrapped:!0,detail:`imported ${e.symbols} symbols / ${e.edges} edges from per-project cache`}:{bootstrapped:!1,detail:e.reason??"import failed"}}i(Ft,"bootstrapCodeGraphFromArtifact");function _t(r){return r?.cloud?.enabled===!0&&r.cloud.paused!==!0}i(_t,"shouldAutoUploadCodeGraph");async function $t(r,e){try{await Wr(r)}catch{}if(e.uploadToCloud)try{await Vr(r,e.uploadDependencies)}catch{}}i($t,"maybeExportAfterIndex");async function Vr(r,e={}){let t=await import("./code-graph-cloud-GTSLO7CD.mjs"),s=(e.buildSnapshot??t.buildCloudCodeGraphSnapshot)(r);if(!t.isUploadableGraph(s))return{uploaded:!1,reason:"no symbol index or empty graph"};try{let o=await(e.upload??(async(n,c)=>{let{default:l}=await import("./sync-client-PIRHMHXL.mjs");return l.uploadCodeGraph(n,c)}))(r,s);return o.ok?{uploaded:!0,nodes:o.nodes??s.nodes.length,links:o.links??s.links.length}:{uploaded:!1,reason:o.reason??"upload failed or unauthenticated",nodes:s.nodes.length,links:s.links.length}}catch(a){return{uploaded:!1,reason:a instanceof Error?a.message:String(a)}}}i(Vr,"maybeUploadCodeGraphToCloud");import F from"node:fs/promises";import Jr from"node:os";import C from"node:path";var de=[{name:"prjct",description:St,allowedTools:[...wt],body:i(()=>vt(),"body"),reference:i(()=>bt(),"reference"),referenceFile:kt}];function Br(r){let e=r.userInvocable!==!1;return`---
13
- description: "${r.description}"
14
- allowed-tools: [${r.allowedTools.map(t=>`"${t}"`).join(", ")}]
15
- user-invocable: ${e}
16
- ---`}i(Br,"buildFrontmatter");function qr(r){return`${Br(r)}
17
-
18
- ${r.body()}`}i(qr,"buildSkillContent");function Ot(){return process.env.HOME||Jr.homedir()}i(Ot,"homeDir");function Kr(){return C.join(Ot(),".claude","skills")}i(Kr,"claudeSkillsRoot");function Yr(){let r=Ot();return[C.join(r,".codex","skills"),C.join(r,".gemini","skills"),C.join(r,".gemini","antigravity","global_skills"),C.join(r,".agents","skills")]}i(Yr,"compactSkillRoots");function Qr(r){return!!(/^# [^\n]+\n[^\n]*\|\s*\d+\s+files\s*\|/m.test(r)||/## Recent Deliveries/m.test(r)||/## Velocity/m.test(r)&&/pts\/sprint/m.test(r))}i(Qr,"skillBodyHasProjectStamp");var ue=class{static{i(this,"SkillGenerator")}async generateAndInstall(){let e={generated:[],skipped:[]},t=Kr();for(let o of de)try{let n=qr(o);if(Qr(n))throw new Error("refusing to install project-stamped skill body (isolation guard)");let c=C.join(t,o.name),l=C.join(c,"SKILL.md");await F.mkdir(c,{recursive:!0}),await F.writeFile(l,n,"utf-8"),o.reference&&o.referenceFile&&await F.writeFile(C.join(c,o.referenceFile),o.reference(),"utf-8"),e.generated.push({name:o.name,path:l})}catch(n){p.debug(`Failed to generate skill ${o.name}`,{error:w(n)}),e.skipped.push({name:o.name,reason:w(n)})}let s=ze();for(let o of Yr())try{let n=C.join(o,"prjct"),c=C.join(n,"SKILL.md");await F.mkdir(n,{recursive:!0}),await F.writeFile(c,s,"utf-8"),e.generated.push({name:"prjct-compact",path:c})}catch(n){p.debug("Compact skill install skipped",{root:o,error:w(n)})}let a=new Set(de.map(o=>o.name));try{let o=await F.readdir(t,{withFileTypes:!0}).catch(()=>[]);for(let n of o)n.isDirectory()&&n.name.startsWith("prjct-")&&!a.has(n.name)&&await F.rm(C.join(t,n.name),{recursive:!0,force:!0}).catch(()=>{})}catch{}return e.generated.length>0&&p.info("Generated portable multi-host skills",{count:e.generated.length,skills:e.generated.map(o=>o.name)}),e}getDefinitions(){return de}},Nt=new ue;function me(){return{branch:"main",commits:0,contributors:0,hasChanges:!1,stagedFiles:[],modifiedFiles:[],untrackedFiles:[],recentCommits:[],weeklyCommits:0}}i(me,"emptyGitData");function pe(){return{fileCount:0,version:"0.0.0",name:"unknown",ecosystem:"unknown",projectType:"simple",languages:[],frameworks:[]}}i(pe,"emptyStats");function fe(){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"}}i(fe,"emptyCommands");function ge(){return{hasFrontend:!1,hasBackend:!1,hasDatabase:!1,hasDocker:!1,hasTesting:!1,frontendType:null,frameworks:[]}}i(ge,"emptyStack");function Ht(r,e){let t=[...r.added,...r.modified],s=new Set(t),a=new Set,o=q(e);if(o)for(let l of t){let d=o.reverse[l];if(d)for(let m of d)s.has(m)||a.add(m)}let n=Array.from(a),c=[...t,...n];return{directlyChanged:t,affectedByImports:n,deleted:r.deleted,allAffected:c}}i(Ht,"propagateChanges");function Lt(r){let e=new Set;for(let t of r){let s=t.toLowerCase();(s.endsWith(".tsx")||s.endsWith(".jsx")||s.endsWith(".css")||s.endsWith(".scss")||s.endsWith(".vue")||s.endsWith(".svelte")||s.includes("/components/")||s.includes("/pages/")||s.includes("/app/"))&&(e.add("frontend"),e.add("uxui")),(s.includes(".test.")||s.includes(".spec.")||s.includes("__tests__")||s.includes("/test/"))&&e.add("testing"),(s.includes("dockerfile")||s.includes("docker-compose")||s.includes(".dockerignore")||s.includes(".github/")||s.includes("ci/")||s.includes("cd/"))&&e.add("devops"),(s.endsWith(".sql")||s.includes("prisma")||s.includes("drizzle")||s.includes("migration")||s.includes("/db/"))&&e.add("database"),(s.endsWith(".ts")||s.endsWith(".js"))&&!s.includes(".test.")&&!s.includes(".spec.")&&!s.endsWith(".d.ts")&&e.add("backend")}return e}i(Lt,"affectedDomains");B();V();import Gt from"node:fs/promises";import Xr from"node:path";function Zr(r){return typeof Bun<"u"&&Bun.hash?`xxh64:${Bun.hash(r).toString(36)}`:`fnv1a:${([...r].reduce((t,s)=>Math.imul(t^s.charCodeAt(0),16777619),2166136261)>>>0).toString(36)}`}i(Zr,"hashContent");async function es(r,e={}){let t=await _e(r,{skipDotfiles:!0,dotfileAllowlist:[".env.example"]}),s=new Map,a=e.changedFilesHint?.length?new Set(e.changedFilesHint):null,o=await $e(t,100,async n=>{try{let c=Xr.join(r,n),l=await Gt.stat(c),d=l.mtime.toISOString(),m=e.storedHashes?.get(n),h=a?.has(n)??!1;if(m&&!h&&m.size===l.size&&m.mtime===d&&m.hash)return{path:n,hash:m.hash,size:l.size,mtime:d};let y=await Gt.readFile(c,"utf-8");return{path:n,hash:Zr(y),size:l.size,mtime:d}}catch{return null}});for(let n of o)s.set(n.path,n);return s}i(es,"computeHashes");function ts(r,e){let t=[],s=[],a=[];for(let[n,c]of r){let l=e.get(n);l?l.hash!==c.hash?s.push(n):a.push(n):t.push(n)}let o=[];for(let n of e.keys())r.has(n)||o.push(n);return{added:t,modified:s,deleted:o,unchanged:a}}i(ts,"diffHashes");function he(r,e){let t=T.getDb(r);t.transaction(()=>{t.prepare("DELETE FROM index_checksums").run();let s=t.prepare("INSERT INTO index_checksums (path, checksum, size, mtime) VALUES (?, ?, ?, ?)");for(let[,a]of e)s.run(a.path,a.hash,a.size,a.mtime)})(),T.setDoc(r,"file-hashes-meta",{fileCount:e.size,builtAt:new Date().toISOString()})}i(he,"saveHashes");function rs(r){let e=new Map;try{let t=T.query(r,"SELECT path, checksum, size, mtime FROM index_checksums");for(let s of t)e.set(s.path,{path:s.path,hash:s.checksum,size:s.size||0,mtime:s.mtime||""})}catch{}return e}i(rs,"loadHashes");async function ye(r,e,t){let s=rs(e),a=await es(r,{storedHashes:s,changedFilesHint:t});return{diff:ts(a,s),currentHashes:a}}i(ye,"detectChanges");function zt(r){return T.hasDoc(r,"file-hashes-meta")}i(zt,"hasHashRegistry");$();var ss=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs"]);async function Wt(r){let{projectId:e,projectPath:t,isFullSync:s,changedFilesHint:a}=r,o={shouldRebuildIndexes:!0,changedDomains:new Set,incrementalInfo:void 0,changedSourceFiles:[],deletedSourceFiles:[]};if(!s&&zt(e)){try{let{diff:n,currentHashes:c}=await ye(t,e,a),l=n.added.length+n.modified.length+n.deleted.length,d=(()=>{if(l===0&&!a?.length)return{shouldRebuildIndexes:!1,changedDomains:new Set,incrementalInfo:{isIncremental:!0,filesChanged:0,filesUnchanged:n.unchanged.length,indexesRebuilt:!1,affectedDomains:[]},changedSourceFiles:[],deletedSourceFiles:[]};let m=Ht(n,e),h=Lt(m.allAffected),y=m.allAffected.some(Se);return{shouldRebuildIndexes:y,changedDomains:h,incrementalInfo:{isIncremental:!0,filesChanged:l,filesUnchanged:n.unchanged.length,indexesRebuilt:y,affectedDomains:Array.from(h)},changedSourceFiles:[...n.added,...n.modified].filter(Se),deletedSourceFiles:n.deleted.filter(Se)}})();return he(e,c),d}catch(n){p.debug("Incremental detection failed, falling back to full sync",{error:k(n)})}return o}try{let{currentHashes:n}=await ye(t,e,a);he(e,n)}catch(n){p.debug("Hash computation failed (non-critical)",{error:k(n)})}return o}i(Wt,"detectIncrementalChanges");function Se(r){let e=r.substring(r.lastIndexOf("."));return ss.has(e)}i(Se,"isSourceFile");import{z as D}from"zod";var jn=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()}),Ut={"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 Vt(r,e="default"){let t=Ut[e]||Ut.default;return r/1e3*t}i(Vt,"estimateCostSaved");function In(r){return r<.01?`$${(r*100).toFixed(2)}\xA2`:`$${r.toFixed(2)}`}i(In,"formatCost");B();var ns=i(r=>({date:r.date,tokensSaved:r.tokens_saved,syncs:r.syncs,avgCompressionRate:r.avg_compression_rate,totalDuration:r.total_duration}),"rowToDaily"),Q=i(r=>{let e=new Date;return e.setDate(e.getDate()-r),e.toISOString().split("T")[0]},"dayCutoff"),we=class{static{i(this,"MetricsStorage")}async recordSync(e,t){let s=Math.max(0,t.originalSize-t.filteredSize),a=t.originalSize>0?s/t.originalSize:0,o=new Date().toISOString().split("T")[0];if(b.run(e,`INSERT INTO metrics_daily (date, tokens_saved, syncs, avg_compression_rate, total_duration)
19
- VALUES (?, ?, 1, ?, ?)
20
- ON CONFLICT(date) DO UPDATE SET
21
- tokens_saved = metrics_daily.tokens_saved + excluded.tokens_saved,
22
- avg_compression_rate =
23
- (metrics_daily.avg_compression_rate * metrics_daily.syncs + excluded.avg_compression_rate)
24
- / (metrics_daily.syncs + 1),
25
- syncs = metrics_daily.syncs + 1,
26
- total_duration = metrics_daily.total_duration + excluded.total_duration`,o,s,a,t.duration),t.agents?.length){let n=Math.floor(s/t.agents.length);for(let c of t.agents)b.run(e,`INSERT INTO metrics_agent_usage (agent_name, usage_count, tokens_saved)
27
- VALUES (?, 1, ?)
28
- ON CONFLICT(agent_name) DO UPDATE SET
29
- usage_count = metrics_agent_usage.usage_count + 1,
30
- tokens_saved = metrics_agent_usage.tokens_saved + excluded.tokens_saved`,c,n)}}async getSummary(e){let t=b.get(e,`SELECT COALESCE(SUM(tokens_saved), 0) AS tokens,
31
- COALESCE(SUM(syncs), 0) AS syncs,
32
- COALESCE(SUM(total_duration), 0) AS duration,
33
- COALESCE(SUM(avg_compression_rate * syncs), 0) AS weighted_rate
34
- FROM metrics_daily`),s=t?.syncs??0,a=t?.tokens??0,o=i((m,h)=>b.get(e,h?"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 >= ?",...h?[m,h]:[m])?.t??0,"rangeTokens"),n=o(Q(30)),c=o(Q(60),Q(30)),l=c>0?(n-c)/c*100:0,d=b.query(e,"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:Vt(a),compressionRate:s>0?(t?.weighted_rate??0)/s:0,syncCount:s,avgSyncDuration:s>0?(t?.duration??0)/s:0,topAgents:d,last30DaysTokens:n,trend:l}}async getDailyStats(e,t=30){return b.query(e,"SELECT * FROM metrics_daily WHERE date >= ? ORDER BY date ASC",Q(t)).map(ns)}async getFirstSyncDate(e){return b.get(e,"SELECT MIN(date) AS d FROM metrics_daily")?.d??""}},Jt=new we;$();te();import as from"node:path";function os(r){return Ue(as.resolve(r))}i(os,"repoHash");function L(r){return r.toLowerCase().replace(/[^a-z0-9]+/g,"")}i(L,"normalizeKey");function is(r){return se(r,e=>`${L(e.name)}::${L(e.source)}`)}i(is,"dedupePatterns");function cs(r){return se(r,e=>`${L(e.issue)}::${L(e.file)}::${L(e.source)}`)}i(cs,"dedupeAntiPatterns");var ke=class{static{i(this,"PatternExtractor")}async extract(e){let t=os(e.projectPath),s=[];if(e.context7Verified)for(let l of e.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=(e.feedback?.patternsDiscovered||[]).map(l=>({name:l,description:`Confirmed during completed tasks: ${l}`,source:"feedback",confidence:.75})),o=(e.feedback?.knownGotchas||[]).map(l=>({issue:l,file:"multiple",suggestion:`Recurring gotcha. Prevent this pattern during implementation: ${l}`,source:"feedback",severity:"medium",confidence:.7})),n=is([...s,...a]),c=cs([...o]);return{patterns:n,antiPatterns:c,repoPathHash:t}}},ls=new ke,Bt=ls;var qt=200;async function Kt(r,e,t){let{bm25Index:s,originalSize:a}=(()=>{try{let d=Ze(r),m=d?Object.values(d.documents).reduce((h,y)=>h+y.length,0):0;return{bm25Index:d,originalSize:m||e.fileCount*qt}}catch(d){return p.debug("Could not load BM25 index for metrics",{error:k(d)}),{bm25Index:null,originalSize:e.fileCount*qt}}})(),o=0,n=a>0?Math.max(0,(a-o)/a):0;try{await Jt.recordSync(r,{originalSize:a,filteredSize:o,duration:t,isWatch:!1})}catch(d){p.debug("Failed to record sync metrics",{error:k(d)})}try{let{velocityStorage:d}=await import("./velocity-storage-5J6BAMCW.mjs");await d.recompute(r)}catch(d){p.debug("Failed to recompute velocity",{error:k(d)})}let c=await import("./developer-evolution-WNSTHDAA.mjs").then(({captureDeveloperSnapshot:d})=>d(r)).catch(d=>(p.debug("Failed to capture dev snapshot",{error:k(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=q(r);m&&(l.importEdges=m.edgeCount,l.importFiles=m.fileCount);let h=gt(r);h&&(l.cochangeCommits=h.commitsAnalyzed,l.cochangeFiles=h.filesAnalyzed)}catch(d){p.debug("Could not load index stats",{error:k(d)})}return{duration:t,originalSize:a,filteredSize:o,compressionRate:n,indexes:l,developerSnapshotCaptured:c}}i(Kt,"recordSyncMetrics");async function Yt(r,e,t,s,a,o){try{let n=t.recentCommits[0]?.hash||null,c=await I.getAggregatedFeedback(r).catch(()=>{});try{let{refreshSkillIndex:d}=await import("./skill-index-FGDQVYHM.mjs");await d(r,e)}catch{}let l=await Bt.extract({projectId:r,projectPath:e,languages:s.languages,frameworks:Array.from(new Set([...s.frameworks,...a.frameworks])),feedback:c,context7Verified:o});await Y.saveDraft(r,{projectId:r,languages:s.languages,frameworks:s.frameworks,configFiles:[],fileCount:s.fileCount,patterns:l.patterns,antiPatterns:l.antiPatterns,analyzedAt:v(),status:"draft",commitHash:n??void 0})}catch(n){p.debug("Failed to save draft analysis (non-critical)",{error:k(n)})}}i(Yt,"saveDraftAnalysis");async function Qt(r){try{let[e,t,s,a,o]=await Promise.all([qe.archiveOldShipped(r).catch(()=>0),Ke.markDormantIdeas(r).catch(()=>0),Ye.removeStaleCompleted(r).catch(()=>0),I.archiveStalePausedTasks(r).catch(()=>[]),Xe.capEntries(r).catch(()=>0)]),n=e+t+s+a.length+o;if(n>0){p.info("Archived stale data",{shipped:e,dormant:t,staleQueue:s,stalePaused:a.length,memoryCapped:o,total:n});let c=Je.getStats(r);p.debug("Archive stats",c)}}catch(e){p.debug("Archival failed (non-critical)",{error:k(e)})}}i(Qt,"archiveStaleData");var us=6e4,ve=class extends Error{static{i(this,"SyncPhaseTimeoutError")}phase;timeoutMs;constructor(e,t){super(`sync phase '${e}' timed out after ${t}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=e,this.timeoutMs=t}};function ms(){return Number(process.env.PRJCT_SYNC_PHASE_TIMEOUT_MS)||us}i(ms,"syncPhaseTimeoutMs");function Xt(r,e){let t=ms(),s=(()=>{let a=Promise.withResolvers(),o=setTimeout(()=>a.reject(new ve(e,t)),t);return{promise:a.promise,cancel:i(()=>clearTimeout(o),"cancel")}})();return Promise.race([r,s.promise]).finally(s.cancel)}i(Xt,"withPhaseTimeout");async function Zt(r,e,t){let s=Date.now();p.debug("sync phase start",{phase:r});try{let a=await e(),o=Date.now()-s;return p.debug("sync phase done",{phase:r,ms:o}),t?.push({phase:r,ms:o}),a}catch(a){let o=Date.now()-s;throw p.debug("sync phase failed",{phase:r,ms:o,error:w(a)}),t?.push({phase:r,ms:o}),a}}i(Zt,"runSyncPhase");function er(r,e={}){let t=e.now??Date.now,s=t(),o=(()=>{try{return r().then(()=>({}),n=>({error:n}))}catch(n){return Promise.resolve({error:n})}})().then(n=>{try{e.onComplete?.({totalMs:t()-s,...n})}catch{}});return{async settle(){await o}}}i(er,"startPostIndexWork");B();import ps from"node:fs/promises";import fs from"node:path";$();te();$();V();import be from"node:fs/promises";import X from"node:path";var Pe=".prjct/.prjct-state.md",Ce=class{static{i(this,"LocalStateGenerator")}async generate(e,t){let s=X.join(e,Pe);await be.mkdir(X.dirname(s),{recursive:!0});let a=this.toMarkdown(t);await be.writeFile(s,a,"utf-8")}async remove(e){try{await be.unlink(X.join(e,Pe))}catch(t){if(!R(t))throw t}}async exists(e){let t=X.join(e,Pe);return N(t)}toMarkdown(e){let t=["<!-- Auto-generated by prjct - DO NOT EDIT -->","<!-- This file provides local state persistence for AI tools -->","","# prjct State",""];if(e.currentTask){let s=e.currentTask;if(t.push("## Current Work Cycle"),t.push(""),t.push(`**${s.description}**`),t.push(""),t.push(`- Started: ${s.startedAt}`),s.linearId&&t.push(`- Linear: ${s.linearId}`),s.branch&&t.push(`- Branch: ${s.branch}`),t.push(`- Status: ${s.status||"active"}`),t.push(""),s.subtasks&&s.subtasks.length>0){t.push("### Subtasks"),t.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**":"";t.push(`${l+1}. ${d} ${c.description}${m}`)}),t.push("");let a=s.subtasks.filter(c=>c.status==="completed").length,o=s.subtasks.length,n=Math.round(a/o*100);t.push(`**Progress**: ${a}/${o} (${n}%)`),t.push("")}}else t.push("*No active work cycle*"),t.push(""),t.push('Start work with `p. work "intent"`'),t.push("");if(e.previousTask){let s=e.previousTask;t.push("---"),t.push(""),t.push("## Previous Work Cycle"),t.push(""),t.push(`**${s.description}**`),t.push(""),t.push(`- Status: ${s.status}`),s.prUrl&&t.push(`- PR: ${s.prUrl}`),t.push("")}return t.push("---"),t.push(`*Last updated: ${e.lastUpdated||new Date().toISOString()}*`),t.push(""),t.join(`
35
- `)}},tr=new Ce;var gs=["storage","context","memory","analysis","config","sync"];async function rr(r){try{await Promise.all(gs.map(e=>ps.mkdir(fs.join(r,e),{recursive:!0})))}catch(e){throw new Error(Fe(e,r,"project directories"))}}i(rr,"ensureProjectDirectories");async function sr(r){let{projectId:e,projectPath:t,cliVersion:s,git:a,stats:o}=r,n=b.getDoc(e,"project")||{},c={...n,projectId:e,repoPath:t,name:o.name,version:o.version,cliVersion:s,techStack:o.frameworks,fileCount:o.fileCount,commitCount:a.commits,stack:o.ecosystem,currentBranch:a.branch,hasUncommittedChanges:a.hasChanges,createdAt:n.createdAt||v(),lastSync:v(),lastSyncCommit:a.recentCommits[0]?.hash||null,lastSyncBranch:a.branch};b.setDoc(e,"project",c)}i(sr,"updateProjectDoc");async function nr(r){let{projectId:e,projectPath:t,stats:s,stack:a}=r,n={...await I.read(e)};n.projectId=e,n.stack={language:s.languages[0]||"Unknown",framework:s.frameworks[0]||null},n.domains={hasFrontend:a.hasFrontend,hasBackend:a.hasBackend,hasDatabase:a.hasDatabase,hasTesting:a.hasTesting,hasDocker:a.hasDocker},n.projectType=s.projectType,n.metrics={totalFiles:s.fileCount},n.lastSync=v(),n.lastUpdated=v(),n.context={...n.context||{},lastSession:v(),lastAction:"Synced project",nextAction:'Run `p. work "intent"` to start a work cycle'},await I.write(e,n);try{await tr.remove(t)}catch(c){p.debug("Legacy local state cleanup failed (optional)",{error:k(c)})}}i(nr,"updateStateDoc");function ar(r,e,t){b.appendEvent(r,"sync",{branch:e.branch,uncommitted:e.hasChanges,fileCount:t.fileCount,commitCount:e.commits})}i(ar,"logSyncEvent");import or from"node:fs/promises";import xe from"node:path";$();Dr();var ir={async jsonFilesValid(r){let e=Date.now(),t=[],s=xe.basename(r);try{await I.read(s)}catch(a){R(a)||t.push(`state: ${k(a)}`)}return{name:"State data valid",passed:t.length===0,output:t.length===0?"1 store validated":void 0,error:t.length>0?t.join("; "):void 0,durationMs:Date.now()-e}},async noSensitiveData(r){let e=Date.now(),t=xe.join(r,"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 o=await or.readdir(t);for(let n of o){if(!n.endsWith(".md"))continue;let c=await or.readFile(xe.join(t,n),"utf-8");for(let l of s)if(l.test(c)){a.push(`${n}: potential sensitive data detected`);break}}}catch(o){if(!R(o))return{name:"No sensitive data",passed:!1,error:`Could not scan: ${k(o)}`,durationMs:Date.now()-e}}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()-e}}},De=class{static{i(this,"SyncVerifier")}async verify(e,t,s){let a=Date.now(),o=[],n=s?.failFast??!1,c=[],l=[ir.jsonFilesValid(t),ir.noSensitiveData(t)];for(let m of l){let h=await m;if(o.push(h),!h.passed&&n){c.push(...s?.checks?.filter(y=>y.enabled!==!1).map(y=>y.name)??[]);break}}if((!n||o.every(m=>m.passed))&&s?.checks)for(let m of s.checks){if(m.enabled===!1){c.push(m.name);continue}let h=await this.runCustomCheck(m,e);if(o.push(h),!h.passed&&n){let y=s.checks.slice(s.checks.indexOf(m)+1);c.push(...y.filter(P=>P.enabled!==!1).map(P=>P.name));break}}return{...K(o,a),skippedCount:c.length}}async runCustomCheck(e,t){let s=Date.now(),a=e.command||(e.script?`sh ${e.script}`:null);if(!a)return{name:e.name,passed:!1,error:"No command or script specified",durationMs:Date.now()-s};try{let{stdout:o,stderr:n}=await Me(a,{cwd:t,timeout:3e4});return{name:e.name,passed:!0,output:(o.trim()||n.trim()).slice(0,200)||void 0,durationMs:Date.now()-s}}catch(o){let n=o;return{name:e.name,passed:!1,error:(n.stderr?.trim()||n.message).slice(0,200),durationMs:Date.now()-s}}}},cr=new De;var je=class{static{i(this,"SyncService")}projectPath;projectId=null;globalPath="";cliVersion="0.0.0";constructor(){this.projectPath=process.cwd()}async sync(e=process.cwd(),t={}){this.projectPath=e;let s=Date.now(),a=[],o=i((l,d)=>Zt(l,d,a),"phase"),n={installed:!1,verified:!1,configPath:"",message:""},c=[];try{if(this.projectId=await M.getProjectId(e),!this.projectId)return{success:!1,projectId:"",cliVersion:"",git:me(),stats:pe(),commands:fe(),stack:ge(),context7:{installed:!1,verified:!1},error:"No prjct project. Run p. init first."};if(this.globalPath=J.getGlobalProjectPath(this.projectId),this.cliVersion=await this.getCliVersion(),await hs.rm(Z.join(this.globalPath,"agents"),{recursive:!0,force:!0}).catch(()=>{}),(await Le()).installed){let u=await yt({autoRepair:!0});u.verified||p.warn(`Codex p. router not ready: ${u.message||"verification failed"}`)}await o("mcp-defaults",()=>ft({silent:!0,verifyContext7:!1}));let m=(await He().catch(()=>null))?.name??"claude";try{Object.assign(n,await o("context7",()=>pt.ensureReady(m)))}catch(u){let g=w(u);p.warn(`Context7 MCP not ready (continuing sync): ${g}`),Object.assign(n,{verified:!1,message:g})}await rr(this.globalPath),process.env.PRJCT_SKIP_CREW_SWEEP!=="1"&&await o("legacy-crew-sweep",async()=>{try{let{legacyCrewSweep:u}=await import("./legacy-crew-sweep-JXYO62UE.mjs"),g=await u(this.projectPath,this.projectId);(g.checkpointsMigrated||g.teamMigrated||g.checkpointsHandEditWarned||g.teamHandEditWarned||g.ghostDirsPurged.length>0||g.agentFilesRepaired.length>0||g.clientPrjctJunkPurged.length>0||g.errors.length>0)&&p.info("Legacy crew sweep ran",{checkpointsMigrated:g.checkpointsMigrated,teamMigrated:g.teamMigrated,checkpointsHandEditWarned:g.checkpointsHandEditWarned,teamHandEditWarned:g.teamHandEditWarned,ghostDirsPurged:g.ghostDirsPurged,agentFilesRepaired:g.agentFilesRepaired,ghostFilesIngested:g.ghostFilesIngested,clientPrjctJunkPurged:g.clientPrjctJunkPurged,errors:g.errors.length})}catch(u){p.debug("Legacy crew sweep failed (non-critical)",{error:w(u)})}});let[y,P,Ee,G]=await o("gather",()=>Xt(Promise.all([Pt(this.projectPath),Ct(this.projectPath),xt(this.projectPath),Dt(this.projectPath)]),"gather")),{shouldRebuildIndexes:ur,changedDomains:ws,incrementalInfo:Re,changedSourceFiles:z,deletedSourceFiles:W}=await o("incremental",()=>Wt({projectId:this.projectId,projectPath:this.projectPath,isFullSync:t.full===!0,changedFilesHint:t.changedFiles}));try{let{refreshFileInventory:u}=await import("./project-file-inventory-OKIP4LBO.mjs");await u(this.projectId,this.projectPath)}catch{}try{await Ft(this.projectId)}catch{}ur&&await o("index",async()=>{try{let u=Re?.isIncremental&&(z.length>0||W.length>0);await Promise.all([u?tt(this.projectPath,this.projectId,z,W):et(this.projectPath,this.projectId),u?nt(this.projectPath,this.projectId,z,W):st(this.projectPath,this.projectId),u?ct(this.projectPath,this.projectId,z,W):it(this.projectPath,this.projectId),ht(this.projectPath,this.projectId)]);let g=this.projectId,S=this.projectPath,O=await M.readConfig(S).catch(()=>null),A=_t(O);c.push(er(()=>$t(g,{uploadToCloud:A}),{onComplete:i(({totalMs:x,error:U})=>{p.debug("sync post-index work settled",{projectId:g,uploadToCloud:A,totalMs:x,...U===void 0?{}:{error:w(U)}})},"onComplete")}))}catch(u){p.debug("File ranking index build failed (non-critical)",{error:w(u)})}});let mr=Date.now();p.debug("sync phase start",{phase:"skills"});let pr=await Nt.generateAndInstall().catch(u=>{p.debug("Native skill generation failed (non-critical)",{error:w(u)})});p.debug("sync phase done",{phase:"skills",ms:Date.now()-mr}),await o("update-files",()=>Promise.all([sr({projectId:this.projectId,projectPath:this.projectPath,cliVersion:this.cliVersion,git:y,stats:P}),nr({projectId:this.projectId,projectPath:this.projectPath,stats:P,stack:G}),Promise.resolve(ar(this.projectId,y,P)),Yt(this.projectId,this.projectPath,y,P,G,n.verified)]));let ee=await Y.getActive(this.projectId),fr={patterns:ee?.patterns?.length||0,antiPatterns:ee?.antiPatterns?.length||0,criticalAntiPatterns:ee?.antiPatterns?.filter(u=>u.severity==="high").length||0},gr=Date.now()-s,Te=await o("metrics",()=>Kt(this.projectId,P,gr)),hr=Te.developerSnapshotCaptured===!0,yr=await(async()=>{try{let{recomputeProjectStyle:u,formatProjectStyleForSync:g}=await import("./project-style-evolution-RPGATIYJ.mjs"),S=await o("project-style",()=>u({projectId:this.projectId,projectPath:this.projectPath,stats:P,stack:G,commands:Ee,commitHash:y.recentCommits[0]?.hash??null,source:"sync-mechanical"})),O=g(S),A=S.snapshot.payload.metrics.styleCoverage;return{summary:S.snapshot.summary,evolutionMd:O.evolutionMd,patternCount:S.snapshot.patternCount,antiPatternCount:S.snapshot.antiPatternCount,conventionCount:S.snapshot.conventionCount,styleCoverage:typeof A=="number"?A:Number(A)||0,isFirst:S.isFirst,hasChanges:S.delta.hasChanges}}catch(u){p.debug("Project style recompute failed (non-critical)",{error:w(u)});return}})(),Sr=await o("work-cost",()=>jt(this.projectId));await o("archive",()=>Qt(this.projectId));let wr=await o("context-quality",()=>rt(this.projectPath,this.projectId)),kr=await o("retention",async()=>{try{let u=await M.readConfig(this.projectPath).catch(()=>null),g=u?.retention?.mode??"apply";if(g==="off")return;let S=g==="dry-run",{applyRetention:O,triageInbox:A}=await import("./retention-C3NQT65W.mjs"),x=O(this.projectId,{dryRun:S,maxArchive:u?.retention?.maxArchive,maxDelete:u?.retention?.maxDelete}),{inboxMerged:U,inboxArchived:br}=S?{inboxMerged:0,inboxArchived:0}:(()=>{let j=A(this.projectId);return{inboxMerged:j.merged,inboxArchived:j.archived}})(),{runVaultPurge:Pr,vaultHealth:Cr}=await import("./purge-XKHUAB4H.mjs"),_=await Pr(this.projectId,{projectPath:this.projectPath,dryRun:S,softDeletedPurgeDays:u?.retention?.softDeletedPurgeDays,archivePruneDays:u?.retention?.archivePruneDays,autoSourceMaxLive:u?.retention?.autoSourceMaxLive}),xr=Cr(this.projectId);return{evaluated:x.evaluated,active:x.active,archive:x.wouldArchive,delete:x.wouldDelete,archived:x.archived,deleted:x.deleted,inboxMerged:U,inboxArchived:br,dryRun:S,samples:x.samples.map(j=>({id:j.id,type:j.type,verdict:j.verdict,score:j.score,reasons:j.reasons,excess:j.excess})),referenceSize:x.referenceSize,vault:{...xr,softDeletedPurged:_.softDeletedPurged,orphanEventsPurged:_.orphanEventsPurged,archivesPruned:_.archivesPruned,autoSourceTrimmed:_.autoSourceTrimmed,distilledDiscarded:_.distilledDiscarded,digestsWritten:_.digestsWritten}}}catch(u){p.debug("retention phase failed",{error:w(u)});return}});await o("install-global",async()=>{await re.installGlobalConfig(),await re.syncCommands()}),await o("install-agent-surfaces",async()=>{let{detectInstalledAgents:u}=await import("./detection-QRVSNMKL.mjs"),g=await u(this.projectPath).catch(()=>[]);await mt(this.projectPath,{refreshIfAdopted:!0,agents:g})});let vr=await o("verify",async()=>{try{let u=await M.readConfig(this.projectPath);return await cr.verify(this.projectPath,this.globalPath,u?.verification)}catch(u){p.debug("Verification failed (non-critical)",{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:g}=await import("./drift-refresh-TD3PYPJN.mjs"),S=process.env.PRJCT_CLI_HOME?Z.resolve(process.env.PRJCT_CLI_HOME):Z.join(u.homedir(),".prjct-cli");g(S)}catch{}return await Promise.all(c.map(u=>u.settle())),{success:!0,projectId:this.projectId,cliVersion:this.cliVersion,git:y,stats:P,commands:Ee,stack:G,context7:{installed:n.installed,verified:n.verified,message:n.message},analysisSummary:fr,contextQuality:wr,retentionDryRun:kr,syncMetrics:Te,workCost:Sr,verification:vr,incremental:Re,projectStyle:yr,developerSnapshotCaptured:hr,generatedSkills:pr,phaseTimings:a}}catch(l){return{success:!1,projectId:this.projectId||"",cliVersion:this.cliVersion,git:me(),stats:pe(),commands:fe(),stack:ge(),context7:{installed:n.installed,verified:n.verified,message:n.message},error:w(l)}}}async getCliVersion(){try{let e=Z.join(__dirname,"..","..","package.json");return(await Oe(e))?.version||"0.0.0"}catch(e){return p.debug("Failed to read CLI version",{error:w(e)}),"0.0.0"}}},co=new je;import Ae from"chalk";var lr={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"},ys={task:"work"};function Ie(r){return ys[r]??r}i(Ie,"publicCommand");var dr={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 fo(r,e={}){if(e.quiet)return;let t=dr[r]||"idle",s=ne.getValidCommands(t);if(s.length===0)return;let a=s.map(o=>({cmd:`p. ${Ie(o)}`,desc:lr[o]||o}));console.log(Ae.dim(`
36
- Next:`));for(let o of a){let n=Ae.cyan(o.cmd.padEnd(12));console.log(Ae.dim(` ${n} \u2192 ${o.desc}`))}}i(fo,"showNextSteps");function go(r,e=!1){let t=dr[r]||"idle";return ne.getValidCommands(t).map(a=>({cmd:e?`prjct ${Ie(a)} --md`:`p. ${Ie(a)}`,desc:lr[a]||a}))}i(go,"getNextSteps");async function Ss(r,e={}){let t=await M.getProjectId(r);return t?{ok:!0,value:t}:(e.md?console.log("> No project ID found. Run `prjct init` first."):Qe.failWithHint("NO_PROJECT_ID"),{ok:!1,result:{success:!1,error:"No project ID found"}})}i(Ss,"requireProjectId");async function Io(r,e={}){let t=await At.ensureInit(r);return t.success?Ss(r,e):{ok:!1,result:t}}i(Io,"requireProject");export{vs as a,bs as b,Y as c,In as d,Jt as e,co as f,fo as g,go as h,Io as i};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{b as l,c as i,d as k}from"./chunk-T6ELTQZM.mjs";import{b as d}from"./chunk-XXRAQZNC.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function u(t,n){let r=t===i?i:t.slice(0,6);return{shortId:r,label:`${r} \xB7 ${n??"(detached)"}`}}o(u,"labelFor");async function b(t,n){let r=await k(n),a=[],p=await d.getTaskSnapshot(t),s=p.currentTask;if(s){let{shortId:e,label:c}=u(i,s.branch);a.push({id:s.id,description:s.description,workspaceId:i,shortId:e,label:c,branch:s.branch,linearId:s.linearId,harness:s.harness,startedAt:s.startedAt,isCurrent:r.workspaceId===i,pipeline:l(t,s.id,i)??void 0})}for(let e of p.activeTasks){if(e.workspaceId===i)continue;let{shortId:c,label:h}=u(e.workspaceId,e.branch);a.push({id:e.id,description:e.description,workspaceId:e.workspaceId,shortId:c,label:h,branch:e.branch,linearId:e.linearId,harness:e.harness,startedAt:e.startedAt,isCurrent:r.workspaceId===e.workspaceId,pipeline:l(t,e.id,e.workspaceId)??void 0})}return a.sort((e,c)=>Number(c.isCurrent)-Number(e.isCurrent)),{current:a.find(e=>e.isCurrent)??null,all:a,mainTaskRaw:s}}o(b,"collectActiveTasks");function T(t){let n=t.isCurrent?"\u2192":" ",r=t.isCurrent?" (this worktree)":"";return`${n} ${t.label} ${t.description}${r}`}o(T,"formatActiveTaskLine");function m(t){if(t.all.length===0)return"No active work cycle.";if(t.all.length===1&&t.current){let r=t.current,a=r.pipeline?`
9
- Pipeline: ${r.pipeline.station}`:"";return`Active: ${r.description}
10
- Workspace: ${r.label}${a}`}let n=[`Active work cycles (${t.all.length})`];for(let r of t.all)n.push(T(r));return n.join(`
11
- `)}o(m,"formatActiveTaskList");export{b as a,T as b,m as c};
@@ -1,69 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as ge}from"./chunk-WGWE3CSC.mjs";import{a as De}from"./chunk-KSSRINDX.mjs";import{a as Ne}from"./chunk-H4CA3XZ6.mjs";import{c as Be}from"./chunk-MHNWIB7B.mjs";import{a as We,c as Ge,d as X}from"./chunk-T6ELTQZM.mjs";import{c as fe}from"./chunk-RHKF7EJW.mjs";import{a as ae}from"./chunk-FEFP6JOL.mjs";import{a as _e,b as Ie}from"./chunk-SJ75V4WG.mjs";import{b as He,c as Me,d as Fe}from"./chunk-C4O243NG.mjs";import{a as Le}from"./chunk-V2FR2NPL.mjs";import{a as D}from"./chunk-S5ISOGDB.mjs";import{c as qe,f as L,h as Oe}from"./chunk-UUULLTQV.mjs";import{b as w}from"./chunk-XXRAQZNC.mjs";import{a as I}from"./chunk-I26F7TLM.mjs";import{b as me}from"./chunk-PO3QDKTE.mjs";import{e as _,g as Ae}from"./chunk-UHVYBU7F.mjs";import{a as je,b as ne,h as pe}from"./chunk-A6K4H3YT.mjs";import{f as de,g as Pe,h as $,j as H,k as Ee,n as Re,o as $e}from"./chunk-UH4MD3F3.mjs";import{a as ue,b as S,e as J,i as re,l as Y,o as Ce,p as se}from"./chunk-QWQFF2UG.mjs";import{e as R,f as wt}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var ie=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 work-cycle replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec","geometry"],booleans:["extend"]},description:"Start or inspect a work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>" [--geometry split|single|direct]'},params:"[intent] [--geometry]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]" [--yes] [--pack code,daily]'},params:"[idea] [--yes]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases","`--yes` skips wizard (CI / 60s quickstart)"]},{name:"quickstart",group:"core",surface:"support",routing:{group:"planning",method:"quickstart"},optionSchema:{strings:["pack"]},description:"One-shot init + packs + agent surfaces (\u224860s install)",usage:{claude:"p. quickstart",terminal:"prjct quickstart [--pack code,daily]"},params:"[--pack]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Non-interactive init --yes","Default packs + AGENTS/CLAUDE routing","Prints three next verbs for the agent"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 work cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate","allowNewDeps","forcePressure","noJudgmentGate"],strings:["intent","geometry"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"close",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"close"},optionSchema:{strings:["reason"]},description:"Resolve/close a memory entry (inbox, signal, trap) so it leaves rotation \u2014 soft-delete + closed tag",usage:{claude:'p. close mem_1234 --reason "fixed in PR"',terminal:'prjct close mem_1234 [--reason "..."] [--md]'},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Soft-removes from recall/FTS/embeddings; records status:closed for audit","Use for resolved inbox/improvement-signals \u2014 prefer over silent forget when the resolution matters"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"code",group:"optional",surface:"support",routing:{group:"code",method:"code"},optionSchema:{},description:"Structural code graph: symbols, trace, impact/risk, architecture (run after sync)",usage:{claude:"p. code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]",terminal:"prjct code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]"},params:"[symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm] [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Symbol index on sync; 4th work-scope signal; CALLS with enclosing + imports","trace / impact (hunk-level) / architecture / dead one-shots","Per-project cache under ~/.prjct-cli/projects/<id>/ (never in client repo)","push-graph: full Function/Class/File + CALLS/IMPORTS graph \u2192 cloud 3D (no node/link caps)","PreToolUse Grep|Glob augment; ship structural risk cue; optional CBM cli"]},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"judgment",group:"optional",surface:"support",routing:{group:"judgment",method:"judgment"},optionSchema:{booleans:["md"]},description:"Precision judgment v2: evidence tax, DNA, RED/BLUE merge, ghosts, next card, ship gate",usage:{claude:"p. judgment [plan|open|add|merge|challenge|next|approve|\u2026]",terminal:"prjct judgment [sub]"},params:"[plan|open|add|merge|challenge|fix-round|fixed|verify|brief|next|ghosts|approve|escalate|status|clear]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["next \u2192 machine directive card (agent loop never re-derives state)","evidence tax + finding DNA + project ghost FP memory","RED/BLUE dual-blind merge; contradiction auto-escalates","code-strict ship hard-gates on ledger.approved before task complete"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents (doctor) or harness surface map (surfaces)",usage:{claude:"p. agents [doctor|surfaces|doctor --fix]",terminal:"prjct agents [doctor|surfaces [--detail]|doctor --fix]"},params:"[doctor|status|list|surfaces] [--fix] [--detail]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","surfaces: benchmark-tier harness map (hooks/MCP/skills wire status)","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Grok"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:'Static continuation brief for another agent. For realtime ownership transfer use `prjct switch <agent> --reason "\u2026"` + `prjct accept`.',usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, Grok, and unknown future agents","For stuck same-branch rescue with ownership transfer: prjct switch / accept (not this alias)"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"Harness intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"perf",group:"optional",surface:"ai-agile",routing:{group:"product",method:"perf"},optionSchema:{numbers:["days"]},description:"Report p50/p95 latency for commands and hooks from local telemetry",usage:{claude:"p. perf [7]",terminal:"prjct perf [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Reads existing command_duration samples from SQLite","Groups hook samples under hook:<subcommand>","Reports p50, p95, average, min, max, and sample count"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): connect/disconnect projects, sync/pull, pause/resume, list, status",usage:{claude:"p. cloud [link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",terminal:"prjct cloud [sub] [--all|--interactive|--yes]"},params:"[link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Local-first: nothing leaves until `prjct connect` / `prjct cloud link`","One project (cwd), one-by-one (--interactive), or all (--all --yes)","Disconnect is soft \u2014 cloud history kept; local vault untouched","Auto-syncs on `prjct ship` and at session end once connected"]},{name:"connect",group:"setup",surface:"support",routing:{group:"cloud",method:"connect"},optionSchema:{},description:"Connect this project to Cloud Sync (alias of `prjct cloud link`)",usage:{claude:"p. connect [--all|--interactive|--yes]",terminal:"prjct connect [--all|--interactive|--yes]"},params:"[--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["cwd: connect one repo after `prjct login`","--all --yes: bulk connect (confirm with human first)","--interactive: one-by-one Y/n (TTY)"]},{name:"disconnect",group:"setup",surface:"support",routing:{group:"cloud",method:"disconnect"},optionSchema:{},description:"Disconnect this project from Cloud Sync (alias of `prjct cloud unlink`)",usage:{claude:"p. disconnect [--all|--yes]",terminal:"prjct disconnect [--all|--yes]"},params:"[--all|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Soft disconnect \u2014 leaves Cloud list; records kept; local vault untouched","Re-connect with `prjct connect`","--all --yes: bulk disconnect after human confirm"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"llm",group:"setup",surface:"support",routing:{group:"llm",method:"llm"},optionSchema:{strings:["name","key","model","baseUrl","wire","provider","authHeader","authScheme"],booleans:["weak","all"]},description:"OPT-IN (default OFF): machine-local LLM brain profiles for a future owned agent loop. Does not change guest mode. enable|disable|set|use|status|test|clear.",usage:{claude:"p. llm status",terminal:"prjct llm <enable|disable|set|use|status|test|clear> [--name <n>] [--key <K>] [--model <M>] [--base-url <U>] [--wire openai-compatible|anthropic] [--weak] [--all]"},params:"[enable|disable|set|use|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Default OFF \u2014 zero impact on guest harnesses until prjct llm enable (or PRJCT_OWNED_LLM=1)","Does not alter embeddings setup gate or existing verbs","Multi-profile brains: Anthropic / OpenAI / xAI / OpenRouter / Ollama / LM Studio","Partial set merges; clear <name> or clear --all (keys wiped, no orphans)","Honest probe + HTTP timeouts","Pairs with prjct agent (print mode) when enabled"]},{name:"agent",group:"setup",surface:"support",routing:{group:"agent",method:"run"},optionSchema:{numbers:["maxSteps"],booleans:["quiet","noWork"]},description:"OPT-IN owned print-mode agent (one-shot). Requires prjct llm enable + brain. Starts a work cycle by default (risks + file map injected). Tools: FS + prjct_search/guard/remember/work. Guest unchanged.",usage:{claude:null,terminal:'prjct agent "<intent>" [--max-steps N] [--no-work] [--quiet] [--md]'},params:'"<intent>"',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blocked unless prjct llm enable (or PRJCT_OWNED_LLM=1) and a brain profile is set","Binds to prjct work cycle (startTask) unless --no-work; attaches if one is already open","Print/one-shot only \u2014 no interactive TUI yet","Tools scoped to project root; secret-like paths denied","Does not replace Claude Code / Grok / Codex guest mode"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"plan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"plan"},optionSchema:{},params:'["title"] | show | write "<md>" | approve | clear',description:"Plan-mode ceremony (read-only until approve): SQLite-backed plan with Context/Approach/Files/Reuse/Verification. Host must not edit source while status is draft.",usage:{claude:'p. plan "Add auth"',terminal:'prjct plan ["title"] | show | write "..." | approve | clear [--md]'},features:["Grok Build plan-mode pattern at the harness layer (no TUI ownership)","draft \u2192 write \u2192 approve; approve persists a decision memory","Single SoT in kv_store work-plan:active"]},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"dream",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"dream"},optionSchema:{booleans:["force","dryRun","md"],numbers:["minHours","minSessions"]},description:"Memory auto-dream: consolidate vault (triage inbox + Rho retention) and rebuild the L0 memory index \u2014 Claude Code KAIROS pattern, deterministic (no model call).",usage:{claude:"p. dream --force",terminal:"prjct dream [--force] [--dry-run] [--min-hours=24] [--min-sessions=5] [--md]"},params:"[--force] [--dry-run]",features:["Gates: \u226524h since last dream AND \u22655 lands (session counter) \u2014 bypass with --force","Phases: orient \u2192 gather \u2192 consolidate (triageInbox + applyRetention) \u2192 prune (L0 index)","Land auto-runs when gates open; dry-run previews without writes"]},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"switch",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"switch"},optionSchema:{booleans:["launch"],strings:["reason"]},params:"<agent>",description:"Yield the active work cycle to another agent runtime (codex/claude/grok/\u2026) with who started + why \u2014 realtime handoff for stuck multi-terminal work.",usage:{claude:'p. switch codex --reason "\u2026"',terminal:'prjct switch <agent> [--reason "\u2026"] [--launch]'}},{name:"accept",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"accept"},optionSchema:{},params:"[hand_id]",description:"Accept a pending multi-agent handoff: rebind ownership of the live cycle and print the resume brief (who/why/task id).",usage:{claude:"p. accept [hand_id]",terminal:"prjct accept [hand_id] [--md]"}},{name:"handoffs",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"handoffs"},optionSchema:{},description:"List pending and recent multi-agent handoffs for this project.",usage:{claude:"p. handoffs",terminal:"prjct handoffs [--md]"}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{booleans:["force","dryRun","md"],strings:["reason"]},description:"Memory surface: export|import (git-shareable), index (L0 TOC), close|forget (lifecycle), dream (auto-consolidation).",usage:{claude:"p. memory index",terminal:"prjct memory export|import|index|close <id>|forget <id>|dream [--force] [--dry-run]"},features:["export/import \u2014 git-shareable JSONL under .prjct/memory-export/","index \u2014 rebuild/show L0 compact memory TOC (SessionStart injects it)","close/forget \u2014 lifecycle aliases of top-level verbs","dream \u2014 auto-consolidation + L0 rebuild"]},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, apply-delta, validate, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["harness","Harness scorecard, instruction observability/disposition, and Body/rig adoption (score \xB7 instructions \xB7 learn-from \xB7 list \xB7 use)"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([t,e,r])=>({name:t,group:"setup",description:e,routing:r,usage:{claude:null,terminal:`prjct ${t}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],yt={"-h":"help","--help":"help","-v":"version","--version":"version"},kt=new Set([...ie.filter(t=>t.routingMode==="bin-only").map(t=>t.name),...Object.entries(yt).filter(([,t])=>ie.some(e=>e.name===t&&e.routingMode==="bin-only")).map(([t])=>t)]);var Ve=new Set(ie.filter(t=>t.routing).map(t=>t.name));Oe();pe();se();Oe();import{execSync as $t}from"node:child_process";import et from"node:fs/promises";import G from"node:path";import T from"chalk";pe();$e();import Ue from"node:path";var St=["CHANGELOG.md","HISTORY.md","NEWS.md","CHANGES.md"],Tt=`# Changelog
9
-
10
- All notable changes to this project will be documented in this file.
11
-
12
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
13
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
14
- `,oe=class{static{o(this,"ChangelogService")}projectPath;constructor(e){this.projectPath=e}async detect(){for(let s of St){let n=Ue.join(this.projectPath,s);if(await Ee(n)){let a=await $(n),i=this.detectFormat(a);return{filePath:n,fileName:s,format:i,created:!1}}}let e="CHANGELOG.md",r=Ue.join(this.projectPath,e);return await H(r,`${Tt}
15
- `),{filePath:r,fileName:e,format:"keepachangelog",created:!0}}async addEntry(e){let r=await this.detect(),s=await $(r.filePath);if(this.hasVersionEntry(s,e.version,r.format))return;let n=e.date||je(new Date),a=r.format==="keepachangelog"?this.insertKeepAChangelogEntry(s,e,n):this.insertMarkdownEntry(s,e,n);await H(r.filePath,a)}hasVersionEntry(e,r,s){let n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(s==="keepachangelog"?new RegExp(`^## \\[${n}\\]`,"m"):new RegExp(`^## ${n}\\b`,"m")).test(e)}async addFeature(e,r){await this.addEntry({version:e,sections:{Added:[r]}})}detectFormat(e){return e.includes("Keep a Changelog")||e.includes("keepachangelog.com")||/^### (?:Added|Changed|Deprecated|Removed|Fixed|Security)\s*$/m.test(e)?"keepachangelog":"markdown"}insertKeepAChangelogEntry(e,r,s){let n=e.split(`
16
- `),a=n.findIndex(c=>/^##\s*\[Unreleased\]\s*$/i.test(c));if(a!==-1){let c=n.slice(a+1).findIndex(x=>/^##\s/.test(x)),p=c===-1?n.length:a+1+c,d=n.slice(a+1,p).join(`
17
- `).trim(),g=this.promoteUnreleasedBody(d,r,s);return`${[...n.slice(0,a),"## [Unreleased]","",g,"",...n.slice(p)].join(`
18
- `).replace(/\n{3,}/g,`
19
-
20
- `).trimEnd()}
21
- `}let i=this.formatKeepAChangelogEntry(r,s),l=e.search(/^## /m);if(l!==-1){let c=e.slice(0,l),p=e.slice(l);return`${c}## [Unreleased]
22
-
23
- ${i}
24
- ${p}`}return`${e.trimEnd()}
25
-
26
- ## [Unreleased]
27
-
28
- ${i}
29
- `}promoteUnreleasedBody(e,r,s){if(!e)return this.formatKeepAChangelogEntry(r,s);let n=`## [${r.version}] - ${s}`,i=(r.sections?.Added??(r.description?[r.description]:[])).filter(p=>!e.includes(p));if(i.length===0)return`${n}
30
-
31
- ${e}`;let l=i.map(p=>`- ${p}`).join(`
32
- `),c=/^###\s+Added\s*$/im.test(e)?e.replace(/^###\s+Added\s*$/im,p=>`${p}
33
- ${l}`):`### Added
34
- ${l}
35
-
36
- ${e}`;return`${n}
37
-
38
- ${c}`}insertMarkdownEntry(e,r,s){let n=this.formatMarkdownEntry(r,s),a=e.indexOf(`
39
- `);if(a!==-1){let i=e.slice(0,a+1),l=e.slice(a+1);return`${i}
40
- ${n}
41
- ${l}`}return`${n}
42
-
43
- ${e}`}formatKeepAChangelogEntry(e,r){let s=[`## [${e.version}] - ${r}`];return s.push(""),e.sections?this.renderSections(s,e.sections):e.description&&(s.push("### Added"),s.push(`- ${e.description}`),s.push("")),s.join(`
44
- `)}renderSections(e,r){for(let[s,n]of Object.entries(r)){e.push(`### ${s}`);for(let a of n)e.push(`- ${a}`);e.push("")}}formatMarkdownEntry(e,r){let s=[`## ${e.version} - ${r}`];return s.push(""),e.sections?this.renderSections(s,e.sections):e.description&&(s.push(`- ${e.description}`),s.push("")),s.join(`
45
- `)}};se();$e();import N from"node:path";var ce=class{static{o(this,"VersionService")}projectPath;constructor(e){this.projectPath=e}async detect(){let e=[()=>this.fromPackageJson(),()=>this.fromCargoToml(),()=>this.fromPyprojectToml(),()=>this.fromCsproj(),()=>this.fromVersionFile("VERSION"),()=>this.fromVersionFile("version.txt"),()=>this.fromGitTag()];for(let r of e){let s=await r();if(s)return s}return this.createFallbackVersion()}async bump(e="patch"){let r=await this.detect();if(r.file){let n=await this.readVersionFromGitHead(r.file,r.format);if(n&&this.isAheadOf(r.current,n))return r.current}let s=jt(r.current,e);return await this.writeVersion({...r,next:s}),s}async readVersionFromGitHead(e,r){let s=N.relative(this.projectPath,e),n=await J(["show",`HEAD:${s}`],{cwd:this.projectPath});if(!n.ok){if(n.kind==="exit")return null;Y(n)}try{let a=n.stdout;if(r==="json")return JSON.parse(a).version??null;if(r==="plaintext"){let i=a.trim();return he(i)?i:null}return r==="toml"?ze(a)??Ke(a):r==="xml"?Je(a):null}catch{return null}}isAheadOf(e,r){let s=e.split(".").map(a=>Number.parseInt(a,10)||0),n=r.split(".").map(a=>Number.parseInt(a,10)||0);for(let a of[0,1,2]){let i=s[a]??0,l=n[a]??0;if(i>l)return!0;if(i<l)return!1}return!1}async fromPackageJson(){let e=N.join(this.projectPath,"package.json"),r=await de(e,null);return r?.version?{current:r.version,next:W(r.version),file:e,format:"json"}:null}async fromCargoToml(){let e=N.join(this.projectPath,"Cargo.toml"),r=await $(e,"");if(!r)return null;let s=ze(r);return s?{current:s,next:W(s),file:e,format:"toml"}:null}async fromPyprojectToml(){let e=N.join(this.projectPath,"pyproject.toml"),r=await $(e,"");if(!r)return null;let s=Ke(r);return s?{current:s,next:W(s),file:e,format:"toml"}:null}async fromCsproj(){let e=await Re(this.projectPath,{extension:".csproj"});if(e.length===0)return null;let r=N.join(this.projectPath,e[0]),s=await $(r,"");if(!s)return null;let n=Je(s);return n?{current:n,next:W(n),file:r,format:"xml"}:null}async fromVersionFile(e){let r=N.join(this.projectPath,e),s=await $(r,"");if(!s)return null;let n=s.trim();return he(n)?{current:n,next:W(n),file:r,format:"plaintext"}:null}async fromGitTag(){let e=await J(["tag","--sort=-v:refname"],{cwd:this.projectPath});if(!e.ok){if(e.kind==="exit")return null;Y(e)}let r=e.stdout.trim().split(`
46
- `);for(let s of r){let n=s.trim().replace(/^v/,"");if(he(n))return{current:n,next:W(n),file:null,format:"git-tag"}}return null}async createFallbackVersion(){let e=N.join(this.projectPath,"VERSION");return await H(e,`0.1.0
47
- `),{current:"0.1.0",next:"0.1.1",file:e,format:"plaintext"}}async writeVersion(e){if(!e.file){e.format==="git-tag"&&await S("git",["tag",`v${e.next}`],{cwd:this.projectPath});return}switch(e.format){case"json":await this.writeJsonVersion(e.file,e.next);break;case"toml":await this.writeTomlVersion(e.file,e.next);break;case"xml":await this.writeXmlVersion(e.file,e.next);break;case"plaintext":await H(e.file,`${e.next}
48
- `);break}}async writeJsonVersion(e,r){let s=await de(e,{});s&&(s.version=r,await Pe(e,s))}async writeTomlVersion(e,r){let s=await $(e,"");if(!s)return;let n=s.replace(/^(\s*version\s*=\s*")([^"]+)(")/m,`$1${r}$3`);await H(e,n)}async writeXmlVersion(e,r){let s=await $(e,"");if(!s)return;let n=s.replace(/(<Version>)([^<]+)(<\/Version>)/,`$1${r}$3`);await H(e,n)}};function he(t){return/^\d+\.\d+\.\d+/.test(t)}o(he,"isSemver");function W(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return t;let[,r,s,n,a]=e;if(a){let i=a.split("."),l=i.length-1;return/^\d+$/.test(i[l])?(i[l]=String(Number(i[l])+1),`${r}.${s}.${n}-${i.join(".")}`):`${r}.${s}.${n}-${a}.1`}return`${r}.${s}.${Number(n)+1}`}o(W,"bumpPatch");function xt(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${e[1]}.${Number(e[2])+1}.0`:t}o(xt,"bumpMinor");function Ct(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${Number(e[1])+1}.0.0`:t}o(Ct,"bumpMajor");function jt(t,e){return e==="major"?Ct(t):e==="minor"?xt(t):W(t)}o(jt,"bumpVersion");function Ye(t){let e=(t??"").toLowerCase().trim();return e?/^[a-z]+(\([^)]*\))?!:/.test(e)||e.includes("breaking change")?"major":/^(fix|chore|docs|refactor|perf|style|test|build|ci|revert)(\([^)]*\))?:/.test(e)?"patch":"minor":"patch"}o(Ye,"inferBumpLevel");function ze(t){let e=t.match(/\[package\]([\s\S]*?)(?=\n\[|\n*$)/);return e?e[1].match(/^\s*version\s*=\s*"([^"]+)"/m)?.[1]??null:null}o(ze,"parseTomlVersion");function Ke(t){let e=t.match(/\[project\]([\s\S]*?)(?=\n\[|\n*$)/);if(e){let s=e[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(s)return s[1]}let r=t.match(/\[tool\.poetry\]([\s\S]*?)(?=\n\[|\n*$)/);if(r){let s=r[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(s)return s[1]}return null}o(Ke,"parsePyprojectVersion");function Je(t){return t.match(/<Version>([^<]+)<\/Version>/)?.[1]?.trim()??null}o(Je,"parseCsprojVersion");Ae();wt();se();Ae();function Xe(t,e,r){try{let s=I();return _.run(t,`INSERT INTO workflow_runs
49
- (id, project_id, command, work_cycle_id, status, iteration, max_iterations, started_at)
50
- VALUES (?, ?, ?, ?, 'running', 0, NULL, ?)`,s,t,e,r??null,Date.now()),s}catch{return null}}o(Xe,"startWorkflowRun");function we(t,e,r,s,n){if(e)try{_.run(t,`INSERT INTO gate_evaluation (id, run_id, rule_id, passed, reason, evaluated_at)
51
- VALUES (?, ?, ?, ?, ?, ?)`,I(),e,String(r),s?1:0,n??null,Date.now())}catch{}}o(we,"recordGateEvaluation");function ye(t,e,r,s,n,a){if(e)try{_.run(t,`INSERT INTO workflow_run_step (id, run_id, rule_id, seq, status, attempt, output, ended_at)
52
- VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,I(),e,String(r),s,n,a??null,Date.now())}catch{}}o(ye,"recordRunStep");function le(t,e,r){if(e)try{_.run(t,"UPDATE workflow_runs SET status = ?, ended_at = ? WHERE id = ?",r,Date.now(),e)}catch{}}o(le,"finishWorkflowRun");function Pt(t){let e=t.split(/\s+/).map(s=>s.trim()).filter(Boolean),r=[];for(let s of e){let n=s.match(/^tags:([a-zA-Z0-9_\-.]+)([=~])(.+)$/);if(n){r.push({kind:"tags",key:n[1],op:n[2],value:n[3]});continue}let a=s.match(/^branch([=~])(.+)$/);if(a){r.push({kind:"branch",op:a[1],value:a[2]});continue}let i=s.match(/^files:(.+)$/);i&&r.push({kind:"files",op:"~",value:i[1]})}return r}o(Pt,"parseWhen");var Qe=new Map;function Et(t){let e=Qe.get(t);if(e)return e;let r=o(a=>{if(a>=t.length)return"";let i=t[a];return i==="*"?t[a+1]==="*"?`.*${r(a+2)}`:`[^/]*${r(a+1)}`:`${/[.+^${}()|[\]\\]/.test(i)?`\\${i}`:i}${r(a+1)}`},"translate"),s=r(0),n=new RegExp(`^${s}$`);return Qe.set(t,n),n}o(Et,"globToRegex");function Rt(t,e){if(t.kind==="tags"){let r=e.tags[t.key??""]??"";return t.op==="="?r===t.value:r.toLowerCase().includes(t.value.toLowerCase())}if(t.kind==="branch")return t.op==="="?e.branch===t.value:e.branch.toLowerCase().includes(t.value.toLowerCase());if(t.kind==="files"){let r=Et(t.value);return e.filesChanged.some(s=>r.test(s))}return!0}o(Rt,"matchCondition");function Ze(t,e){if(!t||!t.trim())return!0;let r=Pt(t);return r.length===0?!0:r.every(s=>Rt(s,e))}o(Ze,"evaluateWhen");var tt="status:",st="script:",nt="mcp:",At="persona:context",rt="version:bump",qt="changelog:add",ve="git:commit",Ot="git:push",Ht="pr:ensure",at="verify:";async function Mt(t,e,r){let s=await w.getCurrentTask(t);if(!s)throw new Error(`Cannot transition to '${r}': no active work cycle`);await D.log(e,L,{taskId:s.id,from:s.type??null,to:r,source:"workflow"})}o(Mt,"runStatusTransition");async function Ft(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-EX65SUYR.mjs"),s=r(t.trustSource,t.description||t.action);if(!s.allow)throw new Error(s.denyMessage);await ue(t.action,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}o(Ft,"runShellAction");async function _t(t){let{test:e}=await Ne(t);return e?.command??null}o(_t,"detectVerifyCommand");async function It(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-EX65SUYR.mjs"),s=r(t.trustSource,t.description||t.action);if(!s.allow)throw new Error(s.denyMessage);let n=t.action.slice(at.length).trim();if(!n)throw new Error(`Empty command in verify action '${t.action}'`);let a=n==="auto"?await _t(e).then(i=>{if(!i)throw new Error("verify:auto found no test script (package.json `scripts.test`). Specify an explicit check, e.g. `verify:bun test` or `verify:npm run typecheck`.");return i}):n;try{await ue(a,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}catch(i){throw new Error(`Verification failed: \`${a}\`
53
- ${R(i)}
54
- Stop-the-line: do not proceed. Fix the failure and re-run this check \u2014 unverified output must not advance.`)}}o(It,"runVerifyAction");async function Lt(t,e,r){let{evaluateWorkflowRuleExecutable:s}=await import("./trust-boundary-EX65SUYR.mjs"),n=s(t.trustSource,t.description||t.action);if(!n.allow)throw new Error(n.denyMessage);let a=t.action.slice(st.length).trim();if(!a)throw new Error(`Empty script path in action '${t.action}'`);if(G.isAbsolute(a)||a.includes("\0"))throw new Error(`Script path escapes workflows dir: ${a}`);let i=G.resolve(e,".prjct/workflows"),l=G.resolve(i,a),c=G.relative(i,l);if(c.startsWith("..")||G.isAbsolute(c))throw new Error(`Script path escapes workflows dir: ${a}`);let p=await et.realpath(l).catch(()=>{throw new Error(`Script not found: .prjct/workflows/${a}`)}),d=await et.realpath(i).catch(()=>i),g=G.relative(d,p);if(g.startsWith("..")||G.isAbsolute(g))throw new Error(`Script path escapes workflows dir: ${a}`);await S("bash",[p],{timeout:t.timeoutMs,cwd:e,env:{...process.env,PRJCT_BRANCH:r.branch,PRJCT_FILES_CHANGED:r.filesChanged.join(","),PRJCT_TAGS:Object.entries(r.tags).map(([y,x])=>`${y}=${x}`).join(",")}})}o(Lt,"runScriptAction");function Dt(t){let e=t.action.slice(nt.length).trim(),r=e.indexOf(":");if(r===-1)return`Call MCP tool ${JSON.stringify(e)} (server unspecified \u2014 re-author rule with format \`mcp:<server>:<tool>[:<args>]\`).`;let s=e.slice(0,r),n=e.slice(r+1),a=n.indexOf(":"),i=a===-1?n:n.slice(0,a),l=a===-1?"":n.slice(a+1),c=t.description?` (${t.description})`:"";return l?`Call MCP \`${s}.${i}\` with args ${l}${c}.`:`Call MCP \`${s}.${i}\`${c}.`}o(Dt,"buildMcpInstruction");async function Nt(t){try{let{default:e}=await import("./config-manager-DX5OOPW5.mjs"),s=(await e.readConfig(t))?.persona;if(!s)return"No persona declared for this project \u2014 `.prjct/prjct.config.json` has no `persona` field.";let n=[`You are **${s.role}** in this project.`];return s.focus&&n.push(`Focus: ${s.focus}.`),s.mcps&&s.mcps.length>0&&n.push(`MCPs available: ${s.mcps.join(", ")}.`),s.packs&&s.packs.length>0&&n.push(`Active packs: ${s.packs.join(", ")}.`),n.join(" ")}catch(e){return`Could not resolve persona: ${R(e)}`}}o(Nt,"buildPersonaInstruction");async function Wt(t,e){let r=new ce(t),s=Ye(typeof e.feature=="string"?e.feature:void 0),n=await r.bump(s);e.version=n}o(Wt,"runVersionBump");async function Gt(t,e){let r=typeof e.version=="string"?e.version:null,s=typeof e.feature=="string"?e.feature:null;if(!r)throw new Error("changelog:add requires a prior version:bump step (no version in runContext)");if(!s)throw new Error("changelog:add requires a feature name in runContext (set by ship before rules run)");await new oe(t).addFeature(r,s)}o(Gt,"runChangelogAdd");function it(t,e){return t.replace(/\$([A-Z_]+)/g,(r,s)=>{let n=s.toLowerCase(),a=e[n];return typeof a=="string"?a:""})}o(it,"expandTemplate");async function Bt(t,e,r){let n=t.slice(ve.length).replace(/^:/,"").trim()||(r.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE"),a=`${it(n,r)}
55
-
56
- Generated with [p/](https://www.prjct.app/)`;await S("git",["add","."],{cwd:e}),await S("git",["commit","-m",a],{cwd:e})}o(Bt,"runGitCommit");function Vt(t,e){let r=t.trim(),s=e.trim(),n=s.includes("/")?s.slice(s.indexOf("/")+1):"";return!!r&&n===r?["push"]:["push","-u","origin","HEAD"]}o(Vt,"decideGitPushArgs");async function Ut(t){let e=await S("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(n=>n.stdout.trim()).catch(()=>""),r=await S("git",["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{cwd:t}).then(n=>n.stdout.trim()).catch(()=>""),s=Vt(e,r);try{await S("git",s,{cwd:t,timeout:3e4})}catch(n){let a=R(n);throw new Error(`git push failed: ${a}`)}}o(Ut,"runGitPush");async function zt(t,e,r){try{let s=await S("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(c=>c.stdout.trim());if(!s||s==="main"||s==="master")return;if(!await S("gh",["--version"],{cwd:t}).then(()=>!0).catch(()=>!1)){r.instructions.push("# prjct: pr:ensure skipped \u2014 `gh` CLI not found. Install it or open the PR manually.");return}let a=await S("gh",["pr","list","--head",s,"--json","number","--jq","length"],{cwd:t}).then(c=>Number(c.stdout.trim())).catch(()=>-1);if(a<0){r.instructions.push("# prjct: pr:ensure could not check for an existing PR (gh not authenticated?) \u2014 skipped.");return}if(a>0)return;let i=it(e.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE",e),l=await S("gh",["pr","create","--fill",...i?["--title",i]:[]],{cwd:t,timeout:3e4}).then(c=>c.stdout.trim());r.instructions.push(`# prjct: opened PR \u2014 ${l}`)}catch(s){r.instructions.push(`# prjct: pr:ensure failed (non-blocking) \u2014 ${R(s)}`)}}o(zt,"runPrEnsure");async function ke(t,e,r,s,n,a){let i=t.action;if(i.startsWith(tt)){let l=i.slice(tt.length).trim();if(!l)throw new Error(`Empty status target in action '${i}'`);await Mt(e,r,l);return}if(i.startsWith(st)){await Lt(t,r,s);return}if(i.startsWith(nt)){n.instructions.push(Dt(t));return}if(i===At){n.instructions.push(await Nt(r));return}if(i===rt||i.startsWith(`${rt}:`)){await Wt(r,a);return}if(i===qt){await Gt(r,a);return}if(i===ve||i.startsWith(`${ve}:`)){await Bt(i,r,a);return}if(i===Ot){await Ut(r);return}if(i===Ht){await zt(r,a,n);return}if(i.startsWith(at)){await It(t,r);return}await Ft(t,r)}o(ke,"runRuleAction");async function Kt(t,e){let[r,s,n]=await Promise.all([Jt(e),Yt(e),Xt(t)]);return{branch:r,filesChanged:s,tags:n}}o(Kt,"buildWhenContext");async function Jt(t){try{return await ae(t)||""}catch{return""}}o(Jt,"resolveBranch");async function Yt(t){let e={cwd:t,encoding:"utf-8"},r=o(async a=>{try{return $t(a,e).split(`
57
- `).map(i=>i.trim()).filter(Boolean)}catch{return[]}},"runDiff"),[s,n]=await Promise.all([r("git diff --cached --name-only"),r("git diff --name-only")]);return[...new Set([...s,...n])]}o(Yt,"resolveChangedFiles");async function Xt(t){try{let e=await w.getCurrentTask(t),r={};if(e?.type&&(r.type=e.type),!e)return r;let s=_.get(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 1",qe);if(s)try{let n=JSON.parse(s.data);if(n.taskId===e.id&&n.tags)return{...r,...n.tags}}catch{}return r}catch{return{}}}o(Xt,"resolveActiveTags");async function be(t,e,r,s={}){let n={success:!0,gatesFailed:[],hooksFailed:[],stepsRun:[],instructions:[],output:""};if(s.skipRules)return n;let a=s.runContext??{},l=De.getRulesForCommand(t,e).filter(u=>u.position===r),c=s.projectPath||process.cwd(),d=l.some(u=>u.whenExpr||u.type==="gate")?await Kt(t,c):{branch:"",filesChanged:[],tags:{}},g=l.filter(u=>Ze(u.whenExpr,d)),y=g.length>0?Xe(t,`${r}:${e}`):null,x=g.filter(u=>u.type==="gate");for(let u of x){let f=u.description||u.action;console.log(`
58
- ${T.dim(`[gate] ${r}-${e}: ${u.action}`)}`);try{let k=Date.now();await ke(u,t,c,d,n,a);let E=Date.now()-k,z=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`gate passed (${z})`)}`),we(t,y,u.id,!0)}catch(k){return console.log(`${T.red("\u2717")} gate failed: ${f}`),n.gatesFailed.push(f),n.success=!1,n.output+=`Gate failed: ${f}
59
- ${R(k)}
60
- `,we(t,y,u.id,!1,R(k)),le(t,y,"blocked"),n}}let B=g.filter(u=>u.type==="instruction");for(let u of B){let f=u.description||u.action;console.log(`
61
- ${T.dim(`[instruction] ${r}-${e}: ${f}`)}`),n.instructions.push(u.action)}let V=g.filter(u=>u.type==="hook"),U=V.filter(u=>u.parallel===!1),C=V.filter(u=>u.parallel!==!1),Z=o(async u=>{console.log(`
62
- ${T.dim(`[hook] ${r}-${e}: ${u.action}`)}`);try{let f=Date.now();await ke(u,t,c,d,n,a);let k=Date.now()-f,E=k>1e3?`${(k/1e3).toFixed(1)}s`:`${k}ms`;console.log(`${T.green("\u2713")} ${T.dim(`(${E})`)}`)}catch(f){console.log(`${T.yellow("\u26A0")} hook failed (non-blocking): ${u.action}`),n.hooksFailed.push(u.description||u.action),n.output+=`Hook failed: ${u.action}
63
- ${R(f)}
64
- `}},"runHook");for(let u of U)await Z(u);C.length>0&&await Promise.all(C.map(Z));let ee=g.filter(u=>u.type==="step");for(let[u,f]of ee.entries()){console.log(`
65
- ${T.dim(`[step] ${e}: ${f.action}`)}`);try{let k=Date.now();await ke(f,t,c,d,n,a);let E=Date.now()-k,z=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`step passed (${z})`)}`),n.stepsRun.push(f.description||f.action),ye(t,y,f.id,u,"ok")}catch(k){return console.log(`${T.red("\u2717")} step failed: ${f.action}`),n.gatesFailed.push(f.description||f.action),n.success=!1,n.output+=`Step failed: ${f.action}
66
- ${R(k)}
67
- `,ye(t,y,f.id,u,"failed",R(k)),le(t,y,"failed"),n}}return le(t,y,"passed"),n}o(be,"executeWorkflowRules");pe();se();var Qt=["cli","command","install","setup","doctor","mcp","codex","claude","statusline","statusbar","output","help"],Zt=new Set(["the","and","for","with","that","this","task","implement","implementa","fix","bug","add","agrega","crear","hacer","esto","debe"]);function Q(t){let e=t.toLowerCase(),r=er(e),s=Qt.some(d=>e.includes(d)),n=A(e,["security","seguridad","auth","permission","secret","migration","sqlite","database","arquitectura","architecture","must","critical","critico","cr\xEDtico"]),a=tr(r,e,n),i=rr(a,n),l=sr(r,a,s),c=nr(a),p=ir(t);return{level:a,kind:r,risk:i,expectedEvidence:l,scopeHints:p,gates:c,rationale:ar(a,r,i),createdAt:ne()}}o(Q,"buildTaskHarness");async function Se(t,e){let r=e.harness;if(!r||r.level==="H0")return{changedFiles:[],observedEvidence:[],warnings:[],diffSize:0};let s=await Promise.all([Ce(t),pr(t)]).then(([p,d])=>({changedFiles:p,diffSize:d,gitUnavailable:null})).catch(p=>{if(p instanceof re)return{changedFiles:[],diffSize:0,gitUnavailable:p};throw p}),{changedFiles:n,diffSize:a,gitUnavailable:i}=s,l=or(n),c=[];return i?(c.push(`git ${i.kind}: change evidence unavailable \u2014 completion checks skipped, not failed.`),{changedFiles:n,observedEvidence:l,warnings:c,diffSize:a}):(r.expectedEvidence.includes("regression-test")&&!l.includes("tests-changed")&&c.push(`${r.level} expects a regression test; no test file changed in the diff.`),r.expectedEvidence.includes("docs-if-public-behavior")&&ur(n)&&!l.includes("docs-changed")&&c.push("Public-facing files changed; no README/docs/changelog file changed."),a>400&&c.push(`Diff is ${a} changed lines; consider splitting or justify the scope.`),{changedFiles:n,observedEvidence:l,warnings:c,diffSize:a})}o(Se,"evaluateHarnessCompletion");function er(t){if(A(t,["security","seguridad","auth","authent","authoriz","permission","secret"]))return"security";if(A(t,["bug","bugs","fix","fixes","fixed","fixing","falla","fallo","error","broken","regression","no se"]))return"bug";let e=A(t,["implement","implementa","refactor","restructure","cleanup","crear","agrega","construir","build"]);return A(t,["research","investiga","investigate","analiza","analyze","analysis","an\xE1lisis","compare","compara","survey","explore","explora","revisa","revisar","review","reviewing","repasa","repasar"])&&!e?"research":A(t,["refactor","cleanup","restructure"])||/(?:^|[^a-z0-9_-])split(?:[^a-z0-9_-]|$)/.test(t)?"refactor":A(t,["doc","docs","document","readme","changelog","typo"])?"docs":A(t,["chore","format","lint","linting","linter"])?"chore":A(t,["add","agrega","crear","implement","implementa","feature","mejora"])?"feature":"unknown"}o(er,"detectKind");function tr(t,e,r){return t==="docs"||t==="chore"?"H0":t==="security"?"H3":t==="research"?"H1":r&&A(e,["migration","sqlite","database","architecture","arquitectura"])?"H3":t==="feature"||t==="refactor"?"H2":"H1"}o(tr,"detectLevel");function rr(t,e){return t==="H3"||e?"high":t==="H2"||t==="H1"?"medium":"low"}o(rr,"detectRisk");function sr(t,e,r){let s=new Set;return t==="bug"&&(s.add("regression-test"),s.add("focused-tests"),s.add("edge-cases")),(t==="feature"||t==="refactor")&&(s.add("focused-tests"),s.add("scope-check")),r&&s.add("docs-if-public-behavior"),(e==="H2"||e==="H3")&&s.add("spec-or-design"),e==="H3"&&s.add("config-preservation"),[...s]}o(sr,"expectedEvidenceFor");function nr(t){return t==="H0"?[]:t==="H1"?["verify-before-done"]:t==="H2"?["verify-before-done","scope-check"]:["spec-before-implementation","verify-before-done","scope-check","review-before-ship"]}o(nr,"gatesFor");function ar(t,e,r){return t==="H0"?`Low-risk ${e}; keep the task direct and low-friction.`:`${t} ${e}/${r}; define expected evidence up front and verify before closure.`}o(ar,"rationaleFor");function ir(t){let e=t.toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").split(/[^a-z0-9_.-]+/u).filter(r=>r.length>=3&&!Zt.has(r));return[...new Set(e)].slice(0,8)}o(ir,"extractScopeHints");function A(t,e){return e.some(r=>{if(r.includes(" "))return t.includes(r);let s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=r.length>=5?`\\b${s}`:`\\b${s}\\b`;return new RegExp(n).test(t)})}o(A,"hasAny");function or(t){let e=new Set;return t.some(cr)&&e.add("tests-changed"),t.some(lr)&&e.add("docs-changed"),[...e]}o(or,"observedEvidenceFromFiles");function cr(t){return/(^|\/)(__tests__|tests?|specs?)\//.test(t)||/\.(test|spec)\.[cm]?[tj]sx?$/.test(t)}o(cr,"isTestFile");function lr(t){return/(^|\/)(README|CHANGELOG|docs\/)/i.test(t)}o(lr,"isDocsFile");function ur(t){return t.some(e=>e.startsWith("core/commands/")||e.startsWith("core/mcp/")||e.startsWith("templates/")||e==="README.md")}o(ur,"touchesPublicSurface");async function pr(t){let e=await J(["diff","--shortstat","HEAD"],{cwd:t});if(!e.ok){if(e.kind==="exit")return 0;Y(e)}let r=Number.parseInt(e.stdout.match(/(\d+) insertions?/)?.[1]??"0",10),s=Number.parseInt(e.stdout.match(/(\d+) deletions?/)?.[1]??"0",10);return r+s}o(pr,"readDiffSize");var dr=[/\btypo\b/i,/\bdocs?\b/i,/\breadme\b/i,/\bformat\b/i,/\bchangelog\b/i,/\brerun\b.*\btests?\b/i,/\bre-?run\b.*\btests?\b/i],mr=[/\badd\b/i,/\bimplement\b/i,/\bcreate\b/i,/\bbuild\b/i,/\bfeature\b/i,/\bbilling\b/i,/\bauth\b/i,/\bsecurity\b/i,/\bmigration\b/i,/\bretry\b/i,/\bfailure\b/i,/\brecovery\b/i,/\baudit\b/i,/\bworkflow\b/i,/\borchestrat/i];function gr(t){let e=t.trim(),r=dr.some(n=>n.test(e)),s=mr.some(n=>n.test(e));return r&&!s?{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"trivial-keyword"}:s?{kind:"substantive",station:"spec_required",requiresSpec:!0,requiresTestsFirst:!0,reason:"substantive-keyword"}:{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"conservative-default"}}o(gr,"classifyTaskPipeline");function ot(t,e){let r=gr(t);return r.kind==="substantive"&&e?{...r,station:"test_red",reason:"linked-spec"}:r}o(ot,"decideTaskPipeline");function ct(t){switch(t.station){case"direct":return"Proceed directly; no spec is required for this trivial task.";case"spec_required":return"Create or link a reviewed spec before implementation; write tests before implementation from the spec acceptance criteria.";case"test_red":return"Write failing tests before implementation, covering the linked spec acceptance criteria and edge cases.";case"implementation":return"Implement the minimum code needed to make the existing tests pass.";case"verify":return"Run verification and keep the task blocked on red tests."}}o(ct,"formatTaskPipelineNextAction");var fr=["active","resume","in_progress","working"],lt=120;function Cs(t){let e=t.type==="decision"||t.type==="gotcha"||t.type==="fact"||t.type==="spec"?"SoT":t.type==="anti-pattern"||t.type==="pattern"||t.type==="learning"?"SUGGEST":"ctx",r=t.when?t.when.slice(0,10):"",s=t.author?` by ${t.author}`:"",n=[r,s].filter(Boolean).join(""),a=`[${e}\xB7${t.type}] ${t.title}${n?` (${n.trim()})`:""} \`${t.id}\``,i=t.decisionTrap??t.antiPattern??t.nextImplication??t.why??t.outcome??t.keyData??t.detail;if(!i)return e==="SoT"?`${a} \u2014 BINDING; supersede via prjct remember if wrong`:a;let l=i.length>lt?`${i.slice(0,lt-1)}\u2026`:i;if(e==="SoT")return`${a} \u2014 tip\u2192user \xB7 SoT: ${l}`;if(e==="SUGGEST"){let c=t.files&&t.files.length>0?` in \`${t.files.slice(0,2).join("`, `")}\``:"";return`${a} \u2014 tip\u2192user \xB7 suggest${c}: ${l}`}return`${a} \u2014 ${l}`}o(Cs,"formatRelatedContextForAgent");function js(t){return`[${t.label}] ${t.title} \u2014 \`${t.file}\` \`${t.id}\``}o(js,"formatRiskForAgent");async function Ps(t,e,r,s={}){let n=r.trim().toLowerCase();if(Ve.has(n))return{ok:!1,blocked:`'${n}' is a prjct command, not a work intent. Did you mean \`prjct ${n}\`? To start a work cycle, describe the task (e.g. \`prjct work "fix the ${n} flow"\`).`};let a=await be(t,"task","before",{projectPath:e,skipRules:s.skipHooks});if(!a.success)return{ok:!1,blocked:a.gatesFailed.length>0?`Blocked: ${a.gatesFailed.join(", ")}`:`Hook failed: ${a.hooksFailed.join(", ")}`};let i=await me.readConfig(e).catch(()=>null);try{let{ensureCodingAnticipationDefaults:h}=await import("./pack-manager-AF5F7PRT.mjs"),m=await h(e);m.healed&&m.reason==="activated-code"?console.log("\u2139 Anticipation ON: activated pack `code` (conflictMode advisory) \u2014 traps surface before edit"):m.healed&&m.reason==="conflictMode-healed"&&console.log("\u2139 Anticipation ON: conflictMode \u2192 advisory for pack code")}catch{}{let{effectiveSddMode:h}=await import("./sdd-6PF7MBAY.mjs"),{discussLockVerdict:m}=await import("./discuss-lock-55GER2LR.mjs"),j=Q(r),b=s.spec?await import("./spec-service-UAQ5AEXQ.mjs").then(({specService:v})=>v.get(e,s.spec)).then(v=>v?.status??null).catch(()=>null):null;if(s.spec&&b===null){let{specService:v}=await import("./spec-service-UAQ5AEXQ.mjs");if(await v.get(e,s.spec).then(F=>!F).catch(()=>!1))return{ok:!1,blocked:`Spec ${s.spec} not found.`}}let q=m({sddMode:h(i),harnessLevel:j.level,hasSpecId:!!s.spec,specStatus:b});if(q.blocked)return{ok:!1,blocked:q.message}}if(s.spec)try{let{effectiveSddMode:h}=await import("./sdd-6PF7MBAY.mjs"),{effectiveTddMode:m}=await import("./tdd-QZL4OSM7.mjs"),{effectiveNyquistWorkMode:j,nyquistWorkVerdict:b}=await import("./nyquist-lite-GE7OAFLC.mjs"),{specService:q}=await import("./spec-service-UAQ5AEXQ.mjs"),v=Q(r),F=(await q.get(e,s.spec))?.content?.acceptance_criteria??[],P=b({harnessLevel:v.level,criteria:F,mode:j(h(i),m(i))});if(P.blocked)return{ok:!1,blocked:P.message??"Nyquist-lite blocked work start."};P.message&&console.log(P.message)}catch{}{let h=i?.deliveryGeometry?.mode??"off";try{let{existsSync:m}=await import("node:fs"),j=await import("node:path"),{computeWorkingTreeChangeset:b,geometryOf:q,tierOf:v,geometryBlockMessage:M,intentGeometryVerdict:F,NORMAL_MAX_LOC:P}=await import("./delivery-geometry-WYOEMKMO.mjs"),O=Q(r),K=m(j.join(e,".git"))?await b(e):null,ft=i?.deliveryGeometry?.locThreshold??P,xe=!!(K&&K.loc>=ft);if(h==="strict"&&xe&&K&&!s.geometry){let ht=q(v(K));return{ok:!1,blocked:M(K,ht)}}let te=F({harnessLevel:O.level,harnessRisk:O.risk,mode:h,explicitGeometry:s.geometry??null,treeLarge:xe});if(te.blocked)return{ok:!1,blocked:te.message??"Delivery geometry required at intent."};te.message&&console.log(te.message)}catch(m){if(m instanceof re&&h==="strict")return{ok:!1,blocked:`Delivery geometry gate unevaluable: ${m.message}. Re-run when git is healthy, or pass \`--geometry\` explicitly.`}}}let l=/^[A-Z]+-\d+$/.test(r)?r:void 0,c=I(),p=s.spec,d=Q(r),g=await(async()=>{try{let h=await me.readConfig(e).catch(()=>null),[{effectiveSddMode:m},{effectiveTddMode:j}]=await Promise.all([import("./sdd-6PF7MBAY.mjs"),import("./tdd-QZL4OSM7.mjs")]),{effectiveWeakModelMode:b}=await import("./weak-model-mode-ZRNKFTFF.mjs");return fe(d,m(h),j(h),b(h),`${r}::${c}`)}catch{return fe(d,"off","off","off",`${r}::${c}`)}})(),{resolveCallerIdentity:y}=await import("./agent-identity-45BYQBU2.mjs"),x=y(r),B=await(async()=>{let h=i?.multiAgent?.autoWorktree??"auto";try{let{getOccupancy:m,shouldIsolate:j,worktreeSlugFromIntent:b}=await import("./workspace-occupancy-3D4OKQRB.mjs"),q=await m(t,e,x),v=j(q,h,r);if(v.block)return{blocked:v.reason};if(v.isolate&&q.isMain){let{worktreeService:M}=await import("./worktree-service-AS7JVBK5.mjs"),F=b(r),P=await M.create(e,F);await M.setup(P.path,await M.getMainWorktree(e));let O=v.occupant;return{effectivePath:P.path,isolation:{reason:v.reason,worktreePath:P.path,branch:P.branch,slug:P.slug,occupantSummary:O?`${[O.ownerAgent,O.ownerIdentity].filter(Boolean).join("/")||"other"} \xB7 ${O.taskId.slice(0,8)} \xB7 "${O.description.slice(0,60)}"`:"foreign cycle"}}}}catch(m){if(m instanceof Error&&m.message.includes("already active"))return{blocked:m.message}}return{effectivePath:e,isolation:void 0}})();if("blocked"in B)return{ok:!1,blocked:B.blocked};let{effectivePath:V,isolation:U}=B,C=await X(V);if(C.gitError)return{ok:!1,blocked:`git ${C.gitError}: workspace identity unknown \u2014 refusing to start work on the main fallback. Re-run when git is healthy.`};let Z=C.isMain?Ge:C.workspaceId,ee={id:c,description:r,sessionId:I(),linearId:l,linkedSpecId:p,harness:d,ownerAgent:x.agent,ownerIdentity:x.identity,ownerSessionId:x.sessionId,yieldStatus:"active"};C.isMain?await w.startTask(t,ee):await w.startTaskInWorkspace(t,{...ee,branch:C.branch??U?.branch,workspaceId:C.workspaceId,worktreePath:C.worktreePath},C.workspaceId);try{let{ensureJudgmentLedger:h,intensityFromQuality:m}=await import("./judgment-orchestrator-YDJTKNV2.mjs");g.quality!=="none"&&await h({projectId:t,projectPath:e,signals:{harnessLevel:d.level,harnessKind:d.kind},forceIntensity:m(g.quality)})}catch{}try{let{prjctDb:h}=await import("./database-ZUC7OEZG.mjs");h.run(t,"UPDATE tasks SET expected_value = ? WHERE id = ?",String(g.expectedPoints),c);let{workGraph:m}=await import("./work-graph-PGYHFLEL.mjs");m.recordComplexity(t,c,{score:g.expectedPoints,recommendedSubtasks:g.expectedPoints>=5?Math.min(g.expectedPoints,6):0,reasoning:`Triage: ${d.level} \xB7 ${g.model}/${g.effort} \xB7 fan-out ${g.fanout}`})}catch{}let u=ot(r,p),f=We(t,{taskId:c,workspaceId:Z,classification:u.kind,station:u.station,requiresSpec:u.requiresSpec,requiresTestsFirst:u.requiresTestsFirst,reason:u.reason,linkedSpecId:p??null});if(p)try{let{specService:h}=await import("./spec-service-UAQ5AEXQ.mjs");await h.linkTask(e,p,c)}catch{}let k=await Be.ensureAuthor();await D.log(e,"task_started",{task:r,taskId:c,harness:d,timestamp:ne()},k.name),await be(t,"task","after",{projectPath:e,skipRules:s.skipHooks});let E=U?.branch??await ae(V).catch(()=>""),z=await yr(e,t,r),Te=await wr(e,t,r),mt=hr(t,Te),gt=await(async()=>{try{let{buildCycleBudgetCard:h}=await import("./cycle-budget-card-O5WAGNGC.mjs"),{contextPressureVerdict:m}=await import("./context-pressure-OUN5PFMN.mjs"),j=m(i,{turnCount:0,tokensIn:0,tokensOut:0}),b=h({turns:0,turnLimit:i?.maxTurnsPerCycle??j.limit,tokensSpent:0,tokenBudget:i?.maxTokensPerCycle??null,pressureLevel:j.level});return console.log(b.line),b.line}catch{return null}})();return{ok:!0,taskId:c,description:r,branch:E,linearId:l,linkedSpecId:p,harness:d,orchestration:g,ownerAgent:x.agent,ownerIdentity:x.identity,isolation:U,pipeline:{classification:f.classification,station:f.station,nextAction:ct(u),requiresSpec:f.requiresSpec,requiresTestsFirst:f.requiresTestsFirst},instructions:a.instructions,relatedContext:z,likelyFiles:Te,risks:mt,cycleBudget:gt}}o(Ps,"startTask");function hr(t,e){let r=new Set,s=[];try{for(let n of e.slice(0,5)){let a=Le.recallForFile(t,n.path,2,{preventiveOnly:!0});for(let i of a)if(!r.has(i.id)&&(r.add(i.id),s.push({id:i.id,label:He(i),title:Fe(i),file:n.path}),s.length>=4))return s}}catch{}return s}o(hr,"recallRisksForFiles");async function wr(t,e,r){try{let{resolveWorkScope:s,toLikelyFileHits:n}=await import("./work-scope-FIB6LBKE.mjs"),a=await s(t,e,r,8);return a.files.length>0?n(a.files):ge(e,r)}catch{try{return ge(e,r)}catch{return[]}}}o(wr,"recallLikelyFiles");async function yr(t,e,r){try{let{enrichedRecall:s}=await import("./enriched-recall-QF22RIK7.mjs"),{deriveTitle:n}=await import("./format-J3X3R225.mjs"),a=await s(t,e,{topic:r,types:["decision","gotcha","fact","spec","anti-pattern","pattern","learning","context"],limit:8});if(a.length===0)return[];let{recordSurfacedForActiveTask:i}=await import("./surface-attribution-A6GCGRFM.mjs");return await i(e,t,a.map(l=>l.id)),a.map(l=>{let c=Ie(l.content),p=c.relatedFiles??l.tags?.related_files?.split(",").filter(Boolean)??l.tags?.files?.split(",").filter(Boolean);return{id:l.id,type:l.type,title:n(l),detail:c.contextSynthesis??Me(l.content,180),when:l.rememberedAt,author:c.whoAuthor??l.tags?.author,keyData:c.keyData??l.tags?.key_data,feature:c.featureDomain??l.tags?.feature,files:p,why:c.whyItMattered,pattern:c.pattern,antiPattern:c.antiPattern,decisionTrap:c.decisionTrap,outcome:c.outcome,nextImplication:c.nextImplication}})}catch{return[]}}o(yr,"recallRelatedContext");var ut=_e();async function Es(t,e,r){let s=r.toLowerCase(),n=fr.includes(s),a=await X(e);if(a.gitError)return{ok:!1,reason:"unsupported",message:`git ${a.gitError}: workspace identity unknown \u2014 refusing to change task status on the main fallback. Re-run when git is healthy.`};if(!a.isMain){let p=await w.getCurrentTaskForWorkspace(t,a.workspaceId);if(!p)return{ok:!1,reason:"no-active-task"};if(s==="done"||s==="completed"){let d=await dt(t,p.id),g=await Se(e,p);await D.log(e,L,{taskId:p.id,from:d??null,to:r,workspaceId:a.workspaceId,harnessWarnings:g.warnings}),await w.completeTaskInWorkspace(t,a.workspaceId),await pt(t,p.id,g.diffSize);try{let{usefulnessService:y}=await import("./usefulness-SZLG6LVC.mjs");y.creditShippedTask(t,p.id)}catch{}try{let{applyRetentionIncremental:y}=await import("./retention-C3NQT65W.mjs");y(t)}catch{}return{ok:!0,taskId:p.id,status:r,verificationWarnings:g.warnings,contextPrompt:ut}}return{ok:!1,reason:"unsupported",message:`'${r}' isn't supported for a worktree task yet \u2014 only 'done'. (pause/resume per-worktree is a planned follow-up)`}}if(n&&!await w.getCurrentTask(t)){let d=await w.resumeTask(t);if(d)return await D.log(e,L,{taskId:d.id,from:"paused",to:r}),{ok:!0,taskId:d.id,status:r}}let i=await w.getCurrentTask(t);if(!i)return{ok:!1,reason:"no-active-task"};let l=await dt(t,i.id),c=s==="done"||s==="completed"?await Se(e,i):{warnings:[],diffSize:0};await D.log(e,L,{taskId:i.id,from:l??null,to:r,harnessWarnings:c.warnings});try{if(s==="done"||s==="completed"){await w.completeTask(t),await pt(t,i.id,c.diffSize);try{let{usefulnessService:p}=await import("./usefulness-SZLG6LVC.mjs");p.creditShippedTask(t,i.id)}catch{}try{let{applyRetentionIncremental:p}=await import("./retention-C3NQT65W.mjs");p(t)}catch{}}else s==="paused"||s==="pause"?await w.pauseTask(t):n&&(await w.getCurrentTask(t)||await w.resumeTask(t))}catch{}return{ok:!0,taskId:i.id,status:r,verificationWarnings:c.warnings,contextPrompt:s==="done"||s==="completed"?ut:void 0}}o(Es,"setTaskStatus");async function Rs(t,e){let r=await X(e);return r.gitError?null:r.isMain?w.getCurrentTask(t):w.getCurrentTaskForWorkspace(t,r.workspaceId)}o(Rs,"resolveActiveTask");async function pt(t,e,r){try{let{prjctDb:s}=await import("./database-ZUC7OEZG.mjs"),{pointsFromDiffLines:n}=await import("./task-orchestration-HFZYWYLR.mjs"),a=s.get(t,"SELECT expected_value FROM tasks WHERE id = ?",e),i=Number(a?.expected_value);if(!Number.isFinite(i)||i<=0)return;s.run(t,`UPDATE tasks SET data = json_set(COALESCE(data, '{}'),
68
- '$.expectedPoints', ?, '$.actualPoints', ?, '$.diffLines', ?)
69
- WHERE id = ?`,i,n(r),r,e)}catch{}}o(pt,"recordEstimationOutcome");async function $s(t,e,r){let s=await X(e);return s.gitError?null:s.isMain?w.completeTask(t,r):w.completeTaskInWorkspace(t,s.workspaceId,r)}o($s,"completeActiveTask");async function dt(t,e){try{let{default:r}=await import("./database-ZUC7OEZG.mjs"),s=r.query(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 10",`memory.${L}`);for(let n of s)try{let a=JSON.parse(n.data);if(a.taskId===e&&a.to)return a.to}catch{}}catch{}return null}o(dt,"readLastStatus");export{be as a,Cs as b,js as c,Ps as d,hr as e,ut as f,Es as g,Rs as h,$s as i,dt as j};
@@ -1,16 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as u,e as c}from"./chunk-GCDLPKOH.mjs";import{a as r}from"./chunk-E66B27AL.mjs";c();function g(){return"---"}r(g,"mdHeader");function a(){return`---
9
- prjct v${u()}`}r(a,"mdFooter");function f(...n){return m(g(),...n.filter(Boolean),a())}r(f,"mdOutput");function d(n,t){let i=`| ${n.join(" | ")} |`,e=`|${n.map(()=>"---").join("|")}|`,o=t.map(s=>`| ${s.join(" | ")} |`);return[i,e,...o].join(`
10
- `)}r(d,"mdTable");function l(n,t,i=3){return`### ${n}
11
- ${t}`}r(l,"mdSection");function $(n,t=!1){return n.map((i,e)=>t?`${e+1}. ${i}`:`- ${i}`).join(`
12
- `)}r($,"mdList");function h(n){let t=["Command","Action"],i=n.map(e=>[`\`${e.command}\``,e.label]);return`### Next
13
- ${d(t,i)}`}r(h,"mdNextSteps");function x(n){let t=Object.entries(n).filter(([,o])=>o!=null);if(t.length===0)return"";let i=["Metric","Value"],e=t.map(([o,s])=>[o,String(s)]);return d(i,e)}r(x,"mdStats");function b(n,t){return t?`## ${n}
14
- > ${t}`:`## ${n}`}r(b,"mdDone");function j(n){return`> **WARNING:** ${n}`}r(j,"mdWarn");function m(...n){return n.filter(Boolean).join(`
15
-
16
- `)}r(m,"mdJoin");export{f as a,l as b,$ as c,h as d,x as e,b as f,j as g};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b as c,c as d,e as k,f as s,g as l,j as f}from"./chunk-Z4X7JIAP.mjs";import{a as u}from"./chunk-E66B27AL.mjs";function m(t){return typeof t=="string"?`${t}
9
- `:`${JSON.stringify(t)}
10
- `}u(m,"payloadLine");async function g(t,n){let i=t.projectPath??process.cwd();if(n){try{let e=n.hookHost??c(),r=n.input;if(n.afterEmitOnly){t.afterEmit&&n.detachAfterEmit(()=>t.afterEmit(r,i));return}let o=t.decide?await t.decide(r,i):null;if(o){n.sink(m(d(a(t.event,o.deny),e)));return}let H=t.build?await t.build(r,i,e):null;n.sink(m(d(f(t.event,H),e))),t.afterEmit&&n.detachAfterEmit(()=>t.afterEmit(r,i))}catch{n.sink(`{}
11
- `)}return}await l(async()=>{let e=k(),r=t.decide?await t.decide(e,i):null;if(r){s(a(t.event,r.deny));return}let o=t.build?await t.build(e,i,c()):null;s(f(t.event,o)),t.afterEmit&&await t.afterEmit(e,i)})}u(g,"runHook");export{g as a};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{b as x}from"./chunk-SJ75V4WG.mjs";import{d as M}from"./chunk-C4O243NG.mjs";import{a as f}from"./chunk-V2FR2NPL.mjs";import{a as C}from"./chunk-QP5USCDX.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var q=new Set(["pattern-detector-auto","pattern-detector-recurring","skill-miss-detector","friction-detector"]);function E(t){if(t.type==="improvement-signal")return!0;let e=t.tags?.source;return e!==void 0&&q.has(e)}o(E,"isSignalEntry");var R=85,S=2;async function K(t,e,n={}){let a=n.threshold??R,d=n.maxIterations??S,i=await import("./retention-C3NQT65W.mjs").then(({evaluateRetention:s})=>s(e,Date.now()).byId).catch(()=>null),h=o(async(s,c,g,m)=>{if(s>=d||c.score>=a)return{...c,irrelevantRemoved:g,repairEntriesCreated:m};let r=f.allEntriesForIndex(e),p=r.filter(l=>{if(!w(l))return!1;let b=i?.get(l.id);return!(b&&b.verdict==="active"&&b.score>=70)}),u=I(r)?0:1;u>0&&await f.remember(t,{type:"context",content:_(r,c),tags:{context_schema:"living-v2",synthesis:"model-authored",feature:"context-quality-cleanup",key_data:`quality_score=${c.score}; threshold=${a}; irrelevant=${p.length}`,model:"prjct sync context-quality analyzer",token_usage:"0 deterministic sync tokens",source:"sync-context-quality"},provenance:"inferred",projectId:e});let y=[];for(let l of p)f.forget(e,l.id)&&(y.push(l.id),await C({projectId:e,entityType:"memories",entityId:l.id,eventType:"delete",data:{id:l.id,type:l.type,content:l.content,tags:l.tags,reason:"context-quality-cleanup"}}));let $={...k(e,a),iterations:s+1,irrelevantRemoved:g+y.length,repairEntriesCreated:m+u};return p.length===0&&u===0?$:h(s+1,$,g+y.length,m+u)},"repairIteration");return h(0,k(e,a),0,0)}o(K,"repairContextQuality");function k(t,e=R){let n=f.allEntriesForIndex(t),a=n.filter(r=>r.type==="context"),d=a.filter(v),i=a.filter(r=>!v(r)),h=n.filter(w),s=[],c=[];n.length>0&&d.length===0&&(c.push(35),s.push("missing living-v2 context synthesis")),h.length>0&&(c.push(Math.min(40,h.length*8)),s.push(`${h.length} irrelevant generated entries in active context`)),i.length>0&&(c.push(Math.min(20,i.length*5)),s.push(`${i.length} legacy context entries need cleanup`));let g=d[0];if(g){let r=x(g.content),u=[r.contextSynthesis,r.keyData,r.model,r.tokenUsage,r.nextImplication].filter(y=>!y).length;u>0&&(c.push(u*4),s.push("latest living context is missing structured UI/LLM fields"))}let m=Math.max(0,Math.min(100,100-c.reduce((r,p)=>r+p,0)));return{score:m,threshold:e,passed:m>=e,iterations:0,livingContextCount:d.length,legacyContextCount:i.length,irrelevantRemoved:0,repairEntriesCreated:0,issues:s}}o(k,"evaluateContextQuality");function w(t){return E(t)?!0:t.tags?.source==="sync-context-quality"||t.type!=="context"||v(t)?!1:L(t)}o(w,"isIrrelevantGeneratedContext");function v(t){if(t.tags?.context_schema==="living-v2")return!0;let e=x(t.content);return!!(e.contextSynthesis&&e.keyData)}o(v,"isLivingV2Context");function I(t){return t.some(e=>e.type==="context"&&v(e))}o(I,"hasUsableLivingContext");function L(t){let e=t.content.trim();if(e.length<260||/User pushback:|raw quote|transcript|hot file|skill-miss/i.test(e))return!0;let n=x(e);return[n.whatHappened,n.whyItMattered,n.pattern,n.antiPattern,n.outcome,n.nextImplication].filter(Boolean).length<3}o(L,"isLowValueLegacyContext");function _(t,e){let n=t.filter(i=>!w(i)).filter(i=>["decision","gotcha","learning","context","shipped"].includes(i.type)).slice(0,8),a=n.length>0?n.map(i=>`${i.type}:${M(i)}`).join("; "):"No high-quality prior context survived cleanup.";return["Context synthesis: Sync repaired historical low-quality project context by removing generated telemetry and preserving the useful project knowledge as a living-v2 synthesis. Future agents should trust this synthesized layer over old raw detector rows or legacy context snippets.",`Key data: ${[`quality_score=${e.score}`,`threshold=${e.threshold}`,`legacy_context=${e.legacyContextCount}`,`issues=${e.issues.join("|")||"none"}`].join("; ")}`,"What happened: prjct sync detected that active context quality was below the required threshold and generated a replacement synthesis before deleting irrelevant generated entries.","Why it mattered: Existing users had accumulated low-signal context over time; leaving it active makes the second brain noisy for both the UI and LLM retrieval.","Who/author: prjct sync","Model: prjct sync context-quality analyzer","Token usage: 0 deterministic sync tokens","Sentiment: cleanup required because raw generated context had become product debt","Related files: generated from existing project memory during sync","Feature/domain: context-quality-cleanup","Pattern: Keep structured key data for UI representation and synthesized context for humans/LLMs.","Anti-pattern: Surfacing raw detector rows, hot-file counters, or short legacy snippets as durable project knowledge.","Decision/trap: Generated garbage is hard-deleted from active recall/vault/search; user-authored decisions, gotchas, learnings, and facts are preserved.",`Outcome: Repair synthesis created from surviving highlights: ${a}`,"Next implication: If quality remains below threshold, run full sync/analysis and inspect remaining user-authored entries manually instead of deleting them blindly."].join(" \xB7 ")}o(_,"buildRepairContext");export{K as a,w as b};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as o}from"./chunk-TPESWBA7.mjs";import{a as r}from"./chunk-E66B27AL.mjs";var c=new Set(["claude","codex","gemini","grok","cursor","opencode","pi","antigravity","unknown"]);function p(){let n=process.env.PRJCT_AGENT_RUNTIME?.trim().toLowerCase();return n&&c.has(n)?n:n?n.slice(0,32):process.env.CLAUDE_AGENT||process.env.ANTHROPIC_CLAUDE||process.env.CLAUDECODE?"claude":process.env.CODEX_SANDBOX||process.env.PRJCT_SANDBOX==="1"?"codex":process.env.GEMINI_CLI||process.env.GEMINI_API_KEY?"gemini":process.env.CURSOR_TRACE_ID||process.env.CURSOR_AGENT||process.env.CURSOR_SESSION_ID?"cursor":process.env.GROK_API_KEY||process.env.XAI_API_KEY||process.env.GROK_SESSION?"grok":process.env.OPENCODE||process.env.OPENCODE_SESSION||process.env.OPENCODE_CONFIG?"opencode":process.env.PI_CODING_AGENT_DIR||process.env.PI_SESSION||process.env.PI_AGENT?"pi":"unknown"}r(p,"detectRuntimeAgent");function u(n="session"){let e=p(),s=process.env.CLAUDE_SESSION_ID||process.env.CODEX_SESSION_ID||process.env.PRJCT_SESSION_ID||void 0,t=process.env.PRJCT_AGENT?.trim(),i=t&&t.length>0?t:o(`identity:${e}:${n}`);return{agent:e,identity:i,sessionId:s}}r(u,"resolveCallerIdentity");function d(n){let e=n.trim().toLowerCase();return e==="claude-code"||e==="anthropic"?"claude":e==="openai"||e==="oai"?"codex":e==="google"?"gemini":e==="xai"||e==="grok-build"?"grok":e==="opencode-ai"||e==="open-code"?"opencode":e==="pi-coding-agent"||e==="pi-agent"?"pi":e.slice(0,32)}r(d,"normalizeAgentName");function E(n,e){return n?!!(n.ownerSessionId&&e.sessionId&&n.ownerSessionId===e.sessionId||n.ownerIdentity&&e.identity&&n.ownerIdentity===e.identity):!1}r(E,"sameOwner");export{c as a,p as b,u as c,d,E as e};
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as d}from"./chunk-V2FR2NPL.mjs";import{c as l}from"./chunk-I26F7TLM.mjs";import{e as a,g as p}from"./chunk-UHVYBU7F.mjs";import{a as m}from"./chunk-E66B27AL.mjs";p();var E=7,T=90,f=20,A=["pattern-detector","transcript-auto","skill-miss","friction","land-auto","sync-context-quality"];function h(e){return e?A.some(t=>e===t||e.startsWith(`${t}-`)||e.startsWith(t)):!1}m(h,"isAutoSource");function L(e,t=E,o=500){let u=Date.now()-t*864e5;try{let n=a.query(e,`SELECT id FROM memory_entries
9
- WHERE deleted_at IS NOT NULL AND deleted_at < ?
10
- ORDER BY deleted_at ASC
11
- LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM memory_embeddings WHERE memory_id = ?"),r=s.prepare("DELETE FROM memory_entries WHERE id = ?");for(let c of n){try{i.run(c.id)}catch{}r.run(c.id)}}),n.length)}catch{return 0}}m(L,"purgeSoftDeleted");function O(e,t=E,o=500){let u=new Date(Date.now()-t*864e5).toISOString();try{let n=a.query(e,`SELECT e.id FROM events e
12
- WHERE e.type LIKE 'memory.remember.%'
13
- AND e.timestamp < ?
14
- AND NOT EXISTS (
15
- SELECT 1 FROM memory_entries m
16
- WHERE m.id = 'mem_' || e.id AND m.deleted_at IS NULL
17
- )
18
- ORDER BY e.id ASC
19
- LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM events WHERE id = ?");for(let r of n)i.run(r.id)}),n.length)}catch{return 0}}m(O,"purgeOrphanRememberEvents");function g(e,t=f){if(t<=0)return 0;let o=[];try{let u=d.allEntriesForIndex(e),n=new Map;for(let s of u){let i=s.tags?.source;if(!h(i))continue;let r=i,c=n.get(r)??[];c.push(s),n.set(r,c)}for(let[,s]of n){if(s.length<=t)continue;s.sort((r,c)=>r.rememberedAt.localeCompare(c.rememberedAt));let i=s.slice(0,s.length-t);for(let r of i){try{l.archive(e,{entityType:"memory_entry",entityId:r.id,entityData:{id:r.id,type:r.type,content:r.content,tags:r.tags,rememberedAt:r.rememberedAt},summary:r.content.slice(0,80),reason:`auto-source-cap (>${t})`})}catch{}d.forget(e,r.id)&&o.push(r)}}}catch{return o.length}return o.length}m(g,"trimAutoSourceCap");function F(e){let t=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NULL")?.c??0,o=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NOT NULL")?.c??0,u=a.get(e,"SELECT COUNT(*) AS c FROM archives")?.c??0,n=a.get(e,"SELECT COUNT(*) AS c FROM events WHERE type LIKE 'memory.remember.%'")?.c??0,s=(()=>{try{return d.allEntriesForIndex(e).filter(i=>h(i.tags?.source)).length}catch{return 0}})();return{live:t,softDeleted:o,archives:u,rememberEvents:n,autoSourceLive:s}}m(F,"vaultHealth");async function N(e,t={}){let o=t.softDeletedPurgeDays??E,u=t.archivePruneDays??T,n=t.autoSourceMaxLive??f;if(t.dryRun===!0)return{softDeletedPurged:0,orphanEventsPurged:0,archivesPruned:0,autoSourceTrimmed:0,distilledDiscarded:0,digestsWritten:0};let i=await(async()=>{if(t.projectPath)try{let{distillAndDiscardAllAutoSources:_}=await import("./distill-GOGPFQFK.mjs"),y=await _(t.projectPath,e,n);return{distilledDiscarded:y.discarded,digestsWritten:y.digests}}catch{return g(e,n),{distilledDiscarded:0,digestsWritten:0}}else return g(e,n),{distilledDiscarded:0,digestsWritten:0}})(),{distilledDiscarded:r,digestsWritten:c}=i,{eliminateSoftDeletedNoValue:D}=await import("./distill-GOGPFQFK.mjs"),b=D(e,o).purged||L(e,o),S=O(e,o),R=(()=>{try{return l.pruneOldArchives(e,u)}catch{return 0}})();return{softDeletedPurged:b,orphanEventsPurged:S,archivesPruned:R,autoSourceTrimmed:r,distilledDiscarded:r,digestsWritten:c}}m(N,"runVaultPurge");export{E as a,T as b,f as c,A as d,h as e,L as f,O as g,g as h,F as i,N as j};