@simosphere/tokenizer-speedup 0.8.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/README-plugin.md +17 -1
  3. package/README.de.md +41 -1
  4. package/README.md +41 -1
  5. package/dist/cli/analyze.js +1 -1
  6. package/dist/cli/config-cmd.js +1 -1
  7. package/dist/cli/index.js +1 -1
  8. package/dist/cli/init-cmd.js +1 -1
  9. package/dist/cli/setup-cmd.js +1 -1
  10. package/dist/cloud/stripe-checkout.js +1 -1
  11. package/dist/cloud/stripe-config.js +1 -1
  12. package/dist/cloud/stripe-usage.js +1 -1
  13. package/dist/cloud/stripe-webhooks.js +1 -1
  14. package/dist/cloud/subscription-store.js +1 -1
  15. package/dist/manifest.json +37 -37
  16. package/dist/mcp/index.js +1 -1
  17. package/dist/mcp/resources.js +1 -1
  18. package/dist/mcp/session.js +1 -1
  19. package/dist/mcp/tools.js +1 -1
  20. package/dist/plugin/cli.js +1 -1
  21. package/dist/plugin/config-loader.js +1 -1
  22. package/dist/plugin/context-compressor.js +1 -1
  23. package/dist/plugin/hook-dispatcher.js +1 -1
  24. package/dist/plugin/metering-client.js +1 -1
  25. package/dist/plugin/metrics-collector.js +1 -1
  26. package/dist/plugin/onboarding.js +1 -1
  27. package/dist/plugin/precompact-handler.js +1 -1
  28. package/dist/plugin/report.js +1 -1
  29. package/dist/plugin/rule-analytics-store.js +1 -1
  30. package/dist/plugin/rule-analytics.js +1 -1
  31. package/dist/plugin/rule-engine.js +1 -1
  32. package/dist/plugin/rule-sharing.js +1 -1
  33. package/dist/plugin/rule-suggest.js +1 -1
  34. package/dist/plugin/session-start.js +1 -1
  35. package/dist/plugin/smart-context.js +1 -1
  36. package/dist/shared/license.js +1 -1
  37. package/dist/shared/providers/claude-provider.js +1 -1
  38. package/dist/shared/providers/openai-provider.js +1 -1
  39. package/dist/shared/token-counter.js +1 -1
  40. package/dist/shared/token-provider.js +1 -1
  41. package/package.json +1 -1
@@ -1 +1 @@
1
- const _0x1f7586=_0x2dda;(function(_0x45a5e3,_0x24f6fb){const _0x17fb2e=_0x2dda,_0x1628a1=_0x45a5e3();while(!![]){try{const _0x530e05=parseInt(_0x17fb2e(0x14c))/0x1*(-parseInt(_0x17fb2e(0x146))/0x2)+parseInt(_0x17fb2e(0x14f))/0x3*(parseInt(_0x17fb2e(0x153))/0x4)+-parseInt(_0x17fb2e(0x145))/0x5*(parseInt(_0x17fb2e(0x14d))/0x6)+parseInt(_0x17fb2e(0x152))/0x7+parseInt(_0x17fb2e(0x148))/0x8+parseInt(_0x17fb2e(0x14e))/0x9+parseInt(_0x17fb2e(0x14a))/0xa;if(_0x530e05===_0x24f6fb)break;else _0x1628a1['push'](_0x1628a1['shift']());}catch(_0x250972){_0x1628a1['push'](_0x1628a1['shift']());}}}(_0x5dd0,0x6106f));import{loadConfig,DEFAULT_LIMITS,DEFAULT_METERING}from'../plugin/config-loader.js';import{HookDispatcher}from'../plugin/hook-dispatcher.js';import{MetricsCollector}from'../plugin/metrics-collector.js';import{createTokenProvider}from'../shared/token-provider.js';const DEFAULT_CONFIG={'version':0x1,'provider':_0x1f7586(0x154),'model':'claude-sonnet-4-20250514','rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};function _0x2dda(_0x1cbc2a,_0x4793b2){_0x1cbc2a=_0x1cbc2a-0x145;const _0x5dd015=_0x5dd0();let _0x2dda7f=_0x5dd015[_0x1cbc2a];return _0x2dda7f;}function _0x5dd0(){const _0x3db1e4=['1454280mHJAkq','provider','12834nGlkQn','3836766pBaFtb','1990422yoSOCE','183zdWcLE','getConfig','mcp-session-','4126717ZydQdc','49420YLSbny','claude','cwd','5gFfKRa','108bFacoz','ZIGAU','161184adzizP','now'];_0x5dd0=function(){return _0x3db1e4;};return _0x5dd0();}export function createSession(_0x1a063f){const _0x391b88=_0x1f7586,_0x3cab36={'ZIGAU':function(_0x239065,_0x31dccb,_0x725c6f){return _0x239065(_0x31dccb,_0x725c6f);}};let _0x12e6fa=_0x1a063f??process[_0x391b88(0x155)](),_0xd86850=null,_0x552123=null;const _0x13b849=_0x391b88(0x151)+Date[_0x391b88(0x149)]();let _0x5424cc=new MetricsCollector(_0x12e6fa,_0x13b849);const _0x20be5d={get 'projectRoot'(){return _0x12e6fa;},get 'config'(){return _0xd86850;},get 'collector'(){return _0x5424cc;},get 'sessionId'(){return _0x13b849;},'getConfig':()=>(_0xd86850||(_0xd86850=(function(){try{return loadConfig(_0x12e6fa);}catch{return structuredClone(DEFAULT_CONFIG);}}())),_0xd86850),'getDispatcher'(){if(!_0x552123){const _0x6014c4=_0x20be5d['getConfig']();_0x552123=new HookDispatcher(_0x6014c4,_0x12e6fa,_0x13b849);}return _0x552123;},'getTokenProvider'(_0x29b913,_0x460515){const _0x47d33d=_0x391b88,_0x471c9f=_0x20be5d[_0x47d33d(0x150)]();return _0x3cab36[_0x47d33d(0x147)](createTokenProvider,_0x29b913??_0x471c9f[_0x47d33d(0x14b)],_0x460515??_0x471c9f['model']);},'setProjectRoot'(_0x5e0759){_0x12e6fa=_0x5e0759,_0xd86850=null,_0x552123=null,_0x5424cc=new MetricsCollector(_0x12e6fa,_0x13b849);}};return _0x20be5d;}
1
+ const _0x5cb64a=_0x5b88;(function(_0x57bde9,_0x372f82){const _0x403f7c=_0x5b88,_0x5aa177=_0x57bde9();while(!![]){try{const _0x45625c=parseInt(_0x403f7c(0xa4))/0x1*(-parseInt(_0x403f7c(0xaa))/0x2)+-parseInt(_0x403f7c(0xa6))/0x3+-parseInt(_0x403f7c(0xb6))/0x4+parseInt(_0x403f7c(0xaf))/0x5*(parseInt(_0x403f7c(0xa5))/0x6)+-parseInt(_0x403f7c(0xa8))/0x7*(parseInt(_0x403f7c(0xae))/0x8)+-parseInt(_0x403f7c(0xb0))/0x9*(-parseInt(_0x403f7c(0xac))/0xa)+parseInt(_0x403f7c(0xa7))/0xb*(parseInt(_0x403f7c(0xad))/0xc);if(_0x45625c===_0x372f82)break;else _0x5aa177['push'](_0x5aa177['shift']());}catch(_0x9e64e9){_0x5aa177['push'](_0x5aa177['shift']());}}}(_0x239a,0x49cbf));import{loadConfig,DEFAULT_LIMITS,DEFAULT_METERING}from'../plugin/config-loader.js';import{HookDispatcher}from'../plugin/hook-dispatcher.js';import{MetricsCollector}from'../plugin/metrics-collector.js';import{createTokenProvider}from'../shared/token-provider.js';function _0x239a(){const _0x6004b9=['7aWECwc','1592310oZlUvS','856341DSieAJ','33bXpdTM','7iTTebh','now','168218lbQWpP','claude-sonnet-4-20250514','99490IzaPWx','6791688Kfktss','2627368HpuWQz','5GosgEB','9kXBuiy','YXvwJ','claude','model','hqaoM','provider','1873416cdwGkf'];_0x239a=function(){return _0x6004b9;};return _0x239a();}function _0x5b88(_0x2d5a6e,_0xc540ea){_0x2d5a6e=_0x2d5a6e-0xa4;const _0x239a5a=_0x239a();let _0x5b88e5=_0x239a5a[_0x2d5a6e];return _0x5b88e5;}const DEFAULT_CONFIG={'version':0x1,'provider':_0x5cb64a(0xb2),'model':_0x5cb64a(0xab),'rules':[],'context_limits':DEFAULT_LIMITS,'metering':DEFAULT_METERING};export function createSession(_0x56a10a){const _0x4bd2c8=_0x5cb64a,_0x25ab21={'Efnrg':function(_0x43b10d,_0x5e7701){return _0x43b10d(_0x5e7701);},'hqaoM':function(_0x8551df,_0x23e35c){return _0x8551df(_0x23e35c);},'YXvwJ':function(_0x3eed77,_0x4ed86e,_0x3ec95f){return _0x3eed77(_0x4ed86e,_0x3ec95f);}};let _0x12df8d=_0x56a10a??process['cwd'](),_0x5b8f21=null,_0x3f34a2=null;const _0x461af0='mcp-session-'+Date[_0x4bd2c8(0xa9)]();let _0x328190=new MetricsCollector(_0x12df8d,_0x461af0);const _0x5abd5c={get 'projectRoot'(){return _0x12df8d;},get 'config'(){return _0x5b8f21;},get 'collector'(){return _0x328190;},get 'sessionId'(){return _0x461af0;},'getConfig':()=>(_0x5b8f21||(_0x5b8f21=(function(){const _0x24ea8f=_0x4bd2c8;try{return _0x25ab21['Efnrg'](loadConfig,_0x12df8d);}catch{return _0x25ab21[_0x24ea8f(0xb4)](structuredClone,DEFAULT_CONFIG);}}())),_0x5b8f21),'getDispatcher'(){if(!_0x3f34a2){const _0x13989b=_0x5abd5c['getConfig']();_0x3f34a2=new HookDispatcher(_0x13989b,_0x12df8d,_0x461af0);}return _0x3f34a2;},'getTokenProvider'(_0x54ebdd,_0x3f09a7){const _0x4d9495=_0x4bd2c8,_0x2a1756=_0x5abd5c['getConfig']();return _0x25ab21[_0x4d9495(0xb1)](createTokenProvider,_0x54ebdd??_0x2a1756[_0x4d9495(0xb5)],_0x3f09a7??_0x2a1756[_0x4d9495(0xb3)]);},'setProjectRoot'(_0x1c0194){_0x12df8d=_0x1c0194,_0x5b8f21=null,_0x3f34a2=null,_0x328190=new MetricsCollector(_0x12df8d,_0x461af0);}};return _0x5abd5c;}
package/dist/mcp/tools.js CHANGED
@@ -1 +1 @@
1
- (function(_0x30a787,_0x13a2d0){const _0x5c8833=_0x597b,_0xdf8202=_0x30a787();while(!![]){try{const _0x27c627=-parseInt(_0x5c8833(0x110))/0x1*(parseInt(_0x5c8833(0x12b))/0x2)+-parseInt(_0x5c8833(0x13a))/0x3*(parseInt(_0x5c8833(0x133))/0x4)+-parseInt(_0x5c8833(0x137))/0x5+parseInt(_0x5c8833(0x111))/0x6+-parseInt(_0x5c8833(0x139))/0x7*(parseInt(_0x5c8833(0x120))/0x8)+parseInt(_0x5c8833(0x115))/0x9*(parseInt(_0x5c8833(0x135))/0xa)+parseInt(_0x5c8833(0x12a))/0xb;if(_0x27c627===_0x13a2d0)break;else _0xdf8202['push'](_0xdf8202['shift']());}catch(_0x195854){_0xdf8202['push'](_0xdf8202['shift']());}}}(_0x4667,0xca30d));import{readFile}from'node:fs/promises';function _0x597b(_0x3c5c6f,_0x26d945){_0x3c5c6f=_0x3c5c6f-0x108;const _0x466714=_0x4667();let _0x597b6e=_0x466714[_0x3c5c6f];return _0x597b6e;}import{resolve}from'node:path';import{z}from'zod';function _0x4667(){const _0x58c9da=['Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','handleUserPromptSubmit','getSessionSummary','startsWith','16YrHRUb','projectRoot','80EgwdwX','zMlSJ','7916285rjmdVL','iGzhS','7729589vIoqil','590748RgyLAt','uReVR','describe','NHqFt','estimateTokens','file_path\x20escapes\x20project\x20root.','getTokenProvider','text','stringify','getDispatcher','pEKnh','countTokens','setProjectRoot','xbAhm','openai','registerTool','160966HDaRIm','3400974TNLqnA','optimize-context','sessionId','total_delta','97101LgRhMQ','Inline\x20text\x20to\x20analyze','total_baseline','Path\x20to\x20a\x20file\x20to\x20analyze','rules_triggered','kAzWe','provider','epPFo','ksXZL','gpt-4o','get-savings','8DHQSIi','optional','QTQRG','prompts_count','Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','utf-8','string','Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.','getConfig','savings_percent','49005110rxkCbn','10JQtpTe','sHYWP','message','Failed\x20to\x20read\x20file:\x20'];_0x4667=function(){return _0x58c9da;};return _0x4667();}import{countTokens}from'../shared/token-counter.js';export function registerTools(_0x378f56,_0x244b3a){const _0x426e41=_0x597b,_0xcc4961={'QTQRG':'UserPromptSubmit','pEKnh':function(_0x459aef,_0x165a47){return _0x459aef(_0x165a47);},'epPFo':_0x426e41(0x141),'zMlSJ':function(_0x5d382a,_0x228d03){return _0x5d382a===_0x228d03;},'NHqFt':function(_0x54a518,_0x619415){return _0x54a518 instanceof _0x619415;},'iGzhS':function(_0x460aed,_0x2d64d3){return _0x460aed(_0x2d64d3);},'PXHEB':function(_0x476e91,_0x2cf427){return _0x476e91!==_0x2cf427;},'uReVR':function(_0x5cc0e6,_0xd23f7e,_0x1a466b){return _0x5cc0e6(_0xd23f7e,_0x1a466b);},'mhhbu':function(_0x133f60,_0x24362a,_0x2b7e0a){return _0x133f60(_0x24362a,_0x2b7e0a);},'cdptz':_0x426e41(0x125),'xbAhm':function(_0x245e22,_0x3cd9d0){return _0x245e22(_0x3cd9d0);},'ordUT':'BPE\x20tokenizer\x20(accurate)','Gsnoo':'1.4','uMIrF':_0x426e41(0x12f),'sHYWP':'The\x20user\x20prompt\x20to\x20optimize','RZTsm':'analyze-tokens','bUWBh':_0x426e41(0x124),'sXQKu':_0x426e41(0x118),'QEFwT':'LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','ksXZL':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','iNbfQ':_0x426e41(0x11f),'kAzWe':_0x426e41(0x127)};_0x378f56[_0x426e41(0x10f)](_0x426e41(0x112),{'description':_0xcc4961['uMIrF'],'inputSchema':{'prompt':z['string']()[_0x426e41(0x13c)](_0xcc4961[_0x426e41(0x12c)]),'project_path':z['string']()[_0x426e41(0x121)]()[_0x426e41(0x13c)]('Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided')}},async({prompt:_0x4d204e,project_path:_0x1ecc9b})=>{const _0x5214f1=_0x426e41;_0x1ecc9b&&_0x244b3a[_0x5214f1(0x10c)](_0x1ecc9b);const _0x52936e=_0x244b3a['getDispatcher'](),_0x2ed40a=_0x52936e['getSessionSummary'](),_0x2f7d53={'session_id':_0x244b3a[_0x5214f1(0x113)],'cwd':_0x244b3a[_0x5214f1(0x134)],'prompt':_0x4d204e,'hook_event_name':_0xcc4961[_0x5214f1(0x122)]},_0x10c7a=_0x52936e[_0x5214f1(0x130)](_0x2f7d53),_0x5015b0=_0x52936e[_0x5214f1(0x131)]()[_0x5214f1(0x114)]-_0x2ed40a[_0x5214f1(0x114)],_0x1853cb=_0x10c7a['additionalContext']??'',_0x12eab2=_0x1853cb['length']>0x0?_0xcc4961[_0x5214f1(0x10a)](countTokens,_0x1853cb):0x0,_0x46bc63=[..._0x1853cb['matchAll'](/^\[([^\]]+)\]/gm)]['map'](_0x188c54=>_0x188c54[0x1]),_0x4c7f48={'context':_0x1853cb,'rules_matched':_0x46bc63,'tokens_injected':_0x12eab2,'tokens_saved':_0x5015b0};return{'content':[{'type':_0xcc4961[_0x5214f1(0x11c)],'text':JSON['stringify'](_0x4c7f48)}]};}),_0x378f56[_0x426e41(0x10f)](_0xcc4961['RZTsm'],{'description':_0xcc4961['bUWBh'],'inputSchema':{'text':z['string']()['optional']()['describe'](_0x426e41(0x116)),'file_path':z['string']()['optional']()[_0x426e41(0x13c)](_0xcc4961['sXQKu']),'provider':z[_0x426e41(0x126)]()['optional']()['describe'](_0xcc4961['QEFwT']),'model':z[_0x426e41(0x126)]()[_0x426e41(0x121)]()[_0x426e41(0x13c)](_0xcc4961[_0x426e41(0x11d)])}},async({text:_0x31cd0c,file_path:_0x54c89c,provider:_0x909eb0,model:_0x34def5})=>{const _0x529d45=_0x426e41;if(_0xcc4961['zMlSJ'](void 0x0,_0x31cd0c)&&void 0x0===_0x54c89c)return{'content':[{'type':_0xcc4961['epPFo'],'text':JSON[_0x529d45(0x108)]({'error':'Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.'})}],'isError':!0x0};const _0x24a96f=_0x909eb0??_0x244b3a['getConfig']()[_0x529d45(0x11b)],_0x2c661d=_0x34def5??(_0xcc4961[_0x529d45(0x136)](_0x529d45(0x10e),_0x24a96f)?_0x529d45(0x11e):_0x244b3a[_0x529d45(0x128)]()['model']);let _0x49300d,_0x276138;try{_0x49300d=_0x244b3a[_0x529d45(0x140)](_0x24a96f,_0x2c661d);}catch(_0x429dad){const _0x44733a=_0xcc4961[_0x529d45(0x13d)](_0x429dad,Error)?_0x429dad['message']:_0xcc4961[_0x529d45(0x138)](String,_0x429dad);return{'content':[{'type':_0x529d45(0x141),'text':JSON['stringify']({'error':_0x44733a})}],'isError':!0x0};}if(_0xcc4961['PXHEB'](void 0x0,_0x31cd0c))_0x276138=_0x31cd0c;else{const _0xe17e31=_0xcc4961[_0x529d45(0x13b)](resolve,_0x244b3a['projectRoot'],_0x54c89c);if(!_0xe17e31[_0x529d45(0x132)](_0x244b3a[_0x529d45(0x134)]))return{'content':[{'type':'text','text':JSON[_0x529d45(0x108)]({'error':_0x529d45(0x13f)})}],'isError':!0x0};try{_0x276138=await _0xcc4961['mhhbu'](readFile,_0xe17e31,_0xcc4961['cdptz']);}catch(_0xd30b95){const _0x132ccc=_0xd30b95 instanceof Error?_0xd30b95[_0x529d45(0x12d)]:_0xcc4961[_0x529d45(0x10d)](String,_0xd30b95);return{'content':[{'type':_0xcc4961[_0x529d45(0x11c)],'text':JSON['stringify']({'error':_0x529d45(0x12e)+_0x132ccc})}],'isError':!0x0};}}const _0x54995c={'tokens':_0x49300d[_0x529d45(0x10b)](_0x276138),'tokens_method':_0xcc4961['ordUT'],'estimate':_0x49300d[_0x529d45(0x13e)](_0x276138),'estimate_method':'word\x20heuristic\x20(words\x20×\x20'+(_0xcc4961['zMlSJ']('openai',_0x24a96f)?'1.3':_0xcc4961['Gsnoo'])+')','provider':_0x24a96f,'model':_0x2c661d};return{'content':[{'type':'text','text':JSON[_0x529d45(0x108)](_0x54995c)}]};}),_0x378f56[_0x426e41(0x10f)](_0xcc4961['iNbfQ'],{'description':_0xcc4961[_0x426e41(0x11a)]},async()=>{const _0x549634=_0x426e41,_0xf9cdb6=_0x244b3a[_0x549634(0x109)]()[_0x549634(0x131)](),_0xbb2285={'baseline_tokens':_0xf9cdb6[_0x549634(0x117)],'optimized_tokens':_0xf9cdb6['total_optimized'],'saved_tokens':_0xf9cdb6[_0x549634(0x114)],'saved_percent':_0xf9cdb6[_0x549634(0x129)],'prompts_count':_0xf9cdb6[_0x549634(0x123)],'rules_triggered':_0xf9cdb6[_0x549634(0x119)]};return{'content':[{'type':'text','text':JSON['stringify'](_0xbb2285)}]};});}
1
+ function _0x56cc(){const _0x451412=['412447hLXrHc','string','YvLIi','provider','get-savings','Inline\x20text\x20to\x20analyze','registerTool','UserPromptSubmit','startsWith','gViiB','projectRoot','openai','vnRej','Optimize\x20LLM\x20context\x20for\x20a\x20given\x20prompt.\x20Returns\x20matched\x20rules,\x20injected\x20context\x20and\x20token\x20savings.','text','114yzFidS','177420QhvQRM','map','word\x20heuristic\x20(words\x20×\x20','eXHDo','6944896WhsJrB','knVJl','Failed\x20to\x20read\x20file:\x20','2243415uyHDae','stringify','XtlvW','describe','10227FgaHqE','MbOoF','optional','vgWCU','total_baseline','3342IrBeLp','getConfig','getDispatcher','rules_triggered','svcAJ','prompts_count','analyze-tokens','getSessionSummary','Path\x20to\x20a\x20file\x20to\x20analyze','utf-8','message','countTokens','total_delta','matchAll','7152euDkQH','PMaKA','file_path\x20escapes\x20project\x20root.','9508194vXFxNj','1.3'];_0x56cc=function(){return _0x451412;};return _0x56cc();}(function(_0x5aa626,_0x35e89b){const _0x578456=_0x32af,_0x428394=_0x5aa626();while(!![]){try{const _0x382f89=-parseInt(_0x578456(0xd4))/0x1+-parseInt(_0x578456(0xcf))/0x2*(parseInt(_0x578456(0xb0))/0x3)+-parseInt(_0x578456(0xb1))/0x4+parseInt(_0x578456(0xb8))/0x5+-parseInt(_0x578456(0xc1))/0x6*(-parseInt(_0x578456(0xbc))/0x7)+parseInt(_0x578456(0xb5))/0x8+-parseInt(_0x578456(0xd2))/0x9;if(_0x382f89===_0x35e89b)break;else _0x428394['push'](_0x428394['shift']());}catch(_0x306b98){_0x428394['push'](_0x428394['shift']());}}}(_0x56cc,0x75888));import{readFile}from'node:fs/promises';function _0x32af(_0x4027e2,_0x539617){_0x4027e2=_0x4027e2-0xae;const _0x56cc51=_0x56cc();let _0x32afed=_0x56cc51[_0x4027e2];return _0x32afed;}import{resolve,normalize}from'node:path';import{z}from'zod';import{countTokens}from'../shared/token-counter.js';export function registerTools(_0x4f13a1,_0x2cd184){const _0x332e76=_0x32af,_0x35a5ea={'gViiB':function(_0x56b232,_0xb8d734){return _0x56b232-_0xb8d734;},'xHNQn':function(_0x55ed84,_0x370d5b){return _0x55ed84>_0x370d5b;},'PMaKA':'text','znlaB':function(_0x245c96,_0x144adc){return _0x245c96===_0x144adc;},'MbOoF':'Either\x20text\x20or\x20file_path\x20must\x20be\x20provided.','gjkyA':_0x332e76(0xdf),'YvLIi':function(_0x4955a1,_0x17b38b){return _0x4955a1 instanceof _0x17b38b;},'vgWCU':function(_0xa55614,_0x4ff24a){return _0xa55614(_0x4ff24a);},'svcAJ':function(_0x3f7f77,_0x39dac3,_0x26b218){return _0x3f7f77(_0x39dac3,_0x26b218);},'vnRej':function(_0x27b376,_0x349e36,_0x113db3){return _0x27b376(_0x349e36,_0x113db3);},'KAGUG':_0x332e76(0xca),'khSGB':function(_0xb56b0d,_0x2d3315){return _0xb56b0d(_0x2d3315);},'XtlvW':_0x332e76(0xd3),'AiPMj':_0x332e76(0xae),'EAinb':'The\x20user\x20prompt\x20to\x20optimize','ezKWL':'Optional\x20project\x20root\x20path;\x20re-loads\x20config\x20if\x20provided','HglkK':_0x332e76(0xc7),'otuEZ':'Count\x20and\x20estimate\x20tokens\x20for\x20a\x20given\x20text\x20or\x20file.\x20Returns\x20exact\x20BPE\x20count\x20and\x20word-based\x20heuristic\x20estimate.','iFQeJ':_0x332e76(0xd9),'eXHDo':'LLM\x20provider\x20(claude,\x20openai).\x20Defaults\x20to\x20config\x20provider.','knVJl':'Model\x20name.\x20Defaults\x20to\x20config\x20model.','PQjem':_0x332e76(0xd8)};_0x4f13a1['registerTool']('optimize-context',{'description':_0x35a5ea['AiPMj'],'inputSchema':{'prompt':z[_0x332e76(0xd5)]()['describe'](_0x35a5ea['EAinb']),'project_path':z['string']()[_0x332e76(0xbe)]()[_0x332e76(0xbb)](_0x35a5ea['ezKWL'])}},async({prompt:_0x131dd1,project_path:_0x4ab0ed})=>{const _0x581aaa=_0x332e76;_0x4ab0ed&&_0x2cd184['setProjectRoot'](_0x4ab0ed);const _0x226917=_0x2cd184[_0x581aaa(0xc3)](),_0x2dbe8b=_0x226917[_0x581aaa(0xc8)](),_0x64830b={'session_id':_0x2cd184['sessionId'],'cwd':_0x2cd184['projectRoot'],'prompt':_0x131dd1,'hook_event_name':_0x581aaa(0xdb)},_0x411592=_0x226917['handleUserPromptSubmit'](_0x64830b),_0x31ed51=_0x35a5ea[_0x581aaa(0xdd)](_0x226917['getSessionSummary']()[_0x581aaa(0xcd)],_0x2dbe8b[_0x581aaa(0xcd)]),_0x5824a2=_0x411592['additionalContext']??'',_0x4cb919=_0x35a5ea['xHNQn'](_0x5824a2['length'],0x0)?countTokens(_0x5824a2):0x0,_0x47fe2c=[..._0x5824a2[_0x581aaa(0xce)](/^\[([^\]]+)\]/gm)][_0x581aaa(0xb2)](_0x573fa8=>_0x573fa8[0x1]),_0x18571d={'context':_0x5824a2,'rules_matched':_0x47fe2c,'tokens_injected':_0x4cb919,'tokens_saved':_0x31ed51};return{'content':[{'type':_0x35a5ea[_0x581aaa(0xd0)],'text':JSON[_0x581aaa(0xb9)](_0x18571d)}]};}),_0x4f13a1[_0x332e76(0xda)](_0x35a5ea['HglkK'],{'description':_0x35a5ea['otuEZ'],'inputSchema':{'text':z['string']()['optional']()['describe'](_0x35a5ea['iFQeJ']),'file_path':z[_0x332e76(0xd5)]()[_0x332e76(0xbe)]()['describe'](_0x332e76(0xc9)),'provider':z['string']()[_0x332e76(0xbe)]()[_0x332e76(0xbb)](_0x35a5ea[_0x332e76(0xb4)]),'model':z['string']()['optional']()[_0x332e76(0xbb)](_0x35a5ea[_0x332e76(0xb6)])}},async({text:_0x2521b7,file_path:_0x165b54,provider:_0x4e7f06,model:_0xd2b554})=>{const _0x192e90=_0x332e76;if(_0x35a5ea['znlaB'](void 0x0,_0x2521b7)&&void 0x0===_0x165b54)return{'content':[{'type':'text','text':JSON[_0x192e90(0xb9)]({'error':_0x35a5ea[_0x192e90(0xbd)]})}],'isError':!0x0};const _0xf9aec7=_0x4e7f06??_0x2cd184[_0x192e90(0xc2)]()[_0x192e90(0xd7)],_0x217871=_0xd2b554??(_0x35a5ea['gjkyA']===_0xf9aec7?'gpt-4o':_0x2cd184[_0x192e90(0xc2)]()['model']);let _0x2cc406,_0x2f0b33;try{_0x2cc406=_0x2cd184['getTokenProvider'](_0xf9aec7,_0x217871);}catch(_0x25c762){const _0x8544d=_0x35a5ea['YvLIi'](_0x25c762,Error)?_0x25c762[_0x192e90(0xcb)]:_0x35a5ea[_0x192e90(0xbf)](String,_0x25c762);return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON[_0x192e90(0xb9)]({'error':_0x8544d})}],'isError':!0x0};}if(void 0x0!==_0x2521b7)_0x2f0b33=_0x2521b7;else{const _0x1aacf3=normalize(_0x2cd184[_0x192e90(0xde)]),_0x548e4d=_0x35a5ea['vgWCU'](normalize,_0x35a5ea[_0x192e90(0xc5)](resolve,_0x1aacf3,_0x165b54));if(!_0x548e4d[_0x192e90(0xdc)](_0x1aacf3))return{'content':[{'type':_0x35a5ea[_0x192e90(0xd0)],'text':JSON['stringify']({'error':_0x192e90(0xd1)})}],'isError':!0x0};try{_0x2f0b33=await _0x35a5ea[_0x192e90(0xe0)](readFile,_0x548e4d,_0x35a5ea['KAGUG']);}catch(_0x592153){const _0x17152c=_0x35a5ea[_0x192e90(0xd6)](_0x592153,Error)?_0x592153[_0x192e90(0xcb)]:_0x35a5ea['khSGB'](String,_0x592153);return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON[_0x192e90(0xb9)]({'error':_0x192e90(0xb7)+_0x17152c})}],'isError':!0x0};}}const _0xd2d7e8={'tokens':_0x2cc406[_0x192e90(0xcc)](_0x2f0b33),'tokens_method':'BPE\x20tokenizer\x20(accurate)','estimate':_0x2cc406['estimateTokens'](_0x2f0b33),'estimate_method':_0x192e90(0xb3)+(_0x35a5ea['znlaB'](_0x35a5ea['gjkyA'],_0xf9aec7)?_0x35a5ea[_0x192e90(0xba)]:'1.4')+')','provider':_0xf9aec7,'model':_0x217871};return{'content':[{'type':_0x35a5ea['PMaKA'],'text':JSON['stringify'](_0xd2d7e8)}]};}),_0x4f13a1['registerTool'](_0x35a5ea['PQjem'],{'description':'Return\x20cumulative\x20token\x20savings\x20for\x20the\x20current\x20MCP\x20session.\x20Shows\x20baseline\x20vs\x20optimized\x20token\x20counts\x20and\x20per-rule\x20trigger\x20counts.'},async()=>{const _0x2bdde8=_0x332e76,_0x32928a=_0x2cd184[_0x2bdde8(0xc3)]()['getSessionSummary'](),_0x2036b5={'baseline_tokens':_0x32928a[_0x2bdde8(0xc0)],'optimized_tokens':_0x32928a['total_optimized'],'saved_tokens':_0x32928a['total_delta'],'saved_percent':_0x32928a['savings_percent'],'prompts_count':_0x32928a[_0x2bdde8(0xc6)],'rules_triggered':_0x32928a[_0x2bdde8(0xc4)]};return{'content':[{'type':_0x2bdde8(0xaf),'text':JSON[_0x2bdde8(0xb9)](_0x2036b5)}]};});}
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- const _0x453c87=_0x4b81;(function(_0x2c6fbb,_0x476ddd){const _0x385df5=_0x4b81,_0x5372d1=_0x2c6fbb();while(!![]){try{const _0x6d5839=parseInt(_0x385df5(0x8a))/0x1+parseInt(_0x385df5(0x87))/0x2*(parseInt(_0x385df5(0x6d))/0x3)+-parseInt(_0x385df5(0x8b))/0x4*(-parseInt(_0x385df5(0x83))/0x5)+parseInt(_0x385df5(0x75))/0x6*(-parseInt(_0x385df5(0x7a))/0x7)+parseInt(_0x385df5(0x7e))/0x8+parseInt(_0x385df5(0x8c))/0x9*(parseInt(_0x385df5(0x85))/0xa)+-parseInt(_0x385df5(0x82))/0xb*(parseInt(_0x385df5(0x80))/0xc);if(_0x6d5839===_0x476ddd)break;else _0x5372d1['push'](_0x5372d1['shift']());}catch(_0x3089a1){_0x5372d1['push'](_0x5372d1['shift']());}}}(_0x25a5,0xc62be));import{resolve}from'node:path';import{loadConfig}from'./config-loader.js';import{HookDispatcher}from'./hook-dispatcher.js';import{buildSessionStartContext}from'./session-start.js';import{buildSmartContext}from'./smart-context.js';import{MeteringClient,buildMeterPayload}from'./metering-client.js';import{loadApiKeyFromConfig}from'../cli/setup-cmd.js';if(!process.env.TOKENIZER_API_KEY){const t=loadApiKeyFromConfig();t&&(process.env.TOKENIZER_API_KEY=t);}function _0x25a5(){const _0x15f93b=['434526QHllih','send','length','uQnmZ','stringify','63mFzJUq','filter','metering','Stop','491232fSCMDZ','../..','11807592bosEuu','CwEyX','11rIISvy','944045MOzbvS','provider','11270PHmcVy','prompt','5278XMPhMu','cwd','JUsag','308237lALwsX','28bEHpFc','2772njlXFb','XTblr','465tGLNaP','additionalContext','ncTFC','concat','utf-8','exit','handleSessionStop','toString'];_0x25a5=function(){return _0x15f93b;};return _0x25a5();}async function main(){const _0x210523=_0x4b81,_0x3ee16e={'ahjNH':_0x210523(0x71),'XTblr':function(_0x485dcb,_0x4baa2b){return _0x485dcb(_0x4baa2b);},'ncTFC':function(_0x23f318,_0x5cf060,_0x38b0ee){return _0x23f318(_0x5cf060,_0x38b0ee);},'uQnmZ':'SessionStart','CwEyX':function(_0x13f848,_0x2a4391){return _0x13f848(_0x2a4391);},'SthZM':'UserPromptSubmit','JUsag':function(_0x48c46a,_0x3e6770){return _0x48c46a>_0x3e6770;}},_0x487dcf=[];for await(const _0x3df128 of process['stdin'])_0x487dcf['push'](_0x3df128);const _0x19b8f2=Buffer[_0x210523(0x70)](_0x487dcf)[_0x210523(0x74)](_0x3ee16e['ahjNH']);let _0xd72f60;try{_0xd72f60=JSON['parse'](_0x19b8f2);}catch{process[_0x210523(0x72)](0x0);}const _0xd976d1=_0xd72f60['cwd']||process[_0x210523(0x88)](),_0x23a3b5=_0xd72f60['hook_event_name'];let _0x260365;try{_0x260365=_0x3ee16e[_0x210523(0x6c)](loadConfig,_0xd976d1);}catch{const _0x2dd91e=process.env.CLAUDE_PLUGIN_ROOT||_0x3ee16e[_0x210523(0x6f)](resolve,import.meta.dirname,_0x210523(0x7f));_0x260365=_0x3ee16e[_0x210523(0x6c)](loadConfig,_0x2dd91e);}const _0x7e9fca=new HookDispatcher(_0x260365,_0xd976d1,_0xd72f60['session_id']);let _0x4b6b0e={};switch(_0x23a3b5){case _0x3ee16e[_0x210523(0x78)]:_0x4b6b0e=_0x3ee16e[_0x210523(0x81)](buildSessionStartContext,{'cwd':_0xd976d1});break;case _0x3ee16e['SthZM']:{const _0x5bfe56=_0x7e9fca['handleUserPromptSubmit'](_0xd72f60),_0x407fb6=buildSmartContext({'prompt':_0xd72f60[_0x210523(0x86)]||'','cwd':_0xd976d1}),_0x47ada0=[_0x5bfe56['additionalContext'],_0x407fb6[_0x210523(0x6e)]][_0x210523(0x7b)](Boolean);_0x4b6b0e=_0x3ee16e[_0x210523(0x89)](_0x47ada0[_0x210523(0x77)],0x0)?{'additionalContext':_0x47ada0['join']('\x0a')}:{};break;}case'PreCompact':_0x4b6b0e=_0x7e9fca['handlePreCompact'](_0xd72f60);break;case _0x210523(0x7d):{const _0x36df29=_0x7e9fca[_0x210523(0x73)](),_0x3aaa52=new MeteringClient(_0x260365[_0x210523(0x7c)]['endpoint']),_0x25598f=buildMeterPayload(_0x36df29,{'provider':_0x260365[_0x210523(0x84)],'model':_0x260365['model']});await _0x3aaa52[_0x210523(0x76)](_0x25598f);break;}}process['stdout']['write'](JSON[_0x210523(0x79)](_0x4b6b0e)),process[_0x210523(0x72)](0x0);}function _0x4b81(_0x2ef05c,_0x4e9e41){_0x2ef05c=_0x2ef05c-0x6c;const _0x25a5f6=_0x25a5();let _0x4b815e=_0x25a5f6[_0x2ef05c];return _0x4b815e;}main()['catch'](()=>process[_0x453c87(0x72)](0x0));
2
+ const _0x675cc2=_0x52ba;(function(_0x39aecc,_0x2c7fcb){const _0xa18c03=_0x52ba,_0x4b10b2=_0x39aecc();while(!![]){try{const _0x274c55=-parseInt(_0xa18c03(0xe7))/0x1+-parseInt(_0xa18c03(0xf4))/0x2*(-parseInt(_0xa18c03(0xef))/0x3)+parseInt(_0xa18c03(0xfa))/0x4+-parseInt(_0xa18c03(0xea))/0x5*(-parseInt(_0xa18c03(0xe8))/0x6)+parseInt(_0xa18c03(0xe9))/0x7+-parseInt(_0xa18c03(0xf3))/0x8*(parseInt(_0xa18c03(0xf5))/0x9)+parseInt(_0xa18c03(0xdf))/0xa*(-parseInt(_0xa18c03(0xeb))/0xb);if(_0x274c55===_0x2c7fcb)break;else _0x4b10b2['push'](_0x4b10b2['shift']());}catch(_0x43d872){_0x4b10b2['push'](_0x4b10b2['shift']());}}}(_0x325e,0x38e89));import{resolve}from'node:path';function _0x325e(){const _0x4dc60a=['stringify','handleSessionStop','model','catch','200993eLhvNy','230346InDLbW','2121182DAKvlh','55Javaua','340406lTGkUo','push','join','PreCompact','57021AgpYZG','endpoint','../..','stdout','8ZYHdqO','10xepQon','237753eadHgK','handleUserPromptSubmit','write','hook_event_name','JYTgI','788692PJdEvd','provider','additionalContext','180IpmeUZ','prompt','exit','length'];_0x325e=function(){return _0x4dc60a;};return _0x325e();}import{loadConfig}from'./config-loader.js';import{HookDispatcher}from'./hook-dispatcher.js';import{buildSessionStartContext}from'./session-start.js';import{buildSmartContext}from'./smart-context.js';import{MeteringClient,buildMeterPayload}from'./metering-client.js';import{loadApiKeyFromConfig}from'../cli/setup-cmd.js';if(!process.env.TOKENIZER_API_KEY){const t=loadApiKeyFromConfig();t&&(process.env.TOKENIZER_API_KEY=t);}function _0x52ba(_0x41df62,_0x1356ed){_0x41df62=_0x41df62-0xdf;const _0x325ef8=_0x325e();let _0x52bae3=_0x325ef8[_0x41df62];return _0x52bae3;}async function main(){const _0x492f23=_0x52ba,_0x40e21f={'JYTgI':function(_0x20e6db,_0x433500){return _0x20e6db(_0x433500);},'wQFcj':_0x492f23(0xf1),'ONlLR':'SessionStart'},_0x3c4009=[];for await(const _0x30bfef of process['stdin'])_0x3c4009[_0x492f23(0xec)](_0x30bfef);const _0x430c6b=Buffer['concat'](_0x3c4009)['toString']('utf-8');let _0x86a314;try{_0x86a314=JSON['parse'](_0x430c6b);}catch{process['exit'](0x0);}const _0x3e51d4=_0x86a314['cwd']||process['cwd'](),_0xd9ef50=_0x86a314[_0x492f23(0xf8)];let _0x23fe8f;try{_0x23fe8f=_0x40e21f[_0x492f23(0xf9)](loadConfig,_0x3e51d4);}catch{const _0x375f3a=process.env.CLAUDE_PLUGIN_ROOT||resolve(import.meta.dirname,_0x40e21f['wQFcj']);_0x23fe8f=_0x40e21f[_0x492f23(0xf9)](loadConfig,_0x375f3a);}const _0x56c354=new HookDispatcher(_0x23fe8f,_0x3e51d4,_0x86a314['session_id']);let _0x13cdef={};switch(_0xd9ef50){case _0x40e21f['ONlLR']:_0x13cdef=_0x40e21f[_0x492f23(0xf9)](buildSessionStartContext,{'cwd':_0x3e51d4});break;case'UserPromptSubmit':{const _0x15f011=_0x56c354[_0x492f23(0xf6)](_0x86a314),_0x6992fa=_0x40e21f[_0x492f23(0xf9)](buildSmartContext,{'prompt':_0x86a314[_0x492f23(0xe0)]||'','cwd':_0x3e51d4}),_0x12ba86=[_0x15f011['additionalContext'],_0x6992fa[_0x492f23(0xfc)]]['filter'](Boolean);_0x13cdef=_0x12ba86[_0x492f23(0xe2)]>0x0?{'additionalContext':_0x12ba86[_0x492f23(0xed)]('\x0a')}:{};break;}case _0x492f23(0xee):_0x13cdef=_0x56c354['handlePreCompact'](_0x86a314);break;case'Stop':{const _0xcae7e3=_0x56c354[_0x492f23(0xe4)](),_0x21be65=new MeteringClient(_0x23fe8f['metering'][_0x492f23(0xf0)]),_0x5ad58f=buildMeterPayload(_0xcae7e3,{'provider':_0x23fe8f[_0x492f23(0xfb)],'model':_0x23fe8f[_0x492f23(0xe5)]});await _0x21be65['send'](_0x5ad58f);break;}}process[_0x492f23(0xf2)][_0x492f23(0xf7)](JSON[_0x492f23(0xe3)](_0x13cdef)),process[_0x492f23(0xe1)](0x0);}main()[_0x675cc2(0xe6)](()=>process[_0x675cc2(0xe1)](0x0));
@@ -1 +1 @@
1
- const _0x1e346e=_0xa3c5;(function(_0x3d3110,_0x83fe2e){const _0x18fe6a=_0xa3c5,_0x51ef31=_0x3d3110();while(!![]){try{const _0x3df35a=parseInt(_0x18fe6a(0xb1))/0x1*(parseInt(_0x18fe6a(0xc8))/0x2)+-parseInt(_0x18fe6a(0xbc))/0x3*(-parseInt(_0x18fe6a(0xc5))/0x4)+parseInt(_0x18fe6a(0xb4))/0x5*(parseInt(_0x18fe6a(0xc7))/0x6)+-parseInt(_0x18fe6a(0xc1))/0x7+-parseInt(_0x18fe6a(0xcd))/0x8*(parseInt(_0x18fe6a(0xc4))/0x9)+parseInt(_0x18fe6a(0xcc))/0xa*(-parseInt(_0x18fe6a(0xb5))/0xb)+parseInt(_0x18fe6a(0xbd))/0xc*(parseInt(_0x18fe6a(0xca))/0xd);if(_0x3df35a===_0x83fe2e)break;else _0x51ef31['push'](_0x51ef31['shift']());}catch(_0x43b2de){_0x51ef31['push'](_0x51ef31['shift']());}}}(_0x5e7e,0xa4c8e));import{readFileSync}from'node:fs';function _0xa3c5(_0x41c68a,_0x460050){_0x41c68a=_0x41c68a-0xb1;const _0x5e7e65=_0x5e7e();let _0xa3c5f3=_0x5e7e65[_0x41c68a];return _0xa3c5f3;}function _0x5e7e(){const _0x3d53bf=['version','number','gpt-4o','147813tMJOoJ','7867164SVcUcb','includes','metering','Unknown\x20provider:\x20','7576534rqtQcC','load','https://api.simosphere.ai/v1/meter','27kDIuCB','4qnWNIb','provider','2349318XFIzie','4AoJJgq','claude','26PZnxPa','ubEig','10aPZvkE','1590536ZOHeLv','HecbS','387149NxrnHM','.\x20Known:\x20','HjDMc','15YACXaA','10512161LgWPiF','utf-8','rules','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field'];_0x5e7e=function(){return _0x3d53bf;};return _0x5e7e();}import{join}from'node:path';import _0x2e6842 from'js-yaml';import'../shared/providers/claude-provider.js';import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME='tokenizer-speedup.yaml';export const DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320};export const DEFAULT_METERING={'endpoint':_0x1e346e(0xc3),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x5361c6){const _0x4d672b=_0x1e346e,_0x45d318={'HecbS':_0x4d672b(0xbb),'ZHFdl':function(_0x5b7ae7){return _0x5b7ae7();}},_0x4a3852=_0x2e6842[_0x4d672b(0xc2)](_0x5361c6);if(!_0x4a3852||_0x4d672b(0xba)!=typeof _0x4a3852[_0x4d672b(0xb9)])throw new Error(_0x4d672b(0xb8));const _0x4dfaf1=_0x4a3852[_0x4d672b(0xc6)]??_0x4d672b(0xc9),_0x281765=_0x4a3852['model']??('claude'===_0x4dfaf1?'claude-sonnet-4-20250514':_0x45d318[_0x4d672b(0xce)]),_0x29397b=_0x45d318['ZHFdl'](listProviders);if(!_0x29397b[_0x4d672b(0xbe)](_0x4dfaf1))throw new Error(_0x4d672b(0xc0)+_0x4dfaf1+_0x4d672b(0xb2)+_0x29397b['join'](',\x20'));const _0x3cf490=Array['isArray'](_0x4a3852[_0x4d672b(0xb7)])?_0x4a3852['rules']:[],_0x4247a6=_0x4a3852['context_limits']??DEFAULT_LIMITS,_0x52b2b5=_0x4a3852[_0x4d672b(0xbf)]??DEFAULT_METERING;return{'version':_0x4a3852[_0x4d672b(0xb9)],'provider':_0x4dfaf1,'model':_0x281765,'rules':_0x3cf490,'context_limits':_0x4247a6,'metering':_0x52b2b5};}export function loadConfigFromString(_0xc8fea9){return parseConfig(_0xc8fea9);}export function loadConfig(_0x5710c6){const _0x46d78c=_0x1e346e,_0x56104b={'ubEig':function(_0x12f0bf,_0x27c575,_0x4837e0){return _0x12f0bf(_0x27c575,_0x4837e0);},'HjDMc':function(_0x201790,_0x35e18d){return _0x201790(_0x35e18d);},'ZoAni':function(_0x1a9411,_0x150e43,_0x4858b2){return _0x1a9411(_0x150e43,_0x4858b2);},'pWnea':_0x46d78c(0xb6)},_0x329096=_0x56104b[_0x46d78c(0xcb)](join,_0x5710c6,CONFIG_FILENAME);return _0x56104b[_0x46d78c(0xb3)](parseConfig,_0x56104b['ZoAni'](readFileSync,_0x329096,_0x56104b['pWnea']));}
1
+ const _0x18835b=_0x3b22;(function(_0x439e9f,_0x4a7112){const _0x38f671=_0x3b22,_0x3cc197=_0x439e9f();while(!![]){try{const _0x2c3868=parseInt(_0x38f671(0x14e))/0x1*(parseInt(_0x38f671(0x159))/0x2)+-parseInt(_0x38f671(0x15b))/0x3*(-parseInt(_0x38f671(0x15c))/0x4)+-parseInt(_0x38f671(0x14b))/0x5*(-parseInt(_0x38f671(0x161))/0x6)+parseInt(_0x38f671(0x154))/0x7*(parseInt(_0x38f671(0x15a))/0x8)+parseInt(_0x38f671(0x156))/0x9+-parseInt(_0x38f671(0x15d))/0xa*(-parseInt(_0x38f671(0x15f))/0xb)+parseInt(_0x38f671(0x157))/0xc*(-parseInt(_0x38f671(0x160))/0xd);if(_0x2c3868===_0x4a7112)break;else _0x3cc197['push'](_0x3cc197['shift']());}catch(_0x1f7c53){_0x3cc197['push'](_0x3cc197['shift']());}}}(_0x51ed,0x704c8));import{readFileSync}from'node:fs';import{join}from'node:path';function _0x51ed(){const _0x4506e6=['load','gpt-4o','5JCGJNW','join','version','229ntiieG','https://api.simosphere.ai/v1/meter','rules','mlHgV','RpGbY','number','56OqLbYv','includes','2644479ZArwrQ','269616rhvlFE','metering','7132RTUQMl','595184ycHZeQ','2630193gahsGB','4OuHQhl','1270QQdwhi','.\x20Known:\x20','4763XdAwdH','1274LbGPOD','146934qpBmJD','Unknown\x20provider:\x20','model','claude'];_0x51ed=function(){return _0x4506e6;};return _0x51ed();}import _0x9cf265 from'js-yaml';import'../shared/providers/claude-provider.js';function _0x3b22(_0x135d49,_0x52d6d6){_0x135d49=_0x135d49-0x14a;const _0x51ed11=_0x51ed();let _0x3b2288=_0x51ed11[_0x135d49];return _0x3b2288;}import'../shared/providers/openai-provider.js';import{listProviders}from'../shared/token-provider.js';const CONFIG_FILENAME='tokenizer-speedup.yaml';export const DEFAULT_LIMITS={'max_injected_tokens':0xfa0,'max_file_tokens':0x5dc,'compress_above':0x320};export const DEFAULT_METERING={'endpoint':_0x18835b(0x14f),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x5b9b08){const _0x49dbe9=_0x18835b,_0x2154e2={'xyEDn':'Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','mlHgV':_0x49dbe9(0x164),'RpGbY':'claude-sonnet-4-20250514'},_0xf58bef=_0x9cf265[_0x49dbe9(0x165)](_0x5b9b08);if(!_0xf58bef||_0x49dbe9(0x153)!=typeof _0xf58bef[_0x49dbe9(0x14d)])throw new Error(_0x2154e2['xyEDn']);const _0x17e53d=_0xf58bef['provider']??_0x2154e2['mlHgV'],_0x2deee5=_0xf58bef[_0x49dbe9(0x163)]??(_0x2154e2[_0x49dbe9(0x151)]===_0x17e53d?_0x2154e2[_0x49dbe9(0x152)]:_0x49dbe9(0x14a)),_0x4c7e9d=listProviders();if(!_0x4c7e9d[_0x49dbe9(0x155)](_0x17e53d))throw new Error(_0x49dbe9(0x162)+_0x17e53d+_0x49dbe9(0x15e)+_0x4c7e9d[_0x49dbe9(0x14c)](',\x20'));const _0x3827bc=Array['isArray'](_0xf58bef[_0x49dbe9(0x150)])?_0xf58bef[_0x49dbe9(0x150)]:[],_0x1e4c8c=_0xf58bef['context_limits']??DEFAULT_LIMITS,_0x13d1ec=_0xf58bef[_0x49dbe9(0x158)]??DEFAULT_METERING;return{'version':_0xf58bef['version'],'provider':_0x17e53d,'model':_0x2deee5,'rules':_0x3827bc,'context_limits':_0x1e4c8c,'metering':_0x13d1ec};}export function loadConfigFromString(_0x1e07ad){return parseConfig(_0x1e07ad);}export function loadConfig(_0x5471a9){const _0xdd7f09={'mIMXE':function(_0x271285,_0x1f13b1,_0x80dfd1){return _0x271285(_0x1f13b1,_0x80dfd1);}},_0x52f068=join(_0x5471a9,CONFIG_FILENAME);return parseConfig(_0xdd7f09['mIMXE'](readFileSync,_0x52f068,'utf-8'));}
@@ -1 +1 @@
1
- (function(_0x5cb8b5,_0x18bd0b){const _0x3fc6c9=_0x5f17,_0x5732b6=_0x5cb8b5();while(!![]){try{const _0x302371=-parseInt(_0x3fc6c9(0x10c))/0x1*(-parseInt(_0x3fc6c9(0x107))/0x2)+-parseInt(_0x3fc6c9(0x10f))/0x3*(-parseInt(_0x3fc6c9(0x11a))/0x4)+parseInt(_0x3fc6c9(0x108))/0x5*(-parseInt(_0x3fc6c9(0x119))/0x6)+-parseInt(_0x3fc6c9(0x111))/0x7+parseInt(_0x3fc6c9(0x118))/0x8+parseInt(_0x3fc6c9(0x116))/0x9*(parseInt(_0x3fc6c9(0x115))/0xa)+-parseInt(_0x3fc6c9(0x112))/0xb;if(_0x302371===_0x18bd0b)break;else _0x5732b6['push'](_0x5732b6['shift']());}catch(_0x292f0e){_0x5732b6['push'](_0x5732b6['shift']());}}}(_0x1dd7,0x95be7));import{countTokens}from'../shared/token-counter.js';export function compressContext(_0xc50905,_0x53cb58){const _0x21bd6a=_0x5f17,_0x46358a={'CZXXN':function(_0x1b8f18,_0x30a5fb){return _0x1b8f18(_0x30a5fb);},'CRGXf':function(_0x291966,_0x26bb7b){return _0x291966+_0x26bb7b;},'NSCtC':function(_0x4fcc8e,_0x53b0a2){return _0x4fcc8e>_0x53b0a2;},'yiMlb':function(_0x509212,_0x58f031){return _0x509212>_0x58f031;},'uBpAz':function(_0x92aada,_0x44c03e){return _0x92aada+_0x44c03e;},'KygTI':function(_0x49941f,_0x43a0db){return _0x49941f>_0x43a0db;},'OfCYr':function(_0x167ba7,_0x5784af){return _0x167ba7+_0x5784af;},'VnATP':function(_0x5a5b16,_0x2015c3){return _0x5a5b16+_0x2015c3;}};if(!_0xc50905)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x323af8=_0x46358a['CZXXN'](countTokens,_0xc50905);if(_0x323af8<=_0x53cb58)return{'text':_0xc50905,'originalTokens':_0x323af8,'compressedTokens':_0x323af8,'wasTruncated':!0x1};const _0xafd42f=_0xc50905['split']('\x0a\x0a');let _0xc3201='',_0x37d7ba=0x0;for(const _0x1953f7 of _0xafd42f){const _0x5a825f=_0xc3201?_0x46358a[_0x21bd6a(0x117)](_0xc3201+'\x0a\x0a',_0x1953f7):_0x1953f7,_0x3aabde=countTokens(_0x5a825f);if(_0x46358a[_0x21bd6a(0x10b)](_0x3aabde,_0x53cb58))break;_0xc3201=_0x5a825f,_0x37d7ba=_0x3aabde;}if(!_0xc3201&&_0x46358a['yiMlb'](_0xafd42f['length'],0x0)){const _0x208f1a=_0xafd42f[0x0][_0x21bd6a(0x10d)](/\s+/);let _0x264d62='';for(const _0x442551 of _0x208f1a){const _0x1166b5=_0x264d62?_0x46358a['uBpAz'](_0x264d62+'\x20',_0x442551):_0x442551;if(_0x46358a[_0x21bd6a(0x109)](_0x46358a[_0x21bd6a(0x10a)](countTokens,_0x1166b5),_0x53cb58-0x5))break;_0x264d62=_0x1166b5;}_0xc3201=_0x264d62,_0x37d7ba=countTokens(_0xc3201);}const _0x10cba7=_0x46358a[_0x21bd6a(0x110)](_0x46358a[_0x21bd6a(0x106)](_0x46358a['VnATP'](_0xc3201,_0x21bd6a(0x11d)),_0x323af8)+_0x21bd6a(0x114)+_0x37d7ba,_0x21bd6a(0x11b));return{'text':_0x10cba7,'originalTokens':_0x323af8,'compressedTokens':countTokens(_0x10cba7),'wasTruncated':!0x0};}function _0x5f17(_0x29bec3,_0x5179ff){_0x29bec3=_0x29bec3-0x106;const _0x1dd707=_0x1dd7();let _0x5f1704=_0x1dd707[_0x29bec3];return _0x5f1704;}function _0x1dd7(){const _0x11ccb1=['1740807vlcqZC','CRGXf','5752608DnPgbn','42ENCaKt','556492ZRCljg','\x20Token]','map','\x0a\x0a[...\x20gekuerzt,\x20','uBpAz','78QWAUsL','585160rvWLVb','KygTI','CZXXN','NSCtC','18931OcUWDc','split','floor','18KxcMRR','OfCYr','2401833QgFzyP','7808372RAgIit','max','\x20→\x20','10QXYIyC'];_0x1dd7=function(){return _0x11ccb1;};return _0x1dd7();}export function compressContextBudget(_0x33e97b,_0x25f8ce){const _0x43ac8e=_0x5f17,_0x2a92bb=Math[_0x43ac8e(0x10e)](_0x25f8ce/Math[_0x43ac8e(0x113)](_0x33e97b['length'],0x1));return _0x33e97b[_0x43ac8e(0x11c)](({label:_0x12be2a,text:_0x163a11})=>({'label':_0x12be2a,'result':compressContext(_0x163a11,_0x2a92bb)}));}
1
+ (function(_0x454c0b,_0x4abacb){const _0x268aa5=_0x46c4,_0x5f51f9=_0x454c0b();while(!![]){try{const _0x4d5421=parseInt(_0x268aa5(0x107))/0x1+parseInt(_0x268aa5(0x100))/0x2+-parseInt(_0x268aa5(0x103))/0x3*(-parseInt(_0x268aa5(0x10a))/0x4)+parseInt(_0x268aa5(0x10b))/0x5*(parseInt(_0x268aa5(0xff))/0x6)+-parseInt(_0x268aa5(0x108))/0x7*(parseInt(_0x268aa5(0x104))/0x8)+parseInt(_0x268aa5(0xfc))/0x9+-parseInt(_0x268aa5(0xfb))/0xa;if(_0x4d5421===_0x4abacb)break;else _0x5f51f9['push'](_0x5f51f9['shift']());}catch(_0x25aee7){_0x5f51f9['push'](_0x5f51f9['shift']());}}}(_0x27b2,0xc47e7));import{countTokens}from'../shared/token-counter.js';function _0x46c4(_0x299de8,_0x29acbd){_0x299de8=_0x299de8-0xfa;const _0x27b275=_0x27b2();let _0x46c497=_0x27b275[_0x299de8];return _0x46c497;}export function compressContext(_0xc405ff,_0x498629){const _0x5c1325=_0x46c4,_0x5e365a={'Kpubm':function(_0x5ba0a5,_0x556e12){return _0x5ba0a5(_0x556e12);},'YeiGy':function(_0x2a96c0,_0x4e65b2){return _0x2a96c0+_0x4e65b2;},'YaCXH':function(_0x2a67d3,_0x3f9bd2){return _0x2a67d3+_0x3f9bd2;},'aFBva':function(_0x159037,_0x22d44b){return _0x159037+_0x22d44b;},'LoPyt':function(_0x4a66d6,_0x19bcce){return _0x4a66d6+_0x19bcce;},'AMkmk':function(_0x1b02dd,_0x52f3dc){return _0x1b02dd(_0x52f3dc);},'MUaDv':function(_0xaaaf7c,_0x5d65d6){return _0xaaaf7c+_0x5d65d6;},'AKgzN':function(_0x226148,_0x2a5936){return _0x226148+_0x2a5936;},'VRcJT':'\x0a\x0a[...\x20gekuerzt,\x20','GzhMJ':'\x20→\x20','CQMin':function(_0x4f1913,_0x3b7845){return _0x4f1913(_0x3b7845);}};if(!_0xc405ff)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x20166c=_0x5e365a['Kpubm'](countTokens,_0xc405ff);if(_0x20166c<=_0x498629)return{'text':_0xc405ff,'originalTokens':_0x20166c,'compressedTokens':_0x20166c,'wasTruncated':!0x1};const _0x4fd133=_0xc405ff[_0x5c1325(0x101)]('\x0a\x0a');let _0x36d360='',_0x573490=0x0;for(const _0x20da4 of _0x4fd133){const _0x230b51=_0x36d360?_0x5e365a['YeiGy'](_0x5e365a['YaCXH'](_0x36d360,'\x0a\x0a'),_0x20da4):_0x20da4,_0x533fcc=countTokens(_0x230b51);if(_0x533fcc>_0x498629)break;_0x36d360=_0x230b51,_0x573490=_0x533fcc;}if(!_0x36d360&&_0x4fd133['length']>0x0){const _0x1b6ed6=_0x4fd133[0x0][_0x5c1325(0x101)](/\s+/);let _0x53829b='';for(const _0x2e0482 of _0x1b6ed6){const _0x139d77=_0x53829b?_0x5e365a[_0x5c1325(0x102)](_0x5e365a['LoPyt'](_0x53829b,'\x20'),_0x2e0482):_0x2e0482;if(_0x5e365a[_0x5c1325(0xfd)](countTokens,_0x139d77)>_0x498629-0x5)break;_0x53829b=_0x139d77;}_0x36d360=_0x53829b,_0x573490=countTokens(_0x36d360);}const _0x54b32b=_0x5e365a[_0x5c1325(0x102)](_0x5e365a[_0x5c1325(0xfa)](_0x5e365a[_0x5c1325(0xfe)](_0x36d360+_0x5e365a[_0x5c1325(0x106)],_0x20166c),_0x5e365a['GzhMJ'])+_0x573490,'\x20Token]');return{'text':_0x54b32b,'originalTokens':_0x20166c,'compressedTokens':_0x5e365a['CQMin'](countTokens,_0x54b32b),'wasTruncated':!0x0};}function _0x27b2(){const _0x4e19aa=['split','aFBva','871599SgVEzz','906904DIQRyL','omsia','VRcJT','747716CGBASh','35qZkQWW','map','12tUaedo','1320030lGCKwA','MUaDv','13559570EPbzNe','2554434MZJKfO','AMkmk','AKgzN','6bSXjRW','1120928TbnFOB'];_0x27b2=function(){return _0x4e19aa;};return _0x27b2();}export function compressContextBudget(_0x2e9dcd,_0x83a305){const _0x4c42b5=_0x46c4,_0x3ecb1b={'omsia':function(_0x3d864e,_0x22d37f){return _0x3d864e/_0x22d37f;}},_0x50a0ac=Math['floor'](_0x3ecb1b[_0x4c42b5(0x105)](_0x83a305,Math['max'](_0x2e9dcd['length'],0x1)));return _0x2e9dcd[_0x4c42b5(0x109)](({label:_0x421180,text:_0x32b60b})=>({'label':_0x421180,'result':compressContext(_0x32b60b,_0x50a0ac)}));}
@@ -1 +1 @@
1
- const _0x43f9a0=_0x4faf;(function(_0xb71165,_0xc9c6e2){const _0x514a40=_0x4faf,_0x21996f=_0xb71165();while(!![]){try{const _0x583607=parseInt(_0x514a40(0x18c))/0x1+parseInt(_0x514a40(0x18d))/0x2*(parseInt(_0x514a40(0x182))/0x3)+-parseInt(_0x514a40(0x183))/0x4*(parseInt(_0x514a40(0x189))/0x5)+-parseInt(_0x514a40(0x16a))/0x6*(parseInt(_0x514a40(0x173))/0x7)+-parseInt(_0x514a40(0x16c))/0x8*(parseInt(_0x514a40(0x17a))/0x9)+-parseInt(_0x514a40(0x17e))/0xa+parseInt(_0x514a40(0x18b))/0xb;if(_0x583607===_0xc9c6e2)break;else _0x21996f['push'](_0x21996f['shift']());}catch(_0x25b4b0){_0x21996f['push'](_0x21996f['shift']());}}}(_0x4fe7,0x324ad));import{RuleEngine}from'./rule-engine.js';function _0x4faf(_0x54f71f,_0x5ca93b){_0x54f71f=_0x54f71f-0x165;const _0x4fe764=_0x4fe7();let _0x4fafee=_0x4fe764[_0x54f71f];return _0x4fafee;}import{MetricsCollector}from'./metrics-collector.js';import{compressContext}from'./context-compressor.js';import{prioritizeContext}from'./precompact-handler.js';import{countTokens}from'../shared/token-counter.js';export class HookDispatcher{[_0x43f9a0(0x172)];[_0x43f9a0(0x171)];[_0x43f9a0(0x185)];constructor(_0x36e519,_0x2ad317,_0x2659b1){const _0x4439c5=_0x43f9a0;this[_0x4439c5(0x172)]=new RuleEngine(_0x36e519),this['projectRoot']=_0x2ad317,this[_0x4439c5(0x171)]=new MetricsCollector(_0x2ad317,_0x2659b1||_0x4439c5(0x177)+Date[_0x4439c5(0x170)]());}['handleUserPromptSubmit'](_0x1960aa){const _0x4168dd=_0x43f9a0,_0x4ab0bb={'eqGGE':function(_0x70a4cb,_0x422f8b){return _0x70a4cb===_0x422f8b;},'aZqPg':function(_0x41f015,_0x1952da){return _0x41f015(_0x1952da);},'EKjBq':function(_0x51a67f,_0xfdded7){return _0x51a67f>_0xfdded7;},'fpSwl':function(_0x1ea732,_0x2899c9){return _0x1ea732(_0x2899c9);},'kiuWs':function(_0x39b9e0,_0x561205){return _0x39b9e0(_0x561205);},'raunl':function(_0x251441,_0x1e53a1){return _0x251441+_0x1e53a1;}},_0x415215=_0x1960aa['prompt']||'',_0x19c843=this[_0x4168dd(0x172)][_0x4168dd(0x167)](_0x415215);if(_0x4ab0bb[_0x4168dd(0x178)](0x0,_0x19c843[_0x4168dd(0x179)])){const _0x93c469=_0x4ab0bb['aZqPg'](countTokens,_0x415215);return this[_0x4168dd(0x171)]['record']({'hook_event':_0x1960aa['hook_event_name'],'baseline_tokens':_0x93c469,'optimized_tokens':_0x93c469,'rule_matched':null}),{};}const _0x3a98de=[],_0x59877b=[];for(const _0x40f0c3 of _0x19c843)_0x59877b[_0x4168dd(0x16b)](_0x40f0c3[_0x4168dd(0x165)][0x0]),_0x40f0c3[_0x4168dd(0x17b)]?_0x3a98de[_0x4168dd(0x16b)]('['+_0x40f0c3['trigger'][0x0]+']\x20Fuer\x20Details:\x20'+_0x40f0c3[_0x4168dd(0x16f)]+'\x20laden.'):_0x3a98de[_0x4168dd(0x16b)]('['+_0x40f0c3[_0x4168dd(0x165)][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x40f0c3[_0x4168dd(0x16f)]+_0x4168dd(0x184)+(_0x40f0c3[_0x4168dd(0x166)]||this['engine']['limits']['max_file_tokens'])+'\x20Token)');let _0x32c9c2=_0x3a98de['join']('\x0a');const _0x45bcb1=this['engine'][_0x4168dd(0x18a)][_0x4168dd(0x17c)];_0x4ab0bb['EKjBq'](_0x45bcb1,0x0)&&(_0x32c9c2=compressContext(_0x32c9c2,_0x45bcb1)[_0x4168dd(0x180)]);const _0x545a6d=_0x4ab0bb[_0x4168dd(0x18e)](countTokens,_0x415215),_0x2cbab9=_0x4ab0bb[_0x4168dd(0x17f)](countTokens,_0x32c9c2),_0x1afa29=_0x4ab0bb['raunl'](_0x545a6d,this[_0x4168dd(0x172)]['limits'][_0x4168dd(0x175)]),_0x567097=_0x545a6d+Math['min'](_0x2cbab9,this['engine']['limits'][_0x4168dd(0x175)]);return this[_0x4168dd(0x171)]['record']({'hook_event':_0x1960aa['hook_event_name'],'baseline_tokens':_0x1afa29,'optimized_tokens':_0x567097,'rule_matched':_0x59877b['join']('+')}),{'additionalContext':_0x32c9c2};}[_0x43f9a0(0x181)](_0x2210e3){const _0x3b7fd7=_0x43f9a0,_0x5e1b6e={'Fnzay':function(_0x4b49ad,_0x2d5a6b){return _0x4b49ad===_0x2d5a6b;},'wNisH':function(_0x55baec,_0xb13e74,_0x177e32){return _0x55baec(_0xb13e74,_0x177e32);}},_0x25a4c9=[];if(_0x2210e3[_0x3b7fd7(0x16d)]&&_0x25a4c9['push']({'role':'user','content':_0x2210e3[_0x3b7fd7(0x16d)],'turnIndex':0x0}),_0x5e1b6e[_0x3b7fd7(0x176)](0x0,_0x25a4c9[_0x3b7fd7(0x179)]))return{};const _0x5199e7=_0x5e1b6e[_0x3b7fd7(0x168)](prioritizeContext,_0x25a4c9,this[_0x3b7fd7(0x172)][_0x3b7fd7(0x18a)]),_0x1e6630=_0x5199e7['prioritized'][_0x3b7fd7(0x169)](_0x2b5ffd=>_0x2b5ffd[_0x3b7fd7(0x186)])['join']('\x0a\x0a');return this['collector'][_0x3b7fd7(0x187)]({'hook_event':_0x2210e3[_0x3b7fd7(0x17d)],'baseline_tokens':_0x5199e7[_0x3b7fd7(0x174)],'optimized_tokens':_0x5199e7['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x1e6630};}['handleSessionStop'](){const _0x458c38=_0x43f9a0;return this['collector']['flush'](),this['collector'][_0x458c38(0x188)]();}[_0x43f9a0(0x16e)](){return this['collector']['getSummary']();}}function _0x4fe7(){const _0xc8bdcc=['now','collector','engine','512806sKEwMr','totalOriginalTokens','max_injected_tokens','Fnzay','session-','eqGGE','length','51453AECtQp','summary_only','compress_above','hook_event_name','1757350wRAfuL','kiuWs','text','handlePreCompact','303891WFiCUL','5612QaMKUM','\x20(max\x20','projectRoot','content','record','getSummary','755wMVqKP','limits','8359285GgfsLr','192787HCULMF','4bhntWy','fpSwl','trigger','max_tokens','match','wNisH','map','24KEfkNJ','push','376RhQTab','prompt','getSessionSummary','load'];_0x4fe7=function(){return _0xc8bdcc;};return _0x4fe7();}
1
+ const _0x461bbd=_0x3fad;(function(_0x4451da,_0x58f74f){const _0x231dca=_0x3fad,_0x2c9201=_0x4451da();while(!![]){try{const _0x20391c=-parseInt(_0x231dca(0x1fa))/0x1*(parseInt(_0x231dca(0x1e4))/0x2)+-parseInt(_0x231dca(0x1d8))/0x3*(-parseInt(_0x231dca(0x1f7))/0x4)+-parseInt(_0x231dca(0x1e9))/0x5+-parseInt(_0x231dca(0x1e2))/0x6+parseInt(_0x231dca(0x1f3))/0x7+parseInt(_0x231dca(0x1f4))/0x8*(parseInt(_0x231dca(0x1ec))/0x9)+parseInt(_0x231dca(0x1f5))/0xa*(parseInt(_0x231dca(0x1dc))/0xb);if(_0x20391c===_0x58f74f)break;else _0x2c9201['push'](_0x2c9201['shift']());}catch(_0x3be72f){_0x2c9201['push'](_0x2c9201['shift']());}}}(_0x58d8,0xce17a));import{RuleEngine}from'./rule-engine.js';import{MetricsCollector}from'./metrics-collector.js';import{compressContext}from'./context-compressor.js';import{prioritizeContext}from'./precompact-handler.js';function _0x3fad(_0x482b5d,_0x2485d2){_0x482b5d=_0x482b5d-0x1d8;const _0x58d822=_0x58d8();let _0x3fadef=_0x58d822[_0x482b5d];return _0x3fadef;}import{countTokens}from'../shared/token-counter.js';function _0x58d8(){const _0x1ed8c7=['40qMHcLF','3091690XJOaEZ','projectRoot','5141604OnXzet','record','handleUserPromptSubmit','9RBpblR','content','AwStj','3uRIISa','hook_event_name','push','\x20laden.','44kceudM','prompt','limits','getSummary','max_tokens','collector','7624584izeuwS','getSessionSummary','101242oAOprN',']\x20Fuer\x20Details:\x20','session-','map','trigger','7789165cacPbM','summary_only','length','1349289ZYwhyJ','engine','min','now','\x20(max\x20','load','prioritized','5996606guqroG'];_0x58d8=function(){return _0x1ed8c7;};return _0x58d8();}export class HookDispatcher{[_0x461bbd(0x1ed)];[_0x461bbd(0x1e1)];[_0x461bbd(0x1f6)];constructor(_0x5ce9c5,_0x4ac825,_0x1cb9be){const _0x2bcfd1=_0x461bbd;this[_0x2bcfd1(0x1ed)]=new RuleEngine(_0x5ce9c5),this[_0x2bcfd1(0x1f6)]=_0x4ac825,this['collector']=new MetricsCollector(_0x4ac825,_0x1cb9be||_0x2bcfd1(0x1e6)+Date[_0x2bcfd1(0x1ef)]());}[_0x461bbd(0x1f9)](_0x10c36f){const _0x8aa00=_0x461bbd,_0x16b89c={'Dbbtp':function(_0x338a22,_0x4805db){return _0x338a22>_0x4805db;},'Ycqox':function(_0x538687,_0x55df04,_0x297ad5){return _0x538687(_0x55df04,_0x297ad5);},'iyZvV':function(_0x127ad9,_0x377f67){return _0x127ad9(_0x377f67);},'AwStj':function(_0x4bd3b0,_0x5e5134){return _0x4bd3b0+_0x5e5134;}},_0x4c2ac7=_0x10c36f[_0x8aa00(0x1dd)]||'',_0xcfb84c=this['engine']['match'](_0x4c2ac7);if(0x0===_0xcfb84c[_0x8aa00(0x1eb)]){const _0x38c098=countTokens(_0x4c2ac7);return this[_0x8aa00(0x1e1)][_0x8aa00(0x1f8)]({'hook_event':_0x10c36f['hook_event_name'],'baseline_tokens':_0x38c098,'optimized_tokens':_0x38c098,'rule_matched':null}),{};}const _0x16834f=[],_0x5b676b=[];for(const _0x523a0b of _0xcfb84c)_0x5b676b[_0x8aa00(0x1da)](_0x523a0b[_0x8aa00(0x1e8)][0x0]),_0x523a0b[_0x8aa00(0x1ea)]?_0x16834f[_0x8aa00(0x1da)]('['+_0x523a0b[_0x8aa00(0x1e8)][0x0]+_0x8aa00(0x1e5)+_0x523a0b['load']+_0x8aa00(0x1db)):_0x16834f['push']('['+_0x523a0b['trigger'][0x0]+']\x20Relevanter\x20Kontext:\x20'+_0x523a0b[_0x8aa00(0x1f1)]+_0x8aa00(0x1f0)+(_0x523a0b[_0x8aa00(0x1e0)]||this['engine'][_0x8aa00(0x1de)]['max_file_tokens'])+'\x20Token)');let _0x4b85dc=_0x16834f['join']('\x0a');const _0x2111f0=this[_0x8aa00(0x1ed)][_0x8aa00(0x1de)]['compress_above'];_0x16b89c['Dbbtp'](_0x2111f0,0x0)&&(_0x4b85dc=_0x16b89c['Ycqox'](compressContext,_0x4b85dc,_0x2111f0)['text']);const _0x4f6d01=_0x16b89c['iyZvV'](countTokens,_0x4c2ac7),_0x86ba22=countTokens(_0x4b85dc),_0x4dd265=_0x16b89c[_0x8aa00(0x1fc)](_0x4f6d01,this[_0x8aa00(0x1ed)][_0x8aa00(0x1de)]['max_injected_tokens']),_0x34e72e=_0x16b89c['AwStj'](_0x4f6d01,Math[_0x8aa00(0x1ee)](_0x86ba22,this[_0x8aa00(0x1ed)][_0x8aa00(0x1de)]['max_injected_tokens']));return this['collector'][_0x8aa00(0x1f8)]({'hook_event':_0x10c36f['hook_event_name'],'baseline_tokens':_0x4dd265,'optimized_tokens':_0x34e72e,'rule_matched':_0x5b676b['join']('+')}),{'additionalContext':_0x4b85dc};}['handlePreCompact'](_0x18e25c){const _0x5a49c6=_0x461bbd,_0x3b7efd={'BrfmC':'user'},_0x31e408=[];if(_0x18e25c[_0x5a49c6(0x1dd)]&&_0x31e408[_0x5a49c6(0x1da)]({'role':_0x3b7efd['BrfmC'],'content':_0x18e25c[_0x5a49c6(0x1dd)],'turnIndex':0x0}),0x0===_0x31e408[_0x5a49c6(0x1eb)])return{};const _0x502614=prioritizeContext(_0x31e408,this[_0x5a49c6(0x1ed)]['limits']),_0x17c8ad=_0x502614[_0x5a49c6(0x1f2)][_0x5a49c6(0x1e7)](_0x5c021a=>_0x5c021a[_0x5a49c6(0x1fb)])['join']('\x0a\x0a');return this[_0x5a49c6(0x1e1)]['record']({'hook_event':_0x18e25c[_0x5a49c6(0x1d9)],'baseline_tokens':_0x502614['totalOriginalTokens'],'optimized_tokens':_0x502614['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x17c8ad};}['handleSessionStop'](){const _0xf46a6=_0x461bbd;return this['collector']['flush'](),this[_0xf46a6(0x1e1)][_0xf46a6(0x1df)]();}[_0x461bbd(0x1e3)](){const _0x50215f=_0x461bbd;return this[_0x50215f(0x1e1)]['getSummary']();}}
@@ -1 +1 @@
1
- const _0x402584=_0x4e34;function _0x4fca(){const _0x5a275d=['timeout','15673WnXMuF','network_error','http_','9830vKQTDO','9094921BvgWnr','total_baseline','2416BqiCCW','provider','274928TIUQvs','862527iXsWth','5283805naylsP','endpoint','6VJZxWV','18JtgBMA','stringify','12eSsotz','send','4745344UKMylG','POST','11367jsYZiA'];_0x4fca=function(){return _0x5a275d;};return _0x4fca();}function _0x4e34(_0x4c5f04,_0x2a1e25){_0x4c5f04=_0x4c5f04-0xec;const _0x4fca75=_0x4fca();let _0x4e34b4=_0x4fca75[_0x4c5f04];return _0x4e34b4;}(function(_0x3d18eb,_0x5372ba){const _0x3deea5=_0x4e34,_0x5cd418=_0x3d18eb();while(!![]){try{const _0x36f9fa=parseInt(_0x3deea5(0xee))/0x1+-parseInt(_0x3deea5(0xed))/0x2*(-parseInt(_0x3deea5(0xf2))/0x3)+parseInt(_0x3deea5(0xf6))/0x4+parseInt(_0x3deea5(0xef))/0x5*(-parseInt(_0x3deea5(0xf1))/0x6)+parseInt(_0x3deea5(0xfa))/0x7*(-parseInt(_0x3deea5(0x100))/0x8)+parseInt(_0x3deea5(0xf8))/0x9*(-parseInt(_0x3deea5(0xfd))/0xa)+-parseInt(_0x3deea5(0xfe))/0xb*(-parseInt(_0x3deea5(0xf4))/0xc);if(_0x36f9fa===_0x5372ba)break;else _0x5cd418['push'](_0x5cd418['shift']());}catch(_0x4378d4){_0x5cd418['push'](_0x5cd418['shift']());}}}(_0x4fca,0xb13e6));export function buildMeterPayload(_0x5cedc2,_0x46c0b9){const _0x469e0c=_0x4e34,_0x451813={'OkAJb':'Stop'};return{'session_id':_0x5cedc2['session_id'],'tokens_saved':_0x5cedc2['total_delta'],'baseline_tokens':_0x5cedc2[_0x469e0c(0xff)],'optimized_tokens':_0x5cedc2['total_optimized'],'hook_event':_0x451813['OkAJb'],'provider':_0x46c0b9[_0x469e0c(0xec)],'model':_0x46c0b9['model'],'team_id':_0x46c0b9['team_id']??''};}export class MeteringClient{[_0x402584(0xf0)];constructor(_0x101a52){const _0x4504bd=_0x402584;this[_0x4504bd(0xf0)]=_0x101a52;}async[_0x402584(0xf5)](_0x1ae484){const _0x2fddd7=_0x402584,_0x206d3a={'odmSa':'no_endpoint','bYMOE':function(_0x1f7859,_0x701a19,_0xfc151e){return _0x1f7859(_0x701a19,_0xfc151e);},'pYCdN':'application/json'};if(!this[_0x2fddd7(0xf0)])return{'sent':!0x1,'reason':_0x206d3a['odmSa']};try{const _0x27ad28=await _0x206d3a['bYMOE'](fetch,this[_0x2fddd7(0xf0)],{'method':_0x2fddd7(0xf7),'headers':{'Content-Type':_0x206d3a['pYCdN'],'Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON[_0x2fddd7(0xf3)](_0x1ae484),'signal':AbortSignal[_0x2fddd7(0xf9)](0x1388)});return _0x27ad28['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x2fddd7(0xfc)+_0x27ad28['status']};}catch{return{'sent':!0x1,'reason':_0x2fddd7(0xfb)};}}}
1
+ function _0x5cb7(){const _0x29a2ad=['session_id','54czjWjR','1910280HITpJw','6011800yigYmQ','http_','AIhKJ','stringify','8160cfAddk','16388364JnVYfh','network_error','1085FydtdS','no_endpoint','484nWWTcA','111HbZVXm','application/json','11634WBAwok','2FjTJur','team_id','198376MDswvQ','endpoint','total_delta','model','375880bySrHK'];_0x5cb7=function(){return _0x29a2ad;};return _0x5cb7();}const _0x37ca50=_0x1122;(function(_0x1cb704,_0x440831){const _0x28feb7=_0x1122,_0x10ebb6=_0x1cb704();while(!![]){try{const _0x5bdd05=-parseInt(_0x28feb7(0x1fa))/0x1*(-parseInt(_0x28feb7(0x1e5))/0x2)+-parseInt(_0x28feb7(0x1f7))/0x3*(-parseInt(_0x28feb7(0x1f1))/0x4)+-parseInt(_0x28feb7(0x1ed))/0x5+parseInt(_0x28feb7(0x1f9))/0x6*(parseInt(_0x28feb7(0x1f4))/0x7)+-parseInt(_0x28feb7(0x1ec))/0x8*(parseInt(_0x28feb7(0x1eb))/0x9)+parseInt(_0x28feb7(0x1e9))/0xa*(parseInt(_0x28feb7(0x1f6))/0xb)+parseInt(_0x28feb7(0x1f2))/0xc;if(_0x5bdd05===_0x440831)break;else _0x10ebb6['push'](_0x10ebb6['shift']());}catch(_0x3f896f){_0x10ebb6['push'](_0x10ebb6['shift']());}}}(_0x5cb7,0xea1b4));function _0x1122(_0x5b497a,_0x56c90d){_0x5b497a=_0x5b497a-0x1e4;const _0x5cb747=_0x5cb7();let _0x112221=_0x5cb747[_0x5b497a];return _0x112221;}export function buildMeterPayload(_0x32872e,_0x5b16bb){const _0x140eaf=_0x1122,_0x7e9e0={'PPmJQ':'Stop'};return{'session_id':_0x32872e[_0x140eaf(0x1ea)],'tokens_saved':_0x32872e[_0x140eaf(0x1e7)],'baseline_tokens':_0x32872e['total_baseline'],'optimized_tokens':_0x32872e['total_optimized'],'hook_event':_0x7e9e0['PPmJQ'],'provider':_0x5b16bb['provider'],'model':_0x5b16bb[_0x140eaf(0x1e8)],'team_id':_0x5b16bb[_0x140eaf(0x1e4)]??''};}export class MeteringClient{[_0x37ca50(0x1e6)];constructor(_0x3ffe09){this['endpoint']=_0x3ffe09;}async['send'](_0x4120c0){const _0x531ca7=_0x37ca50,_0x404652={'VzXIo':_0x531ca7(0x1f8),'AIhKJ':_0x531ca7(0x1f3)};if(!this[_0x531ca7(0x1e6)])return{'sent':!0x1,'reason':_0x531ca7(0x1f5)};try{const _0x58cb1d=await fetch(this[_0x531ca7(0x1e6)],{'method':'POST','headers':{'Content-Type':_0x404652['VzXIo'],'Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON[_0x531ca7(0x1f0)](_0x4120c0),'signal':AbortSignal['timeout'](0x1388)});return _0x58cb1d['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x531ca7(0x1ee)+_0x58cb1d['status']};}catch{return{'sent':!0x1,'reason':_0x404652[_0x531ca7(0x1ef)]};}}}
@@ -1 +1 @@
1
- const _0x37eeeb=_0x41c3;(function(_0x10a204,_0x4f33f1){const _0xa579c9=_0x41c3,_0x22110f=_0x10a204();while(!![]){try{const _0x4f9506=-parseInt(_0xa579c9(0x1a9))/0x1+parseInt(_0xa579c9(0x1a6))/0x2+-parseInt(_0xa579c9(0x19b))/0x3+-parseInt(_0xa579c9(0x1b1))/0x4*(-parseInt(_0xa579c9(0x194))/0x5)+-parseInt(_0xa579c9(0x196))/0x6+parseInt(_0xa579c9(0x19a))/0x7+parseInt(_0xa579c9(0x1a7))/0x8;if(_0x4f9506===_0x4f33f1)break;else _0x22110f['push'](_0x22110f['shift']());}catch(_0x49effb){_0x22110f['push'](_0x22110f['shift']());}}}(_0x4732,0xbe795));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';const METRICS_DIR='.tokenizer-speedup';function _0x41c3(_0x4a5580,_0x20f655){_0x4a5580=_0x4a5580-0x193;const _0x473275=_0x4732();let _0x41c33a=_0x473275[_0x4a5580];return _0x41c33a;}function _0x4732(){const _0x3d3bd8=['URYiD','projectRoot','sessionId','.json','length','uonjU','1344246uVHtHl','11984392BDvGYL','baseline_tokens','780913PfXQoh','metrics','getSummary','reduce','hook_event','eAYfV','record','flush','42780ptlJWo','toISOString','310fRXuZU','utf-8','8025528rnIiIZ','optimized_tokens','stringify','startedAt','3466232QaQSZU','1289268RJYeyo','push','grlDI','Quwpn','rule_matched'];_0x4732=function(){return _0x3d3bd8;};return _0x4732();}export class MetricsCollector{[_0x37eeeb(0x1aa)]=[];['sessionId'];[_0x37eeeb(0x1a1)];[_0x37eeeb(0x199)];constructor(_0x1f6de4,_0x12d111){const _0x200826=_0x37eeeb;this['projectRoot']=_0x1f6de4,this[_0x200826(0x1a2)]=_0x12d111,this['startedAt']=new Date()['toISOString']();}[_0x37eeeb(0x1af)](_0x4642d7){const _0x314f26=_0x37eeeb,_0x564053={'grlDI':function(_0x39facf,_0x3bf071){return _0x39facf-_0x3bf071;}};this[_0x314f26(0x1aa)][_0x314f26(0x19c)]({'session_id':this[_0x314f26(0x1a2)],'timestamp':new Date()[_0x314f26(0x193)](),'hook_event':_0x4642d7[_0x314f26(0x1ad)],'baseline_tokens':_0x4642d7['baseline_tokens'],'optimized_tokens':_0x4642d7[_0x314f26(0x197)],'delta':_0x564053[_0x314f26(0x19d)](_0x4642d7['baseline_tokens'],_0x4642d7[_0x314f26(0x197)]),'rule_matched':_0x4642d7[_0x314f26(0x19f)]});}['getMetrics'](){return[...this['metrics']];}[_0x37eeeb(0x1ab)](){const _0x3c61f8=_0x37eeeb,_0x1641eb={'MZvue':function(_0x386822,_0x1493dd){return _0x386822-_0x1493dd;},'uonjU':function(_0x521ad3,_0x43da58){return _0x521ad3/_0x43da58;}},_0x549d8e=this[_0x3c61f8(0x1aa)]['reduce']((_0x3b5b6f,_0x48934e)=>_0x3b5b6f+_0x48934e[_0x3c61f8(0x1a8)],0x0),_0x4e8d6d=this[_0x3c61f8(0x1aa)][_0x3c61f8(0x1ac)]((_0x4765ec,_0x32956e)=>_0x4765ec+_0x32956e[_0x3c61f8(0x197)],0x0),_0x5892cf=_0x1641eb['MZvue'](_0x549d8e,_0x4e8d6d),_0x2e7e11={};for(const _0x536f29 of this['metrics'])_0x536f29['rule_matched']&&(_0x2e7e11[_0x536f29[_0x3c61f8(0x19f)]]=(_0x2e7e11[_0x536f29['rule_matched']]||0x0)+0x1);return{'session_id':this[_0x3c61f8(0x1a2)],'started_at':this['startedAt'],'ended_at':new Date()['toISOString'](),'total_baseline':_0x549d8e,'total_optimized':_0x4e8d6d,'total_delta':_0x5892cf,'savings_percent':_0x549d8e>0x0?_0x1641eb[_0x3c61f8(0x1a5)](_0x5892cf,_0x549d8e)*0x64:0x0,'prompts_count':this['metrics'][_0x3c61f8(0x1a4)],'rules_triggered':_0x2e7e11};}[_0x37eeeb(0x1b0)](){const _0x4cb4ae=_0x37eeeb,_0x4dd34c={'Quwpn':function(_0x5681f0,_0x362471,_0x14fe95){return _0x5681f0(_0x362471,_0x14fe95);},'pGiSt':function(_0x1d6295,_0x54fb64,_0xf46b9e,_0xb3bc0f){return _0x1d6295(_0x54fb64,_0xf46b9e,_0xb3bc0f);},'eAYfV':function(_0x19df83,_0x3f041d,_0x4e605d){return _0x19df83(_0x3f041d,_0x4e605d);},'URYiD':_0x4cb4ae(0x195)},_0x443546=_0x4dd34c[_0x4cb4ae(0x19e)](join,this[_0x4cb4ae(0x1a1)],METRICS_DIR);mkdirSync(_0x443546,{'recursive':!0x0});const _0x30dadb={'metrics':this[_0x4cb4ae(0x1aa)],'summary':this[_0x4cb4ae(0x1ab)]()};_0x4dd34c['pGiSt'](writeFileSync,_0x4dd34c[_0x4cb4ae(0x1ae)](join,_0x443546,this['sessionId']+_0x4cb4ae(0x1a3)),JSON[_0x4cb4ae(0x198)](_0x30dadb,null,0x2),_0x4dd34c[_0x4cb4ae(0x1a0)]);}}
1
+ function _0x5063(){const _0x43ea0a=['15zYdgmS','232404xTihDD','1179890ABpsVX','baseline_tokens','metrics','getSummary','sessionId','9RmooFQ','8736924ExiEvs','record','startedAt','toISOString','329KlIBGz','53898loQakx','66sqywqz','push','421912UKuiMN','Ptjkv','11hIZYaC','rule_matched','optimized_tokens','161474uOaZwU','hook_event','projectRoot','8621416ZMfdOX'];_0x5063=function(){return _0x43ea0a;};return _0x5063();}const _0x279c6a=_0x5a49;function _0x5a49(_0x198eaa,_0x50e39d){_0x198eaa=_0x198eaa-0x197;const _0x5063f6=_0x5063();let _0x5a494c=_0x5063f6[_0x198eaa];return _0x5a494c;}(function(_0x381424,_0x11e4dc){const _0x35980a=_0x5a49,_0x51bf12=_0x381424();while(!![]){try{const _0x554b19=-parseInt(_0x35980a(0x197))/0x1+parseInt(_0x35980a(0x1a8))/0x2*(-parseInt(_0x35980a(0x1a9))/0x3)+parseInt(_0x35980a(0x1ab))/0x4*(parseInt(_0x35980a(0x19b))/0x5)+-parseInt(_0x35980a(0x19c))/0x6*(-parseInt(_0x35980a(0x1a7))/0x7)+-parseInt(_0x35980a(0x19a))/0x8*(parseInt(_0x35980a(0x1a2))/0x9)+-parseInt(_0x35980a(0x19d))/0xa*(parseInt(_0x35980a(0x1ad))/0xb)+parseInt(_0x35980a(0x1a3))/0xc;if(_0x554b19===_0x11e4dc)break;else _0x51bf12['push'](_0x51bf12['shift']());}catch(_0x20016e){_0x51bf12['push'](_0x51bf12['shift']());}}}(_0x5063,0xdf62f));import{mkdirSync,writeFileSync}from'node:fs';import{join}from'node:path';const METRICS_DIR='.tokenizer-speedup';export class MetricsCollector{[_0x279c6a(0x19f)]=[];['sessionId'];[_0x279c6a(0x199)];[_0x279c6a(0x1a5)];constructor(_0x3d0ecd,_0x1b419d){const _0x25a06f=_0x279c6a;this['projectRoot']=_0x3d0ecd,this[_0x25a06f(0x1a1)]=_0x1b419d,this[_0x25a06f(0x1a5)]=new Date()['toISOString']();}[_0x279c6a(0x1a4)](_0xce93b0){const _0x5ba13c=_0x279c6a,_0x56459e={'Ptjkv':function(_0x3f0861,_0x40fdde){return _0x3f0861-_0x40fdde;}};this[_0x5ba13c(0x19f)][_0x5ba13c(0x1aa)]({'session_id':this['sessionId'],'timestamp':new Date()['toISOString'](),'hook_event':_0xce93b0[_0x5ba13c(0x198)],'baseline_tokens':_0xce93b0['baseline_tokens'],'optimized_tokens':_0xce93b0[_0x5ba13c(0x1af)],'delta':_0x56459e[_0x5ba13c(0x1ac)](_0xce93b0[_0x5ba13c(0x19e)],_0xce93b0['optimized_tokens']),'rule_matched':_0xce93b0[_0x5ba13c(0x1ae)]});}['getMetrics'](){return[...this['metrics']];}[_0x279c6a(0x1a0)](){const _0x66b903=_0x279c6a,_0x509281={'aDAmj':function(_0x428a52,_0x44d267){return _0x428a52-_0x44d267;},'mbMCN':function(_0x3dae49,_0x454f03){return _0x3dae49+_0x454f03;},'Yrdlg':function(_0x34051a,_0x23bd70){return _0x34051a>_0x23bd70;},'CJIbL':function(_0x4ba81e,_0xf98cc9){return _0x4ba81e/_0xf98cc9;}},_0xd7cd2b=this['metrics']['reduce']((_0x189234,_0x51d810)=>_0x189234+_0x51d810['baseline_tokens'],0x0),_0xdfe729=this[_0x66b903(0x19f)]['reduce']((_0x477a74,_0x6c12c9)=>_0x477a74+_0x6c12c9[_0x66b903(0x1af)],0x0),_0x3eec4d=_0x509281['aDAmj'](_0xd7cd2b,_0xdfe729),_0x37ac5a={};for(const _0x24c10d of this[_0x66b903(0x19f)])_0x24c10d[_0x66b903(0x1ae)]&&(_0x37ac5a[_0x24c10d['rule_matched']]=_0x509281['mbMCN'](_0x37ac5a[_0x24c10d[_0x66b903(0x1ae)]]||0x0,0x1));return{'session_id':this[_0x66b903(0x1a1)],'started_at':this['startedAt'],'ended_at':new Date()[_0x66b903(0x1a6)](),'total_baseline':_0xd7cd2b,'total_optimized':_0xdfe729,'total_delta':_0x3eec4d,'savings_percent':_0x509281['Yrdlg'](_0xd7cd2b,0x0)?_0x509281['CJIbL'](_0x3eec4d,_0xd7cd2b)*0x64:0x0,'prompts_count':this[_0x66b903(0x19f)]['length'],'rules_triggered':_0x37ac5a};}['flush'](){const _0x35cbfe=_0x279c6a,_0x1e0640={'NtylQ':function(_0x23f2f1,_0xaeb4c8,_0x2e3af7){return _0x23f2f1(_0xaeb4c8,_0x2e3af7);}},_0x24ef37=_0x1e0640['NtylQ'](join,this['projectRoot'],METRICS_DIR);_0x1e0640['NtylQ'](mkdirSync,_0x24ef37,{'recursive':!0x0});const _0x102017={'metrics':this[_0x35cbfe(0x19f)],'summary':this[_0x35cbfe(0x1a0)]()};writeFileSync(_0x1e0640['NtylQ'](join,_0x24ef37,this['sessionId']+'.json'),JSON['stringify'](_0x102017,null,0x2),'utf-8');}}
@@ -1 +1 @@
1
- function _0x24e8(_0x152179,_0x5a7767){_0x152179=_0x152179-0x15d;const _0x49b57b=_0x49b5();let _0x24e8d1=_0x49b57b[_0x152179];return _0x24e8d1;}(function(_0x41a8e3,_0xe4e5a0){const _0x50ceb4=_0x24e8,_0x3c22dc=_0x41a8e3();while(!![]){try{const _0x26f4c9=parseInt(_0x50ceb4(0x165))/0x1*(-parseInt(_0x50ceb4(0x167))/0x2)+parseInt(_0x50ceb4(0x173))/0x3*(-parseInt(_0x50ceb4(0x170))/0x4)+-parseInt(_0x50ceb4(0x175))/0x5*(-parseInt(_0x50ceb4(0x16a))/0x6)+-parseInt(_0x50ceb4(0x163))/0x7+-parseInt(_0x50ceb4(0x179))/0x8+parseInt(_0x50ceb4(0x16c))/0x9+parseInt(_0x50ceb4(0x15f))/0xa;if(_0x26f4c9===_0xe4e5a0)break;else _0x3c22dc['push'](_0x3c22dc['shift']());}catch(_0x8c0e53){_0x3c22dc['push'](_0x3c22dc['shift']());}}}(_0x49b5,0xe2455));import{existsSync,readdirSync}from'node:fs';import{join}from'node:path';import _0x3dbaaa from'js-yaml';export function detectProjectDocs(_0x29e4f9){const _0x274f10=_0x24e8,_0x5d9a28={'lHBDU':function(_0x16e311,_0x52a2e7,_0x1d23e9){return _0x16e311(_0x52a2e7,_0x1d23e9);},'PliYA':function(_0x5392e6,_0x2b3cc2){return _0x5392e6(_0x2b3cc2);},'OMZnP':'CLAUDE.md','QhmbU':_0x274f10(0x15e)},_0x21d6ec=_0x5d9a28['lHBDU'](join,_0x29e4f9,_0x274f10(0x16b)),_0x3ba73e=existsSync(_0x21d6ec),_0x4ee28b=_0x5d9a28['PliYA'](existsSync,_0x5d9a28['lHBDU'](join,_0x29e4f9,_0x5d9a28[_0x274f10(0x177)])),_0x2c5e86=existsSync(join(_0x29e4f9,_0x5d9a28[_0x274f10(0x16f)]));let _0x160875=[];if(_0x3ba73e)try{_0x160875=_0x5d9a28[_0x274f10(0x174)](readdirSync,_0x21d6ec,{'withFileTypes':!0x0})['filter'](_0x1b73ac=>_0x1b73ac[_0x274f10(0x164)]())[_0x274f10(0x161)](_0x4426d5=>_0x4426d5[_0x274f10(0x171)]);}catch{}return{'hasDocsDir':_0x3ba73e,'hasClaudeMd':_0x4ee28b,'hasLessonsLearned':_0x2c5e86,'docSubdirs':_0x160875};}function _0x49b5(){const _0x1337cd=['docs/lessons-learned','11632540yqrsCd','https://api.simosphereai.com/v1/meter','map','mRvhm','6316366StzbdM','isDirectory','1643qtGsFc','features/*.md','206aeLdtQ','docsDir','error','60GEozFP','docs','13649715gAYTeV','problem','design','QhmbU','14644hQTeUG','name','spec','843nnQvfD','lHBDU','416440hjklvZ','ZNPsL','OMZnP','ltNTN','3885248CGNqxL','bug'];_0x49b5=function(){return _0x1337cd;};return _0x49b5();}export function generateDefaultConfig(_0x291819){const _0x29d350=_0x24e8,_0x1a0236={'xGHfs':'fix','ZNPsL':_0x29d350(0x15d),'nTWho':_0x29d350(0x169),'ltNTN':_0x29d350(0x16e),'ZKWxM':'architecture','mRvhm':'refactor','pbWzS':'feature','LtpSC':_0x29d350(0x160)},_0x31fd54={'version':0x1,'rules':[{'trigger':[_0x1a0236['xGHfs'],_0x1a0236[_0x29d350(0x176)],_0x1a0236['nTWho'],_0x29d350(0x16d)],'load':_0x291819['docsDir']+'lessons-learned/*.md','max_tokens':0x7d0,'summary_only':!0x1},{'trigger':[_0x1a0236[_0x29d350(0x178)],_0x1a0236['ZKWxM'],_0x1a0236[_0x29d350(0x162)]],'load':_0x291819[_0x29d350(0x168)]+'decisions/*.md','max_tokens':0xbb8,'summary_only':!0x0},{'trigger':[_0x1a0236['pbWzS'],_0x29d350(0x172),'requirement'],'load':_0x291819['docsDir']+_0x29d350(0x166),'max_tokens':0xbb8,'summary_only':!0x0}],'context_limits':{'max_injected_tokens':0x1f40,'max_file_tokens':0xfa0,'compress_above':0xbb8},'metering':{'endpoint':_0x1a0236['LtpSC'],'batch_interval':0x3c,'send_content':!0x1}};return _0x3dbaaa['dump'](_0x31fd54,{'lineWidth':0x78});}
1
+ (function(_0x5127dc,_0x2ddb6f){const _0x58982b=_0x469f,_0x291fb7=_0x5127dc();while(!![]){try{const _0xb30e0c=-parseInt(_0x58982b(0x70))/0x1+-parseInt(_0x58982b(0x6f))/0x2*(-parseInt(_0x58982b(0x89))/0x3)+-parseInt(_0x58982b(0x7a))/0x4*(parseInt(_0x58982b(0x76))/0x5)+-parseInt(_0x58982b(0x7d))/0x6+-parseInt(_0x58982b(0x7e))/0x7*(parseInt(_0x58982b(0x71))/0x8)+-parseInt(_0x58982b(0x80))/0x9*(-parseInt(_0x58982b(0x85))/0xa)+-parseInt(_0x58982b(0x74))/0xb*(-parseInt(_0x58982b(0x7f))/0xc);if(_0xb30e0c===_0x2ddb6f)break;else _0x291fb7['push'](_0x291fb7['shift']());}catch(_0x3d93f0){_0x291fb7['push'](_0x291fb7['shift']());}}}(_0x2d78,0x2f7ce));function _0x469f(_0x2d13fd,_0x4f1a60){_0x2d13fd=_0x2d13fd-0x6b;const _0x2d785d=_0x2d78();let _0x469f78=_0x2d785d[_0x2d13fd];return _0x469f78;}import{existsSync,readdirSync}from'node:fs';import{join}from'node:path';import _0x4f374c from'js-yaml';export function detectProjectDocs(_0x297a54){const _0xce9465=_0x469f,_0x4aa5ad={'TcNqO':function(_0x1cb8dd,_0x2782d9,_0x4dbe2b){return _0x1cb8dd(_0x2782d9,_0x4dbe2b);},'FmPZt':'docs','HciYG':function(_0x14df2f,_0xcd2c04){return _0x14df2f(_0xcd2c04);},'HuBDU':function(_0x3d76a3,_0x5f5027,_0x405709){return _0x3d76a3(_0x5f5027,_0x405709);}},_0x3a7c81=_0x4aa5ad[_0xce9465(0x75)](join,_0x297a54,_0x4aa5ad[_0xce9465(0x82)]),_0x5515fd=_0x4aa5ad[_0xce9465(0x6c)](existsSync,_0x3a7c81),_0x3776a3=existsSync(join(_0x297a54,_0xce9465(0x77))),_0x2ab3a5=existsSync(_0x4aa5ad['TcNqO'](join,_0x297a54,_0xce9465(0x73)));let _0x58d091=[];if(_0x5515fd)try{_0x58d091=_0x4aa5ad['HuBDU'](readdirSync,_0x3a7c81,{'withFileTypes':!0x0})[_0xce9465(0x81)](_0xeaa5=>_0xeaa5[_0xce9465(0x6e)]())[_0xce9465(0x72)](_0x10eb49=>_0x10eb49[_0xce9465(0x87)]);}catch{}return{'hasDocsDir':_0x5515fd,'hasClaudeMd':_0x3776a3,'hasLessonsLearned':_0x2ab3a5,'docSubdirs':_0x58d091};}function _0x2d78(){const _0x3d8634=['map','docs/lessons-learned','2497XUTzBb','TcNqO','205sdnrog','CLAUDE.md','https://api.simosphereai.com/v1/meter','error','25348BGRaMM','features/*.md','problem','1055400CQNJBm','7siTgxe','40296WLSMKj','45TCEIoC','filter','FmPZt','lessons-learned/*.md','EWVgP','273310FmXqeZ','design','name','architecture','174QqiSji','fix','HciYG','requirement','isDirectory','8134HUiVap','121644iXKYzr','3063488hinHCv'];_0x2d78=function(){return _0x3d8634;};return _0x2d78();}export function generateDefaultConfig(_0x3932c8){const _0xda2872=_0x469f,_0x5b2062={'FvqxS':'bug','moMmt':_0xda2872(0x79),'jakky':_0xda2872(0x7c),'EWVgP':_0xda2872(0x88),'LrtOP':'refactor','cJUUh':_0xda2872(0x78)},_0x35ce88={'version':0x1,'rules':[{'trigger':[_0xda2872(0x6b),_0x5b2062['FvqxS'],_0x5b2062['moMmt'],_0x5b2062['jakky']],'load':_0x3932c8['docsDir']+_0xda2872(0x83),'max_tokens':0x7d0,'summary_only':!0x1},{'trigger':[_0xda2872(0x86),_0x5b2062[_0xda2872(0x84)],_0x5b2062['LrtOP']],'load':_0x3932c8['docsDir']+'decisions/*.md','max_tokens':0xbb8,'summary_only':!0x0},{'trigger':['feature','spec',_0xda2872(0x6d)],'load':_0x3932c8['docsDir']+_0xda2872(0x7b),'max_tokens':0xbb8,'summary_only':!0x0}],'context_limits':{'max_injected_tokens':0x1f40,'max_file_tokens':0xfa0,'compress_above':0xbb8},'metering':{'endpoint':_0x5b2062['cJUUh'],'batch_interval':0x3c,'send_content':!0x1}};return _0x4f374c['dump'](_0x35ce88,{'lineWidth':0x78});}
@@ -1 +1 @@
1
- (function(_0x14c87a,_0x5bdb79){const _0x4df410=_0x40fa,_0x22a67e=_0x14c87a();while(!![]){try{const _0x3e47d1=-parseInt(_0x4df410(0x70))/0x1+-parseInt(_0x4df410(0x6e))/0x2+-parseInt(_0x4df410(0x72))/0x3*(-parseInt(_0x4df410(0x78))/0x4)+parseInt(_0x4df410(0x73))/0x5*(-parseInt(_0x4df410(0x77))/0x6)+-parseInt(_0x4df410(0x82))/0x7+parseInt(_0x4df410(0x79))/0x8+parseInt(_0x4df410(0x87))/0x9*(parseInt(_0x4df410(0x85))/0xa);if(_0x3e47d1===_0x5bdb79)break;else _0x22a67e['push'](_0x22a67e['shift']());}catch(_0x4b9f4f){_0x22a67e['push'](_0x22a67e['shift']());}}}(_0x1734,0x90d60));import{compressContextBudget}from'./context-compressor.js';import{countTokens}from'../shared/token-counter.js';export function prioritizeContext(_0xb7a732,_0x45b990,_0x200892=0x4){const _0x2085d8=_0x40fa,_0x42c609={'iFdQO':function(_0x4707bf,_0x3cfe61){return _0x4707bf===_0x3cfe61;},'LMaJF':function(_0x1f5590,_0x3597ba){return _0x1f5590-_0x3597ba;},'oFAqe':function(_0x3cc655,_0x537e55){return _0x3cc655<_0x537e55;},'PoSIh':function(_0x38bcf2,_0x502d3c){return _0x38bcf2>_0x502d3c;},'ItnZF':function(_0x59d4c9,_0x29f397){return _0x59d4c9(_0x29f397);}};if(_0x42c609['iFdQO'](0x0,_0xb7a732[_0x2085d8(0x84)]))return{'prioritized':[],'totalOriginalTokens':0x0,'totalCompressedTokens':0x0,'segmentsDropped':0x0};const _0x397c8d=_0x45b990['max_injected_tokens'],_0x2725a4=_0xb7a732[_0x2085d8(0x7f)](_0x1f4624=>_0x2085d8(0x7a)===_0x1f4624[_0x2085d8(0x74)]),_0x702cf0=_0xb7a732[_0x2085d8(0x7f)](_0x50fe52=>'system'!==_0x50fe52['role']),_0x340a2c=Math['max'](0x0,_0x42c609[_0x2085d8(0x80)](_0x702cf0[_0x2085d8(0x84)],_0x200892)),_0x234e43=_0x702cf0[_0x2085d8(0x7e)](_0x340a2c),_0x1de4f6=_0x702cf0[_0x2085d8(0x7e)](0x0,_0x340a2c),_0x310b60=[];let _0x112c4c=0x0,_0x573590=0x0,_0x5478a7=0x0;for(const _0x564e5a of _0x2725a4){const _0xdbf51e=countTokens(_0x564e5a['content']);_0x112c4c+=_0xdbf51e,_0x573590+=_0xdbf51e,_0x310b60[_0x2085d8(0x7d)]({'role':_0x564e5a[_0x2085d8(0x74)],'content':_0x564e5a[_0x2085d8(0x7c)],'turnIndex':_0x564e5a[_0x2085d8(0x76)],'compressed':!0x1});}for(const _0x347e57 of _0x234e43){const _0x4cec0c=countTokens(_0x347e57['content']);_0x112c4c+=_0x4cec0c,_0x573590+=_0x4cec0c,_0x310b60['push']({'role':_0x347e57['role'],'content':_0x347e57[_0x2085d8(0x7c)],'turnIndex':_0x347e57[_0x2085d8(0x76)],'compressed':!0x1});}if(_0x1de4f6['length']>0x0){const _0x53971d=_0x573590,_0x30680d=Math[_0x2085d8(0x75)](0x0,_0x42c609[_0x2085d8(0x80)](_0x397c8d,_0x53971d));if(_0x30680d>0x0){const _0x2aaa30=_0x1de4f6['map'](_0x2d2a4d=>({'label':_0x2085d8(0x71)+_0x2d2a4d['turnIndex'],'text':_0x2d2a4d['content']})),_0x4ff7e6=compressContextBudget(_0x2aaa30,_0x30680d);for(let _0x366b34=0x0;_0x42c609['oFAqe'](_0x366b34,_0x1de4f6['length']);_0x366b34++){const _0x24558c=_0x1de4f6[_0x366b34],_0x4d55be=_0x4ff7e6[_0x366b34][_0x2085d8(0x81)];_0x112c4c+=_0x4d55be['originalTokens'],_0x42c609[_0x2085d8(0x86)](_0x4d55be['compressedTokens'],0x0)?(_0x573590+=_0x4d55be[_0x2085d8(0x7b)],_0x310b60[_0x2085d8(0x7d)]({'role':_0x24558c[_0x2085d8(0x74)],'content':_0x4d55be[_0x2085d8(0x83)],'turnIndex':_0x24558c['turnIndex'],'compressed':_0x4d55be[_0x2085d8(0x6f)]})):(_0x5478a7++,_0x112c4c+=0x0);}}else{for(const _0x33b501 of _0x1de4f6)_0x112c4c+=_0x42c609['ItnZF'](countTokens,_0x33b501['content']),_0x5478a7++;}}return _0x310b60[_0x2085d8(0x88)]((_0x52c4bd,_0xbee95b)=>_0x52c4bd[_0x2085d8(0x76)]-_0xbee95b['turnIndex']),{'prioritized':_0x310b60,'totalOriginalTokens':_0x112c4c,'totalCompressedTokens':_0x573590,'segmentsDropped':_0x5478a7};}function _0x40fa(_0x177487,_0x1a7f3b){_0x177487=_0x177487-0x6e;const _0x1734a6=_0x1734();let _0x40fab1=_0x1734a6[_0x177487];return _0x40fab1;}function _0x1734(){const _0x5acb4a=['length','3469530LfFuxu','PoSIh','63BJPHqZ','sort','721212CUTkxQ','wasTruncated','781556shNgnJ','turn-','9807uOEInI','1425bUEMme','role','max','turnIndex','1722zjBWaS','68CnlLws','3337576Xvocen','system','compressedTokens','content','push','slice','filter','LMaJF','result','7589652kEdCDb','text'];_0x1734=function(){return _0x5acb4a;};return _0x1734();}
1
+ (function(_0x3cda5a,_0x472dbe){const _0x284a8e=_0x4bd3,_0x296e73=_0x3cda5a();while(!![]){try{const _0x492e15=parseInt(_0x284a8e(0x149))/0x1*(parseInt(_0x284a8e(0x13b))/0x2)+parseInt(_0x284a8e(0x14e))/0x3*(parseInt(_0x284a8e(0x13c))/0x4)+-parseInt(_0x284a8e(0x135))/0x5*(parseInt(_0x284a8e(0x143))/0x6)+-parseInt(_0x284a8e(0x140))/0x7+parseInt(_0x284a8e(0x13a))/0x8*(parseInt(_0x284a8e(0x146))/0x9)+parseInt(_0x284a8e(0x134))/0xa*(parseInt(_0x284a8e(0x136))/0xb)+parseInt(_0x284a8e(0x13e))/0xc*(-parseInt(_0x284a8e(0x147))/0xd);if(_0x492e15===_0x472dbe)break;else _0x296e73['push'](_0x296e73['shift']());}catch(_0x2ce3e1){_0x296e73['push'](_0x296e73['shift']());}}}(_0x7b12,0x49c99));import{compressContextBudget}from'./context-compressor.js';function _0x4bd3(_0x200d2b,_0x1847ab){_0x200d2b=_0x200d2b-0x133;const _0x7b125c=_0x7b12();let _0x4bd3cc=_0x7b125c[_0x200d2b];return _0x4bd3cc;}import{countTokens}from'../shared/token-counter.js';export function prioritizeContext(_0x264d2d,_0x21273b,_0x4d1709=0x4){const _0x4d0ce1=_0x4bd3,_0x34a89f={'mcvXa':function(_0x158b00,_0x36dbe8){return _0x158b00===_0x36dbe8;},'zlBgq':function(_0x31a600,_0x3da662){return _0x31a600-_0x3da662;},'cgXSD':function(_0x5708b0,_0x5ba900){return _0x5708b0(_0x5ba900);},'PXJdE':function(_0x386199,_0x5c84fd){return _0x386199-_0x5c84fd;},'MBvEk':function(_0x16577e,_0x341c3f){return _0x16577e>_0x341c3f;},'sSWrC':function(_0x2b6957,_0x3a205b,_0x30da38){return _0x2b6957(_0x3a205b,_0x30da38);}};if(_0x34a89f[_0x4d0ce1(0x14c)](0x0,_0x264d2d[_0x4d0ce1(0x141)]))return{'prioritized':[],'totalOriginalTokens':0x0,'totalCompressedTokens':0x0,'segmentsDropped':0x0};const _0x312178=_0x21273b['max_injected_tokens'],_0x2b5750=_0x264d2d['filter'](_0x24309a=>_0x4d0ce1(0x144)===_0x24309a[_0x4d0ce1(0x133)]),_0xeb9597=_0x264d2d[_0x4d0ce1(0x145)](_0x5d365d=>_0x4d0ce1(0x144)!==_0x5d365d['role']),_0x4c45d7=Math[_0x4d0ce1(0x14a)](0x0,_0x34a89f[_0x4d0ce1(0x13f)](_0xeb9597[_0x4d0ce1(0x141)],_0x4d1709)),_0x59e2b=_0xeb9597['slice'](_0x4c45d7),_0x18bab0=_0xeb9597['slice'](0x0,_0x4c45d7),_0x40d446=[];let _0x201c72=0x0,_0x3b4ef5=0x0,_0x136279=0x0;for(const _0x3b775a of _0x2b5750){const _0x23a9f1=_0x34a89f['cgXSD'](countTokens,_0x3b775a['content']);_0x201c72+=_0x23a9f1,_0x3b4ef5+=_0x23a9f1,_0x40d446['push']({'role':_0x3b775a['role'],'content':_0x3b775a[_0x4d0ce1(0x139)],'turnIndex':_0x3b775a['turnIndex'],'compressed':!0x1});}for(const _0x226e51 of _0x59e2b){const _0x5ea902=countTokens(_0x226e51[_0x4d0ce1(0x139)]);_0x201c72+=_0x5ea902,_0x3b4ef5+=_0x5ea902,_0x40d446['push']({'role':_0x226e51[_0x4d0ce1(0x133)],'content':_0x226e51['content'],'turnIndex':_0x226e51[_0x4d0ce1(0x137)],'compressed':!0x1});}if(_0x18bab0[_0x4d0ce1(0x141)]>0x0){const _0x56d95a=_0x3b4ef5,_0x50106f=Math['max'](0x0,_0x34a89f['PXJdE'](_0x312178,_0x56d95a));if(_0x34a89f['MBvEk'](_0x50106f,0x0)){const _0x2171db=_0x18bab0[_0x4d0ce1(0x138)](_0x5e2c3b=>({'label':'turn-'+_0x5e2c3b['turnIndex'],'text':_0x5e2c3b[_0x4d0ce1(0x139)]})),_0xc3635f=_0x34a89f[_0x4d0ce1(0x148)](compressContextBudget,_0x2171db,_0x50106f);for(let _0x88f397=0x0;_0x88f397<_0x18bab0[_0x4d0ce1(0x141)];_0x88f397++){const _0x4c12fd=_0x18bab0[_0x88f397],_0x30f58c=_0xc3635f[_0x88f397]['result'];_0x201c72+=_0x30f58c[_0x4d0ce1(0x142)],_0x34a89f['MBvEk'](_0x30f58c[_0x4d0ce1(0x13d)],0x0)?(_0x3b4ef5+=_0x30f58c[_0x4d0ce1(0x13d)],_0x40d446['push']({'role':_0x4c12fd['role'],'content':_0x30f58c['text'],'turnIndex':_0x4c12fd['turnIndex'],'compressed':_0x30f58c[_0x4d0ce1(0x14d)]})):(_0x136279++,_0x201c72+=0x0);}}else{for(const _0x30a814 of _0x18bab0)_0x201c72+=countTokens(_0x30a814[_0x4d0ce1(0x139)]),_0x136279++;}}return _0x40d446[_0x4d0ce1(0x14b)]((_0xdc777b,_0x40a057)=>_0xdc777b[_0x4d0ce1(0x137)]-_0x40a057['turnIndex']),{'prioritized':_0x40d446,'totalOriginalTokens':_0x201c72,'totalCompressedTokens':_0x3b4ef5,'segmentsDropped':_0x136279};}function _0x7b12(){const _0x337006=['length','originalTokens','28758WxQcmv','system','filter','16722ZrSMGh','20709KKhEwP','sSWrC','7159MfNhsp','max','sort','mcvXa','wasTruncated','382125lwCZQE','role','91290pWczkK','485hGEKRo','682WtnxGm','turnIndex','map','content','1432jCRUmc','90IsUSNh','4LViaAW','compressedTokens','3480buLfSQ','zlBgq','832902YGbdlV'];_0x7b12=function(){return _0x337006;};return _0x7b12();}
@@ -1 +1 @@
1
- const _0x2fa841=_0xc1d4;(function(_0x4080ae,_0x12d8af){const _0x29d4ce=_0xc1d4,_0x4ff6e3=_0x4080ae();while(!![]){try{const _0x44e6d0=parseInt(_0x29d4ce(0xfb))/0x1+-parseInt(_0x29d4ce(0x100))/0x2*(parseInt(_0x29d4ce(0xf5))/0x3)+-parseInt(_0x29d4ce(0xf1))/0x4+parseInt(_0x29d4ce(0xf2))/0x5+-parseInt(_0x29d4ce(0x105))/0x6*(parseInt(_0x29d4ce(0xf7))/0x7)+parseInt(_0x29d4ce(0xf6))/0x8+parseInt(_0x29d4ce(0xfe))/0x9;if(_0x44e6d0===_0x12d8af)break;else _0x4ff6e3['push'](_0x4ff6e3['shift']());}catch(_0x1de147){_0x4ff6e3['push'](_0x4ff6e3['shift']());}}}(_0x17de,0x4e12c));function _0x17de(){const _0x5266f9=['.json','360ZAzcnM','3490448iSKevq','42KmKBuP','endsWith','prompts_count','entries','388837aUWZnF','map','reduce','8388432FzHzeB','jAQOS','9364hmFeRb','.tokenizer-speedup','utf-8','length','parse','417936TWsbOz','2140820CRzqoN','387890kmnjhk','started_at'];_0x17de=function(){return _0x5266f9;};return _0x17de();}import{readdirSync,readFileSync}from'node:fs';import{join}from'node:path';function _0xc1d4(_0x28b359,_0x3a83e1){_0x28b359=_0x28b359-0xf1;const _0x17de17=_0x17de();let _0xc1d478=_0x17de17[_0x28b359];return _0xc1d478;}const METRICS_DIR=_0x2fa841(0x101),COST_PER_MILLION_TOKENS=0x3;export function generateReport(_0x12f4b3){const _0x4f8dca=_0x2fa841,_0x30a74b={'jAQOS':function(_0x39a84a,_0x53371b){return _0x39a84a>_0x53371b;},'dDNvC':function(_0x106fd4,_0x1c6090){return _0x106fd4/_0x1c6090;}},_0x2c8959=join(_0x12f4b3,METRICS_DIR),_0x5f56a7=readdirSync(_0x2c8959)['filter'](_0x3d2a53=>_0x3d2a53[_0x4f8dca(0xf8)](_0x4f8dca(0xf4)))[_0x4f8dca(0xfc)](_0x2c6045=>JSON[_0x4f8dca(0x104)](readFileSync(join(_0x2c8959,_0x2c6045),_0x4f8dca(0x102)))['summary']),_0x5c2d7f=_0x5f56a7[_0x4f8dca(0xfd)]((_0x28a699,_0x711fc4)=>_0x28a699+_0x711fc4['total_baseline'],0x0),_0x1ff7bb=_0x5f56a7['reduce']((_0x43c373,_0x5236b9)=>_0x43c373+_0x5236b9['total_optimized'],0x0),_0x539e21=_0x5c2d7f-_0x1ff7bb,_0x4d76f1={};for(const _0x4a8d0a of _0x5f56a7)for(const [_0x59033a,_0x41ff86]of Object[_0x4f8dca(0xfa)](_0x4a8d0a['rules_triggered']))_0x4d76f1[_0x59033a]=(_0x4d76f1[_0x59033a]||0x0)+_0x41ff86;const _0x501198=_0x5f56a7[_0x4f8dca(0xfc)](_0x303a38=>_0x303a38[_0x4f8dca(0xf3)])['sort']();return{'sessions_count':_0x5f56a7[_0x4f8dca(0x103)],'total_baseline':_0x5c2d7f,'total_optimized':_0x1ff7bb,'total_delta':_0x539e21,'savings_percent':_0x30a74b[_0x4f8dca(0xff)](_0x5c2d7f,0x0)?_0x539e21/_0x5c2d7f*0x64:0x0,'total_prompts':_0x5f56a7[_0x4f8dca(0xfd)]((_0x27c279,_0x5b5cd0)=>_0x27c279+_0x5b5cd0[_0x4f8dca(0xf9)],0x0),'rules_triggered':_0x4d76f1,'estimated_cost_saved_usd':_0x30a74b['dDNvC'](_0x539e21,0xf4240)*0x3,'period_start':_0x501198[0x0]||'','period_end':_0x501198[_0x501198['length']-0x1]||''};}
1
+ function _0x3fcd(){const _0x52b861=['155886UEqhom','endsWith','7908065YXYuvp','1194XjtSxn','747504MHvlOC','kCBHM','parse','7789056tHDBKy','total_baseline','12ohWyvZ','1578TaXELe','reduce','aMwmD','583byoePr','41944XjGaxv','524eJfeua','144930RWgzZj','rules_triggered','prompts_count','summary','length','32HGiYmC'];_0x3fcd=function(){return _0x52b861;};return _0x3fcd();}(function(_0x3a75db,_0x5ad3a7){const _0x4b60a6=_0x45aa,_0x542931=_0x3a75db();while(!![]){try{const _0x25f689=-parseInt(_0x4b60a6(0x115))/0x1*(-parseInt(_0x4b60a6(0x104))/0x2)+-parseInt(_0x4b60a6(0x10b))/0x3*(parseInt(_0x4b60a6(0x114))/0x4)+parseInt(_0x4b60a6(0x10d))/0x5+parseInt(_0x4b60a6(0x10e))/0x6*(-parseInt(_0x4b60a6(0x103))/0x7)+-parseInt(_0x4b60a6(0x10a))/0x8*(-parseInt(_0x4b60a6(0x10f))/0x9)+parseInt(_0x4b60a6(0x105))/0xa*(-parseInt(_0x4b60a6(0x102))/0xb)+parseInt(_0x4b60a6(0x112))/0xc;if(_0x25f689===_0x5ad3a7)break;else _0x542931['push'](_0x542931['shift']());}catch(_0x25fbab){_0x542931['push'](_0x542931['shift']());}}}(_0x3fcd,0xd1f22));function _0x45aa(_0x562873,_0x1a1797){_0x562873=_0x562873-0x101;const _0x3fcd9d=_0x3fcd();let _0x45aa32=_0x3fcd9d[_0x562873];return _0x45aa32;}import{readdirSync,readFileSync}from'node:fs';import{join}from'node:path';const METRICS_DIR='.tokenizer-speedup',COST_PER_MILLION_TOKENS=0x3;export function generateReport(_0xef8ee0){const _0x487d24=_0x45aa,_0x5d45bf={'kCBHM':function(_0x5db164,_0x4d4c94){return _0x5db164(_0x4d4c94);},'aMwmD':function(_0x2f296f,_0xbff987){return _0x2f296f>_0xbff987;}},_0x58e155=join(_0xef8ee0,METRICS_DIR),_0x5c38b2=_0x5d45bf[_0x487d24(0x110)](readdirSync,_0x58e155)['filter'](_0x13870f=>_0x13870f[_0x487d24(0x10c)]('.json'))['map'](_0x27cea4=>JSON[_0x487d24(0x111)](readFileSync(join(_0x58e155,_0x27cea4),'utf-8'))[_0x487d24(0x108)]),_0x435ce7=_0x5c38b2['reduce']((_0x1d017c,_0x16dec2)=>_0x1d017c+_0x16dec2[_0x487d24(0x113)],0x0),_0x16eede=_0x5c38b2[_0x487d24(0x116)]((_0x408cc1,_0x571b81)=>_0x408cc1+_0x571b81['total_optimized'],0x0),_0x53bd0f=_0x435ce7-_0x16eede,_0x5c5b07={};for(const _0x3535a6 of _0x5c38b2)for(const [_0x10f56e,_0x53068d]of Object['entries'](_0x3535a6[_0x487d24(0x106)]))_0x5c5b07[_0x10f56e]=(_0x5c5b07[_0x10f56e]||0x0)+_0x53068d;const _0x2b88f9=_0x5c38b2['map'](_0x37c0e2=>_0x37c0e2['started_at'])['sort']();return{'sessions_count':_0x5c38b2[_0x487d24(0x109)],'total_baseline':_0x435ce7,'total_optimized':_0x16eede,'total_delta':_0x53bd0f,'savings_percent':_0x5d45bf[_0x487d24(0x101)](_0x435ce7,0x0)?_0x53bd0f/_0x435ce7*0x64:0x0,'total_prompts':_0x5c38b2['reduce']((_0x52eb5b,_0x2cdede)=>_0x52eb5b+_0x2cdede[_0x487d24(0x107)],0x0),'rules_triggered':_0x5c5b07,'estimated_cost_saved_usd':_0x53bd0f/0xf4240*0x3,'period_start':_0x2b88f9[0x0]||'','period_end':_0x2b88f9[_0x2b88f9['length']-0x1]||''};}
@@ -1 +1 @@
1
- function _0x2b49(){const _0x301d34=['3314jvULtY','315993fPMySA','3215760IuZFCk','totalTokensSaved','parse','525epShRj','1314096wYuTAV','IgaQX','rule','10MwFAXn','getRanking','8245818DBBmXf','6BkuNVi','465305WqUzRK','875812lvYURM','fires'];_0x2b49=function(){return _0x301d34;};return _0x2b49();}(function(_0x5bce8b,_0x247997){const _0xb854fd=_0x55f1,_0x2fe63b=_0x5bce8b();while(!![]){try{const _0x148928=parseInt(_0xb854fd(0x1d8))/0x1+-parseInt(_0xb854fd(0x1d7))/0x2*(-parseInt(_0xb854fd(0x1dc))/0x3)+parseInt(_0xb854fd(0x1d5))/0x4+-parseInt(_0xb854fd(0x1d4))/0x5*(-parseInt(_0xb854fd(0x1d3))/0x6)+-parseInt(_0xb854fd(0x1dd))/0x7+parseInt(_0xb854fd(0x1d9))/0x8+-parseInt(_0xb854fd(0x1d2))/0x9*(parseInt(_0xb854fd(0x1d0))/0xa);if(_0x148928===_0x247997)break;else _0x2fe63b['push'](_0x2fe63b['shift']());}catch(_0x161bb4){_0x2fe63b['push'](_0x2fe63b['shift']());}}}(_0x2b49,0x34bd6));function _0x55f1(_0x4e5bea,_0x5106c6){_0x4e5bea=_0x4e5bea-0x1ce;const _0x2b4952=_0x2b49();let _0x55f1e6=_0x2b4952[_0x4e5bea];return _0x55f1e6;}import{RuleAnalytics}from'./rule-analytics.js';export function serializeAnalytics(_0x1b95c8){const _0x39cf96=_0x55f1,_0x249b9d=_0x1b95c8[_0x39cf96(0x1d1)]()['map'](_0x52f682=>({'rule':_0x52f682[_0x39cf96(0x1cf)],'fires':_0x52f682['fires'],'totalTokensSaved':_0x52f682[_0x39cf96(0x1da)]}));return JSON['stringify'](_0x249b9d);}export function deserializeAnalytics(_0x1acaf8){const _0x448b06=_0x55f1,_0x5a7a3c={'IgaQX':function(_0x12fcda,_0x235844){return _0x12fcda>_0x235844;},'hfvzS':function(_0x25b7d8,_0x2e91ea){return _0x25b7d8<_0x2e91ea;}},_0x457c17=new RuleAnalytics();try{const _0x2d7647=JSON[_0x448b06(0x1db)](_0x1acaf8);for(const _0x34b5c5 of _0x2d7647){const _0x32f69d=_0x5a7a3c[_0x448b06(0x1ce)](_0x34b5c5['fires'],0x0)?Math['round'](_0x34b5c5['totalTokensSaved']/_0x34b5c5['fires']):0x0;for(let _0x47dad2=0x0;_0x5a7a3c['hfvzS'](_0x47dad2,_0x34b5c5[_0x448b06(0x1d6)]);_0x47dad2++)_0x457c17['recordFire'](_0x34b5c5[_0x448b06(0x1cf)],_0x32f69d);}}catch{}return _0x457c17;}
1
+ (function(_0x5eec73,_0x44e72b){const _0x4915d7=_0x2687,_0x2d794f=_0x5eec73();while(!![]){try{const _0x57a3bc=parseInt(_0x4915d7(0x19d))/0x1+-parseInt(_0x4915d7(0x198))/0x2*(parseInt(_0x4915d7(0x1a0))/0x3)+-parseInt(_0x4915d7(0x196))/0x4*(parseInt(_0x4915d7(0x19f))/0x5)+-parseInt(_0x4915d7(0x19c))/0x6+-parseInt(_0x4915d7(0x1a4))/0x7*(parseInt(_0x4915d7(0x1a1))/0x8)+parseInt(_0x4915d7(0x19b))/0x9+-parseInt(_0x4915d7(0x194))/0xa*(-parseInt(_0x4915d7(0x1a3))/0xb);if(_0x57a3bc===_0x44e72b)break;else _0x2d794f['push'](_0x2d794f['shift']());}catch(_0x5662ab){_0x2d794f['push'](_0x2d794f['shift']());}}}(_0x13ae,0xf1fb7));import{RuleAnalytics}from'./rule-analytics.js';export function serializeAnalytics(_0x3d0fd7){const _0x2be718=_0x2687,_0x4e13e2=_0x3d0fd7[_0x2be718(0x199)]()[_0x2be718(0x1a2)](_0x4fd6a4=>({'rule':_0x4fd6a4[_0x2be718(0x19a)],'fires':_0x4fd6a4[_0x2be718(0x19e)],'totalTokensSaved':_0x4fd6a4['totalTokensSaved']}));return JSON['stringify'](_0x4e13e2);}function _0x13ae(){const _0x5a0558=['7UAheDs','parse','10pwWhyx','dPgRk','21916kMRWEQ','qSmqI','57244WahIIe','getRanking','rule','12778263NtDJtA','2070264RjfIzu','1713581XmfPKm','fires','1005RQosNe','21CtyGUV','8958424VLyJSa','map','6866761EheoJJ'];_0x13ae=function(){return _0x5a0558;};return _0x13ae();}function _0x2687(_0x56782c,_0x49ec92){_0x56782c=_0x56782c-0x194;const _0x13ae10=_0x13ae();let _0x268758=_0x13ae10[_0x56782c];return _0x268758;}export function deserializeAnalytics(_0x4e632e){const _0x235b5c=_0x2687,_0x3c4b4b={'qSmqI':function(_0x54a363,_0xe20f6a){return _0x54a363/_0xe20f6a;},'dPgRk':function(_0x5be478,_0x4a0bce){return _0x5be478<_0x4a0bce;}},_0x555e9a=new RuleAnalytics();try{const _0x118515=JSON[_0x235b5c(0x1a5)](_0x4e632e);for(const _0x4bfc97 of _0x118515){const _0x2074b7=_0x4bfc97[_0x235b5c(0x19e)]>0x0?Math['round'](_0x3c4b4b[_0x235b5c(0x197)](_0x4bfc97['totalTokensSaved'],_0x4bfc97['fires'])):0x0;for(let _0x4d4d4f=0x0;_0x3c4b4b[_0x235b5c(0x195)](_0x4d4d4f,_0x4bfc97['fires']);_0x4d4d4f++)_0x555e9a['recordFire'](_0x4bfc97['rule'],_0x2074b7);}}catch{}return _0x555e9a;}
@@ -1 +1 @@
1
- const _0x1a3ec6=_0x2ef9;(function(_0x11e7ee,_0xfc95d5){const _0x5849f3=_0x2ef9,_0x491e55=_0x11e7ee();while(!![]){try{const _0x78e444=parseInt(_0x5849f3(0x73))/0x1+-parseInt(_0x5849f3(0x79))/0x2*(-parseInt(_0x5849f3(0x78))/0x3)+-parseInt(_0x5849f3(0x7c))/0x4*(-parseInt(_0x5849f3(0x83))/0x5)+-parseInt(_0x5849f3(0x7f))/0x6*(parseInt(_0x5849f3(0x7b))/0x7)+parseInt(_0x5849f3(0x7e))/0x8*(-parseInt(_0x5849f3(0x74))/0x9)+-parseInt(_0x5849f3(0x77))/0xa*(-parseInt(_0x5849f3(0x82))/0xb)+parseInt(_0x5849f3(0x72))/0xc;if(_0x78e444===_0xfc95d5)break;else _0x491e55['push'](_0x491e55['shift']());}catch(_0x2310e3){_0x491e55['push'](_0x491e55['shift']());}}}(_0x2997,0xd275e));function _0x2ef9(_0x24fe22,_0x1643b2){_0x24fe22=_0x24fe22-0x6e;const _0x2997ec=_0x2997();let _0x2ef96e=_0x2997ec[_0x24fe22];return _0x2ef96e;}export class RuleAnalytics{[_0x1a3ec6(0x7d)]=new Map();['recordFire'](_0x33fb77,_0x383517){const _0x8cf9dc=_0x1a3ec6,_0x53e818=this['data'][_0x8cf9dc(0x71)](_0x33fb77)??{'fires':0x0,'totalTokensSaved':0x0};_0x53e818[_0x8cf9dc(0x81)]++,_0x53e818[_0x8cf9dc(0x80)]+=_0x383517,this['data'][_0x8cf9dc(0x70)](_0x33fb77,_0x53e818);}[_0x1a3ec6(0x76)](_0x4b29a5){const _0x435ea7=_0x1a3ec6,_0x214872={'AZRNR':function(_0x24648a,_0x3f6f6b){return _0x24648a/_0x3f6f6b;}},_0x54a410=this['data'][_0x435ea7(0x71)](_0x4b29a5);return _0x54a410?{'rule':_0x4b29a5,'fires':_0x54a410['fires'],'totalTokensSaved':_0x54a410[_0x435ea7(0x80)],'avgTokensSaved':Math[_0x435ea7(0x7a)](_0x214872['AZRNR'](_0x54a410[_0x435ea7(0x80)],_0x54a410['fires']))}:{'rule':_0x4b29a5,'fires':0x0,'totalTokensSaved':0x0,'avgTokensSaved':0x0};}['getRanking'](){const _0xf72b53=_0x1a3ec6;return Array['from'](this['data'][_0xf72b53(0x75)]())['map'](_0x203497=>this[_0xf72b53(0x76)](_0x203497))[_0xf72b53(0x6f)]((_0xb183dc,_0x58394f)=>_0x58394f[_0xf72b53(0x6e)]-_0xb183dc[_0xf72b53(0x6e)]);}}function _0x2997(){const _0x1f0f1e=['getStats','1547530vtBjCv','21WJSMDC','214666WEQEVq','round','84QSFRzb','4tbSXHe','data','4952aByrPi','601776iByDjr','totalTokensSaved','fires','22hMKuNi','7786690KWOBHG','avgTokensSaved','sort','set','get','11213472fOLYMC','213979uGPYwH','24732TMycuS','keys'];_0x2997=function(){return _0x1f0f1e;};return _0x2997();}
1
+ const _0x32f514=_0x109c;(function(_0x3fbbef,_0x136bbf){const _0xac8513=_0x109c,_0x5781b6=_0x3fbbef();while(!![]){try{const _0x193567=parseInt(_0xac8513(0x1c8))/0x1+parseInt(_0xac8513(0x1d2))/0x2+parseInt(_0xac8513(0x1cf))/0x3*(parseInt(_0xac8513(0x1da))/0x4)+parseInt(_0xac8513(0x1d1))/0x5+parseInt(_0xac8513(0x1c9))/0x6*(parseInt(_0xac8513(0x1ca))/0x7)+parseInt(_0xac8513(0x1d6))/0x8*(parseInt(_0xac8513(0x1d0))/0x9)+-parseInt(_0xac8513(0x1d7))/0xa;if(_0x193567===_0x136bbf)break;else _0x5781b6['push'](_0x5781b6['shift']());}catch(_0x15b4de){_0x5781b6['push'](_0x5781b6['shift']());}}}(_0x5bea,0x301c8));export class RuleAnalytics{[_0x32f514(0x1cc)]=new Map();['recordFire'](_0x519f64,_0x10ae23){const _0x218720=_0x32f514,_0x3a54dc=this[_0x218720(0x1cc)][_0x218720(0x1d3)](_0x519f64)??{'fires':0x0,'totalTokensSaved':0x0};_0x3a54dc['fires']++,_0x3a54dc['totalTokensSaved']+=_0x10ae23,this[_0x218720(0x1cc)][_0x218720(0x1d8)](_0x519f64,_0x3a54dc);}[_0x32f514(0x1cd)](_0x4e0ce4){const _0x5b43dd=_0x32f514,_0x35c100=this['data'][_0x5b43dd(0x1d3)](_0x4e0ce4);return _0x35c100?{'rule':_0x4e0ce4,'fires':_0x35c100['fires'],'totalTokensSaved':_0x35c100[_0x5b43dd(0x1db)],'avgTokensSaved':Math['round'](_0x35c100[_0x5b43dd(0x1db)]/_0x35c100[_0x5b43dd(0x1d9)])}:{'rule':_0x4e0ce4,'fires':0x0,'totalTokensSaved':0x0,'avgTokensSaved':0x0};}['getRanking'](){const _0x8c14f6=_0x32f514;return Array[_0x8c14f6(0x1dc)](this[_0x8c14f6(0x1cc)][_0x8c14f6(0x1d4)]())[_0x8c14f6(0x1cb)](_0x1bb7f5=>this['getStats'](_0x1bb7f5))[_0x8c14f6(0x1ce)]((_0xba5178,_0x2e541b)=>_0x2e541b[_0x8c14f6(0x1d5)]-_0xba5178['avgTokensSaved']);}}function _0x109c(_0x86f57b,_0x33f624){_0x86f57b=_0x86f57b-0x1c8;const _0x5bea2b=_0x5bea();let _0x109c81=_0x5bea2b[_0x86f57b];return _0x109c81;}function _0x5bea(){const _0x43e4bc=['avgTokensSaved','72KEdlkO','12646930QpSqpf','set','fires','148lXLcLG','totalTokensSaved','from','86130DaETFh','178296Uiayhw','42jEzXNr','map','data','getStats','sort','14973ungJvC','392724GhkXNO','1345090xdgahr','701844GUBpeI','get','keys'];_0x5bea=function(){return _0x43e4bc;};return _0x5bea();}
@@ -1 +1 @@
1
- function _0x4334(_0x3d9a9d,_0x4daa16){_0x3d9a9d=_0x3d9a9d-0x106;const _0x1a4339=_0x1a43();let _0x4334ab=_0x1a4339[_0x3d9a9d];return _0x4334ab;}const _0x413f59=_0x4334;(function(_0x1a6bab,_0x43bb93){const _0x4ae5cb=_0x4334,_0x2a90a3=_0x1a6bab();while(!![]){try{const _0x544954=-parseInt(_0x4ae5cb(0x117))/0x1*(-parseInt(_0x4ae5cb(0x10b))/0x2)+-parseInt(_0x4ae5cb(0x108))/0x3*(parseInt(_0x4ae5cb(0x118))/0x4)+-parseInt(_0x4ae5cb(0x116))/0x5*(-parseInt(_0x4ae5cb(0x109))/0x6)+-parseInt(_0x4ae5cb(0x106))/0x7+-parseInt(_0x4ae5cb(0x113))/0x8+parseInt(_0x4ae5cb(0x110))/0x9+-parseInt(_0x4ae5cb(0x10d))/0xa;if(_0x544954===_0x43bb93)break;else _0x2a90a3['push'](_0x2a90a3['shift']());}catch(_0x4e2d53){_0x2a90a3['push'](_0x2a90a3['shift']());}}}(_0x1a43,0xb0e29));function _0x1a43(){const _0x519825=['97628oOYNOZ','4gLiCRG','2022825zWiJKQ','filter','1744287FOgXMw','6VmoTCg','some','20SeFtOu','limits','458240mvsOdC','rules','toLowerCase','9314730RpGrls','includes','context_limits','8021712LEdrPc','meteringConfig','config','3161065XqwbSc'];_0x1a43=function(){return _0x519825;};return _0x1a43();}export class RuleEngine{['rules'];[_0x413f59(0x10c)];[_0x413f59(0x115)];constructor(_0x587acb){const _0x18ac73=_0x413f59;this[_0x18ac73(0x115)]=_0x587acb,this['rules']=_0x587acb[_0x18ac73(0x10e)],this['limits']=_0x587acb[_0x18ac73(0x112)];}['match'](_0x41c9b6){const _0x3f4c71=_0x413f59,_0x585730=_0x41c9b6['toLowerCase']();return this[_0x3f4c71(0x10e)][_0x3f4c71(0x107)](_0x254680=>_0x254680['trigger'][_0x3f4c71(0x10a)](_0x54b511=>_0x585730[_0x3f4c71(0x111)](_0x54b511[_0x3f4c71(0x10f)]())));}get[_0x413f59(0x114)](){return this['config']['metering'];}}
1
+ function _0x2931(_0x28ce9c,_0x56f4ea){_0x28ce9c=_0x28ce9c-0x1e4;const _0x53b219=_0x53b2();let _0x2931a1=_0x53b219[_0x28ce9c];return _0x2931a1;}function _0x53b2(){const _0x48861e=['1662ittZeu','some','7284456WmNXoi','228012dqTrgu','180484LjGZVy','10TtPHTm','metering','filter','27040WrhXSC','match','includes','24437ePUClr','3240uyQTjX','context_limits','toLowerCase','443531iGaShE','344802DQJJpc','15mZWUyz','config','rules'];_0x53b2=function(){return _0x48861e;};return _0x53b2();}const _0x8c4d0e=_0x2931;(function(_0x274c81,_0x3cc7d7){const _0x1ccd22=_0x2931,_0x2fc8ef=_0x274c81();while(!![]){try{const _0x4c4f91=parseInt(_0x1ccd22(0x1ec))/0x1+parseInt(_0x1ccd22(0x1ee))/0x2*(-parseInt(_0x1ccd22(0x1e5))/0x3)+parseInt(_0x1ccd22(0x1ed))/0x4*(parseInt(_0x1ccd22(0x1e6))/0x5)+parseInt(_0x1ccd22(0x1e9))/0x6*(-parseInt(_0x1ccd22(0x1f4))/0x7)+parseInt(_0x1ccd22(0x1eb))/0x8+-parseInt(_0x1ccd22(0x1f5))/0x9*(-parseInt(_0x1ccd22(0x1f1))/0xa)+-parseInt(_0x1ccd22(0x1e4))/0xb;if(_0x4c4f91===_0x3cc7d7)break;else _0x2fc8ef['push'](_0x2fc8ef['shift']());}catch(_0x10ee4a){_0x2fc8ef['push'](_0x2fc8ef['shift']());}}}(_0x53b2,0xa271e));export class RuleEngine{[_0x8c4d0e(0x1e8)];['limits'];['config'];constructor(_0x3206c6){const _0x44e162=_0x8c4d0e;this[_0x44e162(0x1e7)]=_0x3206c6,this['rules']=_0x3206c6[_0x44e162(0x1e8)],this['limits']=_0x3206c6[_0x44e162(0x1f6)];}[_0x8c4d0e(0x1f2)](_0x1dc992){const _0x303d1c=_0x8c4d0e,_0x225993=_0x1dc992[_0x303d1c(0x1f7)]();return this['rules'][_0x303d1c(0x1f0)](_0x26c1e3=>_0x26c1e3['trigger'][_0x303d1c(0x1ea)](_0x57e8af=>_0x225993[_0x303d1c(0x1f3)](_0x57e8af['toLowerCase']())));}get['meteringConfig'](){const _0x3579d8=_0x8c4d0e;return this[_0x3579d8(0x1e7)][_0x3579d8(0x1ef)];}}
@@ -1 +1 @@
1
- (function(_0x547c57,_0xfc7be3){const _0x15f44c=_0x3654,_0x3db087=_0x547c57();while(!![]){try{const _0x478c25=parseInt(_0x15f44c(0x10e))/0x1+-parseInt(_0x15f44c(0x10f))/0x2*(parseInt(_0x15f44c(0x101))/0x3)+-parseInt(_0x15f44c(0x108))/0x4*(-parseInt(_0x15f44c(0x105))/0x5)+parseInt(_0x15f44c(0xff))/0x6*(parseInt(_0x15f44c(0x112))/0x7)+-parseInt(_0x15f44c(0x10a))/0x8*(parseInt(_0x15f44c(0x111))/0x9)+parseInt(_0x15f44c(0x10b))/0xa*(parseInt(_0x15f44c(0x100))/0xb)+-parseInt(_0x15f44c(0x10d))/0xc;if(_0x478c25===_0xfc7be3)break;else _0x3db087['push'](_0x3db087['shift']());}catch(_0x3e2499){_0x3db087['push'](_0x3db087['shift']());}}}(_0x2163,0x40476));function _0x2163(){const _0x1f3cb7=['1449300KPZwwz','494030QFLYAa','13312vONctN','map','666SNpNlR','103761RGuOOG','custom-rules','24qmKsuY','649HvBZGz','129iQBJTP','rules','author','trigger','1261705gtfrza','FTScV','unknown','4HHrzul','name','52040WJQgni','58640cYTLZc','load'];_0x2163=function(){return _0x1f3cb7;};return _0x2163();}import _0xaf2f52 from'js-yaml';export function exportRuleBundle(_0x308197,_0x4d2d54){const _0x3a0447=_0x3654,_0x14df48={'name':_0x4d2d54['name']??_0x3a0447(0xfe),'author':_0x4d2d54[_0x3a0447(0x103)],'description':_0x4d2d54['description'],'rules':_0x308197};return _0xaf2f52['dump'](_0x14df48,{'lineWidth':0x78});}export function importRuleBundle(_0x3e12af){const _0x381301=_0x3654,_0x35c382={'OBDtR':_0x381301(0x107)},_0x784e12=_0xaf2f52[_0x381301(0x10c)](_0x3e12af);return{'name':_0x784e12[_0x381301(0x109)]??'imported','author':_0x784e12[_0x381301(0x103)]??_0x35c382['OBDtR'],'description':_0x784e12['description']??'','rules':(_0x784e12['rules']??[])[_0x381301(0x110)](_0x5d7526=>({'trigger':_0x5d7526[_0x381301(0x104)],'load':_0x5d7526['load'],'max_tokens':_0x5d7526['max_tokens'],'summary_only':_0x5d7526['summary_only']}))};}function _0x3654(_0x11f5cc,_0xa84e51){_0x11f5cc=_0x11f5cc-0xfe;const _0x21633e=_0x2163();let _0x36549c=_0x21633e[_0x11f5cc];return _0x36549c;}export function validateRuleBundle(_0x409173){const _0x4650a2=_0x3654,_0x4f4232={'wsFOx':function(_0xe197e9,_0x280e58){return _0xe197e9!=_0x280e58;},'KaVWR':'invalid\x20YAML\x20structure','WAoYk':function(_0x283020,_0x50e8e0){return _0x283020===_0x50e8e0;},'FTScV':'invalid\x20YAML'};try{const _0x3905c7=_0xaf2f52['load'](_0x409173);if(!_0x3905c7||_0x4f4232['wsFOx']('object',typeof _0x3905c7))return{'valid':!0x1,'error':_0x4f4232['KaVWR']};if(!Array['isArray'](_0x3905c7['rules'])||_0x4f4232['WAoYk'](0x0,_0x3905c7[_0x4650a2(0x102)]['length']))return{'valid':!0x1,'error':'bundle\x20must\x20contain\x20rules\x20array'};for(const _0x4a4954 of _0x3905c7[_0x4650a2(0x102)])if(!Array['isArray'](_0x4a4954[_0x4650a2(0x104)])||!_0x4a4954['load'])return{'valid':!0x1,'error':'each\x20rule\x20must\x20have\x20trigger\x20array\x20and\x20load\x20path'};return{'valid':!0x0};}catch{return{'valid':!0x1,'error':_0x4f4232[_0x4650a2(0x106)]};}}
1
+ function _0x6ab7(){const _0x192176=['dump','trigger','PlXAX','5797584JWoRzz','GczDA','1142616wxHzQH','length','2359494NotSJi','name','load','invalid\x20YAML','TwtVZ','217752ttOrvu','KpjYs','object','742096wuUniK','rules','isArray','hEUYf','custom-rules','ulwNf','imported','774775DTVGgG','133tdrTRU','238544qScNKM','summary_only','max_tokens','10lTPRgC'];_0x6ab7=function(){return _0x192176;};return _0x6ab7();}(function(_0x467f09,_0x358fba){const _0x4374e1=_0x54b4,_0x1a0ff1=_0x467f09();while(!![]){try{const _0x273c29=parseInt(_0x4374e1(0x1e3))/0x1+-parseInt(_0x4374e1(0x1f8))/0x2+-parseInt(_0x4374e1(0x1f0))/0x3+parseInt(_0x4374e1(0x1f5))/0x4+-parseInt(_0x4374e1(0x1e8))/0x5*(parseInt(_0x4374e1(0x1ee))/0x6)+parseInt(_0x4374e1(0x1e4))/0x7*(parseInt(_0x4374e1(0x1e5))/0x8)+parseInt(_0x4374e1(0x1ec))/0x9;if(_0x273c29===_0x358fba)break;else _0x1a0ff1['push'](_0x1a0ff1['shift']());}catch(_0x412afd){_0x1a0ff1['push'](_0x1a0ff1['shift']());}}}(_0x6ab7,0x7a709));function _0x54b4(_0x363a4b,_0x5e03a3){_0x363a4b=_0x363a4b-0x1e1;const _0x6ab70a=_0x6ab7();let _0x54b403=_0x6ab70a[_0x363a4b];return _0x54b403;}import _0x565d72 from'js-yaml';export function exportRuleBundle(_0x28bfc4,_0x59f2dd){const _0x50c3d7=_0x54b4,_0x4755c6={'TwtVZ':_0x50c3d7(0x1fc)},_0x2601dc={'name':_0x59f2dd[_0x50c3d7(0x1f1)]??_0x4755c6[_0x50c3d7(0x1f4)],'author':_0x59f2dd['author'],'description':_0x59f2dd['description'],'rules':_0x28bfc4};return _0x565d72[_0x50c3d7(0x1e9)](_0x2601dc,{'lineWidth':0x78});}export function importRuleBundle(_0x2604bf){const _0x938712=_0x54b4,_0x538043={'vjcYO':_0x938712(0x1e2),'SKuPx':'unknown'},_0x45f7de=_0x565d72[_0x938712(0x1f2)](_0x2604bf);return{'name':_0x45f7de['name']??_0x538043['vjcYO'],'author':_0x45f7de['author']??_0x538043['SKuPx'],'description':_0x45f7de['description']??'','rules':(_0x45f7de[_0x938712(0x1f9)]??[])['map'](_0x1fa68a=>({'trigger':_0x1fa68a['trigger'],'load':_0x1fa68a[_0x938712(0x1f2)],'max_tokens':_0x1fa68a[_0x938712(0x1e7)],'summary_only':_0x1fa68a[_0x938712(0x1e6)]}))};}export function validateRuleBundle(_0x10c140){const _0x52ed90=_0x54b4,_0x441c3b={'KpjYs':function(_0x534efb,_0x52254e){return _0x534efb!=_0x52254e;},'ulwNf':_0x52ed90(0x1f7),'hEUYf':'invalid\x20YAML\x20structure','PlXAX':'bundle\x20must\x20contain\x20rules\x20array','GczDA':_0x52ed90(0x1f3)};try{const _0x546778=_0x565d72['load'](_0x10c140);if(!_0x546778||_0x441c3b[_0x52ed90(0x1f6)](_0x441c3b[_0x52ed90(0x1e1)],typeof _0x546778))return{'valid':!0x1,'error':_0x441c3b[_0x52ed90(0x1fb)]};if(!Array[_0x52ed90(0x1fa)](_0x546778['rules'])||0x0===_0x546778[_0x52ed90(0x1f9)][_0x52ed90(0x1ef)])return{'valid':!0x1,'error':_0x441c3b[_0x52ed90(0x1eb)]};for(const _0x17f772 of _0x546778['rules'])if(!Array['isArray'](_0x17f772[_0x52ed90(0x1ea)])||!_0x17f772['load'])return{'valid':!0x1,'error':'each\x20rule\x20must\x20have\x20trigger\x20array\x20and\x20load\x20path'};return{'valid':!0x0};}catch{return{'valid':!0x1,'error':_0x441c3b[_0x52ed90(0x1ed)]};}}
@@ -1 +1 @@
1
- function _0x258e(_0x55670c,_0x410a1d){_0x55670c=_0x55670c-0x18b;const _0x5c5b82=_0x5c5b();let _0x258eb8=_0x5c5b82[_0x55670c];return _0x258eb8;}const _0xb91c02=_0x258e;(function(_0x1dedfa,_0x3753e6){const _0x2a92a3=_0x258e,_0x4bea64=_0x1dedfa();while(!![]){try{const _0x2a3f8d=parseInt(_0x2a92a3(0x1a0))/0x1*(-parseInt(_0x2a92a3(0x199))/0x2)+parseInt(_0x2a92a3(0x18d))/0x3+parseInt(_0x2a92a3(0x1a2))/0x4+parseInt(_0x2a92a3(0x18e))/0x5*(parseInt(_0x2a92a3(0x191))/0x6)+-parseInt(_0x2a92a3(0x19e))/0x7+parseInt(_0x2a92a3(0x1a1))/0x8*(-parseInt(_0x2a92a3(0x18f))/0x9)+parseInt(_0x2a92a3(0x1a6))/0xa*(parseInt(_0x2a92a3(0x196))/0xb);if(_0x2a3f8d===_0x3753e6)break;else _0x4bea64['push'](_0x4bea64['shift']());}catch(_0x5d2b63){_0x4bea64['push'](_0x4bea64['shift']());}}}(_0x5c5b,0xd4838));const STOP_WORDS=new Set(['the','a','an','is',_0xb91c02(0x198),_0xb91c02(0x1a5),'were','be','been','to','of','in',_0xb91c02(0x197),'on',_0xb91c02(0x19b),'at','by',_0xb91c02(0x193),'it','this','that',_0xb91c02(0x18b),'or',_0xb91c02(0x194),'not','no','i','my','me','we','our',_0xb91c02(0x195),'your']);function _0x5c5b(){const _0x1675c2=['replace','was','300XGPNOD','get','and','filter','3920937VOFeCe','4570wDNSBv','284310nvWzSz','sBkkH','4626oFPgJh','sort','from','but','you','84073eoeeHP','for','are','982kgcJuE','has','with','trigger','split','6132595zUrPBw','entries','1127VCPSFk','144IaxKdo','2510220XkfXbN','toLowerCase'];_0x5c5b=function(){return _0x1675c2;};return _0x5c5b();}export function suggestRules(_0x9eb151,_0x10a881,_0x31518f){const _0x18c369=_0xb91c02,_0x4b5a26={'sBkkH':function(_0x1ac36e,_0x2daa77){return _0x1ac36e+_0x2daa77;}},_0x47ec6c=new Set();for(const _0x44a55e of _0x9eb151)for(const _0x44d1d4 of _0x44a55e[_0x18c369(0x19c)])_0x47ec6c['add'](_0x44d1d4[_0x18c369(0x1a3)]());const _0x1f5d2b=new Map();for(const _0xf72bb5 of _0x10a881){const _0x2ef3f1=_0xf72bb5['toLowerCase']()[_0x18c369(0x19d)](/\s+/);for(const _0x924da0 of _0x2ef3f1){const _0x87ce6=_0x924da0[_0x18c369(0x1a4)](/[^a-z0-9-]/g,'');_0x87ce6['length']<0x3||STOP_WORDS[_0x18c369(0x19a)](_0x87ce6)||_0x47ec6c[_0x18c369(0x19a)](_0x87ce6)||_0x1f5d2b['set'](_0x87ce6,_0x4b5a26[_0x18c369(0x190)](_0x1f5d2b[_0x18c369(0x1a7)](_0x87ce6)??0x0,0x1));}}return Array['from'](_0x1f5d2b[_0x18c369(0x19f)]())[_0x18c369(0x18c)](([,_0x51276e])=>_0x51276e>=_0x31518f)[_0x18c369(0x192)](([,_0x2c4dfe],[,_0x3e8256])=>_0x3e8256-_0x2c4dfe)['map'](([_0x408b53,_0x34bbab])=>({'keyword':_0x408b53,'frequency':_0x34bbab,'suggestedLoad':'docs/'+_0x408b53+'/*.md'}));}
1
+ const _0x495877=_0x5112;function _0x5112(_0x30c489,_0x12cb71){_0x30c489=_0x30c489-0xef;const _0x16cad2=_0x16ca();let _0x511265=_0x16cad2[_0x30c489];return _0x511265;}function _0x16ca(){const _0x3e0f56=['split','4513384VsKdXZ','length','filter','123949AGENYY','set','that','34650HdGPpj','toLowerCase','was','the','9lLJvzK','not','2VDYeJh','820344JRSdcV','WwErW','adyxD','334872WjXNrO','replace','our','sort','add','has','get','885590XLVKPb','this','982122ngPfFU','for'];_0x16ca=function(){return _0x3e0f56;};return _0x16ca();}(function(_0x42069b,_0x17aead){const _0x38fc4e=_0x5112,_0x6a91ad=_0x42069b();while(!![]){try{const _0x375428=-parseInt(_0x38fc4e(0x102))/0x1*(parseInt(_0x38fc4e(0xef))/0x2)+parseInt(_0x38fc4e(0x105))/0x3+-parseInt(_0x38fc4e(0xf3))/0x4+-parseInt(_0x38fc4e(0xfa))/0x5+-parseInt(_0x38fc4e(0xfc))/0x6+parseInt(_0x38fc4e(0xf0))/0x7+-parseInt(_0x38fc4e(0xff))/0x8*(-parseInt(_0x38fc4e(0x109))/0x9);if(_0x375428===_0x17aead)break;else _0x6a91ad['push'](_0x6a91ad['shift']());}catch(_0x3ad184){_0x6a91ad['push'](_0x6a91ad['shift']());}}}(_0x16ca,0x2343b));const STOP_WORDS=new Set([_0x495877(0x108),'a','an','is','are',_0x495877(0x107),'were','be','been','to','of','in',_0x495877(0xfd),'on','with','at','by','from','it',_0x495877(0xfb),_0x495877(0x104),'and','or','but',_0x495877(0x10a),'no','i','my','me','we',_0x495877(0xf5),'you','your']);export function suggestRules(_0x310360,_0x428734,_0x28728e){const _0x335949=_0x495877,_0x4bd67c={'adyxD':function(_0x25e999,_0x5db473){return _0x25e999<_0x5db473;},'WwErW':function(_0x2bbb85,_0x2fc21b){return _0x2bbb85+_0x2fc21b;}},_0x41e486=new Set();for(const _0x2d52fa of _0x310360)for(const _0x38144a of _0x2d52fa['trigger'])_0x41e486[_0x335949(0xf7)](_0x38144a[_0x335949(0x106)]());const _0x1d87e8=new Map();for(const _0xca04b3 of _0x428734){const _0x381cc5=_0xca04b3[_0x335949(0x106)]()[_0x335949(0xfe)](/\s+/);for(const _0xb65396 of _0x381cc5){const _0x5cfed9=_0xb65396[_0x335949(0xf4)](/[^a-z0-9-]/g,'');_0x4bd67c[_0x335949(0xf2)](_0x5cfed9[_0x335949(0x100)],0x3)||STOP_WORDS['has'](_0x5cfed9)||_0x41e486[_0x335949(0xf8)](_0x5cfed9)||_0x1d87e8[_0x335949(0x103)](_0x5cfed9,_0x4bd67c[_0x335949(0xf1)](_0x1d87e8[_0x335949(0xf9)](_0x5cfed9)??0x0,0x1));}}return Array['from'](_0x1d87e8['entries']())[_0x335949(0x101)](([,_0x387310])=>_0x387310>=_0x28728e)[_0x335949(0xf6)](([,_0x2372d6],[,_0x481715])=>_0x481715-_0x2372d6)['map'](([_0x134e6e,_0x6b280d])=>({'keyword':_0x134e6e,'frequency':_0x6b280d,'suggestedLoad':'docs/'+_0x134e6e+'/*.md'}));}
@@ -1 +1 @@
1
- function _0x2abe(){const _0x5ce7b1=['git\x20branch\x20--show-current','EWKXL','69808SyetUX','5559448zUhsul','detached','akIIk','length','\x20Lessons\x20Learned\x20vorhanden\x20in\x20docs/lessons-learned/','_template.md','endsWith','9nBGcPq','git\x20log\x20--oneline\x20-1','docs/lessons-learned','\x20|\x20','pJWXg','DNA\x203:\x20','jREUG','filter','jLWeT','push','6904366lKFlMm','772601IzpMNA','10591998bmTyWq','41073660eZKfdV','ZQOxE','trim','300AiPTrc','4RblSwj','173499wyqOah'];_0x2abe=function(){return _0x5ce7b1;};return _0x2abe();}function _0x3e43(_0x3c960e,_0x5254c0){_0x3c960e=_0x3c960e-0x100;const _0x2abe1f=_0x2abe();let _0x3e4304=_0x2abe1f[_0x3c960e];return _0x3e4304;}(function(_0x170cec,_0x23e121){const _0x39f534=_0x3e43,_0x5df447=_0x170cec();while(!![]){try{const _0x32b02b=-parseInt(_0x39f534(0x100))/0x1+parseInt(_0x39f534(0x106))/0x2*(parseInt(_0x39f534(0x107))/0x3)+-parseInt(_0x39f534(0x10a))/0x4*(parseInt(_0x39f534(0x105))/0x5)+-parseInt(_0x39f534(0x101))/0x6+parseInt(_0x39f534(0x11c))/0x7+-parseInt(_0x39f534(0x10b))/0x8*(parseInt(_0x39f534(0x112))/0x9)+parseInt(_0x39f534(0x102))/0xa;if(_0x32b02b===_0x23e121)break;else _0x5df447['push'](_0x5df447['shift']());}catch(_0x495c31){_0x5df447['push'](_0x5df447['shift']());}}}(_0x2abe,0xe2e69));import{execSync}from'node:child_process';import{readdirSync}from'node:fs';import{join}from'node:path';export function buildSessionStartContext(_0x73b40a){const _0x5029ba=_0x3e43,_0x4695e7={'ZQOxE':function(_0x572fbd,_0x3d8d58,_0x2b6461){return _0x572fbd(_0x3d8d58,_0x2b6461);},'EWKXL':'utf-8','jREUG':'pipe','pJWXg':_0x5029ba(0x10c),'AzUyn':_0x5029ba(0x113),'jLWeT':function(_0x46d580,_0x987e85,_0x11a322){return _0x46d580(_0x987e85,_0x11a322);},'akIIk':function(_0x712b22,_0xd73185){return _0x712b22>_0xd73185;}},{cwd:_0x326676}=_0x73b40a;if(!_0x326676)return{};const _0x12b636=[];try{const _0x264b1a=_0x4695e7[_0x5029ba(0x103)](execSync,_0x5029ba(0x108),{'cwd':_0x326676,'encoding':_0x4695e7['EWKXL'],'stdio':['pipe',_0x4695e7[_0x5029ba(0x118)],_0x4695e7[_0x5029ba(0x118)]]})['trim']()||_0x4695e7[_0x5029ba(0x116)],_0x1e0a4d=execSync(_0x4695e7['AzUyn'],{'cwd':_0x326676,'encoding':_0x4695e7[_0x5029ba(0x109)],'stdio':['pipe','pipe',_0x4695e7[_0x5029ba(0x118)]]})[_0x5029ba(0x104)]();_0x12b636[_0x5029ba(0x11b)]('Git:\x20'+_0x264b1a+_0x5029ba(0x115)+_0x1e0a4d);}catch{}try{const _0x4540ca=_0x4695e7[_0x5029ba(0x11a)](join,_0x326676,_0x5029ba(0x114)),_0x2a41c9=readdirSync(_0x4540ca)[_0x5029ba(0x119)](_0x28abb0=>_0x28abb0[_0x5029ba(0x111)]('.md')&&_0x5029ba(0x110)!==_0x28abb0);_0x4695e7[_0x5029ba(0x10d)](_0x2a41c9['length'],0x0)&&_0x12b636[_0x5029ba(0x11b)](_0x5029ba(0x117)+_0x2a41c9[_0x5029ba(0x10e)]+_0x5029ba(0x10f));}catch{}return 0x0===_0x12b636['length']?{}:{'additionalContext':_0x12b636['join']('\x0a')};}
1
+ (function(_0x3143dd,_0x23b89f){const _0x369120=_0x221f,_0x4c7861=_0x3143dd();while(!![]){try{const _0x6e38bc=parseInt(_0x369120(0x105))/0x1*(parseInt(_0x369120(0x103))/0x2)+-parseInt(_0x369120(0xf3))/0x3*(parseInt(_0x369120(0xfc))/0x4)+parseInt(_0x369120(0x106))/0x5*(parseInt(_0x369120(0xf6))/0x6)+parseInt(_0x369120(0xf4))/0x7*(-parseInt(_0x369120(0x107))/0x8)+-parseInt(_0x369120(0x102))/0x9+-parseInt(_0x369120(0xfd))/0xa*(parseInt(_0x369120(0xfb))/0xb)+parseInt(_0x369120(0xef))/0xc;if(_0x6e38bc===_0x23b89f)break;else _0x4c7861['push'](_0x4c7861['shift']());}catch(_0x41c508){_0x4c7861['push'](_0x4c7861['shift']());}}}(_0x270b,0xeedb9));function _0x221f(_0xe052ba,_0x5d488c){_0xe052ba=_0xe052ba-0xee;const _0x270bd5=_0x270b();let _0x221f1d=_0x270bd5[_0xe052ba];return _0x221f1d;}import{execSync}from'node:child_process';import{readdirSync}from'node:fs';import{join}from'node:path';export function buildSessionStartContext(_0x1fcef8){const _0x410ae3=_0x221f,_0x5a3561={'xpcxW':function(_0x204e71,_0x1cf9c5,_0x2d6f2e){return _0x204e71(_0x1cf9c5,_0x2d6f2e);},'BMFzV':_0x410ae3(0xfe),'nPzAi':'pipe','XpBsA':_0x410ae3(0x101),'GKRpU':function(_0x26ce3a,_0x407d3,_0x1e5665){return _0x26ce3a(_0x407d3,_0x1e5665);},'jZMvT':'docs/lessons-learned','XwhXs':function(_0x2c3e31,_0x38ec71){return _0x2c3e31===_0x38ec71;}},{cwd:_0x522905}=_0x1fcef8;if(!_0x522905)return{};const _0x4bfb4a=[];try{const _0x4545d5=_0x5a3561[_0x410ae3(0xf9)](execSync,_0x410ae3(0xfa),{'cwd':_0x522905,'encoding':_0x5a3561[_0x410ae3(0xf8)],'stdio':[_0x410ae3(0xff),_0x5a3561[_0x410ae3(0x100)],_0x5a3561['nPzAi']]})['trim']()||_0x5a3561['XpBsA'],_0x5d1ed9=execSync('git\x20log\x20--oneline\x20-1',{'cwd':_0x522905,'encoding':_0x410ae3(0xfe),'stdio':['pipe','pipe',_0x410ae3(0xff)]})['trim']();_0x4bfb4a['push']('Git:\x20'+_0x4545d5+_0x410ae3(0xf7)+_0x5d1ed9);}catch{}try{const _0x19268d=_0x5a3561['GKRpU'](join,_0x522905,_0x5a3561['jZMvT']),_0x7392c9=readdirSync(_0x19268d)[_0x410ae3(0xf2)](_0x3619bc=>_0x3619bc[_0x410ae3(0xee)](_0x410ae3(0xf1))&&'_template.md'!==_0x3619bc);_0x7392c9[_0x410ae3(0xf0)]>0x0&&_0x4bfb4a[_0x410ae3(0xf5)](_0x410ae3(0x104)+_0x7392c9[_0x410ae3(0xf0)]+'\x20Lessons\x20Learned\x20vorhanden\x20in\x20docs/lessons-learned/');}catch{}return _0x5a3561['XwhXs'](0x0,_0x4bfb4a[_0x410ae3(0xf0)])?{}:{'additionalContext':_0x4bfb4a['join']('\x0a')};}function _0x270b(){const _0x41c24a=['DNA\x203:\x20','1393529Veibdm','8583915EApceJ','56dFDGmZ','endsWith','9129504KAlWeP','length','.md','filter','612ihfSOA','20181pyqGBW','push','6AXsarq','\x20|\x20','BMFzV','xpcxW','git\x20branch\x20--show-current','2261842ewzdZb','24664OdCJqQ','60FKSAJM','utf-8','pipe','nPzAi','detached','3428694CDunlW','2PkHtIm'];_0x270b=function(){return _0x41c24a;};return _0x270b();}