prjct-cli 3.96.0 → 3.97.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/bin/prjct.cjs +14 -0
- package/dist/bin/core-chunks/agent-HCP5FF77.mjs +31 -0
- package/dist/bin/core-chunks/agent-codenames-7N4DU62I.mjs +7 -0
- package/dist/bin/core-chunks/agent-identity-4KFRR5OU.mjs +7 -0
- package/dist/bin/core-chunks/agent-runtime-registry-3RMVBEV2.mjs +7 -0
- package/dist/bin/core-chunks/agent-switch-AVSX6SLY.mjs +7 -0
- package/dist/bin/core-chunks/agents-OAQXBGH3.mjs +10 -0
- package/dist/bin/core-chunks/ai-provider-RVXK7D7R.mjs +7 -0
- package/dist/bin/core-chunks/analysis-3A7ODSSI.mjs +41 -0
- package/dist/bin/core-chunks/auth-config-KWLVKHCY.mjs +7 -0
- package/dist/bin/core-chunks/auto-flush-EWSVMKQN.mjs +7 -0
- package/dist/bin/core-chunks/auto-updater-PKYQRBGQ.mjs +8 -0
- package/dist/bin/core-chunks/bin-commands-LLHG2NSY.mjs +21 -0
- package/dist/bin/core-chunks/capture-7LQ52T6L.mjs +7 -0
- package/dist/bin/core-chunks/capture-gate-M4HM7WAI.mjs +7 -0
- package/dist/bin/core-chunks/ceremonies-4OZ3FKRE.mjs +19 -0
- package/dist/bin/core-chunks/changelog-CUNVCEL5.mjs +10 -0
- package/dist/bin/core-chunks/chunk-225DWS4D.mjs +7 -0
- package/dist/bin/core-chunks/chunk-24EN5Y62.mjs +48 -0
- package/dist/bin/core-chunks/chunk-2EEMQV7N.mjs +9 -0
- package/dist/bin/core-chunks/chunk-2I5PUQWY.mjs +7 -0
- package/dist/bin/core-chunks/chunk-2JJM3YMW.mjs +44 -0
- package/dist/bin/core-chunks/chunk-2NI4EEK2.mjs +8 -0
- package/dist/bin/core-chunks/chunk-2TJRTFIS.mjs +9 -0
- package/dist/bin/core-chunks/chunk-2ZPM4Z6W.mjs +17 -0
- package/dist/bin/core-chunks/chunk-3FXNIJCS.mjs +8 -0
- package/dist/bin/core-chunks/chunk-3JD6KRNJ.mjs +8 -0
- package/dist/bin/core-chunks/chunk-3TRXQAU4.mjs +7 -0
- package/dist/bin/core-chunks/chunk-3USVY66O.mjs +7 -0
- package/dist/bin/core-chunks/chunk-45LKWJ5D.mjs +7 -0
- package/dist/bin/core-chunks/chunk-4IE7LRH3.mjs +7 -0
- package/dist/bin/core-chunks/chunk-4MR5XSLO.mjs +8 -0
- package/dist/bin/core-chunks/chunk-4PPIE6GA.mjs +102 -0
- package/dist/bin/core-chunks/chunk-4PRD4EU2.mjs +7 -0
- package/dist/bin/core-chunks/chunk-4T7NGLNQ.mjs +16 -0
- package/dist/bin/core-chunks/chunk-53ZPEZLU.mjs +8 -0
- package/dist/bin/core-chunks/chunk-56FW4P6U.mjs +10 -0
- package/dist/bin/core-chunks/chunk-5EF5EOCL.mjs +7 -0
- package/dist/bin/core-chunks/chunk-5MN22JFI.mjs +19 -0
- package/dist/bin/core-chunks/chunk-5ONMON5L.mjs +13 -0
- package/dist/bin/core-chunks/chunk-5UUITMRX.mjs +9 -0
- package/dist/bin/core-chunks/chunk-5YLI5V3Q.mjs +8 -0
- package/dist/bin/core-chunks/chunk-5YSPND5J.mjs +9 -0
- package/dist/bin/core-chunks/chunk-623SNKDH.mjs +7 -0
- package/dist/bin/core-chunks/chunk-6AFXUX2M.mjs +9 -0
- package/dist/bin/core-chunks/chunk-6FFOWWH2.mjs +17 -0
- package/dist/bin/core-chunks/chunk-6FUCOGOW.mjs +7 -0
- package/dist/bin/core-chunks/chunk-6OYLZ4NM.mjs +10 -0
- package/dist/bin/core-chunks/chunk-6P4GMVUZ.mjs +18 -0
- package/dist/bin/core-chunks/chunk-6RT2P22O.mjs +7 -0
- package/dist/bin/core-chunks/chunk-6XTLPAPZ.mjs +15 -0
- package/dist/bin/core-chunks/chunk-76YMLNLF.mjs +7 -0
- package/dist/bin/core-chunks/chunk-7CI4AMVO.mjs +7 -0
- package/dist/bin/core-chunks/chunk-7QMBIMEX.mjs +64 -0
- package/dist/bin/core-chunks/chunk-7QTE6X4J.mjs +7 -0
- package/dist/bin/core-chunks/chunk-7ZHWJSW5.mjs +8 -0
- package/dist/bin/core-chunks/chunk-AJTBFIH2.mjs +9 -0
- package/dist/bin/core-chunks/chunk-AJXELVNH.mjs +7 -0
- package/dist/bin/core-chunks/chunk-ANVCA6LF.mjs +7 -0
- package/dist/bin/core-chunks/chunk-AS3LWTQ4.mjs +16 -0
- package/dist/bin/core-chunks/chunk-B7AQHL7B.mjs +7 -0
- package/dist/bin/core-chunks/chunk-BQKDJ3U6.mjs +8 -0
- package/dist/bin/core-chunks/chunk-BSR3XUBD.mjs +24 -0
- package/dist/bin/core-chunks/chunk-BTCCUMKI.mjs +12 -0
- package/dist/bin/core-chunks/chunk-BTSHD3XJ.mjs +9 -0
- package/dist/bin/core-chunks/chunk-C35JQUWD.mjs +8 -0
- package/dist/bin/core-chunks/chunk-C7YBUD4K.mjs +10 -0
- package/dist/bin/core-chunks/chunk-CDLZLTRY.mjs +10 -0
- package/dist/bin/core-chunks/chunk-CEOTHJIY.mjs +10 -0
- package/dist/bin/core-chunks/chunk-CFD6CW7T.mjs +46 -0
- package/dist/bin/core-chunks/chunk-CKYBGRCF.mjs +8 -0
- package/dist/bin/core-chunks/chunk-CNWEQUB7.mjs +7 -0
- package/dist/bin/core-chunks/chunk-CUIB6CTG.mjs +20 -0
- package/dist/bin/core-chunks/chunk-CWLGRKA7.mjs +6 -0
- package/dist/bin/core-chunks/chunk-CXNVDJNN.mjs +7 -0
- package/dist/bin/core-chunks/chunk-D62TAZG6.mjs +9 -0
- package/dist/bin/core-chunks/chunk-DCVPNFS4.mjs +8 -0
- package/dist/bin/core-chunks/chunk-DEYAQEF5.mjs +7 -0
- package/dist/bin/core-chunks/chunk-DIEPWXJJ.mjs +7 -0
- package/dist/bin/core-chunks/chunk-DMO3ZFUG.mjs +1259 -0
- package/dist/bin/core-chunks/chunk-DN46DLU3.mjs +10 -0
- package/dist/bin/core-chunks/chunk-DOJPSIMG.mjs +7 -0
- package/dist/bin/core-chunks/chunk-DZVOFEM5.mjs +7 -0
- package/dist/bin/core-chunks/chunk-E5QQDYBR.mjs +7 -0
- package/dist/bin/core-chunks/chunk-E73HSXCX.mjs +7 -0
- package/dist/bin/core-chunks/chunk-EFSPBB4S.mjs +8 -0
- package/dist/bin/core-chunks/chunk-EHVU2SMR.mjs +34 -0
- package/dist/bin/core-chunks/chunk-ESB4ALH2.mjs +7 -0
- package/dist/bin/core-chunks/chunk-EZRNQXCC.mjs +7 -0
- package/dist/bin/core-chunks/chunk-F2FKQUYE.mjs +19 -0
- package/dist/bin/core-chunks/chunk-F7OOBAJO.mjs +30 -0
- package/dist/bin/core-chunks/chunk-FATYLG3L.mjs +14 -0
- package/dist/bin/core-chunks/chunk-FOWTB762.mjs +7 -0
- package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +14 -0
- package/dist/bin/core-chunks/chunk-GGGDYL4P.mjs +7 -0
- package/dist/bin/core-chunks/chunk-GHSRH4GL.mjs +8 -0
- package/dist/bin/core-chunks/chunk-GOIBJ7PV.mjs +7 -0
- package/dist/bin/core-chunks/chunk-GSNQKBHZ.mjs +11 -0
- package/dist/bin/core-chunks/chunk-GTG67Z45.mjs +11 -0
- package/dist/bin/core-chunks/chunk-H2KNJUPN.mjs +23 -0
- package/dist/bin/core-chunks/chunk-HCPQZRR3.mjs +7 -0
- package/dist/bin/core-chunks/chunk-HEXSVBUP.mjs +8 -0
- package/dist/bin/core-chunks/chunk-HPCSSJXH.mjs +7 -0
- package/dist/bin/core-chunks/chunk-HU5ERAAV.mjs +8 -0
- package/dist/bin/core-chunks/chunk-HYIT7MF5.mjs +8 -0
- package/dist/bin/core-chunks/chunk-HYMJVHAX.mjs +13 -0
- package/dist/bin/core-chunks/chunk-ID2C2S33.mjs +18 -0
- package/dist/bin/core-chunks/chunk-ID5KE74L.mjs +7 -0
- package/dist/bin/core-chunks/chunk-IFLBZKKK.mjs +14 -0
- package/dist/bin/core-chunks/chunk-IMQCXC3R.mjs +30 -0
- package/dist/bin/core-chunks/chunk-INJ5WT2D.mjs +7 -0
- package/dist/bin/core-chunks/chunk-INM5COWM.mjs +7 -0
- package/dist/bin/core-chunks/chunk-IOFCSTGM.mjs +7 -0
- package/dist/bin/core-chunks/chunk-IVGWOY3U.mjs +8 -0
- package/dist/bin/core-chunks/chunk-J7T5IEFJ.mjs +15 -0
- package/dist/bin/core-chunks/chunk-JCWA7NLM.mjs +7 -0
- package/dist/bin/core-chunks/chunk-JPMUJY42.mjs +7 -0
- package/dist/bin/core-chunks/chunk-JT4RNQ67.mjs +15 -0
- package/dist/bin/core-chunks/chunk-K25HGTC3.mjs +10 -0
- package/dist/bin/core-chunks/chunk-KIRU4QFX.mjs +7 -0
- package/dist/bin/core-chunks/chunk-KKIJAEYU.mjs +7 -0
- package/dist/bin/core-chunks/chunk-KPR5TWSN.mjs +7 -0
- package/dist/bin/core-chunks/chunk-KUQLXY2P.mjs +11 -0
- package/dist/bin/core-chunks/chunk-KWC2PCPC.mjs +10 -0
- package/dist/bin/core-chunks/chunk-L4TUXFCL.mjs +7 -0
- package/dist/bin/core-chunks/chunk-L5LFLI4R.mjs +7 -0
- package/dist/bin/core-chunks/chunk-LZC6NGB6.mjs +50 -0
- package/dist/bin/core-chunks/chunk-MCY7OXED.mjs +10 -0
- package/dist/bin/core-chunks/chunk-MDONTD7O.mjs +21 -0
- package/dist/bin/core-chunks/chunk-MG3YN3AI.mjs +7 -0
- package/dist/bin/core-chunks/chunk-MR5XXHRK.mjs +8 -0
- package/dist/bin/core-chunks/chunk-MTDCRYLP.mjs +7 -0
- package/dist/bin/core-chunks/chunk-MXJKULJY.mjs +9 -0
- package/dist/bin/core-chunks/chunk-NINFE7GS.mjs +9 -0
- package/dist/bin/core-chunks/chunk-NNOX3UU4.mjs +7 -0
- package/dist/bin/core-chunks/chunk-NOHSLOLL.mjs +7 -0
- package/dist/bin/core-chunks/chunk-NXUIMC22.mjs +13 -0
- package/dist/bin/core-chunks/chunk-NZKUCQZK.mjs +8 -0
- package/dist/bin/core-chunks/chunk-O5N6XYPU.mjs +8 -0
- package/dist/bin/core-chunks/chunk-OIE3AKKO.mjs +7 -0
- package/dist/bin/core-chunks/chunk-OYXQRBVM.mjs +10 -0
- package/dist/bin/core-chunks/chunk-P2KU4FFA.mjs +11 -0
- package/dist/bin/core-chunks/chunk-P53YMOKR.mjs +7 -0
- package/dist/bin/core-chunks/chunk-PIA26GWG.mjs +7 -0
- package/dist/bin/core-chunks/chunk-PPERWRFS.mjs +13 -0
- package/dist/bin/core-chunks/chunk-PPSVWUXC.mjs +15 -0
- package/dist/bin/core-chunks/chunk-PWL3KS7Y.mjs +7 -0
- package/dist/bin/core-chunks/chunk-Q3LUL6LL.mjs +7 -0
- package/dist/bin/core-chunks/chunk-Q6C27OL7.mjs +7 -0
- package/dist/bin/core-chunks/chunk-QAIEAOJF.mjs +7 -0
- package/dist/bin/core-chunks/chunk-QLMZW4K7.mjs +7 -0
- package/dist/bin/core-chunks/chunk-QZ7T2EYR.mjs +25 -0
- package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +7 -0
- package/dist/bin/core-chunks/chunk-RACISWUV.mjs +10 -0
- package/dist/bin/core-chunks/chunk-RCIWCKL7.mjs +9 -0
- package/dist/bin/core-chunks/chunk-ROOCBUKH.mjs +8 -0
- package/dist/bin/core-chunks/chunk-RP7F67ZT.mjs +7 -0
- package/dist/bin/core-chunks/chunk-RXXXA7Z6.mjs +7 -0
- package/dist/bin/core-chunks/chunk-RXZJB43D.mjs +7 -0
- package/dist/bin/core-chunks/chunk-S6FBPXQL.mjs +9 -0
- package/dist/bin/core-chunks/chunk-SLYLGDX7.mjs +8 -0
- package/dist/bin/core-chunks/chunk-SO3ZPNWT.mjs +7 -0
- package/dist/bin/core-chunks/chunk-SRJEX6XF.mjs +12 -0
- package/dist/bin/core-chunks/chunk-SROBBOJB.mjs +11 -0
- package/dist/bin/core-chunks/chunk-TDTPDVUM.mjs +8 -0
- package/dist/bin/core-chunks/chunk-TGNZI4KF.mjs +28 -0
- package/dist/bin/core-chunks/chunk-TIBYHZFA.mjs +8 -0
- package/dist/bin/core-chunks/chunk-TILUQF6L.mjs +8 -0
- package/dist/bin/core-chunks/chunk-TTN2CFZC.mjs +7 -0
- package/dist/bin/core-chunks/chunk-U24YKPYX.mjs +7 -0
- package/dist/bin/core-chunks/chunk-U55OPVYR.mjs +9 -0
- package/dist/bin/core-chunks/chunk-UE3XKXWM.mjs +7 -0
- package/dist/bin/core-chunks/chunk-UHXV7MDW.mjs +12 -0
- package/dist/bin/core-chunks/chunk-UNNY2IWZ.mjs +9 -0
- package/dist/bin/core-chunks/chunk-UT425KVX.mjs +10 -0
- package/dist/bin/core-chunks/chunk-UYMZ3NAF.mjs +8 -0
- package/dist/bin/core-chunks/chunk-V3Y3G2DE.mjs +8 -0
- package/dist/bin/core-chunks/chunk-V5VCXMKO.mjs +52 -0
- package/dist/bin/core-chunks/chunk-V6L5PLD7.mjs +18 -0
- package/dist/bin/core-chunks/chunk-V7R3L54M.mjs +7 -0
- package/dist/bin/core-chunks/chunk-V7VA4EQX.mjs +7 -0
- package/dist/bin/core-chunks/chunk-VCSESVZ4.mjs +9 -0
- package/dist/bin/core-chunks/chunk-VCYVYFWE.mjs +9 -0
- package/dist/bin/core-chunks/chunk-VDXTMAMO.mjs +7 -0
- package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +103 -0
- package/dist/bin/core-chunks/chunk-VRFYDYQY.mjs +7 -0
- package/dist/bin/core-chunks/chunk-VWFVSNQT.mjs +7 -0
- package/dist/bin/core-chunks/chunk-WGDE3L33.mjs +7 -0
- package/dist/bin/core-chunks/chunk-WP5IU4W4.mjs +7 -0
- package/dist/bin/core-chunks/chunk-WSVMQYYU.mjs +12 -0
- package/dist/bin/core-chunks/chunk-WTDUJB4I.mjs +8 -0
- package/dist/bin/core-chunks/chunk-WZXUFSVT.mjs +25 -0
- package/dist/bin/core-chunks/chunk-X35YYOFE.mjs +18 -0
- package/dist/bin/core-chunks/chunk-X4FR5S7E.mjs +9 -0
- package/dist/bin/core-chunks/chunk-XC6YAP36.mjs +7 -0
- package/dist/bin/core-chunks/chunk-XLFEWZRA.mjs +7 -0
- package/dist/bin/core-chunks/chunk-XPRLQIVQ.mjs +7 -0
- package/dist/bin/core-chunks/chunk-XSZG3CBO.mjs +7 -0
- package/dist/bin/core-chunks/chunk-XU3BQPBU.mjs +7 -0
- package/dist/bin/core-chunks/chunk-XYDLXF5A.mjs +8 -0
- package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +7 -0
- package/dist/bin/core-chunks/chunk-Y7XOKG4O.mjs +7 -0
- package/dist/bin/core-chunks/chunk-YEALP3WX.mjs +7 -0
- package/dist/bin/core-chunks/chunk-YJOC2JJK.mjs +12 -0
- package/dist/bin/core-chunks/chunk-YLYAYRSJ.mjs +8 -0
- package/dist/bin/core-chunks/chunk-YOGI4WE6.mjs +8 -0
- package/dist/bin/core-chunks/chunk-YQ6HM3YO.mjs +10 -0
- package/dist/bin/core-chunks/chunk-YZEO5DZA.mjs +7 -0
- package/dist/bin/core-chunks/chunk-ZBBNCCGV.mjs +12 -0
- package/dist/bin/core-chunks/chunk-ZHTYSYZC.mjs +7 -0
- package/dist/bin/core-chunks/chunk-ZK7BMUMR.mjs +7 -0
- package/dist/bin/core-chunks/chunk-ZKJZDOPT.mjs +14 -0
- package/dist/bin/core-chunks/chunk-ZQHSJ6FF.mjs +20 -0
- package/dist/bin/core-chunks/chunk-ZS7XJUPE.mjs +7 -0
- package/dist/bin/core-chunks/chunk-ZXTJLMVZ.mjs +7 -0
- package/dist/bin/core-chunks/cleanup-installs-WHXUGAHM.mjs +7 -0
- package/dist/bin/core-chunks/client-D43KKUYH.mjs +8 -0
- package/dist/bin/core-chunks/closest-command-YYNABM7V.mjs +7 -0
- package/dist/bin/core-chunks/cloud-FFUJZLDV.mjs +14 -0
- package/dist/bin/core-chunks/code-SU7GCPH6.mjs +12 -0
- package/dist/bin/core-chunks/code-graph-cloud-G3WQBICY.mjs +7 -0
- package/dist/bin/core-chunks/codex-hooks-GOLMCL2Q.mjs +7 -0
- package/dist/bin/core-chunks/codex-mcp-K4X2UIQF.mjs +7 -0
- package/dist/bin/core-chunks/codex-skill-3HNVU4T4.mjs +7 -0
- package/dist/bin/core-chunks/command-installer-XIQK2G6W.mjs +7 -0
- package/dist/bin/core-chunks/config-W3RHV3GK.mjs +8 -0
- package/dist/bin/core-chunks/config-manager-QVFHXIKI.mjs +7 -0
- package/dist/bin/core-chunks/content-bound-stamp-2PJNI4JC.mjs +7 -0
- package/dist/bin/core-chunks/context-4KGTUAC4.mjs +38 -0
- package/dist/bin/core-chunks/context-DDHC7VIC.mjs +10 -0
- package/dist/bin/core-chunks/context-checkpoint-4CEUPEVG.mjs +27 -0
- package/dist/bin/core-chunks/context-pressure-5URQVNBC.mjs +7 -0
- package/dist/bin/core-chunks/context-tiers-4S6H22NP.mjs +7 -0
- package/dist/bin/core-chunks/context7-service-AZWDYK5Z.mjs +7 -0
- package/dist/bin/core-chunks/core-PR5WEQCS.mjs +70 -0
- package/dist/bin/core-chunks/crew-JQCG6NS3.mjs +24 -0
- package/dist/bin/core-chunks/cursor-hooks-DGDJVAI6.mjs +7 -0
- package/dist/bin/core-chunks/custom-workflow-storage-EBEIG54R.mjs +7 -0
- package/dist/bin/core-chunks/cwd-changed-ODKZVSPB.mjs +7 -0
- package/dist/bin/core-chunks/cycle-budget-card-H37XRAIX.mjs +7 -0
- package/dist/bin/core-chunks/daemon-2NQTBFVR.mjs +13 -0
- package/dist/bin/core-chunks/database-UU2ZXSD4.mjs +7 -0
- package/dist/bin/core-chunks/delivery-geometry-GSJ6LXUC.mjs +7 -0
- package/dist/bin/core-chunks/detect-changes-2YIEX7AY.mjs +7 -0
- package/dist/bin/core-chunks/detection-KKDZYWVD.mjs +7 -0
- package/dist/bin/core-chunks/developer-evolution-AVAXGDKQ.mjs +11 -0
- package/dist/bin/core-chunks/developer-profile-MRPBWL2K.mjs +7 -0
- package/dist/bin/core-chunks/discuss-lock-CWXKBBYJ.mjs +7 -0
- package/dist/bin/core-chunks/distill-MLDZG5RA.mjs +7 -0
- package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +7 -0
- package/dist/bin/core-chunks/doctor-service-WXLB2FEE.mjs +8 -0
- package/dist/bin/core-chunks/drift-refresh-XPJAO2B3.mjs +7 -0
- package/dist/bin/core-chunks/dynasty-outcomes-H2O546OL.mjs +11 -0
- package/dist/bin/core-chunks/editors-config-ELAQA6RV.mjs +7 -0
- package/dist/bin/core-chunks/embeddings-7A5Z5I67.mjs +7 -0
- package/dist/bin/core-chunks/enriched-recall-YXK7EIKH.mjs +7 -0
- package/dist/bin/core-chunks/eval-4YFUBFLV.mjs +76 -0
- package/dist/bin/core-chunks/exec-34V6SJYO.mjs +7 -0
- package/dist/bin/core-chunks/file-helper-LLQKU6YF.mjs +7 -0
- package/dist/bin/core-chunks/format-5V6GF6JJ.mjs +7 -0
- package/dist/bin/core-chunks/gemini-settings-ZTU3VQU3.mjs +7 -0
- package/dist/bin/core-chunks/git-context-ZSWE3KWM.mjs +8 -0
- package/dist/bin/core-chunks/git-helpers-UC53D4FT.mjs +7 -0
- package/dist/bin/core-chunks/grok-mcp-F3SRFMCW.mjs +7 -0
- package/dist/bin/core-chunks/grok-plugin-4CE2WUYI.mjs +7 -0
- package/dist/bin/core-chunks/grok-skill-GLSBOOKW.mjs +7 -0
- package/dist/bin/core-chunks/guard-FJBJ6IAE.mjs +13 -0
- package/dist/bin/core-chunks/guards-LFUFKVVH.mjs +7 -0
- package/dist/bin/core-chunks/handoff-storage-NGUA4Y2L.mjs +7 -0
- package/dist/bin/core-chunks/harness-FN3HASSA.mjs +43 -0
- package/dist/bin/core-chunks/health-W2VWME7Z.mjs +11 -0
- package/dist/bin/core-chunks/help-I37I3V2R.mjs +14 -0
- package/dist/bin/core-chunks/hooks-service-C2P5DRCH.mjs +91 -0
- package/dist/bin/core-chunks/infer-memory-file-ATP7PSAQ.mjs +7 -0
- package/dist/bin/core-chunks/install-XP4S6HWQ.mjs +9 -0
- package/dist/bin/core-chunks/judgment-GJE332LF.mjs +21 -0
- package/dist/bin/core-chunks/judgment-ledger-storage-ZTYXPMM4.mjs +7 -0
- package/dist/bin/core-chunks/judgment-orchestrator-E3SO3NVE.mjs +7 -0
- package/dist/bin/core-chunks/judgment-receipt-WT4EMCAV.mjs +7 -0
- package/dist/bin/core-chunks/kimi-hooks-2UEUIKXV.mjs +7 -0
- package/dist/bin/core-chunks/kimi-mcp-DJCXZ2JY.mjs +7 -0
- package/dist/bin/core-chunks/land-cue-5USQ64MS.mjs +8 -0
- package/dist/bin/core-chunks/land-rho-ISNVEPVC.mjs +8 -0
- package/dist/bin/core-chunks/land-synthesis-CHARJMUP.mjs +7 -0
- package/dist/bin/core-chunks/lean-L53CKZNH.mjs +34 -0
- package/dist/bin/core-chunks/legacy-crew-sweep-2TLKJTHI.mjs +23 -0
- package/dist/bin/core-chunks/living-context-contract-HZIVBMXX.mjs +7 -0
- package/dist/bin/core-chunks/llm-XMH7WTHV.mjs +18 -0
- package/dist/bin/core-chunks/mcp-FLVIZBV2.mjs +17 -0
- package/dist/bin/core-chunks/memory-dream-EJWI4FJO.mjs +14 -0
- package/dist/bin/core-chunks/memory-export-27HTNNFI.mjs +13 -0
- package/dist/bin/core-chunks/memory-index-BRZDZ2BY.mjs +7 -0
- package/dist/bin/core-chunks/notification-KJ4FQJAW.mjs +7 -0
- package/dist/bin/core-chunks/notify-76B7AICZ.mjs +9 -0
- package/dist/bin/core-chunks/nyquist-lite-A23B7G4B.mjs +9 -0
- package/dist/bin/core-chunks/one-breath-install-LVNIVN6S.mjs +7 -0
- package/dist/bin/core-chunks/opencode-mcp-5YSIYDI3.mjs +7 -0
- package/dist/bin/core-chunks/output-D27IOQXR.mjs +7 -0
- package/dist/bin/core-chunks/pack-integrity-GXN67LJB.mjs +9 -0
- package/dist/bin/core-chunks/pack-manager-46SPIPPD.mjs +7 -0
- package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +7 -0
- package/dist/bin/core-chunks/package-legitimacy-VHHGI4P7.mjs +7 -0
- package/dist/bin/core-chunks/path-manager-E5DCU5LP.mjs +7 -0
- package/dist/bin/core-chunks/performance-tracker-BFBNR3LY.mjs +7 -0
- package/dist/bin/core-chunks/pi-skill-SDHTUK3V.mjs +7 -0
- package/dist/bin/core-chunks/planning-S3MYVWH6.mjs +8 -0
- package/dist/bin/core-chunks/post-edit-5YSNEMK7.mjs +7 -0
- package/dist/bin/core-chunks/pr-convention-37YHTUKM.mjs +7 -0
- package/dist/bin/core-chunks/pre-bash-GLDILCRF.mjs +10 -0
- package/dist/bin/core-chunks/pre-commit-U6HPPNIC.mjs +7 -0
- package/dist/bin/core-chunks/pre-edit-PEYQA6P6.mjs +8 -0
- package/dist/bin/core-chunks/pre-package-76JR5GLO.mjs +7 -0
- package/dist/bin/core-chunks/pre-search-5EHNUOP3.mjs +8 -0
- package/dist/bin/core-chunks/pre-secrets-RJELPDFY.mjs +7 -0
- package/dist/bin/core-chunks/precision-classifier-AV75OEVA.mjs +7 -0
- package/dist/bin/core-chunks/precision-judgment-MCX4MIIG.mjs +7 -0
- package/dist/bin/core-chunks/preferences-BTSYWYUM.mjs +31 -0
- package/dist/bin/core-chunks/primitives-IXAYLX7U.mjs +13 -0
- package/dist/bin/core-chunks/prjct-md-SUDFWDCS.mjs +7 -0
- package/dist/bin/core-chunks/product-KKGJ6MMF.mjs +68 -0
- package/dist/bin/core-chunks/project-agent-surfaces-I2CUZUIN.mjs +7 -0
- package/dist/bin/core-chunks/project-alignment-ADKW3ZWQ.mjs +17 -0
- package/dist/bin/core-chunks/project-file-inventory-XIHHJZUP.mjs +7 -0
- package/dist/bin/core-chunks/project-memory-GYLYIJQD.mjs +7 -0
- package/dist/bin/core-chunks/project-style-evolution-5W25UPPN.mjs +7 -0
- package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +23 -0
- package/dist/bin/core-chunks/protocol-4AJ4J5SI.mjs +7 -0
- package/dist/bin/core-chunks/provider-cache-IWVTFLGT.mjs +7 -0
- package/dist/bin/core-chunks/provider-status-HQUBKMH5.mjs +7 -0
- package/dist/bin/core-chunks/publish-helper-2T2EHM3V.mjs +7 -0
- package/dist/bin/core-chunks/purge-5EPJV25P.mjs +7 -0
- package/dist/bin/core-chunks/queue-storage-BKH5XX2E.mjs +7 -0
- package/dist/bin/core-chunks/registry-LK6IQ5UX.mjs +7 -0
- package/dist/bin/core-chunks/reliability-repair-JMPZWDD4.mjs +20 -0
- package/dist/bin/core-chunks/removed-verbs-EU3WPRNK.mjs +7 -0
- package/dist/bin/core-chunks/retention-S22T3SPT.mjs +7 -0
- package/dist/bin/core-chunks/retro-CLKOHAN6.mjs +13 -0
- package/dist/bin/core-chunks/review-risk-LLLBKUXT.mjs +12 -0
- package/dist/bin/core-chunks/run-recorder-EZQ32M55.mjs +7 -0
- package/dist/bin/core-chunks/safe-artifacts-RW5WQUUJ.mjs +9 -0
- package/dist/bin/core-chunks/sdd-HE7O6N5S.mjs +9 -0
- package/dist/bin/core-chunks/seed-JX7W53E5.mjs +10 -0
- package/dist/bin/core-chunks/self-heal-DFUEKNF3.mjs +7 -0
- package/dist/bin/core-chunks/session-continuity-BFSW4OL6.mjs +10 -0
- package/dist/bin/core-chunks/session-start-HVYUKJL2.mjs +7 -0
- package/dist/bin/core-chunks/session-tracker-RG2FBWMS.mjs +7 -0
- package/dist/bin/core-chunks/settings-installer-4XHM3HAZ.mjs +7 -0
- package/dist/bin/core-chunks/setup-GHS24ER5.mjs +140 -0
- package/dist/bin/core-chunks/setup-J4JFYT63.mjs +38 -0
- package/dist/bin/core-chunks/shipping-I4D4AVTE.mjs +12 -0
- package/dist/bin/core-chunks/signals-digest-V44KYN6Z.mjs +7 -0
- package/dist/bin/core-chunks/skill-adherence-MHY4BZL4.mjs +13 -0
- package/dist/bin/core-chunks/skill-generator-LKS5BNMY.mjs +7 -0
- package/dist/bin/core-chunks/skill-index-L4UWQCQE.mjs +11 -0
- package/dist/bin/core-chunks/spec-2XXPLHUZ.mjs +27 -0
- package/dist/bin/core-chunks/spec-context-inference-THFMXC7S.mjs +9 -0
- package/dist/bin/core-chunks/spec-inventory-2TT7BTFZ.mjs +9 -0
- package/dist/bin/core-chunks/spec-service-I23KJKKP.mjs +7 -0
- package/dist/bin/core-chunks/spec-task-breakdown-HTG6ME6G.mjs +7 -0
- package/dist/bin/core-chunks/state-storage-6CGFWW5D.mjs +7 -0
- package/dist/bin/core-chunks/stdin-spill-Y2A6WOOW.mjs +7 -0
- package/dist/bin/core-chunks/stop-2H57XCGZ.mjs +15 -0
- package/dist/bin/core-chunks/subagent-start-5LPASXOS.mjs +7 -0
- package/dist/bin/core-chunks/subagent-stop-ANLSG3KN.mjs +7 -0
- package/dist/bin/core-chunks/surface-attribution-WL7S53XX.mjs +7 -0
- package/dist/bin/core-chunks/symbol-graph-PCS43SHZ.mjs +7 -0
- package/dist/bin/core-chunks/sync-analyzer-M37Q4LE4.mjs +7 -0
- package/dist/bin/core-chunks/sync-client-6TAOTJWR.mjs +7 -0
- package/dist/bin/core-chunks/sync-cursor-storage-GKO4X2QN.mjs +18 -0
- package/dist/bin/core-chunks/task-orchestration-GS4J4KGS.mjs +7 -0
- package/dist/bin/core-chunks/task-overview-XSMK7YEN.mjs +7 -0
- package/dist/bin/core-chunks/task-service-FK7FC3PE.mjs +7 -0
- package/dist/bin/core-chunks/tdd-NQDHU62B.mjs +9 -0
- package/dist/bin/core-chunks/team-XZ4Q6UBV.mjs +42 -0
- package/dist/bin/core-chunks/template-loader-33OVJ4G5.mjs +7 -0
- package/dist/bin/core-chunks/token-backfill-WPXXD5MP.mjs +12 -0
- package/dist/bin/core-chunks/token-economics-JZAQJUET.mjs +7 -0
- package/dist/bin/core-chunks/transcript-jsonl-OC7TH4Q3.mjs +7 -0
- package/dist/bin/core-chunks/trust-boundary-24F662RM.mjs +7 -0
- package/dist/bin/core-chunks/uninstall-6NFON7FO.mjs +13 -0
- package/dist/bin/core-chunks/update-4IE6SA6M.mjs +11 -0
- package/dist/bin/core-chunks/update-checker-FK7MWNWN.mjs +7 -0
- package/dist/bin/core-chunks/usefulness-A3GRKFL3.mjs +7 -0
- package/dist/bin/core-chunks/user-home-BODIAXR4.mjs +7 -0
- package/dist/bin/core-chunks/vault-retire-notice-FDRT7BJG.mjs +8 -0
- package/dist/bin/core-chunks/velocity-storage-5T7RYOWH.mjs +7 -0
- package/dist/bin/core-chunks/verb-names-QWGYABFH.mjs +7 -0
- package/dist/bin/core-chunks/version-252QLBN2.mjs +7 -0
- package/dist/bin/core-chunks/watch-service-7ZERG7RC.mjs +9 -0
- package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +7 -0
- package/dist/bin/core-chunks/weak-model-mode-DH66XMD2.mjs +7 -0
- package/dist/bin/core-chunks/work-graph-JGJWE3AV.mjs +16 -0
- package/dist/bin/core-chunks/work-graph-WHMCFN6U.mjs +7 -0
- package/dist/bin/core-chunks/work-scope-3LXOEIUX.mjs +7 -0
- package/dist/bin/core-chunks/workflow-FGJVLRQ3.mjs +61 -0
- package/dist/bin/core-chunks/workflows-reference-UWKRZ6BJ.mjs +7 -0
- package/dist/bin/core-chunks/workspace-occupancy-JUXKZBUZ.mjs +7 -0
- package/dist/bin/core-chunks/worktree-service-YRRPFU57.mjs +11 -0
- package/dist/bin/core-chunks/world-model-impact-RH5WH2B3.mjs +7 -0
- package/dist/bin/hook-chunks/{agent-switch-I4MTVE56.mjs → agent-switch-7GOGG4KG.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-VN7APBHR.mjs → analysis-UI2JRLJO.mjs} +2 -2
- package/dist/bin/hook-chunks/{auto-flush-DX3FVSQE.mjs → auto-flush-JKIXTI2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{capture-gate-MEIQD7ZS.mjs → capture-gate-DIPHPNIC.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-25OGCQTR.mjs +69 -0
- package/dist/bin/hook-chunks/{chunk-OLQAMCYV.mjs → chunk-63P5VOR6.mjs} +5 -5
- package/dist/bin/hook-chunks/{chunk-EI6VQZOX.mjs → chunk-6LU777GI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-6NMHVPAI.mjs +35 -0
- package/dist/bin/hook-chunks/{chunk-3AHW4XQH.mjs → chunk-6RS7PNAN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZZBNFNMG.mjs → chunk-6WDRJ7J7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PVCEWFHS.mjs → chunk-7PA4KPSR.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-EXVL2OFE.mjs → chunk-A6LRNS6R.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IJ523YO2.mjs → chunk-AEDB75AK.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-AFGXKRRP.mjs +12 -0
- package/dist/bin/hook-chunks/{chunk-LF3S3MYE.mjs → chunk-ANSRNEEI.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YLOK4WRR.mjs → chunk-B2ZA5ZAO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KDNUQPAK.mjs → chunk-B7MHIUFA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-RT2DFIWF.mjs → chunk-F3PNT2DQ.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-XYKVWO23.mjs → chunk-FBEDUKMG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-DB226JIV.mjs → chunk-GER6HFWV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLL5AV2G.mjs → chunk-HNZ24HIK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-LR24AIEW.mjs → chunk-IDPBMN3Q.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EGCYDLSO.mjs → chunk-IFIENAZU.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KV4NXLPT.mjs → chunk-IHEOOJJT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-H2DGDAQP.mjs → chunk-IL36ER4U.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-33BHU4OM.mjs → chunk-JF6DFOQK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-LQLCYBFF.mjs → chunk-KOLXYWOA.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-XV2LJVYB.mjs → chunk-MIJZT4ZR.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SWJ7TLBD.mjs → chunk-NMB6YSAH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Y3RHBU2R.mjs → chunk-NSTXHVTH.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-ADYTBOCZ.mjs → chunk-ONGVBXBD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7PBWIO4K.mjs → chunk-PFORBQBF.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-WL6PKX3U.mjs → chunk-PQJ64L6U.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-FZS3XGEA.mjs → chunk-RLKYEL3F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-WJV24WE6.mjs → chunk-UBWUQ64A.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-64ZEBHDX.mjs → chunk-UI25YRTY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YHOZTAZH.mjs → chunk-V6GGH6H5.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-WIA6ORIY.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-UVATSTRF.mjs → chunk-XXVHUYL7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-E7NA34VQ.mjs → chunk-Y7RDBMNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JZDZH6IV.mjs → chunk-YATXTHDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-DCHIPMOG.mjs → chunk-ZF2EVMY7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MW54MTLB.mjs → chunk-ZH2MF7H7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZQI4TJ5C.mjs → chunk-ZXON2U5F.mjs} +1 -1
- package/dist/bin/hook-chunks/{codex-skill-6CRFUF3A.mjs → codex-skill-UZZCACMB.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-MUHZWDZA.mjs → command-installer-FJ73C2ZW.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-2JJPCLKC.mjs → config-manager-XDKOTIJM.mjs} +1 -1
- package/dist/bin/hook-chunks/{cwd-changed-UTD6Y4MS.mjs → cwd-changed-STP3LH6Y.mjs} +1 -1
- package/dist/bin/hook-chunks/{distill-5TNAM3LY.mjs → distill-63BHUJAC.mjs} +1 -1
- package/dist/bin/hook-chunks/{enriched-recall-6VOIUNLN.mjs → enriched-recall-6F6LBYAB.mjs} +1 -1
- package/dist/bin/hook-chunks/{format-IIOFTSBF.mjs → format-VJ2YQ4XQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-receipt-QLV3MYFT.mjs → judgment-receipt-LSJCAYBT.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-cue-57B23PEL.mjs → land-cue-DEO2AZW4.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-synthesis-ZVPFJERV.mjs → land-synthesis-GTMFIGDM.mjs} +1 -1
- package/dist/bin/hook-chunks/{legacy-crew-sweep-GR6HRSHX.mjs → legacy-crew-sweep-QPKU7ITU.mjs} +2 -2
- package/dist/bin/hook-chunks/{memory-index-XE2MWKQS.mjs → memory-index-KCMXQGKX.mjs} +1 -1
- package/dist/bin/hook-chunks/{notification-GU2ZJP5K.mjs → notification-DX6ZHOUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-integrity-WV5U3AFF.mjs → pack-integrity-UMLIB5RQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-QLFQKP24.mjs → pack-manager-YXRK2TJ4.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-VPAX5DZL.mjs → planning-JR7O5MYW.mjs} +2 -2
- package/dist/bin/hook-chunks/{post-edit-UXCFSR3Y.mjs → post-edit-IPTVSRVG.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-bash-MB4JNNYG.mjs → pre-bash-5WWTH36N.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-commit-U7TRFKWX.mjs → pre-commit-KZ5TNTPW.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-edit-MDCQXI5F.mjs → pre-edit-XHPYBXRU.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-package-A6ZI5R64.mjs → pre-package-U3HDW3SX.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-search-ZZO3LGXJ.mjs → pre-search-R5CRK66E.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-MS52YLI2.mjs → prjct-md-IBQTJBK7.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-6AIW7KL6.mjs → project-agent-surfaces-TPZO73ZV.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-memory-UDH56VFP.mjs → project-memory-YQLZX5RG.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-style-evolution-IJXT2MCP.mjs → project-style-evolution-NOFCIIZZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{prompt-7VZLYONO.mjs → prompt-DJWONMTZ.mjs} +2 -2
- package/dist/bin/hook-chunks/{purge-N2WN6NDB.mjs → purge-5W3K2MZL.mjs} +1 -1
- package/dist/bin/hook-chunks/{retention-RET4P2RO.mjs → retention-GWJ4AX7I.mjs} +1 -1
- package/dist/bin/hook-chunks/{sdd-PB6WKSLE.mjs → sdd-GWBRD4KI.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-continuity-BIJXMN44.mjs → session-continuity-VH645RGR.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-start-R2VMKW2L.mjs → session-start-4TYTI27B.mjs} +1 -1
- package/dist/bin/hook-chunks/{setup-PPIZHVXS.mjs → setup-VF4UHUBX.mjs} +2 -2
- package/dist/bin/hook-chunks/{shipping-C637PCOF.mjs → shipping-2ULWBGRX.mjs} +4 -4
- package/dist/bin/hook-chunks/{spec-context-inference-RTTDOZZO.mjs → spec-context-inference-HVENYOIO.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-ENLAAMVL.mjs → spec-service-4XGQQPGP.mjs} +2 -2
- package/dist/bin/hook-chunks/{spec-task-breakdown-RUDEP3AY.mjs → spec-task-breakdown-JXF556UH.mjs} +1 -1
- package/dist/bin/hook-chunks/{state-storage-AJUPG7J5.mjs → state-storage-EMWLIFQJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{stop-DPXAWJFN.mjs → stop-NJDYIIXR.mjs} +2 -2
- package/dist/bin/hook-chunks/{subagent-start-AFHPXL2S.mjs → subagent-start-2YMGD4SY.mjs} +1 -1
- package/dist/bin/hook-chunks/{subagent-stop-5BMV63ML.mjs → subagent-stop-4TZJ2NSJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{surface-attribution-EGIKCVMF.mjs → surface-attribution-UNK4J5W2.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-F3GB77OA.mjs → task-overview-P3VRH2FD.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-service-FZABHPFV.mjs → task-service-SPUES5DO.mjs} +1 -1
- package/dist/bin/hook-chunks/{tdd-TAMBOPN3.mjs → tdd-MYF7I5FS.mjs} +1 -1
- package/dist/bin/hook-chunks/{template-loader-MXOMU4XH.mjs → template-loader-4SYVR2UB.mjs} +1 -1
- package/dist/bin/hook-chunks/{weak-model-mode-BMSPGEQY.mjs → weak-model-mode-TYJJT6JJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-scope-YCS4GTXW.mjs → work-scope-A6XPENFE.mjs} +1 -1
- package/dist/bin/hook-chunks/{workspace-occupancy-JOBYNNXV.mjs → workspace-occupancy-3NEAXILW.mjs} +1 -1
- package/dist/bin/prjct-core.mjs +9 -3323
- package/dist/bin/prjct-hooks.mjs +1 -1
- package/dist/bin/prjct.mjs +7 -1
- package/dist/daemon/entry.mjs +514 -513
- package/dist/mcp/server.mjs +234 -233
- package/package.json +3 -2
- package/dist/bin/hook-chunks/chunk-3UB6SFRA.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-D7DQABWO.mjs +0 -35
- package/dist/bin/hook-chunks/chunk-M4YM7Z3F.mjs +0 -69
- package/dist/bin/hook-chunks/chunk-TB57OYGW.mjs +0 -16
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as ge}from"./chunk-VDXTMAMO.mjs";import{a as Oe}from"./chunk-NZKUCQZK.mjs";import{a as Ve,c as Be,d as j}from"./chunk-H2KNJUPN.mjs";import{a as Ne}from"./chunk-6FUCOGOW.mjs";import{b as qe}from"./chunk-7CI4AMVO.mjs";import{c as me}from"./chunk-Q3LUL6LL.mjs";import{a as De}from"./chunk-E73HSXCX.mjs";import{a as re}from"./chunk-O5N6XYPU.mjs";import{a as Ge,b as de,c as pe,e as ie}from"./chunk-SROBBOJB.mjs";import{e as _e,f as Me}from"./chunk-2NI4EEK2.mjs";import{d as Fe,e as Ie,f as We}from"./chunk-6AFXUX2M.mjs";import{b as Le}from"./chunk-LZC6NGB6.mjs";import{a as O}from"./chunk-XPRLQIVQ.mjs";import{c as He,f as L,h as Ae}from"./chunk-EZRNQXCC.mjs";import{b as w}from"./chunk-EHVU2SMR.mjs";import{a as fe}from"./chunk-L4TUXFCL.mjs";import{b as ue}from"./chunk-3USVY66O.mjs";import{g as Pe,i as ht}from"./chunk-DMO3ZFUG.mjs";import{d as Re,e as ne,l as le}from"./chunk-HU5ERAAV.mjs";import{a as ae,b as $,e as K,i as ee,l as J,o as Ee,p as te}from"./chunk-D62TAZG6.mjs";import{f as ce,g as Te,h as H,j as W,l as Ce,o as xe,p as Se}from"./chunk-HYIT7MF5.mjs";import{e as P,g as mt}from"./chunk-225DWS4D.mjs";import{a}from"./chunk-3TRXQAU4.mjs";Ae();le();te();Ae();import{execSync as St}from"node:child_process";import Ze from"node:fs/promises";import V from"node:path";import E from"chalk";le();Se();import Ue from"node:path";var vt=["CHANGELOG.md","HISTORY.md","NEWS.md","CHANGES.md"],yt=`# Changelog
|
|
8
|
+
|
|
9
|
+
All notable changes to this project will be documented in this file.
|
|
10
|
+
|
|
11
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
12
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
13
|
+
`,se=class{static{a(this,"ChangelogService")}projectPath;constructor(e){this.projectPath=e}async detect(){for(let r of vt){let i=Ue.join(this.projectPath,r);if(await Ce(i)){let s=await H(i),o=this.detectFormat(s);return{filePath:i,fileName:r,format:o,created:!1}}}let e="CHANGELOG.md",n=Ue.join(this.projectPath,e);return await W(n,`${yt}
|
|
14
|
+
`),{filePath:n,fileName:e,format:"keepachangelog",created:!0}}async addEntry(e){let n=await this.detect(),r=await H(n.filePath);if(this.hasVersionEntry(r,e.version,n.format))return;let i=e.date||Re(new Date),s=n.format==="keepachangelog"?this.insertKeepAChangelogEntry(r,e,i):this.insertMarkdownEntry(r,e,i);await W(n.filePath,s)}hasVersionEntry(e,n,r){let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return(r==="keepachangelog"?new RegExp(`^## \\[${i}\\]`,"m"):new RegExp(`^## ${i}\\b`,"m")).test(e)}async addFeature(e,n){await this.addEntry({version:e,sections:{Added:[n]}})}detectFormat(e){return e.includes("Keep a Changelog")||e.includes("keepachangelog.com")||/^### (?:Added|Changed|Deprecated|Removed|Fixed|Security)\s*$/m.test(e)?"keepachangelog":"markdown"}insertKeepAChangelogEntry(e,n,r){let i=e.split(`
|
|
15
|
+
`),s=i.findIndex(c=>/^##\s*\[Unreleased\]\s*$/i.test(c));if(s!==-1){let c=i.slice(s+1).findIndex(T=>/^##\s/.test(T)),f=c===-1?i.length:s+1+c,d=i.slice(s+1,f).join(`
|
|
16
|
+
`).trim(),g=this.promoteUnreleasedBody(d,n,r);return`${[...i.slice(0,s),"## [Unreleased]","",g,"",...i.slice(f)].join(`
|
|
17
|
+
`).replace(/\n{3,}/g,`
|
|
18
|
+
|
|
19
|
+
`).trimEnd()}
|
|
20
|
+
`}let o=this.formatKeepAChangelogEntry(n,r),l=e.search(/^## /m);if(l!==-1){let c=e.slice(0,l),f=e.slice(l);return`${c}## [Unreleased]
|
|
21
|
+
|
|
22
|
+
${o}
|
|
23
|
+
${f}`}return`${e.trimEnd()}
|
|
24
|
+
|
|
25
|
+
## [Unreleased]
|
|
26
|
+
|
|
27
|
+
${o}
|
|
28
|
+
`}promoteUnreleasedBody(e,n,r){if(!e)return this.formatKeepAChangelogEntry(n,r);let i=`## [${n.version}] - ${r}`,o=(n.sections?.Added??(n.description?[n.description]:[])).filter(f=>!e.includes(f));if(o.length===0)return`${i}
|
|
29
|
+
|
|
30
|
+
${e}`;let l=o.map(f=>`- ${f}`).join(`
|
|
31
|
+
`),c=/^###\s+Added\s*$/im.test(e)?e.replace(/^###\s+Added\s*$/im,f=>`${f}
|
|
32
|
+
${l}`):`### Added
|
|
33
|
+
${l}
|
|
34
|
+
|
|
35
|
+
${e}`;return`${i}
|
|
36
|
+
|
|
37
|
+
${c}`}insertMarkdownEntry(e,n,r){let i=this.formatMarkdownEntry(n,r),s=e.indexOf(`
|
|
38
|
+
`);if(s!==-1){let o=e.slice(0,s+1),l=e.slice(s+1);return`${o}
|
|
39
|
+
${i}
|
|
40
|
+
${l}`}return`${i}
|
|
41
|
+
|
|
42
|
+
${e}`}formatKeepAChangelogEntry(e,n){let r=[`## [${e.version}] - ${n}`];return r.push(""),e.sections?this.renderSections(r,e.sections):e.description&&(r.push("### Added"),r.push(`- ${e.description}`),r.push("")),r.join(`
|
|
43
|
+
`)}renderSections(e,n){for(let[r,i]of Object.entries(n)){e.push(`### ${r}`);for(let s of i)e.push(`- ${s}`);e.push("")}}formatMarkdownEntry(e,n){let r=[`## ${e.version} - ${n}`];return r.push(""),e.sections?this.renderSections(r,e.sections):e.description&&(r.push(`- ${e.description}`),r.push("")),r.join(`
|
|
44
|
+
`)}};te();Se();import N from"node:path";var oe=class{static{a(this,"VersionService")}projectPath;constructor(e){this.projectPath=e}async detect(){let e=[()=>this.fromPackageJson(),()=>this.fromCargoToml(),()=>this.fromPyprojectToml(),()=>this.fromCsproj(),()=>this.fromVersionFile("VERSION"),()=>this.fromVersionFile("version.txt"),()=>this.fromGitTag()];for(let n of e){let r=await n();if(r)return r}return this.createFallbackVersion()}async bump(e="patch"){let n=await this.detect();if(n.file){let i=await this.readVersionFromGitHead(n.file,n.format);if(i&&this.isAheadOf(n.current,i))return n.current}let r=Et(n.current,e);return await this.writeVersion({...n,next:r}),r}async readVersionFromGitHead(e,n){let r=N.relative(this.projectPath,e),i=await K(["show",`HEAD:${r}`],{cwd:this.projectPath});if(!i.ok){if(i.kind==="exit")return null;J(i)}try{let s=i.stdout;if(n==="json")return JSON.parse(s).version??null;if(n==="plaintext"){let o=s.trim();return he(o)?o:null}return n==="toml"?ze(s)??Ke(s):n==="xml"?Je(s):null}catch{return null}}isAheadOf(e,n){let r=e.split(".").map(s=>Number.parseInt(s,10)||0),i=n.split(".").map(s=>Number.parseInt(s,10)||0);for(let s of[0,1,2]){let o=r[s]??0,l=i[s]??0;if(o>l)return!0;if(o<l)return!1}return!1}async fromPackageJson(){let e=N.join(this.projectPath,"package.json"),n=await ce(e,null);return n?.version?{current:n.version,next:D(n.version),file:e,format:"json"}:null}async fromCargoToml(){let e=N.join(this.projectPath,"Cargo.toml"),n=await H(e,"");if(!n)return null;let r=ze(n);return r?{current:r,next:D(r),file:e,format:"toml"}:null}async fromPyprojectToml(){let e=N.join(this.projectPath,"pyproject.toml"),n=await H(e,"");if(!n)return null;let r=Ke(n);return r?{current:r,next:D(r),file:e,format:"toml"}:null}async fromCsproj(){let e=await xe(this.projectPath,{extension:".csproj"});if(e.length===0)return null;let n=N.join(this.projectPath,e[0]),r=await H(n,"");if(!r)return null;let i=Je(r);return i?{current:i,next:D(i),file:n,format:"xml"}:null}async fromVersionFile(e){let n=N.join(this.projectPath,e),r=await H(n,"");if(!r)return null;let i=r.trim();return he(i)?{current:i,next:D(i),file:n,format:"plaintext"}:null}async fromGitTag(){let e=await K(["tag","--sort=-v:refname"],{cwd:this.projectPath});if(!e.ok){if(e.kind==="exit")return null;J(e)}let n=e.stdout.trim().split(`
|
|
45
|
+
`);for(let r of n){let i=r.trim().replace(/^v/,"");if(he(i))return{current:i,next:D(i),file:null,format:"git-tag"}}return null}async createFallbackVersion(){let e=N.join(this.projectPath,"VERSION");return await W(e,`0.1.0
|
|
46
|
+
`),{current:"0.1.0",next:"0.1.1",file:e,format:"plaintext"}}async writeVersion(e){if(!e.file){e.format==="git-tag"&&await $("git",["tag",`v${e.next}`],{cwd:this.projectPath});return}switch(e.format){case"json":await this.writeJsonVersion(e.file,e.next);break;case"toml":await this.writeTomlVersion(e.file,e.next);break;case"xml":await this.writeXmlVersion(e.file,e.next);break;case"plaintext":await W(e.file,`${e.next}
|
|
47
|
+
`);break}}async writeJsonVersion(e,n){let r=await ce(e,{});r&&(r.version=n,await Te(e,r))}async writeTomlVersion(e,n){let r=await H(e,"");if(!r)return;let i=r.replace(/^(\s*version\s*=\s*")([^"]+)(")/m,`$1${n}$3`);await W(e,i)}async writeXmlVersion(e,n){let r=await H(e,"");if(!r)return;let i=r.replace(/(<Version>)([^<]+)(<\/Version>)/,`$1${n}$3`);await W(e,i)}};function he(t){return/^\d+\.\d+\.\d+/.test(t)}a(he,"isSemver");function D(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);if(!e)return t;let[,n,r,i,s]=e;if(s){let o=s.split("."),l=o.length-1;return/^\d+$/.test(o[l])?(o[l]=String(Number(o[l])+1),`${n}.${r}.${i}-${o.join(".")}`):`${n}.${r}.${i}-${s}.1`}return`${n}.${r}.${Number(i)+1}`}a(D,"bumpPatch");function bt(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${e[1]}.${Number(e[2])+1}.0`:t}a(bt,"bumpMinor");function $t(t){let e=t.match(/^(\d+)\.(\d+)\.(\d+)/);return e?`${Number(e[1])+1}.0.0`:t}a($t,"bumpMajor");function Et(t,e){return e==="major"?$t(t):e==="minor"?bt(t):D(t)}a(Et,"bumpVersion");function je(t){let e=(t??"").toLowerCase().trim();return e?/^[a-z]+(\([^)]*\))?!:/.test(e)||e.includes("breaking change")?"major":/^(fix|chore|docs|refactor|perf|style|test|build|ci|revert)(\([^)]*\))?:/.test(e)?"patch":"minor":"patch"}a(je,"inferBumpLevel");function ze(t){let e=t.match(/\[package\]([\s\S]*?)(?=\n\[|\n*$)/);return e?e[1].match(/^\s*version\s*=\s*"([^"]+)"/m)?.[1]??null:null}a(ze,"parseTomlVersion");function Ke(t){let e=t.match(/\[project\]([\s\S]*?)(?=\n\[|\n*$)/);if(e){let r=e[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(r)return r[1]}let n=t.match(/\[tool\.poetry\]([\s\S]*?)(?=\n\[|\n*$)/);if(n){let r=n[1].match(/^\s*version\s*=\s*"([^"]+)"/m);if(r)return r[1]}return null}a(Ke,"parsePyprojectVersion");function Je(t){return t.match(/<Version>([^<]+)<\/Version>/)?.[1]?.trim()??null}a(Je,"parseCsprojVersion");ht();mt();te();function Tt(t){let e=t.split(/\s+/).map(r=>r.trim()).filter(Boolean),n=[];for(let r of e){let i=r.match(/^tags:([a-zA-Z0-9_\-.]+)([=~])(.+)$/);if(i){n.push({kind:"tags",key:i[1],op:i[2],value:i[3]});continue}let s=r.match(/^branch([=~])(.+)$/);if(s){n.push({kind:"branch",op:s[1],value:s[2]});continue}let o=r.match(/^files:(.+)$/);o&&n.push({kind:"files",op:"~",value:o[1]})}return n}a(Tt,"parseWhen");var Xe=new Map;function Ct(t){let e=Xe.get(t);if(e)return e;let n=a(s=>{if(s>=t.length)return"";let o=t[s];return o==="*"?t[s+1]==="*"?`.*${n(s+2)}`:`[^/]*${n(s+1)}`:`${/[.+^${}()|[\]\\]/.test(o)?`\\${o}`:o}${n(s+1)}`},"translate"),r=n(0),i=new RegExp(`^${r}$`);return Xe.set(t,i),i}a(Ct,"globToRegex");function xt(t,e){if(t.kind==="tags"){let n=e.tags[t.key??""]??"";return t.op==="="?n===t.value:n.toLowerCase().includes(t.value.toLowerCase())}if(t.kind==="branch")return t.op==="="?e.branch===t.value:e.branch.toLowerCase().includes(t.value.toLowerCase());if(t.kind==="files"){let n=Ct(t.value);return e.filesChanged.some(r=>n.test(r))}return!0}a(xt,"matchCondition");function Ye(t,e){if(!t||!t.trim())return!0;let n=Tt(t);return n.length===0?!0:n.every(r=>xt(r,e))}a(Ye,"evaluateWhen");var Qe="status:",tt="script:",nt="mcp:",Rt="persona:context",et="version:bump",Pt="changelog:add",ke="git:commit",Ht="git:push",At="pr:ensure",rt="verify:";async function Ft(t,e,n){let r=await w.getCurrentTask(t);if(!r)throw new Error(`Cannot transition to '${n}': no active work cycle`);await O.log(e,L,{taskId:r.id,from:r.type??null,to:n,source:"workflow"})}a(Ft,"runStatusTransition");async function It(t,e){let{evaluateWorkflowRuleExecutable:n}=await import("./trust-boundary-24F662RM.mjs"),r=n(t.trustSource,t.description||t.action);if(!r.allow)throw new Error(r.denyMessage);await ae(t.action,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}a(It,"runShellAction");async function Wt(t){let{test:e}=await Ne(t);return e?.command??null}a(Wt,"detectVerifyCommand");async function _t(t,e){let{evaluateWorkflowRuleExecutable:n}=await import("./trust-boundary-24F662RM.mjs"),r=n(t.trustSource,t.description||t.action);if(!r.allow)throw new Error(r.denyMessage);let i=t.action.slice(rt.length).trim();if(!i)throw new Error(`Empty command in verify action '${t.action}'`);let s=i==="auto"?await Wt(e).then(o=>{if(!o)throw new Error("verify:auto found no test script (package.json `scripts.test`). Specify an explicit check, e.g. `verify:bun test` or `verify:npm run typecheck`.");return o}):i;try{await ae(s,{timeout:t.timeoutMs,cwd:e,env:{...process.env}})}catch(o){throw new Error(`Verification failed: \`${s}\`
|
|
48
|
+
${P(o)}
|
|
49
|
+
Stop-the-line: do not proceed. Fix the failure and re-run this check \u2014 unverified output must not advance.`)}}a(_t,"runVerifyAction");async function Mt(t,e,n){let{evaluateWorkflowRuleExecutable:r}=await import("./trust-boundary-24F662RM.mjs"),i=r(t.trustSource,t.description||t.action);if(!i.allow)throw new Error(i.denyMessage);let s=t.action.slice(tt.length).trim();if(!s)throw new Error(`Empty script path in action '${t.action}'`);if(V.isAbsolute(s)||s.includes("\0"))throw new Error(`Script path escapes workflows dir: ${s}`);let o=V.resolve(e,".prjct/workflows"),l=V.resolve(o,s),c=V.relative(o,l);if(c.startsWith("..")||V.isAbsolute(c))throw new Error(`Script path escapes workflows dir: ${s}`);let f=await Ze.realpath(l).catch(()=>{throw new Error(`Script not found: .prjct/workflows/${s}`)}),d=await Ze.realpath(o).catch(()=>o),g=V.relative(d,f);if(g.startsWith("..")||V.isAbsolute(g))throw new Error(`Script path escapes workflows dir: ${s}`);await $("bash",[f],{timeout:t.timeoutMs,cwd:e,env:{...process.env,PRJCT_BRANCH:n.branch,PRJCT_FILES_CHANGED:n.filesChanged.join(","),PRJCT_TAGS:Object.entries(n.tags).map(([k,T])=>`${k}=${T}`).join(",")}})}a(Mt,"runScriptAction");function Lt(t){let e=t.action.slice(nt.length).trim(),n=e.indexOf(":");if(n===-1)return`Call MCP tool ${JSON.stringify(e)} (server unspecified \u2014 re-author rule with format \`mcp:<server>:<tool>[:<args>]\`).`;let r=e.slice(0,n),i=e.slice(n+1),s=i.indexOf(":"),o=s===-1?i:i.slice(0,s),l=s===-1?"":i.slice(s+1),c=t.description?` (${t.description})`:"";return l?`Call MCP \`${r}.${o}\` with args ${l}${c}.`:`Call MCP \`${r}.${o}\`${c}.`}a(Lt,"buildMcpInstruction");async function Ot(t){try{let{default:e}=await import("./config-manager-QVFHXIKI.mjs"),r=(await e.readConfig(t))?.persona;if(!r)return"No persona declared for this project \u2014 `.prjct/prjct.config.json` has no `persona` field.";let i=[`You are **${r.role}** in this project.`];return r.focus&&i.push(`Focus: ${r.focus}.`),r.mcps&&r.mcps.length>0&&i.push(`MCPs available: ${r.mcps.join(", ")}.`),r.packs&&r.packs.length>0&&i.push(`Active packs: ${r.packs.join(", ")}.`),i.join(" ")}catch(e){return`Could not resolve persona: ${P(e)}`}}a(Ot,"buildPersonaInstruction");async function Nt(t,e){let n=new oe(t),r=je(typeof e.feature=="string"?e.feature:void 0),i=await n.bump(r);e.version=i}a(Nt,"runVersionBump");async function Dt(t,e){let n=typeof e.version=="string"?e.version:null,r=typeof e.feature=="string"?e.feature:null;if(!n)throw new Error("changelog:add requires a prior version:bump step (no version in runContext)");if(!r)throw new Error("changelog:add requires a feature name in runContext (set by ship before rules run)");await new se(t).addFeature(n,r)}a(Dt,"runChangelogAdd");function it(t,e){return t.replace(/\$([A-Z_]+)/g,(n,r)=>{let i=r.toLowerCase(),s=e[i];return typeof s=="string"?s:""})}a(it,"expandTemplate");async function Vt(t,e,n){let i=t.slice(ke.length).replace(/^:/,"").trim()||(n.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE"),s=`${it(i,n)}
|
|
50
|
+
|
|
51
|
+
Generated with [p/](https://www.prjct.app/)`;await $("git",["add","."],{cwd:e}),await $("git",["commit","-m",s],{cwd:e})}a(Vt,"runGitCommit");function Gt(t,e){let n=t.trim(),r=e.trim(),i=r.includes("/")?r.slice(r.indexOf("/")+1):"";return!!n&&i===n?["push"]:["push","-u","origin","HEAD"]}a(Gt,"decideGitPushArgs");async function Bt(t){let e=await $("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(i=>i.stdout.trim()).catch(()=>""),n=await $("git",["rev-parse","--abbrev-ref","--symbolic-full-name","@{u}"],{cwd:t}).then(i=>i.stdout.trim()).catch(()=>""),r=Gt(e,n);try{await $("git",r,{cwd:t,timeout:3e4})}catch(i){let s=P(i);throw new Error(`git push failed: ${s}`)}}a(Bt,"runGitPush");async function qt(t,e,n){try{let r=await $("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:t}).then(c=>c.stdout.trim());if(!r||r==="main"||r==="master")return;if(!await $("gh",["--version"],{cwd:t}).then(()=>!0).catch(()=>!1)){n.instructions.push("# prjct: pr:ensure skipped \u2014 `gh` CLI not found. Install it or open the PR manually.");return}let s=await $("gh",["pr","list","--head",r,"--json","number","--jq","length"],{cwd:t}).then(c=>Number(c.stdout.trim())).catch(()=>-1);if(s<0){n.instructions.push("# prjct: pr:ensure could not check for an existing PR (gh not authenticated?) \u2014 skipped.");return}if(s>0)return;let o=it(e.version?"feat: $FEATURE (v$VERSION)":"feat: $FEATURE",e),l=await $("gh",["pr","create","--fill",...o?["--title",o]:[]],{cwd:t,timeout:3e4}).then(c=>c.stdout.trim());n.instructions.push(`# prjct: opened PR \u2014 ${l}`)}catch(r){n.instructions.push(`# prjct: pr:ensure failed (non-blocking) \u2014 ${P(r)}`)}}a(qt,"runPrEnsure");async function we(t,e,n,r,i,s){let o=t.action;if(o.startsWith(Qe)){let l=o.slice(Qe.length).trim();if(!l)throw new Error(`Empty status target in action '${o}'`);await Ft(e,n,l);return}if(o.startsWith(tt)){await Mt(t,n,r);return}if(o.startsWith(nt)){i.instructions.push(Lt(t));return}if(o===Rt){i.instructions.push(await Ot(n));return}if(o===et||o.startsWith(`${et}:`)){await Nt(n,s);return}if(o===Pt){await Dt(n,s);return}if(o===ke||o.startsWith(`${ke}:`)){await Vt(o,n,s);return}if(o===Ht){await Bt(n);return}if(o===At){await qt(n,s,i);return}if(o.startsWith(rt)){await _t(t,n);return}await It(t,n)}a(we,"runRuleAction");async function Ut(t,e){let[n,r,i]=await Promise.all([zt(e),Kt(e),Jt(t)]);return{branch:n,filesChanged:r,tags:i}}a(Ut,"buildWhenContext");async function zt(t){try{return await re(t)||""}catch{return""}}a(zt,"resolveBranch");async function Kt(t){let e={cwd:t,encoding:"utf-8"},n=a(async s=>{try{return St(s,e).split(`
|
|
52
|
+
`).map(o=>o.trim()).filter(Boolean)}catch{return[]}},"runDiff"),[r,i]=await Promise.all([n("git diff --cached --name-only"),n("git diff --name-only")]);return[...new Set([...r,...i])]}a(Kt,"resolveChangedFiles");async function Jt(t){try{let e=await w.getCurrentTask(t),n={};if(e?.type&&(n.type=e.type),!e)return n;let r=Pe.get(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 1",He);if(r)try{let i=JSON.parse(r.data);if(i.taskId===e.id&&i.tags)return{...n,...i.tags}}catch{}return n}catch{return{}}}a(Jt,"resolveActiveTags");async function ve(t,e,n,r={}){let i={success:!0,gatesFailed:[],hooksFailed:[],stepsRun:[],instructions:[],output:""};if(r.skipRules)return i;let s=r.runContext??{},l=Oe.getRulesForCommand(t,e).filter(u=>u.position===n),c=r.projectPath||process.cwd(),d=l.some(u=>u.whenExpr||u.type==="gate")?await Ut(t,c):{branch:"",filesChanged:[],tags:{}},g=l.filter(u=>Ye(u.whenExpr,d)),k=g.length>0?Ge(t,`${n}:${e}`):null,T=g.filter(u=>u.type==="gate");for(let u of T){let m=u.description||u.action;console.log(`
|
|
53
|
+
${E.dim(`[gate] ${n}-${e}: ${u.action}`)}`);try{let v=Date.now();await we(u,t,c,d,i,s);let R=Date.now()-v,U=R>1e3?`${(R/1e3).toFixed(1)}s`:`${R}ms`;console.log(`${E.green("\u2713")} ${E.dim(`gate passed (${U})`)}`),de(t,k,u.id,!0)}catch(v){return console.log(`${E.red("\u2717")} gate failed: ${m}`),i.gatesFailed.push(m),i.success=!1,i.output+=`Gate failed: ${m}
|
|
54
|
+
${P(v)}
|
|
55
|
+
`,de(t,k,u.id,!1,P(v)),ie(t,k,"blocked"),i}}let G=g.filter(u=>u.type==="instruction");for(let u of G){let m=u.description||u.action;console.log(`
|
|
56
|
+
${E.dim(`[instruction] ${n}-${e}: ${m}`)}`),i.instructions.push(u.action)}let B=g.filter(u=>u.type==="hook"),q=B.filter(u=>u.parallel===!1),C=B.filter(u=>u.parallel!==!1),Y=a(async u=>{console.log(`
|
|
57
|
+
${E.dim(`[hook] ${n}-${e}: ${u.action}`)}`);try{let m=Date.now();await we(u,t,c,d,i,s);let v=Date.now()-m,R=v>1e3?`${(v/1e3).toFixed(1)}s`:`${v}ms`;console.log(`${E.green("\u2713")} ${E.dim(`(${R})`)}`)}catch(m){console.log(`${E.yellow("\u26A0")} hook failed (non-blocking): ${u.action}`),i.hooksFailed.push(u.description||u.action),i.output+=`Hook failed: ${u.action}
|
|
58
|
+
${P(m)}
|
|
59
|
+
`}},"runHook");for(let u of q)await Y(u);C.length>0&&await Promise.all(C.map(Y));let Z=g.filter(u=>u.type==="step");for(let[u,m]of Z.entries()){console.log(`
|
|
60
|
+
${E.dim(`[step] ${e}: ${m.action}`)}`);try{let v=Date.now();await we(m,t,c,d,i,s);let R=Date.now()-v,U=R>1e3?`${(R/1e3).toFixed(1)}s`:`${R}ms`;console.log(`${E.green("\u2713")} ${E.dim(`step passed (${U})`)}`),i.stepsRun.push(m.description||m.action),pe(t,k,m.id,u,"ok")}catch(v){return console.log(`${E.red("\u2717")} step failed: ${m.action}`),i.gatesFailed.push(m.description||m.action),i.success=!1,i.output+=`Step failed: ${m.action}
|
|
61
|
+
${P(v)}
|
|
62
|
+
`,pe(t,k,m.id,u,"failed",P(v)),ie(t,k,"failed"),i}}return ie(t,k,"passed"),i}a(ve,"executeWorkflowRules");le();te();var jt=["cli","command","install","setup","doctor","mcp","codex","claude","statusline","statusbar","output","help"],Xt=new Set(["the","and","for","with","that","this","task","implement","implementa","fix","bug","add","agrega","crear","hacer","esto","debe"]);function X(t){let e=t.toLowerCase(),n=Yt(e),r=jt.some(d=>e.includes(d)),i=A(e,["security","seguridad","auth","permission","secret","migration","sqlite","database","arquitectura","architecture","must","critical","critico","cr\xEDtico"]),s=Zt(n,e,i),o=Qt(s,i),l=en(n,s,r),c=tn(s),f=rn(t);return{level:s,kind:n,risk:o,expectedEvidence:l,scopeHints:f,gates:c,rationale:nn(s,n,o),createdAt:ne()}}a(X,"buildTaskHarness");async function ye(t,e){let n=e.harness;if(!n||n.level==="H0")return{changedFiles:[],observedEvidence:[],warnings:[],diffSize:0};let r=await Promise.all([Ee(t),ln(t)]).then(([f,d])=>({changedFiles:f,diffSize:d,gitUnavailable:null})).catch(f=>{if(f instanceof ee)return{changedFiles:[],diffSize:0,gitUnavailable:f};throw f}),{changedFiles:i,diffSize:s,gitUnavailable:o}=r,l=sn(i),c=[];return o?(c.push(`git ${o.kind}: change evidence unavailable \u2014 completion checks skipped, not failed.`),{changedFiles:i,observedEvidence:l,warnings:c,diffSize:s}):(n.expectedEvidence.includes("regression-test")&&!l.includes("tests-changed")&&c.push(`${n.level} expects a regression test; no test file changed in the diff.`),n.expectedEvidence.includes("docs-if-public-behavior")&&cn(i)&&!l.includes("docs-changed")&&c.push("Public-facing files changed; no README/docs/changelog file changed."),s>400&&c.push(`Diff is ${s} changed lines; consider splitting or justify the scope.`),{changedFiles:i,observedEvidence:l,warnings:c,diffSize:s})}a(ye,"evaluateHarnessCompletion");function Yt(t){if(A(t,["security","seguridad","auth","authent","authoriz","permission","secret"]))return"security";if(A(t,["bug","bugs","fix","fixes","fixed","fixing","falla","fallo","error","broken","regression","no se"]))return"bug";let e=A(t,["implement","implementa","refactor","restructure","cleanup","crear","agrega","construir","build"]);return A(t,["research","investiga","investigate","analiza","analyze","analysis","an\xE1lisis","compare","compara","survey","explore","explora","revisa","revisar","review","reviewing","repasa","repasar"])&&!e?"research":A(t,["refactor","cleanup","restructure"])||/(?:^|[^a-z0-9_-])split(?:[^a-z0-9_-]|$)/.test(t)?"refactor":A(t,["doc","docs","document","readme","changelog","typo"])?"docs":A(t,["chore","format","lint","linting","linter"])?"chore":A(t,["add","agrega","crear","implement","implementa","feature","mejora"])?"feature":"unknown"}a(Yt,"detectKind");function Zt(t,e,n){return t==="docs"||t==="chore"?"H0":t==="security"?"H3":t==="research"?"H1":n&&A(e,["migration","sqlite","database","architecture","arquitectura"])?"H3":t==="feature"||t==="refactor"?"H2":"H1"}a(Zt,"detectLevel");function Qt(t,e){return t==="H3"||e?"high":t==="H2"||t==="H1"?"medium":"low"}a(Qt,"detectRisk");function en(t,e,n){let r=new Set;return t==="bug"&&(r.add("regression-test"),r.add("focused-tests"),r.add("edge-cases")),(t==="feature"||t==="refactor")&&(r.add("focused-tests"),r.add("scope-check")),n&&r.add("docs-if-public-behavior"),(e==="H2"||e==="H3")&&r.add("spec-or-design"),e==="H3"&&r.add("config-preservation"),[...r]}a(en,"expectedEvidenceFor");function tn(t){return t==="H0"?[]:t==="H1"?["verify-before-done"]:t==="H2"?["verify-before-done","scope-check"]:["spec-before-implementation","verify-before-done","scope-check","review-before-ship"]}a(tn,"gatesFor");function nn(t,e,n){return t==="H0"?`Low-risk ${e}; keep the task direct and low-friction.`:`${t} ${e}/${n}; define expected evidence up front and verify before closure.`}a(nn,"rationaleFor");function rn(t){let e=t.toLowerCase().normalize("NFD").replace(new RegExp("\\p{Diacritic}","gu"),"").split(/[^a-z0-9_.-]+/u).filter(n=>n.length>=3&&!Xt.has(n));return[...new Set(e)].slice(0,8)}a(rn,"extractScopeHints");function A(t,e){return e.some(n=>{if(n.includes(" "))return t.includes(n);let r=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=n.length>=5?`\\b${r}`:`\\b${r}\\b`;return new RegExp(i).test(t)})}a(A,"hasAny");function sn(t){let e=new Set;return t.some(on)&&e.add("tests-changed"),t.some(an)&&e.add("docs-changed"),[...e]}a(sn,"observedEvidenceFromFiles");function on(t){return/(^|\/)(__tests__|tests?|specs?)\//.test(t)||/\.(test|spec)\.[cm]?[tj]sx?$/.test(t)}a(on,"isTestFile");function an(t){return/(^|\/)(README|CHANGELOG|docs\/)/i.test(t)}a(an,"isDocsFile");function cn(t){return t.some(e=>e.startsWith("core/commands/")||e.startsWith("core/mcp/")||e.startsWith("templates/")||e==="README.md")}a(cn,"touchesPublicSurface");async function ln(t){let e=await K(["diff","--shortstat","HEAD"],{cwd:t});if(!e.ok){if(e.kind==="exit")return 0;J(e)}let n=Number.parseInt(e.stdout.match(/(\d+) insertions?/)?.[1]??"0",10),r=Number.parseInt(e.stdout.match(/(\d+) deletions?/)?.[1]??"0",10);return n+r}a(ln,"readDiffSize");var un=[/\btypo\b/i,/\bdocs?\b/i,/\breadme\b/i,/\bformat\b/i,/\bchangelog\b/i,/\brerun\b.*\btests?\b/i,/\bre-?run\b.*\btests?\b/i],fn=[/\badd\b/i,/\bimplement\b/i,/\bcreate\b/i,/\bbuild\b/i,/\bfeature\b/i,/\bbilling\b/i,/\bauth\b/i,/\bsecurity\b/i,/\bmigration\b/i,/\bretry\b/i,/\bfailure\b/i,/\brecovery\b/i,/\baudit\b/i,/\bworkflow\b/i,/\borchestrat/i];function dn(t){let e=t.trim(),n=un.some(i=>i.test(e)),r=fn.some(i=>i.test(e));return n&&!r?{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"trivial-keyword"}:r?{kind:"substantive",station:"spec_required",requiresSpec:!0,requiresTestsFirst:!0,reason:"substantive-keyword"}:{kind:"trivial",station:"direct",requiresSpec:!1,requiresTestsFirst:!1,reason:"conservative-default"}}a(dn,"classifyTaskPipeline");function st(t,e){let n=dn(t);return n.kind==="substantive"&&e?{...n,station:"test_red",reason:"linked-spec"}:n}a(st,"decideTaskPipeline");function ot(t){switch(t.station){case"direct":return"Proceed directly; no spec is required for this trivial task.";case"spec_required":return"Create or link a reviewed spec before implementation; write tests before implementation from the spec acceptance criteria.";case"test_red":return"Write failing tests before implementation, covering the linked spec acceptance criteria and edge cases.";case"implementation":return"Implement the minimum code needed to make the existing tests pass.";case"verify":return"Run verification and keep the task blocked on red tests."}}a(ot,"formatTaskPipelineNextAction");var pn=["active","resume","in_progress","working"],at=120;function hr(t){let e=t.type==="decision"||t.type==="gotcha"||t.type==="fact"||t.type==="spec"?"SoT":t.type==="anti-pattern"||t.type==="pattern"||t.type==="learning"?"SUGGEST":"ctx",n=t.when?t.when.slice(0,10):"",r=t.author?` by ${t.author}`:"",i=[n,r].filter(Boolean).join(""),s=`[${e}\xB7${t.type}] ${t.title}${i?` (${i.trim()})`:""} \`${t.id}\``,o=t.decisionTrap??t.antiPattern??t.nextImplication??t.why??t.outcome??t.keyData??t.detail;if(!o)return e==="SoT"?`${s} \u2014 BINDING; supersede via prjct remember if wrong`:s;let l=o.length>at?`${o.slice(0,at-1)}\u2026`:o;if(e==="SoT")return`${s} \u2014 tip\u2192user \xB7 SoT: ${l}`;if(e==="SUGGEST"){let c=t.files&&t.files.length>0?` in \`${t.files.slice(0,2).join("`, `")}\``:"";return`${s} \u2014 tip\u2192user \xB7 suggest${c}: ${l}`}return`${s} \u2014 ${l}`}a(hr,"formatRelatedContextForAgent");function wr(t){return`[${t.label}] ${t.title} \u2014 \`${t.file}\` \`${t.id}\``}a(wr,"formatRiskForAgent");async function kr(t,e,n,r={}){let i=n.trim().toLowerCase();if(De.has(i))return{ok:!1,blocked:`'${i}' is a prjct command, not a work intent. Did you mean \`prjct ${i}\`? To start a work cycle, describe the task (e.g. \`prjct work "fix the ${i} flow"\`).`};let s=await ve(t,"task","before",{projectPath:e,skipRules:r.skipHooks});if(!s.success)return{ok:!1,blocked:s.gatesFailed.length>0?`Blocked: ${s.gatesFailed.join(", ")}`:`Hook failed: ${s.hooksFailed.join(", ")}`};let o=await ue.readConfig(e).catch(()=>null);try{let{ensureCodingAnticipationDefaults:h}=await import("./pack-manager-46SPIPPD.mjs"),p=await h(e);p.healed&&p.reason==="activated-code"?console.log("\u2139 Anticipation ON: activated pack `code` (conflictMode advisory) \u2014 traps surface before edit"):p.healed&&p.reason==="conflictMode-healed"&&console.log("\u2139 Anticipation ON: conflictMode \u2192 advisory for pack code")}catch{}{let{effectiveSddMode:h}=await import("./sdd-HE7O6N5S.mjs"),{discussLockVerdict:p}=await import("./discuss-lock-CWXKBBYJ.mjs"),x=X(n),b=r.spec?await import("./spec-service-I23KJKKP.mjs").then(({specService:y})=>y.get(e,r.spec)).then(y=>y?.status??null).catch(()=>null):null;if(r.spec&&b===null){let{specService:y}=await import("./spec-service-I23KJKKP.mjs");if(await y.get(e,r.spec).then(M=>!M).catch(()=>!1))return{ok:!1,blocked:`Spec ${r.spec} not found.`}}let F=p({sddMode:h(o),harnessLevel:x.level,hasSpecId:!!r.spec,specStatus:b});if(F.blocked)return{ok:!1,blocked:F.message}}if(r.spec)try{let{effectiveSddMode:h}=await import("./sdd-HE7O6N5S.mjs"),{effectiveTddMode:p}=await import("./tdd-NQDHU62B.mjs"),{effectiveNyquistWorkMode:x,nyquistWorkVerdict:b}=await import("./nyquist-lite-A23B7G4B.mjs"),{specService:F}=await import("./spec-service-I23KJKKP.mjs"),y=X(n),M=(await F.get(e,r.spec))?.content?.acceptance_criteria??[],S=b({harnessLevel:y.level,criteria:M,mode:x(h(o),p(o))});if(S.blocked)return{ok:!1,blocked:S.message??"Nyquist-lite blocked work start."};S.message&&console.log(S.message)}catch{}{let h=o?.deliveryGeometry?.mode??"off";try{let{existsSync:p}=await import("node:fs"),x=await import("node:path"),{computeWorkingTreeChangeset:b,geometryOf:F,tierOf:y,geometryBlockMessage:_,intentGeometryVerdict:M,NORMAL_MAX_LOC:S}=await import("./delivery-geometry-GSJ6LXUC.mjs"),I=X(n),z=p(x.join(e,".git"))?await b(e):null,pt=o?.deliveryGeometry?.locThreshold??S,$e=!!(z&&z.loc>=pt);if(h==="strict"&&$e&&z&&!r.geometry){let gt=F(y(z));return{ok:!1,blocked:_(z,gt)}}let Q=M({harnessLevel:I.level,harnessRisk:I.risk,mode:h,explicitGeometry:r.geometry??null,treeLarge:$e});if(Q.blocked)return{ok:!1,blocked:Q.message??"Delivery geometry required at intent."};Q.message&&console.log(Q.message)}catch(p){if(p instanceof ee&&h==="strict")return{ok:!1,blocked:`Delivery geometry gate unevaluable: ${p.message}. Re-run when git is healthy, or pass \`--geometry\` explicitly.`}}}let l=/^[A-Z]+-\d+$/.test(n)?n:void 0,c=fe(),f=r.spec,d=X(n),g=await(async()=>{try{let h=await ue.readConfig(e).catch(()=>null),[{effectiveSddMode:p},{effectiveTddMode:x}]=await Promise.all([import("./sdd-HE7O6N5S.mjs"),import("./tdd-NQDHU62B.mjs")]),{effectiveWeakModelMode:b}=await import("./weak-model-mode-DH66XMD2.mjs");return me(d,p(h),x(h),b(h),`${n}::${c}`)}catch{return me(d,"off","off","off",`${n}::${c}`)}})(),{resolveCallerIdentity:k}=await import("./agent-identity-4KFRR5OU.mjs"),T=k(n),G=await(async()=>{let h=o?.multiAgent?.autoWorktree??"auto";try{let{getOccupancy:p,shouldIsolate:x,worktreeSlugFromIntent:b}=await import("./workspace-occupancy-JUXKZBUZ.mjs"),F=await p(t,e,T),y=x(F,h,n);if(y.block)return{blocked:y.reason};if(y.isolate&&F.isMain){let{worktreeService:_}=await import("./worktree-service-YRRPFU57.mjs"),M=b(n),S=await _.create(e,M);await _.setup(S.path,await _.getMainWorktree(e));let I=y.occupant;return{effectivePath:S.path,isolation:{reason:y.reason,worktreePath:S.path,branch:S.branch,slug:S.slug,occupantSummary:I?`${[I.ownerAgent,I.ownerIdentity].filter(Boolean).join("/")||"other"} \xB7 ${I.taskId.slice(0,8)} \xB7 "${I.description.slice(0,60)}"`:"foreign cycle"}}}}catch(p){if(p instanceof Error&&p.message.includes("already active"))return{blocked:p.message}}return{effectivePath:e,isolation:void 0}})();if("blocked"in G)return{ok:!1,blocked:G.blocked};let{effectivePath:B,isolation:q}=G,C=await j(B);if(C.gitError)return{ok:!1,blocked:`git ${C.gitError}: workspace identity unknown \u2014 refusing to start work on the main fallback. Re-run when git is healthy.`};let Y=C.isMain?Be:C.workspaceId,Z={id:c,description:n,sessionId:fe(),linearId:l,linkedSpecId:f,harness:d,ownerAgent:T.agent,ownerIdentity:T.identity,ownerSessionId:T.sessionId,yieldStatus:"active"};C.isMain?await w.startTask(t,Z):await w.startTaskInWorkspace(t,{...Z,branch:C.branch??q?.branch,workspaceId:C.workspaceId,worktreePath:C.worktreePath},C.workspaceId);try{let{ensureJudgmentLedger:h,intensityFromQuality:p}=await import("./judgment-orchestrator-E3SO3NVE.mjs");g.quality!=="none"&&await h({projectId:t,projectPath:e,signals:{harnessLevel:d.level,harnessKind:d.kind},forceIntensity:p(g.quality)})}catch{}try{let{prjctDb:h}=await import("./database-UU2ZXSD4.mjs");h.run(t,"UPDATE tasks SET expected_value = ? WHERE id = ?",String(g.expectedPoints),c);let{workGraph:p}=await import("./work-graph-WHMCFN6U.mjs");p.recordComplexity(t,c,{score:g.expectedPoints,recommendedSubtasks:g.expectedPoints>=5?Math.min(g.expectedPoints,6):0,reasoning:`Triage: ${d.level} \xB7 ${g.model}/${g.effort} \xB7 fan-out ${g.fanout}`})}catch{}let u=st(n,f),m=Ve(t,{taskId:c,workspaceId:Y,classification:u.kind,station:u.station,requiresSpec:u.requiresSpec,requiresTestsFirst:u.requiresTestsFirst,reason:u.reason,linkedSpecId:f??null});if(f)try{let{specService:h}=await import("./spec-service-I23KJKKP.mjs");await h.linkTask(e,f,c)}catch{}let v=await qe.ensureAuthor();await O.log(e,"task_started",{task:n,taskId:c,harness:d,timestamp:ne()},v.name),await ve(t,"task","after",{projectPath:e,skipRules:r.skipHooks});let R=q?.branch??await re(B).catch(()=>""),U=await hn(e,t,n),be=await mn(e,t,n),ft=gn(t,be),dt=await(async()=>{try{let{buildCycleBudgetCard:h}=await import("./cycle-budget-card-H37XRAIX.mjs"),{contextPressureVerdict:p}=await import("./context-pressure-5URQVNBC.mjs"),x=p(o,{turnCount:0,tokensIn:0,tokensOut:0}),b=h({turns:0,turnLimit:o?.maxTurnsPerCycle??x.limit,tokensSpent:0,tokenBudget:o?.maxTokensPerCycle??null,pressureLevel:x.level});return console.log(b.line),b.line}catch{return null}})();return{ok:!0,taskId:c,description:n,branch:R,linearId:l,linkedSpecId:f,harness:d,orchestration:g,ownerAgent:T.agent,ownerIdentity:T.identity,isolation:q,pipeline:{classification:m.classification,station:m.station,nextAction:ot(u),requiresSpec:m.requiresSpec,requiresTestsFirst:m.requiresTestsFirst},instructions:s.instructions,relatedContext:U,likelyFiles:be,risks:ft,cycleBudget:dt}}a(kr,"startTask");function gn(t,e){let n=new Set,r=[];try{for(let i of e.slice(0,5)){let s=Le.recallForFile(t,i.path,2,{preventiveOnly:!0});for(let o of s)if(!n.has(o.id)&&(n.add(o.id),r.push({id:o.id,label:Fe(o),title:We(o),file:i.path}),r.length>=4))return r}}catch{}return r}a(gn,"recallRisksForFiles");async function mn(t,e,n){try{let{resolveWorkScope:r,toLikelyFileHits:i}=await import("./work-scope-3LXOEIUX.mjs"),s=await r(t,e,n,8);return s.files.length>0?i(s.files):ge(e,n)}catch{try{return ge(e,n)}catch{return[]}}}a(mn,"recallLikelyFiles");async function hn(t,e,n){try{let{enrichedRecall:r}=await import("./enriched-recall-YXK7EIKH.mjs"),{deriveTitle:i}=await import("./format-5V6GF6JJ.mjs"),s=await r(t,e,{topic:n,types:["decision","gotcha","fact","spec","anti-pattern","pattern","learning","context"],limit:8});if(s.length===0)return[];let{recordSurfacedForActiveTask:o}=await import("./surface-attribution-WL7S53XX.mjs");return await o(e,t,s.map(l=>l.id)),s.map(l=>{let c=Me(l.content),f=c.relatedFiles??l.tags?.related_files?.split(",").filter(Boolean)??l.tags?.files?.split(",").filter(Boolean);return{id:l.id,type:l.type,title:i(l),detail:c.contextSynthesis??Ie(l.content,180),when:l.rememberedAt,author:c.whoAuthor??l.tags?.author,keyData:c.keyData??l.tags?.key_data,feature:c.featureDomain??l.tags?.feature,files:f,why:c.whyItMattered,pattern:c.pattern,antiPattern:c.antiPattern,decisionTrap:c.decisionTrap,outcome:c.outcome,nextImplication:c.nextImplication}})}catch{return[]}}a(hn,"recallRelatedContext");var ct=_e();async function vr(t,e,n){let r=n.toLowerCase(),i=pn.includes(r),s=await j(e);if(s.gitError)return{ok:!1,reason:"unsupported",message:`git ${s.gitError}: workspace identity unknown \u2014 refusing to change task status on the main fallback. Re-run when git is healthy.`};if(!s.isMain){let f=await w.getCurrentTaskForWorkspace(t,s.workspaceId);if(!f)return{ok:!1,reason:"no-active-task"};if(r==="done"||r==="completed"){let d=await ut(t,f.id),g=await ye(e,f);await O.log(e,L,{taskId:f.id,from:d??null,to:n,workspaceId:s.workspaceId,harnessWarnings:g.warnings}),await w.completeTaskInWorkspace(t,s.workspaceId),await lt(t,f.id,g.diffSize);try{let{usefulnessService:k}=await import("./usefulness-A3GRKFL3.mjs");k.creditShippedTask(t,f.id)}catch{}try{let{applyRetentionIncremental:k}=await import("./retention-S22T3SPT.mjs");k(t)}catch{}return{ok:!0,taskId:f.id,status:n,verificationWarnings:g.warnings,contextPrompt:ct}}return{ok:!1,reason:"unsupported",message:`'${n}' isn't supported for a worktree task yet \u2014 only 'done'. (pause/resume per-worktree is a planned follow-up)`}}if(i&&!await w.getCurrentTask(t)){let d=await w.resumeTask(t);if(d)return await O.log(e,L,{taskId:d.id,from:"paused",to:n}),{ok:!0,taskId:d.id,status:n}}let o=await w.getCurrentTask(t);if(!o)return{ok:!1,reason:"no-active-task"};let l=await ut(t,o.id),c=r==="done"||r==="completed"?await ye(e,o):{warnings:[],diffSize:0};await O.log(e,L,{taskId:o.id,from:l??null,to:n,harnessWarnings:c.warnings});try{if(r==="done"||r==="completed"){await w.completeTask(t),await lt(t,o.id,c.diffSize);try{let{usefulnessService:f}=await import("./usefulness-A3GRKFL3.mjs");f.creditShippedTask(t,o.id)}catch{}try{let{applyRetentionIncremental:f}=await import("./retention-S22T3SPT.mjs");f(t)}catch{}}else r==="paused"||r==="pause"?await w.pauseTask(t):i&&(await w.getCurrentTask(t)||await w.resumeTask(t))}catch{}return{ok:!0,taskId:o.id,status:n,verificationWarnings:c.warnings,contextPrompt:r==="done"||r==="completed"?ct:void 0}}a(vr,"setTaskStatus");async function yr(t,e){let n=await j(e);return n.gitError?null:n.isMain?w.getCurrentTask(t):w.getCurrentTaskForWorkspace(t,n.workspaceId)}a(yr,"resolveActiveTask");async function lt(t,e,n){try{let{prjctDb:r}=await import("./database-UU2ZXSD4.mjs"),{pointsFromDiffLines:i}=await import("./task-orchestration-GS4J4KGS.mjs"),s=r.get(t,"SELECT expected_value FROM tasks WHERE id = ?",e),o=Number(s?.expected_value);if(!Number.isFinite(o)||o<=0)return;r.run(t,`UPDATE tasks SET data = json_set(COALESCE(data, '{}'),
|
|
63
|
+
'$.expectedPoints', ?, '$.actualPoints', ?, '$.diffLines', ?)
|
|
64
|
+
WHERE id = ?`,o,i(n),n,e)}catch{}}a(lt,"recordEstimationOutcome");async function br(t,e,n){let r=await j(e);return r.gitError?null:r.isMain?w.completeTask(t,n):w.completeTaskInWorkspace(t,r.workspaceId,n)}a(br,"completeActiveTask");async function ut(t,e){try{let{default:n}=await import("./database-UU2ZXSD4.mjs"),r=n.query(t,"SELECT data FROM events WHERE type = ? ORDER BY id DESC LIMIT 10",`memory.${L}`);for(let i of r)try{let s=JSON.parse(i.data);if(s.taskId===e&&s.to)return s.to}catch{}}catch{}return null}a(ut,"readLastStatus");export{ve as a,X as b,hr as c,wr as d,kr as e,gn as f,ct as g,vr as h,yr as i,br as j,ut as k};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as d}from"./chunk-4PPIE6GA.mjs";import{a as p}from"./chunk-5EF5EOCL.mjs";import{a as l}from"./chunk-3TRXQAU4.mjs";var k={memories:"memories",tasks:"tasks",subtasks:"subtasks",ideas:"ideas",queue_tasks:"queue_tasks",custom_workflows:"custom_workflows",workflow_rules:"workflow_rules",archives:"archives",shipped_items:"shipped_items",shipped_features:"shipped_features",metrics_daily:"metrics_daily",work_cost_snapshots:"work_cost_snapshots",velocity_sprints:"velocity_sprints",analysis:"analysis",specs:"specs",memory:"memories",memory_entry:"memories",task:"tasks",paused_task:"tasks",subtask:"subtasks",idea:"ideas",queue:"queue_tasks",queue_task:"queue_tasks",shipped:"shipped_items",feature:"roadmap_features",workflow:"custom_workflows",workflow_rule:"workflow_rules",metric:"metrics_daily",work_cost_snapshot:"work_cost_snapshots",velocity:"velocity_sprints",spec:"specs",project:"projects",session:"sessions",agent:"agents"};function y(c){if(c)return k[c]}l(y,"toCloudTable");var w={memories:"memories",tasks:"tasks",subtasks:"tasks",queue_tasks:"tasks",ideas:"ideas",shipped_items:"shipped",shipped_features:"shipped",custom_workflows:"workflows",workflow_rules:"workflows",metrics_daily:"metrics",work_cost_snapshots:"metrics",velocity_sprints:"metrics",archives:"archives",analysis:"analysis",specs:"specs"},f={memories:!0,tasks:!0,ideas:!0,shipped:!0,workflows:!0,metrics:!0,archives:!0,user_prompts:!1,agent_sessions:!1,analysis:!0,specs:!0};function T(c,e){let t=w[c];return t?{...f,...e??{}}[t]!==!1:!0}l(T,"isTableIncluded");var v=Object.keys(f);function _(c){return c.replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}l(_,"camelToSnake");function R(c){let e={};for(let[t,s]of Object.entries(c))e[_(t)]=s;return e}l(R,"snakeCaseKeys");function E(c,e){let[t,s]=e.type.split("."),r=y(e.entityType)??y(t);if(!r)return null;let i=e.eventType==="delete"||s==="deleted"||s==="archived"||s==="removed"?"delete":"upsert",n=e.data||{},a=R(n),h=e.entityId||(typeof a.id=="string"?a.id:"")||(typeof n.id=="string"?n.id:"")||(typeof a.task_id=="string"?a.task_id:"")||(typeof n.taskId=="string"?n.taskId:"")||(typeof a.entity_id=="string"?a.entity_id:"")||"";h&&a.id==null&&(a.id=h);let u={event_type:i,entity_type:r,entity_id:h,data:{...a,project_id:c},project_id:c};return e.originDeviceId!==void 0&&(u.origin_device_id=e.originDeviceId),e.contentHash!==void 0&&(u.content_hash=e.contentHash),e.revisionCount!==void 0&&(u.revision_count=e.revisionCount),e.timestamp&&(u.ts=e.timestamp),u}l(E,"mapCliEventToWebFormat");function g(c,e){return e.map(t=>E(c,t)).filter(t=>t!==null)}l(g,"mapCliEventsToWebFormat");var m=class{static{l(this,"SyncClient")}retryConfig={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4};async pushEvents(e,t){let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=g(e,t),n=await this.fetchWithRetry(`${s}/sync/batch`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify({projectId:e,events:i})});if(!n.ok)throw await this.parseErrorResponse(n);return await n.json()}async pullEvents(e,t,s){let{apiUrl:r,apiKey:o,deviceId:i}=await this.getAuthHeaders();if(!o)throw this.createError("AUTH_REQUIRED","No API key configured");let n={projectId:e};typeof t=="number"&&t>0&&(n.sinceEventId=t);let a=await this.fetchWithRetry(`${r}/sync/pull`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(o,i)},body:JSON.stringify(n)});if(!a.ok)throw await this.parseErrorResponse(a);return await a.json()}async getStatus(e){let{apiUrl:t,apiKey:s,deviceId:r}=await this.getAuthHeaders();if(!s)throw this.createError("AUTH_REQUIRED","No API key configured");let o=await this.fetchWithRetry(`${t}/sync/status/${e}`,{method:"GET",headers:{...this.authHeaders(s,r)}});if(!o.ok)throw await this.parseErrorResponse(o);return await o.json()}async linkProject(e,t,s){let{apiUrl:r,apiKey:o,deviceId:i}=await this.getAuthHeaders();if(!o)throw this.createError("AUTH_REQUIRED","No API key configured");let n=await this.fetchWithRetry(`${r}/sync/link`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(o,i)},body:JSON.stringify({projectId:e,...t?{name:t}:{},...s?{meta:s}:{}})});if(!n.ok)throw await this.parseErrorResponse(n);return await n.json()}async setCloudLifecycle(e,t){try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();return r?(await this.fetchWithRetry(`${s}/sync/projects/${e}/${t}`,{method:"POST",headers:{...this.authHeaders(r,o)}})).ok:!1}catch{return!1}}async uploadCodeGraph(e,t){try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)return{ok:!1,reason:"unauthenticated"};let i=await this.fetchWithRetry(`${s}/sync/projects/${e}/code-graph`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify(t)});if(!i.ok)return{ok:!1,reason:await(async()=>{let h=`${i.status} ${i.statusText}`;try{let u=await i.json();return typeof u.detail=="string"?u.detail:u.detail!=null?JSON.stringify(u.detail).slice(0,300):h}catch{return h}})()};let n=await i.json();return{ok:n.ok!==!1,nodes:n.nodes,links:n.links}}catch(s){return{ok:!1,reason:s instanceof Error?s.message:String(s)}}}async publishBenchmark(e,t){let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)throw this.createError("AUTH_REQUIRED","No API key configured");let i=await this.fetchWithRetry(`${s}/benchmarks/evals`,{method:"POST",headers:{"Content-Type":"application/json",...this.authHeaders(r,o)},body:JSON.stringify({projectId:e,...t})});if(!i.ok)throw await this.parseErrorResponse(i);return await i.json()}async testConnection(){let e=new AbortController,t=setTimeout(()=>e.abort(),p("API_REQUEST"));try{let{apiUrl:s,apiKey:r,deviceId:o}=await this.getAuthHeaders();if(!r)return clearTimeout(t),!1;let i=await fetch(`${s}/auth/verify`,{method:"GET",headers:{...this.authHeaders(r,o)},signal:e.signal});return clearTimeout(t),i.status===401||i.status===403?(await d.clearAuth(),!1):i.ok}catch{return clearTimeout(t),!1}}async hasAuth(){return await d.hasAuth()}async getAuthHeaders(){let[e,t,s]=await Promise.all([d.getApiUrl(),d.getApiKey(),d.getDeviceId()]);return{apiUrl:e,apiKey:t,deviceId:s}}authHeaders(e,t){return{"X-Api-Key":e,"X-Device-Id":t}}async fetchWithRetry(e,t,s=0){let r=new AbortController,o=setTimeout(()=>r.abort(),p("API_REQUEST")),i=(t.method??"GET").toUpperCase(),n=i==="GET"||i==="HEAD";try{let a=await fetch(e,{...t,signal:r.signal});return clearTimeout(o),n&&a.status>=500&&s<this.retryConfig.maxRetries?this.scheduleRetry(e,t,s):a}catch(a){if(clearTimeout(o),a instanceof Error&&a.name==="AbortError")throw this.createError("NETWORK_ERROR",`Request timed out. Try increasing PRJCT_TIMEOUT_API_REQUEST (current: ${p("API_REQUEST")}ms)`);if(n&&s<this.retryConfig.maxRetries)return this.scheduleRetry(e,t,s);throw this.createError("NETWORK_ERROR",a instanceof Error?a.message:"Network request failed")}}async scheduleRetry(e,t,s){let r=Math.min(this.retryConfig.baseDelayMs*2**s,this.retryConfig.maxDelayMs);return await this.sleep(r),this.fetchWithRetry(e,t,s+1)}async parseErrorResponse(e){try{let t=await e.json(),s=t.detail||t.message||t.error||`HTTP ${e.status}`;return e.status===401||e.status===403?(await d.clearAuth(),this.createError("AUTH_REQUIRED",s,e.status)):e.status===402?this.createError("PAYMENT_REQUIRED",s,e.status):this.createError("API_ERROR",s,e.status)}catch{return e.status===401||e.status===403?(await d.clearAuth(),this.createError("AUTH_REQUIRED",`HTTP ${e.status}`,e.status)):this.createError("API_ERROR",`HTTP ${e.status}`,e.status)}}createError(e,t,s){return{code:e,message:t,status:s}}sleep(e){return new Promise(t=>setTimeout(t,e))}},b=new m,D=b;export{y as a,f as b,T as c,b as d,D as e};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as r}from"./chunk-3TRXQAU4.mjs";function l(e){let a=[{id:"detect",label:"Detect runtimes",status:e.detectedCount>0?"done":"skip",detail:e.detectedCount>0?`${e.detectedCount} host(s) on this machine`:"no agent CLIs detected (hooks still installed for Claude path)"},{id:"wire",label:"Wire hooks + MCP + skills",status:e.claudeHooksNew+e.claudeHooksPresent>0&&e.runtimesWired.length>0?"done":"partial",detail:`Claude hooks +${e.claudeHooksNew}/~${e.claudeHooksPresent}`+(e.runtimesWired.length?` \xB7 adapters: ${e.runtimesWired.join(", ")}`:" \xB7 multi-runtime: none detected")},{id:"surface",label:"Project surface",status:e.projectSurface?"done":"skip",detail:e.projectSurface?"AGENTS.md / adapters refreshed":"skipped (not inside initialized prjct project)"},{id:"board",label:"Organic multi-runtime board",status:e.detectedCount===0?"skip":e.liveCount>=Math.min(2,e.detectedCount)?"done":"partial",detail:`${e.liveCount}/${e.detectedCount} live (${e.organicPct}%)`},{id:"proof",label:"Harness \u0394 proof",status:e.deltaLine?"done":"skip",detail:e.deltaLine??"run `bun run demo:weak-vs-frontier`"}],o=e.detectedCount===0||e.liveCount>=Math.min(2,e.detectedCount),s=r(t=>t==="done"?"\u2713":t==="partial"?"\u25B3":"\xB7","mark"),n=`One-breath install: organic ${e.liveCount}/${e.detectedCount} (${e.organicPct}%) \xB7 wired [${e.runtimesWired.join(", ")||"claude"}] \xB7 ${o?"PASS":"NEEDS doctor --fix"}`,d=["# One-breath install","","Detect \u2192 wire all surfaces \u2192 organic board \u2192 proof. Zero multi-install ceremony.","","| Step | Status | Detail |","|---|:---:|---|",...a.map(t=>`| ${t.label} | ${s(t.status)} | ${t.detail} |`),"",`**${n}**`,"","_Dynasty: one install \xB7 one SQLite brain \xB7 every agent compounds. Never re-learn the OS._",""].join(`
|
|
8
|
+
`);return{title:"One-breath install",steps:a,line:n,md:d,organicOk:o}}r(l,"buildOneBreathReport");export{l as a};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as f}from"./chunk-MCY7OXED.mjs";import{i as a}from"./chunk-YQ6HM3YO.mjs";import{i as u}from"./chunk-6AFXUX2M.mjs";import{b as m}from"./chunk-LZC6NGB6.mjs";import{b as l}from"./chunk-3USVY66O.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";import{execSync as d}from"node:child_process";var h=1200,y=3;function C(t){try{return d("git diff --cached --name-only",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","pipe"]}).split(`
|
|
8
|
+
`).map(o=>o.trim()).filter(Boolean)}catch{return[]}}i(C,"stagedFiles");function b(t){let o=new Set;for(let r of t){let n=r.split("/").filter(Boolean);for(let s of n){let e=s.replace(/\.[^.]+$/,"").toLowerCase();e.length>=3&&o.add(e)}}return[...o]}i(b,"pathFragments");function k(t,o){let r=t.content.toLowerCase();if(o.some(n=>r.includes(n)))return!0;for(let n of Object.values(t.tags)){let s=n.toLowerCase();if(o.some(e=>s.includes(e)))return!0}return!1}i(k,"mentionsFragment");async function I(t){let o=await l.readConfig(t);if(!o?.projectId)return null;let r=C(t);if(r.length===0)return null;let n=b(r);if(n.length===0)return null;let s=(()=>{try{return m.recall(o.projectId,{types:["anti-pattern","gotcha"],limit:50})}catch{return null}})();if(!s)return null;let e=s.filter(g=>k(g,n)).slice(0,y);if(e.length===0)return null;let c=["# prjct: heads-up for this commit",""];c.push(`${e.length} anti-pattern/gotcha entr${e.length===1?"y":"ies"} match the staged files.`),c.push(""),c.push(u(e)),c.push(""),c.push("> Nudge, not block. Proceed if you think it still applies.");let p=c.join(`
|
|
9
|
+
`);return a(p,h)}i(I,"buildPreCommitContext");function _(t=process.cwd(),o){return f({event:"PreToolUse",projectPath:t,build:i(async(r,n)=>w(r)?I(n):null,"build")},o)}i(_,"runPreCommitHook");function w(t){return/\bgit\s+commit\b/.test(t.tool_input?.command??"")}i(w,"isCommitInput");export{I as a,_ as b,w as c};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as v}from"./chunk-HCPQZRR3.mjs";import{g as f,i as _}from"./chunk-DMO3ZFUG.mjs";import{d as M,e as I,p as A}from"./chunk-HYIT7MF5.mjs";import{a as l}from"./chunk-3TRXQAU4.mjs";import D from"node:fs/promises";import E from"node:path";_();A();var B=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","of","in","to","for","with","on","at","from","by","as","or","and","but","if","not","no","so","up","out","this","that","it","its","all","any","import","export","default","const","let","var","function","class","interface","type","return","new","true","false","null","undefined","void","async","await","static","public","private","protected","readonly","string","number","boolean","object","array"]);function h(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[-_./]/g," ").toLowerCase().split(/\s+/).filter(e=>e.length>1)}l(h,"splitIdentifier");function k(t,e){let n=[],o=e.replace(/\.[^.]+$/,"").split(/[/\\]/).filter(Boolean);for(let i of o)n.push(...h(i));let r=[/export\s+(?:async\s+)?function\s+(\w+)/g,/export\s+class\s+(\w+)/g,/export\s+interface\s+(\w+)/g,/export\s+type\s+(\w+)/g,/export\s+(?:const|let|var)\s+(\w+)/g,/export\s+default\s+(?:class|function)\s+(\w+)/g];for(let i of r)for(let s of t.matchAll(i))s[1]&&n.push(...h(s[1]));let a=[/(?:async\s+)?function\s+(\w+)/g,/class\s+(\w+)/g,/interface\s+(\w+)/g,/type\s+(\w+)\s*=/g];for(let i of a)for(let s of t.matchAll(i))s[1]&&n.push(...h(s[1]));let d=/(?:from|import)\s+['"]([^'"]+)['"]/g;for(let i of t.matchAll(d)){let s=i[1];if(s.startsWith(".")||s.startsWith("@/"))n.push(...h(s));else{let g=s.startsWith("@")?s.split("/").slice(0,2).join("/"):s.split("/")[0];n.push(...h(g))}}let c=/\/\/\s*(.+)/g;for(let i of t.matchAll(c)){let s=i[1].toLowerCase().split(/\s+/).filter(g=>g.length>2);n.push(...s)}let u=/\/\*\*?([\s\S]*?)\*\//g;for(let i of t.matchAll(u)){let s=i[1].replace(/@\w+/g,"").replace(/\*/g,"").toLowerCase().split(/\s+/).filter(g=>g.length>2&&/^[a-z]+$/.test(g));n.push(...s)}return n.filter(i=>i.length>1&&!B.has(i)&&/^[a-z][a-z0-9]*$/.test(i))}l(k,"tokenizeFile");function R(t){return t.split(/\s+/).flatMap(e=>h(e)).filter(e=>e.length>1&&!B.has(e)&&/^[a-z][a-z0-9]*$/.test(e))}l(R,"tokenizeQuery");function x(){return Object.create(null)}l(x,"emptyInvertedIndex");async function F(t){let e=await M(t),n={},o=x(),r=await I(e,50,async c=>{try{let u=await D.readFile(E.join(t,c),"utf-8"),i=k(u,c);return i.length>0?{filePath:c,tokens:i}:null}catch{return null}});for(let{filePath:c,tokens:u}of r){n[c]={tokens:u,length:u.length};for(let[i,s]of b(u))o[i]||(o[i]=[]),o[i].push({path:c,tf:s})}let a=r.reduce((c,u)=>c+u.tokens.length,0),d=Object.keys(n).length;return{documents:n,invertedIndex:o,avgDocLength:d>0?a/d:0,totalDocs:d,builtAt:new Date().toISOString()}}l(F,"buildIndex");function C(t,e){return Math.log((e-t+.5)/(t+.5)+1)}l(C,"idf");function N(t,e){let n=R(t);if(n.length===0)return[];let o=new Map;for(let r of n){let a=e.invertedIndex[r];if(!a)continue;let d=C(a.length,e.totalDocs);for(let{path:c,tf:u}of a){let i=e.documents[c];if(!i)continue;let s=u*(1.2+1),g=u+1.2*(1-.75+.75*(i.length/e.avgDocLength)),T=d*(s/g);o.set(c,(o.get(c)||0)+T)}}return v(o)}l(N,"score");var p="bm25-index";function b(t){let e=new Map;for(let n of t)e.set(n,(e.get(n)||0)+1);return e}l(b,"termFrequencies");function P(t,e){let n=t.documents[e];if(!n)return;delete t.documents[e];let o=new Set(n.tokens),r=o.size>0?o:new Set(Object.keys(t.invertedIndex));for(let a of r){let d=t.invertedIndex[a];if(!d)continue;let c=d.filter(u=>u.path!==e);c.length===0?delete t.invertedIndex[a]:t.invertedIndex[a]=c}}l(P,"removeDocument");function z(t,e,n){if(n.length!==0){t.documents[e]={tokens:n,length:n.length};for(let[o,r]of b(n))t.invertedIndex[o]||(t.invertedIndex[o]=[]),t.invertedIndex[o].push({path:e,tf:r})}}l(z,"addDocument");function q(t){let e=Object.values(t.documents).map(o=>o.length),n=e.reduce((o,r)=>o+r,0);t.totalDocs=e.length,t.avgDocLength=e.length>0?n/e.length:0,t.builtAt=new Date().toISOString()}l(q,"recalculateStats");var m=new Map;function y(t){return{schemaVersion:2,avgDocLength:t.avgDocLength,totalDocs:t.totalDocs,builtAt:t.builtAt,docLengths:Object.fromEntries(Object.entries(t.documents).map(([e,n])=>[e,n.length]))}}l(y,"indexMetadata");function L(t,e,n,o,r){if(o.length!==0){t.run(n,JSON.stringify(o),o.length,r);for(let[a,d]of b(o))e.run(a,n,d)}}l(L,"writeDocumentRows");function W(t,e){try{f.transaction(t,n=>{n.prepare("DELETE FROM bm25_terms").run(),n.prepare("DELETE FROM bm25_documents").run();let o=new Date().toISOString(),r=n.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),a=n.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)");for(let[d,c]of Object.entries(e.documents))L(r,a,d,c.tokens,o)})}catch{}}l(W,"replacePerFileTables");function $(t,e,n,o){try{f.transaction(t,r=>{let a=r.prepare("DELETE FROM bm25_terms WHERE path = ?"),d=r.prepare("DELETE FROM bm25_documents WHERE path = ?"),c=r.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),u=r.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)"),i=new Date().toISOString();for(let s of new Set([...n,...o]))a.run(s),d.run(s);for(let s of n){let g=e.documents[s];g&&L(c,u,s,g.tokens,i)}})}catch{}}l($,"updatePerFileTables");function V(t,e){f.setDoc(t,p,y(e)),W(t,e),m.delete(t)}l(V,"saveIndex");function U(t,e,n,o){f.setDoc(t,p,y(e)),$(t,e,n,o),m.delete(t)}l(U,"saveIndexUpdate");function H(t,e,n){try{let o=f.query(t,"SELECT path, length FROM bm25_documents ORDER BY path");if(o.length===0){if(n?.totalDocs===0){let s={documents:{},invertedIndex:x(),avgDocLength:0,totalDocs:0,builtAt:n.builtAt};return m.set(t,{index:s,updatedAt:e}),s}return null}let r={},a=x();for(let s of o)r[s.path]={tokens:[],length:s.length};let d=o.reduce((s,g)=>s+g.length,0),c=f.query(t,"SELECT token, path, tf FROM bm25_terms ORDER BY token, path");for(let s of c)a[s.token]||(a[s.token]=[]),a[s.token].push({path:s.path,tf:s.tf});let u=o.length,i={documents:r,invertedIndex:a,avgDocLength:u>0?d/u:0,totalDocs:u,builtAt:n?.builtAt??e};return m.set(t,{index:i,updatedAt:e}),i}catch{return null}}l(H,"loadIndexFromPerFileTables");function G(t){try{return f.get(t,"SELECT key AS k FROM kv_store WHERE key = ? LIMIT 1",p)!=null}catch{return!1}}l(G,"hasIndex");function O(t){let e=f.get(t,"SELECT updated_at FROM kv_store WHERE key = ?",p);if(!e)return m.delete(t),null;let n=m.get(t);if(n&&n.updatedAt===e.updated_at)return n.index;let o=f.getDoc(t,p),r=H(t,e.updated_at,o);if(r)return r;if(!o?.invertedIndex)return null;let a={};for(let[c,u]of Object.entries(o.docLengths))a[c]={tokens:[],length:u};let d={documents:a,invertedIndex:Object.assign(x(),o.invertedIndex),avgDocLength:o.avgDocLength,totalDocs:o.totalDocs,builtAt:o.builtAt};return m.set(t,{index:d,updatedAt:e.updated_at}),d}l(O,"loadIndex");async function Y(t,e){let n=await F(t);return V(e,n),n}l(Y,"indexProject");async function tt(t,e,n,o=[]){let r=O(e);if(!r)return Y(t,e);let a=new Set([...n,...o]);for(let c of a)P(r,c);let d=await I(n,50,async c=>{try{let u=await D.readFile(E.join(t,c),"utf-8"),i=k(u,c);return{filePath:c,tokens:i}}catch{return null}});for(let{filePath:c,tokens:u}of d)z(r,c,u);return q(r),U(e,r,n,o),r}l(tt,"updateProjectIndex");function et(t,e,n=15){let o=O(t);return o?N(e,o).slice(0,n):[]}l(et,"queryFiles");export{G as a,O as b,Y as c,tt as d,et as e};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{g,i as v}from"./chunk-DMO3ZFUG.mjs";import{a as h}from"./chunk-3TRXQAU4.mjs";v();var y=BigInt(300*1e9),b=class{static{h(this,"PerformanceTracker")}marks=new Map;markStart(e){this.pruneStaleMarks(),this.marks.set(e,process.hrtime.bigint())}markEnd(e){let r=this.marks.get(e);if(r===void 0)return null;let n=process.hrtime.bigint();return this.marks.delete(e),Number(n-r)/1e6}pruneStaleMarks(){if(this.marks.size<10)return;let e=process.hrtime.bigint();for(let[r,n]of this.marks)e-n>y&&this.marks.delete(r)}computeMetricStats(e){return{avg:Math.round(e.reduce((r,n)=>r+n,0)/e.length),min:Math.min(...e),max:Math.max(...e),count:e.length}}recordSample(e,r,n,a,s){let m=new Date().toISOString();g.run(e,"INSERT INTO perf_samples (metric, value, unit, data, timestamp) VALUES (?, ?, ?, ?, ?)",r,a??null,s??null,JSON.stringify(n),m)}recordTiming(e,r,n,a){let s=Math.round(n*100)/100;this.recordSample(e,r,{metric:r,value:s,unit:"ms",context:a},s,"ms")}snapshotMemory(){let e=process.memoryUsage();return{heapUsed:e.heapUsed,heapTotal:e.heapTotal,rss:e.rss,external:e.external}}recordMemory(e,r){let n=this.snapshotMemory(),a=[{metric:"heap_used",value:n.heapUsed,unit:"bytes"},{metric:"heap_total",value:n.heapTotal,unit:"bytes"},{metric:"rss",value:n.rss,unit:"bytes"},{metric:"external_memory",value:n.external,unit:"bytes"}];for(let s of a)this.recordSample(e,s.metric,{metric:s.metric,value:s.value,unit:s.unit,context:r},s.value,s.unit);return n}recordContextCorrectness(e,r){this.recordSample(e,"context_correctness",{metric:"context_correctness",...r})}recordSubtaskHandoff(e,r){this.recordSample(e,"subtask_handoff",{metric:"subtask_handoff",...r})}getMetrics(e,r){r||(r=new Date,r.setDate(r.getDate()-7));let n=r.toISOString(),a=[];try{let m=g.query(e,"SELECT data, timestamp FROM perf_samples WHERE timestamp >= ? ORDER BY id DESC",n);for(let o of m){let d=JSON.parse(o.data);a.push({...d,timestamp:o.timestamp})}}catch{}let s=g.query(e,"SELECT data, timestamp FROM events WHERE type LIKE ? AND timestamp >= ? ORDER BY id DESC","perf.%",n);for(let m of s){let o=JSON.parse(m.data);a.push({...o,timestamp:m.timestamp})}return a}getReport(e,r=7){let n=new Date;n.setDate(n.getDate()-r),n.setHours(0,0,0,0);let a=this.getMetrics(e,n),s={period:`${r}d`},m=a.filter(t=>"metric"in t&&t.metric==="startup_time");if(m.length>0){let t=m.map(c=>c.value);s.startup={...this.computeMetricStats(t),unit:"ms"}}let o=a.filter(t=>"metric"in t&&t.metric==="heap_used"),d=a.filter(t=>"metric"in t&&t.metric==="rss");if(o.length>0){let t=h(p=>Math.round(p/1048576*10)/10,"toMB"),c=o.map(p=>p.value),u=d.map(p=>p.value);s.memory={avgHeapMB:t(c.reduce((p,M)=>p+M,0)/c.length),peakHeapMB:t(Math.max(...c)),avgRssMB:u.length>0?t(u.reduce((p,M)=>p+M,0)/u.length):0}}let i=a.filter(t=>"metric"in t&&t.metric==="context_correctness");if(i.length>0){let t=i.filter(c=>c.receivedSync).length;s.contextCorrectness={total:i.length,receivedSync:t,rate:Math.round(t/i.length*100)}}let f=a.filter(t=>"metric"in t&&t.metric==="subtask_handoff");if(f.length>0){let t=f.filter(c=>c.outputPopulated).length;s.subtaskHandoff={total:f.length,outputPopulated:t,rate:Math.round(t/f.length*100)}}let l=a.filter(t=>"metric"in t&&t.metric==="command_duration");if(l.length>0){let t={};for(let c of l){let u=c.context?.command||"unknown";t[u]||(t[u]=[]),t[u].push(c.value)}s.commandDurations={};for(let[c,u]of Object.entries(t))s.commandDurations[c]={...this.computeMetricStats(u),unit:"ms"}}return s}getLatencyReport(e,r=7){let n=new Date;n.setDate(n.getDate()-r);let a=this.getMetrics(e,n).filter(o=>"metric"in o&&o.metric==="command_duration"),s=new Map;for(let o of a){let d=typeof o.context?.command=="string"?o.context.command:"unknown",i=s.get(d)??[];i.push(o.value),s.set(d,i)}let m={};for(let[o,d]of s){let i=[...d].sort((l,t)=>l-t),f=h(l=>i[Math.min(i.length-1,Math.max(0,Math.ceil(i.length*l)-1))],"percentile");m[o]={count:i.length,min:i[0],p50:f(.5),p95:f(.95),max:i.at(-1),avg:Math.round(i.reduce((l,t)=>l+t,0)/i.length*100)/100}}return{period:`${r}d`,commands:m}}},S=new b,k=S;export{S as a,k as b};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as i}from"./chunk-3TRXQAU4.mjs";function a(e,r){let n=r?.turnCount??0,o=e?.maxTurnsPerCycle&&e.maxTurnsPerCycle>0?e.maxTurnsPerCycle:15,c=o>0?n/o:0;if(!r||n<=0)return{level:"ok",cue:null,turns:n,limit:o,ratio:0};let s=e?.maxTokensPerCycle??0,l=(r.tokensIn??0)+(r.tokensOut??0),u=s>0?l/s:0,t=Math.max(c,u);return t>=.7?{level:"critical",turns:n,limit:o,ratio:t,cue:`# prjct: context density (high ~${Math.round(t*100)}%)
|
|
8
|
+
Session continues \u2014 do NOT force land/clear just because the cycle is long.
|
|
9
|
+
Protect the window: no broad Grep/Glob thrash, no re-research from zero, pull memory by id (\`prjct context memory mem_N\`), prefer compact format.
|
|
10
|
+
Persist durable signal with \`prjct remember\` / land when YOU choose hygiene \u2014 not as a kill switch.
|
|
11
|
+
Host "Context 100%" is the real window limit; until then keep working with high-signal tools only.`}:t>=.6?{level:"warn",turns:n,limit:o,ratio:t,cue:`# prjct: context density (~${Math.round(t*100)}%)
|
|
12
|
+
Keep the chat \u2014 prefer high-signal tools only:
|
|
13
|
+
1. Finish the current slice (no new rabbit holes)
|
|
14
|
+
2. Recall compact / by-id \u2014 do not re-index the tree
|
|
15
|
+
3. Optional hygiene later: \`prjct land\` then \`prjct prime\` if the HOST context is actually full
|
|
16
|
+
Do not treat this as "session must end".`}:{level:"ok",cue:null,turns:n,limit:o,ratio:t}}i(a,"contextPressureVerdict");function h(e,r){return r?.contextPressure?.hardBlockShip===!0&&e.level==="critical"}i(h,"contextPressureBlocksExpansion");function p(e){return e.level==="critical"?`ctx:${Math.round(e.ratio*100)}% density \u2014 compact tools only`:e.level==="warn"?`ctx:${Math.round(e.ratio*100)}% density \u2014 prefer compact`:""}i(p,"contextPressureStatusLine");function x(e){return e.level==="warn"||e.level==="critical"}i(x,"contextPressureRequiresCompactPath");export{a,h as b,p as c,x as d};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as u}from"./chunk-L4TUXFCL.mjs";import{b as E}from"./chunk-Q6C27OL7.mjs";import{f as i,i as T}from"./chunk-DMO3ZFUG.mjs";import{e as y,l as _}from"./chunk-HU5ERAAV.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";_();T();function p(v,t,e){return{id:v,entity_type:t.entityType,entity_id:t.entityId,entity_data:JSON.stringify(t.entityData),summary:t.summary??null,reason:t.reason,archived_at:e,created_at:e}}c(p,"archiveSyncPayload");var A={SHIPPED_RETENTION_DAYS:90,IDEA_DORMANT_DAYS:180,QUEUE_COMPLETED_DAYS:7,PAUSED_TASK_DAYS:30,MEMORY_MAX_ENTRIES:500},h=class{static{c(this,"ArchiveStorage")}archive(t,e){let r=u(),n=y();return i.run(t,"INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)",r,e.entityType,e.entityId,JSON.stringify(e.entityData),e.summary??null,n,e.reason),E({projectId:t,entityType:"archives",entityId:r,eventType:"upsert",data:p(r,e,n)}),r}archiveMany(t,e){if(e.length===0)return 0;let r=y(),n=[];i.transaction(t,a=>{let o=a.prepare("INSERT INTO archives (id, entity_type, entity_id, entity_data, summary, archived_at, reason) VALUES (?, ?, ?, ?, ?, ?, ?)");for(let s of e){let d=u();o.run(d,s.entityType,s.entityId,JSON.stringify(s.entityData),s.summary??null,r,s.reason),n.push({id:d,item:s})}});for(let{id:a,item:o}of n)E({projectId:t,entityType:"archives",entityId:a,eventType:"upsert",data:p(a,o,r)});return e.length}getArchived(t,e,r=50){return e?i.query(t,"SELECT * FROM archives WHERE entity_type = ? ORDER BY archived_at DESC LIMIT ?",e,r):i.query(t,"SELECT * FROM archives ORDER BY archived_at DESC LIMIT ?",r)}getStats(t){let e=i.query(t,"SELECT entity_type, COUNT(*) as count FROM archives GROUP BY entity_type"),r={shipped:0,idea:0,queue_task:0,paused_task:0,memory_entry:0,workspace_task:0,total:0};for(let n of e){let a=n.entity_type;a in r&&(r[a]=n.count),r.total+=n.count}return r}restore(t,e){let r=i.get(t,"SELECT * FROM archives WHERE id = ?",e);return r?(i.run(t,"DELETE FROM archives WHERE id = ?",e),JSON.parse(r.entity_data)):null}pruneOldArchives(t,e){let r=new Date(Date.now()-e*24*60*60*1e3).toISOString(),n=this.getTotalCount(t);i.run(t,"DELETE FROM archives WHERE archived_at < ?",r);let a=this.getTotalCount(t);return n-a}getTotalCount(t){return i.get(t,"SELECT COUNT(*) as count FROM archives")?.count??0}},O=new h;export{A as a,O as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as b,b as m}from"./chunk-6OYLZ4NM.mjs";import{a as u,b as g}from"./chunk-YEALP3WX.mjs";import{b as f}from"./chunk-LZC6NGB6.mjs";import{a as d}from"./chunk-3TRXQAU4.mjs";function M(o,i,s=8){let r=i.map(e=>e.trim()).filter(Boolean),h=!!g(o),l=!!m(o),c=new Map;if(r.length>0&&h)try{for(let e of u(r,g(o),2)){if(r.some(n=>n.endsWith(e.path)||e.path.endsWith(n)))continue;let t=c.get(e.path)??{score:0,via:new Set};t.score+=e.score,t.via.add("imports"),c.set(e.path,t)}}catch{}if(r.length>0&&l)try{for(let e of b(r,m(o))){if(r.some(n=>n.endsWith(e.path)||e.path.endsWith(n)))continue;let t=c.get(e.path)??{score:0,via:new Set};t.score+=e.score,t.via.add("cochange"),c.set(e.path,t)}}catch{}let p=[...c.entries()].map(([e,t])=>({path:e,score:t.score,via:t.via.size>1?"both":[...t.via][0]??"imports"})).sort((e,t)=>t.score-e.score).slice(0,s),a=[];for(let e of r.slice(0,5))try{let t=f.recallForFile(o,e,2,{preventiveOnly:!0});for(let n of t)a.push({id:n.id,type:n.type,title:n.content.replace(/\s+/g," ").trim().slice(0,100),file:e})}catch{}let $=p.length>0?`related=${p.slice(0,3).map(e=>e.path.split("/").pop()).join(",")}`:h||l?"related=none-strong":"indexes=cold",v=a.length>0?`traps=${a.length}`:"traps=0",y=r.length===0?"World model: no seed files":`World model impact: seeds=${r.length} \xB7 ${$} \xB7 ${v}`;return{seeds:r,neighbors:p,traps:a.slice(0,s),line:y,hasIndexes:{imports:h,cochange:l}}}d(M,"breakImpact");function S(o){if(o.seeds.length===0)return"";let i=["# prjct: world-model impact",o.line,""];if(o.neighbors.length>0){i.push("Related (imports/co-change):");for(let s of o.neighbors.slice(0,6))i.push(`- \`${s.path}\` (${s.via}, score=${s.score.toFixed(2)})`);i.push("")}if(o.traps.length>0){i.push("Judgment on seed files:");for(let s of o.traps.slice(0,5))i.push(`- **[${s.type}]** ${s.title} \`${s.id}\``)}return i.join(`
|
|
8
|
+
`).trim()}d(S,"formatImpactMd");export{M as a,S as b};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{g as d,i as r}from"./chunk-DMO3ZFUG.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";r();function t(e,s=500){let n=e?.replace(/\s+/g," ").trim();return n?n.length<=s?n:`${n.slice(0,s-3)}...`:null}o(t,"cleanText");function i(e){let s=[];return e.agent&&s.push(`agent=${e.agent}`),(e.tokensIn??0)+(e.tokensOut??0)>0&&(s.push(`tokens_in=${Math.round(e.tokensIn??0)}`),s.push(`tokens_out=${Math.round(e.tokensOut??0)}`)),e.filesTouched&&e.filesTouched.length>0&&s.push(`files_touched=${e.filesTouched.length}`),s.length===0?null:s.join(" ")}o(i,"summary");function a(e){if(!e.sessionId)return;let s=new Date().toISOString();try{d.run(e.projectId,`INSERT INTO agent_sessions
|
|
8
|
+
(id, project_id, directory, task_id, goal, started_at, created_at)
|
|
9
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
10
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
11
|
+
directory = COALESCE(excluded.directory, agent_sessions.directory),
|
|
12
|
+
task_id = COALESCE(excluded.task_id, agent_sessions.task_id),
|
|
13
|
+
goal = COALESCE(excluded.goal, agent_sessions.goal)`,e.sessionId,e.projectId,t(e.directory),t(e.taskId),t(e.goal),s,s)}catch{}}o(a,"recordAgentSessionStart");function c(e){if(!e.sessionId)return;let s=new Date().toISOString(),n=e.filesTouched&&e.filesTouched.length>0?JSON.stringify(e.filesTouched.slice(0,100)):null;try{d.run(e.projectId,`INSERT INTO agent_sessions
|
|
14
|
+
(id, project_id, directory, task_id, goal, started_at, ended_at, summary, files_touched, runtime, model, created_at)
|
|
15
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
16
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
17
|
+
directory = COALESCE(excluded.directory, agent_sessions.directory),
|
|
18
|
+
task_id = COALESCE(excluded.task_id, agent_sessions.task_id),
|
|
19
|
+
goal = COALESCE(excluded.goal, agent_sessions.goal),
|
|
20
|
+
ended_at = excluded.ended_at,
|
|
21
|
+
summary = COALESCE(excluded.summary, agent_sessions.summary),
|
|
22
|
+
files_touched = COALESCE(excluded.files_touched, agent_sessions.files_touched),
|
|
23
|
+
runtime = excluded.runtime,
|
|
24
|
+
model = CASE WHEN excluded.model = 'unknown' THEN agent_sessions.model ELSE excluded.model END`,e.sessionId,e.projectId,t(e.directory),t(e.taskId),t(e.goal),s,s,i(e),n,t(e.agent,32)??"unknown",t(e.model,120)??"unknown",s)}catch{}}o(c,"recordAgentSessionEnd");export{a,c as b};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{f as p}from"./chunk-6AFXUX2M.mjs";import{e as f}from"./chunk-X35YYOFE.mjs";import{b as g}from"./chunk-LZC6NGB6.mjs";import{g as m,i as _}from"./chunk-DMO3ZFUG.mjs";import{a as l}from"./chunk-3TRXQAU4.mjs";_();var S=8,y=140;function h(d,r){if(r.length===0)return 0;let n=[];try{m.transaction(d,s=>{let i=s.prepare("DELETE FROM memory_embeddings WHERE memory_id = ?"),c=s.prepare("DELETE FROM memory_entries WHERE id = ?"),t=s.prepare("DELETE FROM events WHERE id = ? AND type LIKE 'memory.remember.%'");for(let e of r){try{i.run(e)}catch{}c.run(e).changes&&n.push(e);let a=e.match(/^mem_(\d+)$/);if(a)try{t.run(Number(a[1]))}catch{}}})}catch{return n.length}return n.length}l(h,"hardDeleteEntries");function w(d,r,n){let s=new Map;for(let e of r)s.set(e.type,(s.get(e.type)??0)+1);let i=[...s.entries()].sort((e,o)=>o[1]-e[1]).map(([e,o])=>`${e}\xD7${o}`).join(", "),c=r.map(e=>p(e).replace(/\s+/g," ").trim()).filter(e=>e.length>20).slice(0,S).map(e=>`- ${e.length>y?`${e.slice(0,y-1)}\u2026`:e}`),t=[`Distill of discarded auto-history (${d}).`,`Context synthesis: ${r.length} low-value rows collapsed \u2014 raw history deleted; only this digest remains for the project model.`,`Key data: source=retention-distill; discarded=${r.length}; types=${i}; at=${n}`,"What happened: purged auto-generated / redundant captures that added no excess vs the reference model.","Why it mattered: prevent vault bloat; agents must not re-read detector noise.",`Outcome: ${r.length} raw entries hard-deleted after distillation.`,"Next implication: prefer high-excess judgment; re-run detectors only when code/model changes."];return c.length>0&&t.push(`Sample cues (not full bodies):
|
|
8
|
+
${c.join(`
|
|
9
|
+
`)}`),t.join(" ")}l(w,"buildDistillContent");async function A(d,r,n,s,i){if(s.length<=i)return{discarded:0,digested:!1};let t=[...s].sort((u,b)=>b.rememberedAt.localeCompare(u.rememberedAt)).slice(i);if(t.length===0)return{discarded:0,digested:!1};let e=new Date().toISOString(),o=`auto-distill:${n}`,a=w(n,t,e),E=await g.remember(d,{type:"learning",content:a,tags:{source:"retention-distill",topic:o,capture:"distill-discard-v1",context_schema:"living-v2",synthesis:"deterministic",discarded_count:String(t.length),auto_source:n},provenance:"inferred",projectId:r}).then(()=>!0).catch(()=>!1),D=t.map(u=>u.id);return{discarded:h(r,D),digested:E,digestTopic:o}}l(A,"distillAndDiscardAutoSource");async function v(d,r,n){let s=g.allEntriesForIndex(r),i=new Map;for(let t of s){let e=t.tags?.source;if(!f(e)||e==="retention-distill"||t.tags?.source==="retention-distill")continue;let o=i.get(e)??[];o.push(t),i.set(e,o)}let c=[];for(let[t,e]of i){if(e.length<=n)continue;let o=await A(d,r,t,e,n);c.push(o)}return{discarded:c.reduce((t,e)=>t+e.discarded,0),digests:c.filter(t=>t.digested).length}}l(v,"distillAndDiscardAllAutoSources");function x(d,r,n=1e3){let s=Date.now()-r*864e5;try{let i=m.query(d,`SELECT id, type, content FROM memory_entries
|
|
10
|
+
WHERE deleted_at IS NOT NULL AND deleted_at < ?
|
|
11
|
+
ORDER BY deleted_at ASC
|
|
12
|
+
LIMIT ?`,s,n);return i.length===0?{purged:0,digested:!1}:{purged:h(d,i.map(t=>t.id)),digested:!1}}catch{return{purged:0,digested:!1}}}l(x,"eliminateSoftDeletedNoValue");export{h as a,w as b,A as c,v as d,x as e};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as o}from"./chunk-3TRXQAU4.mjs";var l=new Set(["decision","gotcha","fact","spec","identity","voice","glossary"]);function f(n){return l.has(n)}o(f,"isSotBindType");function u(n,t){let e=new Set(t??[]);return n.filter(r=>f(r.type)&&r.confidence==="high"&&r.id&&!e.has(r.id))}o(u,"filterSotCandidates");function p(n){let t=u(n.candidates,n.overriddenIds);if(t.length===0)return{action:"none",reason:"no-sot",memoryIds:[],message:""};let e=n.harnessLevel??null,r=n.fileLabel?` on \`${n.fileLabel}\``:"",i=t[0],a=t.map(s=>s.id),d='To supersede: `prjct remember decision "\u2026why\u2026" --tags supersedes:'+i.id+'`. To lift for this memory: `prjct remember feedback "override conflict '+i.id+': <why>" --tags conflict:override,memory:'+i.id+"`.";if(e==="H2"||e==="H3"){let s=`SoT hard-bind (${e})${r}: must not contradict [${i.type}] ${c(i.content,80)} (\`${i.id}\`)`;return{action:"deny",reason:"h2-sot-deny",memoryIds:a,message:[`\u26D4 prjct SoT bind: ${s}`,`Memories: ${a.join(", ")}`,d,"H2+ work is bound to living Source-of-Truth. Supersede or override before Edit|Write."].join(" ")}}return e==="H1"?{action:"warn",reason:"h1-sot-warn",memoryIds:a,message:["# prjct: SoT soft-bind (H1)","",`High-confidence SoT on this file${r}:`,...t.slice(0,3).map(s=>`- **[${s.type}]** ${c(s.content,100)} \`${s.id}\``),"",d,"","> H2+ would hard-block. On H1 this is advisory \u2014 supersede if intentional."].join(`
|
|
8
|
+
`)}:{action:"none",reason:"none",memoryIds:a,message:""}}o(p,"sotBindVerdict");function c(n,t){let e=n.replace(/\s+/g," ").trim();return e.length>t?`${e.slice(0,t-1)}\u2026`:e}o(c,"truncate");function h(n,t){if(t.length===0)return null;let e=[`# prjct: heads-up before editing \`${n}\``,"",`${t.length} preventive trap(s) recorded against this file:`,""];for(let r of t)e.push(`- **[${r.type}]** ${r.title} \`${r.id}\``);return e.push(""),e.push("> Dynasty trap-before-edit: surface is mandatory. Apply if it still holds; supersede if not."),e.join(`
|
|
9
|
+
`)}o(h,"formatTrapSurfaceMessage");export{p as a,h as b};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as l,b as c}from"./chunk-YOGI4WE6.mjs";import{a as o}from"./chunk-3TRXQAU4.mjs";var p=[{intent:"review",patterns:[/\b(?:address|apply|handle|resolve|respond\s+to)\s+(?:the\s+)?(?:pr\s+)?review(?:\s+(?:feedback|comments?))?\b/i,/\breview\s+(?:feedback|comments?)\b/i]},{intent:"ci-watch",patterns:[/\b(?:watch|monitor|babysit|follow)\s+(?:the\s+)?(?:ci|checks?|builds?)\b/i,/\bci\s+(?:watch|status|checks?)\b/i]},{intent:"pr",patterns:[/\b(?:open|create|file|prepare|draft|update|write)\s+(?:an?\s+)?(?:pull\s+request|pr)\b/i,/\b(?:pull\s+request|pr)\s+(?:title|description)\b/i]},{intent:"merge",patterns:[/\b(?:merge|merging|squash-merge)\b/i]}];function d(i){for(let t of p)if(t.patterns.some(e=>e.test(i)))return t.intent;return null}o(d,"classifyDeliveryIntent");function h(i){let t=d(i);if(!t)return null;let e='- Keep the original goal/spec as the scope boundary; discovered work becomes `prjct capture "<work>" --fromCurrent`.',a={pr:['- Use a human outcome title. Bad: "Refactor websocket transport". Good: "Cut websocket payload size by 70%".',"- Problem/why first, then solution; omit implementation inventories."],review:["- Apply feedback only when it serves the original goal/spec; explain and capture out-of-scope requests separately."],"ci-watch":["- Watch to a terminal result; distinguish a repository failure from an infrastructure flake before changing code or retrying."],merge:["- Merge only with required checks green and current human approval; never bypass protections."]};return[`# prjct: delivery guidance (${t})`,e,...a[t]].join(`
|
|
8
|
+
`)}o(h,"buildDeliveryGuidance");var f="prjct: denied broad process termination. Identify the exact numeric PID, verify the target, then use `kill <PID>` or `kill -TERM <PID>`.",m=/[$`]/;function u(i){for(let t of l(i)){let e=c(t),a=e[0];if(a===void 0)continue;if(m.test(a))return!0;let s=a.split("/").at(-1)?.toLowerCase();if(s==="killall"||s==="pkill")return!0;if((s==="sh"||s==="bash"||s==="zsh")&&e.some(r=>/^-[^-]*c/.test(r))){let r=e.findIndex(n=>/^-[^-]*c/.test(n))+1;if(r>0&&u(e[r]??""))return!0}if(s==="xargs"){let r=o(n=>n.split("/").at(-1)?.toLowerCase(),"nestedName");if(e.some(n=>r(n)==="killall"||r(n)==="pkill")||e.some(n=>r(n)==="kill"))return!0}}return!1}o(u,"classifyBroadProcessTermination");function g(i){return u(i)?f:null}o(g,"broadProcessTerminationDenial");export{d as a,h as b,g as c};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as d}from"./chunk-IOFCSTGM.mjs";import{G as u,R as h,d as m}from"./chunk-S6FBPXQL.mjs";import{g,h as f}from"./chunk-RCIWCKL7.mjs";import{e as p,l as C}from"./chunk-HU5ERAAV.mjs";import{a as s}from"./chunk-3TRXQAU4.mjs";C();var w='Ship: you MAY suggest when ready, but run `prjct ship` ONLY after the user confirms in text this turn (e.g. "ship", "s\xED publ\xEDcalo"). Never ship on silence, Stop, or green tests alone.';function $(t){return t==="skip"?"none":t==="standard"?"standard":"full"}s($,"qualityFromIntensity");function E(t){return t==="none"?"skip":t==="standard"?"standard":"full"}s(E,"intensityFromQuality");async function R(t,e={}){let{files:n,loc:r}=await(async()=>{try{let o=await f(t);if(o&&(o.files>0||o.loc>0))return{files:o.files,loc:o.loc};let l=await g(t);return{files:l?.files??0,loc:l?.loc??0}}catch{return{files:0,loc:0}}})(),{intensity:i}=m({files:n,loc:r},e);return{intensity:i,files:n,loc:r}}s(R,"resolveWorkIntensity");async function N(t){let e=await R(t.projectPath,t.signals??{}),n=t.forceIntensity??e.intensity,r=$(n),i=d.get(t.projectId);if(r==="none"){let a=u(i,n);return{opened:!1,intensity:n,quality:r,ledger:i,next:a}}if(i&&(i.verdict==="in_progress"||i.verdict==="approved")){let a=u(i,i.intensity);return{opened:!1,intensity:i.intensity,quality:r,ledger:i,next:a}}let o=t.target?.trim()||await L(t.projectPath)||`work-${p().slice(0,10)}`,l=await import("./delivery-geometry-GSJ6LXUC.mjs").then(({tierOf:a})=>a({files:e.files,loc:e.loc})).catch(()=>{}),x=await(async()=>{try{let{computeCommittedChangeset:a}=await import("./delivery-geometry-GSJ6LXUC.mjs"),c=await a(t.projectPath);if(c?.base){let{execFileAsync:I}=await import("./exec-34V6SJYO.mjs"),{stdout:v}=await I("git",["diff","--name-only",`${c.base}..HEAD`],{cwd:t.projectPath});return v.split(`
|
|
8
|
+
`).map(k=>k.trim()).filter(Boolean)}return c?.dirs?.length?[...c.dirs]:void 0}catch{return}})(),y=h({target:o,intensity:n,deliveryTier:l,now:p(),scopePaths:x});d.set(t.projectId,y);let j=u(y,n);return{opened:!0,intensity:n,quality:r,ledger:y,next:j}}s(N,"ensureJudgmentLedger");function P(t,e){if(t.intensity==="skip")return null;if(e?.verdict==="approved")return["# prjct: quality ready","",`- Judgment ledger \`${e.id.slice(0,8)}\` \u2192 **APPROVED** (intensity=${e.intensity}).`,"- You MAY suggest: work is ready to ship when they want.",`- ${w}`].join(`
|
|
9
|
+
`);if(t.kind==="skip_ship")return null;let n=["# prjct: quality orchestrator (automatic)","",`- **kind**: \`${t.kind}\` \xB7 intensity **${t.intensity}** \xB7 round ${t.fixRound}/${t.maxFixRounds}`,`- **directive**: ${t.directive}`,"","### Steps (run these \u2014 human does not type judgment)",...t.steps.map((r,i)=>`${i+1}. ${r}`),"",`_${w}_`];return t.judgeCharters&&n.push("","### Charters",`RED: ${t.judgeCharters.red}`,"",`BLUE: ${t.judgeCharters.blue}`),t.rankedFixIds.length&&n.push("",`### Blast rank: ${t.rankedFixIds.join(" \u2192 ")}`),n.join(`
|
|
10
|
+
`)}s(P,"formatQualityInject");function Q(t){let e=d.get(t),n=e?.intensity??"skip";if(!e&&n==="skip")return null;let r=u(e,n==="skip"&&e?e.intensity:n);return e?P(r,e):null}s(Q,"qualityInjectForProject");async function L(t){try{let{getGitBranch:e}=await import("./git-helpers-UC53D4FT.mjs");return await e(t)??null}catch{return null}}s(L,"defaultBranchTarget");function q(t){return t!=="skip"}s(q,"shipRequiresQuality");export{w as a,$ as b,E as c,R as d,N as e,P as f,Q as g,q as h};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as g}from"./chunk-UT425KVX.mjs";import{b as p,c as O}from"./chunk-DOJPSIMG.mjs";import{a as i}from"./chunk-3TRXQAU4.mjs";O();import a from"node:fs/promises";import l from"node:path";import*as o from"jsonc-parser";function h(){return process.env.PRJCT_TEST_MODE==="1"?l.join(p(".prjct-tests"),"opencode","opencode.json"):p(".config","opencode","opencode.json")}i(h,"getOpenCodeConfigPath");function E(){return process.env.PRJCT_TEST_MODE==="1"?l.join(p(".prjct-tests"),"opencode","opencode.jsonc"):p(".config","opencode","opencode.jsonc")}i(E,"getOpenCodeJsoncConfigPath");function P(n=g.prjct){let t={type:"local",command:[n.command,...n.args??[]],enabled:!0};return n.env&&Object.keys(n.env).length>0&&(t.environment={...n.env}),t}i(P,"toOpenCodeLocalMcp");async function S(n=h()){try{return await a.access(n),n}catch{}if(n===h()){let r=E();try{return await a.access(r),r}catch{}}return n}i(S,"resolveWritePath");function y(n){if(!n.trim())return{};let r=[],t=o.parse(n,r,{allowTrailingComma:!0,disallowComments:!1});if(r.length>0){let e=r[0];throw new SyntaxError(`OpenCode config parse error at offset ${e.offset}: ${o.printParseErrorCode(e.error)}`)}return t===null||typeof t!="object"||Array.isArray(t)?{}:t}i(y,"parseOpenCodeConfig");async function J(n,r=g.prjct){let t=n??await S();await a.mkdir(l.dirname(t),{recursive:!0});let e=await a.readFile(t,"utf-8").catch(f=>{if(f.code==="ENOENT")return"";throw f}),c=P(r);if(!e.trim()){let f={$schema:"https://opencode.ai/config.json",mcp:{prjct:c}};return await a.writeFile(t,`${JSON.stringify(f,null,2)}
|
|
8
|
+
`,"utf-8"),{path:t,changed:!0}}let s=y(e),C=(s.mcp??{}).prjct;if(!(JSON.stringify(C)!==JSON.stringify(c)))return{path:t,changed:!1};let d={tabSize:2,insertSpaces:!0},j=!s.mcp||typeof s.mcp!="object"?o.applyEdits(e,o.modify(e,["mcp"],{},{formattingOptions:d})):e,m=o.applyEdits(j,o.modify(j,["mcp","prjct"],c,{formattingOptions:d})),u=s.$schema?m:o.applyEdits(m,o.modify(m,["$schema"],"https://opencode.ai/config.json",{formattingOptions:d,isArrayInsertion:!1}));return await a.writeFile(t,u.endsWith(`
|
|
9
|
+
`)?u:`${u}
|
|
10
|
+
`,"utf-8"),{path:t,changed:!0}}i(J,"ensureOpenCodeMcpServer");function T(n){if(!n)return!1;try{let e=y(n).mcp?.prjct;if(!e)return!1;let c=e.command;return Array.isArray(c)?c.some(s=>typeof s=="string"&&(s.includes("prjct")||s.includes("mcp-server"))):typeof c=="string"?c.includes("prjct")||c.includes("mcp-server"):JSON.stringify(e).includes("mcp-server")||JSON.stringify(e).includes("prjct")}catch{return n.includes('"prjct"')&&(n.includes("mcp-server")||n.includes("type"))}}i(T,"hasOpenCodePrjctMcp");export{h as a,E as b,P as c,J as d,T as e};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as p}from"./chunk-PIA26GWG.mjs";import{a as o,b as L}from"./chunk-RP7F67ZT.mjs";import{a as c}from"./chunk-INJ5WT2D.mjs";import{b as e,f as S}from"./chunk-XYDLXF5A.mjs";import{d as a,g as P}from"./chunk-TTN2CFZC.mjs";import{b as s,c as h}from"./chunk-DOJPSIMG.mjs";import{l as m,p as k}from"./chunk-HYIT7MF5.mjs";import{e as l,g as d}from"./chunk-225DWS4D.mjs";import{a as n}from"./chunk-3TRXQAU4.mjs";S();d();k();import I from"node:fs/promises";import u from"node:path";L();P();h();var E="prjct-pi-skill";function f(){return process.env.PRJCT_TEST_MODE==="1"?u.join(s(".prjct-tests"),"pi","agent","skills","prjct","SKILL.md"):s(".pi","agent","skills","prjct","SKILL.md")}n(f,"getPiSkillPath");function A(){return f()}n(A,"getPiSkillInstallPath");function w(t){return`<!-- ${E}: ${JSON.stringify({v:a,h:t})} -->`}n(w,"getPiSkillMetadata");function K(t){return c(t).slice(0,12)}n(K,"hashContent");async function x(){return e("pi/SKILL.md")??e("codex/SKILL.md")}n(x,"loadPiSkillTemplate");function C(t){let r=t.trimEnd(),i=K(r),g=w(i);return{content:`${r}
|
|
8
|
+
|
|
9
|
+
${g}
|
|
10
|
+
`,templateHash:i}}n(C,"buildPiSkillContent");async function H(){try{let t=f();await I.mkdir(u.dirname(t),{recursive:!0});let r=await m(t),i=await x();return i?await p({skillMdPath:t,skillExists:r,templateContent:i,build:C,logLabel:"Pi"}):(o.warn("Pi SKILL.md template not found"),{success:!1,action:null})}catch(t){return o.warn(`Pi skill warning: ${l(t)}`),{success:!1,action:null}}}n(H,"installPiSkill");export{A as a,C as b,H as c};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as q}from"./chunk-Q6C27OL7.mjs";import{g as p,i as P}from"./chunk-DMO3ZFUG.mjs";import{g as H,h as g,i as B,l as Q}from"./chunk-HU5ERAAV.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";P();function l(t,s,...e){try{return Number(p.get(t,s,...e)?.value??0)}catch{return 0}}c(l,"count");function E(t,s,...e){try{return p.query(t,s,...e)}catch{return[]}}c(E,"query");P();Q();var j="memory.task_tokens",_=1e7;function pt(t,s,e,r,n){if(!s||e+r<=0)return;let i=5e7;if(e>i||r>i)return;let a=e>_||r>_,u=Math.min(Math.round(e),_),d=Math.min(Math.round(r),_);a&&(n={...n,isEstimated:!0});try{p.appendEvent(t,j,{taskId:s,tokensIn:u,tokensOut:d,...n?.description?{description:n.description}:{},...n?.agent?{agent:n.agent}:{},...n?.model?{model:n.model}:{},...n?.runtime?{runtime:n.runtime}:{},...n?.isEstimated!==void 0?{isEstimated:n.isEstimated}:{},...n?.source?{source:n.source}:{}},s)}catch{}if(u>=0&&u<=_&&d>=0&&d<=_)try{p.run(t,"UPDATE tasks SET tokens_in = ?, tokens_out = ? WHERE id = ?",u,d,s)}catch{}try{let C=n?.source??"cli",S=`${s}:${C}`,h=Date.now();p.run(t,`INSERT INTO token_usage
|
|
8
|
+
(id, work_cycle_id, event_key, source, is_estimated, input_tokens, output_tokens, model_id, description, measured_at, created_at)
|
|
9
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
10
|
+
ON CONFLICT(event_key) DO UPDATE SET
|
|
11
|
+
input_tokens = excluded.input_tokens,
|
|
12
|
+
output_tokens = excluded.output_tokens,
|
|
13
|
+
is_estimated = excluded.is_estimated,
|
|
14
|
+
model_id = excluded.model_id,
|
|
15
|
+
description = COALESCE(excluded.description, token_usage.description),
|
|
16
|
+
measured_at = excluded.measured_at`,S,s,S,C,n?.isEstimated?1:0,u,d,n?.model??null,n?.description??null,h,h)}catch{}}c(pt,"recordTaskTokenUsage");function I(t,s){let e=Date.parse(s),r=E(t,`SELECT work_cycle_id, input_tokens, output_tokens, is_estimated, description
|
|
17
|
+
FROM token_usage
|
|
18
|
+
WHERE measured_at >= ?
|
|
19
|
+
ORDER BY measured_at DESC`,Number.isFinite(e)?e:0),n=new Map;for(let i of r){let a=i.work_cycle_id;if(!a||n.has(a))continue;let u=g(i.input_tokens)??0,d=g(i.output_tokens)??0;u+d<=0||n.set(a,{id:a,description:i.description??a,status:i.is_estimated?"estimated":"measured",tokensIn:u,tokensOut:d,tokensTotal:u+d,minutes:null})}return n}c(I,"measuredCyclesFromTokenUsage");function tt(t,s){let e=H(s),r=new Date().toISOString(),n=E(t,`SELECT id, description, status, started_at, completed_at, shipped_at, tokens_in, tokens_out
|
|
20
|
+
FROM tasks
|
|
21
|
+
WHERE COALESCE(completed_at, shipped_at, started_at) >= ?
|
|
22
|
+
ORDER BY COALESCE(completed_at, shipped_at, started_at) DESC`,e),i=new Map;for(let o of n.map(nt))o&&i.set(o.id,o);for(let[o,m]of I(t,e)){let b=i.get(o);i.set(o,{...m,description:b?.description??m.description,minutes:b?.minutes??m.minutes})}let a=[...i.values()].sort((o,m)=>m.tokensTotal-o.tokensTotal),u=T(t,"memory.task_started",e),d=T(t,"memory.status.changed",e),R=T(t,"memory.feature_shipped",e),C=T(t,"sync",e),S=l(t,"SELECT COUNT(*) AS value FROM events WHERE type >= ? AND type < ? AND timestamp >= ?","memory.","memory/",e),h=T(t,"memory.post_edit",e),Y=l(t,"SELECT COUNT(*) AS value FROM agent_sessions WHERE started_at >= ?",e),$=(()=>{try{return l(t,"SELECT COUNT(*) AS value FROM cli_sessions WHERE created_at >= ?",e)}catch{return 0}})(),A=Y+$,w=l(t,"SELECT COUNT(DISTINCT memory_id) AS value FROM memory_surface_log WHERE created_at >= ?",e),z=l(t,`SELECT COUNT(DISTINCT s.memory_id) AS value
|
|
23
|
+
FROM memory_surface_log s
|
|
24
|
+
INNER JOIN memory_usefulness u ON u.memory_id = s.memory_id
|
|
25
|
+
WHERE s.created_at >= ?
|
|
26
|
+
AND u.score > 0`,e),J=(()=>{try{return l(t,`SELECT COUNT(DISTINCT t.id) AS value
|
|
27
|
+
FROM tasks t
|
|
28
|
+
INNER JOIN agent_sessions a ON a.task_id = t.id
|
|
29
|
+
WHERE (t.completed_at IS NOT NULL OR t.shipped_at IS NOT NULL)
|
|
30
|
+
AND COALESCE(t.completed_at, t.shipped_at, t.started_at) >= ?`,e)}catch{return 0}})(),V=l(t,"SELECT COUNT(*) AS value FROM context_zone_events WHERE timestamp >= ?",e),G=l(t,"SELECT COUNT(*) AS value FROM context_compactions WHERE timestamp >= ?",e),D=K(t,"command_duration",e),x=K(t,"startup_time",e),N=st(t,e),W=a.reduce((o,m)=>o+m.tokensIn,0),L=a.reduce((o,m)=>o+m.tokensOut,0),f=Math.max(n.length,u,R),y=n.filter(o=>o.completed_at||o.shipped_at),v=new Set(I(t,e).keys()),X=(()=>{try{return new Set(p.query(t,`SELECT DISTINCT task_id AS task_id FROM agent_sessions
|
|
31
|
+
WHERE task_id IS NOT NULL AND started_at >= ?`,e).map(o=>o.task_id).filter(Boolean))}catch{return new Set}})(),O=y.filter(o=>{let m=Number(o.tokens_in??0),b=Number(o.tokens_out??0);return m+b>0||v.has(o.id)}).length,U=y.filter(o=>Number(o.tokens_in??0)+Number(o.tokens_out??0)>0||v.has(o.id)||X.has(o.id)).length,M=U>0?U:y.length>0?y.length:n.length>0?n.length:f,F=Math.max(O,a.length),k=[];f===0?k.push("No work cycles were found in tasks or historical events for this window."):n.length===0&&k.push("Work history was rescued from events, but normalized task rows are missing."),M>0&&O===0&&F===0&&k.push("Work cycles exist, but none have exact token totals. Capture exact or estimated usage at task close."),A===0&&k.push("No agent sessions were recorded. Session-level model/runtime/cost cannot be attributed yet."),w===0&&k.push("No surfaced context was logged in this window, so reuse and re-exploration waste cannot be proven.");let Z=(()=>{try{return p.query(t,`SELECT COALESCE(model_id, 'unknown') AS model,
|
|
32
|
+
SUM(input_tokens) AS t_in, SUM(output_tokens) AS t_out
|
|
33
|
+
FROM token_usage
|
|
34
|
+
WHERE model_id IS NOT NULL AND measured_at >= ?
|
|
35
|
+
GROUP BY COALESCE(model_id, 'unknown')
|
|
36
|
+
ORDER BY t_in + t_out DESC`,Date.parse(e)).map(o=>({model:o.model,tokensIn:o.t_in,tokensOut:o.t_out}))}catch{return[]}})();return{id:`work-cost-${s}d`,windowDays:s,generatedAt:r,workCycles:n.length>0?n.length:f,knownTokenCycles:F,tokensIn:W,tokensOut:L,tokensTotal:W+L,tokenCoveragePercent:M===0?0:Math.min(100,Math.round(Math.max(O,a.filter(o=>v.has(o.id)||o.tokensTotal>0).length)/M*100)),measuredSessions:Math.max(A,J),surfacedContext:w,usefulContext:z,contextZoneEvents:V,compactions:G,commandSamples:D.samples,commandMs:Math.round(D.total??0),avgStartupMs:x.average===null?null:Math.round(x.average),mostExpensive:a.slice(0,8),byModel:Z,historicalRescue:{inferredWorkCycles:f,taskTableCycles:n.length,eventWorkStarts:u,eventStatusChanges:d,eventShips:R,syncRuns:C,memoryEvents:S,postEditEvents:h,declaredTokenMentions:N.length,declaredTokensTotal:N.reduce((o,m)=>o+m.tokens,0),topDeclaredTokenMentions:N.slice(0,5)},gaps:k}}c(tt,"buildWorkCostSnapshot");async function kt(t,s=[7,30,90]){let e=s.map(r=>tt(t,r));for(let r of e)await q({projectId:t,entityType:"work_cost_snapshots",entityId:r.id,eventType:"upsert",data:et(r)});return e}c(kt,"publishWorkCostSnapshots");function et(t){return{...t,mostExpensive:t.mostExpensive.map(s=>({...s,description:"[redacted]"})),historicalRescue:{...t.historicalRescue,topDeclaredTokenMentions:t.historicalRescue.topDeclaredTokenMentions.map(s=>({tokens:s.tokens,sourceType:s.sourceType,occurredAt:s.occurredAt,summary:"[redacted]"}))}}}c(et,"redactSnapshotForCloud");function nt(t){let s=g(t.tokens_in)??0,e=g(t.tokens_out)??0,r=s+e;return r<=0?null:{id:t.id,description:t.description,status:t.status,tokensIn:s,tokensOut:e,tokensTotal:r,minutes:B(t.started_at,t.completed_at??t.shipped_at)}}c(nt,"toCostTask");function st(t,s){let e=E(t,`SELECT type, data, timestamp
|
|
37
|
+
FROM events
|
|
38
|
+
WHERE timestamp >= ?
|
|
39
|
+
AND type >= ?
|
|
40
|
+
AND type < ?
|
|
41
|
+
AND json_valid(data)
|
|
42
|
+
AND json_extract(data, '$.content') LIKE '%token%'
|
|
43
|
+
ORDER BY timestamp DESC
|
|
44
|
+
LIMIT 200`,s,"memory.remember.","memory.remember/"),r=[];for(let n of e){let i=(()=>{try{let u=JSON.parse(n.data);return typeof u.content=="string"?u.content:""}catch{return""}})();if(!i)continue;let a=ot(i);for(let u of a)r.push({tokens:u,sourceType:n.type,occurredAt:n.timestamp,summary:rt(i)})}return r.sort((n,i)=>i.tokens-n.tokens)}c(st,"declaredTokenMentions");function ot(t){let s=[],e=/\b(\d+(?:\.\d+)?)\s*([kKmM])?\s*(?:tokens?|tok)\b/g;for(let r of t.matchAll(e)){let n=Number.parseFloat(r[1]??"0"),i=r[2]?.toLowerCase();if(!Number.isFinite(n)||n<=0)continue;let a=i==="m"?1e6:i==="k"?1e3:1;s.push(Math.round(n*a))}return s}c(ot,"extractTokenCounts");function rt(t){let s=t.replace(/\s+/g," ").trim();return s.length<=140?s:`${s.slice(0,137)}...`}c(rt,"summarize");function T(t,s,e){return l(t,"SELECT COUNT(*) AS value FROM events WHERE type = ? AND timestamp >= ?",s,e)}c(T,"eventCount");function K(t,s,e){return E(t,`SELECT COUNT(*) AS samples, COALESCE(SUM(value), 0) AS total, AVG(value) AS average
|
|
45
|
+
FROM perf_samples
|
|
46
|
+
WHERE metric = ? AND timestamp >= ?`,s,e)[0]??{samples:0,total:0,average:null}}c(K,"aggregatePerf");export{l as a,E as b,pt as c,tt as d,kt as e};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{h as c,i as m}from"./chunk-VWFVSNQT.mjs";import{a as l,b as f}from"./chunk-U24YKPYX.mjs";import{a as r}from"./chunk-3TRXQAU4.mjs";f();m();import a from"node:fs";import i from"node:path";var S="https://registry.npmjs.org/prjct-cli/latest",g=3600*1e3,u=r(()=>i.join(l(),"state"),"stateDir"),p=r(()=>i.join(u(),"update-status.json"),"statusPath");function h(){try{let e=a.readFileSync(p(),"utf-8"),t=JSON.parse(e);return typeof t.installed!="string"?null:t}catch{return null}}r(h,"readUpdateStatus");async function T(e){if(!e)return null;let t=h(),n=t?.checkedAt&&Date.now()-Date.parse(t.checkedAt)<g?t?.latest??null:await y()??t?.latest??null,d=n!=null&&c(n,e)>0,o={installed:e,latest:n,updateAvailable:d,checkedAt:new Date().toISOString()};try{a.mkdirSync(u(),{recursive:!0}),a.writeFileSync(p(),`${JSON.stringify(o,null,2)}
|
|
8
|
+
`)}catch{}return o}r(T,"refreshUpdateStatus");async function y(){try{let e=new AbortController,t=setTimeout(()=>e.abort(),6e3),s=await fetch(S,{signal:e.signal});if(clearTimeout(t),!s.ok)return null;let n=await s.json();return typeof n.version=="string"?n.version:null}catch{return null}}r(y,"fetchLatestVersion");export{T as a,y as b};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{f as x}from"./chunk-2NI4EEK2.mjs";import{b as M}from"./chunk-X4FR5S7E.mjs";import{f as E}from"./chunk-6AFXUX2M.mjs";import{b as f}from"./chunk-LZC6NGB6.mjs";import{a as q}from"./chunk-Q6C27OL7.mjs";import{a as c}from"./chunk-3TRXQAU4.mjs";var k=85,I=2;async function j(t,e,n={}){let o=n.threshold??k,d=n.maxIterations??I,i=await import("./retention-S22T3SPT.mjs").then(({evaluateRetentionShared:s})=>s(e,Date.now()).byId).catch(()=>null),h=c(async(s,a,y,g)=>{if(s>=d||a.score>=o)return{...a,irrelevantRemoved:y,repairEntriesCreated:g};let r=f.allEntriesForIndex(e),m=r.filter(l=>{if(!C(l))return!1;let b=i?.get(l.id);return!(b&&b.verdict==="active"&&b.score>=70)}),u=L(r)?0:1;u>0&&await f.remember(t,{type:"context",content:D(r,a),tags:{context_schema:"living-v2",synthesis:"model-authored",feature:"context-quality-cleanup",key_data:`quality_score=${a.score}; threshold=${o}; irrelevant=${m.length}`,model:"prjct sync context-quality analyzer",token_usage:"0 deterministic sync tokens",source:"sync-context-quality"},provenance:"inferred",projectId:e});let p=[];for(let l of m)f.forget(e,l.id)&&(p.push(l.id),await q({projectId:e,entityType:"memories",entityId:l.id,eventType:"delete",data:{id:l.id,type:l.type,content:l.content,tags:l.tags,reason:"context-quality-cleanup"}}));let w={...R(e,o),iterations:s+1,irrelevantRemoved:y+p.length,repairEntriesCreated:g+u};return m.length===0&&u===0?w:h(s+1,w,y+p.length,g+u)},"repairIteration");return h(0,R(e,o),0,0)}c(j,"repairContextQuality");function R(t,e=k){let n=f.allEntriesForIndex(t),o=n.filter(r=>r.type==="context"),d=o.filter(v),i=o.filter(r=>!v(r)),h=n.filter(C),s=[],a=[];n.length>0&&d.length===0&&(a.push(35),s.push("missing living-v2 context synthesis")),h.length>0&&(a.push(Math.min(40,h.length*8)),s.push(`${h.length} irrelevant generated entries in active context`)),i.length>0&&(a.push(Math.min(20,i.length*5)),s.push(`${i.length} legacy context entries need cleanup`));let y=d[0];if(y){let r=x(y.content),u=[r.contextSynthesis,r.keyData,r.model,r.tokenUsage,r.nextImplication].filter(p=>!p).length;u>0&&(a.push(u*4),s.push("latest living context is missing structured UI/LLM fields"))}let g=Math.max(0,Math.min(100,100-a.reduce((r,m)=>r+m,0)));return{score:g,threshold:e,passed:g>=e,iterations:0,livingContextCount:d.length,legacyContextCount:i.length,irrelevantRemoved:0,repairEntriesCreated:0,issues:s}}c(R,"evaluateContextQuality");function C(t){return M(t)?!0:t.tags?.source==="sync-context-quality"||t.type!=="context"||v(t)?!1:$(t)}c(C,"isIrrelevantGeneratedContext");function v(t){if(t.tags?.context_schema==="living-v2")return!0;let e=x(t.content);return!!(e.contextSynthesis&&e.keyData)}c(v,"isLivingV2Context");function L(t){return t.some(e=>e.type==="context"&&v(e))}c(L,"hasUsableLivingContext");function $(t){let e=t.content.trim();if(e.length<260||/User pushback:|raw quote|transcript|hot file|skill-miss/i.test(e))return!0;let n=x(e);return[n.whatHappened,n.whyItMattered,n.pattern,n.antiPattern,n.outcome,n.nextImplication].filter(Boolean).length<3}c($,"isLowValueLegacyContext");function D(t,e){let n=t.filter(i=>!C(i)).filter(i=>["decision","gotcha","learning","context","shipped"].includes(i.type)).slice(0,8),o=n.length>0?n.map(i=>`${i.type}:${E(i)}`).join("; "):"No high-quality prior context survived cleanup.";return["Context synthesis: Sync repaired historical low-quality project context by removing generated telemetry and preserving the useful project knowledge as a living-v2 synthesis. Future agents should trust this synthesized layer over old raw detector rows or legacy context snippets.",`Key data: ${[`quality_score=${e.score}`,`threshold=${e.threshold}`,`legacy_context=${e.legacyContextCount}`,`issues=${e.issues.join("|")||"none"}`].join("; ")}`,"What happened: prjct sync detected that active context quality was below the required threshold and generated a replacement synthesis before deleting irrelevant generated entries.","Why it mattered: Existing users had accumulated low-signal context over time; leaving it active makes the second brain noisy for both the UI and LLM retrieval.","Who/author: prjct sync","Model: prjct sync context-quality analyzer","Token usage: 0 deterministic sync tokens","Sentiment: cleanup required because raw generated context had become product debt","Related files: generated from existing project memory during sync","Feature/domain: context-quality-cleanup","Pattern: Keep structured key data for UI representation and synthesized context for humans/LLMs.","Anti-pattern: Surfacing raw detector rows, hot-file counters, or short legacy snippets as durable project knowledge.","Decision/trap: Generated garbage is hard-deleted from active recall/vault/search; user-authored decisions, gotchas, learnings, and facts are preserved.",`Outcome: Repair synthesis created from surviving highlights: ${o}`,"Next implication: If quality remains below threshold, run full sync/analysis and inspect remaining user-authored entries manually instead of deleting them blindly."].join(" \xB7 ")}c(D,"buildRepairContext");export{j as a,C as b};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as C}from"./chunk-E5QQDYBR.mjs";import{f as l,i as A}from"./chunk-DMO3ZFUG.mjs";import{a as d}from"./chunk-3TRXQAU4.mjs";import{z as t}from"zod";var O=t.enum(["improving","stable","declining"]),R=t.object({sprintNumber:t.number(),startDate:t.string(),endDate:t.string(),pointsCompleted:t.number(),tasksCompleted:t.number(),avgVariance:t.number(),estimationAccuracy:t.number()}),D=t.object({category:t.string(),avgVariance:t.number(),taskCount:t.number()}),I=t.object({totalPoints:t.number(),sprints:t.number(),estimatedDate:t.string()}),P=t.object({sprints:t.array(R),averageVelocity:t.number(),velocityTrend:O,estimationAccuracy:t.number(),overEstimated:t.array(D),underEstimated:t.array(D),lastUpdated:t.string()}),U=t.object({sprintLengthDays:t.number().min(1).max(90).default(7),startDay:t.enum(["monday","tuesday","wednesday","thursday","friday","saturday","sunday"]).default("monday"),windowSize:t.number().min(1).max(52).default(6),accuracyTolerance:t.number().min(0).max(100).default(20)});var f={sprints:[],averageVelocity:0,velocityTrend:"stable",estimationAccuracy:0,overEstimated:[],underEstimated:[],lastUpdated:""};A();var h=10080*60*1e3;function M(m){let r=new Date(m).getTime();return Number.isFinite(r)?Math.floor(r/h):null}d(M,"epochWeek");function k(m){return new Date(m*h).toISOString()}d(k,"weekStartIso");function w(m){return new Date((m+1)*h-1).toISOString()}d(w,"weekEndIso");var E=class extends C{static{d(this,"VelocityStorage")}constructor(){super("velocity.json")}getDefault(){return{metrics:f,lastUpdated:""}}getEventType(r){return`velocity.${r}d`}async recompute(r){let o=l.query(r,"SELECT completed_at FROM tasks WHERE completed_at IS NOT NULL"),_=l.query(r,"SELECT shipped_at FROM shipped_features"),c=new Map;for(let a of o){let n=M(a.completed_at);if(n===null)continue;let p=c.get(n)??{tasks:0,ships:0};p.tasks++,c.set(n,p)}for(let a of _){let n=M(a.shipped_at);if(n===null)continue;let p=c.get(n)??{tasks:0,ships:0};p.ships++,c.set(n,p)}for(let[a,n]of c)l.run(r,`INSERT INTO velocity_sprints
|
|
8
|
+
(sprint_number, points_completed, tasks_completed, estimation_accuracy, avg_variance, started_at, ended_at)
|
|
9
|
+
VALUES (?, ?, ?, 0, 0, ?, ?)
|
|
10
|
+
ON CONFLICT(sprint_number) DO UPDATE SET
|
|
11
|
+
points_completed = excluded.points_completed,
|
|
12
|
+
tasks_completed = excluded.tasks_completed,
|
|
13
|
+
started_at = excluded.started_at,
|
|
14
|
+
ended_at = excluded.ended_at`,a,n.ships+n.tasks,n.tasks,k(a),w(a));let y=await this.getMetrics(r);await this.publishEntityEvent(r,"velocity","updated",{averageVelocity:y.averageVelocity,trend:y.velocityTrend,sprintCount:y.sprints.length})}async getMetrics(r){let o=l.query(r,"SELECT * FROM velocity_sprints ORDER BY sprint_number DESC LIMIT 12");if(o.length===0)return f;let _=o.slice().reverse().map(e=>({sprintNumber:e.sprint_number,startDate:e.started_at??k(e.sprint_number),endDate:e.ended_at??w(e.sprint_number),pointsCompleted:e.points_completed,tasksCompleted:e.tasks_completed,avgVariance:e.avg_variance,estimationAccuracy:e.estimation_accuracy})),c=o.slice(0,6),y=c.reduce((e,u)=>e+u.points_completed,0)/Math.max(1,c.length),a=o.slice(0,3).reduce((e,u)=>e+u.points_completed,0),n=o.slice(3,6).reduce((e,u)=>e+u.points_completed,0),p=o.length<6?"stable":a>n*1.15?"improving":a<n*.85?"declining":"stable",T=[],v=[],L=(()=>{try{let e=l.query(r,`SELECT type,
|
|
15
|
+
CAST(json_extract(data, '$.expectedPoints') AS REAL) AS expected,
|
|
16
|
+
CAST(json_extract(data, '$.actualPoints') AS REAL) AS actual
|
|
17
|
+
FROM tasks
|
|
18
|
+
WHERE status = 'completed'
|
|
19
|
+
AND json_extract(data, '$.expectedPoints') IS NOT NULL
|
|
20
|
+
AND json_extract(data, '$.actualPoints') IS NOT NULL`);if(e.length>0){let u=[1,2,5,8],V=d(i=>u.findIndex(s=>s>=i),"step"),x=e.reduce((i,s)=>{let g=V(s.actual)-V(s.expected);Math.abs(g)<=1&&i.accurate++;let b=s.type??"unknown",S=i.byType.get(b)??{sum:0,n:0};return S.sum+=(s.actual-s.expected)/s.expected*100,S.n++,i.byType.set(b,S),i},{accurate:0,byType:new Map});for(let[i,s]of x.byType){let g=Math.round(s.sum/s.n),b={category:i,avgVariance:g,taskCount:s.n};g<=-20?T.push(b):g>=20&&v.push(b)}return Math.round(x.accurate/e.length*100)}return 0}catch{return 0}})();return{sprints:_,averageVelocity:y,velocityTrend:p,estimationAccuracy:L,overEstimated:T,underEstimated:v,lastUpdated:new Date().toISOString()}}},$=new E;export{M as a,$ as b};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
3
|
+
import { dirname as __pathDirname } from 'path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = __pathDirname(__filename);
|
|
7
|
+
import{a as n,b as s}from"./chunk-ESB4ALH2.mjs";import{a as e}from"./chunk-3TRXQAU4.mjs";var r=32;function u(t={}){let o=(t.hookHost===void 0?process.env.PRJCT_HOOK_HOST:t.hookHost)?.trim().toLowerCase().slice(0,r);return o&&n.has(o)?o:t.detectedRuntime??s()}e(u,"resolveInstructionRuntime");export{u as a};
|