prjct-cli 3.95.0 → 3.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (576) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/bin/prjct.cjs +14 -0
  3. package/dist/bin/core-chunks/agent-HCP5FF77.mjs +31 -0
  4. package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
  5. package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
  6. package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
  7. package/dist/bin/core-chunks/agent-switch-AVSX6SLY.mjs +7 -0
  8. package/dist/bin/core-chunks/agents-OAQXBGH3.mjs +10 -0
  9. package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
  10. package/dist/bin/core-chunks/analysis-3A7ODSSI.mjs +41 -0
  11. package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
  12. package/dist/bin/core-chunks/auto-flush-EWSVMKQN.mjs +7 -0
  13. package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
  14. package/dist/bin/core-chunks/bin-commands-LLHG2NSY.mjs +21 -0
  15. package/dist/bin/core-chunks/capture-7LQ52T6L.mjs +7 -0
  16. package/dist/bin/core-chunks/capture-gate-M4HM7WAI.mjs +7 -0
  17. package/dist/bin/core-chunks/ceremonies-4OZ3FKRE.mjs +19 -0
  18. package/dist/bin/core-chunks/changelog-CUNVCEL5.mjs +10 -0
  19. package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
  20. package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
  21. package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
  22. package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
  23. package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
  24. package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
  25. package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
  26. package/dist/bin/core-chunks/chunk-2ZPM4Z6W.mjs +17 -0
  27. package/dist/bin/core-chunks/chunk-3FXNIJCS.mjs +8 -0
  28. package/dist/bin/core-chunks/chunk-3JD6KRNJ.mjs +8 -0
  29. package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
  30. package/dist/bin/core-chunks/chunk-3USVY66O.mjs +7 -0
  31. package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
  32. package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
  33. package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
  34. package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
  35. package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
  36. package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
  37. package/dist/bin/core-chunks/chunk-53ZPEZLU.mjs +8 -0
  38. package/dist/bin/core-chunks/chunk-56FW4P6U.mjs +10 -0
  39. package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
  40. package/dist/bin/core-chunks/chunk-5MN22JFI.mjs +19 -0
  41. package/dist/bin/core-chunks/chunk-5ONMON5L.mjs +13 -0
  42. package/dist/bin/core-chunks/chunk-5UUITMRX.mjs +9 -0
  43. package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
  44. package/dist/bin/core-chunks/chunk-5YSPND5J.mjs +9 -0
  45. package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
  46. package/dist/bin/core-chunks/chunk-6AFXUX2M.mjs +9 -0
  47. package/dist/bin/core-chunks/chunk-6FFOWWH2.mjs +17 -0
  48. package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
  49. package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
  50. package/dist/bin/core-chunks/chunk-6P4GMVUZ.mjs +18 -0
  51. package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
  52. package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
  53. package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
  54. package/dist/bin/core-chunks/chunk-7CI4AMVO.mjs +7 -0
  55. package/dist/bin/core-chunks/chunk-7QMBIMEX.mjs +64 -0
  56. package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
  57. package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
  58. package/dist/bin/core-chunks/chunk-AJTBFIH2.mjs +9 -0
  59. package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
  60. package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
  61. package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
  62. package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
  63. package/dist/bin/core-chunks/chunk-BQKDJ3U6.mjs +8 -0
  64. package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
  65. package/dist/bin/core-chunks/chunk-BTCCUMKI.mjs +12 -0
  66. package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
  67. package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
  68. package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
  69. package/dist/bin/core-chunks/chunk-CDLZLTRY.mjs +10 -0
  70. package/dist/bin/core-chunks/chunk-CEOTHJIY.mjs +10 -0
  71. package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
  72. package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
  73. package/dist/bin/core-chunks/chunk-CNWEQUB7.mjs +7 -0
  74. package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
  75. package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
  76. package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
  77. package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
  78. package/dist/bin/core-chunks/chunk-DCVPNFS4.mjs +8 -0
  79. package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
  80. package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
  81. package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
  82. package/dist/bin/core-chunks/chunk-DN46DLU3.mjs +10 -0
  83. package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
  84. package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
  85. package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
  86. package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
  87. package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
  88. package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
  89. package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
  90. package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
  91. package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
  92. package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
  93. package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
  94. package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
  95. package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +14 -0
  96. package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
  97. package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
  98. package/dist/bin/core-chunks/chunk-GOIBJ7PV.mjs +7 -0
  99. package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
  100. package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
  101. package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
  102. package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
  103. package/dist/bin/core-chunks/chunk-HEXSVBUP.mjs +8 -0
  104. package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
  105. package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
  106. package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
  107. package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
  108. package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
  109. package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
  110. package/dist/bin/core-chunks/chunk-IFLBZKKK.mjs +14 -0
  111. package/dist/bin/core-chunks/chunk-IMQCXC3R.mjs +30 -0
  112. package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
  113. package/dist/bin/core-chunks/chunk-INM5COWM.mjs +7 -0
  114. package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
  115. package/dist/bin/core-chunks/chunk-IVGWOY3U.mjs +8 -0
  116. package/dist/bin/core-chunks/chunk-J7T5IEFJ.mjs +15 -0
  117. package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
  118. package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
  119. package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
  120. package/dist/bin/core-chunks/chunk-K25HGTC3.mjs +10 -0
  121. package/dist/bin/core-chunks/chunk-KIRU4QFX.mjs +7 -0
  122. package/dist/bin/core-chunks/chunk-KKIJAEYU.mjs +7 -0
  123. package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
  124. package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
  125. package/dist/bin/core-chunks/chunk-KWC2PCPC.mjs +10 -0
  126. package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
  127. package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
  128. package/dist/bin/core-chunks/chunk-LZC6NGB6.mjs +50 -0
  129. package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
  130. package/dist/bin/core-chunks/chunk-MDONTD7O.mjs +21 -0
  131. package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
  132. package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
  133. package/dist/bin/core-chunks/chunk-MTDCRYLP.mjs +7 -0
  134. package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
  135. package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
  136. package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
  137. package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
  138. package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
  139. package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
  140. package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
  141. package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
  142. package/dist/bin/core-chunks/chunk-OYXQRBVM.mjs +10 -0
  143. package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
  144. package/dist/bin/core-chunks/chunk-P53YMOKR.mjs +7 -0
  145. package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
  146. package/dist/bin/core-chunks/chunk-PPERWRFS.mjs +13 -0
  147. package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
  148. package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
  149. package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
  150. package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
  151. package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
  152. package/dist/bin/core-chunks/chunk-QLMZW4K7.mjs +7 -0
  153. package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
  154. package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +7 -0
  155. package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
  156. package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
  157. package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
  158. package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
  159. package/dist/bin/core-chunks/chunk-RXXXA7Z6.mjs +7 -0
  160. package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
  161. package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
  162. package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
  163. package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
  164. package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
  165. package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
  166. package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
  167. package/dist/bin/core-chunks/chunk-TGNZI4KF.mjs +28 -0
  168. package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
  169. package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
  170. package/dist/bin/core-chunks/chunk-TTN2CFZC.mjs +7 -0
  171. package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
  172. package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
  173. package/dist/bin/core-chunks/chunk-UE3XKXWM.mjs +7 -0
  174. package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
  175. package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
  176. package/dist/bin/core-chunks/chunk-UT425KVX.mjs +10 -0
  177. package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
  178. package/dist/bin/core-chunks/chunk-V3Y3G2DE.mjs +8 -0
  179. package/dist/bin/core-chunks/chunk-V5VCXMKO.mjs +52 -0
  180. package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
  181. package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
  182. package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
  183. package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
  184. package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
  185. package/dist/bin/core-chunks/chunk-VDXTMAMO.mjs +7 -0
  186. package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +103 -0
  187. package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
  188. package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
  189. package/dist/bin/core-chunks/chunk-WGDE3L33.mjs +7 -0
  190. package/dist/bin/core-chunks/chunk-WP5IU4W4.mjs +7 -0
  191. package/dist/bin/core-chunks/chunk-WSVMQYYU.mjs +12 -0
  192. package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
  193. package/dist/bin/core-chunks/chunk-WZXUFSVT.mjs +25 -0
  194. package/dist/bin/core-chunks/chunk-X35YYOFE.mjs +18 -0
  195. package/dist/bin/core-chunks/chunk-X4FR5S7E.mjs +9 -0
  196. package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
  197. package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
  198. package/dist/bin/core-chunks/chunk-XPRLQIVQ.mjs +7 -0
  199. package/dist/bin/core-chunks/chunk-XSZG3CBO.mjs +7 -0
  200. package/dist/bin/core-chunks/chunk-XU3BQPBU.mjs +7 -0
  201. package/dist/bin/core-chunks/chunk-XYDLXF5A.mjs +8 -0
  202. package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +7 -0
  203. package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
  204. package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
  205. package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
  206. package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
  207. package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
  208. package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
  209. package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
  210. package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
  211. package/dist/bin/core-chunks/chunk-ZHTYSYZC.mjs +7 -0
  212. package/dist/bin/core-chunks/chunk-ZK7BMUMR.mjs +7 -0
  213. package/dist/bin/core-chunks/chunk-ZKJZDOPT.mjs +14 -0
  214. package/dist/bin/core-chunks/chunk-ZQHSJ6FF.mjs +20 -0
  215. package/dist/bin/core-chunks/chunk-ZS7XJUPE.mjs +7 -0
  216. package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
  217. package/dist/bin/core-chunks/cleanup-installs-WHXUGAHM.mjs +7 -0
  218. package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
  219. package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
  220. package/dist/bin/core-chunks/cloud-FFUJZLDV.mjs +14 -0
  221. package/dist/bin/core-chunks/code-SU7GCPH6.mjs +12 -0
  222. package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
  223. package/dist/bin/core-chunks/codex-hooks-GOLMCL2Q.mjs +7 -0
  224. package/dist/bin/core-chunks/codex-mcp-K4X2UIQF.mjs +7 -0
  225. package/dist/bin/core-chunks/codex-skill-3HNVU4T4.mjs +7 -0
  226. package/dist/bin/core-chunks/command-installer-XIQK2G6W.mjs +7 -0
  227. package/dist/bin/core-chunks/config-W3RHV3GK.mjs +8 -0
  228. package/dist/bin/core-chunks/config-manager-QVFHXIKI.mjs +7 -0
  229. package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
  230. package/dist/bin/core-chunks/context-4KGTUAC4.mjs +38 -0
  231. package/dist/bin/core-chunks/context-DDHC7VIC.mjs +10 -0
  232. package/dist/bin/core-chunks/context-checkpoint-4CEUPEVG.mjs +27 -0
  233. package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
  234. package/dist/bin/core-chunks/context-tiers-4S6H22NP.mjs +7 -0
  235. package/dist/bin/core-chunks/context7-service-AZWDYK5Z.mjs +7 -0
  236. package/dist/bin/core-chunks/core-PR5WEQCS.mjs +70 -0
  237. package/dist/bin/core-chunks/crew-JQCG6NS3.mjs +24 -0
  238. package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
  239. package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
  240. package/dist/bin/core-chunks/cwd-changed-ODKZVSPB.mjs +7 -0
  241. package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
  242. package/dist/bin/core-chunks/daemon-2NQTBFVR.mjs +13 -0
  243. package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
  244. package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
  245. package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
  246. package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
  247. package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
  248. package/dist/bin/core-chunks/developer-profile-MRPBWL2K.mjs +7 -0
  249. package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
  250. package/dist/bin/core-chunks/distill-MLDZG5RA.mjs +7 -0
  251. package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +7 -0
  252. package/dist/bin/core-chunks/doctor-service-WXLB2FEE.mjs +8 -0
  253. package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
  254. package/dist/bin/core-chunks/dynasty-outcomes-H2O546OL.mjs +11 -0
  255. package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
  256. package/dist/bin/core-chunks/embeddings-7A5Z5I67.mjs +7 -0
  257. package/dist/bin/core-chunks/enriched-recall-YXK7EIKH.mjs +7 -0
  258. package/dist/bin/core-chunks/eval-4YFUBFLV.mjs +76 -0
  259. package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
  260. package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
  261. package/dist/bin/core-chunks/format-5V6GF6JJ.mjs +7 -0
  262. package/dist/bin/core-chunks/gemini-settings-ZTU3VQU3.mjs +7 -0
  263. package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
  264. package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
  265. package/dist/bin/core-chunks/grok-mcp-F3SRFMCW.mjs +7 -0
  266. package/dist/bin/core-chunks/grok-plugin-4CE2WUYI.mjs +7 -0
  267. package/dist/bin/core-chunks/grok-skill-GLSBOOKW.mjs +7 -0
  268. package/dist/bin/core-chunks/guard-FJBJ6IAE.mjs +13 -0
  269. package/dist/bin/core-chunks/guards-LFUFKVVH.mjs +7 -0
  270. package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
  271. package/dist/bin/core-chunks/harness-FN3HASSA.mjs +43 -0
  272. package/dist/bin/core-chunks/health-W2VWME7Z.mjs +11 -0
  273. package/dist/bin/core-chunks/help-I37I3V2R.mjs +14 -0
  274. package/dist/bin/core-chunks/hooks-service-C2P5DRCH.mjs +91 -0
  275. package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
  276. package/dist/bin/core-chunks/install-XP4S6HWQ.mjs +9 -0
  277. package/dist/bin/core-chunks/judgment-GJE332LF.mjs +21 -0
  278. package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
  279. package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
  280. package/dist/bin/core-chunks/judgment-receipt-WT4EMCAV.mjs +7 -0
  281. package/dist/bin/core-chunks/kimi-hooks-2UEUIKXV.mjs +7 -0
  282. package/dist/bin/core-chunks/kimi-mcp-DJCXZ2JY.mjs +7 -0
  283. package/dist/bin/core-chunks/land-cue-5USQ64MS.mjs +8 -0
  284. package/dist/bin/core-chunks/land-rho-ISNVEPVC.mjs +8 -0
  285. package/dist/bin/core-chunks/land-synthesis-CHARJMUP.mjs +7 -0
  286. package/dist/bin/core-chunks/lean-L53CKZNH.mjs +34 -0
  287. package/dist/bin/core-chunks/legacy-crew-sweep-2TLKJTHI.mjs +23 -0
  288. package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
  289. package/dist/bin/core-chunks/llm-XMH7WTHV.mjs +18 -0
  290. package/dist/bin/core-chunks/mcp-FLVIZBV2.mjs +17 -0
  291. package/dist/bin/core-chunks/memory-dream-EJWI4FJO.mjs +14 -0
  292. package/dist/bin/core-chunks/memory-export-27HTNNFI.mjs +13 -0
  293. package/dist/bin/core-chunks/memory-index-BRZDZ2BY.mjs +7 -0
  294. package/dist/bin/core-chunks/notification-KJ4FQJAW.mjs +7 -0
  295. package/dist/bin/core-chunks/notify-76B7AICZ.mjs +9 -0
  296. package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
  297. package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
  298. package/dist/bin/core-chunks/opencode-mcp-5YSIYDI3.mjs +7 -0
  299. package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
  300. package/dist/bin/core-chunks/pack-integrity-GXN67LJB.mjs +9 -0
  301. package/dist/bin/core-chunks/pack-manager-46SPIPPD.mjs +7 -0
  302. package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +7 -0
  303. package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
  304. package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
  305. package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
  306. package/dist/bin/core-chunks/pi-skill-SDHTUK3V.mjs +7 -0
  307. package/dist/bin/core-chunks/planning-S3MYVWH6.mjs +8 -0
  308. package/dist/bin/core-chunks/post-edit-5YSNEMK7.mjs +7 -0
  309. package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
  310. package/dist/bin/core-chunks/pre-bash-GLDILCRF.mjs +10 -0
  311. package/dist/bin/core-chunks/pre-commit-U6HPPNIC.mjs +7 -0
  312. package/dist/bin/core-chunks/pre-edit-PEYQA6P6.mjs +8 -0
  313. package/dist/bin/core-chunks/pre-package-76JR5GLO.mjs +7 -0
  314. package/dist/bin/core-chunks/pre-search-5EHNUOP3.mjs +8 -0
  315. package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
  316. package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
  317. package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
  318. package/dist/bin/core-chunks/preferences-BTSYWYUM.mjs +31 -0
  319. package/dist/bin/core-chunks/primitives-IXAYLX7U.mjs +13 -0
  320. package/dist/bin/core-chunks/prjct-md-SUDFWDCS.mjs +7 -0
  321. package/dist/bin/core-chunks/product-KKGJ6MMF.mjs +68 -0
  322. package/dist/bin/core-chunks/project-agent-surfaces-I2CUZUIN.mjs +7 -0
  323. package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
  324. package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
  325. package/dist/bin/core-chunks/project-memory-GYLYIJQD.mjs +7 -0
  326. package/dist/bin/core-chunks/project-style-evolution-5W25UPPN.mjs +7 -0
  327. package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +23 -0
  328. package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
  329. package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
  330. package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
  331. package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
  332. package/dist/bin/core-chunks/purge-5EPJV25P.mjs +7 -0
  333. package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
  334. package/dist/bin/core-chunks/registry-LK6IQ5UX.mjs +7 -0
  335. package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
  336. package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
  337. package/dist/bin/core-chunks/retention-S22T3SPT.mjs +7 -0
  338. package/dist/bin/core-chunks/retro-CLKOHAN6.mjs +13 -0
  339. package/dist/bin/core-chunks/review-risk-LLLBKUXT.mjs +12 -0
  340. package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
  341. package/dist/bin/core-chunks/safe-artifacts-RW5WQUUJ.mjs +9 -0
  342. package/dist/bin/core-chunks/sdd-HE7O6N5S.mjs +9 -0
  343. package/dist/bin/core-chunks/seed-JX7W53E5.mjs +10 -0
  344. package/dist/bin/core-chunks/self-heal-DFUEKNF3.mjs +7 -0
  345. package/dist/bin/core-chunks/session-continuity-BFSW4OL6.mjs +10 -0
  346. package/dist/bin/core-chunks/session-start-HVYUKJL2.mjs +7 -0
  347. package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
  348. package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
  349. package/dist/bin/core-chunks/setup-GHS24ER5.mjs +140 -0
  350. package/dist/bin/core-chunks/setup-J4JFYT63.mjs +38 -0
  351. package/dist/bin/core-chunks/shipping-I4D4AVTE.mjs +12 -0
  352. package/dist/bin/core-chunks/signals-digest-V44KYN6Z.mjs +7 -0
  353. package/dist/bin/core-chunks/skill-adherence-MHY4BZL4.mjs +13 -0
  354. package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
  355. package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
  356. package/dist/bin/core-chunks/spec-2XXPLHUZ.mjs +27 -0
  357. package/dist/bin/core-chunks/spec-context-inference-THFMXC7S.mjs +9 -0
  358. package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
  359. package/dist/bin/core-chunks/spec-service-I23KJKKP.mjs +7 -0
  360. package/dist/bin/core-chunks/spec-task-breakdown-HTG6ME6G.mjs +7 -0
  361. package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
  362. package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
  363. package/dist/bin/core-chunks/stop-2H57XCGZ.mjs +15 -0
  364. package/dist/bin/core-chunks/subagent-start-5LPASXOS.mjs +7 -0
  365. package/dist/bin/core-chunks/subagent-stop-ANLSG3KN.mjs +7 -0
  366. package/dist/bin/core-chunks/surface-attribution-WL7S53XX.mjs +7 -0
  367. package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
  368. package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
  369. package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
  370. package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
  371. package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
  372. package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
  373. package/dist/bin/core-chunks/task-service-FK7FC3PE.mjs +7 -0
  374. package/dist/bin/core-chunks/tdd-NQDHU62B.mjs +9 -0
  375. package/dist/bin/core-chunks/team-XZ4Q6UBV.mjs +42 -0
  376. package/dist/bin/core-chunks/template-loader-33OVJ4G5.mjs +7 -0
  377. package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
  378. package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
  379. package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
  380. package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
  381. package/dist/bin/core-chunks/uninstall-6NFON7FO.mjs +13 -0
  382. package/dist/bin/core-chunks/update-4IE6SA6M.mjs +11 -0
  383. package/dist/bin/core-chunks/update-checker-FK7MWNWN.mjs +7 -0
  384. package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
  385. package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
  386. package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
  387. package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
  388. package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
  389. package/dist/bin/core-chunks/version-252QLBN2.mjs +7 -0
  390. package/dist/bin/core-chunks/watch-service-7ZERG7RC.mjs +9 -0
  391. package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +7 -0
  392. package/dist/bin/core-chunks/weak-model-mode-DH66XMD2.mjs +7 -0
  393. package/dist/bin/core-chunks/work-graph-JGJWE3AV.mjs +16 -0
  394. package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
  395. package/dist/bin/core-chunks/work-scope-3LXOEIUX.mjs +7 -0
  396. package/dist/bin/core-chunks/workflow-FGJVLRQ3.mjs +61 -0
  397. package/dist/bin/core-chunks/workflows-reference-UWKRZ6BJ.mjs +7 -0
  398. package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
  399. package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
  400. package/dist/bin/core-chunks/world-model-impact-RH5WH2B3.mjs +7 -0
  401. package/dist/bin/hook-chunks/{agent-identity-45BYQBU2.mjs → agent-identity-DH6DX72X.mjs} +1 -1
  402. package/dist/bin/hook-chunks/{agent-switch-4ZJJWKMD.mjs → agent-switch-7GOGG4KG.mjs} +1 -1
  403. package/dist/bin/hook-chunks/{analysis-UGHAG2SK.mjs → analysis-UI2JRLJO.mjs} +3 -3
  404. package/dist/bin/hook-chunks/{auto-flush-CXWTU3RF.mjs → auto-flush-JKIXTI2I.mjs} +1 -1
  405. package/dist/bin/hook-chunks/{capture-gate-PS6QUXLX.mjs → capture-gate-DIPHPNIC.mjs} +1 -1
  406. package/dist/bin/hook-chunks/{chunk-YDBZO6I3.mjs → chunk-22GFTUER.mjs} +1 -1
  407. package/dist/bin/hook-chunks/chunk-25OGCQTR.mjs +69 -0
  408. package/dist/bin/hook-chunks/{chunk-DCSKTMDX.mjs → chunk-3CKNJ5RA.mjs} +1 -1
  409. package/dist/bin/hook-chunks/{chunk-ABJNOG2I.mjs → chunk-3FEXJUO2.mjs} +1 -1
  410. package/dist/bin/hook-chunks/{chunk-22AXWLI6.mjs → chunk-3HGQPUKG.mjs} +1 -1
  411. package/dist/bin/hook-chunks/{chunk-GLPKMG5A.mjs → chunk-63P5VOR6.mjs} +10 -10
  412. package/dist/bin/hook-chunks/{chunk-PP6DANGV.mjs → chunk-6LU777GI.mjs} +1 -1
  413. package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
  414. package/dist/bin/hook-chunks/{chunk-QL3NYJTW.mjs → chunk-6RS7PNAN.mjs} +1 -1
  415. package/dist/bin/hook-chunks/{chunk-PO3QDKTE.mjs → chunk-6WDRJ7J7.mjs} +1 -1
  416. package/dist/bin/hook-chunks/chunk-7PA4KPSR.mjs +51 -0
  417. package/dist/bin/hook-chunks/{chunk-QP5USCDX.mjs → chunk-7WO5CEH3.mjs} +1 -1
  418. package/dist/bin/hook-chunks/{chunk-FW4MEPTB.mjs → chunk-A6LRNS6R.mjs} +1 -1
  419. package/dist/bin/hook-chunks/{chunk-GCDLPKOH.mjs → chunk-AEDB75AK.mjs} +1 -1
  420. package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
  421. package/dist/bin/hook-chunks/{chunk-WGWE3CSC.mjs → chunk-ANSRNEEI.mjs} +1 -1
  422. package/dist/bin/hook-chunks/{chunk-RTEEXGEA.mjs → chunk-AORD3YDQ.mjs} +1 -1
  423. package/dist/bin/hook-chunks/chunk-B2ZA5ZAO.mjs +8 -0
  424. package/dist/bin/hook-chunks/{chunk-BOBFTVAY.mjs → chunk-B7MHIUFA.mjs} +1 -1
  425. package/dist/bin/hook-chunks/{chunk-Z6KVLCMK.mjs → chunk-BKJHD5JI.mjs} +1 -1
  426. package/dist/bin/hook-chunks/{chunk-4NTVXJD7.mjs → chunk-BVK7ZDLX.mjs} +1 -1
  427. package/dist/bin/hook-chunks/{chunk-IGHY4FGS.mjs → chunk-CPR4FPXG.mjs} +1 -1
  428. package/dist/bin/hook-chunks/{chunk-5XA5RL5I.mjs → chunk-ETTDRXQ6.mjs} +1 -1
  429. package/dist/bin/hook-chunks/chunk-F3PNT2DQ.mjs +19 -0
  430. package/dist/bin/hook-chunks/{chunk-C4O243NG.mjs → chunk-FBEDUKMG.mjs} +1 -1
  431. package/dist/bin/hook-chunks/{chunk-5H3KJWQS.mjs → chunk-GER6HFWV.mjs} +2 -2
  432. package/dist/bin/hook-chunks/{chunk-IWJG7CZX.mjs → chunk-GSPDJSJ5.mjs} +1 -1
  433. package/dist/bin/hook-chunks/chunk-H5AVBDCH.mjs +8 -0
  434. package/dist/bin/hook-chunks/{chunk-HEDZA6KC.mjs → chunk-HGZQWYBL.mjs} +1 -1
  435. package/dist/bin/hook-chunks/{chunk-GDESYWTD.mjs → chunk-HNZ24HIK.mjs} +2 -2
  436. package/dist/bin/hook-chunks/{chunk-S5ISOGDB.mjs → chunk-IDPBMN3Q.mjs} +1 -1
  437. package/dist/bin/hook-chunks/{chunk-PTA7DMLM.mjs → chunk-IFIENAZU.mjs} +1 -1
  438. package/dist/bin/hook-chunks/chunk-IHEOOJJT.mjs +11 -0
  439. package/dist/bin/hook-chunks/{chunk-S5N2ZZDL.mjs → chunk-IL36ER4U.mjs} +1 -1
  440. package/dist/bin/hook-chunks/{chunk-6GAFRIUQ.mjs → chunk-IWUF2LGO.mjs} +1 -1
  441. package/dist/bin/hook-chunks/{chunk-OGIFB3OE.mjs → chunk-JF6DFOQK.mjs} +1 -1
  442. package/dist/bin/hook-chunks/{chunk-Z4X7JIAP.mjs → chunk-JGZ3QGWX.mjs} +3 -3
  443. package/dist/bin/hook-chunks/chunk-KOLXYWOA.mjs +36 -0
  444. package/dist/bin/hook-chunks/{chunk-DVDZA63F.mjs → chunk-MIJZT4ZR.mjs} +1 -1
  445. package/dist/bin/hook-chunks/{chunk-J5UQVJUW.mjs → chunk-NCLONKOT.mjs} +1 -1
  446. package/dist/bin/hook-chunks/{chunk-QBYHZX33.mjs → chunk-NJ74RHNC.mjs} +1 -1
  447. package/dist/bin/hook-chunks/{chunk-NLKPAJND.mjs → chunk-NMB6YSAH.mjs} +1 -1
  448. package/dist/bin/hook-chunks/{chunk-MHNWIB7B.mjs → chunk-NSTXHVTH.mjs} +2 -2
  449. package/dist/bin/hook-chunks/{chunk-N3L77UNM.mjs → chunk-ONGVBXBD.mjs} +1 -1
  450. package/dist/bin/hook-chunks/{chunk-X5W2UYQK.mjs → chunk-PFORBQBF.mjs} +3 -3
  451. package/dist/bin/hook-chunks/{chunk-KSSRINDX.mjs → chunk-PPWPUEBH.mjs} +1 -1
  452. package/dist/bin/hook-chunks/{chunk-76GDLA3Z.mjs → chunk-PQJ64L6U.mjs} +1 -1
  453. package/dist/bin/hook-chunks/{chunk-PGWFGRX4.mjs → chunk-QOQZHR3E.mjs} +1 -1
  454. package/dist/bin/hook-chunks/{chunk-2UC4DTDO.mjs → chunk-QXCEBAIA.mjs} +1 -1
  455. package/dist/bin/hook-chunks/{chunk-I26F7TLM.mjs → chunk-RLKYEL3F.mjs} +1 -1
  456. package/dist/bin/hook-chunks/{chunk-BDOAQVIF.mjs → chunk-SQW2B7NW.mjs} +1 -1
  457. package/dist/bin/hook-chunks/{chunk-4HAKTI36.mjs → chunk-TF6PN7IB.mjs} +1 -1
  458. package/dist/bin/hook-chunks/{chunk-UHVYBU7F.mjs → chunk-TKXOMN4K.mjs} +4 -4
  459. package/dist/bin/hook-chunks/{chunk-BX7VKYA7.mjs → chunk-UBWUQ64A.mjs} +1 -1
  460. package/dist/bin/hook-chunks/{chunk-OUAVSD47.mjs → chunk-UI25YRTY.mjs} +1 -1
  461. package/dist/bin/hook-chunks/{chunk-G7QQZMAO.mjs → chunk-UMJ5D5I6.mjs} +1 -1
  462. package/dist/bin/hook-chunks/{chunk-ZOX6OV6X.mjs → chunk-V6GGH6H5.mjs} +1 -1
  463. package/dist/bin/hook-chunks/chunk-WIA6ORIY.mjs +16 -0
  464. package/dist/bin/hook-chunks/chunk-WUOVBBPC.mjs +11 -0
  465. package/dist/bin/hook-chunks/{chunk-T6ELTQZM.mjs → chunk-XSJ7SPVR.mjs} +1 -1
  466. package/dist/bin/hook-chunks/{chunk-UYQC63MC.mjs → chunk-XXVHUYL7.mjs} +1 -1
  467. package/dist/bin/hook-chunks/{chunk-RHKF7EJW.mjs → chunk-Y7MZA2G4.mjs} +1 -1
  468. package/dist/bin/hook-chunks/{chunk-U4OON3S7.mjs → chunk-Y7RDBMNC.mjs} +1 -1
  469. package/dist/bin/hook-chunks/{chunk-ROA2AJXY.mjs → chunk-YATXTHDL.mjs} +1 -1
  470. package/dist/bin/hook-chunks/{chunk-ZFLIVOFX.mjs → chunk-ZF2EVMY7.mjs} +1 -1
  471. package/dist/bin/hook-chunks/{chunk-S6L3FECF.mjs → chunk-ZH2MF7H7.mjs} +1 -1
  472. package/dist/bin/hook-chunks/{chunk-3WQBTXUC.mjs → chunk-ZJW27EUC.mjs} +1 -1
  473. package/dist/bin/hook-chunks/{chunk-J5UVRZ44.mjs → chunk-ZXON2U5F.mjs} +3 -3
  474. package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +9 -0
  475. package/dist/bin/hook-chunks/{client-CRXA774S.mjs → client-K3ZA2BLB.mjs} +1 -1
  476. package/dist/bin/hook-chunks/{code-graph-cloud-GTSLO7CD.mjs → code-graph-cloud-XGQF7XYC.mjs} +1 -1
  477. package/dist/bin/hook-chunks/{codex-skill-NUBNPSMF.mjs → codex-skill-UZZCACMB.mjs} +1 -1
  478. package/dist/bin/hook-chunks/{command-installer-UHSXC3UG.mjs → command-installer-FJ73C2ZW.mjs} +1 -1
  479. package/dist/bin/hook-chunks/{config-manager-DX5OOPW5.mjs → config-manager-XDKOTIJM.mjs} +1 -1
  480. package/dist/bin/hook-chunks/{context7-service-GDJ3QICX.mjs → context7-service-NH4BMGSJ.mjs} +1 -1
  481. package/dist/bin/hook-chunks/{custom-workflow-storage-FD47DPA3.mjs → custom-workflow-storage-VBMWLKA7.mjs} +1 -1
  482. package/dist/bin/hook-chunks/cwd-changed-STP3LH6Y.mjs +8 -0
  483. package/dist/bin/hook-chunks/{database-ZUC7OEZG.mjs → database-ZCP76LMM.mjs} +1 -1
  484. package/dist/bin/hook-chunks/{detect-changes-OJUBWWTU.mjs → detect-changes-5W6EGEZG.mjs} +1 -1
  485. package/dist/bin/hook-chunks/{developer-evolution-WNSTHDAA.mjs → developer-evolution-UTY3CWOK.mjs} +1 -1
  486. package/dist/bin/hook-chunks/{distill-GOGPFQFK.mjs → distill-63BHUJAC.mjs} +1 -1
  487. package/dist/bin/hook-chunks/{enriched-recall-QF22RIK7.mjs → enriched-recall-6F6LBYAB.mjs} +1 -1
  488. package/dist/bin/hook-chunks/{format-J3X3R225.mjs → format-VJ2YQ4XQ.mjs} +1 -1
  489. package/dist/bin/hook-chunks/{judgment-ledger-storage-FE4HXTHM.mjs → judgment-ledger-storage-7Q7AEEY6.mjs} +1 -1
  490. package/dist/bin/hook-chunks/{judgment-orchestrator-YDJTKNV2.mjs → judgment-orchestrator-AAON4ZJ4.mjs} +1 -1
  491. package/dist/bin/hook-chunks/{judgment-receipt-7A2DXVJA.mjs → judgment-receipt-LSJCAYBT.mjs} +1 -1
  492. package/dist/bin/hook-chunks/{land-cue-SZWJH6XP.mjs → land-cue-DEO2AZW4.mjs} +1 -1
  493. package/dist/bin/hook-chunks/{land-synthesis-JLYUBKHR.mjs → land-synthesis-GTMFIGDM.mjs} +1 -1
  494. package/dist/bin/hook-chunks/{legacy-crew-sweep-JXYO62UE.mjs → legacy-crew-sweep-QPKU7ITU.mjs} +2 -2
  495. package/dist/bin/hook-chunks/{memory-index-CIYDXN2G.mjs → memory-index-KCMXQGKX.mjs} +1 -1
  496. package/dist/bin/hook-chunks/{notification-UA7RTVHG.mjs → notification-DX6ZHOUC.mjs} +1 -1
  497. package/dist/bin/hook-chunks/{pack-integrity-GZC5NGFN.mjs → pack-integrity-UMLIB5RQ.mjs} +1 -1
  498. package/dist/bin/hook-chunks/{pack-manager-AF5F7PRT.mjs → pack-manager-YXRK2TJ4.mjs} +1 -1
  499. package/dist/bin/hook-chunks/{planning-M3RAOZVB.mjs → planning-JR7O5MYW.mjs} +2 -2
  500. package/dist/bin/hook-chunks/{post-edit-QRDYPZLZ.mjs → post-edit-IPTVSRVG.mjs} +1 -1
  501. package/dist/bin/hook-chunks/{pre-bash-TWWFVNQ7.mjs → pre-bash-5WWTH36N.mjs} +1 -1
  502. package/dist/bin/hook-chunks/{pre-commit-PTFF7JIN.mjs → pre-commit-KZ5TNTPW.mjs} +1 -1
  503. package/dist/bin/hook-chunks/pre-edit-XHPYBXRU.mjs +11 -0
  504. package/dist/bin/hook-chunks/{pre-package-325ALZKD.mjs → pre-package-U3HDW3SX.mjs} +1 -1
  505. package/dist/bin/hook-chunks/{pre-search-GOHVFAFH.mjs → pre-search-R5CRK66E.mjs} +1 -1
  506. package/dist/bin/hook-chunks/{pre-secrets-MYNM5KI4.mjs → pre-secrets-MWPPZPWK.mjs} +1 -1
  507. package/dist/bin/hook-chunks/{prjct-md-RCB6FWD6.mjs → prjct-md-IBQTJBK7.mjs} +1 -1
  508. package/dist/bin/hook-chunks/{project-agent-surfaces-V4P5RTUR.mjs → project-agent-surfaces-TPZO73ZV.mjs} +1 -1
  509. package/dist/bin/hook-chunks/{project-file-inventory-OKIP4LBO.mjs → project-file-inventory-HHURZTMH.mjs} +1 -1
  510. package/dist/bin/hook-chunks/project-memory-YQLZX5RG.mjs +8 -0
  511. package/dist/bin/hook-chunks/{project-style-evolution-RPGATIYJ.mjs → project-style-evolution-NOFCIIZZ.mjs} +1 -1
  512. package/dist/bin/hook-chunks/prompt-DJWONMTZ.mjs +24 -0
  513. package/dist/bin/hook-chunks/{publish-helper-SX7HEV2L.mjs → publish-helper-ZSL27HSX.mjs} +1 -1
  514. package/dist/bin/hook-chunks/{purge-XKHUAB4H.mjs → purge-5W3K2MZL.mjs} +1 -1
  515. package/dist/bin/hook-chunks/retention-GWJ4AX7I.mjs +8 -0
  516. package/dist/bin/hook-chunks/{sdd-6PF7MBAY.mjs → sdd-GWBRD4KI.mjs} +1 -1
  517. package/dist/bin/hook-chunks/{session-continuity-UEXQDGZE.mjs → session-continuity-VH645RGR.mjs} +1 -1
  518. package/dist/bin/hook-chunks/session-start-4TYTI27B.mjs +8 -0
  519. package/dist/bin/hook-chunks/settings-installer-CQKMGMRG.mjs +9 -0
  520. package/dist/bin/hook-chunks/{setup-ZOHG6MGF.mjs → setup-VF4UHUBX.mjs} +3 -3
  521. package/dist/bin/hook-chunks/{shipping-QVGTOO6U.mjs → shipping-2ULWBGRX.mjs} +4 -4
  522. package/dist/bin/hook-chunks/{skill-index-FGDQVYHM.mjs → skill-index-55I3HLAI.mjs} +1 -1
  523. package/dist/bin/hook-chunks/{spec-context-inference-6Z52BT37.mjs → spec-context-inference-HVENYOIO.mjs} +1 -1
  524. package/dist/bin/hook-chunks/{spec-service-UAQ5AEXQ.mjs → spec-service-4XGQQPGP.mjs} +2 -2
  525. package/dist/bin/hook-chunks/{spec-task-breakdown-LAXGVLMY.mjs → spec-task-breakdown-JXF556UH.mjs} +1 -1
  526. package/dist/bin/hook-chunks/{state-storage-XU35ZYNA.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
  527. package/dist/bin/hook-chunks/stop-NJDYIIXR.mjs +16 -0
  528. package/dist/bin/hook-chunks/subagent-start-2YMGD4SY.mjs +8 -0
  529. package/dist/bin/hook-chunks/{subagent-stop-OUG4PR7S.mjs → subagent-stop-4TZJ2NSJ.mjs} +1 -1
  530. package/dist/bin/hook-chunks/{surface-attribution-A6GCGRFM.mjs → surface-attribution-UNK4J5W2.mjs} +1 -1
  531. package/dist/bin/hook-chunks/{symbol-graph-DMPBNBX7.mjs → symbol-graph-MH42JSPX.mjs} +1 -1
  532. package/dist/bin/hook-chunks/{sync-cursor-storage-VVLA3L2U.mjs → sync-cursor-storage-ZB7FGT6D.mjs} +1 -1
  533. package/dist/bin/hook-chunks/{task-orchestration-HFZYWYLR.mjs → task-orchestration-7NGRIISS.mjs} +1 -1
  534. package/dist/bin/hook-chunks/{task-overview-PCUZWL5Q.mjs → task-overview-P3VRH2FD.mjs} +1 -1
  535. package/dist/bin/hook-chunks/task-service-SPUES5DO.mjs +8 -0
  536. package/dist/bin/hook-chunks/{tdd-QZL4OSM7.mjs → tdd-MYF7I5FS.mjs} +1 -1
  537. package/dist/bin/hook-chunks/{template-loader-SKXILJLJ.mjs → template-loader-4SYVR2UB.mjs} +1 -1
  538. package/dist/bin/hook-chunks/{usefulness-SZLG6LVC.mjs → usefulness-TBD5EYAL.mjs} +1 -1
  539. package/dist/bin/hook-chunks/{vault-retire-notice-HOXPURNQ.mjs → vault-retire-notice-7XHVNHU6.mjs} +1 -1
  540. package/dist/bin/hook-chunks/{velocity-storage-5J6BAMCW.mjs → velocity-storage-IOCVK2LU.mjs} +1 -1
  541. package/dist/bin/hook-chunks/{weak-model-mode-ZRNKFTFF.mjs → weak-model-mode-TYJJT6JJ.mjs} +1 -1
  542. package/dist/bin/hook-chunks/{work-graph-PGYHFLEL.mjs → work-graph-AVAOKY63.mjs} +1 -1
  543. package/dist/bin/hook-chunks/{work-scope-FIB6LBKE.mjs → work-scope-A6XPENFE.mjs} +1 -1
  544. package/dist/bin/hook-chunks/{workspace-occupancy-3D4OKQRB.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
  545. package/dist/bin/hook-fast-darwin-arm64 +0 -0
  546. package/dist/bin/hook-fast-darwin-x64 +0 -0
  547. package/dist/bin/hook-fast-linux-x64 +0 -0
  548. package/dist/bin/prjct-core.mjs +9 -3311
  549. package/dist/bin/prjct-hooks.mjs +3 -3
  550. package/dist/bin/prjct.mjs +27 -8
  551. package/dist/daemon/entry.mjs +621 -606
  552. package/dist/mcp/server.mjs +317 -302
  553. package/package.json +5 -6
  554. package/scripts/install.sh +28 -496
  555. package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +0 -11
  556. package/dist/bin/hook-chunks/chunk-BU22R6JX.mjs +0 -9
  557. package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +0 -36
  558. package/dist/bin/hook-chunks/chunk-EWOK4VE7.mjs +0 -11
  559. package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +0 -69
  560. package/dist/bin/hook-chunks/chunk-GDECEHO5.mjs +0 -16
  561. package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +0 -11
  562. package/dist/bin/hook-chunks/chunk-KHLYWNHT.mjs +0 -8
  563. package/dist/bin/hook-chunks/chunk-TRMBRDKH.mjs +0 -8
  564. package/dist/bin/hook-chunks/chunk-TXSLON7M.mjs +0 -19
  565. package/dist/bin/hook-chunks/chunk-V2FR2NPL.mjs +0 -43
  566. package/dist/bin/hook-chunks/chunk-XXRAQZNC.mjs +0 -35
  567. package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +0 -8
  568. package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +0 -11
  569. package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +0 -8
  570. package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +0 -24
  571. package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +0 -8
  572. package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +0 -8
  573. package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +0 -9
  574. package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +0 -16
  575. package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +0 -8
  576. package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +0 -8
@@ -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 g}from"./chunk-PIA26GWG.mjs";import{a as l,b as I}from"./chunk-RP7F67ZT.mjs";import{a as x}from"./chunk-INJ5WT2D.mjs";import{A as h,E}from"./chunk-HU5ERAAV.mjs";import{b as f,f as j}from"./chunk-XYDLXF5A.mjs";import{d as m,g as R}from"./chunk-TTN2CFZC.mjs";import{l as d,p as b}from"./chunk-HYIT7MF5.mjs";import{e as p,g as H}from"./chunk-225DWS4D.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";j();H();b();import S from"node:fs/promises";import K from"node:os";import k from"node:path";I();R();E();var w="prjct-codex-router",C=1024;function y(){return k.join(K.homedir(),".codex","skills","prjct","SKILL.md")}r(y,"getCodexSkillPath");function P(e){return`<!-- ${w}: ${JSON.stringify({v:m,h:e})} -->`}r(P,"getCodexSkillMetadata");function $(e){let t=e.match(new RegExp(`<!--\\s*${w}:\\s*(\\{[\\s\\S]*?\\})\\s*-->`));if(!t)return null;try{let i=JSON.parse(t[1]);return{version:i.v??i.version,templateHash:i.h??i.templateHash}}catch{return null}}r($,"parseCodexSkillMetadata");function M(e){return x(e).slice(0,12)}r(M,"hashContent");async function L(){return f("codex/SKILL.md")}r(L,"loadCodexSkillTemplate");function v(e){let t=e.trimEnd(),i=M(t),a=P(i);return{content:`${t}
8
+
9
+ ${a}
10
+ `,templateHash:i}}r(v,"buildCodexSkillContent");async function D(){try{let e=y(),t=k.dirname(e);await S.mkdir(t,{recursive:!0});let i=await d(e),a=await L();return a?await g({skillMdPath:e,skillExists:i,templateContent:a,build:r(s=>{let n=v(s),o=Buffer.byteLength(n.content,"utf-8");return o>C&&l.warn(`Codex SKILL.md is ${o} bytes \u2014 over Codex's ~${C}-byte hard limit; the skill may be rejected. Trim editor-surfaces.ts.`),n},"build"),logLabel:"Codex"}):(l.warn("Codex SKILL.md template not found"),{success:!1,action:null})}catch(e){return l.warn(`Codex skill warning: ${p(e)}`),{success:!1,action:null}}}r(D,"installCodexSkill");async function q(e={}){let t=y();if(!(await h()).installed)return{installed:!1,verified:!0,skillPath:t,message:"Codex not detected"};let a=await L();if(!a)return{installed:!0,verified:!1,skillPath:t,message:"Codex SKILL.md template missing from prjct installation",fix:["Reinstall prjct-cli package","Run `prjct setup`"]};let s=v(a),n=r(async()=>e.autoRepair?(await D()).success:!1,"maybeRepair");if(!await d(t)&&!await n())return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill missing at ~/.codex/skills/prjct/SKILL.md",fix:["Run `prjct start` to install Codex skill"]};let o=r(async()=>{let c=await S.readFile(t,"utf-8").catch(()=>""),u=$(c);return{matches:u?.version===m&&u?.templateHash===s.templateHash}},"readVerification");if(!(await o()).matches){if(!await n())return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill metadata mismatch (outdated router)",fix:["Run `prjct start` or `prjct setup` to refresh Codex skill"]};if(!(await o()).matches)return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill could not be repaired automatically",fix:["Delete ~/.codex/skills/prjct/SKILL.md","Run `prjct setup`"]}}return{installed:!0,verified:!0,skillPath:t,templateHash:s.templateHash,message:"Codex p. router ready"}}r(q,"verifyCodexPRouterReady");export{C as a,v as b,D as c,q 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 e,c as t}from"./chunk-3TRXQAU4.mjs";import s from"node:os";import o from"node:path";function n(){let r=process.env.HOME?.trim()||process.env.USERPROFILE?.trim();return r?o.resolve(r):s.homedir()}function v(...r){return o.join(n(),...r)}var i=t(()=>{e(n,"resolveUserHome");e(v,"resolveUserPath")});export{n as a,v as b,i 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 r}from"./chunk-3TRXQAU4.mjs";var n={NO_PROJECT:{message:"No prjct project found in this directory",hint:"Run 'prjct init' to set up a new project",file:".prjct/prjct.config.json"},NO_PROJECT_ID:{message:"Project ID not found",hint:"Run 'prjct init' or check .prjct/prjct.config.json",file:".prjct/prjct.config.json"},CONFIG_NOT_FOUND:{message:"Configuration file not found",hint:"Run 'prjct init' to create project configuration",file:".prjct/prjct.config.json"},CONFIG_INVALID:{message:"Invalid configuration file",hint:"Check JSON syntax or delete .prjct/ and run init again",file:".prjct/prjct.config.json"},GIT_NOT_FOUND:{message:"Git repository not detected",hint:"Run 'git init' first, then 'prjct init'"},GIT_NO_COMMITS:{message:"No commits in repository",hint:"Make an initial commit before using prjct"},GIT_DIRTY:{message:"Working directory has uncommitted changes",hint:"Commit or stash changes, or use '--force' to override"},GIT_ON_MAIN:{message:"Cannot ship from main/master branch",hint:"Create a feature branch first: git checkout -b feature/your-feature"},GIT_OPERATION_FAILED:{message:"Git operation failed",hint:"Check git status and resolve any conflicts"},GH_NOT_AUTHENTICATED:{message:"GitHub CLI not authenticated",hint:"Run 'gh auth login' to authenticate",docs:"https://cli.github.com/manual/gh_auth_login"},LINEAR_NOT_CONFIGURED:{message:"Linear integration not configured",hint:"Configure the Linear MCP server in your AI client"},LINEAR_API_ERROR:{message:"Linear API error",hint:"Check your API key or network connection"},NO_ACTIVE_TASK:{message:"No active work cycle",hint:`Start work with 'p. work "intent"'`},TASK_ALREADY_ACTIVE:{message:"A work cycle is already in progress",hint:"Use 'p. work' to inspect it or ship when complete"},SYNC_FAILED:{message:"Project sync failed",hint:"Check file permissions and try again"},NOTHING_TO_SHIP:{message:"Nothing to ship",hint:"Make some changes first, then run ship"},PR_CREATE_FAILED:{message:"Failed to create pull request",hint:"Check GitHub auth and remote configuration"},NO_AI_PROVIDER:{message:"No AI provider detected",hint:"Install Claude Code or Gemini CLI, then run 'prjct start'",docs:"https://prjct.app/docs"},PROVIDER_NOT_CONFIGURED:{message:"AI provider not configured for prjct",hint:"Run 'prjct start' to configure your provider"},UNKNOWN_COMMAND:{message:"Unknown command",hint:"Run 'prjct --help' to see available commands"},MISSING_PARAM:{message:"Missing required parameter",hint:"Check command usage below"},UNKNOWN:{message:"An unexpected error occurred",hint:"Check the error details and try again"}};function a(t,e){return{...n[t],...e}}r(a,"getError");function c(t,e,i){return{message:t,hint:e,...i}}r(c,"createError");export{a,c 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{a as p}from"./chunk-NXUIMC22.mjs";import{f as c,i as g}from"./chunk-DMO3ZFUG.mjs";import{d as h}from"./chunk-INJ5WT2D.mjs";import{b as d,c as m,e as a,l as f}from"./chunk-HU5ERAAV.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";m();f();g();function v(i){let[e,t]=i.split(".");return e?{entityType:e.endsWith("s")?e:`${e}s`,eventType:t==="deleted"||t==="archived"||t==="removed"?"delete":"upsert"}:{}}r(v,"deriveEntityShape");function T(i){if(!i||typeof i!="object")return;let e=i;for(let t of["taskId","task_id","id","feature_id","featureId","specId","spec_id"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}r(T,"entityIdOf");var u={value:null};async function w(){if(u.value)return u.value;try{let{default:i}=await import("./auth-config-KWLVKHCY.mjs"),e=i;if(typeof e.getDeviceId=="function"){let t=await e.getDeviceId();return u.value=t,t}return"unknown-device"}catch{return"unknown-device"}}r(w,"_resolveDeviceId");var y=class{static{r(this,"StorageManager")}filename;cache;constructor(e,t){this.filename=e,this.cache=new d({ttl:5e3,maxSize:50})}getStoreKey(){return this.filename.replace(".json","")}async read(e){if(!(process.env.PRJCT_IN_DAEMON==="1")){let n=this.cache.get(e);if(n!==null)return n}try{let n=c.getDoc(e,this.getStoreKey());if(n!==null)return this.cache.set(e,n),n}catch{}return this.getDefault()}async write(e,t){c.setDoc(e,this.getStoreKey(),t),this.cache.set(e,t)}async update(e,t){let n=this.getStoreKey(),s=c.updateDoc(e,n,t,()=>this.getDefault());return this.cache.set(e,s),s}async publishEvent(e,t,n){let s=v(t),o={type:t,path:[this.filename.replace(".json","")],data:n,timestamp:a(),projectId:e,entityType:s.entityType,entityId:T(n),eventType:s.eventType,contentHash:h(n),deviceId:await w(),revisionCount:1};await p.publish(o)}async publishEntityEvent(e,t,n,s){let o=`${t}.${n}`,l={...s,timestamp:a()};await this.publishEvent(e,o,l)}async exists(e){try{return c.hasDoc(e,this.getStoreKey())}catch{return!1}}clearCache(e){e?this.cache.delete(e):this.cache.clear()}getCacheStats(){return this.cache.stats()}};export{y as a};
@@ -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 e,c as S}from"./chunk-76YMLNLF.mjs";var o=new Set(e.filter(t=>t.routing).map(t=>t.name)),r=S;export{o as a,r 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{e as y}from"./chunk-YJOC2JJK.mjs";import{f as u,i as v}from"./chunk-DMO3ZFUG.mjs";import{c as x}from"./chunk-INJ5WT2D.mjs";import{F as p,G as P,e as m,l as w}from"./chunk-HU5ERAAV.mjs";import{a as f,g as I}from"./chunk-225DWS4D.mjs";import{a as l}from"./chunk-3TRXQAU4.mjs";function $(c,t){let e=c.content,s=[`# ${c.title}`,"",`**id:** \`${c.id}\` \xB7 **status:** ${c.status} \xB7 **created:** ${c.createdAt}`,"","## Goal",e.goal];if(e.eli10&&s.push("","## ELI10",e.eli10),e.stakes&&s.push("","## Stakes",e.stakes),e.acceptance_criteria.length>0){s.push("","## Acceptance criteria");let n=new Map;if(e.delta_log.length>0){let r=y(e.delta_log);for(let[a,o]of Object.entries(e.scenarios)){let i=r.get(a);i&&o.length>0&&n.set(i,o)}}for(let r of e.acceptance_criteria){s.push(`- [ ] ${r}`);let a=n.get(r);if(a)for(let o of a){s.push(` - **Scenario: ${o.name}**`);for(let i of o.given)s.push(` - GIVEN ${i}`);for(let i of o.when)s.push(` - WHEN ${i}`);for(let i of o.then)s.push(` - THEN ${i}`)}}}if(e.scope.length>0){s.push("","## Scope");for(let n of e.scope)s.push(`- ${n}`)}if(e.out_of_scope.length>0){s.push("","## Out of scope");for(let n of e.out_of_scope)s.push(`- ${n}`)}if(e.risks.length>0){s.push("","## Risks");for(let n of e.risks)s.push(`- **${n.risk}** \u2014 ${n.mitigation}`)}if(e.test_plan.length>0){s.push("","## Test plan");for(let n of e.test_plan)s.push(`- ${n}`)}if(e.reviews&&Object.keys(e.reviews).length>0){s.push("","## Reviews");for(let[n,r]of Object.entries(e.reviews))s.push(`- **${n}:** ${r.verdict} \u2014 ${r.notes} _(${r.ts})_`)}if(e.linked_tasks.length>0&&s.push("","## Linked tasks",...e.linked_tasks.map(n=>`- ${n}`)),t&&e.acceptance_criteria.length>0){s.push("","## Tasks");for(let n of e.acceptance_criteria){let r=t.get(n);s.push(`- ${r?.completed?"[x]":"[ ]"} ${n}${r?` (\`${r.id}\`)`:""}`)}}return e.notes&&s.push("","## Notes",e.notes),s.join(`
8
+ `)}l($,"renderSpecMarkdown");P();I();w();import g from"node:fs/promises";import k from"node:path";v();var d="1.0.0";function C(){return{version:d,lastUpdated:"",checksums:{}}}l(C,"getDefaultChecksums");var h=class{static{l(this,"IndexStorage")}getIndexPath(t){return k.join(p.getGlobalProjectPath(t),"index")}async ensureIndexDir(t){let e=this.getIndexPath(t);return await g.mkdir(e,{recursive:!0}),e}async readIndex(t){try{let e=this.getIndexMeta(t,"project-index");if(e!==null)return e.version!==d?null:e}catch{}return null}async writeIndex(t,e){this.setIndexMeta(t,"project-index",e)}async hasValidIndex(t){let e=await this.readIndex(t);return e!==null&&e.lastFullScan!==""}async readChecksums(t){try{let e=this.getIndexMeta(t,"checksums");if(e!==null)return e}catch{}return C()}async writeChecksums(t,e){this.setIndexMeta(t,"checksums",e)}async calculateChecksum(t){try{let e=await g.readFile(t);return x(e)}catch{return""}}async detectChangedFiles(t,e){let n=(await this.readChecksums(t)).checksums,r=[],a=[],o=[];for(let[i,S]of e)i in n?n[i]!==S&&a.push(i):r.push(i);for(let i of Object.keys(n))e.has(i)||o.push(i);return{added:r,modified:a,deleted:o}}async readScores(t){try{let e=this.getIndexMeta(t,"file-scores");if(e!==null)return e.scores||[]}catch{}return[]}async writeScores(t,e){let s={version:d,lastUpdated:m(),scores:e};this.setIndexMeta(t,"file-scores",s)}async clearIndex(t){try{u.getDb(t).prepare("DELETE FROM index_meta").run()}catch{}let e=this.getIndexPath(t);try{let s=await g.readdir(e);await Promise.all(s.map(n=>g.unlink(k.join(e,n))))}catch(s){if(!f(s))throw s}}async getIndexAge(t){let e=await this.readIndex(t);if(!e||!e.lastFullScan)return 1/0;let s=new Date(e.lastFullScan);return(new Date().getTime()-s.getTime())/(1e3*60*60)}async readDomains(t){try{let e=this.getIndexMeta(t,"domains");if(e!==null)return e.version!==d?null:e}catch{}return null}readDomainsSync(t){try{let e=this.getIndexMeta(t,"domains");if(e!==null&&e.version===d)return e}catch{}return null}async writeDomains(t,e){this.setIndexMeta(t,"domains",e)}async readCategories(t){try{let e=this.getIndexMeta(t,"categories-cache");if(e!==null)return e.version!==d?null:e}catch{}return null}async writeCategories(t,e){this.setIndexMeta(t,"categories-cache",e)}async getFileCategories(t,e){let s=await this.readCategories(t),n=new Map;if(!s)return n;let r=new Set(e);for(let a of s.fileCategories)r.has(a.path)&&n.set(a.path,a.categories);return n}async getFilesByDomain(t,e){let s=await this.readCategories(t);return s?s.domainIndex[e]||[]:[]}getIndexMeta(t,e){let s=u.get(t,"SELECT data FROM index_meta WHERE key = ?",e);return s?JSON.parse(s.data):null}setIndexMeta(t,e,s){u.run(t,"INSERT OR REPLACE INTO index_meta (key, data, updated_at) VALUES (?, ?, ?)",e,JSON.stringify(s),new Date().toISOString())}},R=new h;export{$ as a,R as b};
@@ -0,0 +1,34 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as I,b as R}from"./chunk-HPCSSJXH.mjs";import{a as W}from"./chunk-E5QQDYBR.mjs";import{b as y}from"./chunk-B7AQHL7B.mjs";import{a as B}from"./chunk-L4TUXFCL.mjs";import{f as E,g as b,i as _}from"./chunk-DMO3ZFUG.mjs";import{e as d,l as g}from"./chunk-HU5ERAAV.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";g();var f={idle:{transitions:["task"],prompt:"prjct work <intent> Start working",description:"No active work cycle"},working:{transitions:["done","pause"],prompt:"prjct status done Complete work | prjct status paused Switch context",description:"Work in progress"},paused:{transitions:["resume","task","ship"],prompt:"prjct status active Continue | prjct work <new> Start different | prjct ship Ship directly",description:"Task paused"},completed:{transitions:["ship","task","pause","reopen"],prompt:"prjct ship Ship it | prjct work <next> Start next | prjct status active Reopen",description:"Task completed"},shipped:{transitions:["task"],prompt:"prjct work <intent> Start new work cycle",description:"Feature shipped"}},S=class{static{c(this,"WorkflowStateMachine")}getCurrentState(t,s){if(s){let n=(t?.activeTasks??[]).find(a=>a.workspaceId===s);return n?this.statusToState(n):"idle"}let e=t?.currentTask;return e?this.statusToState(e):(t?.pausedTasks?.length||0)>0||t?.previousTask?.status==="paused"?"paused":"idle"}statusToState(t){switch((typeof t.status=="string"?t.status:"").toLowerCase()){case"in_progress":case"working":return"working";case"paused":return"paused";case"completed":case"done":return"completed";case"shipped":return"shipped";default:return"working"}}canTransition(t,s){if(f[t].transitions.includes(s))return{valid:!0};let n=this.formatNextSteps(t).join(" | ");return{valid:!1,error:`Cannot transition to '${s}' from '${t}' state`,suggestion:`Valid next steps: ${n}`}}getNextState(t,s){switch(s){case"task":return"working";case"done":return"completed";case"pause":return"paused";case"resume":return"working";case"ship":return"shipped";case"reopen":return"working";default:return t}}getStateInfo(t){return f[t]}getPrompt(t){return f[t].prompt}getValidCommands(t){return f[t].transitions}formatNextSteps(t){return f[t].transitions.map(e=>{switch(e){case"task":return"prjct work <intent> Start new work cycle";case"done":return"prjct status done Complete current work";case"pause":return"prjct status paused Pause and switch context";case"resume":return"prjct status active Continue paused task";case"ship":return"prjct ship Ship the feature";case"reopen":return"prjct status active Reopen completed task";default:return`prjct ${e}`}})}},w=new S;_();g();async function H(r,t,s){let e={pausedCount:0};if(await r.update(t,a=>{if(!a.currentTask)return a;r.validateTransition(a,"pause"),e.pausedTask={...a.currentTask,status:"paused",pausedAt:d(),pauseReason:s};let i=[e.pausedTask,...r.getPausedTasksFromState(a)].slice(0,r.maxPausedTasks);return e.pausedCount=i.length,{...a,currentTask:null,previousTask:null,pausedTasks:i,lastUpdated:d()}}),!e.pausedTask)return null;let n=e.pausedTask;return await r.publish(t,"task.paused",{taskId:n.id,description:n.description,pausedAt:n.pausedAt,reason:s,pausedCount:e.pausedCount}),n}c(H,"pauseTask");async function O(r,t,s){let e={remainingPaused:0};if(await r.update(t,a=>{let i=r.getPausedTasksFromState(a);if(i.length===0)return a;r.validateTransition(a,"resume");let u=s?i.findIndex(x=>x.id===s):0;if(u===-1)return a;let o=i[u],k=i.filter((x,lt)=>lt!==u),{status:p,pausedAt:T,pauseReason:l,...m}=o;return e.currentTask={...m,startedAt:d(),sessionId:o.sessionId??B()},e.remainingPaused=k.length,{...a,currentTask:e.currentTask,previousTask:null,pausedTasks:k,lastUpdated:d()}}),!e.currentTask)return null;let n=e.currentTask;return await r.publish(t,"task.resumed",{taskId:n.id,description:n.description,resumedAt:n.startedAt,remainingPaused:e.remainingPaused}),n}c(O,"resumeTask");async function D(r,t){let s=await r.read(t),e=r.getPausedTasksFromState(s),n=Date.now()-r.stalenessThresholdDays*24*60*60*1e3;return e.filter(a=>new Date(a.pausedAt).getTime()<n)}c(D,"getStalePausedTasks");async function F(r,t){let s=Date.now()-r.stalenessThresholdDays*24*60*60*1e3,e=[];await r.update(t,a=>{let i=r.getPausedTasksFromState(a),u=i.filter(k=>new Date(k.pausedAt).getTime()<s);if(e.push(u),u.length===0)return a;let o=i.filter(k=>new Date(k.pausedAt).getTime()>=s);return{...a,pausedTasks:o,previousTask:null,lastUpdated:d()}});let n=e[0]??[];if(n.length===0)return[];y.archiveMany(t,n.map(a=>({entityType:"paused_task",entityId:a.id,entityData:a,summary:a.description,reason:"staleness"})));for(let a of n)await r.publish(t,"task.archived",{taskId:a.id,description:a.description,pausedAt:a.pausedAt,reason:"staleness"});return n}c(F,"archiveStalePausedTasks");g();_();var Tt=20;function gt(r){let t=(()=>{if(!r.data)return{};try{return JSON.parse(r.data)}catch{return{}}})(),s={taskId:r.id,title:t.title??r.description,classification:r.type??"improvement",startedAt:r.started_at,completedAt:r.completed_at,subtaskCount:t.subtaskCount??0,subtaskSummaries:t.subtaskSummaries??[],outcome:t.outcome??"Task completed",branchName:r.branch??"unknown"};return r.linear_id!=null&&(s.linearId=r.linear_id),t.linearUuid!=null&&(s.linearUuid=t.linearUuid),r.pr_url!=null&&(s.prUrl=r.pr_url),t.feedback&&(s.feedback=t.feedback),t.harness&&(s.harness=t.harness),r.tokens_in&&(s.tokensIn=r.tokens_in),r.tokens_out&&(s.tokensOut=r.tokens_out),s}c(gt,"rowToHistoryEntry");function P(r,t="",...s){try{return E.query(r,`SELECT id, description, type, branch, linear_id, pr_url, started_at, completed_at, tokens_in, tokens_out, data
8
+ FROM tasks
9
+ WHERE status = 'completed' AND completed_at IS NOT NULL ${t}
10
+ ORDER BY completed_at DESC, rowid DESC LIMIT ${Tt}`,...s).map(gt)}catch{return[]}}c(P,"queryHistory");async function N(r,t){await r.update(t,()=>({currentTask:null,previousTask:null,pausedTasks:[],activeTasks:[],lastUpdated:d()}))}c(N,"clearTask");async function U(r,t){let s=await r.read(t),e=r.getPausedTasksFromState(s);return s.currentTask!==null||e.length>0}c(U,"hasTask");async function J(r,t){let s=await r.read(t);return r.getPausedTasksFromState(s)[0]||null}c(J,"getPausedTask");async function L(r,t){let s=await r.read(t);return r.getPausedTasksFromState(s)}c(L,"getAllPausedTasks");async function v(r,t){return P(t)}c(v,"getTaskHistory");async function q(r,t){return P(t)[0]||null}c(q,"getMostRecentTask");async function M(r,t,s){return P(t,"AND type = ?",s)}c(M,"getTaskHistoryByType");async function $(r,t){let e=(await v(r,t)).filter(l=>l.feedback),n=[],a=[],i=[],u=[];for(let l of e){let m=l.feedback;Array.isArray(m.stackConfirmed)&&n.push(...m.stackConfirmed),Array.isArray(m.patternsDiscovered)&&a.push(...m.patternsDiscovered),Array.isArray(m.agentAccuracy)&&i.push(...m.agentAccuracy),Array.isArray(m.issuesEncountered)&&u.push(...m.issuesEncountered)}let o=[...new Set(n)],k=[...new Set(a)],p=new Map;for(let l of u)p.set(l,(p.get(l)||0)+1);let T=[...p.entries()].filter(([l,m])=>m>=2).map(([l])=>l);return{stackConfirmed:o,patternsDiscovered:k,agentAccuracy:i,issuesEncountered:[...new Set(u)],knownGotchas:T}}c($,"getAggregatedFeedback");g();var yt=c(r=>r.filter(t=>t.status==="completed").length,"countCompleted"),j=c(r=>r.filter(t=>t.status==="completed"||t.status==="failed"||t.status==="skipped").length,"countResolved");async function h(r,t,s,e){let n={};return await r.update(t,a=>{if(!a.currentTask?.subtasks)return a;let i=a.currentTask.currentSubtaskIndex||0,u=a.currentTask.subtasks[i];if(!u)return a;let o=[...a.currentTask.subtasks];o[i]=s(u);let k=i+1,p=o.length;k<p&&(o[k]={...o[k],status:"in_progress",startedAt:d()});let T=k<p?o[k]:null,l=e?Q(e(o),p):void 0;return n.value={taskId:a.currentTask.id,current:o[i],next:T,...l?{progress:l}:{}},{...a,currentTask:{...a.currentTask,subtasks:o,currentSubtaskIndex:k<p?k:i,...l?{subtaskProgress:l}:{}},lastUpdated:d()}}),n.value??null}c(h,"mutateCurrentSubtask");function Q(r,t){return{completed:r,total:t,percentage:t>0?Math.round(r/t*100):0}}c(Q,"progressFrom");async function V(r,t,s){let e=await r.update(t,i=>{if(!i.currentTask)return i;let u=s.map((o,k)=>({...o,status:k===0?"in_progress":"pending",startedAt:k===0?d():void 0,dependsOn:o.dependsOn||[]}));return{...i,currentTask:{...i.currentTask,subtasks:u,currentSubtaskIndex:0,subtaskProgress:Q(0,u.length)},lastUpdated:d()}}),n=e.currentTask?.id??null,a=e.currentTask?.subtasks??[];n&&await r.publish(t,"subtasks.created",{taskId:n,subtaskCount:a.length,subtasks:a.map(i=>({id:i.id,description:i.description,domain:i.domain}))})}c(V,"createSubtasks");async function G(r,t,s){let e=I.safeParse(s);if(!e.success){let u=e.error.issues.map(o=>`${o.path.join(".")}: ${o.message}`);throw new Error(`Subtask completion requires handoff data:
11
+ ${u.join(`
12
+ `)}`)}let{output:n,summary:a}=e.data,i=await h(r,t,u=>({...u,status:"completed",completedAt:d(),output:n,summary:a}),yt);return i?(await r.publish(t,"subtask.completed",{taskId:i.taskId,subtaskId:i.current.id,description:i.current.description,output:n,handoff:a.outputForNextAgent,filesChanged:a.filesChanged.length,progress:i.progress}),i.next):null}c(G,"completeSubtask");async function Y(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=s.currentTask.currentSubtaskIndex||0;return s.currentTask.subtasks[e]||null}c(Y,"getCurrentSubtask");async function z(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=(s.currentTask.currentSubtaskIndex||0)+1;return s.currentTask.subtasks[e]||null}c(z,"getNextSubtask");async function C(r,t){let s=await r.read(t);if(!s.currentTask?.subtasks)return null;let e=(s.currentTask.currentSubtaskIndex||0)-1;return e<0?null:s.currentTask.subtasks[e]||null}c(C,"getPreviousSubtask");async function K(r,t){let s=await C(r,t);return s?.summary?.outputForNextAgent?{fromSubtask:s.description,outputForNextAgent:s.summary.outputForNextAgent,filesChanged:s.summary.filesChanged,whatWasDone:s.summary.whatWasDone}:null}c(K,"getPreviousHandoff");async function X(r,t){return(await r.read(t)).currentTask?.subtasks||[]}c(X,"getSubtasks");async function Z(r,t){return(await r.read(t)).currentTask?.subtaskProgress||null}c(Z,"getSubtaskProgress");async function tt(r,t){return((await r.read(t)).currentTask?.subtasks?.length||0)>0}c(tt,"hasSubtasks");async function st(r,t){let s=await r.read(t);return s.currentTask?.subtasks?s.currentTask.subtasks.every(e=>e.status==="completed"||e.status==="failed"||e.status==="skipped"):!0}c(st,"areAllSubtasksComplete");async function et(r,t,s){let e=await h(r,t,n=>({...n,status:"failed",completedAt:d(),output:`Failed: ${s}`}),j);return e?(await r.publish(t,"subtask.failed",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,error:s}),e.next):null}c(et,"failSubtask");async function rt(r,t,s){let e=await h(r,t,n=>({...n,status:"skipped",completedAt:d(),output:`Skipped: ${s}`,skipReason:s}),j);return e?(await r.publish(t,"subtask.skipped",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,reason:s}),e.next):null}c(rt,"skipSubtask");async function at(r,t,s){let e=await h(r,t,n=>({...n,status:"blocked",output:`Blocked: ${s}`,blockReason:s}));return e?(await r.publish(t,"subtask.blocked",{taskId:e.taskId,subtaskId:e.current.id,description:e.current.description,blocker:s}),e.next):null}c(at,"blockSubtask");g();async function nt(r,t,s,e){let n={...s,workspaceId:e,startedAt:d()};return await r.update(t,a=>{if((a.activeTasks||[]).some(i=>i.workspaceId===e))throw new Error("A task is already active in this workspace");return{...a,activeTasks:[...a.activeTasks||[],n],lastUpdated:d()}}),await r.publish(t,"task.started",{taskId:n.id,description:n.description,startedAt:n.startedAt,sessionId:n.sessionId,workspaceId:e}),n}c(nt,"startTaskInWorkspace");async function it(r,t,s){return((await r.read(t)).activeTasks||[]).find(n=>n.workspaceId===s)??null}c(it,"getCurrentTaskForWorkspace");async function ot(r,t,s,e){let a=((await r.read(t)).activeTasks||[]).find(o=>o.workspaceId===s);if(!a)return null;let i=d(),u=[];return await r.update(t,o=>(u.push((o.activeTasks||[]).find(k=>k.workspaceId===s)??a),{...o,activeTasks:(o.activeTasks||[]).filter(k=>k.workspaceId!==s),lastUpdated:i})),r.persistHistoryEntry(t,r.createTaskHistoryEntry(u.at(-1)??a,i,e)),await r.publish(t,"task.completed",{taskId:a.id,description:a.description,startedAt:a.startedAt,completedAt:i,workspaceId:s}),a}c(ot,"completeTaskInWorkspace");async function ut(r,t){return(await r.read(t)).activeTasks||[]}c(ut,"getActiveTasks");async function ct(r,t,s){if(s.size===0)return[];let e=[];await r.update(t,a=>{let i=a.activeTasks||[],u=i.filter(o=>s.has(o.workspaceId));return e.push(u),u.length===0?a:{...a,activeTasks:i.filter(o=>!s.has(o.workspaceId)),lastUpdated:d()}});let n=e[0]??[];if(n.length===0)return[];y.archiveMany(t,n.map(a=>({entityType:"workspace_task",entityId:a.id,entityData:a,summary:a.description,reason:"staleness"})));for(let a of n)await r.publish(t,"task.archived",{taskId:a.id,description:a.description,workspaceId:a.workspaceId,reason:"staleness"});return n}c(ct,"archiveOrphanedWorkspaceTasks");async function kt(r,t){return((await r.read(t)).activeTasks||[]).length}c(kt,"getActiveTaskCount");async function dt(r,t,s,e){let a=((await r.read(t)).activeTasks||[]).find(o=>o.workspaceId===s);if(!a)return null;let i=c(o=>{let k={...o};for(let[p,T]of Object.entries(e))T===null?delete k[p]:T!==void 0&&(k[p]=T);return k.workspaceId=s,k},"merge"),u=[];return await r.update(t,o=>({...o,activeTasks:(o.activeTasks||[]).map(k=>{if(k.workspaceId!==s)return k;let p=i(k);return u.push(p),p}),lastUpdated:d()})),u.at(-1)??a}c(dt,"updateWorkspaceTask");async function pt(r,t,s,e,n){let a=await r.read(t);if(n){if(!(a.activeTasks||[]).some(o=>o.workspaceId===n))return null;let u=[];return await r.update(t,o=>({...o,activeTasks:(o.activeTasks||[]).map(k=>{if(k.workspaceId!==n)return k;let p=(k.tokensIn||0)+s,T=(k.tokensOut||0)+e;return u.push({tokensIn:p,tokensOut:T}),{...k,tokensIn:p,tokensOut:T}}),lastUpdated:d()})),u.at(-1)??null}if(!a.currentTask)return null;let i=[];return await r.update(t,u=>{if(!u.currentTask)return u;let o=(u.currentTask.tokensIn||0)+s,k=(u.currentTask.tokensOut||0)+e;return i.push({tokensIn:o,tokensOut:k}),{...u,currentTask:{...u.currentTask,tokensIn:o,tokensOut:k},lastUpdated:d()}}),i.at(-1)??null}c(pt,"addTokens");var A=class extends W{static{c(this,"StateStorage")}constructor(){super("state.json",R)}getDefault(){return{currentTask:null,previousTask:null,pausedTasks:[],taskHistory:[],activeTasks:[],lastUpdated:""}}getEventType(t){return`state.${t}d`}validateTransition(t,s,e){let n=w.getCurrentState(t,e),a=w.canTransition(n,s);if(!a.valid)throw new Error(`${a.error}. ${a.suggestion||""}`.trim())}async getCurrentTask(t){return(await this.read(t)).currentTask}async getTaskSnapshot(t){let s=await this.read(t);return{currentTask:s.currentTask,activeTasks:s.activeTasks||[]}}async bumpTurnCount(t){let s={count:0,task:null};return await this.update(t,e=>{if(!e.currentTask)return e;let n=(e.currentTask.turnCount??0)+1,a={...e.currentTask,turnCount:n};return s.count=n,s.task=a,{...e,currentTask:a}}),s}async acknowledgeTurnLimit(t,s){let e={ok:!1};return await this.update(t,n=>n.currentTask?(e.ok=!0,{...n,currentTask:{...n.currentTask,turnLimitAcknowledgedAt:s}}):n),e.ok}async getPausedTasks(t){let s=await this.read(t);return this.getPausedTasksFromState(s)}async startTask(t,s){let e={};if(await this.update(t,a=>(this.validateTransition(a,"task"),e.currentTask={...s,startedAt:d()},{...a,currentTask:e.currentTask,lastUpdated:d()})),!e.currentTask)throw new Error("Failed to start task");let n=e.currentTask;return this.mirrorTaskRow(t,n,"in_progress"),await this.publishEvent(t,"task.started",{taskId:n.id,description:n.description,startedAt:n.startedAt,sessionId:n.sessionId}),n}mirrorTaskRow(t,s,e,n={}){try{b.run(t,`INSERT INTO tasks (id, description, type, status, branch, linked_spec_id, session_id, feature_id, started_at, completed_at, paused_at, pause_reason)
13
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
14
+ ON CONFLICT(id) DO UPDATE SET
15
+ description = excluded.description,
16
+ status = excluded.status,
17
+ branch = COALESCE(excluded.branch, tasks.branch),
18
+ linked_spec_id = COALESCE(excluded.linked_spec_id, tasks.linked_spec_id),
19
+ completed_at = COALESCE(excluded.completed_at, tasks.completed_at),
20
+ paused_at = excluded.paused_at,
21
+ pause_reason = excluded.pause_reason`,s.id,s.description,s.type??null,e,s.branch??null,s.linkedSpecId??null,s.sessionId??null,s.featureId??null,s.startedAt??null,n.completedAt??null,n.pausedAt??null,n.pauseReason??null)}catch{}}mirrorHistoryEntry(t,s){try{let e=JSON.stringify({title:s.title,outcome:s.outcome,subtaskCount:s.subtaskCount,subtaskSummaries:s.subtaskSummaries,feedback:s.feedback,harness:s.harness,linearUuid:s.linearUuid});b.run(t,`INSERT INTO tasks (id, description, type, status, branch, linear_id, pr_url, started_at, completed_at, tokens_in, tokens_out, data)
22
+ VALUES (?, ?, ?, 'completed', ?, ?, ?, ?, ?, ?, ?, ?)
23
+ ON CONFLICT(id) DO UPDATE SET
24
+ description = excluded.description,
25
+ type = excluded.type,
26
+ status = 'completed',
27
+ branch = COALESCE(excluded.branch, tasks.branch),
28
+ linear_id = COALESCE(excluded.linear_id, tasks.linear_id),
29
+ started_at = COALESCE(excluded.started_at, tasks.started_at),
30
+ completed_at = excluded.completed_at,
31
+ pr_url = COALESCE(excluded.pr_url, tasks.pr_url),
32
+ tokens_in = CASE WHEN excluded.tokens_in > 0 THEN excluded.tokens_in ELSE tasks.tokens_in END,
33
+ tokens_out = CASE WHEN excluded.tokens_out > 0 THEN excluded.tokens_out ELSE tasks.tokens_out END,
34
+ data = excluded.data`,s.taskId,s.title,s.classification,s.branchName==="unknown"?null:s.branchName,s.linearId??null,s.prUrl??null,s.startedAt,s.completedAt,s.tokensIn??0,s.tokensOut??0,e)}catch{}}async updateCurrentTask(t,s){return(await this.update(t,n=>{if(!n.currentTask)return n;let a={...n.currentTask};for(let[u,o]of Object.entries(s))o===null?delete a[u]:o!==void 0&&(a[u]=o);return{...n,currentTask:a,lastUpdated:d()}})).currentTask}async completeTask(t,s){let e=d(),n={};if(await this.update(t,i=>i.currentTask?(this.validateTransition(i,"done"),n.completedTask=i.currentTask,{...i,currentTask:null,previousTask:null,lastUpdated:e}):i),!n.completedTask)return null;let a=n.completedTask;return this.mirrorTaskRow(t,a,"completed",{completedAt:e}),this.mirrorHistoryEntry(t,this.createTaskHistoryEntry(a,e,s)),await this.publishEvent(t,"task.completed",{taskId:a.id,description:a.description,startedAt:a.startedAt,completedAt:e}),a}createTaskHistoryEntry(t,s,e){let n=(t.subtasks||[]).filter(u=>u.status==="completed"&&u.summary).map(u=>u.summary),a=n.length>0?n.map(u=>u.title).join(", "):"Task completed",i={taskId:t.id,title:t.parentDescription||t.description,classification:t.type||"improvement",startedAt:t.startedAt,completedAt:s,subtaskCount:t.subtasks?.length||0,subtaskSummaries:n,outcome:a,branchName:t.branch||"unknown",linearId:t.linearId,linearUuid:t.linearUuid,prUrl:t.prUrl,harness:t.harness};return e&&(i.feedback=e),t.tokensIn&&(i.tokensIn=t.tokensIn),t.tokensOut&&(i.tokensOut=t.tokensOut),i}maxPausedTasks=5;stalenessThresholdDays=30;lifecycleBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this),validateTransition:this.validateTransition.bind(this),getPausedTasksFromState:this.getPausedTasksFromState.bind(this),maxPausedTasks:this.maxPausedTasks,stalenessThresholdDays:this.stalenessThresholdDays}}async pauseTask(t,s){let e=await H(this.lifecycleBackend(),t,s);return e&&this.mirrorTaskRow(t,e,"paused",{pausedAt:e.pausedAt,pauseReason:e.pauseReason}),e}async resumeTask(t,s){let e=await O(this.lifecycleBackend(),t,s);return e&&this.mirrorTaskRow(t,e,"in_progress"),e}getPausedTasksFromState(t){return Array.isArray(t.pausedTasks)&&t.pausedTasks.length>0?t.pausedTasks:t.previousTask?[t.previousTask]:[]}async getStalePausedTasks(t){return D(this.lifecycleBackend(),t)}async archiveStalePausedTasks(t){return F(this.lifecycleBackend(),t)}queryBackend(){return{read:this.read.bind(this),update:this.update.bind(this),getPausedTasksFromState:this.getPausedTasksFromState.bind(this)}}async clearTask(t){return N(this.queryBackend(),t)}async hasTask(t){return U(this.queryBackend(),t)}async getPausedTask(t){return J(this.queryBackend(),t)}async getAllPausedTasks(t){return L(this.queryBackend(),t)}async getTaskHistory(t){return v(this.queryBackend(),t)}async getMostRecentTask(t){return q(this.queryBackend(),t)}async getTaskHistoryByType(t,s){return M(this.queryBackend(),t,s)}async getAggregatedFeedback(t){return $(this.queryBackend(),t)}workspaceBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this),createTaskHistoryEntry:this.createTaskHistoryEntry.bind(this),persistHistoryEntry:this.mirrorHistoryEntry.bind(this)}}async startTaskInWorkspace(t,s,e){let n=await this.read(t);this.validateTransition(n,"task",e);let a=await nt(this.workspaceBackend(),t,s,e);return this.mirrorTaskRow(t,a,"in_progress"),a}async getCurrentTaskForWorkspace(t,s){return it(this.workspaceBackend(),t,s)}async completeTaskInWorkspace(t,s,e){let n=await ot(this.workspaceBackend(),t,s,e);return n&&this.mirrorTaskRow(t,n,"completed",{completedAt:d()}),n}async getActiveTasks(t){return ut(this.workspaceBackend(),t)}async archiveOrphanedWorkspaceTasks(t,s){return ct(this.workspaceBackend(),t,s)}async getActiveTaskCount(t){return kt(this.workspaceBackend(),t)}async updateWorkspaceTask(t,s,e){return dt(this.workspaceBackend(),t,s,e)}async addTokens(t,s,e,n){return pt(this.workspaceBackend(),t,s,e,n)}subtaskBackend(){return{read:this.read.bind(this),update:this.update.bind(this),publish:this.publishEvent.bind(this)}}async createSubtasks(t,s){return V(this.subtaskBackend(),t,s)}async completeSubtask(t,s){return G(this.subtaskBackend(),t,s)}async getCurrentSubtask(t){return Y(this.subtaskBackend(),t)}async getNextSubtask(t){return z(this.subtaskBackend(),t)}async getPreviousSubtask(t){return C(this.subtaskBackend(),t)}async getPreviousHandoff(t){return K(this.subtaskBackend(),t)}async getSubtasks(t){return X(this.subtaskBackend(),t)}async getSubtaskProgress(t){return Z(this.subtaskBackend(),t)}async hasSubtasks(t){return tt(this.subtaskBackend(),t)}async areAllSubtasksComplete(t){return st(this.subtaskBackend(),t)}async failSubtask(t,s){return et(this.subtaskBackend(),t,s)}async skipSubtask(t,s){return rt(this.subtaskBackend(),t,s)}async blockSubtask(t,s){return at(this.subtaskBackend(),t,s)}},Lt=new A;export{w as a,Lt 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{c as o}from"./chunk-SO3ZPNWT.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";var c=new Set(["claude","codex","gemini","grok","cursor","opencode","pi","antigravity","kimi","unknown"]);function p(){let n=process.env.PRJCT_AGENT_RUNTIME?.trim().toLowerCase();return n&&c.has(n)?n:n?n.slice(0,32):process.env.CLAUDE_AGENT||process.env.ANTHROPIC_CLAUDE||process.env.CLAUDECODE?"claude":process.env.CODEX_SANDBOX||process.env.PRJCT_SANDBOX==="1"?"codex":process.env.GEMINI_CLI||process.env.GEMINI_API_KEY?"gemini":process.env.CURSOR_TRACE_ID||process.env.CURSOR_AGENT||process.env.CURSOR_SESSION_ID?"cursor":process.env.GROK_API_KEY||process.env.XAI_API_KEY||process.env.GROK_SESSION?"grok":process.env.OPENCODE||process.env.OPENCODE_SESSION||process.env.OPENCODE_CONFIG?"opencode":process.env.PI_CODING_AGENT_DIR||process.env.PI_SESSION||process.env.PI_AGENT?"pi":"unknown"}r(p,"detectRuntimeAgent");function u(n="session"){let e=p(),s=process.env.CLAUDE_SESSION_ID||process.env.CODEX_SESSION_ID||process.env.PRJCT_SESSION_ID||void 0,t=process.env.PRJCT_AGENT?.trim(),i=t&&t.length>0?t:o(`identity:${e}:${n}`);return{agent:e,identity:i,sessionId:s}}r(u,"resolveCallerIdentity");function d(n){let e=n.trim().toLowerCase();return e==="claude-code"||e==="anthropic"?"claude":e==="openai"||e==="oai"?"codex":e==="google"?"gemini":e==="xai"||e==="grok-build"?"grok":e==="opencode-ai"||e==="open-code"?"opencode":e==="pi-coding-agent"||e==="pi-agent"?"pi":e.slice(0,32)}r(d,"normalizeAgentName");function E(n,e){return n?!!(n.ownerSessionId&&e.sessionId&&n.ownerSessionId===e.sessionId||n.ownerIdentity&&e.identity&&n.ownerIdentity===e.identity):!1}r(E,"sameOwner");export{c as a,p as b,u as c,d,E as e};
@@ -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,c as s,d as _}from"./chunk-3TRXQAU4.mjs";var N={};_(N,{MEMORY_EVENT_RANGE:()=>R,REMEMBER_ACTION_PREFIX:()=>e,REMEMBER_EVENT_PREFIX:()=>o,REMEMBER_EVENT_RANGE:()=>T,STATUS_CHANGE_ACTION:()=>M,TAG_EVENT_TYPE:()=>c});function r(t){return t.slice(0,-1)+String.fromCharCode(t.charCodeAt(t.length-1)+1)}var E,e,o,c,R,T,M,a=s(()=>{"use strict";E="memory.",e="remember.",o=`${E}${e}`,c=`${E}task.tagged`;n(r,"prefixUpperBound");R=[E,r(E)],T=[o,r(o)],M="status.changed"});export{e as a,o as b,c,R as d,T as e,M as f,N as g,a as h};
@@ -0,0 +1,19 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{g as c,i as S}from"./chunk-DMO3ZFUG.mjs";import{a as m}from"./chunk-3TRXQAU4.mjs";S();var E=45,O=1,T=.4,R=2.5,h=-2.5,x=-.5,I=-1.3,p=864e5,N=["resolves","relates","supersedes","superseded-by","duplicates","spec"],C=["corrects","contradicts"],d=/\bmem[_-](\d+)\b/g;function w(n,r){let e=new Set;for(let t of N){let s=r[t];if(s)for(let o of String(s).matchAll(d))e.add(`mem_${o[1]}`)}for(let t of n.matchAll(d))e.add(`mem_${t[1]}`);for(let t of l(r))e.delete(t);return[...e]}m(w,"extractRefIds");function l(n){let r=new Set;for(let e of C){let t=n[e];if(t)for(let s of String(t).matchAll(d))r.add(`mem_${s[1]}`)}return[...r]}m(l,"extractCorrectionIds");function g(n,r,e,t,s){c.run(n,`INSERT INTO memory_usefulness (memory_id, score, ${t}, last_used_at)
8
+ VALUES (?, ?, 1, ?)
9
+ ON CONFLICT(memory_id) DO UPDATE SET
10
+ score = score + ?, ${t} = ${t} + 1, last_used_at = excluded.last_used_at`,r,e,s,e)}m(g,"bump");function f(n,r,e,t){c.run(n,`INSERT INTO memory_usefulness (memory_id, score, last_used_at)
11
+ VALUES (?, ?, ?)
12
+ ON CONFLICT(memory_id) DO UPDATE SET
13
+ score = score + ?, last_used_at = excluded.last_used_at`,r,e,t,e)}m(f,"addScore");var L={recordReferences(n,r,e,t=new Date().toISOString()){try{for(let s of w(r,e))g(n,s,O,"ref_count",t)}catch{}},recordCorrection(n,r,e=new Date().toISOString()){try{for(let t of l(r))f(n,t,h,e)}catch{}},recordFetch(n,r,e=new Date().toISOString()){try{g(n,r,T,"fetch_count",e)}catch{}},recordSurfaced(n,r,e,t=new Date().toISOString(),s={}){if(!(!e||r.length===0))try{let o=s.queryText?.trim()||null,u=s.surface?.trim()||null;for(let a of r)c.run(n,`INSERT INTO memory_surface_log (memory_id, task_id, created_at, query_text, surface)
14
+ VALUES (?, ?, ?, ?, ?)
15
+ ON CONFLICT(memory_id, task_id) DO UPDATE SET
16
+ query_text = COALESCE(memory_surface_log.query_text, excluded.query_text),
17
+ surface = COALESCE(memory_surface_log.surface, excluded.surface)`,a,e,t,o,u)}catch{}},penalizeSurfaced(n,r,e=new Date().toISOString()){if(!r)return 0;try{let t=c.query(n,"SELECT memory_id FROM memory_surface_log WHERE task_id = ?",r);for(let s of t)f(n,s.memory_id,x,e);return t.length}catch{return 0}},penalizeSkillMiss(n,r,e=new Date().toISOString()){try{f(n,r,I,e)}catch{}},creditShippedTask(n,r,e=new Date().toISOString()){if(!r)return 0;try{let t=c.query(n,"SELECT memory_id, query_text, surface FROM memory_surface_log WHERE task_id = ?",r);for(let s of t){f(n,s.memory_id,R,e);let o=s.query_text?.trim();o&&c.run(n,`INSERT OR IGNORE INTO retrieval_eval_labels
18
+ (query_text, positive_id, source, source_task_id, created_at, metadata)
19
+ VALUES (?, ?, ?, ?, ?, ?)`,o,s.memory_id,"ship-surfaced",r,e,JSON.stringify({surface:s.surface??"unknown"}))}return c.run(n,"DELETE FROM memory_surface_log WHERE task_id = ?",r),t.length}catch{return 0}},decayedScores(n,r=Date.now(),e){let t=new Map,s=(()=>{try{if(e&&e.length>0){let o=[...new Set(e)].slice(0,200),u=o.map(()=>"?").join(",");return c.query(n,`SELECT memory_id, score, last_used_at FROM memory_usefulness WHERE memory_id IN (${u})`,...o)}else return e&&e.length===0?[]:c.query(n,"SELECT memory_id, score, last_used_at FROM memory_usefulness")}catch{return null}})();if(!s)return t;for(let o of s){let u=Date.parse(o.last_used_at),a=Number.isNaN(u)?1:.5**(Math.max(0,r-u)/p/E);t.set(o.memory_id,o.score*a)}return t},rerank(n,r,e=Date.now()){if(r.length<2)return r;let t=(()=>{try{return this.decayedScores(n,e,r.map(i=>i.id))}catch{return null}})();if(!t||t.size===0)return r;let s=Math.max(1,...t.values()),o=4,u=r.length,a=r.map((i,_)=>{let y=(t.get(i.id)??0)/s;return{entry:i,i:_,rankScore:u-_+o*y}});return a.sort((i,_)=>_.rankScore-i.rankScore||i.i-_.i),a.map(i=>i.entry)}};export{w as a,l as b,L as c};
@@ -0,0 +1,30 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as O}from"./chunk-JT4RNQ67.mjs";import{a as A}from"./chunk-VCSESVZ4.mjs";import{g as I}from"./chunk-YJOC2JJK.mjs";import{a as P,h as tt}from"./chunk-EZRNQXCC.mjs";import{a as h}from"./chunk-KUQLXY2P.mjs";import{b as R}from"./chunk-EHVU2SMR.mjs";import{b}from"./chunk-OIE3AKKO.mjs";import{a as w,c as x,d as S}from"./chunk-7QTE6X4J.mjs";import{c as E}from"./chunk-4PPIE6GA.mjs";import{a as m}from"./chunk-NXUIMC22.mjs";import{a as T,b as j,g as p,i as _}from"./chunk-DMO3ZFUG.mjs";import{d as N}from"./chunk-INJ5WT2D.mjs";import{e as D,l as Z}from"./chunk-HU5ERAAV.mjs";import{a as d}from"./chunk-3TRXQAU4.mjs";_();function g(e,t,n){return e[t]??e[n]??""}d(g,"str");var L={async upsert(e,t){let n=g(t,"id","id"),r=g(t,"entity_type","entityType"),s=g(t,"entity_id","entityId");if(!n||!r||!s||p.get(e,"SELECT id FROM archives WHERE entity_type = ? AND entity_id = ? LIMIT 1",r,s))return;let c=typeof t.entity_data=="string"?t.entity_data:t.entity_data!=null?JSON.stringify(t.entity_data):"{}",o=g(t,"archived_at","archivedAt")||g(t,"created_at","createdAt")||new Date().toISOString(),a=t.summary??null,u=g(t,"reason","reason")||"sync";try{p.run(e,`INSERT OR IGNORE INTO archives
8
+ (id, entity_type, entity_id, entity_data, summary, archived_at, reason)
9
+ VALUES (?, ?, ?, ?, ?, ?, ?)`,n,r,s,c,a,o,u)}catch{}},async delete(e,t){}};_();var C={async upsert(e,t){let n=t.name||"";if(!n)return;let r=t.description??null,s=et(t.metadata),i=new Date().toISOString(),c=p.get(e,"SELECT id, is_builtin FROM custom_workflows WHERE name = ?",n);if(c){if(c.is_builtin===1)return;p.run(e,"UPDATE custom_workflows SET description = ?, metadata = ?, updated_at = ? WHERE name = ? AND is_builtin = 0",r,s,i,n);return}p.run(e,`INSERT INTO custom_workflows (name, description, created_at, updated_at, is_builtin, enabled, metadata)
10
+ VALUES (?, ?, ?, ?, 0, 0, ?)`,n,r,t.created_at||i,i,s)},async delete(e,t){}};function et(e){if(e==null)return null;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return null}}d(et,"serializeMetadata");var M={async upsert(e,t){let n=t.id||"";if(!n)return;let r=t.title||t.text||"";if(!r.trim())return;let s=t.priority||"medium",i=t.status||"active";await O.upsertIdea(e,{id:n,text:r,priority:s,status:i==="archived"?"archived":"pending",addedAt:t.created_at??t.addedAt??new Date().toISOString()})},async delete(e,t){}};j();tt();_();function nt(e){if(!e)return{};if(typeof e=="string")try{return JSON.parse(e)}catch{return{}}return typeof e=="object"?e:{}}d(nt,"asTags");function f(e,t,n){return e[t]??e[n]??""}d(f,"field");var W={async upsert(e,t){let n=f(t,"content","content"),r=f(t,"type","type");if(!n||!r)return;let s=nt(t.tags),i=f(t,"provenance","provenance")||"declared",c=t.source??null,o=T(n);if(p.get(e,"SELECT id FROM memory_entries WHERE content_hash = ? AND type = ? AND deleted_at IS NULL LIMIT 1",o,r))return;let u=t.created_at||t.createdAt||new Date().toISOString();p.appendEvent(e,`memory.${P}${r}`,{content:n,tags:s,source:c,provenance:i,content_hash:o,project_id:e,created_at:u})},async delete(e,t){let n=f(t,"id","id"),r=f(t,"content","content"),s=f(t,"type","type"),i=[];if(/^mem_\d+$/.test(n)&&i.push(n),r&&s){let o=T(r),a=p.query(e,"SELECT id FROM memory_entries WHERE content_hash = ? AND type = ? AND deleted_at IS NULL",o,s);i.push(...a.map(u=>u.id))}let c=[...new Set(i)];for(let o of c){let a=o.match(/^mem_(\d+)$/)?.[1];a&&p.run(e,"UPDATE events SET type = ? WHERE id = ?","memory.deleted.context-quality",Number(a)),p.run(e,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o),p.run(e,"DELETE FROM memory_embeddings WHERE memory_id = ?",o)}}};var F={async upsert(e,t){let n=t.description||"";if(!n.trim())return;let r=t.id||"";if(!r){await h.addTask(e,{description:n,priority:t.priority||"medium",type:t.type||"feature",section:t.section||"backlog"});return}await h.upsertTask(e,{id:r,description:n,...t.priority?{priority:t.priority}:{},...t.type?{type:t.type}:{},...t.section?{section:t.section}:{}})},async delete(e,t){}};var k={async upsert(e,t){await A.addShipped(e,{name:t.name||t.title||"",version:t.version||"",description:t.description||""},t.created_at||t.shippedAt||t.shipped_at)},async delete(e,t){}};var U={async upsert(e,t){let n=t.id||"";n&&I.applyRemote(e,{id:n,title:t.title,status:t.status,content:t.content??{},tags:t.tags,created_at:t.created_at,updated_at:t.updated_at})},async delete(e,t){}};var $={async upsert(e,t){let n=t.id||"";if(!n)return;let r=t.status||"";if(r==="completed"||r==="shipped"){await R.update(e,s=>s.currentTask?.id===n?{...s,currentTask:null}:s);return}if(r==="active"||t.started_at||t.startedAt){await R.update(e,s=>({...s,currentTask:{id:n,description:t.description,startedAt:t.started_at||t.startedAt||new Date().toISOString(),sessionId:t.session_id||t.sessionId||""}}));return}(t.description||"").trim()&&await h.upsertTask(e,{id:n,description:t.description,...t.priority?{priority:t.priority}:{},...t.type?{type:t.type}:{}})},async delete(e,t){}};_();var q={async upsert(e,t){let n=Number(t.id);if(!Number.isSafeInteger(n)||n<=0)return;let r=-n;p.transaction(e,s=>{s.prepare(`INSERT INTO workflow_rules
11
+ (id, type, command, position, action, description, enabled, timeout_ms,
12
+ created_at, sort_order, when_expr, parallel, trust_source)
13
+ VALUES (?, ?, ?, ?, ?, ?, 0, ?, ?, ?, ?, ?, 'imported')
14
+ ON CONFLICT(id) DO UPDATE SET
15
+ type = excluded.type,
16
+ command = excluded.command,
17
+ position = excluded.position,
18
+ action = excluded.action,
19
+ description = excluded.description,
20
+ enabled = 0,
21
+ timeout_ms = excluded.timeout_ms,
22
+ sort_order = excluded.sort_order,
23
+ when_expr = excluded.when_expr,
24
+ parallel = excluded.parallel,
25
+ trust_source = 'imported'`).run(r,t.type||"step",t.command||"",t.position||"",t.action||"",t.description??null,typeof t.timeout_ms=="number"?t.timeout_ms:0,t.created_at||new Date().toISOString(),typeof t.sort_order=="number"?t.sort_order:0,t.when_expr??null,t.parallel===0?0:1),s.prepare("DELETE FROM workflow_rules WHERE id = ? AND trust_source = 'imported'").run(n)})},async delete(e,t){}};var v={memories:W,tasks:$,ideas:M,queue_tasks:F,shipped_items:k,shipped_features:k,custom_workflows:C,workflow_rules:q,specs:U,archives:L},Ut=Object.keys(v),Y=new Set(["roadmap_features","projects","sessions","agents","subtasks","metrics_daily","work_cost_snapshots","velocity_sprints","analysis"]);_();Z();function z(e,t,n){if(!t||!n)return null;try{return p.get(e,"SELECT content_hash, applied_at FROM sync_applied_hashes WHERE entity_type = ? AND entity_id = ?",t,n)?.content_hash??null}catch{return null}}d(z,"getApplied");function B(e,t,n,r,s){if(!(!t||!n||!r))try{p.run(e,`INSERT INTO sync_applied_hashes (entity_type, entity_id, content_hash, applied_at, created_at)
26
+ VALUES (?, ?, ?, ?, ?)
27
+ ON CONFLICT(entity_type, entity_id) DO UPDATE SET
28
+ content_hash = excluded.content_hash,
29
+ applied_at = excluded.applied_at,
30
+ created_at = COALESCE(excluded.created_at, sync_applied_hashes.created_at)`,t,n,r,D(),s??null)}catch{}}d(B,"recordApplied");function V(e,t,n){if(!(!t||!n))try{p.run(e,"DELETE FROM sync_applied_hashes WHERE entity_type = ? AND entity_id = ?",t,n)}catch{}}d(V,"clearApplied");var G=new Set;function rt(e){if(G.has(e))return;G.add(e);let n=Y.has(e)?"CLI does not track this entity locally yet \u2014 see Phase 2 spec":"no local handler registered";console.warn(`[sync] apply skipped: entity_type='${e}' (${n}). code=no_local_handler`)}d(rt,"warnNoLocalHandler");var J=new Set;function st(e){J.has(e)||(J.add(e),console.warn(`[sync] inbound '${e}' event has no created_at \u2014 origin chronology cannot be preserved. The producer should include created_at in its payload. code=missing_origin_created_at`))}d(st,"warnMissingCreatedAt");function it(e){let t=e.data??{},n=e.content_hash??e.contentHash;if(e.entity_type){let c=(e.event_type||"upsert")==="delete"?"delete":"upsert";return{entityType:e.entity_type,eventType:c,data:t,contentHash:n}}if(e.entityType){let c=e.eventType||"upsert";return{entityType:e.entityType,eventType:c==="delete"?"delete":"upsert",data:t,contentHash:n}}let[r,s]=(e.type||"").split("."),i=s==="deleted"||s==="archived"||s==="removed";return{entityType:w(r)||r||"unknown",eventType:i?"delete":"upsert",data:t,contentHash:n}}d(it,"normalizeEventShape");function K(e){return e instanceof Error?e.message:e&&typeof e=="object"&&"message"in e?String(e.message):"Unknown error"}d(K,"errorMessage");function X(e){if(e&&typeof e=="object"&&"code"in e)return e.code}d(X,"errorCode");var H=class{static{d(this,"SyncManager")}async hasAuth(){return await E.hasAuth()}async getStatus(t){if(!await this.hasAuth())return null;try{return await S.getStatus(t)}catch{return null}}async sync(t,n){if(!await this.hasAuth())return{success:!0,skipped:!0,reason:"no_auth"};let r={success:!0,skipped:!1};try{await A.republishShips(t)}catch{}let s=await this.push(t,n);s.success&&!s.skipped&&(r.pushed={count:s.count||0,syncedAt:s.syncedAt||new Date().toISOString()});let i=await this.pull(t);return i.success&&!i.skipped&&(r.pulled={count:i.count||0,syncedAt:i.syncedAt||new Date().toISOString()}),(!s.success||!i.success)&&(r.success=!1,r.error=s.error||i.error,r.code=s.code||i.code),r}async push(t,n){if(!await this.hasAuth())return{success:!0,skipped:!0,reason:"no_auth"};try{let r=await m.getPending(t),s=n?.include?r.filter(a=>{let u=w(a.entityType)??w(a.type?.split(".")[0]);return u?x(u,n.include):!0}):r;if(s.length===0)return{success:!0,skipped:!0,reason:"no_pending"};let i=await this.createProjectLinkEvent(t),c=i?[i,...s]:s,o=await S.pushEvents(t,c);if(o.success)return await m.clearPending(t),await m.updateLastSync(t),{success:!0,skipped:!1,count:o.processed,syncedAt:o.syncedAt};{let a=o.processed,u=o.errors.length,l=o.errors.map(y=>y.error).join(", ");return{success:!1,skipped:!1,count:a,syncedAt:o.syncedAt,error:`${u} events failed: ${l}`}}}catch(r){return{success:!1,skipped:!1,reason:"error",error:K(r),code:X(r)}}}async pull(t){if(!await this.hasAuth())return{success:!0,skipped:!0,reason:"no_auth"};try{let{syncCursorStorage:n}=await import("./sync-cursor-storage-GKO4X2QN.mjs"),r=await E.read(),s=r.deviceId??null,i=r.userId??null,o=(s?n.get(t,i,s):null)?.lastEventId??0,a=await S.pullEvents(t,o);if(a.events.length===0)return await m.updateLastSync(t),{success:!0,skipped:!1,count:0,applied:0,syncedAt:a.syncedAt};let u=await this.applyPulledEvents(t,a.events),l=a.events.flatMap(y=>[y.event_id,y.eventId]).filter(y=>typeof y=="number").reduce((y,Q)=>Math.max(y,Q),o);return s&&l>o&&n.advance(t,l,{userId:i,deviceId:s}),await m.updateLastSync(t),{success:!0,skipped:!1,count:a.events.length,applied:u,syncedAt:a.syncedAt}}catch(n){return{success:!1,skipped:!1,reason:"error",error:K(n),code:X(n)}}}async applyPulledEvents(t,n){let r=[];for(let s of n)try{await this.applyEvent(t,s),r.push(s)}catch(i){let c=s.entity_type||s.type||"unknown";console.error(`Failed to apply event ${c}:`,i)}return r.length}async applyRealtimeEvent(t,n){try{let r=await E.read(),s=r.deviceId??null,i=n.origin_device_id??n.originDeviceId;if(s&&i&&i===s)return!1;await this.applyEvent(t,n);let c=typeof n.event_id=="number"?n.event_id:typeof n.eventId=="number"?n.eventId:null;if(c!==null){let{syncCursorStorage:o}=await import("./sync-cursor-storage-GKO4X2QN.mjs"),a=r.userId??null,u=r.deviceId??null;if(u){let l=o.get(t,a,u);(!l||c>l.lastEventId)&&o.advance(t,c,{userId:a,deviceId:u})}}return!0}catch(r){return console.error("[realtime] apply failed:",r instanceof Error?r.message:r),!1}}async applyEvent(t,n){let{entityType:r,eventType:s,data:i,contentHash:c}=it(n),o=i.id??"",a=v[r];if(!a){rt(r);return}if(s==="delete"){await a.delete(t,i),o&&V(t,r,o);return}if(!(c&&this.alreadyApplied(t,r,o,c))&&(await a.upsert(t,i),o)){let u=i.created_at??i.createdAt??null;u||st(r);let l=c??N(i);B(t,r,o,l,u)}}alreadyApplied(t,n,r,s){if(!r)return!1;let i=z(t,n,r);return i!==null&&i===s}async createProjectLinkEvent(t){try{let n=await b(t).catch(()=>({}));return{type:"project.updated",path:["project"],data:{id:t,cli_project_id:t,meta:n},timestamp:new Date().toISOString(),projectId:t}}catch{return null}}},ot=new H,ee=ot;export{ee 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{e as o,g as m}from"./chunk-2EEMQV7N.mjs";import{a as n,j as l}from"./chunk-KPR5TWSN.mjs";import{a as t,c as p}from"./chunk-3TRXQAU4.mjs";function s(){return`${["---","name: prjct","description: prjct work cycles + memory; run prjct verbs, do not preload context.","---","","# prjct","","Run `prjct <cmd> --md` and follow it.","",`- ${e.rag}`,`- ${e.entrypoint}`,`- ${e.pull}`,`- ${e.remember}`,`- ${e.kb}`,`- ${e.ship}`,`- ${e.loop}`,`- ${e.identity}`,"",`Commit footer: \`${i}\``].join(`
8
+ `)}
9
+ `}function c(r){return`${["<!-- prjct:start - DO NOT REMOVE THIS MARKER -->","# p/ \u2014 Context layer for AI agents","","Skills auto-activate for: work, intent, ship, sync, guard, remember, search, insights, performance","Other commands: run `prjct <command> --md` and follow CLI output","","Flow: known verbs run as `prjct <cmd> --md` (sync, search, remember, ship, guard, land, prime\u2026).",'`prjct work` is only for task/work cycles \u2014 never wrap a bare verb as work "sync".',"Substantive implementation follows the persisted work-cycle station from `prjct work --md`:","reviewed intent, evidence, tests when required, then code.","Sync analysis: prefer schema v1 JSON via `prjct analysis-save-llm` (markdown = thin notes only).","","Data:","- Persist everything (memories, context, intents) in ENGLISH, whatever language the user speaks",`- ${e.rag}`,`- ${e.entrypoint}`,`- ${e.pull}`,`- Sovereign knowledge base \u2014 ${e.kb}`,`- ${e.remember}`,`- ${e.loop}`,"- On close, save synthesized context; raw quotes, counters, detector rows, and transcript chunks are inputs, not final memory","- prjct remembers and shows the path; the agent decides how to execute with its own native tools","- Treat prjct output as signals, not a prescriptive harness",`- Commit footer: \`${i}\``,"- Path resolution: `.prjct/prjct.config.json` \u2192 `~/.prjct-cli/projects/{projectId}`","- Storage: `prjct` CLI (SQLite internally)","- Worktree hygiene: if working in a git worktree, remove it AFTER its PR merges \u2014 `git worktree remove` from the main worktree; never with uncommitted/unpushed work, never `--force`","",`Crew (opt-in via \`prjct crew install\`): Leader (blue) \xB7 Implementer (purple) \xB7 Reviewer (pink). Subagent dispatch is Claude-Code-only; in ${r}, identify the role you are playing explicitly.`,"","**Auto-managed by prjct-cli** | https://prjct.app","<!-- prjct:end - DO NOT REMOVE THIS MARKER -->"].join(`
10
+ `)}
11
+ `}function b(r){return`${["---",r,"---","",u,o,"","**Auto-managed by prjct-cli** | https://prjct.app",g].join(`
12
+ `)}
13
+ `}function S(r){return a[r]?.()??null}var d,i,u,g,e,h,y,w,j,R,a,O,f=p(()=>{"use strict";l();m();d=n.join("/"),i="Generated with [p/](https://www.prjct.app/)",u="<!-- prjct:start - DO NOT REMOVE THIS MARKER -->",g="<!-- prjct:end - DO NOT REMOVE THIS MARKER -->",e={rag:"prjct is a RAG-backed project memory harness; do not preload project history.",entrypoint:'Tasks \u2192 `prjct work "\u2026"`. Known cmds (`sync`/`search`/`remember`/\u2026) \u2192 `prjct <cmd>` \u2014 never work-wrap.',pull:"Pull only what surfaces: `prjct search` / `context memory` / `guard` / MCP \u2014 not something to load wholesale.",remember:'Save synthesized memory in English: `prjct remember <decision|learning|gotcha|context> "<text>"`.',kb:`KB (\`${d}\`): \`remember <facet>\` / \`context memory <facet>\` \u2014 on demand, never injected here.`,ship:"Ship only after user OKs: `prjct ship --md`.",loop:"Loop: land; H2+ intent; tip\u2192user SoT; close.",identity:"L0 portable; id=cwd."};t(s,"buildCompactSkill");h=s,y=s;t(c,"buildGlobalConfig");w=t(()=>c("Gemini"),"buildGeminiConfig"),j=t(()=>c("Antigravity"),"buildAntigravityConfig");t(b,"buildIdePointer");R=t(()=>b(`description: "prjct \u2014 pull project memory + workflow on demand"
14
+ alwaysApply: true`),"buildCursorRule"),a={"codex/SKILL.md":h,"antigravity/SKILL.md":y,"global/GEMINI.md":w,"global/ANTIGRAVITY.md":j,"global/CURSOR.mdc":R},O=Object.freeze(Object.keys(a));t(S,"buildEditorSurface")});export{s as a,S as b,f 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{h as s}from"./chunk-ID2C2S33.mjs";import{e,g as p}from"./chunk-225DWS4D.mjs";import{a as n}from"./chunk-3TRXQAU4.mjs";p();function i(o,t,r){if(r.md){console.log(`> ${t}`);return}s[o](t)}n(i,"notify");var d=n((o,t={})=>i("warn",o,t),"notifyWarn"),a=n((o,t={})=>i("info",o,t),"notifyInfo"),f=n((o,t={})=>i("fail",o,t),"notifyFail"),u=n((o,t={})=>i("done",o,t),"notifyDone");function l(o,t={}){return d(o,t),{success:!1,error:o}}n(l,"failWith");function y(o,t={}){return f(o,t),{success:!1,error:o}}n(y,"failHard");function M(o,t){let r=e(o);return t&&f(r,t),{success:!1,error:r}}n(M,"failFromError");export{a,f as b,u as c,l as d,y as e,M as f};
@@ -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{a as l,f as d,g}from"./chunk-UT425KVX.mjs";import{b as p,c as k}from"./chunk-DOJPSIMG.mjs";import{a as n}from"./chunk-3TRXQAU4.mjs";k();import f from"node:fs/promises";import E from"node:path";var x="# prjct:mcp:start - managed by prjct, do not edit between markers",C="# prjct:mcp:end",b="# prjct:mcp:context7:start - managed by prjct, do not edit between markers",j="# prjct:mcp:context7:end",S=["model-with-reasoning","current-dir","git-branch","context-remaining","five-hour-limit","weekly-limit","task-progress"];function h(){return process.env.PRJCT_TEST_MODE==="1"?E.join(p(".prjct-tests"),"codex","config.toml"):p(".codex","config.toml")}n(h,"getCodexConfigTomlPath");function u(t){return`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}n(u,"tomlString");function T(t,e,c,o){let s=(e.args??[]).map(u).join(", "),r=[c,`[mcp_servers.${t}]`,`command = ${u(e.command)}`,`args = [${s}]`];if(e.env&&Object.keys(e.env).length>0){let a=Object.entries(e.env).map(([i,m])=>`${i} = ${u(m)}`).join(", ");r.push(`env = { ${a} }`)}return r.push(o,""),r.join(`
8
+ `)}n(T,"buildMcpTomlBlock");function _(t=l.prjct){return T("prjct",t,x,C)}n(_,"buildPrjctMcpTomlBlock");function M(t=l.context7){return T("context7",t,b,j)}n(M,"buildContext7McpTomlBlock");function $(){return["[tui]",`status_line = [${S.map(u).join(", ")}]`,""].join(`
9
+ `)}n($,"buildCodexStatusLineToml");function R(t){return/^\s*(?:tui\.)?status_line\s*=/m.test(t)}n(R,"hasCodexStatusLine");function v(t){if(R(t))return{toml:t,changed:!1};let c=`status_line = [${S.map(u).join(", ")}]
10
+ `,o=/^\s*\[tui\]\s*$/m.exec(t);if(o){let r=o.index+o[0].length,a=t.slice(0,r),i=t.slice(r),m=i.startsWith(`
11
+ `)?i.slice(1):i;return{toml:`${a}
12
+ ${c}${m}`,changed:!0}}let s=$();return{toml:t.trim().length>0?`${t.trimEnd()}
13
+
14
+ ${s}`:s,changed:!0}}n(v,"ensureCodexStatusLineToml");async function L(t=h()){let e=await f.readFile(t,"utf-8").catch(()=>""),c=_(),o=d(e,c,x,C,"prjct"),s=o.skipped,r=v(o.next),a=r.toml,i=await g(t,e,a);return{...i,skipped:s,...i.changed?{statusLineChanged:r.changed}:{}}}n(L,"ensureCodexMcpServer");async function O(t=h()){let e=await f.readFile(t,"utf-8").catch(()=>""),c=M(),{next:o,skipped:s}=d(e,c,b,j,"context7");return{...await g(t,e,o),skipped:s}}n(O,"ensureCodexContext7Server");async function N(t=h()){try{let e=await f.readFile(t,"utf-8");return/^\s*\[mcp_servers\.context7\]/m.test(e)}catch{return!1}}n(N,"codexHasContext7Server");export{h as a,_ as b,M as c,$ as d,L as e,O as f,N as g};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{F as l,G as d}from"./chunk-HU5ERAAV.mjs";import{g as t,l as c,p as u}from"./chunk-HYIT7MF5.mjs";import{e as o,g as f}from"./chunk-225DWS4D.mjs";import{a}from"./chunk-3TRXQAU4.mjs";f();u();d();import n from"node:fs/promises";import m from"node:path";var s=class{static{a(this,"EditorsConfig")}get configDir(){return l.globalConfigDir}get configFile(){return m.join(this.configDir,"installed-editors.json")}async ensureConfigDir(){try{await n.mkdir(this.configDir,{recursive:!0})}catch(r){console.error("[editors-config] Error creating config directory:",o(r))}}async loadConfig(){try{let r=await n.readFile(this.configFile,"utf-8");return JSON.parse(r)}catch(r){return r.code==="ENOENT"||console.error("[editors-config] Error loading config:",o(r)),null}}async saveConfig(r,i,g="claude"){try{await this.ensureConfigDir();let e={version:r,provider:g,lastInstall:new Date().toISOString(),path:i};return await t(this.configFile,e),!0}catch(e){return console.error("[editors-config] Error saving config:",o(e)),!1}}async getProvider(){let r=await this.loadConfig();return r?r.provider||"claude":null}async getLastVersion(){let r=await this.loadConfig();return r?r.version:null}async hasVersionChanged(r){let i=await this.getLastVersion();return i!==null&&i!==r}async updateVersion(r){try{let i=await this.loadConfig();return i?(i.version=r,i.lastInstall=new Date().toISOString(),await t(this.configFile,i),!0):!1}catch(i){return!1}}async configExists(){return c(this.configFile)}async deleteConfig(){try{return await this.configExists()&&await n.unlink(this.configFile),!0}catch(r){return console.error("[editors-config] Error deleting config:",o(r)),!1}}},h=new s,C=h;export{C 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{d as f}from"./chunk-WTDUJB4I.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";import s from"node:fs";import g from"node:os";import a from"node:path";function y(r,t){return Array.from({length:Math.max(0,t-1)}).reduce(n=>{let i=n.at(-1),e=a.dirname(i);return e===i?n:[...n,e]},[r])}o(y,"ancestorDirectories");function C(){for(let n of y(__dirname,5))if(s.existsSync(a.join(n,"package.json"))){let i=a.join(n,"dist","daemon","entry.mjs");if(s.existsSync(i))return i;break}let r=[a.join(__dirname,"..","daemon","entry.mjs"),a.join(__dirname,"..","dist","daemon","entry.mjs")];for(let n of r)if(s.existsSync(n))return n;let t=process.argv[1];return t&&s.existsSync(t)?t:null}o(C,"resolveEntryPath");function _(r){return r.codeStale?{restart:!0,lastDriftCheckMs:r.lastDriftCheckMs}:r.ownVersion&&r.command!=="__ping"&&r.now-r.lastDriftCheckMs>=r.driftMinIntervalMs?{restart:r.checkDrift(r.ownVersion),lastDriftCheckMs:r.now}:{restart:!1,lastDriftCheckMs:r.lastDriftCheckMs}}o(_,"decideRestart");function N(r,t){if(!r||t===null)return!1;try{return s.statSync(r).mtimeMs!==t}catch{return!1}}o(N,"isCodeStale");function P(){for(let r of y(__dirname,6)){let t=a.join(r,"package.json");try{let n=JSON.parse(s.readFileSync(t,"utf-8"));if(n?.name==="prjct-cli"&&typeof n.version=="string")return n.version}catch{}}return null}o(P,"readOwnPackageVersion");function S(r,t){let n=o(l=>{let m=l.trim().replace(/^v/i,"").split("-")[0].split("+")[0].split(".").map(d=>Number.parseInt(d,10));return m.length<1||m.some(d=>Number.isNaN(d))?null:[...m,0,0].slice(0,3)},"parse"),i=n(r),e=n(t);if(!i||!e)return!1;let p=i.map((l,u)=>l-e[u]).find(l=>l!==0);return p!==void 0&&p>0}o(S,"isStrictlyNewerVersion");function v(r){if(!r)return!1;let t=g.homedir(),n=[`${t}/Library/pnpm/prjct`,`${t}/.local/share/pnpm/prjct`,`${t}/.npm-global/bin/prjct`,"/usr/local/bin/prjct","/opt/homebrew/bin/prjct",`${t}/.volta/bin/prjct`,`${t}/.asdf/shims/prjct`];for(let i of n){let e=(()=>{try{return s.realpathSync(i)}catch{return null}})();if(e)for(let p of y(a.dirname(e),6)){let l=a.join(p,"package.json");try{let u=JSON.parse(s.readFileSync(l,"utf-8"));if(u?.name==="prjct-cli"&&typeof u.version=="string")return S(u.version,r)}catch{}}}return!1}o(v,"isGlobalVersionDrifted");var k=1024*1024;function L(){let r=f.log();try{if(s.statSync(r).size>k){let n=`${r}.1`;try{s.unlinkSync(n)}catch{}s.renameSync(r,n)}}catch{}}o(L,"rotateLog");function h(r){try{return process.kill(r,0),!0}catch{return!1}}o(h,"isProcessRunning");import c from"node:fs";import b from"node:path";function x(r=f.runDir()){return b.join(r,"daemon.spawn.lock")}o(x,"spawnLockPath");function O(r=f.runDir(),t=process.pid){c.mkdirSync(r,{recursive:!0});let n=x(r);for(let i of[0,1])try{let e=c.openSync(n,"wx");try{c.writeFileSync(e,`${t}
8
+ `)}catch{try{c.closeSync(e)}catch{}try{c.unlinkSync(n)}catch{}return null}return{fd:e,path:n}}catch{let e=(()=>{try{return parseInt(c.readFileSync(n,"utf-8").trim(),10)}catch{return null}})();if(e&&!Number.isNaN(e)&&h(e))return null;try{c.unlinkSync(n)}catch{return null}}return null}o(O,"tryAcquireSpawnLock");function V(r){if(r){try{c.closeSync(r.fd)}catch{}try{if(c.existsSync(r.path)){let t=c.readFileSync(r.path,"utf-8").trim();(t===String(process.pid)||t===`${process.pid}`)&&c.unlinkSync(r.path)}}catch{}}}o(V,"releaseSpawnLock");function R(r){let t=r.errorCode??"",n=r.errorMessage,i=t==="EADDRINUSE"||n.includes("EADDRINUSE")||n.includes("address already in use")||n.includes("Failed to listen");return i&&r.peerHealthy?{exitCode:0,reason:"lost-spawn-race-peer-healthy"}:i?{exitCode:1,reason:"listen-failed-no-peer"}:{exitCode:1,reason:"listen-error"}}o(R,"decideListenFailure");export{C as a,_ as b,N as c,P as d,v as e,L as f,h as g,O as h,V as i,R as j};
@@ -0,0 +1,7 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{e as s}from"./chunk-FOWTB762.mjs";import{b as i}from"./chunk-3USVY66O.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";function d(t,n){let o=((t??"").trim().split(/\s+/).filter(Boolean)[0]??"").toLowerCase();return!o||o==="status"||o==="show"?{kind:"status"}:n.includes(o)?{kind:"mode",mode:o}:{kind:"unknown",sub:o}}e(d,"parseModeSubcommand");async function m(t,n={}){let r=await i.readConfig(t).catch(()=>null);return r?.projectId?{ok:!0,value:r}:{ok:!1,result:s("No prjct project here \u2014 run `prjct init` first.",n)}}e(m,"requireProjectConfig");export{d as a,m as b};
@@ -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 r}from"./chunk-3TRXQAU4.mjs";import e from"chalk";var s={ready:e.green("\u2713 ready"),installed:e.yellow("\u25CF installed"),detected:e.yellow("\u25CF detected")};function l(t,i,d="",n="\u25CB not installed"){let o=i==="missing"?e.dim(n):s[i];return` ${t.padEnd(14)}${o}${d}`}r(l,"providerStatusLine");function c(t){return`
8
+ ${e.cyan("p/")} prjct v${t}
9
+ ${e.dim("Context layer for AI coding agents")}
10
+
11
+ ${e.dim("Providers:")}`}r(c,"providerStatusHeader");export{l as a,c as b};
@@ -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{b as u,c as a,d as w}from"./chunk-H2KNJUPN.mjs";import{b as k}from"./chunk-EHVU2SMR.mjs";import{e as h,p as T}from"./chunk-D62TAZG6.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";T();function f(t,n){let r=t===a?a:t.slice(0,6);return{shortId:r,label:`${r} \xB7 ${n??"(detached)"}`}}o(f,"labelFor");async function m(t,n,r){let i=r.filter(e=>e.worktreePath);if(i.length===0)return r;let c=await h(["worktree","list","--porcelain"],{cwd:n,timeoutMs:2e3});if(!c.ok)return r;let s=new Set(c.stdout.split(`
8
+ `).filter(e=>e.startsWith("worktree ")).map(e=>e.slice(9).trim())),p=i.filter(e=>!s.has(e.worktreePath));if(p.length===0)return r;let d=new Set(p.map(e=>e.workspaceId));return await k.archiveOrphanedWorkspaceTasks(t,d),r.filter(e=>!d.has(e.workspaceId))}o(m,"pruneOrphanedWorkspaceTasks");async function P(t,n){let r=await w(n),i=[],c=await k.getTaskSnapshot(t),s=c.currentTask;if(s){let{shortId:e,label:l}=f(a,s.branch);i.push({id:s.id,description:s.description,workspaceId:a,shortId:e,label:l,branch:s.branch,linearId:s.linearId,harness:s.harness,startedAt:s.startedAt,isCurrent:r.workspaceId===a,pipeline:u(t,s.id,a)??void 0})}let p=await m(t,n,c.activeTasks);for(let e of p){if(e.workspaceId===a)continue;let{shortId:l,label:g}=f(e.workspaceId,e.branch);i.push({id:e.id,description:e.description,workspaceId:e.workspaceId,shortId:l,label:g,branch:e.branch,linearId:e.linearId,harness:e.harness,startedAt:e.startedAt,isCurrent:r.workspaceId===e.workspaceId,pipeline:u(t,e.id,e.workspaceId)??void 0})}return i.sort((e,l)=>Number(l.isCurrent)-Number(e.isCurrent)),{current:i.find(e=>e.isCurrent)??null,all:i,mainTaskRaw:s}}o(P,"collectActiveTasks");function I(t){let n=t.isCurrent?"\u2192":" ",r=t.isCurrent?" (this worktree)":"";return`${n} ${t.label} ${t.description}${r}`}o(I,"formatActiveTaskLine");function W(t){if(t.all.length===0)return"No active work cycle.";if(t.all.length===1&&t.current){let r=t.current,i=r.pipeline?`
9
+ Pipeline: ${r.pipeline.station}`:"";return`Active: ${r.description}
10
+ Workspace: ${r.label}${i}`}let n=[`Active work cycles (${t.all.length})`];for(let r of t.all)n.push(I(r));return n.join(`
11
+ `)}o(W,"formatActiveTaskList");export{P as a,I as b,W as c};
@@ -0,0 +1,23 @@
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 d,i as C}from"./chunk-DMO3ZFUG.mjs";import{b as g}from"./chunk-INJ5WT2D.mjs";import{e as f,l as E}from"./chunk-HU5ERAAV.mjs";import{e as _,p as q}from"./chunk-D62TAZG6.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";E();C();function m(e){return{projectId:e.project_id,taskId:e.task_id,workspaceId:e.workspace_id,classification:e.classification,station:e.station,requiresSpec:e.requires_spec===1,requiresTestsFirst:e.requires_tests_first===1,reason:e.reason,linkedSpecId:e.linked_spec_id,createdAt:e.created_at,updatedAt:e.updated_at}}s(m,"toState");function y(e,t){let i=f(),r=d.query(e,`INSERT INTO task_pipeline_state (
8
+ project_id, task_id, workspace_id, classification, station,
9
+ requires_spec, requires_tests_first, reason, linked_spec_id,
10
+ created_at, updated_at
11
+ ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
12
+ ON CONFLICT(project_id, task_id, workspace_id) DO UPDATE SET
13
+ classification = excluded.classification,
14
+ station = excluded.station,
15
+ requires_spec = excluded.requires_spec,
16
+ requires_tests_first = excluded.requires_tests_first,
17
+ reason = excluded.reason,
18
+ linked_spec_id = excluded.linked_spec_id,
19
+ updated_at = excluded.updated_at
20
+ RETURNING *`,e,t.taskId,t.workspaceId,t.classification,t.station,t.requiresSpec?1:0,t.requiresTestsFirst?1:0,t.reason,t.linkedSpecId??null,i,i)[0];if(!r)throw new Error("Task pipeline state upsert returned no row");return m(r)}s(y,"upsertTaskPipelineState");function N(e,t,i){let r=d.query(e,`SELECT * FROM task_pipeline_state
21
+ WHERE project_id = ? AND task_id = ? AND workspace_id = ?
22
+ LIMIT 1`,e,t,i)[0];return r?m(r):null}s(N,"getTaskPipelineState");q();import A from"node:fs/promises";import T from"node:path";var a="main";async function I(e){try{return await A.realpath(e)}catch{return e}}s(I,"safeRealpath");function l(e,t){return`${e} \xB7 ${t??"(detached)"}`}s(l,"buildLabel");var P=new Map,D=5e3;async function U(e){let t=Date.now(),i=P.get(e);if(i&&t-i.at<D)return i.ctx;let n=await R(e);return P.set(e,{ctx:n,at:t}),n}s(U,"deriveWorkspace");async function R(e){let t=await _(["rev-parse","--show-toplevel","--git-dir","--git-common-dir","--abbrev-ref","HEAD"],{cwd:e});if(!t.ok){let b=await I(e);return{workspaceId:a,worktreePath:b,shortId:a,isMain:!0,label:l(a),...t.kind==="exit"?{}:{gitError:t.kind}}}let[i="",n="",r="",c=""]=t.stdout.trim().split(`
23
+ `),S=i.trim(),w=n.trim(),x=r.trim(),o=c.trim()&&c.trim()!=="HEAD"?c.trim():void 0,h=T.resolve(e,w)===T.resolve(e,x),p=await I(S||e);if(h)return{workspaceId:a,worktreePath:p,shortId:a,branch:o,isMain:!0,label:l(a,o)};let u=g(p),k=u.slice(0,6);return{workspaceId:u,worktreePath:p,shortId:k,branch:o,isMain:!1,label:l(k,o)}}s(R,"computeWorkspace");export{y as a,N as b,a as c,U 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 o}from"./chunk-3TRXQAU4.mjs";var s={critical:0,high:1,medium:2,low:3},c={active:0,previously_active:1,backlog:2};function u(e){return[...e].sort((t,r)=>{let i=c[t.section]-c[r.section];return i!==0?i:s[t.priority]-s[r.priority]})}o(u,"sortBySectionAndPriority");function a(e,t){let r=new Set;return e.filter(i=>{let n=t(i);return r.has(n)?!1:(r.add(n),!0)})}o(a,"uniqueBy");function y(e){return Array.from(e.entries()).map(([t,r])=>({path:t,score:r})).sort((t,r)=>r.score-t.score)}o(y,"scoresToSortedArray");export{u as a,a as b,y 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{a as P,c as I,e as M}from"./chunk-6RT2P22O.mjs";import{e as T,f as O}from"./chunk-XYDLXF5A.mjs";import{c as x,g as L}from"./chunk-TTN2CFZC.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{e as n,i as p}from"./chunk-VWFVSNQT.mjs";p();import{z as e}from"zod";var c=e.enum(["low","medium","high","critical"]),t=e.enum(["feature","bug","improvement","chore"]),u=e.enum(["active","backlog","previously_active"]),l=e.enum(["H0","H1","H2","H3"]),m=e.enum(["bug","feature","refactor","docs","chore","security","research","unknown"]),d=e.enum(["low","medium","high"]),g=e.enum(["regression-test","focused-tests","docs-if-public-behavior","config-preservation","spec-or-design","edge-cases","scope-check"]),k=e.enum(["verify-before-done","scope-check","review-before-ship","spec-before-implementation"]),y=e.enum(["pending","in_progress","completed","blocked","paused","failed","skipped"]),o=e.object({title:e.string(),description:e.string(),filesChanged:e.array(e.object({path:e.string(),action:e.enum(["created","modified","deleted"])})),whatWasDone:e.array(e.string()).min(1),outputForNextAgent:e.string().min(1),notes:e.string().optional()}),I=e.object({output:e.string().min(1,"Subtask output is required"),summary:o}),S=e.object({id:e.string(),description:e.string(),domain:e.string(),agent:e.string(),status:y,dependsOn:e.array(e.string()),startedAt:e.string().optional(),completedAt:e.string().optional(),output:e.string().optional(),summary:o.optional(),skipReason:e.string().optional(),blockReason:e.string().optional(),estimatedPoints:e.number().optional(),estimatedMinutes:e.number().optional()}),f=e.object({completed:e.number(),total:e.number(),percentage:e.number()}),s=e.object({level:l,kind:m,risk:d,expectedEvidence:e.array(g),scopeHints:e.array(e.string()),gates:e.array(k),rationale:e.string(),createdAt:e.string()}),r=e.object({featureId:e.string().optional(),subtasks:e.array(S).optional(),currentSubtaskIndex:e.number().optional(),subtaskProgress:f.optional(),linearId:e.string().optional(),linearUuid:e.string().optional(),estimatedPoints:e.number().optional(),estimatedMinutes:e.number().optional(),modelMetadata:n.optional(),tokensIn:e.number().optional(),tokensOut:e.number().optional(),harness:s.optional()}),i=r.extend({id:e.string(),description:e.string(),type:t.optional(),startedAt:e.string(),sessionId:e.string(),linkedSpecId:e.string().optional(),parentDescription:e.string().optional(),branch:e.string().optional(),prUrl:e.string().optional(),turnCount:e.number().optional(),turnLimitAcknowledgedAt:e.string().optional(),ownerAgent:e.string().optional(),ownerIdentity:e.string().optional(),ownerSessionId:e.string().optional(),yieldStatus:e.enum(["active","yielded"]).optional(),pendingHandoffId:e.string().optional()}),a=r.extend({id:e.string(),description:e.string(),status:e.literal("paused"),startedAt:e.string(),pausedAt:e.string(),pauseReason:e.string().optional(),type:t.optional(),sessionId:e.string().optional()}),h=e.object({stackConfirmed:e.array(e.string()).optional(),patternsDiscovered:e.array(e.string()).optional(),agentAccuracy:e.array(e.object({agent:e.string(),rating:e.enum(["helpful","neutral","inaccurate"]),note:e.string().optional()})).optional(),issuesEncountered:e.array(e.string()).optional()}),b=e.object({taskId:e.string(),title:e.string(),classification:t,startedAt:e.string(),completedAt:e.string(),subtaskCount:e.number(),subtaskSummaries:e.array(o),outcome:e.string(),branchName:e.string(),linearId:e.string().optional(),linearUuid:e.string().optional(),prUrl:e.string().optional(),feedback:h.optional(),harness:s.optional(),tokensIn:e.number().optional(),tokensOut:e.number().optional()}),x=i.extend({workspaceId:e.string(),worktreePath:e.string().optional(),agentSessionId:e.string().optional(),jiraId:e.string().optional(),jiraUuid:e.string().optional(),dispatchedFrom:e.string().optional()}),j=e.object({currentTask:i.nullable(),previousTask:a.nullable().optional(),pausedTasks:e.array(a).optional(),taskHistory:e.array(b).optional(),activeTasks:e.array(x).optional(),lastUpdated:e.string()}),T=e.object({id:e.string(),description:e.string(),body:e.string().optional(),priority:c,type:t,featureId:e.string().optional(),originFeature:e.string().optional(),completed:e.boolean(),completedAt:e.string().optional(),createdAt:e.string(),section:u,agent:e.string().optional(),groupName:e.string().optional(),groupId:e.string().optional()}),A=e.object({tasks:e.array(T),lastUpdated:e.string()});export{I as a,j as b,A 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 as A,e as ye}from"./chunk-6RT2P22O.mjs";import{a as Pe}from"./chunk-ZXTJLMVZ.mjs";import{f as y,g as D,h as V,i as fe}from"./chunk-VWFVSNQT.mjs";import{a as L,b as pe}from"./chunk-U24YKPYX.mjs";import{a as z,p as he}from"./chunk-D62TAZG6.mjs";import{a as J,b as m,c as W}from"./chunk-DOJPSIMG.mjs";import{g as K,l,m as F,n as h,p as b}from"./chunk-HYIT7MF5.mjs";import{a as i,c as P,d as de,e as I}from"./chunk-3TRXQAU4.mjs";function Ee(n){let e=n.getFullYear(),t=(n.getMonth()+1).toString().padStart(2,"0"),r=n.getDate().toString().padStart(2,"0");return`${e}-${t}-${r}`}function Y(n){return{year:n.getFullYear().toString(),month:(n.getMonth()+1).toString().padStart(2,"0"),day:n.getDate().toString().padStart(2,"0")}}function Ge(){return new Date().toISOString()}function De(n){let e=new Date;return e.setDate(e.getDate()-n),e}function He(n){return De(n).toISOString()}function _e(n){return typeof n=="number"&&Number.isFinite(n)&&n>0?n:null}function $e(n,e){if(!n||!e)return null;let t=Date.parse(n),r=Date.parse(e);return!Number.isFinite(t)||!Number.isFinite(r)||r<t?null:Math.round((r-t)/6e4)}function Be(n){let e=Math.floor(n/1e3),t=Math.floor(e/60),r=Math.floor(t/60),o=Math.floor(r/24);return o>0?`${o}d ${r%24}h`:r>0?`${r}h ${t%60}m`:t>0?`${t}m`:`${e}s`}function Ue(n){let t=(n??"7d").trim().toLowerCase().match(/^(\d+)\s*([hd])$/);if(!t)return null;let r=Number.parseInt(t[1],10);return!Number.isFinite(r)||r<=0||r>365?null:{n:r,unit:t[2]}}var Oe,q=P(()=>{"use strict";i(Ee,"formatDate");i(Y,"getYearMonthDay");i(Ge,"getTimestamp");i(De,"getDaysAgo");i(He,"sinceIso");i(_e,"nullableNumber");i($e,"durationMinutes");i(Be,"formatDuration");Oe=new Intl.RelativeTimeFormat("en",{numeric:"always"});i(Ue,"parseWindowSpec")});import je from"node:fs";import v from"node:fs/promises";import u from"node:path";async function N(n){let e={isMonorepo:!1,type:null,rootPath:n,packages:[]},t=[{file:"pnpm-workspace.yaml",type:"pnpm"},{file:"lerna.json",type:"lerna"},{file:"nx.json",type:"nx"},{file:"rush.json",type:"rush"},{file:"turbo.json",type:"turborepo"}];for(let r of t)if(await l(u.join(n,r.file))){e.isMonorepo=!0,e.type=r.type;break}if(!e.isMonorepo){let r=u.join(n,"package.json");if(await l(r))try{JSON.parse(await v.readFile(r,"utf-8")).workspaces&&(e.isMonorepo=!0,e.type="npm")}catch{}}return e.isMonorepo&&(e.packages=await R(n,e.type)),e}async function R(n,e){let t=[];try{let r=await(async()=>{if(e==="pnpm"){let g=(await v.readFile(u.join(n,"pnpm-workspace.yaml"),"utf-8")).match(/packages:\s*\n((?:\s*-\s*.+\n?)+)/);return g?g[1].split(`
8
+ `).map(c=>c.replace(/^\s*-\s*['"]?|['"]?\s*$/g,"")).filter(Boolean):[]}if(e==="npm"||e==="lerna"){let a=u.join(n,"package.json"),g=JSON.parse(await v.readFile(a,"utf-8")),c=Array.isArray(g.workspaces)?g.workspaces:g.workspaces?.packages??[];if(e==="lerna"){let d=u.join(n,"lerna.json");if(await l(d)){let p=JSON.parse(await v.readFile(d,"utf-8"));if(p.packages)return p.packages}}return c}if(e==="nx")return["apps/*","libs/*","packages/*"];if(e==="turborepo"){let a=JSON.parse(await v.readFile(u.join(n,"package.json"),"utf-8"));return Array.isArray(a.workspaces)?a.workspaces:[]}return[]})(),o=r.length>0?r:["packages/*","apps/*","libs/*"];for(let a of o){if(a.startsWith("!"))continue;let g=xe(a,{cwd:n});for(let c of g){let d=u.join(n,c),p=u.join(d,"package.json");if(await l(p))try{let f=JSON.parse(await v.readFile(p,"utf-8")),j=u.join(d,"PRJCT.md");t.push({name:f.name||u.basename(c),path:d,relativePath:c,hasPrjctMd:await l(j)})}catch{}}}}catch{}return t}async function Q(n,e){if(!e.isMonorepo)return null;let t=u.resolve(n);for(let r of e.packages){let o=u.resolve(r.path);if(t.startsWith(o))return r}return null}async function T(n){let e=u.resolve(n),t=u.parse(e).root;return e===t?null:(await N(e)).isMonorepo?e:T(u.dirname(e))}var xe,X=P(()=>{"use strict";b();xe=je.globSync;i(N,"detectMonorepo");i(R,"discoverMonorepoPackages");i(Q,"findContainingPackage");i(T,"findMonorepoRoot")});var S={};de(S,{ClaudeProvider:()=>C,CursorProvider:()=>re,GeminiProvider:()=>H,Providers:()=>w,detectAllProviders:()=>B,detectAntigravity:()=>Me,detectCodex:()=>oe,detectKimi:()=>Ie,detectProvider:()=>G,getActiveProvider:()=>Se,getProviderBranding:()=>ke,selectProvider:()=>Fe,validateCliVersion:()=>ie});import E from"node:path";async function $(n){let e=await A(n);return e||(process.platform==="win32"?A(`${n}.cmd`):null)}async function Ce(n){try{let{stdout:e}=await z(`${n} --version`,{timeout:2e3}),t=e.match(/\d+\.\d+\.\d+/);return t?t[0]:e.trim()}catch{return null}}async function G(n){let e=w[n];if(!e.cliCommand)return{installed:!1};let t=await $(e.cliCommand);if(!t)return{installed:!1};let r=await Ce(e.cliCommand),o=ie(n,r||void 0);return{installed:!0,version:r||void 0,path:t,versionWarning:o||void 0}}function ie(n,e){let t=w[n];return!t.minCliVersion||!e?null:V(e,t.minCliVersion)<0?`\u26A0\uFE0F ${t.displayName} v${e} is below minimum v${t.minCliVersion}. Some features may not work correctly.`:null}async function B(n=!1){if(!n){let g=await Z();if(g)return g}let[e,t,r]=await Promise.all([G("claude"),G("gemini"),oe()]),o={installed:r.installed},a={claude:e,gemini:t,codex:o};return await ee(a).catch(()=>{}),a}async function Se(n){if(n&&w[n])return w[n];let e=await B(),t=[e.claude.installed?"claude":null,e.gemini.installed?"gemini":null,e.codex.installed?"codex":null].filter(Boolean);return t.length===1?w[t[0]]:e.claude.installed?C:e.gemini.installed?H:e.codex.installed?_:C}function ke(n){return{commitFooter:"Generated with [p/](https://www.prjct.app/)",signature:{claude:"\u26A1 prjct + Claude",gemini:"\u26A1 prjct + Gemini",cursor:"\u26A1 prjct + Cursor",antigravity:"\u26A1 prjct + Antigravity",codex:"\u26A1 prjct + Codex"}[n]||"\u26A1 prjct"}}async function Me(){let n=ne.configDir;if(!n)return{installed:!1,skillInstalled:!1};let e=E.join(n,"skills","prjct","SKILL.md"),[t,r]=await Promise.all([l(n),l(e)]);return{installed:t,skillInstalled:r,configPath:t?n:void 0}}async function oe(){let n=_.configDir;if(!n)return{installed:!1,skillInstalled:!1};let e=await $("codex"),t=E.join(n,"skills","prjct","SKILL.md"),r=await l(t),o=!!e||await l(E.join(n,"auth.json"));return{installed:o,skillInstalled:r,configPath:o?n:void 0}}async function Ie(){let n=m(".kimi-code"),e=m(".kimi"),[t,r,o]=await Promise.all([$("kimi"),l(n),l(e)]),a=!!t||r||o;return{installed:a,configPath:a?r||!o?n:e:void 0}}async function Fe(){let n=await B();return{provider:n.claude.installed?"claude":n.gemini.installed?"gemini":n.codex.installed?"codex":"claude",detection:n}}var C,H,ne,re,_,w,k=P(()=>{Pe();fe();he();b();te();ye();W();C={name:"claude",displayName:"Claude Code",cliCommand:"claude",get configDir(){return m(".claude")},contextFile:"CLAUDE.md",get skillsDir(){return m(".claude","skills")},commandsDir:".claude/commands",commandFormat:"md",settingsFile:"settings.json",projectSettingsFile:"settings.local.json",ignoreFile:".claudeignore",websiteUrl:"https://www.anthropic.com/claude",docsUrl:"https://docs.anthropic.com/claude-code",get defaultModel(){return D(this.name)},get supportedModels(){return y(this.name)},minCliVersion:"1.0.0"},H={name:"gemini",displayName:"Gemini CLI",cliCommand:"gemini",get configDir(){return m(".gemini")},contextFile:"GEMINI.md",get skillsDir(){return m(".gemini","skills")},commandsDir:".gemini/commands",commandFormat:"toml",settingsFile:"settings.json",projectSettingsFile:"settings.json",ignoreFile:".geminiignore",websiteUrl:"https://geminicli.com",docsUrl:"https://geminicli.com/docs",get defaultModel(){return D(this.name)},get supportedModels(){return y(this.name)},minCliVersion:"1.0.0"},ne={name:"antigravity",displayName:"Google Antigravity",cliCommand:null,get configDir(){return m(".gemini","antigravity")},contextFile:"ANTIGRAVITY.md",get skillsDir(){return m(".gemini","antigravity","global_skills")},commandsDir:".agent/skills",commandFormat:"md",settingsFile:"mcp_config.json",projectSettingsFile:null,ignoreFile:".agentignore",websiteUrl:"https://gemini.google.com/app/antigravity",docsUrl:"https://gemini.google.com/app/antigravity",get defaultModel(){return D(this.name)},get supportedModels(){return y(this.name)},minCliVersion:null},re={name:"cursor",displayName:"Cursor IDE",cliCommand:null,configDir:null,contextFile:"prjct.mdc",skillsDir:null,commandsDir:".cursor/commands",rulesDir:".cursor/rules",commandFormat:"md",settingsFile:null,projectSettingsFile:null,ignoreFile:".cursorignore",isProjectLevel:!0,websiteUrl:"https://cursor.com",docsUrl:"https://cursor.com/docs",get defaultModel(){return D(this.name)},get supportedModels(){return y(this.name)},minCliVersion:null},_={name:"codex",displayName:"OpenAI Codex",cliCommand:"codex",get configDir(){return m(".codex")},contextFile:"AGENTS.md",get skillsDir(){return m(".codex","skills")},commandsDir:".agents/skills",commandFormat:"md",settingsFile:null,projectSettingsFile:null,ignoreFile:".codexignore",websiteUrl:"https://openai.com/codex",docsUrl:"https://github.com/openai/codex",get defaultModel(){return D(this.name)},get supportedModels(){return y(this.name)},minCliVersion:null},w={claude:C,gemini:H,cursor:re,antigravity:ne,codex:_};i($,"whichCommand");i(Ce,"getCliVersion");i(G,"detectProvider");i(ie,"validateCliVersion");i(B,"detectAllProviders");i(Se,"getActiveProvider");i(ke,"getProviderBranding");i(Me,"detectAntigravity");i(oe,"detectCodex");i(Ie,"detectKimi");i(Fe,"selectProvider")});import Ae from"node:crypto";import M from"node:fs/promises";import s from"node:path";var O,Ne,se,ae=P(()=>{q();b();pe();X();W();O=class{static{i(this,"PathManager")}globalBaseDir;globalConfigDir;constructor(){this.globalBaseDir=L(),this.globalConfigDir=s.join(this.globalBaseDir,"config")}get globalProjectsDir(){let e=process.env.PRJCT_PROJECTS_DIR;return e?s.resolve(e):s.join(this.globalBaseDir,"projects")}setGlobalBaseDir(e){this.globalBaseDir=s.resolve(e),this.globalConfigDir=s.join(this.globalBaseDir,"config")}generateProjectId(e){return Ae.randomUUID()}getGlobalBasePath(){return this.globalBaseDir}getGlobalProjectPath(e){return s.join(this.globalProjectsDir,e)}getLocalConfigPath(e){return s.join(e,".prjct","prjct.config.json")}getGlobalProjectConfigPath(e){return s.join(this.getGlobalProjectPath(e),"project.json")}getLegacyPrjctPath(e){return s.join(e,".prjct")}async hasLegacyStructure(e){return await F(this.getLegacyPrjctPath(e))}async hasConfig(e){return await l(this.getLocalConfigPath(e))}async ensureGlobalStructure(){await h(this.globalBaseDir),await h(this.globalProjectsDir),await h(this.globalConfigDir)}async ensureProjectStructure(e){await this.ensureGlobalStructure();let t=this.getGlobalProjectPath(e),r=["analysis","memory"];for(let o of r)await h(s.join(t,o));return await h(s.join(t,"sessions")),t}getSessionPath(e,t=new Date){let{year:r,month:o,day:a}=Y(t);return s.join(this.getGlobalProjectPath(e),"sessions",r,o,a)}getCurrentSessionPath(e){return this.getSessionPath(e,new Date)}async ensureSessionPath(e,t=new Date){let r=this.getSessionPath(e,t);return await h(r),r}async listSessions(e,t=null,r=null){let o=s.join(this.getGlobalProjectPath(e),"sessions"),a=[];try{let g=await M.readdir(o,{withFileTypes:!0});for(let c of g){if(!c.isDirectory()||t&&c.name!==t.toString())continue;let d=s.join(o,c.name),p=await M.readdir(d,{withFileTypes:!0});for(let f of p){if(!f.isDirectory()||r&&f.name!==r.toString().padStart(2,"0"))continue;let j=s.join(d,f.name),me=await M.readdir(j,{withFileTypes:!0});for(let x of me)x.isDirectory()&&a.push({year:c.name,month:f.name,day:x.name,path:s.join(j,x.name),date:new Date(`${c.name}-${f.name}-${x.name}`)})}}return a.sort((c,d)=>d.date.getTime()-c.date.getTime()),a}catch{return[]}}async getSessionsInRange(e,t,r=new Date){return(await this.listSessions(e)).filter(a=>a.date>=t&&a.date<=r)}getFilePath(e,t,r){return s.join(this.getGlobalProjectPath(e),t,r)}async listProjects(){try{return await this.ensureGlobalStructure(),(await M.readdir(this.globalProjectsDir,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name)}catch{return[]}}async projectExists(e){return await F(this.getGlobalProjectPath(e))}getDisplayPath(e){let t=J();return e.startsWith(t)?e.replace(t,"~"):e}getAuthConfigPath(){return s.join(this.globalConfigDir,"auth.json")}getSyncPendingPath(e){return s.join(this.getGlobalProjectPath(e),"sync","pending.json")}getLastSyncPath(e){return s.join(this.getGlobalProjectPath(e),"sync","last-sync.json")}getRunningStatusPath(){return s.join(this.globalBaseDir,".running")}getCachePath(){return s.join(this.globalBaseDir,"cache")}getStatePath(){return s.join(this.globalBaseDir,"state")}getStatusLinePath(){return s.join(this.globalBaseDir,"statusline")}async getAgentDir(){return(await(k(),I(S)).getActiveProvider()).configDir}async getAgentSettingsPath(){let e=await(k(),I(S)).getActiveProvider();return(k(),I(S)).getGlobalSettingsPath(e.name)}getClaudeDir(){return m(".claude")}getClaudeSettingsPath(){return s.join(this.getClaudeDir(),"settings.json")}getStoragePath(e,t){return s.join(this.getGlobalProjectPath(e),"storage",t)}getContextPath(e){return s.join(this.getGlobalProjectPath(e),"context")}async detectMonorepo(e){return N(e)}async discoverMonorepoPackages(e,t){return R(e,t)}async findContainingPackage(e,t){return Q(e,t)}async findMonorepoRoot(e){return T(e)}},Ne=new O,se=Ne});function le(n,e){let t=typeof n=="string"?new Date(n).getTime():n;return Date.now()-t>e}var ce,ue=P(()=>{"use strict";i(le,"isExpired");ce=class{static{i(this,"TTLCache")}cache=new Map;ttl;maxSize;constructor(e={}){this.ttl=e.ttl??5e3,this.maxSize=e.maxSize??50}isValid(e){let t=this.cache.get(e);return t?Date.now()-t.timestamp<this.ttl:!1}get(e){let t=this.cache.get(e);return t?this.isValid(e)?t.data:(this.cache.delete(e),null):null}set(e,t){this.cache.set(e,{data:t,timestamp:Date.now()}),this.evictOldEntries()}delete(e){this.cache.delete(e)}clear(){this.cache.clear()}has(e){return this.cache.has(e)}get size(){return this.cache.size}evictOldEntries(){if(this.cache.size<=this.maxSize)return;let t=Array.from(this.cache.entries()).sort((r,o)=>r[1].timestamp-o[1].timestamp).slice(0,this.cache.size-this.maxSize);for(let[r]of t)this.cache.delete(r)}stats(){return{size:this.cache.size,maxSize:this.maxSize,ttl:this.ttl}}prune(){let e=[...this.cache.keys()].filter(t=>!this.isValid(t));for(let t of e)this.cache.delete(t);return e.length}}});import ge from"node:fs/promises";import Re from"node:path";async function Z(){try{let n=await ge.readFile(U(),"utf-8"),e=JSON.parse(n);return!e.timestamp||!e.detection||!e.detection.claude||!e.detection.gemini||!e.detection.codex||le(e.timestamp,Te)?null:e.detection}catch{return null}}async function ee(n){let e={timestamp:new Date().toISOString(),detection:n};await K(U(),e)}async function Dt(){try{await ge.unlink(U())}catch{}}var U,Te,te=P(()=>{ae();ue();b();U=i(()=>Re.join(se.getCachePath(),"providers.json"),"cacheFile"),Te=600*1e3;i(Z,"readProviderCache");i(ee,"writeProviderCache");i(Dt,"invalidateProviderCache")});export{le as a,ce as b,ue as c,Ee as d,Ge as e,De as f,He as g,_e as h,$e as i,Be as j,Ue as k,q as l,Z as m,ee as n,Dt as o,te as p,C as q,H as r,re as s,w as t,G as u,ie as v,B as w,Se as x,ke as y,Me as z,oe as A,Ie as B,Fe as C,S as D,k as E,se as F,ae as G};
@@ -0,0 +1,8 @@
1
+ import { createRequire as __createRequire } from 'module';
2
+ import { fileURLToPath as __fileURLToPath } from 'url';
3
+ import { dirname as __pathDirname } from 'path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __pathDirname(__filename);
7
+ import{a as c,b as y,c as x,d as h,g as j}from"./chunk-225DWS4D.mjs";import{a as i,c as d}from"./chunk-3TRXQAU4.mjs";var v,R,_,F=d(()=>{"use strict";v=new Set(["node_modules",".git","dist","build","out",".next",".nuxt","coverage",".cache",".turbo",".vercel",".parcel-cache","__pycache__",".pytest_cache","target","vendor",".venv","venv","eggs","*.egg-info",".prjct",".worktrees"]),R=["",".ts",".tsx",".js",".jsx","/index.ts","/index.js"],_=/(?:import|from)\s+['"]([^'"]+)['"]/g});import S from"node:fs/promises";async function b(t,r){let e=await S.readFile(t,"utf-8").catch(a=>{if(c(a))return null;throw a});if(e===null)return null;let n=(()=>{try{return JSON.parse(e)}catch{return null}})();if(n===null)return await k(t,e),E(t,"Malformed JSON"),null;let o=r.safeParse(n);return o.success?n:(await k(t,e),E(t,O(o.error)),null)}async function k(t,r){let e=`${t}.backup`;try{await S.writeFile(e,r,{encoding:"utf-8",flag:"wx"})}catch{}}function E(t,r){console.error(`[prjct] Warning: Corrupted storage file: ${t}`),console.error(`[prjct] Reason: ${r}`),console.error("[prjct] A .backup file has been created. Returning defaults.")}function O(t){return t.issues.slice(0,3).map(r=>`${r.path.join(".")}: ${r.message}`).join("; ")}var T=d(()=>{"use strict";j();i(b,"safeRead");i(k,"createBackup");i(E,"logCorruption");i(O,"formatZodError")});import s from"node:fs/promises";import u from"node:path";async function g(t,r,e){try{return await e()}catch(n){throw x(n)||y(n)?new Error(h(n,t,r)):n}}async function M(t,r={}){let e=[],n=r.maxFiles??1/0,o=r.dotfileAllowlist?new Set(r.dotfileAllowlist):null;async function a(l){if(e.length>=n)return;let f=await s.readdir(l,{withFileTypes:!0}).catch(()=>[]);for(let p of f){if(e.length>=n)break;let m=String(p.name);if(v.has(m)||r.skipDotfiles&&m.startsWith(".")&&(!o||!o.has(m)))continue;let w=u.join(l,m);p.isDirectory()?await a(w):p.isFile()&&e.push(u.relative(t,w))}}return i(a,"walk"),await a(t),e}async function Z(t,r,e){let n=[],o=Array.from({length:Math.ceil(t.length/r)},(a,l)=>l*r);for(let a of o){let l=await Promise.all(t.slice(a,a+r).map(e));for(let f of l)f!==null&&n.push(f)}return n}async function G(t,r=null,e){if(e)return await b(t,e)??r;try{let n=await s.readFile(t,"utf-8");return JSON.parse(n)}catch(n){if(c(n))return r;throw n}}async function K(t,r,e=2){await g(t,"config",async()=>{let n=u.dirname(t);await s.mkdir(n,{recursive:!0});let o=`${JSON.stringify(r,null,e)}
8
+ `;await s.writeFile(t,o,"utf-8")})}async function X(t,r=""){try{return await s.readFile(t,"utf-8")}catch(e){if(c(e))return r;throw e}}async function q(t){return s.readFile(t,"utf-8").then(r=>({content:r,exists:!0})).catch(r=>{if(c(r))return{content:"",exists:!1};throw r})}async function B(t,r){await g(t,"file",async()=>{let e=u.dirname(t);await s.mkdir(e,{recursive:!0}),await s.writeFile(t,r,"utf-8")})}async function H(t,r){await g(t,"file",async()=>{let e=u.dirname(t);await s.mkdir(e,{recursive:!0});let n=`${t}.tmp`;await s.writeFile(n,r,"utf-8"),await s.rename(n,t)})}async function Q(t){try{return await s.access(t),!0}catch(r){if(c(r))return!1;throw r}}async function U(t){try{return(await s.stat(t)).isDirectory()}catch(r){if(c(r))return!1;throw r}}async function Y(t){await s.mkdir(t,{recursive:!0})}async function z(t,r={}){try{return(await s.readdir(t,{withFileTypes:!0})).filter(o=>!r.filesOnly||o.isFile()).filter(o=>!r.dirsOnly||o.isDirectory()).filter(o=>!r.extension||o.name.endsWith(r.extension)).map(o=>o.name)}catch(e){if(c(e))return[];throw e}}var P=d(()=>{F();T();j();i(g,"withWriteErrorContext");i(M,"walkDir");i(Z,"batchProcess");i(G,"readJson");i(K,"writeJson");i(X,"readFile");i(q,"readExistingFileOrEmpty");i(B,"writeFile");i(H,"writeFileAtomic");i(Q,"fileExists");i(U,"dirExists");i(Y,"ensureDir");i(z,"listFiles")});export{R as a,_ as b,F as c,M as d,Z as e,G as f,K as g,X as h,q as i,B as j,H as k,Q as l,U as m,Y as n,z as o,P as p};
@@ -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{a as k,b as g,c as S,e as h,f as j,g as v}from"./chunk-4T7NGLNQ.mjs";import{a as m,b as E}from"./chunk-RP7F67ZT.mjs";import{a as d,c as F}from"./chunk-FATYLG3L.mjs";import{d as c,e as R}from"./chunk-623SNKDH.mjs";import{a as n,c as D,d as I}from"./chunk-3TRXQAU4.mjs";var O={};I(O,{SKILL_DEFINITIONS:()=>u,SkillGenerator:()=>f,skillBodyHasProjectStamp:()=>y,skillGenerator:()=>K});import s from"node:fs/promises";import P from"node:os";import i from"node:path";function _(t){let o=t.userInvocable!==!1;return`---
8
+ description: "${t.description}"
9
+ allowed-tools: [${t.allowedTools.map(a=>`"${a}"`).join(", ")}]
10
+ user-invocable: ${o}
11
+ ---`}function T(t){return`${_(t)}
12
+
13
+ ${t.body()}`}function w(){return process.env.HOME||P.homedir()}function C(){return i.join(w(),".claude","skills")}function $(){let t=w();return[i.join(t,".codex","skills"),i.join(t,".gemini","skills"),i.join(t,".gemini","antigravity","global_skills"),i.join(t,".agents","skills")]}function y(t){return!!(/^# [^\n]+\n[^\n]*\|\s*\d+\s+files\s*\|/m.test(t)||/## Recent Deliveries/m.test(t)||/## Velocity/m.test(t)&&/pts\/sprint/m.test(t))}var u,f,K,N=D(()=>{R();E();F();v();u=[{name:"prjct",description:k,allowedTools:[...g],body:n(()=>h(),"body"),reference:n(()=>j(),"reference"),referenceFile:S}];n(_,"buildFrontmatter");n(T,"buildSkillContent");n(w,"homeDir");n(C,"claudeSkillsRoot");n($,"compactSkillRoots");n(y,"skillBodyHasProjectStamp");f=class{static{n(this,"SkillGenerator")}async generateAndInstall(){let o={generated:[],skipped:[]},a=C();for(let e of u)try{let r=T(e);if(y(r))throw new Error("refusing to install project-stamped skill body (isolation guard)");let l=i.join(a,e.name),p=i.join(l,"SKILL.md");await s.mkdir(l,{recursive:!0}),await s.writeFile(p,r,"utf-8"),e.reference&&e.referenceFile&&await s.writeFile(i.join(l,e.referenceFile),e.reference(),"utf-8"),o.generated.push({name:e.name,path:p})}catch(r){m.debug(`Failed to generate skill ${e.name}`,{error:c(r)}),o.skipped.push({name:e.name,reason:c(r)})}let b=d();for(let e of $())try{let r=i.join(e,"prjct"),l=i.join(r,"SKILL.md");await s.mkdir(r,{recursive:!0}),await s.writeFile(l,b,"utf-8"),o.generated.push({name:"prjct-compact",path:l})}catch(r){m.debug("Compact skill install skipped",{root:e,error:c(r)})}let L=new Set(u.map(e=>e.name));try{let e=await s.readdir(a,{withFileTypes:!0}).catch(()=>[]);for(let r of e)r.isDirectory()&&r.name.startsWith("prjct-")&&!L.has(r.name)&&await s.rm(i.join(a,r.name),{recursive:!0,force:!0}).catch(()=>{})}catch{}return o.generated.length>0&&m.info("Generated portable multi-host skills",{count:o.generated.length,skills:o.generated.map(e=>e.name)}),o}getDefinitions(){return u}},K=new f});export{u as a,y as b,f as c,K as d,O as e,N as f};