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,43 +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 A}from"./chunk-S5ISOGDB.mjs";import{a as I,b as O,h as B}from"./chunk-UUULLTQV.mjs";import{a as D}from"./chunk-GAOQHD5S.mjs";import{a as T,b as W,e as u,g as k}from"./chunk-UHVYBU7F.mjs";import{c as S,d as v,e as N,f as w,g as M}from"./chunk-GCKILEXJ.mjs";import{a as h}from"./chunk-E66B27AL.mjs";k();W();B();var H=25,$=4,q=100,C=["supersedes","duplicates","superseded-by"];function L(r,e,t){let n=r.get(e);if(n!==void 0)return n;let i=t();return r.set(e,i),i}h(L,"getOrCreateMapValue");function U(r){try{let e=C.map(()=>"?").join(","),t=u.query(r,`SELECT t.entry_id, t.key, t.value
9
- FROM memory_entry_tags t
10
- JOIN memory_entries m ON m.id = t.entry_id
11
- WHERE m.deleted_at IS NULL
12
- AND t.is_machine = 0
13
- AND t.key IN (${e})`,...C),n=new Map;for(let o of t){let a=L(n,o.entry_id,()=>({}));a[o.key]=o.value}let i=[...n.entries()].map(([o,a])=>({id:o,tags:a}));return M(i)}catch{return new Set}}h(U,"collectMirrorSupersededIds");function b(r,e){let t=new Map;if(e.length===0)return t;let n=e.map(()=>"?").join(","),i=u.query(r,`SELECT entry_id, key, value FROM memory_entry_tags WHERE entry_id IN (${n})`,...e);for(let o of i){let a=L(t,o.entry_id,()=>({}));a[o.key]=o.value}return t}h(b,"batchTagsByEntryId");function _(r,e,...t){let n=u.query(r,`SELECT id, type, content, provenance, created_at
14
- FROM memory_entries
15
- WHERE deleted_at IS NULL ${e}`,...t);if(n.length===0)return[];let i=b(r,n.map(o=>o.id));return n.map(o=>({id:o.id,type:o.type,content:o.content,tags:i.get(o.id)??{},rememberedAt:new Date(o.created_at).toISOString(),provenance:o.provenance??"declared"}))}h(_,"loadV2Entries");function x(r,e,t){if(t&&t.length>0){let n=t.map(()=>"?").join(",");return _(r,`AND type IN (${n}) ORDER BY created_at DESC, rowid DESC LIMIT ?`,...t,e)}return _(r,"ORDER BY created_at DESC, rowid DESC LIMIT ?",e)}h(x,"recallEntriesFromV2");var Y={applyTopicSupersession(r,e,t,n){try{let i=u.get(r,`SELECT COUNT(*) AS c FROM memory_entries
16
- WHERE project_id = ? AND type = ? AND content_hash != ?
17
- AND (topic_key = ? OR id IN (
18
- SELECT entry_id FROM memory_entry_tags WHERE key IN ('topic', 'key') AND value = ?
19
- ))`,r,e,t,n,n)?.c??0;u.run(r,`UPDATE memory_entries SET topic_key = ?, revision_count = ?
20
- WHERE project_id = ? AND type = ? AND content_hash = ? AND deleted_at IS NULL`,n,i,r,e,t),u.run(r,`UPDATE memory_entries SET deleted_at = ?
21
- WHERE project_id = ? AND type = ? AND deleted_at IS NULL AND content_hash != ?
22
- AND (topic_key = ? OR id IN (
23
- SELECT entry_id FROM memory_entry_tags WHERE key IN ('topic', 'key') AND value = ?
24
- ))`,Date.now(),r,e,t,n,n)}catch{}},async remember(r,e){let t={...e.tags??{}},n=e.provenance??"declared",i=T(e.content);{let c=await import("./trust-boundary-EX65SUYR.mjs").then(l=>l.evaluateMemoryContent).catch(()=>null);if(c){let l=c(e.content,{force:e.force});if(!l.allow){if(e.requireWrite)throw new Error(l.denyMessage);return}}}let{classifyCapturePrecision:o}=await import("./precision-classifier-IVVAXE26.mjs"),a=o(e.content,e.type,{force:e.force===!0});if(a.action==="refuse"){if(e.requireWrite)throw new Error(`precision refuse (${a.reasonCode}): ${a.reason}`);return}a.action==="demote"&&a.demoteTo&&(t.shape_demoted="true",t.original_type=e.type,t.precision_reason=a.reasonCode),e.force&&(t["precision:force"]="true");let m=a.action==="demote"&&a.demoteTo?a.demoteTo:e.type,d=e.projectId??await(async()=>{try{let{default:c}=await import("./config-manager-DX5OOPW5.mjs");return(await c.readConfig(r))?.projectId}catch{return}})();if(!t.file)try{let{inferMemoryFileTag:c}=await import("./infer-memory-file-PIAZ542H.mjs"),l=d?await(async()=>{try{let{stateStorage:E}=await import("./state-storage-XU35ZYNA.mjs"),p=(await E.getCurrentTask(d))?.likelyFiles;return Array.isArray(p)?p.map(f=>typeof f=="string"?f:f?.path).filter(f=>typeof f=="string"&&f.length>0):null}catch{return null}})():null,R=c({content:e.content,tags:t,projectPath:r,cycleFiles:l});R&&(t.file=R,t.file_source="inferred")}catch{}let y=t.topic??t.key;if(d){try{if(u.get(d,"SELECT id FROM memory_entries WHERE content_hash = ? AND type = ? AND deleted_at IS NULL LIMIT 1",i,m)){y&&this.applyTopicSupersession(d,m,i,y);return}}catch{}try{let{captureGate:c}=await import("./capture-gate-PS6QUXLX.mjs"),l=c(d,m,e.content,t);if(!l.accept){if(e.requireWrite)throw new Error(`capture refused: ${l.reason}`);return}}catch(c){if(e.requireWrite&&c instanceof Error&&c.message.startsWith("capture refused"))throw c}}let s=await A.log(r,`${I}${m}`,{content:e.content,tags:t,source:e.source,provenance:n,content_hash:i,...d?{project_id:d}:{}},void 0,d||e.requireWrite?{...d?{projectId:d}:{},required:e.requireWrite}:void 0),g=d??s?.projectId;if(g&&y&&s?.eventId!=null&&this.applyTopicSupersession(g,m,i,y),s?.projectId)try{let{usefulnessService:c}=await import("./usefulness-SZLG6LVC.mjs");c.recordReferences(s.projectId,e.content,t),c.recordCorrection(s.projectId,t)}catch{}if(g)try{let{publishCRUD:c}=await import("./publish-helper-SX7HEV2L.mjs"),l=t.spec_id??t.task_id??t.id??e.source??`mem-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await c({projectId:g,entityType:"memories",entityId:l,eventType:"upsert",data:{id:l,type:m,content:e.content,tags:t,source:e.source??null,provenance:n,created_at:new Date().toISOString(),rememberedAt:new Date().toISOString()}})}catch{}},searchFts(r,e,t){if(e.length===0||t<=0)return[];let n=e.map(s=>D(s).replace(/[^a-z0-9-]/gi,"")).filter(s=>s.length>=2);if(n.length===0)return[];let i=n.map(s=>`"${s}"*`).join(" OR "),o=(()=>{try{return u.query(r,`SELECT m.id, m.content, m.type, m.provenance, m.created_at
25
- FROM memory_entries_fts ft
26
- JOIN memory_entries m ON m.rowid = ft.rowid
27
- WHERE memory_entries_fts MATCH ?
28
- AND m.deleted_at IS NULL
29
- ORDER BY bm25(memory_entries_fts) ASC, m.created_at DESC
30
- LIMIT ?`,i,t*2)}catch{return[]}})();if(o.length===0)return[];let a=b(r,o.map(s=>s.id)),m=o.map(s=>({id:s.id,type:s.type??"fact",content:s.content,tags:a.get(s.id)??{},rememberedAt:new Date(s.created_at).toISOString(),provenance:s.provenance??"declared"})),d=U(r);return(d.size>0?m.filter(s=>!d.has(s.id)):m).slice(0,t)},recall(r,e={}){let t=e.limit??H,n=Math.max(t*$,q),i=e.types&&e.types.length>0?new Set(e.types):null,o=i?i.has("shipped"):!0,a=i?[...i].some(p=>p!=="shipped"):!0,m=i?[...i].filter(p=>p!=="shipped"):void 0,d=a?x(r,n,m):[],y=o?u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",n):[],s=[...d,...y.map(S)],g=i?s.filter(p=>i.has(p.type)):s,c=e.tags?g.filter(p=>N(p,e.tags??{})):g,R=[...e.topic?c.filter(p=>v(p,e.topic)):c].sort((p,f)=>f.rememberedAt.localeCompare(p.rememberedAt)),E=e.dedupeByKey!==!1?w(R):R;return(()=>{if(e.pruneSuperseded===!1)return E;let p=M(E);return p.size>0?E.filter(f=>!p.has(f.id)):E})().slice(0,t)},recallForFile(r,e,t=3,n={}){if(!e)return[];let i=e.split("/").pop()??e,o=h(c=>c.type==="gotcha"||c.type==="red-herring"||c.type==="anti-pattern"||c.tags?.pattern==="recurring-bug","isPreventive"),a=Math.max(t*5,15),m=(()=>{try{return _(r,`AND file IS NOT NULL
31
- AND (file = ? OR ? LIKE '%/' || file OR file = ? OR file LIKE '%/' || ?)
32
- ORDER BY created_at DESC, rowid DESC
33
- LIMIT ?`,e,e,i,i,a).filter(o)}catch{return[]}})(),d=n.preventiveOnly?[]:(()=>{try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT 200","context").filter(l=>(l.tags?.files??"").split(",").map(E=>E.trim()).some(E=>E===e||E===i||E.endsWith(`/${i}`)))}catch{return[]}})(),y=[...m,...d],s=M(y);return(s.size>0?y.filter(c=>!s.has(c.id)):y).slice(0,t)},getById(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return null;try{return _(r,"AND id = ?",`mem_${t[1]}`)[0]??null}catch{return null}},countByType(r,e){try{return u.get(r,"SELECT COUNT(*) AS n FROM memory_entries WHERE project_id IN (?, 'local') AND type = ? AND deleted_at IS NULL",r,e)?.n??0}catch{return 0}},recallByType(r,e,t){if(t<=0)return[];try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT ?",e,t)}catch{return[]}},forget(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return!1;let n=Number(t[1]),i=`mem_${n}`,o=(()=>{try{return u.get(r,"SELECT id FROM events WHERE id = ? AND type LIKE ?",n,`${O}%`)?(u.run(r,"DELETE FROM events WHERE id = ?",n),!0):!1}catch{return!1}})();try{u.run(r,"DELETE FROM memory_embeddings WHERE memory_id = ?",i)}catch{}let a=(()=>{try{return u.run(r,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),i).changes>0}catch{return!1}})();return o||a},expandWithLinks(r,e,t=5){if(e.length===0||t<=0)return[];let n=/\bmem[_-](\d+)\b/g,i=["resolves","relates","supersedes","superseded-by","duplicates","spec"],o=new Set(e.map(m=>m.id)),a=[];for(let m of e){if(a.length>=t)break;let d=new Set;for(let y of i){let s=m.tags?.[y];if(s)for(let g of String(s).matchAll(n))d.add(`mem_${g[1]}`)}for(let y of m.content.matchAll(n))d.add(`mem_${y[1]}`);for(let y of d){if(a.length>=t)break;if(o.has(y))continue;o.add(y);let s=Y.getById(r,y);s&&a.push(s)}}return a},unembeddedEntriesForIndex(r,e){try{let t=_(r,`AND type != ?
34
- AND NOT EXISTS (
35
- SELECT 1 FROM memory_embeddings me
36
- WHERE me.memory_id = memory_entries.id AND me.model = ?
37
- )
38
- ORDER BY created_at DESC, rowid DESC`,"improvement-signal",e),n=u.query(r,`SELECT s.id, s.name, s.type, s.shipped_at, s.data FROM shipped_features s
39
- WHERE NOT EXISTS (
40
- SELECT 1 FROM memory_embeddings me
41
- WHERE me.memory_id = 'ship_' || s.id AND me.model = ?
42
- )
43
- ORDER BY s.shipped_at DESC`,e);return[...t,...n.map(S)]}catch{return[]}},allEntriesForIndex(r){try{let e=_(r,"ORDER BY created_at DESC, rowid DESC"),t=u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC");return[...e,...t.map(S)]}catch{return[]}}};export{Y as a};
@@ -1,35 +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 W,b as R}from"./chunk-OUAS3LZ3.mjs";import{a as I}from"./chunk-5XA5RL5I.mjs";import{a as _,c as B}from"./chunk-I26F7TLM.mjs";import{d as x,e as b,g as E}from"./chunk-UHVYBU7F.mjs";import{b as d,h as g}from"./chunk-A6K4H3YT.mjs";import{a as u}from"./chunk-E66B27AL.mjs";g();var f={idle:{transitions:["task"],prompt:"prjct work <intent> Start working",description:"No active work cycle"},working:{transitions:["done","pause"],prompt:"prjct status done Complete work | prjct status paused Switch context",description:"Work in progress"},paused:{transitions:["resume","task","ship"],prompt:"prjct status active Continue | prjct work <new> Start different | prjct ship Ship directly",description:"Task paused"},completed:{transitions:["ship","task","pause","reopen"],prompt:"prjct ship Ship it | prjct work <next> Start next | prjct status active Reopen",description:"Task completed"},shipped:{transitions:["task"],prompt:"prjct work <intent> Start new work cycle",description:"Feature shipped"}},h=class{static{u(this,"WorkflowStateMachine")}getCurrentState(t,s){if(s){let a=(t?.activeTasks??[]).find(n=>n.workspaceId===s);return a?this.statusToState(a):"idle"}let e=t?.currentTask;return e?this.statusToState(e):(t?.pausedTasks?.length||0)>0||t?.previousTask?.status==="paused"?"paused":"idle"}statusToState(t){switch((typeof t.status=="string"?t.status:"").toLowerCase()){case"in_progress":case"working":return"working";case"paused":return"paused";case"completed":case"done":return"completed";case"shipped":return"shipped";default:return"working"}}canTransition(t,s){if(f[t].transitions.includes(s))return{valid:!0};let a=this.formatNextSteps(t).join(" | ");return{valid:!1,error:`Cannot transition to '${s}' from '${t}' state`,suggestion:`Valid next steps: ${a}`}}getNextState(t,s){switch(s){case"task":return"working";case"done":return"completed";case"pause":return"paused";case"resume":return"working";case"ship":return"shipped";case"reopen":return"working";default:return t}}getStateInfo(t){return f[t]}getPrompt(t){return f[t].prompt}getValidCommands(t){return f[t].transitions}formatNextSteps(t){return f[t].transitions.map(e=>{switch(e){case"task":return"prjct work <intent> Start new work cycle";case"done":return"prjct status done Complete current work";case"pause":return"prjct status paused Pause and switch context";case"resume":return"prjct status active Continue paused task";case"ship":return"prjct ship Ship the feature";case"reopen":return"prjct status active Reopen completed task";default:return`prjct ${e}`}})}},S=new h;E();g();async function H(r,t,s){let e={pausedCount:0};if(await r.update(t,n=>{if(!n.currentTask)return n;r.validateTransition(n,"pause"),e.pausedTask={...n.currentTask,status:"paused",pausedAt:d(),pauseReason:s};let i=[e.pausedTask,...r.getPausedTasksFromState(n)].slice(0,r.maxPausedTasks);return e.pausedCount=i.length,{...n,currentTask:null,previousTask:null,pausedTasks:i,lastUpdated:d()}}),!e.pausedTask)return null;let a=e.pausedTask;return await r.publish(t,"task.paused",{taskId:a.id,description:a.description,pausedAt:a.pausedAt,reason:s,pausedCount:e.pausedCount}),a}u(H,"pauseTask");async function O(r,t,s){let e={remainingPaused:0};if(await r.update(t,n=>{let i=r.getPausedTasksFromState(n);if(i.length===0)return n;r.validateTransition(n,"resume");let o=s?i.findIndex(A=>A.id===s):0;if(o===-1)return n;let c=i[o],k=i.filter((A,lt)=>lt!==o),{status:l,pausedAt:T,pauseReason:p,...m}=c;return e.currentTask={...m,startedAt:d(),sessionId:c.sessionId??_()},e.remainingPaused=k.length,{...n,currentTask:e.currentTask,previousTask:null,pausedTasks:k,lastUpdated:d()}}),!e.currentTask)return null;let a=e.currentTask;return await r.publish(t,"task.resumed",{taskId:a.id,description:a.description,resumedAt:a.startedAt,remainingPaused:e.remainingPaused}),a}u(O,"resumeTask");async function D(r,t){let s=await r.read(t),e=r.getPausedTasksFromState(s),a=Date.now()-r.stalenessThresholdDays*24*60*60*1e3;return e.filter(n=>new Date(n.pausedAt).getTime()<a)}u(D,"getStalePausedTasks");async function F(r,t){let s=Date.now()-r.stalenessThresholdDays*24*60*60*1e3,e=[];await r.update(t,n=>{let i=r.getPausedTasksFromState(n),o=i.filter(k=>new Date(k.pausedAt).getTime()<s);if(e.push(o),o.length===0)return n;let c=i.filter(k=>new Date(k.pausedAt).getTime()>=s);return{...n,pausedTasks:c,previousTask:null,lastUpdated:d()}});let a=e[0]??[];if(a.length===0)return[];B.archiveMany(t,a.map(n=>({entityType:"paused_task",entityId:n.id,entityData:n,summary:n.description,reason:"staleness"})));for(let n of a)await r.publish(t,"task.archived",{taskId:n.id,description:n.description,pausedAt:n.pausedAt,reason:"staleness"});return a}u(F,"archiveStalePausedTasks");g();E();var mt=20;function Tt(r){let t=(()=>{if(!r.data)return{};try{return JSON.parse(r.data)}catch{return{}}})(),s={taskId:r.id,title:t.title??r.description,classification:r.type??"improvement",startedAt:r.started_at,completedAt:r.completed_at,subtaskCount:t.subtaskCount??0,subtaskSummaries:t.subtaskSummaries??[],outcome:t.outcome??"Task completed",branchName:r.branch??"unknown"};return r.linear_id!=null&&(s.linearId=r.linear_id),t.linearUuid!=null&&(s.linearUuid=t.linearUuid),r.pr_url!=null&&(s.prUrl=r.pr_url),t.feedback&&(s.feedback=t.feedback),t.harness&&(s.harness=t.harness),r.tokens_in&&(s.tokensIn=r.tokens_in),r.tokens_out&&(s.tokensOut=r.tokens_out),s}u(Tt,"rowToHistoryEntry");function w(r,t="",...s){try{return x.query(r,`SELECT id, description, type, branch, linear_id, pr_url, started_at, completed_at, tokens_in, tokens_out, data
9
- FROM tasks
10
- WHERE status = 'completed' AND completed_at IS NOT NULL ${t}
11
- ORDER BY completed_at DESC, rowid DESC LIMIT ${mt}`,...s).map(Tt)}catch{return[]}}u(w,"queryHistory");async function N(r,t){await r.update(t,()=>({currentTask:null,previousTask:null,pausedTasks:[],activeTasks:[],lastUpdated:d()}))}u(N,"clearTask");async function U(r,t){let s=await r.read(t),e=r.getPausedTasksFromState(s);return s.currentTask!==null||e.length>0}u(U,"hasTask");async function J(r,t){let s=await r.read(t);return r.getPausedTasksFromState(s)[0]||null}u(J,"getPausedTask");async function L(r,t){let s=await r.read(t);return r.getPausedTasksFromState(s)}u(L,"getAllPausedTasks");async function P(r,t){return w(t)}u(P,"getTaskHistory");async function q(r,t){return w(t)[0]||null}u(q,"getMostRecentTask");async function M(r,t,s){return w(t,"AND type = ?",s)}u(M,"getTaskHistoryByType");async function $(r,t){let e=(await P(r,t)).filter(p=>p.feedback),a=[],n=[],i=[],o=[];for(let p of e){let m=p.feedback;Array.isArray(m.stackConfirmed)&&a.push(...m.stackConfirmed),Array.isArray(m.patternsDiscovered)&&n.push(...m.patternsDiscovered),Array.isArray(m.agentAccuracy)&&i.push(...m.agentAccuracy),Array.isArray(m.issuesEncountered)&&o.push(...m.issuesEncountered)}let c=[...new Set(a)],k=[...new Set(n)],l=new Map;for(let p of o)l.set(p,(l.get(p)||0)+1);let T=[...l.entries()].filter(([p,m])=>m>=2).map(([p])=>p);return{stackConfirmed:c,patternsDiscovered:k,agentAccuracy:i,issuesEncountered:[...new Set(o)],knownGotchas:T}}u($,"getAggregatedFeedback");g();var ft=u(r=>r.filter(t=>t.status==="completed").length,"countCompleted"),j=u(r=>r.filter(t=>t.status==="completed"||t.status==="failed"||t.status==="skipped").length,"countResolved");async function y(r,t,s,e){let a={};return await r.update(t,n=>{if(!n.currentTask?.subtasks)return n;let i=n.currentTask.currentSubtaskIndex||0,o=n.currentTask.subtasks[i];if(!o)return n;let c=[...n.currentTask.subtasks];c[i]=s(o);let k=i+1,l=c.length;k<l&&(c[k]={...c[k],status:"in_progress",startedAt:d()});let T=k<l?c[k]:null,p=e?Q(e(c),l):void 0;return a.value={taskId:n.currentTask.id,current:c[i],next:T,...p?{progress:p}:{}},{...n,currentTask:{...n.currentTask,subtasks:c,currentSubtaskIndex:k<l?k:i,...p?{subtaskProgress:p}:{}},lastUpdated:d()}}),a.value??null}u(y,"mutateCurrentSubtask");function Q(r,t){return{completed:r,total:t,percentage:t>0?Math.round(r/t*100):0}}u(Q,"progressFrom");async function V(r,t,s){let e=await r.update(t,i=>{if(!i.currentTask)return i;let o=s.map((c,k)=>({...c,status:k===0?"in_progress":"pending",startedAt:k===0?d():void 0,dependsOn:c.dependsOn||[]}));return{...i,currentTask:{...i.currentTask,subtasks:o,currentSubtaskIndex:0,subtaskProgress:Q(0,o.length)},lastUpdated:d()}}),a=e.currentTask?.id??null,n=e.currentTask?.subtasks??[];a&&await r.publish(t,"subtasks.created",{taskId:a,subtaskCount:n.length,subtasks:n.map(i=>({id:i.id,description:i.description,domain:i.domain}))})}u(V,"createSubtasks");async function G(r,t,s){let e=W.safeParse(s);if(!e.success){let o=e.error.issues.map(c=>`${c.path.join(".")}: ${c.message}`);throw new Error(`Subtask completion requires handoff data:
12
- ${o.join(`
13
- `)}`)}let{output:a,summary:n}=e.data,i=await y(r,t,o=>({...o,status:"completed",completedAt:d(),output:a,summary:n}),ft);return i?(await r.publish(t,"subtask.completed",{taskId:i.taskId,subtaskId:i.current.id,description:i.current.description,output:a,handoff:n.outputForNextAgent,filesChanged:n.filesChanged.length,progress:i.progress}),i.next):null}u(G,"completeSubtask");async function Y(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=s.currentTask.currentSubtaskIndex||0;return s.currentTask.subtasks[e]||null}u(Y,"getCurrentSubtask");async function K(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=(s.currentTask.currentSubtaskIndex||0)+1;return s.currentTask.subtasks[e]||null}u(K,"getNextSubtask");async function v(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=(s.currentTask.currentSubtaskIndex||0)-1;return e<0?null:s.currentTask.subtasks[e]||null}u(v,"getPreviousSubtask");async function z(r,t){let s=await v(r,t);return s?.summary?.outputForNextAgent?{fromSubtask:s.description,outputForNextAgent:s.summary.outputForNextAgent,filesChanged:s.summary.filesChanged,whatWasDone:s.summary.whatWasDone}:null}u(z,"getPreviousHandoff");async function X(r,t){return(await r.read(t)).currentTask?.subtasks||[]}u(X,"getSubtasks");async function Z(r,t){return(await r.read(t)).currentTask?.subtaskProgress||null}u(Z,"getSubtaskProgress");async function tt(r,t){return((await r.read(t)).currentTask?.subtasks?.length||0)>0}u(tt,"hasSubtasks");async function st(r,t){let s=await r.read(t);return s.currentTask?.subtasks?s.currentTask.subtasks.every(e=>e.status==="completed"||e.status==="failed"||e.status==="skipped"):!0}u(st,"areAllSubtasksComplete");async function et(r,t,s){let e=await y(r,t,a=>({...a,status:"failed",completedAt:d(),output:`Failed: ${s}`}),j);return e?(await r.publish(t,"subtask.failed",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,error:s}),e.next):null}u(et,"failSubtask");async function rt(r,t,s){let e=await y(r,t,a=>({...a,status:"skipped",completedAt:d(),output:`Skipped: ${s}`,skipReason:s}),j);return e?(await r.publish(t,"subtask.skipped",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,reason:s}),e.next):null}u(rt,"skipSubtask");async function at(r,t,s){let e=await y(r,t,a=>({...a,status:"blocked",output:`Blocked: ${s}`,blockReason:s}));return e?(await r.publish(t,"subtask.blocked",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,blocker:s}),e.next):null}u(at,"blockSubtask");g();async function nt(r,t,s,e){let a={...s,workspaceId:e,startedAt:d()};return await r.update(t,n=>{if((n.activeTasks||[]).some(i=>i.workspaceId===e))throw new Error("A task is already active in this workspace");return{...n,activeTasks:[...n.activeTasks||[],a],lastUpdated:d()}}),await r.publish(t,"task.started",{taskId:a.id,description:a.description,startedAt:a.startedAt,sessionId:a.sessionId,workspaceId:e}),a}u(nt,"startTaskInWorkspace");async function it(r,t,s){return((await r.read(t)).activeTasks||[]).find(a=>a.workspaceId===s)??null}u(it,"getCurrentTaskForWorkspace");async function ut(r,t,s,e){let n=((await r.read(t)).activeTasks||[]).find(c=>c.workspaceId===s);if(!n)return null;let i=d(),o=[];return await r.update(t,c=>(o.push((c.activeTasks||[]).find(k=>k.workspaceId===s)??n),{...c,activeTasks:(c.activeTasks||[]).filter(k=>k.workspaceId!==s),lastUpdated:i})),r.persistHistoryEntry(t,r.createTaskHistoryEntry(o.at(-1)??n,i,e)),await r.publish(t,"task.completed",{taskId:n.id,description:n.description,startedAt:n.startedAt,completedAt:i,workspaceId:s}),n}u(ut,"completeTaskInWorkspace");async function ot(r,t){return(await r.read(t)).activeTasks||[]}u(ot,"getActiveTasks");async function ct(r,t){return((await r.read(t)).activeTasks||[]).length}u(ct,"getActiveTaskCount");async function kt(r,t,s,e){let n=((await r.read(t)).activeTasks||[]).find(c=>c.workspaceId===s);if(!n)return null;let i=u(c=>{let k={...c};for(let[l,T]of Object.entries(e))T===null?delete k[l]:T!==void 0&&(k[l]=T);return k.workspaceId=s,k},"merge"),o=[];return await r.update(t,c=>({...c,activeTasks:(c.activeTasks||[]).map(k=>{if(k.workspaceId!==s)return k;let l=i(k);return o.push(l),l}),lastUpdated:d()})),o.at(-1)??n}u(kt,"updateWorkspaceTask");async function dt(r,t,s,e,a){let n=await r.read(t);if(a){if(!(n.activeTasks||[]).some(c=>c.workspaceId===a))return null;let o=[];return await r.update(t,c=>({...c,activeTasks:(c.activeTasks||[]).map(k=>{if(k.workspaceId!==a)return k;let l=(k.tokensIn||0)+s,T=(k.tokensOut||0)+e;return o.push({tokensIn:l,tokensOut:T}),{...k,tokensIn:l,tokensOut:T}}),lastUpdated:d()})),o.at(-1)??null}if(!n.currentTask)return null;let i=[];return await r.update(t,o=>{if(!o.currentTask)return o;let c=(o.currentTask.tokensIn||0)+s,k=(o.currentTask.tokensOut||0)+e;return i.push({tokensIn:c,tokensOut:k}),{...o,currentTask:{...o.currentTask,tokensIn:c,tokensOut:k},lastUpdated:d()}}),i.at(-1)??null}u(dt,"addTokens");var C=class extends I{static{u(this,"StateStorage")}constructor(){super("state.json",R)}getDefault(){return{currentTask:null,previousTask:null,pausedTasks:[],taskHistory:[],activeTasks:[],lastUpdated:""}}getEventType(t){return`state.${t}d`}validateTransition(t,s,e){let a=S.getCurrentState(t,e),n=S.canTransition(a,s);if(!n.valid)throw new Error(`${n.error}. ${n.suggestion||""}`.trim())}async getCurrentTask(t){return(await this.read(t)).currentTask}async getTaskSnapshot(t){let s=await this.read(t);return{currentTask:s.currentTask,activeTasks:s.activeTasks||[]}}async bumpTurnCount(t){let s={count:0,task:null};return await this.update(t,e=>{if(!e.currentTask)return e;let a=(e.currentTask.turnCount??0)+1,n={...e.currentTask,turnCount:a};return s.count=a,s.task=n,{...e,currentTask:n}}),s}async acknowledgeTurnLimit(t,s){let e={ok:!1};return await this.update(t,a=>a.currentTask?(e.ok=!0,{...a,currentTask:{...a.currentTask,turnLimitAcknowledgedAt:s}}):a),e.ok}async getPausedTasks(t){let s=await this.read(t);return this.getPausedTasksFromState(s)}async startTask(t,s){let e={};if(await this.update(t,n=>(this.validateTransition(n,"task"),e.currentTask={...s,startedAt:d()},{...n,currentTask:e.currentTask,lastUpdated:d()})),!e.currentTask)throw new Error("Failed to start task");let a=e.currentTask;return this.mirrorTaskRow(t,a,"in_progress"),await this.publishEvent(t,"task.started",{taskId:a.id,description:a.description,startedAt:a.startedAt,sessionId:a.sessionId}),a}mirrorTaskRow(t,s,e,a={}){try{b.run(t,`INSERT INTO tasks (id, description, type, status, branch, linked_spec_id, session_id, feature_id, started_at, completed_at, paused_at, pause_reason)
14
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
15
- ON CONFLICT(id) DO UPDATE SET
16
- description = excluded.description,
17
- status = excluded.status,
18
- branch = COALESCE(excluded.branch, tasks.branch),
19
- linked_spec_id = COALESCE(excluded.linked_spec_id, tasks.linked_spec_id),
20
- completed_at = COALESCE(excluded.completed_at, tasks.completed_at),
21
- paused_at = excluded.paused_at,
22
- pause_reason = excluded.pause_reason`,s.id,s.description,s.type??null,e,s.branch??null,s.linkedSpecId??null,s.sessionId??null,s.featureId??null,s.startedAt??null,a.completedAt??null,a.pausedAt??null,a.pauseReason??null)}catch{}}mirrorHistoryEntry(t,s){try{let e=JSON.stringify({title:s.title,outcome:s.outcome,subtaskCount:s.subtaskCount,subtaskSummaries:s.subtaskSummaries,feedback:s.feedback,harness:s.harness,linearUuid:s.linearUuid});b.run(t,`INSERT INTO tasks (id, description, type, status, branch, linear_id, pr_url, started_at, completed_at, tokens_in, tokens_out, data)
23
- VALUES (?, ?, ?, 'completed', ?, ?, ?, ?, ?, ?, ?, ?)
24
- ON CONFLICT(id) DO UPDATE SET
25
- description = excluded.description,
26
- type = excluded.type,
27
- status = 'completed',
28
- branch = COALESCE(excluded.branch, tasks.branch),
29
- linear_id = COALESCE(excluded.linear_id, tasks.linear_id),
30
- started_at = COALESCE(excluded.started_at, tasks.started_at),
31
- completed_at = excluded.completed_at,
32
- pr_url = COALESCE(excluded.pr_url, tasks.pr_url),
33
- tokens_in = CASE WHEN excluded.tokens_in > 0 THEN excluded.tokens_in ELSE tasks.tokens_in END,
34
- tokens_out = CASE WHEN excluded.tokens_out > 0 THEN excluded.tokens_out ELSE tasks.tokens_out END,
35
- data = excluded.data`,s.taskId,s.title,s.classification,s.branchName==="unknown"?null:s.branchName,s.linearId??null,s.prUrl??null,s.startedAt,s.completedAt,s.tokensIn??0,s.tokensOut??0,e)}catch{}}async updateCurrentTask(t,s){return(await this.update(t,a=>{if(!a.currentTask)return a;let n={...a.currentTask};for(let[o,c]of Object.entries(s))c===null?delete n[o]:c!==void 0&&(n[o]=c);return{...a,currentTask:n,lastUpdated:d()}})).currentTask}async completeTask(t,s){let e=d(),a={};if(await this.update(t,i=>i.currentTask?(this.validateTransition(i,"done"),a.completedTask=i.currentTask,{...i,currentTask:null,previousTask:null,lastUpdated:e}):i),!a.completedTask)return null;let n=a.completedTask;return this.mirrorTaskRow(t,n,"completed",{completedAt:e}),this.mirrorHistoryEntry(t,this.createTaskHistoryEntry(n,e,s)),await this.publishEvent(t,"task.completed",{taskId:n.id,description:n.description,startedAt:n.startedAt,completedAt:e}),n}createTaskHistoryEntry(t,s,e){let a=(t.subtasks||[]).filter(o=>o.status==="completed"&&o.summary).map(o=>o.summary),n=a.length>0?a.map(o=>o.title).join(", "):"Task completed",i={taskId:t.id,title:t.parentDescription||t.description,classification:t.type||"improvement",startedAt:t.startedAt,completedAt:s,subtaskCount:t.subtasks?.length||0,subtaskSummaries:a,outcome:n,branchName:t.branch||"unknown",linearId:t.linearId,linearUuid:t.linearUuid,prUrl:t.prUrl,harness:t.harness};return e&&(i.feedback=e),t.tokensIn&&(i.tokensIn=t.tokensIn),t.tokensOut&&(i.tokensOut=t.tokensOut),i}maxPausedTasks=5;stalenessThresholdDays=30;lifecycleBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this),validateTransition:this.validateTransition.bind(this),getPausedTasksFromState:this.getPausedTasksFromState.bind(this),maxPausedTasks:this.maxPausedTasks,stalenessThresholdDays:this.stalenessThresholdDays}}async pauseTask(t,s){let e=await H(this.lifecycleBackend(),t,s);return e&&this.mirrorTaskRow(t,e,"paused",{pausedAt:e.pausedAt,pauseReason:e.pauseReason}),e}async resumeTask(t,s){let e=await O(this.lifecycleBackend(),t,s);return e&&this.mirrorTaskRow(t,e,"in_progress"),e}getPausedTasksFromState(t){return Array.isArray(t.pausedTasks)&&t.pausedTasks.length>0?t.pausedTasks:t.previousTask?[t.previousTask]:[]}async getStalePausedTasks(t){return D(this.lifecycleBackend(),t)}async archiveStalePausedTasks(t){return F(this.lifecycleBackend(),t)}queryBackend(){return{read:this.read.bind(this),update:this.update.bind(this),getPausedTasksFromState:this.getPausedTasksFromState.bind(this)}}async clearTask(t){return N(this.queryBackend(),t)}async hasTask(t){return U(this.queryBackend(),t)}async getPausedTask(t){return J(this.queryBackend(),t)}async getAllPausedTasks(t){return L(this.queryBackend(),t)}async getTaskHistory(t){return P(this.queryBackend(),t)}async getMostRecentTask(t){return q(this.queryBackend(),t)}async getTaskHistoryByType(t,s){return M(this.queryBackend(),t,s)}async getAggregatedFeedback(t){return $(this.queryBackend(),t)}workspaceBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this),createTaskHistoryEntry:this.createTaskHistoryEntry.bind(this),persistHistoryEntry:this.mirrorHistoryEntry.bind(this)}}async startTaskInWorkspace(t,s,e){let a=await this.read(t);this.validateTransition(a,"task",e);let n=await nt(this.workspaceBackend(),t,s,e);return this.mirrorTaskRow(t,n,"in_progress"),n}async getCurrentTaskForWorkspace(t,s){return it(this.workspaceBackend(),t,s)}async completeTaskInWorkspace(t,s,e){let a=await ut(this.workspaceBackend(),t,s,e);return a&&this.mirrorTaskRow(t,a,"completed",{completedAt:d()}),a}async getActiveTasks(t){return ot(this.workspaceBackend(),t)}async getActiveTaskCount(t){return ct(this.workspaceBackend(),t)}async updateWorkspaceTask(t,s,e){return kt(this.workspaceBackend(),t,s,e)}async addTokens(t,s,e,a){return dt(this.workspaceBackend(),t,s,e,a)}subtaskBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this)}}async createSubtasks(t,s){return V(this.subtaskBackend(),t,s)}async completeSubtask(t,s){return G(this.subtaskBackend(),t,s)}async getCurrentSubtask(t){return Y(this.subtaskBackend(),t)}async getNextSubtask(t){return K(this.subtaskBackend(),t)}async getPreviousSubtask(t){return v(this.subtaskBackend(),t)}async getPreviousHandoff(t){return z(this.subtaskBackend(),t)}async getSubtasks(t){return X(this.subtaskBackend(),t)}async getSubtaskProgress(t){return Z(this.subtaskBackend(),t)}async hasSubtasks(t){return tt(this.subtaskBackend(),t)}async areAllSubtasksComplete(t){return st(this.subtaskBackend(),t)}async failSubtask(t,s){return et(this.subtaskBackend(),t,s)}async skipSubtask(t,s){return rt(this.subtaskBackend(),t,s)}async blockSubtask(t,s){return at(this.subtaskBackend(),t,s)}},Ut=new C;export{S as a,Ut 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 t}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import{a as n}from"./chunk-GPZP7NXL.mjs";import"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function p(r=process.cwd(),e){return n({event:"CwdChanged",projectPath:r,build:o(async(d,i)=>{let c=d.cwd||i;return t(c)},"build")},e)}o(p,"runCwdChangedHook");export{p as runCwdChangedHook};
@@ -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 as R}from"./chunk-4NTVXJD7.mjs";import{a as E}from"./chunk-5WAONIPX.mjs";import{a as A}from"./chunk-GPZP7NXL.mjs";import{a as x}from"./chunk-N3L77UNM.mjs";import{a as b,b as M,c as T,d as C,e as g,f as k,g as m,i as w}from"./chunk-PP6DANGV.mjs";import"./chunk-4HAKTI36.mjs";import{b as I,c as S,d as $}from"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as L}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{b as v}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import{i as p}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var O=new Set(["decision","gotcha","fact","spec","identity","voice","glossary"]);function N(r){return O.has(r)}i(N,"isSotBindType");function V(r,o){let n=new Set(o??[]);return r.filter(e=>N(e.type)&&e.confidence==="high"&&e.id&&!n.has(e.id))}i(V,"filterSotCandidates");function H(r){let o=V(r.candidates,r.overriddenIds);if(o.length===0)return{action:"none",reason:"no-sot",memoryIds:[],message:""};let n=r.harnessLevel??null,e=r.fileLabel?` on \`${r.fileLabel}\``:"",t=o[0],a=o.map(s=>s.id),l='To supersede: `prjct remember decision "\u2026why\u2026" --tags supersedes:'+t.id+'`. To lift for this memory: `prjct remember feedback "override conflict '+t.id+': <why>" --tags conflict:override,memory:'+t.id+"`.";if(n==="H2"||n==="H3"){let s=`SoT hard-bind (${n})${e}: must not contradict [${t.type}] ${B(t.content,80)} (\`${t.id}\`)`;return{action:"deny",reason:"h2-sot-deny",memoryIds:a,message:[`\u26D4 prjct SoT bind: ${s}`,`Memories: ${a.join(", ")}`,l,"H2+ work is bound to living Source-of-Truth. Supersede or override before Edit|Write."].join(" ")}}return n==="H1"?{action:"warn",reason:"h1-sot-warn",memoryIds:a,message:["# prjct: SoT soft-bind (H1)","",`High-confidence SoT on this file${e}:`,...o.slice(0,3).map(s=>`- **[${s.type}]** ${B(s.content,100)} \`${s.id}\``),"",l,"","> H2+ would hard-block. On H1 this is advisory \u2014 supersede if intentional."].join(`
9
- `)}:{action:"none",reason:"none",memoryIds:a,message:""}}i(H,"sotBindVerdict");function B(r,o){let n=r.replace(/\s+/g," ").trim();return n.length>o?`${n.slice(0,o-1)}\u2026`:n}i(B,"truncate");function F(r,o){if(o.length===0)return null;let n=[`# prjct: heads-up before editing \`${r}\``,"",`${o.length} preventive trap(s) recorded against this file:`,""];for(let e of o)n.push(`- **[${e.type}]** ${e.title} \`${e.id}\``);return n.push(""),n.push("> Dynasty trap-before-edit: surface is mandatory. Apply if it still holds; supersede if not."),n.join(`
10
- `)}i(F,"formatTrapSurfaceMessage");var y=1200,_=new Map;function D(r,o){let n=`${r}\0${o}`,e=_.get(n);if(e)return e;let t=(()=>{try{return L.recallForFile(r,o,M,{preventiveOnly:!0})}catch{return[]}})();return _.set(n,t),t}i(D,"recallPreventiveOnce");function P(){_.clear()}i(P,"clearPreventiveCache");function U(r,o){let n=F(o,r.map(t=>({id:t.id,type:I(t),title:`${$(t)} \u2014 ${S(t.content)}`})));if(n)return p(n,y);let e=[`# prjct: heads-up before editing \`${o}\``,""];e.push(`${r.length} preventive memory entr${r.length===1?"y":"ies"} recorded against this file:`),e.push("");for(let t of r)e.push(`- **[${I(t)}] ${$(t)}** \u2014 ${S(t.content)} \`${t.id}\``);return e.push(""),e.push("> Nudge, not block. Apply if it still holds; proceed if not."),p(e.join(`
11
- `),y)}i(U,"headsUpMessage");async function W(r,o){let n=Date.now(),e=await h.readConfig(r);if(!e?.projectId)return null;let t=D(e.projectId,o);if(m(n)||t.length===0)return null;x(e.projectId,r,t.map(f=>f.id));let a=w(e),l=C(e.projectId),s=k(t),u=o.split("/").pop()??o,d=T({mode:a,candidates:s,overriddenIds:l,fileLabel:u});if(m(n))return null;try{let f=await v.getCurrentTask(e.projectId),c=H({harnessLevel:f?.harness?.level??null,candidates:s,overriddenIds:l,fileLabel:u});if(c.action==="warn"&&c.message)return p(c.message,y)}catch{}return d.action==="warn"&&d.message?(g(r,e.projectId,"warn",d.memoryIds,d.reason),p(d.message,y)):a==="off"||d.action==="none"||t.length>0?U(t,u):null}i(W,"buildPreEditContext");async function G(r,o){let n=Date.now();try{let e=await h.readConfig(r);if(!e?.projectId)return null;let t=await v.getCurrentTask(e.projectId);if(e.maxTurnsPerCycle){let j=E(e,t);if(j.stopped)return{deny:j.message}}if(!o||m(n,b))return null;let a=D(e.projectId,o);if(a.length===0||m(n,b))return null;let l=C(e.projectId),s=o.split("/").pop()??o,u=k(a),d=H({harnessLevel:t?.harness?.level??null,candidates:u,overriddenIds:l,fileLabel:s});if(d.action==="deny"&&d.message)return g(r,e.projectId,"deny",d.memoryIds,d.reason),{deny:d.message};let f=w(e);if(f!=="strict")return null;let c=T({mode:f,candidates:u,overriddenIds:l,fileLabel:s});return c.action==="deny"&&c.message?(g(r,e.projectId,"deny",c.memoryIds,c.reason),{deny:c.message}):null}catch{return null}}i(G,"decideHardStop");function ce(r=process.cwd(),o){return A({event:"PreToolUse",projectPath:r,decide:i(async(n,e)=>{P();let t=R(n);return t||G(e,n.tool_input?.file_path?.trim())},"decide"),build:i(async(n,e)=>{try{let t=n.tool_input?.file_path?.trim();return t?W(e,t):null}finally{P()}},"build")},o)}i(ce,"runPreEditHook");export{ce as runPreEditHook};
@@ -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}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as projectMemory};
@@ -1,24 +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 A,b as J}from"./chunk-MXHX44WF.mjs";import{a as X}from"./chunk-BDOAQVIF.mjs";import{a as K}from"./chunk-5WAONIPX.mjs";import{a as z,d as W}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import{a as V}from"./chunk-GPZP7NXL.mjs";import{b as x}from"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import{a as F}from"./chunk-5TBQNW2G.mjs";import{a as q}from"./chunk-N3L77UNM.mjs";import{a as M}from"./chunk-DVDZA63F.mjs";import{a as B}from"./chunk-EWOK4VE7.mjs";import{a as N}from"./chunk-ZOX6OV6X.mjs";import{b as O}from"./chunk-WGWE3CSC.mjs";import"./chunk-T6ELTQZM.mjs";import{b as U}from"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-GDESYWTD.mjs";import{a as H,g as L}from"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-4HAKTI36.mjs";import{d as v}from"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as w}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{b as j}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import{h as $,i as k}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as S}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{d as _,g as at}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as R,o as ct}from"./chunk-UH4MD3F3.mjs";import{b as G,p as ot}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as d}from"./chunk-E66B27AL.mjs";import{createHash as D}from"node:crypto";import y from"node:fs/promises";import h from"node:path";var ut=15;function Y(e){let i=[],t=[];e.loop?.stopped&&e.loop.message&&(i.push("loop-hard-stop"),t.push(e.loop.message)),e.pressure?.level==="critical"&&e.pressure.cue?(i.push("context-pressure-critical"),t.push(e.pressure.cue)):e.pressure?.level==="warn"&&e.pressure.cue&&(i.push("context-pressure-warn"),t.push(e.pressure.cue)),e.qualityInject?.trim()&&(i.push("quality-ledger"),t.push(e.qualityInject.trim()));let r=e.turns??0,n=e.stuckThreshold??ut;if(!e.loop?.stopped&&r>=n&&(i.push("stuck-cycle"),t.push(`\u26A0 ${r} turns on this cycle and it is still open. If you are not nearly done, STOP looping: split it, ship the slice that works, or check in with the user \u2014 then \`prjct status done\`. A re-plan beats another grinding turn.`)),t.length===0)return{level:"ok",markdown:null,cues:[]};let c=i.some(l=>["loop-hard-stop","context-pressure-critical","context-pressure-warn"].includes(l)),s=i.some(l=>["quality-ledger","stuck-cycle"].includes(l)),u=c?"hard":s?"warn":"ok",g=u==="hard"?"# prjct: alignment (MUST \u2014 hard gate)":"# prjct: alignment (mid-cycle)",p=t.join(`
9
-
10
- `),o=i.includes("quality-ledger")&&!p.includes("prjct ship")?`
11
-
12
- _${H}_`:"";return{level:u,cues:i,markdown:`${g}
13
-
14
- ${p}${o}`}}d(Y,"buildAlignmentCard");at();ot();ct();var T=1500,lt=T+2100,Z=15,P=8,Q=420,dt=2,pt=15e3;var gt=new Set(["address","apply","check","continue","create","current","description","feedback","handle","merge","monitor","please","review","should","title","watch","write"]),C=new WeakMap,b=new Map;async function tt(e,i){let t=i!==void 0?i:await S.readConfig(e);if(!t?.projectId)return null;let r=mt(t,e),n=["# prjct: project state"];try{let s=await B(t.projectId,e);if(s.current){let g=nt(s.current.startedAt);n.push(`- Active work cycle: "${s.current.description}" (${g}) [${s.current.label}]`),(t.land?.mode??"advisory")!=="off"&&n.push(' \u21B3 Before session end: `prjct land` \xB7 hand-off `prjct remember context "Session close: \u2026"`');let{turns:p,loopVerdict:o,currentTask:l}=(()=>{try{let a=s.mainTaskRaw;return{turns:a?.turnCount??0,currentTask:a,loopVerdict:K(t,a)}}catch{return{turns:0,currentTask:null,loopVerdict:null}}})();!o?.stopped&&p<Z&&n.push(" \u21B3 Stay on this goal. Each turn, before acting: is this step ADVANCING it? If you have hit the same wall twice, or you are exploring rather than progressing, STOP \u2014 re-plan, split the cycle, or ask the user. Do not loop; finish the cycle, then `prjct status done`.");try{let a=t.maxTokensPerCycle??0;if(a>0&&l){let m=(l.tokensIn??0)+(l.tokensOut??0);m>=a?n.push(` \u26A0 Token budget: ${m.toLocaleString()} of ${a.toLocaleString()} spent on this cycle. STOP growing it \u2014 ship the working slice, split the remainder into a new cycle, or check in with the user.`):m>=a*.8&&n.push(` \u21B3 Token budget: ${m.toLocaleString()} of ${a.toLocaleString()} (${Math.round(m/a*100)}%). Plan the close: prefer finishing over expanding scope.`)}}catch{}try{let a=s.current.startedAt;if(a){let m=_.get(t.projectId,`SELECT COUNT(DISTINCT json_extract(data, '$.file')) AS c
15
- FROM events WHERE type = 'memory.post_edit' AND timestamp >= ?`,a)?.c??0,f=U(m);f&&n.push(` ${f}`)}}catch{}try{let a=F(t,l),m=L(t.projectId),f=Y({loop:o,pressure:a,qualityInject:m,turns:p,stuckThreshold:Z});f.markdown&&(n.push(""),n.push(f.markdown))}catch{}l?.ownerAgent&&n.push(`- Owner: ${l.ownerAgent}${l.ownerIdentity?`/${l.ownerIdentity}`:""}${l.yieldStatus==="yielded"?" (yielded \u2014 awaiting accept)":""}`)}let u=s.all.filter(g=>!g.isCurrent);u.length>0&&n.push(`- ${u.length} task(s) active in other workspace(s)`),!s.current&&u.length>0&&n.push("- This workspace idle but siblings busy \u2014 `prjct work` auto-isolates to a worktree when needed")}catch{}let c=await r;for(let s of c)s&&n.push(s);return n.length===1?null:n.join(`
16
- `)}d(tt,"buildProjectState");function mt(e,i){return Promise.all([(async()=>{try{let{formatPendingHandoffCue:t}=await import("./agent-switch-4ZJJWKMD.mjs"),r=t(e.projectId);return r?`- ${r.replace(/\n/g,`
17
- - `)}`:null}catch{return null}})(),(async()=>{try{let t=await N.getActiveTasks(e.projectId);return t.length>0?`- Pending: ${t.length} \xB7 Next: "${t[0].description}"`:null}catch{return null}})(),(async()=>{try{if(!await R(h.join(i,".git")))return null;let t=await It(i);if(!t.branch)return null;let r=[];t.modified>0&&r.push(`${t.modified} modified`),t.staged>0&&r.push(`${t.staged} staged`),t.untracked>0&&r.push(`${t.untracked} untracked`);let n=r.length>0?` \u2014 working tree ${r.join(", ")}`:"",c=t.ahead>0?`${n?",":" \u2014"} ${t.ahead} unpushed`:"";return`- Branch: ${t.branch}${n}${c}`}catch{return null}})(),(async()=>{try{let t=await M.getRecent(e.projectId,1);if(t.length===0)return null;let r=t[0],n=nt(r.shippedAt??"");return`- Last ship: ${r.version?`v${r.version}`:r.name} (${n})`}catch{return null}})(),(async()=>{try{let t=w.countByType(e.projectId,"inbox");return t>0?`- Inbox: ${t} items pending`:null}catch{return null}})()])}d(mt,"collectSecondarySignals");function ht(e){return e.type==="voice"||e.type==="glossary"?!0:e.type==="example"&&!!e.tags.domain&&(e.tags.polarity==="good"||e.tags.polarity==="bad")}d(ht,"isValidGuidanceEntry");function ft(e,i){try{let t=A(i),r=$(i).filter(o=>o.length>=5&&!gt.has(o)),n=r.length>0?w.searchFts(e,r,P*2):[],c=t?w.recall(e,{types:["voice","glossary","example"],limit:P*2}).filter(o=>o.tags.domain==="delivery"||o.tags.domain===t):[],s=new Map([...n,...c].map(o=>[o.id,o])),u=new Map([["voice",0],["glossary",1],["example",2]]),g=[...s.values()].filter(ht).sort((o,l)=>(u.get(o.type)??3)-(u.get(l.type)??3)).slice(0,dt);if(g.length===0)return null;let p=["# prjct: selective guidance"];for(let o of g){let l=o.type==="example"?` ${o.tags.polarity}/${o.tags.domain}`:o.tags.domain?` ${o.tags.domain}`:"",a=Q-p.join(`
18
- `).length-l.length-8;if(a<24)break;let m=k(o.content.replace(/\s+/g," ").trim(),Math.min(150,a));p.push(`- ${o.type}${l}: ${m}`)}return p.length===1?null:{text:k(p.join(`
19
- `),Q),memoryIds:g.slice(0,p.length-1).map(o=>o.id)}}catch{return null}}d(ft,"buildSelectiveGuidance");function yt(e,i,t=T){if(!i)return e;let r=e?`${e}
20
-
21
- ${i}`:i;return r.length<=t?r:null}d(yt,"appendPromptSection");function et(e,i){try{let t=$(i);if(t.length===0)return null;let r=w.searchFts(e,t,P),n=r.find(c=>c.type==="decision"||c.type==="gotcha"||c.type==="fact")??r.find(c=>c.type==="anti-pattern"||c.type==="pattern")??r.find(c=>c.type==="gotcha"||c.type==="anti-pattern");return n?n.type==="decision"||n.type==="gotcha"||n.type==="fact"?{cue:`> Tip\u2192user (SoT): ${v(n)} \`${n.id}\` \u2014 say it briefly in chat; binding \u2014 do not contradict without superseding`,memoryId:n.id}:n.type==="anti-pattern"||n.type==="pattern"?{cue:`> Tip\u2192user (suggest): ${v(n)} \`${n.id}\` \u2014 propose the live change in chat, then apply when editing`,memoryId:n.id}:{cue:`> Tip\u2192user: ${v(n)} \`${n.id}\``,memoryId:n.id}:null}catch{return null}}d(et,"buildTopicalCueResult");function Qt(e,i,t){return et(e,i)?.cue??null}d(Qt,"buildTopicalCue");var I=new Map,E={skipDiskSnapshotOnce:!1};function te(){I.clear(),E.skipDiskSnapshotOnce=!0}d(te,"_resetGitSnapshotCacheForTests");async function It(e){let i=await y.stat(h.join(e,".git","index")).then(s=>s.mtimeMs).catch(()=>0),t=I.get(e);if(t&&t.expiresAt>Date.now()&&t.indexMtimeMs===i)return t.snapshot;let r=wt(e);if(!t&&!E.skipDiskSnapshotOnce){let s=await y.readFile(r,"utf-8").then(u=>JSON.parse(u)).catch(()=>null);if(s&&s.expiresAt>Date.now()&&s.indexMtimeMs===i)return I.set(e,s),s.snapshot}E.skipDiskSnapshotOnce=!1;let n=await vt(e);I.size>32&&I.clear();let c={snapshot:n,expiresAt:Date.now()+pt,indexMtimeMs:i};return I.set(e,c),y.mkdir(h.dirname(r),{recursive:!0}).then(()=>y.writeFile(r,JSON.stringify(c))).catch(()=>{}),n}d(It,"captureGit");function wt(e){let i=D("sha1").update(h.resolve(e)).digest("hex").slice(0,16);return h.join(x.runDir(),`prompt-git-${i}.json`)}d(wt,"gitSnapshotPath");function kt(e,i){let t=D("sha1").update(h.resolve(i)).digest("hex").slice(0,12);return`${e.replace(/[^a-zA-Z0-9._-]/g,"_")}-${t}`}d(kt,"promptHashKey");async function St(e,i,t){let r=kt(e,i),n=D("sha256").update(t).digest("hex");if(b.get(r)===n)return null;b.size>64&&b.clear(),b.set(r,n);let c=h.join(x.runDir(),`prompt-state-${r}.hash`);return(await y.readFile(c,"utf-8").catch(()=>"")).trim()===n?null:(await y.mkdir(h.dirname(c),{recursive:!0}).then(()=>y.writeFile(c,n)).catch(()=>{}),t)}d(St,"dedupePromptPayload");async function vt(e){let i={branch:"",modified:0,staged:0,untracked:0,ahead:0},t=d(async o=>{try{return(await G("git",o,{cwd:e,timeout:2e3})).stdout.trim()}catch{return""}},"safe"),[r,n,c]=await Promise.all([t(["branch","--show-current"]),t(["status","--porcelain"]),t(["rev-list","--count","@{u}..HEAD"])]);if(!r)return i;let{modified:s,staged:u,untracked:g}=n.split(`
22
- `).filter(Boolean).reduce((o,l)=>{let a=l.slice(0,2);return a.startsWith("??")?o.untracked++:(a[0]!==" "&&a[0]!=="?"&&o.staged++,a[1]!==" "&&o.modified++),o},{modified:0,staged:0,untracked:0}),p=Number.parseInt(c,10)||0;return{branch:r,modified:s,staged:u,untracked:g,ahead:p}}d(vt,"captureGitUncached");function nt(e){if(!e)return"unknown";let i=Date.parse(e);if(Number.isNaN(i))return"unknown";let t=Math.max(0,Math.floor((Date.now()-i)/864e5));return t<1?"today":t<2?"yesterday":t<30?`${t}d ago`:`${Math.floor(t/30)}mo ago`}d(nt,"formatRelative");function rt(e,i,t,r=T){let n=et(e,i),c=O(e,i),s=J(i),u=ft(e,i),g=[n?.cue,s,u?.text,c].filter(a=>!!a).reduce((a,m)=>yt(a,m,r)??a,k(t,r)),p=!!(u?.text&&g.includes(u.text)),l=!!(s&&g.includes(s))?`delivery:${A(i)??"unknown"}`:p?u?.memoryIds[0]??null:null;return{prioritized:g,cueResult:n,guidance:u,guidanceIncluded:p,guidanceRuleId:l}}d(rt,"computePromptGuidance");function ee(e=process.cwd(),i){return V({event:"UserPromptSubmit",projectPath:e,build:d(async(t,r,n)=>{let c=(t.prompt??"").trim();if(!c)return null;let s=await S.readConfig(r);if(!s?.projectId)return null;let u=await tt(r,s),g=n==="kimi"?await W(s.projectId,t.session_id).catch(()=>null):null,p=g?await z(r,s,{digest:g==="digest"}).catch(()=>null):null;if(!u&&!p)return null;let o=[p,u].filter(Boolean).join(`
23
-
24
- `),l=p?lt:T,{prioritized:a,cueResult:m,guidance:f,guidanceIncluded:it,guidanceRuleId:st}=rt(s.projectId,c,o,l);return C.set(t,{projectId:s.projectId,projectPath:r,bumpTurn:!!u?.includes("Active work cycle:"),surfacedIds:[...m?[m.memoryId]:[],...it?f?.memoryIds??[]:[]],guidanceRuleId:st}),St(s.projectId,r,a)},"build"),afterEmit:d(async(t,r)=>{let n=C.get(t)??await bt(t,r);C.delete(t),n&&await Promise.all([n.bumpTurn?j.bumpTurnCount(n.projectId).then(()=>{}):Promise.resolve(),n.surfacedIds.length>0?q(n.projectId,n.projectPath,n.surfacedIds):Promise.resolve(),n.guidanceRuleId?Promise.resolve(X.recordGuidanceActivation(n.projectId,{ruleId:n.guidanceRuleId})).then(()=>{}):Promise.resolve()])},"afterEmit")},i)}d(ee,"runPromptHook");async function bt(e,i){let t=(e.prompt??"").trim();if(!t)return null;let r=await S.readConfig(i).catch(()=>null);if(!r?.projectId)return null;let[n,c]=await Promise.all([j.getCurrentTask(r.projectId).catch(()=>null),tt(i,r)]),{cueResult:s,guidance:u,guidanceIncluded:g,guidanceRuleId:p}=rt(r.projectId,t,c??"");return{projectId:r.projectId,projectPath:i,bumpTurn:!!n,surfacedIds:[...s?[s.memoryId]:[],...g?u?.memoryIds??[]:[]],guidanceRuleId:p}}d(bt,"rebuildPromptAfterEmit");export{te as _resetGitSnapshotCacheForTests,J as buildDeliveryGuidance,tt as buildProjectState,ft as buildSelectiveGuidance,Qt as buildTopicalCue,A as classifyDeliveryIntent,ee as runPromptHook};
@@ -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 k}from"./chunk-KHLYWNHT.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{b as P}from"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import{b as O,c as U}from"./chunk-4HAKTI36.mjs";import{a as Y}from"./chunk-S5N2ZZDL.mjs";import"./chunk-C4O243NG.mjs";import{a as Z,b as j,c as S,d as ee,e as te,f as C,g as T,h as ne,i as re}from"./chunk-PTA7DMLM.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import{a as I,h as L}from"./chunk-DXQMKW2B.mjs";import{a as H,e as G,f as z,g as J,h as q,i as K,j as Q}from"./chunk-TXSLON7M.mjs";import{a as x}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{c as A}from"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{a as w,b as V,e as D,g as B}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import{b as M,g as F}from"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";V();B();var W=new Set(["decision","gotcha","learning","feedback","fact","shipped","spec"]),se=30,oe=50,ie=20,ce=45,ae=25,de=15,ue=180,$=90,le=25,pe=.12,me=40,fe=40,he=30,ge=20,xe=35,Ee=.12,ye=864e5,Re=100,ve=50,be=25,_e=15,De=/\b[\w.-]+(?:\/[\w.-]+)+\.(?:ts|tsx|js|jsx|mjs|cjs|json|md|sh|toml|yml|yaml)\b/g;function Ae(e,t){let o=x.allEntriesForIndex(e),r=new Set;for(let c of o)for(let l of O(c.tags))r.add(l);let n=(()=>{try{let c=P(e);return c?new Set(Object.keys(c.documents)):null}catch{return null}})(),a=S(o),i=C(a);return{entries:o,usefulness:U.decayedScores(e,t),supersededIds:F(o),correctedIds:r,indexedPaths:n,nowMs:t,refIndex:i}}p(Ae,"collectRetentionInputs");function Se(e){let t=new Map,o=new Set,r=[...e].sort((n,a)=>a.rememberedAt.localeCompare(n.rememberedAt));for(let n of r){let a=w(n.content);t.has(a)?o.add(n.id):t.set(a,n)}return o}p(Se,"collectDuplicateIds");function Me(e,t){let o=e.content.match(De);return!o||o.length===0?!1:!o.some(r=>t.has(r))}p(Me,"isUngrounded");function Ie(e,t,o){let r=[],n=T(e.content,t.refIndex,e.id),a=o.has(e.id);a&&!n.exactDup&&r.push("duplicate of newer entry"),r.push(`excess ${n.excess.toFixed(2)} (sim ${n.maxSim.toFixed(2)})`);let i=n.exactDup||n.nearDup||n.excess<Ee;i&&r.push(n.exactDup?`exact dup of ${n.nearestId}`:n.nearDup?`near-dup of ${n.nearestId}`:"low excess vs reference");let c=t.usefulness.get(e.id)??0,l=Math.min(ae,Math.max(0,c*8));c>0&&r.push(`used (+${Math.round(l)})`);let u=Math.max(0,(t.nowMs-Date.parse(e.rememberedAt))/ye),h=Number.isFinite(u)?Math.max(0,de*(1-u/ue)):0,s=c<=0&&Number.isFinite(u)&&u>$?Math.min(le,(u-$)*pe):0;s>0&&r.push(`idle ${Math.round(u)}d`);let f=t.supersededIds.has(e.id);f&&r.push("superseded");let m=t.correctedIds.has(e.id);m&&r.push("corrected");let b=!M(e)||k(e);b&&r.push("generated noise");let E=!!(t.indexedPaths&&Me(e,t.indexedPaths));E&&r.push("cites files missing at HEAD");let g=Math.max(0,Math.min(100,n.excess*ce+l+h-(i?xe:0)-s-(f?me:0)-(m?fe:0)-(b?he:0)-(E?ge:0)-(a?20:0))),R=g>=oe?"active":g>=ie?"archive":"delete",_=a||n.exactDup||n.nearDup||f,y=R!=="active"&&u<se&&!_?"active":R;y!==R&&r.push("grace period");let d=y==="delete"&&W.has(e.type)?"archive":y;return d!==y&&r.push("protected type"),{id:e.id,type:e.type,verdict:d,score:Math.round(g),reasons:r,excess:n.excess,maxSim:n.maxSim,nearestId:n.nearestId}}p(Ie,"scoreEntry");function X(e,t){let o=Ae(e,t),r=Se(o.entries),n={evaluated:o.entries.length,active:0,archive:0,delete:0,referenceSize:o.refIndex.entries.length,flagged:[],byId:new Map};for(let a of o.entries){let i=Ie(a,o,r);n[i.verdict]++,n.byId.set(i.id,i),i.verdict!=="active"&&n.flagged.push(i)}return n.flagged.sort((a,i)=>a.score-i.score),n}p(X,"evaluateRetention");function Be(e,t){return!(!M(e)||e.content.trim().length===0||t&&t.verdict!=="active"||t&&t.excess!==void 0&&t.excess<.05)}p(Be,"shouldEmbedEntry");function v(e,t){if(t.startsWith("ship_"))return Ce(e,t);if(x.forget(e,t))return!0;try{return(D.run(e,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),t).changes??0)>0}catch{return!1}}p(v,"forgetEntry");function N(e){return e.startsWith("mem_")||e.startsWith("ship_")||/^\d+$/.test(e)}p(N,"isRetentionRemovableId");function Ce(e,t){let o=t.startsWith("ship_")?t.slice(5):t;if(!o)return!1;try{let r=D.get(e,"SELECT * FROM shipped_features WHERE id = ?",o);if(!r)return!1;try{A.archive(e,{entityType:"shipped",entityId:o,entityData:r,summary:`retention archive shipped [${r.name}]`,reason:"retention-archive"})}catch{}return(D.run(e,"DELETE FROM shipped_features WHERE id = ?",o).changes??0)>0}catch{return!1}}p(Ce,"forgetShippedFeature");function Te(e,t={}){let o=t.dryRun===!0,r=t.nowMs??Date.now(),n=t.maxArchive??Re,a=t.maxDelete??ve,i=X(e,r),c=i.flagged.filter(s=>s.verdict==="archive"&&N(s.id)),l=i.flagged.filter(s=>s.verdict==="delete"&&N(s.id)),u=i.flagged.filter(s=>(s.verdict==="archive"||s.verdict==="delete")&&!N(s.id)).length,h=o?{archived:0,deleted:0,skipped:u}:(()=>{let s=c.slice(0,n),f=s.map(d=>{if(!d.id.startsWith("ship_"))try{A.archive(e,{entityType:"memory_entry",entityId:d.id,entityData:{id:d.id,type:d.type,score:d.score,excess:d.excess,reasons:d.reasons,verdict:d.verdict},summary:`retention archive [${d.type}] excess=${d.excess?.toFixed(2)??"?"} score=${d.score}`,reason:"retention-archive"})}catch{}return v(e,d.id)}),m=f.filter(Boolean).length,b=Math.max(0,c.length-s.length)+f.filter(d=>!d).length,E=l.slice(0,a),g=E.filter(d=>!W.has(d.type)).map(d=>d.id),R=E.length-g.length,_=g.length>0?Y(e,g):0,y=Math.max(0,l.length-E.length)+R+g.length-_;return{archived:m,deleted:_,skipped:u+b+y}})();return{evaluated:i.evaluated,active:i.active,wouldArchive:c.length,wouldDelete:l.length,archived:h.archived,deleted:h.deleted,skipped:h.skipped,dryRun:o,samples:i.flagged.slice(0,10),referenceSize:i.referenceSize}}p(Te,"applyRetention");function He(e){return Te(e,{maxArchive:be,maxDelete:_e})}p(He,"applyRetentionIncremental");function Ge(e,t={}){let o=t.max??50,r=t.types??["inbox","context","idea","todo","question","gotcha","spec"],n=[],a=[];try{let i=x.allEntriesForIndex(e);for(let c of i){if(n.length>=o)break;if(!r.includes(c.type))continue;let l=I(c.content,c.type),u=L(c.content,c.type);(l.junk||u.action==="refuse"||c.type==="gotcha"&&u.action==="demote")&&v(e,c.id)&&(n.push(c),a.length<8&&a.push(`${c.id}:${l.junk?l.reason:u.reasonCode}`))}}catch{return{forgotten:0,samples:[]}}return{forgotten:n.length,samples:a}}p(Ge,"forgetJunkCaptures");function ze(e,t=Date.now()){let r=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(r.length===0)return{merged:0,archived:0,junkForgotten:0};let n=r.filter(s=>I(s.content,s.type).junk&&v(e,s.id)).length,a=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(a.length===0)return{merged:0,archived:0,junkForgotten:n};let i=S(x.allEntriesForIndex(e)),c=C(i),l=X(e,t),u=[],h=[];for(let s of a){let f=T(s.content,c);if(f.exactDup||f.nearDup||f.excess<.15){v(e,s.id)&&u.push(s.id);continue}let m=l.byId.get(s.id);if(m&&m.verdict!=="active"){try{A.archive(e,{entityType:"memory_entry",entityId:s.id,entityData:{id:s.id,type:"inbox",score:m.score,excess:m.excess,reasons:m.reasons},summary:`inbox triage excess=${m.excess?.toFixed(2)??"?"}`,reason:"retention-inbox"})}catch{}v(e,s.id)&&h.push(s.id)}}return{merged:u.length,archived:h.length,junkForgotten:n}}p(ze,"triageInbox");export{te as CAPTURE_MIN_EXCESS,H as DEFAULT_SOFT_DELETED_PURGE_DAYS,ee as NEAR_DUP_SIM,W as PROTECTED_TYPES,Z as REFERENCE_CAP,Te as applyRetention,He as applyRetentionIncremental,S as buildReferenceModel,re as captureGate,Se as collectDuplicateIds,Ae as collectRetentionInputs,ne as computeExcess,X as evaluateRetention,Ge as forgetJunkCaptures,Ce as forgetShippedFeature,G as isAutoSource,j as isReferenceEligible,N as isRetentionRemovableId,J as purgeOrphanRememberEvents,z as purgeSoftDeleted,Q as runVaultPurge,Ie as scoreEntry,Be as shouldEmbedEntry,ze as triageInbox,q as trimAutoSourceCap,K as vaultHealth};
@@ -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,b,c,d,e}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import"./chunk-GPZP7NXL.mjs";import"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as buildProjectIdentityLine,a as buildSessionContext,b as buildSubagentDigest,d as consumeKimiSessionInjection,e as runSessionStartHook};
@@ -1,9 +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 r}from"./chunk-E66B27AL.mjs";import{existsSync as S}from"node:fs";import k from"node:fs/promises";import O from"node:os";import l from"node:path";function f(){let t=process.env.HOME||O.homedir();return l.join(t,".claude","settings.json")}r(f,"settingsPath");var p="_prjctManaged",j=10,g=[{event:"SessionStart",matcher:"",subcommand:"session-start"},{event:"UserPromptSubmit",matcher:"",subcommand:"prompt"},{event:"PreToolUse",matcher:"Bash",subcommand:"pre-bash"},{event:"PreToolUse",matcher:"Edit|Write",subcommand:"pre-edit"},{event:"PreToolUse",matcher:"Grep|Glob",subcommand:"pre-search"},{event:"PostToolUse",matcher:"Edit|Write",subcommand:"post-edit"},{event:"Stop",matcher:"",subcommand:"stop"},{event:"SubagentStart",matcher:"",subcommand:"subagent-start"},{event:"SubagentStop",matcher:"",subcommand:"subagent-stop"},{event:"Notification",matcher:"",subcommand:"notification"},{event:"CwdChanged",matcher:"",subcommand:"cwd-changed"}];function y(t){let e=t.command?.match(/\bhook\s+(\S+)/);return e?e[1]:null}r(y,"subcommandOf");function w(t){let e=new Set(g.map(s=>s.subcommand)),o=[];for(let s of Object.keys(t)){let c=t[s],n=[];for(let a of c)a.hooks=a.hooks.filter(m=>{if(!d(m))return!0;let u=y(m);return u&&!e.has(u)?(o.push(m),!1):!0}),a.hooks.length>0&&n.push(a);n.length>0?t[s]=n:delete t[s]}return o.length}r(w,"pruneOrphanedManagedHooks");async function b(){try{let t=await k.readFile(f(),"utf-8"),e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch(t){if(t.code==="ENOENT")return{};throw t}}r(b,"readSettings");async function P(t){await k.mkdir(l.dirname(f()),{recursive:!0}),await k.writeFile(f(),`${JSON.stringify(t,null,2)}
9
- `,"utf-8")}r(P,"writeSettings");function x(){if(process.platform==="win32")return null;let t=process.execPath;if(!t)return null;let e=__dirname,o=[l.join(e,"prjct.mjs"),l.resolve(e,"..","prjct.mjs"),l.resolve(e,"..","..","dist","bin","prjct.mjs")].find(c=>S(c));return o?`${l.basename(t).includes("bun")?"":'NODE_OPTIONS="--experimental-sqlite${NODE_OPTIONS:+ $NODE_OPTIONS}" '}"${t}" "${o}"`:null}r(x,"directHookPrefix");function R(){if(process.platform==="win32")return null;let t=__dirname,e=`hook-fast-${process.platform}-${process.arch}`;return[l.join(t,e),l.resolve(t,"..",e),l.resolve(t,"..","..","dist","bin",e)].find(o=>S(o))??null}r(R,"nativeHookFastBinary");function $(t){let e=process.env.PRJCT_BIN??"prjct",o=`command -v ${e} >/dev/null 2>&1 && ${e} hook ${t} || exit 0`;if(process.env.PRJCT_BIN)return o;let s=x();if(!s)return o;let c=`${s} hook ${t}`,n=R();return`${n?`"${n}" ${t} || ${c}`:c} || { ${o.replace(" || exit 0","")}; } || exit 0`}r($,"hookCommand");function d(t){return t[p]===!0}r(d,"isPrjctHook");function N(t){if(t[p]===!0)return!1;let e=t.command?.trim()??"";return/(^|\/|\s)prjct\s+hook\s+\S+/.test(e)}r(N,"isLegacyPrjctHook");function v(t){let e={type:"command",command:$(t.subcommand),timeout:j,[p]:!0},o="ifClause"in t?t.ifClause:void 0;return typeof o=="string"&&o&&(e.if=o),e}r(v,"hookEntryFor");async function F(){let t=await b(),e=t.hooks??{},o=[],s=[];for(let n of g){let a=e[n.event]??[],m=a.find(i=>(i.matcher??"")===n.matcher),u=m??{matcher:n.matcher,hooks:[]};m||a.push(u);let H=u.hooks.length;u.hooks=u.hooks.filter(i=>!N(i));let E=H-u.hooks.length,h=u.hooks.find(i=>d(i)&&y(i)===n.subcommand);if(h){let i=v(n);h.command===i.command&&h.if===i.if&&h.timeout===i.timeout&&E===0?s.push(n):(h.command=i.command,h.if=i.if,h.timeout=i.timeout,o.push(n))}else u.hooks.push(v(n)),o.push(n);e[n.event]=a}let c=w(e);return t.hooks=e,await P(t),{settingsPath:f(),hooksWritten:o.length,alreadyPresent:s.length,hooksPruned:c}}r(F,"install");async function I(){let t=await b();if(!t.hooks)return{settingsPath:f(),hooksRemoved:0};let e=[];for(let[o,s]of Object.entries(t.hooks)){let c=[];for(let n of s){let a=n.hooks.filter(m=>d(m)?(e.push(m),!1):!0);a.length>0&&c.push({...n,hooks:a})}c.length>0?t.hooks[o]=c:delete t.hooks[o]}return Object.keys(t.hooks).length===0&&delete t.hooks,await P(t),{settingsPath:f(),hooksRemoved:e.length}}r(I,"uninstall");async function U(){let e=(await b()).hooks??{};return{installed:Object.values(e).flat().flatMap(s=>s.hooks).filter(d).length,expected:g.length}}r(U,"status");export{j as HOOK_TIMEOUT_SECONDS,g as PRJCT_HOOKS,F as install,U as status,I as uninstall};
@@ -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 ue,b as T,d as W}from"./chunk-32RX4YGI.mjs";import{a as L}from"./chunk-BDOAQVIF.mjs";import{b as ae}from"./chunk-QBYHZX33.mjs";import{a as ce}from"./chunk-GPZP7NXL.mjs";import{b as q}from"./chunk-2UC4DTDO.mjs";import{a as J}from"./chunk-PGWFGRX4.mjs";import{a as ie,b as oe}from"./chunk-TRMBRDKH.mjs";import"./chunk-TPESWBA7.mjs";import{b as se}from"./chunk-FEFP6JOL.mjs";import{c as M}from"./chunk-4HAKTI36.mjs";import{c as re}from"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import{a as m}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import{g as at,h as ct}from"./chunk-UUULLTQV.mjs";import{a as ne,c as G}from"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import{b as Y}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as v}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{a as te,b as it,e as b,f as ot,g as B}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as Q,h as tt,v as ee,w as st}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import{b as U,c as rt}from"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as Z,o as nt}from"./chunk-UH4MD3F3.mjs";import{e as A,g as P,l as C,p as V}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a,b as K,e as z}from"./chunk-E66B27AL.mjs";import S from"node:fs/promises";import Qe from"node:path";import ut from"node:crypto";import lt from"node:fs/promises";function D(n){return typeof n=="string"?n:Array.isArray(n)?n.map(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"&&"text"in t){let e=t.text;return typeof e=="string"?e:""}return""}).join(`
9
- `).trim():""}a(D,"textOf");function I(n){try{let t=K("node:fs"),s=K("node:path").join(n,".prjct","prjct.config.json"),r=t.readFileSync(s,"utf-8");return JSON.parse(r).projectId??null}catch{return null}}a(I,"projectIdFromPath");var fe="friction-detector",le="friction-promote",pe=5,de=400,ge=160,pt=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],dt=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],ft=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function me(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await lt.readFile(t,"utf-8").then(gt).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=mt(r);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,pe).map(l=>({category:l.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${l.category}.`,relatedRuleId:null})),u=kt(n),c=I(n)??void 0;return{...await i.slice(0,pe).reduce(async(l,f)=>{let d=await l,y=ye(f.excerpt).slice(0,12);if(u.has(y))return await wt(n,c,f).catch(()=>{}),{...d,signalsSkipped:d.signalsSkipped+1};try{return await m.remember(n,{type:"improvement-signal",content:yt(f),tags:{source:fe,category:f.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...e?{session:e}:{},key:y},provenance:"extracted",projectId:c}),u.add(y),{...d,signalsRecorded:d.signalsRecorded+1}}catch{return{...d,signalsSkipped:d.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}a(me,"detectFriction");function gt(n){return T(n)}a(gt,"parseJsonl");function mt(n){let t={signals:[],lastAssistantText:""};for(let e of n){let s=e.role??e.message?.role,r=D(e.content??e.message?.content);if(!r)continue;if(s==="assistant"){t.lastAssistantText=r;continue}if(s!=="user")continue;let i=ht(r.slice(0,300));i&&t.signals.push({excerpt:r.slice(0,de).trim(),category:i,precedingAssistantPreview:t.lastAssistantText.slice(0,de).trim()})}return t.signals}a(mt,"extractSignals");function ht(n){return ft.some(t=>t.test(n))?"complaint":pt.some(t=>t.test(n))?"negation":dt.some(t=>t.test(n))?"correction":null}a(ht,"classify");function yt(n){let t=bt(n.category),e=he(n.excerpt),s=e?`Obey developer constraint: ${e}`:t.lesson,r=e?`Always: ${e}`:t.nextAction;return[`[${n.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${t.why}`,`Pattern: ${t.pattern}`,`Anti-pattern: ${t.antiPattern}`,`Next action: ${r}`].join(`
10
- `)}a(yt,"formatSignal");function he(n){let t=n.replace(/\s+/g," ").trim();if(!t)return null;let e=t.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=e.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return E(`Prefer ${s[1]}`);let r=e.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(r?.[1]&&r[2])return E(`Prefer ${r[1].trim()} rather than ${r[2].trim()}`);let i=e.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let p=i[2]?` instead of ${i[2].trim()}`:" instead";return E(`Use ${i[1].trim()}${p}`)}let o=e.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return E(`Avoid ${o[1].trim()}`);let u=e.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(u?.[1])return E(`Never ${u[1].trim()}`);let c=e.match(/\balways\s+(.+?)$/i);if(c?.[1])return E(`Always ${c[1].trim()}`);if(e.length>=12&&e.length<=ge&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(e)){let p=e.charAt(0).toUpperCase()+e.slice(1);return E(p.replace(/[.!?]+$/,""))}return null}a(he,"extractSpecificConstraint");function E(n){let t=n.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,ge);return t.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(t)?null:t}a(E,"cleanConstraint");async function wt(n,t,e){if(!t)return;let s=he(e.excerpt);if(!s)return;let r=`Always: ${s}`,i=`fp:${ye(s).slice(0,12)}`;try{if(m.recall(t,{types:["feedback"],tags:{source:le,key:i},limit:1,dedupeByKey:!1}).length>0)return;await m.remember(n,{type:"feedback",content:r,tags:{source:le,key:i,category:e.category,from:"recurring-friction"},provenance:"extracted",projectId:t})}catch{}}a(wt,"maybePromoteStandingPreference");function bt(n){return n==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:n==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}a(bt,"lessonTemplate");function ye(n){let t=n.toLowerCase().replace(/\s+/g," ").trim();return ut.createHash("sha256").update(t).digest("hex")}a(ye,"hashSignal");function kt(n){try{let t=I(n);if(!t)return new Set;let e=m.recall(t,{types:["improvement-signal"],tags:{source:fe},limit:100,dedupeByKey:!1}),s=new Set;for(let r of e){let i=r.tags.key;i&&s.add(i)}return s}catch{return new Set}}a(kt,"projectMemoryHashes");var St=32;function we(n={}){let e=(n.hookHost===void 0?process.env.PRJCT_HOOK_HOST:n.hookHost)?.trim().toLowerCase().slice(0,St);return e&&ie.has(e)?e:n.detectedRuntime??oe()}a(we,"resolveInstructionRuntime");V();function be(n){try{return JSON.parse(n)}catch{return null}}a(be,"safeJsonParse");function k(n,t,e,s){let r=[];try{let{prjctDb:i}=(B(),z(ot)),o=i.query(n,t,...e);for(let u of o){let c=be(u.data);if(!c||typeof c!="object")continue;let p=c.tags;if(!p)continue;let l=s(p,c);l!==void 0&&r.push(l)}}catch{}return r}a(k,"collectFromPersistedEvents");var Se="lean-detector",vt="lean-debt-growth",Tt=3,ke=["off","lite","full","ultra"];function Rt(n){let t=n?.lean?.mode;if(t&&ke.includes(t))return t;let e=process.env.PRJCT_LEAN_MODE?.toLowerCase();return e&&ke.includes(e)?e:"off"}a(Rt,"effectiveMode");async function ve(n,t){let e={active:!1,total:0,previous:0,persisted:!1},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId||Rt(s)==="off")return e;e.active=!0;try{let r=await Et(n);if(e.total=r,r===0)return e;let i=_t(s.projectId);e.previous=i;let o=r-i;i>0&&o>=Tt&&(await m.remember(n,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${r}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:Se,pattern:vt,total:String(r),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),e.persisted=!0)}catch{}return e}a(ve,"detectAndPersistLeanDebt");async function Et(n){let t=await A(["grep","-cI","-e","lean:"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(P(t,1))return 0;C(t)}return t.stdout.split(`
11
- `).reduce((e,s)=>{let r=s.lastIndexOf(":");if(r<=0)return e;let i=Number.parseInt(s.slice(r+1),10);return Number.isFinite(i)?e+i:e},0)}a(Et,"measureLeanMarkers");function _t(n){return k(n,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==Se)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(_t,"collectPreviousSnapshot");import At from"node:path";V();var Ct="hot-file",Te="pattern-detector-auto",It="recurring-bug",Re="pattern-detector-recurring",xt="tech-debt-growth",Ee="pattern-detector-debt",O=7,Pt=3,N=30,Mt=2,Lt=5,Dt=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function _e(n,t){let e={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId)return e.errors.push("no project config"),e;try{let r=await Ot(n);if(e.scanned+=r.length,e.hotFiles=r,r.length>0){let i=jt(s.projectId);for(let o of r){if(i.has(o.path)){e.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await m.remember(n,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${O} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:Te,pattern:Ct,file:o.path,touches:String(o.touches),window_days:String(O)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for ${o.path}: ${u.message}`)}}}}catch(r){e.errors.push(`hot-file detection failed: ${r.message}`)}try{let r=$t(s.projectId);if(r.length>0){let i=Ut(s.projectId);for(let o of r){if(i.has(o.topic)){e.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await m.remember(n,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${N} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:Re,pattern:It,topic:o.topic,occurrences:String(o.occurrences),window_days:String(N)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for recurring ${o.topic}: ${u.message}`)}}}}catch(r){e.errors.push(`recurring-bug detection failed: ${r.message}`)}try{let r=await Ht(n);if(r.totalCount>0){let i=Ft(s.projectId),o=r.totalCount-i;if(i>0&&o>=Lt)try{await m.remember(n,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${r.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:Ee,pattern:xt,total:String(r.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),e.persisted+=1}catch(u){e.errors.push(`remember failed for tech-debt: ${u.message}`)}}}catch(r){e.errors.push(`tech-debt detection failed: ${r.message}`)}return e}a(_e,"detectAndPersistPatterns");async function Ot(n){let t=await A(["log",`--since=${O}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:n,maxBuffer:16777216,timeoutMs:15e3});if(!t.ok){if(t.kind==="exit")return[];C(t)}let e=new Map;for(let r of t.stdout.split("\0")){let i=r.trim();i&&(Nt(i)||e.set(i,(e.get(i)??0)+1))}let s=[];for(let[r,i]of e)i<Pt||s.push({path:r,touches:i});return s.sort((r,i)=>i.touches-r.touches),s}a(Ot,"detectHotFiles");function Nt(n){let t=At.basename(n);for(let e of Dt)if(e.test(n)||e.test(t))return!0;return!1}a(Nt,"isIgnored");function $t(n){let t=new Date(Date.now()-N*24*60*60*1e3).toISOString(),e=k(n,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",[t],i=>{if(i.source==="transcript-auto")return;let o=typeof i.topic=="string"?i.topic:void 0,u=typeof i.area=="string"?i.area:void 0;return(o??u)||void 0}),s=new Map;for(let i of e)s.set(i,(s.get(i)??0)+1);let r=[];for(let[i,o]of s)o<Mt||r.push({topic:i,occurrences:o});return r.sort((i,o)=>o.occurrences-i.occurrences),r}a($t,"detectRecurringBugs");async function Ht(n){let t=await A(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(P(t,1))return{totalCount:0};C(t)}return{totalCount:t.stdout.split(`
12
- `).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}a(Ht,"measureTechDebt");function Ft(n){return k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==Ee)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(Ft,"collectPreviousDebtSnapshot");function jt(n){let t=Date.now()-O*24*60*60*1e3,e=k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Te)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let u=Date.parse(o);if(!Number.isNaN(u)&&u<t)return}return i}});return new Set(e)}a(jt,"collectAlreadyMarkedHotFiles");function Ut(n){let t=Date.now()-N*24*60*60*1e3,e=k(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Re)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let u=Date.parse(o);if(!Number.isNaN(u)&&u<t)return}return i}});return new Set(e)}a(Ut,"collectAlreadyMarkedRecurringBugs");st();it();import x from"node:fs/promises";import Ae from"node:path";B();var Bt={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Gt(n=process.env){let t=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Bt[t==="conservative"||t==="standard"||t==="aggressive"?t:"standard"]}a(Gt,"resolveProfile");async function Jt(n,t){let e=Date.now()-t*24*60*60*1e3,r=m.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<e);if(r.length===0)return 0;let i=[];for(let o of r)try{G.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${t}d)`});let u=o.id.startsWith("mem_")?o.id.slice(4):null;u&&b.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(u)),b.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}a(Jt,"archiveAgedInbox");async function Wt(n,t){if(t===null)return 0;let e=Ae.join(ee.getGlobalProjectPath(n),"checkpoints"),s=await x.readdir(e).catch(()=>null);if(!s)return 0;let r=Date.now()-t*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let u=Ae.join(e,o);try{(await x.stat(u)).mtimeMs<r&&(await x.unlink(u),i.push(u))}catch{}}return i.length}a(Wt,"pruneOldCheckpoints");async function Xt(){let{getVerifyCachePath:n}=await import("./context7-service-GDJ3QICX.mjs"),t=n();try{let e=await x.stat(t);if((Date.now()-e.mtimeMs)/(1440*60*1e3)>7)return await x.unlink(t),!0}catch{}return!1}a(Xt,"rotateContext7Cache");async function Ce(n){let t=Gt(),e={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1};try{e.inboxArchived=await Jt(n,t.inboxDays)}catch{}try{e.archivesPruned=G.pruneOldArchives(n,t.archivesDays)}catch{}try{e.checkpointsRemoved=await Wt(n,t.checkpointsDays)}catch{}try{e.context7CacheRotated=await Xt()}catch{}return e}a(Ce,"runSessionCleanup");async function Ie(n,t){if(t.inboxArchived+t.archivesPruned+t.checkpointsRemoved+(t.context7CacheRotated?1:0)===0)return;let r=`Session cleanup: ${[t.inboxArchived>0?`${t.inboxArchived} inbox archived`:null,t.archivesPruned>0?`${t.archivesPruned} archives pruned`:null,t.checkpointsRemoved>0?`${t.checkpointsRemoved} checkpoints removed`:null,t.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;b.appendEvent(n,"memory.remember.system-event",{content:r,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:te(r),project_id:n})}a(Ie,"recordCleanupReport");import Kt from"node:crypto";import zt from"node:fs/promises";import{z as w}from"zod";tt();B();var Pe="crew-run:",xe=w.object({id:w.string().min(1),spec_id:w.string().nullable().default(null),task_id:w.string().nullable().default(null),started_at:w.string().min(1),ended_at:w.string().min(1),implementer_summary:w.string().default(""),files_touched:w.array(w.string()).default([]),reviewer_verdict:w.enum(["APPROVED","CHANGES_REQUESTED"]),reviewer_notes:w.string().nullable().default(null)});function $(n){return`${Pe}${n}`}a($,"keyFor");var X=class{static{a(this,"CrewRunStorage")}record(t,e){let s=e.runId??ne(),r=b.getDoc(t,$(s));if(r)return r;let i=Q(),o=xe.parse({id:s,spec_id:e.specId??null,task_id:e.taskId??null,started_at:e.startedAt??i,ended_at:e.endedAt??i,implementer_summary:e.implementerSummary,files_touched:e.filesTouched,reviewer_verdict:e.reviewerVerdict,reviewer_notes:e.reviewerNotes??null});return b.setDoc(t,$(s),o),o}get(t,e){return b.getDoc(t,$(e))}list(t){return b.listDocsByPrefix(t,Pe).map(s=>xe.parse(s.data))}delete(t,e){b.deleteDoc(t,$(e))}},Me=new X;var Ne="skill-miss-detector",Le=3,Yt=280,qt=["decision","gotcha","anti-pattern"],Vt=5400*1e3,Qt=360*60*1e3,Zt=2,$e=5,en=8,He=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function Fe(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await zt.readFile(t,"utf-8").then(nn).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=I(n);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=rn(r);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let u=(()=>{try{return cn(i,e)}catch{return null}})();if(!u)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(u.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let c=await se(n).catch(()=>[]),p=(()=>{try{let h=Date.now()-Qt;return new Set(Me.list(i).filter(g=>Date.parse(g.ended_at)>h).flatMap(g=>g.files_touched))}catch{return new Set}})(),l=tn(o,c,u,p);if(l.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let f=un(i),d=[];for(let h of l.slice(0,Le)){let g=an(h.memId,h.excerpt).slice(0,12);if(f.has(g)){d.push("skipped");continue}try{await m.remember(n,{type:"improvement-signal",content:on(h),tags:{source:Ne,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:h.memId,file:h.evidenceFile,key:g,...e?{session:e}:{}},provenance:"extracted",projectId:i}),M.penalizeSkillMiss(i,h.memId),d.push("recorded")}catch{d.push("skipped")}}let y=d.filter(h=>h==="recorded").length,R=d.filter(h=>h==="skipped").length;return{signalsRecorded:y,signalsSkipped:R,failures:l.slice(0,Le).map(h=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${h.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:h.memId}))}}a(Fe,"detectSkillMisses");function tn(n,t,e,s=new Set){let r=De(n);if(r.size===0)return[];let i=t.filter(c=>!s.has(c)),o=H(i),u=[];for(let c of e){let p=De(`${c.content} ${c.fileTag}`);if(p.size===0)continue;let l=c.fileTag!==""&&i.some(g=>Oe(g,c.fileTag))||[...o].some(g=>p.has(g)),f=sn(p),d=[...p].filter(g=>!f.has(g)&&r.has(g)).length;if(!(l||d>=Zt)||[...f].some(g=>r.has(g)))continue;let h=c.fileTag!==""&&i.some(g=>Oe(g,c.fileTag))?c.fileTag:i.find(g=>[...H([g])].some(et=>p.has(et)))??"";u.push({miss:{memId:c.id,memType:c.type,excerpt:c.content.replace(/\s+/g," ").trim().slice(0,Yt),evidenceFile:h,reason:l?"path-overlap-unused":"topic-overlap-unused"},rank:l?2:1,overlap:d})}return u.sort((c,p)=>p.rank-c.rank||p.overlap-c.overlap),u.map(c=>c.miss)}a(tn,"analyze");function nn(n){return T(n)}a(nn,"parseJsonl");function rn(n){let t=[];for(let e of n){let s=e.role??e.message?.role;if(s!=="user"&&s!=="assistant")continue;let r=D(e.content??e.message?.content);r&&t.push(r)}return t.join(`
13
- `).toLowerCase()}a(rn,"transcriptTextOf");function De(n){let t=new Set;for(let e of n.toLowerCase().split(/[^a-z0-9]+/))e.length<$e||He.has(e)||t.add(e);return t}a(De,"tokenize");function sn(n){let t=[...n].filter(s=>s.length>=en);if(t.length>0)return new Set(t);let e=[...n].sort((s,r)=>r.length-s.length||s.localeCompare(r))[0]??"";return e?new Set([e]):new Set}a(sn,"signatureOf");function H(n){let t=new Set;for(let e of n)for(let s of e.split("/")){let r=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();r.length>=$e&&!He.has(r)&&t.add(r)}return t}a(H,"fileStems");function Oe(n,t){let e=H([n]);for(let s of H([t]))if(e.has(s))return!0;return!1}a(Oe,"sharesStem");function on(n){let t=n.evidenceFile!==""?`touched \`${n.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${n.memType}, ${n.memId}): "${n.excerpt}"`,`This session ${t} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${n.memId}`].join(`
14
- `)}a(on,"formatSkillMiss");function an(n,t){let e=`${n}::${t.toLowerCase().replace(/\s+/g," ").trim()}`;return Kt.createHash("sha256").update(e).digest("hex")}a(an,"hashKey");function cn(n,t){let e=m.recall(n,{types:[...qt],limit:120}),s=Date.now()-Vt,r=[];for(let i of e)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||t&&i.tags.session===t||r.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return r}a(cn,"recallCandidates");function un(n){try{let t=m.recall(n,{types:["improvement-signal"],tags:{source:Ne},limit:100,dedupeByKey:!1}),e=new Set;for(let s of t)s.tags.key&&e.add(s.tags.key);return e}catch{return new Set}}a(un,"existingSkillMissKeys");import ln from"node:crypto";import pn from"node:fs/promises";var Be="transcript-auto",dn="v2",Ge=80,Je=20,F=1500,fn=12,je=4,gn=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],We=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function Xe(n,t,e,s={}){let r={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await v.readConfig(n).catch(()=>null);if(!i?.projectId)return r.errors.push("no project config"),r;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return T(await pn.readFile(t,"utf-8"))}catch(d){return r.errors.push(`transcript read failed: ${d.message}`),null}})();if(o===null)return r;let u=mn(o),c=hn(o);if(r.scanned=u.length+c.length,u.length===0&&c.length===0)return r;let p=[...kn(u),...wn(c)];if(p.length===0)return r;let l=vn(i.projectId),f=e?e.slice(0,12):"unknown";for(let d of p){if(l.has(d.hash)){r.skipped.push({reason:"duplicate",phrase:d.matchedPhrase});continue}try{await m.remember(n,{type:d.type,content:d.content,tags:{source:Be,capture:dn,session:f,hash:d.hash,phrase:d.matchedPhrase},provenance:"inferred",projectId:i.projectId}),r.ingested+=1}catch(y){r.errors.push(`remember failed: ${y.message}`)}}return r}a(Xe,"ingestTranscript");function mn(n){let t=[];for(let e of n){let s=Ke(e);if(s!=="assistant")continue;let r=ze(e);!r||r.length<Ge||t.push({role:s,text:r})}return t}a(mn,"projectMessages");function hn(n){let t=[];for(let e of n){let s=Ke(e);if(s!=="user")continue;let r=ze(e);!r||r.length<Je||t.push({role:s,text:r})}return t}a(hn,"projectUserMessages");var yn=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function wn(n){let t=[],e=new Set;for(let s of n){if(t.length>=je)break;let r=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=Je),i=r.length>0?r:[s.text.trim()];for(let o of i){if(t.length>=je)break;let u=yn.find(l=>l.re.test(o));if(!u)continue;let c=o.length>F?`${o.slice(0,F)}\u2026`:o,p=Ye(c);e.has(p)||(e.add(p),t.push({type:"feedback",content:c,hash:p,matchedPhrase:u.phrase}))}}return t}a(wn,"extractUserPreferenceCandidates");function Ke(n){let t=n.role;if(typeof t=="string")return Ue(t);let e=n.message;if(e&&typeof e=="object"&&"role"in e){let r=e.role;if(typeof r=="string")return Ue(r)}let s=n.type;return s==="assistant"||s==="user"||s==="system"?s:null}a(Ke,"inferRole");function Ue(n){let t=n.toLowerCase();return t==="assistant"||t==="user"||t==="system"?t:null}a(Ue,"normalizeRole");function ze(n){let t=n.content===void 0&&n.message&&typeof n.message=="object"?n.message.content:n.content;if(typeof t=="string")return t.trim();if(Array.isArray(t)){let e=[];for(let s of t){if(!s||typeof s!="object")continue;let r=s;r.type==="text"&&typeof r.text=="string"&&e.push(r.text)}return e.join(`
15
- `).trim()}return""}a(ze,"extractText");function bn(n){let t=n.trim();if(t.length<Ge)return null;for(let r of We)if(r.re.test(t))return{type:r.type,matchedPhrase:r.phrase};let e=t.toLowerCase(),s=gn.find(r=>e.includes(r.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}a(bn,"classifyCaptureParagraph");function kn(n){let t=[],e=new Set;for(let s of n){let r=Sn(s.text);for(let i of r){if(t.length>=fn)return t;let o=bn(i);if(!o)continue;let u=i.length>F?`${i.slice(0,F)}\u2026`:i,c=Ye(u);e.has(c)||(e.add(c),t.push({type:o.type,content:u,hash:c,matchedPhrase:o.matchedPhrase}))}}return t}a(kn,"extractCandidates");function Sn(n){let t=n.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),e=[];for(let s of t){let r=s.split(`
16
- `).map(o=>o.trim()).filter(Boolean);if(r.some(o=>We.some(u=>u.re.test(o)))&&r.length>1)for(let o of r)e.push(o);else e.push(s)}return e}a(Sn,"splitParagraphs");function Ye(n){return ln.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}a(Ye,"hashContent");function vn(n){try{let{REMEMBER_EVENT_RANGE:t}=(ct(),z(at)),e=k(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...t],s=>{if(s.source!==Be)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(e)}catch{return new Set}}a(vn,"collectExistingAutoHashes");rt();nt();import Tn from"node:fs/promises";import qe from"node:path";function Rn(){return process.env.PRJCT_TEST_MODE==="1"?qe.join(U(".prjct-tests"),"kimi-code","sessions"):U(".kimi-code","sessions")}a(Rn,"getKimiSessionsRoot");async function Ve(n,t=Rn()){let e=n.replace(/[^a-zA-Z0-9_-]/g,"");if(!e)return;let s=e.startsWith("session_")?[e]:[e,`session_${e}`],r=await Tn.readdir(t,{withFileTypes:!0}).catch(()=>[]);for(let i of r)if(i.isDirectory())for(let o of s){let u=qe.join(t,i.name,o,"agents","main","wire.jsonl");if(await Z(u))return u}}a(Ve,"resolveKimiTranscriptPath");var j=600*1e3,_=new Map;function En(n){let t=n.replace(/[^a-zA-Z0-9._-]/g,"_");return Qe.join(q.runDir(),`stop-heavy-${t}.stamp`)}a(En,"heavyStepStampPath");async function Ze(n,t,e=!0){if(await S.stat(n).then(i=>t-i.mtimeMs<j).catch(()=>!1))return!1;let r=`${n}.lock`;try{await S.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await S.stat(r).then(u=>t-u.mtimeMs>=j).catch(()=>!1)||!e?!1:(await S.rmdir(r).catch(()=>{}),Ze(n,t,!1))}try{return await S.stat(n).then(o=>t-o.mtimeMs<j).catch(()=>!1)?!1:(await S.writeFile(n,String(t)),!0)}finally{await S.rmdir(r).catch(()=>{})}}a(Ze,"claimHeavyStep");async function _n(n){let t=Date.now(),e=_.get(n)??0;if(t-e<j)return!1;try{let s=En(n);await S.mkdir(Qe.dirname(s),{recursive:!0});let r=await Ze(s,t);return _.size>32&&_.clear(),_.set(n,t),r}catch{}return _.size>32&&_.clear(),_.set(n,t),!0}a(_n,"heavyStepsDue");function cs(n=process.cwd(),t){return ce({event:"Stop",projectPath:n,afterEmit:a(async(e,s)=>{let r=await v.readConfig(s).catch(()=>null);if(!r?.projectId)return;let i=we(),o=e.transcript_path??(Y()==="kimi"&&e.session_id?await Ve(e.session_id).catch(()=>{}):void 0),u=await _n(r.projectId),c={};if(u&&o){let l=await S.readFile(o,"utf-8").catch(()=>null);l!==null&&(c.transcriptLines=T(l))}let p=ue(c.transcriptLines??[]);if(u)try{let{collectActiveTasks:l}=await import("./task-overview-PCUZWL5Q.mjs"),f=await l(r.projectId,s);c.activeTaskId=f.current?.id,c.activeTaskDescription=f.current?.description,c.activeTaskStartedAt=f.current?.startedAt}catch{}if(c.transcriptLines&&c.transcriptLines.length>0)try{if(c.transcriptUsage=W(c.transcriptLines),c.transcriptUsage.tokensIn+c.transcriptUsage.tokensOut>0){let l=c.activeTaskStartedAt?{sinceIso:c.activeTaskStartedAt}:void 0,f=W(c.transcriptLines,l);if(c.activeTaskId&&f.tokensIn+f.tokensOut>0){J(r.projectId,c.activeTaskId,f.tokensIn,f.tokensOut,{description:c.activeTaskDescription,agent:i,source:`${i}-transcript`});try{let{sumTranscriptUsageByModel:d}=await import("./transcript-jsonl-7W2NOJPZ.mjs");for(let[y,R]of d(c.transcriptLines,l))R.tokensIn+R.tokensOut<=0||J(r.projectId,c.activeTaskId,R.tokensIn,R.tokensOut,{model:y,agent:i,source:`${i}-transcript:${y}`})}catch{}}}}catch{}if(ae({projectId:r.projectId,sessionId:e.session_id,directory:s,taskId:c.activeTaskId,goal:c.activeTaskDescription,tokensIn:c.transcriptUsage?.tokensIn,tokensOut:c.transcriptUsage?.tokensOut,agent:i,model:p}),u&&o)try{await Xe(s,o,e.session_id??null,{preloadedConfig:r,preloadedLines:c.transcriptLines})}catch{}if(u){try{await _e(s,r)}catch{}try{await ve(s,r)}catch{}try{let l=await Ce(r.projectId);await Ie(r.projectId,l),L.pruneRetained(r.projectId)}catch{}}if(u&&o)try{let l=await me(s,o,e.session_id??null,{preloadedLines:c.transcriptLines,runtime:i,model:p});for(let f of l.failures)try{L.record(r.projectId,{source:"friction-detector",runtime:i,model:p,sessionId:e.session_id??null,taskId:c.activeTaskId??null,...f})}catch{}l.signalsRecorded>0&&c.activeTaskId&&M.penalizeSurfaced(r.projectId,c.activeTaskId)}catch{}if(u&&o)try{let l=await Fe(s,o,e.session_id??null,{preloadedLines:c.transcriptLines,runtime:i,model:p});for(let f of l.failures)try{L.record(r.projectId,{source:"skill-miss-detector",runtime:i,model:p,sessionId:e.session_id??null,taskId:c.activeTaskId??null,...f})}catch{}}catch{}if(u)try{await re.backfill(r.projectId,r,new Date().toISOString())}catch{}if(u&&c.activeTaskId){let l={projectId:r.projectId,projectPath:s,cycleDescription:c.activeTaskDescription??null,cycleId:c.activeTaskId,tokensIn:c.transcriptUsage?.tokensIn,tokensOut:c.transcriptUsage?.tokensOut,model:p},f=a(async d=>{try{await d()}catch{}},"runBestEffort");await f(async()=>{let{synthesizeLandHandoff:d}=await import("./land-synthesis-JLYUBKHR.mjs");await d(l)}),await f(async()=>{let{synthesizeJudgmentReceipt:d}=await import("./judgment-receipt-7A2DXVJA.mjs");await d(l)})}try{let{flushIfLinked:l}=await import("./auto-flush-CXWTU3RF.mjs");await l(s,r)}catch{}},"afterEmit")},t)}a(cs,"runStopHook");export{En as heavyStepStampPath,_n as heavyStepsDue,cs as runStopHook};
@@ -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 a}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import{a as i}from"./chunk-GPZP7NXL.mjs";import"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{d as e,g as m}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-PCUZWL5Q.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
@@ -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 a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-FXFG6PV6.mjs";import"./chunk-WGWE3CSC.mjs";import"./chunk-KSSRINDX.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-MHNWIB7B.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-GDESYWTD.mjs";import"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-3WQBTXUC.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{e as TASK_CONTEXT_PROMPT,h as completeActiveTask,a as formatRelatedContextForAgent,b as formatRiskForAgent,i as readLastStatus,d as recallRisksForFiles,g as resolveActiveTask,f as setTaskStatus,c as startTask};