a2a-memory 0.12.62 → 0.12.63
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/README.md +1 -1
- package/dist/adapters/anthropic.js +1 -1
- package/dist/chunking/chunker.js +1 -1
- package/dist/claude/sync.js +1 -1
- package/dist/cli/commands/add.js +1 -1
- package/dist/cli/commands/claude-sync.js +1 -1
- package/dist/cli/commands/cleanup.js +1 -1
- package/dist/cli/commands/config.js +1 -1
- package/dist/cli/commands/contextrank.js +1 -1
- package/dist/cli/commands/edit.js +1 -1
- package/dist/cli/commands/embed.js +1 -1
- package/dist/cli/commands/export.js +1 -1
- package/dist/cli/commands/extract.js +1 -1
- package/dist/cli/commands/health.js +1 -1
- package/dist/cli/commands/list.js +1 -1
- package/dist/cli/commands/migrate-chunks.js +1 -1
- package/dist/cli/commands/migrate-file-refs.js +1 -1
- package/dist/cli/commands/proficiency.js +1 -1
- package/dist/cli/commands/review.js +1 -1
- package/dist/cli/commands/rm.js +1 -1
- package/dist/cli/commands/search.js +1 -1
- package/dist/cli/commands/session-extract.js +1 -1
- package/dist/cli/commands/setup-wizard.js +1 -1
- package/dist/cli/commands/setup.js +1 -1
- package/dist/cli/commands/skill.js +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/sync.js +1 -1
- package/dist/cli/commands/team.js +1 -1
- package/dist/cli/commands/usage.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/config/manager.js +1 -1
- package/dist/contextrank/ac-matcher.js +1 -1
- package/dist/contextrank/edge-builder.js +1 -1
- package/dist/contextrank/rank-builder.js +1 -1
- package/dist/contextrank/signal-builder.js +1 -1
- package/dist/contextrank/since-store.js +1 -1
- package/dist/db/database.d.ts +55 -1
- package/dist/db/database.js +1 -1
- package/dist/db/integrity-marker.d.ts +40 -0
- package/dist/db/integrity-marker.js +1 -0
- package/dist/db/usage-spool.js +1 -1
- package/dist/embedding/e5-provider.js +1 -1
- package/dist/embedding/index.js +1 -1
- package/dist/embedding/local-provider.js +1 -1
- package/dist/embedding/openai-provider.js +1 -1
- package/dist/embedding/quantization.js +1 -1
- package/dist/extraction/dedup-manager.js +1 -1
- package/dist/extraction/emotion-filter.js +1 -1
- package/dist/extraction/extractor.js +1 -1
- package/dist/extraction/file-reference.js +1 -1
- package/dist/extraction/filter.js +1 -1
- package/dist/extraction/scorer.js +1 -1
- package/dist/extraction/similarity.js +1 -1
- package/dist/hooks/client-factory.js +1 -1
- package/dist/hooks/post-tool-use.js +1 -1
- package/dist/hooks/pre-compact.js +1 -1
- package/dist/hooks/session-end.js +1 -1
- package/dist/hooks/session-start.js +1 -1
- package/dist/hooks/shared.js +1 -1
- package/dist/hooks/stop.js +1 -1
- package/dist/hooks/user-prompt-submit.js +1 -1
- package/dist/i18n/index.js +1 -1
- package/dist/i18n/messages.js +1 -1
- package/dist/index.js +1 -1
- package/dist/lifecycle/cleanup-scheduler.js +1 -1
- package/dist/lifecycle/cleanup.js +1 -1
- package/dist/lifecycle/consolidation.js +1 -1
- package/dist/lifecycle/contradiction.js +1 -1
- package/dist/lifecycle/embedding-backfill.js +1 -1
- package/dist/lifecycle/index.js +1 -1
- package/dist/lifecycle/injection-flush.js +1 -1
- package/dist/lifecycle/quality-scorer.js +1 -1
- package/dist/lifecycle/session-extract.js +1 -1
- package/dist/lifecycle/shadow-rebuild.js +1 -1
- package/dist/lifecycle/tiering.js +1 -1
- package/dist/llm/client.js +1 -1
- package/dist/llm/index.js +1 -1
- package/dist/proficiency/actr-engine.js +1 -1
- package/dist/proficiency/detection.js +1 -1
- package/dist/proficiency/index.js +1 -1
- package/dist/proficiency/tracker.js +1 -1
- package/dist/search/adaptive-router.js +1 -1
- package/dist/search/index.js +1 -1
- package/dist/search/injection-filter.js +1 -1
- package/dist/search/memoryrank-rerank.js +1 -1
- package/dist/search/ranker.js +1 -1
- package/dist/search/reranker.js +1 -1
- package/dist/session/parser.js +1 -1
- package/dist/skill/evaluator.js +1 -1
- package/dist/skill/index.js +1 -1
- package/dist/sync/client.js +1 -1
- package/dist/sync/encryption.js +1 -1
- package/dist/sync/index.js +1 -1
- package/dist/sync/queue.js +1 -1
- package/dist/sync/scheduler.js +1 -1
- package/dist/sync/synchronizer.js +1 -1
- package/dist/sync/team-synchronizer.js +1 -1
- package/dist/sync/vector-clock.js +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/file-mode.d.ts +5 -0
- package/dist/utils/file-mode.js +1 -1
- package/dist/utils/keychain.js +1 -1
- package/dist/utils/logger.js +1 -1
- package/dist/utils/test-isolation.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3f30c0,_0xe42208){function _0x2d78b7(_0x301eb2,_0x2100b6){return _0x4855(_0x301eb2-0x12c,_0x2100b6);}function _0x38a2c7(_0x3b1b61,_0x11d93f){return _0x4855(_0x11d93f- -0x81,_0x3b1b61);}const _0x1d12de=_0x3f30c0();while(!![]){try{const _0x6204c5=parseInt(_0x38a2c7(0x3e,0x4d))/0x1+-parseInt(_0x2d78b7(0x1fc,0x1ed))/0x2*(parseInt(_0x2d78b7(0x1e2,0x1cd))/0x3)+parseInt(_0x2d78b7(0x1e9,0x1e6))/0x4*(-parseInt(_0x2d78b7(0x1f8,0x1e5))/0x5)+parseInt(_0x38a2c7(0x4a,0x41))/0x6*(parseInt(_0x38a2c7(0x76,0x61))/0x7)+-parseInt(_0x2d78b7(0x1f5,0x1ee))/0x8+-parseInt(_0x38a2c7(0x54,0x45))/0x9*(parseInt(_0x38a2c7(0x69,0x5b))/0xa)+-parseInt(_0x38a2c7(0x3e,0x36))/0xb*(-parseInt(_0x38a2c7(0x26,0x34))/0xc);if(_0x6204c5===_0xe42208)break;else _0x1d12de['push'](_0x1d12de['shift']());}catch(_0x13464b){_0x1d12de['push'](_0x1d12de['shift']());}}}(_0x2bfb,0x29880));function _0x2bfb(){const _0x1d0619=['zhn0','BM93txm','z2v0rwrNzxm','DMfSDwvZ','DxbKyxrLu2LNBG','mZv5ugrlv1K','z2v0','wwjUuw8','mtjyzw9KCwm','mtG2mJu4DKvhq3fM','mJKWnJu1mKnNthbMuq','zgvJyxK','C29YDa','Bg9N','AgfZ','CgfYC2u','ngnju0vsyW','CMvKDwnL','ChvZAa','BgvUz3rO','BM93','mJqYmZGYCLDjvLHW','zhvWvgf1','B3jL','CgfYzw50','mtKYmdq3neXsquLttG','ywXZ','Aw5JBhvKzxm','mtu1otyWmentwe9MCG','CxvHBgL0Ev9ZyW','C3jJ','mteWntG1wwDeCLrW','vLfRzNK','mtK2ndm0reXcDwPN','D2vPz2H0','mNDNu0Ppza','rgn2yw4','z2v0u2LNBMfSsq','ywnJzxnZx2nVDq','y3jLyxrLzf9HDa','C2LT','BwfW','Dg9ju09tDhjPBG','C2v0','zMLSDgvY','zMLUza','BNb1DfjVD3m','mtb2DLDTzKq'];_0x2bfb=function(){return _0x1d0619;};return _0x2bfb();}export const ACTR_DECAY=0.5;function _0x23c050(_0x1dcc6c,_0x4a87e7){return _0x4855(_0x4a87e7- -0x128,_0x1dcc6c);}export const DUP_TAU=0.98;export function parseTs(_0x5a2756){if(!_0x5a2756)return null;const _0x33186c=_0x5a2756[_0x1c795d(0x22b,0x215)]('T')?_0x5a2756:_0x5a2756['replace']('\x20','T')+'Z';function _0x3e3658(_0x58a419,_0x399e81){return _0x4855(_0x399e81- -0x264,_0x58a419);}const _0xd74241=Date[_0x3e3658(-0x1b9,-0x1a8)](_0x33186c);function _0x1c795d(_0x168e1a,_0x36d8d4){return _0x4855(_0x36d8d4-0x14d,_0x168e1a);}return Number['isNaN'](_0xd74241)?null:_0xd74241;}export function rankNorm(_0x58fab8){const _0x2e53ab=_0x58fab8[_0x4f0239(-0x1b1,-0x1b2)];function _0x4f0239(_0x172f99,_0x3168e8){return _0x4855(_0x3168e8- -0x272,_0x172f99);}if(_0x2e53ab===0x0)return[];if(_0x2e53ab===0x1)return[0.5];const _0x358353=_0x58fab8[_0x623c2d(0x377,0x363)]((_0x332c74,_0x2da27a)=>({'v':_0x332c74,'i':_0x2da27a}))[_0x623c2d(0x355,0x346)]((_0x1e104b,_0x1639d3)=>_0x1e104b['v']-_0x1639d3['v']),_0x58eccf=new Array(_0x2e53ab);function _0x623c2d(_0x1185ec,_0x382918){return _0x4855(_0x382918-0x28d,_0x1185ec);}let _0x3761d5=0x0;while(_0x3761d5<_0x2e53ab){let _0x661fa4=_0x3761d5;while(_0x661fa4+0x1<_0x2e53ab&&_0x358353[_0x661fa4+0x1]['v']===_0x358353[_0x3761d5]['v'])_0x661fa4++;const _0x4f3c2a=(_0x3761d5+_0x661fa4)/0x2,_0x512d0b=_0x4f3c2a/(_0x2e53ab-0x1);for(let _0xd1fe38=_0x3761d5;_0xd1fe38<=_0x661fa4;_0xd1fe38++)_0x58eccf[_0x358353[_0xd1fe38]['i']]=_0x512d0b;_0x3761d5=_0x661fa4+0x1;}return _0x58eccf;}function _0x4855(_0x2aeef6,_0x471a98){_0x2aeef6=_0x2aeef6-0xb4;const _0x2bfb80=_0x2bfb();let _0x485545=_0x2bfb80[_0x2aeef6];if(_0x4855['ZWNNDU']===undefined){var _0x18ead9=function(_0x1ace0f){const _0x3ac4f0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x15c88b='',_0x351e56='';for(let _0x44aa1f=0x0,_0x321bf7,_0x25e0ec,_0x3259a1=0x0;_0x25e0ec=_0x1ace0f['charAt'](_0x3259a1++);~_0x25e0ec&&(_0x321bf7=_0x44aa1f%0x4?_0x321bf7*0x40+_0x25e0ec:_0x25e0ec,_0x44aa1f++%0x4)?_0x15c88b+=String['fromCharCode'](0xff&_0x321bf7>>(-0x2*_0x44aa1f&0x6)):0x0){_0x25e0ec=_0x3ac4f0['indexOf'](_0x25e0ec);}for(let _0x1af7f8=0x0,_0x497ca8=_0x15c88b['length'];_0x1af7f8<_0x497ca8;_0x1af7f8++){_0x351e56+='%'+('00'+_0x15c88b['charCodeAt'](_0x1af7f8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x351e56);};_0x4855['ZTdxFF']=_0x18ead9,_0x4855['tmhtkT']={},_0x4855['ZWNNDU']=!![];}const _0x1e7763=_0x2bfb80[0x0],_0x410942=_0x2aeef6+_0x1e7763,_0x42aa24=_0x4855['tmhtkT'][_0x410942];return!_0x42aa24?(_0x485545=_0x4855['ZTdxFF'](_0x485545),_0x4855['tmhtkT'][_0x410942]=_0x485545):_0x485545=_0x42aa24,_0x485545;}function _0x1b3641(_0x5db050,_0x5a4b40){return _0x4855(_0x5db050-0x29a,_0x5a4b40);}class UnionFind{[_0x1b3641(0x35f,0x36f)]=new Map();[_0x23c050(-0x3f,-0x4e)](_0xa36ab0){const _0x184608=this['parent']['get'](_0xa36ab0);if(_0x184608===undefined||_0x184608===_0xa36ab0)return this[_0x10ed1d(-0x256,-0x24d)][_0x10ed1d(-0x24f,-0x23a)](_0xa36ab0,_0xa36ab0),_0xa36ab0;function _0x10ed1d(_0x183edc,_0x4668d8){return _0x23c050(_0x183edc,_0x4668d8- -0x1ea);}const _0xcb6b15=this['find'](_0x184608);this[_0x1f5586(0x38d,0x3a1)]['set'](_0xa36ab0,_0xcb6b15);function _0x1f5586(_0x495be4,_0xba58be){return _0x23c050(_0xba58be,_0x495be4-0x3f0);}return _0xcb6b15;}['union'](_0x4676a0,_0x44cc90){function _0x129443(_0x37ee64,_0x5996d){return _0x1b3641(_0x37ee64- -0x5b4,_0x5996d);}const _0x42b0c8=this[_0x129443(-0x240,-0x228)](_0x4676a0),_0x52e950=this[_0x43ca8f(0x15e,0x15e)](_0x44cc90);function _0x43ca8f(_0x2b0783,_0x14bac9){return _0x1b3641(_0x2b0783- -0x216,_0x14bac9);}if(_0x42b0c8!==_0x52e950)this['parent'][_0x129443(-0x242,-0x234)](_0x42b0c8,_0x52e950);}}export function computeSignals(_0x1ded48,_0x38100c){const _0x2af528=_0x38100c?.[_0x1a0eab(0x167,0x169)]??0x0,_0xc4d332=_0x38100c?.['nowMs']??Date[_0xbdc84d(0x64,0x6f)](),_0x1578ea=_0x38100c?.[_0xbdc84d(0x5b,0x6d)]??ACTR_DECAY,_0x54ecf8=_0x38100c?.[_0x1a0eab(0x154,0x14e)]??DUP_TAU,_0x548992=_0x1ded48[_0x1a0eab(0x171,0x15d)+_0x1a0eab(0x173,0x166)](),_0x4c5433=_0x548992[_0x1a0eab(0x135,0x14b)],_0x363654=_0x548992['map'](_0x93c6b6=>_0x93c6b6['id']),_0x44c50b=new Set(_0x363654);let _0x1fe821=0x0;const _0x55a719=_0x548992[_0xbdc84d(0x79,0x65)](_0x2b5edd=>{const _0x3f5603=parseTs(_0x2b5edd[_0x271be2(0x366,0x366)])??_0xc4d332,_0x42494b=Math['max']((_0xc4d332-_0x3f5603)/0x5265c00,0x1/0x18);function _0xda3912(_0x50abb7,_0x466746){return _0xbdc84d(_0x466746-0x82,_0x50abb7);}function _0x271be2(_0x29fb1c,_0x3c3bb7){return _0xbdc84d(_0x29fb1c-0x2ef,_0x3c3bb7);}const _0x1acf03=Math['max'](_0x2b5edd[_0x271be2(0x365,0x351)+'nt'],0x0);if(_0x1acf03>0x0)_0x1fe821++;return Math['log']((_0x1acf03+0x1)/(0x1-_0x1578ea))-_0x1578ea*Math[_0x271be2(0x34c,0x33c)](_0x42494b);}),_0x1db3ae=rankNorm(_0x55a719),_0x4e93d0=_0x1ded48[_0xbdc84d(0x82,0x77)](_0x1a0eab(0x161,0x160)),_0x340561=new Map(),_0x274a84=new Map(),_0xb8fcd4=new UnionFind();for(const _0x14710e of _0x4e93d0){if('KkoSq'==='BBZRk'){const _0x39bb87=_0x3bce7e[_0x1d212f],_0x3695a0=_0x453d6a[_0x50f4e][_0xbdc84d(0x6d,0x56)+'ore']??0.5,_0x3f05fd=(_0x3695a0+_0x117e16[_0x4261b0])/0x2;return 0.5*(0x1-_0x39bb87)+0.5*(0x1-_0x3f05fd);}else{if(!_0x44c50b[_0x1a0eab(0x152,0x146)](_0x14710e[_0xbdc84d(0x6e,0x7f)])||!_0x44c50b[_0xbdc84d(0x5e,0x72)](_0x14710e['dst']))continue;let _0xfa54d3=_0x340561['get'](_0x14710e['src']);if(!_0xfa54d3){if(_0xbdc84d(0x57,0x50)==='oXcsG'){const _0xb95a5=this[_0x1a0eab(0x153,0x150)]['get'](_0x4570a6);if(_0xb95a5===_0x3dc132||_0xb95a5===_0x522a34)return this[_0x1a0eab(0x14e,0x150)]['set'](_0x4fce7c,_0x29d9c0),_0x2b2cf9;const _0xcb0539=this[_0x1a0eab(0x16a,0x165)](_0xb95a5);return this[_0x1a0eab(0x143,0x150)][_0x1a0eab(0x150,0x163)](_0x4b58f9,_0xcb0539),_0xcb0539;}else _0xfa54d3=[],_0x340561['set'](_0x14710e[_0xbdc84d(0x6e,0x61)],_0xfa54d3);}_0xfa54d3[_0xbdc84d(0x62,0x51)](_0x14710e[_0x1a0eab(0x14e,0x15a)]),_0x274a84[_0x1a0eab(0x14e,0x163)](_0x14710e[_0xbdc84d(0x80,0x7a)],(_0x274a84[_0x1a0eab(0x16e,0x16e)](_0x14710e[_0x1a0eab(0x162,0x168)])??0x0)+0x1);if(_0x14710e[_0xbdc84d(0x72,0x5d)]>=_0x54ecf8)_0xb8fcd4['union'](_0x14710e['src'],_0x14710e[_0x1a0eab(0x161,0x168)]);}}const _0x281579=_0x363654[_0xbdc84d(0x79,0x61)](_0x3ecd15=>{const _0x1a682f=_0x340561['get'](_0x3ecd15);if(!_0x1a682f||_0x1a682f[_0x303113(-0x17f,-0x168)]===0x0)return 0x1;function _0x303113(_0x3137a6,_0x3464e2){return _0xbdc84d(_0x3464e2- -0x1cb,_0x3137a6);}const _0x5b9f64=_0x1a682f[_0x4c2689(0xdd,0xcf)]((_0x333d79,_0x3863d4)=>_0x333d79+_0x3863d4,0x0)/_0x1a682f[_0x303113(-0x16a,-0x168)];function _0x4c2689(_0x236728,_0xf5992){return _0xbdc84d(_0xf5992-0x6e,_0x236728);}return 0x1-_0x5b9f64;}),_0x1eb14f=_0x363654[_0x1a0eab(0x16f,0x161)](_0x548f6c=>_0x274a84[_0x1a0eab(0x161,0x16e)](_0x548f6c)??0x0),_0x897051=rankNorm(_0x1eb14f),_0x205571=new Map(),_0x1d877b=new Map();for(const _0x26b534 of _0x363654){if(_0xbdc84d(0x74,0x62)!==_0x1a0eab(0x160,0x158)){const _0x1a10eb=_0xb8fcd4[_0x1a0eab(0x154,0x165)](_0x26b534);_0x205571[_0x1a0eab(0x15f,0x163)](_0x26b534,_0x1a10eb),_0x1d877b['set'](_0x1a10eb,(_0x1d877b['get'](_0x1a10eb)??0x0)+0x1);}else{const _0x7c0260=this[_0xbdc84d(0x7d,0x67)](_0x555731),_0x284928=this[_0xbdc84d(0x7d,0x72)](_0x2004ba);if(_0x7c0260!==_0x284928)this[_0xbdc84d(0x68,0x5b)][_0x1a0eab(0x157,0x163)](_0x7c0260,_0x284928);}}const _0x5f2315=_0x363654[_0x1a0eab(0x152,0x161)](_0x1fb660=>(_0x1d877b['get'](_0x205571[_0xbdc84d(0x86,0x7a)](_0x1fb660))??0x1)-0x1),_0x8b99d7=rankNorm(_0x5f2315),_0x3da53a=_0x363654[_0xbdc84d(0x79,0x64)](_0x2c9369=>{const _0xcb158c=_0x205571[_0x403a33(0x31d,0x316)](_0x2c9369);function _0x403a33(_0x51a6d3,_0x32aa83){return _0xbdc84d(_0x51a6d3-0x297,_0x32aa83);}return(_0x1d877b['get'](_0xcb158c)??0x1)>=0x2?_0xcb158c:null;}),_0x1f35a2=rankNorm(_0x548992[_0x1a0eab(0x159,0x161)](_0x4bb2f8=>_0x4bb2f8['content_le'+'ngth'])),_0x3d77a2=_0x363654[_0x1a0eab(0x154,0x161)]((_0x5eeff6,_0x4bea67)=>{const _0x37741c=_0x1f35a2[_0x4bea67],_0x5b16c2=_0x548992[_0x4bea67][_0x3ae3a8(-0x202,-0x1ea)+_0x952820(0x371,0x379)]??0.5;function _0x952820(_0x5bc938,_0x249280){return _0x1a0eab(_0x249280,_0x5bc938-0x222);}const _0x5d52b3=(_0x5b16c2+_0x281579[_0x4bea67])/0x2;function _0x3ae3a8(_0x196a83,_0x38972d){return _0x1a0eab(_0x196a83,_0x38972d- -0x33f);}return 0.5*(0x1-_0x37741c)+0.5*(0x1-_0x5d52b3);});function _0x1a0eab(_0x49e116,_0x22deb8){return _0x1b3641(_0x22deb8- -0x20f,_0x49e116);}const _0x3a9527=rankNorm(_0x3d77a2),_0x59d338=[..._0x1d877b[_0xbdc84d(0x83,0x6c)]()][_0xbdc84d(0x7c,0x74)](_0x5f0942=>_0x5f0942>=0x2)['length'],_0x58779e=new Date(_0xc4d332)[_0xbdc84d(0x7a,0x86)+'g'](),_0x340eaa=_0x363654[_0xbdc84d(0x79,0x6b)]((_0x36e480,_0x51ba8a)=>({'id':_0x36e480,'activation':_0x1db3ae[_0x51ba8a],'uniqueness':_0x281579[_0x51ba8a],'generic_penalty':_0x897051[_0x51ba8a],'dup_score':_0x8b99d7[_0x51ba8a],'dump_score':_0x3a9527[_0x51ba8a],'reliability':0x1,'cluster_id':_0x3da53a[_0x51ba8a]}));_0x1ded48[_0xbdc84d(0x84,0x89)+_0x1a0eab(0x14f,0x152)](_0x340eaa,_0x58779e);function _0xbdc84d(_0x4d6de8,_0x5eb9fa){return _0x1b3641(_0x4d6de8- -0x2f7,_0x5eb9fa);}return{'nodes':_0x4c5433,'dupClusters':_0x59d338,'activationValid':_0x1fe821,'elapsedMs':_0x2af528?Date[_0xbdc84d(0x64,0x52)]()-_0x2af528:0x0};}
|
|
1
|
+
(function(_0x4254e7,_0x55cbb3){function _0xed014c(_0x14fa4a,_0x5b7852){return _0x285a(_0x5b7852- -0x49,_0x14fa4a);}function _0x143235(_0x4ec6f1,_0x5346dc){return _0x285a(_0x4ec6f1-0x61,_0x5346dc);}const _0x471c5e=_0x4254e7();while(!![]){try{const _0x5e46e9=parseInt(_0x143235(0x1d1,0x1e6))/0x1*(-parseInt(_0xed014c(0x118,0x10e))/0x2)+parseInt(_0xed014c(0xf3,0x10b))/0x3*(parseInt(_0xed014c(0xff,0x114))/0x4)+-parseInt(_0x143235(0x1a3,0x1ba))/0x5+-parseInt(_0xed014c(0x115,0x122))/0x6+parseInt(_0x143235(0x1c0,0x1c2))/0x7+-parseInt(_0xed014c(0x106,0x108))/0x8*(-parseInt(_0x143235(0x1ca,0x1c0))/0x9)+-parseInt(_0xed014c(0x119,0x103))/0xa*(-parseInt(_0x143235(0x1ac,0x197))/0xb);if(_0x5e46e9===_0x55cbb3)break;else _0x471c5e['push'](_0x471c5e['shift']());}catch(_0x1cb567){_0x471c5e['push'](_0x471c5e['shift']());}}}(_0x11ef,0x4644e));export const ACTR_DECAY=0.5;export const DUP_TAU=0.98;export function parseTs(_0x52f625){function _0x4c7aa3(_0x348f88,_0x2810bc){return _0x285a(_0x348f88-0x190,_0x2810bc);}if(!_0x52f625)return null;const _0x20e56c=_0x52f625[_0x510e00(0x143,0x14f)]('T')?_0x52f625:_0x52f625[_0x4c7aa3(0x2ff,0x307)]('\x20','T')+'Z';function _0x510e00(_0x5b78d6,_0x5aba7e){return _0x285a(_0x5aba7e- -0x3,_0x5b78d6);}const _0x50d8b7=Date['parse'](_0x20e56c);return Number['isNaN'](_0x50d8b7)?null:_0x50d8b7;}function _0x285a(_0x58b659,_0x2cb601){_0x58b659=_0x58b659-0x142;const _0x11ef0b=_0x11ef();let _0x285a14=_0x11ef0b[_0x58b659];if(_0x285a['UzuivY']===undefined){var _0x3d662d=function(_0x5e4d80){const _0x184ca4='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x3f60e1='',_0x2aa5f6='';for(let _0x1f9738=0x0,_0x2ed89a,_0x38f35d,_0x583ea9=0x0;_0x38f35d=_0x5e4d80['charAt'](_0x583ea9++);~_0x38f35d&&(_0x2ed89a=_0x1f9738%0x4?_0x2ed89a*0x40+_0x38f35d:_0x38f35d,_0x1f9738++%0x4)?_0x3f60e1+=String['fromCharCode'](0xff&_0x2ed89a>>(-0x2*_0x1f9738&0x6)):0x0){_0x38f35d=_0x184ca4['indexOf'](_0x38f35d);}for(let _0x59f177=0x0,_0x4abd8c=_0x3f60e1['length'];_0x59f177<_0x4abd8c;_0x59f177++){_0x2aa5f6+='%'+('00'+_0x3f60e1['charCodeAt'](_0x59f177)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2aa5f6);};_0x285a['bduMGs']=_0x3d662d,_0x285a['znEmNG']={},_0x285a['UzuivY']=!![];}const _0x1af64c=_0x11ef0b[0x0],_0x74b7e3=_0x58b659+_0x1af64c,_0x4e91d7=_0x285a['znEmNG'][_0x74b7e3];return!_0x4e91d7?(_0x285a14=_0x285a['bduMGs'](_0x285a14),_0x285a['znEmNG'][_0x74b7e3]=_0x285a14):_0x285a14=_0x4e91d7,_0x285a14;}export function rankNorm(_0x59a7ab){function _0x1a7796(_0x4fd688,_0x1fd16f){return _0x285a(_0x4fd688- -0x157,_0x1fd16f);}const _0x40e9f5=_0x59a7ab['length'];if(_0x40e9f5===0x0)return[];if(_0x40e9f5===0x1)return[0.5];const _0x158e97=_0x59a7ab[_0x1673e3(0x315,0x32e)]((_0x3e7c8b,_0x425a12)=>({'v':_0x3e7c8b,'i':_0x425a12}))[_0x1673e3(0x307,0x314)]((_0x1eb1d6,_0x4ec11a)=>_0x1eb1d6['v']-_0x4ec11a['v']),_0x512fa7=new Array(_0x40e9f5);let _0x354b92=0x0;function _0x1673e3(_0x37f885,_0xf5b586){return _0x285a(_0x37f885-0x1ae,_0xf5b586);}while(_0x354b92<_0x40e9f5){let _0xfb5386=_0x354b92;while(_0xfb5386+0x1<_0x40e9f5&&_0x158e97[_0xfb5386+0x1]['v']===_0x158e97[_0x354b92]['v'])_0xfb5386++;const _0x592ba0=(_0x354b92+_0xfb5386)/0x2,_0x2a6d0f=_0x592ba0/(_0x40e9f5-0x1);for(let _0x151214=_0x354b92;_0x151214<=_0xfb5386;_0x151214++)_0x512fa7[_0x158e97[_0x151214]['i']]=_0x2a6d0f;_0x354b92=_0xfb5386+0x1;}return _0x512fa7;}function _0x275394(_0x3e655e,_0x1643a3){return _0x285a(_0x1643a3- -0x2a6,_0x3e655e);}class UnionFind{[_0x275394(-0x13d,-0x146)]=new Map();[_0x6728bd(0x19a,0x190)](_0x351fa0){function _0x42678a(_0x442d22,_0x1dfb0c){return _0x6728bd(_0x442d22-0x383,_0x1dfb0c);}function _0xf2583e(_0x10e845,_0x3fe6a3){return _0x6728bd(_0x3fe6a3- -0x318,_0x10e845);}const _0x990567=this[_0x42678a(0x523,0x53c)][_0x42678a(0x526,0x52a)](_0x351fa0);if(_0x990567===undefined||_0x990567===_0x351fa0)return this[_0xf2583e(-0x18e,-0x178)][_0xf2583e(-0x184,-0x17d)](_0x351fa0,_0x351fa0),_0x351fa0;const _0x13472c=this[_0xf2583e(-0x167,-0x17e)](_0x990567);return this['parent'][_0xf2583e(-0x18f,-0x17d)](_0x351fa0,_0x13472c),_0x13472c;}[_0x275394(-0x15e,-0x160)](_0x314c9a,_0x2d19fc){function _0x4fa2f8(_0x4165c8,_0x5ab2aa){return _0x275394(_0x5ab2aa,_0x4165c8-0x33b);}const _0x214514=this[_0x1fbe96(-0xfd,-0xfd)](_0x314c9a),_0xf8dc00=this[_0x4fa2f8(0x1ef,0x1f1)](_0x2d19fc);function _0x1fbe96(_0x5f15dd,_0x5120c4){return _0x275394(_0x5f15dd,_0x5120c4-0x4f);}if(_0x214514!==_0xf8dc00)this[_0x1fbe96(-0xef,-0xf7)][_0x4fa2f8(0x1f0,0x1e1)](_0x214514,_0xf8dc00);}}function _0x6728bd(_0x2c02b6,_0x1e911c){return _0x285a(_0x2c02b6-0x40,_0x1e911c);}export function computeSignals(_0x463cbe,_0x1a8e3a){const _0xf83685=_0x1a8e3a?.[_0x5b448f(0x60,0x49)]??0x0,_0x4ae84f=_0x1a8e3a?.[_0x5b448f(0x41,0x49)]??Date['now'](),_0x498269=_0x1a8e3a?.[_0x4ed1a9(-0x74,-0x6c)]??ACTR_DECAY,_0x21f763=_0x1a8e3a?.['dupTau']??DUP_TAU,_0x5d15ed=_0x463cbe[_0x4ed1a9(-0xa8,-0x90)+_0x4ed1a9(-0x80,-0x85)](),_0x7e24fd=_0x5d15ed['length'],_0x3b918f=_0x5d15ed['map'](_0x104714=>_0x104714['id']),_0x584037=new Set(_0x3b918f);let _0x570b9f=0x0;const _0xe2c0fc=_0x5d15ed['map'](_0xd77eb6=>{function _0x39539b(_0x1649c8,_0x3484ee){return _0x5b448f(_0x1649c8,_0x3484ee-0xf0);}function _0x4afafc(_0x414792,_0x1f421f){return _0x5b448f(_0x1f421f,_0x414792- -0xfd);}if(_0x39539b(0x12b,0x12e)===_0x4afafc(-0xbf,-0xb7)){const _0x4bb71c=parseTs(_0xd77eb6[_0x39539b(0x155,0x157)])??_0x4ae84f,_0x49aa4a=Math[_0x4afafc(-0xa8,-0xbb)]((_0x4ae84f-_0x4bb71c)/0x5265c00,0x1/0x18),_0x193b50=Math['max'](_0xd77eb6[_0x4afafc(-0x97,-0x87)+'nt'],0x0);if(_0x193b50>0x0)_0x570b9f++;return Math[_0x4afafc(-0xa6,-0xba)]((_0x193b50+0x1)/(0x1-_0x498269))-_0x498269*Math[_0x4afafc(-0xa6,-0xa4)](_0x49aa4a);}else{const _0x3d2c0b=_0x493663[_0x39539b(0x13f,0x14c)](_0x2ac339);if(!_0x3d2c0b||_0x3d2c0b[_0x39539b(0x13e,0x14f)]===0x0)return 0x1;const _0x106016=_0x3d2c0b[_0x39539b(0x136,0x14a)]((_0x1cbcf8,_0x34cdfd)=>_0x1cbcf8+_0x34cdfd,0x0)/_0x3d2c0b['length'];return 0x1-_0x106016;}}),_0x6cb1e0=rankNorm(_0xe2c0fc),_0x4bbbd1=_0x463cbe[_0x5b448f(0x5e,0x4e)](_0x4ed1a9(-0x9c,-0x86)),_0x19f190=new Map(),_0x18abf3=new Map(),_0x183334=new UnionFind();for(const _0x3dfbc0 of _0x4bbbd1){if(!_0x584037['has'](_0x3dfbc0[_0x5b448f(0x49,0x40)])||!_0x584037['has'](_0x3dfbc0[_0x5b448f(0x58,0x65)]))continue;let _0x275692=_0x19f190[_0x5b448f(0x5b,0x5c)](_0x3dfbc0[_0x4ed1a9(-0x8a,-0x8d)]);if(!_0x275692){if(_0x4ed1a9(-0x4c,-0x62)==='KdHZg'){const _0x561398=_0x48928e[_0x4ed1a9(-0x6c,-0x7a)](_0x391bf8);_0x3dba83['set'](_0x44d2ed,_0x561398),_0x4f2565[_0x4ed1a9(-0x74,-0x79)](_0x561398,(_0x403f84[_0x5b448f(0x6e,0x5c)](_0x561398)??0x0)+0x1);}else _0x275692=[],_0x19f190[_0x4ed1a9(-0x80,-0x79)](_0x3dfbc0[_0x5b448f(0x54,0x40)],_0x275692);}_0x275692[_0x4ed1a9(-0x75,-0x7e)](_0x3dfbc0[_0x4ed1a9(-0x79,-0x8c)]),_0x18abf3[_0x5b448f(0x5a,0x54)](_0x3dfbc0[_0x5b448f(0x4d,0x65)],(_0x18abf3['get'](_0x3dfbc0['dst'])??0x0)+0x1);if(_0x3dfbc0['weight']>=_0x21f763)_0x183334['union'](_0x3dfbc0[_0x5b448f(0x4e,0x40)],_0x3dfbc0[_0x4ed1a9(-0x4f,-0x68)]);}const _0x27e97d=_0x3b918f[_0x5b448f(0x76,0x60)](_0xbab05b=>{function _0x26d54a(_0x434bc6,_0x52064f){return _0x5b448f(_0x434bc6,_0x52064f-0x2b1);}function _0x4d568a(_0x240e0f,_0x144656){return _0x5b448f(_0x144656,_0x240e0f-0x49f);}if(_0x26d54a(0x309,0x314)===_0x4d568a(0x502,0x4f7)){const _0xd74e1b=_0x19f190['get'](_0xbab05b);if(!_0xd74e1b||_0xd74e1b['length']===0x0)return 0x1;const _0x103f9f=_0xd74e1b[_0x4d568a(0x4f9,0x4fe)]((_0x1bfba5,_0x46e8fc)=>_0x1bfba5+_0x46e8fc,0x0)/_0xd74e1b['length'];return 0x1-_0x103f9f;}else{const _0x35d786=this[_0x4d568a(0x4f2,0x506)](_0x1e2705),_0xcd80e0=this[_0x4d568a(0x4f2,0x4fb)](_0x493517);if(_0x35d786!==_0xcd80e0)this[_0x4d568a(0x4f8,0x4f9)][_0x26d54a(0x2f8,0x305)](_0x35d786,_0xcd80e0);}}),_0x30690a=_0x3b918f[_0x4ed1a9(-0x7d,-0x6d)](_0x39115d=>_0x18abf3['get'](_0x39115d)??0x0),_0x41c6e0=rankNorm(_0x30690a),_0x59b644=new Map(),_0x56f114=new Map();for(const _0xafada7 of _0x3b918f){const _0x2b54ac=_0x183334[_0x5b448f(0x69,0x53)](_0xafada7);_0x59b644[_0x4ed1a9(-0x8e,-0x79)](_0xafada7,_0x2b54ac),_0x56f114[_0x4ed1a9(-0x74,-0x79)](_0x2b54ac,(_0x56f114[_0x4ed1a9(-0x84,-0x71)](_0x2b54ac)??0x0)+0x1);}const _0x5a05ed=_0x3b918f['map'](_0xefc82a=>(_0x56f114[_0x5b448f(0x70,0x5c)](_0x59b644[_0x5b448f(0x65,0x5c)](_0xefc82a))??0x1)-0x1),_0x48e8c9=rankNorm(_0x5a05ed);function _0x4ed1a9(_0x232257,_0x40400a){return _0x275394(_0x232257,_0x40400a-0xd2);}const _0x1cbed4=_0x3b918f['map'](_0x50ca45=>{const _0x9a25a0=_0x59b644[_0x30475d(0x32d,0x31a)](_0x50ca45);function _0x30475d(_0x54b6ae,_0x1c77fc){return _0x5b448f(_0x54b6ae,_0x1c77fc-0x2be);}function _0x2c1732(_0x8cff95,_0x41796){return _0x5b448f(_0x8cff95,_0x41796-0x18);}return(_0x56f114[_0x2c1732(0x71,0x74)](_0x9a25a0)??0x1)>=0x2?_0x9a25a0:null;}),_0x342c14=rankNorm(_0x5d15ed['map'](_0x355ca2=>_0x355ca2[_0x5b448f(0x46,0x5b)+_0x5b448f(0x63,0x6a)]));function _0x5b448f(_0x48b365,_0x2bf91b){return _0x275394(_0x48b365,_0x2bf91b-0x19f);}const _0x2e09a2=_0x3b918f[_0x5b448f(0x6a,0x60)]((_0x360638,_0x5902c0)=>{function _0x32dbd2(_0x50333c,_0x3f2787){return _0x4ed1a9(_0x3f2787,_0x50333c-0x75);}function _0x559316(_0x988680,_0x52cf90){return _0x4ed1a9(_0x988680,_0x52cf90-0xd7);}const _0x5b90f5=_0x342c14[_0x5902c0],_0x1b9dd9=_0x5d15ed[_0x5902c0][_0x559316(0x60,0x50)+_0x559316(0x6f,0x56)]??0.5,_0x11c366=(_0x1b9dd9+_0x27e97d[_0x5902c0])/0x2;return 0.5*(0x1-_0x5b90f5)+0.5*(0x1-_0x11c366);}),_0x3d9647=rankNorm(_0x2e09a2),_0x43ead7=[..._0x56f114[_0x5b448f(0x5d,0x5d)]()][_0x4ed1a9(-0x8b,-0x8b)](_0x418442=>_0x418442>=0x2)[_0x4ed1a9(-0x6c,-0x6e)],_0x224a05=new Date(_0x4ae84f)[_0x5b448f(0x75,0x5e)+'g'](),_0x4ec2b7=_0x3b918f[_0x4ed1a9(-0x7a,-0x6d)]((_0x3af42d,_0x3a60d0)=>({'id':_0x3af42d,'activation':_0x6cb1e0[_0x3a60d0],'uniqueness':_0x27e97d[_0x3a60d0],'generic_penalty':_0x41c6e0[_0x3a60d0],'dup_score':_0x48e8c9[_0x3a60d0],'dump_score':_0x3d9647[_0x3a60d0],'reliability':0x1,'cluster_id':_0x1cbed4[_0x3a60d0]}));return _0x463cbe[_0x5b448f(0x33,0x3c)+_0x4ed1a9(-0x67,-0x7c)](_0x4ec2b7,_0x224a05),{'nodes':_0x7e24fd,'dupClusters':_0x43ead7,'activationValid':_0x570b9f,'elapsedMs':_0xf83685?Date[_0x5b448f(0x3b,0x43)]()-_0xf83685:0x0};}function _0x11ef(){const _0xd2d355=['BMD0Aa','DenNwgu','ndKZodKWsKjOwKnL','DxbKyxrLu2LNBG','z2v0u2LNBMfSsq','zg1AqKm','Dw5PB24','C3jJ','D2vPz2H0','zMLSDgvY','BM93','mtffBK1hAM0','mJm2mtyXmePPBNH3rq','CxvHBgL0Ev9ZyW','C2LT','BNb1DfjVD3m','BM93txm','mZK2nJm0nhvgtuTRAG','Aw5JBhvKzxm','B3jL','mZu2mde2whbsuvr5','z2v0rwrNzxm','ChvZAa','mMXbs0DAra','ywXZ','C29YDa','zMLUza','C2v0','Bwf4','mtjoyMf1DM8','Bg9N','mte3ndy1nLP0EeL1Aq','CgfYzw50','CMvKDwnL','y29UDgvUDf9Szq','z2v0','DMfSDwvZ','Dg9ju09tDhjPBG','BgvUz3rO','BwfW','zgvJyxK','ovr6tgLADG','zw1wuuW','mZe5ody3ohDSDhDvta','zhn0','ywnJzxnZx2nVDq','y3jLyxrLzf9HDa','CMvWBgfJzq','mZm2mdy1y09yB0TS'];_0x11ef=function(){return _0xd2d355;};return _0x11ef();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2f25ba,_0x3338ce){const _0x977da4=_0x2f25ba();function _0x5ab8c6(_0xcbf5b4,_0x5860ca){return _0x5220(_0xcbf5b4- -0x30,_0x5860ca);}function _0x3e3029(_0x4cda9b,_0x124fd8){return _0x5220(_0x4cda9b- -0x27e,_0x124fd8);}while(!![]){try{const _0x133ffe=parseInt(_0x5ab8c6(0x10a,0x110))/0x1+parseInt(_0x3e3029(-0x145,-0x147))/0x2+-parseInt(_0x3e3029(-0x13e,-0x13b))/0x3+-parseInt(_0x3e3029(-0x143,-0x140))/0x4+-parseInt(_0x5ab8c6(0x10e,0x10c))/0x5*(-parseInt(_0x3e3029(-0x149,-0x14f))/0x6)+-parseInt(_0x3e3029(-0x142,-0x13e))/0x7*(-parseInt(_0x3e3029(-0x141,-0x13b))/0x8)+-parseInt(_0x3e3029(-0x148,-0x146))/0x9*(-parseInt(_0x3e3029(-0x147,-0x141))/0xa);if(_0x133ffe===_0x3338ce)break;else _0x977da4['push'](_0x977da4['shift']());}catch(_0x32b7ab){_0x977da4['push'](_0x977da4['shift']());}}}(_0x3df5,0xe31c4));import{existsSync,readFileSync,unlinkSync,writeFileSync}from'node:fs';function _0x3df5(){const _0x5b481e=['DgvZDa','ndi3nJa4mhDbALLiua','Dg9ju09tDhjPBG','DxrMltG','BM93','otKXmduWCNPMrhr2','mJC5mdqWnvnhyuL6qW','mtbkAuXsA24','DhjPBq','nta2otC0A21Rz3bO','mty5oda4nuvAze9kra','mJi2mJeYogzny2j4wq','nZa5mvP0DKzIvG','mZKWnfLlyKPbwa','nxLzvgTJsG'];_0x3df5=function(){return _0x5b481e;};return _0x3df5();}import{dirname,join,resolve}from'node:path';import{resolvePath}from'../db/database.js';export function sinceFilePath(_0x2f6be7){return join(dirname(resolve(resolvePath(_0x2f6be7))),'.contextra'+'nk-since');}export function nowStamp(_0x2eb784=Date[_0x1f4f8d(0x5,0x6)]()){function _0x1c21f3(_0x39bec1,_0x1e4a67){return _0x1f4f8d(_0x1e4a67- -0x1ec,_0x39bec1);}return new Date(_0x2eb784)[_0x1c21f3(-0x1e2,-0x1e9)+'g']()['replace']('T','\x20')['slice'](0x0,0x13);}export function readSince(_0x61a253){function _0x5253a6(_0x11f80b,_0x38642e){return _0x1f4f8d(_0x38642e- -0x3b,_0x11f80b);}const _0x3afec1=sinceFilePath(_0x61a253);if(!existsSync(_0x3afec1))return undefined;function _0x6cce9f(_0x1c4d58,_0xfe423){return _0x1f4f8d(_0xfe423-0x48e,_0x1c4d58);}try{const _0x2f1b98=readFileSync(_0x3afec1,_0x6cce9f(0x494,0x492))[_0x6cce9f(0x49c,0x497)]();return/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}$/[_0x6cce9f(0x4a3,0x49e)](_0x2f1b98)?_0x2f1b98:undefined;}catch{return undefined;}}function _0x5220(_0x36dcc3,_0x4fd8f0){_0x36dcc3=_0x36dcc3-0x132;const _0x3df52e=_0x3df5();let _0x522022=_0x3df52e[_0x36dcc3];if(_0x5220['XqDumQ']===undefined){var _0x4f9fbc=function(_0x3ca276){const _0x4b00f0='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x2322c4='',_0x2d9b08='';for(let _0x2c7415=0x0,_0x23bfd0,_0x5aa796,_0x175efd=0x0;_0x5aa796=_0x3ca276['charAt'](_0x175efd++);~_0x5aa796&&(_0x23bfd0=_0x2c7415%0x4?_0x23bfd0*0x40+_0x5aa796:_0x5aa796,_0x2c7415++%0x4)?_0x2322c4+=String['fromCharCode'](0xff&_0x23bfd0>>(-0x2*_0x2c7415&0x6)):0x0){_0x5aa796=_0x4b00f0['indexOf'](_0x5aa796);}for(let _0x1f3d7e=0x0,_0x3468ae=_0x2322c4['length'];_0x1f3d7e<_0x3468ae;_0x1f3d7e++){_0x2d9b08+='%'+('00'+_0x2322c4['charCodeAt'](_0x1f3d7e)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2d9b08);};_0x5220['yZHwxr']=_0x4f9fbc,_0x5220['FiJmJx']={},_0x5220['XqDumQ']=!![];}const _0x478f59=_0x3df52e[0x0],_0x5a33b4=_0x36dcc3+_0x478f59,_0x6140d7=_0x5220['FiJmJx'][_0x5a33b4];return!_0x6140d7?(_0x522022=_0x5220['yZHwxr'](_0x522022),_0x5220['FiJmJx'][_0x5a33b4]=_0x522022):_0x522022=_0x6140d7,_0x522022;}function _0x1f4f8d(_0x4a76f0,_0x147ee9){return _0x5220(_0x4a76f0- -0x12f,_0x147ee9);}export function writeSince(_0x2d2d52,_0x2f411a){try{return writeFileSync(sinceFilePath(_0x2d2d52),_0x2f411a+'\x0a','utf-8'),!![];}catch{return![];}}export function clearSince(_0x34089d){try{const _0x3ddabd=sinceFilePath(_0x34089d);if(existsSync(_0x3ddabd))unlinkSync(_0x3ddabd);}catch{}}
|
package/dist/db/database.d.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* SQLite 기반 로컬 메모리 저장소.
|
|
5
5
|
* better-sqlite3 (동기 API) 사용.
|
|
6
6
|
*/
|
|
7
|
+
import Database from 'better-sqlite3';
|
|
8
|
+
import { type IntegrityReason, type MarkerInvalidation, type MarkerWriteHooks } from './integrity-marker.js';
|
|
7
9
|
import type { Memory, MemoryCreateInput, MemorySearchOptions, MemorySearchResult, MemoryCategory, MemoryTier, QuantizationLevel, ContradictionReview } from '../types/index.js';
|
|
8
10
|
import type { ProficiencyRecord, ExperienceEvent } from '../proficiency/types.js';
|
|
9
11
|
export type UsageChannel = 'hook_injection' | 'prompt_injection' | 'cli' | 'mcp';
|
|
@@ -40,12 +42,48 @@ export interface UsageSummary {
|
|
|
40
42
|
* db.path를 다루는 모든 경로는 이 단일 source를 경유할 것.
|
|
41
43
|
*/
|
|
42
44
|
export declare function resolvePath(p: string): string;
|
|
45
|
+
/** #245 (ADR-099 D6): 이번 인스턴스의 무결성 검사 실행 기록 — 회귀는 시간이 아니라 이것으로 단언한다. */
|
|
46
|
+
export type IntegrityEvent = {
|
|
47
|
+
ran: false;
|
|
48
|
+
reason: 'fresh';
|
|
49
|
+
} | {
|
|
50
|
+
ran: true;
|
|
51
|
+
reason: IntegrityReason;
|
|
52
|
+
ok: boolean;
|
|
53
|
+
durationMs: number;
|
|
54
|
+
};
|
|
55
|
+
export interface IntegrityMarkerInfo {
|
|
56
|
+
path: string;
|
|
57
|
+
mtimeMs: number | null;
|
|
58
|
+
/** health 가 이번에 표지를 써 봤으면 그 결과. 안 써 봤으면 null. */
|
|
59
|
+
writable: boolean | null;
|
|
60
|
+
/** health 가 손상을 보고 표지를 무효화했으면 그 결과. */
|
|
61
|
+
invalidation: MarkerInvalidation | null;
|
|
62
|
+
/** 생성자가 손상을 발견해 `.corrupt` 로 옮기고 새 DB 를 만들었는가. */
|
|
63
|
+
recovered: boolean;
|
|
64
|
+
/** 표지를 쓰는 DB 인가 — 비파일 DB·공유 디렉토리는 매번 검사한다(ADR-099 D8). */
|
|
65
|
+
applies: boolean;
|
|
66
|
+
}
|
|
67
|
+
/** 테스트 전용 주입점 — 운영 호출자는 넘기지 않는다. */
|
|
68
|
+
export interface MemoryDatabaseOptions {
|
|
69
|
+
integrityChecker?: (db: Database.Database) => string[];
|
|
70
|
+
markerHooks?: MarkerWriteHooks;
|
|
71
|
+
now?: () => number;
|
|
72
|
+
}
|
|
43
73
|
export declare class MemoryDatabase {
|
|
44
74
|
private db;
|
|
45
75
|
private dbPath;
|
|
46
76
|
private stmts;
|
|
47
77
|
private quantizationLevel;
|
|
48
|
-
|
|
78
|
+
private readonly options;
|
|
79
|
+
/** #245 (ADR-099 D6) */
|
|
80
|
+
integrityEvent: IntegrityEvent;
|
|
81
|
+
/** 생성자 검사 결과 — `getIntegrityStatus()` 가 1회만 재사용하고 소비한다 (ADR-099 D5). */
|
|
82
|
+
private constructorIntegrity;
|
|
83
|
+
private integrityRecovered;
|
|
84
|
+
private markerWritable;
|
|
85
|
+
private markerInvalidation;
|
|
86
|
+
constructor(dbPath?: string, quantizationLevel?: QuantizationLevel, options?: MemoryDatabaseOptions);
|
|
49
87
|
/**
|
|
50
88
|
* better-sqlite3 native binding을 로드합니다.
|
|
51
89
|
* 로드 실패 시 명확한 에러 메시지와 해결 방법을 안내합니다.
|
|
@@ -55,10 +93,19 @@ export declare class MemoryDatabase {
|
|
|
55
93
|
* SQLite integrity_check를 실행합니다.
|
|
56
94
|
* 손상된 DB는 .corrupt로 이름을 변경하고 새 DB를 생성합니다.
|
|
57
95
|
*/
|
|
96
|
+
private now;
|
|
97
|
+
/** 생성자와 `getIntegrityStatus()` 가 같은 검사 함수를 거친다 (ADR-099 D5 — 회귀 seam 단일화). */
|
|
98
|
+
private runIntegrityPragma;
|
|
99
|
+
/**
|
|
100
|
+
* #245 (ADR-099): 전체 무결성 검사는 24시간에 한 번만 한다.
|
|
101
|
+
* 이전에는 매 open 마다 돌아 1.6GB DB 에서 6.2초 — 메모리를 캡처하는 hook 이 Bash 호출마다 멈췄다.
|
|
102
|
+
* 실패·예외 시 `recoverCorruptDatabase()` 로 가는 계약은 그대로다.
|
|
103
|
+
*/
|
|
58
104
|
private checkIntegrity;
|
|
59
105
|
/**
|
|
60
106
|
* 손상된 DB를 .corrupt로 이름 변경 후 새 DB를 엽니다.
|
|
61
107
|
*/
|
|
108
|
+
/** @returns 손상 파일을 `.corrupt` 로 옮기는 데 성공했는가 — 실패하면 같은 파일을 다시 연다. */
|
|
62
109
|
private recoverCorruptDatabase;
|
|
63
110
|
private stmt;
|
|
64
111
|
initialize(): void;
|
|
@@ -669,7 +716,14 @@ export declare class MemoryDatabase {
|
|
|
669
716
|
/**
|
|
670
717
|
* PRAGMA integrity_check 실행
|
|
671
718
|
*/
|
|
719
|
+
/**
|
|
720
|
+
* 수동 무결성 검사 (`a2a-memory health`). 표지와 무관하게 검사하되, 같은 인스턴스의 생성자가 방금
|
|
721
|
+
* 검사했으면 그 결과를 **1회만** 재사용한다 (ADR-099 D5).
|
|
722
|
+
* ok 면 표지를 갱신하고, 🔴 실패·예외면 표지를 무효화한다 — 안 하면 손상 DB 에 24시간 동안 계속 쓴다.
|
|
723
|
+
*/
|
|
672
724
|
getIntegrityStatus(): boolean;
|
|
725
|
+
/** `health` 의 `Integrity marker` 행 (ADR-099 D5). */
|
|
726
|
+
getIntegrityMarkerInfo(): IntegrityMarkerInfo;
|
|
673
727
|
/**
|
|
674
728
|
* pending sync 메모리 수 조회
|
|
675
729
|
*/
|