prjct-cli 3.92.0 → 3.94.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 (256) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin/hook-chunks/{agent-switch-XMFUTNNV.mjs → agent-switch-2U2LOBGR.mjs} +1 -1
  3. package/dist/bin/hook-chunks/analysis-N4NYGIG3.mjs +42 -0
  4. package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-SP4PBALR.mjs} +1 -1
  5. package/dist/bin/hook-chunks/auto-flush-BN6L6QHO.mjs +8 -0
  6. package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
  7. package/dist/bin/hook-chunks/capture-gate-FRF2G3IG.mjs +8 -0
  8. package/dist/bin/hook-chunks/{chunk-DGBDMUBL.mjs → chunk-27XFSCOE.mjs} +4 -4
  9. package/dist/bin/hook-chunks/chunk-2HB2JHQE.mjs +69 -0
  10. package/dist/bin/hook-chunks/{chunk-MAHTF6JG.mjs → chunk-3VWBNLBC.mjs} +1 -1
  11. package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
  12. package/dist/bin/hook-chunks/{chunk-2HTDCLZD.mjs → chunk-4O4D6DV7.mjs} +2 -2
  13. package/dist/bin/hook-chunks/chunk-4SKJWNKE.mjs +11 -0
  14. package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-5EQLQ7GF.mjs} +1 -1
  15. package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-66GE3IHX.mjs} +1 -1
  16. package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-6RLCUGGG.mjs} +1 -1
  17. package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-6UH244CC.mjs} +1 -1
  18. package/dist/bin/hook-chunks/chunk-7GNWHWOO.mjs +26 -0
  19. package/dist/bin/hook-chunks/chunk-7JEKBJAP.mjs +9 -0
  20. package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-7O6OMD4X.mjs} +2 -2
  21. package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
  22. package/dist/bin/hook-chunks/{chunk-XHDNPEAN.mjs → chunk-AVRNHROK.mjs} +1 -1
  23. package/dist/bin/hook-chunks/chunk-AZHE4VOM.mjs +8 -0
  24. package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-AZYQFRPJ.mjs} +1 -1
  25. package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
  26. package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-C3W2HLJT.mjs} +1 -1
  27. package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-D6IONKRA.mjs} +1 -1
  28. package/dist/bin/hook-chunks/chunk-DRGI5UHQ.mjs +10 -0
  29. package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-EHEQOF6Z.mjs} +1 -1
  30. package/dist/bin/hook-chunks/{chunk-ZX6BC2EB.mjs → chunk-EMTCZG5I.mjs} +1 -1
  31. package/dist/bin/hook-chunks/{chunk-ZNQXFWSI.mjs → chunk-EQ5KNMLG.mjs} +1 -1
  32. package/dist/bin/hook-chunks/{chunk-S4TB2OFJ.mjs → chunk-F4T7IAA7.mjs} +1 -1
  33. package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
  34. package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-FX6VHIKB.mjs} +1 -1
  35. package/dist/bin/hook-chunks/{chunk-2WPR5GFT.mjs → chunk-GFY4GY3Z.mjs} +1 -1
  36. package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
  37. package/dist/bin/hook-chunks/chunk-HHIGNKDO.mjs +8 -0
  38. package/dist/bin/hook-chunks/chunk-HNEKXKOI.mjs +16 -0
  39. package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-HRWXMF7P.mjs} +1 -1
  40. package/dist/bin/hook-chunks/{chunk-AWD2AQVJ.mjs → chunk-IHECXD2M.mjs} +1 -1
  41. package/dist/bin/hook-chunks/chunk-IKIB42F7.mjs +31 -0
  42. package/dist/bin/hook-chunks/chunk-INXNK57E.mjs +8 -0
  43. package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-J6TAD3OZ.mjs} +1 -1
  44. package/dist/bin/hook-chunks/chunk-JAMSIKDE.mjs +9 -0
  45. package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-JCYXFHQZ.mjs} +1 -1
  46. package/dist/bin/hook-chunks/chunk-JMCMTX6U.mjs +8 -0
  47. package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-JPSJWCFD.mjs} +1 -1
  48. package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
  49. package/dist/bin/hook-chunks/chunk-JUZ5LNDI.mjs +14 -0
  50. package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-KG7Z6OMK.mjs} +1 -1
  51. package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-KOCROTRM.mjs} +1 -1
  52. package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
  53. package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
  54. package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
  55. package/dist/bin/hook-chunks/{chunk-BZ5UR7G3.mjs → chunk-MHQTGU45.mjs} +1 -1
  56. package/dist/bin/hook-chunks/{chunk-OL6ITIAZ.mjs → chunk-MI3JEFON.mjs} +2 -2
  57. package/dist/bin/hook-chunks/chunk-NBKEOLDH.mjs +18 -0
  58. package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-NCOOKPXX.mjs} +1 -1
  59. package/dist/bin/hook-chunks/chunk-NHIWYDQD.mjs +8 -0
  60. package/dist/bin/hook-chunks/chunk-NUJASVHN.mjs +18 -0
  61. package/dist/bin/hook-chunks/chunk-NWIQNII6.mjs +11 -0
  62. package/dist/bin/hook-chunks/{chunk-OP467HW6.mjs → chunk-NWZEBCTC.mjs} +2 -2
  63. package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-OENWCYLF.mjs} +1 -1
  64. package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OIU4Y5WL.mjs} +1 -1
  65. package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
  66. package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
  67. package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-OZJ6UKKP.mjs} +1 -1
  68. package/dist/bin/hook-chunks/chunk-PUHX3ECX.mjs +11 -0
  69. package/dist/bin/hook-chunks/chunk-Q3EYM4GJ.mjs +19 -0
  70. package/dist/bin/hook-chunks/{chunk-I5BDN25C.mjs → chunk-Q3Z53QTH.mjs} +3 -3
  71. package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-QPRNRLG6.mjs} +1 -1
  72. package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
  73. package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-QYEASMFV.mjs} +1 -1
  74. package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
  75. package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-S7HQQILD.mjs} +1 -1
  76. package/dist/bin/hook-chunks/chunk-SDUS2AT7.mjs +8 -0
  77. package/dist/bin/hook-chunks/chunk-T2FCU3ZS.mjs +12 -0
  78. package/dist/bin/hook-chunks/{chunk-A5RNWWTH.mjs → chunk-TFCLMTJ5.mjs} +1 -1
  79. package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-TG5CQJD5.mjs} +1 -1
  80. package/dist/bin/hook-chunks/{chunk-CQUG6SO2.mjs → chunk-TKWAFYF7.mjs} +1 -1
  81. package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-TYEAIX3X.mjs} +1 -1
  82. package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-UA4Z5TGG.mjs} +1 -1
  83. package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
  84. package/dist/bin/hook-chunks/chunk-V2BSS7HW.mjs +36 -0
  85. package/dist/bin/hook-chunks/{chunk-MQVVNX63.mjs → chunk-VWOIUTAX.mjs} +1 -1
  86. package/dist/bin/hook-chunks/{chunk-NLDL3N6R.mjs → chunk-X2AGNDGD.mjs} +1 -1
  87. package/dist/bin/hook-chunks/{chunk-5PEHJEFE.mjs → chunk-XE4MJNBQ.mjs} +1 -1
  88. package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
  89. package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
  90. package/dist/bin/hook-chunks/chunk-Y3J7UUMR.mjs +47 -0
  91. package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-Y4DUB7UN.mjs} +2 -2
  92. package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
  93. package/dist/bin/hook-chunks/{chunk-DVBBB5BS.mjs → chunk-YUKGWWL7.mjs} +1 -1
  94. package/dist/bin/hook-chunks/chunk-ZJXH76Q5.mjs +11 -0
  95. package/dist/bin/hook-chunks/{chunk-TBM7736J.mjs → chunk-ZMKTR2IO.mjs} +1 -1
  96. package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
  97. package/dist/bin/hook-chunks/client-ERZ5CM3D.mjs +10 -0
  98. package/dist/bin/hook-chunks/code-graph-cloud-4GRWQSUK.mjs +8 -0
  99. package/dist/bin/hook-chunks/{codex-skill-2N6656SR.mjs → codex-skill-6DYQMPDJ.mjs} +1 -1
  100. package/dist/bin/hook-chunks/{command-installer-XSKQS3IS.mjs → command-installer-MF4KUM3X.mjs} +1 -1
  101. package/dist/bin/hook-chunks/{config-manager-YZANYLPV.mjs → config-manager-2VZPHUDG.mjs} +1 -1
  102. package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
  103. package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-V7CIDF3Q.mjs} +1 -1
  104. package/dist/bin/hook-chunks/custom-workflow-storage-UOBQXY42.mjs +8 -0
  105. package/dist/bin/hook-chunks/cwd-changed-J6O46KS7.mjs +8 -0
  106. package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-XYKQF3KR.mjs} +1 -1
  107. package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
  108. package/dist/bin/hook-chunks/detect-changes-DFRJOOB3.mjs +19 -0
  109. package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
  110. package/dist/bin/hook-chunks/developer-evolution-SLC34HUU.mjs +12 -0
  111. package/dist/bin/hook-chunks/distill-U2LJGUG3.mjs +8 -0
  112. package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-6XFYIOE6.mjs} +1 -1
  113. package/dist/bin/hook-chunks/enriched-recall-X6RDNNIE.mjs +8 -0
  114. package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
  115. package/dist/bin/hook-chunks/format-ALUX4QSI.mjs +8 -0
  116. package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
  117. package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-SCGU3URM.mjs} +1 -1
  118. package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-BYPG65RS.mjs} +1 -1
  119. package/dist/bin/hook-chunks/judgment-receipt-GWSSCLAB.mjs +8 -0
  120. package/dist/bin/hook-chunks/land-cue-MMISX2BI.mjs +9 -0
  121. package/dist/bin/hook-chunks/land-synthesis-WG5JAS7B.mjs +8 -0
  122. package/dist/bin/hook-chunks/legacy-crew-sweep-2WSO5KEB.mjs +24 -0
  123. package/dist/bin/hook-chunks/memory-index-QK5QJOFJ.mjs +8 -0
  124. package/dist/bin/hook-chunks/notification-MPVWVV52.mjs +8 -0
  125. package/dist/bin/hook-chunks/{pack-integrity-BKLDNYE5.mjs → pack-integrity-XRYOROK5.mjs} +1 -1
  126. package/dist/bin/hook-chunks/{pack-manager-ASWLKYGP.mjs → pack-manager-WWGQNJDQ.mjs} +1 -1
  127. package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
  128. package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-ZR5RAKTK.mjs} +1 -1
  129. package/dist/bin/hook-chunks/{planning-QBSY272P.mjs → planning-S55KBPN2.mjs} +2 -2
  130. package/dist/bin/hook-chunks/post-edit-QMHSZHDN.mjs +8 -0
  131. package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
  132. package/dist/bin/hook-chunks/pre-bash-RAM6L3G4.mjs +11 -0
  133. package/dist/bin/hook-chunks/pre-commit-736ZLMDL.mjs +8 -0
  134. package/dist/bin/hook-chunks/pre-edit-GZ4QJ2MU.mjs +11 -0
  135. package/dist/bin/hook-chunks/pre-package-LCIAWWGK.mjs +8 -0
  136. package/dist/bin/hook-chunks/pre-search-J5EOFMYN.mjs +9 -0
  137. package/dist/bin/hook-chunks/pre-secrets-TSUMTXHH.mjs +8 -0
  138. package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
  139. package/dist/bin/hook-chunks/{prjct-md-WE6WFVL3.mjs → prjct-md-T2DG236Y.mjs} +1 -1
  140. package/dist/bin/hook-chunks/{project-agent-surfaces-A6HGZPAL.mjs → project-agent-surfaces-VRY22I66.mjs} +1 -1
  141. package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-5DEN5VLF.mjs} +1 -1
  142. package/dist/bin/hook-chunks/project-memory-KKEMTEMP.mjs +8 -0
  143. package/dist/bin/hook-chunks/project-style-evolution-7MAUSED2.mjs +8 -0
  144. package/dist/bin/hook-chunks/{prompt-JIOMJCGV.mjs → prompt-DVF6V2X2.mjs} +7 -7
  145. package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-G54XQV5K.mjs} +1 -1
  146. package/dist/bin/hook-chunks/purge-MC5LFSAO.mjs +8 -0
  147. package/dist/bin/hook-chunks/retention-LWETHQX3.mjs +8 -0
  148. package/dist/bin/hook-chunks/sdd-5UCVX43H.mjs +10 -0
  149. package/dist/bin/hook-chunks/session-continuity-RKNAJJHR.mjs +11 -0
  150. package/dist/bin/hook-chunks/session-start-MFMFKUPK.mjs +8 -0
  151. package/dist/bin/hook-chunks/setup-WQRJ6TQL.mjs +141 -0
  152. package/dist/bin/hook-chunks/{shipping-LVTFVSWJ.mjs → shipping-5D5LTJ3P.mjs} +5 -5
  153. package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-RAVJMC4P.mjs} +1 -1
  154. package/dist/bin/hook-chunks/{spec-context-inference-U6BGGB2Q.mjs → spec-context-inference-7DDSTRTV.mjs} +1 -1
  155. package/dist/bin/hook-chunks/{spec-service-2DVDFOR7.mjs → spec-service-LAO5Z2M5.mjs} +2 -2
  156. package/dist/bin/hook-chunks/spec-task-breakdown-K3GMQKGH.mjs +8 -0
  157. package/dist/bin/hook-chunks/state-storage-EIFGUO7X.mjs +8 -0
  158. package/dist/bin/hook-chunks/stop-RYLI4FGF.mjs +16 -0
  159. package/dist/bin/hook-chunks/subagent-start-CCUPSANT.mjs +8 -0
  160. package/dist/bin/hook-chunks/subagent-stop-RBD2OILE.mjs +8 -0
  161. package/dist/bin/hook-chunks/{surface-attribution-BDKFYUOJ.mjs → surface-attribution-K37N2NK7.mjs} +1 -1
  162. package/dist/bin/hook-chunks/symbol-graph-BKQIMFRG.mjs +8 -0
  163. package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
  164. package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-EGBMWF3J.mjs} +1 -1
  165. package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-E3LMZISA.mjs} +1 -1
  166. package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-2ZYE5M6J.mjs} +1 -1
  167. package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-ITY5OSHX.mjs} +1 -1
  168. package/dist/bin/hook-chunks/task-service-XREJLWEF.mjs +8 -0
  169. package/dist/bin/hook-chunks/tdd-7S55S5C3.mjs +10 -0
  170. package/dist/bin/hook-chunks/{template-loader-BFTLPG2W.mjs → template-loader-SCM4C2A3.mjs} +1 -1
  171. package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
  172. package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SCH5ARGV.mjs} +1 -1
  173. package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HT756AND.mjs} +1 -1
  174. package/dist/bin/hook-chunks/velocity-storage-47CF3XWZ.mjs +8 -0
  175. package/dist/bin/hook-chunks/weak-model-mode-FLCEQ2BV.mjs +8 -0
  176. package/dist/bin/hook-chunks/work-graph-JQHVVXIZ.mjs +49 -0
  177. package/dist/bin/hook-chunks/work-scope-CDLSZ4U5.mjs +8 -0
  178. package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-UUW4UGGB.mjs} +1 -1
  179. package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
  180. package/dist/bin/prjct-core.mjs +736 -746
  181. package/dist/bin/prjct-hooks.mjs +2 -2
  182. package/dist/daemon/entry.mjs +625 -632
  183. package/dist/mcp/server.mjs +323 -323
  184. package/package.json +1 -1
  185. package/dist/bin/hook-chunks/analysis-PFGKPYWQ.mjs +0 -42
  186. package/dist/bin/hook-chunks/auto-flush-QZ3YIQP6.mjs +0 -8
  187. package/dist/bin/hook-chunks/capture-gate-2FXYVHNF.mjs +0 -8
  188. package/dist/bin/hook-chunks/chunk-3X7TBM4A.mjs +0 -19
  189. package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
  190. package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
  191. package/dist/bin/hook-chunks/chunk-7JE6VTLN.mjs +0 -71
  192. package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
  193. package/dist/bin/hook-chunks/chunk-CDCCAU22.mjs +0 -11
  194. package/dist/bin/hook-chunks/chunk-CPHUFXD2.mjs +0 -14
  195. package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
  196. package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
  197. package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
  198. package/dist/bin/hook-chunks/chunk-GELCZWKW.mjs +0 -11
  199. package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
  200. package/dist/bin/hook-chunks/chunk-HX42HFII.mjs +0 -18
  201. package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
  202. package/dist/bin/hook-chunks/chunk-KB3P6XTL.mjs +0 -38
  203. package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
  204. package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
  205. package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
  206. package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
  207. package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
  208. package/dist/bin/hook-chunks/chunk-OLKNK2HB.mjs +0 -8
  209. package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
  210. package/dist/bin/hook-chunks/chunk-SY2FRLJF.mjs +0 -31
  211. package/dist/bin/hook-chunks/chunk-WSFHSXBZ.mjs +0 -9
  212. package/dist/bin/hook-chunks/chunk-Y7CKMFNW.mjs +0 -16
  213. package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
  214. package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
  215. package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
  216. package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
  217. package/dist/bin/hook-chunks/cwd-changed-NJ6RYVOJ.mjs +0 -8
  218. package/dist/bin/hook-chunks/detect-changes-6N4DCWXQ.mjs +0 -17
  219. package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
  220. package/dist/bin/hook-chunks/distill-IABVRW2U.mjs +0 -8
  221. package/dist/bin/hook-chunks/enriched-recall-NDASPZXZ.mjs +0 -8
  222. package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
  223. package/dist/bin/hook-chunks/format-NIBVWBGR.mjs +0 -8
  224. package/dist/bin/hook-chunks/judgment-receipt-HTNEOJLT.mjs +0 -8
  225. package/dist/bin/hook-chunks/land-cue-FNLP4IAB.mjs +0 -9
  226. package/dist/bin/hook-chunks/land-synthesis-HBPIXP5S.mjs +0 -8
  227. package/dist/bin/hook-chunks/legacy-crew-sweep-2MLYPNQR.mjs +0 -24
  228. package/dist/bin/hook-chunks/memory-index-MQCHZFUE.mjs +0 -10
  229. package/dist/bin/hook-chunks/notification-VQM2AMNS.mjs +0 -8
  230. package/dist/bin/hook-chunks/post-edit-VTLDHWI3.mjs +0 -8
  231. package/dist/bin/hook-chunks/pre-bash-JR6257XO.mjs +0 -11
  232. package/dist/bin/hook-chunks/pre-commit-BYUFDN2N.mjs +0 -8
  233. package/dist/bin/hook-chunks/pre-edit-MHROFDS3.mjs +0 -11
  234. package/dist/bin/hook-chunks/pre-package-P7CLTJJV.mjs +0 -8
  235. package/dist/bin/hook-chunks/pre-search-BCQHPE46.mjs +0 -9
  236. package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
  237. package/dist/bin/hook-chunks/project-memory-ON54KZEM.mjs +0 -8
  238. package/dist/bin/hook-chunks/project-style-evolution-T27I5N65.mjs +0 -8
  239. package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
  240. package/dist/bin/hook-chunks/purge-QQ6XILZD.mjs +0 -8
  241. package/dist/bin/hook-chunks/retention-E7WGFL47.mjs +0 -8
  242. package/dist/bin/hook-chunks/sdd-PV6KWXE4.mjs +0 -10
  243. package/dist/bin/hook-chunks/session-continuity-5CLT5YBL.mjs +0 -11
  244. package/dist/bin/hook-chunks/session-start-ATYLOUKB.mjs +0 -8
  245. package/dist/bin/hook-chunks/setup-VL7YXVE5.mjs +0 -142
  246. package/dist/bin/hook-chunks/spec-task-breakdown-MPNRRTNZ.mjs +0 -8
  247. package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
  248. package/dist/bin/hook-chunks/stop-GBUGB5OE.mjs +0 -17
  249. package/dist/bin/hook-chunks/subagent-start-HURF2GI7.mjs +0 -8
  250. package/dist/bin/hook-chunks/subagent-stop-WJECHEXI.mjs +0 -8
  251. package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
  252. package/dist/bin/hook-chunks/task-service-BM2JQXMS.mjs +0 -8
  253. package/dist/bin/hook-chunks/tdd-UJDJUJ3E.mjs +0 -10
  254. package/dist/bin/hook-chunks/weak-model-mode-GLXXHG32.mjs +0 -8
  255. package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
  256. package/dist/bin/hook-chunks/work-scope-VTF6SKLY.mjs +0 -8
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as f}from"./chunk-Q5I2UPD6.mjs";import{c as $,d as E}from"./chunk-S4TB2OFJ.mjs";import{a as M}from"./chunk-PSSR7LSW.mjs";import{a as r}from"./chunk-2HTDCLZD.mjs";import{a as g}from"./chunk-MQVVNX63.mjs";import"./chunk-AWD2AQVJ.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-6EWGHM32.mjs";import{a as h,b as C,c as T,d as P,e as I}from"./chunk-2NMSEZTQ.mjs";import"./chunk-DVBBB5BS.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{a as W,b as A}from"./chunk-OLKNK2HB.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{d as S}from"./chunk-CDCCAU22.mjs";import{s as O,t as Y}from"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-ZNQXFWSI.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-ZX6BC2EB.mjs";import"./chunk-PKDYFXMI.mjs";import{e as z,f as G}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";Y();G();import*as n from"@clack/prompts";import p from"chalk";var y=class{static{o(this,"OnboardingWizard")}projectPath;aborted=!1;detectedType="unknown";confirmedType="unknown";selectedAgents=[];detectedStack={language:"Unknown",technologies:[]};confirmedStack={language:"Unknown",technologies:[]};preferences={verbosity:"normal",autoSync:!0,telemetry:!1};constructor(t=process.cwd()){this.projectPath=t}async run(){n.intro(p.cyan.bold("\u26A1 prjct-cli setup"));let t=[{id:"project-type",title:"Project Type",run:o(()=>this.stepProjectType(),"run")},{id:"ai-agents",title:"AI Agents",run:o(()=>this.stepAIAgents(),"run")},{id:"stack",title:"Stack Confirmation",run:o(()=>this.stepStack(),"run")},{id:"preferences",title:"Preferences",run:o(()=>this.stepPreferences(),"run")},{id:"summary",title:"Summary",run:o(()=>this.stepSummary(),"run")}];for(let e of t)if(!await e.run()||this.aborted)return this.buildResult(!0);return n.outro(p.green("Setup complete!")),this.buildResult(!1)}async runNonInteractive(){r.spin("Auto-detecting project configuration..."),this.detectedType=await T(this.projectPath),this.confirmedType=this.detectedType;let t=await P(this.projectPath);return this.selectedAgents=t,this.detectedStack=await I(this.projectPath),this.confirmedStack=this.detectedStack,r.done("Configuration detected"),this.buildResult(!1)}async stepProjectType(){this.detectedType=await T(this.projectPath);let t=h.findIndex(i=>i.value===this.detectedType),e=await n.select({message:this.detectedType!=="unknown"?`Detected: ${this.getProjectTypeLabel(this.detectedType)}. Is this correct?`:"What type of project is this?",options:h.map(i=>({label:i.title,hint:i.description,value:i.value})),initialValue:t>=0?h[t].value:void 0});return n.isCancel(e)?(this.handleCancel(),!1):(this.confirmedType=e||this.detectedType,!0)}async stepAIAgents(){let t=await P(this.projectPath),e=C.map(a=>({label:a.title,hint:a.description,value:a.value})),i=await n.multiselect({message:"Which AI agents do you use?",options:e,initialValues:t,required:!0});return n.isCancel(i)?(this.handleCancel(),!1):(this.selectedAgents=i,!0)}async stepStack(){this.detectedStack=await I(this.projectPath);let t=this.formatStackDisplay(this.detectedStack);n.note(t,"Detected stack");let e=await n.confirm({message:"Is this stack correct?",initialValue:!0});if(n.isCancel(e))return this.handleCancel(),!1;if(e)this.confirmedStack=this.detectedStack;else{let i=await n.group({language:o(()=>n.text({message:"Primary language:",defaultValue:this.detectedStack.language}),"language"),framework:o(()=>n.text({message:"Framework (optional):",defaultValue:this.detectedStack.framework||""}),"framework")},{onCancel:o(()=>this.handleCancel(),"onCancel")});if(this.aborted)return!1;this.confirmedStack={...this.detectedStack,language:i.language||this.detectedStack.language,framework:i.framework||void 0}}return!0}async stepPreferences(){let t=await n.group({verbosity:o(()=>n.select({message:"Output verbosity:",options:[{label:"Minimal",hint:"Essential output only",value:"minimal"},{label:"Normal (Recommended)",hint:"Balanced information",value:"normal"},{label:"Verbose",hint:"Detailed logging",value:"verbose"}],initialValue:"normal"}),"verbosity"),autoSync:o(()=>n.confirm({message:"Auto-sync context on file changes?",initialValue:!0}),"autoSync")},{onCancel:o(()=>this.handleCancel(),"onCancel")});return this.aborted?!1:(this.preferences={verbosity:t.verbosity||"normal",autoSync:t.autoSync??!0,telemetry:!1},!0)}async stepSummary(){let t=[`${p.cyan("Project Type:")} ${this.getProjectTypeLabel(this.confirmedType)}`,`${p.cyan("AI Agents:")} ${this.selectedAgents.map(i=>this.getAgentLabel(i)).join(", ")}`,`${p.cyan("Stack:")} ${this.formatStackDisplay(this.confirmedStack)}`,`${p.cyan("Verbosity:")} ${this.preferences.verbosity}`,`${p.cyan("Auto-sync:")} ${this.preferences.autoSync?"Yes":"No"}`].join(`
9
- `);n.note(t,"Configuration Summary");let e=await n.confirm({message:"Generate configuration with these settings?",initialValue:!0});return n.isCancel(e)||!e?(n.isCancel(e)&&this.handleCancel(),!1):!0}handleCancel(){this.aborted=!0,n.cancel("Setup cancelled. Run again anytime.")}getProjectTypeLabel(t){return h.find(e=>e.value===t)?.title||"Unknown"}getAgentLabel(t){return C.find(e=>e.value===t)?.title||t}formatStackDisplay(t){let e=[t.language];return t.framework&&e.push(t.framework),t.runtime&&t.runtime!=="Node.js"&&e.push(t.runtime),t.technologies.length>0&&e.push(`+ ${t.technologies.slice(0,3).join(", ")}`),e.join(" / ")}buildResult(t){return{projectType:this.confirmedType,agents:this.selectedAgents,stack:this.confirmedStack,preferences:this.preferences,skipped:t}}getSelectedAgents(){return this.selectedAgents}getConfirmedStack(){return this.confirmedStack}getPreferences(){return this.preferences}};var j={current:null};async function L(){if(!j.current){let{AnalysisCommands:k}=await import("./analysis-PFGKPYWQ.mjs");j.current=new k}return j.current}o(L,"getAnalysisCommands");var N=class extends E{static{o(this,"PlanningCommands")}async _hintCommittedMemoryExport(t){try{let e=await import("node:fs/promises"),a=(await import("node:path")).join(t,".prjct","memory-export","manifest.json"),c=JSON.parse(await e.readFile(a,"utf-8"));c?.entries&&c.entries>0&&r.info(`\u{1F4E6} This repo ships ${c.entries} team memories (.prjct/memory-export/). Load them: prjct memory import`)}catch{}}async init(t={},e=process.cwd()){try{let i=typeof t=="string"||t===null?{idea:t}:t;if(await this.initializeAgent(),await A.isConfigured(e))return r.warn("already initialized"),{success:!1,message:"Already initialized"};let c=process.stdout.isTTY&&process.stdin.isTTY,s=i.yes||!c||process.env.CI==="true"?c&&i.yes?await new y(e).runNonInteractive():null:await new y(e).run();if(s?.skipped)return{success:!1,message:"Setup cancelled"};r.step(1,4,"Detecting author...");let u=await W(),R={name:u.name||void 0,email:u.email||void 0,github:u.github||void 0},d=(await A.createConfig(e,R)).projectId;await this._applyInitialPacksAndPersona(e,i),r.step(2,4,"Creating structure..."),await O.ensureProjectStructure(d),await this._seedShipWorkflow(d,e);let m=await this._detectEmptyDirectory(e),D=await this._detectExistingCode(e);if(D||!m){r.step(3,4,"Analyzing project...");let w=await L();if((await w.analyze({},e)).success){r.step(4,4,"Generating agents..."),await w.sync(e);let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),await this._hintCommittedMemoryExport(e),this._printNextSteps(s,b??void 0),{success:!0,mode:"existing",projectId:d,wizard:s}}}let v=i.idea;if(m&&!D){if(!v){await S.installGlobalConfig();let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("blank project - provide idea for architect mode"),this._printNextSteps(s,b??void 0),{success:!0,mode:"blank_no_idea",projectId:d,wizard:s}}r.spin("architect mode...");let{projectMemory:w}=await import("./project-memory-ON54KZEM.mjs");await w.remember(e,{type:"idea",content:v,tags:{source:"architect-init",status:"awaiting-stack-recommendation"},source:"architect-init"}),await S.installGlobalConfig();let _=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("architect mode ready"),this._printNextSteps(s,_??void 0),{success:!0,mode:"architect",projectId:d,idea:v,wizard:s}}await S.installGlobalConfig();let V=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),this._printNextSteps(s,V??void 0),{success:!0,projectId:d,wizard:s}}catch(i){return r.fail(z(i)),$(i)}}async quickstart(t={},e=process.cwd()){let i=t.pack??"code,daily",a=await this.init({...t,yes:!0,pack:i},e);return!a.success&&a.message!=="Already initialized"?a:(console.log(""),console.log(" \u2500\u2500 quickstart ready \u2500\u2500"),console.log(" 1. Open your coding agent in this repo (Claude / Codex / Cursor / Grok)."),console.log(" 2. Say what to build \u2014 the agent runs `prjct work` for you."),console.log(" 3. Team brain without cloud: `prjct memory export` \u2192 commit \u2192 clone \u2192 import."),console.log(""),{...a,success:!0})}_printNextSteps(t,e){console.log(""),console.log(" \u2713 global prjct router refreshed where supported"),e?.claudeMd&&e.claudeMd.action!=="unchanged"&&console.log(" \u2713 project CLAUDE.md updated with routing block"),e?.agentsMd&&e.agentsMd.action!=="unchanged"&&console.log(" \u2713 project AGENTS.md updated with universal routing block"),(e?.ideRules.length??0)>0&&console.log(` \u2713 project IDE rules updated: ${e?.ideRules.join(", ")}`),console.log(""),console.log(" You don't run prjct commands. Your AI coding agent does."),console.log(""),console.log(" Just describe what you're doing \u2014 the agent reads the intent and"),console.log(" runs the right verb. Routine captures (decision, learning,"),console.log(" gotcha, idea) save automatically; ship and other destructive"),console.log(" verbs surface a one-line plan and wait for your OK."),console.log(""),console.log(" If you want to drive manually:"),console.log(" prjct sync Refresh context + skill body"),console.log(" prjct work Start a work cycle"),console.log(" prjct land Session-close checklist"),console.log(" prjct memory export Git-share team memory"),console.log(""),t&&t.agents.length>0&&(console.log(` Detected agents: ${t.agents.join(", ")}`),console.log("")),console.log(" Docs: https://prjct.app/docs"),console.log("")}async _agentSelections(t,e){if(t)return t.agents;try{let{detectInstalledAgents:i}=await import("./detection-MEYHME4X.mjs");return i(e)}catch{return[]}}async _applyInitialPacksAndPersona(t,e){let{activatePacks:i,detectSuggestedPacks:a}=await import("./pack-manager-ASWLKYGP.mjs"),c=e.pack?e.pack.split(",").map(l=>l.trim()).filter(Boolean):e.persona?[]:await a(t);if(c.length>0&&await i(t,c,{suggestPersona:!0}),e.persona){let l=(await import("./config-manager-YZANYLPV.mjs")).default,s=await l.readConfig(t);if(s){let u=s.persona??{role:e.persona};u.role=e.persona,await l.writeConfig(t,{...s,persona:u})}}}async _resolveInitialPrConvention(t,e){let{detectPrConventionSignal:i,defaultPrConventionFor:a}=await import("./pr-convention-7UGI7TFA.mjs"),{customWorkflowStorage:c}=await import("./custom-workflow-storage-M77INP6Z.mjs"),l=await i(e),s=a(l),u=!!(process.stdout.isTTY&&process.stdin.isTTY),x=(l.kind==="github-ambiguous"&&u?await(async()=>{let d=await import("@clack/prompts"),m=await d.confirm({message:"This project ships to GitHub with no PR template. Should ship open/update the PR automatically?",initialValue:!0});return d.isCancel(m)?null:m?"auto":"manual"})():null)??s;c.updateWorkflow(t,"ship",{metadata:{prConvention:x}})}async _seedShipWorkflow(t,e){let i=await M(e);await this._resolveInitialPrConvention(t,e);let{seedCodeShipRules:a}=await import("./shipping-LVTFVSWJ.mjs");await a(t,e);let c=f.getRulesForCommand(t,"ship").reduce((l,s)=>Math.max(l,s.sortOrder??0),0)+1;f.addRule(t,{type:"gate",command:"ship",position:"before",action:'git branch --show-current | grep -vE "^(main|master)$"',description:"Prevent shipping from main branch",enabled:!0,timeoutMs:5e3,sortOrder:c,createdAt:new Date().toISOString()}),i.lint&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.lint.command} || true`,description:"Lint code",enabled:!0,timeoutMs:12e4,sortOrder:c+1,createdAt:new Date().toISOString()}),i.test&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.test.command} || true`,description:"Run tests",enabled:!0,timeoutMs:3e5,sortOrder:c+(i.lint?2:1),createdAt:new Date().toISOString()})}};export{N as PlanningCommands};
8
+ import{a as f}from"./chunk-C3W2HLJT.mjs";import{c as $,d as E}from"./chunk-F4T7IAA7.mjs";import{a as M}from"./chunk-H4CA3XZ6.mjs";import{a as r}from"./chunk-4O4D6DV7.mjs";import{a as g}from"./chunk-VWOIUTAX.mjs";import"./chunk-IHECXD2M.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-OENWCYLF.mjs";import{a as h,b as C,c as T,d as P,e as I}from"./chunk-XFQ7NNLN.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import{a as W,b as A}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{d as S}from"./chunk-4SKJWNKE.mjs";import{v as O,w as Y}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EQ5KNMLG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import{e as z,f as G}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";Y();G();import*as n from"@clack/prompts";import p from"chalk";var y=class{static{o(this,"OnboardingWizard")}projectPath;aborted=!1;detectedType="unknown";confirmedType="unknown";selectedAgents=[];detectedStack={language:"Unknown",technologies:[]};confirmedStack={language:"Unknown",technologies:[]};preferences={verbosity:"normal",autoSync:!0,telemetry:!1};constructor(t=process.cwd()){this.projectPath=t}async run(){n.intro(p.cyan.bold("\u26A1 prjct-cli setup"));let t=[{id:"project-type",title:"Project Type",run:o(()=>this.stepProjectType(),"run")},{id:"ai-agents",title:"AI Agents",run:o(()=>this.stepAIAgents(),"run")},{id:"stack",title:"Stack Confirmation",run:o(()=>this.stepStack(),"run")},{id:"preferences",title:"Preferences",run:o(()=>this.stepPreferences(),"run")},{id:"summary",title:"Summary",run:o(()=>this.stepSummary(),"run")}];for(let e of t)if(!await e.run()||this.aborted)return this.buildResult(!0);return n.outro(p.green("Setup complete!")),this.buildResult(!1)}async runNonInteractive(){r.spin("Auto-detecting project configuration..."),this.detectedType=await T(this.projectPath),this.confirmedType=this.detectedType;let t=await P(this.projectPath);return this.selectedAgents=t,this.detectedStack=await I(this.projectPath),this.confirmedStack=this.detectedStack,r.done("Configuration detected"),this.buildResult(!1)}async stepProjectType(){this.detectedType=await T(this.projectPath);let t=h.findIndex(i=>i.value===this.detectedType),e=await n.select({message:this.detectedType!=="unknown"?`Detected: ${this.getProjectTypeLabel(this.detectedType)}. Is this correct?`:"What type of project is this?",options:h.map(i=>({label:i.title,hint:i.description,value:i.value})),initialValue:t>=0?h[t].value:void 0});return n.isCancel(e)?(this.handleCancel(),!1):(this.confirmedType=e||this.detectedType,!0)}async stepAIAgents(){let t=await P(this.projectPath),e=C.map(a=>({label:a.title,hint:a.description,value:a.value})),i=await n.multiselect({message:"Which AI agents do you use?",options:e,initialValues:t,required:!0});return n.isCancel(i)?(this.handleCancel(),!1):(this.selectedAgents=i,!0)}async stepStack(){this.detectedStack=await I(this.projectPath);let t=this.formatStackDisplay(this.detectedStack);n.note(t,"Detected stack");let e=await n.confirm({message:"Is this stack correct?",initialValue:!0});if(n.isCancel(e))return this.handleCancel(),!1;if(e)this.confirmedStack=this.detectedStack;else{let i=await n.group({language:o(()=>n.text({message:"Primary language:",defaultValue:this.detectedStack.language}),"language"),framework:o(()=>n.text({message:"Framework (optional):",defaultValue:this.detectedStack.framework||""}),"framework")},{onCancel:o(()=>this.handleCancel(),"onCancel")});if(this.aborted)return!1;this.confirmedStack={...this.detectedStack,language:i.language||this.detectedStack.language,framework:i.framework||void 0}}return!0}async stepPreferences(){let t=await n.group({verbosity:o(()=>n.select({message:"Output verbosity:",options:[{label:"Minimal",hint:"Essential output only",value:"minimal"},{label:"Normal (Recommended)",hint:"Balanced information",value:"normal"},{label:"Verbose",hint:"Detailed logging",value:"verbose"}],initialValue:"normal"}),"verbosity"),autoSync:o(()=>n.confirm({message:"Auto-sync context on file changes?",initialValue:!0}),"autoSync")},{onCancel:o(()=>this.handleCancel(),"onCancel")});return this.aborted?!1:(this.preferences={verbosity:t.verbosity||"normal",autoSync:t.autoSync??!0,telemetry:!1},!0)}async stepSummary(){let t=[`${p.cyan("Project Type:")} ${this.getProjectTypeLabel(this.confirmedType)}`,`${p.cyan("AI Agents:")} ${this.selectedAgents.map(i=>this.getAgentLabel(i)).join(", ")}`,`${p.cyan("Stack:")} ${this.formatStackDisplay(this.confirmedStack)}`,`${p.cyan("Verbosity:")} ${this.preferences.verbosity}`,`${p.cyan("Auto-sync:")} ${this.preferences.autoSync?"Yes":"No"}`].join(`
9
+ `);n.note(t,"Configuration Summary");let e=await n.confirm({message:"Generate configuration with these settings?",initialValue:!0});return n.isCancel(e)||!e?(n.isCancel(e)&&this.handleCancel(),!1):!0}handleCancel(){this.aborted=!0,n.cancel("Setup cancelled. Run again anytime.")}getProjectTypeLabel(t){return h.find(e=>e.value===t)?.title||"Unknown"}getAgentLabel(t){return C.find(e=>e.value===t)?.title||t}formatStackDisplay(t){let e=[t.language];return t.framework&&e.push(t.framework),t.runtime&&t.runtime!=="Node.js"&&e.push(t.runtime),t.technologies.length>0&&e.push(`+ ${t.technologies.slice(0,3).join(", ")}`),e.join(" / ")}buildResult(t){return{projectType:this.confirmedType,agents:this.selectedAgents,stack:this.confirmedStack,preferences:this.preferences,skipped:t}}getSelectedAgents(){return this.selectedAgents}getConfirmedStack(){return this.confirmedStack}getPreferences(){return this.preferences}};var j={current:null};async function L(){if(!j.current){let{AnalysisCommands:k}=await import("./analysis-N4NYGIG3.mjs");j.current=new k}return j.current}o(L,"getAnalysisCommands");var N=class extends E{static{o(this,"PlanningCommands")}async _hintCommittedMemoryExport(t){try{let e=await import("node:fs/promises"),a=(await import("node:path")).join(t,".prjct","memory-export","manifest.json"),c=JSON.parse(await e.readFile(a,"utf-8"));c?.entries&&c.entries>0&&r.info(`\u{1F4E6} This repo ships ${c.entries} team memories (.prjct/memory-export/). Load them: prjct memory import`)}catch{}}async init(t={},e=process.cwd()){try{let i=typeof t=="string"||t===null?{idea:t}:t;if(await this.initializeAgent(),await A.isConfigured(e))return r.warn("already initialized"),{success:!1,message:"Already initialized"};let c=process.stdout.isTTY&&process.stdin.isTTY,s=i.yes||!c||process.env.CI==="true"?c&&i.yes?await new y(e).runNonInteractive():null:await new y(e).run();if(s?.skipped)return{success:!1,message:"Setup cancelled"};r.step(1,4,"Detecting author...");let u=await W(),R={name:u.name||void 0,email:u.email||void 0,github:u.github||void 0},d=(await A.createConfig(e,R)).projectId;await this._applyInitialPacksAndPersona(e,i),r.step(2,4,"Creating structure..."),await O.ensureProjectStructure(d),await this._seedShipWorkflow(d,e);let m=await this._detectEmptyDirectory(e),D=await this._detectExistingCode(e);if(D||!m){r.step(3,4,"Analyzing project...");let w=await L();if((await w.analyze({},e)).success){r.step(4,4,"Generating agents..."),await w.sync(e);let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),await this._hintCommittedMemoryExport(e),this._printNextSteps(s,b??void 0),{success:!0,mode:"existing",projectId:d,wizard:s}}}let v=i.idea;if(m&&!D){if(!v){await S.installGlobalConfig();let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("blank project - provide idea for architect mode"),this._printNextSteps(s,b??void 0),{success:!0,mode:"blank_no_idea",projectId:d,wizard:s}}r.spin("architect mode...");let{projectMemory:w}=await import("./project-memory-KKEMTEMP.mjs");await w.remember(e,{type:"idea",content:v,tags:{source:"architect-init",status:"awaiting-stack-recommendation"},source:"architect-init"}),await S.installGlobalConfig();let _=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("architect mode ready"),this._printNextSteps(s,_??void 0),{success:!0,mode:"architect",projectId:d,idea:v,wizard:s}}await S.installGlobalConfig();let V=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),this._printNextSteps(s,V??void 0),{success:!0,projectId:d,wizard:s}}catch(i){return r.fail(z(i)),$(i)}}async quickstart(t={},e=process.cwd()){let i=t.pack??"code,daily",a=await this.init({...t,yes:!0,pack:i},e);return!a.success&&a.message!=="Already initialized"?a:(console.log(""),console.log(" \u2500\u2500 quickstart ready \u2500\u2500"),console.log(" 1. Open your coding agent in this repo (Claude / Codex / Cursor / Grok)."),console.log(" 2. Say what to build \u2014 the agent runs `prjct work` for you."),console.log(" 3. Team brain without cloud: `prjct memory export` \u2192 commit \u2192 clone \u2192 import."),console.log(""),{...a,success:!0})}_printNextSteps(t,e){console.log(""),console.log(" \u2713 global prjct router refreshed where supported"),e?.claudeMd&&e.claudeMd.action!=="unchanged"&&console.log(" \u2713 project CLAUDE.md updated with routing block"),e?.agentsMd&&e.agentsMd.action!=="unchanged"&&console.log(" \u2713 project AGENTS.md updated with universal routing block"),(e?.ideRules.length??0)>0&&console.log(` \u2713 project IDE rules updated: ${e?.ideRules.join(", ")}`),console.log(""),console.log(" You don't run prjct commands. Your AI coding agent does."),console.log(""),console.log(" Just describe what you're doing \u2014 the agent reads the intent and"),console.log(" runs the right verb. Routine captures (decision, learning,"),console.log(" gotcha, idea) save automatically; ship and other destructive"),console.log(" verbs surface a one-line plan and wait for your OK."),console.log(""),console.log(" If you want to drive manually:"),console.log(" prjct sync Refresh context + skill body"),console.log(" prjct work Start a work cycle"),console.log(" prjct land Session-close checklist"),console.log(" prjct memory export Git-share team memory"),console.log(""),t&&t.agents.length>0&&(console.log(` Detected agents: ${t.agents.join(", ")}`),console.log("")),console.log(" Docs: https://prjct.app/docs"),console.log("")}async _agentSelections(t,e){if(t)return t.agents;try{let{detectInstalledAgents:i}=await import("./detection-QRVSNMKL.mjs");return i(e)}catch{return[]}}async _applyInitialPacksAndPersona(t,e){let{activatePacks:i,detectSuggestedPacks:a}=await import("./pack-manager-WWGQNJDQ.mjs"),c=e.pack?e.pack.split(",").map(l=>l.trim()).filter(Boolean):e.persona?[]:await a(t);if(c.length>0&&await i(t,c,{suggestPersona:!0}),e.persona){let l=(await import("./config-manager-2VZPHUDG.mjs")).default,s=await l.readConfig(t);if(s){let u=s.persona??{role:e.persona};u.role=e.persona,await l.writeConfig(t,{...s,persona:u})}}}async _resolveInitialPrConvention(t,e){let{detectPrConventionSignal:i,defaultPrConventionFor:a}=await import("./pr-convention-5NPXQJ2R.mjs"),{customWorkflowStorage:c}=await import("./custom-workflow-storage-UOBQXY42.mjs"),l=await i(e),s=a(l),u=!!(process.stdout.isTTY&&process.stdin.isTTY),x=(l.kind==="github-ambiguous"&&u?await(async()=>{let d=await import("@clack/prompts"),m=await d.confirm({message:"This project ships to GitHub with no PR template. Should ship open/update the PR automatically?",initialValue:!0});return d.isCancel(m)?null:m?"auto":"manual"})():null)??s;c.updateWorkflow(t,"ship",{metadata:{prConvention:x}})}async _seedShipWorkflow(t,e){let i=await M(e);await this._resolveInitialPrConvention(t,e);let{seedCodeShipRules:a}=await import("./shipping-5D5LTJ3P.mjs");await a(t,e);let c=f.getRulesForCommand(t,"ship").reduce((l,s)=>Math.max(l,s.sortOrder??0),0)+1;f.addRule(t,{type:"gate",command:"ship",position:"before",action:'git branch --show-current | grep -vE "^(main|master)$"',description:"Prevent shipping from main branch",enabled:!0,timeoutMs:5e3,sortOrder:c,createdAt:new Date().toISOString()}),i.lint&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.lint.command} || true`,description:"Lint code",enabled:!0,timeoutMs:12e4,sortOrder:c+1,createdAt:new Date().toISOString()}),i.test&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.test.command} || true`,description:"Run tests",enabled:!0,timeoutMs:3e5,sortOrder:c+(i.lint?2:1),createdAt:new Date().toISOString()})}};export{N as PlanningCommands};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a}from"./chunk-ZJXH76Q5.mjs";import{a as e}from"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function u(f=process.cwd(),c){return a({event:"PostToolUse",projectPath:f,afterEmit:o(async(t,r)=>{let i=t.tool_input?.file_path;if(!(!i||!(await n.readConfig(r))?.projectId))try{await e.log(r,"post_edit",{file:i,tool:t.tool_name??"unknown"})}catch{}},"afterEmit")},c)}o(u,"runPostEditHook");export{u as runPostEditHook};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a,b}from"./chunk-CQHPIYNM.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-E66B27AL.mjs";export{b as defaultPrConventionFor,a as detectPrConventionSignal};
8
+ import{a,b}from"./chunk-BCAHWZH7.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{b as defaultPrConventionFor,a as detectPrConventionSignal};
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a as d}from"./chunk-AVRNHROK.mjs";import{a as k}from"./chunk-S7HQQILD.mjs";import{c as l}from"./chunk-MXHX44WF.mjs";import{a as m,c as p}from"./chunk-Q3Z53QTH.mjs";import{a as u}from"./chunk-ZJXH76Q5.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as r}from"./chunk-E66B27AL.mjs";var s=new WeakMap;function f(e){let o=e.tool_input??e.toolInput;return o&&typeof o.command=="string"?o.command:typeof e.command=="string"?e.command:o&&typeof o.command_line=="string"?o.command_line:""}r(f,"extractCommand");function y(e){let o=f(e),t=o?l(o):null;return t?{deny:t}:null}r(y,"decideBroadProcessTermination");function g(e,o){let t=o,n=s.get(t);if(n)return n;let a=d(e,o);return s.set(t,a),a}r(g,"evaluatePackageOnce");function x(e=process.cwd(),o){return u({event:"PreToolUse",projectPath:e,decide:r(async(t,n)=>{try{let a=k(t);if(a)return a;let c=y(t);if(c)return c;let i=await g(n,t);return i?.strict?{deny:i.message}:null}catch{return null}},"decide"),build:r(async(t,n)=>{try{let[a,c]=await Promise.all([p(t)?m(n):null,g(n,t)]),i=c&&!c.strict?`# prjct: package legitimacy (advisory)
9
+ ${c.message}`:null;return[a,i].filter(Boolean).join(`
10
+
11
+ `)||null}catch{return null}finally{s.delete(t)}},"build")},o)}r(x,"runPreBashHook");export{y as decideBroadProcessTermination,x as runPreBashHook};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b,c}from"./chunk-Q3Z53QTH.mjs";import"./chunk-ZJXH76Q5.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as buildPreCommitContext,c as isCommitInput,b as runPreCommitHook};
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a as R}from"./chunk-S7HQQILD.mjs";import{a as E}from"./chunk-5WAONIPX.mjs";import{a as A}from"./chunk-ZJXH76Q5.mjs";import{a as x}from"./chunk-3VWBNLBC.mjs";import{a as b,b as M,c as T,d as C,e as g,f as k,g as m,i as w}from"./chunk-ZMKTR2IO.mjs";import"./chunk-QPRNRLG6.mjs";import{b as I,c as S,d as $}from"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as L}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import{b as v}from"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import{h as p}from"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var O=new Set(["decision","gotcha","fact","spec","identity","voice","glossary"]);function N(r){return O.has(r)}i(N,"isSotBindType");function V(r,o){let n=new Set(o??[]);return r.filter(e=>N(e.type)&&e.confidence==="high"&&e.id&&!n.has(e.id))}i(V,"filterSotCandidates");function H(r){let o=V(r.candidates,r.overriddenIds);if(o.length===0)return{action:"none",reason:"no-sot",memoryIds:[],message:""};let n=r.harnessLevel??null,e=r.fileLabel?` on \`${r.fileLabel}\``:"",t=o[0],a=o.map(s=>s.id),l='To supersede: `prjct remember decision "\u2026why\u2026" --tags supersedes:'+t.id+'`. To lift for this memory: `prjct remember feedback "override conflict '+t.id+': <why>" --tags conflict:override,memory:'+t.id+"`.";if(n==="H2"||n==="H3"){let s=`SoT hard-bind (${n})${e}: must not contradict [${t.type}] ${B(t.content,80)} (\`${t.id}\`)`;return{action:"deny",reason:"h2-sot-deny",memoryIds:a,message:[`\u26D4 prjct SoT bind: ${s}`,`Memories: ${a.join(", ")}`,l,"H2+ work is bound to living Source-of-Truth. Supersede or override before Edit|Write."].join(" ")}}return n==="H1"?{action:"warn",reason:"h1-sot-warn",memoryIds:a,message:["# prjct: SoT soft-bind (H1)","",`High-confidence SoT on this file${e}:`,...o.slice(0,3).map(s=>`- **[${s.type}]** ${B(s.content,100)} \`${s.id}\``),"",l,"","> H2+ would hard-block. On H1 this is advisory \u2014 supersede if intentional."].join(`
9
+ `)}:{action:"none",reason:"none",memoryIds:a,message:""}}i(H,"sotBindVerdict");function B(r,o){let n=r.replace(/\s+/g," ").trim();return n.length>o?`${n.slice(0,o-1)}\u2026`:n}i(B,"truncate");function F(r,o){if(o.length===0)return null;let n=[`# prjct: heads-up before editing \`${r}\``,"",`${o.length} preventive trap(s) recorded against this file:`,""];for(let e of o)n.push(`- **[${e.type}]** ${e.title} \`${e.id}\``);return n.push(""),n.push("> Dynasty trap-before-edit: surface is mandatory. Apply if it still holds; supersede if not."),n.join(`
10
+ `)}i(F,"formatTrapSurfaceMessage");var y=1200,_=new Map;function D(r,o){let n=`${r}\0${o}`,e=_.get(n);if(e)return e;let t=(()=>{try{return L.recallForFile(r,o,M,{preventiveOnly:!0})}catch{return[]}})();return _.set(n,t),t}i(D,"recallPreventiveOnce");function P(){_.clear()}i(P,"clearPreventiveCache");function U(r,o){let n=F(o,r.map(t=>({id:t.id,type:I(t),title:`${$(t)} \u2014 ${S(t.content)}`})));if(n)return p(n,y);let e=[`# prjct: heads-up before editing \`${o}\``,""];e.push(`${r.length} preventive memory entr${r.length===1?"y":"ies"} recorded against this file:`),e.push("");for(let t of r)e.push(`- **[${I(t)}] ${$(t)}** \u2014 ${S(t.content)} \`${t.id}\``);return e.push(""),e.push("> Nudge, not block. Apply if it still holds; proceed if not."),p(e.join(`
11
+ `),y)}i(U,"headsUpMessage");async function W(r,o){let n=Date.now(),e=await h.readConfig(r);if(!e?.projectId)return null;let t=D(e.projectId,o);if(m(n)||t.length===0)return null;x(e.projectId,r,t.map(f=>f.id));let a=w(e),l=C(e.projectId),s=k(t),u=o.split("/").pop()??o,d=T({mode:a,candidates:s,overriddenIds:l,fileLabel:u});if(m(n))return null;try{let f=await v.getCurrentTask(e.projectId),c=H({harnessLevel:f?.harness?.level??null,candidates:s,overriddenIds:l,fileLabel:u});if(c.action==="warn"&&c.message)return p(c.message,y)}catch{}return d.action==="warn"&&d.message?(g(r,e.projectId,"warn",d.memoryIds,d.reason),p(d.message,y)):a==="off"||d.action==="none"||t.length>0?U(t,u):null}i(W,"buildPreEditContext");async function G(r,o){let n=Date.now();try{let e=await h.readConfig(r);if(!e?.projectId)return null;let t=await v.getCurrentTask(e.projectId);if(e.maxTurnsPerCycle){let j=E(e,t);if(j.stopped)return{deny:j.message}}if(!o||m(n,b))return null;let a=D(e.projectId,o);if(a.length===0||m(n,b))return null;let l=C(e.projectId),s=o.split("/").pop()??o,u=k(a),d=H({harnessLevel:t?.harness?.level??null,candidates:u,overriddenIds:l,fileLabel:s});if(d.action==="deny"&&d.message)return g(r,e.projectId,"deny",d.memoryIds,d.reason),{deny:d.message};let f=w(e);if(f!=="strict")return null;let c=T({mode:f,candidates:u,overriddenIds:l,fileLabel:s});return c.action==="deny"&&c.message?(g(r,e.projectId,"deny",c.memoryIds,c.reason),{deny:c.message}):null}catch{return null}}i(G,"decideHardStop");function ce(r=process.cwd(),o){return A({event:"PreToolUse",projectPath:r,decide:i(async(n,e)=>{P();let t=R(n);return t||G(e,n.tool_input?.file_path?.trim())},"decide"),build:i(async(n,e)=>{try{let t=n.tool_input?.file_path?.trim();return t?W(e,t):null}finally{P()}},"build")},o)}i(ce,"runPreEditHook");export{ce as runPreEditHook};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b}from"./chunk-AVRNHROK.mjs";import"./chunk-ZJXH76Q5.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as evaluatePrePackageInput,b as runPrePackageHook};
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a as d}from"./chunk-ZJXH76Q5.mjs";import{g as p,j as g}from"./chunk-7GNWHWOO.mjs";import{h as u}from"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as f}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";var _=900,h=80,b=8;function m(e){let o=e.tool_input?.pattern??e.tool_input?.query??e.tool_input?.glob??"";if(!o||typeof o!="string")return null;let t=o.match(/[A-Za-z_][A-Za-z0-9_]{2,}/g);if(!t||t.length===0)return null;t.sort((n,s)=>s.length-n.length);let r=new Set(["the","and","for","from","import","export","function","class","const","type","interface","return","async","await","true","false","null","undefined","test","describe","src","core","node","modules"]);for(let n of t)if(!r.has(n.toLowerCase()))return n;return t[0]??null}l(m,"extractToken");async function k(e,o){let t=Date.now();try{let r=(o.tool_name??"").toLowerCase();if(r&&!/grep|glob|search/i.test(r))return null;let n=m(o);if(!n)return null;let s=await f.readConfig(e);if(!s?.projectId||!p(s.projectId)||Date.now()-t>h)return null;let a=g(s.projectId,n,{limit:b});if(a.length===0||Date.now()-t>h)return null;let c=["# prjct code graph (non-blocking)","",`Grep/Glob token \`${n}\` matches indexed symbols \u2014 prefer these before more tree walks:`,""];for(let i of a)c.push(`- **${i.name}** (${i.kind}${i.exported?", exported":""}) \u2014 \`${i.file}:${i.startLine}\``);return c.push(""),c.push(`> Expand: \`prjct code trace ${n}\` or MCP \`prjct_trace_path\`. This inject never blocks the tool.`),u(c.join(`
9
+ `),_)}catch{return null}}l(k,"buildSearchAugment");async function x(e,o){await d({event:"PreToolUse",projectPath:e,build:l((t,r)=>k(r,t),"build")},o)}l(x,"runPreSearchHook");var j={extractToken:m,buildSearchAugment:k};export{j as _internal,x as runPreSearchHook};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b,c}from"./chunk-S7HQQILD.mjs";import"./chunk-ZJXH76Q5.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{c as _internal,a as decideSecrets,b as runPreSecretsHook};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-6IKHMK2U.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-75UJIVMO.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-E66B27AL.mjs";export{a as HOT_PATH_RE,h as PREFER_CONST_CLAIM_RE,w as actionableOpen,y as advanceFixRound,v as applyBatchRefutation,g as applyEvidenceTax,r as applyGhostFilter,j as applyMechanicalStyleRefute,M as applyScopeFreeze,N as applyScopeFreezeAll,n as applySeverityFloor,o as applySeverityFloorAll,k as blastRank,G as buildNextAction,F as buildReReviewBrief,x as canStartFixRound,C as computePrecisionHint,D as computeVerdict,R as createLedger,f as evidenceScore,E as finalizeLedger,e as findingDna,O as findingInFixScope,d as intensityFromChangeset,H as intensityProtocol,m as isActionableSeverity,b as isHotPath,i as isPreferConstClaim,I as judgmentShipVerdict,A as markFindings,B as markFindingsSkippedByScope,p as markGhost,z as markLeftoversOpen,s as mergeDualJudges,P as newFindingId,Q as newLedgerId,K as normalizeScopePath,L as pathInScope,l as rankFindingsForFix,q as recordRefutedAsGhosts,t as refutePanelSize,u as resolveRefuteVotes,c as routeIntensity,J as upsertFinding};
8
+ import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{a as HOT_PATH_RE,h as PREFER_CONST_CLAIM_RE,w as actionableOpen,y as advanceFixRound,v as applyBatchRefutation,g as applyEvidenceTax,r as applyGhostFilter,j as applyMechanicalStyleRefute,M as applyScopeFreeze,N as applyScopeFreezeAll,n as applySeverityFloor,o as applySeverityFloorAll,k as blastRank,G as buildNextAction,F as buildReReviewBrief,x as canStartFixRound,C as computePrecisionHint,D as computeVerdict,R as createLedger,f as evidenceScore,E as finalizeLedger,e as findingDna,O as findingInFixScope,d as intensityFromChangeset,H as intensityProtocol,m as isActionableSeverity,b as isHotPath,i as isPreferConstClaim,I as judgmentShipVerdict,A as markFindings,B as markFindingsSkippedByScope,p as markGhost,z as markLeftoversOpen,s as mergeDualJudges,P as newFindingId,Q as newLedgerId,K as normalizeScopePath,L as pathInScope,l as rankFindingsForFix,q as recordRefutedAsGhosts,t as refutePanelSize,u as resolveRefuteVotes,c as routeIntensity,J as upsertFinding};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a,b,c,d}from"./chunk-AWD2AQVJ.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-OLKNK2HB.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-ZX6BC2EB.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as buildPrjctMdBody,a as buildProjectFactsSection,d as formatProjectFactsMd,c as writeProjectPrjctMd};
8
+ import{a,b,c,d}from"./chunk-IHECXD2M.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as buildPrjctMdBody,a as buildProjectFactsSection,d as formatProjectFactsMd,c as writeProjectPrjctMd};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a}from"./chunk-MQVVNX63.mjs";import"./chunk-AWD2AQVJ.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-OLKNK2HB.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-ZNQXFWSI.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-ZX6BC2EB.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as writeProjectAgentSurfaces};
8
+ import{a}from"./chunk-VWOIUTAX.mjs";import"./chunk-IHECXD2M.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EQ5KNMLG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as writeProjectAgentSurfaces};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-2OU2MKNS.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as FILE_INVENTORY_DOC_KEY,b as buildFileInventory,j as formatInventorySummary,g as inventoryExtensions,i as inventoryPathWeight,c as languagesFromExtensions,e as loadFileInventory,h as pathMatchesInventory,f as refreshFileInventory,d as saveFileInventory};
8
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-FX6VHIKB.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as FILE_INVENTORY_DOC_KEY,b as buildFileInventory,j as formatInventorySummary,g as inventoryExtensions,i as inventoryPathWeight,c as languagesFromExtensions,e as loadFileInventory,h as pathMatchesInventory,f as refreshFileInventory,d as saveFileInventory};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as projectMemory};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b,c,d,e,f,g}from"./chunk-Q3EYM4GJ.mjs";import"./chunk-AZYQFRPJ.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{f as bridgeStyleToMemory,g as formatProjectStyleForSync,a as getActiveProjectStyle,b as getProjectEvolution,d as persistProjectStyleSnapshot,e as recomputeProjectStyle,c as renderProjectEvolution};
@@ -5,18 +5,18 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a as A,b as z}from"./chunk-MXHX44WF.mjs";import{a as K}from"./chunk-EM6ZDJAK.mjs";import{a as V}from"./chunk-5WAONIPX.mjs";import{a as x,b as S,c as q}from"./chunk-L4COZ7ZH.mjs";import{b as $}from"./chunk-2UC4DTDO.mjs";import{a as F}from"./chunk-5TBQNW2G.mjs";import{a as B}from"./chunk-MAHTF6JG.mjs";import{a as _}from"./chunk-WDGDFXSB.mjs";import{a as U}from"./chunk-ZX2KFQV5.mjs";import{b as M}from"./chunk-NWY5M34K.mjs";import{b as N}from"./chunk-5PEHJEFE.mjs";import"./chunk-CREPUNOS.mjs";import{b as O}from"./chunk-D7TRY3CO.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-CPHUFXD2.mjs";import{a as H,g as L}from"./chunk-LLQUB6YR.mjs";import"./chunk-NLG2EW6M.mjs";import"./chunk-6IKHMK2U.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-75UJIVMO.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-2OU2MKNS.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-4DDCWMI6.mjs";import"./chunk-ZZ65CN5F.mjs";import{d as v}from"./chunk-WSFHSXBZ.mjs";import"./chunk-OL6ITIAZ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as I}from"./chunk-DGBDMUBL.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-DVBBB5BS.mjs";import"./chunk-UUULLTQV.mjs";import{b as T}from"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import{b as k}from"./chunk-OLKNK2HB.mjs";import"./chunk-MEQS4VPO.mjs";import{d as R,g as ie}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{j as G,n as re}from"./chunk-SVZHJZ5T.mjs";import{b as D,o as ne}from"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-ZX6BC2EB.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import{createHash as E}from"node:crypto";import f from"node:fs/promises";import h from"node:path";var se=15;function W(t){let r=[],e=[];t.loop?.stopped&&t.loop.message&&(r.push("loop-hard-stop"),e.push(t.loop.message)),t.pressure?.level==="critical"&&t.pressure.cue?(r.push("context-pressure-critical"),e.push(t.pressure.cue)):t.pressure?.level==="warn"&&t.pressure.cue&&(r.push("context-pressure-warn"),e.push(t.pressure.cue)),t.qualityInject?.trim()&&(r.push("quality-ledger"),e.push(t.qualityInject.trim()));let i=t.turns??0,n=t.stuckThreshold??se;if(!t.loop?.stopped&&i>=n&&(r.push("stuck-cycle"),e.push(`\u26A0 ${i} turns on this cycle and it is still open. If you are not nearly done, STOP looping: split it, ship the slice that works, or check in with the user \u2014 then \`prjct status done\`. A re-plan beats another grinding turn.`)),e.length===0)return{level:"ok",markdown:null,cues:[]};let s=r.some(a=>["loop-hard-stop","context-pressure-critical","context-pressure-warn"].includes(a)),o=r.some(a=>["quality-ledger","stuck-cycle"].includes(a)),d=s?"hard":o?"warn":"ok",p=d==="hard"?"# prjct: alignment (MUST \u2014 hard gate)":"# prjct: alignment (mid-cycle)",g=e.join(`
8
+ import{a as A,b as z}from"./chunk-MXHX44WF.mjs";import{a as K}from"./chunk-NCOOKPXX.mjs";import{a as V}from"./chunk-5WAONIPX.mjs";import{a as q}from"./chunk-ZJXH76Q5.mjs";import{b as x}from"./chunk-2UC4DTDO.mjs";import{a as F}from"./chunk-5TBQNW2G.mjs";import{a as B}from"./chunk-3VWBNLBC.mjs";import{a as _}from"./chunk-J6TAD3OZ.mjs";import{a as U}from"./chunk-D6IONKRA.mjs";import{a as M}from"./chunk-T2FCU3ZS.mjs";import{b as N}from"./chunk-XE4MJNBQ.mjs";import"./chunk-JCYXFHQZ.mjs";import{b as O}from"./chunk-JPSJWCFD.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-JUZ5LNDI.mjs";import{a as H,g as L}from"./chunk-7O6OMD4X.mjs";import"./chunk-OZJ6UKKP.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-FX6VHIKB.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-QPRNRLG6.mjs";import{d as S}from"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as I}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import{b as $}from"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import{g as T,h as k}from"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as v}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as R,g as ie}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as G,o as re}from"./chunk-UH4MD3F3.mjs";import{b as D,p as ne}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import{createHash as E}from"node:crypto";import f from"node:fs/promises";import h from"node:path";var se=15;function W(t){let r=[],e=[];t.loop?.stopped&&t.loop.message&&(r.push("loop-hard-stop"),e.push(t.loop.message)),t.pressure?.level==="critical"&&t.pressure.cue?(r.push("context-pressure-critical"),e.push(t.pressure.cue)):t.pressure?.level==="warn"&&t.pressure.cue&&(r.push("context-pressure-warn"),e.push(t.pressure.cue)),t.qualityInject?.trim()&&(r.push("quality-ledger"),e.push(t.qualityInject.trim()));let i=t.turns??0,n=t.stuckThreshold??se;if(!t.loop?.stopped&&i>=n&&(r.push("stuck-cycle"),e.push(`\u26A0 ${i} turns on this cycle and it is still open. If you are not nearly done, STOP looping: split it, ship the slice that works, or check in with the user \u2014 then \`prjct status done\`. A re-plan beats another grinding turn.`)),e.length===0)return{level:"ok",markdown:null,cues:[]};let s=r.some(a=>["loop-hard-stop","context-pressure-critical","context-pressure-warn"].includes(a)),o=r.some(a=>["quality-ledger","stuck-cycle"].includes(a)),d=s?"hard":o?"warn":"ok",p=d==="hard"?"# prjct: alignment (MUST \u2014 hard gate)":"# prjct: alignment (mid-cycle)",g=e.join(`
9
9
 
10
10
  `),c=r.includes("quality-ledger")&&!g.includes("prjct ship")?`
11
11
 
12
12
  _${H}_`:"";return{level:d,cues:r,markdown:`${p}
13
13
 
14
- ${g}${c}`}}l(W,"buildAlignmentCard");ie();ne();re();var Y=1500,J=15,C=8,X=420,oe=2,ce=15e3;var ae=new Set(["address","apply","check","continue","create","current","description","feedback","handle","merge","monitor","please","review","should","title","watch","write"]),j=new WeakMap,b=new Map;async function Z(t,r){let e=r!==void 0?r:await k.readConfig(t);if(!e?.projectId)return null;let i=ue(e,t),n=["# prjct: project state"];try{let o=await U(e.projectId,t);if(o.current){let p=ee(o.current.startedAt);n.push(`- Active work cycle: "${o.current.description}" (${p}) [${o.current.label}]`),(e.land?.mode??"advisory")!=="off"&&n.push(' \u21B3 Before session end: `prjct land` \xB7 hand-off `prjct remember context "Session close: \u2026"`');let{turns:g,loopVerdict:c,currentTask:a}=(()=>{try{let u=o.mainTaskRaw;return{turns:u?.turnCount??0,currentTask:u,loopVerdict:V(e,u)}}catch{return{turns:0,currentTask:null,loopVerdict:null}}})();!c?.stopped&&g<J&&n.push(" \u21B3 Stay on this goal. Each turn, before acting: is this step ADVANCING it? If you have hit the same wall twice, or you are exploring rather than progressing, STOP \u2014 re-plan, split the cycle, or ask the user. Do not loop; finish the cycle, then `prjct status done`.");try{let u=e.maxTokensPerCycle??0;if(u>0&&a){let m=(a.tokensIn??0)+(a.tokensOut??0);m>=u?n.push(` \u26A0 Token budget: ${m.toLocaleString()} of ${u.toLocaleString()} spent on this cycle. STOP growing it \u2014 ship the working slice, split the remainder into a new cycle, or check in with the user.`):m>=u*.8&&n.push(` \u21B3 Token budget: ${m.toLocaleString()} of ${u.toLocaleString()} (${Math.round(m/u*100)}%). Plan the close: prefer finishing over expanding scope.`)}}catch{}try{let u=o.current.startedAt;if(u){let m=R.get(e.projectId,`SELECT COUNT(DISTINCT json_extract(data, '$.file')) AS c
14
+ ${g}${c}`}}l(W,"buildAlignmentCard");ie();ne();re();var Y=1500,J=15,C=8,X=420,oe=2,ce=15e3;var ae=new Set(["address","apply","check","continue","create","current","description","feedback","handle","merge","monitor","please","review","should","title","watch","write"]),j=new WeakMap,b=new Map;async function Z(t,r){let e=r!==void 0?r:await v.readConfig(t);if(!e?.projectId)return null;let i=ue(e,t),n=["# prjct: project state"];try{let o=await U(e.projectId,t);if(o.current){let p=ee(o.current.startedAt);n.push(`- Active work cycle: "${o.current.description}" (${p}) [${o.current.label}]`),(e.land?.mode??"advisory")!=="off"&&n.push(' \u21B3 Before session end: `prjct land` \xB7 hand-off `prjct remember context "Session close: \u2026"`');let{turns:g,loopVerdict:c,currentTask:a}=(()=>{try{let u=o.mainTaskRaw;return{turns:u?.turnCount??0,currentTask:u,loopVerdict:V(e,u)}}catch{return{turns:0,currentTask:null,loopVerdict:null}}})();!c?.stopped&&g<J&&n.push(" \u21B3 Stay on this goal. Each turn, before acting: is this step ADVANCING it? If you have hit the same wall twice, or you are exploring rather than progressing, STOP \u2014 re-plan, split the cycle, or ask the user. Do not loop; finish the cycle, then `prjct status done`.");try{let u=e.maxTokensPerCycle??0;if(u>0&&a){let m=(a.tokensIn??0)+(a.tokensOut??0);m>=u?n.push(` \u26A0 Token budget: ${m.toLocaleString()} of ${u.toLocaleString()} spent on this cycle. STOP growing it \u2014 ship the working slice, split the remainder into a new cycle, or check in with the user.`):m>=u*.8&&n.push(` \u21B3 Token budget: ${m.toLocaleString()} of ${u.toLocaleString()} (${Math.round(m/u*100)}%). Plan the close: prefer finishing over expanding scope.`)}}catch{}try{let u=o.current.startedAt;if(u){let m=R.get(e.projectId,`SELECT COUNT(DISTINCT json_extract(data, '$.file')) AS c
15
15
  FROM events WHERE type = 'memory.post_edit' AND timestamp >= ?`,u)?.c??0,w=O(m);w&&n.push(` ${w}`)}}catch{}try{let u=F(e,a),m=L(e.projectId),w=W({loop:c,pressure:u,qualityInject:m,turns:g,stuckThreshold:J});w.markdown&&(n.push(""),n.push(w.markdown))}catch{}a?.ownerAgent&&n.push(`- Owner: ${a.ownerAgent}${a.ownerIdentity?`/${a.ownerIdentity}`:""}${a.yieldStatus==="yielded"?" (yielded \u2014 awaiting accept)":""}`)}let d=o.all.filter(p=>!p.isCurrent);d.length>0&&n.push(`- ${d.length} task(s) active in other workspace(s)`),!o.current&&d.length>0&&n.push("- This workspace idle but siblings busy \u2014 `prjct work` auto-isolates to a worktree when needed")}catch{}let s=await i;for(let o of s)o&&n.push(o);return n.length===1?null:n.join(`
16
- `)}l(Z,"buildProjectState");function ue(t,r){return Promise.all([(async()=>{try{let{formatPendingHandoffCue:e}=await import("./agent-switch-XMFUTNNV.mjs"),i=e(t.projectId);return i?`- ${i.replace(/\n/g,`
17
- - `)}`:null}catch{return null}})(),(async()=>{try{let e=await M.getActiveTasks(t.projectId);return e.length>0?`- Pending: ${e.length} \xB7 Next: "${e[0].description}"`:null}catch{return null}})(),(async()=>{try{if(!await G(h.join(r,".git")))return null;let e=await ge(r);if(!e.branch)return null;let i=[];e.modified>0&&i.push(`${e.modified} modified`),e.staged>0&&i.push(`${e.staged} staged`),e.untracked>0&&i.push(`${e.untracked} untracked`);let n=i.length>0?` \u2014 working tree ${i.join(", ")}`:"",s=e.ahead>0?`${n?",":" \u2014"} ${e.ahead} unpushed`:"";return`- Branch: ${e.branch}${n}${s}`}catch{return null}})(),(async()=>{try{let e=await _.getRecent(t.projectId,1);if(e.length===0)return null;let i=e[0],n=ee(i.shippedAt??"");return`- Last ship: ${i.version?`v${i.version}`:i.name} (${n})`}catch{return null}})(),(async()=>{try{let e=I.countByType(t.projectId,"inbox");return e>0?`- Inbox: ${e} items pending`:null}catch{return null}})()])}l(ue,"collectSecondarySignals");function le(t){return t.type==="voice"||t.type==="glossary"?!0:t.type==="example"&&!!t.tags.domain&&(t.tags.polarity==="good"||t.tags.polarity==="bad")}l(le,"isValidGuidanceEntry");function de(t,r){try{let e=A(r),i=x(r).filter(c=>c.length>=5&&!ae.has(c)),n=i.length>0?I.searchFts(t,i,C*2):[],s=e?I.recall(t,{types:["voice","glossary","example"],limit:C*2}).filter(c=>c.tags.domain==="delivery"||c.tags.domain===e):[],o=new Map([...n,...s].map(c=>[c.id,c])),d=new Map([["voice",0],["glossary",1],["example",2]]),p=[...o.values()].filter(le).sort((c,a)=>(d.get(c.type)??3)-(d.get(a.type)??3)).slice(0,oe);if(p.length===0)return null;let g=["# prjct: selective guidance"];for(let c of p){let a=c.type==="example"?` ${c.tags.polarity}/${c.tags.domain}`:c.tags.domain?` ${c.tags.domain}`:"",u=X-g.join(`
18
- `).length-a.length-8;if(u<24)break;let m=S(c.content.replace(/\s+/g," ").trim(),Math.min(150,u));g.push(`- ${c.type}${a}: ${m}`)}return g.length===1?null:{text:S(g.join(`
16
+ `)}l(Z,"buildProjectState");function ue(t,r){return Promise.all([(async()=>{try{let{formatPendingHandoffCue:e}=await import("./agent-switch-2U2LOBGR.mjs"),i=e(t.projectId);return i?`- ${i.replace(/\n/g,`
17
+ - `)}`:null}catch{return null}})(),(async()=>{try{let e=await M.getActiveTasks(t.projectId);return e.length>0?`- Pending: ${e.length} \xB7 Next: "${e[0].description}"`:null}catch{return null}})(),(async()=>{try{if(!await G(h.join(r,".git")))return null;let e=await ge(r);if(!e.branch)return null;let i=[];e.modified>0&&i.push(`${e.modified} modified`),e.staged>0&&i.push(`${e.staged} staged`),e.untracked>0&&i.push(`${e.untracked} untracked`);let n=i.length>0?` \u2014 working tree ${i.join(", ")}`:"",s=e.ahead>0?`${n?",":" \u2014"} ${e.ahead} unpushed`:"";return`- Branch: ${e.branch}${n}${s}`}catch{return null}})(),(async()=>{try{let e=await _.getRecent(t.projectId,1);if(e.length===0)return null;let i=e[0],n=ee(i.shippedAt??"");return`- Last ship: ${i.version?`v${i.version}`:i.name} (${n})`}catch{return null}})(),(async()=>{try{let e=I.countByType(t.projectId,"inbox");return e>0?`- Inbox: ${e} items pending`:null}catch{return null}})()])}l(ue,"collectSecondarySignals");function le(t){return t.type==="voice"||t.type==="glossary"?!0:t.type==="example"&&!!t.tags.domain&&(t.tags.polarity==="good"||t.tags.polarity==="bad")}l(le,"isValidGuidanceEntry");function de(t,r){try{let e=A(r),i=T(r).filter(c=>c.length>=5&&!ae.has(c)),n=i.length>0?I.searchFts(t,i,C*2):[],s=e?I.recall(t,{types:["voice","glossary","example"],limit:C*2}).filter(c=>c.tags.domain==="delivery"||c.tags.domain===e):[],o=new Map([...n,...s].map(c=>[c.id,c])),d=new Map([["voice",0],["glossary",1],["example",2]]),p=[...o.values()].filter(le).sort((c,a)=>(d.get(c.type)??3)-(d.get(a.type)??3)).slice(0,oe);if(p.length===0)return null;let g=["# prjct: selective guidance"];for(let c of p){let a=c.type==="example"?` ${c.tags.polarity}/${c.tags.domain}`:c.tags.domain?` ${c.tags.domain}`:"",u=X-g.join(`
18
+ `).length-a.length-8;if(u<24)break;let m=k(c.content.replace(/\s+/g," ").trim(),Math.min(150,u));g.push(`- ${c.type}${a}: ${m}`)}return g.length===1?null:{text:k(g.join(`
19
19
  `),X),memoryIds:p.slice(0,g.length-1).map(c=>c.id)}}catch{return null}}l(de,"buildSelectiveGuidance");function pe(t,r){if(!r)return t;let e=t?`${t}
20
20
 
21
- ${r}`:r;return e.length<=Y?e:null}l(pe,"appendPromptSection");function Q(t,r){try{let e=x(r);if(e.length===0)return null;let i=I.searchFts(t,e,C),n=i.find(s=>s.type==="decision"||s.type==="gotcha"||s.type==="fact")??i.find(s=>s.type==="anti-pattern"||s.type==="pattern")??i.find(s=>s.type==="gotcha"||s.type==="anti-pattern");return n?n.type==="decision"||n.type==="gotcha"||n.type==="fact"?{cue:`> Tip\u2192user (SoT): ${v(n)} \`${n.id}\` \u2014 say it briefly in chat; binding \u2014 do not contradict without superseding`,memoryId:n.id}:n.type==="anti-pattern"||n.type==="pattern"?{cue:`> Tip\u2192user (suggest): ${v(n)} \`${n.id}\` \u2014 propose the live change in chat, then apply when editing`,memoryId:n.id}:{cue:`> Tip\u2192user: ${v(n)} \`${n.id}\``,memoryId:n.id}:null}catch{return null}}l(Q,"buildTopicalCueResult");function Ke(t,r,e){return Q(t,r)?.cue??null}l(Ke,"buildTopicalCue");var y=new Map,P={skipDiskSnapshotOnce:!1};function We(){y.clear(),P.skipDiskSnapshotOnce=!0}l(We,"_resetGitSnapshotCacheForTests");async function ge(t){let r=await f.stat(h.join(t,".git","index")).then(o=>o.mtimeMs).catch(()=>0),e=y.get(t);if(e&&e.expiresAt>Date.now()&&e.indexMtimeMs===r)return e.snapshot;let i=me(t);if(!e&&!P.skipDiskSnapshotOnce){let o=await f.readFile(i,"utf-8").then(d=>JSON.parse(d)).catch(()=>null);if(o&&o.expiresAt>Date.now()&&o.indexMtimeMs===r)return y.set(t,o),o.snapshot}P.skipDiskSnapshotOnce=!1;let n=await ye(t);y.size>32&&y.clear();let s={snapshot:n,expiresAt:Date.now()+ce,indexMtimeMs:r};return y.set(t,s),f.mkdir(h.dirname(i),{recursive:!0}).then(()=>f.writeFile(i,JSON.stringify(s))).catch(()=>{}),n}l(ge,"captureGit");function me(t){let r=E("sha1").update(h.resolve(t)).digest("hex").slice(0,16);return h.join($.runDir(),`prompt-git-${r}.json`)}l(me,"gitSnapshotPath");function he(t,r){let e=E("sha1").update(h.resolve(r)).digest("hex").slice(0,12);return`${t.replace(/[^a-zA-Z0-9._-]/g,"_")}-${e}`}l(he,"promptHashKey");async function fe(t,r,e){let i=he(t,r),n=E("sha256").update(e).digest("hex");if(b.get(i)===n)return null;b.size>64&&b.clear(),b.set(i,n);let s=h.join($.runDir(),`prompt-state-${i}.hash`);return(await f.readFile(s,"utf-8").catch(()=>"")).trim()===n?null:(await f.mkdir(h.dirname(s),{recursive:!0}).then(()=>f.writeFile(s,n)).catch(()=>{}),e)}l(fe,"dedupePromptPayload");async function ye(t){let r={branch:"",modified:0,staged:0,untracked:0,ahead:0},e=l(async c=>{try{return(await D("git",c,{cwd:t,timeout:2e3})).stdout.trim()}catch{return""}},"safe"),[i,n,s]=await Promise.all([e(["branch","--show-current"]),e(["status","--porcelain"]),e(["rev-list","--count","@{u}..HEAD"])]);if(!i)return r;let{modified:o,staged:d,untracked:p}=n.split(`
22
- `).filter(Boolean).reduce((c,a)=>{let u=a.slice(0,2);return u.startsWith("??")?c.untracked++:(u[0]!==" "&&u[0]!=="?"&&c.staged++,u[1]!==" "&&c.modified++),c},{modified:0,staged:0,untracked:0}),g=Number.parseInt(s,10)||0;return{branch:i,modified:o,staged:d,untracked:p,ahead:g}}l(ye,"captureGitUncached");function ee(t){if(!t)return"unknown";let r=Date.parse(t);if(Number.isNaN(r))return"unknown";let e=Math.max(0,Math.floor((Date.now()-r)/864e5));return e<1?"today":e<2?"yesterday":e<30?`${e}d ago`:`${Math.floor(e/30)}mo ago`}l(ee,"formatRelative");function te(t,r,e){let i=Q(t,r),n=N(t,r),s=z(r),o=de(t,r),d=[i?.cue,s,o?.text,n].filter(a=>!!a).reduce((a,u)=>pe(a,u)??a,S(e,Y)),p=!!(o?.text&&d.includes(o.text)),c=!!(s&&d.includes(s))?`delivery:${A(r)??"unknown"}`:p?o?.memoryIds[0]??null:null;return{prioritized:d,cueResult:i,guidance:o,guidanceIncluded:p,guidanceRuleId:c}}l(te,"computePromptGuidance");function Je(t=process.cwd(),r){return q({event:"UserPromptSubmit",projectPath:t,build:l(async(e,i)=>{let n=(e.prompt??"").trim();if(!n)return null;let s=await k.readConfig(i);if(!s?.projectId)return null;let o=await Z(i,s);if(!o)return null;let{prioritized:d,cueResult:p,guidance:g,guidanceIncluded:c,guidanceRuleId:a}=te(s.projectId,n,o);return j.set(e,{projectId:s.projectId,projectPath:i,bumpTurn:o.includes("Active work cycle:"),surfacedIds:[...p?[p.memoryId]:[],...c?g?.memoryIds??[]:[]],guidanceRuleId:a}),fe(s.projectId,i,d)},"build"),afterEmit:l(async(e,i)=>{let n=j.get(e)??await we(e,i);j.delete(e),n&&await Promise.all([n.bumpTurn?T.bumpTurnCount(n.projectId).then(()=>{}):Promise.resolve(),n.surfacedIds.length>0?B(n.projectId,n.projectPath,n.surfacedIds):Promise.resolve(),n.guidanceRuleId?Promise.resolve(K.recordGuidanceActivation(n.projectId,{ruleId:n.guidanceRuleId})).then(()=>{}):Promise.resolve()])},"afterEmit")},r)}l(Je,"runPromptHook");async function we(t,r){let e=(t.prompt??"").trim();if(!e)return null;let i=await k.readConfig(r).catch(()=>null);if(!i?.projectId)return null;let[n,s]=await Promise.all([T.getCurrentTask(i.projectId).catch(()=>null),Z(r,i)]),{cueResult:o,guidance:d,guidanceIncluded:p,guidanceRuleId:g}=te(i.projectId,e,s??"");return{projectId:i.projectId,projectPath:r,bumpTurn:!!n,surfacedIds:[...o?[o.memoryId]:[],...p?d?.memoryIds??[]:[]],guidanceRuleId:g}}l(we,"rebuildPromptAfterEmit");export{We as _resetGitSnapshotCacheForTests,z as buildDeliveryGuidance,Z as buildProjectState,de as buildSelectiveGuidance,Ke as buildTopicalCue,A as classifyDeliveryIntent,Je as runPromptHook};
21
+ ${r}`:r;return e.length<=Y?e:null}l(pe,"appendPromptSection");function Q(t,r){try{let e=T(r);if(e.length===0)return null;let i=I.searchFts(t,e,C),n=i.find(s=>s.type==="decision"||s.type==="gotcha"||s.type==="fact")??i.find(s=>s.type==="anti-pattern"||s.type==="pattern")??i.find(s=>s.type==="gotcha"||s.type==="anti-pattern");return n?n.type==="decision"||n.type==="gotcha"||n.type==="fact"?{cue:`> Tip\u2192user (SoT): ${S(n)} \`${n.id}\` \u2014 say it briefly in chat; binding \u2014 do not contradict without superseding`,memoryId:n.id}:n.type==="anti-pattern"||n.type==="pattern"?{cue:`> Tip\u2192user (suggest): ${S(n)} \`${n.id}\` \u2014 propose the live change in chat, then apply when editing`,memoryId:n.id}:{cue:`> Tip\u2192user: ${S(n)} \`${n.id}\``,memoryId:n.id}:null}catch{return null}}l(Q,"buildTopicalCueResult");function Ke(t,r,e){return Q(t,r)?.cue??null}l(Ke,"buildTopicalCue");var y=new Map,P={skipDiskSnapshotOnce:!1};function We(){y.clear(),P.skipDiskSnapshotOnce=!0}l(We,"_resetGitSnapshotCacheForTests");async function ge(t){let r=await f.stat(h.join(t,".git","index")).then(o=>o.mtimeMs).catch(()=>0),e=y.get(t);if(e&&e.expiresAt>Date.now()&&e.indexMtimeMs===r)return e.snapshot;let i=me(t);if(!e&&!P.skipDiskSnapshotOnce){let o=await f.readFile(i,"utf-8").then(d=>JSON.parse(d)).catch(()=>null);if(o&&o.expiresAt>Date.now()&&o.indexMtimeMs===r)return y.set(t,o),o.snapshot}P.skipDiskSnapshotOnce=!1;let n=await ye(t);y.size>32&&y.clear();let s={snapshot:n,expiresAt:Date.now()+ce,indexMtimeMs:r};return y.set(t,s),f.mkdir(h.dirname(i),{recursive:!0}).then(()=>f.writeFile(i,JSON.stringify(s))).catch(()=>{}),n}l(ge,"captureGit");function me(t){let r=E("sha1").update(h.resolve(t)).digest("hex").slice(0,16);return h.join(x.runDir(),`prompt-git-${r}.json`)}l(me,"gitSnapshotPath");function he(t,r){let e=E("sha1").update(h.resolve(r)).digest("hex").slice(0,12);return`${t.replace(/[^a-zA-Z0-9._-]/g,"_")}-${e}`}l(he,"promptHashKey");async function fe(t,r,e){let i=he(t,r),n=E("sha256").update(e).digest("hex");if(b.get(i)===n)return null;b.size>64&&b.clear(),b.set(i,n);let s=h.join(x.runDir(),`prompt-state-${i}.hash`);return(await f.readFile(s,"utf-8").catch(()=>"")).trim()===n?null:(await f.mkdir(h.dirname(s),{recursive:!0}).then(()=>f.writeFile(s,n)).catch(()=>{}),e)}l(fe,"dedupePromptPayload");async function ye(t){let r={branch:"",modified:0,staged:0,untracked:0,ahead:0},e=l(async c=>{try{return(await D("git",c,{cwd:t,timeout:2e3})).stdout.trim()}catch{return""}},"safe"),[i,n,s]=await Promise.all([e(["branch","--show-current"]),e(["status","--porcelain"]),e(["rev-list","--count","@{u}..HEAD"])]);if(!i)return r;let{modified:o,staged:d,untracked:p}=n.split(`
22
+ `).filter(Boolean).reduce((c,a)=>{let u=a.slice(0,2);return u.startsWith("??")?c.untracked++:(u[0]!==" "&&u[0]!=="?"&&c.staged++,u[1]!==" "&&c.modified++),c},{modified:0,staged:0,untracked:0}),g=Number.parseInt(s,10)||0;return{branch:i,modified:o,staged:d,untracked:p,ahead:g}}l(ye,"captureGitUncached");function ee(t){if(!t)return"unknown";let r=Date.parse(t);if(Number.isNaN(r))return"unknown";let e=Math.max(0,Math.floor((Date.now()-r)/864e5));return e<1?"today":e<2?"yesterday":e<30?`${e}d ago`:`${Math.floor(e/30)}mo ago`}l(ee,"formatRelative");function te(t,r,e){let i=Q(t,r),n=N(t,r),s=z(r),o=de(t,r),d=[i?.cue,s,o?.text,n].filter(a=>!!a).reduce((a,u)=>pe(a,u)??a,k(e,Y)),p=!!(o?.text&&d.includes(o.text)),c=!!(s&&d.includes(s))?`delivery:${A(r)??"unknown"}`:p?o?.memoryIds[0]??null:null;return{prioritized:d,cueResult:i,guidance:o,guidanceIncluded:p,guidanceRuleId:c}}l(te,"computePromptGuidance");function Je(t=process.cwd(),r){return q({event:"UserPromptSubmit",projectPath:t,build:l(async(e,i)=>{let n=(e.prompt??"").trim();if(!n)return null;let s=await v.readConfig(i);if(!s?.projectId)return null;let o=await Z(i,s);if(!o)return null;let{prioritized:d,cueResult:p,guidance:g,guidanceIncluded:c,guidanceRuleId:a}=te(s.projectId,n,o);return j.set(e,{projectId:s.projectId,projectPath:i,bumpTurn:o.includes("Active work cycle:"),surfacedIds:[...p?[p.memoryId]:[],...c?g?.memoryIds??[]:[]],guidanceRuleId:a}),fe(s.projectId,i,d)},"build"),afterEmit:l(async(e,i)=>{let n=j.get(e)??await we(e,i);j.delete(e),n&&await Promise.all([n.bumpTurn?$.bumpTurnCount(n.projectId).then(()=>{}):Promise.resolve(),n.surfacedIds.length>0?B(n.projectId,n.projectPath,n.surfacedIds):Promise.resolve(),n.guidanceRuleId?Promise.resolve(K.recordGuidanceActivation(n.projectId,{ruleId:n.guidanceRuleId})).then(()=>{}):Promise.resolve()])},"afterEmit")},r)}l(Je,"runPromptHook");async function we(t,r){let e=(t.prompt??"").trim();if(!e)return null;let i=await v.readConfig(r).catch(()=>null);if(!i?.projectId)return null;let[n,s]=await Promise.all([$.getCurrentTask(i.projectId).catch(()=>null),Z(r,i)]),{cueResult:o,guidance:d,guidanceIncluded:p,guidanceRuleId:g}=te(i.projectId,e,s??"");return{projectId:i.projectId,projectPath:r,bumpTurn:!!n,surfacedIds:[...o?[o.memoryId]:[],...p?d?.memoryIds??[]:[]],guidanceRuleId:g}}l(we,"rebuildPromptAfterEmit");export{We as _resetGitSnapshotCacheForTests,z as buildDeliveryGuidance,Z as buildProjectState,de as buildSelectiveGuidance,Ke as buildTopicalCue,A as classifyDeliveryIntent,Je as runPromptHook};
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
5
5
  const require = __createRequire(import.meta.url);
6
6
  const __filename = __fileURLToPath(import.meta.url);
7
7
  const __dirname = __pathDirname(__filename);
8
- import{a,b}from"./chunk-DMXFGLZE.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as epochWeek,b as velocityStorage};
8
+ import{a,b}from"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as publishCRUD,b as publishCRUDSync};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b,c,d,e,f,g,h,i,j}from"./chunk-NWZEBCTC.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{d as AUTO_SOURCE_PREFIXES,b as DEFAULT_ARCHIVE_PRUNE_DAYS,c as DEFAULT_AUTO_SOURCE_MAX_LIVE,a as DEFAULT_SOFT_DELETED_PURGE_DAYS,e as isAutoSource,g as purgeOrphanRememberEvents,f as purgeSoftDeleted,j as runVaultPurge,h as trimAutoSourceCap,i as vaultHealth};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{b as k}from"./chunk-GFY4GY3Z.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{b as P}from"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import{b as O,c as U}from"./chunk-QPRNRLG6.mjs";import{a as Y}from"./chunk-TKWAFYF7.mjs";import"./chunk-7JEKBJAP.mjs";import{a as Z,b as j,c as S,d as ee,e as te,f as C,g as T,h as ne,i as re}from"./chunk-MHQTGU45.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import{a as I,h as L}from"./chunk-DXQMKW2B.mjs";import{a as H,e as G,f as z,g as J,h as q,i as K,j as Q}from"./chunk-NWZEBCTC.mjs";import{a as x}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import{c as A}from"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{a as w,b as V,e as D,g as B}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import{b as M,g as F}from"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";V();B();var W=new Set(["decision","gotcha","learning","feedback","fact","shipped","spec"]),se=30,oe=50,ie=20,ce=45,ae=25,de=15,ue=180,$=90,le=25,pe=.12,me=40,fe=40,he=30,ge=20,xe=35,Ee=.12,ye=864e5,Re=100,ve=50,be=25,_e=15,De=/\b[\w.-]+(?:\/[\w.-]+)+\.(?:ts|tsx|js|jsx|mjs|cjs|json|md|sh|toml|yml|yaml)\b/g;function Ae(e,t){let o=x.allEntriesForIndex(e),r=new Set;for(let c of o)for(let l of O(c.tags))r.add(l);let n=(()=>{try{let c=P(e);return c?new Set(Object.keys(c.documents)):null}catch{return null}})(),a=S(o),i=C(a);return{entries:o,usefulness:U.decayedScores(e,t),supersededIds:F(o),correctedIds:r,indexedPaths:n,nowMs:t,refIndex:i}}p(Ae,"collectRetentionInputs");function Se(e){let t=new Map,o=new Set,r=[...e].sort((n,a)=>a.rememberedAt.localeCompare(n.rememberedAt));for(let n of r){let a=w(n.content);t.has(a)?o.add(n.id):t.set(a,n)}return o}p(Se,"collectDuplicateIds");function Me(e,t){let o=e.content.match(De);return!o||o.length===0?!1:!o.some(r=>t.has(r))}p(Me,"isUngrounded");function Ie(e,t,o){let r=[],n=T(e.content,t.refIndex,e.id),a=o.has(e.id);a&&!n.exactDup&&r.push("duplicate of newer entry"),r.push(`excess ${n.excess.toFixed(2)} (sim ${n.maxSim.toFixed(2)})`);let i=n.exactDup||n.nearDup||n.excess<Ee;i&&r.push(n.exactDup?`exact dup of ${n.nearestId}`:n.nearDup?`near-dup of ${n.nearestId}`:"low excess vs reference");let c=t.usefulness.get(e.id)??0,l=Math.min(ae,Math.max(0,c*8));c>0&&r.push(`used (+${Math.round(l)})`);let u=Math.max(0,(t.nowMs-Date.parse(e.rememberedAt))/ye),h=Number.isFinite(u)?Math.max(0,de*(1-u/ue)):0,s=c<=0&&Number.isFinite(u)&&u>$?Math.min(le,(u-$)*pe):0;s>0&&r.push(`idle ${Math.round(u)}d`);let f=t.supersededIds.has(e.id);f&&r.push("superseded");let m=t.correctedIds.has(e.id);m&&r.push("corrected");let b=!M(e)||k(e);b&&r.push("generated noise");let E=!!(t.indexedPaths&&Me(e,t.indexedPaths));E&&r.push("cites files missing at HEAD");let g=Math.max(0,Math.min(100,n.excess*ce+l+h-(i?xe:0)-s-(f?me:0)-(m?fe:0)-(b?he:0)-(E?ge:0)-(a?20:0))),R=g>=oe?"active":g>=ie?"archive":"delete",_=a||n.exactDup||n.nearDup||f,y=R!=="active"&&u<se&&!_?"active":R;y!==R&&r.push("grace period");let d=y==="delete"&&W.has(e.type)?"archive":y;return d!==y&&r.push("protected type"),{id:e.id,type:e.type,verdict:d,score:Math.round(g),reasons:r,excess:n.excess,maxSim:n.maxSim,nearestId:n.nearestId}}p(Ie,"scoreEntry");function X(e,t){let o=Ae(e,t),r=Se(o.entries),n={evaluated:o.entries.length,active:0,archive:0,delete:0,referenceSize:o.refIndex.entries.length,flagged:[],byId:new Map};for(let a of o.entries){let i=Ie(a,o,r);n[i.verdict]++,n.byId.set(i.id,i),i.verdict!=="active"&&n.flagged.push(i)}return n.flagged.sort((a,i)=>a.score-i.score),n}p(X,"evaluateRetention");function Be(e,t){return!(!M(e)||e.content.trim().length===0||t&&t.verdict!=="active"||t&&t.excess!==void 0&&t.excess<.05)}p(Be,"shouldEmbedEntry");function v(e,t){if(t.startsWith("ship_"))return Ce(e,t);if(x.forget(e,t))return!0;try{return(D.run(e,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),t).changes??0)>0}catch{return!1}}p(v,"forgetEntry");function N(e){return e.startsWith("mem_")||e.startsWith("ship_")||/^\d+$/.test(e)}p(N,"isRetentionRemovableId");function Ce(e,t){let o=t.startsWith("ship_")?t.slice(5):t;if(!o)return!1;try{let r=D.get(e,"SELECT * FROM shipped_features WHERE id = ?",o);if(!r)return!1;try{A.archive(e,{entityType:"shipped",entityId:o,entityData:r,summary:`retention archive shipped [${r.name}]`,reason:"retention-archive"})}catch{}return(D.run(e,"DELETE FROM shipped_features WHERE id = ?",o).changes??0)>0}catch{return!1}}p(Ce,"forgetShippedFeature");function Te(e,t={}){let o=t.dryRun===!0,r=t.nowMs??Date.now(),n=t.maxArchive??Re,a=t.maxDelete??ve,i=X(e,r),c=i.flagged.filter(s=>s.verdict==="archive"&&N(s.id)),l=i.flagged.filter(s=>s.verdict==="delete"&&N(s.id)),u=i.flagged.filter(s=>(s.verdict==="archive"||s.verdict==="delete")&&!N(s.id)).length,h=o?{archived:0,deleted:0,skipped:u}:(()=>{let s=c.slice(0,n),f=s.map(d=>{if(!d.id.startsWith("ship_"))try{A.archive(e,{entityType:"memory_entry",entityId:d.id,entityData:{id:d.id,type:d.type,score:d.score,excess:d.excess,reasons:d.reasons,verdict:d.verdict},summary:`retention archive [${d.type}] excess=${d.excess?.toFixed(2)??"?"} score=${d.score}`,reason:"retention-archive"})}catch{}return v(e,d.id)}),m=f.filter(Boolean).length,b=Math.max(0,c.length-s.length)+f.filter(d=>!d).length,E=l.slice(0,a),g=E.filter(d=>!W.has(d.type)).map(d=>d.id),R=E.length-g.length,_=g.length>0?Y(e,g):0,y=Math.max(0,l.length-E.length)+R+g.length-_;return{archived:m,deleted:_,skipped:u+b+y}})();return{evaluated:i.evaluated,active:i.active,wouldArchive:c.length,wouldDelete:l.length,archived:h.archived,deleted:h.deleted,skipped:h.skipped,dryRun:o,samples:i.flagged.slice(0,10),referenceSize:i.referenceSize}}p(Te,"applyRetention");function He(e){return Te(e,{maxArchive:be,maxDelete:_e})}p(He,"applyRetentionIncremental");function Ge(e,t={}){let o=t.max??50,r=t.types??["inbox","context","idea","todo","question","gotcha","spec"],n=[],a=[];try{let i=x.allEntriesForIndex(e);for(let c of i){if(n.length>=o)break;if(!r.includes(c.type))continue;let l=I(c.content,c.type),u=L(c.content,c.type);(l.junk||u.action==="refuse"||c.type==="gotcha"&&u.action==="demote")&&v(e,c.id)&&(n.push(c),a.length<8&&a.push(`${c.id}:${l.junk?l.reason:u.reasonCode}`))}}catch{return{forgotten:0,samples:[]}}return{forgotten:n.length,samples:a}}p(Ge,"forgetJunkCaptures");function ze(e,t=Date.now()){let r=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(r.length===0)return{merged:0,archived:0,junkForgotten:0};let n=r.filter(s=>I(s.content,s.type).junk&&v(e,s.id)).length,a=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(a.length===0)return{merged:0,archived:0,junkForgotten:n};let i=S(x.allEntriesForIndex(e)),c=C(i),l=X(e,t),u=[],h=[];for(let s of a){let f=T(s.content,c);if(f.exactDup||f.nearDup||f.excess<.15){v(e,s.id)&&u.push(s.id);continue}let m=l.byId.get(s.id);if(m&&m.verdict!=="active"){try{A.archive(e,{entityType:"memory_entry",entityId:s.id,entityData:{id:s.id,type:"inbox",score:m.score,excess:m.excess,reasons:m.reasons},summary:`inbox triage excess=${m.excess?.toFixed(2)??"?"}`,reason:"retention-inbox"})}catch{}v(e,s.id)&&h.push(s.id)}}return{merged:u.length,archived:h.length,junkForgotten:n}}p(ze,"triageInbox");export{te as CAPTURE_MIN_EXCESS,H as DEFAULT_SOFT_DELETED_PURGE_DAYS,ee as NEAR_DUP_SIM,W as PROTECTED_TYPES,Z as REFERENCE_CAP,Te as applyRetention,He as applyRetentionIncremental,S as buildReferenceModel,re as captureGate,Se as collectDuplicateIds,Ae as collectRetentionInputs,ne as computeExcess,X as evaluateRetention,Ge as forgetJunkCaptures,Ce as forgetShippedFeature,G as isAutoSource,j as isReferenceEligible,N as isRetentionRemovableId,J as purgeOrphanRememberEvents,z as purgeSoftDeleted,Q as runVaultPurge,Ie as scoreEntry,Be as shouldEmbedEntry,ze as triageInbox,q as trimAutoSourceCap,K as vaultHealth};
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{h as S}from"./chunk-2HB2JHQE.mjs";import"./chunk-XE4MJNBQ.mjs";import"./chunk-C3W2HLJT.mjs";import{a as v,b as u}from"./chunk-NHIWYDQD.mjs";import{a as f}from"./chunk-X2AGNDGD.mjs";import{a as k,d as w}from"./chunk-F4T7IAA7.mjs";import"./chunk-H4CA3XZ6.mjs";import{a as l}from"./chunk-4O4D6DV7.mjs";import"./chunk-JCYXFHQZ.mjs";import"./chunk-JPSJWCFD.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-JUZ5LNDI.mjs";import"./chunk-7O6OMD4X.mjs";import"./chunk-OZJ6UKKP.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-FX6VHIKB.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-OENWCYLF.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as g}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var a=["off","advisory","strict"],$=[{key:"spec drafted",reached:i(()=>!0,"reached")},{key:"audit-spec passed (reviewed)",reached:i(n=>n!=="draft","reached")},{key:"task linked",reached:i(n=>n==="in_progress"||n==="shipped","reached")},{key:"shipped",reached:i(n=>n==="shipped","reached")}],D=class extends w{static{i(this,"SddCommands")}async sdd(e=null,t=process.cwd(),o={}){let s=v(e,a);return s.kind==="status"?this.showStatus(t,o):s.kind==="mode"?this.setMode(s.mode,t,o):k(`Unknown sdd subcommand "${s.sub}". Use: ${a.join("|")}.`,o)}async showStatus(e,t){let o=await u(e,t);if(!o.ok)return o.result;let s=o.value,r=M(s),c=await(async()=>{try{let p=await S(s.projectId,e);if(p?.linkedSpecId){let{specService:h}=await import("./spec-service-LAO5Z2M5.mjs"),d=await h.get(e,p.linkedSpecId);if(d)return{specLine:`Active spec: \`${d.title}\` (${d.status})`,station:$.map(y=>`${y.reached(d.status)?"\u2713":"\u25CB"} ${y.key}`).join(" ")}}else if(p)return{specLine:"Active work cycle has NO linked spec",station:"no active work cycle"};return{specLine:"Active spec: none",station:"no active work cycle"}}catch{return{specLine:"Active spec: none",station:"no active work cycle"}}})(),m=[`Mode: ${r}${r==="off"?" (pipeline stays escalate-only)":""}`,c.specLine,`Pipeline: ${c.station}`,"Set: prjct sdd off|advisory|strict"];return t.md?console.log(f("## SDD",`> **Mode**: \`${r}\``,m.slice(1).join(`
9
+ `))):l.info(`SDD \u2014 ${m.join(`
10
+ `)}`),{success:!0,mode:r}}async setMode(e,t,o){let s=await u(t,o);if(!s.ok)return s.result;let r=s.value;r.sdd={mode:e},await g.writeConfig(t,r);let c=e==="off"?"SDD mode off \u2014 the spec pipeline stays escalate-only (no gating).":e==="advisory"?"SDD mode \u2192 advisory. The skill nudges toward a spec for complex work; `ship` surfaces acceptance criteria.":"SDD mode \u2192 strict. Every `prjct work` cycle must link a REVIEWED intent/spec, and `ship` blocks unspecced work (override: `prjct ship --no-spec-gate`).";return o.md?console.log(f("## SDD",`> ${c}`)):l.done(c),{success:!0,mode:e}}};function M(n){let e=n?.sdd?.mode;if(e&&a.includes(e))return e;let t=process.env.PRJCT_SDD_MODE?.toLowerCase();return t&&a.includes(t)?t:"off"}i(M,"effectiveSddMode");var b={effectiveSddMode:M,SDD_MODES:a};export{D as SddCommands,b as _internal,M as effectiveSddMode};
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a as d}from"./chunk-5TBQNW2G.mjs";import"./chunk-TXJT3G53.mjs";import{a as u}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as l,g as y}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{b as p,h as g}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as r}from"./chunk-E66B27AL.mjs";y();g();function c(){return"Context tiers: L0 always \xB7 L1 session/prime \xB7 L2 pull (search/guard/MCP) \xB7 L3 cold \u2014 never stuff L2 into L0."}r(c,"contextTiersOneLiner");var a="session:continuity",f="session-close",x=10080*60*1e3;function R(e){let t=d(e.config??null,{turnCount:e.turns??void 0,tokensIn:e.tokensIn??void 0,tokensOut:e.tokensOut??void 0,description:e.cycleDescription??void 0}),n=[];e.cycleId||e.cycleDescription?(n.push("Resume open cycle with `prjct prime` then continue work (or `prjct status done` if finished)."),n.push('Journal progress: `prjct log "what you tried"`.')):n.push('No open cycle \u2014 `prjct work "<intent>"` or `prjct next --md` for frontier.'),n.push("Pull L2 on demand: `prjct search` / `prjct guard` / MCP \u2014 never stuff into L0."),n.push("Audit gates: `prjct context artifacts --md`.");let o=e.handoffContent?.trim()?e.handoffContent.trim().slice(0,280):null,s={version:1,landedAt:p(),projectId:e.projectId,cycleId:e.cycleId??null,cycleDescription:e.cycleDescription??null,turns:e.turns??null,tokensIn:e.tokensIn??null,tokensOut:e.tokensOut??null,pressureLevel:t.level==="ok"?e.turns?"ok":null:t.level,handoffWrote:!!e.handoffWrote,receiptWrote:!!e.receiptWrote,nextActions:n,handoffPreview:o};return l.setDoc(e.projectId,a,s),s}r(R,"stampSessionContinuity");function E(e){try{let t=l.getDoc(e,a);return!t||t.version!==1||!t.landedAt?null:t}catch{return null}}r(E,"loadSessionContinuity");function m(e,t=Date.now()){if(!e?.landedAt)return!1;let n=Date.parse(e.landedAt);return Number.isFinite(n)?t-n<=x:!1}r(m,"isContinuityFresh");function B(e){try{let t=u.searchFts(e,["session","close","land-auto"],12);for(let o of t){if(o.type!=="context")continue;let s=o.tags??{};if(s.topic===f||s.source==="land-auto"||o.content.startsWith("Session close:"))return o.content}let n=u.recall(e,{types:["context"],limit:8});for(let o of n){let s=o.tags??{};if(s.topic===f||s.source==="land-auto"||o.content.startsWith("Session close:"))return o.content}}catch{}return null}r(B,"loadLastSessionCloseContent");function W(e){let t=["# Managed session resume","","_Local continuity (Claude Managed Agents pattern without hosting the model). Land stamps SoT; prime restores it._",""],n=e.stamp;if(n&&m(n)){let i=h(n.landedAt);t.push(`**Last land:** ${n.landedAt.slice(0,19)} (${i})`),t.push(`- Hand-off: ${n.handoffWrote?"written":"none"} \xB7 Receipt: ${n.receiptWrote?"written":"none"}`),n.turns!=null&&t.push(`- Last cycle budget signal: turns=${n.turns}`+(n.tokensIn!=null||n.tokensOut!=null?` \xB7 tokens in=${n.tokensIn??0} out=${n.tokensOut??0}`:"")+(n.pressureLevel?` \xB7 pressure=${n.pressureLevel}`:"")),t.push("")}else n?(t.push(`**Last land:** ${n.landedAt.slice(0,19)} (stale >7d) \u2014 treat as historical; re-land after work.`),t.push("")):(t.push("**No land stamp yet.** After meaningful work run `prjct land` so the next window resumes cleanly."),t.push(""));let o=e.liveCycleDescription??n?.cycleDescription;if(o){if(t.push(`**Active / last cycle:** ${o}`),e.liveCycleId&&t.push(`- id: \`${e.liveCycleId.slice(0,8)}\``),e.journal&&e.journal.length>0){t.push("**Journal (recent):**");for(let i of e.journal)t.push(`- ${i.slice(0,120)}`)}t.push("")}else t.push("**No open cycle** on this workspace."),t.push("");let s=e.sessionCloseContent??n?.handoffPreview;if(s){t.push("## Last session hand-off"),t.push("");let i=s.length>900?`${s.slice(0,897)}\u2026`:s;t.push(i),t.push(""),t.push("_Full entry: `prjct context memory session-close` / topic `session-close`._"),t.push("")}if(e.pendingHandoffCue&&(t.push("## Multi-agent handoff"),t.push(""),t.push(e.pendingHandoffCue),t.push("")),n?.nextActions?.length){t.push("## Next actions"),t.push("");for(let i of n.nextActions)t.push(`- ${i}`);t.push("")}return t.push("## Context diet"),t.push(""),t.push(c()),t.push(""),t.push("Default surface: `work` + `ship` (user text confirm). Deeper: `prjct brief` \xB7 `prjct search` \xB7 `prjct guard` \xB7 `prjct context artifacts --md`."),t.join(`
9
+ `)}r(W,"formatSessionResumeCard");function F(e){if(!e||!m(e))return null;let t=h(e.landedAt),n=e.cycleDescription?` \xB7 cycle "${e.cycleDescription.slice(0,50)}${e.cycleDescription.length>50?"\u2026":""}"`:"";return["# prjct: managed session continuity",`Last land ${t}${n}. Restore full state: \`prjct prime --md\` (work graph + hand-off + next actions).`,e.handoffWrote?"Hand-off is in SQLite (`topic:session-close`) \u2014 do not re-discover from chat history.":"No hand-off body last land \u2014 prime still restores cycle/frontier if open."].join(`
10
+ `)}r(F,"formatContinuitySessionCue");function H(e){return["","## Managed session continuity","",`- Stamped at \`${e.landedAt.slice(0,19)}\` (SoT key \`${a}\`).`,"- **Next window / machine:** `prjct prime --md` restores cycle + last hand-off + next actions.","- Cross-device: same project DB / cloud sync of memory \u2014 no hosted model session required.",`- Context diet: ${c()}`].join(`
11
+ `)}r(H,"formatLandContinuityFooter");function h(e){let t=Date.parse(e);if(!Number.isFinite(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}r(h,"formatRelativeIso");export{x as CONTINUITY_FRESH_MS,f as SESSION_CLOSE_TOPIC,a as SESSION_CONTINUITY_KEY,F as formatContinuitySessionCue,H as formatLandContinuityFooter,W as formatSessionResumeCard,m as isContinuityFresh,B as loadLastSessionCloseContent,E as loadSessionContinuity,R as stampSessionContinuity};
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __createRequire } from 'module';
3
+ import { fileURLToPath as __fileURLToPath } from 'url';
4
+ import { dirname as __pathDirname } from 'path';
5
+ const require = __createRequire(import.meta.url);
6
+ const __filename = __fileURLToPath(import.meta.url);
7
+ const __dirname = __pathDirname(__filename);
8
+ import{a,b,c,d}from"./chunk-NUJASVHN.mjs";import"./chunk-HRWXMF7P.mjs";import"./chunk-ZJXH76Q5.mjs";import"./chunk-PUHX3ECX.mjs";import"./chunk-Q3EYM4GJ.mjs";import"./chunk-AZYQFRPJ.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-QPRNRLG6.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as buildProjectIdentityLine,a as buildSessionContext,b as buildSubagentDigest,d as runSessionStartHook};