const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./IyCQvDUH2.js","./X_DUeLZp2.js","./DsQIgu-4.js","./DrKWWDpL.js","./DmLgVuva2.js","./C0bVU7gr2.js","./Ouh6Dj2I2.js","./Dn7LRnjg2.js","./DsanjglN.js","./CbGRcr-D.js","./bG-fsHMS.js","./DTkg6Mnx.js","./DYP3EJMY.js","./DeO5NWhN.js","./DgZn9uJn.js","./CudpqN6Z.js","./CX8DOZuw2.js","./DOqzs8kl2.js","./DIQmuJJZ.js","./D7w7HllH.js","./DB5ifLM-.js","./CxlOpib82.js","./Czb-RtcG.js","./C0nwgWmB.js","./D-eE9s2f.js","./CWxOfblT.js","./DlZwu-Y7.js","./CvFbqtf9.js","./-TjUTcZv2.js","./Y-eU8Aa32.js","./Dg_1c8FK2.js","./CG84LPq-.js","./2PQNgpBd.js","./BmWTAsFW.js","./B5XQZRTz.js","./CVwAhlPZ.js","./BVC3q6GM.js","./B8PRMiR2.js","./BDDiPmhF.js","./BYJC6_MM.js","./Cx_-1PHK2.js","./B_DA9RKE2.js","./DOPTvi6T.js","./CvaH7m0y.js","./O2P-f9sv.js","./BQ9wXJVQ2.js","./OnYyYdSr2.js","./ImGf_A8f.js","./DHbhVvym2.js"])))=>i.map(i=>d[i]);
import{n as e,t}from"./DsQIgu-4.js";e();async function n(e,n,r){let i={recentDecisions:[],relevantPatterns:[],recentObservations:[],recentLearnings:[],tokensEstimated:0},a;try{a=(await t(()=>import(`./IyCQvDUH2.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48]),import.meta.url)).searchBrainCompact}catch{return i}let o=r?.limit??5,s=n?.rootTaskId??n?.epicId??``;try{let[t,n,r,i]=await Promise.all([s?a(e,{query:s,limit:o,tables:[`decisions`]}):Promise.resolve({results:[],total:0,tokensEstimated:0}),a(e,{query:s||`pattern`,limit:Math.min(o,3),tables:[`patterns`],mode:`hybrid`,since:new Date(Date.now()-720*60*60*1e3).toISOString()}),a(e,{query:s||`session`,limit:o,tables:[`observations`],mode:`recency`}),a(e,{query:s||`learning`,limit:Math.min(o,5),tables:[`learnings`],mode:`recency`})]),c=t.tokensEstimated+n.tokensEstimated+r.tokensEstimated+i.tokensEstimated;return{recentDecisions:t.results,relevantPatterns:n.results,recentObservations:r.results,recentLearnings:i.results,tokensEstimated:c}}catch{return i}}export{n as getSessionMemoryContext};