@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.
- package/.claude-plugin/plugin.json +1 -1
- package/README-plugin.md +17 -1
- package/README.de.md +41 -1
- package/README.md +41 -1
- package/dist/cli/analyze.js +1 -1
- package/dist/cli/config-cmd.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/init-cmd.js +1 -1
- package/dist/cli/setup-cmd.js +1 -1
- package/dist/cloud/stripe-checkout.js +1 -1
- package/dist/cloud/stripe-config.js +1 -1
- package/dist/cloud/stripe-usage.js +1 -1
- package/dist/cloud/stripe-webhooks.js +1 -1
- package/dist/cloud/subscription-store.js +1 -1
- package/dist/manifest.json +37 -37
- package/dist/mcp/index.js +1 -1
- package/dist/mcp/resources.js +1 -1
- package/dist/mcp/session.js +1 -1
- package/dist/mcp/tools.js +1 -1
- package/dist/plugin/cli.js +1 -1
- package/dist/plugin/config-loader.js +1 -1
- package/dist/plugin/context-compressor.js +1 -1
- package/dist/plugin/hook-dispatcher.js +1 -1
- package/dist/plugin/metering-client.js +1 -1
- package/dist/plugin/metrics-collector.js +1 -1
- package/dist/plugin/onboarding.js +1 -1
- package/dist/plugin/precompact-handler.js +1 -1
- package/dist/plugin/report.js +1 -1
- package/dist/plugin/rule-analytics-store.js +1 -1
- package/dist/plugin/rule-analytics.js +1 -1
- package/dist/plugin/rule-engine.js +1 -1
- package/dist/plugin/rule-sharing.js +1 -1
- package/dist/plugin/rule-suggest.js +1 -1
- package/dist/plugin/session-start.js +1 -1
- package/dist/plugin/smart-context.js +1 -1
- package/dist/shared/license.js +1 -1
- package/dist/shared/providers/claude-provider.js +1 -1
- package/dist/shared/providers/openai-provider.js +1 -1
- package/dist/shared/token-counter.js +1 -1
- package/dist/shared/token-provider.js +1 -1
- package/package.json +1 -1
package/dist/mcp/session.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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
|
-
|
|
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)}]};});}
|
package/dist/plugin/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
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
|
|
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(
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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(
|
|
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();}
|
package/dist/plugin/report.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
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
|
-
|
|
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
|
|
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
|
|
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(
|
|
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
|
|
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
|
-
|
|
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();}
|