prjct-cli 3.93.0 → 3.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +27 -21
- package/dist/bin/hook-chunks/{agent-switch-A6AYZRJ5.mjs → agent-switch-4ZJJWKMD.mjs} +1 -1
- package/dist/bin/hook-chunks/{analysis-WPRPBYHY.mjs → analysis-UGHAG2SK.mjs} +3 -3
- package/dist/bin/hook-chunks/{auth-config-WNUARXTJ.mjs → auth-config-JIITQ6GY.mjs} +1 -1
- package/dist/bin/hook-chunks/auto-flush-CXWTU3RF.mjs +8 -0
- package/dist/bin/hook-chunks/{auto-updater-EHRRMCYY.mjs → auto-updater-4TIXYSEX.mjs} +1 -1
- package/dist/bin/hook-chunks/capture-gate-PS6QUXLX.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-22AXWLI6.mjs +26 -0
- package/dist/bin/hook-chunks/chunk-32RX4YGI.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-6EWGHM32.mjs → chunk-3WQBTXUC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZZ65CN5F.mjs → chunk-4HAKTI36.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-V37VTXDW.mjs → chunk-4KVPAHFV.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-4KXXDQYI.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-4WHS7CO7.mjs → chunk-4NTVXJD7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HIFIDMH5.mjs → chunk-5H3KJWQS.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-5XA5RL5I.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-6GAFRIUQ.mjs +18 -0
- package/dist/bin/hook-chunks/{chunk-4OYUJTPR.mjs → chunk-76GDLA3Z.mjs} +3 -3
- package/dist/bin/hook-chunks/chunk-7YT2FGO7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-A6K4H3YT.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-MEQS4VPO.mjs → chunk-ABJNOG2I.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7SI6X3Z7.mjs → chunk-B36LC2JR.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BCAHWZH7.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-EM6ZDJAK.mjs → chunk-BDOAQVIF.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BOBFTVAY.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-7OZDWT6C.mjs → chunk-BU22R6JX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-BX7VKYA7.mjs +8 -0
- package/dist/bin/hook-chunks/chunk-C4O243NG.mjs +9 -0
- package/dist/bin/hook-chunks/chunk-CYZ7ST2P.mjs +36 -0
- package/dist/bin/hook-chunks/chunk-DCSKTMDX.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-WDGDFXSB.mjs → chunk-DVDZA63F.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZX2KFQV5.mjs → chunk-EWOK4VE7.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ODWWIFSN.mjs → chunk-FEFP6JOL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-7AN7VQHN.mjs → chunk-FW4MEPTB.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-FXFG6PV6.mjs +69 -0
- package/dist/bin/hook-chunks/chunk-G7QQZMAO.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-P5ZYAXSE.mjs → chunk-GCDLPKOH.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ACKEPXP4.mjs → chunk-GDECEHO5.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-GDESYWTD.mjs +14 -0
- package/dist/bin/hook-chunks/chunk-GLPKMG5A.mjs +18 -0
- package/dist/bin/hook-chunks/chunk-GPZP7NXL.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-PSSR7LSW.mjs → chunk-H4CA3XZ6.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-HEDZA6KC.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-3LG3ACQV.mjs → chunk-I26F7TLM.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-IGHY4FGS.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-DMXFGLZE.mjs → chunk-IWJG7CZX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-LLQUB6YR.mjs → chunk-J5UQVJUW.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-J5UVRZ44.mjs +15 -0
- package/dist/bin/hook-chunks/{chunk-QDQ7DTDV.mjs → chunk-JR542RI2.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-P4J6TY2L.mjs → chunk-KHLYWNHT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-75UJIVMO.mjs → chunk-KOGZCFBC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-Q5I2UPD6.mjs → chunk-KSSRINDX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-ZTZTVBAZ.mjs → chunk-LNB2GLYI.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-M5E2YOZ4.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-PWMMLXZS.mjs → chunk-MHNWIB7B.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-LFY5O66D.mjs → chunk-N3L77UNM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-TSCXXNUF.mjs → chunk-NLKPAJND.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-3JUE6MNF.mjs → chunk-OC4CYF7V.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-OGIFB3OE.mjs +19 -0
- package/dist/bin/hook-chunks/chunk-OUAS3LZ3.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-6WXGOGAN.mjs → chunk-OUAVSD47.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-X5RDLFPM.mjs → chunk-OWOPA2O7.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-PGWFGRX4.mjs +47 -0
- package/dist/bin/hook-chunks/chunk-PO3QDKTE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-RXD7MHJ6.mjs → chunk-PP6DANGV.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HT3ZCLLJ.mjs → chunk-PTA7DMLM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-45I2C2UB.mjs → chunk-QBYHZX33.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QL3NYJTW.mjs +16 -0
- package/dist/bin/hook-chunks/{chunk-AOPJ4Z6O.mjs → chunk-QP5USCDX.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-QWQFF2UG.mjs +10 -0
- package/dist/bin/hook-chunks/chunk-R4ILCXKE.mjs +8 -0
- package/dist/bin/hook-chunks/{chunk-D7TRY3CO.mjs → chunk-RHKF7EJW.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-HZIORCPO.mjs → chunk-ROA2AJXY.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-AUUWQH3S.mjs → chunk-RTEEXGEA.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-QK2IMCDC.mjs → chunk-S5ISOGDB.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-GIMUTVLP.mjs → chunk-S5N2ZZDL.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-742LOGHA.mjs → chunk-S6L3FECF.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-CREPUNOS.mjs → chunk-T6ELTQZM.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-UK7D7EFV.mjs → chunk-TXSLON7M.mjs} +2 -2
- package/dist/bin/hook-chunks/chunk-U4OON3S7.mjs +31 -0
- package/dist/bin/hook-chunks/chunk-UH4MD3F3.mjs +9 -0
- package/dist/bin/hook-chunks/{chunk-HDHVBB6Q.mjs → chunk-UHVYBU7F.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-UYQC63MC.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-3WY2AYPE.mjs → chunk-V2FR2NPL.mjs} +4 -4
- package/dist/bin/hook-chunks/{chunk-L4376X2P.mjs → chunk-WGWE3CSC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-KXWBIQGJ.mjs → chunk-X5W2UYQK.mjs} +2 -2
- package/dist/bin/hook-chunks/{chunk-YUOTOCKK.mjs → chunk-XDBJSJOT.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-2NMSEZTQ.mjs → chunk-XFQ7NNLN.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-SOPRYWUY.mjs → chunk-XS45K7ZQ.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-BISPGBNN.mjs → chunk-XXRAQZNC.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-NLG2EW6M.mjs → chunk-YDBZO6I3.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-6IKHMK2U.mjs → chunk-YQ55MHKL.mjs} +1 -1
- package/dist/bin/hook-chunks/chunk-Z4X7JIAP.mjs +11 -0
- package/dist/bin/hook-chunks/{chunk-2OU2MKNS.mjs → chunk-Z6KVLCMK.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-OGOCHZ3S.mjs → chunk-ZFLIVOFX.mjs} +1 -1
- package/dist/bin/hook-chunks/{chunk-54LH63LM.mjs → chunk-ZMLA5SKR.mjs} +1 -0
- package/dist/bin/hook-chunks/chunk-ZOX6OV6X.mjs +12 -0
- package/dist/bin/hook-chunks/client-CRXA774S.mjs +10 -0
- package/dist/bin/hook-chunks/code-graph-cloud-GTSLO7CD.mjs +8 -0
- package/dist/bin/hook-chunks/{codex-skill-ZCAUF2RM.mjs → codex-skill-NUBNPSMF.mjs} +1 -1
- package/dist/bin/hook-chunks/{command-installer-LNK7WC5I.mjs → command-installer-UHSXC3UG.mjs} +1 -1
- package/dist/bin/hook-chunks/{config-manager-4VWDBPMG.mjs → config-manager-DX5OOPW5.mjs} +1 -1
- package/dist/bin/hook-chunks/{content-bound-stamp-72EQVZLP.mjs → content-bound-stamp-OG2KKN3L.mjs} +1 -1
- package/dist/bin/hook-chunks/{context7-service-4C6VNJUS.mjs → context7-service-GDJ3QICX.mjs} +1 -1
- package/dist/bin/hook-chunks/custom-workflow-storage-FD47DPA3.mjs +8 -0
- package/dist/bin/hook-chunks/cwd-changed-EP3UIRK6.mjs +8 -0
- package/dist/bin/hook-chunks/{database-SLDTQXWG.mjs → database-ZUC7OEZG.mjs} +1 -1
- package/dist/bin/hook-chunks/{delivery-geometry-VHCURJ7E.mjs → delivery-geometry-WYOEMKMO.mjs} +1 -1
- package/dist/bin/hook-chunks/{detect-changes-M2OYIOE5.mjs → detect-changes-OJUBWWTU.mjs} +1 -1
- package/dist/bin/hook-chunks/{detection-MEYHME4X.mjs → detection-QRVSNMKL.mjs} +1 -1
- package/dist/bin/hook-chunks/developer-evolution-WNSTHDAA.mjs +12 -0
- package/dist/bin/hook-chunks/distill-GOGPFQFK.mjs +8 -0
- package/dist/bin/hook-chunks/{editors-config-3N6VREZR.mjs → editors-config-2CACBNS4.mjs} +1 -1
- package/dist/bin/hook-chunks/enriched-recall-QF22RIK7.mjs +8 -0
- package/dist/bin/hook-chunks/exec-2P5VOBHM.mjs +8 -0
- package/dist/bin/hook-chunks/format-J3X3R225.mjs +8 -0
- package/dist/bin/hook-chunks/{git-helpers-6JLP2OJZ.mjs → git-helpers-HELM6DXJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-ledger-storage-UKROWRVA.mjs → judgment-ledger-storage-FE4HXTHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{judgment-orchestrator-UFGNBTEK.mjs → judgment-orchestrator-YDJTKNV2.mjs} +1 -1
- package/dist/bin/hook-chunks/judgment-receipt-7A2DXVJA.mjs +8 -0
- package/dist/bin/hook-chunks/land-cue-SZWJH6XP.mjs +9 -0
- package/dist/bin/hook-chunks/land-synthesis-JLYUBKHR.mjs +8 -0
- package/dist/bin/hook-chunks/legacy-crew-sweep-JXYO62UE.mjs +24 -0
- package/dist/bin/hook-chunks/memory-index-CIYDXN2G.mjs +8 -0
- package/dist/bin/hook-chunks/notification-UA7RTVHG.mjs +8 -0
- package/dist/bin/hook-chunks/{pack-integrity-62XJ5A75.mjs → pack-integrity-GZC5NGFN.mjs} +1 -1
- package/dist/bin/hook-chunks/{pack-manager-K3PQ7MCS.mjs → pack-manager-AF5F7PRT.mjs} +1 -1
- package/dist/bin/hook-chunks/{package-legitimacy-HXC4L73B.mjs → package-legitimacy-MIR3VZSF.mjs} +1 -1
- package/dist/bin/hook-chunks/{path-manager-F2HE2GGK.mjs → path-manager-375HH6TB.mjs} +1 -1
- package/dist/bin/hook-chunks/{planning-WMLFXZMA.mjs → planning-M3RAOZVB.mjs} +2 -2
- package/dist/bin/hook-chunks/post-edit-QRDYPZLZ.mjs +8 -0
- package/dist/bin/hook-chunks/{pr-convention-7UGI7TFA.mjs → pr-convention-5NPXQJ2R.mjs} +1 -1
- package/dist/bin/hook-chunks/pre-bash-TWWFVNQ7.mjs +11 -0
- package/dist/bin/hook-chunks/pre-commit-PTFF7JIN.mjs +8 -0
- package/dist/bin/hook-chunks/pre-edit-PMMWDR2B.mjs +11 -0
- package/dist/bin/hook-chunks/pre-package-325ALZKD.mjs +8 -0
- package/dist/bin/hook-chunks/pre-search-GOHVFAFH.mjs +9 -0
- package/dist/bin/hook-chunks/pre-secrets-MYNM5KI4.mjs +8 -0
- package/dist/bin/hook-chunks/{precision-judgment-WPTCNTGV.mjs → precision-judgment-TT3DRNAX.mjs} +1 -1
- package/dist/bin/hook-chunks/{prjct-md-Q6C5YNI3.mjs → prjct-md-RCB6FWD6.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-agent-surfaces-3BBZIQNI.mjs → project-agent-surfaces-V4P5RTUR.mjs} +1 -1
- package/dist/bin/hook-chunks/{project-file-inventory-ZAPKPKY6.mjs → project-file-inventory-OKIP4LBO.mjs} +1 -1
- package/dist/bin/hook-chunks/project-memory-JK2MXRJB.mjs +8 -0
- package/dist/bin/hook-chunks/project-style-evolution-RPGATIYJ.mjs +8 -0
- package/dist/bin/hook-chunks/prompt-DOENKHLQ.mjs +24 -0
- package/dist/bin/hook-chunks/{velocity-storage-UPW6TLK6.mjs → publish-helper-SX7HEV2L.mjs} +1 -1
- package/dist/bin/hook-chunks/purge-XKHUAB4H.mjs +8 -0
- package/dist/bin/hook-chunks/retention-C3NQT65W.mjs +8 -0
- package/dist/bin/hook-chunks/sdd-6PF7MBAY.mjs +10 -0
- package/dist/bin/hook-chunks/session-continuity-UEXQDGZE.mjs +11 -0
- package/dist/bin/hook-chunks/session-start-B4P7L33E.mjs +8 -0
- package/dist/bin/hook-chunks/setup-ZOHG6MGF.mjs +141 -0
- package/dist/bin/hook-chunks/{shipping-HV5IAM2J.mjs → shipping-QVGTOO6U.mjs} +5 -5
- package/dist/bin/hook-chunks/{skill-index-OOVAXHYJ.mjs → skill-index-FGDQVYHM.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-context-inference-UBHJLOIJ.mjs → spec-context-inference-6Z52BT37.mjs} +1 -1
- package/dist/bin/hook-chunks/{spec-service-TA4Q5S3X.mjs → spec-service-UAQ5AEXQ.mjs} +2 -2
- package/dist/bin/hook-chunks/spec-task-breakdown-LAXGVLMY.mjs +8 -0
- package/dist/bin/hook-chunks/state-storage-XU35ZYNA.mjs +8 -0
- package/dist/bin/hook-chunks/stop-CFB2H3XC.mjs +16 -0
- package/dist/bin/hook-chunks/subagent-start-KFAZZUHS.mjs +8 -0
- package/dist/bin/hook-chunks/subagent-stop-OUG4PR7S.mjs +8 -0
- package/dist/bin/hook-chunks/{surface-attribution-HYCBHBTC.mjs → surface-attribution-A6GCGRFM.mjs} +1 -1
- package/dist/bin/hook-chunks/symbol-graph-DMPBNBX7.mjs +8 -0
- package/dist/bin/hook-chunks/{sync-analyzer-FKC57RTV.mjs → sync-analyzer-6U5GHYV3.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-client-DJWOG2ZQ.mjs → sync-client-PIRHMHXL.mjs} +1 -1
- package/dist/bin/hook-chunks/{sync-cursor-storage-2VKG757H.mjs → sync-cursor-storage-VVLA3L2U.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-orchestration-MLOCR7GA.mjs → task-orchestration-HFZYWYLR.mjs} +1 -1
- package/dist/bin/hook-chunks/{task-overview-6ZQKJGSH.mjs → task-overview-PCUZWL5Q.mjs} +1 -1
- package/dist/bin/hook-chunks/task-service-PXCDU55T.mjs +8 -0
- package/dist/bin/hook-chunks/tdd-QZL4OSM7.mjs +10 -0
- package/dist/bin/hook-chunks/{template-loader-SO6OHPJI.mjs → template-loader-SKXILJLJ.mjs} +1 -1
- package/dist/bin/hook-chunks/{transcript-jsonl-6X4DDD6R.mjs → transcript-jsonl-7W2NOJPZ.mjs} +1 -1
- package/dist/bin/hook-chunks/{trust-boundary-ERMDF2C5.mjs → trust-boundary-EX65SUYR.mjs} +1 -1
- package/dist/bin/hook-chunks/{usefulness-253CZLNY.mjs → usefulness-SZLG6LVC.mjs} +1 -1
- package/dist/bin/hook-chunks/{vault-retire-notice-GRT3QRLZ.mjs → vault-retire-notice-HOXPURNQ.mjs} +1 -1
- package/dist/bin/hook-chunks/velocity-storage-5J6BAMCW.mjs +8 -0
- package/dist/bin/hook-chunks/weak-model-mode-ZRNKFTFF.mjs +8 -0
- package/dist/bin/hook-chunks/work-graph-PGYHFLEL.mjs +49 -0
- package/dist/bin/hook-chunks/work-scope-FIB6LBKE.mjs +8 -0
- package/dist/bin/hook-chunks/{workspace-occupancy-UVIRHY5Z.mjs → workspace-occupancy-3D4OKQRB.mjs} +1 -1
- package/dist/bin/hook-chunks/{worktree-service-XGRN5TTE.mjs → worktree-service-AS7JVBK5.mjs} +1 -1
- package/dist/bin/hook-fast-darwin-arm64 +0 -0
- package/dist/bin/hook-fast-darwin-x64 +0 -0
- package/dist/bin/hook-fast-linux-x64 +0 -0
- package/dist/bin/prjct-core.mjs +737 -736
- package/dist/bin/prjct-hooks.mjs +2 -2
- package/dist/bin/prjct.mjs +1 -1
- package/dist/daemon/entry.mjs +651 -647
- package/dist/mcp/server.mjs +310 -312
- package/package.json +1 -1
- package/dist/bin/hook-chunks/auto-flush-5D4PKOMM.mjs +0 -8
- package/dist/bin/hook-chunks/capture-gate-EOOSAGAP.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4DDCWMI6.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-4KY2EHXS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A5RNWWTH.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-A7SGMNOK.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-AKIN5WSQ.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-BNWB77U5.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-CQHPIYNM.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-CTWZQ7YI.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-DLHSCKBJ.mjs +0 -15
- package/dist/bin/hook-chunks/chunk-DV7KV2O4.mjs +0 -38
- package/dist/bin/hook-chunks/chunk-EHP4DYVQ.mjs +0 -71
- package/dist/bin/hook-chunks/chunk-FGQZ62ZP.mjs +0 -47
- package/dist/bin/hook-chunks/chunk-HJ4HEI45.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-J6JZ4PQA.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-JRKGG2E3.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-L4COZ7ZH.mjs +0 -13
- package/dist/bin/hook-chunks/chunk-LT5WSSQO.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-MHRMV4WI.mjs +0 -31
- package/dist/bin/hook-chunks/chunk-N5WOHG36.mjs +0 -8
- package/dist/bin/hook-chunks/chunk-NJAMZSHM.mjs +0 -26
- package/dist/bin/hook-chunks/chunk-NWY5M34K.mjs +0 -12
- package/dist/bin/hook-chunks/chunk-OB5GRS7T.mjs +0 -18
- package/dist/bin/hook-chunks/chunk-PW3KYKVS.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-SVZHJZ5T.mjs +0 -9
- package/dist/bin/hook-chunks/chunk-UB53HQMG.mjs +0 -14
- package/dist/bin/hook-chunks/chunk-UBMIPWJR.mjs +0 -19
- package/dist/bin/hook-chunks/chunk-VPPHD762.mjs +0 -11
- package/dist/bin/hook-chunks/chunk-VV7VNUTF.mjs +0 -16
- package/dist/bin/hook-chunks/chunk-YJMWY4Y6.mjs +0 -8
- package/dist/bin/hook-chunks/client-SKFMAUI5.mjs +0 -10
- package/dist/bin/hook-chunks/code-graph-cloud-65GCWNII.mjs +0 -8
- package/dist/bin/hook-chunks/custom-workflow-storage-M77INP6Z.mjs +0 -8
- package/dist/bin/hook-chunks/cwd-changed-FYNPPO73.mjs +0 -8
- package/dist/bin/hook-chunks/developer-evolution-R5BXQH6G.mjs +0 -12
- package/dist/bin/hook-chunks/distill-W7QGQUDX.mjs +0 -8
- package/dist/bin/hook-chunks/enriched-recall-W7KYRYVR.mjs +0 -8
- package/dist/bin/hook-chunks/exec-I7XE7NMD.mjs +0 -8
- package/dist/bin/hook-chunks/format-BOWFDUBP.mjs +0 -8
- package/dist/bin/hook-chunks/judgment-receipt-WGTFKID7.mjs +0 -8
- package/dist/bin/hook-chunks/land-cue-WLGSULSO.mjs +0 -9
- package/dist/bin/hook-chunks/land-synthesis-V7UH5QV6.mjs +0 -8
- package/dist/bin/hook-chunks/legacy-crew-sweep-MFE4BDNR.mjs +0 -24
- package/dist/bin/hook-chunks/memory-index-B53F5HAX.mjs +0 -10
- package/dist/bin/hook-chunks/notification-HJLS4L7Y.mjs +0 -8
- package/dist/bin/hook-chunks/post-edit-TT3XOG55.mjs +0 -8
- package/dist/bin/hook-chunks/pre-bash-2KKF4V6G.mjs +0 -11
- package/dist/bin/hook-chunks/pre-commit-UU4SKKWV.mjs +0 -8
- package/dist/bin/hook-chunks/pre-edit-RTBLZPWH.mjs +0 -11
- package/dist/bin/hook-chunks/pre-package-LQTINBT4.mjs +0 -8
- package/dist/bin/hook-chunks/pre-search-UJU3XZ2K.mjs +0 -9
- package/dist/bin/hook-chunks/pre-secrets-IE5NX5X5.mjs +0 -8
- package/dist/bin/hook-chunks/project-memory-YHQBRX3D.mjs +0 -8
- package/dist/bin/hook-chunks/project-style-evolution-HS6HYI7W.mjs +0 -8
- package/dist/bin/hook-chunks/prompt-AYY7BZFG.mjs +0 -22
- package/dist/bin/hook-chunks/publish-helper-I37V4L7U.mjs +0 -8
- package/dist/bin/hook-chunks/purge-AXMYTZVM.mjs +0 -8
- package/dist/bin/hook-chunks/retention-22OSCAGV.mjs +0 -8
- package/dist/bin/hook-chunks/sdd-W3OUQPHD.mjs +0 -10
- package/dist/bin/hook-chunks/session-continuity-LO2KNHXU.mjs +0 -11
- package/dist/bin/hook-chunks/session-start-5UZSL6OY.mjs +0 -8
- package/dist/bin/hook-chunks/setup-BSWLQJPE.mjs +0 -142
- package/dist/bin/hook-chunks/spec-task-breakdown-QJWGCON2.mjs +0 -8
- package/dist/bin/hook-chunks/state-storage-KNGP2CQV.mjs +0 -8
- package/dist/bin/hook-chunks/stop-QVDK6LUV.mjs +0 -17
- package/dist/bin/hook-chunks/subagent-start-UYBSD7VK.mjs +0 -8
- package/dist/bin/hook-chunks/subagent-stop-FHLL7X66.mjs +0 -8
- package/dist/bin/hook-chunks/symbol-graph-LZM4RZXZ.mjs +0 -8
- package/dist/bin/hook-chunks/task-service-RMCQEHV6.mjs +0 -8
- package/dist/bin/hook-chunks/tdd-LV63NXZ3.mjs +0 -10
- package/dist/bin/hook-chunks/weak-model-mode-VDYJ25PX.mjs +0 -8
- package/dist/bin/hook-chunks/work-graph-QJGNBVIP.mjs +0 -49
- package/dist/bin/hook-chunks/work-scope-OKFSTW6D.mjs +0 -8
|
@@ -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 d,g as r}from"./chunk-
|
|
8
|
+
import{e as d,g as r}from"./chunk-UHVYBU7F.mjs";import{a as o}from"./chunk-E66B27AL.mjs";r();function t(e,s=500){let n=e?.replace(/\s+/g," ").trim();return n?n.length<=s?n:`${n.slice(0,s-3)}...`:null}o(t,"cleanText");function i(e){let s=[];return e.agent&&s.push(`agent=${e.agent}`),(e.tokensIn??0)+(e.tokensOut??0)>0&&(s.push(`tokens_in=${Math.round(e.tokensIn??0)}`),s.push(`tokens_out=${Math.round(e.tokensOut??0)}`)),e.filesTouched&&e.filesTouched.length>0&&s.push(`files_touched=${e.filesTouched.length}`),s.length===0?null:s.join(" ")}o(i,"summary");function a(e){if(!e.sessionId)return;let s=new Date().toISOString();try{d.run(e.projectId,`INSERT INTO agent_sessions
|
|
9
9
|
(id, project_id, directory, task_id, goal, started_at, created_at)
|
|
10
10
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
11
11
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as f}from"./chunk-HEDZA6KC.mjs";import{a as i}from"./chunk-ZMLA5SKR.mjs";import{a as y}from"./chunk-V2FR2NPL.mjs";import{d as g,g as x}from"./chunk-UHVYBU7F.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
|
+
`).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
|
+
FROM memory_entries me
|
|
11
|
+
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
12
|
+
WHERE me.deleted_at IS NULL
|
|
13
|
+
AND t.key = 'source'
|
|
14
|
+
AND t.value IN ('transcript-auto', 'land-auto')
|
|
15
|
+
ORDER BY me.created_at DESC
|
|
16
|
+
LIMIT 8`).map(r=>({type:r.type,content:r.content}))}catch{return[]}}a(b,"recentAutoCaptures");export{N as a,L 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{a as r}from"./chunk-
|
|
8
|
+
import{a as r}from"./chunk-RTEEXGEA.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};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as o,c as O}from"./chunk-E66B27AL.mjs";import{exec as _,execFile as U,spawn as R}from"node:child_process";import{promisify as T}from"node:util";function B(r){try{process.platform==="win32"?r.pid!==void 0&&R("taskkill",["/pid",String(r.pid),"/T","/F"],{stdio:"ignore"}).unref():r.pid!==void 0&&process.kill(-r.pid,"SIGKILL")}catch{}try{r.kill("SIGKILL")}catch{}}function h(r,e){if(r.length===0)return"";let t=Buffer.concat(r);return(t.length>e?t.subarray(0,e):t).toString("utf8")}function G(r){let e=r.code;return typeof e=="string"?e:void 0}function J(r,e,t={}){let n=t.timeoutMs??D,s=t.maxBuffer??K,a=s,C=t.spawnFn??R,f=[r,...e],I=Date.now(),l=o(()=>Date.now()-I,"duration");return t.signal?.aborted?Promise.resolve({ok:!1,kind:"timeout",budgetMs:0,budgetSource:"abort",args:f,stdout:"",stderr:"",durationMs:0}):new Promise(F=>{let P=[],v=[],u={settled:!1,overflow:!1,outBytes:0,errBytes:0},d=C(r,e,{cwd:t.cwd,env:t.env,detached:process.platform!=="win32",stdio:["ignore","pipe","pipe"]}),g=o(i=>{u.settled||(u.settled=!0,clearTimeout(L),t.signal?.removeEventListener("abort",S),F(i))},"finish"),x=o(()=>({stdout:h(P,a),stderr:h(v,a)}),"partials"),E=o((i,c)=>{B(d);let{stdout:m,stderr:k}=x();g({ok:!1,kind:"timeout",budgetMs:c,budgetSource:i,args:f,stdout:m,stderr:k,durationMs:l()})},"finishTimeout"),A=o(()=>{B(d);let{stdout:i,stderr:c}=x();g({ok:!1,kind:"overflow",maxBuffer:s,args:f,stdout:i,stderr:c||`maxBuffer exceeded (${s} bytes)`,durationMs:l()})},"finishOverflow"),L=setTimeout(()=>E("timeout",n),n),S=o(()=>E("abort",n),"onAbort");t.signal?.addEventListener("abort",S,{once:!0});let y=o((i,c)=>{u.settled||(c?(v.push(i),u.errBytes+=i.length):(P.push(i),u.outBytes+=i.length),!u.overflow&&u.outBytes+u.errBytes>s&&(u.overflow=!0,A()))},"onChunk");d.stdout?.on("data",i=>y(i,!1)),d.stderr?.on("data",i=>y(i,!0)),d.on("error",i=>{g({ok:!1,kind:"spawn",cause:i,code:G(i),args:f,durationMs:l()})}),d.on("close",(i,c)=>{if(u.settled)return;let{stdout:m,stderr:k}=x();g(i===0?{ok:!0,stdout:m,stderr:k,durationMs:l()}:{ok:!1,kind:"exit",code:i??-1,signal:c,stdout:m,stderr:k.trim(),args:f,durationMs:l()})})})}function w(r,e={}){return J("git",r,e)}function q(r){return!r.ok&&(r.kind==="timeout"||r.kind==="spawn"||r.kind==="overflow")}function Q(r,e){return!Number.isInteger(e)||e<0?!1:!r.ok&&r.kind==="exit"&&r.code===e}function b(r,e=N){let n=r.replace(/[\r\n\t]+/g," ").replace(/\s+/g," ").trim().replace(/(?:[A-Za-z]:)?(?:\/|\\)(?:Users|home|tmp|var|private|Users)(?:\/|\\)[^\s]*/gi,"\u2026").replace(/\/(?:Users|home|tmp|var|private)\/[^\s]*/gi,"\u2026");return n.length<=e?n:`${n.slice(0,Math.max(0,e-1))}\u2026`}function $(r){return r.ok||r.kind==="exit"?null:r.kind==="timeout"?new p("timeout",r.args,r.budgetSource==="abort"?"aborted by caller signal":`exceeded ${r.budgetMs}ms`,{budgetSource:r.budgetSource}):r.kind==="overflow"?new p("overflow",r.args,`maxBuffer ${r.maxBuffer} bytes`):new p("spawn",r.args,r.cause.message)}function j(r){if(r.ok)return null;if(r.kind==="exit"){let e=r.stderr?` \u2014 ${b(r.stderr,120)}`:"",t=r.signal?` signal=${r.signal}`:"";return new Error(b(`command failed (exit ${r.code}${t}): ${r.args.join(" ")}${e}`))}return $(r)}function M(r){throw r.ok?new Error("throwProc called on ok result"):j(r)??new Error(`process failed (${r.kind})`)}function W(r,e){if(r.ok)return e.ok(r);switch(r.kind){case"exit":return e.exit(r);case"timeout":return e.timeout(r);case"spawn":return e.spawn(r);case"overflow":return e.overflow(r);default:return r}}async function Y(r,e,t={}){let n=await w(e,{...t,cwd:r});if(n.ok)return n.stdout.trim();let s=$(n);if(s)throw s;return null}async function rr(r){let e=new Set,t=await w(["diff","--name-only","HEAD"],{cwd:r});if(t.ok)for(let s of t.stdout.split(`
|
|
9
|
+
`)){let a=s.trim();a&&e.add(a)}else t.kind!=="exit"&&M(t);let n=await w(["ls-files","--others","--exclude-standard"],{cwd:r});if(n.ok)for(let s of n.stdout.split(`
|
|
10
|
+
`)){let a=s.trim();a&&e.add(a)}else n.kind!=="exit"&&M(n);return[...e].sort()}var V,Z,D,K,N,p,z=O(()=>{V=T(_),Z=T(U),D=1e4,K=1024*1024,N=240;o(B,"killProcessTree");o(h,"joinChunks");o(G,"nodeErrorCode");o(J,"runProc");o(w,"runGit");o(q,"isProcInfra");o(Q,"exitCodeMeans");o(b,"sanitizeProcEnvelope");p=class extends Error{static{o(this,"GitInfraError")}kind;args;detail;budgetSource;constructor(e,t,n,s){super(b(`git ${e} failure (${t.join(" ")}): ${n}`)),this.name="GitInfraError",this.kind=e,this.args=t,this.detail=n,this.budgetSource=s?.budgetSource}};o($,"gitInfraErrorOf");o(j,"procErrorOf");o(M,"throwProc");o(W,"matchProc");o(Y,"gitStdout");o(rr,"listChangedFiles")});export{V as a,Z as b,N as c,J as d,w as e,q as f,Q as g,b as h,p as i,$ as j,j as k,M as l,W as m,Y as n,rr as o,z as p};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as o}from"./chunk-E66B27AL.mjs";var s={critical:0,high:1,medium:2,low:3},c={active:0,previously_active:1,backlog:2};function u(e){return[...e].sort((t,r)=>{let i=c[t.section]-c[r.section];return i!==0?i:s[t.priority]-s[r.priority]})}o(u,"sortBySectionAndPriority");function a(e,t){let r=new Set;return e.filter(i=>{let n=t(i);return r.has(n)?!1:(r.add(n),!0)})}o(a,"uniqueBy");function y(e){return Array.from(e.entries()).map(([t,r])=>({path:t,score:r})).sort((t,r)=>r.score-t.score)}o(y,"scoresToSortedArray");export{u as a,a as b,y as c};
|
|
@@ -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 l,c as f,d as u}from"./chunk-TPESWBA7.mjs";import{a as c}from"./chunk-
|
|
8
|
+
import{b as l,c as f,d as u}from"./chunk-TPESWBA7.mjs";import{a as c}from"./chunk-J5UQVJUW.mjs";import{a as o}from"./chunk-E66B27AL.mjs";var m={none:0,frame:1,reviewed:2},y={none:0,after:1,first:2},p=o((e,n)=>m[e]>=m[n]?e:n,"maxSpec"),g=o((e,n)=>y[e]>=y[n]?e:n,"maxTest");function x(e){return e!=="docs"&&e!=="chore"}o(x,"isCodeKind");function E(e,n,t){let r=x(n);if(n==="research")return{model:"balanced",effort:"medium",spec:"none",tests:"none",fanout:"parallel",quality:"none",expectedPoints:2,directive:"",cast:[]};switch(e){case"H0":return{model:"fast",effort:"low",spec:"none",tests:"none",fanout:"direct",quality:"none",expectedPoints:1,directive:"",cast:[]};case"H1":return{model:"balanced",effort:"medium",spec:"none",tests:r?"after":"none",fanout:"direct",quality:r?"standard":"none",expectedPoints:2,directive:"",cast:[]};case"H2":return{model:"frontier",effort:"medium",spec:r?"frame":"none",tests:r?"first":"none",fanout:"parallel",quality:r?"standard":"none",expectedPoints:5,directive:"",cast:[]};default:return{model:"frontier",effort:t==="high"?"high":"medium",spec:r?"reviewed":"none",tests:r?"first":"none",fanout:"crew",quality:n==="security"||t==="high"||r?"full":"none",expectedPoints:8,directive:"",cast:[]}}}o(E,"baseline");function H(e,n,t,r){if(!x(n))return e;let s=t==="strict"?p(e.spec,"reviewed"):p(e.spec,t==="advisory"?"frame":"none"),a=r==="strict"?g(e.tests,"first"):g(e.tests,r==="assist"?"after":"none");return{...e,spec:s,tests:a}}o(H,"applyModeFloors");var h={none:"no spec",frame:'frame a lightweight spec (`prjct spec "<title>"`)',reviewed:'reviewed spec + audit panel (`prjct spec "<title>"` \u2192 `prjct spec audit <id>`)'},T={none:"no test ceremony",after:"leave a regression test behind",first:"tests BEFORE implementation"},w={direct:"do it yourself \u2014 no subagents",parallel:"DEFAULT multi-agent geometry: explore (fast) \u2192 implement (frontier) \u2192 review (balanced dual-blind); set EACH subagent model explicitly (they inherit yours otherwise: mem_3432). Stay single-thread only for a truly atomic one-file fix",crew:"DEFAULT crew geometry (`prjct crew`): leader + implementer + review lenses. Set EACH subagent model (Explore\u2192fast, implementer\u2192frontier, reviewers\u2192balanced) \u2014 they inherit your expensive model unless you fix it"},v={none:"no judgment tax (trivial)",standard:"quality auto: ledger opened; follow injected `prjct judgment next` card (one review + batch challenge)",full:"quality auto: ledger opened; follow injected next card (RED+BLUE dual-blind + batch refuters)"},S={fast:"fast/cheap model (e.g. haiku)",balanced:"balanced model (e.g. sonnet)",frontier:"frontier model (e.g. opus)"},O="Before implementing, forecast the diff size: if it will exceed ~400 changed lines, decide the delivery strategy NOW (split into stacked PRs / ship a first slice) instead of producing one unreviewable diff.";function P(e,n,t){let r=t.effort==="high"?", HIGH effort":t.effort==="low"?", low effort":"";if(e==="H0")return`Orchestrate (${e} ${n}): trivial \u2014 do it directly on a ${S[t.model]}${r}. ${h[t.spec]}, ${T[t.tests]}, ${w[t.fanout]}. ${v[t.quality]}. Don\u2019t burn frontier tokens on this. ${c}`;let s=e==="H2"||e==="H3"?` ${O}`:"",a=t.fanout==="parallel"||t.fanout==="crew"?" Multi-agent is the DEFAULT geometry for this harness class \u2014 do not collapse to a single-thread monologue unless the change is truly atomic.":"",i=t.cast.length>0?` ${l(t.cast)}. ${f(t.cast)}`:"";return`Orchestrate (${e} ${n}/${t.model}${r}): ${h[t.spec]}; ${T[t.tests]}; ${w[t.fanout]}; ${v[t.quality]}.${s}${a}${i} ${c}`}o(P,"renderDirective");function q(e){return e<50?1:e<150?2:e<400?5:8}o(q,"pointsFromDiffLines");function A(e){return e>=8?`\u26A0 Delegation trigger: ${e} files edited this cycle. This is no longer one change \u2014 split the remainder into its own cycle/PR and run a FRESH-context review of what's already written before \`prjct status done\`.`:e>=4?`\u21B3 Delegation trigger: ${e} files edited this cycle. Keep ONE writer thread; before closing, review the full diff with fresh eyes (subagent or re-read) \u2014 multi-file changes hide cross-file breaks.`:null}o(A,"renderDelegationTrigger");function D(e,n="off",t="off",r="off",s){let a=E(e.level,e.kind,e.risk),i=H(a,e.kind,n,t),b=r==="on"&&i.quality==="none"?"standard":r==="on"&&i.quality==="standard"?"full":i.quality,$=(s??`${e.level}:${e.kind}:${e.risk}`).trim(),C=u(i.fanout,$),d={...i,quality:b,cast:C};return{...d,directive:P(e.level,e.kind,d)}}o(D,"orchestrationFor");export{q as a,A as b,D 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 E}from"./chunk-
|
|
8
|
+
import{a as E}from"./chunk-5XA5RL5I.mjs";import{a as m,b as l,c as y}from"./chunk-I26F7TLM.mjs";import{d as s,g as v}from"./chunk-UHVYBU7F.mjs";import{b as u,c as p,h as S}from"./chunk-A6K4H3YT.mjs";import{a as d}from"./chunk-E66B27AL.mjs";import{z as t}from"zod";var T=t.enum(["low","medium","high"]),R=t.enum(["pending","converted","completed","archived","dormant"]),I=t.enum(["high","medium","low"]),P=t.object({impact:I,effort:I}),f=t.object({frontend:t.string().optional(),backend:t.string().optional(),payments:t.string().optional(),ai:t.string().optional(),deploy:t.string().optional(),other:t.array(t.string()).optional()}),A=t.object({name:t.string(),description:t.string()}),D=t.object({name:t.string(),description:t.string().optional()}),O=t.object({id:t.string(),text:t.string(),details:t.string().optional(),priority:T,status:R,tags:t.array(t.string()),addedAt:t.string(),completedAt:t.string().optional(),convertedTo:t.string().optional(),source:t.string().optional(),sourceFiles:t.array(t.string()).optional(),painPoints:t.array(t.string()).optional(),solutions:t.array(t.string()).optional(),filesAffected:t.array(t.string()).optional(),impactEffort:P.optional(),implementationNotes:t.string().optional(),stack:f.optional(),modules:t.array(A).optional(),roles:t.array(D).optional(),risks:t.array(t.string()).optional(),risksCount:t.number().optional()}),h=t.object({ideas:t.array(O),lastUpdated:t.string()});S();v();function o(n){let e=(()=>{if(!n.tags)return[];try{let i=JSON.parse(n.tags);return Array.isArray(i)?i:[]}catch{return[]}})(),r={...(()=>{if(!n.data)return{};try{return JSON.parse(n.data)}catch{return{}}})(),id:n.id,text:n.text,status:n.status,priority:n.priority,tags:e,addedAt:n.added_at};return n.converted_to!=null&&(r.convertedTo=n.converted_to),n.details!=null&&(r.details=n.details),r}d(o,"rowToIdea");var g=class extends E{static{d(this,"IdeasStorage")}constructor(){super("ideas.json",h)}getDefault(){return{ideas:[],lastUpdated:""}}getEventType(e){return`ideas.${e}d`}async getAll(e){return s.query(e,"SELECT * FROM ideas ORDER BY added_at DESC").map(o)}async getPending(e){return s.query(e,"SELECT * FROM ideas WHERE status = 'pending' ORDER BY added_at DESC").map(o)}async addIdea(e,a,r={}){let i={id:m(),text:a,status:"pending",priority:r.priority||"medium",tags:r.tags||[],addedAt:u()};return s.run(e,`INSERT INTO ideas (id, text, status, priority, tags, added_at, converted_to, details, data)
|
|
9
9
|
VALUES (?, ?, ?, ?, ?, ?, NULL, NULL, NULL)`,i.id,i.text,i.status,i.priority,i.tags.length?JSON.stringify(i.tags):null,i.addedAt),await this.publishEvent(e,"idea.created",{ideaId:i.id,text:i.text,priority:i.priority}),i}async upsertIdea(e,a){s.run(e,`INSERT INTO ideas (id, text, status, priority, tags, added_at)
|
|
10
10
|
VALUES (?, ?, ?, ?, NULL, ?)
|
|
11
11
|
ON CONFLICT(id) DO UPDATE SET
|
|
@@ -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-UHVYBU7F.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 c,e as p,h as l}from"./chunk-UUULLTQV.mjs";import{b as E,c as d}from"./chunk-
|
|
8
|
+
import{d as c,e as p,h as l}from"./chunk-UUULLTQV.mjs";import{b as E,c as d}from"./chunk-I26F7TLM.mjs";import{b as m}from"./chunk-PO3QDKTE.mjs";import{e as i,g as R}from"./chunk-UHVYBU7F.mjs";import{a as g}from"./chunk-E66B27AL.mjs";l();R();var y=class{static{g(this,"MemoryService")}async log(t,r,n,o,s){try{let e=s?.projectId??await m.getProjectId(t);return e?{eventId:i.appendEvent(e,`memory.${r}`,{...n,author:o}),projectId:e}:null}catch(e){let a=e instanceof Error?e.message:String(e);if(s?.required)throw new Error(a);return console.error(`Memory log error: ${a}`),null}}async clear(t){try{let r=await m.getProjectId(t);if(!r)return;i.run(r,"DELETE FROM events WHERE type >= ? AND type < ?",...c)}catch(r){console.error(`Memory clear error: ${r instanceof Error?r.message:String(r)}`)}}async getRecentEvents(t,r=100){try{return i.query(t,"SELECT type, data, timestamp FROM events WHERE type >= ? AND type < ? ORDER BY id DESC LIMIT ?",...c,r).reverse().map(o=>{let s=JSON.parse(o.data);return{timestamp:o.timestamp,action:o.type.replace("memory.",""),...s}})}catch(n){return console.error(`Memory read error: ${n instanceof Error?n.message:String(n)}`),[]}}async capEntries(t){try{let n=i.get(t,"SELECT COUNT(*) as cnt FROM events WHERE type >= ? AND type < ? AND NOT (type >= ? AND type < ?)",...c,...p)?.cnt??0;if(n<=E.MEMORY_MAX_ENTRIES)return 0;let o=n-E.MEMORY_MAX_ENTRIES,s=i.query(t,"SELECT id, type, data, timestamp FROM events WHERE type >= ? AND type < ? AND NOT (type >= ? AND type < ?) ORDER BY id ASC LIMIT ?",...c,...p,o);return d.archiveMany(t,s.map((e,a)=>({entityType:"memory_entry",entityId:`memory-${e.timestamp||a}`,entityData:{type:e.type,data:JSON.parse(e.data),timestamp:e.timestamp},summary:e.type.replace("memory.",""),reason:"overflow"}))),i.transaction(t,e=>{let a=e.prepare("DELETE FROM events WHERE id = ?");for(let u of s)a.run(u.id)}),o}catch(r){return console.error(`Memory cap error: ${r instanceof Error?r.message:String(r)}`),0}}},O=new y;export{O 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{d as p}from"./chunk-
|
|
8
|
+
import{d as p}from"./chunk-C4O243NG.mjs";import{e as f}from"./chunk-TXSLON7M.mjs";import{a as g}from"./chunk-V2FR2NPL.mjs";import{e as m,g as _}from"./chunk-UHVYBU7F.mjs";import{a as l}from"./chunk-E66B27AL.mjs";_();var S=8,y=140;function h(d,r){if(r.length===0)return 0;let n=[];try{m.transaction(d,s=>{let i=s.prepare("DELETE FROM memory_embeddings WHERE memory_id = ?"),c=s.prepare("DELETE FROM memory_entries WHERE id = ?"),t=s.prepare("DELETE FROM events WHERE id = ? AND type LIKE 'memory.remember.%'");for(let e of r){try{i.run(e)}catch{}c.run(e).changes&&n.push(e);let a=e.match(/^mem_(\d+)$/);if(a)try{t.run(Number(a[1]))}catch{}}})}catch{return n.length}return n.length}l(h,"hardDeleteEntries");function w(d,r,n){let s=new Map;for(let e of r)s.set(e.type,(s.get(e.type)??0)+1);let i=[...s.entries()].sort((e,o)=>o[1]-e[1]).map(([e,o])=>`${e}\xD7${o}`).join(", "),c=r.map(e=>p(e).replace(/\s+/g," ").trim()).filter(e=>e.length>20).slice(0,S).map(e=>`- ${e.length>y?`${e.slice(0,y-1)}\u2026`:e}`),t=[`Distill of discarded auto-history (${d}).`,`Context synthesis: ${r.length} low-value rows collapsed \u2014 raw history deleted; only this digest remains for the project model.`,`Key data: source=retention-distill; discarded=${r.length}; types=${i}; at=${n}`,"What happened: purged auto-generated / redundant captures that added no excess vs the reference model.","Why it mattered: prevent vault bloat; agents must not re-read detector noise.",`Outcome: ${r.length} raw entries hard-deleted after distillation.`,"Next implication: prefer high-excess judgment; re-run detectors only when code/model changes."];return c.length>0&&t.push(`Sample cues (not full bodies):
|
|
9
9
|
${c.join(`
|
|
10
10
|
`)}`),t.join(" ")}l(w,"buildDistillContent");async function A(d,r,n,s,i){if(s.length<=i)return{discarded:0,digested:!1};let t=[...s].sort((u,b)=>b.rememberedAt.localeCompare(u.rememberedAt)).slice(i);if(t.length===0)return{discarded:0,digested:!1};let e=new Date().toISOString(),o=`auto-distill:${n}`,a=w(n,t,e),E=await g.remember(d,{type:"learning",content:a,tags:{source:"retention-distill",topic:o,capture:"distill-discard-v1",context_schema:"living-v2",synthesis:"deterministic",discarded_count:String(t.length),auto_source:n},provenance:"inferred",projectId:r}).then(()=>!0).catch(()=>!1),D=t.map(u=>u.id);return{discarded:h(r,D),digested:E,digestTopic:o}}l(A,"distillAndDiscardAutoSource");async function v(d,r,n){let s=g.allEntriesForIndex(r),i=new Map;for(let t of s){let e=t.tags?.source;if(!f(e)||e==="retention-distill"||t.tags?.source==="retention-distill")continue;let o=i.get(e)??[];o.push(t),i.set(e,o)}let c=[];for(let[t,e]of i){if(e.length<=n)continue;let o=await A(d,r,t,e,n);c.push(o)}return{discarded:c.reduce((t,e)=>t+e.discarded,0),digests:c.filter(t=>t.digested).length}}l(v,"distillAndDiscardAllAutoSources");function x(d,r,n=1e3){let s=Date.now()-r*864e5;try{let i=m.query(d,`SELECT id, type, content FROM memory_entries
|
|
11
11
|
WHERE deleted_at IS NOT NULL AND deleted_at < ?
|
|
@@ -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 k,b as a}from"./chunk-
|
|
8
|
+
import{a as k,b as a}from"./chunk-MHNWIB7B.mjs";import{a as E}from"./chunk-S5ISOGDB.mjs";import{k as l,o as A}from"./chunk-UH4MD3F3.mjs";import{c as d}from"./chunk-PKDYFXMI.mjs";import{e as c,f as v}from"./chunk-BUDZL4DW.mjs";import{a as n}from"./chunk-E66B27AL.mjs";v();function C(r,e,t){if(t.md){console.log(`> ${e}`);return}k[r](e)}n(C,"notify");var B=n((r,e={})=>C("warn",r,e),"notifyWarn");var D=n((r,e={})=>C("fail",r,e),"notifyFail");function J(r,e={}){return B(r,e),{success:!1,error:r}}n(J,"failWith");function Z(r,e={}){return D(r,e),{success:!1,error:r}}n(Z,"failHard");function ee(r,e){let t=c(r);return e&&D(t,e),{success:!1,error:t}}n(ee,"failFromError");A();import x from"node:path";var f={value:null},$={type:"claude",name:"Claude (Code + Desktop)",isSupported:!0,capabilities:{mcp:!0,filesystem:"mcp",markdown:!0,emojis:!0,colors:!0,interactive:!0,agents:!0},config:{configFile:"CLAUDE.md",commandPrefix:"p.",responseStyle:"rich",dataDir:".prjct",commandsDir:"~/.claude/commands/p"},environment:{hasMCP:!0,sandboxed:!1,persistent:!0,agentSystem:!0}},j={type:"terminal",name:"Terminal/CLI",isSupported:!0,capabilities:{mcp:!1,filesystem:"native",markdown:!1,emojis:!0,colors:!0,interactive:!0,agents:!1},config:{configFile:null,commandPrefix:"prjct",responseStyle:"cli",dataDir:".prjct",commandsDir:null},environment:{hasMCP:!1,sandboxed:!1,persistent:!0,agentSystem:!1}};async function L(){if(process.env.CLAUDE_AGENT||process.env.ANTHROPIC_CLAUDE||global.mcp||process.env.MCP_AVAILABLE)return!0;let r=process.cwd();if(await l(x.join(r,"CLAUDE.md")))return!0;let e=process.env.HOME||process.env.USERPROFILE||"";if(await l(x.join(e,".claude")))return!0;let t=process.cwd();return!!(t.includes("/.claude/")||t.includes("/claude-workspace/"))}n(L,"isClaudeEnvironment");function V(){return{...$}}n(V,"getClaudeAgent");function U(){return{...j}}n(U,"getTerminalAgent");function G(){return!!(process.env.CODEX_SANDBOX||process.env.PRJCT_SANDBOX==="1")}n(G,"isSandboxed");async function T(){if(f.value)return f.value;let r=await L()?V():U();return r.environment={...r.environment,sandboxed:G()},f.value=r,r}n(T,"detect");v();A();import p from"node:fs/promises";var y=class{static{n(this,"RuntimeClaude")}name;type;constructor(){this.name="Claude Code",this.type="claude"}formatResponse(e,t="info"){let i={success:"\u2705",error:"\u274C",warning:"\u26A0\uFE0F",info:"\u2139\uFE0F",celebrate:"\u{1F389}",ship:"\u{1F680}",focus:"\u{1F3AF}",idea:"\u{1F4A1}",progress:"\u{1F4CA}",task:"\u{1F4DD}"};return`${i[t]||i.info} ${e}`}async readFile(e){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.read(e)}catch(t){console.warn(`MCP readFile failed, falling back to fs: ${c(t)}`)}return await p.readFile(e,"utf8")}async writeFile(e,t){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.write(e,t)}catch(i){console.warn(`MCP writeFile failed, falling back to fs: ${c(i)}`)}await p.writeFile(e,t,"utf8")}async listDirectory(e){try{if(global.mcp?.filesystem)return await global.mcp.filesystem.list(e)}catch(t){console.warn(`MCP listDirectory failed, falling back to fs: ${c(t)}`)}return await p.readdir(e)}async fileExists(e){return l(e)}async createDirectory(e){await p.mkdir(e,{recursive:!0})}getTimestamp(){return new Date().toISOString()}formatTaskList(e){return!e||e.length===0?"\u{1F4CB} No tasks queued":`\u{1F4CB} Queue:
|
|
9
9
|
${e.map((t,i)=>`${i+1}. ${t}`).join(`
|
|
10
10
|
`)}`}formatRecap(e){return`\u{1F4CA} Recap
|
|
11
11
|
|
|
@@ -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 g}from"./chunk-
|
|
8
|
+
import{b as g}from"./chunk-M5E2YOZ4.mjs";import{d,g as C}from"./chunk-UHVYBU7F.mjs";import{b as f,h as E}from"./chunk-A6K4H3YT.mjs";import{e as _,p as q}from"./chunk-QWQFF2UG.mjs";import{a as s}from"./chunk-E66B27AL.mjs";E();C();function m(e){return{projectId:e.project_id,taskId:e.task_id,workspaceId:e.workspace_id,classification:e.classification,station:e.station,requiresSpec:e.requires_spec===1,requiresTestsFirst:e.requires_tests_first===1,reason:e.reason,linkedSpecId:e.linked_spec_id,createdAt:e.created_at,updatedAt:e.updated_at}}s(m,"toState");function y(e,t){let i=f(),r=d.query(e,`INSERT INTO task_pipeline_state (
|
|
9
9
|
project_id, task_id, workspace_id, classification, station,
|
|
10
10
|
requires_spec, requires_tests_first, reason, linked_spec_id,
|
|
11
11
|
created_at, updated_at
|
|
@@ -5,7 +5,7 @@ import { dirname as __pathDirname } from 'path';
|
|
|
5
5
|
const require = __createRequire(import.meta.url);
|
|
6
6
|
const __filename = __fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = __pathDirname(__filename);
|
|
8
|
-
import{a as d}from"./chunk-
|
|
8
|
+
import{a as d}from"./chunk-V2FR2NPL.mjs";import{c as l}from"./chunk-I26F7TLM.mjs";import{e as a,g as p}from"./chunk-UHVYBU7F.mjs";import{a as m}from"./chunk-E66B27AL.mjs";p();var E=7,T=90,f=20,A=["pattern-detector","transcript-auto","skill-miss","friction","land-auto","sync-context-quality"];function h(e){return e?A.some(t=>e===t||e.startsWith(`${t}-`)||e.startsWith(t)):!1}m(h,"isAutoSource");function L(e,t=E,o=500){let u=Date.now()-t*864e5;try{let n=a.query(e,`SELECT id FROM memory_entries
|
|
9
9
|
WHERE deleted_at IS NOT NULL AND deleted_at < ?
|
|
10
10
|
ORDER BY deleted_at ASC
|
|
11
11
|
LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM memory_embeddings WHERE memory_id = ?"),r=s.prepare("DELETE FROM memory_entries WHERE id = ?");for(let c of n){try{i.run(c.id)}catch{}r.run(c.id)}}),n.length)}catch{return 0}}m(L,"purgeSoftDeleted");function O(e,t=E,o=500){let u=new Date(Date.now()-t*864e5).toISOString();try{let n=a.query(e,`SELECT e.id FROM events e
|
|
@@ -16,4 +16,4 @@ import{a as d}from"./chunk-3WY2AYPE.mjs";import{c as l}from"./chunk-3LG3ACQV.mjs
|
|
|
16
16
|
WHERE m.id = 'mem_' || e.id AND m.deleted_at IS NULL
|
|
17
17
|
)
|
|
18
18
|
ORDER BY e.id ASC
|
|
19
|
-
LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM events WHERE id = ?");for(let r of n)i.run(r.id)}),n.length)}catch{return 0}}m(O,"purgeOrphanRememberEvents");function g(e,t=f){if(t<=0)return 0;let o=[];try{let u=d.allEntriesForIndex(e),n=new Map;for(let s of u){let i=s.tags?.source;if(!h(i))continue;let r=i,c=n.get(r)??[];c.push(s),n.set(r,c)}for(let[,s]of n){if(s.length<=t)continue;s.sort((r,c)=>r.rememberedAt.localeCompare(c.rememberedAt));let i=s.slice(0,s.length-t);for(let r of i){try{l.archive(e,{entityType:"memory_entry",entityId:r.id,entityData:{id:r.id,type:r.type,content:r.content,tags:r.tags,rememberedAt:r.rememberedAt},summary:r.content.slice(0,80),reason:`auto-source-cap (>${t})`})}catch{}d.forget(e,r.id)&&o.push(r)}}}catch{return o.length}return o.length}m(g,"trimAutoSourceCap");function F(e){let t=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NULL")?.c??0,o=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NOT NULL")?.c??0,u=a.get(e,"SELECT COUNT(*) AS c FROM archives")?.c??0,n=a.get(e,"SELECT COUNT(*) AS c FROM events WHERE type LIKE 'memory.remember.%'")?.c??0,s=(()=>{try{return d.allEntriesForIndex(e).filter(i=>h(i.tags?.source)).length}catch{return 0}})();return{live:t,softDeleted:o,archives:u,rememberEvents:n,autoSourceLive:s}}m(F,"vaultHealth");async function N(e,t={}){let o=t.softDeletedPurgeDays??E,u=t.archivePruneDays??T,n=t.autoSourceMaxLive??f;if(t.dryRun===!0)return{softDeletedPurged:0,orphanEventsPurged:0,archivesPruned:0,autoSourceTrimmed:0,distilledDiscarded:0,digestsWritten:0};let i=await(async()=>{if(t.projectPath)try{let{distillAndDiscardAllAutoSources:_}=await import("./distill-
|
|
19
|
+
LIMIT ?`,u,o);return n.length===0?0:(a.transaction(e,s=>{let i=s.prepare("DELETE FROM events WHERE id = ?");for(let r of n)i.run(r.id)}),n.length)}catch{return 0}}m(O,"purgeOrphanRememberEvents");function g(e,t=f){if(t<=0)return 0;let o=[];try{let u=d.allEntriesForIndex(e),n=new Map;for(let s of u){let i=s.tags?.source;if(!h(i))continue;let r=i,c=n.get(r)??[];c.push(s),n.set(r,c)}for(let[,s]of n){if(s.length<=t)continue;s.sort((r,c)=>r.rememberedAt.localeCompare(c.rememberedAt));let i=s.slice(0,s.length-t);for(let r of i){try{l.archive(e,{entityType:"memory_entry",entityId:r.id,entityData:{id:r.id,type:r.type,content:r.content,tags:r.tags,rememberedAt:r.rememberedAt},summary:r.content.slice(0,80),reason:`auto-source-cap (>${t})`})}catch{}d.forget(e,r.id)&&o.push(r)}}}catch{return o.length}return o.length}m(g,"trimAutoSourceCap");function F(e){let t=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NULL")?.c??0,o=a.get(e,"SELECT COUNT(*) AS c FROM memory_entries WHERE deleted_at IS NOT NULL")?.c??0,u=a.get(e,"SELECT COUNT(*) AS c FROM archives")?.c??0,n=a.get(e,"SELECT COUNT(*) AS c FROM events WHERE type LIKE 'memory.remember.%'")?.c??0,s=(()=>{try{return d.allEntriesForIndex(e).filter(i=>h(i.tags?.source)).length}catch{return 0}})();return{live:t,softDeleted:o,archives:u,rememberEvents:n,autoSourceLive:s}}m(F,"vaultHealth");async function N(e,t={}){let o=t.softDeletedPurgeDays??E,u=t.archivePruneDays??T,n=t.autoSourceMaxLive??f;if(t.dryRun===!0)return{softDeletedPurged:0,orphanEventsPurged:0,archivesPruned:0,autoSourceTrimmed:0,distilledDiscarded:0,digestsWritten:0};let i=await(async()=>{if(t.projectPath)try{let{distillAndDiscardAllAutoSources:_}=await import("./distill-GOGPFQFK.mjs"),y=await _(t.projectPath,e,n);return{distilledDiscarded:y.discarded,digestsWritten:y.digests}}catch{return g(e,n),{distilledDiscarded:0,digestsWritten:0}}else return g(e,n),{distilledDiscarded:0,digestsWritten:0}})(),{distilledDiscarded:r,digestsWritten:c}=i,{eliminateSoftDeletedNoValue:D}=await import("./distill-GOGPFQFK.mjs"),b=D(e,o).purged||L(e,o),S=O(e,o),R=(()=>{try{return l.pruneOldArchives(e,u)}catch{return 0}})();return{softDeletedPurged:b,orphanEventsPurged:S,archivesPruned:R,autoSourceTrimmed:r,distilledDiscarded:r,digestsWritten:c}}m(N,"runVaultPurge");export{E as a,T as b,f as c,A as d,h as e,L as f,O as g,g as h,F as i,N as j};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as R}from"./chunk-HEDZA6KC.mjs";import{a}from"./chunk-ZMLA5SKR.mjs";import{a as h}from"./chunk-V2FR2NPL.mjs";import{d as l,g as E}from"./chunk-UHVYBU7F.mjs";import{a as c}from"./chunk-E66B27AL.mjs";E();var _="land-receipt",k="judgment-receipt",g="receipt-v1";function D(e){let s=e.trapsSurfaced??[],t=e.decisions??[],n=(e.journal??[]).filter(r=>r.trim()),o=(e.openRisksNext??[]).filter(r=>r.trim()),u=e.cycleDescription?.trim()||null,y=e.tokensIn!=null||e.tokensOut!=null||!!e.model;if(!u&&s.length===0&&t.length===0&&n.length===0&&o.length===0&&!y)return null;let i=["# Judgment Receipt",""],m=[];if(u&&m.push(`cycle: "${a(u,100)}"`),n.length>0&&m.push(`journal: ${n.slice(0,4).map(r=>a(r,70)).join(" \xB7 ")}`),m.length>0&&i.push("## Applied judgment",...m.map(r=>`- ${r}`),""),s.length>0&&i.push("## Traps re-surfaced",...s.slice(0,8).map(r=>`- **[${r.type}]** ${a(r.title,100)} \`${r.id}\``),""),t.length>0&&i.push("## Decisions contested or honored",...t.slice(0,8).map(r=>`- **${r.status}** [${r.type}] ${a(r.title,100)} \`${r.id}\``),""),o.length>0||u){let r=o.length>0?o.slice(0,5).map(d=>`- ${a(d,120)}`):["- Finish or pause open cycle; next agent: `prjct prime` / `prjct work --md`."];i.push("## Open risks / next",...r,"")}if(y){let r=[];if(e.tokensIn!=null||e.tokensOut!=null){let d=e.tokensIn??0,f=e.tokensOut??0;r.push(`tokens in=${d} out=${f} total=${d+f}`)}e.model&&r.push(`model=${e.model}`),e.author&&r.push(`author=${e.author}`),i.push("## Session economics",`- ${r.join(" \xB7 ")}`,"")}return i.push("_Closed-loop judgment continuity \u2014 not bulk memory. Proof of traps prevented and decisions applied._"),i.join(`
|
|
9
|
+
`).trim()}c(D,"buildJudgmentReceipt");function I(e){if(!e)return null;let s=(e.match(/## Traps re-surfaced/g)||[]).length,t=p(e,"Traps re-surfaced"),n=p(e,"Decisions contested or honored"),o=[];return t>0&&o.push(`${t} trap(s) re-surfaced`),n>0&&o.push(`${n} decision(s) tracked`),o.length===0&&o.push("session judgment landed"),`Judgment receipt: ${o.join(", ")}`}c(I,"summarizeJudgmentReceipt");function p(e,s){let t=new RegExp(`## ${s}\\n([\\s\\S]*?)(?=\\n## |\\n_|$)`),n=e.match(t);return n?(n[1].match(/^- /gm)||[]).length:0}c(p,"countSectionBullets");async function S(e,s,t){let n=D(t);if(!n)return{wrote:!1,content:null,summary:null,reason:"nothing-to-receipt"};try{return await h.remember(e,{type:"context",content:n,tags:{source:_,topic:k,capture:g,synthesis:"deterministic"},provenance:"extracted",projectId:s}),{wrote:!0,content:n,summary:I(n)}}catch(o){return{wrote:!1,content:n,summary:I(n),reason:`remember-failed: ${o.message}`}}}c(S,"persistJudgmentReceipt");async function b(e){let s=R(e.projectId,e.cycleId),t=O(e.projectId),n=j(e.projectId);return S(e.projectPath,e.projectId,{cycleDescription:e.cycleDescription,cycleId:e.cycleId,journal:s,trapsSurfaced:t,decisions:n,tokensIn:e.tokensIn,tokensOut:e.tokensOut,model:e.model,author:e.author,openRisksNext:e.cycleDescription?["Open cycle still needs finish or pause before context dies."]:[]})}c(b,"synthesizeJudgmentReceipt");function C(e){try{let s=Date.now()-864e5,n=l.query(e,`SELECT me.id, me.content
|
|
10
|
+
FROM memory_entries me
|
|
11
|
+
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
12
|
+
WHERE me.deleted_at IS NULL
|
|
13
|
+
AND me.created_at >= ?
|
|
14
|
+
AND t.key = 'capture' AND t.value = ?
|
|
15
|
+
ORDER BY me.created_at DESC
|
|
16
|
+
LIMIT 1`,s,g)[0];return n?{id:n.id,content:n.content,trapCount:p(n.content,"Traps re-surfaced")}:null}catch{return null}}c(C,"latestJudgmentReceipt24h");function T(e,s){try{let t=s??0;return l.get(e,`SELECT COUNT(*) AS c
|
|
17
|
+
FROM memory_entries me
|
|
18
|
+
JOIN memory_entry_tags t ON t.entry_id = me.id
|
|
19
|
+
WHERE me.deleted_at IS NULL
|
|
20
|
+
AND me.created_at >= ?
|
|
21
|
+
AND t.key = 'capture' AND t.value = ?`,t,g)?.c??0}catch{return 0}}c(T,"countReceiptsWritten");function O(e){try{return l.query(e,`SELECT id, type, content FROM memory_entries
|
|
22
|
+
WHERE deleted_at IS NULL
|
|
23
|
+
AND type IN ('gotcha', 'anti-pattern')
|
|
24
|
+
ORDER BY created_at DESC
|
|
25
|
+
LIMIT 5`).map(t=>({id:t.id,type:t.type,title:t.content.replace(/\s+/g," ").trim().slice(0,120)}))}catch{return[]}}c(O,"recentSurfacedTraps");function j(e){try{return l.query(e,`SELECT me.id, me.type, me.content, t.value AS action
|
|
26
|
+
FROM memory_entries me
|
|
27
|
+
JOIN memory_entry_tags t ON t.entry_id = me.id AND t.key = 'conflict_action'
|
|
28
|
+
WHERE me.deleted_at IS NULL
|
|
29
|
+
AND me.created_at >= ?
|
|
30
|
+
ORDER BY me.created_at DESC
|
|
31
|
+
LIMIT 8`,Date.now()-864e5).map(t=>({id:t.id,type:t.type,title:t.content.replace(/\s+/g," ").trim().slice(0,120),status:t.action==="deny"||t.action==="warn"?"contested":"honored"}))}catch{return[]}}c(j,"recentConflictDecisions");export{_ as a,k as b,g as c,D as d,I as e,S as f,b as g,C as h,T as i};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as c,b as w,c as y,d as x,f as h}from"./chunk-BUDZL4DW.mjs";import{a as i,c as d}from"./chunk-E66B27AL.mjs";var j,R,_,v=d(()=>{"use strict";j=new Set(["node_modules",".git","dist","build","out",".next",".nuxt","coverage",".cache",".turbo",".vercel",".parcel-cache","__pycache__",".pytest_cache","target","vendor",".venv","venv","eggs","*.egg-info",".prjct",".worktrees"]),R=["",".ts",".tsx",".js",".jsx","/index.ts","/index.js"],_=/(?:import|from)\s+['"]([^'"]+)['"]/g});import E from"node:fs/promises";async function S(r,t){let e=await E.readFile(r,"utf-8").catch(a=>{if(c(a))return null;throw a});if(e===null)return null;let n=(()=>{try{return JSON.parse(e)}catch{return null}})();if(n===null)return await F(r,e),k(r,"Malformed JSON"),null;let o=t.safeParse(n);return o.success?n:(await F(r,e),k(r,O(o.error)),null)}async function F(r,t){let e=`${r}.backup`;try{await E.writeFile(e,t,{encoding:"utf-8",flag:"wx"})}catch{}}function k(r,t){console.error(`[prjct] Warning: Corrupted storage file: ${r}`),console.error(`[prjct] Reason: ${t}`),console.error("[prjct] A .backup file has been created. Returning defaults.")}function O(r){return r.issues.slice(0,3).map(t=>`${t.path.join(".")}: ${t.message}`).join("; ")}var b=d(()=>{"use strict";h();i(S,"safeRead");i(F,"createBackup");i(k,"logCorruption");i(O,"formatZodError")});import s from"node:fs/promises";import m from"node:path";async function T(r,t,e){try{return await e()}catch(n){throw y(n)||w(n)?new Error(x(n,r,t)):n}}async function M(r,t={}){let e=[],n=t.maxFiles??1/0,o=t.dotfileAllowlist?new Set(t.dotfileAllowlist):null;async function a(l){if(e.length>=n)return;let u=await s.readdir(l,{withFileTypes:!0}).catch(()=>[]);for(let p of u){if(e.length>=n)break;let f=String(p.name);if(j.has(f)||t.skipDotfiles&&f.startsWith(".")&&(!o||!o.has(f)))continue;let g=m.join(l,f);p.isDirectory()?await a(g):p.isFile()&&e.push(m.relative(r,g))}}return i(a,"walk"),await a(r),e}async function Z(r,t,e){let n=[],o=Array.from({length:Math.ceil(r.length/t)},(a,l)=>l*t);for(let a of o){let l=await Promise.all(r.slice(a,a+t).map(e));for(let u of l)u!==null&&n.push(u)}return n}async function G(r,t=null,e){if(e)return await S(r,e)??t;try{let n=await s.readFile(r,"utf-8");return JSON.parse(n)}catch(n){if(c(n))return t;throw n}}async function K(r,t,e=2){await T(r,"config",async()=>{let n=m.dirname(r);await s.mkdir(n,{recursive:!0});let o=`${JSON.stringify(t,null,e)}
|
|
9
|
+
`;await s.writeFile(r,o,"utf-8")})}async function X(r,t=""){try{return await s.readFile(r,"utf-8")}catch(e){if(c(e))return t;throw e}}async function q(r){return s.readFile(r,"utf-8").then(t=>({content:t,exists:!0})).catch(t=>{if(c(t))return{content:"",exists:!1};throw t})}async function B(r,t){await T(r,"file",async()=>{let e=m.dirname(r);await s.mkdir(e,{recursive:!0}),await s.writeFile(r,t,"utf-8")})}async function H(r){try{return await s.access(r),!0}catch(t){if(c(t))return!1;throw t}}async function Q(r){try{return(await s.stat(r)).isDirectory()}catch(t){if(c(t))return!1;throw t}}async function U(r){await s.mkdir(r,{recursive:!0})}async function Y(r,t={}){try{return(await s.readdir(r,{withFileTypes:!0})).filter(o=>!t.filesOnly||o.isFile()).filter(o=>!t.dirsOnly||o.isDirectory()).filter(o=>!t.extension||o.name.endsWith(t.extension)).map(o=>o.name)}catch(e){if(c(e))return[];throw e}}var P=d(()=>{"use strict";v();b();h();i(T,"withWriteErrorContext");i(M,"walkDir");i(Z,"batchProcess");i(G,"readJson");i(K,"writeJson");i(X,"readFile");i(q,"readExistingFileOrEmpty");i(B,"writeFile");i(H,"fileExists");i(Q,"dirExists");i(U,"ensureDir");i(Y,"listFiles")});export{R as a,_ as b,v as c,M as d,Z as e,G as f,K as g,X as h,q as i,B as j,H as k,Q as l,U as m,Y as n,P as o};
|
|
@@ -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 U,c as W}from"./chunk-CE4RCNC7.mjs";import{
|
|
8
|
+
import{a as U,c as W}from"./chunk-CE4RCNC7.mjs";import{v as h,w as Y}from"./chunk-A6K4H3YT.mjs";import{d as D,f as B}from"./chunk-BUDZL4DW.mjs";import{a as r,b as g,c as l,d as M}from"./chunk-E66B27AL.mjs";import P from"node:crypto";function R(e){let t=e.toLowerCase().replace(/\s+/g," ").trim();return P.createHash("sha256").update(t).digest("hex")}var k=l(()=>{"use strict";r(R,"memoryFingerprint")});var C,f=l(()=>{"use strict";C=`
|
|
9
9
|
-- =======================================================================
|
|
10
10
|
-- Document storage (backward-compatible with JSON file pattern)
|
|
11
11
|
-- =======================================================================
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'module';
|
|
3
|
+
import { fileURLToPath as __fileURLToPath } from 'url';
|
|
4
|
+
import { dirname as __pathDirname } from 'path';
|
|
5
|
+
const require = __createRequire(import.meta.url);
|
|
6
|
+
const __filename = __fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __pathDirname(__filename);
|
|
8
|
+
import{a as l}from"./chunk-DYHYDHCW.mjs";import{a as x}from"./chunk-M5E2YOZ4.mjs";import{r as g,u as j}from"./chunk-A6K4H3YT.mjs";import{k as d,o as H}from"./chunk-UH4MD3F3.mjs";import{c as h}from"./chunk-FW4MEPTB.mjs";import{b as m,e as E}from"./chunk-GCDLPKOH.mjs";import{e as c,f as p}from"./chunk-BUDZL4DW.mjs";import{a as i}from"./chunk-E66B27AL.mjs";import w from"node:fs/promises";import P from"node:os";import y from"node:path";p();H();E();j();p();import C from"node:fs/promises";async function k(e){let{skillMdPath:t,skillExists:r,templateContent:a,build:s,logLabel:o}=e;try{let n=s(a);return r&&await C.readFile(t,"utf-8").catch(()=>"")===n.content?{success:!0,action:"unchanged",path:t}:(await C.writeFile(t,n.content,"utf-8"),{success:!0,action:r?"updated":"created",path:t})}catch(n){return l.warn(`${o} skill warning: ${c(n)}`),{success:!1,action:null}}}i(k,"writeSkillIfChanged");var L="prjct-codex-router",S=1024;function b(){return y.join(P.homedir(),".codex","skills","prjct","SKILL.md")}i(b,"getCodexSkillPath");function K(e){return`<!-- ${L}: ${JSON.stringify({v:m,h:e})} -->`}i(K,"getCodexSkillMetadata");function M(e){let t=e.match(new RegExp(`<!--\\s*${L}:\\s*(\\{[\\s\\S]*?\\})\\s*-->`));if(!t)return null;try{let r=JSON.parse(t[1]);return{version:r.v??r.version,templateHash:r.h??r.templateHash}}catch{return null}}i(M,"parseCodexSkillMetadata");function $(e){return x(e).slice(0,12)}i($,"hashContent");async function I(){return h("codex/SKILL.md")}i(I,"loadCodexSkillTemplate");function R(e){let t=e.trimEnd(),r=$(t),a=K(r);return{content:`${t}
|
|
9
|
+
|
|
10
|
+
${a}
|
|
11
|
+
`,templateHash:r}}i(R,"buildCodexSkillContent");async function D(){try{let e=b(),t=y.dirname(e);await w.mkdir(t,{recursive:!0});let r=await d(e),a=await I();return a?await k({skillMdPath:e,skillExists:r,templateContent:a,build:i(s=>{let o=R(s),n=Buffer.byteLength(o.content,"utf-8");return n>S&&l.warn(`Codex SKILL.md is ${n} bytes \u2014 over Codex's ~${S}-byte hard limit; the skill may be rejected. Trim editor-surfaces.ts.`),o},"build"),logLabel:"Codex"}):(l.warn("Codex SKILL.md template not found"),{success:!1,action:null})}catch(e){return l.warn(`Codex skill warning: ${c(e)}`),{success:!1,action:null}}}i(D,"installCodexSkill");async function U(e={}){let t=b();if(!(await g()).installed)return{installed:!1,verified:!0,skillPath:t,message:"Codex not detected"};let a=await I();if(!a)return{installed:!0,verified:!1,skillPath:t,message:"Codex SKILL.md template missing from prjct installation",fix:["Reinstall prjct-cli package","Run `prjct setup`"]};let s=R(a),o=i(async()=>e.autoRepair?(await D()).success:!1,"maybeRepair");if(!await d(t)&&!await o())return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill missing at ~/.codex/skills/prjct/SKILL.md",fix:["Run `prjct start` to install Codex skill"]};let n=i(async()=>{let u=await w.readFile(t,"utf-8").catch(()=>""),f=M(u);return{matches:f?.version===m&&f?.templateHash===s.templateHash}},"readVerification");if(!(await n()).matches){if(!await o())return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill metadata mismatch (outdated router)",fix:["Run `prjct start` or `prjct setup` to refresh Codex skill"]};if(!(await n()).matches)return{installed:!0,verified:!1,skillPath:t,templateHash:s.templateHash,message:"Codex skill could not be repaired automatically",fix:["Delete ~/.codex/skills/prjct/SKILL.md","Run `prjct setup`"]}}return{installed:!0,verified:!0,skillPath:t,templateHash:s.templateHash,message:"Codex p. router ready"}}i(U,"verifyCodexPRouterReady");export{S as a,R as b,D as c,U as d};
|
|
@@ -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 A}from"./chunk-
|
|
8
|
+
import{a as A}from"./chunk-S5ISOGDB.mjs";import{a as I,b as O,h as B}from"./chunk-UUULLTQV.mjs";import{a as D}from"./chunk-GAOQHD5S.mjs";import{a as T,b as W,e as u,g as k}from"./chunk-UHVYBU7F.mjs";import{c as S,d as v,e as N,f as w,g as M}from"./chunk-GCKILEXJ.mjs";import{a as h}from"./chunk-E66B27AL.mjs";k();W();B();var H=25,$=4,q=100,C=["supersedes","duplicates","superseded-by"];function L(r,e,t){let n=r.get(e);if(n!==void 0)return n;let i=t();return r.set(e,i),i}h(L,"getOrCreateMapValue");function U(r){try{let e=C.map(()=>"?").join(","),t=u.query(r,`SELECT t.entry_id, t.key, t.value
|
|
9
9
|
FROM memory_entry_tags t
|
|
10
10
|
JOIN memory_entries m ON m.id = t.entry_id
|
|
11
11
|
WHERE m.deleted_at IS NULL
|
|
@@ -21,16 +21,16 @@ import{a as A}from"./chunk-GAOQHD5S.mjs";import{a as O}from"./chunk-QK2IMCDC.mjs
|
|
|
21
21
|
WHERE project_id = ? AND type = ? AND deleted_at IS NULL AND content_hash != ?
|
|
22
22
|
AND (topic_key = ? OR id IN (
|
|
23
23
|
SELECT entry_id FROM memory_entry_tags WHERE key IN ('topic', 'key') AND value = ?
|
|
24
|
-
))`,Date.now(),r,e,t,n,n)}catch{}},async remember(r,e){let t={...e.tags??{}},n=e.provenance??"declared",i=
|
|
24
|
+
))`,Date.now(),r,e,t,n,n)}catch{}},async remember(r,e){let t={...e.tags??{}},n=e.provenance??"declared",i=T(e.content);{let c=await import("./trust-boundary-EX65SUYR.mjs").then(l=>l.evaluateMemoryContent).catch(()=>null);if(c){let l=c(e.content,{force:e.force});if(!l.allow){if(e.requireWrite)throw new Error(l.denyMessage);return}}}let{classifyCapturePrecision:o}=await import("./precision-classifier-IVVAXE26.mjs"),a=o(e.content,e.type,{force:e.force===!0});if(a.action==="refuse"){if(e.requireWrite)throw new Error(`precision refuse (${a.reasonCode}): ${a.reason}`);return}a.action==="demote"&&a.demoteTo&&(t.shape_demoted="true",t.original_type=e.type,t.precision_reason=a.reasonCode),e.force&&(t["precision:force"]="true");let m=a.action==="demote"&&a.demoteTo?a.demoteTo:e.type,d=e.projectId??await(async()=>{try{let{default:c}=await import("./config-manager-DX5OOPW5.mjs");return(await c.readConfig(r))?.projectId}catch{return}})();if(!t.file)try{let{inferMemoryFileTag:c}=await import("./infer-memory-file-PIAZ542H.mjs"),l=d?await(async()=>{try{let{stateStorage:E}=await import("./state-storage-XU35ZYNA.mjs"),p=(await E.getCurrentTask(d))?.likelyFiles;return Array.isArray(p)?p.map(f=>typeof f=="string"?f:f?.path).filter(f=>typeof f=="string"&&f.length>0):null}catch{return null}})():null,R=c({content:e.content,tags:t,projectPath:r,cycleFiles:l});R&&(t.file=R,t.file_source="inferred")}catch{}let y=t.topic??t.key;if(d){try{if(u.get(d,"SELECT id FROM memory_entries WHERE content_hash = ? AND type = ? AND deleted_at IS NULL LIMIT 1",i,m)){y&&this.applyTopicSupersession(d,m,i,y);return}}catch{}try{let{captureGate:c}=await import("./capture-gate-PS6QUXLX.mjs"),l=c(d,m,e.content,t);if(!l.accept){if(e.requireWrite)throw new Error(`capture refused: ${l.reason}`);return}}catch(c){if(e.requireWrite&&c instanceof Error&&c.message.startsWith("capture refused"))throw c}}let s=await A.log(r,`${I}${m}`,{content:e.content,tags:t,source:e.source,provenance:n,content_hash:i,...d?{project_id:d}:{}},void 0,d||e.requireWrite?{...d?{projectId:d}:{},required:e.requireWrite}:void 0),g=d??s?.projectId;if(g&&y&&s?.eventId!=null&&this.applyTopicSupersession(g,m,i,y),s?.projectId)try{let{usefulnessService:c}=await import("./usefulness-SZLG6LVC.mjs");c.recordReferences(s.projectId,e.content,t),c.recordCorrection(s.projectId,t)}catch{}if(g)try{let{publishCRUD:c}=await import("./publish-helper-SX7HEV2L.mjs"),l=t.spec_id??t.task_id??t.id??e.source??`mem-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;await c({projectId:g,entityType:"memories",entityId:l,eventType:"upsert",data:{id:l,type:m,content:e.content,tags:t,source:e.source??null,provenance:n,created_at:new Date().toISOString(),rememberedAt:new Date().toISOString()}})}catch{}},searchFts(r,e,t){if(e.length===0||t<=0)return[];let n=e.map(s=>D(s).replace(/[^a-z0-9-]/gi,"")).filter(s=>s.length>=2);if(n.length===0)return[];let i=n.map(s=>`"${s}"*`).join(" OR "),o=(()=>{try{return u.query(r,`SELECT m.id, m.content, m.type, m.provenance, m.created_at
|
|
25
25
|
FROM memory_entries_fts ft
|
|
26
26
|
JOIN memory_entries m ON m.rowid = ft.rowid
|
|
27
27
|
WHERE memory_entries_fts MATCH ?
|
|
28
28
|
AND m.deleted_at IS NULL
|
|
29
29
|
ORDER BY bm25(memory_entries_fts) ASC, m.created_at DESC
|
|
30
|
-
LIMIT ?`,i,t*2)}catch{return[]}})();if(o.length===0)return[];let a=b(r,o.map(s=>s.id)),m=o.map(s=>({id:s.id,type:s.type??"fact",content:s.content,tags:a.get(s.id)??{},rememberedAt:new Date(s.created_at).toISOString(),provenance:s.provenance??"declared"})),d=U(r);return(d.size>0?m.filter(s=>!d.has(s.id)):m).slice(0,t)},recall(r,e={}){let t=e.limit??H,n=Math.max(t*$,q),i=e.types&&e.types.length>0?new Set(e.types):null,o=i?i.has("shipped"):!0,a=i?[...i].some(p=>p!=="shipped"):!0,m=i?[...i].filter(p=>p!=="shipped"):void 0,d=a?x(r,n,m):[],y=o?u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",n):[],s=[...d,...y.map(S)],g=i?s.filter(p=>i.has(p.type)):s,c=e.tags?g.filter(p=>
|
|
30
|
+
LIMIT ?`,i,t*2)}catch{return[]}})();if(o.length===0)return[];let a=b(r,o.map(s=>s.id)),m=o.map(s=>({id:s.id,type:s.type??"fact",content:s.content,tags:a.get(s.id)??{},rememberedAt:new Date(s.created_at).toISOString(),provenance:s.provenance??"declared"})),d=U(r);return(d.size>0?m.filter(s=>!d.has(s.id)):m).slice(0,t)},recall(r,e={}){let t=e.limit??H,n=Math.max(t*$,q),i=e.types&&e.types.length>0?new Set(e.types):null,o=i?i.has("shipped"):!0,a=i?[...i].some(p=>p!=="shipped"):!0,m=i?[...i].filter(p=>p!=="shipped"):void 0,d=a?x(r,n,m):[],y=o?u.query(r,"SELECT id, name, type, shipped_at, data FROM shipped_features ORDER BY shipped_at DESC LIMIT ?",n):[],s=[...d,...y.map(S)],g=i?s.filter(p=>i.has(p.type)):s,c=e.tags?g.filter(p=>N(p,e.tags??{})):g,R=[...e.topic?c.filter(p=>v(p,e.topic)):c].sort((p,f)=>f.rememberedAt.localeCompare(p.rememberedAt)),E=e.dedupeByKey!==!1?w(R):R;return(()=>{if(e.pruneSuperseded===!1)return E;let p=M(E);return p.size>0?E.filter(f=>!p.has(f.id)):E})().slice(0,t)},recallForFile(r,e,t=3,n={}){if(!e)return[];let i=e.split("/").pop()??e,o=h(c=>c.type==="gotcha"||c.type==="red-herring"||c.type==="anti-pattern"||c.tags?.pattern==="recurring-bug","isPreventive"),a=Math.max(t*5,15),m=(()=>{try{return _(r,`AND file IS NOT NULL
|
|
31
31
|
AND (file = ? OR ? LIKE '%/' || file OR file = ? OR file LIKE '%/' || ?)
|
|
32
32
|
ORDER BY created_at DESC, rowid DESC
|
|
33
|
-
LIMIT ?`,e,e,i,i,a).filter(o)}catch{return[]}})(),d=n.preventiveOnly?[]:(()=>{try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT 200","context").filter(l=>(l.tags?.files??"").split(",").map(E=>E.trim()).some(E=>E===e||E===i||E.endsWith(`/${i}`)))}catch{return[]}})(),y=[...m,...d],s=M(y);return(s.size>0?y.filter(c=>!s.has(c.id)):y).slice(0,t)},getById(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return null;try{return _(r,"AND id = ?",`mem_${t[1]}`)[0]??null}catch{return null}},countByType(r,e){try{return u.get(r,"SELECT COUNT(*) AS n FROM memory_entries WHERE project_id IN (?, 'local') AND type = ? AND deleted_at IS NULL",r,e)?.n??0}catch{return 0}},recallByType(r,e,t){if(t<=0)return[];try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT ?",e,t)}catch{return[]}},forget(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return!1;let n=Number(t[1]),i=`mem_${n}`,o=(()=>{try{return u.get(r,"SELECT id FROM events WHERE id = ? AND type LIKE ?",n,`${
|
|
33
|
+
LIMIT ?`,e,e,i,i,a).filter(o)}catch{return[]}})(),d=n.preventiveOnly?[]:(()=>{try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT 200","context").filter(l=>(l.tags?.files??"").split(",").map(E=>E.trim()).some(E=>E===e||E===i||E.endsWith(`/${i}`)))}catch{return[]}})(),y=[...m,...d],s=M(y);return(s.size>0?y.filter(c=>!s.has(c.id)):y).slice(0,t)},getById(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return null;try{return _(r,"AND id = ?",`mem_${t[1]}`)[0]??null}catch{return null}},countByType(r,e){try{return u.get(r,"SELECT COUNT(*) AS n FROM memory_entries WHERE project_id IN (?, 'local') AND type = ? AND deleted_at IS NULL",r,e)?.n??0}catch{return 0}},recallByType(r,e,t){if(t<=0)return[];try{return _(r,"AND type = ? ORDER BY created_at DESC, rowid DESC LIMIT ?",e,t)}catch{return[]}},forget(r,e){let t=String(e).trim().match(/^(?:mem[_-])?(\d+)$/i);if(!t)return!1;let n=Number(t[1]),i=`mem_${n}`,o=(()=>{try{return u.get(r,"SELECT id FROM events WHERE id = ? AND type LIKE ?",n,`${O}%`)?(u.run(r,"DELETE FROM events WHERE id = ?",n),!0):!1}catch{return!1}})();try{u.run(r,"DELETE FROM memory_embeddings WHERE memory_id = ?",i)}catch{}let a=(()=>{try{return u.run(r,"UPDATE memory_entries SET deleted_at = ? WHERE id = ? AND deleted_at IS NULL",Date.now(),i).changes>0}catch{return!1}})();return o||a},expandWithLinks(r,e,t=5){if(e.length===0||t<=0)return[];let n=/\bmem[_-](\d+)\b/g,i=["resolves","relates","supersedes","superseded-by","duplicates","spec"],o=new Set(e.map(m=>m.id)),a=[];for(let m of e){if(a.length>=t)break;let d=new Set;for(let y of i){let s=m.tags?.[y];if(s)for(let g of String(s).matchAll(n))d.add(`mem_${g[1]}`)}for(let y of m.content.matchAll(n))d.add(`mem_${y[1]}`);for(let y of d){if(a.length>=t)break;if(o.has(y))continue;o.add(y);let s=Y.getById(r,y);s&&a.push(s)}}return a},unembeddedEntriesForIndex(r,e){try{let t=_(r,`AND type != ?
|
|
34
34
|
AND NOT EXISTS (
|
|
35
35
|
SELECT 1 FROM memory_embeddings me
|
|
36
36
|
WHERE me.memory_id = memory_entries.id AND me.model = ?
|
|
@@ -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 r,g as o}from"./chunk-
|
|
8
|
+
import{c as r,g as o}from"./chunk-GDESYWTD.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var s=8;function g(t,e,n=s){return o(r(t,e,n).files)}i(g,"rankLikelyFiles");function u(t,e){let n=r(t,e,s);return n.files.length===0?null:n.agentBlock||null}i(u,"buildIndexedFileCue");export{g as a,u 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{a as v}from"./chunk-
|
|
8
|
+
import{a as f}from"./chunk-Y5NQV46G.mjs";import{a as v}from"./chunk-V2FR2NPL.mjs";import{e as p,g as I}from"./chunk-UHVYBU7F.mjs";import{a as H,b as F}from"./chunk-WUHGODSQ.mjs";import{b as R,p as q}from"./chunk-QWQFF2UG.mjs";import{b as x}from"./chunk-GCKILEXJ.mjs";import{a as s}from"./chunk-E66B27AL.mjs";I();var U="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)??U);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");F();q();import X from"node:fs";import Q from"node:path";var D="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 R("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 k(){if(S.value!==void 0)return S.value;let r=process.env[D]?.trim();if(r)return S.value=r,r;let e=(ne()?await te():null)??ie();return S.value=e,e}s(k,"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 k(),{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",N=256,ae=800;function ce(r){return r.split("").reduce((n,t)=>Math.imul(n^t.charCodeAt(0),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 P(r){let e=new Float64Array(N),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%N,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(P,"embedLocal");function Oe(r){return P(r)}s(Oe,"embedLocalText");var L=class{static{s(this,"LocalSubwordEmbeddingProvider")}model=de;isLocal=!0;async embed(e){return e.map(n=>P(n))}};function O(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 L}s(O,"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 Ce(r,e){let n=E(r)*E(e);return n===0?0:T(r,e)/n}s(Ce,"cosineSimilarity");function E(r){let e=Array.from({length:r.length},(n,t)=>r[t]).reduce((n,t)=>n+t*t,0);return Math.sqrt(e)}s(E,"l2Norm");function T(r,e){let n=Math.min(r.length,e.length);return Array.from({length:n},(t,i)=>r[i]*e[i]).reduce((t,i)=>t+i,0)}s(T,"dot");var ge=2e3,fe=10,C=new Map,Pe={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??O(e),o=t.batchSize??64,a=await(async()=>{try{let{evaluateRetention:d}=await import("./retention-
|
|
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??O(e),o=t.batchSize??64,a=await(async()=>{try{let{evaluateRetention:d}=await import("./retention-C3NQT65W.mjs");return d(r,Date.now()).byId}catch{return null}})(),u=v.unembeddedEntriesForIndex(r,i.model).filter(d=>{if(!x(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(!x(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,B,K)=>{let A=c[K];return!A||A.length===0?y:(this.store(r,B.id,A,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=C.get(r)??0;return C.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??O(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
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:T(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{Oe as a,Ce as b,Pe 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{
|
|
8
|
+
import{m as _,n as z,v as M,w as J}from"./chunk-A6K4H3YT.mjs";import{f as y,g as m,m as C,o as F}from"./chunk-UH4MD3F3.mjs";import{b as o,p as $}from"./chunk-QWQFF2UG.mjs";import{a as e}from"./chunk-E66B27AL.mjs";J();F();import ot from"node:crypto";import b from"node:fs/promises";import R from"node:os";import H from"node:path";$();z();import{spawn as Y}from"node:child_process";var P="prjct-cli-auth",c="prjct-cloud",A="app.prjct.cli.auth",E="prjct-cli-auth",u={cached:void 0,testStore:null};function d(){return process.platform==="darwin"}e(d,"isDarwin");function h(){return process.platform==="linux"}e(h,"isLinux");function p(){return process.platform==="win32"}e(p,"isWindows");function B(r,t,a){return new Promise((n,i)=>{let s=Y(r,t,{stdio:["pipe","pipe","pipe"]}),f=[],U=[];s.stdout.setEncoding("utf8"),s.stderr.setEncoding("utf8"),s.stdout.on("data",l=>{f.push(String(l))}),s.stderr.on("data",l=>{U.push(String(l))}),s.on("error",i),s.on("close",l=>{if(l===0){n(f.join(""));return}i(new Error(U.join("").trim()||`${r} exited with code ${l}`))}),s.stdin.end(a)})}e(B,"runWithStdin");async function K(){try{let{stdout:r}=await o("security",["find-generic-password","-a",c,"-s",P,"-w"]);return r.trim()||null}catch{return null}}e(K,"readMacosKeychain");async function q(r){await o("security",["add-generic-password","-U","-a",c,"-s",P,"-w",r])}e(q,"writeMacosKeychain");async function V(){try{await o("security",["delete-generic-password","-a",c,"-s",P])}catch{}}e(V,"clearMacosKeychain");async function W(){try{let{stdout:r}=await o("secret-tool",["lookup","service",A,"account",c]);return r.trim()||null}catch{return null}}e(W,"readLinuxSecretService");async function X(r){await B("secret-tool",["store","--label","prjct Cloud token","service",A,"account",c],r)}e(X,"writeLinuxSecretService");async function Z(){try{await o("secret-tool",["clear","service",A,"account",c])}catch{}}e(Z,"clearLinuxSecretService");var w=`
|
|
9
9
|
using System;
|
|
10
10
|
using System.Runtime.InteropServices;
|
|
11
11
|
using System.Text;
|
|
@@ -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{
|
|
8
|
+
import{k as c,l as r,o as d}from"./chunk-UH4MD3F3.mjs";import{a as u}from"./chunk-E66B27AL.mjs";d();import p from"node:fs/promises";import l from"node:os";import n from"node:path";var k=[{value:"web-app",title:"Web Application",description:"React, Vue, Angular, Next.js, etc."},{value:"api-backend",title:"API / Backend Service",description:"Express, Hono, FastAPI, etc."},{value:"fullstack",title:"Full-Stack (Monorepo)",description:"Frontend + Backend in one repo"},{value:"cli-tool",title:"CLI Tool",description:"Command-line application"},{value:"library",title:"Library / Package",description:"Reusable npm/pip/cargo package"},{value:"monorepo",title:"Monorepo (Multiple Projects)",description:"Turborepo, Nx, Lerna, etc."}],h=[{value:"claude",title:"Claude Code",description:"Anthropic's Claude in VS Code/CLI"},{value:"cursor",title:"Cursor",description:"AI-first code editor"},{value:"copilot",title:"GitHub Copilot",description:"GitHub's AI pair programmer"},{value:"gemini",title:"Gemini CLI",description:"Google's Gemini in terminal"},{value:"codex",title:"OpenAI Codex",description:"OpenAI's coding agent in terminal"},{value:"opencode",title:"OpenCode",description:"Open-source terminal coding agent"},{value:"pi",title:"Pi",description:"Minimal terminal coding harness (skills + AGENTS.md)"},{value:"qwen-code",title:"Qwen Code",description:"Qwen-family coding runtime"},{value:"goose",title:"Goose",description:"Open-source coding agent with extensions"},{value:"aider",title:"Aider",description:"Terminal pair-programming agent"},{value:"cline",title:"Cline",description:"VS Code coding agent"},{value:"roo-code",title:"Roo Code",description:"VS Code coding agent with MCP"},{value:"continue",title:"Continue",description:"IDE assistant with MCP config"},{value:"kiro",title:"Kiro",description:"Agentic IDE with steering docs"},{value:"zed",title:"Zed",description:"Editor agent with ACP support"}];async function y(t){try{let e=await p.readdir(t);if(e.includes("turbo.json")||e.includes("lerna.json")||e.includes("nx.json"))return"monorepo";if(e.includes("package.json")){let a=n.join(t,"package.json"),s=JSON.parse(await p.readFile(a,"utf-8")),i={...s.dependencies,...s.devDependencies};if(s.bin)return"cli-tool";if(s.main&&!i.react&&!i.vue&&!i.angular&&!i.express&&!i.hono)return"library";if((i.react||i.vue)&&(i.express||i.hono||i.fastify))return"fullstack";if(i.react||i.vue||i["@angular/core"]||i.next||i.nuxt)return"web-app";if(i.express||i.hono||i.fastify||i.koa||i.nestjs)return"api-backend"}return e.includes("pyproject.toml")||e.includes("setup.py")?e.some(s=>["main.py","app.py","server.py"].includes(s))?"api-backend":"library":e.includes("go.mod")?e.includes("main.go")?"cli-tool":"library":e.includes("Cargo.toml")?"cli-tool":"unknown"}catch{return"unknown"}}u(y,"detectProjectType");async function v(t){let e=[];await r(n.join(l.homedir(),".claude"))&&e.push("claude"),await c(n.join(t,".cursorrules"))&&e.push("cursor"),await c(n.join(t,".github","copilot-instructions.md"))&&e.push("copilot"),await r(n.join(l.homedir(),".gemini"))&&e.push("gemini"),await r(n.join(l.homedir(),".gemini","antigravity"))&&e.push("antigravity"),await r(n.join(t,".opencode"))&&e.push("opencode"),(await r(n.join(t,".pi"))||await r(n.join(l.homedir(),".pi")))&&e.push("pi"),await r(n.join(t,".qwen"))&&e.push("qwen-code"),await r(n.join(t,".goose"))&&e.push("goose"),(await c(n.join(t,".aider.conf.yml"))||await c(n.join(t,".aider.conf.yaml")))&&e.push("aider"),(await r(n.join(t,".cline"))||await r(n.join(t,".clinerules"))||await c(n.join(t,".clinerules")))&&e.push("cline"),await r(n.join(t,".roo"))&&e.push("roo-code"),await r(n.join(t,".continue"))&&e.push("continue"),await r(n.join(t,".kiro"))&&e.push("kiro"),await r(n.join(t,".zed"))&&e.push("zed");try{let{execAsync:a}=await import("./exec-2P5VOBHM.mjs");await a("which codex"),e.push("codex")}catch{await r(n.join(l.homedir(),".codex"))&&e.push("codex")}return e}u(v,"detectInstalledAgents");async function x(t){let e={language:"Unknown",technologies:[]};try{let a=await p.readdir(t);if(a.includes("package.json")){let s=n.join(t,"package.json"),i=JSON.parse(await p.readFile(s,"utf-8")),o={...i.dependencies,...i.devDependencies};e.language=o.typescript?"TypeScript":"JavaScript",o.next?e.framework="Next.js":o.nuxt?e.framework="Nuxt":o.react?e.framework="React":o.vue?e.framework="Vue":o["@angular/core"]?e.framework="Angular":o.express?e.framework="Express":o.hono?e.framework="Hono":o.fastify?e.framework="Fastify":(o.nestjs||o["@nestjs/core"])&&(e.framework="NestJS"),o.bun||o["@types/bun"]||i.engines?.bun?e.runtime="Bun":e.runtime="Node.js",a.includes("bun.lockb")?e.packageManager="Bun":a.includes("pnpm-lock.yaml")?e.packageManager="pnpm":a.includes("yarn.lock")?e.packageManager="Yarn":a.includes("package-lock.json")&&(e.packageManager="npm"),(o.prisma||o["@prisma/client"])&&e.technologies.push("Prisma"),(o.drizzle||o["drizzle-orm"])&&e.technologies.push("Drizzle"),o.tailwindcss&&e.technologies.push("Tailwind CSS"),o.zod&&e.technologies.push("Zod"),(o.trpc||o["@trpc/server"])&&e.technologies.push("tRPC")}else a.includes("pyproject.toml")||a.includes("requirements.txt")?e.language="Python":a.includes("go.mod")?e.language="Go":a.includes("Cargo.toml")?e.language="Rust":(a.includes("pom.xml")||a.includes("build.gradle"))&&(e.language="Java");return e}catch{return e}}u(x,"detectStack");export{k as a,h as b,y as c,v as d,x as e};
|
|
@@ -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 h}from"./chunk-GVNMXVVA.mjs";import{b as k}from"./chunk-
|
|
8
|
+
import{a as h}from"./chunk-GVNMXVVA.mjs";import{b as k}from"./chunk-4KVPAHFV.mjs";import{a as i}from"./chunk-E66B27AL.mjs";var _=[{name:"sk-\u2026 token",re:/\bsk-[A-Za-z0-9_-]{16,}/},{name:"prjct live token",re:/\bprjct_sk_(?:live|test)_[A-Za-z0-9_-]{8,}/},{name:"GitHub PAT",re:/\bghp_[A-Za-z0-9]{30,}/},{name:"GitHub server PAT",re:/\bghs_[A-Za-z0-9]{30,}/},{name:"GitHub fine-grained PAT",re:/\bgithub_pat_[A-Za-z0-9_]{20,}/},{name:"AWS access key",re:/\bAKIA[0-9A-Z]{16}\b/},{name:"Slack token",re:/\bxox[abps]-[A-Za-z0-9-]{10,}/},{name:"Supabase access token",re:/\bsbp_[A-Za-z0-9]{20,}/},{name:"OpenAI project key",re:/\bsk-proj-[A-Za-z0-9_-]{20,}/},{name:"bearer JWT-ish",re:/\beyJ[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\.[A-Za-z0-9_-]{20,}\b/},{name:"PEM private key",re:/-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----/}];function p(n){if(!n)return[];let o=[];for(let{name:e,re:s}of _)s.test(n)&&o.push(e);return o}i(p,"scanForSecrets");function A(n,o=2e5){let e=Math.max(0,o),s=Math.ceil(e/2),r=Math.floor(e/2),t={head:"",tail:"",full:"",totalChars:0,hasPart:!1},c=i(a=>{if(!a||e===0)return;let l=`${t.hasPart?`
|
|
9
9
|
`:""}${a}`;t.hasPart=!0,t.totalChars+=l.length,t.full!==null&&(t.totalChars<=e?t.full+=l:t.full=null),t.head.length<s&&(t.head+=l.slice(0,s-t.head.length)),r>0&&(t.tail=l.length>=r?l.slice(-r):`${t.tail}${l}`.slice(-r))},"push"),u=i((a,l)=>{if(!(l>8)){if(typeof a=="string"){c(a);return}if(Array.isArray(a)){for(let f of a)u(f,l+1);return}if(a&&typeof a=="object")for(let[f,d]of Object.entries(a))/token|secret|password|api[_-]?key|authorization/i.test(f)&&typeof d=="string"?c(`${f}=${d}`):u(d,l+1)}},"walk");return u(n,0),t.full!==null?t.full:t.totalChars>e?`${t.head}
|
|
10
10
|
${t.tail}`:t.head}i(A,"flattenToolInputText");var m=64*1024,T=512;function y(n,o){if(!n)return;if(n.length<=2e5){for(let r of p(A(n)))o.add(r);return}let e=m-T,s=Array.from({length:Math.ceil(n.length/e)},(r,t)=>t*e);for(let r of s){let t=Math.min(n.length,r+m);for(let c of p(n.slice(r,t)))o.add(c);if(t===n.length)break}}i(y,"addSecretHits");function b(n,o){let e=[n],s=new WeakSet;for(;e.length>0;){let r=e.pop();if(typeof r=="string"){y(r,o);continue}if(!r||typeof r!="object"||s.has(r))continue;if(s.add(r),Array.isArray(r)){for(let c of[...r].reverse())e.push(c);continue}let t=Object.entries(r);for(let[c,u]of t.reverse())/token|secret|password|api[_-]?key|authorization/i.test(c)&&typeof u=="string"?e.push(`${c}=${u}`):e.push(u)}}i(b,"scanUnknownStrings");function w(n){if(n==null)return[];let o=n,e=o.tool_input??o.toolInput??o.parameters??n,s=new Set;b(e,s);for(let r of[o.command,o.prompt,o.content])typeof r=="string"&&y(r,s);return[...s]}i(w,"scanHookToolInput");var g={allow:!0};function x(n,o={}){let e=n??"";if(!e.trim())return{allow:!1,kind:"memory_content",reason:"empty content",hits:[],denyMessage:"refusing empty memory content"};if(o.force)return g;let s=p(e);if(s.length>0){let t=s.join(", ");return{allow:!1,kind:"secrets",reason:"secret-like content",hits:s,denyMessage:`refusing to store memory that looks like a secret (${t}). Re-run with --force if intentional.`}}let r=h(e);if(r.length>0){let t=r.join(", ");return{allow:!1,kind:"prompt_injection",reason:"prompt-injection-like content",hits:r,denyMessage:`refusing to store memory that looks like prompt injection (${t}). Entries are inlined into LLM context \u2014 re-run with --force if intentional.`}}return g}i(x,"evaluateMemoryContent");function $(n){let o=w(n);if(o.length===0)return g;let e=o.join(", ");return{allow:!1,kind:"secrets",reason:"secret pattern in tool input",hits:o,denyMessage:`\u26D4 prjct credential guard: tool input matches secret pattern(s): ${e}. Refusing to run this tool so credentials are not exposed. Remove the secret from the command/content and retry. (This MUST runs on every host \u2014 no PPID / host-env dependency.)`}}i($,"evaluateToolInputSecrets");function M(n,o){let e=k(n,o);return!e.risky||!e.message?{allow:!0,decision:e}:{allow:!1,kind:"package_install",reason:"unknown new packages",hits:e.newPackages,denyMessage:`\u26D4 ${e.message}
|
|
11
11
|
Install denied (strict pack). Verify packages before adding them.`,decision:e}}i(M,"evaluatePackageInstallTrust");function E(n,o){if(n==="imported"){let e=o?.trim()||"workflow rule";return{allow:!1,kind:"workflow_rule",reason:"imported trust_source",hits:["imported"],denyMessage:`Refusing to run imported rule without approval: ${e}. Re-create the rule locally if you trust it.`}}return g}i(E,"evaluateWorkflowRuleExecutable");function Z(n){return n==="imported"}i(Z,"isImportedWorkflowTrust");export{x as a,$ as b,M as c,E as d,Z as e};
|