prjct-cli 3.93.0 → 3.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-UGHAG2SK.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-JIITQ6GY.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-CXWTU3RF.mjs +8 -0
- package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
- package/dist/bin/hook-chunks/capture-gate-PS6QUXLX.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-22AXWLI6.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-3WQBTXUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-4HAKTI36.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-4NTVXJD7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-5H3KJWQS.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-5XA5RL5I.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-6GAFRIUQ.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-76GDLA3Z.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-ABJNOG2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-BDOAQVIF.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BOBFTVAY.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-BU22R6JX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BX7VKYA7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-C4O243NG.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +36 -0
- package/dist/bin/hook-chunks/chunk-DCSKTMDX.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-DVDZA63F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-EWOK4VE7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-FW4MEPTB.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +69 -0
- package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-GCDLPKOH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-GDECEHO5.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-GDESYWTD.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HEDZA6KC.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-I26F7TLM.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IGHY4FGS.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-IWJG7CZX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-J5UQVJUW.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-KHLYWNHT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-KSSRINDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-MHNWIB7B.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-N3L77UNM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-NLKPAJND.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OGIFB3OE.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-OUAVSD47.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PGWFGRX4.mjs +47 -0
- package/dist/bin/hook-chunks/chunk-PO3QDKTE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-PP6DANGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-PTA7DMLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-QBYHZX33.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QL3NYJTW.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-QP5USCDX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-RHKF7EJW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-ROA2AJXY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-RTEEXGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-S5ISOGDB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-S5N2ZZDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-S6L3FECF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-T6ELTQZM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-TXSLON7M.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-U4OON3S7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-UHVYBU7F.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UYQC63MC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-V2FR2NPL.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-WGWE3CSC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-X5W2UYQK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-XXRAQZNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-YDBZO6I3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-Z6KVLCMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-ZFLIVOFX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/chunk-ZOX6OV6X.mjs +12 -0
- package/dist/bin/hook-chunks/client-CRXA774S.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-GTSLO7CD.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-UHSXC3UG.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
- package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-GDJ3QICX.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-FD47DPA3.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-ZUC7OEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-WNSTHDAA.mjs +12 -0
- package/dist/bin/hook-chunks/distill-GOGPFQFK.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-2CACBNS4.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-QF22RIK7.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-J3X3R225.mjs +8 -0
- package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-7A2DXVJA.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-SZWJH6XP.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-JLYUBKHR.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-JXYO62UE.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-CIYDXN2G.mjs +8 -0
- package/dist/bin/hook-chunks/notification-UA7RTVHG.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
- package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-375HH6TB.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-M3RAOZVB.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QRDYPZLZ.mjs +8 -0
- package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-bash-TWWFVNQ7.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-PTFF7JIN.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-325ALZKD.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-GOHVFAFH.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-MYNM5KI4.mjs +8 -0
- package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-RPGATIYJ.mjs +8 -0
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-XKHUAB4H.mjs +8 -0
- package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-6PF7MBAY.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-UEXQDGZE.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
- package/dist/bin/hook-chunks/setup-ZOHG6MGF.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-QVGTOO6U.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-FGDQVYHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-LAXGVLMY.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-XU35ZYNA.mjs +8 -0
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-OUG4PR7S.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-DMPBNBX7.mjs +8 -0
- package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-PIRHMHXL.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-QZL4OSM7.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SKXILJLJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SZLG6LVC.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-5J6BAMCW.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-ZRNKFTFF.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-PGYHFLEL.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/hook-fast-darwin-arm64 +0 -0
- package/dist/bin/hook-fast-darwin-x64 +0 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +737 -736
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/bin/prjct.mjs +1 -1
- package/dist/daemon/entry.mjs +651 -647
- package/dist/mcp/server.mjs +310 -312
- package/package.json +1 -1
- package/dist/bin/hook-chunks/auto-flush-5D4PKOMM.mjs +0 -8
- package/dist/bin/hook-chunks/capture-gate-EOOSAGAP.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A7SGMNOK.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-BNWB77U5.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-DLHSCKBJ.mjs +0 -15
- package/dist/bin/hook-chunks/chunk-DV7KV2O4.mjs +0 -38
- package/dist/bin/hook-chunks/chunk-EHP4DYVQ.mjs +0 -71
- package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-JRKGG2E3.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
- package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-MHRMV4WI.mjs +0 -31
- package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
- package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
- package/dist/bin/hook-chunks/chunk-OB5GRS7T.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-UB53HQMG.mjs +0 -14
- package/dist/bin/hook-chunks/chunk-UBMIPWJR.mjs +0 -19
- package/dist/bin/hook-chunks/chunk-VPPHD762.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-VV7VNUTF.mjs +0 -16
- package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
- package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
- package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
- package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
- package/dist/bin/hook-chunks/cwd-changed-FYNPPO73.mjs +0 -8
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
- package/dist/bin/hook-chunks/distill-W7QGQUDX.mjs +0 -8
- package/dist/bin/hook-chunks/enriched-recall-W7KYRYVR.mjs +0 -8
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
- package/dist/bin/hook-chunks/format-BOWFDUBP.mjs +0 -8
- package/dist/bin/hook-chunks/judgment-receipt-WGTFKID7.mjs +0 -8
- package/dist/bin/hook-chunks/land-cue-WLGSULSO.mjs +0 -9
- package/dist/bin/hook-chunks/land-synthesis-V7UH5QV6.mjs +0 -8
- package/dist/bin/hook-chunks/legacy-crew-sweep-MFE4BDNR.mjs +0 -24
- package/dist/bin/hook-chunks/memory-index-B53F5HAX.mjs +0 -10
- package/dist/bin/hook-chunks/notification-HJLS4L7Y.mjs +0 -8
- package/dist/bin/hook-chunks/post-edit-TT3XOG55.mjs +0 -8
- package/dist/bin/hook-chunks/pre-bash-2KKF4V6G.mjs +0 -11
- package/dist/bin/hook-chunks/pre-commit-UU4SKKWV.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-RTBLZPWH.mjs +0 -11
- package/dist/bin/hook-chunks/pre-package-LQTINBT4.mjs +0 -8
- package/dist/bin/hook-chunks/pre-search-UJU3XZ2K.mjs +0 -9
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
- package/dist/bin/hook-chunks/project-memory-YHQBRX3D.mjs +0 -8
- package/dist/bin/hook-chunks/project-style-evolution-HS6HYI7W.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-AYY7BZFG.mjs +0 -22
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
- package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
- package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as x,g as te}from"./chunk-HDHVBB6Q.mjs";import{a as B,c as Q,d as W,e as $,n as ee}from"./chunk-SVZHJZ5T.mjs";import{a as m}from"./chunk-E66B27AL.mjs";Q();te();ee();import N from"node:fs/promises";import w from"node:path";var D="symbol-graph",ne=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java"]),se=new Set(["if","for","while","switch","catch","function","class","return","typeof","new","throw","await","void","super","this","import","require","console","Math","JSON","Object","Array","Promise","Map","Set","Date","Error","Buffer","process","describe","it","test","expect","beforeEach","afterEach","beforeAll","afterAll"]),re=new Set(["if","for","while","switch","catch","return","await","typeof","new","throw","else","case","from","import","export","class","function","const","let","var","get","set","constructor","async","static","public","private","protected","readonly","abstract","extends","implements","interface","type","enum","default","as","of","in","do","try","finally","yield","with"]);function C(e,s){return e.slice(0,Math.min(s,e.length)).split(`
|
|
9
|
-
`).length}m(C,"lineOf");function oe(e,s,t,n){return`${e}#${s}:${t}@${n}`}m(oe,"symbolId");function U(e,s){return`${e.replace(/\.[^.]+$/,"").replace(/[/\\]/g,".")}.${s}`}m(U,"qnameOf");function I(e){let s=w.extname(e).toLowerCase();return ne.has(s)}m(I,"isSourceFile");function O(e){let s=/\/\/[^\n]*(?:\n|$)|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|"(?:\\[\s\S]|[^"\\])*(?:"|$)|`(?:\\[\s\S]|[^`\\])*(?:`|$)/g;return e.replace(s,t=>t.replace(/[^\n]/g," "))}m(O,"stripNoise");function j(e){return{filePath:e,symbols:[],callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}m(j,"emptyExtract");function H(e){let s=[...new Set(e.map(t=>t.name))];return{calls:e,callNames:s}}m(H,"finalizeCalls");function ie(e,s){let t=[],n=[],a=new Map,i=O(e),r=[{re:/export\s+(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:async\s+)?function\s+(\w+)/g,kind:"function",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1,exported:!0},{re:/(?:^|[\n;])(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_]\w*)\s*=>/g,kind:"function",nameIdx:1},{re:/export\s+(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])(?:abstract\s+)?class\s+(\w+)/g,kind:"class",nameIdx:1},{re:/export\s+interface\s+(\w+)/g,kind:"interface",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])interface\s+(\w+)/g,kind:"interface",nameIdx:1},{re:/export\s+type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])type\s+(\w+)\s*[=<]/g,kind:"type",nameIdx:1},{re:/export\s+enum\s+(\w+)/g,kind:"enum",nameIdx:1,exported:!0},{re:/(?:^|[^\w.])enum\s+(\w+)/g,kind:"enum",nameIdx:1},{re:/export\s+(?:const|let|var)\s+(\w+)\s*[:=]/g,kind:"const",nameIdx:1,exported:!0},{re:/(?:^|\n)[ \t]+(?:(?:public|private|protected|static|async|readonly)\s+)*(\w+)\s*\([^)]{0,200}\)\s*[:{]/g,kind:"method",nameIdx:1}],o=new Set;for(let{re:d,kind:y,nameIdx:h,exported:L}of r){d.lastIndex=0;for(let M of i.matchAll(d)){let S=M[h];if(!S||S.length<2||re.has(S))continue;let b=C(i,M.index),T=`${y}:${S}@${b}`;o.has(T)||(o.add(T),t.push({kind:y,name:S,startLine:b,endLine:null,exported:L===!0}))}}let l=/import\s+(?:type\s+)?(?:\{([^}]+)\}|(\w+)(?:\s*,\s*\{([^}]+)\})?|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let d of e.matchAll(l)){let y=d[5],h=m(L=>{if(L)for(let M of L.split(",")){let S=M.trim().replace(/^type\s+/,"").split(/\s+as\s+/),b=(S[1]??S[0])?.trim();b&&/^[A-Za-z_][\w]*$/.test(b)&&a.set(b,y)}},"bindNamed");h(d[1]),h(d[3]),d[2]&&a.set(d[2],y),d[4]&&a.set(d[4],y)}let c=/(?:const|let|var)\s+(\w+)\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(let d of e.matchAll(c))a.set(d[1],d[2]);let f=/\b([A-Za-z_][\w]*)\s*\(/g,p=400;for(let d of i.matchAll(f)){let y=d[1];if(se.has(y)||y.length<2)continue;let h=C(i,d.index);if(n.push({name:y,line:h}),n.length>=p)break}let g=/\.(?:get|post|put|patch|delete|options|head|all)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let d of e.matchAll(g)){let h=d[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:h,startLine:C(e,d.index),endLine:null,exported:!0})}let E=/@(?:app|router|api|bp)\.(?:get|post|put|patch|delete|options|head|api_route)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let d of e.matchAll(E)){let h=d[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:h,startLine:C(e,d.index),endLine:null,exported:!0})}if(/(?:^|\/)route\.(ts|js|tsx|jsx)$/.test(s.replace(/\\/g,"/"))){let d=/\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/g;for(let y of e.matchAll(d))t.push({kind:"route",name:`${y[1]} ${s.replace(/\\/g,"/")}`,startLine:C(e,y.index),endLine:null,exported:!0})}let u=H(n);return{filePath:s,symbols:t,callNames:u.callNames,calls:u.calls,importBindings:a,resolvedImports:new Map}}m(ie,"extractTsJs");function ae(e,s){let t=[],n=[],a=O(e),i=/^(?:async\s+)?def\s+(\w+)\s*\(/gm,r=/^class\s+(\w+)/gm;for(let c of a.matchAll(i))t.push({kind:"function",name:c[1],startLine:C(a,c.index),endLine:null,exported:!c[1].startsWith("_")});for(let c of a.matchAll(r))t.push({kind:"class",name:c[1],startLine:C(a,c.index),endLine:null,exported:!c[1].startsWith("_")});let o=/\b([A-Za-z_][\w]*)\s*\(/g;for(let c of a.matchAll(o)){let f=c[1];/^(if|for|while|return|print|len|range|str|int|list|dict|set|super|self)$/.test(f)||n.push({name:f,line:C(a,c.index)})}let l=H(n);return{filePath:s,symbols:t,callNames:l.callNames,calls:l.calls,importBindings:new Map,resolvedImports:new Map}}m(ae,"extractPython");function le(e,s){let t=[],n=O(e),a=/^func\s+(?:\([^)]+\)\s+)?(\w+)\s*\(/gm,i=/^type\s+(\w+)\s+(?:struct|interface)/gm;for(let r of n.matchAll(a)){let o=r[1];t.push({kind:"function",name:o,startLine:C(n,r.index),endLine:null,exported:o[0]===o[0].toUpperCase()})}for(let r of n.matchAll(i))t.push({kind:"type",name:r[1],startLine:C(n,r.index),endLine:null,exported:r[1][0]===r[1][0].toUpperCase()});return{filePath:s,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}m(le,"extractGo");function ce(e,s){let t=[],n=O(e),a=/^(?:pub\s+)?(?:async\s+)?fn\s+(\w+)/gm,i=/^(?:pub\s+)?struct\s+(\w+)/gm,r=/^(?:pub\s+)?trait\s+(\w+)/gm,o=/^(?:pub\s+)?enum\s+(\w+)/gm;for(let[l,c]of[[a,"function"],[i,"class"],[r,"interface"],[o,"enum"]])for(let f of n.matchAll(l))t.push({kind:c,name:f[1],startLine:C(n,f.index),endLine:null,exported:/^pub\b/.test(f[0])});return{filePath:s,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}m(ce,"extractRust");function de(e,s){let t=[],n=O(e),a=/(?:public\s+|private\s+|protected\s+)?(?:abstract\s+|final\s+)?class\s+(\w+)/g,i=/(?:public\s+)?interface\s+(\w+)/g,r=/(?:public|private|protected)\s+(?:static\s+)?(?:final\s+)?[\w.<>,[\]\s]+\s+(\w+)\s*\(/g;for(let o of n.matchAll(a))t.push({kind:"class",name:o[1],startLine:C(n,o.index),endLine:null,exported:!0});for(let o of n.matchAll(i))t.push({kind:"interface",name:o[1],startLine:C(n,o.index),endLine:null,exported:!0});for(let o of n.matchAll(r))/^(if|for|while|switch|catch|return|new)$/.test(o[1])||t.push({kind:"method",name:o[1],startLine:C(n,o.index),endLine:null,exported:!0});return{filePath:s,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}m(de,"extractJava");function me(e,s){let t=w.extname(s).toLowerCase();return[".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(t)?ie(e,s):t===".py"?ae(e,s):t===".go"?le(e,s):t===".rs"?ce(e,s):t===".java"?de(e,s):j(s)}m(me,"extractFile");async function ue(e){let s=[];for(let t of["tsconfig.json","jsconfig.json"])try{let a=(await N.readFile(w.join(e,t),"utf-8")).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n]*/g,""),i=JSON.parse(a),r=i.compilerOptions?.paths,o=i.compilerOptions?.baseUrl??".";if(!r)continue;for(let[l,c]of Object.entries(r))s.push({pattern:l,targets:c.map(f=>w.posix.join(o.replace(/\\/g,"/"),f))});break}catch{}return s}m(ue,"loadTsPathMap");function fe(e,s){let t=[];for(let{pattern:n,targets:a}of s)if(n.endsWith("/*")){let i=n.slice(0,-1),r=n.slice(0,-2);if(e===r||e.startsWith(`${r}/`)){let o=e.slice(r.length).replace(/^\//,"");for(let l of a){let c=l.endsWith("/*")?l.slice(0,-1):l;t.push(w.posix.join(c.replace(/\*$/,""),o).replace(/\\/g,"/"))}}}else if(e===n)for(let i of a)t.push(i.replace(/\*$/,""));return t}m(fe,"applyTsPath");async function ge(e,s,t,n){let a=[];if(t.startsWith(".")){let i=w.dirname(w.join(e,s));a.push(w.resolve(i,t))}else if(t.startsWith("@/"))a.push(w.join(e,"src",t.slice(2))),a.push(w.join(e,t.slice(2)));else{for(let i of fe(t,n))a.push(w.join(e,i));a.push(w.join(e,"packages",t)),a.push(w.join(e,"src",t))}for(let i of a)for(let r of B){let o=i+r;try{if((await N.stat(o)).isFile())return w.relative(e,o).replace(/\\/g,"/")}catch{}}return null}m(ge,"resolveSpecifierToFile");async function pe(e,s,t){for(let[n,a]of s.importBindings){let i=await ge(e,s.filePath,a,t);i&&s.resolvedImports.set(n,i)}}m(pe,"resolveImportsForExtract");function G(e,s){let t=e.replace(/\\/g,"/"),n=s.replace(/\\/g,"/").replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"");return t===s||t.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"")===n||t===`${n}.ts`||t===`${n}.tsx`||t===`${n}.js`||t===`${n}.jsx`||t===`${n}/index.ts`||t===`${n}/index.tsx`||t===`${n}/index.js`}m(G,"matchFileToMod");function K(e,s){return e.filter(n=>n.kind==="function"||n.kind==="method"||n.kind==="class").reduce((n,a)=>a.startLine<=s&&(!n||a.startLine>n.startLine)?a:n,null)}m(K,"enclosingSymbol");function z(e,s,t,n){let a=t.filter(o=>o.name===e);if(a.length===1)return{targets:a,confidence:.95};if(a.length>1){let o=a.filter(l=>l.exported);if(o.length===1)return{targets:o,confidence:.9}}let i=s.resolvedImports.get(e);if(i){let o=(n.get(e)??[]).filter(f=>G(f.file,i));if(o.length>0)return{targets:o,confidence:.9};let l=[...n.values()].flat().filter(f=>G(f.file,i)&&f.exported),c=l.find(f=>f.kind==="function"||f.kind==="class")??l[0];if(c)return{targets:[c],confidence:.65}}let r=n.get(e)??[];if(r.length===1)return{targets:r,confidence:.75};if(r.length>1){let o=r.filter(l=>l.exported);if(o.length===1)return{targets:o,confidence:.7}}return{targets:[],confidence:0}}m(z,"resolveCallTargets");function Y(e){let s=[],t=[],n=new Map,a=new Map;for(let o of e){let l=[];for(let c of o.symbols){let f=oe(o.filePath,c.kind,c.name,c.startLine),p={id:f,file:o.filePath,kind:c.kind,name:c.name,qname:U(o.filePath,c.name),startLine:c.startLine,endLine:c.endLine,exported:c.exported};s.push(p),l.push(p);let g=n.get(c.name)??[];g.push(p),n.set(c.name,g),t.push({src:`file:${o.filePath}`,dst:f,edgeType:"DEFINES",confidence:1})}a.set(o.filePath,l)}for(let o of e){let l=a.get(o.filePath)??[],c=new Set;for(let f of o.calls){if(l.some(d=>d.name===f.name&&d.startLine===f.line))continue;let{targets:p,confidence:g}=z(f.name,o,l,n);if(p.length===0)continue;let u=K(l,f.line)?.id??`file:${o.filePath}`;for(let d of p){if(d.id===u)continue;let y=`${u}|${d.id}`;c.has(y)||(c.add(y),t.push({src:u,dst:d.id,edgeType:"CALLS",confidence:g}))}}}let i=new Set,r=[];for(let o of t){let l=`${o.src}|${o.dst}|${o.edgeType}`;i.has(l)||(i.add(l),r.push(o))}return{symbols:s,edges:r,fileCount:e.length}}m(Y,"buildFromExtracts");async function Z(e,s){let n=(s??(await W(e)).filter(r=>I(r)&&!r.includes(".d.ts"))).filter(r=>I(r)&&!r.endsWith(".d.ts")),a=await ue(e),i=await $(n,40,async r=>{try{let o=await N.readFile(w.join(e,r),"utf-8"),l=o.length>4e5?o.slice(0,4e5):o;return me(l,r)}catch{return j(r)}});return await $(i,40,async r=>(await pe(e,r,a),r)),i}m(Z,"extractProject");function ye(e,s){x.transaction(e,n=>{n.prepare("DELETE FROM code_symbols").run(),n.prepare("DELETE FROM code_symbol_edges").run();let a=n.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
10
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),i=n.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
|
|
11
|
-
VALUES (?, ?, ?, ?)`);for(let r of s.symbols)a.run(r.id,r.file,r.kind,r.name,r.qname,r.startLine,r.endLine,r.exported?1:0);for(let r of s.edges)i.run(r.src,r.dst,r.edgeType,r.confidence)});let t={symbolCount:s.symbols.length,edgeCount:s.edges.length,fileCount:s.fileCount,builtAt:new Date().toISOString()};x.setDoc(e,D,t)}m(ye,"persistGraph");function he(e,s,t){let n=new Set([...s.map(l=>l.filePath),...t]);if(n.size===0)return V(e);let a=Se(e).filter(l=>!n.has(l.file)),i=Y(s);x.transaction(e,l=>{let c=l.prepare("DELETE FROM code_symbols WHERE file = ?");for(let u of n)l.prepare("DELETE FROM code_symbol_edges WHERE src LIKE ? OR dst LIKE ? OR src = ? OR dst = ?").run(`${u}#%`,`${u}#%`,`file:${u}`,`file:${u}`),c.run(u);let f=l.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
12
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),p=l.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
|
|
13
|
-
VALUES (?, ?, ?, ?)`);for(let u of i.symbols)f.run(u.id,u.file,u.kind,u.name,u.qname,u.startLine,u.endLine,u.exported?1:0);let g=new Map;for(let u of[...a,...i.symbols]){let d=g.get(u.name)??[];d.push(u),g.set(u.name,d)}let E=new Map;for(let u of[...a,...i.symbols])E.has(u.file)||E.set(u.file,[]),E.get(u.file).push(u);for(let u of s){let d=E.get(u.filePath)??[];for(let h of d.filter(L=>L.file===u.filePath))p.run(`file:${u.filePath}`,h.id,"DEFINES",1);let y=new Set;for(let h of u.calls){if(d.some(T=>T.name===h.name&&T.startLine===h.line))continue;let{targets:L,confidence:M}=z(h.name,u,d,g);if(L.length===0)continue;let b=K(d,h.line)?.id??`file:${u.filePath}`;for(let T of L){if(T.id===b)continue;let R=`${b}|${T.id}`;y.has(R)||(y.add(R),p.run(b,T.id,"CALLS",M))}}}});let r=x.get(e,`SELECT
|
|
14
|
-
(SELECT COUNT(*) FROM code_symbols) AS sc,
|
|
15
|
-
(SELECT COUNT(*) FROM code_symbol_edges) AS ec,
|
|
16
|
-
(SELECT COUNT(DISTINCT file) FROM code_symbols) AS fc`),o={symbolCount:r?.sc??0,edgeCount:r?.ec??0,fileCount:r?.fc??0,builtAt:new Date().toISOString()};return x.setDoc(e,D,o),o}m(he,"patchGraph");async function be(e,s){let t=await Z(e),n=Y(t);return ye(s,n),{symbolCount:n.symbols.length,edgeCount:n.edges.length,fileCount:n.fileCount,builtAt:new Date().toISOString()}}m(be,"indexSymbols");async function Te(e,s,t,n=[]){if(!J(s))return be(e,s);let a=t.filter(o=>I(o)&&!o.endsWith(".d.ts")),i=n.filter(o=>I(o));if(a.length===0&&i.length===0)return V(s)??{symbolCount:0,edgeCount:0,fileCount:0,builtAt:new Date().toISOString()};let r=await Z(e,a);return he(s,r,i)??{symbolCount:0,edgeCount:0,fileCount:0,builtAt:new Date().toISOString()}}m(Te,"updateSymbols");function J(e){try{return(x.get(e,"SELECT COUNT(*) AS n FROM code_symbols")?.n??0)>0}catch{return!1}}m(J,"hasSymbolIndex");function V(e){return x.getDoc(e,D)}m(V,"loadMeta");function A(e){return{id:e.id,file:e.file,kind:e.kind,name:e.name,qname:e.qname??U(e.file,e.name),startLine:e.start_line,endLine:e.end_line,exported:e.exported===1}}m(A,"rowToSymbol");function Se(e){try{return x.query(e,"SELECT * FROM code_symbols ORDER BY file, start_line").map(A)}catch{return[]}}m(Se,"listAllSymbols");function v(e,s,t={}){let n=t.limit??30,a=`%${s.replace(/[%_]/g,"")}%`;try{return t.kind?x.query(e,`SELECT * FROM code_symbols
|
|
17
|
-
WHERE name LIKE ? COLLATE NOCASE AND kind = ?
|
|
18
|
-
ORDER BY exported DESC, name
|
|
19
|
-
LIMIT ?`,a,t.kind,n).map(A):x.query(e,`SELECT * FROM code_symbols
|
|
20
|
-
WHERE name LIKE ? COLLATE NOCASE OR qname LIKE ? COLLATE NOCASE
|
|
21
|
-
ORDER BY exported DESC, name
|
|
22
|
-
LIMIT ?`,a,a,n).map(A)}catch{return[]}}m(v,"searchSymbols");function Me(e,s,t=20){let n=s.split(/[^A-Za-z0-9_]+/).flatMap(i=>i.replace(/([a-z])([A-Z])/g,"$1 $2").split(/\s+/)).map(i=>i.trim()).filter(i=>i.length>2);if(n.length===0||!J(e))return[];let a=new Map;for(let i of n){let r=v(e,i,{limit:40});for(let o of r){let l=o.name.toLowerCase()===i.toLowerCase()?1:.55,c=o.exported?1.15:1,f=o.kind==="function"||o.kind==="class"||o.kind==="route"?1.1:1,p=l*c*f,g=a.get(o.file)??{score:0,names:new Set};g.score+=p,g.names.add(o.name),a.set(o.file,g)}}return Array.from(a.entries()).map(([i,r])=>({path:i,score:r.score,matchedNames:[...r.names]})).sort((i,r)=>r.score-i.score).slice(0,t)}m(Me,"scoreFilesFromQuery");function q(e,s){try{return x.query(e,"SELECT * FROM code_symbols WHERE file = ? ORDER BY start_line",s).map(A)}catch{return[]}}m(q,"symbolsInFile");function P(e,s="CALLS"){let t=new Map,n=new Map;try{let a=x.query(e,"SELECT src, dst FROM code_symbol_edges WHERE edge_type = ?",s);for(let i of a)t.has(i.src)||t.set(i.src,[]),t.get(i.src).push(i.dst),n.has(i.dst)||n.set(i.dst,[]),n.get(i.dst).push(i.src)}catch{}return{forward:t,reverse:n}}m(P,"loadEdges");function X(e,s){try{let t=x.get(e,"SELECT * FROM code_symbols WHERE id = ?",s);return t?A(t):null}catch{return null}}m(X,"symbolById");function _e(e,s,t={}){let n=t.direction??"both",a=Math.min(Math.max(t.depth??3,1),5),i=v(e,s,{limit:10}).filter(E=>E.name.toLowerCase()===s.toLowerCase()),r=i.length>0?i:v(e,s,{limit:5});if(r.length===0)return null;let{forward:o,reverse:l}=P(e,"CALLS"),c=[],f=[],p=m((E,u,d,y)=>{let h=new Set(E),L=E.map(M=>({id:M,depth:0}));for(let{id:M,depth:S}of L)if(!(S>=y))for(let b of u.get(M)??[]){if(h.has(b))continue;if(h.add(b),b.startsWith("file:")){let R=b.slice(5),F=q(e,R),k=F.find(_=>_.exported&&(_.kind==="function"||_.kind==="class"))??F.find(_=>_.kind==="function"||_.kind==="class")??F[0];k&&!h.has(k.id)&&(h.add(k.id),d.push({symbol:k,depth:S+1,via:"CALLS"}),L.push({id:k.id,depth:S+1})),L.push({id:b,depth:S+1});continue}let T=X(e,b);T&&(d.push({symbol:T,depth:S+1,via:"CALLS"}),L.push({id:b,depth:S+1}))}},"bfs"),g=r.map(E=>E.id);return(n==="inbound"||n==="both")&&p(g,l,c,a),(n==="outbound"||n==="both")&&p(g,o,f,a),{root:r,inbound:c,outbound:f}}m(_e,"tracePath");function ke(e,s){let t=q(e,s);if(t.length===0)return 0;let{reverse:n}=P(e,"CALLS"),a=new Set;for(let i of t)for(let r of n.get(i.id)??[])a.add(r);return a.size}m(ke,"fileFanIn");function Ae(e){try{let s=x.query(e,`SELECT target.file AS file, COUNT(DISTINCT edge.src) AS caller_count
|
|
23
|
-
FROM code_symbol_edges AS edge
|
|
24
|
-
JOIN code_symbols AS target ON target.id = edge.dst
|
|
25
|
-
WHERE edge.edge_type = 'CALLS'
|
|
26
|
-
GROUP BY target.file`);return new Map(s.map(t=>[t.file,t.caller_count]))}catch{return new Map}}m(Ae,"fileFanInByFile");function Oe(e,s,t=2){let n=new Set(s),{reverse:a}=P(e,"CALLS"),i=new Set;for(let l of s)for(let c of q(e,l))i.add(c.id);let r=new Set,o=new Set(i);return Array.from({length:t}).reduce(l=>{let c=[];for(let f of l)for(let p of a.get(f)??[])if(!o.has(p))if(o.add(p),c.push(p),p.startsWith("file:")){let g=p.slice(5);n.has(g)||r.add(g)}else{let g=X(e,p);g&&!n.has(g.file)&&r.add(g.file)}return c},[...i]),[...r]}m(Oe,"filesCallingInto");export{O as a,me as b,be as c,Te as d,J as e,V as f,Se as g,v as h,Me as i,q as j,_e as k,ke as l,Ae as m,Oe as n};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as _}from"./chunk-LT5WSSQO.mjs";import{a as k}from"./chunk-HJ4HEI45.mjs";import{a as d,b as y,c as E}from"./chunk-3LG3ACQV.mjs";import{d as u,g as S}from"./chunk-HDHVBB6Q.mjs";import{b as a,c as T,e as P}from"./chunk-AKIN5WSQ.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var f={critical:0,high:1,medium:2,low:3},R={active:0,previously_active:1,backlog:2};function A(i){return[...i].sort((e,t)=>{let s=R[e.section]-R[t.section];return s!==0?s:f[e.priority]-f[t.priority]})}o(A,"sortBySectionAndPriority");function Q(i,e){let t=new Set;return i.filter(s=>{let r=e(s);return t.has(r)?!1:(t.add(r),!0)})}o(Q,"uniqueBy");P();S();function c(i){let e={id:i.id,description:i.description,priority:i.priority??"medium",type:i.type??"feature",section:i.section??"backlog",completed:i.completed===1,createdAt:i.created_at};return i.completed_at!=null&&(e.completedAt=i.completed_at),i.feature_id!=null&&(e.featureId=i.feature_id),i.feature_name!=null&&(e.originFeature=i.feature_name),i.body!=null&&(e.body=i.body),i.agent!=null&&(e.agent=i.agent),i.group_name!=null&&(e.groupName=i.group_name),i.group_id!=null&&(e.groupId=i.group_id),e}o(c,"rowToTask");var p=`INSERT INTO queue_tasks
|
|
9
|
-
(id, description, type, priority, section, created_at, completed, completed_at,
|
|
10
|
-
feature_id, feature_name, body, agent, group_name, group_id)
|
|
11
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`;function m(i){return[i.id,i.description,i.type??null,i.priority??null,i.section??"backlog",i.createdAt,i.completed?1:0,i.completedAt??null,i.featureId??null,i.originFeature??null,i.body??null,i.agent??null,i.groupName??null,i.groupId??null]}o(m,"insertParams");var g=class extends k{static{o(this,"QueueStorage")}constructor(){super("queue.json",_)}getDefault(){return{tasks:[],lastUpdated:""}}getEventType(e){return`queue.${e}d`}async getTasks(e){return u.query(e,"SELECT * FROM queue_tasks ORDER BY created_at ASC").map(c)}async getActiveTasks(e){return u.query(e,"SELECT * FROM queue_tasks WHERE section = 'active' AND completed = 0 ORDER BY created_at ASC").map(c)}async getBacklog(e){return u.query(e,"SELECT * FROM queue_tasks WHERE section = 'backlog' AND completed = 0 ORDER BY created_at ASC").map(c)}async getNextTask(e){let t=await this.getActiveTasks(e);return A(t)[0]||null}async addTask(e,t){let s={...t,id:d(),createdAt:a(),completed:!1};return u.run(e,p,...m(s)),await this.publishEvent(e,"queue.task_added",{taskId:s.id,description:s.description,priority:s.priority,section:s.section,created_at:s.createdAt}),s}async addTasks(e,t){let s=a(),r=t.map(n=>({...n,id:d(),createdAt:s,completed:!1}));for(let n of r)u.run(e,p,...m(n));return await this.publishEvent(e,"queue.tasks_added",{count:r.length,tasks:r.map(n=>({id:n.id,description:n.description,created_at:n.createdAt}))}),r}async upsertTask(e,t){let s=await this.getTask(e,t.id);if(s){let n={...s};for(let l of["description","type","priority","section"])t[l]!==void 0&&(n[l]=t[l]);u.run(e,`UPDATE queue_tasks SET description = ?, type = ?, priority = ?, section = ?
|
|
12
|
-
WHERE id = ?`,n.description,n.type??null,n.priority??null,n.section??"backlog",t.id);return}let r={...t,id:t.id,description:t.description,priority:t.priority??"medium",type:t.type??"feature",section:t.section??"backlog",completed:t.completed??!1,createdAt:t.createdAt??a()};u.run(e,p,...m(r))}async removeTask(e,t){u.run(e,"DELETE FROM queue_tasks WHERE id = ?",t),await this.publishEvent(e,"queue.task_removed",{taskId:t})}async deleteByFeatureId(e,t){let r=u.run(e,"DELETE FROM queue_tasks WHERE feature_id = ?",t).changes;return r>0&&await this.publishEvent(e,"queue.tasks_removed_by_feature",{featureId:t,count:r}),r}async completeTask(e,t){let s=a();if(u.run(e,"UPDATE queue_tasks SET completed = 1, completed_at = ? WHERE id = ? AND completed = 0",s,t).changes===0)return null;let n=await this.getTask(e,t);return n&&await this.publishEvent(e,"queue.task_completed",{taskId:t,description:n.description,completedAt:n.completedAt}),n}async moveToSection(e,t,s){u.run(e,"UPDATE queue_tasks SET section = ? WHERE id = ?",s,t)}async setPriority(e,t,s){u.run(e,"UPDATE queue_tasks SET priority = ? WHERE id = ?",s,t)}async getTask(e,t){let s=u.get(e,"SELECT * FROM queue_tasks WHERE id = ?",t);return s?c(s):null}async updateTask(e,t,s){let r=await this.getTask(e,t);if(!r)return null;let n={...r,...s};return u.run(e,"UPDATE queue_tasks SET description = ?, body = ?, type = ?, priority = ?, section = ? WHERE id = ?",n.description,n.body??null,n.type??null,n.priority??null,n.section??"backlog",t),await this.publishEvent(e,"queue.task_updated",{taskId:t}),n}async clearCompleted(e){return u.run(e,"DELETE FROM queue_tasks WHERE completed = 1").changes}async removeStaleCompleted(e){let t=T(y.QUEUE_COMPLETED_DAYS).toISOString(),s=u.query(e,"SELECT * FROM queue_tasks WHERE completed = 1 AND completed_at IS NOT NULL AND completed_at < ?",t).map(c);return s.length===0?0:(E.archiveMany(e,s.map(r=>({entityType:"queue_task",entityId:r.id,entityData:r,summary:r.description,reason:"age"}))),u.run(e,"DELETE FROM queue_tasks WHERE completed = 1 AND completed_at IS NOT NULL AND completed_at < ?",t),await this.publishEvent(e,"queue.stale_removed",{count:s.length}),s.length)}},C=new g;export{Q as a,C as b};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as Y}from"./chunk-45I2C2UB.mjs";import{b as A,c as J}from"./chunk-L4COZ7ZH.mjs";import{a as K}from"./chunk-4KY2EHXS.mjs";import{a as G}from"./chunk-UBMIPWJR.mjs";import{e as B}from"./chunk-7OZDWT6C.mjs";import{c as I}from"./chunk-ZZ65CN5F.mjs";import{d as _}from"./chunk-BNWB77U5.mjs";import{a as w}from"./chunk-3WY2AYPE.mjs";import{b as $}from"./chunk-JRKGG2E3.mjs";import{d as f,g as W}from"./chunk-HDHVBB6Q.mjs";import{b as j,d as b,e as rt,f as O,h as at,s as U,t as lt}from"./chunk-AKIN5WSQ.mjs";import{d as ct}from"./chunk-JQE2F2RK.mjs";import{e as k,o as it}from"./chunk-CTWZQ7YI.mjs";import{b as T,e as ut}from"./chunk-P5ZYAXSE.mjs";import{e as F,f as ot}from"./chunk-BUDZL4DW.mjs";import{a as l}from"./chunk-E66B27AL.mjs";lt();import M from"node:fs";import mt from"node:path";var q=l(()=>U.getStatePath(),"stampDir"),X=l(()=>mt.join(q(),"installed-version"),"stampPath");function dt(){try{return M.readFileSync(X(),"utf-8").trim()}catch{return null}}l(dt,"readStamp");function pt(i){try{M.mkdirSync(q(),{recursive:!0}),M.writeFileSync(X(),i,"utf-8")}catch{}}l(pt,"writeStamp");function V(i){return i?dt()===i:!0}l(V,"isSyncCurrent");async function z(i){if(i&&process.env.PRJCT_NO_SELF_SYNC!=="1"){try{let{installGlobalConfig:n}=await import("./command-installer-LNK7WC5I.mjs");await n()}catch{}try{await(await import("./settings-installer-QDM3GB6J.mjs")).install()}catch{}try{let{SetupCommands:n}=await import("./setup-BSWLQJPE.mjs");await new n().installStatusLine()}catch{}pt(i)}}l(z,"runSelfHeal");W();ot();it();ct();W();at();rt();var ft=50,H=class{static{l(this,"SessionTracker")}currentRow(n){try{return f.get(n,"SELECT * FROM cli_sessions WHERE status = 'active' ORDER BY last_activity DESC LIMIT 1")??null}catch{return null}}isExpired(n){return O(n,18e5)}toSessionData(n,t){return{id:t.id,projectId:n,status:t.status,createdAt:t.created_at,lastActivity:t.last_activity,commands:[],files:[]}}async touch(n){let t=j(),e=this.currentRow(n);if(e&&!this.isExpired(e.last_activity))return f.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",t,e.id),this.toSessionData(n,{...e,last_activity:t});e&&f.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",e.id);let s=crypto.randomUUID();return f.run(n,"INSERT INTO cli_sessions (id, status, created_at, last_activity) VALUES (?, 'active', ?, ?)",s,t,t),this.toSessionData(n,{id:s,status:"active",created_at:t,last_activity:t})}async trackCommand(n,t,e){let s=this.currentRow(n);if(!s)return;let r=j();try{f.run(n,"INSERT INTO cli_session_commands (session_id, command, timestamp, duration_ms) VALUES (?, ?, ?, ?)",s.id,t,r,Math.round(e)),f.run(n,"UPDATE cli_sessions SET last_activity = ? WHERE id = ?",r,s.id)}catch{}}async getInfo(n){let t=this.currentRow(n);if(!t||this.isExpired(t.last_activity))return{active:!1,id:null,duration:null,idleSince:null,idleMs:0,expiresIn:null,commandCount:0,commands:[],filesRead:0,filesWritten:0};let e=Date.now(),s=new Date(t.created_at).getTime(),r=new Date(t.last_activity).getTime(),c=e-r,a=Math.max(0,18e5-c),o=f.query(n,"SELECT command FROM cli_session_commands WHERE session_id = ? ORDER BY timestamp DESC LIMIT ?",t.id,ft);return{active:!0,id:t.id,duration:b(e-s),idleSince:t.last_activity,idleMs:c,expiresIn:b(a),commandCount:o.length,commands:o.map(m=>m.command).reverse(),filesRead:0,filesWritten:0}}async expire(n){try{f.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE status = 'active'")}catch{}}async expireIfStale(n){let t=this.currentRow(n);return t&&this.isExpired(t.last_activity)?(f.run(n,"UPDATE cli_sessions SET status = 'expired' WHERE id = ?",t.id),!0):!1}},Z=new H;var ht={commitThreshold:10,dayThreshold:3,significantFiles:["package.json","tsconfig.json","Cargo.toml","go.mod","requirements.txt","pyproject.toml",".env.example","docker-compose.yml","Dockerfile"]},L=class{static{l(this,"StalenessChecker")}projectPath;config;constructor(n,t={}){this.projectPath=n,this.config={...ht,...t}}async check(n){let t={isStale:!1,reason:null,lastSyncCommit:null,currentCommit:null,commitsSinceSync:0,daysSinceSync:0,changedFiles:[],significantChanges:[]};try{let e=(()=>{try{return f.getDoc(n,"project")}catch{return null}})();if(!e)return t.isStale=!0,t.reason="No sync history found. Run `prjct sync` to initialize.",t;t.lastSyncCommit=e.lastSyncCommit||null;let s=e.lastSync;if(!t.lastSyncCommit)return t.isStale=!0,t.reason="No sync commit recorded. Run `prjct sync` to track.",t;let c={cwd:this.projectPath,timeoutMs:3e3,maxBuffer:1024*256},a=`${t.lastSyncCommit}..HEAD`,[o,m]=await Promise.all([k(["rev-parse","--short","HEAD"],c),k(["rev-list","--count",a],c)]);if(!o.ok)return t.reason=o.kind==="exit"?"Not a git repository":`git ${o.kind} \u2014 staleness unknown`,t;if(t.currentCommit=o.stdout.trim(),t.lastSyncCommit===t.currentCommit)return t.reason="Context is up to date",t;if(!m.ok)return m.kind==="exit"?(t.isStale=!0,t.reason="Sync commit no longer exists (history changed). Run `prjct sync`."):t.reason=`git ${m.kind} reading history \u2014 staleness unknown. Retry shortly.`,t;if(t.commitsSinceSync=parseInt(m.stdout.trim(),10)||0,s){let y=new Date(s),g=new Date;t.daysSinceSync=Math.floor((g.getTime()-y.getTime())/(1e3*60*60*24))}if(t.commitsSinceSync>0&&t.commitsSinceSync<this.config.commitThreshold){let y=await k(["diff","--name-only",a],c),g=y.ok?y.stdout.trim().split(`
|
|
9
|
-
`).filter(Boolean).slice(0,200):[];t.changedFiles=g,t.significantChanges=g.filter(d=>this.config.significantFiles.some(p=>d.endsWith(p)||d.includes(p)))}else t.changedFiles=[],t.significantChanges=[];return t.commitsSinceSync>=this.config.commitThreshold?(t.isStale=!0,t.reason=`${t.commitsSinceSync} commits since last sync (threshold: ${this.config.commitThreshold})`):t.daysSinceSync>=this.config.dayThreshold?(t.isStale=!0,t.reason=`${t.daysSinceSync} days since last sync (threshold: ${this.config.dayThreshold})`):t.significantChanges.length>0?(t.isStale=!0,t.reason=`Significant files changed: ${t.significantChanges.join(", ")}`):t.commitsSinceSync>0?t.reason=`${t.commitsSinceSync} commits since sync (threshold: ${this.config.commitThreshold})`:t.reason="Context is up to date",t}catch(e){return t.reason=`Error checking staleness: ${F(e)}`,t}}formatStatus(n){let t=[];n.isStale?t.push("CLAUDE.md status: \u26A0\uFE0F STALE"):t.push("CLAUDE.md status: \u2713 Fresh");let e=[];if(n.lastSyncCommit&&e.push(`Last sync: ${n.lastSyncCommit}`),n.currentCommit&&e.push(`Current: ${n.currentCommit}`),n.commitsSinceSync>0&&e.push(`Commits since: ${n.commitsSinceSync}`),n.daysSinceSync>0&&e.push(`Days since: ${n.daysSinceSync}`),n.changedFiles.length>0&&e.push(`Files changed: ${n.changedFiles.length}`),e.length>0){let s=Math.max(...e.map(c=>c.length)),r="\u2500".repeat(s+2);t.push(`\u250C${r}\u2510`);for(let c of e)t.push(`\u2502 ${c.padEnd(s)} \u2502`);t.push(`\u2514${r}\u2518`)}if(n.significantChanges.length>0){t.push(""),t.push("Significant changes:");for(let s of n.significantChanges.slice(0,5))t.push(` \u2022 ${s}`);n.significantChanges.length>5&&t.push(` ... and ${n.significantChanges.length-5} more`)}return n.reason&&(t.push(""),t.push(n.reason)),n.isStale&&(t.push(""),t.push("Run `prjct sync` to update context")),t.join(`
|
|
10
|
-
`)}async getSessionInfo(n){return Z.getInfo(n)}formatSessionInfo(n){let t=[];if(!n.active)return t.push("Session: \u25CB No active session"),t.join(`
|
|
11
|
-
`);t.push(`Session: \u25B6 Active (${n.duration})`);let e=[];if(n.commandCount>0){let s=new Set,r=[];for(let c of n.commands)s.has(c)||(s.add(c),r.push(c));e.push(`Commands: ${r.join(" \u2192 ")} (${n.commandCount} total)`)}if((n.filesRead>0||n.filesWritten>0)&&e.push(`Files: ${n.filesRead} read, ${n.filesWritten} written`),e.push(`Idle: ${n.expiresIn} until timeout`),e.length>0){let s=Math.max(...e.map(c=>c.length)),r="\u2500".repeat(s+2);t.push(`\u250C${r}\u2510`);for(let c of e)t.push(`\u2502 ${c.padEnd(s)} \u2502`);t.push(`\u2514${r}\u2518`)}return t.join(`
|
|
12
|
-
`)}getWarning(n){return n.isStale?n.commitsSinceSync>0?`\u26A0\uFE0F Context stale (${n.commitsSinceSync} commits behind). Run \`prjct sync\``:n.daysSinceSync>0?`\u26A0\uFE0F Context stale (${n.daysSinceSync} days old). Run \`prjct sync\``:"\u26A0\uFE0F Context may be stale. Run `prjct sync`":null}},tt=l((i,n)=>new L(i,n),"createStalenessChecker");ut();var gt=1600,P=3,yt=4;async function St(i,n,t={}){let e=n??await $.readConfig(i);if(!e?.projectId)return null;let s=e.persona,r=t.digest?await(async()=>{try{let{memoryL0IndexForSession:h}=await import("./memory-index-B53F5HAX.mjs");return h(e.projectId,{rebuildIfStale:!0})||nt(e.projectId)}catch{return nt(e.projectId)}})():null,c=Ct(i,e.projectId),a=import("./vault-retire-notice-GRT3QRLZ.mjs").then(({vaultRetirementNotice:h})=>h(e,e.projectId)),o=(async()=>{try{let{buildLandCue:h}=await import("./land-cue-WLGSULSO.mjs");return await h(e.projectId,i,e)}catch{return null}})(),m=(async()=>{try{let{effectiveWeakModelMode:h,weakModelBanner:C}=await import("./weak-model-mode-VDYJ25PX.mjs");return h(e)==="on"?C():null}catch{return null}})(),v=t.digest?(async()=>{try{let{formatPendingHandoffCue:h}=await import("./agent-switch-A6AYZRJ5.mjs"),C=h(e.projectId);return C?`# prjct: pending handoff
|
|
13
|
-
${C}`:null}catch{return null}})():Promise.resolve(null),y=t.digest?(async()=>{try{let{loadSessionContinuity:h,formatContinuitySessionCue:C}=await import("./session-continuity-LO2KNHXU.mjs");return C(h(e.projectId))}catch{return null}})():Promise.resolve(null),g=$t(i,e.projectId),[d,p,S,E,x,R,D]=await Promise.all([c,a,o,m,v,y,g]);if(!D&&!s&&!r&&!d&&!p&&!S&&!E&&!x&&!R)return null;let u=["# prjct: project context",""];return D&&u.push(D,""),s&&u.push(Et(s),"","> Exposed as state, not prescription. Decide whether any of this matters for the current turn."),r&&(s&&u.push(""),u.push(r)),d&&((s||r)&&u.push(""),u.push(d)),p&&((s||r||d)&&u.push(""),u.push(p)),S&&((s||r||d||p)&&u.push(""),u.push(S)),E&&((s||r||d||p||S)&&u.push(""),u.push(E)),x&&((s||r||d||p||S||E)&&u.push(""),u.push(x)),R&&((s||r||d||p||S||E||x)&&u.push(""),u.push(R)),u.join(`
|
|
14
|
-
`)}l(St,"buildSessionContext");async function Ct(i,n){try{let t=tt(i),e=await t.check(n);if(!e.isStale||e.commitsSinceSync<=0)return null;let s=t.getWarning(e);if(!s)return null;try{let c=await import("node:path"),a=await import("node:os"),{maybeDetachDriftRefresh:o,readDriftStamp:m,formatDriftNotice:v,driftStaleResolved:y}=await import("./drift-refresh-TD3PYPJN.mjs"),g=process.env.PRJCT_CLI_HOME?c.resolve(process.env.PRJCT_CLI_HOME):c.join(a.homedir(),".prjct-cli"),d=m(g);if(y(d))return v({warning:s,commitsSinceSync:e.commitsSinceSync,stamp:d,refreshScheduled:!1});let p=o({projectPath:i,cliHome:g,commitsSinceSync:e.commitsSinceSync}),S=m(g);return v({warning:s,commitsSinceSync:e.commitsSinceSync,stamp:S,refreshScheduled:p})}catch{}let r=await(async()=>{try{let{hasSymbolIndex:c,loadMeta:a}=await import("./symbol-graph-LZM4RZXZ.mjs");if(!c(n))return" Code graph empty \u2014 `prjct code reindex` (or `prjct sync`) before trace/impact.";if(e.commitsSinceSync<5)return"";let o=a(n);return` Symbol index may lag${o?.builtAt?` (index ${o.builtAt.slice(0,10)})`:""} \u2014 prefer \`prjct code reindex\` after big pulls.`}catch{return""}})();return`**Understanding may be stale:** ${s} \u2014 run \`prjct sync\` before big calls.${r}`}catch{return null}}l(Ct,"buildStalenessNotice");function nt(i){let n=(()=>{try{let o=I.rerank(i,w.recall(i,{types:["gotcha","anti-pattern"],limit:P*4})).slice(0,P),m=I.rerank(i,w.recall(i,{types:["decision"],limit:P*4})).slice(0,P);return{gotchas:o,decisions:m}}catch{return null}})();if(!n)return null;let{gotchas:t,decisions:e}=n,s=(()=>{try{let o=w.recall(i,{types:["feedback","improvement-signal"],limit:40,dedupeByKey:!1});return K(o,yt)}catch{return[]}})(),r=st(i,new Set([...t,...e].map(o=>o.id))),c=(()=>{try{let o=G(i);return o?B(o,{maxConventions:4,maxPatterns:3,maxAnti:2}):null}catch{return null}})();if(t.length===0&&e.length===0&&!r&&s.length===0&&!c)return null;let a=["## What this project already knows",""];if(a.push("> Carried across sessions and model updates \u2014 this survived even if your conversation context did not. Apply these; do not re-derive from source."),s.length>0){a.push("","**How this developer works (act as them):**");for(let o of s){let m=o.rule.length>140?`${o.rule.slice(0,139)}\u2026`:o.rule;a.push(`- ${m} \`${o.sourceId}\``)}}if(c){let o=c.replace(/^## How this repo works \(project style\)\n?/,"").trim();o&&a.push("","**How this repo works (match house style):**",o)}if(t.length>0){a.push("","**Traps to avoid:**");for(let o of t)a.push(`- ${N(o)}`)}if(e.length>0){a.push("","**Decisions in force:**");for(let o of e)a.push(`- ${N(o)}`)}return r&&a.push("","**Keeps being missed:**",`- ${N(r.entry)} \u2014 flagged relevant-but-unused ${r.count}\xD7. Apply it or supersede it.`),a.push("","> Resolve any `mem_id` with `prjct search <id>`. Full developer model: MCP `prjct_developer`. Project style: `prjct analysis` / sync evolution."),A(a.join(`
|
|
15
|
-
`),gt)}l(nt,"buildKnowledgeDigest");function N(i){let n=_(i),t=(i.content??"").replace(/\s+/g," ").trim();if(t.length<=n.length+8)return`${n} \`${i.id}\``;let e=t.slice(n.length).replace(/^[\s.:;—-]+/,"").trim();if(e.length<24)return`${n} \`${i.id}\``;let s=e.length>90?`${e.slice(0,89)}\u2026`:e;return`${n} \u2014 ${s} \`${i.id}\``}l(N,"digestLine");var wt=2;function st(i,n){try{let t=w.recall(i,{types:["improvement-signal"],tags:{kind:"skill-miss"},limit:50,dedupeByKey:!1}),e=new Map;for(let a of t){let o=a.tags?.relates;o&&e.set(o,(e.get(o)??0)+1)}let[s,r]=[...e].reduce((a,o)=>o[1]>a[1]?o:a,[null,0]);if(!s||r<wt||n.has(s))return null;let c=w.getById(i,s);return c?{entry:c,count:r}:null}catch{return null}}l(st,"findRepeatMissedEntry");var vt=500,et=2;async function tn(i){let n=await $.readConfig(i).catch(()=>null);if(!n?.projectId)return null;let t=["# prjct: subagent context"];n.persona?.role&&t.push(`Role in this project: ${n.persona.role}`);try{let{resolveActiveTask:e}=await import("./task-service-RMCQEHV6.mjs"),s=await e(n.projectId,i);s&&t.push(`Active work cycle (this worktree): ${s.description}`)}catch{}try{let e=I.rerank(n.projectId,w.recall(n.projectId,{types:["gotcha","anti-pattern"],limit:et*4})).slice(0,et);if(e.length>0){t.push("Traps to avoid:");for(let r of e)t.push(`- ${_(r)} \`${r.id}\``)}let s=st(n.projectId,new Set(e.map(r=>r.id)));s&&t.push(`Keeps being missed: ${_(s.entry)} \`${s.entry.id}\``)}catch{}return t.length<=1?null:A(t.join(`
|
|
16
|
-
`),vt)}l(tn,"buildSubagentDigest");function Et(i){let n=[];return n.push(`## Your role in this project: **${i.role}**`),i.focus&&n.push(`Focus: ${i.focus}`),i.mcps&&i.mcps.length>0&&n.push(`Available MCPs this project expects: ${i.mcps.join(", ")}`),i.packs&&i.packs.length>0&&n.push(`Active packs: ${i.packs.join(", ")}`),n.join(`
|
|
17
|
-
`)}l(Et,"formatPersona");async function $t(i,n){try{let t=await import("node:path"),{execFileAsync:e}=await import("./exec-I7XE7NMD.mjs"),s=t.basename(i),r=await(async()=>{try{let{stdout:o}=await e("git",["branch","--show-current"],{cwd:i});return o.trim()}catch{return""}})(),c=n.length>12?`${n.slice(0,8)}\u2026`:n,a=["## Project identity (cwd)",`- **${s}** \xB7 id \`${c}\``];return r&&a.push(`- Branch: \`${r}\``),a.push("- Skill is portable L0 \u2014 if skill text names another project, ignore it; trust this block + `prjct context --md`."),a.join(`
|
|
18
|
-
`)}catch{return null}}l($t,"buildProjectIdentityLine");function nn(i=process.cwd(),n){let t=$.readConfig(i).catch(()=>null);return J({event:"SessionStart",projectPath:i,build:l(async(e,s)=>{let r=s===i?await t:await $.readConfig(s).catch(()=>null),c=e.source??"startup";return St(s,r,{digest:c==="startup"||c==="clear"||c==="compact"})},"build"),afterEmit:l(async(e,s)=>{let r=await t;if(r?.projectId){let c=await(async()=>{try{let{collectActiveTasks:a}=await import("./task-overview-6ZQKJGSH.mjs"),o=await a(r.projectId,s);return{taskId:o.current?.id??null,goal:o.current?.description??e.source??null}}catch{return{taskId:null,goal:e.source??null}}})();Y({projectId:r.projectId,sessionId:e.session_id,directory:s,taskId:c.taskId,goal:c.goal})}V(T)||await z(T).catch(()=>{});try{let{maybeAutoUpdate:c}=await import("./auto-updater-EHRRMCYY.mjs");c(T)}catch{}},"afterEmit")},n)}l(nn,"runSessionStartHook");export{St as a,tn as b,$t as c,nn as d};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a}from"./chunk-E66B27AL.mjs";function l(n){let e=new Set;for(let t of n){let s=c(t.message)?.model??t.model;typeof s=="string"&&s.trim()&&e.add(s.trim().slice(0,120))}return e.size===0?"unknown":e.size>1?"mixed":[...e][0]}a(l,"identifyTranscriptModel");function I(n){let e=[];for(let t of n.split(`
|
|
9
|
-
`)){let o=t.trim();if(o)try{let s=JSON.parse(o);s&&typeof s=="object"&&e.push(s)}catch{}}return e}a(I,"parseTranscriptJsonl");function c(n){return n&&typeof n=="object"?n:null}a(c,"asRecord");function p(n){return typeof n=="number"&&Number.isFinite(n)?n:0}a(p,"num");function d(n){let e=p(n.input_tokens)+p(n.cache_creation_input_tokens)+p(n.prompt_tokens)+p(n.promptTokenCount),t=p(n.output_tokens)+p(n.completion_tokens)+p(n.candidatesTokenCount),o=p(n.cache_read_input_tokens);return{tokensIn:e,tokensOut:t,cacheRead:o}}a(d,"usagePairFrom");function f(n,e){if(!e?.sinceIso&&!e?.untilIso)return!0;let t=typeof n.timestamp=="string"?Date.parse(n.timestamp):Number.NaN;return!(!Number.isFinite(t)||e.sinceIso&&t<Date.parse(e.sinceIso)||e.untilIso&&t>=Date.parse(e.untilIso))}a(f,"inWindow");function g(n,e){let t=n.reduce((u,m)=>{if(!f(m,e))return u;let k=c(c(m.message)?.usage)??c(m.usage)??c(m.usageMetadata);if(!k)return u;let i=d(k);return{tokensInNew:u.tokensInNew+i.tokensIn,tokensOut:u.tokensOut+i.tokensOut,maxCacheRead:Math.max(u.maxCacheRead,i.cacheRead)}},{tokensInNew:0,tokensOut:0,maxCacheRead:0}),{tokensInNew:o,tokensOut:s,maxCacheRead:r}=t;return{tokensInNew:o,cacheReadMax:r,tokensIn:o+r,tokensOut:s}}a(g,"sumTranscriptUsageDetailed");function x(n,e){let t=g(n,e);return{tokensIn:t.tokensIn,tokensOut:t.tokensOut}}a(x,"sumTranscriptUsage");function T(n,e){let t=new Map;for(let s of n){if(!f(s,e))continue;let r=c(s.message),u=c(r?.usage)??c(s.usage)??c(s.usageMetadata);if(!u)continue;let m=typeof r?.model=="string"&&r.model?r.model:"unknown",k=d(u),i=t.get(m)??{tokensIn:0,tokensOut:0,maxCacheRead:0};i.tokensIn+=k.tokensIn,i.tokensOut+=k.tokensOut,k.cacheRead>i.maxCacheRead&&(i.maxCacheRead=k.cacheRead),t.set(m,i)}let o=new Map;for(let[s,r]of t)o.set(s,{tokensIn:r.tokensIn+r.maxCacheRead,tokensOut:r.tokensOut});return o}a(T,"sumTranscriptUsageByModel");export{l as a,I as b,g as c,x as d,T as e};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as c,b as w,c as y,d as x,f as h}from"./chunk-BUDZL4DW.mjs";import{a as n,c as d}from"./chunk-E66B27AL.mjs";var j,P,_,v=d(()=>{"use strict";j=new Set(["node_modules",".git","dist","build","out",".next",".nuxt","coverage",".cache",".turbo",".vercel",".parcel-cache","__pycache__",".pytest_cache","target","vendor",".venv","venv","eggs","*.egg-info",".prjct",".worktrees"]),P=["",".ts",".tsx",".js",".jsx","/index.ts","/index.js"],_=/(?:import|from)\s+['"]([^'"]+)['"]/g});import E from"node:fs/promises";async function S(t,r){let e=await E.readFile(t,"utf-8").catch(a=>{if(c(a))return null;throw a});if(e===null)return null;let i=(()=>{try{return JSON.parse(e)}catch{return null}})();if(i===null)return await F(t,e),k(t,"Malformed JSON"),null;let o=r.safeParse(i);return o.success?i:(await F(t,e),k(t,O(o.error)),null)}async function F(t,r){let e=`${t}.backup`;try{await E.writeFile(e,r,{encoding:"utf-8",flag:"wx"})}catch{}}function k(t,r){console.error(`[prjct] Warning: Corrupted storage file: ${t}`),console.error(`[prjct] Reason: ${r}`),console.error("[prjct] A .backup file has been created. Returning defaults.")}function O(t){return t.issues.slice(0,3).map(r=>`${r.path.join(".")}: ${r.message}`).join("; ")}var T=d(()=>{"use strict";h();n(S,"safeRead");n(F,"createBackup");n(k,"logCorruption");n(O,"formatZodError")});import s from"node:fs/promises";import m from"node:path";async function b(t,r,e){try{return await e()}catch(i){throw y(i)||w(i)?new Error(x(i,t,r)):i}}async function M(t,r={}){let e=[],i=r.maxFiles??1/0,o=r.dotfileAllowlist?new Set(r.dotfileAllowlist):null;async function a(l){if(e.length>=i)return;let u=await s.readdir(l,{withFileTypes:!0}).catch(()=>[]);for(let p of u){if(e.length>=i)break;let f=String(p.name);if(j.has(f)||r.skipDotfiles&&f.startsWith(".")&&(!o||!o.has(f)))continue;let g=m.join(l,f);p.isDirectory()?await a(g):p.isFile()&&e.push(m.relative(t,g))}}return n(a,"walk"),await a(t),e}async function Z(t,r,e){let i=[],o=Array.from({length:Math.ceil(t.length/r)},(a,l)=>l*r);for(let a of o){let l=await Promise.all(t.slice(a,a+r).map(e));for(let u of l)u!==null&&i.push(u)}return i}async function G(t,r=null,e){if(e)return await S(t,e)??r;try{let i=await s.readFile(t,"utf-8");return JSON.parse(i)}catch(i){if(c(i))return r;throw i}}async function K(t,r,e=2){await b(t,"config",async()=>{let i=m.dirname(t);await s.mkdir(i,{recursive:!0});let o=`${JSON.stringify(r,null,e)}
|
|
9
|
-
`;await s.writeFile(t,o,"utf-8")})}async function X(t,r=""){try{return await s.readFile(t,"utf-8")}catch(e){if(c(e))return r;throw e}}async function q(t,r){await b(t,"file",async()=>{let e=m.dirname(t);await s.mkdir(e,{recursive:!0}),await s.writeFile(t,r,"utf-8")})}async function B(t){try{return await s.access(t),!0}catch(r){if(c(r))return!1;throw r}}async function H(t){try{return(await s.stat(t)).isDirectory()}catch(r){if(c(r))return!1;throw r}}async function Q(t){await s.mkdir(t,{recursive:!0})}async function U(t,r={}){try{return(await s.readdir(t,{withFileTypes:!0})).filter(o=>!r.filesOnly||o.isFile()).filter(o=>!r.dirsOnly||o.isDirectory()).filter(o=>!r.extension||o.name.endsWith(r.extension)).map(o=>o.name)}catch(e){if(c(e))return[];throw e}}var R=d(()=>{"use strict";v();T();h();n(b,"withWriteErrorContext");n(M,"walkDir");n(Z,"batchProcess");n(G,"readJson");n(K,"writeJson");n(X,"readFile");n(q,"writeFile");n(B,"fileExists");n(H,"dirExists");n(Q,"ensureDir");n(U,"listFiles")});export{P as a,_ as b,v as c,M as d,Z as e,G as f,K as g,X as h,q as i,B as j,H as k,Q as l,U as m,R as n};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as T,g as D,h as v,i as O,j as G}from"./chunk-2OU2MKNS.mjs";import{a as W,b as C}from"./chunk-YJMWY4Y6.mjs";import{e as H,i as z}from"./chunk-NJAMZSHM.mjs";import{a as A,e as B}from"./chunk-4DDCWMI6.mjs";import{a as I}from"./chunk-3WY2AYPE.mjs";import{e as w,g as oe}from"./chunk-HDHVBB6Q.mjs";import{a as L,o as re}from"./chunk-CTWZQ7YI.mjs";import{a as c}from"./chunk-E66B27AL.mjs";oe();re();async function ie(e,t=100){try{let{stdout:r}=await L(`git log --name-only --pretty=format:'---COMMIT---' -${t}`,{cwd:e,maxBuffer:10485760}),n=r.split(`
|
|
9
|
-
`).reduce((o,i)=>{let m=i.trim();return m==="---COMMIT---"?(o.currentFiles&&o.currentFiles.size>0&&o.currentFiles.size<=30&&o.commits.push(o.currentFiles),o.currentFiles=new Set):m&&o.currentFiles&&ce(m)&&o.currentFiles.add(m),o},{commits:[],currentFiles:null});return n.currentFiles&&n.currentFiles.size>0&&n.currentFiles.size<=30&&n.commits.push(n.currentFiles),n.commits}catch{return[]}}c(ie,"parseGitLog");function ce(e){return/\.(ts|tsx|js|jsx|mjs|cjs|py|go|rs|java|cs|rb|php|vue|svelte)$/i.test(e)&&!e.includes("node_modules/")}c(ce,"isSourceFile");async function ae(e,t=100){let r=await ie(e,t),n=new Map,o=new Map;for(let m of r){let p=Array.from(m);for(let g of p)n.set(g,(n.get(g)||0)+1);for(let[g,f]of p.entries())for(let d of p.slice(g+1)){let h=le(f,d);o.set(h,(o.get(h)||0)+1)}}let i={};for(let[m,p]of o){let[g,f]=m.split("\0"),d=n.get(g)||0,h=n.get(f)||0;if(d<2||h<2)continue;let s=d+h-p,a=s>0?p/s:0;a<.1||(i[g]||(i[g]={}),i[f]||(i[f]={}),i[g][f]=a,i[f][g]=a)}return{matrix:i,commitsAnalyzed:r.length,filesAnalyzed:n.size,builtAt:new Date().toISOString()}}c(ae,"buildMatrix");function le(e,t){return e<t?`${e}\0${t}`:`${t}\0${e}`}c(le,"pairKey");function _(e,t){let r=new Set(e),n=new Map;for(let o of e){let i=t.matrix[o];if(i)for(let[m,p]of Object.entries(i)){if(r.has(m))continue;let g=n.get(m)||0;p>g&&n.set(m,p)}}return Array.from(n.entries()).map(([o,i])=>({path:o,score:i})).sort((o,i)=>i.score-o.score)}c(_,"scoreFromSeeds");var N="cochange-index",R=new Map;function me(e,t){w.setDoc(e,N,t),R.delete(e)}c(me,"saveMatrix");function F(e){let t=w.get(e,"SELECT updated_at FROM kv_store WHERE key = ?",N);if(!t)return R.delete(e),null;let r=R.get(e);if(r&&r.updatedAt===t.updated_at)return r.matrix;let n=w.getDoc(e,N);return n&&R.set(e,{matrix:n,updatedAt:t.updated_at}),n}c(F,"loadMatrix");async function ge(e,t){try{let{stdout:r}=await L(`git rev-list --max-count=${t} HEAD`,{cwd:e,maxBuffer:1048576}),n=r.split(`
|
|
10
|
-
`).map(o=>o.trim()).filter(Boolean);return n.length>0?n.join(`
|
|
11
|
-
`):null}catch{return null}}c(ge,"recentHistoryFingerprint");async function xe(e,t,r=100){let n=await ge(e,r),o=n?F(t):null;if(o?.historyFingerprint===n)return o;let i=await ae(e,r);return n&&(i.historyFingerprint=n),me(t,i),i}c(xe,"indexCoChanges");function E(e){if(e.length===0)return[];let t=e[0]?.score||1;return e.map(r=>({path:r.path,score:r.score/t}))}c(E,"normalize");var M=[{name:"bm25",kind:"query",defaultWeight:.45,hasIndex:c(e=>A(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(B(e,t,r)),"scoreFromQuery")},{name:"symbols",kind:"query",defaultWeight:.2,hasIndex:c(e=>H(e),"hasIndex"),scoreFromQuery:c((e,t,r)=>E(z(e,t,r)),"scoreFromQuery")},{name:"imports",kind:"seed",defaultWeight:.2,hasIndex:c(e=>C(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t,r)=>{let n=C(e);return n?E(W(t,n,r.importDepth)):[]},"scoreFromSeeds")},{name:"cochange",kind:"seed",defaultWeight:.15,hasIndex:c(e=>F(e)!==null,"hasIndex"),scoreFromSeeds:c((e,t)=>{let r=F(e);return r?E(_(t,r)):[]},"scoreFromSeeds")}];var pe={bm25Weight:.45,importWeight:.2,cochangeWeight:.15,symbolsWeight:.2,topN:15,importDepth:2},P=10;function Q(e,t,r={}){let n={...pe,...r},o={bm25:n.bm25Weight,symbols:n.symbolsWeight,imports:n.importWeight,cochange:n.cochangeWeight},i=M.filter(s=>s.kind==="query"),m=M.filter(s=>s.kind==="seed"),p=new Map,g=new Map;for(let s of i){let a=s.scoreFromQuery(e,t,n.topN*3);if(a.length!==0){p.set(s.name,new Map(a.map(u=>[u.path,u.score])));for(let u of a.slice(0,P))g.set(u.path,Math.max(g.get(u.path)??0,u.score))}}if(p.size===0)return[];let f=[...g.entries()].sort((s,a)=>a[1]-s[1]).slice(0,P).map(([s])=>s);for(let s of m){let a=s.scoreFromSeeds(e,f,{importDepth:n.importDepth});a.length!==0&&p.set(s.name,new Map(a.map(u=>[u.path,u.score])))}let d=new Set;for(let s of p.values())for(let a of s.keys())d.add(a);let h=[];for(let s of d){let a=[...p].reduce((u,[l,y])=>{let b=y.get(s)??0,k=o[l]??M.find(S=>S.name===l)?.defaultWeight??0;return u+b*k},0);h.push({path:s,finalScore:a,signals:{bm25:p.get("bm25")?.get(s)??0,imports:p.get("imports")?.get(s)??0,cochange:p.get("cochange")?.get(s)??0,symbols:p.get("symbols")?.get(s)??0}})}return h.sort((s,a)=>a.finalScore-s.finalScore),h.slice(0,n.topN)}c(Q,"rankFiles");function U(e){let t={};for(let r of M)t[r.name]=r.hasIndex(e);return{bm25:t.bm25??!1,imports:t.imports??!1,cochange:t.cochange??!1,symbols:t.symbols??!1}}c(U,"hasIndexes");function K(e,t,r=8){let n=t.map(s=>s.trim()).filter(Boolean),o=!!C(e),i=!!F(e),m=new Map;if(n.length>0&&o)try{for(let s of W(n,C(e),2)){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("imports"),m.set(s.path,a)}}catch{}if(n.length>0&&i)try{for(let s of _(n,F(e))){if(n.some(u=>u.endsWith(s.path)||s.path.endsWith(u)))continue;let a=m.get(s.path)??{score:0,via:new Set};a.score+=s.score,a.via.add("cochange"),m.set(s.path,a)}}catch{}let p=[...m.entries()].map(([s,a])=>({path:s,score:a.score,via:a.via.size>1?"both":[...a.via][0]??"imports"})).sort((s,a)=>a.score-s.score).slice(0,r),g=[];for(let s of n.slice(0,5))try{let a=I.recallForFile(e,s,2,{preventiveOnly:!0});for(let u of a)g.push({id:u.id,type:u.type,title:u.content.replace(/\s+/g," ").trim().slice(0,100),file:s})}catch{}let f=p.length>0?`related=${p.slice(0,3).map(s=>s.path.split("/").pop()).join(",")}`:o||i?"related=none-strong":"indexes=cold",d=g.length>0?`traps=${g.length}`:"traps=0",h=n.length===0?"World model: no seed files":`World model impact: seeds=${n.length} \xB7 ${f} \xB7 ${d}`;return{seeds:n,neighbors:p,traps:g.slice(0,r),line:h,hasIndexes:{imports:o,cochange:i}}}c(K,"breakImpact");var Y=8,X=/(?:^|[\s`"'(])((?:@?[\w.-]+\/)+[\w.-]+\.[\w.-]+)(?:$|[\s`"'),;:])/g;function Te(e,t,r=Y){let n=t.trim();if(!n)return ne();let o=V(e,n);return J(e,n,o,r)}c(Te,"resolveWorkScopeSync");async function De(e,t,r,n=Y){let o=r.trim();if(!o)return ne();let i=new Set(V(t,o));try{let{enrichedRecall:m}=await import("./enriched-recall-W7KYRYVR.mjs"),p=await m(e,t,{topic:o,types:["context","decision","gotcha","anti-pattern","learning"],limit:12});for(let g of Z(p,t))i.add(g)}catch{}return J(t,o,i,n)}c(De,"resolveWorkScope");function J(e,t,r,n){let o=U(e),i=new Map,m=T(e),p=D(e),g=c((l,y,b,k)=>{if(!v(e,l))return;let S=y*O(e,l),x=i.get(l);if(!x){i.set(l,{path:l,score:S,signals:[b],reason:k});return}x.score+=S,x.signals.includes(b)||x.signals.push(b),S>=.4&&(x.reason=k)},"bump");for(let l of r)g(l,ue(l,p),"memory","linked from project judgment memory (decision/gotcha/context)");let f=(()=>{if(!(o.bm25||o.symbols))return[];try{return Q(e,t,{topN:Math.max(n*2,12)})}catch{return[]}})();for(let l of f){let y=l.signals.symbols??0,b=[l.signals.bm25>0?"bm25":null,y>0?"symbols":null,l.signals.imports>0?"imports":null,l.signals.cochange>0?"cochange":null].filter(x=>x!==null),k=Math.max(l.signals.bm25,y,l.signals.imports,l.signals.cochange),S=y>=k&&y>0?"matches function/class/route symbols in code graph":l.signals.bm25>=l.signals.imports&&l.signals.bm25>=l.signals.cochange?"matches task terms in code index (BM25)":l.signals.imports>=l.signals.cochange?"import-graph neighbor of matched files":"historically co-changes with matched files";g(l.path,l.finalScore,b[0]??"bm25",S);for(let x of b.slice(1)){let $=i.get(l.path);$&&!$.signals.includes(x)&&$.signals.push(x)}}let d=f.length,h=[...i.keys()].slice(0,5);h.length===0&&r.size>0&&h.push(...[...r].slice(0,5));let s=(()=>{if(h.length===0)return null;try{return K(e,h,n)}catch{return null}})();if(s)for(let l of s.neighbors)g(l.path,.35*Math.min(1,l.score+.1),l.via==="both"?"imports":l.via,l.via==="cochange"?"historically co-changes with seed files":"import-graph neighbor of seed files");let a=s?.neighbors.length??0,u=[...i.values()].sort((l,y)=>y.score-l.score).slice(0,n);return{files:u,indexesReady:o.bm25||o.imports||o.cochange||o.symbols,sources:{memorySeeds:r.size,indexHits:d,graphNeighbors:a},agentBlock:fe(u,{indexesReady:o.bm25||o.imports||o.cochange||o.symbols,memorySeeds:r.size,inventoryLine:G(m)})}}c(J,"mergeScope");function V(e,t){let r=new Set;try{let n=t.split(/\s+/).filter(m=>m.length>2).slice(0,12),o=n.length>0?(()=>{try{return I.searchFts(e,n,15)}catch{return[]}})():[],i=o.length>0?o:I.recall(e,{types:["gotcha","decision","anti-pattern","context"],limit:20});for(let m of Z(i,e))r.add(m)}catch{}return r}c(V,"memoryFileSeedsSync");function Z(e,t){let r=new Set,n=c(o=>{let i=ee(o);i&&(t?v(t,i)&&r.add(i):te(i)&&r.add(i))},"accept");for(let o of e){let i=o.tags?.file?.trim();i&&n(i);let m=o.tags?.files?.trim();if(m)for(let g of m.split(",")){let f=g.trim();f&&n(f)}let p=o.content??"";X.lastIndex=0;for(let g of p.matchAll(X))n(g[1])}return[...r]}c(Z,"extractFilePathsFromEntries");function ee(e){return e.replace(/^\.\//,"").replace(/\\/g,"/")}c(ee,"normalizePath");function te(e){let t=ee(e).trim();return!t||t.length<3?!1:t.includes("/")&&t.includes(".")}c(te,"looksLikeRepoPath");function ue(e,t){let r=(e.split("/").pop()??e).toLowerCase(),n=r.includes(".")?`.${r.split(".").pop()}`:"";return r==="package.json"||r==="cargo.toml"||r==="go.mod"?.4:t.size>0&&n&&t.has(n)?e.includes("/")?.9:.75:e.includes("/")&&r.includes(".")?.7:.5}c(ue,"memorySeedWeight");function ne(){return{files:[],indexesReady:!1,sources:{memorySeeds:0,indexHits:0,graphNeighbors:0},agentBlock:""}}c(ne,"emptyResult");function fe(e,t){if(e.length===0)return t?.indexesReady===!1?["**Work scope (prjct):** indexes cold \u2014 run `prjct sync` once, then re-resolve scope.",t.inventoryLine?`_${t.inventoryLine}_`:"","Until then: prefer `prjct search` / `prjct context memory <topic>` over raw Grep/Glob walks."].filter(Boolean).join(`
|
|
12
|
-
`):["**Work scope (prjct):** no high-confidence file hits for this query.",t?.inventoryLine?`_${t.inventoryLine}_`:"","MUST still try `prjct context memory <topic>` + `prjct search` before a broad Grep/Glob walk."].filter(Boolean).join(`
|
|
13
|
-
`);let r=["**Work scope \u2014 prjct (MUST read before Grep/Glob):**","> Do NOT walk the tree. Open these first. Expand only via `prjct guard <file>` (graph neighbors + traps) or MCP `prjct_relevant_files` / `prjct_impact_analysis`.",...e.map(n=>{let o=n.signals.length>0?` (${n.signals.join("+")})`:"";return`- \`${n.path}\` \u2014 ${n.reason}${o}`})];return t?.memorySeeds&&t.memorySeeds>0&&r.push(`_Seeded from ${t.memorySeeds} memory path hit(s) + code index + graph._`),t?.inventoryLine&&r.push(`_${t.inventoryLine}_`),r.join(`
|
|
14
|
-
`)}c(fe,"formatWorkScopeBlock");function Oe(e){return e.map(({path:t,signals:r,reason:n})=>({path:t,signals:r,reason:n}))}c(Oe,"toLikelyFileHits");function Ge(e,t){return t?v(t,e):te(e)}c(Ge,"isUsefulScopePath");export{F as a,xe as b,Te as c,De as d,Z as e,fe as f,Oe as g,Ge as h};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as j,b as f,d as x,e as D}from"./chunk-7OZDWT6C.mjs";import{b as A}from"./chunk-YJMWY4Y6.mjs";import{e as C,f as M,g as w,h as E,m as R}from"./chunk-NJAMZSHM.mjs";import{a as b}from"./chunk-3WY2AYPE.mjs";import{a as S,b as J,d as m,g as K}from"./chunk-HDHVBB6Q.mjs";import{a as l}from"./chunk-E66B27AL.mjs";J();import g from"node:fs/promises";import d from"node:path";K();var U=/^(main|index|app|server|cli|handler|router|bootstrap|init|start|run|default)$/i;function I(t){let e=M(t);if(!C(t))return{ready:!1,builtAt:e?.builtAt??null,symbols:0,edges:0,files:0,languages:[],kinds:[],routes:[],hotspots:[],entryCandidates:[],packages:[],note:"No symbol index. Run `prjct sync` or `prjct code reindex`."};let r=w(t),s=new Map,a=new Map,o=new Map,p=[],c=[];for(let i of r){s.set(i.kind,(s.get(i.kind)??0)+1),a.set(i.file,(a.get(i.file)??0)+1);let u=i.file.includes(".")?i.file.slice(i.file.lastIndexOf(".")):"(none)";o.set(u,(o.get(u)??0)+1),i.kind==="route"&&p.push({name:i.name,file:i.file,line:i.startLine}),i.exported&&U.test(i.name)&&(i.kind==="function"||i.kind==="class")&&!/__tests__|\.test\.|\.spec\.|fixtures?\//i.test(i.file)&&c.push({name:i.name,file:i.file,kind:i.kind})}let y=[...a.keys()],h=[],W=R(t),Y=y.length>400?y.slice(0,400):y;for(let i of Y){let u=W.get(i)??0;u>0&&h.push({file:i,fanIn:u,symbolCount:a.get(i)??0})}h.sort((i,u)=>u.fanIn-i.fanIn);let k=new Set,v=A(t);if(v)for(let i of Object.keys(v.forward).slice(0,2e3)){let u=i.includes("/")?i.slice(0,i.indexOf("/")):i;u&&!u.startsWith(".")&&k.add(u)}for(let i of y.slice(0,2e3)){let u=i.includes("/")?i.slice(0,i.indexOf("/")):".";u&&u!=="."&&k.add(u)}if(c.length<8)for(let i of r){if(c.length>=12)break;i.exported&&i.kind==="class"&&!c.some(u=>u.file===i.file)&&c.push({name:i.name,file:i.file,kind:i.kind})}return{ready:!0,builtAt:e?.builtAt??null,symbols:e?.symbolCount??r.length,edges:e?.edgeCount??0,files:e?.fileCount??a.size,languages:[...o.entries()].map(([i,u])=>({ext:i,count:u})).sort((i,u)=>u.count-i.count).slice(0,12),kinds:[...s.entries()].map(([i,u])=>({kind:i,count:u})).sort((i,u)=>u.count-i.count),routes:p.slice(0,30),hotspots:h.slice(0,15),entryCandidates:c.slice(0,15),packages:[...k].sort().slice(0,40),note:"Structural only (symbol + import graphs). Narrative architecture lives in prjct analysis / memory decisions."}}l(I,"buildArchitectureSnapshot");function T(t,e){let n=[];if(!t)return{hasChanges:!0,items:[{field:"Project style",type:"added",after:e.summary}],summary:{added:1,removed:0,changed:0},beforeCommit:null,afterCommit:e.commitHash};let r=t.payload,s=e.payload;r.stack.ecosystem!==s.stack.ecosystem&&n.push({field:"Ecosystem",type:"changed",before:r.stack.ecosystem,after:s.stack.ecosystem}),(r.stack.packageManager??"")!==(s.stack.packageManager??"")&&n.push({field:"Package manager",type:"changed",before:r.stack.packageManager??"(none)",after:s.stack.packageManager??"(none)"}),P("Languages",r.stack.languages,s.stack.languages,n),P("Frameworks",r.stack.frameworks,s.stack.frameworks,n),P("Key libraries",r.stack.keyLibraries,s.stack.keyLibraries,n),r.stack.hasTests!==s.stack.hasTests&&n.push({field:"Has tests",type:"changed",before:String(r.stack.hasTests),after:String(s.stack.hasTests)}),_("Pattern",r.patterns.map(c=>[c.key,c.name]),s.patterns.map(c=>[c.key,c.name]),n),_("Anti-pattern",r.antiPatterns.map(c=>[c.key,c.issue]),s.antiPatterns.map(c=>[c.key,c.issue]),n),_("Convention",r.conventions.map(c=>[c.key,c.rule]),s.conventions.map(c=>[c.key,c.rule]),n),r.structural.symbols!==s.structural.symbols&&(r.structural.symbols>0||s.structural.symbols>0)&&n.push({field:"Symbols",type:"changed",before:String(r.structural.symbols),after:String(s.structural.symbols)}),r.structural.files!==s.structural.files&&n.push({field:"Files",type:"changed",before:String(r.structural.files),after:String(s.structural.files)});let a=n.filter(c=>c.type==="added").length,o=n.filter(c=>c.type==="removed").length,p=n.filter(c=>c.type==="changed").length;return{hasChanges:n.length>0,items:n,summary:{added:a,removed:o,changed:p},beforeCommit:t.commitHash,afterCommit:e.commitHash}}l(T,"generateProjectStyleDiff");function O(t){if(!t.hasChanges)return`## Project evolution
|
|
9
|
-
|
|
10
|
-
No style changes since last sync.`;let e=["## Project evolution (this sync)"];(t.beforeCommit||t.afterCommit)&&e.push(`> \`${L(t.beforeCommit)}\` \u2192 \`${L(t.afterCommit)}\``),e.push(""),e.push(`+${t.summary.added} \xB7 \u2212${t.summary.removed} \xB7 ~${t.summary.changed}`),e.push("");for(let n of t.items.slice(0,20)){let r=n.type==="added"?"+":n.type==="removed"?"\u2212":"~";n.type==="changed"?e.push(`- ${r} **${n.field}**: ${n.before} \u2192 ${n.after}`):n.type==="added"?e.push(`- ${r} **${n.field}**: ${n.after}`):e.push(`- ${r} **${n.field}**: ${n.before}`)}return e.join(`
|
|
11
|
-
`)}l(O,"formatProjectStyleDiffMd");function L(t){return t?t.length>7?t.slice(0,7):t:"(none)"}l(L,"short");function P(t,e,n,r){let s=new Set(e.map(o=>o.toLowerCase())),a=new Set(n.map(o=>o.toLowerCase()));for(let o of n)s.has(o.toLowerCase())||r.push({field:t,type:"added",after:o});for(let o of e)a.has(o.toLowerCase())||r.push({field:t,type:"removed",before:o})}l(P,"diffStringArray");function _(t,e,n,r){let s=new Map(e),a=new Map(n);for(let[o,p]of a)s.has(o)?s.get(o)!==p&&r.push({field:t,type:"changed",before:s.get(o),after:p}):r.push({field:t,type:"added",after:p});for(let[o,p]of s)a.has(o)||r.push({field:t,type:"removed",before:p})}l(_,"diffKeyed");var F=50;function B(t){let e=(()=>{try{return JSON.parse(t.payload_json)}catch{return q()}})();return{id:t.id,capturedAt:t.captured_at,commitHash:t.commit_hash,source:t.source||"sync-mechanical",patternCount:t.pattern_count,antiPatternCount:t.anti_pattern_count,conventionCount:t.convention_count,frameworkCount:t.framework_count,symbolCount:t.symbol_count,fileCount:t.file_count,summary:t.summary,payload:e}}l(B,"rowToSnapshot");function q(){return{payloadVersion:1,stack:{ecosystem:"unknown",languages:[],frameworks:[],keyLibraries:[],hasTests:!1,hasDocker:!1},commands:{},conventions:[],patterns:[],antiPatterns:[],structural:{symbols:0,files:0,packages:[]},metrics:{}}}l(q,"emptyPayload");function H(t){try{let e=m.get(t,"SELECT * FROM project_style_snapshots WHERE is_active = 1 ORDER BY captured_at DESC LIMIT 1");return e?B(e):null}catch{return null}}l(H,"getActiveProjectStyle");function G(t,e=12){try{return m.query(t,"SELECT * FROM project_style_snapshots ORDER BY captured_at DESC LIMIT ?",e).map(B)}catch{return[]}}l(G,"getProjectEvolution");function St(t,e=6){let n=G(t,e);if(n.length===0)return null;let r=["## Project evolution"];if(n.length>=2){let s=n[0],a=n[n.length-1],o=s.patternCount-a.patternCount,p=s.conventionCount-a.conventionCount,c=s.fileCount-a.fileCount;r.push(`Over ${n.length} snapshots: patterns ${$(o)}, conventions ${$(p)}, files ${$(c)}.`)}for(let s of n)r.push(`- ${s.capturedAt.slice(0,10)} \u2014 ${s.summary}`);return r.join(`
|
|
12
|
-
`)}l(St,"renderProjectEvolution");function $(t){return t>=0?`+${t}`:`${t}`}l($,"fmtDelta");function V(t,e){m.transaction(t,n=>{n.prepare("UPDATE project_style_snapshots SET is_active = 0 WHERE is_active = 1").run(),n.prepare(`INSERT INTO project_style_snapshots (
|
|
13
|
-
id, captured_at, commit_hash, source,
|
|
14
|
-
pattern_count, anti_pattern_count, convention_count, framework_count,
|
|
15
|
-
symbol_count, file_count, summary, payload_json, is_active
|
|
16
|
-
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)`).run(e.id,e.capturedAt,e.commitHash,e.source,e.patternCount,e.antiPatternCount,e.conventionCount,e.frameworkCount,e.symbolCount,e.fileCount,e.summary,JSON.stringify(e.payload));let r=n.prepare("SELECT id FROM project_style_snapshots ORDER BY captured_at DESC").all();if(r.length>F){let s=r.slice(F),a=n.prepare("DELETE FROM project_style_snapshots WHERE id = ?");for(let o of s)a.run(o.id)}})}l(V,"persistProjectStyleSnapshot");async function bt(t){let e=H(t.projectId),n=Q(t.projectId),r=await tt(t.projectPath),s=X(t.projectId),a=Z(t.projectId),o=x({stats:t.stats,stack:t.stack,commands:t.commands,packageDeps:r.deps,packageManager:r.packageManager,llmAnalysis:n,memoryPatterns:a.patterns,memoryAntiPatterns:a.antiPatterns,memoryConventions:a.conventions,structural:s,commitHash:t.commitHash??null,source:t.source??"sync-mechanical"});o.payload.metrics.styleCoverage=z(o),o.payload.metrics.hasRichAnalysis=f(n)?1:0;let p=T(e,o),c=e===null;(c||p.hasChanges)&&V(t.projectId,o);let y=H(t.projectId)??o;return t.bridgeMemory!==!1&&await nt(t.projectPath,t.projectId,y).catch(()=>{}),await st(t.projectId,y).catch(()=>{}),{snapshot:y,delta:p,isFirst:c}}l(bt,"recomputeProjectStyle");function z(t){let e=(t.payload.stack.ecosystem!=="unknown"?25:0)+(t.payload.stack.frameworks.length>0||t.payload.stack.keyLibraries.length>0?20:0)+(t.payload.stack.hasTests?10:0)+Math.min(25,t.conventionCount*5)+Math.min(15,t.patternCount*3)+Math.min(5,t.antiPatternCount);return Math.min(100,e)}l(z,"computeStyleCoverage");function Q(t){try{let e=j.getActive(t);if(f(e))return e;try{let n=j.getAllFull(t);for(let r of n)if(f(r.analysis))return r.analysis}catch{}return e}catch{return null}}l(Q,"pickBestAnalysis");function X(t){try{let e=I(t);return e.ready?{symbols:e.symbols,files:e.files,packages:e.packages.slice(0,20)}:{symbols:0,files:0,packages:[]}}catch{return{symbols:0,files:0,packages:[]}}}l(X,"loadStructural");function Z(t){let e=[],n=[],r=[];try{let s=b.recall(t,{types:["pattern","anti-pattern","decision"],limit:40});for(let a of s){let o=a.tags?.topic??"";!o.startsWith("style:")&&a.type!=="pattern"&&a.type!=="anti-pattern"||(a.type==="pattern"||o.startsWith("style:pattern:")?e.push({name:a.tags?.name||o.replace(/^style:pattern:/,"")||"pattern",description:a.content.slice(0,400)}):a.type==="anti-pattern"||o.startsWith("style:anti:")?n.push({issue:a.tags?.name||o.replace(/^style:anti:/,"")||"anti-pattern",suggestion:a.content.slice(0,400)}):o.startsWith("style:convention:")&&r.push({rule:a.content.slice(0,400),category:a.tags?.category}))}}catch{}return{patterns:e,antiPatterns:n,conventions:r}}l(Z,"loadMemoryStyle");async function tt(t){try{let e=await g.readFile(d.join(t,"package.json"),"utf-8"),n=JSON.parse(e),r={...n.dependencies??{},...n.devDependencies??{}},s=n.packageManager?n.packageManager.split("@")[0]??null:await(async()=>{let a=[["bun.lockb","bun"],["bun.lock","bun"],["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"]];for(let[o,p]of a)try{return await g.access(d.join(t,o)),p}catch{}return null})();return{deps:r,packageManager:s}}catch{return{deps:{},packageManager:null}}}l(tt,"readPackageMeta");function et(t){let e=t.payload,n=[...e.conventions.slice(0,25).map(s=>({type:"decision",content:s.rule,tags:{topic:`style:convention:${s.key}`,category:s.category??"convention",source:"project-style"}})),...e.patterns.slice(0,25).map(s=>({type:"pattern",content:`${s.name}: ${s.description}`,tags:{topic:`style:pattern:${s.key}`,name:s.name,source:"project-style",...s.category?{category:s.category}:{}}})),...e.antiPatterns.slice(0,25).map(s=>({type:"anti-pattern",content:`${s.issue}. Suggestion: ${s.suggestion}`,tags:{topic:`style:anti:${s.key}`,name:s.issue,source:"project-style",...s.severity?{severity:s.severity}:{}}}))],r=new Set;return n.filter(s=>{let a=`${s.type}\0${S(s.content)}`;return r.has(a)?!1:(r.add(a),!0)})}l(et,"desiredStyleBridgeEntries");function N(t,e,n){return`${t}\0${e}\0${n}`}l(N,"styleBridgeIdentity");async function nt(t,e,n){let r=et(n);if(r.length===0)return 0;let s=(()=>{try{let o=[...new Set(r.map(y=>y.tags.topic))],p=o.map(()=>"?").join(","),c=m.query(e,`SELECT type, topic_key, content_hash
|
|
17
|
-
FROM memory_entries
|
|
18
|
-
WHERE project_id = ? AND deleted_at IS NULL
|
|
19
|
-
AND topic_key IN (${p})`,e,...o);return new Set(c.map(y=>N(y.type,y.topic_key,y.content_hash)))}catch{return null}})(),a=[];for(let o of r){let p=o.tags.topic,c=N(o.type,p,S(o.content));s?.has(c)||(await b.remember(t,{...o,projectId:e,provenance:"extracted"}),a.push(o))}return a.length}l(nt,"bridgeStyleToMemory");async function st(t,e){let{default:n}=await import("./path-manager-F2HE2GGK.mjs"),r=n.getGlobalProjectPath(t),s=d.join(r,"analysis");await g.mkdir(s,{recursive:!0});let a=e.payload.stack,o={ecosystem:a.ecosystem,frameworks:a.frameworks,hasTests:a.hasTests,technologies:[...a.languages,...a.frameworks,...a.keyLibraries].filter((p,c,y)=>y.indexOf(p)===c),packageManager:a.packageManager??null,updatedAt:e.capturedAt,styleSummary:e.summary};await g.writeFile(d.join(s,"repo-analysis.json"),JSON.stringify(o,null,2),"utf-8")}l(st,"writeRepoAnalysisArtifact");function jt(t){let e=t.delta.hasChanges||t.isFirst?O(t.delta):null,n=D(t.snapshot,{maxConventions:4,maxPatterns:3,maxAnti:2});return{evolutionMd:e,digestMd:n,delta:t.delta}}l(jt,"formatProjectStyleForSync");export{H as a,G as b,St as c,V as d,bt as e,nt as f,jt as g};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{m as j,q as L,r as M}from"./chunk-AKIN5WSQ.mjs";import{a as E,b as a,c as S}from"./chunk-JQE2F2RK.mjs";import{j as C,n as I}from"./chunk-SVZHJZ5T.mjs";import{c as x}from"./chunk-7AN7VQHN.mjs";import{a as O}from"./chunk-SYHDEUVU.mjs";import{d as N,e as G}from"./chunk-P5ZYAXSE.mjs";import{a as R,e as l,f as k}from"./chunk-BUDZL4DW.mjs";import{a as c,e as b}from"./chunk-E66B27AL.mjs";k();I();M();import i from"node:fs/promises";import n from"node:path";import u from"node:fs/promises";import A from"node:path";k();var y='<!-- prjct:start - DO NOT REMOVE THIS MARKER -->\n# p/ \u2014 Project knowledge layer\n\nprjct stores project memory (decisions, learnings, gotchas, patterns, ships, analyses) per project in SQLite and serves it to you through tools. **Query it \u2014 don\'t re-read source from scratch.**\n\nprjct remembers and shows the path; it does not own execution. Treat prjct output as durable signals (task state, memories, specs, workflows, risks, recent learnings). Claude, GPT, and other agents decide the concrete HOW with their own native tools and judgment, then persist meaningful outcomes back to prjct.\n\nYou are in a prjct project when `.prjct/` is in cwd OR `~/.prjct-cli/projects/` has an entry for the current path.\n\n## Lookup FIRST, source LAST\n\nBefore reading source code or running broad searches for ANY question about the project (architecture, conventions, decisions, recent ships, bugs, patterns, tech debt, past analyses), QUERY prjct first \u2014 bounded, ranked answers from SQLite, no markdown trees to wade through:\n\n- `prjct context memory <topic>` / `prjct search "<q>"` \u2014 captured decisions, gotchas, learnings, facts\n- `prjct context --md` \u2014 current state: active cycle, ships, recent learnings\n- architecture / conventions / patterns / anti-patterns / tech-debt / insights \u2192 MCP `prjct_analysis` (add `mode:archive` for history)\n- developer preferences \u2192 MCP `prjct_developer`; machine signals \u2192 MCP `prjct_signals`\n- specs \u2192 MCP `prjct_spec_list` / `prjct_spec_get`; per-file traps before editing \u2192 `prjct guard <file>`\n\nOnly fall through to source/repo reading when prjct does not contain the answer.\n\n**Skill \u2260 project identity.** The prjct skill is a portable multi-LLM contract (L0). Live name/stack/branch come from SessionStart + `prjct context --md` for **this cwd**. If skill text and the tree disagree, trust the cwd and the tree.\n\n## Capture analyses BACK to prjct\n\nWhen you complete substantive work \u2014 analysis, decision, learning, gotcha \u2014 persist it: `prjct remember <decision|learning|gotcha|fact> "..."` or `prjct capture "<text>" --tags k:v`. **Author every entry in ENGLISH**, whatever language the user speaks. **Default to capturing \u2014 under-capture is the failure mode that makes prjct useless.** The full verb map and task workflow live in the `prjct` skill.\n\n## Where things live\n\n- Source of truth: SQLite at `~/.prjct-cli/projects/<id>/` (don\'t read directly \u2014 use `prjct` CLI / MCP tools)\n- Project config: `.prjct/prjct.config.json` in repo root\n\n**Auto-managed by prjct-cli** | https://prjct.app\n<!-- prjct:end - DO NOT REMOVE THIS MARKER -->\n';async function P(){let m=(M(),b(L)),t=await m.getActiveProvider(),e=t.name;if(!(await m.detectProvider(e)).installed&&!t.configDir)return{success:!1,error:`${t.displayName} not detected`,action:"skipped"};try{await u.mkdir(t.configDir,{recursive:!0});let s=A.join(t.configDir,t.contextFile),p=await(async()=>{if(e==="claude")return y;let o=x(`global/${t.contextFile}`);if(o)return o;let{PACKAGE_ROOT:g}=(G(),b(N)),T=A.join(g,"templates","global",t.contextFile);return u.readFile(T,"utf-8").catch(()=>e==="gemini"?y.replace(/Claude/g,"Gemini"):y)})(),r=await u.readFile(s,"utf-8").then(o=>({content:o,exists:!0})).catch(o=>{if(R(o))return{content:"",exists:!1};throw o}),h="<!-- prjct-project:start - DO NOT REMOVE THIS MARKER -->",f="<!-- prjct-project:end - DO NOT REMOVE THIS MARKER -->",D=(()=>{if(!r.content.includes(h)||!r.content.includes(f))return r.content;let o=r.content.substring(0,r.content.indexOf(h)),g=r.content.substring(r.content.indexOf(f)+f.length);return`${(o+g).replace(/\n{3,}/g,`
|
|
9
|
-
|
|
10
|
-
`).trim()}
|
|
11
|
-
`})(),w=O(r.exists?D:"",p,"<!-- prjct:start - DO NOT REMOVE THIS MARKER -->","<!-- prjct:end - DO NOT REMOVE THIS MARKER -->");return await u.writeFile(s,w.content,"utf-8"),{success:!0,action:w.action,path:s}}catch(s){return{success:!1,error:l(s),action:"failed"}}}c(P,"installGlobalConfig");S();async function et(){return P()}c(et,"installGlobalConfig");var v=class{static{c(this,"CommandInstaller")}commandsPath="";configPath="";_initialized=!1;async ensureInit(){if(this._initialized)return;let t=await j();this.configPath=t.configDir??"",this.commandsPath=this.configPath?n.join(this.configPath,"commands"):"",this._initialized=!0}async detectActiveProvider(){return await this.ensureInit(),C(this.configPath)}async installCommands(){let t=await this.detectActiveProvider(),e=await j();return t?(await this.cleanupRouter(),{success:!0,installed:[],path:this.commandsPath}):{success:!1,error:`${e.displayName} not detected. Please install it first.`}}async uninstallCommands(){try{let t=[];await this.ensureInit();for(let e of["p.md","p.toml"]){let d=n.join(this.commandsPath,e);try{await i.unlink(d),t.push(e)}catch(s){if(s.code!=="ENOENT")return{success:!1,error:l(s)}}}return{success:!0,uninstalled:t}}catch(t){return{success:!1,error:l(t)}}}async checkInstallation(){return await this.detectActiveProvider()?{installed:!0,providerDetected:!0,commands:[],path:this.commandsPath}:{installed:!1,providerDetected:!1}}async getInstallPath(){return await this.ensureInit(),this.commandsPath}async syncCommands(){if(!await this.detectActiveProvider())return{success:!1,error:"AI agent not detected",added:0,updated:0,removed:0};try{return{success:!0,added:0,updated:0,removed:await this.cleanupRouter()?1:0}}catch(e){return{success:!1,error:l(e),added:0,updated:0,removed:0}}}async cleanupRouter(){return await this.ensureInit(),(await Promise.all(["p.md","p.toml"].map(async e=>{try{return await i.unlink(n.join(this.commandsPath,e)),!0}catch{return!1}}))).some(Boolean)}async cleanupLegacyCommands(){await this.ensureInit();let t=n.join(this.commandsPath,"p");try{if((await i.stat(t).catch(()=>null))?.isDirectory())return await i.rm(t,{recursive:!0,force:!0}),!0}catch{}return!1}async installGlobalConfig(){return P()}async cleanupAllLegacy(){let t=E(),e=[],d=[n.join(t,".claude","commands","p.md"),n.join(t,".claude","commands","p.toml"),n.join(t,".gemini","commands","p.md"),n.join(t,".gemini","commands","p.toml")];for(let r of d)try{await i.unlink(r),e.push(r)}catch{}let s=[n.join(t,".claude","commands","p"),n.join(t,".gemini","commands","p")];for(let r of s)try{(await i.stat(r).catch(()=>null))?.isDirectory()&&(await i.rm(r,{recursive:!0,force:!0}),e.push(r))}catch{}let p=[n.join(t,".prjct-cli","config","homebrew-migrated")];for(let r of p)try{await i.unlink(r),e.push(r)}catch{}return{cleaned:e}}};function rt(){return{claude:{commands:a(".claude","commands"),config:a(".claude"),router:a(".claude","commands","p.md")},gemini:{commands:a(".gemini","commands"),config:a(".gemini"),router:a(".gemini","commands","p.toml")}}}c(rt,"getProviderPaths");var _=new v,nt=_;export{et as a,v as b,rt as c,nt as d};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as y}from"./chunk-3WY2AYPE.mjs";import{d as p,g as w}from"./chunk-HDHVBB6Q.mjs";import{a as i}from"./chunk-E66B27AL.mjs";import{execFileSync as E}from"node:child_process";w();var f="land-auto",j="session-close";async function C(t){let n=S(t);if(!n)return{wrote:!1,content:null,reason:"nothing-to-land"};try{return await y.remember(t.projectPath,{type:"context",content:n,tags:{source:f,topic:j,capture:"land-v2",context_schema:"living-v2",synthesis:"deterministic"},provenance:"extracted",projectId:t.projectId}),{wrote:!0,content:n}}catch(e){return{wrote:!1,content:n,reason:`remember-failed: ${e.message}`}}}i(C,"synthesizeLandHandoff");function S(t){let n=t.cycleDescription?.trim()||null,e=L(t.projectId,t.cycleId),h=x(t.projectPath),a=k(t.projectId);if(!n&&e.length===0&&h.length===0&&a.length===0)return null;let o=[];n?o.push(`Session close: Work cycle "${c(n,120)}" still open or just closed.`):o.push("Session close: no open work cycle \u2014 landed repo + capture signals only."),o.push("Context synthesis: Passive land hand-off from durable signals (cycle, journal, commits, auto-captures). Not a model essay."),o.push(`Key data: source=${f}; topic=${j}; capture=land-v2`);let l=[];if(n&&l.push(`cycle="${c(n,100)}"`),e.length>0&&l.push(`journal: ${e.map(s=>c(s,70)).join(" \xB7 ")}`),l.length>0&&o.push(`What happened: ${l.join("; ")}`),e.length>0&&o.push(`Why it mattered: Journal trail shows progression \u2014 ${e.slice(0,2).map(s=>c(s,80)).join(" \xB7 ")}`),a.length>0){let s=a.filter(r=>r.type==="learning"||r.type==="decision"||r.type==="fact").slice(0,4),u=a.filter(r=>r.type==="gotcha"||r.type==="anti-pattern").slice(0,3);s.length>0&&o.push(`Learned this session: ${s.map(r=>`[${r.type}] ${c(r.content,100)}`).join(" \xB7 ")}`),u.length>0&&o.push(`Decision/trap: ${u.map(r=>`[${r.type}] ${c(r.content,100)}`).join(" \xB7 ")}`);let I=new Set([...s,...u]),g=a.filter(r=>!I.has(r)).slice(0,3);g.length>0&&s.length===0&&u.length===0&&o.push(`Decision/trap: ${g.map(r=>`[${r.type}] ${c(r.content,100)}`).join(" \xB7 ")}`)}h.length>0&&o.push(`Outcome: Recent commits: ${h.join("; ")}`),t.author&&o.push(`Who/author: ${t.author}`),t.model&&o.push(`Model: ${t.model}`);let m=t.tokensIn,d=t.tokensOut;if(m!=null||d!=null){let s=(m??0)+(d??0);o.push(`Token usage: in=${m??0} out=${d??0} total=${s} (compound judgment \u2014 not a fresh-window thrash loop)`)}o.push("Feature/domain: session-close"),o.push("Pattern: land auto-synthesis without agent remember"),o.push("Anti-pattern: relying on the model to remember to remember at session end"),o.push("Competitive: next window must `prjct prime` \u2014 act as this developer with SQLite judgment, not re-research from zero (GSD tax).");let $=n!=null?"Finish or pause the open cycle (`prjct status done` / `prjct pause`); next agent should `prjct work --md` or `prjct prime`.":"Next agent: `prjct prime` then pick from `prjct next --md`.";return o.push(`Next implication: ${$}`),o.join(" \xB7 ")}i(S,"buildLandHandoffContent");function L(t,n){try{return n?p.query(t,"SELECT content FROM task_log WHERE task_id = ? ORDER BY id DESC LIMIT 5",n).map(e=>e.content):p.query(t,"SELECT content FROM task_log ORDER BY id DESC LIMIT 5").map(e=>e.content)}catch{return[]}}i(L,"recentJournal");function x(t){try{return E("git",["log","-5","--oneline","--no-decorate"],{cwd:t,encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
9
|
-
`).map(e=>e.trim()).filter(Boolean)}catch{return[]}}i(x,"recentCommits");function k(t){try{return p.query(t,`SELECT me.type, me.content
|
|
10
|
-
FROM memory_entries me
|
|
11
|
-
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
12
|
-
WHERE me.deleted_at IS NULL
|
|
13
|
-
AND t.key = 'source'
|
|
14
|
-
AND t.value IN ('transcript-auto', 'land-auto')
|
|
15
|
-
ORDER BY me.created_at DESC
|
|
16
|
-
LIMIT 8`).map(e=>({type:e.type,content:e.content}))}catch{return[]}}i(k,"recentAutoCaptures");function c(t,n){let e=t.replace(/\s+/g," ").trim();return e.length>n?`${e.slice(0,n-1)}\u2026`:e}i(c,"truncate");export{C as a,S as b};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as m,g as O}from"./chunk-HDHVBB6Q.mjs";import{a as E,b as _,c as b,d as I,e as v,n as C}from"./chunk-SVZHJZ5T.mjs";import{a as f}from"./chunk-E66B27AL.mjs";b();O();C();import w from"node:fs/promises";import d from"node:path";function G(t){let r=new RegExp(_.source,"g");return[...t.matchAll(r)].map(e=>e[1]).filter(e=>e.startsWith(".")||e.startsWith("@/"))}f(G,"extractImportSources");async function y(t,r,e){let n=t.startsWith("@/")?d.join(e,"src",t.slice(2)):d.resolve(d.dirname(d.join(e,r)),t);for(let o of E){let s=n+o;try{if((await w.stat(s)).isFile())return d.relative(e,s)}catch{}}return null}f(y,"resolveImport");async function R(t){let r=await I(t),e={},n={},o=await v(r,50,async s=>{try{let i=await w.readFile(d.join(t,s),"utf-8"),c=G(i),a=[];for(let u of c){let p=await y(u,s,t);p&&p!==s&&a.push(p)}return a.length>0?{filePath:s,imports:a}:null}catch{return null}});for(let{filePath:s,imports:i}of o){e[s]=i;for(let c of i)n[c]||(n[c]=[]),n[c].push(s)}return{forward:e,reverse:n,fileCount:r.length,edgeCount:o.reduce((s,i)=>s+i.imports.length,0),builtAt:new Date().toISOString()}}f(R,"buildGraph");function B(t,r,e=2){let n=new Set(t),o=new Map,s=[];for(let i of t){let c=r.forward[i]||[],a=r.reverse[i]||[];for(let u of[...c,...a])n.has(u)||s.push({file:u,depth:1})}for(let{file:i,depth:c}of s){if(c>e)continue;let a=1/(c+1),u=o.get(i);if(u){a>u.score&&o.set(i,{score:a,depth:c});continue}if(o.set(i,{score:a,depth:c}),c<e){let p=r.forward[i]||[],A=r.reverse[i]||[];for(let h of[...p,...A])!n.has(h)&&!o.has(h)&&s.push({file:h,depth:c+1})}}return Array.from(o.entries()).map(([i,{score:c,depth:a}])=>({path:i,score:c,depth:a})).sort((i,c)=>c.score-i.score)}f(B,"scoreFromSeeds");var l="import-graph",g=new Map;function x(t){return Object.values(t).reduce((r,e)=>r+e.length,0)}f(x,"countEdges");function D(t,r){let e=t.forward[r]||[];delete t.forward[r];for(let n of e){let o=(t.reverse[n]||[]).filter(s=>s!==r);o.length===0?delete t.reverse[n]:t.reverse[n]=o}}f(D,"removeOutgoingEdges");function T(t,r){let e=t.reverse[r]||[];delete t.reverse[r];let n=[];for(let o of e){let s=(t.forward[o]||[]).filter(i=>i!==r);s.length===0?delete t.forward[o]:t.forward[o]=s,n.push(o)}return n}f(T,"removeIncomingEdges");function F(t,r,e){if(e.length===0)return;let n=Array.from(new Set(e));t.forward[r]=n;for(let o of n)t.reverse[o]||(t.reverse[o]=[]),t.reverse[o].includes(r)||t.reverse[o].push(r)}f(F,"addEdges");async function M(t,r){try{let e=await w.readFile(d.join(t,r),"utf-8"),n=G(e),o=[];for(let s of n){let i=await y(s,r,t);i&&i!==r&&o.push(i)}return{filePath:r,imports:o}}catch{return null}}f(M,"importsForFile");function S(t){return{schemaVersion:2,fileCount:t.fileCount,edgeCount:t.edgeCount,builtAt:t.builtAt}}f(S,"graphMetadata");function L(t,r){try{m.transaction(t,e=>{e.prepare("DELETE FROM import_graph_edges").run();let n=e.prepare("INSERT INTO import_graph_edges (from_path, to_path, sort_order) VALUES (?, ?, ?)");for(let[o,s]of Object.entries(r.forward))for(let[i,c]of s.entries())n.run(o,c,i)})}catch{}}f(L,"replacePerFileEdges");function N(t,r,e,n){try{m.transaction(t,o=>{let s=o.prepare("DELETE FROM import_graph_edges WHERE from_path = ?"),i=o.prepare("INSERT INTO import_graph_edges (from_path, to_path, sort_order) VALUES (?, ?, ?)");for(let c of new Set([...e,...n]))s.run(c);for(let c of e){let a=r.forward[c]||[];for(let[u,p]of a.entries())i.run(c,p,u)}})}catch{}}f(N,"updatePerFileEdges");function P(t,r,e){try{let n=m.query(t,"SELECT from_path, to_path FROM import_graph_edges ORDER BY from_path, sort_order, to_path");if(n.length===0){if(e?.edgeCount===0){let a={forward:{},reverse:{},fileCount:e.fileCount,edgeCount:0,builtAt:e.builtAt};return g.set(t,{graph:a,updatedAt:r}),a}return null}let o={},s={};for(let a of n)o[a.from_path]||(o[a.from_path]=[]),o[a.from_path].push(a.to_path),s[a.to_path]||(s[a.to_path]=[]),s[a.to_path].push(a.from_path);let i=new Set;for(let[a,u]of Object.entries(o)){i.add(a);for(let p of u)i.add(p)}let c={forward:o,reverse:s,fileCount:e?.fileCount??i.size,edgeCount:n.length,builtAt:e?.builtAt??r};return g.set(t,{graph:c,updatedAt:r}),c}catch{return null}}f(P,"loadGraphFromPerFileEdges");function V(t,r){m.setDoc(t,l,S(r)),L(t,r),g.delete(t)}f(V,"saveGraph");function W(t,r,e,n){m.setDoc(t,l,S(r)),N(t,r,e,n),g.delete(t)}f(W,"saveGraphUpdate");function k(t){let r=m.get(t,"SELECT updated_at FROM kv_store WHERE key = ?",l);if(!r)return g.delete(t),null;let e=g.get(t);if(e&&e.updatedAt===r.updated_at)return e.graph;let n=m.getDoc(t,l),o=P(t,r.updated_at,n);if(o)return o;if(!n?.forward||!n?.reverse)return null;let s={forward:n.forward,reverse:n.reverse,fileCount:n.fileCount,edgeCount:n.edgeCount,builtAt:n.builtAt};return g.set(t,{graph:s,updatedAt:r.updated_at}),s}f(k,"loadGraph");async function q(t,r){let e=await R(t);return V(r,e),e}f(q,"indexImports");async function K(t,r,e,n=[]){let o=k(r);if(!o)return q(t,r);let s=new Set([...e,...n]);for(let a of s)D(o,a);let i=new Set;for(let a of n)for(let u of T(o,a))i.add(u);let c=await v(e,50,a=>M(t,a));for(let a of c)F(o,a.filePath,a.imports);return o.edgeCount=x(o.forward),o.builtAt=new Date().toISOString(),W(r,o,[...e,...i],n),o}f(K,"updateImportGraph");export{B as a,k as b,q as c,K as d};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as h,b as c,c as _,d as j}from"./chunk-2UC4DTDO.mjs";import{b as M,c as F}from"./chunk-CE4RCNC7.mjs";import"./chunk-WUHGODSQ.mjs";import{a as o}from"./chunk-E66B27AL.mjs";F();import b from"node:crypto";import i from"node:fs";import{connect as A}from"node:net";import P from"node:path";import l from"node:fs";import O from"node:path";var V=1024*1024;function C(n){try{return process.kill(n,0),!0}catch{return!1}}o(C,"isProcessRunning");function I(n=c.runDir()){return O.join(n,"daemon.spawn.lock")}o(I,"spawnLockPath");function N(n=c.runDir(),e=process.pid){l.mkdirSync(n,{recursive:!0});let t=I(n);for(let s of[0,1])try{let r=l.openSync(t,"wx");try{l.writeFileSync(r,`${e}
|
|
9
|
-
`)}catch{try{l.closeSync(r)}catch{}try{l.unlinkSync(t)}catch{}return null}return{fd:r,path:t}}catch{let r=(()=>{try{return parseInt(l.readFileSync(t,"utf-8").trim(),10)}catch{return null}})();if(r&&!Number.isNaN(r)&&C(r))return null;try{l.unlinkSync(t)}catch{return null}}return null}o(N,"tryAcquireSpawnLock");function E(n){if(n){try{l.closeSync(n.fd)}catch{}try{if(l.existsSync(n.path)){let e=l.readFileSync(n.path,"utf-8").trim();(e===String(process.pid)||e===`${process.pid}`)&&l.unlinkSync(n.path)}}catch{}}}o(E,"releaseSpawnLock");function v(n){if(!n||typeof n!="object"||!("code"in n))return null;let e=n.code;return typeof e=="string"?e:null}o(v,"systemErrorCode");function L(n){let e=v(n);return e==="ENOENT"||e==="ECONNREFUSED"}o(L,"shouldUnlinkDaemonSocket");async function S(){let n=c.socket(),e=h(n);if(!e&&!i.existsSync(n))return!1;try{return(await k({id:b.randomUUID(),command:"__ping",args:[],options:{},cwd:process.cwd()},{timeoutMs:1e3})).success}catch(t){if(!e&&L(t))try{i.unlinkSync(n)}catch{}return!1}}o(S,"isDaemonRunning");async function sn(){let n=c.socket(),e=c.pid();if(!h(n)&&!i.existsSync(n))return{running:!1};try{let s=await k({id:b.randomUUID(),command:"daemon",args:["status"],options:{},cwd:process.cwd()});if(s.success&&s.result)return s.result}catch{}return i.existsSync(e)?{running:!1,pid:parseInt(i.readFileSync(e,"utf-8").trim(),10),socketPath:n}:{running:!1}}o(sn,"getDaemonStatus");function k(n,e={}){let t=e.timeoutMs??_(n.command);return new Promise((s,r)=>{let f=c.socket(),a=A(f),p=[],u=new AbortController,d=setTimeout(()=>{u.signal.aborted||(u.abort(),a.destroy(),r(new Error("Daemon request timed out")))},t);a.on("connect",()=>{a.write(j(n))}),a.on("data",y=>{p.push(y.toString());let m=p.join("");if(m.length>8*1024*1024){u.signal.aborted||(u.abort(),clearTimeout(d),a.destroy(),r(new Error("Daemon response too large")));return}let w=m.indexOf(`
|
|
10
|
-
`);if(w!==-1){let T=m.slice(0,w);p.splice(0,p.length,m.slice(w+1));try{let D=JSON.parse(T);u.abort(),clearTimeout(d),a.end(),s(D)}catch(D){u.abort(),clearTimeout(d),a.end(),r(new Error(`Invalid daemon response: ${D.message}`))}}}),a.on("error",y=>{u.signal.aborted||(u.abort(),clearTimeout(d),r(y))}),a.on("close",()=>{u.signal.aborted||(u.abort(),clearTimeout(d),r(new Error("Connection closed before response")))})})}o(k,"sendRequest");async function an(n,e,t,s,r,f=!0){let a=c.socket();if(!h(a)&&!i.existsSync(a))return f&&x().catch(()=>{}),null;try{return await k({id:b.randomUUID(),command:n,args:e,options:t,cwd:s,perfStartNs:r})}catch{return f&&x().catch(()=>{}),null}}o(an,"executeViaDaemon");async function U(){try{return(await k({id:b.randomUUID(),command:"daemon",args:["stop"],options:{},cwd:process.cwd()})).success}catch{return!1}}o(U,"stopDaemon");function H(){let n=c.pid(),e=c.socket(),t=(()=>{if(!i.existsSync(n))return{killed:!1,safeToCleanOwnership:!0};let s=parseInt(i.readFileSync(n,"utf-8").trim(),10);if(Number.isNaN(s))return{killed:!1,safeToCleanOwnership:!0};try{return process.kill(s,"SIGKILL"),{killed:!0,safeToCleanOwnership:!0}}catch(r){return{killed:!1,safeToCleanOwnership:v(r)==="ESRCH"}}})();if(!t.safeToCleanOwnership)return!1;try{i.existsSync(n)&&i.unlinkSync(n)}catch{}if(!h(e))try{i.existsSync(e)&&i.unlinkSync(e)}catch{}return t.killed}o(H,"forceKillDaemon");var g={inFlight:null};async function x(){return g.inFlight||(g.inFlight=$().finally(()=>{g.inFlight=null})),g.inFlight}o(x,"spawnDaemon");async function $(){if(await S())return!0;let n=N();if(!n)return await R(3e3);try{if(await S())return!0;let{spawn:e}=await import("node:child_process"),t=P.join(__dirname,"entry.ts"),s=P.join(__dirname,"..","daemon","entry.mjs"),r=P.join(__dirname,"..","dist","daemon","entry.mjs"),f=process.platform!=="win32"&&M(),a=i.existsSync(t)?{entryPath:t,runtime:"bun"}:i.existsSync(s)?{entryPath:s,runtime:f?"bun":"node"}:i.existsSync(r)?{entryPath:r,runtime:f?"bun":"node"}:null;if(!a)return!1;let{entryPath:p,runtime:u}=a,d=c.runDir();i.mkdirSync(d,{recursive:!0});let y=c.log(),m=i.openSync(y,"a");return e(u,[p],{detached:!0,stdio:["ignore",m,m],env:process.env}).unref(),i.closeSync(m),await R(3e3)}finally{E(n)}}o($,"spawnDaemonExclusive");async function R(n){let e=Date.now()+n,t=o(async s=>Date.now()>=e?S():await S()?!0:(await new Promise(r=>setTimeout(r,s)),t(Math.min(s*2,250))),"poll");return t(40)}o(R,"waitUntilDaemonRunning");async function cn(){try{return await S()?(await U()||H(),await new Promise(e=>setTimeout(e,300)),await x()):!1}catch{return!1}}o(cn,"restartDaemon");export{an as executeViaDaemon,H as forceKillDaemon,sn as getDaemonStatus,S as isDaemonRunning,cn as restartDaemon,k as sendRequest,L as shouldUnlinkDaemonSocket,x as spawnDaemon,U as stopDaemon};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as k,f as x,g as N}from"./chunk-NJAMZSHM.mjs";import{e as S,g as w}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as s}from"./chunk-E66B27AL.mjs";w();var M={function:"Function",method:"Method",class:"Class",interface:"Interface",type:"Type",enum:"Enum",const:"Const",route:"Route",file:"File"},E={CALLS:5,IMPORTS:4,DEFINES:3,HANDLES:2,TESTS:1};function R(n){return M[n.toLowerCase()]??"Symbol"}s(R,"mapKind");function _(n){try{return S.query(n,"SELECT src, dst, edge_type, confidence FROM code_symbol_edges").map(o=>({src:o.src,dst:o.dst,edgeType:o.edge_type,confidence:o.confidence}))}catch{return[]}}s(_,"loadEdges");function G(n){return typeof n=="number"&&Number.isFinite(n)&&n>=0}s(G,"hasFiniteCap");function $(n,o={}){if(!k(n))return null;let a=N(n);if(a.length===0)return null;let u=_(n),l=x(n),r=new Map;for(let e of u){let t=E[e.edgeType]??1;r.set(e.src,(r.get(e.src)??0)+t),r.set(e.dst,(r.get(e.dst)??0)+t)}let T=s(e=>{switch(e){case"class":return 8;case"function":case"method":return 6;case"interface":case"type":return 4;case"route":return 5;default:return 2}},"kindWeight"),h=a.map(e=>{let t=r.get(e.id)??0,F=e.exported?4:0;return{s:e,score:t+F+T(e.kind)}}).sort((e,t)=>t.score-e.score||e.s.name.localeCompare(t.s.name)),d=G(o.maxNodes)?h.slice(0,o.maxNodes).map(e=>e.s):h.map(e=>e.s),p=new Set(d.map(e=>e.id)),f=new Map;for(let e of d)f.set(e.file,(f.get(e.file)??0)+1);let y=[...f.entries()].sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).map(([e])=>e),g=s(e=>`file:${e}`,"fileNodeId"),m=[];for(let e of y){let t=e.split("/").pop()||e;m.push({id:g(e),name:t,kind:"File",file:e,exported:!1}),p.add(g(e))}for(let e of d)m.push({id:e.id,name:e.name,kind:R(e.kind),file:e.file,exported:e.exported});let C=[],I=new Set(y);for(let e of d)I.has(e.file)&&C.push({source:g(e.file),target:e.id,type:"DEFINES"});let L=u.filter(e=>p.has(e.src)&&p.has(e.dst)&&e.src!==e.dst).map(e=>({source:e.src,target:e.dst,type:e.edgeType,prio:E[e.edgeType]??0,conf:e.confidence})).sort((e,t)=>t.prio-e.prio||t.conf-e.conf),c=new Set,i=[],b=G(o.maxLinks)?o.maxLinks:Number.POSITIVE_INFINITY;for(let e of C){if(i.length>=b)break;let t=`${e.source}->${e.target}:${e.type}`;c.has(t)||(c.add(t),i.push({source:e.source,target:e.target,type:e.type}))}for(let e of L){if(i.length>=b)break;let t=`${e.source}->${e.target}:${e.type}`;c.has(t)||(c.add(t),i.push({source:e.source,target:e.target,type:e.type}))}return{version:1,builtAt:l?.builtAt??new Date().toISOString(),symbolCount:l?.symbolCount??a.length,edgeCount:l?.edgeCount??u.length,nodes:m,links:i}}s($,"buildCloudCodeGraphSnapshot");function K(n){return!!n&&n.nodes.length>0}s(K,"isUploadableGraph");export{$ as buildCloudCodeGraphSnapshot,K as isUploadableGraph};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a}from"./chunk-6EWGHM32.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as customWorkflowStorage};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as t}from"./chunk-OB5GRS7T.mjs";import"./chunk-45I2C2UB.mjs";import{c as n}from"./chunk-L4COZ7ZH.mjs";import"./chunk-4KY2EHXS.mjs";import"./chunk-UBMIPWJR.mjs";import"./chunk-7OZDWT6C.mjs";import"./chunk-YJMWY4Y6.mjs";import"./chunk-NJAMZSHM.mjs";import"./chunk-54LH63LM.mjs";import"./chunk-ZZ65CN5F.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function p(r=process.cwd(),e){return n({event:"CwdChanged",projectPath:r,build:o(async(d,i)=>{let c=d.cwd||i;return t(c)},"build")},e)}o(p,"runCwdChangedHook");export{p as runCwdChangedHook};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as p,b as g}from"./chunk-DMXFGLZE.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-AUUWQH3S.mjs";import{d as a,g as m}from"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";m();var u=o(e=>({week:e.week,capturedAt:e.captured_at,preferences:e.preferences,frictions:e.frictions,decisions7d:e.decisions_7d,gotchas7d:e.gotchas_7d,learnings7d:e.learnings_7d,tasksCompleted7d:e.tasks_completed_7d,ships7d:e.ships_7d,velocityAvg:e.velocity_avg,summary:e.summary}),"rowToSnapshot");function d(e,r,t){let i=t?"SELECT COUNT(*) AS c FROM memory_entries WHERE type = ? AND deleted_at IS NULL AND created_at >= ?":"SELECT COUNT(*) AS c FROM memory_entries WHERE type = ? AND deleted_at IS NULL",s=t?[r,t]:[r];return a.get(e,i,...s)?.c??0}o(d,"countEntries");function f(e){let r=e.decisions7d+e.gotchas7d+e.learnings7d;return`Week digest: ${e.ships7d>0||e.tasksCompleted7d>0?`shipped ${e.ships7d}, completed ${e.tasksCompleted7d} cycles`:"no deliveries recorded"}; velocity avg ${e.velocityAvg.toFixed(1)} pts/wk. Agent's model of the dev: ${e.preferences} standing preferences, ${e.frictions} friction signals; +${r} knowledge entries this week (${e.decisions7d} decisions, ${e.gotchas7d} gotchas, ${e.learnings7d} learnings).`}o(f,"buildSummary");async function y(e){let r=new Date().toISOString(),t=p(r);if(t===null)return!1;let i=Date.now()-10080*60*1e3,s=new Date(i).toISOString(),c=await g.getMetrics(e),n={preferences:d(e,"feedback"),frictions:d(e,"improvement-signal"),decisions7d:d(e,"decision",i),gotchas7d:d(e,"gotcha",i),learnings7d:d(e,"learning",i),tasksCompleted7d:a.get(e,"SELECT COUNT(*) AS c FROM tasks WHERE completed_at IS NOT NULL AND completed_at >= ?",s)?.c??0,ships7d:a.get(e,"SELECT COUNT(*) AS c FROM shipped_features WHERE shipped_at >= ?",s)?.c??0,velocityAvg:c.averageVelocity};return a.run(e,`INSERT OR IGNORE INTO developer_profile_snapshots
|
|
9
|
-
(week, captured_at, preferences, frictions, decisions_7d, gotchas_7d, learnings_7d,
|
|
10
|
-
tasks_completed_7d, ships_7d, velocity_avg, summary)
|
|
11
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,t,r,n.preferences,n.frictions,n.decisions7d,n.gotchas7d,n.learnings7d,n.tasksCompleted7d,n.ships7d,n.velocityAvg,f(n)).changes>0}o(y,"captureDeveloperSnapshot");function v(e,r=8){return a.query(e,"SELECT * FROM developer_profile_snapshots ORDER BY week DESC LIMIT ?",r).map(u)}o(v,"getDeveloperEvolution");function S(e,r=6){let t=v(e,r);if(t.length===0)return null;let i=["## Evolution (weekly snapshots)"];if(t.length>=2){let s=t[0],c=t[t.length-1],n=s.velocityAvg-c.velocityAvg,l=s.preferences-c.preferences;i.push(`Over ${t.length} weeks: velocity ${n>=0?"+":""}${n.toFixed(1)} pts/wk, standing preferences ${l>=0?"+":""}${l}, frictions ${s.frictions-c.frictions>=0?"+":""}${s.frictions-c.frictions}.`)}for(let s of t)i.push(`- ${s.capturedAt.slice(0,10)} \u2014 ${s.summary}`);return i.join(`
|
|
12
|
-
`)}o(S,"renderDeveloperEvolution");export{y as captureDeveloperSnapshot,v as getDeveloperEvolution,S as renderDeveloperEvolution};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e}from"./chunk-GIMUTVLP.mjs";import"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-UK7D7EFV.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as buildDistillContent,d as distillAndDiscardAllAutoSources,c as distillAndDiscardAutoSource,e as eliminateSoftDeletedNoValue,a as hardDeleteEntries};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as y}from"./chunk-ZZ65CN5F.mjs";import{c as T}from"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import{a as g}from"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import{b as A}from"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import{b}from"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import{b as _,e as M}from"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as x}from"./chunk-E66B27AL.mjs";var R=new Set(["decision","gotcha","learning","fact","feedback","spec"]);async function q(C,r,p={}){let{topic:c,types:i,tags:a}=p,l=p.limit??30,w=c?(()=>{let e=c.split(/\s+/).filter(Boolean);try{return g.searchFts(r,e,l).filter(t=>(!i||i.includes(t.type))&&(!a||M(t,a)))}catch{return[]}})():[],m=w.length>0?w:g.recall(r,{topic:c,types:i,tags:a,limit:l}).slice(0,l),d=(c?await(async()=>{try{let e=await b.readConfig(C);if(e&&T.isEnabled(e)){let n=await T.semanticSearch(r,c,e,10);if(n.length>0){let t=new Set(m.map(o=>o.id));return[...n.filter(o=>!t.has(o.id)&&(!i||i.includes(o.type))&&(!a||M(o,a))),...m].slice(0,l)}}return m}catch{return m}})():m).filter(e=>_(e)||(i?.includes(e.type)??!1)),h=i?.includes("improvement-signal")?d:await(async()=>{try{let{isAutoSource:e}=await import("./purge-AXMYTZVM.mjs"),n=45*864e5,t=Date.now(),u=d.filter(s=>{if(!e(s.tags?.source)||R.has(s.type)&&!e(s.tags?.source))return!0;let S=Date.parse(s.rememberedAt);return Number.isFinite(S)?t-S<n:!0}),o=u.filter(s=>!e(s.tags?.source)),O=u.filter(s=>e(s.tags?.source));return[...o,...O].slice(0,Math.max(l,u.length))}catch{return d}})(),f=h.length>1?y.rerank(r,h):h,k=p.expandLinks!==!1&&f.length>0?g.expandWithLinks(r,f,5):[],E=k.length>0?f.concat(k):f;try{let e=await A.getCurrentTask(r),n=new Date().toISOString();e?.id&&y.recordSurfaced(r,E.map(t=>t.id),e.id,n,{queryText:c,surface:"context-memory"});for(let t of E)y.recordFetch(r,t.id,n)}catch{}return E}x(q,"enrichedRecall");export{q as enrichedRecall};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o}from"./chunk-CTWZQ7YI.mjs";import"./chunk-E66B27AL.mjs";o();export{i as GitInfraError,c as PROC_ENVELOPE_MAX,a as execAsync,b as execFileAsync,g as exitCodeMeans,j as gitInfraErrorOf,n as gitStdout,f as isProcInfra,m as matchProc,k as procErrorOf,e as runGit,d as runProc,h as sanitizeProcEnvelope,l as throwProc};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e,f}from"./chunk-BNWB77U5.mjs";import"./chunk-KXWBIQGJ.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as MACHINE_TAG_KEYS,d as deriveTitle,c as flatDetail,f as formatMemoryMd,e as linkifyMemRefs,b as preventiveLabel};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e,f,g,h,i}from"./chunk-MHRMV4WI.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{c as RECEIPT_CAPTURE,a as RECEIPT_SOURCE,b as RECEIPT_TOPIC,d as buildJudgmentReceipt,i as countReceiptsWritten,h as latestJudgmentReceipt24h,f as persistJudgmentReceipt,e as summarizeJudgmentReceipt,g as synthesizeJudgmentReceipt};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as d}from"./chunk-5TBQNW2G.mjs";import{h as f}from"./chunk-MHRMV4WI.mjs";import{a as p}from"./chunk-ZX2KFQV5.mjs";import"./chunk-CREPUNOS.mjs";import"./chunk-QDQ7DTDV.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-BISPGBNN.mjs";import"./chunk-LT5WSSQO.mjs";import"./chunk-HJ4HEI45.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a as c}from"./chunk-E66B27AL.mjs";function j(n){return n?.land?.mode??"advisory"}c(j,"effectiveLandMode");async function L(n,m,u){let l=j(u);if(l==="off")return null;let t=await p(n,m).catch(()=>null),r=f(n);if(!t?.current&&!r)return null;let e=[];if(t?.current){let i=t.current.description.slice(0,60),s=t.current.isCurrent?await import("./state-storage-KNGP2CQV.mjs").then(({stateStorage:g})=>g.getCurrentTask(n)).catch(()=>null):null,o=d(u,{description:t.current.description,turnCount:s?.turnCount,tokensIn:s?.tokensIn,tokensOut:s?.tokensOut}),a=l==="strict"||o.level==="critical"||o.level==="warn",h=a?"# prjct: LAND REQUIRED before context dies":"# prjct: land the plane";e.push(h,`Open cycle: "${i}${t.current.description.length>60?"\u2026":""}"`,a?'Before ending the session: `prjct status done` or `prjct log "\u2026"`, then `prjct land` (auto-synthesizes the Session close hand-off \u2014 no manual remember). Next window: `prjct prime`.':"Before ending the session: `prjct land` (auto hand-off + judgment receipt) \xB7 optional `prjct memory export` for the team."),o.cue&&e.push("",o.cue)}if(r){e.length>0&&e.push("");let i=r.trapCount>0?`${r.trapCount} trap(s) re-surfaced last session`:"judgment continuity landed last session";e.push("# prjct: prior judgment receipt (24h)",`${i} \xB7 \`${r.id}\` \u2014 closed-loop proof, not bulk memory. \`prjct search "judgment-receipt"\` if you need the full receipt.`)}return e.length>0?e.join(`
|
|
9
|
-
`):null}c(L,"buildLandCue");export{L as buildLandCue,j as effectiveLandMode};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { createRequire as __createRequire } from 'module';
|
|
3
|
-
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
-
import { dirname as __pathDirname } from 'path';
|
|
5
|
-
const require = __createRequire(import.meta.url);
|
|
6
|
-
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
-
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b}from"./chunk-VV7VNUTF.mjs";import"./chunk-3WY2AYPE.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-QK2IMCDC.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3LG3ACQV.mjs";import"./chunk-AOPJ4Z6O.mjs";import"./chunk-AUUWQH3S.mjs";import"./chunk-JRKGG2E3.mjs";import"./chunk-MEQS4VPO.mjs";import"./chunk-HDHVBB6Q.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-AKIN5WSQ.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-SVZHJZ5T.mjs";import"./chunk-CTWZQ7YI.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-P5ZYAXSE.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{b as buildLandHandoffContent,a as synthesizeLandHandoff};
|