prjct-cli 3.95.0 → 3.96.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/bin/hook-chunks/{agent-identity-45BYQBU2.mjs → agent-identity-DH6DX72X.mjs} +1 -1
- package/dist/bin/hook-chunks/{agent-switch-4ZJJWKMD.mjs → agent-switch-I4MTVE56.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-UGHAG2SK.mjs → analysis-VN7APBHR.mjs} +3 -3
- package/dist/bin/hook-chunks/{auto-flush-CXWTU3RF.mjs → auto-flush-DX3FVSQE.mjs} +1 -1
- package/dist/bin/hook-chunks/{capture-gate-PS6QUXLX.mjs → capture-gate-MEIQD7ZS.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-YDBZO6I3.mjs → chunk-22GFTUER.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGIFB3OE.mjs → chunk-33BHU4OM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QL3NYJTW.mjs → chunk-3AHW4XQH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-DCSKTMDX.mjs → chunk-3CKNJ5RA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ABJNOG2I.mjs → chunk-3FEXJUO2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-22AXWLI6.mjs → chunk-3HGQPUKG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-EWOK4VE7.mjs → chunk-3UB6SFRA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OUAVSD47.mjs → chunk-64ZEBHDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X5W2UYQK.mjs → chunk-7PBWIO4K.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-QP5USCDX.mjs → chunk-7WO5CEH3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-N3L77UNM.mjs → chunk-ADYTBOCZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-RTEEXGEA.mjs → chunk-AORD3YDQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Z6KVLCMK.mjs → chunk-BKJHD5JI.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-4NTVXJD7.mjs → chunk-BVK7ZDLX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IGHY4FGS.mjs → chunk-CPR4FPXG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-XXRAQZNC.mjs → chunk-D7DQABWO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-5H3KJWQS.mjs → chunk-DB226JIV.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-ZFLIVOFX.mjs → chunk-DCHIPMOG.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-U4OON3S7.mjs → chunk-E7NA34VQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PTA7DMLM.mjs → chunk-EGCYDLSO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-PP6DANGV.mjs → chunk-EI6VQZOX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-5XA5RL5I.mjs → chunk-ETTDRXQ6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-FW4MEPTB.mjs → chunk-EXVL2OFE.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-I26F7TLM.mjs → chunk-FZS3XGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-IWJG7CZX.mjs → chunk-GSPDJSJ5.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-S5N2ZZDL.mjs → chunk-H2DGDAQP.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-H5AVBDCH.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-HEDZA6KC.mjs → chunk-HGZQWYBL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GCDLPKOH.mjs → chunk-IJ523YO2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6GAFRIUQ.mjs → chunk-IWUF2LGO.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Z4X7JIAP.mjs → chunk-JGZ3QGWX.mjs} +3 -3
- package/dist/bin/hook-chunks/{chunk-ROA2AJXY.mjs → chunk-JZDZH6IV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BOBFTVAY.mjs → chunk-KDNUQPAK.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-KV4NXLPT.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-WGWE3CSC.mjs → chunk-LF3S3MYE.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-LQLCYBFF.mjs +36 -0
- package/dist/bin/hook-chunks/{chunk-S5ISOGDB.mjs → chunk-LR24AIEW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-FXFG6PV6.mjs → chunk-M4YM7Z3F.mjs} +15 -15
- package/dist/bin/hook-chunks/{chunk-S6L3FECF.mjs → chunk-MW54MTLB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-J5UQVJUW.mjs → chunk-NCLONKOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QBYHZX33.mjs → chunk-NJ74RHNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GDESYWTD.mjs → chunk-NLL5AV2G.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-GLPKMG5A.mjs → chunk-OLQAMCYV.mjs} +10 -10
- package/dist/bin/hook-chunks/{chunk-KSSRINDX.mjs → chunk-PPWPUEBH.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PVCEWFHS.mjs +51 -0
- package/dist/bin/hook-chunks/{chunk-PGWFGRX4.mjs → chunk-QOQZHR3E.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2UC4DTDO.mjs → chunk-QXCEBAIA.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-RT2DFIWF.mjs +19 -0
- package/dist/bin/hook-chunks/{chunk-BDOAQVIF.mjs → chunk-SQW2B7NW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLKPAJND.mjs → chunk-SWJ7TLBD.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GDECEHO5.mjs → chunk-TB57OYGW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-4HAKTI36.mjs → chunk-TF6PN7IB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UHVYBU7F.mjs → chunk-TKXOMN4K.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-G7QQZMAO.mjs → chunk-UMJ5D5I6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UYQC63MC.mjs → chunk-UVATSTRF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BX7VKYA7.mjs → chunk-WJV24WE6.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-76GDLA3Z.mjs → chunk-WL6PKX3U.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-WUOVBBPC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-T6ELTQZM.mjs → chunk-XSJ7SPVR.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-DVDZA63F.mjs → chunk-XV2LJVYB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-C4O243NG.mjs → chunk-XYKVWO23.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-MHNWIB7B.mjs → chunk-Y3RHBU2R.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-RHKF7EJW.mjs → chunk-Y7MZA2G4.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZOX6OV6X.mjs → chunk-YHOZTAZH.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-YLOK4WRR.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3WQBTXUC.mjs → chunk-ZJW27EUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-J5UVRZ44.mjs → chunk-ZQI4TJ5C.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-ZYCNW75E.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-PO3QDKTE.mjs → chunk-ZZBNFNMG.mjs} +1 -1
- package/dist/bin/hook-chunks/{client-CRXA774S.mjs → client-K3ZA2BLB.mjs} +1 -1
- package/dist/bin/hook-chunks/{code-graph-cloud-GTSLO7CD.mjs → code-graph-cloud-XGQF7XYC.mjs} +1 -1
- package/dist/bin/hook-chunks/{codex-skill-NUBNPSMF.mjs → codex-skill-6CRFUF3A.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-UHSXC3UG.mjs → command-installer-MUHZWDZA.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-DX5OOPW5.mjs → config-manager-2JJPCLKC.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-GDJ3QICX.mjs → context7-service-NH4BMGSJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{custom-workflow-storage-FD47DPA3.mjs → custom-workflow-storage-VBMWLKA7.mjs} +1 -1
- package/dist/bin/hook-chunks/cwd-changed-UTD6Y4MS.mjs +8 -0
- package/dist/bin/hook-chunks/{database-ZUC7OEZG.mjs → database-ZCP76LMM.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-OJUBWWTU.mjs → detect-changes-5W6EGEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{developer-evolution-WNSTHDAA.mjs → developer-evolution-UTY3CWOK.mjs} +1 -1
- package/dist/bin/hook-chunks/{distill-GOGPFQFK.mjs → distill-5TNAM3LY.mjs} +1 -1
- package/dist/bin/hook-chunks/{enriched-recall-QF22RIK7.mjs → enriched-recall-6VOIUNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{format-J3X3R225.mjs → format-IIOFTSBF.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-FE4HXTHM.mjs → judgment-ledger-storage-7Q7AEEY6.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-YDJTKNV2.mjs → judgment-orchestrator-AAON4ZJ4.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-receipt-7A2DXVJA.mjs → judgment-receipt-QLV3MYFT.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-cue-SZWJH6XP.mjs → land-cue-57B23PEL.mjs} +1 -1
- package/dist/bin/hook-chunks/{land-synthesis-JLYUBKHR.mjs → land-synthesis-ZVPFJERV.mjs} +1 -1
- package/dist/bin/hook-chunks/{legacy-crew-sweep-JXYO62UE.mjs → legacy-crew-sweep-GR6HRSHX.mjs} +2 -2
- package/dist/bin/hook-chunks/{memory-index-CIYDXN2G.mjs → memory-index-XE2MWKQS.mjs} +1 -1
- package/dist/bin/hook-chunks/{notification-UA7RTVHG.mjs → notification-GU2ZJP5K.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-integrity-GZC5NGFN.mjs → pack-integrity-WV5U3AFF.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-AF5F7PRT.mjs → pack-manager-QLFQKP24.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-M3RAOZVB.mjs → planning-VPAX5DZL.mjs} +2 -2
- package/dist/bin/hook-chunks/{post-edit-QRDYPZLZ.mjs → post-edit-UXCFSR3Y.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-bash-TWWFVNQ7.mjs → pre-bash-MB4JNNYG.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-commit-PTFF7JIN.mjs → pre-commit-U7TRFKWX.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-edit-MDCQXI5F.mjs +11 -0
- package/dist/bin/hook-chunks/{pre-package-325ALZKD.mjs → pre-package-A6ZI5R64.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-search-GOHVFAFH.mjs → pre-search-ZZO3LGXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{pre-secrets-MYNM5KI4.mjs → pre-secrets-MWPPZPWK.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-RCB6FWD6.mjs → prjct-md-MS52YLI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-V4P5RTUR.mjs → project-agent-surfaces-6AIW7KL6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-OKIP4LBO.mjs → project-file-inventory-HHURZTMH.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-UDH56VFP.mjs +8 -0
- package/dist/bin/hook-chunks/{project-style-evolution-RPGATIYJ.mjs → project-style-evolution-IJXT2MCP.mjs} +1 -1
- package/dist/bin/hook-chunks/prompt-7VZLYONO.mjs +24 -0
- package/dist/bin/hook-chunks/{publish-helper-SX7HEV2L.mjs → publish-helper-ZSL27HSX.mjs} +1 -1
- package/dist/bin/hook-chunks/{purge-XKHUAB4H.mjs → purge-N2WN6NDB.mjs} +1 -1
- package/dist/bin/hook-chunks/retention-RET4P2RO.mjs +8 -0
- package/dist/bin/hook-chunks/{sdd-6PF7MBAY.mjs → sdd-PB6WKSLE.mjs} +1 -1
- package/dist/bin/hook-chunks/{session-continuity-UEXQDGZE.mjs → session-continuity-BIJXMN44.mjs} +1 -1
- package/dist/bin/hook-chunks/session-start-R2VMKW2L.mjs +8 -0
- package/dist/bin/hook-chunks/settings-installer-CQKMGMRG.mjs +9 -0
- package/dist/bin/hook-chunks/{setup-ZOHG6MGF.mjs → setup-PPIZHVXS.mjs} +3 -3
- package/dist/bin/hook-chunks/{shipping-QVGTOO6U.mjs → shipping-C637PCOF.mjs} +4 -4
- package/dist/bin/hook-chunks/{skill-index-FGDQVYHM.mjs → skill-index-55I3HLAI.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-6Z52BT37.mjs → spec-context-inference-RTTDOZZO.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-UAQ5AEXQ.mjs → spec-service-ENLAAMVL.mjs} +2 -2
- package/dist/bin/hook-chunks/{spec-task-breakdown-LAXGVLMY.mjs → spec-task-breakdown-RUDEP3AY.mjs} +1 -1
- package/dist/bin/hook-chunks/{state-storage-XU35ZYNA.mjs → state-storage-AJUPG7J5.mjs} +1 -1
- package/dist/bin/hook-chunks/stop-DPXAWJFN.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-AFHPXL2S.mjs +8 -0
- package/dist/bin/hook-chunks/{subagent-stop-OUG4PR7S.mjs → subagent-stop-5BMV63ML.mjs} +1 -1
- package/dist/bin/hook-chunks/{surface-attribution-A6GCGRFM.mjs → surface-attribution-EGIKCVMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{symbol-graph-DMPBNBX7.mjs → symbol-graph-MH42JSPX.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-VVLA3L2U.mjs → sync-cursor-storage-ZB7FGT6D.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-HFZYWYLR.mjs → task-orchestration-7NGRIISS.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-PCUZWL5Q.mjs → task-overview-F3GB77OA.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-FZABHPFV.mjs +8 -0
- package/dist/bin/hook-chunks/{tdd-QZL4OSM7.mjs → tdd-TAMBOPN3.mjs} +1 -1
- package/dist/bin/hook-chunks/{template-loader-SKXILJLJ.mjs → template-loader-MXOMU4XH.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-SZLG6LVC.mjs → usefulness-TBD5EYAL.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-HOXPURNQ.mjs → vault-retire-notice-7XHVNHU6.mjs} +1 -1
- package/dist/bin/hook-chunks/{velocity-storage-5J6BAMCW.mjs → velocity-storage-IOCVK2LU.mjs} +1 -1
- package/dist/bin/hook-chunks/{weak-model-mode-ZRNKFTFF.mjs → weak-model-mode-BMSPGEQY.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-graph-PGYHFLEL.mjs → work-graph-AVAOKY63.mjs} +1 -1
- package/dist/bin/hook-chunks/{work-scope-FIB6LBKE.mjs → work-scope-YCS4GTXW.mjs} +1 -1
- package/dist/bin/hook-chunks/{workspace-occupancy-3D4OKQRB.mjs → workspace-occupancy-JOBYNNXV.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 +724 -712
- package/dist/bin/prjct-hooks.mjs +3 -3
- package/dist/bin/prjct.mjs +21 -8
- package/dist/daemon/entry.mjs +617 -603
- package/dist/mcp/server.mjs +315 -301
- package/package.json +3 -5
- package/scripts/install.sh +28 -496
- package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-BU22R6JX.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +0 -36
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-KHLYWNHT.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-TRMBRDKH.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-TXSLON7M.mjs +0 -19
- package/dist/bin/hook-chunks/chunk-V2FR2NPL.mjs +0 -43
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +0 -11
- package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +0 -24
- package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +0 -8
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +0 -8
- package/dist/bin/hook-chunks/settings-installer-QDM3GB6J.mjs +0 -9
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +0 -16
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +0 -8
package/CHANGELOG.md
CHANGED
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a,b,c,d,e}from"./chunk-
|
|
8
|
+
import{a,b,c,d,e}from"./chunk-H5AVBDCH.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-E66B27AL.mjs";export{a as KNOWN_AGENTS,b as detectRuntimeAgent,d as normalizeAgentName,c as resolveCallerIdentity,e as sameOwner};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as E,b as I}from"./chunk-OWOPA2O7.mjs";import{a as P}from"./chunk-
|
|
8
|
+
import{a as E,b as I}from"./chunk-OWOPA2O7.mjs";import{a as P}from"./chunk-3AHW4XQH.mjs";import{a as O}from"./chunk-5WAONIPX.mjs";import{a as C}from"./chunk-5TBQNW2G.mjs";import"./chunk-HGZQWYBL.mjs";import{b as N,c as H,d as L}from"./chunk-H5AVBDCH.mjs";import{h as _}from"./chunk-M4YM7Z3F.mjs";import"./chunk-LF3S3MYE.mjs";import"./chunk-PPWPUEBH.mjs";import"./chunk-H4CA3XZ6.mjs";import"./chunk-Y3RHBU2R.mjs";import{c as D,d as A}from"./chunk-XSJ7SPVR.mjs";import"./chunk-Y7MZA2G4.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-NLL5AV2G.mjs";import"./chunk-NCLONKOT.mjs";import"./chunk-22GFTUER.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-BKJHD5JI.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZJW27EUC.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-XYKVWO23.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-PVCEWFHS.mjs";import"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as y}from"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import{a as x}from"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-GAOQHD5S.mjs";import{b as h}from"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import{d as f,g as v}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{b as m,h as V,l as S,n as Y,o as R,u as q}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import{a}from"./chunk-E66B27AL.mjs";q();import{spawn as X}from"node:child_process";v();V();v();function G(t){if(!t)return null;try{return JSON.parse(t)}catch{return null}}a(G,"parseEvidence");function $(t){return{id:t.id,projectId:t.project_id,taskId:t.task_id,taskDescription:t.task_description,fromAgent:t.from_agent,fromIdentity:t.from_identity,toAgent:t.to_agent,reason:t.reason,evidence:G(t.evidence),status:t.status,workspaceId:t.workspace_id,worktreePath:t.worktree_path,branch:t.branch,createdAt:t.created_at,acceptedAt:t.accepted_at,acceptedBy:t.accepted_by,expiresAt:t.expires_at}}a($,"toHandoff");function M(t){let e=new Date;return e.setTime(e.getTime()+Math.max(1,t)*36e5),e.toISOString()}a(M,"expiresAtIso");function W(t){let e=`hand_${x()}`,o=m(),n=t.ttlHours??24,r=t.evidence?JSON.stringify(t.evidence):null;return f.run(t.projectId,`INSERT INTO task_handoffs (
|
|
9
9
|
id, project_id, task_id, task_description, from_agent, from_identity,
|
|
10
10
|
to_agent, reason, evidence, status, workspace_id, worktree_path, branch,
|
|
11
11
|
created_at, accepted_at, accepted_by, expires_at
|
|
@@ -5,10 +5,10 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as G,b as Se,c as b,d as U,e as q,f as H,g as ve,h as $e,i as v}from"./chunk-
|
|
8
|
+
import{a as G,b as Se,c as b,d as U,e as q,f as H,g as ve,h as $e,i as v}from"./chunk-LQLCYBFF.mjs";import"./chunk-QOQZHR3E.mjs";import"./chunk-TXJT3G53.mjs";import"./chunk-UMJ5D5I6.mjs";import"./chunk-JZDZH6IV.mjs";import"./chunk-XV2LJVYB.mjs";import"./chunk-YHOZTAZH.mjs";import"./chunk-M4YM7Z3F.mjs";import"./chunk-LF3S3MYE.mjs";import"./chunk-PPWPUEBH.mjs";import{a as y,b as R,c as M,d as we,e as E,f as L,g as z}from"./chunk-TB57OYGW.mjs";import{b as ge,c as A,d as ke}from"./chunk-MW54MTLB.mjs";import"./chunk-H4CA3XZ6.mjs";import{a as d}from"./chunk-Y3RHBU2R.mjs";import"./chunk-XSJ7SPVR.mjs";import"./chunk-Y7MZA2G4.mjs";import"./chunk-TPESWBA7.mjs";import"./chunk-FEFP6JOL.mjs";import"./chunk-NLL5AV2G.mjs";import"./chunk-NCLONKOT.mjs";import"./chunk-22GFTUER.mjs";import"./chunk-YQ55MHKL.mjs";import"./chunk-QSAA6LZF.mjs";import"./chunk-KOGZCFBC.mjs";import"./chunk-UVATSTRF.mjs";import"./chunk-LNB2GLYI.mjs";import{a as ue}from"./chunk-DYHYDHCW.mjs";import"./chunk-BKJHD5JI.mjs";import{a as D,b as ye,c as K}from"./chunk-ZYCNW75E.mjs";import"./chunk-JR542RI2.mjs";import"./chunk-CPR4FPXG.mjs";import"./chunk-3HGQPUKG.mjs";import"./chunk-ZQI4TJ5C.mjs";import"./chunk-SWJ7TLBD.mjs";import"./chunk-KEJ5RMAI.mjs";import"./chunk-ZJW27EUC.mjs";import"./chunk-IWUF2LGO.mjs";import"./chunk-YLOK4WRR.mjs";import"./chunk-ZMLA5SKR.mjs";import"./chunk-SJ75V4WG.mjs";import{e as pe}from"./chunk-3CKNJ5RA.mjs";import"./chunk-R4ILCXKE.mjs";import{d as fe}from"./chunk-XYKVWO23.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import{b as he}from"./chunk-PVCEWFHS.mjs";import{a as de}from"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-3FBCOCPD.mjs";import{b as me}from"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-XS45K7ZQ.mjs";import"./chunk-GVNMXVVA.mjs";import"./chunk-4KVPAHFV.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import{d as _,g as ce}from"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import{d as le}from"./chunk-KV4NXLPT.mjs";import{b as I,g as oe,h as X,v as ie,w as We}from"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import{k as ae,o as Qe}from"./chunk-UH4MD3F3.mjs";import{a as N,b as ne,p as re}from"./chunk-QWQFF2UG.mjs";import"./chunk-EXVL2OFE.mjs";import"./chunk-SYHDEUVU.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import{a as $,e as k,f as J}from"./chunk-BUDZL4DW.mjs";import{a as m}from"./chunk-E66B27AL.mjs";J();re();Qe();import j from"node:fs/promises";import C from"node:path";var Y=class{static{m(this,"CodebaseAnalyzer")}projectPath=null;init(e=process.cwd()){this.projectPath=e}async readPackageJson(){try{let e=C.join(this.projectPath,"package.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readCargoToml(){try{let e=C.join(this.projectPath,"Cargo.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readRequirements(){try{let e=C.join(this.projectPath,"requirements.txt");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGoMod(){try{let e=C.join(this.projectPath,"go.mod");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readGemfile(){try{let e=C.join(this.projectPath,"Gemfile");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readMixExs(){try{let e=C.join(this.projectPath,"mix.exs");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readPomXml(){try{let e=C.join(this.projectPath,"pom.xml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async readComposerJson(){try{let e=C.join(this.projectPath,"composer.json"),t=await j.readFile(e,"utf-8");return JSON.parse(t)}catch(e){if($(e)||e instanceof SyntaxError)return null;throw e}}async readPyprojectToml(){try{let e=C.join(this.projectPath,"pyproject.toml");return await j.readFile(e,"utf-8")}catch(e){if($(e))return null;throw e}}async getFileExtensions(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" ! -path "*/.next/*" | sed "s/.*\\./\\./" | sort | uniq -c | sort -rn',{cwd:this.projectPath}),t={};return e.trim().split(`
|
|
9
9
|
`).filter(Boolean).forEach(o=>{let s=o.trim().match(/^\s*(\d+)\s+(\.\w+)$/);s&&(t[s[2]]=parseInt(s[1],10))}),t}catch{return{}}}async listConfigFiles(){try{let e=await j.readdir(this.projectPath),t=[/^package\.json$/,/^Cargo\.toml$/,/^go\.mod$/,/^requirements\.txt$/,/^Gemfile$/,/^mix\.exs$/,/^pom\.xml$/,/^composer\.json$/,/^pyproject\.toml$/,/^tsconfig.*\.json$/,/^\..*rc(\.json|\.js|\.cjs)?$/,/^Dockerfile$/,/^docker-compose.*\.ya?ml$/,/^\.env.*$/];return e.filter(o=>t.some(s=>s.test(o)))}catch(e){if($(e))return[];throw e}}async listDirectories(){try{return(await j.readdir(this.projectPath,{withFileTypes:!0})).filter(t=>t.isDirectory()).map(t=>t.name).filter(t=>!t.startsWith(".")&&t!=="node_modules")}catch(e){if($(e))return[];throw e}}async getGitLog(e=50){try{let{stdout:t}=await N(`git log -n ${e} --pretty=format:"%h|%an|%ar|%s"`,{cwd:this.projectPath});return t}catch{return""}}async getGitStats(){try{let{stdout:e}=await N("git rev-list --count HEAD",{cwd:this.projectPath}),{stdout:t}=await N('git log --format="%an" | sort -u | wc -l',{cwd:this.projectPath}),{stdout:o}=await N('git log --reverse --pretty=format:"%ar" | head -1',{cwd:this.projectPath});return{totalCommits:parseInt(e.trim(),10)||0,contributors:parseInt(t.trim(),10)||0,age:o.trim()||"unknown"}}catch{return{totalCommits:0,contributors:0,age:"unknown"}}}async countFiles(){try{let{stdout:e}=await N('find . -type f ! -path "*/node_modules/*" ! -path "*/.git/*" ! -path "*/dist/*" | wc -l',{cwd:this.projectPath});return parseInt(e.trim(),10)||0}catch{return 0}}async fileExists(e){return ae(C.join(this.projectPath,e))}async readFile(e){try{let t=C.join(this.projectPath,e);return await j.readFile(t,"utf-8")}catch(t){if($(t))return null;throw t}}async findFiles(e){try{let{stdout:t}=await N(`find . -type f -name "${e}" ! -path "*/node_modules/*" ! -path "*/.git/*"`,{cwd:this.projectPath});return t.trim().split(`
|
|
10
10
|
`).filter(Boolean)}catch{return[]}}},Xe=new Y,S=Xe;We();import je from"node:fs/promises";import Pe from"node:path";var V=800,Z=6,Ke=8,Ye=5;async function ee(r,e,t,o){let[s,i,n,a]=await Promise.all([Ze(r,e,o),et(r),tt(r),st(r)]);return{project:{name:o.name,ecosystem:o.ecosystem,languages:o.languages,frameworks:o.frameworks,fileCount:o.fileCount,projectType:o.projectType},git:{branch:t.branch,recentCommits:t.recentCommits.slice(0,Ke).map(u=>({message:u.message,date:u.date})),hasChanges:t.hasChanges,weeklyCommits:t.weeklyCommits},codeSamples:s,existingPatterns:i,taskHistory:n,previousAnalysis:a??void 0}}m(ee,"buildAnalysisPayload");async function Ze(r,e,t){let o=[],s=[...t.frameworks.map(a=>a.toLowerCase()),"config","router","middleware","service","model","schema","database","api","auth"].join(" "),i=pe(r,s,Z*2);for(let a of i){if(o.length>=Z)break;try{let u=Pe.join(e,a.path),c=await je.readFile(u,"utf-8");c.length>V*3?o.push({path:a.path,content:`${c.slice(0,V)}
|
|
11
|
-
// ... truncated`,reason:`BM25 score: ${a.score.toFixed(2)} (truncated, ${c.length} chars)`}):o.push({path:a.path,content:c.slice(0,V),reason:`BM25 score: ${a.score.toFixed(2)}`})}catch{}}let n=["package.json","tsconfig.json","src/index.ts","src/main.ts","app.ts"];for(let a of n){if(o.length>=Z)break;if(!o.some(u=>u.path===a))try{let u=Pe.join(e,a),c=await je.readFile(u,"utf-8");o.push({path:a,content:c.slice(0,V),reason:"entry point"})}catch{}}return o}m(Ze,"selectCodeSamples");async function et(r){try{let e=await b.getActive(r);return e?{patterns:(e.patterns??[]).map(t=>({name:t.name,description:t.description})),antiPatterns:(e.antiPatterns??[]).map(t=>({issue:t.issue,file:t.file,suggestion:t.suggestion}))}:{patterns:[],antiPatterns:[]}}catch{return{patterns:[],antiPatterns:[]}}}m(et,"getExistingPatterns");async function tt(r){try{return(await me.getTaskHistory(r)).slice(0,Ye).map(t=>({description:t.title,status:t.classification,branch:t.branchName}))}catch{return[]}}m(tt,"getTaskHistory");function st(r){try{let e=D.getActiveSummary(r);return Promise.resolve(e)}catch(e){return ue.debug("Failed to get previous LLM analysis summary",{error:e}),Promise.resolve(null)}}m(st,"getPreviousAnalysisSummary");J();X();ce();J();async function be(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.seal(o);return e.json?(console.log(JSON.stringify({success:s.success,signature:s.signature,error:s.error})),{success:s.success,error:s.error}):s.success?(d.done("Analysis sealed"),console.log(` Signature: ${s.signature?.substring(0,16)}...`),console.log(""),{success:!0,data:{signature:s.signature}}):(d.fail(s.error||"Seal failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(be,"seal");async function Ce(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.rollback(o);return e.json?(console.log(JSON.stringify({success:s.success,restoredSignature:s.restoredSignature,error:s.error})),{success:s.success,error:s.error}):e.md?s.success?(console.log(y(L("Analysis Rolled Back"),E({"Restored signature":`${s.restoredSignature?.substring(0,16)}...`,Note:"Previous sealed version is now active. Current version moved to draft."}))),{success:!0,data:{restoredSignature:s.restoredSignature}}):(console.log(y("## Rollback Failed",`> ${s.error}`)),{success:!1,error:s.error}):s.success?(d.done("Analysis rolled back to previous sealed version"),console.log(` Restored signature: ${s.restoredSignature?.substring(0,16)}...`),console.log(" Previous sealed version demoted to draft"),console.log(""),{success:!0,data:{restoredSignature:s.restoredSignature}}):(d.fail(s.error||"Rollback failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Rollback Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(Ce,"rollback");async function xe(r=process.cwd(),e={}){if(e.semantic)return te(r,e);try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await b.verify(o);return e.json?(console.log(JSON.stringify(s)),{success:s.valid}):(s.valid?d.done(s.message):d.fail(s.message),console.log(""),{success:s.valid,data:s})}catch(t){let o=k(t);return ge(o)}}m(xe,"verify");async function te(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json?console.log(JSON.stringify({success:!1,error:"No project ID found"})):d.fail("No project ID found"),t.result;let o=t.value,s=(()=>{try{return _.getDoc(o,"project")?.repoPath||r}catch{return r}})(),i=await b.semanticVerify(o,s);if(e.json)return console.log(JSON.stringify(i)),{success:i.passed,data:i};console.log(""),i.passed?(d.done("Semantic verification passed"),console.log(` ${i.passedCount}/${i.checks.length} checks passed (${i.totalMs}ms)`)):(d.fail("Semantic verification failed"),console.log(` ${i.failedCount}/${i.checks.length} checks failed`)),console.log(""),console.log("Check Results:");for(let n of i.checks){let a=n.passed?"\u2713":"\u2717",u=n.passed?`${n.output} (${n.durationMs}ms)`:n.error||"Failed";console.log(` ${a} ${n.name}: ${u}`)}return console.log(""),{success:i.passed,data:i}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(te,"semanticVerifyCommand");import De from"node:fs/promises";import Re from"node:path";import{z as l}from"zod";var nt=l.object({style:l.string(),insights:l.array(l.string()),domains:l.array(l.string())}),rt=l.object({name:l.string(),description:l.string(),locations:l.array(l.string()),confidence:l.number().min(0).max(1),category:l.string()}),ot=l.object({issue:l.string(),reasoning:l.string(),files:l.array(l.string()),suggestion:l.string(),severity:l.enum(["low","medium","high"]),confidence:l.number().min(0).max(1)}),at=l.object({description:l.string(),area:l.string(),effort:l.enum(["small","medium","large"]),impact:l.string(),priority:l.enum(["low","medium","high"])}),it=l.object({path:l.string(),reason:l.string(),risk:l.string(),severity:l.enum(["low","medium","high"])}),ct=l.object({description:l.string(),files:l.array(l.string()),benefit:l.string(),effort:l.enum(["small","medium","large"])}),lt=l.object({category:l.string(),rule:l.string(),example:l.string().optional()}),ut=l.object({build:l.string().optional(),test:l.string().optional(),lint:l.string().optional(),dev:l.string().optional(),format:l.string().optional(),install:l.string().optional()}),mt=l.object({languages:l.array(l.string()),frameworks:l.array(l.string()),packageManager:l.string().optional()}),gt=l.object({version:l.literal(1),commitHash:l.string().nullable(),analyzedAt:l.string(),architecture:nt,patterns:l.array(rt),antiPatterns:l.array(ot),techDebt:l.array(at),riskAreas:l.array(it),refactorSuggestions:l.array(ct),projectInsights:l.array(l.string()),conventions:l.array(lt),commands:ut.optional(),stack:mt.optional()});function Ae(r){let e=gt.safeParse(r);return e.success?{ok:!0,value:e.data}:{ok:!1,error:e.error.issues.map(o=>`${o.path.length>0?o.path.join("."):"<root>"}: ${o.message}`).join("; ")}}m(Ae,"parseLlmAnalysis");X();re();async function Le(r,e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await pt(r,e),n=await ft(i.content,e),a=D.getActive(s),u=!!(a&&ye(a)&&K(n)),c=u?dt(a,n):n;D.save(s,c);try{let{recomputeProjectStyle:f}=await import("./project-style-evolution-
|
|
11
|
+
// ... truncated`,reason:`BM25 score: ${a.score.toFixed(2)} (truncated, ${c.length} chars)`}):o.push({path:a.path,content:c.slice(0,V),reason:`BM25 score: ${a.score.toFixed(2)}`})}catch{}}let n=["package.json","tsconfig.json","src/index.ts","src/main.ts","app.ts"];for(let a of n){if(o.length>=Z)break;if(!o.some(u=>u.path===a))try{let u=Pe.join(e,a),c=await je.readFile(u,"utf-8");o.push({path:a,content:c.slice(0,V),reason:"entry point"})}catch{}}return o}m(Ze,"selectCodeSamples");async function et(r){try{let e=await b.getActive(r);return e?{patterns:(e.patterns??[]).map(t=>({name:t.name,description:t.description})),antiPatterns:(e.antiPatterns??[]).map(t=>({issue:t.issue,file:t.file,suggestion:t.suggestion}))}:{patterns:[],antiPatterns:[]}}catch{return{patterns:[],antiPatterns:[]}}}m(et,"getExistingPatterns");async function tt(r){try{return(await me.getTaskHistory(r)).slice(0,Ye).map(t=>({description:t.title,status:t.classification,branch:t.branchName}))}catch{return[]}}m(tt,"getTaskHistory");function st(r){try{let e=D.getActiveSummary(r);return Promise.resolve(e)}catch(e){return ue.debug("Failed to get previous LLM analysis summary",{error:e}),Promise.resolve(null)}}m(st,"getPreviousAnalysisSummary");J();X();ce();J();async function be(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.seal(o);return e.json?(console.log(JSON.stringify({success:s.success,signature:s.signature,error:s.error})),{success:s.success,error:s.error}):s.success?(d.done("Analysis sealed"),console.log(` Signature: ${s.signature?.substring(0,16)}...`),console.log(""),{success:!0,data:{signature:s.signature}}):(d.fail(s.error||"Seal failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(be,"seal");async function Ce(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json&&console.log(JSON.stringify({success:!1,error:"No project ID found"})),t.result;let o=t.value,s=await b.rollback(o);return e.json?(console.log(JSON.stringify({success:s.success,restoredSignature:s.restoredSignature,error:s.error})),{success:s.success,error:s.error}):e.md?s.success?(console.log(y(L("Analysis Rolled Back"),E({"Restored signature":`${s.restoredSignature?.substring(0,16)}...`,Note:"Previous sealed version is now active. Current version moved to draft."}))),{success:!0,data:{restoredSignature:s.restoredSignature}}):(console.log(y("## Rollback Failed",`> ${s.error}`)),{success:!1,error:s.error}):s.success?(d.done("Analysis rolled back to previous sealed version"),console.log(` Restored signature: ${s.restoredSignature?.substring(0,16)}...`),console.log(" Previous sealed version demoted to draft"),console.log(""),{success:!0,data:{restoredSignature:s.restoredSignature}}):(d.fail(s.error||"Rollback failed"),{success:!1,error:s.error})}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):e.md?console.log(y("## Rollback Failed",`> ${o}`)):d.fail(o),{success:!1,error:o}}}m(Ce,"rollback");async function xe(r=process.cwd(),e={}){if(e.semantic)return te(r,e);try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=await b.verify(o);return e.json?(console.log(JSON.stringify(s)),{success:s.valid}):(s.valid?d.done(s.message):d.fail(s.message),console.log(""),{success:s.valid,data:s})}catch(t){let o=k(t);return ge(o)}}m(xe,"verify");async function te(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return e.json?console.log(JSON.stringify({success:!1,error:"No project ID found"})):d.fail("No project ID found"),t.result;let o=t.value,s=(()=>{try{return _.getDoc(o,"project")?.repoPath||r}catch{return r}})(),i=await b.semanticVerify(o,s);if(e.json)return console.log(JSON.stringify(i)),{success:i.passed,data:i};console.log(""),i.passed?(d.done("Semantic verification passed"),console.log(` ${i.passedCount}/${i.checks.length} checks passed (${i.totalMs}ms)`)):(d.fail("Semantic verification failed"),console.log(` ${i.failedCount}/${i.checks.length} checks failed`)),console.log(""),console.log("Check Results:");for(let n of i.checks){let a=n.passed?"\u2713":"\u2717",u=n.passed?`${n.output} (${n.durationMs}ms)`:n.error||"Failed";console.log(` ${a} ${n.name}: ${u}`)}return console.log(""),{success:i.passed,data:i}}catch(t){let o=k(t);return e.json?console.log(JSON.stringify({success:!1,error:o})):d.fail(o),{success:!1,error:o}}}m(te,"semanticVerifyCommand");import De from"node:fs/promises";import Re from"node:path";import{z as l}from"zod";var nt=l.object({style:l.string(),insights:l.array(l.string()),domains:l.array(l.string())}),rt=l.object({name:l.string(),description:l.string(),locations:l.array(l.string()),confidence:l.number().min(0).max(1),category:l.string()}),ot=l.object({issue:l.string(),reasoning:l.string(),files:l.array(l.string()),suggestion:l.string(),severity:l.enum(["low","medium","high"]),confidence:l.number().min(0).max(1)}),at=l.object({description:l.string(),area:l.string(),effort:l.enum(["small","medium","large"]),impact:l.string(),priority:l.enum(["low","medium","high"])}),it=l.object({path:l.string(),reason:l.string(),risk:l.string(),severity:l.enum(["low","medium","high"])}),ct=l.object({description:l.string(),files:l.array(l.string()),benefit:l.string(),effort:l.enum(["small","medium","large"])}),lt=l.object({category:l.string(),rule:l.string(),example:l.string().optional()}),ut=l.object({build:l.string().optional(),test:l.string().optional(),lint:l.string().optional(),dev:l.string().optional(),format:l.string().optional(),install:l.string().optional()}),mt=l.object({languages:l.array(l.string()),frameworks:l.array(l.string()),packageManager:l.string().optional()}),gt=l.object({version:l.literal(1),commitHash:l.string().nullable(),analyzedAt:l.string(),architecture:nt,patterns:l.array(rt),antiPatterns:l.array(ot),techDebt:l.array(at),riskAreas:l.array(it),refactorSuggestions:l.array(ct),projectInsights:l.array(l.string()),conventions:l.array(lt),commands:ut.optional(),stack:mt.optional()});function Ae(r){let e=gt.safeParse(r);return e.success?{ok:!0,value:e.data}:{ok:!1,error:e.error.issues.map(o=>`${o.path.length>0?o.path.join("."):"<root>"}: ${o.message}`).join("; ")}}m(Ae,"parseLlmAnalysis");X();re();async function Le(r,e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await pt(r,e),n=await ft(i.content,e),a=D.getActive(s),u=!!(a&&ye(a)&&K(n)),c=u?dt(a,n):n;D.save(s,c);try{let{recomputeProjectStyle:f}=await import("./project-style-evolution-IJXT2MCP.mjs"),{gatherStats:h,detectStack:x,detectCommands:B}=await import("./sync-analyzer-6U5GHYV3.mjs"),[T,P,Q]=await Promise.all([h(e),x(e),B(e)]);await f({projectId:s,projectPath:e,stats:T,stack:P,commands:Q,commitHash:c.commitHash,source:"analysis-save"})}catch{}let p=K(c)&&!u;if(t.md){let h=[L(u?"LLM Analysis Notes Merged (house style preserved)":p?"LLM Analysis Notes Saved (thin \u2014 not house style)":"LLM Analysis Saved"),E({Input:i.source,Architecture:c.architecture.style,Patterns:c.patterns.length,"Anti-patterns":c.antiPatterns?.length||0,"Tech debt items":c.techDebt?.length||0,"Risk areas":c.riskAreas?.length||0,Conventions:c.conventions?.length||0,...u?{Merge:"thin notes \u2192 existing rich analysis"}:{},...p?{Kind:"thin markdown/notes"}:{}})];p&&h.push(z("Prefer schema v1 JSON (architecture/patterns/conventions) via `prjct analysis-save-llm <file> --md`. Markdown alone leaves patterns empty and burns a retry loop.")),console.log(y(...h))}else console.log(JSON.stringify({success:!0,message:u?"LLM analysis notes merged into existing rich analysis":p?"LLM analysis thin notes saved (prefer schema v1 JSON for house style)":"LLM analysis saved",input:i.source,mergedNotes:u,thin:p,stats:{patterns:c.patterns.length,antiPatterns:c.antiPatterns?.length||0,techDebt:c.techDebt?.length||0},...p?{tip:"Prefer schema v1 JSON (architecture/patterns/conventions). Markdown alone is thin notes."}:{}}));return{success:!0}}catch(o){return A(o)}}m(Le,"saveLlmAnalysis");function dt(r,e){let t=m((o,s,i)=>{let n=[],a=new Set;for(let u of[...o,...s]){let c=u.toLowerCase();if(!(a.has(c)||!u.trim())&&(a.add(c),n.push(u),n.length>=i))break}return n},"mergeUnique");return{...r,analyzedAt:e.analyzedAt,commitHash:e.commitHash??r.commitHash,projectInsights:t(r.projectInsights??[],e.projectInsights??[],60),architecture:{...r.architecture,insights:t(r.architecture.insights??[],e.architecture.insights??[],24)}}}m(dt,"mergeThinNotesIntoRich");async function pt(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm requires analysis text, JSON, or a file path");let o=Re.isAbsolute(t)?t:Re.resolve(e,t);try{if((await De.stat(o)).isFile())return{content:await De.readFile(o,"utf-8"),source:"file"}}catch{}return{content:r,source:"inline"}}m(pt,"resolveAnalysisInput");async function ft(r,e){let t=r.trim();if(!t)throw new Error("analysis-save-llm received an empty analysis");let o=ht(t);if(o.ok){let s=Ae(o.value);return s.ok?s.value:Me(`Structured analysis did not match the legacy schema; preserved as LLM notes.
|
|
12
12
|
|
|
13
13
|
${JSON.stringify(o.value,null,2)}`,e)}return Me(t,e)}m(ft,"normalizeAnalysis");function ht(r){try{return{ok:!0,value:JSON.parse(r)}}catch{return{ok:!1}}}m(ht,"tryParseJson");async function Me(r,e){let t=yt(r);return{version:1,commitHash:await wt(e),analyzedAt:I(),architecture:{style:"unknown",insights:t.slice(0,8),domains:[]},patterns:[],antiPatterns:[],techDebt:[],riskAreas:[],refactorSuggestions:[],projectInsights:t,conventions:[]}}m(Me,"analysisFromText");function yt(r){let e=r.split(/\r?\n/).map(s=>s.replace(/^\s{0,3}#{1,6}\s+/,"").replace(/^\s*[-*]\s+\[[ xX]\]\s+/,"").replace(/^\s*[-*]\s+/,"").replace(/^\s*\d+[.)]\s+/,"").trim()).filter(St),t=[],o=new Set;for(let s of e){let i=s.toLowerCase();if(!o.has(i)&&(o.add(i),t.push(s),t.length>=40))break}return t.length>0?t:[r.slice(0,2e3)]}m(yt,"textToInsights");function St(r){if(!r||!/[\p{L}\p{N}]/u.test(r))return!1;let e=r.toLowerCase().replace(/\s+/g," ").trim();return!(["current work","wip","misc","todo","n/a","none","latest","unreleased","changelog"].includes(e)||/^[-=_]{3,}$/.test(e)||/^(added|changed|fixed|removed)$/i.test(e)||/^v?\d+\.\d+\.\d+(?:-[\w.-]+)?$/i.test(e))}m(St,"isUsefulInsight");async function wt(r){try{let{stdout:e}=await ne("git",["rev-parse","HEAD"],{cwd:r});return e.trim()||null}catch{return null}}m(wt,"resolveCurrentCommit");async function Ne(r=process.cwd(),e={}){try{let t=await v(r);if(!t.ok)return t.result;let o=t.value,s=D.getActive(o);if(!s)return e.md?console.log(y("## No LLM Analysis","> Run `prjct sync` to generate.")):console.log(JSON.stringify({success:!1,message:"No LLM analysis found"})),{success:!1,message:"No LLM analysis found"};if(e.md){let i=[L(`LLM Analysis (${s.architecture.style})`),""];if(s.architecture.insights.length>0&&i.push(R("Architecture Insights",M(s.architecture.insights.slice(0,5)))),s.patterns.length>0){let n=s.patterns.slice(0,8);i.push(R(`Patterns (${s.patterns.length})`,M(n.map(a=>`**${a.name}** \u2014 ${a.description} (${a.category})`))))}if(s.antiPatterns.length>0){let n=s.antiPatterns.slice(0,5);i.push(R(`Anti-Patterns (${s.antiPatterns.length})`,M(n.map(a=>`[${a.severity}] ${a.issue} \u2014 ${a.suggestion}`))))}if(s.techDebt.length>0){let n=s.techDebt.slice(0,5);i.push(R(`Tech Debt (${s.techDebt.length})`,M(n.map(a=>`[${a.priority}/${a.effort}] ${a.description}`))))}s.conventions.length>0&&i.push(R("Conventions",M(s.conventions.slice(0,5).map(n=>`**${n.category}**: ${n.rule}`)))),console.log(y(...i))}else{let i={...s,patterns:s.patterns.slice(0,10),antiPatterns:s.antiPatterns.slice(0,6),techDebt:s.techDebt.slice(0,6),conventions:s.conventions.slice(0,6)};console.log(JSON.stringify({success:!0,analysis:i}))}return{success:!0,data:s}}catch(t){return A(t)}}m(Ne,"getLlmAnalysis");ce();J();import $t from"node:path";X();async function Te(r,e){let t=Date.now()-e;await le.installGlobalConfig(),d.done(`Synced ${r.stats.name||"project"} (${(t/1e3).toFixed(1)}s)`),console.log("");let o=r.stats.frameworks.length>0?` (${r.stats.frameworks[0]})`:"",s=r.syncMetrics?.indexes,i=[`${r.stats.fileCount} files indexed`,`Stack: ${r.stats.ecosystem}${o} | Branch: ${r.git.branch}`];if(s?.bm25Files){let a=s.bm25Files*(s.bm25AvgTokens||0);i.push(`Index: ${O(a)} tokens | ${s.bm25VocabSize||0} terms | ${s.importEdges||0} imports`)}d.box("Sync Summary",i.join(`
|
|
14
14
|
`));let n=[];if(r.generatedSkills?.generated&&r.generatedSkills.generated.length>0){let a=r.generatedSkills.generated.length,u=a===1?"skill":"skills";n.push(`${a} ${u} generated`)}if(r.context7&&n.push(`Context7: ${r.context7.verified?"verified":`not ready${r.context7.message?` (${r.context7.message})`:""}`}`),r.analysisSummary&&n.push(`Analysis: ${r.analysisSummary.patterns} patterns | ${r.analysisSummary.antiPatterns} anti-patterns (${r.analysisSummary.criticalAntiPatterns} critical)`),r.contextQuality){let a=r.contextQuality,u=a.irrelevantRemoved>0||a.repairEntriesCreated>0?`, repaired ${a.repairEntriesCreated}, removed ${a.irrelevantRemoved}`:"";n.push(`Context quality: ${a.score}/${a.threshold}${a.passed?"":" (needs review)"}${u}`)}if(d.section("Generated"),d.list(n,{bullet:"\u2713"}),console.log(""),r.phaseTimings&&r.phaseTimings.length>0){let a=[...r.phaseTimings].sort((u,c)=>c.ms-u.ms).slice(0,3).map(u=>`${u.phase} ${(u.ms/1e3).toFixed(1)}s`).join(", ");console.log(`Slowest phases: ${a}`),console.log("")}if(r.git.hasChanges&&(d.warn("Uncommitted changes detected"),console.log("")),r.verification){let a=r.verification;if(a.passed){let u=a.checks.map(c=>`${c.name} (${c.durationMs}ms)`);d.section("Verified"),d.list(u,{bullet:"\u2713"})}else{d.section("Verification");let u=a.checks.map(c=>c.passed?`\u2713 ${c.name}`:`\u2717 ${c.name}${c.error?` \u2014 ${c.error}`:""}`);d.list(u),a.skippedCount>0&&d.warn(`${a.skippedCount} check(s) skipped (fail-fast)`)}console.log("")}return ve("sync"),{success:!0,data:r,metrics:{elapsed:t,fileCount:r.stats.fileCount}}}m(Te,"showSyncResult");async function Fe(r){try{let e=await de.getRecentEvents(r,100),t=new Date().toISOString().split("T")[0],o=e.filter(c=>(c.timestamp||c.ts)?.startsWith(t)),s=(()=>{if(o.length<2)return null;let c=o.map(f=>new Date(f.timestamp||f.ts).getTime()).filter(f=>!Number.isNaN(f)).sort((f,h)=>f-h);if(c.length<2)return null;let p=c[c.length-1]-c[0];return oe(p)})(),i=o.filter(c=>c.action==="task_completed").length,n=o.filter(c=>c.action==="feature_shipped").length,a=new Map;for(let c of o)if(c.action==="sync"&&Array.isArray(c.subagents))for(let p of c.subagents)a.set(p,(a.get(p)||0)+1);let u=Array.from(a.entries()).map(([c,p])=>({name:c,count:p})).sort((c,p)=>p.count-c.count);return{sessionDuration:s,tasksCompleted:i,featuresShipped:n,agentsUsed:u}}catch{return{sessionDuration:null,tasksCompleted:0,featuresShipped:0,agentsUsed:[]}}}m(Fe,"getSessionActivity");function O(r){return r>=1e6?`${(r/1e6).toFixed(1)}M`:r>=1e3?`${(r/1e3).toFixed(1)}K`:r.toLocaleString()}m(O,"formatTokens");function se(r){return r<1e3?`${Math.round(r)}ms`:`${(r/1e3).toFixed(1)}s`}m(se,"formatDuration");function Ee(r){if(r.length===0)return"";let e="\u2581\u2582\u2583\u2584\u2585\u2586\u2587\u2588",t=r.map(s=>s.tokensSaved),o=Math.max(...t,1);return t.map(s=>{let i=Math.min(Math.floor(s/o*(e.length-1)),e.length-1);return e[i]}).join("")}m(Ee,"generateSparkline");function Oe(r,e,t,o,s,i){let n=[];if(n.push(`# ${t} - Stats Dashboard`),n.push(""),n.push(`_Generated: ${new Date().toLocaleString()} | Tracking since: ${o}_`),n.push(""),s){if(n.push("## Today's Activity"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),s.sessionDuration&&n.push(`| Duration | ${s.sessionDuration} |`),n.push(`| Tasks completed | ${s.tasksCompleted} |`),n.push(`| Features shipped | ${s.featuresShipped} |`),s.agentsUsed.length>0){let a=s.agentsUsed.slice(0,3).map(u=>`${u.name} (${u.count}\xD7)`).join(", ");n.push(`| Agents used | ${a} |`)}n.push("")}if(i&&(i.decisions>0||i.preferences>0)&&(n.push("## Patterns Learned"),n.push(""),n.push("| Type | Count |"),n.push("|------|-------|"),n.push(`| Decisions | ${i.learnedDecisions} confirmed (${i.decisions} total) |`),n.push(`| Preferences | ${i.preferences} |`),n.push(`| Workflows | ${i.workflows} |`),n.push("")),n.push("## Context Efficiency"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Tokens reduced | ${O(r.totalTokensSaved)} |`),n.push(`| Compression | ${(r.compressionRate*100).toFixed(0)}% |`),n.push(`| Est. cost saved | ${U(r.estimatedCostSaved)} |`),n.push(""),n.push("## Performance"),n.push(""),n.push("| Metric | Value |"),n.push("|--------|-------|"),n.push(`| Syncs | ${r.syncCount} |`),n.push(`| Avg time | ${se(r.avgSyncDuration)} |`),n.push(""),r.topAgents.length>0){n.push("## Agent Usage"),n.push(""),n.push("| Agent | Usage |"),n.push("|-------|-------|");let a=r.topAgents.reduce((u,c)=>u+c.usageCount,0);for(let u of r.topAgents){let c=a>0?(u.usageCount/a*100).toFixed(0):0;n.push(`| ${u.agentName} | ${c}% (${u.usageCount}) |`)}n.push("")}if(n.push("## 30-Day Trend"),n.push(""),n.push(`- Tokens saved: ${O(r.last30DaysTokens)}`),r.trend!==0){let a=r.trend>0?"+":"";n.push(`- Trend: ${a}${r.trend.toFixed(0)}% vs previous period`)}return n.push(""),n.push("---"),n.push(""),n.push("_Generated with [prjct-cli](https://prjct.app)_"),n.join(`
|
|
@@ -37,6 +37,6 @@ ${JSON.stringify(o.value,null,2)}`,e)}return Me(t,e)}m(ft,"normalizeAnalysis");f
|
|
|
37
37
|
Next steps:`),console.log("\u2022 p. sync \u2192 Generate agents based on stack"),console.log('\u2022 p. work "<intent>" \u2192 Start a work cycle'),{success:!0,summary:s,data:o}}catch(o){return console.error("\u274C Error:",k(o)),A(o)}}async sync(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=Date.now();if(t.package){let a=await ie.detectMonorepo(e);if(!a.isMonorepo)return{success:!1,error:"Not a monorepo. --package flag only works in monorepos."};let u=a.packages.find(p=>p.name===t.package||p.relativePath===t.package);if(!u){let p=a.packages.map(f=>f.name).join(", ");return{success:!1,error:`Package "${t.package}" not found. Available: ${p}`}}let c=await H.sync(e,{packagePath:u.path,packageName:u.name});return t.json?console.log(JSON.stringify({success:c.success,package:u.name,path:u.relativePath})):t.md?console.log(y(L(`Synced package: ${u.name}`))):d.done(`Synced package: ${u.name}`),{success:c.success}}t.md||d.spin("Syncing project...");let n=await H.sync(e,{full:t.full});if(!n.success)return t.md?console.log(y("## Sync Failed",`> ${n.error||"Unknown error"}`)):d.fail(n.error||"Sync failed"),{success:!1,error:n.error};if(t.md||d.stop(),t.md){let a=Date.now()-i,u=n.generatedSkills?.generated?.length??0,c=await b.diff(s).then(g=>g?.hasChanges?G(g):null).catch(()=>null),p=n.git.recentCommits[0]?.hash??null,h=p&&D.isCurrent(s,p)?null:await ee(s,e,n.git,n.stats).then(g=>["## Analysis Payload",Ge,"### Data","```json",JSON.stringify(g),"```"].join(`
|
|
38
38
|
`)).catch(()=>"### Next: Run `prjct analysis-payload --md` to update project analysis"),x=$e("sync",!0),B=(()=>{try{let g=he.recall(s,{types:["context"],limit:5}).map(F=>`- ${fe(F)} \`${F.id}\``);return g.length>0?["### Evaluate recent context","Task contexts captured recently \u2014 fold their decisions, patterns and","anti-patterns into the project analysis (and supersede anything now wrong):","",...g].join(`
|
|
39
39
|
`):null}catch{return null}})(),T=n.syncMetrics?.indexes,P={Duration:`${(a/1e3).toFixed(1)}s`,Skills:`${u} generated`,"Files indexed":n.stats.fileCount};if(T?.bm25Files){let g=T.bm25Files*(T.bm25AvgTokens||0);P["Tokens indexed"]=`${Math.round(g/1e3)}K`,P["Import edges"]=T.importEdges||0,P["Co-change commits"]=T.cochangeCommits||0}n.contextQuality&&(P["Context quality"]=`${n.contextQuality.score}/${n.contextQuality.threshold}`+(n.contextQuality.passed?"":" needs review"),P["Context removed"]=n.contextQuality.irrelevantRemoved,P["Context repairs"]=n.contextQuality.repairEntriesCreated);let Q=n.phaseTimings&&n.phaseTimings.length>0?R("Phase timings (slowest first)",M([...n.phaseTimings].sort((g,F)=>F.ms-g.ms).map(g=>`${g.phase}: ${(g.ms/1e3).toFixed(2)}s`))):null,qe=(()=>{if(!n.retentionDryRun)return null;let g=n.retentionDryRun,F=g.dryRun===!1?"applied":"dry-run",Be=g.dryRun===!1?` \xB7 acted: ${g.archived??0} archived, ${g.deleted??0} deleted`+(g.inboxMerged||g.inboxArchived?`, inbox ${g.inboxMerged??0} merged/${g.inboxArchived??0} archived`:""):"";if(P[`Retention (${F})`]=`${g.active} active \xB7 ${g.archive} archive \xB7 ${g.delete} delete${Be}`,g.vault){let w=g.vault,W=g.dryRun===!1?` \xB7 purged: hard\u0394${w.softDeletedPurged??0} distill\u0394${w.distilledDiscarded??0} digests+${w.digestsWritten??0} arch\u0394${w.archivesPruned??0}`:"";P.Vault=`${w.live} live \xB7 soft-del ${w.softDeleted} \xB7 archives ${w.archives} \xB7 auto ${w.autoSourceLive}${W}`}return g.samples.length>0?R(g.dryRun===!1?"Retention (Rho) \u2014 worst excess/score (actions applied)":"Retention (Rho) dry-run \u2014 worst excess/score (nothing removed)",M(g.samples.map(w=>{let W="excess"in w&&typeof w.excess=="number"?` excess=${w.excess.toFixed(2)}`:"";return`\`${w.id}\` [${w.type}] ${w.verdict} (${w.score}${W}) \u2014 ${w.reasons.join(", ")}`}))):null})(),He=n.projectStyle?.evolutionMd?n.projectStyle.evolutionMd:n.projectStyle?.summary?["## Project style","",n.projectStyle.summary,"",`Coverage: ${n.projectStyle.styleCoverage}/100 \xB7 ${n.projectStyle.patternCount} patterns \xB7 ${n.projectStyle.conventionCount} conventions \xB7 ${n.projectStyle.antiPatternCount} anti-patterns`].join(`
|
|
40
|
-
`):null,ze=n.developerSnapshotCaptured?await import("./developer-evolution-
|
|
40
|
+
`):null,ze=n.developerSnapshotCaptured?await import("./developer-evolution-UTY3CWOK.mjs").then(({renderDeveloperEvolution:g})=>g(s,4)).catch(()=>`## Developer evolution
|
|
41
41
|
|
|
42
42
|
Weekly developer snapshot captured.`):null,Ve=y(L("Sync Complete"),E(P),Q,qe,c,He,ze,n.git.hasChanges?z("Uncommitted changes detected"):null,B,h,we(x.map(g=>({label:g.desc,command:g.cmd}))));return console.log(Ve),{success:!0,data:n,metrics:{elapsed:a,skillCount:u,fileCount:n.stats.fileCount}}}return Te(n,i)}catch(o){return t.md?console.log(y("## Sync Failed",`> ${k(o)}`)):d.fail(k(o)),A(o)}}async analysisPayload(e=process.cwd(),t={}){try{let o=await v(e);if(!o.ok)return o.result;let s=o.value,i=await H.sync(e);if(!i.success)return{success:!1,error:i.error||"Failed to gather project data"};let n=i.git.recentCommits[0]?.hash??null;if(n&&D.isCurrent(s,n))return t.md?console.log(y(L("LLM analysis is current"),"> No re-analysis needed.")):console.log(JSON.stringify({success:!0,action:"skip",message:"Analysis is current"})),{success:!0,message:"Analysis is current"};let a=await ee(s,e,i.git,i.stats);return t.md?console.log(y("## Analysis Payload",Ge,"### Data","```json",JSON.stringify(a),"```")):console.log(JSON.stringify({success:!0,payload:a})),{success:!0,data:a}}catch(o){return A(o)}}async saveLlmAnalysis(...e){return Le(...e)}async getLlmAnalysis(...e){return Ne(...e)}async stats(...e){return Je(...e)}async diff(...e){return _e(...e)}async seal(...e){return be(...e)}async rollback(...e){return Ce(...e)}async verify(...e){return xe(...e)}async semanticVerify(...e){return te(...e)}};export{Ue as AnalysisCommands};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as n}from"./chunk-
|
|
8
|
+
import{a as n}from"./chunk-DB226JIV.mjs";import"./chunk-JZDZH6IV.mjs";import"./chunk-XV2LJVYB.mjs";import"./chunk-YHOZTAZH.mjs";import"./chunk-DCHIPMOG.mjs";import"./chunk-DYHYDHCW.mjs";import"./chunk-R4ILCXKE.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-OC4CYF7V.mjs";import"./chunk-3FBCOCPD.mjs";import"./chunk-XDBJSJOT.mjs";import"./chunk-D7DQABWO.mjs";import"./chunk-OUAS3LZ3.mjs";import"./chunk-ETTDRXQ6.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-BUDZL4DW.mjs";import{a as t}from"./chunk-E66B27AL.mjs";async function c(u,o){try{let e=o??await import("./config-manager-2JJPCLKC.mjs").then(({default:a})=>a.readConfig(u).catch(()=>null));if(!e?.projectId||!e.cloud?.enabled||e.cloud.paused)return{ran:!1};if(!await n.hasAuth())return{ran:!1};let r=await n.sync(e.projectId,{include:e.cloud.include??{}});return{ran:!0,pushed:r.pushed?.count??0,pulled:r.pulled?.count??0,error:r.success?void 0:r.error}}catch{return{ran:!1}}}t(c,"flushIfLinked");export{c as flushIfLinked};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{i as a}from"./chunk-
|
|
8
|
+
import{i as a}from"./chunk-EGCYDLSO.mjs";import"./chunk-7PBWIO4K.mjs";import"./chunk-Y5NQV46G.mjs";import"./chunk-DXQMKW2B.mjs";import"./chunk-RT2DFIWF.mjs";import"./chunk-PVCEWFHS.mjs";import"./chunk-LR24AIEW.mjs";import"./chunk-UUULLTQV.mjs";import"./chunk-FZS3XGEA.mjs";import"./chunk-7WO5CEH3.mjs";import"./chunk-AORD3YDQ.mjs";import"./chunk-M5E2YOZ4.mjs";import"./chunk-GAOQHD5S.mjs";import"./chunk-ZZBNFNMG.mjs";import"./chunk-3FEXJUO2.mjs";import"./chunk-TKXOMN4K.mjs";import"./chunk-CE4RCNC7.mjs";import"./chunk-A6K4H3YT.mjs";import"./chunk-HDSS6UB3.mjs";import"./chunk-JQE2F2RK.mjs";import"./chunk-WUHGODSQ.mjs";import"./chunk-UH4MD3F3.mjs";import"./chunk-QWQFF2UG.mjs";import"./chunk-GCKILEXJ.mjs";import"./chunk-IJ523YO2.mjs";import"./chunk-PKDYFXMI.mjs";import"./chunk-BUDZL4DW.mjs";import"./chunk-E66B27AL.mjs";export{a as captureGate};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as r,c as d}from"./chunk-QSAA6LZF.mjs";import{e as o,g as p}from"./chunk-
|
|
8
|
+
import{b as r,c as d}from"./chunk-QSAA6LZF.mjs";import{e as o,g as p}from"./chunk-TKXOMN4K.mjs";import{b as n,h as m}from"./chunk-A6K4H3YT.mjs";import{a}from"./chunk-E66B27AL.mjs";m();p();var u="judgment:active",c="judgment:ghosts",g=class{static{a(this,"JudgmentLedgerStorage")}get(s){let t=o.getDoc(s,u);if(t===null)return null;let e=r.safeParse(t);return e.success?e.data:null}set(s,t){let e=t.updatedAt||n();return o.updateDoc(s,u,()=>r.parse({...t,updatedAt:e}),()=>r.parse({...t,updatedAt:e}))}clear(s){o.deleteDoc(s,u)}getGhosts(s){let t=o.getDoc(s,c);if(t===null)return{ghosts:[],updatedAt:n()};let e=d.safeParse(t);return e.success?e.data:{ghosts:[],updatedAt:n()}}setGhosts(s,t){let e=d.parse(t);return o.setDoc(s,c,e),e}},w=new g;export{u as a,c as b,w as c};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as j,b as f,d as x,e as I}from"./chunk-
|
|
8
|
+
import{a as j,b as f,d as x,e as I}from"./chunk-ZYCNW75E.mjs";import{a as D}from"./chunk-JR542RI2.mjs";import{b as v}from"./chunk-CPR4FPXG.mjs";import{g as C,h as M,i as w,j as E,o as R}from"./chunk-3HGQPUKG.mjs";import{b}from"./chunk-PVCEWFHS.mjs";import{a as S,b as K,d as m,g as U}from"./chunk-TKXOMN4K.mjs";import{a as c}from"./chunk-E66B27AL.mjs";K();import g from"node:fs/promises";import d from"node:path";U();var q=/^(main|index|app|server|cli|handler|router|bootstrap|init|start|run|default)$/i;function L(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 o=w(t),n=new Map,r=new Map,a=new Map,u=[],p=[];for(let i of o){n.set(i.kind,(n.get(i.kind)??0)+1),r.set(i.file,(r.get(i.file)??0)+1);let l=i.file.includes(".")?i.file.slice(i.file.lastIndexOf(".")):"(none)";a.set(l,(a.get(l)??0)+1),i.kind==="route"&&u.push({name:i.name,file:i.file,line:i.startLine}),i.exported&&q.test(i.name)&&(i.kind==="function"||i.kind==="class")&&!/__tests__|\.test\.|\.spec\.|fixtures?\//i.test(i.file)&&p.push({name:i.name,file:i.file,kind:i.kind})}let y=[...r.keys()],h=[],Y=R(t),J=y.length>400?y.slice(0,400):y;for(let i of J){let l=Y.get(i)??0;l>0&&h.push({file:i,fanIn:l,symbolCount:r.get(i)??0})}h.sort((i,l)=>l.fanIn-i.fanIn);let k=new Set,A=v(t);if(A)for(let i of Object.keys(A.forward).slice(0,2e3)){let l=i.includes("/")?i.slice(0,i.indexOf("/")):i;l&&!l.startsWith(".")&&k.add(l)}for(let i of y.slice(0,2e3)){let l=i.includes("/")?i.slice(0,i.indexOf("/")):".";l&&l!=="."&&k.add(l)}if(p.length<8)for(let i of o){if(p.length>=12)break;i.exported&&i.kind==="class"&&!p.some(l=>l.file===i.file)&&p.push({name:i.name,file:i.file,kind:i.kind})}return{ready:!0,builtAt:e?.builtAt??null,symbols:e?.symbolCount??o.length,edges:e?.edgeCount??0,files:e?.fileCount??r.size,languages:[...a.entries()].map(([i,l])=>({ext:i,count:l})).sort((i,l)=>l.count-i.count).slice(0,12),kinds:[...n.entries()].map(([i,l])=>({kind:i,count:l})).sort((i,l)=>l.count-i.count),routes:u.slice(0,30),hotspots:h.slice(0,15),entryCandidates:p.slice(0,15),packages:[...k].sort().slice(0,40),note:"Structural only (symbol + import graphs). Narrative architecture lives in prjct analysis / memory decisions."}}c(L,"buildArchitectureSnapshot");function O(t,e){let s=[];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 o=t.payload,n=e.payload;return o.stack.ecosystem!==n.stack.ecosystem&&s.push({field:"Ecosystem",type:"changed",before:o.stack.ecosystem,after:n.stack.ecosystem}),(o.stack.packageManager??"")!==(n.stack.packageManager??"")&&s.push({field:"Package manager",type:"changed",before:o.stack.packageManager??"(none)",after:n.stack.packageManager??"(none)"}),P("Languages",o.stack.languages,n.stack.languages,s),P("Frameworks",o.stack.frameworks,n.stack.frameworks,s),P("Key libraries",o.stack.keyLibraries,n.stack.keyLibraries,s),o.stack.hasTests!==n.stack.hasTests&&s.push({field:"Has tests",type:"changed",before:String(o.stack.hasTests),after:String(n.stack.hasTests)}),_("Pattern",o.patterns.map(r=>[r.key,r.name]),n.patterns.map(r=>[r.key,r.name]),s),_("Anti-pattern",o.antiPatterns.map(r=>[r.key,r.issue]),n.antiPatterns.map(r=>[r.key,r.issue]),s),_("Convention",o.conventions.map(r=>[r.key,r.rule]),n.conventions.map(r=>[r.key,r.rule]),s),o.structural.symbols!==n.structural.symbols&&(o.structural.symbols>0||n.structural.symbols>0)&&s.push({field:"Symbols",type:"changed",before:String(o.structural.symbols),after:String(n.structural.symbols)}),o.structural.files!==n.structural.files&&s.push({field:"Files",type:"changed",before:String(o.structural.files),after:String(n.structural.files)}),D(s,t.commitHash,e.commitHash)}c(O,"generateProjectStyleDiff");function F(t){if(!t.hasChanges)return`## Project evolution
|
|
9
9
|
|
|
10
10
|
No style changes since last sync.`;let e=["## Project evolution (this sync)"];(t.beforeCommit||t.afterCommit)&&e.push(`> \`${T(t.beforeCommit)}\` \u2192 \`${T(t.afterCommit)}\``),e.push(""),e.push(`+${t.summary.added} \xB7 \u2212${t.summary.removed} \xB7 ~${t.summary.changed}`),e.push("");for(let s of t.items.slice(0,20)){let o=s.type==="added"?"+":s.type==="removed"?"\u2212":"~";s.type==="changed"?e.push(`- ${o} **${s.field}**: ${s.before} \u2192 ${s.after}`):s.type==="added"?e.push(`- ${o} **${s.field}**: ${s.after}`):e.push(`- ${o} **${s.field}**: ${s.before}`)}return e.join(`
|
|
11
11
|
`)}c(F,"formatProjectStyleDiffMd");function T(t){return t?t.length>7?t.slice(0,7):t:"(none)"}c(T,"short");function P(t,e,s,o){let n=new Set(e.map(a=>a.toLowerCase())),r=new Set(s.map(a=>a.toLowerCase()));for(let a of s)n.has(a.toLowerCase())||o.push({field:t,type:"added",after:a});for(let a of e)r.has(a.toLowerCase())||o.push({field:t,type:"removed",before:a})}c(P,"diffStringArray");function _(t,e,s,o){let n=new Map(e),r=new Map(s);for(let[a,u]of r)n.has(a)?n.get(a)!==u&&o.push({field:t,type:"changed",before:n.get(a),after:u}):o.push({field:t,type:"added",after:u});for(let[a,u]of n)r.has(a)||o.push({field:t,type:"removed",before:u})}c(_,"diffKeyed");var H=50;function W(t){let e=(()=>{try{return JSON.parse(t.payload_json)}catch{return z()}})();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}}c(W,"rowToSnapshot");function z(){return{payloadVersion:1,stack:{ecosystem:"unknown",languages:[],frameworks:[],keyLibraries:[],hasTests:!1,hasDocker:!1},commands:{},conventions:[],patterns:[],antiPatterns:[],structural:{symbols:0,files:0,packages:[]},metrics:{}}}c(z,"emptyPayload");function N(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?W(e):null}catch{return null}}c(N,"getActiveProjectStyle");function G(t,e=12){try{return m.query(t,"SELECT * FROM project_style_snapshots ORDER BY captured_at DESC LIMIT ?",e).map(W)}catch{return[]}}c(G,"getProjectEvolution");function jt(t,e=6){let s=G(t,e);if(s.length===0)return null;let o=["## Project evolution"];if(s.length>=2){let n=s[0],r=s[s.length-1],a=n.patternCount-r.patternCount,u=n.conventionCount-r.conventionCount,p=n.fileCount-r.fileCount;o.push(`Over ${s.length} snapshots: patterns ${$(a)}, conventions ${$(u)}, files ${$(p)}.`)}for(let n of s)o.push(`- ${n.capturedAt.slice(0,10)} \u2014 ${n.summary}`);return o.join(`
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-
|
|
8
|
+
import{a as f}from"./chunk-HGZQWYBL.mjs";import{a as i}from"./chunk-ZMLA5SKR.mjs";import{b as y}from"./chunk-PVCEWFHS.mjs";import{d as g,g as x}from"./chunk-TKXOMN4K.mjs";import{a}from"./chunk-E66B27AL.mjs";import{execFileSync as S}from"node:child_process";x();var j="land-auto",$="session-close";async function N(t){let o=L(t);if(!o)return{wrote:!1,content:null,reason:"nothing-to-land"};try{return await y.remember(t.projectPath,{type:"context",content:o,tags:{source:j,topic:$,capture:"land-v2",context_schema:"living-v2",synthesis:"deterministic"},provenance:"extracted",projectId:t.projectId}),{wrote:!0,content:o}}catch(r){return{wrote:!1,content:o,reason:`remember-failed: ${r.message}`}}}a(N,"synthesizeLandHandoff");function L(t){let o=t.cycleDescription?.trim()||null,r=f(t.projectId,t.cycleId),u=k(t.projectPath),c=b(t.projectId);if(!o&&r.length===0&&u.length===0&&c.length===0)return null;let e=[];o?e.push(`Session close: Work cycle "${i(o,120)}" still open or just closed.`):e.push("Session close: no open work cycle \u2014 landed repo + capture signals only."),e.push("Context synthesis: Passive land hand-off from durable signals (cycle, journal, commits, auto-captures). Not a model essay."),e.push(`Key data: source=${j}; topic=${$}; capture=land-v2`);let l=[];if(o&&l.push(`cycle="${i(o,100)}"`),r.length>0&&l.push(`journal: ${r.map(s=>i(s,70)).join(" \xB7 ")}`),l.length>0&&e.push(`What happened: ${l.join("; ")}`),r.length>0&&e.push(`Why it mattered: Journal trail shows progression \u2014 ${r.slice(0,2).map(s=>i(s,80)).join(" \xB7 ")}`),c.length>0){let s=c.filter(n=>n.type==="learning"||n.type==="decision"||n.type==="fact").slice(0,4),p=c.filter(n=>n.type==="gotcha"||n.type==="anti-pattern").slice(0,3);s.length>0&&e.push(`Learned this session: ${s.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`),p.length>0&&e.push(`Decision/trap: ${p.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`);let I=new Set([...s,...p]),d=c.filter(n=>!I.has(n)).slice(0,3);d.length>0&&s.length===0&&p.length===0&&e.push(`Decision/trap: ${d.map(n=>`[${n.type}] ${i(n.content,100)}`).join(" \xB7 ")}`)}u.length>0&&e.push(`Outcome: Recent commits: ${u.join("; ")}`),t.author&&e.push(`Who/author: ${t.author}`),t.model&&e.push(`Model: ${t.model}`);let m=t.tokensIn,h=t.tokensOut;if(m!=null||h!=null){let s=(m??0)+(h??0);e.push(`Token usage: in=${m??0} out=${h??0} total=${s} (compound judgment \u2014 not a fresh-window thrash loop)`)}e.push("Feature/domain: session-close"),e.push("Pattern: land auto-synthesis without agent remember"),e.push("Anti-pattern: relying on the model to remember to remember at session end"),e.push("Competitive: next window must `prjct prime` \u2014 act as this developer with SQLite judgment, not re-research from zero (GSD tax).");let w=o!=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 e.push(`Next implication: ${w}`),e.join(" \xB7 ")}a(L,"buildLandHandoffContent");function k(t){try{return S("git",["log","-5","--oneline","--no-decorate"],{cwd:t,encoding:"utf-8",timeout:3e3,stdio:["ignore","pipe","ignore"]}).split(`
|
|
9
9
|
`).map(r=>r.trim()).filter(Boolean)}catch{return[]}}a(k,"recentCommits");function b(t){try{return g.query(t,`SELECT me.type, me.content
|
|
10
10
|
FROM memory_entries me
|
|
11
11
|
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as y}from"./chunk-R4ILCXKE.mjs";import{e as g,g as T}from"./chunk-
|
|
8
|
+
import{c as y}from"./chunk-R4ILCXKE.mjs";import{e as g,g as T}from"./chunk-TKXOMN4K.mjs";import{d as b,e as I,o as A}from"./chunk-UH4MD3F3.mjs";import{a as l}from"./chunk-E66B27AL.mjs";import v from"node:fs/promises";import w from"node:path";T();A();var D=new Set(["the","a","an","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","shall","can","of","in","to","for","with","on","at","from","by","as","or","and","but","if","not","no","so","up","out","this","that","it","its","all","any","import","export","default","const","let","var","function","class","interface","type","return","new","true","false","null","undefined","void","async","await","static","public","private","protected","readonly","string","number","boolean","object","array"]);function p(t){return t.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/[-_./]/g," ").toLowerCase().split(/\s+/).filter(n=>n.length>1)}l(p,"splitIdentifier");function B(t,n){let e=[],o=n.replace(/\.[^.]+$/,"").split(/[/\\]/).filter(Boolean);for(let i of o)e.push(...p(i));let r=[/export\s+(?:async\s+)?function\s+(\w+)/g,/export\s+class\s+(\w+)/g,/export\s+interface\s+(\w+)/g,/export\s+type\s+(\w+)/g,/export\s+(?:const|let|var)\s+(\w+)/g,/export\s+default\s+(?:class|function)\s+(\w+)/g];for(let i of r)for(let s of t.matchAll(i))s[1]&&e.push(...p(s[1]));let a=[/(?:async\s+)?function\s+(\w+)/g,/class\s+(\w+)/g,/interface\s+(\w+)/g,/type\s+(\w+)\s*=/g];for(let i of a)for(let s of t.matchAll(i))s[1]&&e.push(...p(s[1]));let d=/(?:from|import)\s+['"]([^'"]+)['"]/g;for(let i of t.matchAll(d)){let s=i[1];if(s.startsWith(".")||s.startsWith("@/"))e.push(...p(s));else{let f=s.startsWith("@")?s.split("/").slice(0,2).join("/"):s.split("/")[0];e.push(...p(f))}}let c=/\/\/\s*(.+)/g;for(let i of t.matchAll(c)){let s=i[1].toLowerCase().split(/\s+/).filter(f=>f.length>2);e.push(...s)}let u=/\/\*\*?([\s\S]*?)\*\//g;for(let i of t.matchAll(u)){let s=i[1].replace(/@\w+/g,"").replace(/\*/g,"").toLowerCase().split(/\s+/).filter(f=>f.length>2&&/^[a-z]+$/.test(f));e.push(...s)}return e.filter(i=>i.length>1&&!D.has(i)&&/^[a-z][a-z0-9]*$/.test(i))}l(B,"tokenizeFile");function R(t){return t.split(/\s+/).flatMap(n=>p(n)).filter(n=>n.length>1&&!D.has(n)&&/^[a-z][a-z0-9]*$/.test(n))}l(R,"tokenizeQuery");function x(){return Object.create(null)}l(x,"emptyInvertedIndex");async function C(t){let n=await b(t),e={},o=x(),r=await I(n,50,async c=>{try{let u=await v.readFile(w.join(t,c),"utf-8"),i=B(u,c);return i.length>0?{filePath:c,tokens:i}:null}catch{return null}});for(let{filePath:c,tokens:u}of r){e[c]={tokens:u,length:u.length};for(let[i,s]of M(u))o[i]||(o[i]=[]),o[i].push({path:c,tf:s})}let a=r.reduce((c,u)=>c+u.tokens.length,0),d=Object.keys(e).length;return{documents:e,invertedIndex:o,avgDocLength:d>0?a/d:0,totalDocs:d,builtAt:new Date().toISOString()}}l(C,"buildIndex");function N(t,n){return Math.log((n-t+.5)/(t+.5)+1)}l(N,"idf");function F(t,n){let e=R(t);if(e.length===0)return[];let o=new Map;for(let r of e){let a=n.invertedIndex[r];if(!a)continue;let d=N(a.length,n.totalDocs);for(let{path:c,tf:u}of a){let i=n.documents[c];if(!i)continue;let s=u*(1.2+1),f=u+1.2*(1-.75+.75*(i.length/n.avgDocLength)),L=d*(s/f);o.set(c,(o.get(c)||0)+L)}}return y(o)}l(F,"score");var h="bm25-index";function M(t){let n=new Map;for(let e of t)n.set(e,(n.get(e)||0)+1);return n}l(M,"termFrequencies");function P(t,n){let e=t.documents[n];if(!e)return;delete t.documents[n];let o=new Set(e.tokens),r=o.size>0?o:new Set(Object.keys(t.invertedIndex));for(let a of r){let d=t.invertedIndex[a];if(!d)continue;let c=d.filter(u=>u.path!==n);c.length===0?delete t.invertedIndex[a]:t.invertedIndex[a]=c}}l(P,"removeDocument");function z(t,n,e){if(e.length!==0){t.documents[n]={tokens:e,length:e.length};for(let[o,r]of M(e))t.invertedIndex[o]||(t.invertedIndex[o]=[]),t.invertedIndex[o].push({path:n,tf:r})}}l(z,"addDocument");function q(t){let n=Object.values(t.documents).map(o=>o.length),e=n.reduce((o,r)=>o+r,0);t.totalDocs=n.length,t.avgDocLength=n.length>0?e/n.length:0,t.builtAt=new Date().toISOString()}l(q,"recalculateStats");var m=new Map;function _(t){return{schemaVersion:2,avgDocLength:t.avgDocLength,totalDocs:t.totalDocs,builtAt:t.builtAt,docLengths:Object.fromEntries(Object.entries(t.documents).map(([n,e])=>[n,e.length]))}}l(_,"indexMetadata");function k(t,n,e,o,r){if(o.length!==0){t.run(e,JSON.stringify(o),o.length,r);for(let[a,d]of M(o))n.run(a,e,d)}}l(k,"writeDocumentRows");function W(t,n){try{g.transaction(t,e=>{e.prepare("DELETE FROM bm25_terms").run(),e.prepare("DELETE FROM bm25_documents").run();let o=new Date().toISOString(),r=e.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),a=e.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)");for(let[d,c]of Object.entries(n.documents))k(r,a,d,c.tokens,o)})}catch{}}l(W,"replacePerFileTables");function $(t,n,e,o){try{g.transaction(t,r=>{let a=r.prepare("DELETE FROM bm25_terms WHERE path = ?"),d=r.prepare("DELETE FROM bm25_documents WHERE path = ?"),c=r.prepare("INSERT INTO bm25_documents (path, tokens, length, updated_at) VALUES (?, ?, ?, ?)"),u=r.prepare("INSERT INTO bm25_terms (token, path, tf) VALUES (?, ?, ?)"),i=new Date().toISOString();for(let s of new Set([...e,...o]))a.run(s),d.run(s);for(let s of e){let f=n.documents[s];f&&k(c,u,s,f.tokens,i)}})}catch{}}l($,"updatePerFileTables");function H(t,n){g.setDoc(t,h,_(n)),W(t,n),m.delete(t)}l(H,"saveIndex");function U(t,n,e,o){g.setDoc(t,h,_(n)),$(t,n,e,o),m.delete(t)}l(U,"saveIndexUpdate");function V(t,n,e){try{let o=g.query(t,"SELECT path, length FROM bm25_documents ORDER BY path");if(o.length===0){if(e?.totalDocs===0){let s={documents:{},invertedIndex:x(),avgDocLength:0,totalDocs:0,builtAt:e.builtAt};return m.set(t,{index:s,updatedAt:n}),s}return null}let r={},a=x();for(let s of o)r[s.path]={tokens:[],length:s.length};let d=o.reduce((s,f)=>s+f.length,0),c=g.query(t,"SELECT token, path, tf FROM bm25_terms ORDER BY token, path");for(let s of c)a[s.token]||(a[s.token]=[]),a[s.token].push({path:s.path,tf:s.tf});let u=o.length,i={documents:r,invertedIndex:a,avgDocLength:u>0?d/u:0,totalDocs:u,builtAt:e?.builtAt??n};return m.set(t,{index:i,updatedAt:n}),i}catch{return null}}l(V,"loadIndexFromPerFileTables");function tt(t){try{return g.get(t,"SELECT key AS k FROM kv_store WHERE key = ? LIMIT 1",h)!=null}catch{return!1}}l(tt,"hasIndex");function O(t){let n=g.get(t,"SELECT updated_at FROM kv_store WHERE key = ?",h);if(!n)return m.delete(t),null;let e=m.get(t);if(e&&e.updatedAt===n.updated_at)return e.index;let o=g.getDoc(t,h),r=V(t,n.updated_at,o);if(r)return r;if(!o?.invertedIndex)return null;let a={};for(let[c,u]of Object.entries(o.docLengths))a[c]={tokens:[],length:u};let d={documents:a,invertedIndex:Object.assign(x(),o.invertedIndex),avgDocLength:o.avgDocLength,totalDocs:o.totalDocs,builtAt:o.builtAt};return m.set(t,{index:d,updatedAt:n.updated_at}),d}l(O,"loadIndex");async function Y(t,n){let e=await C(t);return H(n,e),e}l(Y,"indexProject");async function nt(t,n,e,o=[]){let r=O(n);if(!r)return Y(t,n);let a=new Set([...e,...o]);for(let c of a)P(r,c);let d=await I(e,50,async c=>{try{let u=await v.readFile(w.join(t,c),"utf-8"),i=B(u,c);return{filePath:c,tokens:i}}catch{return null}});for(let{filePath:c,tokens:u}of d)z(r,c,u);return q(r),U(n,r,e,o),r}l(nt,"updateProjectIndex");function et(t,n,e=15){let o=O(t);return o?F(n,o).slice(0,e):[]}l(et,"queryFiles");export{tt as a,O as b,Y as c,nt as d,et as e};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{d as a,g as h}from"./chunk-
|
|
8
|
+
import{d as a,g as h}from"./chunk-TKXOMN4K.mjs";import{b as u,p as l}from"./chunk-QWQFF2UG.mjs";import{a as e}from"./chunk-E66B27AL.mjs";h();l();function d(n){let t=n.toLowerCase();return t.includes("github")?"github":t.includes("gitlab")?"gitlab":t.includes("bitbucket")?"bitbucket":"other"}e(d,"providerForHost");function p(n){let t=n.trim();if(!t)return{};let r=t.match(/^[^/@]+@([^:/]+):(.+?)(?:\.git)?\/?$/);if(r)return{provider:d(r[1]),repoSlug:r[2]};try{let o=new URL(t),c=o.pathname.replace(/^\/+/,"").replace(/\.git$/,"").replace(/\/+$/,"");return!o.host||!c?{}:{provider:d(o.host),repoSlug:c}}catch{return{}}}e(p,"parseRemote");async function y(n){try{let{stdout:t}=await u("git",["remote","get-url","origin"],{cwd:n});return t.trim()||void 0}catch{return}}e(y,"gitRemoteUrl");async function b(n){try{let{stdout:t}=await u("git",["symbolic-ref","--short","refs/remotes/origin/HEAD"],{cwd:n});return t.trim().replace(/^origin\//,"")||void 0}catch{return}}e(b,"gitDefaultBranch");function i(n){return typeof n=="string"&&n.length>0?n:void 0}e(i,"str");function g(n){return typeof n=="number"&&Number.isFinite(n)?n:void 0}e(g,"num");function P(n){return Object.fromEntries(Object.entries(n).filter(([,t])=>t!==void 0))}e(P,"compact");async function S(n){let t=a.getDoc(n,"project")||{},r=i(t.repoPath),{provider:o,repoSlug:c}=r?p(await y(r)||""):{},f=r?await b(r):void 0,s=Array.isArray(t.techStack)?t.techStack.filter(m=>typeof m=="string"):void 0;return P({provider:o,repoSlug:c,currentBranch:i(t.currentBranch),defaultBranch:f,stack:i(t.stack),techStack:s&&s.length>0?s:void 0,version:i(t.version),commitCount:g(t.commitCount),fileCount:g(t.fileCount),lastCommit:i(t.lastSyncCommit),hasUncommitted:typeof t.hasUncommittedChanges=="boolean"?t.hasUncommittedChanges:void 0,cliVersion:i(t.cliVersion),syncedAt:i(t.lastSync)})}e(S,"buildProjectMeta");export{p as a,S as b};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as S,g as G}from"./chunk-
|
|
8
|
+
import{e as S,g as G}from"./chunk-TKXOMN4K.mjs";import{a as B,c as te,d as W,e as $,o as ne}from"./chunk-UH4MD3F3.mjs";import{a as d}from"./chunk-E66B27AL.mjs";te();import N from"node:fs/promises";import E from"node:path";G();function j(e,n){S.transaction(e,t=>{t.prepare("DELETE FROM code_symbols").run(),t.prepare("DELETE FROM code_symbol_edges").run();let s=t.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
9
9
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?)`),i=t.prepare(`INSERT OR IGNORE INTO code_symbol_edges (src, dst, edge_type, confidence)
|
|
10
10
|
VALUES (?, ?, ?, ?)`);for(let r of n.symbols)s.run(r.id,r.file,r.kind,r.name,r.qname,r.startLine,r.endLine,r.exported?1:0);for(let r of n.edges)i.run(r.src,r.dst,r.edgeType,r.confidence)})}d(j,"replaceCodeGraph");function we(e){try{return S.query(e,"SELECT src, dst, edge_type, confidence FROM code_symbol_edges").map(n=>({src:n.src,dst:n.dst,edgeType:n.edge_type,confidence:n.confidence}))}catch{return[]}}d(we,"loadCodeSymbolEdges");G();ne();var D="symbol-graph",se=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java"]),re=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"]),oe=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 L(e,n){return e.slice(0,Math.min(n,e.length)).split(`
|
|
11
11
|
`).length}d(L,"lineOf");function ie(e,n,t,s){return`${e}#${n}:${t}@${s}`}d(ie,"symbolId");function H(e,n){return`${e.replace(/\.[^.]+$/,"").replace(/[/\\]/g,".")}.${n}`}d(H,"qnameOf");function I(e){let n=E.extname(e).toLowerCase();return se.has(n)}d(I,"isSourceFile");function O(e){let n=/\/\/[^\n]*(?:\n|$)|\/\*(?:[^*]|\*(?!\/))*(?:\*\/|$)|'(?:\\[\s\S]|[^'\\])*(?:'|$)|"(?:\\[\s\S]|[^"\\])*(?:"|$)|`(?:\\[\s\S]|[^`\\])*(?:`|$)/g;return e.replace(n,t=>t.replace(/[^\n]/g," "))}d(O,"stripNoise");function K(e){return{filePath:e,symbols:[],callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(K,"emptyExtract");function z(e){let n=[...new Set(e.map(t=>t.name))];return{calls:e,callNames:n}}d(z,"finalizeCalls");function ae(e,n){let t=[],s=[],i=new Map,r=O(e),a=[{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:m,kind:y,nameIdx:b,exported:C}of a){m.lastIndex=0;for(let _ of r.matchAll(m)){let x=_[b];if(!x||x.length<2||oe.has(x))continue;let h=L(r,_.index),T=`${y}:${x}@${h}`;o.has(T)||(o.add(T),t.push({kind:y,name:x,startLine:h,endLine:null,exported:C===!0}))}}let c=/import\s+(?:type\s+)?(?:\{([^}]+)\}|(\w+)(?:\s*,\s*\{([^}]+)\})?|\*\s+as\s+(\w+))\s+from\s+['"]([^'"]+)['"]/g;for(let m of e.matchAll(c)){let y=m[5],b=d(C=>{if(C)for(let _ of C.split(",")){let x=_.trim().replace(/^type\s+/,"").split(/\s+as\s+/),h=(x[1]??x[0])?.trim();h&&/^[A-Za-z_][\w]*$/.test(h)&&i.set(h,y)}},"bindNamed");b(m[1]),b(m[3]),m[2]&&i.set(m[2],y),m[4]&&i.set(m[4],y)}let l=/(?:const|let|var)\s+(\w+)\s*=\s*require\s*\(\s*['"]([^'"]+)['"]\s*\)/g;for(let m of e.matchAll(l))i.set(m[1],m[2]);let f=/\b([A-Za-z_][\w]*)\s*\(/g,p=400;for(let m of r.matchAll(f)){let y=m[1];if(re.has(y)||y.length<2)continue;let b=L(r,m.index);if(s.push({name:y,line:b}),s.length>=p)break}let g=/\.(?:get|post|put|patch|delete|options|head|all)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(g)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}let w=/@(?:app|router|api|bp)\.(?:get|post|put|patch|delete|options|head|api_route)\s*\(\s*['"`](\/[^'"`]*)['"`]/gi;for(let m of e.matchAll(w)){let b=m[1].replace(/[^\w/.-]/g,"").slice(0,64)||"route";t.push({kind:"route",name:b,startLine:L(e,m.index),endLine:null,exported:!0})}if(/(?:^|\/)route\.(ts|js|tsx|jsx)$/.test(n.replace(/\\/g,"/"))){let m=/\bexport\s+(?:async\s+)?function\s+(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\b/g;for(let y of e.matchAll(m))t.push({kind:"route",name:`${y[1]} ${n.replace(/\\/g,"/")}`,startLine:L(e,y.index),endLine:null,exported:!0})}let u=z(s);return{filePath:n,symbols:t,callNames:u.callNames,calls:u.calls,importBindings:i,resolvedImports:new Map}}d(ae,"extractTsJs");function ce(e,n){let t=[],s=[],i=O(e),r=/^(?:async\s+)?def\s+(\w+)\s*\(/gm,a=/^class\s+(\w+)/gm;for(let l of i.matchAll(r))t.push({kind:"function",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});for(let l of i.matchAll(a))t.push({kind:"class",name:l[1],startLine:L(i,l.index),endLine:null,exported:!l[1].startsWith("_")});let o=/\b([A-Za-z_][\w]*)\s*\(/g;for(let l of i.matchAll(o)){let f=l[1];/^(if|for|while|return|print|len|range|str|int|list|dict|set|super|self)$/.test(f)||s.push({name:f,line:L(i,l.index)})}let c=z(s);return{filePath:n,symbols:t,callNames:c.callNames,calls:c.calls,importBindings:new Map,resolvedImports:new Map}}d(ce,"extractPython");function le(e,n){let t=[],s=O(e),i=/^func\s+(?:\([^)]+\)\s+)?(\w+)\s*\(/gm,r=/^type\s+(\w+)\s+(?:struct|interface)/gm;for(let a of s.matchAll(i)){let o=a[1];t.push({kind:"function",name:o,startLine:L(s,a.index),endLine:null,exported:o[0]===o[0].toUpperCase()})}for(let a of s.matchAll(r))t.push({kind:"type",name:a[1],startLine:L(s,a.index),endLine:null,exported:a[1][0]===a[1][0].toUpperCase()});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(le,"extractGo");function de(e,n){let t=[],s=O(e),i=/^(?:pub\s+)?(?:async\s+)?fn\s+(\w+)/gm,r=/^(?:pub\s+)?struct\s+(\w+)/gm,a=/^(?:pub\s+)?trait\s+(\w+)/gm,o=/^(?:pub\s+)?enum\s+(\w+)/gm;for(let[c,l]of[[i,"function"],[r,"class"],[a,"interface"],[o,"enum"]])for(let f of s.matchAll(c))t.push({kind:l,name:f[1],startLine:L(s,f.index),endLine:null,exported:/^pub\b/.test(f[0])});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(de,"extractRust");function me(e,n){let t=[],s=O(e),i=/(?:public\s+|private\s+|protected\s+)?(?:abstract\s+|final\s+)?class\s+(\w+)/g,r=/(?:public\s+)?interface\s+(\w+)/g,a=/(?:public|private|protected)\s+(?:static\s+)?(?:final\s+)?[\w.<>,[\]\s]+\s+(\w+)\s*\(/g;for(let o of s.matchAll(i))t.push({kind:"class",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(r))t.push({kind:"interface",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});for(let o of s.matchAll(a))/^(if|for|while|switch|catch|return|new)$/.test(o[1])||t.push({kind:"method",name:o[1],startLine:L(s,o.index),endLine:null,exported:!0});return{filePath:n,symbols:t,callNames:[],calls:[],importBindings:new Map,resolvedImports:new Map}}d(me,"extractJava");function ue(e,n){let t=E.extname(n).toLowerCase();return[".ts",".tsx",".js",".jsx",".mjs",".cjs"].includes(t)?ae(e,n):t===".py"?ce(e,n):t===".go"?le(e,n):t===".rs"?de(e,n):t===".java"?me(e,n):K(n)}d(ue,"extractFile");async function fe(e){let n=[];for(let t of["tsconfig.json","jsconfig.json"])try{let i=(await N.readFile(E.join(e,t),"utf-8")).replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/[^\n]*/g,""),r=JSON.parse(i),a=r.compilerOptions?.paths,o=r.compilerOptions?.baseUrl??".";if(!a)continue;for(let[c,l]of Object.entries(a))n.push({pattern:c,targets:l.map(f=>E.posix.join(o.replace(/\\/g,"/"),f))});break}catch{}return n}d(fe,"loadTsPathMap");function ge(e,n){let t=[];for(let{pattern:s,targets:i}of n)if(s.endsWith("/*")){let r=s.slice(0,-1),a=s.slice(0,-2);if(e===a||e.startsWith(`${a}/`)){let o=e.slice(a.length).replace(/^\//,"");for(let c of i){let l=c.endsWith("/*")?c.slice(0,-1):c;t.push(E.posix.join(l.replace(/\*$/,""),o).replace(/\\/g,"/"))}}}else if(e===s)for(let r of i)t.push(r.replace(/\*$/,""));return t}d(ge,"applyTsPath");async function pe(e,n,t,s){let i=[];if(t.startsWith(".")){let r=E.dirname(E.join(e,n));i.push(E.resolve(r,t))}else if(t.startsWith("@/"))i.push(E.join(e,"src",t.slice(2))),i.push(E.join(e,t.slice(2)));else{for(let r of ge(t,s))i.push(E.join(e,r));i.push(E.join(e,"packages",t)),i.push(E.join(e,"src",t))}for(let r of i)for(let a of B){let o=r+a;try{if((await N.stat(o)).isFile())return E.relative(e,o).replace(/\\/g,"/")}catch{}}return null}d(pe,"resolveSpecifierToFile");async function ye(e,n,t){for(let[s,i]of n.importBindings){let r=await pe(e,n.filePath,i,t);r&&n.resolvedImports.set(s,r)}}d(ye,"resolveImportsForExtract");function U(e,n){let t=e.replace(/\\/g,"/"),s=n.replace(/\\/g,"/").replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"");return t===n||t.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"")===s||t===`${s}.ts`||t===`${s}.tsx`||t===`${s}.js`||t===`${s}.jsx`||t===`${s}/index.ts`||t===`${s}/index.tsx`||t===`${s}/index.js`}d(U,"matchFileToMod");function Y(e,n){return e.filter(s=>s.kind==="function"||s.kind==="method"||s.kind==="class").reduce((s,i)=>i.startLine<=n&&(!s||i.startLine>s.startLine)?i:s,null)}d(Y,"enclosingSymbol");function Z(e,n,t,s){let i=t.filter(o=>o.name===e);if(i.length===1)return{targets:i,confidence:.95};if(i.length>1){let o=i.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.9}}let r=n.resolvedImports.get(e);if(r){let o=(s.get(e)??[]).filter(f=>U(f.file,r));if(o.length>0)return{targets:o,confidence:.9};let c=[...s.values()].flat().filter(f=>U(f.file,r)&&f.exported),l=c.find(f=>f.kind==="function"||f.kind==="class")??c[0];if(l)return{targets:[l],confidence:.65}}let a=s.get(e)??[];if(a.length===1)return{targets:a,confidence:.75};if(a.length>1){let o=a.filter(c=>c.exported);if(o.length===1)return{targets:o,confidence:.7}}return{targets:[],confidence:0}}d(Z,"resolveCallTargets");function J(e){let n=[],t=[],s=new Map,i=new Map;for(let o of e){let c=[];for(let l of o.symbols){let f=ie(o.filePath,l.kind,l.name,l.startLine),p={id:f,file:o.filePath,kind:l.kind,name:l.name,qname:H(o.filePath,l.name),startLine:l.startLine,endLine:l.endLine,exported:l.exported};n.push(p),c.push(p);let g=s.get(l.name)??[];g.push(p),s.set(l.name,g),t.push({src:`file:${o.filePath}`,dst:f,edgeType:"DEFINES",confidence:1})}i.set(o.filePath,c)}for(let o of e){let c=i.get(o.filePath)??[],l=new Set;for(let f of o.calls){if(c.some(m=>m.name===f.name&&m.startLine===f.line))continue;let{targets:p,confidence:g}=Z(f.name,o,c,s);if(p.length===0)continue;let u=Y(c,f.line)?.id??`file:${o.filePath}`;for(let m of p){if(m.id===u)continue;let y=`${u}|${m.id}`;l.has(y)||(l.add(y),t.push({src:u,dst:m.id,edgeType:"CALLS",confidence:g}))}}}let r=new Set,a=[];for(let o of t){let c=`${o.src}|${o.dst}|${o.edgeType}`;r.has(c)||(r.add(c),a.push(o))}return{symbols:n,edges:a,fileCount:e.length}}d(J,"buildFromExtracts");async function V(e,n){let s=(n??(await W(e)).filter(a=>I(a)&&!a.includes(".d.ts"))).filter(a=>I(a)&&!a.endsWith(".d.ts")),i=await fe(e),r=await $(s,40,async a=>{try{let o=await N.readFile(E.join(e,a),"utf-8"),c=o.length>4e5?o.slice(0,4e5):o;return ue(c,a)}catch{return K(a)}});return await $(r,40,async a=>(await ye(e,a,i),a)),r}d(V,"extractProject");function be(e,n){j(e,n);let t={symbolCount:n.symbols.length,edgeCount:n.edges.length,fileCount:n.fileCount,builtAt:new Date().toISOString()};S.setDoc(e,D,t)}d(be,"persistGraph");function he(e,n,t){let s=new Set([...n.map(c=>c.filePath),...t]);if(s.size===0)return Q(e);let i=xe(e).filter(c=>!s.has(c.file)),r=J(n);S.transaction(e,c=>{let l=c.prepare("DELETE FROM code_symbols WHERE file = ?");for(let u of s)c.prepare("DELETE FROM code_symbol_edges WHERE src LIKE ? OR dst LIKE ? OR src = ? OR dst = ?").run(`${u}#%`,`${u}#%`,`file:${u}`,`file:${u}`),l.run(u);let f=c.prepare(`INSERT INTO code_symbols (id, file, kind, name, qname, start_line, end_line, exported)
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{b as l,c as i,d as k}from"./chunk-
|
|
8
|
+
import{b as l,c as i,d as k}from"./chunk-XSJ7SPVR.mjs";import{b as d}from"./chunk-D7DQABWO.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function u(t,n){let r=t===i?i:t.slice(0,6);return{shortId:r,label:`${r} \xB7 ${n??"(detached)"}`}}o(u,"labelFor");async function b(t,n){let r=await k(n),a=[],p=await d.getTaskSnapshot(t),s=p.currentTask;if(s){let{shortId:e,label:c}=u(i,s.branch);a.push({id:s.id,description:s.description,workspaceId:i,shortId:e,label:c,branch:s.branch,linearId:s.linearId,harness:s.harness,startedAt:s.startedAt,isCurrent:r.workspaceId===i,pipeline:l(t,s.id,i)??void 0})}for(let e of p.activeTasks){if(e.workspaceId===i)continue;let{shortId:c,label:h}=u(e.workspaceId,e.branch);a.push({id:e.id,description:e.description,workspaceId:e.workspaceId,shortId:c,label:h,branch:e.branch,linearId:e.linearId,harness:e.harness,startedAt:e.startedAt,isCurrent:r.workspaceId===e.workspaceId,pipeline:l(t,e.id,e.workspaceId)??void 0})}return a.sort((e,c)=>Number(c.isCurrent)-Number(e.isCurrent)),{current:a.find(e=>e.isCurrent)??null,all:a,mainTaskRaw:s}}o(b,"collectActiveTasks");function T(t){let n=t.isCurrent?"\u2192":" ",r=t.isCurrent?" (this worktree)":"";return`${n} ${t.label} ${t.description}${r}`}o(T,"formatActiveTaskLine");function m(t){if(t.all.length===0)return"No active work cycle.";if(t.all.length===1&&t.current){let r=t.current,a=r.pipeline?`
|
|
9
9
|
Pipeline: ${r.pipeline.station}`:"";return`Active: ${r.description}
|
|
10
10
|
Workspace: ${r.label}${a}`}let n=[`Active work cycles (${t.all.length})`];for(let r of t.all)n.push(T(r));return n.join(`
|
|
11
11
|
`)}o(m,"formatActiveTaskList");export{b as a,T as b,m as c};
|
|
@@ -5,5 +5,5 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as l}from"./chunk-
|
|
8
|
+
import{a as l}from"./chunk-WUOVBBPC.mjs";import{c as u}from"./chunk-XS45K7ZQ.mjs";import{a as s,c}from"./chunk-4KVPAHFV.mjs";import{b as i}from"./chunk-ZZBNFNMG.mjs";import{a as o}from"./chunk-E66B27AL.mjs";function g(n){let e=n.tool_input??n.toolInput;return e&&typeof e.command=="string"?e.command:typeof n.command=="string"?n.command:e&&typeof e.command_line=="string"?e.command_line:""}o(g,"extractCommand");function k(n){return n?n.sdd?.mode==="strict"||n.tdd?.mode==="strict"||n.deliveryGeometry?.mode==="strict":!1}o(k,"isStrictPackageMode");async function m(n,e){let a=s(g(e));if(!a)return null;let t=await c(n),r=u(a.packages,t);if(r.allow)return null;let d=await i.readConfig(n).catch(()=>null);return{strict:k(d),message:r.decision?.message??r.denyMessage}}o(m,"evaluatePrePackageInput");function w(n=process.cwd(),e){return l({event:"PreToolUse",projectPath:n,decide:o(async a=>{try{let t=await m(n,a);return t?.strict?{deny:t.message}:null}catch{return null}},"decide"),build:o(async a=>{try{let t=await m(n,a);return!t||t.strict?null:`# prjct: package legitimacy (advisory)
|
|
9
9
|
${t.message}`}catch{return null}},"build")},e)}o(w,"runPrePackageHook");export{m as a,w as b};
|
|
@@ -5,9 +5,9 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as f}from"./chunk-Y5NQV46G.mjs";import{
|
|
8
|
+
import{a as f}from"./chunk-Y5NQV46G.mjs";import{b as v}from"./chunk-PVCEWFHS.mjs";import{e as p,g as I}from"./chunk-TKXOMN4K.mjs";import{a as H,b as K}from"./chunk-WUHGODSQ.mjs";import{b as N,p as q}from"./chunk-QWQFF2UG.mjs";import{b as A}from"./chunk-GCKILEXJ.mjs";import{a as s}from"./chunk-E66B27AL.mjs";I();var L="https://api.openai.com/v1";function M(r,e){return/openrouter\.ai/i.test(e)&&r&&!r.includes("/")?`openai/${r}`:r}s(M,"normalizeModelForBaseUrl");var G="embeddings.provider",V="embeddings.baseUrl",$="embeddings.model",Y="embeddings.authHeader",j="embeddings.authScheme",z="embeddings.headers",W="embeddings.query";function J(r){if(!(typeof r!="string"||!r.trim()))try{let e=JSON.parse(r);if(e&&typeof e=="object"&&!Array.isArray(e)){let n={};for(let[t,i]of Object.entries(e))n[t]=String(i);return Object.keys(n).length?n:void 0}}catch{}}s(J,"parseHeaders");function w(){let r=f(G),e=f($);if(r!=="openai-compatible"||!e)return null;let n=f(j),t=f(Y),i=f(W),o=String(f(V)??L);return{provider:"openai-compatible",baseUrl:o,model:M(String(e),o),authHeader:t!=null?String(t):void 0,authScheme:n!=null?String(n):void 0,extraHeaders:J(f(z)),query:i!=null?String(i):void 0}}s(w,"resolveGlobalEmbeddings");K();q();import X from"node:fs";import Q from"node:path";var U="PRJCT_EMBEDDINGS_API_KEY",Z="prjct-embeddings",ee="prjct";function re(){return Q.join(H(),"config","embeddings.key")}s(re,"keyFilePath");var S={value:void 0};function ne(){return process.platform==="darwin"}s(ne,"isDarwin");async function te(){try{let{stdout:r}=await N("security",["find-generic-password","-a",ee,"-s",Z,"-w"]);return r.trim()||null}catch{return null}}s(te,"readKeychain");function ie(){try{return X.readFileSync(re(),"utf-8").trim()||null}catch{return null}}s(ie,"readFileKey");async function D(){if(S.value!==void 0)return S.value;let r=process.env[U]?.trim();if(r)return S.value=r,r;let e=(ne()?await te():null)??ie();return S.value=e,e}s(D,"getEmbeddingsKey");function oe(r){let e=r?.embeddings;return!e||!e.provider||!e.model?null:e.provider==="openai-compatible"?new _(e.baseUrl??"https://api.openai.com/v1",e.model,{authHeader:e.authHeader,authScheme:e.authScheme,extraHeaders:e.headers,query:e.query}):null}s(oe,"resolveProvider");function se(r,e,n,t,i={}){let o=r.replace(/\/+$/,""),a=i.query?.trim().replace(/^\?/,""),u=`${o}/embeddings${a?`?${a}`:""}`,l=M(e,o),g={"content-type":"application/json",...i.extraHeaders??{}};if(t){let b=i.authHeader?.trim()||"authorization",m=i.authScheme??"Bearer";g[b]=m?`${m} ${t}`:t}return{url:u,init:{method:"POST",headers:g,body:JSON.stringify({model:l,input:n})}}}s(se,"buildEmbeddingsRequest");var _=class{constructor(e,n,t={}){this.baseUrl=e;this.model=n;this.auth=t}baseUrl;model;auth;static{s(this,"HttpEmbeddingProvider")}async embed(e){if(e.length===0)return[];let n=await D(),{url:t,init:i}=se(this.baseUrl,this.model,e,n,this.auth),o=await fetch(t,i);if(!o.ok)throw new Error(`embeddings endpoint ${o.status}: ${await o.text().catch(()=>"")}`);return((await o.json()).data??[]).map(u=>u.embedding)}},de="local-subword-v1",O=256,ae=800;function ce(r){return Array.from({length:r.length},(n,t)=>r.charCodeAt(t)).reduce((n,t)=>Math.imul(n^t,16777619),2166136261)>>>0}s(ce,"fnv1a");function ue(r,e,n){let t=[];if(r.length<e)return t.push(r),t;for(let i of Array.from({length:n-e+1},(o,a)=>e+a))t.push(...Array.from({length:Math.max(0,r.length-i+1)},(o,a)=>r.slice(a,a+i)));return t}s(ue,"charNGrams");function k(r){let e=new Float64Array(O),n=(r.toLowerCase().match(/[\p{L}\p{N}]+/gu)??[]).slice(0,ae);for(let i of n){let o=ue(`<${i}>`,3,5);o.push(i);for(let a of o){let u=ce(a),l=u%O,g=u&65536?1:-1;e[l]+=g}}let t=Math.sqrt(e.reduce((i,o)=>i+o*o,0))||1;return Array.from(e,i=>i/t)}s(k,"embedLocal");function Ce(r){return k(r)}s(Ce,"embedLocalText");var R=class{static{s(this,"LocalSubwordEmbeddingProvider")}model=de;isLocal=!0;async embed(e){return e.map(n=>k(n))}};function C(r){let e=oe(r);if(e)return e;let n=w();return n?new _(n.baseUrl,n.model,{authHeader:n.authHeader,authScheme:n.authScheme,extraHeaders:n.extraHeaders,query:n.query}):new R}s(C,"resolveActiveProvider");function me(r){return Buffer.from(new Float32Array(r).buffer)}s(me,"packVector");function le(r){let e=Uint8Array.from(r);return new Float32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}s(le,"unpackVector");function Pe(r,e){let n=E(r)*E(e);return n===0?0:F(r,e)/n}s(Pe,"cosineSimilarity");function E(r){return Math.sqrt(r.reduce((e,n)=>e+n*n,0))}s(E,"l2Norm");function F(r,e){let n=Math.min(r.length,e.length);return r.reduce((t,i,o)=>o<n?t+i*e[o]:t,0)}s(F,"dot");var ge=2e3,fe=10,P=new Map,ke={isEnabled(r){return!0},store(r,e,n,t,i){p.run(r,`INSERT INTO memory_embeddings (memory_id, vector, model, dims, norm, created_at)
|
|
9
9
|
VALUES (?, ?, ?, ?, ?, ?)
|
|
10
10
|
ON CONFLICT(memory_id) DO UPDATE SET
|
|
11
11
|
vector = excluded.vector, model = excluded.model,
|
|
12
|
-
dims = excluded.dims, norm = excluded.norm, created_at = excluded.created_at`,e,me(n),t,n.length,E(n),i)},embeddedIds(r,e){try{let n=p.query(r,"SELECT memory_id FROM memory_embeddings WHERE model = ?",e);return new Set(n.map(t=>t.memory_id))}catch{return new Set}},async backfill(r,e,n,t={}){let i=t.provider??
|
|
13
|
-
WHERE model = ? ORDER BY rowid DESC LIMIT ?`,o.model,ge)}catch{return null}})();if(!u)return[];let l=E(a);if(l===0)return[];let g=u.map(m=>{let d=le(m.vector),c=l*(m.norm??E(d));return{id:m.memory_id,score:c===0?0:
|
|
12
|
+
dims = excluded.dims, norm = excluded.norm, created_at = excluded.created_at`,e,me(n),t,n.length,E(n),i)},embeddedIds(r,e){try{let n=p.query(r,"SELECT memory_id FROM memory_embeddings WHERE model = ?",e);return new Set(n.map(t=>t.memory_id))}catch{return new Set}},async backfill(r,e,n,t={}){let i=t.provider??C(e),o=t.batchSize??64,a=await(async()=>{try{let{evaluateRetention:d}=await import("./retention-RET4P2RO.mjs");return d(r,Date.now()).byId}catch{return null}})(),u=v.unembeddedEntriesForIndex(r,i.model).filter(d=>{if(!A(d)||d.content.trim().length===0)return!1;let c=a?.get(d.id);return!(c&&c.verdict!=="active")});if(this.shouldPruneThisRun(r)){let c=v.allEntriesForIndex(r).filter(h=>{if(!A(h))return!0;let y=a?.get(h.id);return y!=null&&y.verdict!=="active"}).map(h=>h.id);this.pruneNonModelVectors(r,c)}let l=this.countByModel(r,i.model),g=Array.from({length:Math.ceil(u.length/o)},(d,c)=>u.slice(c*o,(c+1)*o)),b=[];for(let d of g)try{let c=await i.embed(d.map(y=>y.content)),h=d.reduce((y,T,B)=>{let x=c[B];return!x||x.length===0?y:(this.store(r,T.id,x,i.model,n),y+1)},0);b.push(h)}catch{}return{embedded:b.reduce((d,c)=>d+c,0),skipped:l,total:l+u.length}},countByModel(r,e){try{return p.get(r,"SELECT COUNT(*) AS n FROM memory_embeddings WHERE model = ?",e)?.n??0}catch{return 0}},shouldPruneThisRun(r){let e=P.get(r)??0;return P.set(r,(e+1)%fe),e===0},pruneNonModelVectors(r,e){if(e.length!==0)try{let n=e.map(()=>"?").join(",");p.run(r,`DELETE FROM memory_embeddings WHERE memory_id IN (${n})`,...e)}catch{}},async semanticSearch(r,e,n,t=10,i){let o=i??C(n);if(!e.trim())return[];let a=await(async()=>{try{return(await o.embed([e]))[0]}catch{return}})();if(!a||a.length===0)return[];let u=(()=>{try{return p.query(r,`SELECT memory_id, vector, norm FROM memory_embeddings
|
|
13
|
+
WHERE model = ? ORDER BY rowid DESC LIMIT ?`,o.model,ge)}catch{return null}})();if(!u)return[];let l=E(a);if(l===0)return[];let g=u.map(m=>{let d=le(m.vector),c=l*(m.norm??E(d));return{id:m.memory_id,score:c===0?0:F(a,d)/c}}).sort((m,d)=>d.score-m.score).slice(0,t),b=[];for(let m of g){let d=v.getById(r,m.id);d&&b.push(d)}return b}};export{Ce as a,Pe as b,F as c,ke as d};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as r}from"./chunk-
|
|
8
|
+
import{a as r}from"./chunk-AORD3YDQ.mjs";import{c as d}from"./chunk-M5E2YOZ4.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var u={upsert:"updated",delete:"deleted"},o={value:null};async function p(){if(o.value)return o.value;try{let{default:e}=await import("./auth-config-JIITQ6GY.mjs"),t=e;if(typeof t.getDeviceId=="function"){let n=await t.getDeviceId();return o.value=n,n}return"unknown-device"}catch{return"unknown-device"}}i(p,"resolveDeviceId");async function v(e){try{let t=await p(),n=d(e.data),c={type:`${e.entityType}.${u[e.eventType]}`,path:[e.entityType,e.entityId],data:e.data,timestamp:new Date().toISOString(),projectId:e.projectId,entityType:e.entityType,entityId:e.entityId,eventType:e.eventType,contentHash:n,deviceId:t,originDeviceId:e.originDeviceId??t,revisionCount:e.revisionCount??1};await r.publish(c)}catch{}}i(v,"publishCRUD");function a(e){v(e)}i(a,"publishCRUDSync");export{v as a,a as b};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{c as t}from"./chunk-
|
|
8
|
+
import{c as t}from"./chunk-TF6PN7IB.mjs";import{a as e}from"./chunk-E66B27AL.mjs";async function f(r,o,i){if(i.length!==0)try{let{resolveActiveTask:s}=await import("./task-service-FZABHPFV.mjs"),c=await s(r,o);c?.id&&t.recordSurfaced(r,i,c.id);for(let n of i)t.recordFetch(r,n)}catch{}}e(f,"recordSurfacedForActiveTask");export{f as a};
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{e as r,g as S}from"./chunk-
|
|
8
|
+
import{e as r,g as S}from"./chunk-TKXOMN4K.mjs";import{b as o,h as p,v as a,w as _}from"./chunk-A6K4H3YT.mjs";import{f as g,g as l,o as m}from"./chunk-UH4MD3F3.mjs";import{a as s}from"./chunk-E66B27AL.mjs";_();p();S();var c=class{static{s(this,"SyncPendingStorage")}append(n,e){let t=o(),u=JSON.stringify(e);return e.entityType&&e.entityId&&e.contentHash&&r.run(n,`DELETE FROM sync_pending
|
|
9
9
|
WHERE project_id = ?
|
|
10
10
|
AND entity_type = ?
|
|
11
11
|
AND entity_id = ?
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{d as p,g as b}from"./chunk-
|
|
8
|
+
import{d as p,g as b}from"./chunk-TKXOMN4K.mjs";import{d as f,o as S}from"./chunk-UH4MD3F3.mjs";import{a as o}from"./chunk-E66B27AL.mjs";b();S();import a from"node:path";var g="file-inventory",m=/^(package-lock\.json|pnpm-lock\.yaml|yarn\.lock|bun\.lockb?|composer\.lock|Cargo\.lock|poetry\.lock|CHANGELOG(\.md)?|LICENSE(\.md)?|\.DS_Store)$/i,x=/(^|\/)(node_modules|dist|build|\.git|coverage|\.next|target|vendor)(\/|$)/i,y=new Set([".png",".jpg",".jpeg",".gif",".webp",".ico",".woff",".woff2",".ttf",".eot",".mp4",".mp3",".zip",".gz",".tar",".wasm",".exe",".dll",".so",".dylib",".bin",".pdf",".ico"]),v={".ts":"TypeScript",".tsx":"TypeScript",".js":"JavaScript",".jsx":"JavaScript",".mjs":"JavaScript",".cjs":"JavaScript",".vue":"Vue",".svelte":"Svelte",".py":"Python",".go":"Go",".rs":"Rust",".java":"Java",".kt":"Kotlin",".kts":"Kotlin",".swift":"Swift",".rb":"Ruby",".php":"PHP",".cs":"C#",".fs":"F#",".cpp":"C++",".cc":"C++",".c":"C",".h":"C/C++",".hpp":"C++",".m":"Objective-C",".mm":"Objective-C++",".scala":"Scala",".clj":"Clojure",".ex":"Elixir",".exs":"Elixir",".erl":"Erlang",".hs":"Haskell",".lua":"Lua",".r":"R",".dart":"Dart",".sql":"SQL",".graphql":"GraphQL",".gql":"GraphQL",".proto":"Protobuf",".md":"Markdown",".mdx":"MDX",".json":"JSON",".yml":"YAML",".yaml":"YAML",".toml":"TOML",".css":"CSS",".scss":"SCSS",".sass":"Sass",".less":"Less",".html":"HTML",".htm":"HTML",".sh":"Shell",".bash":"Shell",".zsh":"Shell",".ps1":"PowerShell",".swiftui":"Swift"};async function h(e,n={}){let t=(await f(e,{skipDotfiles:!0,maxFiles:n.maxFiles??5e4})).filter(l=>{if(x.test(l))return!1;let u=a.basename(l);if(m.test(u))return!1;let c=a.extname(u).toLowerCase();return!!(c&&c!=="."&&!y.has(c))}),r=t.reduce((l,u)=>{let c=a.extname(a.basename(u)).toLowerCase();return l[c]=(l[c]??0)+1,l},Object.create(null)),i=j(r);return{extensions:r,languages:i,fileCount:t.length,builtAt:new Date().toISOString(),projectHint:a.basename(e)}}o(h,"buildFileInventory");function j(e){let n=new Set,s=Object.entries(e).sort((t,r)=>r[1]-t[1]);for(let[t]of s){let r=v[t];r&&n.add(r)}return[...n]}o(j,"languagesFromExtensions");function C(e,n){p.setDoc(e,g,n)}o(C,"saveFileInventory");function d(e){try{return p.getDoc(e,g)}catch{return null}}o(d,"loadFileInventory");async function L(e,n){let s=await h(n);return C(e,s),s}o(L,"refreshFileInventory");function E(e){let n=d(e);return n?.extensions?new Set(Object.keys(n.extensions).map(s=>s.toLowerCase())):new Set}o(E,"inventoryExtensions");function k(e,n,s={}){let t=n.replace(/^\.\//,"").replace(/\\/g,"/").trim();if(!t||x.test(t))return!1;let r=t.split("/").pop()??t;if(m.test(r))return!1;let i=a.extname(r).toLowerCase();return i?!y.has(i):t.includes("/")}o(k,"pathMatchesInventory");function O(e,n){let s=n.replace(/^\.\//,"").replace(/\\/g,"/").trim(),t=s.split("/").pop()??s,r=a.extname(t).toLowerCase();if(!r)return .7;let i=E(e);return i.size===0||i.has(r)?1:.45}o(O,"inventoryPathWeight");function P(e){if(!e||Object.keys(e.extensions).length===0)return"File inventory: empty \u2014 run `prjct sync` to discover languages/extensions.";let n=Object.entries(e.extensions).sort((t,r)=>r[1]-t[1]).slice(0,12).map(([t,r])=>`${t}\xD7${r}`).join(" "),s=e.languages.length>0?e.languages.join(", "):"unknown";return`File inventory: ${e.fileCount} files \xB7 langs: ${s} \xB7 ${n}`}o(P,"formatInventorySummary");export{g as a,h as b,j as c,C as d,d as e,L as f,E as g,k as h,O as i,P as j};
|
|
@@ -5,4 +5,4 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as r}from"./chunk-
|
|
8
|
+
import{a as r}from"./chunk-WUOVBBPC.mjs";import{b as t}from"./chunk-XS45K7ZQ.mjs";import{a as e}from"./chunk-E66B27AL.mjs";function u(o){let n=t(o);return n.allow?null:{deny:n.denyMessage}}e(u,"decideSecrets");function l(o=process.cwd(),n){return r({event:"PreToolUse",projectPath:o,decide:e(async c=>{try{return u(c)}catch{return null}},"decide")},n)}e(l,"runPreSecretsHook");var p={decideSecrets:u};export{u as a,l as b,p as c};
|