@simosphere/tokenizer-speedup 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/dist/cli/analyze.js +1 -1
- package/dist/cli/config-cmd.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/setup-cmd.js +1 -1
- package/dist/cloud/stripe-checkout.js +1 -1
- package/dist/cloud/stripe-config.js +1 -1
- package/dist/cloud/stripe-usage.js +1 -1
- package/dist/cloud/stripe-webhooks.js +1 -1
- package/dist/cloud/subscription-store.js +1 -1
- package/dist/manifest.json +32 -63
- package/dist/plugin/cli.js +1 -1
- package/dist/plugin/config-loader.js +1 -1
- package/dist/plugin/context-compressor.js +1 -1
- package/dist/plugin/hook-dispatcher.js +1 -1
- package/dist/plugin/metering-client.js +1 -1
- package/dist/plugin/metrics-collector.js +1 -1
- package/dist/plugin/onboarding.js +1 -1
- package/dist/plugin/precompact-handler.js +1 -1
- package/dist/plugin/report.js +1 -1
- package/dist/plugin/rule-analytics-store.js +1 -1
- package/dist/plugin/rule-analytics.js +1 -1
- package/dist/plugin/rule-engine.js +1 -1
- package/dist/plugin/rule-sharing.js +1 -1
- package/dist/plugin/rule-suggest.js +1 -1
- package/dist/plugin/session-start.js +1 -1
- package/dist/plugin/smart-context.js +1 -1
- package/dist/shared/license.js +1 -1
- package/dist/shared/providers/claude-provider.js +1 -1
- package/dist/shared/providers/openai-provider.js +1 -1
- package/dist/shared/token-counter.js +1 -1
- package/dist/shared/token-provider.js +1 -1
- package/package.json +1 -1
- package/dist/cli/analyze.d.ts +0 -13
- package/dist/cli/analyze.js.map +0 -1
- package/dist/cli/config-cmd.d.ts +0 -10
- package/dist/cli/config-cmd.js.map +0 -1
- package/dist/cli/index.d.ts +0 -5
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/setup-cmd.d.ts +0 -2
- package/dist/cli/setup-cmd.js.map +0 -1
- package/dist/cloud/stripe-checkout.d.ts +0 -11
- package/dist/cloud/stripe-checkout.js.map +0 -1
- package/dist/cloud/stripe-config.d.ts +0 -35
- package/dist/cloud/stripe-config.js.map +0 -1
- package/dist/cloud/stripe-usage.d.ts +0 -30
- package/dist/cloud/stripe-usage.js.map +0 -1
- package/dist/cloud/stripe-webhooks.d.ts +0 -15
- package/dist/cloud/stripe-webhooks.js.map +0 -1
- package/dist/cloud/subscription-store.d.ts +0 -23
- package/dist/cloud/subscription-store.js.map +0 -1
- package/dist/plugin/cli.d.ts +0 -2
- package/dist/plugin/cli.js.map +0 -1
- package/dist/plugin/config-loader.d.ts +0 -6
- package/dist/plugin/config-loader.js.map +0 -1
- package/dist/plugin/context-compressor.d.ts +0 -22
- package/dist/plugin/context-compressor.js.map +0 -1
- package/dist/plugin/hook-dispatcher.d.ts +0 -11
- package/dist/plugin/hook-dispatcher.js.map +0 -1
- package/dist/plugin/metering-client.d.ts +0 -26
- package/dist/plugin/metering-client.js.map +0 -1
- package/dist/plugin/metrics-collector.d.ts +0 -19
- package/dist/plugin/metrics-collector.js.map +0 -1
- package/dist/plugin/onboarding.d.ts +0 -13
- package/dist/plugin/onboarding.js.map +0 -1
- package/dist/plugin/precompact-handler.d.ts +0 -26
- package/dist/plugin/precompact-handler.js.map +0 -1
- package/dist/plugin/report.d.ts +0 -13
- package/dist/plugin/report.js.map +0 -1
- package/dist/plugin/rule-analytics-store.d.ts +0 -3
- package/dist/plugin/rule-analytics-store.js.map +0 -1
- package/dist/plugin/rule-analytics.d.ts +0 -12
- package/dist/plugin/rule-analytics.js.map +0 -1
- package/dist/plugin/rule-engine.d.ts +0 -9
- package/dist/plugin/rule-engine.js.map +0 -1
- package/dist/plugin/rule-sharing.d.ts +0 -19
- package/dist/plugin/rule-sharing.js.map +0 -1
- package/dist/plugin/rule-suggest.d.ts +0 -7
- package/dist/plugin/rule-suggest.js.map +0 -1
- package/dist/plugin/session-start.d.ts +0 -6
- package/dist/plugin/session-start.js.map +0 -1
- package/dist/plugin/smart-context.d.ts +0 -7
- package/dist/plugin/smart-context.js.map +0 -1
- package/dist/shared/license.d.ts +0 -7
- package/dist/shared/license.js.map +0 -1
- package/dist/shared/providers/claude-provider.d.ts +0 -2
- package/dist/shared/providers/claude-provider.js.map +0 -1
- package/dist/shared/providers/openai-provider.d.ts +0 -2
- package/dist/shared/providers/openai-provider.js.map +0 -1
- package/dist/shared/token-counter.d.ts +0 -10
- package/dist/shared/token-counter.js.map +0 -1
- package/dist/shared/token-provider.d.ts +0 -10
- package/dist/shared/token-provider.js.map +0 -1
- package/dist/shared/types.d.ts +0 -62
- package/dist/shared/types.js.map +0 -1
package/dist/cli/analyze.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x5259c3=_0x3348;(function(_0x11b825,_0x207b8c){const _0x40e6a6=_0x3348,_0x4d1fc3=_0x11b825();while(!![]){try{const _0x1e8e6f=parseInt(_0x40e6a6(0x165))/0x1*(-parseInt(_0x40e6a6(0x174))/0x2)+-parseInt(_0x40e6a6(0x172))/0x3*(-parseInt(_0x40e6a6(0x168))/0x4)+-parseInt(_0x40e6a6(0x167))/0x5*(parseInt(_0x40e6a6(0x16b))/0x6)+parseInt(_0x40e6a6(0x163))/0x7+parseInt(_0x40e6a6(0x16f))/0x8+parseInt(_0x40e6a6(0x16a))/0x9+-parseInt(_0x40e6a6(0x16c))/0xa;if(_0x1e8e6f===_0x207b8c)break;else _0x4d1fc3['push'](_0x4d1fc3['shift']());}catch(_0x569507){_0x4d1fc3['push'](_0x4d1fc3['shift']());}}}(_0x860a,0xad929));function _0x860a(){const _0x5e148a=['305253udDZnF','86070SjsVzv','6120750fgaNRF','openai','claude','2812184XQbFht','filter','fLAFs','219nsFicv','countTokens','22ipNSEB','gFpOX','leVGT','5887644yvDAfb','QrbjG','30937GwjjRE','gpt-4o','290nIDaqG','69524FfEzNy','split'];_0x860a=function(){return _0x5e148a;};return _0x860a();}import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x1acc81,_0x4ab9b3=_0x5259c3(0x16e),_0x3a741c){const _0x23655e=_0x5259c3,_0x5654ed={'QrbjG':'claude-sonnet-4-20250514','YIbhU':_0x23655e(0x166)},_0x84fb69=_0x3a741c??('claude'===_0x4ab9b3?_0x5654ed[_0x23655e(0x164)]:_0x5654ed['YIbhU']),_0x5c05e6=createTokenProvider(_0x4ab9b3,_0x84fb69),_0x1d1c24=_0x1acc81[_0x23655e(0x169)](/\s+/)[_0x23655e(0x170)](Boolean)['length'];return{'tokens':_0x5c05e6[_0x23655e(0x173)](_0x1acc81),'estimate':_0x5c05e6['estimateTokens'](_0x1acc81),'provider':_0x4ab9b3,'model':_0x84fb69,'chars':_0x1acc81['length'],'words':_0x1d1c24};}function _0x3348(_0x3aff35,_0x1ea973){_0x3aff35=_0x3aff35-0x162;const _0x860a9f=_0x860a();let _0x334852=_0x860a9f[_0x3aff35];return _0x334852;}export function analyzeFile(_0x407290,_0x5ddfe4=_0x5259c3(0x16e),_0x11070d){const _0x517829=_0x5259c3,_0x5b7959={'fLAFs':function(_0x479d97,_0x39fb77,_0x445e58){return _0x479d97(_0x39fb77,_0x445e58);},'leVGT':'utf-8'};return analyzeText(_0x5b7959[_0x517829(0x171)](readFileSync,_0x407290,_0x5b7959[_0x517829(0x162)]),_0x5ddfe4,_0x11070d);}export function compareProviders(_0x17d16f){const _0x2905cd=_0x5259c3,_0x32d9fa={'gFpOX':function(_0x397a3d,_0x4a44ee,_0x3c85bc){return _0x397a3d(_0x4a44ee,_0x3c85bc);}};return{'claude':_0x32d9fa[_0x2905cd(0x175)](analyzeText,_0x17d16f,_0x2905cd(0x16e)),'openai':analyzeText(_0x17d16f,_0x2905cd(0x16d))};}
|
package/dist/cli/config-cmd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x13f1ad,_0x283aea){const _0x42762a=_0x30e1,_0x283da8=_0x13f1ad();while(!![]){try{const _0x38f449=parseInt(_0x42762a(0xb8))/0x1+parseInt(_0x42762a(0xbb))/0x2+parseInt(_0x42762a(0xbd))/0x3+-parseInt(_0x42762a(0xbf))/0x4+-parseInt(_0x42762a(0xba))/0x5*(-parseInt(_0x42762a(0xc0))/0x6)+parseInt(_0x42762a(0xbe))/0x7+-parseInt(_0x42762a(0xbc))/0x8;if(_0x38f449===_0x283aea)break;else _0x283da8['push'](_0x283da8['shift']());}catch(_0xe0df2c){_0x283da8['push'](_0x283da8['shift']());}}}(_0x43a9,0xdad7d));import'../shared/providers/claude-provider.js';function _0x30e1(_0x3a549b,_0x5cbb6f){_0x3a549b=_0x3a549b-0xb8;const _0x43a96e=_0x43a9();let _0x30e180=_0x43a96e[_0x3a549b];return _0x30e180;}function _0x43a9(){const _0x27bf9c=['2010978UgsmVz','3997539vXdqJh','2158744ngSzJh','246UnXlVw','425129lsKHRo','length','112505bAVjOi','2616758KVFJtU','19691080tohtOt'];_0x43a9=function(){return _0x27bf9c;};return _0x43a9();}import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x28dfee){const _0x59ccf4=_0x30e1;try{const _0x3f077c=parseConfig(_0x28dfee);return{'valid':!0x0,'provider':_0x3f077c['provider'],'model':_0x3f077c['model'],'ruleCount':_0x3f077c['rules'][_0x59ccf4(0xb9)]};}catch(_0x32d42b){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x32d42b['message']};}}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const _0x533665=_0x8fd7;(function(_0x3f2219,_0x164348){const _0x325cb5=_0x8fd7,_0x32e0cc=_0x3f2219();while(!![]){try{const _0x572951=parseInt(_0x325cb5(0xf9))/0x1*(parseInt(_0x325cb5(0xe9))/0x2)+parseInt(_0x325cb5(0xe6))/0x3*(parseInt(_0x325cb5(0x107))/0x4)+parseInt(_0x325cb5(0x111))/0x5+parseInt(_0x325cb5(0x10b))/0x6+parseInt(_0x325cb5(0xf7))/0x7*(-parseInt(_0x325cb5(0xe1))/0x8)+-parseInt(_0x325cb5(0x106))/0x9*(-parseInt(_0x325cb5(0x10d))/0xa)+parseInt(_0x325cb5(0x112))/0xb*(-parseInt(_0x325cb5(0xf5))/0xc);if(_0x572951===_0x164348)break;else _0x32e0cc['push'](_0x32e0cc['shift']());}catch(_0xec0a44){_0x32e0cc['push'](_0x32e0cc['shift']());}}}(_0x22f4,0x8df13));import{Command}from'commander';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';function _0x22f4(){const _0x249cb2=['0.7.4','name','Validate\x20configuration\x20file','Analyze\x20inline\x20text\x20instead\x20of\x20file','LLM\x20provider\x20(claude,\x20openai)','message','216896SWKWbN','tokenizer-speedup.yaml','--api-key\x20<key>','YLQTZ','includes','2279961RauDQN','AxIQI','AgPrD','2078BbMBwm','description','-p,\x20--provider\x20<provider>','log','argument','WNfZF','action','rules','[file]','rJKXk','claude-sonnet-4-20250514','apiKey','12yomntL','option','238kekgIJ','config','478wUFIet','../plugin/config-loader.js','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','File\x20to\x20analyze','fTuBs','command','rNlJw','addHelpText','exitCode','setup','wXkIN','sZyFX','stringify','2675565CRmska','4TRarrT','requiredOption','cli/index','Error:\x20','430374xhqskG','argv','30xXgaLO','XyYJf','error','length','183580KInSFF','8290986cvEgsG','provider','utf-8','text','model'];_0x22f4=function(){return _0x249cb2;};return _0x22f4();}import{readFileSync,realpathSync}from'node:fs';import{runSetup}from'./setup-cmd.js';function _0x8fd7(_0x3a7ef4,_0x361bcd){_0x3a7ef4=_0x3a7ef4-0xdb;const _0x22f45f=_0x22f4();let _0x8fd7c7=_0x22f45f[_0x3a7ef4];return _0x8fd7c7;}export function buildCLI(){const _0x2484dd=_0x8fd7,_0x475efe={'rJKXk':function(_0x23fcdc,_0x5deb3a){return _0x23fcdc===_0x5deb3a;},'AxIQI':'gpt-4o','wXkIN':'Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','eKEZt':function(_0x1eb5f3,_0x25706d){return _0x1eb5f3>_0x25706d;},'Aecvc':function(_0x5b215c,_0x2f8318){return _0x5b215c??_0x2f8318;},'WNfZF':function(_0x1b7371,_0x4b5208,_0x257571){return _0x1b7371(_0x4b5208,_0x257571);},'fTuBs':function(_0x16b82e,_0x57f554){return _0x16b82e(_0x57f554);},'rNlJw':'Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)','MjnFY':'Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text','YLQTZ':_0x2484dd(0xeb),'AgPrD':'claude','PelOx':'-m,\x20--model\x20<model>','sZyFX':'Model\x20name','cdrkM':'-t,\x20--text\x20<text>','FFxrN':_0x2484dd(0xf8),'xnpPl':_0x2484dd(0xdd),'XyYJf':_0x2484dd(0xf1),'iZsxw':'Config\x20file\x20path','JkICn':_0x2484dd(0xe2)},_0x6bc258=new Command();return _0x6bc258[_0x2484dd(0xdc)]('tsu')[_0x2484dd(0xea)]('TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI')['version'](_0x2484dd(0xdb))[_0x2484dd(0x100)]('after','\x0aExamples:\x0a\x20\x20$\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x20\x20\x20Configure\x20with\x20your\x20API\x20key\x0a\x20\x20$\x20tsu\x20analyze\x20src/index.ts\x20\x20\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20a\x20file\x0a\x20\x20$\x20tsu\x20analyze\x20--text\x20\x22Hello\x22\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20inline\x20text\x0a\x20\x20$\x20tsu\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Validate\x20tokenizer-speedup.yaml\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Get\x20your\x20free\x20API\x20key\x20at\x20https://tokenizer-speedup.simosphereai.com\x0a\x20\x202.\x20Run:\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x0a\x20\x203.\x20Restart\x20Claude\x20Code\x20—\x20the\x20plugin\x20activates\x20automatically\x0a\x0aDocs:\x20https://tokenizer-speedup.simosphereai.com\x0a'),_0x6bc258[_0x2484dd(0xfe)](_0x2484dd(0x102))['description'](_0x2484dd(0xfb))[_0x2484dd(0x108)](_0x2484dd(0xe3),_0x475efe[_0x2484dd(0xff)])['action'](_0x1001c3=>{const _0x23b0a4=_0x2484dd;runSetup(_0x1001c3[_0x23b0a4(0xf4)]);}),_0x6bc258['command']('analyze')[_0x2484dd(0xea)](_0x475efe['MjnFY'])[_0x2484dd(0xed)]('[file]',_0x2484dd(0xfc))['option'](_0x475efe[_0x2484dd(0xe4)],_0x2484dd(0xdf),_0x475efe[_0x2484dd(0xe8)])[_0x2484dd(0xf6)](_0x475efe['PelOx'],_0x475efe[_0x2484dd(0x104)])[_0x2484dd(0xf6)](_0x475efe['cdrkM'],_0x2484dd(0xde))[_0x2484dd(0xef)]((_0x394e9c,_0x40a41c)=>{const _0x288e80=_0x2484dd,_0x4a042f=_0x40a41c[_0x288e80(0x116)]??(_0x475efe[_0x288e80(0xf2)]('claude',_0x40a41c[_0x288e80(0x113)])?_0x288e80(0xf3):_0x475efe[_0x288e80(0xe7)]);let _0xb878cd,_0x2f2513;try{_0xb878cd=createTokenProvider(_0x40a41c[_0x288e80(0x113)],_0x4a042f);}catch(_0x13f61f){return console['error'](_0x288e80(0x10a)+_0x13f61f[_0x288e80(0xe0)]),void(process[_0x288e80(0x101)]=0x1);}if(void 0x0!==_0x40a41c[_0x288e80(0x115)])_0x2f2513=_0x40a41c[_0x288e80(0x115)];else{if(!_0x394e9c)return console[_0x288e80(0x10f)](_0x475efe[_0x288e80(0x103)]),void(process[_0x288e80(0x101)]=0x1);_0x2f2513=readFileSync(_0x394e9c,'utf-8');}_0x475efe['eKEZt'](_0x2f2513[_0x288e80(0x110)],0x7a120)&&console[_0x288e80(0x10f)]('Warning:\x20large\x20input\x20('+(_0x2f2513[_0x288e80(0x110)]/0x3e8)['toFixed'](0x0)+'K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.');const _0x1d6fc0=_0xb878cd['countTokens'](_0x2f2513),_0x3de2a9=_0xb878cd['estimateTokens'](_0x2f2513);console['log'](JSON['stringify']({'file':_0x475efe['Aecvc'](_0x394e9c,'(inline)'),'tokens':_0x1d6fc0,'estimate':_0x3de2a9,'provider':_0x40a41c['provider'],'model':_0x4a042f}));}),_0x6bc258['command'](_0x475efe['FFxrN'])[_0x2484dd(0xea)](_0x475efe['xnpPl'])[_0x2484dd(0xed)](_0x475efe[_0x2484dd(0x10e)],_0x475efe['iZsxw'],_0x475efe['JkICn'])['action'](async _0x174bfd=>{const _0x1def43=_0x2484dd;try{const _0x4f6f96=_0x475efe[_0x1def43(0xee)](readFileSync,_0x174bfd,_0x1def43(0x114)),{parseConfig:_0x17e74d}=await import(_0x1def43(0xfa)),_0x1698a8=_0x475efe[_0x1def43(0xfd)](_0x17e74d,_0x4f6f96);console['log'](JSON[_0x1def43(0x105)]({'valid':!0x0,'provider':_0x1698a8['provider'],'model':_0x1698a8['model'],'ruleCount':_0x1698a8[_0x1def43(0xf0)]['length']}));}catch(_0x171f05){console[_0x1def43(0xec)](JSON['stringify']({'valid':!0x1,'error':_0x171f05[_0x1def43(0xe0)]})),process[_0x1def43(0x101)]=0x1;}}),_0x6bc258;}const resolvedArgv1=((()=>{const _0x4bf85a=_0x8fd7;try{return realpathSync(process[_0x4bf85a(0x10c)][0x1]??'')['replace'](/\\/g,'/');}catch{return process['argv'][0x1]?.['replace'](/\\/g,'/')??'';}})());resolvedArgv1[_0x533665(0xe5)](_0x533665(0x109))&&buildCLI()['parse']();
|
package/dist/cli/setup-cmd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x2583ba=_0x2317;(function(_0x4d3510,_0x25d5d8){const _0x1ba371=_0x2317,_0x229628=_0x4d3510();while(!![]){try{const _0x3f6665=-parseInt(_0x1ba371(0x1e5))/0x1+-parseInt(_0x1ba371(0x1e9))/0x2*(-parseInt(_0x1ba371(0x1ff))/0x3)+-parseInt(_0x1ba371(0x1ee))/0x4*(-parseInt(_0x1ba371(0x1f0))/0x5)+-parseInt(_0x1ba371(0x1f5))/0x6+parseInt(_0x1ba371(0x1ef))/0x7*(parseInt(_0x1ba371(0x1fd))/0x8)+parseInt(_0x1ba371(0x200))/0x9+-parseInt(_0x1ba371(0x1fe))/0xa;if(_0x3f6665===_0x25d5d8)break;else _0x229628['push'](_0x229628['shift']());}catch(_0x10c574){_0x229628['push'](_0x229628['shift']());}}}(_0x3e78,0x58f88));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),'.config','tokenizer-speedup'),CONFIG_FILE=join(CONFIG_DIR,_0x2583ba(0x1ec)),CLAUDE_SETTINGS_FILE=join(homedir(),'.claude',_0x2583ba(0x1e7));export function runSetup(_0x27f32f){const _0x4d21f4=_0x2583ba,_0x24e5fe={'NYdFc':'✅\x20API\x20key\x20saved\x20successfully.','hCgYV':_0x4d21f4(0x1eb),'gTdVb':'✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.'};try{if(!_0x27f32f||0x0===_0x27f32f['trim']()[_0x4d21f4(0x1f4)])return console['error'](_0x4d21f4(0x202)),void(process['exitCode']=0x1);if(_0x27f32f[_0x4d21f4(0x1e8)]()[_0x4d21f4(0x1f4)]<0x8)return console['error']('❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).'),void(process[_0x4d21f4(0x204)]=0x1);saveApiKey(_0x27f32f[_0x4d21f4(0x1e8)]()),console['log'](_0x24e5fe[_0x4d21f4(0x1e6)]),console['log'](_0x24e5fe[_0x4d21f4(0x1f9)]),registerHooks(),console['log'](_0x24e5fe[_0x4d21f4(0x1f7)]),console['log'](''),console[_0x4d21f4(0x1f3)]('Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.');}catch(_0x5943ee){console[_0x4d21f4(0x203)](_0x4d21f4(0x1f2)+_0x5943ee['message']),process['exitCode']=0x1;}}function saveApiKey(_0x2fa3c8){const _0x36abcd=_0x2583ba,_0x2242a7={'Krxur':_0x36abcd(0x1f6),'oGYzA':function(_0x3c4787,_0x42908d){return _0x3c4787+_0x42908d;}};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x196c2a={};try{_0x196c2a=JSON['parse'](readFileSync(CONFIG_FILE,_0x2242a7[_0x36abcd(0x1fa)]));}catch{}_0x196c2a['apiKey']=_0x2fa3c8,writeFileSync(CONFIG_FILE,_0x2242a7['oGYzA'](JSON[_0x36abcd(0x1ed)](_0x196c2a,null,0x2),'\x0a'),_0x2242a7[_0x36abcd(0x1fa)]);}function _0x3e78(){const _0x37b861=['5425880GCDgYR','3hLuRyI','4110192uAoBvQ','MraSQ','❌\x20API\x20key\x20cannot\x20be\x20empty.','error','exitCode','708682vQcCcf','NYdFc','settings.local.json','trim','1300408rBPNul','command','⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','config.json','stringify','263372fKhAMD','35lnxkeo','15gJRSRC','JxODq','❌\x20Setup\x20failed:\x20','log','length','2255892PPyMJB','utf-8','gTdVb','ZvgQm','hCgYV','Krxur','parse','dieIt','1099608YCrpyx'];_0x3e78=function(){return _0x37b861;};return _0x3e78();}function _0x2317(_0x56721f,_0xee2385){_0x56721f=_0x56721f-0x1e5;const _0x3e7827=_0x3e78();let _0x23179e=_0x3e7827[_0x56721f];return _0x23179e;}function registerHooks(){const _0xeec747=_0x2583ba,_0x1992f1={'ZvgQm':function(_0x26652d,_0x4a6a1a,_0x541135){return _0x26652d(_0x4a6a1a,_0x541135);},'JxODq':function(_0x4fc184,_0x401995,_0x156d13){return _0x4fc184(_0x401995,_0x156d13);},'MraSQ':'.claude','mdXdE':_0xeec747(0x1f6),'wiGLP':'command','YhXlU':'tokenizer-speedup','dieIt':function(_0x4fbfa6,_0x484170,_0x5803b6,_0x513af2){return _0x4fbfa6(_0x484170,_0x5803b6,_0x513af2);}};_0x1992f1[_0xeec747(0x1f8)](mkdirSync,_0x1992f1['JxODq'](join,homedir(),_0x1992f1[_0xeec747(0x201)]),{'recursive':!0x0});let _0x296bf1={};try{_0x296bf1=JSON['parse'](_0x1992f1[_0xeec747(0x1f1)](readFileSync,CLAUDE_SETTINGS_FILE,_0x1992f1['mdXdE']));}catch{}const _0x2b182b=_0x296bf1['hooks']??{};_0x2b182b['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':_0x1992f1['wiGLP'],'command':_0x1992f1['YhXlU']}]}],_0x2b182b['Stop']=[{'matcher':'','hooks':[{'type':_0xeec747(0x1ea),'command':_0x1992f1['YhXlU'],'timeout':0xa}]}],_0x296bf1['hooks']=_0x2b182b,_0x1992f1[_0xeec747(0x1fc)](writeFileSync,CLAUDE_SETTINGS_FILE,JSON['stringify'](_0x296bf1,null,0x2)+'\x0a',_0x1992f1['mdXdE']);}export function loadApiKeyFromConfig(){const _0x2e3f83=_0x2583ba;try{return JSON[_0x2e3f83(0x1fb)](readFileSync(CONFIG_FILE,_0x2e3f83(0x1f6)))['apiKey']??void 0x0;}catch{return;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x27a6a9,_0x48c54e){const _0x23c912=_0x4f39,_0x46f64b=_0x27a6a9();while(!![]){try{const _0x1da112=-parseInt(_0x23c912(0x74))/0x1*(-parseInt(_0x23c912(0x79))/0x2)+-parseInt(_0x23c912(0x6e))/0x3*(-parseInt(_0x23c912(0x70))/0x4)+-parseInt(_0x23c912(0x76))/0x5*(-parseInt(_0x23c912(0x71))/0x6)+-parseInt(_0x23c912(0x6d))/0x7+parseInt(_0x23c912(0x6f))/0x8*(-parseInt(_0x23c912(0x7b))/0x9)+parseInt(_0x23c912(0x72))/0xa*(-parseInt(_0x23c912(0x73))/0xb)+-parseInt(_0x23c912(0x77))/0xc*(-parseInt(_0x23c912(0x78))/0xd);if(_0x1da112===_0x48c54e)break;else _0x46f64b['push'](_0x46f64b['shift']());}catch(_0x3ea3de){_0x46f64b['push'](_0x46f64b['shift']());}}}(_0x462e,0xd0bfb));export function buildCheckoutParams(_0x403987){const _0x1e67db=_0x4f39,_0x253055={'MmJAP':_0x1e67db(0x7a)},_0x325382=[{'price':_0x403987[_0x1e67db(0x6c)],'quantity':0x1}];return _0x403987[_0x1e67db(0x75)]&&_0x325382['push']({'price':_0x403987['meteredPriceId']}),{'customer':_0x403987['customerId'],'mode':_0x253055['MmJAP'],'line_items':_0x325382,'success_url':_0x403987['successUrl'],'cancel_url':_0x403987['cancelUrl'],'metadata':{'tier':_0x403987['tier']}};}function _0x4f39(_0x3029dd,_0x58a08c){_0x3029dd=_0x3029dd-0x6c;const _0x462ed5=_0x462e();let _0x4f3917=_0x462ed5[_0x3029dd];return _0x4f3917;}function _0x462e(){const _0x2b219e=['meteredPriceId','5vcrEcS','24sfddIz','10942672DuLHbq','455234dgPvwr','subscription','9475965NwSKbg','recurringPriceId','7716499DvLCdn','366OuGudu','8UkyACr','7564TPYHOi','9448836fbAKbC','40iCHHAl','1942424medQRU','1XMfFWr'];_0x462e=function(){return _0x2b219e;};return _0x462e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x45ec3c=_0x512b;function _0x512b(_0x5ca010,_0x28a237){_0x5ca010=_0x5ca010-0x16b;const _0x1501ae=_0x1501();let _0x512b9f=_0x1501ae[_0x5ca010];return _0x512b9f;}function _0x1501(){const _0x5f4e91=['TokenizerSpeedUp\x20Pro','6927010anTjNn','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','11JATHGW','3318SzpifS','32VsUooO','1038243rhmZhz','Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','5525829SBBiwn','4wJgBYj','2170KYwOJH','302218myMdmz','204XWqVQr','379929xCnTZL','1195YpCiiK'];_0x1501=function(){return _0x5f4e91;};return _0x1501();}(function(_0x1faeda,_0x3b29a7){const _0x4749c8=_0x512b,_0x4356df=_0x1faeda();while(!![]){try{const _0x1ebf40=-parseInt(_0x4749c8(0x174))/0x1*(parseInt(_0x4749c8(0x16c))/0x2)+parseInt(_0x4749c8(0x177))/0x3*(parseInt(_0x4749c8(0x16b))/0x4)+parseInt(_0x4749c8(0x170))/0x5*(-parseInt(_0x4749c8(0x175))/0x6)+-parseInt(_0x4749c8(0x16d))/0x7*(parseInt(_0x4749c8(0x176))/0x8)+parseInt(_0x4749c8(0x179))/0x9+-parseInt(_0x4749c8(0x172))/0xa+-parseInt(_0x4749c8(0x16f))/0xb*(-parseInt(_0x4749c8(0x16e))/0xc);if(_0x1ebf40===_0x3b29a7)break;else _0x4356df['push'](_0x4356df['shift']());}catch(_0x46cd0b){_0x4356df['push'](_0x4356df['shift']());}}}(_0x1501,0x8347e));export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':'Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','recurringPrice':0x0},'pro':{'name':_0x45ec3c(0x171),'description':_0x45ec3c(0x178),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':'TokenizerSpeedUp\x20Team','description':_0x45ec3c(0x173),'recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x23a0ad=_0x35ba;function _0x35ba(_0x599b89,_0x515aa3){_0x599b89=_0x599b89-0x1c9;const _0x2e427b=_0x2e42();let _0x35ba11=_0x2e427b[_0x599b89];return _0x35ba11;}function _0x2e42(){const _0x3f8c70=['17155180LgFays','qIptI','1750216eDaNdE','9880038SMWoYJ','meteredUnitAmount','set','pro','floor','2250072UiyYIR','zLLYV','chargeableUnits','4910045tOqMCe','max','4723137gffINd','unitRate','allowance','5548968xdzUXb'];_0x2e42=function(){return _0x3f8c70;};return _0x2e42();}(function(_0x3d87e6,_0x1b1c93){const _0x39e9bd=_0x35ba,_0x1d934e=_0x3d87e6();while(!![]){try{const _0x142f18=parseInt(_0x39e9bd(0x1d0))/0x1+parseInt(_0x39e9bd(0x1d6))/0x2+-parseInt(_0x39e9bd(0x1ca))/0x3+parseInt(_0x39e9bd(0x1cd))/0x4+-parseInt(_0x39e9bd(0x1d9))/0x5+parseInt(_0x39e9bd(0x1d1))/0x6+-parseInt(_0x39e9bd(0x1ce))/0x7;if(_0x142f18===_0x1b1c93)break;else _0x1d934e['push'](_0x1d934e['shift']());}catch(_0x3748d6){_0x1d934e['push'](_0x1d934e['shift']());}}}(_0x2e42,0xdc397));import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG[_0x23a0ad(0x1d4)][_0x23a0ad(0x1d2)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG['team'][_0x23a0ad(0x1d2)]}};export function calculateUsageCharge(_0x9207a9,_0x39f52b){const _0x42d23c=_0x23a0ad,_0x4011de={'qIptI':function(_0xde690,_0x3e11c7){return _0xde690-_0x3e11c7;},'KVeIK':function(_0x48aed9,_0x48896d){return _0x48aed9*_0x48896d;}},_0x2c9513=TIER_LIMITS[_0x9207a9];if(0x0===_0x2c9513[_0x42d23c(0x1cb)])return{'tier':_0x9207a9,'tokensSaved':_0x39f52b,'freeAllowance':_0x2c9513[_0x42d23c(0x1cc)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x2dfb8a=Math[_0x42d23c(0x1c9)](0x0,_0x4011de[_0x42d23c(0x1cf)](_0x39f52b,_0x2c9513['allowance'])),_0x2a2bc8=Math['ceil'](_0x2dfb8a/0x186a0),_0x373632=_0x4011de['KVeIK'](_0x2a2bc8,_0x2c9513[_0x42d23c(0x1cb)]);return{'tier':_0x9207a9,'tokensSaved':_0x39f52b,'freeAllowance':_0x2c9513['allowance'],'chargeableTokens':_0x2dfb8a,'chargeableUnits':_0x2a2bc8,'unitRate':_0x2c9513[_0x42d23c(0x1cb)],'amount':_0x373632};}export function buildUsageRecord(_0x42171e,_0x38a766){const _0x34a2a6=_0x23a0ad,_0x5d2948={'oroQn':_0x34a2a6(0x1d3),'eawab':function(_0x3f877a,_0xeb5cbe){return _0x3f877a/_0xeb5cbe;}};return{'subscription_item':_0x42171e,'quantity':_0x38a766,'action':_0x5d2948['oroQn'],'timestamp':Math[_0x34a2a6(0x1d5)](_0x5d2948['eawab'](Date['now'](),0x3e8))};}export function prepareUsageSync(_0x2a72c5,_0x1bb4c5,_0x30bfb6){const _0x5130f5=_0x23a0ad,_0x2ebd99={'zLLYV':function(_0x152615,_0x4ede41,_0xf84f45){return _0x152615(_0x4ede41,_0xf84f45);}};if(!_0x30bfb6)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x2a72c5,'error':'no\x20subscription_item_id'};const _0x25fea0=_0x2ebd99[_0x5130f5(0x1d7)](calculateUsageCharge,_0x2a72c5,_0x1bb4c5);if(0x0===_0x25fea0['chargeableUnits'])return{'synced':!0x0,'subscriptionItemId':_0x30bfb6,'chargeableUnits':0x0,'tier':_0x2a72c5};return buildUsageRecord(_0x30bfb6,_0x25fea0[_0x5130f5(0x1d8)]),{'synced':!0x0,'subscriptionItemId':_0x30bfb6,'chargeableUnits':_0x25fea0[_0x5130f5(0x1d8)],'tier':_0x2a72c5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xa8ec47,_0x56b4e6){const _0x2acf3a=_0x5c39,_0x598c85=_0xa8ec47();while(!![]){try{const _0x526163=-parseInt(_0x2acf3a(0x179))/0x1+-parseInt(_0x2acf3a(0x183))/0x2*(parseInt(_0x2acf3a(0x180))/0x3)+parseInt(_0x2acf3a(0x18c))/0x4*(parseInt(_0x2acf3a(0x18e))/0x5)+-parseInt(_0x2acf3a(0x181))/0x6*(-parseInt(_0x2acf3a(0x184))/0x7)+-parseInt(_0x2acf3a(0x189))/0x8+parseInt(_0x2acf3a(0x18a))/0x9*(parseInt(_0x2acf3a(0x17f))/0xa)+-parseInt(_0x2acf3a(0x186))/0xb;if(_0x526163===_0x56b4e6)break;else _0x598c85['push'](_0x598c85['shift']());}catch(_0x53525c){_0x598c85['push'](_0x598c85['shift']());}}}(_0x429b,0x22e27));export function handleWebhookEvent(_0x4d7ccd,_0x5877f8){const _0x45b621=_0x5c39,_0x36b3ba={'xTFcy':'invoice.paid','TwiDH':'customer.subscription.updated','BPWtP':'subscription_updated','aBSVU':function(_0x3ed390,_0x595b4d){return _0x3ed390(_0x595b4d);},'lONTo':_0x45b621(0x191),'ZvGrk':'free'};switch(_0x4d7ccd[_0x45b621(0x185)]){case _0x36b3ba['xTFcy']:{const _0x1be965=_0x4d7ccd['data']['object'];return{'handled':!0x0,'action':_0x45b621(0x177),'customerId':_0x1be965['customer'],'subscriptionId':_0x1be965['subscription']};}case _0x36b3ba['TwiDH']:{const _0x4dfda2=_0x4d7ccd['data'][_0x45b621(0x18f)],_0x215aa2={'handled':!0x0,'action':_0x36b3ba[_0x45b621(0x17a)],'customerId':_0x4dfda2[_0x45b621(0x17b)],'subscriptionId':_0x4dfda2['id']};return _0x5877f8&&_0x5877f8['upsert']({'id':_0x4dfda2['id'],'customerId':_0x4dfda2[_0x45b621(0x17b)],'status':_0x4dfda2['status']||'active','tier':_0x4dfda2['metadata']?.[_0x45b621(0x17c)]||_0x45b621(0x190),'currentPeriodEnd':_0x4dfda2['current_period_end']||0x0,'meteredSubscriptionItemId':_0x36b3ba['aBSVU'](extractMeteredItemId,_0x4dfda2),'updatedAt':''}),_0x215aa2;}case _0x45b621(0x182):{const _0x14804c=_0x4d7ccd['data'][_0x45b621(0x18f)],_0x4a6e93={'handled':!0x0,'action':_0x36b3ba['lONTo'],'customerId':_0x14804c['customer'],'subscriptionId':_0x14804c['id']};return _0x5877f8&&_0x5877f8[_0x45b621(0x17d)]({'id':_0x14804c['id'],'customerId':_0x14804c[_0x45b621(0x17b)],'status':'canceled','tier':_0x14804c['metadata']?.[_0x45b621(0x17c)]||_0x36b3ba[_0x45b621(0x18d)],'currentPeriodEnd':_0x14804c[_0x45b621(0x178)]||0x0,'updatedAt':''}),_0x4a6e93;}default:return{'handled':!0x1,'action':'ignored'};}}function _0x5c39(_0x558b5b,_0x1bd363){_0x558b5b=_0x558b5b-0x177;const _0x429b17=_0x429b();let _0x5c39a7=_0x429b17[_0x558b5b];return _0x5c39a7;}function _0x429b(){const _0x57eec1=['metered','8RvfTGZ','ZvGrk','700745uZtYKT','object','free','subscription_canceled','invoice_paid','current_period_end','169169VzeXJQ','BPWtP','customer','tier','upsert','data','10iMoAvb','555171pXKJtW','1633206fFLTdd','customer.subscription.deleted','2gIApmT','7gRZVKF','type','2344958mSEIDC','find','recurring','223568fPCXGP','1671642mNDMgD'];_0x429b=function(){return _0x57eec1;};return _0x429b();}function extractMeteredItemId(_0x3047b6){const _0x504a01=_0x5c39,_0x4be0d6=_0x3047b6['items'];if(!_0x4be0d6?.[_0x504a01(0x17e)])return;const _0x3e69d4=_0x4be0d6['data'][_0x504a01(0x187)](_0x4791ba=>_0x504a01(0x18b)===_0x4791ba['price']?.[_0x504a01(0x188)]?.['usage_type']);return _0x3e69d4?.['id'];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x144a(){const _0x638725=['8275725OrOMFO','subs','upsert','61913VQLvxj','get','updatedAt','21ORejWw','953475OazLuX','32586eHGQIo','2045196EnQPoE','values','361808YredSr','60lHqttU','816156pHOLcf'];_0x144a=function(){return _0x638725;};return _0x144a();}const _0x4aec0f=_0x3289;function _0x3289(_0x5a8edf,_0x6f2cfd){_0x5a8edf=_0x5a8edf-0x84;const _0x144aa6=_0x144a();let _0x3289cc=_0x144aa6[_0x5a8edf];return _0x3289cc;}(function(_0x384cb6,_0x124f55){const _0x1a35e=_0x3289,_0xae3793=_0x384cb6();while(!![]){try{const _0x5c4336=-parseInt(_0x1a35e(0x91))/0x1+parseInt(_0x1a35e(0x88))/0x2*(parseInt(_0x1a35e(0x8c))/0x3)+parseInt(_0x1a35e(0x8d))/0x4+parseInt(_0x1a35e(0x87))/0x5+parseInt(_0x1a35e(0x89))/0x6+parseInt(_0x1a35e(0x86))/0x7*(parseInt(_0x1a35e(0x8b))/0x8)+-parseInt(_0x1a35e(0x8e))/0x9;if(_0x5c4336===_0x124f55)break;else _0xae3793['push'](_0xae3793['shift']());}catch(_0x40010a){_0xae3793['push'](_0xae3793['shift']());}}}(_0x144a,0x34a94));export class MemorySubscriptionStore{[_0x4aec0f(0x8f)]=new Map();[_0x4aec0f(0x90)](_0x15e057){const _0x1a82bf=_0x4aec0f;_0x15e057[_0x1a82bf(0x85)]=new Date()['toISOString'](),this[_0x1a82bf(0x8f)]['set'](_0x15e057['id'],_0x15e057);}['getByCustomerId'](_0x218662){const _0x33cc49=_0x4aec0f;for(const _0x5ed709 of this[_0x33cc49(0x8f)]['values']())if(_0x5ed709['customerId']===_0x218662)return _0x5ed709;}['getBySubscriptionId'](_0xc5c012){const _0x143898=_0x4aec0f;return this[_0x143898(0x8f)][_0x143898(0x84)](_0xc5c012);}['list'](){const _0x3981ac=_0x4aec0f;return[...this['subs'][_0x3981ac(0x8a)]()];}}
|
package/dist/manifest.json
CHANGED
|
@@ -1,68 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
3
|
-
"build": "2026-03-
|
|
2
|
+
"version": "0.7.4",
|
|
3
|
+
"build": "2026-03-05T07:28:48.533Z",
|
|
4
4
|
"files": {
|
|
5
|
-
"cli/analyze.
|
|
6
|
-
"cli/
|
|
7
|
-
"cli/
|
|
8
|
-
"cli/
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"cloud/
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"plugin/
|
|
24
|
-
"plugin/
|
|
25
|
-
"plugin/
|
|
26
|
-
"plugin/
|
|
27
|
-
"plugin/
|
|
28
|
-
"plugin/
|
|
29
|
-
"plugin/
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"plugin/onboarding.d.ts": "sha256:b907ca6fc63a732f28a3c173c4a79e42e84971a0efe7cde39c2d9767376a97b6",
|
|
36
|
-
"plugin/onboarding.js": "sha256:0426833434cd7da9cc80bfadfae1556adab6fdf8997d3998f06f4e63a68b0177",
|
|
37
|
-
"plugin/precompact-handler.d.ts": "sha256:52b1570601955ed1aa26541f651e3f45fde21ec6ce8042001dd0ac2fab253ccd",
|
|
38
|
-
"plugin/precompact-handler.js": "sha256:6f159b359f608cd28caa28104815fdb5984a490ca0994483d8e47ce580ab5b2b",
|
|
39
|
-
"plugin/report.d.ts": "sha256:8027321ede260c9302dfd19c73cf48e334595350fee14485475e50008f74645f",
|
|
40
|
-
"plugin/report.js": "sha256:11c6486b65fdb8e50d1f55084a7b8ccea0b8110dccbd14275d7a072675521f1c",
|
|
41
|
-
"plugin/rule-analytics-store.d.ts": "sha256:710a52c82dc6e4b2998cdd10a51083be8103b39b15b6d6d37ac8272a58e854ec",
|
|
42
|
-
"plugin/rule-analytics-store.js": "sha256:842aca0d3ec5ff631af88dbba5d1d235d32a74d3f8101b519e0fb9d5808a0b86",
|
|
43
|
-
"plugin/rule-analytics.d.ts": "sha256:cdeffbbc424b5452f57ca697b9c5e5ed0264efc0d56342ce476bd591b564aff3",
|
|
44
|
-
"plugin/rule-analytics.js": "sha256:b8e0035fb36ab0b1f82a7872ecbf9cb44700f358c048903a318e3deb54f1c4f9",
|
|
45
|
-
"plugin/rule-engine.d.ts": "sha256:e9e9e0c8af47ecf1c039a6db15a656ef3cd28e4a7521204d4eaf076a15ee2cc8",
|
|
46
|
-
"plugin/rule-engine.js": "sha256:c55d2b239ea9fc824f2c111f68e57350fe8ad17bf4edfa2c232cd5bb5fa11c23",
|
|
47
|
-
"plugin/rule-sharing.d.ts": "sha256:8fc87926ec3752c2e0d21274c98ef3bb21f2a10665eb5536b726ea8d94479a79",
|
|
48
|
-
"plugin/rule-sharing.js": "sha256:d4c1a3ef21b6625318e656d0960ec3936b2b660c3f54d980df17b449919fbca5",
|
|
49
|
-
"plugin/rule-suggest.d.ts": "sha256:4d12dac9df44bb3adf5b5e9456e683a42625e8b28712c80aa62292a5b3d40be9",
|
|
50
|
-
"plugin/rule-suggest.js": "sha256:fb6c57a1b305812bf0ee3d6024891fdf2d1b3e08c80c3fddaca0a4d14b1ab661",
|
|
51
|
-
"plugin/session-start.d.ts": "sha256:36cb2cc2a7e09195e650aa7a96b8ae420b612c23907fa35723501d27600d4ff1",
|
|
52
|
-
"plugin/session-start.js": "sha256:f0f8392071bf31c9273fab674e25a53c1e1ec83a7301f0f508344670e732ee63",
|
|
53
|
-
"plugin/smart-context.d.ts": "sha256:cace6c764ef3cf1a18f87f09ad4650abe69322b7629cd8383a7cc775f7f81be1",
|
|
54
|
-
"plugin/smart-context.js": "sha256:7004420859104fdf92f2a6603924b6d1e7984a10c871a69f90c6f897557ec3c1",
|
|
55
|
-
"shared/license.d.ts": "sha256:4778f87bbd80b5033479e03556a7e755aa7787707f3b875aa8795c4f1e97ee96",
|
|
56
|
-
"shared/license.js": "sha256:3d220e3b09eadec906caaeda93726bc601ea9a75eb92cd7c3fdc294c53cdb22c",
|
|
57
|
-
"shared/providers/claude-provider.d.ts": "sha256:58d95cac3a61871425760a3ad7cd4b7749737841d49f84f70e933c52ed297f32",
|
|
58
|
-
"shared/providers/claude-provider.js": "sha256:614f01440ddb381dcc47240a0b29436f2716722a5788300a65196c7653f83c0f",
|
|
59
|
-
"shared/providers/openai-provider.d.ts": "sha256:2114b5a1dcc4c03c5c26094d941189ffe4d6cb26a9ecc7e102830eb8bcab3cf7",
|
|
60
|
-
"shared/providers/openai-provider.js": "sha256:20ae4eaa066a8580974951f3886b021451f33be18b843a480b1f02f367350b66",
|
|
61
|
-
"shared/token-counter.d.ts": "sha256:d7e1bfe11fb4893dd936057db98fb4c9e1ee95c3d13b2bc24309fc471512f3b5",
|
|
62
|
-
"shared/token-counter.js": "sha256:50f9718629994f2f3e96fcf656025ed3ba1fcaaf74ffc8487095705fafa16e98",
|
|
63
|
-
"shared/token-provider.d.ts": "sha256:f3728d375158e79fef3055f56dc247395101ecee4c21911997668de3607aea0e",
|
|
64
|
-
"shared/token-provider.js": "sha256:9ddea82d958e1b0fd69d25f191bccb6f0e048072600bd69640db90bed2fb3acb",
|
|
65
|
-
"shared/types.d.ts": "sha256:20600b79ba665bdd2200ab8390784c37a508f29b23f1967a4662b86de8baa122",
|
|
5
|
+
"cli/analyze.js": "sha256:de1b97165c9428156ac7fce78f5f4783f29303d4d32cd54ddabdc4c7d7ee3e13",
|
|
6
|
+
"cli/config-cmd.js": "sha256:99b666d2a5d0d5d83cbf0d549334ffa4956564a2a34f0e7051add2b6ee719f81",
|
|
7
|
+
"cli/index.js": "sha256:b84bc6e8fa322addaa6230dd20e52451d7325c73781c69612c9fe9b37b993d28",
|
|
8
|
+
"cli/setup-cmd.js": "sha256:845081b06056c8f5c63efd6ecda2e2b2279b7b29c8db8d2321bf53a746fbae1b",
|
|
9
|
+
"cloud/stripe-checkout.js": "sha256:63600859eec26b903f937b28bfa1009c55ef9d450c8bb161dcb118edbd5a6b1a",
|
|
10
|
+
"cloud/stripe-config.js": "sha256:1b3c87b018011b268f2a2691b96f997d2152086dd11abac8f04d68854b95e21d",
|
|
11
|
+
"cloud/stripe-usage.js": "sha256:904e4a816b6c5d24658d645570bf690fc52c95f975bc3ef7ec0b383e0c1c08f2",
|
|
12
|
+
"cloud/stripe-webhooks.js": "sha256:57c55429df008a54445d914174d0d25ad18209bac2b1bd4ca5fd77ead557139c",
|
|
13
|
+
"cloud/subscription-store.js": "sha256:4e8096575ff8145102ccee5e472a17fd8bb79fd3b4e871a633f3a1e95d31f0a6",
|
|
14
|
+
"plugin/cli.js": "sha256:8e8269fc4aadcca233f8a4072d8b80b2c6c4fa7b2ce833c55785131f2dc66f10",
|
|
15
|
+
"plugin/config-loader.js": "sha256:f26093ca5dbd3d1795adc7c74245b4f71565899b52b67c1a0431fe50c23674fd",
|
|
16
|
+
"plugin/context-compressor.js": "sha256:8e1121d6197278823a6119785646d39d9d0d9e7d34a3b1dc83f12cc6e8f4ce6d",
|
|
17
|
+
"plugin/hook-dispatcher.js": "sha256:b0c83d61618c09243cb6386c3eab24dd2b862bf79e9c08d83ee810d0672fd5bd",
|
|
18
|
+
"plugin/metering-client.js": "sha256:e61ce0ee45184f562c6e3a491263cd3402cf6eff824dfc4aeac0f8b36472e9dd",
|
|
19
|
+
"plugin/metrics-collector.js": "sha256:0670a0d7217681febeea6e501038ac5560c1c94a8af0506f57b658ca229cb62d",
|
|
20
|
+
"plugin/onboarding.js": "sha256:97b330d6e1fb1e109bf8491e2377c607d5210847293a78f65d023d59924f8903",
|
|
21
|
+
"plugin/precompact-handler.js": "sha256:7b6cfa55eed307108d9be50d26db0c9ec1b587970c87e184778a5620de89f603",
|
|
22
|
+
"plugin/report.js": "sha256:10d2b4b87e33bcfc02f47819054a8248009b0fbae01953a594fee81ad656b2d4",
|
|
23
|
+
"plugin/rule-analytics-store.js": "sha256:48961785ac7f3315b5ca75e08e6fd1e55ce3b250a060c08ea481a1b06d3db319",
|
|
24
|
+
"plugin/rule-analytics.js": "sha256:f638b35b1dbc5ff6bb21d9bfb869276de920edcce753394eb04fd61a82ff817b",
|
|
25
|
+
"plugin/rule-engine.js": "sha256:49c94d8bb152cfd8f22fbf51e72434ad6691616ff58cccdaef2a6e355b5550a3",
|
|
26
|
+
"plugin/rule-sharing.js": "sha256:3b3a1568c638576abfd1a55e6464686ff0e260b179225953c30c397ffd894356",
|
|
27
|
+
"plugin/rule-suggest.js": "sha256:95eb716c9eab8510f901a419e22ad1a6392506aa6018d478308cd75c63e6a04e",
|
|
28
|
+
"plugin/session-start.js": "sha256:dfb970dbea11f455fda7a5967f872f16274a6fa611bcc6c330c2eeb46903aeae",
|
|
29
|
+
"plugin/smart-context.js": "sha256:a5e86917b0349e3cea56206df66eb397e2fcc445dbe59380f2772cc15ec9866f",
|
|
30
|
+
"shared/license.js": "sha256:081d8d02faa1eca18ba1c7dc17de820e519ad80e1fd7834fa5436f4129f09c91",
|
|
31
|
+
"shared/providers/claude-provider.js": "sha256:1baa81d1b24e5b1c87785cd5436f3ad6396c998f47b1ab351e6b0a90c0ddc5cd",
|
|
32
|
+
"shared/providers/openai-provider.js": "sha256:46f3ce3aead8812c9655e35e5ad27aaccaaef25eb431597089884c62bcb4d9e1",
|
|
33
|
+
"shared/token-counter.js": "sha256:e043a9a56141c173a4a9aa0ce978bb0c96571520bb766f12cdade2d638a8c002",
|
|
34
|
+
"shared/token-provider.js": "sha256:063e73d5dbaef5162bb04cf9c605dd6b881e26111975e267d12b4b2e3e81700e",
|
|
66
35
|
"shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
|
|
67
36
|
}
|
|
68
37
|
}
|
package/dist/plugin/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const _0x48fd4c=_0xea48;(function(_0x4b3336,_0x3ff85f){const _0x6c95c0=_0xea48,_0x449250=_0x4b3336();while(!![]){try{const _0x89a70e=parseInt(_0x6c95c0(0x120))/0x1+-parseInt(_0x6c95c0(0x110))/0x2*(parseInt(_0x6c95c0(0x11d))/0x3)+-parseInt(_0x6c95c0(0x128))/0x4*(-parseInt(_0x6c95c0(0x114))/0x5)+-parseInt(_0x6c95c0(0x11c))/0x6+parseInt(_0x6c95c0(0x11b))/0x7*(parseInt(_0x6c95c0(0x12a))/0x8)+-parseInt(_0x6c95c0(0x119))/0x9*(-parseInt(_0x6c95c0(0x112))/0xa)+parseInt(_0x6c95c0(0x111))/0xb*(parseInt(_0x6c95c0(0x125))/0xc);if(_0x89a70e===_0x3ff85f)break;else _0x449250['push'](_0x449250['shift']());}catch(_0xb9b7a8){_0x449250['push'](_0x449250['shift']());}}}(_0x330d,0x587a8));import{resolve}from'node:path';function _0xea48(_0x1b651e,_0x37492e){_0x1b651e=_0x1b651e-0x110;const _0x330dd2=_0x330d();let _0xea4892=_0x330dd2[_0x1b651e];return _0xea4892;}import{loadConfig}from'./config-loader.js';function _0x330d(){const _0x3ad850=['exit','utf-8','provider','metering','hook_event_name','1390NkyTCW','836SnDMjC','33890LhZCQv','cwd','77590VpoLGN','QMJKe','QcUiC','additionalContext','handlePreCompact','135RuncGS','write','2753177WjOYoT','3835344kknVVT','2094vgeHlg','parse','filter','36970WjaYdE','handleSessionStop','kmbYC','model','prompt','146532Fnxzlv','ZOdOK','session_id','20FvJsST','send','8VABQMR'];_0x330d=function(){return _0x3ad850;};return _0x330d();}import{HookDispatcher}from'./hook-dispatcher.js';import{buildSessionStartContext}from'./session-start.js';import{buildSmartContext}from'./smart-context.js';import{MeteringClient,buildMeterPayload}from'./metering-client.js';import{loadApiKeyFromConfig}from'../cli/setup-cmd.js';if(!process.env.TOKENIZER_API_KEY){const t=loadApiKeyFromConfig();t&&(process.env.TOKENIZER_API_KEY=t);}async function main(){const _0x537e38=_0xea48,_0x1d2a35={'QcUiC':_0x537e38(0x12c),'ZOdOK':function(_0x321423,_0x1466a9){return _0x321423(_0x1466a9);},'NAHdr':function(_0x2e4b5d,_0x47ff9f,_0xa0eaa3){return _0x2e4b5d(_0x47ff9f,_0xa0eaa3);},'pqjZS':'../..','QMJKe':'SessionStart','kmbYC':'UserPromptSubmit','bTlmb':function(_0x437e89,_0x202d8f){return _0x437e89(_0x202d8f);}},_0x11a082=[];for await(const _0x44cf62 of process['stdin'])_0x11a082['push'](_0x44cf62);const _0x2415f2=Buffer['concat'](_0x11a082)['toString'](_0x1d2a35[_0x537e38(0x116)]);let _0x5312fd;try{_0x5312fd=JSON[_0x537e38(0x11e)](_0x2415f2);}catch{process[_0x537e38(0x12b)](0x0);}const _0x52b002=_0x5312fd[_0x537e38(0x113)]||process[_0x537e38(0x113)](),_0x37b295=_0x5312fd[_0x537e38(0x12f)];let _0x2b634e;try{_0x2b634e=_0x1d2a35[_0x537e38(0x126)](loadConfig,_0x52b002);}catch{const _0x4040ec=process.env.CLAUDE_PLUGIN_ROOT||_0x1d2a35['NAHdr'](resolve,import.meta.dirname,_0x1d2a35['pqjZS']);_0x2b634e=_0x1d2a35['ZOdOK'](loadConfig,_0x4040ec);}const _0x58cb74=new HookDispatcher(_0x2b634e,_0x52b002,_0x5312fd[_0x537e38(0x127)]);let _0x32640b={};switch(_0x37b295){case _0x1d2a35[_0x537e38(0x115)]:_0x32640b=buildSessionStartContext({'cwd':_0x52b002});break;case _0x1d2a35[_0x537e38(0x122)]:{const _0x5f12db=_0x58cb74['handleUserPromptSubmit'](_0x5312fd),_0x78dc06=_0x1d2a35['bTlmb'](buildSmartContext,{'prompt':_0x5312fd[_0x537e38(0x124)]||'','cwd':_0x52b002}),_0x2862d9=[_0x5f12db[_0x537e38(0x117)],_0x78dc06[_0x537e38(0x117)]][_0x537e38(0x11f)](Boolean);_0x32640b=_0x2862d9['length']>0x0?{'additionalContext':_0x2862d9['join']('\x0a')}:{};break;}case'PreCompact':_0x32640b=_0x58cb74[_0x537e38(0x118)](_0x5312fd);break;case'Stop':{const _0x374a36=_0x58cb74[_0x537e38(0x121)](),_0x101ee3=new MeteringClient(_0x2b634e[_0x537e38(0x12e)]['endpoint']),_0x5ac8fc=buildMeterPayload(_0x374a36,{'provider':_0x2b634e[_0x537e38(0x12d)],'model':_0x2b634e[_0x537e38(0x123)]});await _0x101ee3[_0x537e38(0x129)](_0x5ac8fc);break;}}process['stdout'][_0x537e38(0x11a)](JSON['stringify'](_0x32640b)),process[_0x537e38(0x12b)](0x0);}main()['catch'](()=>process[_0x48fd4c(0x12b)](0x0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3210(_0x4d176d,_0x45c380){_0x4d176d=_0x4d176d-0x138;const _0x318fc5=_0x318f();let _0x3210eb=_0x318fc5[_0x4d176d];return _0x3210eb;}const _0x1a90c2=_0x3210;(function(_0x18f7b1,_0xefbf16){const _0x4038f5=_0x3210,_0x1e9282=_0x18f7b1();while(!![]){try{const _0x47cb68=parseInt(_0x4038f5(0x14b))/0x1*(parseInt(_0x4038f5(0x13b))/0x2)+parseInt(_0x4038f5(0x143))/0x3*(-parseInt(_0x4038f5(0x13c))/0x4)+-parseInt(_0x4038f5(0x14c))/0x5+parseInt(_0x4038f5(0x13f))/0x6+parseInt(_0x4038f5(0x142))/0x7+-parseInt(_0x4038f5(0x138))/0x8+parseInt(_0x4038f5(0x149))/0x9;if(_0x47cb68===_0xefbf16)break;else _0x1e9282['push'](_0x1e9282['shift']());}catch(_0x43aba3){_0x1e9282['push'](_0x1e9282['shift']());}}}(_0x318f,0x1ba40));import{readFileSync}from'node:fs';import{join}from'node:path';import _0x1526aa from'js-yaml';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME=_0x1a90c2(0x13a),DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320},DEFAULT_METERING={'endpoint':_0x1a90c2(0x13e),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x54684f){const _0x57b48a=_0x1a90c2,_0x135a3d={'BUFKN':function(_0x298fb9,_0xa53cae){return _0x298fb9!=_0xa53cae;},'uQbIR':'number','HURIv':_0x57b48a(0x14d),'diAbi':_0x57b48a(0x140),'HauUS':'gpt-4o','LvpRE':function(_0x4c1f75){return _0x4c1f75();}},_0x32548a=_0x1526aa['load'](_0x54684f);if(!_0x32548a||_0x135a3d['BUFKN'](_0x135a3d['uQbIR'],typeof _0x32548a['version']))throw new Error(_0x135a3d['HURIv']);const _0x37d3eb=_0x32548a['provider']??'claude',_0x38ecaa=_0x32548a['model']??(_0x57b48a(0x139)===_0x37d3eb?_0x135a3d[_0x57b48a(0x141)]:_0x135a3d['HauUS']),_0x47936f=_0x135a3d[_0x57b48a(0x147)](listProviders);if(!_0x47936f['includes'](_0x37d3eb))throw new Error('Unknown\x20provider:\x20'+_0x37d3eb+_0x57b48a(0x13d)+_0x47936f[_0x57b48a(0x144)](',\x20'));const _0x403d46=Array['isArray'](_0x32548a['rules'])?_0x32548a['rules']:[],_0x1ee14e=_0x32548a[_0x57b48a(0x145)]??DEFAULT_LIMITS,_0x592582=_0x32548a['metering']??DEFAULT_METERING;return{'version':_0x32548a[_0x57b48a(0x14a)],'provider':_0x37d3eb,'model':_0x38ecaa,'rules':_0x403d46,'context_limits':_0x1ee14e,'metering':_0x592582};}export function loadConfigFromString(_0x45ebbb){const _0x49445d=_0x1a90c2,_0x4b786b={'eJRUx':function(_0x17e5ae,_0x406af4){return _0x17e5ae(_0x406af4);}};return _0x4b786b[_0x49445d(0x146)](parseConfig,_0x45ebbb);}function _0x318f(){const _0x2fe798=['version','4798wRpbFo','717490vlpgdi','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','289144iJbOAB','claude','tokenizer-speedup.yaml','28xzIwJg','4kmPBLm','.\x20Known:\x20','https://api.simosphere.ai/v1/meter','10794icwTnG','claude-sonnet-4-20250514','diAbi','1169469SwCylF','122847MBviJZ','join','context_limits','eJRUx','LvpRE','utf-8','879912gCmVmj'];_0x318f=function(){return _0x2fe798;};return _0x318f();}export function loadConfig(_0x38dd17){const _0x49ba2f=_0x1a90c2,_0x517ac6={'PUKHr':function(_0x387f11,_0x3f7f35){return _0x387f11(_0x3f7f35);}},_0x3c0e74=join(_0x38dd17,CONFIG_FILENAME);return _0x517ac6['PUKHr'](parseConfig,readFileSync(_0x3c0e74,_0x49ba2f(0x148)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1300(){const _0x49cb75=['246120qAzAZE','83238phprBO','8033LOfyFk','369960lpbIFf','knWYk','8HmSMed','map','ebFwM','split','576225IElGEH','YFsOu','28ljwyGC','jFKDB','eRuxg','floor','1663974wRzOkh','58buboij','5634450zXBsqx'];_0x1300=function(){return _0x49cb75;};return _0x1300();}(function(_0x18c6a6,_0x29fbbb){const _0x2a6706=_0x2db0,_0xbc28f=_0x18c6a6();while(!![]){try{const _0x1ef033=parseInt(_0x2a6706(0x122))/0x1*(parseInt(_0x2a6706(0x11e))/0x2)+parseInt(_0x2a6706(0x129))/0x3+parseInt(_0x2a6706(0x123))/0x4+-parseInt(_0x2a6706(0x120))/0x5+parseInt(_0x2a6706(0x121))/0x6*(parseInt(_0x2a6706(0x12b))/0x7)+parseInt(_0x2a6706(0x125))/0x8*(parseInt(_0x2a6706(0x11d))/0x9)+-parseInt(_0x2a6706(0x11f))/0xa;if(_0x1ef033===_0x29fbbb)break;else _0xbc28f['push'](_0xbc28f['shift']());}catch(_0x4f8894){_0xbc28f['push'](_0xbc28f['shift']());}}}(_0x1300,0x2374f));import{countTokens}from'../shared/token-counter.js';export function compressContext(_0x55ed8a,_0xd12028){const _0x41c54e=_0x2db0,_0x102456={'plCNP':function(_0x4e6468,_0xbe066e){return _0x4e6468<=_0xbe066e;},'Gnqmi':function(_0x48312e,_0x534965){return _0x48312e+_0x534965;},'DgJQW':function(_0x4d0d0f,_0x45e7eb){return _0x4d0d0f>_0x45e7eb;},'jFKDB':function(_0x5ac0ee,_0x3bfef3){return _0x5ac0ee>_0x3bfef3;},'sUFiN':function(_0x254f09,_0x83f35c){return _0x254f09(_0x83f35c);},'JqiCI':function(_0xe01b3e,_0xfa5f64){return _0xe01b3e+_0xfa5f64;},'YFsOu':function(_0x58981c,_0x40bae3){return _0x58981c+_0x40bae3;},'EZBlA':'\x20→\x20','eRuxg':'\x20Token]','knWYk':function(_0xd57a22,_0x4b5746){return _0xd57a22(_0x4b5746);}};if(!_0x55ed8a)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x3e63a4=countTokens(_0x55ed8a);if(_0x102456['plCNP'](_0x3e63a4,_0xd12028))return{'text':_0x55ed8a,'originalTokens':_0x3e63a4,'compressedTokens':_0x3e63a4,'wasTruncated':!0x1};const _0x352ee0=_0x55ed8a['split']('\x0a\x0a');let _0x270d19='',_0x28e3da=0x0;for(const _0x57f0ed of _0x352ee0){const _0x10ca4a=_0x270d19?_0x102456['Gnqmi'](_0x270d19+'\x0a\x0a',_0x57f0ed):_0x57f0ed,_0x1a4796=countTokens(_0x10ca4a);if(_0x1a4796>_0xd12028)break;_0x270d19=_0x10ca4a,_0x28e3da=_0x1a4796;}if(!_0x270d19&&_0x102456['DgJQW'](_0x352ee0['length'],0x0)){const _0x1c1086=_0x352ee0[0x0][_0x41c54e(0x128)](/\s+/);let _0x7a6f1e='';for(const _0x1a259c of _0x1c1086){const _0x366e73=_0x7a6f1e?_0x7a6f1e+'\x20'+_0x1a259c:_0x1a259c;if(_0x102456[_0x41c54e(0x11a)](countTokens(_0x366e73),_0xd12028-0x5))break;_0x7a6f1e=_0x366e73;}_0x270d19=_0x7a6f1e,_0x28e3da=_0x102456['sUFiN'](countTokens,_0x270d19);}const _0x36de16=_0x102456['JqiCI'](_0x102456[_0x41c54e(0x12a)](_0x102456['Gnqmi'](_0x270d19,'\x0a\x0a[...\x20gekuerzt,\x20'),_0x3e63a4)+_0x102456['EZBlA']+_0x28e3da,_0x102456[_0x41c54e(0x11b)]);return{'text':_0x36de16,'originalTokens':_0x3e63a4,'compressedTokens':_0x102456[_0x41c54e(0x124)](countTokens,_0x36de16),'wasTruncated':!0x0};}function _0x2db0(_0x52fde1,_0x5bd573){_0x52fde1=_0x52fde1-0x11a;const _0x13001e=_0x1300();let _0x2db0aa=_0x13001e[_0x52fde1];return _0x2db0aa;}export function compressContextBudget(_0x523868,_0x2787af){const _0x4f9a1a=_0x2db0,_0x934589={'ebFwM':function(_0x5384da,_0x519510){return _0x5384da/_0x519510;}},_0x479fb2=Math[_0x4f9a1a(0x11c)](_0x934589[_0x4f9a1a(0x127)](_0x2787af,Math['max'](_0x523868['length'],0x1)));return _0x523868[_0x4f9a1a(0x126)](({label:_0x53eb79,text:_0x4d1e41})=>({'label':_0x53eb79,'result':compressContext(_0x4d1e41,_0x479fb2)}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x55d095=_0x2602;function _0x3133(){const _0x414fef=['text','mOxEx','join','4592tPYkya','record','\x20laden.','6987075vubLiu','collector','288940DIspPZ','push','prompt','limits','projectRoot','max_file_tokens','engine','222WYfhwd','user','hook_event_name','82612pVCSQD','length','min','QiWYi','1289866CbaciY','708fgEuBS','now','max_injected_tokens','getSessionSummary','load','11151864ircQtC','content','handlePreCompact','7262019EmgIzI'];_0x3133=function(){return _0x414fef;};return _0x3133();}(function(_0x2bed0f,_0x1dae52){const _0x381ad8=_0x2602,_0xa08133=_0x2bed0f();while(!![]){try{const _0x4d29c2=parseInt(_0x381ad8(0xbe))/0x1+parseInt(_0x381ad8(0xb0))/0x2+parseInt(_0x381ad8(0xb7))/0x3*(-parseInt(_0x381ad8(0xba))/0x4)+-parseInt(_0x381ad8(0xae))/0x5+-parseInt(_0x381ad8(0xbf))/0x6*(-parseInt(_0x381ad8(0xab))/0x7)+parseInt(_0x381ad8(0xa4))/0x8+parseInt(_0x381ad8(0xa7))/0x9;if(_0x4d29c2===_0x1dae52)break;else _0xa08133['push'](_0xa08133['shift']());}catch(_0x410cb5){_0xa08133['push'](_0xa08133['shift']());}}}(_0x3133,0xc01c1));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';import{compressContext}from'./context-compressor.js';function _0x2602(_0x470d61,_0x4c98b9){_0x470d61=_0x470d61-0xa1;const _0x3133c9=_0x3133();let _0x2602ba=_0x3133c9[_0x470d61];return _0x2602ba;}import{prioritizeContext}from'./precompact-handler.js';import{countTokens}from'../shared/token-counter.js';export class HookDispatcher{['engine'];[_0x55d095(0xaf)];[_0x55d095(0xb4)];constructor(_0xb56715,_0x2873c0,_0x437a35){const _0x1af629=_0x55d095;this[_0x1af629(0xb6)]=new RuleEngine(_0xb56715),this['projectRoot']=_0x2873c0,this['collector']=new MetricsCollector(_0x2873c0,_0x437a35||'session-'+Date[_0x1af629(0xc0)]());}['handleUserPromptSubmit'](_0x7963e){const _0xbf38bf=_0x55d095,_0x10e71e={'CMTtT':function(_0x4d0ad9,_0x16a42f){return _0x4d0ad9===_0x16a42f;},'tVReL':function(_0x4119db,_0x26b203){return _0x4119db(_0x26b203);},'mOxEx':function(_0x2c5933,_0x1d4720){return _0x2c5933+_0x1d4720;}},_0x25f38c=_0x7963e[_0xbf38bf(0xb2)]||'',_0x183dc4=this['engine']['match'](_0x25f38c);if(_0x10e71e['CMTtT'](0x0,_0x183dc4[_0xbf38bf(0xbb)])){const _0x69b07=_0x10e71e['tVReL'](countTokens,_0x25f38c);return this[_0xbf38bf(0xaf)]['record']({'hook_event':_0x7963e['hook_event_name'],'baseline_tokens':_0x69b07,'optimized_tokens':_0x69b07,'rule_matched':null}),{};}const _0x4cab3e=[],_0x364b6c=[];for(const _0x2bdfe4 of _0x183dc4)_0x364b6c[_0xbf38bf(0xb1)](_0x2bdfe4['trigger'][0x0]),_0x2bdfe4['summary_only']?_0x4cab3e[_0xbf38bf(0xb1)]('['+_0x2bdfe4['trigger'][0x0]+']\x20Fuer\x20Details:\x20'+_0x2bdfe4[_0xbf38bf(0xa3)]+_0xbf38bf(0xad)):_0x4cab3e[_0xbf38bf(0xb1)]('['+_0x2bdfe4['trigger'][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x2bdfe4['load']+'\x20(max\x20'+(_0x2bdfe4['max_tokens']||this[_0xbf38bf(0xb6)][_0xbf38bf(0xb3)][_0xbf38bf(0xb5)])+'\x20Token)');let _0x2f456d=_0x4cab3e[_0xbf38bf(0xaa)]('\x0a');const _0x10cb1f=this['engine'][_0xbf38bf(0xb3)]['compress_above'];_0x10cb1f>0x0&&(_0x2f456d=compressContext(_0x2f456d,_0x10cb1f)[_0xbf38bf(0xa8)]);const _0x19ea5f=countTokens(_0x25f38c),_0x333c20=countTokens(_0x2f456d),_0x457c20=_0x10e71e['mOxEx'](_0x19ea5f,this['engine']['limits']['max_injected_tokens']),_0x57a1d4=_0x10e71e[_0xbf38bf(0xa9)](_0x19ea5f,Math[_0xbf38bf(0xbc)](_0x333c20,this['engine']['limits'][_0xbf38bf(0xa1)]));return this['collector']['record']({'hook_event':_0x7963e['hook_event_name'],'baseline_tokens':_0x457c20,'optimized_tokens':_0x57a1d4,'rule_matched':_0x364b6c[_0xbf38bf(0xaa)]('+')}),{'additionalContext':_0x2f456d};}[_0x55d095(0xa6)](_0x1f4360){const _0x1ad578=_0x55d095,_0x599484={'QiWYi':function(_0x3bbf58,_0x5d9121,_0x55a3d6){return _0x3bbf58(_0x5d9121,_0x55a3d6);}},_0x2d8b8a=[];if(_0x1f4360[_0x1ad578(0xb2)]&&_0x2d8b8a[_0x1ad578(0xb1)]({'role':_0x1ad578(0xb8),'content':_0x1f4360[_0x1ad578(0xb2)],'turnIndex':0x0}),0x0===_0x2d8b8a['length'])return{};const _0x4f218f=_0x599484[_0x1ad578(0xbd)](prioritizeContext,_0x2d8b8a,this['engine'][_0x1ad578(0xb3)]),_0x594b12=_0x4f218f['prioritized']['map'](_0x2ed017=>_0x2ed017[_0x1ad578(0xa5)])[_0x1ad578(0xaa)]('\x0a\x0a');return this[_0x1ad578(0xaf)][_0x1ad578(0xac)]({'hook_event':_0x1f4360[_0x1ad578(0xb9)],'baseline_tokens':_0x4f218f['totalOriginalTokens'],'optimized_tokens':_0x4f218f['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x594b12};}['handleSessionStop'](){const _0x157f22=_0x55d095;return this[_0x157f22(0xaf)]['flush'](),this['collector']['getSummary']();}[_0x55d095(0xa2)](){const _0x4f7507=_0x55d095;return this[_0x4f7507(0xaf)]['getSummary']();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x801554=_0x1d5f;function _0x1d5f(_0x317379,_0xb7f1b7){_0x317379=_0x317379-0x1c4;const _0x3e71de=_0x3e71();let _0x1d5fc6=_0x3e71de[_0x317379];return _0x1d5fc6;}(function(_0x3f96bb,_0x1cc520){const _0x56cdb8=_0x1d5f,_0x4b72d4=_0x3f96bb();while(!![]){try{const _0x17ff98=-parseInt(_0x56cdb8(0x1d3))/0x1+parseInt(_0x56cdb8(0x1cd))/0x2+-parseInt(_0x56cdb8(0x1c7))/0x3+parseInt(_0x56cdb8(0x1cc))/0x4+parseInt(_0x56cdb8(0x1d6))/0x5*(-parseInt(_0x56cdb8(0x1c8))/0x6)+parseInt(_0x56cdb8(0x1ce))/0x7+-parseInt(_0x56cdb8(0x1ca))/0x8*(-parseInt(_0x56cdb8(0x1cf))/0x9);if(_0x17ff98===_0x1cc520)break;else _0x4b72d4['push'](_0x4b72d4['shift']());}catch(_0x1a3d3f){_0x4b72d4['push'](_0x4b72d4['shift']());}}}(_0x3e71,0xb63a1));export function buildMeterPayload(_0x15ee37,_0x58e505){const _0x4dfccb=_0x1d5f;return{'session_id':_0x15ee37['session_id'],'tokens_saved':_0x15ee37[_0x4dfccb(0x1c5)],'baseline_tokens':_0x15ee37['total_baseline'],'optimized_tokens':_0x15ee37[_0x4dfccb(0x1d7)],'hook_event':'Stop','provider':_0x58e505[_0x4dfccb(0x1c9)],'model':_0x58e505[_0x4dfccb(0x1d9)],'team_id':_0x58e505['team_id']??''};}function _0x3e71(){const _0x106060=['no_endpoint','zuSGa','616123jqOWeD','send','http_','83200pwyPKB','total_optimized','timeout','model','status','application/json','total_delta','Yecha','4473453OUTmlz','450pxlcNx','provider','160SWDAWS','network_error','1954232fYBdGP','771902RrHCCy','5362042afqHqK','1107522gqYlWB','endpoint'];_0x3e71=function(){return _0x106060;};return _0x3e71();}export class MeteringClient{['endpoint'];constructor(_0x70d3e8){this['endpoint']=_0x70d3e8;}async[_0x801554(0x1d4)](_0x549e9d){const _0x5532ef=_0x801554,_0x29c51e={'MfKaz':function(_0x91b11f,_0x36ebcf,_0x3d2861){return _0x91b11f(_0x36ebcf,_0x3d2861);},'zuSGa':_0x5532ef(0x1c4),'Yecha':_0x5532ef(0x1cb)};if(!this['endpoint'])return{'sent':!0x1,'reason':_0x5532ef(0x1d1)};try{const _0x275307=await _0x29c51e['MfKaz'](fetch,this[_0x5532ef(0x1d0)],{'method':'POST','headers':{'Content-Type':_0x29c51e[_0x5532ef(0x1d2)],'Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON['stringify'](_0x549e9d),'signal':AbortSignal[_0x5532ef(0x1d8)](0x1388)});return _0x275307['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x5532ef(0x1d5)+_0x275307[_0x5532ef(0x1da)]};}catch{return{'sent':!0x1,'reason':_0x29c51e[_0x5532ef(0x1c6)]};}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x4aac(_0x513fb2,_0x5d5c81){_0x513fb2=_0x513fb2-0x93;const _0x4a361b=_0x4a36();let _0x4aacd2=_0x4a361b[_0x513fb2];return _0x4aacd2;}const _0xfbb764=_0x4aac;(function(_0x4669f3,_0x1b1d36){const _0x4de77a=_0x4aac,_0x35b38d=_0x4669f3();while(!![]){try{const _0xa28a5e=-parseInt(_0x4de77a(0xa5))/0x1*(-parseInt(_0x4de77a(0x9a))/0x2)+parseInt(_0x4de77a(0x98))/0x3*(parseInt(_0x4de77a(0xa9))/0x4)+-parseInt(_0x4de77a(0x99))/0x5+-parseInt(_0x4de77a(0xab))/0x6*(-parseInt(_0x4de77a(0xa4))/0x7)+-parseInt(_0x4de77a(0x97))/0x8*(-parseInt(_0x4de77a(0xa6))/0x9)+-parseInt(_0x4de77a(0xa1))/0xa*(parseInt(_0x4de77a(0xae))/0xb)+-parseInt(_0x4de77a(0x9c))/0xc*(parseInt(_0x4de77a(0x95))/0xd);if(_0xa28a5e===_0x1b1d36)break;else _0x35b38d['push'](_0x35b38d['shift']());}catch(_0x3a4041){_0x35b38d['push'](_0x35b38d['shift']());}}}(_0x4a36,0x5abf8));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';function _0x4a36(){const _0x437f21=['11YbPcAP','baseline_tokens','utf-8','stringify','reduce','1651wDsZln','startedAt','8TwwGRs','3JalYAg','1462525hEmLHW','949174fesQQn','record','51708LdwMTS','optimized_tokens','hook_event','oJfcq','flush','214190PWQpZe','metrics','rule_matched','710381ojFOCm','1gdmoDd','4421961Neoxkj','lkyBr','length','661888aeXDVe','sessionId','6abbhft','projectRoot','push'];_0x4a36=function(){return _0x437f21;};return _0x4a36();}const METRICS_DIR='.tokenizer-speedup';export class MetricsCollector{['metrics']=[];[_0xfbb764(0xaa)];['projectRoot'];[_0xfbb764(0x96)];constructor(_0x5e68ed,_0x4192b8){const _0x46fa50=_0xfbb764;this[_0x46fa50(0xac)]=_0x5e68ed,this[_0x46fa50(0xaa)]=_0x4192b8,this[_0x46fa50(0x96)]=new Date()['toISOString']();}[_0xfbb764(0x9b)](_0x45a01e){const _0x2912cc=_0xfbb764;this['metrics'][_0x2912cc(0xad)]({'session_id':this[_0x2912cc(0xaa)],'timestamp':new Date()['toISOString'](),'hook_event':_0x45a01e[_0x2912cc(0x9e)],'baseline_tokens':_0x45a01e['baseline_tokens'],'optimized_tokens':_0x45a01e[_0x2912cc(0x9d)],'delta':_0x45a01e['baseline_tokens']-_0x45a01e['optimized_tokens'],'rule_matched':_0x45a01e[_0x2912cc(0xa3)]});}['getMetrics'](){return[...this['metrics']];}['getSummary'](){const _0x55c40b=_0xfbb764,_0x14deb7={'oJfcq':function(_0x2b5ef1,_0x472921){return _0x2b5ef1+_0x472921;},'lkyBr':function(_0x3fc7bc,_0x228b2c){return _0x3fc7bc*_0x228b2c;},'FNGIe':function(_0x1ed7b9,_0x4378a0){return _0x1ed7b9/_0x4378a0;}},_0x199bac=this[_0x55c40b(0xa2)][_0x55c40b(0x94)]((_0x4b9983,_0x502e98)=>_0x4b9983+_0x502e98[_0x55c40b(0xaf)],0x0),_0x49d8dd=this[_0x55c40b(0xa2)][_0x55c40b(0x94)]((_0x211773,_0x4f55a8)=>_0x211773+_0x4f55a8['optimized_tokens'],0x0),_0x5d821e=_0x199bac-_0x49d8dd,_0x49b9bc={};for(const _0x3fb470 of this['metrics'])_0x3fb470['rule_matched']&&(_0x49b9bc[_0x3fb470[_0x55c40b(0xa3)]]=_0x14deb7[_0x55c40b(0x9f)](_0x49b9bc[_0x3fb470[_0x55c40b(0xa3)]]||0x0,0x1));return{'session_id':this[_0x55c40b(0xaa)],'started_at':this[_0x55c40b(0x96)],'ended_at':new Date()['toISOString'](),'total_baseline':_0x199bac,'total_optimized':_0x49d8dd,'total_delta':_0x5d821e,'savings_percent':_0x199bac>0x0?_0x14deb7[_0x55c40b(0xa7)](_0x14deb7['FNGIe'](_0x5d821e,_0x199bac),0x64):0x0,'prompts_count':this[_0x55c40b(0xa2)][_0x55c40b(0xa8)],'rules_triggered':_0x49b9bc};}[_0xfbb764(0xa0)](){const _0x4de828=_0xfbb764,_0xd264a={'setBQ':function(_0x11eba0,_0xac0670,_0xd1c156){return _0x11eba0(_0xac0670,_0xd1c156);}},_0x270b33=join(this['projectRoot'],METRICS_DIR);_0xd264a['setBQ'](mkdirSync,_0x270b33,{'recursive':!0x0});const _0x5507f8={'metrics':this['metrics'],'summary':this['getSummary']()};writeFileSync(join(_0x270b33,this['sessionId']+'.json'),JSON[_0x4de828(0x93)](_0x5507f8,null,0x2),_0x4de828(0xb0));}}
|