@simosphere/tokenizer-speedup 0.8.1 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/.claude-plugin/plugin.json +22 -14
  2. package/dist/cli/analyze.js +1 -1
  3. package/dist/cli/config-cmd.js +1 -1
  4. package/dist/cli/index.js +1 -1
  5. package/dist/cli/init-cmd.js +1 -1
  6. package/dist/cli/setup-cmd.js +1 -1
  7. package/dist/cloud/stripe-checkout.js +1 -1
  8. package/dist/cloud/stripe-config.js +1 -1
  9. package/dist/cloud/stripe-usage.js +1 -1
  10. package/dist/cloud/stripe-webhooks.js +1 -1
  11. package/dist/cloud/subscription-store.js +1 -1
  12. package/dist/manifest.json +50 -37
  13. package/dist/mcp/index.js +1 -1
  14. package/dist/mcp/resources.js +1 -1
  15. package/dist/mcp/session.js +1 -1
  16. package/dist/mcp/tools.js +1 -1
  17. package/dist/plugin/cli.js +1 -1
  18. package/dist/plugin/compression/anonymize.js +1 -0
  19. package/dist/plugin/compression/cache.js +1 -0
  20. package/dist/plugin/compression/chunked.js +1 -0
  21. package/dist/plugin/compression/dedup.js +1 -0
  22. package/dist/plugin/compression/format-optimizer.js +1 -0
  23. package/dist/plugin/compression/index.js +1 -0
  24. package/dist/plugin/compression/pipeline.js +1 -0
  25. package/dist/plugin/compression/quality.js +1 -0
  26. package/dist/plugin/compression/rule-based.js +1 -0
  27. package/dist/plugin/compression/structural.js +1 -0
  28. package/dist/plugin/compression/text-utils.js +1 -0
  29. package/dist/plugin/compression/token-budget.js +1 -0
  30. package/dist/plugin/compression/types.js +1 -0
  31. package/dist/plugin/config-loader.js +1 -1
  32. package/dist/plugin/context-compressor.js +1 -1
  33. package/dist/plugin/hook-dispatcher.js +1 -1
  34. package/dist/plugin/metering-client.js +1 -1
  35. package/dist/plugin/metrics-collector.js +1 -1
  36. package/dist/plugin/onboarding.js +1 -1
  37. package/dist/plugin/precompact-handler.js +1 -1
  38. package/dist/plugin/report.js +1 -1
  39. package/dist/plugin/rule-analytics-store.js +1 -1
  40. package/dist/plugin/rule-analytics.js +1 -1
  41. package/dist/plugin/rule-engine.js +1 -1
  42. package/dist/plugin/rule-sharing.js +1 -1
  43. package/dist/plugin/rule-suggest.js +1 -1
  44. package/dist/plugin/session-start.js +1 -1
  45. package/dist/plugin/smart-context.js +1 -1
  46. package/dist/shared/license.js +1 -1
  47. package/dist/shared/providers/claude-provider.js +1 -1
  48. package/dist/shared/providers/openai-provider.js +1 -1
  49. package/dist/shared/token-counter.js +1 -1
  50. package/dist/shared/token-provider.js +1 -1
  51. package/package.json +1 -1
@@ -1,15 +1,23 @@
1
1
  {
2
- "name": "tokenizer-speedup",
3
- "version": "0.8.1",
4
- "description": "Intelligent context optimization for LLM sessions save 30-60% on tokens",
5
- "author": {
6
- "name": "SIMO GmbH",
7
- "email": "info@simo-online.com",
8
- "url": "https://simo-online.com"
9
- },
10
- "homepage": "https://tokenizer-speedup.simosphereai.com",
11
- "repository": "https://github.com/AndreasSchwan-SIMO/tokenizer-speedup",
12
- "license": "BSL-1.1",
13
- "engines": { "node": ">=20.0.0" },
14
- "keywords": ["claude", "token-optimization", "context-management", "cost-reduction", "llm"]
15
- }
2
+ "name": "tokenizer-speedup",
3
+ "version": "0.9.0",
4
+ "description": "Intelligent context optimization for LLM sessions \u2014 save 30-60% on tokens",
5
+ "author": {
6
+ "name": "SIMO GmbH",
7
+ "email": "info@simo-online.com",
8
+ "url": "https://simo-online.com"
9
+ },
10
+ "homepage": "https://tokenizer-speedup.simosphereai.com",
11
+ "repository": "https://gitlab.simo-online.com/simosphereos/tokenizer-speedup",
12
+ "license": "BSL-1.1",
13
+ "engines": {
14
+ "node": ">=20.0.0"
15
+ },
16
+ "keywords": [
17
+ "claude",
18
+ "token-optimization",
19
+ "context-management",
20
+ "cost-reduction",
21
+ "llm"
22
+ ]
23
+ }
@@ -1 +1 @@
1
- const _0x3e2d52=_0x7acd;function _0x1828(){const _0x15e84f=['162RDKleY','CmORl','192130IxQHIK','5384460xcgUHy','4617277SDJPmu','6293432IcgASF','jWTrm','9rneTum','249NyDJra','estimateTokens','1243882FGcalo','2HVrqIK','uXpJf','11OtGSkN','1108IvFXlt','gpt-4o','split','16874830osDekM','claude','countTokens','openai','length'];_0x1828=function(){return _0x15e84f;};return _0x1828();}(function(_0x52e083,_0x57cfb0){const _0x3f28d7=_0x7acd,_0x3f5ea6=_0x52e083();while(!![]){try{const _0x1c324b=parseInt(_0x3f28d7(0x176))/0x1*(parseInt(_0x3f28d7(0x175))/0x2)+parseInt(_0x3f28d7(0x173))/0x3*(parseInt(_0x3f28d7(0x179))/0x4)+parseInt(_0x3f28d7(0x16d))/0x5*(parseInt(_0x3f28d7(0x16b))/0x6)+parseInt(_0x3f28d7(0x16f))/0x7+-parseInt(_0x3f28d7(0x170))/0x8*(parseInt(_0x3f28d7(0x172))/0x9)+-parseInt(_0x3f28d7(0x17c))/0xa+-parseInt(_0x3f28d7(0x178))/0xb*(-parseInt(_0x3f28d7(0x16e))/0xc);if(_0x1c324b===_0x57cfb0)break;else _0x3f5ea6['push'](_0x3f5ea6['shift']());}catch(_0x3ac803){_0x3f5ea6['push'](_0x3f5ea6['shift']());}}}(_0x1828,0xe5221));import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';function _0x7acd(_0x15fd48,_0x5196e7){_0x15fd48=_0x15fd48-0x16b;const _0x1828f2=_0x1828();let _0x7acdd2=_0x1828f2[_0x15fd48];return _0x7acdd2;}import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x22cfdc,_0x1c72dc=_0x3e2d52(0x17d),_0x1f1908){const _0x44eca8=_0x3e2d52,_0xc33abf={'rqSaR':'claude','CmORl':_0x44eca8(0x17a),'WQxbx':function(_0xc130e3,_0x53bab9,_0x1f5562){return _0xc130e3(_0x53bab9,_0x1f5562);}},_0x5ad55e=_0x1f1908??(_0xc33abf['rqSaR']===_0x1c72dc?'claude-sonnet-4-20250514':_0xc33abf[_0x44eca8(0x16c)]),_0x567a35=_0xc33abf['WQxbx'](createTokenProvider,_0x1c72dc,_0x5ad55e),_0x21fba9=_0x22cfdc[_0x44eca8(0x17b)](/\s+/)['filter'](Boolean)['length'];return{'tokens':_0x567a35[_0x44eca8(0x17e)](_0x22cfdc),'estimate':_0x567a35[_0x44eca8(0x174)](_0x22cfdc),'provider':_0x1c72dc,'model':_0x5ad55e,'chars':_0x22cfdc[_0x44eca8(0x180)],'words':_0x21fba9};}export function analyzeFile(_0x3e956f,_0x1aecba=_0x3e2d52(0x17d),_0x355183){const _0x5ef5b1=_0x3e2d52,_0x58fdec={'mCtNB':function(_0x165867,_0x3f562e,_0x85f7ab,_0x1434ca){return _0x165867(_0x3f562e,_0x85f7ab,_0x1434ca);},'jWTrm':'utf-8'};return _0x58fdec['mCtNB'](analyzeText,readFileSync(_0x3e956f,_0x58fdec[_0x5ef5b1(0x171)]),_0x1aecba,_0x355183);}export function compareProviders(_0x2b65b7){const _0x1430e0=_0x3e2d52,_0x27424c={'NOAMP':function(_0x357af6,_0x599dc8,_0x2082a9){return _0x357af6(_0x599dc8,_0x2082a9);},'uXpJf':_0x1430e0(0x17f)};return{'claude':_0x27424c['NOAMP'](analyzeText,_0x2b65b7,_0x1430e0(0x17d)),'openai':analyzeText(_0x2b65b7,_0x27424c[_0x1430e0(0x177)])};}
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 +1 @@
1
- (function(_0x523b16,_0x546548){const _0x34e4bc=_0xc4c4,_0x244a56=_0x523b16();while(!![]){try{const _0x1720f1=parseInt(_0x34e4bc(0x7f))/0x1+parseInt(_0x34e4bc(0x7a))/0x2+parseInt(_0x34e4bc(0x80))/0x3*(parseInt(_0x34e4bc(0x85))/0x4)+parseInt(_0x34e4bc(0x7e))/0x5*(-parseInt(_0x34e4bc(0x84))/0x6)+parseInt(_0x34e4bc(0x79))/0x7*(parseInt(_0x34e4bc(0x78))/0x8)+parseInt(_0x34e4bc(0x83))/0x9*(-parseInt(_0x34e4bc(0x7d))/0xa)+parseInt(_0x34e4bc(0x86))/0xb;if(_0x1720f1===_0x546548)break;else _0x244a56['push'](_0x244a56['shift']());}catch(_0x41da88){_0x244a56['push'](_0x244a56['shift']());}}}(_0x1a33,0x3a623));function _0xc4c4(_0x5f2532,_0x23b635){_0x5f2532=_0x5f2532-0x78;const _0x1a33f3=_0x1a33();let _0xc4c495=_0x1a33f3[_0x5f2532];return _0xc4c495;}import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';function _0x1a33(){const _0x288133=['model','provider','230tNWJZt','5hGlaXN','214767rEezLh','131190pxXSMb','IoEcc','rules','166599eRcypW','987402OpejjH','8ojxrwj','1124860HtcTaz','538528wcqoNg','35dcjGid','176784bWevRp'];_0x1a33=function(){return _0x288133;};return _0x1a33();}export function validateConfigYaml(_0x1a51c1){const _0xd2b3a5=_0xc4c4,_0x17d4a6={'IoEcc':function(_0x5412ee,_0x41f2c1){return _0x5412ee(_0x41f2c1);}};try{const _0x297c29=_0x17d4a6[_0xd2b3a5(0x81)](parseConfig,_0x1a51c1);return{'valid':!0x0,'provider':_0x297c29[_0xd2b3a5(0x7c)],'model':_0x297c29[_0xd2b3a5(0x7b)],'ruleCount':_0x297c29[_0xd2b3a5(0x82)]['length']};}catch(_0x4f641e){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x4f641e['message']};}}
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']};}}
package/dist/cli/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- (function(_0x32a066,_0x18e508){const _0x33b292=_0x15d8,_0x625718=_0x32a066();while(!![]){try{const _0x281826=parseInt(_0x33b292(0x194))/0x1+parseInt(_0x33b292(0x19f))/0x2+parseInt(_0x33b292(0x18e))/0x3*(-parseInt(_0x33b292(0x1aa))/0x4)+-parseInt(_0x33b292(0x197))/0x5*(parseInt(_0x33b292(0x187))/0x6)+parseInt(_0x33b292(0x184))/0x7*(parseInt(_0x33b292(0x19b))/0x8)+-parseInt(_0x33b292(0x1a7))/0x9*(-parseInt(_0x33b292(0x1a2))/0xa)+parseInt(_0x33b292(0x1ad))/0xb*(-parseInt(_0x33b292(0x1a8))/0xc);if(_0x281826===_0x18e508)break;else _0x625718['push'](_0x625718['shift']());}catch(_0x4204e9){_0x625718['push'](_0x625718['shift']());}}}(_0x2b9a,0x7b157));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 _0x2b9a(){const _0x3ae18b=['-m,\x20--model\x20<model>','claude-sonnet-4-20250514','Model\x20name','VVIbp','8523zKbVgM','474972gfsHRU','lghRF','58184VLIrFS','IDgUw','Wqopq','451RuaCZG','K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.','\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','LLM\x20provider\x20(claude,\x20openai)','replace','message','requiredOption','after','LEnHs','argument','wEFEL','length','claude','Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text','description','stringify','rules','utf-8','-p,\x20--provider\x20<provider>','[file]','3954734SljSpz','version','0.8.1','12zqnuNZ','1.4','toFixed','argv','GDgXM','error','1.3','54vgmsmj','aJBGU','hEMVG','apiKey','-t,\x20--text\x20<text>','action','954868bsnRzZ','analyze','tsu','1816985xQaaRM','iCxkP','Config\x20file\x20path','option','8zWgmWS','command','provider','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','1920654DaBSoA','Create\x20a\x20starter\x20tokenizer-speedup.yaml\x20in\x20the\x20current\x20directory','setup','6710qzsaDr'];_0x2b9a=function(){return _0x3ae18b;};return _0x2b9a();}function _0x15d8(_0x1881e9,_0x207245){_0x1881e9=_0x1881e9-0x17e;const _0x2b9af9=_0x2b9a();let _0x15d857=_0x2b9af9[_0x1881e9];return _0x15d857;}import{runInit}from'./init-cmd.js';export function buildCLI(){const _0x57f048=_0x15d8,_0x3fa04a={'bMrRa':_0x57f048(0x1b9),'RbjIw':_0x57f048(0x1a4),'SSVzh':'gpt-4o','IDgUw':'Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','iCxkP':function(_0x49f6ba,_0x51f172){return _0x49f6ba>_0x51f172;},'QYFvR':function(_0x201654,_0x3297a0){return _0x201654===_0x3297a0;},'IKArJ':'openai','TDpdh':_0x57f048(0x18d),'vAGGs':_0x57f048(0x188),'CsdQP':function(_0x502482,_0x26e811,_0x5e7220){return _0x502482(_0x26e811,_0x5e7220);},'gSxAV':_0x57f048(0x181),'wEFEL':'TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI','Wqopq':_0x57f048(0x186),'HkYlG':_0x57f048(0x1b4),'dngpB':_0x57f048(0x1af),'LEnHs':_0x57f048(0x1a1),'aJBGU':'--api-key\x20<key>','ApKQz':_0x57f048(0x195),'VVIbp':_0x57f048(0x1ba),'hEMVG':_0x57f048(0x183),'GDgXM':_0x57f048(0x182),'lghRF':_0x57f048(0x1b0),'urRWO':'config'},_0x21bc71=new Command();return _0x21bc71['name'](_0x57f048(0x196))[_0x57f048(0x17e)](_0x3fa04a[_0x57f048(0x1b7)])[_0x57f048(0x185)](_0x3fa04a[_0x57f048(0x1ac)])['addHelpText'](_0x3fa04a['HkYlG'],_0x3fa04a['dngpB']),_0x21bc71[_0x57f048(0x19c)](_0x3fa04a[_0x57f048(0x1b5)])['description'](_0x57f048(0x19e))[_0x57f048(0x1b3)](_0x3fa04a[_0x57f048(0x18f)],'Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)')['action'](_0x106960=>{const _0x407adb=_0x57f048;runSetup(_0x106960[_0x407adb(0x191)]);}),_0x21bc71['command'](_0x3fa04a['ApKQz'])['description'](_0x3fa04a[_0x57f048(0x1a6)])[_0x57f048(0x1b6)](_0x3fa04a[_0x57f048(0x190)],'File\x20to\x20analyze')[_0x57f048(0x19a)](_0x3fa04a[_0x57f048(0x18b)],_0x3fa04a[_0x57f048(0x1a9)],_0x3fa04a['bMrRa'])['option'](_0x57f048(0x1a3),_0x57f048(0x1a5))['option'](_0x57f048(0x192),'Analyze\x20inline\x20text\x20instead\x20of\x20file')['action']((_0xd53d9a,_0x4f9c68)=>{const _0x4bd8eb=_0x57f048,_0x1e9126=_0x4f9c68['model']??(_0x3fa04a['bMrRa']===_0x4f9c68[_0x4bd8eb(0x19d)]?_0x3fa04a['RbjIw']:_0x3fa04a['SSVzh']);let _0x494566,_0xfb6153;try{_0x494566=createTokenProvider(_0x4f9c68['provider'],_0x1e9126);}catch(_0x2241ee){return console[_0x4bd8eb(0x18c)]('Error:\x20'+_0x2241ee[_0x4bd8eb(0x1b2)]),void(process['exitCode']=0x1);}if(void 0x0!==_0x4f9c68['text'])_0xfb6153=_0x4f9c68['text'];else{if(!_0xd53d9a)return console['error'](_0x3fa04a[_0x4bd8eb(0x1ab)]),void(process['exitCode']=0x1);_0xfb6153=readFileSync(_0xd53d9a,_0x4bd8eb(0x181));}_0x3fa04a[_0x4bd8eb(0x198)](_0xfb6153['length'],0x7a120)&&console['error']('Warning:\x20large\x20input\x20('+(_0xfb6153[_0x4bd8eb(0x1b8)]/0x3e8)[_0x4bd8eb(0x189)](0x0)+_0x4bd8eb(0x1ae));const _0xc246cb=_0x494566['countTokens'](_0xfb6153),_0x4ec280=_0x494566['estimateTokens'](_0xfb6153);console['log'](JSON['stringify']({'file':_0xd53d9a??'(inline)','tokens':_0xc246cb,'tokens_method':'BPE\x20tokenizer\x20(accurate)','estimate':_0x4ec280,'estimate_method':'word\x20heuristic\x20(words\x20×\x20'+(_0x3fa04a['QYFvR'](_0x3fa04a['IKArJ'],_0x4f9c68[_0x4bd8eb(0x19d)])?_0x3fa04a['TDpdh']:_0x3fa04a['vAGGs'])+')','provider':_0x4f9c68['provider'],'model':_0x1e9126}));}),_0x21bc71[_0x57f048(0x19c)](_0x3fa04a['urRWO'])['description']('Validate\x20configuration\x20file')['argument'](_0x3fa04a['hEMVG'],_0x57f048(0x199),'tokenizer-speedup.yaml')['action'](async _0x25e4f1=>{const _0x13c26b=_0x57f048;try{const _0x56a5b2=_0x3fa04a['CsdQP'](readFileSync,_0x25e4f1,_0x3fa04a['gSxAV']),{parseConfig:_0x183187}=await import('../plugin/config-loader.js'),_0x3a9775=_0x183187(_0x56a5b2);console['log'](JSON['stringify']({'valid':!0x0,'provider':_0x3a9775[_0x13c26b(0x19d)],'model':_0x3a9775['model'],'ruleCount':_0x3a9775[_0x13c26b(0x180)][_0x13c26b(0x1b8)]}));}catch(_0x4f9c93){console['log'](JSON[_0x13c26b(0x17f)]({'valid':!0x1,'error':_0x4f9c93['message']})),process['exitCode']=0x1;}}),_0x21bc71['command']('init')[_0x57f048(0x17e)](_0x57f048(0x1a0))[_0x57f048(0x193)](()=>{runInit();}),_0x21bc71;}const resolvedArgv1=((()=>{const _0x451b3b=_0x15d8;try{return realpathSync(process[_0x451b3b(0x18a)][0x1]??'')['replace'](/\\/g,'/');}catch{return process['argv'][0x1]?.[_0x451b3b(0x1b1)](/\\/g,'/')??'';}})());resolvedArgv1['includes']('cli/index')&&buildCLI()['parse']();
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)]();
@@ -1 +1 @@
1
- const _0x340214=_0x398f;(function(_0xc6b7d4,_0x23b794){const _0x348504=_0x398f,_0xb03cbd=_0xc6b7d4();while(!![]){try{const _0xbbc43f=parseInt(_0x348504(0x11f))/0x1+-parseInt(_0x348504(0x128))/0x2+parseInt(_0x348504(0x11e))/0x3*(-parseInt(_0x348504(0x120))/0x4)+-parseInt(_0x348504(0x11c))/0x5+-parseInt(_0x348504(0x125))/0x6*(parseInt(_0x348504(0x129))/0x7)+-parseInt(_0x348504(0x121))/0x8+-parseInt(_0x348504(0x119))/0x9*(-parseInt(_0x348504(0x127))/0xa);if(_0xbbc43f===_0x23b794)break;else _0xb03cbd['push'](_0xb03cbd['shift']());}catch(_0x5c9863){_0xb03cbd['push'](_0xb03cbd['shift']());}}}(_0x24fb,0x3a555));import{writeFileSync,existsSync}from'node:fs';import{join}from'node:path';const STARTER_CONFIG=_0x340214(0x12c);function _0x24fb(){const _0x31801e=['208387wHQROJ','24UVlLhF','1731624UXSRFz','DngtI','Next\x20steps:','sUIxS','12NansIU','\x20\x201.\x20Edit\x20the\x20rules\x20to\x20match\x20your\x20project\x20structure','3020170AaHHoW','853036xurpsY','929894VhJRak','utf-8','LyMxD','#\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','cwd','tokenizer-speedup.yaml\x20already\x20exists\x20in\x20this\x20directory.','45liRApt','sMRqt','NlqmI','1811290qTyEUN','log','104313nvlgfC'];_0x24fb=function(){return _0x31801e;};return _0x24fb();}function _0x398f(_0x156a6f,_0x17b7a8){_0x156a6f=_0x156a6f-0x118;const _0x24fb73=_0x24fb();let _0x398f82=_0x24fb73[_0x156a6f];return _0x398f82;}export function runInit(){const _0x28bc03=_0x340214,_0x89ede7={'LyMxD':function(_0x106e3f,_0x2f126d,_0x4c6ea4){return _0x106e3f(_0x2f126d,_0x4c6ea4);},'sMRqt':'tokenizer-speedup.yaml','PsWsk':_0x28bc03(0x118),'sUIxS':_0x28bc03(0x12a),'yJXlK':_0x28bc03(0x123),'NlqmI':_0x28bc03(0x126),'DngtI':'\x20\x202.\x20Run:\x20tsu\x20config\x20tokenizer-speedup.yaml\x20\x20(to\x20validate)'},_0x4fa5cf=_0x89ede7[_0x28bc03(0x12b)](join,process[_0x28bc03(0x12d)](),_0x89ede7[_0x28bc03(0x11a)]);if(existsSync(_0x4fa5cf))return console['error'](_0x89ede7['PsWsk']),void(process['exitCode']=0x1);writeFileSync(_0x4fa5cf,STARTER_CONFIG,_0x89ede7[_0x28bc03(0x124)]),console[_0x28bc03(0x11d)]('Created\x20tokenizer-speedup.yaml'),console['log'](''),console[_0x28bc03(0x11d)](_0x89ede7['yJXlK']),console['log'](_0x89ede7[_0x28bc03(0x11b)]),console['log'](_0x89ede7[_0x28bc03(0x122)]),console[_0x28bc03(0x11d)]('\x20\x203.\x20Restart\x20Claude\x20Code\x20to\x20pick\x20up\x20the\x20new\x20config');}
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 +1 @@
1
- const _0x2ea414=_0x47ca;(function(_0x180775,_0x2a7616){const _0x3d7547=_0x47ca,_0xc36563=_0x180775();while(!![]){try{const _0xd2aa14=-parseInt(_0x3d7547(0xaa))/0x1+-parseInt(_0x3d7547(0xb1))/0x2+parseInt(_0x3d7547(0xa8))/0x3*(parseInt(_0x3d7547(0xba))/0x4)+parseInt(_0x3d7547(0xc5))/0x5*(parseInt(_0x3d7547(0xc0))/0x6)+parseInt(_0x3d7547(0xae))/0x7*(parseInt(_0x3d7547(0xc1))/0x8)+-parseInt(_0x3d7547(0xb8))/0x9+parseInt(_0x3d7547(0xb2))/0xa*(parseInt(_0x3d7547(0xaf))/0xb);if(_0xd2aa14===_0x2a7616)break;else _0xc36563['push'](_0xc36563['shift']());}catch(_0x4db728){_0xc36563['push'](_0xc36563['shift']());}}}(_0x214b,0x2b139));function _0x47ca(_0x33a50b,_0x2bb688){_0x33a50b=_0x33a50b-0xa1;const _0x214b91=_0x214b();let _0x47ca82=_0x214b91[_0x33a50b];return _0x47ca82;}import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),_0x2ea414(0xa1),_0x2ea414(0xa7)),CONFIG_FILE=join(CONFIG_DIR,_0x2ea414(0xad)),CLAUDE_SETTINGS_FILE=join(homedir(),_0x2ea414(0xbc),'settings.local.json');export function runSetup(_0x5cf9f0){const _0x2144f4=_0x2ea414,_0x1677de={'hZFIw':'❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).','izOBA':_0x2144f4(0xb5),'SXyXC':'⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','LQtIo':function(_0xc5b71b){return _0xc5b71b();},'wqAjZ':'✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.'};try{if(!_0x5cf9f0||0x0===_0x5cf9f0[_0x2144f4(0xa2)]()['length'])return console['error'](_0x2144f4(0xbe)),void(process[_0x2144f4(0xac)]=0x1);if(_0x5cf9f0[_0x2144f4(0xa2)]()['length']<0x8)return console['error'](_0x1677de[_0x2144f4(0xa4)]),void(process['exitCode']=0x1);saveApiKey(_0x5cf9f0[_0x2144f4(0xa2)]()),console['log'](_0x1677de[_0x2144f4(0xc3)]),console[_0x2144f4(0xa9)](_0x1677de[_0x2144f4(0xb9)]),_0x1677de['LQtIo'](registerHooks),console['log'](_0x1677de['wqAjZ']),console['log'](''),console['log'](_0x2144f4(0xab));}catch(_0x222f3d){console['error'](_0x2144f4(0xbb)+_0x222f3d[_0x2144f4(0xc4)]),process[_0x2144f4(0xac)]=0x1;}}function saveApiKey(_0x2eb432){const _0x4c8fc1=_0x2ea414;mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x4808fc={};try{_0x4808fc=JSON[_0x4c8fc1(0xa6)](readFileSync(CONFIG_FILE,'utf-8'));}catch{}_0x4808fc['apiKey']=_0x2eb432,writeFileSync(CONFIG_FILE,JSON[_0x4c8fc1(0xc6)](_0x4808fc,null,0x2)+'\x0a','utf-8');}function _0x214b(){const _0x3eff36=['parse','tokenizer-speedup','24234vmUFXl','log','336689NenDFY','Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.','exitCode','config.json','112XIxRYs','2310913tTEjFS','utf-8','668224ijSjmg','20kACeym','wedbJ','UiBHI','✅\x20API\x20key\x20saved\x20successfully.','hooks','ItWRu','1368504CZkxFr','SXyXC','96hTITKB','❌\x20Setup\x20failed:\x20','.claude','SessionStart','❌\x20API\x20key\x20cannot\x20be\x20empty.','UserPromptSubmit','12FwfccS','130064jSIpzk','dlKbB','izOBA','message','312830USurzX','stringify','cAnsm','.config','trim','command','hZFIw','vdaSM'];_0x214b=function(){return _0x3eff36;};return _0x214b();}function registerHooks(){const _0xbc515e=_0x2ea414,_0xcaa7a8={'BcciB':function(_0x2c914e,_0x269ceb,_0x113551){return _0x2c914e(_0x269ceb,_0x113551);},'VbkkG':_0xbc515e(0xbc),'cAnsm':function(_0x2d0951,_0x419e40,_0x1274a7){return _0x2d0951(_0x419e40,_0x1274a7);},'ItWRu':'startup|resume|clear|compact','dlKbB':_0xbc515e(0xa7),'UiBHI':'command','XupBB':function(_0x344a45,_0x1cb2d8,_0x3b9b29,_0x5c9d3b){return _0x344a45(_0x1cb2d8,_0x3b9b29,_0x5c9d3b);},'wedbJ':function(_0x23aedb,_0x3a5031){return _0x23aedb+_0x3a5031;},'zCLjc':'utf-8'};_0xcaa7a8['BcciB'](mkdirSync,join(homedir(),_0xcaa7a8['VbkkG']),{'recursive':!0x0});let _0x313bc1={};try{_0x313bc1=JSON['parse'](_0xcaa7a8[_0xbc515e(0xc7)](readFileSync,CLAUDE_SETTINGS_FILE,_0xbc515e(0xb0)));}catch{}const _0x367c4d=_0x313bc1[_0xbc515e(0xb6)]??{};_0x367c4d[_0xbc515e(0xbd)]=[{'matcher':_0xcaa7a8[_0xbc515e(0xb7)],'hooks':[{'type':_0xbc515e(0xa3),'command':_0xcaa7a8[_0xbc515e(0xc2)],'timeout':0x5}]}],_0x367c4d[_0xbc515e(0xbf)]=[{'matcher':'','hooks':[{'type':_0xcaa7a8['UiBHI'],'command':_0xcaa7a8[_0xbc515e(0xc2)]}]}],_0x367c4d['PreCompact']=[{'matcher':'','hooks':[{'type':_0xbc515e(0xa3),'command':_0xcaa7a8['dlKbB'],'timeout':0xa}]}],_0x367c4d['Stop']=[{'matcher':'','hooks':[{'type':_0xcaa7a8[_0xbc515e(0xb4)],'command':'tokenizer-speedup','timeout':0xa}]}],_0x313bc1[_0xbc515e(0xb6)]=_0x367c4d,_0xcaa7a8['XupBB'](writeFileSync,CLAUDE_SETTINGS_FILE,_0xcaa7a8[_0xbc515e(0xb3)](JSON['stringify'](_0x313bc1,null,0x2),'\x0a'),_0xcaa7a8['zCLjc']);}export function loadApiKeyFromConfig(){const _0x519a57=_0x2ea414,_0x5bf6f1={'vdaSM':_0x519a57(0xb0)};try{return JSON[_0x519a57(0xa6)](readFileSync(CONFIG_FILE,_0x5bf6f1[_0x519a57(0xa5)]))['apiKey']??void 0x0;}catch{return;}}
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 +1 @@
1
- (function(_0x2010ff,_0x314fbb){const _0x4956fe=_0x5801,_0x402593=_0x2010ff();while(!![]){try{const _0x12e1f5=-parseInt(_0x4956fe(0xd7))/0x1+parseInt(_0x4956fe(0xdf))/0x2*(parseInt(_0x4956fe(0xd6))/0x3)+parseInt(_0x4956fe(0xe0))/0x4+parseInt(_0x4956fe(0xd9))/0x5+-parseInt(_0x4956fe(0xd5))/0x6+parseInt(_0x4956fe(0xdd))/0x7*(-parseInt(_0x4956fe(0xdc))/0x8)+-parseInt(_0x4956fe(0xd8))/0x9*(-parseInt(_0x4956fe(0xdb))/0xa);if(_0x12e1f5===_0x314fbb)break;else _0x402593['push'](_0x402593['shift']());}catch(_0x154cbf){_0x402593['push'](_0x402593['shift']());}}}(_0x1964,0x2bd8f));export function buildCheckoutParams(_0x3bdd60){const _0xfc5318=_0x5801,_0xdac372=[{'price':_0x3bdd60['recurringPriceId'],'quantity':0x1}];return _0x3bdd60['meteredPriceId']&&_0xdac372['push']({'price':_0x3bdd60[_0xfc5318(0xda)]}),{'customer':_0x3bdd60[_0xfc5318(0xe2)],'mode':_0xfc5318(0xe3),'line_items':_0xdac372,'success_url':_0x3bdd60[_0xfc5318(0xe1)],'cancel_url':_0x3bdd60[_0xfc5318(0xde)],'metadata':{'tier':_0x3bdd60['tier']}};}function _0x5801(_0xa598e3,_0x143a5b){_0xa598e3=_0xa598e3-0xd5;const _0x19642f=_0x1964();let _0x580188=_0x19642f[_0xa598e3];return _0x580188;}function _0x1964(){const _0x3ca468=['customerId','subscription','1015668QJwvRy','144123DsVwLB','42607qIzaVY','9uFsJnn','211400hqUWvO','meteredPriceId','4313020vtqVhS','2780440Iceylc','7TbKyPi','cancelUrl','6HqtKqp','485336FUqAbH','successUrl'];_0x1964=function(){return _0x3ca468;};return _0x1964();}
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 +1 @@
1
- function _0x5e3a(){const _0x866b5c=['Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','2870GvfLzE','Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','50EdgACB','489408UwRaFN','65532YveqoN','98340RyPdRT','7734noHmNW','9DIckPw','240VQjkft','7516460YfsnES','460176BpWRVz','468689JPiEDV','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','99TtovGq','TokenizerSpeedUp\x20Team'];_0x5e3a=function(){return _0x866b5c;};return _0x5e3a();}const _0x44231c=_0x5613;(function(_0x5858b5,_0x3dcb58){const _0x2ea4c7=_0x5613,_0x40bfd2=_0x5858b5();while(!![]){try{const _0x32f0f8=parseInt(_0x2ea4c7(0x140))/0x1+-parseInt(_0x2ea4c7(0x138))/0x2*(parseInt(_0x2ea4c7(0x13c))/0x3)+parseInt(_0x2ea4c7(0x139))/0x4*(parseInt(_0x2ea4c7(0x137))/0x5)+parseInt(_0x2ea4c7(0x13b))/0x6*(parseInt(_0x2ea4c7(0x135))/0x7)+parseInt(_0x2ea4c7(0x13f))/0x8*(parseInt(_0x2ea4c7(0x142))/0x9)+-parseInt(_0x2ea4c7(0x13e))/0xa+parseInt(_0x2ea4c7(0x13a))/0xb*(parseInt(_0x2ea4c7(0x13d))/0xc);if(_0x32f0f8===_0x3dcb58)break;else _0x40bfd2['push'](_0x40bfd2['shift']());}catch(_0x2680ea){_0x40bfd2['push'](_0x40bfd2['shift']());}}}(_0x5e3a,0x76d89));function _0x5613(_0x5bf38d,_0xf7c750){_0x5bf38d=_0x5bf38d-0x135;const _0x5e3a75=_0x5e3a();let _0x561319=_0x5e3a75[_0x5bf38d];return _0x561319;}export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':_0x44231c(0x136),'recurringPrice':0x0},'pro':{'name':'TokenizerSpeedUp\x20Pro','description':_0x44231c(0x144),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':_0x44231c(0x143),'description':_0x44231c(0x141),'recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
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 +1 @@
1
- const _0x4912a7=_0x38bf;(function(_0x22c0a0,_0x1aa283){const _0x23071b=_0x38bf,_0x32c4b0=_0x22c0a0();while(!![]){try{const _0x543269=parseInt(_0x23071b(0xec))/0x1+-parseInt(_0x23071b(0xeb))/0x2*(parseInt(_0x23071b(0xf2))/0x3)+parseInt(_0x23071b(0xf4))/0x4*(parseInt(_0x23071b(0xf0))/0x5)+parseInt(_0x23071b(0xf3))/0x6+parseInt(_0x23071b(0xe6))/0x7+-parseInt(_0x23071b(0xed))/0x8+-parseInt(_0x23071b(0xe5))/0x9*(parseInt(_0x23071b(0xe7))/0xa);if(_0x543269===_0x1aa283)break;else _0x32c4b0['push'](_0x32c4b0['shift']());}catch(_0x2a0d57){_0x32c4b0['push'](_0x32c4b0['shift']());}}}(_0x20a5,0x67809));import{STRIPE_CONFIG}from'./stripe-config.js';function _0x38bf(_0x129dd4,_0x58ef43){_0x129dd4=_0x129dd4-0xe4;const _0x20a58b=_0x20a5();let _0x38bffe=_0x20a58b[_0x129dd4];return _0x38bffe;}const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG['pro']['meteredUnitAmount']},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG['team'][_0x4912a7(0xe8)]}};function _0x20a5(){const _0x2b60c7=['3595392zNAxqZ','2145036FDIKjz','allowance','1269CEmnsW','2152892iQhPyE','66650TOvnFk','meteredUnitAmount','now','Cmwhe','1528gAGYjg','349063wgcRPK','2094784ilGXVq','set','ceil','5vSTtEN','chargeableUnits','654ejnDKE'];_0x20a5=function(){return _0x2b60c7;};return _0x20a5();}export function calculateUsageCharge(_0x5cebd6,_0x5ef848){const _0x14071f=_0x4912a7,_0x54279d={'Cmwhe':function(_0x5cb03a,_0x1fe888){return _0x5cb03a/_0x1fe888;}},_0x46a1c5=TIER_LIMITS[_0x5cebd6];if(0x0===_0x46a1c5['unitRate'])return{'tier':_0x5cebd6,'tokensSaved':_0x5ef848,'freeAllowance':_0x46a1c5[_0x14071f(0xe4)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x31ba00=Math['max'](0x0,_0x5ef848-_0x46a1c5['allowance']),_0x144bfd=Math[_0x14071f(0xef)](_0x54279d[_0x14071f(0xea)](_0x31ba00,0x186a0)),_0x1c0b1c=_0x144bfd*_0x46a1c5['unitRate'];return{'tier':_0x5cebd6,'tokensSaved':_0x5ef848,'freeAllowance':_0x46a1c5['allowance'],'chargeableTokens':_0x31ba00,'chargeableUnits':_0x144bfd,'unitRate':_0x46a1c5['unitRate'],'amount':_0x1c0b1c};}export function buildUsageRecord(_0x43a86d,_0x3b27fa){const _0x214672=_0x4912a7;return{'subscription_item':_0x43a86d,'quantity':_0x3b27fa,'action':_0x214672(0xee),'timestamp':Math['floor'](Date[_0x214672(0xe9)]()/0x3e8)};}export function prepareUsageSync(_0x3cf6ea,_0x5fcb98,_0xc39621){const _0x3535be=_0x4912a7,_0x525385={'riSwQ':function(_0x2af171,_0x1aece1){return _0x2af171===_0x1aece1;}};if(!_0xc39621)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x3cf6ea,'error':'no\x20subscription_item_id'};const _0x5d91f5=calculateUsageCharge(_0x3cf6ea,_0x5fcb98);if(_0x525385['riSwQ'](0x0,_0x5d91f5['chargeableUnits']))return{'synced':!0x0,'subscriptionItemId':_0xc39621,'chargeableUnits':0x0,'tier':_0x3cf6ea};return buildUsageRecord(_0xc39621,_0x5d91f5['chargeableUnits']),{'synced':!0x0,'subscriptionItemId':_0xc39621,'chargeableUnits':_0x5d91f5[_0x3535be(0xf1)],'tier':_0x3cf6ea};}
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 +1 @@
1
- (function(_0x4a53f,_0x1764b7){const _0x364d7b=_0x5aae,_0x5d8759=_0x4a53f();while(!![]){try{const _0x2a2a80=parseInt(_0x364d7b(0x17a))/0x1*(-parseInt(_0x364d7b(0x174))/0x2)+-parseInt(_0x364d7b(0x186))/0x3+-parseInt(_0x364d7b(0x16d))/0x4*(parseInt(_0x364d7b(0x16e))/0x5)+-parseInt(_0x364d7b(0x184))/0x6+parseInt(_0x364d7b(0x17e))/0x7*(parseInt(_0x364d7b(0x175))/0x8)+-parseInt(_0x364d7b(0x16c))/0x9*(parseInt(_0x364d7b(0x185))/0xa)+parseInt(_0x364d7b(0x181))/0xb;if(_0x2a2a80===_0x1764b7)break;else _0x5d8759['push'](_0x5d8759['shift']());}catch(_0x500178){_0x5d8759['push'](_0x5d8759['shift']());}}}(_0x5386,0x69b93));export function handleWebhookEvent(_0x3ca04f,_0x23a3e1){const _0x39cb3f=_0x5aae,_0x414fd8={'ozEJA':_0x39cb3f(0x172),'XHpMc':_0x39cb3f(0x183),'rqBaG':function(_0x3a96d0,_0x3bd892){return _0x3a96d0(_0x3bd892);},'AwrmF':_0x39cb3f(0x17f),'WzHAL':_0x39cb3f(0x179)};switch(_0x3ca04f['type']){case _0x39cb3f(0x17b):{const _0x454f56=_0x3ca04f['data'][_0x39cb3f(0x17c)];return{'handled':!0x0,'action':_0x39cb3f(0x180),'customerId':_0x454f56['customer'],'subscriptionId':_0x454f56[_0x39cb3f(0x178)]};}case _0x414fd8[_0x39cb3f(0x168)]:{const _0x47065a=_0x3ca04f[_0x39cb3f(0x170)][_0x39cb3f(0x17c)],_0x28052a={'handled':!0x0,'action':_0x39cb3f(0x169),'customerId':_0x47065a[_0x39cb3f(0x16a)],'subscriptionId':_0x47065a['id']};return _0x23a3e1&&_0x23a3e1[_0x39cb3f(0x16f)]({'id':_0x47065a['id'],'customerId':_0x47065a['customer'],'status':_0x47065a[_0x39cb3f(0x171)]||_0x414fd8[_0x39cb3f(0x16b)],'tier':_0x47065a['metadata']?.[_0x39cb3f(0x17d)]||'free','currentPeriodEnd':_0x47065a[_0x39cb3f(0x177)]||0x0,'meteredSubscriptionItemId':_0x414fd8['rqBaG'](extractMeteredItemId,_0x47065a),'updatedAt':''}),_0x28052a;}case'customer.subscription.deleted':{const _0x26e0e7=_0x3ca04f['data']['object'],_0x53b098={'handled':!0x0,'action':'subscription_canceled','customerId':_0x26e0e7[_0x39cb3f(0x16a)],'subscriptionId':_0x26e0e7['id']};return _0x23a3e1&&_0x23a3e1['upsert']({'id':_0x26e0e7['id'],'customerId':_0x26e0e7[_0x39cb3f(0x16a)],'status':_0x414fd8[_0x39cb3f(0x173)],'tier':_0x26e0e7['metadata']?.[_0x39cb3f(0x17d)]||_0x414fd8['WzHAL'],'currentPeriodEnd':_0x26e0e7[_0x39cb3f(0x177)]||0x0,'updatedAt':''}),_0x53b098;}default:return{'handled':!0x1,'action':'ignored'};}}function _0x5386(){const _0x2e7ba9=['115270MNkbDp','3370784IFeYoY','items','current_period_end','subscription','free','9QOsNlO','invoice.paid','object','tier','14peeFZU','canceled','invoice_paid','27583787nloXaU','recurring','active','3005694AIXhZb','1521160hhjgse','2491902PIfuYZ','ozEJA','subscription_updated','customer','XHpMc','45QINUVK','4DuVjri','1531960hicnZX','upsert','data','status','customer.subscription.updated','AwrmF'];_0x5386=function(){return _0x2e7ba9;};return _0x5386();}function _0x5aae(_0x42bb77,_0x55493d){_0x42bb77=_0x42bb77-0x168;const _0x53864f=_0x5386();let _0x5aae53=_0x53864f[_0x42bb77];return _0x5aae53;}function extractMeteredItemId(_0x531a45){const _0x54ac2b=_0x5aae,_0x3a7565=_0x531a45[_0x54ac2b(0x176)];if(!_0x3a7565?.[_0x54ac2b(0x170)])return;const _0x779d5f=_0x3a7565[_0x54ac2b(0x170)]['find'](_0xd2b2ca=>'metered'===_0xd2b2ca['price']?.[_0x54ac2b(0x182)]?.['usage_type']);return _0x779d5f?.['id'];}
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 +1 @@
1
- const _0x4705b1=_0x35ab;(function(_0x4a4aa2,_0x4a5e51){const _0x33f67b=_0x35ab,_0x548d78=_0x4a4aa2();while(!![]){try{const _0x31821c=parseInt(_0x33f67b(0xf3))/0x1+parseInt(_0x33f67b(0xfd))/0x2*(parseInt(_0x33f67b(0x100))/0x3)+parseInt(_0x33f67b(0xf2))/0x4*(-parseInt(_0x33f67b(0xfc))/0x5)+parseInt(_0x33f67b(0xff))/0x6*(-parseInt(_0x33f67b(0x101))/0x7)+-parseInt(_0x33f67b(0xf4))/0x8*(parseInt(_0x33f67b(0xfb))/0x9)+-parseInt(_0x33f67b(0xfa))/0xa+parseInt(_0x33f67b(0xf5))/0xb;if(_0x31821c===_0x4a5e51)break;else _0x548d78['push'](_0x548d78['shift']());}catch(_0x36469d){_0x548d78['push'](_0x548d78['shift']());}}}(_0x2e0f,0x19514));export class MemorySubscriptionStore{[_0x4705b1(0xf9)]=new Map();[_0x4705b1(0xf6)](_0x53a104){_0x53a104['updatedAt']=new Date()['toISOString'](),this['subs']['set'](_0x53a104['id'],_0x53a104);}['getByCustomerId'](_0x793d73){const _0x2908d2=_0x4705b1,_0x1c8a8a={'uEDOg':function(_0x2729ef,_0x34cdaa){return _0x2729ef===_0x34cdaa;}};for(const _0x38e9d8 of this['subs'][_0x2908d2(0xf8)]())if(_0x1c8a8a[_0x2908d2(0xfe)](_0x38e9d8['customerId'],_0x793d73))return _0x38e9d8;}[_0x4705b1(0xf7)](_0x2be55d){return this['subs']['get'](_0x2be55d);}['list'](){return[...this['subs']['values']()];}}function _0x35ab(_0x5b02f9,_0x54de49){_0x5b02f9=_0x5b02f9-0xf2;const _0x2e0fd7=_0x2e0f();let _0x35ab08=_0x2e0fd7[_0x5b02f9];return _0x35ab08;}function _0x2e0f(){const _0x36cd6d=['14744VSwNdo','6273960uZItRb','upsert','getBySubscriptionId','values','subs','1339270bPtNvU','594aqurPI','147020glshCU','3458DOerRn','uEDOg','36582iZtxJd','21yYyvtN','175GnNpUq','24jzMshf','105651owrdyX'];_0x2e0f=function(){return _0x36cd6d;};return _0x2e0f();}
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,42 +1,55 @@
1
1
  {
2
- "version": "0.8.1",
3
- "build": "2026-03-06T08:02:05.507Z",
2
+ "version": "0.10.0",
3
+ "build": "2026-07-03T09:22:00.154Z",
4
4
  "files": {
5
- "cli/analyze.js": "sha256:a6da07b9f07ca3bf6d56d6ca605b7e53a8b4dc99002e93b16643be9ef7b8cd46",
6
- "cli/config-cmd.js": "sha256:6751758f20479858ad4788a2fbd5093591f48f060558dd0d7d02166da3d0f8c0",
7
- "cli/index.js": "sha256:45c708613f0d81c908be0d23035b536552206ac57ff58513f8a6bda451163b57",
8
- "cli/init-cmd.js": "sha256:0b7cbe89847db71df46f00a9581f801070b3ef259cf816bb463543c76ceaf17c",
9
- "cli/setup-cmd.js": "sha256:c4fae763e73d12cd01171d9a820e6f7ecce0862dc8aaed80ddad692c92b60100",
10
- "cloud/stripe-checkout.js": "sha256:932ee0d2025c8cb170cc9b6fe86def9929eef6be613619db4bbdd5ab622e809e",
11
- "cloud/stripe-config.js": "sha256:35f6ef8518f77c416886d95695abc58b56d1c7ed5b0e5c255b8795b882c59603",
12
- "cloud/stripe-usage.js": "sha256:704d58ceab47b44adf02ca55cd223a455c5c659b0b1e5569409e34065567a86b",
13
- "cloud/stripe-webhooks.js": "sha256:c70b0ceeb9b705ae8176d45585dff063e33bf957f97a02ae48815222bd15aac8",
14
- "cloud/subscription-store.js": "sha256:5a4cc951ca16499f0e91219439a31d243f2b105ee5cea5721706fdd21e42a6be",
15
- "mcp/index.js": "sha256:d3959c17b2cba73c29e588e34b83abfdc115767d13b0fe2c671c24b7c774823c",
16
- "mcp/resources.js": "sha256:5f5e36ad6d20d2219fd335e4ee5b49a732daccf3b3907da3025ace0bcad1663f",
17
- "mcp/session.js": "sha256:7aa976c1e4df4a092c68c415fb42dda4294d97e348d007edac5042646862f4ed",
18
- "mcp/tools.js": "sha256:aa815f5f807d0ba3f3eb2c6bcf85b578d727fd6e35aa96c849795c28d12863dd",
19
- "plugin/cli.js": "sha256:14f75597ad5638c4336a5b6c40429e83caacce17cb4c84804d748c7a7f44a7d2",
20
- "plugin/config-loader.js": "sha256:2cf1b0c7dcf25b7b5323342080932da807b6c23f5314949a9176dc38fe86fd4b",
21
- "plugin/context-compressor.js": "sha256:546503e95e6627da78d17c1bad15b416ae8f72e4d5f0b51a4c41ba2a1ca482f8",
22
- "plugin/hook-dispatcher.js": "sha256:8dc48ee8fe77d6df320fbe7ffd2c4bb4ef1a68eed155db71896e389737b2d518",
23
- "plugin/metering-client.js": "sha256:e3021425b8652173a82efd4c80c5806743833ca251c6b96ce342fbdb17bc0114",
24
- "plugin/metrics-collector.js": "sha256:e5f76e59fca916a20cf96d3a90dd69261bf616853c7deb2240a15d3cf2dfc849",
25
- "plugin/onboarding.js": "sha256:b7b8820c54bdb95d5b5f974fb1cd2e12d5991a7b8b7a7469aec354a7a4e2ec06",
26
- "plugin/precompact-handler.js": "sha256:17d16a5f59df46ef267b27d0b4fc20e38be5bcc6941cee5eabb0c1daaae64894",
27
- "plugin/report.js": "sha256:9daff0042b8e9fe2bd0fc6f913256f60992c91316bf9301f5dd01e2fc38269c2",
28
- "plugin/rule-analytics-store.js": "sha256:dc43b03800d54f92203d0708bd7f8b274b0c34b63244591a39495c001eb926c2",
29
- "plugin/rule-analytics.js": "sha256:8cbe6c33ba85b73e04e4c7ac70d7ce518105a449d9cc8600d3a52981dbd34474",
30
- "plugin/rule-engine.js": "sha256:5bd06e650c4d44ab51fd8d30c07138d6a24d6d042e417e44075a13fada4ed5f4",
31
- "plugin/rule-sharing.js": "sha256:56334e01c285cb431ae7308f8e36a4f7869d18dce5e6627fc8f332784ccefeda",
32
- "plugin/rule-suggest.js": "sha256:35376afd45b087ad07eae5bc093b0998c80cd840fc3bb4984ae0309ff3e321e2",
33
- "plugin/session-start.js": "sha256:623284ca5a09970cce4d326dae243f0bccf8791c99dd24e68765eec72ecb67ed",
34
- "plugin/smart-context.js": "sha256:fceb4e17d91974590a8751663cb6e5cda77f6bf878375cd89a54fe798a3a4400",
35
- "shared/license.js": "sha256:cbd16f82da7040f5690b5b4da909bc642b0dee0d730cb917c8fc462a296315b5",
36
- "shared/providers/claude-provider.js": "sha256:9a3ba3b59eb631db5f4eed86788233f9f5294d9bb9f143ce9f9439f51640b142",
37
- "shared/providers/openai-provider.js": "sha256:9186756e6ed2020e376ea07cbf45c00afe072fa841015974fb33393a62ffb8cb",
38
- "shared/token-counter.js": "sha256:2eeb8c67c99c42a2d888b51da6a5691247d7d8207b150245be2f81080cb9daae",
39
- "shared/token-provider.js": "sha256:48c9e51680eabfbfd5527f0e477f03ea3ef42977c9f176eb79a0ed64aebf5e03",
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",
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",
40
53
  "shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
41
54
  }
42
55
  }
package/dist/mcp/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x316ca5=_0x5668;(function(_0x4bc693,_0x37765f){const _0x1d65db=_0x5668,_0x51f485=_0x4bc693();while(!![]){try{const _0x544e6d=parseInt(_0x1d65db(0xe2))/0x1+-parseInt(_0x1d65db(0xe5))/0x2*(-parseInt(_0x1d65db(0xf0))/0x3)+parseInt(_0x1d65db(0xeb))/0x4*(parseInt(_0x1d65db(0xe8))/0x5)+parseInt(_0x1d65db(0xed))/0x6+-parseInt(_0x1d65db(0xef))/0x7*(parseInt(_0x1d65db(0xe3))/0x8)+-parseInt(_0x1d65db(0xea))/0x9*(parseInt(_0x1d65db(0xee))/0xa)+-parseInt(_0x1d65db(0xec))/0xb;if(_0x544e6d===_0x37765f)break;else _0x51f485['push'](_0x51f485['shift']());}catch(_0x4534f1){_0x51f485['push'](_0x51f485['shift']());}}}(_0x3fb5,0x94a06));import'../shared/providers/claude-provider.js';function _0x5668(_0x33bec0,_0x1d612a){_0x33bec0=_0x33bec0-0xe2;const _0x3fb53e=_0x3fb5();let _0x566812=_0x3fb53e[_0x33bec0];return _0x566812;}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';function _0x3fb5(){const _0x36aa59=['763574kFrxEv','tokenizer-speedup\x20MCP\x20server\x20running','fsYZO','775iXAepN','connect','9558414gvvKHU','23628IWJhXi','14952553OuwKjk','4513110aqjQzd','10qsEuPZ','1442ifBWNT','9oZvHpw','lsCja','0.8.1','exit','SIGINT','666710EJYvZQ','17464xjWBDf','catch'];_0x3fb5=function(){return _0x36aa59;};return _0x3fb5();}import{registerResources}from'./resources.js';async function main(){const _0x152f97=_0x5668,_0x1d1e30={'lsCja':'tokenizer-speedup','fsYZO':function(_0x397d4d,_0x46cef7,_0xc233a3){return _0x397d4d(_0x46cef7,_0xc233a3);}},_0x3f1026=new McpServer({'name':_0x1d1e30[_0x152f97(0xf1)],'version':_0x152f97(0xf2)}),_0xb37286=createSession();_0x1d1e30[_0x152f97(0xe7)](registerTools,_0x3f1026,_0xb37286),_0x1d1e30[_0x152f97(0xe7)](registerResources,_0x3f1026,_0xb37286),process['on'](_0x152f97(0xf4),()=>{const _0x2436e3=_0x152f97;try{_0xb37286['getDispatcher']()['handleSessionStop']();}catch{}process[_0x2436e3(0xf3)](0x0);});const _0x58c338=new StdioServerTransport();await _0x3f1026[_0x152f97(0xe9)](_0x58c338),console['error'](_0x152f97(0xe6));}main()[_0x316ca5(0xe4)](_0x1628b1=>{const _0x1b6e1d=_0x316ca5;console['error']('tokenizer-speedup\x20MCP\x20server\x20failed\x20to\x20start:',_0x1628b1),process[_0x1b6e1d(0xf3)](0x1);});
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);});
@@ -1 +1 @@
1
- function _0x1c0c(){const _0x172400=['Returns\x20an\x20aggregated\x20report\x20of\x20token\x20savings\x20across\x20all\x20recorded\x20sessions,\x20including\x20baseline\x20vs.\x20optimized\x20counts,\x20cost\x20estimates,\x20and\x20rule\x20trigger\x20statistics.','report','application/json','tokenizer-speedup://report','4706552zHOhuU','95196LUFhYC','stringify','29160261klrVNY','108717iWqIaS','16vtzbTg','6ScCSKe','registerResource','5331720KrGFmb','hkfEQ','3422487tYlHfu','href','5706480jmCtWa','tokenizer-speedup://config'];_0x1c0c=function(){return _0x172400;};return _0x1c0c();}(function(_0x31043f,_0x3f41c8){const _0x44b61b=_0x5ba5,_0x54d404=_0x31043f();while(!![]){try{const _0x543d86=-parseInt(_0x44b61b(0x12f))/0x1*(parseInt(_0x44b61b(0x13d))/0x2)+parseInt(_0x44b61b(0x134))/0x3+-parseInt(_0x44b61b(0x13c))/0x4+-parseInt(_0x44b61b(0x136))/0x5+-parseInt(_0x44b61b(0x130))/0x6*(parseInt(_0x44b61b(0x140))/0x7)+-parseInt(_0x44b61b(0x132))/0x8+parseInt(_0x44b61b(0x13f))/0x9;if(_0x543d86===_0x3f41c8)break;else _0x54d404['push'](_0x54d404['shift']());}catch(_0xf8076d){_0x54d404['push'](_0x54d404['shift']());}}}(_0x1c0c,0x97360));import{generateReport}from'../plugin/report.js';function _0x5ba5(_0x33b6cc,_0x4b6442){_0x33b6cc=_0x33b6cc-0x12f;const _0x1c0c96=_0x1c0c();let _0x5ba58d=_0x1c0c96[_0x33b6cc];return _0x5ba58d;}export function registerResources(_0x498949,_0x21cbfd){const _0x5bbf47=_0x5ba5,_0x11262a={'YdyFl':_0x5bbf47(0x13a),'hkfEQ':_0x5bbf47(0x139),'HDMeh':_0x5bbf47(0x13b),'MCScJ':_0x5bbf47(0x138)};_0x498949['registerResource']('config',_0x5bbf47(0x137),{'title':'TokenizerSpeedUp\x20Configuration','description':'Returns\x20the\x20current\x20YAML-based\x20plugin\x20configuration\x20as\x20JSON,\x20including\x20rules,\x20context\x20limits,\x20and\x20metering\x20settings.','mimeType':_0x11262a['YdyFl']},async _0xf9d2b=>{const _0x1e0381=_0x5bbf47,_0x380f73=_0x21cbfd['getConfig']();return{'contents':[{'uri':_0xf9d2b[_0x1e0381(0x135)],'text':JSON['stringify'](_0x380f73,null,0x2)}]};}),_0x498949[_0x5bbf47(0x131)](_0x11262a[_0x5bbf47(0x133)],_0x11262a['HDMeh'],{'title':'TokenizerSpeedUp\x20Savings\x20Report','description':_0x11262a['MCScJ'],'mimeType':_0x11262a['YdyFl']},async _0x4815a=>{const _0x4cfeb4=_0x5bbf47;try{const _0x1fa0e7=generateReport(_0x21cbfd['projectRoot']);return{'contents':[{'uri':_0x4815a['href'],'text':JSON['stringify'](_0x1fa0e7,null,0x2)}]};}catch{return{'contents':[{'uri':_0x4815a[_0x4cfeb4(0x135)],'text':JSON[_0x4cfeb4(0x13e)]({'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(_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 +1 @@
1
- const _0x5cb64a=_0x5b88;(function(_0x57bde9,_0x372f82){const _0x403f7c=_0x5b88,_0x5aa177=_0x57bde9();while(!![]){try{const _0x45625c=parseInt(_0x403f7c(0xa4))/0x1*(-parseInt(_0x403f7c(0xaa))/0x2)+-parseInt(_0x403f7c(0xa6))/0x3+-parseInt(_0x403f7c(0xb6))/0x4+parseInt(_0x403f7c(0xaf))/0x5*(parseInt(_0x403f7c(0xa5))/0x6)+-parseInt(_0x403f7c(0xa8))/0x7*(parseInt(_0x403f7c(0xae))/0x8)+-parseInt(_0x403f7c(0xb0))/0x9*(-parseInt(_0x403f7c(0xac))/0xa)+parseInt(_0x403f7c(0xa7))/0xb*(parseInt(_0x403f7c(0xad))/0xc);if(_0x45625c===_0x372f82)break;else _0x5aa177['push'](_0x5aa177['shift']());}catch(_0x9e64e9){_0x5aa177['push'](_0x5aa177['shift']());}}}(_0x239a,0x49cbf));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 _0x239a(){const _0x6004b9=['7aWECwc','1592310oZlUvS','856341DSieAJ','33bXpdTM','7iTTebh','now','168218lbQWpP','claude-sonnet-4-20250514','99490IzaPWx','6791688Kfktss','2627368HpuWQz','5GosgEB','9kXBuiy','YXvwJ','claude','model','hqaoM','provider','1873416cdwGkf'];_0x239a=function(){return _0x6004b9;};return _0x239a();}function _0x5b88(_0x2d5a6e,_0xc540ea){_0x2d5a6e=_0x2d5a6e-0xa4;const _0x239a5a=_0x239a();let _0x5b88e5=_0x239a5a[_0x2d5a6e];return _0x5b88e5;}const DEFAULT_CONFIG={'version':0x1,'provider':_0x5cb64a(0xb2),'model':_0x5cb64a(0xab),'rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};export function createSession(_0x56a10a){const _0x4bd2c8=_0x5cb64a,_0x25ab21={'Efnrg':function(_0x43b10d,_0x5e7701){return _0x43b10d(_0x5e7701);},'hqaoM':function(_0x8551df,_0x23e35c){return _0x8551df(_0x23e35c);},'YXvwJ':function(_0x3eed77,_0x4ed86e,_0x3ec95f){return _0x3eed77(_0x4ed86e,_0x3ec95f);}};let _0x12df8d=_0x56a10a??process['cwd'](),_0x5b8f21=null,_0x3f34a2=null;const _0x461af0='mcp-session-'+Date[_0x4bd2c8(0xa9)]();let _0x328190=new MetricsCollector(_0x12df8d,_0x461af0);const _0x5abd5c={get 'projectRoot'(){return _0x12df8d;},get 'config'(){return _0x5b8f21;},get 'collector'(){return _0x328190;},get 'sessionId'(){return _0x461af0;},'getConfig':()=>(_0x5b8f21||(_0x5b8f21=(function(){const _0x24ea8f=_0x4bd2c8;try{return _0x25ab21['Efnrg'](loadConfig,_0x12df8d);}catch{return _0x25ab21[_0x24ea8f(0xb4)](structuredClone,DEFAULT_CONFIG);}}())),_0x5b8f21),'getDispatcher'(){if(!_0x3f34a2){const _0x13989b=_0x5abd5c['getConfig']();_0x3f34a2=new HookDispatcher(_0x13989b,_0x12df8d,_0x461af0);}return _0x3f34a2;},'getTokenProvider'(_0x54ebdd,_0x3f09a7){const _0x4d9495=_0x4bd2c8,_0x2a1756=_0x5abd5c['getConfig']();return _0x25ab21[_0x4d9495(0xb1)](createTokenProvider,_0x54ebdd??_0x2a1756[_0x4d9495(0xb5)],_0x3f09a7??_0x2a1756[_0x4d9495(0xb3)]);},'setProjectRoot'(_0x1c0194){_0x12df8d=_0x1c0194,_0x5b8f21=null,_0x3f34a2=null,_0x328190=new MetricsCollector(_0x12df8d,_0x461af0);}};return _0x5abd5c;}
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;}
package/dist/mcp/tools.js CHANGED
@@ -1 +1 @@
1
- function _0x56cc(){const _0x451412=['412447hLXrHc','string','YvLIi','provider','get-savings','Inline\x20text\x20to\x20analyze','registerTool','UserPromptSubmit','startsWith','gViiB','projectRoot','openai','vnRej','Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','text','114yzFidS','177420QhvQRM','map','word\x20heuristic\x20(words\x20×\x20','eXHDo','6944896WhsJrB','knVJl','Failed\x20to\x20read\x20file:\x20','2243415uyHDae','stringify','XtlvW','describe','10227FgaHqE','MbOoF','optional','vgWCU','total_baseline','3342IrBeLp','getConfig','getDispatcher','rules_triggered','svcAJ','prompts_count','analyze-tokens','getSessionSummary','Path\x20to\x20a\x20file\x20to\x20analyze','utf-8','message','countTokens','total_delta','matchAll','7152euDkQH','PMaKA','file_path\x20escapes\x20project\x20root.','9508194vXFxNj','1.3'];_0x56cc=function(){return _0x451412;};return _0x56cc();}(function(_0x5aa626,_0x35e89b){const _0x578456=_0x32af,_0x428394=_0x5aa626();while(!![]){try{const _0x382f89=-parseInt(_0x578456(0xd4))/0x1+-parseInt(_0x578456(0xcf))/0x2*(parseInt(_0x578456(0xb0))/0x3)+-parseInt(_0x578456(0xb1))/0x4+parseInt(_0x578456(0xb8))/0x5+-parseInt(_0x578456(0xc1))/0x6*(-parseInt(_0x578456(0xbc))/0x7)+parseInt(_0x578456(0xb5))/0x8+-parseInt(_0x578456(0xd2))/0x9;if(_0x382f89===_0x35e89b)break;else _0x428394['push'](_0x428394['shift']());}catch(_0x306b98){_0x428394['push'](_0x428394['shift']());}}}(_0x56cc,0x75888));import{readFile}from'node:fs/promises';function _0x32af(_0x4027e2,_0x539617){_0x4027e2=_0x4027e2-0xae;const _0x56cc51=_0x56cc();let _0x32afed=_0x56cc51[_0x4027e2];return _0x32afed;}import{resolve,normalize}from'node:path';import{z}from'zod';import{countTokens}from'../shared/token-counter.js';export function registerTools(_0x4f13a1,_0x2cd184){const _0x332e76=_0x32af,_0x35a5ea={'gViiB':function(_0x56b232,_0xb8d734){return _0x56b232-_0xb8d734;},'xHNQn':function(_0x55ed84,_0x370d5b){return _0x55ed84>_0x370d5b;},'PMaKA':'text','znlaB':function(_0x245c96,_0x144adc){return _0x245c96===_0x144adc;},'MbOoF':'Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.','gjkyA':_0x332e76(0xdf),'YvLIi':function(_0x4955a1,_0x17b38b){return _0x4955a1 instanceof _0x17b38b;},'vgWCU':function(_0xa55614,_0x4ff24a){return _0xa55614(_0x4ff24a);},'svcAJ':function(_0x3f7f77,_0x39dac3,_0x26b218){return _0x3f7f77(_0x39dac3,_0x26b218);},'vnRej':function(_0x27b376,_0x349e36,_0x113db3){return _0x27b376(_0x349e36,_0x113db3);},'KAGUG':_0x332e76(0xca),'khSGB':function(_0xb56b0d,_0x2d3315){return _0xb56b0d(_0x2d3315);},'XtlvW':_0x332e76(0xd3),'AiPMj':_0x332e76(0xae),'EAinb':'The\x20user\x20prompt\x20to\x20optimize','ezKWL':'Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided','HglkK':_0x332e76(0xc7),'otuEZ':'Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','iFQeJ':_0x332e76(0xd9),'eXHDo':'LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','knVJl':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','PQjem':_0x332e76(0xd8)};_0x4f13a1['registerTool']('optimize-context',{'description':_0x35a5ea['AiPMj'],'inputSchema':{'prompt':z[_0x332e76(0xd5)]()['describe'](_0x35a5ea['EAinb']),'project_path':z['string']()[_0x332e76(0xbe)]()[_0x332e76(0xbb)](_0x35a5ea['ezKWL'])}},async({prompt:_0x131dd1,project_path:_0x4ab0ed})=>{const _0x581aaa=_0x332e76;_0x4ab0ed&&_0x2cd184['setProjectRoot'](_0x4ab0ed);const _0x226917=_0x2cd184[_0x581aaa(0xc3)](),_0x2dbe8b=_0x226917[_0x581aaa(0xc8)](),_0x64830b={'session_id':_0x2cd184['sessionId'],'cwd':_0x2cd184['projectRoot'],'prompt':_0x131dd1,'hook_event_name':_0x581aaa(0xdb)},_0x411592=_0x226917['handleUserPromptSubmit'](_0x64830b),_0x31ed51=_0x35a5ea[_0x581aaa(0xdd)](_0x226917['getSessionSummary']()[_0x581aaa(0xcd)],_0x2dbe8b[_0x581aaa(0xcd)]),_0x5824a2=_0x411592['additionalContext']??'',_0x4cb919=_0x35a5ea['xHNQn'](_0x5824a2['length'],0x0)?countTokens(_0x5824a2):0x0,_0x47fe2c=[..._0x5824a2[_0x581aaa(0xce)](/^\[([^\]]+)\]/gm)][_0x581aaa(0xb2)](_0x573fa8=>_0x573fa8[0x1]),_0x18571d={'context':_0x5824a2,'rules_matched':_0x47fe2c,'tokens_injected':_0x4cb919,'tokens_saved':_0x31ed51};return{'content':[{'type':_0x35a5ea[_0x581aaa(0xd0)],'text':JSON[_0x581aaa(0xb9)](_0x18571d)}]};}),_0x4f13a1[_0x332e76(0xda)](_0x35a5ea['HglkK'],{'description':_0x35a5ea['otuEZ'],'inputSchema':{'text':z['string']()['optional']()['describe'](_0x35a5ea['iFQeJ']),'file_path':z[_0x332e76(0xd5)]()[_0x332e76(0xbe)]()['describe'](_0x332e76(0xc9)),'provider':z['string']()[_0x332e76(0xbe)]()[_0x332e76(0xbb)](_0x35a5ea[_0x332e76(0xb4)]),'model':z['string']()['optional']()[_0x332e76(0xbb)](_0x35a5ea[_0x332e76(0xb6)])}},async({text:_0x2521b7,file_path:_0x165b54,provider:_0x4e7f06,model:_0xd2b554})=>{const _0x192e90=_0x332e76;if(_0x35a5ea['znlaB'](void 0x0,_0x2521b7)&&void 0x0===_0x165b54)return{'content':[{'type':'text','text':JSON[_0x192e90(0xb9)]({'error':_0x35a5ea[_0x192e90(0xbd)]})}],'isError':!0x0};const _0xf9aec7=_0x4e7f06??_0x2cd184[_0x192e90(0xc2)]()[_0x192e90(0xd7)],_0x217871=_0xd2b554??(_0x35a5ea['gjkyA']===_0xf9aec7?'gpt-4o':_0x2cd184[_0x192e90(0xc2)]()['model']);let _0x2cc406,_0x2f0b33;try{_0x2cc406=_0x2cd184['getTokenProvider'](_0xf9aec7,_0x217871);}catch(_0x25c762){const _0x8544d=_0x35a5ea['YvLIi'](_0x25c762,Error)?_0x25c762[_0x192e90(0xcb)]:_0x35a5ea[_0x192e90(0xbf)](String,_0x25c762);return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON[_0x192e90(0xb9)]({'error':_0x8544d})}],'isError':!0x0};}if(void 0x0!==_0x2521b7)_0x2f0b33=_0x2521b7;else{const _0x1aacf3=normalize(_0x2cd184[_0x192e90(0xde)]),_0x548e4d=_0x35a5ea['vgWCU'](normalize,_0x35a5ea[_0x192e90(0xc5)](resolve,_0x1aacf3,_0x165b54));if(!_0x548e4d[_0x192e90(0xdc)](_0x1aacf3))return{'content':[{'type':_0x35a5ea[_0x192e90(0xd0)],'text':JSON['stringify']({'error':_0x192e90(0xd1)})}],'isError':!0x0};try{_0x2f0b33=await _0x35a5ea[_0x192e90(0xe0)](readFile,_0x548e4d,_0x35a5ea['KAGUG']);}catch(_0x592153){const _0x17152c=_0x35a5ea[_0x192e90(0xd6)](_0x592153,Error)?_0x592153[_0x192e90(0xcb)]:_0x35a5ea['khSGB'](String,_0x592153);return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON[_0x192e90(0xb9)]({'error':_0x192e90(0xb7)+_0x17152c})}],'isError':!0x0};}}const _0xd2d7e8={'tokens':_0x2cc406[_0x192e90(0xcc)](_0x2f0b33),'tokens_method':'BPE\x20tokenizer\x20(accurate)','estimate':_0x2cc406['estimateTokens'](_0x2f0b33),'estimate_method':_0x192e90(0xb3)+(_0x35a5ea['znlaB'](_0x35a5ea['gjkyA'],_0xf9aec7)?_0x35a5ea[_0x192e90(0xba)]:'1.4')+')','provider':_0xf9aec7,'model':_0x217871};return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON['stringify'](_0xd2d7e8)}]};}),_0x4f13a1['registerTool'](_0x35a5ea['PQjem'],{'description':'Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.'},async()=>{const _0x2bdde8=_0x332e76,_0x32928a=_0x2cd184[_0x2bdde8(0xc3)]()['getSessionSummary'](),_0x2036b5={'baseline_tokens':_0x32928a[_0x2bdde8(0xc0)],'optimized_tokens':_0x32928a['total_optimized'],'saved_tokens':_0x32928a['total_delta'],'saved_percent':_0x32928a['savings_percent'],'prompts_count':_0x32928a[_0x2bdde8(0xc6)],'rules_triggered':_0x32928a[_0x2bdde8(0xc4)]};return{'content':[{'type':_0x2bdde8(0xaf),'text':JSON[_0x2bdde8(0xb9)](_0x2036b5)}]};});}
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)}]};});}