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.
- package/CHANGELOG.md +10 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-UGHAG2SK.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-JIITQ6GY.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-CXWTU3RF.mjs +8 -0
- package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
- package/dist/bin/hook-chunks/capture-gate-PS6QUXLX.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-22AXWLI6.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-3WQBTXUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-4HAKTI36.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-4NTVXJD7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-5H3KJWQS.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-5XA5RL5I.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-6GAFRIUQ.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-76GDLA3Z.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-ABJNOG2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-BDOAQVIF.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BOBFTVAY.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-BU22R6JX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BX7VKYA7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-C4O243NG.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +36 -0
- package/dist/bin/hook-chunks/chunk-DCSKTMDX.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-DVDZA63F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-EWOK4VE7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-FW4MEPTB.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +69 -0
- package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-GCDLPKOH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-GDECEHO5.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-GDESYWTD.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HEDZA6KC.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-I26F7TLM.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IGHY4FGS.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-IWJG7CZX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-J5UQVJUW.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-KHLYWNHT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-KSSRINDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-MHNWIB7B.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-N3L77UNM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-NLKPAJND.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OGIFB3OE.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-OUAVSD47.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PGWFGRX4.mjs +47 -0
- package/dist/bin/hook-chunks/chunk-PO3QDKTE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-PP6DANGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-PTA7DMLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-QBYHZX33.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QL3NYJTW.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-QP5USCDX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-RHKF7EJW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-ROA2AJXY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-RTEEXGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-S5ISOGDB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-S5N2ZZDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-S6L3FECF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-T6ELTQZM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-TXSLON7M.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-U4OON3S7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-UHVYBU7F.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UYQC63MC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-V2FR2NPL.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-WGWE3CSC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-X5W2UYQK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-XXRAQZNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-YDBZO6I3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-Z6KVLCMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-ZFLIVOFX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/chunk-ZOX6OV6X.mjs +12 -0
- package/dist/bin/hook-chunks/client-CRXA774S.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-GTSLO7CD.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-UHSXC3UG.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
- package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-GDJ3QICX.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-FD47DPA3.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-ZUC7OEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-WNSTHDAA.mjs +12 -0
- package/dist/bin/hook-chunks/distill-GOGPFQFK.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-2CACBNS4.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-QF22RIK7.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-J3X3R225.mjs +8 -0
- package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-7A2DXVJA.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-SZWJH6XP.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-JLYUBKHR.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-JXYO62UE.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-CIYDXN2G.mjs +8 -0
- package/dist/bin/hook-chunks/notification-UA7RTVHG.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
- package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-375HH6TB.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-M3RAOZVB.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QRDYPZLZ.mjs +8 -0
- package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-bash-TWWFVNQ7.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-PTFF7JIN.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-325ALZKD.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-GOHVFAFH.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-MYNM5KI4.mjs +8 -0
- package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-RPGATIYJ.mjs +8 -0
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-XKHUAB4H.mjs +8 -0
- package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-6PF7MBAY.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-UEXQDGZE.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
- package/dist/bin/hook-chunks/setup-ZOHG6MGF.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-QVGTOO6U.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-FGDQVYHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-LAXGVLMY.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-XU35ZYNA.mjs +8 -0
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-OUG4PR7S.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-DMPBNBX7.mjs +8 -0
- package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-PIRHMHXL.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-QZL4OSM7.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SKXILJLJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SZLG6LVC.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-5J6BAMCW.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-ZRNKFTFF.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-PGYHFLEL.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/hook-fast-darwin-arm64 +0 -0
- package/dist/bin/hook-fast-darwin-x64 +0 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +737 -736
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/bin/prjct.mjs +1 -1
- package/dist/daemon/entry.mjs +651 -647
- package/dist/mcp/server.mjs +310 -312
- package/package.json +1 -1
- package/dist/bin/hook-chunks/auto-flush-5D4PKOMM.mjs +0 -8
- package/dist/bin/hook-chunks/capture-gate-EOOSAGAP.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A7SGMNOK.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-BNWB77U5.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-DLHSCKBJ.mjs +0 -15
- package/dist/bin/hook-chunks/chunk-DV7KV2O4.mjs +0 -38
- package/dist/bin/hook-chunks/chunk-EHP4DYVQ.mjs +0 -71
- package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-JRKGG2E3.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
- package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-MHRMV4WI.mjs +0 -31
- package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
- package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
- package/dist/bin/hook-chunks/chunk-OB5GRS7T.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-UB53HQMG.mjs +0 -14
- package/dist/bin/hook-chunks/chunk-UBMIPWJR.mjs +0 -19
- package/dist/bin/hook-chunks/chunk-VPPHD762.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-VV7VNUTF.mjs +0 -16
- package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
- package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
- package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
- package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
- package/dist/bin/hook-chunks/cwd-changed-FYNPPO73.mjs +0 -8
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
- package/dist/bin/hook-chunks/distill-W7QGQUDX.mjs +0 -8
- package/dist/bin/hook-chunks/enriched-recall-W7KYRYVR.mjs +0 -8
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
- package/dist/bin/hook-chunks/format-BOWFDUBP.mjs +0 -8
- package/dist/bin/hook-chunks/judgment-receipt-WGTFKID7.mjs +0 -8
- package/dist/bin/hook-chunks/land-cue-WLGSULSO.mjs +0 -9
- package/dist/bin/hook-chunks/land-synthesis-V7UH5QV6.mjs +0 -8
- package/dist/bin/hook-chunks/legacy-crew-sweep-MFE4BDNR.mjs +0 -24
- package/dist/bin/hook-chunks/memory-index-B53F5HAX.mjs +0 -10
- package/dist/bin/hook-chunks/notification-HJLS4L7Y.mjs +0 -8
- package/dist/bin/hook-chunks/post-edit-TT3XOG55.mjs +0 -8
- package/dist/bin/hook-chunks/pre-bash-2KKF4V6G.mjs +0 -11
- package/dist/bin/hook-chunks/pre-commit-UU4SKKWV.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-RTBLZPWH.mjs +0 -11
- package/dist/bin/hook-chunks/pre-package-LQTINBT4.mjs +0 -8
- package/dist/bin/hook-chunks/pre-search-UJU3XZ2K.mjs +0 -9
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
- package/dist/bin/hook-chunks/project-memory-YHQBRX3D.mjs +0 -8
- package/dist/bin/hook-chunks/project-style-evolution-HS6HYI7W.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-AYY7BZFG.mjs +0 -22
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
- package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
- package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
|
@@ -0,0 +1,24 @@
|
|
|
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 F}from"./chunk-B36LC2JR.mjs";import{a as N}from"./chunk-DYHYDHCW.mjs";import{e as f,g as x}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b,h as ne}from"./chunk-A6K4H3YT.mjs";import{a as Q,f as re}from"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import{c as R}from"./chunk-FW4MEPTB.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import p from"node:fs/promises";import d from"node:path";re();import{z as _}from"zod";ne();x();var D="crew:checkpoints",Y="crew/CHECKPOINTS.md",se=_.object({content:_.string(),source:_.enum(["default","user","migrated"]),updated_at:_.string().min(1)});function ie(){let t=R(Y);if(!t)throw new Error(`Missing bundled crew checkpoints template: ${Y}`);return t}l(ie,"getBundledDefault");var A=class{static{l(this,"CheckpointsStorage")}get(n){let e=f.getDoc(n,D);return e===null?{content:ie(),source:"default",updated_at:b()}:se.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)}},oe=new A,E=oe;x();x();import{z as S}from"zod";var M="team:enrollment",V=S.object({required:S.boolean(),minVersion:S.string().min(1),enrolledAt:S.string().min(1),enrolledBy:S.string().nullable().default(null)}),$=class{static{l(this,"TeamEnrollmentStorage")}get(n){let e=f.getDoc(n,M);return e===null?null:V.parse(e)}set(n,e){let r=V.parse(e);f.setDoc(n,M,r)}clear(n){f.deleteDoc(n,M)}};var ae=new $,C=ae;var P=".prjct/CHECKPOINTS.md",L=".prjct/team.json",I="migration:v2.19.8:last-flagged-checkpoints",H="migration:v2.19.8:last-flagged-team",O="migration:v3.77:last-ghost-purge-warn",q="migration:v3.77:last-agent-repair-warn",ce=["sessions","audits","deploy"],le=[/\.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],We=[".prjct/sessions/<task",".prjct/audits/",".prjct/deploy/"],ge=F.map(t=>({destRelative:`.claude/agents/${t.name}.md`,templateKey:`crew/roles/${t.name}.md`})),v="CLAUDE.md",W="CREW.md",me="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`) -->",ue="<!-- prjct:checkpoints:end -->",pe=["prjct.config.json","memory-export"];async function te(t){try{return(await p.stat(t)).mtimeMs}catch{return null}}l(te,"statMtimeMs");async function k(t){try{return await p.readFile(t,"utf-8")}catch{return null}}l(k,"tryReadFile");async function J(t){try{return await p.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-JK2MXRJB.mjs");await r.remember(t,{type:"inbox",content:n,tags:e,provenance:"declared"})}catch(r){N.debug("Legacy sweep inbox capture failed (non-critical)",{error:r instanceof Error?r.message:String(r)})}}l(y,"captureInboxWarning");function T(t){return le.some(n=>n.test(t))}l(T,"containsForbiddenWriteInstruction");function de(t,n){let e=F.find(o=>`.claude/agents/${o.name}.md`===n)?.role;if(!e)return t;let{model:r}=Q(e);return t.replace(/^model:[ \t].*$/m,`model: ${r}`)}l(de,"stampCrewModelPolicy");function fe(t,n){let e=t.indexOf(X),r=t.indexOf(ue);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(fe,"spliceCheckpoints");function we(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),m=a.indexOf(G),g=s>=0&&(m<0||s<=m)?{relative:s,length:U.length}:m>=0?{relative:m,length:G.length}:null;if(!g)return c.slice(0,i);let u=i+K.length+g.relative;return e(`${c.slice(0,i)}${c.slice(u+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(we,"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 he(t,n,e){let r=d.join(t,P),o=await te(r);if(o===null)return;let c=j(n,I),i=await k(r);if(i!==null)try{c===null?(E.set(n,i,"migrated"),w(n,I,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,I,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 p.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(he,"sweepCheckpoints");function ee(t){return{required:t.required===!0,minVersion:typeof t.minVersion=="string"?t.minVersion:"0.0.0",enrolledAt:typeof t.enrolledAt=="string"?t.enrolledAt:new Date().toISOString(),enrolledBy:typeof t.enrolledBy=="string"?t.enrolledBy:null}}l(ee,"parseTeamEnrollment");async function Ee(t,n,e){let r=d.join(t,L),o=await te(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),m=ee(s);C.set(n,m),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),m=ee(s);C.set(n,m)}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 p.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(Ee,"sweepTeamJson");async function z(t){let n=[],e=await p.readdir(t,{withFileTypes:!0}).catch(()=>[]);for(let r of e){let o=d.join(t,r.name);r.isDirectory()?n.push(...await z(o)):r.isFile()&&n.push(o)}return n}l(z,"listFilesRecursive");async function B(t,n,e,r){let o=new Set([".md",".txt",".json",".yml",".yaml",".toml",".csv",".log"]),c=d.extname(e).toLowerCase();if(!o.has(c)&&c!=="")return!1;let i=await p.readFile(e).then(g=>{if(g.byteLength>2e5)return null;let u=g.toString("utf-8");return u.includes("\0")?null:u}).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,m=["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-JK2MXRJB.mjs");return await g.remember(t,{type:"context",content:m,tags:{topic:"worktree-ghost-ingest",source_path:r,"migration:v3.77":"1"},provenance:"declared",projectId:n,force:!0}),!0}catch(g){return N.debug("Ghost file SQL ingest failed (non-critical)",{file:r,error:g instanceof Error?g.message:String(g)}),!1}}l(B,"ingestGhostFileToSql");async function ye(t,n,e){let r=d.join(t,".prjct");if(!await J(r))return;for(let c of ce){let i=d.join(r,c);if(await J(i))try{let a=await z(i);for(let s of a){let m=d.relative(t,s);await B(t,n,s,m)&&(e.ghostFilesIngested+=1)}await p.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(ye,"purgeWorktreeGhostDirs");async function Re(t,n,e){try{let s=E.get(n),m=Z(s.content);if(m!==s.content){let g=s.source==="user"?"user":"migrated";E.set(n,m,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 ge){let m=d.join(t,s.destRelative),g=await k(m);if(g===null||!T(g))continue;let u=R(s.templateKey);if(!u){e.errors.push({file:s.destRelative,reason:"template missing"});continue}try{let h=de(s.destRelative===".claude/agents/reviewer.md"?fe(u,Z(E.get(n).content)):u,s.destRelative);await p.mkdir(d.dirname(m),{recursive:!0}),await p.writeFile(m,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=d.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(me)?.trim();if(!g)e.errors.push({file:v,reason:"leader-mode template missing"});else try{let u=we(o,g);await p.writeFile(r,u,"utf-8"),e.agentFilesRepaired.push(v)}catch(u){e.errors.push({file:v,reason:u instanceof Error?u.message:String(u)})}}}let c=d.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 p.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,q)===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,q,Date.now()))}l(Re,"repairCrewDiskWriteInstructions");async function Se(t,n,e){let r=d.join(t,".prjct");if(!await J(r))return;let o=await p.readdir(r).catch(()=>[]);for(let i of o){if(pe.includes(i))continue;let a=d.join(r,i);try{let s=await p.stat(a);if(s.isDirectory()){let m=await z(a);for(let g of m){let u=d.relative(t,g);await B(t,n,g,u)&&(e.ghostFilesIngested+=1)}}else if(s.isFile()){let m=d.relative(t,a);i!=="CHECKPOINTS.md"&&i!=="team.json"&&await B(t,n,a,m)&&(e.ghostFilesIngested+=1)}await p.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(Se,"enforcePrjctConfigOnly");async function Ke(t,n){let e={checkpointsMigrated:!1,checkpointsHandEditWarned:!1,teamMigrated:!1,teamHandEditWarned:!1,ghostDirsPurged:[],agentFilesRepaired:[],ghostFilesIngested:0,clientPrjctJunkPurged:[],errors:[]};return await he(t,n,e).catch(r=>{e.errors.push({file:P,reason:r instanceof Error?r.message:String(r)})}),await Ee(t,n,e).catch(r=>{e.errors.push({file:L,reason:r instanceof Error?r.message:String(r)})}),await ye(t,n,e).catch(r=>{e.errors.push({file:".prjct/*/",reason:r instanceof Error?r.message:String(r)})}),await Se(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:".claude/agents/*",reason:r instanceof Error?r.message:String(r)})}),e}l(Ke,"legacyCrewSweep");export{pe as CLIENT_PRJCT_ALLOWLIST,We as FORBIDDEN_WORKTREE_WRITE_NEEDLES,le as FORBIDDEN_WORKTREE_WRITE_PATTERNS,ce as WORKTREE_GHOST_DIRS,T as containsForbiddenWriteInstruction,Ke as legacyCrewSweep};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-BOBFTVAY.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-4HAKTI36.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as L0_INDEX_FRESH_MS,b as L0_INDEX_MAX_CHARS,a as MEMORY_L0_INDEX_KEY,d as buildAndStoreMemoryL0Index,e as buildMemoryL0Index,i as findRepeatMissedEntry,g as isMemoryL0IndexFresh,f as loadMemoryL0Index,h as memoryL0IndexForSession};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b as f}from"./chunk-OWOPA2O7.mjs";import{a as c}from"./chunk-GPZP7NXL.mjs";import{a as e}from"./chunk-EWOK4VE7.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.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};
|
|
@@ -5,6 +5,6 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as k,b as d,c as v}from"./chunk-
|
|
8
|
+
import{a as k,b as d,c as v}from"./chunk-7YT2FGO7.mjs";import{b as y}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{d as g,g as $}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{b as m,h as T}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import{createHash as b}from"node:crypto";$();T();var h="packs:installs";function P(t){let n={name:t.name,version:t.version,description:t.description,memoryTypes:[...t.memoryTypes].sort(),workflowSlots:j(t.workflowSlots),hookSignals:t.hookSignals,suggestedTags:t.suggestedTags?Object.fromEntries(Object.entries(t.suggestedTags).sort(([e],[s])=>e.localeCompare(s)).map(([e,s])=>[e,[...s].sort()])):void 0,suggestedPersona:t.suggestedPersona,configDefaults:t.configDefaults};return b("sha256").update(JSON.stringify(n)).digest("hex").slice(0,16)}c(P,"packIntegrityHash");function j(t){let n={};for(let e of Object.keys(t).sort())n[e]=t[e];return n}c(j,"sortKeys");function u(t){try{let n=g.getDoc(t,h);return!n||typeof n!="object"?{}:n}catch{return{}}}c(u,"loadPackInstalls");function w(t,n){g.setDoc(t,h,n)}c(w,"savePackInstalls");function M(t,n,e=m()){let s=u(t),r=[];for(let o of n){let i=v(o);if(!i)continue;let a={name:i.name,version:i.version,integrity:P(i),activatedAt:e};s[o]=a,r.push(a)}return w(t,s),r}c(M,"stampPackInstalls");function O(t,n){let e=u(t),s=[];for(let r of n)e[r]&&(delete e[r],s.push(r));s.length>0&&w(t,e)}c(O,"clearPackInstalls");async function x(t){let n=await y.readConfig(t),e=new Set(n?.persona?.packs??[]),s=n?.projectId,r=s?u(s):{},o=[];for(let i of d){let a=k[i],f=P(a),p=e.has(i),l=r[i],I=p&&l&&(l.integrity!==f||l.version!==a.version)?"stale":p?"active":"available";o.push({name:a.name,version:a.version,description:a.description,integrity:f,active:p,status:I,memoryTypes:a.memoryTypes,slots:Object.keys(a.workflowSlots),receipt:l})}for(let i of e){if(k[i])continue;let a=r[i];o.push({name:i,version:a?.version??"?",description:"Unknown pack (not in built-in catalog)",integrity:a?.integrity??"\u2014",active:!0,status:"unknown",memoryTypes:[],slots:[],receipt:a})}return o.sort((i,a)=>i.name.localeCompare(a.name))}c(x,"buildPackCatalog");async function D(t){let e=(await x(t)).filter(o=>o.active),s=e.filter(o=>o.status==="stale").map(o=>o.name),r=e.filter(o=>o.status==="unknown").map(o=>o.name);return{ok:s.length===0&&r.length===0,active:e.length,stale:s,unknown:r,entries:e}}c(D,"verifyActivePacks");function K(t){let n=["# prjct pack catalog (marketplace-lite)","","Local built-in packs with version + integrity. Activate with `prjct seed add <name>`.","Not a third-party MCP marketplace \u2014 packs = persona + memory types + workflow slots.","","| Pack | Ver | Active | Status | Integrity | Description |","|---|---|---|---|---|---|"];for(let e of t){let s=e.active?"yes":"\u2014";n.push(`| \`${e.name}\` | ${e.version} | ${s} | ${e.status} | \`${e.integrity}\` | ${e.description.replace(/\|/g,"\\|")} |`)}return n.push(""),n.push("## Integrity"),n.push(""),n.push("- On `seed add`, prjct stamps `version@integrity` into project SoT (`packs:installs`)."),n.push("- `prjct seed verify` flags **stale** (CLI pack upgraded since activate) or **unknown**."),n.push("- Re-activate with `prjct seed add <name>` to refresh the receipt after upgrade."),n.push(""),n.join(`
|
|
9
9
|
`)}c(K,"formatPackCatalogMd");function V(t){let n=["# prjct pack verify","",t.ok?`**OK** \u2014 ${t.active} active pack(s), integrity clean.`:`**Attention** \u2014 ${t.stale.length} stale, ${t.unknown.length} unknown.`,""];if(t.stale.length&&n.push(`- Stale (re-add to refresh): ${t.stale.map(e=>`\`${e}\``).join(", ")}`),t.unknown.length&&n.push(`- Unknown (remove or restore): ${t.unknown.map(e=>`\`${e}\``).join(", ")}`),t.entries.length){n.push("","| Pack | Ver | Status | Integrity |","|---|---|---|---|");for(let e of t.entries)n.push(`| \`${e.name}\` | ${e.version} | ${e.status} | \`${e.integrity}\` |`)}return n.push(""),n.join(`
|
|
10
10
|
`)}c(V,"formatPackVerifyMd");export{h as PACK_INSTALLS_KEY,x as buildPackCatalog,O as clearPackInstalls,K as formatPackCatalogMd,V as formatPackVerifyMd,u as loadPackInstalls,P as packIntegrityHash,w as savePackInstalls,M as stampPackInstalls,D as verifyActivePacks};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as u,c as m}from"./chunk-
|
|
8
|
+
import{a as u,c as m}from"./chunk-7YT2FGO7.mjs";import{b as f}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as d}from"./chunk-E66B27AL.mjs";async function P(t){let i=await import("node:fs/promises"),n=await import("node:path"),s=new Set(["daily"]),o=["package.json","go.mod","Cargo.toml","pyproject.toml","Gemfile","pom.xml","build.gradle"];for(let e of o)try{await i.stat(n.join(t,e)),s.add("code");break}catch{}return[...s]}d(P,"detectSuggestedPacks");async function C(t){let i=await f.readConfig(t);if(!i)return{healed:!1,activated:[],reason:"no-config"};if(i.judgment?.conflictMode==="off")return{healed:!1,activated:[],reason:"conflictMode-off"};let n=i.persona?.packs??[];if(n.includes("code")||n.includes("code-strict"))return!i.judgment?.conflictMode&&n.includes("code")?(await f.writeConfig(t,{...i,judgment:{...i.judgment,conflictMode:"advisory"}}),{healed:!0,activated:[],reason:"conflictMode-healed"}):{healed:!1,activated:[],reason:"already-coding-pack"};if(!(await P(t)).includes("code"))return{healed:!1,activated:[],reason:"not-code-repo"};let e=await y(t,["code"],{suggestPersona:!0});return e.activated.includes("code")?{healed:!0,activated:e.activated,reason:"activated-code"}:{healed:!1,activated:[],reason:"noop"}}d(C,"ensureCodingAnticipationDefaults");async function y(t,i,n={}){let s=[],o=[],e=await f.readConfig(t);if(!e)throw new Error("No prjct project here \u2014 run `prjct init` first.");let a=e.persona??{role:"DEV"},r=new Set(a.packs??[]);for(let g of i){if(!u[g]){o.push(g);continue}r.has(g)||(r.add(g),s.push(g))}let l=[...r],c={...a,packs:l};n.suggestPersona&&s.length>0&&k(c,s);let p={...e,persona:c,...v(e,s)};if(await f.writeConfig(t,p),s.length>0&&e.projectId)try{let{stampPackInstalls:g}=await import("./pack-integrity-GZC5NGFN.mjs");g(e.projectId,s)}catch{}return{activated:s,skipped:o}}d(y,"activatePacks");function v(t,i){let n={};for(let s of i){let o=u[s]?.configDefaults;o&&(o.sdd&&!t.sdd&&(n.sdd={mode:o.sdd}),o.tdd&&!t.tdd&&(n.tdd={mode:o.tdd}),o.maxTurnsPerCycle!=null&&t.maxTurnsPerCycle==null&&n.maxTurnsPerCycle==null&&(n.maxTurnsPerCycle=o.maxTurnsPerCycle),o.deliveryGeometry&&!t.deliveryGeometry&&(n.deliveryGeometry={mode:o.deliveryGeometry}),o.land&&!t.land&&(n.land={mode:o.land}),o.conflictMode&&!t.judgment?.conflictMode&&(n.judgment={...t.judgment,...n.judgment,conflictMode:o.conflictMode}))}return n}d(v,"packConfigDefaults");async function j(t,i){let n=await f.readConfig(t);if(!n)throw new Error("No prjct project here \u2014 run `prjct init` first.");let s=n.persona??{role:"DEV"},o=new Set(s.packs??[]),e=[],a=[];for(let c of i)o.delete(c)?e.push(c):a.push(c);let r={...s,packs:[...o]},l={...n,persona:r};if(await f.writeConfig(t,l),e.length>0&&n.projectId)try{let{clearPackInstalls:c}=await import("./pack-integrity-GZC5NGFN.mjs");c(n.projectId,e)}catch{}return{deactivated:e,notActive:a}}d(j,"deactivatePacks");async function M(t){let n=(await f.readConfig(t))?.persona?.packs??[],s=await import("./pack-integrity-GZC5NGFN.mjs").then(({buildPackCatalog:a})=>a(t)).catch(()=>[]),o=Object.fromEntries(s.filter(a=>a.active).map(a=>[a.name,{version:a.version,integrity:a.integrity,status:a.status}])),e=[];for(let a of n){let r=u[a];if(!r){let c=o[a];e.push({name:a,description:"Unknown pack (not in built-in catalog)",memoryTypes:[],slots:[],version:c?.version,integrity:c?.integrity,status:c?.status??"unknown"});continue}let l=o[a];e.push({name:r.name,description:r.description,memoryTypes:r.memoryTypes,slots:Object.keys(r.workflowSlots),version:l?.version??r.version,integrity:l?.integrity,status:l?.status??"active"})}return e}d(M,"listActivePacks");function k(t,i){let n=t.role&&t.role!=="DEV",s=t.mcps&&t.mcps.length>0;for(let o of i){let e=m(o);if(e?.suggestedPersona&&(!n&&e.suggestedPersona.role&&(t.role=e.suggestedPersona.role),!t.focus&&e.suggestedPersona.focus&&(t.focus=e.suggestedPersona.focus),!s&&e.suggestedPersona.mcps&&(t.mcps=[...e.suggestedPersona.mcps]),t.role&&t.role!=="DEV"))break}}d(k,"applyPersonaSuggestion");export{y as activatePacks,j as deactivatePacks,P as detectSuggestedPacks,C as ensureCodingAnticipationDefaults,M as listActivePacks};
|
package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs}
RENAMED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d}from"./chunk-
|
|
8
|
+
import{a,b,c,d}from"./chunk-4KVPAHFV.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{d as checkPackageLegitimacy,b as decidePackageInstall,c as loadKnownDependencyNames,a as parsePackageInstallCommand};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{
|
|
8
|
+
import{v as a,w as b}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";b();export{a as default};
|
|
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-
|
|
9
|
-
`);n.note(t,"Configuration Summary");let e=await n.confirm({message:"Generate configuration with these settings?",initialValue:!0});return n.isCancel(e)||!e?(n.isCancel(e)&&this.handleCancel(),!1):!0}handleCancel(){this.aborted=!0,n.cancel("Setup cancelled. Run again anytime.")}getProjectTypeLabel(t){return h.find(e=>e.value===t)?.title||"Unknown"}getAgentLabel(t){return C.find(e=>e.value===t)?.title||t}formatStackDisplay(t){let e=[t.language];return t.framework&&e.push(t.framework),t.runtime&&t.runtime!=="Node.js"&&e.push(t.runtime),t.technologies.length>0&&e.push(`+ ${t.technologies.slice(0,3).join(", ")}`),e.join(" / ")}buildResult(t){return{projectType:this.confirmedType,agents:this.selectedAgents,stack:this.confirmedStack,preferences:this.preferences,skipped:t}}getSelectedAgents(){return this.selectedAgents}getConfirmedStack(){return this.confirmedStack}getPreferences(){return this.preferences}};var j={current:null};async function L(){if(!j.current){let{AnalysisCommands:k}=await import("./analysis-
|
|
8
|
+
import{a as f}from"./chunk-KSSRINDX.mjs";import{c as $,d as E}from"./chunk-S6L3FECF.mjs";import{a as M}from"./chunk-H4CA3XZ6.mjs";import{a as r}from"./chunk-MHNWIB7B.mjs";import{a as g}from"./chunk-J5UVRZ44.mjs";import"./chunk-NLKPAJND.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-3WQBTXUC.mjs";import{a as h,b as C,c as T,d as P,e as I}from"./chunk-XFQ7NNLN.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import{a as W,b as A}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import{d as S}from"./chunk-4KXXDQYI.mjs";import{v as O,w as Y}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-FW4MEPTB.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import{e as z,f as G}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";Y();G();import*as n from"@clack/prompts";import p from"chalk";var y=class{static{o(this,"OnboardingWizard")}projectPath;aborted=!1;detectedType="unknown";confirmedType="unknown";selectedAgents=[];detectedStack={language:"Unknown",technologies:[]};confirmedStack={language:"Unknown",technologies:[]};preferences={verbosity:"normal",autoSync:!0,telemetry:!1};constructor(t=process.cwd()){this.projectPath=t}async run(){n.intro(p.cyan.bold("\u26A1 prjct-cli setup"));let t=[{id:"project-type",title:"Project Type",run:o(()=>this.stepProjectType(),"run")},{id:"ai-agents",title:"AI Agents",run:o(()=>this.stepAIAgents(),"run")},{id:"stack",title:"Stack Confirmation",run:o(()=>this.stepStack(),"run")},{id:"preferences",title:"Preferences",run:o(()=>this.stepPreferences(),"run")},{id:"summary",title:"Summary",run:o(()=>this.stepSummary(),"run")}];for(let e of t)if(!await e.run()||this.aborted)return this.buildResult(!0);return n.outro(p.green("Setup complete!")),this.buildResult(!1)}async runNonInteractive(){r.spin("Auto-detecting project configuration..."),this.detectedType=await T(this.projectPath),this.confirmedType=this.detectedType;let t=await P(this.projectPath);return this.selectedAgents=t,this.detectedStack=await I(this.projectPath),this.confirmedStack=this.detectedStack,r.done("Configuration detected"),this.buildResult(!1)}async stepProjectType(){this.detectedType=await T(this.projectPath);let t=h.findIndex(i=>i.value===this.detectedType),e=await n.select({message:this.detectedType!=="unknown"?`Detected: ${this.getProjectTypeLabel(this.detectedType)}. Is this correct?`:"What type of project is this?",options:h.map(i=>({label:i.title,hint:i.description,value:i.value})),initialValue:t>=0?h[t].value:void 0});return n.isCancel(e)?(this.handleCancel(),!1):(this.confirmedType=e||this.detectedType,!0)}async stepAIAgents(){let t=await P(this.projectPath),e=C.map(a=>({label:a.title,hint:a.description,value:a.value})),i=await n.multiselect({message:"Which AI agents do you use?",options:e,initialValues:t,required:!0});return n.isCancel(i)?(this.handleCancel(),!1):(this.selectedAgents=i,!0)}async stepStack(){this.detectedStack=await I(this.projectPath);let t=this.formatStackDisplay(this.detectedStack);n.note(t,"Detected stack");let e=await n.confirm({message:"Is this stack correct?",initialValue:!0});if(n.isCancel(e))return this.handleCancel(),!1;if(e)this.confirmedStack=this.detectedStack;else{let i=await n.group({language:o(()=>n.text({message:"Primary language:",defaultValue:this.detectedStack.language}),"language"),framework:o(()=>n.text({message:"Framework (optional):",defaultValue:this.detectedStack.framework||""}),"framework")},{onCancel:o(()=>this.handleCancel(),"onCancel")});if(this.aborted)return!1;this.confirmedStack={...this.detectedStack,language:i.language||this.detectedStack.language,framework:i.framework||void 0}}return!0}async stepPreferences(){let t=await n.group({verbosity:o(()=>n.select({message:"Output verbosity:",options:[{label:"Minimal",hint:"Essential output only",value:"minimal"},{label:"Normal (Recommended)",hint:"Balanced information",value:"normal"},{label:"Verbose",hint:"Detailed logging",value:"verbose"}],initialValue:"normal"}),"verbosity"),autoSync:o(()=>n.confirm({message:"Auto-sync context on file changes?",initialValue:!0}),"autoSync")},{onCancel:o(()=>this.handleCancel(),"onCancel")});return this.aborted?!1:(this.preferences={verbosity:t.verbosity||"normal",autoSync:t.autoSync??!0,telemetry:!1},!0)}async stepSummary(){let t=[`${p.cyan("Project Type:")} ${this.getProjectTypeLabel(this.confirmedType)}`,`${p.cyan("AI Agents:")} ${this.selectedAgents.map(i=>this.getAgentLabel(i)).join(", ")}`,`${p.cyan("Stack:")} ${this.formatStackDisplay(this.confirmedStack)}`,`${p.cyan("Verbosity:")} ${this.preferences.verbosity}`,`${p.cyan("Auto-sync:")} ${this.preferences.autoSync?"Yes":"No"}`].join(`
|
|
9
|
+
`);n.note(t,"Configuration Summary");let e=await n.confirm({message:"Generate configuration with these settings?",initialValue:!0});return n.isCancel(e)||!e?(n.isCancel(e)&&this.handleCancel(),!1):!0}handleCancel(){this.aborted=!0,n.cancel("Setup cancelled. Run again anytime.")}getProjectTypeLabel(t){return h.find(e=>e.value===t)?.title||"Unknown"}getAgentLabel(t){return C.find(e=>e.value===t)?.title||t}formatStackDisplay(t){let e=[t.language];return t.framework&&e.push(t.framework),t.runtime&&t.runtime!=="Node.js"&&e.push(t.runtime),t.technologies.length>0&&e.push(`+ ${t.technologies.slice(0,3).join(", ")}`),e.join(" / ")}buildResult(t){return{projectType:this.confirmedType,agents:this.selectedAgents,stack:this.confirmedStack,preferences:this.preferences,skipped:t}}getSelectedAgents(){return this.selectedAgents}getConfirmedStack(){return this.confirmedStack}getPreferences(){return this.preferences}};var j={current:null};async function L(){if(!j.current){let{AnalysisCommands:k}=await import("./analysis-UGHAG2SK.mjs");j.current=new k}return j.current}o(L,"getAnalysisCommands");var N=class extends E{static{o(this,"PlanningCommands")}async _hintCommittedMemoryExport(t){try{let e=await import("node:fs/promises"),a=(await import("node:path")).join(t,".prjct","memory-export","manifest.json"),c=JSON.parse(await e.readFile(a,"utf-8"));c?.entries&&c.entries>0&&r.info(`\u{1F4E6} This repo ships ${c.entries} team memories (.prjct/memory-export/). Load them: prjct memory import`)}catch{}}async init(t={},e=process.cwd()){try{let i=typeof t=="string"||t===null?{idea:t}:t;if(await this.initializeAgent(),await A.isConfigured(e))return r.warn("already initialized"),{success:!1,message:"Already initialized"};let c=process.stdout.isTTY&&process.stdin.isTTY,s=i.yes||!c||process.env.CI==="true"?c&&i.yes?await new y(e).runNonInteractive():null:await new y(e).run();if(s?.skipped)return{success:!1,message:"Setup cancelled"};r.step(1,4,"Detecting author...");let u=await W(),R={name:u.name||void 0,email:u.email||void 0,github:u.github||void 0},d=(await A.createConfig(e,R)).projectId;await this._applyInitialPacksAndPersona(e,i),r.step(2,4,"Creating structure..."),await O.ensureProjectStructure(d),await this._seedShipWorkflow(d,e);let m=await this._detectEmptyDirectory(e),D=await this._detectExistingCode(e);if(D||!m){r.step(3,4,"Analyzing project...");let w=await L();if((await w.analyze({},e)).success){r.step(4,4,"Generating agents..."),await w.sync(e);let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),await this._hintCommittedMemoryExport(e),this._printNextSteps(s,b??void 0),{success:!0,mode:"existing",projectId:d,wizard:s}}}let v=i.idea;if(m&&!D){if(!v){await S.installGlobalConfig();let b=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("blank project - provide idea for architect mode"),this._printNextSteps(s,b??void 0),{success:!0,mode:"blank_no_idea",projectId:d,wizard:s}}r.spin("architect mode...");let{projectMemory:w}=await import("./project-memory-JK2MXRJB.mjs");await w.remember(e,{type:"idea",content:v,tags:{source:"architect-init",status:"awaiting-stack-recommendation"},source:"architect-init"}),await S.installGlobalConfig();let _=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("architect mode ready"),this._printNextSteps(s,_??void 0),{success:!0,mode:"architect",projectId:d,idea:v,wizard:s}}await S.installGlobalConfig();let V=await g(e,{agents:await this._agentSelections(s,e),explicit:!0}).catch(()=>null);return r.done("initialized"),this._printNextSteps(s,V??void 0),{success:!0,projectId:d,wizard:s}}catch(i){return r.fail(z(i)),$(i)}}async quickstart(t={},e=process.cwd()){let i=t.pack??"code,daily",a=await this.init({...t,yes:!0,pack:i},e);return!a.success&&a.message!=="Already initialized"?a:(console.log(""),console.log(" \u2500\u2500 quickstart ready \u2500\u2500"),console.log(" 1. Open your coding agent in this repo (Claude / Codex / Cursor / Grok)."),console.log(" 2. Say what to build \u2014 the agent runs `prjct work` for you."),console.log(" 3. Team brain without cloud: `prjct memory export` \u2192 commit \u2192 clone \u2192 import."),console.log(""),{...a,success:!0})}_printNextSteps(t,e){console.log(""),console.log(" \u2713 global prjct router refreshed where supported"),e?.claudeMd&&e.claudeMd.action!=="unchanged"&&console.log(" \u2713 project CLAUDE.md updated with routing block"),e?.agentsMd&&e.agentsMd.action!=="unchanged"&&console.log(" \u2713 project AGENTS.md updated with universal routing block"),(e?.ideRules.length??0)>0&&console.log(` \u2713 project IDE rules updated: ${e?.ideRules.join(", ")}`),console.log(""),console.log(" You don't run prjct commands. Your AI coding agent does."),console.log(""),console.log(" Just describe what you're doing \u2014 the agent reads the intent and"),console.log(" runs the right verb. Routine captures (decision, learning,"),console.log(" gotcha, idea) save automatically; ship and other destructive"),console.log(" verbs surface a one-line plan and wait for your OK."),console.log(""),console.log(" If you want to drive manually:"),console.log(" prjct sync Refresh context + skill body"),console.log(" prjct work Start a work cycle"),console.log(" prjct land Session-close checklist"),console.log(" prjct memory export Git-share team memory"),console.log(""),t&&t.agents.length>0&&(console.log(` Detected agents: ${t.agents.join(", ")}`),console.log("")),console.log(" Docs: https://prjct.app/docs"),console.log("")}async _agentSelections(t,e){if(t)return t.agents;try{let{detectInstalledAgents:i}=await import("./detection-QRVSNMKL.mjs");return i(e)}catch{return[]}}async _applyInitialPacksAndPersona(t,e){let{activatePacks:i,detectSuggestedPacks:a}=await import("./pack-manager-AF5F7PRT.mjs"),c=e.pack?e.pack.split(",").map(l=>l.trim()).filter(Boolean):e.persona?[]:await a(t);if(c.length>0&&await i(t,c,{suggestPersona:!0}),e.persona){let l=(await import("./config-manager-DX5OOPW5.mjs")).default,s=await l.readConfig(t);if(s){let u=s.persona??{role:e.persona};u.role=e.persona,await l.writeConfig(t,{...s,persona:u})}}}async _resolveInitialPrConvention(t,e){let{detectPrConventionSignal:i,defaultPrConventionFor:a}=await import("./pr-convention-5NPXQJ2R.mjs"),{customWorkflowStorage:c}=await import("./custom-workflow-storage-FD47DPA3.mjs"),l=await i(e),s=a(l),u=!!(process.stdout.isTTY&&process.stdin.isTTY),x=(l.kind==="github-ambiguous"&&u?await(async()=>{let d=await import("@clack/prompts"),m=await d.confirm({message:"This project ships to GitHub with no PR template. Should ship open/update the PR automatically?",initialValue:!0});return d.isCancel(m)?null:m?"auto":"manual"})():null)??s;c.updateWorkflow(t,"ship",{metadata:{prConvention:x}})}async _seedShipWorkflow(t,e){let i=await M(e);await this._resolveInitialPrConvention(t,e);let{seedCodeShipRules:a}=await import("./shipping-QVGTOO6U.mjs");await a(t,e);let c=f.getRulesForCommand(t,"ship").reduce((l,s)=>Math.max(l,s.sortOrder??0),0)+1;f.addRule(t,{type:"gate",command:"ship",position:"before",action:'git branch --show-current | grep -vE "^(main|master)$"',description:"Prevent shipping from main branch",enabled:!0,timeoutMs:5e3,sortOrder:c,createdAt:new Date().toISOString()}),i.lint&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.lint.command} || true`,description:"Lint code",enabled:!0,timeoutMs:12e4,sortOrder:c+1,createdAt:new Date().toISOString()}),i.test&&f.addRule(t,{type:"step",command:"ship",position:"before",action:`${i.test.command} || true`,description:"Run tests",enabled:!0,timeoutMs:3e5,sortOrder:c+(i.lint?2:1),createdAt:new Date().toISOString()})}};export{N as PlanningCommands};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a}from"./chunk-GPZP7NXL.mjs";import{a as e}from"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function u(f=process.cwd(),c){return a({event:"PostToolUse",projectPath:f,afterEmit:o(async(t,r)=>{let i=t.tool_input?.file_path;if(!(!i||!(await n.readConfig(r))?.projectId))try{await e.log(r,"post_edit",{file:i,tool:t.tool_name??"unknown"})}catch{}},"afterEmit")},c)}o(u,"runPostEditHook");export{u as runPostEditHook};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b}from"./chunk-
|
|
8
|
+
import{a,b}from"./chunk-BCAHWZH7.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{b as defaultPrConventionFor,a as detectPrConventionSignal};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as d}from"./chunk-OUAVSD47.mjs";import{a as k}from"./chunk-4NTVXJD7.mjs";import{c as l}from"./chunk-MXHX44WF.mjs";import{a as m,c as p}from"./chunk-76GDLA3Z.mjs";import{a as u}from"./chunk-GPZP7NXL.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as r}from"./chunk-E66B27AL.mjs";var s=new WeakMap;function f(e){let o=e.tool_input??e.toolInput;return o&&typeof o.command=="string"?o.command:typeof e.command=="string"?e.command:o&&typeof o.command_line=="string"?o.command_line:""}r(f,"extractCommand");function y(e){let o=f(e),t=o?l(o):null;return t?{deny:t}:null}r(y,"decideBroadProcessTermination");function g(e,o){let t=o,n=s.get(t);if(n)return n;let a=d(e,o);return s.set(t,a),a}r(g,"evaluatePackageOnce");function x(e=process.cwd(),o){return u({event:"PreToolUse",projectPath:e,decide:r(async(t,n)=>{try{let a=k(t);if(a)return a;let c=y(t);if(c)return c;let i=await g(n,t);return i?.strict?{deny:i.message}:null}catch{return null}},"decide"),build:r(async(t,n)=>{try{let[a,c]=await Promise.all([p(t)?m(n):null,g(n,t)]),i=c&&!c.strict?`# prjct: package legitimacy (advisory)
|
|
9
|
+
${c.message}`:null;return[a,i].filter(Boolean).join(`
|
|
10
|
+
|
|
11
|
+
`)||null}catch{return null}finally{s.delete(t)}},"build")},o)}r(x,"runPreBashHook");export{y as decideBroadProcessTermination,x as runPreBashHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c}from"./chunk-76GDLA3Z.mjs";import"./chunk-GPZP7NXL.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as buildPreCommitContext,c as isCommitInput,b as runPreCommitHook};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as R}from"./chunk-4NTVXJD7.mjs";import{a as E}from"./chunk-5WAONIPX.mjs";import{a as A}from"./chunk-GPZP7NXL.mjs";import{a as x}from"./chunk-N3L77UNM.mjs";import{a as b,b as M,c as T,d as C,e as g,f as k,g as m,i as w}from"./chunk-PP6DANGV.mjs";import"./chunk-4HAKTI36.mjs";import{b as I,c as S,d as $}from"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as L}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{b as v}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import{i as p}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var O=new Set(["decision","gotcha","fact","spec","identity","voice","glossary"]);function N(r){return O.has(r)}i(N,"isSotBindType");function V(r,o){let n=new Set(o??[]);return r.filter(e=>N(e.type)&&e.confidence==="high"&&e.id&&!n.has(e.id))}i(V,"filterSotCandidates");function H(r){let o=V(r.candidates,r.overriddenIds);if(o.length===0)return{action:"none",reason:"no-sot",memoryIds:[],message:""};let n=r.harnessLevel??null,e=r.fileLabel?` on \`${r.fileLabel}\``:"",t=o[0],a=o.map(s=>s.id),l='To supersede: `prjct remember decision "\u2026why\u2026" --tags supersedes:'+t.id+'`. To lift for this memory: `prjct remember feedback "override conflict '+t.id+': <why>" --tags conflict:override,memory:'+t.id+"`.";if(n==="H2"||n==="H3"){let s=`SoT hard-bind (${n})${e}: must not contradict [${t.type}] ${B(t.content,80)} (\`${t.id}\`)`;return{action:"deny",reason:"h2-sot-deny",memoryIds:a,message:[`\u26D4 prjct SoT bind: ${s}`,`Memories: ${a.join(", ")}`,l,"H2+ work is bound to living Source-of-Truth. Supersede or override before Edit|Write."].join(" ")}}return n==="H1"?{action:"warn",reason:"h1-sot-warn",memoryIds:a,message:["# prjct: SoT soft-bind (H1)","",`High-confidence SoT on this file${e}:`,...o.slice(0,3).map(s=>`- **[${s.type}]** ${B(s.content,100)} \`${s.id}\``),"",l,"","> H2+ would hard-block. On H1 this is advisory \u2014 supersede if intentional."].join(`
|
|
9
|
+
`)}:{action:"none",reason:"none",memoryIds:a,message:""}}i(H,"sotBindVerdict");function B(r,o){let n=r.replace(/\s+/g," ").trim();return n.length>o?`${n.slice(0,o-1)}\u2026`:n}i(B,"truncate");function F(r,o){if(o.length===0)return null;let n=[`# prjct: heads-up before editing \`${r}\``,"",`${o.length} preventive trap(s) recorded against this file:`,""];for(let e of o)n.push(`- **[${e.type}]** ${e.title} \`${e.id}\``);return n.push(""),n.push("> Dynasty trap-before-edit: surface is mandatory. Apply if it still holds; supersede if not."),n.join(`
|
|
10
|
+
`)}i(F,"formatTrapSurfaceMessage");var y=1200,_=new Map;function D(r,o){let n=`${r}\0${o}`,e=_.get(n);if(e)return e;let t=(()=>{try{return L.recallForFile(r,o,M,{preventiveOnly:!0})}catch{return[]}})();return _.set(n,t),t}i(D,"recallPreventiveOnce");function P(){_.clear()}i(P,"clearPreventiveCache");function U(r,o){let n=F(o,r.map(t=>({id:t.id,type:I(t),title:`${$(t)} \u2014 ${S(t.content)}`})));if(n)return p(n,y);let e=[`# prjct: heads-up before editing \`${o}\``,""];e.push(`${r.length} preventive memory entr${r.length===1?"y":"ies"} recorded against this file:`),e.push("");for(let t of r)e.push(`- **[${I(t)}] ${$(t)}** \u2014 ${S(t.content)} \`${t.id}\``);return e.push(""),e.push("> Nudge, not block. Apply if it still holds; proceed if not."),p(e.join(`
|
|
11
|
+
`),y)}i(U,"headsUpMessage");async function W(r,o){let n=Date.now(),e=await h.readConfig(r);if(!e?.projectId)return null;let t=D(e.projectId,o);if(m(n)||t.length===0)return null;x(e.projectId,r,t.map(f=>f.id));let a=w(e),l=C(e.projectId),s=k(t),u=o.split("/").pop()??o,d=T({mode:a,candidates:s,overriddenIds:l,fileLabel:u});if(m(n))return null;try{let f=await v.getCurrentTask(e.projectId),c=H({harnessLevel:f?.harness?.level??null,candidates:s,overriddenIds:l,fileLabel:u});if(c.action==="warn"&&c.message)return p(c.message,y)}catch{}return d.action==="warn"&&d.message?(g(r,e.projectId,"warn",d.memoryIds,d.reason),p(d.message,y)):a==="off"||d.action==="none"||t.length>0?U(t,u):null}i(W,"buildPreEditContext");async function G(r,o){let n=Date.now();try{let e=await h.readConfig(r);if(!e?.projectId)return null;let t=await v.getCurrentTask(e.projectId);if(e.maxTurnsPerCycle){let j=E(e,t);if(j.stopped)return{deny:j.message}}if(!o||m(n,b))return null;let a=D(e.projectId,o);if(a.length===0||m(n,b))return null;let l=C(e.projectId),s=o.split("/").pop()??o,u=k(a),d=H({harnessLevel:t?.harness?.level??null,candidates:u,overriddenIds:l,fileLabel:s});if(d.action==="deny"&&d.message)return g(r,e.projectId,"deny",d.memoryIds,d.reason),{deny:d.message};let f=w(e);if(f!=="strict")return null;let c=T({mode:f,candidates:u,overriddenIds:l,fileLabel:s});return c.action==="deny"&&c.message?(g(r,e.projectId,"deny",c.memoryIds,c.reason),{deny:c.message}):null}catch{return null}}i(G,"decideHardStop");function ce(r=process.cwd(),o){return A({event:"PreToolUse",projectPath:r,decide:i(async(n,e)=>{P();let t=R(n);return t||G(e,n.tool_input?.file_path?.trim())},"decide"),build:i(async(n,e)=>{try{let t=n.tool_input?.file_path?.trim();return t?W(e,t):null}finally{P()}},"build")},o)}i(ce,"runPreEditHook");export{ce as runPreEditHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b}from"./chunk-OUAVSD47.mjs";import"./chunk-GPZP7NXL.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as evaluatePrePackageInput,b as runPrePackageHook};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as d}from"./chunk-GPZP7NXL.mjs";import{g as p,j as g}from"./chunk-22AXWLI6.mjs";import{i as u}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as f}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";var _=900,h=80,b=8;function m(e){let o=e.tool_input?.pattern??e.tool_input?.query??e.tool_input?.glob??"";if(!o||typeof o!="string")return null;let t=o.match(/[A-Za-z_][A-Za-z0-9_]{2,}/g);if(!t||t.length===0)return null;t.sort((n,s)=>s.length-n.length);let r=new Set(["the","and","for","from","import","export","function","class","const","type","interface","return","async","await","true","false","null","undefined","test","describe","src","core","node","modules"]);for(let n of t)if(!r.has(n.toLowerCase()))return n;return t[0]??null}l(m,"extractToken");async function k(e,o){let t=Date.now();try{let r=(o.tool_name??"").toLowerCase();if(r&&!/grep|glob|search/i.test(r))return null;let n=m(o);if(!n)return null;let s=await f.readConfig(e);if(!s?.projectId||!p(s.projectId)||Date.now()-t>h)return null;let a=g(s.projectId,n,{limit:b});if(a.length===0||Date.now()-t>h)return null;let c=["# prjct code graph (non-blocking)","",`Grep/Glob token \`${n}\` matches indexed symbols \u2014 prefer these before more tree walks:`,""];for(let i of a)c.push(`- **${i.name}** (${i.kind}${i.exported?", exported":""}) \u2014 \`${i.file}:${i.startLine}\``);return c.push(""),c.push(`> Expand: \`prjct code trace ${n}\` or MCP \`prjct_trace_path\`. This inject never blocks the tool.`),u(c.join(`
|
|
9
|
+
`),_)}catch{return null}}l(k,"buildSearchAugment");async function x(e,o){await d({event:"PreToolUse",projectPath:e,build:l((t,r)=>k(r,t),"build")},o)}l(x,"runPreSearchHook");var j={extractToken:m,buildSearchAugment:k};export{j as _internal,x as runPreSearchHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c}from"./chunk-4NTVXJD7.mjs";import"./chunk-GPZP7NXL.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{c as _internal,a as decideSecrets,b as runPreSecretsHook};
|
package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs}
RENAMED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-
|
|
8
|
+
import{A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z}from"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-E66B27AL.mjs";export{a as HOT_PATH_RE,h as PREFER_CONST_CLAIM_RE,w as actionableOpen,y as advanceFixRound,v as applyBatchRefutation,g as applyEvidenceTax,r as applyGhostFilter,j as applyMechanicalStyleRefute,M as applyScopeFreeze,N as applyScopeFreezeAll,n as applySeverityFloor,o as applySeverityFloorAll,k as blastRank,G as buildNextAction,F as buildReReviewBrief,x as canStartFixRound,C as computePrecisionHint,D as computeVerdict,R as createLedger,f as evidenceScore,E as finalizeLedger,e as findingDna,O as findingInFixScope,d as intensityFromChangeset,H as intensityProtocol,m as isActionableSeverity,b as isHotPath,i as isPreferConstClaim,I as judgmentShipVerdict,A as markFindings,B as markFindingsSkippedByScope,p as markGhost,z as markLeftoversOpen,s as mergeDualJudges,P as newFindingId,Q as newLedgerId,K as normalizeScopePath,L as pathInScope,l as rankFindingsForFix,q as recordRefutedAsGhosts,t as refutePanelSize,u as resolveRefuteVotes,c as routeIntensity,J as upsertFinding};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d}from"./chunk-
|
|
8
|
+
import{a,b,c,d}from"./chunk-NLKPAJND.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as buildPrjctMdBody,a as buildProjectFactsSection,d as formatProjectFactsMd,c as writeProjectPrjctMd};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a}from"./chunk-
|
|
8
|
+
import{a}from"./chunk-J5UVRZ44.mjs";import"./chunk-NLKPAJND.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-FW4MEPTB.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as writeProjectAgentSurfaces};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-
|
|
8
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-Z6KVLCMK.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as FILE_INVENTORY_DOC_KEY,b as buildFileInventory,j as formatInventorySummary,g as inventoryExtensions,i as inventoryPathWeight,c as languagesFromExtensions,e as loadFileInventory,h as pathMatchesInventory,f as refreshFileInventory,d as saveFileInventory};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as projectMemory};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d,e,f,g}from"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{f as bridgeStyleToMemory,g as formatProjectStyleForSync,a as getActiveProjectStyle,b as getProjectEvolution,d as persistProjectStyleSnapshot,e as recomputeProjectStyle,c as renderProjectEvolution};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as A,b as J}from"./chunk-MXHX44WF.mjs";import{a as X}from"./chunk-BDOAQVIF.mjs";import{a as K}from"./chunk-5WAONIPX.mjs";import{a as z,d as W}from"./chunk-GLPKMG5A.mjs";import"./chunk-QBYHZX33.mjs";import{a as V}from"./chunk-GPZP7NXL.mjs";import{b as x}from"./chunk-2UC4DTDO.mjs";import"./chunk-BOBFTVAY.mjs";import{a as F}from"./chunk-5TBQNW2G.mjs";import{a as q}from"./chunk-N3L77UNM.mjs";import{a as M}from"./chunk-DVDZA63F.mjs";import{a as B}from"./chunk-EWOK4VE7.mjs";import{a as N}from"./chunk-ZOX6OV6X.mjs";import{b as O}from"./chunk-WGWE3CSC.mjs";import"./chunk-T6ELTQZM.mjs";import{b as U}from"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-GDESYWTD.mjs";import{a as H,g as L}from"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-OGIFB3OE.mjs";import"./chunk-BU22R6JX.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-4HAKTI36.mjs";import{d as v}from"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as w}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{b as j}from"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import{h as $,i as k}from"./chunk-Z4X7JIAP.mjs";import"./chunk-GAOQHD5S.mjs";import{b as S}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{d as _,g as at}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as R,o as ct}from"./chunk-UH4MD3F3.mjs";import{b as G,p as ot}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as d}from"./chunk-E66B27AL.mjs";import{createHash as D}from"node:crypto";import y from"node:fs/promises";import h from"node:path";var ut=15;function Y(e){let i=[],t=[];e.loop?.stopped&&e.loop.message&&(i.push("loop-hard-stop"),t.push(e.loop.message)),e.pressure?.level==="critical"&&e.pressure.cue?(i.push("context-pressure-critical"),t.push(e.pressure.cue)):e.pressure?.level==="warn"&&e.pressure.cue&&(i.push("context-pressure-warn"),t.push(e.pressure.cue)),e.qualityInject?.trim()&&(i.push("quality-ledger"),t.push(e.qualityInject.trim()));let r=e.turns??0,n=e.stuckThreshold??ut;if(!e.loop?.stopped&&r>=n&&(i.push("stuck-cycle"),t.push(`\u26A0 ${r} turns on this cycle and it is still open. If you are not nearly done, STOP looping: split it, ship the slice that works, or check in with the user \u2014 then \`prjct status done\`. A re-plan beats another grinding turn.`)),t.length===0)return{level:"ok",markdown:null,cues:[]};let c=i.some(l=>["loop-hard-stop","context-pressure-critical","context-pressure-warn"].includes(l)),s=i.some(l=>["quality-ledger","stuck-cycle"].includes(l)),u=c?"hard":s?"warn":"ok",g=u==="hard"?"# prjct: alignment (MUST \u2014 hard gate)":"# prjct: alignment (mid-cycle)",p=t.join(`
|
|
9
|
+
|
|
10
|
+
`),o=i.includes("quality-ledger")&&!p.includes("prjct ship")?`
|
|
11
|
+
|
|
12
|
+
_${H}_`:"";return{level:u,cues:i,markdown:`${g}
|
|
13
|
+
|
|
14
|
+
${p}${o}`}}d(Y,"buildAlignmentCard");at();ot();ct();var T=1500,lt=T+2100,Z=15,P=8,Q=420,dt=2,pt=15e3;var gt=new Set(["address","apply","check","continue","create","current","description","feedback","handle","merge","monitor","please","review","should","title","watch","write"]),C=new WeakMap,b=new Map;async function tt(e,i){let t=i!==void 0?i:await S.readConfig(e);if(!t?.projectId)return null;let r=mt(t,e),n=["# prjct: project state"];try{let s=await B(t.projectId,e);if(s.current){let g=nt(s.current.startedAt);n.push(`- Active work cycle: "${s.current.description}" (${g}) [${s.current.label}]`),(t.land?.mode??"advisory")!=="off"&&n.push(' \u21B3 Before session end: `prjct land` \xB7 hand-off `prjct remember context "Session close: \u2026"`');let{turns:p,loopVerdict:o,currentTask:l}=(()=>{try{let a=s.mainTaskRaw;return{turns:a?.turnCount??0,currentTask:a,loopVerdict:K(t,a)}}catch{return{turns:0,currentTask:null,loopVerdict:null}}})();!o?.stopped&&p<Z&&n.push(" \u21B3 Stay on this goal. Each turn, before acting: is this step ADVANCING it? If you have hit the same wall twice, or you are exploring rather than progressing, STOP \u2014 re-plan, split the cycle, or ask the user. Do not loop; finish the cycle, then `prjct status done`.");try{let a=t.maxTokensPerCycle??0;if(a>0&&l){let m=(l.tokensIn??0)+(l.tokensOut??0);m>=a?n.push(` \u26A0 Token budget: ${m.toLocaleString()} of ${a.toLocaleString()} spent on this cycle. STOP growing it \u2014 ship the working slice, split the remainder into a new cycle, or check in with the user.`):m>=a*.8&&n.push(` \u21B3 Token budget: ${m.toLocaleString()} of ${a.toLocaleString()} (${Math.round(m/a*100)}%). Plan the close: prefer finishing over expanding scope.`)}}catch{}try{let a=s.current.startedAt;if(a){let m=_.get(t.projectId,`SELECT COUNT(DISTINCT json_extract(data, '$.file')) AS c
|
|
15
|
+
FROM events WHERE type = 'memory.post_edit' AND timestamp >= ?`,a)?.c??0,f=U(m);f&&n.push(` ${f}`)}}catch{}try{let a=F(t,l),m=L(t.projectId),f=Y({loop:o,pressure:a,qualityInject:m,turns:p,stuckThreshold:Z});f.markdown&&(n.push(""),n.push(f.markdown))}catch{}l?.ownerAgent&&n.push(`- Owner: ${l.ownerAgent}${l.ownerIdentity?`/${l.ownerIdentity}`:""}${l.yieldStatus==="yielded"?" (yielded \u2014 awaiting accept)":""}`)}let u=s.all.filter(g=>!g.isCurrent);u.length>0&&n.push(`- ${u.length} task(s) active in other workspace(s)`),!s.current&&u.length>0&&n.push("- This workspace idle but siblings busy \u2014 `prjct work` auto-isolates to a worktree when needed")}catch{}let c=await r;for(let s of c)s&&n.push(s);return n.length===1?null:n.join(`
|
|
16
|
+
`)}d(tt,"buildProjectState");function mt(e,i){return Promise.all([(async()=>{try{let{formatPendingHandoffCue:t}=await import("./agent-switch-4ZJJWKMD.mjs"),r=t(e.projectId);return r?`- ${r.replace(/\n/g,`
|
|
17
|
+
- `)}`:null}catch{return null}})(),(async()=>{try{let t=await N.getActiveTasks(e.projectId);return t.length>0?`- Pending: ${t.length} \xB7 Next: "${t[0].description}"`:null}catch{return null}})(),(async()=>{try{if(!await R(h.join(i,".git")))return null;let t=await It(i);if(!t.branch)return null;let r=[];t.modified>0&&r.push(`${t.modified} modified`),t.staged>0&&r.push(`${t.staged} staged`),t.untracked>0&&r.push(`${t.untracked} untracked`);let n=r.length>0?` \u2014 working tree ${r.join(", ")}`:"",c=t.ahead>0?`${n?",":" \u2014"} ${t.ahead} unpushed`:"";return`- Branch: ${t.branch}${n}${c}`}catch{return null}})(),(async()=>{try{let t=await M.getRecent(e.projectId,1);if(t.length===0)return null;let r=t[0],n=nt(r.shippedAt??"");return`- Last ship: ${r.version?`v${r.version}`:r.name} (${n})`}catch{return null}})(),(async()=>{try{let t=w.countByType(e.projectId,"inbox");return t>0?`- Inbox: ${t} items pending`:null}catch{return null}})()])}d(mt,"collectSecondarySignals");function ht(e){return e.type==="voice"||e.type==="glossary"?!0:e.type==="example"&&!!e.tags.domain&&(e.tags.polarity==="good"||e.tags.polarity==="bad")}d(ht,"isValidGuidanceEntry");function ft(e,i){try{let t=A(i),r=$(i).filter(o=>o.length>=5&&!gt.has(o)),n=r.length>0?w.searchFts(e,r,P*2):[],c=t?w.recall(e,{types:["voice","glossary","example"],limit:P*2}).filter(o=>o.tags.domain==="delivery"||o.tags.domain===t):[],s=new Map([...n,...c].map(o=>[o.id,o])),u=new Map([["voice",0],["glossary",1],["example",2]]),g=[...s.values()].filter(ht).sort((o,l)=>(u.get(o.type)??3)-(u.get(l.type)??3)).slice(0,dt);if(g.length===0)return null;let p=["# prjct: selective guidance"];for(let o of g){let l=o.type==="example"?` ${o.tags.polarity}/${o.tags.domain}`:o.tags.domain?` ${o.tags.domain}`:"",a=Q-p.join(`
|
|
18
|
+
`).length-l.length-8;if(a<24)break;let m=k(o.content.replace(/\s+/g," ").trim(),Math.min(150,a));p.push(`- ${o.type}${l}: ${m}`)}return p.length===1?null:{text:k(p.join(`
|
|
19
|
+
`),Q),memoryIds:g.slice(0,p.length-1).map(o=>o.id)}}catch{return null}}d(ft,"buildSelectiveGuidance");function yt(e,i,t=T){if(!i)return e;let r=e?`${e}
|
|
20
|
+
|
|
21
|
+
${i}`:i;return r.length<=t?r:null}d(yt,"appendPromptSection");function et(e,i){try{let t=$(i);if(t.length===0)return null;let r=w.searchFts(e,t,P),n=r.find(c=>c.type==="decision"||c.type==="gotcha"||c.type==="fact")??r.find(c=>c.type==="anti-pattern"||c.type==="pattern")??r.find(c=>c.type==="gotcha"||c.type==="anti-pattern");return n?n.type==="decision"||n.type==="gotcha"||n.type==="fact"?{cue:`> Tip\u2192user (SoT): ${v(n)} \`${n.id}\` \u2014 say it briefly in chat; binding \u2014 do not contradict without superseding`,memoryId:n.id}:n.type==="anti-pattern"||n.type==="pattern"?{cue:`> Tip\u2192user (suggest): ${v(n)} \`${n.id}\` \u2014 propose the live change in chat, then apply when editing`,memoryId:n.id}:{cue:`> Tip\u2192user: ${v(n)} \`${n.id}\``,memoryId:n.id}:null}catch{return null}}d(et,"buildTopicalCueResult");function Qt(e,i,t){return et(e,i)?.cue??null}d(Qt,"buildTopicalCue");var I=new Map,E={skipDiskSnapshotOnce:!1};function te(){I.clear(),E.skipDiskSnapshotOnce=!0}d(te,"_resetGitSnapshotCacheForTests");async function It(e){let i=await y.stat(h.join(e,".git","index")).then(s=>s.mtimeMs).catch(()=>0),t=I.get(e);if(t&&t.expiresAt>Date.now()&&t.indexMtimeMs===i)return t.snapshot;let r=wt(e);if(!t&&!E.skipDiskSnapshotOnce){let s=await y.readFile(r,"utf-8").then(u=>JSON.parse(u)).catch(()=>null);if(s&&s.expiresAt>Date.now()&&s.indexMtimeMs===i)return I.set(e,s),s.snapshot}E.skipDiskSnapshotOnce=!1;let n=await vt(e);I.size>32&&I.clear();let c={snapshot:n,expiresAt:Date.now()+pt,indexMtimeMs:i};return I.set(e,c),y.mkdir(h.dirname(r),{recursive:!0}).then(()=>y.writeFile(r,JSON.stringify(c))).catch(()=>{}),n}d(It,"captureGit");function wt(e){let i=D("sha1").update(h.resolve(e)).digest("hex").slice(0,16);return h.join(x.runDir(),`prompt-git-${i}.json`)}d(wt,"gitSnapshotPath");function kt(e,i){let t=D("sha1").update(h.resolve(i)).digest("hex").slice(0,12);return`${e.replace(/[^a-zA-Z0-9._-]/g,"_")}-${t}`}d(kt,"promptHashKey");async function St(e,i,t){let r=kt(e,i),n=D("sha256").update(t).digest("hex");if(b.get(r)===n)return null;b.size>64&&b.clear(),b.set(r,n);let c=h.join(x.runDir(),`prompt-state-${r}.hash`);return(await y.readFile(c,"utf-8").catch(()=>"")).trim()===n?null:(await y.mkdir(h.dirname(c),{recursive:!0}).then(()=>y.writeFile(c,n)).catch(()=>{}),t)}d(St,"dedupePromptPayload");async function vt(e){let i={branch:"",modified:0,staged:0,untracked:0,ahead:0},t=d(async o=>{try{return(await G("git",o,{cwd:e,timeout:2e3})).stdout.trim()}catch{return""}},"safe"),[r,n,c]=await Promise.all([t(["branch","--show-current"]),t(["status","--porcelain"]),t(["rev-list","--count","@{u}..HEAD"])]);if(!r)return i;let{modified:s,staged:u,untracked:g}=n.split(`
|
|
22
|
+
`).filter(Boolean).reduce((o,l)=>{let a=l.slice(0,2);return a.startsWith("??")?o.untracked++:(a[0]!==" "&&a[0]!=="?"&&o.staged++,a[1]!==" "&&o.modified++),o},{modified:0,staged:0,untracked:0}),p=Number.parseInt(c,10)||0;return{branch:r,modified:s,staged:u,untracked:g,ahead:p}}d(vt,"captureGitUncached");function nt(e){if(!e)return"unknown";let i=Date.parse(e);if(Number.isNaN(i))return"unknown";let t=Math.max(0,Math.floor((Date.now()-i)/864e5));return t<1?"today":t<2?"yesterday":t<30?`${t}d ago`:`${Math.floor(t/30)}mo ago`}d(nt,"formatRelative");function rt(e,i,t,r=T){let n=et(e,i),c=O(e,i),s=J(i),u=ft(e,i),g=[n?.cue,s,u?.text,c].filter(a=>!!a).reduce((a,m)=>yt(a,m,r)??a,k(t,r)),p=!!(u?.text&&g.includes(u.text)),l=!!(s&&g.includes(s))?`delivery:${A(i)??"unknown"}`:p?u?.memoryIds[0]??null:null;return{prioritized:g,cueResult:n,guidance:u,guidanceIncluded:p,guidanceRuleId:l}}d(rt,"computePromptGuidance");function ee(e=process.cwd(),i){return V({event:"UserPromptSubmit",projectPath:e,build:d(async(t,r,n)=>{let c=(t.prompt??"").trim();if(!c)return null;let s=await S.readConfig(r);if(!s?.projectId)return null;let u=await tt(r,s),g=n==="kimi"?await W(s.projectId,t.session_id).catch(()=>null):null,p=g?await z(r,s,{digest:g==="digest"}).catch(()=>null):null;if(!u&&!p)return null;let o=[p,u].filter(Boolean).join(`
|
|
23
|
+
|
|
24
|
+
`),l=p?lt:T,{prioritized:a,cueResult:m,guidance:f,guidanceIncluded:it,guidanceRuleId:st}=rt(s.projectId,c,o,l);return C.set(t,{projectId:s.projectId,projectPath:r,bumpTurn:!!u?.includes("Active work cycle:"),surfacedIds:[...m?[m.memoryId]:[],...it?f?.memoryIds??[]:[]],guidanceRuleId:st}),St(s.projectId,r,a)},"build"),afterEmit:d(async(t,r)=>{let n=C.get(t)??await bt(t,r);C.delete(t),n&&await Promise.all([n.bumpTurn?j.bumpTurnCount(n.projectId).then(()=>{}):Promise.resolve(),n.surfacedIds.length>0?q(n.projectId,n.projectPath,n.surfacedIds):Promise.resolve(),n.guidanceRuleId?Promise.resolve(X.recordGuidanceActivation(n.projectId,{ruleId:n.guidanceRuleId})).then(()=>{}):Promise.resolve()])},"afterEmit")},i)}d(ee,"runPromptHook");async function bt(e,i){let t=(e.prompt??"").trim();if(!t)return null;let r=await S.readConfig(i).catch(()=>null);if(!r?.projectId)return null;let[n,c]=await Promise.all([j.getCurrentTask(r.projectId).catch(()=>null),tt(i,r)]),{cueResult:s,guidance:u,guidanceIncluded:g,guidanceRuleId:p}=rt(r.projectId,t,c??"");return{projectId:r.projectId,projectPath:i,bumpTurn:!!n,surfacedIds:[...s?[s.memoryId]:[],...g?u?.memoryIds??[]:[]],guidanceRuleId:p}}d(bt,"rebuildPromptAfterEmit");export{te as _resetGitSnapshotCacheForTests,J as buildDeliveryGuidance,tt as buildProjectState,ft as buildSelectiveGuidance,Qt as buildTopicalCue,A as classifyDeliveryIntent,ee as runPromptHook};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b}from"./chunk-
|
|
8
|
+
import{a,b}from"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as publishCRUD,b as publishCRUDSync};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a,b,c,d,e,f,g,h,i,j}from"./chunk-TXSLON7M.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{d as AUTO_SOURCE_PREFIXES,b as DEFAULT_ARCHIVE_PRUNE_DAYS,c as DEFAULT_AUTO_SOURCE_MAX_LIVE,a as DEFAULT_SOFT_DELETED_PURGE_DAYS,e as isAutoSource,g as purgeOrphanRememberEvents,f as purgeSoftDeleted,j as runVaultPurge,h as trimAutoSourceCap,i as vaultHealth};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as k}from"./chunk-KHLYWNHT.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{b as P}from"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import{b as O,c as U}from"./chunk-4HAKTI36.mjs";import{a as Y}from"./chunk-S5N2ZZDL.mjs";import"./chunk-C4O243NG.mjs";import{a as Z,b as j,c as S,d as ee,e as te,f as C,g as T,h as ne,i as re}from"./chunk-PTA7DMLM.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import{a as I,h as L}from"./chunk-DXQMKW2B.mjs";import{a as H,e as G,f as z,g as J,h as q,i as K,j as Q}from"./chunk-TXSLON7M.mjs";import{a as x}from"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import{c as A}from"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import{a as w,b as V,e as D,g as B}from"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import{b as M,g as F}from"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";V();B();var W=new Set(["decision","gotcha","learning","feedback","fact","shipped","spec"]),se=30,oe=50,ie=20,ce=45,ae=25,de=15,ue=180,$=90,le=25,pe=.12,me=40,fe=40,he=30,ge=20,xe=35,Ee=.12,ye=864e5,Re=100,ve=50,be=25,_e=15,De=/\b[\w.-]+(?:\/[\w.-]+)+\.(?:ts|tsx|js|jsx|mjs|cjs|json|md|sh|toml|yml|yaml)\b/g;function Ae(e,t){let o=x.allEntriesForIndex(e),r=new Set;for(let c of o)for(let l of O(c.tags))r.add(l);let n=(()=>{try{let c=P(e);return c?new Set(Object.keys(c.documents)):null}catch{return null}})(),a=S(o),i=C(a);return{entries:o,usefulness:U.decayedScores(e,t),supersededIds:F(o),correctedIds:r,indexedPaths:n,nowMs:t,refIndex:i}}p(Ae,"collectRetentionInputs");function Se(e){let t=new Map,o=new Set,r=[...e].sort((n,a)=>a.rememberedAt.localeCompare(n.rememberedAt));for(let n of r){let a=w(n.content);t.has(a)?o.add(n.id):t.set(a,n)}return o}p(Se,"collectDuplicateIds");function Me(e,t){let o=e.content.match(De);return!o||o.length===0?!1:!o.some(r=>t.has(r))}p(Me,"isUngrounded");function Ie(e,t,o){let r=[],n=T(e.content,t.refIndex,e.id),a=o.has(e.id);a&&!n.exactDup&&r.push("duplicate of newer entry"),r.push(`excess ${n.excess.toFixed(2)} (sim ${n.maxSim.toFixed(2)})`);let i=n.exactDup||n.nearDup||n.excess<Ee;i&&r.push(n.exactDup?`exact dup of ${n.nearestId}`:n.nearDup?`near-dup of ${n.nearestId}`:"low excess vs reference");let c=t.usefulness.get(e.id)??0,l=Math.min(ae,Math.max(0,c*8));c>0&&r.push(`used (+${Math.round(l)})`);let u=Math.max(0,(t.nowMs-Date.parse(e.rememberedAt))/ye),h=Number.isFinite(u)?Math.max(0,de*(1-u/ue)):0,s=c<=0&&Number.isFinite(u)&&u>$?Math.min(le,(u-$)*pe):0;s>0&&r.push(`idle ${Math.round(u)}d`);let f=t.supersededIds.has(e.id);f&&r.push("superseded");let m=t.correctedIds.has(e.id);m&&r.push("corrected");let b=!M(e)||k(e);b&&r.push("generated noise");let E=!!(t.indexedPaths&&Me(e,t.indexedPaths));E&&r.push("cites files missing at HEAD");let g=Math.max(0,Math.min(100,n.excess*ce+l+h-(i?xe:0)-s-(f?me:0)-(m?fe:0)-(b?he:0)-(E?ge:0)-(a?20:0))),R=g>=oe?"active":g>=ie?"archive":"delete",_=a||n.exactDup||n.nearDup||f,y=R!=="active"&&u<se&&!_?"active":R;y!==R&&r.push("grace period");let d=y==="delete"&&W.has(e.type)?"archive":y;return d!==y&&r.push("protected type"),{id:e.id,type:e.type,verdict:d,score:Math.round(g),reasons:r,excess:n.excess,maxSim:n.maxSim,nearestId:n.nearestId}}p(Ie,"scoreEntry");function X(e,t){let o=Ae(e,t),r=Se(o.entries),n={evaluated:o.entries.length,active:0,archive:0,delete:0,referenceSize:o.refIndex.entries.length,flagged:[],byId:new Map};for(let a of o.entries){let i=Ie(a,o,r);n[i.verdict]++,n.byId.set(i.id,i),i.verdict!=="active"&&n.flagged.push(i)}return n.flagged.sort((a,i)=>a.score-i.score),n}p(X,"evaluateRetention");function Be(e,t){return!(!M(e)||e.content.trim().length===0||t&&t.verdict!=="active"||t&&t.excess!==void 0&&t.excess<.05)}p(Be,"shouldEmbedEntry");function v(e,t){if(t.startsWith("ship_"))return Ce(e,t);if(x.forget(e,t))return!0;try{return(D.run(e,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),t).changes??0)>0}catch{return!1}}p(v,"forgetEntry");function N(e){return e.startsWith("mem_")||e.startsWith("ship_")||/^\d+$/.test(e)}p(N,"isRetentionRemovableId");function Ce(e,t){let o=t.startsWith("ship_")?t.slice(5):t;if(!o)return!1;try{let r=D.get(e,"SELECT * FROM shipped_features WHERE id = ?",o);if(!r)return!1;try{A.archive(e,{entityType:"shipped",entityId:o,entityData:r,summary:`retention archive shipped [${r.name}]`,reason:"retention-archive"})}catch{}return(D.run(e,"DELETE FROM shipped_features WHERE id = ?",o).changes??0)>0}catch{return!1}}p(Ce,"forgetShippedFeature");function Te(e,t={}){let o=t.dryRun===!0,r=t.nowMs??Date.now(),n=t.maxArchive??Re,a=t.maxDelete??ve,i=X(e,r),c=i.flagged.filter(s=>s.verdict==="archive"&&N(s.id)),l=i.flagged.filter(s=>s.verdict==="delete"&&N(s.id)),u=i.flagged.filter(s=>(s.verdict==="archive"||s.verdict==="delete")&&!N(s.id)).length,h=o?{archived:0,deleted:0,skipped:u}:(()=>{let s=c.slice(0,n),f=s.map(d=>{if(!d.id.startsWith("ship_"))try{A.archive(e,{entityType:"memory_entry",entityId:d.id,entityData:{id:d.id,type:d.type,score:d.score,excess:d.excess,reasons:d.reasons,verdict:d.verdict},summary:`retention archive [${d.type}] excess=${d.excess?.toFixed(2)??"?"} score=${d.score}`,reason:"retention-archive"})}catch{}return v(e,d.id)}),m=f.filter(Boolean).length,b=Math.max(0,c.length-s.length)+f.filter(d=>!d).length,E=l.slice(0,a),g=E.filter(d=>!W.has(d.type)).map(d=>d.id),R=E.length-g.length,_=g.length>0?Y(e,g):0,y=Math.max(0,l.length-E.length)+R+g.length-_;return{archived:m,deleted:_,skipped:u+b+y}})();return{evaluated:i.evaluated,active:i.active,wouldArchive:c.length,wouldDelete:l.length,archived:h.archived,deleted:h.deleted,skipped:h.skipped,dryRun:o,samples:i.flagged.slice(0,10),referenceSize:i.referenceSize}}p(Te,"applyRetention");function He(e){return Te(e,{maxArchive:be,maxDelete:_e})}p(He,"applyRetentionIncremental");function Ge(e,t={}){let o=t.max??50,r=t.types??["inbox","context","idea","todo","question","gotcha","spec"],n=[],a=[];try{let i=x.allEntriesForIndex(e);for(let c of i){if(n.length>=o)break;if(!r.includes(c.type))continue;let l=I(c.content,c.type),u=L(c.content,c.type);(l.junk||u.action==="refuse"||c.type==="gotcha"&&u.action==="demote")&&v(e,c.id)&&(n.push(c),a.length<8&&a.push(`${c.id}:${l.junk?l.reason:u.reasonCode}`))}}catch{return{forgotten:0,samples:[]}}return{forgotten:n.length,samples:a}}p(Ge,"forgetJunkCaptures");function ze(e,t=Date.now()){let r=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(r.length===0)return{merged:0,archived:0,junkForgotten:0};let n=r.filter(s=>I(s.content,s.type).junk&&v(e,s.id)).length,a=x.allEntriesForIndex(e).filter(s=>s.type==="inbox");if(a.length===0)return{merged:0,archived:0,junkForgotten:n};let i=S(x.allEntriesForIndex(e)),c=C(i),l=X(e,t),u=[],h=[];for(let s of a){let f=T(s.content,c);if(f.exactDup||f.nearDup||f.excess<.15){v(e,s.id)&&u.push(s.id);continue}let m=l.byId.get(s.id);if(m&&m.verdict!=="active"){try{A.archive(e,{entityType:"memory_entry",entityId:s.id,entityData:{id:s.id,type:"inbox",score:m.score,excess:m.excess,reasons:m.reasons},summary:`inbox triage excess=${m.excess?.toFixed(2)??"?"}`,reason:"retention-inbox"})}catch{}v(e,s.id)&&h.push(s.id)}}return{merged:u.length,archived:h.length,junkForgotten:n}}p(ze,"triageInbox");export{te as CAPTURE_MIN_EXCESS,H as DEFAULT_SOFT_DELETED_PURGE_DAYS,ee as NEAR_DUP_SIM,W as PROTECTED_TYPES,Z as REFERENCE_CAP,Te as applyRetention,He as applyRetentionIncremental,S as buildReferenceModel,re as captureGate,Se as collectDuplicateIds,Ae as collectRetentionInputs,ne as computeExcess,X as evaluateRetention,Ge as forgetJunkCaptures,Ce as forgetShippedFeature,G as isAutoSource,j as isReferenceEligible,N as isRetentionRemovableId,J as purgeOrphanRememberEvents,z as purgeSoftDeleted,Q as runVaultPurge,Ie as scoreEntry,Be as shouldEmbedEntry,ze as triageInbox,q as trimAutoSourceCap,K as vaultHealth};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{h as S}from"./chunk-FXFG6PV6.mjs";import"./chunk-WGWE3CSC.mjs";import"./chunk-KSSRINDX.mjs";import{a as v,b as u}from"./chunk-BX7VKYA7.mjs";import{a as f}from"./chunk-GDECEHO5.mjs";import{a as k,d as w}from"./chunk-S6L3FECF.mjs";import"./chunk-H4CA3XZ6.mjs";import{a as l}from"./chunk-MHNWIB7B.mjs";import"./chunk-T6ELTQZM.mjs";import"./chunk-RHKF7EJW.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-GDESYWTD.mjs";import"./chunk-J5UQVJUW.mjs";import"./chunk-YDBZO6I3.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-Z6KVLCMK.mjs";import"./chunk-IGHY4FGS.mjs";import"./chunk-22AXWLI6.mjs";import"./chunk-3WQBTXUC.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-DCSKTMDX.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-C4O243NG.mjs";import"./chunk-X5W2UYQK.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-V2FR2NPL.mjs";import"./chunk-S5ISOGDB.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XXRAQZNC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-5XA5RL5I.mjs";import"./chunk-I26F7TLM.mjs";import"./chunk-QP5USCDX.mjs";import"./chunk-RTEEXGEA.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as g}from"./chunk-PO3QDKTE.mjs";import"./chunk-ABJNOG2I.mjs";import"./chunk-UHVYBU7F.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-GCDLPKOH.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var a=["off","advisory","strict"],$=[{key:"spec drafted",reached:i(()=>!0,"reached")},{key:"audit-spec passed (reviewed)",reached:i(n=>n!=="draft","reached")},{key:"task linked",reached:i(n=>n==="in_progress"||n==="shipped","reached")},{key:"shipped",reached:i(n=>n==="shipped","reached")}],D=class extends w{static{i(this,"SddCommands")}async sdd(e=null,t=process.cwd(),o={}){let s=v(e,a);return s.kind==="status"?this.showStatus(t,o):s.kind==="mode"?this.setMode(s.mode,t,o):k(`Unknown sdd subcommand "${s.sub}". Use: ${a.join("|")}.`,o)}async showStatus(e,t){let o=await u(e,t);if(!o.ok)return o.result;let s=o.value,r=M(s),c=await(async()=>{try{let p=await S(s.projectId,e);if(p?.linkedSpecId){let{specService:h}=await import("./spec-service-UAQ5AEXQ.mjs"),d=await h.get(e,p.linkedSpecId);if(d)return{specLine:`Active spec: \`${d.title}\` (${d.status})`,station:$.map(y=>`${y.reached(d.status)?"\u2713":"\u25CB"} ${y.key}`).join(" ")}}else if(p)return{specLine:"Active work cycle has NO linked spec",station:"no active work cycle"};return{specLine:"Active spec: none",station:"no active work cycle"}}catch{return{specLine:"Active spec: none",station:"no active work cycle"}}})(),m=[`Mode: ${r}${r==="off"?" (pipeline stays escalate-only)":""}`,c.specLine,`Pipeline: ${c.station}`,"Set: prjct sdd off|advisory|strict"];return t.md?console.log(f("## SDD",`> **Mode**: \`${r}\``,m.slice(1).join(`
|
|
9
|
+
`))):l.info(`SDD \u2014 ${m.join(`
|
|
10
|
+
`)}`),{success:!0,mode:r}}async setMode(e,t,o){let s=await u(t,o);if(!s.ok)return s.result;let r=s.value;r.sdd={mode:e},await g.writeConfig(t,r);let c=e==="off"?"SDD mode off \u2014 the spec pipeline stays escalate-only (no gating).":e==="advisory"?"SDD mode \u2192 advisory. The skill nudges toward a spec for complex work; `ship` surfaces acceptance criteria.":"SDD mode \u2192 strict. Every `prjct work` cycle must link a REVIEWED intent/spec, and `ship` blocks unspecced work (override: `prjct ship --no-spec-gate`).";return o.md?console.log(f("## SDD",`> ${c}`)):l.done(c),{success:!0,mode:e}}};function M(n){let e=n?.sdd?.mode;if(e&&a.includes(e))return e;let t=process.env.PRJCT_SDD_MODE?.toLowerCase();return t&&a.includes(t)?t:"off"}i(M,"effectiveSddMode");var b={effectiveSddMode:M,SDD_MODES:a};export{D as SddCommands,b as _internal,M as effectiveSddMode};
|