prjct-cli 3.92.0 → 3.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/bin/hook-chunks/{agent-switch-XMFUTNNV.mjs → agent-switch-2U2LOBGR.mjs} +1 -1
- package/dist/bin/hook-chunks/analysis-N4NYGIG3.mjs +42 -0
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-SP4PBALR.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-BN6L6QHO.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-FRF2G3IG.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-DGBDMUBL.mjs → chunk-27XFSCOE.mjs} +4 -4
- package/dist/bin/hook-chunks/chunk-2HB2JHQE.mjs +69 -0
- package/dist/bin/hook-chunks/{chunk-MAHTF6JG.mjs → chunk-3VWBNLBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2HTDCLZD.mjs → chunk-4O4D6DV7.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-4SKJWNKE.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-5EQLQ7GF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-66GE3IHX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-6RLCUGGG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-6UH244CC.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-7GNWHWOO.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-7JEKBJAP.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-7O6OMD4X.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-XHDNPEAN.mjs → chunk-AVRNHROK.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-AZHE4VOM.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-AZYQFRPJ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-C3W2HLJT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-D6IONKRA.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-DRGI5UHQ.mjs +10 -0
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-EHEQOF6Z.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX6BC2EB.mjs → chunk-EMTCZG5I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZNQXFWSI.mjs → chunk-EQ5KNMLG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-S4TB2OFJ.mjs → chunk-F4T7IAA7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-FX6VHIKB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2WPR5GFT.mjs → chunk-GFY4GY3Z.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HHIGNKDO.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-HNEKXKOI.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-HRWXMF7P.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AWD2AQVJ.mjs → chunk-IHECXD2M.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IKIB42F7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-INXNK57E.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-J6TAD3OZ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JAMSIKDE.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-JCYXFHQZ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JMCMTX6U.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-JPSJWCFD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JUZ5LNDI.mjs +14 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-KG7Z6OMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-KOCROTRM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.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-BZ5UR7G3.mjs → chunk-MHQTGU45.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OL6ITIAZ.mjs → chunk-MI3JEFON.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-NBKEOLDH.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-NCOOKPXX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-NHIWYDQD.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-NUJASVHN.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-NWIQNII6.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-OP467HW6.mjs → chunk-NWZEBCTC.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-OENWCYLF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OIU4Y5WL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-OZJ6UKKP.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PUHX3ECX.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-Q3EYM4GJ.mjs +19 -0
- package/dist/bin/hook-chunks/{chunk-I5BDN25C.mjs → chunk-Q3Z53QTH.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-QPRNRLG6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-QYEASMFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-S7HQQILD.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-SDUS2AT7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-T2FCU3ZS.mjs +12 -0
- package/dist/bin/hook-chunks/{chunk-A5RNWWTH.mjs → chunk-TFCLMTJ5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-TG5CQJD5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-CQUG6SO2.mjs → chunk-TKWAFYF7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-TYEAIX3X.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-UA4Z5TGG.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-V2BSS7HW.mjs +36 -0
- package/dist/bin/hook-chunks/{chunk-MQVVNX63.mjs → chunk-VWOIUTAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLDL3N6R.mjs → chunk-X2AGNDGD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-5PEHJEFE.mjs → chunk-XE4MJNBQ.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-Y3J7UUMR.mjs +47 -0
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-Y4DUB7UN.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-DVBBB5BS.mjs → chunk-YUKGWWL7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-ZJXH76Q5.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-TBM7736J.mjs → chunk-ZMKTR2IO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/client-ERZ5CM3D.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-4GRWQSUK.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-2N6656SR.mjs → codex-skill-6DYQMPDJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-XSKQS3IS.mjs → command-installer-MF4KUM3X.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-YZANYLPV.mjs → config-manager-2VZPHUDG.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-V7CIDF3Q.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-UOBQXY42.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-J6O46KS7.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-XYKQF3KR.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-DFRJOOB3.mjs +19 -0
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-SLC34HUU.mjs +12 -0
- package/dist/bin/hook-chunks/distill-U2LJGUG3.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-6XFYIOE6.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-X6RDNNIE.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-ALUX4QSI.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-SCGU3URM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-BYPG65RS.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-GWSSCLAB.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-MMISX2BI.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-WG5JAS7B.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-2WSO5KEB.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-QK5QJOFJ.mjs +8 -0
- package/dist/bin/hook-chunks/notification-MPVWVV52.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-BKLDNYE5.mjs → pack-integrity-XRYOROK5.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-ASWLKYGP.mjs → pack-manager-WWGQNJDQ.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-ZR5RAKTK.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-QBSY272P.mjs → planning-S55KBPN2.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QMHSZHDN.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-RAM6L3G4.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-736ZLMDL.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-GZ4QJ2MU.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-LCIAWWGK.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-J5EOFMYN.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-TSUMTXHH.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-WE6WFVL3.mjs → prjct-md-T2DG236Y.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-A6HGZPAL.mjs → project-agent-surfaces-VRY22I66.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-5DEN5VLF.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-KKEMTEMP.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-7MAUSED2.mjs +8 -0
- package/dist/bin/hook-chunks/{prompt-JIOMJCGV.mjs → prompt-DVF6V2X2.mjs} +7 -7
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-G54XQV5K.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-MC5LFSAO.mjs +8 -0
- package/dist/bin/hook-chunks/retention-LWETHQX3.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-5UCVX43H.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-RKNAJJHR.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-MFMFKUPK.mjs +8 -0
- package/dist/bin/hook-chunks/setup-WQRJ6TQL.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-LVTFVSWJ.mjs → shipping-5D5LTJ3P.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-RAVJMC4P.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-U6BGGB2Q.mjs → spec-context-inference-7DDSTRTV.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-2DVDFOR7.mjs → spec-service-LAO5Z2M5.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-K3GMQKGH.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-EIFGUO7X.mjs +8 -0
- package/dist/bin/hook-chunks/stop-RYLI4FGF.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-CCUPSANT.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-RBD2OILE.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-BDKFYUOJ.mjs → surface-attribution-K37N2NK7.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-BKQIMFRG.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-EGBMWF3J.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-E3LMZISA.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-2ZYE5M6J.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-ITY5OSHX.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-XREJLWEF.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-7S55S5C3.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-BFTLPG2W.mjs → template-loader-SCM4C2A3.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-SCH5ARGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HT756AND.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-47CF3XWZ.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-FLCEQ2BV.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-JQHVVXIZ.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-CDLSZ4U5.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-UUW4UGGB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/prjct-core.mjs +736 -746
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/daemon/entry.mjs +625 -632
- package/dist/mcp/server.mjs +323 -323
- package/package.json +1 -1
- package/dist/bin/hook-chunks/analysis-PFGKPYWQ.mjs +0 -42
- package/dist/bin/hook-chunks/auto-flush-QZ3YIQP6.mjs +0 -8
- package/dist/bin/hook-chunks/capture-gate-2FXYVHNF.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-3X7TBM4A.mjs +0 -19
- 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-7JE6VTLN.mjs +0 -71
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CDCCAU22.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-CPHUFXD2.mjs +0 -14
- 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-FGQZ62ZP.mjs +0 -47
- package/dist/bin/hook-chunks/chunk-GELCZWKW.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-HX42HFII.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-KB3P6XTL.mjs +0 -38
- 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-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-OLKNK2HB.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-SY2FRLJF.mjs +0 -31
- package/dist/bin/hook-chunks/chunk-WSFHSXBZ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-Y7CKMFNW.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-NJ6RYVOJ.mjs +0 -8
- package/dist/bin/hook-chunks/detect-changes-6N4DCWXQ.mjs +0 -17
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
- package/dist/bin/hook-chunks/distill-IABVRW2U.mjs +0 -8
- package/dist/bin/hook-chunks/enriched-recall-NDASPZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
- package/dist/bin/hook-chunks/format-NIBVWBGR.mjs +0 -8
- package/dist/bin/hook-chunks/judgment-receipt-HTNEOJLT.mjs +0 -8
- package/dist/bin/hook-chunks/land-cue-FNLP4IAB.mjs +0 -9
- package/dist/bin/hook-chunks/land-synthesis-HBPIXP5S.mjs +0 -8
- package/dist/bin/hook-chunks/legacy-crew-sweep-2MLYPNQR.mjs +0 -24
- package/dist/bin/hook-chunks/memory-index-MQCHZFUE.mjs +0 -10
- package/dist/bin/hook-chunks/notification-VQM2AMNS.mjs +0 -8
- package/dist/bin/hook-chunks/post-edit-VTLDHWI3.mjs +0 -8
- package/dist/bin/hook-chunks/pre-bash-JR6257XO.mjs +0 -11
- package/dist/bin/hook-chunks/pre-commit-BYUFDN2N.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-MHROFDS3.mjs +0 -11
- package/dist/bin/hook-chunks/pre-package-P7CLTJJV.mjs +0 -8
- package/dist/bin/hook-chunks/pre-search-BCQHPE46.mjs +0 -9
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
- package/dist/bin/hook-chunks/project-memory-ON54KZEM.mjs +0 -8
- package/dist/bin/hook-chunks/project-style-evolution-T27I5N65.mjs +0 -8
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-QQ6XILZD.mjs +0 -8
- package/dist/bin/hook-chunks/retention-E7WGFL47.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-PV6KWXE4.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-5CLT5YBL.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-ATYLOUKB.mjs +0 -8
- package/dist/bin/hook-chunks/setup-VL7YXVE5.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-MPNRRTNZ.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-GBUGB5OE.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-HURF2GI7.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-WJECHEXI.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-BM2JQXMS.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-UJDJUJ3E.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-GLXXHG32.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-VTF6SKLY.mjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [3.94.0] - 2026-08-16
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- eliminate duplicate code
|
|
9
|
+
|
|
10
|
+
## [3.93.0] - 2026-08-16
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
- Efficiency improvements: model routing, agent planning, and performance
|
|
14
|
+
|
|
5
15
|
## [3.92.0] - 2026-08-15
|
|
6
16
|
|
|
7
17
|
### Added
|
|
@@ -5,7 +5,7 @@ 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 E,b as I}from"./chunk-
|
|
8
|
+
import{a as E,b as I}from"./chunk-OWOPA2O7.mjs";import{a as P}from"./chunk-HNEKXKOI.mjs";import{a as O}from"./chunk-5WAONIPX.mjs";import{a as C}from"./chunk-5TBQNW2G.mjs";import"./chunk-SDUS2AT7.mjs";import{b as N,c as H,d as L}from"./chunk-TRMBRDKH.mjs";import{h as _}from"./chunk-2HB2JHQE.mjs";import"./chunk-XE4MJNBQ.mjs";import"./chunk-C3W2HLJT.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-4O4D6DV7.mjs";import{c as D,d as A}from"./chunk-JCYXFHQZ.mjs";import"./chunk-JPSJWCFD.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-JUZ5LNDI.mjs";import"./chunk-7O6OMD4X.mjs";import"./chunk-OZJ6UKKP.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-FX6VHIKB.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-OENWCYLF.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as y}from"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import{a as x}from"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as f,g as v}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{b as m,h as V,l as S,n as Y,o as R,u as q}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a}from"./chunk-E66B27AL.mjs";q();import{spawn as X}from"node:child_process";v();V();v();function G(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}a(G,"parseEvidence");function $(t){return{id:t.id,projectId:t.project_id,taskId:t.task_id,taskDescription:t.task_description,fromAgent:t.from_agent,fromIdentity:t.from_identity,toAgent:t.to_agent,reason:t.reason,evidence:G(t.evidence),status:t.status,workspaceId:t.workspace_id,worktreePath:t.worktree_path,branch:t.branch,createdAt:t.created_at,acceptedAt:t.accepted_at,acceptedBy:t.accepted_by,expiresAt:t.expires_at}}a($,"toHandoff");function M(t){let e=new Date;return e.setTime(e.getTime()+Math.max(1,t)*36e5),e.toISOString()}a(M,"expiresAtIso");function W(t){let e=`hand_${x()}`,o=m(),n=t.ttlHours??24,r=t.evidence?JSON.stringify(t.evidence):null;return f.run(t.projectId,`INSERT INTO task_handoffs (
|
|
9
9
|
id, project_id, task_id, task_description, from_agent, from_identity,
|
|
10
10
|
to_agent, reason, evidence, status, workspace_id, worktree_path, branch,
|
|
11
11
|
created_at, accepted_at, accepted_by, expires_at
|
|
@@ -0,0 +1,42 @@
|
|
|
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 G,b as Se,c as b,d as U,e as q,f as H,g as ve,h as $e,i as v}from"./chunk-V2BSS7HW.mjs";import"./chunk-Y3J7UUMR.mjs";import"./chunk-TXJT3G53.mjs";import"./chunk-TFCLMTJ5.mjs";import"./chunk-66GE3IHX.mjs";import"./chunk-J6TAD3OZ.mjs";import"./chunk-T2FCU3ZS.mjs";import"./chunk-2HB2JHQE.mjs";import"./chunk-XE4MJNBQ.mjs";import"./chunk-C3W2HLJT.mjs";import{a as y,b as R,c as M,d as we,e as E,f as L,g as z}from"./chunk-X2AGNDGD.mjs";import{b as ge,c as A,d as ke}from"./chunk-F4T7IAA7.mjs";import"./chunk-H4CA3XZ6.mjs";import{a as d}from"./chunk-4O4D6DV7.mjs";import"./chunk-JCYXFHQZ.mjs";import"./chunk-JPSJWCFD.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-JUZ5LNDI.mjs";import"./chunk-7O6OMD4X.mjs";import"./chunk-OZJ6UKKP.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-NWIQNII6.mjs";import"./chunk-LNB2GLYI.mjs";import{a as ue}from"./chunk-DYHYDHCW.mjs";import"./chunk-FX6VHIKB.mjs";import{a as D,b as ye,c as K}from"./chunk-AZYQFRPJ.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-VWOIUTAX.mjs";import"./chunk-IHECXD2M.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-OENWCYLF.mjs";import"./chunk-NBKEOLDH.mjs";import"./chunk-GFY4GY3Z.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{e as pe}from"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import{d as fe}from"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{a as he}from"./chunk-27XFSCOE.mjs";import{a as de}from"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as me}from"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as _,g as ce}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{d as le}from"./chunk-4SKJWNKE.mjs";import{b as I,g as oe,h as X,v as ie,w as We}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as ae,o as Qe}from"./chunk-UH4MD3F3.mjs";import{a as N,b as ne,p as re}from"./chunk-QWQFF2UG.mjs";import"./chunk-EQ5KNMLG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import{a as $,e as k,f as J}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";J();re();Qe();import j from"node:fs/promises";import C from"node:path";var Y=class{static{m(this,"CodebaseAnalyzer")}projectPath=null;init(e=process.cwd()){this.projectPath=e}async readPackageJson(){try{let e=C.join(this.projectPath,"package.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readCargoToml(){try{let e=C.join(this.projectPath,"Cargo.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readRequirements(){try{let e=C.join(this.projectPath,"requirements.txt");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGoMod(){try{let e=C.join(this.projectPath,"go.mod");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGemfile(){try{let e=C.join(this.projectPath,"Gemfile");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readMixExs(){try{let e=C.join(this.projectPath,"mix.exs");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readPomXml(){try{let e=C.join(this.projectPath,"pom.xml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readComposerJson(){try{let e=C.join(this.projectPath,"composer.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readPyprojectToml(){try{let e=C.join(this.projectPath,"pyproject.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async getFileExtensions(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" ! -path "*/.next/*" | sed "s/.*\\./\\./" | sort | uniq -c | sort -rn',{cwd:this.projectPath}),t={};return e.trim().split(`
|
|
9
|
+
`).filter(Boolean).forEach(o=>{let s=o.trim().match(/^\s*(\d+)\s+(\.\w+)$/);s&&(t[s[2]]=parseInt(s[1],10))}),t}catch{return{}}}async listConfigFiles(){try{let e=await j.readdir(this.projectPath),t=[/^package\.json$/,/^Cargo\.toml$/,/^go\.mod$/,/^requirements\.txt$/,/^Gemfile$/,/^mix\.exs$/,/^pom\.xml$/,/^composer\.json$/,/^pyproject\.toml$/,/^tsconfig.*\.json$/,/^\..*rc(\.json|\.js|\.cjs)?$/,/^Dockerfile$/,/^docker-compose.*\.ya?ml$/,/^\.env.*$/];return e.filter(o=>t.some(s=>s.test(o)))}catch(e){if($(e))return[];throw e}}async listDirectories(){try{return(await j.readdir(this.projectPath,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).filter(t=>!t.startsWith(".")&&t!=="node_modules")}catch(e){if($(e))return[];throw e}}async getGitLog(e=50){try{let{stdout:t}=await N(`git log -n ${e} --pretty=format:"%h|%an|%ar|%s"`,{cwd:this.projectPath});return t}catch{return""}}async getGitStats(){try{let{stdout:e}=await N("git rev-list --count HEAD",{cwd:this.projectPath}),{stdout:t}=await N('git log --format="%an" | sort -u | wc -l',{cwd:this.projectPath}),{stdout:o}=await N('git log --reverse --pretty=format:"%ar" | head -1',{cwd:this.projectPath});return{totalCommits:parseInt(e.trim(),10)||0,contributors:parseInt(t.trim(),10)||0,age:o.trim()||"unknown"}}catch{return{totalCommits:0,contributors:0,age:"unknown"}}}async countFiles(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" | wc -l',{cwd:this.projectPath});return parseInt(e.trim(),10)||0}catch{return 0}}async fileExists(e){return ae(C.join(this.projectPath,e))}async readFile(e){try{let t=C.join(this.projectPath,e);return await j.readFile(t,"utf-8")}catch(t){if($(t))return null;throw t}}async findFiles(e){try{let{stdout:t}=await N(`find . -type f -name "${e}" ! -path "*/node_modules/*" ! -path "*/.git/*"`,{cwd:this.projectPath});return t.trim().split(`
|
|
10
|
+
`).filter(Boolean)}catch{return[]}}},Xe=new Y,S=Xe;We();import je from"node:fs/promises";import Pe from"node:path";var V=800,Z=6,Ke=8,Ye=5;async function ee(r,e,t,o){let[s,i,n,a]=await Promise.all([Ze(r,e,o),et(r),tt(r),st(r)]);return{project:{name:o.name,ecosystem:o.ecosystem,languages:o.languages,frameworks:o.frameworks,fileCount:o.fileCount,projectType:o.projectType},git:{branch:t.branch,recentCommits:t.recentCommits.slice(0,Ke).map(u=>({message:u.message,date:u.date})),hasChanges:t.hasChanges,weeklyCommits:t.weeklyCommits},codeSamples:s,existingPatterns:i,taskHistory:n,previousAnalysis:a??void 0}}m(ee,"buildAnalysisPayload");async function Ze(r,e,t){let o=[],s=[...t.frameworks.map(a=>a.toLowerCase()),"config","router","middleware","service","model","schema","database","api","auth"].join(" "),i=pe(r,s,Z*2);for(let a of i){if(o.length>=Z)break;try{let u=Pe.join(e,a.path),c=await je.readFile(u,"utf-8");c.length>V*3?o.push({path:a.path,content:`${c.slice(0,V)}
|
|
11
|
+
// ... truncated`,reason:`BM25 score: ${a.score.toFixed(2)} (truncated, ${c.length} chars)`}):o.push({path:a.path,content:c.slice(0,V),reason:`BM25 score: ${a.score.toFixed(2)}`})}catch{}}let n=["package.json","tsconfig.json","src/index.ts","src/main.ts","app.ts"];for(let a of n){if(o.length>=Z)break;if(!o.some(u=>u.path===a))try{let u=Pe.join(e,a),c=await je.readFile(u,"utf-8");o.push({path:a,content:c.slice(0,V),reason:"entry point"})}catch{}}return o}m(Ze,"selectCodeSamples");async function et(r){try{let e=await b.getActive(r);return e?{patterns:(e.patterns??[]).map(t=>({name:t.name,description:t.description})),antiPatterns:(e.antiPatterns??[]).map(t=>({issue:t.issue,file:t.file,suggestion:t.suggestion}))}:{patterns:[],antiPatterns:[]}}catch{return{patterns:[],antiPatterns:[]}}}m(et,"getExistingPatterns");async function tt(r){try{return(await me.getTaskHistory(r)).slice(0,Ye).map(t=>({description:t.title,status:t.classification,branch:t.branchName}))}catch{return[]}}m(tt,"getTaskHistory");function st(r){try{let e=D.getActiveSummary(r);return Promise.resolve(e)}catch(e){return ue.debug("Failed to get previous LLM analysis summary",{error:e}),Promise.resolve(null)}}m(st,"getPreviousAnalysisSummary");J();X();ce();J();async function be(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.seal(o);return e.json?(console.log(JSON.stringify({success:s.success,signature:s.signature,error:s.error})),{success:s.success,error:s.error}):s.success?(d.done("Analysis sealed"),console.log(` Signature: ${s.signature?.substring(0,16)}...`),console.log(""),{success:!0,data:{signature:s.signature}}):(d.fail(s.error||"Seal failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(be,"seal");async function Ce(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.rollback(o);return e.json?(console.log(JSON.stringify({success:s.success,restoredSignature:s.restoredSignature,error:s.error})),{success:s.success,error:s.error}):e.md?s.success?(console.log(y(L("Analysis Rolled Back"),E({"Restored signature":`${s.restoredSignature?.substring(0,16)}...`,Note:"Previous sealed version is now active. Current version moved to draft."}))),{success:!0,data:{restoredSignature:s.restoredSignature}}):(console.log(y("## Rollback Failed",`> ${s.error}`)),{success:!1,error:s.error}):s.success?(d.done("Analysis rolled back to previous sealed version"),console.log(` Restored signature: ${s.restoredSignature?.substring(0,16)}...`),console.log(" Previous sealed version demoted to draft"),console.log(""),{success:!0,data:{restoredSignature:s.restoredSignature}}):(d.fail(s.error||"Rollback failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Rollback Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(Ce,"rollback");async function xe(r=process.cwd(),e={}){if(e.semantic)return te(r,e);try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await b.verify(o);return e.json?(console.log(JSON.stringify(s)),{success:s.valid}):(s.valid?d.done(s.message):d.fail(s.message),console.log(""),{success:s.valid,data:s})}catch(t){let o=k(t);return ge(o)}}m(xe,"verify");async function te(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json?console.log(JSON.stringify({success:!1,error:"No project ID found"})):d.fail("No project ID found"),t.result;let o=t.value,s=(()=>{try{return _.getDoc(o,"project")?.repoPath||r}catch{return r}})(),i=await b.semanticVerify(o,s);if(e.json)return console.log(JSON.stringify(i)),{success:i.passed,data:i};console.log(""),i.passed?(d.done("Semantic verification passed"),console.log(` ${i.passedCount}/${i.checks.length} checks passed (${i.totalMs}ms)`)):(d.fail("Semantic verification failed"),console.log(` ${i.failedCount}/${i.checks.length} checks failed`)),console.log(""),console.log("Check Results:");for(let n of i.checks){let a=n.passed?"\u2713":"\u2717",u=n.passed?`${n.output} (${n.durationMs}ms)`:n.error||"Failed";console.log(` ${a} ${n.name}: ${u}`)}return console.log(""),{success:i.passed,data:i}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(te,"semanticVerifyCommand");import De from"node:fs/promises";import Re from"node:path";import{z as l}from"zod";var nt=l.object({style:l.string(),insights:l.array(l.string()),domains:l.array(l.string())}),rt=l.object({name:l.string(),description:l.string(),locations:l.array(l.string()),confidence:l.number().min(0).max(1),category:l.string()}),ot=l.object({issue:l.string(),reasoning:l.string(),files:l.array(l.string()),suggestion:l.string(),severity:l.enum(["low","medium","high"]),confidence:l.number().min(0).max(1)}),at=l.object({description:l.string(),area:l.string(),effort:l.enum(["small","medium","large"]),impact:l.string(),priority:l.enum(["low","medium","high"])}),it=l.object({path:l.string(),reason:l.string(),risk:l.string(),severity:l.enum(["low","medium","high"])}),ct=l.object({description:l.string(),files:l.array(l.string()),benefit:l.string(),effort:l.enum(["small","medium","large"])}),lt=l.object({category:l.string(),rule:l.string(),example:l.string().optional()}),ut=l.object({build:l.string().optional(),test:l.string().optional(),lint:l.string().optional(),dev:l.string().optional(),format:l.string().optional(),install:l.string().optional()}),mt=l.object({languages:l.array(l.string()),frameworks:l.array(l.string()),packageManager:l.string().optional()}),gt=l.object({version:l.literal(1),commitHash:l.string().nullable(),analyzedAt:l.string(),architecture:nt,patterns:l.array(rt),antiPatterns:l.array(ot),techDebt:l.array(at),riskAreas:l.array(it),refactorSuggestions:l.array(ct),projectInsights:l.array(l.string()),conventions:l.array(lt),commands:ut.optional(),stack:mt.optional()});function Ae(r){let e=gt.safeParse(r);return e.success?{ok:!0,value:e.data}:{ok:!1,error:e.error.issues.map(o=>`${o.path.length>0?o.path.join("."):"<root>"}: ${o.message}`).join("; ")}}m(Ae,"parseLlmAnalysis");X();re();async function Le(r,e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await pt(r,e),n=await ft(i.content,e),a=D.getActive(s),u=!!(a&&ye(a)&&K(n)),c=u?dt(a,n):n;D.save(s,c);try{let{recomputeProjectStyle:f}=await import("./project-style-evolution-7MAUSED2.mjs"),{gatherStats:h,detectStack:x,detectCommands:B}=await import("./sync-analyzer-6U5GHYV3.mjs"),[T,P,Q]=await Promise.all([h(e),x(e),B(e)]);await f({projectId:s,projectPath:e,stats:T,stack:P,commands:Q,commitHash:c.commitHash,source:"analysis-save"})}catch{}let p=K(c)&&!u;if(t.md){let h=[L(u?"LLM Analysis Notes Merged (house style preserved)":p?"LLM Analysis Notes Saved (thin \u2014 not house style)":"LLM Analysis Saved"),E({Input:i.source,Architecture:c.architecture.style,Patterns:c.patterns.length,"Anti-patterns":c.antiPatterns?.length||0,"Tech debt items":c.techDebt?.length||0,"Risk areas":c.riskAreas?.length||0,Conventions:c.conventions?.length||0,...u?{Merge:"thin notes \u2192 existing rich analysis"}:{},...p?{Kind:"thin markdown/notes"}:{}})];p&&h.push(z("Prefer schema v1 JSON (architecture/patterns/conventions) via `prjct analysis-save-llm <file> --md`. Markdown alone leaves patterns empty and burns a retry loop.")),console.log(y(...h))}else console.log(JSON.stringify({success:!0,message:u?"LLM analysis notes merged into existing rich analysis":p?"LLM analysis thin notes saved (prefer schema v1 JSON for house style)":"LLM analysis saved",input:i.source,mergedNotes:u,thin:p,stats:{patterns:c.patterns.length,antiPatterns:c.antiPatterns?.length||0,techDebt:c.techDebt?.length||0},...p?{tip:"Prefer schema v1 JSON (architecture/patterns/conventions). Markdown alone is thin notes."}:{}}));return{success:!0}}catch(o){return A(o)}}m(Le,"saveLlmAnalysis");function dt(r,e){let t=m((o,s,i)=>{let n=[],a=new Set;for(let u of[...o,...s]){let c=u.toLowerCase();if(!(a.has(c)||!u.trim())&&(a.add(c),n.push(u),n.length>=i))break}return n},"mergeUnique");return{...r,analyzedAt:e.analyzedAt,commitHash:e.commitHash??r.commitHash,projectInsights:t(r.projectInsights??[],e.projectInsights??[],60),architecture:{...r.architecture,insights:t(r.architecture.insights??[],e.architecture.insights??[],24)}}}m(dt,"mergeThinNotesIntoRich");async function pt(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm requires analysis text, JSON, or a file path");let o=Re.isAbsolute(t)?t:Re.resolve(e,t);try{if((await De.stat(o)).isFile())return{content:await De.readFile(o,"utf-8"),source:"file"}}catch{}return{content:r,source:"inline"}}m(pt,"resolveAnalysisInput");async function ft(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm received an empty analysis");let o=ht(t);if(o.ok){let s=Ae(o.value);return s.ok?s.value:Me(`Structured analysis did not match the legacy schema; preserved as LLM notes.
|
|
12
|
+
|
|
13
|
+
${JSON.stringify(o.value,null,2)}`,e)}return Me(t,e)}m(ft,"normalizeAnalysis");function ht(r){try{return{ok:!0,value:JSON.parse(r)}}catch{return{ok:!1}}}m(ht,"tryParseJson");async function Me(r,e){let t=yt(r);return{version:1,commitHash:await wt(e),analyzedAt:I(),architecture:{style:"unknown",insights:t.slice(0,8),domains:[]},patterns:[],antiPatterns:[],techDebt:[],riskAreas:[],refactorSuggestions:[],projectInsights:t,conventions:[]}}m(Me,"analysisFromText");function yt(r){let e=r.split(/\r?\n/).map(s=>s.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s*[-*]\s+\[[ xX]\]\s+/,"").replace(/^\s*[-*]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").trim()).filter(St),t=[],o=new Set;for(let s of e){let i=s.toLowerCase();if(!o.has(i)&&(o.add(i),t.push(s),t.length>=40))break}return t.length>0?t:[r.slice(0,2e3)]}m(yt,"textToInsights");function St(r){if(!r||!/[\p{L}\p{N}]/u.test(r))return!1;let e=r.toLowerCase().replace(/\s+/g," ").trim();return!(["current work","wip","misc","todo","n/a","none","latest","unreleased","changelog"].includes(e)||/^[-=_]{3,}$/.test(e)||/^(added|changed|fixed|removed)$/i.test(e)||/^v?\d+\.\d+\.\d+(?:-[\w.-]+)?$/i.test(e))}m(St,"isUsefulInsight");async function wt(r){try{let{stdout:e}=await ne("git",["rev-parse","HEAD"],{cwd:r});return e.trim()||null}catch{return null}}m(wt,"resolveCurrentCommit");async function Ne(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=D.getActive(o);if(!s)return e.md?console.log(y("## No LLM Analysis","> Run `prjct sync` to generate.")):console.log(JSON.stringify({success:!1,message:"No LLM analysis found"})),{success:!1,message:"No LLM analysis found"};if(e.md){let i=[L(`LLM Analysis (${s.architecture.style})`),""];if(s.architecture.insights.length>0&&i.push(R("Architecture Insights",M(s.architecture.insights.slice(0,5)))),s.patterns.length>0){let n=s.patterns.slice(0,8);i.push(R(`Patterns (${s.patterns.length})`,M(n.map(a=>`**${a.name}** \u2014 ${a.description} (${a.category})`))))}if(s.antiPatterns.length>0){let n=s.antiPatterns.slice(0,5);i.push(R(`Anti-Patterns (${s.antiPatterns.length})`,M(n.map(a=>`[${a.severity}] ${a.issue} \u2014 ${a.suggestion}`))))}if(s.techDebt.length>0){let n=s.techDebt.slice(0,5);i.push(R(`Tech Debt (${s.techDebt.length})`,M(n.map(a=>`[${a.priority}/${a.effort}] ${a.description}`))))}s.conventions.length>0&&i.push(R("Conventions",M(s.conventions.slice(0,5).map(n=>`**${n.category}**: ${n.rule}`)))),console.log(y(...i))}else{let i={...s,patterns:s.patterns.slice(0,10),antiPatterns:s.antiPatterns.slice(0,6),techDebt:s.techDebt.slice(0,6),conventions:s.conventions.slice(0,6)};console.log(JSON.stringify({success:!0,analysis:i}))}return{success:!0,data:s}}catch(t){return A(t)}}m(Ne,"getLlmAnalysis");ce();J();import $t from"node:path";X();async function Te(r,e){let t=Date.now()-e;await le.installGlobalConfig(),d.done(`Synced ${r.stats.name||"project"} (${(t/1e3).toFixed(1)}s)`),console.log("");let o=r.stats.frameworks.length>0?` (${r.stats.frameworks[0]})`:"",s=r.syncMetrics?.indexes,i=[`${r.stats.fileCount} files indexed`,`Stack: ${r.stats.ecosystem}${o} | Branch: ${r.git.branch}`];if(s?.bm25Files){let a=s.bm25Files*(s.bm25AvgTokens||0);i.push(`Index: ${O(a)} tokens | ${s.bm25VocabSize||0} terms | ${s.importEdges||0} imports`)}d.box("Sync Summary",i.join(`
|
|
14
|
+
`));let n=[];if(r.generatedSkills?.generated&&r.generatedSkills.generated.length>0){let a=r.generatedSkills.generated.length,u=a===1?"skill":"skills";n.push(`${a} ${u} generated`)}if(r.context7&&n.push(`Context7: ${r.context7.verified?"verified":`not ready${r.context7.message?` (${r.context7.message})`:""}`}`),r.analysisSummary&&n.push(`Analysis: ${r.analysisSummary.patterns} patterns | ${r.analysisSummary.antiPatterns} anti-patterns (${r.analysisSummary.criticalAntiPatterns} critical)`),r.contextQuality){let a=r.contextQuality,u=a.irrelevantRemoved>0||a.repairEntriesCreated>0?`, repaired ${a.repairEntriesCreated}, removed ${a.irrelevantRemoved}`:"";n.push(`Context quality: ${a.score}/${a.threshold}${a.passed?"":" (needs review)"}${u}`)}if(d.section("Generated"),d.list(n,{bullet:"\u2713"}),console.log(""),r.phaseTimings&&r.phaseTimings.length>0){let a=[...r.phaseTimings].sort((u,c)=>c.ms-u.ms).slice(0,3).map(u=>`${u.phase} ${(u.ms/1e3).toFixed(1)}s`).join(", ");console.log(`Slowest phases: ${a}`),console.log("")}if(r.git.hasChanges&&(d.warn("Uncommitted changes detected"),console.log("")),r.verification){let a=r.verification;if(a.passed){let u=a.checks.map(c=>`${c.name} (${c.durationMs}ms)`);d.section("Verified"),d.list(u,{bullet:"\u2713"})}else{d.section("Verification");let u=a.checks.map(c=>c.passed?`\u2713 ${c.name}`:`\u2717 ${c.name}${c.error?` \u2014 ${c.error}`:""}`);d.list(u),a.skippedCount>0&&d.warn(`${a.skippedCount} check(s) skipped (fail-fast)`)}console.log("")}return ve("sync"),{success:!0,data:r,metrics:{elapsed:t,fileCount:r.stats.fileCount}}}m(Te,"showSyncResult");async function Fe(r){try{let e=await de.getRecentEvents(r,100),t=new Date().toISOString().split("T")[0],o=e.filter(c=>(c.timestamp||c.ts)?.startsWith(t)),s=(()=>{if(o.length<2)return null;let c=o.map(f=>new Date(f.timestamp||f.ts).getTime()).filter(f=>!Number.isNaN(f)).sort((f,h)=>f-h);if(c.length<2)return null;let p=c[c.length-1]-c[0];return oe(p)})(),i=o.filter(c=>c.action==="task_completed").length,n=o.filter(c=>c.action==="feature_shipped").length,a=new Map;for(let c of o)if(c.action==="sync"&&Array.isArray(c.subagents))for(let p of c.subagents)a.set(p,(a.get(p)||0)+1);let u=Array.from(a.entries()).map(([c,p])=>({name:c,count:p})).sort((c,p)=>p.count-c.count);return{sessionDuration:s,tasksCompleted:i,featuresShipped:n,agentsUsed:u}}catch{return{sessionDuration:null,tasksCompleted:0,featuresShipped:0,agentsUsed:[]}}}m(Fe,"getSessionActivity");function O(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:r.toLocaleString()}m(O,"formatTokens");function se(r){return r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(1)}s`}m(se,"formatDuration");function Ee(r){if(r.length===0)return"";let e="\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588",t=r.map(s=>s.tokensSaved),o=Math.max(...t,1);return t.map(s=>{let i=Math.min(Math.floor(s/o*(e.length-1)),e.length-1);return e[i]}).join("")}m(Ee,"generateSparkline");function Oe(r,e,t,o,s,i){let n=[];if(n.push(`# ${t} - Stats Dashboard`),n.push(""),n.push(`_Generated: ${new Date().toLocaleString()} | Tracking since: ${o}_`),n.push(""),s){if(n.push("## Today's Activity"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),s.sessionDuration&&n.push(`| Duration | ${s.sessionDuration} |`),n.push(`| Tasks completed | ${s.tasksCompleted} |`),n.push(`| Features shipped | ${s.featuresShipped} |`),s.agentsUsed.length>0){let a=s.agentsUsed.slice(0,3).map(u=>`${u.name} (${u.count}\xD7)`).join(", ");n.push(`| Agents used | ${a} |`)}n.push("")}if(i&&(i.decisions>0||i.preferences>0)&&(n.push("## Patterns Learned"),n.push(""),n.push("| Type | Count |"),n.push("|------|-------|"),n.push(`| Decisions | ${i.learnedDecisions} confirmed (${i.decisions} total) |`),n.push(`| Preferences | ${i.preferences} |`),n.push(`| Workflows | ${i.workflows} |`),n.push("")),n.push("## Context Efficiency"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Tokens reduced | ${O(r.totalTokensSaved)} |`),n.push(`| Compression | ${(r.compressionRate*100).toFixed(0)}% |`),n.push(`| Est. cost saved | ${U(r.estimatedCostSaved)} |`),n.push(""),n.push("## Performance"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Syncs | ${r.syncCount} |`),n.push(`| Avg time | ${se(r.avgSyncDuration)} |`),n.push(""),r.topAgents.length>0){n.push("## Agent Usage"),n.push(""),n.push("| Agent | Usage |"),n.push("|-------|-------|");let a=r.topAgents.reduce((u,c)=>u+c.usageCount,0);for(let u of r.topAgents){let c=a>0?(u.usageCount/a*100).toFixed(0):0;n.push(`| ${u.agentName} | ${c}% (${u.usageCount}) |`)}n.push("")}if(n.push("## 30-Day Trend"),n.push(""),n.push(`- Tokens saved: ${O(r.last30DaysTokens)}`),r.trend!==0){let a=r.trend>0?"+":"";n.push(`- Trend: ${a}${r.trend.toFixed(0)}% vs previous period`)}return n.push(""),n.push("---"),n.push(""),n.push("_Generated with [prjct-cli](https://prjct.app)_"),n.join(`
|
|
15
|
+
`)}m(Oe,"generateStatsMarkdown");function Ie(r,e){let t=[];t.push(`# Repository Analysis
|
|
16
|
+
`),t.push(`Generated: ${new Date().toLocaleString()}
|
|
17
|
+
`);let o=$t.basename(e);if(t.push(`## Project: ${o}
|
|
18
|
+
`),t.push(`## Stack Detected
|
|
19
|
+
`),r.packageJson){let n=r.packageJson;if(t.push(`### JavaScript/TypeScript
|
|
20
|
+
`),t.push("- **Package Manager**: npm/yarn/pnpm"),n.dependencies){let a=Object.keys(n.dependencies);a.length>0&&t.push(`- **Dependencies**: ${a.slice(0,10).join(", ")}${a.length>10?` (+${a.length-10} more)`:""}`)}r.hasNextConfig&&t.push("- **Framework**: Next.js detected"),r.hasViteConfig&&t.push("- **Build Tool**: Vite detected"),r.hasTsconfig&&t.push("- **Language**: TypeScript"),t.push("")}r.cargoToml&&(t.push(`### Rust
|
|
21
|
+
`),t.push("- **Package Manager**: Cargo"),t.push(`- **Language**: Rust
|
|
22
|
+
`)),r.goMod&&(t.push(`### Go
|
|
23
|
+
`),t.push("- **Package Manager**: Go modules"),t.push(`- **Language**: Go
|
|
24
|
+
`)),r.requirements&&(t.push(`### Python
|
|
25
|
+
`),t.push("- **Package Manager**: pip"),t.push(`- **Language**: Python
|
|
26
|
+
`));let s=r.directories;t.push(`## Structure
|
|
27
|
+
`),t.push(`- **Total Files**: ${r.fileCount}`),t.push(`- **Directories**: ${s?.slice(0,15).join(", ")||"none"}${(s?.length||0)>15?` (+${(s?.length||0)-15} more)`:""}`),r.hasDockerfile&&t.push("- **Docker**: Detected"),r.hasDockerCompose&&t.push("- **Docker Compose**: Detected"),r.hasReadme&&t.push("- **Documentation**: README.md found"),t.push("");let i=r.gitStats;return t.push(`## Git Statistics
|
|
28
|
+
`),t.push(`- **Total Commits**: ${i?.totalCommits||0}`),t.push(`- **Contributors**: ${i?.contributors||0}`),t.push(`- **Age**: ${i?.age||"unknown"}`),t.push(""),r.gitLog&&(t.push(`## Recent Activity
|
|
29
|
+
`),r.gitLog.split(`
|
|
30
|
+
`).slice(0,5).forEach(a=>{if(a.trim()){let[u,,c,p]=a.split("|");t.push(`- \`${u}\` ${p} (${c})`)}}),t.push("")),t.push(`## Recommendations
|
|
31
|
+
`),t.push("Based on detected stack, consider generating specialized agents using `p. sync`.\n"),t.push(`---
|
|
32
|
+
`),t.push("*This analysis was generated automatically. For updated information, run `p. analyze` again.*\n"),t.join(`
|
|
33
|
+
`)}m(Ie,"generateAnalysisSummary");async function Je(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await q.getSummary(o),i=await q.getDailyStats(o,30),n=await Fe(o),a={decisions:0,preferences:0,workflows:0,learnedDecisions:0};if(e.json){let f={session:n,patterns:a,totalTokensSaved:s.totalTokensSaved,estimatedCostSaved:s.estimatedCostSaved,compressionRate:s.compressionRate,syncCount:s.syncCount,avgSyncDuration:s.avgSyncDuration,topAgents:s.topAgents.slice(0,5),last30DaysTokens:s.last30DaysTokens,trend:s.trend,dailyStats:i.slice(0,7)};return console.log(JSON.stringify(f)),{success:!0,data:f}}let u=(()=>{try{return _.getDoc(o,"project")?.name||"Unknown"}catch{return"Unknown"}})(),c=await q.getFirstSyncDate(o),p=c?new Date(c).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"N/A";if(console.log(""),console.log("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E"),console.log("\u2502 \u{1F4CA} prjct-cli Stats Dashboard \u2502"),console.log(`\u2502 Project: ${u.padEnd(20).slice(0,20)} | Since: ${p.padEnd(12).slice(0,12)} \u2502`),console.log("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F"),console.log(""),console.log("\u{1F3AF} TODAY'S ACTIVITY"),n.sessionDuration&&console.log(` Duration: ${n.sessionDuration}`),console.log(` Tasks completed: ${n.tasksCompleted}`),console.log(` Features shipped: ${n.featuresShipped}`),n.agentsUsed.length>0){let f=n.agentsUsed.slice(0,3).map(h=>`${h.name} (${h.count}\xD7)`).join(", ");console.log(` Agents used: ${f}`)}if(console.log(""),(a.decisions>0||a.preferences>0)&&(console.log("\u{1F9E0} PATTERNS LEARNED"),console.log(` Decisions: ${a.learnedDecisions} confirmed (${a.decisions} total)`),console.log(` Preferences: ${a.preferences} saved`),console.log(` Workflows: ${a.workflows} tracked`),console.log("")),console.log("\u{1F4B0} TOKEN SAVINGS"),console.log(` Total saved: ${O(s.totalTokensSaved)} tokens`),console.log(` Compression: ${(s.compressionRate*100).toFixed(0)}% average reduction`),console.log(` Estimated cost: ${U(s.estimatedCostSaved)} saved`),console.log(""),console.log("\u26A1 PERFORMANCE"),console.log(` Syncs completed: ${s.syncCount.toLocaleString()}`),console.log(` Avg sync time: ${se(s.avgSyncDuration)}`),console.log(""),s.topAgents.length>0){console.log("\u{1F916} AGENT USAGE (all time)");let f=s.topAgents.reduce((h,x)=>h+x.usageCount,0);for(let h of s.topAgents){let x=f>0?(h.usageCount/f*100).toFixed(0):0;console.log(` ${h.agentName.padEnd(12)}: ${x}% (${h.usageCount} uses)`)}console.log("")}if(i.length>0){console.log("\u{1F4C8} TREND (last 30 days)");let f=Ee(i);if(console.log(` ${f} ${O(s.last30DaysTokens)} tokens saved`),s.trend!==0){let h=s.trend>0?"\u2191":"\u2193",x=s.trend>0?"+":"";console.log(` ${h} ${x}${s.trend.toFixed(0)}% vs previous 30 days`)}console.log("")}if(console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),console.log("Export: prjct stats --export > stats.md"),console.log(""),e.export){let f=Oe(s,i,u,p,n,a);return console.log(f),{success:!0,data:{markdown:f}}}return{success:!0,data:{...s,session:n,patterns:a}}}catch(t){return console.error("\u274C Error:",k(t)),A(t)}}m(Je,"stats");async function _e(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.diff(o);if(!s){let i="Cannot compute diff: need both a sealed and a draft analysis. Run `p. sync` to create a draft.";return e.json?console.log(JSON.stringify({success:!1,error:i})):e.md?console.log(y("## Analysis Diff",`> ${i}`)):d.warn(i),{success:!1,error:i}}if(e.json)return console.log(JSON.stringify({success:!0,...s})),{success:!0,data:s};if(e.md)return console.log(y(G(s))),{success:!0,data:s};if(!s.hasChanges)d.done("No changes between draft and sealed analysis");else{d.section("Analysis Diff"),console.log(Se(s)),console.log("");let i=[];s.summary.added>0&&i.push(`${s.summary.added} added`),s.summary.removed>0&&i.push(`${s.summary.removed} removed`),s.summary.changed>0&&i.push(`${s.summary.changed} changed`),d.done(i.join(", "))}return console.log(""),{success:!0,data:s}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Diff Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(_e,"diff");var Ge=["> Review this project data and save durable notes for future AI agents (architecture, conventions, risks, gotchas).","> **Prefer schema v1 JSON** with: architecture{style,insights,domains}, patterns[], antiPatterns[], techDebt[], riskAreas[], refactorSuggestions[], projectInsights[], conventions[], optional stack/commands. See core/schemas/llm-analysis.ts.","> Markdown alone saves style=unknown and empty patterns (thin notes) \u2014 agents then retry and burn tokens. Use markdown only to append insight bullets when a rich analysis already exists.","> Save path: write the JSON file, then `prjct analysis-save-llm <file> --md`."].join(`
|
|
34
|
+
`),Ue=class extends ke{static{m(this,"AnalysisCommands")}async analyze(e={},t=process.cwd()){try{await this.initializeAgent(),console.log(`\u{1F50D} Analyzing repository...
|
|
35
|
+
`),S.init(t);let o={packageJson:await S.readPackageJson(),cargoToml:await S.readCargoToml(),goMod:await S.readGoMod(),requirements:await S.readRequirements(),directories:await S.listDirectories(),fileCount:await S.countFiles(),gitStats:await S.getGitStats(),gitLog:await S.getGitLog(20),hasDockerfile:await S.fileExists("Dockerfile"),hasDockerCompose:await S.fileExists("docker-compose.yml"),hasReadme:await S.fileExists("README.md"),hasTsconfig:await S.fileExists("tsconfig.json"),hasViteConfig:await S.fileExists("vite.config.ts")||await S.fileExists("vite.config.js"),hasNextConfig:await S.fileExists("next.config.js")||await S.fileExists("next.config.mjs")},s=Ie(o,t);return await this.logToMemory(t,"repository_analyzed",{timestamp:I(),fileCount:o.fileCount,gitCommits:o.gitStats.totalCommits}),console.log(`\u2705 Analysis complete!
|
|
36
|
+
`),console.log(s),console.log(`
|
|
37
|
+
Next steps:`),console.log("\u2022 p. sync \u2192 Generate agents based on stack"),console.log('\u2022 p. work "<intent>" \u2192 Start a work cycle'),{success:!0,summary:s,data:o}}catch(o){return console.error("\u274C Error:",k(o)),A(o)}}async sync(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=Date.now();if(t.package){let a=await ie.detectMonorepo(e);if(!a.isMonorepo)return{success:!1,error:"Not a monorepo. --package flag only works in monorepos."};let u=a.packages.find(p=>p.name===t.package||p.relativePath===t.package);if(!u){let p=a.packages.map(f=>f.name).join(", ");return{success:!1,error:`Package "${t.package}" not found. Available: ${p}`}}let c=await H.sync(e,{packagePath:u.path,packageName:u.name});return t.json?console.log(JSON.stringify({success:c.success,package:u.name,path:u.relativePath})):t.md?console.log(y(L(`Synced package: ${u.name}`))):d.done(`Synced package: ${u.name}`),{success:c.success}}t.md||d.spin("Syncing project...");let n=await H.sync(e,{full:t.full});if(!n.success)return t.md?console.log(y("## Sync Failed",`> ${n.error||"Unknown error"}`)):d.fail(n.error||"Sync failed"),{success:!1,error:n.error};if(t.md||d.stop(),t.md){let a=Date.now()-i,u=n.generatedSkills?.generated?.length??0,c=await b.diff(s).then(g=>g?.hasChanges?G(g):null).catch(()=>null),p=n.git.recentCommits[0]?.hash??null,h=p&&D.isCurrent(s,p)?null:await ee(s,e,n.git,n.stats).then(g=>["## Analysis Payload",Ge,"### Data","```json",JSON.stringify(g),"```"].join(`
|
|
38
|
+
`)).catch(()=>"### Next: Run `prjct analysis-payload --md` to update project analysis"),x=$e("sync",!0),B=(()=>{try{let g=he.recall(s,{types:["context"],limit:5}).map(F=>`- ${fe(F)} \`${F.id}\``);return g.length>0?["### Evaluate recent context","Task contexts captured recently \u2014 fold their decisions, patterns and","anti-patterns into the project analysis (and supersede anything now wrong):","",...g].join(`
|
|
39
|
+
`):null}catch{return null}})(),T=n.syncMetrics?.indexes,P={Duration:`${(a/1e3).toFixed(1)}s`,Skills:`${u} generated`,"Files indexed":n.stats.fileCount};if(T?.bm25Files){let g=T.bm25Files*(T.bm25AvgTokens||0);P["Tokens indexed"]=`${Math.round(g/1e3)}K`,P["Import edges"]=T.importEdges||0,P["Co-change commits"]=T.cochangeCommits||0}n.contextQuality&&(P["Context quality"]=`${n.contextQuality.score}/${n.contextQuality.threshold}`+(n.contextQuality.passed?"":" needs review"),P["Context removed"]=n.contextQuality.irrelevantRemoved,P["Context repairs"]=n.contextQuality.repairEntriesCreated);let Q=n.phaseTimings&&n.phaseTimings.length>0?R("Phase timings (slowest first)",M([...n.phaseTimings].sort((g,F)=>F.ms-g.ms).map(g=>`${g.phase}: ${(g.ms/1e3).toFixed(2)}s`))):null,qe=(()=>{if(!n.retentionDryRun)return null;let g=n.retentionDryRun,F=g.dryRun===!1?"applied":"dry-run",Be=g.dryRun===!1?` \xB7 acted: ${g.archived??0} archived, ${g.deleted??0} deleted`+(g.inboxMerged||g.inboxArchived?`, inbox ${g.inboxMerged??0} merged/${g.inboxArchived??0} archived`:""):"";if(P[`Retention (${F})`]=`${g.active} active \xB7 ${g.archive} archive \xB7 ${g.delete} delete${Be}`,g.vault){let w=g.vault,W=g.dryRun===!1?` \xB7 purged: hard\u0394${w.softDeletedPurged??0} distill\u0394${w.distilledDiscarded??0} digests+${w.digestsWritten??0} arch\u0394${w.archivesPruned??0}`:"";P.Vault=`${w.live} live \xB7 soft-del ${w.softDeleted} \xB7 archives ${w.archives} \xB7 auto ${w.autoSourceLive}${W}`}return g.samples.length>0?R(g.dryRun===!1?"Retention (Rho) \u2014 worst excess/score (actions applied)":"Retention (Rho) dry-run \u2014 worst excess/score (nothing removed)",M(g.samples.map(w=>{let W="excess"in w&&typeof w.excess=="number"?` excess=${w.excess.toFixed(2)}`:"";return`\`${w.id}\` [${w.type}] ${w.verdict} (${w.score}${W}) \u2014 ${w.reasons.join(", ")}`}))):null})(),He=n.projectStyle?.evolutionMd?n.projectStyle.evolutionMd:n.projectStyle?.summary?["## Project style","",n.projectStyle.summary,"",`Coverage: ${n.projectStyle.styleCoverage}/100 \xB7 ${n.projectStyle.patternCount} patterns \xB7 ${n.projectStyle.conventionCount} conventions \xB7 ${n.projectStyle.antiPatternCount} anti-patterns`].join(`
|
|
40
|
+
`):null,ze=n.developerSnapshotCaptured?await import("./developer-evolution-SLC34HUU.mjs").then(({renderDeveloperEvolution:g})=>g(s,4)).catch(()=>`## Developer evolution
|
|
41
|
+
|
|
42
|
+
Weekly developer snapshot captured.`):null,Ve=y(L("Sync Complete"),E(P),Q,qe,c,He,ze,n.git.hasChanges?z("Uncommitted changes detected"):null,B,h,we(x.map(g=>({label:g.desc,command:g.cmd}))));return console.log(Ve),{success:!0,data:n,metrics:{elapsed:a,skillCount:u,fileCount:n.stats.fileCount}}}return Te(n,i)}catch(o){return t.md?console.log(y("## Sync Failed",`> ${k(o)}`)):d.fail(k(o)),A(o)}}async analysisPayload(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await H.sync(e);if(!i.success)return{success:!1,error:i.error||"Failed to gather project data"};let n=i.git.recentCommits[0]?.hash??null;if(n&&D.isCurrent(s,n))return t.md?console.log(y(L("LLM analysis is current"),"> No re-analysis needed.")):console.log(JSON.stringify({success:!0,action:"skip",message:"Analysis is current"})),{success:!0,message:"Analysis is current"};let a=await ee(s,e,i.git,i.stats);return t.md?console.log(y("## Analysis Payload",Ge,"### Data","```json",JSON.stringify(a),"```")):console.log(JSON.stringify({success:!0,payload:a})),{success:!0,data:a}}catch(o){return A(o)}}async saveLlmAnalysis(...e){return Le(...e)}async getLlmAnalysis(...e){return Ne(...e)}async stats(...e){return Je(...e)}async diff(...e){return _e(...e)}async seal(...e){return be(...e)}async rollback(...e){return Ce(...e)}async verify(...e){return xe(...e)}async semanticVerify(...e){return te(...e)}};export{Ue as AnalysisCommands};
|
|
@@ -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}from"./chunk-
|
|
8
|
+
import{a,b,c}from"./chunk-TYEAIX3X.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as DEFAULT_API_URL,b as DEFAULT_WEB_URL,c as default};
|
|
@@ -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 as n}from"./chunk-Y4DUB7UN.mjs";import"./chunk-66GE3IHX.mjs";import"./chunk-J6TAD3OZ.mjs";import"./chunk-T2FCU3ZS.mjs";import"./chunk-KOCROTRM.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OIU4Y5WL.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-TYEAIX3X.mjs";import"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as t}from"./chunk-E66B27AL.mjs";async function c(u,o){try{let e=o??await import("./config-manager-2VZPHUDG.mjs").then(({default:a})=>a.readConfig(u).catch(()=>null));if(!e?.projectId||!e.cloud?.enabled||e.cloud.paused)return{ran:!1};if(!await n.hasAuth())return{ran:!1};let r=await n.sync(e.projectId,{include:e.cloud.include??{}});return{ran:!0,pushed:r.pushed?.count??0,pulled:r.pulled?.count??0,error:r.success?void 0:r.error}}catch{return{ran:!1}}}t(c,"flushIfLinked");export{c as flushIfLinked};
|
|
@@ -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 l,b as g}from"./chunk-Y5NQV46G.mjs";import{e as c,f as d}from"./chunk-HDSS6UB3.mjs";import{a as s,b as m}from"./chunk-WUHGODSQ.mjs";import{b as u,
|
|
8
|
+
import{a as l,b as g}from"./chunk-Y5NQV46G.mjs";import{e as c,f as d}from"./chunk-HDSS6UB3.mjs";import{a as s,b as m}from"./chunk-WUHGODSQ.mjs";import{b as u,p as v}from"./chunk-QWQFF2UG.mjs";import{a as n}from"./chunk-E66B27AL.mjs";m();d();v();import{execFileSync as y,spawn as j}from"node:child_process";import a from"node:fs";import i from"node:path";m();d();var w="https://registry.npmjs.org/prjct-cli/latest",$=3600*1e3;async function p(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),6e3),r=await fetch(w,{signal:e.signal});if(clearTimeout(t),!r.ok)return null;let f=await r.json();return typeof f.version=="string"?f.version:null}catch{return null}}n(p,"fetchLatestVersion");var S=n(()=>i.join(s(),"state"),"stateDir"),k=n(()=>i.join(S(),"auto-update.log"),"logPath"),h=3600*1e3;function H(e){if(!e||process.env.PRJCT_NO_AUTO_UPDATE==="1"||l("auto-update")!=="on")return;let t=l("auto-update-last-check");if(t&&Date.now()-Date.parse(t)<h)return;g("auto-update-last-check",new Date().toISOString()),j(process.execPath,[process.argv[1],"__internal-auto-update",e],{detached:!0,stdio:"ignore"}).unref()}n(H,"maybeAutoUpdate");async function L(e){try{let t=await p();if(!t)return;if(c(t,e)<=0){o(`current ${e} >= latest ${t}, no-op`);return}let r=b();o(`upgrade available: ${e} \u2192 ${t} (source: ${r})`),await x(r,t),o(`upgrade complete: ${e} \u2192 ${t}`)}catch(t){o(`auto-update failed: ${t.message}`)}}n(L,"runBackgroundCheck");function b(){let e=i.join(s(),"bin","prjct");if(a.existsSync(e))try{if(a.statSync(e).size>1024*1024)return"binary"}catch{}try{let t=y("npm",["root","-g"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(t&&a.existsSync(i.join(t,"prjct-cli")))return"npm"}catch{}try{let t=y("bun",["pm","bin","-g"],{encoding:"utf8",stdio:["ignore","pipe","ignore"]}).trim();if(t&&a.existsSync(i.join(t,"prjct")))return"bun"}catch{}return"unknown"}n(b,"detectInstallSource");async function x(e,t){if(e==="binary"){o(`binary install auto-update skipped for ${t}; run the installer manually to upgrade`);return}if(e==="bun"){await u("bun",["install","-g","prjct-cli@latest"],{timeout:12e4});return}if(e==="npm"||e==="unknown"){await u("npm",["install","-g","prjct-cli@latest"],{timeout:12e4});return}}n(x,"applyUpgrade");function o(e){try{a.mkdirSync(S(),{recursive:!0}),a.appendFileSync(k(),`${new Date().toISOString()} ${e}
|
|
9
9
|
`)}catch{}}n(o,"log");var N={fetchLatestVersion:p,detectInstallSource:b,compareSemver:c,THROTTLE_MS:h};export{N as _internal,H as maybeAutoUpdate,L as runBackgroundCheck};
|
|
@@ -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{i as a}from"./chunk-MHQTGU45.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-NWZEBCTC.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as captureGate};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as A}from"./chunk-
|
|
8
|
+
import{a as A}from"./chunk-YUKGWWL7.mjs";import{a as I,b as O,h as B}from"./chunk-UUULLTQV.mjs";import{a as D}from"./chunk-GAOQHD5S.mjs";import{a as T,b as W,e as u,g as k}from"./chunk-KG7Z6OMK.mjs";import{c as S,d as v,e as N,f as w,g as M}from"./chunk-GCKILEXJ.mjs";import{a as h}from"./chunk-E66B27AL.mjs";k();W();B();var H=25,$=4,q=100,C=["supersedes","duplicates","superseded-by"];function L(r,e,t){let n=r.get(e);if(n!==void 0)return n;let i=t();return r.set(e,i),i}h(L,"getOrCreateMapValue");function U(r){try{let e=C.map(()=>"?").join(","),t=u.query(r,`SELECT t.entry_id, t.key, t.value
|
|
9
9
|
FROM memory_entry_tags t
|
|
10
10
|
JOIN memory_entries m ON m.id = t.entry_id
|
|
11
11
|
WHERE m.deleted_at IS NULL
|
|
@@ -21,16 +21,16 @@ import{a as A}from"./chunk-GAOQHD5S.mjs";import{a as O}from"./chunk-DVBBB5BS.mjs
|
|
|
21
21
|
WHERE project_id = ? AND type = ? AND deleted_at IS NULL AND content_hash != ?
|
|
22
22
|
AND (topic_key = ? OR id IN (
|
|
23
23
|
SELECT entry_id FROM memory_entry_tags WHERE key IN ('topic', 'key') AND value = ?
|
|
24
|
-
))`,Date.now(),r,e,t,n,n)}catch{}},async remember(r,e){let t={...e.tags??{}},n=e.provenance??"declared",i=
|
|
24
|
+
))`,Date.now(),r,e,t,n,n)}catch{}},async remember(r,e){let t={...e.tags??{}},n=e.provenance??"declared",i=T(e.content);{let c=await import("./trust-boundary-EX65SUYR.mjs").then(l=>l.evaluateMemoryContent).catch(()=>null);if(c){let l=c(e.content,{force:e.force});if(!l.allow){if(e.requireWrite)throw new Error(l.denyMessage);return}}}let{classifyCapturePrecision:o}=await import("./precision-classifier-IVVAXE26.mjs"),a=o(e.content,e.type,{force:e.force===!0});if(a.action==="refuse"){if(e.requireWrite)throw new Error(`precision refuse (${a.reasonCode}): ${a.reason}`);return}a.action==="demote"&&a.demoteTo&&(t.shape_demoted="true",t.original_type=e.type,t.precision_reason=a.reasonCode),e.force&&(t["precision:force"]="true");let m=a.action==="demote"&&a.demoteTo?a.demoteTo:e.type,d=e.projectId??await(async()=>{try{let{default:c}=await import("./config-manager-2VZPHUDG.mjs");return(await c.readConfig(r))?.projectId}catch{return}})();if(!t.file)try{let{inferMemoryFileTag:c}=await import("./infer-memory-file-PIAZ542H.mjs"),l=d?await(async()=>{try{let{stateStorage:E}=await import("./state-storage-EIFGUO7X.mjs"),p=(await E.getCurrentTask(d))?.likelyFiles;return Array.isArray(p)?p.map(f=>typeof f=="string"?f:f?.path).filter(f=>typeof f=="string"&&f.length>0):null}catch{return null}})():null,R=c({content:e.content,tags:t,projectPath:r,cycleFiles:l});R&&(t.file=R,t.file_source="inferred")}catch{}let y=t.topic??t.key;if(d){try{if(u.get(d,"SELECT id FROM memory_entries WHERE content_hash = ? AND type = ? AND deleted_at IS NULL LIMIT 1",i,m)){y&&this.applyTopicSupersession(d,m,i,y);return}}catch{}try{let{captureGate:c}=await import("./capture-gate-FRF2G3IG.mjs"),l=c(d,m,e.content,t);if(!l.accept){if(e.requireWrite)throw new Error(`capture refused: ${l.reason}`);return}}catch(c){if(e.requireWrite&&c instanceof Error&&c.message.startsWith("capture refused"))throw c}}let s=await A.log(r,`${I}${m}`,{content:e.content,tags:t,source:e.source,provenance:n,content_hash:i,...d?{project_id:d}:{}},void 0,d||e.requireWrite?{...d?{projectId:d}:{},required:e.requireWrite}:void 0),g=d??s?.projectId;if(g&&y&&s?.eventId!=null&&this.applyTopicSupersession(g,m,i,y),s?.projectId)try{let{usefulnessService:c}=await import("./usefulness-SCH5ARGV.mjs");c.recordReferences(s.projectId,e.content,t),c.recordCorrection(s.projectId,t)}catch{}if(g)try{let{publishCRUD:c}=await import("./publish-helper-G54XQV5K.mjs"),l=t.spec_id??t.task_id??t.id??e.source??`mem-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await c({projectId:g,entityType:"memories",entityId:l,eventType:"upsert",data:{id:l,type:m,content:e.content,tags:t,source:e.source??null,provenance:n,created_at:new Date().toISOString(),rememberedAt:new Date().toISOString()}})}catch{}},searchFts(r,e,t){if(e.length===0||t<=0)return[];let n=e.map(s=>D(s).replace(/[^a-z0-9-]/gi,"")).filter(s=>s.length>=2);if(n.length===0)return[];let i=n.map(s=>`"${s}"*`).join(" OR "),o=(()=>{try{return u.query(r,`SELECT m.id, m.content, m.type, m.provenance, m.created_at
|
|
25
25
|
FROM memory_entries_fts ft
|
|
26
26
|
JOIN memory_entries m ON m.rowid = ft.rowid
|
|
27
27
|
WHERE memory_entries_fts MATCH ?
|
|
28
28
|
AND m.deleted_at IS NULL
|
|
29
29
|
ORDER BY bm25(memory_entries_fts) ASC, m.created_at DESC
|
|
30
|
-
LIMIT ?`,i,t*2)}catch{return[]}})();if(o.length===0)return[];let a=b(r,o.map(s=>s.id)),m=o.map(s=>({id:s.id,type:s.type??"fact",content:s.content,tags:a.get(s.id)??{},rememberedAt:new Date(s.created_at).toISOString(),provenance:s.provenance??"declared"})),d=U(r);return(d.size>0?m.filter(s=>!d.has(s.id)):m).slice(0,t)},recall(r,e={}){let t=e.limit??H,n=Math.max(t*$,q),i=e.types&&e.types.length>0?new Set(e.types):null,o=i?i.has("shipped"):!0,a=i?[...i].some(p=>p!=="shipped"):!0,m=i?[...i].filter(p=>p!=="shipped"):void 0,d=a?x(r,n,m):[],y=o?u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",n):[],s=[...d,...y.map(S)],g=i?s.filter(p=>i.has(p.type)):s,c=e.tags?g.filter(p=>
|
|
30
|
+
LIMIT ?`,i,t*2)}catch{return[]}})();if(o.length===0)return[];let a=b(r,o.map(s=>s.id)),m=o.map(s=>({id:s.id,type:s.type??"fact",content:s.content,tags:a.get(s.id)??{},rememberedAt:new Date(s.created_at).toISOString(),provenance:s.provenance??"declared"})),d=U(r);return(d.size>0?m.filter(s=>!d.has(s.id)):m).slice(0,t)},recall(r,e={}){let t=e.limit??H,n=Math.max(t*$,q),i=e.types&&e.types.length>0?new Set(e.types):null,o=i?i.has("shipped"):!0,a=i?[...i].some(p=>p!=="shipped"):!0,m=i?[...i].filter(p=>p!=="shipped"):void 0,d=a?x(r,n,m):[],y=o?u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",n):[],s=[...d,...y.map(S)],g=i?s.filter(p=>i.has(p.type)):s,c=e.tags?g.filter(p=>N(p,e.tags??{})):g,R=[...e.topic?c.filter(p=>v(p,e.topic)):c].sort((p,f)=>f.rememberedAt.localeCompare(p.rememberedAt)),E=e.dedupeByKey!==!1?w(R):R;return(()=>{if(e.pruneSuperseded===!1)return E;let p=M(E);return p.size>0?E.filter(f=>!p.has(f.id)):E})().slice(0,t)},recallForFile(r,e,t=3,n={}){if(!e)return[];let i=e.split("/").pop()??e,o=h(c=>c.type==="gotcha"||c.type==="red-herring"||c.type==="anti-pattern"||c.tags?.pattern==="recurring-bug","isPreventive"),a=Math.max(t*5,15),m=(()=>{try{return _(r,`AND file IS NOT NULL
|
|
31
31
|
AND (file = ? OR ? LIKE '%/' || file OR file = ? OR file LIKE '%/' || ?)
|
|
32
32
|
ORDER BY created_at DESC, rowid DESC
|
|
33
|
-
LIMIT ?`,e,e,i,i,a).filter(o)}catch{return[]}})(),d=n.preventiveOnly?[]:(()=>{try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT 200","context").filter(l=>(l.tags?.files??"").split(",").map(E=>E.trim()).some(E=>E===e||E===i||E.endsWith(`/${i}`)))}catch{return[]}})(),y=[...m,...d],s=M(y);return(s.size>0?y.filter(c=>!s.has(c.id)):y).slice(0,t)},getById(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return null;try{return _(r,"AND id = ?",`mem_${t[1]}`)[0]??null}catch{return null}},countByType(r,e){try{return u.get(r,"SELECT COUNT(*) AS n FROM memory_entries WHERE project_id IN (?, 'local') AND type = ? AND deleted_at IS NULL",r,e)?.n??0}catch{return 0}},recallByType(r,e,t){if(t<=0)return[];try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT ?",e,t)}catch{return[]}},forget(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return!1;let n=Number(t[1]),i=`mem_${n}`,o=(()=>{try{return u.get(r,"SELECT id FROM events WHERE id = ? AND type LIKE ?",n,`${
|
|
33
|
+
LIMIT ?`,e,e,i,i,a).filter(o)}catch{return[]}})(),d=n.preventiveOnly?[]:(()=>{try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT 200","context").filter(l=>(l.tags?.files??"").split(",").map(E=>E.trim()).some(E=>E===e||E===i||E.endsWith(`/${i}`)))}catch{return[]}})(),y=[...m,...d],s=M(y);return(s.size>0?y.filter(c=>!s.has(c.id)):y).slice(0,t)},getById(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return null;try{return _(r,"AND id = ?",`mem_${t[1]}`)[0]??null}catch{return null}},countByType(r,e){try{return u.get(r,"SELECT COUNT(*) AS n FROM memory_entries WHERE project_id IN (?, 'local') AND type = ? AND deleted_at IS NULL",r,e)?.n??0}catch{return 0}},recallByType(r,e,t){if(t<=0)return[];try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT ?",e,t)}catch{return[]}},forget(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return!1;let n=Number(t[1]),i=`mem_${n}`,o=(()=>{try{return u.get(r,"SELECT id FROM events WHERE id = ? AND type LIKE ?",n,`${O}%`)?(u.run(r,"DELETE FROM events WHERE id = ?",n),!0):!1}catch{return!1}})();try{u.run(r,"DELETE FROM memory_embeddings WHERE memory_id = ?",i)}catch{}let a=(()=>{try{return u.run(r,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),i).changes>0}catch{return!1}})();return o||a},expandWithLinks(r,e,t=5){if(e.length===0||t<=0)return[];let n=/\bmem[_-](\d+)\b/g,i=["resolves","relates","supersedes","superseded-by","duplicates","spec"],o=new Set(e.map(m=>m.id)),a=[];for(let m of e){if(a.length>=t)break;let d=new Set;for(let y of i){let s=m.tags?.[y];if(s)for(let g of String(s).matchAll(n))d.add(`mem_${g[1]}`)}for(let y of m.content.matchAll(n))d.add(`mem_${y[1]}`);for(let y of d){if(a.length>=t)break;if(o.has(y))continue;o.add(y);let s=Y.getById(r,y);s&&a.push(s)}}return a},unembeddedEntriesForIndex(r,e){try{let t=_(r,`AND type != ?
|
|
34
34
|
AND NOT EXISTS (
|
|
35
35
|
SELECT 1 FROM memory_embeddings me
|
|
36
36
|
WHERE me.memory_id = memory_entries.id AND me.model = ?
|
|
@@ -0,0 +1,69 @@
|
|
|
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 ge}from"./chunk-XE4MJNBQ.mjs";import{a as De}from"./chunk-C3W2HLJT.mjs";import{a as Ne}from"./chunk-H4CA3XZ6.mjs";import{c as Be}from"./chunk-4O4D6DV7.mjs";import{a as We,c as Ge,d as X}from"./chunk-JCYXFHQZ.mjs";import{c as fe}from"./chunk-JPSJWCFD.mjs";import{a as ae}from"./chunk-FEFP6JOL.mjs";import{a as _e,b as Ie}from"./chunk-SJ75V4WG.mjs";import{b as He,c as Me,d as Fe}from"./chunk-7JEKBJAP.mjs";import{a as Le}from"./chunk-27XFSCOE.mjs";import{a as D}from"./chunk-YUKGWWL7.mjs";import{c as qe,f as L,h as Oe}from"./chunk-UUULLTQV.mjs";import{b as w}from"./chunk-6UH244CC.mjs";import{a as I}from"./chunk-5EQLQ7GF.mjs";import{b as me}from"./chunk-AZHE4VOM.mjs";import{e as _,g as Ae}from"./chunk-KG7Z6OMK.mjs";import{a as je,b as ne,h as pe}from"./chunk-JAMSIKDE.mjs";import{f as de,g as Pe,h as $,j as H,k as Ee,n as Re,o as $e}from"./chunk-UH4MD3F3.mjs";import{a as ue,b as S,e as J,i as re,l as Y,o as Ce,p as se}from"./chunk-QWQFF2UG.mjs";import{e as R,f as wt}from"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var ie=[{name:"intent",group:"core",surface:"ai-agile",routing:{group:"spec",method:"draft"},routingMode:"cold-only",optionSchema:{strings:["goal","tags"]},description:"Frame the work brief: objective, constraints, risks, and success signal",usage:{claude:'p. intent "<title>"',terminal:'prjct intent "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["v3 work-cycle replacement for ticket-style planning","Stores the durable brief in SQLite","Sub-verbs mirror spec for compatibility: list, show, update, audit, link-work, ship"]},{name:"work",group:"core",surface:"ai-agile",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec","geometry"],booleans:["extend"]},description:"Start or inspect a work cycle with context and evidence",usage:{claude:'p. work "<intent>"',terminal:'prjct work "<intent>" [--geometry split|single|direct]'},params:"[intent] [--geometry]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["v3 name for the execution cycle formerly exposed as task","No arg \u2192 shows the active work cycle","Surfaces related context before planning/editing","Captures harness/evidence expectations for the cycle"]},{name:"init",group:"core",surface:"support",routing:{group:"planning",method:"init"},description:"Deep project analysis and initialization",usage:{claude:'p. init "[idea]"',terminal:'prjct init "[idea]" [--yes] [--pack code,daily]'},params:"[idea] [--yes]",implemented:!0,hasTemplate:!0,requiresProject:!1,requiresLlm:!0,features:["Architect mode for blank projects","Auto tech stack recommendation","Analyzes existing codebases","`--yes` skips wizard (CI / 60s quickstart)"]},{name:"quickstart",group:"core",surface:"support",routing:{group:"planning",method:"quickstart"},optionSchema:{strings:["pack"]},description:"One-shot init + packs + agent surfaces (\u224860s install)",usage:{claude:"p. quickstart",terminal:"prjct quickstart [--pack code,daily]"},params:"[--pack]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Non-interactive init --yes","Default packs + AGENTS/CLAUDE routing","Prints three next verbs for the agent"]},{name:"task",group:"legacy",surface:"legacy",routing:{group:"workflow",method:"now"},optionSchema:{strings:["spec"],booleans:["extend"]},description:"Compatibility alias for `work`",usage:{claude:null,terminal:'prjct task "<description>"'},params:"[description]",implemented:!0,hasTemplate:!0,requiresProject:!0,features:["No arg \u2192 shows the active task (or none)","Deprecated public language: use `prjct work` for the v3 work cycle","Auto-harness classifies H0-H3 and stores expected evidence on the task","Writes to stateStorage; runs before/after workflow rules","Optional Linear issue link when the arg matches `[A-Z]+-\\d+`"]},{name:"ship",group:"core",surface:"ai-agile",routing:{group:"shipping",method:"ship"},optionSchema:{booleans:["skipHooks","noSpecGate","noTestGate","allowNewDeps","forcePressure","noJudgmentGate"],strings:["intent","geometry"]},description:"Commit, push, and celebrate shipped feature",usage:{claude:'p. ship ["feature"]',terminal:'prjct ship ["feature"]'},params:"[feature]",implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["No arg \u2192 ships the active task description, or derives a summary from the branch"]},{name:"sync",group:"core",surface:"ai-agile",routing:{group:"analysis",method:"sync"},description:"Sync project state and update workflow agents",usage:{claude:"p. sync",terminal:"prjct sync [--package=<name>] [--full]"},implemented:!0,hasTemplate:!0,requiresProject:!0,requiresLlm:!0,features:["Incremental sync: only re-analyzes changed files (default)","Force full sync: --full bypasses incremental cache","Monorepo support: --package=<name> for single package sync","Nested PRJCT.md inheritance","Per-package CLAUDE.md generation"]},{name:"eval",group:"optional",surface:"support",routing:{group:"eval",method:"eval"},optionSchema:{booleans:["publish","dryRun","json"],strings:["baseline","candidate","source","target","file"]},description:"Run product evals, compare versions, and publish actionable results",usage:{claude:"p. eval run [--candidate <version>] [--publish]",terminal:"prjct eval <run|compare|report|publish> [--baseline <version>] [--candidate <version>] [--target cloud] [--dry-run]"},params:"[run|compare|report|publish]",implemented:!0,hasTemplate:!1,requiresProject:!1,requiresLlm:!1,features:["Deterministic local eval runs stored under PRJCT_CLI_HOME/evals","Version comparisons with regression/improvement actionables","Cloud publication for shared benchmark history with server-side ownership and subscription checks"]},{name:"status",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"status"},optionSchema:{strings:["tokensIn","tokensOut"]},description:"Compatibility lifecycle escape hatch; prefer `work` outcomes",usage:{claude:null,terminal:"prjct status <value>"},params:"[value]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["No args \u2192 prints active task + current status","Workflows are the primary status-change mechanism; this is the escape"]},{name:"tag",group:"legacy",surface:"legacy",routing:{group:"primitives",method:"tag"},optionSchema:{},description:"Compatibility metadata escape hatch; prefer synthesized context tags",usage:{claude:null,terminal:"prjct tag type:bug domain:auth"},params:"<pairs...>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Claude decides what to tag \u2014 no heuristic classifier","type:<feature|bug|improvement|chore> promotes to tasks.type"]},{name:"remember",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"remember"},optionSchema:{strings:["tags"],booleans:["force","global"]},description:"Capture a project memory entry (fact, decision, learning, gotcha, \u2026)",usage:{claude:'p. remember learning "message"',terminal:'prjct remember learning "message" --tags domain:auth'},params:'<type> "<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Types: fact, decision, learning, gotcha, pattern, anti-pattern, shipped, inbox, todo, idea, insight, question, source, person \u2014 plus user-defined","Grows the project memory consumable via `prjct context memory`"]},{name:"forget",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"forget"},optionSchema:{},description:"Delete a project memory entry by id (the delete half of `remember`)",usage:{claude:"p. forget mem_1234",terminal:"prjct forget mem_1234 [--md]"},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Accepts `mem_1234`, `mem-1234`, or a bare `1234`","Hard-deletes the source event + drops the FTS mirror and any embedding \u2014 cannot resurface lexically or semantically"]},{name:"close",group:"core",surface:"ai-agile",routing:{group:"primitives",method:"close"},optionSchema:{strings:["reason"]},description:"Resolve/close a memory entry (inbox, signal, trap) so it leaves rotation \u2014 soft-delete + closed tag",usage:{claude:'p. close mem_1234 --reason "fixed in PR"',terminal:'prjct close mem_1234 [--reason "..."] [--md]'},params:"<id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Soft-removes from recall/FTS/embeddings; records status:closed for audit","Use for resolved inbox/improvement-signals \u2014 prefer over silent forget when the resolution matters"]},{name:"capture",group:"legacy",surface:"legacy",routing:{group:"capture",method:"capture"},optionSchema:{strings:["tags"],booleans:["force","fromCurrent"]},description:"Compatibility inbox fallback; prefer synthesized `remember context`",usage:{claude:null,terminal:'prjct capture "call Ana re pricing" --tags domain:sales'},params:'"<content>" [--tags k:v,...]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes memory type=inbox; Claude retypes later via a clarify workflow","No task id, no branch, no worktree \u2014 just persists",'Bare `prjct "<text>"` auto-routes to `capture`']},{name:"seed",group:"setup",surface:"support",routing:{group:"seed",method:"seed"},routingMode:"bin-only",optionSchema:{},description:"Manage declarative packs (persona, memory types, workflow slots, hook signals)",usage:{claude:"p. seed list",terminal:"prjct seed add pm,daily"},params:"[add|remove|list|suggest] [pack,pack,...]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Packs declare signals only \u2014 no bash is written","Add or remove multi-persona contexts per project","Auto-detect suggestion from project stack"]},{name:"mcp",group:"setup",surface:"support",routing:{group:"mcp",method:"mcp"},routingMode:"bin-only",optionSchema:{},description:"Toggle MCP servers per-project \u2014 interactive multi-select in your terminal, list/deny/allow for scripts",usage:{claude:"p. mcp list",terminal:"prjct mcp"},params:"[list|status|deny|allow] [serverName]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Interactive multi-select with live tool-cost delta (default UX in TTY)","Project-local \u2014 writes only to .claude/settings.local.json","Knows the well-known cloud MCPs from claude.ai (PostHog, Atlassian, etc.)","Headless list/deny/allow for LLM agents and scripts (--md flag)"]},{name:"install",group:"setup",surface:"support",routing:{group:"install",method:"install"},routingMode:"bin-only",optionSchema:{},description:"Install universal agent surfaces, Claude hooks, and Codex config",usage:{claude:"p. install",terminal:"prjct install"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Inside a prjct project, refreshes AGENTS.md as the portable baseline","Writes Claude passive hooks: SessionStart, UserPromptSubmit, \u2026","Repairs detected Codex config.toml with prjct MCP and TUI status_line","Idempotent; existing non-prjct hooks stay intact","Audit agent support with `prjct agents doctor`"]},{name:"help",group:"setup",surface:"support",routingMode:"bin-only",description:"Contextual help and guidance",usage:{claude:"p. help [topic]",terminal:"prjct help [topic]"},params:"[topic]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"analysis-save-llm",group:"optional",surface:"internal",routing:{group:"analysis",method:"saveLlmAnalysis"},description:"Persist analysis notes produced by an LLM run",usage:{claude:null,terminal:"prjct analysis-save-llm <file|text|json>"},params:"<file|text|json>",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0},{name:"analyze",group:"legacy",surface:"legacy",routing:{group:"analysis",method:"analyze"},description:"Compatibility alias for sync analysis",usage:{claude:null,terminal:"prjct analyze"},implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0},{name:"code",group:"optional",surface:"support",routing:{group:"code",method:"code"},optionSchema:{},description:"Structural code graph: symbols, trace, impact/risk, architecture (run after sync)",usage:{claude:"p. code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]",terminal:"prjct code [symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm]"},params:"[symbols|trace|impact|architecture|dead|export|import|push-graph|reindex|cbm] [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Symbol index on sync; 4th work-scope signal; CALLS with enclosing + imports","trace / impact (hunk-level) / architecture / dead one-shots","Per-project cache under ~/.prjct-cli/projects/<id>/ (never in client repo)","push-graph: full Function/Class/File + CALLS/IMPORTS graph \u2192 cloud 3D (no node/link caps)","PreToolUse Grep|Glob augment; ship structural risk cue; optional CBM cli"]},{name:"lean",group:"optional",surface:"support",routing:{group:"lean",method:"lean"},optionSchema:{},description:"Anti-over-engineering: set intensity, review/audit/debt (read-only)",usage:{claude:"p. lean [review|audit|debt|off|lite|full|ultra]",terminal:"prjct lean [sub]"},params:"[review|audit|debt|off|lite|full|ultra]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show active intensity mode + a one-screen summary","review/audit/debt are advisory \u2014 no gate, no source writes","off|lite|full|ultra sets the intensity (mirrors ponytail modes)"]},{name:"tdd",group:"optional",surface:"support",routing:{group:"tdd",method:"tdd"},optionSchema:{},description:"Test-Driven Development: set intensity, run the test command (check)",usage:{claude:"p. tdd [check|off|assist|strict]",terminal:"prjct tdd [sub]"},params:"[check|off|assist|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the auto-detected test command","off|assist|strict sets the intensity (opt-in, like lean)","check runs the detected test command now (red/green) \u2014 the real gate"]},{name:"judgment",group:"optional",surface:"support",routing:{group:"judgment",method:"judgment"},optionSchema:{booleans:["md"]},description:"Precision judgment v2: evidence tax, DNA, RED/BLUE merge, ghosts, next card, ship gate",usage:{claude:"p. judgment [plan|open|add|merge|challenge|next|approve|\u2026]",terminal:"prjct judgment [sub]"},params:"[plan|open|add|merge|challenge|fix-round|fixed|verify|brief|next|ghosts|approve|escalate|status|clear]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["next \u2192 machine directive card (agent loop never re-derives state)","evidence tax + finding DNA + project ghost FP memory","RED/BLUE dual-blind merge; contradiction auto-escalates","code-strict ship hard-gates on ledger.approved before task complete"]},{name:"sdd",group:"optional",surface:"support",routing:{group:"sdd",method:"sdd"},optionSchema:{},description:"Spec-Driven Development: gate the spec pipeline (off/advisory/strict)",usage:{claude:"p. sdd [off|advisory|strict]",terminal:"prjct sdd [sub]"},params:"[off|advisory|strict]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["No arg \u2192 show mode + the active task spec station (pipeline checklist)","off|advisory|strict sets the intensity (opt-in, like lean)","strict: every task needs a reviewed spec; ship blocks unspecced work"]},{name:"notify",group:"setup",surface:"support",routing:{group:"notify",method:"notify"},optionSchema:{},description:"Desktop notifications (default on): ping on Claude-waiting + subagent-finished",usage:{claude:"p. notify [on|off]",terminal:"prjct notify [on|off]"},params:"[on|off]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Default ON \u2014 pings when Claude is waiting or a subagent finishes","No arg \u2192 show mode + what fires","off silences OS notifications (per-prompt work-state block stays)"]},{name:"agents",group:"setup",surface:"support",routing:{group:"agents",method:"agents"},optionSchema:{booleans:["fix"]},description:"Show the concrete compatibility matrix for AI coding agents (doctor) or harness surface map (surfaces)",usage:{claude:"p. agents [doctor|surfaces|doctor --fix]",terminal:"prjct agents [doctor|surfaces [--detail]|doctor --fix]"},params:"[doctor|status|list|surfaces] [--fix] [--detail]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Derives support levels from the runtime registry","Reports AGENTS.md, MCP, skills, hooks, ACP, and project-rule support","surfaces: benchmark-tier harness map (hooks/MCP/skills wire status)","doctor --fix refreshes repo-local agent surfaces when run inside a project",'Use this to audit claims like "works with Codex/Gemini/OpenCode/Cursor/Grok"']},{name:"value",group:"legacy",surface:"legacy",routing:{group:"product",method:"value"},optionSchema:{},description:"Compatibility alias for `insights value`",usage:{claude:null,terminal:"prjct value [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Scores project continuity from real SQLite data","Counts durable memory, preventive guardrails, shipped work, sync metrics, and agent coverage","Designed as the paid-tier proof screen for humans and agents"]},{name:"memory-doctor",group:"legacy",surface:"legacy",routing:{group:"product",method:"memoryDoctor"},optionSchema:{},description:"Compatibility alias for `insights quality`",usage:{claude:null,terminal:"prjct memory-doctor [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Finds duplicate groups, stale inbox entries, low-signal memories, and missing types","Read-only by default; recommends exact cleanup actions","Protects recall quality across Claude, Codex, Gemini, OpenCode, and future agents"]},{name:"report",group:"legacy",surface:"legacy",routing:{group:"product",method:"report"},optionSchema:{numbers:["days"]},description:"Compatibility alias for `insights report`",usage:{claude:null,terminal:"prjct report [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Summarizes shipped features, completed tasks, active work, and carry-forward lessons","Uses real project state instead of a marketing changelog","Useful for founders, teams, and paid Cloud status emails"]},{name:"handoff",group:"legacy",surface:"legacy",routing:{group:"product",method:"handoff"},optionSchema:{},description:'Static continuation brief for another agent. For realtime ownership transfer use `prjct switch <agent> --reason "\u2026"` + `prjct accept`.',usage:{claude:null,terminal:"prjct handoff codex [--md]"},params:"[agent]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Gives the next agent the active task, required prjct checks, and high-value memories","Works across Codex, Claude, Gemini, Cursor, OpenCode, Qwen, Kimi, Grok, and unknown future agents","For stuck same-branch rescue with ownership transfer: prjct switch / accept (not this alias)"]},{name:"guardrails",group:"legacy",surface:"legacy",routing:{group:"product",method:"guardrails"},optionSchema:{},description:"Compatibility alias for `insights guardrails`",usage:{claude:null,terminal:"prjct guardrails [--md]"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Checks changed files against preventive memory","Falls back to general project traps when no file-specific hit exists","Advisory only; no gate, no mutation"]},{name:"insights",group:"optional",surface:"ai-agile",routing:{group:"product",method:"insights"},optionSchema:{numbers:["days"]},description:"Harness intelligence: value, quality, reliability, token cost, reports, continuation, and guardrails",usage:{claude:"p. insights [value|quality|reliability|cost|report|continue|guardrails]",terminal:"prjct insights [value|quality|reliability|cost|report|continue|guardrails] [--md]"},params:"[value|quality|reliability|cost|report|continue|guardrails] [agent|days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["v3 surface for project intelligence formerly spread across value/report/handoff/memory-doctor/guardrails","Default view summarizes whether the project is compounding","reliability/trust shows whether value, cost, and performance metrics are decision-ready","cost/spend/tokens shows subscription burn, token coverage, context reuse, and capture gaps","Subcommands remain read-only except where underlying compatibility commands already mutate nothing"]},{name:"performance",group:"optional",surface:"ai-agile",routing:{group:"product",method:"performance"},optionSchema:{numbers:["days"]},description:"Measure dev+LLM efficiency per work cycle: time, tokens, model/runtime, tools, friction",usage:{claude:"p. performance [7]",terminal:"prjct performance [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Uses real task/session rows and available token columns","Stores unknown when a runtime does not expose exact model/token data","Designed to guide the next work cycle, not to create scrum velocity reports"]},{name:"perf",group:"optional",surface:"ai-agile",routing:{group:"product",method:"perf"},optionSchema:{numbers:["days"]},description:"Report p50/p95 latency for commands and hooks from local telemetry",usage:{claude:"p. perf [7]",terminal:"prjct perf [days] [--md]"},params:"[days]",implemented:!0,hasTemplate:!1,requiresProject:!0,isOptional:!0,features:["Reads existing command_duration samples from SQLite","Groups hook samples under hook:<subcommand>","Reports p50, p95, average, min, max, and sample count"]},{name:"cloud",group:"setup",surface:"support",routing:{group:"cloud",method:"cloud"},optionSchema:{},description:"Cloud sync (paid): connect/disconnect projects, sync/pull, pause/resume, list, status",usage:{claude:"p. cloud [link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",terminal:"prjct cloud [sub] [--all|--interactive|--yes]"},params:"[link|unlink|projects|sync|pull|pause|resume|status] [--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Local-first: nothing leaves until `prjct connect` / `prjct cloud link`","One project (cwd), one-by-one (--interactive), or all (--all --yes)","Disconnect is soft \u2014 cloud history kept; local vault untouched","Auto-syncs on `prjct ship` and at session end once connected"]},{name:"connect",group:"setup",surface:"support",routing:{group:"cloud",method:"connect"},optionSchema:{},description:"Connect this project to Cloud Sync (alias of `prjct cloud link`)",usage:{claude:"p. connect [--all|--interactive|--yes]",terminal:"prjct connect [--all|--interactive|--yes]"},params:"[--all|--interactive|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["cwd: connect one repo after `prjct login`","--all --yes: bulk connect (confirm with human first)","--interactive: one-by-one Y/n (TTY)"]},{name:"disconnect",group:"setup",surface:"support",routing:{group:"cloud",method:"disconnect"},optionSchema:{},description:"Disconnect this project from Cloud Sync (alias of `prjct cloud unlink`)",usage:{claude:"p. disconnect [--all|--yes]",terminal:"prjct disconnect [--all|--yes]"},params:"[--all|--yes]",implemented:!0,hasTemplate:!1,requiresProject:!1,isOptional:!0,features:["Soft disconnect \u2014 leaves Cloud list; records kept; local vault untouched","Re-connect with `prjct connect`","--all --yes: bulk disconnect after human confirm"]},{name:"workflow",group:"optional",surface:"support",routing:{group:"workflow",method:"workflow"},optionSchema:{},description:"Configure workflow hooks via natural language",usage:{claude:'p. workflow ["config"]',terminal:'prjct workflow ["config"]'},params:'["natural language config"]',implemented:!0,hasTemplate:!0,requiresProject:!0,isOptional:!0,requiresLlm:!0,features:["Natural language configuration","Before/after hooks for task, done, ship, sync","Permanent, session, or one-time preferences"]},{name:"start",group:"setup",surface:"support",routing:{group:"setup",method:"start"},routingMode:"bin-only",description:"First-time setup (install commands to editors)",usage:{claude:null,terminal:"prjct start"},implemented:!0,hasTemplate:!1,requiresProject:!1},{name:"setup",group:"setup",surface:"support",routing:{group:"setup",method:"setup"},routingMode:"bin-only",description:"Reconfigure editor installations and user-owned defaults",usage:{claude:"p. setup",terminal:"prjct setup"},params:"[--force] [--non-interactive]",implemented:!0,hasTemplate:!0,requiresProject:!1},{name:"login",group:"setup",surface:"support",routing:{group:"setup",method:"login"},description:"Authenticate with prjct cloud (opens browser)",usage:{claude:null,terminal:"prjct login"},params:"",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"logout",group:"setup",surface:"support",routing:{group:"setup",method:"logout"},description:"Sign out from prjct cloud",usage:{claude:null,terminal:"prjct logout"},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"auth",group:"setup",surface:"support",routing:{group:"setup",method:"auth"},description:"Manage cloud authentication",usage:{claude:"p. auth [action]",terminal:"prjct auth [action]"},params:"[logout|status]",implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"},{name:"context",group:"setup",surface:"support",routing:{group:"context",method:"context"},routingMode:"bin-only",optionSchema:{},description:"Smart context filtering tools for AI agents",usage:{claude:null,terminal:"prjct context <tool> [args]"},params:"<tool> [args]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["files - Find relevant files for a task","signatures - Extract code structure (~90% compression)","imports - Analyze dependency graphs","recent - Find hot files from git history","summary - Intelligent file summarization"]},{name:"search",group:"core",surface:"ai-agile",routing:{group:"context",method:"search"},optionSchema:{booleans:["global"]},description:"Search project memory (decisions, learnings, gotchas, ships\u2026) \u2014 BM25 + semantic + recall",usage:{claude:'p. search "<query>"',terminal:'prjct search "<query>" [--md]'},params:"<query>",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blended retrieval: FTS5 BM25 + opt-in semantic + recency recall","Reranks by proven usefulness, expands one hop of the memory graph","`prjct search mem_1234` resolves a specific entry by id"]},{name:"update",group:"setup",surface:"support",routing:{group:"update",method:"update"},routingMode:"bin-only",description:"Update prjct system-wide: package + migrations + daemon restart",usage:{claude:null,terminal:"prjct update [--dry-run]"},params:"[--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Phase 1: npm update (migrates homebrew \u2192 npm if needed)","Phase 2: All projects \u2014 migrate, sweep, reinstall commands","Phase 3: Daemon stop + restart with new code","--dry-run to preview without changes"]},{name:"uninstall",group:"setup",surface:"support",routing:{group:"uninstall",method:"uninstall"},routingMode:"bin-only",description:"Complete system removal of prjct",usage:{claude:null,terminal:"prjct uninstall"},params:"[--force] [--backup] [--dry-run]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Removes ~/.prjct-cli/ data","Cleans CLAUDE.md prjct section","Uninstalls Homebrew/npm packages","Backup option before deletion"]},{name:"team",group:"setup",surface:"support",routing:{group:"team",method:"team"},optionSchema:{booleans:["required","enforce"],strings:["minVersion"]},description:"Enroll this repo in prjct team mode \u2014 commits .prjct/team.json + .claude/CLAUDE.md so teammates pick up shared expectations",usage:{claude:"p. team",terminal:"prjct team [--required] [--min-version <semver>]"},params:"[--required] [--min-version <semver>]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Writes .prjct/team.json with required/minVersion config","Adds prjct context block to .claude/CLAUDE.md (per-project)","Stages both files for the next commit (does NOT commit)","Teammates clone repo + install prjct \u2192 ready to go"]},{name:"embeddings",group:"setup",surface:"support",routing:{group:"embeddings",method:"embeddings"},optionSchema:{strings:["key","model","baseUrl","authHeader","authScheme","headers","query"]},description:"Configure the GLOBAL semantic-embeddings provider (BYOT) \u2014 one API key, stored securely, used by every project.",usage:{claude:"p. embeddings status",terminal:'prjct embeddings <set|status|test|clear> [--key <K>] [--model <M>] [--base-url <U>] [--auth-header <H>] [--auth-scheme <S|none>] [--headers "k=v,..."] [--query <qs>]'},params:"[set|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["BYOT: bring your own embedding API key \u2014 ANY OpenAI-compatible provider","Zero-config: paste just --key, the base URL is auto-detected from its prefix","OpenAI, OpenRouter, Ollama, Together, Mistral, Voyage, Jina, LM Studio\u2026",'Non-Bearer providers too: --auth-header api-key --auth-scheme none --query "api-version=..." (Azure OpenAI)',"Key stored in the macOS Keychain (else a 0600 file), never in config","Global \u2014 applies to all projects; per-project config still overrides","Without a key, recall uses the always-on local subword embedder","Validate with: prjct embeddings test"]},{name:"llm",group:"setup",surface:"support",routing:{group:"llm",method:"llm"},optionSchema:{strings:["name","key","model","baseUrl","wire","provider","authHeader","authScheme"],booleans:["weak","all"]},description:"OPT-IN (default OFF): machine-local LLM brain profiles for a future owned agent loop. Does not change guest mode. enable|disable|set|use|status|test|clear.",usage:{claude:"p. llm status",terminal:"prjct llm <enable|disable|set|use|status|test|clear> [--name <n>] [--key <K>] [--model <M>] [--base-url <U>] [--wire openai-compatible|anthropic] [--weak] [--all]"},params:"[enable|disable|set|use|status|test|clear]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Default OFF \u2014 zero impact on guest harnesses until prjct llm enable (or PRJCT_OWNED_LLM=1)","Does not alter embeddings setup gate or existing verbs","Multi-profile brains: Anthropic / OpenAI / xAI / OpenRouter / Ollama / LM Studio","Partial set merges; clear <name> or clear --all (keys wiped, no orphans)","Honest probe + HTTP timeouts","Pairs with prjct agent (print mode) when enabled"]},{name:"agent",group:"setup",surface:"support",routing:{group:"agent",method:"run"},optionSchema:{numbers:["maxSteps"],booleans:["quiet","noWork"]},description:"OPT-IN owned print-mode agent (one-shot). Requires prjct llm enable + brain. Starts a work cycle by default (risks + file map injected). Tools: FS + prjct_search/guard/remember/work. Guest unchanged.",usage:{claude:null,terminal:'prjct agent "<intent>" [--max-steps N] [--no-work] [--quiet] [--md]'},params:'"<intent>"',implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Blocked unless prjct llm enable (or PRJCT_OWNED_LLM=1) and a brain profile is set","Binds to prjct work cycle (startTask) unless --no-work; attaches if one is already open","Print/one-shot only \u2014 no interactive TUI yet","Tools scoped to project root; secret-like paths denied","Does not replace Claude Code / Grok / Codex guest mode"]},{name:"log",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"log"},optionSchema:{strings:["task"]},params:"<note>",description:'Append-only implementation journal on the active work cycle \u2014 "what did the last agent try", the cheapest session-to-session continuity. Surfaced in prjct brief and prime.',usage:{claude:'p. log "tried X, blocked on Y"',terminal:'prjct log "<note>" [--task id]'}},{name:"brief",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"brief"},optionSchema:{},description:"COMPILED context artifact for a task: orchestration directive + journal + related memory + recently-landed conventions + graph position. Persisted, regenerable \u2014 retrieval as a build step.",usage:{claude:"p. brief",terminal:"prjct brief [task-id] [--md]"}},{name:"replan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"replan"},optionSchema:{},params:"<what-changed>",description:"Cascading drift repair: captures the pivot as a decision memory FIRST, then serves a re-plan directive over the open frontier so downstream items get re-evaluated against reality.",usage:{claude:'p. replan "auth moved to JWT"',terminal:'prjct replan "<what changed>"'}},{name:"plan",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"plan"},optionSchema:{},params:'["title"] | show | write "<md>" | approve | clear',description:"Plan-mode ceremony (read-only until approve): SQLite-backed plan with Context/Approach/Files/Reuse/Verification. Host must not edit source while status is draft.",usage:{claude:'p. plan "Add auth"',terminal:'prjct plan ["title"] | show | write "..." | approve | clear [--md]'},features:["Grok Build plan-mode pattern at the harness layer (no TUI ownership)","draft \u2192 write \u2192 approve; approve persists a decision memory","Single SoT in kv_store work-plan:active"]},{name:"prime",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"prime"},optionSchema:{},description:"Session-open bundle in ONE pull: active cycle + its last journal entries + ready frontier + pull-pointers. The named start-of-session ceremony.",usage:{claude:"p. prime",terminal:"prjct prime [--md]"}},{name:"land",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"land"},optionSchema:{},description:'Session-close checklist ("land the plane"): open cycle, claimed-but-unfinished items, pending sync, hand-off reminder \u2014 everything that must not die with the context.',usage:{claude:"p. land",terminal:"prjct land [--md]"}},{name:"dream",group:"ceremonies",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"ceremonies",method:"dream"},optionSchema:{booleans:["force","dryRun","md"],numbers:["minHours","minSessions"]},description:"Memory auto-dream: consolidate vault (triage inbox + Rho retention) and rebuild the L0 memory index \u2014 Claude Code KAIROS pattern, deterministic (no model call).",usage:{claude:"p. dream --force",terminal:"prjct dream [--force] [--dry-run] [--min-hours=24] [--min-sessions=5] [--md]"},params:"[--force] [--dry-run]",features:["Gates: \u226524h since last dream AND \u22655 lands (session counter) \u2014 bypass with --force","Phases: orient \u2192 gather \u2192 consolidate (triageInbox + applyRetention) \u2192 prune (L0 index)","Land auto-runs when gates open; dry-run previews without writes"]},{name:"ready",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"ready"},optionSchema:{},description:'The ready frontier: open backlog items with zero unresolved blocking dependencies \u2014 "what can I work on NOW" as a structural query, ranked by how much each item unblocks.',usage:{claude:"p. ready",terminal:"prjct ready [--md]"}},{name:"next",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"next"},optionSchema:{},description:'Deterministic "what now": top unclaimed item of the ready frontier, served WITH its orchestration directive (model tier, effort, ceremony, fan-out, points).',usage:{claude:"p. next",terminal:"prjct next [--md]"}},{name:"claim",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"claim"},optionSchema:{strings:["as"]},params:"<id>",description:"Race-free claim of a backlog item for multi-agent fan-out: succeeds only if unclaimed (atomic check-and-set).",usage:{claude:"p. claim <id>",terminal:"prjct claim <id> [--as name]"}},{name:"depend",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"depend"},optionSchema:{strings:["on","type"]},params:"<id>",description:"Add a typed dependency edge between work items: blocks | parent | related | discovered-from. Blocking edges are cycle-checked.",usage:{claude:"p. depend <id> --on <id>",terminal:"prjct depend <id> --on <id> [--type blocks|parent|related|discovered-from]"}},{name:"phases",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"phases"},optionSchema:{},description:"Topological execution phases over the dependency graph: items in the same phase are parallelizable \u2014 a data-driven fan-out plan with per-item orchestration.",usage:{claude:"p. phases",terminal:"prjct phases [--md]"}},{name:"expand",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"expand"},optionSchema:{},params:"<id>",description:"Decomposition loop: read the persisted complexity record + expansion directive for an item, or persist the agent's decomposition as subtasks with parent edges.",usage:{claude:"p. expand <id>",terminal:'prjct expand <id> ["subtask 1" "subtask 2" ...]'}},{name:"switch",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"switch"},optionSchema:{booleans:["launch"],strings:["reason"]},params:"<agent>",description:"Yield the active work cycle to another agent runtime (codex/claude/grok/\u2026) with who started + why \u2014 realtime handoff for stuck multi-terminal work.",usage:{claude:'p. switch codex --reason "\u2026"',terminal:'prjct switch <agent> [--reason "\u2026"] [--launch]'}},{name:"accept",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"accept"},optionSchema:{},params:"[hand_id]",description:"Accept a pending multi-agent handoff: rebind ownership of the live cycle and print the resume brief (who/why/task id).",usage:{claude:"p. accept [hand_id]",terminal:"prjct accept [hand_id] [--md]"}},{name:"handoffs",group:"workGraph",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"workGraph",method:"handoffs"},optionSchema:{},description:"List pending and recent multi-agent handoffs for this project.",usage:{claude:"p. handoffs",terminal:"prjct handoffs [--md]"}},{name:"changelog",group:"changelog",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"changelog",method:"changelog"},optionSchema:{},description:"Release notes from the typed delivery record: what shipped (by version) + completed work cycles in the window. Zero LLM \u2014 pure data-plane render.",usage:{claude:"p. changelog 14",terminal:"prjct changelog [days]"}},{name:"workflows",group:"workflowsReference",surface:"ai-agile",requiresProject:!1,implemented:!0,hasTemplate:!1,routing:{group:"workflowsReference",method:"workflows"},optionSchema:{},description:"Print the quality methodology reference (subagent dispatch, model policy, review/judgment/security workflows) \u2014 the rig-agnostic pull of what Claude reads as workflows.md.",usage:{claude:"p. workflows",terminal:"prjct workflows --md"}},{name:"memory",group:"memoryExport",surface:"ai-agile",requiresProject:!0,implemented:!0,hasTemplate:!1,routing:{group:"memoryExport",method:"memory"},optionSchema:{booleans:["force","dryRun","md"],strings:["reason"]},description:"Memory surface: export|import (git-shareable), index (L0 TOC), close|forget (lifecycle), dream (auto-consolidation).",usage:{claude:"p. memory index",terminal:"prjct memory export|import|index|close <id>|forget <id>|dream [--force] [--dry-run]"},features:["export/import \u2014 git-shareable JSONL under .prjct/memory-export/","index \u2014 rebuild/show L0 compact memory TOC (SessionStart injects it)","close/forget \u2014 lifecycle aliases of top-level verbs","dream \u2014 auto-consolidation + L0 rebuild"]},{name:"guard",group:"core",surface:"ai-agile",routing:{group:"guard",method:"guard"},optionSchema:{numbers:["limit"],strings:["diff"],booleans:["strict"]},description:"Surface preventive memory (gotchas, anti-patterns, recurring-bugs) recorded against a file BEFORE you edit it \u2014 anticipation, provider-agnostic.",usage:{claude:"p. guard <file>",terminal:"prjct guard <file> | prjct guard --diff <range> [--strict]"},params:"[file]",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Pillar 3 (anticipation): see the trap before you step in it","Pull, not push \u2014 also exposed as the prjct_guard MCP tool for Claude + Codex","Strict: only gotchas / anti-patterns / recurring-bugs \u2014 never plain decisions, so no noise",'Quiet by design: "clear to edit" when nothing preventive matches',"Matches absolute or repo-relative paths by exact / suffix / basename"]},{name:"config",group:"setup",surface:"support",routing:{group:"config",method:"config"},optionSchema:{},description:"Read/write global prjct config \u2014 auto-update opt-in, suggestions toggle, etc.",usage:{claude:"p. config list",terminal:"prjct config <list|get|set|unset> [key] [value]"},params:"<list|get|set|unset> [key] [value]",implemented:!0,hasTemplate:!1,requiresProject:!1,features:["Stored at ~/.prjct-cli/config/global.json","Opt into silent auto-update: prjct config set auto-update on","Toggle proactive suggestions: prjct config set suggestions off","Booleans accept on/off/true/false; numbers parsed automatically"]},{name:"spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"draft"},routingMode:"cold-only",description:"Compatibility alias for `intent` \u2014 Goal/Acceptance/Scope/Risks before work starts.",usage:{claude:null,terminal:'prjct spec "<title>" [--goal "..."] [--tags k:v,...]'},params:'"<title>" [--goal] [--tags]',implemented:!0,hasTemplate:!1,requiresProject:!0,features:['Drafting: `prjct spec "<title>"` IS the create action \u2014 there is no `draft` subverb (aliases `draft`/`new`/`create` are tolerated and stripped)',"Persists in `specs` SQLite table + memory event stream","Sub-verbs: list, show, update, apply-delta, validate, set-status, record-review, link-task, ship, audit, inventory"]},{name:"audit-spec",group:"legacy",surface:"legacy",routing:{group:"spec",method:"audit"},routingMode:"cold-only",description:"Compatibility alias for `intent audit <id>`",usage:{claude:null,terminal:"prjct audit-spec <id>"},params:"<spec-id>",implemented:!0,hasTemplate:!1,requiresProject:!0,features:["Emits dispatch prompt \u2014 Claude runs three Agent calls in parallel","Each reviewer writes back via `prjct spec record-review`","All three pass \u2192 spec auto-promotes draft \u2192 reviewed"]},...[["daemon","Run the prjct daemon in the foreground"],["stop","Stop the running prjct daemon"],["restart","Restart the prjct daemon"],["upgrade","Alias of `prjct update`",{group:"update",method:"update"}],["hook","Run a Claude Code hook event (internal; called by the hook scripts)"],["hooks","Inspect or reinstall the Claude Code hooks"],["claude","Claude Code integration management (install/uninstall)"],["crew","Run a crew (multi-subagent) workflow"],["harness","Harness scorecard, instruction observability/disposition, and Body/rig adoption (score \xB7 instructions \xB7 learn-from \xB7 list \xB7 use)"],["doctor","Diagnose the local prjct installation"],["watch","Watch project files and react to changes"],["version","Print the installed prjct version + provider status"],["prefs","Inspect or set workflow preferences"],["retro","Summarize what shipped over a time window"],["health","Codebase health snapshot"],["skill-adherence","Report how well sessions follow the prjct skill"],["review-risk","Risk-ranked review hints for the working tree"],["context-save","Save the current working context for later restore"],["context-restore","Restore a previously saved working context"]].map(([t,e,r])=>({name:t,group:"setup",description:e,routing:r,usage:{claude:null,terminal:`prjct ${t}`},implemented:!0,hasTemplate:!1,requiresProject:!1,routingMode:"bin-only"}))],yt={"-h":"help","--help":"help","-v":"version","--version":"version"},kt=new Set([...ie.filter(t=>t.routingMode==="bin-only").map(t=>t.name),...Object.entries(yt).filter(([,t])=>ie.some(e=>e.name===t&&e.routingMode==="bin-only")).map(([t])=>t)]);var Ve=new Set(ie.filter(t=>t.routing).map(t=>t.name));Oe();pe();se();Oe();import{execSync as $t}from"node:child_process";import et from"node:fs/promises";import G from"node:path";import T from"chalk";pe();$e();import Ue from"node:path";var St=["CHANGELOG.md","HISTORY.md","NEWS.md","CHANGES.md"],Tt=`# Changelog
|
|
9
|
+
|
|
10
|
+
All notable changes to this project will be documented in this file.
|
|
11
|
+
|
|
12
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
13
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
14
|
+
`,oe=class{static{o(this,"ChangelogService")}projectPath;constructor(e){this.projectPath=e}async detect(){for(let s of St){let n=Ue.join(this.projectPath,s);if(await Ee(n)){let a=await $(n),i=this.detectFormat(a);return{filePath:n,fileName:s,format:i,created:!1}}}let e="CHANGELOG.md",r=Ue.join(this.projectPath,e);return await H(r,`${Tt}
|
|
15
|
+
`),{filePath:r,fileName:e,format:"keepachangelog",created:!0}}async addEntry(e){let r=await this.detect(),s=await $(r.filePath);if(this.hasVersionEntry(s,e.version,r.format))return;let n=e.date||je(new Date),a=r.format==="keepachangelog"?this.insertKeepAChangelogEntry(s,e,n):this.insertMarkdownEntry(s,e,n);await H(r.filePath,a)}hasVersionEntry(e,r,s){let n=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(s==="keepachangelog"?new RegExp(`^## \\[${n}\\]`,"m"):new RegExp(`^## ${n}\\b`,"m")).test(e)}async addFeature(e,r){await this.addEntry({version:e,sections:{Added:[r]}})}detectFormat(e){return e.includes("Keep a Changelog")||e.includes("keepachangelog.com")||/^### (?:Added|Changed|Deprecated|Removed|Fixed|Security)\s*$/m.test(e)?"keepachangelog":"markdown"}insertKeepAChangelogEntry(e,r,s){let n=e.split(`
|
|
16
|
+
`),a=n.findIndex(c=>/^##\s*\[Unreleased\]\s*$/i.test(c));if(a!==-1){let c=n.slice(a+1).findIndex(x=>/^##\s/.test(x)),p=c===-1?n.length:a+1+c,d=n.slice(a+1,p).join(`
|
|
17
|
+
`).trim(),g=this.promoteUnreleasedBody(d,r,s);return`${[...n.slice(0,a),"## [Unreleased]","",g,"",...n.slice(p)].join(`
|
|
18
|
+
`).replace(/\n{3,}/g,`
|
|
19
|
+
|
|
20
|
+
`).trimEnd()}
|
|
21
|
+
`}let i=this.formatKeepAChangelogEntry(r,s),l=e.search(/^## /m);if(l!==-1){let c=e.slice(0,l),p=e.slice(l);return`${c}## [Unreleased]
|
|
22
|
+
|
|
23
|
+
${i}
|
|
24
|
+
${p}`}return`${e.trimEnd()}
|
|
25
|
+
|
|
26
|
+
## [Unreleased]
|
|
27
|
+
|
|
28
|
+
${i}
|
|
29
|
+
`}promoteUnreleasedBody(e,r,s){if(!e)return this.formatKeepAChangelogEntry(r,s);let n=`## [${r.version}] - ${s}`,i=(r.sections?.Added??(r.description?[r.description]:[])).filter(p=>!e.includes(p));if(i.length===0)return`${n}
|
|
30
|
+
|
|
31
|
+
${e}`;let l=i.map(p=>`- ${p}`).join(`
|
|
32
|
+
`),c=/^###\s+Added\s*$/im.test(e)?e.replace(/^###\s+Added\s*$/im,p=>`${p}
|
|
33
|
+
${l}`):`### Added
|
|
34
|
+
${l}
|
|
35
|
+
|
|
36
|
+
${e}`;return`${n}
|
|
37
|
+
|
|
38
|
+
${c}`}insertMarkdownEntry(e,r,s){let n=this.formatMarkdownEntry(r,s),a=e.indexOf(`
|
|
39
|
+
`);if(a!==-1){let i=e.slice(0,a+1),l=e.slice(a+1);return`${i}
|
|
40
|
+
${n}
|
|
41
|
+
${l}`}return`${n}
|
|
42
|
+
|
|
43
|
+
${e}`}formatKeepAChangelogEntry(e,r){let s=[`## [${e.version}] - ${r}`];return s.push(""),e.sections?this.renderSections(s,e.sections):e.description&&(s.push("### Added"),s.push(`- ${e.description}`),s.push("")),s.join(`
|
|
44
|
+
`)}renderSections(e,r){for(let[s,n]of Object.entries(r)){e.push(`### ${s}`);for(let a of n)e.push(`- ${a}`);e.push("")}}formatMarkdownEntry(e,r){let s=[`## ${e.version} - ${r}`];return s.push(""),e.sections?this.renderSections(s,e.sections):e.description&&(s.push(`- ${e.description}`),s.push("")),s.join(`
|
|
45
|
+
`)}};se();$e();import N from"node:path";var ce=class{static{o(this,"VersionService")}projectPath;constructor(e){this.projectPath=e}async detect(){let e=[()=>this.fromPackageJson(),()=>this.fromCargoToml(),()=>this.fromPyprojectToml(),()=>this.fromCsproj(),()=>this.fromVersionFile("VERSION"),()=>this.fromVersionFile("version.txt"),()=>this.fromGitTag()];for(let r of e){let s=await r();if(s)return s}return this.createFallbackVersion()}async bump(e="patch"){let r=await this.detect();if(r.file){let n=await this.readVersionFromGitHead(r.file,r.format);if(n&&this.isAheadOf(r.current,n))return r.current}let s=jt(r.current,e);return await this.writeVersion({...r,next:s}),s}async readVersionFromGitHead(e,r){let s=N.relative(this.projectPath,e),n=await J(["show",`HEAD:${s}`],{cwd:this.projectPath});if(!n.ok){if(n.kind==="exit")return null;Y(n)}try{let a=n.stdout;if(r==="json")return JSON.parse(a).version??null;if(r==="plaintext"){let i=a.trim();return he(i)?i:null}return r==="toml"?ze(a)??Ke(a):r==="xml"?Je(a):null}catch{return null}}isAheadOf(e,r){let s=e.split(".").map(a=>Number.parseInt(a,10)||0),n=r.split(".").map(a=>Number.parseInt(a,10)||0);for(let a of[0,1,2]){let i=s[a]??0,l=n[a]??0;if(i>l)return!0;if(i<l)return!1}return!1}async fromPackageJson(){let e=N.join(this.projectPath,"package.json"),r=await de(e,null);return r?.version?{current:r.version,next:W(r.version),file:e,format:"json"}:null}async fromCargoToml(){let e=N.join(this.projectPath,"Cargo.toml"),r=await $(e,"");if(!r)return null;let s=ze(r);return s?{current:s,next:W(s),file:e,format:"toml"}:null}async fromPyprojectToml(){let e=N.join(this.projectPath,"pyproject.toml"),r=await $(e,"");if(!r)return null;let s=Ke(r);return s?{current:s,next:W(s),file:e,format:"toml"}:null}async fromCsproj(){let e=await Re(this.projectPath,{extension:".csproj"});if(e.length===0)return null;let r=N.join(this.projectPath,e[0]),s=await $(r,"");if(!s)return null;let n=Je(s);return n?{current:n,next:W(n),file:r,format:"xml"}:null}async fromVersionFile(e){let r=N.join(this.projectPath,e),s=await $(r,"");if(!s)return null;let n=s.trim();return he(n)?{current:n,next:W(n),file:r,format:"plaintext"}:null}async fromGitTag(){let e=await J(["tag","--sort=-v:refname"],{cwd:this.projectPath});if(!e.ok){if(e.kind==="exit")return null;Y(e)}let r=e.stdout.trim().split(`
|
|
46
|
+
`);for(let s of r){let n=s.trim().replace(/^v/,"");if(he(n))return{current:n,next:W(n),file:null,format:"git-tag"}}return null}async createFallbackVersion(){let e=N.join(this.projectPath,"VERSION");return await H(e,`0.1.0
|
|
47
|
+
`),{current:"0.1.0",next:"0.1.1",file:e,format:"plaintext"}}async writeVersion(e){if(!e.file){e.format==="git-tag"&&await S("git",["tag",`v${e.next}`],{cwd:this.projectPath});return}switch(e.format){case"json":await this.writeJsonVersion(e.file,e.next);break;case"toml":await this.writeTomlVersion(e.file,e.next);break;case"xml":await this.writeXmlVersion(e.file,e.next);break;case"plaintext":await H(e.file,`${e.next}
|
|
48
|
+
`);break}}async writeJsonVersion(e,r){let s=await de(e,{});s&&(s.version=r,await Pe(e,s))}async writeTomlVersion(e,r){let s=await $(e,"");if(!s)return;let n=s.replace(/^(\s*version\s*=\s*")([^"]+)(")/m,`$1${r}$3`);await H(e,n)}async writeXmlVersion(e,r){let s=await $(e,"");if(!s)return;let n=s.replace(/(<Version>)([^<]+)(<\/Version>)/,`$1${r}$3`);await H(e,n)}};function he(t){return/^\d+\.\d+\.\d+/.test(t)}o(he,"isSemver");function W(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return t;let[,r,s,n,a]=e;if(a){let i=a.split("."),l=i.length-1;return/^\d+$/.test(i[l])?(i[l]=String(Number(i[l])+1),`${r}.${s}.${n}-${i.join(".")}`):`${r}.${s}.${n}-${a}.1`}return`${r}.${s}.${Number(n)+1}`}o(W,"bumpPatch");function xt(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${e[1]}.${Number(e[2])+1}.0`:t}o(xt,"bumpMinor");function Ct(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${Number(e[1])+1}.0.0`:t}o(Ct,"bumpMajor");function jt(t,e){return e==="major"?Ct(t):e==="minor"?xt(t):W(t)}o(jt,"bumpVersion");function Ye(t){let e=(t??"").toLowerCase().trim();return e?/^[a-z]+(\([^)]*\))?!:/.test(e)||e.includes("breaking change")?"major":/^(fix|chore|docs|refactor|perf|style|test|build|ci|revert)(\([^)]*\))?:/.test(e)?"patch":"minor":"patch"}o(Ye,"inferBumpLevel");function ze(t){let e=t.match(/\[package\]([\s\S]*?)(?=\n\[|\n*$)/);return e?e[1].match(/^\s*version\s*=\s*"([^"]+)"/m)?.[1]??null:null}o(ze,"parseTomlVersion");function Ke(t){let e=t.match(/\[project\]([\s\S]*?)(?=\n\[|\n*$)/);if(e){let s=e[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(s)return s[1]}let r=t.match(/\[tool\.poetry\]([\s\S]*?)(?=\n\[|\n*$)/);if(r){let s=r[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(s)return s[1]}return null}o(Ke,"parsePyprojectVersion");function Je(t){return t.match(/<Version>([^<]+)<\/Version>/)?.[1]?.trim()??null}o(Je,"parseCsprojVersion");Ae();wt();se();Ae();function Xe(t,e,r){try{let s=I();return _.run(t,`INSERT INTO workflow_runs
|
|
49
|
+
(id, project_id, command, work_cycle_id, status, iteration, max_iterations, started_at)
|
|
50
|
+
VALUES (?, ?, ?, ?, 'running', 0, NULL, ?)`,s,t,e,r??null,Date.now()),s}catch{return null}}o(Xe,"startWorkflowRun");function we(t,e,r,s,n){if(e)try{_.run(t,`INSERT INTO gate_evaluation (id, run_id, rule_id, passed, reason, evaluated_at)
|
|
51
|
+
VALUES (?, ?, ?, ?, ?, ?)`,I(),e,String(r),s?1:0,n??null,Date.now())}catch{}}o(we,"recordGateEvaluation");function ye(t,e,r,s,n,a){if(e)try{_.run(t,`INSERT INTO workflow_run_step (id, run_id, rule_id, seq, status, attempt, output, ended_at)
|
|
52
|
+
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,I(),e,String(r),s,n,a??null,Date.now())}catch{}}o(ye,"recordRunStep");function le(t,e,r){if(e)try{_.run(t,"UPDATE workflow_runs SET status = ?, ended_at = ? WHERE id = ?",r,Date.now(),e)}catch{}}o(le,"finishWorkflowRun");function Pt(t){let e=t.split(/\s+/).map(s=>s.trim()).filter(Boolean),r=[];for(let s of e){let n=s.match(/^tags:([a-zA-Z0-9_\-.]+)([=~])(.+)$/);if(n){r.push({kind:"tags",key:n[1],op:n[2],value:n[3]});continue}let a=s.match(/^branch([=~])(.+)$/);if(a){r.push({kind:"branch",op:a[1],value:a[2]});continue}let i=s.match(/^files:(.+)$/);i&&r.push({kind:"files",op:"~",value:i[1]})}return r}o(Pt,"parseWhen");var Qe=new Map;function Et(t){let e=Qe.get(t);if(e)return e;let r=o(a=>{if(a>=t.length)return"";let i=t[a];return i==="*"?t[a+1]==="*"?`.*${r(a+2)}`:`[^/]*${r(a+1)}`:`${/[.+^${}()|[\]\\]/.test(i)?`\\${i}`:i}${r(a+1)}`},"translate"),s=r(0),n=new RegExp(`^${s}$`);return Qe.set(t,n),n}o(Et,"globToRegex");function Rt(t,e){if(t.kind==="tags"){let r=e.tags[t.key??""]??"";return t.op==="="?r===t.value:r.toLowerCase().includes(t.value.toLowerCase())}if(t.kind==="branch")return t.op==="="?e.branch===t.value:e.branch.toLowerCase().includes(t.value.toLowerCase());if(t.kind==="files"){let r=Et(t.value);return e.filesChanged.some(s=>r.test(s))}return!0}o(Rt,"matchCondition");function Ze(t,e){if(!t||!t.trim())return!0;let r=Pt(t);return r.length===0?!0:r.every(s=>Rt(s,e))}o(Ze,"evaluateWhen");var tt="status:",st="script:",nt="mcp:",At="persona:context",rt="version:bump",qt="changelog:add",ve="git:commit",Ot="git:push",Ht="pr:ensure",at="verify:";async function Mt(t,e,r){let s=await w.getCurrentTask(t);if(!s)throw new Error(`Cannot transition to '${r}': no active work cycle`);await D.log(e,L,{taskId:s.id,from:s.type??null,to:r,source:"workflow"})}o(Mt,"runStatusTransition");async function Ft(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-EX65SUYR.mjs"),s=r(t.trustSource,t.description||t.action);if(!s.allow)throw new Error(s.denyMessage);await ue(t.action,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}o(Ft,"runShellAction");async function _t(t){let{test:e}=await Ne(t);return e?.command??null}o(_t,"detectVerifyCommand");async function It(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-EX65SUYR.mjs"),s=r(t.trustSource,t.description||t.action);if(!s.allow)throw new Error(s.denyMessage);let n=t.action.slice(at.length).trim();if(!n)throw new Error(`Empty command in verify action '${t.action}'`);let a=n==="auto"?await _t(e).then(i=>{if(!i)throw new Error("verify:auto found no test script (package.json `scripts.test`). Specify an explicit check, e.g. `verify:bun test` or `verify:npm run typecheck`.");return i}):n;try{await ue(a,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}catch(i){throw new Error(`Verification failed: \`${a}\`
|
|
53
|
+
${R(i)}
|
|
54
|
+
Stop-the-line: do not proceed. Fix the failure and re-run this check \u2014 unverified output must not advance.`)}}o(It,"runVerifyAction");async function Lt(t,e,r){let{evaluateWorkflowRuleExecutable:s}=await import("./trust-boundary-EX65SUYR.mjs"),n=s(t.trustSource,t.description||t.action);if(!n.allow)throw new Error(n.denyMessage);let a=t.action.slice(st.length).trim();if(!a)throw new Error(`Empty script path in action '${t.action}'`);if(G.isAbsolute(a)||a.includes("\0"))throw new Error(`Script path escapes workflows dir: ${a}`);let i=G.resolve(e,".prjct/workflows"),l=G.resolve(i,a),c=G.relative(i,l);if(c.startsWith("..")||G.isAbsolute(c))throw new Error(`Script path escapes workflows dir: ${a}`);let p=await et.realpath(l).catch(()=>{throw new Error(`Script not found: .prjct/workflows/${a}`)}),d=await et.realpath(i).catch(()=>i),g=G.relative(d,p);if(g.startsWith("..")||G.isAbsolute(g))throw new Error(`Script path escapes workflows dir: ${a}`);await S("bash",[p],{timeout:t.timeoutMs,cwd:e,env:{...process.env,PRJCT_BRANCH:r.branch,PRJCT_FILES_CHANGED:r.filesChanged.join(","),PRJCT_TAGS:Object.entries(r.tags).map(([y,x])=>`${y}=${x}`).join(",")}})}o(Lt,"runScriptAction");function Dt(t){let e=t.action.slice(nt.length).trim(),r=e.indexOf(":");if(r===-1)return`Call MCP tool ${JSON.stringify(e)} (server unspecified \u2014 re-author rule with format \`mcp:<server>:<tool>[:<args>]\`).`;let s=e.slice(0,r),n=e.slice(r+1),a=n.indexOf(":"),i=a===-1?n:n.slice(0,a),l=a===-1?"":n.slice(a+1),c=t.description?` (${t.description})`:"";return l?`Call MCP \`${s}.${i}\` with args ${l}${c}.`:`Call MCP \`${s}.${i}\`${c}.`}o(Dt,"buildMcpInstruction");async function Nt(t){try{let{default:e}=await import("./config-manager-2VZPHUDG.mjs"),s=(await e.readConfig(t))?.persona;if(!s)return"No persona declared for this project \u2014 `.prjct/prjct.config.json` has no `persona` field.";let n=[`You are **${s.role}** in this project.`];return s.focus&&n.push(`Focus: ${s.focus}.`),s.mcps&&s.mcps.length>0&&n.push(`MCPs available: ${s.mcps.join(", ")}.`),s.packs&&s.packs.length>0&&n.push(`Active packs: ${s.packs.join(", ")}.`),n.join(" ")}catch(e){return`Could not resolve persona: ${R(e)}`}}o(Nt,"buildPersonaInstruction");async function Wt(t,e){let r=new ce(t),s=Ye(typeof e.feature=="string"?e.feature:void 0),n=await r.bump(s);e.version=n}o(Wt,"runVersionBump");async function Gt(t,e){let r=typeof e.version=="string"?e.version:null,s=typeof e.feature=="string"?e.feature:null;if(!r)throw new Error("changelog:add requires a prior version:bump step (no version in runContext)");if(!s)throw new Error("changelog:add requires a feature name in runContext (set by ship before rules run)");await new oe(t).addFeature(r,s)}o(Gt,"runChangelogAdd");function it(t,e){return t.replace(/\$([A-Z_]+)/g,(r,s)=>{let n=s.toLowerCase(),a=e[n];return typeof a=="string"?a:""})}o(it,"expandTemplate");async function Bt(t,e,r){let n=t.slice(ve.length).replace(/^:/,"").trim()||(r.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE"),a=`${it(n,r)}
|
|
55
|
+
|
|
56
|
+
Generated with [p/](https://www.prjct.app/)`;await S("git",["add","."],{cwd:e}),await S("git",["commit","-m",a],{cwd:e})}o(Bt,"runGitCommit");function Vt(t,e){let r=t.trim(),s=e.trim(),n=s.includes("/")?s.slice(s.indexOf("/")+1):"";return!!r&&n===r?["push"]:["push","-u","origin","HEAD"]}o(Vt,"decideGitPushArgs");async function Ut(t){let e=await S("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(n=>n.stdout.trim()).catch(()=>""),r=await S("git",["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{cwd:t}).then(n=>n.stdout.trim()).catch(()=>""),s=Vt(e,r);try{await S("git",s,{cwd:t,timeout:3e4})}catch(n){let a=R(n);throw new Error(`git push failed: ${a}`)}}o(Ut,"runGitPush");async function zt(t,e,r){try{let s=await S("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(c=>c.stdout.trim());if(!s||s==="main"||s==="master")return;if(!await S("gh",["--version"],{cwd:t}).then(()=>!0).catch(()=>!1)){r.instructions.push("# prjct: pr:ensure skipped \u2014 `gh` CLI not found. Install it or open the PR manually.");return}let a=await S("gh",["pr","list","--head",s,"--json","number","--jq","length"],{cwd:t}).then(c=>Number(c.stdout.trim())).catch(()=>-1);if(a<0){r.instructions.push("# prjct: pr:ensure could not check for an existing PR (gh not authenticated?) \u2014 skipped.");return}if(a>0)return;let i=it(e.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE",e),l=await S("gh",["pr","create","--fill",...i?["--title",i]:[]],{cwd:t,timeout:3e4}).then(c=>c.stdout.trim());r.instructions.push(`# prjct: opened PR \u2014 ${l}`)}catch(s){r.instructions.push(`# prjct: pr:ensure failed (non-blocking) \u2014 ${R(s)}`)}}o(zt,"runPrEnsure");async function ke(t,e,r,s,n,a){let i=t.action;if(i.startsWith(tt)){let l=i.slice(tt.length).trim();if(!l)throw new Error(`Empty status target in action '${i}'`);await Mt(e,r,l);return}if(i.startsWith(st)){await Lt(t,r,s);return}if(i.startsWith(nt)){n.instructions.push(Dt(t));return}if(i===At){n.instructions.push(await Nt(r));return}if(i===rt||i.startsWith(`${rt}:`)){await Wt(r,a);return}if(i===qt){await Gt(r,a);return}if(i===ve||i.startsWith(`${ve}:`)){await Bt(i,r,a);return}if(i===Ot){await Ut(r);return}if(i===Ht){await zt(r,a,n);return}if(i.startsWith(at)){await It(t,r);return}await Ft(t,r)}o(ke,"runRuleAction");async function Kt(t,e){let[r,s,n]=await Promise.all([Jt(e),Yt(e),Xt(t)]);return{branch:r,filesChanged:s,tags:n}}o(Kt,"buildWhenContext");async function Jt(t){try{return await ae(t)||""}catch{return""}}o(Jt,"resolveBranch");async function Yt(t){let e={cwd:t,encoding:"utf-8"},r=o(async a=>{try{return $t(a,e).split(`
|
|
57
|
+
`).map(i=>i.trim()).filter(Boolean)}catch{return[]}},"runDiff"),[s,n]=await Promise.all([r("git diff --cached --name-only"),r("git diff --name-only")]);return[...new Set([...s,...n])]}o(Yt,"resolveChangedFiles");async function Xt(t){try{let e=await w.getCurrentTask(t),r={};if(e?.type&&(r.type=e.type),!e)return r;let s=_.get(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 1",qe);if(s)try{let n=JSON.parse(s.data);if(n.taskId===e.id&&n.tags)return{...r,...n.tags}}catch{}return r}catch{return{}}}o(Xt,"resolveActiveTags");async function be(t,e,r,s={}){let n={success:!0,gatesFailed:[],hooksFailed:[],stepsRun:[],instructions:[],output:""};if(s.skipRules)return n;let a=s.runContext??{},l=De.getRulesForCommand(t,e).filter(u=>u.position===r),c=s.projectPath||process.cwd(),d=l.some(u=>u.whenExpr||u.type==="gate")?await Kt(t,c):{branch:"",filesChanged:[],tags:{}},g=l.filter(u=>Ze(u.whenExpr,d)),y=g.length>0?Xe(t,`${r}:${e}`):null,x=g.filter(u=>u.type==="gate");for(let u of x){let f=u.description||u.action;console.log(`
|
|
58
|
+
${T.dim(`[gate] ${r}-${e}: ${u.action}`)}`);try{let k=Date.now();await ke(u,t,c,d,n,a);let E=Date.now()-k,z=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`gate passed (${z})`)}`),we(t,y,u.id,!0)}catch(k){return console.log(`${T.red("\u2717")} gate failed: ${f}`),n.gatesFailed.push(f),n.success=!1,n.output+=`Gate failed: ${f}
|
|
59
|
+
${R(k)}
|
|
60
|
+
`,we(t,y,u.id,!1,R(k)),le(t,y,"blocked"),n}}let B=g.filter(u=>u.type==="instruction");for(let u of B){let f=u.description||u.action;console.log(`
|
|
61
|
+
${T.dim(`[instruction] ${r}-${e}: ${f}`)}`),n.instructions.push(u.action)}let V=g.filter(u=>u.type==="hook"),U=V.filter(u=>u.parallel===!1),C=V.filter(u=>u.parallel!==!1),Z=o(async u=>{console.log(`
|
|
62
|
+
${T.dim(`[hook] ${r}-${e}: ${u.action}`)}`);try{let f=Date.now();await ke(u,t,c,d,n,a);let k=Date.now()-f,E=k>1e3?`${(k/1e3).toFixed(1)}s`:`${k}ms`;console.log(`${T.green("\u2713")} ${T.dim(`(${E})`)}`)}catch(f){console.log(`${T.yellow("\u26A0")} hook failed (non-blocking): ${u.action}`),n.hooksFailed.push(u.description||u.action),n.output+=`Hook failed: ${u.action}
|
|
63
|
+
${R(f)}
|
|
64
|
+
`}},"runHook");for(let u of U)await Z(u);C.length>0&&await Promise.all(C.map(Z));let ee=g.filter(u=>u.type==="step");for(let[u,f]of ee.entries()){console.log(`
|
|
65
|
+
${T.dim(`[step] ${e}: ${f.action}`)}`);try{let k=Date.now();await ke(f,t,c,d,n,a);let E=Date.now()-k,z=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`step passed (${z})`)}`),n.stepsRun.push(f.description||f.action),ye(t,y,f.id,u,"ok")}catch(k){return console.log(`${T.red("\u2717")} step failed: ${f.action}`),n.gatesFailed.push(f.description||f.action),n.success=!1,n.output+=`Step failed: ${f.action}
|
|
66
|
+
${R(k)}
|
|
67
|
+
`,ye(t,y,f.id,u,"failed",R(k)),le(t,y,"failed"),n}}return le(t,y,"passed"),n}o(be,"executeWorkflowRules");pe();se();var Qt=["cli","command","install","setup","doctor","mcp","codex","claude","statusline","statusbar","output","help"],Zt=new Set(["the","and","for","with","that","this","task","implement","implementa","fix","bug","add","agrega","crear","hacer","esto","debe"]);function Q(t){let e=t.toLowerCase(),r=er(e),s=Qt.some(d=>e.includes(d)),n=A(e,["security","seguridad","auth","permission","secret","migration","sqlite","database","arquitectura","architecture","must","critical","critico","cr\xEDtico"]),a=tr(r,e,n),i=rr(a,n),l=sr(r,a,s),c=nr(a),p=ir(t);return{level:a,kind:r,risk:i,expectedEvidence:l,scopeHints:p,gates:c,rationale:ar(a,r,i),createdAt:ne()}}o(Q,"buildTaskHarness");async function Se(t,e){let r=e.harness;if(!r||r.level==="H0")return{changedFiles:[],observedEvidence:[],warnings:[],diffSize:0};let s=await Promise.all([Ce(t),pr(t)]).then(([p,d])=>({changedFiles:p,diffSize:d,gitUnavailable:null})).catch(p=>{if(p instanceof re)return{changedFiles:[],diffSize:0,gitUnavailable:p};throw p}),{changedFiles:n,diffSize:a,gitUnavailable:i}=s,l=or(n),c=[];return i?(c.push(`git ${i.kind}: change evidence unavailable \u2014 completion checks skipped, not failed.`),{changedFiles:n,observedEvidence:l,warnings:c,diffSize:a}):(r.expectedEvidence.includes("regression-test")&&!l.includes("tests-changed")&&c.push(`${r.level} expects a regression test; no test file changed in the diff.`),r.expectedEvidence.includes("docs-if-public-behavior")&&ur(n)&&!l.includes("docs-changed")&&c.push("Public-facing files changed; no README/docs/changelog file changed."),a>400&&c.push(`Diff is ${a} changed lines; consider splitting or justify the scope.`),{changedFiles:n,observedEvidence:l,warnings:c,diffSize:a})}o(Se,"evaluateHarnessCompletion");function er(t){if(A(t,["security","seguridad","auth","authent","authoriz","permission","secret"]))return"security";if(A(t,["bug","bugs","fix","fixes","fixed","fixing","falla","fallo","error","broken","regression","no se"]))return"bug";let e=A(t,["implement","implementa","refactor","restructure","cleanup","crear","agrega","construir","build"]);return A(t,["research","investiga","investigate","analiza","analyze","analysis","an\xE1lisis","compare","compara","survey","explore","explora","revisa","revisar","review","reviewing","repasa","repasar"])&&!e?"research":A(t,["refactor","cleanup","restructure"])||/(?:^|[^a-z0-9_-])split(?:[^a-z0-9_-]|$)/.test(t)?"refactor":A(t,["doc","docs","document","readme","changelog","typo"])?"docs":A(t,["chore","format","lint","linting","linter"])?"chore":A(t,["add","agrega","crear","implement","implementa","feature","mejora"])?"feature":"unknown"}o(er,"detectKind");function tr(t,e,r){return t==="docs"||t==="chore"?"H0":t==="security"?"H3":t==="research"?"H1":r&&A(e,["migration","sqlite","database","architecture","arquitectura"])?"H3":t==="feature"||t==="refactor"?"H2":"H1"}o(tr,"detectLevel");function rr(t,e){return t==="H3"||e?"high":t==="H2"||t==="H1"?"medium":"low"}o(rr,"detectRisk");function sr(t,e,r){let s=new Set;return t==="bug"&&(s.add("regression-test"),s.add("focused-tests"),s.add("edge-cases")),(t==="feature"||t==="refactor")&&(s.add("focused-tests"),s.add("scope-check")),r&&s.add("docs-if-public-behavior"),(e==="H2"||e==="H3")&&s.add("spec-or-design"),e==="H3"&&s.add("config-preservation"),[...s]}o(sr,"expectedEvidenceFor");function nr(t){return t==="H0"?[]:t==="H1"?["verify-before-done"]:t==="H2"?["verify-before-done","scope-check"]:["spec-before-implementation","verify-before-done","scope-check","review-before-ship"]}o(nr,"gatesFor");function ar(t,e,r){return t==="H0"?`Low-risk ${e}; keep the task direct and low-friction.`:`${t} ${e}/${r}; define expected evidence up front and verify before closure.`}o(ar,"rationaleFor");function ir(t){let e=t.toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").split(/[^a-z0-9_.-]+/u).filter(r=>r.length>=3&&!Zt.has(r));return[...new Set(e)].slice(0,8)}o(ir,"extractScopeHints");function A(t,e){return e.some(r=>{if(r.includes(" "))return t.includes(r);let s=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),n=r.length>=5?`\\b${s}`:`\\b${s}\\b`;return new RegExp(n).test(t)})}o(A,"hasAny");function or(t){let e=new Set;return t.some(cr)&&e.add("tests-changed"),t.some(lr)&&e.add("docs-changed"),[...e]}o(or,"observedEvidenceFromFiles");function cr(t){return/(^|\/)(__tests__|tests?|specs?)\//.test(t)||/\.(test|spec)\.[cm]?[tj]sx?$/.test(t)}o(cr,"isTestFile");function lr(t){return/(^|\/)(README|CHANGELOG|docs\/)/i.test(t)}o(lr,"isDocsFile");function ur(t){return t.some(e=>e.startsWith("core/commands/")||e.startsWith("core/mcp/")||e.startsWith("templates/")||e==="README.md")}o(ur,"touchesPublicSurface");async function pr(t){let e=await J(["diff","--shortstat","HEAD"],{cwd:t});if(!e.ok){if(e.kind==="exit")return 0;Y(e)}let r=Number.parseInt(e.stdout.match(/(\d+) insertions?/)?.[1]??"0",10),s=Number.parseInt(e.stdout.match(/(\d+) deletions?/)?.[1]??"0",10);return r+s}o(pr,"readDiffSize");var dr=[/\btypo\b/i,/\bdocs?\b/i,/\breadme\b/i,/\bformat\b/i,/\bchangelog\b/i,/\brerun\b.*\btests?\b/i,/\bre-?run\b.*\btests?\b/i],mr=[/\badd\b/i,/\bimplement\b/i,/\bcreate\b/i,/\bbuild\b/i,/\bfeature\b/i,/\bbilling\b/i,/\bauth\b/i,/\bsecurity\b/i,/\bmigration\b/i,/\bretry\b/i,/\bfailure\b/i,/\brecovery\b/i,/\baudit\b/i,/\bworkflow\b/i,/\borchestrat/i];function gr(t){let e=t.trim(),r=dr.some(n=>n.test(e)),s=mr.some(n=>n.test(e));return r&&!s?{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"trivial-keyword"}:s?{kind:"substantive",station:"spec_required",requiresSpec:!0,requiresTestsFirst:!0,reason:"substantive-keyword"}:{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"conservative-default"}}o(gr,"classifyTaskPipeline");function ot(t,e){let r=gr(t);return r.kind==="substantive"&&e?{...r,station:"test_red",reason:"linked-spec"}:r}o(ot,"decideTaskPipeline");function ct(t){switch(t.station){case"direct":return"Proceed directly; no spec is required for this trivial task.";case"spec_required":return"Create or link a reviewed spec before implementation; write tests before implementation from the spec acceptance criteria.";case"test_red":return"Write failing tests before implementation, covering the linked spec acceptance criteria and edge cases.";case"implementation":return"Implement the minimum code needed to make the existing tests pass.";case"verify":return"Run verification and keep the task blocked on red tests."}}o(ct,"formatTaskPipelineNextAction");var fr=["active","resume","in_progress","working"],lt=120;function Cs(t){let e=t.type==="decision"||t.type==="gotcha"||t.type==="fact"||t.type==="spec"?"SoT":t.type==="anti-pattern"||t.type==="pattern"||t.type==="learning"?"SUGGEST":"ctx",r=t.when?t.when.slice(0,10):"",s=t.author?` by ${t.author}`:"",n=[r,s].filter(Boolean).join(""),a=`[${e}\xB7${t.type}] ${t.title}${n?` (${n.trim()})`:""} \`${t.id}\``,i=t.decisionTrap??t.antiPattern??t.nextImplication??t.why??t.outcome??t.keyData??t.detail;if(!i)return e==="SoT"?`${a} \u2014 BINDING; supersede via prjct remember if wrong`:a;let l=i.length>lt?`${i.slice(0,lt-1)}\u2026`:i;if(e==="SoT")return`${a} \u2014 tip\u2192user \xB7 SoT: ${l}`;if(e==="SUGGEST"){let c=t.files&&t.files.length>0?` in \`${t.files.slice(0,2).join("`, `")}\``:"";return`${a} \u2014 tip\u2192user \xB7 suggest${c}: ${l}`}return`${a} \u2014 ${l}`}o(Cs,"formatRelatedContextForAgent");function js(t){return`[${t.label}] ${t.title} \u2014 \`${t.file}\` \`${t.id}\``}o(js,"formatRiskForAgent");async function Ps(t,e,r,s={}){let n=r.trim().toLowerCase();if(Ve.has(n))return{ok:!1,blocked:`'${n}' is a prjct command, not a work intent. Did you mean \`prjct ${n}\`? To start a work cycle, describe the task (e.g. \`prjct work "fix the ${n} flow"\`).`};let a=await be(t,"task","before",{projectPath:e,skipRules:s.skipHooks});if(!a.success)return{ok:!1,blocked:a.gatesFailed.length>0?`Blocked: ${a.gatesFailed.join(", ")}`:`Hook failed: ${a.hooksFailed.join(", ")}`};let i=await me.readConfig(e).catch(()=>null);try{let{ensureCodingAnticipationDefaults:h}=await import("./pack-manager-WWGQNJDQ.mjs"),m=await h(e);m.healed&&m.reason==="activated-code"?console.log("\u2139 Anticipation ON: activated pack `code` (conflictMode advisory) \u2014 traps surface before edit"):m.healed&&m.reason==="conflictMode-healed"&&console.log("\u2139 Anticipation ON: conflictMode \u2192 advisory for pack code")}catch{}{let{effectiveSddMode:h}=await import("./sdd-5UCVX43H.mjs"),{discussLockVerdict:m}=await import("./discuss-lock-55GER2LR.mjs"),j=Q(r),b=s.spec?await import("./spec-service-LAO5Z2M5.mjs").then(({specService:v})=>v.get(e,s.spec)).then(v=>v?.status??null).catch(()=>null):null;if(s.spec&&b===null){let{specService:v}=await import("./spec-service-LAO5Z2M5.mjs");if(await v.get(e,s.spec).then(F=>!F).catch(()=>!1))return{ok:!1,blocked:`Spec ${s.spec} not found.`}}let q=m({sddMode:h(i),harnessLevel:j.level,hasSpecId:!!s.spec,specStatus:b});if(q.blocked)return{ok:!1,blocked:q.message}}if(s.spec)try{let{effectiveSddMode:h}=await import("./sdd-5UCVX43H.mjs"),{effectiveTddMode:m}=await import("./tdd-7S55S5C3.mjs"),{effectiveNyquistWorkMode:j,nyquistWorkVerdict:b}=await import("./nyquist-lite-GE7OAFLC.mjs"),{specService:q}=await import("./spec-service-LAO5Z2M5.mjs"),v=Q(r),F=(await q.get(e,s.spec))?.content?.acceptance_criteria??[],P=b({harnessLevel:v.level,criteria:F,mode:j(h(i),m(i))});if(P.blocked)return{ok:!1,blocked:P.message??"Nyquist-lite blocked work start."};P.message&&console.log(P.message)}catch{}{let h=i?.deliveryGeometry?.mode??"off";try{let{existsSync:m}=await import("node:fs"),j=await import("node:path"),{computeWorkingTreeChangeset:b,geometryOf:q,tierOf:v,geometryBlockMessage:M,intentGeometryVerdict:F,NORMAL_MAX_LOC:P}=await import("./delivery-geometry-WYOEMKMO.mjs"),O=Q(r),K=m(j.join(e,".git"))?await b(e):null,ft=i?.deliveryGeometry?.locThreshold??P,xe=!!(K&&K.loc>=ft);if(h==="strict"&&xe&&K&&!s.geometry){let ht=q(v(K));return{ok:!1,blocked:M(K,ht)}}let te=F({harnessLevel:O.level,harnessRisk:O.risk,mode:h,explicitGeometry:s.geometry??null,treeLarge:xe});if(te.blocked)return{ok:!1,blocked:te.message??"Delivery geometry required at intent."};te.message&&console.log(te.message)}catch(m){if(m instanceof re&&h==="strict")return{ok:!1,blocked:`Delivery geometry gate unevaluable: ${m.message}. Re-run when git is healthy, or pass \`--geometry\` explicitly.`}}}let l=/^[A-Z]+-\d+$/.test(r)?r:void 0,c=I(),p=s.spec,d=Q(r),g=await(async()=>{try{let h=await me.readConfig(e).catch(()=>null),[{effectiveSddMode:m},{effectiveTddMode:j}]=await Promise.all([import("./sdd-5UCVX43H.mjs"),import("./tdd-7S55S5C3.mjs")]),{effectiveWeakModelMode:b}=await import("./weak-model-mode-FLCEQ2BV.mjs");return fe(d,m(h),j(h),b(h),`${r}::${c}`)}catch{return fe(d,"off","off","off",`${r}::${c}`)}})(),{resolveCallerIdentity:y}=await import("./agent-identity-45BYQBU2.mjs"),x=y(r),B=await(async()=>{let h=i?.multiAgent?.autoWorktree??"auto";try{let{getOccupancy:m,shouldIsolate:j,worktreeSlugFromIntent:b}=await import("./workspace-occupancy-UUW4UGGB.mjs"),q=await m(t,e,x),v=j(q,h,r);if(v.block)return{blocked:v.reason};if(v.isolate&&q.isMain){let{worktreeService:M}=await import("./worktree-service-AS7JVBK5.mjs"),F=b(r),P=await M.create(e,F);await M.setup(P.path,await M.getMainWorktree(e));let O=v.occupant;return{effectivePath:P.path,isolation:{reason:v.reason,worktreePath:P.path,branch:P.branch,slug:P.slug,occupantSummary:O?`${[O.ownerAgent,O.ownerIdentity].filter(Boolean).join("/")||"other"} \xB7 ${O.taskId.slice(0,8)} \xB7 "${O.description.slice(0,60)}"`:"foreign cycle"}}}}catch(m){if(m instanceof Error&&m.message.includes("already active"))return{blocked:m.message}}return{effectivePath:e,isolation:void 0}})();if("blocked"in B)return{ok:!1,blocked:B.blocked};let{effectivePath:V,isolation:U}=B,C=await X(V);if(C.gitError)return{ok:!1,blocked:`git ${C.gitError}: workspace identity unknown \u2014 refusing to start work on the main fallback. Re-run when git is healthy.`};let Z=C.isMain?Ge:C.workspaceId,ee={id:c,description:r,sessionId:I(),linearId:l,linkedSpecId:p,harness:d,ownerAgent:x.agent,ownerIdentity:x.identity,ownerSessionId:x.sessionId,yieldStatus:"active"};C.isMain?await w.startTask(t,ee):await w.startTaskInWorkspace(t,{...ee,branch:C.branch??U?.branch,workspaceId:C.workspaceId,worktreePath:C.worktreePath},C.workspaceId);try{let{ensureJudgmentLedger:h,intensityFromQuality:m}=await import("./judgment-orchestrator-BYPG65RS.mjs");g.quality!=="none"&&await h({projectId:t,projectPath:e,signals:{harnessLevel:d.level,harnessKind:d.kind},forceIntensity:m(g.quality)})}catch{}try{let{prjctDb:h}=await import("./database-XYKQF3KR.mjs");h.run(t,"UPDATE tasks SET expected_value = ? WHERE id = ?",String(g.expectedPoints),c);let{workGraph:m}=await import("./work-graph-JQHVVXIZ.mjs");m.recordComplexity(t,c,{score:g.expectedPoints,recommendedSubtasks:g.expectedPoints>=5?Math.min(g.expectedPoints,6):0,reasoning:`Triage: ${d.level} \xB7 ${g.model}/${g.effort} \xB7 fan-out ${g.fanout}`})}catch{}let u=ot(r,p),f=We(t,{taskId:c,workspaceId:Z,classification:u.kind,station:u.station,requiresSpec:u.requiresSpec,requiresTestsFirst:u.requiresTestsFirst,reason:u.reason,linkedSpecId:p??null});if(p)try{let{specService:h}=await import("./spec-service-LAO5Z2M5.mjs");await h.linkTask(e,p,c)}catch{}let k=await Be.ensureAuthor();await D.log(e,"task_started",{task:r,taskId:c,harness:d,timestamp:ne()},k.name),await be(t,"task","after",{projectPath:e,skipRules:s.skipHooks});let E=U?.branch??await ae(V).catch(()=>""),z=await yr(e,t,r),Te=await wr(e,t,r),mt=hr(t,Te),gt=await(async()=>{try{let{buildCycleBudgetCard:h}=await import("./cycle-budget-card-O5WAGNGC.mjs"),{contextPressureVerdict:m}=await import("./context-pressure-OUN5PFMN.mjs"),j=m(i,{turnCount:0,tokensIn:0,tokensOut:0}),b=h({turns:0,turnLimit:i?.maxTurnsPerCycle??j.limit,tokensSpent:0,tokenBudget:i?.maxTokensPerCycle??null,pressureLevel:j.level});return console.log(b.line),b.line}catch{return null}})();return{ok:!0,taskId:c,description:r,branch:E,linearId:l,linkedSpecId:p,harness:d,orchestration:g,ownerAgent:x.agent,ownerIdentity:x.identity,isolation:U,pipeline:{classification:f.classification,station:f.station,nextAction:ct(u),requiresSpec:f.requiresSpec,requiresTestsFirst:f.requiresTestsFirst},instructions:a.instructions,relatedContext:z,likelyFiles:Te,risks:mt,cycleBudget:gt}}o(Ps,"startTask");function hr(t,e){let r=new Set,s=[];try{for(let n of e.slice(0,5)){let a=Le.recallForFile(t,n.path,2,{preventiveOnly:!0});for(let i of a)if(!r.has(i.id)&&(r.add(i.id),s.push({id:i.id,label:He(i),title:Fe(i),file:n.path}),s.length>=4))return s}}catch{}return s}o(hr,"recallRisksForFiles");async function wr(t,e,r){try{let{resolveWorkScope:s,toLikelyFileHits:n}=await import("./work-scope-CDLSZ4U5.mjs"),a=await s(t,e,r,8);return a.files.length>0?n(a.files):ge(e,r)}catch{try{return ge(e,r)}catch{return[]}}}o(wr,"recallLikelyFiles");async function yr(t,e,r){try{let{enrichedRecall:s}=await import("./enriched-recall-X6RDNNIE.mjs"),{deriveTitle:n}=await import("./format-ALUX4QSI.mjs"),a=await s(t,e,{topic:r,types:["decision","gotcha","fact","spec","anti-pattern","pattern","learning","context"],limit:8});if(a.length===0)return[];let{recordSurfacedForActiveTask:i}=await import("./surface-attribution-K37N2NK7.mjs");return await i(e,t,a.map(l=>l.id)),a.map(l=>{let c=Ie(l.content),p=c.relatedFiles??l.tags?.related_files?.split(",").filter(Boolean)??l.tags?.files?.split(",").filter(Boolean);return{id:l.id,type:l.type,title:n(l),detail:c.contextSynthesis??Me(l.content,180),when:l.rememberedAt,author:c.whoAuthor??l.tags?.author,keyData:c.keyData??l.tags?.key_data,feature:c.featureDomain??l.tags?.feature,files:p,why:c.whyItMattered,pattern:c.pattern,antiPattern:c.antiPattern,decisionTrap:c.decisionTrap,outcome:c.outcome,nextImplication:c.nextImplication}})}catch{return[]}}o(yr,"recallRelatedContext");var ut=_e();async function Es(t,e,r){let s=r.toLowerCase(),n=fr.includes(s),a=await X(e);if(a.gitError)return{ok:!1,reason:"unsupported",message:`git ${a.gitError}: workspace identity unknown \u2014 refusing to change task status on the main fallback. Re-run when git is healthy.`};if(!a.isMain){let p=await w.getCurrentTaskForWorkspace(t,a.workspaceId);if(!p)return{ok:!1,reason:"no-active-task"};if(s==="done"||s==="completed"){let d=await dt(t,p.id),g=await Se(e,p);await D.log(e,L,{taskId:p.id,from:d??null,to:r,workspaceId:a.workspaceId,harnessWarnings:g.warnings}),await w.completeTaskInWorkspace(t,a.workspaceId),await pt(t,p.id,g.diffSize);try{let{usefulnessService:y}=await import("./usefulness-SCH5ARGV.mjs");y.creditShippedTask(t,p.id)}catch{}try{let{applyRetentionIncremental:y}=await import("./retention-LWETHQX3.mjs");y(t)}catch{}return{ok:!0,taskId:p.id,status:r,verificationWarnings:g.warnings,contextPrompt:ut}}return{ok:!1,reason:"unsupported",message:`'${r}' isn't supported for a worktree task yet \u2014 only 'done'. (pause/resume per-worktree is a planned follow-up)`}}if(n&&!await w.getCurrentTask(t)){let d=await w.resumeTask(t);if(d)return await D.log(e,L,{taskId:d.id,from:"paused",to:r}),{ok:!0,taskId:d.id,status:r}}let i=await w.getCurrentTask(t);if(!i)return{ok:!1,reason:"no-active-task"};let l=await dt(t,i.id),c=s==="done"||s==="completed"?await Se(e,i):{warnings:[],diffSize:0};await D.log(e,L,{taskId:i.id,from:l??null,to:r,harnessWarnings:c.warnings});try{if(s==="done"||s==="completed"){await w.completeTask(t),await pt(t,i.id,c.diffSize);try{let{usefulnessService:p}=await import("./usefulness-SCH5ARGV.mjs");p.creditShippedTask(t,i.id)}catch{}try{let{applyRetentionIncremental:p}=await import("./retention-LWETHQX3.mjs");p(t)}catch{}}else s==="paused"||s==="pause"?await w.pauseTask(t):n&&(await w.getCurrentTask(t)||await w.resumeTask(t))}catch{}return{ok:!0,taskId:i.id,status:r,verificationWarnings:c.warnings,contextPrompt:s==="done"||s==="completed"?ut:void 0}}o(Es,"setTaskStatus");async function Rs(t,e){let r=await X(e);return r.gitError?null:r.isMain?w.getCurrentTask(t):w.getCurrentTaskForWorkspace(t,r.workspaceId)}o(Rs,"resolveActiveTask");async function pt(t,e,r){try{let{prjctDb:s}=await import("./database-XYKQF3KR.mjs"),{pointsFromDiffLines:n}=await import("./task-orchestration-2ZYE5M6J.mjs"),a=s.get(t,"SELECT expected_value FROM tasks WHERE id = ?",e),i=Number(a?.expected_value);if(!Number.isFinite(i)||i<=0)return;s.run(t,`UPDATE tasks SET data = json_set(COALESCE(data, '{}'),
|
|
68
|
+
'$.expectedPoints', ?, '$.actualPoints', ?, '$.diffLines', ?)
|
|
69
|
+
WHERE id = ?`,i,n(r),r,e)}catch{}}o(pt,"recordEstimationOutcome");async function $s(t,e,r){let s=await X(e);return s.gitError?null:s.isMain?w.completeTask(t,r):w.completeTaskInWorkspace(t,s.workspaceId,r)}o($s,"completeActiveTask");async function dt(t,e){try{let{default:r}=await import("./database-XYKQF3KR.mjs"),s=r.query(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 10",`memory.${L}`);for(let n of s)try{let a=JSON.parse(n.data);if(a.taskId===e&&a.to)return a.to}catch{}}catch{}return null}o(dt,"readLastStatus");export{be as a,Cs as b,js as c,Ps as d,hr as e,ut as f,Es as g,Rs as h,$s as i,dt as j};
|