prjct-cli 3.93.0 → 3.95.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 (265) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +27 -21
  3. package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
  4. package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-UGHAG2SK.mjs} +3 -3
  5. package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-JIITQ6GY.mjs} +1 -1
  6. package/dist/bin/hook-chunks/auto-flush-CXWTU3RF.mjs +8 -0
  7. package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
  8. package/dist/bin/hook-chunks/capture-gate-PS6QUXLX.mjs +8 -0
  9. package/dist/bin/hook-chunks/chunk-22AXWLI6.mjs +26 -0
  10. package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
  11. package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-3WQBTXUC.mjs} +1 -1
  12. package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-4HAKTI36.mjs} +1 -1
  13. package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
  14. package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +11 -0
  15. package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-4NTVXJD7.mjs} +1 -1
  16. package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-5H3KJWQS.mjs} +2 -2
  17. package/dist/bin/hook-chunks/chunk-5XA5RL5I.mjs +8 -0
  18. package/dist/bin/hook-chunks/chunk-6GAFRIUQ.mjs +18 -0
  19. package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-76GDLA3Z.mjs} +3 -3
  20. package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
  21. package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
  22. package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-ABJNOG2I.mjs} +1 -1
  23. package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-B36LC2JR.mjs} +1 -1
  24. package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
  25. package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-BDOAQVIF.mjs} +1 -1
  26. package/dist/bin/hook-chunks/chunk-BOBFTVAY.mjs +11 -0
  27. package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-BU22R6JX.mjs} +1 -1
  28. package/dist/bin/hook-chunks/chunk-BX7VKYA7.mjs +8 -0
  29. package/dist/bin/hook-chunks/chunk-C4O243NG.mjs +9 -0
  30. package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +36 -0
  31. package/dist/bin/hook-chunks/chunk-DCSKTMDX.mjs +8 -0
  32. package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-DVDZA63F.mjs} +1 -1
  33. package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-EWOK4VE7.mjs} +1 -1
  34. package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
  35. package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-FW4MEPTB.mjs} +1 -1
  36. package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +69 -0
  37. package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
  38. package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-GCDLPKOH.mjs} +1 -1
  39. package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-GDECEHO5.mjs} +1 -1
  40. package/dist/bin/hook-chunks/chunk-GDESYWTD.mjs +14 -0
  41. package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
  42. package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
  43. package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
  44. package/dist/bin/hook-chunks/chunk-HEDZA6KC.mjs +8 -0
  45. package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-I26F7TLM.mjs} +1 -1
  46. package/dist/bin/hook-chunks/chunk-IGHY4FGS.mjs +8 -0
  47. package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-IWJG7CZX.mjs} +1 -1
  48. package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-J5UQVJUW.mjs} +2 -2
  49. package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
  50. package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
  51. package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-KHLYWNHT.mjs} +1 -1
  52. package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
  53. package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-KSSRINDX.mjs} +1 -1
  54. package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
  55. package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
  56. package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-MHNWIB7B.mjs} +2 -2
  57. package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-N3L77UNM.mjs} +1 -1
  58. package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-NLKPAJND.mjs} +1 -1
  59. package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OC4CYF7V.mjs} +1 -1
  60. package/dist/bin/hook-chunks/chunk-OGIFB3OE.mjs +19 -0
  61. package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
  62. package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-OUAVSD47.mjs} +1 -1
  63. package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
  64. package/dist/bin/hook-chunks/chunk-PGWFGRX4.mjs +47 -0
  65. package/dist/bin/hook-chunks/chunk-PO3QDKTE.mjs +8 -0
  66. package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-PP6DANGV.mjs} +1 -1
  67. package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-PTA7DMLM.mjs} +1 -1
  68. package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-QBYHZX33.mjs} +1 -1
  69. package/dist/bin/hook-chunks/chunk-QL3NYJTW.mjs +16 -0
  70. package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-QP5USCDX.mjs} +1 -1
  71. package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
  72. package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
  73. package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-RHKF7EJW.mjs} +1 -1
  74. package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-ROA2AJXY.mjs} +1 -1
  75. package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-RTEEXGEA.mjs} +1 -1
  76. package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-S5ISOGDB.mjs} +1 -1
  77. package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-S5N2ZZDL.mjs} +1 -1
  78. package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-S6L3FECF.mjs} +1 -1
  79. package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-T6ELTQZM.mjs} +1 -1
  80. package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-TXSLON7M.mjs} +2 -2
  81. package/dist/bin/hook-chunks/chunk-U4OON3S7.mjs +31 -0
  82. package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
  83. package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-UHVYBU7F.mjs} +1 -1
  84. package/dist/bin/hook-chunks/chunk-UYQC63MC.mjs +11 -0
  85. package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-V2FR2NPL.mjs} +4 -4
  86. package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-WGWE3CSC.mjs} +1 -1
  87. package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-X5W2UYQK.mjs} +2 -2
  88. package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-XDBJSJOT.mjs} +1 -1
  89. package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
  90. package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
  91. package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-XXRAQZNC.mjs} +1 -1
  92. package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-YDBZO6I3.mjs} +1 -1
  93. package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
  94. package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
  95. package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-Z6KVLCMK.mjs} +1 -1
  96. package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-ZFLIVOFX.mjs} +1 -1
  97. package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
  98. package/dist/bin/hook-chunks/chunk-ZOX6OV6X.mjs +12 -0
  99. package/dist/bin/hook-chunks/client-CRXA774S.mjs +10 -0
  100. package/dist/bin/hook-chunks/code-graph-cloud-GTSLO7CD.mjs +8 -0
  101. package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
  102. package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-UHSXC3UG.mjs} +1 -1
  103. package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
  104. package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
  105. package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-GDJ3QICX.mjs} +1 -1
  106. package/dist/bin/hook-chunks/custom-workflow-storage-FD47DPA3.mjs +8 -0
  107. package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
  108. package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-ZUC7OEZG.mjs} +1 -1
  109. package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
  110. package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
  111. package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
  112. package/dist/bin/hook-chunks/developer-evolution-WNSTHDAA.mjs +12 -0
  113. package/dist/bin/hook-chunks/distill-GOGPFQFK.mjs +8 -0
  114. package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-2CACBNS4.mjs} +1 -1
  115. package/dist/bin/hook-chunks/enriched-recall-QF22RIK7.mjs +8 -0
  116. package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
  117. package/dist/bin/hook-chunks/format-J3X3R225.mjs +8 -0
  118. package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
  119. package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
  120. package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
  121. package/dist/bin/hook-chunks/judgment-receipt-7A2DXVJA.mjs +8 -0
  122. package/dist/bin/hook-chunks/land-cue-SZWJH6XP.mjs +9 -0
  123. package/dist/bin/hook-chunks/land-synthesis-JLYUBKHR.mjs +8 -0
  124. package/dist/bin/hook-chunks/legacy-crew-sweep-JXYO62UE.mjs +24 -0
  125. package/dist/bin/hook-chunks/memory-index-CIYDXN2G.mjs +8 -0
  126. package/dist/bin/hook-chunks/notification-UA7RTVHG.mjs +8 -0
  127. package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
  128. package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
  129. package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
  130. package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-375HH6TB.mjs} +1 -1
  131. package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-M3RAOZVB.mjs} +2 -2
  132. package/dist/bin/hook-chunks/post-edit-QRDYPZLZ.mjs +8 -0
  133. package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
  134. package/dist/bin/hook-chunks/pre-bash-TWWFVNQ7.mjs +11 -0
  135. package/dist/bin/hook-chunks/pre-commit-PTFF7JIN.mjs +8 -0
  136. package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +11 -0
  137. package/dist/bin/hook-chunks/pre-package-325ALZKD.mjs +8 -0
  138. package/dist/bin/hook-chunks/pre-search-GOHVFAFH.mjs +9 -0
  139. package/dist/bin/hook-chunks/pre-secrets-MYNM5KI4.mjs +8 -0
  140. package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
  141. package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
  142. package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
  143. package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
  144. package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +8 -0
  145. package/dist/bin/hook-chunks/project-style-evolution-RPGATIYJ.mjs +8 -0
  146. package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
  147. package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
  148. package/dist/bin/hook-chunks/purge-XKHUAB4H.mjs +8 -0
  149. package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +8 -0
  150. package/dist/bin/hook-chunks/sdd-6PF7MBAY.mjs +10 -0
  151. package/dist/bin/hook-chunks/session-continuity-UEXQDGZE.mjs +11 -0
  152. package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
  153. package/dist/bin/hook-chunks/setup-ZOHG6MGF.mjs +141 -0
  154. package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-QVGTOO6U.mjs} +5 -5
  155. package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-FGDQVYHM.mjs} +1 -1
  156. package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
  157. package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
  158. package/dist/bin/hook-chunks/spec-task-breakdown-LAXGVLMY.mjs +8 -0
  159. package/dist/bin/hook-chunks/state-storage-XU35ZYNA.mjs +8 -0
  160. package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
  161. package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
  162. package/dist/bin/hook-chunks/subagent-stop-OUG4PR7S.mjs +8 -0
  163. package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
  164. package/dist/bin/hook-chunks/symbol-graph-DMPBNBX7.mjs +8 -0
  165. package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
  166. package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-PIRHMHXL.mjs} +1 -1
  167. package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
  168. package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
  169. package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
  170. package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
  171. package/dist/bin/hook-chunks/tdd-QZL4OSM7.mjs +10 -0
  172. package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SKXILJLJ.mjs} +1 -1
  173. package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
  174. package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
  175. package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SZLG6LVC.mjs} +1 -1
  176. package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
  177. package/dist/bin/hook-chunks/velocity-storage-5J6BAMCW.mjs +8 -0
  178. package/dist/bin/hook-chunks/weak-model-mode-ZRNKFTFF.mjs +8 -0
  179. package/dist/bin/hook-chunks/work-graph-PGYHFLEL.mjs +49 -0
  180. package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
  181. package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
  182. package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
  183. package/dist/bin/hook-fast-darwin-arm64 +0 -0
  184. package/dist/bin/hook-fast-darwin-x64 +0 -0
  185. package/dist/bin/hook-fast-linux-x64 +0 -0
  186. package/dist/bin/prjct-core.mjs +737 -736
  187. package/dist/bin/prjct-hooks.mjs +2 -2
  188. package/dist/bin/prjct.mjs +1 -1
  189. package/dist/daemon/entry.mjs +651 -647
  190. package/dist/mcp/server.mjs +310 -312
  191. package/package.json +1 -1
  192. package/dist/bin/hook-chunks/auto-flush-5D4PKOMM.mjs +0 -8
  193. package/dist/bin/hook-chunks/capture-gate-EOOSAGAP.mjs +0 -8
  194. package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
  195. package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
  196. package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +0 -9
  197. package/dist/bin/hook-chunks/chunk-A7SGMNOK.mjs +0 -11
  198. package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
  199. package/dist/bin/hook-chunks/chunk-BNWB77U5.mjs +0 -9
  200. package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
  201. package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
  202. package/dist/bin/hook-chunks/chunk-DLHSCKBJ.mjs +0 -15
  203. package/dist/bin/hook-chunks/chunk-DV7KV2O4.mjs +0 -38
  204. package/dist/bin/hook-chunks/chunk-EHP4DYVQ.mjs +0 -71
  205. package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
  206. package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
  207. package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
  208. package/dist/bin/hook-chunks/chunk-JRKGG2E3.mjs +0 -8
  209. package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
  210. package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
  211. package/dist/bin/hook-chunks/chunk-MHRMV4WI.mjs +0 -31
  212. package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
  213. package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
  214. package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
  215. package/dist/bin/hook-chunks/chunk-OB5GRS7T.mjs +0 -18
  216. package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
  217. package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
  218. package/dist/bin/hook-chunks/chunk-UB53HQMG.mjs +0 -14
  219. package/dist/bin/hook-chunks/chunk-UBMIPWJR.mjs +0 -19
  220. package/dist/bin/hook-chunks/chunk-VPPHD762.mjs +0 -11
  221. package/dist/bin/hook-chunks/chunk-VV7VNUTF.mjs +0 -16
  222. package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
  223. package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
  224. package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
  225. package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
  226. package/dist/bin/hook-chunks/cwd-changed-FYNPPO73.mjs +0 -8
  227. package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
  228. package/dist/bin/hook-chunks/distill-W7QGQUDX.mjs +0 -8
  229. package/dist/bin/hook-chunks/enriched-recall-W7KYRYVR.mjs +0 -8
  230. package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
  231. package/dist/bin/hook-chunks/format-BOWFDUBP.mjs +0 -8
  232. package/dist/bin/hook-chunks/judgment-receipt-WGTFKID7.mjs +0 -8
  233. package/dist/bin/hook-chunks/land-cue-WLGSULSO.mjs +0 -9
  234. package/dist/bin/hook-chunks/land-synthesis-V7UH5QV6.mjs +0 -8
  235. package/dist/bin/hook-chunks/legacy-crew-sweep-MFE4BDNR.mjs +0 -24
  236. package/dist/bin/hook-chunks/memory-index-B53F5HAX.mjs +0 -10
  237. package/dist/bin/hook-chunks/notification-HJLS4L7Y.mjs +0 -8
  238. package/dist/bin/hook-chunks/post-edit-TT3XOG55.mjs +0 -8
  239. package/dist/bin/hook-chunks/pre-bash-2KKF4V6G.mjs +0 -11
  240. package/dist/bin/hook-chunks/pre-commit-UU4SKKWV.mjs +0 -8
  241. package/dist/bin/hook-chunks/pre-edit-RTBLZPWH.mjs +0 -11
  242. package/dist/bin/hook-chunks/pre-package-LQTINBT4.mjs +0 -8
  243. package/dist/bin/hook-chunks/pre-search-UJU3XZ2K.mjs +0 -9
  244. package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
  245. package/dist/bin/hook-chunks/project-memory-YHQBRX3D.mjs +0 -8
  246. package/dist/bin/hook-chunks/project-style-evolution-HS6HYI7W.mjs +0 -8
  247. package/dist/bin/hook-chunks/prompt-AYY7BZFG.mjs +0 -22
  248. package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
  249. package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
  250. package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
  251. package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
  252. package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
  253. package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
  254. package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
  255. package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
  256. package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
  257. package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
  258. package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
  259. package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
  260. package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
  261. package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
  262. package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
  263. package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
  264. package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
  265. package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
@@ -1,24 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as N}from"./chunk-7SI6X3Z7.mjs";import{a as A}from"./chunk-DYHYDHCW.mjs";import{e as f,g as x}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{b,e as te}from"./chunk-AKIN5WSQ.mjs";import{a as z,f as ne}from"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import{c as R}from"./chunk-7AN7VQHN.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import m from"node:fs/promises";import u from"node:path";ne();import{z as _}from"zod";te();x();var D="crew:checkpoints",Q="crew/CHECKPOINTS.md",re=_.object({content:_.string(),source:_.enum(["default","user","migrated"]),updated_at:_.string().min(1)});function se(){let t=R(Q);if(!t)throw new Error(`Missing bundled crew checkpoints template: ${Q}`);return t}l(se,"getBundledDefault");var F=class{static{l(this,"CheckpointsStorage")}get(n){let e=f.getDoc(n,D);return e===null?{content:se(),source:"default",updated_at:b()}:re.parse(e)}hasCustomization(n){return f.hasDoc(n,D)}set(n,e,r="user"){let o={content:e,source:r,updated_at:b()};return f.setDoc(n,D,o),o}reset(n){f.deleteDoc(n,D)}},ie=new F,E=ie;x();x();import{z as S}from"zod";var M="team:enrollment",q=S.object({required:S.boolean(),minVersion:S.string().min(1),enrolledAt:S.string().min(1),enrolledBy:S.string().nullable().default(null)}),I=class{static{l(this,"TeamEnrollmentStorage")}get(n){let e=f.getDoc(n,M);return e===null?null:q.parse(e)}set(n,e){let r=q.parse(e);f.setDoc(n,M,r)}clear(n){f.deleteDoc(n,M)}};var oe=new I,C=oe;var P=".prjct/CHECKPOINTS.md",L=".prjct/team.json",$="migration:v2.19.8:last-flagged-checkpoints",H="migration:v2.19.8:last-flagged-team",O="migration:v3.77:last-ghost-purge-warn",Y="migration:v3.77:last-agent-repair-warn",ae=["sessions","audits","deploy"],ce=[/\.prjct\/sessions\/<task/i,/\.prjct\/sessions\/\$\{/i,/->\s*`?\.prjct\/sessions\//i,/write(?:s|n)?\s+(?:a\s+)?(?:plan|report|results?|verdict|findings?)[^\n]{0,120}\.prjct\/sessions\//i,/write(?:s|n)?\s+its\s+results[^\n]{0,80}\.prjct\/sessions\//i,/Session artifacts at `?\.prjct\/sessions\//i,/Implementer report at `?\.prjct\/sessions\//i,/Reviewer verdict at `?\.prjct\/sessions\//i,/\.prjct\/audits\//i,/\.prjct\/deploy\//i,/SESSION_ROOT\s*=/i,/Write under `?SESSION_ROOT/i,/~\/\.prjct-cli\/projects\/[^\s`]+\/sessions\//i,/sessions\/<task-slug>\/\{?plan/i],He=[".prjct/sessions/<task",".prjct/audits/",".prjct/deploy/"],le=N.map(t=>({destRelative:`.claude/agents/${t.name}.md`,templateKey:`crew/roles/${t.name}.md`})),v="CLAUDE.md",W="CREW.md",ge="crew/leader-mode.md",K="<!-- prjct:crew:start - DO NOT REMOVE THIS MARKER -->",U="<!-- prjct:crew:end - DO NOT REMOVE THIS MARKER -->",G="<!-- prjct:crew:end -->",X="<!-- prjct:checkpoints:start - DO NOT EDIT (managed by `prjct crew checkpoints set|reset`) -->",de="<!-- prjct:checkpoints:end -->",pe=["prjct.config.json","memory-export"];async function ee(t){try{return(await m.stat(t)).mtimeMs}catch{return null}}l(ee,"statMtimeMs");async function k(t){try{return await m.readFile(t,"utf-8")}catch{return null}}l(k,"tryReadFile");async function J(t){try{return await m.access(t),!0}catch{return!1}}l(J,"pathExists");function j(t,n){return f.getDoc(t,n)}l(j,"readFlag");function w(t,n,e){f.setDoc(t,n,{mtime_ms:e,migrated_at:new Date().toISOString()})}l(w,"writeFlag");async function y(t,n,e){try{let{projectMemory:r}=await import("./project-memory-YHQBRX3D.mjs");await r.remember(t,{type:"inbox",content:n,tags:e,provenance:"declared"})}catch(r){A.debug("Legacy sweep inbox capture failed (non-critical)",{error:r instanceof Error?r.message:String(r)})}}l(y,"captureInboxWarning");function T(t){return ce.some(n=>n.test(t))}l(T,"containsForbiddenWriteInstruction");function me(t,n){let e=N.find(o=>`.claude/agents/${o.name}.md`===n)?.role;if(!e)return t;let{model:r}=z(e);return t.replace(/^model:[ \t].*$/m,`model: ${r}`)}l(me,"stampCrewModelPolicy");function ue(t,n){let e=t.indexOf(X),r=t.indexOf(de);if(e<0||r<0||r<e)return t;let o=t.slice(0,e+X.length),c=t.slice(r);return`${o}
9
- ${n.trimEnd()}
10
- ${c}`}l(ue,"spliceCheckpoints");function fe(t,n){let e=l(c=>{let i=c.indexOf(K);if(i<0)return c;let a=c.slice(i+K.length),s=a.indexOf(U),d=a.indexOf(G),g=s>=0&&(d<0||s<=d)?{relative:s,length:U.length}:d>=0?{relative:d,length:G.length}:null;if(!g)return c.slice(0,i);let p=i+K.length+g.relative;return e(`${c.slice(0,i)}${c.slice(p+g.length)}`)},"stripMarkerBlocks"),r=e(t).replace(/\n{3,}/g,`
11
-
12
- `).trimEnd(),o=r.length>0?`
13
-
14
- `:"";return`${r}${o}${n.trimEnd()}
15
- `}l(fe,"replaceCrewSnippet");function Z(t){return T(t)?`${t.split(`
16
- `).filter(e=>!T(e)).join(`
17
- `).replace(/\n{3,}/g,`
18
-
19
- `).trimEnd()}
20
- `:t}l(Z,"sanitizeCheckpointsContent");async function we(t,n,e){let r=u.join(t,P),o=await ee(r);if(o===null)return;let c=j(n,$),i=await k(r);if(i!==null)try{c===null?(E.set(n,i,"migrated"),w(n,$,o),e.checkpointsMigrated=!0,await y(t,"Legacy .prjct/CHECKPOINTS.md migrated into kv_store crew:checkpoints and DELETED from the client worktree. Manage with 'prjct crew checkpoints show|set|reset|export'. Product law: nothing but prjct.config.json under client .prjct/.",{"migration:v3.79":"1",topic:"crew-checkpoints"})):o>c.mtime_ms&&(E.set(n,i,"migrated"),w(n,$,o),e.checkpointsHandEditWarned=!0,await y(t,"Legacy .prjct/CHECKPOINTS.md hand-edited after migration \u2014 content re-adopted into kv_store and file DELETED. Prefer 'prjct crew checkpoints set' going forward.",{"migration:v3.79":"1",topic:"crew-checkpoints",state:"re-adopted"}))}catch(a){e.errors.push({file:P,reason:a instanceof Error?a.message:String(a)})}try{await m.rm(r,{force:!0}),e.clientPrjctJunkPurged.push("CHECKPOINTS.md")}catch(a){e.errors.push({file:P,reason:a instanceof Error?a.message:String(a)})}}l(we,"sweepCheckpoints");async function he(t,n,e){let r=u.join(t,L),o=await ee(r);if(o===null)return;let c=j(n,H),i=C.get(n),a=await k(r);if(a!==null)try{if(c===null||i===null){if(i===null){let s=JSON.parse(a),d={required:s.required===!0,minVersion:typeof s.minVersion=="string"?s.minVersion:"0.0.0",enrolledAt:typeof s.enrolledAt=="string"?s.enrolledAt:new Date().toISOString(),enrolledBy:typeof s.enrolledBy=="string"?s.enrolledBy:null};C.set(n,d),e.teamMigrated=!0,await y(t,"Legacy .prjct/team.json adopted into kv_store team:enrollment and DELETED from the client worktree. Team state is SQL-only; manage with 'prjct team'.",{"migration:v3.79":"1",topic:"team-enrollment"})}w(n,H,o)}else if(o>c.mtime_ms){try{let s=JSON.parse(a),d={required:s.required===!0,minVersion:typeof s.minVersion=="string"?s.minVersion:"0.0.0",enrolledAt:typeof s.enrolledAt=="string"?s.enrolledAt:new Date().toISOString(),enrolledBy:typeof s.enrolledBy=="string"?s.enrolledBy:null};C.set(n,d)}catch{}w(n,H,o),e.teamHandEditWarned=!0}}catch(s){e.errors.push({file:L,reason:s instanceof Error?s.message:String(s)})}try{await m.rm(r,{force:!0}),e.clientPrjctJunkPurged.push("team.json")}catch(s){e.errors.push({file:L,reason:s instanceof Error?s.message:String(s)})}}l(he,"sweepTeamJson");async function V(t){let n=[],e=await m.readdir(t,{withFileTypes:!0}).catch(()=>[]);for(let r of e){let o=u.join(t,r.name);r.isDirectory()?n.push(...await V(o)):r.isFile()&&n.push(o)}return n}l(V,"listFilesRecursive");async function B(t,n,e,r){let o=new Set([".md",".txt",".json",".yml",".yaml",".toml",".csv",".log"]),c=u.extname(e).toLowerCase();if(!o.has(c)&&c!=="")return!1;let i=await m.readFile(e).then(g=>{if(g.byteLength>2e5)return null;let p=g.toString("utf-8");return p.includes("\0")?null:p}).catch(()=>null);if(i===null||!i.trim())return!1;let a=12e3,s=i.length>a?`${i.slice(0,a)}
21
-
22
- \u2026[truncated ${i.length-a} chars]`:i,d=["Rescued worktree ghost (physical files are not traceable \u2014 ingested to SQLite, disk deleted).",`source: ${r}`,"",s].join(`
23
- `);try{let{projectMemory:g}=await import("./project-memory-YHQBRX3D.mjs");return await g.remember(t,{type:"context",content:d,tags:{topic:"worktree-ghost-ingest",source_path:r,"migration:v3.77":"1"},provenance:"declared",projectId:n,force:!0}),!0}catch(g){return A.debug("Ghost file SQL ingest failed (non-critical)",{file:r,error:g instanceof Error?g.message:String(g)}),!1}}l(B,"ingestGhostFileToSql");async function Ee(t,n,e){let r=u.join(t,".prjct");if(!await J(r))return;for(let c of ae){let i=u.join(r,c);if(await J(i))try{let a=await V(i);for(let s of a){let d=u.relative(t,s);await B(t,n,s,d)&&(e.ghostFilesIngested+=1)}await m.rm(i,{recursive:!0,force:!0}),e.ghostDirsPurged.push(c)}catch(a){e.errors.push({file:`.prjct/${c}/`,reason:a instanceof Error?a.message:String(a)})}}if(e.ghostDirsPurged.length===0)return;if(j(n,O)===null){let c=e.ghostFilesIngested>0?` ${e.ghostFilesIngested} text file(s) ingested into SQLite (topic:worktree-ghost-ingest) for traceability.`:"";await y(t,`Purged forbidden prjct ghost dir(s) from the customer worktree: ${e.ghostDirsPurged.map(i=>`.prjct/${i}/`).join(", ")}.${c} Product law: plans and work data live ONLY in project SQLite (prjct plan / prjct spec / prjct remember / prjct crew record-run) \u2014 never as physical files in the repo or under ~/.prjct-cli. The only hand-editable file under .prjct/ is prjct.config.json.`,{"migration:v3.77":"1",topic:"worktree-ghost-purge"}),w(n,O,Date.now())}}l(Ee,"purgeWorktreeGhostDirs");async function ye(t,n,e){try{let s=E.get(n),d=Z(s.content);if(d!==s.content){let g=s.source==="user"?"user":"migrated";E.set(n,d,g),e.agentFilesRepaired.push("kv_store[crew:checkpoints]")}}catch(s){e.errors.push({file:"kv_store[crew:checkpoints]",reason:s instanceof Error?s.message:String(s)})}for(let s of le){let d=u.join(t,s.destRelative),g=await k(d);if(g===null||!T(g))continue;let p=R(s.templateKey);if(!p){e.errors.push({file:s.destRelative,reason:"template missing"});continue}try{let h=me(s.destRelative===".claude/agents/reviewer.md"?ue(p,Z(E.get(n).content)):p,s.destRelative);await m.mkdir(u.dirname(d),{recursive:!0}),await m.writeFile(d,h,"utf-8"),e.agentFilesRepaired.push(s.destRelative)}catch(h){e.errors.push({file:s.destRelative,reason:h instanceof Error?h.message:String(h)})}}let r=u.join(t,v),o=await k(r);if(o!==null){let s=(o.match(/prjct:crew:start/g)??[]).length;if(T(o)||s>1||o.includes(G)){let g=R(ge)?.trim();if(!g)e.errors.push({file:v,reason:"leader-mode template missing"});else try{let p=fe(o,g);await m.writeFile(r,p,"utf-8"),e.agentFilesRepaired.push(v)}catch(p){e.errors.push({file:v,reason:p instanceof Error?p.message:String(p)})}}}let c=u.join(t,W),i=await k(c);if(i!==null&&T(i))try{let s=["# CREW.md \u2014 reinstall required","","This file previously instructed agents to write plans/reports under","`.prjct/sessions/` (or other worktree paths). That is forbidden.","","Run `prjct crew install` to regenerate the emulated crew protocol.","Durable state goes through `prjct` CLI verbs only (SQLite).",""].join(`
24
- `);await m.writeFile(c,s,"utf-8"),e.agentFilesRepaired.push(W)}catch(s){e.errors.push({file:W,reason:s instanceof Error?s.message:String(s)})}if(e.agentFilesRepaired.length===0)return;j(n,Y)===null&&(await y(t,`Repaired crew instruction files that still told agents to write plans/reports to disk (${e.agentFilesRepaired.join(", ")}). Refreshed from current prjct templates. Product law: plans + work data ONLY in project SQLite via prjct plan / prjct spec / prjct remember / prjct crew record-run \u2014 physical files are not traceable.`,{"migration:v3.77":"1",topic:"crew-disk-write-repair"}),w(n,Y,Date.now()))}l(ye,"repairCrewDiskWriteInstructions");async function Re(t,n,e){let r=u.join(t,".prjct");if(!await J(r))return;let o=await m.readdir(r).catch(()=>[]);for(let i of o){if(pe.includes(i))continue;let a=u.join(r,i);try{let s=await m.stat(a);if(s.isDirectory()){let d=await V(a);for(let g of d){let p=u.relative(t,g);await B(t,n,g,p)&&(e.ghostFilesIngested+=1)}}else if(s.isFile()){let d=u.relative(t,a);i!=="CHECKPOINTS.md"&&i!=="team.json"&&await B(t,n,a,d)&&(e.ghostFilesIngested+=1)}await m.rm(a,{recursive:!0,force:!0}),e.clientPrjctJunkPurged.includes(i)||e.clientPrjctJunkPurged.push(i)}catch(s){e.errors.push({file:`.prjct/${i}`,reason:s instanceof Error?s.message:String(s)})}}if(e.clientPrjctJunkPurged.length===0)return;j(n,O)===null&&e.ghostDirsPurged.length===0&&(await y(t,`Client .prjct/ cleaned to config-only. Removed: ${e.clientPrjctJunkPurged.join(", ")}. Durable state is SQLite only (prjct crew checkpoints / prjct team / prjct remember).`,{"migration:v3.79":"1",topic:"client-prjct-config-only"}),w(n,O,Date.now()))}l(Re,"enforcePrjctConfigOnly");async function We(t,n){let e={checkpointsMigrated:!1,checkpointsHandEditWarned:!1,teamMigrated:!1,teamHandEditWarned:!1,ghostDirsPurged:[],agentFilesRepaired:[],ghostFilesIngested:0,clientPrjctJunkPurged:[],errors:[]};return await we(t,n,e).catch(r=>{e.errors.push({file:P,reason:r instanceof Error?r.message:String(r)})}),await he(t,n,e).catch(r=>{e.errors.push({file:L,reason:r instanceof Error?r.message:String(r)})}),await Ee(t,n,e).catch(r=>{e.errors.push({file:".prjct/*/",reason:r instanceof Error?r.message:String(r)})}),await Re(t,n,e).catch(r=>{e.errors.push({file:".prjct/",reason:r instanceof Error?r.message:String(r)})}),await ye(t,n,e).catch(r=>{e.errors.push({file:".claude/agents/*",reason:r instanceof Error?r.message:String(r)})}),e}l(We,"legacyCrewSweep");export{pe as CLIENT_PRJCT_ALLOWLIST,He as FORBIDDEN_WORKTREE_WRITE_NEEDLES,ce as FORBIDDEN_WORKTREE_WRITE_PATTERNS,ae as WORKTREE_GHOST_DIRS,T as containsForbiddenWriteInstruction,We as legacyCrewSweep};
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as L}from"./chunk-4KY2EHXS.mjs";import"./chunk-54LH63LM.mjs";import{c as v}from"./chunk-ZZ65CN5F.mjs";import{d as b}from"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import{d as g,g as D}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{b as M,e as k}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{b as h}from"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";D();k();var E="memory:l0-index",$=4e3,R=1440*60*1e3,j=3,A=4,T=2,S=["decision","gotcha","anti-pattern","learning","fact","feedback"];function F(t){try{let r=C(t);return r?(g.setDoc(t.projectId,E,r),r):null}catch{return null}}l(F,"buildAndStoreMemoryL0Index");function C(t){let r=a.allEntriesForIndex(t.projectId).filter(e=>h(e)||e.type==="inbox"||e.type==="improvement-signal");if(r.length===0)return null;let n={};for(let e of r)n[e.type]=(n[e.type]??0)+1;if(r.filter(e=>e.type!=="improvement-signal"&&h(e)).length===0&&(n.inbox??0)===0)return null;let o=["## What this project already knows","","> Carried across sessions and model updates \u2014 this survived even if your conversation context did not. Apply these; do not re-derive from source.","",`_L0 index \xB7 live=${r.length} \xB7 pull L2: \`prjct search\` / \`prjct context memory <topic>\` / \`prjct guard <file>\`_`,""],m=new Set;try{let e=a.recall(t.projectId,{types:["feedback","improvement-signal"],limit:40,dedupeByKey:!1}),d=L(e,A);if(d.length>0){o.push("**How this developer works (act as them):**");for(let u of d){let w=u.rule.length>140?`${u.rule.slice(0,139)}\u2026`:u.rule;o.push(`- ${w} \`${u.sourceId}\``)}o.push("")}}catch{}let f=[{title:"Traps to avoid",types:["gotcha","anti-pattern"],suppressMiss:!0},{title:"Decisions in force",types:["decision"],suppressMiss:!0},{title:"Learnings",types:["learning"]},{title:"Facts",types:["fact"]}];for(let e of f){let d=v.rerank(t.projectId,a.recall(t.projectId,{types:e.types,limit:j*4})).slice(0,j);if(d.length!==0){o.push(`**${e.title}:**`);for(let u of d)o.push(`- ${I(u)}`),e.suppressMiss&&m.add(u.id);o.push("")}}let p=P(t.projectId,m);p&&o.push("**Keeps being missed:**",`- ${I(p.entry)} \u2014 flagged relevant-but-unused ${p.count}\xD7. Apply it or supersede it.`,"");let c=r.filter(e=>e.type==="inbox").slice(0,3),i=n.inbox??0;if(i>0){o.push(`**Inbox (${i}):**`);for(let e of c)o.push(`- ${I(e)}`);i>c.length&&o.push(`- \u2026 +${i-c.length} more`),o.push("",'> Close resolved: `prjct close <id> --reason "\u2026"`. Forget noise: `prjct forget <id>`.',"")}let x=S.filter(e=>(n[e]??0)>0).map(e=>`${e}=${n[e]}`).concat(Object.keys(n).filter(e=>!S.includes(e)&&(n[e]??0)>0).sort().slice(0,8).map(e=>`${e}=${n[e]}`));x.length>0&&o.push(`_Counts: ${x.join(" \xB7 ")}_`,""),o.push("> Resolve any `mem_id` with `prjct search <id>`. Full developer model: MCP `prjct_developer`. Consolidate: `prjct dream`. Never stuff L2 into L0.");let y=o.join(`
9
- `),_=y.length>$?`${y.slice(0,$-20).trimEnd()}
10
- \u2026(truncated)`:y;return{version:1,builtAt:M(),projectId:t.projectId,live:r.length,byType:n,markdown:_,source:t.source??"manual"}}l(C,"buildMemoryL0Index");function N(t){try{let r=g.getDoc(t,E);return!r||r.version!==1||!r.markdown?null:r}catch{return null}}l(N,"loadMemoryL0Index");function B(t,r=Date.now()){if(!t?.builtAt)return!1;let n=Date.parse(t.builtAt);return Number.isFinite(n)?r-n<=R:!1}l(B,"isMemoryL0IndexFresh");function W(t,r={}){try{let n=N(t),s=(!n||!B(n))&&r.rebuildIfStale!==!1?F({projectId:t,source:"session-start"}):n;return s?.markdown?.trim()?s.markdown.trim():null}catch{return null}}l(W,"memoryL0IndexForSession");function I(t){let r=b(t),n=(t.content??"").replace(/\s+/g," ").trim();if(n.length<=r.length+8)return`${r} \`${t.id}\``;let s=n.slice(r.length).replace(/^[\s.:;—-]+/,"").trim();if(s.length<20)return`${r} \`${t.id}\``;let o=s.length>80?`${s.slice(0,79)}\u2026`:s;return`${r} \u2014 ${o} \`${t.id}\``}l(I,"indexLine");function P(t,r){try{let n=a.recall(t,{types:["improvement-signal"],tags:{kind:"skill-miss"},limit:50,dedupeByKey:!1}),s=new Map;for(let c of n){let i=c.tags?.relates;i&&s.set(i,(s.get(i)??0)+1)}let o=[...s].sort((c,i)=>i[1]-c[1])[0];if(!o||o[1]<T||r.has(o[0]))return null;let[m,f]=o,p=a.getById(t,m);return p?{entry:p,count:f}:null}catch{return null}}l(P,"findRepeatMissedEntry");export{R as L0_INDEX_FRESH_MS,$ as L0_INDEX_MAX_CHARS,E as MEMORY_L0_INDEX_KEY,F as buildAndStoreMemoryL0Index,C as buildMemoryL0Index,B as isMemoryL0IndexFresh,N as loadMemoryL0Index,W as memoryL0IndexForSession};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b as f}from"./chunk-X5RDLFPM.mjs";import{c}from"./chunk-L4COZ7ZH.mjs";import{a as e}from"./chunk-ZX2KFQV5.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as n}from"./chunk-JRKGG2E3.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-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as t}from"./chunk-E66B27AL.mjs";function l(u=process.cwd(),p){return c({event:"Notification",projectPath:u,afterEmit:t(async(d,i)=>{let o=await n.readConfig(i).catch(()=>null);if(!o?.projectId||a(o)==="off")return;let s=await e(o.projectId,i).then(r=>r.current?`Waiting \u2014 active: ${r.current.description}`:"Waiting for your input").catch(()=>"Waiting for your input");await f("prjct \u2014 Claude needs you",s)},"afterEmit")},p)}t(l,"runNotificationHook");export{l as runNotificationHook};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{c as a}from"./chunk-L4COZ7ZH.mjs";import"./chunk-GAOQHD5S.mjs";import{a as e}from"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as n}from"./chunk-JRKGG2E3.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-P5ZYAXSE.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};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as d}from"./chunk-6WXGOGAN.mjs";import{a as k}from"./chunk-4WHS7CO7.mjs";import{c as l}from"./chunk-MXHX44WF.mjs";import{a as m,c as p}from"./chunk-4OYUJTPR.mjs";import{c as u}from"./chunk-L4COZ7ZH.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-SOPRYWUY.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-V37VTXDW.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c}from"./chunk-4OYUJTPR.mjs";import"./chunk-L4COZ7ZH.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as buildPreCommitContext,c as isCommitInput,b as runPreCommitHook};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as R}from"./chunk-4WHS7CO7.mjs";import{a as E}from"./chunk-5WAONIPX.mjs";import{b as m,c as A}from"./chunk-L4COZ7ZH.mjs";import{a as x}from"./chunk-LFY5O66D.mjs";import{a as b,b as M,c as T,d as C,e as g,f as k,g as p,i as w}from"./chunk-RXD7MHJ6.mjs";import"./chunk-ZZ65CN5F.mjs";import{b as I,c as S,d as $}from"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as L}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import{b as v}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-SOPRYWUY.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-V37VTXDW.mjs";import{b as h}from"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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 m(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."),m(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(p(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(p(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 m(c.message,y)}catch{}return d.action==="warn"&&d.message?(g(r,e.projectId,"warn",d.memoryIds,d.reason),m(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||p(n,b))return null;let a=D(e.projectId,o);if(a.length===0||p(n,b))return null;let l=C(e.projectId),s=o.split("/").pop()??o,u=k(a),d=H({harnessLevel:t?.harness?.level??null,candidates:u,overriddenIds:l,fileLabel:s});if(d.action==="deny"&&d.message)return g(r,e.projectId,"deny",d.memoryIds,d.reason),{deny:d.message};let f=w(e);if(f!=="strict")return null;let c=T({mode:f,candidates:u,overriddenIds:l,fileLabel:s});return c.action==="deny"&&c.message?(g(r,e.projectId,"deny",c.memoryIds,c.reason),{deny:c.message}):null}catch{return null}}i(G,"decideHardStop");function ce(r=process.cwd(),o){return A({event:"PreToolUse",projectPath:r,decide:i(async(n,e)=>{P();let t=R(n);return t||G(e,n.tool_input?.file_path?.trim())},"decide"),build:i(async(n,e)=>{try{let t=n.tool_input?.file_path?.trim();return t?W(e,t):null}finally{P()}},"build")},o)}i(ce,"runPreEditHook");export{ce as runPreEditHook};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b}from"./chunk-6WXGOGAN.mjs";import"./chunk-L4COZ7ZH.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-SOPRYWUY.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-V37VTXDW.mjs";import"./chunk-JRKGG2E3.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-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as evaluatePrePackageInput,b as runPrePackageHook};
@@ -1,9 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{b as g,c as d}from"./chunk-L4COZ7ZH.mjs";import{e as f,h as p}from"./chunk-NJAMZSHM.mjs";import"./chunk-GAOQHD5S.mjs";import{b as u}from"./chunk-JRKGG2E3.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-P5ZYAXSE.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 u.readConfig(e);if(!s?.projectId||!f(s.projectId)||Date.now()-t>h)return null;let a=p(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.`),g(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};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c}from"./chunk-4WHS7CO7.mjs";import"./chunk-L4COZ7ZH.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-SOPRYWUY.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-V37VTXDW.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-E66B27AL.mjs";export{c as _internal,a as decideSecrets,b as runPreSecretsHook};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as projectMemory};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c,d,e,f,g}from"./chunk-UBMIPWJR.mjs";import"./chunk-7OZDWT6C.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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};
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as A,b as 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-LFY5O66D.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-L4376X2P.mjs";import"./chunk-CREPUNOS.mjs";import{b as O}from"./chunk-D7TRY3CO.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-UB53HQMG.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-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as I}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.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-JRKGG2E3.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-P5ZYAXSE.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
-
10
- `),c=r.includes("quality-ledger")&&!g.includes("prjct ship")?`
11
-
12
- _${H}_`:"";return{level:d,cues:r,markdown:`${p}
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
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-A6AYZRJ5.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(`
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
-
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};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c}from"./chunk-AOPJ4Z6O.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 hashPayload,b as publishCRUD,c as publishCRUDSync};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c,d,e,f,g,h,i,j}from"./chunk-UK7D7EFV.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{b as k}from"./chunk-P4J6TY2L.mjs";import"./chunk-54LH63LM.mjs";import"./chunk-SJ75V4WG.mjs";import{b as P}from"./chunk-4DDCWMI6.mjs";import{b as O,c as U}from"./chunk-ZZ65CN5F.mjs";import{a as Y}from"./chunk-GIMUTVLP.mjs";import"./chunk-BNWB77U5.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-HT3ZCLLJ.mjs";import"./chunk-KXWBIQGJ.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-UK7D7EFV.mjs";import{a as x}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import{c as A}from"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import{a as w,b as V,e as D,g as B}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"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import{b as M,g as F}from"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";V();B();var W=new Set(["decision","gotcha","learning","feedback","fact","shipped","spec"]),se=30,oe=50,ie=20,ce=45,ae=25,de=15,ue=180,$=90,le=25,pe=.12,me=40,fe=40,he=30,ge=20,xe=35,Ee=.12,ye=864e5,Re=100,ve=50,be=25,_e=15,De=/\b[\w.-]+(?:\/[\w.-]+)+\.(?:ts|tsx|js|jsx|mjs|cjs|json|md|sh|toml|yml|yaml)\b/g;function Ae(e,t){let o=x.allEntriesForIndex(e),r=new Set;for(let c of o)for(let l of O(c.tags))r.add(l);let n=(()=>{try{let c=P(e);return c?new Set(Object.keys(c.documents)):null}catch{return null}})(),a=S(o),i=C(a);return{entries:o,usefulness:U.decayedScores(e,t),supersededIds:F(o),correctedIds:r,indexedPaths:n,nowMs:t,refIndex:i}}p(Ae,"collectRetentionInputs");function Se(e){let t=new Map,o=new Set,r=[...e].sort((n,a)=>a.rememberedAt.localeCompare(n.rememberedAt));for(let n of r){let a=w(n.content);t.has(a)?o.add(n.id):t.set(a,n)}return o}p(Se,"collectDuplicateIds");function Me(e,t){let o=e.content.match(De);return!o||o.length===0?!1:!o.some(r=>t.has(r))}p(Me,"isUngrounded");function Ie(e,t,o){let r=[],n=T(e.content,t.refIndex,e.id),a=o.has(e.id);a&&!n.exactDup&&r.push("duplicate of newer entry"),r.push(`excess ${n.excess.toFixed(2)} (sim ${n.maxSim.toFixed(2)})`);let i=n.exactDup||n.nearDup||n.excess<Ee;i&&r.push(n.exactDup?`exact dup of ${n.nearestId}`:n.nearDup?`near-dup of ${n.nearestId}`:"low excess vs reference");let c=t.usefulness.get(e.id)??0,l=Math.min(ae,Math.max(0,c*8));c>0&&r.push(`used (+${Math.round(l)})`);let u=Math.max(0,(t.nowMs-Date.parse(e.rememberedAt))/ye),h=Number.isFinite(u)?Math.max(0,de*(1-u/ue)):0,s=c<=0&&Number.isFinite(u)&&u>$?Math.min(le,(u-$)*pe):0;s>0&&r.push(`idle ${Math.round(u)}d`);let f=t.supersededIds.has(e.id);f&&r.push("superseded");let m=t.correctedIds.has(e.id);m&&r.push("corrected");let b=!M(e)||k(e);b&&r.push("generated noise");let E=!!(t.indexedPaths&&Me(e,t.indexedPaths));E&&r.push("cites files missing at HEAD");let g=Math.max(0,Math.min(100,n.excess*ce+l+h-(i?xe:0)-s-(f?me:0)-(m?fe:0)-(b?he:0)-(E?ge:0)-(a?20:0))),R=g>=oe?"active":g>=ie?"archive":"delete",_=a||n.exactDup||n.nearDup||f,y=R!=="active"&&u<se&&!_?"active":R;y!==R&&r.push("grace period");let d=y==="delete"&&W.has(e.type)?"archive":y;return d!==y&&r.push("protected type"),{id:e.id,type:e.type,verdict:d,score:Math.round(g),reasons:r,excess:n.excess,maxSim:n.maxSim,nearestId:n.nearestId}}p(Ie,"scoreEntry");function X(e,t){let o=Ae(e,t),r=Se(o.entries),n={evaluated:o.entries.length,active:0,archive:0,delete:0,referenceSize:o.refIndex.entries.length,flagged:[],byId:new Map};for(let a of o.entries){let i=Ie(a,o,r);n[i.verdict]++,n.byId.set(i.id,i),i.verdict!=="active"&&n.flagged.push(i)}return n.flagged.sort((a,i)=>a.score-i.score),n}p(X,"evaluateRetention");function Be(e,t){return!(!M(e)||e.content.trim().length===0||t&&t.verdict!=="active"||t&&t.excess!==void 0&&t.excess<.05)}p(Be,"shouldEmbedEntry");function v(e,t){if(t.startsWith("ship_"))return Ce(e,t);if(x.forget(e,t))return!0;try{return(D.run(e,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),t).changes??0)>0}catch{return!1}}p(v,"forgetEntry");function N(e){return e.startsWith("mem_")||e.startsWith("ship_")||/^\d+$/.test(e)}p(N,"isRetentionRemovableId");function Ce(e,t){let o=t.startsWith("ship_")?t.slice(5):t;if(!o)return!1;try{let r=D.get(e,"SELECT * FROM shipped_features WHERE id = ?",o);if(!r)return!1;try{A.archive(e,{entityType:"shipped",entityId:o,entityData:r,summary:`retention archive shipped [${r.name}]`,reason:"retention-archive"})}catch{}return(D.run(e,"DELETE FROM shipped_features WHERE id = ?",o).changes??0)>0}catch{return!1}}p(Ce,"forgetShippedFeature");function Te(e,t={}){let o=t.dryRun===!0,r=t.nowMs??Date.now(),n=t.maxArchive??Re,a=t.maxDelete??ve,i=X(e,r),c=i.flagged.filter(s=>s.verdict==="archive"&&N(s.id)),l=i.flagged.filter(s=>s.verdict==="delete"&&N(s.id)),u=i.flagged.filter(s=>(s.verdict==="archive"||s.verdict==="delete")&&!N(s.id)).length,h=o?{archived:0,deleted:0,skipped:u}:(()=>{let s=c.slice(0,n),f=s.map(d=>{if(!d.id.startsWith("ship_"))try{A.archive(e,{entityType:"memory_entry",entityId:d.id,entityData:{id:d.id,type:d.type,score:d.score,excess:d.excess,reasons:d.reasons,verdict:d.verdict},summary:`retention archive [${d.type}] excess=${d.excess?.toFixed(2)??"?"} score=${d.score}`,reason:"retention-archive"})}catch{}return v(e,d.id)}),m=f.filter(Boolean).length,b=Math.max(0,c.length-s.length)+f.filter(d=>!d).length,E=l.slice(0,a),g=E.filter(d=>!W.has(d.type)).map(d=>d.id),R=E.length-g.length,_=g.length>0?Y(e,g):0,y=Math.max(0,l.length-E.length)+R+g.length-_;return{archived:m,deleted:_,skipped:u+b+y}})();return{evaluated:i.evaluated,active:i.active,wouldArchive:c.length,wouldDelete:l.length,archived:h.archived,deleted:h.deleted,skipped:h.skipped,dryRun:o,samples:i.flagged.slice(0,10),referenceSize:i.referenceSize}}p(Te,"applyRetention");function He(e){return Te(e,{maxArchive:be,maxDelete:_e})}p(He,"applyRetentionIncremental");function Ge(e,t={}){let o=t.max??50,r=t.types??["inbox","context","idea","todo","question","gotcha","spec"],n=[],a=[];try{let i=x.allEntriesForIndex(e);for(let c of i){if(n.length>=o)break;if(!r.includes(c.type))continue;let l=I(c.content,c.type),u=L(c.content,c.type);(l.junk||u.action==="refuse"||c.type==="gotcha"&&u.action==="demote")&&v(e,c.id)&&(n.push(c),a.length<8&&a.push(`${c.id}:${l.junk?l.reason:u.reasonCode}`))}}catch{return{forgotten:0,samples:[]}}return{forgotten:n.length,samples:a}}p(Ge,"forgetJunkCaptures");function ze(e,t=Date.now()){let r=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(r.length===0)return{merged:0,archived:0,junkForgotten:0};let n=r.filter(s=>I(s.content,s.type).junk&&v(e,s.id)).length,a=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(a.length===0)return{merged:0,archived:0,junkForgotten:n};let i=S(x.allEntriesForIndex(e)),c=C(i),l=X(e,t),u=[],h=[];for(let s of a){let f=T(s.content,c);if(f.exactDup||f.nearDup||f.excess<.15){v(e,s.id)&&u.push(s.id);continue}let m=l.byId.get(s.id);if(m&&m.verdict!=="active"){try{A.archive(e,{entityType:"memory_entry",entityId:s.id,entityData:{id:s.id,type:"inbox",score:m.score,excess:m.excess,reasons:m.reasons},summary:`inbox triage excess=${m.excess?.toFixed(2)??"?"}`,reason:"retention-inbox"})}catch{}v(e,s.id)&&h.push(s.id)}}return{merged:u.length,archived:h.length,junkForgotten:n}}p(ze,"triageInbox");export{te as CAPTURE_MIN_EXCESS,H as DEFAULT_SOFT_DELETED_PURGE_DAYS,ee as NEAR_DUP_SIM,W as PROTECTED_TYPES,Z as REFERENCE_CAP,Te as applyRetention,He as applyRetentionIncremental,S as buildReferenceModel,re as captureGate,Se as collectDuplicateIds,Ae as collectRetentionInputs,ne as computeExcess,X as evaluateRetention,Ge as forgetJunkCaptures,Ce as forgetShippedFeature,G as isAutoSource,j as isReferenceEligible,N as isRetentionRemovableId,J as purgeOrphanRememberEvents,z as purgeSoftDeleted,Q as runVaultPurge,Ie as scoreEntry,Be as shouldEmbedEntry,ze as triageInbox,q as trimAutoSourceCap,K as vaultHealth};
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{h as v}from"./chunk-EHP4DYVQ.mjs";import"./chunk-L4376X2P.mjs";import"./chunk-Q5I2UPD6.mjs";import{a as u}from"./chunk-ACKEPXP4.mjs";import{a as g,b as f,d as w}from"./chunk-742LOGHA.mjs";import"./chunk-PSSR7LSW.mjs";import{a as l}from"./chunk-PWMMLXZS.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-D7TRY3CO.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-ODWWIFSN.mjs";import"./chunk-UB53HQMG.mjs";import"./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-6EWGHM32.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-4DDCWMI6.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./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 d}from"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as n}from"./chunk-E66B27AL.mjs";var c=["off","advisory","strict"],D=[{key:"spec drafted",reached:n(()=>!0,"reached")},{key:"audit-spec passed (reviewed)",reached:n(r=>r!=="draft","reached")},{key:"task linked",reached:n(r=>r==="in_progress"||r==="shipped","reached")},{key:"shipped",reached:n(r=>r==="shipped","reached")}],k=class extends w{static{n(this,"SddCommands")}async sdd(e=null,t=process.cwd(),o={}){let s=((e??"").trim().split(/\s+/).filter(Boolean)[0]??"").toLowerCase();return!s||s==="status"||s==="show"?this.showStatus(t,o):c.includes(s)?this.setMode(s,t,o):g(`Unknown sdd subcommand "${s}". Use: ${c.join("|")}.`,o)}async showStatus(e,t){let o=await d.readConfig(e).catch(()=>null);if(!o?.projectId)return f("No prjct project here \u2014 run `prjct init` first.",t);let i=S(o),s=await(async()=>{try{let p=await v(o.projectId,e);if(p?.linkedSpecId){let{specService:h}=await import("./spec-service-TA4Q5S3X.mjs"),a=await h.get(e,p.linkedSpecId);if(a)return{specLine:`Active spec: \`${a.title}\` (${a.status})`,station:D.map(y=>`${y.reached(a.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: ${i}${i==="off"?" (pipeline stays escalate-only)":""}`,s.specLine,`Pipeline: ${s.station}`,"Set: prjct sdd off|advisory|strict"];return t.md?console.log(u("## SDD",`> **Mode**: \`${i}\``,m.slice(1).join(`
9
- `))):l.info(`SDD \u2014 ${m.join(`
10
- `)}`),{success:!0,mode:i}}async setMode(e,t,o){let i=await d.readConfig(t).catch(()=>null);if(!i?.projectId)return f("No prjct project here \u2014 run `prjct init` first.",o);i.sdd={mode:e},await d.writeConfig(t,i);let s=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(u("## SDD",`> ${s}`)):l.done(s),{success:!0,mode:e}}};function S(r){let e=r?.sdd?.mode;if(e&&c.includes(e))return e;let t=process.env.PRJCT_SDD_MODE?.toLowerCase();return t&&c.includes(t)?t:"off"}n(S,"effectiveSddMode");var A={effectiveSddMode:S,SDD_MODES:c};export{k as SddCommands,A as _internal,S as effectiveSddMode};
@@ -1,11 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as d}from"./chunk-5TBQNW2G.mjs";import"./chunk-TXJT3G53.mjs";import{a as u}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import{d as l,g as y}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{b as p,e as g}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-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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};
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a,b,c,d}from"./chunk-OB5GRS7T.mjs";import"./chunk-45I2C2UB.mjs";import"./chunk-L4COZ7ZH.mjs";import"./chunk-4KY2EHXS.mjs";import"./chunk-UBMIPWJR.mjs";import"./chunk-7OZDWT6C.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-54LH63LM.mjs";import"./chunk-ZZ65CN5F.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.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-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.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};
@@ -1,142 +0,0 @@
1
- #!/usr/bin/env node
2
- import { createRequire as __createRequire } from 'module';
3
- import { fileURLToPath as __fileURLToPath } from 'url';
4
- import { dirname as __pathDirname } from 'path';
5
- const require = __createRequire(import.meta.url);
6
- const __filename = __fileURLToPath(import.meta.url);
7
- const __dirname = __pathDirname(__filename);
8
- import{a as H}from"./chunk-HIFIDMH5.mjs";import{a as J}from"./chunk-A5RNWWTH.mjs";import"./chunk-HZIORCPO.mjs";import"./chunk-WDGDFXSB.mjs";import"./chunk-NWY5M34K.mjs";import"./chunk-OGOCHZ3S.mjs";import{c as z,d as G}from"./chunk-742LOGHA.mjs";import{a as i}from"./chunk-PWMMLXZS.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-J6JZ4PQA.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import{c as B}from"./chunk-3JUE6MNF.mjs";import"./chunk-3FBCOCPD.mjs";import{a as K,b as F,c as g}from"./chunk-YUOTOCKK.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b as E}from"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import{d as v}from"./chunk-VPPHD762.mjs";import{q as O,r as N,s as $,t as se}from"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{f as D,g as U,j as T,n as ae}from"./chunk-SVZHJZ5T.mjs";import{a as _,o as oe}from"./chunk-CTWZQ7YI.mjs";import"./chunk-7AN7VQHN.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import{b as P,e as ie}from"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import{e as k,f as ne}from"./chunk-BUDZL4DW.mjs";import{a as m,e as M}from"./chunk-E66B27AL.mjs";import j from"node:fs/promises";import ce from"node:http";import R from"node:path";import a from"chalk";se();import{createHash as re,randomBytes as V}from"node:crypto";var q="pkce-v1",W=32;function L(r){return r.toString("base64url")}m(L,"base64Url");function Y(){let r=L(V(W)),e=L(V(W)),t=L(re("sha256").update(r,"ascii").digest());return{state:e,codeVerifier:r,codeChallenge:t,codeChallengeMethod:"S256"}}m(Y,"generatePkceMaterial");function Q(r){return new URLSearchParams({flow:q,port:String(r.port),device_id:r.deviceId,hostname:r.hostname,state:r.state,code_challenge:r.codeChallenge,code_challenge_method:"S256"})}m(Q,"buildCliLoginSearchParams");function X(r,e){if(r.get("key"))return{ok:!1,reason:"legacy-bearer",message:"This CLI requires PKCE login. Update the web app or set flow=pkce-v1; bearer tokens in the callback URL are no longer accepted."};let o=r.get("code"),n=r.get("state");return!o||!n?{ok:!1,reason:"missing",message:"Missing authorization code or state in callback"}:n!==e?{ok:!1,reason:"mismatch",message:"Login state mismatch \u2014 try `prjct login` again"}:{ok:!0,code:o,state:n}}m(X,"parsePkceCallback");function Z(r){return{flow:q,code:r.code,state:r.state,code_verifier:r.codeVerifier,device_id:r.deviceId,redirect_uri:`http://127.0.0.1:${r.port}/callback`}}m(Z,"buildExchangeBody");function ee(r){if(!r||typeof r!="object")return null;let e=r,t=e.apiKey??e.api_key,o=e.userId??e.user_id,n=e.email,s=e.deviceId??e.device_id;return!t||!o||!n||!s?null:{apiKey:t,userId:o,email:n,deviceId:s}}m(ee,"parseMintedKeyResponse");ne();oe();ae();ie();var te=class extends G{static{m(this,"SetupCommands")}async auth(e=null,t={}){switch(e?.split(" ")[0]||"status"){case"login":return t.md||i.fail("Manual token login is not supported. Run prjct login."),{success:!1,message:t.md?"## Error\nManual token login is not supported. Run `prjct login`.":""};case"logout":return await g.clearAuth(),await this.refreshDaemonAuth(),t.md||i.done("Logged out. Auth credentials cleared"),{success:!0,message:t.md?`## Auth
9
- - **Status**: Logged out`:""};default:{let n=await g.getStatus();return t.md?{success:!0,message:n.authenticated?`## Auth Status
10
- - **Authenticated**: Yes
11
- - **Email**: ${n.email||"N/A"}
12
- - **Token**: stored securely
13
- - **Last auth**: ${n.lastAuth||"N/A"}`:"## Auth Status\n- **Authenticated**: No\n- Run `prjct login` to connect"}:(n.authenticated?i.box("Auth Status",`Email: ${n.email||"N/A"}
14
- Token: stored securely
15
- Since: ${n.lastAuth||"N/A"}`):(i.info("Not authenticated"),i.info(`Run ${a.cyan("prjct login")} to connect`)),{success:!0,message:""})}}}async login(e={}){let t=await g.getStatus();if(t.authenticated)return e.md||(i.box("Already Authenticated",`Email: ${t.email}
16
- Token: stored securely`),i.info(`Run ${a.cyan("prjct logout")} first to re-authenticate`)),{success:!0,message:e.md?`## Already Authenticated
17
- - **Email**: ${t.email}
18
- - **Token**: stored securely
19
-
20
- Run \`prjct logout\` first to re-authenticate.`:""};let o=process.env.PRJCT_WEB_URL||F,n=process.env.PRJCT_API_URL||K,s=Y(),l={settled:!1,listenPort:0};return new Promise(h=>{let c=m(p=>{l.settled||(l.settled=!0,h(p))},"finish"),d=ce.createServer(async(p,u)=>{let x=new URL(p.url||"/","http://127.0.0.1"),w={"Content-Type":"text/html","Cache-Control":"no-store","Referrer-Policy":"no-referrer"};if(x.pathname==="/callback"){let f=X(x.searchParams,s.state);if(!f.ok){let S=(f.reason==="legacy-bearer",400);u.writeHead(S,w),u.end(this.buildErrorPage(f.message)),f.reason==="legacy-bearer"&&(e.md||(i.warn(f.message),i.info("Update prjct-cli-app or open the login URL with flow=pkce-v1")));return}let{verified:y,failureMessage:b,email:A}=await(async()=>{try{let S=Z({code:f.code,state:f.state,codeVerifier:s.codeVerifier,deviceId:await g.getDeviceId(),port:l.listenPort}),I=await fetch(`${n}/auth/cli/exchange`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(S)});if(!I.ok)return{verified:!1,failureMessage:`Exchange failed (${I.status})`,email:""};let C=ee(await I.json());return C?(await g.saveAuth(C.apiKey,C.userId,C.email),await g.write({apiUrl:n}),await B.testConnection()?{verified:!0,failureMessage:"",email:C.email}:(await g.clearAuth(),{verified:!1,failureMessage:"Could not verify credentials with prjct Cloud",email:C.email})):{verified:!1,failureMessage:"Malformed exchange response",email:""}}catch(S){return await g.clearAuth(),{verified:!1,failureMessage:S instanceof Error?S.message:"Could not store credentials securely",email:""}}})();y?(u.writeHead(200,w),u.end(this.buildSuccessPage(A))):(u.writeHead(401,w),u.end(this.buildErrorPage(b))),d.close(),y?(e.md||(i.step(3,3,"Connected"),i.stop(),i.box("Authentication Complete",`Email: ${A}
21
- Token: stored securely
22
- Status: Connected`)),await this.refreshDaemonAuth(),await this.autoSync(),c({success:!0,message:e.md?`## Authenticated
23
- - **Email**: ${A}
24
- - **Token**: stored securely`:""})):(e.md||i.fail(`Authentication failed: ${b}`),c({success:!1,message:e.md?`## Error
25
- Authentication failed: ${b}`:""}));return}u.writeHead(404,w),u.end("Not found")});d.listen(0,"127.0.0.1",async()=>{let p=d.address();if(!p||typeof p=="string"){d.close(),e.md||i.fail("Failed to start callback server"),c({success:!1,message:e.md?`## Error
26
- Failed to start callback server`:""});return}l.listenPort=p.port;let u=await g.getDeviceId(),x=await g.getHostname(),w=Q({port:l.listenPort,deviceId:u,hostname:x,state:s.state,codeChallenge:s.codeChallenge}),f=`${o}/auth/cli?flow=pkce-v1&port=${l.listenPort}`,y=`${o}/auth/cli?${w.toString()}`;i.step(1,3,"Opening browser..."),i.stop(),i.info(a.dim(f));let b=process.platform,A=b==="darwin"?`open "${y}"`:b==="win32"?`start "" "${y}"`:`xdg-open "${y}"`;try{await _(A)}catch{i.warn("Could not open browser automatically"),i.info("Visit the URL printed by your terminal session (full URL not echoed for safety)"),i.info(y)}i.step(2,3,"Waiting for authentication...")}),setTimeout(()=>{l.settled||(d.close(),i.stop(),e.md||(i.fail("Authentication timed out"),i.info(`Run ${a.cyan("prjct login")} to try again`)),c({success:!1,message:e.md?"## Error\nAuthentication timed out. Run `prjct login` to try again.":""}))},300*1e3)})}async logout(){return await g.clearAuth(),i.done("Logged out"),{success:!0,message:""}}async refreshDaemonAuth(){try{let{restartDaemon:e}=await import("./client-SKFMAUI5.mjs");await e()}catch{}}async autoSync(){try{let e=await E.readConfig(process.cwd()).catch(()=>null),t=e?.projectId;if(!t||!e.cloud?.enabled||e.cloud.paused)return;i.spin("Syncing project...");let o=await H.sync(t,{include:e.cloud.include??{}});if(i.stop(),o.success&&!o.skipped){let n=o.pushed?.count||0,s=o.pulled?.count||0;n>0||s>0?i.done(`Synced (${n} pushed, ${s} pulled)`):i.done("Synced \u2014 everything up to date")}}catch{i.stop()}}buildSuccessPage(e){return`<!DOCTYPE html>
27
- <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
28
- <title>prjct CLI Connected</title>
29
- <style>
30
- *{margin:0;padding:0;box-sizing:border-box}
31
- body{font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',sans-serif;
32
- background:#0a0a0a;color:#e5e5e5;display:flex;justify-content:center;align-items:center;min-height:100vh}
33
- .card{text-align:center;max-width:420px;padding:2.5rem}
34
- .logo{font-size:.875rem;letter-spacing:.05em;color:#a3a3a3;margin-bottom:2rem;font-family:ui-monospace,monospace}
35
- .logo span{color:#e5e5e5}
36
- .icon{width:64px;height:64px;border-radius:50%;background:rgba(34,211,238,.12);
37
- display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem}
38
- .icon svg{width:32px;height:32px;color:#22d3ee}
39
- h1{font-size:1.5rem;font-weight:600;margin-bottom:.75rem}
40
- .details{background:#141414;border:1px solid #262626;border-radius:8px;padding:1rem 1.25rem;
41
- margin:1.25rem 0;text-align:left;font-size:.875rem;line-height:1.75}
42
- .details .label{color:#888}
43
- .details .value{color:#e5e5e5}
44
- .hint{color:#666;font-size:.8125rem;margin-top:1rem}
45
- </style></head>
46
- <body><div class="card">
47
- <div class="logo"><span>prjct</span>/cli</div>
48
- <div class="icon"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
49
- <path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg></div>
50
- <h1>CLI Connected</h1>
51
- <div class="details">
52
- <span class="label">Account:</span> <span class="value">${e}</span><br>
53
- <span class="label">Token:</span> <span class="value">stored securely</span>
54
- </div>
55
- <p class="hint">Return to your terminal to continue.</p>
56
- </div></body></html>`}buildErrorPage(e){return`<!DOCTYPE html>
57
- <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
58
- <title>prjct CLI \u2014 Error</title>
59
- <style>
60
- *{margin:0;padding:0;box-sizing:border-box}
61
- body{font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',sans-serif;
62
- background:#0a0a0a;color:#e5e5e5;display:flex;justify-content:center;align-items:center;min-height:100vh}
63
- .card{text-align:center;max-width:420px;padding:2.5rem}
64
- .logo{font-size:.875rem;letter-spacing:.05em;color:#a3a3a3;margin-bottom:2rem;font-family:ui-monospace,monospace}
65
- .logo span{color:#e5e5e5}
66
- .icon{width:64px;height:64px;border-radius:50%;background:rgba(239,68,68,.12);
67
- display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem}
68
- .icon svg{width:32px;height:32px;color:#ef4444}
69
- h1{font-size:1.5rem;font-weight:600;margin-bottom:.75rem}
70
- .msg{background:#141414;border:1px solid #262626;border-radius:8px;padding:1rem 1.25rem;
71
- margin:1.25rem 0;font-size:.875rem;color:#f87171}
72
- .hint{color:#666;font-size:.8125rem;margin-top:1rem}
73
- </style></head>
74
- <body><div class="card">
75
- <div class="logo"><span>prjct</span>/cli</div>
76
- <div class="icon"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
77
- <path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg></div>
78
- <h1>Authentication Failed</h1>
79
- <div class="msg">${e}</div>
80
- <p class="hint">Return to your terminal and try again.</p>
81
- </div></body></html>`}async start(){let e=await v.checkInstallation(),t=(N(),M(O)),o=await t.detectCodex(),n=await t.detectAntigravity(),s=e.providerDetected,l=s?await t.getActiveProvider():null,h=s?l.displayName:o.installed?"OpenAI Codex":"AI agents";if(console.log(`\u{1F680} Setting up prjct for ${h}...
82
- `),!s&&!o.installed&&!n.installed&&(console.log("\u2139\uFE0F No local CLI runtime detected."),console.log(" prjct will still use AGENTS.md + MCP-compatible surfaces after init.")),s){console.log("\u{1F4E6} Installing p. command router...");let c=await v.installCommands();if(!c.success)return{success:!1,message:`\u274C Installation failed: ${c.error}`};if(console.log(`
83
- \u2705 Installed ${c.installed?.length??0} commands to:
84
- ${$.getDisplayPath(c.path||"")}`),(c.errors?.length??0)>0){console.log(`
85
- \u26A0\uFE0F ${c.errors?.length??0} errors:`);for(let d of c.errors??[])console.log(` - ${d.file}: ${d.error}`)}}return await this.installCodexSurface(o.installed,"Installed Codex skill"),await this.installAntigravitySurface(n.installed),await this.setupMcpServers(),await this.installProjectAgentSurfacesIfConfigured(),await this.saveSetupStamp(l?.name??(o.installed?"codex":n.installed?"antigravity":"claude")),console.log(`
86
- \u{1F389} Setup complete!`),console.log(`
87
- Next steps:`),console.log(` 1. Open ${h}`),console.log(" 2. Navigate to your project"),console.log(" 3. Run: prjct init"),{success:!0,message:""}}async setup(e={}){console.log(`\u{1F527} Reconfiguring prjct...
88
- `);let t=(N(),M(O)),o=await t.detectCodex(),n=await t.detectAntigravity(),l=(await v.checkInstallation()).providerDetected;if(e.force&&(console.log("\u{1F5D1}\uFE0F Removing existing installation..."),await v.uninstallCommands()),!l&&!o.installed&&!n.installed&&(console.log("\u2139\uFE0F No local CLI runtime detected."),console.log(" Continuing with universal AGENTS.md/MCP-compatible setup.")),l){console.log("\u{1F4E6} Installing p. command router...");let c=await v.installCommands();if(!c.success)return{success:!1,message:`\u274C Setup failed: ${c.error}`};if(console.log(`
89
- \u2705 Installed ${c.installed?.length??0} commands`),(c.errors?.length??0)>0){console.log(`
90
- \u26A0\uFE0F ${c.errors?.length??0} errors:`);for(let u of c.errors??[])console.log(` - ${u.file}: ${u.error}`)}console.log(`
91
- \u{1F4DD} Installing global configuration...`);let d=await v.installGlobalConfig(),p=d.path?$.getDisplayPath(d.path):"global config";d.success?d.action==="created"?console.log(`\u2705 Created ${p}`):d.action==="updated"?console.log(`\u2705 Updated ${p}`):d.action==="appended"&&console.log(`\u2705 Added prjct config to ${p}`):console.log(`\u26A0\uFE0F ${d.error}`)}else console.log("\u2139\uFE0F No Claude/Gemini global command surface detected; skipping CLI router cleanup.");let h=l?await t.getActiveProvider():null;if(h?.name==="claude"){console.log(`
92
- \u26A1 Installing status line...`);let c=await this.installStatusLine();c.success?console.log("\u2705 Status line configured"):console.log(`\u26A0\uFE0F ${c.error}`)}return await this.installCodexSurface(o.installed,"Codex skill installed"),await this.installAntigravitySurface(n.installed),await this.setupMcpServers(),await this.installProjectAgentSurfacesIfConfigured(),await this.saveSetupStamp(h?.name??(o.installed?"codex":n.installed?"antigravity":"claude")),console.log(`
93
- \u{1F389} Setup complete!
94
- `),this.showAsciiArt(),{success:!0,message:""}}async setupMcpServers(){await J()}async saveSetupStamp(e){try{let t=(await import("./editors-config-3N6VREZR.mjs")).default,o=R.join($.globalConfigDir,"runtime-surfaces");await t.saveConfig(P,o,e)}catch(t){console.log(`\u26A0\uFE0F Setup stamp failed (non-blocking): ${k(t)}`)}}async installProjectAgentSurfacesIfConfigured(){try{let e=process.cwd();if(!await E.isConfigured(e))return;let{writeProjectAgentSurfaces:o}=await import("./project-agent-surfaces-3BBZIQNI.mjs"),{detectInstalledAgents:n}=await import("./detection-MEYHME4X.mjs"),s=await o(e,{agents:await n(e),explicit:!0});s.prjctMd.action!=="unchanged"&&console.log("\u2705 Project PRJCT.md ready"),s.agentsMd.action!=="unchanged"&&console.log("\u2705 Project AGENTS.md ready"),s.claudeMd&&s.claudeMd.action!=="unchanged"&&console.log("\u2705 Project CLAUDE.md ready"),s.ideRules.length>0&&console.log(`\u2705 Project IDE rules ready: ${s.ideRules.join(", ")}`)}catch(e){console.log(`\u26A0\uFE0F Project agent surface setup failed (non-blocking): ${k(e)}`)}}async installCodexSurface(e,t){if(e)try{let{installCodexSkill:o,verifyCodexPRouterReady:n}=await import("./codex-skill-ZCAUF2RM.mjs");await o();let s=await n({autoRepair:!0});s.verified?(console.log(`\u2705 ${t}`),console.log("\u2705 Codex p. router ready")):(console.log(`\u26A0\uFE0F Codex skill setup incomplete: ${s.message||"router verification failed"}`),console.log(" Run `prjct setup` to retry Codex configuration."))}catch(o){console.log(`\u26A0\uFE0F Codex skill setup failed (non-blocking): ${k(o)}`)}}async installAntigravitySurface(e){if(e)try{let t=await import("node:os"),{getTemplateContent:o}=await import("./template-loader-SO6OHPJI.mjs"),n=R.join(t.homedir(),".gemini","antigravity","skills","prjct"),s=R.join(n,"SKILL.md"),l=o("antigravity/SKILL.md");if(!l)throw new Error("Antigravity SKILL.md template not found");await j.mkdir(n,{recursive:!0}),await j.writeFile(s,l,"utf-8"),console.log("\u2705 Antigravity skill installed")}catch(t){console.log(`\u26A0\uFE0F Antigravity skill setup failed (non-blocking): ${k(t)}`)}}async installStatusLine(){try{let e=$.getClaudeDir(),t=$.getClaudeSettingsPath(),o=R.join(e,"prjct-statusline.sh");if(await T(o)&&(await j.readFile(o,"utf-8")).includes("build_statusline"))return{success:!0};let n=`#!/bin/bash
95
- # prjct Status Line for Claude Code
96
- # Shows version update notifications and current task
97
-
98
- # Current CLI version (embedded at install time)
99
- CLI_VERSION="${P}"
100
-
101
- # Read JSON context from stdin (provided by Claude Code)
102
- read -r json
103
-
104
- # Extract cwd from JSON
105
- CWD=$(echo "$json" | grep -o '"cwd"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"cwd"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
106
-
107
- # Check if this is a prjct project
108
- CONFIG="$CWD/.prjct/prjct.config.json"
109
- if [[ -f "$CONFIG" ]]; then
110
- # Extract projectId
111
- PROJECT_ID=$(grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' "$CONFIG" | sed 's/.*"projectId"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
112
-
113
- if [[ -n "$PROJECT_ID" ]]; then
114
- # Upgrade notice \u2014 the daemon checks npm and writes this GLOBAL flag.
115
- # The statusline only READS it; it does no version comparison itself.
116
- UPDATE_STATUS="$HOME/.prjct-cli/state/update-status.json"
117
- if [[ -f "$UPDATE_STATUS" ]] && grep -q '"updateAvailable"[[:space:]]*:[[:space:]]*true' "$UPDATE_STATUS"; then
118
- LATEST=$(grep -o '"latest"[[:space:]]*:[[:space:]]*"[^"]*"' "$UPDATE_STATUS" | sed 's/.*"latest"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
119
- echo "\u26A0\uFE0F prjct v$LATEST available! Run p. upgrade"
120
- exit 0
121
- fi
122
-
123
- # Show current task if exists
124
- STATE="$HOME/.prjct-cli/projects/$PROJECT_ID/storage/state.json"
125
- if [[ -f "$STATE" ]]; then
126
- TASK=$(grep -o '"description"[[:space:]]*:[[:space:]]*"[^"]*"' "$STATE" | head -1 | sed 's/.*"description"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
127
- STATUS=$(grep -o '"status"[[:space:]]*:[[:space:]]*"[^"]*"' "$STATE" | head -1 | sed 's/.*"status"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
128
-
129
- if [[ -n "$TASK" ]] && [[ "$STATUS" == "active" ]]; then
130
- # Truncate task to 40 chars
131
- TASK_SHORT="\${TASK:0:40}"
132
- [[ \${#TASK} -gt 40 ]] && TASK_SHORT="$TASK_SHORT..."
133
- echo "\u{1F3AF} $TASK_SHORT"
134
- exit 0
135
- fi
136
- fi
137
- fi
138
- fi
139
-
140
- # Default: show prjct branding
141
- echo "\u26A1 prjct"
142
- `;await j.writeFile(o,n,{mode:493});let s=await T(t)?await D(t).catch(()=>null).then(l=>l??{}):{};return s.statusLine={type:"command",command:o},await U(t,s),{success:!0}}catch(e){return z(e)}}showAsciiArt(){console.log(a.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(""),console.log(a.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")),console.log(a.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")),console.log(a.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551")),console.log(a.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551")),console.log(a.bold.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551")),console.log(a.bold.cyan(" \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D")),console.log(""),console.log(` ${a.bold.cyan("prjct")}${a.magenta("/")}${a.green("cli")} ${a.dim.white(`v${P} installed`)}`),console.log(""),console.log(` ${a.yellow("\u26A1")} Improve developer + agent performance`),console.log(` ${a.green("\u{1F9E0}")} Rich project context without context bloat`),console.log(` ${a.cyan("\u{1F916}")} Human-in-the-loop work cycles`),console.log(""),console.log(a.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(""),console.log(a.bold.cyan("\u{1F680} Quick Start")),console.log(a.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(""),console.log(` ${a.bold("1.")} Initialize your project:`),console.log(` ${a.green("cd your-project && prjct init")}`),console.log(""),console.log(` ${a.bold("2.")} Start your first work cycle:`),console.log(` ${a.green('prjct work "build auth"')}`),console.log(""),console.log(` ${a.bold("3.")} Ship & celebrate:`),console.log(` ${a.green('prjct ship "user login"')}`),console.log(""),console.log(a.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(""),console.log(` ${a.dim("Documentation:")} ${a.cyan("https://prjct.app")}`),console.log(` ${a.dim("Report issues:")} ${a.cyan("https://github.com/prjct-app/cli/issues")}`),console.log(""),console.log(a.bold.magenta("Ship with better context.")),console.log("")}};export{te as SetupCommands};