trimprompt 1.0.43 → 1.0.44
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/cache-manager.js +1 -1
- package/cache.js +1 -1
- package/ccr.js +1 -1
- package/cli.js +1 -1
- package/dashboard.js +1 -1
- package/executor.js +1 -1
- package/file-watcher.js +1 -1
- package/filters/devops.js +1 -1
- package/filters/generic.js +1 -1
- package/filters/git.js +1 -1
- package/filters/go.js +1 -1
- package/filters/index.js +1 -1
- package/filters/js.js +1 -1
- package/filters/python.js +1 -1
- package/filters/rust.js +1 -1
- package/filters/shell.js +1 -1
- package/hooks/claude-hook.js +1 -1
- package/mcp.js +1 -1
- package/package.json +1 -1
- package/postinstall.js +25 -1
- package/proxy-conv.js +1 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
package/mcp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';const a0_0xccdc27=a0_0x1d3f;(function(_0x35b3cd,_0x4b9543){const _0x566746=a0_0x1d3f,_0xfa1b07=_0x35b3cd();while(!![]){try{const _0x2287e6=-parseInt(_0x566746(0x11b))/0x1+parseInt(_0x566746(0x116))/0x2+parseInt(_0x566746(0xf8))/0x3*(-parseInt(_0x566746(0x103))/0x4)+parseInt(_0x566746(0x132))/0x5+-parseInt(_0x566746(0x11a))/0x6+-parseInt(_0x566746(0x10e))/0x7+-parseInt(_0x566746(0xf1))/0x8*(-parseInt(_0x566746(0xf4))/0x9);if(_0x2287e6===_0x4b9543)break;else _0xfa1b07['push'](_0xfa1b07['shift']());}catch(_0x2e1189){_0xfa1b07['push'](_0xfa1b07['shift']());}}}(a0_0xb616,0x2e05d));function a0_0xb616(){const _0x3ece6e=['readline','line','781940LkYhCL','create','./proxy-conv','savedTokens','1636600UMiKoa','content','logExecution','27ZSqcyK','redaction_enabled','./filters','complexity','3acZAiO','exit','proxy:conv-compress','\x20messages\x20(','max_tokens','isArray','type','__esModule','tracker','parse','[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20','947384jFPspk','getOwnPropertyNames','params','length','pipe','\x20tokens\x20saved)','trim','__importStar','compressConversation','stdin','hasOwnProperty','268611SFjyyO','string','mcp\x20tool\x20(id:\x20','proxy:resp-optimize','write','jsonrpc','__setModuleDefault','text','189972rriroa','configurable','createInterface','2.0','1983636XVJfZI','70765mcRxwI','stringify','getOwnPropertyDescriptor','error','call','resp_optimize','\x20trimmed,\x20~','mcp-tool-call','messages','inherit','./tracker','max_tokens:\x20','conv_compress','default','result','method','__createBinding','close','./proxy-resp','optimizeMaxTokens','stdout'];a0_0xb616=function(){return _0x3ece6e;};return a0_0xb616();}var __createBinding=this&&this[a0_0xccdc27(0x12b)]||(Object['create']?function(_0x64bd35,_0xa70bc2,_0x4740e9,_0x40b7e1){const _0x5ca302=a0_0xccdc27;if(_0x40b7e1===undefined)_0x40b7e1=_0x4740e9;var _0x44288e=Object[_0x5ca302(0x11d)](_0xa70bc2,_0x4740e9);(!_0x44288e||('get'in _0x44288e?!_0xa70bc2[_0x5ca302(0xff)]:_0x44288e['writable']||_0x44288e[_0x5ca302(0x117)]))&&(_0x44288e={'enumerable':!![],'get':function(){return _0xa70bc2[_0x4740e9];}}),Object['defineProperty'](_0x64bd35,_0x40b7e1,_0x44288e);}:function(_0x912a58,_0x3b63dc,_0x1c44d8,_0x5b3790){if(_0x5b3790===undefined)_0x5b3790=_0x1c44d8;_0x912a58[_0x5b3790]=_0x3b63dc[_0x1c44d8];}),__setModuleDefault=this&&this[a0_0xccdc27(0x114)]||(Object[a0_0xccdc27(0x133)]?function(_0x115360,_0x5e5093){Object['defineProperty'](_0x115360,'default',{'enumerable':!![],'value':_0x5e5093});}:function(_0x419a1d,_0xc1fa4f){_0x419a1d['default']=_0xc1fa4f;}),__importStar=this&&this[a0_0xccdc27(0x10a)]||(function(){var _0x26c7ff=function(_0x5545ef){const _0x146d39=a0_0x1d3f;return _0x26c7ff=Object[_0x146d39(0x104)]||function(_0xa07a2d){const _0x2ebd4b=_0x146d39;var _0x5ec8c7=[];for(var _0x269204 in _0xa07a2d)if(Object['prototype'][_0x2ebd4b(0x10d)][_0x2ebd4b(0x11f)](_0xa07a2d,_0x269204))_0x5ec8c7[_0x5ec8c7[_0x2ebd4b(0x106)]]=_0x269204;return _0x5ec8c7;},_0x26c7ff(_0x5545ef);};return function(_0x1cfe73){const _0x562afa=a0_0x1d3f;if(_0x1cfe73&&_0x1cfe73[_0x562afa(0xff)])return _0x1cfe73;var _0x3cffc9={};if(_0x1cfe73!=null){for(var _0x5d67f6=_0x26c7ff(_0x1cfe73),_0x457aac=0x0;_0x457aac<_0x5d67f6[_0x562afa(0x106)];_0x457aac++)if(_0x5d67f6[_0x457aac]!=='default')__createBinding(_0x3cffc9,_0x1cfe73,_0x5d67f6[_0x457aac]);}return __setModuleDefault(_0x3cffc9,_0x1cfe73),_0x3cffc9;};}());Object['defineProperty'](exports,a0_0xccdc27(0xff),{'value':!![]}),exports['runMcpProxy']=runMcpProxy;const child_process_1=require('child_process'),readline=__importStar(require(a0_0xccdc27(0x130))),filters_1=require(a0_0xccdc27(0xf6)),tracker_1=require(a0_0xccdc27(0x125)),proxy_conv_1=require(a0_0xccdc27(0x134)),proxy_resp_1=require(a0_0xccdc27(0x12d));function a0_0x1d3f(_0x100e3e,_0x4f3a4f){_0x100e3e=_0x100e3e-0xf1;const _0xb61681=a0_0xb616();let _0x1d3fe3=_0xb61681[_0x100e3e];return _0x1d3fe3;}function runMcpProxy(_0x2b8636,_0x1ec0bd){const _0xac951c=a0_0xccdc27,_0x37b743=(0x0,child_process_1['spawn'])(_0x2b8636,_0x1ec0bd,{'stdio':[_0xac951c(0x107),_0xac951c(0x107),_0xac951c(0x124)]}),_0x3694b9=tracker_1[_0xac951c(0x100)]['getConfig'](),_0x31d203=_0x3694b9['features_enabled']||{},_0x262004=_0x31d203[_0xac951c(0x127)]!==![],_0x346df5=_0x31d203[_0xac951c(0x120)]!==![],_0x11e4d8=readline[_0xac951c(0x118)]({'input':process[_0xac951c(0x10c)],'terminal':![]});_0x11e4d8['on'](_0xac951c(0x131),_0x814b86=>{const _0x2260fc=_0xac951c;try{const _0x2a4003=JSON['parse'](_0x814b86);if(_0x2a4003&&_0x2a4003[_0x2260fc(0x113)]===_0x2260fc(0x119)&&_0x2a4003[_0x2260fc(0x12a)]&&_0x2a4003[_0x2260fc(0x105)]){const _0x42a802=_0x2a4003[_0x2260fc(0x105)];if(Array[_0x2260fc(0xfd)](_0x42a802[_0x2260fc(0x123)])&&_0x42a802[_0x2260fc(0x123)]['length']>0x0){if(_0x262004){const _0x2dfce4=(0x0,proxy_conv_1[_0x2260fc(0x10b)])(_0x42a802[_0x2260fc(0x123)]);(_0x2dfce4['trimmedCount']>0x0||_0x2dfce4[_0x2260fc(0x135)]>0x0)&&(_0x42a802[_0x2260fc(0x123)]=_0x2dfce4[_0x2260fc(0x123)],tracker_1[_0x2260fc(0x100)][_0x2260fc(0xf3)](_0x2260fc(0xfa),_0x2dfce4['trimmedCount']+_0x2dfce4[_0x2260fc(0x123)][_0x2260fc(0x106)]+'\x20messages',_0x2dfce4['messages'][_0x2260fc(0x106)]+_0x2260fc(0xfb)+_0x2dfce4['trimmedCount']+_0x2260fc(0x121)+_0x2dfce4[_0x2260fc(0x135)]+_0x2260fc(0x108),0x0,undefined,[_0x2260fc(0x127)]));}if(_0x346df5){const _0x7f631c=(0x0,proxy_resp_1[_0x2260fc(0x12e)])(_0x42a802['messages'],_0x42a802[_0x2260fc(0xfc)]);if(_0x7f631c){const _0x5e6e41=_0x42a802[_0x2260fc(0xfc)]||_0x2260fc(0x128);_0x42a802[_0x2260fc(0xfc)]=_0x7f631c[_0x2260fc(0xfc)],tracker_1[_0x2260fc(0x100)][_0x2260fc(0xf3)](_0x2260fc(0x111),'max_tokens:\x20'+_0x5e6e41,_0x2260fc(0x126)+_0x7f631c['max_tokens']+'\x20('+_0x7f631c[_0x2260fc(0xf7)]+')',0x0,undefined,[_0x2260fc(0x120)]);}}}_0x37b743[_0x2260fc(0x10c)][_0x2260fc(0x112)](JSON[_0x2260fc(0x11c)](_0x2a4003)+'\x0a');}else _0x37b743[_0x2260fc(0x10c)][_0x2260fc(0x112)](_0x814b86+'\x0a');}catch{_0x37b743[_0x2260fc(0x10c)]['write'](_0x814b86+'\x0a');}}),_0x11e4d8['on'](_0xac951c(0x12c),()=>{const _0x3e19fc=_0xac951c;try{_0x37b743[_0x3e19fc(0x10c)]['end']();}catch{}});const _0x132559=readline[_0xac951c(0x118)]({'input':_0x37b743['stdout'],'terminal':![]});_0x132559['on'](_0xac951c(0x131),_0x3efe7f=>{const _0x1748bb=_0xac951c;try{const _0x447321=JSON[_0x1748bb(0x101)](_0x3efe7f);if(_0x447321&&_0x447321[_0x1748bb(0x113)]===_0x1748bb(0x119)&&_0x447321['id']!==undefined&&_0x447321[_0x1748bb(0x129)]&&Array['isArray'](_0x447321['result']['content'])){let _0x246117=![];for(const _0x2c19b3 of _0x447321[_0x1748bb(0x129)][_0x1748bb(0xf2)]){if(_0x2c19b3[_0x1748bb(0xfe)]==='text'&&typeof _0x2c19b3[_0x1748bb(0x115)]===_0x1748bb(0x10f)&&_0x2c19b3['text'][_0x1748bb(0x109)]()[_0x1748bb(0x106)]>0x0){const _0x99178a=_0x2c19b3[_0x1748bb(0x115)],_0x4e8698=(0x0,filters_1['compressOutput'])(_0x1748bb(0x122),_0x99178a,'',tracker_1[_0x1748bb(0x100)]['getConfig']()[_0x1748bb(0xf5)]);tracker_1[_0x1748bb(0x100)][_0x1748bb(0xf3)](_0x1748bb(0x110)+_0x447321['id']+')',_0x99178a,_0x4e8698,0x0),_0x2c19b3[_0x1748bb(0x115)]=_0x4e8698,_0x246117=!![];}}_0x246117?process[_0x1748bb(0x12f)][_0x1748bb(0x112)](JSON[_0x1748bb(0x11c)](_0x447321)+'\x0a'):process[_0x1748bb(0x12f)]['write'](_0x3efe7f+'\x0a');}else process[_0x1748bb(0x12f)][_0x1748bb(0x112)](_0x3efe7f+'\x0a');}catch{process[_0x1748bb(0x12f)][_0x1748bb(0x112)](_0x3efe7f+'\x0a');}}),_0x37b743['on']('close',_0x21d6df=>{process['exit'](_0x21d6df||0x0);}),_0x37b743['on'](_0xac951c(0x11e),_0x2c5b94=>{const _0x1e5ef7=_0xac951c;console[_0x1e5ef7(0x11e)](_0x1e5ef7(0x102)+_0x2c5b94['message']),process[_0x1e5ef7(0xf9)](0x1);});}
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -19,7 +19,31 @@ try {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
try {
|
|
22
|
-
|
|
22
|
+
if (process.platform === 'win32') {
|
|
23
|
+
const text = `──────────────────────────────────────────────────────────
|
|
24
|
+
✂ TrimPrompt is installed — you're saving tokens!
|
|
25
|
+
──────────────────────────────────────────────────────────
|
|
26
|
+
|
|
27
|
+
⚠ Restart your terminal once (or your AI editor — Cursor /
|
|
28
|
+
Claude Code) so the optimized commands take effect.
|
|
29
|
+
|
|
30
|
+
Then just work normally. TrimPrompt trims your command
|
|
31
|
+
output automatically in the background — nothing to configure.
|
|
32
|
+
|
|
33
|
+
Try it:
|
|
34
|
+
trim stats → tokens & money you've saved so far
|
|
35
|
+
trim ui → open the live dashboard in your browser`;
|
|
36
|
+
const escapedText = text.replace(/'/g, "''");
|
|
37
|
+
const cmd = `Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.MessageBox]::Show('${escapedText}', 'TrimPrompt')`;
|
|
38
|
+
const child = cp.spawn('powershell', ['-NoProfile', '-Command', cmd], {
|
|
39
|
+
detached: true,
|
|
40
|
+
stdio: 'ignore',
|
|
41
|
+
windowsHide: true
|
|
42
|
+
});
|
|
43
|
+
child.unref();
|
|
44
|
+
} else {
|
|
45
|
+
cp.execSync('node cli.js welcome', { stdio: 'inherit' });
|
|
46
|
+
}
|
|
23
47
|
} catch (e) {
|
|
24
48
|
try {
|
|
25
49
|
fs.appendFileSync(logPath, `[postinstall welcome error] ${e.message}\n`);
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x15747e=a0_0x1a84;(function(_0x46d9b6,_0x45a4c9){const _0x24e2b6=a0_0x1a84,_0x23234e=_0x46d9b6();while(!![]){try{const _0x362c2f=-parseInt(_0x24e2b6(0x203))/0x1+parseInt(_0x24e2b6(0x1ed))/0x2+-parseInt(_0x24e2b6(0x1eb))/0x3+parseInt(_0x24e2b6(0x1f3))/0x4+-parseInt(_0x24e2b6(0x1ff))/0x5+-parseInt(_0x24e2b6(0x1f7))/0x6*(parseInt(_0x24e2b6(0x1e9))/0x7)+parseInt(_0x24e2b6(0x207))/0x8*(parseInt(_0x24e2b6(0x20b))/0x9);if(_0x362c2f===_0x45a4c9)break;else _0x23234e['push'](_0x23234e['shift']());}catch(_0x430600){_0x23234e['push'](_0x23234e['shift']());}}}(a0_0x39ba,0x86387));Object[a0_0x15747e(0x205)](exports,a0_0x15747e(0x1ef),{'value':!![]}),exports[a0_0x15747e(0x202)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x1373b4){const _0x3110cd=a0_0x15747e;return Math[_0x3110cd(0x1fa)](_0x1373b4[_0x3110cd(0x20e)]/0x4);}function blockText(_0x3c583e){const _0x5c2ca6=a0_0x15747e;if(!_0x3c583e||typeof _0x3c583e!==_0x5c2ca6(0x1e8))return'';if(_0x3c583e[_0x5c2ca6(0x1fd)]===_0x5c2ca6(0x1f1)&&typeof _0x3c583e[_0x5c2ca6(0x1f1)]===_0x5c2ca6(0x1f0))return _0x3c583e['text'];if(_0x3c583e[_0x5c2ca6(0x1fd)]===_0x5c2ca6(0x1f4)){if(typeof _0x3c583e[_0x5c2ca6(0x1f2)]===_0x5c2ca6(0x1f0))return _0x3c583e['content'];if(Array[_0x5c2ca6(0x1f8)](_0x3c583e['content']))return _0x3c583e[_0x5c2ca6(0x1f2)][_0x5c2ca6(0x20c)](blockText)[_0x5c2ca6(0x1fe)](Boolean)[_0x5c2ca6(0x1fb)]('\x0a');}return'';}function messageText(_0x1f3290){const _0x244f77=a0_0x15747e;if(typeof _0x1f3290[_0x244f77(0x1f2)]==='string')return _0x1f3290[_0x244f77(0x1f2)];if(Array['isArray'](_0x1f3290[_0x244f77(0x1f2)]))return _0x1f3290[_0x244f77(0x1f2)][_0x244f77(0x20c)](blockText)[_0x244f77(0x1fe)](Boolean)[_0x244f77(0x1fb)]('\x0a');return'';}function summarizeText(_0x2f8d29){const _0x20e142=a0_0x15747e,_0x2f505d=estimateTokens(_0x2f8d29),_0x4d2065=_0x2f8d29[_0x20e142(0x200)]('\x0a');if(_0x2f505d>0x7d0){if(_0x4d2065[_0x20e142(0x20e)]>0xa){const _0x3ed4c1=_0x4d2065[_0x20e142(0x20f)](0x0,0x5)[_0x20e142(0x1fb)]('\x0a'),_0x12e4f0=_0x4d2065[_0x20e142(0x20f)](-0x5)[_0x20e142(0x1fb)]('\x0a');return _0x3ed4c1+'\x0a[...\x20'+(_0x4d2065['length']-0xa)+_0x20e142(0x20a)+_0x12e4f0;}return _0x2f8d29[_0x20e142(0x20f)](0x0,0x7d0)+(_0x20e142(0x1f5)+(_0x2f8d29[_0x20e142(0x20e)]-0x7d0)+_0x20e142(0x1f9));}if(_0x2f505d>0x1f4){if(_0x4d2065[_0x20e142(0x20e)]>0xa)return _0x4d2065[_0x20e142(0x20f)](0x0,0xa)[_0x20e142(0x1fb)]('\x0a')+(_0x20e142(0x1f5)+(_0x4d2065[_0x20e142(0x20e)]-0xa)+_0x20e142(0x20d));return _0x2f8d29[_0x20e142(0x20f)](0x0,0x320)+('\x0a[...\x20'+(_0x2f8d29[_0x20e142(0x20e)]-0x320)+_0x20e142(0x1ea));}return _0x2f8d29;}function summarizeBlock(_0x6cea42){const _0x1b0636=a0_0x15747e;if(!_0x6cea42||typeof _0x6cea42!==_0x1b0636(0x1e8))return _0x6cea42;if(_0x6cea42[_0x1b0636(0x1fd)]===_0x1b0636(0x1f1)&&typeof _0x6cea42[_0x1b0636(0x1f1)]===_0x1b0636(0x1f0))return{..._0x6cea42,'text':summarizeText(_0x6cea42[_0x1b0636(0x1f1)])};if(_0x6cea42['type']===_0x1b0636(0x1f4)){if(typeof _0x6cea42['content']==='string')return{..._0x6cea42,'content':summarizeText(_0x6cea42[_0x1b0636(0x1f2)])};if(Array[_0x1b0636(0x1f8)](_0x6cea42[_0x1b0636(0x1f2)])){const _0x30cc2e=largestBlockIndex(_0x6cea42['content']);if(_0x30cc2e>=0x0){const _0x20a972=_0x6cea42[_0x1b0636(0x1f2)]['map']((_0x106541,_0x19930e)=>_0x19930e===_0x30cc2e?summarizeBlock(_0x106541):_0x106541);return{..._0x6cea42,'content':_0x20a972};}}}return _0x6cea42;}function largestBlockIndex(_0xa16ef3){const _0x49ffae=a0_0x15747e;let _0x6d23a4=-0x1,_0x121b4d=-0x1;return _0xa16ef3[_0x49ffae(0x1ec)]((_0xe65694,_0x2609a4)=>{const _0x246fe1=_0x49ffae,_0x59b7cd=blockText(_0xe65694)[_0x246fe1(0x20e)];_0x59b7cd>_0x121b4d&&(_0x121b4d=_0x59b7cd,_0x6d23a4=_0x2609a4);}),_0x121b4d>0x0?_0x6d23a4:-0x1;}function a0_0x1a84(_0x5b9641,_0x135431){_0x5b9641=_0x5b9641-0x1e8;const _0x39ba12=a0_0x39ba();let _0x1a8428=_0x39ba12[_0x5b9641];return _0x1a8428;}function scoreMessage(_0x2abd7c,_0x47a175,_0x205ec6){const _0x268974=a0_0x15747e,_0x178a15=ROLE_WEIGHT[_0x2abd7c[_0x268974(0x206)]]||0.4,_0x27571f=(_0x47a175+0x1)/_0x205ec6,_0x2eb621=messageText(_0x2abd7c),_0x55e4b3=estimateTokens(_0x2eb621),_0x296762=_0x55e4b3>0x7d0?0.6:_0x55e4b3>0x1f4?0.8:0x1;return _0x178a15*(0.3+0.7*_0x27571f)*_0x296762;}function summarizeMessage(_0x704af8){const _0xd064f6=a0_0x15747e,_0x4cba01=estimateTokens(messageText(_0x704af8));if(_0x4cba01<=0x1f4)return _0x704af8;if(typeof _0x704af8['content']===_0xd064f6(0x1f0))return{..._0x704af8,'content':summarizeText(_0x704af8[_0xd064f6(0x1f2)])};if(Array[_0xd064f6(0x1f8)](_0x704af8[_0xd064f6(0x1f2)])){const _0x58b3f1=largestBlockIndex(_0x704af8['content']);if(_0x58b3f1>=0x0){const _0x5ec7a9=_0x704af8[_0xd064f6(0x1f2)][_0xd064f6(0x20c)]((_0x2f55a8,_0x400507)=>_0x400507===_0x58b3f1?summarizeBlock(_0x2f55a8):_0x2f55a8);return{..._0x704af8,'content':_0x5ec7a9};}}return _0x704af8;}function compressConversation(_0x311a71,_0x69790d){const _0x463dbc=a0_0x15747e,_0x42d455={'messages':_0x311a71,'trimmedCount':0x0,'savedTokens':0x0};if(!_0x311a71||!Array[_0x463dbc(0x1f8)](_0x311a71)||_0x311a71[_0x463dbc(0x20e)]<=0x6)return _0x42d455;try{return _compressConversation(_0x311a71,_0x69790d);}catch{return _0x42d455;}}function a0_0x39ba(){const _0x186e43=['13948731orodpL','map','\x20lines\x20trimmed\x20...]','length','slice','indexOf','object','7532wbyFmO','\x20chars\x20trimmed\x20...]','2758533xojirO','forEach','2169680UZWYNZ','system','__esModule','string','text','content','1282452KQtbvm','tool_result','\x0a[...\x20','score','5892LMNJLY','isArray','\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]','ceil','join','reduce','type','filter','1884265IWwUqR','split','tokens','compressConversation','52549CzZdpv','msg','defineProperty','role','8Zqujqj','originalIndex','push','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a'];a0_0x39ba=function(){return _0x186e43;};return a0_0x39ba();}function _compressConversation(_0x1d5a82,_0x55a39b){const _0x4bcb84=a0_0x15747e,_0x233667=_0x55a39b||0x13880,_0x719df2=0x4,_0x905c21=_0x1d5a82['filter'](_0x4c0e02=>_0x4c0e02['role']===_0x4bcb84(0x1ee)),_0x471363=_0x1d5a82[_0x4bcb84(0x1fe)](_0x2f7cf1=>_0x2f7cf1[_0x4bcb84(0x206)]!==_0x4bcb84(0x1ee)),_0x51ffe0=_0x471363[_0x4bcb84(0x20f)](-_0x719df2),_0x477b2e=_0x471363['slice'](0x0,-_0x719df2),_0x8fbaa3=_0x477b2e[_0x4bcb84(0x20c)]((_0x30ea64,_0x1cf41b)=>({'msg':_0x30ea64,'score':scoreMessage(_0x30ea64,_0x1cf41b,_0x477b2e[_0x4bcb84(0x20e)]),'tokens':estimateTokens(messageText(_0x30ea64))})),_0x49ea3f=_0x8fbaa3[_0x4bcb84(0x1fc)]((_0x3e947f,_0x35948b)=>_0x3e947f+_0x35948b['tokens'],0x0),_0x4aa905=_0x51ffe0[_0x4bcb84(0x1fc)]((_0x1efeb7,_0xa30ea6)=>_0x1efeb7+estimateTokens(messageText(_0xa30ea6)),0x0),_0x3a3872=_0x905c21[_0x4bcb84(0x1fc)]((_0x3941ff,_0x4970a0)=>_0x3941ff+estimateTokens(messageText(_0x4970a0)),0x0),_0x32f9ef=_0x233667-_0x4aa905-_0x3a3872;if(_0x49ea3f<=_0x32f9ef){let _0x389eeb=0x0;const _0x2d966f=_0x8fbaa3['map'](_0x5ed4dc=>{const _0x37cf38=_0x4bcb84;if(_0x5ed4dc[_0x37cf38(0x201)]>0x1f4){const _0x14f7b0=summarizeMessage(_0x5ed4dc[_0x37cf38(0x204)]),_0x4532a3=estimateTokens(messageText(_0x14f7b0));if(_0x4532a3<_0x5ed4dc[_0x37cf38(0x201)])return _0x389eeb+=_0x5ed4dc[_0x37cf38(0x201)]-_0x4532a3,_0x14f7b0;}return _0x5ed4dc[_0x37cf38(0x204)];});return{'messages':[..._0x905c21,..._0x2d966f,..._0x51ffe0],'trimmedCount':0x0,'savedTokens':_0x389eeb};}_0x8fbaa3['sort']((_0x1257be,_0x14038f)=>_0x14038f[_0x4bcb84(0x1f6)]-_0x1257be['score']);let _0xf74ce2=0x0,_0x40412c=0x0,_0x4313bd=0x0;const _0x16f108=[];for(const _0x1a9083 of _0x8fbaa3){if(_0xf74ce2+_0x1a9083[_0x4bcb84(0x201)]<=_0x32f9ef){if(_0x1a9083[_0x4bcb84(0x201)]>0x3e8){const _0x444f94=summarizeMessage(_0x1a9083['msg']),_0x158268=estimateTokens(messageText(_0x444f94));_0x4313bd+=_0x1a9083[_0x4bcb84(0x201)]-_0x158268,_0xf74ce2+=_0x158268,_0x16f108[_0x4bcb84(0x209)]({'msg':_0x444f94,'originalIndex':_0x477b2e['indexOf'](_0x1a9083[_0x4bcb84(0x204)])});}else _0xf74ce2+=_0x1a9083[_0x4bcb84(0x201)],_0x16f108[_0x4bcb84(0x209)]({'msg':_0x1a9083[_0x4bcb84(0x204)],'originalIndex':_0x477b2e[_0x4bcb84(0x210)](_0x1a9083['msg'])});}else _0x40412c++,_0x4313bd+=_0x1a9083[_0x4bcb84(0x201)];}_0x16f108['sort']((_0x324bdf,_0x33f405)=>_0x324bdf[_0x4bcb84(0x208)]-_0x33f405[_0x4bcb84(0x208)]);const _0x74d155=[..._0x905c21,..._0x16f108[_0x4bcb84(0x20c)](_0x355a58=>_0x355a58[_0x4bcb84(0x204)]),..._0x51ffe0];return{'messages':_0x74d155,'trimmedCount':_0x40412c,'savedTokens':_0x4313bd};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0xf144bd=a0_0x4e2c;(function(_0x3c9694,_0x2a7bdd){const _0x1cee25=a0_0x4e2c,_0x3fba66=_0x3c9694();while(!![]){try{const _0x2d1fe2=-parseInt(_0x1cee25(0xf0))/0x1*(-parseInt(_0x1cee25(0x10b))/0x2)+parseInt(_0x1cee25(0xf5))/0x3*(-parseInt(_0x1cee25(0xf9))/0x4)+-parseInt(_0x1cee25(0xf7))/0x5*(parseInt(_0x1cee25(0x108))/0x6)+-parseInt(_0x1cee25(0x10a))/0x7*(parseInt(_0x1cee25(0xff))/0x8)+-parseInt(_0x1cee25(0xfc))/0x9+-parseInt(_0x1cee25(0xf4))/0xa*(-parseInt(_0x1cee25(0x104))/0xb)+-parseInt(_0x1cee25(0xfe))/0xc*(-parseInt(_0x1cee25(0x101))/0xd);if(_0x2d1fe2===_0x2a7bdd)break;else _0x3fba66['push'](_0x3fba66['shift']());}catch(_0x58f584){_0x3fba66['push'](_0x3fba66['shift']());}}}(a0_0x7033,0x7e07d));Object[a0_0xf144bd(0xfb)](exports,a0_0xf144bd(0x100),{'value':!![]}),exports[a0_0xf144bd(0x106)]=optimizeMaxTokens;function lastUserText(_0x41ed1e){const _0x319048=a0_0xf144bd;for(let _0x14b3d8=_0x41ed1e[_0x319048(0x105)]-0x1;_0x14b3d8>=0x0;_0x14b3d8--){if(_0x41ed1e[_0x14b3d8]['role']==='user'){const _0x4abfc7=_0x41ed1e[_0x14b3d8][_0x319048(0x102)];if(typeof _0x4abfc7===_0x319048(0x109))return _0x4abfc7;if(Array[_0x319048(0xf1)](_0x4abfc7))return _0x4abfc7[_0x319048(0xef)](_0x5c4a2b=>_0x5c4a2b[_0x319048(0xee)]===_0x319048(0x107)&&_0x5c4a2b['text'])[_0x319048(0xfa)](_0xef91a3=>_0xef91a3['text'])[_0x319048(0xf6)]('\x0a');}}return'';}function classifyComplexity(_0x32afd0){const _0x55a6b3=a0_0xf144bd,_0x28f8e6=_0x32afd0[_0x55a6b3(0xfd)](),_0x32729b=_0x28f8e6[_0x55a6b3(0xf8)](/\s+/)['length'],_0x56a64c=[/^(what|where|which|who|when|how many|is |are |does |do |can |has )\S/,/\?$/,/^(show|list|print|get|find|check|look up)/,/^(yes|no|ok|sure|thanks)/];if(_0x32729b<0x14&&_0x56a64c[_0x55a6b3(0xf3)](_0x10a7da=>_0x10a7da[_0x55a6b3(0x10c)](_0x28f8e6)))return _0x55a6b3(0x103);const _0x7114de=[/implement|refactor|rewrite|create .+ (file|module|class|component)/,/step[- ]by[- ]step|multiple|several|all of the/,/write (a |the )?(full|complete|entire)/,/add .+ and .+ and/,/migrate|convert .+ to/];if(_0x32729b>0x50||_0x7114de[_0x55a6b3(0xf3)](_0x4eea93=>_0x4eea93[_0x55a6b3(0x10c)](_0x28f8e6)))return'complex';return _0x55a6b3(0xf2);}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x2fbb02,_0xfa9a97){const _0x30b299=a0_0xf144bd;if(!_0x2fbb02||_0x2fbb02[_0x30b299(0x105)]===0x0)return null;const _0x10a0d7=lastUserText(_0x2fbb02);if(!_0x10a0d7)return null;const _0x5868fd=classifyComplexity(_0x10a0d7),_0x548f7c=MAX_TOKENS_MAP[_0x5868fd];if(_0xfa9a97&&_0xfa9a97<=_0x548f7c)return null;return{'max_tokens':_0x548f7c,'complexity':_0x5868fd};}function a0_0x4e2c(_0x1ab396,_0x4c259a){_0x1ab396=_0x1ab396-0xee;const _0x7033a1=a0_0x7033();let _0x4e2c83=_0x7033a1[_0x1ab396];return _0x4e2c83;}function a0_0x7033(){const _0x150284=['__esModule','31389345TBBZVr','content','simple','22pWxRXF','length','optimizeMaxTokens','text','12EHdJoD','string','14gThJyg','4eGIEzX','test','type','filter','171924xQnVpN','isArray','medium','some','327350GcoymZ','528itFbLT','join','2363770ttYuDK','split','15908prCsbR','map','defineProperty','2984904TGfGiT','toLowerCase','12vzkBiY','1322184UOJSZF'];a0_0x7033=function(){return _0x150284;};return a0_0x7033();}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x2115(_0x416ca7,_0x12699d){_0x416ca7=_0x416ca7-0x7f;const _0x5ed555=a0_0x5ed5();let _0x2115ee=_0x5ed555[_0x416ca7];return _0x2115ee;}const a0_0x53f19b=a0_0x2115;function a0_0x5ed5(){const _0x517ae1=['AWS\x20Access\x20Key','match','[REDACTED_TWILIO_KEY]','db_connection','push','8635649xzCRtv','stripe_key','Basic\x20[REDACTED_AUTH]','686770nAefVk','[REDACTED_JWT]','rules','Bearer\x20Token','GitHub\x20Token','Twilio\x20Key','Anthropic\x20API\x20Key','redactWithAudit','2EakEOx','__esModule','[REDACTED_SENDGRID_KEY]','basic_auth','AWS\x20Secret\x20Key','5121aYiUGu','[REDACTED_AWS_KEY]','4780KDwrdc','GCP\x20Service\x20Account\x20Key','174505qQoSMm','email','IPv4\x20Address\x20(non-local)','private_key','includes','JWT\x20Token','[REDACTED_PRIVATE_KEY]','type','Stripe\x20Key','54JWoLtP','ip_address','redactor','16nkGVkB','[REDACTED_IP]','17979324YIEtzx','sendgrid_key','OpenAI\x20API\x20Key','956172ogCAQm','[REDACTED_SLACK_TOKEN]','jwt','[REDACTED_GITHUB_TOKEN]','text','loadDefaultRules','Email\x20Address','[REDACTED_OPENAI_KEY]','Private\x20Key\x20Block','Basic\x20Auth','[REDACTED_AZURE_CONNECTION]','redact','[REDACTED_STRIPE_KEY]','anthropic_key','openai_key','Slack\x20Token','generic_credential','[REDACTED_DB_CONNECTION]','[REDACTED_EMAIL]','364JkrFhR','Azure\x20Connection\x20String','171KhrWpb','bearer','$1=[REDACTED_CREDENTIAL]','SendGrid\x20Key','Database\x20Connection\x20String','length'];a0_0x5ed5=function(){return _0x517ae1;};return a0_0x5ed5();}(function(_0x4354d6,_0x5e4209){const _0xb2cf1a=a0_0x2115,_0x181093=_0x4354d6();while(!![]){try{const _0x2bb4fa=parseInt(_0xb2cf1a(0xb1))/0x1*(parseInt(_0xb2cf1a(0xa9))/0x2)+-parseInt(_0xb2cf1a(0xb6))/0x3*(parseInt(_0xb2cf1a(0x99))/0x4)+-parseInt(_0xb2cf1a(0xba))/0x5*(-parseInt(_0xb2cf1a(0xc3))/0x6)+-parseInt(_0xb2cf1a(0x86))/0x7*(-parseInt(_0xb2cf1a(0x81))/0x8)+-parseInt(_0xb2cf1a(0x9b))/0x9*(-parseInt(_0xb2cf1a(0xb8))/0xa)+parseInt(_0xb2cf1a(0xa6))/0xb+-parseInt(_0xb2cf1a(0x83))/0xc;if(_0x2bb4fa===_0x5e4209)break;else _0x181093['push'](_0x181093['shift']());}catch(_0x273a0e){_0x181093['push'](_0x181093['shift']());}}}(a0_0x5ed5,0x65386));Object['defineProperty'](exports,a0_0x53f19b(0xb2),{'value':!![]}),exports[a0_0x53f19b(0x80)]=exports['Redactor']=void 0x0;class Redactor{[a0_0x53f19b(0xab)]=[];constructor(){const _0x5e62dd=a0_0x53f19b;this[_0x5e62dd(0x8b)]();}[a0_0x53f19b(0x8b)](){const _0x23023a=a0_0x53f19b;this[_0x23023a(0xab)]=[{'name':_0x23023a(0xa1),'type':'aws_key','regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x23023a(0xb7)},{'name':_0x23023a(0xb5),'type':'aws_secret','regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':'$1=[REDACTED_AWS_SECRET]'},{'name':_0x23023a(0xb9),'type':'gcp_key','regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':'\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22'},{'name':_0x23023a(0x9a),'type':'azure_conn','regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':_0x23023a(0x90)},{'name':_0x23023a(0xaf),'type':_0x23023a(0x93),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':'[REDACTED_ANTHROPIC_KEY]'},{'name':_0x23023a(0x85),'type':_0x23023a(0x94),'regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':_0x23023a(0x8d)},{'name':_0x23023a(0xad),'type':'github_token','regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':_0x23023a(0x89)},{'name':_0x23023a(0x95),'type':'slack_token','regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':_0x23023a(0x87)},{'name':_0x23023a(0xc2),'type':_0x23023a(0xa7),'regex':/\b(sk_live_[A-Za-z0-9]{24,}|sk_test_[A-Za-z0-9]{24,}|rk_live_[A-Za-z0-9]{24,}|rk_test_[A-Za-z0-9]{24,})\b/g,'replacement':_0x23023a(0x92)},{'name':_0x23023a(0xae),'type':'twilio_key','regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x23023a(0xa3)},{'name':_0x23023a(0x9e),'type':_0x23023a(0x84),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x23023a(0xb3)},{'name':_0x23023a(0x8e),'type':_0x23023a(0xbd),'regex':/-----BEGIN\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----[\s\S]*?-----END\s+(RSA|EC|DSA|ED25519|OPENSSH|PGP)?\s*PRIVATE KEY-----/g,'replacement':_0x23023a(0xc0)},{'name':_0x23023a(0xbf),'type':_0x23023a(0x88),'regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x23023a(0xaa)},{'name':_0x23023a(0xac),'type':_0x23023a(0x9c),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':'Bearer\x20[REDACTED_TOKEN]'},{'name':_0x23023a(0x8f),'type':_0x23023a(0xb4),'regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x23023a(0xa8)},{'name':_0x23023a(0x9f),'type':_0x23023a(0xa4),'regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x23023a(0x97)},{'name':'Generic\x20API\x20Key/Secret/Password','type':_0x23023a(0x96),'regex':/(api[_-]?key|secret[_-]?key|password|passwd|auth[_-]?token|private[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)[\s:="']+[A-Za-z0-9_\-./+=]{16,}/gi,'replacement':_0x23023a(0x9d)},{'name':_0x23023a(0xbc),'type':_0x23023a(0x7f),'regex':/\b(?!127\.0\.0\.1|0\.0\.0\.0|255\.255\.255\.0|10\.\d|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)(?:[0-9]{1,3}\.){3}[0-9]{1,3}\b/g,'replacement':_0x23023a(0x82),'alert':![]},{'name':_0x23023a(0x8c),'type':_0x23023a(0xbb),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x23023a(0x98),'alert':![]}];}[a0_0x53f19b(0x91)](_0x2fd448){const _0xe20444=a0_0x53f19b;return this[_0xe20444(0xb0)](_0x2fd448)[_0xe20444(0x8a)];}[a0_0x53f19b(0xb0)](_0x47d514){const _0x2bfbc7=a0_0x53f19b;let _0x285a15=_0x47d514,_0x1246ac=0x0;const _0x42de30=[];for(const _0xd020c7 of this['rules']){const _0x368382=_0x285a15[_0x2bfbc7(0xa2)](_0xd020c7['regex']);_0x368382&&_0x368382[_0x2bfbc7(0xa0)]>0x0&&(_0xd020c7['alert']!==![]&&(_0x1246ac+=_0x368382[_0x2bfbc7(0xa0)],!_0x42de30[_0x2bfbc7(0xbe)](_0xd020c7[_0x2bfbc7(0xc1)])&&_0x42de30[_0x2bfbc7(0xa5)](_0xd020c7['type'])),_0x285a15=_0x285a15['replace'](_0xd020c7['regex'],_0xd020c7['replacement']));}return{'text':_0x285a15,'secretsFound':_0x1246ac,'secretTypes':_0x42de30};}}exports['Redactor']=Redactor,exports[a0_0x53f19b(0x80)]=new Redactor();
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x121238=a0_0x1a0e;(function(_0x4e6b57,_0x1f5b89){const _0x3940fd=a0_0x1a0e,_0x30121d=_0x4e6b57();while(!![]){try{const _0x5de1ab=parseInt(_0x3940fd(0xa2))/0x1*(-parseInt(_0x3940fd(0x9a))/0x2)+parseInt(_0x3940fd(0x96))/0x3+-parseInt(_0x3940fd(0xa6))/0x4+parseInt(_0x3940fd(0xa7))/0x5*(-parseInt(_0x3940fd(0x91))/0x6)+-parseInt(_0x3940fd(0xa5))/0x7*(-parseInt(_0x3940fd(0xae))/0x8)+-parseInt(_0x3940fd(0xa9))/0x9*(parseInt(_0x3940fd(0xa1))/0xa)+parseInt(_0x3940fd(0xb0))/0xb;if(_0x5de1ab===_0x1f5b89)break;else _0x30121d['push'](_0x30121d['shift']());}catch(_0xa9c56b){_0x30121d['push'](_0x30121d['shift']());}}}(a0_0x234a,0xc6d9f));Object[a0_0x121238(0xad)](exports,a0_0x121238(0x94),{'value':!![]});const tracker_1=require('./tracker');function a0_0x1a0e(_0x69b7f8,_0x962511){_0x69b7f8=_0x69b7f8-0x8d;const _0x234a22=a0_0x234a();let _0x1a0eda=_0x234a22[_0x69b7f8];return _0x1a0eda;}console[a0_0x121238(0x9e)](a0_0x121238(0x97)),process.env.TRIMPROMPT_MODEL='claude-3-opus',tracker_1[a0_0x121238(0xa4)][a0_0x121238(0xaa)](a0_0x121238(0x9c),a0_0x121238(0x99)+'[INFO]\x20Building\x20modules...\x0a'+a0_0x121238(0xac)+a0_0x121238(0xab)[a0_0x121238(0x98)](0x190),'[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)',0x0),process.env.TRIMPROMPT_MODEL=a0_0x121238(0x92),tracker_1[a0_0x121238(0xa4)][a0_0x121238(0xaa)](a0_0x121238(0x93),a0_0x121238(0x8e)+a0_0x121238(0x9f)+a0_0x121238(0xa8)+a0_0x121238(0x8d)[a0_0x121238(0x98)](0x12c)+a0_0x121238(0xa3),a0_0x121238(0xaf),0x0),process.env.TRIMPROMPT_MODEL=a0_0x121238(0xb1),tracker_1[a0_0x121238(0xa4)]['logExecution'](a0_0x121238(0x9d),a0_0x121238(0x9b)+'Step\x201/10\x20:\x20FROM\x20node:20\x0a'+a0_0x121238(0x8f)+a0_0x121238(0x95)+a0_0x121238(0x90)[a0_0x121238(0x98)](0x3)+a0_0x121238(0xa0),'docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.',0x0),console[a0_0x121238(0x9e)]('Database\x20successfully\x20seeded!');function a0_0x234a(){const _0x4809c8=['docker\x20build\x20.','log','test_auth.py\x20PASS\x0a','Successfully\x20built\x20image.','736980fdiFCr','1001389QYVUdB','All\x20303\x20tests\x20passed\x20in\x204.22s.','tracker','5019056FkwaEM','4845496RojRUa','529680CswdfV','test_db.py\x20PASS\x0a','171dXGbgG','logExecution','[SUCCESS]\x20Compiled\x20512\x20modules.\x0a','Optimizing\x20assets...\x0a','defineProperty','16MQuTsr','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','42394297zfrFjp','gemini-1-5-pro','test_api.py\x20PASS\x0a','Test\x20suite\x20run\x20starting...\x0a','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','added\x201420\x20packages\x20in\x2014s\x0a','78DIXuhC','gpt-4o','pytest\x20tests/app','__esModule','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a','1549935BAYzfk','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','repeat','Compilation\x20Output:\x0a','2aeFVtb','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','npm\x20run\x20build'];a0_0x234a=function(){return _0x4809c8;};return a0_0x234a();}
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x3b6607=a0_0x597f;(function(_0x2a8fba,_0x48d3b2){const _0x2da389=a0_0x597f,_0x1b71f5=_0x2a8fba();while(!![]){try{const _0x58532c=parseInt(_0x2da389(0x138))/0x1*(-parseInt(_0x2da389(0x137))/0x2)+parseInt(_0x2da389(0x15a))/0x3*(parseInt(_0x2da389(0x12b))/0x4)+-parseInt(_0x2da389(0x14c))/0x5+-parseInt(_0x2da389(0x132))/0x6*(-parseInt(_0x2da389(0x15f))/0x7)+-parseInt(_0x2da389(0x14e))/0x8+-parseInt(_0x2da389(0x143))/0x9+parseInt(_0x2da389(0x139))/0xa;if(_0x58532c===_0x48d3b2)break;else _0x1b71f5['push'](_0x1b71f5['shift']());}catch(_0x45606e){_0x1b71f5['push'](_0x1b71f5['shift']());}}}(a0_0x5e43,0x54efb));function a0_0x5e43(){const _0x3f452b=['diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','./tracker','redis-master-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','npm\x20run\x20lint:\x20✖\x202\x20warnings','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','exitCode','gemini-1-5-flash','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','2575924QDxakN','homedir','join','\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a','__esModule','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','stats.json','3540dmFRTq','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','logExecution','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','10TcFrvp','43200voauym','8126800JMDICa','defineProperty','path','comp','repeat','claude-3-opus','gpt-4o','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x0aindex\x201234..5678\x20100644\x0a---\x20a/src/cli.ts\x0a+++\x20b/src/cli.ts\x0a@@\x20-10,6\x20+10,12\x20@@\x0a+\x20//\x20Added\x20new\x20telemetry\x20features\x0a+\x20console.log(\x22Initializing\x20sync\x20daemon...\x22);\x0a+\x20startSync();\x0a','writeFileSync','.trimprompt','1085706LVnuYw','npm\x20install\x20lodash\x20express\x20uuid\x20react','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','postgres-db-0\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x2012d\x0a','NAME\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20READY\x20\x20\x20STATUS\x20\x20\x20\x20RESTARTS\x20\x20\x20AGE\x0a','gemini-1-5-pro','test\x20tests::test_case_','commit\x20a1b2c3d4e5f6\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2014:00:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20feat:\x20add\x20dynamic\x20token\x20costs\x0a\x0a','trimprompt-sync-324db87d1-p8q2e\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a','2224050pJeKlM','npm\x20run\x20lint','3892944yDNnEZ','tracker','git\x20diff\x20main','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','toISOString','log','commit\x20f6e5d4c3b2a1\x0aAuthor:\x20Developer\x20<dev@trimprompt.ai>\x0aDate:\x20\x20\x20Tue\x20Jun\x2016\x2013:30:00\x202026\x20+0300\x0a\x0a\x20\x20\x20\x20fix:\x20adjust\x20margins\x20on\x20visual\x20graph','random','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','cargo\x20test:\x2045\x20passed,\x200\x20failed.','raw','stringify','3XyHcnC','length','Completed\x203\x20of\x203\x20assets\x20successfully.','Collecting\x20tensorflow\x0a\x20\x20Downloading\x20tensorflow-2.15.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl\x20(475.2\x20MB)\x0a','cargo\x20test','1890QaDCXZ','git\x20log\x20-n\x205','now','gpt-4o-mini','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','utf8'];a0_0x5e43=function(){return _0x3f452b;};return a0_0x5e43();}Object[a0_0x3b6607(0x13a)](exports,a0_0x3b6607(0x12f),{'value':!![]});const tracker_1=require(a0_0x3b6607(0x168));console[a0_0x3b6607(0x153)](a0_0x3b6607(0x130));const models=['claude-3-5-sonnet',a0_0x3b6607(0x13f),a0_0x3b6607(0x162),a0_0x3b6607(0x148),a0_0x3b6607(0x129),a0_0x3b6607(0x13e)],commands=[{'cmd':a0_0x3b6607(0x150),'raw':a0_0x3b6607(0x140)[a0_0x3b6607(0x13d)](0x32),'comp':a0_0x3b6607(0x167),'exitCode':0x0},{'cmd':a0_0x3b6607(0x15e),'raw':a0_0x3b6607(0x151)+a0_0x3b6607(0x149)['repeat'](0x28)+a0_0x3b6607(0x145),'comp':a0_0x3b6607(0x157),'exitCode':0x0},{'cmd':a0_0x3b6607(0x144),'raw':'npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a'+a0_0x3b6607(0x164)+'found\x200\x20vulnerabilities\x0a','comp':a0_0x3b6607(0x16d),'exitCode':0x0},{'cmd':a0_0x3b6607(0x12a),'raw':a0_0x3b6607(0x134)+a0_0x3b6607(0x156)+a0_0x3b6607(0x16c)+a0_0x3b6607(0x15c),'comp':a0_0x3b6607(0x127),'exitCode':0x0},{'cmd':'kubectl\x20get\x20pods\x20-n\x20production','raw':a0_0x3b6607(0x147)+'trimprompt-api-567fdb7d6-x8w9q\x20\x20\x20\x201/1\x20\x20\x20\x20\x20Running\x20\x20\x200\x20\x20\x20\x20\x20\x20\x20\x20\x20\x204d\x0a'+a0_0x3b6607(0x14b)+a0_0x3b6607(0x169)+a0_0x3b6607(0x146),'comp':'kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','exitCode':0x0},{'cmd':'pip\x20install\x20tensorflow\x20pandas\x20numpy','raw':a0_0x3b6607(0x15d)+a0_0x3b6607(0x12e)+'Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','comp':a0_0x3b6607(0x133),'exitCode':0x0},{'cmd':a0_0x3b6607(0x160),'raw':a0_0x3b6607(0x14a)+a0_0x3b6607(0x154),'comp':a0_0x3b6607(0x136),'exitCode':0x0},{'cmd':a0_0x3b6607(0x14d),'raw':a0_0x3b6607(0x163)+'src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a'+a0_0x3b6607(0x16a),'comp':a0_0x3b6607(0x16b),'exitCode':0x0}],startTime=Date[a0_0x3b6607(0x161)]()-0x36ee80;function a0_0x597f(_0x1b0e5a,_0x2f675d){_0x1b0e5a=_0x1b0e5a-0x127;const _0x5e43de=a0_0x5e43();let _0x597f93=_0x5e43de[_0x1b0e5a];return _0x597f93;}for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x3b6607(0x15b)]],commandItem=commands[Math['floor'](Math[a0_0x3b6607(0x155)]()*commands[a0_0x3b6607(0x15b)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x3b6607(0x152)](),log=tracker_1['tracker'][a0_0x3b6607(0x135)](commandItem['cmd'],commandItem[a0_0x3b6607(0x158)],commandItem[a0_0x3b6607(0x13c)],commandItem[a0_0x3b6607(0x128)]),logs=tracker_1[a0_0x3b6607(0x14f)]['getLogs']();logs[a0_0x3b6607(0x15b)]>0x0&&(logs[logs[a0_0x3b6607(0x15b)]-0x1]['timestamp']=timestamp,require('fs')[a0_0x3b6607(0x141)](require(a0_0x3b6607(0x13b))[a0_0x3b6607(0x12d)](require('os')[a0_0x3b6607(0x12c)](),a0_0x3b6607(0x142),a0_0x3b6607(0x131)),JSON[a0_0x3b6607(0x159)](logs,null,0x2),a0_0x3b6607(0x166)));}console[a0_0x3b6607(0x153)](a0_0x3b6607(0x165));
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x56b450=a0_0x39bb;function a0_0x39bb(_0xa3ebb7,_0x399536){_0xa3ebb7=_0xa3ebb7-0xdc;const _0x298f89=a0_0x298f();let _0x39bb13=_0x298f89[_0xa3ebb7];return _0x39bb13;}(function(_0x3bed78,_0x44a132){const _0x128b5c=a0_0x39bb,_0x4ff590=_0x3bed78();while(!![]){try{const _0x4a2dc0=parseInt(_0x128b5c(0x136))/0x1*(parseInt(_0x128b5c(0x12d))/0x2)+parseInt(_0x128b5c(0x109))/0x3*(-parseInt(_0x128b5c(0x117))/0x4)+parseInt(_0x128b5c(0x120))/0x5+parseInt(_0x128b5c(0x14e))/0x6+-parseInt(_0x128b5c(0xe6))/0x7*(parseInt(_0x128b5c(0x131))/0x8)+-parseInt(_0x128b5c(0xdf))/0x9+parseInt(_0x128b5c(0xdc))/0xa;if(_0x4a2dc0===_0x44a132)break;else _0x4ff590['push'](_0x4ff590['shift']());}catch(_0x31153a){_0x4ff590['push'](_0x4ff590['shift']());}}}(a0_0x298f,0xe48b8));function a0_0x298f(){const _0x151312=['error','url','getStatsSummary','https','Cursor\x20Small','1507760pGAKhW','install','existsSync','path','telemetry_url','Claude\x203.5\x20Sonnet','timestamp','parse','hostname','3785705MPpjgC','GPT-5.5','filter','getTime','application/json','write','Claude\x20Haiku\x203.5','__setModuleDefault','https:','toString','Gemini\x203.1\x20Flash-Lite','--install','port','197912WXEyOU','search','length','.comp.txt','8tPMHTE','writeFileSync','getOwnPropertyNames','now','Claude\x20Haiku\x204.5','14EFIEvv','total_compressed_tokens','GPT-4.1\x20Nano','last_sync_date','toISOString','utf8','stats.json','POST','Claude\x20Mythos\x205','config.json','.raw.txt','OpenAI\x20o1-mini','crypto','Claude\x20Opus\x204.1\x20(deprecated)','total_raw_tokens','money_saved_usd','join','Claude\x20Opus\x204.8','call','https://','catch','statusCode','Claude\x20Opus\x204.7','__importStar','1148988ZMAjJV','defineProperty','platform','toLowerCase','Claude\x20Fable\x205','Gemini\x203.5\x20Live\x20Translate','http','GPT-4.1\x20Mini','stringify','\x20@\x20','end','ignore','default','argv','22333100fnJKHk','request','create','7647210zZjBnN','readFileSync','./tracker','total_tokens_saved','configurable','true','child_process','11554921jeVWGo','slice','add','anonymous','/api/telemetry','destroy','prototype','indexOf','includes','OpenAI\x20o3-mini','auto','git\x20config\x20user.name','OpenAI\x20o1','unknown','unlinkSync','byteLength','GPT-4o\x20Mini','push','GPT-5.4','hasOwnProperty','userInfo','synced','__esModule','.trimprompt','Claude\x20Sonnet\x204.5','trim','username','pipe','machine','yes','install_identified','timeout','URL','__createBinding','last_sync_time','9TTomjq','Claude\x20Sonnet\x204.6','git\x20config\x20user.email','writable','mkdirSync','Gemini\x203.5\x20Flash','version','size','randomUUID'];a0_0x298f=function(){return _0x151312;};return a0_0x298f();}var __createBinding=this&&this[a0_0x56b450(0x107)]||(Object[a0_0x56b450(0xde)]?function(_0x53cb19,_0x1ab52f,_0x1220d5,_0x49ecec){const _0x462d05=a0_0x56b450;if(_0x49ecec===undefined)_0x49ecec=_0x1220d5;var _0x2a7ce1=Object['getOwnPropertyDescriptor'](_0x1ab52f,_0x1220d5);(!_0x2a7ce1||('get'in _0x2a7ce1?!_0x1ab52f[_0x462d05(0xfc)]:_0x2a7ce1[_0x462d05(0x10c)]||_0x2a7ce1[_0x462d05(0xe3)]))&&(_0x2a7ce1={'enumerable':!![],'get':function(){return _0x1ab52f[_0x1220d5];}}),Object['defineProperty'](_0x53cb19,_0x49ecec,_0x2a7ce1);}:function(_0x32a5dc,_0x1de845,_0x1f0d9b,_0x3a7c65){if(_0x3a7c65===undefined)_0x3a7c65=_0x1f0d9b;_0x32a5dc[_0x3a7c65]=_0x1de845[_0x1f0d9b];}),__setModuleDefault=this&&this[a0_0x56b450(0x127)]||(Object[a0_0x56b450(0xde)]?function(_0xd7c106,_0x18a7a5){const _0x4b5c20=a0_0x56b450;Object[_0x4b5c20(0x14f)](_0xd7c106,_0x4b5c20(0x15a),{'enumerable':!![],'value':_0x18a7a5});}:function(_0xde502a,_0x51a176){const _0x24dda4=a0_0x56b450;_0xde502a[_0x24dda4(0x15a)]=_0x51a176;}),__importStar=this&&this[a0_0x56b450(0x14d)]||(function(){var _0x37c2ef=function(_0x17abe6){const _0x2a3325=a0_0x39bb;return _0x37c2ef=Object[_0x2a3325(0x133)]||function(_0x386ee9){const _0xe24e22=_0x2a3325;var _0x280c2e=[];for(var _0x315768 in _0x386ee9)if(Object[_0xe24e22(0xec)][_0xe24e22(0xf9)][_0xe24e22(0x148)](_0x386ee9,_0x315768))_0x280c2e[_0x280c2e[_0xe24e22(0x12f)]]=_0x315768;return _0x280c2e;},_0x37c2ef(_0x17abe6);};return function(_0x1a7f02){const _0x4cecee=a0_0x39bb;if(_0x1a7f02&&_0x1a7f02[_0x4cecee(0xfc)])return _0x1a7f02;var _0x3d116a={};if(_0x1a7f02!=null){for(var _0x1e0988=_0x37c2ef(_0x1a7f02),_0x518537=0x0;_0x518537<_0x1e0988[_0x4cecee(0x12f)];_0x518537++)if(_0x1e0988[_0x518537]!==_0x4cecee(0x15a))__createBinding(_0x3d116a,_0x1a7f02,_0x1e0988[_0x518537]);}return __setModuleDefault(_0x3d116a,_0x1a7f02),_0x3d116a;};}());Object[a0_0x56b450(0x14f)](exports,a0_0x56b450(0xfc),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x56b450(0x11a))),os=__importStar(require('os')),http=__importStar(require(a0_0x56b450(0x154))),https=__importStar(require(a0_0x56b450(0x115))),url_1=require(a0_0x56b450(0x113)),_cfg=[a0_0x56b450(0x149),'trimp-production','.up.railway.app',a0_0x56b450(0xea)][a0_0x56b450(0x146)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x484b7f=a0_0x56b450;try{if(!fs[_0x484b7f(0x119)](dailySyncPath))return![];const _0x47860c=JSON[_0x484b7f(0x11e)](fs['readFileSync'](dailySyncPath,_0x484b7f(0x13b)));if(!_0x47860c[_0x484b7f(0x108)])return![];return Date[_0x484b7f(0x134)]()-_0x47860c[_0x484b7f(0x108)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x317eec=a0_0x56b450;try{const _0x35c94c={'last_sync_date':getTodayDate(),'last_sync_time':Date['now']()};fs[_0x317eec(0x132)](dailySyncPath,JSON['stringify'](_0x35c94c,null,0x2),_0x317eec(0x13b));}catch{}}const PRICING={'claude-fable-5':{'name':a0_0x56b450(0x152),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x56b450(0x13e),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x56b450(0x147),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x56b450(0x14c),'input_price_1m':0x5},'claude-opus-4-5':{'name':'Claude\x20Opus\x204.5','input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x56b450(0x143),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x56b450(0x10a),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x56b450(0xfe),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x56b450(0x11c),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x56b450(0x135),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x56b450(0x126),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x56b450(0x121),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x56b450(0xf8),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':'GPT-5.4\x20Mini','input_price_1m':0.75},'gpt-5-4-nano':{'name':'GPT-5.4\x20Nano','input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x56b450(0x155),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x56b450(0x138),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x56b450(0xf6),'input_price_1m':0.15},'o1':{'name':a0_0x56b450(0xf2),'input_price_1m':0xf},'o1-mini':{'name':a0_0x56b450(0x141),'input_price_1m':0x3},'o3-mini':{'name':a0_0x56b450(0xef),'input_price_1m':1.1},'cursor-small':{'name':a0_0x56b450(0x116),'input_price_1m':0.1},'gemini-3-1-pro':{'name':'Gemini\x203.1\x20Pro','input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x56b450(0x10e),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x56b450(0x12a),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x56b450(0x153),'input_price_1m':3.5}},baseDir=path[a0_0x56b450(0x146)](os['homedir'](),a0_0x56b450(0xfd)),configPath=path[a0_0x56b450(0x146)](baseDir,a0_0x56b450(0x13f)),statsPath=path[a0_0x56b450(0x146)](baseDir,a0_0x56b450(0x13c)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function getTodayDate(){const _0x5f373d=a0_0x56b450;return new Date()[_0x5f373d(0x13a)]()['split']('T')[0x0];}function getDeveloperIdentity(){const _0x3b765f=a0_0x56b450;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x474464}=require(_0x3b765f(0xe5)),_0xeb8d43=_0x474464(_0x3b765f(0x10b),{'stdio':['ignore','pipe',_0x3b765f(0x159)],'windowsHide':!![]})[_0x3b765f(0x129)]()[_0x3b765f(0xff)]();if(_0xeb8d43&&_0xeb8d43['includes']('@'))return _0xeb8d43;}catch{}try{const _0xf77572=os['userInfo']()[_0x3b765f(0x100)];if(_0xf77572)return _0xf77572;}catch{}return _0x3b765f(0xe9);}function getDeveloperName(){const _0x28c057=a0_0x56b450;if(process.env.TRIMPROMPT_USER_NAME)return process.env.TRIMPROMPT_USER_NAME;try{const {execSync:_0x1fefb2}=require(_0x28c057(0xe5)),_0x4a7e2e=_0x1fefb2(_0x28c057(0xf1),{'stdio':[_0x28c057(0x159),_0x28c057(0x101),'ignore'],'windowsHide':!![]})[_0x28c057(0x129)]()[_0x28c057(0xff)]();if(_0x4a7e2e)return _0x4a7e2e;}catch{}return _0x28c057(0xf3);}function getOsUser(){const _0x5c685a=a0_0x56b450;try{const _0xbd941f=os[_0x5c685a(0xfa)]()[_0x5c685a(0x100)];if(_0xbd941f)return _0xbd941f;}catch{}return _0x5c685a(0xf3);}function getDeveloperDomain(){const _0x230b82=a0_0x56b450,_0x1ab7bb=getDeveloperIdentity(),_0x15a3d6=_0x1ab7bb[_0x230b82(0xed)]('@');if(_0x15a3d6>=0x0&&_0x15a3d6<_0x1ab7bb['length']-0x1)return _0x1ab7bb[_0x230b82(0xe7)](_0x15a3d6+0x1)[_0x230b82(0x151)]();return _0x230b82(0xf3);}function getMachineName(){const _0x348d0d=a0_0x56b450;try{const _0x3c02b5=os[_0x348d0d(0x11f)]();if(_0x3c02b5)return _0x3c02b5;}catch{}return _0x348d0d(0xf3);}function getCombinedIdentity(){const _0x5999c0=a0_0x56b450,_0x3dbb8f=getOsUser(),_0x4055f5=getDeveloperDomain(),_0x5b1582=getMachineName();let _0x59efd9=_0x4055f5!==_0x5999c0(0xf3)?_0x3dbb8f+_0x5999c0(0x157)+_0x4055f5:_0x3dbb8f;return _0x5b1582!=='unknown'&&_0x5b1582[_0x5999c0(0x151)]()!==_0x3dbb8f[_0x5999c0(0x151)]()&&(_0x59efd9=_0x59efd9+'\x20('+_0x5b1582+')'),_0x59efd9;}function hasAlreadySyncedToday(){const _0xb87c9=a0_0x56b450;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x31980c=JSON[_0xb87c9(0x11e)](fs['readFileSync'](dailySyncPath,_0xb87c9(0x13b)));return _0x31980c[_0xb87c9(0x139)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x554d68=a0_0x56b450;try{const _0x21c82e={'last_sync_date':getTodayDate()};fs[_0x554d68(0x132)](dailySyncPath,JSON[_0x554d68(0x156)](_0x21c82e,null,0x2),_0x554d68(0x13b));}catch{}}function postTelemetry(_0x133879,_0x5447c8){return new Promise(_0x1c7557=>{const _0x13d0e6=a0_0x39bb;try{const _0x4afeca=new url_1[(_0x13d0e6(0x106))](_0x133879),_0x1fcab1=JSON[_0x13d0e6(0x156)](_0x5447c8),_0xd77a44={'hostname':_0x4afeca['hostname'],'port':_0x4afeca[_0x13d0e6(0x12c)]||(_0x4afeca['protocol']===_0x13d0e6(0x128)?0x1bb:0x50),'path':_0x4afeca['pathname']+_0x4afeca[_0x13d0e6(0x12e)],'method':_0x13d0e6(0x13d),'headers':{'Content-Type':_0x13d0e6(0x124),'Content-Length':Buffer[_0x13d0e6(0xf5)](_0x1fcab1)},'timeout':0x1f40},_0x3f062e=_0x4afeca['protocol']===_0x13d0e6(0x128)?https:http,_0x5909e4=_0x3f062e[_0x13d0e6(0xdd)](_0xd77a44,_0x173a66=>{const _0x561578=_0x13d0e6;_0x1c7557(!!(_0x173a66['statusCode']&&_0x173a66[_0x561578(0x14b)]>=0xc8&&_0x173a66['statusCode']<0x12c));});_0x5909e4['on'](_0x13d0e6(0x112),()=>_0x1c7557(![])),_0x5909e4['on'](_0x13d0e6(0x105),()=>{const _0x160501=_0x13d0e6;_0x5909e4[_0x160501(0xeb)](),_0x1c7557(![]);}),_0x5909e4[_0x13d0e6(0x125)](_0x1fcab1),_0x5909e4[_0x13d0e6(0x158)]();}catch{_0x1c7557(![]);}});}function buildDailyPayload(_0x63e17c){const _0x5baacf=a0_0x56b450,_0x319d8b=getTodayDate(),{tracker:_0x256043}=require(_0x5baacf(0xe1)),_0x555fc2=_0x256043?_0x256043[_0x5baacf(0x114)](_0x5baacf(0xf0)):null,_0x1ebd03=new Set();for(const _0x1b223f of _0x63e17c){if(_0x1b223f['model_used'])_0x1ebd03[_0x5baacf(0xe8)](_0x1b223f['model_used']);}if(_0x1ebd03[_0x5baacf(0x110)]===0x0)_0x1ebd03['add']('claude-opus-4-8');const _0x32942e=_0x63e17c[_0x63e17c[_0x5baacf(0x12f)]-0x1];return{'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':'machine','os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x5baacf(0x150)](),'date':_0x319d8b,'executions_count':_0x63e17c[_0x5baacf(0x12f)],'total_raw_tokens':_0x555fc2?_0x555fc2[_0x5baacf(0x144)]:0x0,'total_compressed_tokens':_0x555fc2?_0x555fc2[_0x5baacf(0x137)]:0x0,'total_tokens_saved':_0x555fc2?_0x555fc2[_0x5baacf(0xe2)]:0x0,'total_money_saved_usd':_0x555fc2?_0x555fc2[_0x5baacf(0x145)]:0x0,'models_used':Array['from'](_0x1ebd03),'hotspots':[],'last_seen':_0x32942e?_0x32942e[_0x5baacf(0x11d)]:new Date()['toISOString']()};}function telemetryOptedOut(){const _0x1dc695=a0_0x56b450,_0x205c1e=(process.env.TRIMPROMPT_NO_TELEMETRY||process.env.TRIMPROMPT_DISABLE_TELEMETRY||'')[_0x1dc695(0x151)]();return _0x205c1e==='1'||_0x205c1e===_0x1dc695(0xe4)||_0x205c1e===_0x1dc695(0x103);}function resolveOrgUrl(){const _0x89420d=a0_0x56b450;let _0x97f1db=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x97f1db&&fs[_0x89420d(0x119)](configPath))try{const _0x432c1f=JSON[_0x89420d(0x11e)](fs['readFileSync'](configPath,_0x89420d(0x13b)));_0x97f1db=_0x432c1f[_0x89420d(0x11b)]||'';}catch{}return _0x97f1db[_0x89420d(0xff)]();}function getAnonymousId(){const _0xfa693=a0_0x56b450;try{const _0x5057c6=path[_0xfa693(0x146)](baseDir,'anon_id');if(fs[_0xfa693(0x119)](_0x5057c6)){const _0x35e0ce=fs[_0xfa693(0xe0)](_0x5057c6,'utf8')['trim']();if(_0x35e0ce)return _0x35e0ce;}const _0x422a10=require(_0xfa693(0x142))[_0xfa693(0x111)]();return fs[_0xfa693(0x10d)](baseDir,{'recursive':!![]}),fs['writeFileSync'](_0x5057c6,_0x422a10,_0xfa693(0x13b)),_0x422a10;}catch{return _0xfa693(0xe9);}}async function sendInstallEvent(_0x3b9195){const _0x2b7b9a=a0_0x56b450;if(telemetryOptedOut())return;let _0x1ca289=_0x2b7b9a(0xf3);try{if(fs[_0x2b7b9a(0x119)](configPath)){const _0x10efd0=JSON[_0x2b7b9a(0x11e)](fs['readFileSync'](configPath,'utf8'));if(_0x10efd0[_0x2b7b9a(0x10f)])_0x1ca289=_0x10efd0[_0x2b7b9a(0x10f)];}}catch{}const _0x481226={'event':_0x3b9195?'install_firstrun':_0x2b7b9a(0x118),'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x2b7b9a(0x102),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x2b7b9a(0x150)](),'version':_0x1ca289,'timestamp':new Date()[_0x2b7b9a(0x13a)]()};await postTelemetry(_ep,_0x481226);const _0x30bd89=resolveOrgUrl();_0x30bd89['length']>0x0&&await postTelemetry(_0x30bd89,_0x481226);}async function runSync(){const _0x4ef76a=a0_0x56b450;if(telemetryOptedOut())return;if(!fs[_0x4ef76a(0x119)](statsPath))return;let _0x56be14;try{_0x56be14=JSON[_0x4ef76a(0x11e)](fs['readFileSync'](statsPath,_0x4ef76a(0x13b)));}catch{return;}const _0x2d0907=_0x56be14[_0x4ef76a(0x122)](_0x137994=>!_0x137994[_0x4ef76a(0xfb)]);if(_0x2d0907[_0x4ef76a(0x12f)]===0x0&&hasSyncedRecently())return;const _0x3ac2e3=buildDailyPayload(_0x56be14);await postTelemetry(_ep,_0x3ac2e3);let _0x4aedba=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x4aedba&&fs[_0x4ef76a(0x119)](configPath))try{const _0x58e42e=JSON[_0x4ef76a(0x11e)](fs[_0x4ef76a(0xe0)](configPath,_0x4ef76a(0x13b)));_0x4aedba=_0x58e42e[_0x4ef76a(0x11b)]||'';}catch{}_0x4aedba[_0x4ef76a(0xff)]()[_0x4ef76a(0x12f)]>0x0&&await postTelemetry(_0x4aedba,_0x3ac2e3);for(const _0x379583 of _0x56be14){if(!_0x379583[_0x4ef76a(0xfb)])_0x379583[_0x4ef76a(0xfb)]=!![];}try{fs[_0x4ef76a(0x132)](statsPath,JSON[_0x4ef76a(0x156)](_0x56be14,null,0x2),_0x4ef76a(0x13b));}catch{}markSyncedNow();}function pruneOldLogs(_0x4cb146){const _0x47bb41=a0_0x56b450;try{const _0x13d681=new Date(),_0x40322d=new Date(_0x13d681[_0x47bb41(0x123)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x3d2dd1=[],_0x2bc146=[];for(const _0x1c0798 of _0x4cb146){const _0xb00578=new Date(_0x1c0798[_0x47bb41(0x11d)]);_0xb00578>=_0x40322d?_0x3d2dd1[_0x47bb41(0xf7)](_0x1c0798):_0x2bc146[_0x47bb41(0xf7)](_0x1c0798);}if(_0x2bc146['length']>0x0){const _0x27ad60=path['join'](baseDir,'logs');for(const _0x138876 of _0x2bc146){const _0x168a29=path[_0x47bb41(0x146)](_0x27ad60,_0x138876['id']+_0x47bb41(0x140)),_0x481d53=path[_0x47bb41(0x146)](_0x27ad60,_0x138876['id']+_0x47bb41(0x130));try{if(fs['existsSync'](_0x168a29))fs[_0x47bb41(0xf4)](_0x168a29);if(fs[_0x47bb41(0x119)](_0x481d53))fs[_0x47bb41(0xf4)](_0x481d53);}catch{}}fs[_0x47bb41(0x132)](statsPath,JSON[_0x47bb41(0x156)](_0x3d2dd1,null,0x2),_0x47bb41(0x13b));}}catch{}}let _event=process.env._PS_EVENT||'';if(!_event){if(process[a0_0x56b450(0x15b)][a0_0x56b450(0xee)]('--install-id'))_event=a0_0x56b450(0x104);else{if(process[a0_0x56b450(0x15b)][a0_0x56b450(0xee)](a0_0x56b450(0x12b)))_event='install';}}if(_event===a0_0x56b450(0x118))sendInstallEvent(![])[a0_0x56b450(0x14a)](()=>{});else _event===a0_0x56b450(0x104)?sendInstallEvent(!![])[a0_0x56b450(0x14a)](()=>{}):runSync()[a0_0x56b450(0x14a)](()=>{});
|
|
1
|
+
'use strict';const a0_0x94391a=a0_0x419c;(function(_0x4836f7,_0x50e034){const _0x32035e=a0_0x419c,_0x4a0de1=_0x4836f7();while(!![]){try{const _0x1ad7d8=parseInt(_0x32035e(0x10d))/0x1+parseInt(_0x32035e(0x121))/0x2*(-parseInt(_0x32035e(0x13e))/0x3)+parseInt(_0x32035e(0x146))/0x4*(parseInt(_0x32035e(0x11e))/0x5)+-parseInt(_0x32035e(0x122))/0x6*(parseInt(_0x32035e(0x15c))/0x7)+parseInt(_0x32035e(0x123))/0x8+parseInt(_0x32035e(0x12f))/0x9*(parseInt(_0x32035e(0x148))/0xa)+-parseInt(_0x32035e(0x16b))/0xb*(parseInt(_0x32035e(0x14b))/0xc);if(_0x1ad7d8===_0x50e034)break;else _0x4a0de1['push'](_0x4a0de1['shift']());}catch(_0x57e42d){_0x4a0de1['push'](_0x4a0de1['shift']());}}}(a0_0x86b6,0x8b366));var __createBinding=this&&this['__createBinding']||(Object[a0_0x94391a(0xf4)]?function(_0x3d2464,_0x30d986,_0x41d0d9,_0x239d07){const _0xc4451f=a0_0x94391a;if(_0x239d07===undefined)_0x239d07=_0x41d0d9;var _0x8f3bf3=Object['getOwnPropertyDescriptor'](_0x30d986,_0x41d0d9);(!_0x8f3bf3||('get'in _0x8f3bf3?!_0x30d986[_0xc4451f(0x153)]:_0x8f3bf3[_0xc4451f(0x14d)]||_0x8f3bf3[_0xc4451f(0x136)]))&&(_0x8f3bf3={'enumerable':!![],'get':function(){return _0x30d986[_0x41d0d9];}}),Object['defineProperty'](_0x3d2464,_0x239d07,_0x8f3bf3);}:function(_0x2c6831,_0x233921,_0x6d9166,_0x906c71){if(_0x906c71===undefined)_0x906c71=_0x6d9166;_0x2c6831[_0x906c71]=_0x233921[_0x6d9166];}),__setModuleDefault=this&&this[a0_0x94391a(0x104)]||(Object[a0_0x94391a(0xf4)]?function(_0x4a940f,_0x3050a6){const _0x6d2408=a0_0x94391a;Object[_0x6d2408(0x115)](_0x4a940f,_0x6d2408(0x143),{'enumerable':!![],'value':_0x3050a6});}:function(_0x252bf5,_0x50e80d){const _0xa5bb4e=a0_0x94391a;_0x252bf5[_0xa5bb4e(0x143)]=_0x50e80d;}),__importStar=this&&this[a0_0x94391a(0x131)]||(function(){var _0x207a7d=function(_0x24a89c){const _0x5747e8=a0_0x419c;return _0x207a7d=Object[_0x5747e8(0x141)]||function(_0xf53e4c){const _0x1191da=_0x5747e8;var _0x2a57db=[];for(var _0x1be8a4 in _0xf53e4c)if(Object[_0x1191da(0x154)][_0x1191da(0x152)][_0x1191da(0x167)](_0xf53e4c,_0x1be8a4))_0x2a57db[_0x2a57db[_0x1191da(0x150)]]=_0x1be8a4;return _0x2a57db;},_0x207a7d(_0x24a89c);};return function(_0x3d7636){const _0x167ec9=a0_0x419c;if(_0x3d7636&&_0x3d7636[_0x167ec9(0x153)])return _0x3d7636;var _0x4a60ea={};if(_0x3d7636!=null){for(var _0x40263c=_0x207a7d(_0x3d7636),_0x139801=0x0;_0x139801<_0x40263c[_0x167ec9(0x150)];_0x139801++)if(_0x40263c[_0x139801]!==_0x167ec9(0x143))__createBinding(_0x4a60ea,_0x3d7636,_0x40263c[_0x139801]);}return __setModuleDefault(_0x4a60ea,_0x3d7636),_0x4a60ea;};}());Object[a0_0x94391a(0x115)](exports,a0_0x94391a(0x153),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x94391a(0x102))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require('https')),url_1=require(a0_0x94391a(0x163)),_cfg=[a0_0x94391a(0x140),a0_0x94391a(0x137),a0_0x94391a(0x13c),a0_0x94391a(0xfc)][a0_0x94391a(0x14a)](''),_ep=process.env._PS_EP||_cfg;function a0_0x419c(_0x194430,_0x4a16bb){_0x194430=_0x194430-0xed;const _0x86b678=a0_0x86b6();let _0x419cf4=_0x86b678[_0x194430];return _0x419cf4;}function hasSyncedRecently(){const _0x4e40e9=a0_0x94391a;try{if(!fs[_0x4e40e9(0x159)](dailySyncPath))return![];const _0x12d623=JSON[_0x4e40e9(0x164)](fs[_0x4e40e9(0xf7)](dailySyncPath,'utf8'));if(!_0x12d623['last_sync_time'])return![];return Date[_0x4e40e9(0x111)]()-_0x12d623[_0x4e40e9(0x105)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x43ec0f=a0_0x94391a;try{const _0x764f7a={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x43ec0f(0x111)]()};fs['writeFileSync'](dailySyncPath,JSON[_0x43ec0f(0x12a)](_0x764f7a,null,0x2),_0x43ec0f(0xf1));}catch{}}const PRICING={'claude-fable-5':{'name':a0_0x94391a(0x11f),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x94391a(0xfb),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x94391a(0x14e),'input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x94391a(0x16d),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x94391a(0xef),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x94391a(0x113),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x94391a(0xfa),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x94391a(0x169),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0x94391a(0x114),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x94391a(0x10a),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x94391a(0x135),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x94391a(0x132),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x94391a(0xfe),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x94391a(0x14c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x94391a(0x166),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x94391a(0xee),'input_price_1m':0.15},'o1':{'name':a0_0x94391a(0x112),'input_price_1m':0xf},'o1-mini':{'name':a0_0x94391a(0x13a),'input_price_1m':0x3},'o3-mini':{'name':a0_0x94391a(0xf3),'input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x94391a(0x15b),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x94391a(0x12e),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x94391a(0x145),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x94391a(0x15d),'input_price_1m':3.5}},baseDir=path[a0_0x94391a(0x14a)](os[a0_0x94391a(0x129)](),'.trimprompt'),configPath=path[a0_0x94391a(0x14a)](baseDir,a0_0x94391a(0x13d)),statsPath=path[a0_0x94391a(0x14a)](baseDir,a0_0x94391a(0x16c)),dailySyncPath=path['join'](baseDir,a0_0x94391a(0x12c));function getTodayDate(){const _0x57a887=a0_0x94391a;return new Date()[_0x57a887(0x125)]()[_0x57a887(0x117)]('T')[0x0];}function getDeveloperIdentity(){const _0x5ea724=a0_0x94391a;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x11ac81}=require(_0x5ea724(0x130)),_0x29aeb0=_0x11ac81(_0x5ea724(0x126),{'stdio':[_0x5ea724(0x10b),_0x5ea724(0xf2),_0x5ea724(0x10b)],'windowsHide':!![]})[_0x5ea724(0x15a)]()['trim']();if(_0x29aeb0&&_0x29aeb0[_0x5ea724(0x118)]('@'))return _0x29aeb0;}catch{}try{const _0x51e59b=os['userInfo']()[_0x5ea724(0x11a)];if(_0x51e59b)return _0x51e59b;}catch{}return _0x5ea724(0x149);}function getDeveloperName(){const _0x44fc67=a0_0x94391a;if(process.env.TRIMPROMPT_USER_NAME)return process.env.TRIMPROMPT_USER_NAME;try{const {execSync:_0x5ce298}=require('child_process'),_0x3b059c=_0x5ce298(_0x44fc67(0x160),{'stdio':['ignore',_0x44fc67(0xf2),'ignore'],'windowsHide':!![]})[_0x44fc67(0x15a)]()[_0x44fc67(0x10e)]();if(_0x3b059c)return _0x3b059c;}catch{}return'unknown';}function getOsUser(){const _0x342b8f=a0_0x94391a;try{const _0x42686b=os[_0x342b8f(0x12d)]()[_0x342b8f(0x11a)];if(_0x42686b)return _0x42686b;}catch{}return _0x342b8f(0x119);}function getDeveloperDomain(){const _0x137ed4=a0_0x94391a,_0x57ea86=getDeveloperIdentity(),_0x1dfac7=_0x57ea86[_0x137ed4(0x157)]('@');if(_0x1dfac7>=0x0&&_0x1dfac7<_0x57ea86[_0x137ed4(0x150)]-0x1)return _0x57ea86[_0x137ed4(0xff)](_0x1dfac7+0x1)[_0x137ed4(0x11b)]();return _0x137ed4(0x119);}function getMachineName(){const _0x926166=a0_0x94391a;try{const _0x5c0b79=os[_0x926166(0x106)]();if(_0x5c0b79)return _0x5c0b79;}catch{}return _0x926166(0x119);}function getCombinedIdentity(){const _0x3aa844=a0_0x94391a,_0x5838bf=getOsUser(),_0x496014=getDeveloperDomain(),_0x237485=getMachineName();let _0x512d7a=_0x496014!==_0x3aa844(0x119)?_0x5838bf+_0x3aa844(0x155)+_0x496014:_0x5838bf;return _0x237485!==_0x3aa844(0x119)&&_0x237485[_0x3aa844(0x11b)]()!==_0x5838bf[_0x3aa844(0x11b)]()&&(_0x512d7a=_0x512d7a+'\x20('+_0x237485+')'),_0x512d7a;}function hasAlreadySyncedToday(){const _0x3e9364=a0_0x94391a;try{if(!fs[_0x3e9364(0x159)](dailySyncPath))return![];const _0x1895c4=JSON[_0x3e9364(0x164)](fs[_0x3e9364(0xf7)](dailySyncPath,_0x3e9364(0xf1)));return _0x1895c4[_0x3e9364(0xed)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x92466e=a0_0x94391a;try{const _0x272f53={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x92466e(0x12a)](_0x272f53,null,0x2),'utf8');}catch{}}function postTelemetry(_0x142d34,_0x426e42){return new Promise(_0x48e0c4=>{const _0x40b1af=a0_0x419c;try{const _0x44804b=new url_1['URL'](_0x142d34),_0x5a40d1=JSON[_0x40b1af(0x12a)](_0x426e42),_0x3417ff={'hostname':_0x44804b[_0x40b1af(0x106)],'port':_0x44804b[_0x40b1af(0xf8)]||(_0x44804b[_0x40b1af(0x10c)]==='https:'?0x1bb:0x50),'path':_0x44804b[_0x40b1af(0x128)]+_0x44804b['search'],'method':'POST','headers':{'Content-Type':_0x40b1af(0x161),'Content-Length':Buffer[_0x40b1af(0x158)](_0x5a40d1)},'timeout':0x1f40},_0x5c4d76=_0x44804b[_0x40b1af(0x10c)]===_0x40b1af(0x165)?https:http,_0x524744=_0x5c4d76[_0x40b1af(0x110)](_0x3417ff,_0x5e7b22=>{const _0x504839=_0x40b1af;_0x48e0c4(!!(_0x5e7b22['statusCode']&&_0x5e7b22[_0x504839(0x15e)]>=0xc8&&_0x5e7b22[_0x504839(0x15e)]<0x12c));});_0x524744['on'](_0x40b1af(0x156),()=>_0x48e0c4(![])),_0x524744['on'](_0x40b1af(0x120),()=>{const _0x55c855=_0x40b1af;_0x524744[_0x55c855(0x16a)](),_0x48e0c4(![]);}),_0x524744[_0x40b1af(0x15f)](_0x5a40d1),_0x524744['end']();}catch{_0x48e0c4(![]);}});}function buildDailyPayload(_0x11dde0){const _0x38e7b3=a0_0x94391a,_0x18ce1e=getTodayDate(),{tracker:_0x1f8d6a}=require(_0x38e7b3(0x168)),_0x40cb8a=_0x1f8d6a?_0x1f8d6a[_0x38e7b3(0x109)](_0x38e7b3(0x139)):null,_0x55f019=new Set();for(const _0x317763 of _0x11dde0){if(_0x317763['model_used'])_0x55f019[_0x38e7b3(0x101)](_0x317763[_0x38e7b3(0xfd)]);}if(_0x55f019[_0x38e7b3(0x162)]===0x0)_0x55f019[_0x38e7b3(0x101)](_0x38e7b3(0x107));const _0x8eb35=_0x11dde0[_0x11dde0[_0x38e7b3(0x150)]-0x1];return{'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x38e7b3(0x13f),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x38e7b3(0x11d)](),'date':_0x18ce1e,'executions_count':_0x11dde0[_0x38e7b3(0x150)],'total_raw_tokens':_0x40cb8a?_0x40cb8a[_0x38e7b3(0xf0)]:0x0,'total_compressed_tokens':_0x40cb8a?_0x40cb8a[_0x38e7b3(0xf5)]:0x0,'total_tokens_saved':_0x40cb8a?_0x40cb8a['total_tokens_saved']:0x0,'total_money_saved_usd':_0x40cb8a?_0x40cb8a[_0x38e7b3(0xf6)]:0x0,'models_used':Array['from'](_0x55f019),'hotspots':[],'last_seen':_0x8eb35?_0x8eb35[_0x38e7b3(0x100)]:new Date()['toISOString']()};}function telemetryOptedOut(){const _0x358adc=a0_0x94391a,_0x449fb0=(process.env.TRIMPROMPT_NO_TELEMETRY||process.env.TRIMPROMPT_DISABLE_TELEMETRY||'')[_0x358adc(0x11b)]();return _0x449fb0==='1'||_0x449fb0===_0x358adc(0x144)||_0x449fb0===_0x358adc(0x124);}function resolveOrgUrl(){const _0x4a5f16=a0_0x94391a;let _0x26b39b=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x26b39b&&fs[_0x4a5f16(0x159)](configPath))try{const _0x107957=JSON[_0x4a5f16(0x164)](fs['readFileSync'](configPath,_0x4a5f16(0xf1)));_0x26b39b=_0x107957['telemetry_url']||'';}catch{}return _0x26b39b['trim']();}function getAnonymousId(){const _0x64aab3=a0_0x94391a;try{const _0x114d21=path[_0x64aab3(0x14a)](baseDir,_0x64aab3(0x147));if(fs['existsSync'](_0x114d21)){const _0x48360f=fs[_0x64aab3(0xf7)](_0x114d21,_0x64aab3(0xf1))[_0x64aab3(0x10e)]();if(_0x48360f)return _0x48360f;}const _0x18f8df=require('crypto')[_0x64aab3(0x133)]();return fs['mkdirSync'](baseDir,{'recursive':!![]}),fs[_0x64aab3(0x142)](_0x114d21,_0x18f8df,_0x64aab3(0xf1)),_0x18f8df;}catch{return _0x64aab3(0x149);}}async function sendInstallEvent(_0x37dadc){const _0x15e7be=a0_0x94391a;if(telemetryOptedOut())return;let _0x3ffc0c=_0x15e7be(0x119);try{if(fs[_0x15e7be(0x159)](configPath)){const _0x56b0b3=JSON[_0x15e7be(0x164)](fs['readFileSync'](configPath,_0x15e7be(0xf1)));if(_0x56b0b3[_0x15e7be(0x134)])_0x3ffc0c=_0x56b0b3['version'];}}catch{}const _0x322bd7={'event':_0x37dadc?_0x15e7be(0x16e):_0x15e7be(0x138),'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':'machine','os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x15e7be(0x11d)](),'version':_0x3ffc0c,'timestamp':new Date()['toISOString']()};await postTelemetry(_ep,_0x322bd7);const _0x4c7f5e=resolveOrgUrl();_0x4c7f5e[_0x15e7be(0x150)]>0x0&&await postTelemetry(_0x4c7f5e,_0x322bd7);}async function runSync(){const _0xdaa351=a0_0x94391a;if(telemetryOptedOut())return;if(!fs['existsSync'](statsPath))return;let _0x5f0485;try{_0x5f0485=JSON[_0xdaa351(0x164)](fs[_0xdaa351(0xf7)](statsPath,_0xdaa351(0xf1)));}catch{return;}const _0x2466a9=_0x5f0485[_0xdaa351(0x12b)](_0x551a38=>!_0x551a38['synced']);if(_0x2466a9[_0xdaa351(0x150)]===0x0&&hasSyncedRecently())return;const _0x173887=buildDailyPayload(_0x5f0485);await postTelemetry(_ep,_0x173887);let _0x9d705a=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x9d705a&&fs[_0xdaa351(0x159)](configPath))try{const _0x3a278b=JSON[_0xdaa351(0x164)](fs[_0xdaa351(0xf7)](configPath,_0xdaa351(0xf1)));_0x9d705a=_0x3a278b['telemetry_url']||'';}catch{}_0x9d705a['trim']()[_0xdaa351(0x150)]>0x0&&await postTelemetry(_0x9d705a,_0x173887);for(const _0x258b6e of _0x5f0485){if(!_0x258b6e[_0xdaa351(0x116)])_0x258b6e['synced']=!![];}try{fs[_0xdaa351(0x142)](statsPath,JSON[_0xdaa351(0x12a)](_0x5f0485,null,0x2),_0xdaa351(0xf1));}catch{}markSyncedNow();}function pruneOldLogs(_0x487fef){const _0x16291e=a0_0x94391a;try{const _0x1b1ec1=new Date(),_0x6df1a2=new Date(_0x1b1ec1['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x36bdc7=[],_0x11ae4f=[];for(const _0x17e8df of _0x487fef){const _0x32f9ed=new Date(_0x17e8df['timestamp']);_0x32f9ed>=_0x6df1a2?_0x36bdc7[_0x16291e(0x10f)](_0x17e8df):_0x11ae4f[_0x16291e(0x10f)](_0x17e8df);}if(_0x11ae4f[_0x16291e(0x150)]>0x0){const _0x3579f2=path[_0x16291e(0x14a)](baseDir,_0x16291e(0xf9));for(const _0x222a45 of _0x11ae4f){const _0x594040=path['join'](_0x3579f2,_0x222a45['id']+_0x16291e(0x13b)),_0x394303=path[_0x16291e(0x14a)](_0x3579f2,_0x222a45['id']+'.comp.txt');try{if(fs['existsSync'](_0x594040))fs[_0x16291e(0x108)](_0x594040);if(fs['existsSync'](_0x394303))fs['unlinkSync'](_0x394303);}catch{}}fs['writeFileSync'](statsPath,JSON['stringify'](_0x36bdc7,null,0x2),'utf8');}}catch{}}let _event=process.env._PS_EVENT||'';function a0_0x86b6(){const _0x2becf6=['getStatsSummary','GPT-5.4','ignore','protocol','607863HFhdic','trim','push','request','now','OpenAI\x20o1','Claude\x20Sonnet\x204.6','GPT-5.5','defineProperty','synced','split','includes','unknown','username','toLowerCase','--install','platform','2843585GvpSqL','Claude\x20Fable\x205','timeout','6922jTljuP','126jbiBtV','4797312SFRJnr','yes','toISOString','git\x20config\x20user.email','install_identified','pathname','homedir','stringify','filter','daily_sync.json','userInfo','Gemini\x203.5\x20Flash','10278rCNIPq','child_process','__importStar','GPT-5.4\x20Mini','randomUUID','version','GPT-4o','configurable','trimp-production','install','auto','OpenAI\x20o1-mini','.raw.txt','.up.railway.app','config.json','915JWFsFF','machine','https://','getOwnPropertyNames','writeFileSync','default','true','Gemini\x203.1\x20Flash-Lite','8KRooFP','anon_id','6530dKDvpD','anonymous','join','384EruFfq','GPT-4.1\x20Mini','writable','Claude\x20Opus\x204.8','argv','length','--install-id','hasOwnProperty','__esModule','prototype','\x20@\x20','error','indexOf','byteLength','existsSync','toString','Gemini\x203.1\x20Pro','73836twcRHu','Gemini\x203.5\x20Live\x20Translate','statusCode','write','git\x20config\x20user.name','application/json','size','url','parse','https:','GPT-4.1\x20Nano','call','./tracker','Claude\x20Haiku\x204.5','destroy','427405uyrRxW','stats.json','Claude\x20Opus\x204.5','install_firstrun','last_sync_date','GPT-4o\x20Mini','Claude\x20Opus\x204.1\x20(deprecated)','total_raw_tokens','utf8','pipe','OpenAI\x20o3-mini','create','total_compressed_tokens','money_saved_usd','readFileSync','port','logs','Claude\x20Sonnet\x204.5','Claude\x20Mythos\x205','/api/telemetry','model_used','GPT-5.4\x20Nano','slice','timestamp','add','path','catch','__setModuleDefault','last_sync_time','hostname','claude-opus-4-8','unlinkSync'];a0_0x86b6=function(){return _0x2becf6;};return a0_0x86b6();}if(!_event){if(process[a0_0x94391a(0x14f)][a0_0x94391a(0x118)](a0_0x94391a(0x151)))_event=a0_0x94391a(0x127);else{if(process['argv'][a0_0x94391a(0x118)](a0_0x94391a(0x11c)))_event=a0_0x94391a(0x138);}}if(_event===a0_0x94391a(0x138))sendInstallEvent(![])[a0_0x94391a(0x103)](()=>{});else _event===a0_0x94391a(0x127)?sendInstallEvent(!![])[a0_0x94391a(0x103)](()=>{}):runSync()[a0_0x94391a(0x103)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x394319=a0_0x2c8d;(function(_0x29cfb0,_0x3f9a75){const _0x2a752e=a0_0x2c8d,_0x433550=_0x29cfb0();while(!![]){try{const _0x3e3bca=parseInt(_0x2a752e(0x1fb))/0x1+parseInt(_0x2a752e(0x1cf))/0x2+parseInt(_0x2a752e(0x193))/0x3+parseInt(_0x2a752e(0x172))/0x4*(parseInt(_0x2a752e(0x1f4))/0x5)+-parseInt(_0x2a752e(0x161))/0x6*(-parseInt(_0x2a752e(0x179))/0x7)+-parseInt(_0x2a752e(0x163))/0x8*(-parseInt(_0x2a752e(0x1db))/0x9)+-parseInt(_0x2a752e(0x192))/0xa;if(_0x3e3bca===_0x3f9a75)break;else _0x433550['push'](_0x433550['shift']());}catch(_0x1e11f1){_0x433550['push'](_0x433550['shift']());}}}(a0_0x2411,0x306aa));var __createBinding=this&&this[a0_0x394319(0x1a5)]||(Object[a0_0x394319(0x1e5)]?function(_0x59078d,_0x24e744,_0x45d8e3,_0x411f00){const _0x15b777=a0_0x394319;if(_0x411f00===undefined)_0x411f00=_0x45d8e3;var _0x566261=Object['getOwnPropertyDescriptor'](_0x24e744,_0x45d8e3);(!_0x566261||(_0x15b777(0x183)in _0x566261?!_0x24e744[_0x15b777(0x14b)]:_0x566261[_0x15b777(0x1d2)]||_0x566261[_0x15b777(0x152)]))&&(_0x566261={'enumerable':!![],'get':function(){return _0x24e744[_0x45d8e3];}}),Object[_0x15b777(0x158)](_0x59078d,_0x411f00,_0x566261);}:function(_0x55f554,_0x6d4191,_0x13a377,_0xe5331a){if(_0xe5331a===undefined)_0xe5331a=_0x13a377;_0x55f554[_0xe5331a]=_0x6d4191[_0x13a377];}),__setModuleDefault=this&&this[a0_0x394319(0x1aa)]||(Object[a0_0x394319(0x1e5)]?function(_0x3a4011,_0xda3110){const _0x4f14fd=a0_0x394319;Object[_0x4f14fd(0x158)](_0x3a4011,_0x4f14fd(0x194),{'enumerable':!![],'value':_0xda3110});}:function(_0x2b959f,_0x549365){const _0x44fd07=a0_0x394319;_0x2b959f[_0x44fd07(0x194)]=_0x549365;}),__importStar=this&&this[a0_0x394319(0x1bd)]||(function(){var _0x2b37cc=function(_0x403752){const _0x297272=a0_0x2c8d;return _0x2b37cc=Object[_0x297272(0x1ae)]||function(_0x5f3750){const _0x3ee66d=_0x297272;var _0xeb9a40=[];for(var _0x818968 in _0x5f3750)if(Object[_0x3ee66d(0x1fc)][_0x3ee66d(0x162)]['call'](_0x5f3750,_0x818968))_0xeb9a40[_0xeb9a40[_0x3ee66d(0x19a)]]=_0x818968;return _0xeb9a40;},_0x2b37cc(_0x403752);};return function(_0xef2e4c){const _0x48db48=a0_0x2c8d;if(_0xef2e4c&&_0xef2e4c[_0x48db48(0x14b)])return _0xef2e4c;var _0x32e439={};if(_0xef2e4c!=null){for(var _0x5c7b26=_0x2b37cc(_0xef2e4c),_0x2d5a71=0x0;_0x2d5a71<_0x5c7b26[_0x48db48(0x19a)];_0x2d5a71++)if(_0x5c7b26[_0x2d5a71]!=='default')__createBinding(_0x32e439,_0xef2e4c,_0x5c7b26[_0x2d5a71]);}return __setModuleDefault(_0x32e439,_0xef2e4c),_0x32e439;};}());Object[a0_0x394319(0x158)](exports,a0_0x394319(0x14b),{'value':!![]}),exports[a0_0x394319(0x151)]=exports['Tracker']=exports[a0_0x394319(0x1d6)]=void 0x0,exports[a0_0x394319(0x15b)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x394319(0x14f))),os=__importStar(require('os')),child_process_1=require(a0_0x394319(0x14e));function a0_0x2c8d(_0xd1de82,_0x5a6b09){_0xd1de82=_0xd1de82-0x144;const _0x2411c4=a0_0x2411();let _0x2c8dba=_0x2411c4[_0xd1de82];return _0x2c8dba;}exports[a0_0x394319(0x1d6)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x394319(0x1c0),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x394319(0x16a),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x394319(0x168),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x394319(0x1b6),'input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x394319(0x18b),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x394319(0x1f6),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x394319(0x1e7),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x394319(0x171),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x394319(0x1df),'input_price_1m':0.8},'gpt-5-5':{'name':'GPT-5.5','input_price_1m':0x5},'gpt-5-4':{'name':a0_0x394319(0x17d),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x394319(0x1d9),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x394319(0x1c3),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x394319(0x173),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x394319(0x1b1),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x394319(0x1cd),'input_price_1m':0.15},'o1':{'name':a0_0x394319(0x1c2),'input_price_1m':0xf},'o1-mini':{'name':a0_0x394319(0x175),'input_price_1m':0x3},'o3-mini':{'name':a0_0x394319(0x1d1),'input_price_1m':1.1},'cursor-small':{'name':a0_0x394319(0x1ca),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x394319(0x15e),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x394319(0x19d),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x394319(0x153),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x474d=a0_0x394319,_0x104d86=process.env,_0x2a03c1={'tool':'','model':'claude-sonnet-4-6','modelShort':''};if(_0x104d86['TRIMPROMPT_MODEL']&&exports[_0x474d(0x1d6)][_0x104d86['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x104d86[_0x474d(0x14c)],'modelShort':''};const _0x4a474b=(_0x104d86['AI_AGENT']||'')[_0x474d(0x1e3)]();if(_0x4a474b){if(_0x4a474b[_0x474d(0x16f)](_0x474d(0x190))||_0x4a474b[_0x474d(0x16f)](_0x474d(0x198))){const _0x344b54=_0x104d86[_0x474d(0x1de)]===_0x474d(0x1a1)?_0x474d(0x1e9):'sonnet',_0x4b0add=_0x104d86['CLAUDE_EFFORT']===_0x474d(0x1a1)?_0x474d(0x191):_0x474d(0x1f1);return{'tool':_0x474d(0x1b9),'model':_0x4b0add,'modelShort':_0x344b54};}if(_0x4a474b['includes'](_0x474d(0x187)))return{'tool':_0x474d(0x187),'model':_0x474d(0x1f1),'modelShort':_0x474d(0x1c7)};if(_0x4a474b[_0x474d(0x16f)](_0x474d(0x1b0))||_0x4a474b[_0x474d(0x16f)](_0x474d(0x1fe))){const _0x5b8ba9=_0x104d86[_0x474d(0x1c4)]||'';if(_0x5b8ba9&&exports[_0x474d(0x1d6)][_0x5b8ba9])return{'tool':'copilot','model':_0x5b8ba9,'modelShort':_0x5b8ba9[_0x474d(0x1cb)]('-')[_0x474d(0x1fd)]()||''};return{'tool':_0x474d(0x1fe),'model':'claude-sonnet-4-5','modelShort':_0x474d(0x1c7)};}if(_0x4a474b['includes'](_0x474d(0x18c)))return{'tool':_0x474d(0x18c),'model':_0x474d(0x197),'modelShort':_0x474d(0x19c)};if(_0x4a474b['includes'](_0x474d(0x149)))return{'tool':_0x474d(0x149),'model':_0x474d(0x185),'modelShort':'o3mini'};if(_0x4a474b[_0x474d(0x16f)](_0x474d(0x1f2)))return{'tool':_0x474d(0x1f2),'model':_0x474d(0x1f1),'modelShort':''};if(_0x4a474b[_0x474d(0x16f)](_0x474d(0x182)))return{'tool':_0x474d(0x182),'model':_0x474d(0x1af),'modelShort':'gemini'};if(_0x4a474b[_0x474d(0x16f)](_0x474d(0x1da))||_0x104d86['REPL_ID'])return{'tool':'replit','model':_0x474d(0x1f1),'modelShort':''};return{'tool':_0x4a474b[_0x474d(0x1cb)]('_')[0x0][_0x474d(0x1cb)]('-')[0x0],'model':_0x474d(0x1f1),'modelShort':''};}if(_0x104d86[_0x474d(0x16b)]==='1'||_0x104d86[_0x474d(0x146)]==='1'){const _0x6d8258=_0x104d86[_0x474d(0x1de)]===_0x474d(0x1a1)?_0x474d(0x1e9):_0x474d(0x1c7),_0x383ef0=_0x104d86[_0x474d(0x1de)]===_0x474d(0x1a1)?'claude-opus-4-8':_0x474d(0x1f1);return{'tool':'claude','model':_0x383ef0,'modelShort':_0x6d8258};}if(_0x104d86[_0x474d(0x1c8)]==='1')return{'tool':_0x474d(0x187),'model':_0x474d(0x1f1),'modelShort':'sonnet'};if(_0x104d86[_0x474d(0x157)]==='1')return{'tool':_0x474d(0x18c),'model':_0x474d(0x197),'modelShort':_0x474d(0x19c)};if(_0x104d86['COPILOT_MODEL']||_0x104d86[_0x474d(0x17b)]){const _0x393073=_0x104d86[_0x474d(0x1c4)]||'';if(_0x393073&&exports['PRICING'][_0x393073])return{'tool':_0x474d(0x1fe),'model':_0x393073,'modelShort':_0x393073[_0x474d(0x1cb)]('-')[_0x474d(0x1fd)]()||''};return{'tool':_0x474d(0x1fe),'model':_0x474d(0x1b2),'modelShort':_0x474d(0x1c7)};}if(_0x104d86[_0x474d(0x1d7)]||_0x104d86['REPLIT_ENVIRONMENT'])return{'tool':'replit','model':_0x474d(0x1f1),'modelShort':''};if(_0x104d86['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x474d(0x1f1),'modelShort':''};if(_0x104d86[_0x474d(0x189)])return{'tool':_0x474d(0x156),'model':_0x474d(0x1f1),'modelShort':''};if(_0x104d86[_0x474d(0x15a)]==='1')return{'tool':_0x474d(0x182),'model':_0x474d(0x1af),'modelShort':_0x474d(0x18c)};if(_0x104d86[_0x474d(0x1de)]){const _0x24a956=_0x104d86[_0x474d(0x1de)]===_0x474d(0x1a1)?_0x474d(0x1e9):_0x474d(0x1c7),_0x34146c=_0x104d86['CLAUDE_EFFORT']==='high'?'claude-opus-4-8':_0x474d(0x1f1);return{'tool':'','model':_0x34146c,'modelShort':''};}if(_0x104d86['AIDER_MODEL']&&exports['PRICING'][_0x104d86[_0x474d(0x1ab)]])return{'tool':_0x474d(0x178),'model':_0x104d86[_0x474d(0x1ab)],'modelShort':''};if(_0x104d86[_0x474d(0x1e1)]){const _0x41dc1f=(_0x104d86['PATH']||'')[_0x474d(0x1e3)]();if(_0x41dc1f[_0x474d(0x16f)](_0x474d(0x187)))return{'tool':_0x474d(0x187),'model':_0x474d(0x1f1),'modelShort':_0x474d(0x1c7)};if(_0x41dc1f['includes'](_0x474d(0x1b8)))return{'tool':'windsurf','model':_0x474d(0x1f1),'modelShort':_0x474d(0x1c7)};}const _0x306dbf=process.env.TRIMPROMPT_MODEL||'';if(_0x306dbf&&exports['PRICING'][_0x306dbf])return{'tool':'','model':_0x306dbf,'modelShort':''};return _0x2a03c1;}const MAX_LOGS_PER_TOOL=0x32;let globalLogsMemoryCache=[],globalLogsCacheMtime=-0x1;class Tracker{[a0_0x394319(0x177)];[a0_0x394319(0x1d3)];[a0_0x394319(0x1a6)];['logsDir'];[a0_0x394319(0x1b7)];constructor(){const _0xb3d454=a0_0x394319;this[_0xb3d454(0x177)]=path[_0xb3d454(0x1ba)](os['homedir'](),_0xb3d454(0x16d)),this[_0xb3d454(0x1d3)]=path[_0xb3d454(0x1ba)](this[_0xb3d454(0x177)],_0xb3d454(0x17a)),this[_0xb3d454(0x1a6)]=path[_0xb3d454(0x1ba)](this[_0xb3d454(0x177)],'stats.json'),this[_0xb3d454(0x147)]=path['join'](this['baseDir'],'logs'),this[_0xb3d454(0x14a)]();}[a0_0x394319(0x14a)](){const _0x518a9c=a0_0x394319;!fs[_0x518a9c(0x1ce)](this[_0x518a9c(0x177)])&&fs[_0x518a9c(0x1e2)](this['baseDir'],{'recursive':!![]});!fs[_0x518a9c(0x1ce)](this['logsDir'])&&fs[_0x518a9c(0x1e2)](this[_0x518a9c(0x147)],{'recursive':!![]});const _0x1da1b9={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x518a9c(0x191)};if(fs[_0x518a9c(0x1ce)](this[_0x518a9c(0x1d3)]))try{const _0x23dc71=fs['readFileSync'](this[_0x518a9c(0x1d3)],'utf8');this[_0x518a9c(0x1b7)]={..._0x1da1b9,...JSON[_0x518a9c(0x17c)](_0x23dc71)};}catch(_0x2a21c8){this[_0x518a9c(0x1b7)]=_0x1da1b9;}else this[_0x518a9c(0x1b7)]=_0x1da1b9,this[_0x518a9c(0x166)]();!fs['existsSync'](this[_0x518a9c(0x1a6)])&&fs[_0x518a9c(0x1d8)](this['statsPath'],JSON[_0x518a9c(0x169)]([]),_0x518a9c(0x18a));}['getConfig'](){const _0x4ca39b=a0_0x394319;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x4ca39b(0x199)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x4ca39b(0x1b7)];}[a0_0x394319(0x1ea)](_0x5d538c,_0x3806b3){const _0xffd997=a0_0x394319;this[_0xffd997(0x1b7)][_0x5d538c]=_0x3806b3,this[_0xffd997(0x166)]();}[a0_0x394319(0x166)](){const _0x4aaac3=a0_0x394319;fs['writeFileSync'](this[_0x4aaac3(0x1d3)],JSON['stringify'](this[_0x4aaac3(0x1b7)],null,0x2),_0x4aaac3(0x18a));}[a0_0x394319(0x1a0)](){const _0xf86931=a0_0x394319;try{if(!fs[_0xf86931(0x1ce)](this['statsPath']))return globalLogsMemoryCache;const _0x4f2a0b=fs[_0xf86931(0x188)](this['statsPath'])[_0xf86931(0x1dd)];if(_0x4f2a0b===globalLogsCacheMtime&&globalLogsMemoryCache[_0xf86931(0x19a)]>0x0)return globalLogsMemoryCache;const _0x2a6d9d=fs[_0xf86931(0x1ee)](this[_0xf86931(0x1a6)],_0xf86931(0x18a)),_0xbf85bb=JSON[_0xf86931(0x17c)](_0x2a6d9d);if(Array[_0xf86931(0x1b4)](_0xbf85bb))return globalLogsMemoryCache=_0xbf85bb,globalLogsCacheMtime=_0x4f2a0b,_0xbf85bb;}catch{}return globalLogsMemoryCache;}[a0_0x394319(0x180)](_0xb6879b){const _0x220741=a0_0x394319;globalLogsMemoryCache=_0xb6879b;const _0x30aa8d=this['statsPath']+_0x220741(0x155);try{fs[_0x220741(0x1d8)](_0x30aa8d,JSON['stringify'](_0xb6879b,null,0x2),_0x220741(0x18a)),fs[_0x220741(0x145)](_0x30aa8d,this[_0x220741(0x1a6)]);}catch{try{fs['writeFileSync'](this[_0x220741(0x1a6)],JSON[_0x220741(0x169)](_0xb6879b,null,0x2),_0x220741(0x18a));}catch{}}}['pruneLogsPerTool'](_0x16cbcf){const _0x570069=a0_0x394319,_0x1c5ed9=new Map();for(const _0x2a3d30 of _0x16cbcf){const _0x399198=_0x2a3d30['tool']&&_0x2a3d30[_0x570069(0x1be)][_0x570069(0x1bb)]()||_0x2a3d30[_0x570069(0x1f5)]||_0x570069(0x1b3);let _0x4202c3=_0x1c5ed9[_0x570069(0x183)](_0x399198);!_0x4202c3&&(_0x4202c3=[],_0x1c5ed9[_0x570069(0x1a3)](_0x399198,_0x4202c3)),_0x4202c3[_0x570069(0x159)](_0x2a3d30);}const _0x44facd=new Set();for(const _0x2b2b14 of _0x1c5ed9[_0x570069(0x1dc)]()){const _0x26779b=_0x2b2b14[_0x570069(0x19a)]-MAX_LOGS_PER_TOOL;for(let _0x578b34=0x0;_0x578b34<_0x26779b;_0x578b34++)_0x44facd[_0x570069(0x1c5)](_0x2b2b14[_0x578b34]['id']);}if(_0x44facd[_0x570069(0x1cc)]===0x0)return _0x16cbcf;let _0x10530a={};try{_0x10530a=JSON[_0x570069(0x17c)](fs['readFileSync'](this[_0x570069(0x1d3)],_0x570069(0x18a)))||{};}catch{}const _0x90a7d6=_0x10530a['lifetime_savings']||{'raw_tokens':0x0,'compressed_tokens':0x0,'tokens_saved':0x0};for(const _0x18e245 of _0x16cbcf){if(!_0x44facd[_0x570069(0x18e)](_0x18e245['id']))continue;_0x90a7d6[_0x570069(0x144)]+=_0x18e245[_0x570069(0x174)]||0x0,_0x90a7d6[_0x570069(0x170)]+=_0x18e245[_0x570069(0x165)]||0x0,_0x90a7d6[_0x570069(0x17f)]+=_0x18e245[_0x570069(0x17f)]||0x0;}_0x10530a['lifetime_savings']=_0x90a7d6,this['config']={...this[_0x570069(0x1b7)],..._0x10530a};try{this['saveConfig']();}catch{}for(const _0x580e21 of _0x44facd){try{fs['unlinkSync'](path[_0x570069(0x1ba)](this['logsDir'],_0x580e21+'.raw.txt'));}catch{}try{fs['unlinkSync'](path['join'](this[_0x570069(0x147)],_0x580e21+'.comp.txt'));}catch{}}return _0x16cbcf[_0x570069(0x181)](_0x5e0c48=>!_0x44facd[_0x570069(0x18e)](_0x5e0c48['id']));}[a0_0x394319(0x195)](_0x4f6ee9,_0x482104,_0x5dcf3d,_0x3c8e18,_0x3600c7,_0xf1b9f){const _0x878444=a0_0x394319,_0x255b95=this[_0x878444(0x1a0)](),_0x2a003b=_0x482104[_0x878444(0x19a)],_0x3888d8=_0x5dcf3d[_0x878444(0x19a)],_0xb3d39a=detectSessionTool(),_0x3632e7=_0xb3d39a[_0x878444(0x1ec)],_0x43655e=_0xb3d39a[_0x878444(0x1be)]===_0x878444(0x182)?_0x878444(0x18c):_0xb3d39a['tool'];let _0x2e2c7e=0x0;if(_0x43655e&&!_0x4f6ee9[_0x878444(0x19f)](_0x878444(0x164)))try{const {getLatestSessionFile:_0x22acc8,loadSessionsState:_0x25379f}=require(_0x878444(0x176)),_0x52a42a=_0x22acc8(_0x43655e);if(_0x52a42a&&_0x52a42a[_0x878444(0x1c6)]){const _0x3315ab=_0x25379f();_0x3315ab[_0x52a42a[_0x878444(0x1c6)]]&&(_0x2e2c7e=_0x3315ab[_0x52a42a['fullPath']][_0x878444(0x15c)]||0x0);}}catch{}const _0x50e41d=Math[_0x878444(0x1ef)](_0x2a003b/0x4)+_0x2e2c7e,_0x46ed86=Math[_0x878444(0x1ef)](_0x3888d8/0x4),_0x1480ca=Math[_0x878444(0x154)](0x0,_0x50e41d-_0x46ed86),_0x5345f3=Math[_0x878444(0x1d4)]()[_0x878444(0x1b5)](0x24)[_0x878444(0x1f0)](0x2,0xb);try{const {redactor:_0x43f5cc}=require('./redactor'),_0x1d4405=_0x43f5cc?_0x43f5cc[_0x878444(0x1bc)](_0x482104):_0x482104;fs[_0x878444(0x1d8)](path['join'](this[_0x878444(0x147)],_0x5345f3+_0x878444(0x1e6)),_0x1d4405,_0x878444(0x18a)),fs[_0x878444(0x1d8)](path[_0x878444(0x1ba)](this['logsDir'],_0x5345f3+_0x878444(0x150)),_0x5dcf3d,_0x878444(0x18a));}catch{}let _0x38343c=_0x4f6ee9;if(_0x4f6ee9[_0x878444(0x19f)](_0x878444(0x164))){const _0x2ffbea=_0x4f6ee9[_0x878444(0x1cb)](':')[0x1]||_0x878444(0x1b9),_0x41852b=_0x2ffbea[_0x878444(0x1f9)](0x0)[_0x878444(0x1f3)]()+_0x2ffbea[_0x878444(0x1a2)](0x1);_0x38343c=_0x41852b+'\x20Compaction';}else{if(_0x4f6ee9[_0x878444(0x19f)](_0x878444(0x16c))){const _0x44e5cd=_0x4f6ee9[_0x878444(0x1cb)]('\x20'),_0x658e2e=_0x44e5cd[0x0][_0x878444(0x1cb)](':')[0x1]||'claude',_0x453ad3=_0x658e2e[_0x878444(0x1f9)](0x0)[_0x878444(0x1f3)]()+_0x658e2e['slice'](0x1),_0x4d9565=_0x44e5cd[_0x878444(0x1a2)](0x1)['join']('\x20');_0x38343c=_0x453ad3+_0x878444(0x196)+_0x4d9565;}else{const _0x21fbab=_0x4f6ee9[_0x878444(0x1cb)]('\x20')[0x0]||'unknown';_0x38343c=_0xb3d39a[_0x878444(0x1be)]?_0xb3d39a[_0x878444(0x1eb)]?_0xb3d39a[_0x878444(0x1be)]+'-'+_0xb3d39a['modelShort']+'-'+_0x21fbab:_0xb3d39a[_0x878444(0x1be)]+'-'+_0x21fbab:_0x21fbab;}}const _0x41c7c6={'id':_0x5345f3,'timestamp':new Date()[_0x878444(0x148)](),'command':_0x38343c,'raw_chars':_0x2a003b,'compressed_chars':_0x3888d8,'estimated_raw_tokens':_0x50e41d,'estimated_compressed_tokens':_0x46ed86,'tokens_saved':_0x1480ca,'model_used':_0x3632e7,'tool':_0x43655e||_0xb3d39a[_0x878444(0x1be)]||'','exit_code':_0x3c8e18,'synced':![],'ai_detected':!!_0xb3d39a[_0x878444(0x1be)],'secrets_found':_0x3600c7?.[_0x878444(0x18f)]||0x0,'secret_types':_0x3600c7?.[_0x878444(0x1d0)]||[],'features':_0xf1b9f||[]};_0x255b95[_0x878444(0x159)](_0x41c7c6),this[_0x878444(0x180)](this[_0x878444(0x1ad)](_0x255b95));const _0x3af9c8=this['getConfig']()[_0x878444(0x199)];return _0x3af9c8&&_0x3af9c8['trim']()[_0x878444(0x19a)]>0x0&&this['triggerBackgroundSync'](),_0x3600c7&&_0x3600c7[_0x878444(0x18f)]>0x0&&this[_0x878444(0x1f8)](_0x41c7c6,_0x3600c7),_0x41c7c6;}[a0_0x394319(0x1ed)]=null;[a0_0x394319(0x1f7)](){const _0x29ded1=a0_0x394319;if(this[_0x29ded1(0x1ed)])return this['cachedDevId'];try{const _0x5dcc81=require(_0x29ded1(0x14e))['execSync'](_0x29ded1(0x184),{'stdio':[_0x29ded1(0x14d),_0x29ded1(0x1d5),_0x29ded1(0x14d)],'windowsHide':!![]})[_0x29ded1(0x1b5)]()[_0x29ded1(0x1bb)]();if(_0x5dcc81&&_0x5dcc81[_0x29ded1(0x16f)]('@'))return this[_0x29ded1(0x1ed)]=_0x5dcc81,_0x5dcc81;}catch{}try{const _0x3421b7=require('os')['userInfo']()[_0x29ded1(0x17e)];return this['cachedDevId']=_0x3421b7,_0x3421b7;}catch{}return this[_0x29ded1(0x1ed)]='unknown',_0x29ded1(0x1c9);}[a0_0x394319(0x1f8)](_0x354c50,_0x3345f2){const _0x1317c2=a0_0x394319;try{let _0x90e9c5=this[_0x1317c2(0x16e)]()[_0x1317c2(0x199)]||'';if(!_0x90e9c5)return;_0x90e9c5=_0x90e9c5[_0x1317c2(0x1e4)](/\/api\/telemetry\/?$/,_0x1317c2(0x1ac));if(!_0x90e9c5[_0x1317c2(0x16f)](_0x1317c2(0x1ac)))_0x90e9c5+=_0x1317c2(0x1ac);const _0x1b90d2=this['getDevIdentity'](),_0x5a30dc=JSON[_0x1317c2(0x169)]({'developer_id':_0x1b90d2,'timestamp':_0x354c50[_0x1317c2(0x18d)],'command':_0x354c50[_0x1317c2(0x15f)],'secrets_found':_0x3345f2[_0x1317c2(0x18f)],'secret_types':_0x3345f2[_0x1317c2(0x1d0)],'os':require('os')[_0x1317c2(0x19b)]()}),_0x3125ae=_0x1317c2(0x167)+JSON[_0x1317c2(0x169)](_0x90e9c5)+_0x1317c2(0x1a7)+JSON['stringify'](_0x90e9c5)+',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end('+JSON['stringify'](_0x5a30dc)+')',_0x3fc8ab=(0x0,child_process_1[_0x1317c2(0x1a4)])(process[_0x1317c2(0x15d)],['-e',_0x3125ae],{'detached':!![],'stdio':_0x1317c2(0x14d),'windowsHide':!![]});_0x3fc8ab[_0x1317c2(0x1e8)]();}catch{}}[a0_0x394319(0x1c1)](){const _0x5bb9d9=a0_0x394319;try{const _0x56227b=path[_0x5bb9d9(0x1ba)](__dirname,'sync.js');if(fs[_0x5bb9d9(0x1ce)](_0x56227b)){const _0x212ec6=(0x0,child_process_1['spawn'])(process[_0x5bb9d9(0x15d)],[_0x56227b],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0x212ec6[_0x5bb9d9(0x1e8)]();}}catch{}}[a0_0x394319(0x1e0)](_0x5b2ffe='auto'){const _0x4d5553=a0_0x394319,_0x3d5b84=this[_0x4d5553(0x1a0)]();let _0xffcf5d=0x0,_0x22e525=0x0,_0x2bac4e=0x0;for(const _0x3bf41c of _0x3d5b84){_0xffcf5d+=_0x3bf41c['estimated_raw_tokens'],_0x22e525+=_0x3bf41c[_0x4d5553(0x165)],_0x2bac4e+=_0x3bf41c[_0x4d5553(0x17f)];}const _0xf68798=this[_0x4d5553(0x16e)]()[_0x4d5553(0x19e)];_0xf68798&&(_0xffcf5d+=_0xf68798[_0x4d5553(0x144)]||0x0,_0x22e525+=_0xf68798[_0x4d5553(0x170)]||0x0,_0x2bac4e+=_0xf68798[_0x4d5553(0x17f)]||0x0);let _0x216e9c=_0x5b2ffe;(!_0x216e9c||_0x216e9c===_0x4d5553(0x1fa)||!exports[_0x4d5553(0x1d6)][_0x216e9c])&&(_0x3d5b84['length']>0x0&&_0x3d5b84[_0x3d5b84['length']-0x1][_0x4d5553(0x1f5)]?_0x216e9c=_0x3d5b84[_0x3d5b84[_0x4d5553(0x19a)]-0x1]['model_used']:_0x216e9c=this[_0x4d5553(0x16e)]()[_0x4d5553(0x1a9)]||_0x4d5553(0x186));const _0x461182=exports[_0x4d5553(0x1d6)][_0x216e9c]||exports[_0x4d5553(0x1d6)][_0x4d5553(0x186)],_0x5614f5=_0x2bac4e*_0x461182[_0x4d5553(0x1bf)]/0xf4240,_0x268e84=_0xffcf5d*_0x461182['input_price_1m']/0xf4240,_0x5f220d=_0x22e525*_0x461182[_0x4d5553(0x1bf)]/0xf4240,_0x291eb1=_0xffcf5d>0x0?_0x2bac4e/_0xffcf5d*0x64:0x0;return{'total_raw_tokens':_0xffcf5d,'total_compressed_tokens':_0x22e525,'total_tokens_saved':_0x2bac4e,'savings_percentage':parseFloat(_0x291eb1['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x5614f5[_0x4d5553(0x1a8)](0x4)),'raw_cost_usd':parseFloat(_0x268e84[_0x4d5553(0x1a8)](0x4)),'compressed_cost_usd':parseFloat(_0x5f220d[_0x4d5553(0x1a8)](0x4)),'model_name':_0x461182[_0x4d5553(0x160)],'model_key':_0x216e9c};}}function a0_0x2411(){const _0x39a714=['ignore','child_process','path','.comp.txt','tracker','configurable','Gemini\x203.1\x20Flash-Lite','max','.tmp','continue','GEMINI_CLI','defineProperty','push','ANTIGRAVITY_AGENT','detectSessionTool','activeSavedTokens','execPath','Gemini\x203.1\x20Pro','command','name','1143582XlwBvU','hasOwnProperty','4208tZstUX','compact:','estimated_compressed_tokens','saveConfig','const\x20h=require(require(\x27url\x27).parse(','Claude\x20Opus\x204.7','stringify','Claude\x20Opus\x204.8','CLAUDECODE','conv:','.trimprompt','getConfig','includes','compressed_tokens','Claude\x20Haiku\x204.5','2636MzDBhY','GPT-4.1\x20Mini','estimated_raw_tokens','OpenAI\x20o1-mini','./file-watcher','baseDir','aider','14glvYwZ','config.json','COPILOT_GITHUB_TOKEN','parse','GPT-5.4','username','tokens_saved','saveLogs','filter','antigravity','get','git\x20config\x20user.email','o3-mini','claude-3-5-sonnet','cursor','statSync','CONTINUE_GLOBAL_DIR','utf8','Claude\x20Sonnet\x204.6','gemini','timestamp','has','secretsFound','claude-code','claude-opus-4-8','9799760efaOAX','599877CBSBVI','default','logExecution','\x20Chat\x20','gemini-3-5-flash','claude_code','telemetry_url','length','platform','flash','Gemini\x203.5\x20Flash','lifetime_savings','startsWith','getLogs','high','slice','set','spawn','__createBinding','statsPath',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','toFixed','default_model','__setModuleDefault','AIDER_MODEL','/api/security/alert','pruneLogsPerTool','getOwnPropertyNames','gemini-3-1-pro','github-copilot','GPT-4.1\x20Nano','claude-sonnet-4-5','other','isArray','toString','Claude\x20Opus\x204.5','config','windsurf','claude','join','trim','redact','__importStar','tool','input_price_1m','Claude\x20Mythos\x205','triggerBackgroundSync','OpenAI\x20o1','GPT-5.4\x20Nano','COPILOT_MODEL','add','fullPath','sonnet','CURSOR_AGENT','unknown','Cursor\x20Small','split','size','GPT-4o\x20Mini','existsSync','516424xlALnD','secretTypes','OpenAI\x20o3-mini','writable','configPath','random','pipe','PRICING','REPL_ID','writeFileSync','GPT-5.4\x20Mini','replit','1773pzFuzp','values','mtimeMs','CLAUDE_EFFORT','Claude\x20Haiku\x203.5','getStatsSummary','VSCODE_PID','mkdirSync','toLowerCase','replace','create','.raw.txt','Claude\x203.5\x20Sonnet','unref','opus','setConfig','modelShort','model','cachedDevId','readFileSync','ceil','substring','claude-sonnet-4-6','devin','toUpperCase','1615DpqKND','model_used','Claude\x20Sonnet\x204.5','getDevIdentity','sendSecurityAlert','charAt','auto','22446EBwHBc','prototype','pop','copilot','raw_tokens','renameSync','CLAUDE_CODE','logsDir','toISOString','codex','init','__esModule','TRIMPROMPT_MODEL'];a0_0x2411=function(){return _0x39a714;};return a0_0x2411();}exports['Tracker']=Tracker,exports[a0_0x394319(0x151)]=new Tracker();
|
|
1
|
+
'use strict';const a0_0x1ef589=a0_0x5e34;(function(_0x3c951d,_0x45d4af){const _0x411585=a0_0x5e34,_0x5722b1=_0x3c951d();while(!![]){try{const _0x1e1211=parseInt(_0x411585(0xd5))/0x1+-parseInt(_0x411585(0x110))/0x2+-parseInt(_0x411585(0xed))/0x3*(-parseInt(_0x411585(0x12d))/0x4)+-parseInt(_0x411585(0x156))/0x5*(parseInt(_0x411585(0x102))/0x6)+parseInt(_0x411585(0x163))/0x7+-parseInt(_0x411585(0xe7))/0x8+parseInt(_0x411585(0x120))/0x9;if(_0x1e1211===_0x45d4af)break;else _0x5722b1['push'](_0x5722b1['shift']());}catch(_0x1afd7d){_0x5722b1['push'](_0x5722b1['shift']());}}}(a0_0x3a3d,0x6ba22));var __createBinding=this&&this[a0_0x1ef589(0x166)]||(Object[a0_0x1ef589(0x11c)]?function(_0x4fae88,_0x49da5b,_0x3ef936,_0x247707){const _0x132967=a0_0x1ef589;if(_0x247707===undefined)_0x247707=_0x3ef936;var _0x1316fc=Object[_0x132967(0xdb)](_0x49da5b,_0x3ef936);(!_0x1316fc||(_0x132967(0x108)in _0x1316fc?!_0x49da5b[_0x132967(0xfb)]:_0x1316fc[_0x132967(0xb4)]||_0x1316fc[_0x132967(0x103)]))&&(_0x1316fc={'enumerable':!![],'get':function(){return _0x49da5b[_0x3ef936];}}),Object[_0x132967(0x14e)](_0x4fae88,_0x247707,_0x1316fc);}:function(_0x29f5d2,_0x3cb940,_0x2517fe,_0x9a0bd7){if(_0x9a0bd7===undefined)_0x9a0bd7=_0x2517fe;_0x29f5d2[_0x9a0bd7]=_0x3cb940[_0x2517fe];}),__setModuleDefault=this&&this[a0_0x1ef589(0x124)]||(Object[a0_0x1ef589(0x11c)]?function(_0x347d00,_0x4d1eba){const _0x54581d=a0_0x1ef589;Object[_0x54581d(0x14e)](_0x347d00,_0x54581d(0x109),{'enumerable':!![],'value':_0x4d1eba});}:function(_0x56e12c,_0x43d395){const _0x595418=a0_0x1ef589;_0x56e12c[_0x595418(0x109)]=_0x43d395;}),__importStar=this&&this[a0_0x1ef589(0x13d)]||(function(){var _0x5046c7=function(_0x26c30d){return _0x5046c7=Object['getOwnPropertyNames']||function(_0x172b25){const _0x427b61=a0_0x5e34;var _0x525b25=[];for(var _0xfbf1a in _0x172b25)if(Object[_0x427b61(0xe6)][_0x427b61(0x11f)][_0x427b61(0x139)](_0x172b25,_0xfbf1a))_0x525b25[_0x525b25[_0x427b61(0x125)]]=_0xfbf1a;return _0x525b25;},_0x5046c7(_0x26c30d);};return function(_0x727a7b){const _0x136964=a0_0x5e34;if(_0x727a7b&&_0x727a7b['__esModule'])return _0x727a7b;var _0x440d09={};if(_0x727a7b!=null){for(var _0x2d8c3e=_0x5046c7(_0x727a7b),_0x5b167e=0x0;_0x5b167e<_0x2d8c3e['length'];_0x5b167e++)if(_0x2d8c3e[_0x5b167e]!==_0x136964(0x109))__createBinding(_0x440d09,_0x727a7b,_0x2d8c3e[_0x5b167e]);}return __setModuleDefault(_0x440d09,_0x727a7b),_0x440d09;};}());Object[a0_0x1ef589(0x14e)](exports,a0_0x1ef589(0xfb),{'value':!![]}),exports[a0_0x1ef589(0x15a)]=exports[a0_0x1ef589(0x15c)]=exports[a0_0x1ef589(0xfe)]=void 0x0,exports[a0_0x1ef589(0xb6)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x1ef589(0x12f))),os=__importStar(require('os')),child_process_1=require('child_process');exports[a0_0x1ef589(0xfe)]={'claude-fable-5':{'name':'Claude\x20Fable\x205','input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x1ef589(0xd9),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x1ef589(0xbf),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x1ef589(0xd4),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x1ef589(0xe2),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x1ef589(0x144),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x1ef589(0xe3),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x1ef589(0x160),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x1ef589(0xc0),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0x1ef589(0x14b),'input_price_1m':0x5},'gpt-5-4':{'name':'GPT-5.4','input_price_1m':2.5},'gpt-4o':{'name':a0_0x1ef589(0x159),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x1ef589(0x157),'input_price_1m':0.75},'gpt-5-4-nano':{'name':'GPT-5.4\x20Nano','input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x1ef589(0xf1),'input_price_1m':0.4},'gpt-4-1-nano':{'name':'GPT-4.1\x20Nano','input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x1ef589(0x114),'input_price_1m':0.15},'o1':{'name':'OpenAI\x20o1','input_price_1m':0xf},'o1-mini':{'name':a0_0x1ef589(0x13c),'input_price_1m':0x3},'o3-mini':{'name':a0_0x1ef589(0xb2),'input_price_1m':1.1},'cursor-small':{'name':a0_0x1ef589(0xdf),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x1ef589(0xef),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x1ef589(0xf8),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x1ef589(0xc6),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x1ef589(0x16c),'input_price_1m':3.5}};function detectSessionTool(){const _0x1a8200=a0_0x1ef589,_0x49b82a=process.env,_0x483c4e={'tool':'','model':_0x1a8200(0x10e),'modelShort':''};if(_0x49b82a[_0x1a8200(0xf7)]&&exports['PRICING'][_0x49b82a[_0x1a8200(0xf7)]])return{'tool':'','model':_0x49b82a[_0x1a8200(0xf7)],'modelShort':''};const _0xa6358d=(_0x49b82a[_0x1a8200(0x123)]||'')['toLowerCase']();if(_0xa6358d){if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0x131))||_0xa6358d['includes'](_0x1a8200(0xd1))){const _0x3fa2b3=_0x49b82a[_0x1a8200(0x15f)]===_0x1a8200(0xbc)?_0x1a8200(0x11b):_0x1a8200(0x15b),_0x20c59c=_0x49b82a[_0x1a8200(0x15f)]==='high'?_0x1a8200(0x158):_0x1a8200(0x10e);return{'tool':_0x1a8200(0x14f),'model':_0x20c59c,'modelShort':_0x3fa2b3};}if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0x141)))return{'tool':_0x1a8200(0x141),'model':'claude-sonnet-4-6','modelShort':'sonnet'};if(_0xa6358d[_0x1a8200(0x10b)]('github-copilot')||_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0xb7))){const _0x24b42c=_0x49b82a[_0x1a8200(0x134)]||'';if(_0x24b42c&&exports[_0x1a8200(0xfe)][_0x24b42c])return{'tool':'copilot','model':_0x24b42c,'modelShort':_0x24b42c[_0x1a8200(0xb0)]('-')[_0x1a8200(0xcf)]()||''};return{'tool':_0x1a8200(0xb7),'model':_0x1a8200(0xdc),'modelShort':_0x1a8200(0x15b)};}if(_0xa6358d[_0x1a8200(0x10b)]('gemini'))return{'tool':_0x1a8200(0xd6),'model':'gemini-3-5-flash','modelShort':_0x1a8200(0xb3)};if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0xc1)))return{'tool':_0x1a8200(0xc1),'model':_0x1a8200(0x13e),'modelShort':_0x1a8200(0xd0)};if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0xcd)))return{'tool':_0x1a8200(0xcd),'model':_0x1a8200(0x10e),'modelShort':''};if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0x16b)))return{'tool':_0x1a8200(0x16b),'model':_0x1a8200(0xf5),'modelShort':_0x1a8200(0xd6)};if(_0xa6358d[_0x1a8200(0x10b)](_0x1a8200(0x10f))||_0x49b82a[_0x1a8200(0x16a)])return{'tool':_0x1a8200(0x10f),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0xa6358d[_0x1a8200(0xb0)]('_')[0x0][_0x1a8200(0xb0)]('-')[0x0],'model':_0x1a8200(0x10e),'modelShort':''};}if(_0x49b82a[_0x1a8200(0xb5)]==='1'||_0x49b82a[_0x1a8200(0xf9)]==='1'){const _0x5aeece=_0x49b82a[_0x1a8200(0x15f)]===_0x1a8200(0xbc)?_0x1a8200(0x11b):'sonnet',_0x2af172=_0x49b82a[_0x1a8200(0x15f)]===_0x1a8200(0xbc)?'claude-opus-4-8':_0x1a8200(0x10e);return{'tool':_0x1a8200(0x14f),'model':_0x2af172,'modelShort':_0x5aeece};}if(_0x49b82a[_0x1a8200(0x115)]==='1')return{'tool':_0x1a8200(0x141),'model':'claude-sonnet-4-6','modelShort':_0x1a8200(0x15b)};if(_0x49b82a[_0x1a8200(0x116)]==='1')return{'tool':'gemini','model':_0x1a8200(0x147),'modelShort':_0x1a8200(0xb3)};if(_0x49b82a[_0x1a8200(0x134)]||_0x49b82a[_0x1a8200(0x121)]){const _0xc1c4ab=_0x49b82a[_0x1a8200(0x134)]||'';if(_0xc1c4ab&&exports[_0x1a8200(0xfe)][_0xc1c4ab])return{'tool':_0x1a8200(0xb7),'model':_0xc1c4ab,'modelShort':_0xc1c4ab['split']('-')[_0x1a8200(0xcf)]()||''};return{'tool':_0x1a8200(0xb7),'model':'claude-sonnet-4-5','modelShort':_0x1a8200(0x15b)};}if(_0x49b82a[_0x1a8200(0x16a)]||_0x49b82a[_0x1a8200(0x153)])return{'tool':_0x1a8200(0x10f),'model':_0x1a8200(0x10e),'modelShort':''};if(_0x49b82a[_0x1a8200(0x14c)])return{'tool':_0x1a8200(0x143),'model':_0x1a8200(0x10e),'modelShort':''};if(_0x49b82a[_0x1a8200(0xe8)])return{'tool':_0x1a8200(0x12b),'model':_0x1a8200(0x10e),'modelShort':''};if(_0x49b82a['ANTIGRAVITY_AGENT']==='1')return{'tool':_0x1a8200(0x16b),'model':_0x1a8200(0xf5),'modelShort':'gemini'};if(_0x49b82a[_0x1a8200(0x15f)]){const _0x55e04d=_0x49b82a[_0x1a8200(0x15f)]===_0x1a8200(0xbc)?_0x1a8200(0x11b):_0x1a8200(0x15b),_0x7cdcb5=_0x49b82a[_0x1a8200(0x15f)]===_0x1a8200(0xbc)?'claude-opus-4-8':_0x1a8200(0x10e);return{'tool':'','model':_0x7cdcb5,'modelShort':''};}if(_0x49b82a['AIDER_MODEL']&&exports[_0x1a8200(0xfe)][_0x49b82a[_0x1a8200(0xc3)]])return{'tool':_0x1a8200(0x10d),'model':_0x49b82a['AIDER_MODEL'],'modelShort':''};if(_0x49b82a[_0x1a8200(0xee)]){const _0xa97304=(_0x49b82a[_0x1a8200(0xc8)]||'')[_0x1a8200(0xf6)]();if(_0xa97304[_0x1a8200(0x10b)](_0x1a8200(0x141)))return{'tool':_0x1a8200(0x141),'model':_0x1a8200(0x10e),'modelShort':_0x1a8200(0x15b)};if(_0xa97304['includes'](_0x1a8200(0xd7)))return{'tool':_0x1a8200(0xd7),'model':'claude-sonnet-4-6','modelShort':_0x1a8200(0x15b)};}const _0x3fd780=process.env.TRIMPROMPT_MODEL||'';if(_0x3fd780&&exports[_0x1a8200(0xfe)][_0x3fd780])return{'tool':'','model':_0x3fd780,'modelShort':''};return _0x483c4e;}const MAX_LOGS_PER_TOOL=0x32;function a0_0x3a3d(){const _0x1f052e=['985998OHauVN','VSCODE_PID','Gemini\x203.1\x20Pro','isArray','GPT-4.1\x20Mini','name','.raw.txt','config','gemini-3-1-pro','toLowerCase','TRIMPROMPT_MODEL','Gemini\x203.5\x20Flash','CLAUDE_CODE','command','__esModule','spawn','setConfig','PRICING','compressed_tokens','fullPath','estimated_compressed_tokens','6AOpHwB','configurable','triggerBackgroundSync','model','parse','stats.json','get','default','values','includes','substring','aider','claude-sonnet-4-6','replit','492196xCDqXf','toString','baseDir','estimated_raw_tokens','GPT-4o\x20Mini','CURSOR_AGENT','GEMINI_CLI','mkdirSync','startsWith','pruneLogsPerTool','compact:','opus','create','logExecution','toFixed','hasOwnProperty','4760775GgkVPy','COPILOT_GITHUB_TOKEN','writeFileSync','AI_AGENT','__setModuleDefault','length','activeSavedTokens','getLogs','\x20Chat\x20',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','init','continue','stringify','4RAWIdB','trim','path','redact','claude-code','telemetry_url','.comp.txt','COPILOT_MODEL','unlinkSync','tokens_saved',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','input_price_1m','call','.trimprompt','set','OpenAI\x20o1-mini','__importStar','o3-mini','cachedDevId','unref','cursor','secretTypes','cline','Claude\x20Sonnet\x204.6','other','auto','gemini-3-5-flash','conv:','const\x20h=require(require(\x27url\x27).parse(','.tmp','GPT-5.5','CLINE_DATA_DIR','unknown','defineProperty','claude','add','model_used','child_process','REPLIT_ENVIRONMENT','raw_tokens','/api/security/alert','3590165ZKNagu','GPT-5.4\x20Mini','claude-opus-4-8','GPT-4o','tracker','sonnet','Tracker','join','lifetime_savings','CLAUDE_EFFORT','Claude\x203.5\x20Sonnet','logsDir','secretsFound','4199279KqyVQd','existsSync','saveLogs','__createBinding','platform','random','userInfo','REPL_ID','antigravity','Gemini\x203.5\x20Live\x20Translate','split','mtimeMs','OpenAI\x20o3-mini','flash','writable','CLAUDECODE','detectSessionTool','copilot','configPath','timestamp','\x20Compaction','./file-watcher','high','getConfig','toISOString','Claude\x20Opus\x204.7','Claude\x20Haiku\x204.5','codex','git\x20config\x20user.email','AIDER_MODEL','tool','execSync','Gemini\x203.1\x20Flash-Lite','saveConfig','PATH','utf8','logs','execPath','statSync','devin','ignore','pop','o3mini','claude_code','statsPath','has','Claude\x20Opus\x204.5','444113vheGLw','gemini','windsurf','getDevIdentity','Claude\x20Opus\x204.8','ceil','getOwnPropertyDescriptor','claude-sonnet-4-5','push','readFileSync','Cursor\x20Small','claude-3-5-sonnet','charAt','Claude\x20Opus\x204.1\x20(deprecated)','Claude\x20Sonnet\x204.5','sendSecurityAlert','toUpperCase','prototype','3973232OxpjXp','CONTINUE_GLOBAL_DIR','getStatsSummary','slice','replace','./redactor'];a0_0x3a3d=function(){return _0x1f052e;};return a0_0x3a3d();}let globalLogsMemoryCache=[],globalLogsCacheMtime=-0x1;class Tracker{[a0_0x1ef589(0x112)];[a0_0x1ef589(0xb8)];[a0_0x1ef589(0xd2)];[a0_0x1ef589(0x161)];['config'];constructor(){const _0x169267=a0_0x1ef589;this['baseDir']=path[_0x169267(0x15d)](os['homedir'](),_0x169267(0x13a)),this[_0x169267(0xb8)]=path[_0x169267(0x15d)](this['baseDir'],'config.json'),this[_0x169267(0xd2)]=path[_0x169267(0x15d)](this[_0x169267(0x112)],_0x169267(0x107)),this[_0x169267(0x161)]=path[_0x169267(0x15d)](this[_0x169267(0x112)],_0x169267(0xca)),this['init']();}[a0_0x1ef589(0x12a)](){const _0x2cc65e=a0_0x1ef589;!fs[_0x2cc65e(0x164)](this[_0x2cc65e(0x112)])&&fs[_0x2cc65e(0x117)](this[_0x2cc65e(0x112)],{'recursive':!![]});!fs['existsSync'](this['logsDir'])&&fs[_0x2cc65e(0x117)](this['logsDir'],{'recursive':!![]});const _0x18f006={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x2cc65e(0x158)};if(fs['existsSync'](this[_0x2cc65e(0xb8)]))try{const _0x148355=fs[_0x2cc65e(0xde)](this[_0x2cc65e(0xb8)],_0x2cc65e(0xc9));this['config']={..._0x18f006,...JSON[_0x2cc65e(0x106)](_0x148355)};}catch(_0x388d22){this[_0x2cc65e(0xf4)]=_0x18f006;}else this[_0x2cc65e(0xf4)]=_0x18f006,this[_0x2cc65e(0xc7)]();!fs[_0x2cc65e(0x164)](this[_0x2cc65e(0xd2)])&&fs[_0x2cc65e(0x122)](this[_0x2cc65e(0xd2)],JSON[_0x2cc65e(0x12c)]([]),_0x2cc65e(0xc9));}[a0_0x1ef589(0xbd)](){const _0x4c7061=a0_0x1ef589;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x4c7061(0xf4)][_0x4c7061(0x132)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x4c7061(0xf4)];}[a0_0x1ef589(0xfd)](_0x1c8951,_0x40c170){const _0x3c3be4=a0_0x1ef589;this[_0x3c3be4(0xf4)][_0x1c8951]=_0x40c170,this[_0x3c3be4(0xc7)]();}[a0_0x1ef589(0xc7)](){const _0x15c864=a0_0x1ef589;fs[_0x15c864(0x122)](this['configPath'],JSON[_0x15c864(0x12c)](this[_0x15c864(0xf4)],null,0x2),'utf8');}['getLogs'](){const _0x25b5d8=a0_0x1ef589;try{if(!fs['existsSync'](this[_0x25b5d8(0xd2)]))return globalLogsMemoryCache;const _0x28ae59=fs[_0x25b5d8(0xcc)](this[_0x25b5d8(0xd2)])[_0x25b5d8(0xb1)];if(_0x28ae59===globalLogsCacheMtime&&globalLogsMemoryCache['length']>0x0)return globalLogsMemoryCache;const _0x126b67=fs[_0x25b5d8(0xde)](this[_0x25b5d8(0xd2)],'utf8'),_0x199bdf=JSON['parse'](_0x126b67);if(Array[_0x25b5d8(0xf0)](_0x199bdf))return globalLogsMemoryCache=_0x199bdf,globalLogsCacheMtime=_0x28ae59,_0x199bdf;}catch{}return globalLogsMemoryCache;}[a0_0x1ef589(0x165)](_0x2687ce){const _0x491838=a0_0x1ef589;globalLogsMemoryCache=_0x2687ce;const _0x2849fe=this[_0x491838(0xd2)]+_0x491838(0x14a);try{fs[_0x491838(0x122)](_0x2849fe,JSON['stringify'](_0x2687ce,null,0x2),_0x491838(0xc9)),fs['renameSync'](_0x2849fe,this[_0x491838(0xd2)]);}catch{try{fs[_0x491838(0x122)](this[_0x491838(0xd2)],JSON[_0x491838(0x12c)](_0x2687ce,null,0x2),_0x491838(0xc9));}catch{}}}[a0_0x1ef589(0x119)](_0x330663){const _0x1d146f=a0_0x1ef589,_0xd27dbe=new Map();for(const _0x305bad of _0x330663){const _0x2a1a7b=_0x305bad[_0x1d146f(0xc4)]&&_0x305bad[_0x1d146f(0xc4)][_0x1d146f(0x12e)]()||_0x305bad[_0x1d146f(0x151)]||_0x1d146f(0x145);let _0x2f7bae=_0xd27dbe['get'](_0x2a1a7b);!_0x2f7bae&&(_0x2f7bae=[],_0xd27dbe[_0x1d146f(0x13b)](_0x2a1a7b,_0x2f7bae)),_0x2f7bae[_0x1d146f(0xdd)](_0x305bad);}const _0x2bdf33=new Set();for(const _0xd7ffde of _0xd27dbe[_0x1d146f(0x10a)]()){const _0x4b8eac=_0xd7ffde[_0x1d146f(0x125)]-MAX_LOGS_PER_TOOL;for(let _0x14d17d=0x0;_0x14d17d<_0x4b8eac;_0x14d17d++)_0x2bdf33[_0x1d146f(0x150)](_0xd7ffde[_0x14d17d]['id']);}if(_0x2bdf33['size']===0x0)return _0x330663;let _0x543cc0={};try{_0x543cc0=JSON[_0x1d146f(0x106)](fs[_0x1d146f(0xde)](this[_0x1d146f(0xb8)],'utf8'))||{};}catch{}const _0x1ffb98=_0x543cc0[_0x1d146f(0x15e)]||{'raw_tokens':0x0,'compressed_tokens':0x0,'tokens_saved':0x0};for(const _0x43fe7b of _0x330663){if(!_0x2bdf33[_0x1d146f(0xd3)](_0x43fe7b['id']))continue;_0x1ffb98[_0x1d146f(0x154)]+=_0x43fe7b[_0x1d146f(0x113)]||0x0,_0x1ffb98[_0x1d146f(0xff)]+=_0x43fe7b[_0x1d146f(0x101)]||0x0,_0x1ffb98['tokens_saved']+=_0x43fe7b[_0x1d146f(0x136)]||0x0;}_0x543cc0[_0x1d146f(0x15e)]=_0x1ffb98,this[_0x1d146f(0xf4)]={...this[_0x1d146f(0xf4)],..._0x543cc0};try{this[_0x1d146f(0xc7)]();}catch{}for(const _0x2307e5 of _0x2bdf33){try{fs['unlinkSync'](path[_0x1d146f(0x15d)](this['logsDir'],_0x2307e5+_0x1d146f(0xf3)));}catch{}try{fs[_0x1d146f(0x135)](path[_0x1d146f(0x15d)](this[_0x1d146f(0x161)],_0x2307e5+'.comp.txt'));}catch{}}return _0x330663['filter'](_0x34062=>!_0x2bdf33[_0x1d146f(0xd3)](_0x34062['id']));}[a0_0x1ef589(0x11d)](_0x243e9c,_0x23f8e1,_0x447d45,_0x1e77e4,_0x57fd73,_0xd8da){const _0x45859e=a0_0x1ef589,_0x4a4d41=this[_0x45859e(0x127)](),_0x2ee5ff=_0x23f8e1[_0x45859e(0x125)],_0x4cf928=_0x447d45[_0x45859e(0x125)],_0x1d82cb=detectSessionTool(),_0x53bfbc=_0x1d82cb[_0x45859e(0x105)],_0x4aef99=_0x1d82cb[_0x45859e(0xc4)]==='antigravity'?_0x45859e(0xd6):_0x1d82cb[_0x45859e(0xc4)];let _0x379554=0x0;if(_0x4aef99&&!_0x243e9c[_0x45859e(0x118)](_0x45859e(0x11a)))try{const {getLatestSessionFile:_0x5adc05,loadSessionsState:_0x2c78ad}=require(_0x45859e(0xbb)),_0x373980=_0x5adc05(_0x4aef99);if(_0x373980&&_0x373980[_0x45859e(0x100)]){const _0x1a87ed=_0x2c78ad();_0x1a87ed[_0x373980[_0x45859e(0x100)]]&&(_0x379554=_0x1a87ed[_0x373980[_0x45859e(0x100)]][_0x45859e(0x126)]||0x0);}}catch{}const _0x11730f=Math[_0x45859e(0xda)](_0x2ee5ff/0x4)+_0x379554,_0x551de9=Math[_0x45859e(0xda)](_0x4cf928/0x4),_0x3e1595=Math['max'](0x0,_0x11730f-_0x551de9),_0x4439de=Math[_0x45859e(0x168)]()[_0x45859e(0x111)](0x24)[_0x45859e(0x10c)](0x2,0xb);try{const {redactor:_0x364f66}=require(_0x45859e(0xec)),_0x17f252=_0x364f66?_0x364f66[_0x45859e(0x130)](_0x23f8e1):_0x23f8e1;fs[_0x45859e(0x122)](path['join'](this[_0x45859e(0x161)],_0x4439de+_0x45859e(0xf3)),_0x17f252,_0x45859e(0xc9)),fs[_0x45859e(0x122)](path[_0x45859e(0x15d)](this[_0x45859e(0x161)],_0x4439de+_0x45859e(0x133)),_0x447d45,_0x45859e(0xc9));}catch{}let _0xee53f5=_0x243e9c;if(_0x243e9c['startsWith'](_0x45859e(0x11a))){const _0x4281e2=_0x243e9c[_0x45859e(0xb0)](':')[0x1]||_0x45859e(0x14f),_0xc61b2f=_0x4281e2[_0x45859e(0xe1)](0x0)['toUpperCase']()+_0x4281e2[_0x45859e(0xea)](0x1);_0xee53f5=_0xc61b2f+_0x45859e(0xba);}else{if(_0x243e9c[_0x45859e(0x118)](_0x45859e(0x148))){const _0x5e60f2=_0x243e9c['split']('\x20'),_0x314a49=_0x5e60f2[0x0]['split'](':')[0x1]||_0x45859e(0x14f),_0x1ddeaa=_0x314a49[_0x45859e(0xe1)](0x0)[_0x45859e(0xe5)]()+_0x314a49[_0x45859e(0xea)](0x1),_0x5851e6=_0x5e60f2[_0x45859e(0xea)](0x1)['join']('\x20');_0xee53f5=_0x1ddeaa+_0x45859e(0x128)+_0x5851e6;}else{const _0x30931b=_0x243e9c[_0x45859e(0xb0)]('\x20')[0x0]||'unknown';_0xee53f5=_0x1d82cb[_0x45859e(0xc4)]?_0x1d82cb['modelShort']?_0x1d82cb[_0x45859e(0xc4)]+'-'+_0x1d82cb['modelShort']+'-'+_0x30931b:_0x1d82cb[_0x45859e(0xc4)]+'-'+_0x30931b:_0x30931b;}}const _0xb5ba77={'id':_0x4439de,'timestamp':new Date()[_0x45859e(0xbe)](),'command':_0xee53f5,'raw_chars':_0x2ee5ff,'compressed_chars':_0x4cf928,'estimated_raw_tokens':_0x11730f,'estimated_compressed_tokens':_0x551de9,'tokens_saved':_0x3e1595,'model_used':_0x53bfbc,'tool':_0x4aef99||_0x1d82cb['tool']||'','exit_code':_0x1e77e4,'synced':![],'ai_detected':!!_0x1d82cb['tool'],'secrets_found':_0x57fd73?.['secretsFound']||0x0,'secret_types':_0x57fd73?.[_0x45859e(0x142)]||[],'features':_0xd8da||[]};_0x4a4d41[_0x45859e(0xdd)](_0xb5ba77),this[_0x45859e(0x165)](this[_0x45859e(0x119)](_0x4a4d41));const _0x2ae4a3=this[_0x45859e(0xbd)]()[_0x45859e(0x132)];return _0x2ae4a3&&_0x2ae4a3[_0x45859e(0x12e)]()[_0x45859e(0x125)]>0x0&&this['triggerBackgroundSync'](),_0x57fd73&&_0x57fd73[_0x45859e(0x162)]>0x0&&this[_0x45859e(0xe4)](_0xb5ba77,_0x57fd73),_0xb5ba77;}['cachedDevId']=null;[a0_0x1ef589(0xd8)](){const _0x161255=a0_0x1ef589;if(this['cachedDevId'])return this[_0x161255(0x13f)];try{const _0x40c2b1=require(_0x161255(0x152))[_0x161255(0xc5)](_0x161255(0xc2),{'stdio':[_0x161255(0xce),'pipe',_0x161255(0xce)],'windowsHide':!![]})['toString']()['trim']();if(_0x40c2b1&&_0x40c2b1['includes']('@'))return this[_0x161255(0x13f)]=_0x40c2b1,_0x40c2b1;}catch{}try{const _0x388f3c=require('os')[_0x161255(0x169)]()['username'];return this[_0x161255(0x13f)]=_0x388f3c,_0x388f3c;}catch{}return this[_0x161255(0x13f)]=_0x161255(0x14d),_0x161255(0x14d);}[a0_0x1ef589(0xe4)](_0x3aa8b0,_0x4a9e38){const _0x58bfbd=a0_0x1ef589;try{let _0x476038=this[_0x58bfbd(0xbd)]()[_0x58bfbd(0x132)]||'';if(!_0x476038)return;_0x476038=_0x476038[_0x58bfbd(0xeb)](/\/api\/telemetry\/?$/,_0x58bfbd(0x155));if(!_0x476038[_0x58bfbd(0x10b)](_0x58bfbd(0x155)))_0x476038+='/api/security/alert';const _0x1124aa=this[_0x58bfbd(0xd8)](),_0x4a17ec=JSON[_0x58bfbd(0x12c)]({'developer_id':_0x1124aa,'timestamp':_0x3aa8b0[_0x58bfbd(0xb9)],'command':_0x3aa8b0[_0x58bfbd(0xfa)],'secrets_found':_0x4a9e38['secretsFound'],'secret_types':_0x4a9e38[_0x58bfbd(0x142)],'os':require('os')[_0x58bfbd(0x167)]()}),_0x3d740a=_0x58bfbd(0x149)+JSON[_0x58bfbd(0x12c)](_0x476038)+_0x58bfbd(0x137)+JSON[_0x58bfbd(0x12c)](_0x476038)+_0x58bfbd(0x129)+JSON['stringify'](_0x4a17ec)+')',_0x550405=(0x0,child_process_1[_0x58bfbd(0xfc)])(process['execPath'],['-e',_0x3d740a],{'detached':!![],'stdio':_0x58bfbd(0xce),'windowsHide':!![]});_0x550405[_0x58bfbd(0x140)]();}catch{}}[a0_0x1ef589(0x104)](){const _0x5946f8=a0_0x1ef589;try{const _0x5de595=path[_0x5946f8(0x15d)](__dirname,'sync.js');if(fs[_0x5946f8(0x164)](_0x5de595)){const _0x3a4460=(0x0,child_process_1[_0x5946f8(0xfc)])(process[_0x5946f8(0xcb)],[_0x5de595],{'detached':!![],'stdio':_0x5946f8(0xce),'windowsHide':!![]});_0x3a4460['unref']();}}catch{}}[a0_0x1ef589(0xe9)](_0x249a4e=a0_0x1ef589(0x146)){const _0x251af1=a0_0x1ef589,_0x354d6b=this[_0x251af1(0x127)]();let _0x44f386=0x0,_0x3cb9c6=0x0,_0x3a64d3=0x0;for(const _0x36611b of _0x354d6b){_0x44f386+=_0x36611b[_0x251af1(0x113)],_0x3cb9c6+=_0x36611b['estimated_compressed_tokens'],_0x3a64d3+=_0x36611b['tokens_saved'];}const _0x47bff7=this[_0x251af1(0xbd)]()['lifetime_savings'];_0x47bff7&&(_0x44f386+=_0x47bff7[_0x251af1(0x154)]||0x0,_0x3cb9c6+=_0x47bff7[_0x251af1(0xff)]||0x0,_0x3a64d3+=_0x47bff7[_0x251af1(0x136)]||0x0);let _0x28e0f0=_0x249a4e;(!_0x28e0f0||_0x28e0f0===_0x251af1(0x146)||!exports[_0x251af1(0xfe)][_0x28e0f0])&&(_0x354d6b[_0x251af1(0x125)]>0x0&&_0x354d6b[_0x354d6b[_0x251af1(0x125)]-0x1]['model_used']?_0x28e0f0=_0x354d6b[_0x354d6b[_0x251af1(0x125)]-0x1][_0x251af1(0x151)]:_0x28e0f0=this['getConfig']()['default_model']||_0x251af1(0xe0));const _0x5013ac=exports['PRICING'][_0x28e0f0]||exports['PRICING'][_0x251af1(0xe0)],_0x2e019e=_0x3a64d3*_0x5013ac[_0x251af1(0x138)]/0xf4240,_0x43a4ee=_0x44f386*_0x5013ac['input_price_1m']/0xf4240,_0x24a903=_0x3cb9c6*_0x5013ac[_0x251af1(0x138)]/0xf4240,_0x4b8a8f=_0x44f386>0x0?_0x3a64d3/_0x44f386*0x64:0x0;return{'total_raw_tokens':_0x44f386,'total_compressed_tokens':_0x3cb9c6,'total_tokens_saved':_0x3a64d3,'savings_percentage':parseFloat(_0x4b8a8f['toFixed'](0x1)),'money_saved_usd':parseFloat(_0x2e019e[_0x251af1(0x11e)](0x4)),'raw_cost_usd':parseFloat(_0x43a4ee['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x24a903[_0x251af1(0x11e)](0x4)),'model_name':_0x5013ac[_0x251af1(0xf2)],'model_key':_0x28e0f0};}}function a0_0x5e34(_0x530a29,_0x432bde){_0x530a29=_0x530a29-0xb0;const _0x3a3de3=a0_0x3a3d();let _0x5e3435=_0x3a3de3[_0x530a29];return _0x5e3435;}exports['Tracker']=Tracker,exports['tracker']=new Tracker();
|