@simosphere/tokenizer-speedup 0.7.3 → 0.8.0
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/init-cmd.js +1 -0
- 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 +37 -63
- package/dist/mcp/index.js +2 -0
- package/dist/mcp/resources.js +1 -0
- package/dist/mcp/session.js +1 -0
- package/dist/mcp/tools.js +1 -0
- 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 +7 -3
- 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
|
+
(function(_0x446757,_0x30be30){const _0x20beeb=_0x5d02,_0xbe5d60=_0x446757();while(!![]){try{const _0x3c568f=parseInt(_0x20beeb(0x158))/0x1*(-parseInt(_0x20beeb(0x161))/0x2)+-parseInt(_0x20beeb(0x15e))/0x3*(-parseInt(_0x20beeb(0x155))/0x4)+-parseInt(_0x20beeb(0x163))/0x5*(parseInt(_0x20beeb(0x15c))/0x6)+-parseInt(_0x20beeb(0x159))/0x7+parseInt(_0x20beeb(0x157))/0x8+-parseInt(_0x20beeb(0x166))/0x9+parseInt(_0x20beeb(0x164))/0xa;if(_0x3c568f===_0x30be30)break;else _0xbe5d60['push'](_0xbe5d60['shift']());}catch(_0x5334ad){_0xbe5d60['push'](_0xbe5d60['shift']());}}}(_0x74b3,0x308a3));function _0x74b3(){const _0x75b8fe=['1240155UBFHzs','JaSyT','filter','ALDxA','4KwMnSD','fCHTj','2061664DCCGiF','20KaDHXL','1701931wJsIjG','split','length','66RQZOnK','BmbzA','658395PpOXvL','openai','claude-sonnet-4-20250514','18686FoOjbx','kiJru','151620bnUjUl','6229980AzhEdu','gpt-4o'];_0x74b3=function(){return _0x75b8fe;};return _0x74b3();}function _0x5d02(_0x2f8bc3,_0x45be67){_0x2f8bc3=_0x2f8bc3-0x153;const _0x74b36a=_0x74b3();let _0x5d0290=_0x74b36a[_0x2f8bc3];return _0x5d0290;}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(_0x230a1a,_0x3e09ae='claude',_0x5e9ec3){const _0x5737c2=_0x5d02,_0x62be1d={'dJDtQ':function(_0x4ba55c,_0x58ac4e){return _0x4ba55c===_0x58ac4e;},'BmbzA':'claude','ALDxA':_0x5737c2(0x160),'fCHTj':_0x5737c2(0x165),'uLHVx':function(_0x2ec5e6,_0x436ca9,_0x35a7b7){return _0x2ec5e6(_0x436ca9,_0x35a7b7);}},_0x5b431e=_0x5e9ec3??(_0x62be1d['dJDtQ'](_0x62be1d[_0x5737c2(0x15d)],_0x3e09ae)?_0x62be1d[_0x5737c2(0x154)]:_0x62be1d[_0x5737c2(0x156)]),_0x29789d=_0x62be1d['uLHVx'](createTokenProvider,_0x3e09ae,_0x5b431e),_0x286eb2=_0x230a1a[_0x5737c2(0x15a)](/\s+/)[_0x5737c2(0x153)](Boolean)[_0x5737c2(0x15b)];return{'tokens':_0x29789d['countTokens'](_0x230a1a),'estimate':_0x29789d['estimateTokens'](_0x230a1a),'provider':_0x3e09ae,'model':_0x5b431e,'chars':_0x230a1a[_0x5737c2(0x15b)],'words':_0x286eb2};}export function analyzeFile(_0x41b35f,_0x51420a='claude',_0x578a0e){const _0x371207=_0x5d02,_0x1e5137={'JaSyT':function(_0xcc8908,_0x1189d8,_0x4c3dbf){return _0xcc8908(_0x1189d8,_0x4c3dbf);}};return analyzeText(_0x1e5137[_0x371207(0x167)](readFileSync,_0x41b35f,'utf-8'),_0x51420a,_0x578a0e);}export function compareProviders(_0x574829){const _0x2998ba=_0x5d02,_0xac9d50={'kiJru':function(_0xd5697c,_0x1246ad,_0x26bba4){return _0xd5697c(_0x1246ad,_0x26bba4);}};return{'claude':_0xac9d50[_0x2998ba(0x162)](analyzeText,_0x574829,'claude'),'openai':_0xac9d50[_0x2998ba(0x162)](analyzeText,_0x574829,_0x2998ba(0x15f))};}
|
package/dist/cli/config-cmd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x1790(){const _0x44ea86=['6vbFVvQ','422802PGsQeT','3521413XwfkmE','1245736vmOLfj','3713868LvOeGf','58903lzVwMv','ckRiW','45fubLOf','464210hMpMtd','length','1816905feWtkA'];_0x1790=function(){return _0x44ea86;};return _0x1790();}(function(_0x14da15,_0x19fd8d){const _0x144fc6=_0x7683,_0x3b4899=_0x14da15();while(!![]){try{const _0x108269=parseInt(_0x144fc6(0xdb))/0x1+-parseInt(_0x144fc6(0xd3))/0x2+-parseInt(_0x144fc6(0xd7))/0x3+parseInt(_0x144fc6(0xda))/0x4+parseInt(_0x144fc6(0xd5))/0x5+-parseInt(_0x144fc6(0xd6))/0x6*(-parseInt(_0x144fc6(0xd8))/0x7)+parseInt(_0x144fc6(0xd9))/0x8*(-parseInt(_0x144fc6(0xd2))/0x9);if(_0x108269===_0x19fd8d)break;else _0x3b4899['push'](_0x3b4899['shift']());}catch(_0x3c030b){_0x3b4899['push'](_0x3b4899['shift']());}}}(_0x1790,0xab6ea));import'../shared/providers/claude-provider.js';function _0x7683(_0x1d1357,_0x3cae22){_0x1d1357=_0x1d1357-0xd2;const _0x179051=_0x1790();let _0x7683a=_0x179051[_0x1d1357];return _0x7683a;}import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x59441d){const _0x45b25f=_0x7683,_0x5a1766={'ckRiW':function(_0x275321,_0x20fc29){return _0x275321(_0x20fc29);}};try{const _0x43c04e=_0x5a1766[_0x45b25f(0xdc)](parseConfig,_0x59441d);return{'valid':!0x0,'provider':_0x43c04e['provider'],'model':_0x43c04e['model'],'ruleCount':_0x43c04e['rules'][_0x45b25f(0xd4)]};}catch(_0x23c6ba){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x23c6ba['message']};}}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const _0x5b2d42=_0x3098;(function(_0x3658ec,_0x3df8db){const _0x5a22d5=_0x3098,_0x30ab2=_0x3658ec();while(!![]){try{const _0x38e196=parseInt(_0x5a22d5(0x111))/0x1*(-parseInt(_0x5a22d5(0x12b))/0x2)+-parseInt(_0x5a22d5(0x12d))/0x3+-parseInt(_0x5a22d5(0x108))/0x4+-parseInt(_0x5a22d5(0x112))/0x5*(-parseInt(_0x5a22d5(0x137))/0x6)+parseInt(_0x5a22d5(0x115))/0x7+-parseInt(_0x5a22d5(0x131))/0x8*(parseInt(_0x5a22d5(0x12e))/0x9)+parseInt(_0x5a22d5(0xfe))/0xa*(parseInt(_0x5a22d5(0x10e))/0xb);if(_0x38e196===_0x3df8db)break;else _0x30ab2['push'](_0x30ab2['shift']());}catch(_0x33eee1){_0x30ab2['push'](_0x30ab2['shift']());}}}(_0x37a8,0x2943e));function _0x3098(_0xc2c608,_0x4d5e6d){_0xc2c608=_0xc2c608-0xf8;const _0x37a847=_0x37a8();let _0x3098e2=_0x37a847[_0xc2c608];return _0x3098e2;}import{Command}from'commander';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';import{readFileSync,realpathSync}from'node:fs';import{runSetup}from'./setup-cmd.js';import{runInit}from'./init-cmd.js';export function buildCLI(){const _0xeebdcf=_0x3098,_0x162e45={'jSBca':function(_0xbf387c,_0x3d1716){return _0xbf387c===_0x3d1716;},'ARLDb':_0xeebdcf(0x11f),'rftfZ':function(_0x4ca0e9,_0xda157c,_0x2cfa0f){return _0x4ca0e9(_0xda157c,_0x2cfa0f);},'joUpH':function(_0x35fbd9,_0x6a4756){return _0x35fbd9!==_0x6a4756;},'SrFNN':_0xeebdcf(0x100),'CuhNU':'1.3','ocQCw':'utf-8','MqHER':'../plugin/config-loader.js','BYrJR':function(_0x42fd6a,_0x8acae9){return _0x42fd6a(_0x8acae9);},'BSlxA':function(_0x54a31e){return _0x54a31e();},'ApjTL':_0xeebdcf(0x132),'LkCZO':'after','WDkSx':_0xeebdcf(0x10a),'WTUKx':_0xeebdcf(0x130),'IXsVb':_0xeebdcf(0xfd),'mjgrW':_0xeebdcf(0x118),'HHSMz':'File\x20to\x20analyze','DZAXb':'-p,\x20--provider\x20<provider>','vruks':_0xeebdcf(0x121),'acgSQ':'claude','ULUuA':'Model\x20name','hkXzq':'-t,\x20--text\x20<text>','BrBeW':_0xeebdcf(0x10b),'VKMyF':_0xeebdcf(0x12f),'ZiPZv':'tokenizer-speedup.yaml','Oxukq':'Create\x20a\x20starter\x20tokenizer-speedup.yaml\x20in\x20the\x20current\x20directory'},_0x230de6=new Command();return _0x230de6[_0xeebdcf(0x133)](_0x162e45[_0xeebdcf(0x134)])[_0xeebdcf(0x11e)](_0xeebdcf(0x114))[_0xeebdcf(0x11a)]('0.8.0')[_0xeebdcf(0x11d)](_0x162e45[_0xeebdcf(0x126)],_0x162e45[_0xeebdcf(0x10d)]),_0x230de6[_0xeebdcf(0x106)](_0x162e45[_0xeebdcf(0x12a)])[_0xeebdcf(0x11e)](_0x162e45['IXsVb'])['requiredOption'](_0x162e45[_0xeebdcf(0x135)],'Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)')['action'](_0x551f60=>{runSetup(_0x551f60['apiKey']);}),_0x230de6[_0xeebdcf(0x106)](_0xeebdcf(0x120))[_0xeebdcf(0x11e)](_0xeebdcf(0xf9))['argument']('[file]',_0x162e45['HHSMz'])[_0xeebdcf(0x117)](_0x162e45[_0xeebdcf(0x101)],_0x162e45['vruks'],_0x162e45[_0xeebdcf(0xf8)])[_0xeebdcf(0x117)]('-m,\x20--model\x20<model>',_0x162e45[_0xeebdcf(0x138)])[_0xeebdcf(0x117)](_0x162e45[_0xeebdcf(0x123)],'Analyze\x20inline\x20text\x20instead\x20of\x20file')[_0xeebdcf(0xfb)]((_0x5053c1,_0x2c879e)=>{const _0x459e26=_0xeebdcf,_0x150843=_0x2c879e['model']??(_0x162e45[_0x459e26(0x10f)]('claude',_0x2c879e['provider'])?_0x459e26(0x105):_0x162e45['ARLDb']);let _0x32043b,_0x21c16e;try{_0x32043b=_0x162e45['rftfZ'](createTokenProvider,_0x2c879e[_0x459e26(0x103)],_0x150843);}catch(_0x4ec082){return console['error'](_0x459e26(0x109)+_0x4ec082['message']),void(process[_0x459e26(0x129)]=0x1);}if(_0x162e45[_0x459e26(0x124)](void 0x0,_0x2c879e[_0x459e26(0xfc)]))_0x21c16e=_0x2c879e['text'];else{if(!_0x5053c1)return console[_0x459e26(0x104)](_0x162e45[_0x459e26(0x110)]),void(process['exitCode']=0x1);_0x21c16e=readFileSync(_0x5053c1,'utf-8');}_0x21c16e['length']>0x7a120&&console['error'](_0x459e26(0x10c)+(_0x21c16e[_0x459e26(0x136)]/0x3e8)[_0x459e26(0x122)](0x0)+'K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.');const _0x45f4ec=_0x32043b[_0x459e26(0x125)](_0x21c16e),_0x5d9188=_0x32043b['estimateTokens'](_0x21c16e);console['log'](JSON['stringify']({'file':_0x5053c1??'(inline)','tokens':_0x45f4ec,'tokens_method':_0x459e26(0xfa),'estimate':_0x5d9188,'estimate_method':_0x459e26(0x107)+(_0x162e45[_0x459e26(0x10f)]('openai',_0x2c879e['provider'])?_0x162e45['CuhNU']:_0x459e26(0xff))+')','provider':_0x2c879e[_0x459e26(0x103)],'model':_0x150843}));}),_0x230de6['command'](_0xeebdcf(0x12c))['description']('Validate\x20configuration\x20file')[_0xeebdcf(0x116)](_0x162e45['BrBeW'],_0x162e45['VKMyF'],_0x162e45[_0xeebdcf(0x128)])[_0xeebdcf(0xfb)](async _0x3a1cfc=>{const _0x158e69=_0xeebdcf;try{const _0x2b7d9d=readFileSync(_0x3a1cfc,_0x162e45['ocQCw']),{parseConfig:_0x461a03}=await import(_0x162e45[_0x158e69(0x127)]),_0x2e9399=_0x162e45['BYrJR'](_0x461a03,_0x2b7d9d);console[_0x158e69(0x11c)](JSON[_0x158e69(0x113)]({'valid':!0x0,'provider':_0x2e9399['provider'],'model':_0x2e9399['model'],'ruleCount':_0x2e9399[_0x158e69(0x119)]['length']}));}catch(_0x4f62ec){console[_0x158e69(0x11c)](JSON[_0x158e69(0x113)]({'valid':!0x1,'error':_0x4f62ec['message']})),process['exitCode']=0x1;}}),_0x230de6['command']('init')['description'](_0x162e45['Oxukq'])['action'](()=>{_0x162e45['BSlxA'](runInit);}),_0x230de6;}function _0x37a8(){const _0x2c72ca=['Error:\x20','\x0aExamples:\x0a\x20\x20$\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x20\x20\x20Configure\x20and\x20register\x20Claude\x20Code\x20hooks\x0a\x20\x20$\x20tsu\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Create\x20starter\x20tokenizer-speedup.yaml\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.\x20Optional:\x20tsu\x20init\x20(creates\x20project-level\x20config)\x0a\x20\x204.\x20Restart\x20Claude\x20Code\x20—\x20the\x20plugin\x20activates\x20automatically\x0a\x0aConfiguration\x20(tokenizer-speedup.yaml):\x0a\x20\x20Place\x20in\x20your\x20project\x20root.\x20Defines\x20keyword\x20triggers,\x20file\x20patterns,\x0a\x20\x20and\x20token\x20limits.\x20Run\x20\x27tsu\x20init\x27\x20to\x20generate\x20a\x20starter\x20config.\x0a\x20\x20Docs:\x20https://tokenizer-speedup.simosphereai.com/#integration\x0a','[file]','Warning:\x20large\x20input\x20(','WDkSx','1289101lqrJjh','jSBca','SrFNN','11ekiSBX','430EhSHdx','stringify','TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI','827071UsuxQP','argument','option','--api-key\x20<key>','rules','version','cli/index','log','addHelpText','description','gpt-4o','analyze','LLM\x20provider\x20(claude,\x20openai)','toFixed','hkXzq','joUpH','countTokens','LkCZO','MqHER','ZiPZv','exitCode','WTUKx','29294hZnKvY','config','94539DauXAh','317349JaObpn','Config\x20file\x20path','setup','16PjIFbH','tsu','name','ApjTL','mjgrW','length','18726djPpVC','ULUuA','acgSQ','Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text','BPE\x20tokenizer\x20(accurate)','action','text','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','10bEHbMF','1.4','Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','DZAXb','replace','provider','error','claude-sonnet-4-20250514','command','word\x20heuristic\x20(words\x20×\x20','286304IAtUJd'];_0x37a8=function(){return _0x2c72ca;};return _0x37a8();}const resolvedArgv1=((()=>{const _0x3498a1=_0x3098,_0x42e80a={'myGCx':function(_0x4dc601,_0x13912a){return _0x4dc601(_0x13912a);}};try{return _0x42e80a['myGCx'](realpathSync,process['argv'][0x1]??'')[_0x3498a1(0x102)](/\\/g,'/');}catch{return process['argv'][0x1]?.['replace'](/\\/g,'/')??'';}})());resolvedArgv1['includes'](_0x5b2d42(0x11b))&&buildCLI()['parse']();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x3129(_0x352ab5,_0x436333){_0x352ab5=_0x352ab5-0xba;const _0x1d575c=_0x1d57();let _0x312966=_0x1d575c[_0x352ab5];return _0x312966;}const _0x2a9457=_0x3129;(function(_0x5a71d9,_0x5dfcf2){const _0x240227=_0x3129,_0xa57a91=_0x5a71d9();while(!![]){try{const _0x503491=parseInt(_0x240227(0xc8))/0x1+parseInt(_0x240227(0xc0))/0x2*(parseInt(_0x240227(0xc2))/0x3)+parseInt(_0x240227(0xba))/0x4*(-parseInt(_0x240227(0xc6))/0x5)+-parseInt(_0x240227(0xbf))/0x6*(-parseInt(_0x240227(0xbb))/0x7)+parseInt(_0x240227(0xc3))/0x8+parseInt(_0x240227(0xcc))/0x9*(-parseInt(_0x240227(0xcd))/0xa)+-parseInt(_0x240227(0xbe))/0xb*(-parseInt(_0x240227(0xcb))/0xc);if(_0x503491===_0x5dfcf2)break;else _0xa57a91['push'](_0xa57a91['shift']());}catch(_0x28891f){_0xa57a91['push'](_0xa57a91['shift']());}}}(_0x1d57,0x5a436));function _0x1d57(){const _0x1ef261=['Next\x20steps:','701272fITBmS','2238QJOOyZ','66206uggTbA','exitCode','6lNZFbK','3263792nXWvoX','tokenizer-speedup.yaml','log','335qEJvar','#\x20tokenizer-speedup.yaml\x20—\x20Project\x20Configuration\x0a#\x20Docs:\x20https://tokenizer-speedup.simosphereai.com/#integration\x0aversion:\x201\x0a\x0arules:\x0a\x20\x20-\x20trigger:\x20[\x22fix\x22,\x20\x22bug\x22,\x20\x22error\x22,\x20\x22crash\x22]\x0a\x20\x20\x20\x20load:\x20\x22docs/lessons-learned/*.md\x22\x0a\x20\x20\x20\x20max_tokens:\x202000\x0a\x0a\x20\x20-\x20trigger:\x20[\x22design\x22,\x20\x22brand\x22,\x20\x22theme\x22]\x0a\x20\x20\x20\x20load:\x20\x22docs/design/*.md\x22\x0a\x20\x20\x20\x20summary_only:\x20true\x0a\x0acontext_limits:\x0a\x20\x20max_injected_tokens:\x204000\x0a\x20\x20max_file_tokens:\x201500\x0a\x20\x20compress_above:\x20800\x0a\x0ametering:\x0a\x20\x20endpoint:\x20\x22https://api.simosphere.ai/v1/meter\x22\x0a\x20\x20batch_interval:\x2060\x0a\x20\x20send_content:\x20false\x0a','20949RtyTYK','VJABy','\x20\x203.\x20Restart\x20Claude\x20Code\x20to\x20pick\x20up\x20the\x20new\x20config','96BzPpbR','2587392iofAEu','20RwCWdq','cwd','34028BXoBPi','9562mazAXN','Created\x20tokenizer-speedup.yaml'];_0x1d57=function(){return _0x1ef261;};return _0x1d57();}import{writeFileSync,existsSync}from'node:fs';import{join}from'node:path';const STARTER_CONFIG=_0x2a9457(0xc7);export function runInit(){const _0x30adaa=_0x2a9457,_0x513bfc={'cOdoH':function(_0x16f44c,_0x208f6c,_0x4b9a5f){return _0x16f44c(_0x208f6c,_0x4b9a5f);},'VJABy':'tokenizer-speedup.yaml\x20already\x20exists\x20in\x20this\x20directory.','FwoPI':_0x30adaa(0xbd),'oltdH':'\x20\x201.\x20Edit\x20the\x20rules\x20to\x20match\x20your\x20project\x20structure','HRMSj':'\x20\x202.\x20Run:\x20tsu\x20config\x20tokenizer-speedup.yaml\x20\x20(to\x20validate)','klCuE':_0x30adaa(0xca)},_0x5ef78d=_0x513bfc['cOdoH'](join,process[_0x30adaa(0xce)](),_0x30adaa(0xc4));if(existsSync(_0x5ef78d))return console['error'](_0x513bfc[_0x30adaa(0xc9)]),void(process[_0x30adaa(0xc1)]=0x1);writeFileSync(_0x5ef78d,STARTER_CONFIG,'utf-8'),console['log'](_0x30adaa(0xbc)),console['log'](''),console[_0x30adaa(0xc5)](_0x513bfc['FwoPI']),console[_0x30adaa(0xc5)](_0x513bfc['oltdH']),console['log'](_0x513bfc['HRMSj']),console[_0x30adaa(0xc5)](_0x513bfc['klCuE']);}
|
package/dist/cli/setup-cmd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x41617e=_0x1534;(function(_0x1991c3,_0x5b6b77){const _0x3357c9=_0x1534,_0x5cc092=_0x1991c3();while(!![]){try{const _0x2bac3d=-parseInt(_0x3357c9(0xdc))/0x1+-parseInt(_0x3357c9(0xf3))/0x2+-parseInt(_0x3357c9(0xf0))/0x3*(-parseInt(_0x3357c9(0xe3))/0x4)+parseInt(_0x3357c9(0xdd))/0x5*(-parseInt(_0x3357c9(0xe4))/0x6)+parseInt(_0x3357c9(0xef))/0x7*(-parseInt(_0x3357c9(0xe2))/0x8)+-parseInt(_0x3357c9(0xea))/0x9*(parseInt(_0x3357c9(0xf1))/0xa)+parseInt(_0x3357c9(0xd3))/0xb;if(_0x2bac3d===_0x5b6b77)break;else _0x5cc092['push'](_0x5cc092['shift']());}catch(_0xb1525a){_0x5cc092['push'](_0x5cc092['shift']());}}}(_0x53da,0xb8f92));function _0x53da(){const _0x21194f=['✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.','.config','utf-8','PreCompact','error','hrVEm','46712743DeExJZ','NbwkE','❌\x20API\x20key\x20cannot\x20be\x20empty.','lGVpC','config.json','log','lXiFR','apiKey','length','423534uxGErS','205szHoLN','message','settings.local.json','tokenizer-speedup','command','1663848lGQALM','4XVzMBu','135390mfRMiT','hooks','QCPZi','⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','oisXX','mtLUV','1152VDUgev','.claude','exitCode','stringify','fdKUz','21gCACdf','362694VDruru','31830wiGVPF','qjgbs','2459590Usjhai'];_0x53da=function(){return _0x21194f;};return _0x53da();}import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),_0x41617e(0xf5),'tokenizer-speedup'),CONFIG_FILE=join(CONFIG_DIR,_0x41617e(0xd7)),CLAUDE_SETTINGS_FILE=join(homedir(),'.claude',_0x41617e(0xdf));export function runSetup(_0x2c0af7){const _0x9abaca=_0x41617e,_0x5e3470={'psMIf':_0x9abaca(0xd5),'hrVEm':'❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).','eXTct':'✅\x20API\x20key\x20saved\x20successfully.','QCPZi':'Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.'};try{if(!_0x2c0af7||0x0===_0x2c0af7['trim']()[_0x9abaca(0xdb)])return console['error'](_0x5e3470['psMIf']),void(process['exitCode']=0x1);if(_0x2c0af7['trim']()['length']<0x8)return console[_0x9abaca(0xd1)](_0x5e3470[_0x9abaca(0xd2)]),void(process[_0x9abaca(0xec)]=0x1);saveApiKey(_0x2c0af7['trim']()),console['log'](_0x5e3470['eXTct']),console[_0x9abaca(0xd8)](_0x9abaca(0xe7)),registerHooks(),console[_0x9abaca(0xd8)](_0x9abaca(0xf4)),console[_0x9abaca(0xd8)](''),console[_0x9abaca(0xd8)](_0x5e3470[_0x9abaca(0xe6)]);}catch(_0x1d8f76){console[_0x9abaca(0xd1)]('❌\x20Setup\x20failed:\x20'+_0x1d8f76[_0x9abaca(0xde)]),process[_0x9abaca(0xec)]=0x1;}}function _0x1534(_0x2450fd,_0x4cd41b){_0x2450fd=_0x2450fd-0xd0;const _0x53dafe=_0x53da();let _0x153457=_0x53dafe[_0x2450fd];return _0x153457;}function saveApiKey(_0x2c6c80){const _0x5513e1=_0x41617e,_0x42a7df={'mtLUV':function(_0x202be1,_0x3af6d1,_0x3c56dc){return _0x202be1(_0x3af6d1,_0x3c56dc);},'KXaVn':_0x5513e1(0xf6),'BANGU':function(_0x3bbdfe,_0x45cfe5,_0xc47ec0,_0x31a142){return _0x3bbdfe(_0x45cfe5,_0xc47ec0,_0x31a142);}};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x1a4fe7={};try{_0x1a4fe7=JSON['parse'](_0x42a7df[_0x5513e1(0xe9)](readFileSync,CONFIG_FILE,_0x42a7df['KXaVn']));}catch{}_0x1a4fe7['apiKey']=_0x2c6c80,_0x42a7df['BANGU'](writeFileSync,CONFIG_FILE,JSON['stringify'](_0x1a4fe7,null,0x2)+'\x0a','utf-8');}function registerHooks(){const _0x2c408b=_0x41617e,_0x2ff5d7={'lGVpC':function(_0x5131c2,_0x138f27,_0x3f58d5){return _0x5131c2(_0x138f27,_0x3f58d5);},'qjgbs':_0x2c408b(0xeb),'lXiFR':_0x2c408b(0xf6),'NbwkE':'command','fdKUz':'tokenizer-speedup','oisXX':function(_0x337289,_0xab3af5){return _0x337289+_0xab3af5;}};_0x2ff5d7[_0x2c408b(0xd6)](mkdirSync,join(homedir(),_0x2ff5d7[_0x2c408b(0xf2)]),{'recursive':!0x0});let _0x312547={};try{_0x312547=JSON['parse'](_0x2ff5d7[_0x2c408b(0xd6)](readFileSync,CLAUDE_SETTINGS_FILE,_0x2ff5d7[_0x2c408b(0xd9)]));}catch{}const _0x569757=_0x312547[_0x2c408b(0xe5)]??{};_0x569757['SessionStart']=[{'matcher':'startup|resume|clear|compact','hooks':[{'type':_0x2ff5d7[_0x2c408b(0xd4)],'command':_0x2ff5d7['fdKUz'],'timeout':0x5}]}],_0x569757['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':'command','command':_0x2ff5d7[_0x2c408b(0xee)]}]}],_0x569757[_0x2c408b(0xd0)]=[{'matcher':'','hooks':[{'type':_0x2c408b(0xe1),'command':'tokenizer-speedup','timeout':0xa}]}],_0x569757['Stop']=[{'matcher':'','hooks':[{'type':'command','command':_0x2c408b(0xe0),'timeout':0xa}]}],_0x312547[_0x2c408b(0xe5)]=_0x569757,writeFileSync(CLAUDE_SETTINGS_FILE,_0x2ff5d7[_0x2c408b(0xe8)](JSON[_0x2c408b(0xed)](_0x312547,null,0x2),'\x0a'),_0x2ff5d7['lXiFR']);}export function loadApiKeyFromConfig(){const _0x57178d=_0x41617e,_0x58ea5a={'TxvHz':'utf-8'};try{return JSON['parse'](readFileSync(CONFIG_FILE,_0x58ea5a['TxvHz']))[_0x57178d(0xda)]??void 0x0;}catch{return;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x228326,_0x4f9e3e){const _0x5ddeb3=_0x5a65,_0xfdd56f=_0x228326();while(!![]){try{const _0x3ec4f9=parseInt(_0x5ddeb3(0x6e))/0x1*(parseInt(_0x5ddeb3(0x74))/0x2)+parseInt(_0x5ddeb3(0x68))/0x3+-parseInt(_0x5ddeb3(0x67))/0x4*(-parseInt(_0x5ddeb3(0x70))/0x5)+-parseInt(_0x5ddeb3(0x69))/0x6*(parseInt(_0x5ddeb3(0x6d))/0x7)+-parseInt(_0x5ddeb3(0x72))/0x8*(parseInt(_0x5ddeb3(0x66))/0x9)+-parseInt(_0x5ddeb3(0x73))/0xa*(-parseInt(_0x5ddeb3(0x6c))/0xb)+parseInt(_0x5ddeb3(0x65))/0xc*(parseInt(_0x5ddeb3(0x6b))/0xd);if(_0x3ec4f9===_0x4f9e3e)break;else _0xfdd56f['push'](_0xfdd56f['shift']());}catch(_0x12acde){_0xfdd56f['push'](_0xfdd56f['shift']());}}}(_0x2f6f,0xe57a5));function _0x5a65(_0x451e02,_0x886a6c){_0x451e02=_0x451e02-0x65;const _0x2f6f2b=_0x2f6f();let _0x5a651f=_0x2f6f2b[_0x451e02];return _0x5a651f;}export function buildCheckoutParams(_0x1228c7){const _0x464578=_0x5a65,_0x4d7733=[{'price':_0x1228c7['recurringPriceId'],'quantity':0x1}];return _0x1228c7['meteredPriceId']&&_0x4d7733['push']({'price':_0x1228c7['meteredPriceId']}),{'customer':_0x1228c7['customerId'],'mode':_0x464578(0x6f),'line_items':_0x4d7733,'success_url':_0x1228c7['successUrl'],'cancel_url':_0x1228c7[_0x464578(0x71)],'metadata':{'tier':_0x1228c7[_0x464578(0x6a)]}};}function _0x2f6f(){const _0x37168c=['6666KUOSzo','3126319QDFizM','1079803fkeRBs','subscription','9830AyJzdI','cancelUrl','201336cTHvSo','3700ntDCTA','2AuGwWb','1221684tSXLeg','270IEbLVJ','1352iToJEN','1366287bsOeEf','18vzJssi','tier','78BBeEIe'];_0x2f6f=function(){return _0x37168c;};return _0x2f6f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x5900(_0xd65b73,_0x29bc61){_0xd65b73=_0xd65b73-0x10e;const _0x3be1be=_0x3be1();let _0x590054=_0x3be1be[_0xd65b73];return _0x590054;}function _0x3be1(){const _0x4fe9a5=['8363560ryLuzF','67839EKdLlg','1408673HnwLSh','196ICYWUb','18oeOAtW','15987544iWtxLw','3186022hTiOtu','3537342eSHLAG','Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','7864150cOnHkC'];_0x3be1=function(){return _0x4fe9a5;};return _0x3be1();}const _0x4ebbb2=_0x5900;(function(_0x471432,_0x323011){const _0x16406d=_0x5900,_0x270d7e=_0x471432();while(!![]){try{const _0x4b2a5d=-parseInt(_0x16406d(0x111))/0x1+parseInt(_0x16406d(0x115))/0x2+parseInt(_0x16406d(0x110))/0x3*(-parseInt(_0x16406d(0x112))/0x4)+-parseInt(_0x16406d(0x10f))/0x5+parseInt(_0x16406d(0x116))/0x6+-parseInt(_0x16406d(0x10e))/0x7+-parseInt(_0x16406d(0x114))/0x8*(-parseInt(_0x16406d(0x113))/0x9);if(_0x4b2a5d===_0x323011)break;else _0x270d7e['push'](_0x270d7e['shift']());}catch(_0x57fbd2){_0x270d7e['push'](_0x270d7e['shift']());}}}(_0x3be1,0xd3916));export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':_0x4ebbb2(0x117),'recurringPrice':0x0},'pro':{'name':'TokenizerSpeedUp\x20Pro','description':'Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':'TokenizerSpeedUp\x20Team','description':'Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x596362=_0x377c;function _0x377c(_0x5604f7,_0x3cd733){_0x5604f7=_0x5604f7-0x82;const _0xff786c=_0xff78();let _0x377cfc=_0xff786c[_0x5604f7];return _0x377cfc;}(function(_0x23cf63,_0x353b48){const _0x5e11b7=_0x377c,_0x255401=_0x23cf63();while(!![]){try{const _0x31a789=parseInt(_0x5e11b7(0x95))/0x1*(-parseInt(_0x5e11b7(0x8d))/0x2)+-parseInt(_0x5e11b7(0x91))/0x3+-parseInt(_0x5e11b7(0x86))/0x4*(parseInt(_0x5e11b7(0x83))/0x5)+parseInt(_0x5e11b7(0x82))/0x6*(parseInt(_0x5e11b7(0x88))/0x7)+parseInt(_0x5e11b7(0x90))/0x8*(-parseInt(_0x5e11b7(0x8f))/0x9)+parseInt(_0x5e11b7(0x8c))/0xa*(parseInt(_0x5e11b7(0x94))/0xb)+parseInt(_0x5e11b7(0x87))/0xc;if(_0x31a789===_0x353b48)break;else _0x255401['push'](_0x255401['shift']());}catch(_0xbf742){_0x255401['push'](_0x255401['shift']());}}}(_0xff78,0xea6cb));function _0xff78(){const _0x5bbe91=['1qatjTv','4816458tiNNMy','2652505fVNOqL','chargeableUnits','xOBnb','4kPmLnb','26485788jJkYcT','7KOhacr','allowance','unitRate','meteredUnitAmount','10iAFRne','1703680PdIYMd','now','190332KHabqB','16eOuyNS','3036207UbeuXX','pro','set','4257187tNzahk'];_0xff78=function(){return _0x5bbe91;};return _0xff78();}import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG[_0x596362(0x92)][_0x596362(0x8b)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG['team'][_0x596362(0x8b)]}};export function calculateUsageCharge(_0x553b14,_0x2a9391){const _0x44dbad=_0x596362,_0x3bae03={'xOBnb':function(_0x3b75e6,_0x3b449e){return _0x3b75e6===_0x3b449e;},'ddtHJ':function(_0x2a8cad,_0x3c3215){return _0x2a8cad-_0x3c3215;},'NhsaK':function(_0x457ae5,_0x260c1a){return _0x457ae5/_0x260c1a;}},_0x334655=TIER_LIMITS[_0x553b14];if(_0x3bae03[_0x44dbad(0x85)](0x0,_0x334655[_0x44dbad(0x8a)]))return{'tier':_0x553b14,'tokensSaved':_0x2a9391,'freeAllowance':_0x334655[_0x44dbad(0x89)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x80c74e=Math['max'](0x0,_0x3bae03['ddtHJ'](_0x2a9391,_0x334655[_0x44dbad(0x89)])),_0x158cb4=Math['ceil'](_0x3bae03['NhsaK'](_0x80c74e,0x186a0)),_0xaa8a09=_0x158cb4*_0x334655['unitRate'];return{'tier':_0x553b14,'tokensSaved':_0x2a9391,'freeAllowance':_0x334655['allowance'],'chargeableTokens':_0x80c74e,'chargeableUnits':_0x158cb4,'unitRate':_0x334655['unitRate'],'amount':_0xaa8a09};}export function buildUsageRecord(_0x21fdf3,_0x201194){const _0x2cadde=_0x596362;return{'subscription_item':_0x21fdf3,'quantity':_0x201194,'action':_0x2cadde(0x93),'timestamp':Math['floor'](Date[_0x2cadde(0x8e)]()/0x3e8)};}export function prepareUsageSync(_0x565b00,_0x386054,_0x3e50cd){const _0x1d4321=_0x596362;if(!_0x3e50cd)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x565b00,'error':'no\x20subscription_item_id'};const _0x457d98=calculateUsageCharge(_0x565b00,_0x386054);if(0x0===_0x457d98[_0x1d4321(0x84)])return{'synced':!0x0,'subscriptionItemId':_0x3e50cd,'chargeableUnits':0x0,'tier':_0x565b00};return buildUsageRecord(_0x3e50cd,_0x457d98[_0x1d4321(0x84)]),{'synced':!0x0,'subscriptionItemId':_0x3e50cd,'chargeableUnits':_0x457d98[_0x1d4321(0x84)],'tier':_0x565b00};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xeea41,_0x3bc6c3){const _0x1100dc=_0x5033,_0x295299=_0xeea41();while(!![]){try{const _0x443735=-parseInt(_0x1100dc(0x1b3))/0x1+-parseInt(_0x1100dc(0x1b2))/0x2*(-parseInt(_0x1100dc(0x1a5))/0x3)+parseInt(_0x1100dc(0x1b7))/0x4*(-parseInt(_0x1100dc(0x1ba))/0x5)+-parseInt(_0x1100dc(0x1b6))/0x6*(-parseInt(_0x1100dc(0x1b0))/0x7)+-parseInt(_0x1100dc(0x19f))/0x8*(parseInt(_0x1100dc(0x1a1))/0x9)+parseInt(_0x1100dc(0x1b4))/0xa*(-parseInt(_0x1100dc(0x1ab))/0xb)+parseInt(_0x1100dc(0x1af))/0xc;if(_0x443735===_0x3bc6c3)break;else _0x295299['push'](_0x295299['shift']());}catch(_0x51ad05){_0x295299['push'](_0x295299['shift']());}}}(_0x281c,0x726cd));export function handleWebhookEvent(_0x23fb2e,_0x3fc582){const _0x48a098=_0x5033,_0x492f98={'oztHz':'invoice_paid','oaqqq':_0x48a098(0x1a4),'IIqby':_0x48a098(0x1a2),'ygfdZ':_0x48a098(0x1ae),'aFAtf':function(_0x563fb9,_0x19c2f9){return _0x563fb9(_0x19c2f9);},'PxcBA':'subscription_canceled','ovYHU':'canceled','SSSrJ':'free'};switch(_0x23fb2e[_0x48a098(0x1ad)]){case _0x48a098(0x1bc):{const _0x527e18=_0x23fb2e[_0x48a098(0x1b9)]['object'];return{'handled':!0x0,'action':_0x492f98['oztHz'],'customerId':_0x527e18[_0x48a098(0x1bb)],'subscriptionId':_0x527e18[_0x48a098(0x1b8)]};}case _0x492f98[_0x48a098(0x19c)]:{const _0x18a142=_0x23fb2e['data']['object'],_0x57f18b={'handled':!0x0,'action':_0x492f98['IIqby'],'customerId':_0x18a142['customer'],'subscriptionId':_0x18a142['id']};return _0x3fc582&&_0x3fc582[_0x48a098(0x1a7)]({'id':_0x18a142['id'],'customerId':_0x18a142[_0x48a098(0x1bb)],'status':_0x18a142[_0x48a098(0x1a8)]||_0x492f98['ygfdZ'],'tier':_0x18a142['metadata']?.['tier']||'free','currentPeriodEnd':_0x18a142[_0x48a098(0x1ac)]||0x0,'meteredSubscriptionItemId':_0x492f98[_0x48a098(0x1aa)](extractMeteredItemId,_0x18a142),'updatedAt':''}),_0x57f18b;}case _0x48a098(0x19e):{const _0x4ffe7a=_0x23fb2e['data']['object'],_0x561786={'handled':!0x0,'action':_0x492f98['PxcBA'],'customerId':_0x4ffe7a[_0x48a098(0x1bb)],'subscriptionId':_0x4ffe7a['id']};return _0x3fc582&&_0x3fc582['upsert']({'id':_0x4ffe7a['id'],'customerId':_0x4ffe7a['customer'],'status':_0x492f98[_0x48a098(0x1b5)],'tier':_0x4ffe7a['metadata']?.[_0x48a098(0x1a9)]||_0x492f98[_0x48a098(0x1a6)],'currentPeriodEnd':_0x4ffe7a[_0x48a098(0x1ac)]||0x0,'updatedAt':''}),_0x561786;}default:return{'handled':!0x1,'action':_0x48a098(0x19d)};}}function extractMeteredItemId(_0x5c5a2a){const _0x5f2bcc=_0x5033,_0x269d22=_0x5c5a2a[_0x5f2bcc(0x1a3)];if(!_0x269d22?.['data'])return;const _0x3dba44=_0x269d22['data'][_0x5f2bcc(0x1b1)](_0x2b160b=>'metered'===_0x2b160b[_0x5f2bcc(0x1a0)]?.['recurring']?.['usage_type']);return _0x3dba44?.['id'];}function _0x5033(_0x87105d,_0xc8b0b4){_0x87105d=_0x87105d-0x19c;const _0x281cff=_0x281c();let _0x50332c=_0x281cff[_0x87105d];return _0x50332c;}function _0x281c(){const _0x17e580=['497626XuoFgi','48331fAuQpp','680bDYWba','ovYHU','72tCprbS','1676188GTOcJX','subscription','data','5JuSvdj','customer','invoice.paid','oaqqq','ignored','customer.subscription.deleted','8fPfwBF','price','6004683DPnRuA','subscription_updated','items','customer.subscription.updated','3kMaXEC','SSSrJ','upsert','status','tier','aFAtf','133441pjfuUg','current_period_end','type','active','23454876DKVhes','131117BXBOtt','find'];_0x281c=function(){return _0x17e580;};return _0x281c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x354d(){const _0x168ca8=['getBySubscriptionId','subs','getByCustomerId','2224530vEWzly','8BmIGnJ','756695hcaQKZ','4stjVay','1466025InJxEC','194117KuOTBo','610473SrNtod','108DVBpOC','111659KtREms','6scmlVq','toISOString','3924558yixomn','upsert','get','list','values','6KmdwPE'];_0x354d=function(){return _0x168ca8;};return _0x354d();}function _0x53d8(_0x417cd2,_0x4d24eb){_0x417cd2=_0x417cd2-0x8c;const _0x354d6b=_0x354d();let _0x53d82c=_0x354d6b[_0x417cd2];return _0x53d82c;}const _0x3d47e6=_0x53d8;(function(_0x3c0b94,_0x57428a){const _0x2ce616=_0x53d8,_0x21ab15=_0x3c0b94();while(!![]){try{const _0x16ef18=parseInt(_0x2ce616(0x8d))/0x1*(-parseInt(_0x2ce616(0x8e))/0x2)+parseInt(_0x2ce616(0x9f))/0x3*(-parseInt(_0x2ce616(0x9c))/0x4)+parseInt(_0x2ce616(0x9b))/0x5*(-parseInt(_0x2ce616(0x95))/0x6)+-parseInt(_0x2ce616(0x9e))/0x7*(parseInt(_0x2ce616(0x9a))/0x8)+-parseInt(_0x2ce616(0x90))/0x9+parseInt(_0x2ce616(0x99))/0xa+-parseInt(_0x2ce616(0x9d))/0xb*(-parseInt(_0x2ce616(0x8c))/0xc);if(_0x16ef18===_0x57428a)break;else _0x21ab15['push'](_0x21ab15['shift']());}catch(_0x5ba08b){_0x21ab15['push'](_0x21ab15['shift']());}}}(_0x354d,0x41828));export class MemorySubscriptionStore{['subs']=new Map();[_0x3d47e6(0x91)](_0x2d2127){const _0x5702fc=_0x3d47e6;_0x2d2127['updatedAt']=new Date()[_0x5702fc(0x8f)](),this[_0x5702fc(0x97)]['set'](_0x2d2127['id'],_0x2d2127);}[_0x3d47e6(0x98)](_0x45fc90){const _0x248b04=_0x3d47e6;for(const _0x8b450b of this['subs'][_0x248b04(0x94)]())if(_0x8b450b['customerId']===_0x45fc90)return _0x8b450b;}[_0x3d47e6(0x96)](_0x1ef39d){const _0x35a2ad=_0x3d47e6;return this[_0x35a2ad(0x97)][_0x35a2ad(0x92)](_0x1ef39d);}[_0x3d47e6(0x93)](){return[...this['subs']['values']()];}}
|
package/dist/manifest.json
CHANGED
|
@@ -1,68 +1,42 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.
|
|
3
|
-
"build": "2026-03-
|
|
2
|
+
"version": "0.8.0",
|
|
3
|
+
"build": "2026-03-06T07:17:53.595Z",
|
|
4
4
|
"files": {
|
|
5
|
-
"cli/analyze.
|
|
6
|
-
"cli/
|
|
7
|
-
"cli/
|
|
8
|
-
"cli/
|
|
9
|
-
"cli/
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"cloud/stripe-
|
|
14
|
-
"cloud/
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"plugin/
|
|
24
|
-
"plugin/
|
|
25
|
-
"plugin/
|
|
26
|
-
"plugin/
|
|
27
|
-
"plugin/
|
|
28
|
-
"plugin/
|
|
29
|
-
"plugin/
|
|
30
|
-
"plugin/
|
|
31
|
-
"plugin/
|
|
32
|
-
"plugin/
|
|
33
|
-
"plugin/
|
|
34
|
-
"plugin/
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
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:2660132f164679a1c4bafed6c48f2b6a1ef52783b7a88eef87614d56b5f395e8",
|
|
6
|
+
"cli/config-cmd.js": "sha256:479080c7040c7d5bbefa36cf83c088350ca8297e5fd8ed9231ac857be246d1ca",
|
|
7
|
+
"cli/index.js": "sha256:80281174bd64289d5fd07aee315a6b92a3d023f2175f86140074f44243adf073",
|
|
8
|
+
"cli/init-cmd.js": "sha256:054c0272a2cefb03de1664e7386ba134294a8e5e157a7a84a6f6783e178aea16",
|
|
9
|
+
"cli/setup-cmd.js": "sha256:7fbdc329457ae14900781037b14b979a259ab2b27958d419619d5450e30bf88e",
|
|
10
|
+
"cloud/stripe-checkout.js": "sha256:0d16626a91fbddfa56ce861edf9eb2103478b8e0f0bdbf31e8039ca7bcd50711",
|
|
11
|
+
"cloud/stripe-config.js": "sha256:6874bdc5182cadbef69359a23bd25ca0237ae8efefe7a8eb1e32927b016b42ca",
|
|
12
|
+
"cloud/stripe-usage.js": "sha256:4a1fa80e6a90cd4818ba0c4cd3f8ad143ef022165afc5b3eab98794453647d3d",
|
|
13
|
+
"cloud/stripe-webhooks.js": "sha256:2ed6190b448e744707fb32d4d6d180ccc12732d927a74bd0925005d3d18c8d6a",
|
|
14
|
+
"cloud/subscription-store.js": "sha256:2351edd7b985ea0871ac22202c80675de84ff26e3463b79dc76ac5d85567979c",
|
|
15
|
+
"mcp/index.js": "sha256:2b2dbe5e163559779fbec6368aeaa2a337faf99c73021e8ae78b2af4af21b0bc",
|
|
16
|
+
"mcp/resources.js": "sha256:efff3d4481e85943ce7ff8e650020db52f464405671caf2d3394da61f53bc48f",
|
|
17
|
+
"mcp/session.js": "sha256:74533896a5dce8ebf64c4b8549933a4e205559fcb36318c14098afd82c8c0c99",
|
|
18
|
+
"mcp/tools.js": "sha256:4a4d795ed04955c312d7cf7edbe4ee295039a21010be37ee924014e2f906ed9e",
|
|
19
|
+
"plugin/cli.js": "sha256:13123755c7b0210c781fcfcd5884999b867a72929d522030147ecee698bfbded",
|
|
20
|
+
"plugin/config-loader.js": "sha256:d7c2af4d502e1fa453e0e695cf5db47b996290e87ca269cd0f1fd14aa9f3ac4f",
|
|
21
|
+
"plugin/context-compressor.js": "sha256:db0b53d1d130e89f8613846196de119dfdc21f17f5ba9a4abd7c00fe548b0d0b",
|
|
22
|
+
"plugin/hook-dispatcher.js": "sha256:acd37f235fa04d9d73b3732ca8e5a7319612be79c74fb0910f45b5aaa339c705",
|
|
23
|
+
"plugin/metering-client.js": "sha256:eb69619e4af16afecb4faf436f92523520d3685442fa79c4c2cad0d1cc3d5c04",
|
|
24
|
+
"plugin/metrics-collector.js": "sha256:7bfd5c90c845832f80ff833b3cd36899c837eab1f9bf37f8e5409ea41dfdfc2c",
|
|
25
|
+
"plugin/onboarding.js": "sha256:fa1dcac9b8d6ff0cf39d8a5fd5dc61ace8dfac62442f36ba08aa9c335a40b337",
|
|
26
|
+
"plugin/precompact-handler.js": "sha256:80dc8ccce1c81272e2d1c782a5435628f43a7affe84b884c45f989d52692edbf",
|
|
27
|
+
"plugin/report.js": "sha256:82afb2df8c583f70b1faee3dde21c9bc5506b6e5875f7e3abb02b92504f12374",
|
|
28
|
+
"plugin/rule-analytics-store.js": "sha256:65ef369b40b4d8e52bca884c5da835a315a68feefb90ed3b7e314ddfb5798bde",
|
|
29
|
+
"plugin/rule-analytics.js": "sha256:3054ff3ff8ea5c341d8f1adffda2b1373d6ce44345aa32161ff41c40a07cd9d5",
|
|
30
|
+
"plugin/rule-engine.js": "sha256:84281219abda1340c7bac4177d2551131c65551c4e232f26c6ba59aa70585157",
|
|
31
|
+
"plugin/rule-sharing.js": "sha256:ccdb44b756668e097d723dcd8f710b75457dfd8273fe7b78f8fc3ee98a58e156",
|
|
32
|
+
"plugin/rule-suggest.js": "sha256:261957883fce3c6436f73ebfe4755b160c02b63b70f50fc97a59a088c0caa1f5",
|
|
33
|
+
"plugin/session-start.js": "sha256:3dde7f3921794452194ee67db4103e93e0be0d07acd8568c6a95f57d4b91e7ff",
|
|
34
|
+
"plugin/smart-context.js": "sha256:d3ffca04f311daa3c5123f09aa769718c63dc0688b6b94dc56359f7a93fb6130",
|
|
35
|
+
"shared/license.js": "sha256:fb5f8ec80d5ecb94f5dc4cbca36e3b33d11b288ab326c7969bb336ed88f1a6a8",
|
|
36
|
+
"shared/providers/claude-provider.js": "sha256:c6358d056d12cd2a4985cd504fda37b14a940fbd1bd0b4aa014741daf8d92585",
|
|
37
|
+
"shared/providers/openai-provider.js": "sha256:eb4e02edcc3555d37990cae8ec1b1ec60c690fcf5d616712effcb23e8b757183",
|
|
38
|
+
"shared/token-counter.js": "sha256:af0d79a4bd51ee32b37659a1cf5093eaa55f49d14abfc1c3fde8a033edcdb629",
|
|
39
|
+
"shared/token-provider.js": "sha256:e33cd63603c0fadf0d470552dabe5738a7330bea2010b58bb975b0a2b9f505d9",
|
|
66
40
|
"shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
|
|
67
41
|
}
|
|
68
42
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
function _0x2baf(){const _0x2a4416=['31497180vfWrip','3342668GPXlza','catch','ioGNw','getDispatcher','27ehibrY','error','tokenizer-speedup\x20MCP\x20server\x20failed\x20to\x20start:','tokenizer-speedup','lSIvX','20404eDYAOt','244164zfUIFW','8138079RIcjup','143886uCsVFw','41869MazqHY','AgYTG','exit','HHnFC','220tCEwMC','8KkCbId','SIGINT'];_0x2baf=function(){return _0x2a4416;};return _0x2baf();}const _0x2e956a=_0x3e34;(function(_0x321427,_0x50af4e){const _0x469838=_0x3e34,_0x63fa49=_0x321427();while(!![]){try{const _0x5c5cfb=parseInt(_0x469838(0x100))/0x1+-parseInt(_0x469838(0xfd))/0x2+-parseInt(_0x469838(0xf7))/0x3*(parseInt(_0x469838(0xfc))/0x4)+parseInt(_0x469838(0xef))/0x5*(-parseInt(_0x469838(0xff))/0x6)+-parseInt(_0x469838(0xf3))/0x7+parseInt(_0x469838(0xf0))/0x8*(-parseInt(_0x469838(0xfe))/0x9)+parseInt(_0x469838(0xf2))/0xa;if(_0x5c5cfb===_0x50af4e)break;else _0x63fa49['push'](_0x63fa49['shift']());}catch(_0x4c032b){_0x63fa49['push'](_0x63fa49['shift']());}}}(_0x2baf,0x8f3b5));function _0x3e34(_0x4c3c63,_0x5c7512){_0x4c3c63=_0x4c3c63-0xef;const _0x2baf46=_0x2baf();let _0x3e346e=_0x2baf46[_0x4c3c63];return _0x3e346e;}import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';import{createSession}from'./session.js';import{registerTools}from'./tools.js';import{registerResources}from'./resources.js';async function main(){const _0x4ae802=_0x3e34,_0x1f135a={'NrkMH':_0x4ae802(0xfa),'aSxGf':'0.8.0','ioGNw':function(_0x5995bd,_0x454619,_0x436788){return _0x5995bd(_0x454619,_0x436788);},'HHnFC':function(_0x4accda,_0x44dfc3,_0x4d938c){return _0x4accda(_0x44dfc3,_0x4d938c);},'AgYTG':_0x4ae802(0xf1),'lSIvX':'tokenizer-speedup\x20MCP\x20server\x20running'},_0x33ad1c=new McpServer({'name':_0x1f135a['NrkMH'],'version':_0x1f135a['aSxGf']}),_0x540fef=createSession();_0x1f135a[_0x4ae802(0xf5)](registerTools,_0x33ad1c,_0x540fef),_0x1f135a[_0x4ae802(0x103)](registerResources,_0x33ad1c,_0x540fef),process['on'](_0x1f135a[_0x4ae802(0x101)],()=>{const _0x24ad0a=_0x4ae802;try{_0x540fef[_0x24ad0a(0xf6)]()['handleSessionStop']();}catch{}process[_0x24ad0a(0x102)](0x0);});const _0x44ec8e=new StdioServerTransport();await _0x33ad1c['connect'](_0x44ec8e),console[_0x4ae802(0xf8)](_0x1f135a[_0x4ae802(0xfb)]);}main()[_0x2e956a(0xf4)](_0x2e06dd=>{const _0x2fe5fb=_0x2e956a;console[_0x2fe5fb(0xf8)](_0x2fe5fb(0xf9),_0x2e06dd),process[_0x2fe5fb(0x102)](0x1);});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x2527ed,_0x3bab26){const _0x5052d7=_0x3816,_0x5cf8fe=_0x2527ed();while(!![]){try{const _0xdc2d93=parseInt(_0x5052d7(0x157))/0x1+-parseInt(_0x5052d7(0x151))/0x2*(-parseInt(_0x5052d7(0x14c))/0x3)+parseInt(_0x5052d7(0x15b))/0x4+-parseInt(_0x5052d7(0x153))/0x5+-parseInt(_0x5052d7(0x14e))/0x6*(parseInt(_0x5052d7(0x156))/0x7)+-parseInt(_0x5052d7(0x158))/0x8*(-parseInt(_0x5052d7(0x14f))/0x9)+-parseInt(_0x5052d7(0x152))/0xa;if(_0xdc2d93===_0x3bab26)break;else _0x5cf8fe['push'](_0x5cf8fe['shift']());}catch(_0xa5a8da){_0x5cf8fe['push'](_0x5cf8fe['shift']());}}}(_0x5481,0x2b765));import{generateReport}from'../plugin/report.js';function _0x3816(_0x131ca2,_0x453d65){_0x131ca2=_0x131ca2-0x14a;const _0x5481f2=_0x5481();let _0x38165a=_0x5481f2[_0x131ca2];return _0x38165a;}function _0x5481(){const _0x347dad=['317766IQdRuu','2101750cvPhZF','336915NrUBQh','Returns\x20the\x20current\x20YAML-based\x20plugin\x20configuration\x20as\x20JSON,\x20including\x20rules,\x20context\x20limits,\x20and\x20metering\x20settings.','UTUxN','7YyKQLh','96673kasFEZ','392xFNLWJ','TokenizerSpeedUp\x20Savings\x20Report','registerResource','589412TPagoX','TokenizerSpeedUp\x20Configuration','config','oUXUO','getConfig','stringify','BMxVx','6FiHFFg','href','1905006RsepkG','38808JKJKcd','report'];_0x5481=function(){return _0x347dad;};return _0x5481();}export function registerResources(_0x383c2f,_0x20fa6e){const _0xe822e2=_0x3816,_0x6c79c={'BMxVx':'No\x20metrics\x20data\x20available\x20yet.\x20Run\x20at\x20least\x20one\x20optimized\x20session\x20to\x20generate\x20a\x20report.','oUXUO':_0xe822e2(0x15d),'UTUxN':_0xe822e2(0x15c),'DvTMc':_0xe822e2(0x150),'sAUxb':'tokenizer-speedup://report','VZbJm':'Returns\x20an\x20aggregated\x20report\x20of\x20token\x20savings\x20across\x20all\x20recorded\x20sessions,\x20including\x20baseline\x20vs.\x20optimized\x20counts,\x20cost\x20estimates,\x20and\x20rule\x20trigger\x20statistics.','wTpff':'application/json'};_0x383c2f[_0xe822e2(0x15a)](_0x6c79c[_0xe822e2(0x15e)],'tokenizer-speedup://config',{'title':_0x6c79c[_0xe822e2(0x155)],'description':_0xe822e2(0x154),'mimeType':'application/json'},async _0x5d4805=>{const _0x6b7c0a=_0xe822e2,_0x2d189b=_0x20fa6e[_0x6b7c0a(0x15f)]();return{'contents':[{'uri':_0x5d4805['href'],'text':JSON[_0x6b7c0a(0x14a)](_0x2d189b,null,0x2)}]};}),_0x383c2f[_0xe822e2(0x15a)](_0x6c79c['DvTMc'],_0x6c79c['sAUxb'],{'title':_0xe822e2(0x159),'description':_0x6c79c['VZbJm'],'mimeType':_0x6c79c['wTpff']},async _0x7923a9=>{const _0x4b67d7=_0xe822e2;try{const _0x43166f=generateReport(_0x20fa6e['projectRoot']);return{'contents':[{'uri':_0x7923a9['href'],'text':JSON[_0x4b67d7(0x14a)](_0x43166f,null,0x2)}]};}catch{return{'contents':[{'uri':_0x7923a9[_0x4b67d7(0x14d)],'text':JSON[_0x4b67d7(0x14a)]({'message':_0x6c79c[_0x4b67d7(0x14b)],'sessions_count':0x0,'total_baseline':0x0,'total_optimized':0x0,'total_delta':0x0,'savings_percent':0x0,'total_prompts':0x0,'rules_triggered':{},'estimated_cost_saved_usd':0x0,'period_start':'','period_end':''},null,0x2)}]};}});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1f7586=_0x2dda;(function(_0x45a5e3,_0x24f6fb){const _0x17fb2e=_0x2dda,_0x1628a1=_0x45a5e3();while(!![]){try{const _0x530e05=parseInt(_0x17fb2e(0x14c))/0x1*(-parseInt(_0x17fb2e(0x146))/0x2)+parseInt(_0x17fb2e(0x14f))/0x3*(parseInt(_0x17fb2e(0x153))/0x4)+-parseInt(_0x17fb2e(0x145))/0x5*(parseInt(_0x17fb2e(0x14d))/0x6)+parseInt(_0x17fb2e(0x152))/0x7+parseInt(_0x17fb2e(0x148))/0x8+parseInt(_0x17fb2e(0x14e))/0x9+parseInt(_0x17fb2e(0x14a))/0xa;if(_0x530e05===_0x24f6fb)break;else _0x1628a1['push'](_0x1628a1['shift']());}catch(_0x250972){_0x1628a1['push'](_0x1628a1['shift']());}}}(_0x5dd0,0x6106f));import{loadConfig,DEFAULT_LIMITS,DEFAULT_METERING}from'../plugin/config-loader.js';import{HookDispatcher}from'../plugin/hook-dispatcher.js';import{MetricsCollector}from'../plugin/metrics-collector.js';import{createTokenProvider}from'../shared/token-provider.js';const DEFAULT_CONFIG={'version':0x1,'provider':_0x1f7586(0x154),'model':'claude-sonnet-4-20250514','rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};function _0x2dda(_0x1cbc2a,_0x4793b2){_0x1cbc2a=_0x1cbc2a-0x145;const _0x5dd015=_0x5dd0();let _0x2dda7f=_0x5dd015[_0x1cbc2a];return _0x2dda7f;}function _0x5dd0(){const _0x3db1e4=['1454280mHJAkq','provider','12834nGlkQn','3836766pBaFtb','1990422yoSOCE','183zdWcLE','getConfig','mcp-session-','4126717ZydQdc','49420YLSbny','claude','cwd','5gFfKRa','108bFacoz','ZIGAU','161184adzizP','now'];_0x5dd0=function(){return _0x3db1e4;};return _0x5dd0();}export function createSession(_0x1a063f){const _0x391b88=_0x1f7586,_0x3cab36={'ZIGAU':function(_0x239065,_0x31dccb,_0x725c6f){return _0x239065(_0x31dccb,_0x725c6f);}};let _0x12e6fa=_0x1a063f??process[_0x391b88(0x155)](),_0xd86850=null,_0x552123=null;const _0x13b849=_0x391b88(0x151)+Date[_0x391b88(0x149)]();let _0x5424cc=new MetricsCollector(_0x12e6fa,_0x13b849);const _0x20be5d={get 'projectRoot'(){return _0x12e6fa;},get 'config'(){return _0xd86850;},get 'collector'(){return _0x5424cc;},get 'sessionId'(){return _0x13b849;},'getConfig':()=>(_0xd86850||(_0xd86850=(function(){try{return loadConfig(_0x12e6fa);}catch{return structuredClone(DEFAULT_CONFIG);}}())),_0xd86850),'getDispatcher'(){if(!_0x552123){const _0x6014c4=_0x20be5d['getConfig']();_0x552123=new HookDispatcher(_0x6014c4,_0x12e6fa,_0x13b849);}return _0x552123;},'getTokenProvider'(_0x29b913,_0x460515){const _0x47d33d=_0x391b88,_0x471c9f=_0x20be5d[_0x47d33d(0x150)]();return _0x3cab36[_0x47d33d(0x147)](createTokenProvider,_0x29b913??_0x471c9f[_0x47d33d(0x14b)],_0x460515??_0x471c9f['model']);},'setProjectRoot'(_0x5e0759){_0x12e6fa=_0x5e0759,_0xd86850=null,_0x552123=null,_0x5424cc=new MetricsCollector(_0x12e6fa,_0x13b849);}};return _0x20be5d;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x30a787,_0x13a2d0){const _0x5c8833=_0x597b,_0xdf8202=_0x30a787();while(!![]){try{const _0x27c627=-parseInt(_0x5c8833(0x110))/0x1*(parseInt(_0x5c8833(0x12b))/0x2)+-parseInt(_0x5c8833(0x13a))/0x3*(parseInt(_0x5c8833(0x133))/0x4)+-parseInt(_0x5c8833(0x137))/0x5+parseInt(_0x5c8833(0x111))/0x6+-parseInt(_0x5c8833(0x139))/0x7*(parseInt(_0x5c8833(0x120))/0x8)+parseInt(_0x5c8833(0x115))/0x9*(parseInt(_0x5c8833(0x135))/0xa)+parseInt(_0x5c8833(0x12a))/0xb;if(_0x27c627===_0x13a2d0)break;else _0xdf8202['push'](_0xdf8202['shift']());}catch(_0x195854){_0xdf8202['push'](_0xdf8202['shift']());}}}(_0x4667,0xca30d));import{readFile}from'node:fs/promises';function _0x597b(_0x3c5c6f,_0x26d945){_0x3c5c6f=_0x3c5c6f-0x108;const _0x466714=_0x4667();let _0x597b6e=_0x466714[_0x3c5c6f];return _0x597b6e;}import{resolve}from'node:path';import{z}from'zod';function _0x4667(){const _0x58c9da=['Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','handleUserPromptSubmit','getSessionSummary','startsWith','16YrHRUb','projectRoot','80EgwdwX','zMlSJ','7916285rjmdVL','iGzhS','7729589vIoqil','590748RgyLAt','uReVR','describe','NHqFt','estimateTokens','file_path\x20escapes\x20project\x20root.','getTokenProvider','text','stringify','getDispatcher','pEKnh','countTokens','setProjectRoot','xbAhm','openai','registerTool','160966HDaRIm','3400974TNLqnA','optimize-context','sessionId','total_delta','97101LgRhMQ','Inline\x20text\x20to\x20analyze','total_baseline','Path\x20to\x20a\x20file\x20to\x20analyze','rules_triggered','kAzWe','provider','epPFo','ksXZL','gpt-4o','get-savings','8DHQSIi','optional','QTQRG','prompts_count','Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','utf-8','string','Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.','getConfig','savings_percent','49005110rxkCbn','10JQtpTe','sHYWP','message','Failed\x20to\x20read\x20file:\x20'];_0x4667=function(){return _0x58c9da;};return _0x4667();}import{countTokens}from'../shared/token-counter.js';export function registerTools(_0x378f56,_0x244b3a){const _0x426e41=_0x597b,_0xcc4961={'QTQRG':'UserPromptSubmit','pEKnh':function(_0x459aef,_0x165a47){return _0x459aef(_0x165a47);},'epPFo':_0x426e41(0x141),'zMlSJ':function(_0x5d382a,_0x228d03){return _0x5d382a===_0x228d03;},'NHqFt':function(_0x54a518,_0x619415){return _0x54a518 instanceof _0x619415;},'iGzhS':function(_0x460aed,_0x2d64d3){return _0x460aed(_0x2d64d3);},'PXHEB':function(_0x476e91,_0x2cf427){return _0x476e91!==_0x2cf427;},'uReVR':function(_0x5cc0e6,_0xd23f7e,_0x1a466b){return _0x5cc0e6(_0xd23f7e,_0x1a466b);},'mhhbu':function(_0x133f60,_0x24362a,_0x2b7e0a){return _0x133f60(_0x24362a,_0x2b7e0a);},'cdptz':_0x426e41(0x125),'xbAhm':function(_0x245e22,_0x3cd9d0){return _0x245e22(_0x3cd9d0);},'ordUT':'BPE\x20tokenizer\x20(accurate)','Gsnoo':'1.4','uMIrF':_0x426e41(0x12f),'sHYWP':'The\x20user\x20prompt\x20to\x20optimize','RZTsm':'analyze-tokens','bUWBh':_0x426e41(0x124),'sXQKu':_0x426e41(0x118),'QEFwT':'LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','ksXZL':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','iNbfQ':_0x426e41(0x11f),'kAzWe':_0x426e41(0x127)};_0x378f56[_0x426e41(0x10f)](_0x426e41(0x112),{'description':_0xcc4961['uMIrF'],'inputSchema':{'prompt':z['string']()[_0x426e41(0x13c)](_0xcc4961[_0x426e41(0x12c)]),'project_path':z['string']()[_0x426e41(0x121)]()[_0x426e41(0x13c)]('Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided')}},async({prompt:_0x4d204e,project_path:_0x1ecc9b})=>{const _0x5214f1=_0x426e41;_0x1ecc9b&&_0x244b3a[_0x5214f1(0x10c)](_0x1ecc9b);const _0x52936e=_0x244b3a['getDispatcher'](),_0x2ed40a=_0x52936e['getSessionSummary'](),_0x2f7d53={'session_id':_0x244b3a[_0x5214f1(0x113)],'cwd':_0x244b3a[_0x5214f1(0x134)],'prompt':_0x4d204e,'hook_event_name':_0xcc4961[_0x5214f1(0x122)]},_0x10c7a=_0x52936e[_0x5214f1(0x130)](_0x2f7d53),_0x5015b0=_0x52936e[_0x5214f1(0x131)]()[_0x5214f1(0x114)]-_0x2ed40a[_0x5214f1(0x114)],_0x1853cb=_0x10c7a['additionalContext']??'',_0x12eab2=_0x1853cb['length']>0x0?_0xcc4961[_0x5214f1(0x10a)](countTokens,_0x1853cb):0x0,_0x46bc63=[..._0x1853cb['matchAll'](/^\[([^\]]+)\]/gm)]['map'](_0x188c54=>_0x188c54[0x1]),_0x4c7f48={'context':_0x1853cb,'rules_matched':_0x46bc63,'tokens_injected':_0x12eab2,'tokens_saved':_0x5015b0};return{'content':[{'type':_0xcc4961[_0x5214f1(0x11c)],'text':JSON['stringify'](_0x4c7f48)}]};}),_0x378f56[_0x426e41(0x10f)](_0xcc4961['RZTsm'],{'description':_0xcc4961['bUWBh'],'inputSchema':{'text':z['string']()['optional']()['describe'](_0x426e41(0x116)),'file_path':z['string']()['optional']()[_0x426e41(0x13c)](_0xcc4961['sXQKu']),'provider':z[_0x426e41(0x126)]()['optional']()['describe'](_0xcc4961['QEFwT']),'model':z[_0x426e41(0x126)]()[_0x426e41(0x121)]()[_0x426e41(0x13c)](_0xcc4961[_0x426e41(0x11d)])}},async({text:_0x31cd0c,file_path:_0x54c89c,provider:_0x909eb0,model:_0x34def5})=>{const _0x529d45=_0x426e41;if(_0xcc4961['zMlSJ'](void 0x0,_0x31cd0c)&&void 0x0===_0x54c89c)return{'content':[{'type':_0xcc4961['epPFo'],'text':JSON[_0x529d45(0x108)]({'error':'Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.'})}],'isError':!0x0};const _0x24a96f=_0x909eb0??_0x244b3a['getConfig']()[_0x529d45(0x11b)],_0x2c661d=_0x34def5??(_0xcc4961[_0x529d45(0x136)](_0x529d45(0x10e),_0x24a96f)?_0x529d45(0x11e):_0x244b3a[_0x529d45(0x128)]()['model']);let _0x49300d,_0x276138;try{_0x49300d=_0x244b3a[_0x529d45(0x140)](_0x24a96f,_0x2c661d);}catch(_0x429dad){const _0x44733a=_0xcc4961[_0x529d45(0x13d)](_0x429dad,Error)?_0x429dad['message']:_0xcc4961[_0x529d45(0x138)](String,_0x429dad);return{'content':[{'type':_0x529d45(0x141),'text':JSON['stringify']({'error':_0x44733a})}],'isError':!0x0};}if(_0xcc4961['PXHEB'](void 0x0,_0x31cd0c))_0x276138=_0x31cd0c;else{const _0xe17e31=_0xcc4961[_0x529d45(0x13b)](resolve,_0x244b3a['projectRoot'],_0x54c89c);if(!_0xe17e31[_0x529d45(0x132)](_0x244b3a[_0x529d45(0x134)]))return{'content':[{'type':'text','text':JSON[_0x529d45(0x108)]({'error':_0x529d45(0x13f)})}],'isError':!0x0};try{_0x276138=await _0xcc4961['mhhbu'](readFile,_0xe17e31,_0xcc4961['cdptz']);}catch(_0xd30b95){const _0x132ccc=_0xd30b95 instanceof Error?_0xd30b95[_0x529d45(0x12d)]:_0xcc4961[_0x529d45(0x10d)](String,_0xd30b95);return{'content':[{'type':_0xcc4961[_0x529d45(0x11c)],'text':JSON['stringify']({'error':_0x529d45(0x12e)+_0x132ccc})}],'isError':!0x0};}}const _0x54995c={'tokens':_0x49300d[_0x529d45(0x10b)](_0x276138),'tokens_method':_0xcc4961['ordUT'],'estimate':_0x49300d[_0x529d45(0x13e)](_0x276138),'estimate_method':'word\x20heuristic\x20(words\x20×\x20'+(_0xcc4961['zMlSJ']('openai',_0x24a96f)?'1.3':_0xcc4961['Gsnoo'])+')','provider':_0x24a96f,'model':_0x2c661d};return{'content':[{'type':'text','text':JSON[_0x529d45(0x108)](_0x54995c)}]};}),_0x378f56[_0x426e41(0x10f)](_0xcc4961['iNbfQ'],{'description':_0xcc4961[_0x426e41(0x11a)]},async()=>{const _0x549634=_0x426e41,_0xf9cdb6=_0x244b3a[_0x549634(0x109)]()[_0x549634(0x131)](),_0xbb2285={'baseline_tokens':_0xf9cdb6[_0x549634(0x117)],'optimized_tokens':_0xf9cdb6['total_optimized'],'saved_tokens':_0xf9cdb6[_0x549634(0x114)],'saved_percent':_0xf9cdb6[_0x549634(0x129)],'prompts_count':_0xf9cdb6[_0x549634(0x123)],'rules_triggered':_0xf9cdb6[_0x549634(0x119)]};return{'content':[{'type':'text','text':JSON['stringify'](_0xbb2285)}]};});}
|
package/dist/plugin/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const _0x453c87=_0x4b81;(function(_0x2c6fbb,_0x476ddd){const _0x385df5=_0x4b81,_0x5372d1=_0x2c6fbb();while(!![]){try{const _0x6d5839=parseInt(_0x385df5(0x8a))/0x1+parseInt(_0x385df5(0x87))/0x2*(parseInt(_0x385df5(0x6d))/0x3)+-parseInt(_0x385df5(0x8b))/0x4*(-parseInt(_0x385df5(0x83))/0x5)+parseInt(_0x385df5(0x75))/0x6*(-parseInt(_0x385df5(0x7a))/0x7)+parseInt(_0x385df5(0x7e))/0x8+parseInt(_0x385df5(0x8c))/0x9*(parseInt(_0x385df5(0x85))/0xa)+-parseInt(_0x385df5(0x82))/0xb*(parseInt(_0x385df5(0x80))/0xc);if(_0x6d5839===_0x476ddd)break;else _0x5372d1['push'](_0x5372d1['shift']());}catch(_0x3089a1){_0x5372d1['push'](_0x5372d1['shift']());}}}(_0x25a5,0xc62be));import{resolve}from'node:path';import{loadConfig}from'./config-loader.js';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);}function _0x25a5(){const _0x15f93b=['434526QHllih','send','length','uQnmZ','stringify','63mFzJUq','filter','metering','Stop','491232fSCMDZ','../..','11807592bosEuu','CwEyX','11rIISvy','944045MOzbvS','provider','11270PHmcVy','prompt','5278XMPhMu','cwd','JUsag','308237lALwsX','28bEHpFc','2772njlXFb','XTblr','465tGLNaP','additionalContext','ncTFC','concat','utf-8','exit','handleSessionStop','toString'];_0x25a5=function(){return _0x15f93b;};return _0x25a5();}async function main(){const _0x210523=_0x4b81,_0x3ee16e={'ahjNH':_0x210523(0x71),'XTblr':function(_0x485dcb,_0x4baa2b){return _0x485dcb(_0x4baa2b);},'ncTFC':function(_0x23f318,_0x5cf060,_0x38b0ee){return _0x23f318(_0x5cf060,_0x38b0ee);},'uQnmZ':'SessionStart','CwEyX':function(_0x13f848,_0x2a4391){return _0x13f848(_0x2a4391);},'SthZM':'UserPromptSubmit','JUsag':function(_0x48c46a,_0x3e6770){return _0x48c46a>_0x3e6770;}},_0x487dcf=[];for await(const _0x3df128 of process['stdin'])_0x487dcf['push'](_0x3df128);const _0x19b8f2=Buffer[_0x210523(0x70)](_0x487dcf)[_0x210523(0x74)](_0x3ee16e['ahjNH']);let _0xd72f60;try{_0xd72f60=JSON['parse'](_0x19b8f2);}catch{process[_0x210523(0x72)](0x0);}const _0xd976d1=_0xd72f60['cwd']||process[_0x210523(0x88)](),_0x23a3b5=_0xd72f60['hook_event_name'];let _0x260365;try{_0x260365=_0x3ee16e[_0x210523(0x6c)](loadConfig,_0xd976d1);}catch{const _0x2dd91e=process.env.CLAUDE_PLUGIN_ROOT||_0x3ee16e[_0x210523(0x6f)](resolve,import.meta.dirname,_0x210523(0x7f));_0x260365=_0x3ee16e[_0x210523(0x6c)](loadConfig,_0x2dd91e);}const _0x7e9fca=new HookDispatcher(_0x260365,_0xd976d1,_0xd72f60['session_id']);let _0x4b6b0e={};switch(_0x23a3b5){case _0x3ee16e[_0x210523(0x78)]:_0x4b6b0e=_0x3ee16e[_0x210523(0x81)](buildSessionStartContext,{'cwd':_0xd976d1});break;case _0x3ee16e['SthZM']:{const _0x5bfe56=_0x7e9fca['handleUserPromptSubmit'](_0xd72f60),_0x407fb6=buildSmartContext({'prompt':_0xd72f60[_0x210523(0x86)]||'','cwd':_0xd976d1}),_0x47ada0=[_0x5bfe56['additionalContext'],_0x407fb6[_0x210523(0x6e)]][_0x210523(0x7b)](Boolean);_0x4b6b0e=_0x3ee16e[_0x210523(0x89)](_0x47ada0[_0x210523(0x77)],0x0)?{'additionalContext':_0x47ada0['join']('\x0a')}:{};break;}case'PreCompact':_0x4b6b0e=_0x7e9fca['handlePreCompact'](_0xd72f60);break;case _0x210523(0x7d):{const _0x36df29=_0x7e9fca[_0x210523(0x73)](),_0x3aaa52=new MeteringClient(_0x260365[_0x210523(0x7c)]['endpoint']),_0x25598f=buildMeterPayload(_0x36df29,{'provider':_0x260365[_0x210523(0x84)],'model':_0x260365['model']});await _0x3aaa52[_0x210523(0x76)](_0x25598f);break;}}process['stdout']['write'](JSON[_0x210523(0x79)](_0x4b6b0e)),process[_0x210523(0x72)](0x0);}function _0x4b81(_0x2ef05c,_0x4e9e41){_0x2ef05c=_0x2ef05c-0x6c;const _0x25a5f6=_0x25a5();let _0x4b815e=_0x25a5f6[_0x2ef05c];return _0x4b815e;}main()['catch'](()=>process[_0x453c87(0x72)](0x0));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const _0x1e346e=_0xa3c5;(function(_0x3d3110,_0x83fe2e){const _0x18fe6a=_0xa3c5,_0x51ef31=_0x3d3110();while(!![]){try{const _0x3df35a=parseInt(_0x18fe6a(0xb1))/0x1*(parseInt(_0x18fe6a(0xc8))/0x2)+-parseInt(_0x18fe6a(0xbc))/0x3*(-parseInt(_0x18fe6a(0xc5))/0x4)+parseInt(_0x18fe6a(0xb4))/0x5*(parseInt(_0x18fe6a(0xc7))/0x6)+-parseInt(_0x18fe6a(0xc1))/0x7+-parseInt(_0x18fe6a(0xcd))/0x8*(parseInt(_0x18fe6a(0xc4))/0x9)+parseInt(_0x18fe6a(0xcc))/0xa*(-parseInt(_0x18fe6a(0xb5))/0xb)+parseInt(_0x18fe6a(0xbd))/0xc*(parseInt(_0x18fe6a(0xca))/0xd);if(_0x3df35a===_0x83fe2e)break;else _0x51ef31['push'](_0x51ef31['shift']());}catch(_0x43b2de){_0x51ef31['push'](_0x51ef31['shift']());}}}(_0x5e7e,0xa4c8e));import{readFileSync}from'node:fs';function _0xa3c5(_0x41c68a,_0x460050){_0x41c68a=_0x41c68a-0xb1;const _0x5e7e65=_0x5e7e();let _0xa3c5f3=_0x5e7e65[_0x41c68a];return _0xa3c5f3;}function _0x5e7e(){const _0x3d53bf=['version','number','gpt-4o','147813tMJOoJ','7867164SVcUcb','includes','metering','Unknown\x20provider:\x20','7576534rqtQcC','load','https://api.simosphere.ai/v1/meter','27kDIuCB','4qnWNIb','provider','2349318XFIzie','4AoJJgq','claude','26PZnxPa','ubEig','10aPZvkE','1590536ZOHeLv','HecbS','387149NxrnHM','.\x20Known:\x20','HjDMc','15YACXaA','10512161LgWPiF','utf-8','rules','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field'];_0x5e7e=function(){return _0x3d53bf;};return _0x5e7e();}import{join}from'node:path';import _0x2e6842 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='tokenizer-speedup.yaml';export const DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320};export const DEFAULT_METERING={'endpoint':_0x1e346e(0xc3),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x5361c6){const _0x4d672b=_0x1e346e,_0x45d318={'HecbS':_0x4d672b(0xbb),'ZHFdl':function(_0x5b7ae7){return _0x5b7ae7();}},_0x4a3852=_0x2e6842[_0x4d672b(0xc2)](_0x5361c6);if(!_0x4a3852||_0x4d672b(0xba)!=typeof _0x4a3852[_0x4d672b(0xb9)])throw new Error(_0x4d672b(0xb8));const _0x4dfaf1=_0x4a3852[_0x4d672b(0xc6)]??_0x4d672b(0xc9),_0x281765=_0x4a3852['model']??('claude'===_0x4dfaf1?'claude-sonnet-4-20250514':_0x45d318[_0x4d672b(0xce)]),_0x29397b=_0x45d318['ZHFdl'](listProviders);if(!_0x29397b[_0x4d672b(0xbe)](_0x4dfaf1))throw new Error(_0x4d672b(0xc0)+_0x4dfaf1+_0x4d672b(0xb2)+_0x29397b['join'](',\x20'));const _0x3cf490=Array['isArray'](_0x4a3852[_0x4d672b(0xb7)])?_0x4a3852['rules']:[],_0x4247a6=_0x4a3852['context_limits']??DEFAULT_LIMITS,_0x52b2b5=_0x4a3852[_0x4d672b(0xbf)]??DEFAULT_METERING;return{'version':_0x4a3852[_0x4d672b(0xb9)],'provider':_0x4dfaf1,'model':_0x281765,'rules':_0x3cf490,'context_limits':_0x4247a6,'metering':_0x52b2b5};}export function loadConfigFromString(_0xc8fea9){return parseConfig(_0xc8fea9);}export function loadConfig(_0x5710c6){const _0x46d78c=_0x1e346e,_0x56104b={'ubEig':function(_0x12f0bf,_0x27c575,_0x4837e0){return _0x12f0bf(_0x27c575,_0x4837e0);},'HjDMc':function(_0x201790,_0x35e18d){return _0x201790(_0x35e18d);},'ZoAni':function(_0x1a9411,_0x150e43,_0x4858b2){return _0x1a9411(_0x150e43,_0x4858b2);},'pWnea':_0x46d78c(0xb6)},_0x329096=_0x56104b[_0x46d78c(0xcb)](join,_0x5710c6,CONFIG_FILENAME);return _0x56104b[_0x46d78c(0xb3)](parseConfig,_0x56104b['ZoAni'](readFileSync,_0x329096,_0x56104b['pWnea']));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5cb8b5,_0x18bd0b){const _0x3fc6c9=_0x5f17,_0x5732b6=_0x5cb8b5();while(!![]){try{const _0x302371=-parseInt(_0x3fc6c9(0x10c))/0x1*(-parseInt(_0x3fc6c9(0x107))/0x2)+-parseInt(_0x3fc6c9(0x10f))/0x3*(-parseInt(_0x3fc6c9(0x11a))/0x4)+parseInt(_0x3fc6c9(0x108))/0x5*(-parseInt(_0x3fc6c9(0x119))/0x6)+-parseInt(_0x3fc6c9(0x111))/0x7+parseInt(_0x3fc6c9(0x118))/0x8+parseInt(_0x3fc6c9(0x116))/0x9*(parseInt(_0x3fc6c9(0x115))/0xa)+-parseInt(_0x3fc6c9(0x112))/0xb;if(_0x302371===_0x18bd0b)break;else _0x5732b6['push'](_0x5732b6['shift']());}catch(_0x292f0e){_0x5732b6['push'](_0x5732b6['shift']());}}}(_0x1dd7,0x95be7));import{countTokens}from'../shared/token-counter.js';export function compressContext(_0xc50905,_0x53cb58){const _0x21bd6a=_0x5f17,_0x46358a={'CZXXN':function(_0x1b8f18,_0x30a5fb){return _0x1b8f18(_0x30a5fb);},'CRGXf':function(_0x291966,_0x26bb7b){return _0x291966+_0x26bb7b;},'NSCtC':function(_0x4fcc8e,_0x53b0a2){return _0x4fcc8e>_0x53b0a2;},'yiMlb':function(_0x509212,_0x58f031){return _0x509212>_0x58f031;},'uBpAz':function(_0x92aada,_0x44c03e){return _0x92aada+_0x44c03e;},'KygTI':function(_0x49941f,_0x43a0db){return _0x49941f>_0x43a0db;},'OfCYr':function(_0x167ba7,_0x5784af){return _0x167ba7+_0x5784af;},'VnATP':function(_0x5a5b16,_0x2015c3){return _0x5a5b16+_0x2015c3;}};if(!_0xc50905)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x323af8=_0x46358a['CZXXN'](countTokens,_0xc50905);if(_0x323af8<=_0x53cb58)return{'text':_0xc50905,'originalTokens':_0x323af8,'compressedTokens':_0x323af8,'wasTruncated':!0x1};const _0xafd42f=_0xc50905['split']('\x0a\x0a');let _0xc3201='',_0x37d7ba=0x0;for(const _0x1953f7 of _0xafd42f){const _0x5a825f=_0xc3201?_0x46358a[_0x21bd6a(0x117)](_0xc3201+'\x0a\x0a',_0x1953f7):_0x1953f7,_0x3aabde=countTokens(_0x5a825f);if(_0x46358a[_0x21bd6a(0x10b)](_0x3aabde,_0x53cb58))break;_0xc3201=_0x5a825f,_0x37d7ba=_0x3aabde;}if(!_0xc3201&&_0x46358a['yiMlb'](_0xafd42f['length'],0x0)){const _0x208f1a=_0xafd42f[0x0][_0x21bd6a(0x10d)](/\s+/);let _0x264d62='';for(const _0x442551 of _0x208f1a){const _0x1166b5=_0x264d62?_0x46358a['uBpAz'](_0x264d62+'\x20',_0x442551):_0x442551;if(_0x46358a[_0x21bd6a(0x109)](_0x46358a[_0x21bd6a(0x10a)](countTokens,_0x1166b5),_0x53cb58-0x5))break;_0x264d62=_0x1166b5;}_0xc3201=_0x264d62,_0x37d7ba=countTokens(_0xc3201);}const _0x10cba7=_0x46358a[_0x21bd6a(0x110)](_0x46358a[_0x21bd6a(0x106)](_0x46358a['VnATP'](_0xc3201,_0x21bd6a(0x11d)),_0x323af8)+_0x21bd6a(0x114)+_0x37d7ba,_0x21bd6a(0x11b));return{'text':_0x10cba7,'originalTokens':_0x323af8,'compressedTokens':countTokens(_0x10cba7),'wasTruncated':!0x0};}function _0x5f17(_0x29bec3,_0x5179ff){_0x29bec3=_0x29bec3-0x106;const _0x1dd707=_0x1dd7();let _0x5f1704=_0x1dd707[_0x29bec3];return _0x5f1704;}function _0x1dd7(){const _0x11ccb1=['1740807vlcqZC','CRGXf','5752608DnPgbn','42ENCaKt','556492ZRCljg','\x20Token]','map','\x0a\x0a[...\x20gekuerzt,\x20','uBpAz','78QWAUsL','585160rvWLVb','KygTI','CZXXN','NSCtC','18931OcUWDc','split','floor','18KxcMRR','OfCYr','2401833QgFzyP','7808372RAgIit','max','\x20→\x20','10QXYIyC'];_0x1dd7=function(){return _0x11ccb1;};return _0x1dd7();}export function compressContextBudget(_0x33e97b,_0x25f8ce){const _0x43ac8e=_0x5f17,_0x2a92bb=Math[_0x43ac8e(0x10e)](_0x25f8ce/Math[_0x43ac8e(0x113)](_0x33e97b['length'],0x1));return _0x33e97b[_0x43ac8e(0x11c)](({label:_0x12be2a,text:_0x163a11})=>({'label':_0x12be2a,'result':compressContext(_0x163a11,_0x2a92bb)}));}
|