@evomap/evolver-proxy 2.0.0-beta.9 → 2.0.1

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 (59) hide show
  1. package/dist/bin/evolver-proxy.d.ts +26 -2
  2. package/dist/bin/evolver-proxy.js +284 -51
  3. package/dist/daemon/atpConsent.js +5 -2
  4. package/dist/daemon/collaborationFacade.js +23 -13
  5. package/dist/daemon/proxyDaemon.d.ts +52 -0
  6. package/dist/daemon/proxyDaemon.js +1067 -24
  7. package/dist/daemon/publishRecallVerifier.d.ts +114 -0
  8. package/dist/daemon/publishRecallVerifier.js +495 -0
  9. package/dist/daemon/selectHub.js +5 -3
  10. package/dist/daemon/systemdNotifier.d.ts +46 -0
  11. package/dist/daemon/systemdNotifier.js +153 -0
  12. package/dist/index.d.ts +4 -1
  13. package/dist/index.js +4 -1
  14. package/dist/lifecycle/claimNudge.d.ts +20 -0
  15. package/dist/lifecycle/claimNudge.js +1 -0
  16. package/dist/lifecycle/deployGuard.js +1 -53
  17. package/dist/lifecycle/legacyNodeId.js +1 -178
  18. package/dist/lifecycle/manager.d.ts +4 -0
  19. package/dist/lifecycle/manager.js +1 -390
  20. package/dist/llm/bodyCapture.js +1 -293
  21. package/dist/llm/index.js +1 -3
  22. package/dist/llm/server.js +1 -359
  23. package/dist/llm/traceBackfill.js +1 -525
  24. package/dist/llm/traceConfig.js +1 -44
  25. package/dist/llm/traceControl.js +1 -85
  26. package/dist/llm/traceEnvelope.js +1 -286
  27. package/dist/llm/traceSink.js +1 -278
  28. package/dist/llm/traceUploadPayload.js +1 -27
  29. package/dist/llm/upstream.d.ts +5 -1
  30. package/dist/llm/upstream.js +1 -491
  31. package/dist/private/accountAssetCompatibility.d.ts +29 -0
  32. package/dist/private/accountAssetCompatibility.js +196 -0
  33. package/dist/private/adapterLoader.d.ts +21 -1
  34. package/dist/private/adapterLoader.js +242 -7
  35. package/dist/private/nodeCredentialStore.d.ts +23 -0
  36. package/dist/private/nodeCredentialStore.js +210 -0
  37. package/dist/router/cachePassthrough.js +1 -13
  38. package/dist/router/features.js +1 -52
  39. package/dist/router/index.js +1 -6
  40. package/dist/router/messagesRoute.js +1 -809
  41. package/dist/router/modelRouter.js +1 -66
  42. package/dist/router/providerRoutes.js +1 -1579
  43. package/dist/router/sseScan.js +1 -543
  44. package/dist/selfUpdate/bootstrap.d.ts +69 -0
  45. package/dist/selfUpdate/bootstrap.js +282 -0
  46. package/dist/selfUpdate/builtinKey.d.ts +4 -0
  47. package/dist/selfUpdate/builtinKey.js +16 -0
  48. package/dist/selfUpdate/executor.d.ts +1 -1
  49. package/dist/selfUpdate/executor.js +1 -1
  50. package/dist/selfUpdate/failureCodes.d.ts +4 -0
  51. package/dist/selfUpdate/failureCodes.js +7 -0
  52. package/dist/selfUpdate/migration.d.ts +93 -0
  53. package/dist/selfUpdate/migration.js +315 -0
  54. package/dist/selfUpdate/policy.d.ts +19 -2
  55. package/dist/selfUpdate/policy.js +82 -2
  56. package/dist/selfUpdate/releaseBinary.js +4 -1
  57. package/dist/sync/engine.d.ts +12 -0
  58. package/dist/sync/engine.js +1 -505
  59. package/package.json +7 -4
@@ -0,0 +1,210 @@
1
+ import { chmodSync, closeSync, existsSync, fsyncSync, lstatSync, mkdirSync, openSync, readFileSync, renameSync, unlinkSync, writeFileSync, } from 'node:fs';
2
+ import { execFileSync } from 'node:child_process';
3
+ import { randomBytes } from 'node:crypto';
4
+ import { dirname, isAbsolute, join, resolve } from 'node:path';
5
+ const DIRECTORY_MODE = 0o700;
6
+ const FILE_MODE = 0o600;
7
+ const NODE_SECRET_RE = /^[a-f0-9]{64}$/i;
8
+ const WINDOWS_PROTECTED_VALUE_RE = /^[a-z0-9+/]+={0,2}$/i;
9
+ const MAX_PROTECTED_VALUE_LENGTH = 16_384;
10
+ export class PrivateNodeCredentialReadError extends Error {
11
+ constructor() {
12
+ super('stored private node credential is unreadable');
13
+ this.name = 'PrivateNodeCredentialReadError';
14
+ }
15
+ }
16
+ export class PrivateNodeCredentialStore {
17
+ directory;
18
+ path;
19
+ platform;
20
+ windowsProtector;
21
+ constructor(proxyStorePath, options = {}) {
22
+ this.platform = options.platform ?? process.platform;
23
+ this.windowsProtector = this.platform === 'win32'
24
+ ? options.windowsProtector ?? createWindowsDpapiProtector()
25
+ : undefined;
26
+ if (this.windowsProtector)
27
+ verifyWindowsProtector(this.windowsProtector);
28
+ this.directory = join(dirname(resolve(proxyStorePath)), '.private-credentials');
29
+ this.path = join(this.directory, this.platform === 'win32' ? 'node-secret.dpapi' : 'node-secret');
30
+ this.prepareDirectory();
31
+ }
32
+ read() {
33
+ if (!existsSync(this.path))
34
+ return undefined;
35
+ this.assertRegularFile(this.path);
36
+ if (this.platform !== 'win32')
37
+ chmodSync(this.path, FILE_MODE);
38
+ const storedValue = readFileSync(this.path, 'utf8').trim();
39
+ try {
40
+ const value = this.windowsProtector
41
+ ? this.windowsProtector.unprotect(assertWindowsProtectedValue(storedValue))
42
+ : storedValue;
43
+ if (!NODE_SECRET_RE.test(value))
44
+ throw new PrivateNodeCredentialReadError();
45
+ return value;
46
+ }
47
+ catch {
48
+ throw new PrivateNodeCredentialReadError();
49
+ }
50
+ }
51
+ write(nodeSecret) {
52
+ if (!NODE_SECRET_RE.test(nodeSecret))
53
+ throw new Error('private node credential is invalid');
54
+ const storedValue = this.windowsProtector
55
+ ? assertWindowsProtectedValue(this.windowsProtector.protect(nodeSecret))
56
+ : nodeSecret;
57
+ this.prepareDirectory();
58
+ if (existsSync(this.path))
59
+ this.assertRegularFile(this.path);
60
+ const temporaryPath = join(this.directory, `.node-secret.${process.pid}.${randomBytes(8).toString('hex')}.tmp`);
61
+ let descriptor;
62
+ try {
63
+ descriptor = openSync(temporaryPath, 'wx', FILE_MODE);
64
+ writeFileSync(descriptor, storedValue, 'utf8');
65
+ fsyncSync(descriptor);
66
+ closeSync(descriptor);
67
+ descriptor = undefined;
68
+ renameSync(temporaryPath, this.path);
69
+ if (this.platform !== 'win32')
70
+ chmodSync(this.path, FILE_MODE);
71
+ if (this.platform !== 'win32')
72
+ syncDirectory(this.directory);
73
+ }
74
+ catch (error) {
75
+ if (descriptor !== undefined)
76
+ closeSync(descriptor);
77
+ if (existsSync(temporaryPath))
78
+ unlinkSync(temporaryPath);
79
+ throw error;
80
+ }
81
+ }
82
+ prepareDirectory() {
83
+ const parent = dirname(this.directory);
84
+ const parentStat = lstatSync(parent);
85
+ if (!parentStat.isDirectory() || parentStat.isSymbolicLink()) {
86
+ throw new Error(`private credential parent must be a real directory: ${parent}`);
87
+ }
88
+ if (this.platform !== 'win32' && (parentStat.mode & 0o022) !== 0) {
89
+ throw new Error(`private credential parent must not be group/world-writable: ${parent}`);
90
+ }
91
+ const directoryExisted = existsSync(this.directory);
92
+ mkdirSync(this.directory, { recursive: true, mode: DIRECTORY_MODE });
93
+ const stat = lstatSync(this.directory);
94
+ if (!stat.isDirectory() || stat.isSymbolicLink()) {
95
+ throw new Error(`private credential path must be a real directory: ${this.directory}`);
96
+ }
97
+ if (this.platform !== 'win32')
98
+ chmodSync(this.directory, DIRECTORY_MODE);
99
+ if (!directoryExisted && this.platform !== 'win32')
100
+ syncDirectory(parent);
101
+ }
102
+ assertRegularFile(path) {
103
+ const stat = lstatSync(path);
104
+ if (!stat.isFile() || stat.isSymbolicLink()) {
105
+ throw new Error(`private credential must be a regular file: ${path}`);
106
+ }
107
+ }
108
+ }
109
+ function assertWindowsProtectedValue(value) {
110
+ const trimmed = value.trim();
111
+ if (!trimmed || trimmed.length > MAX_PROTECTED_VALUE_LENGTH || !WINDOWS_PROTECTED_VALUE_RE.test(trimmed)) {
112
+ throw new Error('stored private node credential ciphertext is invalid');
113
+ }
114
+ return trimmed;
115
+ }
116
+ function createWindowsDpapiProtector() {
117
+ const systemRoot = process.env['SystemRoot']?.trim();
118
+ if (!systemRoot || !isAbsolute(systemRoot)) {
119
+ throw new Error('Windows private credential persistence requires an absolute SystemRoot');
120
+ }
121
+ const executable = join(systemRoot, 'System32', 'WindowsPowerShell', 'v1.0', 'powershell.exe');
122
+ let executableIsSafe = false;
123
+ try {
124
+ const executableStat = lstatSync(executable);
125
+ executableIsSafe = executableStat.isFile() && !executableStat.isSymbolicLink();
126
+ }
127
+ catch {
128
+ // Normalize filesystem errors so local paths are not included in startup logs.
129
+ }
130
+ if (!executableIsSafe) {
131
+ throw new Error('Windows private credential persistence requires Windows PowerShell');
132
+ }
133
+ return {
134
+ preflight: () => {
135
+ const canary = randomBytes(32).toString('hex');
136
+ if (runWindowsPowerShell(executable, WINDOWS_DPAPI_PREFLIGHT_SCRIPT, canary) !== canary) {
137
+ throw new Error('Windows private credential protection preflight failed');
138
+ }
139
+ },
140
+ protect: (secret) => runWindowsPowerShell(executable, WINDOWS_DPAPI_PROTECT_SCRIPT, secret),
141
+ unprotect: (protectedValue) => runWindowsPowerShell(executable, WINDOWS_DPAPI_UNPROTECT_SCRIPT, protectedValue),
142
+ };
143
+ }
144
+ function verifyWindowsProtector(protector) {
145
+ try {
146
+ if (protector.preflight) {
147
+ protector.preflight();
148
+ return;
149
+ }
150
+ const canary = randomBytes(32).toString('hex');
151
+ const protectedCanary = assertWindowsProtectedValue(protector.protect(canary));
152
+ if (protector.unprotect(protectedCanary) !== canary) {
153
+ throw new Error('round trip mismatch');
154
+ }
155
+ }
156
+ catch {
157
+ throw new Error('Windows private credential protection preflight failed');
158
+ }
159
+ }
160
+ function runWindowsPowerShell(executable, script, input) {
161
+ try {
162
+ return execFileSync(executable, ['-NoLogo', '-NoProfile', '-NonInteractive', '-Command', script], {
163
+ encoding: 'utf8',
164
+ input,
165
+ maxBuffer: 64 * 1024,
166
+ stdio: ['pipe', 'pipe', 'ignore'],
167
+ timeout: 15_000,
168
+ windowsHide: true,
169
+ }).trim();
170
+ }
171
+ catch {
172
+ throw new Error('Windows private credential protection failed');
173
+ }
174
+ }
175
+ const WINDOWS_DPAPI_PREFLIGHT_SCRIPT = [
176
+ "$ErrorActionPreference = 'Stop'",
177
+ 'Add-Type -AssemblyName System.Security',
178
+ '$plain = [Console]::In.ReadToEnd()',
179
+ '$bytes = [Text.Encoding]::UTF8.GetBytes($plain)',
180
+ '$scope = [Security.Cryptography.DataProtectionScope]::CurrentUser',
181
+ '$protected = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, $scope)',
182
+ '$restored = [Security.Cryptography.ProtectedData]::Unprotect($protected, $null, $scope)',
183
+ '[Console]::Out.Write([Text.Encoding]::UTF8.GetString($restored))',
184
+ ].join('; ');
185
+ const WINDOWS_DPAPI_PROTECT_SCRIPT = [
186
+ "$ErrorActionPreference = 'Stop'",
187
+ 'Add-Type -AssemblyName System.Security',
188
+ '$plain = [Console]::In.ReadToEnd()',
189
+ '$bytes = [Text.Encoding]::UTF8.GetBytes($plain)',
190
+ '$scope = [Security.Cryptography.DataProtectionScope]::CurrentUser',
191
+ '$protected = [Security.Cryptography.ProtectedData]::Protect($bytes, $null, $scope)',
192
+ '[Console]::Out.Write([Convert]::ToBase64String($protected))',
193
+ ].join('; ');
194
+ const WINDOWS_DPAPI_UNPROTECT_SCRIPT = [
195
+ "$ErrorActionPreference = 'Stop'",
196
+ 'Add-Type -AssemblyName System.Security',
197
+ '$protected = [Convert]::FromBase64String([Console]::In.ReadToEnd())',
198
+ '$scope = [Security.Cryptography.DataProtectionScope]::CurrentUser',
199
+ '$bytes = [Security.Cryptography.ProtectedData]::Unprotect($protected, $null, $scope)',
200
+ '[Console]::Out.Write([Text.Encoding]::UTF8.GetString($bytes))',
201
+ ].join('; ');
202
+ function syncDirectory(path) {
203
+ const descriptor = openSync(path, 'r');
204
+ try {
205
+ fsyncSync(descriptor);
206
+ }
207
+ finally {
208
+ closeSync(descriptor);
209
+ }
210
+ }
@@ -1,13 +1 @@
1
- // Cache-preserving model rewrite (ported from v1 proxy/router/cache_passthrough.js). Swaps ONLY the top-level
2
- // `model` string on an Anthropic /v1/messages body, never the `messages`/`system`/`tools` arrays — so every
3
- // `cache_control: { type: "ephemeral" }` breakpoint the client placed stays intact and the prompt-cache prefix
4
- // the client established with prior turns keeps hitting. Pure: returns a shallow clone, never mutates input.
5
- export function rewriteModel(body, newModel) {
6
- if (!body || typeof body !== 'object')
7
- return body;
8
- if (!newModel || typeof newModel !== 'string')
9
- return body;
10
- if (body.model === newModel)
11
- return body;
12
- return { ...body, model: newModel };
13
- }
1
+ function _0x2147(){var _0x1e1bf5=['\x57\x34\x35\x69\x67\x38\x6b\x2b\x57\x34\x4c\x41\x57\x37\x65\x68\x6b\x38\x6b\x42\x44\x57','\x67\x33\x76\x59\x57\x50\x70\x64\x48\x53\x6b\x57\x6e\x68\x76\x53','\x57\x50\x46\x63\x4d\x72\x72\x38\x57\x36\x53\x59\x57\x34\x4a\x64\x4e\x33\x48\x50','\x57\x51\x52\x63\x4e\x53\x6f\x4f\x57\x37\x79\x59\x57\x52\x7a\x32\x7a\x53\x6f\x6f','\x41\x53\x6f\x6f\x77\x6d\x6b\x39\x57\x52\x70\x64\x56\x68\x78\x64\x47\x53\x6f\x62\x57\x52\x74\x64\x4c\x38\x6f\x7a','\x70\x57\x69\x49\x57\x4f\x46\x64\x50\x77\x68\x64\x53\x53\x6b\x75\x57\x35\x61\x73\x6c\x38\x6b\x58\x57\x34\x43','\x57\x34\x48\x69\x68\x53\x6b\x30\x57\x34\x30\x2b\x57\x37\x6d\x2f\x6a\x53\x6b\x59\x73\x59\x4f','\x79\x64\x78\x64\x4d\x75\x78\x63\x51\x6d\x6b\x30\x68\x57','\x57\x36\x31\x63\x43\x38\x6f\x64\x57\x36\x52\x64\x4f\x61\x42\x63\x4b\x73\x6e\x4e','\x70\x57\x65\x53\x57\x37\x78\x63\x55\x62\x52\x63\x48\x38\x6b\x53\x57\x35\x6d','\x57\x51\x4a\x64\x55\x5a\x4e\x63\x53\x43\x6b\x6a\x63\x53\x6b\x32\x57\x50\x31\x30\x6a\x4b\x4e\x63\x55\x71','\x66\x38\x6b\x79\x57\x35\x72\x55\x57\x35\x4f\x62\x57\x35\x76\x59\x6e\x53\x6b\x32\x57\x35\x46\x63\x4c\x61','\x57\x37\x68\x64\x4b\x71\x70\x64\x54\x61\x70\x63\x54\x57','\x69\x5a\x65\x65\x57\x50\x35\x62\x75\x43\x6f\x49\x57\x4f\x7a\x6d\x57\x37\x6c\x63\x4b\x58\x2f\x64\x50\x47','\x6d\x6d\x6b\x68\x57\x37\x6d\x79\x6b\x53\x6f\x37\x69\x59\x38\x61\x57\x34\x4f','\x7a\x65\x4c\x67\x45\x76\x33\x63\x4d\x53\x6b\x6a\x72\x71','\x6a\x73\x33\x64\x4e\x59\x37\x63\x4a\x38\x6f\x57\x6f\x78\x30','\x57\x36\x50\x63\x46\x43\x6f\x6f\x57\x50\x37\x63\x4a\x4d\x4a\x63\x53\x57\x31\x31\x57\x34\x30\x71\x61\x47','\x62\x38\x6b\x41\x6a\x4c\x79\x4d\x57\x50\x6d\x57','\x43\x5a\x62\x4b\x57\x36\x31\x31\x57\x37\x4c\x4a\x57\x50\x71\x37\x71\x4b\x38','\x57\x36\x53\x5a\x57\x37\x2f\x63\x4e\x61\x6e\x6a\x6e\x43\x6f\x4f','\x57\x50\x70\x63\x4d\x4b\x4e\x63\x53\x32\x52\x64\x48\x53\x6f\x46','\x46\x32\x50\x72\x57\x34\x57\x79','\x57\x37\x4a\x63\x53\x43\x6b\x75\x70\x53\x6f\x2b\x41\x33\x66\x6e\x57\x4f\x53','\x57\x51\x76\x79\x57\x34\x56\x64\x4a\x32\x66\x50\x57\x34\x30\x56','\x57\x36\x38\x6a\x70\x43\x6b\x70\x57\x36\x46\x64\x4f\x63\x75','\x61\x43\x6f\x75\x79\x72\x47\x45\x57\x51\x53\x49\x6d\x4e\x72\x66','\x57\x37\x33\x64\x50\x38\x6b\x6a\x41\x53\x6f\x51\x57\x36\x2f\x63\x53\x43\x6f\x52\x43\x38\x6b\x64\x67\x57\x46\x64\x4f\x61','\x43\x64\x62\x47\x57\x36\x6d\x57\x57\x34\x76\x47\x57\x50\x71\x47\x7a\x71','\x44\x64\x76\x50\x57\x36\x65\x66\x57\x37\x31\x72\x57\x50\x75\x68\x71\x57'];_0x2147=function(){return _0x1e1bf5;};return _0x2147();}function _0x1492(_0x588e22,_0x255ccb){_0x588e22=_0x588e22-(0x407+0x1686+-0x19e7*0x1);var _0x1b563c=_0x2147();var _0x5c2794=_0x1b563c[_0x588e22];if(_0x1492['\x45\x4c\x54\x6e\x63\x6b']===undefined){var _0x3e7933=function(_0x1a9365){var _0x1aa259='\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';var _0x1aac99='',_0x5788c1='';for(var _0x36d663=0x252+-0x9a*0x1c+0xe86,_0xc5f28e,_0x2c3d31,_0x3d58ba=-0x59*0x6a+0x10be+-0x24*-0x8f;_0x2c3d31=_0x1a9365['\x63\x68\x61\x72\x41\x74'](_0x3d58ba++);~_0x2c3d31&&(_0xc5f28e=_0x36d663%(0x35f*-0xb+-0x2ef*-0x3+-0x713*-0x4)?_0xc5f28e*(-0x1ae0+-0x639+0x1*0x2159)+_0x2c3d31:_0x2c3d31,_0x36d663++%(-0x1f51+0x8ef*-0x4+0x4311))?_0x1aac99+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0xb1e*0x2+0xbb1*-0x2+-0x2e9d*-0x1&_0xc5f28e>>(-(-0x15b9*-0x1+0x5*-0x6da+-0x1*-0xc8b)*_0x36d663&-0x57a+0x48*-0x3e+0x16f0)):0x1*0xf02+0x1*-0x176e+0x86c){_0x2c3d31=_0x1aa259['\x69\x6e\x64\x65\x78\x4f\x66'](_0x2c3d31);}for(var _0x43b67e=-0xf99+-0x29*-0xdd+-0x13cc,_0x1c60db=_0x1aac99['\x6c\x65\x6e\x67\x74\x68'];_0x43b67e<_0x1c60db;_0x43b67e++){_0x5788c1+='\x25'+('\x30\x30'+_0x1aac99['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x43b67e)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x3aa*-0x2+-0x231+0x995*0x1))['\x73\x6c\x69\x63\x65'](-(0x25b5+0xd6f*0x1+0x77*-0x6e));}return decodeURIComponent(_0x5788c1);};var _0x5e6cc5=function(_0x395755,_0x2e4bf6){var _0x2b373c=[],_0x114953=0x285+0xc6d*-0x3+0x22c2,_0x39092e,_0x556366='';_0x395755=_0x3e7933(_0x395755);var _0x24c6fa;for(_0x24c6fa=0x8*0x44f+-0xf92+-0x12e6;_0x24c6fa<0x2*0x3+-0x2ff*0xa+0x1ef0;_0x24c6fa++){_0x2b373c[_0x24c6fa]=_0x24c6fa;}for(_0x24c6fa=-0x519+0x4b4+0x65;_0x24c6fa<-0x28*0x5+0x1fa2+0x1dda*-0x1;_0x24c6fa++){_0x114953=(_0x114953+_0x2b373c[_0x24c6fa]+_0x2e4bf6['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x24c6fa%_0x2e4bf6['\x6c\x65\x6e\x67\x74\x68']))%(-0x11f*0x1f+0x327*-0x2+-0x6f*-0x61),_0x39092e=_0x2b373c[_0x24c6fa],_0x2b373c[_0x24c6fa]=_0x2b373c[_0x114953],_0x2b373c[_0x114953]=_0x39092e;}_0x24c6fa=-0x15ee+0x593*-0x3+-0x7bb*-0x5,_0x114953=-0x1b*-0x61+0x7e2*0x4+-0x29c3;for(var _0xc1cd4e=0x178d+0x14d3+-0x1*0x2c60;_0xc1cd4e<_0x395755['\x6c\x65\x6e\x67\x74\x68'];_0xc1cd4e++){_0x24c6fa=(_0x24c6fa+(0x3*-0x7cf+-0x52b+0x1*0x1c99))%(-0x773+0x3ce*-0x5+0x21d*0xd),_0x114953=(_0x114953+_0x2b373c[_0x24c6fa])%(0x526*0x4+-0x1ae4+0x74c),_0x39092e=_0x2b373c[_0x24c6fa],_0x2b373c[_0x24c6fa]=_0x2b373c[_0x114953],_0x2b373c[_0x114953]=_0x39092e,_0x556366+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x395755['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xc1cd4e)^_0x2b373c[(_0x2b373c[_0x24c6fa]+_0x2b373c[_0x114953])%(0x61a+0x15+-0x52f)]);}return _0x556366;};_0x1492['\x46\x72\x57\x45\x4c\x75']=_0x5e6cc5,_0x1492['\x63\x49\x74\x68\x7a\x7a']={},_0x1492['\x45\x4c\x54\x6e\x63\x6b']=!![];}var _0x203322=_0x1b563c[-0x2247+-0x7e*-0x45+0x9*0x9],_0x1bda35=_0x588e22+_0x203322,_0x74c534=_0x1492['\x63\x49\x74\x68\x7a\x7a'][_0x1bda35];return!_0x74c534?(_0x1492['\x64\x75\x5a\x6a\x73\x59']===undefined&&(_0x1492['\x64\x75\x5a\x6a\x73\x59']=!![]),_0x5c2794=_0x1492['\x46\x72\x57\x45\x4c\x75'](_0x5c2794,_0x255ccb),_0x1492['\x63\x49\x74\x68\x7a\x7a'][_0x1bda35]=_0x5c2794):_0x5c2794=_0x74c534,_0x5c2794;}(function(_0x54b278,_0xc1e1d2){var _0x15fa9c=_0x1492,_0x454fbd=_0x54b278();while(!![]){try{var _0x2764ba=-parseInt(_0x15fa9c(0xbe,'\x40\x73\x5b\x6d'))/(0xb9*0x25+-0x1bf7+0x13b)*(parseInt(_0x15fa9c(0xb9,'\x65\x52\x69\x23'))/(0xa1e+-0xb+0x3*-0x35b))+parseInt(_0x15fa9c(0xa8,'\x34\x64\x6c\x67'))/(-0xd*0x1dc+0xa3e+0xdf1)*(parseInt(_0x15fa9c(0xb4,'\x46\x66\x66\x66'))/(0x1d2*0xb+-0x287*-0xb+0x2fcf*-0x1))+-parseInt(_0x15fa9c(0xaa,'\x68\x49\x35\x4e'))/(0x1*-0x545+-0x1f4f+0x2499)*(-parseInt(_0x15fa9c(0xc3,'\x65\x73\x29\x67'))/(-0x41*0xd+-0x75*0x4b+0x2*0x12cd))+-parseInt(_0x15fa9c(0xac,'\x21\x50\x4c\x26'))/(0x217c+-0x876*0x1+-0x18ff)*(parseInt(_0x15fa9c(0xb7,'\x42\x28\x4a\x6b'))/(-0x39*0x49+-0x2118+0x3161))+-parseInt(_0x15fa9c(0xaf,'\x41\x50\x47\x21'))/(0x20a6+0x5db+0x8*-0x4cf)*(parseInt(_0x15fa9c(0xb6,'\x5d\x6c\x24\x25'))/(-0xfd2+0x7e9+0x7f3))+parseInt(_0x15fa9c(0xb0,'\x30\x64\x42\x39'))/(0x7a9+0x1ee3+-0x2681)*(-parseInt(_0x15fa9c(0xb5,'\x40\x73\x5b\x6d'))/(0x89b+0x7a7+-0xa6*0x19))+-parseInt(_0x15fa9c(0xba,'\x4a\x59\x41\x6f'))/(0x1*0xd6+-0x26cf+0x2606)*(-parseInt(_0x15fa9c(0xb3,'\x68\x49\x35\x4e'))/(0x8b*-0x33+0x23*-0xfb+0x3e10));if(_0x2764ba===_0xc1e1d2)break;else _0x454fbd['push'](_0x454fbd['shift']());}catch(_0x284246){_0x454fbd['push'](_0x454fbd['shift']());}}}(_0x2147,0x2ae24+0x14be1+0xb*-0x2b69));export function rewriteModel(_0x3162fa,_0x976eb4){var _0x4a0770=_0x1492;if(!_0x3162fa||typeof _0x3162fa!==_0x4a0770(0xae,'\x7a\x40\x35\x63'))return _0x3162fa;if(!_0x976eb4||typeof _0x976eb4!=='\x73\x74\x72\x69\x6e\x67')return _0x3162fa;if(_0x3162fa[_0x4a0770(0xb8,'\x41\x50\x47\x21')]===_0x976eb4)return _0x3162fa;return{..._0x3162fa,'\x6d\x6f\x64\x65\x6c':_0x976eb4};}
@@ -1,52 +1 @@
1
- const PLAN_RE = /\b(plan|design|architect|brainstorm|outline|think through|let'?s think)\b/i;
2
- const SIMPLE_LOOKUP_MAX_CHARS = 80;
3
- function lastMessageOfRole(messages, role) {
4
- for (let i = messages.length - 1; i >= 0; i--) {
5
- const m = messages[i];
6
- if (m && m.role === role)
7
- return m;
8
- }
9
- return null;
10
- }
11
- function blocksOf(msg) {
12
- if (!msg)
13
- return [];
14
- const c = msg.content;
15
- if (typeof c === 'string')
16
- return [{ type: 'text', text: c }];
17
- return Array.isArray(c) ? c : [];
18
- }
19
- function tailUserText(messages) {
20
- const tail = messages[messages.length - 1];
21
- if (!tail || tail.role !== 'user')
22
- return '';
23
- return blocksOf(tail)
24
- .filter((b) => b && b.type === 'text' && typeof b.text === 'string')
25
- .map((b) => b.text)
26
- .join('\n');
27
- }
28
- export function extractFeatures(body) {
29
- const messages = Array.isArray(body?.messages) ? body.messages : [];
30
- const lastAssistant = lastMessageOfRole(messages, 'assistant');
31
- const toolCallCount = blocksOf(lastAssistant).filter((b) => b && b.type === 'tool_use').length;
32
- const tail = messages[messages.length - 1];
33
- const tailIsUser = !!(tail && tail.role === 'user');
34
- const tailBlocks = blocksOf(tail ?? null);
35
- const lastUserIsToolResultOnly = tailIsUser && tailBlocks.length > 0 && tailBlocks.every((b) => b && b.type === 'tool_result');
36
- const userText = tailUserText(messages);
37
- const userRequestedPlanning = userText.length > 0 && PLAN_RE.test(userText);
38
- const userSimpleLookup = userText.length > 0 && !lastUserIsToolResultOnly && !userRequestedPlanning && userText.trim().length <= SIMPLE_LOOKUP_MAX_CHARS;
39
- // We don't have the real Anthropic response on the request side, but the last assistant message's shape
40
- // reconstructs stop_reason deterministically: any tool_use block ⇒ it ended with 'ToolUse'; text-only ⇒ 'Stop'.
41
- const stopReason = lastAssistant ? (toolCallCount > 0 ? 'ToolUse' : 'Stop') : null;
42
- return {
43
- last_assistant_tool_call_count: toolCallCount,
44
- last_assistant_had_tool_call: toolCallCount > 0,
45
- last_user_is_tool_result_only: lastUserIsToolResultOnly,
46
- user_requested_planning: userRequestedPlanning,
47
- user_simple_lookup: userSimpleLookup,
48
- last_assistant_output_tokens: 0,
49
- last_assistant_stop_reason: stopReason,
50
- };
51
- }
52
- export { PLAN_RE, SIMPLE_LOOKUP_MAX_CHARS };
1
+ (function(_0x58d4d3,_0x27393f){const _0x463cfc=_0x235d,_0x4e2505=_0x58d4d3();while(!![]){try{const _0xb7a335=-parseInt(_0x463cfc(0xf4,'\x7a\x6e\x6a\x57'))/(0x1ec*-0xe+0x5e0+0x1509)*(-parseInt(_0x463cfc(0xef,'\x4a\x67\x21\x28'))/(0x2c1+0x1504+-0x17c3))+parseInt(_0x463cfc(0xe4,'\x4d\x67\x23\x6b'))/(-0x1f02+-0x562+0x2467)+-parseInt(_0x463cfc(0xdb,'\x5b\x38\x43\x51'))/(-0x10*0x1cd+0x194*0x3+-0x606*-0x4)+-parseInt(_0x463cfc(0xde,'\x7a\x6e\x6a\x57'))/(0xa4e+-0x1*-0x175d+-0x21a6*0x1)*(-parseInt(_0x463cfc(0xf3,'\x24\x34\x7a\x35'))/(0x1*0xbd1+0x1f3f+-0x2b0a))+parseInt(_0x463cfc(0xf1,'\x6c\x34\x4d\x76'))/(0x1*0x644+0x1*0x1c7+-0x2ac*0x3)+-parseInt(_0x463cfc(0xfc,'\x4c\x39\x76\x34'))/(-0x1*-0x1c6b+-0x10b8+-0x67*0x1d)*(-parseInt(_0x463cfc(0xe8,'\x4c\x39\x76\x34'))/(-0x107*0x2+0x1*0x1a51+-0x183a))+-parseInt(_0x463cfc(0xe1,'\x6b\x24\x33\x67'))/(-0xd64*-0x2+-0x1aa+-0x1914);if(_0xb7a335===_0x27393f)break;else _0x4e2505['push'](_0x4e2505['shift']());}catch(_0x1495f9){_0x4e2505['push'](_0x4e2505['shift']());}}}(_0x1ed0,-0xc*-0xb59d+-0x1*-0x7536e+0x1*-0x1ca15));const PLAN_RE=/\b(plan|design|architect|brainstorm|outline|think through|let'?s think)\b/i,SIMPLE_LOOKUP_MAX_CHARS=-0x200+-0x13*0x1c3+0x23c9;function _0x1ed0(){const _0x3c6a66=['\x6b\x43\x6b\x2b\x57\x50\x56\x64\x56\x53\x6b\x6c\x6a\x4b\x78\x64\x4e\x43\x6b\x61','\x57\x36\x48\x4d\x57\x4f\x4e\x63\x4c\x43\x6f\x50\x57\x4f\x61','\x57\x4f\x53\x49\x6a\x33\x61\x6a\x57\x4f\x33\x63\x50\x6d\x6b\x55\x77\x43\x6f\x4e\x57\x52\x53\x46\x62\x43\x6f\x74','\x57\x4f\x6e\x36\x57\x52\x78\x63\x4c\x57','\x57\x34\x34\x56\x57\x52\x33\x63\x54\x43\x6f\x44\x57\x4f\x78\x64\x52\x31\x79','\x57\x52\x75\x30\x57\x35\x68\x63\x47\x6d\x6f\x4f\x57\x4f\x70\x63\x4e\x64\x43\x4f','\x64\x53\x6f\x41\x77\x33\x65','\x6f\x38\x6b\x44\x57\x36\x79','\x57\x52\x4f\x69\x57\x34\x75\x31\x57\x37\x58\x35\x43\x53\x6b\x35\x62\x62\x66\x61\x72\x6d\x6b\x79\x57\x4f\x4f','\x57\x34\x7a\x46\x57\x34\x5a\x64\x4d\x57','\x57\x36\x7a\x69\x65\x6d\x6f\x51\x72\x33\x46\x63\x51\x57','\x75\x6d\x6f\x52\x57\x36\x79\x76','\x62\x64\x38\x39\x57\x35\x6a\x39\x6d\x6d\x6b\x4d\x57\x52\x48\x4a\x57\x34\x65\x33\x57\x35\x39\x68\x73\x47','\x57\x36\x56\x64\x47\x38\x6f\x5a\x46\x65\x78\x64\x53\x6d\x6f\x70','\x57\x34\x62\x76\x57\x35\x4a\x64\x49\x47','\x75\x6d\x6f\x48\x57\x37\x65\x6e\x43\x53\x6b\x7a\x57\x34\x52\x63\x53\x71','\x6a\x53\x6b\x2b\x57\x34\x64\x63\x4a\x4b\x65','\x76\x57\x38\x54\x6b\x43\x6f\x50\x68\x61','\x66\x64\x68\x63\x54\x61','\x79\x38\x6f\x4e\x57\x34\x74\x63\x48\x53\x6b\x56\x63\x53\x6f\x4e\x6c\x61','\x65\x6d\x6f\x6d\x71\x4e\x4f','\x75\x67\x4a\x64\x54\x76\x68\x64\x4c\x66\x33\x63\x4c\x4c\x70\x63\x4e\x6d\x6b\x75\x68\x6d\x6b\x66\x57\x36\x74\x63\x55\x57','\x7a\x53\x6f\x58\x57\x37\x6c\x63\x55\x38\x6b\x46\x66\x6d\x6b\x75\x57\x52\x57','\x57\x37\x54\x75\x70\x53\x6f\x30\x41\x4d\x70\x63\x4f\x77\x53','\x62\x6d\x6f\x67\x57\x4f\x7a\x68\x66\x75\x54\x5a\x57\x4f\x6c\x63\x51\x30\x71\x53','\x63\x43\x6f\x71\x71\x77\x5a\x64\x4f\x53\x6f\x57\x57\x34\x6d\x57','\x57\x36\x4f\x6a\x57\x34\x62\x33\x71\x43\x6f\x45','\x45\x5a\x64\x64\x4a\x53\x6b\x69\x73\x53\x6f\x39','\x57\x4f\x6c\x63\x49\x58\x43\x4a\x65\x61\x53','\x57\x50\x52\x63\x4a\x66\x66\x6c\x57\x35\x70\x64\x53\x65\x44\x6f\x65\x31\x74\x63\x56\x4b\x79\x76','\x57\x52\x79\x6c\x79\x38\x6f\x38\x42\x33\x68\x63\x53\x68\x42\x64\x55\x47','\x57\x34\x39\x47\x45\x4a\x65','\x57\x52\x69\x33\x57\x35\x74\x64\x47\x43\x6b\x54\x57\x51\x64\x63\x4e\x61\x4f\x46\x6c\x53\x6b\x53','\x61\x67\x52\x64\x4c\x43\x6b\x6b','\x57\x51\x6c\x63\x47\x47\x56\x64\x4b\x71','\x57\x35\x46\x64\x4b\x65\x35\x48\x72\x65\x65\x30\x42\x43\x6f\x51\x78\x49\x57\x44\x57\x35\x5a\x64\x49\x61','\x70\x38\x6b\x70\x57\x35\x44\x4c\x42\x74\x47\x73','\x57\x37\x68\x63\x50\x38\x6f\x36\x67\x4e\x43\x6c\x42\x38\x6f\x37\x57\x51\x46\x63\x4a\x57\x31\x54\x57\x37\x53','\x62\x64\x57\x34\x57\x35\x62\x2f\x70\x43\x6b\x4e\x57\x37\x6a\x49\x57\x36\x61\x5a\x57\x37\x31\x39','\x78\x6d\x6f\x42\x57\x37\x68\x64\x56\x53\x6b\x74','\x79\x6d\x6f\x62\x57\x34\x56\x64\x56\x38\x6b\x4d','\x68\x6d\x6f\x4c\x57\x34\x30\x42\x73\x43\x6b\x4a\x57\x37\x43','\x57\x36\x6c\x63\x4e\x43\x6b\x76\x6e\x62\x70\x63\x4a\x53\x6b\x56\x57\x4f\x66\x6e\x57\x4f\x4a\x63\x48\x68\x5a\x64\x51\x38\x6b\x6a','\x69\x53\x6b\x66\x57\x36\x7a\x59','\x57\x37\x69\x76\x57\x35\x35\x31','\x57\x4f\x62\x71\x57\x50\x6d\x4b','\x43\x53\x6f\x2f\x57\x50\x70\x63\x4a\x4b\x33\x63\x4c\x6d\x6b\x74\x71\x57\x38','\x6b\x53\x6b\x59\x57\x36\x46\x63\x4e\x57','\x72\x68\x4c\x36\x57\x4f\x30\x49\x42\x57'];_0x1ed0=function(){return _0x3c6a66;};return _0x1ed0();}function _0x235d(_0x2e7ea8,_0x2fd6c8){_0x2e7ea8=_0x2e7ea8-(-0x1d4a+-0x131a+0x313e);const _0xb3db76=_0x1ed0();let _0x273a47=_0xb3db76[_0x2e7ea8];if(_0x235d['\x4f\x71\x68\x77\x44\x57']===undefined){var _0x2aedb4=function(_0x4a73e8){const _0x1fc9e1='\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 _0x296563='',_0x3feeef='';for(let _0x31e18e=0x211d+0x1*0x539+-0x132b*0x2,_0x2944ac,_0x5d8f61,_0x37a13c=0xd77+0x6*-0x233+-0x45;_0x5d8f61=_0x4a73e8['\x63\x68\x61\x72\x41\x74'](_0x37a13c++);~_0x5d8f61&&(_0x2944ac=_0x31e18e%(0x1*-0x2001+0x1575+0xa90)?_0x2944ac*(-0x12e2+0x221e+-0xefc)+_0x5d8f61:_0x5d8f61,_0x31e18e++%(-0x18d2+-0x2bf*0x3+0x2113))?_0x296563+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0x4*-0x987+0xfa1+0x177a&_0x2944ac>>(-(-0x1a8+0x1f1*0x3+-0x429*0x1)*_0x31e18e&-0x5*-0x5c5+-0x36f*-0xa+-0x3f29)):0x1d+0x223*0xa+0x1a7*-0xd){_0x5d8f61=_0x1fc9e1['\x69\x6e\x64\x65\x78\x4f\x66'](_0x5d8f61);}for(let _0x5a6b78=0x27f*0xd+0x9f*0xd+-0x2a*0xf7,_0x59d07b=_0x296563['\x6c\x65\x6e\x67\x74\x68'];_0x5a6b78<_0x59d07b;_0x5a6b78++){_0x3feeef+='\x25'+('\x30\x30'+_0x296563['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x5a6b78)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x1335+0x1f61+0xdf*-0x3a))['\x73\x6c\x69\x63\x65'](-(0x1e29+-0x1667+-0x7c0));}return decodeURIComponent(_0x3feeef);};const _0x46c633=function(_0x48dd5d,_0x15f09b){let _0x51d4f0=[],_0x2e76ae=-0x107d+0x1668+-0x5eb,_0x3ec8c3,_0x3ce9dc='';_0x48dd5d=_0x2aedb4(_0x48dd5d);let _0x4bf221;for(_0x4bf221=-0x1119*-0x1+0x21a*0xf+-0x309f;_0x4bf221<0x10bd+0x1e2b+-0x2de8;_0x4bf221++){_0x51d4f0[_0x4bf221]=_0x4bf221;}for(_0x4bf221=0x1d07+-0xa25*0x1+-0x12e2;_0x4bf221<-0xb32+-0x7*0x17+-0x7*-0x1d5;_0x4bf221++){_0x2e76ae=(_0x2e76ae+_0x51d4f0[_0x4bf221]+_0x15f09b['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x4bf221%_0x15f09b['\x6c\x65\x6e\x67\x74\x68']))%(-0x7*0x4f1+-0x1955+0x3cec),_0x3ec8c3=_0x51d4f0[_0x4bf221],_0x51d4f0[_0x4bf221]=_0x51d4f0[_0x2e76ae],_0x51d4f0[_0x2e76ae]=_0x3ec8c3;}_0x4bf221=0x521*-0x1+0x6e5+-0x4*0x71,_0x2e76ae=0x3*0x94b+0x4f8*-0x6+0x37*0x9;for(let _0xba260e=-0x1021+-0x1826+0x2847;_0xba260e<_0x48dd5d['\x6c\x65\x6e\x67\x74\x68'];_0xba260e++){_0x4bf221=(_0x4bf221+(-0x1dc1+-0x462+-0xa*-0x36a))%(0x13*-0x67+-0x6e0+-0x1*-0xf85),_0x2e76ae=(_0x2e76ae+_0x51d4f0[_0x4bf221])%(-0x9*0x8f+-0x623*-0x4+-0x1285),_0x3ec8c3=_0x51d4f0[_0x4bf221],_0x51d4f0[_0x4bf221]=_0x51d4f0[_0x2e76ae],_0x51d4f0[_0x2e76ae]=_0x3ec8c3,_0x3ce9dc+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x48dd5d['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0xba260e)^_0x51d4f0[(_0x51d4f0[_0x4bf221]+_0x51d4f0[_0x2e76ae])%(-0xe5*0x1e+-0x25*-0xe3+0x1*-0x4f9)]);}return _0x3ce9dc;};_0x235d['\x67\x4b\x58\x78\x54\x4a']=_0x46c633,_0x235d['\x78\x74\x57\x70\x49\x4b']={},_0x235d['\x4f\x71\x68\x77\x44\x57']=!![];}const _0x3c201f=_0xb3db76[0x397*-0x2+0x22da+0x284*-0xb],_0x2f66ee=_0x2e7ea8+_0x3c201f,_0x238bf1=_0x235d['\x78\x74\x57\x70\x49\x4b'][_0x2f66ee];return!_0x238bf1?(_0x235d['\x77\x77\x53\x5a\x72\x75']===undefined&&(_0x235d['\x77\x77\x53\x5a\x72\x75']=!![]),_0x273a47=_0x235d['\x67\x4b\x58\x78\x54\x4a'](_0x273a47,_0x2fd6c8),_0x235d['\x78\x74\x57\x70\x49\x4b'][_0x2f66ee]=_0x273a47):_0x273a47=_0x238bf1,_0x273a47;}function lastMessageOfRole(_0x2e7ea8,_0x2fd6c8){const _0x43cb2f=_0x235d;for(let _0x273a47=_0x2e7ea8['\x6c\x65\x6e\x67\x74\x68']-(0x1832+-0x2364+0xb33);_0x273a47>=-0xc04+-0x1d*-0x7a+-0x1ce;_0x273a47--){if(_0x43cb2f(0xe6,'\x4a\x67\x21\x28')!==_0x43cb2f(0xe5,'\x4a\x67\x21\x28')){const _0x2aedb4=_0x2e7ea8[_0x273a47];if(_0x2aedb4&&_0x2aedb4[_0x43cb2f(0xf8,'\x73\x72\x29\x75')]===_0x2fd6c8)return _0x2aedb4;}else{for(let _0x3c201f=_0x475f1f[_0x43cb2f(0x109,'\x28\x2a\x21\x58')]-(-0x1955+0xcad+0xca9);_0x3c201f>=0x521*-0x1+0x6e5+-0x4*0x71;_0x3c201f--){const _0x2f66ee=_0x49e0e0[_0x3c201f];if(_0x2f66ee&&_0x2f66ee[_0x43cb2f(0xeb,'\x6a\x76\x53\x29')]===_0x4f27a3)return _0x2f66ee;}return null;}}return null;}function blocksOf(_0x238bf1){const _0x11c43b=_0x235d;if(!_0x238bf1)return[];const _0x46c633=_0x238bf1['\x63\x6f\x6e\x74\x65\x6e\x74'];if(typeof _0x46c633===_0x11c43b(0x100,'\x46\x56\x55\x46'))return[{'\x74\x79\x70\x65':_0x11c43b(0xf2,'\x24\x34\x7a\x35'),'\x74\x65\x78\x74':_0x46c633}];return Array[_0x11c43b(0xe2,'\x35\x63\x7a\x72')](_0x46c633)?_0x46c633:[];}function tailUserText(_0x4a73e8){const _0x156d3b=_0x235d,_0x1fc9e1=_0x4a73e8[_0x4a73e8['\x6c\x65\x6e\x67\x74\x68']-(0x3*0x94b+0x4f8*-0x6+0x7c*0x4)];if(!_0x1fc9e1||_0x1fc9e1[_0x156d3b(0xdf,'\x65\x46\x38\x23')]!==_0x156d3b(0xdd,'\x6c\x34\x4d\x76'))return'';return blocksOf(_0x1fc9e1)[_0x156d3b(0xda,'\x6b\x24\x33\x67')](_0x296563=>_0x296563&&_0x296563[_0x156d3b(0x103,'\x25\x40\x74\x39')]===_0x156d3b(0xfa,'\x74\x7a\x78\x77')&&typeof _0x296563[_0x156d3b(0xe0,'\x78\x48\x46\x4d')]===_0x156d3b(0xee,'\x4d\x67\x23\x6b'))[_0x156d3b(0xf6,'\x35\x63\x7a\x72')](_0x3feeef=>_0x3feeef[_0x156d3b(0xfd,'\x73\x72\x29\x75')])[_0x156d3b(0xf5,'\x25\x40\x74\x39')]('\x0a');}export function extractFeatures(_0x31e18e){const _0x4a4046=_0x235d,_0x2944ac=Array[_0x4a4046(0xf9,'\x69\x4f\x76\x4d')](_0x31e18e?.[_0x4a4046(0x108,'\x25\x40\x74\x39')])?_0x31e18e[_0x4a4046(0x108,'\x25\x40\x74\x39')]:[],_0x5d8f61=lastMessageOfRole(_0x2944ac,_0x4a4046(0x102,'\x51\x45\x6e\x26')+'\x74'),_0x37a13c=blocksOf(_0x5d8f61)['\x66\x69\x6c\x74\x65\x72'](_0x4bf221=>_0x4bf221&&_0x4bf221[_0x4a4046(0xe9,'\x35\x63\x7a\x72')]===_0x4a4046(0x106,'\x69\x4f\x76\x4d'))[_0x4a4046(0xf0,'\x7a\x6e\x6a\x57')],_0x5a6b78=_0x2944ac[_0x2944ac[_0x4a4046(0x10a,'\x49\x4e\x40\x5b')]-(-0x1021+-0x1826+0x2848)],_0x59d07b=!!(_0x5a6b78&&_0x5a6b78[_0x4a4046(0xf8,'\x73\x72\x29\x75')]===_0x4a4046(0xed,'\x59\x51\x30\x32')),_0x48dd5d=blocksOf(_0x5a6b78??null),_0x15f09b=_0x59d07b&&_0x48dd5d['\x6c\x65\x6e\x67\x74\x68']>-0x1dc1+-0x462+-0x3*-0xb61&&_0x48dd5d[_0x4a4046(0xff,'\x4b\x34\x78\x70')](_0xba260e=>_0xba260e&&_0xba260e[_0x4a4046(0xea,'\x28\x2a\x21\x58')]===_0x4a4046(0xfe,'\x74\x7a\x78\x77')+_0x4a4046(0x101,'\x25\x79\x31\x71')),_0x51d4f0=tailUserText(_0x2944ac),_0x2e76ae=_0x51d4f0['\x6c\x65\x6e\x67\x74\x68']>0x13*-0x67+-0x6e0+-0x3*-0x4d7&&PLAN_RE['\x74\x65\x73\x74'](_0x51d4f0),_0x3ec8c3=_0x51d4f0['\x6c\x65\x6e\x67\x74\x68']>-0x9*0x8f+-0x623*-0x4+-0x1385&&!_0x15f09b&&!_0x2e76ae&&_0x51d4f0['\x74\x72\x69\x6d']()[_0x4a4046(0xf0,'\x7a\x6e\x6a\x57')]<=SIMPLE_LOOKUP_MAX_CHARS,_0x3ce9dc=_0x5d8f61?_0x37a13c>-0xe5*0x1e+-0x25*-0xe3+0x1*-0x5f9?'\x54\x6f\x6f\x6c\x55\x73\x65':'\x53\x74\x6f\x70':null;return{'\x6c\x61\x73\x74\x5f\x61\x73\x73\x69\x73\x74\x61\x6e\x74\x5f\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c\x5f\x63\x6f\x75\x6e\x74':_0x37a13c,'\x6c\x61\x73\x74\x5f\x61\x73\x73\x69\x73\x74\x61\x6e\x74\x5f\x68\x61\x64\x5f\x74\x6f\x6f\x6c\x5f\x63\x61\x6c\x6c':_0x37a13c>0x397*-0x2+0x22da+0x284*-0xb,'\x6c\x61\x73\x74\x5f\x75\x73\x65\x72\x5f\x69\x73\x5f\x74\x6f\x6f\x6c\x5f\x72\x65\x73\x75\x6c\x74\x5f\x6f\x6e\x6c\x79':_0x15f09b,'\x75\x73\x65\x72\x5f\x72\x65\x71\x75\x65\x73\x74\x65\x64\x5f\x70\x6c\x61\x6e\x6e\x69\x6e\x67':_0x2e76ae,'\x75\x73\x65\x72\x5f\x73\x69\x6d\x70\x6c\x65\x5f\x6c\x6f\x6f\x6b\x75\x70':_0x3ec8c3,'\x6c\x61\x73\x74\x5f\x61\x73\x73\x69\x73\x74\x61\x6e\x74\x5f\x6f\x75\x74\x70\x75\x74\x5f\x74\x6f\x6b\x65\x6e\x73':0x0,'\x6c\x61\x73\x74\x5f\x61\x73\x73\x69\x73\x74\x61\x6e\x74\x5f\x73\x74\x6f\x70\x5f\x72\x65\x61\x73\x6f\x6e':_0x3ce9dc};}export{PLAN_RE,SIMPLE_LOOKUP_MAX_CHARS};
@@ -1,6 +1 @@
1
- export * from './modelRouter.js';
2
- export * from './features.js';
3
- export * from './cachePassthrough.js';
4
- export * from './messagesRoute.js';
5
- export * from './sseScan.js';
6
- export * from './providerRoutes.js';
1
+ (function(_0x51af98,_0x5dff42){var _0x4b1734=_0x4891,_0x417fe9=_0x51af98();while(!![]){try{var _0x35c2d4=parseInt(_0x4b1734(0x153,'\x61\x79\x61\x46'))/(0x10d4+0x1e08+0x5*-0x95f)*(-parseInt(_0x4b1734(0x158,'\x56\x6e\x30\x4e'))/(0x1476+-0x22db*-0x1+-0x374f))+-parseInt(_0x4b1734(0x14c,'\x78\x46\x7a\x26'))/(0x13bf+-0x1*0x31b+-0x10a1)+parseInt(_0x4b1734(0x146,'\x66\x4b\x73\x6e'))/(-0x9be*0x4+-0x2*-0x269+0x2*0x1115)*(-parseInt(_0x4b1734(0x152,'\x45\x43\x6e\x25'))/(0x370+-0xa08+0x1*0x69d))+parseInt(_0x4b1734(0x14a,'\x53\x41\x28\x4a'))/(-0x5f5*0x1+0x55*0x26+-0x6a3)*(parseInt(_0x4b1734(0x154,'\x42\x74\x26\x50'))/(0x84c+0x1*0x3bb+-0xc00))+parseInt(_0x4b1734(0x14f,'\x59\x76\x29\x45'))/(-0x10*-0x209+0x1c05*0x1+-0x1*0x3c8d)+parseInt(_0x4b1734(0x149,'\x25\x79\x44\x26'))/(0x40d*0x7+-0x1*0x26b6+0x4c*0x23)+-parseInt(_0x4b1734(0x148,'\x6f\x24\x23\x63'))/(0xf8f+-0x1c05+0x50*0x28);if(_0x35c2d4===_0x5dff42)break;else _0x417fe9['push'](_0x417fe9['shift']());}catch(_0x2d2ccc){_0x417fe9['push'](_0x417fe9['shift']());}}}(_0x3c18,0x3b9e+0x4*0xc9e2+0x4f7*-0x15));export*from'\x2e\x2f\x6d\x6f\x64\x65\x6c\x52\x6f\x75\x74\x65\x72\x2e\x6a\x73';export*from'\x2e\x2f\x66\x65\x61\x74\x75\x72\x65\x73\x2e\x6a\x73';function _0x3c18(){var _0x5aa721=['\x57\x36\x57\x7a\x65\x6d\x6f\x41\x70\x30\x4c\x54','\x57\x34\x46\x64\x49\x53\x6b\x77\x57\x35\x31\x6d\x57\x51\x66\x46\x57\x37\x37\x64\x53\x77\x69','\x57\x50\x78\x64\x55\x4b\x46\x64\x4f\x38\x6b\x2b\x79\x73\x6e\x57\x45\x62\x70\x63\x47\x76\x6d','\x68\x53\x6b\x4e\x7a\x53\x6f\x66\x57\x4f\x2f\x63\x47\x71\x4a\x64\x4a\x4a\x39\x33\x57\x50\x46\x63\x52\x6d\x6b\x4f','\x57\x51\x7a\x7a\x6f\x61\x70\x64\x4d\x6d\x6b\x5a\x57\x34\x44\x4b\x6e\x6d\x6b\x73\x57\x34\x7a\x6f\x42\x71','\x57\x4f\x69\x4f\x57\x35\x42\x63\x52\x43\x6b\x7a\x73\x76\x53\x42\x44\x43\x6f\x41\x57\x35\x78\x63\x49\x6d\x6f\x4d','\x57\x36\x48\x74\x72\x53\x6b\x77\x77\x61\x66\x4e\x57\x36\x72\x30\x57\x52\x57\x34\x79\x57','\x57\x37\x48\x56\x6a\x53\x6b\x37\x57\x52\x74\x63\x55\x68\x53','\x78\x38\x6b\x32\x57\x4f\x37\x64\x48\x30\x38\x54\x71\x71','\x57\x37\x43\x52\x64\x43\x6b\x53\x57\x50\x74\x63\x52\x65\x75','\x57\x52\x74\x63\x4e\x38\x6f\x2b\x57\x51\x6e\x37\x57\x35\x47\x36\x64\x47\x2f\x64\x4d\x6d\x6b\x6b\x57\x35\x79','\x6e\x57\x46\x64\x48\x43\x6f\x4d\x57\x37\x37\x63\x52\x53\x6f\x4b','\x42\x6d\x6b\x6a\x57\x51\x46\x64\x4d\x38\x6b\x4e\x57\x4f\x50\x2b\x57\x37\x71\x61\x6d\x58\x4e\x64\x4c\x53\x6f\x33','\x65\x47\x72\x4e\x57\x51\x6e\x78\x78\x6d\x6f\x49','\x57\x35\x33\x64\x47\x47\x74\x63\x54\x53\x6b\x49\x57\x4f\x56\x64\x53\x43\x6b\x38\x57\x36\x78\x64\x50\x47','\x67\x43\x6f\x75\x57\x51\x4b\x5a\x43\x4a\x37\x64\x4f\x73\x6c\x63\x4e\x53\x6b\x39\x57\x35\x53','\x64\x5a\x5a\x64\x4f\x49\x79\x41\x57\x35\x42\x63\x4c\x63\x33\x63\x47\x5a\x44\x53','\x57\x37\x33\x64\x4d\x59\x4a\x64\x56\x53\x6f\x4e\x6e\x48\x33\x64\x52\x6d\x6b\x41\x63\x6d\x6b\x33\x6b\x6d\x6f\x6c','\x57\x36\x72\x4e\x57\x35\x56\x64\x4c\x43\x6f\x4b\x57\x35\x39\x50\x43\x62\x6d\x6a\x6d\x53\x6b\x70\x6a\x71'];_0x3c18=function(){return _0x5aa721;};return _0x3c18();}export*from'\x2e\x2f\x63\x61\x63\x68\x65\x50\x61\x73\x73\x74\x68\x72\x6f\x75\x67\x68\x2e\x6a\x73';function _0x4891(_0x5b0ec6,_0x4b99a1){_0x5b0ec6=_0x5b0ec6-(0x97*0x30+0x229*-0xd+0x1*0x10b);var _0x17568d=_0x3c18();var _0x1404c9=_0x17568d[_0x5b0ec6];if(_0x4891['\x58\x4f\x4c\x44\x73\x50']===undefined){var _0x1c9fb0=function(_0x571c16){var _0x147110='\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';var _0x32d9e0='',_0x25f704='';for(var _0x360afe=-0x1489+0xabd+0x9cc,_0x300c06,_0x135590,_0x5df246=0xa6*-0x3+0x2*0x1b5+-0x178;_0x135590=_0x571c16['\x63\x68\x61\x72\x41\x74'](_0x5df246++);~_0x135590&&(_0x300c06=_0x360afe%(0x2*0x108f+0x259c+-0x46b6)?_0x300c06*(-0x20b3+0x2047+0xac)+_0x135590:_0x135590,_0x360afe++%(0x814+0xea1+-0x1*0x16b1))?_0x32d9e0+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](-0x1*-0x21c7+0x143a+-0x3502&_0x300c06>>(-(-0x92f+0x4*-0x958+0x2e91)*_0x360afe&-0x10*-0xc2+0x1be1+-0x27fb)):-0x2086+-0x1d7+0x225d){_0x135590=_0x147110['\x69\x6e\x64\x65\x78\x4f\x66'](_0x135590);}for(var _0x232280=0xe71*0x2+-0x295*0x1+0x1*-0x1a4d,_0x4e7b6b=_0x32d9e0['\x6c\x65\x6e\x67\x74\x68'];_0x232280<_0x4e7b6b;_0x232280++){_0x25f704+='\x25'+('\x30\x30'+_0x32d9e0['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x232280)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](-0x1432+-0x230e+-0x78*-0x76))['\x73\x6c\x69\x63\x65'](-(-0x125d+0x822+0xa3d));}return decodeURIComponent(_0x25f704);};var _0xb5aa10=function(_0x8841d6,_0x5c8cb4){var _0x2a0f92=[],_0x3c0ce6=0x20bf+0x85b+-0x291a,_0x26c44b,_0x46e8df='';_0x8841d6=_0x1c9fb0(_0x8841d6);var _0x46ebaa;for(_0x46ebaa=-0x173a+0x14f7*-0x1+0x2c31;_0x46ebaa<0x1a*-0x11+-0x145*-0x14+-0x78e*0x3;_0x46ebaa++){_0x2a0f92[_0x46ebaa]=_0x46ebaa;}for(_0x46ebaa=-0x8d5+0x13bf+-0x1*0xaea;_0x46ebaa<0xe5*-0x8+-0x26f8+-0x3a*-0xd0;_0x46ebaa++){_0x3c0ce6=(_0x3c0ce6+_0x2a0f92[_0x46ebaa]+_0x5c8cb4['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x46ebaa%_0x5c8cb4['\x6c\x65\x6e\x67\x74\x68']))%(-0x1*-0x38b+0x105d+-0x12e8),_0x26c44b=_0x2a0f92[_0x46ebaa],_0x2a0f92[_0x46ebaa]=_0x2a0f92[_0x3c0ce6],_0x2a0f92[_0x3c0ce6]=_0x26c44b;}_0x46ebaa=0xb5d+0xc86*0x1+-0x17e3,_0x3c0ce6=0x226+0x3*0x6cf+-0x1693;for(var _0x47355b=0x3a8+0x10f*0x2+-0x2*0x2e3;_0x47355b<_0x8841d6['\x6c\x65\x6e\x67\x74\x68'];_0x47355b++){_0x46ebaa=(_0x46ebaa+(-0x1*-0xc71+-0x236e*-0x1+0x17ef*-0x2))%(0x3b*0x2b+-0xfa*0x5+-0x407),_0x3c0ce6=(_0x3c0ce6+_0x2a0f92[_0x46ebaa])%(0x1*-0x10c5+-0x1*-0x623+0x2*0x5d1),_0x26c44b=_0x2a0f92[_0x46ebaa],_0x2a0f92[_0x46ebaa]=_0x2a0f92[_0x3c0ce6],_0x2a0f92[_0x3c0ce6]=_0x26c44b,_0x46e8df+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](_0x8841d6['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x47355b)^_0x2a0f92[(_0x2a0f92[_0x46ebaa]+_0x2a0f92[_0x3c0ce6])%(0x1cbc*0x1+-0x1eb9*-0x1+-0x3a75)]);}return _0x46e8df;};_0x4891['\x6f\x74\x6e\x64\x4d\x61']=_0xb5aa10,_0x4891['\x75\x73\x79\x62\x50\x52']={},_0x4891['\x58\x4f\x4c\x44\x73\x50']=!![];}var _0x529ff2=_0x17568d[0x1719+0xd6d+0x11*-0x226],_0x7da2d=_0x5b0ec6+_0x529ff2,_0x43d49f=_0x4891['\x75\x73\x79\x62\x50\x52'][_0x7da2d];return!_0x43d49f?(_0x4891['\x69\x45\x51\x7a\x64\x43']===undefined&&(_0x4891['\x69\x45\x51\x7a\x64\x43']=!![]),_0x1404c9=_0x4891['\x6f\x74\x6e\x64\x4d\x61'](_0x1404c9,_0x4b99a1),_0x4891['\x75\x73\x79\x62\x50\x52'][_0x7da2d]=_0x1404c9):_0x1404c9=_0x43d49f,_0x1404c9;}export*from'\x2e\x2f\x6d\x65\x73\x73\x61\x67\x65\x73\x52\x6f\x75\x74\x65\x2e\x6a\x73';export*from'\x2e\x2f\x73\x73\x65\x53\x63\x61\x6e\x2e\x6a\x73';export*from'\x2e\x2f\x70\x72\x6f\x76\x69\x64\x65\x72\x52\x6f\x75\x74\x65\x73\x2e\x6a\x73';