@evomap/evolver 1.89.10 → 1.89.12

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.
Files changed (112) hide show
  1. package/.cursor/BUGBOT.md +182 -0
  2. package/.env.example +68 -0
  3. package/.git-commit-guard-token +1 -0
  4. package/.github/CODEOWNERS +63 -0
  5. package/.github/ISSUE_TEMPLATE/good_first_issue.md +23 -0
  6. package/.github/pull_request_template.md +45 -0
  7. package/.github/workflows/test.yml +75 -0
  8. package/CHANGELOG.md +1367 -0
  9. package/README.ja-JP.md +1 -1
  10. package/README.ko-KR.md +1 -1
  11. package/README.md +90 -536
  12. package/README.public.md +578 -0
  13. package/README.zh-CN.md +1 -1
  14. package/SECURITY.md +108 -0
  15. package/assets/gep/events.jsonl +3 -0
  16. package/examples/atp-consumer-quickstart.md +100 -0
  17. package/examples/hello-world.md +38 -0
  18. package/index.js +5 -3
  19. package/package.json +6 -18
  20. package/proxy-package.json +39 -0
  21. package/public.manifest.json +145 -0
  22. package/src/adapters/scripts/evolver-session-end.js +18 -37
  23. package/src/atp/atpExecute.js +27 -71
  24. package/src/atp/serviceHelper.js +28 -36
  25. package/src/config.js +17 -0
  26. package/src/evolve/guards.js +721 -1
  27. package/src/evolve/pipeline/collect.js +1283 -1
  28. package/src/evolve/pipeline/dispatch.js +421 -1
  29. package/src/evolve/pipeline/enrich.js +440 -1
  30. package/src/evolve/pipeline/hub.js +319 -1
  31. package/src/evolve/pipeline/select.js +274 -1
  32. package/src/evolve/pipeline/signals.js +206 -1
  33. package/src/evolve/utils.js +264 -1
  34. package/src/evolve.js +350 -1
  35. package/src/gep/a2aProtocol.js +4463 -1
  36. package/src/gep/antiAbuseTelemetry.js +233 -1
  37. package/src/gep/autoDistillConv.js +205 -1
  38. package/src/gep/autoDistillLlm.js +315 -1
  39. package/src/gep/candidateEval.js +92 -1
  40. package/src/gep/candidates.js +198 -1
  41. package/src/gep/contentHash.js +30 -1
  42. package/src/gep/conversationDistiller.js +270 -0
  43. package/src/gep/conversationSniffer.js +266 -1
  44. package/src/gep/crypto.js +89 -1
  45. package/src/gep/curriculum.js +163 -1
  46. package/src/gep/deviceId.js +218 -1
  47. package/src/gep/envFingerprint.js +118 -1
  48. package/src/gep/epigenetics.js +31 -1
  49. package/src/gep/execBridge.js +712 -1
  50. package/src/gep/explore.js +289 -1
  51. package/src/gep/hash.js +15 -1
  52. package/src/gep/hubFetch.js +608 -1
  53. package/src/gep/hubReview.js +207 -1
  54. package/src/gep/hubSearch.js +526 -1
  55. package/src/gep/hubVerify.js +306 -1
  56. package/src/gep/learningSignals.js +89 -1
  57. package/src/gep/memoryGraph.js +1449 -1
  58. package/src/gep/memoryGraphAdapter.js +203 -1
  59. package/src/gep/mutation.js +203 -1
  60. package/src/gep/narrativeMemory.js +108 -1
  61. package/src/gep/oauthLogin.js +9 -3
  62. package/src/gep/openPRRegistry.js +205 -1
  63. package/src/gep/personality.js +423 -1
  64. package/src/gep/policyCheck.js +599 -1
  65. package/src/gep/privacyClient.js +10 -9
  66. package/src/gep/prompt.js +836 -1
  67. package/src/gep/questionGenerator.js +103 -0
  68. package/src/gep/recallInject.js +409 -1
  69. package/src/gep/recallVerifier.js +318 -1
  70. package/src/gep/reflection.js +177 -1
  71. package/src/gep/savingsCore.js +112 -1
  72. package/src/gep/selector.js +602 -1
  73. package/src/gep/signals.js +85 -17
  74. package/src/gep/skillDistiller.js +1294 -1
  75. package/src/gep/solidify.js +1699 -1
  76. package/src/gep/strategy.js +136 -1
  77. package/src/gep/tokenSavings.js +95 -1
  78. package/src/gep/workspaceKeychain.js +174 -1
  79. package/src/proxy/extensions/traceControl.js +109 -1
  80. package/src/proxy/index.js +100 -3
  81. package/src/proxy/inject.js +52 -1
  82. package/src/proxy/lifecycle/manager.js +108 -7
  83. package/src/proxy/server/routes.js +41 -7
  84. package/src/proxy/server/settings.js +6 -2
  85. package/src/proxy/sync/engine.js +31 -15
  86. package/src/proxy/sync/inbound.js +87 -9
  87. package/src/proxy/sync/outbound.js +57 -4
  88. package/src/proxy/trace/extractor.js +1403 -1
  89. package/src/proxy/trace/usage.js +105 -1
  90. package/CONTRIBUTING.md +0 -19
  91. package/assets/cover.png +0 -0
  92. package/scripts/a2a_export.js +0 -63
  93. package/scripts/a2a_ingest.js +0 -79
  94. package/scripts/a2a_promote.js +0 -118
  95. package/scripts/analyze_by_skill.js +0 -121
  96. package/scripts/build_binaries.js +0 -479
  97. package/scripts/check-changelog.js +0 -166
  98. package/scripts/extract_log.js +0 -85
  99. package/scripts/generate_history.js +0 -75
  100. package/scripts/gep_append_event.js +0 -96
  101. package/scripts/gep_personality_report.js +0 -234
  102. package/scripts/human_report.js +0 -147
  103. package/scripts/recall-verify-report.js +0 -234
  104. package/scripts/recover_loop.js +0 -61
  105. package/scripts/refresh_stars_badge.js +0 -168
  106. package/scripts/seed-merchants.js +0 -91
  107. package/scripts/suggest_version.js +0 -89
  108. package/scripts/validate-modules.js +0 -38
  109. package/scripts/validate-suite.js +0 -78
  110. package/skills/index.json +0 -14
  111. /package/assets/gep/{genes.seed.json → genes.json} +0 -0
  112. /package/{skills → bundled-skills}/_meta/SKILL.md +0 -0
@@ -1 +1,203 @@
1
- const _0x177ecd=_0x936a;function _0x4089(){const _0x38c8ee=['\x42\x65\x7a\x72\x70\x38\x6f\x73\x57\x50\x65\x6a\x57\x34\x4b','\x57\x34\x78\x63\x51\x67\x79\x73\x63\x4e\x75\x67\x66\x67\x61','\x57\x50\x68\x64\x52\x64\x71\x71\x6f\x61','\x63\x6d\x6f\x4d\x57\x52\x4e\x63\x56\x78\x47','\x57\x34\x76\x2b\x57\x52\x4a\x64\x55\x49\x65','\x63\x43\x6f\x52\x57\x37\x39\x2f\x70\x6d\x6b\x49\x6f\x38\x6b\x31','\x44\x38\x6f\x37\x57\x34\x74\x64\x4f\x4d\x4a\x64\x51\x6d\x6f\x78','\x45\x62\x38\x37\x74\x38\x6f\x64','\x6e\x30\x48\x65\x46\x53\x6f\x41\x57\x50\x6d\x54\x57\x34\x30','\x41\x64\x30\x51\x57\x34\x54\x49\x61\x78\x4e\x63\x52\x61','\x57\x36\x30\x49\x57\x37\x6a\x67\x62\x68\x75\x41\x57\x35\x43','\x74\x38\x6f\x7a\x45\x63\x42\x64\x47\x6d\x6f\x74\x57\x52\x38','\x70\x4c\x6c\x64\x50\x5a\x58\x2b\x57\x34\x6e\x78\x57\x4f\x6d','\x76\x6d\x6f\x46\x75\x73\x74\x64\x49\x61','\x57\x52\x4a\x63\x51\x6d\x6b\x2b\x57\x4f\x5a\x63\x4f\x4b\x4f','\x57\x37\x50\x6d\x62\x53\x6b\x66\x74\x47','\x57\x34\x64\x63\x54\x38\x6f\x74\x68\x6d\x6b\x55\x57\x34\x6d\x61\x6b\x53\x6b\x49\x57\x51\x7a\x56\x6c\x38\x6f\x41','\x44\x38\x6b\x4b\x74\x59\x5a\x64\x47\x57\x5a\x64\x4f\x47','\x46\x78\x47\x77\x6e\x6d\x6b\x63\x57\x34\x75\x50\x57\x50\x79','\x57\x52\x79\x63\x57\x37\x5a\x63\x55\x77\x78\x64\x48\x4b\x7a\x44\x76\x6d\x6b\x70\x69\x77\x61','\x74\x78\x64\x64\x4a\x61\x64\x64\x47\x49\x53','\x45\x43\x6f\x48\x66\x38\x6b\x45\x57\x36\x70\x64\x50\x68\x56\x63\x4e\x71','\x57\x37\x4a\x64\x51\x4b\x34\x68\x46\x64\x43\x7a\x57\x37\x34','\x70\x43\x6f\x76\x74\x48\x56\x64\x4d\x47\x4e\x64\x52\x49\x53','\x57\x34\x5a\x64\x4d\x38\x6f\x51\x43\x53\x6b\x79\x63\x38\x6b\x59\x57\x37\x4b','\x41\x43\x6f\x52\x6c\x38\x6b\x6d\x57\x34\x43','\x7a\x53\x6f\x4a\x57\x36\x4e\x64\x48\x67\x5a\x64\x53\x53\x6f\x6c\x57\x36\x30','\x77\x53\x6b\x6a\x66\x6d\x6f\x58\x76\x57','\x76\x6d\x6f\x4c\x57\x37\x53\x2f\x6a\x38\x6b\x4f\x65\x38\x6b\x4c','\x57\x50\x33\x64\x50\x53\x6b\x70\x72\x6d\x6f\x37\x57\x52\x54\x77\x67\x71','\x42\x53\x6f\x5a\x75\x38\x6f\x63\x57\x36\x39\x68\x57\x34\x39\x36','\x57\x51\x6a\x6a\x7a\x4c\x56\x63\x50\x61','\x57\x52\x58\x58\x57\x51\x57\x43\x75\x73\x72\x56\x57\x36\x6a\x77\x57\x52\x65\x38\x57\x4f\x7a\x75','\x57\x51\x76\x44\x64\x6d\x6f\x64\x76\x53\x6f\x47\x70\x71\x61','\x71\x6d\x6f\x4a\x6c\x43\x6b\x75\x57\x35\x61','\x43\x72\x34\x38\x74\x53\x6f\x72\x45\x53\x6b\x4b','\x57\x36\x6c\x64\x4d\x5a\x66\x56\x57\x34\x4b','\x57\x36\x72\x47\x66\x32\x33\x64\x4a\x38\x6b\x74','\x41\x48\x38\x79\x7a\x43\x6f\x39','\x63\x43\x6f\x52\x57\x36\x58\x38\x6c\x38\x6b\x4c\x65\x71','\x67\x43\x6f\x66\x71\x6d\x6b\x54\x66\x6d\x6f\x71\x57\x50\x43\x72\x57\x37\x5a\x63\x4d\x4c\x52\x63\x47\x71\x4f\x32','\x72\x64\x78\x63\x4c\x43\x6f\x6c\x57\x4f\x70\x63\x52\x6d\x6b\x2b\x57\x52\x64\x64\x4f\x53\x6b\x6d\x68\x4a\x46\x63\x49\x47','\x57\x37\x4a\x63\x56\x6d\x6b\x74\x71\x32\x6a\x4b\x69\x43\x6b\x4b','\x57\x52\x58\x49\x57\x35\x6c\x64\x49\x57\x75\x63\x57\x34\x79','\x63\x53\x6f\x2f\x57\x37\x39\x33\x67\x57','\x57\x4f\x4a\x63\x4d\x77\x38\x38\x57\x51\x37\x64\x50\x53\x6b\x59\x67\x53\x6b\x59\x57\x35\x7a\x4d\x44\x53\x6f\x4b\x57\x4f\x30','\x41\x6d\x6b\x58\x66\x38\x6f\x30\x79\x61','\x46\x64\x4f\x53\x57\x34\x4c\x71\x61\x57','\x57\x37\x7a\x7a\x57\x50\x2f\x64\x55\x73\x74\x63\x4d\x4c\x54\x6d','\x62\x6d\x6b\x78\x68\x38\x6b\x6e\x6c\x78\x71\x74\x73\x47','\x57\x50\x46\x64\x53\x74\x61\x50\x6e\x4b\x30\x35\x67\x61','\x71\x38\x6b\x75\x66\x38\x6f\x35\x73\x53\x6b\x50\x57\x34\x76\x41','\x57\x35\x74\x64\x52\x48\x54\x6b','\x72\x31\x46\x64\x55\x4a\x4e\x64\x52\x47','\x78\x6d\x6f\x41\x57\x34\x35\x55\x43\x47','\x67\x32\x56\x64\x49\x61','\x65\x53\x6b\x44\x57\x34\x38\x4b\x41\x57','\x57\x34\x69\x67\x57\x35\x66\x4e\x6d\x30\x47\x63\x57\x37\x75','\x57\x51\x53\x63\x57\x36\x34\x67\x44\x43\x6b\x73\x57\x37\x42\x64\x4c\x57','\x57\x37\x38\x58\x57\x37\x4c\x6f\x62\x67\x6d\x56\x57\x35\x43','\x57\x52\x37\x64\x47\x53\x6b\x61\x78\x43\x6f\x42','\x57\x36\x6e\x67\x57\x51\x74\x64\x4e\x74\x46\x63\x48\x31\x30','\x6e\x33\x7a\x37\x79\x38\x6b\x64\x69\x43\x6f\x68\x6c\x71','\x79\x53\x6f\x6e\x46\x64\x33\x64\x53\x47','\x7a\x6d\x6b\x38\x69\x58\x56\x64\x53\x64\x38','\x57\x50\x6a\x51\x57\x36\x65\x69\x57\x34\x74\x64\x54\x38\x6f\x6c\x68\x43\x6f\x41\x6a\x6d\x6f\x31\x57\x4f\x43','\x73\x53\x6b\x38\x57\x50\x6c\x63\x52\x6d\x6b\x61','\x6f\x43\x6f\x6d\x57\x37\x6a\x38\x63\x61','\x66\x53\x6b\x2f\x68\x38\x6b\x4c\x67\x47','\x57\x35\x68\x64\x4b\x38\x6f\x69\x46\x6d\x6b\x64\x6a\x43\x6b\x4c\x57\x34\x6d','\x61\x77\x68\x64\x53\x38\x6b\x44\x57\x36\x4f','\x57\x36\x4a\x64\x4e\x65\x65\x76\x46\x47','\x57\x35\x6d\x4e\x57\x52\x35\x77\x57\x4f\x75','\x77\x43\x6b\x68\x67\x6d\x6f\x53\x75\x38\x6b\x72','\x69\x43\x6f\x68\x46\x31\x74\x63\x52\x33\x70\x63\x49\x63\x4b','\x57\x35\x38\x6d\x57\x34\x39\x38','\x57\x36\x61\x37\x57\x37\x50\x36\x6f\x71','\x67\x38\x6f\x64\x64\x53\x6f\x35\x44\x53\x6b\x42\x57\x35\x7a\x63','\x57\x36\x39\x42\x62\x6d\x6b\x45\x72\x53\x6f\x6a\x6b\x61\x71','\x44\x38\x6f\x37\x57\x35\x5a\x64\x4e\x4d\x64\x64\x56\x38\x6f\x45\x57\x36\x4f','\x6b\x43\x6f\x61\x44\x53\x6b\x76\x57\x37\x43','\x57\x4f\x64\x64\x55\x6d\x6b\x72\x71\x61','\x74\x77\x33\x64\x54\x53\x6f\x54\x57\x37\x4f','\x62\x6d\x6f\x5a\x57\x52\x4a\x63\x48\x75\x4b','\x70\x6d\x6f\x55\x57\x51\x46\x63\x4f\x30\x30','\x6b\x4e\x52\x64\x51\x38\x6b\x70\x57\x52\x43','\x57\x35\x4e\x63\x54\x4e\x66\x56\x57\x34\x6a\x50\x57\x36\x58\x6e','\x57\x51\x53\x66\x57\x35\x38\x79\x44\x43\x6b\x70\x57\x36\x56\x64\x4c\x57','\x57\x37\x62\x74\x57\x51\x2f\x64\x4f\x49\x74\x63\x4c\x33\x72\x46','\x45\x38\x6b\x6b\x6e\x62\x78\x64\x54\x4a\x37\x64\x4f\x4e\x71','\x57\x51\x66\x38\x71\x6d\x6b\x2b\x57\x36\x69','\x6e\x33\x64\x64\x51\x6d\x6f\x71\x57\x51\x4e\x64\x54\x53\x6b\x78\x57\x4f\x69','\x57\x35\x37\x64\x4c\x59\x6a\x53\x57\x36\x37\x63\x55\x53\x6f\x4b\x72\x61','\x78\x53\x6b\x71\x66\x53\x6f\x31\x71\x38\x6b\x4b\x57\x35\x6a\x6d','\x57\x4f\x4a\x64\x4d\x62\x39\x55\x57\x35\x46\x63\x53\x6d\x6f\x4d','\x72\x33\x5a\x64\x50\x53\x6f\x31\x57\x35\x4c\x4d\x57\x50\x57','\x6c\x62\x62\x67\x41\x53\x6b\x37','\x69\x53\x6f\x35\x71\x6d\x6b\x69\x57\x36\x4c\x6d\x57\x34\x54\x51','\x41\x53\x6b\x58\x68\x38\x6f\x6a','\x57\x37\x52\x64\x56\x43\x6b\x4f\x57\x50\x2f\x63\x4b\x76\x56\x64\x4a\x38\x6b\x7a','\x45\x38\x6f\x2b\x63\x53\x6b\x63\x57\x36\x38','\x61\x67\x68\x64\x48\x43\x6b\x71\x57\x34\x4e\x64\x56\x53\x6f\x79\x57\x4f\x61','\x79\x38\x6b\x39\x57\x35\x42\x63\x4a\x33\x42\x64\x4e\x53\x6f\x57\x57\x52\x6e\x52','\x57\x36\x76\x74\x57\x52\x4a\x64\x47\x64\x70\x63\x4e\x4c\x50\x7a','\x79\x43\x6b\x77\x6a\x58\x78\x64\x53\x64\x6c\x64\x48\x4e\x6d','\x57\x52\x6a\x38\x73\x6d\x6b\x45\x57\x34\x47','\x6e\x49\x48\x6c\x7a\x6d\x6b\x36','\x62\x53\x6f\x79\x57\x36\x43\x61\x78\x38\x6b\x38\x66\x33\x30','\x57\x35\x43\x2b\x57\x52\x58\x73\x57\x50\x68\x63\x47\x38\x6f\x51\x63\x47','\x57\x36\x57\x49\x57\x36\x48\x6c\x63\x71','\x57\x34\x57\x59\x78\x6d\x6b\x34\x57\x36\x7a\x38\x78\x53\x6f\x55','\x57\x52\x57\x4e\x57\x50\x5a\x64\x55\x57\x38','\x57\x35\x71\x79\x79\x53\x6b\x78\x57\x50\x4e\x64\x4e\x43\x6f\x47\x57\x34\x53','\x42\x72\x38\x34\x72\x43\x6f\x65\x41\x38\x6b\x45\x72\x71','\x77\x53\x6f\x47\x57\x34\x64\x64\x56\x77\x61','\x63\x6d\x6f\x4d\x57\x37\x6e\x4b','\x57\x36\x48\x67\x62\x53\x6b\x4a\x75\x71','\x57\x52\x35\x43\x41\x66\x70\x63\x55\x71','\x57\x4f\x54\x59\x78\x57','\x57\x36\x64\x64\x49\x38\x6f\x6f\x77\x53\x6b\x63','\x67\x43\x6f\x52\x72\x43\x6b\x48\x57\x37\x47','\x57\x37\x4a\x63\x56\x6d\x6b\x74\x71\x32\x6a\x4b\x6c\x6d\x6b\x4c','\x57\x34\x4e\x64\x55\x48\x39\x58\x57\x37\x53','\x57\x36\x74\x64\x51\x64\x44\x35\x71\x61','\x6d\x43\x6f\x2b\x57\x50\x5a\x63\x54\x76\x56\x64\x55\x53\x6f\x6f\x57\x4f\x38','\x73\x6d\x6b\x36\x57\x51\x38\x4c\x45\x6d\x6f\x57\x62\x6d\x6b\x70\x74\x53\x6f\x34\x61\x43\x6b\x6c','\x43\x67\x37\x64\x51\x59\x64\x64\x52\x47','\x6f\x43\x6b\x6c\x57\x35\x38\x41\x46\x4a\x47','\x57\x4f\x46\x64\x51\x43\x6b\x6f\x75\x71','\x57\x36\x50\x79\x62\x32\x33\x64\x4d\x6d\x6b\x79\x6d\x4d\x38','\x41\x53\x6b\x74\x57\x50\x68\x63\x48\x53\x6b\x6b','\x57\x35\x71\x79\x79\x53\x6b\x78\x57\x50\x4e\x64\x4e\x43\x6f\x59\x57\x35\x79','\x6e\x74\x31\x65\x71\x53\x6b\x42\x57\x37\x75\x67\x41\x61','\x57\x34\x6c\x64\x50\x58\x6e\x45\x77\x47','\x57\x52\x46\x64\x48\x71\x43\x63','\x64\x38\x6b\x6c\x62\x53\x6b\x66\x6c\x77\x34\x78','\x57\x36\x57\x4f\x42\x38\x6b\x73\x57\x50\x65','\x71\x30\x6c\x64\x4a\x61\x6c\x64\x4e\x47','\x41\x6d\x6b\x42\x69\x58\x2f\x64\x51\x73\x52\x64\x4c\x57','\x57\x36\x56\x64\x4f\x47\x76\x69\x57\x34\x71','\x57\x37\x54\x57\x57\x37\x42\x64\x4e\x64\x4f','\x6d\x38\x6f\x39\x76\x38\x6b\x63\x57\x37\x58\x68\x57\x36\x50\x36','\x6e\x6d\x6f\x6f\x57\x52\x4e\x63\x4b\x32\x53','\x74\x66\x4e\x64\x4a\x43\x6f\x2f\x57\x36\x71','\x57\x36\x4c\x78\x68\x38\x6b\x70\x76\x57','\x57\x51\x7a\x43\x45\x71','\x57\x52\x6e\x61\x42\x47','\x7a\x53\x6f\x30\x41\x58\x5a\x64\x4e\x61','\x57\x37\x58\x67\x57\x37\x68\x63\x54\x47','\x6b\x6d\x6b\x4d\x67\x38\x6b\x79\x6e\x61','\x43\x53\x6f\x61\x57\x36\x39\x4d\x57\x4f\x53','\x6b\x75\x54\x4d\x68\x53\x6b\x69\x6f\x6d\x6f\x30\x44\x38\x6b\x45\x57\x37\x48\x4d\x57\x36\x37\x63\x55\x47','\x79\x53\x6f\x55\x57\x35\x37\x64\x4e\x67\x4a\x64\x53\x6d\x6f\x38\x57\x37\x38','\x57\x4f\x46\x63\x54\x75\x57\x7a\x68\x53\x6b\x72\x76\x57\x6a\x7a\x57\x37\x31\x77\x57\x4f\x71','\x46\x43\x6f\x74\x42\x74\x5a\x64\x47\x6d\x6f\x73\x57\x37\x42\x64\x4e\x61','\x57\x36\x66\x75\x57\x50\x33\x64\x50\x57\x43','\x41\x43\x6f\x4e\x68\x43\x6b\x61\x57\x37\x46\x64\x56\x67\x30','\x71\x53\x6b\x6b\x57\x34\x48\x72\x57\x50\x37\x64\x54\x62\x66\x78','\x45\x53\x6b\x42\x6a\x72\x70\x64\x51\x4a\x33\x64\x49\x4d\x79','\x6c\x65\x48\x4c\x68\x53\x6b\x61\x6f\x38\x6f\x5a\x46\x53\x6b\x74\x57\x34\x7a\x36\x57\x36\x2f\x63\x4e\x71','\x6f\x38\x6f\x53\x57\x4f\x64\x63\x50\x4c\x6c\x64\x4e\x38\x6f\x46\x57\x51\x75','\x57\x50\x74\x64\x48\x64\x65\x4d\x57\x37\x78\x63\x55\x53\x6f\x49\x74\x71','\x45\x38\x6f\x45\x57\x34\x43\x53\x44\x64\x33\x63\x55\x4d\x79','\x57\x52\x47\x6c\x57\x35\x38\x74\x45\x61','\x57\x34\x54\x34\x57\x52\x42\x64\x54\x73\x75','\x57\x4f\x66\x59\x78\x6d\x6b\x54\x57\x37\x35\x4e\x73\x43\x6f\x65','\x6c\x5a\x58\x45\x74\x6d\x6b\x74','\x69\x75\x52\x64\x4c\x6d\x6b\x67\x57\x35\x34','\x73\x77\x6a\x4f\x6b\x6d\x6f\x30','\x57\x36\x70\x64\x51\x65\x30\x6a\x7a\x62\x4b','\x65\x38\x6b\x6b\x64\x6d\x6b\x6f\x70\x4e\x34\x5a\x73\x47','\x57\x34\x4a\x64\x48\x5a\x4c\x39','\x57\x37\x6c\x64\x52\x66\x71\x66\x45\x61','\x7a\x38\x6b\x61\x69\x31\x52\x64\x50\x5a\x78\x64\x4a\x77\x79','\x57\x50\x46\x64\x52\x53\x6b\x6d\x76\x43\x6f\x49\x57\x4f\x72\x77\x6d\x57','\x6b\x43\x6f\x70\x57\x34\x58\x79\x65\x43\x6b\x75\x6d\x43\x6b\x6e','\x71\x38\x6f\x4c\x61\x53\x6b\x78\x57\x34\x69','\x42\x53\x6b\x75\x57\x50\x42\x63\x50\x61','\x57\x52\x74\x64\x4b\x71\x79\x6e\x46\x38\x6f\x44\x6a\x76\x30','\x64\x58\x47\x72\x6e\x53\x6b\x62','\x57\x37\x70\x63\x4a\x31\x35\x68\x57\x37\x57','\x57\x51\x37\x64\x4e\x57\x38\x63\x43\x53\x6f\x36','\x79\x38\x6b\x32\x78\x5a\x56\x64\x4e\x47\x4f','\x57\x37\x39\x47\x63\x4b\x4a\x64\x47\x61','\x57\x37\x35\x65\x65\x53\x6b\x2b\x77\x53\x6f\x56\x70\x49\x47','\x57\x37\x37\x63\x54\x53\x6b\x4a\x77\x67\x6a\x50\x62\x38\x6b\x36','\x57\x51\x38\x74\x73\x32\x68\x63\x54\x6d\x6f\x49\x57\x51\x65\x75','\x57\x51\x42\x63\x49\x6d\x6f\x6b\x57\x37\x70\x64\x49\x65\x43\x76\x57\x37\x61','\x57\x51\x56\x63\x55\x38\x6f\x78\x57\x35\x46\x64\x48\x65\x75\x75','\x57\x34\x65\x74\x79\x6d\x6b\x75\x57\x52\x4a\x64\x4c\x38\x6f\x73\x57\x35\x69','\x70\x43\x6f\x7a\x7a\x75\x70\x63\x56\x77\x4e\x63\x4b\x65\x4f\x48\x57\x35\x4e\x64\x4f\x59\x42\x63\x56\x61','\x57\x36\x72\x73\x61\x53\x6b\x69\x78\x53\x6f\x36\x70\x57','\x41\x59\x65\x49\x57\x34\x66\x66\x6b\x4e\x42\x63\x56\x71','\x57\x50\x2f\x63\x52\x38\x6f\x7a\x57\x35\x70\x64\x54\x71','\x42\x6d\x6f\x51\x57\x35\x6e\x4c\x79\x47','\x41\x58\x71\x55\x57\x34\x4c\x75\x6a\x4e\x57','\x69\x4a\x76\x69\x78\x38\x6b\x71\x57\x35\x79\x58\x43\x71','\x70\x73\x61\x43\x61\x71','\x74\x33\x56\x64\x4b\x38\x6f\x49\x57\x34\x7a\x33\x57\x50\x65','\x74\x4c\x54\x31\x65\x38\x6f\x65','\x6d\x38\x6f\x39\x76\x38\x6b\x63\x57\x37\x58\x68\x57\x37\x58\x52'];_0x4089=function(){return _0x38c8ee;};return _0x4089();}(function(_0x4eb1a2,_0x4588ba){const _0x4d5a88=_0x936a,_0x2860f3=_0x4eb1a2();while(!![]){try{const _0x4caa3b=-parseInt(_0x4d5a88(0x1d1,'\x47\x21\x62\x4f'))/(0x19af+0x4*0xb7+-0x1*0x1c8a)*(-parseInt(_0x4d5a88(0x207,'\x74\x66\x34\x21'))/(0x1f0c+0x778+0x1f*-0x13e))+parseInt(_0x4d5a88(0x1cc,'\x36\x21\x26\x38'))/(0x980+-0x134b+0x9ce)*(-parseInt(_0x4d5a88(0x18e,'\x61\x73\x71\x25'))/(0x69c+0x4*0x2+0x10*-0x6a))+-parseInt(_0x4d5a88(0x181,'\x24\x46\x70\x61'))/(0x36c*0x7+-0x284+-0x156b)*(parseInt(_0x4d5a88(0x180,'\x25\x53\x41\x31'))/(0x387*-0x9+0x2f9*-0x9+0x2a9*0x16))+-parseInt(_0x4d5a88(0x17e,'\x6e\x56\x53\x68'))/(-0x1e17*-0x1+-0xf65+-0x2ef*0x5)+-parseInt(_0x4d5a88(0x238,'\x72\x70\x78\x6b'))/(-0xb*-0x33a+0x6*-0x1eb+-0x17f4)*(parseInt(_0x4d5a88(0x1eb,'\x55\x68\x78\x39'))/(-0x176+-0x1d08+0x1e87))+parseInt(_0x4d5a88(0x228,'\x48\x51\x41\x7a'))/(0x1*-0xb7b+0x5*-0x638+0x2a9d*0x1)*(-parseInt(_0x4d5a88(0x197,'\x6e\x58\x6f\x2a'))/(0x2465+0x1b37+0x3f91*-0x1))+parseInt(_0x4d5a88(0x196,'\x7a\x44\x26\x29'))/(0x2233+0x15a6+-0x37cd);if(_0x4caa3b===_0x4588ba)break;else _0x2860f3['push'](_0x2860f3['shift']());}catch(_0x55be7b){_0x2860f3['push'](_0x2860f3['shift']());}}}(_0x4089,0xd3dd8+-0xf2fc9+0xc54a7));const _0x36e94b=require(_0x177ecd(0x1dc,'\x38\x43\x34\x33')+'\x47\x72\x61\x70\x68'),_0x2d2b87={'\x6e\x61\x6d\x65':_0x177ecd(0x1e3,'\x75\x62\x61\x75'),'\x67\x65\x74\x41\x64\x76\x69\x63\x65'(_0x582b0e){const _0x181442=_0x177ecd;return _0x36e94b[_0x181442(0x1d5,'\x24\x46\x70\x61')+_0x181442(0x17f,'\x54\x67\x39\x56')](_0x582b0e);},'\x72\x65\x63\x6f\x72\x64\x53\x69\x67\x6e\x61\x6c\x53\x6e\x61\x70\x73\x68\x6f\x74'(_0x38da29){const _0x50f0c6=_0x177ecd;return _0x36e94b['\x72\x65\x63\x6f\x72\x64\x53\x69'+_0x50f0c6(0x22b,'\x37\x79\x61\x46')+_0x50f0c6(0x233,'\x25\x53\x41\x31')](_0x38da29);},'\x72\x65\x63\x6f\x72\x64\x48\x79\x70\x6f\x74\x68\x65\x73\x69\x73'(_0xf5e09b){const _0x4ed83=_0x177ecd;return _0x36e94b[_0x4ed83(0x198,'\x39\x33\x77\x6b')+_0x4ed83(0x208,'\x23\x53\x56\x51')](_0xf5e09b);},'\x72\x65\x63\x6f\x72\x64\x41\x74\x74\x65\x6d\x70\x74'(_0xe593){const _0x4e4a03=_0x177ecd;return _0x36e94b[_0x4e4a03(0x1c7,'\x28\x5b\x55\x44')+_0x4e4a03(0x1fa,'\x43\x42\x4d\x75')](_0xe593);},'\x72\x65\x63\x6f\x72\x64\x4f\x75\x74\x63\x6f\x6d\x65'(_0x19ea99){const _0x111d3d=_0x177ecd;return _0x36e94b['\x72\x65\x63\x6f\x72\x64\x4f\x75'+_0x111d3d(0x20b,'\x37\x58\x75\x41')+_0x111d3d(0x224,'\x54\x67\x39\x56')](_0x19ea99);},'\x72\x65\x63\x6f\x72\x64\x45\x78\x74\x65\x72\x6e\x61\x6c\x43\x61\x6e\x64\x69\x64\x61\x74\x65'(_0x1b58dc){const _0x2bd40c=_0x177ecd;return _0x36e94b[_0x2bd40c(0x1f2,'\x79\x6b\x77\x6e')+'\x74\x65\x72\x6e\x61\x6c\x43\x61'+_0x2bd40c(0x1f5,'\x63\x58\x64\x34')](_0x1b58dc);},'\x6d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x50\x61\x74\x68'(){const _0x20136c=_0x177ecd;return _0x36e94b['\x6d\x65\x6d\x6f\x72\x79\x47\x72'+_0x20136c(0x23d,'\x4d\x4b\x6f\x35')]();},'\x63\x6f\x6d\x70\x75\x74\x65\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79'(_0x401ab9){const _0x5e7ddd=_0x177ecd;return _0x36e94b[_0x5e7ddd(0x183,'\x39\x4d\x30\x7a')+_0x5e7ddd(0x220,'\x38\x62\x34\x5a')](_0x401ab9);},'\x74\x72\x79\x52\x65\x61\x64\x4d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x45\x76\x65\x6e\x74\x73'(_0x451f06){const _0x295dcb=_0x177ecd;return _0x36e94b[_0x295dcb(0x226,'\x29\x58\x77\x23')+_0x295dcb(0x232,'\x79\x6b\x77\x6e')+_0x295dcb(0x1a8,'\x4d\x4a\x28\x78')](_0x451f06);}};function _0x936a(_0xacfd00,_0x45fb43){_0xacfd00=_0xacfd00-(0x257b+-0x1efe*-0x1+-0x1656*0x3);const _0x40b1b5=_0x4089();let _0x247b0a=_0x40b1b5[_0xacfd00];if(_0x936a['\x6e\x53\x57\x5a\x63\x70']===undefined){var _0x142d60=function(_0x5e4514){const _0x5e4198='\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 _0xd0e51c='',_0x4f5ef3='',_0x290fab=_0xd0e51c+_0x142d60,_0x38a979=(''+function(){return 0xacb+0x13a5+0x1*-0x1e70;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!==-(0x2635+-0xb*-0x367+-0x13*0x3fb);for(let _0x33c5c6=-0x1eea+-0x1*-0x5cc+0x191e,_0x34b6be,_0x268fdd,_0x1ffab2=-0x121f+0x7*-0x3f5+0x2dd2;_0x268fdd=_0x5e4514['\x63\x68\x61\x72\x41\x74'](_0x1ffab2++);~_0x268fdd&&(_0x34b6be=_0x33c5c6%(-0xde5+-0x1*0x92f+0x1718)?_0x34b6be*(0x1*0x7ea+0x14e1+-0x1c8b)+_0x268fdd:_0x268fdd,_0x33c5c6++%(0x21e6+-0x22d4+0xf2*0x1))?_0xd0e51c+=_0x38a979||_0x290fab['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1ffab2+(-0x1c92+-0x1b2c+0x2a*0x154))-(-0x25+-0x39*0x21+-0xf1*-0x8)!==-0x10d9+0xbf6+0x4e3*0x1?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x11ea*-0x1+-0x421*-0x1+-0x150c&_0x34b6be>>(-(0x1a60+0x649*0x1+0x20a7*-0x1)*_0x33c5c6&0x75f*0x1+-0x4*-0x4c7+-0x1*0x1a75)):_0x33c5c6:0x427*-0x2+0x12b2+-0xa64){_0x268fdd=_0x5e4198['\x69\x6e\x64\x65\x78\x4f\x66'](_0x268fdd);}for(let _0x2bbd0d=-0x185e*0x1+-0xae0+0x2*0x119f,_0x2ef80b=_0xd0e51c['\x6c\x65\x6e\x67\x74\x68'];_0x2bbd0d<_0x2ef80b;_0x2bbd0d++){_0x4f5ef3+='\x25'+('\x30\x30'+_0xd0e51c['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x2bbd0d)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x1*-0x430+-0x512+-0x1*-0x952))['\x73\x6c\x69\x63\x65'](-(-0x11b*0xc+-0x1282+0x1fc8));}return decodeURIComponent(_0x4f5ef3);};const _0x29c863=function(_0x994f13,_0x19faa8){let _0x4f0ebe=[],_0x3fe3c0=0x3d*-0x4+-0x15b5+0x16a9,_0x5ca8e6,_0xe5ce44='';_0x994f13=_0x142d60(_0x994f13);let _0x1d5535;for(_0x1d5535=0x23e4*-0x1+-0x1*-0xc67+0x35b*0x7;_0x1d5535<-0xcfd+-0x259*0xf+-0x43*-0xbc;_0x1d5535++){_0x4f0ebe[_0x1d5535]=_0x1d5535;}for(_0x1d5535=0xbdb*0x1+-0x2*0x13d+-0x961;_0x1d5535<-0x53*0x3a+-0x1158+0x2526;_0x1d5535++){_0x3fe3c0=(_0x3fe3c0+_0x4f0ebe[_0x1d5535]+_0x19faa8['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x1d5535%_0x19faa8['\x6c\x65\x6e\x67\x74\x68']))%(0x1cef+-0xde2+-0xe0d),_0x5ca8e6=_0x4f0ebe[_0x1d5535],_0x4f0ebe[_0x1d5535]=_0x4f0ebe[_0x3fe3c0],_0x4f0ebe[_0x3fe3c0]=_0x5ca8e6;}_0x1d5535=0x1eb3+0xd*0x21d+0x22*-0x1b6,_0x3fe3c0=0xd47+-0x963+0x53*-0xc;for(let _0x5c0b8c=-0x12*0x4c+-0xdf5+0x134d;_0x5c0b8c<_0x994f13['\x6c\x65\x6e\x67\x74\x68'];_0x5c0b8c++){_0x1d5535=(_0x1d5535+(0x23e3+0x22c+0x260e*-0x1))%(0x1485+0x50a+0x1*-0x188f),_0x3fe3c0=(_0x3fe3c0+_0x4f0ebe[_0x1d5535])%(0x1d76*0x1+0xf77+-0xd*0x361),_0x5ca8e6=_0x4f0ebe[_0x1d5535],_0x4f0ebe[_0x1d5535]=_0x4f0ebe[_0x3fe3c0],_0x4f0ebe[_0x3fe3c0]=_0x5ca8e6,_0xe5ce44+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x994f13['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x5c0b8c)^_0x4f0ebe[(_0x4f0ebe[_0x1d5535]+_0x4f0ebe[_0x3fe3c0])%(-0x1f61+0x11c4+-0x81*-0x1d)]);}return _0xe5ce44;};_0x936a['\x6e\x66\x6d\x4b\x6d\x46']=_0x29c863,_0x936a['\x63\x6a\x77\x70\x69\x65']={},_0x936a['\x6e\x53\x57\x5a\x63\x70']=!![];}const _0x4bd472=_0x40b1b5[-0x1014+0x1*-0x7dc+0x17f0],_0x13078f=_0xacfd00+_0x4bd472,_0x2c2321=_0x936a['\x63\x6a\x77\x70\x69\x65'][_0x13078f];if(!_0x2c2321){if(_0x936a['\x6d\x65\x58\x71\x70\x75']===undefined){const _0x3e834f=function(_0x2fadb8){this['\x77\x57\x55\x57\x59\x77']=_0x2fadb8,this['\x66\x71\x57\x62\x4e\x43']=[-0x355*-0x1+0x2306+-0x132d*0x2,0x1937+-0x5*0x6a3+0x7f8,-0x21e0+-0x1eb+0x341*0xb],this['\x74\x57\x62\x63\x48\x62']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x50\x78\x59\x43\x61\x45']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x5a\x68\x44\x79\x53\x66']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x3e834f['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x67\x44\x70\x6d\x55\x66']=function(){const _0x4dfb83=new RegExp(this['\x50\x78\x59\x43\x61\x45']+this['\x5a\x68\x44\x79\x53\x66']),_0x4e7eb5=_0x4dfb83['\x74\x65\x73\x74'](this['\x74\x57\x62\x63\x48\x62']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x66\x71\x57\x62\x4e\x43'][-0x12f5+0x8b*-0x2f+0xc1*0x3b]:--this['\x66\x71\x57\x62\x4e\x43'][-0x1892+-0x20bd+0x394f];return this['\x54\x57\x4b\x70\x62\x6f'](_0x4e7eb5);},_0x3e834f['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x54\x57\x4b\x70\x62\x6f']=function(_0x338b70){if(!Boolean(~_0x338b70))return _0x338b70;return this['\x69\x65\x6c\x46\x4b\x4e'](this['\x77\x57\x55\x57\x59\x77']);},_0x3e834f['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x69\x65\x6c\x46\x4b\x4e']=function(_0x3d8f65){for(let _0x56c900=0x2457+-0x9d8+0x3*-0x8d5,_0x59be13=this['\x66\x71\x57\x62\x4e\x43']['\x6c\x65\x6e\x67\x74\x68'];_0x56c900<_0x59be13;_0x56c900++){this['\x66\x71\x57\x62\x4e\x43']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x59be13=this['\x66\x71\x57\x62\x4e\x43']['\x6c\x65\x6e\x67\x74\x68'];}return _0x3d8f65(this['\x66\x71\x57\x62\x4e\x43'][-0x25ad+-0xe1e+-0x1*-0x33cb]);},(''+function(){return 0x2404+-0x204f+-0x3b5;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')===-(-0x2349+-0x8*0x2b2+-0x2fe*-0x13)&&new _0x3e834f(_0x936a)['\x67\x44\x70\x6d\x55\x66'](),_0x936a['\x6d\x65\x58\x71\x70\x75']=!![];}_0x247b0a=_0x936a['\x6e\x66\x6d\x4b\x6d\x46'](_0x247b0a,_0x45fb43),_0x936a['\x63\x6a\x77\x70\x69\x65'][_0x13078f]=_0x247b0a;}else _0x247b0a=_0x2c2321;return _0x247b0a;}function _0x40bd47(){const _0x2f8fd0=_0x177ecd,_0x15fd83={'\x65\x72\x6a\x4a\x7a':_0x2f8fd0(0x1a7,'\x61\x73\x71\x25')+_0x2f8fd0(0x21d,'\x55\x68\x78\x39')+_0x2f8fd0(0x1ac,'\x69\x28\x6c\x25')+_0x2f8fd0(0x21b,'\x28\x5b\x55\x44')+_0x2f8fd0(0x193,'\x52\x46\x5e\x5d'),'\x50\x4d\x53\x41\x58':function(_0x3418d5,_0x1b9cd8,_0x34df5b){return _0x3418d5(_0x1b9cd8,_0x34df5b);},'\x41\x50\x62\x43\x73':_0x2f8fd0(0x1b9,'\x61\x73\x71\x25'),'\x64\x73\x4f\x49\x5a':_0x2f8fd0(0x1bd,'\x4d\x4b\x6f\x35')+_0x2f8fd0(0x1c9,'\x49\x67\x33\x40'),'\x45\x77\x4a\x49\x76':function(_0x29a339,_0x666ab6){return _0x29a339!==_0x666ab6;},'\x5a\x6d\x57\x7a\x46':_0x2f8fd0(0x201,'\x23\x53\x56\x51'),'\x5a\x48\x78\x50\x6a':function(_0x408605,_0x8a0ab4){return _0x408605(_0x8a0ab4);},'\x50\x5a\x6d\x65\x48':_0x2f8fd0(0x21e,'\x39\x4d\x30\x7a'),'\x4e\x68\x46\x5a\x43':_0x2f8fd0(0x19a,'\x55\x68\x78\x39'),'\x72\x67\x68\x57\x6a':function(_0x3fb9df,..._0xf31634){return _0x3fb9df(..._0xf31634);},'\x6f\x78\x66\x52\x58':_0x2f8fd0(0x203,'\x63\x58\x64\x34'),'\x72\x55\x49\x78\x67':function(_0x207c19,_0xcace39,_0x5dc9c7){return _0x207c19(_0xcace39,_0x5dc9c7);},'\x73\x65\x55\x62\x51':function(_0x209647,_0x184526,_0x1f70af){return _0x209647(_0x184526,_0x1f70af);},'\x58\x73\x71\x4c\x76':_0x2f8fd0(0x223,'\x38\x62\x34\x5a'),'\x62\x56\x6a\x78\x4f':function(_0x59d815,_0x1864a7,_0x1f4fd2){return _0x59d815(_0x1864a7,_0x1f4fd2);},'\x50\x61\x79\x43\x43':_0x2f8fd0(0x1d6,'\x28\x5b\x55\x44')+'\x69\x73','\x56\x78\x56\x42\x77':function(_0x4f6863,_0x5ecbc4,_0x12f6d2){return _0x4f6863(_0x5ecbc4,_0x12f6d2);},'\x70\x7a\x6d\x69\x71':_0x2f8fd0(0x18a,'\x55\x68\x78\x39')+'\x73\x74','\x4a\x43\x61\x78\x4c':_0x2f8fd0(0x1f8,'\x28\x5b\x55\x44'),'\x47\x48\x74\x77\x77':function(_0x590cef,_0x198fba,_0x1804c1){return _0x590cef(_0x198fba,_0x1804c1);},'\x51\x41\x4b\x79\x47':'\x6f\x75\x74\x63\x6f\x6d\x65','\x71\x70\x6c\x49\x53':function(_0x34548c,_0x505973,_0x57eb42){return _0x34548c(_0x505973,_0x57eb42);},'\x42\x42\x6e\x6c\x46':_0x2f8fd0(0x1ca,'\x36\x21\x26\x38')+'\x5f\x63\x61\x6e\x64\x69\x64\x61'+'\x74\x65','\x45\x59\x53\x4a\x54':function(_0x3cd4df,_0x4f998c){return _0x3cd4df!==_0x4f998c;},'\x66\x45\x57\x54\x55':function(_0x47e3a5,_0x7160ed){return _0x47e3a5===_0x7160ed;},'\x6f\x71\x65\x69\x57':_0x2f8fd0(0x209,'\x24\x46\x70\x61'),'\x6b\x48\x46\x69\x45':_0x2f8fd0(0x214,'\x79\x6b\x77\x6e')},_0x48ba9a=process.env.MEMORY_GRAPH_REMOTE_URL||'',_0x33e97d=process.env.MEMORY_GRAPH_REMOTE_KEY||'',_0x584fd0=_0x15fd83[_0x2f8fd0(0x225,'\x52\x46\x5e\x5d')](Number,process.env.MEMORY_GRAPH_REMOTE_TIMEOUT_MS)||-0x1db7+0x19fa+0x1745;async function _0x1fe03a(_0x5e7cbb,_0x595145){const _0xb20548=_0x2f8fd0;if(!_0x48ba9a)throw new Error(_0x15fd83[_0xb20548(0x239,'\x72\x70\x78\x6b')]);const _0x2faf9a=''+_0x48ba9a[_0xb20548(0x195,'\x55\x68\x78\x39')](/\/+$/,'')+_0x5e7cbb,_0x2d282c=new AbortController(),_0x23aeda=setTimeout(()=>_0x2d282c['\x61\x62\x6f\x72\x74'](),_0x584fd0);try{const _0x2b0d1d=await _0x15fd83[_0xb20548(0x1f9,'\x36\x21\x26\x38')](fetch,_0x2faf9a,{'\x6d\x65\x74\x68\x6f\x64':_0x15fd83[_0xb20548(0x221,'\x25\x53\x41\x31')],'\x68\x65\x61\x64\x65\x72\x73':{'\x43\x6f\x6e\x74\x65\x6e\x74\x2d\x54\x79\x70\x65':_0x15fd83['\x64\x73\x4f\x49\x5a'],..._0x33e97d?{'\x41\x75\x74\x68\x6f\x72\x69\x7a\x61\x74\x69\x6f\x6e':_0xb20548(0x179,'\x23\x53\x56\x51')+_0x33e97d}:{}},'\x62\x6f\x64\x79':JSON[_0xb20548(0x20c,'\x28\x5b\x55\x44')+'\x79'](_0x595145),'\x73\x69\x67\x6e\x61\x6c':_0x2d282c[_0xb20548(0x19d,'\x44\x65\x4f\x59')]});if(!_0x2b0d1d['\x6f\x6b'])throw new Error(_0xb20548(0x1df,'\x61\x78\x79\x57')+_0xb20548(0x1ef,'\x52\x46\x5e\x5d')+'\x20'+_0x2b0d1d[_0xb20548(0x1b7,'\x7a\x44\x26\x29')]);return await _0x2b0d1d[_0xb20548(0x1f4,'\x38\x62\x34\x5a')]();}finally{if(_0x15fd83[_0xb20548(0x1e5,'\x42\x44\x59\x44')](_0x15fd83[_0xb20548(0x190,'\x39\x4d\x30\x7a')],_0x15fd83[_0xb20548(0x23a,'\x65\x78\x42\x53')]))return _0x1aac28[_0xb20548(0x1fb,'\x46\x37\x49\x21')+_0xb20548(0x1c4,'\x66\x30\x69\x31')+_0xb20548(0x1ee,'\x6e\x56\x53\x68')](_0x9f577a);else _0x15fd83['\x5a\x48\x78\x50\x6a'](clearTimeout,_0x23aeda);}}function _0x27c72d(_0x2bae98,_0x10f3e0){return async function(..._0x269c13){const _0x4ce1a1=_0x936a;if(_0x15fd83[_0x4ce1a1(0x1b0,'\x31\x48\x43\x34')]!==_0x15fd83['\x4e\x68\x46\x5a\x43'])try{return await _0x15fd83['\x72\x67\x68\x57\x6a'](_0x10f3e0,..._0x269c13);}catch(_0x470ed9){return _0x2bae98(..._0x269c13);}else return _0x2b47d2['\x72\x65\x63\x6f\x72\x64\x4f\x75'+_0x4ce1a1(0x1cb,'\x7a\x44\x26\x29')+_0x4ce1a1(0x1ae,'\x28\x5b\x55\x44')](_0x1ebb09);};}return{'\x6e\x61\x6d\x65':_0x2f8fd0(0x217,'\x29\x55\x6a\x48'),'\x67\x65\x74\x41\x64\x76\x69\x63\x65':_0x15fd83[_0x2f8fd0(0x23b,'\x24\x46\x70\x61')](_0x27c72d,_0x27b3b8=>_0x36e94b[_0x2f8fd0(0x1d5,'\x24\x46\x70\x61')+_0x2f8fd0(0x22a,'\x26\x40\x66\x50')](_0x27b3b8),async _0xbb3ba0=>{const _0x44faa5=_0x2f8fd0;if(_0x15fd83[_0x44faa5(0x1ba,'\x61\x73\x71\x25')]===_0x15fd83['\x6f\x78\x66\x52\x58']){const _0x17786b=await _0x15fd83[_0x44faa5(0x1e8,'\x36\x21\x26\x38')](_0x1fe03a,_0x44faa5(0x18c,'\x46\x37\x49\x21')+'\x63\x65',{'\x73\x69\x67\x6e\x61\x6c\x73':_0xbb3ba0['\x73\x69\x67\x6e\x61\x6c\x73'],'\x67\x65\x6e\x65\x73':(_0xbb3ba0[_0x44faa5(0x23e,'\x61\x78\x79\x57')]||[])['\x6d\x61\x70'](_0x2e5faa=>({'\x69\x64':_0x2e5faa['\x69\x64'],'\x63\x61\x74\x65\x67\x6f\x72\x79':_0x2e5faa[_0x44faa5(0x1cf,'\x46\x37\x49\x21')],'\x74\x79\x70\x65':_0x2e5faa[_0x44faa5(0x1bf,'\x6e\x56\x53\x68')]})),'\x64\x72\x69\x66\x74\x45\x6e\x61\x62\x6c\x65\x64':_0xbb3ba0[_0x44faa5(0x22e,'\x44\x65\x4f\x59')+_0x44faa5(0x1a2,'\x74\x66\x34\x21')]});return{'\x63\x75\x72\x72\x65\x6e\x74\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79':_0x17786b[_0x44faa5(0x1ea,'\x65\x78\x42\x53')+_0x44faa5(0x18b,'\x6e\x56\x53\x68')]||_0x36e94b[_0x44faa5(0x213,'\x38\x43\x34\x33')+_0x44faa5(0x184,'\x29\x55\x6a\x48')](_0xbb3ba0[_0x44faa5(0x20a,'\x39\x4d\x30\x7a')]),'\x70\x72\x65\x66\x65\x72\x72\x65\x64\x47\x65\x6e\x65\x49\x64':_0x17786b[_0x44faa5(0x1a9,'\x61\x73\x71\x25')+_0x44faa5(0x231,'\x44\x65\x4f\x59')]||null,'\x62\x61\x6e\x6e\x65\x64\x47\x65\x6e\x65\x49\x64\x73':new Set(_0x17786b[_0x44faa5(0x178,'\x61\x73\x71\x25')+_0x44faa5(0x1c2,'\x65\x78\x42\x53')]||[]),'\x65\x78\x70\x6c\x61\x6e\x61\x74\x69\x6f\x6e':Array[_0x44faa5(0x1cd,'\x6a\x63\x30\x2a')](_0x17786b['\x65\x78\x70\x6c\x61\x6e\x61\x74'+_0x44faa5(0x1a5,'\x6e\x58\x6f\x2a')])?_0x17786b[_0x44faa5(0x19f,'\x63\x58\x64\x34')+_0x44faa5(0x1e4,'\x38\x43\x34\x33')]:[]};}else return _0x1f5999['\x63\x6f\x6d\x70\x75\x74\x65\x53'+_0x44faa5(0x186,'\x42\x44\x59\x44')](_0x37d8ae);}),'\x72\x65\x63\x6f\x72\x64\x53\x69\x67\x6e\x61\x6c\x53\x6e\x61\x70\x73\x68\x6f\x74'(_0x340b33){const _0xe5b0b6=_0x2f8fd0,_0x217dc8=_0x36e94b[_0xe5b0b6(0x1d3,'\x6e\x58\x6f\x2a')+'\x67\x6e\x61\x6c\x53\x6e\x61\x70'+_0xe5b0b6(0x1e1,'\x55\x68\x78\x39')](_0x340b33);return _0x15fd83[_0xe5b0b6(0x1b4,'\x6e\x58\x6f\x2a')](_0x1fe03a,_0xe5b0b6(0x23f,'\x23\x4d\x57\x25')+'\x73\x74',{'\x6b\x69\x6e\x64':_0x15fd83[_0xe5b0b6(0x1e6,'\x46\x37\x49\x21')],'\x65\x76\x65\x6e\x74':_0x217dc8})[_0xe5b0b6(0x1f7,'\x61\x24\x74\x33')](()=>{}),_0x217dc8;},'\x72\x65\x63\x6f\x72\x64\x48\x79\x70\x6f\x74\x68\x65\x73\x69\x73'(_0x3cec9c){const _0x179c4b=_0x2f8fd0,_0x1fc73a={'\x49\x4e\x7a\x78\x73':function(_0x438f47,_0x329127,_0x8e4c5a){const _0x275e86=_0x936a;return _0x15fd83[_0x275e86(0x1fd,'\x6a\x63\x30\x2a')](_0x438f47,_0x329127,_0x8e4c5a);},'\x62\x70\x6d\x4f\x6e':_0x179c4b(0x20f,'\x36\x21\x26\x38')+'\x73\x74','\x77\x50\x70\x44\x56':_0x179c4b(0x234,'\x6a\x63\x30\x2a')};if(_0x179c4b(0x1be,'\x46\x37\x49\x21')!==_0x179c4b(0x222,'\x66\x30\x69\x31')){const _0x5b0cb6=_0x36e94b[_0x179c4b(0x17a,'\x5d\x57\x6f\x78')+_0x179c4b(0x1c5,'\x4d\x4a\x28\x78')](_0x3cec9c);return _0x15fd83[_0x179c4b(0x187,'\x39\x4d\x30\x7a')](_0x1fe03a,_0x179c4b(0x18f,'\x29\x58\x77\x23')+'\x73\x74',{'\x6b\x69\x6e\x64':_0x15fd83[_0x179c4b(0x1d7,'\x38\x43\x34\x33')],'\x65\x76\x65\x6e\x74':_0x5b0cb6})['\x63\x61\x74\x63\x68'](()=>{}),_0x5b0cb6;}else{const _0x417f56=_0x4fe13c[_0x179c4b(0x1c6,'\x24\x46\x70\x61')+_0x179c4b(0x1f3,'\x74\x66\x34\x21')](_0x375bc3);return _0x1fc73a[_0x179c4b(0x212,'\x24\x46\x70\x61')](_0x242ebb,_0x1fc73a[_0x179c4b(0x1e2,'\x29\x58\x77\x23')],{'\x6b\x69\x6e\x64':_0x1fc73a[_0x179c4b(0x1b2,'\x63\x58\x64\x34')],'\x65\x76\x65\x6e\x74':_0x417f56})['\x63\x61\x74\x63\x68'](()=>{}),_0x417f56;}},'\x72\x65\x63\x6f\x72\x64\x41\x74\x74\x65\x6d\x70\x74'(_0x6734d4){const _0x9501ff=_0x2f8fd0,_0x2d009e=_0x36e94b[_0x9501ff(0x1f1,'\x37\x79\x61\x46')+_0x9501ff(0x1c3,'\x49\x67\x33\x40')](_0x6734d4);return _0x15fd83[_0x9501ff(0x235,'\x23\x4d\x57\x25')](_0x1fe03a,_0x15fd83[_0x9501ff(0x17d,'\x29\x58\x77\x23')],{'\x6b\x69\x6e\x64':_0x15fd83[_0x9501ff(0x1aa,'\x6e\x56\x53\x68')],'\x65\x76\x65\x6e\x74':_0x2d009e})[_0x9501ff(0x1db,'\x61\x73\x71\x25')](()=>{}),_0x2d009e;},'\x72\x65\x63\x6f\x72\x64\x4f\x75\x74\x63\x6f\x6d\x65'(_0x4db7c0){const _0x3d8197=_0x2f8fd0,_0x50644c=_0x36e94b[_0x3d8197(0x23c,'\x55\x68\x78\x39')+_0x3d8197(0x1da,'\x4b\x4d\x62\x33')+_0x3d8197(0x182,'\x61\x24\x74\x33')](_0x4db7c0);return _0x50644c&&_0x15fd83[_0x3d8197(0x23b,'\x24\x46\x70\x61')](_0x1fe03a,_0x15fd83[_0x3d8197(0x1b6,'\x4b\x4d\x62\x33')],{'\x6b\x69\x6e\x64':_0x15fd83[_0x3d8197(0x216,'\x23\x4d\x57\x25')],'\x65\x76\x65\x6e\x74':_0x50644c})[_0x3d8197(0x21a,'\x29\x55\x6a\x48')](()=>{}),_0x50644c;},'\x72\x65\x63\x6f\x72\x64\x45\x78\x74\x65\x72\x6e\x61\x6c\x43\x61\x6e\x64\x69\x64\x61\x74\x65'(_0x53a329){const _0xf0330d=_0x2f8fd0;if(_0x15fd83[_0xf0330d(0x230,'\x42\x67\x61\x67')](_0xf0330d(0x1e0,'\x4d\x4b\x6f\x35'),_0xf0330d(0x1f0,'\x31\x48\x43\x34'))){const _0x3d312f=_0x36e94b[_0xf0330d(0x236,'\x46\x37\x49\x21')+_0xf0330d(0x206,'\x4d\x4b\x6f\x35')+_0xf0330d(0x191,'\x61\x78\x79\x57')](_0x53a329);return _0x3d312f&&_0x15fd83[_0xf0330d(0x1ec,'\x61\x24\x74\x33')](_0x1fe03a,_0xf0330d(0x1d9,'\x42\x67\x61\x67')+'\x73\x74',{'\x6b\x69\x6e\x64':_0x15fd83[_0xf0330d(0x1b1,'\x55\x68\x78\x39')],'\x65\x76\x65\x6e\x74':_0x3d312f})[_0xf0330d(0x1fe,'\x29\x58\x77\x23')](()=>{}),_0x3d312f;}else{const _0x3b1158=_0x151888[_0xf0330d(0x1e7,'\x39\x33\x77\x6b')+_0xf0330d(0x237,'\x23\x4d\x57\x25')+_0xf0330d(0x22d,'\x29\x58\x77\x23')](_0x26871d);return _0x3b1158&&_0x15fd83[_0xf0330d(0x1d8,'\x79\x6b\x77\x6e')](_0x226aee,_0x15fd83[_0xf0330d(0x18d,'\x75\x62\x61\x75')],{'\x6b\x69\x6e\x64':_0x15fd83[_0xf0330d(0x19c,'\x7a\x44\x26\x29')],'\x65\x76\x65\x6e\x74':_0x3b1158})[_0xf0330d(0x211,'\x4d\x4a\x28\x78')](()=>{}),_0x3b1158;}},'\x6d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x50\x61\x74\x68'(){const _0xc6e1be=_0x2f8fd0,_0x8dd821={'\x52\x6a\x49\x57\x6e':function(_0x471a76,_0x50fcf3,_0x1a5709){const _0x23a1d2=_0x936a;return _0x15fd83[_0x23a1d2(0x1c1,'\x65\x78\x42\x53')](_0x471a76,_0x50fcf3,_0x1a5709);},'\x4d\x55\x6a\x72\x58':_0x15fd83[_0xc6e1be(0x189,'\x7a\x44\x26\x29')],'\x75\x69\x4e\x41\x44':_0x15fd83[_0xc6e1be(0x1a6,'\x65\x70\x78\x2a')]};if(_0x15fd83[_0xc6e1be(0x1fc,'\x65\x78\x42\x53')](_0xc6e1be(0x1c0,'\x6a\x63\x30\x2a'),_0x15fd83[_0xc6e1be(0x1ad,'\x23\x53\x56\x51')]))return _0x36e94b['\x6d\x65\x6d\x6f\x72\x79\x47\x72'+_0xc6e1be(0x1ab,'\x24\x46\x70\x61')]();else{const _0x13d8a7=_0x15fc15[_0xc6e1be(0x1de,'\x37\x79\x61\x46')+_0xc6e1be(0x177,'\x44\x65\x4f\x59')+_0xc6e1be(0x219,'\x36\x21\x26\x38')](_0x1b1fa9);return zCFMzN[_0xc6e1be(0x1e9,'\x74\x66\x34\x21')](_0x3e49ba,zCFMzN[_0xc6e1be(0x22f,'\x26\x40\x66\x50')],{'\x6b\x69\x6e\x64':zCFMzN[_0xc6e1be(0x1a4,'\x42\x67\x61\x67')],'\x65\x76\x65\x6e\x74':_0x13d8a7})['\x63\x61\x74\x63\x68'](()=>{}),_0x13d8a7;}},'\x63\x6f\x6d\x70\x75\x74\x65\x53\x69\x67\x6e\x61\x6c\x4b\x65\x79'(_0x345e06){const _0x4ca380=_0x2f8fd0;return _0x15fd83[_0x4ca380(0x1dd,'\x76\x51\x43\x34')]===_0x4ca380(0x1f6,'\x37\x79\x61\x46')?_0xde1aba[_0x4ca380(0x218,'\x63\x58\x64\x34')+'\x74\x65\x6d\x70\x74'](_0x5431b2):_0x36e94b['\x63\x6f\x6d\x70\x75\x74\x65\x53'+_0x4ca380(0x20e,'\x65\x78\x42\x53')](_0x345e06);},'\x74\x72\x79\x52\x65\x61\x64\x4d\x65\x6d\x6f\x72\x79\x47\x72\x61\x70\x68\x45\x76\x65\x6e\x74\x73'(_0x50e8aa){const _0x3e056f=_0x2f8fd0;return _0x36e94b[_0x3e056f(0x229,'\x26\x40\x66\x50')+_0x3e056f(0x1bc,'\x29\x58\x77\x23')+_0x3e056f(0x188,'\x4d\x4b\x6f\x35')](_0x50e8aa);}};}function _0x3d5440(){const _0x307291=_0x177ecd,_0x59ddbc={'\x59\x63\x48\x70\x6d':function(_0xe1664,_0x495fee){return _0xe1664!==_0x495fee;},'\x70\x4c\x4e\x4e\x6f':_0x307291(0x192,'\x36\x21\x26\x38'),'\x6b\x48\x61\x47\x52':_0x307291(0x1b8,'\x28\x5b\x55\x44')+_0x307291(0x1d0,'\x46\x37\x49\x21'),'\x79\x51\x61\x73\x6e':function(_0x475c55,_0x433287,_0x2c7f2e){return _0x475c55(_0x433287,_0x2c7f2e);},'\x53\x4e\x72\x79\x65':function(_0x3d9c10){return _0x3d9c10();},'\x75\x65\x4d\x4f\x4d':function(_0x4ec9ab,_0x25373d){return _0x4ec9ab===_0x25373d;},'\x67\x74\x42\x58\x58':'\x72\x65\x6d\x6f\x74\x65'},_0x14ec04=(function(){let _0x330554=!![];return function(_0x186fae,_0x22bcf5){const _0x49aa45=_0x936a;if(_0x59ddbc[_0x49aa45(0x17b,'\x23\x53\x56\x51')](_0x59ddbc['\x70\x4c\x4e\x4e\x6f'],_0x49aa45(0x1c8,'\x38\x43\x34\x33'))){const _0x42ceb0=_0x330554?function(){const _0x205906=_0x49aa45;if(_0x22bcf5){const _0x151c75=_0x22bcf5[_0x205906(0x1d2,'\x39\x4d\x30\x7a')](_0x186fae,arguments);return _0x22bcf5=null,_0x151c75;}}:function(){};return _0x330554=![],_0x42ceb0;}else return _0x333bc8[_0x49aa45(0x21c,'\x6e\x56\x53\x68')+_0x49aa45(0x1a1,'\x7a\x44\x26\x29')](_0x2c827f);};}()),_0x5c1e21=_0x59ddbc[_0x307291(0x1b5,'\x29\x55\x6a\x48')](_0x14ec04,this,function(){const _0x104b8d=_0x307291;return _0x5c1e21[_0x104b8d(0x227,'\x39\x33\x77\x6b')]()[_0x104b8d(0x1ed,'\x65\x70\x78\x2a')]('\x28\x28\x28\x2e\x2b\x29\x2b\x29'+_0x104b8d(0x202,'\x76\x51\x43\x34'))[_0x104b8d(0x19e,'\x24\x46\x70\x61')]()[_0x104b8d(0x1a0,'\x72\x70\x78\x6b')+_0x104b8d(0x1ff,'\x75\x62\x61\x75')](_0x5c1e21)[_0x104b8d(0x17c,'\x47\x21\x62\x4f')](_0x59ddbc[_0x104b8d(0x1ce,'\x79\x6b\x77\x6e')]);});_0x59ddbc[_0x307291(0x215,'\x6e\x58\x6f\x2a')](_0x5c1e21);const _0x53db38=(process.env.MEMORY_GRAPH_PROVIDER||'\x6c\x6f\x63\x61\x6c')[_0x307291(0x1b3,'\x42\x44\x59\x44')+_0x307291(0x200,'\x75\x62\x61\x75')]()[_0x307291(0x21f,'\x31\x48\x43\x34')]();if(_0x59ddbc[_0x307291(0x194,'\x61\x78\x79\x57')](_0x53db38,_0x59ddbc[_0x307291(0x1a3,'\x61\x24\x74\x33')]))return _0x59ddbc[_0x307291(0x204,'\x5b\x32\x5e\x79')](_0x40bd47);return _0x2d2b87;}const _0x77e235=_0x3d5440();module['\x65\x78\x70\x6f\x72\x74\x73']=_0x77e235;
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;