@evomap/evolver 1.88.4 → 1.89.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/.cursor/BUGBOT.md +182 -0
- package/.env.example +68 -0
- package/.git-commit-guard-token +1 -0
- package/.github/CODEOWNERS +63 -0
- package/.github/ISSUE_TEMPLATE/good_first_issue.md +23 -0
- package/.github/pull_request_template.md +45 -0
- package/.github/workflows/test.yml +75 -0
- package/CHANGELOG.md +1123 -0
- package/README.md +86 -553
- package/README.public.md +594 -0
- package/SECURITY.md +108 -0
- package/assets/gep/events.jsonl +3 -0
- package/examples/atp-consumer-quickstart.md +100 -0
- package/examples/hello-world.md +38 -0
- package/index.js +30 -1
- package/package.json +6 -17
- package/proxy-package.json +39 -0
- package/public.manifest.json +141 -0
- package/src/evolve/guards.js +721 -1
- package/src/evolve/pipeline/collect.js +1283 -1
- package/src/evolve/pipeline/dispatch.js +421 -1
- package/src/evolve/pipeline/enrich.js +434 -1
- package/src/evolve/pipeline/hub.js +319 -1
- package/src/evolve/pipeline/select.js +274 -1
- package/src/evolve/pipeline/signals.js +206 -1
- package/src/evolve/utils.js +264 -1
- package/src/evolve.js +350 -1
- package/src/gep/a2aProtocol.js +4395 -1
- package/src/gep/autoDistillConv.js +205 -1
- package/src/gep/autoDistillLlm.js +315 -1
- package/src/gep/candidateEval.js +92 -1
- package/src/gep/candidates.js +198 -1
- package/src/gep/contentHash.js +30 -1
- package/src/gep/conversationSniffer.js +266 -1
- package/src/gep/crypto.js +89 -1
- package/src/gep/curriculum.js +163 -1
- package/src/gep/deviceId.js +218 -1
- package/src/gep/envFingerprint.js +118 -1
- package/src/gep/epigenetics.js +31 -1
- package/src/gep/execBridge.js +711 -1
- package/src/gep/explore.js +289 -1
- package/src/gep/hash.js +15 -1
- package/src/gep/hubFetch.js +359 -1
- package/src/gep/hubReview.js +207 -1
- package/src/gep/hubSearch.js +526 -1
- package/src/gep/hubVerify.js +306 -1
- package/src/gep/learningSignals.js +89 -1
- package/src/gep/memoryGraph.js +1374 -1
- package/src/gep/memoryGraphAdapter.js +203 -1
- package/src/gep/mutation.js +203 -1
- package/src/gep/narrativeMemory.js +108 -1
- package/src/gep/oauthLogin.js +143 -0
- package/src/gep/openPRRegistry.js +205 -1
- package/src/gep/personality.js +423 -1
- package/src/gep/policyCheck.js +599 -1
- package/src/gep/prompt.js +836 -1
- package/src/gep/recallInject.js +409 -1
- package/src/gep/recallVerifier.js +318 -1
- package/src/gep/reflection.js +177 -1
- package/src/gep/selector.js +602 -1
- package/src/gep/skillDistiller.js +1294 -1
- package/src/gep/solidify.js +1699 -1
- package/src/gep/strategy.js +136 -1
- package/src/gep/tokenSavings.js +88 -1
- package/src/gep/workspaceKeychain.js +174 -1
- package/src/proxy/extensions/traceControl.js +99 -1
- package/src/proxy/inject.js +52 -1
- package/src/proxy/trace/extractor.js +534 -1
- package/src/proxy/trace/usage.js +105 -1
- package/CONTRIBUTING.md +0 -19
- package/assets/cover.png +0 -0
- package/scripts/a2a_export.js +0 -63
- package/scripts/a2a_ingest.js +0 -79
- package/scripts/a2a_promote.js +0 -118
- package/scripts/analyze_by_skill.js +0 -121
- package/scripts/build_binaries.js +0 -479
- package/scripts/check-changelog.js +0 -166
- package/scripts/extract_log.js +0 -85
- package/scripts/generate_history.js +0 -75
- package/scripts/gep_append_event.js +0 -96
- package/scripts/gep_personality_report.js +0 -234
- package/scripts/human_report.js +0 -147
- package/scripts/recall-verify-report.js +0 -234
- package/scripts/recover_loop.js +0 -61
- package/scripts/seed-merchants.js +0 -91
- package/scripts/suggest_version.js +0 -89
- package/scripts/validate-modules.js +0 -38
- package/scripts/validate-suite.js +0 -78
- package/skills/index.json +0 -14
- /package/assets/gep/{genes.seed.json → genes.json} +0 -0
- /package/{skills → bundled-skills}/_meta/SKILL.md +0 -0
|
@@ -1 +1,203 @@
|
|
|
1
|
-
const _0x56dd5a=_0x19a8;(function(_0x59a355,_0x182ef9){const _0x31e849=_0x19a8,_0x711c34=_0x59a355();while(!![]){try{const _0xf3186e=-parseInt(_0x31e849(0x180,'\x4b\x5a\x57\x4d'))/(0x456*0x4+-0x3*-0x821+-0x29ba)*(parseInt(_0x31e849(0x12d,'\x24\x4d\x50\x45'))/(-0x3a1*-0x7+0xc*-0x39+0x33f*-0x7))+parseInt(_0x31e849(0x1af,'\x76\x4f\x74\x64'))/(0x5*0x28f+0x938+-0x1600)*(parseInt(_0x31e849(0xff,'\x30\x44\x52\x6d'))/(0x1*-0x2231+-0x243b+-0x1c*-0x284))+parseInt(_0x31e849(0x161,'\x4b\x5a\x57\x4d'))/(-0x5*-0x6f8+0x1*-0x2309+0x9*0x6)*(parseInt(_0x31e849(0x18f,'\x21\x55\x72\x30'))/(-0x412+-0x3aa*-0x4+0x10*-0xa9))+-parseInt(_0x31e849(0x1bd,'\x33\x65\x33\x6c'))/(-0x1d26+-0x166f+0x339c)*(parseInt(_0x31e849(0x15f,'\x69\x73\x47\x38'))/(0x4fc+0x134*-0xc+-0x2*-0x4be))+parseInt(_0x31e849(0x196,'\x65\x75\x63\x47'))/(-0xf3*0x21+0xe79+0x83*0x21)+parseInt(_0x31e849(0x1ba,'\x33\x65\x78\x40'))/(-0x321+0x4d3*0x1+-0xd4*0x2)+-parseInt(_0x31e849(0x1be,'\x44\x47\x56\x6c'))/(0x18b7+0x5*-0x6d6+0x982)*(parseInt(_0x31e849(0x11d,'\x76\x4f\x74\x64'))/(0x21a9+-0x69*0x2f+-0xe56));if(_0xf3186e===_0x182ef9)break;else _0x711c34['push'](_0x711c34['shift']());}catch(_0x5d1ddc){_0x711c34['push'](_0x711c34['shift']());}}}(_0x5b6d,0x4bfef+0x2881+-0xf8*0x1e7));const _0xa4ab4d=require('\x2e\x2f\x6d\x65\x6d\x6f\x72\x79'+'\x47\x72\x61\x70\x68'),_0x20d07a={'\x6e\x61\x6d\x65':_0x56dd5a(0x1b6,'\x39\x26\x29\x42'),'\x67\x65\x74\x41\x64\x76\x69\x63\x65'(_0x145d68){const _0x180245=_0x56dd5a;return _0xa4ab4d['\x67\x65\x74\x4d\x65\x6d\x6f\x72'+_0x180245(0x139,'\x43\x73\x29\x55')](_0x145d68);},'\x72\x65\x63\x6f\x72\x64\x53\x69\x67\x6e\x61\x6c\x53\x6e\x61\x70\x73\x68\x6f\x74'(_0x3b7ef5){const _0x20c65f=_0x56dd5a;return _0xa4ab4d[_0x20c65f(0x10e,'\x50\x66\x78\x44')+'\x67\x6e\x61\x6c\x53\x6e\x61\x70'+_0x20c65f(0x151,'\x76\x4f\x74\x64')](_0x3b7ef5);},'\x72\x65\x63\x6f\x72\x64\x48\x79\x70\x6f\x74\x68\x65\x73\x69\x73'(_0x10d07c){const _0x46fa2b=_0x56dd5a;return _0xa4ab4d[_0x46fa2b(0x19e,'\x43\x73\x29\x55')+_0x46fa2b(0x177,'\x25\x4d\x6e\x2a')](_0x10d07c);},'\x72\x65\x63\x6f\x72\x64\x41\x74\x74\x65\x6d\x70\x74'(_0x4bb935){const _0x2cf15d=_0x56dd5a;return _0xa4ab4d[_0x2cf15d(0x153,'\x47\x4e\x65\x5b')+_0x2cf15d(0x127,'\x63\x4e\x24\x70')](_0x4bb935);},'\x72\x65\x63\x6f\x72\x64\x4f\x75\x74\x63\x6f\x6d\x65'(_0x50b84a){const _0x4be9a5=_0x56dd5a;return _0xa4ab4d[_0x4be9a5(0x18a,'\x47\x4e\x65\x5b')+_0x4be9a5(0x12c,'\x50\x66\x78\x44')+_0x4be9a5(0x19a,'\x2a\x45\x46\x62')](_0x50b84a);},'\x72\x65\x63\x6f\x72\x64\x45\x78\x74\x65\x72\x6e\x61\x6c\x43\x61\x6e\x64\x69\x64\x61\x74\x65'(_0x1c1bf0){const _0x27cac9=_0x56dd5a;return _0xa4ab4d['\x72\x65\x63\x6f\x72\x64\x45\x78'+_0x27cac9(0x144,'\x40\x37\x6f\x61')+_0x27cac9(0x1b0,'\x6d\x56\x24\x57')](_0x1c1bf0);},'\x6d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x50\x61\x74\x68'(){const _0x42cb02=_0x56dd5a;return _0xa4ab4d[_0x42cb02(0x134,'\x6a\x74\x73\x49')+_0x42cb02(0x12e,'\x5b\x33\x41\x5e')]();},'\x63\x6f\x6d\x70\x75\x74\x65\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79'(_0x1adb52){const _0x378233=_0x56dd5a;return _0xa4ab4d[_0x378233(0x149,'\x65\x75\x63\x47')+_0x378233(0x13d,'\x30\x44\x52\x6d')](_0x1adb52);},'\x74\x72\x79\x52\x65\x61\x64\x4d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x45\x76\x65\x6e\x74\x73'(_0x4a77a0){const _0x58f35b=_0x56dd5a;return _0xa4ab4d[_0x58f35b(0x186,'\x76\x4f\x74\x64')+_0x58f35b(0x115,'\x25\x4d\x6e\x2a')+'\x70\x68\x45\x76\x65\x6e\x74\x73'](_0x4a77a0);}};function _0x38113d(){const _0x57902e=_0x56dd5a,_0x4df27f={'\x79\x4a\x43\x56\x55':_0x57902e(0x119,'\x21\x55\x72\x30')+_0x57902e(0x1a8,'\x23\x54\x57\x4e')+_0x57902e(0x14b,'\x5b\x33\x41\x5e')+_0x57902e(0x10c,'\x6b\x58\x59\x44')+_0x57902e(0x1a9,'\x33\x4a\x40\x67'),'\x51\x69\x53\x5a\x7a':function(_0x128abc,_0x493f8c,_0x540847){return _0x128abc(_0x493f8c,_0x540847);},'\x57\x6a\x6a\x4e\x46':_0x57902e(0x13a,'\x44\x47\x56\x6c'),'\x44\x75\x65\x63\x47':_0x57902e(0x138,'\x70\x67\x7a\x43')+_0x57902e(0x170,'\x39\x26\x29\x42'),'\x52\x57\x79\x75\x44':function(_0x26b3d1,_0xa79984){return _0x26b3d1(_0xa79984);},'\x53\x64\x62\x76\x4d':_0x57902e(0x191,'\x54\x6a\x6d\x31')+'\x69\x73','\x50\x6d\x43\x63\x4a':_0x57902e(0x179,'\x32\x71\x61\x4a'),'\x75\x52\x4f\x6a\x71':_0x57902e(0x124,'\x32\x71\x61\x4a'),'\x59\x41\x4b\x77\x6f':function(_0x1b37d6,..._0x2e615e){return _0x1b37d6(..._0x2e615e);},'\x59\x51\x69\x4e\x5a':function(_0x35893a,_0x2040fd){return _0x35893a!==_0x2040fd;},'\x79\x6a\x66\x54\x68':_0x57902e(0x16d,'\x50\x66\x78\x44'),'\x71\x43\x54\x77\x41':_0x57902e(0x1a5,'\x25\x52\x74\x42')+'\x63\x65','\x73\x4c\x43\x58\x64':function(_0x2ffb36,_0x1b454b,_0x352928){return _0x2ffb36(_0x1b454b,_0x352928);},'\x55\x69\x76\x6a\x4e':_0x57902e(0x184,'\x39\x75\x30\x29')+'\x73\x74','\x7a\x4e\x6c\x62\x42':function(_0x2dbdcc,_0xa44f40,_0x5a38cc){return _0x2dbdcc(_0xa44f40,_0x5a38cc);},'\x4b\x47\x4f\x68\x62':_0x57902e(0x175,'\x74\x21\x33\x26'),'\x70\x70\x58\x6b\x6e':function(_0x15e042,_0x1ba451){return _0x15e042!==_0x1ba451;},'\x56\x74\x71\x64\x72':_0x57902e(0x140,'\x6a\x74\x73\x49'),'\x6c\x52\x6a\x47\x65':function(_0x10ebd6,_0x3ecefa,_0x4abdc1){return _0x10ebd6(_0x3ecefa,_0x4abdc1);},'\x74\x68\x6f\x68\x4c':_0x57902e(0x16b,'\x70\x67\x7a\x43'),'\x62\x51\x76\x47\x5a':'\x65\x78\x74\x65\x72\x6e\x61\x6c'+_0x57902e(0x1bf,'\x39\x26\x29\x42')+'\x74\x65','\x65\x4e\x78\x6a\x6b':function(_0x5b7e65,_0x1f5a5a){return _0x5b7e65(_0x1f5a5a);}},_0x2fea89=process.env.MEMORY_GRAPH_REMOTE_URL||'',_0x25ece2=process.env.MEMORY_GRAPH_REMOTE_KEY||'',_0x1ce513=_0x4df27f[_0x57902e(0x13f,'\x30\x44\x52\x6d')](Number,process.env.MEMORY_GRAPH_REMOTE_TIMEOUT_MS)||-0x19*-0x113+0x513+-0xc66;async function _0x40fe44(_0x44fa45,_0x222f7d){const _0x2441fd=_0x57902e;if(!_0x2fea89)throw new Error(_0x4df27f['\x79\x4a\x43\x56\x55']);const _0x446307=''+_0x2fea89[_0x2441fd(0x126,'\x6b\x58\x59\x44')](/\/+$/,'')+_0x44fa45,_0xf6eebc=new AbortController(),_0x13c25f=setTimeout(()=>_0xf6eebc[_0x2441fd(0x15d,'\x26\x30\x63\x68')](),_0x1ce513);try{const _0x96bd0a=await _0x4df27f[_0x2441fd(0x183,'\x54\x37\x7a\x53')](fetch,_0x446307,{'\x6d\x65\x74\x68\x6f\x64':_0x4df27f['\x57\x6a\x6a\x4e\x46'],'\x68\x65\x61\x64\x65\x72\x73':{'\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65':_0x4df27f[_0x2441fd(0x135,'\x33\x65\x78\x40')],..._0x25ece2?{'\x41\x75\x74\x68\x6f\x72\x69\x7a\x61\x74\x69\x6f\x6e':_0x2441fd(0x112,'\x65\x75\x63\x47')+_0x25ece2}:{}},'\x62\x6f\x64\x79':JSON[_0x2441fd(0x166,'\x45\x31\x76\x5d')+'\x79'](_0x222f7d),'\x73\x69\x67\x6e\x61\x6c':_0xf6eebc[_0x2441fd(0x147,'\x4b\x40\x48\x6e')]});if(!_0x96bd0a['\x6f\x6b'])throw new Error(_0x2441fd(0x10a,'\x54\x37\x7a\x53')+_0x2441fd(0x19d,'\x5b\x33\x41\x5e')+'\x20'+_0x96bd0a[_0x2441fd(0x1b5,'\x32\x43\x31\x5e')]);return await _0x96bd0a['\x6a\x73\x6f\x6e']();}finally{_0x4df27f[_0x2441fd(0x1a0,'\x70\x67\x7a\x43')](clearTimeout,_0x13c25f);}}function _0x1ff60e(_0x447e70,_0x45952c){return async function(..._0xe3140c){const _0x2783ab=_0x19a8,_0x4d1ca0={'\x4c\x59\x65\x72\x42':function(_0xbca4e2,_0x2a25a2,_0x45d7c9){const _0x22d22b=_0x19a8;return _0x4df27f[_0x22d22b(0x169,'\x51\x70\x28\x6f')](_0xbca4e2,_0x2a25a2,_0x45d7c9);},'\x6a\x51\x6e\x50\x70':'\x2f\x6b\x67\x2f\x69\x6e\x67\x65'+'\x73\x74','\x5a\x41\x74\x46\x76':_0x4df27f[_0x2783ab(0x14e,'\x26\x30\x63\x68')]};if(_0x4df27f['\x50\x6d\x43\x63\x4a']!==_0x4df27f['\x50\x6d\x43\x63\x4a']){const _0x3bdb77=_0xf352df[_0x2783ab(0x13b,'\x42\x31\x6d\x33')+_0x2783ab(0x165,'\x52\x67\x6f\x7a')](_0x2e9baa);return _0x4d1ca0[_0x2783ab(0x188,'\x37\x33\x59\x66')](_0x2c8e15,_0x4d1ca0[_0x2783ab(0x192,'\x39\x26\x29\x42')],{'\x6b\x69\x6e\x64':_0x4d1ca0[_0x2783ab(0x113,'\x39\x25\x6e\x65')],'\x65\x76\x65\x6e\x74':_0x3bdb77})[_0x2783ab(0x18c,'\x67\x23\x63\x26')](()=>{}),_0x3bdb77;}else try{return await _0x4df27f[_0x2783ab(0x1b2,'\x37\x28\x40\x75')](_0x45952c,..._0xe3140c);}catch(_0x43eb1b){return _0x4df27f['\x75\x52\x4f\x6a\x71']!==_0x4df27f['\x75\x52\x4f\x6a\x71']?_0x3d25d7[_0x2783ab(0x181,'\x45\x31\x76\x5d')+_0x2783ab(0x13e,'\x67\x23\x63\x26')+_0x2783ab(0x111,'\x70\x67\x7a\x43')](_0x4753ff):_0x4df27f[_0x2783ab(0x1a3,'\x39\x25\x6e\x65')](_0x447e70,..._0xe3140c);}};}return{'\x6e\x61\x6d\x65':_0x57902e(0x17f,'\x69\x73\x47\x38'),'\x67\x65\x74\x41\x64\x76\x69\x63\x65':_0x4df27f[_0x57902e(0x148,'\x25\x39\x72\x33')](_0x1ff60e,_0x17d5a3=>_0xa4ab4d[_0x57902e(0x194,'\x39\x26\x29\x42')+_0x57902e(0x104,'\x40\x37\x6f\x61')](_0x17d5a3),async _0x381947=>{const _0x2f13dc=_0x57902e;if(_0x4df27f[_0x2f13dc(0x19f,'\x54\x37\x7a\x53')]('\x45\x53\x69\x51\x65',_0x4df27f['\x79\x6a\x66\x54\x68']))throw new _0x1ae446(_0x2f13dc(0x171,'\x30\x44\x52\x6d')+'\x67\x5f\x65\x72\x72\x6f\x72\x3a'+'\x20'+_0x501070[_0x2f13dc(0x18b,'\x25\x4d\x6e\x2a')]);else{const _0x486a42=await _0x4df27f['\x51\x69\x53\x5a\x7a'](_0x40fe44,_0x4df27f['\x71\x43\x54\x77\x41'],{'\x73\x69\x67\x6e\x61\x6c\x73':_0x381947[_0x2f13dc(0x12f,'\x39\x26\x29\x42')],'\x67\x65\x6e\x65\x73':(_0x381947[_0x2f13dc(0x19b,'\x50\x66\x78\x44')]||[])[_0x2f13dc(0x1b7,'\x6a\x74\x73\x49')](_0x5be97c=>({'\x69\x64':_0x5be97c['\x69\x64'],'\x63\x61\x74\x65\x67\x6f\x72\x79':_0x5be97c['\x63\x61\x74\x65\x67\x6f\x72\x79'],'\x74\x79\x70\x65':_0x5be97c[_0x2f13dc(0x193,'\x25\x4d\x6e\x2a')]})),'\x64\x72\x69\x66\x74\x45\x6e\x61\x62\x6c\x65\x64':_0x381947[_0x2f13dc(0xfd,'\x6a\x74\x73\x49')+_0x2f13dc(0x16c,'\x46\x62\x63\x76')]});return{'\x63\x75\x72\x72\x65\x6e\x74\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79':_0x486a42['\x63\x75\x72\x72\x65\x6e\x74\x53'+_0x2f13dc(0x18e,'\x74\x21\x33\x26')]||_0xa4ab4d[_0x2f13dc(0x10b,'\x42\x31\x6d\x33')+_0x2f13dc(0x13d,'\x30\x44\x52\x6d')](_0x381947[_0x2f13dc(0x154,'\x43\x73\x29\x55')]),'\x70\x72\x65\x66\x65\x72\x72\x65\x64\x47\x65\x6e\x65\x49\x64':_0x486a42[_0x2f13dc(0x1b8,'\x54\x6a\x6d\x31')+_0x2f13dc(0x125,'\x4b\x40\x48\x6e')]||null,'\x62\x61\x6e\x6e\x65\x64\x47\x65\x6e\x65\x49\x64\x73':new Set(_0x486a42[_0x2f13dc(0x198,'\x4b\x40\x48\x6e')+_0x2f13dc(0x12b,'\x50\x66\x78\x44')]||[]),'\x65\x78\x70\x6c\x61\x6e\x61\x74\x69\x6f\x6e':Array[_0x2f13dc(0x131,'\x67\x23\x63\x26')](_0x486a42[_0x2f13dc(0x195,'\x40\x37\x6f\x61')+_0x2f13dc(0x185,'\x6d\x56\x24\x57')])?_0x486a42[_0x2f13dc(0x1a2,'\x37\x33\x59\x66')+_0x2f13dc(0x150,'\x33\x65\x33\x6c')]:[]};}}),'\x72\x65\x63\x6f\x72\x64\x53\x69\x67\x6e\x61\x6c\x53\x6e\x61\x70\x73\x68\x6f\x74'(_0x29cfdc){const _0x468a92=_0x57902e,_0x17842=_0xa4ab4d['\x72\x65\x63\x6f\x72\x64\x53\x69'+_0x468a92(0x182,'\x45\x31\x76\x5d')+_0x468a92(0x17c,'\x50\x66\x78\x44')](_0x29cfdc),_0x5209b6={};return _0x5209b6[_0x468a92(0x105,'\x33\x4a\x40\x67')]=_0x468a92(0x19c,'\x37\x33\x59\x66'),_0x5209b6[_0x468a92(0x14d,'\x6d\x56\x24\x57')]=_0x17842,_0x4df27f[_0x468a92(0x155,'\x39\x26\x29\x42')](_0x40fe44,_0x4df27f[_0x468a92(0x136,'\x77\x41\x6d\x28')],_0x5209b6)[_0x468a92(0x129,'\x33\x65\x33\x6c')](()=>{}),_0x17842;},'\x72\x65\x63\x6f\x72\x64\x48\x79\x70\x6f\x74\x68\x65\x73\x69\x73'(_0x37dcbd){const _0x1e3c68=_0x57902e,_0x11c068=_0xa4ab4d[_0x1e3c68(0x13c,'\x5b\x33\x41\x5e')+_0x1e3c68(0x172,'\x24\x4d\x50\x45')](_0x37dcbd);return _0x4df27f[_0x1e3c68(0x162,'\x5b\x33\x41\x5e')](_0x40fe44,_0x4df27f[_0x1e3c68(0x1ab,'\x51\x70\x28\x6f')],{'\x6b\x69\x6e\x64':_0x4df27f[_0x1e3c68(0x11e,'\x39\x26\x29\x42')],'\x65\x76\x65\x6e\x74':_0x11c068})[_0x1e3c68(0xfe,'\x70\x67\x7a\x43')](()=>{}),_0x11c068;},'\x72\x65\x63\x6f\x72\x64\x41\x74\x74\x65\x6d\x70\x74'(_0x1b2793){const _0x339f87=_0x57902e,_0x4baf30=_0xa4ab4d[_0x339f87(0x1ad,'\x2a\x45\x46\x62')+_0x339f87(0x122,'\x43\x73\x29\x55')](_0x1b2793);return _0x4df27f[_0x339f87(0x187,'\x63\x4e\x24\x70')](_0x40fe44,_0x4df27f['\x55\x69\x76\x6a\x4e'],{'\x6b\x69\x6e\x64':_0x4df27f['\x4b\x47\x4f\x68\x62'],'\x65\x76\x65\x6e\x74':_0x4baf30})[_0x339f87(0x16f,'\x54\x6a\x6d\x31')](()=>{}),_0x4baf30;},'\x72\x65\x63\x6f\x72\x64\x4f\x75\x74\x63\x6f\x6d\x65'(_0x65079d){const _0x41f60e=_0x57902e,_0x4c169b={'\x57\x4f\x78\x46\x7a':function(_0x549771,_0xe07faf,_0x217f18){const _0x5382ce=_0x19a8;return _0x4df27f[_0x5382ce(0x12a,'\x45\x31\x76\x5d')](_0x549771,_0xe07faf,_0x217f18);},'\x4e\x4d\x51\x4f\x5a':_0x4df27f['\x55\x69\x76\x6a\x4e']},_0x1c3fe3=_0xa4ab4d['\x72\x65\x63\x6f\x72\x64\x4f\x75'+_0x41f60e(0x1bb,'\x25\x52\x74\x42')+_0x41f60e(0x173,'\x6d\x56\x24\x57')](_0x65079d);if(_0x1c3fe3){if(_0x4df27f[_0x41f60e(0x1a6,'\x45\x31\x76\x5d')](_0x4df27f['\x56\x74\x71\x64\x72'],_0x41f60e(0x1ac,'\x65\x75\x63\x47')))_0x4df27f['\x6c\x52\x6a\x47\x65'](_0x40fe44,_0x4df27f[_0x41f60e(0x164,'\x37\x33\x59\x66')],{'\x6b\x69\x6e\x64':_0x4df27f[_0x41f60e(0x120,'\x4b\x5a\x57\x4d')],'\x65\x76\x65\x6e\x74':_0x1c3fe3})[_0x41f60e(0x14f,'\x44\x47\x56\x6c')](()=>{});else{const _0x319f3a={};_0x319f3a[_0x41f60e(0x142,'\x73\x73\x7a\x73')]=_0x41f60e(0x189,'\x5b\x33\x41\x5e')+_0x41f60e(0x190,'\x23\x54\x57\x4e')+'\x74\x65',_0x319f3a[_0x41f60e(0x1b4,'\x67\x23\x63\x26')]=_0x2622ac,_0x4c169b[_0x41f60e(0x137,'\x77\x41\x6d\x28')](_0x262610,_0x4c169b[_0x41f60e(0x11b,'\x21\x4f\x6c\x6c')],_0x319f3a)[_0x41f60e(0x16f,'\x54\x6a\x6d\x31')](()=>{});}}return _0x1c3fe3;},'\x72\x65\x63\x6f\x72\x64\x45\x78\x74\x65\x72\x6e\x61\x6c\x43\x61\x6e\x64\x69\x64\x61\x74\x65'(_0x18801f){const _0x1d0759=_0x57902e,_0x5be5ac=_0xa4ab4d[_0x1d0759(0x160,'\x52\x67\x6f\x7a')+_0x1d0759(0x1b3,'\x69\x73\x47\x38')+_0x1d0759(0x1a1,'\x33\x65\x78\x40')](_0x18801f);return _0x5be5ac&&_0x4df27f[_0x1d0759(0x110,'\x5b\x33\x41\x5e')](_0x40fe44,_0x4df27f['\x55\x69\x76\x6a\x4e'],{'\x6b\x69\x6e\x64':_0x4df27f[_0x1d0759(0x17b,'\x44\x47\x56\x6c')],'\x65\x76\x65\x6e\x74':_0x5be5ac})['\x63\x61\x74\x63\x68'](()=>{}),_0x5be5ac;},'\x6d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x50\x61\x74\x68'(){const _0x55ea59=_0x57902e;return _0xa4ab4d['\x6d\x65\x6d\x6f\x72\x79\x47\x72'+_0x55ea59(0x130,'\x43\x73\x29\x55')]();},'\x63\x6f\x6d\x70\x75\x74\x65\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79'(_0xb463d){const _0x5110c6=_0x57902e;return _0xa4ab4d[_0x5110c6(0x152,'\x39\x75\x30\x29')+_0x5110c6(0x17d,'\x54\x37\x7a\x53')](_0xb463d);},'\x74\x72\x79\x52\x65\x61\x64\x4d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x45\x76\x65\x6e\x74\x73'(_0x2d74cf){const _0x19b86c=_0x57902e;return _0xa4ab4d[_0x19b86c(0x121,'\x6b\x58\x59\x44')+'\x65\x6d\x6f\x72\x79\x47\x72\x61'+_0x19b86c(0x11a,'\x5b\x34\x49\x38')](_0x2d74cf);}};}function _0x57aa21(){const _0x19abe6=_0x56dd5a,_0x3ef001={'\x72\x41\x59\x43\x63':function(_0x24ff10,_0x5d8b58){return _0x24ff10!==_0x5d8b58;},'\x4a\x4d\x4e\x47\x45':function(_0x1c4b8f,_0x2d122f){return _0x1c4b8f===_0x2d122f;},'\x4c\x44\x78\x44\x71':_0x19abe6(0x15c,'\x47\x4e\x65\x5b'),'\x6a\x66\x6c\x61\x67':_0x19abe6(0x143,'\x5b\x34\x49\x38'),'\x72\x4e\x46\x6e\x79':function(_0x1fb442,_0x45aa7a){return _0x1fb442!==_0x45aa7a;},'\x49\x6a\x7a\x67\x62':_0x19abe6(0x118,'\x21\x4f\x6c\x6c'),'\x79\x58\x71\x6f\x48':'\x28\x28\x28\x2e\x2b\x29\x2b\x29'+_0x19abe6(0x103,'\x65\x75\x63\x47'),'\x70\x6d\x73\x4b\x6b':function(_0x29f45a,_0x5aa5c9,_0x3a8ea9){return _0x29f45a(_0x5aa5c9,_0x3a8ea9);},'\x73\x78\x58\x64\x4e':function(_0x3a98c3){return _0x3a98c3();},'\x55\x62\x6d\x42\x6c':function(_0x110f09,_0x21c3db){return _0x110f09===_0x21c3db;},'\x45\x53\x4a\x4c\x71':_0x19abe6(0x176,'\x21\x4f\x6c\x6c'),'\x66\x77\x51\x70\x62':_0x19abe6(0x14c,'\x33\x65\x33\x6c')},_0x1fef7d=(function(){let _0x91ae12=!![];return function(_0x3b55dd,_0x44a600){const _0x30238a=_0x19a8,_0x3b029b={'\x55\x54\x61\x42\x51':_0x30238a(0x145,'\x77\x41\x6d\x28')+'\x73\x74','\x4f\x49\x41\x66\x4e':function(_0x22489b,_0x4ec118){const _0xa255ed=_0x30238a;return _0x3ef001[_0xa255ed(0x178,'\x40\x37\x6f\x61')](_0x22489b,_0x4ec118);},'\x55\x70\x52\x7a\x52':'\x7a\x45\x63\x77\x77'};if(_0x3ef001[_0x30238a(0x18d,'\x4b\x40\x48\x6e')](_0x3ef001[_0x30238a(0x106,'\x33\x65\x33\x6c')],_0x3ef001['\x6a\x66\x6c\x61\x67'])){const _0x3ac166=_0x17ab45[_0x30238a(0x1bc,'\x5b\x6a\x32\x56')+_0x30238a(0x133,'\x70\x67\x7a\x43')+_0x30238a(0x11c,'\x33\x4a\x40\x67')](_0x23a05e);if(_0x3ac166){const _0x1a8d8a={};_0x1a8d8a[_0x30238a(0x156,'\x51\x70\x28\x6f')]='\x6f\x75\x74\x63\x6f\x6d\x65',_0x1a8d8a[_0x30238a(0x17e,'\x25\x52\x74\x42')]=_0x3ac166,_0x4a795d(RpzfQw[_0x30238a(0x15a,'\x73\x73\x7a\x73')],_0x1a8d8a)[_0x30238a(0x14a,'\x43\x73\x29\x55')](()=>{});}return _0x3ac166;}else{const _0x547d00=_0x91ae12?function(){const _0x416a2d=_0x30238a;if(_0x44a600){if(_0x3b029b[_0x416a2d(0x157,'\x30\x44\x52\x6d')](_0x416a2d(0x174,'\x24\x43\x63\x44'),_0x3b029b[_0x416a2d(0x167,'\x77\x41\x6d\x28')]))return _0x2659bb[_0x416a2d(0x10f,'\x37\x28\x40\x75')+_0x416a2d(0x159,'\x32\x71\x61\x4a')+_0x416a2d(0x11f,'\x32\x43\x31\x5e')](_0x59eb98);else{const _0x4380a6=_0x44a600[_0x416a2d(0x17a,'\x37\x33\x59\x66')](_0x3b55dd,arguments);return _0x44a600=null,_0x4380a6;}}}:function(){};return _0x91ae12=![],_0x547d00;}};}()),_0x16e2e4=_0x3ef001[_0x19abe6(0x109,'\x47\x4e\x65\x5b')](_0x1fef7d,this,function(){const _0x448c53=_0x19abe6;return _0x3ef001[_0x448c53(0x128,'\x47\x4e\x65\x5b')](_0x3ef001[_0x448c53(0x108,'\x52\x67\x6f\x7a')],_0x3ef001['\x49\x6a\x7a\x67\x62'])?_0x2e7bbb[_0x448c53(0x1b9,'\x33\x65\x78\x40')+_0x448c53(0x139,'\x43\x73\x29\x55')](_0x1ac6ef):_0x16e2e4[_0x448c53(0x117,'\x39\x25\x6e\x65')]()[_0x448c53(0x102,'\x74\x21\x33\x26')](_0x3ef001[_0x448c53(0x197,'\x47\x4e\x65\x5b')])[_0x448c53(0x101,'\x33\x65\x78\x40')]()[_0x448c53(0x168,'\x69\x73\x47\x38')+_0x448c53(0x1a7,'\x39\x26\x29\x42')](_0x16e2e4)[_0x448c53(0x163,'\x42\x31\x6d\x33')](_0x3ef001['\x79\x58\x71\x6f\x48']);});_0x3ef001[_0x19abe6(0x116,'\x45\x31\x76\x5d')](_0x16e2e4);const _0x501b30=(process.env.MEMORY_GRAPH_PROVIDER||_0x19abe6(0x1a4,'\x32\x43\x31\x5e'))['\x74\x6f\x4c\x6f\x77\x65\x72\x43'+_0x19abe6(0x132,'\x25\x39\x72\x33')]()[_0x19abe6(0x15b,'\x33\x4a\x40\x67')]();if(_0x3ef001[_0x19abe6(0x100,'\x5b\x34\x49\x38')](_0x501b30,_0x3ef001[_0x19abe6(0x15e,'\x32\x43\x31\x5e')]))return _0x3ef001[_0x19abe6(0x123,'\x46\x62\x63\x76')]!==_0x19abe6(0x1b1,'\x2a\x45\x46\x62')?_0x435d58[_0x19abe6(0x10d,'\x43\x73\x29\x55')+_0x19abe6(0x146,'\x70\x67\x7a\x43')](_0x53f238):_0x38113d();return _0x20d07a;}function _0x5b6d(){const _0x39f1a6=['\x7a\x6d\x6b\x6b\x6e\x5a\x61\x5a\x6e\x6d\x6b\x44','\x57\x4f\x53\x44\x57\x50\x75\x44\x57\x51\x75','\x57\x50\x7a\x79\x57\x37\x54\x72\x67\x61','\x43\x53\x6f\x35\x57\x4f\x54\x37\x6c\x47\x4a\x63\x48\x4a\x53','\x57\x37\x42\x64\x49\x6d\x6b\x38\x57\x4f\x4a\x64\x4b\x71','\x57\x35\x52\x64\x51\x75\x4e\x64\x56\x78\x61\x66','\x72\x5a\x71\x52\x57\x52\x68\x63\x4b\x61','\x64\x77\x54\x6c','\x57\x34\x68\x63\x52\x6d\x6f\x68\x57\x37\x68\x64\x52\x6d\x6f\x2b\x69\x4e\x30','\x57\x35\x50\x37\x57\x35\x64\x63\x49\x6d\x6f\x44\x57\x51\x61\x73\x57\x36\x6d','\x57\x4f\x38\x4d\x57\x50\x68\x64\x53\x38\x6b\x6e\x57\x37\x58\x6e\x57\x35\x35\x30\x78\x65\x78\x63\x56\x74\x4b','\x45\x76\x68\x64\x56\x53\x6b\x42\x57\x34\x56\x64\x53\x38\x6b\x67\x70\x47','\x57\x52\x69\x6e\x41\x6d\x6b\x64\x67\x67\x37\x63\x55\x6d\x6b\x62','\x57\x37\x34\x48\x57\x35\x6e\x65\x44\x43\x6b\x2f\x57\x52\x2f\x63\x55\x74\x72\x4a\x66\x61','\x57\x52\x68\x63\x4a\x38\x6b\x36\x57\x36\x75\x50\x57\x50\x4b\x31\x43\x47','\x44\x64\x47\x50\x57\x52\x37\x63\x4d\x6d\x6f\x32\x71\x4e\x71','\x6c\x6d\x6b\x78\x57\x35\x70\x64\x48\x53\x6b\x53\x65\x67\x64\x63\x53\x73\x48\x57\x57\x35\x4a\x64\x51\x78\x30','\x57\x50\x56\x64\x52\x6d\x6b\x48\x57\x50\x31\x48\x77\x43\x6b\x44','\x62\x68\x48\x73\x72\x4b\x46\x64\x4a\x4a\x78\x64\x55\x71','\x64\x4b\x57\x43\x79\x6d\x6b\x76','\x57\x35\x57\x52\x43\x4a\x6e\x76\x65\x4c\x38\x56\x62\x38\x6b\x64\x57\x4f\x71\x43\x57\x34\x69','\x57\x34\x37\x63\x53\x57\x78\x63\x47\x33\x6d','\x57\x34\x4c\x58\x57\x37\x46\x63\x53\x43\x6f\x6b\x57\x51\x71\x74\x57\x37\x79','\x57\x51\x65\x61\x57\x4f\x6a\x6b\x57\x35\x4e\x64\x56\x71','\x57\x4f\x70\x63\x51\x53\x6f\x65\x57\x36\x61','\x57\x35\x42\x64\x4b\x58\x6a\x75\x57\x52\x4f\x63\x73\x71','\x6b\x6d\x6f\x74\x57\x50\x33\x64\x4d\x61','\x57\x4f\x6e\x75\x57\x50\x4b\x59\x6e\x71','\x57\x37\x39\x68\x57\x51\x42\x63\x4f\x38\x6b\x43\x6d\x48\x2f\x63\x55\x57','\x57\x51\x76\x4b\x69\x43\x6b\x34\x57\x34\x69','\x45\x53\x6f\x37\x57\x37\x33\x64\x54\x73\x75','\x42\x6d\x6f\x6b\x57\x4f\x56\x63\x4e\x38\x6f\x54\x72\x61\x2f\x63\x4c\x71','\x57\x51\x30\x79\x57\x51\x37\x63\x48\x38\x6b\x6f\x65\x4a\x74\x63\x47\x71','\x77\x73\x74\x63\x4c\x6d\x6b\x39\x77\x32\x54\x78\x57\x34\x30','\x44\x53\x6f\x79\x57\x37\x2f\x63\x48\x43\x6b\x4d\x6c\x6d\x6f\x4d\x57\x51\x47','\x6d\x4c\x34\x4d\x57\x50\x35\x47\x57\x34\x50\x75\x62\x61','\x57\x52\x7a\x51\x57\x36\x66\x6c\x6c\x48\x6e\x58\x42\x47','\x44\x43\x6b\x49\x46\x53\x6f\x58\x57\x35\x75','\x68\x75\x75\x54\x44\x43\x6b\x79\x57\x35\x74\x64\x4d\x66\x34','\x57\x36\x52\x64\x50\x53\x6b\x6f\x57\x52\x7a\x57\x42\x53\x6f\x37','\x77\x4c\x69\x79\x57\x34\x4f\x48','\x74\x31\x46\x63\x53\x6d\x6f\x56\x57\x34\x7a\x45\x57\x51\x6e\x2f\x67\x57','\x6b\x38\x6f\x66\x57\x51\x33\x63\x52\x59\x2f\x63\x50\x53\x6f\x44\x57\x36\x79','\x76\x72\x53\x50\x6b\x43\x6f\x52','\x44\x68\x57\x2f\x57\x37\x47\x4c\x61\x43\x6f\x43\x57\x37\x43','\x57\x50\x70\x64\x56\x5a\x42\x63\x48\x33\x43','\x57\x50\x61\x66\x57\x36\x75\x78\x64\x78\x52\x64\x50\x38\x6f\x4c','\x57\x36\x56\x63\x55\x73\x33\x63\x54\x33\x4f\x53\x57\x52\x42\x63\x53\x57','\x57\x50\x56\x64\x4e\x49\x6c\x63\x52\x4d\x47','\x6c\x53\x6f\x50\x57\x4f\x46\x64\x4e\x78\x4e\x63\x4d\x57','\x57\x50\x79\x59\x78\x43\x6b\x67\x64\x4d\x2f\x64\x55\x38\x6f\x6c\x57\x52\x74\x64\x54\x6d\x6f\x74\x72\x53\x6b\x77','\x45\x64\x38\x51\x57\x51\x42\x63\x53\x71','\x57\x34\x46\x64\x55\x75\x68\x64\x52\x77\x71\x63\x57\x35\x65','\x62\x43\x6f\x31\x57\x50\x37\x63\x54\x38\x6f\x38','\x71\x5a\x4e\x63\x4d\x43\x6f\x70\x78\x77\x76\x44\x57\x36\x79','\x79\x43\x6f\x73\x57\x37\x2f\x63\x48\x43\x6b\x4e','\x57\x52\x6a\x48\x57\x50\x56\x63\x56\x4a\x34','\x57\x35\x75\x4d\x69\x53\x6b\x79\x57\x50\x61','\x6d\x6d\x6f\x79\x57\x52\x33\x63\x4c\x63\x42\x64\x4d\x38\x6f\x59','\x72\x73\x37\x63\x4b\x6d\x6f\x58\x77\x77\x44\x43','\x57\x51\x47\x74\x72\x49\x57\x56','\x45\x6d\x6f\x79\x57\x34\x4a\x64\x4b\x64\x43','\x57\x51\x58\x58\x57\x50\x75\x76\x6c\x61','\x76\x73\x38\x59\x66\x43\x6f\x62','\x6c\x4c\x34\x6d\x57\x50\x76\x48','\x6e\x66\x47\x51\x57\x50\x58\x33\x57\x36\x48\x31\x61\x47','\x7a\x77\x33\x63\x4e\x43\x6b\x32\x57\x51\x5a\x64\x55\x43\x6f\x78\x57\x37\x5a\x63\x4f\x6d\x6b\x59','\x45\x6d\x6b\x61\x46\x6d\x6f\x4d\x57\x35\x68\x64\x4c\x53\x6b\x70','\x77\x64\x69\x56\x57\x52\x37\x63\x4e\x43\x6f\x5a\x76\x71','\x44\x6d\x6f\x68\x57\x37\x52\x63\x50\x43\x6b\x59\x6c\x6d\x6f\x52','\x57\x37\x52\x64\x4a\x43\x6b\x79\x57\x50\x74\x64\x4c\x57\x4a\x64\x4c\x61','\x57\x37\x68\x63\x4b\x66\x75','\x67\x75\x34\x68\x42\x53\x6b\x79\x57\x37\x5a\x64\x4e\x4b\x69','\x64\x77\x39\x77\x74\x30\x68\x64\x53\x48\x5a\x64\x51\x47','\x57\x37\x4c\x52\x57\x34\x68\x63\x50\x53\x6f\x2f','\x6b\x61\x52\x64\x53\x53\x6f\x38\x57\x35\x47','\x6b\x49\x5a\x64\x56\x6d\x6f\x71\x57\x36\x57','\x64\x66\x30\x79\x42\x38\x6b\x75\x57\x35\x4e\x64\x4a\x76\x4b','\x42\x6d\x6f\x32\x57\x37\x42\x63\x47\x38\x6b\x36\x6f\x38\x6f\x4d','\x57\x35\x64\x64\x53\x43\x6b\x46\x57\x35\x43','\x57\x52\x57\x73\x57\x51\x64\x63\x4d\x6d\x6b\x6a\x61\x48\x4e\x63\x51\x57','\x41\x38\x6b\x76\x44\x38\x6f\x7a\x57\x34\x6c\x64\x48\x53\x6b\x56\x57\x36\x6d','\x57\x4f\x72\x35\x6a\x67\x75\x6f\x41\x57\x34\x31','\x57\x37\x42\x64\x4b\x38\x6b\x32\x57\x50\x74\x64\x4e\x63\x37\x64\x4e\x38\x6f\x6f','\x57\x4f\x48\x71\x6d\x4d\x34\x6a','\x66\x4b\x62\x51\x42\x30\x75','\x57\x50\x4a\x63\x52\x62\x56\x63\x55\x31\x65\x33\x57\x35\x31\x4f\x57\x51\x58\x61','\x57\x50\x37\x64\x49\x6d\x6b\x6e\x57\x51\x79','\x57\x35\x74\x63\x4e\x72\x56\x63\x49\x4b\x57','\x57\x35\x56\x64\x54\x57\x72\x6d\x57\x52\x69\x6e\x42\x57\x71','\x75\x47\x4a\x64\x4f\x38\x6b\x35\x57\x37\x39\x4e\x57\x50\x35\x6f','\x62\x65\x4f\x67\x79\x53\x6b\x72\x57\x37\x68\x64\x49\x76\x71','\x6a\x38\x6f\x32\x57\x52\x2f\x63\x4c\x63\x6c\x64\x56\x47','\x57\x36\x52\x63\x52\x76\x5a\x63\x50\x4a\x4b','\x57\x34\x56\x64\x52\x6d\x6b\x63\x57\x52\x72\x47\x41\x6d\x6b\x2b\x6e\x47','\x44\x53\x6f\x77\x57\x36\x42\x63\x4c\x53\x6b\x37','\x76\x53\x6b\x4b\x75\x43\x6f\x50\x57\x36\x78\x64\x53\x6d\x6b\x52\x57\x52\x4f','\x57\x51\x54\x38\x57\x4f\x43\x63\x6e\x61','\x42\x38\x6b\x79\x6f\x5a\x4f\x4d','\x63\x6d\x6b\x2f\x57\x37\x4a\x63\x55\x53\x6f\x38','\x57\x36\x70\x64\x4e\x38\x6b\x34\x57\x36\x61\x56','\x57\x51\x7a\x2f\x57\x4f\x38','\x57\x35\x31\x52\x61\x43\x6f\x62','\x6d\x53\x6b\x37\x77\x38\x6f\x31\x57\x51\x52\x63\x55\x4c\x6e\x42','\x45\x6d\x6f\x5a\x57\x36\x33\x64\x4b\x74\x5a\x63\x53\x6d\x6b\x4f\x57\x37\x65','\x7a\x53\x6f\x45\x57\x37\x78\x63\x4d\x38\x6b\x59\x6e\x6d\x6f\x57','\x77\x62\x43\x6c\x57\x4f\x4a\x63\x4d\x61','\x57\x36\x64\x63\x48\x62\x31\x46','\x57\x51\x6a\x78\x63\x32\x69\x53','\x57\x34\x76\x4d\x57\x51\x2f\x63\x47\x43\x6f\x68\x77\x6d\x6b\x55\x57\x52\x54\x42\x79\x53\x6b\x4a','\x57\x35\x47\x6d\x67\x38\x6b\x74\x57\x51\x46\x63\x55\x6d\x6b\x52\x6f\x47','\x57\x51\x64\x64\x54\x43\x6b\x63\x57\x4f\x64\x63\x50\x61','\x6e\x38\x6f\x69\x57\x50\x52\x64\x4b\x71','\x72\x38\x6f\x46\x57\x35\x5a\x64\x52\x73\x53','\x6f\x53\x6b\x35\x57\x37\x78\x63\x56\x53\x6f\x66','\x57\x36\x5a\x64\x4a\x4d\x6c\x64\x48\x78\x71','\x6d\x53\x6b\x52\x57\x34\x54\x39\x69\x74\x37\x63\x47\x4a\x35\x2f','\x57\x50\x35\x52\x6f\x6d\x6b\x57\x57\x35\x69\x31\x75\x43\x6f\x58','\x71\x6d\x6b\x54\x57\x50\x74\x63\x49\x38\x6f\x78\x57\x34\x70\x64\x4e\x38\x6f\x79','\x79\x38\x6b\x2b\x45\x6d\x6f\x75\x57\x37\x69','\x57\x52\x30\x73\x57\x51\x6c\x63\x48\x43\x6b\x79\x64\x47','\x57\x51\x65\x2b\x57\x36\x56\x64\x4d\x43\x6b\x34','\x57\x50\x58\x48\x6c\x38\x6b\x33\x57\x34\x75\x49\x46\x43\x6f\x36','\x76\x72\x43\x64\x6a\x6d\x6f\x6c\x6d\x59\x56\x64\x50\x61','\x6b\x62\x70\x64\x4c\x53\x6f\x53\x57\x34\x71','\x7a\x43\x6f\x5a\x57\x50\x44\x4d\x6f\x58\x42\x63\x53\x64\x4b','\x57\x35\x52\x63\x48\x63\x62\x48\x57\x35\x57','\x57\x36\x6e\x75\x57\x50\x76\x45\x57\x35\x74\x64\x55\x38\x6f\x67\x78\x71','\x61\x4c\x47\x43\x79\x6d\x6b\x73\x57\x35\x46\x64\x49\x71','\x57\x52\x7a\x36\x57\x51\x2f\x63\x51\x47','\x62\x77\x47\x53\x57\x51\x62\x33','\x70\x53\x6f\x7a\x42\x64\x57\x38\x67\x53\x6b\x2f\x57\x36\x58\x49','\x57\x35\x6c\x63\x56\x38\x6f\x77\x57\x37\x74\x64\x4f\x71','\x71\x4a\x71\x4d\x57\x37\x2f\x63\x4c\x53\x6f\x53\x73\x78\x53','\x57\x50\x39\x37\x6a\x32\x53\x77\x72\x74\x71\x4e','\x6a\x64\x70\x64\x4d\x53\x6f\x53\x57\x50\x33\x64\x49\x38\x6f\x78\x57\x35\x38','\x7a\x38\x6b\x39\x6b\x4a\x75\x4d\x6a\x71','\x57\x4f\x53\x56\x44\x38\x6b\x42\x57\x50\x30','\x57\x52\x6d\x72\x57\x50\x44\x44\x57\x35\x46\x64\x50\x43\x6f\x38','\x57\x51\x46\x64\x54\x48\x37\x63\x4a\x4b\x42\x63\x54\x61','\x70\x53\x6f\x68\x57\x52\x42\x63\x54\x74\x70\x63\x4b\x53\x6f\x67\x57\x37\x71','\x57\x35\x33\x64\x4b\x59\x39\x48\x57\x52\x61','\x57\x34\x38\x55\x68\x53\x6b\x38\x57\x4f\x34','\x57\x50\x75\x4e\x57\x36\x33\x64\x4e\x38\x6b\x70','\x57\x36\x6c\x64\x52\x38\x6b\x36\x57\x34\x71\x44','\x6d\x31\x6d\x51\x57\x4f\x75','\x44\x38\x6f\x69\x57\x4f\x4a\x63\x4b\x43\x6f\x31\x41\x4a\x78\x63\x48\x57','\x41\x65\x74\x64\x54\x6d\x6b\x79\x57\x35\x4f','\x44\x6d\x6f\x35\x57\x50\x72\x36\x6f\x57\x65','\x71\x38\x6b\x50\x57\x34\x78\x63\x50\x53\x6f\x47\x57\x34\x64\x64\x49\x38\x6f\x4c\x57\x52\x43','\x75\x48\x65\x69\x68\x38\x6f\x61\x6e\x73\x42\x64\x4a\x57','\x71\x71\x30\x71\x69\x43\x6f\x32\x6f\x49\x70\x64\x53\x47','\x74\x38\x6f\x67\x57\x52\x78\x63\x51\x53\x6f\x4a','\x46\x53\x6b\x2f\x75\x43\x6b\x51\x57\x52\x42\x63\x4f\x66\x66\x54','\x79\x38\x6b\x62\x6d\x61','\x57\x35\x50\x58\x66\x38\x6f\x4e\x77\x5a\x46\x63\x51\x43\x6f\x32','\x57\x51\x79\x34\x72\x5a\x34\x7a','\x57\x52\x47\x6f\x57\x37\x4a\x64\x47\x43\x6b\x30','\x46\x6d\x6b\x69\x79\x6d\x6f\x74\x57\x34\x6c\x64\x4a\x6d\x6b\x67\x57\x37\x79','\x45\x6d\x6f\x5a\x57\x36\x33\x64\x4b\x74\x5a\x63\x53\x6d\x6b\x4d\x57\x37\x61','\x70\x43\x6f\x43\x57\x51\x70\x63\x51\x73\x70\x63\x4b\x47','\x57\x37\x64\x64\x4e\x38\x6b\x54\x57\x4f\x78\x64\x4a\x71','\x68\x53\x6f\x73\x57\x50\x42\x63\x56\x71\x79','\x57\x52\x53\x63\x57\x4f\x31\x7a\x57\x35\x42\x64\x4e\x53\x6f\x54\x7a\x47','\x57\x36\x48\x32\x57\x50\x66\x55\x42\x48\x78\x64\x54\x38\x6f\x6b\x79\x43\x6f\x69\x76\x38\x6b\x5a','\x6a\x53\x6b\x4f\x57\x35\x2f\x63\x48\x53\x6b\x76\x67\x6d\x6b\x6d\x42\x71','\x57\x35\x4e\x63\x50\x38\x6f\x73\x57\x37\x4a\x64\x56\x43\x6f\x4b\x6e\x77\x53','\x71\x71\x4f\x4d\x57\x4f\x64\x63\x4a\x61','\x6f\x53\x6f\x72\x57\x52\x6c\x63\x55\x61','\x74\x64\x34\x38\x57\x50\x33\x63\x4d\x43\x6f\x59\x73\x77\x43','\x57\x34\x52\x64\x51\x47\x7a\x6f\x57\x52\x69\x70\x74\x72\x65','\x57\x50\x52\x63\x53\x53\x6f\x42\x57\x37\x30\x49\x6c\x43\x6f\x4f\x65\x53\x6f\x67\x63\x53\x6b\x4b\x69\x4c\x30','\x43\x38\x6f\x6f\x57\x37\x2f\x64\x4b\x71\x79','\x6e\x53\x6f\x2b\x57\x52\x42\x63\x4c\x63\x42\x64\x54\x53\x6f\x72\x6f\x47','\x57\x37\x39\x63\x57\x37\x56\x64\x47\x6d\x6f\x6d\x76\x67\x78\x63\x53\x43\x6b\x33\x57\x51\x62\x65\x57\x4f\x58\x6d','\x57\x4f\x69\x49\x57\x4f\x43\x69\x57\x51\x68\x64\x4d\x57','\x6a\x31\x34\x52\x57\x50\x72\x48','\x57\x4f\x43\x2b\x57\x37\x52\x64\x4e\x43\x6b\x78\x44\x47','\x46\x53\x6b\x56\x43\x43\x6f\x65\x57\x34\x6c\x64\x4a\x43\x6b\x76\x57\x51\x61','\x7a\x38\x6f\x73\x57\x37\x68\x63\x4d\x53\x6b\x48\x70\x6d\x6f\x6c\x57\x4f\x69','\x72\x38\x6f\x2b\x57\x4f\x2f\x63\x56\x53\x6f\x64','\x70\x33\x4f\x72\x44\x53\x6b\x35','\x57\x35\x6e\x36\x57\x34\x33\x63\x4f\x43\x6f\x7a\x57\x52\x4b\x79','\x57\x50\x65\x56\x57\x36\x33\x64\x4e\x38\x6b\x78\x44\x6d\x6b\x41\x57\x51\x65','\x77\x76\x69\x4e\x57\x37\x53\x34','\x57\x34\x78\x64\x53\x4b\x56\x64\x51\x67\x4b','\x69\x4c\x4e\x64\x54\x53\x6f\x7a\x57\x34\x2f\x64\x4b\x43\x6b\x63\x6f\x61','\x76\x48\x6d\x50\x6a\x53\x6f\x6c','\x78\x5a\x71\x36','\x6b\x38\x6b\x6b\x57\x36\x37\x63\x4f\x6d\x6b\x55\x69\x38\x6b\x54\x71\x71','\x6b\x53\x6f\x44\x57\x4f\x42\x64\x4a\x4d\x4a\x63\x4d\x47','\x57\x4f\x4e\x64\x52\x38\x6b\x72\x57\x51\x74\x63\x55\x43\x6b\x31\x7a\x4d\x47\x74\x57\x37\x6c\x63\x55\x43\x6f\x78\x70\x57','\x57\x35\x37\x63\x48\x61\x76\x72\x57\x36\x47','\x57\x36\x70\x64\x49\x6d\x6b\x39\x57\x4f\x48\x4e','\x57\x50\x30\x75\x57\x50\x61\x67\x57\x51\x46\x64\x4d\x53\x6f\x46\x57\x52\x61','\x57\x4f\x4f\x6a\x57\x4f\x6d\x67\x57\x51\x46\x64\x49\x53\x6f\x54','\x57\x50\x31\x53\x69\x6d\x6f\x53\x73\x48\x70\x63\x49\x57'];_0x5b6d=function(){return _0x39f1a6;};return _0x5b6d();}function _0x19a8(_0x32d454,_0x40a578){_0x32d454=_0x32d454-(0x1dfd+0x247e+-0x417e);const _0x340107=_0x5b6d();let _0x1e9dc2=_0x340107[_0x32d454];if(_0x19a8['\x65\x47\x53\x4d\x4c\x58']===undefined){var _0x4aadca=function(_0x466c7c){const _0x59314b='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x3dc878='',_0x374878='',_0x33ea92=_0x3dc878+_0x4aadca,_0x366ec5=(''+function(){return 0x23d6+0x1*-0x120d+-0x11c9*0x1;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!==-(-0x1*0x6f7+0x21ee+-0x1af6);for(let _0x4c621f=0x1c61+0x154b+0x16*-0x242,_0x193c38,_0x5b48a2,_0x3236cd=-0x1b5e+0xba2*-0x2+-0x1951*-0x2;_0x5b48a2=_0x466c7c['\x63\x68\x61\x72\x41\x74'](_0x3236cd++);~_0x5b48a2&&(_0x193c38=_0x4c621f%(0x1*0x1239+0x112+-0x3db*0x5)?_0x193c38*(0x175+-0x8*0x409+0x1f13)+_0x5b48a2:_0x5b48a2,_0x4c621f++%(0x2497+-0xddf+-0x16b4))?_0x3dc878+=_0x366ec5||_0x33ea92['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x3236cd+(-0x3*0x5ae+0x1a87+0x29*-0x3b))-(-0x27*0x15+0xc39+-0x64*0x17)!==0x1d00+-0x21cb+-0x199*-0x3?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x1a9d+-0x1258*0x2+0x404c&_0x193c38>>(-(-0x940+0x1317+0x9d5*-0x1)*_0x4c621f&-0x12a+-0xd5b+0xe8b)):_0x4c621f:0x15f2+-0x258e+0xf9c){_0x5b48a2=_0x59314b['\x69\x6e\x64\x65\x78\x4f\x66'](_0x5b48a2);}for(let _0x28d2a5=0x1ffe+0xcaf+-0x1*0x2cad,_0x44588e=_0x3dc878['\x6c\x65\x6e\x67\x74\x68'];_0x28d2a5<_0x44588e;_0x28d2a5++){_0x374878+='\x25'+('\x30\x30'+_0x3dc878['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x28d2a5)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0xde5*-0x2+-0x1570+0x314a))['\x73\x6c\x69\x63\x65'](-(0x14e*-0x6+0x74a+0x23*0x4));}return decodeURIComponent(_0x374878);};const _0x3265f3=function(_0x5e2486,_0x13d5ec){let _0x15cebb=[],_0x10d3ed=0xa*-0x2f+0x10c*-0x2+0x3ee,_0x58ba42,_0x215a2f='';_0x5e2486=_0x4aadca(_0x5e2486);let _0xf320e3;for(_0xf320e3=-0x26e2+-0x12f7*-0x2+-0xf4*-0x1;_0xf320e3<0x107f*-0x1+0x1*0x1e1+0x2*0x7cf;_0xf320e3++){_0x15cebb[_0xf320e3]=_0xf320e3;}for(_0xf320e3=0x1f92+-0x293*0x3+-0x1*0x17d9;_0xf320e3<0x1671+-0x3e*-0x40+-0xc1*0x31;_0xf320e3++){_0x10d3ed=(_0x10d3ed+_0x15cebb[_0xf320e3]+_0x13d5ec['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xf320e3%_0x13d5ec['\x6c\x65\x6e\x67\x74\x68']))%(-0x1*-0x184a+0x7*-0x515+-0x25*-0x55),_0x58ba42=_0x15cebb[_0xf320e3],_0x15cebb[_0xf320e3]=_0x15cebb[_0x10d3ed],_0x15cebb[_0x10d3ed]=_0x58ba42;}_0xf320e3=0x1*-0x481+-0x959*0x3+-0x208c*-0x1,_0x10d3ed=-0x26a6+0x59*-0x11+-0xbb*-0x3d;for(let _0x4df080=-0x21f3+0x1494+0xd5f;_0x4df080<_0x5e2486['\x6c\x65\x6e\x67\x74\x68'];_0x4df080++){_0xf320e3=(_0xf320e3+(-0x3*-0x4a5+0x2*0xc6d+0x49*-0x88))%(-0xc56+0x53c+0x22*0x3d),_0x10d3ed=(_0x10d3ed+_0x15cebb[_0xf320e3])%(0x9ce+0x1a8f+-0x235d),_0x58ba42=_0x15cebb[_0xf320e3],_0x15cebb[_0xf320e3]=_0x15cebb[_0x10d3ed],_0x15cebb[_0x10d3ed]=_0x58ba42,_0x215a2f+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x5e2486['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4df080)^_0x15cebb[(_0x15cebb[_0xf320e3]+_0x15cebb[_0x10d3ed])%(-0x119d+-0x1565*-0x1+-0x2c8)]);}return _0x215a2f;};_0x19a8['\x42\x76\x4f\x46\x4a\x45']=_0x3265f3,_0x19a8['\x75\x53\x4e\x41\x55\x43']={},_0x19a8['\x65\x47\x53\x4d\x4c\x58']=!![];}const _0x2bd2d1=_0x340107[-0x4ae+0x1488+0x2*-0x7ed],_0x1ce335=_0x32d454+_0x2bd2d1,_0x20390a=_0x19a8['\x75\x53\x4e\x41\x55\x43'][_0x1ce335];if(!_0x20390a){if(_0x19a8['\x47\x57\x63\x46\x6f\x4b']===undefined){const _0x170c9b=function(_0x5ecdb5){this['\x72\x42\x70\x49\x71\x4b']=_0x5ecdb5,this['\x64\x66\x4c\x72\x49\x6a']=[0x15a*-0x8+-0x4a0*-0x4+0x7*-0x119,-0x1*0xaf1+0xf6a+-0x479,-0x11ab*0x2+-0xdb1*-0x2+-0x3fa*-0x2],this['\x76\x5a\x61\x69\x61\x5a']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x66\x58\x71\x52\x6b\x69']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x72\x61\x4d\x51\x67\x62']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x170c9b['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x73\x6d\x48\x64\x76\x53']=function(){const _0x21ff3b=new RegExp(this['\x66\x58\x71\x52\x6b\x69']+this['\x72\x61\x4d\x51\x67\x62']),_0x42b234=_0x21ff3b['\x74\x65\x73\x74'](this['\x76\x5a\x61\x69\x61\x5a']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x64\x66\x4c\x72\x49\x6a'][-0x1997*-0x1+-0xe6c+-0xb2a]:--this['\x64\x66\x4c\x72\x49\x6a'][-0x980+-0xf92+0x1912];return this['\x44\x46\x6b\x68\x75\x43'](_0x42b234);},_0x170c9b['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x44\x46\x6b\x68\x75\x43']=function(_0x58a03f){if(!Boolean(~_0x58a03f))return _0x58a03f;return this['\x74\x59\x43\x61\x4f\x73'](this['\x72\x42\x70\x49\x71\x4b']);},_0x170c9b['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x74\x59\x43\x61\x4f\x73']=function(_0x2b8b72){for(let _0x2ad4a1=0xde8+-0x55e+-0x88a,_0x360168=this['\x64\x66\x4c\x72\x49\x6a']['\x6c\x65\x6e\x67\x74\x68'];_0x2ad4a1<_0x360168;_0x2ad4a1++){this['\x64\x66\x4c\x72\x49\x6a']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x360168=this['\x64\x66\x4c\x72\x49\x6a']['\x6c\x65\x6e\x67\x74\x68'];}return _0x2b8b72(this['\x64\x66\x4c\x72\x49\x6a'][0x10f4+-0x13d9+-0xf7*-0x3]);},(''+function(){return-0x14*-0x6f+-0x10c*-0x19+-0x22d8;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')===-(-0x1*0x1924+0x95+-0xc48*-0x2)&&new _0x170c9b(_0x19a8)['\x73\x6d\x48\x64\x76\x53'](),_0x19a8['\x47\x57\x63\x46\x6f\x4b']=!![];}_0x1e9dc2=_0x19a8['\x42\x76\x4f\x46\x4a\x45'](_0x1e9dc2,_0x40a578),_0x19a8['\x75\x53\x4e\x41\x55\x43'][_0x1ce335]=_0x1e9dc2;}else _0x1e9dc2=_0x20390a;return _0x1e9dc2;}const _0x1a4f89=_0x57aa21();module[_0x56dd5a(0x1ae,'\x2a\x45\x46\x62')]=_0x1a4f89;
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// MemoryGraphAdapter -- stable interface boundary for memory graph operations.
|
|
3
|
+
//
|
|
4
|
+
// Default implementation delegates to the local JSONL-based memoryGraph.js.
|
|
5
|
+
// SaaS providers can supply a remote adapter by setting MEMORY_GRAPH_PROVIDER=remote
|
|
6
|
+
// and configuring MEMORY_GRAPH_REMOTE_URL / MEMORY_GRAPH_REMOTE_KEY.
|
|
7
|
+
//
|
|
8
|
+
// The adapter is designed so that the open-source evolver always works offline
|
|
9
|
+
// with the local implementation. Remote is optional and degrades gracefully.
|
|
10
|
+
// ---------------------------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
const localGraph = require('./memoryGraph');
|
|
13
|
+
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
// Adapter interface contract (all methods must be implemented by providers):
|
|
16
|
+
//
|
|
17
|
+
// getAdvice({ signals, genes, driftEnabled }) => { preferredGeneId, bannedGeneIds, currentSignalKey, explanation }
|
|
18
|
+
// recordSignalSnapshot({ signals, observations }) => event
|
|
19
|
+
// recordHypothesis({ signals, mutation, personality_state, selectedGene, selector, driftEnabled, selectedBy, capsulesUsed, observations }) => { hypothesisId, signalKey }
|
|
20
|
+
// recordAttempt({ signals, mutation, personality_state, selectedGene, selector, driftEnabled, selectedBy, hypothesisId, capsulesUsed, observations }) => { actionId, signalKey }
|
|
21
|
+
// recordOutcome({ signals, observations }) => event | null
|
|
22
|
+
// recordExternalCandidate({ asset, source, signals }) => event | null
|
|
23
|
+
// memoryGraphPath() => string
|
|
24
|
+
// computeSignalKey(signals) => string
|
|
25
|
+
// tryReadMemoryGraphEvents(limit) => event[]
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
// ---------------------------------------------------------------------------
|
|
29
|
+
// Local adapter (default) -- wraps memoryGraph.js without any behavior change
|
|
30
|
+
// ---------------------------------------------------------------------------
|
|
31
|
+
|
|
32
|
+
const localAdapter = {
|
|
33
|
+
name: 'local',
|
|
34
|
+
|
|
35
|
+
getAdvice(opts) {
|
|
36
|
+
return localGraph.getMemoryAdvice(opts);
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
recordSignalSnapshot(opts) {
|
|
40
|
+
return localGraph.recordSignalSnapshot(opts);
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
recordHypothesis(opts) {
|
|
44
|
+
return localGraph.recordHypothesis(opts);
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
recordAttempt(opts) {
|
|
48
|
+
return localGraph.recordAttempt(opts);
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
recordOutcome(opts) {
|
|
52
|
+
return localGraph.recordOutcomeFromState(opts);
|
|
53
|
+
},
|
|
54
|
+
|
|
55
|
+
recordExternalCandidate(opts) {
|
|
56
|
+
return localGraph.recordExternalCandidate(opts);
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
memoryGraphPath() {
|
|
60
|
+
return localGraph.memoryGraphPath();
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
computeSignalKey(signals) {
|
|
64
|
+
return localGraph.computeSignalKey(signals);
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
tryReadMemoryGraphEvents(limit) {
|
|
68
|
+
return localGraph.tryReadMemoryGraphEvents(limit);
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// ---------------------------------------------------------------------------
|
|
73
|
+
// Remote adapter (SaaS) -- calls external KG service with local fallback
|
|
74
|
+
// ---------------------------------------------------------------------------
|
|
75
|
+
|
|
76
|
+
function buildRemoteAdapter() {
|
|
77
|
+
const remoteUrl = process.env.MEMORY_GRAPH_REMOTE_URL || '';
|
|
78
|
+
const remoteKey = process.env.MEMORY_GRAPH_REMOTE_KEY || '';
|
|
79
|
+
const timeoutMs = Number(process.env.MEMORY_GRAPH_REMOTE_TIMEOUT_MS) || 5000;
|
|
80
|
+
|
|
81
|
+
async function remoteCall(endpoint, body) {
|
|
82
|
+
if (!remoteUrl) throw new Error('MEMORY_GRAPH_REMOTE_URL not configured');
|
|
83
|
+
const url = `${remoteUrl.replace(/\/+$/, '')}${endpoint}`;
|
|
84
|
+
const controller = new AbortController();
|
|
85
|
+
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
86
|
+
try {
|
|
87
|
+
const res = await fetch(url, {
|
|
88
|
+
method: 'POST',
|
|
89
|
+
headers: {
|
|
90
|
+
'Content-Type': 'application/json',
|
|
91
|
+
...(remoteKey ? { Authorization: `Bearer ${remoteKey}` } : {}),
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify(body),
|
|
94
|
+
signal: controller.signal,
|
|
95
|
+
});
|
|
96
|
+
if (!res.ok) {
|
|
97
|
+
throw new Error(`remote_kg_error: ${res.status}`);
|
|
98
|
+
}
|
|
99
|
+
return await res.json();
|
|
100
|
+
} finally {
|
|
101
|
+
clearTimeout(timer);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Wrap remote call with local fallback -- ensures offline resilience.
|
|
106
|
+
function withFallback(localFn, remoteFn) {
|
|
107
|
+
return async function (...args) {
|
|
108
|
+
try {
|
|
109
|
+
return await remoteFn(...args);
|
|
110
|
+
} catch (e) {
|
|
111
|
+
// Fallback to local on any remote failure (network, timeout, config).
|
|
112
|
+
return localFn(...args);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
return {
|
|
118
|
+
name: 'remote',
|
|
119
|
+
|
|
120
|
+
// getAdvice is the primary candidate for remote enhancement (richer graph reasoning).
|
|
121
|
+
getAdvice: withFallback(
|
|
122
|
+
(opts) => localGraph.getMemoryAdvice(opts),
|
|
123
|
+
async (opts) => {
|
|
124
|
+
const result = await remoteCall('/kg/advice', {
|
|
125
|
+
signals: opts.signals,
|
|
126
|
+
genes: (opts.genes || []).map((g) => ({ id: g.id, category: g.category, type: g.type })),
|
|
127
|
+
driftEnabled: opts.driftEnabled,
|
|
128
|
+
});
|
|
129
|
+
// Normalize remote response to match local contract.
|
|
130
|
+
return {
|
|
131
|
+
currentSignalKey: result.currentSignalKey || localGraph.computeSignalKey(opts.signals),
|
|
132
|
+
preferredGeneId: result.preferredGeneId || null,
|
|
133
|
+
bannedGeneIds: new Set(result.bannedGeneIds || []),
|
|
134
|
+
explanation: Array.isArray(result.explanation) ? result.explanation : [],
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
),
|
|
138
|
+
|
|
139
|
+
// Write operations: always write locally first, then async-sync to remote.
|
|
140
|
+
// This preserves the append-only local graph as source of truth.
|
|
141
|
+
recordSignalSnapshot(opts) {
|
|
142
|
+
const ev = localGraph.recordSignalSnapshot(opts);
|
|
143
|
+
remoteCall('/kg/ingest', { kind: 'signal', event: ev }).catch(() => {});
|
|
144
|
+
return ev;
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
recordHypothesis(opts) {
|
|
148
|
+
const result = localGraph.recordHypothesis(opts);
|
|
149
|
+
remoteCall('/kg/ingest', { kind: 'hypothesis', event: result }).catch(() => {});
|
|
150
|
+
return result;
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
recordAttempt(opts) {
|
|
154
|
+
const result = localGraph.recordAttempt(opts);
|
|
155
|
+
remoteCall('/kg/ingest', { kind: 'attempt', event: result }).catch(() => {});
|
|
156
|
+
return result;
|
|
157
|
+
},
|
|
158
|
+
|
|
159
|
+
recordOutcome(opts) {
|
|
160
|
+
const ev = localGraph.recordOutcomeFromState(opts);
|
|
161
|
+
if (ev) {
|
|
162
|
+
remoteCall('/kg/ingest', { kind: 'outcome', event: ev }).catch(() => {});
|
|
163
|
+
}
|
|
164
|
+
return ev;
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
recordExternalCandidate(opts) {
|
|
168
|
+
const ev = localGraph.recordExternalCandidate(opts);
|
|
169
|
+
if (ev) {
|
|
170
|
+
remoteCall('/kg/ingest', { kind: 'external_candidate', event: ev }).catch(() => {});
|
|
171
|
+
}
|
|
172
|
+
return ev;
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
memoryGraphPath() {
|
|
176
|
+
return localGraph.memoryGraphPath();
|
|
177
|
+
},
|
|
178
|
+
|
|
179
|
+
computeSignalKey(signals) {
|
|
180
|
+
return localGraph.computeSignalKey(signals);
|
|
181
|
+
},
|
|
182
|
+
|
|
183
|
+
tryReadMemoryGraphEvents(limit) {
|
|
184
|
+
return localGraph.tryReadMemoryGraphEvents(limit);
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// ---------------------------------------------------------------------------
|
|
190
|
+
// Provider resolution
|
|
191
|
+
// ---------------------------------------------------------------------------
|
|
192
|
+
|
|
193
|
+
function resolveAdapter() {
|
|
194
|
+
const provider = (process.env.MEMORY_GRAPH_PROVIDER || 'local').toLowerCase().trim();
|
|
195
|
+
if (provider === 'remote') {
|
|
196
|
+
return buildRemoteAdapter();
|
|
197
|
+
}
|
|
198
|
+
return localAdapter;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const adapter = resolveAdapter();
|
|
202
|
+
|
|
203
|
+
module.exports = adapter;
|