@simosphere/tokenizer-speedup 0.10.0 → 0.10.1

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.
Files changed (49) hide show
  1. package/dist/cli/analyze.js +1 -1
  2. package/dist/cli/config-cmd.js +1 -1
  3. package/dist/cli/index.js +1 -1
  4. package/dist/cli/init-cmd.js +1 -1
  5. package/dist/cli/setup-cmd.js +1 -1
  6. package/dist/cloud/stripe-checkout.js +1 -1
  7. package/dist/cloud/stripe-config.js +1 -1
  8. package/dist/cloud/stripe-usage.js +1 -1
  9. package/dist/cloud/stripe-webhooks.js +1 -1
  10. package/dist/cloud/subscription-store.js +1 -1
  11. package/dist/manifest.json +49 -49
  12. package/dist/mcp/index.js +1 -1
  13. package/dist/mcp/resources.js +1 -1
  14. package/dist/mcp/session.js +1 -1
  15. package/dist/mcp/tools.js +1 -1
  16. package/dist/plugin/cli.js +1 -1
  17. package/dist/plugin/compression/anonymize.js +1 -1
  18. package/dist/plugin/compression/cache.js +1 -1
  19. package/dist/plugin/compression/chunked.js +1 -1
  20. package/dist/plugin/compression/dedup.js +1 -1
  21. package/dist/plugin/compression/format-optimizer.js +1 -1
  22. package/dist/plugin/compression/index.js +1 -1
  23. package/dist/plugin/compression/pipeline.js +1 -1
  24. package/dist/plugin/compression/quality.js +1 -1
  25. package/dist/plugin/compression/rule-based.js +1 -1
  26. package/dist/plugin/compression/structural.js +1 -1
  27. package/dist/plugin/compression/text-utils.js +1 -1
  28. package/dist/plugin/compression/token-budget.js +1 -1
  29. package/dist/plugin/config-loader.js +1 -1
  30. package/dist/plugin/context-compressor.js +1 -1
  31. package/dist/plugin/hook-dispatcher.js +1 -1
  32. package/dist/plugin/metering-client.js +1 -1
  33. package/dist/plugin/metrics-collector.js +1 -1
  34. package/dist/plugin/onboarding.js +1 -1
  35. package/dist/plugin/precompact-handler.js +1 -1
  36. package/dist/plugin/report.js +1 -1
  37. package/dist/plugin/rule-analytics-store.js +1 -1
  38. package/dist/plugin/rule-analytics.js +1 -1
  39. package/dist/plugin/rule-engine.js +1 -1
  40. package/dist/plugin/rule-sharing.js +1 -1
  41. package/dist/plugin/rule-suggest.js +1 -1
  42. package/dist/plugin/session-start.js +1 -1
  43. package/dist/plugin/smart-context.js +1 -1
  44. package/dist/shared/license.js +1 -1
  45. package/dist/shared/providers/claude-provider.js +1 -1
  46. package/dist/shared/providers/openai-provider.js +1 -1
  47. package/dist/shared/token-counter.js +1 -1
  48. package/dist/shared/token-provider.js +1 -1
  49. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x1e5e89=_0x429d;(function(_0x10aed3,_0x554799){const _0x3f63fe=_0x429d,_0x517a49=_0x10aed3();while(!![]){try{const _0x1e8688=-parseInt(_0x3f63fe(0x1ec))/0x1*(parseInt(_0x3f63fe(0x1e3))/0x2)+-parseInt(_0x3f63fe(0x1e7))/0x3*(parseInt(_0x3f63fe(0x1eb))/0x4)+parseInt(_0x3f63fe(0x1e6))/0x5+parseInt(_0x3f63fe(0x1e0))/0x6+parseInt(_0x3f63fe(0x1e1))/0x7*(-parseInt(_0x3f63fe(0x1e9))/0x8)+parseInt(_0x3f63fe(0x1ea))/0x9+parseInt(_0x3f63fe(0x1ed))/0xa;if(_0x1e8688===_0x554799)break;else _0x517a49['push'](_0x517a49['shift']());}catch(_0x3e2ce1){_0x517a49['push'](_0x517a49['shift']());}}}(_0x1be9,0x2da1c));import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';function _0x1be9(){const _0x53d3a2=['1mOmASe','1146220iKDaGU','claude-sonnet-4-20250514','hgyqo','RHyvI','1453140CzPqTh','1666651xoYTpl','countTokens','315814YJprkx','estimateTokens','iQwUG','382065UweZzi','393LGqoKr','claude','8qrthfo','2757231zKAIpa','4784JPHnto'];_0x1be9=function(){return _0x53d3a2;};return _0x1be9();}import'../shared/providers/openai-provider.js';function _0x429d(_0x4e02e1,_0x31abe9){_0x4e02e1=_0x4e02e1-0x1e0;const _0x1be908=_0x1be9();let _0x429d62=_0x1be908[_0x4e02e1];return _0x429d62;}import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x1245d3,_0x5406c0=_0x1e5e89(0x1e8),_0x5b1915){const _0x15299d=_0x1e5e89,_0x134acf={'hgyqo':_0x15299d(0x1ee),'BFOoH':'gpt-4o'},_0x36a313=_0x5b1915??('claude'===_0x5406c0?_0x134acf[_0x15299d(0x1ef)]:_0x134acf['BFOoH']),_0x397e73=createTokenProvider(_0x5406c0,_0x36a313),_0x27c7dc=_0x1245d3['split'](/\s+/)['filter'](Boolean)['length'];return{'tokens':_0x397e73[_0x15299d(0x1e2)](_0x1245d3),'estimate':_0x397e73[_0x15299d(0x1e4)](_0x1245d3),'provider':_0x5406c0,'model':_0x36a313,'chars':_0x1245d3['length'],'words':_0x27c7dc};}export function analyzeFile(_0x51c891,_0x3c941e='claude',_0x316f1d){const _0x7164dd=_0x1e5e89,_0x2331af={'tAwrJ':function(_0x33278d,_0x241040,_0x3c661e,_0x55f65b){return _0x33278d(_0x241040,_0x3c661e,_0x55f65b);},'iQwUG':function(_0x275a3e,_0x39cbb0,_0x37e117){return _0x275a3e(_0x39cbb0,_0x37e117);},'HvUHd':'utf-8'};return _0x2331af['tAwrJ'](analyzeText,_0x2331af[_0x7164dd(0x1e5)](readFileSync,_0x51c891,_0x2331af['HvUHd']),_0x3c941e,_0x316f1d);}export function compareProviders(_0x3a6c6c){const _0x378900=_0x1e5e89,_0x318ff3={'RHyvI':function(_0x52673b,_0x2034b8,_0x5c094a){return _0x52673b(_0x2034b8,_0x5c094a);}};return{'claude':analyzeText(_0x3a6c6c,_0x378900(0x1e8)),'openai':_0x318ff3[_0x378900(0x1f0)](analyzeText,_0x3a6c6c,'openai')};}
1
+ (function(_0x562260,_0x4d9814){const _0x5bba74=_0x1e58,_0x4e5d6b=_0x562260();while(!![]){try{const _0x14209f=parseInt(_0x5bba74(0x17a))/0x1+parseInt(_0x5bba74(0x170))/0x2+-parseInt(_0x5bba74(0x172))/0x3*(parseInt(_0x5bba74(0x17d))/0x4)+-parseInt(_0x5bba74(0x175))/0x5*(parseInt(_0x5bba74(0x17b))/0x6)+-parseInt(_0x5bba74(0x171))/0x7+parseInt(_0x5bba74(0x16d))/0x8*(-parseInt(_0x5bba74(0x17f))/0x9)+parseInt(_0x5bba74(0x16f))/0xa*(parseInt(_0x5bba74(0x177))/0xb);if(_0x14209f===_0x4d9814)break;else _0x4e5d6b['push'](_0x4e5d6b['shift']());}catch(_0x16dbc6){_0x4e5d6b['push'](_0x4e5d6b['shift']());}}}(_0x202f,0xb5dd7));import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';function _0x1e58(_0x11c1ba,_0x2a19e1){_0x11c1ba=_0x11c1ba-0x16d;const _0x202f85=_0x202f();let _0x1e5885=_0x202f85[_0x11c1ba];return _0x1e5885;}export function analyzeText(_0x3c6af5,_0x2ba939='claude',_0x3babe1){const _0x43a230=_0x1e58,_0x53d6f4={'dCNwJ':function(_0x3b07b2,_0x13f0c8){return _0x3b07b2===_0x13f0c8;},'ubeIK':'claude','Qiiqa':'gpt-4o'},_0x316bf8=_0x3babe1??(_0x53d6f4[_0x43a230(0x17e)](_0x53d6f4['ubeIK'],_0x2ba939)?_0x43a230(0x176):_0x53d6f4['Qiiqa']),_0x4a7037=createTokenProvider(_0x2ba939,_0x316bf8),_0x4df2dc=_0x3c6af5[_0x43a230(0x178)](/\s+/)[_0x43a230(0x16e)](Boolean)['length'];return{'tokens':_0x4a7037[_0x43a230(0x179)](_0x3c6af5),'estimate':_0x4a7037['estimateTokens'](_0x3c6af5),'provider':_0x2ba939,'model':_0x316bf8,'chars':_0x3c6af5[_0x43a230(0x17c)],'words':_0x4df2dc};}export function analyzeFile(_0x54f478,_0x290310='claude',_0x1ab022){const _0x521a2a=_0x1e58,_0x65974d={'PTYSO':function(_0x175f9b,_0x12b0af,_0x3dd67e){return _0x175f9b(_0x12b0af,_0x3dd67e);}};return analyzeText(_0x65974d[_0x521a2a(0x174)](readFileSync,_0x54f478,'utf-8'),_0x290310,_0x1ab022);}export function compareProviders(_0x8bd991){const _0x6f21ef=_0x1e58,_0x1dc136={'KtNaN':'claude','wcxCh':'openai'};return{'claude':analyzeText(_0x8bd991,_0x1dc136[_0x6f21ef(0x173)]),'openai':analyzeText(_0x8bd991,_0x1dc136['wcxCh'])};}function _0x202f(){const _0x121c90=['14619530PncXcE','2910852NFtIwZ','8163498LrLtcR','1457997BDgZgp','KtNaN','PTYSO','95240hlTasQ','claude-sonnet-4-20250514','22YMdVPR','split','countTokens','354527gjxTlB','318aKKeLQ','length','8WEXbhl','dCNwJ','3492FXsXCc','17344CDEkbr','filter'];_0x202f=function(){return _0x121c90;};return _0x202f();}
@@ -1 +1 @@
1
- (function(_0x2b3729,_0x46de46){const _0x5d531c=_0x427e,_0x35d3e2=_0x2b3729();while(!![]){try{const _0x133b1a=parseInt(_0x5d531c(0x195))/0x1*(parseInt(_0x5d531c(0x196))/0x2)+-parseInt(_0x5d531c(0x1a0))/0x3+-parseInt(_0x5d531c(0x193))/0x4*(parseInt(_0x5d531c(0x199))/0x5)+-parseInt(_0x5d531c(0x19b))/0x6*(parseInt(_0x5d531c(0x197))/0x7)+parseInt(_0x5d531c(0x198))/0x8*(parseInt(_0x5d531c(0x19a))/0x9)+parseInt(_0x5d531c(0x1a1))/0xa+parseInt(_0x5d531c(0x19f))/0xb;if(_0x133b1a===_0x46de46)break;else _0x35d3e2['push'](_0x35d3e2['shift']());}catch(_0x3a87cf){_0x35d3e2['push'](_0x35d3e2['shift']());}}}(_0x538d,0x56fae));function _0x427e(_0x56c870,_0x4a25d8){_0x56c870=_0x56c870-0x193;const _0x538d1f=_0x538d();let _0x427e86=_0x538d1f[_0x56c870];return _0x427e86;}function _0x538d(){const _0x57aa19=['445104rGkvfa','2208100oPiGvo','100ONUEbW','provider','1UsrrrO','814142URQllj','1216621yOVSLS','8CFGeEI','74150jEJlYd','5826213Lpzvwp','24BlyGwQ','DMarA','length','rules','3248982KbfTiU'];_0x538d=function(){return _0x57aa19;};return _0x538d();}import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x5651b1){const _0x4c5ce3=_0x427e,_0x36f1d9={'DMarA':function(_0x3fa037,_0x531ba5){return _0x3fa037(_0x531ba5);}};try{const _0xf1c313=_0x36f1d9[_0x4c5ce3(0x19c)](parseConfig,_0x5651b1);return{'valid':!0x0,'provider':_0xf1c313[_0x4c5ce3(0x194)],'model':_0xf1c313['model'],'ruleCount':_0xf1c313[_0x4c5ce3(0x19e)][_0x4c5ce3(0x19d)]};}catch(_0xdbf8c4){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0xdbf8c4['message']};}}
1
+ function _0x3255(){const _0x1ade26=['310DwjRwe','22040RNyeon','235964QcfEsI','30445wBpwVi','20QcaURY','20744119nwDhxa','1540695puVpTd','139113XSdSuE','4375638IrVFNT','25oRddDI','rules','1463vubmRb','model'];_0x3255=function(){return _0x1ade26;};return _0x3255();}(function(_0xf7d79,_0x1a91ff){const _0x1de630=_0x5dee,_0x1e57a6=_0xf7d79();while(!![]){try{const _0x500e70=-parseInt(_0x1de630(0x11d))/0x1*(-parseInt(_0x1de630(0x11e))/0x2)+parseInt(_0x1de630(0x120))/0x3+-parseInt(_0x1de630(0x11c))/0x4*(parseInt(_0x1de630(0x116))/0x5)+parseInt(_0x1de630(0x115))/0x6+parseInt(_0x1de630(0x118))/0x7*(parseInt(_0x1de630(0x11b))/0x8)+-parseInt(_0x1de630(0x121))/0x9*(-parseInt(_0x1de630(0x11a))/0xa)+-parseInt(_0x1de630(0x11f))/0xb;if(_0x500e70===_0x1a91ff)break;else _0x1e57a6['push'](_0x1e57a6['shift']());}catch(_0x25801c){_0x1e57a6['push'](_0x1e57a6['shift']());}}}(_0x3255,0x66e5a));import'../shared/providers/claude-provider.js';function _0x5dee(_0xa762e7,_0x25df70){_0xa762e7=_0xa762e7-0x115;const _0x32554e=_0x3255();let _0x5dee81=_0x32554e[_0xa762e7];return _0x5dee81;}import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x13e3fc){const _0x3d8bfd=_0x5dee,_0x2ce54f={'XYLVw':function(_0x28f5d2,_0x1aff91){return _0x28f5d2(_0x1aff91);}};try{const _0x41137c=_0x2ce54f['XYLVw'](parseConfig,_0x13e3fc);return{'valid':!0x0,'provider':_0x41137c['provider'],'model':_0x41137c[_0x3d8bfd(0x119)],'ruleCount':_0x41137c[_0x3d8bfd(0x117)]['length']};}catch(_0x3b39af){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x3b39af['message']};}}
package/dist/cli/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function _0x5f0c(_0x536231,_0xca5791){_0x536231=_0x536231-0x1d8;const _0x2c6de3=_0x2c6d();let _0x5f0c33=_0x2c6de3[_0x536231];return _0x5f0c33;}const _0x8e7224=_0x5f0c;(function(_0x1ab4ba,_0x2f7596){const _0x44f822=_0x5f0c,_0x10e2bf=_0x1ab4ba();while(!![]){try{const _0x5e0634=parseInt(_0x44f822(0x1e3))/0x1*(parseInt(_0x44f822(0x1fb))/0x2)+parseInt(_0x44f822(0x222))/0x3+parseInt(_0x44f822(0x215))/0x4+-parseInt(_0x44f822(0x20f))/0x5*(-parseInt(_0x44f822(0x1ec))/0x6)+-parseInt(_0x44f822(0x218))/0x7*(-parseInt(_0x44f822(0x21e))/0x8)+parseInt(_0x44f822(0x20d))/0x9*(-parseInt(_0x44f822(0x203))/0xa)+-parseInt(_0x44f822(0x1f2))/0xb*(parseInt(_0x44f822(0x1e2))/0xc);if(_0x5e0634===_0x2f7596)break;else _0x10e2bf['push'](_0x10e2bf['shift']());}catch(_0x344a25){_0x10e2bf['push'](_0x10e2bf['shift']());}}}(_0x2c6d,0x8e2d2));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';function _0x2c6d(){const _0x44c912=['-p,\x20--provider\x20<provider>','1377492pprZOH','UKUVz','SacqU','122787SdgCjK','BPE\x20tokenizer\x20(accurate)','name','argument','description','Create\x20a\x20starter\x20tokenizer-speedup.yaml\x20in\x20the\x20current\x20directory','528bNLdPg','RMXGr','srKMM','MTrpo','1316931zJIpVX','DZQyR','-m,\x20--model\x20<model>','word\x20heuristic\x20(words\x20×\x20','TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI','text','xGZMH','JOUJW','message','claude','1.3','24JnYsiv','34205yTXqMV','[file]','URXSH','estimateTokens','apiKey','1.4','K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.','Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text','YuGcE','18iHkakv','setup','tokenizer-speedup.yaml','requiredOption','addHelpText','parse','8085902bffiVh','GCcCQ','command','provider','action','\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\x20to\x20analyze','utf-8','rules','2AxCGwY','ogKGn','init','stringify','model','cli/index','SRIou','after','25910lIvlfD','mVrFy','EBvUj','LLM\x20provider\x20(claude,\x20openai)','exitCode','countTokens','xwaBx','-t,\x20--text\x20<text>','config','error','2547Hzglud','../plugin/config-loader.js','1350850OtokRO','HSLwd','option','includes','length'];_0x2c6d=function(){return _0x44c912;};return _0x2c6d();}import{runInit}from'./init-cmd.js';export function buildCLI(){const _0x526f59=_0x5f0c,_0x2360e6={'SRIou':function(_0x4455d5,_0x447ee0){return _0x4455d5(_0x447ee0);},'MTrpo':'claude-sonnet-4-20250514','UKUVz':function(_0x484c6c,_0x2d567a,_0x11e85e){return _0x484c6c(_0x2d567a,_0x11e85e);},'GEpfA':'Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','EBvUj':_0x526f59(0x1f9),'TivLl':function(_0x48b4a4,_0x55df11){return _0x48b4a4/_0x55df11;},'xwaBx':function(_0xf96966,_0x59ee4e){return _0xf96966===_0x59ee4e;},'mVrFy':'openai','bVYDc':_0x526f59(0x1e8),'DZQyR':function(_0x2293ba,_0x7835cb,_0x10a879){return _0x2293ba(_0x7835cb,_0x10a879);},'YuGcE':'tsu','srKMM':_0x526f59(0x1ed),'URXSH':'Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','xWlGv':'--api-key\x20<key>','RMXGr':'Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)','HikKh':_0x526f59(0x1ea),'GCcCQ':_0x526f59(0x214),'uToBN':_0x526f59(0x206),'HSLwd':_0x526f59(0x1d9),'fTNwC':'Model\x20name','cZBYz':_0x526f59(0x20a),'ogKGn':_0x526f59(0x20b),'JOUJW':'Config\x20file\x20path','xGZMH':_0x526f59(0x1fd),'SacqU':_0x526f59(0x21d)},_0x778e09=new Command();return _0x778e09[_0x526f59(0x21a)](_0x2360e6[_0x526f59(0x1eb)])['description'](_0x526f59(0x1db))['version']('0.8.1')[_0x526f59(0x1f0)](_0x526f59(0x202),_0x526f59(0x1f7)),_0x778e09['command'](_0x2360e6[_0x526f59(0x220)])[_0x526f59(0x21c)](_0x2360e6[_0x526f59(0x1e5)])[_0x526f59(0x1ef)](_0x2360e6['xWlGv'],_0x2360e6[_0x526f59(0x21f)])['action'](_0x19c695=>{const _0xc8f993=_0x526f59;_0x2360e6['SRIou'](runSetup,_0x19c695[_0xc8f993(0x1e7)]);}),_0x778e09[_0x526f59(0x1f4)]('analyze')[_0x526f59(0x21c)](_0x2360e6['HikKh'])[_0x526f59(0x21b)](_0x526f59(0x1e4),_0x526f59(0x1f8))[_0x526f59(0x211)](_0x2360e6[_0x526f59(0x1f3)],_0x2360e6['uToBN'],_0x526f59(0x1e0))[_0x526f59(0x211)](_0x2360e6[_0x526f59(0x210)],_0x2360e6['fTNwC'])['option'](_0x2360e6['cZBYz'],'Analyze\x20inline\x20text\x20instead\x20of\x20file')[_0x526f59(0x1f6)]((_0x190d1c,_0x489e3e)=>{const _0x152a11=_0x526f59,_0x2d82f3=_0x489e3e[_0x152a11(0x1ff)]??(_0x152a11(0x1e0)===_0x489e3e['provider']?_0x2360e6[_0x152a11(0x221)]:'gpt-4o');let _0x43abe4,_0x150c5f;try{_0x43abe4=_0x2360e6['UKUVz'](createTokenProvider,_0x489e3e[_0x152a11(0x1f5)],_0x2d82f3);}catch(_0x3501c1){return console['error']('Error:\x20'+_0x3501c1[_0x152a11(0x1df)]),void(process['exitCode']=0x1);}if(void 0x0!==_0x489e3e['text'])_0x150c5f=_0x489e3e[_0x152a11(0x1dc)];else{if(!_0x190d1c)return console[_0x152a11(0x20c)](_0x2360e6['GEpfA']),void(process[_0x152a11(0x207)]=0x1);_0x150c5f=_0x2360e6[_0x152a11(0x216)](readFileSync,_0x190d1c,_0x2360e6[_0x152a11(0x205)]);}_0x150c5f[_0x152a11(0x213)]>0x7a120&&console[_0x152a11(0x20c)]('Warning:\x20large\x20input\x20('+_0x2360e6['TivLl'](_0x150c5f[_0x152a11(0x213)],0x3e8)['toFixed'](0x0)+_0x152a11(0x1e9));const _0x1054e4=_0x43abe4[_0x152a11(0x208)](_0x150c5f),_0x5d7dd8=_0x43abe4[_0x152a11(0x1e6)](_0x150c5f);console['log'](JSON['stringify']({'file':_0x190d1c??'(inline)','tokens':_0x1054e4,'tokens_method':_0x152a11(0x219),'estimate':_0x5d7dd8,'estimate_method':_0x152a11(0x1da)+(_0x2360e6[_0x152a11(0x209)](_0x2360e6[_0x152a11(0x204)],_0x489e3e[_0x152a11(0x1f5)])?_0x152a11(0x1e1):_0x2360e6['bVYDc'])+')','provider':_0x489e3e[_0x152a11(0x1f5)],'model':_0x2d82f3}));}),_0x778e09['command'](_0x2360e6[_0x526f59(0x1fc)])['description']('Validate\x20configuration\x20file')['argument']('[file]',_0x2360e6[_0x526f59(0x1de)],_0x526f59(0x1ee))[_0x526f59(0x1f6)](async _0x40d0d2=>{const _0x151ba1=_0x526f59;try{const _0x6f94ea=_0x2360e6[_0x151ba1(0x1d8)](readFileSync,_0x40d0d2,_0x2360e6[_0x151ba1(0x205)]),{parseConfig:_0x598101}=await import(_0x151ba1(0x20e)),_0x6b38c7=_0x2360e6[_0x151ba1(0x201)](_0x598101,_0x6f94ea);console['log'](JSON[_0x151ba1(0x1fe)]({'valid':!0x0,'provider':_0x6b38c7[_0x151ba1(0x1f5)],'model':_0x6b38c7['model'],'ruleCount':_0x6b38c7[_0x151ba1(0x1fa)]['length']}));}catch(_0x399e1f){console['log'](JSON['stringify']({'valid':!0x1,'error':_0x399e1f[_0x151ba1(0x1df)]})),process[_0x151ba1(0x207)]=0x1;}}),_0x778e09['command'](_0x2360e6[_0x526f59(0x1dd)])[_0x526f59(0x21c)](_0x2360e6[_0x526f59(0x217)])[_0x526f59(0x1f6)](()=>{runInit();}),_0x778e09;}const resolvedArgv1=((()=>{try{return realpathSync(process['argv'][0x1]??'')['replace'](/\\/g,'/');}catch{return process['argv'][0x1]?.['replace'](/\\/g,'/')??'';}})());resolvedArgv1[_0x8e7224(0x212)](_0x8e7224(0x200))&&buildCLI()[_0x8e7224(0x1f1)]();
2
+ const _0x2a6fb1=_0x58d8;(function(_0x53482e,_0x127909){const _0x2bd42a=_0x58d8,_0x192395=_0x53482e();while(!![]){try{const _0x174517=-parseInt(_0x2bd42a(0xad))/0x1+parseInt(_0x2bd42a(0xbe))/0x2+parseInt(_0x2bd42a(0xdd))/0x3*(-parseInt(_0x2bd42a(0xca))/0x4)+-parseInt(_0x2bd42a(0xde))/0x5*(parseInt(_0x2bd42a(0xd1))/0x6)+-parseInt(_0x2bd42a(0xd8))/0x7+parseInt(_0x2bd42a(0xc8))/0x8+parseInt(_0x2bd42a(0xdf))/0x9;if(_0x174517===_0x127909)break;else _0x192395['push'](_0x192395['shift']());}catch(_0x2a5353){_0x192395['push'](_0x192395['shift']());}}}(_0x443e,0x72062));function _0x443e(){const _0x295100=['version','tEYfz','toFixed','includes','replace','text','lkoln','HUQSu','addHelpText','Validate\x20configuration\x20file','LLM\x20provider\x20(claude,\x20openai)','Config\x20file\x20path','init','EEnPh','1804590RuwgJM','rules','UrXVb','TWoVe','requiredOption','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','claude-sonnet-4-20250514','[file]','Model\x20name','K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.','5114176dHiHEE','command','1015004qIQiNU','action','QpnBv','tokenizer-speedup.yaml','option','exitCode','error','1146poFElO','description','openai','1.3','estimateTokens','length','cli/index','5311607Wxjojd','word\x20heuristic\x20(words\x20×\x20','claude','wnycj','NEowY','3uIzuKd','7295ifOkeN','3915234otUOBC','Warning:\x20large\x20input\x20(','argument','-p,\x20--provider\x20<provider>','DMKGn','CdsEq','stringify','Analyze\x20inline\x20text\x20instead\x20of\x20file','argv','provider','rxnxs','setup','218330TGYhcq','gpt-4o','Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text'];_0x443e=function(){return _0x295100;};return _0x443e();}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 _0x187736=_0x58d8,_0x28b2ef={'UrXVb':function(_0x286747,_0x1b45dd){return _0x286747(_0x1b45dd);},'rxnxs':function(_0x5a1b89,_0x2aeb65){return _0x5a1b89===_0x2aeb65;},'NEowY':_0x187736(0xda),'avsmG':function(_0x1db6cf,_0x50347d,_0x14ad67){return _0x1db6cf(_0x50347d,_0x14ad67);},'hbdHe':'utf-8','CMKir':function(_0x12effd,_0x1502c4){return _0x12effd>_0x1502c4;},'EEnPh':'tsu','HUQSu':'after','tEYfz':_0x187736(0xac),'DMKGn':_0x187736(0xaf),'TWoVe':_0x187736(0xc5),'qQrWH':_0x187736(0xba),'CdsEq':'-m,\x20--model\x20<model>','QpnBv':'-t,\x20--text\x20<text>','MyFuL':_0x187736(0xe6),'lkoln':_0x187736(0xb9),'SlkID':_0x187736(0xbc)},_0x6a5a40=new Command();return _0x6a5a40['name'](_0x28b2ef[_0x187736(0xbd)])[_0x187736(0xd2)]('TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI')[_0x187736(0xb0)]('0.8.1')[_0x187736(0xb8)](_0x28b2ef[_0x187736(0xb7)],'\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'),_0x6a5a40['command'](_0x28b2ef[_0x187736(0xb1)])['description'](_0x187736(0xc3))[_0x187736(0xc2)]('--api-key\x20<key>','Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)')['action'](_0x4c9af3=>{const _0x47c354=_0x187736;_0x28b2ef[_0x47c354(0xc0)](runSetup,_0x4c9af3['apiKey']);}),_0x6a5a40['command']('analyze')[_0x187736(0xd2)](_0x28b2ef[_0x187736(0xe3)])[_0x187736(0xe1)](_0x28b2ef['TWoVe'],'File\x20to\x20analyze')[_0x187736(0xce)](_0x187736(0xe2),_0x28b2ef['qQrWH'],_0x28b2ef[_0x187736(0xdc)])['option'](_0x28b2ef[_0x187736(0xe4)],_0x187736(0xc6))['option'](_0x28b2ef[_0x187736(0xcc)],_0x28b2ef['MyFuL'])[_0x187736(0xcb)]((_0x3efe4a,_0x1f9774)=>{const _0x41492d=_0x187736,_0x50c6e1=_0x1f9774['model']??(_0x28b2ef[_0x41492d(0xab)](_0x28b2ef[_0x41492d(0xdc)],_0x1f9774['provider'])?_0x41492d(0xc4):_0x41492d(0xae));let _0xb29f8,_0x5e426d;try{_0xb29f8=createTokenProvider(_0x1f9774[_0x41492d(0xe8)],_0x50c6e1);}catch(_0x42bfb6){return console[_0x41492d(0xd0)]('Error:\x20'+_0x42bfb6['message']),void(process[_0x41492d(0xcf)]=0x1);}if(void 0x0!==_0x1f9774[_0x41492d(0xb5)])_0x5e426d=_0x1f9774[_0x41492d(0xb5)];else{if(!_0x3efe4a)return console['error']('Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option'),void(process[_0x41492d(0xcf)]=0x1);_0x5e426d=_0x28b2ef['avsmG'](readFileSync,_0x3efe4a,_0x28b2ef['hbdHe']);}_0x28b2ef['CMKir'](_0x5e426d['length'],0x7a120)&&console[_0x41492d(0xd0)](_0x41492d(0xe0)+(_0x5e426d[_0x41492d(0xd6)]/0x3e8)[_0x41492d(0xb2)](0x0)+_0x41492d(0xc7));const _0x4a3038=_0xb29f8['countTokens'](_0x5e426d),_0x24ae31=_0xb29f8[_0x41492d(0xd5)](_0x5e426d);console['log'](JSON[_0x41492d(0xe5)]({'file':_0x3efe4a??'(inline)','tokens':_0x4a3038,'tokens_method':'BPE\x20tokenizer\x20(accurate)','estimate':_0x24ae31,'estimate_method':_0x41492d(0xd9)+(_0x28b2ef['rxnxs'](_0x41492d(0xd3),_0x1f9774['provider'])?_0x41492d(0xd4):'1.4')+')','provider':_0x1f9774[_0x41492d(0xe8)],'model':_0x50c6e1}));}),_0x6a5a40[_0x187736(0xc9)]('config')[_0x187736(0xd2)](_0x28b2ef[_0x187736(0xb6)])['argument'](_0x28b2ef[_0x187736(0xc1)],_0x187736(0xbb),_0x187736(0xcd))['action'](async _0x5b6836=>{const _0x564f5f=_0x187736;try{const _0x50adb8=readFileSync(_0x5b6836,_0x28b2ef['hbdHe']),{parseConfig:_0x4aff99}=await import('../plugin/config-loader.js'),_0x44a882=_0x28b2ef['UrXVb'](_0x4aff99,_0x50adb8);console['log'](JSON[_0x564f5f(0xe5)]({'valid':!0x0,'provider':_0x44a882[_0x564f5f(0xe8)],'model':_0x44a882['model'],'ruleCount':_0x44a882[_0x564f5f(0xbf)][_0x564f5f(0xd6)]}));}catch(_0x5815ff){console['log'](JSON['stringify']({'valid':!0x1,'error':_0x5815ff['message']})),process[_0x564f5f(0xcf)]=0x1;}}),_0x6a5a40['command'](_0x28b2ef['SlkID'])['description']('Create\x20a\x20starter\x20tokenizer-speedup.yaml\x20in\x20the\x20current\x20directory')['action'](()=>{runInit();}),_0x6a5a40;}const resolvedArgv1=((()=>{const _0x40f49b=_0x58d8,_0x36d5d7={'wnycj':function(_0x1dfd2e,_0x315da7){return _0x1dfd2e(_0x315da7);}};try{return _0x36d5d7[_0x40f49b(0xdb)](realpathSync,process[_0x40f49b(0xe7)][0x1]??'')[_0x40f49b(0xb4)](/\\/g,'/');}catch{return process[_0x40f49b(0xe7)][0x1]?.['replace'](/\\/g,'/')??'';}})());function _0x58d8(_0x5c97ae,_0x2b3847){_0x5c97ae=_0x5c97ae-0xab;const _0x443ede=_0x443e();let _0x58d81e=_0x443ede[_0x5c97ae];return _0x58d81e;}resolvedArgv1[_0x2a6fb1(0xb3)](_0x2a6fb1(0xd7))&&buildCLI()['parse']();
@@ -1 +1 @@
1
- (function(_0x4fa992,_0x1e46d5){const _0x5eaf42=_0x19fe,_0x54b44b=_0x4fa992();while(!![]){try{const _0x4a631d=parseInt(_0x5eaf42(0x147))/0x1*(-parseInt(_0x5eaf42(0x144))/0x2)+parseInt(_0x5eaf42(0x154))/0x3+-parseInt(_0x5eaf42(0x14d))/0x4+parseInt(_0x5eaf42(0x14c))/0x5*(parseInt(_0x5eaf42(0x152))/0x6)+-parseInt(_0x5eaf42(0x14f))/0x7*(parseInt(_0x5eaf42(0x145))/0x8)+-parseInt(_0x5eaf42(0x148))/0x9+parseInt(_0x5eaf42(0x155))/0xa;if(_0x4a631d===_0x1e46d5)break;else _0x54b44b['push'](_0x54b44b['shift']());}catch(_0x1681af){_0x54b44b['push'](_0x54b44b['shift']());}}}(_0x360b,0x42ca9));import{writeFileSync,existsSync}from'node:fs';import{join}from'node:path';function _0x19fe(_0x34865c,_0x1d5930){_0x34865c=_0x34865c-0x143;const _0x360b39=_0x360b();let _0x19fe45=_0x360b39[_0x34865c];return _0x19fe45;}function _0x360b(){const _0x5cfa2f=['Created\x20tokenizer-speedup.yaml','6yLSkWj','lUFPc','223338rZubAR','14336030rIZoOB','\x20\x202.\x20Run:\x20tsu\x20config\x20tokenizer-speedup.yaml\x20\x20(to\x20validate)','log','Next\x20steps:','2mJhxbo','3383536zIyBmu','MgyCB','339743yPCdTW','117414uoiSJP','cwd','NHgpz','uAKzK','257760oZzEeh','2041172EUJUgr','utf-8','7WShykl','tokenizer-speedup.yaml\x20already\x20exists\x20in\x20this\x20directory.'];_0x360b=function(){return _0x5cfa2f;};return _0x360b();}const STARTER_CONFIG='#\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';export function runInit(){const _0x59c43a=_0x19fe,_0x3f691b={'lUFPc':function(_0x4e6601,_0x10f78c,_0x7e6346){return _0x4e6601(_0x10f78c,_0x7e6346);},'NHgpz':'tokenizer-speedup.yaml','MgyCB':function(_0x307b3a,_0x3fff70){return _0x307b3a(_0x3fff70);},'kRvQv':_0x59c43a(0x14e),'uAKzK':_0x59c43a(0x151),'vOZnk':'\x20\x201.\x20Edit\x20the\x20rules\x20to\x20match\x20your\x20project\x20structure','oonRf':'\x20\x203.\x20Restart\x20Claude\x20Code\x20to\x20pick\x20up\x20the\x20new\x20config'},_0x1ba1d1=_0x3f691b[_0x59c43a(0x153)](join,process[_0x59c43a(0x149)](),_0x3f691b[_0x59c43a(0x14a)]);if(_0x3f691b[_0x59c43a(0x146)](existsSync,_0x1ba1d1))return console['error'](_0x59c43a(0x150)),void(process['exitCode']=0x1);writeFileSync(_0x1ba1d1,STARTER_CONFIG,_0x3f691b['kRvQv']),console['log'](_0x3f691b[_0x59c43a(0x14b)]),console['log'](''),console[_0x59c43a(0x157)](_0x59c43a(0x143)),console['log'](_0x3f691b['vOZnk']),console[_0x59c43a(0x157)](_0x59c43a(0x156)),console['log'](_0x3f691b['oonRf']);}
1
+ const _0xf6a0fd=_0x174a;(function(_0x389c21,_0x34d0ee){const _0x4e38d4=_0x174a,_0x356092=_0x389c21();while(!![]){try{const _0x5cd9b9=-parseInt(_0x4e38d4(0xea))/0x1*(parseInt(_0x4e38d4(0xed))/0x2)+-parseInt(_0x4e38d4(0xdd))/0x3*(-parseInt(_0x4e38d4(0xdf))/0x4)+-parseInt(_0x4e38d4(0xef))/0x5*(parseInt(_0x4e38d4(0xe5))/0x6)+parseInt(_0x4e38d4(0xe1))/0x7+-parseInt(_0x4e38d4(0xe4))/0x8+parseInt(_0x4e38d4(0xe6))/0x9+parseInt(_0x4e38d4(0xe8))/0xa*(parseInt(_0x4e38d4(0xee))/0xb);if(_0x5cd9b9===_0x34d0ee)break;else _0x356092['push'](_0x356092['shift']());}catch(_0x481425){_0x356092['push'](_0x356092['shift']());}}}(_0x3c72,0x202b9));function _0x174a(_0x14278f,_0x3e3f15){_0x14278f=_0x14278f-0xdd;const _0x3c7214=_0x3c72();let _0x174aef=_0x3c7214[_0x14278f];return _0x174aef;}import{writeFileSync,existsSync}from'node:fs';import{join}from'node:path';function _0x3c72(){const _0x203def=['iWQTC','21170QVDQxK','1133YTsiRS','313265QTEXhq','\x20\x203.\x20Restart\x20Claude\x20Code\x20to\x20pick\x20up\x20the\x20new\x20config','12783nOZsDZ','rSPGf','196ImPgUW','error','1500632navfFo','CWctr','tokenizer-speedup.yaml\x20already\x20exists\x20in\x20this\x20directory.','2096560gqdZsi','18PpMGBe','46098wudyqi','#\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','21070ToLbFl','\x20\x201.\x20Edit\x20the\x20rules\x20to\x20match\x20your\x20project\x20structure','6RFnVOA','log'];_0x3c72=function(){return _0x203def;};return _0x3c72();}const STARTER_CONFIG=_0xf6a0fd(0xe7);export function runInit(){const _0xb8d16b=_0xf6a0fd,_0x4be0a8={'CWctr':function(_0x5db7a0,_0x30e74a,_0xafd05){return _0x5db7a0(_0x30e74a,_0xafd05);},'jytTU':function(_0x359191,_0x22824e){return _0x359191(_0x22824e);},'rSPGf':_0xb8d16b(0xe3),'iWQTC':'Created\x20tokenizer-speedup.yaml','rcEtJ':_0xb8d16b(0xf0)},_0x17ea4a=_0x4be0a8[_0xb8d16b(0xe2)](join,process['cwd'](),'tokenizer-speedup.yaml');if(_0x4be0a8['jytTU'](existsSync,_0x17ea4a))return console[_0xb8d16b(0xe0)](_0x4be0a8[_0xb8d16b(0xde)]),void(process['exitCode']=0x1);writeFileSync(_0x17ea4a,STARTER_CONFIG,'utf-8'),console[_0xb8d16b(0xeb)](_0x4be0a8[_0xb8d16b(0xec)]),console['log'](''),console['log']('Next\x20steps:'),console['log'](_0xb8d16b(0xe9)),console['log']('\x20\x202.\x20Run:\x20tsu\x20config\x20tokenizer-speedup.yaml\x20\x20(to\x20validate)'),console['log'](_0x4be0a8['rcEtJ']);}
@@ -1 +1 @@
1
- function _0x4fb2(_0x2cb7b1,_0x3ba502){_0x2cb7b1=_0x2cb7b1-0x1b2;const _0x22e66a=_0x22e6();let _0x4fb278=_0x22e66a[_0x2cb7b1];return _0x4fb278;}const _0x30654e=_0x4fb2;(function(_0x49a506,_0x1ad7ae){const _0x24046d=_0x4fb2,_0x1f58dc=_0x49a506();while(!![]){try{const _0x28c26a=parseInt(_0x24046d(0x1b7))/0x1+parseInt(_0x24046d(0x1c5))/0x2*(-parseInt(_0x24046d(0x1ce))/0x3)+-parseInt(_0x24046d(0x1c4))/0x4+-parseInt(_0x24046d(0x1c1))/0x5*(-parseInt(_0x24046d(0x1cb))/0x6)+-parseInt(_0x24046d(0x1c9))/0x7*(-parseInt(_0x24046d(0x1c0))/0x8)+-parseInt(_0x24046d(0x1d6))/0x9+parseInt(_0x24046d(0x1c8))/0xa*(parseInt(_0x24046d(0x1ba))/0xb);if(_0x28c26a===_0x1ad7ae)break;else _0x1f58dc['push'](_0x1f58dc['shift']());}catch(_0x2a846e){_0x1f58dc['push'](_0x1f58dc['shift']());}}}(_0x22e6,0x842e3));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),_0x30654e(0x1bb),_0x30654e(0x1cc)),CONFIG_FILE=join(CONFIG_DIR,'config.json'),CLAUDE_SETTINGS_FILE=join(homedir(),_0x30654e(0x1c2),_0x30654e(0x1be));export function runSetup(_0xf90af7){const _0x22f068=_0x30654e,_0x4008b1={'cZDNz':'❌\x20API\x20key\x20cannot\x20be\x20empty.','FHQMq':function(_0x4f71a7,_0x583c97){return _0x4f71a7<_0x583c97;},'KYgBE':function(_0x71432,_0x3a3ba4){return _0x71432(_0x3a3ba4);},'WGAre':'✅\x20API\x20key\x20saved\x20successfully.','vbZxH':function(_0x116393){return _0x116393();},'TDeIw':_0x22f068(0x1cd)};try{if(!_0xf90af7||0x0===_0xf90af7[_0x22f068(0x1d3)]()['length'])return console['error'](_0x4008b1[_0x22f068(0x1c6)]),void(process['exitCode']=0x1);if(_0x4008b1['FHQMq'](_0xf90af7[_0x22f068(0x1d3)]()['length'],0x8))return console[_0x22f068(0x1b9)]('❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).'),void(process[_0x22f068(0x1bf)]=0x1);_0x4008b1[_0x22f068(0x1d5)](saveApiKey,_0xf90af7[_0x22f068(0x1d3)]()),console[_0x22f068(0x1d2)](_0x4008b1[_0x22f068(0x1d0)]),console['log']('⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.'),_0x4008b1[_0x22f068(0x1b3)](registerHooks),console['log'](_0x22f068(0x1d7)),console['log'](''),console[_0x22f068(0x1d2)](_0x4008b1['TDeIw']);}catch(_0x151b4b){console[_0x22f068(0x1b9)]('❌\x20Setup\x20failed:\x20'+_0x151b4b['message']),process[_0x22f068(0x1bf)]=0x1;}}function saveApiKey(_0x55c837){const _0xaa5dbc=_0x30654e,_0x22c929={'ebVgX':function(_0xf93d0b,_0x4e3da2,_0x3cf792){return _0xf93d0b(_0x4e3da2,_0x3cf792);},'cOKMg':'utf-8'};_0x22c929['ebVgX'](mkdirSync,CONFIG_DIR,{'recursive':!0x0});let _0x3e1b87={};try{_0x3e1b87=JSON['parse'](readFileSync(CONFIG_FILE,_0x22c929['cOKMg']));}catch{}_0x3e1b87[_0xaa5dbc(0x1d4)]=_0x55c837,writeFileSync(CONFIG_FILE,JSON['stringify'](_0x3e1b87,null,0x2)+'\x0a',_0x22c929['cOKMg']);}function registerHooks(){const _0x2bbf54=_0x30654e,_0x162ec1={'mrLtz':function(_0x82b4bc,_0x349890,_0x4fdcbe){return _0x82b4bc(_0x349890,_0x4fdcbe);},'kwgZb':function(_0x5bc0da){return _0x5bc0da();},'EFbAU':function(_0x1e5443,_0x260762,_0x513676){return _0x1e5443(_0x260762,_0x513676);},'umyCI':'startup|resume|clear|compact','KLfKX':_0x2bbf54(0x1c7),'WEuNW':_0x2bbf54(0x1cc)};mkdirSync(_0x162ec1['mrLtz'](join,_0x162ec1[_0x2bbf54(0x1c3)](homedir),'.claude'),{'recursive':!0x0});let _0x1bc9c1={};try{_0x1bc9c1=JSON['parse'](_0x162ec1[_0x2bbf54(0x1b8)](readFileSync,CLAUDE_SETTINGS_FILE,_0x2bbf54(0x1d1)));}catch{}const _0x450f76=_0x1bc9c1['hooks']??{};_0x450f76[_0x2bbf54(0x1cf)]=[{'matcher':_0x162ec1[_0x2bbf54(0x1b4)],'hooks':[{'type':_0x162ec1['KLfKX'],'command':'tokenizer-speedup','timeout':0x5}]}],_0x450f76[_0x2bbf54(0x1bd)]=[{'matcher':'','hooks':[{'type':_0x162ec1['KLfKX'],'command':_0x162ec1['WEuNW']}]}],_0x450f76['PreCompact']=[{'matcher':'','hooks':[{'type':_0x162ec1['KLfKX'],'command':_0x162ec1[_0x2bbf54(0x1b5)],'timeout':0xa}]}],_0x450f76[_0x2bbf54(0x1b6)]=[{'matcher':'','hooks':[{'type':_0x2bbf54(0x1c7),'command':'tokenizer-speedup','timeout':0xa}]}],_0x1bc9c1[_0x2bbf54(0x1ca)]=_0x450f76,writeFileSync(CLAUDE_SETTINGS_FILE,JSON['stringify'](_0x1bc9c1,null,0x2)+'\x0a','utf-8');}export function loadApiKeyFromConfig(){const _0x2c800a=_0x30654e,_0x19cb56={'KAakh':function(_0x21816b,_0xd33f1a,_0xa5c32b){return _0x21816b(_0xd33f1a,_0xa5c32b);}};try{return JSON[_0x2c800a(0x1b2)](_0x19cb56[_0x2c800a(0x1bc)](readFileSync,CONFIG_FILE,'utf-8'))[_0x2c800a(0x1d4)]??void 0x0;}catch{return;}}function _0x22e6(){const _0x199bdf=['settings.local.json','exitCode','40eGdJKD','55jOgsMI','.claude','kwgZb','3193280dntkAg','526XYXPQT','cZDNz','command','2410ZefFre','489251LPibGf','hooks','489486TVTXrP','tokenizer-speedup','Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.','12066KFOEcP','SessionStart','WGAre','utf-8','log','trim','apiKey','KYgBE','759231jKOeCL','✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.','parse','vbZxH','umyCI','WEuNW','Stop','1080057QQattz','EFbAU','error','7073sLnUQO','.config','KAakh','UserPromptSubmit'];_0x22e6=function(){return _0x199bdf;};return _0x22e6();}
1
+ function _0x4c78(){const _0x5dd71d=['tokenizer-speedup','1469vLbenq','stringify','BqLuv','2LxvuMC','Stop','DyeAW','.config','utf-8','LUXlb','hooks','.claude','730966cRhPOd','uakSl','nDcMj','CYxPf','3280968letpRO','✅\x20API\x20key\x20saved\x20successfully.','EBoUu','log','exitCode','101300vjJmAg','20UFqEHj','error','biHCr','length','9333093XuLvXs','253068ZoVJju','10hjZUzM','parse','EYBuB','3191508fWyBFN','21qYjrZh','1431618fSyEbo','159Ulcgwd','trim'];_0x4c78=function(){return _0x5dd71d;};return _0x4c78();}const _0x354a3f=_0x4842;function _0x4842(_0xf6ffe,_0xdd565c){_0xf6ffe=_0xf6ffe-0x15d;const _0x4c781d=_0x4c78();let _0x4842d5=_0x4c781d[_0xf6ffe];return _0x4842d5;}(function(_0x42bd08,_0x54e344){const _0x5ccf2f=_0x4842,_0x3ac89d=_0x42bd08();while(!![]){try{const _0x431b9b=-parseInt(_0x5ccf2f(0x16d))/0x1*(parseInt(_0x5ccf2f(0x165))/0x2)+parseInt(_0x5ccf2f(0x15f))/0x3*(parseInt(_0x5ccf2f(0x176))/0x4)+-parseInt(_0x5ccf2f(0x177))/0x5*(-parseInt(_0x5ccf2f(0x15e))/0x6)+-parseInt(_0x5ccf2f(0x15d))/0x7*(-parseInt(_0x5ccf2f(0x171))/0x8)+-parseInt(_0x5ccf2f(0x180))/0x9+parseInt(_0x5ccf2f(0x17d))/0xa*(parseInt(_0x5ccf2f(0x17b))/0xb)+-parseInt(_0x5ccf2f(0x17c))/0xc*(parseInt(_0x5ccf2f(0x162))/0xd);if(_0x431b9b===_0x54e344)break;else _0x3ac89d['push'](_0x3ac89d['shift']());}catch(_0x48e63d){_0x3ac89d['push'](_0x3ac89d['shift']());}}}(_0x4c78,0xdd64c));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),_0x354a3f(0x168),'tokenizer-speedup'),CONFIG_FILE=join(CONFIG_DIR,'config.json'),CLAUDE_SETTINGS_FILE=join(homedir(),_0x354a3f(0x16c),'settings.local.json');export function runSetup(_0x56d5bd){const _0x1fb069=_0x354a3f,_0x3b4a2e={'cqfPT':function(_0x1da860,_0x29f22f){return _0x1da860===_0x29f22f;},'biHCr':'❌\x20API\x20key\x20cannot\x20be\x20empty.','fsZhW':'❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).','RWsyL':function(_0x34e345,_0x1e154e){return _0x34e345(_0x1e154e);},'LUXlb':'⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','EYBuB':function(_0x21e41f){return _0x21e41f();}};try{if(!_0x56d5bd||_0x3b4a2e['cqfPT'](0x0,_0x56d5bd[_0x1fb069(0x160)]()[_0x1fb069(0x17a)]))return console[_0x1fb069(0x178)](_0x3b4a2e[_0x1fb069(0x179)]),void(process['exitCode']=0x1);if(_0x56d5bd['trim']()[_0x1fb069(0x17a)]<0x8)return console[_0x1fb069(0x178)](_0x3b4a2e['fsZhW']),void(process['exitCode']=0x1);_0x3b4a2e['RWsyL'](saveApiKey,_0x56d5bd[_0x1fb069(0x160)]()),console[_0x1fb069(0x174)](_0x1fb069(0x172)),console[_0x1fb069(0x174)](_0x3b4a2e[_0x1fb069(0x16a)]),_0x3b4a2e[_0x1fb069(0x17f)](registerHooks),console[_0x1fb069(0x174)]('✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.'),console[_0x1fb069(0x174)](''),console[_0x1fb069(0x174)]('Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.');}catch(_0x28810e){console[_0x1fb069(0x178)]('❌\x20Setup\x20failed:\x20'+_0x28810e['message']),process[_0x1fb069(0x175)]=0x1;}}function saveApiKey(_0x41b192){const _0x3327a0=_0x354a3f,_0x5b332e={'uakSl':function(_0xb32c02,_0x4c85ff,_0x183ee0){return _0xb32c02(_0x4c85ff,_0x183ee0);},'EBoUu':'utf-8'};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x28f379={};try{_0x28f379=JSON[_0x3327a0(0x17e)](_0x5b332e[_0x3327a0(0x16e)](readFileSync,CONFIG_FILE,_0x5b332e[_0x3327a0(0x173)]));}catch{}_0x28f379['apiKey']=_0x41b192,writeFileSync(CONFIG_FILE,JSON[_0x3327a0(0x163)](_0x28f379,null,0x2)+'\x0a','utf-8');}function registerHooks(){const _0x398129=_0x354a3f,_0x923114={'BqLuv':function(_0x1c4f3a,_0x31cfd6,_0x57d6ba){return _0x1c4f3a(_0x31cfd6,_0x57d6ba);},'DyeAW':'utf-8','CYxPf':'command','nDcMj':_0x398129(0x161),'CJXWx':function(_0x213a4e,_0xd10a5,_0x59c003,_0x4229fe){return _0x213a4e(_0xd10a5,_0x59c003,_0x4229fe);}};_0x923114[_0x398129(0x164)](mkdirSync,join(homedir(),_0x398129(0x16c)),{'recursive':!0x0});let _0x534364={};try{_0x534364=JSON['parse'](_0x923114['BqLuv'](readFileSync,CLAUDE_SETTINGS_FILE,_0x923114[_0x398129(0x167)]));}catch{}const _0x2d37a9=_0x534364[_0x398129(0x16b)]??{};_0x2d37a9['SessionStart']=[{'matcher':'startup|resume|clear|compact','hooks':[{'type':_0x923114[_0x398129(0x170)],'command':_0x923114[_0x398129(0x16f)],'timeout':0x5}]}],_0x2d37a9['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':_0x923114['CYxPf'],'command':'tokenizer-speedup'}]}],_0x2d37a9['PreCompact']=[{'matcher':'','hooks':[{'type':_0x923114['CYxPf'],'command':_0x923114[_0x398129(0x16f)],'timeout':0xa}]}],_0x2d37a9[_0x398129(0x166)]=[{'matcher':'','hooks':[{'type':_0x923114[_0x398129(0x170)],'command':'tokenizer-speedup','timeout':0xa}]}],_0x534364[_0x398129(0x16b)]=_0x2d37a9,_0x923114['CJXWx'](writeFileSync,CLAUDE_SETTINGS_FILE,JSON['stringify'](_0x534364,null,0x2)+'\x0a',_0x923114['DyeAW']);}export function loadApiKeyFromConfig(){const _0x21ee84=_0x354a3f,_0x437b00={'gmAXo':function(_0x16285c,_0x13cda0,_0x2848e0){return _0x16285c(_0x13cda0,_0x2848e0);}};try{return JSON[_0x21ee84(0x17e)](_0x437b00['gmAXo'](readFileSync,CONFIG_FILE,_0x21ee84(0x169)))['apiKey']??void 0x0;}catch{return;}}
@@ -1 +1 @@
1
- (function(_0x13266c,_0x1f4b0a){const _0x59392f=_0x3f60,_0xaa91e7=_0x13266c();while(!![]){try{const _0x383fc6=parseInt(_0x59392f(0xf3))/0x1*(-parseInt(_0x59392f(0xf4))/0x2)+-parseInt(_0x59392f(0xed))/0x3+parseInt(_0x59392f(0xf0))/0x4+-parseInt(_0x59392f(0xf1))/0x5*(-parseInt(_0x59392f(0xf5))/0x6)+-parseInt(_0x59392f(0xef))/0x7*(-parseInt(_0x59392f(0xf2))/0x8)+-parseInt(_0x59392f(0xee))/0x9+parseInt(_0x59392f(0xeb))/0xa*(parseInt(_0x59392f(0xf6))/0xb);if(_0x383fc6===_0x1f4b0a)break;else _0xaa91e7['push'](_0xaa91e7['shift']());}catch(_0xe61dc2){_0xaa91e7['push'](_0xaa91e7['shift']());}}}(_0x1d62,0x3b029));function _0x3f60(_0xb2c9b6,_0x18aa36){_0xb2c9b6=_0xb2c9b6-0xea;const _0x1d62f0=_0x1d62();let _0x3f60cc=_0x1d62f0[_0xb2c9b6];return _0x3f60cc;}function _0x1d62(){const _0x4ca469=['125792MWMKlx','2GsQRgY','13126pDNHhy','401490yRPKBu','13519trsUFj','tier','730ybZepe','meteredPriceId','589518JGWpyR','2463327TPvpuK','49oVEwNf','1298040iMsMlx','15pcIkSM'];_0x1d62=function(){return _0x4ca469;};return _0x1d62();}export function buildCheckoutParams(_0x54731c){const _0x5becf8=_0x3f60,_0x46aa64=[{'price':_0x54731c['recurringPriceId'],'quantity':0x1}];return _0x54731c['meteredPriceId']&&_0x46aa64['push']({'price':_0x54731c[_0x5becf8(0xec)]}),{'customer':_0x54731c['customerId'],'mode':'subscription','line_items':_0x46aa64,'success_url':_0x54731c['successUrl'],'cancel_url':_0x54731c['cancelUrl'],'metadata':{'tier':_0x54731c[_0x5becf8(0xea)]}};}
1
+ function _0x3c99(_0x554c1b,_0x466eb9){_0x554c1b=_0x554c1b-0xfd;const _0x5db8b9=_0x5db8();let _0x3c9960=_0x5db8b9[_0x554c1b];return _0x3c9960;}(function(_0x424b53,_0x2adedb){const _0x4cd69e=_0x3c99,_0x25fe45=_0x424b53();while(!![]){try{const _0x4d694b=-parseInt(_0x4cd69e(0x106))/0x1+parseInt(_0x4cd69e(0xfe))/0x2*(parseInt(_0x4cd69e(0xfd))/0x3)+parseInt(_0x4cd69e(0x100))/0x4*(-parseInt(_0x4cd69e(0x102))/0x5)+parseInt(_0x4cd69e(0x108))/0x6+-parseInt(_0x4cd69e(0xff))/0x7+-parseInt(_0x4cd69e(0x107))/0x8+parseInt(_0x4cd69e(0x104))/0x9*(parseInt(_0x4cd69e(0x101))/0xa);if(_0x4d694b===_0x2adedb)break;else _0x25fe45['push'](_0x25fe45['shift']());}catch(_0x573e9a){_0x25fe45['push'](_0x25fe45['shift']());}}}(_0x5db8,0xcc1d7));export function buildCheckoutParams(_0x3dd660){const _0x59512f=_0x3c99,_0x417007={'nZWTR':'subscription'},_0xe5fb1b=[{'price':_0x3dd660[_0x59512f(0x10a)],'quantity':0x1}];return _0x3dd660[_0x59512f(0x109)]&&_0xe5fb1b[_0x59512f(0x10b)]({'price':_0x3dd660[_0x59512f(0x109)]}),{'customer':_0x3dd660[_0x59512f(0x105)],'mode':_0x417007[_0x59512f(0x103)],'line_items':_0xe5fb1b,'success_url':_0x3dd660['successUrl'],'cancel_url':_0x3dd660['cancelUrl'],'metadata':{'tier':_0x3dd660['tier']}};}function _0x5db8(){const _0x558e39=['630ZTwqLR','6099408RrAvmn','111472pcaxLq','735070KyowRI','60nHWsAf','nZWTR','324UfeWuP','customerId','841444FeaIid','12499456elbLLU','6402384oyrsIp','meteredPriceId','recurringPriceId','push','6975eGLupE'];_0x5db8=function(){return _0x558e39;};return _0x5db8();}
@@ -1 +1 @@
1
- function _0x1f70(_0x1aaa73,_0x262ecd){_0x1aaa73=_0x1aaa73-0x143;const _0x2305b4=_0x2305();let _0x1f7010=_0x2305b4[_0x1aaa73];return _0x1f7010;}const _0x2623c1=_0x1f70;function _0x2305(){const _0x2aac66=['147076FnKNCi','250282PSheUL','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','782280mhkPVh','6OjoXrf','6ZNqAEw','2536930dGqrxL','812799lbjdiR','706700dwksDN','1076880MZbsII','2nUhyfp','Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.'];_0x2305=function(){return _0x2aac66;};return _0x2305();}(function(_0x148d6b,_0x5257f4){const _0x4a06ab=_0x1f70,_0x4a2b75=_0x148d6b();while(!![]){try{const _0x1f5b44=parseInt(_0x4a06ab(0x146))/0x1*(-parseInt(_0x4a06ab(0x149))/0x2)+-parseInt(_0x4a06ab(0x14d))/0x3*(parseInt(_0x4a06ab(0x148))/0x4)+-parseInt(_0x4a06ab(0x144))/0x5+-parseInt(_0x4a06ab(0x14c))/0x6*(-parseInt(_0x4a06ab(0x145))/0x7)+parseInt(_0x4a06ab(0x14b))/0x8+parseInt(_0x4a06ab(0x143))/0x9+parseInt(_0x4a06ab(0x14e))/0xa;if(_0x1f5b44===_0x5257f4)break;else _0x4a2b75['push'](_0x4a2b75['shift']());}catch(_0x1546aa){_0x4a2b75['push'](_0x4a2b75['shift']());}}}(_0x2305,0x1fda5));export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':_0x2623c1(0x147),'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':_0x2623c1(0x14a),'recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
1
+ const _0x47f661=_0xfe98;function _0x8dbf(){const _0x2e9fc1=['357012LftOYJ','1288614patJMD','45dBJEeb','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','644008TDULad','533151gMRlrT','515910SEBzyD','TokenizerSpeedUp\x20Free','80RwJacl','264gQQMHR','59852bwYPXP','116giflBV','Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','7xqXJJb','32695WrXcCq'];_0x8dbf=function(){return _0x2e9fc1;};return _0x8dbf();}function _0xfe98(_0x46277e,_0x32e422){_0x46277e=_0x46277e-0x14d;const _0x8dbfa5=_0x8dbf();let _0xfe9850=_0x8dbfa5[_0x46277e];return _0xfe9850;}(function(_0x8ee25,_0x5247f0){const _0x2bd0af=_0xfe98,_0x31cf1b=_0x8ee25();while(!![]){try{const _0x484805=parseInt(_0x2bd0af(0x14d))/0x1+parseInt(_0x2bd0af(0x151))/0x2*(-parseInt(_0x2bd0af(0x158))/0x3)+parseInt(_0x2bd0af(0x152))/0x4*(parseInt(_0x2bd0af(0x155))/0x5)+-parseInt(_0x2bd0af(0x157))/0x6+parseInt(_0x2bd0af(0x154))/0x7*(parseInt(_0x2bd0af(0x15a))/0x8)+parseInt(_0x2bd0af(0x15b))/0x9*(-parseInt(_0x2bd0af(0x14f))/0xa)+parseInt(_0x2bd0af(0x150))/0xb*(parseInt(_0x2bd0af(0x156))/0xc);if(_0x484805===_0x5247f0)break;else _0x31cf1b['push'](_0x31cf1b['shift']());}catch(_0x34d251){_0x31cf1b['push'](_0x31cf1b['shift']());}}}(_0x8dbf,0x587ff));export const STRIPE_CONFIG={'free':{'name':_0x47f661(0x14e),'description':'Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','recurringPrice':0x0},'pro':{'name':'TokenizerSpeedUp\x20Pro','description':_0x47f661(0x153),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':'TokenizerSpeedUp\x20Team','description':_0x47f661(0x159),'recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
@@ -1 +1 @@
1
- const _0x1118c7=_0x1732;(function(_0xe23667,_0xbcf701){const _0x4bc423=_0x1732,_0x80ee56=_0xe23667();while(!![]){try{const _0x1fa37c=parseInt(_0x4bc423(0xff))/0x1*(parseInt(_0x4bc423(0x106))/0x2)+parseInt(_0x4bc423(0x102))/0x3+-parseInt(_0x4bc423(0x108))/0x4+parseInt(_0x4bc423(0xfb))/0x5*(parseInt(_0x4bc423(0x105))/0x6)+-parseInt(_0x4bc423(0x109))/0x7+parseInt(_0x4bc423(0x107))/0x8+-parseInt(_0x4bc423(0x10b))/0x9;if(_0x1fa37c===_0xbcf701)break;else _0x80ee56['push'](_0x80ee56['shift']());}catch(_0x5a5bc9){_0x80ee56['push'](_0x80ee56['shift']());}}}(_0x166a,0x8e0f1));import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG[_0x1118c7(0xfc)][_0x1118c7(0x10a)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG['team']['meteredUnitAmount']}};function _0x1732(_0x50843c,_0x567dcc){_0x50843c=_0x50843c-0xfb;const _0x166ab7=_0x166a();let _0x1732a0=_0x166ab7[_0x50843c];return _0x1732a0;}export function calculateUsageCharge(_0x30c97e,_0x613587){const _0x4962a5=_0x1118c7,_0x3bb1d8={'GHYpS':function(_0x16647b,_0xb86079){return _0x16647b-_0xb86079;},'mSAes':function(_0x52ed1c,_0x334326){return _0x52ed1c/_0x334326;}},_0x58bd=TIER_LIMITS[_0x30c97e];if(0x0===_0x58bd['unitRate'])return{'tier':_0x30c97e,'tokensSaved':_0x613587,'freeAllowance':_0x58bd[_0x4962a5(0xfe)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x56cb02=Math['max'](0x0,_0x3bb1d8['GHYpS'](_0x613587,_0x58bd[_0x4962a5(0xfe)])),_0x5ea9ba=Math['ceil'](_0x3bb1d8[_0x4962a5(0x103)](_0x56cb02,0x186a0)),_0x32946c=_0x5ea9ba*_0x58bd[_0x4962a5(0xfd)];return{'tier':_0x30c97e,'tokensSaved':_0x613587,'freeAllowance':_0x58bd['allowance'],'chargeableTokens':_0x56cb02,'chargeableUnits':_0x5ea9ba,'unitRate':_0x58bd[_0x4962a5(0xfd)],'amount':_0x32946c};}export function buildUsageRecord(_0x50174e,_0x104a5b){const _0x3bbd2b=_0x1118c7,_0x399ce1={'KsmKK':'set'};return{'subscription_item':_0x50174e,'quantity':_0x104a5b,'action':_0x399ce1['KsmKK'],'timestamp':Math[_0x3bbd2b(0x104)](Date['now']()/0x3e8)};}export function prepareUsageSync(_0x4e6649,_0x15d4f0,_0x9148f1){const _0x582679=_0x1118c7,_0x2d667a={'vdVOp':function(_0x58fc81,_0x19de91,_0xc3cbb0){return _0x58fc81(_0x19de91,_0xc3cbb0);}};if(!_0x9148f1)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x4e6649,'error':_0x582679(0x100)};const _0x3ec587=_0x2d667a[_0x582679(0x101)](calculateUsageCharge,_0x4e6649,_0x15d4f0);if(0x0===_0x3ec587['chargeableUnits'])return{'synced':!0x0,'subscriptionItemId':_0x9148f1,'chargeableUnits':0x0,'tier':_0x4e6649};return buildUsageRecord(_0x9148f1,_0x3ec587['chargeableUnits']),{'synced':!0x0,'subscriptionItemId':_0x9148f1,'chargeableUnits':_0x3ec587['chargeableUnits'],'tier':_0x4e6649};}function _0x166a(){const _0x167f0b=['4159344imvyZO','698208JVCZzc','1954778lTOQaK','meteredUnitAmount','10973907IzWczf','7495hIpJqO','pro','unitRate','allowance','10747EEqivt','no\x20subscription_item_id','vdVOp','191871QdahNt','mSAes','floor','4194DZWQVY','116XHNLEm'];_0x166a=function(){return _0x167f0b;};return _0x166a();}
1
+ function _0x3922(){const _0x4493b2=['pro','450479hyXDyl','no\x20subscription_item_id','3391850URdxMy','2234229cSYiRp','7xiZJVh','chargeableUnits','Obzer','now','allowance','2222124wwEqct','20707254CnkNYA','5107254DsuLND','set','meteredUnitAmount','floor','RfJEj','4yyxfMJ','team','11144568VHooxq','unitRate','BJvHF','LoFcc'];_0x3922=function(){return _0x4493b2;};return _0x3922();}const _0x5118dd=_0x24a7;(function(_0x54a6e5,_0x2c3dcb){const _0x4b3ece=_0x24a7,_0x46773d=_0x54a6e5();while(!![]){try{const _0x451ae7=parseInt(_0x4b3ece(0x14e))/0x1+-parseInt(_0x4b3ece(0x140))/0x2+parseInt(_0x4b3ece(0x13a))/0x3*(parseInt(_0x4b3ece(0x147))/0x4)+parseInt(_0x4b3ece(0x139))/0x5+parseInt(_0x4b3ece(0x142))/0x6*(-parseInt(_0x4b3ece(0x13b))/0x7)+-parseInt(_0x4b3ece(0x149))/0x8+parseInt(_0x4b3ece(0x141))/0x9;if(_0x451ae7===_0x2c3dcb)break;else _0x46773d['push'](_0x46773d['shift']());}catch(_0x27a848){_0x46773d['push'](_0x46773d['shift']());}}}(_0x3922,0xc7f70));function _0x24a7(_0xd92250,_0x45d07b){_0xd92250=_0xd92250-0x138;const _0x3922e6=_0x3922();let _0x24a76b=_0x3922e6[_0xd92250];return _0x24a76b;}import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG[_0x5118dd(0x14d)][_0x5118dd(0x144)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG[_0x5118dd(0x148)][_0x5118dd(0x144)]}};export function calculateUsageCharge(_0x461137,_0x22117a){const _0x201ee0=_0x5118dd,_0x2a68de={'gCpTo':function(_0x2e5db0,_0x168cb2){return _0x2e5db0===_0x168cb2;},'Obzer':function(_0x3513f6,_0x31b436){return _0x3513f6-_0x31b436;},'GRGnZ':function(_0x5221df,_0x2a36d9){return _0x5221df/_0x2a36d9;},'RfJEj':function(_0x48c781,_0x2b602e){return _0x48c781*_0x2b602e;}},_0x8f172f=TIER_LIMITS[_0x461137];if(_0x2a68de['gCpTo'](0x0,_0x8f172f[_0x201ee0(0x14a)]))return{'tier':_0x461137,'tokensSaved':_0x22117a,'freeAllowance':_0x8f172f[_0x201ee0(0x13f)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x77a0b5=Math['max'](0x0,_0x2a68de[_0x201ee0(0x13d)](_0x22117a,_0x8f172f[_0x201ee0(0x13f)])),_0x36ea10=Math['ceil'](_0x2a68de['GRGnZ'](_0x77a0b5,0x186a0)),_0xbf8c4b=_0x2a68de[_0x201ee0(0x146)](_0x36ea10,_0x8f172f['unitRate']);return{'tier':_0x461137,'tokensSaved':_0x22117a,'freeAllowance':_0x8f172f[_0x201ee0(0x13f)],'chargeableTokens':_0x77a0b5,'chargeableUnits':_0x36ea10,'unitRate':_0x8f172f[_0x201ee0(0x14a)],'amount':_0xbf8c4b};}export function buildUsageRecord(_0x1848e5,_0x1b6341){const _0x136c9d=_0x5118dd,_0x147514={'NeCLS':_0x136c9d(0x143),'LoFcc':function(_0x48137d,_0x553759){return _0x48137d/_0x553759;}};return{'subscription_item':_0x1848e5,'quantity':_0x1b6341,'action':_0x147514['NeCLS'],'timestamp':Math[_0x136c9d(0x145)](_0x147514[_0x136c9d(0x14c)](Date[_0x136c9d(0x13e)](),0x3e8))};}export function prepareUsageSync(_0x4c1799,_0x4ed528,_0x1efc18){const _0x20e6bb=_0x5118dd,_0x345e0d={'BJvHF':function(_0x227988,_0x5522df,_0x26baf7){return _0x227988(_0x5522df,_0x26baf7);}};if(!_0x1efc18)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x4c1799,'error':_0x20e6bb(0x138)};const _0xaee40f=calculateUsageCharge(_0x4c1799,_0x4ed528);if(0x0===_0xaee40f['chargeableUnits'])return{'synced':!0x0,'subscriptionItemId':_0x1efc18,'chargeableUnits':0x0,'tier':_0x4c1799};return _0x345e0d[_0x20e6bb(0x14b)](buildUsageRecord,_0x1efc18,_0xaee40f['chargeableUnits']),{'synced':!0x0,'subscriptionItemId':_0x1efc18,'chargeableUnits':_0xaee40f[_0x20e6bb(0x13c)],'tier':_0x4c1799};}
@@ -1 +1 @@
1
- function _0x3ba1(){const _0x369665=['object','metered','customer.subscription.deleted','current_period_end','71387dupszL','subscription_canceled','tier','data','1615254DmnuGu','1902695tLbZwd','623eIVbNe','customer','6000624LgkQkl','3272CxjRnq','KXGGW','metadata','free','invoice.paid','subscription','hZnSD','zPabJ','728740hzoSxD','items','ignored','canceled','172uSvSrE','5667WIvZIN','DdRPB'];_0x3ba1=function(){return _0x369665;};return _0x3ba1();}function _0x43ff(_0x4ec3ce,_0x3a6624){_0x4ec3ce=_0x4ec3ce-0xd4;const _0x3ba1ca=_0x3ba1();let _0x43ff55=_0x3ba1ca[_0x4ec3ce];return _0x43ff55;}(function(_0x474e7,_0x5ba274){const _0x57c686=_0x43ff,_0x1df7ad=_0x474e7();while(!![]){try{const _0x4185d2=-parseInt(_0x57c686(0xe2))/0x1+parseInt(_0x57c686(0xd7))/0x2+-parseInt(_0x57c686(0xdc))/0x3*(parseInt(_0x57c686(0xdb))/0x4)+parseInt(_0x57c686(0xe7))/0x5+parseInt(_0x57c686(0xe6))/0x6+-parseInt(_0x57c686(0xe8))/0x7*(-parseInt(_0x57c686(0xeb))/0x8)+-parseInt(_0x57c686(0xea))/0x9;if(_0x4185d2===_0x5ba274)break;else _0x1df7ad['push'](_0x1df7ad['shift']());}catch(_0x695679){_0x1df7ad['push'](_0x1df7ad['shift']());}}}(_0x3ba1,0x38701));export function handleWebhookEvent(_0x1ebbbd,_0x3c93c6){const _0x53efe4=_0x43ff,_0x3c32d4={'TqrrB':_0x53efe4(0xef),'ERZyQ':'customer.subscription.updated','zPabJ':'subscription_updated','KXGGW':'active','GZVRQ':function(_0x45f26d,_0x21409f){return _0x45f26d(_0x21409f);},'DdRPB':_0x53efe4(0xda),'hZnSD':_0x53efe4(0xd9)};switch(_0x1ebbbd['type']){case _0x3c32d4['TqrrB']:{const _0x55e247=_0x1ebbbd[_0x53efe4(0xe5)]['object'];return{'handled':!0x0,'action':'invoice_paid','customerId':_0x55e247['customer'],'subscriptionId':_0x55e247[_0x53efe4(0xd4)]};}case _0x3c32d4['ERZyQ']:{const _0x30e560=_0x1ebbbd['data'][_0x53efe4(0xde)],_0x444c23={'handled':!0x0,'action':_0x3c32d4[_0x53efe4(0xd6)],'customerId':_0x30e560['customer'],'subscriptionId':_0x30e560['id']};return _0x3c93c6&&_0x3c93c6['upsert']({'id':_0x30e560['id'],'customerId':_0x30e560['customer'],'status':_0x30e560['status']||_0x3c32d4[_0x53efe4(0xec)],'tier':_0x30e560['metadata']?.[_0x53efe4(0xe4)]||'free','currentPeriodEnd':_0x30e560['current_period_end']||0x0,'meteredSubscriptionItemId':_0x3c32d4['GZVRQ'](extractMeteredItemId,_0x30e560),'updatedAt':''}),_0x444c23;}case _0x53efe4(0xe0):{const _0x2f0174=_0x1ebbbd['data'][_0x53efe4(0xde)],_0x1330fa={'handled':!0x0,'action':_0x53efe4(0xe3),'customerId':_0x2f0174['customer'],'subscriptionId':_0x2f0174['id']};return _0x3c93c6&&_0x3c93c6['upsert']({'id':_0x2f0174['id'],'customerId':_0x2f0174[_0x53efe4(0xe9)],'status':_0x3c32d4[_0x53efe4(0xdd)],'tier':_0x2f0174[_0x53efe4(0xed)]?.['tier']||_0x53efe4(0xee),'currentPeriodEnd':_0x2f0174[_0x53efe4(0xe1)]||0x0,'updatedAt':''}),_0x1330fa;}default:return{'handled':!0x1,'action':_0x3c32d4[_0x53efe4(0xd5)]};}}function extractMeteredItemId(_0x2c407b){const _0x272a85=_0x43ff,_0x597388=_0x2c407b[_0x272a85(0xd8)];if(!_0x597388?.['data'])return;const _0xfd37d7=_0x597388['data']['find'](_0x22a7db=>_0x272a85(0xdf)===_0x22a7db['price']?.['recurring']?.['usage_type']);return _0xfd37d7?.['id'];}
1
+ function _0x2b03(){const _0x1f9a9f=['77592QvumfN','current_period_end','subscription_canceled','1383008lIEdBy','108EFsoVa','price','metered','15YxYjuB','ASpUE','metadata','active','data','customer','395260KvzTul','592614vlhKts','102447sPQKEg','invoice_paid','canceled','EEVBW','subscription_updated','Xgtss','193226cKBJQX','type','invoice.paid','2CovWVQ','free','object','490Toekuc','6397412IxOGjj','ignored','Dsysv','upsert'];_0x2b03=function(){return _0x1f9a9f;};return _0x2b03();}(function(_0x58a6c7,_0x3ca8c2){const _0x5ccf79=_0x292f,_0x5247a5=_0x58a6c7();while(!![]){try{const _0x1dc12c=-parseInt(_0x5ccf79(0x187))/0x1*(parseInt(_0x5ccf79(0x17c))/0x2)+parseInt(_0x5ccf79(0x18f))/0x3*(parseInt(_0x5ccf79(0x193))/0x4)+parseInt(_0x5ccf79(0x196))/0x5*(-parseInt(_0x5ccf79(0x17d))/0x6)+parseInt(_0x5ccf79(0x18b))/0x7+parseInt(_0x5ccf79(0x192))/0x8+parseInt(_0x5ccf79(0x17e))/0x9*(-parseInt(_0x5ccf79(0x18a))/0xa)+parseInt(_0x5ccf79(0x184))/0xb;if(_0x1dc12c===_0x3ca8c2)break;else _0x5247a5['push'](_0x5247a5['shift']());}catch(_0x3a10fa){_0x5247a5['push'](_0x5247a5['shift']());}}}(_0x2b03,0x87188));export function handleWebhookEvent(_0x2f001a,_0x1c9ee0){const _0x728c0f=_0x292f,_0x4a39f9={'Xgtss':_0x728c0f(0x186),'ydnuq':_0x728c0f(0x17f),'Dsysv':'customer.subscription.updated','EEVBW':_0x728c0f(0x182),'ZIhJm':'free','CleWK':function(_0x337b2a,_0x32dbec){return _0x337b2a(_0x32dbec);},'SVzOd':_0x728c0f(0x191),'ASpUE':_0x728c0f(0x180)};switch(_0x2f001a[_0x728c0f(0x185)]){case _0x4a39f9[_0x728c0f(0x183)]:{const _0x851ba2=_0x2f001a['data']['object'];return{'handled':!0x0,'action':_0x4a39f9['ydnuq'],'customerId':_0x851ba2['customer'],'subscriptionId':_0x851ba2['subscription']};}case _0x4a39f9[_0x728c0f(0x18d)]:{const _0x4ea168=_0x2f001a[_0x728c0f(0x17a)]['object'],_0x2d2916={'handled':!0x0,'action':_0x4a39f9[_0x728c0f(0x181)],'customerId':_0x4ea168['customer'],'subscriptionId':_0x4ea168['id']};return _0x1c9ee0&&_0x1c9ee0[_0x728c0f(0x18e)]({'id':_0x4ea168['id'],'customerId':_0x4ea168['customer'],'status':_0x4ea168['status']||_0x728c0f(0x179),'tier':_0x4ea168[_0x728c0f(0x178)]?.['tier']||_0x4a39f9['ZIhJm'],'currentPeriodEnd':_0x4ea168['current_period_end']||0x0,'meteredSubscriptionItemId':_0x4a39f9['CleWK'](extractMeteredItemId,_0x4ea168),'updatedAt':''}),_0x2d2916;}case'customer.subscription.deleted':{const _0x28538d=_0x2f001a['data'][_0x728c0f(0x189)],_0x90f391={'handled':!0x0,'action':_0x4a39f9['SVzOd'],'customerId':_0x28538d[_0x728c0f(0x17b)],'subscriptionId':_0x28538d['id']};return _0x1c9ee0&&_0x1c9ee0[_0x728c0f(0x18e)]({'id':_0x28538d['id'],'customerId':_0x28538d[_0x728c0f(0x17b)],'status':_0x4a39f9[_0x728c0f(0x197)],'tier':_0x28538d['metadata']?.['tier']||_0x728c0f(0x188),'currentPeriodEnd':_0x28538d[_0x728c0f(0x190)]||0x0,'updatedAt':''}),_0x90f391;}default:return{'handled':!0x1,'action':_0x728c0f(0x18c)};}}function _0x292f(_0x2b8b46,_0x2c32df){_0x2b8b46=_0x2b8b46-0x178;const _0x2b03a7=_0x2b03();let _0x292fe2=_0x2b03a7[_0x2b8b46];return _0x292fe2;}function extractMeteredItemId(_0x3040b3){const _0x268f86=_0x292f,_0x58456a=_0x3040b3['items'];if(!_0x58456a?.[_0x268f86(0x17a)])return;const _0x546582=_0x58456a['data']['find'](_0x273ba2=>_0x268f86(0x195)===_0x273ba2[_0x268f86(0x194)]?.['recurring']?.['usage_type']);return _0x546582?.['id'];}
@@ -1 +1 @@
1
- function _0x1925(_0x2ee080,_0x483cd4){_0x2ee080=_0x2ee080-0x112;const _0x541348=_0x5413();let _0x1925b4=_0x541348[_0x2ee080];return _0x1925b4;}(function(_0x32f707,_0x237539){const _0x4e8e6a=_0x1925,_0x56224f=_0x32f707();while(!![]){try{const _0x36a1c8=parseInt(_0x4e8e6a(0x11a))/0x1*(-parseInt(_0x4e8e6a(0x11e))/0x2)+parseInt(_0x4e8e6a(0x119))/0x3+-parseInt(_0x4e8e6a(0x117))/0x4+-parseInt(_0x4e8e6a(0x11f))/0x5*(-parseInt(_0x4e8e6a(0x114))/0x6)+-parseInt(_0x4e8e6a(0x113))/0x7*(parseInt(_0x4e8e6a(0x115))/0x8)+parseInt(_0x4e8e6a(0x116))/0x9*(parseInt(_0x4e8e6a(0x120))/0xa)+-parseInt(_0x4e8e6a(0x118))/0xb*(-parseInt(_0x4e8e6a(0x11b))/0xc);if(_0x36a1c8===_0x237539)break;else _0x56224f['push'](_0x56224f['shift']());}catch(_0x1ad249){_0x56224f['push'](_0x56224f['shift']());}}}(_0x5413,0x5b4fc));function _0x5413(){const _0xbb7975=['set','values','1358NyXUvY','122406ZQbCSk','17272WZQtUW','927jVLhIY','1790096NSxcVT','55ocvNJY','1454391QhBpQh','2sEQHrX','574164yByOqb','get','subs','37338QEKJji','45Erjcsa','35930EcQvku'];_0x5413=function(){return _0xbb7975;};return _0x5413();}export class MemorySubscriptionStore{['subs']=new Map();['upsert'](_0x4acc5e){const _0x5b441a=_0x1925;_0x4acc5e['updatedAt']=new Date()['toISOString'](),this['subs'][_0x5b441a(0x121)](_0x4acc5e['id'],_0x4acc5e);}['getByCustomerId'](_0x282087){const _0x314764={'cayYV':function(_0x37f86c,_0x3eadd0){return _0x37f86c===_0x3eadd0;}};for(const _0x2383e4 of this['subs']['values']())if(_0x314764['cayYV'](_0x2383e4['customerId'],_0x282087))return _0x2383e4;}['getBySubscriptionId'](_0x51235e){const _0x4291ce=_0x1925;return this[_0x4291ce(0x11d)][_0x4291ce(0x11c)](_0x51235e);}['list'](){const _0x4fa899=_0x1925;return[...this['subs'][_0x4fa899(0x112)]()];}}
1
+ const _0x2b0dbc=_0x3155;function _0x55a8(){const _0x13c21b=['get','customerId','165inuTIu','getBySubscriptionId','1726644QZJTAN','35824rolfzC','675084vRPZRa','5hYqXqL','3789bcVVlq','getByCustomerId','3412iLZtWn','208icUDEI','10770UGxoSc','XEuzw','37563ImZtCU','259tigwyU','updatedAt','subs','960636YwFCWO'];_0x55a8=function(){return _0x13c21b;};return _0x55a8();}(function(_0x22e6c0,_0x4d0bb6){const _0x451fed=_0x3155,_0x4d07bd=_0x22e6c0();while(!![]){try{const _0x1aad05=parseInt(_0x451fed(0x13b))/0x1*(parseInt(_0x451fed(0x13a))/0x2)+parseInt(_0x451fed(0x13e))/0x3+parseInt(_0x451fed(0x136))/0x4+-parseInt(_0x451fed(0x137))/0x5*(-parseInt(_0x451fed(0x147))/0x6)+-parseInt(_0x451fed(0x13f))/0x7*(-parseInt(_0x451fed(0x135))/0x8)+-parseInt(_0x451fed(0x138))/0x9*(-parseInt(_0x451fed(0x13c))/0xa)+parseInt(_0x451fed(0x145))/0xb*(-parseInt(_0x451fed(0x142))/0xc);if(_0x1aad05===_0x4d0bb6)break;else _0x4d07bd['push'](_0x4d07bd['shift']());}catch(_0x25667a){_0x4d07bd['push'](_0x4d07bd['shift']());}}}(_0x55a8,0x3b22e));function _0x3155(_0x2a4d3b,_0x594c15){_0x2a4d3b=_0x2a4d3b-0x135;const _0x55a8a4=_0x55a8();let _0x315505=_0x55a8a4[_0x2a4d3b];return _0x315505;}export class MemorySubscriptionStore{[_0x2b0dbc(0x141)]=new Map();['upsert'](_0x2bd8a5){const _0x6f3366=_0x2b0dbc;_0x2bd8a5[_0x6f3366(0x140)]=new Date()['toISOString'](),this['subs']['set'](_0x2bd8a5['id'],_0x2bd8a5);}[_0x2b0dbc(0x139)](_0x2328d0){const _0x1a4ea2=_0x2b0dbc,_0x4cbaef={'XEuzw':function(_0x17cfcb,_0x468a46){return _0x17cfcb===_0x468a46;}};for(const _0x3289e3 of this['subs']['values']())if(_0x4cbaef[_0x1a4ea2(0x13d)](_0x3289e3[_0x1a4ea2(0x144)],_0x2328d0))return _0x3289e3;}[_0x2b0dbc(0x146)](_0x2256e2){const _0x468c89=_0x2b0dbc;return this[_0x468c89(0x141)][_0x468c89(0x143)](_0x2256e2);}['list'](){const _0x386671=_0x2b0dbc;return[...this[_0x386671(0x141)]['values']()];}}
@@ -1,55 +1,55 @@
1
1
  {
2
- "version": "0.10.0",
3
- "build": "2026-07-03T09:22:00.154Z",
2
+ "version": "0.10.1",
3
+ "build": "2026-07-03T09:39:14.895Z",
4
4
  "files": {
5
- "cli/analyze.js": "sha256:5907fe7481ef7ff26f4abbc3c4c8c95e54905bd7471304a24cf7211ecc3676f0",
6
- "cli/config-cmd.js": "sha256:34f24a5059cb54339161147aefbc1d49655a9d2a8d55f31eaf060530831e4274",
7
- "cli/index.js": "sha256:5febf9bdfe4c90148be98f0f414ce2572ee507eb1c66041c47389025b9d128e1",
8
- "cli/init-cmd.js": "sha256:7f759cadc8f9f0ccaf1a190421c84b22c1958b31407348de23f0247300d90510",
9
- "cli/setup-cmd.js": "sha256:7b0d3e48c66c341c3ef8a1066a5d5212cad5c3412c553b1e65ed5633cbe0e5ae",
10
- "cloud/stripe-checkout.js": "sha256:a2b6a3ca0b21180d159cb8f2c5c0e6aab71aad094f7887b87137e2ff9418443a",
11
- "cloud/stripe-config.js": "sha256:47f740cffece13a9b9f3dd4acddf97f0d7dac3c011cc4fd3184acda0d6cd228a",
12
- "cloud/stripe-usage.js": "sha256:6923782d11736c23736139c9eb5eab558d1886ec113d71b6d1a7ae2f7699fcd0",
13
- "cloud/stripe-webhooks.js": "sha256:06dcc1319a563524584454aca0be4213d834d75355455982899b7b6f9d8f0d63",
14
- "cloud/subscription-store.js": "sha256:b879a696e3842f4f5a56ba750558de53991f9b49d2d8ccf9334d10a75d11ef35",
15
- "mcp/index.js": "sha256:178760e99eb31a04db688d8b840c02339486a7f3c78b38b59ce17cee635196f4",
16
- "mcp/resources.js": "sha256:d85aa5fc5166310009424e3b6f198f0647a554cc3faa405ec4a37f5a33214e67",
17
- "mcp/session.js": "sha256:07189fad9595c32bde92b5cb432a556e1a4248e39cab28df20ab8e4ab93f66a8",
18
- "mcp/tools.js": "sha256:7f0a2e46d7d92c22152c7ea0cf0a6ead9d4671a3ffddc62c8ac564ab50335eaa",
19
- "plugin/cli.js": "sha256:ca1d655a58cc95ddd5d205516d2d3b618b3691e85ad90328c83c9ecedd9639fd",
20
- "plugin/compression/anonymize.js": "sha256:d2392ce330967cc3872b4882013848c59a8976a3a99836d8f56134e7bd56eb09",
21
- "plugin/compression/cache.js": "sha256:cfde2f81df9111ae449492e4d40b6389a4459a1aed1c92cab528cb52db719afe",
22
- "plugin/compression/chunked.js": "sha256:6a28bfb1365407d99de49e2bbbe6a82254364fff733d46f39747a77e971b74b8",
23
- "plugin/compression/dedup.js": "sha256:062b309066a4a2a1d9e2de4abe6b40152d1271e18735503e8f7e8ee78df09b94",
24
- "plugin/compression/format-optimizer.js": "sha256:43c7827a6cf9bc9dc7d84fffd3e8014db8a1588e44dae1f9857321e67bdbb809",
25
- "plugin/compression/index.js": "sha256:6eb8464efed2d22fa3056fda1aa46c2cd09cdd37609686a38b63251370f909c3",
26
- "plugin/compression/pipeline.js": "sha256:625a4fb6f51816d216c0645c4379dce624df6b026839ebd9f6b416a53ac8ac2e",
27
- "plugin/compression/quality.js": "sha256:af9e54fb844c026c31e573d6cbf2099e91bafb0a0c5bad10fd994340f44c9e8e",
28
- "plugin/compression/rule-based.js": "sha256:7f985c06e4329c7715ef7dc0cc0d318c8053c7bf65c95e6910d9120f102c3e81",
29
- "plugin/compression/structural.js": "sha256:9b194d4c66b33722ac9ea3f001c037bc483b50367c4479341cbb19151663e08e",
30
- "plugin/compression/text-utils.js": "sha256:e19a204e3a163086143439d8e728f401a2245a5973291b51e1b8888ecdda02db",
31
- "plugin/compression/token-budget.js": "sha256:6b01ae4b662b9e98284dc4f2e673f45691502ac2b87b394bced1bc70e292b97c",
5
+ "cli/analyze.js": "sha256:f9d99ec7acdab8b83a2e46ee13a93ecc12aa006ea66acb44216c51c87be5e8f0",
6
+ "cli/config-cmd.js": "sha256:a1ba210a5b0e99b60ce8ab2dafdcc561ffa6f1ab0c944ff364fe26e52dab7e1c",
7
+ "cli/index.js": "sha256:ab8774ce906d9cd33f45a516496c706cb84d63c071bcd5a72f5c01fcb45fe065",
8
+ "cli/init-cmd.js": "sha256:2ab4c800028a1c588911358775583e04652308129d8edce1d15ba8b9f69c382f",
9
+ "cli/setup-cmd.js": "sha256:845efebe2857c5a2f709c5993e766952e8e803f7c6808be47c48cc78d76651bb",
10
+ "cloud/stripe-checkout.js": "sha256:8b207c8d5dd1ef0da2a753ca610d3894f7d9ad300240fcb1e0750cd90b4a68d3",
11
+ "cloud/stripe-config.js": "sha256:e67f2e6d1d1407774881ff67a96d1e3b6e8d698878f6e30549685f4ebdf8ed42",
12
+ "cloud/stripe-usage.js": "sha256:df5e849aaff1275956a9c56b9bc8a25adc239475b4e3a66ee96c2120542db110",
13
+ "cloud/stripe-webhooks.js": "sha256:c589a08da7111cffc55b33de196da2b4c651efab0e1abe91c791bb3ea18cd4a2",
14
+ "cloud/subscription-store.js": "sha256:e8459662928c08775fa7cb43abe9871969792f2bef1a525302b1bf11d74a7833",
15
+ "mcp/index.js": "sha256:709ebda813712c049f68a942d501c1cac19eabeea89dc8a502737d4511b08aee",
16
+ "mcp/resources.js": "sha256:0170524f698e6af25763dda034d36da47ce149cc49d4c8d4a54d9ce423ddf975",
17
+ "mcp/session.js": "sha256:3dc7cce9e5fd2854bb42e87642649e56425292f298f676854ae713198933b010",
18
+ "mcp/tools.js": "sha256:f09d75c351c7600b2db4c63d41fe2bd2beb8a8eae3c6cca9cf4616c60395e975",
19
+ "plugin/cli.js": "sha256:26f0ef06d18a61c2dbb4f9e1ba0848f4bbcf0fec1619f9fb91c8be4ae98f4a0c",
20
+ "plugin/compression/anonymize.js": "sha256:307fcb01618b6c5327d6ba34ff10bbedb30968f54d4c2f20c60fd385b6052659",
21
+ "plugin/compression/cache.js": "sha256:8e4abfd16bacb73c7ee74f70b9b08631f7aaabb06486ad3f2d3c51ffa9bd337a",
22
+ "plugin/compression/chunked.js": "sha256:72a7e1ce2e732f29f847f1776f65fb9b3e2137dca5be25873d935abb7eac093e",
23
+ "plugin/compression/dedup.js": "sha256:a17be603fe44e91b6ddb75f6f0144ddd6b7080bbf2a0afdf7506e23d9307d2b3",
24
+ "plugin/compression/format-optimizer.js": "sha256:8b95962e3f030f3ffb7a63b8e0711b3ccfdbc5ebe96a2822218273caf7725951",
25
+ "plugin/compression/index.js": "sha256:e6204a653e068d11e6faa4f8aaff4406fee87d4fd726bd735b56a49a853c2a9c",
26
+ "plugin/compression/pipeline.js": "sha256:8c8ed05f258034304a37afc58a46c214821d79f783501f7bfd5f8ac5764bf9b3",
27
+ "plugin/compression/quality.js": "sha256:0afc62133f5a3c259df155dabc0a8859eef17b909e308462b23165038c633387",
28
+ "plugin/compression/rule-based.js": "sha256:0bcc60a64377b63683d5414db253a9790740b1c8f49dc65245dd2e8f3be2c37b",
29
+ "plugin/compression/structural.js": "sha256:2051e8402fcf31283d6cee4763397efb1023c8f1829c5ca612dbb54a1468664b",
30
+ "plugin/compression/text-utils.js": "sha256:ad419fcf67ed3056603798c1540d8024dd94424d331a1ff37e547c7bc3711faa",
31
+ "plugin/compression/token-budget.js": "sha256:64cbe3c50db397dd078ca61c40e40750b88d3b1a96f8bb9605f879324f30a539",
32
32
  "plugin/compression/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02",
33
- "plugin/config-loader.js": "sha256:bf2cb5abc55a0771f8804b924581d719322bfdb3663791300008ee2900bdb654",
34
- "plugin/context-compressor.js": "sha256:c45052b705f02cba89fc703a8ed4bb94028a73fa1349a49c786550cf7a966ee2",
35
- "plugin/hook-dispatcher.js": "sha256:7f64d69b44062298df12cfc4697a478f40578d7e54fffd4ca52d4bf311c42503",
36
- "plugin/metering-client.js": "sha256:90b48d157f375227092a791a8e93968135015c5b575bab0fe763fd7d6e607840",
37
- "plugin/metrics-collector.js": "sha256:52d6076267ba7cd245d0bc4aed858384e37e0d5b3a55fe4b307b35c155c78788",
38
- "plugin/onboarding.js": "sha256:cc46e39e7906878ac228a5efa10e624354fb8845fe16ca36068eee013efb6e28",
39
- "plugin/precompact-handler.js": "sha256:14d088b68e1ea31803fc081f277967f3ce26f2ff93ddec1ef21572a27c5670b2",
40
- "plugin/report.js": "sha256:4d361148191f1522c1e473c472040a22861e7f8bc6f9655efa4682b77ec2be2a",
41
- "plugin/rule-analytics-store.js": "sha256:3f14921c0729eb1a2c52935976aeace3e49dcea692776c95db79df9446e6fc37",
42
- "plugin/rule-analytics.js": "sha256:622d14b7607bd3a6e328d9084b790c3a923ae607076a16596b94722b3e30decf",
43
- "plugin/rule-engine.js": "sha256:e179a3c9f1454366c190a80e05739f37b6c33188812670a048238af6ce3ad03a",
44
- "plugin/rule-sharing.js": "sha256:118645573383bb14c4d2955a7432e31464b4d5f007a2d5aac86655552665ae77",
45
- "plugin/rule-suggest.js": "sha256:45e1002f0bc87c5d02ee442f6c98f6edd36a5a9e7a287750be4daf921f70a58c",
46
- "plugin/session-start.js": "sha256:e43ea0bdacc30e38a72a51448dad01c425d9e8d0cff0382b2bd74e176bf85ff1",
47
- "plugin/smart-context.js": "sha256:7c9be6574f5c8d455557eb7c6dbc4af58e4298606992b3884769cef169d406e0",
48
- "shared/license.js": "sha256:b69a9a7319a472e139d630773bd2a7bcb0597dc7f8170ee281458b78f716dab4",
49
- "shared/providers/claude-provider.js": "sha256:e538cb3a2c0049102f6dd0abf15d635287511c4a45a8547dd5d2697d2d1cf9bd",
50
- "shared/providers/openai-provider.js": "sha256:0a31fb589b4ba1e5dc6a60fbd5d6defd297cc839d8a22f7ba0559aac3aafd43b",
51
- "shared/token-counter.js": "sha256:8be9806d22d8d99b2e82cac27e753acb6bb8e68b9d41e5c83d6d460526e31e5e",
52
- "shared/token-provider.js": "sha256:9a2724f0bf822e3f03f42841698a6bb0fa8f9e6fbf5102896f5d5e9ae187d7a1",
33
+ "plugin/config-loader.js": "sha256:32d967457691592d79d3b658ed07289d4ab8cfec32ffe463806643442329a941",
34
+ "plugin/context-compressor.js": "sha256:ce61428d31acc56d493c11e0f0356662e4a0305df7ca55344569306d2c3d706d",
35
+ "plugin/hook-dispatcher.js": "sha256:8582a0186991dfeb9ec566e6d9f53c24a5fd5d305df977d38dea6e91710001b9",
36
+ "plugin/metering-client.js": "sha256:d20b945f31cc1c3c14cce5b4afd8a50efbd078d2ba85bc9db0664114b36b876c",
37
+ "plugin/metrics-collector.js": "sha256:347f8ac8703256a1c78b8f1a7dd544773f538dfa4a37f5f534f1d0d013dbc95e",
38
+ "plugin/onboarding.js": "sha256:ac918260c84397dee97db14824b5d30a01d1cb993f9267097a9d4789dfe91d1c",
39
+ "plugin/precompact-handler.js": "sha256:2d21d82870283f0037b79bade10a279d729b611382cd477734d99aa05e6a754b",
40
+ "plugin/report.js": "sha256:9fabe2c846bb68bd7fd7ccf8a5327bc9d13497239be3b4ca2129b22663249950",
41
+ "plugin/rule-analytics-store.js": "sha256:3a6ee87abb372145562fd8a507d77f13df52fbdb728ebba3aeb6bcebc1bbae34",
42
+ "plugin/rule-analytics.js": "sha256:66819376ab5b11eb789080bfa83f5b9a1419c1864be7f21122c5ba856d741845",
43
+ "plugin/rule-engine.js": "sha256:b58abe02686283ebf44d2788a111cb5c138bc097a3a84fa75c6d67f230467334",
44
+ "plugin/rule-sharing.js": "sha256:5d44c494cd19b46d1c420ca8a17bdb19da4458419fa39ca071c49313132bfa10",
45
+ "plugin/rule-suggest.js": "sha256:005df78669b73ced70c84e5fbc157d19c424fd8aed50a91daec1af83dcf25b1e",
46
+ "plugin/session-start.js": "sha256:410963915c4898541dc828a3e786bc446dbc9393c5637221e32ff522b45ed559",
47
+ "plugin/smart-context.js": "sha256:f58ed474a05ed501a2641ac11337023ae12a04bcfe907ddad8dc511e7f88e0bc",
48
+ "shared/license.js": "sha256:54348bb2df7e74875e1f97b957442a47f089744479b7b8a4bc6e44d8cd2d02e6",
49
+ "shared/providers/claude-provider.js": "sha256:ee3a62e15a5f2505998ea34fe46c0a00e9a332ca92160aca32ce39b8e831d6ca",
50
+ "shared/providers/openai-provider.js": "sha256:20e157a0c364e565ca68b4e267c458c2a55edf716b0d5b8c2c80c11d2d950f6a",
51
+ "shared/token-counter.js": "sha256:040d2af98c7f30d6c6e19a19c11a7031d0b70ab1085721ad1b7c69b1781d6f97",
52
+ "shared/token-provider.js": "sha256:7e567f4b7f6c840c108c7cc9d296533f37965f829d8417f0d38615affe0dc2db",
53
53
  "shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
54
54
  }
55
55
  }
package/dist/mcp/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function _0x1e29(){const _0x5da4a9=['32BuAAKP','223590cWrLqN','BIFuQ','exit','error','tokenizer-speedup','8uqzXbQ','2673786chojvG','tokenizer-speedup\x20MCP\x20server\x20failed\x20to\x20start:','12bulSrk','7015851xWzoek','20440732tpLYYm','XLCgq','0.8.1','getDispatcher','connect','511329UgJHfn','handleSessionStop','33rVGyRt','SIGINT','5gnRbTD','12933eVqxXT','552HwJOxH','96179GmyiPg'];_0x1e29=function(){return _0x5da4a9;};return _0x1e29();}(function(_0x1a2ea9,_0x31a05e){const _0x150cb0=_0x14e3,_0x336364=_0x1a2ea9();while(!![]){try{const _0x5ceba5=parseInt(_0x150cb0(0x162))/0x1*(-parseInt(_0x150cb0(0x169))/0x2)+parseInt(_0x150cb0(0x160))/0x3*(-parseInt(_0x150cb0(0x161))/0x4)+-parseInt(_0x150cb0(0x15f))/0x5*(parseInt(_0x150cb0(0x16a))/0x6)+-parseInt(_0x150cb0(0x15b))/0x7*(parseInt(_0x150cb0(0x163))/0x8)+parseInt(_0x150cb0(0x16d))/0x9+-parseInt(_0x150cb0(0x164))/0xa*(parseInt(_0x150cb0(0x15d))/0xb)+parseInt(_0x150cb0(0x16c))/0xc*(parseInt(_0x150cb0(0x16e))/0xd);if(_0x5ceba5===_0x31a05e)break;else _0x336364['push'](_0x336364['shift']());}catch(_0x2be624){_0x336364['push'](_0x336364['shift']());}}}(_0x1e29,0x8a84d));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';function _0x14e3(_0x2b840f,_0xb63af2){_0x2b840f=_0x2b840f-0x158;const _0x1e2922=_0x1e29();let _0x14e3ea=_0x1e2922[_0x2b840f];return _0x14e3ea;}import{createSession}from'./session.js';import{registerTools}from'./tools.js';import{registerResources}from'./resources.js';async function main(){const _0x560610=_0x14e3,_0x2ed959={'yDDOD':_0x560610(0x158),'FnBDZ':function(_0x3591d0,_0x1fde73,_0x2ed789){return _0x3591d0(_0x1fde73,_0x2ed789);},'BIFuQ':_0x560610(0x15e)},_0x11bddf=new McpServer({'name':_0x560610(0x168),'version':_0x2ed959['yDDOD']}),_0x237dae=createSession();_0x2ed959['FnBDZ'](registerTools,_0x11bddf,_0x237dae),registerResources(_0x11bddf,_0x237dae),process['on'](_0x2ed959[_0x560610(0x165)],()=>{const _0x511202=_0x560610;try{_0x237dae[_0x511202(0x159)]()[_0x511202(0x15c)]();}catch{}process[_0x511202(0x166)](0x0);});const _0x1101e9=new StdioServerTransport();await _0x11bddf[_0x560610(0x15a)](_0x1101e9),console[_0x560610(0x167)]('tokenizer-speedup\x20MCP\x20server\x20running');}main()['catch'](_0x2a2dbe=>{const _0x2cf9e7=_0x14e3,_0x4d5552={'XLCgq':_0x2cf9e7(0x16b)};console['error'](_0x4d5552[_0x2cf9e7(0x16f)],_0x2a2dbe),process[_0x2cf9e7(0x166)](0x1);});
2
+ const _0xa22ce7=_0x187f;(function(_0x5eb17c,_0x5925af){const _0x500426=_0x187f,_0x56d3d2=_0x5eb17c();while(!![]){try{const _0x26b183=-parseInt(_0x500426(0x13e))/0x1+-parseInt(_0x500426(0x13b))/0x2*(parseInt(_0x500426(0x136))/0x3)+-parseInt(_0x500426(0x139))/0x4*(parseInt(_0x500426(0x13a))/0x5)+-parseInt(_0x500426(0x135))/0x6+parseInt(_0x500426(0x131))/0x7*(-parseInt(_0x500426(0x141))/0x8)+parseInt(_0x500426(0x12f))/0x9*(parseInt(_0x500426(0x13f))/0xa)+parseInt(_0x500426(0x130))/0xb;if(_0x26b183===_0x5925af)break;else _0x56d3d2['push'](_0x56d3d2['shift']());}catch(_0x42d05b){_0x56d3d2['push'](_0x56d3d2['shift']());}}}(_0x5720,0xae5d2));import'../shared/providers/claude-provider.js';function _0x5720(){const _0x59c098=['handleSessionStop','getDispatcher','57395NzxZJU','1328330YhOJiM','nCFME','13168opdrrM','tokenizer-speedup\x20MCP\x20server\x20running','81CtLvDW','36278396qfLqnY','5782BvxXyT','error','tokenizer-speedup\x20MCP\x20server\x20failed\x20to\x20start:','DLkGm','4523478GFkNrJ','2550699RLAsrk','catch','0.8.1','12rVDvjb','1263670SJioFK','2WeBulu'];_0x5720=function(){return _0x59c098;};return _0x5720();}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';function _0x187f(_0x33ebee,_0x3a7124){_0x33ebee=_0x33ebee-0x12e;const _0x572003=_0x5720();let _0x187f21=_0x572003[_0x33ebee];return _0x187f21;}async function main(){const _0x16687d=_0x187f,_0xdfa7f5={'txlJF':'tokenizer-speedup','DVbeL':_0x16687d(0x138),'nCFME':function(_0x46bd82){return _0x46bd82();},'DLkGm':function(_0x417bdc,_0x1e68c5,_0x6287cc){return _0x417bdc(_0x1e68c5,_0x6287cc);}},_0x1d332b=new McpServer({'name':_0xdfa7f5['txlJF'],'version':_0xdfa7f5['DVbeL']}),_0x1aa642=_0xdfa7f5[_0x16687d(0x140)](createSession);registerTools(_0x1d332b,_0x1aa642),_0xdfa7f5[_0x16687d(0x134)](registerResources,_0x1d332b,_0x1aa642),process['on']('SIGINT',()=>{const _0x18018a=_0x16687d;try{_0x1aa642[_0x18018a(0x13d)]()[_0x18018a(0x13c)]();}catch{}process['exit'](0x0);});const _0x171f7f=new StdioServerTransport();await _0x1d332b['connect'](_0x171f7f),console[_0x16687d(0x132)](_0x16687d(0x12e));}main()[_0xa22ce7(0x137)](_0x5abf7c=>{const _0x19d2ab=_0xa22ce7,_0x4f7c6e={'pJIVT':_0x19d2ab(0x133)};console['error'](_0x4f7c6e['pJIVT'],_0x5abf7c),process['exit'](0x1);});
@@ -1 +1 @@
1
- (function(_0x5900f6,_0x1e9b0c){const _0x5850e4=_0x47f9,_0x306a76=_0x5900f6();while(!![]){try{const _0x21effc=-parseInt(_0x5850e4(0xc2))/0x1+parseInt(_0x5850e4(0xc4))/0x2+-parseInt(_0x5850e4(0xcd))/0x3*(-parseInt(_0x5850e4(0xbd))/0x4)+parseInt(_0x5850e4(0xbf))/0x5+parseInt(_0x5850e4(0xc1))/0x6*(parseInt(_0x5850e4(0xca))/0x7)+parseInt(_0x5850e4(0xce))/0x8*(-parseInt(_0x5850e4(0xc9))/0x9)+parseInt(_0x5850e4(0xc5))/0xa;if(_0x21effc===_0x1e9b0c)break;else _0x306a76['push'](_0x306a76['shift']());}catch(_0x1e170f){_0x306a76['push'](_0x306a76['shift']());}}}(_0x1cad,0x5904b));function _0x47f9(_0x2dcb35,_0x241ba6){_0x2dcb35=_0x2dcb35-0xbd;const _0x1cad69=_0x1cad();let _0x47f9f8=_0x1cad69[_0x2dcb35];return _0x47f9f8;}function _0x1cad(){const _0x2ac52a=['getConfig','2108110pEwEpj','stringify','102JbRkpq','483665oUeDZD','TokenizerSpeedUp\x20Configuration','854368cOKoPQ','519900YiZQLf','application/json','tokenizer-speedup://report','HpmMy','9009xwfDxu','176568NFiHgT','projectRoot','FKWOM','3sTByUw','4208FpLTgE','href','registerResource','report','180824jRZBPe'];_0x1cad=function(){return _0x2ac52a;};return _0x1cad();}import{generateReport}from'../plugin/report.js';export function registerResources(_0x2403b3,_0x2c19ab){const _0x2c364f=_0x47f9,_0x37b6de={'FKWOM':'tokenizer-speedup://config','KISJf':_0x2c364f(0xc3),'PXgfT':_0x2c364f(0xc6),'HpmMy':_0x2c364f(0xd1),'VzMjn':_0x2c364f(0xc7),'OyIIg':'TokenizerSpeedUp\x20Savings\x20Report'};_0x2403b3['registerResource']('config',_0x37b6de[_0x2c364f(0xcc)],{'title':_0x37b6de['KISJf'],'description':'Returns\x20the\x20current\x20YAML-based\x20plugin\x20configuration\x20as\x20JSON,\x20including\x20rules,\x20context\x20limits,\x20and\x20metering\x20settings.','mimeType':_0x37b6de['PXgfT']},async _0x490bb6=>{const _0x6388e=_0x2c364f,_0x5cee98=_0x2c19ab[_0x6388e(0xbe)]();return{'contents':[{'uri':_0x490bb6['href'],'text':JSON['stringify'](_0x5cee98,null,0x2)}]};}),_0x2403b3[_0x2c364f(0xd0)](_0x37b6de[_0x2c364f(0xc8)],_0x37b6de['VzMjn'],{'title':_0x37b6de['OyIIg'],'description':'Returns\x20an\x20aggregated\x20report\x20of\x20token\x20savings\x20across\x20all\x20recorded\x20sessions,\x20including\x20baseline\x20vs.\x20optimized\x20counts,\x20cost\x20estimates,\x20and\x20rule\x20trigger\x20statistics.','mimeType':_0x2c364f(0xc6)},async _0x388281=>{const _0x3438ef=_0x2c364f;try{const _0xa4009d=generateReport(_0x2c19ab[_0x3438ef(0xcb)]);return{'contents':[{'uri':_0x388281[_0x3438ef(0xcf)],'text':JSON['stringify'](_0xa4009d,null,0x2)}]};}catch{return{'contents':[{'uri':_0x388281[_0x3438ef(0xcf)],'text':JSON[_0x3438ef(0xc0)]({'message':'No\x20metrics\x20data\x20available\x20yet.\x20Run\x20at\x20least\x20one\x20optimized\x20session\x20to\x20generate\x20a\x20report.','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)}]};}});}
1
+ (function(_0x389ef5,_0x803457){const _0x13da4f=_0x530e,_0x1a9db5=_0x389ef5();while(!![]){try{const _0x12a50e=parseInt(_0x13da4f(0x1a0))/0x1*(-parseInt(_0x13da4f(0x1a3))/0x2)+-parseInt(_0x13da4f(0x1a1))/0x3*(parseInt(_0x13da4f(0x1a6))/0x4)+parseInt(_0x13da4f(0x1a8))/0x5*(-parseInt(_0x13da4f(0x19c))/0x6)+-parseInt(_0x13da4f(0x196))/0x7*(-parseInt(_0x13da4f(0x19d))/0x8)+-parseInt(_0x13da4f(0x19b))/0x9+-parseInt(_0x13da4f(0x1a4))/0xa*(parseInt(_0x13da4f(0x1a5))/0xb)+parseInt(_0x13da4f(0x197))/0xc;if(_0x12a50e===_0x803457)break;else _0x1a9db5['push'](_0x1a9db5['shift']());}catch(_0x204475){_0x1a9db5['push'](_0x1a9db5['shift']());}}}(_0x23c2,0x995e6));import{generateReport}from'../plugin/report.js';function _0x530e(_0x29c83c,_0x25c5f7){_0x29c83c=_0x29c83c-0x196;const _0x23c204=_0x23c2();let _0x530e54=_0x23c204[_0x29c83c];return _0x530e54;}export function registerResources(_0x1bbd4c,_0x583d75){const _0x7229bd=_0x530e,_0x38c9e7={'BaVvd':function(_0x487248,_0x35ce61){return _0x487248(_0x35ce61);},'wmYsw':'config','FHBfj':'application/json','vifyD':_0x7229bd(0x198)};_0x1bbd4c[_0x7229bd(0x19f)](_0x38c9e7['wmYsw'],_0x7229bd(0x1a7),{'title':'TokenizerSpeedUp\x20Configuration','description':'Returns\x20the\x20current\x20YAML-based\x20plugin\x20configuration\x20as\x20JSON,\x20including\x20rules,\x20context\x20limits,\x20and\x20metering\x20settings.','mimeType':_0x38c9e7[_0x7229bd(0x19a)]},async _0x1d4ffc=>{const _0x4eb657=_0x7229bd,_0x43535c=_0x583d75[_0x4eb657(0x199)]();return{'contents':[{'uri':_0x1d4ffc[_0x4eb657(0x1a2)],'text':JSON[_0x4eb657(0x19e)](_0x43535c,null,0x2)}]};}),_0x1bbd4c[_0x7229bd(0x19f)](_0x38c9e7['vifyD'],'tokenizer-speedup://report',{'title':_0x7229bd(0x1a9),'description':'Returns\x20an\x20aggregated\x20report\x20of\x20token\x20savings\x20across\x20all\x20recorded\x20sessions,\x20including\x20baseline\x20vs.\x20optimized\x20counts,\x20cost\x20estimates,\x20and\x20rule\x20trigger\x20statistics.','mimeType':_0x38c9e7['FHBfj']},async _0x23e2c1=>{const _0x19dfe2=_0x7229bd;try{const _0x8ced48=_0x38c9e7['BaVvd'](generateReport,_0x583d75['projectRoot']);return{'contents':[{'uri':_0x23e2c1['href'],'text':JSON[_0x19dfe2(0x19e)](_0x8ced48,null,0x2)}]};}catch{return{'contents':[{'uri':_0x23e2c1['href'],'text':JSON[_0x19dfe2(0x19e)]({'message':'No\x20metrics\x20data\x20available\x20yet.\x20Run\x20at\x20least\x20one\x20optimized\x20session\x20to\x20generate\x20a\x20report.','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)}]};}});}function _0x23c2(){const _0x222bbc=['6oBEWcC','3992ZtuwLu','stringify','registerResource','2doObIh','1340664kbSddn','href','408406wuifjE','10qgIpCO','12904364sRCpkZ','8cKpnBg','tokenizer-speedup://config','5996755qXNzXp','TokenizerSpeedUp\x20Savings\x20Report','16639lKDstg','43195128YTFUGl','report','getConfig','FHBfj','4345758plHndy'];_0x23c2=function(){return _0x222bbc;};return _0x23c2();}
@@ -1 +1 @@
1
- function _0x4059(){const _0x2e5c96=['6447ZZcbDP','1055591kYiMRD','8532eoyKBD','cwd','15wKWTWU','24657804UXdDiS','5716536kMIdmE','5641156GAJCJg','now','model','mcp-session-','provider','14548CIjNwA','1637335VgbcCs'];_0x4059=function(){return _0x2e5c96;};return _0x4059();}(function(_0x329b74,_0x1a919a){const _0x1fc1d2=_0x3d0d,_0x4ef94f=_0x329b74();while(!![]){try{const _0x161611=parseInt(_0x1fc1d2(0x166))/0x1+-parseInt(_0x1fc1d2(0x163))/0x2*(-parseInt(_0x1fc1d2(0x169))/0x3)+-parseInt(_0x1fc1d2(0x16c))/0x4+parseInt(_0x1fc1d2(0x164))/0x5+-parseInt(_0x1fc1d2(0x167))/0x6*(parseInt(_0x1fc1d2(0x165))/0x7)+-parseInt(_0x1fc1d2(0x16b))/0x8+parseInt(_0x1fc1d2(0x16a))/0x9;if(_0x161611===_0x1a919a)break;else _0x4ef94f['push'](_0x4ef94f['shift']());}catch(_0x307648){_0x4ef94f['push'](_0x4ef94f['shift']());}}}(_0x4059,0xb0eba));import{loadConfig,DEFAULT_LIMITS,DEFAULT_METERING}from'../plugin/config-loader.js';import{HookDispatcher}from'../plugin/hook-dispatcher.js';function _0x3d0d(_0x780575,_0x105ea8){_0x780575=_0x780575-0x160;const _0x405913=_0x4059();let _0x3d0de9=_0x405913[_0x780575];return _0x3d0de9;}import{MetricsCollector}from'../plugin/metrics-collector.js';import{createTokenProvider}from'../shared/token-provider.js';const DEFAULT_CONFIG={'version':0x1,'provider':'claude','model':'claude-sonnet-4-20250514','rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};export function createSession(_0x5f3924){const _0x568564=_0x3d0d,_0x57c6c8={'ftVrv':function(_0x335d3b,_0x221fb4){return _0x335d3b(_0x221fb4);}};let _0x23ca8d=_0x5f3924??process[_0x568564(0x168)](),_0x531115=null,_0x1168da=null;const _0x353dac=_0x568564(0x161)+Date[_0x568564(0x16d)]();let _0x1e2f94=new MetricsCollector(_0x23ca8d,_0x353dac);const _0xd65fea={get 'projectRoot'(){return _0x23ca8d;},get 'config'(){return _0x531115;},get 'collector'(){return _0x1e2f94;},get 'sessionId'(){return _0x353dac;},'getConfig':()=>(_0x531115||(_0x531115=(function(){try{return _0x57c6c8['ftVrv'](loadConfig,_0x23ca8d);}catch{return structuredClone(DEFAULT_CONFIG);}}())),_0x531115),'getDispatcher'(){if(!_0x1168da){const _0x235c35=_0xd65fea['getConfig']();_0x1168da=new HookDispatcher(_0x235c35,_0x23ca8d,_0x353dac);}return _0x1168da;},'getTokenProvider'(_0x2a40d3,_0x2736b5){const _0x224347=_0x568564,_0x510e22=_0xd65fea['getConfig']();return createTokenProvider(_0x2a40d3??_0x510e22[_0x224347(0x162)],_0x2736b5??_0x510e22[_0x224347(0x160)]);},'setProjectRoot'(_0x5454d0){_0x23ca8d=_0x5454d0,_0x531115=null,_0x1168da=null,_0x1e2f94=new MetricsCollector(_0x23ca8d,_0x353dac);}};return _0xd65fea;}
1
+ (function(_0x32eb0c,_0x55a02e){const _0x3cab66=_0x3e8b,_0x33a719=_0x32eb0c();while(!![]){try{const _0x2ce3c8=-parseInt(_0x3cab66(0x6e))/0x1+-parseInt(_0x3cab66(0x72))/0x2*(parseInt(_0x3cab66(0x6d))/0x3)+parseInt(_0x3cab66(0x6b))/0x4*(parseInt(_0x3cab66(0x67))/0x5)+parseInt(_0x3cab66(0x66))/0x6*(-parseInt(_0x3cab66(0x6f))/0x7)+-parseInt(_0x3cab66(0x71))/0x8*(-parseInt(_0x3cab66(0x65))/0x9)+-parseInt(_0x3cab66(0x6c))/0xa+parseInt(_0x3cab66(0x70))/0xb;if(_0x2ce3c8===_0x55a02e)break;else _0x33a719['push'](_0x33a719['shift']());}catch(_0x580c8c){_0x33a719['push'](_0x33a719['shift']());}}}(_0x32ba,0x9cde1));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';function _0x3e8b(_0x28d737,_0x4282da){_0x28d737=_0x28d737-0x64;const _0x32bafa=_0x32ba();let _0x3e8b6a=_0x32bafa[_0x28d737];return _0x3e8b6a;}const DEFAULT_CONFIG={'version':0x1,'provider':'claude','model':'claude-sonnet-4-20250514','rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};function _0x32ba(){const _0x2ffac8=['26963123vDOtee','1102936qZFgWh','298KfXmRp','mcp-session-','27LgluyZ','6uIpmsW','652870cVGwbM','cwd','model','getConfig','4Hdvphr','8295300YXhJyJ','12885fbHVAu','776127byUKls','750589foovyr'];_0x32ba=function(){return _0x2ffac8;};return _0x32ba();}export function createSession(_0x1a975e){const _0x3fe884=_0x3e8b;let _0x1cde84=_0x1a975e??process[_0x3fe884(0x68)](),_0xa0653=null,_0x320b56=null;const _0x207e46=_0x3fe884(0x64)+Date['now']();let _0x2698ee=new MetricsCollector(_0x1cde84,_0x207e46);const _0x23a0e4={get 'projectRoot'(){return _0x1cde84;},get 'config'(){return _0xa0653;},get 'collector'(){return _0x2698ee;},get 'sessionId'(){return _0x207e46;},'getConfig':()=>(_0xa0653||(_0xa0653=(function(){try{return loadConfig(_0x1cde84);}catch{return structuredClone(DEFAULT_CONFIG);}}())),_0xa0653),'getDispatcher'(){if(!_0x320b56){const _0x3de98a=_0x23a0e4['getConfig']();_0x320b56=new HookDispatcher(_0x3de98a,_0x1cde84,_0x207e46);}return _0x320b56;},'getTokenProvider'(_0x337749,_0xfa14ee){const _0x3bb960=_0x3fe884,_0x10015c=_0x23a0e4[_0x3bb960(0x6a)]();return createTokenProvider(_0x337749??_0x10015c['provider'],_0xfa14ee??_0x10015c[_0x3bb960(0x69)]);},'setProjectRoot'(_0x5aebaa){_0x1cde84=_0x5aebaa,_0xa0653=null,_0x320b56=null,_0x2698ee=new MetricsCollector(_0x1cde84,_0x207e46);}};return _0x23a0e4;}
package/dist/mcp/tools.js CHANGED
@@ -1 +1 @@
1
- (function(_0x496cb2,_0xbb23a4){const _0x54b8f3=_0x6d54,_0x2f74c0=_0x496cb2();while(!![]){try{const _0x1919a0=parseInt(_0x54b8f3(0xb6))/0x1+parseInt(_0x54b8f3(0xe6))/0x2*(parseInt(_0x54b8f3(0xe4))/0x3)+parseInt(_0x54b8f3(0xbf))/0x4+parseInt(_0x54b8f3(0xd1))/0x5+-parseInt(_0x54b8f3(0xd0))/0x6+-parseInt(_0x54b8f3(0xcd))/0x7*(-parseInt(_0x54b8f3(0xc1))/0x8)+-parseInt(_0x54b8f3(0xba))/0x9;if(_0x1919a0===_0xbb23a4)break;else _0x2f74c0['push'](_0x2f74c0['shift']());}catch(_0x90ef23){_0x2f74c0['push'](_0x2f74c0['shift']());}}}(_0xd1a5,0xbc538));function _0x6d54(_0x259a54,_0x1c724f){_0x259a54=_0x259a54-0xb6;const _0xd1a5b2=_0xd1a5();let _0x6d542c=_0xd1a5b2[_0x259a54];return _0x6d542c;}import{readFile}from'node:fs/promises';import{resolve,normalize}from'node:path';import{z}from'zod';import{countTokens}from'../shared/token-counter.js';function _0xd1a5(){const _0x2cff3b=['matchAll','4729500UACncb','3655285GVyQtK','setProjectRoot','UwBsX','qyYGY','vjkjM','getConfig','getDispatcher','Failed\x20to\x20read\x20file:\x20','Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.','word\x20heuristic\x20(words\x20×\x20','registerTool','TGIFU','string','PAtKX','LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','additionalContext','uBICv','handleUserPromptSubmit','xGkqu','9xUNMFg','Inline\x20text\x20to\x20analyze','369676eZsGYP','sessionId','Kczrf','Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','600650UenpGI','savings_percent','total_optimized','text','12391020CjudgO','optimize-context','UserPromptSubmit','describe','provider','1675956GoTbWl','optional','1262408GNwTfu','xGTaX','startsWith','ehehQ','stringify','getSessionSummary','total_baseline','projectRoot','The\x20user\x20prompt\x20to\x20optimize','1.4','openai','Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.','28aiHzNR','Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided'];_0xd1a5=function(){return _0x2cff3b;};return _0xd1a5();}export function registerTools(_0x4a59c0,_0x1bfed4){const _0x495763=_0x6d54,_0x289a99={'ehehQ':function(_0x477772,_0x135be3){return _0x477772-_0x135be3;},'vjkjM':function(_0x4e998b,_0xe28e8c){return _0x4e998b(_0xe28e8c);},'UwBsX':function(_0x308a44,_0x661c74){return _0x308a44===_0x661c74;},'PAtKX':function(_0x3e86f3,_0x5c0472,_0xcf06cc){return _0x3e86f3(_0x5c0472,_0xcf06cc);},'uEivv':'utf-8','uBICv':function(_0x5038bb,_0x4794e0){return _0x5038bb instanceof _0x4794e0;},'YsuaH':function(_0x2d6259,_0x112970){return _0x2d6259(_0x112970);},'TGIFU':'text','fCYeT':'BPE\x20tokenizer\x20(accurate)','xGTaX':'1.3','spsyk':_0x495763(0xca),'xGkqu':'analyze-tokens','qyYGY':_0x495763(0xe9),'Kczrf':_0x495763(0xe5),'sHJqY':_0x495763(0xdf),'GGzSK':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','CxEsv':_0x495763(0xcc)};_0x4a59c0[_0x495763(0xdb)](_0x495763(0xbb),{'description':'Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','inputSchema':{'prompt':z['string']()[_0x495763(0xbd)](_0x495763(0xc9)),'project_path':z['string']()[_0x495763(0xc0)]()[_0x495763(0xbd)](_0x495763(0xce))}},async({prompt:_0x5026a1,project_path:_0x1ec650})=>{const _0xa58e7a=_0x495763;_0x1ec650&&_0x1bfed4[_0xa58e7a(0xd2)](_0x1ec650);const _0x19131a=_0x1bfed4[_0xa58e7a(0xd7)](),_0x3d2972=_0x19131a[_0xa58e7a(0xc6)](),_0x87fe2c={'session_id':_0x1bfed4[_0xa58e7a(0xe7)],'cwd':_0x1bfed4[_0xa58e7a(0xc8)],'prompt':_0x5026a1,'hook_event_name':_0xa58e7a(0xbc)},_0x51d86c=_0x19131a[_0xa58e7a(0xe2)](_0x87fe2c),_0x1717e2=_0x289a99[_0xa58e7a(0xc4)](_0x19131a['getSessionSummary']()['total_delta'],_0x3d2972['total_delta']),_0xc9ded9=_0x51d86c[_0xa58e7a(0xe0)]??'',_0x290a46=_0xc9ded9['length']>0x0?_0x289a99[_0xa58e7a(0xd5)](countTokens,_0xc9ded9):0x0,_0x275a0a=[..._0xc9ded9[_0xa58e7a(0xcf)](/^\[([^\]]+)\]/gm)]['map'](_0x399824=>_0x399824[0x1]),_0x3c8074={'context':_0xc9ded9,'rules_matched':_0x275a0a,'tokens_injected':_0x290a46,'tokens_saved':_0x1717e2};return{'content':[{'type':_0xa58e7a(0xb9),'text':JSON['stringify'](_0x3c8074)}]};}),_0x4a59c0[_0x495763(0xdb)](_0x289a99[_0x495763(0xe3)],{'description':_0x289a99[_0x495763(0xd4)],'inputSchema':{'text':z['string']()[_0x495763(0xc0)]()[_0x495763(0xbd)](_0x289a99[_0x495763(0xe8)]),'file_path':z['string']()[_0x495763(0xc0)]()['describe']('Path\x20to\x20a\x20file\x20to\x20analyze'),'provider':z['string']()['optional']()[_0x495763(0xbd)](_0x289a99['sHJqY']),'model':z[_0x495763(0xdd)]()['optional']()['describe'](_0x289a99['GGzSK'])}},async({text:_0x514acf,file_path:_0xc015c7,provider:_0x3c6431,model:_0x2465a8})=>{const _0x269dba=_0x495763;if(_0x289a99[_0x269dba(0xd3)](void 0x0,_0x514acf)&&void 0x0===_0xc015c7)return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x269dba(0xd9)})}],'isError':!0x0};const _0xdeb906=_0x3c6431??_0x1bfed4[_0x269dba(0xd6)]()[_0x269dba(0xbe)],_0x5843f9=_0x2465a8??(_0x269dba(0xcb)===_0xdeb906?'gpt-4o':_0x1bfed4[_0x269dba(0xd6)]()['model']);let _0x517d48,_0x1b6fe3;try{_0x517d48=_0x1bfed4['getTokenProvider'](_0xdeb906,_0x5843f9);}catch(_0x2ff7f2){const _0x3cafe0=_0x2ff7f2 instanceof Error?_0x2ff7f2['message']:String(_0x2ff7f2);return{'content':[{'type':'text','text':JSON['stringify']({'error':_0x3cafe0})}],'isError':!0x0};}if(void 0x0!==_0x514acf)_0x1b6fe3=_0x514acf;else{const _0x12db3e=_0x289a99['vjkjM'](normalize,_0x1bfed4['projectRoot']),_0xfbd007=normalize(resolve(_0x12db3e,_0xc015c7));if(!_0xfbd007[_0x269dba(0xc3)](_0x12db3e))return{'content':[{'type':_0x269dba(0xb9),'text':JSON['stringify']({'error':'file_path\x20escapes\x20project\x20root.'})}],'isError':!0x0};try{_0x1b6fe3=await _0x289a99[_0x269dba(0xde)](readFile,_0xfbd007,_0x289a99['uEivv']);}catch(_0x2078e8){const _0x1c1941=_0x289a99[_0x269dba(0xe1)](_0x2078e8,Error)?_0x2078e8['message']:_0x289a99['YsuaH'](String,_0x2078e8);return{'content':[{'type':_0x289a99['TGIFU'],'text':JSON['stringify']({'error':_0x269dba(0xd8)+_0x1c1941})}],'isError':!0x0};}}const _0x3b81ef={'tokens':_0x517d48['countTokens'](_0x1b6fe3),'tokens_method':_0x289a99['fCYeT'],'estimate':_0x517d48['estimateTokens'](_0x1b6fe3),'estimate_method':_0x269dba(0xda)+(_0x289a99['UwBsX'](_0x269dba(0xcb),_0xdeb906)?_0x289a99[_0x269dba(0xc2)]:_0x289a99['spsyk'])+')','provider':_0xdeb906,'model':_0x5843f9};return{'content':[{'type':_0x289a99[_0x269dba(0xdc)],'text':JSON['stringify'](_0x3b81ef)}]};}),_0x4a59c0[_0x495763(0xdb)]('get-savings',{'description':_0x289a99['CxEsv']},async()=>{const _0x2a9bf5=_0x495763,_0x495994=_0x1bfed4['getDispatcher']()[_0x2a9bf5(0xc6)](),_0x22b9ac={'baseline_tokens':_0x495994[_0x2a9bf5(0xc7)],'optimized_tokens':_0x495994[_0x2a9bf5(0xb8)],'saved_tokens':_0x495994['total_delta'],'saved_percent':_0x495994[_0x2a9bf5(0xb7)],'prompts_count':_0x495994['prompts_count'],'rules_triggered':_0x495994['rules_triggered']};return{'content':[{'type':'text','text':JSON[_0x2a9bf5(0xc5)](_0x22b9ac)}]};});}
1
+ (function(_0x447021,_0x318fb9){const _0x29ff13=_0x52ad,_0x3c7a62=_0x447021();while(!![]){try{const _0x46a020=-parseInt(_0x29ff13(0x7f))/0x1+-parseInt(_0x29ff13(0x96))/0x2+-parseInt(_0x29ff13(0x99))/0x3+-parseInt(_0x29ff13(0x8b))/0x4+-parseInt(_0x29ff13(0x6f))/0x5+parseInt(_0x29ff13(0x76))/0x6+parseInt(_0x29ff13(0x9f))/0x7;if(_0x46a020===_0x318fb9)break;else _0x3c7a62['push'](_0x3c7a62['shift']());}catch(_0xee0444){_0x3c7a62['push'](_0x3c7a62['shift']());}}}(_0x164a,0xca592));import{readFile}from'node:fs/promises';import{resolve,normalize}from'node:path';import{z}from'zod';import{countTokens}from'../shared/token-counter.js';function _0x52ad(_0x27b13b,_0x5eba6b){_0x27b13b=_0x27b13b-0x6e;const _0x164aea=_0x164a();let _0x52ad9d=_0x164aea[_0x27b13b];return _0x52ad9d;}export function registerTools(_0x2dd2f1,_0x2e7616){const _0x4853fd=_0x52ad,_0x4de409={'eNYNH':'UserPromptSubmit','KhsTv':function(_0x4d0e68,_0x3cd142){return _0x4d0e68>_0x3cd142;},'rjkXl':'text','NGjfr':function(_0x15f120,_0x541ea3){return _0x15f120===_0x541ea3;},'XRofW':_0x4853fd(0x78),'XPExV':'gpt-4o','eGujG':function(_0x2a49c4,_0x3f9867){return _0x2a49c4 instanceof _0x3f9867;},'INdmj':function(_0x29579c,_0x2e2c9a){return _0x29579c(_0x2e2c9a);},'FWpGV':function(_0x1e46b7,_0x4f6422){return _0x1e46b7!==_0x4f6422;},'LEbLg':function(_0x4bf039,_0x1de6ae){return _0x4bf039 instanceof _0x1de6ae;},'pcWZZ':_0x4853fd(0x87),'FrkIZ':'optimize-context','CYXUw':'Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided','ssgNC':'analyze-tokens','hyMsd':'Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','jBMKn':'LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','Oisoc':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','GvZWA':'get-savings'};_0x2dd2f1['registerTool'](_0x4de409['FrkIZ'],{'description':'Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','inputSchema':{'prompt':z['string']()['describe'](_0x4853fd(0x97)),'project_path':z[_0x4853fd(0x79)]()[_0x4853fd(0x83)]()[_0x4853fd(0x84)](_0x4de409[_0x4853fd(0x8c)])}},async({prompt:_0x145465,project_path:_0x16bd32})=>{const _0x577156=_0x4853fd;_0x16bd32&&_0x2e7616[_0x577156(0x6e)](_0x16bd32);const _0x3cd099=_0x2e7616[_0x577156(0x89)](),_0x336559=_0x3cd099[_0x577156(0x93)](),_0x73caa7={'session_id':_0x2e7616['sessionId'],'cwd':_0x2e7616[_0x577156(0x86)],'prompt':_0x145465,'hook_event_name':_0x4de409[_0x577156(0x9c)]},_0x41e412=_0x3cd099['handleUserPromptSubmit'](_0x73caa7),_0x143e9f=_0x3cd099['getSessionSummary']()['total_delta']-_0x336559[_0x577156(0x70)],_0xdf584c=_0x41e412[_0x577156(0x94)]??'',_0x58d60e=_0x4de409[_0x577156(0x88)](_0xdf584c[_0x577156(0x7c)],0x0)?countTokens(_0xdf584c):0x0,_0x4a1c05=[..._0xdf584c[_0x577156(0x71)](/^\[([^\]]+)\]/gm)]['map'](_0x98b1d1=>_0x98b1d1[0x1]),_0x193b32={'context':_0xdf584c,'rules_matched':_0x4a1c05,'tokens_injected':_0x58d60e,'tokens_saved':_0x143e9f};return{'content':[{'type':_0x4de409[_0x577156(0xa0)],'text':JSON['stringify'](_0x193b32)}]};}),_0x2dd2f1[_0x4853fd(0x7d)](_0x4de409[_0x4853fd(0x90)],{'description':_0x4de409[_0x4853fd(0x8f)],'inputSchema':{'text':z['string']()['optional']()['describe'](_0x4853fd(0x8e)),'file_path':z['string']()['optional']()['describe'](_0x4853fd(0x72)),'provider':z['string']()[_0x4853fd(0x83)]()['describe'](_0x4de409[_0x4853fd(0x8d)]),'model':z[_0x4853fd(0x79)]()[_0x4853fd(0x83)]()['describe'](_0x4de409['Oisoc'])}},async({text:_0x2d5ddf,file_path:_0x50d393,provider:_0x2490cc,model:_0x437516})=>{const _0x4ea3ea=_0x4853fd;if(_0x4de409[_0x4ea3ea(0x7b)](void 0x0,_0x2d5ddf)&&void 0x0===_0x50d393)return{'content':[{'type':_0x4ea3ea(0x9e),'text':JSON[_0x4ea3ea(0x74)]({'error':_0x4ea3ea(0x9d)})}],'isError':!0x0};const _0x4ddf29=_0x2490cc??_0x2e7616[_0x4ea3ea(0x98)]()[_0x4ea3ea(0x75)],_0x25fd6d=_0x437516??(_0x4de409[_0x4ea3ea(0x7b)](_0x4de409['XRofW'],_0x4ddf29)?_0x4de409['XPExV']:_0x2e7616['getConfig']()[_0x4ea3ea(0x9b)]);let _0x33dd89,_0x2e4196;try{_0x33dd89=_0x2e7616[_0x4ea3ea(0xa1)](_0x4ddf29,_0x25fd6d);}catch(_0x44359b){const _0x42b91d=_0x4de409[_0x4ea3ea(0x8a)](_0x44359b,Error)?_0x44359b['message']:_0x4de409[_0x4ea3ea(0x80)](String,_0x44359b);return{'content':[{'type':_0x4de409[_0x4ea3ea(0xa0)],'text':JSON[_0x4ea3ea(0x74)]({'error':_0x42b91d})}],'isError':!0x0};}if(_0x4de409['FWpGV'](void 0x0,_0x2d5ddf))_0x2e4196=_0x2d5ddf;else{const _0xe877b=normalize(_0x2e7616[_0x4ea3ea(0x86)]),_0x35f450=normalize(resolve(_0xe877b,_0x50d393));if(!_0x35f450['startsWith'](_0xe877b))return{'content':[{'type':_0x4de409[_0x4ea3ea(0xa0)],'text':JSON[_0x4ea3ea(0x74)]({'error':'file_path\x20escapes\x20project\x20root.'})}],'isError':!0x0};try{_0x2e4196=await readFile(_0x35f450,'utf-8');}catch(_0x1c36d6){const _0x28fbba=_0x4de409[_0x4ea3ea(0x95)](_0x1c36d6,Error)?_0x1c36d6['message']:String(_0x1c36d6);return{'content':[{'type':_0x4ea3ea(0x9e),'text':JSON[_0x4ea3ea(0x74)]({'error':_0x4ea3ea(0x82)+_0x28fbba})}],'isError':!0x0};}}const _0x480f53={'tokens':_0x33dd89['countTokens'](_0x2e4196),'tokens_method':_0x4ea3ea(0x85),'estimate':_0x33dd89[_0x4ea3ea(0x77)](_0x2e4196),'estimate_method':_0x4ea3ea(0x9a)+(_0x4ea3ea(0x78)===_0x4ddf29?_0x4ea3ea(0x81):_0x4de409[_0x4ea3ea(0x91)])+')','provider':_0x4ddf29,'model':_0x25fd6d};return{'content':[{'type':_0x4ea3ea(0x9e),'text':JSON[_0x4ea3ea(0x74)](_0x480f53)}]};}),_0x2dd2f1['registerTool'](_0x4de409[_0x4853fd(0x7a)],{'description':_0x4853fd(0x73)},async()=>{const _0x52d8ee=_0x4853fd,_0x212f2b=_0x2e7616['getDispatcher']()['getSessionSummary'](),_0xc9a0cf={'baseline_tokens':_0x212f2b['total_baseline'],'optimized_tokens':_0x212f2b[_0x52d8ee(0x92)],'saved_tokens':_0x212f2b[_0x52d8ee(0x70)],'saved_percent':_0x212f2b['savings_percent'],'prompts_count':_0x212f2b['prompts_count'],'rules_triggered':_0x212f2b[_0x52d8ee(0x7e)]};return{'content':[{'type':_0x52d8ee(0x9e),'text':JSON[_0x52d8ee(0x74)](_0xc9a0cf)}]};});}function _0x164a(){const _0x5b9dae=['length','registerTool','rules_triggered','437624xmBcFX','INdmj','1.3','Failed\x20to\x20read\x20file:\x20','optional','describe','BPE\x20tokenizer\x20(accurate)','projectRoot','1.4','KhsTv','getDispatcher','eGujG','2876284WThdEb','CYXUw','jBMKn','Inline\x20text\x20to\x20analyze','hyMsd','ssgNC','pcWZZ','total_optimized','getSessionSummary','additionalContext','LEbLg','2584246XgClHE','The\x20user\x20prompt\x20to\x20optimize','getConfig','226299ZvpBJb','word\x20heuristic\x20(words\x20×\x20','model','eNYNH','Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.','text','21389949fUtNMx','rjkXl','getTokenProvider','setProjectRoot','5335410mZvHpN','total_delta','matchAll','Path\x20to\x20a\x20file\x20to\x20analyze','Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.','stringify','provider','8186664Dgjvej','estimateTokens','openai','string','GvZWA','NGjfr'];_0x164a=function(){return _0x5b9dae;};return _0x164a();}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x29b02e=_0x1968;(function(_0x35a9d4,_0x2ed138){const _0x407989=_0x1968,_0x2be3c2=_0x35a9d4();while(!![]){try{const _0xff872a=parseInt(_0x407989(0x1f9))/0x1+parseInt(_0x407989(0x1f5))/0x2*(-parseInt(_0x407989(0x1f6))/0x3)+-parseInt(_0x407989(0x201))/0x4+-parseInt(_0x407989(0x203))/0x5+-parseInt(_0x407989(0x1ff))/0x6+-parseInt(_0x407989(0x1f1))/0x7+parseInt(_0x407989(0x1f2))/0x8;if(_0xff872a===_0x2ed138)break;else _0x2be3c2['push'](_0x2be3c2['shift']());}catch(_0x55a9c9){_0x2be3c2['push'](_0x2be3c2['shift']());}}}(_0x246b,0xaf4f5));import{resolve}from'node:path';import{loadConfig}from'./config-loader.js';function _0x1968(_0x1d0841,_0x5c1046){_0x1d0841=_0x1d0841-0x1ee;const _0x246be3=_0x246b();let _0x1968f4=_0x246be3[_0x1d0841];return _0x1968f4;}function _0x246b(){const _0x1ced9f=['utf-8','sHcmv','qcYOw','7387314yrYZAi','handleSessionStop','374096qQHGcm','Stop','6568895RyPaJl','../..','send','join','6973813mqkqwa','44601888qhrZFA','filter','zcwyE','349882FxtZSQ','21bjXMaR','parse','additionalContext','2201AMpIgj','write','exit'];_0x246b=function(){return _0x1ced9f;};return _0x246b();}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 _0x4e9620=_0x1968,_0x1d1061={'sHcmv':function(_0x3f5fdd,_0x53900a){return _0x3f5fdd(_0x53900a);},'ziZhA':function(_0x4d7247,_0xfe723,_0x27038a){return _0x4d7247(_0xfe723,_0x27038a);},'akNyC':_0x4e9620(0x1ee),'Ukvwp':'SessionStart','zcwyE':'UserPromptSubmit','qcYOw':function(_0xac4aed,_0x26d5e1){return _0xac4aed>_0x26d5e1;},'YNAnM':_0x4e9620(0x202)},_0xbaa56f=[];for await(const _0x1261b3 of process['stdin'])_0xbaa56f['push'](_0x1261b3);const _0x2b97dc=Buffer['concat'](_0xbaa56f)['toString'](_0x4e9620(0x1fc));let _0x140dbd;try{_0x140dbd=JSON[_0x4e9620(0x1f7)](_0x2b97dc);}catch{process['exit'](0x0);}const _0x2b1fe6=_0x140dbd['cwd']||process['cwd'](),_0x149e8f=_0x140dbd['hook_event_name'];let _0x7280c9;try{_0x7280c9=_0x1d1061['sHcmv'](loadConfig,_0x2b1fe6);}catch{const _0x3ffd81=process.env.CLAUDE_PLUGIN_ROOT||_0x1d1061['ziZhA'](resolve,import.meta.dirname,_0x1d1061['akNyC']);_0x7280c9=loadConfig(_0x3ffd81);}const _0xd90e57=new HookDispatcher(_0x7280c9,_0x2b1fe6,_0x140dbd['session_id']);let _0x39ed4d={};switch(_0x149e8f){case _0x1d1061['Ukvwp']:_0x39ed4d=_0x1d1061[_0x4e9620(0x1fd)](buildSessionStartContext,{'cwd':_0x2b1fe6});break;case _0x1d1061[_0x4e9620(0x1f4)]:{const _0x135e76=_0xd90e57['handleUserPromptSubmit'](_0x140dbd),_0x210094=buildSmartContext({'prompt':_0x140dbd['prompt']||'','cwd':_0x2b1fe6}),_0xcb29f0=[_0x135e76[_0x4e9620(0x1f8)],_0x210094['additionalContext']][_0x4e9620(0x1f3)](Boolean);_0x39ed4d=_0x1d1061[_0x4e9620(0x1fe)](_0xcb29f0['length'],0x0)?{'additionalContext':_0xcb29f0[_0x4e9620(0x1f0)]('\x0a')}:{};break;}case'PreCompact':_0x39ed4d=_0xd90e57['handlePreCompact'](_0x140dbd);break;case _0x1d1061['YNAnM']:{const _0x4d3b36=_0xd90e57[_0x4e9620(0x200)](),_0x450250=new MeteringClient(_0x7280c9['metering']['endpoint']),_0x3b6e0f=buildMeterPayload(_0x4d3b36,{'provider':_0x7280c9['provider'],'model':_0x7280c9['model']});await _0x450250[_0x4e9620(0x1ef)](_0x3b6e0f);break;}}process['stdout'][_0x4e9620(0x1fa)](JSON['stringify'](_0x39ed4d)),process['exit'](0x0);}main()['catch'](()=>process[_0x29b02e(0x1fb)](0x0));
2
+ const _0x198515=_0x21aa;function _0x28ef(){const _0x4034b3=['exit','model','30067128sZLVAX','NLnzv','tpCRk','1478UcSkLS','cwd','length','join','handleUserPromptSubmit','toString','3543wKAfNg','hook_event_name','endpoint','2439492kZOxhy','3654952fUrFrY','3891295gsRGiE','vabfw','6753292AXYfpJ','Stop','handlePreCompact','additionalContext','86020UMMPOZ','stdin','UserPromptSubmit','provider','catch'];_0x28ef=function(){return _0x4034b3;};return _0x28ef();}(function(_0x5d3986,_0xa357f5){const _0x3df509=_0x21aa,_0x46cc3e=_0x5d3986();while(!![]){try{const _0x348f7f=parseInt(_0x3df509(0x14a))/0x1+parseInt(_0x3df509(0x154))/0x2*(-parseInt(_0x3df509(0x13f))/0x3)+-parseInt(_0x3df509(0x143))/0x4+-parseInt(_0x3df509(0x144))/0x5+parseInt(_0x3df509(0x142))/0x6+-parseInt(_0x3df509(0x146))/0x7+parseInt(_0x3df509(0x151))/0x8;if(_0x348f7f===_0xa357f5)break;else _0x46cc3e['push'](_0x46cc3e['shift']());}catch(_0x70b29f){_0x46cc3e['push'](_0x46cc3e['shift']());}}}(_0x28ef,0xb0249));import{resolve}from'node:path';import{loadConfig}from'./config-loader.js';import{HookDispatcher}from'./hook-dispatcher.js';import{buildSessionStartContext}from'./session-start.js';function _0x21aa(_0x27769b,_0x104301){_0x27769b=_0x27769b-0x13b;const _0x28ef76=_0x28ef();let _0x21aaeb=_0x28ef76[_0x27769b];return _0x21aaeb;}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 _0x5c9930=_0x21aa,_0x2b5973={'nAgON':'utf-8','tpCRk':function(_0x3ca294,_0x3bb5f0){return _0x3ca294(_0x3bb5f0);},'qRgEn':'../..','NLnzv':_0x5c9930(0x14c),'tONSv':'PreCompact','Cvnpi':_0x5c9930(0x147),'vabfw':function(_0x328987,_0x5ee8e8,_0x3c77c1){return _0x328987(_0x5ee8e8,_0x3c77c1);}},_0x3626c8=[];for await(const _0x5be2ce of process[_0x5c9930(0x14b)])_0x3626c8['push'](_0x5be2ce);const _0x4f7e50=Buffer['concat'](_0x3626c8)[_0x5c9930(0x13e)](_0x2b5973['nAgON']);let _0x4bb5f4;try{_0x4bb5f4=JSON['parse'](_0x4f7e50);}catch{process[_0x5c9930(0x14f)](0x0);}const _0xf28075=_0x4bb5f4['cwd']||process[_0x5c9930(0x155)](),_0x3d2957=_0x4bb5f4[_0x5c9930(0x140)];let _0x543fe6;try{_0x543fe6=_0x2b5973[_0x5c9930(0x153)](loadConfig,_0xf28075);}catch{const _0x2999e4=process.env.CLAUDE_PLUGIN_ROOT||resolve(import.meta.dirname,_0x2b5973['qRgEn']);_0x543fe6=_0x2b5973['tpCRk'](loadConfig,_0x2999e4);}const _0x391934=new HookDispatcher(_0x543fe6,_0xf28075,_0x4bb5f4['session_id']);let _0x4c97f5={};switch(_0x3d2957){case'SessionStart':_0x4c97f5=_0x2b5973[_0x5c9930(0x153)](buildSessionStartContext,{'cwd':_0xf28075});break;case _0x2b5973[_0x5c9930(0x152)]:{const _0x2dd9a8=_0x391934[_0x5c9930(0x13d)](_0x4bb5f4),_0x5004ba=_0x2b5973['tpCRk'](buildSmartContext,{'prompt':_0x4bb5f4['prompt']||'','cwd':_0xf28075}),_0x1f72ba=[_0x2dd9a8[_0x5c9930(0x149)],_0x5004ba['additionalContext']]['filter'](Boolean);_0x4c97f5=_0x1f72ba[_0x5c9930(0x13b)]>0x0?{'additionalContext':_0x1f72ba[_0x5c9930(0x13c)]('\x0a')}:{};break;}case _0x2b5973['tONSv']:_0x4c97f5=_0x391934[_0x5c9930(0x148)](_0x4bb5f4);break;case _0x2b5973['Cvnpi']:{const _0x69c142=_0x391934['handleSessionStop'](),_0x4df90e=new MeteringClient(_0x543fe6['metering'][_0x5c9930(0x141)]),_0x230120=_0x2b5973[_0x5c9930(0x145)](buildMeterPayload,_0x69c142,{'provider':_0x543fe6[_0x5c9930(0x14d)],'model':_0x543fe6[_0x5c9930(0x150)]});await _0x4df90e['send'](_0x230120);break;}}process['stdout']['write'](JSON['stringify'](_0x4c97f5)),process['exit'](0x0);}main()[_0x198515(0x14e)](()=>process['exit'](0x0));