prjct-cli 3.93.0 → 3.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-UGHAG2SK.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-JIITQ6GY.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-CXWTU3RF.mjs +8 -0
- package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
- package/dist/bin/hook-chunks/capture-gate-PS6QUXLX.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-22AXWLI6.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-3WQBTXUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-4HAKTI36.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-4NTVXJD7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-5H3KJWQS.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-5XA5RL5I.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-6GAFRIUQ.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-76GDLA3Z.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-ABJNOG2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-BDOAQVIF.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BOBFTVAY.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-BU22R6JX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BX7VKYA7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-C4O243NG.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +36 -0
- package/dist/bin/hook-chunks/chunk-DCSKTMDX.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-DVDZA63F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-EWOK4VE7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-FW4MEPTB.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +69 -0
- package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-GCDLPKOH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-GDECEHO5.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-GDESYWTD.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HEDZA6KC.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-I26F7TLM.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IGHY4FGS.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-IWJG7CZX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-J5UQVJUW.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-KHLYWNHT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-KSSRINDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-MHNWIB7B.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-N3L77UNM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-NLKPAJND.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OGIFB3OE.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-OUAVSD47.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PGWFGRX4.mjs +47 -0
- package/dist/bin/hook-chunks/chunk-PO3QDKTE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-PP6DANGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-PTA7DMLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-QBYHZX33.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QL3NYJTW.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-QP5USCDX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-RHKF7EJW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-ROA2AJXY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-RTEEXGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-S5ISOGDB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-S5N2ZZDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-S6L3FECF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-T6ELTQZM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-TXSLON7M.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-U4OON3S7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-UHVYBU7F.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UYQC63MC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-V2FR2NPL.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-WGWE3CSC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-X5W2UYQK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-XXRAQZNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-YDBZO6I3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-Z6KVLCMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-ZFLIVOFX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/chunk-ZOX6OV6X.mjs +12 -0
- package/dist/bin/hook-chunks/client-CRXA774S.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-GTSLO7CD.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-UHSXC3UG.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
- package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-GDJ3QICX.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-FD47DPA3.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-ZUC7OEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-WNSTHDAA.mjs +12 -0
- package/dist/bin/hook-chunks/distill-GOGPFQFK.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-2CACBNS4.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-QF22RIK7.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-J3X3R225.mjs +8 -0
- package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-7A2DXVJA.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-SZWJH6XP.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-JLYUBKHR.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-JXYO62UE.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-CIYDXN2G.mjs +8 -0
- package/dist/bin/hook-chunks/notification-UA7RTVHG.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
- package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-375HH6TB.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-M3RAOZVB.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QRDYPZLZ.mjs +8 -0
- package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-bash-TWWFVNQ7.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-PTFF7JIN.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-325ALZKD.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-GOHVFAFH.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-MYNM5KI4.mjs +8 -0
- package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-RPGATIYJ.mjs +8 -0
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-XKHUAB4H.mjs +8 -0
- package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-6PF7MBAY.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-UEXQDGZE.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
- package/dist/bin/hook-chunks/setup-ZOHG6MGF.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-QVGTOO6U.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-FGDQVYHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-LAXGVLMY.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-XU35ZYNA.mjs +8 -0
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-OUG4PR7S.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-DMPBNBX7.mjs +8 -0
- package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-PIRHMHXL.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-QZL4OSM7.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SKXILJLJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SZLG6LVC.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-5J6BAMCW.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-ZRNKFTFF.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-PGYHFLEL.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/hook-fast-darwin-arm64 +0 -0
- package/dist/bin/hook-fast-darwin-x64 +0 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +737 -736
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/bin/prjct.mjs +1 -1
- package/dist/daemon/entry.mjs +651 -647
- package/dist/mcp/server.mjs +310 -312
- package/package.json +1 -1
- package/dist/bin/hook-chunks/auto-flush-5D4PKOMM.mjs +0 -8
- package/dist/bin/hook-chunks/capture-gate-EOOSAGAP.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A7SGMNOK.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-BNWB77U5.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-DLHSCKBJ.mjs +0 -15
- package/dist/bin/hook-chunks/chunk-DV7KV2O4.mjs +0 -38
- package/dist/bin/hook-chunks/chunk-EHP4DYVQ.mjs +0 -71
- package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-JRKGG2E3.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
- package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-MHRMV4WI.mjs +0 -31
- package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
- package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
- package/dist/bin/hook-chunks/chunk-OB5GRS7T.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-UB53HQMG.mjs +0 -14
- package/dist/bin/hook-chunks/chunk-UBMIPWJR.mjs +0 -19
- package/dist/bin/hook-chunks/chunk-VPPHD762.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-VV7VNUTF.mjs +0 -16
- package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
- package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
- package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
- package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
- package/dist/bin/hook-chunks/cwd-changed-FYNPPO73.mjs +0 -8
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
- package/dist/bin/hook-chunks/distill-W7QGQUDX.mjs +0 -8
- package/dist/bin/hook-chunks/enriched-recall-W7KYRYVR.mjs +0 -8
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
- package/dist/bin/hook-chunks/format-BOWFDUBP.mjs +0 -8
- package/dist/bin/hook-chunks/judgment-receipt-WGTFKID7.mjs +0 -8
- package/dist/bin/hook-chunks/land-cue-WLGSULSO.mjs +0 -9
- package/dist/bin/hook-chunks/land-synthesis-V7UH5QV6.mjs +0 -8
- package/dist/bin/hook-chunks/legacy-crew-sweep-MFE4BDNR.mjs +0 -24
- package/dist/bin/hook-chunks/memory-index-B53F5HAX.mjs +0 -10
- package/dist/bin/hook-chunks/notification-HJLS4L7Y.mjs +0 -8
- package/dist/bin/hook-chunks/post-edit-TT3XOG55.mjs +0 -8
- package/dist/bin/hook-chunks/pre-bash-2KKF4V6G.mjs +0 -11
- package/dist/bin/hook-chunks/pre-commit-UU4SKKWV.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-RTBLZPWH.mjs +0 -11
- package/dist/bin/hook-chunks/pre-package-LQTINBT4.mjs +0 -8
- package/dist/bin/hook-chunks/pre-search-UJU3XZ2K.mjs +0 -9
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
- package/dist/bin/hook-chunks/project-memory-YHQBRX3D.mjs +0 -8
- package/dist/bin/hook-chunks/project-style-evolution-HS6HYI7W.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-AYY7BZFG.mjs +0 -22
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
- package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
- package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as ge}from"./chunk-L4376X2P.mjs";import{a as Le}from"./chunk-Q5I2UPD6.mjs";import{a as De}from"./chunk-PSSR7LSW.mjs";import{c as Ge}from"./chunk-PWMMLXZS.mjs";import{a as Ne,c as We,d as X}from"./chunk-CREPUNOS.mjs";import{c as fe}from"./chunk-D7TRY3CO.mjs";import{a as ae}from"./chunk-ODWWIFSN.mjs";import{a as Fe,b as _e}from"./chunk-SJ75V4WG.mjs";import{b as Oe,c as He,d as Me}from"./chunk-BNWB77U5.mjs";import{a as Ie}from"./chunk-3WY2AYPE.mjs";import{a as W}from"./chunk-QK2IMCDC.mjs";import{c as Ae,f as N,h as qe}from"./chunk-UUULLTQV.mjs";import{b as w}from"./chunk-BISPGBNN.mjs";import{a as D}from"./chunk-3LG3ACQV.mjs";import{b as me}from"./chunk-JRKGG2E3.mjs";import{e as L,g as Re}from"./chunk-HDHVBB6Q.mjs";import{a as Ce,b as ne,e as pe}from"./chunk-AKIN5WSQ.mjs";import{f as de,g as je,h as R,i as H,j as Pe,m as Ee,n as $e}from"./chunk-SVZHJZ5T.mjs";import{a as ue,b as S,e as _,i as re,l as I,o as se}from"./chunk-CTWZQ7YI.mjs";import{e as $,f as ht}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"}))],wt={"-h":"help","--help":"help","-v":"version","--version":"version"},yt=new Set([...ie.filter(t=>t.routingMode==="bin-only").map(t=>t.name),...Object.entries(wt).filter(([,t])=>ie.some(e=>e.name===t&&e.routingMode==="bin-only")).map(([t])=>t)]);var Be=new Set(ie.filter(t=>t.routing).map(t=>t.name));qe();pe();se();qe();import{execSync as $t}from"node:child_process";import Ze from"node:fs/promises";import V from"node:path";import T from"chalk";pe();$e();import Ve from"node:path";var bt=["CHANGELOG.md","HISTORY.md","NEWS.md","CHANGES.md"],St=`# 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 bt){let n=Ve.join(this.projectPath,s);if(await Pe(n)){let a=await R(n),i=this.detectFormat(a);return{filePath:n,fileName:s,format:i,created:!1}}}let e="CHANGELOG.md",r=Ve.join(this.projectPath,e);return await H(r,`${St}
|
|
15
|
-
`),{filePath:r,fileName:e,format:"keepachangelog",created:!0}}async addEntry(e){let r=await this.detect(),s=await R(r.filePath);if(this.hasVersionEntry(s,e.version,r.format))return;let n=e.date||Ce(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}`];if(s.push(""),e.sections)for(let[n,a]of Object.entries(e.sections)){s.push(`### ${n}`);for(let i of a)s.push(`- ${i}`);s.push("")}else e.description&&(s.push("### Added"),s.push(`- ${e.description}`),s.push(""));return s.join(`
|
|
44
|
-
`)}formatMarkdownEntry(e,r){let s=[`## ${e.version} - ${r}`];if(s.push(""),e.sections)for(let[n,a]of Object.entries(e.sections)){s.push(`### ${n}`);for(let i of a)s.push(`- ${i}`);s.push("")}else e.description&&(s.push(`- ${e.description}`),s.push(""));return s.join(`
|
|
45
|
-
`)}};se();$e();import G 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=Ct(r.current,e);return await this.writeVersion({...r,next:s}),s}async readVersionFromGitHead(e,r){let s=G.relative(this.projectPath,e),n=await _(["show",`HEAD:${s}`],{cwd:this.projectPath});if(!n.ok){if(n.kind==="exit")return null;I(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"?Ue(a)??ze(a):r==="xml"?Ke(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=G.join(this.projectPath,"package.json"),r=await de(e,null);return r?.version?{current:r.version,next:B(r.version),file:e,format:"json"}:null}async fromCargoToml(){let e=G.join(this.projectPath,"Cargo.toml"),r=await R(e,"");if(!r)return null;let s=Ue(r);return s?{current:s,next:B(s),file:e,format:"toml"}:null}async fromPyprojectToml(){let e=G.join(this.projectPath,"pyproject.toml"),r=await R(e,"");if(!r)return null;let s=ze(r);return s?{current:s,next:B(s),file:e,format:"toml"}:null}async fromCsproj(){let e=await Ee(this.projectPath,{extension:".csproj"});if(e.length===0)return null;let r=G.join(this.projectPath,e[0]),s=await R(r,"");if(!s)return null;let n=Ke(s);return n?{current:n,next:B(n),file:r,format:"xml"}:null}async fromVersionFile(e){let r=G.join(this.projectPath,e),s=await R(r,"");if(!s)return null;let n=s.trim();return he(n)?{current:n,next:B(n),file:r,format:"plaintext"}:null}async fromGitTag(){let e=await _(["tag","--sort=-v:refname"],{cwd:this.projectPath});if(!e.ok){if(e.kind==="exit")return null;I(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:B(n),file:null,format:"git-tag"}}return null}async createFallbackVersion(){let e=G.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 je(e,s))}async writeTomlVersion(e,r){let s=await R(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 R(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 B(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(B,"bumpPatch");function Tt(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${e[1]}.${Number(e[2])+1}.0`:t}o(Tt,"bumpMinor");function xt(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${Number(e[1])+1}.0.0`:t}o(xt,"bumpMajor");function Ct(t,e){return e==="major"?xt(t):e==="minor"?Tt(t):B(t)}o(Ct,"bumpVersion");function Je(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(Je,"inferBumpLevel");function Ue(t){let e=t.match(/\[package\]([\s\S]*?)(?=\n\[|\n*$)/);return e?e[1].match(/^\s*version\s*=\s*"([^"]+)"/m)?.[1]??null:null}o(Ue,"parseTomlVersion");function ze(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(ze,"parsePyprojectVersion");function Ke(t){return t.match(/<Version>([^<]+)<\/Version>/)?.[1]?.trim()??null}o(Ke,"parseCsprojVersion");Re();ht();se();Re();function Ye(t,e,r){try{let s=D();return L.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(Ye,"startWorkflowRun");function we(t,e,r,s,n){if(e)try{L.run(t,`INSERT INTO gate_evaluation (id, run_id, rule_id, passed, reason, evaluated_at)
|
|
51
|
-
VALUES (?, ?, ?, ?, ?, ?)`,D(),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{L.run(t,`INSERT INTO workflow_run_step (id, run_id, rule_id, seq, status, attempt, output, ended_at)
|
|
52
|
-
VALUES (?, ?, ?, ?, ?, 1, ?, ?)`,D(),e,String(r),s,n,a??null,Date.now())}catch{}}o(ye,"recordRunStep");function le(t,e,r){if(e)try{L.run(t,"UPDATE workflow_runs SET status = ?, ended_at = ? WHERE id = ?",r,Date.now(),e)}catch{}}o(le,"finishWorkflowRun");function jt(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(jt,"parseWhen");var Xe=new Map;function Pt(t){let e=Xe.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 Xe.set(t,n),n}o(Pt,"globToRegex");function Et(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=Pt(t.value);return e.filesChanged.some(s=>r.test(s))}return!0}o(Et,"matchCondition");function Qe(t,e){if(!t||!t.trim())return!0;let r=jt(t);return r.length===0?!0:r.every(s=>Et(s,e))}o(Qe,"evaluateWhen");var et="status:",rt="script:",st="mcp:",Rt="persona:context",tt="version:bump",At="changelog:add",ve="git:commit",qt="git:push",Ot="pr:ensure",nt="verify:";async function Ht(t,e,r){let s=await w.getCurrentTask(t);if(!s)throw new Error(`Cannot transition to '${r}': no active work cycle`);await W.log(e,N,{taskId:s.id,from:s.type??null,to:r,source:"workflow"})}o(Ht,"runStatusTransition");async function Mt(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-ERMDF2C5.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(Mt,"runShellAction");async function Ft(t){let{test:e}=await De(t);return e?.command??null}o(Ft,"detectVerifyCommand");async function _t(t,e){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-ERMDF2C5.mjs"),s=r(t.trustSource,t.description||t.action);if(!s.allow)throw new Error(s.denyMessage);let n=t.action.slice(nt.length).trim();if(!n)throw new Error(`Empty command in verify action '${t.action}'`);let a=n==="auto"?await Ft(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
|
-
${$(i)}
|
|
54
|
-
Stop-the-line: do not proceed. Fix the failure and re-run this check \u2014 unverified output must not advance.`)}}o(_t,"runVerifyAction");async function It(t,e,r){let{evaluateWorkflowRuleExecutable:s}=await import("./trust-boundary-ERMDF2C5.mjs"),n=s(t.trustSource,t.description||t.action);if(!n.allow)throw new Error(n.denyMessage);let a=t.action.slice(rt.length).trim();if(!a)throw new Error(`Empty script path in action '${t.action}'`);if(V.isAbsolute(a)||a.includes("\0"))throw new Error(`Script path escapes workflows dir: ${a}`);let i=V.resolve(e,".prjct/workflows"),l=V.resolve(i,a),c=V.relative(i,l);if(c.startsWith("..")||V.isAbsolute(c))throw new Error(`Script path escapes workflows dir: ${a}`);let p=await Ze.realpath(l).catch(()=>{throw new Error(`Script not found: .prjct/workflows/${a}`)}),d=await Ze.realpath(i).catch(()=>i),g=V.relative(d,p);if(g.startsWith("..")||V.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(It,"runScriptAction");function Lt(t){let e=t.action.slice(st.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(Lt,"buildMcpInstruction");async function Dt(t){try{let{default:e}=await import("./config-manager-4VWDBPMG.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: ${$(e)}`}}o(Dt,"buildPersonaInstruction");async function Nt(t,e){let r=new ce(t),s=Je(typeof e.feature=="string"?e.feature:void 0),n=await r.bump(s);e.version=n}o(Nt,"runVersionBump");async function Wt(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(Wt,"runChangelogAdd");function at(t,e){return t.replace(/\$([A-Z_]+)/g,(r,s)=>{let n=s.toLowerCase(),a=e[n];return typeof a=="string"?a:""})}o(at,"expandTemplate");async function Gt(t,e,r){let n=t.slice(ve.length).replace(/^:/,"").trim()||(r.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE"),a=`${at(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(Gt,"runGitCommit");function Bt(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(Bt,"decideGitPushArgs");async function Vt(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=Bt(e,r);try{await S("git",s,{cwd:t,timeout:3e4})}catch(n){let a=$(n);throw new Error(`git push failed: ${a}`)}}o(Vt,"runGitPush");async function Ut(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=at(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 ${$(s)}`)}}o(Ut,"runPrEnsure");async function ke(t,e,r,s,n,a){let i=t.action;if(i.startsWith(et)){let l=i.slice(et.length).trim();if(!l)throw new Error(`Empty status target in action '${i}'`);await Ht(e,r,l);return}if(i.startsWith(rt)){await It(t,r,s);return}if(i.startsWith(st)){n.instructions.push(Lt(t));return}if(i===Rt){n.instructions.push(await Dt(r));return}if(i===tt||i.startsWith(`${tt}:`)){await Nt(r,a);return}if(i===At){await Wt(r,a);return}if(i===ve||i.startsWith(`${ve}:`)){await Gt(i,r,a);return}if(i===qt){await Vt(r);return}if(i===Ot){await Ut(r,a,n);return}if(i.startsWith(nt)){await _t(t,r);return}await Mt(t,r)}o(ke,"runRuleAction");async function zt(t,e){let[r,s,n]=await Promise.all([Kt(e),Jt(e),Yt(t)]);return{branch:r,filesChanged:s,tags:n}}o(zt,"buildWhenContext");async function Kt(t){try{return await ae(t)||""}catch{return""}}o(Kt,"resolveBranch");async function Jt(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(Jt,"resolveChangedFiles");async function Yt(t){try{let e=await w.getCurrentTask(t),r={};if(e?.type&&(r.type=e.type),!e)return r;let s=L.get(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 1",Ae);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(Yt,"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=Le.getRulesForCommand(t,e).filter(u=>u.position===r),c=s.projectPath||process.cwd(),d=l.some(u=>u.whenExpr||u.type==="gate")?await zt(t,c):{branch:"",filesChanged:[],tags:{}},g=l.filter(u=>Qe(u.whenExpr,d)),y=g.length>0?Ye(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,J=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`gate passed (${J})`)}`),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
|
-
${$(k)}
|
|
60
|
-
`,we(t,y,u.id,!1,$(k)),le(t,y,"blocked"),n}}let U=g.filter(u=>u.type==="instruction");for(let u of U){let f=u.description||u.action;console.log(`
|
|
61
|
-
${T.dim(`[instruction] ${r}-${e}: ${f}`)}`),n.instructions.push(u.action)}let z=g.filter(u=>u.type==="hook"),K=z.filter(u=>u.parallel===!1),C=z.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
|
-
${$(f)}
|
|
64
|
-
`}},"runHook");for(let u of K)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,J=E>1e3?`${(E/1e3).toFixed(1)}s`:`${E}ms`;console.log(`${T.green("\u2713")} ${T.dim(`step passed (${J})`)}`),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
|
-
${$(k)}
|
|
67
|
-
`,ye(t,y,f.id,u,"failed",$(k)),le(t,y,"failed"),n}}return le(t,y,"passed"),n}o(be,"executeWorkflowRules");pe();se();var Xt=["cli","command","install","setup","doctor","mcp","codex","claude","statusline","statusbar","output","help"],Qt=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=Zt(e),s=Xt.some(d=>e.includes(d)),n=A(e,["security","seguridad","auth","permission","secret","migration","sqlite","database","arquitectura","architecture","must","critical","critico","cr\xEDtico"]),a=er(r,e,n),i=tr(a,n),l=rr(r,a,s),c=sr(a),p=ar(t);return{level:a,kind:r,risk:i,expectedEvidence:l,scopeHints:p,gates:c,rationale:nr(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([ur(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=ir(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")&&lr(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 Zt(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(Zt,"detectKind");function er(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(er,"detectLevel");function tr(t,e){return t==="H3"||e?"high":t==="H2"||t==="H1"?"medium":"low"}o(tr,"detectRisk");function rr(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(rr,"expectedEvidenceFor");function sr(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(sr,"gatesFor");function nr(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(nr,"rationaleFor");function ar(t){let e=t.toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").split(/[^a-z0-9_.-]+/u).filter(r=>r.length>=3&&!Qt.has(r));return[...new Set(e)].slice(0,8)}o(ar,"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 ir(t){let e=new Set;return t.some(or)&&e.add("tests-changed"),t.some(cr)&&e.add("docs-changed"),[...e]}o(ir,"observedEvidenceFromFiles");function or(t){return/(^|\/)(__tests__|tests?|specs?)\//.test(t)||/\.(test|spec)\.[cm]?[tj]sx?$/.test(t)}o(or,"isTestFile");function cr(t){return/(^|\/)(README|CHANGELOG|docs\/)/i.test(t)}o(cr,"isDocsFile");function lr(t){return t.some(e=>e.startsWith("core/commands/")||e.startsWith("core/mcp/")||e.startsWith("templates/")||e==="README.md")}o(lr,"touchesPublicSurface");async function ur(t){let e=new Set,r=await _(["diff","--name-only","HEAD"],{cwd:t});if(r.ok)for(let n of r.stdout.split(`
|
|
68
|
-
`)){let a=n.trim();a&&e.add(a)}else r.kind!=="exit"&&I(r);let s=await _(["ls-files","--others","--exclude-standard"],{cwd:t});if(s.ok)for(let n of s.stdout.split(`
|
|
69
|
-
`)){let a=n.trim();a&&e.add(a)}else s.kind!=="exit"&&I(s);return[...e].sort()}o(ur,"readChangedFiles");async function pr(t){let e=await _(["diff","--shortstat","HEAD"],{cwd:t});if(!e.ok){if(e.kind==="exit")return 0;I(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 it(t,e){let r=gr(t);return r.kind==="substantive"&&e?{...r,station:"test_red",reason:"linked-spec"}:r}o(it,"decideTaskPipeline");function ot(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(ot,"formatTaskPipelineNextAction");var fr=["active","resume","in_progress","working"],ct=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>ct?`${i.slice(0,ct-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(Be.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-K3PQ7MCS.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-W3OUQPHD.mjs"),{discussLockVerdict:m}=await import("./discuss-lock-55GER2LR.mjs"),j=Q(r),b=s.spec?await import("./spec-service-TA4Q5S3X.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-TA4Q5S3X.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-W3OUQPHD.mjs"),{effectiveTddMode:m}=await import("./tdd-LV63NXZ3.mjs"),{effectiveNyquistWorkMode:j,nyquistWorkVerdict:b}=await import("./nyquist-lite-GE7OAFLC.mjs"),{specService:q}=await import("./spec-service-TA4Q5S3X.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-VHCURJ7E.mjs"),O=Q(r),Y=m(j.join(e,".git"))?await b(e):null,gt=i?.deliveryGeometry?.locThreshold??P,xe=!!(Y&&Y.loc>=gt);if(h==="strict"&&xe&&Y&&!s.geometry){let ft=q(v(Y));return{ok:!1,blocked:M(Y,ft)}}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=D(),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-W3OUQPHD.mjs"),import("./tdd-LV63NXZ3.mjs")]),{effectiveWeakModelMode:b}=await import("./weak-model-mode-VDYJ25PX.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),U=await(async()=>{let h=i?.multiAgent?.autoWorktree??"auto";try{let{getOccupancy:m,shouldIsolate:j,worktreeSlugFromIntent:b}=await import("./workspace-occupancy-UVIRHY5Z.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-XGRN5TTE.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 U)return{ok:!1,blocked:U.blocked};let{effectivePath:z,isolation:K}=U,C=await X(z);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?We:C.workspaceId,ee={id:c,description:r,sessionId:D(),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??K?.branch,workspaceId:C.workspaceId,worktreePath:C.worktreePath},C.workspaceId);try{let{ensureJudgmentLedger:h,intensityFromQuality:m}=await import("./judgment-orchestrator-UFGNBTEK.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-SLDTQXWG.mjs");h.run(t,"UPDATE tasks SET expected_value = ? WHERE id = ?",String(g.expectedPoints),c);let{workGraph:m}=await import("./work-graph-QJGNBVIP.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=it(r,p),f=Ne(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-TA4Q5S3X.mjs");await h.linkTask(e,p,c)}catch{}let k=await Ge.ensureAuthor();await W.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=K?.branch??await ae(z).catch(()=>""),J=await yr(e,t,r),Te=await wr(e,t,r),dt=hr(t,Te),mt=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:K,pipeline:{classification:f.classification,station:f.station,nextAction:ot(u),requiresSpec:f.requiresSpec,requiresTestsFirst:f.requiresTestsFirst},instructions:a.instructions,relatedContext:J,likelyFiles:Te,risks:dt,cycleBudget:mt}}o(Ps,"startTask");function hr(t,e){let r=new Set,s=[];try{for(let n of e.slice(0,5)){let a=Ie.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:Oe(i),title:Me(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-OKFSTW6D.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-W7KYRYVR.mjs"),{deriveTitle:n}=await import("./format-BOWFDUBP.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-HYCBHBTC.mjs");return await i(e,t,a.map(l=>l.id)),a.map(l=>{let c=_e(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??He(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 lt=Fe();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 pt(t,p.id),g=await Se(e,p);await W.log(e,N,{taskId:p.id,from:d??null,to:r,workspaceId:a.workspaceId,harnessWarnings:g.warnings}),await w.completeTaskInWorkspace(t,a.workspaceId),await ut(t,p.id,g.diffSize);try{let{usefulnessService:y}=await import("./usefulness-253CZLNY.mjs");y.creditShippedTask(t,p.id)}catch{}try{let{applyRetentionIncremental:y}=await import("./retention-22OSCAGV.mjs");y(t)}catch{}return{ok:!0,taskId:p.id,status:r,verificationWarnings:g.warnings,contextPrompt:lt}}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 W.log(e,N,{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 pt(t,i.id),c=s==="done"||s==="completed"?await Se(e,i):{warnings:[],diffSize:0};await W.log(e,N,{taskId:i.id,from:l??null,to:r,harnessWarnings:c.warnings});try{if(s==="done"||s==="completed"){await w.completeTask(t),await ut(t,i.id,c.diffSize);try{let{usefulnessService:p}=await import("./usefulness-253CZLNY.mjs");p.creditShippedTask(t,i.id)}catch{}try{let{applyRetentionIncremental:p}=await import("./retention-22OSCAGV.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"?lt:void 0}}o(Es,"setTaskStatus");async function $s(t,e){let r=await X(e);return r.gitError?null:r.isMain?w.getCurrentTask(t):w.getCurrentTaskForWorkspace(t,r.workspaceId)}o($s,"resolveActiveTask");async function ut(t,e,r){try{let{prjctDb:s}=await import("./database-SLDTQXWG.mjs"),{pointsFromDiffLines:n}=await import("./task-orchestration-MLOCR7GA.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, '{}'),
|
|
70
|
-
'$.expectedPoints', ?, '$.actualPoints', ?, '$.diffLines', ?)
|
|
71
|
-
WHERE id = ?`,i,n(r),r,e)}catch{}}o(ut,"recordEstimationOutcome");async function Rs(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(Rs,"completeActiveTask");async function pt(t,e){try{let{default:r}=await import("./database-SLDTQXWG.mjs"),s=r.query(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 10",`memory.${N}`);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(pt,"readLastStatus");export{be as a,Cs as b,js as c,Ps as d,hr as e,lt as f,Es as g,$s as h,Rs as i,pt as j};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as H}from"./chunk-AOPJ4Z6O.mjs";import{e as k,g as G}from"./chunk-HDHVBB6Q.mjs";import{a as c}from"./chunk-E66B27AL.mjs";G();var X="memory.task_tokens",_=1e7;function ae(e,n,t,r,s){if(!n||t+r<=0)return;let i=5e7;if(t>i||r>i)return;let a=t>_||r>_,u=Math.min(Math.round(t),_),d=Math.min(Math.round(r),_);a&&(s={...s,isEstimated:!0});try{k.appendEvent(e,X,{taskId:n,tokensIn:u,tokensOut:d,...s?.description?{description:s.description}:{},...s?.agent?{agent:s.agent}:{},...s?.model?{model:s.model}:{},...s?.runtime?{runtime:s.runtime}:{},...s?.isEstimated!==void 0?{isEstimated:s.isEstimated}:{},...s?.source?{source:s.source}:{}},n)}catch{}if(u>=0&&u<=_&&d>=0&&d<=_)try{k.run(e,"UPDATE tasks SET tokens_in = ?, tokens_out = ? WHERE id = ?",u,d,n)}catch{}try{let E=s?.source??"cli",T=`${n}:${E}`,S=Date.now();k.run(e,`INSERT INTO token_usage
|
|
9
|
-
(id, work_cycle_id, event_key, source, is_estimated, input_tokens, output_tokens, model_id, description, measured_at, created_at)
|
|
10
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
11
|
-
ON CONFLICT(event_key) DO UPDATE SET
|
|
12
|
-
input_tokens = excluded.input_tokens,
|
|
13
|
-
output_tokens = excluded.output_tokens,
|
|
14
|
-
is_estimated = excluded.is_estimated,
|
|
15
|
-
model_id = excluded.model_id,
|
|
16
|
-
description = COALESCE(excluded.description, token_usage.description),
|
|
17
|
-
measured_at = excluded.measured_at`,T,n,T,E,s?.isEstimated?1:0,u,d,s?.model??null,s?.description??null,S,S)}catch{}}c(ae,"recordTaskTokenUsage");function B(e,n){let t=Date.parse(n),r=y(e,`SELECT work_cycle_id, input_tokens, output_tokens, is_estimated, description
|
|
18
|
-
FROM token_usage
|
|
19
|
-
WHERE measured_at >= ?
|
|
20
|
-
ORDER BY measured_at DESC`,Number.isFinite(t)?t:0),s=new Map;for(let i of r){let a=i.work_cycle_id;if(!a||s.has(a))continue;let u=b(i.input_tokens)??0,d=b(i.output_tokens)??0;u+d<=0||s.set(a,{id:a,description:i.description??a,status:i.is_estimated?"estimated":"measured",tokensIn:u,tokensOut:d,tokensTotal:u+d,minutes:null})}return s}c(B,"measuredCyclesFromTokenUsage");function Z(e,n){let t=se(n),r=new Date().toISOString(),s=y(e,`SELECT id, description, status, started_at, completed_at, shipped_at, tokens_in, tokens_out
|
|
21
|
-
FROM tasks
|
|
22
|
-
WHERE COALESCE(completed_at, shipped_at, started_at) >= ?
|
|
23
|
-
ORDER BY COALESCE(completed_at, shipped_at, started_at) DESC`,t),i=new Map;for(let o of s.map(j))o&&i.set(o.id,o);for(let[o,m]of B(e,t)){let h=i.get(o);i.set(o,{...m,description:h?.description??m.description,minutes:h?.minutes??m.minutes})}let a=[...i.values()].sort((o,m)=>m.tokensTotal-o.tokensTotal),u=g(e,"memory.task_started",t),d=g(e,"memory.status.changed",t),R=g(e,"memory.feature_shipped",t),E=g(e,"sync",t),T=l(e,"SELECT COUNT(*) AS value FROM events WHERE type >= ? AND type < ? AND timestamp >= ?","memory.","memory/",t),S=g(e,"memory.post_edit",t),q=l(e,"SELECT COUNT(*) AS value FROM agent_sessions WHERE started_at >= ?",t),I=(()=>{try{return l(e,"SELECT COUNT(*) AS value FROM cli_sessions WHERE created_at >= ?",t)}catch{return 0}})(),A=q+I,w=l(e,"SELECT COUNT(DISTINCT memory_id) AS value FROM memory_surface_log WHERE created_at >= ?",t),K=l(e,`SELECT COUNT(DISTINCT s.memory_id) AS value
|
|
24
|
-
FROM memory_surface_log s
|
|
25
|
-
INNER JOIN memory_usefulness u ON u.memory_id = s.memory_id
|
|
26
|
-
WHERE s.created_at >= ?
|
|
27
|
-
AND u.score > 0`,t),Y=(()=>{try{return l(e,`SELECT COUNT(DISTINCT t.id) AS value
|
|
28
|
-
FROM tasks t
|
|
29
|
-
INNER JOIN agent_sessions a ON a.task_id = t.id
|
|
30
|
-
WHERE (t.completed_at IS NOT NULL OR t.shipped_at IS NOT NULL)
|
|
31
|
-
AND COALESCE(t.completed_at, t.shipped_at, t.started_at) >= ?`,t)}catch{return 0}})(),$=l(e,"SELECT COUNT(*) AS value FROM context_zone_events WHERE timestamp >= ?",t),z=l(e,"SELECT COUNT(*) AS value FROM context_compactions WHERE timestamp >= ?",t),D=P(e,"command_duration",t),x=P(e,"startup_time",t),N=ee(e,t),W=a.reduce((o,m)=>o+m.tokensIn,0),L=a.reduce((o,m)=>o+m.tokensOut,0),C=Math.max(s.length,u,R),f=s.filter(o=>o.completed_at||o.shipped_at),O=new Set(B(e,t).keys()),J=(()=>{try{return new Set(k.query(e,`SELECT DISTINCT task_id AS task_id FROM agent_sessions
|
|
32
|
-
WHERE task_id IS NOT NULL AND started_at >= ?`,t).map(o=>o.task_id).filter(Boolean))}catch{return new Set}})(),M=f.filter(o=>{let m=Number(o.tokens_in??0),h=Number(o.tokens_out??0);return m+h>0||O.has(o.id)}).length,U=f.filter(o=>Number(o.tokens_in??0)+Number(o.tokens_out??0)>0||O.has(o.id)||J.has(o.id)).length,v=U>0?U:f.length>0?f.length:s.length>0?s.length:C,F=Math.max(M,a.length),p=[];C===0?p.push("No work cycles were found in tasks or historical events for this window."):s.length===0&&p.push("Work history was rescued from events, but normalized task rows are missing."),v>0&&M===0&&F===0&&p.push("Work cycles exist, but none have exact token totals. Capture exact or estimated usage at task close."),A===0&&p.push("No agent sessions were recorded. Session-level model/runtime/cost cannot be attributed yet."),w===0&&p.push("No surfaced context was logged in this window, so reuse and re-exploration waste cannot be proven.");let V=(()=>{try{return k.query(e,`SELECT COALESCE(model_id, 'unknown') AS model,
|
|
33
|
-
SUM(input_tokens) AS t_in, SUM(output_tokens) AS t_out
|
|
34
|
-
FROM token_usage
|
|
35
|
-
WHERE model_id IS NOT NULL AND measured_at >= ?
|
|
36
|
-
GROUP BY COALESCE(model_id, 'unknown')
|
|
37
|
-
ORDER BY t_in + t_out DESC`,Date.parse(t)).map(o=>({model:o.model,tokensIn:o.t_in,tokensOut:o.t_out}))}catch{return[]}})();return{id:`work-cost-${n}d`,windowDays:n,generatedAt:r,workCycles:s.length>0?s.length:C,knownTokenCycles:F,tokensIn:W,tokensOut:L,tokensTotal:W+L,tokenCoveragePercent:v===0?0:Math.min(100,Math.round(Math.max(M,a.filter(o=>O.has(o.id)||o.tokensTotal>0).length)/v*100)),measuredSessions:Math.max(A,Y),surfacedContext:w,usefulContext:K,contextZoneEvents:$,compactions:z,commandSamples:D.samples,commandMs:Math.round(D.total??0),avgStartupMs:x.average===null?null:Math.round(x.average),mostExpensive:a.slice(0,8),byModel:V,historicalRescue:{inferredWorkCycles:C,taskTableCycles:s.length,eventWorkStarts:u,eventStatusChanges:d,eventShips:R,syncRuns:E,memoryEvents:T,postEditEvents:S,declaredTokenMentions:N.length,declaredTokensTotal:N.reduce((o,m)=>o+m.tokens,0),topDeclaredTokenMentions:N.slice(0,5)},gaps:p}}c(Z,"buildWorkCostSnapshot");async function ue(e,n=[7,30,90]){let t=n.map(r=>Z(e,r));for(let r of t)await H({projectId:e,entityType:"work_cost_snapshots",entityId:r.id,eventType:"upsert",data:Q(r)});return t}c(ue,"publishWorkCostSnapshots");function Q(e){return{...e,mostExpensive:e.mostExpensive.map(n=>({...n,description:"[redacted]"})),historicalRescue:{...e.historicalRescue,topDeclaredTokenMentions:e.historicalRescue.topDeclaredTokenMentions.map(n=>({tokens:n.tokens,sourceType:n.sourceType,occurredAt:n.occurredAt,summary:"[redacted]"}))}}}c(Q,"redactSnapshotForCloud");function j(e){let n=b(e.tokens_in)??0,t=b(e.tokens_out)??0,r=n+t;return r<=0?null:{id:e.id,description:e.description,status:e.status,tokensIn:n,tokensOut:t,tokensTotal:r,minutes:oe(e.started_at,e.completed_at??e.shipped_at)}}c(j,"toCostTask");function ee(e,n){let t=y(e,`SELECT type, data, timestamp
|
|
38
|
-
FROM events
|
|
39
|
-
WHERE timestamp >= ?
|
|
40
|
-
AND type >= ?
|
|
41
|
-
AND type < ?
|
|
42
|
-
AND json_valid(data)
|
|
43
|
-
AND json_extract(data, '$.content') LIKE '%token%'
|
|
44
|
-
ORDER BY timestamp DESC
|
|
45
|
-
LIMIT 200`,n,"memory.remember.","memory.remember/"),r=[];for(let s of t){let i=(()=>{try{let u=JSON.parse(s.data);return typeof u.content=="string"?u.content:""}catch{return""}})();if(!i)continue;let a=te(i);for(let u of a)r.push({tokens:u,sourceType:s.type,occurredAt:s.timestamp,summary:ne(i)})}return r.sort((s,i)=>i.tokens-s.tokens)}c(ee,"declaredTokenMentions");function te(e){let n=[],t=/\b(\d+(?:\.\d+)?)\s*([kKmM])?\s*(?:tokens?|tok)\b/g;for(let r of e.matchAll(t)){let s=Number.parseFloat(r[1]??"0"),i=r[2]?.toLowerCase();if(!Number.isFinite(s)||s<=0)continue;let a=i==="m"?1e6:i==="k"?1e3:1;n.push(Math.round(s*a))}return n}c(te,"extractTokenCounts");function ne(e){let n=e.replace(/\s+/g," ").trim();return n.length<=140?n:`${n.slice(0,137)}...`}c(ne,"summarize");function g(e,n,t){return l(e,"SELECT COUNT(*) AS value FROM events WHERE type = ? AND timestamp >= ?",n,t)}c(g,"eventCount");function P(e,n,t){return y(e,`SELECT COUNT(*) AS samples, COALESCE(SUM(value), 0) AS total, AVG(value) AS average
|
|
46
|
-
FROM perf_samples
|
|
47
|
-
WHERE metric = ? AND timestamp >= ?`,n,t)[0]??{samples:0,total:0,average:null}}c(P,"aggregatePerf");function l(e,n,...t){try{return Number(k.get(e,n,...t)?.value??0)}catch{return 0}}c(l,"count");function y(e,n,...t){try{return k.query(e,n,...t)}catch{return[]}}c(y,"query");function se(e){let n=new Date;return n.setDate(n.getDate()-e),n.toISOString()}c(se,"sinceIso");function b(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:null}c(b,"nullableNumber");function oe(e,n){if(!e||!n)return null;let t=Date.parse(e),r=Date.parse(n);return!Number.isFinite(t)||!Number.isFinite(r)||r<t?null:Math.round((r-t)/6e4)}c(oe,"durationMinutes");export{ae as a,ue as b};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as h}from"./chunk-AUUWQH3S.mjs";import{d as c,g as l}from"./chunk-HDHVBB6Q.mjs";import{b as a,e as f,g as d,h as g}from"./chunk-AKIN5WSQ.mjs";import{a as r}from"./chunk-E66B27AL.mjs";import m from"node:crypto";g();f();l();function v(s){let[e,t]=s.split(".");return e?{entityType:e.endsWith("s")?e:`${e}s`,eventType:t==="deleted"||t==="archived"||t==="removed"?"delete":"upsert"}:{}}r(v,"deriveEntityShape");function T(s){if(!s||typeof s!="object")return;let e=s;for(let t of["taskId","task_id","id","feature_id","featureId","specId","spec_id"]){let n=e[t];if(typeof n=="string"&&n.length>0)return n}}r(T,"entityIdOf");function w(s){let e=s&&typeof s=="object"&&!Array.isArray(s)?JSON.stringify(k(s)):JSON.stringify(s);return m.createHash("sha256").update(e).digest("hex")}r(w,"hashPayload");function k(s){let e={};for(let t of Object.keys(s).sort())e[t]=s[t];return e}r(k,"sortKeys");var u={value:null};async function b(){if(u.value)return u.value;try{let{default:s}=await import("./auth-config-WNUARXTJ.mjs"),e=s;if(typeof e.getDeviceId=="function"){let t=await e.getDeviceId();return u.value=t,t}return"unknown-device"}catch{return"unknown-device"}}r(b,"_resolveDeviceId");var y=class{static{r(this,"StorageManager")}filename;cache;constructor(e,t){this.filename=e,this.cache=new d({ttl:5e3,maxSize:50})}getStoreKey(){return this.filename.replace(".json","")}async read(e){if(!(process.env.PRJCT_IN_DAEMON==="1")){let n=this.cache.get(e);if(n!==null)return n}try{let n=c.getDoc(e,this.getStoreKey());if(n!==null)return this.cache.set(e,n),n}catch{}return this.getDefault()}async write(e,t){c.setDoc(e,this.getStoreKey(),t),this.cache.set(e,t)}async update(e,t){let n=this.getStoreKey(),i=c.updateDoc(e,n,t,()=>this.getDefault());return this.cache.set(e,i),i}async publishEvent(e,t,n){let i=v(t),o={type:t,path:[this.filename.replace(".json","")],data:n,timestamp:a(),projectId:e,entityType:i.entityType,entityId:T(n),eventType:i.eventType,contentHash:w(n),deviceId:await b(),revisionCount:1};await h.publish(o)}async publishEntityEvent(e,t,n,i){let o=`${t}.${n}`,p={...i,timestamp:a()};await this.publishEvent(e,o,p)}async exists(e){try{return c.hasDoc(e,this.getStoreKey())}catch{return!1}}clearCache(e){e?this.cache.delete(e):this.cache.clear()}getCacheStats(){return this.cache.stats()}};export{y as a};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as w,c as te,d as ne}from"./chunk-JQE2F2RK.mjs";import{a as D,b as ee}from"./chunk-WUHGODSQ.mjs";import{g as S,n as A}from"./chunk-SVZHJZ5T.mjs";import{b as R,o as Z}from"./chunk-CTWZQ7YI.mjs";import{a as O,e as h,f as N}from"./chunk-BUDZL4DW.mjs";import{a as i,b as k}from"./chunk-E66B27AL.mjs";ne();ee();N();import{constants as me}from"node:fs";import g from"node:fs/promises";import y from"node:os";import a from"node:path";te();import d from"node:fs/promises";import T from"node:path";N();A();import m from"node:fs";import re from"node:fs/promises";import M from"node:os";import u from"node:path";var _="mcp-remote@0.1.38";var E="prjct: agentic harness with project memory, workflow gates, intent briefs, and performance context. Use prjct_task_start as the MCP entrypoint for a work cycle; prjct retrieves focused context, persists evidence stations, and keeps humans in the loop for risky gates. Agents resume from prjct_task_status/workflow output, create or link reviewed intent/spec briefs when required, and persist synthesized learning instead of raw transcript fragments.";function se(){let e=oe();if(e)return e;if(process.env.PRJCT_MCP_ALLOW_LOCAL==="1"){let t=ie();if(t)return{command:t,args:["mcp-server"],description:E}}return{command:"npx",args:["-y","prjct-cli@latest","mcp-server"],description:E}}i(se,"getPrjctMcpConfig");function I(e){let t=e.replace(/\\/g,"/");return!!(t.includes("/.worktrees/")||t.includes("/prjct-cli/bin/prjct")&&!t.includes("/node_modules/prjct-cli/"))}i(I,"isNonProductionPrjctPath");function oe(){let e=[];try{e.push(u.dirname(k.resolve("prjct-cli/package.json")))}catch{}let t=M.homedir();for(let n of[process.env.NVM_BIN?u.resolve(process.env.NVM_BIN,".."):"",u.join(t,".nvm","versions","node",process.version,"lib"),"/opt/homebrew/lib","/usr/local/lib"].filter(Boolean))e.push(u.join(n,"node_modules","prjct-cli"));for(let n of e){if(I(n))continue;let r=u.join(n,"bin","prjct.cjs"),o=m.existsSync(u.join(n,"dist","bin","prjct.mjs"))||m.existsSync(u.join(n,"dist","bin","prjct-core.mjs"));if(!m.existsSync(r)||!o)continue;let c=[process.execPath,u.join(u.dirname(process.execPath),"node"),u.join(n,"..","..","bin","node")].find(P=>P&&m.existsSync(P)),p=u.resolve(n,"..","..","..","bin","node"),f=m.existsSync(p)?p:c??process.execPath;return{command:f,args:[r,"mcp-server"],env:{PATH:`${u.dirname(f)}${u.delimiter}/usr/bin${u.delimiter}/bin`},description:E}}return null}i(oe,"resolvePublishedPrjctMcpConfig");function ie(){let e=process.argv[1],t=[e?u.resolve(u.dirname(e),"prjct"):"",e?u.resolve(u.dirname(e),"..","bin","prjct"):"",u.resolve(process.cwd(),"bin","prjct")].filter(Boolean);for(let n of t){if(!m.existsSync(n))continue;let r=(()=>{try{return m.realpathSync(n)}catch{return n}})();if(!I(r))return r}return null}i(ie,"resolveLocalPrjctBin");var v={context7:{command:"npx",args:["-y","@upstash/context7-mcp@latest"],description:"Library documentation lookup"},prjct:se(),linear:{command:"npx",args:["-y",_,"https://mcp.linear.app/mcp"],description:"Linear MCP server (OAuth)"},jira:{command:"npx",args:["-y",_,"https://mcp.atlassian.com/v1/mcp"],description:"Atlassian MCP server for Jira (OAuth)"}};function j(){return process.env.PRJCT_TEST_MODE==="1"?u.join(M.tmpdir(),"prjct-context7-test","mcp.json"):u.join(M.homedir(),".claude","mcp.json")}i(j,"getClaudeMcpConfigPath");async function V(e=j()){try{let t=await re.readFile(e,"utf-8");return JSON.parse(t)}catch(t){let n=h(t).toLowerCase();if(n.includes("no such file")||n.includes("enoent"))return{};throw new Error(`Failed to read MCP config at ${e}: ${h(t)}`)}}i(V,"readMcpConfig");async function ce(e,t=j()){await S(t,e)}i(ce,"writeMcpConfig");async function Re(e,t,n=j()){let r=await V(n),o={...r.mcpServers||{}},s=o[e];o[e]=t,r.mcpServers=o;let c=JSON.stringify(s)!==JSON.stringify(t);return await ce(r,n),{path:n,changed:c}}i(Re,"upsertMcpServer");async function Oe(e,t=j()){return!!(await V(t)).mcpServers?.[e]}i(Oe,"hasMcpServer");var $="# prjct:mcp:start - managed by prjct, do not edit between markers",L="# prjct:mcp:end",F="# prjct:mcp:context7:start - managed by prjct, do not edit between markers",J="# prjct:mcp:context7:end",B=["model-with-reasoning","current-dir","git-branch","context-remaining","five-hour-limit","weekly-limit","task-progress"];function x(){return process.env.PRJCT_TEST_MODE==="1"?T.join(w(".prjct-tests"),"codex","config.toml"):w(".codex","config.toml")}i(x,"getCodexConfigTomlPath");function C(e){return`"${e.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}i(C,"tomlString");function X(e,t,n,r){let o=(t.args??[]).map(C).join(", "),s=[n,`[mcp_servers.${e}]`,`command = ${C(t.command)}`,`args = [${o}]`];if(t.env&&Object.keys(t.env).length>0){let c=Object.entries(t.env).map(([p,f])=>`${p} = ${C(f)}`).join(", ");s.push(`env = { ${c} }`)}return s.push(r,""),s.join(`
|
|
9
|
-
`)}i(X,"buildMcpTomlBlock");function ae(e=v.prjct){return X("prjct",e,$,L)}i(ae,"buildPrjctMcpTomlBlock");function ue(e=v.context7){return X("context7",e,F,J)}i(ue,"buildContext7McpTomlBlock");function H(e,t,n,r,o){let s=e.indexOf(n),c=e.indexOf(r);if(s!==-1&&c!==-1&&c>s){let p=e.slice(0,s),f=e.slice(c+r.length),P=f.startsWith(`
|
|
10
|
-
`)?f.slice(1):f;return{next:p+t+P}}return new RegExp(`^\\s*\\[mcp_servers\\.${o}\\]`,"m").test(e)?{next:e,skipped:"user-managed"}:e.trim().length>0?{next:`${e.trimEnd()}
|
|
11
|
-
|
|
12
|
-
${t}`}:{next:t}}i(H,"upsertMarkedBlock");function pe(){return["[tui]",`status_line = [${B.map(C).join(", ")}]`,""].join(`
|
|
13
|
-
`)}i(pe,"buildCodexStatusLineToml");function fe(e){return/^\s*(?:tui\.)?status_line\s*=/m.test(e)}i(fe,"hasCodexStatusLine");function le(e){if(fe(e))return{toml:e,changed:!1};let n=`status_line = [${B.map(C).join(", ")}]
|
|
14
|
-
`,r=/^\s*\[tui\]\s*$/m.exec(e);if(r){let s=r.index+r[0].length,c=e.slice(0,s),p=e.slice(s),f=p.startsWith(`
|
|
15
|
-
`)?p.slice(1):p;return{toml:`${c}
|
|
16
|
-
${n}${f}`,changed:!0}}let o=pe();return{toml:e.trim().length>0?`${e.trimEnd()}
|
|
17
|
-
|
|
18
|
-
${o}`:o,changed:!0}}i(le,"ensureCodexStatusLineToml");async function Le(e=x()){let t=await d.readFile(e,"utf-8").catch(()=>""),n=ae(),r=H(t,n,$,L,"prjct"),o=r.skipped,s=le(r.next),c=s.toml;return c===t?{path:e,changed:!1,skipped:o}:(await d.mkdir(T.dirname(e),{recursive:!0}),await d.writeFile(e,c,"utf-8"),{path:e,changed:!0,skipped:o,statusLineChanged:s.changed})}i(Le,"ensureCodexMcpServer");async function K(e=x()){let t=await d.readFile(e,"utf-8").catch(()=>""),n=ue(),{next:r,skipped:o}=H(t,n,F,J,"context7");return r===t?{path:e,changed:!1,skipped:o}:(await d.mkdir(T.dirname(e),{recursive:!0}),await d.writeFile(e,r,"utf-8"),{path:e,changed:!0,skipped:o})}i(K,"ensureCodexContext7Server");async function U(e=x()){try{let t=await d.readFile(e,"utf-8");return/^\s*\[mcp_servers\.context7\]/m.test(t)}catch{return!1}}i(U,"codexHasContext7Server");Z();A();function z(){return process.env.NODE_ENV==="test"?a.join(y.tmpdir(),"prjct-context7-test","verify-cache.json"):a.join(D(),"state","context7-verify.json")}i(z,"getVerifyCachePath");async function de(){try{let e=await g.readFile(z(),"utf-8"),t=JSON.parse(e);if(typeof t?.at=="number"&&t.status)return{...t,provider:t.provider??"claude"}}catch{}return null}i(de,"readPersistedVerify");async function ge(e,t,n){let r=z();try{await g.mkdir(a.dirname(r),{recursive:!0}),await g.writeFile(r,JSON.stringify({at:e,provider:t,status:n}),"utf-8")}catch{}}i(ge,"writePersistedVerify");var Q=v.context7,l={value:null},he=[a.dirname(process.execPath),"/opt/homebrew/bin","/usr/local/bin","/opt/local/bin","/usr/bin","/bin"],ve=[[".bun","bin"],[".local","bin"],[".volta","bin"],[".asdf","shims"],[".local","share","mise","shims"],[".rtx","shims"],[".npm-global","bin"]];async function W(e){try{return(await g.readdir(e,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>n.name)}catch{return[]}}i(W,"listChildDirs");async function Ce(e){let t=[],n=process.env.NVM_DIR||a.join(e,".nvm"),r=a.join(n,"versions","node");for(let c of await W(r))t.push(a.join(r,c,"bin"));let o=process.env.FNM_DIR||a.join(e,".local","share","fnm"),s=a.join(o,"node-versions");for(let c of await W(s))t.push(a.join(s,c,"installation","bin"));return t}i(Ce,"discoverNodeManagerBinDirs");async function xe(e=process.env.PATH||"",t=y.homedir()){let n=new Set,r=[],o=ve.map(c=>a.join(t,...c)),s=[...he,...o,...process.env.NVM_BIN?[process.env.NVM_BIN]:[],...process.env.VOLTA_HOME?[a.join(process.env.VOLTA_HOME,"bin")]:[],...process.env.ASDF_DIR?[a.join(process.env.ASDF_DIR,"shims")]:[],...process.env.MISE_DATA_DIR?[a.join(process.env.MISE_DATA_DIR,"shims")]:[],...await Ce(t)];for(let c of[...e.split(a.delimiter),...s]){let p=c.trim();!p||n.has(p)||(n.add(p),r.push(p))}return r.join(a.delimiter)}i(xe,"buildContext7SmokePath");async function Pe(e,t){if(a.isAbsolute(e)||e.includes(a.sep))return e;let n=process.platform==="win32"?(process.env.PATHEXT||".EXE;.CMD;.BAT;.COM").split(";").filter(Boolean):[""];for(let r of t.split(a.delimiter))if(r)for(let o of n){let s=a.join(r,e+o);try{return await g.access(s,me.X_OK),s}catch{}}return e}i(Pe,"resolveExecutable");function G(){return process.env.PRJCT_CONTEXT7_CONFIG?process.env.PRJCT_CONTEXT7_CONFIG:process.env.NODE_ENV==="test"?a.join(y.tmpdir(),"prjct-context7-test","mcp.json"):a.join(y.homedir(),".claude","mcp.json")}i(G,"getConfigPath");async function Y(e){try{let t=await g.readFile(e,"utf-8");return JSON.parse(t)}catch(t){if(O(t))return{};throw t}}i(Y,"readConfig");async function Se(){if(process.env.PRJCT_SKIP_CONTEXT7_SMOKE==="1"||process.env.NODE_ENV==="test")return;let e=Q,t=[...e.args||[],"--help"],n=await xe(),r=await Pe(e.command||"npx",n);await R(r,t,{timeout:15e3,env:{...process.env,PATH:n}})}i(Se,"runSmokeCheck");var b=class{static{i(this,"Context7Service")}async install(t="claude"){if(t==="codex")return this.installCodex();if(t!=="claude")return{installed:!1,verified:!1,configPath:"",message:`Context7 auto-config not supported for ${t}; skipping`};let n=G(),r=a.dirname(n);await g.mkdir(r,{recursive:!0});let o=await Y(n),s=o.mcpServers||{},c=Q,p=s.context7;return p&&JSON.stringify(p)===JSON.stringify(c)?{installed:!0,verified:!1,configPath:n,message:"Context7 MCP already configured"}:(s.context7=c,o.mcpServers=s,await S(n,o),l.value=null,{installed:!0,verified:!1,configPath:n,message:"Context7 MCP configured"})}async installCodex(){let t=await K();return t.changed&&(l.value=null),{installed:!0,verified:!1,configPath:t.path,message:t.skipped==="user-managed"?"Context7 MCP user-managed in config.toml":"Context7 MCP configured in config.toml"}}async resolveConfigured(t){if(t==="codex"){let c=x();return await U(c)?{ok:!0,configPath:c}:{ok:!1,configPath:c,message:"Context7 MCP not configured in ~/.codex/config.toml"}}if(t!=="claude")return{ok:!1,configPath:"",message:`Context7 not managed for ${t}`};let n=G(),s=((await Y(n)).mcpServers||{}).context7;return!s?.command||!Array.isArray(s.args)||s.args.length===0?{ok:!1,configPath:n,message:"Context7 MCP not configured in ~/.claude/mcp.json"}:{ok:!0,configPath:n}}async verify(t="claude"){let n=Date.now();if(l.value&&l.value.provider===t&&n-l.value.at<3e5)return l.value.status;let r=await de();if(r?.status.verified&&r.provider===t&&n-r.at<3e5)return l.value=r,r.status;let o=await this.resolveConfigured(t);if(!o.ok)return{installed:!1,verified:!1,configPath:o.configPath,message:o.message};try{await Se();let s={installed:!0,verified:!0,configPath:o.configPath};return l.value={at:n,provider:t,status:s},await ge(n,t,s),s}catch(s){let c={installed:!0,verified:!1,configPath:o.configPath,message:`Context7 smoke check failed: ${h(s)}`};return l.value={at:n,provider:t,status:c},c}}async ensureReady(t="claude"){await this.install(t);let n=await this.verify(t);if(!n.verified){let r=n.message||"Context7 MCP is required but not ready. Run `prjct start` to repair configuration.";throw new Error(r)}return n}},je=new b,Ze=je;export{v as a,j as b,Re as c,Oe as d,Le as e,K as f,z as g,xe as h,Ze as i};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as v}from"./chunk-MEQS4VPO.mjs";import{b as u,e as S,s,t as $}from"./chunk-AKIN5WSQ.mjs";import{g as C,n as j}from"./chunk-SVZHJZ5T.mjs";import{a as y,b as P,o as G}from"./chunk-CTWZQ7YI.mjs";import{b,e as E}from"./chunk-P5ZYAXSE.mjs";import{d as w}from"./chunk-PKDYFXMI.mjs";import{a as f,f as M}from"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";import h from"node:fs/promises";import W from"node:path";import*as d from"jsonc-parser";G();import k from"node:crypto";var D="6f9b2c1a-3d4e-5f60-8a7b-1c2d3e4f5a6b";function F(r,t=D){let n=Buffer.from(t.replace(/-/g,""),"hex"),i=k.createHash("sha1").update(n).update(r,"utf8").digest().subarray(0,16);i[6]=i[6]&15|80,i[8]=i[8]&63|128;let e=i.toString("hex");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}c(F,"uuidv5");async function N(r){let t=await P("git",["remote","get-url","origin"],{cwd:r}).then(({stdout:i})=>i.trim()||null).catch(()=>null);if(!t)return null;let{provider:n,repoSlug:o}=v(t);return!n||!o?null:`${n}:${o}`.toLowerCase()}c(N,"repoKey");async function x(r){let t=await N(r);return t?F(t):null}c(x,"deriveProjectId");M();S();j();E();G();async function m(r){try{let{stdout:t}=await y(r,{timeout:5e3});return{success:!0,output:t.trim()}}catch{return{success:!1,output:""}}}c(m,"execCommand");async function R(){let r=await m("gh api user --jq .login");if(r.success&&r.output)return r.output;let t=await m("git config --global github.user");return t.success&&t.output?t.output:null}c(R,"detectGitHubUsername");async function T(){let r=await m("git config user.name");return r.success&&r.output?r.output:null}c(T,"detectGitName");async function U(){let r=await m("git config user.email");return r.success&&r.output?r.output:null}c(U,"detectGitEmail");async function A(){let[r,t,n]=await Promise.all([R(),T(),U()]);return{github:r,email:n,name:t||r||"Unknown"}}c(A,"detect");$();function I(r){let t=[],n=d.parse(r,t,{allowTrailingComma:!0,disallowComments:!1});if(t.length>0){let o=t[0];throw new SyntaxError(`JSON parse error at offset ${o.offset}: ${d.printParseErrorCode(o.error)}`)}return n}c(I,"parseJsonc");var l=new Map,p=class{static{c(this,"ConfigManager")}async readConfig(t){let n=s.getLocalConfigPath(t),o=await h.stat(n).catch(()=>null);if(!o)return l.delete(n),null;let i=o.mtimeMs,e=l.get(n);if(e&&e.mtimeMs===i)return e.config;try{let a=await h.readFile(n,"utf-8"),g=I(a);return l.size>32&&l.clear(),l.set(n,{mtimeMs:i,config:g}),g}catch(a){return f(a)?(l.delete(n),null):(console.warn(`Warning: Could not read config at ${t}: ${w(a)}`),null)}}async writeConfig(t,n){let o=s.getLocalConfigPath(t);await C(o,n),l.delete(o)}async readGlobalConfig(t){try{let n=s.getGlobalProjectConfigPath(t),o=await h.readFile(n,"utf-8");return I(o)}catch(n){return f(n)||console.warn(`Warning: Could not read global config for ${t}: ${w(n)}`),null}}async writeGlobalConfig(t,n){let o=s.getGlobalProjectConfigPath(t);await C(o,n)}async ensureGlobalConfig(t){let n=await this.readGlobalConfig(t),o=n??(()=>{let i=u();return{projectId:t,authors:[],version:b,lastSync:i}})();return n||await this.writeGlobalConfig(t,o),o}async createConfig(t,n){let o=await x(t)??s.generateProjectId(t),i=s.getGlobalProjectPath(o),e=s.getDisplayPath(i),a=u(),g={projectId:o,dataPath:e,showMetrics:!0};await this.writeConfig(t,g);let L={projectId:o,authors:[{name:n.name||"Unknown",email:n.email||"",github:n.github||"",firstContribution:a,lastActivity:a}],version:b,created:a,lastSync:a};return await this.writeGlobalConfig(o,L),g}async updateLastSync(t){let n=await this.getProjectId(t),o=await this.readGlobalConfig(n);o&&(o.lastSync=u(),await this.writeGlobalConfig(n,o))}validateConfig(t){return!(!t||!t.projectId||!t.dataPath)}async needsMigration(t){if(!await s.hasLegacyStructure(t))return!1;if(!await s.hasConfig(t))return!0;let i=await this.readConfig(t);if(!i||!i.projectId)return!0;let e=s.getGlobalProjectPath(i.projectId);try{return(await h.readdir(W.join(e,"core"))).length===0}catch(a){return f(a),!0}}async getProjectId(t){let n=await this.readConfig(t);if(n?.projectId)return n.projectId;try{let{worktreeService:o}=await import("./worktree-service-XGRN5TTE.mjs");if(await o.detect(t)){let e=await o.getMainWorktree(t);if(e!==t){let a=await this.readConfig(e);if(a?.projectId)return a.projectId}}}catch{}return""}async findAuthor(t,n){let o=await this.readGlobalConfig(t);return!o||!o.authors?null:o.authors.find(i=>i.github===n)||null}async addAuthor(t,n){let o=await this.ensureGlobalConfig(t);if(o.authors.some(a=>a.github===n.github))return;let e=u();o.authors.push({name:n.name||"Unknown",email:n.email||"",github:n.github||"",firstContribution:e,lastActivity:e}),o.lastSync=e,await this.writeGlobalConfig(t,o)}async updateAuthorActivity(t,n){let o=await this.readGlobalConfig(t);if(!o||!o.authors)return;let i=o.authors.find(e=>e.github===n);i&&(i.lastActivity=u(),o.lastSync=i.lastActivity,await this.writeGlobalConfig(t,o))}async getCurrentAuthor(t){let n=await A(),o=await this.getProjectId(t);return await this.addAuthor(o,{name:n.name??void 0,email:n.email??void 0,github:n.github??void 0}),n.github||n.name||"Unknown"}async isConfigured(t){let n=await this.readConfig(t);return this.validateConfig(n)}async getShowMetrics(t){return(await this.readConfig(t))?.showMetrics??!0}async setShowMetrics(t,n){let o=await this.readConfig(t);o&&(o.showMetrics=n,await this.writeConfig(t,o))}async getConfigWithDefaults(t){let n=await this.readConfig(t);if(n)return n;let o=s.generateProjectId(t);return{projectId:o,dataPath:s.getDisplayPath(s.getGlobalProjectPath(o))}}},H=new p,et=H;export{A as a,et as b};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-GAOQHD5S.mjs";import{a as i}from"./chunk-E66B27AL.mjs";import{readSync as k}from"node:fs";import{isatty as y}from"node:tty";var O=new Set(["SessionStart","UserPromptSubmit","PreToolUse","PostToolUse"]);function c(e,t){return{hookSpecificOutput:{hookEventName:e,permissionDecision:"deny",permissionDecisionReason:m(t)}}}i(c,"buildDenyOutput");function S(){let e=(process.env.PRJCT_HOOK_HOST??"claude").toLowerCase();return e==="gemini"||e==="codex"||e==="cursor"?e:"claude"}i(S,"currentHookHost");function a(e,t=S()){return t==="claude"||t==="codex"||!e||Object.keys(e).length===0?e:t==="gemini"?w(e):t==="cursor"?b(e):e}i(a,"adaptHookOutputForHost");function w(e){let t=e;if(t.hookSpecificOutput?.permissionDecision==="deny")return{decision:"deny",reason:t.hookSpecificOutput.permissionDecisionReason??"blocked by prjct"};let o=e,n=o.hookSpecificOutput;return n?.additionalContext?{hookSpecificOutput:{hookEventName:x(n.hookEventName),additionalContext:n.additionalContext}}:o.systemMessage?{systemMessage:o.systemMessage}:e}i(w,"adaptForGemini");function b(e){let t=e;if(t.hookSpecificOutput?.permissionDecision==="deny")return{decision:"deny",reason:t.hookSpecificOutput.permissionDecisionReason??"blocked by prjct",permissionDecision:"deny",permissionDecisionReason:t.hookSpecificOutput.permissionDecisionReason??"blocked by prjct"};let o=e,n=o.hookSpecificOutput;return n?.additionalContext?{hookSpecificOutput:{hookEventName:D(n.hookEventName),additionalContext:n.additionalContext,additional_context:n.additionalContext},additional_context:n.additionalContext}:o.systemMessage?{systemMessage:o.systemMessage}:e}i(b,"adaptForCursor");function x(e){switch(e){case"UserPromptSubmit":return"BeforeAgent";case"PreToolUse":return"BeforeTool";case"PostToolUse":return"AfterTool";case"Stop":return"AfterAgent";default:return e}}i(x,"mapClaudeEventToGemini");function D(e){switch(e){case"SessionStart":return"sessionStart";case"UserPromptSubmit":return"beforeSubmitPrompt";case"PreToolUse":return"preToolUse";case"PostToolUse":return"postToolUse";case"Stop":return"stop";case"SubagentStart":return"subagentStart";case"SubagentStop":return"subagentStop";default:return e.charAt(0).toLowerCase()+e.slice(1)}}i(D,"mapClaudeEventToCursor");function p(){if(y(0))return{};try{process.stdin.fd}catch{}let e=Date.now()+200,t=new Int32Array(new SharedArrayBuffer(4)),o=Buffer.alloc(65536),n=[];for(;;)try{let r=k(0,o,0,o.length,null);if(r===0)break;n.push(Buffer.from(o.subarray(0,r)))}catch(r){if(r.code==="EAGAIN"&&Date.now()<e){Atomics.wait(t,0,0,1);continue}break}try{let r=Buffer.concat(n).toString("utf-8").trim();return r?JSON.parse(r):{}}catch{return{}}}i(p,"readStdinSafe");function u(e){let t=a(e);process.stdout.write(`${JSON.stringify(t)}
|
|
9
|
-
`)}i(u,"emit");function E(){u({})}i(E,"emitEmpty");async function l(e){try{await e()}catch{E()}}i(l,"safeRun");var v=new Set(["this","that","with","from","have","your","please","would","about","there","these","those","what","when","where","which","while","will","been","were","they","them","their","que","como","cuando","donde","porque","para","pero","por","con","sin","los","las","del","una","uno","unos","unas","este","esta","esto","estos","estas","eso","esos","esas","mas","muy","todo","toda","todos","todas","sobre","entre","hasta","desde","hace","hacer","tiene","tienen","debe","deben","puede","pueden","estan","ser","son","algo","ahora","aqui","bien","cada","dale"]);function P(e,t=8){let o=f(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")).toLowerCase(),n=new Set,r=[];for(let s of o.split(/[^\p{L}\p{N}]+/u))if(!(s.length<3)&&!v.has(s)&&!n.has(s)&&(n.add(s),r.push(s),r.length>=t))break;return r}i(P,"extractKeywords");function m(e){return e.replace(/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/g,"\uFFFD")}i(m,"stripLoneSurrogates");function C(e,t,o=`
|
|
10
|
-
\u2026 [truncated]`){if(e.length<=t)return e;let n=Math.max(0,t-o.length),r=e.charCodeAt(n-1),s=r>=55296&&r<=56319?n-1:n;return e.slice(0,Math.max(0,s))+o}i(C,"safeTruncate");function d(e,t){if(!t)return{};let o=m(t);return O.has(e)?{hookSpecificOutput:{hookEventName:e,additionalContext:o}}:{systemMessage:o}}i(d,"buildHookOutput");async function I(e,t){let o=e.projectPath??process.cwd();if(t){try{let n=t.input;if(t.afterEmitOnly){e.afterEmit&&t.detachAfterEmit(()=>e.afterEmit(n,o));return}let r=e.decide?await e.decide(n,o):null;if(r){let h=a(c(e.event,r.deny));t.sink(`${JSON.stringify(h)}
|
|
11
|
-
`);return}let s=e.build?await e.build(n,o):null,g=a(d(e.event,s));t.sink(`${JSON.stringify(g)}
|
|
12
|
-
`),e.afterEmit&&t.detachAfterEmit(()=>e.afterEmit(n,o))}catch{t.sink(`{}
|
|
13
|
-
`)}return}await l(async()=>{let n=p(),r=e.decide?await e.decide(n,o):null;if(r){u(c(e.event,r.deny));return}let s=e.build?await e.build(n,o):null;u(d(e.event,s)),e.afterEmit&&await e.afterEmit(n,o)})}i(I,"runHook");export{P as a,C as b,I as c};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as o,f as c}from"./chunk-HDSS6UB3.mjs";c();import{z as e}from"zod";var u=e.enum(["low","medium","high","critical"]),t=e.enum(["feature","bug","improvement","chore"]),l=e.enum(["active","backlog","previously_active"]),m=e.enum(["H0","H1","H2","H3"]),d=e.enum(["bug","feature","refactor","docs","chore","security","research","unknown"]),g=e.enum(["low","medium","high"]),k=e.enum(["regression-test","focused-tests","docs-if-public-behavior","config-preservation","spec-or-design","edge-cases","scope-check"]),y=e.enum(["verify-before-done","scope-check","review-before-ship","spec-before-implementation"]),b=e.enum(["pending","in_progress","completed","blocked","paused","failed","skipped"]),n=e.object({title:e.string(),description:e.string(),filesChanged:e.array(e.object({path:e.string(),action:e.enum(["created","modified","deleted"])})),whatWasDone:e.array(e.string()).min(1),outputForNextAgent:e.string().min(1),notes:e.string().optional()}),I=e.object({output:e.string().min(1,"Subtask output is required"),summary:n}),r=e.object({id:e.string(),description:e.string(),domain:e.string(),agent:e.string(),status:b,dependsOn:e.array(e.string()),startedAt:e.string().optional(),completedAt:e.string().optional(),output:e.string().optional(),summary:n.optional(),skipReason:e.string().optional(),blockReason:e.string().optional(),estimatedPoints:e.number().optional(),estimatedMinutes:e.number().optional()}),i=e.object({completed:e.number(),total:e.number(),percentage:e.number()}),a=e.object({level:m,kind:d,risk:g,expectedEvidence:e.array(k),scopeHints:e.array(e.string()),gates:e.array(y),rationale:e.string(),createdAt:e.string()}),p=e.object({id:e.string(),description:e.string(),type:t.optional(),startedAt:e.string(),sessionId:e.string(),featureId:e.string().optional(),subtasks:e.array(r).optional(),currentSubtaskIndex:e.number().optional(),subtaskProgress:i.optional(),linearId:e.string().optional(),linearUuid:e.string().optional(),linkedSpecId:e.string().optional(),estimatedPoints:e.number().optional(),estimatedMinutes:e.number().optional(),modelMetadata:o.optional(),tokensIn:e.number().optional(),tokensOut:e.number().optional(),parentDescription:e.string().optional(),branch:e.string().optional(),prUrl:e.string().optional(),harness:a.optional(),turnCount:e.number().optional(),turnLimitAcknowledgedAt:e.string().optional(),ownerAgent:e.string().optional(),ownerIdentity:e.string().optional(),ownerSessionId:e.string().optional(),yieldStatus:e.enum(["active","yielded"]).optional(),pendingHandoffId:e.string().optional()}),s=e.object({id:e.string(),description:e.string(),status:e.literal("paused"),startedAt:e.string(),pausedAt:e.string(),pauseReason:e.string().optional(),type:t.optional(),sessionId:e.string().optional(),featureId:e.string().optional(),subtasks:e.array(r).optional(),currentSubtaskIndex:e.number().optional(),subtaskProgress:i.optional(),linearId:e.string().optional(),linearUuid:e.string().optional(),estimatedPoints:e.number().optional(),estimatedMinutes:e.number().optional(),modelMetadata:o.optional(),tokensIn:e.number().optional(),tokensOut:e.number().optional(),harness:a.optional()}),S=e.object({stackConfirmed:e.array(e.string()).optional(),patternsDiscovered:e.array(e.string()).optional(),agentAccuracy:e.array(e.object({agent:e.string(),rating:e.enum(["helpful","neutral","inaccurate"]),note:e.string().optional()})).optional(),issuesEncountered:e.array(e.string()).optional()}),f=e.object({taskId:e.string(),title:e.string(),classification:t,startedAt:e.string(),completedAt:e.string(),subtaskCount:e.number(),subtaskSummaries:e.array(n),outcome:e.string(),branchName:e.string(),linearId:e.string().optional(),linearUuid:e.string().optional(),prUrl:e.string().optional(),feedback:S.optional(),harness:a.optional(),tokensIn:e.number().optional(),tokensOut:e.number().optional()}),h=p.extend({workspaceId:e.string(),worktreePath:e.string().optional(),agentSessionId:e.string().optional(),jiraId:e.string().optional(),jiraUuid:e.string().optional(),dispatchedFrom:e.string().optional()}),z=e.object({currentTask:p.nullable(),previousTask:s.nullable().optional(),pausedTasks:e.array(s).optional(),taskHistory:e.array(f).optional(),activeTasks:e.array(h).optional(),lastUpdated:e.string()}),x=e.object({id:e.string(),description:e.string(),body:e.string().optional(),priority:u,type:t,featureId:e.string().optional(),originFeature:e.string().optional(),completed:e.boolean(),completedAt:e.string().optional(),createdAt:e.string(),section:l,agent:e.string().optional(),groupName:e.string().optional(),groupId:e.string().optional()}),j=e.object({tasks:e.array(x),lastUpdated:e.string()});export{I as a,z as b,j as c};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as h}from"./chunk-3WY2AYPE.mjs";import{d as a,g as E}from"./chunk-HDHVBB6Q.mjs";import{a as c}from"./chunk-E66B27AL.mjs";E();var I="land-receipt",_="judgment-receipt",g="receipt-v1";function D(e){let r=e.trapsSurfaced??[],t=e.decisions??[],n=(e.journal??[]).filter(s=>s.trim()),o=(e.openRisksNext??[]).filter(s=>s.trim()),l=e.cycleDescription?.trim()||null,y=e.tokensIn!=null||e.tokensOut!=null||!!e.model;if(!l&&r.length===0&&t.length===0&&n.length===0&&o.length===0&&!y)return null;let i=["# Judgment Receipt",""],m=[];if(l&&m.push(`cycle: "${u(l,100)}"`),n.length>0&&m.push(`journal: ${n.slice(0,4).map(s=>u(s,70)).join(" \xB7 ")}`),m.length>0&&i.push("## Applied judgment",...m.map(s=>`- ${s}`),""),r.length>0&&i.push("## Traps re-surfaced",...r.slice(0,8).map(s=>`- **[${s.type}]** ${u(s.title,100)} \`${s.id}\``),""),t.length>0&&i.push("## Decisions contested or honored",...t.slice(0,8).map(s=>`- **${s.status}** [${s.type}] ${u(s.title,100)} \`${s.id}\``),""),o.length>0||l){let s=o.length>0?o.slice(0,5).map(d=>`- ${u(d,120)}`):["- Finish or pause open cycle; next agent: `prjct prime` / `prjct work --md`."];i.push("## Open risks / next",...s,"")}if(y){let s=[];if(e.tokensIn!=null||e.tokensOut!=null){let d=e.tokensIn??0,f=e.tokensOut??0;s.push(`tokens in=${d} out=${f} total=${d+f}`)}e.model&&s.push(`model=${e.model}`),e.author&&s.push(`author=${e.author}`),i.push("## Session economics",`- ${s.join(" \xB7 ")}`,"")}return i.push("_Closed-loop judgment continuity \u2014 not bulk memory. Proof of traps prevented and decisions applied._"),i.join(`
|
|
9
|
-
`).trim()}c(D,"buildJudgmentReceipt");function R(e){if(!e)return null;let r=(e.match(/## Traps re-surfaced/g)||[]).length,t=p(e,"Traps re-surfaced"),n=p(e,"Decisions contested or honored"),o=[];return t>0&&o.push(`${t} trap(s) re-surfaced`),n>0&&o.push(`${n} decision(s) tracked`),o.length===0&&o.push("session judgment landed"),`Judgment receipt: ${o.join(", ")}`}c(R,"summarizeJudgmentReceipt");function p(e,r){let t=new RegExp(`## ${r}\\n([\\s\\S]*?)(?=\\n## |\\n_|$)`),n=e.match(t);return n?(n[1].match(/^- /gm)||[]).length:0}c(p,"countSectionBullets");async function k(e,r,t){let n=D(t);if(!n)return{wrote:!1,content:null,summary:null,reason:"nothing-to-receipt"};try{return await h.remember(e,{type:"context",content:n,tags:{source:I,topic:_,capture:g,synthesis:"deterministic"},provenance:"extracted",projectId:r}),{wrote:!0,content:n,summary:R(n)}}catch(o){return{wrote:!1,content:n,summary:R(n),reason:`remember-failed: ${o.message}`}}}c(k,"persistJudgmentReceipt");async function C(e){let r=S(e.projectId,e.cycleId),t=O(e.projectId),n=$(e.projectId);return k(e.projectPath,e.projectId,{cycleDescription:e.cycleDescription,cycleId:e.cycleId,journal:r,trapsSurfaced:t,decisions:n,tokensIn:e.tokensIn,tokensOut:e.tokensOut,model:e.model,author:e.author,openRisksNext:e.cycleDescription?["Open cycle still needs finish or pause before context dies."]:[]})}c(C,"synthesizeJudgmentReceipt");function T(e){try{let r=Date.now()-864e5,n=a.query(e,`SELECT me.id, me.content
|
|
10
|
-
FROM memory_entries me
|
|
11
|
-
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
12
|
-
WHERE me.deleted_at IS NULL
|
|
13
|
-
AND me.created_at >= ?
|
|
14
|
-
AND t.key = 'capture' AND t.value = ?
|
|
15
|
-
ORDER BY me.created_at DESC
|
|
16
|
-
LIMIT 1`,r,g)[0];return n?{id:n.id,content:n.content,trapCount:p(n.content,"Traps re-surfaced")}:null}catch{return null}}c(T,"latestJudgmentReceipt24h");function x(e,r){try{let t=r??0;return a.get(e,`SELECT COUNT(*) AS c
|
|
17
|
-
FROM memory_entries me
|
|
18
|
-
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
19
|
-
WHERE me.deleted_at IS NULL
|
|
20
|
-
AND me.created_at >= ?
|
|
21
|
-
AND t.key = 'capture' AND t.value = ?`,t,g)?.c??0}catch{return 0}}c(x,"countReceiptsWritten");function S(e,r){try{return r?a.query(e,"SELECT content FROM task_log WHERE task_id = ? ORDER BY id DESC LIMIT 5",r).map(t=>t.content):a.query(e,"SELECT content FROM task_log ORDER BY id DESC LIMIT 5").map(t=>t.content)}catch{return[]}}c(S,"recentJournal");function O(e){try{return a.query(e,`SELECT id, type, content FROM memory_entries
|
|
22
|
-
WHERE deleted_at IS NULL
|
|
23
|
-
AND type IN ('gotcha', 'anti-pattern')
|
|
24
|
-
ORDER BY created_at DESC
|
|
25
|
-
LIMIT 5`).map(t=>({id:t.id,type:t.type,title:t.content.replace(/\s+/g," ").trim().slice(0,120)}))}catch{return[]}}c(O,"recentSurfacedTraps");function $(e){try{return a.query(e,`SELECT me.id, me.type, me.content, t.value AS action
|
|
26
|
-
FROM memory_entries me
|
|
27
|
-
JOIN memory_entry_tags t ON t.entry_id = me.id AND t.key = 'conflict_action'
|
|
28
|
-
WHERE me.deleted_at IS NULL
|
|
29
|
-
AND me.created_at >= ?
|
|
30
|
-
ORDER BY me.created_at DESC
|
|
31
|
-
LIMIT 8`,Date.now()-864e5).map(t=>({id:t.id,type:t.type,title:t.content.replace(/\s+/g," ").trim().slice(0,120),status:t.action==="deny"||t.action==="warn"?"contested":"honored"}))}catch{return[]}}c($,"recentConflictDecisions");function u(e,r){let t=e.replace(/\s+/g," ").trim();return t.length>r?`${t.slice(0,r-1)}\u2026`:t}c(u,"truncate");export{I as a,_ as b,g as c,D as d,R as e,k as f,C as g,T as h,x as i};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as e}from"./chunk-E66B27AL.mjs";var t={code:{name:"code",version:"1.1.0",description:"Coding work: features, bugs, refactors, TDD, shipping.",suggestedPersona:{role:"DEV",mcps:["github"]},memoryTypes:["fact","decision","learning","gotcha","pattern","anti-pattern","shipped"],workflowSlots:{ship:{description:"Publish finished work \u2014 tests, commit, push, PR."},review:{description:"Pre-commit or pre-PR review pass."}},hookSignals:[],suggestedTags:{domain:["auth","api","frontend","infra","data"]},configDefaults:{sdd:"advisory",tdd:"assist",maxTurnsPerCycle:25,deliveryGeometry:"advisory",land:"strict",conflictMode:"advisory"}},"code-strict":{name:"code-strict",version:"1.1.0",description:"Ship-grade coding: SDD+TDD strict, delivery-geometry gate, forced land. Opt-in.",suggestedPersona:{role:"DEV",mcps:["github"]},memoryTypes:["fact","decision","learning","gotcha","pattern","anti-pattern","shipped"],workflowSlots:{ship:{description:"Publish finished work \u2014 tests, commit, push, PR."},review:{description:"Pre-commit or pre-PR review pass."}},hookSignals:[],configDefaults:{sdd:"strict",tdd:"strict",maxTurnsPerCycle:25,deliveryGeometry:"strict",land:"strict",conflictMode:"strict"}},daily:{name:"daily",version:"1.0.0",description:"Day-to-day capture + review. GTD-style inbox + weekly review.",memoryTypes:["inbox","todo","idea"],workflowSlots:{morning:{description:"Morning briefing \u2014 pull open todos + upcoming commitments."},clarify:{description:"Reclassify inbox entries to real memory types."},review:{description:"Weekly/biweekly review across memory."}},hookSignals:[]},pm:{name:"pm",version:"1.0.0",description:"Product Management: specs, user interviews, roadmap, backlog triage.",suggestedPersona:{role:"PM",mcps:["linear","posthog"]},memoryTypes:["insight","question","stakeholder","decision","source"],workflowSlots:{spec:{description:"Draft a technical/product spec from captured insights."},triage:{description:"Review Linear backlog and prioritize."},interview:{description:"User interview pre-brief + post-synthesis."}},hookSignals:[{event:"UserPromptSubmit",ifMatches:"spec|requirements?|prd",inject:["type=insight","type=question"]}],suggestedTags:{audience:["team","stakeholders"],quarter:["q1","q2","q3","q4"]}},founder:{name:"founder",version:"1.0.0",description:"Founder ops: strategy, fundraising, hiring, stakeholder comms.",suggestedPersona:{role:"Founder",mcps:["gmail","linear","posthog"]},memoryTypes:["goal","okr","person","stakeholder","decision","shipped"],workflowSlots:{"investor-update":{description:"Monthly investor update draft."},"1on1":{description:"1:1 prep + synthesis."},strategy:{description:"Strategy checkpoint \u2014 OKR progress + pivots."}},hookSignals:[{event:"UserPromptSubmit",ifMatches:"investor|board|update|fundrais",inject:["type=okr","type=shipped","type=stakeholder"]}],suggestedTags:{audience:["board","investors","team"]}},lean:{name:"lean",version:"1.0.0",description:"Anti-over-engineering: minimal-code review, debt ledger, intensity modes.",memoryTypes:["over-engineering","lean-debt"],workflowSlots:{review:{description:"Flag over-engineering in the current diff."},audit:{description:"Repo-wide over-engineering assessment."},debt:{description:"Harvest deferred-simplification (lean:) markers."}},hookSignals:[{event:"UserPromptSubmit",ifMatches:"simplif|over-?engineer|yagni|too complex|leaner",inject:["type=over-engineering","type=lean-debt"]}],suggestedTags:{intensity:["lite","full","ultra"]}},research:{name:"research",version:"1.0.0",description:"Research: deep-dives, literature review, competitive scans.",suggestedPersona:{role:"Research",mcps:["web"]},memoryTypes:["source","claim","question","insight"],workflowSlots:{"lit-review":{description:"Literature review across captured sources."},analyze:{description:"Data analysis run via MCP, persist findings."}},hookSignals:[],suggestedTags:{confidence:["high","medium","low"]}}},r=Object.keys(t);function s(i){return t[i]??null}e(s,"getPackManifest");export{t as a,r as b,s as c};
|