trimprompt 1.0.43 → 1.0.45
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 +2 -27
- 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';function
|
|
1
|
+
'use strict';const a0_0x19c963=a0_0x458c;function a0_0x458c(_0x599d48,_0xafd36e){_0x599d48=_0x599d48-0x6a;const _0x5afae8=a0_0x5afa();let _0x458c4c=_0x5afae8[_0x599d48];return _0x458c4c;}(function(_0x597612,_0x270781){const _0x5ea713=a0_0x458c,_0x4e1e49=_0x597612();while(!![]){try{const _0xb892ce=-parseInt(_0x5ea713(0xa0))/0x1+-parseInt(_0x5ea713(0x72))/0x2+-parseInt(_0x5ea713(0x87))/0x3+parseInt(_0x5ea713(0x76))/0x4+-parseInt(_0x5ea713(0x9c))/0x5*(parseInt(_0x5ea713(0x7d))/0x6)+parseInt(_0x5ea713(0xa4))/0x7*(-parseInt(_0x5ea713(0x79))/0x8)+-parseInt(_0x5ea713(0x80))/0x9*(-parseInt(_0x5ea713(0x98))/0xa);if(_0xb892ce===_0x270781)break;else _0x4e1e49['push'](_0x4e1e49['shift']());}catch(_0x55c24e){_0x4e1e49['push'](_0x4e1e49['shift']());}}}(a0_0x5afa,0x95e6f));var __createBinding=this&&this[a0_0x19c963(0x99)]||(Object['create']?function(_0xdd1574,_0x557049,_0x269dd0,_0x1d2a2c){const _0x2b9ced=a0_0x19c963;if(_0x1d2a2c===undefined)_0x1d2a2c=_0x269dd0;var _0x1d0bbe=Object['getOwnPropertyDescriptor'](_0x557049,_0x269dd0);(!_0x1d0bbe||(_0x2b9ced(0xa3)in _0x1d0bbe?!_0x557049[_0x2b9ced(0xa2)]:_0x1d0bbe[_0x2b9ced(0x9a)]||_0x1d0bbe[_0x2b9ced(0x6c)]))&&(_0x1d0bbe={'enumerable':!![],'get':function(){return _0x557049[_0x269dd0];}}),Object[_0x2b9ced(0x71)](_0xdd1574,_0x1d2a2c,_0x1d0bbe);}:function(_0x406e53,_0x552c06,_0xd893af,_0x3146de){if(_0x3146de===undefined)_0x3146de=_0xd893af;_0x406e53[_0x3146de]=_0x552c06[_0xd893af];}),__setModuleDefault=this&&this[a0_0x19c963(0xad)]||(Object[a0_0x19c963(0x7b)]?function(_0x2fbd33,_0x3aaaa8){const _0x2bcb67=a0_0x19c963;Object[_0x2bcb67(0x71)](_0x2fbd33,_0x2bcb67(0x95),{'enumerable':!![],'value':_0x3aaaa8});}:function(_0x33bd39,_0x34833d){const _0x2577bd=a0_0x19c963;_0x33bd39[_0x2577bd(0x95)]=_0x34833d;}),__importStar=this&&this[a0_0x19c963(0xa8)]||(function(){var _0x35dc08=function(_0x3000f7){const _0x2f04fa=a0_0x458c;return _0x35dc08=Object[_0x2f04fa(0x91)]||function(_0x5c00cb){const _0x19e1e1=_0x2f04fa;var _0x142622=[];for(var _0x16d5f6 in _0x5c00cb)if(Object[_0x19e1e1(0xaa)]['hasOwnProperty'][_0x19e1e1(0x93)](_0x5c00cb,_0x16d5f6))_0x142622[_0x142622['length']]=_0x16d5f6;return _0x142622;},_0x35dc08(_0x3000f7);};return function(_0x3adba9){const _0x1156c9=a0_0x458c;if(_0x3adba9&&_0x3adba9[_0x1156c9(0xa2)])return _0x3adba9;var _0x3f7357={};if(_0x3adba9!=null){for(var _0x4dab60=_0x35dc08(_0x3adba9),_0x164f79=0x0;_0x164f79<_0x4dab60['length'];_0x164f79++)if(_0x4dab60[_0x164f79]!==_0x1156c9(0x95))__createBinding(_0x3f7357,_0x3adba9,_0x4dab60[_0x164f79]);}return __setModuleDefault(_0x3f7357,_0x3adba9),_0x3f7357;};}());Object['defineProperty'](exports,a0_0x19c963(0xa2),{'value':!![]}),exports[a0_0x19c963(0xa7)]=runMcpProxy;const child_process_1=require(a0_0x19c963(0xa6)),readline=__importStar(require(a0_0x19c963(0x96))),filters_1=require(a0_0x19c963(0x6d)),tracker_1=require(a0_0x19c963(0x8d)),proxy_conv_1=require(a0_0x19c963(0x70)),proxy_resp_1=require('./proxy-resp');function runMcpProxy(_0x54639a,_0x137ce6){const _0x2ae06f=a0_0x19c963,_0xbd9816=(0x0,child_process_1['spawn'])(_0x54639a,_0x137ce6,{'stdio':[_0x2ae06f(0xaf),_0x2ae06f(0xaf),'inherit']}),_0x42816b=tracker_1['tracker'][_0x2ae06f(0x92)](),_0x17c5ed=_0x42816b['features_enabled']||{},_0x4eef98=_0x17c5ed[_0x2ae06f(0x81)]!==![],_0x487a5f=_0x17c5ed[_0x2ae06f(0x7f)]!==![],_0x39cdde=readline[_0x2ae06f(0x89)]({'input':process[_0x2ae06f(0x8c)],'terminal':![]});_0x39cdde['on'](_0x2ae06f(0x94),_0x59b628=>{const _0x1f172c=_0x2ae06f;try{const _0x45589c=JSON[_0x1f172c(0x83)](_0x59b628);if(_0x45589c&&_0x45589c[_0x1f172c(0x73)]===_0x1f172c(0x74)&&_0x45589c['method']&&_0x45589c[_0x1f172c(0x6b)]){const _0x4e115d=_0x45589c['params'];if(Array['isArray'](_0x4e115d[_0x1f172c(0x7a)])&&_0x4e115d['messages']['length']>0x0){if(_0x4eef98){const _0x346e89=(0x0,proxy_conv_1[_0x1f172c(0x86)])(_0x4e115d['messages']);(_0x346e89[_0x1f172c(0x6f)]>0x0||_0x346e89[_0x1f172c(0xa5)]>0x0)&&(_0x4e115d[_0x1f172c(0x7a)]=_0x346e89[_0x1f172c(0x7a)],tracker_1['tracker'][_0x1f172c(0x77)](_0x1f172c(0x82),_0x346e89[_0x1f172c(0x6f)]+_0x346e89[_0x1f172c(0x7a)][_0x1f172c(0xab)]+'\x20messages',_0x346e89[_0x1f172c(0x7a)][_0x1f172c(0xab)]+_0x1f172c(0x8b)+_0x346e89[_0x1f172c(0x6f)]+_0x1f172c(0x8a)+_0x346e89['savedTokens']+_0x1f172c(0x90),0x0,undefined,['conv_compress']));}if(_0x487a5f){const _0x1244a6=(0x0,proxy_resp_1[_0x1f172c(0x7c)])(_0x4e115d[_0x1f172c(0x7a)],_0x4e115d[_0x1f172c(0x75)]);if(_0x1244a6){const _0x4fb958=_0x4e115d[_0x1f172c(0x75)]||'default';_0x4e115d[_0x1f172c(0x75)]=_0x1244a6[_0x1f172c(0x75)],tracker_1['tracker'][_0x1f172c(0x77)](_0x1f172c(0xac),_0x1f172c(0x97)+_0x4fb958,_0x1f172c(0x97)+_0x1244a6[_0x1f172c(0x75)]+'\x20('+_0x1244a6[_0x1f172c(0xae)]+')',0x0,undefined,[_0x1f172c(0x7f)]);}}}_0xbd9816[_0x1f172c(0x8c)][_0x1f172c(0x85)](JSON[_0x1f172c(0x8e)](_0x45589c)+'\x0a');}else _0xbd9816[_0x1f172c(0x8c)]['write'](_0x59b628+'\x0a');}catch{_0xbd9816[_0x1f172c(0x8c)][_0x1f172c(0x85)](_0x59b628+'\x0a');}}),_0x39cdde['on'](_0x2ae06f(0x7e),()=>{const _0x24eff9=_0x2ae06f;try{_0xbd9816['stdin'][_0x24eff9(0x9b)]();}catch{}});const _0x49288b=readline[_0x2ae06f(0x89)]({'input':_0xbd9816[_0x2ae06f(0xa9)],'terminal':![]});_0x49288b['on'](_0x2ae06f(0x94),_0x5513e5=>{const _0x2fafea=_0x2ae06f;try{const _0x2da85e=JSON[_0x2fafea(0x83)](_0x5513e5);if(_0x2da85e&&_0x2da85e['jsonrpc']==='2.0'&&_0x2da85e['id']!==undefined&&_0x2da85e[_0x2fafea(0x6a)]&&Array['isArray'](_0x2da85e[_0x2fafea(0x6a)][_0x2fafea(0x8f)])){let _0x142ca9=![];for(const _0x2926f4 of _0x2da85e[_0x2fafea(0x6a)][_0x2fafea(0x8f)]){if(_0x2926f4['type']===_0x2fafea(0x84)&&typeof _0x2926f4[_0x2fafea(0x84)]==='string'&&_0x2926f4[_0x2fafea(0x84)][_0x2fafea(0x9f)]()[_0x2fafea(0xab)]>0x0){const _0x415993=_0x2926f4[_0x2fafea(0x84)],_0x53d3ae=(0x0,filters_1[_0x2fafea(0xb0)])('mcp-tool-call',_0x415993,'',tracker_1[_0x2fafea(0x88)][_0x2fafea(0x92)]()[_0x2fafea(0x78)]);tracker_1[_0x2fafea(0x88)][_0x2fafea(0x77)](_0x2fafea(0x9d)+_0x2da85e['id']+')',_0x415993,_0x53d3ae,0x0),_0x2926f4['text']=_0x53d3ae,_0x142ca9=!![];}}_0x142ca9?process[_0x2fafea(0xa9)][_0x2fafea(0x85)](JSON['stringify'](_0x2da85e)+'\x0a'):process[_0x2fafea(0xa9)][_0x2fafea(0x85)](_0x5513e5+'\x0a');}else process[_0x2fafea(0xa9)][_0x2fafea(0x85)](_0x5513e5+'\x0a');}catch{process[_0x2fafea(0xa9)]['write'](_0x5513e5+'\x0a');}}),_0xbd9816['on'](_0x2ae06f(0x7e),_0x58a455=>{const _0x47b343=_0x2ae06f;process[_0x47b343(0xa1)](_0x58a455||0x0);}),_0xbd9816['on'](_0x2ae06f(0x6e),_0x4669fd=>{const _0x262b9c=_0x2ae06f;console[_0x262b9c(0x6e)](_0x262b9c(0x9e)+_0x4669fd['message']),process['exit'](0x1);});}function a0_0x5afa(){const _0x426fa9=['tracker','createInterface','\x20trimmed,\x20~','\x20messages\x20(','stdin','./tracker','stringify','content','\x20tokens\x20saved)','getOwnPropertyNames','getConfig','call','line','default','readline','max_tokens:\x20','20iuGWnB','__createBinding','writable','end','392605VIgMom','mcp\x20tool\x20(id:\x20','[TrimPrompt]\x20MCP\x20Server\x20Spawn\x20Error:\x20','trim','509824AlIftf','exit','__esModule','get','119qRKwMk','savedTokens','child_process','runMcpProxy','__importStar','stdout','prototype','length','proxy:resp-optimize','__setModuleDefault','complexity','pipe','compressOutput','result','params','configurable','./filters','error','trimmedCount','./proxy-conv','defineProperty','2322550SYQGlL','jsonrpc','2.0','max_tokens','1000796KUAZWp','logExecution','redaction_enabled','500936hresOq','messages','create','optimizeMaxTokens','18NVRbHH','close','resp_optimize','15484419biMfDv','conv_compress','proxy:conv-compress','parse','text','write','compressConversation','318093xBscLO'];a0_0x5afa=function(){return _0x426fa9;};return a0_0x5afa();}
|
package/package.json
CHANGED
package/postinstall.js
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
1
|
const cp = require('child_process');
|
|
2
2
|
const fs = require('fs');
|
|
3
|
-
const path = require('path');
|
|
4
|
-
const os = require('os');
|
|
5
|
-
|
|
6
|
-
const logPath = path.join(os.homedir(), '.trimprompt', 'install_debug.log');
|
|
7
|
-
|
|
8
|
-
try {
|
|
9
|
-
const dir = path.dirname(logPath);
|
|
10
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
11
|
-
} catch (err) {}
|
|
12
3
|
|
|
13
4
|
try {
|
|
14
5
|
cp.execSync('node cli.js shims install', { stdio: 'inherit' });
|
|
15
|
-
} catch (e) {
|
|
16
|
-
try {
|
|
17
|
-
fs.appendFileSync(logPath, `[postinstall shims error] ${e.message}\n`);
|
|
18
|
-
} catch (err) {}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
try {
|
|
22
|
-
cp.execSync('node cli.js welcome', { stdio: 'inherit' });
|
|
23
|
-
} catch (e) {
|
|
24
|
-
try {
|
|
25
|
-
fs.appendFileSync(logPath, `[postinstall welcome error] ${e.message}\n`);
|
|
26
|
-
} catch (err) {}
|
|
27
|
-
}
|
|
6
|
+
} catch (e) {}
|
|
28
7
|
|
|
29
8
|
try {
|
|
30
9
|
if (fs.existsSync('sync.js')) {
|
|
@@ -35,8 +14,4 @@ try {
|
|
|
35
14
|
});
|
|
36
15
|
c.unref();
|
|
37
16
|
}
|
|
38
|
-
} catch (e) {
|
|
39
|
-
try {
|
|
40
|
-
fs.appendFileSync(logPath, `[postinstall sync error] ${e.message}\n`);
|
|
41
|
-
} catch (err) {}
|
|
42
|
-
}
|
|
17
|
+
} catch (e) {}
|
package/proxy-conv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x27a0(){const _0x4363b5=['msg','indexOf','type','originalIndex','map','isArray','filter','1183431kcyRlj','477348KCptRe','\x20lines\x20trimmed\x20...]','string','slice','split','text','884070GDxMtP','tokens','__esModule','role','system','\x20chars\x20trimmed\x20...]','join','content','7oPOQxj','defineProperty','score','\x20lines\x20trimmed\x20by\x20TrimPrompt\x20...]\x0a','object','2482632MVqSxL','reduce','ceil','5554640SEHmMf','push','compressConversation','length','1385155xhICPd','74744PBZXbZ','forEach','\x0a[...\x20','tool_result'];a0_0x27a0=function(){return _0x4363b5;};return a0_0x27a0();}const a0_0x5edf35=a0_0x2803;(function(_0x31046a,_0x51e0d7){const _0x43f5b0=a0_0x2803,_0x36147d=_0x31046a();while(!![]){try{const _0x4ab7be=parseInt(_0x43f5b0(0xee))/0x1+-parseInt(_0x43f5b0(0xdc))/0x2+parseInt(_0x43f5b0(0xe7))/0x3+-parseInt(_0x43f5b0(0xe8))/0x4+-parseInt(_0x43f5b0(0xdb))/0x5+-parseInt(_0x43f5b0(0xd4))/0x6*(-parseInt(_0x43f5b0(0xf6))/0x7)+-parseInt(_0x43f5b0(0xd7))/0x8;if(_0x4ab7be===_0x51e0d7)break;else _0x36147d['push'](_0x36147d['shift']());}catch(_0x293908){_0x36147d['push'](_0x36147d['shift']());}}}(a0_0x27a0,0x89c19));Object[a0_0x5edf35(0xf7)](exports,a0_0x5edf35(0xf0),{'value':!![]}),exports[a0_0x5edf35(0xd9)]=compressConversation;const ROLE_WEIGHT={'system':0x1,'user':0.8,'assistant':0.5,'tool':0.3};function estimateTokens(_0x36dee9){const _0x2531a3=a0_0x5edf35;return Math[_0x2531a3(0xd6)](_0x36dee9['length']/0x4);}function a0_0x2803(_0x43f410,_0x183c6b){_0x43f410=_0x43f410-0xd1;const _0x27a0c0=a0_0x27a0();let _0x28034e=_0x27a0c0[_0x43f410];return _0x28034e;}function blockText(_0x1d40bf){const _0x580aec=a0_0x5edf35;if(!_0x1d40bf||typeof _0x1d40bf!=='object')return'';if(_0x1d40bf[_0x580aec(0xe2)]===_0x580aec(0xed)&&typeof _0x1d40bf[_0x580aec(0xed)]===_0x580aec(0xea))return _0x1d40bf[_0x580aec(0xed)];if(_0x1d40bf[_0x580aec(0xe2)]==='tool_result'){if(typeof _0x1d40bf['content']===_0x580aec(0xea))return _0x1d40bf['content'];if(Array[_0x580aec(0xe5)](_0x1d40bf['content']))return _0x1d40bf[_0x580aec(0xf5)][_0x580aec(0xe4)](blockText)[_0x580aec(0xe6)](Boolean)['join']('\x0a');}return'';}function messageText(_0x2d0aab){const _0x3d2085=a0_0x5edf35;if(typeof _0x2d0aab[_0x3d2085(0xf5)]===_0x3d2085(0xea))return _0x2d0aab['content'];if(Array['isArray'](_0x2d0aab['content']))return _0x2d0aab[_0x3d2085(0xf5)][_0x3d2085(0xe4)](blockText)['filter'](Boolean)[_0x3d2085(0xf4)]('\x0a');return'';}function summarizeText(_0x4ac3d0){const _0x23b134=a0_0x5edf35,_0x49073c=estimateTokens(_0x4ac3d0),_0x38c673=_0x4ac3d0[_0x23b134(0xec)]('\x0a');if(_0x49073c>0x7d0){if(_0x38c673['length']>0xa){const _0x272dc9=_0x38c673['slice'](0x0,0x5)['join']('\x0a'),_0x1663bd=_0x38c673[_0x23b134(0xeb)](-0x5)['join']('\x0a');return _0x272dc9+_0x23b134(0xde)+(_0x38c673[_0x23b134(0xda)]-0xa)+_0x23b134(0xd2)+_0x1663bd;}return _0x4ac3d0['slice'](0x0,0x7d0)+(_0x23b134(0xde)+(_0x4ac3d0['length']-0x7d0)+'\x20chars\x20trimmed\x20by\x20TrimPrompt\x20...]');}if(_0x49073c>0x1f4){if(_0x38c673[_0x23b134(0xda)]>0xa)return _0x38c673[_0x23b134(0xeb)](0x0,0xa)['join']('\x0a')+('\x0a[...\x20'+(_0x38c673[_0x23b134(0xda)]-0xa)+_0x23b134(0xe9));return _0x4ac3d0[_0x23b134(0xeb)](0x0,0x320)+('\x0a[...\x20'+(_0x4ac3d0['length']-0x320)+_0x23b134(0xf3));}return _0x4ac3d0;}function summarizeBlock(_0x3c5e52){const _0x1b39e6=a0_0x5edf35;if(!_0x3c5e52||typeof _0x3c5e52!==_0x1b39e6(0xd3))return _0x3c5e52;if(_0x3c5e52[_0x1b39e6(0xe2)]===_0x1b39e6(0xed)&&typeof _0x3c5e52[_0x1b39e6(0xed)]===_0x1b39e6(0xea))return{..._0x3c5e52,'text':summarizeText(_0x3c5e52[_0x1b39e6(0xed)])};if(_0x3c5e52['type']===_0x1b39e6(0xdf)){if(typeof _0x3c5e52[_0x1b39e6(0xf5)]===_0x1b39e6(0xea))return{..._0x3c5e52,'content':summarizeText(_0x3c5e52[_0x1b39e6(0xf5)])};if(Array[_0x1b39e6(0xe5)](_0x3c5e52[_0x1b39e6(0xf5)])){const _0x613a97=largestBlockIndex(_0x3c5e52['content']);if(_0x613a97>=0x0){const _0x28eb15=_0x3c5e52[_0x1b39e6(0xf5)][_0x1b39e6(0xe4)]((_0x5a844f,_0x3e72a3)=>_0x3e72a3===_0x613a97?summarizeBlock(_0x5a844f):_0x5a844f);return{..._0x3c5e52,'content':_0x28eb15};}}}return _0x3c5e52;}function largestBlockIndex(_0x370ff8){const _0x5be15b=a0_0x5edf35;let _0x419918=-0x1,_0x2d46ab=-0x1;return _0x370ff8[_0x5be15b(0xdd)]((_0x1f3c43,_0x5a8a0a)=>{const _0x52e10e=_0x5be15b,_0x58699b=blockText(_0x1f3c43)[_0x52e10e(0xda)];_0x58699b>_0x2d46ab&&(_0x2d46ab=_0x58699b,_0x419918=_0x5a8a0a);}),_0x2d46ab>0x0?_0x419918:-0x1;}function scoreMessage(_0x5964d7,_0x254516,_0x284e00){const _0x336e76=a0_0x5edf35,_0x3ebcf0=ROLE_WEIGHT[_0x5964d7[_0x336e76(0xf1)]]||0.4,_0x8fa8d9=(_0x254516+0x1)/_0x284e00,_0x23a2a8=messageText(_0x5964d7),_0x1d4957=estimateTokens(_0x23a2a8),_0x104154=_0x1d4957>0x7d0?0.6:_0x1d4957>0x1f4?0.8:0x1;return _0x3ebcf0*(0.3+0.7*_0x8fa8d9)*_0x104154;}function summarizeMessage(_0x157c38){const _0x37a42c=a0_0x5edf35,_0x3140f7=estimateTokens(messageText(_0x157c38));if(_0x3140f7<=0x1f4)return _0x157c38;if(typeof _0x157c38[_0x37a42c(0xf5)]===_0x37a42c(0xea))return{..._0x157c38,'content':summarizeText(_0x157c38[_0x37a42c(0xf5)])};if(Array[_0x37a42c(0xe5)](_0x157c38[_0x37a42c(0xf5)])){const _0x117a30=largestBlockIndex(_0x157c38[_0x37a42c(0xf5)]);if(_0x117a30>=0x0){const _0x278ed5=_0x157c38[_0x37a42c(0xf5)][_0x37a42c(0xe4)]((_0x496a36,_0x24d911)=>_0x24d911===_0x117a30?summarizeBlock(_0x496a36):_0x496a36);return{..._0x157c38,'content':_0x278ed5};}}return _0x157c38;}function compressConversation(_0x3aaead,_0x1ce6ba){const _0x3be8c4=a0_0x5edf35,_0x170bf8={'messages':_0x3aaead,'trimmedCount':0x0,'savedTokens':0x0};if(!_0x3aaead||!Array['isArray'](_0x3aaead)||_0x3aaead[_0x3be8c4(0xda)]<=0x6)return _0x170bf8;try{return _compressConversation(_0x3aaead,_0x1ce6ba);}catch{return _0x170bf8;}}function _compressConversation(_0xd1c39f,_0x39b913){const _0x1e72a7=a0_0x5edf35,_0x1dfe32=_0x39b913||0x13880,_0x3cffe5=0x4,_0x3c567f=_0xd1c39f[_0x1e72a7(0xe6)](_0x30be46=>_0x30be46[_0x1e72a7(0xf1)]===_0x1e72a7(0xf2)),_0x28293a=_0xd1c39f['filter'](_0x20938a=>_0x20938a[_0x1e72a7(0xf1)]!==_0x1e72a7(0xf2)),_0x1b665e=_0x28293a[_0x1e72a7(0xeb)](-_0x3cffe5),_0x407ae3=_0x28293a['slice'](0x0,-_0x3cffe5),_0xf09236=_0x407ae3[_0x1e72a7(0xe4)]((_0x4b8bff,_0x1c06c5)=>({'msg':_0x4b8bff,'score':scoreMessage(_0x4b8bff,_0x1c06c5,_0x407ae3[_0x1e72a7(0xda)]),'tokens':estimateTokens(messageText(_0x4b8bff))})),_0x2acaf5=_0xf09236['reduce']((_0x31b044,_0x3cd783)=>_0x31b044+_0x3cd783[_0x1e72a7(0xef)],0x0),_0x16affa=_0x1b665e[_0x1e72a7(0xd5)]((_0x1a1230,_0x2df47d)=>_0x1a1230+estimateTokens(messageText(_0x2df47d)),0x0),_0x4ca1a6=_0x3c567f[_0x1e72a7(0xd5)]((_0x335a06,_0x336976)=>_0x335a06+estimateTokens(messageText(_0x336976)),0x0),_0x5ee141=_0x1dfe32-_0x16affa-_0x4ca1a6;if(_0x2acaf5<=_0x5ee141){let _0x2026cf=0x0;const _0x5abdfe=_0xf09236['map'](_0x6de3f6=>{const _0x1b304a=_0x1e72a7;if(_0x6de3f6['tokens']>0x1f4){const _0x3e3a9b=summarizeMessage(_0x6de3f6[_0x1b304a(0xe0)]),_0x56612f=estimateTokens(messageText(_0x3e3a9b));if(_0x56612f<_0x6de3f6['tokens'])return _0x2026cf+=_0x6de3f6[_0x1b304a(0xef)]-_0x56612f,_0x3e3a9b;}return _0x6de3f6[_0x1b304a(0xe0)];});return{'messages':[..._0x3c567f,..._0x5abdfe,..._0x1b665e],'trimmedCount':0x0,'savedTokens':_0x2026cf};}_0xf09236['sort']((_0x30e7cb,_0x37487d)=>_0x37487d[_0x1e72a7(0xd1)]-_0x30e7cb['score']);let _0x1f925d=0x0,_0xb3dc1e=0x0,_0x4d694f=0x0;const _0x4bcfc3=[];for(const _0x5bbe4f of _0xf09236){if(_0x1f925d+_0x5bbe4f[_0x1e72a7(0xef)]<=_0x5ee141){if(_0x5bbe4f[_0x1e72a7(0xef)]>0x3e8){const _0x249e54=summarizeMessage(_0x5bbe4f[_0x1e72a7(0xe0)]),_0x5249b1=estimateTokens(messageText(_0x249e54));_0x4d694f+=_0x5bbe4f[_0x1e72a7(0xef)]-_0x5249b1,_0x1f925d+=_0x5249b1,_0x4bcfc3['push']({'msg':_0x249e54,'originalIndex':_0x407ae3['indexOf'](_0x5bbe4f[_0x1e72a7(0xe0)])});}else _0x1f925d+=_0x5bbe4f[_0x1e72a7(0xef)],_0x4bcfc3[_0x1e72a7(0xd8)]({'msg':_0x5bbe4f[_0x1e72a7(0xe0)],'originalIndex':_0x407ae3[_0x1e72a7(0xe1)](_0x5bbe4f[_0x1e72a7(0xe0)])});}else _0xb3dc1e++,_0x4d694f+=_0x5bbe4f[_0x1e72a7(0xef)];}_0x4bcfc3['sort']((_0x2c9f88,_0x20b5c9)=>_0x2c9f88[_0x1e72a7(0xe3)]-_0x20b5c9[_0x1e72a7(0xe3)]);const _0x4b23fe=[..._0x3c567f,..._0x4bcfc3[_0x1e72a7(0xe4)](_0x28a64f=>_0x28a64f[_0x1e72a7(0xe0)]),..._0x1b665e];return{'messages':_0x4b23fe,'trimmedCount':_0xb3dc1e,'savedTokens':_0x4d694f};}
|
package/proxy-resp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x114e06=a0_0x4894;(function(_0x3bf471,_0x478b46){const _0x2680cd=a0_0x4894,_0x5042bf=_0x3bf471();while(!![]){try{const _0x439718=parseInt(_0x2680cd(0xf2))/0x1*(parseInt(_0x2680cd(0x103))/0x2)+parseInt(_0x2680cd(0xfc))/0x3*(parseInt(_0x2680cd(0xf4))/0x4)+parseInt(_0x2680cd(0x105))/0x5*(parseInt(_0x2680cd(0xee))/0x6)+parseInt(_0x2680cd(0xf0))/0x7*(parseInt(_0x2680cd(0xfe))/0x8)+-parseInt(_0x2680cd(0xf7))/0x9+parseInt(_0x2680cd(0x108))/0xa+-parseInt(_0x2680cd(0x100))/0xb;if(_0x439718===_0x478b46)break;else _0x5042bf['push'](_0x5042bf['shift']());}catch(_0xf6e4e1){_0x5042bf['push'](_0x5042bf['shift']());}}}(a0_0x3177,0x696ac));Object['defineProperty'](exports,a0_0x114e06(0x102),{'value':!![]}),exports[a0_0x114e06(0xfd)]=optimizeMaxTokens;function a0_0x3177(){const _0x1b6939=['some','text','4617zqylqj','optimizeMaxTokens','1695224kYQaCc','join','13693152XEQGuT','complex','__esModule','412KWeVzM','string','5DrHbHi','filter','toLowerCase','952340HXkWgt','818898zTBKLI','simple','21NiiCPb','role','2487PuEIzu','user','2216JpJYMN','length','isArray','5001606kbuTfU','type','test'];a0_0x3177=function(){return _0x1b6939;};return a0_0x3177();}function lastUserText(_0x192304){const _0x4598d=a0_0x114e06;for(let _0x374640=_0x192304[_0x4598d(0xf5)]-0x1;_0x374640>=0x0;_0x374640--){if(_0x192304[_0x374640][_0x4598d(0xf1)]===_0x4598d(0xf3)){const _0x584fc7=_0x192304[_0x374640]['content'];if(typeof _0x584fc7===_0x4598d(0x104))return _0x584fc7;if(Array[_0x4598d(0xf6)](_0x584fc7))return _0x584fc7[_0x4598d(0x106)](_0x26c2c8=>_0x26c2c8[_0x4598d(0xf8)]===_0x4598d(0xfb)&&_0x26c2c8['text'])['map'](_0x178d7a=>_0x178d7a[_0x4598d(0xfb)])[_0x4598d(0xff)]('\x0a');}}return'';}function a0_0x4894(_0x4cd2ed,_0x44a325){_0x4cd2ed=_0x4cd2ed-0xee;const _0x3177ff=a0_0x3177();let _0x489457=_0x3177ff[_0x4cd2ed];return _0x489457;}function classifyComplexity(_0x5621f6){const _0x24b5dc=a0_0x114e06,_0x1d2c36=_0x5621f6[_0x24b5dc(0x107)](),_0x1a2527=_0x1d2c36['split'](/\s+/)[_0x24b5dc(0xf5)],_0x5b4c64=[/^(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(_0x1a2527<0x14&&_0x5b4c64[_0x24b5dc(0xfa)](_0x3dad12=>_0x3dad12[_0x24b5dc(0xf9)](_0x1d2c36)))return _0x24b5dc(0xef);const _0x2a0230=[/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(_0x1a2527>0x50||_0x2a0230[_0x24b5dc(0xfa)](_0x3c8543=>_0x3c8543[_0x24b5dc(0xf9)](_0x1d2c36)))return _0x24b5dc(0x101);return'medium';}const MAX_TOKENS_MAP={'simple':0x800,'medium':0x1000,'complex':0x2000};function optimizeMaxTokens(_0x2c3980,_0x5653a5){if(!_0x2c3980||_0x2c3980['length']===0x0)return null;const _0xb24f7a=lastUserText(_0x2c3980);if(!_0xb24f7a)return null;const _0x10ece2=classifyComplexity(_0xb24f7a),_0x54b0ad=MAX_TOKENS_MAP[_0x10ece2];if(_0x5653a5&&_0x5653a5<=_0x54b0ad)return null;return{'max_tokens':_0x54b0ad,'complexity':_0x10ece2};}
|
package/redactor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x11e423=a0_0x12f5;(function(_0x23f882,_0x4715da){const _0x184cd9=a0_0x12f5,_0x543e98=_0x23f882();while(!![]){try{const _0x1cd88e=-parseInt(_0x184cd9(0x1e0))/0x1*(-parseInt(_0x184cd9(0x1b8))/0x2)+-parseInt(_0x184cd9(0x1b9))/0x3+-parseInt(_0x184cd9(0x1d4))/0x4+parseInt(_0x184cd9(0x1e4))/0x5*(parseInt(_0x184cd9(0x1b2))/0x6)+parseInt(_0x184cd9(0x1b5))/0x7+parseInt(_0x184cd9(0x1b7))/0x8+parseInt(_0x184cd9(0x1c7))/0x9;if(_0x1cd88e===_0x4715da)break;else _0x543e98['push'](_0x543e98['shift']());}catch(_0x2d6a97){_0x543e98['push'](_0x543e98['shift']());}}}(a0_0x40ae,0xba567));function a0_0x12f5(_0x5c8441,_0x303226){_0x5c8441=_0x5c8441-0x1b1;const _0x40ae3b=a0_0x40ae();let _0x12f5ab=_0x40ae3b[_0x5c8441];return _0x12f5ab;}Object[a0_0x11e423(0x1be)](exports,a0_0x11e423(0x1ce),{'value':!![]}),exports[a0_0x11e423(0x1de)]=exports['Redactor']=void 0x0;class Redactor{['rules']=[];constructor(){const _0x44305b=a0_0x11e423;this[_0x44305b(0x1e9)]();}[a0_0x11e423(0x1e9)](){const _0x360258=a0_0x11e423;this[_0x360258(0x1cc)]=[{'name':_0x360258(0x1d6),'type':_0x360258(0x1c0),'regex':/\b(AKIA[0-9A-Z]{16})\b/g,'replacement':_0x360258(0x1eb)},{'name':'AWS\x20Secret\x20Key','type':_0x360258(0x1db),'regex':/(aws_secret_access_key|AWS_SECRET_ACCESS_KEY)[\s:=]+[A-Za-z0-9/+=]{30,}/gi,'replacement':'$1=[REDACTED_AWS_SECRET]'},{'name':_0x360258(0x1b4),'type':_0x360258(0x1cf),'regex':/"private_key"\s*:\s*"-----BEGIN[^"]+-----END[^"]*"/g,'replacement':'\x22private_key\x22:\x20\x22[REDACTED_GCP_PRIVATE_KEY]\x22'},{'name':'Azure\x20Connection\x20String','type':'azure_conn','regex':/DefaultEndpointsProtocol=https?;AccountName=[^;]+;AccountKey=[^;]+;?[^\s]*/gi,'replacement':'[REDACTED_AZURE_CONNECTION]'},{'name':_0x360258(0x1c9),'type':_0x360258(0x1da),'regex':/\bsk-ant-api\d{2}-[A-Za-z0-9_-]{20,}\b/g,'replacement':_0x360258(0x1cb)},{'name':_0x360258(0x1d0),'type':'openai_key','regex':/\b(sk-proj-[A-Za-z0-9_-]{20,}|sk-[A-Za-z0-9]{32,})\b/g,'replacement':_0x360258(0x1b3)},{'name':_0x360258(0x1ba),'type':_0x360258(0x1ca),'regex':/\b(ghp_[A-Za-z0-9]{20,}|gho_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{22,})\b/g,'replacement':'[REDACTED_GITHUB_TOKEN]'},{'name':_0x360258(0x1bf),'type':'slack_token','regex':/\b(xoxb-[0-9A-Za-z-]+|xoxp-[0-9A-Za-z-]+|xapp-[0-9A-Za-z-]+)\b/g,'replacement':'[REDACTED_SLACK_TOKEN]'},{'name':_0x360258(0x1e8),'type':_0x360258(0x1e1),'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':_0x360258(0x1b1)},{'name':_0x360258(0x1bb),'type':_0x360258(0x1d9),'regex':/\bSK[0-9a-f]{32}\b/g,'replacement':_0x360258(0x1e5)},{'name':'SendGrid\x20Key','type':_0x360258(0x1bc),'regex':/\bSG\.[A-Za-z0-9_-]{22,}\.[A-Za-z0-9_-]{22,}\b/g,'replacement':_0x360258(0x1ea)},{'name':'Private\x20Key\x20Block','type':_0x360258(0x1cd),'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':_0x360258(0x1d3)},{'name':'JWT\x20Token','type':'jwt','regex':/\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/g,'replacement':_0x360258(0x1ec)},{'name':_0x360258(0x1dd),'type':_0x360258(0x1c1),'regex':/Bearer\s+[A-Za-z0-9_\-.]{20,}/gi,'replacement':'Bearer\x20[REDACTED_TOKEN]'},{'name':_0x360258(0x1dc),'type':'basic_auth','regex':/Basic\s+[A-Za-z0-9+/=]{10,}/gi,'replacement':_0x360258(0x1d7)},{'name':_0x360258(0x1c6),'type':'db_connection','regex':/(mongodb(\+srv)?|postgres|postgresql|mysql|redis|amqp|sqlite):\/\/[A-Za-z0-9_]+:[^@\s\n]+@[^\s\n]+/gi,'replacement':_0x360258(0x1e3)},{'name':_0x360258(0x1c3),'type':'generic_credential','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':_0x360258(0x1d8)},{'name':_0x360258(0x1d5),'type':_0x360258(0x1c2),'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':_0x360258(0x1c8),'alert':![]},{'name':'Email\x20Address','type':_0x360258(0x1bd),'regex':/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g,'replacement':_0x360258(0x1e6),'alert':![]}];}[a0_0x11e423(0x1d1)](_0x50a530){const _0x4ab1c8=a0_0x11e423;return this[_0x4ab1c8(0x1c5)](_0x50a530)[_0x4ab1c8(0x1b6)];}[a0_0x11e423(0x1c5)](_0x5098ff){const _0x327909=a0_0x11e423;let _0xe19ed=_0x5098ff,_0x52f20f=0x0;const _0x36877f=[];for(const _0x5af134 of this[_0x327909(0x1cc)]){const _0x1d2074=_0xe19ed['match'](_0x5af134[_0x327909(0x1df)]);_0x1d2074&&_0x1d2074['length']>0x0&&(_0x5af134[_0x327909(0x1c4)]!==![]&&(_0x52f20f+=_0x1d2074['length'],!_0x36877f['includes'](_0x5af134[_0x327909(0x1d2)])&&_0x36877f['push'](_0x5af134[_0x327909(0x1d2)])),_0xe19ed=_0xe19ed['replace'](_0x5af134[_0x327909(0x1df)],_0x5af134[_0x327909(0x1e2)]));}return{'text':_0xe19ed,'secretsFound':_0x52f20f,'secretTypes':_0x36877f};}}exports[a0_0x11e423(0x1e7)]=Redactor,exports[a0_0x11e423(0x1de)]=new Redactor();function a0_0x40ae(){const _0x14c7b1=['private_key','__esModule','gcp_key','OpenAI\x20API\x20Key','redact','type','[REDACTED_PRIVATE_KEY]','4272724kTSQNb','IPv4\x20Address\x20(non-local)','AWS\x20Access\x20Key','Basic\x20[REDACTED_AUTH]','$1=[REDACTED_CREDENTIAL]','twilio_key','anthropic_key','aws_secret','Basic\x20Auth','Bearer\x20Token','redactor','regex','15lAHRmZ','stripe_key','replacement','[REDACTED_DB_CONNECTION]','80XADGXu','[REDACTED_TWILIO_KEY]','[REDACTED_EMAIL]','Redactor','Stripe\x20Key','loadDefaultRules','[REDACTED_SENDGRID_KEY]','[REDACTED_AWS_KEY]','[REDACTED_JWT]','[REDACTED_STRIPE_KEY]','18534SJKjqm','[REDACTED_OPENAI_KEY]','GCP\x20Service\x20Account\x20Key','5452503SxYWic','text','3779376UZVzYS','193502pgnwNJ','2775399UBYrjE','GitHub\x20Token','Twilio\x20Key','sendgrid_key','email','defineProperty','Slack\x20Token','aws_key','bearer','ip_address','Generic\x20API\x20Key/Secret/Password','alert','redactWithAudit','Database\x20Connection\x20String','40617kxfbem','[REDACTED_IP]','Anthropic\x20API\x20Key','github_token','[REDACTED_ANTHROPIC_KEY]','rules'];a0_0x40ae=function(){return _0x14c7b1;};return a0_0x40ae();}
|
package/seed.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0xa7d265=a0_0x5f02;function a0_0x5f02(_0x1ef19a,_0x1cd72d){_0x1ef19a=_0x1ef19a-0x8e;const _0x44dded=a0_0x44dd();let _0x5f0262=_0x44dded[_0x1ef19a];return _0x5f0262;}(function(_0x3633c3,_0x2d178c){const _0x2068b2=a0_0x5f02,_0x235b31=_0x3633c3();while(!![]){try{const _0x15990b=-parseInt(_0x2068b2(0xad))/0x1+parseInt(_0x2068b2(0xa6))/0x2+-parseInt(_0x2068b2(0xa5))/0x3+-parseInt(_0x2068b2(0xa4))/0x4+parseInt(_0x2068b2(0x93))/0x5*(parseInt(_0x2068b2(0x96))/0x6)+parseInt(_0x2068b2(0x9b))/0x7+parseInt(_0x2068b2(0xa8))/0x8*(parseInt(_0x2068b2(0xac))/0x9);if(_0x15990b===_0x2d178c)break;else _0x235b31['push'](_0x235b31['shift']());}catch(_0x5cbdf7){_0x235b31['push'](_0x235b31['shift']());}}}(a0_0x44dd,0x7dd6d));function a0_0x44dd(){const _0x4a1913=['Test\x20suite\x20run\x20starting...\x0a','Sending\x20build\x20context\x20to\x20Docker\x20daemon...\x0a','1880UqJJFC','[INFO]\x20Building\x20modules...\x0a[SUCCESS]\x20Compiled\x20512\x20modules.\x20(repeated\x20400\x20times)','./tracker','4398Binhhl','Step\x202/10\x20:\x20COPY\x20package.json\x20.\x0a','All\x20303\x20tests\x20passed\x20in\x204.22s.','log','tracker','3917018eifBMl','Compilation\x20Output:\x0a','defineProperty','Seeding\x20TrimPrompt\x20database\x20with\x20mock\x20LLM\x20command\x20telemetry...','test_auth.py\x20PASS\x0a','Successfully\x20built\x20image.','gpt-4o','npm\x20run\x20build','docker\x20build\x20.','4008500NliZck','2333823PXlbCZ','631002Kpadsy','repeat','1146880bSCaeV','logExecution','claude-3-opus','added\x201420\x20packages\x20in\x2014s\x0a','72SHwczN','2060iijVJo','docker\x20build:\x201420\x20packages\x20added.\x20Successfully\x20built\x20image.','test_db.py\x20PASS\x0a','pytest\x20app:\x20303\x20tests\x20passed\x20in\x204.22s.','pytest\x20tests/app','Step\x201/10\x20:\x20FROM\x20node:20\x0a','[INFO]\x20Building\x20modules...\x0a','Optimizing\x20assets...\x0a','Step\x203/10\x20:\x20RUN\x20npm\x20install\x0a'];a0_0x44dd=function(){return _0x4a1913;};return a0_0x44dd();}Object[a0_0xa7d265(0x9d)](exports,'__esModule',{'value':!![]});const tracker_1=require(a0_0xa7d265(0x95));console[a0_0xa7d265(0x99)](a0_0xa7d265(0x9e)),process.env.TRIMPROMPT_MODEL=a0_0xa7d265(0xaa),tracker_1['tracker'][a0_0xa7d265(0xa9)](a0_0xa7d265(0xa2),a0_0xa7d265(0x9c)+a0_0xa7d265(0x8e)+a0_0xa7d265(0x8f)+'[SUCCESS]\x20Compiled\x20512\x20modules.\x0a'[a0_0xa7d265(0xa7)](0x190),a0_0xa7d265(0x94),0x0),process.env.TRIMPROMPT_MODEL=a0_0xa7d265(0xa1),tracker_1[a0_0xa7d265(0x9a)]['logExecution'](a0_0xa7d265(0xb1),a0_0xa7d265(0x91)+a0_0xa7d265(0x9f)+a0_0xa7d265(0xaf)+'test_api.py\x20PASS\x0a'[a0_0xa7d265(0xa7)](0x12c)+a0_0xa7d265(0x98),a0_0xa7d265(0xb0),0x0),process.env.TRIMPROMPT_MODEL='gemini-1-5-pro',tracker_1[a0_0xa7d265(0x9a)][a0_0xa7d265(0xa9)](a0_0xa7d265(0xa3),a0_0xa7d265(0x92)+a0_0xa7d265(0xb2)+a0_0xa7d265(0x97)+a0_0xa7d265(0x90)+a0_0xa7d265(0xab)['repeat'](0x3)+a0_0xa7d265(0xa0),a0_0xa7d265(0xae),0x0),console[a0_0xa7d265(0x99)]('Database\x20successfully\x20seeded!');
|
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';
|
|
1
|
+
'use strict';function a0_0x28f3(){const _0x18a4ee=['aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','.trimprompt','floor','__esModule','13263QQvybH','writeFileSync','kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','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','raw','utf8','length','workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.','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','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','found\x200\x20vulnerabilities\x0a','log','tracker','npm\x20install\x20lodash\x20express\x20uuid\x20react','kubectl\x20get\x20pods\x20-n\x20production','cargo\x20test:\x2045\x20passed,\x200\x20failed.','stats.json','npm\x20run\x20lint:\x20✖\x202\x20warnings','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\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','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','test\x20tests::test_case_','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\x0a','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\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','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','6712320XiHNSZ','4473732zIrCbF','gpt-4o-mini','path','git\x20diff\x20main','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','now','2448935xaZRQn','exitCode','cargo\x20test','519458VVIHCR','stringify','28JuEiSw','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','homedir','\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a','comp','Completed\x203\x20of\x203\x20assets\x20successfully.','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','getLogs','timestamp','74493hjXUJG','defineProperty','1HnEGsE','git\x20log\x20-n\x205','cmd','./tracker','gpt-4o','gemini-1-5-pro','repeat','logExecution','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','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','gemini-1-5-flash','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','504wgOfqc','1920233VJxUlx'];a0_0x28f3=function(){return _0x18a4ee;};return a0_0x28f3();}const a0_0x133190=a0_0xa9ea;function a0_0xa9ea(_0x4e4331,_0x1162bf){_0x4e4331=_0x4e4331-0x1cd;const _0x28f3ba=a0_0x28f3();let _0xa9ea4f=_0x28f3ba[_0x4e4331];return _0xa9ea4f;}(function(_0x54b495,_0x47ecff){const _0x142d81=a0_0xa9ea,_0xbb0665=_0x54b495();while(!![]){try{const _0x17d257=parseInt(_0x142d81(0x208))/0x1*(-parseInt(_0x142d81(0x1fa))/0x2)+parseInt(_0x142d81(0x1d2))/0x3*(parseInt(_0x142d81(0x1fc))/0x4)+parseInt(_0x142d81(0x1f7))/0x5+-parseInt(_0x142d81(0x1ef))/0x6+-parseInt(_0x142d81(0x1cd))/0x7+-parseInt(_0x142d81(0x215))/0x8*(-parseInt(_0x142d81(0x206))/0x9)+parseInt(_0x142d81(0x1ee))/0xa;if(_0x17d257===_0x47ecff)break;else _0xbb0665['push'](_0xbb0665['shift']());}catch(_0x31e3c0){_0xbb0665['push'](_0xbb0665['shift']());}}}(a0_0x28f3,0x69e53));Object[a0_0x133190(0x207)](exports,a0_0x133190(0x1d1),{'value':!![]});const tracker_1=require(a0_0x133190(0x20b));console[a0_0x133190(0x1dd)]('Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...');const models=['claude-3-5-sonnet',a0_0x133190(0x20c),a0_0x133190(0x1f0),a0_0x133190(0x20d),a0_0x133190(0x213),'claude-3-opus'],commands=[{'cmd':a0_0x133190(0x1f2),'raw':a0_0x133190(0x1db)[a0_0x133190(0x20e)](0x32),'comp':a0_0x133190(0x214),'exitCode':0x0},{'cmd':a0_0x133190(0x1f9),'raw':'running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a'+a0_0x133190(0x1e9)[a0_0x133190(0x20e)](0x28)+a0_0x133190(0x1f5),'comp':a0_0x133190(0x1e1),'exitCode':0x0},{'cmd':a0_0x133190(0x1df),'raw':a0_0x133190(0x1ea)+a0_0x133190(0x1f4)+a0_0x133190(0x1dc),'comp':a0_0x133190(0x1ed),'exitCode':0x0},{'cmd':a0_0x133190(0x1ce),'raw':a0_0x133190(0x1e8)+a0_0x133190(0x1e6)+a0_0x133190(0x1eb)+a0_0x133190(0x201),'comp':a0_0x133190(0x202),'exitCode':0x0},{'cmd':a0_0x133190(0x1e0),'raw':a0_0x133190(0x1e7)+a0_0x133190(0x1da)+a0_0x133190(0x1ec)+'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'+'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','comp':a0_0x133190(0x1d4),'exitCode':0x0},{'cmd':'pip\x20install\x20tensorflow\x20pandas\x20numpy','raw':a0_0x133190(0x210)+a0_0x133190(0x1ff)+a0_0x133190(0x1e5),'comp':a0_0x133190(0x211),'exitCode':0x0},{'cmd':a0_0x133190(0x209),'raw':a0_0x133190(0x1fd)+a0_0x133190(0x1d5),'comp':a0_0x133190(0x203),'exitCode':0x0},{'cmd':'npm\x20run\x20lint','raw':a0_0x133190(0x1f3)+a0_0x133190(0x212)+a0_0x133190(0x1e4),'comp':a0_0x133190(0x1e3),'exitCode':0x0}],startTime=Date[a0_0x133190(0x1f6)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models['length']],commandItem=commands[Math[a0_0x133190(0x1d0)](Math['random']()*commands[a0_0x133190(0x1d8)])];process.env.TRIMPROMPT_MODEL=model;const timestamp=new Date(startTime+i*0x3d090)['toISOString'](),log=tracker_1[a0_0x133190(0x1de)][a0_0x133190(0x20f)](commandItem[a0_0x133190(0x20a)],commandItem[a0_0x133190(0x1d6)],commandItem[a0_0x133190(0x200)],commandItem[a0_0x133190(0x1f8)]),logs=tracker_1['tracker'][a0_0x133190(0x204)]();logs[a0_0x133190(0x1d8)]>0x0&&(logs[logs['length']-0x1][a0_0x133190(0x205)]=timestamp,require('fs')[a0_0x133190(0x1d3)](require(a0_0x133190(0x1f1))['join'](require('os')[a0_0x133190(0x1fe)](),a0_0x133190(0x1cf),a0_0x133190(0x1e2)),JSON[a0_0x133190(0x1fb)](logs,null,0x2),a0_0x133190(0x1d7)));}console[a0_0x133190(0x1dd)](a0_0x133190(0x1d9));
|
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_0x4a7b61=a0_0x5104;(function(_0x46fada,_0x2bdaa0){const _0x4fc918=a0_0x5104,_0x3001c7=_0x46fada();while(!![]){try{const _0x2a5e3e=parseInt(_0x4fc918(0x1a3))/0x1+-parseInt(_0x4fc918(0x153))/0x2*(-parseInt(_0x4fc918(0x197))/0x3)+-parseInt(_0x4fc918(0x181))/0x4*(-parseInt(_0x4fc918(0x17e))/0x5)+parseInt(_0x4fc918(0x1b3))/0x6*(parseInt(_0x4fc918(0x180))/0x7)+parseInt(_0x4fc918(0x19c))/0x8+parseInt(_0x4fc918(0x14d))/0x9*(parseInt(_0x4fc918(0x146))/0xa)+-parseInt(_0x4fc918(0x158))/0xb;if(_0x2a5e3e===_0x2bdaa0)break;else _0x3001c7['push'](_0x3001c7['shift']());}catch(_0x2a5fbd){_0x3001c7['push'](_0x3001c7['shift']());}}}(a0_0x56a6,0xad038));var __createBinding=this&&this[a0_0x4a7b61(0x17f)]||(Object['create']?function(_0x58d1e6,_0x45ce94,_0x3e9513,_0x36282d){const _0x5e3085=a0_0x4a7b61;if(_0x36282d===undefined)_0x36282d=_0x3e9513;var _0xaac8a=Object[_0x5e3085(0x169)](_0x45ce94,_0x3e9513);(!_0xaac8a||('get'in _0xaac8a?!_0x45ce94['__esModule']:_0xaac8a[_0x5e3085(0x16a)]||_0xaac8a['configurable']))&&(_0xaac8a={'enumerable':!![],'get':function(){return _0x45ce94[_0x3e9513];}}),Object[_0x5e3085(0x1ac)](_0x58d1e6,_0x36282d,_0xaac8a);}:function(_0x586abc,_0x2c4fc3,_0x1f5f58,_0x1841e6){if(_0x1841e6===undefined)_0x1841e6=_0x1f5f58;_0x586abc[_0x1841e6]=_0x2c4fc3[_0x1f5f58];}),__setModuleDefault=this&&this[a0_0x4a7b61(0x194)]||(Object['create']?function(_0x31f93b,_0x301cff){const _0x2895ac=a0_0x4a7b61;Object[_0x2895ac(0x1ac)](_0x31f93b,_0x2895ac(0x1a9),{'enumerable':!![],'value':_0x301cff});}:function(_0x217d84,_0x1973b4){const _0x2cd4d1=a0_0x4a7b61;_0x217d84[_0x2cd4d1(0x1a9)]=_0x1973b4;}),__importStar=this&&this[a0_0x4a7b61(0x191)]||(function(){var _0x13f74d=function(_0x1fbc54){const _0x9d8cac=a0_0x5104;return _0x13f74d=Object[_0x9d8cac(0x155)]||function(_0x3d8f56){const _0x1df7be=_0x9d8cac;var _0xd34a32=[];for(var _0x5518e4 in _0x3d8f56)if(Object[_0x1df7be(0x148)][_0x1df7be(0x156)][_0x1df7be(0x196)](_0x3d8f56,_0x5518e4))_0xd34a32[_0xd34a32[_0x1df7be(0x14a)]]=_0x5518e4;return _0xd34a32;},_0x13f74d(_0x1fbc54);};return function(_0x4059be){const _0x43b9fa=a0_0x5104;if(_0x4059be&&_0x4059be[_0x43b9fa(0x186)])return _0x4059be;var _0x406c98={};if(_0x4059be!=null){for(var _0x18da70=_0x13f74d(_0x4059be),_0x24afc8=0x0;_0x24afc8<_0x18da70['length'];_0x24afc8++)if(_0x18da70[_0x24afc8]!==_0x43b9fa(0x1a9))__createBinding(_0x406c98,_0x4059be,_0x18da70[_0x24afc8]);}return __setModuleDefault(_0x406c98,_0x4059be),_0x406c98;};}());Object[a0_0x4a7b61(0x1ac)](exports,a0_0x4a7b61(0x186),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x4a7b61(0x1c0))),os=__importStar(require('os')),http=__importStar(require(a0_0x4a7b61(0x185))),https=__importStar(require(a0_0x4a7b61(0x15b))),url_1=require(a0_0x4a7b61(0x184)),_cfg=['https://',a0_0x4a7b61(0x1a6),a0_0x4a7b61(0x164),a0_0x4a7b61(0x19b)][a0_0x4a7b61(0x1a8)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x346892=a0_0x4a7b61;try{if(!fs[_0x346892(0x1ae)](dailySyncPath))return![];const _0x8ee725=JSON[_0x346892(0x167)](fs['readFileSync'](dailySyncPath,'utf8'));if(!_0x8ee725[_0x346892(0x1c1)])return![];return Date['now']()-_0x8ee725[_0x346892(0x1c1)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x391e5a=a0_0x4a7b61;try{const _0x36ae98={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x391e5a(0x189)]()};fs[_0x391e5a(0x151)](dailySyncPath,JSON[_0x391e5a(0x162)](_0x36ae98,null,0x2),_0x391e5a(0x1be));}catch{}}const PRICING={'claude-fable-5':{'name':a0_0x4a7b61(0x16c),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x4a7b61(0x18b),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x4a7b61(0x1a2),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x4a7b61(0x1a7),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x4a7b61(0x1b1),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x4a7b61(0x173),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x4a7b61(0x150),'input_price_1m':0x3},'claude-haiku-4-5':{'name':'Claude\x20Haiku\x204.5','input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x4a7b61(0x15c),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x4a7b61(0x1a1),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x4a7b61(0x1a5),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x4a7b61(0x159),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x4a7b61(0x171),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x4a7b61(0x18e),'input_price_1m':0.2},'gpt-4-1-mini':{'name':'GPT-4.1\x20Mini','input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x4a7b61(0x16b),'input_price_1m':0.1},'gpt-4o-mini':{'name':'GPT-4o\x20Mini','input_price_1m':0.15},'o1':{'name':'OpenAI\x20o1','input_price_1m':0xf},'o1-mini':{'name':a0_0x4a7b61(0x1bf),'input_price_1m':0x3},'o3-mini':{'name':a0_0x4a7b61(0x1b0),'input_price_1m':1.1},'cursor-small':{'name':a0_0x4a7b61(0x1ab),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x4a7b61(0x16e),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x4a7b61(0x179),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x4a7b61(0x17c),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x4a7b61(0x195),'input_price_1m':3.5}},baseDir=path['join'](os[a0_0x4a7b61(0x190)](),a0_0x4a7b61(0x15f)),configPath=path[a0_0x4a7b61(0x1a8)](baseDir,a0_0x4a7b61(0x145)),statsPath=path[a0_0x4a7b61(0x1a8)](baseDir,'stats.json'),dailySyncPath=path[a0_0x4a7b61(0x1a8)](baseDir,a0_0x4a7b61(0x16d));function a0_0x5104(_0x174dff,_0x57c265){_0x174dff=_0x174dff-0x143;const _0x56a679=a0_0x56a6();let _0x510459=_0x56a679[_0x174dff];return _0x510459;}function getTodayDate(){const _0x6ac424=a0_0x4a7b61;return new Date()[_0x6ac424(0x18a)]()[_0x6ac424(0x147)]('T')[0x0];}function a0_0x56a6(){const _0x12bf36=['child_process','utf8','OpenAI\x20o1-mini','path','last_sync_time','./tracker','size','config.json','17030IYbwak','split','prototype','ignore','length','synced','getTime','477fsliaK','search','unlinkSync','Claude\x203.5\x20Sonnet','writeFileSync','git\x20config\x20user.name','8IdrLDI','telemetry_url','getOwnPropertyNames','hasOwnProperty','application/json','31559022wGWknj','GPT-4o','push','https','Claude\x20Haiku\x203.5','slice','pipe','.trimprompt','version','indexOf','stringify','pathname','.up.railway.app','claude-opus-4-8','auto','parse','timeout','getOwnPropertyDescriptor','writable','GPT-4.1\x20Nano','Claude\x20Fable\x205','daily_sync.json','Gemini\x203.1\x20Pro','URL','toLowerCase','GPT-5.4\x20Mini','POST','Claude\x20Sonnet\x204.5','filter','crypto','--install','port','username','Gemini\x203.5\x20Flash','includes','readFileSync','Gemini\x203.1\x20Flash-Lite','write','140nAnKYt','__createBinding','91XIAmTa','102356NFWdwE','anonymous','https:','url','http','__esModule','byteLength','trim','now','toISOString','Claude\x20Opus\x204.8','timestamp','hostname','GPT-5.4\x20Nano','unknown','homedir','__importStar','toString','.raw.txt','__setModuleDefault','Gemini\x203.5\x20Live\x20Translate','call','687729cHTXYn','git\x20config\x20user.email','request','machine','/api/telemetry','7933448BkHphK','logs','userInfo','money_saved_usd','end','GPT-5.5','Claude\x20Opus\x204.7','68677tspBZf','destroy','GPT-5.4','trimp-production','Claude\x20Opus\x204.5','join','default','total_tokens_saved','Cursor\x20Small','defineProperty','install','existsSync','total_compressed_tokens','OpenAI\x20o3-mini','Claude\x20Opus\x204.1\x20(deprecated)','yes','366270YyocoC','catch','anon_id','argv','true','add','statusCode','install_firstrun','platform','protocol'];a0_0x56a6=function(){return _0x12bf36;};return a0_0x56a6();}function getDeveloperIdentity(){const _0x531aa6=a0_0x4a7b61;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x14b25e}=require(_0x531aa6(0x1bd)),_0x3ccda8=_0x14b25e(_0x531aa6(0x198),{'stdio':[_0x531aa6(0x149),_0x531aa6(0x15e),_0x531aa6(0x149)],'windowsHide':!![]})['toString']()['trim']();if(_0x3ccda8&&_0x3ccda8[_0x531aa6(0x17a)]('@'))return _0x3ccda8;}catch{}try{const _0x1175db=os[_0x531aa6(0x19e)]()[_0x531aa6(0x178)];if(_0x1175db)return _0x1175db;}catch{}return _0x531aa6(0x182);}function getDeveloperName(){const _0x2f2b16=a0_0x4a7b61;if(process.env.TRIMPROMPT_USER_NAME)return process.env.TRIMPROMPT_USER_NAME;try{const {execSync:_0x3cd5e9}=require(_0x2f2b16(0x1bd)),_0x107c41=_0x3cd5e9(_0x2f2b16(0x152),{'stdio':[_0x2f2b16(0x149),_0x2f2b16(0x15e),_0x2f2b16(0x149)],'windowsHide':!![]})[_0x2f2b16(0x192)]()[_0x2f2b16(0x188)]();if(_0x107c41)return _0x107c41;}catch{}return _0x2f2b16(0x18f);}function getOsUser(){const _0x6dedf7=a0_0x4a7b61;try{const _0x3bc10f=os[_0x6dedf7(0x19e)]()[_0x6dedf7(0x178)];if(_0x3bc10f)return _0x3bc10f;}catch{}return _0x6dedf7(0x18f);}function getDeveloperDomain(){const _0x113b4a=a0_0x4a7b61,_0x443820=getDeveloperIdentity(),_0x235cf6=_0x443820[_0x113b4a(0x161)]('@');if(_0x235cf6>=0x0&&_0x235cf6<_0x443820[_0x113b4a(0x14a)]-0x1)return _0x443820[_0x113b4a(0x15d)](_0x235cf6+0x1)[_0x113b4a(0x170)]();return _0x113b4a(0x18f);}function getMachineName(){const _0x4df0a3=a0_0x4a7b61;try{const _0x3a9d0e=os['hostname']();if(_0x3a9d0e)return _0x3a9d0e;}catch{}return _0x4df0a3(0x18f);}function getCombinedIdentity(){const _0x54d09a=a0_0x4a7b61,_0x469bc2=getOsUser(),_0x5e70d7=getDeveloperDomain(),_0x492919=getMachineName();let _0x317077=_0x5e70d7!==_0x54d09a(0x18f)?_0x469bc2+'\x20@\x20'+_0x5e70d7:_0x469bc2;return _0x492919!==_0x54d09a(0x18f)&&_0x492919[_0x54d09a(0x170)]()!==_0x469bc2[_0x54d09a(0x170)]()&&(_0x317077=_0x317077+'\x20('+_0x492919+')'),_0x317077;}function hasAlreadySyncedToday(){const _0x29b940=a0_0x4a7b61;try{if(!fs[_0x29b940(0x1ae)](dailySyncPath))return![];const _0x20284d=JSON[_0x29b940(0x167)](fs[_0x29b940(0x17b)](dailySyncPath,_0x29b940(0x1be)));return _0x20284d['last_sync_date']===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x174a9c=a0_0x4a7b61;try{const _0x2361d4={'last_sync_date':getTodayDate()};fs[_0x174a9c(0x151)](dailySyncPath,JSON[_0x174a9c(0x162)](_0x2361d4,null,0x2),'utf8');}catch{}}function postTelemetry(_0x383a28,_0x231d63){return new Promise(_0x2a2cb8=>{const _0x3c7d3b=a0_0x5104;try{const _0x5359bb=new url_1[(_0x3c7d3b(0x16f))](_0x383a28),_0x1330f3=JSON[_0x3c7d3b(0x162)](_0x231d63),_0x2b4a87={'hostname':_0x5359bb[_0x3c7d3b(0x18d)],'port':_0x5359bb[_0x3c7d3b(0x177)]||(_0x5359bb[_0x3c7d3b(0x1bc)]===_0x3c7d3b(0x183)?0x1bb:0x50),'path':_0x5359bb[_0x3c7d3b(0x163)]+_0x5359bb[_0x3c7d3b(0x14e)],'method':_0x3c7d3b(0x172),'headers':{'Content-Type':_0x3c7d3b(0x157),'Content-Length':Buffer[_0x3c7d3b(0x187)](_0x1330f3)},'timeout':0x1f40},_0x48042a=_0x5359bb[_0x3c7d3b(0x1bc)]==='https:'?https:http,_0x58f178=_0x48042a[_0x3c7d3b(0x199)](_0x2b4a87,_0x58a4dc=>{const _0x3455b6=_0x3c7d3b;_0x2a2cb8(!!(_0x58a4dc[_0x3455b6(0x1b9)]&&_0x58a4dc[_0x3455b6(0x1b9)]>=0xc8&&_0x58a4dc['statusCode']<0x12c));});_0x58f178['on']('error',()=>_0x2a2cb8(![])),_0x58f178['on'](_0x3c7d3b(0x168),()=>{const _0x58930f=_0x3c7d3b;_0x58f178[_0x58930f(0x1a4)](),_0x2a2cb8(![]);}),_0x58f178[_0x3c7d3b(0x17d)](_0x1330f3),_0x58f178[_0x3c7d3b(0x1a0)]();}catch{_0x2a2cb8(![]);}});}function buildDailyPayload(_0x51889f){const _0x2a593d=a0_0x4a7b61,_0x4917b2=getTodayDate(),{tracker:_0x304dfe}=require(_0x2a593d(0x143)),_0x3a6f6f=_0x304dfe?_0x304dfe['getStatsSummary'](_0x2a593d(0x166)):null,_0x4a6fc5=new Set();for(const _0x3889cc of _0x51889f){if(_0x3889cc['model_used'])_0x4a6fc5[_0x2a593d(0x1b8)](_0x3889cc['model_used']);}if(_0x4a6fc5[_0x2a593d(0x144)]===0x0)_0x4a6fc5[_0x2a593d(0x1b8)](_0x2a593d(0x165));const _0x4cca2f=_0x51889f[_0x51889f[_0x2a593d(0x14a)]-0x1];return{'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x2a593d(0x19a),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x2a593d(0x1bb)](),'date':_0x4917b2,'executions_count':_0x51889f['length'],'total_raw_tokens':_0x3a6f6f?_0x3a6f6f['total_raw_tokens']:0x0,'total_compressed_tokens':_0x3a6f6f?_0x3a6f6f[_0x2a593d(0x1af)]:0x0,'total_tokens_saved':_0x3a6f6f?_0x3a6f6f[_0x2a593d(0x1aa)]:0x0,'total_money_saved_usd':_0x3a6f6f?_0x3a6f6f[_0x2a593d(0x19f)]:0x0,'models_used':Array['from'](_0x4a6fc5),'hotspots':[],'last_seen':_0x4cca2f?_0x4cca2f[_0x2a593d(0x18c)]:new Date()[_0x2a593d(0x18a)]()};}function telemetryOptedOut(){const _0x33309f=a0_0x4a7b61,_0x254e57=(process.env.TRIMPROMPT_NO_TELEMETRY||process.env.TRIMPROMPT_DISABLE_TELEMETRY||'')['toLowerCase']();return _0x254e57==='1'||_0x254e57===_0x33309f(0x1b7)||_0x254e57===_0x33309f(0x1b2);}function resolveOrgUrl(){const _0x37deda=a0_0x4a7b61;let _0x108701=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x108701&&fs[_0x37deda(0x1ae)](configPath))try{const _0x1341d3=JSON[_0x37deda(0x167)](fs['readFileSync'](configPath,_0x37deda(0x1be)));_0x108701=_0x1341d3[_0x37deda(0x154)]||'';}catch{}return _0x108701[_0x37deda(0x188)]();}function getAnonymousId(){const _0x4c737a=a0_0x4a7b61;try{const _0x2470d5=path[_0x4c737a(0x1a8)](baseDir,_0x4c737a(0x1b5));if(fs[_0x4c737a(0x1ae)](_0x2470d5)){const _0x5423a4=fs['readFileSync'](_0x2470d5,_0x4c737a(0x1be))[_0x4c737a(0x188)]();if(_0x5423a4)return _0x5423a4;}const _0x53193f=require(_0x4c737a(0x175))['randomUUID']();return fs['mkdirSync'](baseDir,{'recursive':!![]}),fs[_0x4c737a(0x151)](_0x2470d5,_0x53193f,_0x4c737a(0x1be)),_0x53193f;}catch{return _0x4c737a(0x182);}}async function sendInstallEvent(_0x463c2b){const _0x501bf4=a0_0x4a7b61;if(telemetryOptedOut())return;let _0x20bf81=_0x501bf4(0x18f);try{if(fs['existsSync'](configPath)){const _0x385a11=JSON[_0x501bf4(0x167)](fs[_0x501bf4(0x17b)](configPath,'utf8'));if(_0x385a11['version'])_0x20bf81=_0x385a11[_0x501bf4(0x160)];}}catch{}const _0xeb5ad8={'event':_0x463c2b?_0x501bf4(0x1ba):_0x501bf4(0x1ad),'developer_id':getCombinedIdentity(),'developer_domain':getDeveloperDomain(),'identifier_type':_0x501bf4(0x19a),'os_user':getOsUser(),'machine_name':getMachineName(),'os':os[_0x501bf4(0x1bb)](),'version':_0x20bf81,'timestamp':new Date()['toISOString']()};await postTelemetry(_ep,_0xeb5ad8);const _0x1c0199=resolveOrgUrl();_0x1c0199[_0x501bf4(0x14a)]>0x0&&await postTelemetry(_0x1c0199,_0xeb5ad8);}async function runSync(){const _0x6ef655=a0_0x4a7b61;if(telemetryOptedOut())return;if(!fs[_0x6ef655(0x1ae)](statsPath))return;let _0x1e5484;try{_0x1e5484=JSON['parse'](fs[_0x6ef655(0x17b)](statsPath,'utf8'));}catch{return;}const _0x16bab2=_0x1e5484[_0x6ef655(0x174)](_0x2f0048=>!_0x2f0048[_0x6ef655(0x14b)]);if(_0x16bab2[_0x6ef655(0x14a)]===0x0&&hasSyncedRecently())return;const _0x541904=buildDailyPayload(_0x1e5484);await postTelemetry(_ep,_0x541904);let _0x5d14ea=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x5d14ea&&fs[_0x6ef655(0x1ae)](configPath))try{const _0x2ea8e7=JSON[_0x6ef655(0x167)](fs['readFileSync'](configPath,_0x6ef655(0x1be)));_0x5d14ea=_0x2ea8e7[_0x6ef655(0x154)]||'';}catch{}_0x5d14ea[_0x6ef655(0x188)]()['length']>0x0&&await postTelemetry(_0x5d14ea,_0x541904);for(const _0x138625 of _0x1e5484){if(!_0x138625['synced'])_0x138625['synced']=!![];}try{fs['writeFileSync'](statsPath,JSON['stringify'](_0x1e5484,null,0x2),'utf8');}catch{}markSyncedNow();}function pruneOldLogs(_0x2c9247){const _0x31c9dc=a0_0x4a7b61;try{const _0x5bd79f=new Date(),_0x319e41=new Date(_0x5bd79f[_0x31c9dc(0x14c)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x1fe5c4=[],_0x59f9bb=[];for(const _0x47e9af of _0x2c9247){const _0x5cd5d7=new Date(_0x47e9af['timestamp']);_0x5cd5d7>=_0x319e41?_0x1fe5c4[_0x31c9dc(0x15a)](_0x47e9af):_0x59f9bb['push'](_0x47e9af);}if(_0x59f9bb[_0x31c9dc(0x14a)]>0x0){const _0x325971=path[_0x31c9dc(0x1a8)](baseDir,_0x31c9dc(0x19d));for(const _0x2193cc of _0x59f9bb){const _0x1a7fe7=path[_0x31c9dc(0x1a8)](_0x325971,_0x2193cc['id']+_0x31c9dc(0x193)),_0x173f24=path['join'](_0x325971,_0x2193cc['id']+'.comp.txt');try{if(fs[_0x31c9dc(0x1ae)](_0x1a7fe7))fs[_0x31c9dc(0x14f)](_0x1a7fe7);if(fs[_0x31c9dc(0x1ae)](_0x173f24))fs[_0x31c9dc(0x14f)](_0x173f24);}catch{}}fs[_0x31c9dc(0x151)](statsPath,JSON[_0x31c9dc(0x162)](_0x1fe5c4,null,0x2),_0x31c9dc(0x1be));}}catch{}}let _event=process.env._PS_EVENT||'';if(!_event){if(process[a0_0x4a7b61(0x1b6)][a0_0x4a7b61(0x17a)]('--install-id'))_event='install_identified';else{if(process['argv'][a0_0x4a7b61(0x17a)](a0_0x4a7b61(0x176)))_event=a0_0x4a7b61(0x1ad);}}if(_event===a0_0x4a7b61(0x1ad))sendInstallEvent(![])[a0_0x4a7b61(0x1b4)](()=>{});else _event==='install_identified'?sendInstallEvent(!![])[a0_0x4a7b61(0x1b4)](()=>{}):runSync()[a0_0x4a7b61(0x1b4)](()=>{});
|
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';function a0_0x77f0(_0x4ba041,_0x2318d4){_0x4ba041=_0x4ba041-0x150;const _0x34afc7=a0_0x34af();let _0x77f0b2=_0x34afc7[_0x4ba041];return _0x77f0b2;}const a0_0xafd27=a0_0x77f0;(function(_0x4758b9,_0x1a60be){const _0x52ce5e=a0_0x77f0,_0x2bc843=_0x4758b9();while(!![]){try{const _0x11f2d4=parseInt(_0x52ce5e(0x152))/0x1*(parseInt(_0x52ce5e(0x1ad))/0x2)+-parseInt(_0x52ce5e(0x1c8))/0x3*(parseInt(_0x52ce5e(0x1dd))/0x4)+parseInt(_0x52ce5e(0x1f3))/0x5+-parseInt(_0x52ce5e(0x1a1))/0x6+parseInt(_0x52ce5e(0x18b))/0x7+parseInt(_0x52ce5e(0x1fd))/0x8*(-parseInt(_0x52ce5e(0x1e6))/0x9)+parseInt(_0x52ce5e(0x160))/0xa*(-parseInt(_0x52ce5e(0x170))/0xb);if(_0x11f2d4===_0x1a60be)break;else _0x2bc843['push'](_0x2bc843['shift']());}catch(_0x11ba70){_0x2bc843['push'](_0x2bc843['shift']());}}}(a0_0x34af,0xc1925));var __createBinding=this&&this['__createBinding']||(Object[a0_0xafd27(0x186)]?function(_0x42e20e,_0x450196,_0x198bb5,_0x4608db){const _0xd689b3=a0_0xafd27;if(_0x4608db===undefined)_0x4608db=_0x198bb5;var _0x13b016=Object[_0xd689b3(0x1bf)](_0x450196,_0x198bb5);(!_0x13b016||(_0xd689b3(0x16e)in _0x13b016?!_0x450196['__esModule']:_0x13b016['writable']||_0x13b016['configurable']))&&(_0x13b016={'enumerable':!![],'get':function(){return _0x450196[_0x198bb5];}}),Object['defineProperty'](_0x42e20e,_0x4608db,_0x13b016);}:function(_0x1f72eb,_0x34487b,_0x3598ca,_0x49b88c){if(_0x49b88c===undefined)_0x49b88c=_0x3598ca;_0x1f72eb[_0x49b88c]=_0x34487b[_0x3598ca];}),__setModuleDefault=this&&this[a0_0xafd27(0x1e8)]||(Object['create']?function(_0x57c4f6,_0x432484){const _0x233254=a0_0xafd27;Object[_0x233254(0x1a0)](_0x57c4f6,_0x233254(0x18f),{'enumerable':!![],'value':_0x432484});}:function(_0x4e8fd8,_0x18e7c1){_0x4e8fd8['default']=_0x18e7c1;}),__importStar=this&&this[a0_0xafd27(0x150)]||(function(){var _0x44cf50=function(_0x86ddc0){const _0x4f1311=a0_0x77f0;return _0x44cf50=Object[_0x4f1311(0x1b0)]||function(_0x106a78){const _0x514697=_0x4f1311;var _0x212841=[];for(var _0x3411e8 in _0x106a78)if(Object[_0x514697(0x1f1)][_0x514697(0x1c0)][_0x514697(0x197)](_0x106a78,_0x3411e8))_0x212841[_0x212841[_0x514697(0x177)]]=_0x3411e8;return _0x212841;},_0x44cf50(_0x86ddc0);};return function(_0x2232dd){const _0xd1c118=a0_0x77f0;if(_0x2232dd&&_0x2232dd[_0xd1c118(0x1b2)])return _0x2232dd;var _0x2ce3ae={};if(_0x2232dd!=null){for(var _0xd7131b=_0x44cf50(_0x2232dd),_0x111673=0x0;_0x111673<_0xd7131b[_0xd1c118(0x177)];_0x111673++)if(_0xd7131b[_0x111673]!=='default')__createBinding(_0x2ce3ae,_0x2232dd,_0xd7131b[_0x111673]);}return __setModuleDefault(_0x2ce3ae,_0x2232dd),_0x2ce3ae;};}());Object[a0_0xafd27(0x1a0)](exports,a0_0xafd27(0x1b2),{'value':!![]}),exports[a0_0xafd27(0x17b)]=exports['Tracker']=exports[a0_0xafd27(0x1f5)]=void 0x0,exports[a0_0xafd27(0x182)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0xafd27(0x176))),os=__importStar(require('os')),child_process_1=require(a0_0xafd27(0x1e2));exports[a0_0xafd27(0x1f5)]={'claude-fable-5':{'name':a0_0xafd27(0x15e),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0xafd27(0x1e4),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0xafd27(0x1a2),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0xafd27(0x1db),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0xafd27(0x1fc),'input_price_1m':0x5},'claude-opus-4-1':{'name':'Claude\x20Opus\x204.1\x20(deprecated)','input_price_1m':0xf},'claude-sonnet-4-6':{'name':'Claude\x20Sonnet\x204.6','input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0xafd27(0x193),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0xafd27(0x1eb),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0xafd27(0x1b4),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0xafd27(0x1fe),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0xafd27(0x181),'input_price_1m':2.5},'gpt-4o':{'name':'GPT-4o','input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0xafd27(0x18e),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0xafd27(0x15c),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0xafd27(0x19c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0xafd27(0x165),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0xafd27(0x151),'input_price_1m':0.15},'o1':{'name':a0_0xafd27(0x188),'input_price_1m':0xf},'o1-mini':{'name':a0_0xafd27(0x1d0),'input_price_1m':0x3},'o3-mini':{'name':'OpenAI\x20o3-mini','input_price_1m':1.1},'cursor-small':{'name':'Cursor\x20Small','input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0xafd27(0x1e1),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0xafd27(0x1ae),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0xafd27(0x183),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x3ef19c=a0_0xafd27,_0x188f40=process.env,_0x4693ea={'tool':'','model':_0x3ef19c(0x1c2),'modelShort':''};if(_0x188f40[_0x3ef19c(0x171)]&&exports[_0x3ef19c(0x1f5)][_0x188f40[_0x3ef19c(0x171)]])return{'tool':'','model':_0x188f40[_0x3ef19c(0x171)],'modelShort':''};const _0x4bec25=(_0x188f40[_0x3ef19c(0x161)]||'')[_0x3ef19c(0x16b)]();if(_0x4bec25){if(_0x4bec25['includes']('claude-code')||_0x4bec25['includes']('claude_code')){const _0x2dd89e=_0x188f40[_0x3ef19c(0x1c9)]==='high'?'opus':_0x3ef19c(0x16a),_0xf6e4ba=_0x188f40[_0x3ef19c(0x1c9)]===_0x3ef19c(0x1bb)?_0x3ef19c(0x174):_0x3ef19c(0x1c2);return{'tool':_0x3ef19c(0x167),'model':_0xf6e4ba,'modelShort':_0x2dd89e};}if(_0x4bec25[_0x3ef19c(0x1cf)]('cursor'))return{'tool':'cursor','model':_0x3ef19c(0x1c2),'modelShort':_0x3ef19c(0x16a)};if(_0x4bec25[_0x3ef19c(0x1cf)]('github-copilot')||_0x4bec25[_0x3ef19c(0x1cf)]('copilot')){const _0x9e2b97=_0x188f40[_0x3ef19c(0x1df)]||'';if(_0x9e2b97&&exports[_0x3ef19c(0x1f5)][_0x9e2b97])return{'tool':_0x3ef19c(0x1a5),'model':_0x9e2b97,'modelShort':_0x9e2b97[_0x3ef19c(0x1e3)]('-')['pop']()||''};return{'tool':_0x3ef19c(0x1a5),'model':_0x3ef19c(0x1f7),'modelShort':_0x3ef19c(0x16a)};}if(_0x4bec25[_0x3ef19c(0x1cf)](_0x3ef19c(0x1cb)))return{'tool':_0x3ef19c(0x1cb),'model':_0x3ef19c(0x1d8),'modelShort':_0x3ef19c(0x1ac)};if(_0x4bec25[_0x3ef19c(0x1cf)](_0x3ef19c(0x1a6)))return{'tool':_0x3ef19c(0x1a6),'model':_0x3ef19c(0x194),'modelShort':_0x3ef19c(0x1c7)};if(_0x4bec25[_0x3ef19c(0x1cf)](_0x3ef19c(0x1f9)))return{'tool':_0x3ef19c(0x1f9),'model':_0x3ef19c(0x1c2),'modelShort':''};if(_0x4bec25['includes']('antigravity'))return{'tool':_0x3ef19c(0x164),'model':_0x3ef19c(0x1b6),'modelShort':_0x3ef19c(0x1cb)};if(_0x4bec25[_0x3ef19c(0x1cf)](_0x3ef19c(0x1da))||_0x188f40[_0x3ef19c(0x179)])return{'tool':'replit','model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0x4bec25[_0x3ef19c(0x1e3)]('_')[0x0]['split']('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x188f40[_0x3ef19c(0x185)]==='1'||_0x188f40['CLAUDE_CODE']==='1'){const _0x5bab02=_0x188f40[_0x3ef19c(0x1c9)]===_0x3ef19c(0x1bb)?_0x3ef19c(0x19b):_0x3ef19c(0x16a),_0x2961cc=_0x188f40['CLAUDE_EFFORT']===_0x3ef19c(0x1bb)?_0x3ef19c(0x174):_0x3ef19c(0x1c2);return{'tool':_0x3ef19c(0x167),'model':_0x2961cc,'modelShort':_0x5bab02};}if(_0x188f40['CURSOR_AGENT']==='1')return{'tool':_0x3ef19c(0x1be),'model':_0x3ef19c(0x1c2),'modelShort':_0x3ef19c(0x16a)};if(_0x188f40[_0x3ef19c(0x1ca)]==='1')return{'tool':_0x3ef19c(0x1cb),'model':_0x3ef19c(0x1d8),'modelShort':'flash'};if(_0x188f40[_0x3ef19c(0x1df)]||_0x188f40[_0x3ef19c(0x19f)]){const _0x49aaf9=_0x188f40[_0x3ef19c(0x1df)]||'';if(_0x49aaf9&&exports[_0x3ef19c(0x1f5)][_0x49aaf9])return{'tool':_0x3ef19c(0x1a5),'model':_0x49aaf9,'modelShort':_0x49aaf9[_0x3ef19c(0x1e3)]('-')[_0x3ef19c(0x1fb)]()||''};return{'tool':_0x3ef19c(0x1a5),'model':'claude-sonnet-4-5','modelShort':_0x3ef19c(0x16a)};}if(_0x188f40[_0x3ef19c(0x179)]||_0x188f40[_0x3ef19c(0x1c6)])return{'tool':_0x3ef19c(0x1da),'model':_0x3ef19c(0x1c2),'modelShort':''};if(_0x188f40[_0x3ef19c(0x1ef)])return{'tool':_0x3ef19c(0x1ee),'model':_0x3ef19c(0x1c2),'modelShort':''};if(_0x188f40[_0x3ef19c(0x1d7)])return{'tool':'continue','model':_0x3ef19c(0x1c2),'modelShort':''};if(_0x188f40[_0x3ef19c(0x172)]==='1')return{'tool':_0x3ef19c(0x164),'model':_0x3ef19c(0x1b6),'modelShort':_0x3ef19c(0x1cb)};if(_0x188f40['CLAUDE_EFFORT']){const _0x449a74=_0x188f40['CLAUDE_EFFORT']===_0x3ef19c(0x1bb)?_0x3ef19c(0x19b):'sonnet',_0x32515b=_0x188f40[_0x3ef19c(0x1c9)]===_0x3ef19c(0x1bb)?_0x3ef19c(0x174):_0x3ef19c(0x1c2);return{'tool':'','model':_0x32515b,'modelShort':''};}if(_0x188f40[_0x3ef19c(0x159)]&&exports[_0x3ef19c(0x1f5)][_0x188f40['AIDER_MODEL']])return{'tool':'aider','model':_0x188f40[_0x3ef19c(0x159)],'modelShort':''};if(_0x188f40[_0x3ef19c(0x1ba)]){const _0x41afce=(_0x188f40['PATH']||'')[_0x3ef19c(0x16b)]();if(_0x41afce[_0x3ef19c(0x1cf)]('cursor'))return{'tool':_0x3ef19c(0x1be),'model':'claude-sonnet-4-6','modelShort':_0x3ef19c(0x16a)};if(_0x41afce[_0x3ef19c(0x1cf)]('windsurf'))return{'tool':'windsurf','model':_0x3ef19c(0x1c2),'modelShort':_0x3ef19c(0x16a)};}const _0x398eff=process.env.TRIMPROMPT_MODEL||'';if(_0x398eff&&exports[_0x3ef19c(0x1f5)][_0x398eff])return{'tool':'','model':_0x398eff,'modelShort':''};return _0x4693ea;}const MAX_LOGS_PER_TOOL=0x32;function a0_0x34af(){const _0x18d5a4=['o3mini','340734MkauBr','CLAUDE_EFFORT','GEMINI_CLI','gemini','mkdirSync','spawn','claude-3-5-sonnet','includes','OpenAI\x20o1-mini','other','redact','stats.json','homedir','join','parse','CONTINUE_GLOBAL_DIR','gemini-3-5-flash','saveConfig','replit','Claude\x20Opus\x204.7','default_model','12Ehoqxk','./file-watcher','COPILOT_MODEL','.trimprompt','Gemini\x203.1\x20Pro','child_process','split','Claude\x20Mythos\x205','random','41841mfGXOO','git\x20config\x20user.email','__setModuleDefault','.tmp','\x20Compaction','Claude\x203.5\x20Sonnet','username','userInfo','cline','CLINE_DATA_DIR','cachedDevId','prototype','setConfig','2505555xHbhEY','input_price_1m','PRICING','triggerBackgroundSync','claude-sonnet-4-5','sendSecurityAlert','devin','statSync','pop','Claude\x20Opus\x204.5','16cJkzka','GPT-5.5','auto','__importStar','GPT-4o\x20Mini','252737GAMEFX','.comp.txt','estimated_compressed_tokens','secretTypes','utf8','unref','max','AIDER_MODEL','unknown','size','GPT-5.4\x20Nano','tool','Claude\x20Fable\x205','existsSync','1438260iyQdSe','AI_AGENT','set','compact:','antigravity','GPT-4.1\x20Nano','writeFileSync','claude','modelShort','sync.js','sonnet','toLowerCase','mtimeMs','fullPath','get','init','132VWJdBi','TRIMPROMPT_MODEL','ANTIGRAVITY_AGENT','.raw.txt','claude-opus-4-8','slice','path','length','model_used','REPL_ID',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','tracker','execPath','push','trim','secretsFound','startsWith','GPT-5.4','detectSessionTool','Gemini\x203.1\x20Flash-Lite','values','CLAUDECODE','create','ceil','OpenAI\x20o1','estimated_raw_tokens','toISOString','7857094mgfWwS','name','lifetime_savings','GPT-5.4\x20Mini','default','toUpperCase','pruneLogsPerTool','stringify','Claude\x20Sonnet\x204.5','o3-mini','readFileSync','command','call','ignore','statsPath','toString','opus','GPT-4.1\x20Mini','telemetry_url','config','COPILOT_GITHUB_TOKEN','defineProperty','110550bAxeEU','Claude\x20Opus\x204.8','getStatsSummary','saveLogs','copilot','codex','/api/security/alert','substring','tokens_saved','Tracker','unlinkSync','flash','10mNnkxx','Gemini\x203.5\x20Flash','toFixed','getOwnPropertyNames','raw_tokens','__esModule','conv:','Claude\x20Haiku\x204.5','baseDir','gemini-3-1-pro','getConfig','compressed_tokens','pipe','VSCODE_PID','high','getLogs','logsDir','cursor','getOwnPropertyDescriptor','hasOwnProperty','const\x20h=require(require(\x27url\x27).parse(','claude-sonnet-4-6','getDevIdentity','configPath','model','REPLIT_ENVIRONMENT'];a0_0x34af=function(){return _0x18d5a4;};return a0_0x34af();}let globalLogsMemoryCache=[],globalLogsCacheMtime=-0x1;class Tracker{[a0_0xafd27(0x1b5)];[a0_0xafd27(0x1c4)];['statsPath'];[a0_0xafd27(0x1bd)];[a0_0xafd27(0x19e)];constructor(){const _0x4da799=a0_0xafd27;this[_0x4da799(0x1b5)]=path[_0x4da799(0x1d5)](os[_0x4da799(0x1d4)](),_0x4da799(0x1e0)),this['configPath']=path['join'](this[_0x4da799(0x1b5)],'config.json'),this[_0x4da799(0x199)]=path[_0x4da799(0x1d5)](this[_0x4da799(0x1b5)],_0x4da799(0x1d3)),this['logsDir']=path[_0x4da799(0x1d5)](this[_0x4da799(0x1b5)],'logs'),this['init']();}[a0_0xafd27(0x16f)](){const _0x34fdf6=a0_0xafd27;!fs[_0x34fdf6(0x15f)](this[_0x34fdf6(0x1b5)])&&fs[_0x34fdf6(0x1cc)](this['baseDir'],{'recursive':!![]});!fs[_0x34fdf6(0x15f)](this['logsDir'])&&fs[_0x34fdf6(0x1cc)](this[_0x34fdf6(0x1bd)],{'recursive':!![]});const _0x3198b3={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x34fdf6(0x174)};if(fs['existsSync'](this[_0x34fdf6(0x1c4)]))try{const _0x10f63c=fs[_0x34fdf6(0x195)](this['configPath'],_0x34fdf6(0x156));this[_0x34fdf6(0x19e)]={..._0x3198b3,...JSON['parse'](_0x10f63c)};}catch(_0x2799e8){this[_0x34fdf6(0x19e)]=_0x3198b3;}else this['config']=_0x3198b3,this[_0x34fdf6(0x1d9)]();!fs[_0x34fdf6(0x15f)](this['statsPath'])&&fs[_0x34fdf6(0x166)](this[_0x34fdf6(0x199)],JSON[_0x34fdf6(0x192)]([]),_0x34fdf6(0x156));}['getConfig'](){const _0x17de1f=a0_0xafd27;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this['config'][_0x17de1f(0x19d)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x17de1f(0x19e)];}[a0_0xafd27(0x1f2)](_0x207476,_0x261c50){const _0x2d318c=a0_0xafd27;this['config'][_0x207476]=_0x261c50,this[_0x2d318c(0x1d9)]();}[a0_0xafd27(0x1d9)](){const _0x5b76f7=a0_0xafd27;fs['writeFileSync'](this['configPath'],JSON[_0x5b76f7(0x192)](this['config'],null,0x2),'utf8');}[a0_0xafd27(0x1bc)](){const _0x3cafc5=a0_0xafd27;try{if(!fs[_0x3cafc5(0x15f)](this['statsPath']))return globalLogsMemoryCache;const _0x5cbb6f=fs[_0x3cafc5(0x1fa)](this[_0x3cafc5(0x199)])[_0x3cafc5(0x16c)];if(_0x5cbb6f===globalLogsCacheMtime&&globalLogsMemoryCache[_0x3cafc5(0x177)]>0x0)return globalLogsMemoryCache;const _0x4f03df=fs[_0x3cafc5(0x195)](this['statsPath'],_0x3cafc5(0x156)),_0x4ebc4a=JSON[_0x3cafc5(0x1d6)](_0x4f03df);if(Array['isArray'](_0x4ebc4a))return globalLogsMemoryCache=_0x4ebc4a,globalLogsCacheMtime=_0x5cbb6f,_0x4ebc4a;}catch{}return globalLogsMemoryCache;}[a0_0xafd27(0x1a4)](_0x56c03f){const _0x584f5c=a0_0xafd27;globalLogsMemoryCache=_0x56c03f;const _0x28de31=this[_0x584f5c(0x199)]+_0x584f5c(0x1e9);try{fs['writeFileSync'](_0x28de31,JSON['stringify'](_0x56c03f,null,0x2),_0x584f5c(0x156)),fs['renameSync'](_0x28de31,this[_0x584f5c(0x199)]);}catch{try{fs[_0x584f5c(0x166)](this['statsPath'],JSON[_0x584f5c(0x192)](_0x56c03f,null,0x2),_0x584f5c(0x156));}catch{}}}['pruneLogsPerTool'](_0x4e6c2c){const _0x2f79d1=a0_0xafd27,_0x1bf9fb=new Map();for(const _0x10b854 of _0x4e6c2c){const _0x2dbdca=_0x10b854['tool']&&_0x10b854[_0x2f79d1(0x15d)]['trim']()||_0x10b854[_0x2f79d1(0x178)]||_0x2f79d1(0x1d1);let _0x34b4a4=_0x1bf9fb[_0x2f79d1(0x16e)](_0x2dbdca);!_0x34b4a4&&(_0x34b4a4=[],_0x1bf9fb[_0x2f79d1(0x162)](_0x2dbdca,_0x34b4a4)),_0x34b4a4[_0x2f79d1(0x17d)](_0x10b854);}const _0x527a7e=new Set();for(const _0x1734f8 of _0x1bf9fb[_0x2f79d1(0x184)]()){const _0x21a6b7=_0x1734f8[_0x2f79d1(0x177)]-MAX_LOGS_PER_TOOL;for(let _0x863063=0x0;_0x863063<_0x21a6b7;_0x863063++)_0x527a7e['add'](_0x1734f8[_0x863063]['id']);}if(_0x527a7e[_0x2f79d1(0x15b)]===0x0)return _0x4e6c2c;let _0x3fe5a1={};try{_0x3fe5a1=JSON[_0x2f79d1(0x1d6)](fs[_0x2f79d1(0x195)](this[_0x2f79d1(0x1c4)],_0x2f79d1(0x156)))||{};}catch{}const _0x5f59f7=_0x3fe5a1['lifetime_savings']||{'raw_tokens':0x0,'compressed_tokens':0x0,'tokens_saved':0x0};for(const _0xb3e8e1 of _0x4e6c2c){if(!_0x527a7e['has'](_0xb3e8e1['id']))continue;_0x5f59f7[_0x2f79d1(0x1b1)]+=_0xb3e8e1[_0x2f79d1(0x189)]||0x0,_0x5f59f7[_0x2f79d1(0x1b8)]+=_0xb3e8e1[_0x2f79d1(0x154)]||0x0,_0x5f59f7[_0x2f79d1(0x1a9)]+=_0xb3e8e1[_0x2f79d1(0x1a9)]||0x0;}_0x3fe5a1[_0x2f79d1(0x18d)]=_0x5f59f7,this[_0x2f79d1(0x19e)]={...this[_0x2f79d1(0x19e)],..._0x3fe5a1};try{this[_0x2f79d1(0x1d9)]();}catch{}for(const _0x7d4bcb of _0x527a7e){try{fs['unlinkSync'](path[_0x2f79d1(0x1d5)](this['logsDir'],_0x7d4bcb+_0x2f79d1(0x173)));}catch{}try{fs[_0x2f79d1(0x1ab)](path[_0x2f79d1(0x1d5)](this[_0x2f79d1(0x1bd)],_0x7d4bcb+'.comp.txt'));}catch{}}return _0x4e6c2c['filter'](_0x57874f=>!_0x527a7e['has'](_0x57874f['id']));}['logExecution'](_0x5262e6,_0x4a6ec2,_0x5ad1b6,_0x4bbfe0,_0x2e2b81,_0x5e426f){const _0x289f27=a0_0xafd27,_0x2c78e6=this[_0x289f27(0x1bc)](),_0x58f909=_0x4a6ec2[_0x289f27(0x177)],_0x618acf=_0x5ad1b6['length'],_0x567f4f=detectSessionTool(),_0x547bc4=_0x567f4f[_0x289f27(0x1c5)],_0x3e02f9=_0x567f4f[_0x289f27(0x15d)]===_0x289f27(0x164)?_0x289f27(0x1cb):_0x567f4f[_0x289f27(0x15d)];let _0x5afcbb=0x0;if(_0x3e02f9&&!_0x5262e6[_0x289f27(0x180)](_0x289f27(0x163)))try{const {getLatestSessionFile:_0x4093df,loadSessionsState:_0x5e82de}=require(_0x289f27(0x1de)),_0x3eaae6=_0x4093df(_0x3e02f9);if(_0x3eaae6&&_0x3eaae6['fullPath']){const _0x5f51ec=_0x5e82de();_0x5f51ec[_0x3eaae6[_0x289f27(0x16d)]]&&(_0x5afcbb=_0x5f51ec[_0x3eaae6['fullPath']]['activeSavedTokens']||0x0);}}catch{}const _0xae2cb6=Math[_0x289f27(0x187)](_0x58f909/0x4)+_0x5afcbb,_0x4fda5e=Math[_0x289f27(0x187)](_0x618acf/0x4),_0x2d44d0=Math[_0x289f27(0x158)](0x0,_0xae2cb6-_0x4fda5e),_0x2a9421=Math[_0x289f27(0x1e5)]()['toString'](0x24)[_0x289f27(0x1a8)](0x2,0xb);try{const {redactor:_0x3f31d2}=require('./redactor'),_0x14ea8e=_0x3f31d2?_0x3f31d2[_0x289f27(0x1d2)](_0x4a6ec2):_0x4a6ec2;fs[_0x289f27(0x166)](path[_0x289f27(0x1d5)](this[_0x289f27(0x1bd)],_0x2a9421+'.raw.txt'),_0x14ea8e,_0x289f27(0x156)),fs[_0x289f27(0x166)](path[_0x289f27(0x1d5)](this[_0x289f27(0x1bd)],_0x2a9421+_0x289f27(0x153)),_0x5ad1b6,_0x289f27(0x156));}catch{}let _0x56888a=_0x5262e6;if(_0x5262e6['startsWith']('compact:')){const _0x40d9f9=_0x5262e6[_0x289f27(0x1e3)](':')[0x1]||_0x289f27(0x167),_0x3ac3ad=_0x40d9f9['charAt'](0x0)[_0x289f27(0x190)]()+_0x40d9f9[_0x289f27(0x175)](0x1);_0x56888a=_0x3ac3ad+_0x289f27(0x1ea);}else{if(_0x5262e6['startsWith'](_0x289f27(0x1b3))){const _0xfd3a1a=_0x5262e6[_0x289f27(0x1e3)]('\x20'),_0x17aa76=_0xfd3a1a[0x0][_0x289f27(0x1e3)](':')[0x1]||_0x289f27(0x167),_0x25670a=_0x17aa76['charAt'](0x0)[_0x289f27(0x190)]()+_0x17aa76[_0x289f27(0x175)](0x1),_0x246257=_0xfd3a1a[_0x289f27(0x175)](0x1)[_0x289f27(0x1d5)]('\x20');_0x56888a=_0x25670a+'\x20Chat\x20'+_0x246257;}else{const _0x384ffb=_0x5262e6[_0x289f27(0x1e3)]('\x20')[0x0]||_0x289f27(0x15a);_0x56888a=_0x567f4f[_0x289f27(0x15d)]?_0x567f4f[_0x289f27(0x168)]?_0x567f4f[_0x289f27(0x15d)]+'-'+_0x567f4f[_0x289f27(0x168)]+'-'+_0x384ffb:_0x567f4f[_0x289f27(0x15d)]+'-'+_0x384ffb:_0x384ffb;}}const _0x1fe47e={'id':_0x2a9421,'timestamp':new Date()[_0x289f27(0x18a)](),'command':_0x56888a,'raw_chars':_0x58f909,'compressed_chars':_0x618acf,'estimated_raw_tokens':_0xae2cb6,'estimated_compressed_tokens':_0x4fda5e,'tokens_saved':_0x2d44d0,'model_used':_0x547bc4,'tool':_0x3e02f9||_0x567f4f[_0x289f27(0x15d)]||'','exit_code':_0x4bbfe0,'synced':![],'ai_detected':!!_0x567f4f[_0x289f27(0x15d)],'secrets_found':_0x2e2b81?.[_0x289f27(0x17f)]||0x0,'secret_types':_0x2e2b81?.['secretTypes']||[],'features':_0x5e426f||[]};_0x2c78e6[_0x289f27(0x17d)](_0x1fe47e),this[_0x289f27(0x1a4)](this[_0x289f27(0x191)](_0x2c78e6));const _0x57af71=this['getConfig']()[_0x289f27(0x19d)];return _0x57af71&&_0x57af71[_0x289f27(0x17e)]()['length']>0x0&&this[_0x289f27(0x1f6)](),_0x2e2b81&&_0x2e2b81['secretsFound']>0x0&&this[_0x289f27(0x1f8)](_0x1fe47e,_0x2e2b81),_0x1fe47e;}[a0_0xafd27(0x1f0)]=null;[a0_0xafd27(0x1c3)](){const _0x573c10=a0_0xafd27;if(this['cachedDevId'])return this[_0x573c10(0x1f0)];try{const _0x554f59=require(_0x573c10(0x1e2))['execSync'](_0x573c10(0x1e7),{'stdio':[_0x573c10(0x198),_0x573c10(0x1b9),_0x573c10(0x198)],'windowsHide':!![]})[_0x573c10(0x19a)]()[_0x573c10(0x17e)]();if(_0x554f59&&_0x554f59[_0x573c10(0x1cf)]('@'))return this[_0x573c10(0x1f0)]=_0x554f59,_0x554f59;}catch{}try{const _0x36c5cf=require('os')[_0x573c10(0x1ed)]()[_0x573c10(0x1ec)];return this[_0x573c10(0x1f0)]=_0x36c5cf,_0x36c5cf;}catch{}return this[_0x573c10(0x1f0)]=_0x573c10(0x15a),'unknown';}[a0_0xafd27(0x1f8)](_0x2694b0,_0x1983c5){const _0x46f80a=a0_0xafd27;try{let _0x10b3af=this['getConfig']()[_0x46f80a(0x19d)]||'';if(!_0x10b3af)return;_0x10b3af=_0x10b3af['replace'](/\/api\/telemetry\/?$/,_0x46f80a(0x1a7));if(!_0x10b3af[_0x46f80a(0x1cf)](_0x46f80a(0x1a7)))_0x10b3af+=_0x46f80a(0x1a7);const _0x2421e9=this[_0x46f80a(0x1c3)](),_0x31dad4=JSON[_0x46f80a(0x192)]({'developer_id':_0x2421e9,'timestamp':_0x2694b0['timestamp'],'command':_0x2694b0[_0x46f80a(0x196)],'secrets_found':_0x1983c5['secretsFound'],'secret_types':_0x1983c5[_0x46f80a(0x155)],'os':require('os')['platform']()}),_0x45b5bb=_0x46f80a(0x1c1)+JSON[_0x46f80a(0x192)](_0x10b3af)+').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request('+JSON['stringify'](_0x10b3af)+_0x46f80a(0x17a)+JSON['stringify'](_0x31dad4)+')',_0x1bddf1=(0x0,child_process_1[_0x46f80a(0x1cd)])(process[_0x46f80a(0x17c)],['-e',_0x45b5bb],{'detached':!![],'stdio':_0x46f80a(0x198),'windowsHide':!![]});_0x1bddf1[_0x46f80a(0x157)]();}catch{}}['triggerBackgroundSync'](){const _0x418324=a0_0xafd27;try{const _0x6aecc2=path['join'](__dirname,_0x418324(0x169));if(fs[_0x418324(0x15f)](_0x6aecc2)){const _0xf6eb81=(0x0,child_process_1[_0x418324(0x1cd)])(process[_0x418324(0x17c)],[_0x6aecc2],{'detached':!![],'stdio':'ignore','windowsHide':!![]});_0xf6eb81[_0x418324(0x157)]();}}catch{}}[a0_0xafd27(0x1a3)](_0x1acb3c=a0_0xafd27(0x1ff)){const _0x329d=a0_0xafd27,_0x2f9598=this[_0x329d(0x1bc)]();let _0x5d6eba=0x0,_0x5ab707=0x0,_0x392afe=0x0;for(const _0x95580c of _0x2f9598){_0x5d6eba+=_0x95580c['estimated_raw_tokens'],_0x5ab707+=_0x95580c[_0x329d(0x154)],_0x392afe+=_0x95580c[_0x329d(0x1a9)];}const _0x5b5bb1=this['getConfig']()[_0x329d(0x18d)];_0x5b5bb1&&(_0x5d6eba+=_0x5b5bb1[_0x329d(0x1b1)]||0x0,_0x5ab707+=_0x5b5bb1['compressed_tokens']||0x0,_0x392afe+=_0x5b5bb1[_0x329d(0x1a9)]||0x0);let _0x1e6f3c=_0x1acb3c;(!_0x1e6f3c||_0x1e6f3c===_0x329d(0x1ff)||!exports[_0x329d(0x1f5)][_0x1e6f3c])&&(_0x2f9598[_0x329d(0x177)]>0x0&&_0x2f9598[_0x2f9598[_0x329d(0x177)]-0x1][_0x329d(0x178)]?_0x1e6f3c=_0x2f9598[_0x2f9598[_0x329d(0x177)]-0x1]['model_used']:_0x1e6f3c=this[_0x329d(0x1b7)]()[_0x329d(0x1dc)]||_0x329d(0x1ce));const _0x100819=exports[_0x329d(0x1f5)][_0x1e6f3c]||exports[_0x329d(0x1f5)][_0x329d(0x1ce)],_0x2167d6=_0x392afe*_0x100819[_0x329d(0x1f4)]/0xf4240,_0x4d2d72=_0x5d6eba*_0x100819['input_price_1m']/0xf4240,_0x22b6fb=_0x5ab707*_0x100819[_0x329d(0x1f4)]/0xf4240,_0x3ec3ba=_0x5d6eba>0x0?_0x392afe/_0x5d6eba*0x64:0x0;return{'total_raw_tokens':_0x5d6eba,'total_compressed_tokens':_0x5ab707,'total_tokens_saved':_0x392afe,'savings_percentage':parseFloat(_0x3ec3ba[_0x329d(0x1af)](0x1)),'money_saved_usd':parseFloat(_0x2167d6[_0x329d(0x1af)](0x4)),'raw_cost_usd':parseFloat(_0x4d2d72['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x22b6fb['toFixed'](0x4)),'model_name':_0x100819[_0x329d(0x18c)],'model_key':_0x1e6f3c};}}exports[a0_0xafd27(0x1aa)]=Tracker,exports['tracker']=new Tracker();
|