@simosphere/tokenizer-speedup 0.8.1 → 0.9.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 (47) 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 +46 -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/chunked.js +1 -0
  19. package/dist/plugin/compression/index.js +1 -0
  20. package/dist/plugin/compression/pipeline.js +1 -0
  21. package/dist/plugin/compression/quality.js +1 -0
  22. package/dist/plugin/compression/rule-based.js +1 -0
  23. package/dist/plugin/compression/structural.js +1 -0
  24. package/dist/plugin/compression/text-utils.js +1 -0
  25. package/dist/plugin/compression/token-budget.js +1 -0
  26. package/dist/plugin/compression/types.js +1 -0
  27. package/dist/plugin/config-loader.js +1 -1
  28. package/dist/plugin/context-compressor.js +1 -1
  29. package/dist/plugin/hook-dispatcher.js +1 -1
  30. package/dist/plugin/metering-client.js +1 -1
  31. package/dist/plugin/metrics-collector.js +1 -1
  32. package/dist/plugin/onboarding.js +1 -1
  33. package/dist/plugin/precompact-handler.js +1 -1
  34. package/dist/plugin/report.js +1 -1
  35. package/dist/plugin/rule-analytics-store.js +1 -1
  36. package/dist/plugin/rule-analytics.js +1 -1
  37. package/dist/plugin/rule-engine.js +1 -1
  38. package/dist/plugin/rule-sharing.js +1 -1
  39. package/dist/plugin/rule-suggest.js +1 -1
  40. package/dist/plugin/session-start.js +1 -1
  41. package/dist/plugin/smart-context.js +1 -1
  42. package/dist/shared/license.js +1 -1
  43. package/dist/shared/providers/claude-provider.js +1 -1
  44. package/dist/shared/providers/openai-provider.js +1 -1
  45. package/dist/shared/token-counter.js +1 -1
  46. package/dist/shared/token-provider.js +1 -1
  47. 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 _0x33b627=_0x121c;(function(_0x5337b9,_0x117087){const _0x288da8=_0x121c,_0x33852e=_0x5337b9();while(!![]){try{const _0x4ea0ae=-parseInt(_0x288da8(0x78))/0x1*(-parseInt(_0x288da8(0x7c))/0x2)+parseInt(_0x288da8(0x7b))/0x3*(parseInt(_0x288da8(0x7a))/0x4)+parseInt(_0x288da8(0x72))/0x5*(parseInt(_0x288da8(0x70))/0x6)+-parseInt(_0x288da8(0x73))/0x7+-parseInt(_0x288da8(0x74))/0x8+-parseInt(_0x288da8(0x79))/0x9+parseInt(_0x288da8(0x6d))/0xa;if(_0x4ea0ae===_0x117087)break;else _0x33852e['push'](_0x33852e['shift']());}catch(_0x213128){_0x33852e['push'](_0x33852e['shift']());}}}(_0x72e1,0x88eab));import{readFileSync}from'node:fs';function _0x121c(_0x44fcb7,_0x2322c6){_0x44fcb7=_0x44fcb7-0x6d;const _0x72e115=_0x72e1();let _0x121cc5=_0x72e115[_0x44fcb7];return _0x121cc5;}import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x141a20,_0x405841=_0x33b627(0x6f),_0x3edbc1){const _0x4e90e0=_0x33b627,_0x34b0aa={'iENXt':function(_0x2fcbbd,_0x5cc8b9){return _0x2fcbbd===_0x5cc8b9;},'qUGTP':_0x4e90e0(0x6e)},_0x5874b1=_0x3edbc1??(_0x34b0aa[_0x4e90e0(0x7d)](_0x4e90e0(0x6f),_0x405841)?_0x4e90e0(0x76):_0x34b0aa['qUGTP']),_0x2ab246=createTokenProvider(_0x405841,_0x5874b1),_0x80aeb8=_0x141a20['split'](/\s+/)[_0x4e90e0(0x77)](Boolean)[_0x4e90e0(0x71)];return{'tokens':_0x2ab246['countTokens'](_0x141a20),'estimate':_0x2ab246[_0x4e90e0(0x75)](_0x141a20),'provider':_0x405841,'model':_0x5874b1,'chars':_0x141a20[_0x4e90e0(0x71)],'words':_0x80aeb8};}export function analyzeFile(_0x3c717b,_0x52234a='claude',_0x3b7513){const _0x379107={'vDqek':function(_0x206e8c,_0x1b5eb9,_0x2154fc,_0x2293d2){return _0x206e8c(_0x1b5eb9,_0x2154fc,_0x2293d2);},'RHVGX':'utf-8'};return _0x379107['vDqek'](analyzeText,readFileSync(_0x3c717b,_0x379107['RHVGX']),_0x52234a,_0x3b7513);}function _0x72e1(){const _0x189b0d=['claude','30RYVpKa','length','330895eIiLan','5240354wMCsmh','6519552wOviPN','estimateTokens','claude-sonnet-4-20250514','filter','1wKsjoz','1823868NlIugx','3764uTiOKF','2757kODSxT','1533082mGrAQv','iENXt','3648140OAuigl','gpt-4o'];_0x72e1=function(){return _0x189b0d;};return _0x72e1();}export function compareProviders(_0x5e7f9b){const _0x161c6e={'YUXcE':function(_0x2575c5,_0x17c2e9,_0x299f3c){return _0x2575c5(_0x17c2e9,_0x299f3c);},'koedo':'claude'};return{'claude':_0x161c6e['YUXcE'](analyzeText,_0x5e7f9b,_0x161c6e['koedo']),'openai':_0x161c6e['YUXcE'](analyzeText,_0x5e7f9b,'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(_0x2a3882,_0x3951e7){const _0x19e074=_0x171d,_0xf6e990=_0x2a3882();while(!![]){try{const _0x1e8e67=parseInt(_0x19e074(0x1e8))/0x1*(parseInt(_0x19e074(0x1e9))/0x2)+parseInt(_0x19e074(0x1e2))/0x3*(parseInt(_0x19e074(0x1db))/0x4)+parseInt(_0x19e074(0x1dd))/0x5*(-parseInt(_0x19e074(0x1df))/0x6)+-parseInt(_0x19e074(0x1dc))/0x7+parseInt(_0x19e074(0x1e3))/0x8*(-parseInt(_0x19e074(0x1d8))/0x9)+parseInt(_0x19e074(0x1e5))/0xa+-parseInt(_0x19e074(0x1e4))/0xb*(-parseInt(_0x19e074(0x1da))/0xc);if(_0x1e8e67===_0x3951e7)break;else _0xf6e990['push'](_0xf6e990['shift']());}catch(_0x5e3e7d){_0xf6e990['push'](_0xf6e990['shift']());}}}(_0x2176,0xad3c2));function _0x2176(){const _0x30daf6=['354GIBHzH','423ofmlPk','length','24dGYKAH','2065924ECUBVy','2277429aGgsoE','560eLDOsV','rules','73614nbJJLg','message','provider','3tHBGFk','140072ezQPHe','7360012PHGHMX','11250780qhwGDN','tolXm','model','1425YJsKZg'];_0x2176=function(){return _0x30daf6;};return _0x2176();}import'../shared/providers/claude-provider.js';function _0x171d(_0x3c9911,_0x243dd4){_0x3c9911=_0x3c9911-0x1d8;const _0x21762e=_0x2176();let _0x171d3c=_0x21762e[_0x3c9911];return _0x171d3c;}import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x35778c){const _0x34a9c9=_0x171d,_0x5da43e={'tolXm':function(_0x399588,_0x2469e5){return _0x399588(_0x2469e5);}};try{const _0x431da5=_0x5da43e[_0x34a9c9(0x1e6)](parseConfig,_0x35778c);return{'valid':!0x0,'provider':_0x431da5[_0x34a9c9(0x1e1)],'model':_0x431da5[_0x34a9c9(0x1e7)],'ruleCount':_0x431da5[_0x34a9c9(0x1de)][_0x34a9c9(0x1d9)]};}catch(_0x534e75){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x534e75[_0x34a9c9(0x1e0)]};}}
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
+ const _0x58bb9f=_0x5603;(function(_0x27152c,_0x38b2f4){const _0x32963d=_0x5603,_0x3069c7=_0x27152c();while(!![]){try{const _0x586a28=parseInt(_0x32963d(0xdb))/0x1+-parseInt(_0x32963d(0xe9))/0x2*(parseInt(_0x32963d(0xfb))/0x3)+-parseInt(_0x32963d(0xef))/0x4+parseInt(_0x32963d(0xe2))/0x5+parseInt(_0x32963d(0xde))/0x6+parseInt(_0x32963d(0xe8))/0x7+-parseInt(_0x32963d(0xf4))/0x8;if(_0x586a28===_0x38b2f4)break;else _0x3069c7['push'](_0x3069c7['shift']());}catch(_0x110e5d){_0x3069c7['push'](_0x3069c7['shift']());}}}(_0x30f3,0x3ab36));import{Command}from'commander';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';function _0x30f3(){const _0x2d071c=['option','claude-sonnet-4-20250514','70932rBoRsE','word\x20heuristic\x20(words\x20×\x20','K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.','stringify','BJTol','provider','command','BPE\x20tokenizer\x20(accurate)','argv','1.4','-m,\x20--model\x20<model>','ePKUG','error','after','PsgVn','[file]','XbsTQ','lbqWo','analyze','countTokens','IXsMV','init','Create\x20a\x20starter\x20tokenizer-speedup.yaml\x20in\x20the\x20current\x20directory','hERof','(inline)','utf-8','183351MNMZbm','argument','rules','849876DNQZxQ','cli/index','description','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','962535ZqzFjb','xsVAw','-t,\x20--text\x20<text>','KEmHf','config','Config\x20file\x20path','1833006ERzBzM','16shJlPA','\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','log','claude','Warning:\x20large\x20input\x20(','1.3','910432TzHStC','text','yVQsK','UAbIt','replace','977312UKaiaN','action','message','model','length'];_0x30f3=function(){return _0x2d071c;};return _0x30f3();}import{createTokenProvider}from'../shared/token-provider.js';import{readFileSync,realpathSync}from'node:fs';import{runSetup}from'./setup-cmd.js';import{runInit}from'./init-cmd.js';export function buildCLI(){const _0x112347=_0x5603,_0x2a427e={'xsVAw':function(_0xffe106,_0x592039){return _0xffe106(_0x592039);},'hERof':function(_0x53d2e1,_0x343b48){return _0x53d2e1!==_0x343b48;},'UAbIt':function(_0x1b46a6,_0x32592f){return _0x1b46a6/_0x32592f;},'HCvAK':_0x112347(0xca),'IXsMV':function(_0x47ecb7,_0x3c48c3,_0x54063b){return _0x47ecb7(_0x3c48c3,_0x54063b);},'KEmHf':'tsu','lXeDb':'TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI','tVwrS':'0.8.1','azlBz':'setup','iSDoZ':_0x112347(0xe1),'XbsTQ':_0x112347(0xd3),'lbqWo':'[file]','BJTol':'File\x20to\x20analyze','PzXjh':'LLM\x20provider\x20(claude,\x20openai)','yVQsK':'claude','ePKUG':'Model\x20name','PsgVn':_0x112347(0xe4),'kfbOp':_0x112347(0xe6),'PSBqQ':'Validate\x20configuration\x20file'},_0x2cbcb0=new Command();return _0x2cbcb0['name'](_0x2a427e[_0x112347(0xe5)])[_0x112347(0xe0)](_0x2a427e['lXeDb'])['version'](_0x2a427e['tVwrS'])['addHelpText'](_0x112347(0xce),_0x112347(0xea)),_0x2cbcb0['command'](_0x2a427e['azlBz'])[_0x112347(0xe0)](_0x2a427e['iSDoZ'])['requiredOption']('--api-key\x20<key>','Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)')[_0x112347(0xf5)](_0x425544=>{_0x2a427e['xsVAw'](runSetup,_0x425544['apiKey']);}),_0x2cbcb0[_0x112347(0xc7)](_0x2a427e[_0x112347(0xd1)])[_0x112347(0xe0)]('Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text')[_0x112347(0xdc)](_0x2a427e[_0x112347(0xd2)],_0x2a427e[_0x112347(0xc5)])[_0x112347(0xf9)]('-p,\x20--provider\x20<provider>',_0x2a427e['PzXjh'],_0x2a427e[_0x112347(0xf1)])['option'](_0x112347(0xcb),_0x2a427e[_0x112347(0xcc)])[_0x112347(0xf9)](_0x2a427e[_0x112347(0xcf)],'Analyze\x20inline\x20text\x20instead\x20of\x20file')[_0x112347(0xf5)]((_0x51e019,_0x5759ef)=>{const _0x490451=_0x112347,_0x57de37=_0x5759ef[_0x490451(0xf7)]??(_0x490451(0xec)===_0x5759ef['provider']?_0x490451(0xfa):'gpt-4o');let _0x2e5d7e,_0x4d0691;try{_0x2e5d7e=createTokenProvider(_0x5759ef['provider'],_0x57de37);}catch(_0x5d85bc){return console[_0x490451(0xcd)]('Error:\x20'+_0x5d85bc[_0x490451(0xf6)]),void(process['exitCode']=0x1);}if(_0x2a427e[_0x490451(0xd8)](void 0x0,_0x5759ef['text']))_0x4d0691=_0x5759ef[_0x490451(0xf0)];else{if(!_0x51e019)return console['error']('Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option'),void(process['exitCode']=0x1);_0x4d0691=readFileSync(_0x51e019,_0x490451(0xda));}_0x4d0691[_0x490451(0xf8)]>0x7a120&&console['error'](_0x490451(0xed)+_0x2a427e[_0x490451(0xf2)](_0x4d0691['length'],0x3e8)['toFixed'](0x0)+_0x490451(0xc3));const _0x5b75e6=_0x2e5d7e[_0x490451(0xd4)](_0x4d0691),_0x1f41cc=_0x2e5d7e['estimateTokens'](_0x4d0691);console[_0x490451(0xeb)](JSON['stringify']({'file':_0x51e019??_0x490451(0xd9),'tokens':_0x5b75e6,'tokens_method':_0x490451(0xc8),'estimate':_0x1f41cc,'estimate_method':_0x490451(0xfc)+('openai'===_0x5759ef[_0x490451(0xc6)]?_0x490451(0xee):_0x2a427e['HCvAK'])+')','provider':_0x5759ef[_0x490451(0xc6)],'model':_0x57de37}));}),_0x2cbcb0[_0x112347(0xc7)](_0x2a427e['kfbOp'])[_0x112347(0xe0)](_0x2a427e['PSBqQ'])['argument'](_0x112347(0xd0),_0x112347(0xe7),'tokenizer-speedup.yaml')['action'](async _0x2a1412=>{const _0xfb2ea=_0x112347;try{const _0x289904=_0x2a427e[_0xfb2ea(0xd5)](readFileSync,_0x2a1412,_0xfb2ea(0xda)),{parseConfig:_0x15f25a}=await import('../plugin/config-loader.js'),_0x5ddab3=_0x2a427e[_0xfb2ea(0xe3)](_0x15f25a,_0x289904);console['log'](JSON['stringify']({'valid':!0x0,'provider':_0x5ddab3[_0xfb2ea(0xc6)],'model':_0x5ddab3['model'],'ruleCount':_0x5ddab3[_0xfb2ea(0xdd)]['length']}));}catch(_0x4e78d9){console['log'](JSON[_0xfb2ea(0xc4)]({'valid':!0x1,'error':_0x4e78d9['message']})),process['exitCode']=0x1;}}),_0x2cbcb0[_0x112347(0xc7)](_0x112347(0xd6))[_0x112347(0xe0)](_0x112347(0xd7))[_0x112347(0xf5)](()=>{runInit();}),_0x2cbcb0;}const resolvedArgv1=((()=>{const _0x3196e9=_0x5603;try{return realpathSync(process[_0x3196e9(0xc9)][0x1]??'')[_0x3196e9(0xf3)](/\\/g,'/');}catch{return process[_0x3196e9(0xc9)][0x1]?.[_0x3196e9(0xf3)](/\\/g,'/')??'';}})());function _0x5603(_0x69cbf1,_0x5d9afc){_0x69cbf1=_0x69cbf1-0xc3;const _0x30f3b0=_0x30f3();let _0x560314=_0x30f3b0[_0x69cbf1];return _0x560314;}resolvedArgv1['includes'](_0x58bb9f(0xdf))&&buildCLI()['parse']();
@@ -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
+ const _0x2f47c4=_0xb127;function _0x2f9d(){const _0xc01917=['177lagwAi','tokenizer-speedup.yaml\x20already\x20exists\x20in\x20this\x20directory.','34DurVOM','5TMjBoY','47797QoZqfo','Created\x20tokenizer-speedup.yaml','11256300Yningo','error','48788cXlEQM','vWumu','22140459KIEhLy','exitCode','log','2595342Hbfllv','#\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','717471XpqwGd','\x20\x202.\x20Run:\x20tsu\x20config\x20tokenizer-speedup.yaml\x20\x20(to\x20validate)','8182825fAzWEE','gHGlw','\x20\x203.\x20Restart\x20Claude\x20Code\x20to\x20pick\x20up\x20the\x20new\x20config','utf-8','cwd','168QeyNCu'];_0x2f9d=function(){return _0xc01917;};return _0x2f9d();}(function(_0x106794,_0x1f6546){const _0x5a8954=_0xb127,_0x1b2a65=_0x106794();while(!![]){try{const _0x342fdd=parseInt(_0x5a8954(0xaf))/0x1*(-parseInt(_0x5a8954(0xad))/0x2)+parseInt(_0x5a8954(0xc2))/0x3*(-parseInt(_0x5a8954(0xb3))/0x4)+parseInt(_0x5a8954(0xae))/0x5*(parseInt(_0x5a8954(0xb8))/0x6)+parseInt(_0x5a8954(0xbc))/0x7+parseInt(_0x5a8954(0xc1))/0x8*(parseInt(_0x5a8954(0xba))/0x9)+parseInt(_0x5a8954(0xb1))/0xa+-parseInt(_0x5a8954(0xb5))/0xb;if(_0x342fdd===_0x1f6546)break;else _0x1b2a65['push'](_0x1b2a65['shift']());}catch(_0x571a48){_0x1b2a65['push'](_0x1b2a65['shift']());}}}(_0x2f9d,0xd1100));import{writeFileSync,existsSync}from'node:fs';function _0xb127(_0x15f257,_0x44b6d8){_0x15f257=_0x15f257-0xac;const _0x2f9dc5=_0x2f9d();let _0xb1279e=_0x2f9dc5[_0x15f257];return _0xb1279e;}import{join}from'node:path';const STARTER_CONFIG=_0x2f47c4(0xb9);export function runInit(){const _0x28c6ac=_0x2f47c4,_0xb03cb2={'PyXia':function(_0xe1fbd,_0x1a6593,_0x4c6064){return _0xe1fbd(_0x1a6593,_0x4c6064);},'zozVR':function(_0x29acbf,_0x38c4cc){return _0x29acbf(_0x38c4cc);},'UgPxu':function(_0x41c902,_0x5ea4f8,_0x2734d1,_0x18e5c6){return _0x41c902(_0x5ea4f8,_0x2734d1,_0x18e5c6);},'vWumu':_0x28c6ac(0xb0),'gHGlw':'\x20\x201.\x20Edit\x20the\x20rules\x20to\x20match\x20your\x20project\x20structure','juWzo':_0x28c6ac(0xbe)},_0x3e6e48=_0xb03cb2['PyXia'](join,process[_0x28c6ac(0xc0)](),'tokenizer-speedup.yaml');if(_0xb03cb2['zozVR'](existsSync,_0x3e6e48))return console[_0x28c6ac(0xb2)](_0x28c6ac(0xac)),void(process[_0x28c6ac(0xb6)]=0x1);_0xb03cb2['UgPxu'](writeFileSync,_0x3e6e48,STARTER_CONFIG,_0x28c6ac(0xbf)),console[_0x28c6ac(0xb7)](_0xb03cb2[_0x28c6ac(0xb4)]),console['log'](''),console[_0x28c6ac(0xb7)]('Next\x20steps:'),console[_0x28c6ac(0xb7)](_0xb03cb2[_0x28c6ac(0xbd)]),console['log'](_0x28c6ac(0xbb)),console[_0x28c6ac(0xb7)](_0xb03cb2['juWzo']);}
@@ -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 _0x5926(){const _0x1f45f9=['3318357XKBsZd','✅\x20API\x20key\x20saved\x20successfully.','6LfOiKo','Stop','error','72JDQoMM','command','856398FFaToq','ukiQq','apiKey','Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.','settings.local.json','length','trim','log','27108675RFZRlr','YiTit','135530PgqyYf','message','191215yTmFPs','3757473vNVBjz','jUZeS','iyUrN','utf-8','exitCode','jqWLr','✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.','jhTAs','FeAUr','stringify','bJdjt','MjUjC','parse','tokenizer-speedup','2946568kqtRvH'];_0x5926=function(){return _0x1f45f9;};return _0x5926();}const _0x506328=_0x2d8f;(function(_0x359ea1,_0x31706c){const _0x5c281a=_0x2d8f,_0x28b22b=_0x359ea1();while(!![]){try{const _0x4cb707=-parseInt(_0x5c281a(0x1be))/0x1*(parseInt(_0x5c281a(0x1d2))/0x2)+-parseInt(_0x5c281a(0x1c1))/0x3+parseInt(_0x5c281a(0x1d5))/0x4*(-parseInt(_0x5c281a(0x1c0))/0x5)+-parseInt(_0x5c281a(0x1d7))/0x6+parseInt(_0x5c281a(0x1d0))/0x7+-parseInt(_0x5c281a(0x1cf))/0x8+parseInt(_0x5c281a(0x1df))/0x9;if(_0x4cb707===_0x31706c)break;else _0x28b22b['push'](_0x28b22b['shift']());}catch(_0x329f43){_0x28b22b['push'](_0x28b22b['shift']());}}}(_0x5926,0x993a1));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';function _0x2d8f(_0x46e17f,_0x4365e0){_0x46e17f=_0x46e17f-0x1bd;const _0x5926ac=_0x5926();let _0x2d8f45=_0x5926ac[_0x46e17f];return _0x2d8f45;}const CONFIG_DIR=join(homedir(),'.config',_0x506328(0x1ce)),CONFIG_FILE=join(CONFIG_DIR,'config.json'),CLAUDE_SETTINGS_FILE=join(homedir(),'.claude',_0x506328(0x1db));export function runSetup(_0x39f417){const _0x53e3c0=_0x506328,_0x45d042={'jUZeS':'❌\x20API\x20key\x20cannot\x20be\x20empty.','bJdjt':'❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).','jqWLr':function(_0x4fe9c4,_0x51926c){return _0x4fe9c4(_0x51926c);},'PCdfs':_0x53e3c0(0x1d1),'jhTAs':'⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','YiTit':function(_0x342577){return _0x342577();},'WCpEm':_0x53e3c0(0x1da)};try{if(!_0x39f417||0x0===_0x39f417[_0x53e3c0(0x1dd)]()[_0x53e3c0(0x1dc)])return console['error'](_0x45d042[_0x53e3c0(0x1c2)]),void(process[_0x53e3c0(0x1c5)]=0x1);if(_0x39f417[_0x53e3c0(0x1dd)]()[_0x53e3c0(0x1dc)]<0x8)return console[_0x53e3c0(0x1d4)](_0x45d042[_0x53e3c0(0x1cb)]),void(process[_0x53e3c0(0x1c5)]=0x1);_0x45d042[_0x53e3c0(0x1c6)](saveApiKey,_0x39f417['trim']()),console['log'](_0x45d042['PCdfs']),console[_0x53e3c0(0x1de)](_0x45d042[_0x53e3c0(0x1c8)]),_0x45d042[_0x53e3c0(0x1bd)](registerHooks),console['log'](_0x53e3c0(0x1c7)),console[_0x53e3c0(0x1de)](''),console['log'](_0x45d042['WCpEm']);}catch(_0x4f0eb0){console[_0x53e3c0(0x1d4)]('❌\x20Setup\x20failed:\x20'+_0x4f0eb0[_0x53e3c0(0x1bf)]),process[_0x53e3c0(0x1c5)]=0x1;}}function saveApiKey(_0x1836e1){const _0x439858=_0x506328,_0x24caba={'ukiQq':function(_0x2f87b3,_0x267fdf,_0x3a670f,_0x5a2778){return _0x2f87b3(_0x267fdf,_0x3a670f,_0x5a2778);}};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x37fffb={};try{_0x37fffb=JSON[_0x439858(0x1cd)](readFileSync(CONFIG_FILE,_0x439858(0x1c4)));}catch{}_0x37fffb[_0x439858(0x1d9)]=_0x1836e1,_0x24caba[_0x439858(0x1d8)](writeFileSync,CONFIG_FILE,JSON['stringify'](_0x37fffb,null,0x2)+'\x0a','utf-8');}function registerHooks(){const _0x546430=_0x506328,_0x161f25={'MjUjC':function(_0x2aeed9,_0x538996,_0xee300){return _0x2aeed9(_0x538996,_0xee300);},'FeAUr':function(_0x1c5e87){return _0x1c5e87();},'fvNHI':'.claude','zcYlL':_0x546430(0x1c4),'iyUrN':_0x546430(0x1d6),'KTmvl':'tokenizer-speedup'};_0x161f25[_0x546430(0x1cc)](mkdirSync,_0x161f25[_0x546430(0x1cc)](join,_0x161f25[_0x546430(0x1c9)](homedir),_0x161f25['fvNHI']),{'recursive':!0x0});let _0x55f5e7={};try{_0x55f5e7=JSON['parse'](readFileSync(CLAUDE_SETTINGS_FILE,_0x161f25['zcYlL']));}catch{}const _0x2391c5=_0x55f5e7['hooks']??{};_0x2391c5['SessionStart']=[{'matcher':'startup|resume|clear|compact','hooks':[{'type':_0x161f25[_0x546430(0x1c3)],'command':_0x161f25['KTmvl'],'timeout':0x5}]}],_0x2391c5['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':_0x546430(0x1d6),'command':'tokenizer-speedup'}]}],_0x2391c5['PreCompact']=[{'matcher':'','hooks':[{'type':'command','command':_0x546430(0x1ce),'timeout':0xa}]}],_0x2391c5[_0x546430(0x1d3)]=[{'matcher':'','hooks':[{'type':_0x161f25[_0x546430(0x1c3)],'command':'tokenizer-speedup','timeout':0xa}]}],_0x55f5e7['hooks']=_0x2391c5,writeFileSync(CLAUDE_SETTINGS_FILE,JSON[_0x546430(0x1ca)](_0x55f5e7,null,0x2)+'\x0a',_0x546430(0x1c4));}export function loadApiKeyFromConfig(){const _0x320bcd=_0x506328,_0x2c8359={'YvZPQ':_0x320bcd(0x1c4)};try{return JSON[_0x320bcd(0x1cd)](readFileSync(CONFIG_FILE,_0x2c8359['YvZPQ']))[_0x320bcd(0x1d9)]??void 0x0;}catch{return;}}
@@ -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 _0x5dc3(_0x2f3bfd,_0x3dbb6f){_0x2f3bfd=_0x2f3bfd-0x77;const _0x296280=_0x2962();let _0x5dc3ef=_0x296280[_0x2f3bfd];return _0x5dc3ef;}function _0x2962(){const _0x1c4285=['subscription','1580448HOWLWP','successUrl','242298CcaTgW','push','2767233xfxkel','20872rbJBTQ','824190japBsm','meteredPriceId','347442zPtuPM','3094856XJgllo','tier','655AfDJXJ'];_0x2962=function(){return _0x1c4285;};return _0x2962();}(function(_0x3ba1c4,_0x4873dc){const _0x5643fc=_0x5dc3,_0x3f3b41=_0x3ba1c4();while(!![]){try{const _0x3f9658=parseInt(_0x5643fc(0x77))/0x1+-parseInt(_0x5643fc(0x7e))/0x2+-parseInt(_0x5643fc(0x82))/0x3+parseInt(_0x5643fc(0x81))/0x4*(parseInt(_0x5643fc(0x7a))/0x5)+-parseInt(_0x5643fc(0x7c))/0x6+parseInt(_0x5643fc(0x80))/0x7+-parseInt(_0x5643fc(0x78))/0x8;if(_0x3f9658===_0x4873dc)break;else _0x3f3b41['push'](_0x3f3b41['shift']());}catch(_0x31a50f){_0x3f3b41['push'](_0x3f3b41['shift']());}}}(_0x2962,0x5cd0f));export function buildCheckoutParams(_0x4bd3d1){const _0x5870d4=_0x5dc3,_0x225ef5={'lApww':_0x5870d4(0x7b)},_0x52b7fe=[{'price':_0x4bd3d1['recurringPriceId'],'quantity':0x1}];return _0x4bd3d1[_0x5870d4(0x83)]&&_0x52b7fe[_0x5870d4(0x7f)]({'price':_0x4bd3d1['meteredPriceId']}),{'customer':_0x4bd3d1['customerId'],'mode':_0x225ef5['lApww'],'line_items':_0x52b7fe,'success_url':_0x4bd3d1[_0x5870d4(0x7d)],'cancel_url':_0x4bd3d1['cancelUrl'],'metadata':{'tier':_0x4bd3d1[_0x5870d4(0x79)]}};}
@@ -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
+ const _0x15bba3=_0x2008;(function(_0x3e2ce7,_0x1dadf5){const _0x5e6067=_0x2008,_0x566583=_0x3e2ce7();while(!![]){try{const _0x3e777f=-parseInt(_0x5e6067(0x149))/0x1*(-parseInt(_0x5e6067(0x14b))/0x2)+-parseInt(_0x5e6067(0x147))/0x3*(-parseInt(_0x5e6067(0x14f))/0x4)+parseInt(_0x5e6067(0x156))/0x5*(-parseInt(_0x5e6067(0x155))/0x6)+-parseInt(_0x5e6067(0x154))/0x7*(-parseInt(_0x5e6067(0x152))/0x8)+-parseInt(_0x5e6067(0x14e))/0x9+-parseInt(_0x5e6067(0x157))/0xa*(-parseInt(_0x5e6067(0x14d))/0xb)+parseInt(_0x5e6067(0x153))/0xc*(-parseInt(_0x5e6067(0x14c))/0xd);if(_0x3e777f===_0x1dadf5)break;else _0x566583['push'](_0x566583['shift']());}catch(_0x1d0c1e){_0x566583['push'](_0x566583['shift']());}}}(_0x330d,0xb6216));function _0x330d(){const _0x47c9ab=['696865hNzRrG','TokenizerSpeedUp\x20Team','4pMwtfM','962GpKZPQ','77HQYaDO','2801997OrQoNX','7636zPlUsX','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','2041944dqpMtC','271212cMYZlZ','21gOWKKu','381216RlFgfD','30tqvirb','1193030IKVhrv','183IDZPPp','TokenizerSpeedUp\x20Pro'];_0x330d=function(){return _0x47c9ab;};return _0x330d();}function _0x2008(_0x1dedd9,_0x2aae02){_0x1dedd9=_0x1dedd9-0x147;const _0x330def=_0x330d();let _0x200898=_0x330def[_0x1dedd9];return _0x200898;}export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':'Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','recurringPrice':0x0},'pro':{'name':_0x15bba3(0x148),'description':_0x15bba3(0x151),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':_0x15bba3(0x14a),'description':_0x15bba3(0x150),'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 _0x5bc67a=_0x1e6b;(function(_0x5d6a7c,_0x1491f6){const _0x18e154=_0x1e6b,_0x44cb8c=_0x5d6a7c();while(!![]){try{const _0x58fa09=parseInt(_0x18e154(0xd3))/0x1*(-parseInt(_0x18e154(0xd9))/0x2)+parseInt(_0x18e154(0xe4))/0x3*(parseInt(_0x18e154(0xd8))/0x4)+-parseInt(_0x18e154(0xd6))/0x5*(-parseInt(_0x18e154(0xda))/0x6)+parseInt(_0x18e154(0xdc))/0x7+-parseInt(_0x18e154(0xd4))/0x8+parseInt(_0x18e154(0xd2))/0x9*(-parseInt(_0x18e154(0xdd))/0xa)+parseInt(_0x18e154(0xd7))/0xb;if(_0x58fa09===_0x1491f6)break;else _0x44cb8c['push'](_0x44cb8c['shift']());}catch(_0x343709){_0x44cb8c['push'](_0x44cb8c['shift']());}}}(_0x201e,0x5ad6e));function _0x201e(){const _0x59b3c3=['4380icRpLU','1135476dlsavY','allowance','3013115UVwboN','1786930FzpCCI','unitRate','meteredUnitAmount','now','floor','team','dujHl','10683VyFFMp','aBDbZ','ceil','27qHXOrU','70veNXQU','2560000EkESLo','chargeableUnits','10SLFtkH','1048806tzUsDI','536HgtQWh'];_0x201e=function(){return _0x59b3c3;};return _0x201e();}import{STRIPE_CONFIG}from'./stripe-config.js';function _0x1e6b(_0x2efd77,_0x3f46ac){_0x2efd77=_0x2efd77-0xd1;const _0x201e89=_0x201e();let _0x1e6b36=_0x201e89[_0x2efd77];return _0x1e6b36;}const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG['pro'][_0x5bc67a(0xdf)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG[_0x5bc67a(0xe2)]['meteredUnitAmount']}};export function calculateUsageCharge(_0x2418e0,_0x349e88){const _0x2e70ef=_0x5bc67a,_0x4a7b40={'dujHl':function(_0x2b164d,_0x34451e){return _0x2b164d*_0x34451e;}},_0x505789=TIER_LIMITS[_0x2418e0];if(0x0===_0x505789['unitRate'])return{'tier':_0x2418e0,'tokensSaved':_0x349e88,'freeAllowance':_0x505789[_0x2e70ef(0xdb)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x138628=Math['max'](0x0,_0x349e88-_0x505789[_0x2e70ef(0xdb)]),_0x5d23f1=Math[_0x2e70ef(0xd1)](_0x138628/0x186a0),_0x4df7ec=_0x4a7b40[_0x2e70ef(0xe3)](_0x5d23f1,_0x505789[_0x2e70ef(0xde)]);return{'tier':_0x2418e0,'tokensSaved':_0x349e88,'freeAllowance':_0x505789[_0x2e70ef(0xdb)],'chargeableTokens':_0x138628,'chargeableUnits':_0x5d23f1,'unitRate':_0x505789['unitRate'],'amount':_0x4df7ec};}export function buildUsageRecord(_0x5cfa9d,_0xb85db7){const _0x4804b5=_0x5bc67a;return{'subscription_item':_0x5cfa9d,'quantity':_0xb85db7,'action':'set','timestamp':Math[_0x4804b5(0xe1)](Date[_0x4804b5(0xe0)]()/0x3e8)};}export function prepareUsageSync(_0x44cd59,_0x28d1c8,_0x15b949){const _0x513475=_0x5bc67a,_0x3525d6={'aNFIS':function(_0x3ae90a,_0x134189,_0xa27858){return _0x3ae90a(_0x134189,_0xa27858);},'aBDbZ':function(_0xe62e7,_0x3d90bd){return _0xe62e7===_0x3d90bd;},'KxwuY':function(_0x32e02a,_0x341333,_0x2ac756){return _0x32e02a(_0x341333,_0x2ac756);}};if(!_0x15b949)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x44cd59,'error':'no\x20subscription_item_id'};const _0x2f54a0=_0x3525d6['aNFIS'](calculateUsageCharge,_0x44cd59,_0x28d1c8);if(_0x3525d6[_0x513475(0xe5)](0x0,_0x2f54a0['chargeableUnits']))return{'synced':!0x0,'subscriptionItemId':_0x15b949,'chargeableUnits':0x0,'tier':_0x44cd59};return _0x3525d6['KxwuY'](buildUsageRecord,_0x15b949,_0x2f54a0['chargeableUnits']),{'synced':!0x0,'subscriptionItemId':_0x15b949,'chargeableUnits':_0x2f54a0[_0x513475(0xd5)],'tier':_0x44cd59};}
@@ -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 _0x4dc2(_0x42fb57,_0x2f1a63){_0x42fb57=_0x42fb57-0x68;const _0x217855=_0x2178();let _0x4dc284=_0x217855[_0x42fb57];return _0x4dc284;}function _0x2178(){const _0x504d79=['data','976654uxWVKA','current_period_end','metered','invoice.paid','object','wgfAQ','usage_type','invoice_paid','4458wuZVTY','6kMthjO','514695vGxtdF','11veeYWT','357jHZdaQ','type','481AfakMj','265340NhVQLO','customer','2409324zrIrbQ','subscription_updated','299orlplK','price','active','37848bvxyHE','1005957UmUnPY','6PCuMUd','10wYoaxD','customer.subscription.updated','upsert','InXoT'];_0x2178=function(){return _0x504d79;};return _0x2178();}(function(_0x290947,_0x1663a1){const _0x2bf56d=_0x4dc2,_0x79b910=_0x290947();while(!![]){try{const _0x27f30c=-parseInt(_0x2bf56d(0x71))/0x1*(parseInt(_0x2bf56d(0x6b))/0x2)+-parseInt(_0x2bf56d(0x7b))/0x3*(-parseInt(_0x2bf56d(0x72))/0x4)+-parseInt(_0x2bf56d(0x6d))/0x5*(-parseInt(_0x2bf56d(0x6c))/0x6)+-parseInt(_0x2bf56d(0x6f))/0x7*(parseInt(_0x2bf56d(0x79))/0x8)+parseInt(_0x2bf56d(0x7a))/0x9*(-parseInt(_0x2bf56d(0x7c))/0xa)+-parseInt(_0x2bf56d(0x6e))/0xb*(-parseInt(_0x2bf56d(0x74))/0xc)+parseInt(_0x2bf56d(0x76))/0xd*(parseInt(_0x2bf56d(0x81))/0xe);if(_0x27f30c===_0x1663a1)break;else _0x79b910['push'](_0x79b910['shift']());}catch(_0x217146){_0x79b910['push'](_0x79b910['shift']());}}}(_0x2178,0x96506));export function handleWebhookEvent(_0x164938,_0x7699b1){const _0x4098eb=_0x4dc2,_0x43a378={'zMRuo':_0x4098eb(0x6a),'InXoT':_0x4098eb(0x78),'BPiOv':'customer.subscription.deleted','lekZJ':'subscription_canceled','wgfAQ':'free','FPaeA':'ignored'};switch(_0x164938[_0x4098eb(0x70)]){case _0x4098eb(0x84):{const _0x38c133=_0x164938[_0x4098eb(0x80)][_0x4098eb(0x85)];return{'handled':!0x0,'action':_0x43a378['zMRuo'],'customerId':_0x38c133[_0x4098eb(0x73)],'subscriptionId':_0x38c133['subscription']};}case _0x4098eb(0x7d):{const _0x36f253=_0x164938[_0x4098eb(0x80)]['object'],_0x2bf1cf={'handled':!0x0,'action':_0x4098eb(0x75),'customerId':_0x36f253[_0x4098eb(0x73)],'subscriptionId':_0x36f253['id']};return _0x7699b1&&_0x7699b1[_0x4098eb(0x7e)]({'id':_0x36f253['id'],'customerId':_0x36f253[_0x4098eb(0x73)],'status':_0x36f253['status']||_0x43a378[_0x4098eb(0x7f)],'tier':_0x36f253['metadata']?.['tier']||'free','currentPeriodEnd':_0x36f253[_0x4098eb(0x82)]||0x0,'meteredSubscriptionItemId':extractMeteredItemId(_0x36f253),'updatedAt':''}),_0x2bf1cf;}case _0x43a378['BPiOv']:{const _0x45fafc=_0x164938[_0x4098eb(0x80)][_0x4098eb(0x85)],_0x52a7fe={'handled':!0x0,'action':_0x43a378['lekZJ'],'customerId':_0x45fafc['customer'],'subscriptionId':_0x45fafc['id']};return _0x7699b1&&_0x7699b1['upsert']({'id':_0x45fafc['id'],'customerId':_0x45fafc[_0x4098eb(0x73)],'status':'canceled','tier':_0x45fafc['metadata']?.['tier']||_0x43a378[_0x4098eb(0x68)],'currentPeriodEnd':_0x45fafc['current_period_end']||0x0,'updatedAt':''}),_0x52a7fe;}default:return{'handled':!0x1,'action':_0x43a378['FPaeA']};}}function extractMeteredItemId(_0x2a6e1f){const _0x10be84=_0x4dc2,_0x564fff=_0x2a6e1f['items'];if(!_0x564fff?.[_0x10be84(0x80)])return;const _0x153441=_0x564fff['data']['find'](_0x5b383b=>_0x10be84(0x83)===_0x5b383b[_0x10be84(0x77)]?.['recurring']?.[_0x10be84(0x69)]);return _0x153441?.['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
+ const _0x3fe062=_0x37b0;function _0x37b0(_0x3836f3,_0x496f1c){_0x3836f3=_0x3836f3-0xf9;const _0x41614c=_0x4161();let _0x37b043=_0x41614c[_0x3836f3];return _0x37b043;}function _0x4161(){const _0x3fbdb0=['5619165sMVluq','getByCustomerId','updatedAt','1978924HRbWOq','subs','818424ldgXBi','3946026Mioely','90AniDlM','3isUeti','4094101iCDhwZ','getBySubscriptionId','10nAzGhW','set','161263ZGhbhY','6724176tFoAcc','14evvGgD','values'];_0x4161=function(){return _0x3fbdb0;};return _0x4161();}(function(_0x5a6c93,_0x23ba36){const _0x74908e=_0x37b0,_0x16ff70=_0x5a6c93();while(!![]){try{const _0x3abbad=-parseInt(_0x74908e(0xf9))/0x1*(parseInt(_0x74908e(0xfb))/0x2)+parseInt(_0x74908e(0x105))/0x3*(parseInt(_0x74908e(0x100))/0x4)+-parseInt(_0x74908e(0xfd))/0x5+parseInt(_0x74908e(0xfa))/0x6+parseInt(_0x74908e(0x103))/0x7+parseInt(_0x74908e(0x102))/0x8*(parseInt(_0x74908e(0x104))/0x9)+parseInt(_0x74908e(0x108))/0xa*(-parseInt(_0x74908e(0x106))/0xb);if(_0x3abbad===_0x23ba36)break;else _0x16ff70['push'](_0x16ff70['shift']());}catch(_0x41a5fb){_0x16ff70['push'](_0x16ff70['shift']());}}}(_0x4161,0x8cf1e));export class MemorySubscriptionStore{[_0x3fe062(0x101)]=new Map();['upsert'](_0x3e80ad){const _0x537026=_0x3fe062;_0x3e80ad[_0x537026(0xff)]=new Date()['toISOString'](),this['subs'][_0x537026(0x109)](_0x3e80ad['id'],_0x3e80ad);}[_0x3fe062(0xfe)](_0x200285){const _0x237102=_0x3fe062;for(const _0x1c2ed8 of this[_0x237102(0x101)][_0x237102(0xfc)]())if(_0x1c2ed8['customerId']===_0x200285)return _0x1c2ed8;}[_0x3fe062(0x107)](_0x24b17e){return this['subs']['get'](_0x24b17e);}['list'](){const _0x1e3d77=_0x3fe062;return[...this['subs'][_0x1e3d77(0xfc)]()];}}
@@ -1,42 +1,51 @@
1
1
  {
2
- "version": "0.8.1",
3
- "build": "2026-03-06T08:02:05.507Z",
2
+ "version": "0.9.0",
3
+ "build": "2026-07-03T09:08:40.413Z",
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:ebe65ed4b29979af6cfd6f0a4ec66d7b42bcefe7e380689855b56fab12807208",
6
+ "cli/config-cmd.js": "sha256:70faeb118e3aa77f9cd919ad00d0fb3b35811bef1d8d4b274fc215fa837ba328",
7
+ "cli/index.js": "sha256:d0dcbb24f0819ec207c8b28b14f01c3674a34eb53f7417c45b0ead54aae2f090",
8
+ "cli/init-cmd.js": "sha256:c62535c8a25381a66a227645a3b27dbd7b1255c5b324bb756b8996e9cef2e577",
9
+ "cli/setup-cmd.js": "sha256:e2398fbc709acd15c1894229e20420a6838949fd89ae3178a1a17ac7dc9fadc2",
10
+ "cloud/stripe-checkout.js": "sha256:e54208ff904abcc6afc147cb3dca7413dd9417362199a24a728ce611a69a0b01",
11
+ "cloud/stripe-config.js": "sha256:0ce49547bca01825f493ab0f2273b697e0617111c6f6c36853e0b16aa628ed31",
12
+ "cloud/stripe-usage.js": "sha256:b2b55067bd12b5a49a469c464acf6834803a08b539d4bd5511d60a78f60015ff",
13
+ "cloud/stripe-webhooks.js": "sha256:9cf40b633f94c09d2836949797d0570611cdeb0a5978b871bde05c0069d189a2",
14
+ "cloud/subscription-store.js": "sha256:af6eb90ec730d5ac49e13a7a12788e838139e751cfd4abda3e881510ce04e52b",
15
+ "mcp/index.js": "sha256:9c9b91d0ab3dec96471e79255e4775bc427d722e4024c04a2d4a807ed3b602a1",
16
+ "mcp/resources.js": "sha256:1f62f805069790692e1ed3e528811108cbe96f8d12a1049f77fae90edc924ff2",
17
+ "mcp/session.js": "sha256:d47f6a7eb432b9cbc30b36d9447b6e9a4521a648920b1017eb7f5edffeb73237",
18
+ "mcp/tools.js": "sha256:87977ca1303719cef6eab179495f69c25809d7d0fbe08772153965ad6500db95",
19
+ "plugin/cli.js": "sha256:75d88f2fa18cca2d31ff31e28aebf9ef604766e342cead4ea2636bd6f07549a7",
20
+ "plugin/compression/chunked.js": "sha256:a57f41db1ac20cf745bcfd7d2673f29435d78b23f9dd9c638b08fe6e757480e0",
21
+ "plugin/compression/index.js": "sha256:971ca8ce2c1361a349a0cc16a02f1c20837a1a4c81ec7622be8b138c8f1405b5",
22
+ "plugin/compression/pipeline.js": "sha256:b22dabd68adc4e72a06103f358e3e1442b0d229d485cfd7fecdcd6e9c26325c5",
23
+ "plugin/compression/quality.js": "sha256:af9a1feb96e2786b6226347b66cba4bd8213f419e4f8e69d617c08ba8b62a774",
24
+ "plugin/compression/rule-based.js": "sha256:a025aaebae41430aed244dbc755922d2bb22234b53afa59f89330005fc46082a",
25
+ "plugin/compression/structural.js": "sha256:12270ed11885a99467129a5ab699558e31039c0c2465f16958d21abe1e41ee53",
26
+ "plugin/compression/text-utils.js": "sha256:105283763cec2d5f9cab1ab361a79740e5dc6dfb728c11151630939935fce3db",
27
+ "plugin/compression/token-budget.js": "sha256:56a714783092236e3fbe0096c19dfe7d9cc22cebca21abfc9029d9a327adc756",
28
+ "plugin/compression/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02",
29
+ "plugin/config-loader.js": "sha256:80db5858643003f12b3c00df04c09efba43f0f47a3115af2c3a1e21642cec403",
30
+ "plugin/context-compressor.js": "sha256:3d9aee732e54c59515e7ede7f93723cb0f4baaeac65023990448c65e43d447cb",
31
+ "plugin/hook-dispatcher.js": "sha256:654cc2a6b847d38047f8b2f694d78b21171c0f46db2e03bc4d14af78e8f3ac0a",
32
+ "plugin/metering-client.js": "sha256:ac81c28f43717f6fb918a7109a93fa79df149929a1f3e55da61b88020a1abf47",
33
+ "plugin/metrics-collector.js": "sha256:7e3611a61ed5d773c6800b686545ef620a9ed339294d5bdaddb534b04645e433",
34
+ "plugin/onboarding.js": "sha256:5d7750ac834072612bdeb4becade5c3c3ddab5518bb76d4220acea2d7a726b6f",
35
+ "plugin/precompact-handler.js": "sha256:c16b3ad7b3aa07ac8c042fa0597a563ba6ae52ca5226c098f3972d27038a98aa",
36
+ "plugin/report.js": "sha256:6e568f948fde6e49aa789ac374c7a0e2450c551cb4ff076ea8b43b2fb91b5b4f",
37
+ "plugin/rule-analytics-store.js": "sha256:f0af78de3a39f63f38dcf0f9f6fdc07bab5ff66521bd86a25383a1d85cc17208",
38
+ "plugin/rule-analytics.js": "sha256:3bd7bd8c6776589e594ff03eca9264b57772b18f0933e095f15687a3105211f0",
39
+ "plugin/rule-engine.js": "sha256:1eb58f013ee2a0c44e44bbb355613f5f5013be675d894af874a39af2a7641fc5",
40
+ "plugin/rule-sharing.js": "sha256:98f280b6e9557cc0710e2d9828ccfc640c23524020c8704475894d42d27a4818",
41
+ "plugin/rule-suggest.js": "sha256:0c6412b94443592c2692cdd3e9873a03f8607abd12e2d6f87217d3e3a655d22f",
42
+ "plugin/session-start.js": "sha256:cd50fa4b05754a629ba9e45f202e296582c693f1329f5cc22c990f47b1063ed0",
43
+ "plugin/smart-context.js": "sha256:f07f27c774d37dc01b21344c7c86930dd82ab7809f947a1b62cf2bd461dedda3",
44
+ "shared/license.js": "sha256:c324a8164939a864b57fa966cf050668f4ddfa1d27ac149d1f0c791149d7bd5c",
45
+ "shared/providers/claude-provider.js": "sha256:7d12406eabc03f2d6c5e02bb81e5ce8501cd6fc66bd23f7f17932374c2ae2a26",
46
+ "shared/providers/openai-provider.js": "sha256:18c22570c73eba71793a9186f6c50870a40a0d18e9280b8072c0b2138d883dfb",
47
+ "shared/token-counter.js": "sha256:0747f1a3d2752c36ed27cf3368ada75f92dc6151d45ac8cd2eb3f8aec9eb8ff9",
48
+ "shared/token-provider.js": "sha256:e1fbe8e2961a0887661a88b4bcc9269e5d277bbbf0dc0f7ea7b388b25b4e11cd",
40
49
  "shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
41
50
  }
42
51
  }
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
+ const _0x40a73e=_0x3bf3;(function(_0x528387,_0x39b459){const _0x45f436=_0x3bf3,_0x25cd0b=_0x528387();while(!![]){try{const _0x1641cf=parseInt(_0x45f436(0x18f))/0x1*(-parseInt(_0x45f436(0x188))/0x2)+-parseInt(_0x45f436(0x17f))/0x3+-parseInt(_0x45f436(0x180))/0x4*(-parseInt(_0x45f436(0x186))/0x5)+-parseInt(_0x45f436(0x184))/0x6+parseInt(_0x45f436(0x183))/0x7+parseInt(_0x45f436(0x182))/0x8+parseInt(_0x45f436(0x185))/0x9*(parseInt(_0x45f436(0x181))/0xa);if(_0x1641cf===_0x39b459)break;else _0x25cd0b['push'](_0x25cd0b['shift']());}catch(_0x4981c4){_0x25cd0b['push'](_0x25cd0b['shift']());}}}(_0xd503,0xeed6e));import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';function _0xd503(){const _0x4e3725=['TklfP','exit','handleSessionStop','qyhsq','41aAfGIR','catch','2671707LoewbN','3867836soHmEP','190JfQreG','15019040nzBnoI','4811002zbLdWj','1543566AGWGkK','208782GiYkqS','5GAkXpl','tokenizer-speedup\x20MCP\x20server\x20running','90062hUpKaJ','getDispatcher','error'];_0xd503=function(){return _0x4e3725;};return _0xd503();}import{McpServer}from'@modelcontextprotocol/sdk/server/mcp.js';import{StdioServerTransport}from'@modelcontextprotocol/sdk/server/stdio.js';function _0x3bf3(_0x3f4439,_0x15c0c6){_0x3f4439=_0x3f4439-0x17e;const _0xd503bd=_0xd503();let _0x3bf39b=_0xd503bd[_0x3f4439];return _0x3bf39b;}import{createSession}from'./session.js';import{registerTools}from'./tools.js';import{registerResources}from'./resources.js';async function main(){const _0x49e644=_0x3bf3,_0x181011={'qyhsq':'tokenizer-speedup','TklfP':function(_0x37dcb7){return _0x37dcb7();},'VYIbO':function(_0xff56f0,_0x935216,_0x5289d3){return _0xff56f0(_0x935216,_0x5289d3);}},_0x1c6d95=new McpServer({'name':_0x181011[_0x49e644(0x18e)],'version':'0.8.1'}),_0x3c2596=_0x181011[_0x49e644(0x18b)](createSession);_0x181011['VYIbO'](registerTools,_0x1c6d95,_0x3c2596),registerResources(_0x1c6d95,_0x3c2596),process['on']('SIGINT',()=>{const _0x47ea20=_0x49e644;try{_0x3c2596[_0x47ea20(0x189)]()[_0x47ea20(0x18d)]();}catch{}process[_0x47ea20(0x18c)](0x0);});const _0x4f18b1=new StdioServerTransport();await _0x1c6d95['connect'](_0x4f18b1),console['error'](_0x49e644(0x187));}main()[_0x40a73e(0x17e)](_0x2889d2=>{const _0x582366=_0x40a73e;console[_0x582366(0x18a)]('tokenizer-speedup\x20MCP\x20server\x20failed\x20to\x20start:',_0x2889d2),process['exit'](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(_0x220e47,_0x2a3795){const _0x321892=_0x51b6,_0x27e20d=_0x220e47();while(!![]){try{const _0x1ae2d5=parseInt(_0x321892(0x1b7))/0x1*(parseInt(_0x321892(0x1a6))/0x2)+parseInt(_0x321892(0x1b0))/0x3*(parseInt(_0x321892(0x1a3))/0x4)+parseInt(_0x321892(0x1a1))/0x5+parseInt(_0x321892(0x1ad))/0x6*(-parseInt(_0x321892(0x19f))/0x7)+-parseInt(_0x321892(0x1b1))/0x8*(parseInt(_0x321892(0x1b3))/0x9)+parseInt(_0x321892(0x1aa))/0xa+parseInt(_0x321892(0x1b5))/0xb*(-parseInt(_0x321892(0x1b6))/0xc);if(_0x1ae2d5===_0x2a3795)break;else _0x27e20d['push'](_0x27e20d['shift']());}catch(_0xaf76b){_0x27e20d['push'](_0x27e20d['shift']());}}}(_0x403a,0x8b5ad));function _0x51b6(_0x48dae0,_0x2c33bf){_0x48dae0=_0x48dae0-0x19e;const _0x403a0c=_0x403a();let _0x51b690=_0x403a0c[_0x48dae0];return _0x51b690;}import{generateReport}from'../plugin/report.js';export function registerResources(_0x32dfad,_0x42d207){const _0x3afafe=_0x51b6,_0x5b0060={'KpnlH':_0x3afafe(0x1a5),'cNlfD':_0x3afafe(0x1a7),'dZLQY':_0x3afafe(0x1ac),'UIJma':'TokenizerSpeedUp\x20Savings\x20Report','SAnrE':'Returns\x20an\x20aggregated\x20report\x20of\x20token\x20savings\x20across\x20all\x20recorded\x20sessions,\x20including\x20baseline\x20vs.\x20optimized\x20counts,\x20cost\x20estimates,\x20and\x20rule\x20trigger\x20statistics.','OiVfR':'application/json'};_0x32dfad['registerResource'](_0x3afafe(0x1a4),_0x5b0060['KpnlH'],{'title':_0x5b0060[_0x3afafe(0x1a8)],'description':_0x3afafe(0x19e),'mimeType':_0x3afafe(0x1a0)},async _0x49f98c=>{const _0x3f505d=_0x3afafe,_0x530a08=_0x42d207[_0x3f505d(0x1ae)]();return{'contents':[{'uri':_0x49f98c[_0x3f505d(0x1af)],'text':JSON[_0x3f505d(0x1a2)](_0x530a08,null,0x2)}]};}),_0x32dfad[_0x3afafe(0x1ab)](_0x5b0060[_0x3afafe(0x1b4)],'tokenizer-speedup://report',{'title':_0x5b0060['UIJma'],'description':_0x5b0060[_0x3afafe(0x1b2)],'mimeType':_0x5b0060['OiVfR']},async _0x1b1bd3=>{const _0x281aa1=_0x3afafe;try{const _0x3d7cca=generateReport(_0x42d207['projectRoot']);return{'contents':[{'uri':_0x1b1bd3[_0x281aa1(0x1af)],'text':JSON[_0x281aa1(0x1a2)](_0x3d7cca,null,0x2)}]};}catch{return{'contents':[{'uri':_0x1b1bd3['href'],'text':JSON['stringify']({'message':_0x281aa1(0x1a9),'sessions_count':0x0,'total_baseline':0x0,'total_optimized':0x0,'total_delta':0x0,'savings_percent':0x0,'total_prompts':0x0,'rules_triggered':{},'estimated_cost_saved_usd':0x0,'period_start':'','period_end':''},null,0x2)}]};}});}function _0x403a(){const _0x15067b=['33hPfkGa','1237224hiOkqq','1AyqyNE','Returns\x20the\x20current\x20YAML-based\x20plugin\x20configuration\x20as\x20JSON,\x20including\x20rules,\x20context\x20limits,\x20and\x20metering\x20settings.','5635427SnSKNP','application/json','1394190kGuxxf','stringify','1188536JgFNPU','config','tokenizer-speedup://config','878652oeVqNS','TokenizerSpeedUp\x20Configuration','cNlfD','No\x20metrics\x20data\x20available\x20yet.\x20Run\x20at\x20least\x20one\x20optimized\x20session\x20to\x20generate\x20a\x20report.','2527070siBplz','registerResource','report','6XdKwiN','getConfig','href','9eTdSaO','1416872ejvPYT','SAnrE','9yrtOXe','dZLQY'];_0x403a=function(){return _0x15067b;};return _0x403a();}
@@ -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
+ const _0x1596eb=_0xf091;(function(_0x206c52,_0x80eaa8){const _0x1b2a6c=_0xf091,_0x255e01=_0x206c52();while(!![]){try{const _0x438ccf=-parseInt(_0x1b2a6c(0x1b2))/0x1+parseInt(_0x1b2a6c(0x1ba))/0x2+parseInt(_0x1b2a6c(0x1b5))/0x3+-parseInt(_0x1b2a6c(0x1b3))/0x4*(-parseInt(_0x1b2a6c(0x1b4))/0x5)+parseInt(_0x1b2a6c(0x1bb))/0x6*(-parseInt(_0x1b2a6c(0x1b7))/0x7)+parseInt(_0x1b2a6c(0x1bd))/0x8*(parseInt(_0x1b2a6c(0x1b8))/0x9)+parseInt(_0x1b2a6c(0x1bc))/0xa;if(_0x438ccf===_0x80eaa8)break;else _0x255e01['push'](_0x255e01['shift']());}catch(_0x5291b7){_0x255e01['push'](_0x255e01['shift']());}}}(_0xfe41,0xcd698));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';function _0xf091(_0x3b31b2,_0x51e950){_0x3b31b2=_0x3b31b2-0x1b2;const _0xfe41c9=_0xfe41();let _0xf09179=_0xfe41c9[_0x3b31b2];return _0xf09179;}function _0xfe41(){const _0x169a91=['4541070yALsPD','51512fucEEM','claude','601216oqhsTw','52rOvSMK','243590cJmite','297054HBJqCb','mcp-session-','14glLlcZ','1674NuCzgV','model','1065138xbrKdP','4422294bqHKrk'];_0xfe41=function(){return _0x169a91;};return _0xfe41();}import{createTokenProvider}from'../shared/token-provider.js';const DEFAULT_CONFIG={'version':0x1,'provider':_0x1596eb(0x1be),'model':'claude-sonnet-4-20250514','rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};export function createSession(_0x4fa3fb){const _0x15092e=_0x1596eb,_0x2dbc2c={'svxsR':function(_0x35e0e7,_0x4c86a1){return _0x35e0e7(_0x4c86a1);},'DgiVb':function(_0x277802,_0x39461b,_0x55b0f0){return _0x277802(_0x39461b,_0x55b0f0);}};let _0x36a91d=_0x4fa3fb??process['cwd'](),_0x35feb0=null,_0x5a1370=null;const _0x1baa3=_0x15092e(0x1b6)+Date['now']();let _0x1df2e7=new MetricsCollector(_0x36a91d,_0x1baa3);const _0x4f5dcd={get 'projectRoot'(){return _0x36a91d;},get 'config'(){return _0x35feb0;},get 'collector'(){return _0x1df2e7;},get 'sessionId'(){return _0x1baa3;},'getConfig':()=>(_0x35feb0||(_0x35feb0=(function(){try{return _0x2dbc2c['svxsR'](loadConfig,_0x36a91d);}catch{return structuredClone(DEFAULT_CONFIG);}}())),_0x35feb0),'getDispatcher'(){if(!_0x5a1370){const _0xa1ee13=_0x4f5dcd['getConfig']();_0x5a1370=new HookDispatcher(_0xa1ee13,_0x36a91d,_0x1baa3);}return _0x5a1370;},'getTokenProvider'(_0x3c1e4b,_0xfee254){const _0x53b2aa=_0x15092e,_0x597ebc=_0x4f5dcd['getConfig']();return _0x2dbc2c['DgiVb'](createTokenProvider,_0x3c1e4b??_0x597ebc['provider'],_0xfee254??_0x597ebc[_0x53b2aa(0x1b9)]);},'setProjectRoot'(_0x2c8b1f){_0x36a91d=_0x2c8b1f,_0x35feb0=null,_0x5a1370=null,_0x1df2e7=new MetricsCollector(_0x36a91d,_0x1baa3);}};return _0x4f5dcd;}
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(_0x5d56e4,_0x2dfddf){const _0x34d98d=_0x50d9,_0x3c39ad=_0x5d56e4();while(!![]){try{const _0x2354c8=parseInt(_0x34d98d(0x195))/0x1*(parseInt(_0x34d98d(0x185))/0x2)+parseInt(_0x34d98d(0x178))/0x3+parseInt(_0x34d98d(0x1a1))/0x4*(parseInt(_0x34d98d(0x18b))/0x5)+-parseInt(_0x34d98d(0x192))/0x6+-parseInt(_0x34d98d(0x193))/0x7+-parseInt(_0x34d98d(0x19b))/0x8*(parseInt(_0x34d98d(0x189))/0x9)+-parseInt(_0x34d98d(0x187))/0xa*(-parseInt(_0x34d98d(0x1a5))/0xb);if(_0x2354c8===_0x2dfddf)break;else _0x3c39ad['push'](_0x3c39ad['shift']());}catch(_0x5823a7){_0x3c39ad['push'](_0x3c39ad['shift']());}}}(_0x1f35,0x67dd2));import{readFile}from'node:fs/promises';import{resolve,normalize}from'node:path';import{z}from'zod';import{countTokens}from'../shared/token-counter.js';function _0x50d9(_0x403b5f,_0x36cc26){_0x403b5f=_0x403b5f-0x176;const _0x1f35c9=_0x1f35();let _0x50d92a=_0x1f35c9[_0x403b5f];return _0x50d92a;}export function registerTools(_0x1dd12a,_0x23247a){const _0x1d62da=_0x50d9,_0x5c3e67={'QVXho':'UserPromptSubmit','HEFNM':function(_0x295cf6,_0x44633e){return _0x295cf6>_0x44633e;},'MPjln':function(_0x55ae16,_0xa4b723){return _0x55ae16(_0xa4b723);},'jMhrN':'text','eOMWG':function(_0x375d55,_0x5bdb62){return _0x375d55===_0x5bdb62;},'rPjBM':function(_0x3028da,_0x209fdd){return _0x3028da===_0x209fdd;},'piWRd':function(_0x2c00e8,_0x5b9e0d){return _0x2c00e8===_0x5b9e0d;},'MKgZb':'openai','uydiu':function(_0x851e7,_0x33a707){return _0x851e7 instanceof _0x33a707;},'njsfU':function(_0x397b32,_0x485e02,_0x16dfb2){return _0x397b32(_0x485e02,_0x16dfb2);},'anYFo':function(_0x504e65,_0xbb8625,_0x12a23b){return _0x504e65(_0xbb8625,_0x12a23b);},'ztdUr':function(_0x4cfba3,_0x7fddb6){return _0x4cfba3(_0x7fddb6);},'DaJyb':_0x1d62da(0x184),'JJomk':_0x1d62da(0x17f),'CgOSd':'optimize-context','VWaQn':'Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','Kbigi':_0x1d62da(0x1a3),'CjKQW':'Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided','DmIoY':_0x1d62da(0x1a6),'ewCXD':'Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','rYpvG':_0x1d62da(0x18a),'EAKio':_0x1d62da(0x199),'DvPrF':'get-savings','pCdbS':'Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.'};_0x1dd12a['registerTool'](_0x5c3e67['CgOSd'],{'description':_0x5c3e67['VWaQn'],'inputSchema':{'prompt':z[_0x1d62da(0x1aa)]()[_0x1d62da(0x180)](_0x5c3e67[_0x1d62da(0x18c)]),'project_path':z[_0x1d62da(0x1aa)]()['optional']()[_0x1d62da(0x180)](_0x5c3e67[_0x1d62da(0x1a8)])}},async({prompt:_0x4deaeb,project_path:_0xf26410})=>{const _0x3dca6a=_0x1d62da;_0xf26410&&_0x23247a['setProjectRoot'](_0xf26410);const _0x17c0e6=_0x23247a[_0x3dca6a(0x1a4)](),_0x103132=_0x17c0e6[_0x3dca6a(0x18d)](),_0x3f7db9={'session_id':_0x23247a[_0x3dca6a(0x1a0)],'cwd':_0x23247a['projectRoot'],'prompt':_0x4deaeb,'hook_event_name':_0x5c3e67['QVXho']},_0x890ca6=_0x17c0e6['handleUserPromptSubmit'](_0x3f7db9),_0x39f65a=_0x17c0e6['getSessionSummary']()[_0x3dca6a(0x183)]-_0x103132['total_delta'],_0x301b57=_0x890ca6[_0x3dca6a(0x196)]??'',_0x5c784b=_0x5c3e67[_0x3dca6a(0x19d)](_0x301b57[_0x3dca6a(0x17b)],0x0)?_0x5c3e67[_0x3dca6a(0x17e)](countTokens,_0x301b57):0x0,_0x47ff39=[..._0x301b57[_0x3dca6a(0x19a)](/^\[([^\]]+)\]/gm)]['map'](_0x592a90=>_0x592a90[0x1]),_0x56fddb={'context':_0x301b57,'rules_matched':_0x47ff39,'tokens_injected':_0x5c784b,'tokens_saved':_0x39f65a};return{'content':[{'type':_0x5c3e67[_0x3dca6a(0x18e)],'text':JSON[_0x3dca6a(0x198)](_0x56fddb)}]};}),_0x1dd12a[_0x1d62da(0x186)](_0x5c3e67[_0x1d62da(0x190)],{'description':_0x5c3e67['ewCXD'],'inputSchema':{'text':z[_0x1d62da(0x1aa)]()['optional']()['describe'](_0x5c3e67[_0x1d62da(0x1a7)]),'file_path':z['string']()[_0x1d62da(0x1a2)]()['describe']('Path\x20to\x20a\x20file\x20to\x20analyze'),'provider':z['string']()[_0x1d62da(0x1a2)]()['describe']('LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.'),'model':z['string']()['optional']()[_0x1d62da(0x180)](_0x5c3e67['EAKio'])}},async({text:_0x45eba5,file_path:_0x341dc2,provider:_0x1a2d76,model:_0x165f59})=>{const _0x565b4a=_0x1d62da;if(_0x5c3e67['eOMWG'](void 0x0,_0x45eba5)&&_0x5c3e67['rPjBM'](void 0x0,_0x341dc2))return{'content':[{'type':_0x5c3e67['jMhrN'],'text':JSON[_0x565b4a(0x198)]({'error':'Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.'})}],'isError':!0x0};const _0x48853e=_0x1a2d76??_0x23247a['getConfig']()[_0x565b4a(0x19e)],_0x2ac4b4=_0x165f59??(_0x5c3e67[_0x565b4a(0x191)](_0x5c3e67['MKgZb'],_0x48853e)?_0x565b4a(0x19c):_0x23247a['getConfig']()[_0x565b4a(0x18f)]);let _0xd4092,_0x33121e;try{_0xd4092=_0x23247a['getTokenProvider'](_0x48853e,_0x2ac4b4);}catch(_0x2b90b9){const _0x4256e3=_0x5c3e67['uydiu'](_0x2b90b9,Error)?_0x2b90b9[_0x565b4a(0x19f)]:String(_0x2b90b9);return{'content':[{'type':'text','text':JSON[_0x565b4a(0x198)]({'error':_0x4256e3})}],'isError':!0x0};}if(void 0x0!==_0x45eba5)_0x33121e=_0x45eba5;else{const _0x280a5c=normalize(_0x23247a['projectRoot']),_0x3904a6=_0x5c3e67['MPjln'](normalize,_0x5c3e67[_0x565b4a(0x1a9)](resolve,_0x280a5c,_0x341dc2));if(!_0x3904a6[_0x565b4a(0x194)](_0x280a5c))return{'content':[{'type':_0x5c3e67['jMhrN'],'text':JSON[_0x565b4a(0x198)]({'error':'file_path\x20escapes\x20project\x20root.'})}],'isError':!0x0};try{_0x33121e=await _0x5c3e67[_0x565b4a(0x17a)](readFile,_0x3904a6,'utf-8');}catch(_0x542d0c){const _0x1c9697=_0x542d0c instanceof Error?_0x542d0c[_0x565b4a(0x19f)]:_0x5c3e67['ztdUr'](String,_0x542d0c);return{'content':[{'type':_0x565b4a(0x17c),'text':JSON['stringify']({'error':_0x565b4a(0x179)+_0x1c9697})}],'isError':!0x0};}}const _0x112160={'tokens':_0xd4092[_0x565b4a(0x188)](_0x33121e),'tokens_method':_0x5c3e67[_0x565b4a(0x182)],'estimate':_0xd4092[_0x565b4a(0x197)](_0x33121e),'estimate_method':'word\x20heuristic\x20(words\x20×\x20'+(_0x5c3e67[_0x565b4a(0x176)](_0x5c3e67[_0x565b4a(0x177)],_0x48853e)?_0x5c3e67['JJomk']:'1.4')+')','provider':_0x48853e,'model':_0x2ac4b4};return{'content':[{'type':_0x5c3e67[_0x565b4a(0x18e)],'text':JSON['stringify'](_0x112160)}]};}),_0x1dd12a[_0x1d62da(0x186)](_0x5c3e67['DvPrF'],{'description':_0x5c3e67['pCdbS']},async()=>{const _0x5e6ac0=_0x1d62da,_0x2a72b5=_0x23247a['getDispatcher']()['getSessionSummary'](),_0x4de96e={'baseline_tokens':_0x2a72b5['total_baseline'],'optimized_tokens':_0x2a72b5[_0x5e6ac0(0x17d)],'saved_tokens':_0x2a72b5['total_delta'],'saved_percent':_0x2a72b5[_0x5e6ac0(0x181)],'prompts_count':_0x2a72b5['prompts_count'],'rules_triggered':_0x2a72b5['rules_triggered']};return{'content':[{'type':'text','text':JSON[_0x5e6ac0(0x198)](_0x4de96e)}]};});}function _0x1f35(){const _0x3c5758=['string','rPjBM','MKgZb','96786XptdQE','Failed\x20to\x20read\x20file:\x20','anYFo','length','text','total_optimized','MPjln','1.3','describe','savings_percent','DaJyb','total_delta','BPE\x20tokenizer\x20(accurate)','242470dWDEZA','registerTool','10lRuGTl','countTokens','9rYblQZ','Inline\x20text\x20to\x20analyze','5aCvybr','Kbigi','getSessionSummary','jMhrN','model','DmIoY','piWRd','3520578DzwYea','2776844inXNbp','startsWith','1opqDWt','additionalContext','estimateTokens','stringify','Model\x20name.\x20Defaults\x20to\x20config\x20model.','matchAll','745088peiffi','gpt-4o','HEFNM','provider','message','sessionId','729836moXQyk','optional','The\x20user\x20prompt\x20to\x20optimize','getDispatcher','12826671lOZdLm','analyze-tokens','rYpvG','CjKQW','njsfU'];_0x1f35=function(){return _0x3c5758;};return _0x1f35();}