prjct-cli 3.97.0 → 3.98.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/bin/core-chunks/{agent-HCP5FF77.mjs → agent-3N2MSSGT.mjs} +1 -1
- package/dist/bin/core-chunks/{agent-switch-AVSX6SLY.mjs → agent-switch-4SE6GF7R.mjs} +1 -1
- package/dist/bin/core-chunks/{agents-OAQXBGH3.mjs → agents-ZPNNCOH7.mjs} +1 -1
- package/dist/bin/core-chunks/{analysis-3A7ODSSI.mjs → analysis-OARMM4AH.mjs} +2 -2
- package/dist/bin/core-chunks/{auto-flush-EWSVMKQN.mjs → auto-flush-XA3V7BJ6.mjs} +1 -1
- package/dist/bin/core-chunks/{bin-commands-LLHG2NSY.mjs → bin-commands-FYID6EYI.mjs} +5 -5
- package/dist/bin/core-chunks/{capture-7LQ52T6L.mjs → capture-3JJPWIF3.mjs} +1 -1
- package/dist/bin/core-chunks/{capture-gate-M4HM7WAI.mjs → capture-gate-G5LGVDME.mjs} +1 -1
- package/dist/bin/core-chunks/{ceremonies-4OZ3FKRE.mjs → ceremonies-B565WDCA.mjs} +4 -4
- package/dist/bin/core-chunks/{changelog-CUNVCEL5.mjs → changelog-LPJ4GKB6.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-DN46DLU3.mjs → chunk-2FRLIQKX.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-X4FR5S7E.mjs → chunk-2VRS5CUH.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-ZK7BMUMR.mjs → chunk-2VXPFULA.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-3OWKIRK6.mjs +7 -0
- package/dist/bin/core-chunks/{chunk-V5VCXMKO.mjs → chunk-5DZ2LTII.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-5ONMON5L.mjs → chunk-5OWPZWEU.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-KWC2PCPC.mjs → chunk-5TGZSK4C.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-5ZBACKED.mjs +14 -0
- package/dist/bin/core-chunks/{chunk-X35YYOFE.mjs → chunk-6KNMT46X.mjs} +2 -2
- package/dist/bin/core-chunks/{chunk-5MN22JFI.mjs → chunk-6POAOY5C.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-7CI4AMVO.mjs → chunk-6U3CYLY5.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-J7T5IEFJ.mjs → chunk-6U3MV7KZ.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-2ZPM4Z6W.mjs → chunk-7BU6SJBC.mjs} +4 -4
- package/dist/bin/core-chunks/{chunk-ZKJZDOPT.mjs → chunk-ACIOJQSI.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-UE3XKXWM.mjs → chunk-ALTQ3KL4.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-IVGWOY3U.mjs → chunk-ANBDOI53.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-LZC6NGB6.mjs → chunk-B2HY22OD.mjs} +2 -2
- package/dist/bin/core-chunks/{chunk-6AFXUX2M.mjs → chunk-BUD3R6LF.mjs} +2 -2
- package/dist/bin/core-chunks/{chunk-MDONTD7O.mjs → chunk-CA2VFWFP.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-56FW4P6U.mjs → chunk-CB3CNJTL.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-6FFOWWH2.mjs → chunk-CVKMV22J.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-5UUITMRX.mjs → chunk-CXKDKMYE.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-XSZG3CBO.mjs → chunk-DTMZBK4E.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-DW4QMD6J.mjs +10 -0
- package/dist/bin/core-chunks/{chunk-CDLZLTRY.mjs → chunk-DZDEBDAB.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-WGDE3L33.mjs → chunk-FOUBHU4X.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-CNWEQUB7.mjs → chunk-HA7Y76GF.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-MTDCRYLP.mjs → chunk-HVXWQ2XZ.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-OYXQRBVM.mjs → chunk-IJNKHQIS.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-KIRU4QFX.mjs → chunk-J6Y7IVFQ.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-3FXNIJCS.mjs → chunk-JGGQSMZC.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-6P4GMVUZ.mjs → chunk-KI4OY3UQ.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-BTCCUMKI.mjs → chunk-L3DJN3XD.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-CEOTHJIY.mjs → chunk-LFOQ7FCR.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-XU3BQPBU.mjs → chunk-LGX2GM45.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-LTKUTRRL.mjs +7 -0
- package/dist/bin/core-chunks/{chunk-BQKDJ3U6.mjs → chunk-LZILSE5H.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-MPU3VM6Z.mjs +7 -0
- package/dist/bin/core-chunks/{chunk-INM5COWM.mjs → chunk-MXJF3FA7.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-VDXTMAMO.mjs → chunk-NNILF7R3.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-WZXUFSVT.mjs → chunk-O5VCBMEK.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-XYDLXF5A.mjs → chunk-OE27RFLJ.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-HEXSVBUP.mjs → chunk-OGM34Z6W.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-KKIJAEYU.mjs → chunk-OXKGN3HG.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-QLMZW4K7.mjs → chunk-PQTR6XVW.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-53ZPEZLU.mjs → chunk-Q7GJIU6D.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-IFLBZKKK.mjs → chunk-QWRPJARA.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-TGNZI4KF.mjs → chunk-STFUT7R7.mjs} +2 -2
- package/dist/bin/core-chunks/{chunk-IMQCXC3R.mjs → chunk-SUXIKMTS.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-WP5IU4W4.mjs → chunk-TOORPP6K.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-7QMBIMEX.mjs → chunk-UAYTDSYG.mjs} +3 -3
- package/dist/bin/core-chunks/{chunk-PPERWRFS.mjs → chunk-UNIBFM6J.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-5YSPND5J.mjs → chunk-UX2ORID4.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-3JD6KRNJ.mjs → chunk-VJCTTFKP.mjs} +1 -1
- package/dist/bin/core-chunks/chunk-W23JLJJZ.mjs +109 -0
- package/dist/bin/core-chunks/{chunk-DCVPNFS4.mjs → chunk-WCTVZQBG.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-GOIBJ7PV.mjs → chunk-WZ6W5ZQ5.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-XPRLQIVQ.mjs → chunk-X433BB6F.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-ZHTYSYZC.mjs → chunk-XBR63NJA.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-ZS7XJUPE.mjs → chunk-XJTEPHLC.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-K25HGTC3.mjs → chunk-XLAGA5B7.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-3USVY66O.mjs → chunk-XSZOHNL4.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-TTN2CFZC.mjs → chunk-XWLTEAGN.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-V3Y3G2DE.mjs → chunk-YOWW4LHK.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-P53YMOKR.mjs → chunk-YPLFWN62.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-ZQHSJ6FF.mjs → chunk-ZAUJWUUN.mjs} +3 -3
- package/dist/bin/core-chunks/{chunk-WSVMQYYU.mjs → chunk-ZQ2XH76U.mjs} +2 -2
- package/dist/bin/core-chunks/{chunk-RXXXA7Z6.mjs → chunk-ZSANMA7K.mjs} +1 -1
- package/dist/bin/core-chunks/{chunk-AJTBFIH2.mjs → chunk-ZZR3LXCK.mjs} +1 -1
- package/dist/bin/core-chunks/{cleanup-installs-WHXUGAHM.mjs → cleanup-installs-LD43GI4K.mjs} +1 -1
- package/dist/bin/core-chunks/{cloud-FFUJZLDV.mjs → cloud-RXHFZ7MX.mjs} +1 -1
- package/dist/bin/core-chunks/{code-SU7GCPH6.mjs → code-IYK65A62.mjs} +1 -1
- package/dist/bin/core-chunks/{codex-hooks-GOLMCL2Q.mjs → codex-hooks-N5UHKK5B.mjs} +1 -1
- package/dist/bin/core-chunks/{codex-mcp-K4X2UIQF.mjs → codex-mcp-G7WNAT6T.mjs} +1 -1
- package/dist/bin/core-chunks/{codex-skill-3HNVU4T4.mjs → codex-skill-IZNP76BJ.mjs} +1 -1
- package/dist/bin/core-chunks/{command-installer-XIQK2G6W.mjs → command-installer-4ENM4GZR.mjs} +1 -1
- package/dist/bin/core-chunks/{config-W3RHV3GK.mjs → config-UVF7YOR6.mjs} +1 -1
- package/dist/bin/core-chunks/{config-manager-QVFHXIKI.mjs → config-manager-QY73WM5U.mjs} +1 -1
- package/dist/bin/core-chunks/{context-4KGTUAC4.mjs → context-4GB6ICXK.mjs} +1 -1
- package/dist/bin/core-chunks/{context-DDHC7VIC.mjs → context-MPHOQPXF.mjs} +2 -2
- package/dist/bin/core-chunks/{context-checkpoint-4CEUPEVG.mjs → context-checkpoint-NBI5HKPV.mjs} +1 -1
- package/dist/bin/core-chunks/{context-tiers-4S6H22NP.mjs → context-tiers-NOKJ75QP.mjs} +1 -1
- package/dist/bin/core-chunks/{context7-service-AZWDYK5Z.mjs → context7-service-2MYRUNKY.mjs} +1 -1
- package/dist/bin/core-chunks/{core-PR5WEQCS.mjs → core-WMEHDCOK.mjs} +1 -1
- package/dist/bin/core-chunks/{crew-JQCG6NS3.mjs → crew-EYVSIX4L.mjs} +1 -1
- package/dist/bin/core-chunks/{cwd-changed-ODKZVSPB.mjs → cwd-changed-EUJZOBIC.mjs} +1 -1
- package/dist/bin/core-chunks/{daemon-2NQTBFVR.mjs → daemon-QARP3RVX.mjs} +1 -1
- package/dist/bin/core-chunks/{developer-profile-MRPBWL2K.mjs → developer-profile-2VSFJGCU.mjs} +1 -1
- package/dist/bin/core-chunks/{distill-MLDZG5RA.mjs → distill-ZF7WHGCZ.mjs} +1 -1
- package/dist/bin/core-chunks/doctor-heal-XFSVPSEY.mjs +7 -0
- package/dist/bin/core-chunks/{doctor-service-WXLB2FEE.mjs → doctor-service-6ZJBWIXR.mjs} +1 -1
- package/dist/bin/core-chunks/{dynasty-outcomes-H2O546OL.mjs → dynasty-outcomes-KDWIEA4Y.mjs} +1 -1
- package/dist/bin/core-chunks/{embeddings-7A5Z5I67.mjs → embeddings-354ZYFKX.mjs} +1 -1
- package/dist/bin/core-chunks/{enriched-recall-YXK7EIKH.mjs → enriched-recall-MKBOXB7M.mjs} +1 -1
- package/dist/bin/core-chunks/{eval-4YFUBFLV.mjs → eval-O4YD6YOV.mjs} +2 -2
- package/dist/bin/core-chunks/{format-5V6GF6JJ.mjs → format-SYVL4CV5.mjs} +1 -1
- package/dist/bin/core-chunks/{gemini-settings-ZTU3VQU3.mjs → gemini-settings-RGD7JLSP.mjs} +1 -1
- package/dist/bin/core-chunks/{grok-mcp-F3SRFMCW.mjs → grok-mcp-IE2RRRRW.mjs} +1 -1
- package/dist/bin/core-chunks/{grok-plugin-4CE2WUYI.mjs → grok-plugin-SSANHBS7.mjs} +1 -1
- package/dist/bin/core-chunks/{grok-skill-GLSBOOKW.mjs → grok-skill-7ZP7R7KO.mjs} +1 -1
- package/dist/bin/core-chunks/{guard-FJBJ6IAE.mjs → guard-RT7U3LJX.mjs} +1 -1
- package/dist/bin/core-chunks/{guards-LFUFKVVH.mjs → guards-AXH6V2IJ.mjs} +1 -1
- package/dist/bin/core-chunks/{harness-FN3HASSA.mjs → harness-V7J7WIT2.mjs} +2 -2
- package/dist/bin/core-chunks/{health-W2VWME7Z.mjs → health-TNB5OC37.mjs} +1 -1
- package/dist/bin/core-chunks/{help-I37I3V2R.mjs → help-P7EYELVK.mjs} +1 -1
- package/dist/bin/core-chunks/{hooks-service-C2P5DRCH.mjs → hooks-service-REI56DDC.mjs} +1 -1
- package/dist/bin/core-chunks/{install-XP4S6HWQ.mjs → install-FZQJJWT5.mjs} +2 -2
- package/dist/bin/core-chunks/{judgment-GJE332LF.mjs → judgment-G5KH6QFC.mjs} +2 -2
- package/dist/bin/core-chunks/{judgment-receipt-WT4EMCAV.mjs → judgment-receipt-GO6QEZQC.mjs} +1 -1
- package/dist/bin/core-chunks/{kimi-hooks-2UEUIKXV.mjs → kimi-hooks-TR6J3OVG.mjs} +1 -1
- package/dist/bin/core-chunks/{kimi-mcp-DJCXZ2JY.mjs → kimi-mcp-ETG7O6O5.mjs} +1 -1
- package/dist/bin/core-chunks/{land-cue-5USQ64MS.mjs → land-cue-3BUD3KJJ.mjs} +1 -1
- package/dist/bin/core-chunks/{land-rho-ISNVEPVC.mjs → land-rho-MCTQDPRH.mjs} +1 -1
- package/dist/bin/core-chunks/{land-synthesis-CHARJMUP.mjs → land-synthesis-MU4EZEYL.mjs} +1 -1
- package/dist/bin/core-chunks/{lean-L53CKZNH.mjs → lean-26BWCUOR.mjs} +1 -1
- package/dist/bin/core-chunks/{legacy-crew-sweep-2TLKJTHI.mjs → legacy-crew-sweep-G5UJT2PM.mjs} +2 -2
- package/dist/bin/core-chunks/{llm-XMH7WTHV.mjs → llm-KMVXVBHG.mjs} +1 -1
- package/dist/bin/core-chunks/{mcp-FLVIZBV2.mjs → mcp-BD5TOTCK.mjs} +1 -1
- package/dist/bin/core-chunks/{memory-dream-EJWI4FJO.mjs → memory-dream-6GFV2GXN.mjs} +1 -1
- package/dist/bin/core-chunks/{memory-export-27HTNNFI.mjs → memory-export-WJ4H7CFV.mjs} +1 -1
- package/dist/bin/core-chunks/{memory-index-BRZDZ2BY.mjs → memory-index-7NIU34EI.mjs} +1 -1
- package/dist/bin/core-chunks/{notification-KJ4FQJAW.mjs → notification-G654IX3O.mjs} +1 -1
- package/dist/bin/core-chunks/{notify-76B7AICZ.mjs → notify-EWYUBKGO.mjs} +1 -1
- package/dist/bin/core-chunks/{opencode-mcp-5YSIYDI3.mjs → opencode-mcp-L7NC77JF.mjs} +1 -1
- package/dist/bin/core-chunks/{pack-integrity-GXN67LJB.mjs → pack-integrity-X277OVRB.mjs} +1 -1
- package/dist/bin/core-chunks/{pack-manager-46SPIPPD.mjs → pack-manager-VN7F6R47.mjs} +1 -1
- package/dist/bin/core-chunks/package-R4FUTGOE.mjs +7 -0
- package/dist/bin/core-chunks/{pi-skill-SDHTUK3V.mjs → pi-skill-IZQEUILZ.mjs} +1 -1
- package/dist/bin/core-chunks/{planning-S3MYVWH6.mjs → planning-NOWLKZDS.mjs} +2 -2
- package/dist/bin/core-chunks/{post-edit-5YSNEMK7.mjs → post-edit-GTBY32JU.mjs} +1 -1
- package/dist/bin/core-chunks/{pre-bash-GLDILCRF.mjs → pre-bash-32ZOGNSP.mjs} +1 -1
- package/dist/bin/core-chunks/{pre-commit-U6HPPNIC.mjs → pre-commit-7TU2A7H4.mjs} +1 -1
- package/dist/bin/core-chunks/{pre-edit-PEYQA6P6.mjs → pre-edit-ASEWA5TS.mjs} +1 -1
- package/dist/bin/core-chunks/{pre-package-76JR5GLO.mjs → pre-package-ZTZACEBB.mjs} +1 -1
- package/dist/bin/core-chunks/{pre-search-5EHNUOP3.mjs → pre-search-MKDRFJSE.mjs} +1 -1
- package/dist/bin/core-chunks/{preferences-BTSYWYUM.mjs → preferences-KO5U2ELK.mjs} +1 -1
- package/dist/bin/core-chunks/{primitives-IXAYLX7U.mjs → primitives-GNUMBYOK.mjs} +1 -1
- package/dist/bin/core-chunks/{prjct-md-SUDFWDCS.mjs → prjct-md-BSFV7OQQ.mjs} +1 -1
- package/dist/bin/core-chunks/{product-KKGJ6MMF.mjs → product-GUHSUNIH.mjs} +1 -1
- package/dist/bin/core-chunks/{project-agent-surfaces-I2CUZUIN.mjs → project-agent-surfaces-BXCJJXB7.mjs} +1 -1
- package/dist/bin/core-chunks/{project-memory-GYLYIJQD.mjs → project-memory-L5MDZYST.mjs} +1 -1
- package/dist/bin/core-chunks/{project-style-evolution-5W25UPPN.mjs → project-style-evolution-HIMSJQQB.mjs} +1 -1
- package/dist/bin/core-chunks/prompt-47YP5JIR.mjs +25 -0
- package/dist/bin/core-chunks/{purge-5EPJV25P.mjs → purge-6SJKHKIY.mjs} +1 -1
- package/dist/bin/core-chunks/{registry-LK6IQ5UX.mjs → registry-YM2EYUXY.mjs} +1 -1
- package/dist/bin/core-chunks/{retention-S22T3SPT.mjs → retention-QSXWKE4H.mjs} +1 -1
- package/dist/bin/core-chunks/{retro-CLKOHAN6.mjs → retro-B2EBN4TA.mjs} +1 -1
- package/dist/bin/core-chunks/{review-risk-LLLBKUXT.mjs → review-risk-LBPY5M3K.mjs} +1 -1
- package/dist/bin/core-chunks/{safe-artifacts-RW5WQUUJ.mjs → safe-artifacts-PE2TMEZQ.mjs} +1 -1
- package/dist/bin/core-chunks/{sdd-HE7O6N5S.mjs → sdd-3WNZJ6FU.mjs} +1 -1
- package/dist/bin/core-chunks/{seed-JX7W53E5.mjs → seed-MMDJE2UO.mjs} +2 -2
- package/dist/bin/core-chunks/{self-heal-DFUEKNF3.mjs → self-heal-R5FBXEVQ.mjs} +1 -1
- package/dist/bin/core-chunks/{session-continuity-BFSW4OL6.mjs → session-continuity-OQDB5UYI.mjs} +1 -1
- package/dist/bin/core-chunks/{session-start-HVYUKJL2.mjs → session-start-FM6UL7MT.mjs} +1 -1
- package/dist/bin/core-chunks/{setup-GHS24ER5.mjs → setup-BL36ZWPW.mjs} +2 -2
- package/dist/bin/core-chunks/{setup-J4JFYT63.mjs → setup-V75BWRHU.mjs} +2 -2
- package/dist/bin/core-chunks/{shipping-I4D4AVTE.mjs → shipping-NZVM57JJ.mjs} +4 -4
- package/dist/bin/core-chunks/{signals-digest-V44KYN6Z.mjs → signals-digest-P5BG6MZF.mjs} +1 -1
- package/dist/bin/core-chunks/{skill-adherence-MHY4BZL4.mjs → skill-adherence-JE3N3Y67.mjs} +1 -1
- package/dist/bin/core-chunks/{spec-2XXPLHUZ.mjs → spec-VC3VTUI3.mjs} +3 -3
- package/dist/bin/core-chunks/{spec-context-inference-THFMXC7S.mjs → spec-context-inference-KOINWBC7.mjs} +1 -1
- package/dist/bin/core-chunks/{spec-service-I23KJKKP.mjs → spec-service-UZ53XL6X.mjs} +1 -1
- package/dist/bin/core-chunks/{spec-task-breakdown-HTG6ME6G.mjs → spec-task-breakdown-3Y7YXCIQ.mjs} +1 -1
- package/dist/bin/core-chunks/{stop-2H57XCGZ.mjs → stop-6SH36ULT.mjs} +3 -3
- package/dist/bin/core-chunks/{subagent-start-5LPASXOS.mjs → subagent-start-TVGBV2V2.mjs} +1 -1
- package/dist/bin/core-chunks/{subagent-stop-ANLSG3KN.mjs → subagent-stop-APWY6KMX.mjs} +1 -1
- package/dist/bin/core-chunks/{surface-attribution-WL7S53XX.mjs → surface-attribution-CQVM2SWY.mjs} +1 -1
- package/dist/bin/core-chunks/{task-service-FK7FC3PE.mjs → task-service-KFYL5NT4.mjs} +1 -1
- package/dist/bin/core-chunks/{tdd-NQDHU62B.mjs → tdd-P2PP4RR4.mjs} +1 -1
- package/dist/bin/core-chunks/{team-XZ4Q6UBV.mjs → team-WKAAOEFE.mjs} +1 -1
- package/dist/bin/core-chunks/{template-loader-33OVJ4G5.mjs → template-loader-H4FE37HV.mjs} +1 -1
- package/dist/bin/core-chunks/{uninstall-6NFON7FO.mjs → uninstall-W6EAUS7N.mjs} +1 -1
- package/dist/bin/core-chunks/{update-4IE6SA6M.mjs → update-PSHEJJI5.mjs} +2 -2
- package/dist/bin/core-chunks/{update-checker-FK7MWNWN.mjs → update-checker-LZCUPWQB.mjs} +1 -1
- package/dist/bin/core-chunks/{version-252QLBN2.mjs → version-B5DBRVGQ.mjs} +1 -1
- package/dist/bin/core-chunks/{watch-service-7ZERG7RC.mjs → watch-service-7V3O52TW.mjs} +1 -1
- package/dist/bin/core-chunks/weak-frontier-demo-ZCDTMYRO.mjs +7 -0
- package/dist/bin/core-chunks/{weak-model-mode-DH66XMD2.mjs → weak-model-mode-LOAPFJPQ.mjs} +1 -1
- package/dist/bin/core-chunks/{work-graph-JGJWE3AV.mjs → work-graph-ZNV7S6EU.mjs} +1 -1
- package/dist/bin/core-chunks/{work-scope-3LXOEIUX.mjs → work-scope-XXPUH6TU.mjs} +1 -1
- package/dist/bin/core-chunks/{workflow-FGJVLRQ3.mjs → workflow-XM77QYRF.mjs} +2 -2
- package/dist/bin/core-chunks/{workflows-reference-UWKRZ6BJ.mjs → workflows-reference-T7RH7IGJ.mjs} +1 -1
- package/dist/bin/core-chunks/{world-model-impact-RH5WH2B3.mjs → world-model-impact-FAGGNUGN.mjs} +1 -1
- package/dist/bin/hook-chunks/{agent-switch-7GOGG4KG.mjs → agent-switch-TAJWH2ZD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-UI2JRLJO.mjs → analysis-34WDLUXK.mjs} +2 -2
- package/dist/bin/hook-chunks/{auto-flush-JKIXTI2I.mjs → auto-flush-7TIEBPPQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{capture-gate-DIPHPNIC.mjs → capture-gate-JFVGG7RB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-XXVHUYL7.mjs → chunk-22CBVTZ3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZH2MF7H7.mjs → chunk-3JOZN7YJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Y7RDBMNC.mjs → chunk-4X3KUIXK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6RS7PNAN.mjs → chunk-5ALQBNIZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IL36ER4U.mjs → chunk-5VPZI2ZF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-FBEDUKMG.mjs → chunk-6EHYPQ5U.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-7H5UVM6X.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-IDPBMN3Q.mjs → chunk-A3R47SP6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UI25YRTY.mjs → chunk-CGAKJDKT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6LU777GI.mjs → chunk-CJY4Y5SO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-WIA6ORIY.mjs → chunk-FSFURDAE.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6WDRJ7J7.mjs → chunk-FTBBQHI4.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-25OGCQTR.mjs → chunk-G4VJKPG7.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-PFORBQBF.mjs → chunk-GAJOSSB4.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-KOLXYWOA.mjs → chunk-H3GIYI4Q.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-B7MHIUFA.mjs → chunk-HRU2KNEB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-JF6DFOQK.mjs → chunk-LCGWETJ6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PQJ64L6U.mjs → chunk-MG2DNP4Z.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-NGB6JNSB.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-AEDB75AK.mjs → chunk-OALZUWC6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IFIENAZU.mjs → chunk-PZMBZ6GE.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-F3PNT2DQ.mjs → chunk-QIB6Y6AH.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-ZXON2U5F.mjs → chunk-QMNZPNVY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-B2ZA5ZAO.mjs → chunk-R4YDE3GU.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UBWUQ64A.mjs → chunk-RFKRKUHB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NMB6YSAH.mjs → chunk-RGOTJCZU.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ANSRNEEI.mjs → chunk-T2KVL6PZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HNZ24HIK.mjs → chunk-T7DRHVK3.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-IHEOOJJT.mjs → chunk-TWFLW6OJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ONGVBXBD.mjs → chunk-UJIOGFNP.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NSTXHVTH.mjs → chunk-UK24P7PV.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-63P5VOR6.mjs → chunk-ULNGKZB6.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-UMJ5D5I6.mjs → chunk-UWHVPO6X.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-A6LRNS6R.mjs → chunk-XC2BSGWF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7PA4KPSR.mjs → chunk-ZPAY2NSF.mjs} +2 -2
- package/dist/bin/hook-chunks/{codex-skill-UZZCACMB.mjs → codex-skill-BFRU5FTP.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-FJ73C2ZW.mjs → command-installer-3XOZGKOQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-XDKOTIJM.mjs → config-manager-UPB7NEXF.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-NH4BMGSJ.mjs → context7-service-7VFXEQVN.mjs} +1 -1
- package/dist/bin/hook-chunks/{cwd-changed-STP3LH6Y.mjs → cwd-changed-USNJYUH7.mjs} +1 -1
- package/dist/bin/hook-chunks/{distill-63BHUJAC.mjs → distill-47YVL7IH.mjs} +1 -1
- package/dist/bin/hook-chunks/{enriched-recall-6F6LBYAB.mjs → enriched-recall-CVYI52NO.mjs} +1 -1
- package/dist/bin/hook-chunks/{format-VJ2YQ4XQ.mjs → format-DPIN45EG.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-receipt-LSJCAYBT.mjs → judgment-receipt-G2DKQR7U.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-cue-DEO2AZW4.mjs → land-cue-3JD2TXFP.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-synthesis-GTMFIGDM.mjs → land-synthesis-5C4KGCTB.mjs} +1 -1
- package/dist/bin/hook-chunks/{legacy-crew-sweep-QPKU7ITU.mjs → legacy-crew-sweep-XQNXNZES.mjs} +2 -2
- package/dist/bin/hook-chunks/{memory-index-KCMXQGKX.mjs → memory-index-LL6SQJ2N.mjs} +1 -1
- package/dist/bin/hook-chunks/{notification-DX6ZHOUC.mjs → notification-ACQBRJG3.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-integrity-UMLIB5RQ.mjs → pack-integrity-DCXVRRJZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-YXRK2TJ4.mjs → pack-manager-KYWKNYUY.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-JR7O5MYW.mjs → planning-KOU3XKWS.mjs} +2 -2
- package/dist/bin/hook-chunks/{post-edit-IPTVSRVG.mjs → post-edit-CK2MYQEN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-bash-5WWTH36N.mjs → pre-bash-W5A5CTR3.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-commit-KZ5TNTPW.mjs → pre-commit-5Q24RM4S.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-edit-XHPYBXRU.mjs → pre-edit-YIJ4BCYL.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-package-U3HDW3SX.mjs → pre-package-O4RMVA4T.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-search-R5CRK66E.mjs → pre-search-WYOWC3D6.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-IBQTJBK7.mjs → prjct-md-2UVHFYTJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-TPZO73ZV.mjs → project-agent-surfaces-BKFYUMRV.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-memory-YQLZX5RG.mjs → project-memory-OC5GTJPY.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-style-evolution-NOFCIIZZ.mjs → project-style-evolution-2IFJCACQ.mjs} +1 -1
- package/dist/bin/hook-chunks/prompt-JIWMP563.mjs +26 -0
- package/dist/bin/hook-chunks/{purge-5W3K2MZL.mjs → purge-FQK3Z4QS.mjs} +1 -1
- package/dist/bin/hook-chunks/{retention-GWJ4AX7I.mjs → retention-2FETBJFG.mjs} +1 -1
- package/dist/bin/hook-chunks/{sdd-GWBRD4KI.mjs → sdd-V43TSJ2P.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-continuity-VH645RGR.mjs → session-continuity-RO2ACICF.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-start-4TYTI27B.mjs → session-start-FKKFMKQ5.mjs} +1 -1
- package/dist/bin/hook-chunks/{setup-VF4UHUBX.mjs → setup-YV2DKG5L.mjs} +2 -2
- package/dist/bin/hook-chunks/{shipping-2ULWBGRX.mjs → shipping-SCNFEXBY.mjs} +4 -4
- package/dist/bin/hook-chunks/{spec-context-inference-HVENYOIO.mjs → spec-context-inference-BD3ANTXA.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-4XGQQPGP.mjs → spec-service-OWYOAGXS.mjs} +2 -2
- package/dist/bin/hook-chunks/{spec-task-breakdown-JXF556UH.mjs → spec-task-breakdown-HOTLUFDM.mjs} +1 -1
- package/dist/bin/hook-chunks/{stop-NJDYIIXR.mjs → stop-MIXT7WXA.mjs} +3 -3
- package/dist/bin/hook-chunks/{subagent-start-2YMGD4SY.mjs → subagent-start-NO3TN65K.mjs} +1 -1
- package/dist/bin/hook-chunks/{subagent-stop-4TZJ2NSJ.mjs → subagent-stop-CKWIXX7W.mjs} +1 -1
- package/dist/bin/hook-chunks/{surface-attribution-UNK4J5W2.mjs → surface-attribution-BYESPLXM.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-service-SPUES5DO.mjs → task-service-5ONSBKKP.mjs} +1 -1
- package/dist/bin/hook-chunks/{tdd-MYF7I5FS.mjs → tdd-SESB4IG3.mjs} +1 -1
- package/dist/bin/hook-chunks/{template-loader-4SYVR2UB.mjs → template-loader-KO67FVHO.mjs} +1 -1
- package/dist/bin/hook-chunks/{weak-model-mode-TYJJT6JJ.mjs → weak-model-mode-HPXBKXJT.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-scope-A6XPENFE.mjs → work-scope-RNPGACPA.mjs} +1 -1
- package/dist/bin/prjct-core.mjs +3 -3
- package/dist/bin/prjct-hooks.mjs +1 -1
- package/dist/daemon/entry.mjs +591 -583
- package/dist/mcp/server.mjs +318 -312
- package/package.json +2 -1
- package/dist/bin/core-chunks/chunk-GDLAQV3Q.mjs +0 -14
- package/dist/bin/core-chunks/chunk-R7LLMJDP.mjs +0 -7
- package/dist/bin/core-chunks/chunk-UT425KVX.mjs +0 -10
- package/dist/bin/core-chunks/chunk-VILH3VYH.mjs +0 -103
- package/dist/bin/core-chunks/chunk-Y5SEUYET.mjs +0 -7
- package/dist/bin/core-chunks/doctor-heal-ZUZ2RHGY.mjs +0 -7
- package/dist/bin/core-chunks/package-DCGCOAGQ.mjs +0 -7
- package/dist/bin/core-chunks/prompt-SW5XDRMX.mjs +0 -23
- package/dist/bin/core-chunks/weak-frontier-demo-5C4FR3OA.mjs +0 -7
- package/dist/bin/hook-chunks/chunk-IWUF2LGO.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +0 -9
- package/dist/bin/hook-chunks/prompt-DJWONMTZ.mjs +0 -24
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as _,b as R,c as o}from"./chunk-ZF2EVMY7.mjs";import"./chunk-B36LC2JR.mjs";import"./chunk-DYHYDHCW.mjs";import{b as v}from"./chunk-
|
|
8
|
+
import{a as _,b as R,c as o}from"./chunk-ZF2EVMY7.mjs";import"./chunk-B36LC2JR.mjs";import"./chunk-DYHYDHCW.mjs";import{b as v}from"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import{b as y}from"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import{e as w,g as k}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{b as P,h as A}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{b as E,p as x}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";A();x();k();import{createHash as I}from"node:crypto";function S(c){let t={goal:c.goal,eli10:c.eli10,stakes:c.stakes,acceptance_criteria:c.acceptance_criteria,scope:c.scope,out_of_scope:c.out_of_scope,risks:c.risks,test_plan:c.test_plan,scenarios:c.scenarios};return I("sha256").update(JSON.stringify(t)).digest("hex")}m(S,"computeAuditCandidateHash");function j(c,t){let e=w.get(c,"SELECT content FROM specs WHERE id = ?",t),s=(()=>{if(!e?.content)return null;try{return JSON.parse(e.content)}catch{return null}})(),r=w.query(c,"SELECT lens FROM spec_selected_reviewer WHERE spec_id = ?",t).map(a=>a.lens),n=new Set(w.query(c,"SELECT lens FROM spec_review WHERE spec_id = ? AND verdict = 'pass'",t).map(a=>a.lens));if(!(r.length>0?r.every(a=>n.has(a)):n.has("strategic")&&n.has("architecture")&&n.has("design")))return!1;let u=s?.audit_candidate_hash;if(!u)return!0;if(S(s)!==u)return!1;let l=s?.reviews??{};for(let a of r.length>0?r:Object.keys(l)){let d=l[a];if(!(!d||d.verdict!=="pass")&&d.candidateHash!==u)return!1}for(let a of r.length>0?r:["strategic","architecture","design"]){if(!n.has(a))continue;let d=l[a];if(!d||d.candidateHash!==u)return!1}return!0}m(j,"reviewsGatePassedRelational");async function D(c){try{let{stdout:t}=await E("git",["rev-parse","HEAD"],{cwd:c}),e=t.trim();return/^[0-9a-f]{7,40}$/.test(e)?e:null}catch{return null}}m(D,"readGitHead");var C=class{static{m(this,"SpecService")}async create(t,e){let s=await this.requireProjectId(t),{classifySpecCreate:r,shouldMirrorSpecToMemory:n}=await import("./precision-classifier-IVVAXE26.mjs"),p=r(e.title,e.content.goal);if(p.action==="refuse")throw new Error(`Cannot create empty spec (${p.reasonCode}): ${p.reason}`);let u=e.autoContext!==!1,l=e.content.notes??"",a=u&&!l.trim()?await import("./spec-context-inference-BD3ANTXA.mjs").then(async({inferSpecContext:h,warnNoContextMatch:f})=>{let g=await h(e.title,s,t);return g.empty&&f(e.title),g.empty?l:g.notesBlock}):l,d=_.parse({goal:e.content.goal,eli10:e.content.eli10??"",stakes:e.content.stakes??"",acceptance_criteria:e.content.acceptance_criteria??[],scope:e.content.scope??[],out_of_scope:e.content.out_of_scope??[],risks:e.content.risks??[],test_plan:e.content.test_plan??[],reviews:e.content.reviews,linked_tasks:e.content.linked_tasks??[],notes:a}),i=o.create(s,{title:e.title,content:d,tags:e.tags});return n(i.title,i.content.goal)&&await v.remember(t,{type:"spec",content:`${i.title}
|
|
9
9
|
|
|
10
10
|
Goal: ${i.content.goal}`,tags:{...e.tags??{},spec_id:i.id,status:i.status},source:i.id,provenance:"declared"}),i}async get(t,e){let s=await this.requireProjectId(t);return o.get(s,e)}async list(t,e={}){let s=await this.requireProjectId(t);return o.list(s,e)}async setStatus(t,e,s){let r=await this.requireProjectId(t),n=o.setStatus(r,e,s);return n&&await v.remember(t,{type:"spec",content:`Spec status \u2192 ${s}: ${n.title}`,tags:{spec_id:e,status:s,event:"status_change"},source:e}),n}async patch(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=_.parse({...n.content,...s});return this.update(t,e,p)}async applyDelta(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=R(n.content,s);return p===n.content?n:this.update(t,e,p)}async update(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content),u=S(s),l=p!==u,a=l?{...s,reviews:{},selected_reviewers:[],audit_candidate_hash:null}:s;return l&&(n.status==="reviewed"||n.status==="in_progress")&&o.setStatus(r,e,"draft"),o.updateContent(r,e,a)}async recordReview(t,e,s,r){let n=await this.requireProjectId(t),p=3,u=50,l=m(async d=>{let i=o.get(n,e);if(!i)return null;let h=i.content.audit_candidate_hash??S(i.content);if(i.content.audit_candidate_hash&&S(i.content)!==i.content.audit_candidate_hash)throw new Error(`SPEC_CANDIDATE_DRIFT: body no longer matches audit_candidate_hash. Re-run \`prjct spec audit ${e}\` then re-record reviews.`);let f={...r,ts:P(),candidateHash:h},g={...i.content,audit_candidate_hash:h,reviews:{...i.content.reviews??{},[s]:f}};if(o.casUpdate(n,e,g,i.updatedAt))return o.get(n,e);if(d+1>=p)throw new Error(`SPEC_RECORD_REVIEW_CONFLICT_RETRY_EXHAUSTED: ${p} retries failed for spec ${e}`);return await new Promise($=>setTimeout($,u)),l(d+1)},"attemptReview"),a=await l(0);if(a&&j(n,e)&&a.status==="draft"){let{assessAcceptanceCriteria:d}=await import("./nyquist-lite-GE7OAFLC.mjs"),i=d(a.content.acceptance_criteria??[]);if(!i.ok&&i.message){let f=await y.readConfig(t).catch(()=>null),g=f?.tdd?.mode==="strict",b=f?.sdd?.mode==="strict";if(g||b)throw new Error(`NYQUIST_LITE_BLOCK: ${i.message}
|
|
11
|
-
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-
|
|
11
|
+
Rewrite acceptance criteria with verifiable signals, then re-record the last review.`);try{await v.remember(t,{type:"improvement-signal",content:i.message,tags:{source:"nyquist-lite",spec:e},provenance:"extracted",projectId:n})}catch{}}let h=o.setStatus(n,e,"reviewed");if(h){let{breakdownSpecToTasks:f}=await import("./spec-task-breakdown-HOTLUFDM.mjs");return await f(n,t,h),o.get(n,e)}return h}return a}async linkTask(t,e,s){let r=await this.requireProjectId(t);return o.linkTask(r,e,s)}async ship(t,e,s){let r=await this.requireProjectId(t);s!==void 0&&o.setShippedPr(r,e,s);let n=await D(t);return n&&o.setShippedSha(r,e,n),o.setStatus(r,e,"shipped")}unmetCriteria(t,e=new Set){return t.content.acceptance_criteria.filter(s=>!e.has(s))}async setSelectedReviewers(t,e,s){let r=await this.requireProjectId(t),n=o.get(r,e);if(!n)return null;let p=S(n.content);return o.updateContent(r,e,{...n.content,selected_reviewers:s,audit_candidate_hash:p,reviews:{}})}async requireProjectId(t){let e=await y.readConfig(t);if(!e?.projectId)throw new Error("not a prjct project (run `prjct init` first)");return e.projectId}},oe=new C;export{oe as specService};
|
package/dist/bin/hook-chunks/{spec-task-breakdown-JXF556UH.mjs → spec-task-breakdown-HOTLUFDM.mjs}
RENAMED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as m}from"./chunk-V6GGH6H5.mjs";import{c as s}from"./chunk-ZF2EVMY7.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import{b as w}from"./chunk-
|
|
8
|
+
import{a as m}from"./chunk-V6GGH6H5.mjs";import{c as s}from"./chunk-ZF2EVMY7.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import{b as w}from"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{b as h,h as S}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as p}from"./chunk-E66B27AL.mjs";S();async function x(r,a,e){let o=e.content.acceptance_criteria;if(o.length===0)return{taskIds:[],skippedReason:"no_acceptance_criteria"};if(e.content.tasks_created_at!==null)return{taskIds:[],skippedReason:"already_broken_down"};let d=e.content.linked_tasks.length>0,y=(await m.getTasks(r)).filter(t=>t.featureId===e.id),g=new Set,u=o.map(t=>{let n=y.find(_=>_.body===t&&!g.has(_.id));return n&&g.add(n.id),n??null}),c=o.map((t,n)=>({ac:t,i:n})).filter(({i:t})=>u[t]===null),l=c.length>0?await m.addTasks(r,c.map(({ac:t})=>({description:I(t),body:t,priority:"medium",type:"feature",section:"backlog",featureId:e.id,groupId:e.id,groupName:e.title}))):[],b=new Map(c.map(({i:t},n)=>[t,l[n].id])),i=o.map((t,n)=>u[n]?.id??b.get(n));for(let t of i)s.linkTask(r,e.id,t);let k=s.get(r,e.id);if(k){let t={...k.content,tasks_created_at:h()};s.updateContent(r,e.id,t)}let f=i.length-l.length;return await w.remember(a,{type:"spec",content:`Auto-breakdown: ${l.length} tasks created${f>0?`, ${f} adopted`:""} from ${e.title}${d?" (recovered from partial)":""}`,tags:{spec_id:e.id,event:"auto_breakdown",task_count:String(i.length),...d?{recovered:"partial"}:{}},source:e.id}),{taskIds:i,...d?{recoveredFromPartial:!0}:{}}}p(x,"breakdownSpecToTasks");function I(r){let a=r.replace(/\s+/g," ").trim();return a.length<=140?a:`${a.slice(0,137)}\u2026`}p(I,"truncateForDescription");export{x as breakdownSpecToTasks};
|
|
@@ -5,12 +5,12 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as ue,b as T,d as X}from"./chunk-32RX4YGI.mjs";import{a as L}from"./chunk-SQW2B7NW.mjs";import{b as ae}from"./chunk-NJ74RHNC.mjs";import{a as ce}from"./chunk-WUOVBBPC.mjs";import{a as W}from"./chunk-QOQZHR3E.mjs";import{a as ie,b as oe}from"./chunk-H5AVBDCH.mjs";import"./chunk-TPESWBA7.mjs";import{b as se}from"./chunk-FEFP6JOL.mjs";import{c as D}from"./chunk-TF6PN7IB.mjs";import{d as re}from"./chunk-
|
|
8
|
+
import{a as ue,b as T,d as X}from"./chunk-32RX4YGI.mjs";import{a as L}from"./chunk-SQW2B7NW.mjs";import{b as ae}from"./chunk-NJ74RHNC.mjs";import{a as ce}from"./chunk-WUOVBBPC.mjs";import{a as W}from"./chunk-QOQZHR3E.mjs";import{a as ie,b as oe}from"./chunk-H5AVBDCH.mjs";import"./chunk-TPESWBA7.mjs";import{b as se}from"./chunk-FEFP6JOL.mjs";import{c as D}from"./chunk-TF6PN7IB.mjs";import{d as re}from"./chunk-GAJOSSB4.mjs";import"./chunk-Y5NQV46G.mjs";import{b as h}from"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import{g as ot,h as at}from"./chunk-UUULLTQV.mjs";import{a as ne,c as J}from"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-JGZ3QGWX.mjs";import{c as P}from"./chunk-QXCEBAIA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as S}from"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import{a as te,b as st,e as v,f as it,g as G}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{b as Q,h as et,v as ee,w as rt}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import{b as B,c as nt}from"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as Z,o as tt}from"./chunk-UH4MD3F3.mjs";import{e as I,g as M,l as C,p as V}from"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a,b as Y,e as q}from"./chunk-E66B27AL.mjs";import k from"node:fs/promises";import Ve from"node:path";import ct from"node:crypto";import ut from"node:fs/promises";function O(n){return typeof n=="string"?n:Array.isArray(n)?n.map(e=>{if(typeof e=="string")return e;if(e&&typeof e=="object"&&"text"in e){let t=e.text;return typeof t=="string"?t:""}return""}).join(`
|
|
9
9
|
`).trim():""}a(O,"textOf");function x(n){try{let e=Y("node:fs"),s=Y("node:path").join(n,".prjct","prjct.config.json"),r=e.readFileSync(s,"utf-8");return JSON.parse(r).projectId??null}catch{return null}}a(x,"projectIdFromPath");var fe="friction-detector",le="friction-promote",pe=5,de=400,me=160,lt=[/^\s*no[,.!\s]/i,/^\s*nope\b/i,/^\s*stop\b/i,/^\s*wait\b/i,/^\s*cancel\b/i],pt=[/\bshould be\b/i,/\brather than\b/i,/\binstead\b/i],dt=[/\bdoesn'?t work\b/i,/\bbroken\b/i,/\bagain\b.*\bsame\b/i];async function ge(n,e,t,s={}){let r=s.preloadedLines?s.preloadedLines:await ut.readFile(e,"utf-8").then(ft).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=mt(r);if(i.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=i.slice(0,pe).map(f=>({category:f.category,expectedBehavior:"Follow the user constraint without requiring correction.",observedBehavior:`The assistant response triggered user ${f.category}.`,relatedRuleId:null})),c=vt(n),l=x(n)??void 0;return{...await i.slice(0,pe).reduce(async(f,d)=>{let p=await f,y=ye(d.excerpt).slice(0,12);if(c.has(y))return await yt(n,l,d).catch(()=>{}),{...p,signalsSkipped:p.signalsSkipped+1};try{return await h.remember(n,{type:"improvement-signal",content:ht(d),tags:{source:fe,category:d.category,...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},...t?{session:t}:{},key:y},provenance:"extracted",projectId:l}),c.add(y),{...p,signalsRecorded:p.signalsRecorded+1}}catch{return{...p,signalsSkipped:p.signalsSkipped+1}}},Promise.resolve({signalsRecorded:0,signalsSkipped:0})),failures:o}}a(ge,"detectFriction");function ft(n){return T(n)}a(ft,"parseJsonl");function mt(n){let e={signals:[],lastAssistantText:""};for(let t of n){let s=t.role??t.message?.role,r=O(t.content??t.message?.content);if(!r)continue;if(s==="assistant"){e.lastAssistantText=r;continue}if(s!=="user")continue;let i=gt(r.slice(0,300));i&&e.signals.push({excerpt:r.slice(0,de).trim(),category:i,precedingAssistantPreview:e.lastAssistantText.slice(0,de).trim()})}return e.signals}a(mt,"extractSignals");function gt(n){return dt.some(e=>e.test(n))?"complaint":lt.some(e=>e.test(n))?"negation":pt.some(e=>e.test(n))?"correction":null}a(gt,"classify");function ht(n){let e=wt(n.category),t=he(n.excerpt),s=t?`Obey developer constraint: ${t}`:e.lesson,r=t?`Always: ${t}`:e.nextAction;return[`[${n.category}] Lesson: ${s}`,"What happened: The user pushed back after the assistant response.",`Why it mattered: ${e.why}`,`Pattern: ${e.pattern}`,`Anti-pattern: ${e.antiPattern}`,`Next action: ${r}`].join(`
|
|
10
10
|
`)}a(ht,"formatSignal");function he(n){let e=n.replace(/\s+/g," ").trim();if(!e)return null;let t=e.replace(/^\s*(?:nope|no|stop|wait|cancel)[,.!\s:—-]*/i,"").trim(),s=t.match(/\bshould be\b\s+(.+?)$/i);if(s?.[1])return E(`Prefer ${s[1]}`);let r=t.match(/^(.+?)\s+rather than\s+(.+?)$/i);if(r?.[1]&&r[2])return E(`Prefer ${r[1].trim()} rather than ${r[2].trim()}`);let i=t.match(/\b(?:use|prefer|do|run|ship|write|keep)\s+(.+?)\s+instead(?:\s+of\s+(.+))?$/i);if(i?.[1]){let u=i[2]?` instead of ${i[2].trim()}`:" instead";return E(`Use ${i[1].trim()}${u}`)}let o=t.match(/\binstead of\b\s+(.+?)$/i);if(o?.[1])return E(`Avoid ${o[1].trim()}`);let c=t.match(/\b(?:don'?t|do not|never)\s+(.+?)$/i);if(c?.[1])return E(`Never ${c[1].trim()}`);let l=t.match(/\balways\s+(.+?)$/i);if(l?.[1])return E(`Always ${l[1].trim()}`);if(t.length>=12&&t.length<=me&&/^(?:run|use|do|ship|write|keep|add|fix|remove|prefer|test|check|verify|read|ask|stop|start)\b/i.test(t)){let u=t.charAt(0).toUpperCase()+t.slice(1);return E(u.replace(/[.!?]+$/,""))}return null}a(he,"extractSpecificConstraint");function E(n){let e=n.replace(/\s+/g," ").trim().replace(/^[-*•]\s+/,"").replace(/[.!?]+$/,"").slice(0,me);return e.length<12||/^(?:nope|no|stop|wait|cancel)\b/i.test(e)?null:e}a(E,"cleanConstraint");async function yt(n,e,t){if(!e)return;let s=he(t.excerpt);if(!s)return;let r=`Always: ${s}`,i=`fp:${ye(s).slice(0,12)}`;try{if(h.recall(e,{types:["feedback"],tags:{source:le,key:i},limit:1,dedupeByKey:!1}).length>0)return;await h.remember(n,{type:"feedback",content:r,tags:{source:le,key:i,category:t.category,from:"recurring-friction"},provenance:"extracted",projectId:e})}catch{}}a(yt,"maybePromoteStandingPreference");function wt(n){return n==="complaint"?{lesson:"Treat explicit failure complaints as evidence that the last result needs diagnosis, not repetition.",why:"The user reported that the delivered behavior or command did not work.",pattern:"User names a broken or non-working result after an assistant action.",antiPattern:"Retrying the same path or moving on without isolating the failure.",nextAction:"Stop, inspect the failing output or assumption, and propose the smallest verifiable fix."}:n==="correction"?{lesson:"Update the working assumption when the user corrects the intended direction.",why:"The assistant was using an assumption that did not match what the user wanted.",pattern:"User redirects the implementation or workflow with a correction.",antiPattern:"Continuing with the original plan after the user clarified a different target.",nextAction:"Restate the corrected target as an actionable rule before continuing."}:{lesson:"Recalibrate before continuing when the user rejects the assistant\u2019s last step.",why:"The assistant likely violated sequencing, scope, or approval expectations.",pattern:"User immediately rejects an assistant action or proposed next step.",antiPattern:"Treating the rejected action as acceptable and continuing without changing course.",nextAction:"Pause, convert the pushback into a workflow constraint, and adjust the next tool use."}}a(wt,"lessonTemplate");function ye(n){let e=n.toLowerCase().replace(/\s+/g," ").trim();return ct.createHash("sha256").update(e).digest("hex")}a(ye,"hashSignal");function vt(n){try{let e=x(n);if(!e)return new Set;let t=h.recall(e,{types:["improvement-signal"],tags:{source:fe},limit:100,dedupeByKey:!1}),s=new Set;for(let r of t){let i=r.tags.key;i&&s.add(i)}return s}catch{return new Set}}a(vt,"projectMemoryHashes");var bt=32;function we(n={}){let t=(n.hookHost===void 0?process.env.PRJCT_HOOK_HOST:n.hookHost)?.trim().toLowerCase().slice(0,bt);return t&&ie.has(t)?t:n.detectedRuntime??oe()}a(we,"resolveInstructionRuntime");V();function ve(n){try{return JSON.parse(n)}catch{return null}}a(ve,"safeJsonParse");function b(n,e,t,s){let r=[];try{let{prjctDb:i}=(G(),q(it)),o=i.query(n,e,...t);for(let c of o){let l=ve(c.data);if(!l||typeof l!="object")continue;let u=l.tags;if(!u)continue;let f=s(u,l);f!==void 0&&r.push(f)}}catch{}return r}a(b,"collectFromPersistedEvents");var ke="lean-detector",kt="lean-debt-growth",St=3,be=["off","lite","full","ultra"];function Tt(n){let e=n?.lean?.mode;if(e&&be.includes(e))return e;let t=process.env.PRJCT_LEAN_MODE?.toLowerCase();return t&&be.includes(t)?t:"off"}a(Tt,"effectiveMode");async function Se(n,e){let t={active:!1,total:0,previous:0,persisted:!1},s=e!==void 0?e:await S.readConfig(n).catch(()=>null);if(!s?.projectId||Tt(s)==="off")return t;t.active=!0;try{let r=await Rt(n);if(t.total=r,r===0)return t;let i=Et(s.projectId);t.previous=i;let o=r-i;i>0&&o>=St&&(await h.remember(n,{type:"lean-debt",content:`Lean debt growing: \`lean:\` markers rose by ${o} (now ${r}, was ${i}). Deferred simplifications are accumulating \u2014 consider a leaning pass via \`prjct lean debt\`.`,tags:{source:ke,pattern:kt,total:String(r),previous:String(i),delta:String(o)},provenance:"inferred",projectId:s.projectId}),t.persisted=!0)}catch{}return t}a(Se,"detectAndPersistLeanDebt");async function Rt(n){let e=await I(["grep","-cI","-e","lean:"],{cwd:n,maxBuffer:16777216});if(!e.ok){if(M(e,1))return 0;C(e)}return e.stdout.split(`
|
|
11
11
|
`).reduce((t,s)=>{let r=s.lastIndexOf(":");if(r<=0)return t;let i=Number.parseInt(s.slice(r+1),10);return Number.isFinite(i)?t+i:t},0)}a(Rt,"measureLeanMarkers");function Et(n){return b(n,"SELECT data FROM events WHERE type = 'memory.remember.lean-debt' ORDER BY id DESC LIMIT 50",[],t=>{if(t.source!==ke)return;let s=typeof t.total=="string"?Number.parseInt(t.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(Et,"collectPreviousSnapshot");import _t from"node:path";V();var At="hot-file",Te="pattern-detector-auto",It="recurring-bug",Re="pattern-detector-recurring",Ct="tech-debt-growth",Ee="pattern-detector-debt",N=7,xt=3,$=30,Pt=2,Mt=5,Dt=[/^package(-lock)?\.json$/,/^bun\.lock(b)?$/,/^pnpm-lock\.yaml$/,/^yarn\.lock$/,/^CHANGELOG\.md$/,/^\.gitignore$/,/\.snap$/,/^dist\//,/^node_modules\//];async function _e(n,e){let t={scanned:0,hotFiles:[],persisted:0,skipped:[],errors:[]},s=e!==void 0?e:await S.readConfig(n).catch(()=>null);if(!s?.projectId)return t.errors.push("no project config"),t;try{let r=await Lt(n);if(t.scanned+=r.length,t.hotFiles=r,r.length>0){let i=Ft(s.projectId);for(let o of r){if(i.has(o.path)){t.skipped.push({reason:"already-marked-this-window",file:o.path});continue}try{await h.remember(n,{type:"learning",content:`Hot file: \`${o.path}\` \u2014 ${o.touches} touches in the last ${N} days. Worth a refactor pass or a deliberate decision about why it churns this often.`,tags:{source:Te,pattern:At,file:o.path,touches:String(o.touches),window_days:String(N)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for ${o.path}: ${c.message}`)}}}}catch(r){t.errors.push(`hot-file detection failed: ${r.message}`)}try{let r=Nt(s.projectId);if(r.length>0){let i=jt(s.projectId);for(let o of r){if(i.has(o.topic)){t.skipped.push({reason:"recurring-bug-already-marked",file:o.topic});continue}try{await h.remember(n,{type:"learning",content:`Recurring bug pattern: gotchas tagged \`topic:${o.topic}\` reported ${o.occurrences} times in the last ${$} days. Likely a real underlying issue \u2014 consider a focused investigation before patching the next instance.`,tags:{source:Re,pattern:It,topic:o.topic,occurrences:String(o.occurrences),window_days:String($)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for recurring ${o.topic}: ${c.message}`)}}}}catch(r){t.errors.push(`recurring-bug detection failed: ${r.message}`)}try{let r=await $t(n);if(r.totalCount>0){let i=Ht(s.projectId),o=r.totalCount-i;if(i>0&&o>=Mt)try{await h.remember(n,{type:"learning",content:`Tech debt growing: TODO/FIXME/XXX count rose by ${o} (now ${r.totalCount}, was ${i}). Consider a focused debt-reduction pass before adding more features.`,tags:{source:Ee,pattern:Ct,total:String(r.totalCount),previous:String(i),delta:String(o)},provenance:"inferred"}),t.persisted+=1}catch(c){t.errors.push(`remember failed for tech-debt: ${c.message}`)}}}catch(r){t.errors.push(`tech-debt detection failed: ${r.message}`)}return t}a(_e,"detectAndPersistPatterns");async function Lt(n){let e=await I(["log",`--since=${N}.days.ago`,"--name-only","--pretty=format:","-z"],{cwd:n,maxBuffer:16777216,timeoutMs:15e3});if(!e.ok){if(e.kind==="exit")return[];C(e)}let t=new Map;for(let r of e.stdout.split("\0")){let i=r.trim();i&&(Ot(i)||t.set(i,(t.get(i)??0)+1))}let s=[];for(let[r,i]of t)i<xt||s.push({path:r,touches:i});return s.sort((r,i)=>i.touches-r.touches),s}a(Lt,"detectHotFiles");function Ot(n){let e=_t.basename(n);for(let t of Dt)if(t.test(n)||t.test(e))return!0;return!1}a(Ot,"isIgnored");function Nt(n){let e=new Date(Date.now()-$*24*60*60*1e3).toISOString(),t=b(n,"SELECT data, timestamp FROM events WHERE type = 'memory.remember.gotcha' AND timestamp >= ? ORDER BY id DESC LIMIT 500",[e],i=>{if(i.source==="transcript-auto")return;let o=typeof i.topic=="string"?i.topic:void 0,c=typeof i.area=="string"?i.area:void 0;return(o??c)||void 0}),s=new Map;for(let i of t)s.set(i,(s.get(i)??0)+1);let r=[];for(let[i,o]of s)o<Pt||r.push({topic:i,occurrences:o});return r.sort((i,o)=>o.occurrences-i.occurrences),r}a(Nt,"detectRecurringBugs");async function $t(n){let e=await I(["grep","-cE","\\b(TODO|FIXME|XXX)\\b"],{cwd:n,maxBuffer:16777216});if(!e.ok){if(M(e,1))return{totalCount:0};C(e)}return{totalCount:e.stdout.split(`
|
|
12
|
-
`).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}a($t,"measureTechDebt");function Ht(n){return b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],t=>{if(t.source!==Ee)return;let s=typeof t.total=="string"?Number.parseInt(t.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(Ht,"collectPreviousDebtSnapshot");function Ft(n){let e=Date.now()-N*24*60*60*1e3,t=b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Te)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(Ft,"collectAlreadyMarkedHotFiles");function jt(n){let e=Date.now()-$*24*60*60*1e3,t=b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Re)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(jt,"collectAlreadyMarkedRecurringBugs");import R from"node:fs/promises";import K from"node:path";rt();st();G();var Ut={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Bt(n=process.env){let e=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Ut[e==="conservative"||e==="standard"||e==="aggressive"?e:"standard"]}a(Bt,"resolveProfile");async function Gt(n,e){let t=Date.now()-e*24*60*60*1e3,r=h.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<t);if(r.length===0)return 0;let i=[];for(let o of r)try{J.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${e}d)`});let c=o.id.startsWith("mem_")?o.id.slice(4):null;c&&v.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(c)),v.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}a(Gt,"archiveAgedInbox");async function Jt(n,e){if(e===null)return 0;let t=K.join(ee.getGlobalProjectPath(n),"checkpoints"),s=await R.readdir(t).catch(()=>null);if(!s)return 0;let r=Date.now()-e*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let c=K.join(t,o);try{(await R.stat(c)).mtimeMs<r&&(await R.unlink(c),i.push(c))}catch{}}return i.length}a(Jt,"pruneOldCheckpoints");async function Wt(){let{getVerifyCachePath:n}=await import("./context7-service-
|
|
12
|
+
`).reduce((s,r)=>{let i=r.lastIndexOf(":");if(i<=0)return s;let o=Number.parseInt(r.slice(i+1),10);return Number.isFinite(o)?s+o:s},0)}}a($t,"measureTechDebt");function Ht(n){return b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 50",[],t=>{if(t.source!==Ee)return;let s=typeof t.total=="string"?Number.parseInt(t.total,10):0;return Number.isFinite(s)?s:void 0})[0]??0}a(Ht,"collectPreviousDebtSnapshot");function Ft(n){let e=Date.now()-N*24*60*60*1e3,t=b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Te)return;let i=s.file,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(Ft,"collectAlreadyMarkedHotFiles");function jt(n){let e=Date.now()-$*24*60*60*1e3,t=b(n,"SELECT data FROM events WHERE type = 'memory.remember.learning' ORDER BY id DESC LIMIT 200",[],(s,r)=>{if(s.source!==Re)return;let i=s.topic,o=r.rememberedAt;if(typeof i=="string"){if(typeof o=="string"){let c=Date.parse(o);if(!Number.isNaN(c)&&c<e)return}return i}});return new Set(t)}a(jt,"collectAlreadyMarkedRecurringBugs");import R from"node:fs/promises";import K from"node:path";rt();st();G();var Ut={conservative:{inboxDays:30,archivesDays:180,checkpointsDays:null},standard:{inboxDays:14,archivesDays:90,checkpointsDays:30},aggressive:{inboxDays:7,archivesDays:30,checkpointsDays:14}};function Bt(n=process.env){let e=(n.PRJCT_CLEANUP_AGGRESSIVENESS??"standard").toLowerCase();return Ut[e==="conservative"||e==="standard"||e==="aggressive"?e:"standard"]}a(Bt,"resolveProfile");async function Gt(n,e){let t=Date.now()-e*24*60*60*1e3,r=h.recall(n,{types:["inbox"],limit:200}).filter(o=>Date.parse(o.rememberedAt)<t);if(r.length===0)return 0;let i=[];for(let o of r)try{J.archive(n,{entityType:"memory_entry",entityId:o.id,entityData:{type:o.type,content:o.content,tags:o.tags,rememberedAt:o.rememberedAt},summary:o.content.slice(0,80),reason:`inbox-age-out (>${e}d)`});let c=o.id.startsWith("mem_")?o.id.slice(4):null;c&&v.run(n,"UPDATE events SET type = ? WHERE id = ?","memory.archived.inbox",Number(c)),v.run(n,"UPDATE memory_entries SET deleted_at = ? WHERE id = ?",Date.now(),o.id),i.push(o.id)}catch{}return i.length}a(Gt,"archiveAgedInbox");async function Jt(n,e){if(e===null)return 0;let t=K.join(ee.getGlobalProjectPath(n),"checkpoints"),s=await R.readdir(t).catch(()=>null);if(!s)return 0;let r=Date.now()-e*24*60*60*1e3,i=[];for(let o of s){if(!o.endsWith(".json"))continue;let c=K.join(t,o);try{(await R.stat(c)).mtimeMs<r&&(await R.unlink(c),i.push(c))}catch{}}return i.length}a(Jt,"pruneOldCheckpoints");async function Wt(){let{getVerifyCachePath:n}=await import("./context7-service-7VFXEQVN.mjs"),e=n();try{let t=await R.stat(e);if((Date.now()-t.mtimeMs)/(1440*60*1e3)>7)return await R.unlink(e),!0}catch{}return!1}a(Wt,"rotateContext7Cache");var Xt=1440*60*1e3,Kt=["prompt-state-","prompt-git-","prompt-afteremit-","prompt-scc-","stop-heavy-","kimi-session-"];async function zt(){let n=P.runDir(),e=await R.readdir(n).catch(()=>null);if(!e)return 0;let t=Date.now()-Xt,s=[];for(let r of e){if(!Kt.some(o=>r.startsWith(o)))continue;let i=K.join(n,r);try{(await R.stat(i)).mtimeMs<t&&(await R.unlink(i),s.push(i))}catch{}}return s.length}a(zt,"sweepRunDirStamps");async function Ae(n){let e=Bt(),t={inboxArchived:0,archivesPruned:0,checkpointsRemoved:0,context7CacheRotated:!1,stampsRemoved:0};try{t.inboxArchived=await Gt(n,e.inboxDays)}catch{}try{t.archivesPruned=J.pruneOldArchives(n,e.archivesDays)}catch{}try{t.checkpointsRemoved=await Jt(n,e.checkpointsDays)}catch{}try{t.context7CacheRotated=await Wt()}catch{}try{t.stampsRemoved=await zt()}catch{}return t}a(Ae,"runSessionCleanup");async function Ie(n,e){if(e.inboxArchived+e.archivesPruned+e.checkpointsRemoved+e.stampsRemoved+(e.context7CacheRotated?1:0)===0)return;let r=`Session cleanup: ${[e.inboxArchived>0?`${e.inboxArchived} inbox archived`:null,e.archivesPruned>0?`${e.archivesPruned} archives pruned`:null,e.checkpointsRemoved>0?`${e.checkpointsRemoved} checkpoints removed`:null,e.stampsRemoved>0?`${e.stampsRemoved} stale hook stamps removed`:null,e.context7CacheRotated?"context7 cache rotated":null].filter(i=>!!i).join(", ")}`;v.appendEvent(n,"memory.remember.system-event",{content:r,tags:{source:"session-cleanup",key:"last-cleanup"},provenance:"extracted",content_hash:te(r),project_id:n})}a(Ie,"recordCleanupReport");import Yt from"node:crypto";import qt from"node:fs/promises";import{z as w}from"zod";et();G();var xe="crew-run:",Ce=w.object({id:w.string().min(1),spec_id:w.string().nullable().default(null),task_id:w.string().nullable().default(null),started_at:w.string().min(1),ended_at:w.string().min(1),implementer_summary:w.string().default(""),files_touched:w.array(w.string()).default([]),reviewer_verdict:w.enum(["APPROVED","CHANGES_REQUESTED"]),reviewer_notes:w.string().nullable().default(null)});function H(n){return`${xe}${n}`}a(H,"keyFor");var z=class{static{a(this,"CrewRunStorage")}record(e,t){let s=t.runId??ne(),r=v.getDoc(e,H(s));if(r)return r;let i=Q(),o=Ce.parse({id:s,spec_id:t.specId??null,task_id:t.taskId??null,started_at:t.startedAt??i,ended_at:t.endedAt??i,implementer_summary:t.implementerSummary,files_touched:t.filesTouched,reviewer_verdict:t.reviewerVerdict,reviewer_notes:t.reviewerNotes??null});return v.setDoc(e,H(s),o),o}get(e,t){return v.getDoc(e,H(t))}list(e){return v.listDocsByPrefix(e,xe).map(s=>Ce.parse(s.data))}delete(e,t){v.deleteDoc(e,H(t))}},Pe=new z;var Oe="skill-miss-detector",Me=3,Vt=280,Qt=["decision","gotcha","anti-pattern"],Zt=5400*1e3,en=360*60*1e3,tn=2,Ne=5,nn=8,$e=new Set(["should","because","project","prjct","instead","always","never","using","value","state","change","changes","update","updated","function","return","returns","error","errors","tests","testing","config","default","import","export","before","after","without"]);async function He(n,e,t,s={}){let r=s.preloadedLines?s.preloadedLines:await qt.readFile(e,"utf-8").then(sn).catch(()=>null);if(!r)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let i=x(n);if(!i)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let o=on(r);if(!o)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let c=(()=>{try{return ln(i,t)}catch{return null}})();if(!c)return{signalsRecorded:0,signalsSkipped:0,failures:[]};if(c.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let l=await se(n).catch(()=>[]),u=(()=>{try{let m=Date.now()-en;return new Set(Pe.list(i).filter(g=>Date.parse(g.ended_at)>m).flatMap(g=>g.files_touched))}catch{return new Set}})(),f=rn(o,l,c,u);if(f.length===0)return{signalsRecorded:0,signalsSkipped:0,failures:[]};let d=pn(i),p=[];for(let m of f.slice(0,Me)){let g=un(m.memId,m.excerpt).slice(0,12);if(d.has(g)){p.push("skipped");continue}try{await h.remember(n,{type:"improvement-signal",content:cn(m),tags:{source:Oe,kind:"skill-miss",category:"skill-miss",...s.runtime?{runtime:s.runtime}:{},...s.model?{model:s.model}:{},relates:m.memId,file:m.evidenceFile,key:g,...t?{session:t}:{}},provenance:"extracted",projectId:i}),D.penalizeSkillMiss(i,m.memId),p.push("recorded")}catch{p.push("skipped")}}let y=p.filter(m=>m==="recorded").length,A=p.filter(m=>m==="skipped").length;return{signalsRecorded:y,signalsSkipped:A,failures:f.slice(0,Me).map(m=>({category:"skill-miss",expectedBehavior:`Apply relevant project rule ${m.memId}.`,observedBehavior:"Relevant project knowledge was not referenced in the session.",relatedRuleId:m.memId}))}}a(He,"detectSkillMisses");function rn(n,e,t,s=new Set){let r=De(n);if(r.size===0)return[];let i=e.filter(l=>!s.has(l)),o=F(i),c=[];for(let l of t){let u=De(`${l.content} ${l.fileTag}`);if(u.size===0)continue;let f=l.fileTag!==""&&i.some(g=>Le(g,l.fileTag))||[...o].some(g=>u.has(g)),d=an(u),p=[...u].filter(g=>!d.has(g)&&r.has(g)).length;if(!(f||p>=tn)||[...d].some(g=>r.has(g)))continue;let m=l.fileTag!==""&&i.some(g=>Le(g,l.fileTag))?l.fileTag:i.find(g=>[...F([g])].some(Ze=>u.has(Ze)))??"";c.push({miss:{memId:l.id,memType:l.type,excerpt:l.content.replace(/\s+/g," ").trim().slice(0,Vt),evidenceFile:m,reason:f?"path-overlap-unused":"topic-overlap-unused"},rank:f?2:1,overlap:p})}return c.sort((l,u)=>u.rank-l.rank||u.overlap-l.overlap),c.map(l=>l.miss)}a(rn,"analyze");function sn(n){return T(n)}a(sn,"parseJsonl");function on(n){let e=[];for(let t of n){let s=t.role??t.message?.role;if(s!=="user"&&s!=="assistant")continue;let r=O(t.content??t.message?.content);r&&e.push(r)}return e.join(`
|
|
13
13
|
`).toLowerCase()}a(on,"transcriptTextOf");function De(n){let e=new Set;for(let t of n.toLowerCase().split(/[^a-z0-9]+/))t.length<Ne||$e.has(t)||e.add(t);return e}a(De,"tokenize");function an(n){let e=[...n].filter(s=>s.length>=nn);if(e.length>0)return new Set(e);let t=[...n].sort((s,r)=>r.length-s.length||s.localeCompare(r))[0]??"";return t?new Set([t]):new Set}a(an,"signatureOf");function F(n){let e=new Set;for(let t of n)for(let s of t.split("/")){let r=s.replace(/\.[a-z0-9]+$/i,"").toLowerCase();r.length>=Ne&&!$e.has(r)&&e.add(r)}return e}a(F,"fileStems");function Le(n,e){let t=F([n]);for(let s of F([e]))if(t.has(s))return!0;return!1}a(Le,"sharesStem");function cn(n){let e=n.evidenceFile!==""?`touched \`${n.evidenceFile}\``:"worked the same area";return[`[skill-miss] Unused project knowledge (${n.memType}, ${n.memId}): "${n.excerpt}"`,`This session ${e} but never referenced it. Apply it, or supersede it via: prjct remember decision "<resolution>" --tags resolves:skill-miss,relates:${n.memId}`].join(`
|
|
14
14
|
`)}a(cn,"formatSkillMiss");function un(n,e){let t=`${n}::${e.toLowerCase().replace(/\s+/g," ").trim()}`;return Yt.createHash("sha256").update(t).digest("hex")}a(un,"hashKey");function ln(n,e){let t=h.recall(n,{types:[...Qt],limit:120}),s=Date.now()-Zt,r=[];for(let i of t)i.provenance!=="inferred"&&(Date.parse(i.rememberedAt)>s||e&&i.tags.session===e||r.push({id:i.id,type:i.type,content:i.content,fileTag:i.tags.file??"",rememberedAt:i.rememberedAt,provenance:i.provenance,session:i.tags.session??""}));return r}a(ln,"recallCandidates");function pn(n){try{let e=h.recall(n,{types:["improvement-signal"],tags:{source:Oe},limit:100,dedupeByKey:!1}),t=new Set;for(let s of e)s.tags.key&&t.add(s.tags.key);return t}catch{return new Set}}a(pn,"existingSkillMissKeys");import dn from"node:crypto";import fn from"node:fs/promises";var Ue="transcript-auto",mn="v2",Be=80,Ge=20,j=1500,gn=12,Fe=4,hn=[{phrase:"decided to",type:"decision"},{phrase:"we chose",type:"decision"},{phrase:"going with",type:"decision"},{phrase:"the right call",type:"decision"},{phrase:"best approach is",type:"decision"},{phrase:"we will use",type:"decision"},{phrase:"shipping with",type:"decision"},{phrase:"turns out that",type:"learning"},{phrase:"now i understand",type:"learning"},{phrase:"the key insight",type:"learning"},{phrase:"i learned that",type:"learning"},{phrase:"discovered that",type:"learning"},{phrase:"root cause is",type:"learning"},{phrase:"root cause was",type:"learning"},{phrase:"the fix is",type:"learning"},{phrase:"gotcha:",type:"gotcha"},{phrase:"bug:",type:"gotcha"},{phrase:"fails when",type:"gotcha"},{phrase:"breaks when",type:"gotcha"},{phrase:"be careful",type:"gotcha"},{phrase:"never do this",type:"gotcha"},{phrase:"trap:",type:"gotcha"},{phrase:"important:",type:"fact"},{phrase:"always use",type:"fact"},{phrase:"never write",type:"fact"},{phrase:"the pattern is",type:"pattern"},{phrase:"anti-pattern:",type:"anti-pattern"},{phrase:"antipattern:",type:"anti-pattern"}],Je=[{re:/^(?:[-*•]\s+)?(?:\*\*)?decision(?:\*\*)?\s*[:—-]\s+/i,type:"decision",phrase:"label:decision"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(learning|insight)(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:learning"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(gotcha|trap|warning)(?:\*\*)?\s*[:—-]\s+/i,type:"gotcha",phrase:"label:gotcha"},{re:/^(?:[-*•]\s+)?(?:\*\*)?(fact|note)(?:\*\*)?\s*[:—-]\s+/i,type:"fact",phrase:"label:fact"},{re:/^(?:[-*•]\s+)?(?:\*\*)?root\s*cause(?:\*\*)?\s*[:—-]\s+/i,type:"learning",phrase:"label:root-cause"},{re:/^(?:[-*•]\s+)?(?:\*\*)?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"pattern",phrase:"label:pattern"},{re:/^(?:[-*•]\s+)?(?:\*\*)?anti[- ]?pattern(?:\*\*)?\s*[:—-]\s+/i,type:"anti-pattern",phrase:"label:anti-pattern"}];async function We(n,e,t,s={}){let r={scanned:0,ingested:0,skipped:[],errors:[]},i=s.preloadedConfig!==void 0?s.preloadedConfig:await S.readConfig(n).catch(()=>null);if(!i?.projectId)return r.errors.push("no project config"),r;let o=await(async()=>{if(s.preloadedLines)return s.preloadedLines;try{return T(await fn.readFile(e,"utf-8"))}catch(p){return r.errors.push(`transcript read failed: ${p.message}`),null}})();if(o===null)return r;let c=yn(o),l=wn(o);if(r.scanned=c.length+l.length,c.length===0&&l.length===0)return r;let u=[...Sn(c),...bn(l)];if(u.length===0)return r;let f=Rn(i.projectId),d=t?t.slice(0,12):"unknown";for(let p of u){if(f.has(p.hash)){r.skipped.push({reason:"duplicate",phrase:p.matchedPhrase});continue}try{await h.remember(n,{type:p.type,content:p.content,tags:{source:Ue,capture:mn,session:d,hash:p.hash,phrase:p.matchedPhrase},provenance:"inferred",projectId:i.projectId}),r.ingested+=1}catch(y){r.errors.push(`remember failed: ${y.message}`)}}return r}a(We,"ingestTranscript");function yn(n){let e=[];for(let t of n){let s=Xe(t);if(s!=="assistant")continue;let r=Ke(t);!r||r.length<Be||e.push({role:s,text:r})}return e}a(yn,"projectMessages");function wn(n){let e=[];for(let t of n){let s=Xe(t);if(s!=="user")continue;let r=Ke(t);!r||r.length<Ge||e.push({role:s,text:r})}return e}a(wn,"projectUserMessages");var vn=[{re:/^(?:please\s+)?always\b/i,phrase:"user:always"},{re:/^(?:please\s+)?never\b/i,phrase:"user:never"},{re:/\bi (?:always|never|prefer)\b/i,phrase:"user:i-prefer"},{re:/^(?:rule|preference)\s*[:—-]/i,phrase:"user:rule"},{re:/\bno more\s+(?:features?|feature\s+creep)\b/i,phrase:"user:no-more-features"},{re:/\bdon'?t add (?:more )?(?:features?|surface)\b/i,phrase:"user:dont-add-features"}];function bn(n){let e=[],t=new Set;for(let s of n){if(e.length>=Fe)break;let r=s.text.split(/\n/).map(o=>o.replace(/^[-*•]\s+/,"").trim()).filter(o=>o.length>=Ge),i=r.length>0?r:[s.text.trim()];for(let o of i){if(e.length>=Fe)break;let c=vn.find(f=>f.re.test(o));if(!c)continue;let l=o.length>j?`${o.slice(0,j)}\u2026`:o,u=ze(l);t.has(u)||(t.add(u),e.push({type:"feedback",content:l,hash:u,matchedPhrase:c.phrase}))}}return e}a(bn,"extractUserPreferenceCandidates");function Xe(n){let e=n.role;if(typeof e=="string")return je(e);let t=n.message;if(t&&typeof t=="object"&&"role"in t){let r=t.role;if(typeof r=="string")return je(r)}let s=n.type;return s==="assistant"||s==="user"||s==="system"?s:null}a(Xe,"inferRole");function je(n){let e=n.toLowerCase();return e==="assistant"||e==="user"||e==="system"?e:null}a(je,"normalizeRole");function Ke(n){let e=n.content===void 0&&n.message&&typeof n.message=="object"?n.message.content:n.content;if(typeof e=="string")return e.trim();if(Array.isArray(e)){let t=[];for(let s of e){if(!s||typeof s!="object")continue;let r=s;r.type==="text"&&typeof r.text=="string"&&t.push(r.text)}return t.join(`
|
|
15
15
|
`).trim()}return""}a(Ke,"extractText");function kn(n){let e=n.trim();if(e.length<Be)return null;for(let r of Je)if(r.re.test(e))return{type:r.type,matchedPhrase:r.phrase};let t=e.toLowerCase(),s=hn.find(r=>t.includes(r.phrase));return s?{type:s.type,matchedPhrase:s.phrase}:null}a(kn,"classifyCaptureParagraph");function Sn(n){let e=[],t=new Set;for(let s of n){let r=Tn(s.text);for(let i of r){if(e.length>=gn)return e;let o=kn(i);if(!o)continue;let c=i.length>j?`${i.slice(0,j)}\u2026`:i,l=ze(c);t.has(l)||(t.add(l),e.push({type:o.type,content:c,hash:l,matchedPhrase:o.matchedPhrase}))}}return e}a(Sn,"extractCandidates");function Tn(n){let e=n.split(/\n\s*\n/).map(s=>s.trim()).filter(Boolean),t=[];for(let s of e){let r=s.split(`
|
|
16
|
-
`).map(o=>o.trim()).filter(Boolean);if(r.some(o=>Je.some(c=>c.re.test(o)))&&r.length>1)for(let o of r)t.push(o);else t.push(s)}return t}a(Tn,"splitParagraphs");function ze(n){return dn.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}a(ze,"hashContent");function Rn(n){try{let{REMEMBER_EVENT_RANGE:e}=(at(),q(ot)),t=b(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...e],s=>{if(s.source!==Ue)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(t)}catch{return new Set}}a(Rn,"collectExistingAutoHashes");nt();tt();import En from"node:fs/promises";import Ye from"node:path";function _n(){return process.env.PRJCT_TEST_MODE==="1"?Ye.join(B(".prjct-tests"),"kimi-code","sessions"):B(".kimi-code","sessions")}a(_n,"getKimiSessionsRoot");async function qe(n,e=_n()){let t=n.replace(/[^a-zA-Z0-9_-]/g,"");if(!t)return;let s=t.startsWith("session_")?[t]:[t,`session_${t}`],r=await En.readdir(e,{withFileTypes:!0}).catch(()=>[]);for(let i of r)if(i.isDirectory())for(let o of s){let c=Ye.join(e,i.name,o,"agents","main","wire.jsonl");if(await Z(c))return c}}a(qe,"resolveKimiTranscriptPath");var U=600*1e3,_=new Map;function An(n){let e=n.replace(/[^a-zA-Z0-9._-]/g,"_");return Ve.join(P.runDir(),`stop-heavy-${e}.stamp`)}a(An,"heavyStepStampPath");async function Qe(n,e,t=!0){if(await k.stat(n).then(i=>e-i.mtimeMs<U).catch(()=>!1))return!1;let r=`${n}.lock`;try{await k.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await k.stat(r).then(c=>e-c.mtimeMs>=U).catch(()=>!1)||!t?!1:(await k.rmdir(r).catch(()=>{}),Qe(n,e,!1))}try{return await k.stat(n).then(o=>e-o.mtimeMs<U).catch(()=>!1)?!1:(await k.writeFile(n,String(e)),!0)}finally{await k.rmdir(r).catch(()=>{})}}a(Qe,"claimHeavyStep");async function In(n){let e=Date.now(),t=_.get(n)??0;if(e-t<U)return!1;try{let s=An(n);await k.mkdir(Ve.dirname(s),{recursive:!0});let r=await Qe(s,e);return _.size>32&&_.clear(),_.set(n,e),r}catch{}return _.size>32&&_.clear(),_.set(n,e),!0}a(In,"heavyStepsDue");function ls(n=process.cwd(),e){return ce({event:"Stop",projectPath:n,afterEmit:a(async(t,s,r)=>{let i=await S.readConfig(s).catch(()=>null);if(!i?.projectId)return;let o=we({hookHost:r}),c=t.transcript_path??(r==="kimi"&&t.session_id?await qe(t.session_id).catch(()=>{}):void 0),l=await In(i.projectId),u={};if(l&&c){let d=await k.readFile(c,"utf-8").catch(()=>null);d!==null&&(u.transcriptLines=T(d))}let f=ue(u.transcriptLines??[]);if(l)try{let{collectActiveTasks:d}=await import("./task-overview-P3VRH2FD.mjs"),p=await d(i.projectId,s);u.activeTaskId=p.current?.id,u.activeTaskDescription=p.current?.description,u.activeTaskStartedAt=p.current?.startedAt}catch{}if(u.transcriptLines&&u.transcriptLines.length>0)try{if(u.transcriptUsage=X(u.transcriptLines),u.transcriptUsage.tokensIn+u.transcriptUsage.tokensOut>0){let d=u.activeTaskStartedAt?{sinceIso:u.activeTaskStartedAt}:void 0,p=X(u.transcriptLines,d);if(u.activeTaskId&&p.tokensIn+p.tokensOut>0){W(i.projectId,u.activeTaskId,p.tokensIn,p.tokensOut,{description:u.activeTaskDescription,agent:o,source:`${o}-transcript`});try{let{sumTranscriptUsageByModel:y}=await import("./transcript-jsonl-7W2NOJPZ.mjs");for(let[A,m]of y(u.transcriptLines,d))m.tokensIn+m.tokensOut<=0||W(i.projectId,u.activeTaskId,m.tokensIn,m.tokensOut,{model:A,agent:o,source:`${o}-transcript:${A}`})}catch{}}}}catch{}if(ae({projectId:i.projectId,sessionId:t.session_id,directory:s,taskId:u.activeTaskId,goal:u.activeTaskDescription,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,agent:o,model:f}),l&&c)try{await We(s,c,t.session_id??null,{preloadedConfig:i,preloadedLines:u.transcriptLines})}catch{}if(l){try{await _e(s,i)}catch{}try{await Se(s,i)}catch{}try{let d=await Ae(i.projectId);await Ie(i.projectId,d),L.pruneRetained(i.projectId)}catch{}}if(l&&c)try{let d=await ge(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"friction-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}d.signalsRecorded>0&&u.activeTaskId&&D.penalizeSurfaced(i.projectId,u.activeTaskId)}catch{}if(l&&c)try{let d=await He(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"skill-miss-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}}catch{}if(l)try{await re.backfill(i.projectId,i,new Date().toISOString())}catch{}if(l&&u.activeTaskId){let d={projectId:i.projectId,projectPath:s,cycleDescription:u.activeTaskDescription??null,cycleId:u.activeTaskId,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,model:f},p=a(async y=>{try{await y()}catch{}},"runBestEffort");await p(async()=>{let{synthesizeLandHandoff:y}=await import("./land-synthesis-
|
|
16
|
+
`).map(o=>o.trim()).filter(Boolean);if(r.some(o=>Je.some(c=>c.re.test(o)))&&r.length>1)for(let o of r)t.push(o);else t.push(s)}return t}a(Tn,"splitParagraphs");function ze(n){return dn.createHash("sha256").update(n.toLowerCase().trim()).digest("hex").slice(0,16)}a(ze,"hashContent");function Rn(n){try{let{REMEMBER_EVENT_RANGE:e}=(at(),q(ot)),t=b(n,"SELECT data FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT 500",[...e],s=>{if(s.source!==Ue)return;let r=s.hash;return typeof r=="string"?r:void 0});return new Set(t)}catch{return new Set}}a(Rn,"collectExistingAutoHashes");nt();tt();import En from"node:fs/promises";import Ye from"node:path";function _n(){return process.env.PRJCT_TEST_MODE==="1"?Ye.join(B(".prjct-tests"),"kimi-code","sessions"):B(".kimi-code","sessions")}a(_n,"getKimiSessionsRoot");async function qe(n,e=_n()){let t=n.replace(/[^a-zA-Z0-9_-]/g,"");if(!t)return;let s=t.startsWith("session_")?[t]:[t,`session_${t}`],r=await En.readdir(e,{withFileTypes:!0}).catch(()=>[]);for(let i of r)if(i.isDirectory())for(let o of s){let c=Ye.join(e,i.name,o,"agents","main","wire.jsonl");if(await Z(c))return c}}a(qe,"resolveKimiTranscriptPath");var U=600*1e3,_=new Map;function An(n){let e=n.replace(/[^a-zA-Z0-9._-]/g,"_");return Ve.join(P.runDir(),`stop-heavy-${e}.stamp`)}a(An,"heavyStepStampPath");async function Qe(n,e,t=!0){if(await k.stat(n).then(i=>e-i.mtimeMs<U).catch(()=>!1))return!1;let r=`${n}.lock`;try{await k.mkdir(r)}catch(i){if(i.code!=="EEXIST")throw i;return!await k.stat(r).then(c=>e-c.mtimeMs>=U).catch(()=>!1)||!t?!1:(await k.rmdir(r).catch(()=>{}),Qe(n,e,!1))}try{return await k.stat(n).then(o=>e-o.mtimeMs<U).catch(()=>!1)?!1:(await k.writeFile(n,String(e)),!0)}finally{await k.rmdir(r).catch(()=>{})}}a(Qe,"claimHeavyStep");async function In(n){let e=Date.now(),t=_.get(n)??0;if(e-t<U)return!1;try{let s=An(n);await k.mkdir(Ve.dirname(s),{recursive:!0});let r=await Qe(s,e);return _.size>32&&_.clear(),_.set(n,e),r}catch{}return _.size>32&&_.clear(),_.set(n,e),!0}a(In,"heavyStepsDue");function ls(n=process.cwd(),e){return ce({event:"Stop",projectPath:n,afterEmit:a(async(t,s,r)=>{let i=await S.readConfig(s).catch(()=>null);if(!i?.projectId)return;let o=we({hookHost:r}),c=t.transcript_path??(r==="kimi"&&t.session_id?await qe(t.session_id).catch(()=>{}):void 0),l=await In(i.projectId),u={};if(l&&c){let d=await k.readFile(c,"utf-8").catch(()=>null);d!==null&&(u.transcriptLines=T(d))}let f=ue(u.transcriptLines??[]);if(l)try{let{collectActiveTasks:d}=await import("./task-overview-P3VRH2FD.mjs"),p=await d(i.projectId,s);u.activeTaskId=p.current?.id,u.activeTaskDescription=p.current?.description,u.activeTaskStartedAt=p.current?.startedAt}catch{}if(u.transcriptLines&&u.transcriptLines.length>0)try{if(u.transcriptUsage=X(u.transcriptLines),u.transcriptUsage.tokensIn+u.transcriptUsage.tokensOut>0){let d=u.activeTaskStartedAt?{sinceIso:u.activeTaskStartedAt}:void 0,p=X(u.transcriptLines,d);if(u.activeTaskId&&p.tokensIn+p.tokensOut>0){W(i.projectId,u.activeTaskId,p.tokensIn,p.tokensOut,{description:u.activeTaskDescription,agent:o,source:`${o}-transcript`});try{let{sumTranscriptUsageByModel:y}=await import("./transcript-jsonl-7W2NOJPZ.mjs");for(let[A,m]of y(u.transcriptLines,d))m.tokensIn+m.tokensOut<=0||W(i.projectId,u.activeTaskId,m.tokensIn,m.tokensOut,{model:A,agent:o,source:`${o}-transcript:${A}`})}catch{}}}}catch{}if(ae({projectId:i.projectId,sessionId:t.session_id,directory:s,taskId:u.activeTaskId,goal:u.activeTaskDescription,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,agent:o,model:f}),l&&c)try{await We(s,c,t.session_id??null,{preloadedConfig:i,preloadedLines:u.transcriptLines})}catch{}if(l){try{await _e(s,i)}catch{}try{await Se(s,i)}catch{}try{let d=await Ae(i.projectId);await Ie(i.projectId,d),L.pruneRetained(i.projectId)}catch{}}if(l&&c)try{let d=await ge(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"friction-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}d.signalsRecorded>0&&u.activeTaskId&&D.penalizeSurfaced(i.projectId,u.activeTaskId)}catch{}if(l&&c)try{let d=await He(s,c,t.session_id??null,{preloadedLines:u.transcriptLines,runtime:o,model:f});for(let p of d.failures)try{L.record(i.projectId,{source:"skill-miss-detector",runtime:o,model:f,sessionId:t.session_id??null,taskId:u.activeTaskId??null,...p})}catch{}}catch{}if(l)try{await re.backfill(i.projectId,i,new Date().toISOString())}catch{}if(l&&u.activeTaskId){let d={projectId:i.projectId,projectPath:s,cycleDescription:u.activeTaskDescription??null,cycleId:u.activeTaskId,tokensIn:u.transcriptUsage?.tokensIn,tokensOut:u.transcriptUsage?.tokensOut,model:f},p=a(async y=>{try{await y()}catch{}},"runBestEffort");await p(async()=>{let{synthesizeLandHandoff:y}=await import("./land-synthesis-5C4KGCTB.mjs");await y(d)}),await p(async()=>{let{synthesizeJudgmentReceipt:y}=await import("./judgment-receipt-G2DKQR7U.mjs");await y(d)})}try{let{flushIfLinked:d}=await import("./auto-flush-7TIEBPPQ.mjs");await d(s,i)}catch{}},"afterEmit")},e)}a(ls,"runStopHook");export{An as heavyStepStampPath,In as heavyStepsDue,ls as runStopHook};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as a}from"./chunk-
|
|
8
|
+
import{b as a}from"./chunk-ULNGKZB6.mjs";import"./chunk-NJ74RHNC.mjs";import{a as i}from"./chunk-WUOVBBPC.mjs";import"./chunk-HRU2KNEB.mjs";import"./chunk-LCGWETJ6.mjs";import"./chunk-7H5UVM6X.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-TF6PN7IB.mjs";import"./chunk-6EHYPQ5U.mjs";import"./chunk-GAJOSSB4.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JGZ3QGWX.mjs";import"./chunk-QXCEBAIA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as n}from"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import{d as e,g as m}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();function l(c=process.cwd(),p){return i({event:"SubagentStart",projectPath:c,build:o((u,t)=>a(t),"build"),afterEmit:o(async(u,t)=>{try{let r=await n.readConfig(t);if(!r?.projectId)return;let{collectActiveTasks:s}=await import("./task-overview-P3VRH2FD.mjs"),d=await s(r.projectId,t);e.appendEvent(r.projectId,"subagent.spawned",{taskId:d.current?.id??null})}catch{}},"afterEmit")},p)}o(l,"runSubagentStartHook");export{l as runSubagentStartHook};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f,b as p}from"./chunk-OWOPA2O7.mjs";import{a as s}from"./chunk-WUOVBBPC.mjs";import{a}from"./chunk-AFGXKRRP.mjs";import{a as c}from"./chunk-V6GGH6H5.mjs";import"./chunk-XSJ7SPVR.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-6NMHVPAI.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-JGZ3QGWX.mjs";import"./chunk-GAOQHD5S.mjs";import{b as r}from"./chunk-
|
|
8
|
+
import{a as f,b as p}from"./chunk-OWOPA2O7.mjs";import{a as s}from"./chunk-WUOVBBPC.mjs";import{a}from"./chunk-AFGXKRRP.mjs";import{a as c}from"./chunk-V6GGH6H5.mjs";import"./chunk-XSJ7SPVR.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-6NMHVPAI.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-JGZ3QGWX.mjs";import"./chunk-GAOQHD5S.mjs";import{b as r}from"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";function w(u=process.cwd(),g){return s({event:"SubagentStop",projectPath:u,afterEmit:i(async(d,n)=>{let o=await r.readConfig(n).catch(()=>null);if(!o?.projectId||f(o)==="off")return;let e=[];try{let t=await a(o.projectId,n);t.current&&e.push(`active: ${t.current.description}`)}catch{}try{let t=await c.getActiveTasks(o.projectId);t.length>0&&e.push(`pending: ${t.length}`)}catch{}await p("prjct \u2014 subagent finished",e.join(" \xB7 ")||"A subagent finished")},"afterEmit")},g)}i(w,"runSubagentStopHook");export{w as runSubagentStopHook};
|
package/dist/bin/hook-chunks/{surface-attribution-UNK4J5W2.mjs → surface-attribution-BYESPLXM.mjs}
RENAMED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a}from"./chunk-
|
|
8
|
+
import{a}from"./chunk-UJIOGFNP.mjs";import"./chunk-TF6PN7IB.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as recordSurfacedForActiveTask};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-
|
|
8
|
+
import{b as a,c as b,d as c,e as d,f as e,g as f,h as g,i as h,j as i}from"./chunk-G4VJKPG7.mjs";import"./chunk-T2KVL6PZ.mjs";import"./chunk-PPWPUEBH.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-UK24P7PV.mjs";import"./chunk-XSJ7SPVR.mjs";import"./chunk-Y7MZA2G4.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-T7DRHVK3.mjs";import"./chunk-NCLONKOT.mjs";import"./chunk-22GFTUER.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-BKJHD5JI.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZJW27EUC.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-6EHYPQ5U.mjs";import"./chunk-GAJOSSB4.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-6NMHVPAI.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{e as TASK_CONTEXT_PROMPT,h as completeActiveTask,a as formatRelatedContextForAgent,b as formatRiskForAgent,i as readLastStatus,d as recallRisksForFiles,g as resolveActiveTask,f as setTaskStatus,c as startTask};
|
|
@@ -5,6 +5,6 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as M,b as l}from"./chunk-
|
|
8
|
+
import{a as M,b as l}from"./chunk-RFKRKUHB.mjs";import{a as d}from"./chunk-FSFURDAE.mjs";import{a as T,d as k}from"./chunk-3JOZN7YJ.mjs";import{a as u}from"./chunk-H4CA3XZ6.mjs";import{a as c}from"./chunk-UK24P7PV.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import{b as h}from"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import{a as D,p as w}from"./chunk-QWQFF2UG.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import{e as f,f as $}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";$();w();var i=["off","assist","strict"],C=class extends k{static{m(this,"TddCommands")}async tdd(s=null,t=process.cwd(),n={}){let e=M(s,i);return e.kind==="status"?this.showStatus(t,n):e.kind==="mode"?this.setMode(e.mode,t,n):e.sub==="check"?this.check(t,n):T(`Unknown tdd subcommand "${e.sub}". Use: check, or ${i.join("|")}.`,n)}async showStatus(s,t){let n=await l(s,t);if(!n.ok)return n.result;let e=n.value,o=y(e),a=(await u(s).catch(()=>null))?.test?.command??null,p=[`Mode: ${o}${o==="off"?" (guidance + ship TDD gate dormant)":""}`,`Test command: ${a??"none detected (add tests to enable the gate)"}`,"Set: prjct tdd off|assist|strict","Check: prjct tdd check \u2014 run the test command now (red/green)"];return t.md?console.log(d("## TDD",`> **Mode**: \`${o}\``,`- Test command: \`${a??"none detected"}\``,p.slice(2).join(`
|
|
9
9
|
`))):c.info(`TDD \u2014 ${p.join(`
|
|
10
10
|
`)}`),{success:!0,mode:o,testCommand:a}}async setMode(s,t,n){let e=await l(t,n);if(!e.ok)return e.result;let o=e.value;o.tdd={mode:s},await h.writeConfig(t,o);let r=s==="off"?"TDD mode off \u2014 test-first guidance and the ship TDD gate are dormant.":s==="assist"?"TDD mode \u2192 assist. Guidance biases test-first (red\u2192green\u2192refactor); `ship` reminds.":"TDD mode \u2192 strict. Test-first expected; `ship` surfaces a hard gate \u2014 run `prjct tdd check` and don't ship on red.";return n.md?console.log(d("## TDD",`> ${r}`)):c.done(r),{success:!0,mode:s}}async check(s,t){let e=(await u(s).catch(()=>null))?.test?.command;if(!e){let o="tdd check: no test command detected for this stack. Add a test script first.";return console.log(t.md?d("## TDD check",`> ${o}`):o),{success:!1,reason:"no_test_command"}}try{await D(e,{cwd:s,maxBuffer:32*1024*1024});let o=`tdd check: GREEN \u2014 \`${e}\` passed.`;return console.log(t.md?d("## TDD check",`> \u2705 ${o}`):o),{success:!0,green:!0,testCommand:e}}catch(o){let r=`tdd check: RED \u2014 \`${e}\` failed. Fix before shipping.`;return t.md?console.log(d("## TDD check",`> \u274C ${r}`,f(o))):(c.fail(r),c.info(f(o))),{success:!1,green:!1,testCommand:e}}}};function y(g){let s=g?.tdd?.mode;if(s&&i.includes(s))return s;let t=process.env.PRJCT_TDD_MODE?.toLowerCase();return t&&i.includes(t)?t:"off"}m(y,"effectiveTddMode");var L={effectiveTddMode:y,TDD_MODES:i};export{C as TddCommands,L as _internal,y as effectiveTddMode};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as a,c as b,d as c,e as d}from"./chunk-
|
|
8
|
+
import{b as a,c as b,d as c,e as d}from"./chunk-XC2BSGWF.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{d as default,b as getTemplateContent,c as listTemplates,a as resetBundle};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{h as a,i as b,j as c,k as d,l as e}from"./chunk-
|
|
8
|
+
import{h as a,i as b,j as c,k as d,l as e}from"./chunk-CJY4Y5SO.mjs";import"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as conflictModeWithWeakModel,a as effectiveWeakModelMode,c as qualityFloorWithWeakModel,d as weakModelBanner,e as weakModelOneLiner};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as a,d as b,e as c,f as d,g as e,h as f}from"./chunk-
|
|
8
|
+
import{c as a,d as b,e as c,f as d,g as e,h as f}from"./chunk-T7DRHVK3.mjs";import"./chunk-BKJHD5JI.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-ZPAY2NSF.mjs";import"./chunk-A3R47SP6.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-RLKYEL3F.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-FTBBQHI4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-OALZUWC6.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as extractFilePathsFromEntries,d as formatWorkScopeBlock,f as isUsefulScopePath,b as resolveWorkScope,a as resolveWorkScopeSync,e as toLikelyFileHits};
|
package/dist/bin/prjct-core.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { dirname as __pathDirname } from 'path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
const __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __pathDirname(__filename);
|
|
7
|
-
import{a as g}from"./core-chunks/chunk-3TRXQAU4.mjs";import{readSync as U}from"node:fs";import{isatty as J}from"node:tty";globalThis.__perfStartNs=process.hrtime.bigint();var R=process.argv.slice(2),d=R.find(t=>!t.startsWith("--")&&!t.startsWith("-"));if(d==="__internal-auto-update"){let t=R[1]??"";try{let{runBackgroundCheck:i}=await import("./core-chunks/auto-updater-PKYQRBGQ.mjs");await i(t)}catch{}process.exit(0)}if(d==="__post-upgrade"){try{let{run:t}=await import("./core-chunks/setup-
|
|
7
|
+
import{a as g}from"./core-chunks/chunk-3TRXQAU4.mjs";import{readSync as U}from"node:fs";import{isatty as J}from"node:tty";globalThis.__perfStartNs=process.hrtime.bigint();var R=process.argv.slice(2),d=R.find(t=>!t.startsWith("--")&&!t.startsWith("-"));if(d==="__internal-auto-update"){let t=R[1]??"";try{let{runBackgroundCheck:i}=await import("./core-chunks/auto-updater-PKYQRBGQ.mjs");await i(t)}catch{}process.exit(0)}if(d==="__post-upgrade"){try{let{run:t}=await import("./core-chunks/setup-V75BWRHU.mjs");await t()}catch{}process.exit(0)}if(d==="__internal-ensure-daemon"){try{if(process.env.PRJCT_NO_DAEMON!=="1"){let{spawnDaemon:t}=await import("./core-chunks/client-D43KKUYH.mjs");await t()}}catch{}process.exit(0)}function q(t){if(J(0))return"";try{process.stdin.fd}catch{}let i=Date.now()+t,u=new Int32Array(new SharedArrayBuffer(4)),n=Buffer.alloc(65536),o=[];for(;;)try{let a=U(0,n,0,n.length,null);if(a===0)break;o.push(Buffer.from(n.subarray(0,a)))}catch(a){if(a.code==="EAGAIN"&&Date.now()<i){Atomics.wait(u,0,0,1);continue}break}return Buffer.concat(o).toString("utf-8")}g(q,"readStdinSync");if(d==="hook"&&process.env.PRJCT_NO_DAEMON!=="1"){let t=await import("node:fs"),{DAEMON_PATHS:i,isDaemonNamedPipe:u}=await import("./core-chunks/protocol-4AJ4J5SI.mjs"),n=i.socket();if(u(n)||t.existsSync(n)){let o=R[1],{consumeHookStdinSpill:a}=await import("./core-chunks/stdin-spill-Y2A6WOOW.mjs"),p=(o?a(process.cwd(),o):null)??q(1e3);try{let{sendRequest:m}=await import("./core-chunks/client-D43KKUYH.mjs"),{HOOK_REQUEST_TIMEOUT_MS:S}=await import("./core-chunks/protocol-4AJ4J5SI.mjs"),s=await import("node:crypto"),e=await m({id:s.randomUUID(),command:"hook",args:o?[o]:[],options:{},cwd:process.cwd(),stdin:p,...process.env.PRJCT_HOOK_HOST?{hookHost:process.env.PRJCT_HOOK_HOST}:{}},{timeoutMs:S});e.retry||(e.stdout&&process.stdout.write(e.stdout),process.exit(e.exitCode??0))}catch{}try{let{getHookRunner:m}=await import("./core-chunks/registry-YM2EYUXY.mjs"),S=m(o);S||(process.stdout.write(`{}
|
|
8
8
|
`),process.exit(0));let s=(()=>{try{return p?JSON.parse(p):{}}catch{return{}}})(),e=[];if(await S(process.cwd(),{input:s,sink:g(r=>{process.stdout.write(r)},"sink"),detachAfterEmit:g(r=>{e.push(r)},"detachAfterEmit")}),e.length>0){let r=process.argv[1];if(r&&o)try{let{spawn:c}=await import("node:child_process"),l=c(process.execPath,[r,"hook",o],{detached:!0,stdio:["pipe","ignore","ignore"],cwd:process.cwd(),env:{...process.env,PRJCT_HOOK_AFTER_EMIT:"1",PRJCT_NO_DAEMON:"1"},shell:!1});l.stdin?.write(p),l.stdin?.end(),l.unref()}catch{for(let c of e)await c().catch(()=>{})}else for(let c of e)await c().catch(()=>{})}process.exit(0)}catch{process.stdout.write(`{}
|
|
9
|
-
`),process.exit(0)}}else try{let o=process.argv[1];if(o){let{spawn:a}=await import("node:child_process");a(process.execPath,[o,"__internal-ensure-daemon"],{detached:!0,stdio:"ignore"}).unref()}}catch{}}var{REGISTERED_VERBS_SET:j,BIN_COMMANDS_SET:B}=await import("./core-chunks/verb-names-QWGYABFH.mjs"),{isRemovedVerb:b}=await import("./core-chunks/removed-verbs-EU3WPRNK.mjs"),I=B;if(d&&d!=="help"&&(j.has(d)||I.has(d))&&(R.includes("--help")||R.includes("-h"))){let{getHelp:t}=await import("./core-chunks/help-
|
|
9
|
+
`),process.exit(0)}}else try{let o=process.argv[1];if(o){let{spawn:a}=await import("node:child_process");a(process.execPath,[o,"__internal-ensure-daemon"],{detached:!0,stdio:"ignore"}).unref()}}catch{}}var{REGISTERED_VERBS_SET:j,BIN_COMMANDS_SET:B}=await import("./core-chunks/verb-names-QWGYABFH.mjs"),{isRemovedVerb:b}=await import("./core-chunks/removed-verbs-EU3WPRNK.mjs"),I=B;if(d&&d!=="help"&&(j.has(d)||I.has(d))&&(R.includes("--help")||R.includes("-h"))){let{getHelp:t}=await import("./core-chunks/help-P7EYELVK.mjs");console.log(t(d)),process.exit(0)}var{command:E,args:y}=await(async()=>{if(!d||I.has(d)||j.has(d)||b(d))return{command:d,args:R};let t=R.filter(n=>!n.startsWith("-")),i=t.join(" "),u=R.filter(n=>n.startsWith("-"));if(t.length===1&&/^[a-z][a-z0-9:-]+$/.test(t[0])&&!b(t[0])){let{findClosestCommand:n}=await import("./core-chunks/closest-command-YYNABM7V.mjs"),o=n(t[0]);process.stderr.write(`prjct: '${t[0]}' is not a known command in this install. `+(o?`Did you mean \`prjct ${o}\`? `:"")+"If you meant a command, upgrade prjct with `prjct upgrade` (or `prjct update` on older installs).\n"),process.exit(1)}return{command:"capture",args:["capture",i,...u]}})(),$=new Set(["update","upgrade","daemon","hook","version","-v","--version"]);if(E&&!$.has(E)&&process.stderr.isTTY&&!y.includes("--md")&&!y.includes("--json")&&!y.includes("--quiet")&&!y.includes("-q")&&process.env.PRJCT_NO_UPDATE_NOTICE!=="1"){let{triggerBackgroundRefreshIfStale:t,getUpdateNotificationSync:i}=await import("./core-chunks/update-checker-LZCUPWQB.mjs"),u=await import("node:fs"),n=await import("node:path"),o=(()=>{try{let a=n.resolve(n.dirname(new URL(import.meta.url).pathname),"..","package.json");return JSON.parse(u.readFileSync(a,"utf-8")).version??""}catch{return""}})();try{t()}catch{}o&&process.on("exit",()=>{try{let a=i(o);a&&process.stderr.write(a)}catch{}})}if(E&&!I.has(E)&&process.env.PRJCT_NO_DAEMON!=="1"){let t=await import("node:fs"),{DAEMON_PATHS:i,isDaemonNamedPipe:u}=await import("./core-chunks/protocol-4AJ4J5SI.mjs"),n=i.socket();if(u(n)||t.existsSync(n)){let{sendRequest:o}=await import("./core-chunks/client-D43KKUYH.mjs"),a=await import("node:crypto"),p=g((s=0,e=[],r={})=>{if(s>=y.length)return{commandArgs:e,commandOptions:r};let c=y[s];if(c.startsWith("--")){let l=c.slice(2);if(l.includes("=")){let C=l.indexOf("=");return p(s+1,e,{...r,[l.slice(0,C)]:l.slice(C+1)})}return s+1<y.length&&!y[s+1].startsWith("--")?p(s+2,e,{...r,[l]:y[s+1]}):p(s+1,e,{...r,[l]:!0})}return c.startsWith("-")&&c.length===2?p(s+1,e,{...r,[c.slice(1)]:!0}):p(s+1,s>0?[...e,c]:e,r)},"parseFastArgs"),{commandArgs:m,commandOptions:S}=p();try{let{commandRequestTimeoutMs:s}=await import("./core-chunks/protocol-4AJ4J5SI.mjs"),e=await o({id:a.randomUUID(),command:E,args:m,options:S,cwd:process.cwd(),perfStartNs:globalThis.__perfStartNs?.toString()},{timeoutMs:s(E)});e.retry||(e.stdout&&console.log(e.stdout),e.stderr&&console.error(e.stderr),process.exit(e.exitCode))}catch(s){let e=s?.message??"",r=s?.code??"";r==="ECONNREFUSED"||r==="ENOENT"||r==="EACCES"||r==="EPERM"||e.includes("ECONNREFUSED")||e.includes("ENOENT")||e.includes("EACCES")||e.includes("EPERM")||(console.error(`prjct: daemon dropped the request (${e}). Retry: \`prjct ${y.join(" ")}\``),process.exit(1))}}}var F=new Set(["daemon","update","upgrade","version","-v","--version","hook"]);if(E&&!F.has(E)&&process.env.PRJCT_NO_SELF_SYNC!=="1")try{let{VERSION:t}=await import("./core-chunks/version-B5DBRVGQ.mjs");if(t){let{isSyncCurrent:i,runSelfHeal:u}=await import("./core-chunks/self-heal-R5FBXEVQ.mjs");i(t)||await u(t)}}catch{}async function V(){let t=await import("node:path"),i=(await import("chalk")).default,{detectAllProviders:u}=await import("./core-chunks/ai-provider-RVXK7D7R.mjs"),n=(await import("./core-chunks/config-manager-QY73WM5U.mjs")).default,o=(await import("./core-chunks/editors-config-ELAQA6RV.mjs")).default,{fileExists:a}=await import("./core-chunks/file-helper-LLQKU6YF.mjs"),{invalidateProviderCache:p}=await import("./core-chunks/provider-cache-IWVTFLGT.mjs"),{VERSION:m}=await import("./core-chunks/version-B5DBRVGQ.mjs");async function S(){let{resolveUserHome:f}=await import("./core-chunks/user-home-BODIAXR4.mjs"),O=f(),h=await u(),{readFile:v}=await import("node:fs/promises"),w=g(async(...P)=>{try{return(await v(t.join(O,...P),"utf-8")).includes("prjct:start")}catch{return!1}},"hasPrjctSection"),_=[];return h.claude.installed&&_.push(await w(".claude","CLAUDE.md")),h.gemini.installed&&_.push(await w(".gemini","GEMINI.md")),_.length===0?!0:_.some(Boolean)}g(S,"checkRoutersInstalled");let s=process.argv.slice(2),e=s.findIndex(f=>f==="--quiet"||f==="-q"),r=e!==-1;if(r){s.splice(e,1);let{setQuietMode:f}=await import("./core-chunks/output-D27IOQXR.mjs");f(!0)}let c=r||s.includes("--md")||s.includes("--json")||!process.stdout.isTTY,l=s.indexOf("--refresh"),C=l!==-1;C&&(s.splice(l,1),await p());async function M(f){let O=Date.now();try{let h=await n.getProjectId(process.cwd());if(h){let{sessionTracker:v}=await import("./core-chunks/session-tracker-RG2FBWMS.mjs");return await v.expireIfStale(h),await v.touch(h),()=>{let w=Date.now()-O;v.trackCommand(h,f,w).catch(()=>{}),import("./core-chunks/performance-tracker-BFBNR3LY.mjs").then(({performanceTracker:_})=>{_.recordTiming(h,"command_duration",w,{command:f}).catch(()=>{}),_.recordMemory(h,{command:f}).catch(()=>{})}).catch(()=>{})}}}catch{}return()=>{}}g(M,"trackSession");let{runBinCommand:A}=await import("./core-chunks/bin-commands-FYID6EYI.mjs");if(!await A(s,{isQuietMode:r,isRefresh:C,trackSession:M})){let{default:f}=await import("./core-chunks/path-manager-E5DCU5LP.mjs"),O=t.join(f.globalConfigDir,"installed-editors.json"),h=await S();if(!new Set(["auth","login","logout","init","eval","analysis-save-llm","llm","agent"]).has(s[0])&&(!await a(O)||!h))console.log(`
|
|
10
10
|
${i.cyan.bold(" Welcome to prjct!")}
|
|
11
11
|
|
|
12
12
|
Run ${i.bold("prjct start")} to configure your AI providers.
|
|
@@ -15,5 +15,5 @@ ${i.cyan.bold(" Welcome to prjct!")}
|
|
|
15
15
|
Claude Code, Gemini CLI, or both.`)}
|
|
16
16
|
`),console.error(`prjct: not configured \u2014 \`${s[0]}\` did not run. Run \`prjct start\` (AI providers) or \`prjct init\` (project) first.`),process.exitCode=1;else{try{let w=await o.getLastVersion();if(w&&w!==m){let _=s[0]==="update",P=g(N=>N.split(".").map(T=>Number.parseInt(T,10)||0),"parts"),D=g((N,T)=>{let x=P(N),H=P(T);return[0,1,2].map(k=>Math.sign((x[k]??0)-(H[k]??0))).find(k=>k!==0)??0},"cmp")(m,w)>0;!_&&D&&!c&&console.log(`
|
|
17
17
|
${i.yellow("\u2139")} prjct updated to v${m} \u2014 finishing setup in the background
|
|
18
|
-
`);try{if(_){let{run:N}=await import("./core-chunks/setup-
|
|
18
|
+
`);try{if(_){let{run:N}=await import("./core-chunks/setup-V75BWRHU.mjs");await N()}else{await o.updateVersion(m).catch(()=>{});let{spawn:N}=await import("node:child_process");N(process.execPath,[process.argv[1],"__post-upgrade"],{detached:!0,stdio:"ignore"}).unref()}}catch{await o.updateVersion(m).catch(()=>{})}}}catch{}s.length>0&&process.env.PRJCT_NO_DAEMON!=="1"&&import("./core-chunks/client-D43KKUYH.mjs").then(({spawnDaemon:w})=>w()).catch(()=>{}),await import("./core-chunks/core-WMEHDCOK.mjs")}}}g(V,"main");V().catch(t=>{process.argv[2]==="hook"&&(process.stdout.write(`{}
|
|
19
19
|
`),process.exit(0)),console.error("Fatal error:",t.message),process.exit(1)});
|
package/dist/bin/prjct-hooks.mjs
CHANGED
|
@@ -5,6 +5,6 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{d as p}from"./hook-chunks/chunk-JGZ3QGWX.mjs";import{a as d}from"./hook-chunks/chunk-QXCEBAIA.mjs";import"./hook-chunks/chunk-GAOQHD5S.mjs";import"./hook-chunks/chunk-WUHGODSQ.mjs";import{a as o}from"./hook-chunks/chunk-E66B27AL.mjs";import{spawn as R}from"node:child_process";var u={"session-start":{load:o(()=>import("./hook-chunks/session-start-
|
|
8
|
+
import{d as p}from"./hook-chunks/chunk-JGZ3QGWX.mjs";import{a as d}from"./hook-chunks/chunk-QXCEBAIA.mjs";import"./hook-chunks/chunk-GAOQHD5S.mjs";import"./hook-chunks/chunk-WUHGODSQ.mjs";import{a as o}from"./hook-chunks/chunk-E66B27AL.mjs";import{spawn as R}from"node:child_process";var u={"session-start":{load:o(()=>import("./hook-chunks/session-start-FKKFMKQ5.mjs"),"load"),exportName:"runSessionStartHook"},prompt:{load:o(()=>import("./hook-chunks/prompt-JIWMP563.mjs"),"load"),exportName:"runPromptHook"},"pre-bash":{load:o(()=>import("./hook-chunks/pre-bash-W5A5CTR3.mjs"),"load"),exportName:"runPreBashHook"},"pre-commit":{load:o(()=>import("./hook-chunks/pre-commit-5Q24RM4S.mjs"),"load"),exportName:"runPreCommitHook"},"pre-secrets":{load:o(()=>import("./hook-chunks/pre-secrets-MWPPZPWK.mjs"),"load"),exportName:"runPreSecretsHook"},"pre-package":{load:o(()=>import("./hook-chunks/pre-package-O4RMVA4T.mjs"),"load"),exportName:"runPrePackageHook"},"pre-edit":{load:o(()=>import("./hook-chunks/pre-edit-YIJ4BCYL.mjs"),"load"),exportName:"runPreEditHook"},"pre-search":{load:o(()=>import("./hook-chunks/pre-search-WYOWC3D6.mjs"),"load"),exportName:"runPreSearchHook"},"post-edit":{load:o(()=>import("./hook-chunks/post-edit-CK2MYQEN.mjs"),"load"),exportName:"runPostEditHook"},stop:{load:o(()=>import("./hook-chunks/stop-MIXT7WXA.mjs"),"load"),exportName:"runStopHook"},"subagent-start":{load:o(()=>import("./hook-chunks/subagent-start-NO3TN65K.mjs"),"load"),exportName:"runSubagentStartHook"},"subagent-stop":{load:o(()=>import("./hook-chunks/subagent-stop-CKWIXX7W.mjs"),"load"),exportName:"runSubagentStopHook"},notification:{load:o(()=>import("./hook-chunks/notification-ACQBRJG3.mjs"),"load"),exportName:"runNotificationHook"},"cwd-changed":{load:o(()=>import("./hook-chunks/cwd-changed-USNJYUH7.mjs"),"load"),exportName:"runCwdChangedHook"}},f=new Map;async function H(t){let n=f.get(t);if(n)return n;let r=u[t];if(!r)return;let i=(await r.load())[r.exportName];if(typeof i=="function")return f.set(t,i),i}o(H,"resolveRunner");var S=Object.fromEntries(Object.keys(u).map(t=>[t,async(n,r)=>{let e=await H(t);if(!e)throw new Error(`Hook runner missing export for '${t}'`);return e(n,r)}]));function m(t){return t&&u[t]?S[t]:void 0}o(m,"getHookRunner");import c from"node:fs";import x from"node:path";var w=3e4;function y(t){return Buffer.from(t,"utf-8").reduce((r,e)=>Math.imul(r^e,16777619)>>>0,2166136261).toString(16).padStart(8,"0")}o(y,"fnv1a32hex");function N(t){return t.toLowerCase().replace(/[^a-z0-9-]/g,"")}o(N,"sanitizeSubcommand");function P(t,n){let r=N(n);return r?x.join(d(),`hook-stdin-${y(t)}-${r}.json`):null}o(P,"hookStdinSpillPath");function l(t,n){let r=P(t,n);if(!r)return null;try{let e=c.statSync(r);if(Date.now()-e.mtimeMs>w)return c.unlinkSync(r),null;let i=c.readFileSync(r,"utf-8");return c.unlinkSync(r),i}catch{return null}}o(l,"consumeHookStdinSpill");var g="PRJCT_HOOK_AFTER_EMIT";function E(t,n){let r=n?l(process.cwd(),n):null;return r!==null?r:p(t).toString("utf-8")}o(E,"readStdinSync");function _(t,n){let r=process.argv[1];if(!r||!t)return!1;try{let e=R(process.execPath,[r,"hook",t],{detached:!0,stdio:["pipe","ignore","ignore"],cwd:process.cwd(),env:{...process.env,[g]:"1",PRJCT_NO_DAEMON:"1"},shell:!1});return e.stdin?.write(n),e.stdin?.end(),e.unref(),!0}catch{return!1}}o(_,"trySpawnAfterEmitWorker");async function O(){let n=process.argv.slice(2)[1],r=process.env[g]==="1";try{let e=m(n);e||(r||process.stdout.write(`{}
|
|
9
9
|
`),process.exit(0));let i=E(1e3,n),k=(()=>{try{return i?JSON.parse(i):{}}catch{return{}}})(),a=[];if(await e(process.cwd(),{afterEmitOnly:r,input:k,sink:o(s=>{r||process.stdout.write(s)},"sink"),detachAfterEmit:o(s=>{a.push(s)},"detachAfterEmit")}),r){for(let s of a)await s().catch(()=>{});process.exit(0)}if(a.length>0&&(process.env.PRJCT_HOOK_BENCH==="1"&&process.exit(0),!_(n,i)))for(let h of a)await h().catch(()=>{});process.exit(0)}catch{r||process.stdout.write(`{}
|
|
10
10
|
`),process.exit(0)}}o(O,"main");O();
|