@simosphere/tokenizer-speedup 0.7.2 → 0.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  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/setup-cmd.js +1 -1
  6. package/dist/cloud/stripe-checkout.js +1 -1
  7. package/dist/cloud/stripe-config.js +1 -1
  8. package/dist/cloud/stripe-usage.js +1 -1
  9. package/dist/cloud/stripe-webhooks.js +1 -1
  10. package/dist/cloud/subscription-store.js +1 -1
  11. package/dist/manifest.json +32 -63
  12. package/dist/plugin/cli.js +1 -1
  13. package/dist/plugin/config-loader.js +1 -1
  14. package/dist/plugin/context-compressor.js +1 -1
  15. package/dist/plugin/hook-dispatcher.js +1 -1
  16. package/dist/plugin/metering-client.js +1 -1
  17. package/dist/plugin/metrics-collector.js +1 -1
  18. package/dist/plugin/onboarding.js +1 -1
  19. package/dist/plugin/precompact-handler.js +1 -1
  20. package/dist/plugin/report.js +1 -1
  21. package/dist/plugin/rule-analytics-store.js +1 -1
  22. package/dist/plugin/rule-analytics.js +1 -1
  23. package/dist/plugin/rule-engine.js +1 -1
  24. package/dist/plugin/rule-sharing.js +1 -1
  25. package/dist/plugin/rule-suggest.js +1 -1
  26. package/dist/plugin/session-start.js +1 -1
  27. package/dist/plugin/smart-context.js +1 -1
  28. package/dist/shared/license.js +1 -1
  29. package/dist/shared/providers/claude-provider.js +1 -1
  30. package/dist/shared/providers/openai-provider.js +1 -1
  31. package/dist/shared/token-counter.js +1 -1
  32. package/dist/shared/token-provider.js +1 -1
  33. package/package.json +1 -1
  34. package/dist/cli/analyze.d.ts +0 -13
  35. package/dist/cli/analyze.js.map +0 -1
  36. package/dist/cli/config-cmd.d.ts +0 -10
  37. package/dist/cli/config-cmd.js.map +0 -1
  38. package/dist/cli/index.d.ts +0 -5
  39. package/dist/cli/index.js.map +0 -1
  40. package/dist/cli/setup-cmd.d.ts +0 -2
  41. package/dist/cli/setup-cmd.js.map +0 -1
  42. package/dist/cloud/stripe-checkout.d.ts +0 -11
  43. package/dist/cloud/stripe-checkout.js.map +0 -1
  44. package/dist/cloud/stripe-config.d.ts +0 -35
  45. package/dist/cloud/stripe-config.js.map +0 -1
  46. package/dist/cloud/stripe-usage.d.ts +0 -30
  47. package/dist/cloud/stripe-usage.js.map +0 -1
  48. package/dist/cloud/stripe-webhooks.d.ts +0 -15
  49. package/dist/cloud/stripe-webhooks.js.map +0 -1
  50. package/dist/cloud/subscription-store.d.ts +0 -23
  51. package/dist/cloud/subscription-store.js.map +0 -1
  52. package/dist/plugin/cli.d.ts +0 -2
  53. package/dist/plugin/cli.js.map +0 -1
  54. package/dist/plugin/config-loader.d.ts +0 -6
  55. package/dist/plugin/config-loader.js.map +0 -1
  56. package/dist/plugin/context-compressor.d.ts +0 -22
  57. package/dist/plugin/context-compressor.js.map +0 -1
  58. package/dist/plugin/hook-dispatcher.d.ts +0 -11
  59. package/dist/plugin/hook-dispatcher.js.map +0 -1
  60. package/dist/plugin/metering-client.d.ts +0 -26
  61. package/dist/plugin/metering-client.js.map +0 -1
  62. package/dist/plugin/metrics-collector.d.ts +0 -19
  63. package/dist/plugin/metrics-collector.js.map +0 -1
  64. package/dist/plugin/onboarding.d.ts +0 -13
  65. package/dist/plugin/onboarding.js.map +0 -1
  66. package/dist/plugin/precompact-handler.d.ts +0 -26
  67. package/dist/plugin/precompact-handler.js.map +0 -1
  68. package/dist/plugin/report.d.ts +0 -13
  69. package/dist/plugin/report.js.map +0 -1
  70. package/dist/plugin/rule-analytics-store.d.ts +0 -3
  71. package/dist/plugin/rule-analytics-store.js.map +0 -1
  72. package/dist/plugin/rule-analytics.d.ts +0 -12
  73. package/dist/plugin/rule-analytics.js.map +0 -1
  74. package/dist/plugin/rule-engine.d.ts +0 -9
  75. package/dist/plugin/rule-engine.js.map +0 -1
  76. package/dist/plugin/rule-sharing.d.ts +0 -19
  77. package/dist/plugin/rule-sharing.js.map +0 -1
  78. package/dist/plugin/rule-suggest.d.ts +0 -7
  79. package/dist/plugin/rule-suggest.js.map +0 -1
  80. package/dist/plugin/session-start.d.ts +0 -6
  81. package/dist/plugin/session-start.js.map +0 -1
  82. package/dist/plugin/smart-context.d.ts +0 -7
  83. package/dist/plugin/smart-context.js.map +0 -1
  84. package/dist/shared/license.d.ts +0 -7
  85. package/dist/shared/license.js.map +0 -1
  86. package/dist/shared/providers/claude-provider.d.ts +0 -2
  87. package/dist/shared/providers/claude-provider.js.map +0 -1
  88. package/dist/shared/providers/openai-provider.d.ts +0 -2
  89. package/dist/shared/providers/openai-provider.js.map +0 -1
  90. package/dist/shared/token-counter.d.ts +0 -10
  91. package/dist/shared/token-counter.js.map +0 -1
  92. package/dist/shared/token-provider.d.ts +0 -10
  93. package/dist/shared/token-provider.js.map +0 -1
  94. package/dist/shared/types.d.ts +0 -62
  95. package/dist/shared/types.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tokenizer-speedup",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "description": "Intelligent context optimization for LLM sessions — save 30-60% on tokens",
5
5
  "author": {
6
6
  "name": "SIMO GmbH",
@@ -1 +1 @@
1
- const _0x324465=_0x342d;function _0x3bca(){const _0x2fb572=['LQUHh','397246lYmdax','3255483TZTbJW','8pcuVrr','102FerhLg','xZulD','9QvTpSI','14119hEYsTO','1GCGDZV','estimateTokens','1382530wyDAsu','GQgiD','utf-8','437525leHWWn','954IohRmD','length','claude','2362120sShGdG','BgLGY'];_0x3bca=function(){return _0x2fb572;};return _0x3bca();}(function(_0x272f77,_0xe41205){const _0x428edb=_0x342d,_0x3f5c4f=_0x272f77();while(!![]){try{const _0x12fb45=-parseInt(_0x428edb(0x1af))/0x1*(-parseInt(_0x428edb(0x1a8))/0x2)+-parseInt(_0x428edb(0x1b5))/0x3*(-parseInt(_0x428edb(0x1aa))/0x4)+parseInt(_0x428edb(0x1b4))/0x5+parseInt(_0x428edb(0x1ab))/0x6*(parseInt(_0x428edb(0x1ae))/0x7)+parseInt(_0x428edb(0x1b8))/0x8*(parseInt(_0x428edb(0x1ad))/0x9)+-parseInt(_0x428edb(0x1b1))/0xa+-parseInt(_0x428edb(0x1a9))/0xb;if(_0x12fb45===_0xe41205)break;else _0x3f5c4f['push'](_0x3f5c4f['shift']());}catch(_0x32dd75){_0x3f5c4f['push'](_0x3f5c4f['shift']());}}}(_0x3bca,0x2c760));import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';function _0x342d(_0x3351dd,_0x2328d3){_0x3351dd=_0x3351dd-0x1a6;const _0x3bcac6=_0x3bca();let _0x342d8b=_0x3bcac6[_0x3351dd];return _0x342d8b;}import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x33560e,_0x3ef345='claude',_0x1ff1de){const _0x1e5edf=_0x342d,_0x550842={'GQgiD':function(_0x5f3e9e,_0x3c3271){return _0x5f3e9e===_0x3c3271;},'odimT':'claude','BgLGY':'claude-sonnet-4-20250514','LQUHh':function(_0x4ee392,_0x285143,_0x3892e6){return _0x4ee392(_0x285143,_0x3892e6);}},_0x275b62=_0x1ff1de??(_0x550842[_0x1e5edf(0x1b2)](_0x550842['odimT'],_0x3ef345)?_0x550842[_0x1e5edf(0x1a6)]:'gpt-4o'),_0x7d9cff=_0x550842[_0x1e5edf(0x1a7)](createTokenProvider,_0x3ef345,_0x275b62),_0x2b4099=_0x33560e['split'](/\s+/)['filter'](Boolean)[_0x1e5edf(0x1b6)];return{'tokens':_0x7d9cff['countTokens'](_0x33560e),'estimate':_0x7d9cff[_0x1e5edf(0x1b0)](_0x33560e),'provider':_0x3ef345,'model':_0x275b62,'chars':_0x33560e[_0x1e5edf(0x1b6)],'words':_0x2b4099};}export function analyzeFile(_0x384e75,_0x3e469c=_0x324465(0x1b7),_0x293977){const _0x62ded6=_0x324465,_0x2ed158={'qlhkH':function(_0x42f7a3,_0x55e533,_0x1c174c,_0x54a44a){return _0x42f7a3(_0x55e533,_0x1c174c,_0x54a44a);},'xZulD':_0x62ded6(0x1b3)};return _0x2ed158['qlhkH'](analyzeText,readFileSync(_0x384e75,_0x2ed158[_0x62ded6(0x1ac)]),_0x3e469c,_0x293977);}export function compareProviders(_0x5e7bda){const _0x186be8={'QAZEX':'openai'};return{'claude':analyzeText(_0x5e7bda,'claude'),'openai':analyzeText(_0x5e7bda,_0x186be8['QAZEX'])};}
1
+ const _0x5259c3=_0x3348;(function(_0x11b825,_0x207b8c){const _0x40e6a6=_0x3348,_0x4d1fc3=_0x11b825();while(!![]){try{const _0x1e8e6f=parseInt(_0x40e6a6(0x165))/0x1*(-parseInt(_0x40e6a6(0x174))/0x2)+-parseInt(_0x40e6a6(0x172))/0x3*(-parseInt(_0x40e6a6(0x168))/0x4)+-parseInt(_0x40e6a6(0x167))/0x5*(parseInt(_0x40e6a6(0x16b))/0x6)+parseInt(_0x40e6a6(0x163))/0x7+parseInt(_0x40e6a6(0x16f))/0x8+parseInt(_0x40e6a6(0x16a))/0x9+-parseInt(_0x40e6a6(0x16c))/0xa;if(_0x1e8e6f===_0x207b8c)break;else _0x4d1fc3['push'](_0x4d1fc3['shift']());}catch(_0x569507){_0x4d1fc3['push'](_0x4d1fc3['shift']());}}}(_0x860a,0xad929));function _0x860a(){const _0x5e148a=['305253udDZnF','86070SjsVzv','6120750fgaNRF','openai','claude','2812184XQbFht','filter','fLAFs','219nsFicv','countTokens','22ipNSEB','gFpOX','leVGT','5887644yvDAfb','QrbjG','30937GwjjRE','gpt-4o','290nIDaqG','69524FfEzNy','split'];_0x860a=function(){return _0x5e148a;};return _0x860a();}import{readFileSync}from'node:fs';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';export function analyzeText(_0x1acc81,_0x4ab9b3=_0x5259c3(0x16e),_0x3a741c){const _0x23655e=_0x5259c3,_0x5654ed={'QrbjG':'claude-sonnet-4-20250514','YIbhU':_0x23655e(0x166)},_0x84fb69=_0x3a741c??('claude'===_0x4ab9b3?_0x5654ed[_0x23655e(0x164)]:_0x5654ed['YIbhU']),_0x5c05e6=createTokenProvider(_0x4ab9b3,_0x84fb69),_0x1d1c24=_0x1acc81[_0x23655e(0x169)](/\s+/)[_0x23655e(0x170)](Boolean)['length'];return{'tokens':_0x5c05e6[_0x23655e(0x173)](_0x1acc81),'estimate':_0x5c05e6['estimateTokens'](_0x1acc81),'provider':_0x4ab9b3,'model':_0x84fb69,'chars':_0x1acc81['length'],'words':_0x1d1c24};}function _0x3348(_0x3aff35,_0x1ea973){_0x3aff35=_0x3aff35-0x162;const _0x860a9f=_0x860a();let _0x334852=_0x860a9f[_0x3aff35];return _0x334852;}export function analyzeFile(_0x407290,_0x5ddfe4=_0x5259c3(0x16e),_0x11070d){const _0x517829=_0x5259c3,_0x5b7959={'fLAFs':function(_0x479d97,_0x39fb77,_0x445e58){return _0x479d97(_0x39fb77,_0x445e58);},'leVGT':'utf-8'};return analyzeText(_0x5b7959[_0x517829(0x171)](readFileSync,_0x407290,_0x5b7959[_0x517829(0x162)]),_0x5ddfe4,_0x11070d);}export function compareProviders(_0x17d16f){const _0x2905cd=_0x5259c3,_0x32d9fa={'gFpOX':function(_0x397a3d,_0x4a44ee,_0x3c85bc){return _0x397a3d(_0x4a44ee,_0x3c85bc);}};return{'claude':_0x32d9fa[_0x2905cd(0x175)](analyzeText,_0x17d16f,_0x2905cd(0x16e)),'openai':analyzeText(_0x17d16f,_0x2905cd(0x16d))};}
@@ -1 +1 @@
1
- (function(_0x15cfaa,_0x1ddf1b){const _0x290e5b=_0x4293,_0x223855=_0x15cfaa();while(!![]){try{const _0x32599b=parseInt(_0x290e5b(0x1e3))/0x1*(-parseInt(_0x290e5b(0x1df))/0x2)+parseInt(_0x290e5b(0x1e5))/0x3*(-parseInt(_0x290e5b(0x1e4))/0x4)+-parseInt(_0x290e5b(0x1e0))/0x5+-parseInt(_0x290e5b(0x1e6))/0x6*(parseInt(_0x290e5b(0x1de))/0x7)+parseInt(_0x290e5b(0x1e2))/0x8+-parseInt(_0x290e5b(0x1e1))/0x9+parseInt(_0x290e5b(0x1dd))/0xa;if(_0x32599b===_0x1ddf1b)break;else _0x223855['push'](_0x223855['shift']());}catch(_0x4f404b){_0x223855['push'](_0x223855['shift']());}}}(_0x5959,0x8dee7));function _0x4293(_0x43fa59,_0x507bc9){_0x43fa59=_0x43fa59-0x1dc;const _0x595964=_0x5959();let _0x429311=_0x595964[_0x43fa59];return _0x429311;}import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x59745f){const _0x1ae43f=_0x4293,_0xd213bc={'JBbbc':function(_0x33e3ec,_0x1871b0){return _0x33e3ec(_0x1871b0);}};try{const _0x206771=_0xd213bc['JBbbc'](parseConfig,_0x59745f);return{'valid':!0x0,'provider':_0x206771['provider'],'model':_0x206771['model'],'ruleCount':_0x206771[_0x1ae43f(0x1e7)]['length']};}catch(_0x33db3){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x33db3[_0x1ae43f(0x1dc)]};}}function _0x5959(){const _0x1ddcbe=['89712GCJTuN','8612880iZpRiq','40trQjBl','12qjeZoW','745383FiXhqj','1584TFTbIt','rules','message','13298780mAXEDP','20552hZTdRu','8974lzAtLy','576010sUPABE'];_0x5959=function(){return _0x1ddcbe;};return _0x5959();}
1
+ (function(_0x13f1ad,_0x283aea){const _0x42762a=_0x30e1,_0x283da8=_0x13f1ad();while(!![]){try{const _0x38f449=parseInt(_0x42762a(0xb8))/0x1+parseInt(_0x42762a(0xbb))/0x2+parseInt(_0x42762a(0xbd))/0x3+-parseInt(_0x42762a(0xbf))/0x4+-parseInt(_0x42762a(0xba))/0x5*(-parseInt(_0x42762a(0xc0))/0x6)+parseInt(_0x42762a(0xbe))/0x7+-parseInt(_0x42762a(0xbc))/0x8;if(_0x38f449===_0x283aea)break;else _0x283da8['push'](_0x283da8['shift']());}catch(_0xe0df2c){_0x283da8['push'](_0x283da8['shift']());}}}(_0x43a9,0xdad7d));import'../shared/providers/claude-provider.js';function _0x30e1(_0x3a549b,_0x5cbb6f){_0x3a549b=_0x3a549b-0xb8;const _0x43a96e=_0x43a9();let _0x30e180=_0x43a96e[_0x3a549b];return _0x30e180;}function _0x43a9(){const _0x27bf9c=['2010978UgsmVz','3997539vXdqJh','2158744ngSzJh','246UnXlVw','425129lsKHRo','length','112505bAVjOi','2616758KVFJtU','19691080tohtOt'];_0x43a9=function(){return _0x27bf9c;};return _0x43a9();}import'../shared/providers/openai-provider.js';import{parseConfig}from'../plugin/config-loader.js';export function validateConfigYaml(_0x28dfee){const _0x59ccf4=_0x30e1;try{const _0x3f077c=parseConfig(_0x28dfee);return{'valid':!0x0,'provider':_0x3f077c['provider'],'model':_0x3f077c['model'],'ruleCount':_0x3f077c['rules'][_0x59ccf4(0xb9)]};}catch(_0x32d42b){return{'valid':!0x1,'provider':'','model':'','ruleCount':0x0,'error':_0x32d42b['message']};}}
package/dist/cli/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- function _0x3b59(){const _0x32ff3c=['UStZC','XpCjw','TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI','324472IxfmBX','321063BaKFSg','2570616IKWVOv','0.7.2','NHaJo','config','action','claude-sonnet-4-20250514','hiEqK','argument','--api-key\x20<key>','stringify','../plugin/config-loader.js','provider','after','2YohggL','WkHju','includes','Analyze\x20inline\x20text\x20instead\x20of\x20file','text','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','20WKDdIh','547579uyJeeJ','MUonJ','yEYFV','rules','claude','YTJHq','-p,\x20--provider\x20<provider>','Config\x20file\x20path','zbeqQ','model','1020CvMMcL','argv','requiredOption','\x0aExamples:\x0a\x20\x20$\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x20\x20\x20Configure\x20with\x20your\x20API\x20key\x0a\x20\x20$\x20tsu\x20analyze\x20src/index.ts\x20\x20\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20a\x20file\x0a\x20\x20$\x20tsu\x20analyze\x20--text\x20\x22Hello\x22\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20inline\x20text\x0a\x20\x20$\x20tsu\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Validate\x20tokenizer-speedup.yaml\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Get\x20your\x20free\x20API\x20key\x20at\x20https://tokenizer-speedup.simosphereai.com\x0a\x20\x202.\x20Run:\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x0a\x20\x203.\x20Restart\x20Claude\x20Code\x20—\x20the\x20plugin\x20activates\x20automatically\x0a\x0aDocs:\x20https://tokenizer-speedup.simosphereai.com\x0a','cli/index','jZdVJ','log','wsetC','20wKGbrL','command','setup','length','Nhquh','utf-8','naBuy','description','Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)','4700509stJwFL','message','gpt-4o','8345ZhSfAk','Model\x20name','2816289TdWmzX'];_0x3b59=function(){return _0x32ff3c;};return _0x3b59();}function _0x57c3(_0x1ce0f9,_0x6c98de){_0x1ce0f9=_0x1ce0f9-0x132;const _0x3b59dd=_0x3b59();let _0x57c38a=_0x3b59dd[_0x1ce0f9];return _0x57c38a;}const _0x5801d5=_0x57c3;(function(_0x6556d8,_0x7402b1){const _0x2675be=_0x57c3,_0x96631e=_0x6556d8();while(!![]){try{const _0x441279=-parseInt(_0x2675be(0x169))/0x1*(parseInt(_0x2675be(0x162))/0x2)+parseInt(_0x2675be(0x154))/0x3*(parseInt(_0x2675be(0x141))/0x4)+parseInt(_0x2675be(0x14d))/0x5*(-parseInt(_0x2675be(0x139))/0x6)+-parseInt(_0x2675be(0x14f))/0x7+-parseInt(_0x2675be(0x153))/0x8+parseInt(_0x2675be(0x155))/0x9+-parseInt(_0x2675be(0x168))/0xa*(-parseInt(_0x2675be(0x14a))/0xb);if(_0x441279===_0x7402b1)break;else _0x96631e['push'](_0x96631e['shift']());}catch(_0x29ad1d){_0x96631e['push'](_0x96631e['shift']());}}}(_0x3b59,0x61f14));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}from'node:fs';import{runSetup}from'./setup-cmd.js';export function buildCLI(){const _0x3a421f=_0x57c3,_0x5cf02d={'jBXaU':function(_0x570c8d,_0x533240){return _0x570c8d(_0x533240);},'aWuTU':function(_0x8d85e1,_0x2df72d){return _0x8d85e1===_0x2df72d;},'eRLKP':_0x3a421f(0x15a),'WkHju':_0x3a421f(0x14c),'YTJHq':function(_0x5795dd,_0x17642f,_0x521dc9){return _0x5795dd(_0x17642f,_0x521dc9);},'KgDdA':'Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','naBuy':_0x3a421f(0x15f),'KVsbM':function(_0x268368,_0x207ce8){return _0x268368(_0x207ce8);},'Nhquh':_0x3a421f(0x156),'NHaJo':_0x3a421f(0x167),'cRWKF':'analyze','hiEqK':'File\x20to\x20analyze','UStZC':_0x3a421f(0x135),'fuqEV':'LLM\x20provider\x20(claude,\x20openai)','MUonJ':_0x3a421f(0x133),'XpCjw':'-m,\x20--model\x20<model>','yEYFV':_0x3a421f(0x165),'jZdVJ':'Validate\x20configuration\x20file','zbeqQ':_0x3a421f(0x136),'wsetC':'tokenizer-speedup.yaml'},_0x46bc01=new Command();return _0x46bc01['name']('tsu')['description'](_0x3a421f(0x152))['version'](_0x5cf02d[_0x3a421f(0x145)])['addHelpText'](_0x3a421f(0x161),_0x3a421f(0x13c)),_0x46bc01['command'](_0x3a421f(0x143))[_0x3a421f(0x148)](_0x5cf02d[_0x3a421f(0x157)])[_0x3a421f(0x13b)](_0x3a421f(0x15d),_0x3a421f(0x149))[_0x3a421f(0x159)](_0x149316=>{_0x5cf02d['jBXaU'](runSetup,_0x149316['apiKey']);}),_0x46bc01['command'](_0x5cf02d['cRWKF'])['description']('Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text')[_0x3a421f(0x15c)]('[file]',_0x5cf02d[_0x3a421f(0x15b)])['option'](_0x5cf02d[_0x3a421f(0x150)],_0x5cf02d['fuqEV'],_0x5cf02d[_0x3a421f(0x16a)])['option'](_0x5cf02d[_0x3a421f(0x151)],_0x3a421f(0x14e))['option']('-t,\x20--text\x20<text>',_0x5cf02d[_0x3a421f(0x16b)])['action']((_0x4963fe,_0xb0561d)=>{const _0x41dc9e=_0x3a421f,_0x51e795=_0xb0561d[_0x41dc9e(0x138)]??(_0x5cf02d['aWuTU'](_0x41dc9e(0x133),_0xb0561d['provider'])?_0x5cf02d['eRLKP']:_0x5cf02d[_0x41dc9e(0x163)]),_0x5997ca=_0x5cf02d[_0x41dc9e(0x134)](createTokenProvider,_0xb0561d[_0x41dc9e(0x160)],_0x51e795);let _0x2bd429;if(_0xb0561d[_0x41dc9e(0x166)])_0x2bd429=_0xb0561d[_0x41dc9e(0x166)];else{if(!_0x4963fe)return console['error'](_0x5cf02d['KgDdA']),void(process['exitCode']=0x1);_0x2bd429=readFileSync(_0x4963fe,_0x41dc9e(0x146));}const _0x4b3c88=_0x5997ca['countTokens'](_0x2bd429),_0x2daa7a=_0x5997ca['estimateTokens'](_0x2bd429);console[_0x41dc9e(0x13f)](JSON[_0x41dc9e(0x15e)]({'file':_0x4963fe??'(inline)','tokens':_0x4b3c88,'estimate':_0x2daa7a,'provider':_0xb0561d['provider'],'model':_0x51e795}));}),_0x46bc01[_0x3a421f(0x142)](_0x3a421f(0x158))['description'](_0x5cf02d[_0x3a421f(0x13e)])[_0x3a421f(0x15c)]('[file]',_0x5cf02d[_0x3a421f(0x137)],_0x5cf02d[_0x3a421f(0x140)])['action'](async _0x2062f3=>{const _0xad7096=_0x3a421f;try{const _0x7a6047=_0x5cf02d['YTJHq'](readFileSync,_0x2062f3,'utf-8'),{parseConfig:_0x3ac976}=await import(_0x5cf02d[_0xad7096(0x147)]),_0x5683ec=_0x5cf02d['KVsbM'](_0x3ac976,_0x7a6047);console['log'](JSON[_0xad7096(0x15e)]({'valid':!0x0,'provider':_0x5683ec[_0xad7096(0x160)],'model':_0x5683ec['model'],'ruleCount':_0x5683ec[_0xad7096(0x132)][_0xad7096(0x144)]}));}catch(_0xd292a5){console[_0xad7096(0x13f)](JSON['stringify']({'valid':!0x1,'error':_0xd292a5[_0xad7096(0x14b)]})),process['exitCode']=0x1;}}),_0x46bc01;}process[_0x5801d5(0x13a)][0x1]?.['replace'](/\\/g,'/')[_0x5801d5(0x164)](_0x5801d5(0x13d))&&buildCLI()['parse']();
2
+ const _0x533665=_0x8fd7;(function(_0x3f2219,_0x164348){const _0x325cb5=_0x8fd7,_0x32e0cc=_0x3f2219();while(!![]){try{const _0x572951=parseInt(_0x325cb5(0xf9))/0x1*(parseInt(_0x325cb5(0xe9))/0x2)+parseInt(_0x325cb5(0xe6))/0x3*(parseInt(_0x325cb5(0x107))/0x4)+parseInt(_0x325cb5(0x111))/0x5+parseInt(_0x325cb5(0x10b))/0x6+parseInt(_0x325cb5(0xf7))/0x7*(-parseInt(_0x325cb5(0xe1))/0x8)+-parseInt(_0x325cb5(0x106))/0x9*(-parseInt(_0x325cb5(0x10d))/0xa)+parseInt(_0x325cb5(0x112))/0xb*(-parseInt(_0x325cb5(0xf5))/0xc);if(_0x572951===_0x164348)break;else _0x32e0cc['push'](_0x32e0cc['shift']());}catch(_0xec0a44){_0x32e0cc['push'](_0x32e0cc['shift']());}}}(_0x22f4,0x8df13));import{Command}from'commander';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{createTokenProvider}from'../shared/token-provider.js';function _0x22f4(){const _0x249cb2=['0.7.4','name','Validate\x20configuration\x20file','Analyze\x20inline\x20text\x20instead\x20of\x20file','LLM\x20provider\x20(claude,\x20openai)','message','216896SWKWbN','tokenizer-speedup.yaml','--api-key\x20<key>','YLQTZ','includes','2279961RauDQN','AxIQI','AgPrD','2078BbMBwm','description','-p,\x20--provider\x20<provider>','log','argument','WNfZF','action','rules','[file]','rJKXk','claude-sonnet-4-20250514','apiKey','12yomntL','option','238kekgIJ','config','478wUFIet','../plugin/config-loader.js','Configure\x20TokenizerSpeedUp\x20with\x20your\x20API\x20key\x20and\x20register\x20Claude\x20Code\x20hooks','File\x20to\x20analyze','fTuBs','command','rNlJw','addHelpText','exitCode','setup','wXkIN','sZyFX','stringify','2675565CRmska','4TRarrT','requiredOption','cli/index','Error:\x20','430374xhqskG','argv','30xXgaLO','XyYJf','error','length','183580KInSFF','8290986cvEgsG','provider','utf-8','text','model'];_0x22f4=function(){return _0x249cb2;};return _0x22f4();}import{readFileSync,realpathSync}from'node:fs';import{runSetup}from'./setup-cmd.js';function _0x8fd7(_0x3a7ef4,_0x361bcd){_0x3a7ef4=_0x3a7ef4-0xdb;const _0x22f45f=_0x22f4();let _0x8fd7c7=_0x22f45f[_0x3a7ef4];return _0x8fd7c7;}export function buildCLI(){const _0x2484dd=_0x8fd7,_0x475efe={'rJKXk':function(_0x23fcdc,_0x5deb3a){return _0x23fcdc===_0x5deb3a;},'AxIQI':'gpt-4o','wXkIN':'Error:\x20provide\x20a\x20file\x20argument\x20or\x20--text\x20option','eKEZt':function(_0x1eb5f3,_0x25706d){return _0x1eb5f3>_0x25706d;},'Aecvc':function(_0x5b215c,_0x2f8318){return _0x5b215c??_0x2f8318;},'WNfZF':function(_0x1b7371,_0x4b5208,_0x257571){return _0x1b7371(_0x4b5208,_0x257571);},'fTuBs':function(_0x16b82e,_0x57f554){return _0x16b82e(_0x57f554);},'rNlJw':'Your\x20TokenizerSpeedUp\x20API\x20key\x20(get\x20one\x20at\x20https://tokenizer-speedup.simosphereai.com)','MjnFY':'Analyze\x20token\x20count\x20of\x20a\x20file\x20or\x20text','YLQTZ':_0x2484dd(0xeb),'AgPrD':'claude','PelOx':'-m,\x20--model\x20<model>','sZyFX':'Model\x20name','cdrkM':'-t,\x20--text\x20<text>','FFxrN':_0x2484dd(0xf8),'xnpPl':_0x2484dd(0xdd),'XyYJf':_0x2484dd(0xf1),'iZsxw':'Config\x20file\x20path','JkICn':_0x2484dd(0xe2)},_0x6bc258=new Command();return _0x6bc258[_0x2484dd(0xdc)]('tsu')[_0x2484dd(0xea)]('TokenizerSpeedUp\x20—\x20Multi-LLM\x20Token\x20Optimization\x20CLI')['version'](_0x2484dd(0xdb))[_0x2484dd(0x100)]('after','\x0aExamples:\x0a\x20\x20$\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x20\x20\x20Configure\x20with\x20your\x20API\x20key\x0a\x20\x20$\x20tsu\x20analyze\x20src/index.ts\x20\x20\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20a\x20file\x0a\x20\x20$\x20tsu\x20analyze\x20--text\x20\x22Hello\x22\x20\x20\x20\x20\x20Count\x20tokens\x20in\x20inline\x20text\x0a\x20\x20$\x20tsu\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Validate\x20tokenizer-speedup.yaml\x0a\x0aQuick\x20Start:\x0a\x20\x201.\x20Get\x20your\x20free\x20API\x20key\x20at\x20https://tokenizer-speedup.simosphereai.com\x0a\x20\x202.\x20Run:\x20tsu\x20setup\x20--api-key\x20YOUR_KEY\x0a\x20\x203.\x20Restart\x20Claude\x20Code\x20—\x20the\x20plugin\x20activates\x20automatically\x0a\x0aDocs:\x20https://tokenizer-speedup.simosphereai.com\x0a'),_0x6bc258[_0x2484dd(0xfe)](_0x2484dd(0x102))['description'](_0x2484dd(0xfb))[_0x2484dd(0x108)](_0x2484dd(0xe3),_0x475efe[_0x2484dd(0xff)])['action'](_0x1001c3=>{const _0x23b0a4=_0x2484dd;runSetup(_0x1001c3[_0x23b0a4(0xf4)]);}),_0x6bc258['command']('analyze')[_0x2484dd(0xea)](_0x475efe['MjnFY'])[_0x2484dd(0xed)]('[file]',_0x2484dd(0xfc))['option'](_0x475efe[_0x2484dd(0xe4)],_0x2484dd(0xdf),_0x475efe[_0x2484dd(0xe8)])[_0x2484dd(0xf6)](_0x475efe['PelOx'],_0x475efe[_0x2484dd(0x104)])[_0x2484dd(0xf6)](_0x475efe['cdrkM'],_0x2484dd(0xde))[_0x2484dd(0xef)]((_0x394e9c,_0x40a41c)=>{const _0x288e80=_0x2484dd,_0x4a042f=_0x40a41c[_0x288e80(0x116)]??(_0x475efe[_0x288e80(0xf2)]('claude',_0x40a41c[_0x288e80(0x113)])?_0x288e80(0xf3):_0x475efe[_0x288e80(0xe7)]);let _0xb878cd,_0x2f2513;try{_0xb878cd=createTokenProvider(_0x40a41c[_0x288e80(0x113)],_0x4a042f);}catch(_0x13f61f){return console['error'](_0x288e80(0x10a)+_0x13f61f[_0x288e80(0xe0)]),void(process[_0x288e80(0x101)]=0x1);}if(void 0x0!==_0x40a41c[_0x288e80(0x115)])_0x2f2513=_0x40a41c[_0x288e80(0x115)];else{if(!_0x394e9c)return console[_0x288e80(0x10f)](_0x475efe[_0x288e80(0x103)]),void(process[_0x288e80(0x101)]=0x1);_0x2f2513=readFileSync(_0x394e9c,'utf-8');}_0x475efe['eKEZt'](_0x2f2513[_0x288e80(0x110)],0x7a120)&&console[_0x288e80(0x10f)]('Warning:\x20large\x20input\x20('+(_0x2f2513[_0x288e80(0x110)]/0x3e8)['toFixed'](0x0)+'K\x20chars)\x20—\x20processing\x20may\x20be\x20slow.');const _0x1d6fc0=_0xb878cd['countTokens'](_0x2f2513),_0x3de2a9=_0xb878cd['estimateTokens'](_0x2f2513);console['log'](JSON['stringify']({'file':_0x475efe['Aecvc'](_0x394e9c,'(inline)'),'tokens':_0x1d6fc0,'estimate':_0x3de2a9,'provider':_0x40a41c['provider'],'model':_0x4a042f}));}),_0x6bc258['command'](_0x475efe['FFxrN'])[_0x2484dd(0xea)](_0x475efe['xnpPl'])[_0x2484dd(0xed)](_0x475efe[_0x2484dd(0x10e)],_0x475efe['iZsxw'],_0x475efe['JkICn'])['action'](async _0x174bfd=>{const _0x1def43=_0x2484dd;try{const _0x4f6f96=_0x475efe[_0x1def43(0xee)](readFileSync,_0x174bfd,_0x1def43(0x114)),{parseConfig:_0x17e74d}=await import(_0x1def43(0xfa)),_0x1698a8=_0x475efe[_0x1def43(0xfd)](_0x17e74d,_0x4f6f96);console['log'](JSON[_0x1def43(0x105)]({'valid':!0x0,'provider':_0x1698a8['provider'],'model':_0x1698a8['model'],'ruleCount':_0x1698a8[_0x1def43(0xf0)]['length']}));}catch(_0x171f05){console[_0x1def43(0xec)](JSON['stringify']({'valid':!0x1,'error':_0x171f05[_0x1def43(0xe0)]})),process[_0x1def43(0x101)]=0x1;}}),_0x6bc258;}const resolvedArgv1=((()=>{const _0x4bf85a=_0x8fd7;try{return realpathSync(process[_0x4bf85a(0x10c)][0x1]??'')['replace'](/\\/g,'/');}catch{return process['argv'][0x1]?.['replace'](/\\/g,'/')??'';}})());resolvedArgv1[_0x533665(0xe5)](_0x533665(0x109))&&buildCLI()['parse']();
@@ -1 +1 @@
1
- const _0x1a0665=_0x2f24;(function(_0x185a2e,_0x31a24b){const _0x5e4349=_0x2f24,_0x48f23b=_0x185a2e();while(!![]){try{const _0x2801de=-parseInt(_0x5e4349(0xd5))/0x1+parseInt(_0x5e4349(0xe1))/0x2+-parseInt(_0x5e4349(0xdd))/0x3*(-parseInt(_0x5e4349(0xd6))/0x4)+-parseInt(_0x5e4349(0xda))/0x5+parseInt(_0x5e4349(0xed))/0x6+-parseInt(_0x5e4349(0xe2))/0x7*(parseInt(_0x5e4349(0xe0))/0x8)+-parseInt(_0x5e4349(0xea))/0x9*(-parseInt(_0x5e4349(0xe4))/0xa);if(_0x2801de===_0x31a24b)break;else _0x48f23b['push'](_0x48f23b['shift']());}catch(_0xbfd017){_0x48f23b['push'](_0x48f23b['shift']());}}}(_0x16db,0x58a76));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),'.config',_0x1a0665(0xe9)),CONFIG_FILE=join(CONFIG_DIR,'config.json'),CLAUDE_SETTINGS_FILE=join(homedir(),_0x1a0665(0xdb),'settings.local.json');export function runSetup(_0x36a5dd){const _0x27aa30=_0x1a0665,_0x2a5734={'jNHUf':_0x27aa30(0xd9)};try{saveApiKey(_0x36a5dd),console['log'](_0x27aa30(0xe8)),console[_0x27aa30(0xeb)](_0x2a5734['jNHUf']),registerHooks(),console[_0x27aa30(0xeb)]('✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.'),console['log'](''),console[_0x27aa30(0xeb)](_0x27aa30(0xe5));}catch(_0x3ab640){console[_0x27aa30(0xd7)](_0x27aa30(0xe6)+_0x3ab640['message']),process['exitCode']=0x1;}}function _0x2f24(_0x418df6,_0xd161c5){_0x418df6=_0x418df6-0xd5;const _0x16db4e=_0x16db();let _0x2f2421=_0x16db4e[_0x418df6];return _0x2f2421;}function saveApiKey(_0x1f00e0){const _0x4db8b4=_0x1a0665,_0x1e1bbf={'WYVMV':_0x4db8b4(0xe3)};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x5352cb={};try{_0x5352cb=JSON['parse'](readFileSync(CONFIG_FILE,_0x1e1bbf[_0x4db8b4(0xd8)]));}catch{}_0x5352cb['apiKey']=_0x1f00e0,writeFileSync(CONFIG_FILE,JSON[_0x4db8b4(0xde)](_0x5352cb,null,0x2)+'\x0a',_0x1e1bbf['WYVMV']);}function registerHooks(){const _0xfaa54=_0x1a0665,_0x58ea21={'BVJgr':_0xfaa54(0xec),'BvLPs':_0xfaa54(0xe9)};mkdirSync(join(homedir(),_0xfaa54(0xdb)),{'recursive':!0x0});let _0x46af5c={};try{_0x46af5c=JSON['parse'](readFileSync(CLAUDE_SETTINGS_FILE,'utf-8'));}catch{}const _0x5e5ed6=_0x46af5c[_0xfaa54(0xdc)]??{};_0x5e5ed6['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':'command','command':_0xfaa54(0xe9)}]}],_0x5e5ed6[_0xfaa54(0xdf)]=[{'matcher':'','hooks':[{'type':_0x58ea21['BVJgr'],'command':_0x58ea21['BvLPs'],'timeout':0xa}]}],_0x46af5c['hooks']=_0x5e5ed6,writeFileSync(CLAUDE_SETTINGS_FILE,JSON[_0xfaa54(0xde)](_0x46af5c,null,0x2)+'\x0a','utf-8');}export function loadApiKeyFromConfig(){const _0x1dacf5=_0x1a0665;try{return JSON[_0x1dacf5(0xe7)](readFileSync(CONFIG_FILE,_0x1dacf5(0xe3)))['apiKey']??void 0x0;}catch{return;}}function _0x16db(){const _0x38e0eb=['command','3301770dromEO','25150dSYNPL','4136QIPahU','error','WYVMV','⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','3374900hvuyTD','.claude','hooks','1335kexqPl','stringify','Stop','16hiBLDs','994248gGAqUn','1662052AVRsgc','utf-8','30ucbMBl','Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.','❌\x20Setup\x20failed:\x20','parse','✅\x20API\x20key\x20saved\x20successfully.','tokenizer-speedup','91737BXqvfL','log'];_0x16db=function(){return _0x38e0eb;};return _0x16db();}
1
+ const _0x2583ba=_0x2317;(function(_0x4d3510,_0x25d5d8){const _0x1ba371=_0x2317,_0x229628=_0x4d3510();while(!![]){try{const _0x3f6665=-parseInt(_0x1ba371(0x1e5))/0x1+-parseInt(_0x1ba371(0x1e9))/0x2*(-parseInt(_0x1ba371(0x1ff))/0x3)+-parseInt(_0x1ba371(0x1ee))/0x4*(-parseInt(_0x1ba371(0x1f0))/0x5)+-parseInt(_0x1ba371(0x1f5))/0x6+parseInt(_0x1ba371(0x1ef))/0x7*(parseInt(_0x1ba371(0x1fd))/0x8)+parseInt(_0x1ba371(0x200))/0x9+-parseInt(_0x1ba371(0x1fe))/0xa;if(_0x3f6665===_0x25d5d8)break;else _0x229628['push'](_0x229628['shift']());}catch(_0x10c574){_0x229628['push'](_0x229628['shift']());}}}(_0x3e78,0x58f88));import{readFileSync,writeFileSync,mkdirSync}from'node:fs';import{join}from'node:path';import{homedir}from'node:os';const CONFIG_DIR=join(homedir(),'.config','tokenizer-speedup'),CONFIG_FILE=join(CONFIG_DIR,_0x2583ba(0x1ec)),CLAUDE_SETTINGS_FILE=join(homedir(),'.claude',_0x2583ba(0x1e7));export function runSetup(_0x27f32f){const _0x4d21f4=_0x2583ba,_0x24e5fe={'NYdFc':'✅\x20API\x20key\x20saved\x20successfully.','hCgYV':_0x4d21f4(0x1eb),'gTdVb':'✅\x20Hooks\x20registered\x20in\x20Claude\x20Code\x20settings.'};try{if(!_0x27f32f||0x0===_0x27f32f['trim']()[_0x4d21f4(0x1f4)])return console['error'](_0x4d21f4(0x202)),void(process['exitCode']=0x1);if(_0x27f32f[_0x4d21f4(0x1e8)]()[_0x4d21f4(0x1f4)]<0x8)return console['error']('❌\x20API\x20key\x20is\x20too\x20short\x20(minimum\x208\x20characters).'),void(process[_0x4d21f4(0x204)]=0x1);saveApiKey(_0x27f32f[_0x4d21f4(0x1e8)]()),console['log'](_0x24e5fe[_0x4d21f4(0x1e6)]),console['log'](_0x24e5fe[_0x4d21f4(0x1f9)]),registerHooks(),console['log'](_0x24e5fe[_0x4d21f4(0x1f7)]),console['log'](''),console[_0x4d21f4(0x1f3)]('Setup\x20complete.\x20Please\x20restart\x20Claude\x20Code\x20to\x20activate\x20the\x20plugin.');}catch(_0x5943ee){console[_0x4d21f4(0x203)](_0x4d21f4(0x1f2)+_0x5943ee['message']),process['exitCode']=0x1;}}function saveApiKey(_0x2fa3c8){const _0x36abcd=_0x2583ba,_0x2242a7={'Krxur':_0x36abcd(0x1f6),'oGYzA':function(_0x3c4787,_0x42908d){return _0x3c4787+_0x42908d;}};mkdirSync(CONFIG_DIR,{'recursive':!0x0});let _0x196c2a={};try{_0x196c2a=JSON['parse'](readFileSync(CONFIG_FILE,_0x2242a7[_0x36abcd(0x1fa)]));}catch{}_0x196c2a['apiKey']=_0x2fa3c8,writeFileSync(CONFIG_FILE,_0x2242a7['oGYzA'](JSON[_0x36abcd(0x1ed)](_0x196c2a,null,0x2),'\x0a'),_0x2242a7[_0x36abcd(0x1fa)]);}function _0x3e78(){const _0x37b861=['5425880GCDgYR','3hLuRyI','4110192uAoBvQ','MraSQ','❌\x20API\x20key\x20cannot\x20be\x20empty.','error','exitCode','708682vQcCcf','NYdFc','settings.local.json','trim','1300408rBPNul','command','⚠️\x20\x20Claude\x20Code\x20will\x20restart\x20automatically\x20to\x20load\x20the\x20plugin.\x20This\x20is\x20expected\x20behavior.','config.json','stringify','263372fKhAMD','35lnxkeo','15gJRSRC','JxODq','❌\x20Setup\x20failed:\x20','log','length','2255892PPyMJB','utf-8','gTdVb','ZvgQm','hCgYV','Krxur','parse','dieIt','1099608YCrpyx'];_0x3e78=function(){return _0x37b861;};return _0x3e78();}function _0x2317(_0x56721f,_0xee2385){_0x56721f=_0x56721f-0x1e5;const _0x3e7827=_0x3e78();let _0x23179e=_0x3e7827[_0x56721f];return _0x23179e;}function registerHooks(){const _0xeec747=_0x2583ba,_0x1992f1={'ZvgQm':function(_0x26652d,_0x4a6a1a,_0x541135){return _0x26652d(_0x4a6a1a,_0x541135);},'JxODq':function(_0x4fc184,_0x401995,_0x156d13){return _0x4fc184(_0x401995,_0x156d13);},'MraSQ':'.claude','mdXdE':_0xeec747(0x1f6),'wiGLP':'command','YhXlU':'tokenizer-speedup','dieIt':function(_0x4fbfa6,_0x484170,_0x5803b6,_0x513af2){return _0x4fbfa6(_0x484170,_0x5803b6,_0x513af2);}};_0x1992f1[_0xeec747(0x1f8)](mkdirSync,_0x1992f1['JxODq'](join,homedir(),_0x1992f1[_0xeec747(0x201)]),{'recursive':!0x0});let _0x296bf1={};try{_0x296bf1=JSON['parse'](_0x1992f1[_0xeec747(0x1f1)](readFileSync,CLAUDE_SETTINGS_FILE,_0x1992f1['mdXdE']));}catch{}const _0x2b182b=_0x296bf1['hooks']??{};_0x2b182b['UserPromptSubmit']=[{'matcher':'','hooks':[{'type':_0x1992f1['wiGLP'],'command':_0x1992f1['YhXlU']}]}],_0x2b182b['Stop']=[{'matcher':'','hooks':[{'type':_0xeec747(0x1ea),'command':_0x1992f1['YhXlU'],'timeout':0xa}]}],_0x296bf1['hooks']=_0x2b182b,_0x1992f1[_0xeec747(0x1fc)](writeFileSync,CLAUDE_SETTINGS_FILE,JSON['stringify'](_0x296bf1,null,0x2)+'\x0a',_0x1992f1['mdXdE']);}export function loadApiKeyFromConfig(){const _0x2e3f83=_0x2583ba;try{return JSON[_0x2e3f83(0x1fb)](readFileSync(CONFIG_FILE,_0x2e3f83(0x1f6)))['apiKey']??void 0x0;}catch{return;}}
@@ -1 +1 @@
1
- (function(_0x326b6e,_0x128189){const _0x1c5619=_0x3385,_0xd1a0a5=_0x326b6e();while(!![]){try{const _0x3dc82e=parseInt(_0x1c5619(0x16a))/0x1+-parseInt(_0x1c5619(0x162))/0x2+parseInt(_0x1c5619(0x164))/0x3+-parseInt(_0x1c5619(0x169))/0x4+-parseInt(_0x1c5619(0x167))/0x5*(parseInt(_0x1c5619(0x16c))/0x6)+parseInt(_0x1c5619(0x163))/0x7+-parseInt(_0x1c5619(0x168))/0x8;if(_0x3dc82e===_0x128189)break;else _0xd1a0a5['push'](_0xd1a0a5['shift']());}catch(_0x2773e7){_0xd1a0a5['push'](_0xd1a0a5['shift']());}}}(_0x2205,0x3ea9a));function _0x3385(_0x49285e,_0x2c858b){_0x49285e=_0x49285e-0x161;const _0x220505=_0x2205();let _0x338519=_0x220505[_0x49285e];return _0x338519;}export function buildCheckoutParams(_0x375ee5){const _0x45ff54=_0x3385,_0x17c13f={'CZOhJ':_0x45ff54(0x161)},_0x3c6e27=[{'price':_0x375ee5['recurringPriceId'],'quantity':0x1}];return _0x375ee5[_0x45ff54(0x166)]&&_0x3c6e27['push']({'price':_0x375ee5[_0x45ff54(0x166)]}),{'customer':_0x375ee5['customerId'],'mode':_0x17c13f['CZOhJ'],'line_items':_0x3c6e27,'success_url':_0x375ee5[_0x45ff54(0x165)],'cancel_url':_0x375ee5[_0x45ff54(0x16b)],'metadata':{'tier':_0x375ee5[_0x45ff54(0x16d)]}};}function _0x2205(){const _0x2699a6=['54491lYnDAO','cancelUrl','12tsHbQY','tier','subscription','188948EttNyq','2591470HFPRQr','1496652PrqZer','successUrl','meteredPriceId','123780YGkUgB','590256qCaQOI','1796604xWmFzp'];_0x2205=function(){return _0x2699a6;};return _0x2205();}
1
+ (function(_0x27a6a9,_0x48c54e){const _0x23c912=_0x4f39,_0x46f64b=_0x27a6a9();while(!![]){try{const _0x1da112=-parseInt(_0x23c912(0x74))/0x1*(-parseInt(_0x23c912(0x79))/0x2)+-parseInt(_0x23c912(0x6e))/0x3*(-parseInt(_0x23c912(0x70))/0x4)+-parseInt(_0x23c912(0x76))/0x5*(-parseInt(_0x23c912(0x71))/0x6)+-parseInt(_0x23c912(0x6d))/0x7+parseInt(_0x23c912(0x6f))/0x8*(-parseInt(_0x23c912(0x7b))/0x9)+parseInt(_0x23c912(0x72))/0xa*(-parseInt(_0x23c912(0x73))/0xb)+-parseInt(_0x23c912(0x77))/0xc*(-parseInt(_0x23c912(0x78))/0xd);if(_0x1da112===_0x48c54e)break;else _0x46f64b['push'](_0x46f64b['shift']());}catch(_0x3ea3de){_0x46f64b['push'](_0x46f64b['shift']());}}}(_0x462e,0xd0bfb));export function buildCheckoutParams(_0x403987){const _0x1e67db=_0x4f39,_0x253055={'MmJAP':_0x1e67db(0x7a)},_0x325382=[{'price':_0x403987[_0x1e67db(0x6c)],'quantity':0x1}];return _0x403987[_0x1e67db(0x75)]&&_0x325382['push']({'price':_0x403987['meteredPriceId']}),{'customer':_0x403987['customerId'],'mode':_0x253055['MmJAP'],'line_items':_0x325382,'success_url':_0x403987['successUrl'],'cancel_url':_0x403987['cancelUrl'],'metadata':{'tier':_0x403987['tier']}};}function _0x4f39(_0x3029dd,_0x58a08c){_0x3029dd=_0x3029dd-0x6c;const _0x462ed5=_0x462e();let _0x4f3917=_0x462ed5[_0x3029dd];return _0x4f3917;}function _0x462e(){const _0x2b219e=['meteredPriceId','5vcrEcS','24sfddIz','10942672DuLHbq','455234dgPvwr','subscription','9475965NwSKbg','recurringPriceId','7716499DvLCdn','366OuGudu','8UkyACr','7564TPYHOi','9448836fbAKbC','40iCHHAl','1942424medQRU','1XMfFWr'];_0x462e=function(){return _0x2b219e;};return _0x462e();}
@@ -1 +1 @@
1
- const _0x1a9d39=_0xa590;(function(_0x2ef087,_0x4bd6f8){const _0x4bd8c8=_0xa590,_0x4f7483=_0x2ef087();while(!![]){try{const _0x54112f=parseInt(_0x4bd8c8(0xab))/0x1*(-parseInt(_0x4bd8c8(0xb3))/0x2)+parseInt(_0x4bd8c8(0xb4))/0x3*(-parseInt(_0x4bd8c8(0xac))/0x4)+parseInt(_0x4bd8c8(0xb1))/0x5*(parseInt(_0x4bd8c8(0xb2))/0x6)+-parseInt(_0x4bd8c8(0xa7))/0x7*(parseInt(_0x4bd8c8(0xaa))/0x8)+parseInt(_0x4bd8c8(0xa8))/0x9+parseInt(_0x4bd8c8(0xa6))/0xa+-parseInt(_0x4bd8c8(0xa9))/0xb*(-parseInt(_0x4bd8c8(0xae))/0xc);if(_0x54112f===_0x4bd6f8)break;else _0x4f7483['push'](_0x4f7483['shift']());}catch(_0x1a1309){_0x4f7483['push'](_0x4f7483['shift']());}}}(_0x4956,0x6be5e));export const STRIPE_CONFIG={'free':{'name':_0x1a9d39(0xad),'description':'Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','recurringPrice':0x0},'pro':{'name':'TokenizerSpeedUp\x20Pro','description':_0x1a9d39(0xb0),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':_0x1a9d39(0xaf),'description':'Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','recurringPrice':0x5dc,'meteredUnitAmount':0x18}};function _0xa590(_0x210041,_0x76a9f7){_0x210041=_0x210041-0xa6;const _0x495664=_0x4956();let _0xa59041=_0x495664[_0x210041];return _0xa59041;}function _0x4956(){const _0x5c4f67=['354lhRyxP','4178jdSbOQ','1353gLoYgy','6816100PubIPb','21izWBhN','1239561CwBLjC','22KcyrPT','1175192NCuIzb','265LGwAUX','4468wApMBb','TokenizerSpeedUp\x20Free','6406068sxrDpR','TokenizerSpeedUp\x20Team','Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','4490nMEcKk'];_0x4956=function(){return _0x5c4f67;};return _0x4956();}
1
+ const _0x45ec3c=_0x512b;function _0x512b(_0x5ca010,_0x28a237){_0x5ca010=_0x5ca010-0x16b;const _0x1501ae=_0x1501();let _0x512b9f=_0x1501ae[_0x5ca010];return _0x512b9f;}function _0x1501(){const _0x5f4e91=['TokenizerSpeedUp\x20Pro','6927010anTjNn','Per-seat\x20pricing.\x20$15/mo/seat\x20+\x208%\x20of\x20savings\x20over\x201M\x20tokens.','11JATHGW','3318SzpifS','32VsUooO','1038243rhmZhz','Unlimited\x20optimization.\x20$5/mo\x20+\x2010%\x20of\x20savings\x20over\x20500K\x20tokens.','5525829SBBiwn','4wJgBYj','2170KYwOJH','302218myMdmz','204XWqVQr','379929xCnTZL','1195YpCiiK'];_0x1501=function(){return _0x5f4e91;};return _0x1501();}(function(_0x1faeda,_0x3b29a7){const _0x4749c8=_0x512b,_0x4356df=_0x1faeda();while(!![]){try{const _0x1ebf40=-parseInt(_0x4749c8(0x174))/0x1*(parseInt(_0x4749c8(0x16c))/0x2)+parseInt(_0x4749c8(0x177))/0x3*(parseInt(_0x4749c8(0x16b))/0x4)+parseInt(_0x4749c8(0x170))/0x5*(-parseInt(_0x4749c8(0x175))/0x6)+-parseInt(_0x4749c8(0x16d))/0x7*(parseInt(_0x4749c8(0x176))/0x8)+parseInt(_0x4749c8(0x179))/0x9+-parseInt(_0x4749c8(0x172))/0xa+-parseInt(_0x4749c8(0x16f))/0xb*(-parseInt(_0x4749c8(0x16e))/0xc);if(_0x1ebf40===_0x3b29a7)break;else _0x4356df['push'](_0x4356df['shift']());}catch(_0x46cd0b){_0x4356df['push'](_0x4356df['shift']());}}}(_0x1501,0x8347e));export const STRIPE_CONFIG={'free':{'name':'TokenizerSpeedUp\x20Free','description':'Up\x20to\x20100K\x20tokens\x20saved/month.\x20Basic\x20dashboard.','recurringPrice':0x0},'pro':{'name':_0x45ec3c(0x171),'description':_0x45ec3c(0x178),'recurringPrice':0x1f4,'meteredUnitAmount':0x1e},'team':{'name':'TokenizerSpeedUp\x20Team','description':_0x45ec3c(0x173),'recurringPrice':0x5dc,'meteredUnitAmount':0x18}};
@@ -1 +1 @@
1
- const _0x391ca7=_0x5eb4;(function(_0x2ea063,_0x2010a8){const _0x40dac2=_0x5eb4,_0x14c203=_0x2ea063();while(!![]){try{const _0x7a46ea=parseInt(_0x40dac2(0x164))/0x1*(-parseInt(_0x40dac2(0x169))/0x2)+parseInt(_0x40dac2(0x16f))/0x3*(-parseInt(_0x40dac2(0x16c))/0x4)+-parseInt(_0x40dac2(0x172))/0x5+parseInt(_0x40dac2(0x16a))/0x6+parseInt(_0x40dac2(0x160))/0x7+parseInt(_0x40dac2(0x171))/0x8+parseInt(_0x40dac2(0x16d))/0x9;if(_0x7a46ea===_0x2010a8)break;else _0x14c203['push'](_0x14c203['shift']());}catch(_0x13ad50){_0x14c203['push'](_0x14c203['shift']());}}}(_0x4847,0xad2dc));import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG['pro']['meteredUnitAmount']},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG[_0x391ca7(0x167)][_0x391ca7(0x163)]}};export function calculateUsageCharge(_0xce62c4,_0x1ee207){const _0x4e21aa=_0x391ca7,_0x2e630c={'RxGMw':function(_0x4dc80d,_0x55c78f){return _0x4dc80d===_0x55c78f;},'ATlMy':function(_0x3e0c2d,_0x545cde){return _0x3e0c2d-_0x545cde;},'BRvsl':function(_0x19c71d,_0x50b53e){return _0x19c71d*_0x50b53e;}},_0x20c48a=TIER_LIMITS[_0xce62c4];if(_0x2e630c['RxGMw'](0x0,_0x20c48a[_0x4e21aa(0x162)]))return{'tier':_0xce62c4,'tokensSaved':_0x1ee207,'freeAllowance':_0x20c48a[_0x4e21aa(0x16b)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x41535a=Math['max'](0x0,_0x2e630c[_0x4e21aa(0x16e)](_0x1ee207,_0x20c48a[_0x4e21aa(0x16b)])),_0x5b8520=Math['ceil'](_0x41535a/0x186a0),_0x2916c1=_0x2e630c['BRvsl'](_0x5b8520,_0x20c48a['unitRate']);return{'tier':_0xce62c4,'tokensSaved':_0x1ee207,'freeAllowance':_0x20c48a[_0x4e21aa(0x16b)],'chargeableTokens':_0x41535a,'chargeableUnits':_0x5b8520,'unitRate':_0x20c48a[_0x4e21aa(0x162)],'amount':_0x2916c1};}export function buildUsageRecord(_0x3470e1,_0x3bfa98){const _0x5e5929=_0x391ca7,_0x3b106a={'AuJoQ':function(_0x52883d,_0x5a7523){return _0x52883d/_0x5a7523;}};return{'subscription_item':_0x3470e1,'quantity':_0x3bfa98,'action':'set','timestamp':Math[_0x5e5929(0x168)](_0x3b106a[_0x5e5929(0x165)](Date[_0x5e5929(0x166)](),0x3e8))};}function _0x5eb4(_0x49f49e,_0x58940f){_0x49f49e=_0x49f49e-0x160;const _0x484760=_0x4847();let _0x5eb4c6=_0x484760[_0x49f49e];return _0x5eb4c6;}function _0x4847(){const _0x23339a=['59658DvRzha','chargeableUnits','9627168KvPJCY','5326740VEPWIj','1720187nTOQAE','no\x20subscription_item_id','unitRate','meteredUnitAmount','277227vOoBpl','AuJoQ','now','team','floor','10WkzmGj','4374762mSUUqB','allowance','32ecDekM','10274823XXMQLU','ATlMy'];_0x4847=function(){return _0x23339a;};return _0x4847();}export function prepareUsageSync(_0x48c94e,_0x4f86ad,_0x267d1a){const _0x44cbe9=_0x391ca7,_0x4f69bf={'dEbfV':function(_0x2ed71f,_0x53e75f,_0x1e0cdd){return _0x2ed71f(_0x53e75f,_0x1e0cdd);}};if(!_0x267d1a)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x48c94e,'error':_0x44cbe9(0x161)};const _0x56c1e5=_0x4f69bf['dEbfV'](calculateUsageCharge,_0x48c94e,_0x4f86ad);if(0x0===_0x56c1e5[_0x44cbe9(0x170)])return{'synced':!0x0,'subscriptionItemId':_0x267d1a,'chargeableUnits':0x0,'tier':_0x48c94e};return buildUsageRecord(_0x267d1a,_0x56c1e5['chargeableUnits']),{'synced':!0x0,'subscriptionItemId':_0x267d1a,'chargeableUnits':_0x56c1e5['chargeableUnits'],'tier':_0x48c94e};}
1
+ const _0x23a0ad=_0x35ba;function _0x35ba(_0x599b89,_0x515aa3){_0x599b89=_0x599b89-0x1c9;const _0x2e427b=_0x2e42();let _0x35ba11=_0x2e427b[_0x599b89];return _0x35ba11;}function _0x2e42(){const _0x3f8c70=['17155180LgFays','qIptI','1750216eDaNdE','9880038SMWoYJ','meteredUnitAmount','set','pro','floor','2250072UiyYIR','zLLYV','chargeableUnits','4910045tOqMCe','max','4723137gffINd','unitRate','allowance','5548968xdzUXb'];_0x2e42=function(){return _0x3f8c70;};return _0x2e42();}(function(_0x3d87e6,_0x1b1c93){const _0x39e9bd=_0x35ba,_0x1d934e=_0x3d87e6();while(!![]){try{const _0x142f18=parseInt(_0x39e9bd(0x1d0))/0x1+parseInt(_0x39e9bd(0x1d6))/0x2+-parseInt(_0x39e9bd(0x1ca))/0x3+parseInt(_0x39e9bd(0x1cd))/0x4+-parseInt(_0x39e9bd(0x1d9))/0x5+parseInt(_0x39e9bd(0x1d1))/0x6+-parseInt(_0x39e9bd(0x1ce))/0x7;if(_0x142f18===_0x1b1c93)break;else _0x1d934e['push'](_0x1d934e['shift']());}catch(_0x3748d6){_0x1d934e['push'](_0x1d934e['shift']());}}}(_0x2e42,0xdc397));import{STRIPE_CONFIG}from'./stripe-config.js';const TIER_LIMITS={'free':{'allowance':0x186a0,'unitRate':0x0},'pro':{'allowance':0x7a120,'unitRate':STRIPE_CONFIG[_0x23a0ad(0x1d4)][_0x23a0ad(0x1d2)]},'team':{'allowance':0xf4240,'unitRate':STRIPE_CONFIG['team'][_0x23a0ad(0x1d2)]}};export function calculateUsageCharge(_0x9207a9,_0x39f52b){const _0x42d23c=_0x23a0ad,_0x4011de={'qIptI':function(_0xde690,_0x3e11c7){return _0xde690-_0x3e11c7;},'KVeIK':function(_0x48aed9,_0x48896d){return _0x48aed9*_0x48896d;}},_0x2c9513=TIER_LIMITS[_0x9207a9];if(0x0===_0x2c9513[_0x42d23c(0x1cb)])return{'tier':_0x9207a9,'tokensSaved':_0x39f52b,'freeAllowance':_0x2c9513[_0x42d23c(0x1cc)],'chargeableTokens':0x0,'chargeableUnits':0x0,'unitRate':0x0,'amount':0x0};const _0x2dfb8a=Math[_0x42d23c(0x1c9)](0x0,_0x4011de[_0x42d23c(0x1cf)](_0x39f52b,_0x2c9513['allowance'])),_0x2a2bc8=Math['ceil'](_0x2dfb8a/0x186a0),_0x373632=_0x4011de['KVeIK'](_0x2a2bc8,_0x2c9513[_0x42d23c(0x1cb)]);return{'tier':_0x9207a9,'tokensSaved':_0x39f52b,'freeAllowance':_0x2c9513['allowance'],'chargeableTokens':_0x2dfb8a,'chargeableUnits':_0x2a2bc8,'unitRate':_0x2c9513[_0x42d23c(0x1cb)],'amount':_0x373632};}export function buildUsageRecord(_0x42171e,_0x38a766){const _0x34a2a6=_0x23a0ad,_0x5d2948={'oroQn':_0x34a2a6(0x1d3),'eawab':function(_0x3f877a,_0xeb5cbe){return _0x3f877a/_0xeb5cbe;}};return{'subscription_item':_0x42171e,'quantity':_0x38a766,'action':_0x5d2948['oroQn'],'timestamp':Math[_0x34a2a6(0x1d5)](_0x5d2948['eawab'](Date['now'](),0x3e8))};}export function prepareUsageSync(_0x2a72c5,_0x1bb4c5,_0x30bfb6){const _0x5130f5=_0x23a0ad,_0x2ebd99={'zLLYV':function(_0x152615,_0x4ede41,_0xf84f45){return _0x152615(_0x4ede41,_0xf84f45);}};if(!_0x30bfb6)return{'synced':!0x1,'subscriptionItemId':'','chargeableUnits':0x0,'tier':_0x2a72c5,'error':'no\x20subscription_item_id'};const _0x25fea0=_0x2ebd99[_0x5130f5(0x1d7)](calculateUsageCharge,_0x2a72c5,_0x1bb4c5);if(0x0===_0x25fea0['chargeableUnits'])return{'synced':!0x0,'subscriptionItemId':_0x30bfb6,'chargeableUnits':0x0,'tier':_0x2a72c5};return buildUsageRecord(_0x30bfb6,_0x25fea0[_0x5130f5(0x1d8)]),{'synced':!0x0,'subscriptionItemId':_0x30bfb6,'chargeableUnits':_0x25fea0[_0x5130f5(0x1d8)],'tier':_0x2a72c5};}
@@ -1 +1 @@
1
- (function(_0x340f9e,_0x253701){const _0x525076=_0x2808,_0x5cbafd=_0x340f9e();while(!![]){try{const _0x4268d1=-parseInt(_0x525076(0x139))/0x1+-parseInt(_0x525076(0x13c))/0x2*(parseInt(_0x525076(0x138))/0x3)+-parseInt(_0x525076(0x137))/0x4+parseInt(_0x525076(0x13f))/0x5*(-parseInt(_0x525076(0x130))/0x6)+-parseInt(_0x525076(0x133))/0x7+parseInt(_0x525076(0x134))/0x8*(parseInt(_0x525076(0x136))/0x9)+parseInt(_0x525076(0x132))/0xa;if(_0x4268d1===_0x253701)break;else _0x5cbafd['push'](_0x5cbafd['shift']());}catch(_0x459653){_0x5cbafd['push'](_0x5cbafd['shift']());}}}(_0x5c6f,0x86de0));function _0x2808(_0x15b621,_0xfcabf7){_0x15b621=_0x15b621-0x129;const _0x5c6f70=_0x5c6f();let _0x2808fc=_0x5c6f70[_0x15b621];return _0x2808fc;}function _0x5c6f(){const _0x2f1e8f=['subscription','customer','upsert','object','current_period_end','data','FGltW','metadata','3510522XzAMKL','tier','25377950hjupcd','4647223GuJitJ','841200eTuhTW','free','45mBhnvm','354268ZkevPx','3BllzIX','1051716fEmxdt','price','invoice_paid','243740xDnBMc','kPFCo','items','5etTzdl'];_0x5c6f=function(){return _0x2f1e8f;};return _0x5c6f();}export function handleWebhookEvent(_0x2ba340,_0x5176cf){const _0xcfb63f=_0x2808,_0x2131cf={'kPFCo':'invoice.paid','ZsXSN':'customer.subscription.updated','FGltW':'subscription_updated','xaLhi':'active','MBLTi':'customer.subscription.deleted','oOUCt':'subscription_canceled'};switch(_0x2ba340['type']){case _0x2131cf[_0xcfb63f(0x13d)]:{const _0x4dd452=_0x2ba340['data']['object'];return{'handled':!0x0,'action':_0xcfb63f(0x13b),'customerId':_0x4dd452['customer'],'subscriptionId':_0x4dd452[_0xcfb63f(0x140)]};}case _0x2131cf['ZsXSN']:{const _0x5de321=_0x2ba340['data'][_0xcfb63f(0x12b)],_0x4fc443={'handled':!0x0,'action':_0x2131cf[_0xcfb63f(0x12e)],'customerId':_0x5de321[_0xcfb63f(0x129)],'subscriptionId':_0x5de321['id']};return _0x5176cf&&_0x5176cf[_0xcfb63f(0x12a)]({'id':_0x5de321['id'],'customerId':_0x5de321['customer'],'status':_0x5de321['status']||_0x2131cf['xaLhi'],'tier':_0x5de321[_0xcfb63f(0x12f)]?.[_0xcfb63f(0x131)]||_0xcfb63f(0x135),'currentPeriodEnd':_0x5de321[_0xcfb63f(0x12c)]||0x0,'meteredSubscriptionItemId':extractMeteredItemId(_0x5de321),'updatedAt':''}),_0x4fc443;}case _0x2131cf['MBLTi']:{const _0x4627e3=_0x2ba340['data']['object'],_0x46cf6b={'handled':!0x0,'action':_0x2131cf['oOUCt'],'customerId':_0x4627e3['customer'],'subscriptionId':_0x4627e3['id']};return _0x5176cf&&_0x5176cf['upsert']({'id':_0x4627e3['id'],'customerId':_0x4627e3['customer'],'status':'canceled','tier':_0x4627e3['metadata']?.['tier']||'free','currentPeriodEnd':_0x4627e3['current_period_end']||0x0,'updatedAt':''}),_0x46cf6b;}default:return{'handled':!0x1,'action':'ignored'};}}function extractMeteredItemId(_0x14a0c4){const _0x28b193=_0x2808,_0x2a3387=_0x14a0c4[_0x28b193(0x13e)];if(!_0x2a3387?.[_0x28b193(0x12d)])return;const _0x5b1ff3=_0x2a3387['data']['find'](_0x2c0b91=>'metered'===_0x2c0b91[_0x28b193(0x13a)]?.['recurring']?.['usage_type']);return _0x5b1ff3?.['id'];}
1
+ (function(_0xa8ec47,_0x56b4e6){const _0x2acf3a=_0x5c39,_0x598c85=_0xa8ec47();while(!![]){try{const _0x526163=-parseInt(_0x2acf3a(0x179))/0x1+-parseInt(_0x2acf3a(0x183))/0x2*(parseInt(_0x2acf3a(0x180))/0x3)+parseInt(_0x2acf3a(0x18c))/0x4*(parseInt(_0x2acf3a(0x18e))/0x5)+-parseInt(_0x2acf3a(0x181))/0x6*(-parseInt(_0x2acf3a(0x184))/0x7)+-parseInt(_0x2acf3a(0x189))/0x8+parseInt(_0x2acf3a(0x18a))/0x9*(parseInt(_0x2acf3a(0x17f))/0xa)+-parseInt(_0x2acf3a(0x186))/0xb;if(_0x526163===_0x56b4e6)break;else _0x598c85['push'](_0x598c85['shift']());}catch(_0x53525c){_0x598c85['push'](_0x598c85['shift']());}}}(_0x429b,0x22e27));export function handleWebhookEvent(_0x4d7ccd,_0x5877f8){const _0x45b621=_0x5c39,_0x36b3ba={'xTFcy':'invoice.paid','TwiDH':'customer.subscription.updated','BPWtP':'subscription_updated','aBSVU':function(_0x3ed390,_0x595b4d){return _0x3ed390(_0x595b4d);},'lONTo':_0x45b621(0x191),'ZvGrk':'free'};switch(_0x4d7ccd[_0x45b621(0x185)]){case _0x36b3ba['xTFcy']:{const _0x1be965=_0x4d7ccd['data']['object'];return{'handled':!0x0,'action':_0x45b621(0x177),'customerId':_0x1be965['customer'],'subscriptionId':_0x1be965['subscription']};}case _0x36b3ba['TwiDH']:{const _0x4dfda2=_0x4d7ccd['data'][_0x45b621(0x18f)],_0x215aa2={'handled':!0x0,'action':_0x36b3ba[_0x45b621(0x17a)],'customerId':_0x4dfda2[_0x45b621(0x17b)],'subscriptionId':_0x4dfda2['id']};return _0x5877f8&&_0x5877f8['upsert']({'id':_0x4dfda2['id'],'customerId':_0x4dfda2[_0x45b621(0x17b)],'status':_0x4dfda2['status']||'active','tier':_0x4dfda2['metadata']?.[_0x45b621(0x17c)]||_0x45b621(0x190),'currentPeriodEnd':_0x4dfda2['current_period_end']||0x0,'meteredSubscriptionItemId':_0x36b3ba['aBSVU'](extractMeteredItemId,_0x4dfda2),'updatedAt':''}),_0x215aa2;}case _0x45b621(0x182):{const _0x14804c=_0x4d7ccd['data'][_0x45b621(0x18f)],_0x4a6e93={'handled':!0x0,'action':_0x36b3ba['lONTo'],'customerId':_0x14804c['customer'],'subscriptionId':_0x14804c['id']};return _0x5877f8&&_0x5877f8[_0x45b621(0x17d)]({'id':_0x14804c['id'],'customerId':_0x14804c[_0x45b621(0x17b)],'status':'canceled','tier':_0x14804c['metadata']?.[_0x45b621(0x17c)]||_0x36b3ba[_0x45b621(0x18d)],'currentPeriodEnd':_0x14804c[_0x45b621(0x178)]||0x0,'updatedAt':''}),_0x4a6e93;}default:return{'handled':!0x1,'action':'ignored'};}}function _0x5c39(_0x558b5b,_0x1bd363){_0x558b5b=_0x558b5b-0x177;const _0x429b17=_0x429b();let _0x5c39a7=_0x429b17[_0x558b5b];return _0x5c39a7;}function _0x429b(){const _0x57eec1=['metered','8RvfTGZ','ZvGrk','700745uZtYKT','object','free','subscription_canceled','invoice_paid','current_period_end','169169VzeXJQ','BPWtP','customer','tier','upsert','data','10iMoAvb','555171pXKJtW','1633206fFLTdd','customer.subscription.deleted','2gIApmT','7gRZVKF','type','2344958mSEIDC','find','recurring','223568fPCXGP','1671642mNDMgD'];_0x429b=function(){return _0x57eec1;};return _0x429b();}function extractMeteredItemId(_0x3047b6){const _0x504a01=_0x5c39,_0x4be0d6=_0x3047b6['items'];if(!_0x4be0d6?.[_0x504a01(0x17e)])return;const _0x3e69d4=_0x4be0d6['data'][_0x504a01(0x187)](_0x4791ba=>_0x504a01(0x18b)===_0x4791ba['price']?.[_0x504a01(0x188)]?.['usage_type']);return _0x3e69d4?.['id'];}
@@ -1 +1 @@
1
- function _0x42ab(_0x262a93,_0x3ecda8){_0x262a93=_0x262a93-0x76;const _0x53a81b=_0x53a8();let _0x42ab4b=_0x53a81b[_0x262a93];return _0x42ab4b;}const _0x5f14b2=_0x42ab;function _0x53a8(){const _0x503ab7=['3574140XcBZLy','2034ohvzXE','getBySubscriptionId','subs','8714748wjycBG','set','4984959KNewny','getByCustomerId','46072ALrKbL','2228248AdPqHK','values','63465XGydgs','655668HisYTi','6xBAXyl'];_0x53a8=function(){return _0x503ab7;};return _0x53a8();}(function(_0x4f65f9,_0x4f970a){const _0x2a2582=_0x42ab,_0x466c03=_0x4f65f9();while(!![]){try{const _0x162008=-parseInt(_0x2a2582(0x7e))/0x1+-parseInt(_0x2a2582(0x7c))/0x2+parseInt(_0x2a2582(0x80))/0x3*(parseInt(_0x2a2582(0x7f))/0x4)+parseInt(_0x2a2582(0x81))/0x5+parseInt(_0x2a2582(0x77))/0x6+parseInt(_0x2a2582(0x79))/0x7+-parseInt(_0x2a2582(0x7b))/0x8*(parseInt(_0x2a2582(0x82))/0x9);if(_0x162008===_0x4f970a)break;else _0x466c03['push'](_0x466c03['shift']());}catch(_0x171519){_0x466c03['push'](_0x466c03['shift']());}}}(_0x53a8,0xb1c46));export class MemorySubscriptionStore{['subs']=new Map();['upsert'](_0x1c2dde){const _0x404d56=_0x42ab;_0x1c2dde['updatedAt']=new Date()['toISOString'](),this['subs'][_0x404d56(0x78)](_0x1c2dde['id'],_0x1c2dde);}[_0x5f14b2(0x7a)](_0xffb945){const _0x1358c4=_0x5f14b2;for(const _0x4d900d of this['subs'][_0x1358c4(0x7d)]())if(_0x4d900d['customerId']===_0xffb945)return _0x4d900d;}[_0x5f14b2(0x83)](_0x551d40){return this['subs']['get'](_0x551d40);}['list'](){const _0x843bbc=_0x5f14b2;return[...this[_0x843bbc(0x76)][_0x843bbc(0x7d)]()];}}
1
+ function _0x144a(){const _0x638725=['8275725OrOMFO','subs','upsert','61913VQLvxj','get','updatedAt','21ORejWw','953475OazLuX','32586eHGQIo','2045196EnQPoE','values','361808YredSr','60lHqttU','816156pHOLcf'];_0x144a=function(){return _0x638725;};return _0x144a();}const _0x4aec0f=_0x3289;function _0x3289(_0x5a8edf,_0x6f2cfd){_0x5a8edf=_0x5a8edf-0x84;const _0x144aa6=_0x144a();let _0x3289cc=_0x144aa6[_0x5a8edf];return _0x3289cc;}(function(_0x384cb6,_0x124f55){const _0x1a35e=_0x3289,_0xae3793=_0x384cb6();while(!![]){try{const _0x5c4336=-parseInt(_0x1a35e(0x91))/0x1+parseInt(_0x1a35e(0x88))/0x2*(parseInt(_0x1a35e(0x8c))/0x3)+parseInt(_0x1a35e(0x8d))/0x4+parseInt(_0x1a35e(0x87))/0x5+parseInt(_0x1a35e(0x89))/0x6+parseInt(_0x1a35e(0x86))/0x7*(parseInt(_0x1a35e(0x8b))/0x8)+-parseInt(_0x1a35e(0x8e))/0x9;if(_0x5c4336===_0x124f55)break;else _0xae3793['push'](_0xae3793['shift']());}catch(_0x40010a){_0xae3793['push'](_0xae3793['shift']());}}}(_0x144a,0x34a94));export class MemorySubscriptionStore{[_0x4aec0f(0x8f)]=new Map();[_0x4aec0f(0x90)](_0x15e057){const _0x1a82bf=_0x4aec0f;_0x15e057[_0x1a82bf(0x85)]=new Date()['toISOString'](),this[_0x1a82bf(0x8f)]['set'](_0x15e057['id'],_0x15e057);}['getByCustomerId'](_0x218662){const _0x33cc49=_0x4aec0f;for(const _0x5ed709 of this[_0x33cc49(0x8f)]['values']())if(_0x5ed709['customerId']===_0x218662)return _0x5ed709;}['getBySubscriptionId'](_0xc5c012){const _0x143898=_0x4aec0f;return this[_0x143898(0x8f)][_0x143898(0x84)](_0xc5c012);}['list'](){const _0x3981ac=_0x4aec0f;return[...this['subs'][_0x3981ac(0x8a)]()];}}
@@ -1,68 +1,37 @@
1
1
  {
2
- "version": "0.7.2",
3
- "build": "2026-03-05T06:22:10.376Z",
2
+ "version": "0.7.4",
3
+ "build": "2026-03-05T07:28:48.533Z",
4
4
  "files": {
5
- "cli/analyze.d.ts": "sha256:520ab064dfdf8a4fa95f73d74d4f96add4d60d8a22a32f622f68c4ffbf8e9785",
6
- "cli/analyze.js": "sha256:8c5d71b5bf439235c46faec42da53b481c977d3192d4c163e4d333e66b6d56eb",
7
- "cli/config-cmd.d.ts": "sha256:eeae10f481e1ef2f3c6573d52bbbe1bc6994895a34c5dfc9a7c4e9f89db3460d",
8
- "cli/config-cmd.js": "sha256:67390d2512ad03d8267de174f1d27e5a41e4181fc6f5500f0c5e5895c837687c",
9
- "cli/index.d.ts": "sha256:2e031d7fa827aeb1cdcdb13aa1a73a6ec1e3e1e0f6d27a874bfc7f69e27e5037",
10
- "cli/index.js": "sha256:aac8c4f3336e27b50708ae52107d8057a8b9b5b7b14e5573e4200057d0aef4df",
11
- "cli/setup-cmd.d.ts": "sha256:5fb0b00fd2b57e681e590153ad8ec33b9619179bfbed635c5ed01c94b232852d",
12
- "cli/setup-cmd.js": "sha256:7005261688bb726444a8026e8ba20a29204bc6bbfc9b5099c71e637fee1c7666",
13
- "cloud/stripe-checkout.d.ts": "sha256:ce58292aa395baf9068d819c4feb5cd29781a05a5f6977024f27b8ac0c839d1e",
14
- "cloud/stripe-checkout.js": "sha256:dd6f1a8fb0308e63239d920abcc2954daa23b9d5eef207c0d8ad55c7c206b308",
15
- "cloud/stripe-config.d.ts": "sha256:b5e4ef4c8d722b239ef13008bd216d3c56291e12ff82e3e9b9c494cd2303d656",
16
- "cloud/stripe-config.js": "sha256:c70deb4dd0f2675ce6e41c39c0be6ff8171a074a866895d6f53aad4dcf6e2b97",
17
- "cloud/stripe-usage.d.ts": "sha256:134415ce475007c2ed196305ab91489b688d852dda3cbf2f240d1d860d24bd2c",
18
- "cloud/stripe-usage.js": "sha256:0d4048d8e81dd1dbd3a62c80c7e228b70c04e9190fea403b5385c69a33f35dea",
19
- "cloud/stripe-webhooks.d.ts": "sha256:cca005cebcc8f1e916e975d6adef5ad15d09df4249facbb718cbc3f831ff84ab",
20
- "cloud/stripe-webhooks.js": "sha256:7241ae8ef57ca4b9b48210033891ff441deac86398bb686e3baff57229ebe46c",
21
- "cloud/subscription-store.d.ts": "sha256:6e6ba1b28d7b58131aeebd96051dae42a1e9fb5069e48a7e5d042268d5b417ec",
22
- "cloud/subscription-store.js": "sha256:3e8475095c8d38188913330652cc774520d4f48fd2208d20efd98b53c9847ce2",
23
- "plugin/cli.d.ts": "sha256:43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012",
24
- "plugin/cli.js": "sha256:aa07782f8ffb50810cde1150b135c342ace81be436c30b4117a95fd87ee6a496",
25
- "plugin/config-loader.d.ts": "sha256:d55c9c53c9df25188abd6af71c217bb4a3feee89960ea411e174b10c456177da",
26
- "plugin/config-loader.js": "sha256:1bd487e7b33571541b768e44c88a473f354cc23753fafea2023b105f500d5bbf",
27
- "plugin/context-compressor.d.ts": "sha256:c14912ec73df27f3c49abc84edc510edee126956eb197c446863309348a03412",
28
- "plugin/context-compressor.js": "sha256:bcb7fd5f46b0849b563d6859dbd960436fb54067a1fd4383e1b45dc7a2234d02",
29
- "plugin/hook-dispatcher.d.ts": "sha256:ee5a5e5ac92dd5ca872b76611a4531fa074cb077e417f8bc9f97cf750e87aced",
30
- "plugin/hook-dispatcher.js": "sha256:d9e645904aa1c8f90cc5476e20fc0e522806fef69e4892f757712ec54207f886",
31
- "plugin/metering-client.d.ts": "sha256:f0be7100119afdfdb557fdfd4bab872e53d2d472205d8f85fa7241e457c59c19",
32
- "plugin/metering-client.js": "sha256:fa5d10e44180cc9fd1c62fae0c20c941f0bfe3d147932f9b331e9b917c9efdae",
33
- "plugin/metrics-collector.d.ts": "sha256:91a0b593ff1f9dfbc7f02473ac250e2e875c5ac774000811490c1c1e46987c09",
34
- "plugin/metrics-collector.js": "sha256:27890b235542d4511a640fdd06e988e340eb0bff0a313d8b7c95e515eda83612",
35
- "plugin/onboarding.d.ts": "sha256:b907ca6fc63a732f28a3c173c4a79e42e84971a0efe7cde39c2d9767376a97b6",
36
- "plugin/onboarding.js": "sha256:a197acd7e733285c27ba83a2a98d64f1da564087cc6a6cbbaf9e09e786c72ad9",
37
- "plugin/precompact-handler.d.ts": "sha256:52b1570601955ed1aa26541f651e3f45fde21ec6ce8042001dd0ac2fab253ccd",
38
- "plugin/precompact-handler.js": "sha256:901cade9ced14e042e8d15a70f0d4bf849f62ed2d272114419540f4438a58fb8",
39
- "plugin/report.d.ts": "sha256:8027321ede260c9302dfd19c73cf48e334595350fee14485475e50008f74645f",
40
- "plugin/report.js": "sha256:eba74ac51ec645c83179828f96b3bb468e9e773aac6ed4b5350511ab2366c67a",
41
- "plugin/rule-analytics-store.d.ts": "sha256:710a52c82dc6e4b2998cdd10a51083be8103b39b15b6d6d37ac8272a58e854ec",
42
- "plugin/rule-analytics-store.js": "sha256:b19a5ed7fd7c0390f407f71e2b91e9079a5431cb7fb56cda7d90cbc71767f416",
43
- "plugin/rule-analytics.d.ts": "sha256:cdeffbbc424b5452f57ca697b9c5e5ed0264efc0d56342ce476bd591b564aff3",
44
- "plugin/rule-analytics.js": "sha256:d79b62c3e85069d82501a4a7acff5cc64e981becf597ad412fc68464925090d7",
45
- "plugin/rule-engine.d.ts": "sha256:e9e9e0c8af47ecf1c039a6db15a656ef3cd28e4a7521204d4eaf076a15ee2cc8",
46
- "plugin/rule-engine.js": "sha256:de4118eeb51f3d2169b92eb66429ea41d579645a43e740676eddc6626976244e",
47
- "plugin/rule-sharing.d.ts": "sha256:8fc87926ec3752c2e0d21274c98ef3bb21f2a10665eb5536b726ea8d94479a79",
48
- "plugin/rule-sharing.js": "sha256:d6584d85ddfcc1e124d12d601ab8658f8541e6105eeab86f21b881b24dc48faa",
49
- "plugin/rule-suggest.d.ts": "sha256:4d12dac9df44bb3adf5b5e9456e683a42625e8b28712c80aa62292a5b3d40be9",
50
- "plugin/rule-suggest.js": "sha256:27323c1490e70320ceb4009830c6be01c861691a8b73ea1b04d7238fbce75f2c",
51
- "plugin/session-start.d.ts": "sha256:36cb2cc2a7e09195e650aa7a96b8ae420b612c23907fa35723501d27600d4ff1",
52
- "plugin/session-start.js": "sha256:7615d9ca71a81dfac7789c6fcd3af855ee46055e14b888f573a1326f88b5aeca",
53
- "plugin/smart-context.d.ts": "sha256:cace6c764ef3cf1a18f87f09ad4650abe69322b7629cd8383a7cc775f7f81be1",
54
- "plugin/smart-context.js": "sha256:6aba84993055379fa3a51160e71c42c7d1571f3bd1cc68aa02787fc8031d6906",
55
- "shared/license.d.ts": "sha256:4778f87bbd80b5033479e03556a7e755aa7787707f3b875aa8795c4f1e97ee96",
56
- "shared/license.js": "sha256:98283b257e0b74d372be8c0e2cf07ef87aa33fb60b25bbdc291e503a75383a86",
57
- "shared/providers/claude-provider.d.ts": "sha256:58d95cac3a61871425760a3ad7cd4b7749737841d49f84f70e933c52ed297f32",
58
- "shared/providers/claude-provider.js": "sha256:e72fb7ec0a6f406cab6b3d871880c558485beeaf02fac3a187476b11297b79bb",
59
- "shared/providers/openai-provider.d.ts": "sha256:2114b5a1dcc4c03c5c26094d941189ffe4d6cb26a9ecc7e102830eb8bcab3cf7",
60
- "shared/providers/openai-provider.js": "sha256:85453369ef8718688614b2de73b81dd0f01a0f1d68aaf063a82fd748b357aee1",
61
- "shared/token-counter.d.ts": "sha256:d7e1bfe11fb4893dd936057db98fb4c9e1ee95c3d13b2bc24309fc471512f3b5",
62
- "shared/token-counter.js": "sha256:315e16a43badc9e02a4ec459cd75ce05a172d1b8ed6618e447adab02e0576bb2",
63
- "shared/token-provider.d.ts": "sha256:f3728d375158e79fef3055f56dc247395101ecee4c21911997668de3607aea0e",
64
- "shared/token-provider.js": "sha256:29d9049ba597518d3b72eee94806f03b94ce920c9d2788dc24f2ebf94881702e",
65
- "shared/types.d.ts": "sha256:20600b79ba665bdd2200ab8390784c37a508f29b23f1967a4662b86de8baa122",
5
+ "cli/analyze.js": "sha256:de1b97165c9428156ac7fce78f5f4783f29303d4d32cd54ddabdc4c7d7ee3e13",
6
+ "cli/config-cmd.js": "sha256:99b666d2a5d0d5d83cbf0d549334ffa4956564a2a34f0e7051add2b6ee719f81",
7
+ "cli/index.js": "sha256:b84bc6e8fa322addaa6230dd20e52451d7325c73781c69612c9fe9b37b993d28",
8
+ "cli/setup-cmd.js": "sha256:845081b06056c8f5c63efd6ecda2e2b2279b7b29c8db8d2321bf53a746fbae1b",
9
+ "cloud/stripe-checkout.js": "sha256:63600859eec26b903f937b28bfa1009c55ef9d450c8bb161dcb118edbd5a6b1a",
10
+ "cloud/stripe-config.js": "sha256:1b3c87b018011b268f2a2691b96f997d2152086dd11abac8f04d68854b95e21d",
11
+ "cloud/stripe-usage.js": "sha256:904e4a816b6c5d24658d645570bf690fc52c95f975bc3ef7ec0b383e0c1c08f2",
12
+ "cloud/stripe-webhooks.js": "sha256:57c55429df008a54445d914174d0d25ad18209bac2b1bd4ca5fd77ead557139c",
13
+ "cloud/subscription-store.js": "sha256:4e8096575ff8145102ccee5e472a17fd8bb79fd3b4e871a633f3a1e95d31f0a6",
14
+ "plugin/cli.js": "sha256:8e8269fc4aadcca233f8a4072d8b80b2c6c4fa7b2ce833c55785131f2dc66f10",
15
+ "plugin/config-loader.js": "sha256:f26093ca5dbd3d1795adc7c74245b4f71565899b52b67c1a0431fe50c23674fd",
16
+ "plugin/context-compressor.js": "sha256:8e1121d6197278823a6119785646d39d9d0d9e7d34a3b1dc83f12cc6e8f4ce6d",
17
+ "plugin/hook-dispatcher.js": "sha256:b0c83d61618c09243cb6386c3eab24dd2b862bf79e9c08d83ee810d0672fd5bd",
18
+ "plugin/metering-client.js": "sha256:e61ce0ee45184f562c6e3a491263cd3402cf6eff824dfc4aeac0f8b36472e9dd",
19
+ "plugin/metrics-collector.js": "sha256:0670a0d7217681febeea6e501038ac5560c1c94a8af0506f57b658ca229cb62d",
20
+ "plugin/onboarding.js": "sha256:97b330d6e1fb1e109bf8491e2377c607d5210847293a78f65d023d59924f8903",
21
+ "plugin/precompact-handler.js": "sha256:7b6cfa55eed307108d9be50d26db0c9ec1b587970c87e184778a5620de89f603",
22
+ "plugin/report.js": "sha256:10d2b4b87e33bcfc02f47819054a8248009b0fbae01953a594fee81ad656b2d4",
23
+ "plugin/rule-analytics-store.js": "sha256:48961785ac7f3315b5ca75e08e6fd1e55ce3b250a060c08ea481a1b06d3db319",
24
+ "plugin/rule-analytics.js": "sha256:f638b35b1dbc5ff6bb21d9bfb869276de920edcce753394eb04fd61a82ff817b",
25
+ "plugin/rule-engine.js": "sha256:49c94d8bb152cfd8f22fbf51e72434ad6691616ff58cccdaef2a6e355b5550a3",
26
+ "plugin/rule-sharing.js": "sha256:3b3a1568c638576abfd1a55e6464686ff0e260b179225953c30c397ffd894356",
27
+ "plugin/rule-suggest.js": "sha256:95eb716c9eab8510f901a419e22ad1a6392506aa6018d478308cd75c63e6a04e",
28
+ "plugin/session-start.js": "sha256:dfb970dbea11f455fda7a5967f872f16274a6fa611bcc6c330c2eeb46903aeae",
29
+ "plugin/smart-context.js": "sha256:a5e86917b0349e3cea56206df66eb397e2fcc445dbe59380f2772cc15ec9866f",
30
+ "shared/license.js": "sha256:081d8d02faa1eca18ba1c7dc17de820e519ad80e1fd7834fa5436f4129f09c91",
31
+ "shared/providers/claude-provider.js": "sha256:1baa81d1b24e5b1c87785cd5436f3ad6396c998f47b1ab351e6b0a90c0ddc5cd",
32
+ "shared/providers/openai-provider.js": "sha256:46f3ce3aead8812c9655e35e5ad27aaccaaef25eb431597089884c62bcb4d9e1",
33
+ "shared/token-counter.js": "sha256:e043a9a56141c173a4a9aa0ce978bb0c96571520bb766f12cdade2d638a8c002",
34
+ "shared/token-provider.js": "sha256:063e73d5dbaef5162bb04cf9c605dd6b881e26111975e267d12b4b2e3e81700e",
66
35
  "shared/types.js": "sha256:56e1b0c10087ee6ff7f949b15d1ef63cb11228ff93a159a52f9ad7ef851e4e02"
67
36
  }
68
37
  }
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x2c2ffd=_0x308d;(function(_0x3938dc,_0x467335){const _0x3d5b28=_0x308d,_0x3aaebc=_0x3938dc();while(!![]){try{const _0x665745=parseInt(_0x3d5b28(0xed))/0x1*(parseInt(_0x3d5b28(0xdc))/0x2)+-parseInt(_0x3d5b28(0xdf))/0x3+-parseInt(_0x3d5b28(0xec))/0x4*(parseInt(_0x3d5b28(0xee))/0x5)+-parseInt(_0x3d5b28(0xe4))/0x6*(parseInt(_0x3d5b28(0xea))/0x7)+-parseInt(_0x3d5b28(0xe8))/0x8*(parseInt(_0x3d5b28(0xeb))/0x9)+-parseInt(_0x3d5b28(0xe1))/0xa+parseInt(_0x3d5b28(0xef))/0xb;if(_0x665745===_0x467335)break;else _0x3aaebc['push'](_0x3aaebc['shift']());}catch(_0x32863a){_0x3aaebc['push'](_0x3aaebc['shift']());}}}(_0xf728,0xbad15));import{resolve}from'node:path';import{loadConfig}from'./config-loader.js';function _0xf728(){const _0x104dba=['mZOSH','1209159MNlnjn','hCDdk','7818420ywYkBl','endpoint','exit','42246pTSzcC','SessionStart','push','filter','279312zNfzsh','stdin','819cklluE','333oDrABv','28gZCxEQ','1069234IZjSmF','444120UPQZbW','39800739FqAVGQ','stringify','metering','send','UserPromptSubmit','utf-8','dZYCH','provider','cwd','join','catch','Stop','additionalContext','2AacMVV','model'];_0xf728=function(){return _0x104dba;};return _0xf728();}import{HookDispatcher}from'./hook-dispatcher.js';function _0x308d(_0x5a741b,_0x96ae53){_0x5a741b=_0x5a741b-0xdb;const _0xf7288a=_0xf728();let _0x308d28=_0xf7288a[_0x5a741b];return _0x308d28;}import{buildSessionStartContext}from'./session-start.js';import{buildSmartContext}from'./smart-context.js';import{MeteringClient,buildMeterPayload}from'./metering-client.js';import{loadApiKeyFromConfig}from'../cli/setup-cmd.js';if(!process.env.TOKENIZER_API_KEY){const t=loadApiKeyFromConfig();t&&(process.env.TOKENIZER_API_KEY=t);}async function main(){const _0x57c7c1=_0x308d,_0x2312d5={'dZYCH':function(_0x470777,_0x18af45){return _0x470777(_0x18af45);},'WiMpw':'../..','mZOSH':function(_0x18f707,_0x373895){return _0x18f707>_0x373895;},'hCDdk':'PreCompact'},_0x29c6b6=[];for await(const _0x23af9d of process[_0x57c7c1(0xe9)])_0x29c6b6[_0x57c7c1(0xe6)](_0x23af9d);const _0x3a2346=Buffer['concat'](_0x29c6b6)['toString'](_0x57c7c1(0xf4));let _0x1d04cb;try{_0x1d04cb=JSON['parse'](_0x3a2346);}catch{process[_0x57c7c1(0xe3)](0x0);}const _0x531da6=_0x1d04cb[_0x57c7c1(0xf7)]||process['cwd'](),_0x1e4cda=_0x1d04cb['hook_event_name'];let _0x47ff76;try{_0x47ff76=_0x2312d5[_0x57c7c1(0xf5)](loadConfig,_0x531da6);}catch{const _0x315555=process.env.CLAUDE_PLUGIN_ROOT||resolve(import.meta.dirname,_0x2312d5['WiMpw']);_0x47ff76=loadConfig(_0x315555);}const _0x27a3d4=new HookDispatcher(_0x47ff76,_0x531da6,_0x1d04cb['session_id']);let _0x53d7c9={};switch(_0x1e4cda){case _0x57c7c1(0xe5):_0x53d7c9=buildSessionStartContext({'cwd':_0x531da6});break;case _0x57c7c1(0xf3):{const _0x390f6c=_0x27a3d4['handleUserPromptSubmit'](_0x1d04cb),_0x43cee3=_0x2312d5[_0x57c7c1(0xf5)](buildSmartContext,{'prompt':_0x1d04cb['prompt']||'','cwd':_0x531da6}),_0x31a62f=[_0x390f6c[_0x57c7c1(0xdb)],_0x43cee3['additionalContext']][_0x57c7c1(0xe7)](Boolean);_0x53d7c9=_0x2312d5[_0x57c7c1(0xde)](_0x31a62f['length'],0x0)?{'additionalContext':_0x31a62f[_0x57c7c1(0xf8)]('\x0a')}:{};break;}case _0x2312d5[_0x57c7c1(0xe0)]:_0x53d7c9=_0x27a3d4['handlePreCompact'](_0x1d04cb);break;case _0x57c7c1(0xfa):{const _0x3b42b5=_0x27a3d4['handleSessionStop'](),_0x2b2e68=new MeteringClient(_0x47ff76[_0x57c7c1(0xf1)][_0x57c7c1(0xe2)]),_0x5604f0=buildMeterPayload(_0x3b42b5,{'provider':_0x47ff76[_0x57c7c1(0xf6)],'model':_0x47ff76[_0x57c7c1(0xdd)]});await _0x2b2e68[_0x57c7c1(0xf2)](_0x5604f0);break;}}process['stdout']['write'](JSON[_0x57c7c1(0xf0)](_0x53d7c9)),process['exit'](0x0);}main()[_0x2c2ffd(0xf9)](()=>process['exit'](0x0));
2
+ const _0x48fd4c=_0xea48;(function(_0x4b3336,_0x3ff85f){const _0x6c95c0=_0xea48,_0x449250=_0x4b3336();while(!![]){try{const _0x89a70e=parseInt(_0x6c95c0(0x120))/0x1+-parseInt(_0x6c95c0(0x110))/0x2*(parseInt(_0x6c95c0(0x11d))/0x3)+-parseInt(_0x6c95c0(0x128))/0x4*(-parseInt(_0x6c95c0(0x114))/0x5)+-parseInt(_0x6c95c0(0x11c))/0x6+parseInt(_0x6c95c0(0x11b))/0x7*(parseInt(_0x6c95c0(0x12a))/0x8)+-parseInt(_0x6c95c0(0x119))/0x9*(-parseInt(_0x6c95c0(0x112))/0xa)+parseInt(_0x6c95c0(0x111))/0xb*(parseInt(_0x6c95c0(0x125))/0xc);if(_0x89a70e===_0x3ff85f)break;else _0x449250['push'](_0x449250['shift']());}catch(_0xb9b7a8){_0x449250['push'](_0x449250['shift']());}}}(_0x330d,0x587a8));import{resolve}from'node:path';function _0xea48(_0x1b651e,_0x37492e){_0x1b651e=_0x1b651e-0x110;const _0x330dd2=_0x330d();let _0xea4892=_0x330dd2[_0x1b651e];return _0xea4892;}import{loadConfig}from'./config-loader.js';function _0x330d(){const _0x3ad850=['exit','utf-8','provider','metering','hook_event_name','1390NkyTCW','836SnDMjC','33890LhZCQv','cwd','77590VpoLGN','QMJKe','QcUiC','additionalContext','handlePreCompact','135RuncGS','write','2753177WjOYoT','3835344kknVVT','2094vgeHlg','parse','filter','36970WjaYdE','handleSessionStop','kmbYC','model','prompt','146532Fnxzlv','ZOdOK','session_id','20FvJsST','send','8VABQMR'];_0x330d=function(){return _0x3ad850;};return _0x330d();}import{HookDispatcher}from'./hook-dispatcher.js';import{buildSessionStartContext}from'./session-start.js';import{buildSmartContext}from'./smart-context.js';import{MeteringClient,buildMeterPayload}from'./metering-client.js';import{loadApiKeyFromConfig}from'../cli/setup-cmd.js';if(!process.env.TOKENIZER_API_KEY){const t=loadApiKeyFromConfig();t&&(process.env.TOKENIZER_API_KEY=t);}async function main(){const _0x537e38=_0xea48,_0x1d2a35={'QcUiC':_0x537e38(0x12c),'ZOdOK':function(_0x321423,_0x1466a9){return _0x321423(_0x1466a9);},'NAHdr':function(_0x2e4b5d,_0x47ff9f,_0xa0eaa3){return _0x2e4b5d(_0x47ff9f,_0xa0eaa3);},'pqjZS':'../..','QMJKe':'SessionStart','kmbYC':'UserPromptSubmit','bTlmb':function(_0x437e89,_0x202d8f){return _0x437e89(_0x202d8f);}},_0x11a082=[];for await(const _0x44cf62 of process['stdin'])_0x11a082['push'](_0x44cf62);const _0x2415f2=Buffer['concat'](_0x11a082)['toString'](_0x1d2a35[_0x537e38(0x116)]);let _0x5312fd;try{_0x5312fd=JSON[_0x537e38(0x11e)](_0x2415f2);}catch{process[_0x537e38(0x12b)](0x0);}const _0x52b002=_0x5312fd[_0x537e38(0x113)]||process[_0x537e38(0x113)](),_0x37b295=_0x5312fd[_0x537e38(0x12f)];let _0x2b634e;try{_0x2b634e=_0x1d2a35[_0x537e38(0x126)](loadConfig,_0x52b002);}catch{const _0x4040ec=process.env.CLAUDE_PLUGIN_ROOT||_0x1d2a35['NAHdr'](resolve,import.meta.dirname,_0x1d2a35['pqjZS']);_0x2b634e=_0x1d2a35['ZOdOK'](loadConfig,_0x4040ec);}const _0x58cb74=new HookDispatcher(_0x2b634e,_0x52b002,_0x5312fd[_0x537e38(0x127)]);let _0x32640b={};switch(_0x37b295){case _0x1d2a35[_0x537e38(0x115)]:_0x32640b=buildSessionStartContext({'cwd':_0x52b002});break;case _0x1d2a35[_0x537e38(0x122)]:{const _0x5f12db=_0x58cb74['handleUserPromptSubmit'](_0x5312fd),_0x78dc06=_0x1d2a35['bTlmb'](buildSmartContext,{'prompt':_0x5312fd[_0x537e38(0x124)]||'','cwd':_0x52b002}),_0x2862d9=[_0x5f12db[_0x537e38(0x117)],_0x78dc06[_0x537e38(0x117)]][_0x537e38(0x11f)](Boolean);_0x32640b=_0x2862d9['length']>0x0?{'additionalContext':_0x2862d9['join']('\x0a')}:{};break;}case'PreCompact':_0x32640b=_0x58cb74[_0x537e38(0x118)](_0x5312fd);break;case'Stop':{const _0x374a36=_0x58cb74[_0x537e38(0x121)](),_0x101ee3=new MeteringClient(_0x2b634e[_0x537e38(0x12e)]['endpoint']),_0x5ac8fc=buildMeterPayload(_0x374a36,{'provider':_0x2b634e[_0x537e38(0x12d)],'model':_0x2b634e[_0x537e38(0x123)]});await _0x101ee3[_0x537e38(0x129)](_0x5ac8fc);break;}}process['stdout'][_0x537e38(0x11a)](JSON['stringify'](_0x32640b)),process[_0x537e38(0x12b)](0x0);}main()['catch'](()=>process[_0x48fd4c(0x12b)](0x0));
@@ -1 +1 @@
1
- function _0x2a3d(_0x51b034,_0x5f3709){_0x51b034=_0x51b034-0x15d;const _0x57ba2e=_0x57ba();let _0x2a3dfc=_0x57ba2e[_0x51b034];return _0x2a3dfc;}(function(_0x190832,_0x494675){const _0x2ac60a=_0x2a3d,_0x4bf3b7=_0x190832();while(!![]){try{const _0x2ea2e9=parseInt(_0x2ac60a(0x16f))/0x1*(parseInt(_0x2ac60a(0x16c))/0x2)+-parseInt(_0x2ac60a(0x15f))/0x3*(parseInt(_0x2ac60a(0x168))/0x4)+-parseInt(_0x2ac60a(0x167))/0x5+-parseInt(_0x2ac60a(0x16d))/0x6*(parseInt(_0x2ac60a(0x16e))/0x7)+-parseInt(_0x2ac60a(0x173))/0x8*(parseInt(_0x2ac60a(0x171))/0x9)+parseInt(_0x2ac60a(0x163))/0xa*(parseInt(_0x2ac60a(0x165))/0xb)+parseInt(_0x2ac60a(0x169))/0xc;if(_0x2ea2e9===_0x494675)break;else _0x4bf3b7['push'](_0x4bf3b7['shift']());}catch(_0x56fd04){_0x4bf3b7['push'](_0x4bf3b7['shift']());}}}(_0x57ba,0x60b94));import{readFileSync}from'node:fs';function _0x57ba(){const _0x5b154d=['ySlFW','368hSshGn','claude','fwwnC','join','provider','2562gnltBP','.\x20Known:\x20','ypdLV','rules','190wyzHeH','gpt-4o','287122uGbqNI','Zptll','3147115QVjkUN','144rjLnNc','13096956KuCKDR','noouL','version','24126HVSmaQ','62022RJEvwr','203nNKvqP','1VFFfwM','AslIG','47601oPloRS'];_0x57ba=function(){return _0x5b154d;};return _0x57ba();}import{join}from'node:path';import _0x5d229d from'js-yaml';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME='tokenizer-speedup.yaml',DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320},DEFAULT_METERING={'endpoint':'https://api.simosphere.ai/v1/meter','batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x4c6b50){const _0x5be8cb=_0x2a3d,_0x569405={'Zptll':'number','ypdLV':'Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','noouL':_0x5be8cb(0x174),'zohYk':function(_0x2b5cda,_0x4e29ba){return _0x2b5cda===_0x4e29ba;},'LAAup':'claude-sonnet-4-20250514','tMfhB':_0x5be8cb(0x164),'fwwnC':function(_0x1dd805){return _0x1dd805();}},_0x15744e=_0x5d229d['load'](_0x4c6b50);if(!_0x15744e||_0x569405[_0x5be8cb(0x166)]!=typeof _0x15744e[_0x5be8cb(0x16b)])throw new Error(_0x569405[_0x5be8cb(0x161)]);const _0x238f8b=_0x15744e[_0x5be8cb(0x15e)]??_0x569405['noouL'],_0x22287f=_0x15744e['model']??(_0x569405['zohYk'](_0x569405[_0x5be8cb(0x16a)],_0x238f8b)?_0x569405['LAAup']:_0x569405['tMfhB']),_0x493bc3=_0x569405[_0x5be8cb(0x175)](listProviders);if(!_0x493bc3['includes'](_0x238f8b))throw new Error('Unknown\x20provider:\x20'+_0x238f8b+_0x5be8cb(0x160)+_0x493bc3[_0x5be8cb(0x15d)](',\x20'));const _0x132684=Array['isArray'](_0x15744e['rules'])?_0x15744e[_0x5be8cb(0x162)]:[],_0x26211d=_0x15744e['context_limits']??DEFAULT_LIMITS,_0x544904=_0x15744e['metering']??DEFAULT_METERING;return{'version':_0x15744e['version'],'provider':_0x238f8b,'model':_0x22287f,'rules':_0x132684,'context_limits':_0x26211d,'metering':_0x544904};}export function loadConfigFromString(_0x3984f2){const _0x5a2b18={'KgSLn':function(_0x290ac1,_0x385354){return _0x290ac1(_0x385354);}};return _0x5a2b18['KgSLn'](parseConfig,_0x3984f2);}export function loadConfig(_0x339986){const _0x31054f=_0x2a3d,_0x228c89={'ySlFW':function(_0x414074,_0x4e4fc3,_0xd26f68){return _0x414074(_0x4e4fc3,_0xd26f68);},'jbaTv':function(_0x33a49e,_0x323dbc){return _0x33a49e(_0x323dbc);},'AslIG':function(_0x57d1e1,_0x2fd6a1,_0x579b95){return _0x57d1e1(_0x2fd6a1,_0x579b95);}},_0x1abaeb=_0x228c89[_0x31054f(0x172)](join,_0x339986,CONFIG_FILENAME);return _0x228c89['jbaTv'](parseConfig,_0x228c89[_0x31054f(0x170)](readFileSync,_0x1abaeb,'utf-8'));}
1
+ function _0x3210(_0x4d176d,_0x45c380){_0x4d176d=_0x4d176d-0x138;const _0x318fc5=_0x318f();let _0x3210eb=_0x318fc5[_0x4d176d];return _0x3210eb;}const _0x1a90c2=_0x3210;(function(_0x18f7b1,_0xefbf16){const _0x4038f5=_0x3210,_0x1e9282=_0x18f7b1();while(!![]){try{const _0x47cb68=parseInt(_0x4038f5(0x14b))/0x1*(parseInt(_0x4038f5(0x13b))/0x2)+parseInt(_0x4038f5(0x143))/0x3*(-parseInt(_0x4038f5(0x13c))/0x4)+-parseInt(_0x4038f5(0x14c))/0x5+parseInt(_0x4038f5(0x13f))/0x6+parseInt(_0x4038f5(0x142))/0x7+-parseInt(_0x4038f5(0x138))/0x8+parseInt(_0x4038f5(0x149))/0x9;if(_0x47cb68===_0xefbf16)break;else _0x1e9282['push'](_0x1e9282['shift']());}catch(_0x43aba3){_0x1e9282['push'](_0x1e9282['shift']());}}}(_0x318f,0x1ba40));import{readFileSync}from'node:fs';import{join}from'node:path';import _0x1526aa from'js-yaml';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME=_0x1a90c2(0x13a),DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320},DEFAULT_METERING={'endpoint':_0x1a90c2(0x13e),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x54684f){const _0x57b48a=_0x1a90c2,_0x135a3d={'BUFKN':function(_0x298fb9,_0xa53cae){return _0x298fb9!=_0xa53cae;},'uQbIR':'number','HURIv':_0x57b48a(0x14d),'diAbi':_0x57b48a(0x140),'HauUS':'gpt-4o','LvpRE':function(_0x4c1f75){return _0x4c1f75();}},_0x32548a=_0x1526aa['load'](_0x54684f);if(!_0x32548a||_0x135a3d['BUFKN'](_0x135a3d['uQbIR'],typeof _0x32548a['version']))throw new Error(_0x135a3d['HURIv']);const _0x37d3eb=_0x32548a['provider']??'claude',_0x38ecaa=_0x32548a['model']??(_0x57b48a(0x139)===_0x37d3eb?_0x135a3d[_0x57b48a(0x141)]:_0x135a3d['HauUS']),_0x47936f=_0x135a3d[_0x57b48a(0x147)](listProviders);if(!_0x47936f['includes'](_0x37d3eb))throw new Error('Unknown\x20provider:\x20'+_0x37d3eb+_0x57b48a(0x13d)+_0x47936f[_0x57b48a(0x144)](',\x20'));const _0x403d46=Array['isArray'](_0x32548a['rules'])?_0x32548a['rules']:[],_0x1ee14e=_0x32548a[_0x57b48a(0x145)]??DEFAULT_LIMITS,_0x592582=_0x32548a['metering']??DEFAULT_METERING;return{'version':_0x32548a[_0x57b48a(0x14a)],'provider':_0x37d3eb,'model':_0x38ecaa,'rules':_0x403d46,'context_limits':_0x1ee14e,'metering':_0x592582};}export function loadConfigFromString(_0x45ebbb){const _0x49445d=_0x1a90c2,_0x4b786b={'eJRUx':function(_0x17e5ae,_0x406af4){return _0x17e5ae(_0x406af4);}};return _0x4b786b[_0x49445d(0x146)](parseConfig,_0x45ebbb);}function _0x318f(){const _0x2fe798=['version','4798wRpbFo','717490vlpgdi','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','289144iJbOAB','claude','tokenizer-speedup.yaml','28xzIwJg','4kmPBLm','.\x20Known:\x20','https://api.simosphere.ai/v1/meter','10794icwTnG','claude-sonnet-4-20250514','diAbi','1169469SwCylF','122847MBviJZ','join','context_limits','eJRUx','LvpRE','utf-8','879912gCmVmj'];_0x318f=function(){return _0x2fe798;};return _0x318f();}export function loadConfig(_0x38dd17){const _0x49ba2f=_0x1a90c2,_0x517ac6={'PUKHr':function(_0x387f11,_0x3f7f35){return _0x387f11(_0x3f7f35);}},_0x3c0e74=join(_0x38dd17,CONFIG_FILENAME);return _0x517ac6['PUKHr'](parseConfig,readFileSync(_0x3c0e74,_0x49ba2f(0x148)));}
@@ -1 +1 @@
1
- (function(_0x22ef39,_0x33d090){const _0x3d6161=_0x4859,_0x286d6d=_0x22ef39();while(!![]){try{const _0x42c150=parseInt(_0x3d6161(0xf7))/0x1+parseInt(_0x3d6161(0x104))/0x2*(-parseInt(_0x3d6161(0xfe))/0x3)+-parseInt(_0x3d6161(0x100))/0x4*(-parseInt(_0x3d6161(0xfd))/0x5)+-parseInt(_0x3d6161(0x101))/0x6*(-parseInt(_0x3d6161(0xf4))/0x7)+-parseInt(_0x3d6161(0xf8))/0x8+-parseInt(_0x3d6161(0xf5))/0x9+parseInt(_0x3d6161(0xf9))/0xa*(parseInt(_0x3d6161(0x106))/0xb);if(_0x42c150===_0x33d090)break;else _0x286d6d['push'](_0x286d6d['shift']());}catch(_0x1564f6){_0x286d6d['push'](_0x286d6d['shift']());}}}(_0x5bea,0x942c1));function _0x5bea(){const _0x3e5186=['map','1368932SlndQy','1219638lxfDjK','XFuMI','SMFJi','1514asEkbA','OERfu','174141fZNyWV','14laNhmL','4735386nlJdcQ','split','1185984pwPHjc','9662936DDvimu','510FlgibK','length','\x0a\x0a[...\x20gekuerzt,\x20','floor','5HIWZbu','1590etJJbf'];_0x5bea=function(){return _0x3e5186;};return _0x5bea();}import{countTokens}from'../shared/token-counter.js';export function compressContext(_0x448df2,_0x4a8c7c){const _0x5aad8c=_0x4859,_0xf0c85c={'HlLzf':function(_0x400717,_0x37e97d){return _0x400717<=_0x37e97d;},'SMFJi':function(_0xd4c419,_0x26a831){return _0xd4c419(_0x26a831);},'noKiG':function(_0x513cf6,_0xca8a90){return _0x513cf6>_0xca8a90;},'gUxzF':function(_0x422269,_0x4dc9b5){return _0x422269+_0x4dc9b5;},'OERfu':function(_0x2537ca,_0x337789){return _0x2537ca+_0x337789;},'ntMNU':_0x5aad8c(0xfb),'XFuMI':'\x20→\x20'};if(!_0x448df2)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0xe9526a=countTokens(_0x448df2);if(_0xf0c85c['HlLzf'](_0xe9526a,_0x4a8c7c))return{'text':_0x448df2,'originalTokens':_0xe9526a,'compressedTokens':_0xe9526a,'wasTruncated':!0x1};const _0x4f447c=_0x448df2['split']('\x0a\x0a');let _0x1078e4='',_0xbf12f=0x0;for(const _0x2a5bb0 of _0x4f447c){const _0x4c39c6=_0x1078e4?_0x1078e4+'\x0a\x0a'+_0x2a5bb0:_0x2a5bb0,_0x3b887e=_0xf0c85c[_0x5aad8c(0x103)](countTokens,_0x4c39c6);if(_0x3b887e>_0x4a8c7c)break;_0x1078e4=_0x4c39c6,_0xbf12f=_0x3b887e;}if(!_0x1078e4&&_0x4f447c[_0x5aad8c(0xfa)]>0x0){const _0x369a86=_0x4f447c[0x0][_0x5aad8c(0xf6)](/\s+/);let _0x5836c1='';for(const _0x46f679 of _0x369a86){const _0x4892df=_0x5836c1?_0x5836c1+'\x20'+_0x46f679:_0x46f679;if(_0xf0c85c['noKiG'](countTokens(_0x4892df),_0x4a8c7c-0x5))break;_0x5836c1=_0x4892df;}_0x1078e4=_0x5836c1,_0xbf12f=countTokens(_0x1078e4);}const _0x4c8135=_0xf0c85c['gUxzF'](_0xf0c85c[_0x5aad8c(0x105)](_0x1078e4+_0xf0c85c['ntMNU'],_0xe9526a)+_0xf0c85c[_0x5aad8c(0x102)],_0xbf12f)+'\x20Token]';return{'text':_0x4c8135,'originalTokens':_0xe9526a,'compressedTokens':countTokens(_0x4c8135),'wasTruncated':!0x0};}function _0x4859(_0x26d263,_0x5f1bca){_0x26d263=_0x26d263-0xf4;const _0x5bea60=_0x5bea();let _0x48593c=_0x5bea60[_0x26d263];return _0x48593c;}export function compressContextBudget(_0xb1e7ba,_0x42bdff){const _0x2eda2d=_0x4859,_0x3daaa5=Math[_0x2eda2d(0xfc)](_0x42bdff/Math['max'](_0xb1e7ba[_0x2eda2d(0xfa)],0x1));return _0xb1e7ba[_0x2eda2d(0xff)](({label:_0x5c417b,text:_0x560039})=>({'label':_0x5c417b,'result':compressContext(_0x560039,_0x3daaa5)}));}
1
+ function _0x1300(){const _0x49cb75=['246120qAzAZE','83238phprBO','8033LOfyFk','369960lpbIFf','knWYk','8HmSMed','map','ebFwM','split','576225IElGEH','YFsOu','28ljwyGC','jFKDB','eRuxg','floor','1663974wRzOkh','58buboij','5634450zXBsqx'];_0x1300=function(){return _0x49cb75;};return _0x1300();}(function(_0x18c6a6,_0x29fbbb){const _0x2a6706=_0x2db0,_0xbc28f=_0x18c6a6();while(!![]){try{const _0x1ef033=parseInt(_0x2a6706(0x122))/0x1*(parseInt(_0x2a6706(0x11e))/0x2)+parseInt(_0x2a6706(0x129))/0x3+parseInt(_0x2a6706(0x123))/0x4+-parseInt(_0x2a6706(0x120))/0x5+parseInt(_0x2a6706(0x121))/0x6*(parseInt(_0x2a6706(0x12b))/0x7)+parseInt(_0x2a6706(0x125))/0x8*(parseInt(_0x2a6706(0x11d))/0x9)+-parseInt(_0x2a6706(0x11f))/0xa;if(_0x1ef033===_0x29fbbb)break;else _0xbc28f['push'](_0xbc28f['shift']());}catch(_0x4f8894){_0xbc28f['push'](_0xbc28f['shift']());}}}(_0x1300,0x2374f));import{countTokens}from'../shared/token-counter.js';export function compressContext(_0x55ed8a,_0xd12028){const _0x41c54e=_0x2db0,_0x102456={'plCNP':function(_0x4e6468,_0xbe066e){return _0x4e6468<=_0xbe066e;},'Gnqmi':function(_0x48312e,_0x534965){return _0x48312e+_0x534965;},'DgJQW':function(_0x4d0d0f,_0x45e7eb){return _0x4d0d0f>_0x45e7eb;},'jFKDB':function(_0x5ac0ee,_0x3bfef3){return _0x5ac0ee>_0x3bfef3;},'sUFiN':function(_0x254f09,_0x83f35c){return _0x254f09(_0x83f35c);},'JqiCI':function(_0xe01b3e,_0xfa5f64){return _0xe01b3e+_0xfa5f64;},'YFsOu':function(_0x58981c,_0x40bae3){return _0x58981c+_0x40bae3;},'EZBlA':'\x20→\x20','eRuxg':'\x20Token]','knWYk':function(_0xd57a22,_0x4b5746){return _0xd57a22(_0x4b5746);}};if(!_0x55ed8a)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x3e63a4=countTokens(_0x55ed8a);if(_0x102456['plCNP'](_0x3e63a4,_0xd12028))return{'text':_0x55ed8a,'originalTokens':_0x3e63a4,'compressedTokens':_0x3e63a4,'wasTruncated':!0x1};const _0x352ee0=_0x55ed8a['split']('\x0a\x0a');let _0x270d19='',_0x28e3da=0x0;for(const _0x57f0ed of _0x352ee0){const _0x10ca4a=_0x270d19?_0x102456['Gnqmi'](_0x270d19+'\x0a\x0a',_0x57f0ed):_0x57f0ed,_0x1a4796=countTokens(_0x10ca4a);if(_0x1a4796>_0xd12028)break;_0x270d19=_0x10ca4a,_0x28e3da=_0x1a4796;}if(!_0x270d19&&_0x102456['DgJQW'](_0x352ee0['length'],0x0)){const _0x1c1086=_0x352ee0[0x0][_0x41c54e(0x128)](/\s+/);let _0x7a6f1e='';for(const _0x1a259c of _0x1c1086){const _0x366e73=_0x7a6f1e?_0x7a6f1e+'\x20'+_0x1a259c:_0x1a259c;if(_0x102456[_0x41c54e(0x11a)](countTokens(_0x366e73),_0xd12028-0x5))break;_0x7a6f1e=_0x366e73;}_0x270d19=_0x7a6f1e,_0x28e3da=_0x102456['sUFiN'](countTokens,_0x270d19);}const _0x36de16=_0x102456['JqiCI'](_0x102456[_0x41c54e(0x12a)](_0x102456['Gnqmi'](_0x270d19,'\x0a\x0a[...\x20gekuerzt,\x20'),_0x3e63a4)+_0x102456['EZBlA']+_0x28e3da,_0x102456[_0x41c54e(0x11b)]);return{'text':_0x36de16,'originalTokens':_0x3e63a4,'compressedTokens':_0x102456[_0x41c54e(0x124)](countTokens,_0x36de16),'wasTruncated':!0x0};}function _0x2db0(_0x52fde1,_0x5bd573){_0x52fde1=_0x52fde1-0x11a;const _0x13001e=_0x1300();let _0x2db0aa=_0x13001e[_0x52fde1];return _0x2db0aa;}export function compressContextBudget(_0x523868,_0x2787af){const _0x4f9a1a=_0x2db0,_0x934589={'ebFwM':function(_0x5384da,_0x519510){return _0x5384da/_0x519510;}},_0x479fb2=Math[_0x4f9a1a(0x11c)](_0x934589[_0x4f9a1a(0x127)](_0x2787af,Math['max'](_0x523868['length'],0x1)));return _0x523868[_0x4f9a1a(0x126)](({label:_0x53eb79,text:_0x4d1e41})=>({'label':_0x53eb79,'result':compressContext(_0x4d1e41,_0x479fb2)}));}
@@ -1 +1 @@
1
- function _0x19db(_0x203663,_0x55dec5){_0x203663=_0x203663-0x9c;const _0x27c1fa=_0x27c1();let _0x19db79=_0x27c1fa[_0x203663];return _0x19db79;}const _0x39b3e6=_0x19db;(function(_0x2bd295,_0x5a9041){const _0x5805a3=_0x19db,_0x566cc0=_0x2bd295();while(!![]){try{const _0x1200c9=parseInt(_0x5805a3(0xa7))/0x1*(-parseInt(_0x5805a3(0xa6))/0x2)+parseInt(_0x5805a3(0xad))/0x3*(-parseInt(_0x5805a3(0xba))/0x4)+-parseInt(_0x5805a3(0xa0))/0x5+parseInt(_0x5805a3(0xb9))/0x6*(parseInt(_0x5805a3(0xbe))/0x7)+parseInt(_0x5805a3(0x9f))/0x8*(parseInt(_0x5805a3(0xbc))/0x9)+parseInt(_0x5805a3(0xa1))/0xa*(parseInt(_0x5805a3(0x9d))/0xb)+parseInt(_0x5805a3(0xab))/0xc;if(_0x1200c9===_0x5a9041)break;else _0x566cc0['push'](_0x566cc0['shift']());}catch(_0x2c48e6){_0x566cc0['push'](_0x566cc0['shift']());}}}(_0x27c1,0x6b05e));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';function _0x27c1(){const _0x6e2d5b=['15wzmVPK','collector','now','session-','18806040hrefnX','xJqnZ','9ZMToyC','getSummary','totalCompressedTokens','RhuHK','hook_event_name','compress_above','flush','urpPU','trigger','user','handleSessionStop','match','582FQecLA','710392XuDvvh','\x20Token)','9nxCsUJ','engine','51303LDpQEg','length','join','max_injected_tokens','JdvYJ','push','63844xqlBzT','limits','335152cuLzaQ','3512340yhmMZq','290unXfCE','summary_only','record','prompt','getSessionSummary','108622rMuhZP'];_0x27c1=function(){return _0x6e2d5b;};return _0x27c1();}import{compressContext}from'./context-compressor.js';import{prioritizeContext}from'./precompact-handler.js';import{countTokens}from'../shared/token-counter.js';export class HookDispatcher{[_0x39b3e6(0xbd)];[_0x39b3e6(0xa8)];['projectRoot'];constructor(_0x4ab733,_0x1244e1,_0x3aafe1){const _0x153c81=_0x39b3e6;this['engine']=new RuleEngine(_0x4ab733),this['projectRoot']=_0x1244e1,this[_0x153c81(0xa8)]=new MetricsCollector(_0x1244e1,_0x3aafe1||_0x153c81(0xaa)+Date[_0x153c81(0xa9)]());}['handleUserPromptSubmit'](_0x2a9f60){const _0x13c9b2=_0x39b3e6,_0x3d1a0b={'xxJzU':function(_0x1e62a7,_0x315749){return _0x1e62a7===_0x315749;},'JdvYJ':function(_0xf04b23,_0x3b3ed2,_0x3f1254){return _0xf04b23(_0x3b3ed2,_0x3f1254);},'urpPU':function(_0x389cba,_0x53246b){return _0x389cba(_0x53246b);},'xJqnZ':function(_0x5a801b,_0x4888d7){return _0x5a801b+_0x4888d7;}},_0x4a0b36=_0x2a9f60['prompt']||'',_0x4a4d9a=this[_0x13c9b2(0xbd)][_0x13c9b2(0xb8)](_0x4a0b36);if(_0x3d1a0b['xxJzU'](0x0,_0x4a4d9a['length'])){const _0x3c2661=countTokens(_0x4a0b36);return this['collector']['record']({'hook_event':_0x2a9f60[_0x13c9b2(0xb1)],'baseline_tokens':_0x3c2661,'optimized_tokens':_0x3c2661,'rule_matched':null}),{};}const _0x41d1ea=[],_0x49233b=[];for(const _0x5c37b8 of _0x4a4d9a)_0x49233b[_0x13c9b2(0x9c)](_0x5c37b8[_0x13c9b2(0xb5)][0x0]),_0x5c37b8[_0x13c9b2(0xa2)]?_0x41d1ea[_0x13c9b2(0x9c)]('['+_0x5c37b8['trigger'][0x0]+']\x20Fuer\x20Details:\x20'+_0x5c37b8['load']+'\x20laden.'):_0x41d1ea[_0x13c9b2(0x9c)]('['+_0x5c37b8[_0x13c9b2(0xb5)][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x5c37b8['load']+'\x20(max\x20'+(_0x5c37b8['max_tokens']||this[_0x13c9b2(0xbd)][_0x13c9b2(0x9e)]['max_file_tokens'])+_0x13c9b2(0xbb));let _0x44b8eb=_0x41d1ea[_0x13c9b2(0xc0)]('\x0a');const _0x182385=this['engine']['limits'][_0x13c9b2(0xb2)];_0x182385>0x0&&(_0x44b8eb=_0x3d1a0b[_0x13c9b2(0xc2)](compressContext,_0x44b8eb,_0x182385)['text']);const _0xafef30=_0x3d1a0b[_0x13c9b2(0xb4)](countTokens,_0x4a0b36),_0xbda98a=countTokens(_0x44b8eb),_0x24ebfa=_0xafef30+this[_0x13c9b2(0xbd)]['limits'][_0x13c9b2(0xc1)],_0x5d2c62=_0x3d1a0b[_0x13c9b2(0xac)](_0xafef30,Math['min'](_0xbda98a,this['engine'][_0x13c9b2(0x9e)]['max_injected_tokens']));return this['collector'][_0x13c9b2(0xa3)]({'hook_event':_0x2a9f60[_0x13c9b2(0xb1)],'baseline_tokens':_0x24ebfa,'optimized_tokens':_0x5d2c62,'rule_matched':_0x49233b[_0x13c9b2(0xc0)]('+')}),{'additionalContext':_0x44b8eb};}['handlePreCompact'](_0x12f1b3){const _0x38e6c1=_0x39b3e6,_0x1c3e25={'RhuHK':_0x38e6c1(0xb6)},_0x120e3f=[];if(_0x12f1b3[_0x38e6c1(0xa4)]&&_0x120e3f['push']({'role':_0x1c3e25[_0x38e6c1(0xb0)],'content':_0x12f1b3['prompt'],'turnIndex':0x0}),0x0===_0x120e3f[_0x38e6c1(0xbf)])return{};const _0x4c6442=prioritizeContext(_0x120e3f,this['engine']['limits']),_0x298644=_0x4c6442['prioritized']['map'](_0xf85578=>_0xf85578['content'])['join']('\x0a\x0a');return this['collector'][_0x38e6c1(0xa3)]({'hook_event':_0x12f1b3['hook_event_name'],'baseline_tokens':_0x4c6442['totalOriginalTokens'],'optimized_tokens':_0x4c6442[_0x38e6c1(0xaf)],'rule_matched':null}),{'additionalContext':_0x298644};}[_0x39b3e6(0xb7)](){const _0x55a873=_0x39b3e6;return this[_0x55a873(0xa8)][_0x55a873(0xb3)](),this[_0x55a873(0xa8)][_0x55a873(0xae)]();}[_0x39b3e6(0xa5)](){const _0x47123b=_0x39b3e6;return this[_0x47123b(0xa8)]['getSummary']();}}
1
+ const _0x55d095=_0x2602;function _0x3133(){const _0x414fef=['text','mOxEx','join','4592tPYkya','record','\x20laden.','6987075vubLiu','collector','288940DIspPZ','push','prompt','limits','projectRoot','max_file_tokens','engine','222WYfhwd','user','hook_event_name','82612pVCSQD','length','min','QiWYi','1289866CbaciY','708fgEuBS','now','max_injected_tokens','getSessionSummary','load','11151864ircQtC','content','handlePreCompact','7262019EmgIzI'];_0x3133=function(){return _0x414fef;};return _0x3133();}(function(_0x2bed0f,_0x1dae52){const _0x381ad8=_0x2602,_0xa08133=_0x2bed0f();while(!![]){try{const _0x4d29c2=parseInt(_0x381ad8(0xbe))/0x1+parseInt(_0x381ad8(0xb0))/0x2+parseInt(_0x381ad8(0xb7))/0x3*(-parseInt(_0x381ad8(0xba))/0x4)+-parseInt(_0x381ad8(0xae))/0x5+-parseInt(_0x381ad8(0xbf))/0x6*(-parseInt(_0x381ad8(0xab))/0x7)+parseInt(_0x381ad8(0xa4))/0x8+parseInt(_0x381ad8(0xa7))/0x9;if(_0x4d29c2===_0x1dae52)break;else _0xa08133['push'](_0xa08133['shift']());}catch(_0x410cb5){_0xa08133['push'](_0xa08133['shift']());}}}(_0x3133,0xc01c1));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';import{compressContext}from'./context-compressor.js';function _0x2602(_0x470d61,_0x4c98b9){_0x470d61=_0x470d61-0xa1;const _0x3133c9=_0x3133();let _0x2602ba=_0x3133c9[_0x470d61];return _0x2602ba;}import{prioritizeContext}from'./precompact-handler.js';import{countTokens}from'../shared/token-counter.js';export class HookDispatcher{['engine'];[_0x55d095(0xaf)];[_0x55d095(0xb4)];constructor(_0xb56715,_0x2873c0,_0x437a35){const _0x1af629=_0x55d095;this[_0x1af629(0xb6)]=new RuleEngine(_0xb56715),this['projectRoot']=_0x2873c0,this['collector']=new MetricsCollector(_0x2873c0,_0x437a35||'session-'+Date[_0x1af629(0xc0)]());}['handleUserPromptSubmit'](_0x7963e){const _0xbf38bf=_0x55d095,_0x10e71e={'CMTtT':function(_0x4d0ad9,_0x16a42f){return _0x4d0ad9===_0x16a42f;},'tVReL':function(_0x4119db,_0x26b203){return _0x4119db(_0x26b203);},'mOxEx':function(_0x2c5933,_0x1d4720){return _0x2c5933+_0x1d4720;}},_0x25f38c=_0x7963e[_0xbf38bf(0xb2)]||'',_0x183dc4=this['engine']['match'](_0x25f38c);if(_0x10e71e['CMTtT'](0x0,_0x183dc4[_0xbf38bf(0xbb)])){const _0x69b07=_0x10e71e['tVReL'](countTokens,_0x25f38c);return this[_0xbf38bf(0xaf)]['record']({'hook_event':_0x7963e['hook_event_name'],'baseline_tokens':_0x69b07,'optimized_tokens':_0x69b07,'rule_matched':null}),{};}const _0x4cab3e=[],_0x364b6c=[];for(const _0x2bdfe4 of _0x183dc4)_0x364b6c[_0xbf38bf(0xb1)](_0x2bdfe4['trigger'][0x0]),_0x2bdfe4['summary_only']?_0x4cab3e[_0xbf38bf(0xb1)]('['+_0x2bdfe4['trigger'][0x0]+']\x20Fuer\x20Details:\x20'+_0x2bdfe4[_0xbf38bf(0xa3)]+_0xbf38bf(0xad)):_0x4cab3e[_0xbf38bf(0xb1)]('['+_0x2bdfe4['trigger'][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x2bdfe4['load']+'\x20(max\x20'+(_0x2bdfe4['max_tokens']||this[_0xbf38bf(0xb6)][_0xbf38bf(0xb3)][_0xbf38bf(0xb5)])+'\x20Token)');let _0x2f456d=_0x4cab3e[_0xbf38bf(0xaa)]('\x0a');const _0x10cb1f=this['engine'][_0xbf38bf(0xb3)]['compress_above'];_0x10cb1f>0x0&&(_0x2f456d=compressContext(_0x2f456d,_0x10cb1f)[_0xbf38bf(0xa8)]);const _0x19ea5f=countTokens(_0x25f38c),_0x333c20=countTokens(_0x2f456d),_0x457c20=_0x10e71e['mOxEx'](_0x19ea5f,this['engine']['limits']['max_injected_tokens']),_0x57a1d4=_0x10e71e[_0xbf38bf(0xa9)](_0x19ea5f,Math[_0xbf38bf(0xbc)](_0x333c20,this['engine']['limits'][_0xbf38bf(0xa1)]));return this['collector']['record']({'hook_event':_0x7963e['hook_event_name'],'baseline_tokens':_0x457c20,'optimized_tokens':_0x57a1d4,'rule_matched':_0x364b6c[_0xbf38bf(0xaa)]('+')}),{'additionalContext':_0x2f456d};}[_0x55d095(0xa6)](_0x1f4360){const _0x1ad578=_0x55d095,_0x599484={'QiWYi':function(_0x3bbf58,_0x5d9121,_0x55a3d6){return _0x3bbf58(_0x5d9121,_0x55a3d6);}},_0x2d8b8a=[];if(_0x1f4360[_0x1ad578(0xb2)]&&_0x2d8b8a[_0x1ad578(0xb1)]({'role':_0x1ad578(0xb8),'content':_0x1f4360[_0x1ad578(0xb2)],'turnIndex':0x0}),0x0===_0x2d8b8a['length'])return{};const _0x4f218f=_0x599484[_0x1ad578(0xbd)](prioritizeContext,_0x2d8b8a,this['engine'][_0x1ad578(0xb3)]),_0x594b12=_0x4f218f['prioritized']['map'](_0x2ed017=>_0x2ed017[_0x1ad578(0xa5)])[_0x1ad578(0xaa)]('\x0a\x0a');return this[_0x1ad578(0xaf)][_0x1ad578(0xac)]({'hook_event':_0x1f4360[_0x1ad578(0xb9)],'baseline_tokens':_0x4f218f['totalOriginalTokens'],'optimized_tokens':_0x4f218f['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x594b12};}['handleSessionStop'](){const _0x157f22=_0x55d095;return this[_0x157f22(0xaf)]['flush'](),this['collector']['getSummary']();}[_0x55d095(0xa2)](){const _0x4f7507=_0x55d095;return this[_0x4f7507(0xaf)]['getSummary']();}}
@@ -1 +1 @@
1
- const _0x3710d=_0x9e6e;(function(_0x15f308,_0x39e740){const _0x5be63d=_0x9e6e,_0x2aa8a4=_0x15f308();while(!![]){try{const _0x4678cf=parseInt(_0x5be63d(0x88))/0x1*(parseInt(_0x5be63d(0x7b))/0x2)+parseInt(_0x5be63d(0x7d))/0x3+-parseInt(_0x5be63d(0x7f))/0x4+parseInt(_0x5be63d(0x80))/0x5*(parseInt(_0x5be63d(0x82))/0x6)+parseInt(_0x5be63d(0x7e))/0x7*(parseInt(_0x5be63d(0x8b))/0x8)+parseInt(_0x5be63d(0x81))/0x9+-parseInt(_0x5be63d(0x78))/0xa;if(_0x4678cf===_0x39e740)break;else _0x2aa8a4['push'](_0x2aa8a4['shift']());}catch(_0x5ed638){_0x2aa8a4['push'](_0x2aa8a4['shift']());}}}(_0x5de6,0xa1794));export function buildMeterPayload(_0x59d181,_0xe833c0){const _0x4760e4=_0x9e6e,_0x1f25c5={'uiDQp':'Stop'};return{'session_id':_0x59d181['session_id'],'tokens_saved':_0x59d181[_0x4760e4(0x79)],'baseline_tokens':_0x59d181[_0x4760e4(0x7a)],'optimized_tokens':_0x59d181['total_optimized'],'hook_event':_0x1f25c5[_0x4760e4(0x85)],'provider':_0xe833c0['provider'],'model':_0xe833c0['model'],'team_id':_0xe833c0['team_id']??''};}function _0x5de6(){const _0x5d1235=['713344uHJBak','25534210upOWiV','total_delta','total_baseline','779134XNpThw','timeout','1071996NnoCVm','49cSeBvt','369816KVQnLc','624185MNAewz','301761lwXmfM','54nCCzyJ','stringify','send','uiDQp','network_error','http_','3frFLkn','endpoint','iCRhJ'];_0x5de6=function(){return _0x5d1235;};return _0x5de6();}function _0x9e6e(_0xcf92a1,_0xbd5fb7){_0xcf92a1=_0xcf92a1-0x78;const _0x5de6a5=_0x5de6();let _0x9e6e64=_0x5de6a5[_0xcf92a1];return _0x9e6e64;}export class MeteringClient{['endpoint'];constructor(_0x15793a){const _0x102fa8=_0x9e6e;this[_0x102fa8(0x89)]=_0x15793a;}async[_0x3710d(0x84)](_0x5d7c8a){const _0x1e5a72=_0x3710d,_0x5e5f11={'iCRhJ':'no_endpoint','ZlZNP':'POST'};if(!this['endpoint'])return{'sent':!0x1,'reason':_0x5e5f11[_0x1e5a72(0x8a)]};try{const _0x273d26=await fetch(this[_0x1e5a72(0x89)],{'method':_0x5e5f11['ZlZNP'],'headers':{'Content-Type':'application/json','Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON[_0x1e5a72(0x83)](_0x5d7c8a),'signal':AbortSignal[_0x1e5a72(0x7c)](0x1388)});return _0x273d26['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x1e5a72(0x87)+_0x273d26['status']};}catch{return{'sent':!0x1,'reason':_0x1e5a72(0x86)};}}}
1
+ const _0x801554=_0x1d5f;function _0x1d5f(_0x317379,_0xb7f1b7){_0x317379=_0x317379-0x1c4;const _0x3e71de=_0x3e71();let _0x1d5fc6=_0x3e71de[_0x317379];return _0x1d5fc6;}(function(_0x3f96bb,_0x1cc520){const _0x56cdb8=_0x1d5f,_0x4b72d4=_0x3f96bb();while(!![]){try{const _0x17ff98=-parseInt(_0x56cdb8(0x1d3))/0x1+parseInt(_0x56cdb8(0x1cd))/0x2+-parseInt(_0x56cdb8(0x1c7))/0x3+parseInt(_0x56cdb8(0x1cc))/0x4+parseInt(_0x56cdb8(0x1d6))/0x5*(-parseInt(_0x56cdb8(0x1c8))/0x6)+parseInt(_0x56cdb8(0x1ce))/0x7+-parseInt(_0x56cdb8(0x1ca))/0x8*(-parseInt(_0x56cdb8(0x1cf))/0x9);if(_0x17ff98===_0x1cc520)break;else _0x4b72d4['push'](_0x4b72d4['shift']());}catch(_0x1a3d3f){_0x4b72d4['push'](_0x4b72d4['shift']());}}}(_0x3e71,0xb63a1));export function buildMeterPayload(_0x15ee37,_0x58e505){const _0x4dfccb=_0x1d5f;return{'session_id':_0x15ee37['session_id'],'tokens_saved':_0x15ee37[_0x4dfccb(0x1c5)],'baseline_tokens':_0x15ee37['total_baseline'],'optimized_tokens':_0x15ee37[_0x4dfccb(0x1d7)],'hook_event':'Stop','provider':_0x58e505[_0x4dfccb(0x1c9)],'model':_0x58e505[_0x4dfccb(0x1d9)],'team_id':_0x58e505['team_id']??''};}function _0x3e71(){const _0x106060=['no_endpoint','zuSGa','616123jqOWeD','send','http_','83200pwyPKB','total_optimized','timeout','model','status','application/json','total_delta','Yecha','4473453OUTmlz','450pxlcNx','provider','160SWDAWS','network_error','1954232fYBdGP','771902RrHCCy','5362042afqHqK','1107522gqYlWB','endpoint'];_0x3e71=function(){return _0x106060;};return _0x3e71();}export class MeteringClient{['endpoint'];constructor(_0x70d3e8){this['endpoint']=_0x70d3e8;}async[_0x801554(0x1d4)](_0x549e9d){const _0x5532ef=_0x801554,_0x29c51e={'MfKaz':function(_0x91b11f,_0x36ebcf,_0x3d2861){return _0x91b11f(_0x36ebcf,_0x3d2861);},'zuSGa':_0x5532ef(0x1c4),'Yecha':_0x5532ef(0x1cb)};if(!this['endpoint'])return{'sent':!0x1,'reason':_0x5532ef(0x1d1)};try{const _0x275307=await _0x29c51e['MfKaz'](fetch,this[_0x5532ef(0x1d0)],{'method':'POST','headers':{'Content-Type':_0x29c51e[_0x5532ef(0x1d2)],'Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON['stringify'](_0x549e9d),'signal':AbortSignal[_0x5532ef(0x1d8)](0x1388)});return _0x275307['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x5532ef(0x1d5)+_0x275307[_0x5532ef(0x1da)]};}catch{return{'sent':!0x1,'reason':_0x29c51e[_0x5532ef(0x1c6)]};}}}
@@ -1 +1 @@
1
- const _0x153857=_0x19b3;(function(_0x4a07ce,_0x5bdc81){const _0x22d43e=_0x19b3,_0x2b6bb4=_0x4a07ce();while(!![]){try{const _0x1728d2=parseInt(_0x22d43e(0x80))/0x1*(-parseInt(_0x22d43e(0x8f))/0x2)+-parseInt(_0x22d43e(0x91))/0x3+-parseInt(_0x22d43e(0x7d))/0x4+parseInt(_0x22d43e(0x86))/0x5*(-parseInt(_0x22d43e(0x79))/0x6)+-parseInt(_0x22d43e(0x81))/0x7*(-parseInt(_0x22d43e(0x8e))/0x8)+-parseInt(_0x22d43e(0x85))/0x9+parseInt(_0x22d43e(0x78))/0xa*(parseInt(_0x22d43e(0x90))/0xb);if(_0x1728d2===_0x5bdc81)break;else _0x2b6bb4['push'](_0x2b6bb4['shift']());}catch(_0xb7e2f8){_0x2b6bb4['push'](_0x2b6bb4['shift']());}}}(_0x2dac,0x5e154));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';function _0x2dac(){const _0x440319=['startedAt','IZucY','3724389YxFZdG','5Ustxcw','length','metrics','projectRoot','hxdOk','push','sessionId','toISOString','24384MqoWcD','6362uwmgUV','22403623jyHPAK','240975HFRaUH','.json','flush','10SJTJwa','1376478ctcoKn','.tokenizer-speedup','gnvcE','rule_matched','1072380VCmoYE','DoDSK','getMetrics','239bigJUF','231ACQODw','optimized_tokens'];_0x2dac=function(){return _0x440319;};return _0x2dac();}const METRICS_DIR=_0x153857(0x7a);function _0x19b3(_0x16b7f2,_0x31bcce){_0x16b7f2=_0x16b7f2-0x77;const _0x2dac03=_0x2dac();let _0x19b3ef=_0x2dac03[_0x16b7f2];return _0x19b3ef;}export class MetricsCollector{[_0x153857(0x88)]=[];[_0x153857(0x8c)];['projectRoot'];[_0x153857(0x83)];constructor(_0x43a617,_0x5e83eb){const _0x4e7e96=_0x153857;this[_0x4e7e96(0x89)]=_0x43a617,this['sessionId']=_0x5e83eb,this['startedAt']=new Date()['toISOString']();}['record'](_0x2195e4){const _0x43818a=_0x153857;this['metrics'][_0x43818a(0x8b)]({'session_id':this['sessionId'],'timestamp':new Date()[_0x43818a(0x8d)](),'hook_event':_0x2195e4['hook_event'],'baseline_tokens':_0x2195e4['baseline_tokens'],'optimized_tokens':_0x2195e4[_0x43818a(0x82)],'delta':_0x2195e4['baseline_tokens']-_0x2195e4[_0x43818a(0x82)],'rule_matched':_0x2195e4['rule_matched']});}[_0x153857(0x7f)](){return[...this['metrics']];}['getSummary'](){const _0x58bd75=_0x153857,_0x414ade={'hxdOk':function(_0x30b043,_0x3ffa4f){return _0x30b043+_0x3ffa4f;},'QuTyP':function(_0x2eedd3,_0x5dc267){return _0x2eedd3>_0x5dc267;}},_0x258aa0=this[_0x58bd75(0x88)]['reduce']((_0x58da2f,_0x4bef9a)=>_0x58da2f+_0x4bef9a['baseline_tokens'],0x0),_0x4c2913=this[_0x58bd75(0x88)]['reduce']((_0x406a55,_0x197372)=>_0x406a55+_0x197372['optimized_tokens'],0x0),_0x4043d0=_0x258aa0-_0x4c2913,_0x31d239={};for(const _0xf2c44f of this[_0x58bd75(0x88)])_0xf2c44f['rule_matched']&&(_0x31d239[_0xf2c44f[_0x58bd75(0x7c)]]=_0x414ade[_0x58bd75(0x8a)](_0x31d239[_0xf2c44f[_0x58bd75(0x7c)]]||0x0,0x1));return{'session_id':this[_0x58bd75(0x8c)],'started_at':this[_0x58bd75(0x83)],'ended_at':new Date()['toISOString'](),'total_baseline':_0x258aa0,'total_optimized':_0x4c2913,'total_delta':_0x4043d0,'savings_percent':_0x414ade['QuTyP'](_0x258aa0,0x0)?_0x4043d0/_0x258aa0*0x64:0x0,'prompts_count':this[_0x58bd75(0x88)][_0x58bd75(0x87)],'rules_triggered':_0x31d239};}[_0x153857(0x77)](){const _0x1a562d=_0x153857,_0x57f6c1={'DoDSK':function(_0x379075,_0x37b4d7,_0x499e36){return _0x379075(_0x37b4d7,_0x499e36);},'gnvcE':function(_0x21e55a,_0x3d58a3,_0x32be42,_0x102ff0){return _0x21e55a(_0x3d58a3,_0x32be42,_0x102ff0);},'IZucY':'utf-8'},_0x172e36=join(this['projectRoot'],METRICS_DIR);_0x57f6c1[_0x1a562d(0x7e)](mkdirSync,_0x172e36,{'recursive':!0x0});const _0x1a7dc6={'metrics':this['metrics'],'summary':this['getSummary']()};_0x57f6c1[_0x1a562d(0x7b)](writeFileSync,join(_0x172e36,this['sessionId']+_0x1a562d(0x92)),JSON['stringify'](_0x1a7dc6,null,0x2),_0x57f6c1[_0x1a562d(0x84)]);}}
1
+ function _0x4aac(_0x513fb2,_0x5d5c81){_0x513fb2=_0x513fb2-0x93;const _0x4a361b=_0x4a36();let _0x4aacd2=_0x4a361b[_0x513fb2];return _0x4aacd2;}const _0xfbb764=_0x4aac;(function(_0x4669f3,_0x1b1d36){const _0x4de77a=_0x4aac,_0x35b38d=_0x4669f3();while(!![]){try{const _0xa28a5e=-parseInt(_0x4de77a(0xa5))/0x1*(-parseInt(_0x4de77a(0x9a))/0x2)+parseInt(_0x4de77a(0x98))/0x3*(parseInt(_0x4de77a(0xa9))/0x4)+-parseInt(_0x4de77a(0x99))/0x5+-parseInt(_0x4de77a(0xab))/0x6*(-parseInt(_0x4de77a(0xa4))/0x7)+-parseInt(_0x4de77a(0x97))/0x8*(-parseInt(_0x4de77a(0xa6))/0x9)+-parseInt(_0x4de77a(0xa1))/0xa*(parseInt(_0x4de77a(0xae))/0xb)+-parseInt(_0x4de77a(0x9c))/0xc*(parseInt(_0x4de77a(0x95))/0xd);if(_0xa28a5e===_0x1b1d36)break;else _0x35b38d['push'](_0x35b38d['shift']());}catch(_0x3a4041){_0x35b38d['push'](_0x35b38d['shift']());}}}(_0x4a36,0x5abf8));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';function _0x4a36(){const _0x437f21=['11YbPcAP','baseline_tokens','utf-8','stringify','reduce','1651wDsZln','startedAt','8TwwGRs','3JalYAg','1462525hEmLHW','949174fesQQn','record','51708LdwMTS','optimized_tokens','hook_event','oJfcq','flush','214190PWQpZe','metrics','rule_matched','710381ojFOCm','1gdmoDd','4421961Neoxkj','lkyBr','length','661888aeXDVe','sessionId','6abbhft','projectRoot','push'];_0x4a36=function(){return _0x437f21;};return _0x4a36();}const METRICS_DIR='.tokenizer-speedup';export class MetricsCollector{['metrics']=[];[_0xfbb764(0xaa)];['projectRoot'];[_0xfbb764(0x96)];constructor(_0x5e68ed,_0x4192b8){const _0x46fa50=_0xfbb764;this[_0x46fa50(0xac)]=_0x5e68ed,this[_0x46fa50(0xaa)]=_0x4192b8,this[_0x46fa50(0x96)]=new Date()['toISOString']();}[_0xfbb764(0x9b)](_0x45a01e){const _0x2912cc=_0xfbb764;this['metrics'][_0x2912cc(0xad)]({'session_id':this[_0x2912cc(0xaa)],'timestamp':new Date()['toISOString'](),'hook_event':_0x45a01e[_0x2912cc(0x9e)],'baseline_tokens':_0x45a01e['baseline_tokens'],'optimized_tokens':_0x45a01e[_0x2912cc(0x9d)],'delta':_0x45a01e['baseline_tokens']-_0x45a01e['optimized_tokens'],'rule_matched':_0x45a01e[_0x2912cc(0xa3)]});}['getMetrics'](){return[...this['metrics']];}['getSummary'](){const _0x55c40b=_0xfbb764,_0x14deb7={'oJfcq':function(_0x2b5ef1,_0x472921){return _0x2b5ef1+_0x472921;},'lkyBr':function(_0x3fc7bc,_0x228b2c){return _0x3fc7bc*_0x228b2c;},'FNGIe':function(_0x1ed7b9,_0x4378a0){return _0x1ed7b9/_0x4378a0;}},_0x199bac=this[_0x55c40b(0xa2)][_0x55c40b(0x94)]((_0x4b9983,_0x502e98)=>_0x4b9983+_0x502e98[_0x55c40b(0xaf)],0x0),_0x49d8dd=this[_0x55c40b(0xa2)][_0x55c40b(0x94)]((_0x211773,_0x4f55a8)=>_0x211773+_0x4f55a8['optimized_tokens'],0x0),_0x5d821e=_0x199bac-_0x49d8dd,_0x49b9bc={};for(const _0x3fb470 of this['metrics'])_0x3fb470['rule_matched']&&(_0x49b9bc[_0x3fb470[_0x55c40b(0xa3)]]=_0x14deb7[_0x55c40b(0x9f)](_0x49b9bc[_0x3fb470[_0x55c40b(0xa3)]]||0x0,0x1));return{'session_id':this[_0x55c40b(0xaa)],'started_at':this[_0x55c40b(0x96)],'ended_at':new Date()['toISOString'](),'total_baseline':_0x199bac,'total_optimized':_0x49d8dd,'total_delta':_0x5d821e,'savings_percent':_0x199bac>0x0?_0x14deb7[_0x55c40b(0xa7)](_0x14deb7['FNGIe'](_0x5d821e,_0x199bac),0x64):0x0,'prompts_count':this[_0x55c40b(0xa2)][_0x55c40b(0xa8)],'rules_triggered':_0x49b9bc};}[_0xfbb764(0xa0)](){const _0x4de828=_0xfbb764,_0xd264a={'setBQ':function(_0x11eba0,_0xac0670,_0xd1c156){return _0x11eba0(_0xac0670,_0xd1c156);}},_0x270b33=join(this['projectRoot'],METRICS_DIR);_0xd264a['setBQ'](mkdirSync,_0x270b33,{'recursive':!0x0});const _0x5507f8={'metrics':this['metrics'],'summary':this['getSummary']()};writeFileSync(join(_0x270b33,this['sessionId']+'.json'),JSON[_0x4de828(0x93)](_0x5507f8,null,0x2),_0x4de828(0xb0));}}