a2a-memory 0.12.61 → 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(_0x1b6575,_0x1de34e){function _0x306bf0(_0x36c493,_0x4054bf){return _0x18d5(_0x36c493- -0x124,_0x4054bf);}const _0x50253c=_0x1b6575();function _0x55a32d(_0x12ecdf,_0x1b75d8){return _0x18d5(_0x1b75d8-0x30,_0x12ecdf);}while(!![]){try{const _0x36dc18=parseInt(_0x55a32d(0x14a,0x152))/0x1+parseInt(_0x55a32d(0x154,0x150))/0x2+-parseInt(_0x306bf0(0x6,-0xe))/0x3+-parseInt(_0x55a32d(0x155,0x156))/0x4*(-parseInt(_0x55a32d(0x16a,0x170))/0x5)+parseInt(_0x55a32d(0x144,0x14e))/0x6*(-parseInt(_0x55a32d(0x162,0x16a))/0x7)+parseInt(_0x55a32d(0x16b,0x15e))/0x8*(parseInt(_0x306bf0(0x17,0x13))/0x9)+-parseInt(_0x306bf0(0x5,0x16))/0xa;if(_0x36dc18===_0x1de34e)break;else _0x50253c['push'](_0x50253c['shift']());}catch(_0x563e28){_0x50253c['push'](_0x50253c['shift']());}}}(_0x54f4,0x4f8ca));export const ACTR_DECAY=0.5;export const DUP_TAU=0.98;function _0x1221bb(_0x37248a,_0x12cac7){return _0x18d5(_0x12cac7-0x177,_0x37248a);}function _0x54f4(){const _0x3594ee=['nda4EK9tzK1h','AgfZ','ywnJzxnZx2nVDq','y29UDgvUDf9Szq','BwfW','C2LT','zMLUza','DxbKyxrLu2LNBG','Bg9N','z2v0','CMvWBgfJzq','y3jLyxrLzf9HDa','nZq4m1Dxrfv2vG','mJiZmJLwuxvQBLC','BM93','Bwf4','D2vPz2H0','BgvUz3rO','mJKXnJu0nwrICeflqG','CxvHBgL0Ev9ZyW','CMvKDwnL','C3jJ','z2v0u2LNBMfSsq','BM93txm','mta3ngHWD0nxEa','zhn0','ndmZntm4v3nfC0jK','zMLSDgvY','ntyZndfmyM5vCeO','zhvWvgf1','CgfYzw50','BMD0Aa','ng90zNvdqG','zgvJyxK','Dw5PB24','mZC5mJa5meTUy1bzwq','mJu5nJy4AMfvD2ru','C2v0','Aw5JBhvKzxm','Dg9ju09tDhjPBG'];_0x54f4=function(){return _0x3594ee;};return _0x54f4();}export function parseTs(_0x32e3c1){function _0xc38dc1(_0xb05910,_0x4e3034){return _0x18d5(_0xb05910-0x384,_0x4e3034);}if(!_0x32e3c1)return null;function _0x31b707(_0x3295b5,_0x2c6ea4){return _0x18d5(_0x3295b5-0x1fe,_0x2c6ea4);}const _0x315070=_0x32e3c1[_0x31b707(0x32a,0x319)]('T')?_0x32e3c1:_0x32e3c1[_0xc38dc1(0x4bc,0x4ce)]('\x20','T')+'Z',_0x170fe8=Date['parse'](_0x315070);return Number['isNaN'](_0x170fe8)?null:_0x170fe8;}export function rankNorm(_0x23e9d5){const _0x39f426=_0x23e9d5['length'];if(_0x39f426===0x0)return[];if(_0x39f426===0x1)return[0.5];const _0x162d00=_0x23e9d5[_0x285c62(-0x163,-0x15d)]((_0x2301c9,_0x162496)=>({'v':_0x2301c9,'i':_0x162496}))['sort']((_0x29a25c,_0x1fa394)=>_0x29a25c['v']-_0x1fa394['v']),_0x23421b=new Array(_0x39f426);let _0x38c7e0=0x0;while(_0x38c7e0<_0x39f426){let _0x18a060=_0x38c7e0;while(_0x18a060+0x1<_0x39f426&&_0x162d00[_0x18a060+0x1]['v']===_0x162d00[_0x38c7e0]['v'])_0x18a060++;const _0x282876=(_0x38c7e0+_0x18a060)/0x2,_0x4943a1=_0x282876/(_0x39f426-0x1);for(let _0x20d537=_0x38c7e0;_0x20d537<=_0x18a060;_0x20d537++)_0x23421b[_0x162d00[_0x20d537]['i']]=_0x4943a1;_0x38c7e0=_0x18a060+0x1;}function _0x285c62(_0x3962de,_0x26b212){return _0x18d5(_0x3962de- -0x295,_0x26b212);}return _0x23421b;}class UnionFind{[_0x1221bb(0x2a6,0x29b)]=new Map();[_0x1221bb(0x2bd,0x2ab)](_0x379b27){const _0x59cc5e=this['parent'][_0x461f24(0x373,0x383)](_0x379b27);if(_0x59cc5e===undefined||_0x59cc5e===_0x379b27)return this['parent'][_0x461f24(0x367,0x368)](_0x379b27,_0x379b27),_0x379b27;function _0x55a0a5(_0x373c64,_0x3cd246){return _0x1221bb(_0x373c64,_0x3cd246-0x212);}const _0x4375a9=this[_0x55a0a5(0x4ae,0x4bd)](_0x59cc5e);this[_0x461f24(0x360,0x355)][_0x55a0a5(0x4af,0x4b4)](_0x379b27,_0x4375a9);function _0x461f24(_0x257122,_0x3ee0d9){return _0x1221bb(_0x3ee0d9,_0x257122-0xc5);}return _0x4375a9;}['union'](_0x1a49a1,_0x359d84){function _0x11a727(_0xc65fdf,_0x34ffac){return _0x1221bb(_0xc65fdf,_0x34ffac- -0x245);}const _0x359e41=this[_0x387c1e(0x1dc,0x1e6)](_0x1a49a1),_0x270f04=this[_0x387c1e(0x1dc,0x1cc)](_0x359d84);function _0x387c1e(_0x4c11b3,_0x274937){return _0x1221bb(_0x274937,_0x4c11b3- -0xcf);}if(_0x359e41!==_0x270f04)this[_0x387c1e(0x1cc,0x1b8)][_0x11a727(0x65,0x5d)](_0x359e41,_0x270f04);}}function _0x18d5(_0x4e9401,_0x406149){_0x4e9401=_0x4e9401-0x11a;const _0x54f404=_0x54f4();let _0x18d567=_0x54f404[_0x4e9401];if(_0x18d5['SQUphV']===undefined){var _0x57078f=function(_0x79feb0){const _0x40fa78='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x1b6de1='',_0x1d469a='';for(let _0x18c4cd=0x0,_0x30bf29,_0x9032a7,_0x2a938e=0x0;_0x9032a7=_0x79feb0['charAt'](_0x2a938e++);~_0x9032a7&&(_0x30bf29=_0x18c4cd%0x4?_0x30bf29*0x40+_0x9032a7:_0x9032a7,_0x18c4cd++%0x4)?_0x1b6de1+=String['fromCharCode'](0xff&_0x30bf29>>(-0x2*_0x18c4cd&0x6)):0x0){_0x9032a7=_0x40fa78['indexOf'](_0x9032a7);}for(let _0x1b79e0=0x0,_0xbccf52=_0x1b6de1['length'];_0x1b79e0<_0xbccf52;_0x1b79e0++){_0x1d469a+='%'+('00'+_0x1b6de1['charCodeAt'](_0x1b79e0)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x1d469a);};_0x18d5['XsULnI']=_0x57078f,_0x18d5['jTCYTS']={},_0x18d5['SQUphV']=!![];}const _0x4f1258=_0x54f404[0x0],_0x541de3=_0x4e9401+_0x4f1258,_0x481a19=_0x18d5['jTCYTS'][_0x541de3];return!_0x481a19?(_0x18d567=_0x18d5['XsULnI'](_0x18d567),_0x18d5['jTCYTS'][_0x541de3]=_0x18d567):_0x18d567=_0x481a19,_0x18d567;}function _0x441ec9(_0x1d2009,_0x1a219e){return _0x18d5(_0x1a219e-0x24b,_0x1d2009);}export function computeSignals(_0x2342b5,_0xb9de89){const _0x1fae40=_0xb9de89?.[_0x6014d7(0xdc,0xd2)]??0x0,_0x2292a7=_0xb9de89?.[_0x6014d7(0xdc,0xe0)]??Date[_0x6014d7(0xfb,0xe9)](),_0x29eb7f=_0xb9de89?.[_0x6014d7(0xe6,0xf4)]??ACTR_DECAY,_0x1cf358=_0xb9de89?.[_0x53111e(0xcd,0xbb)]??DUP_TAU,_0x4aeabe=_0x2342b5[_0x53111e(0xc6,0xce)+'nputRows'](),_0x6543d6=_0x4aeabe['length'],_0x3c9989=_0x4aeabe[_0x6014d7(0xf1,0xf9)](_0x4ad56f=>_0x4ad56f['id']),_0x4a6733=new Set(_0x3c9989);let _0x42a37c=0x0;const _0x522768=_0x4aeabe[_0x6014d7(0xf1,0xe4)](_0x5ce1bf=>{const _0xec9ac8=parseTs(_0x5ce1bf[_0x2e8896(0x461,0x46d)])??_0x2292a7;function _0x2e8896(_0xb2d867,_0x17a487){return _0x6014d7(_0xb2d867-0x369,_0x17a487);}const _0x51af72=Math[_0x36f509(0x467,0x463)]((_0x2292a7-_0xec9ac8)/0x5265c00,0x1/0x18);function _0x36f509(_0x347648,_0x4c53f9){return _0x6014d7(_0x4c53f9-0x367,_0x347648);}const _0x7db9ce=Math[_0x2e8896(0x465,0x45a)](_0x5ce1bf[_0x36f509(0x469,0x456)+'nt'],0x0);if(_0x7db9ce>0x0)_0x42a37c++;return Math[_0x2e8896(0x45e,0x46e)]((_0x7db9ce+0x1)/(0x1-_0x29eb7f))-_0x29eb7f*Math[_0x36f509(0x448,0x45c)](_0x51af72);}),_0x5ea1f2=rankNorm(_0x522768);function _0x6014d7(_0x467387,_0x47dd08){return _0x441ec9(_0x47dd08,_0x467387- -0x28c);}const _0x3d0505=_0x2342b5['getEdges'](_0x6014d7(0xf2,0xe9)),_0x875b54=new Map(),_0x3bec22=new Map(),_0x465a83=new UnionFind();for(const _0x4a0d4d of _0x3d0505){if(!_0x4a6733[_0x6014d7(0xee,0xe0)](_0x4a0d4d['src'])||!_0x4a6733[_0x6014d7(0xee,0xfc)](_0x4a0d4d[_0x53111e(0xc9,0xdc)]))continue;let _0x42e8e7=_0x875b54[_0x53111e(0xe1,0xee)](_0x4a0d4d['src']);!_0x42e8e7&&(_0x42e8e7=[],_0x875b54[_0x6014d7(0xea,0xed)](_0x4a0d4d[_0x53111e(0xc5,0xd0)],_0x42e8e7));_0x42e8e7['push'](_0x4a0d4d['weight']),_0x3bec22[_0x6014d7(0xea,0xe4)](_0x4a0d4d[_0x53111e(0xc9,0xbe)],(_0x3bec22['get'](_0x4a0d4d[_0x6014d7(0xde,0xe9)])??0x0)+0x1);if(_0x4a0d4d[_0x53111e(0xe8,0xe4)]>=_0x1cf358)_0x465a83[_0x53111e(0xd2,0xd9)](_0x4a0d4d[_0x53111e(0xc5,0xd2)],_0x4a0d4d[_0x53111e(0xc9,0xb6)]);}const _0x3f0cf4=_0x3c9989[_0x53111e(0xdc,0xe0)](_0x156a30=>{function _0x117aeb(_0x270f44,_0x14edcf){return _0x6014d7(_0x270f44- -0x89,_0x14edcf);}const _0x5e74f1=_0x875b54['get'](_0x156a30);if(!_0x5e74f1||_0x5e74f1[_0x117aeb(0x75,0x88)]===0x0)return 0x1;const _0x4daf12=_0x5e74f1[_0xe4d618(-0x100,-0x101)]((_0x5a78a4,_0x2b6ad0)=>_0x5a78a4+_0x2b6ad0,0x0)/_0x5e74f1[_0x117aeb(0x75,0x83)];function _0xe4d618(_0x478f7c,_0x1a5cd5){return _0x6014d7(_0x1a5cd5- -0x1da,_0x478f7c);}return 0x1-_0x4daf12;}),_0x2fe174=_0x3c9989[_0x53111e(0xdc,0xc9)](_0x4d7a9f=>_0x3bec22['get'](_0x4d7a9f)??0x0),_0x3359ce=rankNorm(_0x2fe174),_0x5196d4=new Map(),_0x3d400d=new Map();for(const _0x20a71c of _0x3c9989){const _0x1a2970=_0x465a83['find'](_0x20a71c);_0x5196d4[_0x6014d7(0xea,0xdb)](_0x20a71c,_0x1a2970),_0x3d400d['set'](_0x1a2970,(_0x3d400d[_0x6014d7(0xf6,0xff)](_0x1a2970)??0x0)+0x1);}const _0xec050d=_0x3c9989[_0x6014d7(0xf1,0xdd)](_0x5787fb=>(_0x3d400d[_0x6014d7(0xf6,0xef)](_0x5196d4[_0x6014d7(0xf6,0xed)](_0x5787fb))??0x1)-0x1),_0x5778e2=rankNorm(_0xec050d);function _0x53111e(_0x3d0b73,_0x496849){return _0x441ec9(_0x496849,_0x3d0b73- -0x2a1);}const _0x1d2f6f=_0x3c9989[_0x53111e(0xdc,0xe6)](_0x341a80=>{const _0x15b923=_0x5196d4[_0x1ee06e(-0x2a9,-0x2b1)](_0x341a80);function _0x1ee06e(_0x4ecbb5,_0xe1cc0e){return _0x6014d7(_0xe1cc0e- -0x3a7,_0x4ecbb5);}return(_0x3d400d['get'](_0x15b923)??0x1)>=0x2?_0x15b923:null;}),_0x4113c6=rankNorm(_0x4aeabe['map'](_0x9e3c43=>_0x9e3c43[_0x6014d7(0xf0,0xfc)+_0x6014d7(0xe4,0xf1)])),_0x58c713=_0x3c9989[_0x6014d7(0xf1,0xe5)]((_0x2b69cc,_0xdfc01a)=>{const _0x2359d0=_0x4113c6[_0xdfc01a],_0x175684=_0x4aeabe[_0xdfc01a][_0x4767d6(-0x214,-0x204)+'ore']??0.5,_0x1b3f97=(_0x175684+_0x3f0cf4[_0xdfc01a])/0x2;function _0x4767d6(_0x11b35a,_0x422bd1){return _0x53111e(_0x422bd1- -0x2ef,_0x11b35a);}return 0.5*(0x1-_0x2359d0)+0.5*(0x1-_0x1b3f97);}),_0x2ed867=rankNorm(_0x58c713),_0x53bdac=[..._0x3d400d['values']()][_0x6014d7(0xe0,0xd9)](_0x1c4b01=>_0x1c4b01>=0x2)[_0x6014d7(0xfe,0xfa)],_0x5d4c0f=new Date(_0x2292a7)[_0x6014d7(0xec,0xe8)+'g'](),_0x454a34=_0x3c9989[_0x6014d7(0xf1,0x102)]((_0x2f8a2b,_0xa67ac7)=>({'id':_0x2f8a2b,'activation':_0x5ea1f2[_0xa67ac7],'uniqueness':_0x3f0cf4[_0xa67ac7],'generic_penalty':_0x3359ce[_0xa67ac7],'dup_score':_0x5778e2[_0xa67ac7],'dump_score':_0x2ed867[_0xa67ac7],'reliability':0x1,'cluster_id':_0x1d2f6f[_0xa67ac7]}));return _0x2342b5[_0x6014d7(0xf4,0xe6)+'als'](_0x454a34,_0x5d4c0f),{'nodes':_0x6543d6,'dupClusters':_0x53bdac,'activationValid':_0x42a37c,'elapsedMs':_0x1fae40?Date[_0x53111e(0xe6,0xe8)]()-_0x1fae40: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
|
*/
|