@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,30 @@
1
- function _0x39a1(){const _0xe3e40a=['\x57\x50\x2f\x63\x4f\x30\x69\x4c','\x57\x35\x74\x64\x48\x78\x43','\x57\x37\x70\x64\x51\x75\x33\x63\x47\x30\x2f\x63\x49\x38\x6f\x69\x78\x71','\x57\x50\x46\x63\x4d\x43\x6f\x70\x63\x43\x6f\x32\x57\x51\x48\x2f\x57\x4f\x37\x63\x4c\x4b\x70\x63\x49\x4b\x4c\x32','\x63\x4b\x78\x64\x54\x6d\x6b\x63\x45\x38\x6f\x72\x6c\x38\x6b\x39\x57\x37\x74\x64\x4c\x6d\x6b\x2f\x75\x6d\x6f\x35','\x57\x34\x6e\x4a\x44\x66\x66\x49\x57\x50\x6e\x52\x74\x47','\x57\x4f\x75\x4b\x6c\x72\x34\x61','\x57\x36\x4a\x63\x56\x68\x74\x64\x51\x53\x6b\x67\x57\x51\x31\x4a\x74\x47','\x57\x50\x74\x63\x4d\x53\x6f\x64\x63\x43\x6f\x36\x57\x35\x79\x43\x57\x52\x33\x63\x4a\x30\x78\x63\x50\x61','\x65\x43\x6b\x54\x61\x38\x6f\x71\x72\x4d\x54\x44\x79\x71','\x7a\x43\x6f\x79\x57\x36\x2f\x64\x47\x53\x6f\x76\x71\x30\x2f\x63\x49\x6d\x6f\x69\x77\x53\x6f\x49','\x70\x38\x6b\x72\x57\x37\x2f\x64\x52\x6d\x6f\x59\x69\x62\x42\x64\x50\x71','\x6b\x38\x6f\x37\x76\x64\x76\x4f\x57\x34\x78\x64\x4f\x77\x4f','\x79\x6d\x6f\x36\x57\x4f\x6c\x63\x51\x53\x6b\x63\x57\x34\x5a\x64\x53\x49\x30','\x45\x6d\x6f\x2b\x57\x51\x44\x42\x74\x61\x33\x64\x4c\x4d\x75\x79\x57\x50\x7a\x75\x71\x58\x53','\x57\x35\x4e\x64\x47\x4e\x48\x2b','\x6c\x5a\x65\x4c\x63\x53\x6b\x55\x43\x57','\x57\x34\x47\x56\x42\x57\x57\x76\x45\x31\x39\x63\x57\x35\x50\x61\x41\x53\x6b\x42\x57\x50\x75','\x57\x4f\x4f\x37\x6c\x62\x6d\x57','\x57\x36\x7a\x46\x6e\x43\x6b\x49\x57\x50\x4c\x45\x57\x35\x64\x64\x54\x71','\x57\x52\x70\x64\x51\x63\x4a\x63\x53\x53\x6f\x71\x57\x4f\x50\x35\x44\x32\x42\x63\x4a\x62\x38','\x77\x61\x52\x63\x4c\x43\x6b\x66\x75\x65\x4f','\x57\x36\x62\x45\x6c\x66\x54\x55','\x57\x50\x58\x48\x6a\x4c\x7a\x76\x6e\x48\x4b','\x57\x52\x33\x64\x50\x63\x4e\x63\x56\x43\x6f\x79\x57\x51\x58\x75\x46\x4c\x37\x63\x48\x58\x4f','\x57\x50\x53\x64\x57\x37\x4a\x64\x53\x38\x6f\x6a\x57\x37\x68\x64\x4e\x4d\x43\x53\x57\x37\x75\x65\x77\x59\x30','\x42\x77\x7a\x33\x74\x6d\x6f\x31\x6c\x33\x37\x63\x4d\x6d\x6f\x79\x79\x43\x6b\x34\x57\x37\x65\x6d','\x73\x48\x70\x64\x4a\x53\x6f\x49\x57\x35\x4a\x63\x48\x65\x2f\x63\x4e\x47','\x6f\x53\x6b\x50\x57\x37\x65\x41\x67\x76\x75','\x6f\x5a\x33\x63\x4a\x43\x6f\x4b\x6b\x43\x6f\x4d\x72\x53\x6f\x52','\x57\x4f\x74\x64\x51\x47\x66\x54\x74\x68\x78\x63\x4a\x38\x6b\x75\x57\x51\x6c\x64\x48\x53\x6f\x63','\x6f\x65\x33\x63\x50\x43\x6f\x4d\x6d\x43\x6f\x67\x63\x75\x5a\x63\x4f\x75\x52\x64\x4d\x71'];_0x39a1=function(){return _0xe3e40a;};return _0x39a1();}const _0x51b9be=_0x4acd;(function(_0x4a011b,_0x221acc){const _0x3512f4=_0x4acd,_0x12b332=_0x4a011b();while(!![]){try{const _0x54fa4a=-parseInt(_0x3512f4(0xcb,'\x2a\x38\x73\x40'))/(0x1f3*-0xe+0x2627+-0xadc)+parseInt(_0x3512f4(0xcf,'\x2a\x38\x73\x40'))/(0x1ac6*-0x1+0x1958+0x170)+parseInt(_0x3512f4(0xc2,'\x6b\x36\x55\x68'))/(0x80*0x7+-0xe3*0x25+0x1d52)*(parseInt(_0x3512f4(0xd6,'\x21\x66\x49\x7a'))/(0x1*0x7d8+-0x1a31+0x125d))+parseInt(_0x3512f4(0xc5,'\x53\x41\x58\x4b'))/(-0x1*0x9a6+0x1633*0x1+-0xc88)+-parseInt(_0x3512f4(0xda,'\x24\x53\x61\x39'))/(-0x1*0x5d5+0x1452+-0xe77)+parseInt(_0x3512f4(0xc8,'\x23\x6f\x42\x4f'))/(-0x2142+0x1c70+-0x1*-0x4d9)+-parseInt(_0x3512f4(0xd0,'\x53\x70\x28\x56'))/(-0x15*-0x15b+-0x4bc*0x4+-0x97f);if(_0x54fa4a===_0x221acc)break;else _0x12b332['push'](_0x12b332['shift']());}catch(_0x1c8838){_0x12b332['push'](_0x12b332['shift']());}}}(_0x39a1,-0x17d03+-0x331bb+0xa1f2*0xb));const _0x381d66=(function(){let _0x34a46e=!![];return function(_0x5da537,_0x2e3a43){const _0x4358e7=_0x34a46e?function(){const _0x31f97e=_0x4acd;if(_0x2e3a43){const _0x3b8a04=_0x2e3a43[_0x31f97e(0xc9,'\x40\x64\x55\x4c')](_0x5da537,arguments);return _0x2e3a43=null,_0x3b8a04;}}:function(){};return _0x34a46e=![],_0x4358e7;};}()),_0x4ce2dd=_0x381d66(this,function(){const _0xbc08e8=_0x4acd,_0x7d4c92={};_0x7d4c92[_0xbc08e8(0xbd,'\x40\x64\x55\x4c')]=_0xbc08e8(0xbc,'\x40\x64\x55\x4c')+'\x2b\x29\x2b\x24';const _0x386ffc=_0x7d4c92;return _0x4ce2dd[_0xbc08e8(0xc3,'\x68\x6f\x23\x51')]()[_0xbc08e8(0xc7,'\x48\x53\x46\x6d')](_0xbc08e8(0xc0,'\x54\x41\x36\x42')+_0xbc08e8(0xc6,'\x5b\x6d\x67\x52'))['\x74\x6f\x53\x74\x72\x69\x6e\x67']()[_0xbc08e8(0xc4,'\x62\x6a\x72\x24')+_0xbc08e8(0xd8,'\x72\x71\x72\x45')](_0x4ce2dd)[_0xbc08e8(0xd3,'\x53\x41\x58\x4b')](_0x386ffc['\x6e\x6f\x71\x61\x49']);});_0x4ce2dd();function _0x4acd(_0x4ad79b,_0x45eee6){_0x4ad79b=_0x4ad79b-(-0x53*-0x19+-0x15d7+0x1cf*0x8);const _0x5e5858=_0x39a1();let _0x1444c5=_0x5e5858[_0x4ad79b];if(_0x4acd['\x56\x77\x61\x6a\x4f\x54']===undefined){var _0x2423a1=function(_0x2c4bed){const _0x8a16bb='\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 _0x200746='',_0x5b261f='',_0x52b410=_0x200746+_0x2423a1,_0x5ea825=(''+function(){return-0xb00+-0x1b*0x11d+0x290f;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!==-(-0x2a9+0xa6f+0x27*-0x33);for(let _0x2272a4=0xe37+-0x35*0x7d+0xbaa,_0x317762,_0x5b67c3,_0x17d8c3=0x57e+0x14e0+-0x1a5e;_0x5b67c3=_0x2c4bed['\x63\x68\x61\x72\x41\x74'](_0x17d8c3++);~_0x5b67c3&&(_0x317762=_0x2272a4%(0x72c+-0x177e+0x1056)?_0x317762*(-0x216e+-0x2f*0x2f+0x2a4f)+_0x5b67c3:_0x5b67c3,_0x2272a4++%(0x2*-0x1134+-0x22c*0xb+0x3a50))?_0x200746+=_0x5ea825||_0x52b410['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x17d8c3+(-0x2105+0x24da+-0x3cb))-(0x1ea8+-0x150a+-0x994)!==0xefe*-0x1+0x1*-0x25af+0x1f*0x1b3?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x1*-0xcee+0x1209*-0x1+0x1ff6&_0x317762>>(-(0x101b+-0x9b6*-0x1+-0x19cf)*_0x2272a4&-0x48b*-0x1+-0xeeb*-0x1+-0x1370)):_0x2272a4:0x13a3+0xa25+-0x1dc8){_0x5b67c3=_0x8a16bb['\x69\x6e\x64\x65\x78\x4f\x66'](_0x5b67c3);}for(let _0x56dbd2=-0x1357+-0x45*-0x4b+0x38*-0x4,_0x5948ed=_0x200746['\x6c\x65\x6e\x67\x74\x68'];_0x56dbd2<_0x5948ed;_0x56dbd2++){_0x5b261f+='\x25'+('\x30\x30'+_0x200746['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x56dbd2)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x1c42*-0x1+0xb5*0x29+0x3*-0x39))['\x73\x6c\x69\x63\x65'](-(0x1a5*-0x13+0x295*0x1+0x1cac));}return decodeURIComponent(_0x5b261f);};const _0x5a15ce=function(_0x4dc9a2,_0xcf6df3){let _0xccb063=[],_0xa160ce=-0x280*0x2+-0x69*0x13+0xccb,_0xf15c21,_0x388dab='';_0x4dc9a2=_0x2423a1(_0x4dc9a2);let _0x20f1a5;for(_0x20f1a5=-0x2*-0x287+-0x95e+0x450;_0x20f1a5<0x396+0x5de*0x1+-0x874;_0x20f1a5++){_0xccb063[_0x20f1a5]=_0x20f1a5;}for(_0x20f1a5=-0x2*0x543+-0x5*-0x388+-0x722;_0x20f1a5<0x2*-0x2d9+-0x1*0x1b4a+0x21fc;_0x20f1a5++){_0xa160ce=(_0xa160ce+_0xccb063[_0x20f1a5]+_0xcf6df3['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x20f1a5%_0xcf6df3['\x6c\x65\x6e\x67\x74\x68']))%(0x1ac6*-0x1+0x1958+0x26e),_0xf15c21=_0xccb063[_0x20f1a5],_0xccb063[_0x20f1a5]=_0xccb063[_0xa160ce],_0xccb063[_0xa160ce]=_0xf15c21;}_0x20f1a5=0x80*0x7+-0xe3*0x25+0x1d4f,_0xa160ce=0x1*0x7d8+-0x1a31+0x1259;for(let _0x426667=-0x1*0x9a6+0x1633*0x1+-0xc8d;_0x426667<_0x4dc9a2['\x6c\x65\x6e\x67\x74\x68'];_0x426667++){_0x20f1a5=(_0x20f1a5+(-0x1*0x5d5+0x1452+-0xe7c))%(-0x2142+0x1c70+-0x2*-0x2e9),_0xa160ce=(_0xa160ce+_0xccb063[_0x20f1a5])%(-0x15*-0x15b+-0x4bc*0x4+-0x887),_0xf15c21=_0xccb063[_0x20f1a5],_0xccb063[_0x20f1a5]=_0xccb063[_0xa160ce],_0xccb063[_0xa160ce]=_0xf15c21,_0x388dab+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x4dc9a2['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x426667)^_0xccb063[(_0xccb063[_0x20f1a5]+_0xccb063[_0xa160ce])%(-0xcc6+-0x1b6a+0x1498*0x2)]);}return _0x388dab;};_0x4acd['\x6b\x55\x6e\x5a\x6a\x75']=_0x5a15ce,_0x4acd['\x4c\x54\x7a\x71\x67\x79']={},_0x4acd['\x56\x77\x61\x6a\x4f\x54']=!![];}const _0x4857f9=_0x5e5858[0x1590+-0x25*0x4d+-0xa6f],_0x29c06e=_0x4ad79b+_0x4857f9,_0x4f0b3d=_0x4acd['\x4c\x54\x7a\x71\x67\x79'][_0x29c06e];if(!_0x4f0b3d){if(_0x4acd['\x72\x4b\x70\x67\x55\x70']===undefined){const _0x187cdf=function(_0x59efd9){this['\x65\x51\x74\x5a\x68\x4d']=_0x59efd9,this['\x52\x4b\x79\x63\x62\x6a']=[0xba4+0x2680+0x11*-0x2f3,0xd7d+-0x2*-0xfa9+0x2ccf*-0x1,-0x13a*-0x9+0x14a7+-0x1fb1],this['\x41\x58\x57\x6e\x6f\x65']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x59\x71\x52\x58\x71\x79']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x41\x61\x6b\x41\x4a\x62']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x187cdf['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x6d\x6e\x6c\x7a\x68\x4e']=function(){const _0x47f319=new RegExp(this['\x59\x71\x52\x58\x71\x79']+this['\x41\x61\x6b\x41\x4a\x62']),_0x57e990=_0x47f319['\x74\x65\x73\x74'](this['\x41\x58\x57\x6e\x6f\x65']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x52\x4b\x79\x63\x62\x6a'][0x10ef+0x1*-0x1c2b+0xb3d]:--this['\x52\x4b\x79\x63\x62\x6a'][0xcb*0x11+-0xe75+-0x2*-0x7d];return this['\x6e\x74\x6f\x77\x58\x4d'](_0x57e990);},_0x187cdf['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x6e\x74\x6f\x77\x58\x4d']=function(_0x4de764){if(!Boolean(~_0x4de764))return _0x4de764;return this['\x73\x51\x6a\x43\x4a\x41'](this['\x65\x51\x74\x5a\x68\x4d']);},_0x187cdf['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x73\x51\x6a\x43\x4a\x41']=function(_0x107dab){for(let _0x27398f=0xd1a+-0x1*-0x262d+-0x1*0x3347,_0x85fcd1=this['\x52\x4b\x79\x63\x62\x6a']['\x6c\x65\x6e\x67\x74\x68'];_0x27398f<_0x85fcd1;_0x27398f++){this['\x52\x4b\x79\x63\x62\x6a']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x85fcd1=this['\x52\x4b\x79\x63\x62\x6a']['\x6c\x65\x6e\x67\x74\x68'];}return _0x107dab(this['\x52\x4b\x79\x63\x62\x6a'][-0x146e+-0x264b+0x3ab9]);},(''+function(){return-0x1*-0xebf+-0x14ea+0x62b;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')===-(-0x6*0x37c+-0x4*-0x32c+0x839)&&new _0x187cdf(_0x4acd)['\x6d\x6e\x6c\x7a\x68\x4e'](),_0x4acd['\x72\x4b\x70\x67\x55\x70']=!![];}_0x1444c5=_0x4acd['\x6b\x55\x6e\x5a\x6a\x75'](_0x1444c5,_0x45eee6),_0x4acd['\x4c\x54\x7a\x71\x67\x79'][_0x29c06e]=_0x1444c5;}else _0x1444c5=_0x4f0b3d;return _0x1444c5;}const {SCHEMA_VERSION:_0x3fe964,canonicalize:_0x1fe7cf,computeAssetId:_0x19acd8,verifyAssetId:_0x581cf8}=require('\x40\x65\x76\x6f\x6d\x61\x70\x2f'+'\x67\x65\x70\x2d\x73\x64\x6b'),_0x342e04={};_0x342e04[_0x51b9be(0xd9,'\x72\x71\x72\x45')+_0x51b9be(0xcc,'\x68\x37\x42\x53')]=_0x3fe964,_0x342e04[_0x51b9be(0xbe,'\x2a\x38\x73\x40')+_0x51b9be(0xd7,'\x41\x6c\x48\x4e')]=_0x1fe7cf,_0x342e04[_0x51b9be(0xd2,'\x33\x78\x30\x24')+'\x73\x73\x65\x74\x49\x64']=_0x19acd8,_0x342e04[_0x51b9be(0xca,'\x23\x57\x25\x63')+_0x51b9be(0xcd,'\x31\x4c\x73\x28')]=_0x581cf8,module[_0x51b9be(0xce,'\x23\x6f\x42\x4f')]=_0x342e04;
1
+ // Content-addressable hashing for GEP assets.
2
+ //
3
+ // As of v1.84.0 the protocol primitives (SCHEMA_VERSION, canonicalize,
4
+ // computeAssetId, verifyAssetId) live in @evomap/gep-sdk. This module
5
+ // is a thin CommonJS facade so the ~13 internal callsites that
6
+ // `require('./contentHash')` keep working unchanged.
7
+ //
8
+ // Why move them out: every implementation that participates in GEP
9
+ // (this engine, gep-mcp-server, evox-Rust, the Hub backend) needs an
10
+ // authoritative copy of the canonicalize / computeAssetId algorithm.
11
+ // Hand-maintaining four copies caused the v1.80.8 "explore" enum
12
+ // drift incident; consolidating into the SDK makes that class of bug
13
+ // structurally impossible. If you find yourself wanting to inline the
14
+ // algorithm here again, stop -- bump @evomap/gep-sdk instead.
15
+ //
16
+ // Implementation note: @evomap/gep-sdk is published as ESM
17
+ // (`"type": "module"`). Node 22 supports `require()` of synchronous
18
+ // ESM packages, but only on 22.12.0 and later (the
19
+ // `--experimental-require-module` flag was unflagged in that
20
+ // release). `package.json#engines.node` is therefore pinned to
21
+ // `>=22.12` so the call below works in every supported runtime.
22
+
23
+ const { SCHEMA_VERSION, canonicalize, computeAssetId, verifyAssetId } = require('@evomap/gep-sdk');
24
+
25
+ module.exports = {
26
+ SCHEMA_VERSION,
27
+ canonicalize,
28
+ computeAssetId,
29
+ verifyAssetId,
30
+ };
@@ -0,0 +1,270 @@
1
+ 'use strict';
2
+
3
+ const crypto = require('crypto');
4
+
5
+ const assetStore = require('./assetStore');
6
+ const { computeAssetId, SCHEMA_VERSION } = require('./contentHash');
7
+ const { createGene } = require('./schemas/gene');
8
+ const { createCapsule } = require('./schemas/capsule');
9
+ const { redactString, sanitizePayload } = require('./sanitize');
10
+
11
+ const DEFAULT_SIGNALS = [
12
+ 'conversation_distillation',
13
+ 'reusable_capability',
14
+ 'agent_self_evolution',
15
+ ];
16
+
17
+ const SIGNAL_RULES = [
18
+ { signal: 'conversation_distillation', re: /\b(distill|distillation|distilled|蒸馏|提炼|萃取)\b/i },
19
+ { signal: 'gene_publish', re: /\b(gene|capsule|evomap|evolver|gep)\b|基因|胶囊/i },
20
+ { signal: 'reusable_capability', re: /\b(reusable|repeatable|workflow|playbook|capability)\b|可复用|复用|能力|流程/i },
21
+ { signal: 'visual_annotation', re: /\b(screenshot|annotat|mock|wireframe|playwright|visual)\b|截图|圈圈|标注|画图|飞书/i },
22
+ { signal: 'frontend_polish', re: /\b(frontend|ui|ux|interaction|polish|mockup)\b|前端|交互|打磨|体验/i },
23
+ { signal: 'proxy_sync', re: /\b(proxy|sync|mailbox|outbound|hub|asset_submit)\b|同步|队列|代理/i },
24
+ { signal: 'plugin_integration', re: /\b(plugin|codex|claude|cursor|antigravity|workbuddy|hook|notify)\b|插件|钩子/i },
25
+ { signal: 'test_verified', re: /\b(test|build|verify|passed|green)\b|测试|验证|通过/i },
26
+ ];
27
+
28
+ function trimText(value, max) {
29
+ const text = redactString(String(value || '').replace(/\s+/g, ' ').trim());
30
+ return text.length > max ? text.slice(0, max - 1) + '...' : text;
31
+ }
32
+
33
+ function asArray(value) {
34
+ if (!value) return [];
35
+ return Array.isArray(value) ? value : [value];
36
+ }
37
+
38
+ function normalizeList(value, maxItems, maxLen) {
39
+ return asArray(value)
40
+ .map((item) => trimText(item, maxLen || 180))
41
+ .filter(Boolean)
42
+ .slice(0, maxItems);
43
+ }
44
+
45
+ function slugify(value) {
46
+ const raw = String(value || 'conversation-capability').toLowerCase();
47
+ const ascii = raw
48
+ .replace(/[^a-z0-9]+/g, '-')
49
+ .replace(/^-+|-+$/g, '')
50
+ .replace(/-{2,}/g, '-');
51
+ if (ascii.length >= 8) return ascii.slice(0, 56).replace(/-+$/g, '');
52
+ const hash = crypto.createHash('sha1').update(raw, 'utf8').digest('hex').slice(0, 8);
53
+ return 'conversation-capability-' + hash;
54
+ }
55
+
56
+ function hashInput(input) {
57
+ return crypto.createHash('sha1').update(JSON.stringify(input || {}), 'utf8').digest('hex').slice(0, 10);
58
+ }
59
+
60
+ function inferSignals(text, providedSignals) {
61
+ const found = new Set(normalizeList(providedSignals, 12, 64));
62
+ for (const rule of SIGNAL_RULES) {
63
+ if (rule.re.test(text)) found.add(rule.signal);
64
+ }
65
+ if (found.size === 0) DEFAULT_SIGNALS.forEach((s) => found.add(s));
66
+ return Array.from(found).slice(0, 12);
67
+ }
68
+
69
+ function inferCategory(signals, text) {
70
+ const hay = `${signals.join(' ')} ${text}`.toLowerCase();
71
+ if (/proxy|sync|auth|error|failure|bug|repair|修复|故障/.test(hay)) return 'repair';
72
+ if (/new|plugin|integration|feature|capability|能力|新增/.test(hay)) return 'innovate';
73
+ return 'optimize';
74
+ }
75
+
76
+ function normalizeExecution(input) {
77
+ const execution = input && typeof input.execution === 'object' ? input.execution : {};
78
+ const validation = normalizeList(input.validation || input.verification || execution.validation, 8, 180);
79
+ const trace = asArray(execution.trace).map((item) => {
80
+ if (typeof item === 'string') return { command: trimText(item, 180), exit: 0 };
81
+ if (!item || typeof item !== 'object') return null;
82
+ return {
83
+ command: trimText(item.command || item.cmd || item.name || 'validation', 180),
84
+ exit: Number.isInteger(item.exit) ? item.exit : (item.ok === false ? 1 : 0),
85
+ summary: trimText(item.summary || item.output || '', 240),
86
+ };
87
+ }).filter(Boolean);
88
+ for (const cmd of validation) {
89
+ if (!trace.some((t) => t.command === cmd)) trace.push({ command: cmd, exit: 0 });
90
+ }
91
+ const ok = execution.status === 'success'
92
+ || execution.ok === true
93
+ || validation.length > 0
94
+ || trace.some((t) => t.exit === 0);
95
+ return {
96
+ status: ok ? 'success' : 'failed',
97
+ trace,
98
+ validation,
99
+ blast_radius: execution.blast_radius || input.blast_radius || { files: 0, lines: 0 },
100
+ };
101
+ }
102
+
103
+ function normalizePublishBlastRadius(value, artifactCount) {
104
+ const files = Number(value && value.files);
105
+ const lines = Number(value && value.lines);
106
+ return {
107
+ files: Math.max(1, Math.trunc(Number.isFinite(files) ? files : (artifactCount || 1))),
108
+ lines: Math.max(1, Math.trunc(Number.isFinite(lines) ? lines : 1)),
109
+ };
110
+ }
111
+
112
+ function capsuleContent(normalized) {
113
+ return redactString(JSON.stringify(sanitizePayload({
114
+ platform: normalized.platform,
115
+ source_thread: normalized.source_thread || null,
116
+ artifacts: normalized.artifacts,
117
+ excerpt: normalized.text.slice(0, 1200),
118
+ })));
119
+ }
120
+
121
+ function buildStrategy(input) {
122
+ const explicit = normalizeList(input.strategy || input.steps, 10, 220);
123
+ if (explicit.length >= 3) return explicit;
124
+ const artifacts = normalizeList(input.artifacts, 6, 160);
125
+ const strategy = explicit.slice();
126
+ strategy.push('Capture the user-visible trigger and the concrete workflow that solved it.');
127
+ strategy.push('Preserve evidence: commands, screenshots, documents, changed files, and validation results.');
128
+ if (artifacts.length > 0) strategy.push('Link generated artifacts back to the reusable procedure before publishing.');
129
+ strategy.push('Sanitize secrets and local-only paths before persisting or submitting the asset.');
130
+ strategy.push('Queue the resulting Gene/Capsule through the local Proxy so Hub outages do not drop the learning.');
131
+ return strategy.slice(0, 10);
132
+ }
133
+
134
+ function evaluateGate(input, normalized) {
135
+ let score = 0;
136
+ const reasons = [];
137
+ if (normalized.summary.length >= 40) { score += 2; reasons.push('summary'); }
138
+ if (normalized.strategy.length >= 3) { score += 2; reasons.push('strategy'); }
139
+ if (normalized.artifacts.length > 0) { score += 1; reasons.push('artifacts'); }
140
+ if (normalized.execution.validation.length > 0 || normalized.execution.trace.length > 0) { score += 1; reasons.push('validation'); }
141
+ if (/\b(gene|capsule|distill|reusable|evomap|evolver)\b|蒸馏|提炼|可复用|基因/i.test(normalized.text)) {
142
+ score += 2;
143
+ reasons.push('explicit_distill_signal');
144
+ }
145
+ const threshold = Number(input.min_score || input.minScore || 5);
146
+ if (score < threshold) {
147
+ return { ok: false, score, threshold, reasons, reason: 'insufficient_reusable_signal' };
148
+ }
149
+ return { ok: true, score, threshold, reasons };
150
+ }
151
+
152
+ function normalizeConversationInput(input) {
153
+ const sourceText = [
154
+ input.summary,
155
+ input.title,
156
+ input.user_prompt,
157
+ input.userPrompt,
158
+ input.assistant_summary,
159
+ input.assistantSummary,
160
+ input.transcript,
161
+ input.conversation,
162
+ ].filter(Boolean).join('\n');
163
+ const text = trimText(sourceText, 8000);
164
+ const summary = trimText(input.summary || input.assistant_summary || input.assistantSummary || text, 300);
165
+ const signals = inferSignals(text, input.signals);
166
+ const strategy = buildStrategy(input);
167
+ const artifacts = normalizeList(input.artifacts || input.outputs || input.files, 12, 240);
168
+ const execution = normalizeExecution(input);
169
+ return {
170
+ text,
171
+ summary,
172
+ signals,
173
+ strategy,
174
+ artifacts,
175
+ execution,
176
+ platform: trimText(input.platform || input.host || 'generic', 64),
177
+ source_thread: trimText(input.thread_id || input.threadId || input.session_id || input.sessionId || '', 128),
178
+ };
179
+ }
180
+
181
+ function distillConversation(input, opts = {}) {
182
+ if (!input || typeof input !== 'object') {
183
+ return { ok: false, status: 'skipped', reason: 'input_object_required' };
184
+ }
185
+ const normalized = normalizeConversationInput(input);
186
+ if (!normalized.summary || normalized.summary.length < 20) {
187
+ return { ok: false, status: 'skipped', reason: 'summary_required' };
188
+ }
189
+ const gate = evaluateGate(input, normalized);
190
+ if (!gate.ok) {
191
+ return { ok: false, status: 'skipped', reason: gate.reason, quality: gate, signals: normalized.signals };
192
+ }
193
+
194
+ const slug = slugify(input.name || input.title || normalized.summary);
195
+ const fingerprint = hashInput({
196
+ summary: normalized.summary,
197
+ signals: normalized.signals,
198
+ strategy: normalized.strategy,
199
+ artifacts: normalized.artifacts,
200
+ });
201
+ const gene = createGene({
202
+ id: `gene_conversation_${slug}_${fingerprint}`,
203
+ summary: normalized.summary,
204
+ category: inferCategory(normalized.signals, normalized.text),
205
+ signals_match: normalized.signals,
206
+ preconditions: [
207
+ 'A live agent conversation produced a repeatable workflow or capability.',
208
+ 'The conversation includes enough evidence to reconstruct when and how to use it.',
209
+ ],
210
+ strategy: normalized.strategy,
211
+ validation: normalized.execution.validation.length > 0 ? normalized.execution.validation : ['node --version'],
212
+ constraints: { max_files: 20, forbidden_paths: ['.git', 'node_modules', '.env'] },
213
+ schema_version: SCHEMA_VERSION,
214
+ _source: {
215
+ kind: 'conversation_distillation',
216
+ platform: normalized.platform,
217
+ source_thread: normalized.source_thread || null,
218
+ quality: gate,
219
+ distilled_at: new Date().toISOString(),
220
+ },
221
+ });
222
+ gene.asset_id = computeAssetId(gene);
223
+
224
+ const capsule = createCapsule({
225
+ id: `capsule_conversation_${slug}_${fingerprint}`,
226
+ trigger: normalized.signals,
227
+ gene: gene.id,
228
+ summary: normalized.summary,
229
+ confidence: Math.min(0.95, 0.5 + gate.score / 20),
230
+ blast_radius: normalizePublishBlastRadius(normalized.execution.blast_radius, normalized.artifacts.length),
231
+ outcome: { status: normalized.execution.status, score: normalized.execution.status === 'success' ? 0.82 : 0.35 },
232
+ success_streak: normalized.execution.status === 'success' ? 1 : 0,
233
+ success_reason: normalized.execution.status === 'success' ? 'Conversation included reusable evidence and validation signals.' : null,
234
+ source_type: 'conversation_distillation',
235
+ strategy: normalized.strategy,
236
+ execution_trace: normalized.execution.trace,
237
+ a2a: { eligible_to_broadcast: true },
238
+ content: capsuleContent(normalized),
239
+ diff: '',
240
+ reused_asset_id: '',
241
+ env_fingerprint: {
242
+ platform: normalized.platform,
243
+ source_thread: normalized.source_thread || null,
244
+ },
245
+ });
246
+ capsule.asset_id = computeAssetId(capsule);
247
+
248
+ const persist = opts.persist !== false && input.persist !== false;
249
+ if (persist) {
250
+ assetStore.upsertGene(gene);
251
+ assetStore.upsertCapsule(capsule);
252
+ }
253
+
254
+ return {
255
+ ok: true,
256
+ status: persist ? 'stored' : 'draft',
257
+ distill_id: fingerprint,
258
+ quality: gate,
259
+ signals: normalized.signals,
260
+ gene,
261
+ capsule,
262
+ };
263
+ }
264
+
265
+ module.exports = {
266
+ distillConversation,
267
+ normalizeConversationInput,
268
+ inferSignals,
269
+ evaluateGate,
270
+ };