prjct-cli 3.96.0 → 3.98.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (511) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-3N2MSSGT.mjs +31 -0
  4. package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
  5. package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
  6. package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
  7. package/dist/bin/core-chunks/agent-switch-4SE6GF7R.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-ZPNNCOH7.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-OARMM4AH.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-XA3V7BJ6.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-FYID6EYI.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-3JJPWIF3.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-G5LGVDME.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-B565WDCA.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-LPJ4GKB6.mjs +10 -0
  19. package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
  20. package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
  21. package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
  22. package/dist/bin/core-chunks/chunk-2FRLIQKX.mjs +10 -0
  23. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  24. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  25. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  26. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  27. package/dist/bin/core-chunks/chunk-2VRS5CUH.mjs +9 -0
  28. package/dist/bin/core-chunks/chunk-2VXPFULA.mjs +7 -0
  29. package/dist/bin/core-chunks/chunk-3OWKIRK6.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
  31. package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
  32. package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
  33. package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
  34. package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
  35. package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
  36. package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
  37. package/dist/bin/core-chunks/chunk-5DZ2LTII.mjs +52 -0
  38. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  39. package/dist/bin/core-chunks/chunk-5OWPZWEU.mjs +13 -0
  40. package/dist/bin/core-chunks/chunk-5TGZSK4C.mjs +10 -0
  41. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  42. package/dist/bin/core-chunks/chunk-5ZBACKED.mjs +14 -0
  43. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  44. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  45. package/dist/bin/core-chunks/chunk-6KNMT46X.mjs +18 -0
  46. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  47. package/dist/bin/core-chunks/chunk-6POAOY5C.mjs +19 -0
  48. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6U3CYLY5.mjs +7 -0
  50. package/dist/bin/core-chunks/chunk-6U3MV7KZ.mjs +15 -0
  51. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  52. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  53. package/dist/bin/core-chunks/chunk-7BU6SJBC.mjs +17 -0
  54. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  56. package/dist/bin/core-chunks/chunk-ACIOJQSI.mjs +14 -0
  57. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  58. package/dist/bin/core-chunks/chunk-ALTQ3KL4.mjs +7 -0
  59. package/dist/bin/core-chunks/chunk-ANBDOI53.mjs +8 -0
  60. package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
  61. package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
  62. package/dist/bin/core-chunks/chunk-B2HY22OD.mjs +50 -0
  63. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  66. package/dist/bin/core-chunks/chunk-BUD3R6LF.mjs +9 -0
  67. package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
  68. package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
  69. package/dist/bin/core-chunks/chunk-CA2VFWFP.mjs +21 -0
  70. package/dist/bin/core-chunks/chunk-CB3CNJTL.mjs +10 -0
  71. package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
  72. package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
  73. package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
  74. package/dist/bin/core-chunks/chunk-CVKMV22J.mjs +17 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXKDKMYE.mjs +9 -0
  77. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  78. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
  79. package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
  80. package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
  81. package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
  82. package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
  83. package/dist/bin/core-chunks/chunk-DTMZBK4E.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DW4QMD6J.mjs +10 -0
  85. package/dist/bin/core-chunks/chunk-DZDEBDAB.mjs +10 -0
  86. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  88. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  89. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  90. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  91. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  92. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  93. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  94. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  95. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-FOUBHU4X.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  98. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  100. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  102. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  103. package/dist/bin/core-chunks/chunk-HA7Y76GF.mjs +7 -0
  104. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  106. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HVXWQ2XZ.mjs +7 -0
  108. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  109. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  110. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  111. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  112. package/dist/bin/core-chunks/chunk-IJNKHQIS.mjs +10 -0
  113. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-J6Y7IVFQ.mjs +7 -0
  116. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  117. package/dist/bin/core-chunks/chunk-JGGQSMZC.mjs +8 -0
  118. package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
  119. package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
  120. package/dist/bin/core-chunks/chunk-KI4OY3UQ.mjs +18 -0
  121. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  123. package/dist/bin/core-chunks/chunk-L3DJN3XD.mjs +12 -0
  124. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  125. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  126. package/dist/bin/core-chunks/chunk-LFOQ7FCR.mjs +10 -0
  127. package/dist/bin/core-chunks/chunk-LGX2GM45.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LTKUTRRL.mjs +7 -0
  129. package/dist/bin/core-chunks/chunk-LZILSE5H.mjs +8 -0
  130. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MPU3VM6Z.mjs +7 -0
  133. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  134. package/dist/bin/core-chunks/chunk-MXJF3FA7.mjs +7 -0
  135. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  137. package/dist/bin/core-chunks/chunk-NNILF7R3.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  139. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  140. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  141. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  142. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  143. package/dist/bin/core-chunks/chunk-O5VCBMEK.mjs +25 -0
  144. package/dist/bin/core-chunks/chunk-OE27RFLJ.mjs +8 -0
  145. package/dist/bin/core-chunks/chunk-OGM34Z6W.mjs +8 -0
  146. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  147. package/dist/bin/core-chunks/chunk-OXKGN3HG.mjs +7 -0
  148. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  149. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  151. package/dist/bin/core-chunks/chunk-PQTR6XVW.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  154. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-Q7GJIU6D.mjs +8 -0
  156. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  157. package/dist/bin/core-chunks/chunk-QWRPJARA.mjs +14 -0
  158. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  159. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  160. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  161. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  162. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  163. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  165. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  166. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  167. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  168. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  169. package/dist/bin/core-chunks/chunk-STFUT7R7.mjs +28 -0
  170. package/dist/bin/core-chunks/chunk-SUXIKMTS.mjs +30 -0
  171. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  172. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  173. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  174. package/dist/bin/core-chunks/chunk-TOORPP6K.mjs +7 -0
  175. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  176. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  177. package/dist/bin/core-chunks/chunk-UAYTDSYG.mjs +64 -0
  178. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  179. package/dist/bin/core-chunks/chunk-UNIBFM6J.mjs +13 -0
  180. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  181. package/dist/bin/core-chunks/chunk-UX2ORID4.mjs +9 -0
  182. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  183. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  184. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  185. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  187. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  188. package/dist/bin/core-chunks/chunk-VJCTTFKP.mjs +8 -0
  189. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-W23JLJJZ.mjs +109 -0
  192. package/dist/bin/core-chunks/chunk-WCTVZQBG.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  194. package/dist/bin/core-chunks/chunk-WZ6W5ZQ5.mjs +7 -0
  195. package/dist/bin/core-chunks/chunk-X433BB6F.mjs +7 -0
  196. package/dist/bin/core-chunks/chunk-XBR63NJA.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XJTEPHLC.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XLAGA5B7.mjs +10 -0
  200. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XSZOHNL4.mjs +7 -0
  202. package/dist/bin/core-chunks/chunk-XWLTEAGN.mjs +7 -0
  203. package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
  204. package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
  205. package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
  206. package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
  207. package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
  208. package/dist/bin/core-chunks/chunk-YOWW4LHK.mjs +8 -0
  209. package/dist/bin/core-chunks/chunk-YPLFWN62.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  211. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZAUJWUUN.mjs +20 -0
  213. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  214. package/dist/bin/core-chunks/chunk-ZQ2XH76U.mjs +12 -0
  215. package/dist/bin/core-chunks/chunk-ZSANMA7K.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/chunk-ZZR3LXCK.mjs +9 -0
  218. package/dist/bin/core-chunks/cleanup-installs-LD43GI4K.mjs +7 -0
  219. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  220. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  221. package/dist/bin/core-chunks/cloud-RXHFZ7MX.mjs +14 -0
  222. package/dist/bin/core-chunks/code-IYK65A62.mjs +12 -0
  223. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-hooks-N5UHKK5B.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-mcp-G7WNAT6T.mjs +7 -0
  226. package/dist/bin/core-chunks/codex-skill-IZNP76BJ.mjs +7 -0
  227. package/dist/bin/core-chunks/command-installer-4ENM4GZR.mjs +7 -0
  228. package/dist/bin/core-chunks/config-UVF7YOR6.mjs +8 -0
  229. package/dist/bin/core-chunks/config-manager-QY73WM5U.mjs +7 -0
  230. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  231. package/dist/bin/core-chunks/context-4GB6ICXK.mjs +38 -0
  232. package/dist/bin/core-chunks/context-MPHOQPXF.mjs +10 -0
  233. package/dist/bin/core-chunks/context-checkpoint-NBI5HKPV.mjs +27 -0
  234. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  235. package/dist/bin/core-chunks/context-tiers-NOKJ75QP.mjs +7 -0
  236. package/dist/bin/core-chunks/context7-service-2MYRUNKY.mjs +7 -0
  237. package/dist/bin/core-chunks/core-WMEHDCOK.mjs +70 -0
  238. package/dist/bin/core-chunks/crew-EYVSIX4L.mjs +24 -0
  239. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  240. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  241. package/dist/bin/core-chunks/cwd-changed-EUJZOBIC.mjs +7 -0
  242. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  243. package/dist/bin/core-chunks/daemon-QARP3RVX.mjs +13 -0
  244. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  245. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  246. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  247. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  248. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  249. package/dist/bin/core-chunks/developer-profile-2VSFJGCU.mjs +7 -0
  250. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  251. package/dist/bin/core-chunks/distill-ZF7WHGCZ.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-heal-XFSVPSEY.mjs +7 -0
  253. package/dist/bin/core-chunks/doctor-service-6ZJBWIXR.mjs +8 -0
  254. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  255. package/dist/bin/core-chunks/dynasty-outcomes-KDWIEA4Y.mjs +11 -0
  256. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  257. package/dist/bin/core-chunks/embeddings-354ZYFKX.mjs +7 -0
  258. package/dist/bin/core-chunks/enriched-recall-MKBOXB7M.mjs +7 -0
  259. package/dist/bin/core-chunks/eval-O4YD6YOV.mjs +76 -0
  260. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  261. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  262. package/dist/bin/core-chunks/format-SYVL4CV5.mjs +7 -0
  263. package/dist/bin/core-chunks/gemini-settings-RGD7JLSP.mjs +7 -0
  264. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  265. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-mcp-IE2RRRRW.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-plugin-SSANHBS7.mjs +7 -0
  268. package/dist/bin/core-chunks/grok-skill-7ZP7R7KO.mjs +7 -0
  269. package/dist/bin/core-chunks/guard-RT7U3LJX.mjs +13 -0
  270. package/dist/bin/core-chunks/guards-AXH6V2IJ.mjs +7 -0
  271. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  272. package/dist/bin/core-chunks/harness-V7J7WIT2.mjs +43 -0
  273. package/dist/bin/core-chunks/health-TNB5OC37.mjs +11 -0
  274. package/dist/bin/core-chunks/help-P7EYELVK.mjs +14 -0
  275. package/dist/bin/core-chunks/hooks-service-REI56DDC.mjs +91 -0
  276. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  277. package/dist/bin/core-chunks/install-FZQJJWT5.mjs +9 -0
  278. package/dist/bin/core-chunks/judgment-G5KH6QFC.mjs +21 -0
  279. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  281. package/dist/bin/core-chunks/judgment-receipt-GO6QEZQC.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-hooks-TR6J3OVG.mjs +7 -0
  283. package/dist/bin/core-chunks/kimi-mcp-ETG7O6O5.mjs +7 -0
  284. package/dist/bin/core-chunks/land-cue-3BUD3KJJ.mjs +8 -0
  285. package/dist/bin/core-chunks/land-rho-MCTQDPRH.mjs +8 -0
  286. package/dist/bin/core-chunks/land-synthesis-MU4EZEYL.mjs +7 -0
  287. package/dist/bin/core-chunks/lean-26BWCUOR.mjs +34 -0
  288. package/dist/bin/core-chunks/legacy-crew-sweep-G5UJT2PM.mjs +23 -0
  289. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  290. package/dist/bin/core-chunks/llm-KMVXVBHG.mjs +18 -0
  291. package/dist/bin/core-chunks/mcp-BD5TOTCK.mjs +17 -0
  292. package/dist/bin/core-chunks/memory-dream-6GFV2GXN.mjs +14 -0
  293. package/dist/bin/core-chunks/memory-export-WJ4H7CFV.mjs +13 -0
  294. package/dist/bin/core-chunks/memory-index-7NIU34EI.mjs +7 -0
  295. package/dist/bin/core-chunks/notification-G654IX3O.mjs +7 -0
  296. package/dist/bin/core-chunks/notify-EWYUBKGO.mjs +9 -0
  297. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  298. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  299. package/dist/bin/core-chunks/opencode-mcp-L7NC77JF.mjs +7 -0
  300. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  301. package/dist/bin/core-chunks/pack-integrity-X277OVRB.mjs +9 -0
  302. package/dist/bin/core-chunks/pack-manager-VN7F6R47.mjs +7 -0
  303. package/dist/bin/core-chunks/package-R4FUTGOE.mjs +7 -0
  304. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  305. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  306. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  307. package/dist/bin/core-chunks/pi-skill-IZQEUILZ.mjs +7 -0
  308. package/dist/bin/core-chunks/planning-NOWLKZDS.mjs +8 -0
  309. package/dist/bin/core-chunks/post-edit-GTBY32JU.mjs +7 -0
  310. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  311. package/dist/bin/core-chunks/pre-bash-32ZOGNSP.mjs +10 -0
  312. package/dist/bin/core-chunks/pre-commit-7TU2A7H4.mjs +7 -0
  313. package/dist/bin/core-chunks/pre-edit-ASEWA5TS.mjs +8 -0
  314. package/dist/bin/core-chunks/pre-package-ZTZACEBB.mjs +7 -0
  315. package/dist/bin/core-chunks/pre-search-MKDRFJSE.mjs +8 -0
  316. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  318. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  319. package/dist/bin/core-chunks/preferences-KO5U2ELK.mjs +31 -0
  320. package/dist/bin/core-chunks/primitives-GNUMBYOK.mjs +13 -0
  321. package/dist/bin/core-chunks/prjct-md-BSFV7OQQ.mjs +7 -0
  322. package/dist/bin/core-chunks/product-GUHSUNIH.mjs +68 -0
  323. package/dist/bin/core-chunks/project-agent-surfaces-BXCJJXB7.mjs +7 -0
  324. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  325. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  326. package/dist/bin/core-chunks/project-memory-L5MDZYST.mjs +7 -0
  327. package/dist/bin/core-chunks/project-style-evolution-HIMSJQQB.mjs +7 -0
  328. package/dist/bin/core-chunks/prompt-47YP5JIR.mjs +25 -0
  329. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  331. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  332. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  333. package/dist/bin/core-chunks/purge-6SJKHKIY.mjs +7 -0
  334. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  335. package/dist/bin/core-chunks/registry-YM2EYUXY.mjs +7 -0
  336. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  337. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  338. package/dist/bin/core-chunks/retention-QSXWKE4H.mjs +7 -0
  339. package/dist/bin/core-chunks/retro-B2EBN4TA.mjs +13 -0
  340. package/dist/bin/core-chunks/review-risk-LBPY5M3K.mjs +12 -0
  341. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  342. package/dist/bin/core-chunks/safe-artifacts-PE2TMEZQ.mjs +9 -0
  343. package/dist/bin/core-chunks/sdd-3WNZJ6FU.mjs +9 -0
  344. package/dist/bin/core-chunks/seed-MMDJE2UO.mjs +10 -0
  345. package/dist/bin/core-chunks/self-heal-R5FBXEVQ.mjs +7 -0
  346. package/dist/bin/core-chunks/session-continuity-OQDB5UYI.mjs +10 -0
  347. package/dist/bin/core-chunks/session-start-FM6UL7MT.mjs +7 -0
  348. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  349. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  350. package/dist/bin/core-chunks/setup-BL36ZWPW.mjs +140 -0
  351. package/dist/bin/core-chunks/setup-V75BWRHU.mjs +38 -0
  352. package/dist/bin/core-chunks/shipping-NZVM57JJ.mjs +12 -0
  353. package/dist/bin/core-chunks/signals-digest-P5BG6MZF.mjs +7 -0
  354. package/dist/bin/core-chunks/skill-adherence-JE3N3Y67.mjs +13 -0
  355. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  356. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  357. package/dist/bin/core-chunks/spec-VC3VTUI3.mjs +27 -0
  358. package/dist/bin/core-chunks/spec-context-inference-KOINWBC7.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  360. package/dist/bin/core-chunks/spec-service-UZ53XL6X.mjs +7 -0
  361. package/dist/bin/core-chunks/spec-task-breakdown-3Y7YXCIQ.mjs +7 -0
  362. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  363. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  364. package/dist/bin/core-chunks/stop-6SH36ULT.mjs +15 -0
  365. package/dist/bin/core-chunks/subagent-start-TVGBV2V2.mjs +7 -0
  366. package/dist/bin/core-chunks/subagent-stop-APWY6KMX.mjs +7 -0
  367. package/dist/bin/core-chunks/surface-attribution-CQVM2SWY.mjs +7 -0
  368. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  371. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  372. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  373. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  374. package/dist/bin/core-chunks/task-service-KFYL5NT4.mjs +7 -0
  375. package/dist/bin/core-chunks/tdd-P2PP4RR4.mjs +9 -0
  376. package/dist/bin/core-chunks/team-WKAAOEFE.mjs +42 -0
  377. package/dist/bin/core-chunks/template-loader-H4FE37HV.mjs +7 -0
  378. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  379. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  380. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  381. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  382. package/dist/bin/core-chunks/uninstall-W6EAUS7N.mjs +13 -0
  383. package/dist/bin/core-chunks/update-PSHEJJI5.mjs +11 -0
  384. package/dist/bin/core-chunks/update-checker-LZCUPWQB.mjs +7 -0
  385. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  386. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  387. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  388. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  389. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  390. package/dist/bin/core-chunks/version-B5DBRVGQ.mjs +7 -0
  391. package/dist/bin/core-chunks/watch-service-7V3O52TW.mjs +9 -0
  392. package/dist/bin/core-chunks/weak-frontier-demo-ZCDTMYRO.mjs +7 -0
  393. package/dist/bin/core-chunks/weak-model-mode-LOAPFJPQ.mjs +7 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-graph-ZNV7S6EU.mjs +16 -0
  396. package/dist/bin/core-chunks/work-scope-XXPUH6TU.mjs +7 -0
  397. package/dist/bin/core-chunks/workflow-XM77QYRF.mjs +61 -0
  398. package/dist/bin/core-chunks/workflows-reference-T7RH7IGJ.mjs +7 -0
  399. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  400. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  401. package/dist/bin/core-chunks/world-model-impact-FAGGNUGN.mjs +7 -0
  402. package/dist/bin/hook-chunks/{agent-switch-I4MTVE56.mjs → agent-switch-TAJWH2ZD.mjs} +1 -1
  403. package/dist/bin/hook-chunks/{analysis-VN7APBHR.mjs → analysis-34WDLUXK.mjs} +2 -2
  404. package/dist/bin/hook-chunks/{auto-flush-DX3FVSQE.mjs → auto-flush-7TIEBPPQ.mjs} +1 -1
  405. package/dist/bin/hook-chunks/{capture-gate-MEIQD7ZS.mjs → capture-gate-JFVGG7RB.mjs} +1 -1
  406. package/dist/bin/hook-chunks/{chunk-UVATSTRF.mjs → chunk-22CBVTZ3.mjs} +1 -1
  407. package/dist/bin/hook-chunks/{chunk-MW54MTLB.mjs → chunk-3JOZN7YJ.mjs} +1 -1
  408. package/dist/bin/hook-chunks/{chunk-E7NA34VQ.mjs → chunk-4X3KUIXK.mjs} +1 -1
  409. package/dist/bin/hook-chunks/{chunk-3AHW4XQH.mjs → chunk-5ALQBNIZ.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-H2DGDAQP.mjs → chunk-5VPZI2ZF.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-XYKVWO23.mjs → chunk-6EHYPQ5U.mjs} +1 -1
  412. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  413. package/dist/bin/hook-chunks/chunk-7H5UVM6X.mjs +9 -0
  414. package/dist/bin/hook-chunks/{chunk-LR24AIEW.mjs → chunk-A3R47SP6.mjs} +1 -1
  415. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  416. package/dist/bin/hook-chunks/{chunk-64ZEBHDX.mjs → chunk-CGAKJDKT.mjs} +1 -1
  417. package/dist/bin/hook-chunks/{chunk-EI6VQZOX.mjs → chunk-CJY4Y5SO.mjs} +1 -1
  418. package/dist/bin/hook-chunks/chunk-FSFURDAE.mjs +16 -0
  419. package/dist/bin/hook-chunks/{chunk-ZZBNFNMG.mjs → chunk-FTBBQHI4.mjs} +1 -1
  420. package/dist/bin/hook-chunks/chunk-G4VJKPG7.mjs +69 -0
  421. package/dist/bin/hook-chunks/{chunk-7PBWIO4K.mjs → chunk-GAJOSSB4.mjs} +2 -2
  422. package/dist/bin/hook-chunks/{chunk-DB226JIV.mjs → chunk-GER6HFWV.mjs} +1 -1
  423. package/dist/bin/hook-chunks/{chunk-LQLCYBFF.mjs → chunk-H3GIYI4Q.mjs} +2 -2
  424. package/dist/bin/hook-chunks/{chunk-KDNUQPAK.mjs → chunk-HRU2KNEB.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-33BHU4OM.mjs → chunk-LCGWETJ6.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-WL6PKX3U.mjs → chunk-MG2DNP4Z.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-XV2LJVYB.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  428. package/dist/bin/hook-chunks/chunk-NGB6JNSB.mjs +18 -0
  429. package/dist/bin/hook-chunks/{chunk-IJ523YO2.mjs → chunk-OALZUWC6.mjs} +1 -1
  430. package/dist/bin/hook-chunks/{chunk-EGCYDLSO.mjs → chunk-PZMBZ6GE.mjs} +1 -1
  431. package/dist/bin/hook-chunks/{chunk-RT2DFIWF.mjs → chunk-QIB6Y6AH.mjs} +2 -2
  432. package/dist/bin/hook-chunks/{chunk-ZQI4TJ5C.mjs → chunk-QMNZPNVY.mjs} +1 -1
  433. package/dist/bin/hook-chunks/{chunk-YLOK4WRR.mjs → chunk-R4YDE3GU.mjs} +1 -1
  434. package/dist/bin/hook-chunks/{chunk-WJV24WE6.mjs → chunk-RFKRKUHB.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-SWJ7TLBD.mjs → chunk-RGOTJCZU.mjs} +1 -1
  436. package/dist/bin/hook-chunks/{chunk-FZS3XGEA.mjs → chunk-RLKYEL3F.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-LF3S3MYE.mjs → chunk-T2KVL6PZ.mjs} +1 -1
  438. package/dist/bin/hook-chunks/{chunk-NLL5AV2G.mjs → chunk-T7DRHVK3.mjs} +2 -2
  439. package/dist/bin/hook-chunks/{chunk-KV4NXLPT.mjs → chunk-TWFLW6OJ.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-ADYTBOCZ.mjs → chunk-UJIOGFNP.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-Y3RHBU2R.mjs → chunk-UK24P7PV.mjs} +2 -2
  442. package/dist/bin/hook-chunks/{chunk-OLQAMCYV.mjs → chunk-ULNGKZB6.mjs} +5 -5
  443. package/dist/bin/hook-chunks/{chunk-UMJ5D5I6.mjs → chunk-UWHVPO6X.mjs} +2 -2
  444. package/dist/bin/hook-chunks/{chunk-YHOZTAZH.mjs → chunk-V6GGH6H5.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{chunk-EXVL2OFE.mjs → chunk-XC2BSGWF.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{chunk-JZDZH6IV.mjs → chunk-YATXTHDL.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{chunk-DCHIPMOG.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{chunk-PVCEWFHS.mjs → chunk-ZPAY2NSF.mjs} +2 -2
  449. package/dist/bin/hook-chunks/{codex-skill-6CRFUF3A.mjs → codex-skill-BFRU5FTP.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{command-installer-MUHZWDZA.mjs → command-installer-3XOZGKOQ.mjs} +1 -1
  451. package/dist/bin/hook-chunks/{config-manager-2JJPCLKC.mjs → config-manager-UPB7NEXF.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{context7-service-NH4BMGSJ.mjs → context7-service-7VFXEQVN.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{cwd-changed-UTD6Y4MS.mjs → cwd-changed-USNJYUH7.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{distill-5TNAM3LY.mjs → distill-47YVL7IH.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{enriched-recall-6VOIUNLN.mjs → enriched-recall-CVYI52NO.mjs} +1 -1
  456. package/dist/bin/hook-chunks/{format-IIOFTSBF.mjs → format-DPIN45EG.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{judgment-receipt-QLV3MYFT.mjs → judgment-receipt-G2DKQR7U.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{land-cue-57B23PEL.mjs → land-cue-3JD2TXFP.mjs} +1 -1
  459. package/dist/bin/hook-chunks/{land-synthesis-ZVPFJERV.mjs → land-synthesis-5C4KGCTB.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{legacy-crew-sweep-GR6HRSHX.mjs → legacy-crew-sweep-XQNXNZES.mjs} +2 -2
  461. package/dist/bin/hook-chunks/{memory-index-XE2MWKQS.mjs → memory-index-LL6SQJ2N.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{notification-GU2ZJP5K.mjs → notification-ACQBRJG3.mjs} +1 -1
  463. package/dist/bin/hook-chunks/{pack-integrity-WV5U3AFF.mjs → pack-integrity-DCXVRRJZ.mjs} +1 -1
  464. package/dist/bin/hook-chunks/{pack-manager-QLFQKP24.mjs → pack-manager-KYWKNYUY.mjs} +1 -1
  465. package/dist/bin/hook-chunks/{planning-VPAX5DZL.mjs → planning-KOU3XKWS.mjs} +2 -2
  466. package/dist/bin/hook-chunks/{post-edit-UXCFSR3Y.mjs → post-edit-CK2MYQEN.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{pre-bash-MB4JNNYG.mjs → pre-bash-W5A5CTR3.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{pre-commit-U7TRFKWX.mjs → pre-commit-5Q24RM4S.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{pre-edit-MDCQXI5F.mjs → pre-edit-YIJ4BCYL.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{pre-package-A6ZI5R64.mjs → pre-package-O4RMVA4T.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{pre-search-ZZO3LGXJ.mjs → pre-search-WYOWC3D6.mjs} +1 -1
  472. package/dist/bin/hook-chunks/{prjct-md-MS52YLI2.mjs → prjct-md-2UVHFYTJ.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{project-agent-surfaces-6AIW7KL6.mjs → project-agent-surfaces-BKFYUMRV.mjs} +1 -1
  474. package/dist/bin/hook-chunks/{project-memory-UDH56VFP.mjs → project-memory-OC5GTJPY.mjs} +1 -1
  475. package/dist/bin/hook-chunks/{project-style-evolution-IJXT2MCP.mjs → project-style-evolution-2IFJCACQ.mjs} +1 -1
  476. package/dist/bin/hook-chunks/prompt-JIWMP563.mjs +26 -0
  477. package/dist/bin/hook-chunks/{purge-N2WN6NDB.mjs → purge-FQK3Z4QS.mjs} +1 -1
  478. package/dist/bin/hook-chunks/{retention-RET4P2RO.mjs → retention-2FETBJFG.mjs} +1 -1
  479. package/dist/bin/hook-chunks/{sdd-PB6WKSLE.mjs → sdd-V43TSJ2P.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{session-continuity-BIJXMN44.mjs → session-continuity-RO2ACICF.mjs} +1 -1
  481. package/dist/bin/hook-chunks/{session-start-R2VMKW2L.mjs → session-start-FKKFMKQ5.mjs} +1 -1
  482. package/dist/bin/hook-chunks/{setup-PPIZHVXS.mjs → setup-YV2DKG5L.mjs} +2 -2
  483. package/dist/bin/hook-chunks/{shipping-C637PCOF.mjs → shipping-SCNFEXBY.mjs} +4 -4
  484. package/dist/bin/hook-chunks/{spec-context-inference-RTTDOZZO.mjs → spec-context-inference-BD3ANTXA.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{spec-service-ENLAAMVL.mjs → spec-service-OWYOAGXS.mjs} +2 -2
  486. package/dist/bin/hook-chunks/{spec-task-breakdown-RUDEP3AY.mjs → spec-task-breakdown-HOTLUFDM.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{state-storage-AJUPG7J5.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{stop-DPXAWJFN.mjs → stop-MIXT7WXA.mjs} +3 -3
  489. package/dist/bin/hook-chunks/{subagent-start-AFHPXL2S.mjs → subagent-start-NO3TN65K.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{subagent-stop-5BMV63ML.mjs → subagent-stop-CKWIXX7W.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{surface-attribution-EGIKCVMF.mjs → surface-attribution-BYESPLXM.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{task-overview-F3GB77OA.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{task-service-FZABHPFV.mjs → task-service-5ONSBKKP.mjs} +1 -1
  494. package/dist/bin/hook-chunks/{tdd-TAMBOPN3.mjs → tdd-SESB4IG3.mjs} +1 -1
  495. package/dist/bin/hook-chunks/{template-loader-MXOMU4XH.mjs → template-loader-KO67FVHO.mjs} +1 -1
  496. package/dist/bin/hook-chunks/{weak-model-mode-BMSPGEQY.mjs → weak-model-mode-HPXBKXJT.mjs} +1 -1
  497. package/dist/bin/hook-chunks/{work-scope-YCS4GTXW.mjs → work-scope-RNPGACPA.mjs} +1 -1
  498. package/dist/bin/hook-chunks/{workspace-occupancy-JOBYNNXV.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  499. package/dist/bin/prjct-core.mjs +9 -3323
  500. package/dist/bin/prjct-hooks.mjs +1 -1
  501. package/dist/bin/prjct.mjs +7 -1
  502. package/dist/daemon/entry.mjs +591 -582
  503. package/dist/mcp/server.mjs +320 -313
  504. package/package.json +4 -2
  505. package/dist/bin/hook-chunks/chunk-3UB6SFRA.mjs +0 -11
  506. package/dist/bin/hook-chunks/chunk-D7DQABWO.mjs +0 -35
  507. package/dist/bin/hook-chunks/chunk-IWUF2LGO.mjs +0 -18
  508. package/dist/bin/hook-chunks/chunk-M4YM7Z3F.mjs +0 -69
  509. package/dist/bin/hook-chunks/chunk-TB57OYGW.mjs +0 -16
  510. package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +0 -9
  511. package/dist/bin/hook-chunks/prompt-7VZLYONO.mjs +0 -24
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{E as h,x as a}from"./chunk-HU5ERAAV.mjs";import{c as s,d as n,i as l}from"./chunk-VWFVSNQT.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";h();l();var p={strategic:{label:"scope sanity",rubric:"Review it for strategic soundness. Does it solve a real problem? Is the goal worth the cost? Is out_of_scope coherent with goal? Is the spec OVER- or UNDER-scoped? Cross-reference relevant prior memory via `prjct context memory <topic>` if useful."},architecture:{label:"eng feasibility",rubric:"Then read the codebase paths listed above (Read tool, cap 10 files). Can this be built ON TOP of what exists? Does the spec contradict an existing state machine, schema, or contract? What failure modes / dependencies / edge cases are missing? Include a short ASCII diagram + cite at least one concrete symbol from the codebase in notes when applicable."},design:{label:"UX/DX",rubric:"Rate 0-10 across {clarity, ergonomics, consistency, accessibility} for the user-facing or developer-facing surface. If scope touches existing UI/CLI patterns (read the listed paths), consistency must be judged against those \u2014 not against your priors. Pass only if all dimensions \u22656; include the four scores in notes.",capabilityClass:"fast"},security:{label:"threat surface",rubric:"Threat-model the surface this spec defines: authn/authz, secret handling, input validation & injection, sandbox/exec boundaries, network egress, PII. Name the highest-severity gap and whether the acceptance criteria mitigate it. Pass only if no high-severity gap is left unmitigated."},data:{label:"data integrity",rubric:"Review the data design. Are schema / migration changes backward-compatible and reversible? Index / query implications, write amplification, migration idempotency, data-loss risk on partial failure. Pass only if the migration path is safe and rollbackable."},performance:{label:"perf profile",rubric:"Identify the hottest path this spec touches and its expected complexity / allocation / IO profile. Do the acceptance criteria bound latency or throughput where it matters? Name the single biggest perf risk. Pass only if no hot-path regression is left unbounded."}},u="Review the spec through this lens. Identify the most important risk or gap it implies and whether the acceptance criteria address it.";function g(e){return`You are the \`${e.name}\` domain specialist (${e.description}). Judge whether this change respects the existing patterns, contracts, and invariants of the \`${e.name}\` domain. Pull \`prjct context memory ${e.name}\` to ground the verdict in what the project already knows. Pass only if the change is consistent with how \`${e.name}\` already works.`}r(g,"domainLensRubric");var o="architecture";function c(){return Object.entries(p).map(([e,t])=>`\`${e}\` (${t.label})`).join(", ")}r(c,"reviewLensMenu");var R=[{name:"leader",role:"orchestrator",kind:"orchestrate"},{name:"implementer",role:"implementer",kind:"implement"},{name:"reviewer",role:"reviewer",kind:"review"}];function d(){return{native:!0,modelDirective:r((e,t)=>n(e,void 0,t),"modelDirective"),runLine:r(e=>e===1?"Run this review subagent via the Agent tool. It reads the spec FROM prjct (command below), reads the relevant codebase paths, applies its rubric, then returns a structured verdict.":`Run these ${e} review subagents IN PARALLEL via the Agent tool \u2014 one tool-use block per lens, all in the SAME message so they run concurrently. Each subagent reads the spec FROM prjct (command below), reads the relevant codebase paths, applies its rubric, then returns a structured verdict.`,"runLine")}}r(d,"claudeMechanism");function m(e){return{native:!1,modelDirective:r((t,i)=>s(t,e,void 0,i),"modelDirective"),runLine:r(t=>t===1?`This rig (${e}) has no native subagent tool. Run this review as ONE focused, fresh pass: read the spec FROM prjct (command below) and the relevant codebase paths, apply the rubric, return a structured verdict \u2014 do not carry over assumptions from the planning context.`:`This rig (${e}) has no native subagent tool, so EMULATE the fan-out: run the ${t} reviews ONE AT A TIME, each as a fresh, independent pass. For each \u2014 reset your working assumptions, state the lens you are playing, read the spec FROM prjct (command below) + the relevant paths, apply that lens's rubric, return its verdict, then move on. Keep them isolated: a later lens must not inherit an earlier lens's framing.`,"runLine")}}r(m,"emulatedMechanism");async function E(e){let t=(await a(e)).name,i=t==="claude"?d():m(t);return{provider:t,...i}}r(E,"resolveDispatchMechanism");function D(e,t){let i=t.trim();return`${[`# prjct crew \u2014 emulated on ${e.provider}`,"","This rig has no native subagent tool, so the crew runs as ONE agent playing roles IN SEQUENCE \u2014 each a fresh, isolated pass. Reset your working assumptions between roles; a later role must never inherit an earlier one's framing.","","The roster is **composed per task, not a fixed trio**: the leader decides how many implementers and which review specialists the change actually needs.","","## Roles (run in order)","",`1. **Leader \u2014 orchestrate, do not write code.** Run \`prjct work --md\` for the cycle + related context. Decompose into slices with DISJOINT file scope, and decide the roster: how many implementers, which review specialists the change raises, and whether investigation is needed first. ${e.modelDirective("orchestrator")}`,`2. **Explore \u2014 only if investigation is needed.** One fresh, read-only pass per narrow question; persist findings with \`prjct remember learning\`. ${e.modelDirective("orchestrator")}`,`3. **Implementer(s) \u2014 one per disjoint slice.** Implement the slice + its tests and self-verify (run the project's test command) before handing off. Fan out only over non-overlapping file scopes. ${e.modelDirective("implementer")}`,`4. **Review specialists \u2014 compose, do NOT default to one generic reviewer.** Always include \`${o}\`; add the specialists the diff raises \u2014 ${c()} \u2014 and invent one the change demands (open vocabulary). Run ONE fresh pass per specialist over the combined diff; each replies \`VERDICT: APPROVED\` or \`VERDICT: CHANGES_REQUESTED\` with notes. (Same catalog \`prjct spec audit\` selects from.) ${e.modelDirective("reviewer")}`,"","## Checkpoints every review specialist applies","",i.length>0?i:"_No project checkpoints set \u2014 review against the project conventions. Set them with `prjct crew checkpoints set`._","","## Rules","- Point, don't carry: the plan/work/memory live in prjct \u2014 read them in each role (`prjct work --md`, `prjct spec show <id> --md`, `prjct context memory <topic>`), never paste them between roles.","- Advance only when EVERY selected specialist returns APPROVED: run `prjct crew record-run \u2026` (one durable row), THEN close the work cycle. If any returns CHANGES_REQUESTED, loop back to the implementer with the notes.","- Persist ONLY through prjct verbs \u2014 SQLite is the only allowed surface. Never write reports/audits to disk."].join(`
8
+ `)}
9
+ `}r(D,"buildEmulatedCrewProtocol");export{p as a,u as b,g as c,R as d,E as e,D as f};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as k,p as w}from"./chunk-D62TAZG6.mjs";import{a}from"./chunk-3TRXQAU4.mjs";w();import{existsSync as g}from"node:fs";import{readFile as P}from"node:fs/promises";import u from"node:path";function v(n){let e=n.trim();if(!e)return null;let s=(e.split(/&&|\|\||;/)[0]?.trim()??e).split(/\s+/).filter(Boolean);if(s.length<2)return null;let r=s[0].replace(/\.cmd$/i,""),o=r==="npm"||r==="npx"?"npm":r==="pnpm"?"pnpm":r==="yarn"?"yarn":r==="bun"?"bun":null;if(!o)return null;let i=s[1];if(!(i==="install"||i==="i"||i==="add"||o==="npm"&&i==="install"||o==="yarn"&&(i==="add"||i==="install")))return null;let m=[];for(let y of s.slice(2).keys()){let c=s[y+2];if(c.startsWith("-")||c.startsWith(".")||c.startsWith("/")||c.startsWith("file:")||c.startsWith("http"))continue;let f=D(c);f&&m.push(f)}let d=[...new Set(m)];return d.length===0?null:{manager:o,packages:d}}a(v,"parsePackageInstallCommand");function D(n){if(n.startsWith("@")){let t=n.match(/^(@[\w.-]+\/[\w.-]+)/);return t?t[1]:null}let e=n.split("@")[0]??"";return!e||!/^[\w.-]+$/.test(e)?null:e}a(D,"normalizePackageToken");function I(n,e){let t=n.filter(s=>!e.has(s)).sort();return t.length===0?{risky:!1,newPackages:[],message:null}:{risky:!0,newPackages:t,message:[`Package legitimacy (pre-install): ${t.length} new package${t.length===1?"":"s"} not in package.json:`,...t.map(s=>` - ${s}`),"Verify each on the registry (age, downloads, maintainers). Do not install look-alike names.","Strict packs DENY the install until verified. Override ship later with `prjct ship --allow-new-deps` only after human consent."].join(`
8
+ `)}}a(I,"decidePackageInstall");async function $(n){let e=u.join(n,"package.json");if(!g(e))return new Set;let t=await h(e);return p(t)}a($,"loadKnownDependencyNames");function p(n){let e=new Set;if(!n)return e;for(let t of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){let s=n[t];if(s)for(let r of Object.keys(s))e.add(r)}return e}a(p,"depNames");async function h(n){try{let e=await P(n,"utf-8");return JSON.parse(e)}catch{return null}}a(h,"readJsonFile");async function b(n){try{let{stdout:e}=await k("git",["show","HEAD:package.json"],{cwd:n});return JSON.parse(e)}catch{return null}}a(b,"headPackageJson");async function R(n){let e=u.join(n,"package.json");if(!g(e))return{newDependencies:[],risky:!1,message:null};if(!g(u.join(n,".git")))return{newDependencies:[],risky:!1,message:null};let t=await h(e),s=await b(n),r=p(t),o=p(s),i=[...r].filter(l=>!o.has(l)).sort();return i.length===0?{newDependencies:[],risky:!1,message:null}:{newDependencies:i,risky:!0,message:[`Package legitimacy: ${i.length} new dependenc${i.length===1?"y":"ies"} vs HEAD:`,...i.map(l=>` - ${l}`),"Verify each on the registry (age, downloads, source). Do not substitute similar names.","Strict packs block ship until you confirm or revert.","Override with explicit consent: `prjct ship --allow-new-deps` (not `--no-spec-gate`)."].join(`
9
+ `)}}a(R,"checkPackageLegitimacy");export{v as a,I as b,$ as c,R as d};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as r,e as o}from"./chunk-CB3CNJTL.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";var s=8;function g(n,t,e=s){return o(r(n,t,e).files)}i(g,"rankLikelyFiles");function u(n){let t=n.signals.length>0?` (${n.signals.join("+")})`:"";return`\`${n.path}\` \u2014 ${n.reason}${t}`}i(u,"formatLikelyFileForAgent");function c(n,t){let e=r(n,t,s);return e.files.length===0?null:e.agentBlock||null}i(c,"buildIndexedFileCue");export{g as a,u as b,c};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as n,b as u,c as t}from"./chunk-3TRXQAU4.mjs";function r(){return typeof globalThis<"u"&&"Bun"in globalThis?"bun":"node"}function i(){return r()==="bun"}function b(){if(r()==="bun")return!0;try{let{execFileSync:e}=u("node:child_process");return e("bun",["--version"],{stdio:"ignore"}),!0}catch{return!1}}var o=t(()=>{"use strict";n(r,"detectRuntime");n(i,"isBun");n(b,"isBunAvailable")});export{i as a,b,o as c};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{z as e}from"zod";var n=e.enum(["skip","standard","full"]),i=e.enum(["blocker","critical","warning","suggestion"]),o=e.enum(["candidate","stands","refuted","info","fixed","verified","open"]),r=e.enum(["stands","refuted"]),a=e.enum(["in_progress","approved","escalated","blocked"]),s=e.enum(["red","blue","solo"]),m=e.object({id:e.string().min(1),severity:i,status:o,title:e.string().min(1),file:e.string().optional(),line:e.number().int().positive().optional(),evidence:e.string().optional(),judge:e.string().optional(),role:s.optional(),dna:e.string().optional(),evidenceScore:e.number().int().min(0).max(3).optional(),blast:e.number().optional(),knownFalsePositive:e.boolean().optional(),agreedBy:e.array(e.string()).optional(),refuteVotes:e.array(r).optional()}),t=2,g=e.object({id:e.string().min(1),target:e.string().min(1),intensity:n,maxFixRounds:e.literal(t).default(t),fixRound:e.number().int().min(0).max(t),findings:e.array(m),verdict:a,createdAt:e.string().min(1),updatedAt:e.string().min(1),baseSha:e.string().optional(),headSha:e.string().optional(),escalateReason:e.string().optional(),deliveryTier:e.enum(["trivial","normal","large"]).optional(),merge:e.object({agreed:e.number().int().min(0),onlyRed:e.number().int().min(0),onlyBlue:e.number().int().min(0),contradicted:e.number().int().min(0)}).optional(),precisionHint:e.number().min(0).max(1).optional(),scopePaths:e.array(e.string().min(1)).optional(),scopeFrozenAt:e.string().optional(),contentBound:e.object({version:e.literal(1),treeHash:e.string().min(8),pathCount:e.number().int().min(0),paths:e.array(e.object({path:e.string().min(1),blobHash:e.string().min(1)})),stampedAt:e.string().min(1),headSha:e.string().optional()}).optional()}),p=e.object({dna:e.string().min(1),title:e.string().min(1),times:e.number().int().positive(),lastSeenAt:e.string().min(1),lastReason:e.string().optional()}),c=e.object({ghosts:e.array(p),updatedAt:e.string().min(1)});export{i as a,r as b,t as c,g as d,c as e};
@@ -0,0 +1,13 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as r,i as S}from"./chunk-DMO3ZFUG.mjs";import{F as a,G as _,e as o,l}from"./chunk-HU5ERAAV.mjs";import{f as p,g,p as m}from"./chunk-HYIT7MF5.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";_();l();S();var c=class{static{s(this,"SyncPendingStorage")}append(n,e){let t=o(),u=JSON.stringify(e);return e.entityType&&e.entityId&&e.contentHash&&r.run(n,`DELETE FROM sync_pending
8
+ WHERE project_id = ?
9
+ AND entity_type = ?
10
+ AND entity_id = ?
11
+ AND content_hash = ?`,n,e.entityType,e.entityId,e.contentHash),r.run(n,`INSERT INTO sync_pending
12
+ (project_id, entity_type, entity_id, event_type, content_hash, payload, enqueued_at)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,n,e.entityType??null,e.entityId??null,e.eventType??null,e.contentHash??null,u,t),{id:r.get(n,"SELECT last_insert_rowid() AS id")?.id??0,event:e,enqueuedAt:t}}list(n,e){let t=e?"SELECT * FROM sync_pending WHERE project_id = ? ORDER BY id ASC LIMIT ?":"SELECT * FROM sync_pending WHERE project_id = ? ORDER BY id ASC";return(e?r.query(n,t,n,e):r.query(n,t,n)).map(d=>this.rowToEntry(d))}count(n){return r.get(n,"SELECT COUNT(*) AS n FROM sync_pending WHERE project_id = ?",n)?.n??0}clearUpTo(n,e){if(e<=0)return 0;let t=this.count(n);return r.run(n,"DELETE FROM sync_pending WHERE project_id = ? AND id <= ?",n,e),t-this.count(n)}clearAll(n){r.run(n,"DELETE FROM sync_pending WHERE project_id = ?",n)}clearByIds(n,e){if(e.length===0)return;let t=e.map(()=>"?").join(",");r.run(n,`DELETE FROM sync_pending WHERE project_id = ? AND id IN (${t})`,n,...e)}rowToEntry(n){let e=(()=>{try{return JSON.parse(n.payload)}catch{return{type:"unknown.corrupt",path:[],data:null,timestamp:n.enqueued_at,projectId:n.project_id}}})();return{id:n.id,event:e,enqueuedAt:n.enqueued_at}}},i=new c;l();m();var y=class{static{s(this,"SyncEventBus")}async publish(n){i.append(n.projectId,n)}async getPending(n){return i.list(n).map(e=>e.event)}async clearPending(n){i.clearAll(n)}async getPendingEntries(n){return i.list(n)}async clearPendingUpTo(n,e){return i.clearUpTo(n,e)}async clearPendingByIds(n,e){i.clearByIds(n,e)}async updateLastSync(n){let e=a.getLastSyncPath(n),t={timestamp:o(),success:!0};await g(e,t)}async getLastSync(n){let e=a.getLastSyncPath(n);return await p(e,null)}},L=new y;export{L as a};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as f}from"./chunk-UYMZ3NAF.mjs";import{b as m}from"./chunk-Q6C27OL7.mjs";import{f as r,i as g}from"./chunk-DMO3ZFUG.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";g();var _=["hook","gate","step","instruction"];function d(o){let t=o.trust_source==="imported"?"imported":"local",e=_.includes(o.type)?o.type:"step";return{id:o.id,type:e,command:o.command,position:o.position,action:o.action,description:o.description,enabled:o.enabled===1,timeoutMs:o.timeout_ms,createdAt:o.created_at,sortOrder:o.sort_order,whenExpr:o.when_expr??null,parallel:o.parallel===null?!0:o.parallel===1,trustSource:t}}i(d,"rowToRule");var p=class{static{i(this,"WorkflowRuleStorage")}addRule(t,e){let n=r.get(t,"SELECT MAX(sort_order) as m FROM workflow_rules WHERE command = ?",e.command),u=e.sortOrder||(n?.m??-1)+1;r.run(t,`INSERT INTO workflow_rules (type, command, position, action, description, enabled, timeout_ms, created_at, sort_order, when_expr, parallel, trust_source)
8
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,e.type,e.command,e.position,e.action,e.description??null,e.enabled?1:0,e.timeoutMs,e.createdAt,u,e.whenExpr??null,e.parallel===!1?0:1,e.trustSource??"local");let l=r.get(t,"SELECT last_insert_rowid() as id")?.id??0;return l>0&&m({projectId:t,entityType:"workflow_rules",entityId:String(l),eventType:"upsert",data:{id:l,type:e.type,command:e.command,position:e.position,action:e.action,description:e.description??null,enabled:e.enabled?1:0,timeout_ms:e.timeoutMs,sort_order:u,when_expr:e.whenExpr??null,parallel:e.parallel===!1?0:1,trust_source:e.trustSource??"local",created_at:e.createdAt}}),l}removeRule(t,e){return r.get(t,"SELECT id FROM workflow_rules WHERE id = ?",e)?(r.run(t,"DELETE FROM workflow_rules WHERE id = ?",e),m({projectId:t,entityType:"workflow_rules",entityId:String(e),eventType:"delete",data:{id:e}}),!0):!1}updateRule(t,e,n){if(!r.get(t,"SELECT id FROM workflow_rules WHERE id = ?",e))return!1;let w={type:{column:"type"},command:{column:"command"},position:{column:"position"},action:{column:"action"},description:{column:"description"},enabled:{column:"enabled",transform:i(s=>s?1:0,"transform")},timeoutMs:{column:"timeout_ms"},createdAt:{column:"created_at"},sortOrder:{column:"sort_order"},whenExpr:{column:"when_expr"},parallel:{column:"parallel",transform:i(s=>s===!1?0:1,"transform")},trustSource:{column:"trust_source"}},l=[],c=[];for(let[s,E]of Object.entries(n)){let a=w[s];if(!a)continue;l.push(`${a.column} = ?`);let R=E;c.push(a.transform?a.transform(R):R)}return l.length===0||(c.push(e),r.run(t,`UPDATE workflow_rules SET ${l.join(", ")} WHERE id = ?`,...c)),!0}getRuleById(t,e){let n=r.get(t,"SELECT * FROM workflow_rules WHERE id = ?",e);return n?d(n):null}getRulesForCommand(t,e){let n=f.getWorkflow(t,e);return!n||!n.enabled?[]:r.query(t,"SELECT * FROM workflow_rules WHERE command = ? AND enabled = 1 ORDER BY sort_order ASC",e).map(d)}getAllRules(t){return r.query(t,"SELECT * FROM workflow_rules ORDER BY command ASC, sort_order ASC").map(d)}resetRules(t){let e=r.get(t,"SELECT COUNT(*) as c FROM workflow_rules");return r.run(t,"DELETE FROM workflow_rules"),e?.c??0}},S=new p;export{S as a};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{e as r,p as c}from"./chunk-D62TAZG6.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";c();var s=5e3;async function g(t){let n=await r(["branch","--show-current"],{cwd:t,timeoutMs:s});if(n.ok)return n.stdout.trim()||void 0}e(g,"getGitBranch");async function m(t,n=20){let o=e(i=>i.trim().split(`
8
+ `).filter(f=>f.length>0).slice(0,n),"parse"),u=await r(["diff","--name-only","HEAD"],{cwd:t,timeoutMs:s});if(u.ok){let i=o(u.stdout);if(i.length>0)return i}let d=await r(["diff","--name-only"],{cwd:t,timeoutMs:s});return d.ok?o(d.stdout):[]}e(m,"getModifiedFiles");export{g as a,m as b};
@@ -0,0 +1,25 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as m,c as d}from"./chunk-5TGZSK4C.mjs";import{a as l,b}from"./chunk-RP7F67ZT.mjs";import{d as g,g as y}from"./chunk-XWLTEAGN.mjs";import{b as a,c as w}from"./chunk-DOJPSIMG.mjs";import{e as u,g as k}from"./chunk-225DWS4D.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";import s from"node:fs/promises";import n from"node:path";w();k();b();y();var c="prjct";function f(){return process.env.PRJCT_TEST_MODE==="1"?n.join(a(".prjct-tests"),"grok","plugins",c):a(".grok","plugins",c)}e(f,"getGrokPluginRoot");function v(){return`${JSON.stringify({name:c,version:g,description:"prjct agentic harness: SQLite work cycles, memory, guards. Grok is Brain; prjct is Body. Run prjct verbs / MCP prjct_*.",author:{name:"prjct.app"}},null,2)}
8
+ `}e(v,"buildPluginJson");function P(){return`---
9
+ description: Enter or manage prjct plan mode (read-only until approve). Use when the approach is ambiguous and you need a written plan before editing code.
10
+ ---
11
+
12
+ # prjct plan
13
+
14
+ Run this ceremony yourself (do not ask the user to type it):
15
+
16
+ \`\`\`bash
17
+ prjct plan "\${ARGUMENTS}" --md
18
+ \`\`\`
19
+
20
+ Follow the host contract printed by the CLI:
21
+
22
+ - While plan status is **draft**, do not edit project source \u2014 only update the plan via \`prjct plan write\` / \`prjct plan\`.
23
+ - When the plan is ready, ask the user to approve, then run \`prjct plan approve --md\`.
24
+ - After approve, implement against the plan; persist decisions with \`prjct remember\`.
25
+ `}e(P,"buildPlanCommandMarkdown");async function G(t,r){try{if(await s.readFile(t,"utf-8")===r)return!1}catch{}return await s.mkdir(n.dirname(t),{recursive:!0}),await s.writeFile(t,r,"utf-8"),!0}e(G,"writeIfChanged");async function N(t=f()){try{let r=m();if(!r)return l.warn("Grok plugin: skill template missing"),{success:!1,path:t,changed:!1,files:[]};let p=d(r),h=[{rel:"plugin.json",content:v()},{rel:n.join("skills","prjct","SKILL.md"),content:p.content},{rel:n.join("commands","plan.md"),content:P()}],o=[];for(let i of h){let j=n.join(t,i.rel);await G(j,i.content)&&o.push(i.rel)}return{success:!0,path:t,changed:o.length>0,files:o}}catch(r){return l.warn(`Grok plugin warning: ${u(r)}`),{success:!1,path:t,changed:!1,files:[]}}}e(N,"installGrokPlugin");async function T(t=f()){try{return await s.access(n.join(t,"plugin.json")),!0}catch{return!1}}e(T,"grokPluginInstalled");export{f as a,N as b,T as c};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b,c as $}from"./chunk-FATYLG3L.mjs";import{b as y,e as E}from"./chunk-623SNKDH.mjs";import{e as c,g as A}from"./chunk-XWLTEAGN.mjs";import{a as n,c as P,d as x}from"./chunk-3TRXQAU4.mjs";var z={};x(z,{default:()=>k,getTemplateContent:()=>w,listTemplates:()=>j,resetBundle:()=>B});import m from"node:fs";import v from"node:fs/promises";import d from"node:path";function g(){if(s.loaded)return s.templates;s.loaded=!0;let t=d.join(c,"dist","templates.json");try{let e=m.readFileSync(t,"utf-8");return s.templates=JSON.parse(e),s.templates}catch{return null}}function L(t){let e=i.indexOf(t);e>-1&&i.splice(e,1),i.push(t)}function W(){for(;a.size>=R&&i.length>0;){let t=i.shift();t&&a.delete(t)}}function S(t){let e=/^---\n([\s\S]+?)\n---\n([\s\S]*)$/,r=t.match(e);if(!r)return{frontmatter:{},content:t.trim()};let[,o,l]=r,p={};return o.split(`
8
+ `).forEach(F=>{let[f,...h]=F.split(":");if(f&&h.length>0){let u=h.join(":").trim();u.startsWith("[")&&u.endsWith("]")?p[f.trim()]=u.slice(1,-1).split(",").map(O=>O.trim()):p[f.trim()]=u.replace(/^["']|["']$/g,"")}}),{frontmatter:p,content:l.trim()}}async function T(t){if(a.has(t))return L(t),a.get(t);let o=g()?.[`commands/${t}.md`]??await v.readFile(d.join(c,"templates","commands",`${t}.md`),"utf-8").catch(()=>{throw y.notFound(t)}),l=S(o);return W(),a.set(t,l),i.push(t),l}async function _(t){return(await T(t)).frontmatter["allowed-tools"]||[]}function C(){a.clear(),i.length=0}function B(){s.templates=null,s.loaded=!1,C()}function w(t){let e=g();if(e?.[t])return e[t];let r=b(t);if(r)return r;let o=d.join(c,"templates",t);try{return m.readFileSync(o,"utf-8")}catch{return null}}function j(t){let e=g();if(e)return Object.keys(e).filter(o=>o.startsWith(t));let r=d.join(c,"templates",t);try{return m.readdirSync(r).map(l=>`${t}${l}`)}catch{return[]}}var R,a,i,s,M,k,G=P(()=>{E();$();A();R=50,a=new Map,i=[],s={templates:null,loaded:!1};n(g,"loadBundle");n(L,"updateLruOrder");n(W,"evictLru");n(S,"parseFrontmatter");n(T,"load");n(_,"getAllowedTools");n(C,"clearCache");n(B,"resetBundle");n(w,"getTemplateContent");n(j,"listTemplates");M={load:T,parseFrontmatter:S,getAllowedTools:_,clearCache:C,getTemplateContent:w,listTemplates:j},k=M});export{B as a,w as b,j as c,k as d,z as e,G as f};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as P,c as I,e as M}from"./chunk-6RT2P22O.mjs";import{e as T,f as O}from"./chunk-OE27RFLJ.mjs";import{c as x,g as L}from"./chunk-XWLTEAGN.mjs";import{a as t,b as v,e as S}from"./chunk-3TRXQAU4.mjs";M();import{execFileSync as F}from"node:child_process";import{realpathSync as w}from"node:fs";import h from"node:path";import H from"node:readline";L();M();import{execFileSync as y}from"node:child_process";import C from"node:os";import g from"node:path";var _=C.homedir(),p={npm:{name:"npm",installArgs:["install","-g","prjct-cli@latest","--prefer-online"],getInstallRoot:t(()=>{try{return y("npm",["root","-g"],{encoding:"utf-8",stdio:"pipe"}).trim()}catch{return null}},"getInstallRoot")},pnpm:{name:"pnpm",installArgs:["add","-g","prjct-cli@latest"],getInstallRoot:t(()=>{try{return y("pnpm",["root","-g"],{encoding:"utf-8",stdio:"pipe"}).trim()}catch{return null}},"getInstallRoot")},bun:{name:"bun",installArgs:["add","-g","prjct-cli@latest"],getInstallRoot:t(()=>g.join(_,".bun","install","global","node_modules"),"getInstallRoot")},yarn:{name:"yarn",installArgs:["global","add","prjct-cli@latest"],getInstallRoot:t(()=>{try{let e=y("yarn",["global","dir"],{encoding:"utf-8",stdio:"pipe"}).trim();return g.join(e,"node_modules")}catch{return null}},"getInstallRoot")}};function tn(){return C.tmpdir()}t(tn,"registryInstallCwd");function on(e,r){let o=r??"prjct-cli@latest";return e.installArgs.map(n=>n==="prjct-cli@latest"||n.startsWith("prjct-cli@")?o:n)}t(on,"registryInstallArgs");function N(){try{return!!y("brew",["list","prjct-cli"],{encoding:"utf-8",stdio:["pipe","pipe","ignore"]})}catch{return!1}}t(N,"isHomebrewInstall");function $(e){return I(e)||process.platform==="win32"&&I(`${e}.cmd`)}t($,"isOnPath");function R(){let e=[process.argv[1],process.execPath].filter(Boolean);for(let r of e){let n=(()=>{try{return v("node:fs").realpathSync(r)}catch{return r}})().replace(/\\/g,"/").toLowerCase();if(n.includes("/.bun/install/global")||n.includes("/.bun/bin/"))return"bun";if(n.includes("/library/pnpm/")||n.includes("/.pnpm/")||n.includes("/.local/share/pnpm/")||n.includes("/pnpm/")&&(n.includes("/global")||n.includes("/prjct")))return"pnpm";if(n.includes("/.yarn/")||n.includes("/yarn/global")||n.includes("/yarn/berry"))return"yarn";if(n.includes("/node_modules/prjct-cli")||n.includes("/npm/node_modules/")||n.endsWith("/npm/prjct.cmd")||n.endsWith("/npm/prjct"))return"npm"}return null}t(R,"detectInstallerFromRunningBinary");function sn(){let e=R();if(e&&$(e))return p[e];for(let r of["bun","pnpm","npm","yarn"])if($(r))return p[r];throw new Error("No supported package manager found in PATH (tried npm, pnpm, bun, yarn). Install one and re-run, or upgrade manually: bun add -g prjct-cli@latest")}t(sn,"selectPackageManager");function A(){let e=[];for(let r of[p.bun,p.pnpm,p.npm,p.yarn]){let o=r.getInstallRoot();if(!o)continue;let n=g.join(o,"prjct-cli","package.json");try{let a=JSON.parse(v("node:fs").readFileSync(n,"utf-8"));a?.name==="prjct-cli"&&typeof a.version=="string"&&e.push({pm:r,version:a.version})}catch{}}return e}t(A,"getAllInstalledLocations");function an(){try{let{existsSync:e,realpathSync:r,readFileSync:o}=v("node:fs"),n=(()=>{try{return r(g.resolve(__dirname,"..","..",".."))}catch{return""}})(),a=[p.bun.getInstallRoot(),p.pnpm.getInstallRoot(),p.npm.getInstallRoot(),p.yarn.getInstallRoot()].filter(s=>!!s);for(let s of a){let l=g.join(s,"prjct-cli"),d=g.join(l,"package.json");if(!e(d))continue;let c=(()=>{try{return r(l)}catch{return l}})();if(n&&c===n)continue;try{if(JSON.parse(o(g.join(c,"package.json"),"utf-8"))?.name!=="prjct-cli")continue}catch{continue}x(c);let{resetBundle:i}=(O(),S(T));i();return}}catch{}}t(an,"redirectToInstalledPackage");var q={npm:["npm","uninstall","-g","prjct-cli"],pnpm:["pnpm","remove","-g","prjct-cli"],bun:["bun","remove","-g","prjct-cli"],yarn:["yarn","global","remove","prjct-cli"]};function B(){let e=P("prjct")??P("prjct.cmd");if(!e)return null;try{return w(e)}catch{return e}}t(B,"pathWinnerReal");function E(){try{return w(h.resolve(__dirname,"..","..",".."))}catch{return""}}t(E,"sourceRoot");function k(e){let r=h.normalize(e).replace(/\\/g,"/");return process.platform==="win32"?r.toLowerCase():r}t(k,"normalizePathForCompare");function z(e,r){if(!e||!r)return!1;try{let o=k(w(e)),n=k(w(r));return n===o||n.startsWith(`${o}/`)}catch{let o=k(e),n=k(r);return n===o||n.startsWith(`${o}/`)||n.includes(o)}}t(z,"locationOwnsWinner");function J(e){try{return w(e)}catch{return e}}t(J,"defaultResolvePath");function G(e){if(!e||process.platform==="win32")return!1;let r=e.replace(/\\/g,"/");return!!(r.includes("/Cellar/prjct-cli")||r.includes("/Cellar/prjct/")||/(?:^|\/)(?:opt\/)?homebrew\/bin\/prjct(?:$|\/)/.test(r)||r.includes("/.linuxbrew/bin/prjct")||r.includes("/linuxbrew/.linuxbrew/bin/prjct")||r.endsWith("/homebrew/bin/prjct")||r.endsWith("/opt/homebrew/bin/prjct"))}t(G,"isBrewWinnerPath");function Y(e){let{winnerReal:r,winnerPm:o,locations:n,brewInstalled:a,sourceRoot:s,ownsWinner:l=z,resolvePath:d=J}=e,c=[];if(!r&&!o)return{winner:null,removable:[],skipped:[{pm:"(all)",reason:"cannot resolve the PATH-winning binary \u2014 refusing to remove"}]};let i=G(r),f=!i&&r?n.find(u=>{let m=u.installRoot;return l(m,r)||l(m?h.join(m,"prjct-cli"):null,r)})?.name:void 0,b=i?"brew":f??o,j=[];for(let u of n){let m=u.installRoot,W=l(m,r)||l(m?h.join(m,"prjct-cli"):null,r);if(u.name===b||W||!r&&u.name===o){c.push({pm:u.name,reason:"PATH winner (or owns winning binary) \u2014 kept"});continue}if(m&&s&&d(h.join(m,"prjct-cli"))===s){c.push({pm:u.name,reason:"resolves to the dev source tree (link) \u2014 kept"});continue}j.push({pm:u.name,version:u.version})}return a&&!i&&b!=="brew"?j.push({pm:"brew",version:"(homebrew)"}):a&&(i||b==="brew")&&c.push({pm:"brew",reason:"PATH winner \u2014 kept"}),b===null?{winner:null,removable:[],skipped:[...c,{pm:"(all)",reason:"no definitive winner \u2014 refusing to remove any copy"}]}:{winner:b,removable:j,skipped:c}}t(Y,"planCleanupFrom");function K(){return Y({winnerReal:B(),winnerPm:R(),locations:A().map(e=>({name:e.pm.name,installRoot:e.pm.getInstallRoot(),version:e.version})),brewInstalled:N(),sourceRoot:E()})}t(K,"planCleanup");function U(e){let r=e==="brew"?["brew","uninstall","prjct-cli"]:q[e];try{return F(r[0],r.slice(1),{stdio:"pipe"}),{ok:!0}}catch(o){return{ok:!1,error:`${e}: ${o.message.split(`
8
+ `)[0]}`}}}t(U,"removeOne");async function V(e){let r=H.createInterface({input:process.stdin,output:process.stdout});try{let o=await new Promise(n=>r.question(`${e} [y/N] `,n));return/^y(es)?$/i.test(o.trim())}finally{r.close()}}t(V,"confirm");async function bn(e,r,o){let n=[],a=[];if(e==="off")return n.push("Install consolidation skipped (--no-cleanup)"),{details:n,errors:a};let s=K();if(s.removable.length===0)return n.push(s.skipped.some(i=>i.pm==="(all)")?`Consolidation skipped \u2014 ${s.skipped[0].reason}`:"Single install \u2014 nothing to consolidate"),{details:n,errors:a};let l=s.removable.map(i=>`${i.pm} (${i.version})`).join(", ");if(n.push(`Winner: ${s.winner??"unknown"} \u2014 redundant copies: ${l}`),r){for(let i of s.removable)n.push(`Would remove ${i.pm} copy`);return{details:n,errors:a}}let d=process.stdin.isTTY===!0&&process.stdout.isTTY===!0;if(!(e==="force"||o||d&&await V(`Remove ${s.removable.length} redundant prjct install(s) [${l}], keeping ${s.winner}?`)))return d?n.push("Consolidation declined \u2014 left all installs in place"):n.push(`Multiple installs detected [${l}]. Run \`prjct upgrade --yes\` to consolidate (kept ${s.winner}).`),{details:n,errors:a};for(let i of s.removable){let f=U(i.pm);f.ok?n.push(`Removed redundant ${i.pm} install`):a.push(f.error??`failed to remove ${i.pm}`)}for(let i of s.skipped)n.push(`Kept ${i.pm}: ${i.reason}`);return{details:n,errors:a}}t(bn,"consolidateInstalls");export{tn as a,on as b,N as c,$ as d,sn as e,A as f,an as g,k as h,z as i,G as j,Y as k,K as l,bn as m};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{f as a,i as h}from"./chunk-DMO3ZFUG.mjs";import{b as u,p as l}from"./chunk-D62TAZG6.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";h();l();function d(n){let t=n.toLowerCase();return t.includes("github")?"github":t.includes("gitlab")?"gitlab":t.includes("bitbucket")?"bitbucket":"other"}e(d,"providerForHost");function p(n){let t=n.trim();if(!t)return{};let r=t.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(r)return{provider:d(r[1]),repoSlug:r[2]};try{let o=new URL(t),c=o.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!o.host||!c?{}:{provider:d(o.host),repoSlug:c}}catch{return{}}}e(p,"parseRemote");async function y(n){try{let{stdout:t}=await u("git",["remote","get-url","origin"],{cwd:n});return t.trim()||void 0}catch{return}}e(y,"gitRemoteUrl");async function b(n){try{let{stdout:t}=await u("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return t.trim().replace(/^origin\//,"")||void 0}catch{return}}e(b,"gitDefaultBranch");function i(n){return typeof n=="string"&&n.length>0?n:void 0}e(i,"str");function g(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}e(g,"num");function P(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}e(P,"compact");async function S(n){let t=a.getDoc(n,"project")||{},r=i(t.repoPath),{provider:o,repoSlug:c}=r?p(await y(r)||""):{},f=r?await b(r):void 0,s=Array.isArray(t.techStack)?t.techStack.filter(m=>typeof m=="string"):void 0;return P({provider:o,repoSlug:c,currentBranch:i(t.currentBranch),defaultBranch:f,stack:i(t.stack),techStack:s&&s.length>0?s:void 0,version:i(t.version),commitCount:g(t.commitCount),fileCount:g(t.fileCount),lastCommit:i(t.lastSyncCommit),hasUncommitted:typeof t.hasUncommittedChanges=="boolean"?t.hasUncommittedChanges:void 0,cliVersion:i(t.cliVersion),syncedAt:i(t.lastSync)})}e(S,"buildProjectMeta");export{p as a,S as b};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{i as x,l as h}from"./chunk-ZQ2XH76U.mjs";import{e as b}from"./chunk-6KNMT46X.mjs";import{b as S}from"./chunk-B2HY22OD.mjs";import{a as M,h as I}from"./chunk-UNNY2IWZ.mjs";import{a as l,b as F}from"./chunk-DMO3ZFUG.mjs";import{d as R,j as D}from"./chunk-KPR5TWSN.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";F();var $=.92,v=.18;function d(e){let r=new Map,n=[];for(let s of e){r.set(l(s.content),s.id);let o=x(s.content);n.push(Float64Array.from(o))}return{entries:e,fingerprints:r,vectors:n}}c(d,"buildReferenceIndex");function g(e,r,n){if(!r||r.entries.length===0)return{excess:1,maxSim:0,nearestId:null,exactDup:!1,nearDup:!1};let s=l(e),o=r.fingerprints.get(s);if(o&&o!==n)return{excess:0,maxSim:1,nearestId:o,exactDup:!0,nearDup:!0};let f=x(e),a=r.entries.reduce((t,m,_)=>{if(n&&m.id===n)return t;let E=h(f,r.vectors[_]);return E>t.maxSim?{maxSim:E,nearestId:m.id}:t},{maxSim:0,nearestId:null}),i=Math.max(0,Math.min(1,a.maxSim)),u=a.nearestId,p=i>=$;return{excess:p?0:Math.max(0,Math.min(1,1-i)),maxSim:i,nearestId:u,exactDup:!1,nearDup:p}}c(g,"excessAgainstIndex");function O(e,r,n){return g(e,d(r),n)}c(O,"computeExcess");D();var k=new Set(["decision","gotcha","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","context"]),N=150,T={declared:3,extracted:2,ambiguous:1,inferred:0};function w(e){return e.tags?.context_schema==="living-v2"||e.tags?.synthesis==="model-authored"||e.tags?.synthesis==="deterministic"||e.tags?.source==="land-auto"||e.tags?.capture==="land-v2"}c(w,"isLivingV2");function P(e){return!(!R(e)||e.content.trim().length<40||!k.has(e.type)||e.type==="context"&&!w(e)||e.type==="inbox"||e.type==="todo"||e.type==="idea")}c(P,"isReferenceEligible");function A(e){let r=T[e.provenance]??1,n=e.type==="decision"||e.type==="gotcha"?100:e.type==="learning"||e.type==="fact"?50:e.type==="context"?30:20,s=Date.parse(e.rememberedAt),o=Number.isFinite(s)?s/1e13:0;return n*10+r*3+o}c(A,"referenceRank");function C(e){let r=e.filter(P);return r.sort((n,s)=>A(s)-A(n)),r.slice(0,N)}c(C,"buildReferenceModel");var j=new Set(["decision","gotcha","red-herring","learning","fact","feedback","pattern","anti-pattern","identity","voice","glossary","framework","spec","shipped"]),U=.28;function Z(e,r,n,s){let o=n.trim();if(o.length===0)return{accept:!1,reason:"empty content"};let f=M(o,r);if(f.junk)return{accept:!1,reason:`junk capture: ${f.reason}`};let a=I(o,r,{force:s?.force==="true"||s?.["precision:force"]==="true"});if(a.action==="refuse")return{accept:!1,reason:`precision: ${a.reason}`};if(a.action==="demote")return{accept:!1,reason:`precision demote\u2192${a.demoteTo??"context"}: ${a.reason}`};let i=b(s?.source);if(j.has(r)&&!i)return{accept:!0,reason:"judgment type \u2014 always accept novel content"};let u=(()=>{try{return S.allEntriesForIndex(e)}catch{return null}})();if(!u)return{accept:!0,reason:"gate skipped (read failure)"};if(u.length===0)return{accept:!0,reason:"empty vault \u2014 seed accepted"};let p=C(u);if(p.length===0)return{accept:!0,reason:"empty reference \u2014 accept"};let y=d(p),t=g(o,y),m=i?U:v;return t.exactDup||t.nearDup||t.excess<m?{accept:!1,reason:t.exactDup?`redundant exact match of ${t.nearestId}`:i?`auto-source low excess ${t.excess.toFixed(2)} (floor ${m}) vs R nearest ${t.nearestId}`:`low excess ${t.excess.toFixed(2)} vs reference (nearest ${t.nearestId}, sim ${t.maxSim.toFixed(2)})`,excess:t.excess,nearestId:t.nearestId}:{accept:!0,reason:i?`auto-source excess ${t.excess.toFixed(2)} above floor`:`excess ${t.excess.toFixed(2)} above capture floor`,excess:t.excess,nearestId:t.nearestId}}c(Z,"captureGate");export{N as a,P as b,C as c,$ as d,v as e,d as f,g,O as h,Z as i};
@@ -0,0 +1,11 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as f,b as R}from"./chunk-RP7F67ZT.mjs";import{a as l,p as P}from"./chunk-D62TAZG6.mjs";import{d as k,e as j}from"./chunk-623SNKDH.mjs";import{d as x,f as D,l as g,p as S}from"./chunk-HYIT7MF5.mjs";import{a}from"./chunk-3TRXQAU4.mjs";j();P();S();R();import y from"node:path";S();import C from"node:fs/promises";import F from"node:path";var d=class{static{a(this,"StackDetector")}projectPath;constructor(t){this.projectPath=t}async detect(){let t={hasFrontend:!1,hasBackend:!1,hasDatabase:!1,hasDocker:!1,hasTesting:!1,frontendType:null,frameworks:[]},e=await this.readPackageJson();if(e){let s={...e.dependencies,...e.devDependencies};this.detectFrontend(s,t),this.detectBackend(s,t),this.detectDatabase(s,t),this.detectTesting(s,e,t),this.collectFrameworks(s,t)}return t.hasDocker=await this.detectDocker(),t}detectFrontend(t,e){(t.react||t.vue||t.svelte||t["@angular/core"])&&(e.hasFrontend=!0,e.frontendType="web"),(t["react-native"]||t.expo)&&(e.hasFrontend=!0,e.frontendType=e.frontendType==="web"?"both":"mobile")}detectBackend(t,e){["express","fastify","hono","koa","@nestjs/core","nest","@hapi/hapi","restify","polka"].some(o=>t[o])&&(e.hasBackend=!0)}detectDatabase(t,e){["prisma","@prisma/client","mongoose","pg","mysql2","sequelize","typeorm","drizzle-orm","knex","better-sqlite3","mongodb","redis","ioredis"].some(o=>t[o])&&(e.hasDatabase=!0)}detectTesting(t,e,s){["jest","vitest","mocha","@testing-library/react","@testing-library/vue","cypress","playwright","@playwright/test","ava","tap","bun-types"].some(c=>t[c]||e.devDependencies?.[c])&&(s.hasTesting=!0)}async detectDocker(){let t=["Dockerfile","docker-compose.yml","docker-compose.yaml",".dockerignore"];for(let e of t)if(await this.fileExistsInProject(e))return!0;return!1}collectFrameworks(t,e){t.react&&e.frameworks.push("React"),t.next&&e.frameworks.push("Next.js"),t.vue&&e.frameworks.push("Vue"),t.nuxt&&e.frameworks.push("Nuxt"),t.svelte&&e.frameworks.push("Svelte"),t["@angular/core"]&&e.frameworks.push("Angular"),t["react-native"]&&e.frameworks.push("React Native"),t.expo&&e.frameworks.push("Expo"),t.express&&e.frameworks.push("Express"),t.fastify&&e.frameworks.push("Fastify"),t.hono&&e.frameworks.push("Hono"),t.koa&&e.frameworks.push("Koa"),(t["@nestjs/core"]||t.nest)&&e.frameworks.push("NestJS"),t.astro&&e.frameworks.push("Astro"),t.remix&&e.frameworks.push("Remix"),t.gatsby&&e.frameworks.push("Gatsby")}async readPackageJson(){try{let t=F.join(this.projectPath,"package.json"),e=await C.readFile(t,"utf-8");return JSON.parse(e)}catch{return null}}async fileExistsInProject(t){return g(F.join(this.projectPath,t))}};async function L(r){let t={branch:"main",commits:0,contributors:0,hasChanges:!1,stagedFiles:[],modifiedFiles:[],untrackedFiles:[],recentCommits:[],weeklyCommits:0},e={cwd:r},s=a(i=>i.catch(()=>null),"safe"),[o,c,w,h,b,v]=await Promise.all([s(l("git branch --show-current",e)),s(l("git rev-list --count HEAD",e)),s(l("git shortlog -sn --all",e)),s(l("git status --porcelain",e)),s(l('git log --oneline -20 --pretty=format:"%h|%s|%ad" --date=short',e)),s(l('git log --oneline --since="1 week ago"',e))]);if(o&&(t.branch=o.stdout.trim()||"main"),c&&(t.commits=parseInt(c.stdout.trim(),10)||0),w&&(t.contributors=w.stdout.split(`
8
+ `).filter(i=>i.trim()).length),h){let i=h.stdout.trim().split(`
9
+ `).filter(Boolean);t.hasChanges=i.length>0;for(let p of i){let m=p.substring(0,2),u=p.substring(3);m.startsWith("A")||m.startsWith("M ")?t.stagedFiles.push(u):m.includes("M")?t.modifiedFiles.push(u):m.startsWith("??")&&t.untrackedFiles.push(u)}}return b&&(t.recentCommits=b.stdout.split(`
10
+ `).filter(Boolean).map(i=>{let[p,m,u]=i.split("|");return{hash:p,message:m,date:u}})),v&&(t.weeklyCommits=v.stdout.split(`
11
+ `).filter(i=>i.trim()).length),!o&&!c&&!h&&f.debug("Git analysis failed (not a git repo?)"),t}a(L,"analyzeGit");async function n(r,t){let e=await g(y.join(r,t));return e||f.debug("File not found",{filename:t}),e}a(n,"fileExistsInProject");async function M(r){let t={fileCount:0,version:"0.0.0",name:y.basename(r),ecosystem:"unknown",projectType:"simple",languages:[],frameworks:[]};try{let e=[".js",".ts",".tsx",".py",".go",".rs"],s=await x(r,{skipDotfiles:!0});t.fileCount=s.filter(o=>e.some(c=>o.endsWith(c))).length}catch(e){f.debug("File count failed",{path:r,error:k(e)}),t.fileCount=0}try{let e=y.join(r,"package.json"),s=await D(e);if(!s)throw new Error("No package.json found");t.version=s.version||"0.0.0",t.name=s.name||t.name,t.ecosystem="JavaScript",s.devDependencies?.typescript||await n(r,"tsconfig.json")?t.languages.push("TypeScript"):t.languages.push("JavaScript")}catch(e){f.debug("No package.json found",{path:r,error:k(e)})}return await n(r,"Cargo.toml")?(t.ecosystem="Rust",t.languages.push("Rust")):await n(r,"go.mod")?(t.ecosystem="Go",t.languages.push("Go")):(await n(r,"requirements.txt")||await n(r,"pyproject.toml"))&&(t.ecosystem="Python",t.languages.push("Python")),t.fileCount>300||t.frameworks.length>=3?t.projectType="enterprise":(t.fileCount>50||t.frameworks.length>=2)&&(t.projectType="complex"),t}a(M,"gatherStats");async function H(r){let t={install:"npm install",run:"npm run",test:"npm test",build:"npm run build",dev:"npm run dev",lint:"npm run lint",format:"npm run format"};return await n(r,"bun.lockb")||await n(r,"bun.lock")?(t.install="bun install",t.run="bun run",t.test="bun test",t.build="bun run build",t.dev="bun run dev",t.lint="bun run lint",t.format="bun run format"):await n(r,"pnpm-lock.yaml")?(t.install="pnpm install",t.run="pnpm run",t.test="pnpm test",t.build="pnpm run build",t.dev="pnpm run dev",t.lint="pnpm run lint",t.format="pnpm run format"):await n(r,"yarn.lock")&&(t.install="yarn",t.run="yarn",t.test="yarn test",t.build="yarn build",t.dev="yarn dev",t.lint="yarn lint",t.format="yarn format"),await n(r,"Cargo.toml")&&(t.install="cargo build",t.run="cargo run",t.test="cargo test",t.build="cargo build --release",t.dev="cargo run",t.lint="cargo clippy",t.format="cargo fmt"),await n(r,"go.mod")&&(t.install="go mod download",t.run="go run .",t.test="go test ./...",t.build="go build",t.dev="go run .",t.lint="golangci-lint run",t.format="go fmt ./..."),t}a(H,"detectCommands");async function K(r){return new d(r).detect()}a(K,"detectStack");export{L as a,M as b,H as c,K as d};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as r,b as f}from"./chunk-RP7F67ZT.mjs";import{e as l,g}from"./chunk-225DWS4D.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";g();f();import s from"node:fs/promises";async function m(a){let{skillMdPath:t,skillExists:n,templateContent:o,build:c,logLabel:u}=a;try{let e=c(o);return n&&await s.readFile(t,"utf-8").catch(()=>"")===e.content?{success:!0,action:"unchanged",path:t}:(await s.writeFile(t,e.content,"utf-8"),{success:!0,action:n?"updated":"created",path:t})}catch(e){return r.warn(`${u} skill warning: ${l(e)}`),{success:!1,action:null}}}i(m,"writeSkillIfChanged");export{m as a};
@@ -0,0 +1,15 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as _,c as b}from"./chunk-TIBYHZFA.mjs";import{a as J,b as se}from"./chunk-U24YKPYX.mjs";import{b as P,p as ae}from"./chunk-D62TAZG6.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";function le(t){let e=t.trim();if(e){if(/^sk-or-/i.test(e))return{wire:"openai-compatible",baseUrl:"https://openrouter.ai/api/v1",providerLabel:"OpenRouter",defaultModel:"openai/gpt-4o-mini"};if(/^sk-ant-/i.test(e))return{wire:"anthropic",baseUrl:"https://api.anthropic.com",providerLabel:"Anthropic",defaultModel:"claude-sonnet-4-20250514"};if(/^xai-/i.test(e))return{wire:"openai-compatible",baseUrl:"https://api.x.ai/v1",providerLabel:"xAI",defaultModel:"grok-3-mini"};if(/^sk-/i.test(e))return{wire:"openai-compatible",baseUrl:"https://api.openai.com/v1",providerLabel:"OpenAI",defaultModel:"gpt-4o-mini"}}}i(le,"detectBrainFromKey");function me(t){let e=t.trim().replace(/\/+$/,"");if(e){if(/localhost:11434|127\.0\.0\.1:11434/i.test(e))return{wire:"openai-compatible",baseUrl:w(e),providerLabel:"Ollama",defaultModel:"qwen3.5:4b",weakHint:!0};if(/localhost:1234|127\.0\.0\.1:1234/i.test(e))return{wire:"openai-compatible",baseUrl:w(e),providerLabel:"LM Studio",defaultModel:"local-model",weakHint:!0};if(/api\.anthropic\.com/i.test(e))return{wire:"anthropic",baseUrl:"https://api.anthropic.com",providerLabel:"Anthropic",defaultModel:"claude-sonnet-4-20250514"};if(/openrouter\.ai/i.test(e))return{wire:"openai-compatible",baseUrl:e.includes("/api")?w(e.replace(/\/chat\/completions$/i,"")):"https://openrouter.ai/api/v1",providerLabel:"OpenRouter",defaultModel:"openai/gpt-4o-mini"};if(/api\.x\.ai/i.test(e))return{wire:"openai-compatible",baseUrl:w(e),providerLabel:"xAI",defaultModel:"grok-3-mini"};if(/api\.openai\.com/i.test(e))return{wire:"openai-compatible",baseUrl:w(e),providerLabel:"OpenAI",defaultModel:"gpt-4o-mini"}}}i(me,"detectBrainFromBaseUrl");function w(t){let e=t.replace(/\/+$/,"");return/\/v1$/i.test(e)?e:/\/v1\//i.test(e)?e.replace(/\/v1\/.*$/i,"/v1"):`${e}/v1`}i(w,"ensureV1");function M(t,e){return/openrouter\.ai/i.test(e)&&t&&!t.includes("/")?`openai/${t}`:t}i(M,"normalizeChatModelForBaseUrl");function c(t){return t.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,40)||"default"}i(c,"slugifyProfileName");function d(t){return/localhost|127\.0\.0\.1/i.test(t)}i(d,"isLocalBaseUrl");var Y="PRJCT_OWNED_LLM",U="owned-llm";function ue(){let t=process.env[Y]?.trim().toLowerCase();return t==="0"||t==="false"||t==="off"?!1:t==="1"||t==="true"||t==="on"?!0:_(U)==="on"}i(ue,"isOwnedLlmEnabled");function ce(t){b(U,t?"on":"off")}i(ce,"setOwnedLlmEnabled");function fe(){return`Owned LLM is opt-in and OFF by default (no change to guest harnesses).
8
+ Enable: prjct llm enable
9
+ or: PRJCT_OWNED_LLM=1 prjct llm \u2026
10
+ Disable: prjct llm disable`}i(fe,"ownedLlmEnableHint");var G="llm.active",V="llm.profiles",z="PRJCT_LLM_PROFILE";function pe(t){if(typeof t!="string"||!t.trim())return[];try{let e=JSON.parse(t);if(!Array.isArray(e))return[];let n=[];for(let r of e){let o=de(r);o&&n.push(o)}return n}catch{return[]}}i(pe,"parseProfiles");function de(t){if(!t||typeof t!="object")return null;let e=t,n=typeof e.name=="string"?c(e.name):"",r=typeof e.baseUrl=="string"?e.baseUrl.trim().replace(/\/+$/,""):"",o=typeof e.model=="string"?e.model.trim():"";if(!n||!r||!o)return null;let s=e.wire==="anthropic"?"anthropic":"openai-compatible",a={name:n,wire:s,providerLabel:typeof e.providerLabel=="string"?e.providerLabel:s,baseUrl:r,model:M(o,r)};return typeof e.authHeader=="string"&&(a.authHeader=e.authHeader),typeof e.authScheme=="string"&&(a.authScheme=e.authScheme),e.extraHeaders&&typeof e.extraHeaders=="object"&&!Array.isArray(e.extraHeaders)&&(a.extraHeaders=e.extraHeaders),e.weak===!0&&(a.weak=!0),e.weak===!1&&(a.weak=!1),a}i(de,"coerceProfile");function v(t,e){b(V,JSON.stringify(t)),b(G,e??void 0)}i(v,"persist");function y(){let t=pe(_(V)),e=_(G),n=typeof e=="string"&&e.trim()?c(e):t[0]?.name??null;return{active:n&&t.some(o=>o.name===n)?n:t[0]?.name??null,profiles:t}}i(y,"listLlmProfiles");function A(t){let e=c(t);return y().profiles.find(n=>n.name===e)??null}i(A,"getLlmProfile");function E(){let t=y();if(t.profiles.length===0)return null;let e=process.env[z]?.trim();if(e){let n=t.profiles.find(r=>r.name===c(e));if(n)return n}return t.active?t.profiles.find(n=>n.name===t.active)??null:null}i(E,"getActiveLlmProfile");function X(t,e){let n=c(t.name),r=(t.baseUrl??e?.baseUrl)?.trim().replace(/\/+$/,""),o=(t.model??e?.model)?.trim(),s=t.wire??e?.wire,a=t.providerLabel??e?.providerLabel,m=[];if(r||m.push("baseUrl"),o||m.push("model"),s||m.push("wire"),m.length)return{ok:!1,missing:m};let u=M(o,r),l={name:n,wire:s,providerLabel:a??s,baseUrl:r,model:u};return t.authHeader===null||(typeof t.authHeader=="string"?l.authHeader=t.authHeader:e?.authHeader!==void 0&&(l.authHeader=e.authHeader)),t.authScheme===null||(typeof t.authScheme=="string"?l.authScheme=t.authScheme:e?.authScheme!==void 0&&(l.authScheme=e.authScheme)),t.extraHeaders===null||(t.extraHeaders?l.extraHeaders=t.extraHeaders:e?.extraHeaders&&(l.extraHeaders=e.extraHeaders)),t.weak===null||(t.weak===!0||t.weak===!1?l.weak=t.weak:(e?.weak===!0||e?.weak===!1)&&(l.weak=e.weak)),{ok:!0,profile:l}}i(X,"canCompleteProfile");function ge(t,e={}){let n=c(t.name),r=y(),o=r.profiles.find(p=>p.name===n)??null,s=X({...t,name:n},o);if(!s.ok)throw new Error(`Incomplete LLM profile '${n}' \u2014 missing: ${s.missing.join(", ")}. Provide --base-url and --model (or --key for auto-detect), or set a full profile first.`);let a=s.profile,m=r.profiles.filter(p=>p.name!==n);m.push(a),m.sort((p,ie)=>p.name.localeCompare(ie.name));let u=!o,l=e.activate===!0||e.activate!==!1&&(u||!r.active)?n:r.active,f=l&&m.some(p=>p.name===l)?l:m[0]?.name??null;return v(m,f),a}i(ge,"upsertLlmProfile");function he(t){let e=c(t),n=A(e);if(!n)throw new Error(`Unknown LLM profile '${e}'. Run: prjct llm status`);let r=y();return v(r.profiles,e),n}i(he,"setActiveLlmProfile");function Le(t){let e=c(t),n=y(),r=n.profiles.filter(s=>s.name!==e);if(r.length===n.profiles.length)return!1;let o=n.active===e?r[0]?.name??null:n.active;return v(r,o),!0}i(Le,"removeLlmProfile");function ye(){let t=y().profiles.map(e=>e.name);return v([],null),t}i(ye,"clearAllLlmProfiles");function Z(t){return t.weak===!0?!0:t.weak===!1?!1:!!(d(t.baseUrl)||/\b([1-7])b\b/i.test(t.model)&&/ollama|lm studio|local/i.test(t.providerLabel))}i(Z,"profileImpliesWeakMode");se();ae();import g from"node:fs";import Q from"node:path";var O="PRJCT_LLM_API_KEY",H="prjct-llm",x="ollama";function K(){return process.platform==="darwin"}i(K,"isDarwin");function T(){return process.env.PRJCT_TEST_MODE==="1"||process.env.PRJCT_LLM_FORCE_FILE==="1"}i(T,"preferFileStore");function I(){return Q.join(J(),"config","llm-keys")}i(I,"keyDir");function $(t){let e=c(t).replace(/[^a-zA-Z0-9._-]+/g,"_").slice(0,64);return Q.join(I(),`${e}.key`)}i($,"keyFilePath");function N(t){let e=c(t).toUpperCase().replace(/-/g,"_");return`${O}_${e}`}i(N,"profileKeyEnvName");var k=new Map;async function q(t){try{let{stdout:e}=await P("security",["find-generic-password","-a",t,"-s",H,"-w"]);return e.trim()||null}catch{return null}}i(q,"readKeychain");function ee(t){try{return g.readFileSync($(t),"utf-8").trim()||null}catch{return null}}i(ee,"readFileKey");async function D(t,e={}){let n=c(t),r=process.env[N(n)]?.trim();if(r)return r;if(e.isActive){let s=process.env[O]?.trim();if(s)return s}if(k.has(n))return k.get(n)??null;let o=(!T()&&K()?await q(n):null)??ee(n);return k.set(n,o),o}i(D,"getLlmKey");async function _e(t,e={}){let n=c(t);if(process.env[N(n)]?.trim())return"env-profile";if(e.isActive&&process.env[O]?.trim())return"env";if(!T()&&K()&&await q(n))return"keychain";let r=ee(n);return r?r===x?"dummy":"file":"none"}i(_e,"getLlmKeyLocation");async function be(t,e){let n=c(t),r=e.trim();if(!r)throw new Error("API key must not be empty");if(k.set(n,r),!T()&&K())try{return await P("security",["add-generic-password","-U","-a",n,"-s",H,"-w",r]),"keychain"}catch{}g.mkdirSync(I(),{recursive:!0,mode:448});let o=$(n);g.writeFileSync(o,`${r}
11
+ `,{mode:384});try{g.chmodSync(o,384)}catch{}return"file"}i(be,"setLlmKey");async function R(t){let e=c(t);if(k.delete(e),!T()&&K())try{await P("security",["delete-generic-password","-a",e,"-s",H])}catch{}try{g.unlinkSync($(e))}catch{}}i(R,"clearLlmKey");async function we(t=[]){let e=new Set;for(let n of t)await R(n),e.add(c(n));try{let n=I();if(g.existsSync(n)){for(let r of g.readdirSync(n)){if(!r.endsWith(".key"))continue;let o=r.replace(/\.key$/,"");await R(o),e.add(o)}try{g.rmdirSync(n)}catch{}}}catch{}return[...e]}i(we,"clearAllLlmKeys");function F(t){return t===x}i(F,"isDummyKey");var h=class extends Error{constructor(n,r,o){super(n);this.status=r;this.bodySnippet=o;this.name="LlmHttpError"}status;bodySnippet;static{i(this,"LlmHttpError")}};async function C(t,e,n=fetch){let r=e.timeoutMs??6e4,{timeoutMs:o,...s}=e,a=new AbortController,m=setTimeout(()=>a.abort(),r),u=i(()=>a.abort(),"onCallerAbort");s.signal&&(s.signal.aborted?a.abort():s.signal.addEventListener("abort",u,{once:!0}));try{let l=await n(t,{...s,signal:a.signal}),f=await l.text();if(!l.ok)throw new h(`LLM HTTP ${l.status} from ${t}: ${f.slice(0,400)}`,l.status,f.slice(0,400));let p=(()=>{try{return f?JSON.parse(f):{}}catch{throw new h(`LLM returned non-JSON from ${t}: ${f.slice(0,200)}`,l.status,f.slice(0,200))}})();return{status:l.status,json:p,text:f}}catch(l){if(l instanceof h)throw l;let f=l instanceof Error?l.message:String(l);throw/abort/i.test(f)?new h(`LLM request timed out after ${r}ms (${t})`):new h(`LLM request failed (${t}): ${f}`)}finally{clearTimeout(m),s.signal&&s.signal.removeEventListener("abort",u)}}i(C,"fetchJson");function B(t){if(t==null)return null;if(typeof t=="string")return t;if(Array.isArray(t)){let e=[];for(let n of t)if(typeof n=="string")e.push(n);else if(n&&typeof n=="object"){let r=n;typeof r.text=="string"&&e.push(r.text)}return e.length?e.join(`
12
+ `):null}return String(t)}i(B,"normalizeMessageContent");var ke="2023-06-01";function ne(t){let e=[],n=[],r=i((o,s)=>{let a=n[n.length-1];if(a?.role===o){a.content=xe(a.content,s);return}n.push({role:o,content:s})},"push");for(let o of t){if(o.role==="system"){let s=o.content??"";s&&e.push(s);continue}if(o.role==="tool"){r("user",[{type:"tool_result",tool_use_id:o.tool_call_id??"tool",content:o.content??""}]);continue}if(o.role==="assistant"&&o.tool_calls?.length){let s=[];o.content&&s.push({type:"text",text:o.content});for(let a of o.tool_calls){let m=(()=>{try{return JSON.parse(a.function.arguments||"{}")}catch{return{raw:a.function.arguments}}})();s.push({type:"tool_use",id:a.id,name:a.function.name,input:m})}r("assistant",s);continue}if(o.role==="user"){r("user",o.content??"");continue}o.role==="assistant"&&r("assistant",o.content??"")}return n.length>0&&n[0]?.role==="assistant"&&n.unshift({role:"user",content:"(continue)"}),{system:e.join(`
13
+
14
+ `)||void 0,messages:n}}i(ne,"toAnthropicMessages");function xe(t,e){return[...te(t),...te(e)]}i(xe,"mergeContent");function te(t){return Array.isArray(t)?t:typeof t=="string"?t?[{type:"text",text:t}]:[]:t==null?[]:[t]}i(te,"toBlockArray");function Ce(t){if(t?.length)return t.map(e=>({name:e.function.name,description:e.function.description,input_schema:e.function.parameters??{type:"object",properties:{}}}))}i(Ce,"toAnthropicTools");async function j(t,e,n,r=fetch){let{system:o,messages:s}=ne(e.messages),a={model:t.model,max_tokens:e.max_tokens??4096,messages:s};o&&(a.system=o),e.temperature!==void 0&&(a.temperature=e.temperature);let m=Ce(e.tools);m&&(a.tools=m);let u=t.baseUrl.replace(/\/+$/,""),l=u.includes("/v1/messages")?u:`${u}/v1/messages`,{json:f}=await C(l,{method:"POST",headers:{"content-type":"application/json","x-api-key":n,"anthropic-version":ke,...t.extraHeaders??{}},body:JSON.stringify(a),timeoutMs:e.timeoutMs??6e4},r);return re(f,t.model)}i(j,"anthropicChat");function re(t,e){let n=t,r=n.content??[],o=[],s=[];for(let u of r)u.type==="text"&&u.text&&o.push(u.text),u.type==="tool_use"&&u.name&&s.push({id:u.id??`toolu_${s.length}`,type:"function",function:{name:u.name,arguments:JSON.stringify(u.input??{})}});let a=n.usage?.input_tokens??0,m=n.usage?.output_tokens??0;return{content:o.length?o.join(`
15
+ `):null,tool_calls:s,model:n.model??e,usage:n.usage?{prompt_tokens:n.usage.input_tokens,completion_tokens:n.usage.output_tokens,total_tokens:a+m>0?a+m:void 0}:void 0,finish_reason:n.stop_reason??null,raw:t}}i(re,"parseAnthropicResponse");function Pe(t){let e={"content-type":"application/json",...t.extraHeaders??{}};if(t.apiKey){let n=t.authHeader?.trim()||"Authorization",r=t.authScheme===void 0?"Bearer":t.authScheme;e[n]=r?`${r} ${t.apiKey}`.trim():t.apiKey}return e}i(Pe,"buildHeaders");function Me(t){let e=t.replace(/\/+$/,"");return e.endsWith("/chat/completions")?e:`${e}/chat/completions`}i(Me,"chatUrl");async function W(t,e,n,r=fetch){let o=e.model??t.model,s={model:o,messages:e.messages};e.tools?.length&&(s.tools=e.tools),e.temperature!==void 0&&(s.temperature=e.temperature),e.max_tokens!==void 0&&(s.max_tokens=e.max_tokens),d(t.baseUrl)&&(s.think=!1,s.reasoning_effort="none");let{json:a}=await C(Me(t.baseUrl),{method:"POST",headers:Pe(n),body:JSON.stringify(s),timeoutMs:e.timeoutMs??6e4},r);return oe(a,o)}i(W,"openaiCompatibleChat");function oe(t,e){let n=t,r=n.choices?.[0],o=r?.message,s=(o?.tool_calls??[]).filter(a=>a.function?.name).map((a,m)=>({id:a.id??`call_${m}`,type:"function",function:{name:a.function?.name??"",arguments:a.function?.arguments??"{}"}}));return{content:B(o?.content),tool_calls:s,model:n.model??e,usage:n.usage,finish_reason:r?.finish_reason??null,raw:t}}i(oe,"parseOpenAiChatResponse");var S=class{constructor(e,n,r=fetch,o=6e4){this.profile=e;this.apiKey=n;this.fetchImpl=r;this.defaultTimeoutMs=o}profile;apiKey;fetchImpl;defaultTimeoutMs;static{i(this,"ProfileLlmProvider")}async generate(e){let n=e.timeoutMs??this.defaultTimeoutMs;if(this.profile.wire==="anthropic"){if(!this.apiKey||F(this.apiKey))throw new Error(`Anthropic profile '${this.profile.name}' has no API key. Set with: prjct llm set --name ${this.profile.name} --key <sk-ant-\u2026>`);return j(this.profile,{messages:e.messages,tools:e.tools,temperature:e.temperature,max_tokens:e.max_tokens,timeoutMs:n},this.apiKey,this.fetchImpl)}let r=this.apiKey??(d(this.profile.baseUrl)?x:null);if(!r&&!d(this.profile.baseUrl))throw new Error(`Profile '${this.profile.name}' has no API key. Set with: prjct llm set --name ${this.profile.name} --key <api-key>`);return W(this.profile,{messages:e.messages,tools:e.tools,temperature:e.temperature,max_tokens:e.max_tokens,timeoutMs:n},{apiKey:r,authHeader:this.profile.authHeader,authScheme:this.profile.authScheme,extraHeaders:this.profile.extraHeaders},this.fetchImpl)}};async function ve(t={}){let e=t.profile?A(t.profile):E();if(!e)return null;let n=E()?.name,r=e.name===n,o=t.apiKey!==void 0?t.apiKey:await D(e.name,{isActive:r});return new S(e,o,t.fetchImpl,t.defaultTimeoutMs)}i(ve,"resolveLlmProvider");function Ae(t){return(t.content??"").trim().length>0||t.tool_calls.length>0}i(Ae,"isUsableCompletion");function Ee(t,e){let n=t.usage?.total_tokens??t.usage?.completion_tokens,r=d(e.baseUrl);return["Model returned empty content (and no tool calls).",n!=null?`Tokens used: ${n}.`:null,t.finish_reason?`finish_reason=${t.finish_reason}.`:null,r?"Local/thinking models often burn the budget on hidden reasoning \u2014 try a non-thinking model, raise num_ctx, or set reasoning_effort=none on the server alias.":"Check the model id and that the key has access."].filter(Boolean).join(" ")}i(Ee,"explainUnusableCompletion");export{le as a,me as b,c,d,ue as e,ce as f,fe as g,y as h,A as i,E as j,ge as k,he as l,Le as m,ye as n,Z as o,x as p,_e as q,be as r,R as s,we as t,ve as u,Ae as v,Ee as w};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as y}from"./chunk-F7OOBAJO.mjs";import{c}from"./chunk-4PPIE6GA.mjs";import{F as a,G as j}from"./chunk-HU5ERAAV.mjs";import{f as g,g as u,n as h,p as P}from"./chunk-HYIT7MF5.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";j();P();import x from"node:path";function d(){return x.join(a.getStatePath(),"cloud-linked.json")}s(d,"registryPath");async function l(){let i=await g(d(),[]);return Array.isArray(i)?i.filter(t=>t?.projectId&&t?.projectPath):[]}s(l,"listLinkedProjects");async function _(i,t){let n=(await l()).filter(r=>r.projectId!==i);n.push({projectId:i,projectPath:t}),await h(a.getStatePath()),await u(d(),n)}s(_,"addLinkedProject");async function I(i){let t=await l();await h(a.getStatePath()),await u(d(),t.filter(e=>e.projectId!==i))}s(I,"removeLinkedProject");function v(){return typeof globalThis.WebSocket=="function"}s(v,"hasGlobalWebSocket");function R(i,t,e,n){let r=i.replace(/\/$/,"").replace(/^http/,"ws"),o=new URLSearchParams({key:e,device:n,project:t});return`${r}/ws?${o.toString()}`}s(R,"buildRealtimeUrl");function M(i,t,e){let n=Math.min(e,t*2**i);return Math.round(Math.random()*n)}s(M,"backoffDelay");var p=class{static{s(this,"RealtimeClient")}opts;ws=null;_state="idle";attempt=0;stopped=!1;reconnectTimer=null;constructor(t){this.opts={...t,wsFactory:t.wsFactory??(e=>new globalThis.WebSocket(e)),baseDelayMs:t.baseDelayMs??1e3,maxDelayMs:t.maxDelayMs??3e4}}get state(){return this._state}start(){this.stopped||this._state==="connecting"||this._state==="open"||this.connect()}stop(){this.stopped=!0,this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.closeSocket(),this._state="closed"}connect(){this._state=this.attempt===0?"connecting":"reconnecting";let t=R(this.opts.apiUrl,this.opts.projectId,this.opts.apiKey,this.opts.deviceId),e=(()=>{try{return this.opts.wsFactory(t)}catch{return null}})();if(!e){this.scheduleReconnect();return}this.ws=e,e.onopen=()=>{this._state="open",this.attempt=0},e.onmessage=n=>{this.handleMessage(n?.data)},e.onerror=()=>{},e.onclose=()=>{this.stopped||this.scheduleReconnect()}}async handleMessage(t){let e=(()=>{try{return typeof t=="string"?JSON.parse(t):t}catch{return null}})();if(!e||typeof e!="object")return;let n=e;if(n.type==="event"&&n.event&&typeof n.event=="object")try{await this.opts.apply(this.opts.projectId,n.event)}catch{}}scheduleReconnect(){if(this.stopped)return;this.closeSocket(),this._state="reconnecting";let t=M(this.attempt,this.opts.baseDelayMs,this.opts.maxDelayMs);this.attempt+=1,this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.stopped||this.connect()},t),this.reconnectTimer?.unref?.()}closeSocket(){if(!this.ws)return;let t=this.ws;t.onopen=null,t.onmessage=null,t.onclose=null,t.onerror=null;try{t.close()}catch{}this.ws=null}};var m=class{static{s(this,"RealtimeManager")}clients=new Map;available(){return process.env.PRJCT_IN_DAEMON==="1"&&v()}async startAll(){if(!this.available())return;let t=await l();for(let e of t)try{await this.start(e.projectId,e.projectPath)}catch{}}async start(t,e){if(!this.available()||this.clients.has(t))return;let{default:n}=await import("./config-manager-QY73WM5U.mjs"),r=await n.readConfig(e).catch(()=>null);if(!r?.cloud?.enabled||r.cloud.paused)return;let o=await c.read();if(!o.apiKey)return;let[w,b]=await Promise.all([c.getApiUrl(),c.getDeviceId()]),f=new p({projectId:t,apiUrl:w,apiKey:o.apiKey,deviceId:b,apply:s((k,S)=>y.applyRealtimeEvent(k,S),"apply")});this.clients.set(t,f),f.start()}stop(t){let e=this.clients.get(t);e&&(e.stop(),this.clients.delete(t))}stopAll(){for(let t of this.clients.values())t.stop();this.clients.clear()}status(t){return this.clients.get(t)?.state??"disabled"}},T=new m,N=T;export{l as a,_ as b,I as c,T as d,N as e};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as r}from"./chunk-MCY7OXED.mjs";import{b as t}from"./chunk-RACISWUV.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";function u(o){let n=t(o);return n.allow?null:{deny:n.denyMessage}}e(u,"decideSecrets");function l(o=process.cwd(),n){return r({event:"PreToolUse",projectPath:o,decide:e(async c=>{try{return u(c)}catch{return null}},"decide")},n)}e(l,"runPreSecretsHook");var p={decideSecrets:u};export{u as a,l as b,p as c};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as c}from"./chunk-C7YBUD4K.mjs";import{g as l,h as f,i as u}from"./chunk-SO3ZPNWT.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";var m={none:0,frame:1,reviewed:2},y={none:0,after:1,first:2},p=o((e,n)=>m[e]>=m[n]?e:n,"maxSpec"),g=o((e,n)=>y[e]>=y[n]?e:n,"maxTest");function x(e){return e!=="docs"&&e!=="chore"}o(x,"isCodeKind");function E(e,n,t){let r=x(n);if(n==="research")return{model:"balanced",effort:"medium",spec:"none",tests:"none",fanout:"parallel",quality:"none",expectedPoints:2,directive:"",cast:[]};switch(e){case"H0":return{model:"fast",effort:"low",spec:"none",tests:"none",fanout:"direct",quality:"none",expectedPoints:1,directive:"",cast:[]};case"H1":return{model:"balanced",effort:"medium",spec:"none",tests:r?"after":"none",fanout:"direct",quality:r?"standard":"none",expectedPoints:2,directive:"",cast:[]};case"H2":return{model:"frontier",effort:"medium",spec:r?"frame":"none",tests:r?"first":"none",fanout:"parallel",quality:r?"standard":"none",expectedPoints:5,directive:"",cast:[]};default:return{model:"frontier",effort:t==="high"?"high":"medium",spec:r?"reviewed":"none",tests:r?"first":"none",fanout:"crew",quality:n==="security"||t==="high"||r?"full":"none",expectedPoints:8,directive:"",cast:[]}}}o(E,"baseline");function H(e,n,t,r){if(!x(n))return e;let s=t==="strict"?p(e.spec,"reviewed"):p(e.spec,t==="advisory"?"frame":"none"),a=r==="strict"?g(e.tests,"first"):g(e.tests,r==="assist"?"after":"none");return{...e,spec:s,tests:a}}o(H,"applyModeFloors");var h={none:"no spec",frame:'frame a lightweight spec (`prjct spec "<title>"`)',reviewed:'reviewed spec + audit panel (`prjct spec "<title>"` \u2192 `prjct spec audit <id>`)'},T={none:"no test ceremony",after:"leave a regression test behind",first:"tests BEFORE implementation"},w={direct:"do it yourself \u2014 no subagents",parallel:"DEFAULT multi-agent geometry: explore (fast) \u2192 implement (frontier) \u2192 review (balanced dual-blind); set EACH subagent model explicitly (they inherit yours otherwise: mem_3432). Stay single-thread only for a truly atomic one-file fix",crew:"DEFAULT crew geometry (`prjct crew`): leader + implementer + review lenses. Set EACH subagent model (Explore\u2192fast, implementer\u2192frontier, reviewers\u2192balanced) \u2014 they inherit your expensive model unless you fix it"},v={none:"no judgment tax (trivial)",standard:"quality auto: ledger opened; follow injected `prjct judgment next` card (one review + batch challenge)",full:"quality auto: ledger opened; follow injected next card (RED+BLUE dual-blind + batch refuters)"},S={fast:"fast/cheap model (e.g. haiku)",balanced:"balanced model (e.g. sonnet)",frontier:"frontier model (e.g. opus)"},O="Before implementing, forecast the diff size: if it will exceed ~400 changed lines, decide the delivery strategy NOW (split into stacked PRs / ship a first slice) instead of producing one unreviewable diff.";function P(e,n,t){let r=t.effort==="high"?", HIGH effort":t.effort==="low"?", low effort":"";if(e==="H0")return`Orchestrate (${e} ${n}): trivial \u2014 do it directly on a ${S[t.model]}${r}. ${h[t.spec]}, ${T[t.tests]}, ${w[t.fanout]}. ${v[t.quality]}. Don\u2019t burn frontier tokens on this. ${c}`;let s=e==="H2"||e==="H3"?` ${O}`:"",a=t.fanout==="parallel"||t.fanout==="crew"?" Multi-agent is the DEFAULT geometry for this harness class \u2014 do not collapse to a single-thread monologue unless the change is truly atomic.":"",i=t.cast.length>0?` ${l(t.cast)}. ${f(t.cast)}`:"";return`Orchestrate (${e} ${n}/${t.model}${r}): ${h[t.spec]}; ${T[t.tests]}; ${w[t.fanout]}; ${v[t.quality]}.${s}${a}${i} ${c}`}o(P,"renderDirective");function q(e){return e<50?1:e<150?2:e<400?5:8}o(q,"pointsFromDiffLines");function A(e){return e>=8?`\u26A0 Delegation trigger: ${e} files edited this cycle. This is no longer one change \u2014 split the remainder into its own cycle/PR and run a FRESH-context review of what's already written before \`prjct status done\`.`:e>=4?`\u21B3 Delegation trigger: ${e} files edited this cycle. Keep ONE writer thread; before closing, review the full diff with fresh eyes (subagent or re-read) \u2014 multi-file changes hide cross-file breaks.`:null}o(A,"renderDelegationTrigger");function D(e,n="off",t="off",r="off",s){let a=E(e.level,e.kind,e.risk),i=H(a,e.kind,n,t),b=r==="on"&&i.quality==="none"?"standard":r==="on"&&i.quality==="standard"?"full":i.quality,$=(s??`${e.level}:${e.kind}:${e.risk}`).trim(),C=u(i.fanout,$),d={...i,quality:b,cast:C};return{...d,directive:P(e.level,e.kind,d)}}o(D,"orchestrationFor");export{q as a,A as b,D as c};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as d}from"./chunk-NXUIMC22.mjs";import{d as r}from"./chunk-INJ5WT2D.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";var u={upsert:"updated",delete:"deleted"},o={value:null};async function p(){if(o.value)return o.value;try{let{default:e}=await import("./auth-config-KWLVKHCY.mjs"),t=e;if(typeof t.getDeviceId=="function"){let n=await t.getDeviceId();return o.value=n,n}return"unknown-device"}catch{return"unknown-device"}}i(p,"resolveDeviceId");async function v(e){try{let t=await p(),n=r(e.data),c={type:`${e.entityType}.${u[e.eventType]}`,path:[e.entityType,e.entityId],data:e.data,timestamp:new Date().toISOString(),projectId:e.projectId,entityType:e.entityType,entityId:e.entityId,eventType:e.eventType,contentHash:n,deviceId:t,originDeviceId:e.originDeviceId??t,revisionCount:e.revisionCount??1};await d.publish(c)}catch{}}i(v,"publishCRUD");function a(e){v(e)}i(a,"publishCRUDSync");export{v as a,a as b};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as l}from"./chunk-MCY7OXED.mjs";import{c as u}from"./chunk-RACISWUV.mjs";import{a as s,c}from"./chunk-NINFE7GS.mjs";import{b as i}from"./chunk-XSZOHNL4.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";function g(n){let e=n.tool_input??n.toolInput;return e&&typeof e.command=="string"?e.command:typeof n.command=="string"?n.command:e&&typeof e.command_line=="string"?e.command_line:""}o(g,"extractCommand");function k(n){return n?n.sdd?.mode==="strict"||n.tdd?.mode==="strict"||n.deliveryGeometry?.mode==="strict":!1}o(k,"isStrictPackageMode");async function m(n,e){let a=s(g(e));if(!a)return null;let t=await c(n),r=u(a.packages,t);if(r.allow)return null;let d=await i.readConfig(n).catch(()=>null);return{strict:k(d),message:r.decision?.message??r.denyMessage}}o(m,"evaluatePrePackageInput");function w(n=process.cwd(),e){return l({event:"PreToolUse",projectPath:n,decide:o(async a=>{try{let t=await m(n,a);return t?.strict?{deny:t.message}:null}catch{return null}},"decide"),build:o(async a=>{try{let t=await m(n,a);return!t||t.strict?null:`# prjct: package legitimacy (advisory)
8
+ ${t.message}`}catch{return null}},"build")},e)}o(w,"runPrePackageHook");export{m as a,w as b};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{b as f}from"./chunk-76YMLNLF.mjs";import{a as m}from"./chunk-3TRXQAU4.mjs";function C(r){let e=r.toLowerCase(),s=f.reduce((n,i)=>{let o=i.name;if(Math.abs(o.length-e.length)>2)return n;let t=g(e,o.toLowerCase());return t<n.distance?{name:o,distance:t}:n},{name:null,distance:1/0});return s.distance<=2?s.name:null}m(C,"findClosestCommand");function g(r,e){let s=r.length,n=e.length;if(Math.abs(s-n)>2)return 3;let i=Array.from({length:n+1},(t,c)=>c);return Array.from(r).reduce((t,c,u)=>{let l=[u+1];for(let[a,d]of Array.from(e).entries())l.push(c===d?t[a]:1+Math.min(t[a+1],l[a],t[a]));return l},i)[n]}m(g,"editDistance");export{C as a};
@@ -0,0 +1,14 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{c as P}from"./chunk-ACIOJQSI.mjs";import{d as w}from"./chunk-JPMUJY42.mjs";import{b as M,f as N}from"./chunk-OE27RFLJ.mjs";import{c,d as u,e as g,f as d,g as p}from"./chunk-2EEMQV7N.mjs";import{e as A,g as I}from"./chunk-XWLTEAGN.mjs";import{l as o,p as T}from"./chunk-HYIT7MF5.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";T();import a from"node:path";p();var O=`${g}
8
+ - project facts (stack/commands): see \`PRJCT.md\``,y=`${c}
9
+ ${O}
10
+ ${u}
11
+ `;async function _(t){return d(t,"AGENTS.md",y)}r(_,"writeProjectAgentsMd");p();var D="@PRJCT.md",U=`${c}
12
+ ${D}
13
+ ${u}
14
+ `;async function E(t){return d(t,"CLAUDE.md",U)}r(E,"writeProjectClaudeMd");N();import R from"node:fs/promises";import l from"node:path";T();I();async function K(t){let e=M(t);return e||R.readFile(l.join(A,"templates",t),"utf-8")}r(K,"loadTemplate");async function L(t,e,s){let i=l.join(t,e);await R.mkdir(l.dirname(i),{recursive:!0}),await R.writeFile(i,await K(s),"utf-8")}r(L,"writeRule");async function j(t,e={}){let s=new Set(e.agents??[]),i=[];for(let n of w())(s.has(n.relativePath.split("/")[0].replace(/^\./,""))||n.detectPath&&await o(l.join(t,n.detectPath)))&&(await L(t,n.relativePath,n.templateKey),i.push(n.relativePath));return{written:i}}r(j,"writeProjectIdeRules");async function W(t){let[e,s,i]=await Promise.all([o(a.join(t,"PRJCT.md")),o(a.join(t,"AGENTS.md")),o(a.join(t,"CLAUDE.md"))]);return e||s||i}r(W,"hasAdoptedSurfaces");async function it(t,e={}){if(!(e.explicit||e.refreshIfAdopted&&await W(t)))return{prjctMd:{action:"unchanged",path:a.join(t,"PRJCT.md")},agentsMd:{action:"unchanged",path:a.join(t,"AGENTS.md")},ideRules:[]};let i=new Set(e.agents??[]),n=await o(a.join(t,"CLAUDE.md")),m=i.has("claude")||n,[x,S,f,C]=await Promise.all([P(t),_(t),m?E(t):void 0,j(t,e)]);return{prjctMd:x,agentsMd:S,...f?{claudeMd:f}:{},ideRules:C.written}}r(it,"writeProjectAgentSurfaces");export{it as a};
@@ -0,0 +1,25 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as S,i as G}from"./chunk-DMO3ZFUG.mjs";import{a as B,c as te,d as W,e as $,p as ne}from"./chunk-HYIT7MF5.mjs";import{a as d}from"./chunk-3TRXQAU4.mjs";te();import N from"node:fs/promises";import E from"node:path";G();function j(e,n){S.transaction(e,t=>{t.prepare("DELETE FROM code_symbols").run(),t.prepare("DELETE FROM code_symbol_edges").run();let s=t.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
8
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),i=t.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
9
+ VALUES (?, ?, ?, ?)`);for(let r of n.symbols)s.run(r.id,r.file,r.kind,r.name,r.qname,r.startLine,r.endLine,r.exported?1:0);for(let r of n.edges)i.run(r.src,r.dst,r.edgeType,r.confidence)})}d(j,"replaceCodeGraph");function we(e){try{return S.query(e,"SELECT src, dst, edge_type, confidence FROM code_symbol_edges").map(n=>({src:n.src,dst:n.dst,edgeType:n.edge_type,confidence:n.confidence}))}catch{return[]}}d(we,"loadCodeSymbolEdges");G();ne();var D="symbol-graph",se=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java"]),re=new Set(["if","for","while","switch","catch","function","class","return","typeof","new","throw","await","void","super","this","import","require","console","Math","JSON","Object","Array","Promise","Map","Set","Date","Error","Buffer","process","describe","it","test","expect","beforeEach","afterEach","beforeAll","afterAll"]),oe=new Set(["if","for","while","switch","catch","return","await","typeof","new","throw","else","case","from","import","export","class","function","const","let","var","get","set","constructor","async","static","public","private","protected","readonly","abstract","extends","implements","interface","type","enum","default","as","of","in","do","try","finally","yield","with"]);function L(e,n){return e.slice(0,Math.min(n,e.length)).split(`
10
+ `).length}d(L,"lineOf");function ie(e,n,t,s){return`${e}#${n}:${t}@${s}`}d(ie,"symbolId");function H(e,n){return`${e.replace(/\.[^.]+$/,"").replace(/[/\\]/g,".")}.${n}`}d(H,"qnameOf");function I(e){let n=E.extname(e).toLowerCase();return se.has(n)}d(I,"isSourceFile");function O(e){let n=/\/\/[^\n]*(?:\n|$)|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|"(?:\\[\s\S]|[^"\\])*(?:"|$)|`(?:\\[\s\S]|[^`\\])*(?:`|$)/g;return e.replace(n,t=>t.replace(/[^\n]/g," "))}d(O,"stripNoise");function K(e){return{filePath:e,symbols:[],callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(K,"emptyExtract");function z(e){let n=[...new Set(e.map(t=>t.name))];return{calls:e,callNames:n}}d(z,"finalizeCalls");function ae(e,n){let t=[],s=[],i=new Map,r=O(e),a=[{re:/export\s+(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[\n;])(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1},{re:/export\s+(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1},{re:/export\s+interface\s+(\w+)/g,kind:"interface",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])interface\s+(\w+)/g,kind:"interface",nameIdx:1},{re:/export\s+type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1},{re:/export\s+enum\s+(\w+)/g,kind:"enum",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])enum\s+(\w+)/g,kind:"enum",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*[:=]/g,kind:"const",nameIdx:1,exported:!0},{re:/(?:^|\n)[ \t]+(?:(?:public|private|protected|static|async|readonly)\s+)*(\w+)\s*\([^)]{0,200}\)\s*[:{]/g,kind:"method",nameIdx:1}],o=new Set;for(let{re:m,kind:y,nameIdx:b,exported:C}of a){m.lastIndex=0;for(let _ of r.matchAll(m)){let x=_[b];if(!x||x.length<2||oe.has(x))continue;let h=L(r,_.index),T=`${y}:${x}@${h}`;o.has(T)||(o.add(T),t.push({kind:y,name:x,startLine:h,endLine:null,exported:C===!0}))}}let c=/import\s+(?:type\s+)?(?:\{([^}]+)\}|(\w+)(?:\s*,\s*\{([^}]+)\})?|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let m of e.matchAll(c)){let y=m[5],b=d(C=>{if(C)for(let _ of C.split(",")){let x=_.trim().replace(/^type\s+/,"").split(/\s+as\s+/),h=(x[1]??x[0])?.trim();h&&/^[A-Za-z_][\w]*$/.test(h)&&i.set(h,y)}},"bindNamed");b(m[1]),b(m[3]),m[2]&&i.set(m[2],y),m[4]&&i.set(m[4],y)}let l=/(?:const|let|var)\s+(\w+)\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(let m of e.matchAll(l))i.set(m[1],m[2]);let f=/\b([A-Za-z_][\w]*)\s*\(/g,p=400;for(let m of r.matchAll(f)){let y=m[1];if(re.has(y)||y.length<2)continue;let b=L(r,m.index);if(s.push({name:y,line:b}),s.length>=p)break}let g=/\.(?:get|post|put|patch|delete|options|head|all)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(g)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}let w=/@(?:app|router|api|bp)\.(?:get|post|put|patch|delete|options|head|api_route)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(w)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}if(/(?:^|\/)route\.(ts|js|tsx|jsx)$/.test(n.replace(/\\/g,"/"))){let m=/\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/g;for(let y of e.matchAll(m))t.push({kind:"route",name:`${y[1]} ${n.replace(/\\/g,"/")}`,startLine:L(e,y.index),endLine:null,exported:!0})}let u=z(s);return{filePath:n,symbols:t,callNames:u.callNames,calls:u.calls,importBindings:i,resolvedImports:new Map}}d(ae,"extractTsJs");function ce(e,n){let t=[],s=[],i=O(e),r=/^(?:async\s+)?def\s+(\w+)\s*\(/gm,a=/^class\s+(\w+)/gm;for(let l of i.matchAll(r))t.push({kind:"function",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});for(let l of i.matchAll(a))t.push({kind:"class",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});let o=/\b([A-Za-z_][\w]*)\s*\(/g;for(let l of i.matchAll(o)){let f=l[1];/^(if|for|while|return|print|len|range|str|int|list|dict|set|super|self)$/.test(f)||s.push({name:f,line:L(i,l.index)})}let c=z(s);return{filePath:n,symbols:t,callNames:c.callNames,calls:c.calls,importBindings:new Map,resolvedImports:new Map}}d(ce,"extractPython");function le(e,n){let t=[],s=O(e),i=/^func\s+(?:\([^)]+\)\s+)?(\w+)\s*\(/gm,r=/^type\s+(\w+)\s+(?:struct|interface)/gm;for(let a of s.matchAll(i)){let o=a[1];t.push({kind:"function",name:o,startLine:L(s,a.index),endLine:null,exported:o[0]===o[0].toUpperCase()})}for(let a of s.matchAll(r))t.push({kind:"type",name:a[1],startLine:L(s,a.index),endLine:null,exported:a[1][0]===a[1][0].toUpperCase()});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(le,"extractGo");function de(e,n){let t=[],s=O(e),i=/^(?:pub\s+)?(?:async\s+)?fn\s+(\w+)/gm,r=/^(?:pub\s+)?struct\s+(\w+)/gm,a=/^(?:pub\s+)?trait\s+(\w+)/gm,o=/^(?:pub\s+)?enum\s+(\w+)/gm;for(let[c,l]of[[i,"function"],[r,"class"],[a,"interface"],[o,"enum"]])for(let f of s.matchAll(c))t.push({kind:l,name:f[1],startLine:L(s,f.index),endLine:null,exported:/^pub\b/.test(f[0])});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(de,"extractRust");function me(e,n){let t=[],s=O(e),i=/(?:public\s+|private\s+|protected\s+)?(?:abstract\s+|final\s+)?class\s+(\w+)/g,r=/(?:public\s+)?interface\s+(\w+)/g,a=/(?:public|private|protected)\s+(?:static\s+)?(?:final\s+)?[\w.<>,[\]\s]+\s+(\w+)\s*\(/g;for(let o of s.matchAll(i))t.push({kind:"class",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(r))t.push({kind:"interface",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(a))/^(if|for|while|switch|catch|return|new)$/.test(o[1])||t.push({kind:"method",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(me,"extractJava");function ue(e,n){let t=E.extname(n).toLowerCase();return[".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(t)?ae(e,n):t===".py"?ce(e,n):t===".go"?le(e,n):t===".rs"?de(e,n):t===".java"?me(e,n):K(n)}d(ue,"extractFile");async function fe(e){let n=[];for(let t of["tsconfig.json","jsconfig.json"])try{let i=(await N.readFile(E.join(e,t),"utf-8")).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n]*/g,""),r=JSON.parse(i),a=r.compilerOptions?.paths,o=r.compilerOptions?.baseUrl??".";if(!a)continue;for(let[c,l]of Object.entries(a))n.push({pattern:c,targets:l.map(f=>E.posix.join(o.replace(/\\/g,"/"),f))});break}catch{}return n}d(fe,"loadTsPathMap");function ge(e,n){let t=[];for(let{pattern:s,targets:i}of n)if(s.endsWith("/*")){let r=s.slice(0,-1),a=s.slice(0,-2);if(e===a||e.startsWith(`${a}/`)){let o=e.slice(a.length).replace(/^\//,"");for(let c of i){let l=c.endsWith("/*")?c.slice(0,-1):c;t.push(E.posix.join(l.replace(/\*$/,""),o).replace(/\\/g,"/"))}}}else if(e===s)for(let r of i)t.push(r.replace(/\*$/,""));return t}d(ge,"applyTsPath");async function pe(e,n,t,s){let i=[];if(t.startsWith(".")){let r=E.dirname(E.join(e,n));i.push(E.resolve(r,t))}else if(t.startsWith("@/"))i.push(E.join(e,"src",t.slice(2))),i.push(E.join(e,t.slice(2)));else{for(let r of ge(t,s))i.push(E.join(e,r));i.push(E.join(e,"packages",t)),i.push(E.join(e,"src",t))}for(let r of i)for(let a of B){let o=r+a;try{if((await N.stat(o)).isFile())return E.relative(e,o).replace(/\\/g,"/")}catch{}}return null}d(pe,"resolveSpecifierToFile");async function ye(e,n,t){for(let[s,i]of n.importBindings){let r=await pe(e,n.filePath,i,t);r&&n.resolvedImports.set(s,r)}}d(ye,"resolveImportsForExtract");function U(e,n){let t=e.replace(/\\/g,"/"),s=n.replace(/\\/g,"/").replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"");return t===n||t.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"")===s||t===`${s}.ts`||t===`${s}.tsx`||t===`${s}.js`||t===`${s}.jsx`||t===`${s}/index.ts`||t===`${s}/index.tsx`||t===`${s}/index.js`}d(U,"matchFileToMod");function Y(e,n){return e.filter(s=>s.kind==="function"||s.kind==="method"||s.kind==="class").reduce((s,i)=>i.startLine<=n&&(!s||i.startLine>s.startLine)?i:s,null)}d(Y,"enclosingSymbol");function Z(e,n,t,s){let i=t.filter(o=>o.name===e);if(i.length===1)return{targets:i,confidence:.95};if(i.length>1){let o=i.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.9}}let r=n.resolvedImports.get(e);if(r){let o=(s.get(e)??[]).filter(f=>U(f.file,r));if(o.length>0)return{targets:o,confidence:.9};let c=[...s.values()].flat().filter(f=>U(f.file,r)&&f.exported),l=c.find(f=>f.kind==="function"||f.kind==="class")??c[0];if(l)return{targets:[l],confidence:.65}}let a=s.get(e)??[];if(a.length===1)return{targets:a,confidence:.75};if(a.length>1){let o=a.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.7}}return{targets:[],confidence:0}}d(Z,"resolveCallTargets");function J(e){let n=[],t=[],s=new Map,i=new Map;for(let o of e){let c=[];for(let l of o.symbols){let f=ie(o.filePath,l.kind,l.name,l.startLine),p={id:f,file:o.filePath,kind:l.kind,name:l.name,qname:H(o.filePath,l.name),startLine:l.startLine,endLine:l.endLine,exported:l.exported};n.push(p),c.push(p);let g=s.get(l.name)??[];g.push(p),s.set(l.name,g),t.push({src:`file:${o.filePath}`,dst:f,edgeType:"DEFINES",confidence:1})}i.set(o.filePath,c)}for(let o of e){let c=i.get(o.filePath)??[],l=new Set;for(let f of o.calls){if(c.some(m=>m.name===f.name&&m.startLine===f.line))continue;let{targets:p,confidence:g}=Z(f.name,o,c,s);if(p.length===0)continue;let u=Y(c,f.line)?.id??`file:${o.filePath}`;for(let m of p){if(m.id===u)continue;let y=`${u}|${m.id}`;l.has(y)||(l.add(y),t.push({src:u,dst:m.id,edgeType:"CALLS",confidence:g}))}}}let r=new Set,a=[];for(let o of t){let c=`${o.src}|${o.dst}|${o.edgeType}`;r.has(c)||(r.add(c),a.push(o))}return{symbols:n,edges:a,fileCount:e.length}}d(J,"buildFromExtracts");async function V(e,n){let s=(n??(await W(e)).filter(a=>I(a)&&!a.includes(".d.ts"))).filter(a=>I(a)&&!a.endsWith(".d.ts")),i=await fe(e),r=await $(s,40,async a=>{try{let o=await N.readFile(E.join(e,a),"utf-8"),c=o.length>4e5?o.slice(0,4e5):o;return ue(c,a)}catch{return K(a)}});return await $(r,40,async a=>(await ye(e,a,i),a)),r}d(V,"extractProject");function be(e,n){j(e,n);let t={symbolCount:n.symbols.length,edgeCount:n.edges.length,fileCount:n.fileCount,builtAt:new Date().toISOString()};S.setDoc(e,D,t)}d(be,"persistGraph");function he(e,n,t){let s=new Set([...n.map(c=>c.filePath),...t]);if(s.size===0)return Q(e);let i=xe(e).filter(c=>!s.has(c.file)),r=J(n);S.transaction(e,c=>{let l=c.prepare("DELETE FROM code_symbols WHERE file = ?");for(let u of s)c.prepare("DELETE FROM code_symbol_edges WHERE src LIKE ? OR dst LIKE ? OR src = ? OR dst = ?").run(`${u}#%`,`${u}#%`,`file:${u}`,`file:${u}`),l.run(u);let f=c.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
11
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),p=c.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
12
+ VALUES (?, ?, ?, ?)`);for(let u of r.symbols)f.run(u.id,u.file,u.kind,u.name,u.qname,u.startLine,u.endLine,u.exported?1:0);let g=new Map;for(let u of[...i,...r.symbols]){let m=g.get(u.name)??[];m.push(u),g.set(u.name,m)}let w=new Map;for(let u of[...i,...r.symbols])w.has(u.file)||w.set(u.file,[]),w.get(u.file).push(u);for(let u of n){let m=w.get(u.filePath)??[];for(let b of m.filter(C=>C.file===u.filePath))p.run(`file:${u.filePath}`,b.id,"DEFINES",1);let y=new Set;for(let b of u.calls){if(m.some(T=>T.name===b.name&&T.startLine===b.line))continue;let{targets:C,confidence:_}=Z(b.name,u,m,g);if(C.length===0)continue;let h=Y(m,b.line)?.id??`file:${u.filePath}`;for(let T of C){if(T.id===h)continue;let R=`${h}|${T.id}`;y.has(R)||(y.add(R),p.run(h,T.id,"CALLS",_))}}}});let a=S.get(e,`SELECT
13
+ (SELECT COUNT(*) FROM code_symbols) AS sc,
14
+ (SELECT COUNT(*) FROM code_symbol_edges) AS ec,
15
+ (SELECT COUNT(DISTINCT file) FROM code_symbols) AS fc`),o={symbolCount:a?.sc??0,edgeCount:a?.ec??0,fileCount:a?.fc??0,builtAt:new Date().toISOString()};return S.setDoc(e,D,o),o}d(he,"patchGraph");async function Se(e,n){let t=await V(e),s=J(t);return be(n,s),{symbolCount:s.symbols.length,edgeCount:s.edges.length,fileCount:s.fileCount,builtAt:new Date().toISOString()}}d(Se,"indexSymbols");async function Re(e,n,t,s=[]){if(!X(n))return Se(e,n);let i=t.filter(o=>I(o)&&!o.endsWith(".d.ts")),r=s.filter(o=>I(o));if(i.length===0&&r.length===0)return Q(n)??{symbolCount:0,edgeCount:0,fileCount:0,builtAt:new Date().toISOString()};let a=await V(e,i);return he(n,a,r)??{symbolCount:0,edgeCount:0,fileCount:0,builtAt:new Date().toISOString()}}d(Re,"updateSymbols");function X(e){try{return(S.get(e,"SELECT COUNT(*) AS n FROM code_symbols")?.n??0)>0}catch{return!1}}d(X,"hasSymbolIndex");function Q(e){return S.getDoc(e,D)}d(Q,"loadMeta");function A(e){return{id:e.id,file:e.file,kind:e.kind,name:e.name,qname:e.qname??H(e.file,e.name),startLine:e.start_line,endLine:e.end_line,exported:e.exported===1}}d(A,"rowToSymbol");function xe(e){try{return S.query(e,"SELECT * FROM code_symbols ORDER BY file, start_line").map(A)}catch{return[]}}d(xe,"listAllSymbols");function v(e,n,t={}){let s=t.limit??30,i=`%${n.replace(/[%_]/g,"")}%`;try{return t.kind?S.query(e,`SELECT * FROM code_symbols
16
+ WHERE name LIKE ? COLLATE NOCASE AND kind = ?
17
+ ORDER BY exported DESC, name
18
+ LIMIT ?`,i,t.kind,s).map(A):S.query(e,`SELECT * FROM code_symbols
19
+ WHERE name LIKE ? COLLATE NOCASE OR qname LIKE ? COLLATE NOCASE
20
+ ORDER BY exported DESC, name
21
+ LIMIT ?`,i,i,s).map(A)}catch{return[]}}d(v,"searchSymbols");function Ie(e,n,t=20){let s=n.split(/[^A-Za-z0-9_]+/).flatMap(r=>r.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/)).map(r=>r.trim()).filter(r=>r.length>2);if(s.length===0||!X(e))return[];let i=new Map;for(let r of s){let a=v(e,r,{limit:40});for(let o of a){let c=o.name.toLowerCase()===r.toLowerCase()?1:.55,l=o.exported?1.15:1,f=o.kind==="function"||o.kind==="class"||o.kind==="route"?1.1:1,p=c*l*f,g=i.get(o.file)??{score:0,names:new Set};g.score+=p,g.names.add(o.name),i.set(o.file,g)}}return Array.from(i.entries()).map(([r,a])=>({path:r,score:a.score,matchedNames:[...a.names]})).sort((r,a)=>a.score-r.score).slice(0,t)}d(Ie,"scoreFilesFromQuery");function q(e,n){try{return S.query(e,"SELECT * FROM code_symbols WHERE file = ? ORDER BY start_line",n).map(A)}catch{return[]}}d(q,"symbolsInFile");function P(e,n="CALLS"){let t=new Map,s=new Map;try{let i=S.query(e,"SELECT src, dst FROM code_symbol_edges WHERE edge_type = ?",n);for(let r of i)t.has(r.src)||t.set(r.src,[]),t.get(r.src).push(r.dst),s.has(r.dst)||s.set(r.dst,[]),s.get(r.dst).push(r.src)}catch{}return{forward:t,reverse:s}}d(P,"loadEdges");function ee(e,n){try{let t=S.get(e,"SELECT * FROM code_symbols WHERE id = ?",n);return t?A(t):null}catch{return null}}d(ee,"symbolById");function Fe(e,n,t={}){let s=t.direction??"both",i=Math.min(Math.max(t.depth??3,1),5),r=v(e,n,{limit:10}).filter(w=>w.name.toLowerCase()===n.toLowerCase()),a=r.length>0?r:v(e,n,{limit:5});if(a.length===0)return null;let{forward:o,reverse:c}=P(e,"CALLS"),l=[],f=[],p=d((w,u,m,y)=>{let b=new Set(w),C=w.map(_=>({id:_,depth:0}));for(let{id:_,depth:x}of C)if(!(x>=y))for(let h of u.get(_)??[]){if(b.has(h))continue;if(b.add(h),h.startsWith("file:")){let R=h.slice(5),F=q(e,R),k=F.find(M=>M.exported&&(M.kind==="function"||M.kind==="class"))??F.find(M=>M.kind==="function"||M.kind==="class")??F[0];k&&!b.has(k.id)&&(b.add(k.id),m.push({symbol:k,depth:x+1,via:"CALLS"}),C.push({id:k.id,depth:x+1})),C.push({id:h,depth:x+1});continue}let T=ee(e,h);T&&(m.push({symbol:T,depth:x+1,via:"CALLS"}),C.push({id:h,depth:x+1}))}},"bfs"),g=a.map(w=>w.id);return(s==="inbound"||s==="both")&&p(g,c,l,i),(s==="outbound"||s==="both")&&p(g,o,f,i),{root:a,inbound:l,outbound:f}}d(Fe,"tracePath");function $e(e,n){let t=q(e,n);if(t.length===0)return 0;let{reverse:s}=P(e,"CALLS"),i=new Set;for(let r of t)for(let a of s.get(r.id)??[])i.add(a);return i.size}d($e,"fileFanIn");function ve(e){try{let n=S.query(e,`SELECT target.file AS file, COUNT(DISTINCT edge.src) AS caller_count
22
+ FROM code_symbol_edges AS edge
23
+ JOIN code_symbols AS target ON target.id = edge.dst
24
+ WHERE edge.edge_type = 'CALLS'
25
+ GROUP BY target.file`);return new Map(n.map(t=>[t.file,t.caller_count]))}catch{return new Map}}d(ve,"fileFanInByFile");function Ne(e,n,t=2){let s=new Set(n),{reverse:i}=P(e,"CALLS"),r=new Set;for(let c of n)for(let l of q(e,c))r.add(l.id);let a=new Set,o=new Set(r);return Array.from({length:t}).reduce(c=>{let l=[];for(let f of c)for(let p of i.get(f)??[])if(!o.has(p))if(o.add(p),l.push(p),p.startsWith("file:")){let g=p.slice(5);s.has(g)||a.add(g)}else{let g=ee(e,p);g&&!s.has(g.file)&&a.add(g.file)}return l},[...r]),[...a]}d(Ne,"filesCallingInto");export{j as a,we as b,O as c,ue as d,Se as e,Re as f,X as g,Q as h,xe as i,v as j,Ie as k,q as l,Fe as m,$e as n,ve as o,Ne as p};
@@ -0,0 +1,10 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as h}from"./chunk-DIEPWXJJ.mjs";import{b as k}from"./chunk-NINFE7GS.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";var _=[{name:"sk-\u2026 token",re:/\bsk-[A-Za-z0-9_-]{16,}/},{name:"prjct live token",re:/\bprjct_sk_(?:live|test)_[A-Za-z0-9_-]{8,}/},{name:"GitHub PAT",re:/\bghp_[A-Za-z0-9]{30,}/},{name:"GitHub server PAT",re:/\bghs_[A-Za-z0-9]{30,}/},{name:"GitHub fine-grained PAT",re:/\bgithub_pat_[A-Za-z0-9_]{20,}/},{name:"AWS access key",re:/\bAKIA[0-9A-Z]{16}\b/},{name:"Slack token",re:/\bxox[abps]-[A-Za-z0-9-]{10,}/},{name:"Supabase access token",re:/\bsbp_[A-Za-z0-9]{20,}/},{name:"OpenAI project key",re:/\bsk-proj-[A-Za-z0-9_-]{20,}/},{name:"bearer JWT-ish",re:/\beyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\b/},{name:"PEM private key",re:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/}];function p(n){if(!n)return[];let o=[];for(let{name:e,re:s}of _)s.test(n)&&o.push(e);return o}i(p,"scanForSecrets");function A(n,o=2e5){let e=Math.max(0,o),s=Math.ceil(e/2),r=Math.floor(e/2),t={head:"",tail:"",full:"",totalChars:0,hasPart:!1},c=i(a=>{if(!a||e===0)return;let l=`${t.hasPart?`
8
+ `:""}${a}`;t.hasPart=!0,t.totalChars+=l.length,t.full!==null&&(t.totalChars<=e?t.full+=l:t.full=null),t.head.length<s&&(t.head+=l.slice(0,s-t.head.length)),r>0&&(t.tail=l.length>=r?l.slice(-r):`${t.tail}${l}`.slice(-r))},"push"),u=i((a,l)=>{if(!(l>8)){if(typeof a=="string"){c(a);return}if(Array.isArray(a)){for(let f of a)u(f,l+1);return}if(a&&typeof a=="object")for(let[f,d]of Object.entries(a))/token|secret|password|api[_-]?key|authorization/i.test(f)&&typeof d=="string"?c(`${f}=${d}`):u(d,l+1)}},"walk");return u(n,0),t.full!==null?t.full:t.totalChars>e?`${t.head}
9
+ ${t.tail}`:t.head}i(A,"flattenToolInputText");var m=64*1024,T=512;function y(n,o){if(!n)return;if(n.length<=2e5){for(let r of p(A(n)))o.add(r);return}let e=m-T,s=Array.from({length:Math.ceil(n.length/e)},(r,t)=>t*e);for(let r of s){let t=Math.min(n.length,r+m);for(let c of p(n.slice(r,t)))o.add(c);if(t===n.length)break}}i(y,"addSecretHits");function b(n,o){let e=[n],s=new WeakSet;for(;e.length>0;){let r=e.pop();if(typeof r=="string"){y(r,o);continue}if(!r||typeof r!="object"||s.has(r))continue;if(s.add(r),Array.isArray(r)){for(let c of[...r].reverse())e.push(c);continue}let t=Object.entries(r);for(let[c,u]of t.reverse())/token|secret|password|api[_-]?key|authorization/i.test(c)&&typeof u=="string"?e.push(`${c}=${u}`):e.push(u)}}i(b,"scanUnknownStrings");function w(n){if(n==null)return[];let o=n,e=o.tool_input??o.toolInput??o.parameters??n,s=new Set;b(e,s);for(let r of[o.command,o.prompt,o.content])typeof r=="string"&&y(r,s);return[...s]}i(w,"scanHookToolInput");var g={allow:!0};function x(n,o={}){let e=n??"";if(!e.trim())return{allow:!1,kind:"memory_content",reason:"empty content",hits:[],denyMessage:"refusing empty memory content"};if(o.force)return g;let s=p(e);if(s.length>0){let t=s.join(", ");return{allow:!1,kind:"secrets",reason:"secret-like content",hits:s,denyMessage:`refusing to store memory that looks like a secret (${t}). Re-run with --force if intentional.`}}let r=h(e);if(r.length>0){let t=r.join(", ");return{allow:!1,kind:"prompt_injection",reason:"prompt-injection-like content",hits:r,denyMessage:`refusing to store memory that looks like prompt injection (${t}). Entries are inlined into LLM context \u2014 re-run with --force if intentional.`}}return g}i(x,"evaluateMemoryContent");function $(n){let o=w(n);if(o.length===0)return g;let e=o.join(", ");return{allow:!1,kind:"secrets",reason:"secret pattern in tool input",hits:o,denyMessage:`\u26D4 prjct credential guard: tool input matches secret pattern(s): ${e}. Refusing to run this tool so credentials are not exposed. Remove the secret from the command/content and retry. (This MUST runs on every host \u2014 no PPID / host-env dependency.)`}}i($,"evaluateToolInputSecrets");function M(n,o){let e=k(n,o);return!e.risky||!e.message?{allow:!0,decision:e}:{allow:!1,kind:"package_install",reason:"unknown new packages",hits:e.newPackages,denyMessage:`\u26D4 ${e.message}
10
+ Install denied (strict pack). Verify packages before adding them.`,decision:e}}i(M,"evaluatePackageInstallTrust");function E(n,o){if(n==="imported"){let e=o?.trim()||"workflow rule";return{allow:!1,kind:"workflow_rule",reason:"imported trust_source",hits:["imported"],denyMessage:`Refusing to run imported rule without approval: ${e}. Re-create the rule locally if you trust it.`}}return g}i(E,"evaluateWorkflowRuleExecutable");function Z(n){return n==="imported"}i(Z,"isImportedWorkflowTrust");export{x as a,$ as b,M as c,E as d,Z as e};
@@ -0,0 +1,9 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{n as y,p as h}from"./chunk-D62TAZG6.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";h();var b=2,v=20,p=10,u=400;function k(e){return e.files<=b&&e.loc<=v?"trivial":e.files<=p&&e.loc<=u?"normal":"large"}o(k,"tierOf");function x(e){return e==="trivial"?"direct":e==="normal"?"single":"split"}o(x,"geometryOf");async function l(e,r){return y(e,r)}o(l,"safeGit");function d(e){let r=e.match(/(\d+) files? changed/),t=e.match(/(\d+) insertions?/),s=e.match(/(\d+) deletions?/),i=r?Number.parseInt(r[1],10):0,n=(t?Number.parseInt(t[1],10):0)+(s?Number.parseInt(s[1],10):0);return{files:i,loc:n}}o(d,"parseShortstat");async function G(e){let r=await l(e,["rev-parse","--abbrev-ref","origin/HEAD"]),t=r&&r!=="origin/HEAD"?r:await(async()=>{for(let c of["main","master"])if(await l(e,["rev-parse","--verify","--quiet",c])!==null)return c;return""})();if(!t)return null;let s=await l(e,["merge-base",t,"HEAD"]);if(!s)return null;let i=await l(e,["rev-parse","HEAD"]);if(!i||i===s)return null;let n=await l(e,["diff","--shortstat",`${s}..HEAD`]);if(n===null)return null;let{files:a,loc:m}=d(n),f=await l(e,["diff","--name-only",`${s}..HEAD`])??"",g=[...new Set(f.split(`
8
+ `).filter(Boolean).map(c=>c.includes("/")?c.slice(0,c.indexOf("/")):"."))].sort();return{base:s.slice(0,7),files:a,loc:m,dirs:g,source:"committed"}}o(G,"computeCommittedChangeset");async function w(e){let r=await l(e,["diff","--shortstat","HEAD"]),t=await l(e,["diff","--shortstat","--cached"]);if(r===null&&t===null)return null;let s=d(r??""),i=d(t??""),n=Math.max(s.files,i.files),a=s.loc+i.loc;if(n===0&&a===0)return null;let m=await l(e,["diff","--name-only","HEAD"])??await l(e,["diff","--name-only","--cached"])??"",f=[...new Set(m.split(`
9
+ `).filter(Boolean).map(g=>g.includes("/")?g.slice(0,g.indexOf("/")):"."))].sort();return{base:"HEAD",files:n,loc:a,dirs:f,source:"working-tree"}}o(w,"computeWorkingTreeChangeset");function L(e,r){let t=e.dirs.length>1?` Natural split lines: ${e.dirs.slice(0,6).join(", ")}.`:"";return`Delivery geometry gate: ${e.loc} LOC / ${e.files} files (${e.source}) \u2192 suggested \`${r}\`.${t} Decide explicitly: \`prjct work "<intent>" --geometry split|single|direct\` or split the tree before continuing. (Relax: \`prjct config\` deliveryGeometry off.)`}o(L,"geometryBlockMessage");function $(e){let r=e.harnessLevel,t=e.harnessRisk==="high",s=r==="H3"||r==="H2"&&t,i=!!e.treeLarge||s,n=r==="H3"||t||e.treeLarge?"split":"single";if(e.explicitGeometry)return{blocked:!1,message:null,reason:"has-geometry",geometry:e.explicitGeometry};if(!i)return{blocked:!1,message:null,reason:"not-large",geometry:"direct"};let a=`Delivery geometry (intent): ${r}`+(t?" high-risk":"")+(e.treeLarge?" + large working tree":"")+` \u2192 plan as \`${n}\` before coding. Pass \`prjct work "<intent>" --geometry split|single|direct\` (or stamp geometry on the linked intent/spec). Dynasty: geometry is first-class plan, not only a ship-time afterthought.`;return e.mode==="strict"?{blocked:!0,message:a,reason:e.treeLarge?"tree-strict":"h2-intent-strict",geometry:n}:{blocked:!1,message:`\u26A0\uFE0F ${a}`,reason:"h2-intent-advisory",geometry:n}}o($,"intentGeometryVerdict");function A(e){if(e.mode==="off"||!e.changeset)return{blocked:!1,message:null,tier:"trivial",geometry:"direct",reason:"none"};let r=e.locThreshold??u,t=k(e.changeset),s=x(t);if(e.changeset.loc<r&&t!=="large")return{blocked:!1,message:null,tier:t,geometry:s,reason:"ok-small"};if(e.explicitGeometry)return{blocked:!1,message:null,tier:t,geometry:e.explicitGeometry,reason:"override"};let i=e.changeset.dirs&&e.changeset.dirs.length>1?` Natural split lines: ${e.changeset.dirs.slice(0,6).join(", ")}.`:"",n=`Delivery geometry (ship): ${e.changeset.loc} LOC / ${e.changeset.files} files (${e.changeset.source}) \u2192 suggested \`${s}\`.${i} Decide with \`prjct ship --geometry split|single|direct\` before publishing. (SUPERIOR to silent large PRs \u2014 gentle-ai forecast with teeth.)`;return e.mode==="strict"?{blocked:!0,message:n,tier:t,geometry:s,reason:"strict-block"}:{blocked:!1,message:`\u26A0\uFE0F ${n}`,tier:t,geometry:s,reason:"advisory"}}o(A,"shipGeometryVerdict");export{b as a,v as b,p as c,u as d,k as e,x as f,G as g,w as h,L as i,$ as j,A as k};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a}from"./chunk-3TRXQAU4.mjs";function T(n){let e=new Set;for(let t of n){let s=c(t.message)?.model??t.model;typeof s=="string"&&s.trim()&&e.add(s.trim().slice(0,120))}return e.size===0?"unknown":e.size>1?"mixed":[...e][0]}a(T,"identifyTranscriptModel");function h(n){let e=[];for(let t of n.split(`
8
+ `)){let o=t.trim();if(o)try{let s=JSON.parse(o);s&&typeof s=="object"&&e.push(s)}catch{}}return e}a(h,"parseTranscriptJsonl");function c(n){return n&&typeof n=="object"?n:null}a(c,"asRecord");function r(n){return typeof n=="number"&&Number.isFinite(n)?n:0}a(r,"num");function f(n){let e=r(n.input_tokens)+r(n.cache_creation_input_tokens)+r(n.prompt_tokens)+r(n.promptTokenCount)+r(n.inputOther)+r(n.inputCacheCreation),t=r(n.output_tokens)+r(n.completion_tokens)+r(n.candidatesTokenCount)+r(n.output),o=r(n.cache_read_input_tokens)+r(n.inputCacheRead);return{tokensIn:e,tokensOut:t,cacheRead:o}}a(f,"usagePairFrom");function l(n){return typeof n.timestamp=="string"?Date.parse(n.timestamp):typeof n.time=="number"?n.time:Number.NaN}a(l,"lineTimeMs");function g(n,e){if(!e?.sinceIso&&!e?.untilIso)return!0;let t=l(n);return!(!Number.isFinite(t)||e.sinceIso&&t<Date.parse(e.sinceIso)||e.untilIso&&t>=Date.parse(e.untilIso))}a(g,"inWindow");function I(n,e){let t=n.reduce((u,p)=>{if(!g(p,e))return u;let d=c(c(p.message)?.usage)??c(p.usage)??c(p.usageMetadata);if(!d)return u;let m=f(d);return{tokensInNew:u.tokensInNew+m.tokensIn,tokensOut:u.tokensOut+m.tokensOut,maxCacheRead:Math.max(u.maxCacheRead,m.cacheRead)}},{tokensInNew:0,tokensOut:0,maxCacheRead:0}),{tokensInNew:o,tokensOut:s,maxCacheRead:i}=t;return{tokensInNew:o,cacheReadMax:i,tokensIn:o+i,tokensOut:s}}a(I,"sumTranscriptUsageDetailed");function x(n,e){let t=I(n,e);return{tokensIn:t.tokensIn,tokensOut:t.tokensOut}}a(x,"sumTranscriptUsage");function R(n,e){let t=new Map;for(let s of n){if(!g(s,e))continue;let i=c(s.message),u=c(i?.usage)??c(s.usage)??c(s.usageMetadata);if(!u)continue;let p=i?.model??s.model,d=typeof p=="string"&&p?p:"unknown",m=f(u),k=t.get(d)??{tokensIn:0,tokensOut:0,maxCacheRead:0};k.tokensIn+=m.tokensIn,k.tokensOut+=m.tokensOut,m.cacheRead>k.maxCacheRead&&(k.maxCacheRead=m.cacheRead),t.set(d,k)}let o=new Map;for(let[s,i]of t)o.set(s,{tokensIn:i.tokensIn+i.maxCacheRead,tokensOut:i.tokensOut});return o}a(R,"sumTranscriptUsageByModel");export{T as a,h as b,I as c,x as d,R as e};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as r,c as u}from"./chunk-3TRXQAU4.mjs";function s(){let e=process.env.PRJCT_DEBUG||process.env.DEBUG||"";if(!e)return{level:-1,name:"disabled"};if(a.has(e)||e.includes("prjct"))return{level:n.debug,name:"debug"};let o=n[e]??-1,t=o>=0?e:"disabled";return{level:o,name:t}}function l(e,o,t){return g>=e?(...c)=>console[t](o,...c):v}var n,a,g,L,v,d,b,i=u(()=>{"use strict";n={error:0,warn:1,info:2,debug:3},a=new Set(["1","true","*"]);r(s,"getLogLevel");({level:g,name:L}=s()),v=r(()=>{},"noop");r(l,"createLogMethod");d={error:l(n.error,"[prjct:error]","error"),warn:l(n.warn,"[prjct:warn]","warn"),info:l(n.info,"[prjct:info]","log"),debug:l(n.debug,"[prjct:debug]","log"),isEnabled:r(()=>g>=0,"isEnabled"),level:r(()=>L,"level")},b=d});export{b as a,i as b};