prjct-cli 3.93.0 → 3.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-2U2LOBGR.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-N4NYGIG3.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-SP4PBALR.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-BN6L6QHO.mjs +8 -0
- package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
- package/dist/bin/hook-chunks/capture-gate-FRF2G3IG.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-27XFSCOE.mjs} +4 -4
- package/dist/bin/hook-chunks/chunk-2HB2JHQE.mjs +69 -0
- package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-3VWBNLBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-4O4D6DV7.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-4SKJWNKE.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-5EQLQ7GF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-66GE3IHX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-6RLCUGGG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-6UH244CC.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-7GNWHWOO.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-7JEKBJAP.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-7O6OMD4X.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-AVRNHROK.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-AZHE4VOM.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-AZYQFRPJ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-C3W2HLJT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-D6IONKRA.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-DRGI5UHQ.mjs +10 -0
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-EHEQOF6Z.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-EMTCZG5I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-EQ5KNMLG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-F4T7IAA7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-FX6VHIKB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-GFY4GY3Z.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HHIGNKDO.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-HNEKXKOI.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-HRWXMF7P.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-IHECXD2M.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IKIB42F7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-INXNK57E.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-J6TAD3OZ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JAMSIKDE.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-JCYXFHQZ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JMCMTX6U.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-JPSJWCFD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-JUZ5LNDI.mjs +14 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-KG7Z6OMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-KOCROTRM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-MHQTGU45.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-MI3JEFON.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-NBKEOLDH.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-NCOOKPXX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-NHIWYDQD.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-NUJASVHN.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-NWIQNII6.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-NWZEBCTC.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-OENWCYLF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OIU4Y5WL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-OZJ6UKKP.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PUHX3ECX.mjs +11 -0
- package/dist/bin/hook-chunks/chunk-Q3EYM4GJ.mjs +19 -0
- package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-Q3Z53QTH.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-QPRNRLG6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-QYEASMFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-S7HQQILD.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-SDUS2AT7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-T2FCU3ZS.mjs +12 -0
- package/dist/bin/hook-chunks/{chunk-A5RNWWTH.mjs → chunk-TFCLMTJ5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-TG5CQJD5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-TKWAFYF7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-TYEAIX3X.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-UA4Z5TGG.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-V2BSS7HW.mjs +36 -0
- package/dist/bin/hook-chunks/{chunk-DLHSCKBJ.mjs → chunk-VWOIUTAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-X2AGNDGD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-XE4MJNBQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Y3J7UUMR.mjs +47 -0
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-Y4DUB7UN.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-YUKGWWL7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-ZJXH76Q5.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-ZMKTR2IO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/client-ERZ5CM3D.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-4GRWQSUK.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-6DYQMPDJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-MF4KUM3X.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-2VZPHUDG.mjs} +1 -1
- package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-V7CIDF3Q.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-UOBQXY42.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-J6O46KS7.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-XYKQF3KR.mjs} +1 -1
- package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-DFRJOOB3.mjs} +1 -1
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-SLC34HUU.mjs +12 -0
- package/dist/bin/hook-chunks/distill-U2LJGUG3.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-6XFYIOE6.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-X6RDNNIE.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-ALUX4QSI.mjs +8 -0
- package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-SCGU3URM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-BYPG65RS.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-GWSSCLAB.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-MMISX2BI.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-WG5JAS7B.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-2WSO5KEB.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-QK5QJOFJ.mjs +8 -0
- package/dist/bin/hook-chunks/notification-MPVWVV52.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-XRYOROK5.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-WWGQNJDQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-ZR5RAKTK.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-S55KBPN2.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QMHSZHDN.mjs +8 -0
- package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-bash-RAM6L3G4.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-736ZLMDL.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-GZ4QJ2MU.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-LCIAWWGK.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-J5EOFMYN.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-TSUMTXHH.mjs +8 -0
- package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-T2DG236Y.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-VRY22I66.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-5DEN5VLF.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-KKEMTEMP.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-7MAUSED2.mjs +8 -0
- package/dist/bin/hook-chunks/{prompt-AYY7BZFG.mjs → prompt-DVF6V2X2.mjs} +7 -7
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-G54XQV5K.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-MC5LFSAO.mjs +8 -0
- package/dist/bin/hook-chunks/retention-LWETHQX3.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-5UCVX43H.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-RKNAJJHR.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-MFMFKUPK.mjs +8 -0
- package/dist/bin/hook-chunks/setup-WQRJ6TQL.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-5D5LTJ3P.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-RAVJMC4P.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-7DDSTRTV.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-LAO5Z2M5.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-K3GMQKGH.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-EIFGUO7X.mjs +8 -0
- package/dist/bin/hook-chunks/stop-RYLI4FGF.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-CCUPSANT.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-RBD2OILE.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-K37N2NK7.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-BKQIMFRG.mjs +8 -0
- package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-EGBMWF3J.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-E3LMZISA.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-2ZYE5M6J.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-ITY5OSHX.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-XREJLWEF.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-7S55S5C3.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SCM4C2A3.mjs} +1 -1
- package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SCH5ARGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HT756AND.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-47CF3XWZ.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-FLCEQ2BV.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-JQHVVXIZ.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-CDLSZ4U5.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-UUW4UGGB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/prjct-core.mjs +720 -732
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/daemon/entry.mjs +638 -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-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-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-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/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
- package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
- package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
|
@@ -0,0 +1,141 @@
|
|
|
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-Y4DUB7UN.mjs";import{a as J}from"./chunk-TFCLMTJ5.mjs";import"./chunk-66GE3IHX.mjs";import"./chunk-J6TAD3OZ.mjs";import"./chunk-T2FCU3ZS.mjs";import"./chunk-KOCROTRM.mjs";import{c as z,d as G}from"./chunk-F4T7IAA7.mjs";import{a as i}from"./chunk-4O4D6DV7.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-NBKEOLDH.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import{c as B}from"./chunk-OIU4Y5WL.mjs";import"./chunk-3FBCOCPD.mjs";import{a as K,b as F,c as u}from"./chunk-TYEAIX3X.mjs";import"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import{b as E}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{d as v}from"./chunk-4SKJWNKE.mjs";import{t as O,u as N,v as A,w as ae}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{f as _,g as U,k as T,o as se}from"./chunk-UH4MD3F3.mjs";import{a as D,p as oe}from"./chunk-QWQFF2UG.mjs";import"./chunk-EQ5KNMLG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import{b as x,e as ie}from"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import{e as P,f as ne}from"./chunk-BUDZL4DW.mjs";import{a as m,e as M}from"./chunk-E66B27AL.mjs";import j from"node:fs/promises";import ce from"node:http";import I from"node:path";import s from"chalk";ae();import{createHash as re,randomBytes as V}from"node:crypto";var q="pkce-v1",W=32;function L(r){return r.toString("base64url")}m(L,"base64Url");function Y(){let r=L(V(W)),e=L(V(W)),t=L(re("sha256").update(r,"ascii").digest());return{state:e,codeVerifier:r,codeChallenge:t,codeChallengeMethod:"S256"}}m(Y,"generatePkceMaterial");function Q(r){return new URLSearchParams({flow:q,port:String(r.port),device_id:r.deviceId,hostname:r.hostname,state:r.state,code_challenge:r.codeChallenge,code_challenge_method:"S256"})}m(Q,"buildCliLoginSearchParams");function X(r,e){if(r.get("key"))return{ok:!1,reason:"legacy-bearer",message:"This CLI requires PKCE login. Update the web app or set flow=pkce-v1; bearer tokens in the callback URL are no longer accepted."};let o=r.get("code"),n=r.get("state");return!o||!n?{ok:!1,reason:"missing",message:"Missing authorization code or state in callback"}:n!==e?{ok:!1,reason:"mismatch",message:"Login state mismatch \u2014 try `prjct login` again"}:{ok:!0,code:o,state:n}}m(X,"parsePkceCallback");function Z(r){return{flow:q,code:r.code,state:r.state,code_verifier:r.codeVerifier,device_id:r.deviceId,redirect_uri:`http://127.0.0.1:${r.port}/callback`}}m(Z,"buildExchangeBody");function ee(r){if(!r||typeof r!="object")return null;let e=r,t=e.apiKey??e.api_key,o=e.userId??e.user_id,n=e.email,a=e.deviceId??e.device_id;return!t||!o||!n||!a?null:{apiKey:t,userId:o,email:n,deviceId:a}}m(ee,"parseMintedKeyResponse");ne();oe();se();ie();var te=class extends G{static{m(this,"SetupCommands")}async auth(e=null,t={}){switch(e?.split(" ")[0]||"status"){case"login":return t.md||i.fail("Manual token login is not supported. Run prjct login."),{success:!1,message:t.md?"## Error\nManual token login is not supported. Run `prjct login`.":""};case"logout":return await u.clearAuth(),await this.refreshDaemonAuth(),t.md||i.done("Logged out. Auth credentials cleared"),{success:!0,message:t.md?`## Auth
|
|
9
|
+
- **Status**: Logged out`:""};default:{let n=await u.getStatus();return t.md?{success:!0,message:n.authenticated?`## Auth Status
|
|
10
|
+
- **Authenticated**: Yes
|
|
11
|
+
- **Email**: ${n.email||"N/A"}
|
|
12
|
+
- **Token**: stored securely
|
|
13
|
+
- **Last auth**: ${n.lastAuth||"N/A"}`:"## Auth Status\n- **Authenticated**: No\n- Run `prjct login` to connect"}:(n.authenticated?i.box("Auth Status",`Email: ${n.email||"N/A"}
|
|
14
|
+
Token: stored securely
|
|
15
|
+
Since: ${n.lastAuth||"N/A"}`):(i.info("Not authenticated"),i.info(`Run ${s.cyan("prjct login")} to connect`)),{success:!0,message:""})}}}async login(e={}){let t=await u.getStatus();if(t.authenticated)return e.md||(i.box("Already Authenticated",`Email: ${t.email}
|
|
16
|
+
Token: stored securely`),i.info(`Run ${s.cyan("prjct logout")} first to re-authenticate`)),{success:!0,message:e.md?`## Already Authenticated
|
|
17
|
+
- **Email**: ${t.email}
|
|
18
|
+
- **Token**: stored securely
|
|
19
|
+
|
|
20
|
+
Run \`prjct logout\` first to re-authenticate.`:""};let o=process.env.PRJCT_WEB_URL||F,n=process.env.PRJCT_API_URL||K,a=Y(),c={settled:!1,listenPort:0};return new Promise(h=>{let l=m(g=>{c.settled||(c.settled=!0,h(g))},"finish"),d=ce.createServer(async(g,p)=>{let k=new URL(g.url||"/","http://127.0.0.1"),w={"Content-Type":"text/html","Cache-Control":"no-store","Referrer-Policy":"no-referrer"};if(k.pathname==="/callback"){let f=X(k.searchParams,a.state);if(!f.ok){let C=(f.reason==="legacy-bearer",400);p.writeHead(C,w),p.end(this.buildErrorPage(f.message)),f.reason==="legacy-bearer"&&(e.md||(i.warn(f.message),i.info("Update prjct-cli-app or open the login URL with flow=pkce-v1")));return}let{verified:y,failureMessage:b,email:$}=await(async()=>{try{let C=Z({code:f.code,state:f.state,codeVerifier:a.codeVerifier,deviceId:await u.getDeviceId(),port:c.listenPort}),R=await fetch(`${n}/auth/cli/exchange`,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(C)});if(!R.ok)return{verified:!1,failureMessage:`Exchange failed (${R.status})`,email:""};let S=ee(await R.json());return S?(await u.saveAuth(S.apiKey,S.userId,S.email),await u.write({apiUrl:n}),await B.testConnection()?{verified:!0,failureMessage:"",email:S.email}:(await u.clearAuth(),{verified:!1,failureMessage:"Could not verify credentials with prjct Cloud",email:S.email})):{verified:!1,failureMessage:"Malformed exchange response",email:""}}catch(C){return await u.clearAuth(),{verified:!1,failureMessage:C instanceof Error?C.message:"Could not store credentials securely",email:""}}})();y?(p.writeHead(200,w),p.end(this.buildSuccessPage($))):(p.writeHead(401,w),p.end(this.buildErrorPage(b))),d.close(),y?(e.md||(i.step(3,3,"Connected"),i.stop(),i.box("Authentication Complete",`Email: ${$}
|
|
21
|
+
Token: stored securely
|
|
22
|
+
Status: Connected`)),await this.refreshDaemonAuth(),await this.autoSync(),l({success:!0,message:e.md?`## Authenticated
|
|
23
|
+
- **Email**: ${$}
|
|
24
|
+
- **Token**: stored securely`:""})):(e.md||i.fail(`Authentication failed: ${b}`),l({success:!1,message:e.md?`## Error
|
|
25
|
+
Authentication failed: ${b}`:""}));return}p.writeHead(404,w),p.end("Not found")});d.listen(0,"127.0.0.1",async()=>{let g=d.address();if(!g||typeof g=="string"){d.close(),e.md||i.fail("Failed to start callback server"),l({success:!1,message:e.md?`## Error
|
|
26
|
+
Failed to start callback server`:""});return}c.listenPort=g.port;let p=await u.getDeviceId(),k=await u.getHostname(),w=Q({port:c.listenPort,deviceId:p,hostname:k,state:a.state,codeChallenge:a.codeChallenge}),f=`${o}/auth/cli?flow=pkce-v1&port=${c.listenPort}`,y=`${o}/auth/cli?${w.toString()}`;i.step(1,3,"Opening browser..."),i.stop(),i.info(s.dim(f));let b=process.platform,$=b==="darwin"?`open "${y}"`:b==="win32"?`start "" "${y}"`:`xdg-open "${y}"`;try{await D($)}catch{i.warn("Could not open browser automatically"),i.info("Visit the URL printed by your terminal session (full URL not echoed for safety)"),i.info(y)}i.step(2,3,"Waiting for authentication...")}),setTimeout(()=>{c.settled||(d.close(),i.stop(),e.md||(i.fail("Authentication timed out"),i.info(`Run ${s.cyan("prjct login")} to try again`)),l({success:!1,message:e.md?"## Error\nAuthentication timed out. Run `prjct login` to try again.":""}))},300*1e3)})}async logout(){return await u.clearAuth(),i.done("Logged out"),{success:!0,message:""}}async refreshDaemonAuth(){try{let{restartDaemon:e}=await import("./client-ERZ5CM3D.mjs");await e()}catch{}}async autoSync(){try{let e=await E.readConfig(process.cwd()).catch(()=>null),t=e?.projectId;if(!t||!e.cloud?.enabled||e.cloud.paused)return;i.spin("Syncing project...");let o=await H.sync(t,{include:e.cloud.include??{}});if(i.stop(),o.success&&!o.skipped){let n=o.pushed?.count||0,a=o.pulled?.count||0;n>0||a>0?i.done(`Synced (${n} pushed, ${a} pulled)`):i.done("Synced \u2014 everything up to date")}}catch{i.stop()}}buildSuccessPage(e){return`<!DOCTYPE html>
|
|
27
|
+
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
28
|
+
<title>prjct CLI Connected</title>
|
|
29
|
+
<style>
|
|
30
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
31
|
+
body{font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
|
32
|
+
background:#0a0a0a;color:#e5e5e5;display:flex;justify-content:center;align-items:center;min-height:100vh}
|
|
33
|
+
.card{text-align:center;max-width:420px;padding:2.5rem}
|
|
34
|
+
.logo{font-size:.875rem;letter-spacing:.05em;color:#a3a3a3;margin-bottom:2rem;font-family:ui-monospace,monospace}
|
|
35
|
+
.logo span{color:#e5e5e5}
|
|
36
|
+
.icon{width:64px;height:64px;border-radius:50%;background:rgba(34,211,238,.12);
|
|
37
|
+
display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem}
|
|
38
|
+
.icon svg{width:32px;height:32px;color:#22d3ee}
|
|
39
|
+
h1{font-size:1.5rem;font-weight:600;margin-bottom:.75rem}
|
|
40
|
+
.details{background:#141414;border:1px solid #262626;border-radius:8px;padding:1rem 1.25rem;
|
|
41
|
+
margin:1.25rem 0;text-align:left;font-size:.875rem;line-height:1.75}
|
|
42
|
+
.details .label{color:#888}
|
|
43
|
+
.details .value{color:#e5e5e5}
|
|
44
|
+
.hint{color:#666;font-size:.8125rem;margin-top:1rem}
|
|
45
|
+
</style></head>
|
|
46
|
+
<body><div class="card">
|
|
47
|
+
<div class="logo"><span>prjct</span>/cli</div>
|
|
48
|
+
<div class="icon"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
|
|
49
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7"/></svg></div>
|
|
50
|
+
<h1>CLI Connected</h1>
|
|
51
|
+
<div class="details">
|
|
52
|
+
<span class="label">Account:</span> <span class="value">${e}</span><br>
|
|
53
|
+
<span class="label">Token:</span> <span class="value">stored securely</span>
|
|
54
|
+
</div>
|
|
55
|
+
<p class="hint">Return to your terminal to continue.</p>
|
|
56
|
+
</div></body></html>`}buildErrorPage(e){return`<!DOCTYPE html>
|
|
57
|
+
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
|
58
|
+
<title>prjct CLI \u2014 Error</title>
|
|
59
|
+
<style>
|
|
60
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
61
|
+
body{font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',sans-serif;
|
|
62
|
+
background:#0a0a0a;color:#e5e5e5;display:flex;justify-content:center;align-items:center;min-height:100vh}
|
|
63
|
+
.card{text-align:center;max-width:420px;padding:2.5rem}
|
|
64
|
+
.logo{font-size:.875rem;letter-spacing:.05em;color:#a3a3a3;margin-bottom:2rem;font-family:ui-monospace,monospace}
|
|
65
|
+
.logo span{color:#e5e5e5}
|
|
66
|
+
.icon{width:64px;height:64px;border-radius:50%;background:rgba(239,68,68,.12);
|
|
67
|
+
display:flex;align-items:center;justify-content:center;margin:0 auto 1.5rem}
|
|
68
|
+
.icon svg{width:32px;height:32px;color:#ef4444}
|
|
69
|
+
h1{font-size:1.5rem;font-weight:600;margin-bottom:.75rem}
|
|
70
|
+
.msg{background:#141414;border:1px solid #262626;border-radius:8px;padding:1rem 1.25rem;
|
|
71
|
+
margin:1.25rem 0;font-size:.875rem;color:#f87171}
|
|
72
|
+
.hint{color:#666;font-size:.8125rem;margin-top:1rem}
|
|
73
|
+
</style></head>
|
|
74
|
+
<body><div class="card">
|
|
75
|
+
<div class="logo"><span>prjct</span>/cli</div>
|
|
76
|
+
<div class="icon"><svg fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5">
|
|
77
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12"/></svg></div>
|
|
78
|
+
<h1>Authentication Failed</h1>
|
|
79
|
+
<div class="msg">${e}</div>
|
|
80
|
+
<p class="hint">Return to your terminal and try again.</p>
|
|
81
|
+
</div></body></html>`}async start(){let e=await v.checkInstallation(),t=(N(),M(O)),o=await t.detectCodex(),n=await t.detectAntigravity(),a=e.providerDetected,c=a?await t.getActiveProvider():null,h=a?c.displayName:o.installed?"OpenAI Codex":"AI agents";if(console.log(`\u{1F680} Setting up prjct for ${h}...
|
|
82
|
+
`),!a&&!o.installed&&!n.installed&&(console.log("\u2139\uFE0F No local CLI runtime detected."),console.log(" prjct will still use AGENTS.md + MCP-compatible surfaces after init.")),a){console.log("\u{1F4E6} Installing p. command router...");let l=await v.installCommands();if(!l.success)return{success:!1,message:`\u274C Installation failed: ${l.error}`};console.log(`
|
|
83
|
+
\u2705 Installed ${l.installed?.length??0} commands to:
|
|
84
|
+
${A.getDisplayPath(l.path||"")}`),this.printInstallErrors(l.errors)}return await this.finishProviderInstall(o,n,c,"Installed Codex skill"),console.log(`
|
|
85
|
+
\u{1F389} Setup complete!`),console.log(`
|
|
86
|
+
Next steps:`),console.log(` 1. Open ${h}`),console.log(" 2. Navigate to your project"),console.log(" 3. Run: prjct init"),{success:!0,message:""}}async setup(e={}){console.log(`\u{1F527} Reconfiguring prjct...
|
|
87
|
+
`);let t=(N(),M(O)),o=await t.detectCodex(),n=await t.detectAntigravity(),c=(await v.checkInstallation()).providerDetected;if(e.force&&(console.log("\u{1F5D1}\uFE0F Removing existing installation..."),await v.uninstallCommands()),!c&&!o.installed&&!n.installed&&(console.log("\u2139\uFE0F No local CLI runtime detected."),console.log(" Continuing with universal AGENTS.md/MCP-compatible setup.")),c){console.log("\u{1F4E6} Installing p. command router...");let l=await v.installCommands();if(!l.success)return{success:!1,message:`\u274C Setup failed: ${l.error}`};console.log(`
|
|
88
|
+
\u2705 Installed ${l.installed?.length??0} commands`),this.printInstallErrors(l.errors),console.log(`
|
|
89
|
+
\u{1F4DD} Installing global configuration...`);let d=await v.installGlobalConfig(),g=d.path?A.getDisplayPath(d.path):"global config";d.success?d.action==="created"?console.log(`\u2705 Created ${g}`):d.action==="updated"?console.log(`\u2705 Updated ${g}`):d.action==="appended"&&console.log(`\u2705 Added prjct config to ${g}`):console.log(`\u26A0\uFE0F ${d.error}`)}else console.log("\u2139\uFE0F No Claude/Gemini global command surface detected; skipping CLI router cleanup.");let h=c?await t.getActiveProvider():null;if(h?.name==="claude"){console.log(`
|
|
90
|
+
\u26A1 Installing status line...`);let l=await this.installStatusLine();l.success?console.log("\u2705 Status line configured"):console.log(`\u26A0\uFE0F ${l.error}`)}return await this.finishProviderInstall(o,n,h,"Codex skill installed"),console.log(`
|
|
91
|
+
\u{1F389} Setup complete!
|
|
92
|
+
`),this.showAsciiArt(),{success:!0,message:""}}async setupMcpServers(){await J()}printInstallErrors(e){if((e?.length??0)>0){console.log(`
|
|
93
|
+
\u26A0\uFE0F ${e?.length??0} errors:`);for(let t of e??[])console.log(` - ${t.file}: ${t.error}`)}}async finishProviderInstall(e,t,o,n){await this.installCodexSurface(e.installed,n),await this.installAntigravitySurface(t.installed),await this.setupMcpServers(),await this.installProjectAgentSurfacesIfConfigured(),await this.saveSetupStamp(o?.name??(e.installed?"codex":t.installed?"antigravity":"claude"))}async saveSetupStamp(e){try{let t=(await import("./editors-config-6XFYIOE6.mjs")).default,o=I.join(A.globalConfigDir,"runtime-surfaces");await t.saveConfig(x,o,e)}catch(t){console.log(`\u26A0\uFE0F Setup stamp failed (non-blocking): ${P(t)}`)}}async installProjectAgentSurfacesIfConfigured(){try{let e=process.cwd();if(!await E.isConfigured(e))return;let{writeProjectAgentSurfaces:o}=await import("./project-agent-surfaces-VRY22I66.mjs"),{detectInstalledAgents:n}=await import("./detection-QRVSNMKL.mjs"),a=await o(e,{agents:await n(e),explicit:!0});a.prjctMd.action!=="unchanged"&&console.log("\u2705 Project PRJCT.md ready"),a.agentsMd.action!=="unchanged"&&console.log("\u2705 Project AGENTS.md ready"),a.claudeMd&&a.claudeMd.action!=="unchanged"&&console.log("\u2705 Project CLAUDE.md ready"),a.ideRules.length>0&&console.log(`\u2705 Project IDE rules ready: ${a.ideRules.join(", ")}`)}catch(e){console.log(`\u26A0\uFE0F Project agent surface setup failed (non-blocking): ${P(e)}`)}}async installCodexSurface(e,t){if(e)try{let{installCodexSkill:o,verifyCodexPRouterReady:n}=await import("./codex-skill-6DYQMPDJ.mjs");await o();let a=await n({autoRepair:!0});a.verified?(console.log(`\u2705 ${t}`),console.log("\u2705 Codex p. router ready")):(console.log(`\u26A0\uFE0F Codex skill setup incomplete: ${a.message||"router verification failed"}`),console.log(" Run `prjct setup` to retry Codex configuration."))}catch(o){console.log(`\u26A0\uFE0F Codex skill setup failed (non-blocking): ${P(o)}`)}}async installAntigravitySurface(e){if(e)try{let t=await import("node:os"),{getTemplateContent:o}=await import("./template-loader-SCM4C2A3.mjs"),n=I.join(t.homedir(),".gemini","antigravity","skills","prjct"),a=I.join(n,"SKILL.md"),c=o("antigravity/SKILL.md");if(!c)throw new Error("Antigravity SKILL.md template not found");await j.mkdir(n,{recursive:!0}),await j.writeFile(a,c,"utf-8"),console.log("\u2705 Antigravity skill installed")}catch(t){console.log(`\u26A0\uFE0F Antigravity skill setup failed (non-blocking): ${P(t)}`)}}async installStatusLine(){try{let e=A.getClaudeDir(),t=A.getClaudeSettingsPath(),o=I.join(e,"prjct-statusline.sh");if(await T(o)&&(await j.readFile(o,"utf-8")).includes("build_statusline"))return{success:!0};let n=`#!/bin/bash
|
|
94
|
+
# prjct Status Line for Claude Code
|
|
95
|
+
# Shows version update notifications and current task
|
|
96
|
+
|
|
97
|
+
# Current CLI version (embedded at install time)
|
|
98
|
+
CLI_VERSION="${x}"
|
|
99
|
+
|
|
100
|
+
# Read JSON context from stdin (provided by Claude Code)
|
|
101
|
+
read -r json
|
|
102
|
+
|
|
103
|
+
# Extract cwd from JSON
|
|
104
|
+
CWD=$(echo "$json" | grep -o '"cwd"[[:space:]]*:[[:space:]]*"[^"]*"' | sed 's/.*"cwd"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
|
|
105
|
+
|
|
106
|
+
# Check if this is a prjct project
|
|
107
|
+
CONFIG="$CWD/.prjct/prjct.config.json"
|
|
108
|
+
if [[ -f "$CONFIG" ]]; then
|
|
109
|
+
# Extract projectId
|
|
110
|
+
PROJECT_ID=$(grep -o '"projectId"[[:space:]]*:[[:space:]]*"[^"]*"' "$CONFIG" | sed 's/.*"projectId"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
|
|
111
|
+
|
|
112
|
+
if [[ -n "$PROJECT_ID" ]]; then
|
|
113
|
+
# Upgrade notice \u2014 the daemon checks npm and writes this GLOBAL flag.
|
|
114
|
+
# The statusline only READS it; it does no version comparison itself.
|
|
115
|
+
UPDATE_STATUS="$HOME/.prjct-cli/state/update-status.json"
|
|
116
|
+
if [[ -f "$UPDATE_STATUS" ]] && grep -q '"updateAvailable"[[:space:]]*:[[:space:]]*true' "$UPDATE_STATUS"; then
|
|
117
|
+
LATEST=$(grep -o '"latest"[[:space:]]*:[[:space:]]*"[^"]*"' "$UPDATE_STATUS" | sed 's/.*"latest"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
|
|
118
|
+
echo "\u26A0\uFE0F prjct v$LATEST available! Run p. upgrade"
|
|
119
|
+
exit 0
|
|
120
|
+
fi
|
|
121
|
+
|
|
122
|
+
# Show current task if exists
|
|
123
|
+
STATE="$HOME/.prjct-cli/projects/$PROJECT_ID/storage/state.json"
|
|
124
|
+
if [[ -f "$STATE" ]]; then
|
|
125
|
+
TASK=$(grep -o '"description"[[:space:]]*:[[:space:]]*"[^"]*"' "$STATE" | head -1 | sed 's/.*"description"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
|
|
126
|
+
STATUS=$(grep -o '"status"[[:space:]]*:[[:space:]]*"[^"]*"' "$STATE" | head -1 | sed 's/.*"status"[[:space:]]*:[[:space:]]*"\\([^"]*\\)".*/\\1/')
|
|
127
|
+
|
|
128
|
+
if [[ -n "$TASK" ]] && [[ "$STATUS" == "active" ]]; then
|
|
129
|
+
# Truncate task to 40 chars
|
|
130
|
+
TASK_SHORT="\${TASK:0:40}"
|
|
131
|
+
[[ \${#TASK} -gt 40 ]] && TASK_SHORT="$TASK_SHORT..."
|
|
132
|
+
echo "\u{1F3AF} $TASK_SHORT"
|
|
133
|
+
exit 0
|
|
134
|
+
fi
|
|
135
|
+
fi
|
|
136
|
+
fi
|
|
137
|
+
fi
|
|
138
|
+
|
|
139
|
+
# Default: show prjct branding
|
|
140
|
+
echo "\u26A1 prjct"
|
|
141
|
+
`;await j.writeFile(o,n,{mode:493});let a=await T(t)?await _(t).catch(()=>null).then(c=>c??{}):{};return a.statusLine={type:"command",command:o},await U(t,a),{success:!0}}catch(e){return z(e)}}showAsciiArt(){console.log(s.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(""),console.log(s.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")),console.log(s.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u2550\u2588\u2588\u2554\u2550\u2550\u255D")),console.log(s.bold.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551")),console.log(s.bold.cyan(" \u2588\u2588\u2554\u2550\u2550\u2550\u255D \u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551")),console.log(s.bold.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2551")),console.log(s.bold.cyan(" \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u2550\u2550\u2550\u2550\u255D \u255A\u2550\u255D")),console.log(""),console.log(` ${s.bold.cyan("prjct")}${s.magenta("/")}${s.green("cli")} ${s.dim.white(`v${x} installed`)}`),console.log(""),console.log(` ${s.yellow("\u26A1")} Improve developer + agent performance`),console.log(` ${s.green("\u{1F9E0}")} Rich project context without context bloat`),console.log(` ${s.cyan("\u{1F916}")} Human-in-the-loop work cycles`),console.log(""),console.log(s.cyan("\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501\u2501")),console.log(""),console.log(s.bold.cyan("\u{1F680} Quick Start")),console.log(s.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(""),console.log(` ${s.bold("1.")} Initialize your project:`),console.log(` ${s.green("cd your-project && prjct init")}`),console.log(""),console.log(` ${s.bold("2.")} Start your first work cycle:`),console.log(` ${s.green('prjct work "build auth"')}`),console.log(""),console.log(` ${s.bold("3.")} Ship & celebrate:`),console.log(` ${s.green('prjct ship "user login"')}`),console.log(""),console.log(s.dim("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500")),console.log(""),console.log(` ${s.dim("Documentation:")} ${s.cyan("https://prjct.app")}`),console.log(` ${s.dim("Report issues:")} ${s.cyan("https://github.com/prjct-app/cli/issues")}`),console.log(""),console.log(s.bold.magenta("Ship with better context.")),console.log("")}};export{te as SetupCommands};
|
|
@@ -5,9 +5,9 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{f as ie,g as le,h as ue,i as me}from"./chunk-
|
|
9
|
-
Override only with explicit consent: verify packages, then \`prjct ship --allow-new-deps\`.`};console.log(`\u26A0\uFE0F ${c.message}`)}}catch{}try{let{contextPressureBlocksExpansion:t,contextPressureVerdict:c}=await import("./context-pressure-OUN5PFMN.mjs"),r=c(m,{turnCount:a?.turnCount,tokensIn:a?.tokensIn,tokensOut:a?.tokensOut,description:a?.description});if(t(r,m)&&!n.forcePressure)return{success:!1,error:r.cue??"Context density hard-block is enabled (contextPressure.hardBlockShip). Soften injection or pass --force-pressure with consent."};(r.level==="warn"||r.level==="critical")&&r.cue&&console.log(r.cue)}catch{}let u=m?.deliveryGeometry?.mode??"off";try{let{computeCommittedChangeset:t,shipGeometryVerdict:c}=await import("./delivery-geometry-
|
|
10
|
-
`))}}catch{}if(!n.noTestGate)try{let{effectiveTddMode:t}=await import("./tdd-
|
|
11
|
-
`))}}catch{}let Ce=y.getRulesForCommand(o,"ship"),X=n.intent==="seed-code-workflow"?await ke(o,e):null;if(X===!1)return{success:!1,error:"seed-code-workflow requested but this project does not look like code (no package.json / Cargo.toml / pyproject.toml / VERSION). Add rules manually with `prjct workflow add`."};let Z=X===!0?y.getRulesForCommand(o,"ship"):Ce,ee=!Z.some(t=>t.type==="step"&&t.position==="before")&&n.intent!=="register-only"?await ke(o,e):!1;ee&&console.log("\u2139\uFE0F Auto-seeded code ship workflow (one-time migration)");let te=ee?y.getRulesForCommand(o,"ship"):Z,_=n.intent==="pr-convention-auto"?"auto":n.intent==="pr-convention-manual"?"manual":null;_&&Ee(o,_,te);let Re=_?y.getRulesForCommand(o,"ship"):te,q=await Ne(o,e,Re,n);if(q)return He(q,n.md===!0),{success:!1,clarification:q};let w=b??await Fe(e);if(!w)return{success:!1,error:'Ship needs a release description. Pass one explicitly, e.g. `prjct ship "add universal agent compatibility"`, or ship from a named feature branch.'};let F={feature:w},v=await U(o,"ship","before",{projectPath:e,skipRules:n.skipHooks,runContext:F});if(!v.success)return{success:!1,error:`Ship blocked: ${v.gatesFailed.length>0?v.gatesFailed.join(", "):"unknown step"}`};let S=typeof F.version=="string"?F.version:"unversioned";try{R.setDoc(o,L,{feature:w,version:S,startedAt:I()})}catch{}await B.addShipped(o,{name:w,version:S});try{R.deleteDoc(o,L)}catch{}if(a)try{R.run(o,"UPDATE tasks SET shipped_at = ? WHERE id = ?",I(),a.id)}catch{}await this.logToMemory(e,"feature_shipped",{feature:w,version:S,timestamp:I()});let G=await U(o,"ship","after",{projectPath:e,skipRules:n.skipHooks,runContext:F}),ne=[...v.instructions,...G.instructions];try{await ie.sync(e)}catch(t){console.warn("\u26A0\uFE0F Failed to sync AI context after shipping:",z(t))}let xe=v.stepsRun.length+G.stepsRun.length;if(a?.id)try{let{usefulnessService:t}=await import("./usefulness-
|
|
8
|
+
import{f as ie,g as le,h as ue,i as me}from"./chunk-V2BSS7HW.mjs";import"./chunk-Y3J7UUMR.mjs";import"./chunk-TXJT3G53.mjs";import"./chunk-TFCLMTJ5.mjs";import"./chunk-66GE3IHX.mjs";import{a as B}from"./chunk-J6TAD3OZ.mjs";import{a as fe,b as ge}from"./chunk-BCAHWZH7.mjs";import"./chunk-T2FCU3ZS.mjs";import{a as U,h as Y,i as de}from"./chunk-2HB2JHQE.mjs";import"./chunk-XE4MJNBQ.mjs";import{a as y}from"./chunk-C3W2HLJT.mjs";import{a as Q,b as $,c as A,d as ae,f as ce}from"./chunk-X2AGNDGD.mjs";import{c as re,d as he}from"./chunk-F4T7IAA7.mjs";import{a as K}from"./chunk-H4CA3XZ6.mjs";import{a as V}from"./chunk-4O4D6DV7.mjs";import"./chunk-JCYXFHQZ.mjs";import"./chunk-JPSJWCFD.mjs";import"./chunk-TPESWBA7.mjs";import{a as pe}from"./chunk-FEFP6JOL.mjs";import"./chunk-JUZ5LNDI.mjs";import"./chunk-7O6OMD4X.mjs";import"./chunk-OZJ6UKKP.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-NWIQNII6.mjs";import"./chunk-LNB2GLYI.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-FX6VHIKB.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-VWOIUTAX.mjs";import"./chunk-IHECXD2M.mjs";import"./chunk-KEJ5RMAI.mjs";import{a as x}from"./chunk-OENWCYLF.mjs";import"./chunk-NBKEOLDH.mjs";import"./chunk-GFY4GY3Z.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-JMCMTX6U.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-GAOQHD5S.mjs";import{b as W}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as R,g as Ae}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-4SKJWNKE.mjs";import{b as I,h as Te}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{i as M,p as De}from"./chunk-QWQFF2UG.mjs";import"./chunk-EQ5KNMLG.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import{e as z,f as Me}from"./chunk-BUDZL4DW.mjs";import{a as g}from"./chunk-E66B27AL.mjs";import{existsSync as ve}from"node:fs";import Se from"node:path";Ae();Me();Te();De();var L="ship:in_progress",we=class extends he{static{g(this,"ShippingCommands")}async ship(i,e=process.cwd(),n={}){try{let l=await me(e);if(!l.ok)return l.result;let o=l.value;try{if((await W.readConfig(e))?.delivery?.killSwitch==="on")return{success:!1,error:"Delivery kill-switch ON \u2014 mutation path removed. Lift only by setting `delivery.killSwitch` to `off` in `.prjct/prjct.config.json` (not via --no-judgment-gate / --no-spec-gate)."}}catch{}try{let t=R.getDoc(o,L);t?.version&&(await B.getByVersion(o,t.version)||(await B.addShipped(o,{name:t.feature,version:t.version}),console.log(`\u2139\uFE0F Reconciled an interrupted ship: ${t.feature} (v${t.version})`)),R.deleteDoc(o,L))}catch{}let a=await Y(o,e),d=a?.linkedSpecId,b=ye(i)??ye(a?.description??null),m=await W.readConfig(e).catch(()=>null);if(!n.noSpecGate&&!d)try{let{effectiveSddMode:t}=await import("./sdd-5UCVX43H.mjs");if(t(m)==="strict")return{success:!1,error:"Strict SDD: this work has no linked intent/spec. Start it via `prjct intent` \u2192 `audit-spec` \u2192 `prjct work --spec <id>`, or override with `prjct ship --no-spec-gate`."}}catch{}try{let{checkPackageLegitimacy:t}=await import("./package-legitimacy-MIR3VZSF.mjs"),c=await t(e);if(c.risky&&c.message){if((m?.sdd?.mode==="strict"||m?.tdd?.mode==="strict"||m?.deliveryGeometry?.mode==="strict")&&!n.allowNewDeps)return{success:!1,error:`${c.message}
|
|
9
|
+
Override only with explicit consent: verify packages, then \`prjct ship --allow-new-deps\`.`};console.log(`\u26A0\uFE0F ${c.message}`)}}catch{}try{let{contextPressureBlocksExpansion:t,contextPressureVerdict:c}=await import("./context-pressure-OUN5PFMN.mjs"),r=c(m,{turnCount:a?.turnCount,tokensIn:a?.tokensIn,tokensOut:a?.tokensOut,description:a?.description});if(t(r,m)&&!n.forcePressure)return{success:!1,error:r.cue??"Context density hard-block is enabled (contextPressure.hardBlockShip). Soften injection or pass --force-pressure with consent."};(r.level==="warn"||r.level==="critical")&&r.cue&&console.log(r.cue)}catch{}let u=m?.deliveryGeometry?.mode??"off";try{let{computeCommittedChangeset:t,shipGeometryVerdict:c}=await import("./delivery-geometry-WYOEMKMO.mjs"),r=await t(e),p=c({changeset:r,mode:u,explicitGeometry:n.geometry??null,locThreshold:m?.deliveryGeometry?.locThreshold});if(p.blocked)return{success:!1,error:p.message??"Delivery geometry gate blocked ship."};p.message&&console.log(p.message)}catch(t){if(u==="strict"&&t instanceof M)return{success:!1,error:`Delivery geometry gate unevaluable: ${t.message}. Re-run when git is healthy, or ship with explicit \`--geometry\`.`}}try{let{hasSymbolIndex:t}=await import("./symbol-graph-BKQIMFRG.mjs");if(t(o)){let{detectChanges:c,shipStructuralRiskCue:r}=await import("./detect-changes-DFRJOOB3.mjs"),p=await c(e,o,{source:"auto"}),h=r(p);if(h&&console.log(h),(m?.deliveryGeometry?.mode??"off")==="strict"&&p.summary.critical>0&&!n.geometry&&!n.allowNewDeps)return{success:!1,error:`Strict delivery geometry + structural CRITICAL risk (${p.summary.critical} file(s), blast ${p.affectedFiles.length}). Review \`prjct code impact --md\`, then re-ship with explicit \`--geometry single|split|direct\`.`}}}catch(t){t instanceof M&&console.log(`\u26A0\uFE0F Structural risk cue unavailable: ${t.message}`)}let J=(m?.persona?.packs??[]).includes("code-strict");try{let{intensityFromChangeset:t,judgmentShipVerdict:c}=await import("./precision-judgment-TT3DRNAX.mjs"),{shipRequiresQuality:r}=await import("./judgment-orchestrator-BYPG65RS.mjs"),{computeCommittedChangeset:p}=await import("./delivery-geometry-WYOEMKMO.mjs"),{judgmentLedgerStorage:h}=await import("./judgment-ledger-storage-SCGU3URM.mjs"),f=await p(e),$e={harnessLevel:a?.harness?.level,harnessKind:a?.harness?.kind},Oe=t({files:f?.files??0,loc:f?.loc??0},$e).intensity,oe=J?"full":Oe,se=J||r(oe),O=h.get(o),D=c({codeStrict:se,intensity:oe,ledger:O,override:!!n.noJudgmentGate});if(D.blocked)return{success:!1,error:D.message};if(D.message&&console.log(D.message),se&&!n.noJudgmentGate&&D.reason==="approved")try{let{contentBoundDriftVerdict:C,currentTreeHashForStamp:P}=await import("./content-bound-stamp-OG2KKN3L.mjs"),T=O?.contentBound,N=T?.treeHash?await P(e,T):null,H=C({stamp:T??null,currentTreeHash:N,hard:!0,override:!1});if(H.blocked)return{success:!1,error:H.message};H.message&&console.log(H.message)}catch(C){if(C instanceof M)return{success:!1,error:`Content-bound stamp unevaluable: ${C.message}. Re-run when git is healthy, or override with \`--no-judgment-gate\`.`}}else if(O?.contentBound?.treeHash&&!n.noJudgmentGate)try{let{contentBoundDriftVerdict:C,currentTreeHashForStamp:P}=await import("./content-bound-stamp-OG2KKN3L.mjs"),T=await P(e,O.contentBound),N=C({stamp:O.contentBound,currentTreeHash:T,hard:!1,override:!1});N.message&&console.log(N.message)}catch{}}catch(t){if(J&&t instanceof M)return{success:!1,error:`Judgment ship gate unevaluable: ${t.message}. Re-run when git is healthy, or override with \`--no-judgment-gate\`.`}}if(a&&await de(o,e),d&&!n.noSpecGate)try{let{specService:t}=await import("./spec-service-LAO5Z2M5.mjs"),c=await t.get(e,d);if(c&&c.content.acceptance_criteria.length>0){let r=[];r.push(""),r.push(`## Spec acceptance gate \u2014 \`${c.title}\` (${c.id.slice(0,8)})`),r.push(""),r.push("Walk each criterion. STOP if any is unmet."),r.push("");for(let p of c.content.acceptance_criteria)r.push(`- [ ] ${p}`);r.push(""),r.push("Override (only with explicit user consent): `prjct ship --no-spec-gate`."),r.push(""),console.log(r.join(`
|
|
10
|
+
`))}}catch{}if(!n.noTestGate)try{let{effectiveTddMode:t}=await import("./tdd-7S55S5C3.mjs"),c=await W.readConfig(e).catch(()=>null),r=t(c);if(r!=="off"){let h=(await K(e).catch(()=>null))?.test?.command,f=[""];r==="strict"?(f.push("## TDD gate (strict) \u2014 tests must be green before ship"),f.push(""),f.push(h?`Run \`prjct tdd check\` (\`${h}\`). STOP and fix if RED.`:"No test command detected \u2014 add tests (strict TDD expects them)."),f.push("Override (only with explicit user consent): `prjct ship --no-test-gate`.")):(f.push("## TDD reminder (assist)"),f.push(""),f.push(h?`Did the change ship with tests? Verify green: \`prjct tdd check\` (\`${h}\`).`:"Consider adding a test for this change.")),f.push(""),console.log(f.join(`
|
|
11
|
+
`))}}catch{}let Ce=y.getRulesForCommand(o,"ship"),X=n.intent==="seed-code-workflow"?await ke(o,e):null;if(X===!1)return{success:!1,error:"seed-code-workflow requested but this project does not look like code (no package.json / Cargo.toml / pyproject.toml / VERSION). Add rules manually with `prjct workflow add`."};let Z=X===!0?y.getRulesForCommand(o,"ship"):Ce,ee=!Z.some(t=>t.type==="step"&&t.position==="before")&&n.intent!=="register-only"?await ke(o,e):!1;ee&&console.log("\u2139\uFE0F Auto-seeded code ship workflow (one-time migration)");let te=ee?y.getRulesForCommand(o,"ship"):Z,_=n.intent==="pr-convention-auto"?"auto":n.intent==="pr-convention-manual"?"manual":null;_&&Ee(o,_,te);let Re=_?y.getRulesForCommand(o,"ship"):te,q=await Ne(o,e,Re,n);if(q)return He(q,n.md===!0),{success:!1,clarification:q};let w=b??await Fe(e);if(!w)return{success:!1,error:'Ship needs a release description. Pass one explicitly, e.g. `prjct ship "add universal agent compatibility"`, or ship from a named feature branch.'};let F={feature:w},v=await U(o,"ship","before",{projectPath:e,skipRules:n.skipHooks,runContext:F});if(!v.success)return{success:!1,error:`Ship blocked: ${v.gatesFailed.length>0?v.gatesFailed.join(", "):"unknown step"}`};let S=typeof F.version=="string"?F.version:"unversioned";try{R.setDoc(o,L,{feature:w,version:S,startedAt:I()})}catch{}await B.addShipped(o,{name:w,version:S});try{R.deleteDoc(o,L)}catch{}if(a)try{R.run(o,"UPDATE tasks SET shipped_at = ? WHERE id = ?",I(),a.id)}catch{}await this.logToMemory(e,"feature_shipped",{feature:w,version:S,timestamp:I()});let G=await U(o,"ship","after",{projectPath:e,skipRules:n.skipHooks,runContext:F}),ne=[...v.instructions,...G.instructions];try{await ie.sync(e)}catch(t){console.warn("\u26A0\uFE0F Failed to sync AI context after shipping:",z(t))}let xe=v.stepsRun.length+G.stepsRun.length;if(a?.id)try{let{usefulnessService:t}=await import("./usefulness-SCH5ARGV.mjs");t.creditShippedTask(o,a.id)}catch{}let E=await(async()=>{try{let{synthesizeJudgmentReceipt:t}=await import("./judgment-receipt-GWSSCLAB.mjs"),c=await t({projectId:o,projectPath:e,cycleDescription:a?.description??w,cycleId:a?.id??null});return c.wrote?c.summary??"Judgment receipt written":null}catch{return null}})();if(n.md){let t=ue("ship",!0),c=Q(ce(`Shipped: ${w}`,`Version: ${S}`),$("Results",A([`Version: ${S}`,`Workflow steps run: ${xe>0?[...v.stepsRun,...G.stepsRun].join(", "):"none"}`,`Hooks failed (non-blocking): ${v.hooksFailed.length+G.hooksFailed.length}`,E?`Compound judgment: ${E}`:null].filter(r=>r!==null))),ne.length>0?$("Agent Instructions",A(ne)):null,ae([...t.map(r=>({label:r.desc,command:r.cmd})),{label:"Capture non-obvious learning (compounds next session)",command:'prjct remember learning "\u2026"'}]));console.log(c)}else V.done(`v${S} shipped`),E&&V.info(`Compound: ${E}`),le("ship");return(async()=>{try{let{flushIfLinked:t}=await import("./auto-flush-BN6L6QHO.mjs");await t(e)}catch{}})(),{success:!0,feature:w,version:S}}catch(l){return V.fail(z(l)),re(l)}}};function ye(s){let i=s?.trim();return i||null}g(ye,"normalizeShipFeature");async function Fe(s){let i=await pe(s);if(!i)return null;let e=i.replace(/^refs\/heads\//,"").trim();if(!e||/^(main|master|develop|development|dev|trunk)$/i.test(e))return null;let n=e.split("/").filter(Boolean).at(-1)??e;if(!n||/^\d+(?:\.\d+)*$/.test(n))return null;let l=n.replace(/^[a-z]+-\d+[-_]/i,"").replace(/[_-]+/g," ").replace(/[^\p{L}\p{N} ]+/gu," ").replace(/\s+/g," ").trim();return l.length>=3?l:null}g(Fe,"inferShipFeatureFromBranch");function be(s){return["package.json","Cargo.toml","pyproject.toml","go.mod","Gemfile","pom.xml","build.gradle","VERSION"].some(e=>ve(Se.join(s,e)))}g(be,"isCodeProject");function j(s){return ve(Se.join(s,".git"))}g(j,"isGitRepo");async function ke(s,i){if(!be(i))return!1;let e=new Date().toISOString(),n=y.getRulesForCommand(s,"ship"),l=new Set(n.map(u=>u.action)),o=n.reduce((u,k)=>Math.max(u,k.sortOrder??0),0),a=[];j(i)&&a.push({action:'git branch --show-current | grep -vE "^(main|master)$"',description:"Prevent shipping from main branch",timeoutMs:5e3});let d=await K(i).catch(()=>null);d?.test?.command&&a.push({action:`verify:${d.test.command}`,description:"Verify before shipping (Stop-Slop)",timeoutMs:3e5});let b=[{action:"version:bump",description:"Bump version (stack-aware)",timeoutMs:1e4},{action:"changelog:add",description:"Append CHANGELOG entry",timeoutMs:1e4}];j(i)&&(b.push({action:"git:commit",description:"Commit ship",timeoutMs:15e3}),b.push({action:"git:push",description:"Push to origin",timeoutMs:3e4}),await Ge(s,i)==="auto"&&b.push({action:"pr:ensure",description:"Open or confirm the PR",timeoutMs:3e4}));let m=[...a.map(u=>({...u,type:"gate"})),...b.map(u=>({...u,type:"step"}))].filter(u=>!l.has(u.action));for(let[u,k]of m.entries())y.addRule(s,{type:k.type,command:"ship",position:"before",action:k.action,description:k.description,enabled:!0,timeoutMs:k.timeoutMs,sortOrder:o+u+1,createdAt:e});return m.length>0}g(ke,"seedCodeShipRules");async function Ge(s,i){let e=x.getWorkflow(s,"ship"),n=e?.metadata?.prConvention;if(n==="auto"||n==="manual")return n;let l=await fe(i),o=ge(l);return x.updateWorkflow(s,"ship",{metadata:{...e?.metadata??{},prConvention:o}}),o}g(Ge,"resolvePrConvention");function Ee(s,i,e){let n=x.getWorkflow(s,"ship");if(x.updateWorkflow(s,"ship",{metadata:{...n?.metadata??{},prConvention:i}}),i==="auto"&&!e.some(l=>l.action==="pr:ensure")){let l=e.reduce((o,a)=>Math.max(o,a.sortOrder??0),0);y.addRule(s,{type:"step",command:"ship",position:"before",action:"pr:ensure",description:"Open or confirm the PR",enabled:!0,timeoutMs:3e4,sortOrder:l+1,createdAt:new Date().toISOString()})}}g(Ee,"applyPrConventionDecision");async function Ne(s,i,e,n){if(n.intent==="proceed"||n.intent==="register-only")return null;if(!e.some(d=>d.type==="step"&&d.position==="before"))return{question:"No `ship` workflow steps are configured for this project. What should ship do?",options:["register-only","seed-code-workflow","abort"],state:{rulesCount:e.length,looksLikeCode:be(i)}};if(await Y(s,i))return null;let a=await Ie(i);return a?{question:`No active work cycle, and PR #${a.number} ("${a.title}") is OPEN for this branch. Continue ship anyway?`,options:["proceed","abort"],state:{openPr:a.number,branch:a.branch}}:j(i)&&e.some(d=>d.action==="git:push")&&!e.some(d=>d.action==="pr:ensure")&&!x.getWorkflow(s,"ship")?.metadata?.prConvention?{question:"This project ships without opening/updating a PR. Want ship to handle that automatically (`gh pr create`), or do you manage PRs yourself?",options:["pr-convention-auto","pr-convention-manual"]}:null}g(Ne,"buildClarification");function He(s,i){if(i){let e=Q($("Clarification needed",s.question),$("Options",A(s.options.map(n=>`\`prjct ship --intent=${n}\``))),s.state?$("State",A(Object.entries(s.state).map(([n,l])=>`${n}: ${JSON.stringify(l)}`))):null);console.log(e);return}console.log(`
|
|
12
12
|
\u26A0\uFE0F ${s.question}`),console.log(`
|
|
13
|
-
Options:`);for(let e of s.options)console.log(` prjct ship --intent=${e}`)}g(He,"renderClarification");async function Ie(s){if(!j(s))return null;try{let{execFileAsync:i}=await import("./exec-
|
|
13
|
+
Options:`);for(let e of s.options)console.log(` prjct ship --intent=${e}`)}g(He,"renderClarification");async function Ie(s){if(!j(s))return null;try{let{execFileAsync:i}=await import("./exec-2P5VOBHM.mjs"),{stdout:e}=await i("git",["branch","--show-current"],{cwd:s,timeout:3e3}),n=e.toString().trim();if(!n)return null;let{stdout:l}=await i("gh",["pr","list","--head",n,"--state","open","--json","number,title","--limit","1"],{cwd:s,timeout:5e3}),o=JSON.parse(l.toString());return o.length===0?null:{number:o[0].number,title:o[0].title,branch:n}}catch{return null}}g(Ie,"findOpenPrForBranch");export{we as ShippingCommands,ke as seedCodeShipRules};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{d as m,g as S}from"./chunk-
|
|
8
|
+
import{d as m,g as S}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";S();import k from"node:fs/promises";import E from"node:os";import g from"node:path";function I(t){return[{dir:g.join(t,".claude","skills"),scope:"project"},{dir:g.join(t,"skills"),scope:"project"},{dir:g.join(E.homedir(),".claude","skills"),scope:"global"}]}o(I,"skillRoots");function y(t){let s=t.replace(/^\uFEFF/,"").replace(/\r\n/g,`
|
|
9
9
|
`).match(/^---\n([\s\S]*?)\n---/);if(!s)return{};let i={},n=s[1].split(`
|
|
10
10
|
`),p=o(e=>{if(e>=n.length)return;let c=n[e].match(/^(name|description):\s*(.*)$/);if(!c){p(e+1);return}let u=c[1],l=c[2].trim(),d=/^[>|][+-]?$/.test(l)?n.slice(e+1).findIndex(f=>!/^\s+\S/.test(f)):0,a=d===-1?n.length-e-1:d,h=/^[>|][+-]?$/.test(l)?n.slice(e+1,e+1+a).map(f=>f.trim()).join(" "):l;h&&(i[u]=h.replace(/^["']|["']$/g,"")),p(e+1+a)},"parseLine");return p(0),i}o(y,"parseFrontmatter");async function F(t,r){let s=new Map;for(let{dir:n,scope:p}of I(r)){let e=await k.readdir(n).catch(()=>null);if(e)for(let c of e){let u=g.join(n,c,"SKILL.md"),l=await k.readFile(u,"utf-8").catch(()=>null);if(l===null)continue;let d=y(l),a=d.name||c;s.has(a)||s.set(a,{name:a,description:d.description??"",path:u,scope:p})}}let i=[...s.values()];try{m.run(t,"DELETE FROM skill_registry");for(let n of i)m.run(t,"INSERT OR REPLACE INTO skill_registry (name, description, path, scope, indexed_at) VALUES (?, ?, ?, ?, ?)",n.name,n.description,n.path,n.scope,Date.now())}catch{}return i}o(F,"refreshSkillIndex");function L(t){try{return m.query(t,"SELECT name, description, path, scope FROM skill_registry ORDER BY scope ASC, name ASC").map(r=>({...r,scope:r.scope}))}catch{return[]}}o(L,"getSkillIndex");function b(t){let r=L(t);if(r.length===0)return null;let s=["## Skill index \u2014 pass EXACT paths to subagents (they read the original SKILL.md; never summarize a skill for them)",""];for(let i of r)s.push(`- **${i.name}** (${i.scope}) \u2014 ${i.description||"no description"}
|
|
11
11
|
\`${i.path}\``);return s.join(`
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as D}from"./chunk-DYHYDHCW.mjs";import{a as $}from"./chunk-
|
|
8
|
+
import{a as D}from"./chunk-DYHYDHCW.mjs";import{a as $}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{a as M,p as B}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import{a as O,e as R,f as L}from"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";L();B();import z from"node:fs/promises";import S from"node:path";var j={frontend:["component","page","view","ui","layout","style","css","scss","sass","hook","context","store","redux","zustand","react","vue","svelte","angular","next","nuxt","app","client"],backend:["api","route","controller","service","middleware","handler","resolver","schema","model","entity","repository","server","socket","graphql","rest","trpc"],database:["migration","seed","schema","model","entity","repository","prisma","drizzle","sequelize","typeorm","mongoose","knex","sql","db"],auth:["auth","login","logout","session","token","jwt","oauth","passport","credential","permission","role","user","account"],testing:["test","spec","e2e","integration","unit","mock","fixture","stub","jest","vitest","cypress","playwright"],config:["config","env","setting","constant","option","tsconfig","eslint","prettier","vite","webpack","rollup"],infra:["docker","compose","kubernetes","k8s","ci","cd","github","gitlab","jenkins","terraform","ansible","deploy"],util:["util","helper","lib","common","shared","core","base","abstract"]},E=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".kt",".swift",".rb",".php",".c",".cpp",".h",".hpp",".cs",".vue",".svelte"]),A=new Set(["node_modules",".git","dist","build",".next",".nuxt",".output","coverage",".cache","__pycache__",".pytest_cache","vendor","target",".turbo",".vercel"]),I=new Set(["a","an","the","and","or","but","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","must","shall","can","need","to","of","in","for","on","with","at","by","from","as","into","through","during","before","after","above","below","between","under","again","further","then","once","here","there","when","where","why","how","all","each","few","more","most","other","some","such","no","nor","not","only","own","same","so","than","too","very","just","add","create","make","implement","fix","update","change","modify","remove","delete","new"]);async function N(n,e,o={}){let t=Date.now(),s=o.maxFiles??30,r=o.minScore??.1,i=o.includeTests??!1,u=H(n),c=await W(e),a=await q(e),m=[];for(let h of c){if(!i&&Y(h))continue;let p=G(h,u,a,o.historicalBoosts);p.score>=r&&m.push(p)}m.sort((h,p)=>p.score-h.score);let g=m.slice(0,s);return{files:g,metrics:{filesScanned:c.length,filesReturned:g.length,scanDuration:Date.now()-t}}}l(N,"findRelevantFiles");function H(n){return n.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).filter(o=>!I.has(o)&&o.length>2)}l(H,"extractKeywords");async function W(n){let e=[];async function o(t,s=""){try{let r=await z.readdir(t,{withFileTypes:!0});for(let i of r){let u=S.join(t,i.name),c=S.join(s,i.name);if(i.isDirectory()){if(A.has(i.name)||i.name.startsWith("."))continue;await o(u,c)}else if(i.isFile()){let a=S.extname(i.name).toLowerCase();E.has(a)&&e.push(c)}}}catch(r){O(r)||D.debug(`files-tool: skipped unreadable path during walk: ${R(r)}`)}}return l(o,"walk"),await o(n),e}l(W,"getAllCodeFiles");async function q(n){let e=new Map;try{let{stdout:o}=await M(`git log -30 --pretty=format:"%H %ct" --name-only | awk '
|
|
9
9
|
/^[a-f0-9]{40}/ { commit=$1; timestamp=$2; next }
|
|
10
10
|
NF { files[$0]++; if (!lastmod[$0]) lastmod[$0]=timestamp }
|
|
11
11
|
END { for (const f in files) print files[f], lastmod[f], f }
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as _,b as R,c as o}from"./chunk-
|
|
8
|
+
import{a as _,b as R,c as o}from"./chunk-KOCROTRM.mjs";import"./chunk-EHEQOF6Z.mjs";import"./chunk-DYHYDHCW.mjs";import{a as v}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import{b as y}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{e as w,g as k}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{b as P,h as A}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{b as E,p as x}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";A();x();k();import{createHash as I}from"node:crypto";function S(c){let t={goal:c.goal,eli10:c.eli10,stakes:c.stakes,acceptance_criteria:c.acceptance_criteria,scope:c.scope,out_of_scope:c.out_of_scope,risks:c.risks,test_plan:c.test_plan,scenarios:c.scenarios};return I("sha256").update(JSON.stringify(t)).digest("hex")}m(S,"computeAuditCandidateHash");function j(c,t){let e=w.get(c,"SELECT content FROM specs WHERE id = ?",t),s=(()=>{if(!e?.content)return null;try{return JSON.parse(e.content)}catch{return null}})(),r=w.query(c,"SELECT lens FROM spec_selected_reviewer WHERE spec_id = ?",t).map(a=>a.lens),n=new Set(w.query(c,"SELECT lens FROM spec_review WHERE spec_id = ? AND verdict = 'pass'",t).map(a=>a.lens));if(!(r.length>0?r.every(a=>n.has(a)):n.has("strategic")&&n.has("architecture")&&n.has("design")))return!1;let u=s?.audit_candidate_hash;if(!u)return!0;if(S(s)!==u)return!1;let l=s?.reviews??{};for(let a of r.length>0?r:Object.keys(l)){let d=l[a];if(!(!d||d.verdict!=="pass")&&d.candidateHash!==u)return!1}for(let a of r.length>0?r:["strategic","architecture","design"]){if(!n.has(a))continue;let d=l[a];if(!d||d.candidateHash!==u)return!1}return!0}m(j,"reviewsGatePassedRelational");async function D(c){try{let{stdout:t}=await E("git",["rev-parse","HEAD"],{cwd:c}),e=t.trim();return/^[0-9a-f]{7,40}$/.test(e)?e:null}catch{return null}}m(D,"readGitHead");var C=class{static{m(this,"SpecService")}async create(t,e){let s=await this.requireProjectId(t),{classifySpecCreate:r,shouldMirrorSpecToMemory:n}=await import("./precision-classifier-IVVAXE26.mjs"),p=r(e.title,e.content.goal);if(p.action==="refuse")throw new Error(`Cannot create empty spec (${p.reasonCode}): ${p.reason}`);let u=e.autoContext!==!1,l=e.content.notes??"",a=u&&!l.trim()?await import("./spec-context-inference-7DDSTRTV.mjs").then(async({inferSpecContext:h,warnNoContextMatch:f})=>{let g=await h(e.title,s,t);return g.empty&&f(e.title),g.empty?l:g.notesBlock}):l,d=_.parse({goal:e.content.goal,eli10:e.content.eli10??"",stakes:e.content.stakes??"",acceptance_criteria:e.content.acceptance_criteria??[],scope:e.content.scope??[],out_of_scope:e.content.out_of_scope??[],risks:e.content.risks??[],test_plan:e.content.test_plan??[],reviews:e.content.reviews,linked_tasks:e.content.linked_tasks??[],notes:a}),i=o.create(s,{title:e.title,content:d,tags:e.tags});return n(i.title,i.content.goal)&&await v.remember(t,{type:"spec",content:`${i.title}
|
|
9
9
|
|
|
10
10
|
Goal: ${i.content.goal}`,tags:{...e.tags??{},spec_id:i.id,status:i.status},source:i.id,provenance:"declared"}),i}async get(t,e){let s=await this.requireProjectId(t);return o.get(s,e)}async list(t,e={}){let s=await this.requireProjectId(t);return o.list(s,e)}async setStatus(t,e,s){let r=await this.requireProjectId(t),n=o.setStatus(r,e,s);return n&&await v.remember(t,{type:"spec",content:`Spec status \u2192 ${s}: ${n.title}`,tags:{spec_id:e,status:s,event:"status_change"},source:e}),n}async patch(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=_.parse({...n.content,...s});return this.update(t,e,p)}async applyDelta(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=R(n.content,s);return p===n.content?n:this.update(t,e,p)}async update(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content),u=S(s),l=p!==u,a=l?{...s,reviews:{},selected_reviewers:[],audit_candidate_hash:null}:s;return l&&(n.status==="reviewed"||n.status==="in_progress")&&o.setStatus(r,e,"draft"),o.updateContent(r,e,a)}async recordReview(t,e,s,r){let n=await this.requireProjectId(t),p=3,u=50,l=m(async d=>{let i=o.get(n,e);if(!i)return null;let h=i.content.audit_candidate_hash??S(i.content);if(i.content.audit_candidate_hash&&S(i.content)!==i.content.audit_candidate_hash)throw new Error(`SPEC_CANDIDATE_DRIFT: body no longer matches audit_candidate_hash. Re-run \`prjct spec audit ${e}\` then re-record reviews.`);let f={...r,ts:P(),candidateHash:h},g={...i.content,audit_candidate_hash:h,reviews:{...i.content.reviews??{},[s]:f}};if(o.casUpdate(n,e,g,i.updatedAt))return o.get(n,e);if(d+1>=p)throw new Error(`SPEC_RECORD_REVIEW_CONFLICT_RETRY_EXHAUSTED: ${p} retries failed for spec ${e}`);return await new Promise($=>setTimeout($,u)),l(d+1)},"attemptReview"),a=await l(0);if(a&&j(n,e)&&a.status==="draft"){let{assessAcceptanceCriteria:d}=await import("./nyquist-lite-GE7OAFLC.mjs"),i=d(a.content.acceptance_criteria??[]);if(!i.ok&&i.message){let f=await y.readConfig(t).catch(()=>null),g=f?.tdd?.mode==="strict",b=f?.sdd?.mode==="strict";if(g||b)throw new Error(`NYQUIST_LITE_BLOCK: ${i.message}
|
|
11
|
-
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-
|
|
11
|
+
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-K3GMQKGH.mjs");return await f(n,t,h),o.get(n,e)}return h}return a}async linkTask(t,e,s){let r=await this.requireProjectId(t);return o.linkTask(r,e,s)}async ship(t,e,s){let r=await this.requireProjectId(t);s!==void 0&&o.setShippedPr(r,e,s);let n=await D(t);return n&&o.setShippedSha(r,e,n),o.setStatus(r,e,"shipped")}unmetCriteria(t,e=new Set){return t.content.acceptance_criteria.filter(s=>!e.has(s))}async setSelectedReviewers(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content);return o.updateContent(r,e,{...n.content,selected_reviewers:s,audit_candidate_hash:p,reviews:{}})}async requireProjectId(t){let e=await y.readConfig(t);if(!e?.projectId)throw new Error("not a prjct project (run `prjct init` first)");return e.projectId}},oe=new C;export{oe as specService};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as m}from"./chunk-T2FCU3ZS.mjs";import{c as s}from"./chunk-KOCROTRM.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import{a as w}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{b as h,h as S}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";S();async function x(r,a,e){let o=e.content.acceptance_criteria;if(o.length===0)return{taskIds:[],skippedReason:"no_acceptance_criteria"};if(e.content.tasks_created_at!==null)return{taskIds:[],skippedReason:"already_broken_down"};let d=e.content.linked_tasks.length>0,y=(await m.getTasks(r)).filter(t=>t.featureId===e.id),g=new Set,u=o.map(t=>{let n=y.find(_=>_.body===t&&!g.has(_.id));return n&&g.add(n.id),n??null}),c=o.map((t,n)=>({ac:t,i:n})).filter(({i:t})=>u[t]===null),l=c.length>0?await m.addTasks(r,c.map(({ac:t})=>({description:I(t),body:t,priority:"medium",type:"feature",section:"backlog",featureId:e.id,groupId:e.id,groupName:e.title}))):[],b=new Map(c.map(({i:t},n)=>[t,l[n].id])),i=o.map((t,n)=>u[n]?.id??b.get(n));for(let t of i)s.linkTask(r,e.id,t);let k=s.get(r,e.id);if(k){let t={...k.content,tasks_created_at:h()};s.updateContent(r,e.id,t)}let f=i.length-l.length;return await w.remember(a,{type:"spec",content:`Auto-breakdown: ${l.length} tasks created${f>0?`, ${f} adopted`:""} from ${e.title}${d?" (recovered from partial)":""}`,tags:{spec_id:e.id,event:"auto_breakdown",task_count:String(i.length),...d?{recovered:"partial"}:{}},source:e.id}),{taskIds:i,...d?{recoveredFromPartial:!0}:{}}}p(x,"breakdownSpecToTasks");function I(r){let a=r.replace(/\s+/g," ").trim();return a.length<=140?a:`${a.slice(0,137)}\u2026`}p(I,"truncateForDescription");export{x as breakdownSpecToTasks};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a}from"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as stateStorage};
|
|
@@ -0,0 +1,16 @@
|
|
|
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 oe,b as R,d as G}from"./chunk-PW3KYKVS.mjs";import{b as se}from"./chunk-HRWXMF7P.mjs";import{a as L}from"./chunk-NCOOKPXX.mjs";import{a as ie}from"./chunk-ZJXH76Q5.mjs";import{b as re}from"./chunk-2UC4DTDO.mjs";import{a as B}from"./chunk-Y3J7UUMR.mjs";import{a as te,b as ne}from"./chunk-TRMBRDKH.mjs";import"./chunk-TPESWBA7.mjs";import{b as ee}from"./chunk-FEFP6JOL.mjs";import{c as M}from"./chunk-QPRNRLG6.mjs";import{c as Z}from"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import{a as m}from"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import{g as et,h as tt}from"./chunk-UUULLTQV.mjs";import{a as Q,c as U}from"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as v}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{a as V,b as Qe,e as b,f as Ze,g as j}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import{b as Y,h as qe,v as q,w as Ve}from"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{e as _,g as x,l as A,p as K}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as c,b as X,e as z}from"./chunk-E66B27AL.mjs";import k from"node:fs/promises";import ze from"node:path";import nt from"node:crypto";import rt from"node:fs/promises";function P(n){return typeof n=="string"?n:Array.isArray(n)?n.map(t=>{if(typeof t=="string")return t;if(t&&typeof t=="object"&&"text"in t){let e=t.text;return typeof e=="string"?e:""}return""}).join(`
|
|
9
|
+
`).trim():""}c(P,"textOf");function C(n){try{let t=X("node:fs"),s=X("node:path").join(n,".prjct","prjct.config.json"),r=t.readFileSync(s,"utf-8");return JSON.parse(r).projectId??null}catch{return null}}c(C,"projectIdFromPath");var ue="friction-detector",ae="friction-promote",ce=5,le=400,pe=160,st=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],it=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],ot=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function de(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await rt.readFile(t,"utf-8").then(at).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=ct(r);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,ce).map(p=>({category:p.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${p.category}.`,relatedRuleId:null})),a=ft(n),l=C(n)??void 0;return{...await i.slice(0,ce).reduce(async(p,f)=>{let d=await p,y=ge(f.excerpt).slice(0,12);if(a.has(y))return await pt(n,l,f).catch(()=>{}),{...d,signalsSkipped:d.signalsSkipped+1};try{return await m.remember(n,{type:"improvement-signal",content:ut(f),tags:{source:ue,category:f.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...e?{session:e}:{},key:y},provenance:"extracted",projectId:l}),a.add(y),{...d,signalsRecorded:d.signalsRecorded+1}}catch{return{...d,signalsSkipped:d.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}c(de,"detectFriction");function at(n){return R(n)}c(at,"parseJsonl");function ct(n){let t={signals:[],lastAssistantText:""};for(let e of n){let s=e.role??e.message?.role,r=P(e.content??e.message?.content);if(!r)continue;if(s==="assistant"){t.lastAssistantText=r;continue}if(s!=="user")continue;let i=lt(r.slice(0,300));i&&t.signals.push({excerpt:r.slice(0,le).trim(),category:i,precedingAssistantPreview:t.lastAssistantText.slice(0,le).trim()})}return t.signals}c(ct,"extractSignals");function lt(n){return ot.some(t=>t.test(n))?"complaint":st.some(t=>t.test(n))?"negation":it.some(t=>t.test(n))?"correction":null}c(lt,"classify");function ut(n){let t=dt(n.category),e=fe(n.excerpt),s=e?`Obey developer constraint: ${e}`:t.lesson,r=e?`Always: ${e}`:t.nextAction;return[`[${n.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${t.why}`,`Pattern: ${t.pattern}`,`Anti-pattern: ${t.antiPattern}`,`Next action: ${r}`].join(`
|
|
10
|
+
`)}c(ut,"formatSignal");function fe(n){let t=n.replace(/\s+/g," ").trim();if(!t)return null;let e=t.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=e.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return T(`Prefer ${s[1]}`);let r=e.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(r?.[1]&&r[2])return T(`Prefer ${r[1].trim()} rather than ${r[2].trim()}`);let i=e.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let u=i[2]?` instead of ${i[2].trim()}`:" instead";return T(`Use ${i[1].trim()}${u}`)}let o=e.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return T(`Avoid ${o[1].trim()}`);let a=e.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(a?.[1])return T(`Never ${a[1].trim()}`);let l=e.match(/\balways\s+(.+?)$/i);if(l?.[1])return T(`Always ${l[1].trim()}`);if(e.length>=12&&e.length<=pe&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(e)){let u=e.charAt(0).toUpperCase()+e.slice(1);return T(u.replace(/[.!?]+$/,""))}return null}c(fe,"extractSpecificConstraint");function T(n){let t=n.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,pe);return t.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(t)?null:t}c(T,"cleanConstraint");async function pt(n,t,e){if(!t)return;let s=fe(e.excerpt);if(!s)return;let r=`Always: ${s}`,i=`fp:${ge(s).slice(0,12)}`;try{if(m.recall(t,{types:["feedback"],tags:{source:ae,key:i},limit:1,dedupeByKey:!1}).length>0)return;await m.remember(n,{type:"feedback",content:r,tags:{source:ae,key:i,category:e.category,from:"recurring-friction"},provenance:"extracted",projectId:t})}catch{}}c(pt,"maybePromoteStandingPreference");function dt(n){return n==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:n==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}c(dt,"lessonTemplate");function ge(n){let t=n.toLowerCase().replace(/\s+/g," ").trim();return nt.createHash("sha256").update(t).digest("hex")}c(ge,"hashSignal");function ft(n){try{let t=C(n);if(!t)return new Set;let e=m.recall(t,{types:["improvement-signal"],tags:{source:ue},limit:100,dedupeByKey:!1}),s=new Set;for(let r of e){let i=r.tags.key;i&&s.add(i)}return s}catch{return new Set}}c(ft,"projectMemoryHashes");var gt=32;function me(n={}){let e=(n.hookHost===void 0?process.env.PRJCT_HOOK_HOST:n.hookHost)?.trim().toLowerCase().slice(0,gt);return e&&te.has(e)?e:n.detectedRuntime??ne()}c(me,"resolveInstructionRuntime");K();function he(n){try{return JSON.parse(n)}catch{return null}}c(he,"safeJsonParse");function S(n,t,e,s){let r=[];try{let{prjctDb:i}=(j(),z(Ze)),o=i.query(n,t,...e);for(let a of o){let l=he(a.data);if(!l||typeof l!="object")continue;let u=l.tags;if(!u)continue;let p=s(u,l);p!==void 0&&r.push(p)}}catch{}return r}c(S,"collectFromPersistedEvents");var we="lean-detector",mt="lean-debt-growth",ht=3,ye=["off","lite","full","ultra"];function yt(n){let t=n?.lean?.mode;if(t&&ye.includes(t))return t;let e=process.env.PRJCT_LEAN_MODE?.toLowerCase();return e&&ye.includes(e)?e:"off"}c(yt,"effectiveMode");async function be(n,t){let e={active:!1,total:0,previous:0,persisted:!1},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId||yt(s)==="off")return e;e.active=!0;try{let r=await wt(n);if(e.total=r,r===0)return e;let i=bt(s.projectId);e.previous=i;let o=r-i;i>0&&o>=ht&&(await m.remember(n,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${r}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:we,pattern:mt,total:String(r),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),e.persisted=!0)}catch{}return e}c(be,"detectAndPersistLeanDebt");async function wt(n){let t=await _(["grep","-cI","-e","lean:"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(x(t,1))return 0;A(t)}return t.stdout.split(`
|
|
11
|
+
`).reduce((e,s)=>{let r=s.lastIndexOf(":");if(r<=0)return e;let i=Number.parseInt(s.slice(r+1),10);return Number.isFinite(i)?e+i:e},0)}c(wt,"measureLeanMarkers");function bt(n){return S(n,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==we)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}c(bt,"collectPreviousSnapshot");import St from"node:path";K();var kt="hot-file",Se="pattern-detector-auto",vt="recurring-bug",ke="pattern-detector-recurring",Rt="tech-debt-growth",ve="pattern-detector-debt",D=7,Tt=3,O=30,Et=2,_t=5,At=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function Re(n,t){let e={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=t!==void 0?t:await v.readConfig(n).catch(()=>null);if(!s?.projectId)return e.errors.push("no project config"),e;try{let r=await Ct(n);if(e.scanned+=r.length,e.hotFiles=r,r.length>0){let i=Pt(s.projectId);for(let o of r){if(i.has(o.path)){e.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await m.remember(n,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${D} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:Se,pattern:kt,file:o.path,touches:String(o.touches),window_days:String(D)},provenance:"inferred"}),e.persisted+=1}catch(a){e.errors.push(`remember failed for ${o.path}: ${a.message}`)}}}}catch(r){e.errors.push(`hot-file detection failed: ${r.message}`)}try{let r=xt(s.projectId);if(r.length>0){let i=Dt(s.projectId);for(let o of r){if(i.has(o.topic)){e.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await m.remember(n,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${O} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:ke,pattern:vt,topic:o.topic,occurrences:String(o.occurrences),window_days:String(O)},provenance:"inferred"}),e.persisted+=1}catch(a){e.errors.push(`remember failed for recurring ${o.topic}: ${a.message}`)}}}}catch(r){e.errors.push(`recurring-bug detection failed: ${r.message}`)}try{let r=await Mt(n);if(r.totalCount>0){let i=Lt(s.projectId),o=r.totalCount-i;if(i>0&&o>=_t)try{await m.remember(n,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${r.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:ve,pattern:Rt,total:String(r.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),e.persisted+=1}catch(a){e.errors.push(`remember failed for tech-debt: ${a.message}`)}}}catch(r){e.errors.push(`tech-debt detection failed: ${r.message}`)}return e}c(Re,"detectAndPersistPatterns");async function Ct(n){let t=await _(["log",`--since=${D}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:n,maxBuffer:16777216,timeoutMs:15e3});if(!t.ok){if(t.kind==="exit")return[];A(t)}let e=new Map;for(let r of t.stdout.split("\0")){let i=r.trim();i&&(It(i)||e.set(i,(e.get(i)??0)+1))}let s=[];for(let[r,i]of e)i<Tt||s.push({path:r,touches:i});return s.sort((r,i)=>i.touches-r.touches),s}c(Ct,"detectHotFiles");function It(n){let t=St.basename(n);for(let e of At)if(e.test(n)||e.test(t))return!0;return!1}c(It,"isIgnored");function xt(n){let t=new Date(Date.now()-O*24*60*60*1e3).toISOString(),e=S(n,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",[t],i=>{if(i.source==="transcript-auto")return;let o=typeof i.topic=="string"?i.topic:void 0,a=typeof i.area=="string"?i.area:void 0;return(o??a)||void 0}),s=new Map;for(let i of e)s.set(i,(s.get(i)??0)+1);let r=[];for(let[i,o]of s)o<Et||r.push({topic:i,occurrences:o});return r.sort((i,o)=>o.occurrences-i.occurrences),r}c(xt,"detectRecurringBugs");async function Mt(n){let t=await _(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:n,maxBuffer:16777216});if(!t.ok){if(x(t,1))return{totalCount:0};A(t)}return{totalCount:t.stdout.split(`
|
|
12
|
+
`).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}c(Mt,"measureTechDebt");function Lt(n){return S(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],e=>{if(e.source!==ve)return;let s=typeof e.total=="string"?Number.parseInt(e.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}c(Lt,"collectPreviousDebtSnapshot");function Pt(n){let t=Date.now()-D*24*60*60*1e3,e=S(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Se)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let a=Date.parse(o);if(!Number.isNaN(a)&&a<t)return}return i}});return new Set(e)}c(Pt,"collectAlreadyMarkedHotFiles");function Dt(n){let t=Date.now()-O*24*60*60*1e3,e=S(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==ke)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let a=Date.parse(o);if(!Number.isNaN(a)&&a<t)return}return i}});return new Set(e)}c(Dt,"collectAlreadyMarkedRecurringBugs");Ve();Qe();import I from"node:fs/promises";import Te from"node:path";j();var Ot={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Nt(n=process.env){let t=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Ot[t==="conservative"||t==="standard"||t==="aggressive"?t:"standard"]}c(Nt,"resolveProfile");async function $t(n,t){let e=Date.now()-t*24*60*60*1e3,r=m.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<e);if(r.length===0)return 0;let i=[];for(let o of r)try{U.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${t}d)`});let a=o.id.startsWith("mem_")?o.id.slice(4):null;a&&b.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(a)),b.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}c($t,"archiveAgedInbox");async function Ht(n,t){if(t===null)return 0;let e=Te.join(q.getGlobalProjectPath(n),"checkpoints"),s=await I.readdir(e).catch(()=>null);if(!s)return 0;let r=Date.now()-t*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let a=Te.join(e,o);try{(await I.stat(a)).mtimeMs<r&&(await I.unlink(a),i.push(a))}catch{}}return i.length}c(Ht,"pruneOldCheckpoints");async function Ft(){let{getVerifyCachePath:n}=await import("./context7-service-V7CIDF3Q.mjs"),t=n();try{let e=await I.stat(t);if((Date.now()-e.mtimeMs)/(1440*60*1e3)>7)return await I.unlink(t),!0}catch{}return!1}c(Ft,"rotateContext7Cache");async function Ee(n){let t=Nt(),e={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1};try{e.inboxArchived=await $t(n,t.inboxDays)}catch{}try{e.archivesPruned=U.pruneOldArchives(n,t.archivesDays)}catch{}try{e.checkpointsRemoved=await Ht(n,t.checkpointsDays)}catch{}try{e.context7CacheRotated=await Ft()}catch{}return e}c(Ee,"runSessionCleanup");async function _e(n,t){if(t.inboxArchived+t.archivesPruned+t.checkpointsRemoved+(t.context7CacheRotated?1:0)===0)return;let r=`Session cleanup: ${[t.inboxArchived>0?`${t.inboxArchived} inbox archived`:null,t.archivesPruned>0?`${t.archivesPruned} archives pruned`:null,t.checkpointsRemoved>0?`${t.checkpointsRemoved} checkpoints removed`:null,t.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;b.appendEvent(n,"memory.remember.system-event",{content:r,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:V(r),project_id:n})}c(_e,"recordCleanupReport");import jt from"node:crypto";import Ut from"node:fs/promises";import{z as w}from"zod";qe();j();var Ce="crew-run:",Ae=w.object({id:w.string().min(1),spec_id:w.string().nullable().default(null),task_id:w.string().nullable().default(null),started_at:w.string().min(1),ended_at:w.string().min(1),implementer_summary:w.string().default(""),files_touched:w.array(w.string()).default([]),reviewer_verdict:w.enum(["APPROVED","CHANGES_REQUESTED"]),reviewer_notes:w.string().nullable().default(null)});function N(n){return`${Ce}${n}`}c(N,"keyFor");var J=class{static{c(this,"CrewRunStorage")}record(t,e){let s=e.runId??Q(),r=b.getDoc(t,N(s));if(r)return r;let i=Y(),o=Ae.parse({id:s,spec_id:e.specId??null,task_id:e.taskId??null,started_at:e.startedAt??i,ended_at:e.endedAt??i,implementer_summary:e.implementerSummary,files_touched:e.filesTouched,reviewer_verdict:e.reviewerVerdict,reviewer_notes:e.reviewerNotes??null});return b.setDoc(t,N(s),o),o}get(t,e){return b.getDoc(t,N(e))}list(t){return b.listDocsByPrefix(t,Ce).map(s=>Ae.parse(s.data))}delete(t,e){b.deleteDoc(t,N(e))}},Ie=new J;var Pe="skill-miss-detector",xe=3,Bt=280,Gt=["decision","gotcha","anti-pattern"],Jt=5400*1e3,Wt=360*60*1e3,Xt=2,De=5,zt=8,Oe=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function Ne(n,t,e,s={}){let r=s.preloadedLines?s.preloadedLines:await Ut.readFile(t,"utf-8").then(Yt).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=C(n);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=qt(r);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let a=(()=>{try{return en(i,e)}catch{return null}})();if(!a)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(a.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let l=await ee(n).catch(()=>[]),u=(()=>{try{let h=Date.now()-Wt;return new Set(Ie.list(i).filter(g=>Date.parse(g.ended_at)>h).flatMap(g=>g.files_touched))}catch{return new Set}})(),p=Kt(o,l,a,u);if(p.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let f=tn(i),d=[];for(let h of p.slice(0,xe)){let g=Zt(h.memId,h.excerpt).slice(0,12);if(f.has(g)){d.push("skipped");continue}try{await m.remember(n,{type:"improvement-signal",content:Qt(h),tags:{source:Pe,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:h.memId,file:h.evidenceFile,key:g,...e?{session:e}:{}},provenance:"extracted",projectId:i}),M.penalizeSkillMiss(i,h.memId),d.push("recorded")}catch{d.push("skipped")}}let y=d.filter(h=>h==="recorded").length,W=d.filter(h=>h==="skipped").length;return{signalsRecorded:y,signalsSkipped:W,failures:p.slice(0,xe).map(h=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${h.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:h.memId}))}}c(Ne,"detectSkillMisses");function Kt(n,t,e,s=new Set){let r=Me(n);if(r.size===0)return[];let i=t.filter(l=>!s.has(l)),o=$(i),a=[];for(let l of e){let u=Me(`${l.content} ${l.fileTag}`);if(u.size===0)continue;let p=l.fileTag!==""&&i.some(g=>Le(g,l.fileTag))||[...o].some(g=>u.has(g)),f=Vt(u),d=[...u].filter(g=>!f.has(g)&&r.has(g)).length;if(!(p||d>=Xt)||[...f].some(g=>r.has(g)))continue;let h=l.fileTag!==""&&i.some(g=>Le(g,l.fileTag))?l.fileTag:i.find(g=>[...$([g])].some(Ye=>u.has(Ye)))??"";a.push({miss:{memId:l.id,memType:l.type,excerpt:l.content.replace(/\s+/g," ").trim().slice(0,Bt),evidenceFile:h,reason:p?"path-overlap-unused":"topic-overlap-unused"},rank:p?2:1,overlap:d})}return a.sort((l,u)=>u.rank-l.rank||u.overlap-l.overlap),a.map(l=>l.miss)}c(Kt,"analyze");function Yt(n){return R(n)}c(Yt,"parseJsonl");function qt(n){let t=[];for(let e of n){let s=e.role??e.message?.role;if(s!=="user"&&s!=="assistant")continue;let r=P(e.content??e.message?.content);r&&t.push(r)}return t.join(`
|
|
13
|
+
`).toLowerCase()}c(qt,"transcriptTextOf");function Me(n){let t=new Set;for(let e of n.toLowerCase().split(/[^a-z0-9]+/))e.length<De||Oe.has(e)||t.add(e);return t}c(Me,"tokenize");function Vt(n){let t=[...n].filter(s=>s.length>=zt);if(t.length>0)return new Set(t);let e=[...n].sort((s,r)=>r.length-s.length||s.localeCompare(r))[0]??"";return e?new Set([e]):new Set}c(Vt,"signatureOf");function $(n){let t=new Set;for(let e of n)for(let s of e.split("/")){let r=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();r.length>=De&&!Oe.has(r)&&t.add(r)}return t}c($,"fileStems");function Le(n,t){let e=$([n]);for(let s of $([t]))if(e.has(s))return!0;return!1}c(Le,"sharesStem");function Qt(n){let t=n.evidenceFile!==""?`touched \`${n.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${n.memType}, ${n.memId}): "${n.excerpt}"`,`This session ${t} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${n.memId}`].join(`
|
|
14
|
+
`)}c(Qt,"formatSkillMiss");function Zt(n,t){let e=`${n}::${t.toLowerCase().replace(/\s+/g," ").trim()}`;return jt.createHash("sha256").update(e).digest("hex")}c(Zt,"hashKey");function en(n,t){let e=m.recall(n,{types:[...Gt],limit:120}),s=Date.now()-Jt,r=[];for(let i of e)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||t&&i.tags.session===t||r.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return r}c(en,"recallCandidates");function tn(n){try{let t=m.recall(n,{types:["improvement-signal"],tags:{source:Pe},limit:100,dedupeByKey:!1}),e=new Set;for(let s of t)s.tags.key&&e.add(s.tags.key);return e}catch{return new Set}}c(tn,"existingSkillMissKeys");import nn from"node:crypto";import rn from"node:fs/promises";var Fe="transcript-auto",sn="v2",je=80,Ue=20,H=1500,on=12,$e=4,an=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],Be=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function Ge(n,t,e,s={}){let r={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await v.readConfig(n).catch(()=>null);if(!i?.projectId)return r.errors.push("no project config"),r;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return R(await rn.readFile(t,"utf-8"))}catch(d){return r.errors.push(`transcript read failed: ${d.message}`),null}})();if(o===null)return r;let a=cn(o),l=ln(o);if(r.scanned=a.length+l.length,a.length===0&&l.length===0)return r;let u=[...fn(a),...pn(l)];if(u.length===0)return r;let p=mn(i.projectId),f=e?e.slice(0,12):"unknown";for(let d of u){if(p.has(d.hash)){r.skipped.push({reason:"duplicate",phrase:d.matchedPhrase});continue}try{await m.remember(n,{type:d.type,content:d.content,tags:{source:Fe,capture:sn,session:f,hash:d.hash,phrase:d.matchedPhrase},provenance:"inferred",projectId:i.projectId}),r.ingested+=1}catch(y){r.errors.push(`remember failed: ${y.message}`)}}return r}c(Ge,"ingestTranscript");function cn(n){let t=[];for(let e of n){let s=Je(e);if(s!=="assistant")continue;let r=We(e);!r||r.length<je||t.push({role:s,text:r})}return t}c(cn,"projectMessages");function ln(n){let t=[];for(let e of n){let s=Je(e);if(s!=="user")continue;let r=We(e);!r||r.length<Ue||t.push({role:s,text:r})}return t}c(ln,"projectUserMessages");var un=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function pn(n){let t=[],e=new Set;for(let s of n){if(t.length>=$e)break;let r=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=Ue),i=r.length>0?r:[s.text.trim()];for(let o of i){if(t.length>=$e)break;let a=un.find(p=>p.re.test(o));if(!a)continue;let l=o.length>H?`${o.slice(0,H)}\u2026`:o,u=Xe(l);e.has(u)||(e.add(u),t.push({type:"feedback",content:l,hash:u,matchedPhrase:a.phrase}))}}return t}c(pn,"extractUserPreferenceCandidates");function Je(n){let t=n.role;if(typeof t=="string")return He(t);let e=n.message;if(e&&typeof e=="object"&&"role"in e){let r=e.role;if(typeof r=="string")return He(r)}let s=n.type;return s==="assistant"||s==="user"||s==="system"?s:null}c(Je,"inferRole");function He(n){let t=n.toLowerCase();return t==="assistant"||t==="user"||t==="system"?t:null}c(He,"normalizeRole");function We(n){let t=n.content===void 0&&n.message&&typeof n.message=="object"?n.message.content:n.content;if(typeof t=="string")return t.trim();if(Array.isArray(t)){let e=[];for(let s of t){if(!s||typeof s!="object")continue;let r=s;r.type==="text"&&typeof r.text=="string"&&e.push(r.text)}return e.join(`
|
|
15
|
+
`).trim()}return""}c(We,"extractText");function dn(n){let t=n.trim();if(t.length<je)return null;for(let r of Be)if(r.re.test(t))return{type:r.type,matchedPhrase:r.phrase};let e=t.toLowerCase(),s=an.find(r=>e.includes(r.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}c(dn,"classifyCaptureParagraph");function fn(n){let t=[],e=new Set;for(let s of n){let r=gn(s.text);for(let i of r){if(t.length>=on)return t;let o=dn(i);if(!o)continue;let a=i.length>H?`${i.slice(0,H)}\u2026`:i,l=Xe(a);e.has(l)||(e.add(l),t.push({type:o.type,content:a,hash:l,matchedPhrase:o.matchedPhrase}))}}return t}c(fn,"extractCandidates");function gn(n){let t=n.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),e=[];for(let s of t){let r=s.split(`
|
|
16
|
+
`).map(o=>o.trim()).filter(Boolean);if(r.some(o=>Be.some(a=>a.re.test(o)))&&r.length>1)for(let o of r)e.push(o);else e.push(s)}return e}c(gn,"splitParagraphs");function Xe(n){return nn.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}c(Xe,"hashContent");function mn(n){try{let{REMEMBER_EVENT_RANGE:t}=(tt(),z(et)),e=S(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...t],s=>{if(s.source!==Fe)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(e)}catch{return new Set}}c(mn,"collectExistingAutoHashes");var F=600*1e3,E=new Map;function hn(n){let t=n.replace(/[^a-zA-Z0-9._-]/g,"_");return ze.join(re.runDir(),`stop-heavy-${t}.stamp`)}c(hn,"heavyStepStampPath");async function Ke(n,t,e=!0){if(await k.stat(n).then(i=>t-i.mtimeMs<F).catch(()=>!1))return!1;let r=`${n}.lock`;try{await k.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await k.stat(r).then(a=>t-a.mtimeMs>=F).catch(()=>!1)||!e?!1:(await k.rmdir(r).catch(()=>{}),Ke(n,t,!1))}try{return await k.stat(n).then(o=>t-o.mtimeMs<F).catch(()=>!1)?!1:(await k.writeFile(n,String(t)),!0)}finally{await k.rmdir(r).catch(()=>{})}}c(Ke,"claimHeavyStep");async function yn(n){let t=Date.now(),e=E.get(n)??0;if(t-e<F)return!1;try{let s=hn(n);await k.mkdir(ze.dirname(s),{recursive:!0});let r=await Ke(s,t);return E.size>32&&E.clear(),E.set(n,t),r}catch{}return E.size>32&&E.clear(),E.set(n,t),!0}c(yn,"heavyStepsDue");function Wr(n=process.cwd(),t){return ie({event:"Stop",projectPath:n,afterEmit:c(async(e,s)=>{let r=await v.readConfig(s).catch(()=>null);if(!r?.projectId)return;let i=me(),o=await yn(r.projectId),a={};if(o&&e.transcript_path){let u=await k.readFile(e.transcript_path,"utf-8").catch(()=>null);u!==null&&(a.transcriptLines=R(u))}let l=oe(a.transcriptLines??[]);if(o)try{let{collectActiveTasks:u}=await import("./task-overview-ITY5OSHX.mjs"),p=await u(r.projectId,s);a.activeTaskId=p.current?.id,a.activeTaskDescription=p.current?.description,a.activeTaskStartedAt=p.current?.startedAt}catch{}if(a.transcriptLines&&a.transcriptLines.length>0)try{if(a.transcriptUsage=G(a.transcriptLines),a.transcriptUsage.tokensIn+a.transcriptUsage.tokensOut>0){let u=a.activeTaskStartedAt?{sinceIso:a.activeTaskStartedAt}:void 0,p=G(a.transcriptLines,u);if(a.activeTaskId&&p.tokensIn+p.tokensOut>0){B(r.projectId,a.activeTaskId,p.tokensIn,p.tokensOut,{description:a.activeTaskDescription,agent:i,source:`${i}-transcript`});try{let{sumTranscriptUsageByModel:f}=await import("./transcript-jsonl-6X4DDD6R.mjs");for(let[d,y]of f(a.transcriptLines,u))y.tokensIn+y.tokensOut<=0||B(r.projectId,a.activeTaskId,y.tokensIn,y.tokensOut,{model:d,agent:i,source:`${i}-transcript:${d}`})}catch{}}}}catch{}if(se({projectId:r.projectId,sessionId:e.session_id,directory:s,taskId:a.activeTaskId,goal:a.activeTaskDescription,tokensIn:a.transcriptUsage?.tokensIn,tokensOut:a.transcriptUsage?.tokensOut,agent:i,model:l}),o&&e.transcript_path)try{await Ge(s,e.transcript_path,e.session_id??null,{preloadedConfig:r,preloadedLines:a.transcriptLines})}catch{}if(o){try{await Re(s,r)}catch{}try{await be(s,r)}catch{}try{let u=await Ee(r.projectId);await _e(r.projectId,u),L.pruneRetained(r.projectId)}catch{}}if(o&&e.transcript_path)try{let u=await de(s,e.transcript_path,e.session_id??null,{preloadedLines:a.transcriptLines,runtime:i,model:l});for(let p of u.failures)try{L.record(r.projectId,{source:"friction-detector",runtime:i,model:l,sessionId:e.session_id??null,taskId:a.activeTaskId??null,...p})}catch{}u.signalsRecorded>0&&a.activeTaskId&&M.penalizeSurfaced(r.projectId,a.activeTaskId)}catch{}if(o&&e.transcript_path)try{let u=await Ne(s,e.transcript_path,e.session_id??null,{preloadedLines:a.transcriptLines,runtime:i,model:l});for(let p of u.failures)try{L.record(r.projectId,{source:"skill-miss-detector",runtime:i,model:l,sessionId:e.session_id??null,taskId:a.activeTaskId??null,...p})}catch{}}catch{}if(o)try{await Z.backfill(r.projectId,r,new Date().toISOString())}catch{}if(o&&a.activeTaskId){let u={projectId:r.projectId,projectPath:s,cycleDescription:a.activeTaskDescription??null,cycleId:a.activeTaskId,tokensIn:a.transcriptUsage?.tokensIn,tokensOut:a.transcriptUsage?.tokensOut,model:l},p=c(async f=>{try{await f()}catch{}},"runBestEffort");await p(async()=>{let{synthesizeLandHandoff:f}=await import("./land-synthesis-WG5JAS7B.mjs");await f(u)}),await p(async()=>{let{synthesizeJudgmentReceipt:f}=await import("./judgment-receipt-GWSSCLAB.mjs");await f(u)})}try{let{flushIfLinked:u}=await import("./auto-flush-BN6L6QHO.mjs");await u(s,r)}catch{}},"afterEmit")},t)}c(Wr,"runStopHook");export{hn as heavyStepStampPath,yn as heavyStepsDue,Wr as runStopHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{b as a}from"./chunk-NUJASVHN.mjs";import"./chunk-HRWXMF7P.mjs";import{a as i}from"./chunk-ZJXH76Q5.mjs";import"./chunk-PUHX3ECX.mjs";import"./chunk-Q3EYM4GJ.mjs";import"./chunk-AZYQFRPJ.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-HHIGNKDO.mjs";import"./chunk-7GNWHWOO.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-QPRNRLG6.mjs";import"./chunk-7JEKBJAP.mjs";import"./chunk-MI3JEFON.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-27XFSCOE.mjs";import"./chunk-YUKGWWL7.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import{d as e,g as m}from"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-ITY5OSHX.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as f,b as p}from"./chunk-OWOPA2O7.mjs";import{a as s}from"./chunk-ZJXH76Q5.mjs";import{a}from"./chunk-D6IONKRA.mjs";import{a as c}from"./chunk-T2FCU3ZS.mjs";import"./chunk-JCYXFHQZ.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-6UH244CC.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-INXNK57E.mjs";import"./chunk-5EQLQ7GF.mjs";import"./chunk-UA4Z5TGG.mjs";import"./chunk-TG5CQJD5.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-DRGI5UHQ.mjs";import"./chunk-GAOQHD5S.mjs";import{b as r}from"./chunk-AZHE4VOM.mjs";import"./chunk-6RLCUGGG.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-EMTCZG5I.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";function w(u=process.cwd(),g){return s({event:"SubagentStop",projectPath:u,afterEmit:i(async(d,n)=>{let o=await r.readConfig(n).catch(()=>null);if(!o?.projectId||f(o)==="off")return;let e=[];try{let t=await a(o.projectId,n);t.current&&e.push(`active: ${t.current.description}`)}catch{}try{let t=await c.getActiveTasks(o.projectId);t.length>0&&e.push(`pending: ${t.length}`)}catch{}await p("prjct \u2014 subagent finished",e.join(" \xB7 ")||"A subagent finished")},"afterEmit")},g)}i(w,"runSubagentStopHook");export{w as runSubagentStopHook};
|
package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-K37N2NK7.mjs}
RENAMED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a}from"./chunk-
|
|
8
|
+
import{a}from"./chunk-3VWBNLBC.mjs";import"./chunk-QPRNRLG6.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as recordSurfacedForActiveTask};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f,i as g,j as h,k as i,l as j,m as k,n as l,o as m,p as n}from"./chunk-7GNWHWOO.mjs";import"./chunk-KG7Z6OMK.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as extractFile,l as fileFanIn,m as fileFanInByFile,n as filesCallingInto,e as hasSymbolIndex,c as indexSymbols,g as listAllSymbols,f as loadMeta,i as scoreFilesFromQuery,h as searchSymbols,a as stripNoise,j as symbolsInFile,k as tracePath,d as updateSymbols};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d}from"./chunk-
|
|
8
|
+
import{a,b,c,d}from"./chunk-LNB2GLYI.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as analyzeGit,c as detectCommands,d as detectStack,b as gatherStats};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as a,d as b}from"./chunk-
|
|
8
|
+
import{c as a,d as b}from"./chunk-OIU4Y5WL.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-TYEAIX3X.mjs";import"./chunk-JAMSIKDE.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as default,a as syncClient};
|