@evomap/evolver 1.89.3 → 1.89.4

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 (104) 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 +1237 -0
  9. package/README.md +86 -528
  10. package/README.public.md +569 -0
  11. package/SECURITY.md +108 -0
  12. package/assets/gep/events.jsonl +3 -0
  13. package/examples/atp-consumer-quickstart.md +100 -0
  14. package/examples/hello-world.md +38 -0
  15. package/index.js +30 -1
  16. package/package.json +6 -17
  17. package/proxy-package.json +39 -0
  18. package/public.manifest.json +143 -0
  19. package/src/config.js +23 -0
  20. package/src/evolve/guards.js +721 -1
  21. package/src/evolve/pipeline/collect.js +1283 -1
  22. package/src/evolve/pipeline/dispatch.js +421 -1
  23. package/src/evolve/pipeline/enrich.js +440 -1
  24. package/src/evolve/pipeline/hub.js +319 -1
  25. package/src/evolve/pipeline/select.js +274 -1
  26. package/src/evolve/pipeline/signals.js +206 -1
  27. package/src/evolve/utils.js +264 -1
  28. package/src/evolve.js +350 -1
  29. package/src/experiment/agentRunner.js +229 -0
  30. package/src/experiment/cli.js +159 -0
  31. package/src/experiment/comparison.js +233 -0
  32. package/src/experiment/metrics.js +75 -0
  33. package/src/forceUpdate.js +147 -59
  34. package/src/gep/a2aProtocol.js +4455 -1
  35. package/src/gep/antiAbuseTelemetry.js +233 -0
  36. package/src/gep/autoDistillConv.js +205 -1
  37. package/src/gep/autoDistillLlm.js +315 -1
  38. package/src/gep/candidateEval.js +92 -1
  39. package/src/gep/candidates.js +198 -1
  40. package/src/gep/contentHash.js +30 -1
  41. package/src/gep/conversationSniffer.js +266 -1
  42. package/src/gep/crypto.js +89 -1
  43. package/src/gep/curriculum.js +163 -1
  44. package/src/gep/deviceId.js +218 -1
  45. package/src/gep/envFingerprint.js +118 -1
  46. package/src/gep/epigenetics.js +31 -1
  47. package/src/gep/execBridge.js +711 -1
  48. package/src/gep/explore.js +289 -1
  49. package/src/gep/hash.js +15 -1
  50. package/src/gep/hubFetch.js +359 -1
  51. package/src/gep/hubReview.js +207 -1
  52. package/src/gep/hubSearch.js +526 -1
  53. package/src/gep/hubVerify.js +306 -1
  54. package/src/gep/learningSignals.js +89 -1
  55. package/src/gep/memoryGraph.js +1374 -1
  56. package/src/gep/memoryGraphAdapter.js +203 -1
  57. package/src/gep/mutation.js +203 -1
  58. package/src/gep/narrativeMemory.js +108 -1
  59. package/src/gep/openPRRegistry.js +205 -1
  60. package/src/gep/personality.js +423 -1
  61. package/src/gep/policyCheck.js +599 -1
  62. package/src/gep/prompt.js +836 -1
  63. package/src/gep/recallInject.js +409 -1
  64. package/src/gep/recallVerifier.js +318 -1
  65. package/src/gep/reflection.js +177 -1
  66. package/src/gep/sanitize.js +9 -0
  67. package/src/gep/selector.js +602 -1
  68. package/src/gep/skillDistiller.js +1294 -1
  69. package/src/gep/solidify.js +1699 -1
  70. package/src/gep/strategy.js +136 -1
  71. package/src/gep/tokenSavings.js +88 -1
  72. package/src/gep/validator/sandboxExecutor.js +29 -1
  73. package/src/gep/workspaceKeychain.js +174 -1
  74. package/src/proxy/extensions/traceControl.js +99 -1
  75. package/src/proxy/index.js +10 -1
  76. package/src/proxy/inject.js +52 -1
  77. package/src/proxy/lifecycle/manager.js +19 -0
  78. package/src/proxy/mailbox/store.js +2 -1
  79. package/src/proxy/router/messages_route.js +5 -2
  80. package/src/proxy/trace/extractor.js +646 -1
  81. package/src/proxy/trace/usage.js +105 -1
  82. package/CONTRIBUTING.md +0 -19
  83. package/assets/cover.png +0 -0
  84. package/scripts/a2a_export.js +0 -63
  85. package/scripts/a2a_ingest.js +0 -79
  86. package/scripts/a2a_promote.js +0 -118
  87. package/scripts/analyze_by_skill.js +0 -121
  88. package/scripts/build_binaries.js +0 -479
  89. package/scripts/check-changelog.js +0 -166
  90. package/scripts/extract_log.js +0 -85
  91. package/scripts/generate_history.js +0 -75
  92. package/scripts/gep_append_event.js +0 -96
  93. package/scripts/gep_personality_report.js +0 -234
  94. package/scripts/human_report.js +0 -147
  95. package/scripts/recall-verify-report.js +0 -234
  96. package/scripts/recover_loop.js +0 -61
  97. package/scripts/refresh_stars_badge.js +0 -168
  98. package/scripts/seed-merchants.js +0 -91
  99. package/scripts/suggest_version.js +0 -89
  100. package/scripts/validate-modules.js +0 -38
  101. package/scripts/validate-suite.js +0 -78
  102. package/skills/index.json +0 -14
  103. /package/assets/gep/{genes.seed.json → genes.json} +0 -0
  104. /package/{skills → bundled-skills}/_meta/SKILL.md +0 -0
@@ -1 +1,105 @@
1
- const _0x1d6b2f=_0x3597;(function(_0x5739ab,_0x51ec1e){const _0x31d2a1=_0x3597,_0x179344=_0x5739ab();while(!![]){try{const _0x2c4250=parseInt(_0x31d2a1(0x108,'\x46\x66\x7a\x79'))/(0xd98+0x1*0x2441+0xe8*-0x37)*(-parseInt(_0x31d2a1(0x98,'\x5d\x58\x39\x26'))/(0x2ad*-0x5+0x15db+-0x878))+-parseInt(_0x31d2a1(0x96,'\x4e\x39\x72\x4a'))/(0x21eb+-0xa5b*-0x3+-0x1*0x40f9)+parseInt(_0x31d2a1(0x102,'\x30\x42\x4d\x6f'))/(-0x47b*0x2+-0x112a+-0x4*-0x689)+-parseInt(_0x31d2a1(0x93,'\x73\x34\x73\x74'))/(-0xc9*-0x15+-0x3d*0x13+-0xbf1)*(-parseInt(_0x31d2a1(0xcc,'\x64\x79\x70\x35'))/(-0x238a+-0x941+-0x95*-0x4d))+-parseInt(_0x31d2a1(0xc9,'\x40\x78\x73\x44'))/(-0x634+0xd*0x1b9+-0x102a)+-parseInt(_0x31d2a1(0xe6,'\x6d\x35\x64\x59'))/(0x1347+-0x1e6e+0x1*0xb2f)+parseInt(_0x31d2a1(0x9a,'\x6d\x35\x64\x59'))/(0xa57+-0x1e9e+0x1450)*(parseInt(_0x31d2a1(0x105,'\x55\x6a\x51\x77'))/(0x2557+-0x210a+-0x1*0x443));if(_0x2c4250===_0x51ec1e)break;else _0x179344['push'](_0x179344['shift']());}catch(_0x49cab1){_0x179344['push'](_0x179344['shift']());}}}(_0x339c,-0x127b70+-0x3eec3*-0x1+-0x825af*-0x3));function _0x3597(_0x29e27d,_0x29a004){_0x29e27d=_0x29e27d-(0x6c9+-0x5d*0x4a+0x1*0x14a9);const _0x231174=_0x339c();let _0x3a5f20=_0x231174[_0x29e27d];if(_0x3597['\x74\x69\x4d\x4b\x4d\x4c']===undefined){var _0xc6d7ef=function(_0x4e9c25){const _0x6f9f4a='\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 _0x465e3c='',_0x391b23='',_0xfbadfc=_0x465e3c+_0xc6d7ef,_0x31e5aa=(''+function(){return 0xf60+0x23d1+-0x3331*0x1;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!==-(0x19eb+0x1*-0x333+-0x16b7);for(let _0x39c645=-0x1*-0x1547+-0x18b5+-0x36e*-0x1,_0x5e8cd0,_0x4e1907,_0x8d372e=-0x259a+0xcdf+0x1e7*0xd;_0x4e1907=_0x4e9c25['\x63\x68\x61\x72\x41\x74'](_0x8d372e++);~_0x4e1907&&(_0x5e8cd0=_0x39c645%(0xb3c+-0x1274+0x1cf*0x4)?_0x5e8cd0*(-0xa76+0x1ad7+-0x1*0x1021)+_0x4e1907:_0x4e1907,_0x39c645++%(0x2510+0x89*-0x4+-0x22e8))?_0x465e3c+=_0x31e5aa||_0xfbadfc['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x8d372e+(-0x1562+-0x1ba8+0x3114))-(0xee1+0x1fe3+0x175d*-0x2)!==0x3f8*0x4+0x1928+-0x2908?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x1*0x2499+0x22b9+-0x5*-0x93&_0x5e8cd0>>(-(-0x25ca+0x3ef+0x1*0x21dd)*_0x39c645&-0xa47+-0xac5*0x1+0x1512)):_0x39c645:-0x583+-0x1*-0xb6c+0x5e9*-0x1){_0x4e1907=_0x6f9f4a['\x69\x6e\x64\x65\x78\x4f\x66'](_0x4e1907);}for(let _0x277d1f=0xcbc+0x3f*-0x65+-0x6b*-0x1d,_0x1fbf85=_0x465e3c['\x6c\x65\x6e\x67\x74\x68'];_0x277d1f<_0x1fbf85;_0x277d1f++){_0x391b23+='\x25'+('\x30\x30'+_0x465e3c['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x277d1f)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x20*0xc2+0x3af*0x2+0x482*-0x7))['\x73\x6c\x69\x63\x65'](-(-0x7f4+-0x3*-0x6d+0x6af));}return decodeURIComponent(_0x391b23);};const _0x2776bc=function(_0x9c5719,_0x11d6e3){let _0x3e6b26=[],_0xabe59=-0x701+-0x1d36+0x2437,_0x240d8f,_0x40911d='';_0x9c5719=_0xc6d7ef(_0x9c5719);let _0x25e6ad;for(_0x25e6ad=-0x1a63+-0x10c+0x925*0x3;_0x25e6ad<0x1*-0x22b7+0x30e*0x5+0x1471;_0x25e6ad++){_0x3e6b26[_0x25e6ad]=_0x25e6ad;}for(_0x25e6ad=0x1147*0x2+-0x11fc+-0x1092;_0x25e6ad<0x35*0x39+0x10d9+0xdd3*-0x2;_0x25e6ad++){_0xabe59=(_0xabe59+_0x3e6b26[_0x25e6ad]+_0x11d6e3['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x25e6ad%_0x11d6e3['\x6c\x65\x6e\x67\x74\x68']))%(-0x2fe*0x2+-0xb1*0x13+0x141f),_0x240d8f=_0x3e6b26[_0x25e6ad],_0x3e6b26[_0x25e6ad]=_0x3e6b26[_0xabe59],_0x3e6b26[_0xabe59]=_0x240d8f;}_0x25e6ad=-0x115*0x17+-0x4ed*-0x1+-0x16d*-0xe,_0xabe59=0x23c5+-0x146*-0xc+0x330d*-0x1;for(let _0x518c6d=-0xb4a+-0x1a74+0x25be;_0x518c6d<_0x9c5719['\x6c\x65\x6e\x67\x74\x68'];_0x518c6d++){_0x25e6ad=(_0x25e6ad+(0x1*-0x1659+0x68c+0xfce))%(0x3b*0x12+-0x2255+-0x1f2f*-0x1),_0xabe59=(_0xabe59+_0x3e6b26[_0x25e6ad])%(-0x1*0x745+-0x14d+-0x1ea*-0x5),_0x240d8f=_0x3e6b26[_0x25e6ad],_0x3e6b26[_0x25e6ad]=_0x3e6b26[_0xabe59],_0x3e6b26[_0xabe59]=_0x240d8f,_0x40911d+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x9c5719['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x518c6d)^_0x3e6b26[(_0x3e6b26[_0x25e6ad]+_0x3e6b26[_0xabe59])%(0x1969+0x8d5+-0x25*0xe6)]);}return _0x40911d;};_0x3597['\x58\x64\x4f\x46\x43\x55']=_0x2776bc,_0x3597['\x67\x4e\x6b\x46\x4a\x79']={},_0x3597['\x74\x69\x4d\x4b\x4d\x4c']=!![];}const _0x12a6a3=_0x231174[-0x5cf+-0x1*-0x180f+-0x248*0x8],_0x47293b=_0x29e27d+_0x12a6a3,_0x58f7c0=_0x3597['\x67\x4e\x6b\x46\x4a\x79'][_0x47293b];if(!_0x58f7c0){if(_0x3597['\x56\x4d\x5a\x70\x55\x70']===undefined){const _0x56bd23=function(_0x388d87){this['\x6a\x63\x6d\x62\x54\x4e']=_0x388d87,this['\x70\x47\x42\x78\x75\x68']=[-0x42e+-0x252c+-0xdc9*-0x3,-0x2461+0x5*0x15c+0x1d95*0x1,0x42d*-0x5+-0x5*0x2d5+-0x6*-0x5d7],this['\x70\x43\x6a\x49\x5a\x4f']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x68\x72\x70\x6c\x54\x76']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x43\x69\x52\x62\x6f\x43']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x56bd23['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x69\x69\x7a\x6b\x71\x69']=function(){const _0x56c01d=new RegExp(this['\x68\x72\x70\x6c\x54\x76']+this['\x43\x69\x52\x62\x6f\x43']),_0x306258=_0x56c01d['\x74\x65\x73\x74'](this['\x70\x43\x6a\x49\x5a\x4f']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x70\x47\x42\x78\x75\x68'][-0x4f9*-0x7+-0x152b+-0x1*0xda3]:--this['\x70\x47\x42\x78\x75\x68'][0x901*0x1+-0x1*-0x155b+-0x10c*0x1d];return this['\x61\x5a\x42\x43\x45\x4d'](_0x306258);},_0x56bd23['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x61\x5a\x42\x43\x45\x4d']=function(_0x358da0){if(!Boolean(~_0x358da0))return _0x358da0;return this['\x79\x67\x53\x4c\x4d\x61'](this['\x6a\x63\x6d\x62\x54\x4e']);},_0x56bd23['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x79\x67\x53\x4c\x4d\x61']=function(_0x2c0e51){for(let _0x3cc384=0x1d5+0x1*-0x1efc+0x11*0x1b7,_0x230246=this['\x70\x47\x42\x78\x75\x68']['\x6c\x65\x6e\x67\x74\x68'];_0x3cc384<_0x230246;_0x3cc384++){this['\x70\x47\x42\x78\x75\x68']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x230246=this['\x70\x47\x42\x78\x75\x68']['\x6c\x65\x6e\x67\x74\x68'];}return _0x2c0e51(this['\x70\x47\x42\x78\x75\x68'][-0x76+0x309+0x1*-0x293]);},(''+function(){return 0x255e+0x295*-0xc+-0x662;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')===-(-0x244+-0x13a*0x17+0x1e7b)&&new _0x56bd23(_0x3597)['\x69\x69\x7a\x6b\x71\x69'](),_0x3597['\x56\x4d\x5a\x70\x55\x70']=!![];}_0x3a5f20=_0x3597['\x58\x64\x4f\x46\x43\x55'](_0x3a5f20,_0x29a004),_0x3597['\x67\x4e\x6b\x46\x4a\x79'][_0x47293b]=_0x3a5f20;}else _0x3a5f20=_0x58f7c0;return _0x3a5f20;}const _0x39cb0d=(function(){const _0x4a8451=_0x3597,_0xfcc2d7={'\x78\x62\x65\x61\x48':function(_0x1e5994){return _0x1e5994();},'\x45\x6a\x42\x46\x55':_0x4a8451(0xbf,'\x5d\x58\x39\x26'),'\x4d\x51\x4c\x75\x49':_0x4a8451(0xe7,'\x76\x43\x39\x79'),'\x66\x78\x45\x41\x57':function(_0x5e8c1b,_0x22cc4c){return _0x5e8c1b===_0x22cc4c;},'\x43\x70\x63\x4d\x4c':'\x58\x6a\x51\x45\x4b'};let _0x1b750c=!![];return function(_0x1f3f04,_0x12e180){const _0x3a2361=_0x4a8451;if(_0xfcc2d7[_0x3a2361(0xc6,'\x74\x6a\x64\x72')](_0xfcc2d7[_0x3a2361(0xc3,'\x74\x68\x59\x78')],_0x3a2361(0x97,'\x36\x78\x5a\x33'))){const _0x153d51=_0x1b750c?function(){const _0x5b8c16=_0x3a2361,_0x55b8f2={'\x43\x64\x42\x4f\x6b':function(_0x953d98){const _0x565c48=_0x3597;return _0xfcc2d7[_0x565c48(0xa7,'\x6c\x53\x73\x4b')](_0x953d98);},'\x54\x79\x61\x59\x64':_0xfcc2d7[_0x5b8c16(0xc2,'\x55\x23\x64\x7a')]};if(_0xfcc2d7[_0x5b8c16(0xda,'\x40\x78\x73\x44')]!==_0xfcc2d7[_0x5b8c16(0xef,'\x42\x74\x38\x62')]){const _0x560430=_0x55b8f2[_0x5b8c16(0xeb,'\x6c\x32\x36\x6e')](_0x41d93a),_0x43810f={..._0x9c2071};if(!_0x569afb['\x65\x78\x69\x73\x74\x73\x53\x79'+'\x6e\x63'](_0x560430))return _0x43810f;_0x294234=_0x5ce531[_0x5b8c16(0xbd,'\x53\x71\x6f\x55')+_0x5b8c16(0x104,'\x37\x4b\x31\x70')](_0x560430,_0x55b8f2[_0x5b8c16(0x101,'\x53\x52\x6a\x7a')]);}else{if(_0x12e180){const _0x2bc3ee=_0x12e180[_0x5b8c16(0x100,'\x6f\x30\x4f\x55')](_0x1f3f04,arguments);return _0x12e180=null,_0x2bc3ee;}}}:function(){};return _0x1b750c=![],_0x153d51;}else{const _0x5ec6ff=_0x2a02ab[_0x3a2361(0xfd,'\x4e\x39\x72\x4a')](_0x4464c0);if(_0x4e5f26['\x69\x73\x46\x69\x6e\x69\x74\x65'](_0x5ec6ff))return _0x5ec6ff;}};}()),_0x385a90=_0x39cb0d(this,function(){const _0x4bcdf7=_0x3597,_0x5c95b9={};_0x5c95b9['\x4d\x57\x76\x51\x64']=_0x4bcdf7(0xe9,'\x25\x5b\x28\x69')+_0x4bcdf7(0xfb,'\x25\x5b\x28\x69');const _0x3d5688=_0x5c95b9;return _0x385a90['\x74\x6f\x53\x74\x72\x69\x6e\x67']()['\x73\x65\x61\x72\x63\x68'](_0x3d5688[_0x4bcdf7(0x9f,'\x73\x34\x73\x74')])[_0x4bcdf7(0xdd,'\x4f\x6b\x55\x28')]()[_0x4bcdf7(0xb8,'\x6c\x53\x73\x4b')+_0x4bcdf7(0x106,'\x50\x24\x6f\x36')](_0x385a90)[_0x4bcdf7(0xab,'\x53\x43\x34\x32')](_0x3d5688[_0x4bcdf7(0xa3,'\x25\x5b\x28\x69')]);});_0x385a90();'use strict';const _0x2bccd5=require('\x66\x73'),{resolveTraceFile:_0x419bbf,resolveEvomapNodeSecret:_0x1df7cb,decryptTraceEnvelope:_0x59ba4a}=require(_0x1d6b2f(0xc0,'\x53\x43\x34\x32')+_0x1d6b2f(0xe3,'\x5e\x57\x34\x75')),_0x12236f={};_0x12236f[_0x1d6b2f(0xdc,'\x53\x52\x4a\x6c')+_0x1d6b2f(0xc7,'\x6a\x6c\x21\x54')]=0x0,_0x12236f['\x6f\x75\x74\x70\x75\x74\x5f\x74'+_0x1d6b2f(0xa6,'\x55\x23\x64\x7a')]=0x0,_0x12236f[_0x1d6b2f(0x90,'\x77\x6b\x59\x29')+_0x1d6b2f(0xaa,'\x6c\x53\x73\x4b')]=0x0,_0x12236f['\x63\x61\x6c\x6c\x73']=0x0,_0x12236f[_0x1d6b2f(0x9b,'\x5b\x43\x42\x44')]=![];const _0x353d81=Object[_0x1d6b2f(0xd6,'\x73\x34\x73\x74')](_0x12236f);function _0x339c(){const _0x400c3=['\x75\x71\x52\x63\x48\x62\x31\x45','\x57\x35\x44\x32\x6a\x72\x47\x33','\x42\x68\x70\x63\x4d\x38\x6f\x70\x61\x57','\x57\x34\x6e\x62\x6b\x76\x65\x47\x65\x53\x6f\x51\x72\x32\x52\x64\x53\x73\x4f\x41\x57\x36\x56\x63\x47\x47','\x69\x77\x42\x64\x47\x43\x6f\x67\x57\x52\x39\x52\x57\x35\x4e\x63\x51\x71','\x72\x6d\x6b\x65\x57\x37\x37\x63\x4b\x4d\x4a\x63\x55\x5a\x47\x56','\x6d\x62\x62\x4d\x77\x61\x61','\x46\x77\x47\x70\x57\x37\x79\x61\x67\x47\x57\x51','\x57\x51\x5a\x63\x52\x62\x66\x45\x71\x61','\x7a\x68\x68\x64\x47\x61\x34\x54','\x78\x53\x6b\x70\x57\x36\x42\x63\x4b\x67\x30','\x78\x38\x6b\x2b\x57\x37\x53','\x57\x37\x42\x63\x54\x48\x74\x63\x47\x47','\x57\x34\x71\x74\x70\x53\x6b\x6d\x72\x47','\x57\x37\x52\x64\x4b\x53\x6b\x58\x68\x47\x71\x62\x65\x38\x6f\x6d\x57\x4f\x71\x65\x57\x34\x65\x65\x72\x71','\x64\x6d\x6b\x62\x57\x4f\x65\x2f\x57\x35\x79','\x76\x43\x6f\x34\x65\x53\x6f\x2b\x68\x49\x61\x54\x57\x50\x34','\x66\x4b\x4e\x64\x49\x76\x30\x67\x57\x37\x6c\x63\x50\x76\x6d','\x57\x51\x37\x64\x52\x31\x70\x64\x4a\x38\x6b\x32','\x57\x35\x52\x64\x4e\x32\x52\x63\x4a\x38\x6b\x67','\x57\x35\x4e\x63\x56\x38\x6f\x54\x44\x6d\x6b\x34','\x73\x49\x4a\x63\x4b\x48\x57','\x57\x52\x33\x63\x4e\x38\x6f\x4d\x66\x61','\x57\x35\x2f\x63\x4f\x43\x6f\x4c\x72\x38\x6b\x4d','\x44\x38\x6f\x74\x57\x35\x4e\x64\x4d\x4d\x76\x38\x57\x4f\x47\x37\x74\x63\x74\x64\x4a\x71','\x45\x58\x64\x64\x4e\x47','\x42\x38\x6f\x33\x57\x34\x30\x56\x57\x34\x61','\x57\x37\x4e\x63\x55\x6d\x6f\x4c\x72\x76\x4c\x50\x75\x71','\x57\x37\x64\x63\x53\x58\x46\x63\x51\x6d\x6b\x79\x75\x64\x79\x62','\x57\x4f\x68\x64\x56\x72\x33\x64\x51\x78\x6d','\x71\x43\x6f\x70\x57\x52\x5a\x64\x48\x71','\x57\x37\x52\x63\x53\x4a\x74\x63\x4f\x6d\x6b\x63\x78\x63\x79\x4c','\x72\x53\x6f\x72\x42\x68\x6a\x35\x78\x78\x6c\x64\x51\x71','\x57\x34\x39\x31\x66\x59\x79\x4e','\x75\x63\x5a\x64\x4a\x38\x6f\x64\x57\x34\x57','\x66\x75\x4a\x64\x49\x4c\x43','\x57\x34\x58\x39\x65\x5a\x69\x36','\x57\x51\x43\x67\x63\x43\x6f\x74\x41\x57','\x71\x38\x6b\x77\x57\x4f\x4e\x63\x49\x38\x6b\x51\x65\x63\x58\x6a','\x57\x36\x42\x63\x52\x53\x6b\x39\x57\x52\x74\x63\x4e\x32\x4e\x63\x53\x67\x4b','\x57\x4f\x78\x63\x56\x73\x39\x33\x57\x50\x43','\x57\x4f\x4e\x64\x50\x4c\x37\x64\x56\x38\x6b\x4d','\x57\x51\x4a\x64\x55\x77\x42\x64\x53\x53\x6f\x61\x78\x61\x38\x50\x57\x35\x2f\x63\x4c\x38\x6b\x74','\x69\x43\x6f\x5a\x57\x52\x52\x63\x53\x58\x4f','\x57\x37\x69\x6a\x68\x38\x6b\x39','\x57\x52\x56\x64\x4f\x38\x6f\x2f\x57\x37\x42\x64\x4d\x49\x2f\x64\x4e\x73\x33\x64\x55\x6d\x6f\x34\x57\x37\x72\x45\x57\x52\x64\x63\x48\x57','\x57\x52\x42\x64\x55\x43\x6b\x4f','\x74\x30\x42\x64\x47\x5a\x71\x37','\x57\x4f\x31\x70\x62\x63\x47\x32\x57\x35\x44\x59','\x57\x4f\x75\x77\x41\x57\x6a\x38\x46\x38\x6b\x53\x67\x61','\x57\x52\x44\x79\x65\x67\x34\x4a','\x57\x50\x35\x75\x6b\x33\x38\x31','\x43\x38\x6b\x50\x57\x52\x46\x63\x56\x71\x6a\x44\x57\x52\x69','\x57\x51\x6c\x64\x4c\x38\x6f\x54\x76\x43\x6f\x6c\x57\x52\x56\x64\x4a\x66\x79\x6a\x57\x34\x42\x63\x4f\x32\x70\x64\x4d\x57','\x57\x36\x56\x63\x4e\x53\x6f\x57\x78\x38\x6b\x62','\x57\x36\x39\x73\x71\x53\x6b\x78\x6f\x53\x6b\x50\x57\x34\x5a\x64\x47\x4b\x35\x33\x6c\x53\x6f\x49','\x6e\x53\x6b\x74\x66\x72\x4b\x7a','\x57\x34\x42\x63\x53\x53\x6f\x52\x57\x4f\x6a\x72\x7a\x30\x4e\x63\x50\x64\x5a\x64\x52\x6d\x6b\x57\x57\x36\x76\x63','\x64\x6d\x6f\x39\x74\x53\x6f\x6f\x66\x57\x7a\x52\x57\x52\x61','\x57\x37\x68\x63\x4e\x38\x6f\x6d\x71\x31\x39\x43\x44\x71','\x44\x77\x6d\x6e\x57\x37\x43\x6d\x67\x62\x30\x52','\x6b\x53\x6f\x55\x57\x35\x46\x64\x56\x61\x53','\x6e\x53\x6b\x6c\x57\x50\x5a\x63\x4d\x4a\x79','\x42\x67\x4b\x2f\x57\x37\x61\x6c\x61\x58\x79\x4f','\x63\x38\x6b\x39\x57\x50\x4a\x63\x55\x64\x43','\x77\x4a\x47\x62\x46\x38\x6f\x5a','\x57\x52\x74\x64\x51\x68\x6c\x64\x54\x43\x6b\x76','\x42\x48\x46\x63\x53\x49\x66\x62','\x43\x5a\x42\x63\x4c\x59\x6a\x6a','\x57\x4f\x46\x63\x4f\x4a\x66\x4f\x57\x50\x52\x63\x55\x4b\x33\x64\x4d\x47','\x71\x38\x6b\x6b\x57\x4f\x52\x63\x55\x53\x6b\x36\x6e\x57\x50\x76','\x66\x53\x6f\x34\x78\x38\x6f\x6a\x63\x61','\x74\x61\x64\x64\x4a\x38\x6f\x71\x57\x35\x34','\x57\x52\x6c\x64\x54\x38\x6b\x4f\x57\x34\x53\x69','\x57\x52\x34\x75\x70\x43\x6f\x6a\x79\x6d\x6f\x35\x57\x36\x68\x64\x49\x57','\x78\x57\x46\x64\x48\x6d\x6f\x63','\x57\x36\x70\x63\x48\x38\x6b\x34\x65\x43\x6b\x72\x57\x36\x4f','\x68\x30\x56\x63\x47\x43\x6b\x76','\x65\x6d\x6f\x47\x57\x4f\x37\x64\x53\x6d\x6f\x67\x57\x52\x46\x64\x4f\x71\x47','\x63\x75\x5a\x64\x49\x6d\x6f\x37\x57\x52\x38','\x7a\x38\x6f\x34\x57\x52\x5a\x64\x4d\x63\x65','\x42\x65\x4e\x64\x4f\x64\x65\x43','\x57\x52\x42\x64\x53\x62\x62\x43\x57\x4f\x62\x33\x70\x75\x6d','\x57\x50\x57\x69\x6e\x43\x6f\x6c\x71\x57','\x57\x37\x74\x63\x48\x53\x6f\x32\x42\x43\x6b\x45\x57\x50\x38\x78\x77\x61','\x73\x53\x6b\x52\x64\x6d\x6b\x78\x74\x33\x34\x55\x57\x51\x7a\x6b\x61\x58\x71\x51\x57\x36\x34','\x72\x57\x46\x64\x49\x38\x6f\x64\x57\x37\x76\x2b','\x63\x59\x6c\x63\x55\x63\x44\x38\x57\x50\x2f\x64\x55\x71','\x61\x78\x46\x63\x4d\x43\x6f\x77\x6a\x47','\x76\x57\x33\x64\x48\x6d\x6f\x63\x57\x36\x6a\x4b\x41\x6d\x6f\x7a','\x57\x34\x48\x5a\x65\x57','\x57\x50\x34\x42\x44\x71\x7a\x5a\x76\x61','\x63\x43\x6b\x78\x57\x51\x4a\x63\x54\x53\x6b\x57\x65\x49\x4b','\x57\x51\x56\x64\x51\x4a\x54\x71\x57\x50\x31\x51\x6b\x65\x53','\x69\x38\x6f\x33\x57\x51\x4e\x63\x50\x64\x4e\x63\x48\x4c\x37\x63\x50\x57','\x57\x35\x42\x64\x54\x67\x34\x50\x57\x35\x52\x64\x55\x71\x37\x64\x49\x47\x6c\x63\x4c\x47\x74\x63\x47\x38\x6f\x45','\x57\x4f\x68\x64\x53\x38\x6b\x35\x57\x4f\x57','\x57\x52\x37\x64\x4a\x43\x6b\x38\x67\x38\x6b\x67\x57\x37\x64\x63\x4d\x30\x61','\x6f\x67\x4e\x64\x47\x38\x6f\x61\x57\x51\x34','\x70\x6d\x6f\x35\x45\x6d\x6f\x48\x6c\x47','\x41\x72\x53\x61\x71\x53\x6f\x4f','\x57\x51\x4a\x64\x4c\x38\x6f\x47\x76\x6d\x6f\x67\x57\x52\x56\x63\x4f\x30\x38\x39\x57\x36\x74\x63\x54\x4c\x79','\x62\x4c\x2f\x63\x52\x6d\x6f\x6a\x6a\x47','\x57\x37\x56\x63\x4a\x43\x6f\x31\x72\x43\x6b\x4e','\x57\x51\x4e\x64\x56\x62\x6e\x6b','\x6d\x59\x4f\x74\x6b\x38\x6f\x42','\x65\x48\x52\x64\x4f\x43\x6b\x6b\x46\x53\x6b\x70\x70\x5a\x4a\x63\x50\x6d\x6b\x48\x75\x49\x54\x79','\x57\x4f\x6c\x64\x53\x4c\x70\x64\x48\x61','\x57\x37\x74\x63\x53\x6d\x6b\x63\x57\x37\x2f\x64\x53\x76\x65\x65\x76\x71','\x57\x35\x52\x63\x56\x76\x4e\x63\x51\x64\x7a\x42\x6a\x63\x2f\x64\x56\x68\x69\x2f\x57\x50\x68\x64\x53\x57','\x75\x38\x6b\x72\x57\x4f\x68\x63\x55\x6d\x6b\x52\x67\x58\x31\x37','\x6e\x72\x54\x54\x74\x72\x34','\x64\x31\x74\x64\x4c\x75\x69\x41\x57\x36\x52\x63\x54\x47\x4f\x45\x42\x53\x6f\x4a\x57\x52\x58\x44','\x69\x53\x6f\x37\x57\x51\x42\x63\x4f\x58\x52\x63\x50\x4b\x68\x63\x52\x71','\x57\x37\x4a\x63\x51\x6d\x6b\x6e\x57\x35\x74\x64\x50\x71','\x70\x76\x46\x63\x47\x76\x75\x4a\x57\x37\x79\x46\x75\x57','\x62\x53\x6f\x46\x57\x34\x56\x64\x4d\x57\x34','\x57\x4f\x6d\x58\x45\x4a\x76\x35','\x76\x31\x78\x64\x4c\x62\x53\x76','\x69\x6d\x6b\x79\x57\x4f\x56\x63\x4a\x63\x4c\x38','\x57\x52\x79\x61\x68\x47'];_0x339c=function(){return _0x400c3;};return _0x339c();}function _0x45c2e7(_0x1de4d2){const _0x3d42e5=_0x1d6b2f,_0x2167e4={'\x41\x44\x79\x48\x74':function(_0x3ee85b,_0x38cf91){return _0x3ee85b(_0x38cf91);}},_0x1b4d19=_0x1de4d2&&(_0x1de4d2[_0x3d42e5(0xb1,'\x6a\x6c\x21\x54')+'\x70']||_0x1de4d2[_0x3d42e5(0xf7,'\x30\x42\x4d\x6f')+_0x3d42e5(0xed,'\x25\x5b\x28\x69')]);if(_0x1b4d19){const _0x533ef1=Date[_0x3d42e5(0xe0,'\x29\x55\x47\x7a')](_0x1b4d19);if(Number[_0x3d42e5(0xbc,'\x6a\x6c\x21\x54')](_0x533ef1))return _0x533ef1;}if(_0x1de4d2&&Number[_0x3d42e5(0xf4,'\x30\x42\x4d\x6f')](Number(_0x1de4d2[_0x3d42e5(0xcd,'\x4f\x69\x43\x23')+'\x74'])))return _0x2167e4[_0x3d42e5(0xae,'\x53\x52\x4a\x6c')](Number,_0x1de4d2[_0x3d42e5(0xad,'\x70\x5b\x69\x4d')+'\x74'])*(-0x19b*-0x3+-0x1*-0x1471+-0x6*0x38f);return null;}function _0x101d5c(_0x28925b={}){const _0x14cacc=_0x1d6b2f,_0x2d387d={'\x63\x48\x7a\x6f\x49':_0x14cacc(0xd2,'\x59\x7a\x61\x26')+_0x14cacc(0xe4,'\x53\x52\x6a\x7a'),'\x4c\x6f\x74\x43\x74':function(_0x2297f7,_0x211089){return _0x2297f7!=_0x211089;},'\x63\x62\x6f\x58\x75':function(_0x2b7337,_0x3abdba){return _0x2b7337!=_0x3abdba;},'\x41\x52\x48\x4c\x69':function(_0x1d6ffc){return _0x1d6ffc();},'\x65\x63\x4f\x52\x62':function(_0x1277fb,_0x170e46){return _0x1277fb!==_0x170e46;},'\x6c\x76\x45\x4d\x6b':_0x14cacc(0xf9,'\x46\x66\x7a\x79'),'\x79\x6e\x59\x6d\x6e':'\x61\x6a\x4f\x50\x63','\x6e\x64\x4b\x76\x77':function(_0x173176){return _0x173176();},'\x59\x66\x76\x76\x57':_0x14cacc(0x9c,'\x6e\x45\x61\x5d'),'\x70\x53\x62\x70\x57':function(_0x2adfa1,_0x3dc4e9){return _0x2adfa1!==_0x3dc4e9;},'\x74\x41\x43\x78\x78':_0x14cacc(0xb2,'\x4e\x39\x72\x4a'),'\x6a\x75\x70\x70\x72':function(_0x17dec2,_0x3e9c2c){return _0x17dec2===_0x3e9c2c;},'\x65\x6b\x49\x42\x7a':_0x14cacc(0xd4,'\x77\x6b\x59\x29'),'\x57\x6a\x71\x67\x62':function(_0x5e215c,_0x3abd0b,_0x3cefef){return _0x5e215c(_0x3abd0b,_0x3cefef);},'\x50\x76\x53\x52\x6c':_0x14cacc(0xba,'\x77\x6b\x59\x29'),'\x75\x58\x69\x65\x49':function(_0xc00320,_0xf3f5eb){return _0xc00320==_0xf3f5eb;},'\x64\x4e\x65\x72\x5a':function(_0x296c8c,_0x2d7d3d){return _0x296c8c>_0x2d7d3d;},'\x52\x45\x69\x70\x59':function(_0x17b249,_0x10ebef){return _0x17b249(_0x10ebef);},'\x6b\x4f\x46\x76\x58':function(_0x5b6bfe,_0x4975db){return _0x5b6bfe===_0x4975db;},'\x4c\x70\x41\x78\x44':function(_0x29431c,_0x1e5544){return _0x29431c+_0x1e5544;}},_0x41679d=_0x28925b&&_0x2d387d[_0x14cacc(0x92,'\x56\x47\x49\x79')](_0x28925b[_0x14cacc(0xa5,'\x4f\x69\x43\x23')],null)?Date[_0x14cacc(0xfc,'\x46\x66\x7a\x79')](_0x28925b[_0x14cacc(0xd0,'\x53\x71\x6f\x55')]):NaN,_0x2b665c={..._0x353d81};if(!Number[_0x14cacc(0xcb,'\x42\x2a\x40\x31')](_0x41679d))return _0x2b665c;const _0x298efa=_0x28925b&&_0x2d387d['\x63\x62\x6f\x58\x75'](_0x28925b[_0x14cacc(0xe8,'\x33\x50\x42\x57')],null)&&Number[_0x14cacc(0xb3,'\x74\x6a\x64\x72')](Date[_0x14cacc(0xc1,'\x53\x52\x4a\x6c')](_0x28925b[_0x14cacc(0x99,'\x55\x23\x64\x7a')]))?Date[_0x14cacc(0x9d,'\x73\x34\x73\x74')](_0x28925b['\x75\x6e\x74\x69\x6c\x49\x73\x6f']):Date[_0x14cacc(0xf1,'\x59\x7a\x61\x26')]();let _0x2b30eb;try{const _0xa72684=_0x2d387d[_0x14cacc(0xc8,'\x50\x52\x55\x69')](_0x419bbf),_0x37acba={..._0x353d81};if(!_0x2bccd5['\x65\x78\x69\x73\x74\x73\x53\x79'+'\x6e\x63'](_0xa72684))return _0x37acba;_0x2b30eb=_0x2bccd5['\x72\x65\x61\x64\x46\x69\x6c\x65'+_0x14cacc(0xca,'\x5a\x4a\x45\x6d')](_0xa72684,_0x14cacc(0xee,'\x6d\x35\x64\x59'));}catch(_0x3cdf79){if(_0x2d387d[_0x14cacc(0xa1,'\x5a\x4a\x45\x6d')](_0x14cacc(0xc5,'\x6e\x54\x50\x6d'),_0x2d387d[_0x14cacc(0xb0,'\x46\x79\x6e\x64')]))_0x14ab13=_0x22c4e6();else{const _0x1b3bc7={..._0x353d81};return _0x1b3bc7;}}let _0x5910be=null;try{if(_0x2d387d[_0x14cacc(0x91,'\x56\x47\x49\x79')](_0x2d387d[_0x14cacc(0x95,'\x42\x74\x38\x62')],_0x14cacc(0xec,'\x42\x74\x38\x62')))_0x5910be=_0x2d387d[_0x14cacc(0xe2,'\x4f\x6b\x55\x28')](_0x1df7cb);else return _0xc51deb[_0x14cacc(0x9e,'\x5b\x43\x42\x44')]()['\x73\x65\x61\x72\x63\x68'](OfsuKt[_0x14cacc(0xd3,'\x6e\x45\x61\x5d')])['\x74\x6f\x53\x74\x72\x69\x6e\x67']()[_0x14cacc(0xa4,'\x6f\x30\x4f\x55')+_0x14cacc(0xb9,'\x46\x66\x7a\x79')](_0x453f44)[_0x14cacc(0xb5,'\x6c\x53\x73\x4b')](_0x14cacc(0xf8,'\x36\x78\x5a\x33')+_0x14cacc(0xac,'\x6c\x53\x73\x4b'));}catch(_0x559766){_0x2d387d[_0x14cacc(0xe5,'\x37\x4b\x31\x70')](_0x2d387d['\x59\x66\x76\x76\x57'],_0x14cacc(0x107,'\x46\x79\x6e\x64'))?_0x45b6c2=_0x23259f(_0x228b9b,_0x32d465):_0x5910be=null;}let _0x1dcc90=-0x1ab4+-0x1cbe+0x3772,_0x1a616e=0x393+-0x133+-0x260,_0x2ccd44=-0x2*0x2a4+-0x8f3*-0x4+0x3e*-0x7e;for(const _0x135a0c of _0x2b30eb[_0x14cacc(0xea,'\x53\x52\x6a\x7a')]('\x0a')){const _0x5b9654=_0x135a0c[_0x14cacc(0xf6,'\x42\x43\x4e\x5e')]();if(!_0x5b9654)continue;let _0x12a906;try{_0x12a906=JSON[_0x14cacc(0xa8,'\x50\x24\x6f\x36')](_0x5b9654);}catch(_0x1d3c2e){continue;}if(_0x12a906&&_0x12a906[_0x14cacc(0xdf,'\x5b\x43\x42\x44')+'\x64']){if(_0x2d387d[_0x14cacc(0xde,'\x40\x32\x2a\x32')](_0x2d387d[_0x14cacc(0xb7,'\x6e\x54\x50\x6d')],_0x14cacc(0xb2,'\x4e\x39\x72\x4a')))_0x3adc52=_0x2657da[_0x14cacc(0x103,'\x53\x71\x6f\x55')](_0x1913a6);else{if(!_0x5910be)continue;try{_0x2d387d[_0x14cacc(0xf5,'\x64\x79\x70\x35')](_0x2d387d[_0x14cacc(0xd1,'\x42\x2a\x40\x31')],_0x14cacc(0xd9,'\x46\x66\x7a\x79'))?_0x5a119a=null:_0x12a906=_0x2d387d[_0x14cacc(0xd5,'\x46\x79\x6e\x64')](_0x59ba4a,_0x12a906,_0x5910be);}catch(_0x4375d4){continue;}}}if(!_0x12a906||_0x2d387d[_0x14cacc(0xa0,'\x74\x68\x59\x78')](typeof _0x12a906,_0x2d387d[_0x14cacc(0xa2,'\x25\x5b\x28\x69')]))continue;const _0x1ae81e=_0x45c2e7(_0x12a906);if(_0x2d387d[_0x14cacc(0xce,'\x40\x32\x2a\x32')](_0x1ae81e,null)||_0x1ae81e<_0x41679d||_0x2d387d[_0x14cacc(0xfa,'\x6c\x53\x73\x4b')](_0x1ae81e,_0x298efa))continue;const _0x1e1f62=_0x2d387d['\x52\x45\x69\x70\x59'](Number,_0x12a906[_0x14cacc(0xdc,'\x53\x52\x4a\x6c')+'\x6b\x65\x6e\x73']),_0x2a676d=_0x2d387d[_0x14cacc(0xaf,'\x42\x43\x4e\x5e')](Number,_0x12a906[_0x14cacc(0xff,'\x55\x6a\x51\x77')+_0x14cacc(0xd8,'\x25\x5b\x28\x69')]),_0x18118b=Number[_0x14cacc(0xa9,'\x4e\x39\x72\x4a')](_0x1e1f62)&&_0x1e1f62>-0x1a9a+-0x1*-0x24e9+0x7*-0x179,_0x3b10a3=Number[_0x14cacc(0xa9,'\x4e\x39\x72\x4a')](_0x2a676d)&&_0x2d387d[_0x14cacc(0xe1,'\x46\x79\x6e\x64')](_0x2a676d,0x1300+-0x1183*-0x2+-0x3606);if(_0x18118b)_0x1dcc90+=_0x1e1f62;if(_0x3b10a3)_0x1a616e+=_0x2a676d;if(_0x18118b||_0x3b10a3)_0x2ccd44+=-0x127d+-0x421+0x169f*0x1;}const _0x119c9b={..._0x353d81};if(_0x2d387d[_0x14cacc(0xf2,'\x54\x69\x21\x62')](_0x2ccd44,-0x4*0x859+0x1a8c+0x6d8))return _0x119c9b;return{'\x69\x6e\x70\x75\x74\x5f\x74\x6f\x6b\x65\x6e\x73':_0x1dcc90,'\x6f\x75\x74\x70\x75\x74\x5f\x74\x6f\x6b\x65\x6e\x73':_0x1a616e,'\x74\x6f\x74\x61\x6c\x5f\x74\x6f\x6b\x65\x6e\x73':_0x2d387d['\x4c\x70\x41\x78\x44'](_0x1dcc90,_0x1a616e),'\x63\x61\x6c\x6c\x73':_0x2ccd44,'\x6d\x65\x61\x73\x75\x72\x65\x64':!![]};}const _0xb194e5={};_0xb194e5[_0x1d6b2f(0xfe,'\x4f\x69\x43\x23')+_0x1d6b2f(0xd7,'\x4e\x39\x72\x4a')]=_0x101d5c,module['\x65\x78\x70\x6f\x72\x74\x73']=_0xb194e5;
1
+ 'use strict';
2
+
3
+ // Per-run token-usage rollup over the proxy trace log.
4
+ //
5
+ // The local proxy (src/proxy) meters real Anthropic input/output tokens for
6
+ // every Hand /v1/messages call into proxy-traces.jsonl. This reads that log
7
+ // back -- decrypting encrypted rows with the local EvoMap node secret -- and
8
+ // sums the real tokens spent within a time window, giving solidify the
9
+ // MEASURED cost of a derive loop.
10
+ //
11
+ // Best-effort by design: returns measured:false (and never throws) when the
12
+ // proxy was inactive, the node secret is missing, no rows fall in the window,
13
+ // or the in-window rows carried no usage (e.g. streamed-but-unobserved calls).
14
+ // Callers fall back to a grounded estimate in that case.
15
+
16
+ const fs = require('fs');
17
+ const {
18
+ resolveTraceFile,
19
+ resolveEvomapNodeSecret,
20
+ decryptTraceEnvelope,
21
+ } = require('./extractor');
22
+
23
+ const EMPTY = Object.freeze({
24
+ input_tokens: 0,
25
+ output_tokens: 0,
26
+ total_tokens: 0,
27
+ calls: 0,
28
+ measured: false,
29
+ });
30
+
31
+ function _rowTimestampMs(row) {
32
+ const iso = row && (row.timestamp || row.createdAtIso);
33
+ if (iso) {
34
+ const ms = Date.parse(iso);
35
+ if (Number.isFinite(ms)) return ms;
36
+ }
37
+ // createdAt is unix seconds in the Prism trace shape.
38
+ if (row && Number.isFinite(Number(row.createdAt))) return Number(row.createdAt) * 1000;
39
+ return null;
40
+ }
41
+
42
+ /**
43
+ * Sum the real token usage the proxy recorded within a run's time window.
44
+ *
45
+ * @param {object} opts
46
+ * @param {string} opts.sinceIso - REQUIRED lower bound (e.g. last_run.created_at).
47
+ * Without a window we cannot attribute traces to this run, so we report
48
+ * unmeasured rather than summing unrelated calls.
49
+ * @param {string} [opts.untilIso] - upper bound; defaults to now.
50
+ * @returns {{input_tokens:number,output_tokens:number,total_tokens:number,calls:number,measured:boolean}}
51
+ */
52
+ function sumRunUsage(opts = {}) {
53
+ const sinceMs = opts && opts.sinceIso != null ? Date.parse(opts.sinceIso) : NaN;
54
+ if (!Number.isFinite(sinceMs)) return { ...EMPTY };
55
+ const untilMs = opts && opts.untilIso != null && Number.isFinite(Date.parse(opts.untilIso))
56
+ ? Date.parse(opts.untilIso)
57
+ : Date.now();
58
+
59
+ let raw;
60
+ try {
61
+ const file = resolveTraceFile();
62
+ if (!fs.existsSync(file)) return { ...EMPTY };
63
+ raw = fs.readFileSync(file, 'utf8');
64
+ } catch (_) {
65
+ return { ...EMPTY };
66
+ }
67
+
68
+ let secret = null;
69
+ try { secret = resolveEvomapNodeSecret(); } catch (_) { secret = null; }
70
+
71
+ let input = 0;
72
+ let output = 0;
73
+ let calls = 0;
74
+ for (const line of raw.split('\n')) {
75
+ const s = line.trim();
76
+ if (!s) continue;
77
+ let row;
78
+ try { row = JSON.parse(s); } catch (_) { continue; }
79
+ if (row && row.encrypted) {
80
+ if (!secret) continue; // cannot decrypt -> treat as unobserved
81
+ try { row = decryptTraceEnvelope(row, secret); } catch (_) { continue; }
82
+ }
83
+ if (!row || typeof row !== 'object') continue;
84
+ const ms = _rowTimestampMs(row);
85
+ if (ms == null || ms < sinceMs || ms > untilMs) continue;
86
+ const i = Number(row.input_tokens);
87
+ const o = Number(row.output_tokens);
88
+ const hasI = Number.isFinite(i) && i > 0;
89
+ const hasO = Number.isFinite(o) && o > 0;
90
+ if (hasI) input += i;
91
+ if (hasO) output += o;
92
+ if (hasI || hasO) calls += 1;
93
+ }
94
+
95
+ if (calls === 0) return { ...EMPTY };
96
+ return {
97
+ input_tokens: input,
98
+ output_tokens: output,
99
+ total_tokens: input + output,
100
+ calls,
101
+ measured: true,
102
+ };
103
+ }
104
+
105
+ module.exports = { sumRunUsage };
package/CONTRIBUTING.md DELETED
@@ -1,19 +0,0 @@
1
- ## Contributing
2
-
3
- Thank you for contributing. Please follow these rules:
4
-
5
- - Do not use emoji (except the DNA emoji in documentation if needed).
6
- - Keep changes small and reviewable.
7
- - Update related documentation when you change behavior.
8
- - Run `node index.js` for a quick sanity check.
9
-
10
- Submit PRs with clear intent and scope.
11
-
12
- ### Engineering conventions
13
-
14
- - **Spawn child CLIs as `node <entry.js>` — never via a `.cmd` shim, npm symlink, or bare command name.** When launching a harness/tool subprocess (claude-code, openclaw, codex, ...), resolve the JS entry behind the launcher and hand it to `node` directly. Two reasons:
15
- 1. On Windows, `child_process.spawn` without `shell:true` on a `.cmd`/`.bat` throws `EINVAL` since the CVE-2024-27980 fix (Node >=18.20.2 / 20.12.2 / 21.7.3) — this silently broke the auto-exec bridge on Windows.
16
- 2. Across platforms, shims/wrappers can emit warnings or silently exit on some machines. `node <entry>` is zero-shell, deterministic, and passes args via argv (no shell-injection surface).
17
-
18
- `runChild` in `src/gep/execBridge.js` implements this for Windows npm shims (`_resolveNpmCmdShim`: parse the shim's `"%dp0%\<entry>" %*` exec line and rewrite `(bin, args)` -> `(process.execPath, [<entry>, ...args])`), falling back to the original target when it is not a recognized npm shim. POSIX binaries / wrappers spawn natively and are left unchanged. A unit test (`test/execBridgeSpawnNpmShim.test.js`) enforces the parser.
19
-
package/assets/cover.png DELETED
Binary file
@@ -1,63 +0,0 @@
1
- const { loadGenes, loadCapsules, readAllEvents } = require('../src/gep/assetStore');
2
- const { exportEligibleCapsules, exportEligibleGenes, isAllowedA2AAsset } = require('../src/gep/a2a');
3
- const { buildPublish, buildHello, getTransport } = require('../src/gep/a2aProtocol');
4
- const { computeAssetId, SCHEMA_VERSION } = require('../src/gep/contentHash');
5
-
6
- function main() {
7
- var args = process.argv.slice(2);
8
- var asJson = args.includes('--json');
9
- var asProtocol = args.includes('--protocol');
10
- var withHello = args.includes('--hello');
11
- var persist = args.includes('--persist');
12
- var includeEvents = args.includes('--include-events');
13
-
14
- var capsules = loadCapsules();
15
- var genes = loadGenes();
16
- var events = readAllEvents();
17
-
18
- // Build eligible list: Capsules (filtered) + Genes (filtered) + Events (opt-in)
19
- var eligibleCapsules = exportEligibleCapsules({ capsules: capsules, events: events });
20
- var eligibleGenes = exportEligibleGenes({ genes: genes });
21
- var eligible = eligibleCapsules.concat(eligibleGenes);
22
-
23
- if (includeEvents) {
24
- var eligibleEvents = (Array.isArray(events) ? events : []).filter(function (e) {
25
- return isAllowedA2AAsset(e) && e.type === 'EvolutionEvent';
26
- });
27
- for (var ei = 0; ei < eligibleEvents.length; ei++) {
28
- var ev = eligibleEvents[ei];
29
- if (!ev.schema_version) ev.schema_version = SCHEMA_VERSION;
30
- if (!ev.asset_id) { try { ev.asset_id = computeAssetId(ev); } catch (e) {} }
31
- }
32
- eligible = eligible.concat(eligibleEvents);
33
- }
34
-
35
- if (withHello || asProtocol) {
36
- var hello = buildHello({ geneCount: genes.length, capsuleCount: capsules.length });
37
- process.stdout.write(JSON.stringify(hello) + '\n');
38
- if (persist) { try { getTransport().send(hello); } catch (e) {} }
39
- }
40
-
41
- if (asProtocol) {
42
- for (var i = 0; i < eligible.length; i++) {
43
- var msg = buildPublish({ asset: eligible[i] });
44
- process.stdout.write(JSON.stringify(msg) + '\n');
45
- if (persist) { try { getTransport().send(msg); } catch (e) {} }
46
- }
47
- return;
48
- }
49
-
50
- if (asJson) {
51
- process.stdout.write(JSON.stringify(eligible, null, 2) + '\n');
52
- return;
53
- }
54
-
55
- for (var j = 0; j < eligible.length; j++) {
56
- process.stdout.write(JSON.stringify(eligible[j]) + '\n');
57
- }
58
- }
59
-
60
- try { main(); } catch (e) {
61
- process.stderr.write((e && e.message ? e.message : String(e)) + '\n');
62
- process.exit(1);
63
- }
@@ -1,79 +0,0 @@
1
- var fs = require('fs');
2
- var assetStore = require('../src/gep/assetStore');
3
- var a2a = require('../src/gep/a2a');
4
- var memGraph = require('../src/gep/memoryGraphAdapter');
5
- var contentHash = require('../src/gep/contentHash');
6
- var a2aProto = require('../src/gep/a2aProtocol');
7
-
8
- function readStdin() {
9
- try { return fs.readFileSync(0, 'utf8'); } catch (e) { return ''; }
10
- }
11
-
12
- function parseSignalsFromEnv() {
13
- var raw = process.env.A2A_SIGNALS || '';
14
- if (!raw) return [];
15
- try {
16
- var maybe = JSON.parse(raw);
17
- if (Array.isArray(maybe)) return maybe.map(String).filter(Boolean);
18
- } catch (e) {}
19
- return String(raw).split(',').map(function (s) { return s.trim(); }).filter(Boolean);
20
- }
21
-
22
- function main() {
23
- var args = process.argv.slice(2);
24
- var inputPath = '';
25
- for (var i = 0; i < args.length; i++) {
26
- if (args[i] && !args[i].startsWith('--')) { inputPath = args[i]; break; }
27
- }
28
- var source = process.env.A2A_SOURCE || 'external';
29
- var factor = Number.isFinite(Number(process.env.A2A_EXTERNAL_CONFIDENCE_FACTOR))
30
- ? Number(process.env.A2A_EXTERNAL_CONFIDENCE_FACTOR) : 0.6;
31
-
32
- var text = inputPath ? a2a.readTextIfExists(inputPath) : readStdin();
33
- var parsed = a2a.parseA2AInput(text);
34
- var signals = parseSignalsFromEnv();
35
-
36
- var accepted = 0;
37
- var rejected = 0;
38
- var emitDecisions = process.env.A2A_EMIT_DECISIONS === 'true';
39
-
40
- for (var j = 0; j < parsed.length; j++) {
41
- var obj = parsed[j];
42
- if (!a2a.isAllowedA2AAsset(obj)) continue;
43
-
44
- if (obj.asset_id && typeof obj.asset_id === 'string') {
45
- if (!contentHash.verifyAssetId(obj)) {
46
- rejected += 1;
47
- if (emitDecisions) {
48
- try {
49
- var dm = a2aProto.buildDecision({ assetId: obj.asset_id, localId: obj.id, decision: 'reject', reason: 'asset_id integrity check failed' });
50
- a2aProto.getTransport().send(dm);
51
- } catch (e) {}
52
- }
53
- continue;
54
- }
55
- }
56
-
57
- var staged = a2a.lowerConfidence(obj, { source: source, factor: factor });
58
- if (!staged) continue;
59
-
60
- assetStore.appendExternalCandidateJsonl(staged);
61
- try { memGraph.recordExternalCandidate({ asset: staged, source: source, signals: signals }); } catch (e) {}
62
-
63
- if (emitDecisions) {
64
- try {
65
- var dm2 = a2aProto.buildDecision({ assetId: staged.asset_id, localId: staged.id, decision: 'quarantine', reason: 'staged as external candidate' });
66
- a2aProto.getTransport().send(dm2);
67
- } catch (e) {}
68
- }
69
-
70
- accepted += 1;
71
- }
72
-
73
- process.stdout.write('accepted=' + accepted + ' rejected=' + rejected + '\n');
74
- }
75
-
76
- try { main(); } catch (e) {
77
- process.stderr.write((e && e.message ? e.message : String(e)) + '\n');
78
- process.exit(1);
79
- }
@@ -1,118 +0,0 @@
1
- var assetStore = require('../src/gep/assetStore');
2
- var solidifyMod = require('../src/gep/solidify');
3
- var contentHash = require('../src/gep/contentHash');
4
- var a2aProto = require('../src/gep/a2aProtocol');
5
-
6
- function parseArgs(argv) {
7
- var out = { flags: new Set(), kv: new Map(), positionals: [] };
8
- for (var i = 0; i < argv.length; i++) {
9
- var a = argv[i];
10
- if (!a) continue;
11
- if (a.startsWith('--')) {
12
- var eq = a.indexOf('=');
13
- if (eq > -1) { out.kv.set(a.slice(2, eq), a.slice(eq + 1)); }
14
- else {
15
- var key = a.slice(2);
16
- var next = argv[i + 1];
17
- if (next && !String(next).startsWith('--')) { out.kv.set(key, next); i++; }
18
- else { out.flags.add(key); }
19
- }
20
- } else { out.positionals.push(a); }
21
- }
22
- return out;
23
- }
24
-
25
- function main() {
26
- var args = parseArgs(process.argv.slice(2));
27
- var id = String(args.kv.get('id') || '').trim();
28
- var typeRaw = String(args.kv.get('type') || '').trim().toLowerCase();
29
- var validated = args.flags.has('validated') || String(args.kv.get('validated') || '') === 'true';
30
- var limit = Number.isFinite(Number(args.kv.get('limit'))) ? Number(args.kv.get('limit')) : 500;
31
-
32
- if (!id || !typeRaw) throw new Error('Usage: node scripts/a2a_promote.js --type capsule|gene|event --id <id> --validated');
33
- if (!validated) throw new Error('Refusing to promote without --validated (local verification must be done first).');
34
-
35
- var type = typeRaw === 'capsule' ? 'Capsule' : typeRaw === 'gene' ? 'Gene' : typeRaw === 'event' ? 'EvolutionEvent' : '';
36
- if (!type) throw new Error('Invalid --type. Use capsule, gene, or event.');
37
-
38
- var external = assetStore.readRecentExternalCandidates(limit);
39
- var candidate = null;
40
- for (var i = 0; i < external.length; i++) {
41
- if (external[i] && external[i].type === type && String(external[i].id) === id) { candidate = external[i]; break; }
42
- }
43
- if (!candidate) throw new Error('Candidate not found in external zone: type=' + type + ' id=' + id);
44
-
45
- if (type === 'Gene') {
46
- var validation = Array.isArray(candidate.validation) ? candidate.validation : [];
47
- for (var j = 0; j < validation.length; j++) {
48
- var c = String(validation[j] || '').trim();
49
- if (!c) continue;
50
- if (!solidifyMod.isValidationCommandAllowed(c)) {
51
- throw new Error('Refusing to promote Gene ' + id + ': validation command rejected by safety check: "' + c + '". Only node/npm/npx commands without shell operators are allowed.');
52
- }
53
- }
54
- }
55
-
56
- var promoted = JSON.parse(JSON.stringify(candidate));
57
- if (!promoted.a2a || typeof promoted.a2a !== 'object') promoted.a2a = {};
58
- promoted.a2a.status = 'promoted';
59
- promoted.a2a.promoted_at = new Date().toISOString();
60
- if (!promoted.schema_version) promoted.schema_version = contentHash.SCHEMA_VERSION;
61
- promoted.asset_id = contentHash.computeAssetId(promoted);
62
-
63
- var emitDecisions = process.env.A2A_EMIT_DECISIONS === 'true';
64
-
65
- if (type === 'EvolutionEvent') {
66
- assetStore.appendEventJsonl(promoted);
67
- if (emitDecisions) {
68
- try {
69
- var dmEv = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'event promoted for provenance tracking' });
70
- a2aProto.getTransport().send(dmEv);
71
- } catch (e) {}
72
- }
73
- process.stdout.write('promoted_event=' + id + '\n');
74
- return;
75
- }
76
-
77
- if (type === 'Capsule') {
78
- assetStore.appendCapsule(promoted);
79
- if (emitDecisions) {
80
- try {
81
- var dm = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'capsule promoted after validation' });
82
- a2aProto.getTransport().send(dm);
83
- } catch (e) {}
84
- }
85
- process.stdout.write('promoted_capsule=' + id + '\n');
86
- return;
87
- }
88
-
89
- var localGenes = assetStore.loadGenes();
90
- var exists = false;
91
- for (var k = 0; k < localGenes.length; k++) {
92
- if (localGenes[k] && localGenes[k].type === 'Gene' && String(localGenes[k].id) === id) { exists = true; break; }
93
- }
94
- if (exists) {
95
- if (emitDecisions) {
96
- try {
97
- var dm2 = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'reject', reason: 'local gene with same ID already exists' });
98
- a2aProto.getTransport().send(dm2);
99
- } catch (e) {}
100
- }
101
- process.stdout.write('conflict_keep_local_gene=' + id + '\n');
102
- return;
103
- }
104
-
105
- assetStore.upsertGene(promoted);
106
- if (emitDecisions) {
107
- try {
108
- var dm3 = a2aProto.buildDecision({ assetId: promoted.asset_id, localId: id, decision: 'accept', reason: 'gene promoted after safety audit' });
109
- a2aProto.getTransport().send(dm3);
110
- } catch (e) {}
111
- }
112
- process.stdout.write('promoted_gene=' + id + '\n');
113
- }
114
-
115
- try { main(); } catch (e) {
116
- process.stderr.write((e && e.message ? e.message : String(e)) + '\n');
117
- process.exit(1);
118
- }
@@ -1,121 +0,0 @@
1
- const fs = require('fs');
2
- const path = require('path');
3
-
4
- const REPO_ROOT = path.resolve(__dirname, '..');
5
- const LOG_FILE = path.join(REPO_ROOT, 'evolution_history_full.md');
6
- const OUT_FILE = path.join(REPO_ROOT, 'evolution_detailed_report.md');
7
-
8
- function analyzeEvolution() {
9
- if (!fs.existsSync(LOG_FILE)) {
10
- console.error("Source file missing.");
11
- return;
12
- }
13
-
14
- const content = fs.readFileSync(LOG_FILE, 'utf8');
15
- // Split by divider
16
- const entries = content.split('---').map(e => e.trim()).filter(e => e.length > 0);
17
-
18
- const skillUpdates = {}; // Map<SkillName, Array<Changes>>
19
- const generalUpdates = []; // Array<Changes>
20
-
21
- // Regex to detect skills/paths
22
- // e.g. `skills/feishu-card/send.js` or **Target**: `skills/git-sync`
23
- const skillRegex = /skills\/([a-zA-Z0-9\-_]+)/;
24
- const actionRegex = /Action:\s*([\s\S]*?)(?=\n\n|\n[A-Z]|$)/i; // Capture Action text
25
- const statusRegex = /Status:\s*\[?([A-Z\s_]+)\]?/i;
26
-
27
- entries.forEach(entry => {
28
- // Extract basic info
29
- const statusMatch = entry.match(statusRegex);
30
- const status = statusMatch ? statusMatch[1].trim().toUpperCase() : 'UNKNOWN';
31
-
32
- // Skip routine checks if we want a *detailed evolution* report (focus on changes)
33
- // But user asked for "what happened", so routine scans might be boring unless they found something.
34
- // Let's filter out "STABILITY" or "RUNNING" unless there is a clear "Mutated" or "Fixed" keyword.
35
- const isInteresting =
36
- entry.includes('Fixed') ||
37
- entry.includes('Hardened') ||
38
- entry.includes('Optimized') ||
39
- entry.includes('Patched') ||
40
- entry.includes('Created') ||
41
- entry.includes('Added') ||
42
- status === 'SUCCESS' ||
43
- status === 'COMPLETED';
44
-
45
- if (!isInteresting) return;
46
-
47
- // Find associated skill
48
- const skillMatch = entry.match(skillRegex);
49
- let skillName = 'General / System';
50
- if (skillMatch) {
51
- skillName = skillMatch[1];
52
- } else {
53
- // Try heuristics
54
- if (entry.toLowerCase().includes('feishu card')) skillName = 'feishu-card';
55
- else if (entry.toLowerCase().includes('git sync')) skillName = 'git-sync';
56
- else if (entry.toLowerCase().includes('logger')) skillName = 'interaction-logger';
57
- else if (entry.toLowerCase().includes('evolve')) skillName = 'capability-evolver';
58
- }
59
-
60
- // Extract description
61
- let description = "";
62
- const actionMatch = entry.match(actionRegex);
63
- if (actionMatch) {
64
- description = actionMatch[1].trim();
65
- } else {
66
- // Fallback: take lines that look like bullet points or text after header
67
- const lines = entry.split('\n');
68
- description = lines.filter(l => l.match(/^[•\-\*]|\w/)).slice(1).join('\n').trim();
69
- }
70
-
71
- // Clean up description (remove duplicate "Action:" prefix if captured)
72
- description = description.replace(/^Action:\s*/i, '');
73
-
74
- if (!skillUpdates[skillName]) skillUpdates[skillName] = [];
75
-
76
- // Dedup descriptions slightly (simple check)
77
- const isDuplicate = skillUpdates[skillName].some(u => u.desc.includes(description.substring(0, 20)));
78
- if (!isDuplicate) {
79
- // Extract Date if possible
80
- const dateMatch = entry.match(/\((\d{4}\/\d{1,2}\/\d{1,2}.*?)\)/);
81
- const date = dateMatch ? dateMatch[1] : 'Unknown';
82
-
83
- skillUpdates[skillName].push({
84
- date,
85
- status,
86
- desc: description
87
- });
88
- }
89
- });
90
-
91
- // Generate Markdown
92
- let md = "# Detailed Evolution Report (By Skill)\n\n> Comprehensive breakdown of system changes.\n\n";
93
-
94
- // Sort skills alphabetically
95
- const sortedSkills = Object.keys(skillUpdates).sort();
96
-
97
- sortedSkills.forEach(skill => {
98
- md += `## ${skill}\n`;
99
- const updates = skillUpdates[skill];
100
-
101
- updates.forEach(u => {
102
- // Icon based on content
103
- let icon = '*';
104
- const lowerDesc = u.desc.toLowerCase();
105
- if (lowerDesc.includes('optimiz')) icon = '[optimize]';
106
- if (lowerDesc.includes('secur') || lowerDesc.includes('harden') || lowerDesc.includes('permission')) icon = '[security]';
107
- if (lowerDesc.includes('fix') || lowerDesc.includes('patch')) icon = '[repair]';
108
- if (lowerDesc.includes('creat') || lowerDesc.includes('add')) icon = '[add]';
109
-
110
- md += `### ${icon} ${u.date}\n`;
111
- md += `${u.desc}\n\n`;
112
- });
113
- md += `---\n`;
114
- });
115
-
116
- fs.writeFileSync(OUT_FILE, md);
117
- console.log(`Generated report for ${sortedSkills.length} skills.`);
118
- }
119
-
120
- analyzeEvolution();
121
-