@simosphere/tokenizer-speedup 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +49 -45
- 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/compression/anonymize.js +1 -0
- package/dist/plugin/compression/cache.js +1 -0
- package/dist/plugin/compression/chunked.js +1 -1
- package/dist/plugin/compression/dedup.js +1 -0
- package/dist/plugin/compression/format-optimizer.js +1 -0
- package/dist/plugin/compression/index.js +1 -1
- package/dist/plugin/compression/pipeline.js +1 -1
- package/dist/plugin/compression/quality.js +1 -1
- package/dist/plugin/compression/rule-based.js +1 -1
- package/dist/plugin/compression/structural.js +1 -1
- package/dist/plugin/compression/text-utils.js +1 -1
- package/dist/plugin/compression/token-budget.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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x2b0754=_0x3d07;function _0x54a6(){const _0x3de042=['charCodeAt','694368uTHyND','211818HfSomf','3504834IlqTfc','dateOfBirth','53OPRyQI','919224TcWIlL','set','Hiwok','1255905eyEbHN','OpRId','padStart','ZGcma','1966HUJgpm','join','type','regex','DE00-ANON-','flags','replacements','customerId','length','0.0.0.','ipv4','jkRBV','BGFHd','KBbdz','sort','550904ZuWnNA','01.01.1970-','14pEGWSI','SIhwL','entries'];_0x54a6=function(){return _0x3de042;};return _0x54a6();}(function(_0x2ce119,_0x4cc73f){const _0x5d04a4=_0x3d07,_0x3b5019=_0x2ce119();while(!![]){try{const _0x57ce3f=-parseInt(_0x5d04a4(0x136))/0x1*(parseInt(_0x5d04a4(0x13e))/0x2)+parseInt(_0x5d04a4(0x133))/0x3+parseInt(_0x5d04a4(0x137))/0x4+-parseInt(_0x5d04a4(0x13a))/0x5+-parseInt(_0x5d04a4(0x132))/0x6+-parseInt(_0x5d04a4(0x12e))/0x7*(parseInt(_0x5d04a4(0x12c))/0x8)+parseInt(_0x5d04a4(0x134))/0x9;if(_0x57ce3f===_0x4cc73f)break;else _0x3b5019['push'](_0x3b5019['shift']());}catch(_0x56abb1){_0x3b5019['push'](_0x3b5019['shift']());}}}(_0x54a6,0x207f0));import{countTokens}from'../../shared/token-counter.js';function _0x3d07(_0x2c9500,_0x2b39e1){_0x2c9500=_0x2c9500-0x127;const _0x54a605=_0x54a6();let _0x3d07c6=_0x54a605[_0x2c9500];return _0x3d07c6;}function simpleHash(_0x42b01b){const _0x291f08=_0x3d07,_0x306eb7={'Hiwok':function(_0x4e235d,_0x39f3c0){return _0x4e235d<_0x39f3c0;},'KBbdz':function(_0x2b4af6,_0x539609){return _0x2b4af6-_0x539609;},'BGFHd':function(_0x5925cb,_0x3b5a90){return _0x5925cb<<_0x3b5a90;}};let _0x11038b=0x0;for(let _0x8eb720=0x0;_0x306eb7[_0x291f08(0x139)](_0x8eb720,_0x42b01b['length']);_0x8eb720++)_0x11038b=_0x306eb7[_0x291f08(0x12a)](_0x306eb7[_0x291f08(0x129)](_0x11038b,0x5),_0x11038b)+_0x42b01b[_0x291f08(0x131)](_0x8eb720)|0x0;return Math['abs'](_0x11038b)['toString'](0x10)['slice'](0x0,0x4)['toUpperCase']()[_0x291f08(0x13c)](0x4,'0');}const PII_PATTERNS=[{'type':'email','regex':/[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}/g,'buildPseudonym':_0x30fe5d=>'user_'+_0x30fe5d+'@example.redacted'},{'type':'iban','regex':/\bDE\d{2}\s?\d{4}\s?\d{4}\s?\d{4}\s?\d{4}\s?\d{2}\b/g,'buildPseudonym':_0x4b83f3=>_0x2b0754(0x142)+_0x4b83f3},{'type':'phone','regex':/(?:\+\d{1,3}[\s\-]?)?(?:\(?\d{2,5}\)?[\s\-]?)?\d{3,}[\s\-]?\d{2,}/g,'buildPseudonym':_0x31e33c=>'+49-ANON-'+_0x31e33c},{'type':_0x2b0754(0x145),'regex':/\b(?:KD|KDN|ORD)-[A-Z0-9\-]{4,12}\b/g,'buildPseudonym':_0x52a5c0=>'KD-ANON-'+_0x52a5c0},{'type':_0x2b0754(0x135),'regex':/\b(?:\d{2}\.\d{2}\.\d{4}|\d{4}-\d{2}-\d{2})\b/g,'buildPseudonym':_0x5c6391=>_0x2b0754(0x12d)+_0x5c6391},{'type':_0x2b0754(0x127),'regex':/\b(?:\d{1,3}\.){3}\d{1,3}\b/g,'buildPseudonym':_0x147b6a=>_0x2b0754(0x147)+_0x147b6a},{'type':'address','regex':/[A-ZÄÖÜ][a-zäöüß]+(?:str\.|straße|stra(?:ss|ß)e|weg|gasse|platz|allee|ring|damm)\s+\d{1,4}\s*[a-z]?\s*,\s*\d{5}\s+[A-ZÄÖÜ][a-zäöüß\-]+/g,'buildPseudonym':_0x24a89b=>'Anonymstr.\x201,\x2000000\x20Anon-'+_0x24a89b}];export function anonymizeText(_0x422431){const _0x105f8c=_0x2b0754,_0x28b981={'ZGcma':function(_0x1e65fc,_0x40cc78){return _0x1e65fc(_0x40cc78);}},_0x3e540b=new Map(),_0xee313a=new Set(),_0x5840f4=new Map();let _0x23c566=_0x422431;for(const _0x34d789 of PII_PATTERNS){const _0x204830=new RegExp(_0x34d789['regex']['source'],_0x34d789[_0x105f8c(0x141)][_0x105f8c(0x143)]),_0x454a83=_0x23c566['match'](_0x204830);if(!_0x454a83)continue;const _0xbc4f66=[...new Set(_0x454a83)]['sort']((_0x48f0d5,_0x315a36)=>_0x315a36[_0x105f8c(0x146)]-_0x48f0d5[_0x105f8c(0x146)]);for(const _0x3707e6 of _0xbc4f66){if(_0x5840f4['has'](_0x3707e6))continue;const _0x2e25df=_0x28b981[_0x105f8c(0x13d)](simpleHash,_0x3707e6),_0x224be3=_0x34d789['buildPseudonym'](_0x2e25df);_0x5840f4[_0x105f8c(0x138)](_0x3707e6,_0x224be3),_0x3e540b[_0x105f8c(0x138)](_0x224be3,_0x3707e6),_0xee313a['add'](_0x34d789[_0x105f8c(0x140)]),_0x23c566=_0x23c566['split'](_0x3707e6)['join'](_0x224be3);}}return{'text':_0x23c566,'map':{'replacements':_0x3e540b,'piiTypesFound':[..._0xee313a]}};}export function deanonymizeText(_0x339c40,_0x599873){const _0x1a2fb7=_0x2b0754;let _0x5c713e=_0x339c40;const _0x5bcefc=[..._0x599873[_0x1a2fb7(0x144)][_0x1a2fb7(0x130)]()][_0x1a2fb7(0x12b)](([_0x411419],[_0x24a635])=>_0x24a635[_0x1a2fb7(0x146)]-_0x411419['length']);for(const [_0x2c77ca,_0x1e5bb9]of _0x5bcefc)_0x5c713e=_0x5c713e['split'](_0x2c77ca)['join'](_0x1e5bb9);return _0x5c713e;}export const anonymizeStrategy={'name':'pii-anonymize','compress'(_0x3aa80c,_0x416799){const _0x553cd1=_0x2b0754,_0x517608={'jkRBV':function(_0x53cf6b,_0x248838){return _0x53cf6b(_0x248838);},'OpRId':function(_0x1f11eb,_0x23038f){return _0x1f11eb(_0x23038f);},'SIhwL':function(_0x112b47,_0x5394e2){return _0x112b47>_0x5394e2;},'UPxkl':function(_0x3db449,_0xabea84){return _0x3db449-_0xabea84;}},_0x28696e=_0x517608[_0x553cd1(0x128)](countTokens,_0x3aa80c),{text:_0x4db566,map:_0x316eaf}=_0x517608[_0x553cd1(0x13b)](anonymizeText,_0x3aa80c),_0x3ee1c9=countTokens(_0x4db566);return{'text':_0x4db566,'originalTokens':_0x28696e,'compressedTokens':_0x3ee1c9,'compressionRatio':_0x517608[_0x553cd1(0x12f)](_0x28696e,0x0)?_0x517608['UPxkl'](0x1,_0x3ee1c9/_0x28696e):0x0,'strategyUsed':'pii-anonymize\x20('+_0x316eaf['piiTypesFound'][_0x553cd1(0x13f)](',\x20')+')','qualityEstimate':0x1,'wasTruncated':!0x1};}};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x160256=_0x113f;function _0x44f2(){const _0x560bb5=['wijzB','stats','size','set','3220956GSuDTh','HlWcu','2438697iNEzJw','clear','32VmyAru','missCount','next','has','150wbxkld','result','euTOg','egbai','22gXtXGm','delete','expiresAt','maxEntries','NQXnE','81980XEyeFs','HLKrF','entries','abs','2182311VxHbbn','now','328363gdtOlk','get','hitCount','compress','ttlMs','4928780SKuORi','237730ggZetQ'];_0x44f2=function(){return _0x560bb5;};return _0x44f2();}(function(_0x8e3fb6,_0x18b567){const _0x5603a2=_0x113f,_0x1ff68b=_0x8e3fb6();while(!![]){try{const _0x1d0174=-parseInt(_0x5603a2(0x1b9))/0x1*(parseInt(_0x5603a2(0x1b4))/0x2)+parseInt(_0x5603a2(0x1cc))/0x3+-parseInt(_0x5603a2(0x1ca))/0x4+-parseInt(_0x5603a2(0x1c5))/0x5*(-parseInt(_0x5603a2(0x1d2))/0x6)+parseInt(_0x5603a2(0x1bf))/0x7+parseInt(_0x5603a2(0x1ce))/0x8*(parseInt(_0x5603a2(0x1bd))/0x9)+-parseInt(_0x5603a2(0x1c4))/0xa;if(_0x1d0174===_0x18b567)break;else _0x1ff68b['push'](_0x1ff68b['shift']());}catch(_0x526b97){_0x1ff68b['push'](_0x1ff68b['shift']());}}}(_0x44f2,0xc7d2d));function contentHash(_0x7e73ea){const _0x3e1d40=_0x113f,_0x554ee2={'egbai':function(_0x40f66c,_0xbdf59c){return _0x40f66c+_0xbdf59c;},'NQXnE':function(_0x516e3e,_0x14abf7){return _0x516e3e-_0x14abf7;},'MZsaN':function(_0x4befbb,_0x206258){return _0x4befbb<<_0x206258;}},_0x2b2880=_0x7e73ea['replace'](/\s+/g,'\x20')['trim']()['toLowerCase']();let _0x1038ef=0x0;for(let _0x1d527e=0x0;_0x1d527e<_0x2b2880['length'];_0x1d527e++)_0x1038ef=_0x554ee2[_0x3e1d40(0x1b3)](_0x554ee2[_0x3e1d40(0x1b8)](_0x554ee2['MZsaN'](_0x1038ef,0x5),_0x1038ef),_0x2b2880['charCodeAt'](_0x1d527e))|0x0;return Math[_0x3e1d40(0x1bc)](_0x1038ef)['toString'](0x24);}export class CompressionCache{[_0x160256(0x1b7)];['ttlMs'];['entries'];[_0x160256(0x1c1)]=0x0;['missCount']=0x0;constructor(_0x416707){const _0x17e797=_0x160256;this[_0x17e797(0x1b7)]=_0x416707?.[_0x17e797(0x1b7)]??0x64,this[_0x17e797(0x1c3)]=_0x416707?.['ttlMs']??0x493e0,this[_0x17e797(0x1bb)]=new Map();}['get'](_0x409d50){const _0x32f1d6=_0x160256,_0x22bd66=contentHash(_0x409d50),_0x4c2f10=this['entries'][_0x32f1d6(0x1c0)](_0x22bd66);if(_0x4c2f10)return Date[_0x32f1d6(0x1be)]()>_0x4c2f10['expiresAt']?(this['entries']['delete'](_0x22bd66),void this['missCount']++):(this['entries'][_0x32f1d6(0x1b5)](_0x22bd66),this[_0x32f1d6(0x1bb)]['set'](_0x22bd66,_0x4c2f10),this['hitCount']++,_0x4c2f10[_0x32f1d6(0x1d3)]);this['missCount']++;}[_0x160256(0x1c9)](_0x44fe5c,_0x1fefca){const _0x529889=_0x160256,_0x4f6e43={'euTOg':function(_0x417dda,_0x3fa4d6){return _0x417dda(_0x3fa4d6);},'piCzH':function(_0x1e59f4,_0x223110){return _0x1e59f4+_0x223110;}},_0x271c93=_0x4f6e43[_0x529889(0x1b2)](contentHash,_0x44fe5c);if(this[_0x529889(0x1bb)]['has'](_0x271c93)&&this[_0x529889(0x1bb)]['delete'](_0x271c93),this[_0x529889(0x1bb)][_0x529889(0x1c8)]>=this[_0x529889(0x1b7)]){const _0x577247=this['entries']['keys']()[_0x529889(0x1d0)]()['value'];void 0x0!==_0x577247&&this[_0x529889(0x1bb)]['delete'](_0x577247);}this[_0x529889(0x1bb)]['set'](_0x271c93,{'result':_0x1fefca,'expiresAt':_0x4f6e43['piCzH'](Date['now'](),this[_0x529889(0x1c3)])});}[_0x160256(0x1d1)](_0x44e4f0){const _0x5d3ad4=_0x160256,_0x501070={'QsOvb':function(_0x3a0eb1,_0x4a74e2){return _0x3a0eb1>_0x4a74e2;}},_0x254a70=contentHash(_0x44e4f0),_0x2e45f6=this['entries']['get'](_0x254a70);return!!_0x2e45f6&&(!_0x501070['QsOvb'](Date[_0x5d3ad4(0x1be)](),_0x2e45f6[_0x5d3ad4(0x1b6)])||(this[_0x5d3ad4(0x1bb)][_0x5d3ad4(0x1b5)](_0x254a70),!0x1));}['clear'](){const _0x25fd56=_0x160256;this['entries'][_0x25fd56(0x1cd)](),this[_0x25fd56(0x1c1)]=0x0,this['missCount']=0x0;}get[_0x160256(0x1c8)](){const _0x3e615e=_0x160256;return this[_0x3e615e(0x1bb)][_0x3e615e(0x1c8)];}get[_0x160256(0x1c7)](){const _0x18e306=_0x160256,_0x1837bc={'HLKrF':function(_0x32cdb8,_0x4f0d61){return _0x32cdb8+_0x4f0d61;},'wijzB':function(_0x3a982e,_0x35beda){return _0x3a982e===_0x35beda;},'HlWcu':function(_0x39646c,_0x530976){return _0x39646c/_0x530976;}},_0x5acca9=_0x1837bc[_0x18e306(0x1ba)](this[_0x18e306(0x1c1)],this[_0x18e306(0x1cf)]);return{'hits':this[_0x18e306(0x1c1)],'misses':this[_0x18e306(0x1cf)],'entries':this['entries'][_0x18e306(0x1c8)],'hitRate':_0x1837bc[_0x18e306(0x1c6)](0x0,_0x5acca9)?0x0:_0x1837bc[_0x18e306(0x1cb)](this['hitCount'],_0x5acca9)};}}function _0x113f(_0x5f3f67,_0xc70dce){_0x5f3f67=_0x5f3f67-0x1b2;const _0x44f2cc=_0x44f2();let _0x113f2a=_0x44f2cc[_0x5f3f67];return _0x113f2a;}export function createCachedPipeline(_0x5670a9,_0x228356){const _0x4b69e7=new CompressionCache(_0x228356);return{'compress':function(_0x7dce2e,_0x557a88){const _0x30ff7b=_0x113f,_0x282d28=_0x4b69e7['get'](_0x7dce2e);if(void 0x0!==_0x282d28)return _0x282d28;const _0x5165ca=_0x5670a9[_0x30ff7b(0x1c2)](_0x7dce2e,_0x557a88);return _0x4b69e7[_0x30ff7b(0x1c9)](_0x7dce2e,_0x5165ca),_0x5165ca;},'cache':_0x4b69e7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1207(_0x2c6af4,_0x34ba55){_0x2c6af4=_0x2c6af4-0x14d;const _0x508268=_0x5082();let _0x120751=_0x508268[_0x2c6af4];return _0x120751;}(function(_0x16eb46,_0x406023){const _0x494c5f=_0x1207,_0x737de0=_0x16eb46();while(!![]){try{const _0x446c0c=-parseInt(_0x494c5f(0x153))/0x1+parseInt(_0x494c5f(0x14d))/0x2*(-parseInt(_0x494c5f(0x163))/0x3)+parseInt(_0x494c5f(0x168))/0x4+-parseInt(_0x494c5f(0x152))/0x5+parseInt(_0x494c5f(0x165))/0x6*(parseInt(_0x494c5f(0x155))/0x7)+-parseInt(_0x494c5f(0x15f))/0x8*(-parseInt(_0x494c5f(0x160))/0x9)+-parseInt(_0x494c5f(0x162))/0xa*(-parseInt(_0x494c5f(0x159))/0xb);if(_0x446c0c===_0x406023)break;else _0x737de0['push'](_0x737de0['shift']());}catch(_0x45ef6f){_0x737de0['push'](_0x737de0['shift']());}}}(_0x5082,0xd6c37));import{encode,decode}from'gpt-tokenizer';import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';const DEFAULT_CHUNK_SIZE=0xc8,DEFAULT_OVERLAP=0x1e,DEFAULT_SENTENCES_PER_CHUNK=0x3,BASE_QUALITY_ESTIMATE=0.88,QUALITY_VARIANCE_WEIGHT=0.12;function splitIntoOverlappingChunks(_0x1be304,_0x2edc5c,_0x1f8623){const _0x362b5a=_0x1207,_0x22ef0a={'LvRCP':function(_0x2d82e0,_0x47a941){return _0x2d82e0-_0x47a941;},'tywIG':function(_0x419469,_0x52f5fc){return _0x419469<_0x52f5fc;},'dOFvc':function(_0x2cfecc,_0x5ccf59){return _0x2cfecc(_0x5ccf59);},'PbFkp':function(_0x3722bd,_0x4ad7b4){return _0x3722bd===_0x4ad7b4;}},_0x18b775=Math['min'](_0x1f8623,_0x22ef0a[_0x362b5a(0x157)](_0x2edc5c,0x1)),_0x4be528=Math['max'](0x1,_0x2edc5c-_0x18b775),_0x596294=[];let _0x3db8bb=0x0;for(;_0x22ef0a[_0x362b5a(0x15d)](_0x3db8bb,_0x1be304['length']);){const _0x59809b=Math[_0x362b5a(0x161)](_0x3db8bb+_0x2edc5c,_0x1be304[_0x362b5a(0x15e)]),_0x557df4=_0x1be304['slice'](_0x3db8bb,_0x59809b);if(_0x596294[_0x362b5a(0x151)](_0x22ef0a[_0x362b5a(0x167)](decode,_0x557df4)),_0x22ef0a['PbFkp'](_0x59809b,_0x1be304['length']))break;_0x3db8bb+=_0x4be528;}return _0x596294;}function summarizeChunk(_0x5b2ecc,_0x208ac5){const _0x5ed023=_0x1207,_0x5305b0={'DDQfT':function(_0x4452da,_0x30ba33){return _0x4452da(_0x30ba33);},'viJhP':function(_0x1e2ab5,_0x594ee0){return _0x1e2ab5===_0x594ee0;},'lqVFl':function(_0x4c0115,_0x20cd61){return _0x4c0115-_0x20cd61;}},_0x1d7600=_0x5305b0[_0x5ed023(0x166)](splitSentences,_0x5b2ecc);if(_0x1d7600['length']<=_0x208ac5)return _0x5b2ecc;if(_0x5305b0['viJhP'](0x1,_0x208ac5))return _0x1d7600[0x0];return[..._0x1d7600['slice'](0x0,0x1),..._0x1d7600[_0x5ed023(0x154)](-_0x5305b0['lqVFl'](_0x208ac5,0x1))][_0x5ed023(0x164)]('.\x20');}export function compressChunked(_0x1fbc86,_0x49cf7c={}){const _0x567750=_0x1207,_0x42a569={'TNPnr':function(_0xf899b6,_0x283390){return _0xf899b6+_0x283390;},'lvXHo':_0x567750(0x158),'QlQok':function(_0x1e36a0,_0x49eb65){return _0x1e36a0(_0x49eb65);},'iLAhq':function(_0x5d6197,_0x133189){return _0x5d6197<=_0x133189;},'TmjoE':function(_0x59b0a9,_0x777117){return _0x59b0a9>_0x777117;},'RUUhM':function(_0x2c2f05,_0x7aa7a4){return _0x2c2f05/_0x7aa7a4;},'LDdbG':function(_0x5ad344,_0x3c981e){return _0x5ad344/_0x3c981e;}};if(!_0x1fbc86||!_0x1fbc86[_0x567750(0x15b)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x42a569['lvXHo'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x54e93c=_0x42a569[_0x567750(0x15c)](countTokens,_0x1fbc86),_0x2716d8=_0x49cf7c[_0x567750(0x15a)]??0xc8,_0x4595f4=_0x49cf7c['overlap']??0x1e,_0x5794b4=_0x49cf7c[_0x567750(0x150)]??0x3;if(_0x42a569[_0x567750(0x14f)](_0x54e93c,_0x2716d8))return{'text':_0x1fbc86,'originalTokens':_0x54e93c,'compressedTokens':_0x54e93c,'compressionRatio':0x1,'strategyUsed':_0x42a569['lvXHo'],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x42bf4c=splitIntoOverlappingChunks(_0x42a569[_0x567750(0x15c)](encode,_0x1fbc86),_0x2716d8,_0x4595f4),_0x1d0dbd=_0x42bf4c['map']((_0xb42696,_0x5c0f7f)=>{const _0x54eaf5=_0x567750,_0x41122a=summarizeChunk(_0xb42696,_0x5794b4);return'['+_0x42a569[_0x54eaf5(0x14e)](_0x5c0f7f,0x1)+'/'+_0x42bf4c[_0x54eaf5(0x15e)]+']\x20'+_0x41122a;})['join']('\x0a\x0a'),_0x275d05=countTokens(_0x1d0dbd);return{'text':_0x1d0dbd,'originalTokens':_0x54e93c,'compressedTokens':_0x275d05,'compressionRatio':_0x42a569[_0x567750(0x156)](_0x275d05,0x0)?_0x42a569['RUUhM'](_0x54e93c,_0x275d05):0x1,'strategyUsed':_0x567750(0x158),'qualityEstimate':Math['min'](0x1,_0x42a569['TNPnr'](0.88,_0x42a569['LDdbG'](_0x275d05,_0x54e93c)*0.12)),'wasTruncated':!0x0};}export const chunkedStrategy={'name':'chunked','compress':(_0x3c6a2f,_0x332e1c)=>compressChunked(_0x3c6a2f,_0x332e1c)};function _0x5082(){const _0x410d36=['71421WhhuZo','TmjoE','LvRCP','chunked','37213FmQcNL','chunkSize','trim','QlQok','tywIG','length','8dlJxDn','7263441OhKmJN','min','4850hzHLrD','33VtkCiQ','join','468vBouTo','DDQfT','dOFvc','174952kppiCd','57398OXzAnX','TNPnr','iLAhq','sentencesPerChunk','push','5928465JOKIcZ','906323Ktxkzx','slice'];_0x5082=function(){return _0x410d36;};return _0x5082();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x1b0f5b=_0x168c;(function(_0x4422ef,_0x4b4a88){const _0x3fd5db=_0x168c,_0x949efa=_0x4422ef();while(!![]){try{const _0x2f620a=parseInt(_0x3fd5db(0x15d))/0x1*(-parseInt(_0x3fd5db(0x165))/0x2)+parseInt(_0x3fd5db(0x16d))/0x3*(parseInt(_0x3fd5db(0x164))/0x4)+-parseInt(_0x3fd5db(0x158))/0x5+-parseInt(_0x3fd5db(0x171))/0x6*(parseInt(_0x3fd5db(0x15e))/0x7)+-parseInt(_0x3fd5db(0x160))/0x8*(parseInt(_0x3fd5db(0x163))/0x9)+-parseInt(_0x3fd5db(0x15b))/0xa*(parseInt(_0x3fd5db(0x156))/0xb)+parseInt(_0x3fd5db(0x16a))/0xc*(parseInt(_0x3fd5db(0x181))/0xd);if(_0x2f620a===_0x4b4a88)break;else _0x949efa['push'](_0x949efa['shift']());}catch(_0x493c5b){_0x949efa['push'](_0x949efa['shift']());}}}(_0xe36d,0xe8834));import{countTokens}from'../../shared/token-counter.js';import{extractContentWords,STOPWORDS}from'./text-utils.js';function _0xe36d(){const _0x207c8b=['bRZdf','map','EIxky','VuPdm','split','9359467Ylrhxc','test','isProtected','110bScSKt','maxTokens','1216810XSFyzW','KBJav','HFpDE','20040ZFphff','size','898553sSKfEY','28EXcSHc','trim','195016CfZjep','uByDd','VgQiN','126IRfRXE','1164972ouDSWA','2ScDoWs','text','IsnWX','XYKAG','MtezO','36fLaLRk','length','filter','12KFhRQT','has','fingerprint','wTarZ','1303866XRPcOU','sort','index','FspKp','dedup','OVOii','add','lYTpH','thWfz','oqNJy','FOBtK'];_0xe36d=function(){return _0x207c8b;};return _0xe36d();}const DEFAULT_SIMILARITY_THRESHOLD=0.7,MIN_WORDS_FOR_DEDUP=0x5,CODE_FENCE_PATTERN=/^```/,HEADING_PATTERN=/^#/,BASE_QUALITY_ESTIMATE=0.95;function isInsideCodeFence(_0x420839,_0x24a22b){const _0x515f41=_0x168c,_0x1b88b0={'uByDd':function(_0x2238e9,_0x460f5e){return _0x2238e9<_0x460f5e;}};let _0x4a8fb1=!0x1;for(let _0x4e06cb=0x0;_0x1b88b0[_0x515f41(0x161)](_0x4e06cb,_0x24a22b);_0x4e06cb++){const _0x4990ab=_0x420839[_0x4e06cb]['split']('\x0a');for(const _0x263793 of _0x4990ab)CODE_FENCE_PATTERN[_0x515f41(0x182)](_0x263793[_0x515f41(0x15f)]())&&(_0x4a8fb1=!_0x4a8fb1);}return _0x4a8fb1;}function hasCodeFence(_0x2c03c5){const _0x58c33f=_0x168c;return _0x2c03c5['split']('\x0a')['some'](_0x1a903e=>CODE_FENCE_PATTERN[_0x58c33f(0x182)](_0x1a903e['trim']()));}function isHeading(_0x1f2804){const _0x5486a1=_0x168c;return HEADING_PATTERN['test'](_0x1f2804[_0x5486a1(0x15f)]());}function isTooShort(_0x42dd71){const _0x141f4a=_0x168c,_0x9ed01c={'FOBtK':function(_0x1b042e,_0x4afc7c){return _0x1b042e<_0x4afc7c;}};return _0x9ed01c[_0x141f4a(0x17b)](_0x42dd71['trim']()['split'](/\s+/)[_0x141f4a(0x16b)],0x5);}function computeFingerprint(_0x37d0e4){const _0x50c6fc=_0x168c,_0x1472fe=extractContentWords(_0x37d0e4)['filter'](_0x44c3b4=>!STOPWORDS['has'](_0x44c3b4));return new Set(_0x1472fe[_0x50c6fc(0x172)]());}function computeJaccardSimilarity(_0x4236cc,_0x42ff75){const _0x9955d=_0x168c,_0xf34f27={'lYTpH':function(_0x12983e,_0x52a920){return _0x12983e===_0x52a920;},'cuCiA':function(_0x37d3bc,_0x3e0732){return _0x37d3bc<=_0x3e0732;},'oBFTY':function(_0x3def5b,_0x2d1f9d){return _0x3def5b-_0x2d1f9d;},'HFpDE':function(_0x35e42b,_0x10adff){return _0x35e42b+_0x10adff;},'bRZdf':function(_0x215dc4,_0x212da8){return _0x215dc4>_0x212da8;},'KBJav':function(_0x26e2a3,_0x33551b){return _0x26e2a3/_0x33551b;}};if(_0xf34f27[_0x9955d(0x178)](0x0,_0x4236cc['size'])&&0x0===_0x42ff75[_0x9955d(0x15c)])return 0x0;let _0x165220=0x0;const _0x32d207=_0xf34f27['cuCiA'](_0x4236cc['size'],_0x42ff75[_0x9955d(0x15c)])?_0x4236cc:_0x42ff75,_0x546048=_0x4236cc[_0x9955d(0x15c)]<=_0x42ff75['size']?_0x42ff75:_0x4236cc;for(const _0x44fa2e of _0x32d207)_0x546048[_0x9955d(0x16e)](_0x44fa2e)&&_0x165220++;const _0x2c2920=_0xf34f27['oBFTY'](_0xf34f27[_0x9955d(0x15a)](_0x4236cc['size'],_0x42ff75[_0x9955d(0x15c)]),_0x165220);return _0xf34f27[_0x9955d(0x17c)](_0x2c2920,0x0)?_0xf34f27[_0x9955d(0x159)](_0x165220,_0x2c2920):0x0;}function splitParagraphs(_0x215436){const _0x238fd6=_0x168c;return _0x215436[_0x238fd6(0x180)](/\n\n+/);}function buildParagraphEntries(_0x1fa82c){const _0x22ff77=_0x168c,_0x57db47={'oqNJy':function(_0x2a362c,_0x53d269){return _0x2a362c(_0x53d269);},'fRJlf':function(_0x519b36,_0x54ec7c){return _0x519b36(_0x54ec7c);},'IsnWX':function(_0x1fbdd2,_0x23540c,_0x209c63){return _0x1fbdd2(_0x23540c,_0x209c63);}};return _0x1fa82c[_0x22ff77(0x17d)]((_0x25551e,_0x412e57)=>{const _0x14e105=_0x22ff77,_0x2e3aa2=isTooShort(_0x25551e)||_0x57db47[_0x14e105(0x17a)](isHeading,_0x25551e)||_0x57db47['fRJlf'](hasCodeFence,_0x25551e)||_0x57db47[_0x14e105(0x167)](isInsideCodeFence,_0x1fa82c,_0x412e57);return{'index':_0x412e57,'text':_0x25551e,'fingerprint':_0x2e3aa2?new Set():computeFingerprint(_0x25551e),'isProtected':_0x2e3aa2};});}function findDuplicates(_0x108b78,_0xf4f015){const _0x166b93=_0x168c,_0x1609f8={'thWfz':function(_0x33c563,_0x1ab9e6){return _0x33c563<_0x1ab9e6;},'VuPdm':function(_0x827e34,_0x52df76){return _0x827e34>=_0x52df76;},'njDQa':function(_0x23d8ba,_0x308f7d,_0x19b37c){return _0x23d8ba(_0x308f7d,_0x19b37c);}},_0x166601=new Set();let _0x44a550=0x0;for(let _0x479b7e=0x0;_0x1609f8[_0x166b93(0x179)](_0x479b7e,_0x108b78[_0x166b93(0x16b)]);_0x479b7e++){const _0x465a3a=_0x108b78[_0x479b7e];if(_0x465a3a[_0x166b93(0x155)]||_0x166601['has'](_0x479b7e))continue;let _0x245b3f=!0x1;for(let _0x1ec09=_0x479b7e+0x1;_0x1609f8[_0x166b93(0x179)](_0x1ec09,_0x108b78['length']);_0x1ec09++){const _0x59fb50=_0x108b78[_0x1ec09];if(_0x59fb50[_0x166b93(0x155)]||_0x166601[_0x166b93(0x16e)](_0x1ec09))continue;_0x1609f8[_0x166b93(0x17f)](_0x1609f8['njDQa'](computeJaccardSimilarity,_0x465a3a['fingerprint'],_0x59fb50[_0x166b93(0x16f)]),_0xf4f015)&&(_0x166601[_0x166b93(0x177)](_0x1ec09),_0x245b3f=!0x0);}_0x245b3f&&_0x44a550++;}const _0x449567=new Set();for(let _0x5c6523=0x0;_0x1609f8[_0x166b93(0x179)](_0x5c6523,_0x108b78[_0x166b93(0x16b)]);_0x5c6523++)_0x166601['has'](_0x5c6523)||_0x449567['add'](_0x5c6523);return{'keptIndices':_0x449567,'removedIndices':_0x166601,'groupCount':_0x44a550};}function _0x168c(_0x268531,_0x1be3bf){_0x268531=_0x268531-0x155;const _0xe36dfb=_0xe36d();let _0x168c0c=_0xe36dfb[_0x268531];return _0x168c0c;}export function deduplicateText(_0x557d3d,_0x437c81){const _0x2e6a86=_0x168c,_0x132691={'MtezO':function(_0x4affa6,_0x3a8f06){return _0x4affa6(_0x3a8f06);},'WcHHA':function(_0x3232a1,_0x207334,_0x2cee15){return _0x3232a1(_0x207334,_0x2cee15);}};if(!_0x557d3d||!_0x557d3d[_0x2e6a86(0x15f)]())return{'text':'','originalParagraphs':0x0,'keptParagraphs':0x0,'removedParagraphs':0x0,'duplicateGroups':0x0};const _0x17f718=_0x437c81?.['similarityThreshold']??0.7,_0x347536=splitParagraphs(_0x557d3d),_0x3acccc=_0x132691[_0x2e6a86(0x169)](buildParagraphEntries,_0x347536),{keptIndices:_0x4cb585,removedIndices:_0x1ff09a,groupCount:_0x3b7ff3}=_0x132691['WcHHA'](findDuplicates,_0x3acccc,_0x17f718),_0x44d83b=_0x3acccc[_0x2e6a86(0x16c)](_0x192d0b=>_0x4cb585['has'](_0x192d0b[_0x2e6a86(0x173)]))[_0x2e6a86(0x17d)](_0xcde292=>_0xcde292['text']);return{'text':_0x44d83b['join']('\x0a\x0a'),'originalParagraphs':_0x347536[_0x2e6a86(0x16b)],'keptParagraphs':_0x44d83b[_0x2e6a86(0x16b)],'removedParagraphs':_0x1ff09a[_0x2e6a86(0x15c)],'duplicateGroups':_0x3b7ff3};}export function compressDedup(_0x5c3585,_0x8e0bb6={}){const _0x450db6=_0x168c,_0x1f818d={'EIxky':_0x450db6(0x175),'XYKAG':function(_0x2e850f,_0x2e936b){return _0x2e850f(_0x2e936b);},'VgQiN':function(_0x5e7567,_0x5b2d72){return _0x5e7567(_0x5b2d72);},'PYhIv':function(_0x20b285,_0x2e2695){return _0x20b285(_0x2e2695);},'FspKp':function(_0x100e74,_0x1da102){return _0x100e74>_0x1da102;},'OVOii':function(_0x337a61,_0x2b251b){return _0x337a61(_0x2b251b);},'wTarZ':function(_0xecab3e,_0xb1d1e9){return _0xecab3e<=_0xb1d1e9;},'hnQaV':function(_0x26658c,_0x27b604){return _0x26658c+_0x27b604;},'CAkrZ':function(_0x2a591e,_0x5f18cb){return _0x2a591e/_0x5f18cb;}};if(!_0x5c3585||!_0x5c3585[_0x450db6(0x15f)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x1f818d[_0x450db6(0x17e)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x31a25b=_0x1f818d[_0x450db6(0x168)](countTokens,_0x5c3585),_0x21b5b7=_0x1f818d[_0x450db6(0x162)](deduplicateText,_0x5c3585),_0x27a5c8=_0x1f818d['PYhIv'](countTokens,_0x21b5b7[_0x450db6(0x166)]),_0x406011=_0x21b5b7['removedParagraphs']>0x0?Math['min'](0x1,0.95+_0x27a5c8/_0x31a25b*(0x1-0.95)):0x1;let _0x5c74c3=_0x21b5b7[_0x450db6(0x166)],_0x1656d1=!0x1;if(_0x8e0bb6[_0x450db6(0x157)]&&_0x1f818d[_0x450db6(0x174)](_0x27a5c8,_0x8e0bb6['maxTokens'])){const _0x45888c=splitParagraphs(_0x5c74c3),_0x7b3ff9=[];let _0x265165=0x0;for(const _0x3d9617 of _0x45888c){const _0x2d0c2a=_0x1f818d[_0x450db6(0x176)](countTokens,_0x3d9617);if(!_0x1f818d[_0x450db6(0x170)](_0x1f818d['hnQaV'](_0x265165,_0x2d0c2a),_0x8e0bb6[_0x450db6(0x157)])){_0x1656d1=!0x0;break;}_0x7b3ff9['push'](_0x3d9617),_0x265165+=_0x2d0c2a;}_0x5c74c3=_0x7b3ff9['join']('\x0a\x0a');}const _0x45e648=_0x1656d1?countTokens(_0x5c74c3):_0x27a5c8;return{'text':_0x5c74c3,'originalTokens':_0x31a25b,'compressedTokens':_0x45e648,'compressionRatio':_0x45e648>0x0?_0x1f818d['CAkrZ'](_0x31a25b,_0x45e648):0x1,'strategyUsed':_0x1f818d['EIxky'],'qualityEstimate':_0x406011,'wasTruncated':_0x1656d1};}export const dedupStrategy={'name':_0x1b0f5b(0x175),'compress':compressDedup};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x17004a,_0x31a11a){const _0x3230b9=_0x27c0,_0x15a9ee=_0x17004a();while(!![]){try{const _0x7921c1=parseInt(_0x3230b9(0xd5))/0x1*(-parseInt(_0x3230b9(0xcd))/0x2)+-parseInt(_0x3230b9(0xe6))/0x3*(parseInt(_0x3230b9(0xec))/0x4)+parseInt(_0x3230b9(0xd6))/0x5*(parseInt(_0x3230b9(0xe5))/0x6)+-parseInt(_0x3230b9(0xca))/0x7*(parseInt(_0x3230b9(0xd7))/0x8)+-parseInt(_0x3230b9(0xea))/0x9+-parseInt(_0x3230b9(0xe7))/0xa+parseInt(_0x3230b9(0xdc))/0xb;if(_0x7921c1===_0x31a11a)break;else _0x15a9ee['push'](_0x15a9ee['shift']());}catch(_0x26f45f){_0x15a9ee['push'](_0x15a9ee['shift']());}}}(_0x1220,0xd7fcf));import{countTokens}from'../../shared/token-counter.js';const FENCED_JSON_BLOCK=/```(?:json)?\s*\n([\s\S]*?)```/g,INLINE_JSON_OBJECT=/(?<![\\:a-zA-Z0-9_"'])(\{[\s\S]*?\})(?![\\a-zA-Z0-9_])/g,INLINE_JSON_ARRAY=/(?<![\\:a-zA-Z0-9_"'])(\[[\s\S]*?\])(?![\\a-zA-Z0-9_])/g,CONSECUTIVE_BLANK_LINES=/\n{3,}/g,EXCESSIVE_LIST_INDENT=/^( {4,}|\t{2,})([*\-+]|\d+\.)\s/gm,BOLD_WHOLE_PARAGRAPH=/^\*\*([^*\n]+)\*\*$/gm,ITALIC_WHOLE_PARAGRAPH=/^_([^_\n]+)_$/gm,MAX_FLATTEN_DEPTH=0x2;function isJsonLike(_0x468098){const _0x48b95c=_0x27c0,_0x3cb83a=_0x468098['trim']();return _0x3cb83a[_0x48b95c(0xc5)]('{')&&_0x3cb83a['endsWith']('}')||_0x3cb83a[_0x48b95c(0xc5)]('[')&&_0x3cb83a[_0x48b95c(0xc6)](']');}function tryParseJson(_0x47b79d){try{return JSON['parse'](_0x47b79d);}catch{return null;}}function flattenObject(_0x49d860,_0x521c29,_0x5af7ea){const _0x1f3e7b=_0x27c0,_0x7d4888={'dtnkC':function(_0x25ae4e,_0x441fe7){return _0x25ae4e==_0x441fe7;},'PrqPF':function(_0x23741b,_0x37d69f){return _0x23741b+_0x37d69f;}},_0x781464=[];for(const [_0x31b490,_0x25b445]of Object['entries'](_0x49d860)){const _0x16493b=_0x521c29?_0x521c29+'.'+_0x31b490:_0x31b490;null!==_0x25b445&&_0x7d4888[_0x1f3e7b(0xd9)]('object',typeof _0x25b445)&&!Array['isArray'](_0x25b445)&&_0x5af7ea<0x2?_0x781464[_0x1f3e7b(0xce)](...flattenObject(_0x25b445,_0x16493b,_0x7d4888[_0x1f3e7b(0xe3)](_0x5af7ea,0x1))):_0x781464['push']([_0x16493b,_0x25b445]);}return _0x781464;}function formatValue(_0x2ee06c){const _0x3adc6c=_0x27c0,_0x591ab1={'FDhHx':function(_0x1895cb,_0x2bec77){return _0x1895cb===_0x2bec77;},'WjfRm':_0x3adc6c(0xe0),'bWXXz':function(_0x26a6ed,_0x5d72d7){return _0x26a6ed===_0x5d72d7;},'KBapf':function(_0x461888,_0x3057cc){return _0x461888==_0x3057cc;}};if(_0x591ab1['FDhHx'](null,_0x2ee06c))return _0x591ab1['WjfRm'];if(_0x591ab1[_0x3adc6c(0xdb)](void 0x0,_0x2ee06c))return'undefined';if(_0x3adc6c(0xcb)==typeof _0x2ee06c)return _0x2ee06c;if(_0x591ab1['KBapf'](_0x3adc6c(0xc4),typeof _0x2ee06c)||_0x3adc6c(0xcc)==typeof _0x2ee06c)return String(_0x2ee06c);if(Array[_0x3adc6c(0xe9)](_0x2ee06c))return'['+_0x2ee06c[_0x3adc6c(0xe1)](_0x13958f=>'object'==typeof _0x13958f&&null!==_0x13958f?JSON['stringify'](_0x13958f):formatValue(_0x13958f))[_0x3adc6c(0xd3)](',\x20')+']';return JSON[_0x3adc6c(0xdd)](_0x2ee06c);}function hasDeepNesting(_0x21dff8,_0x180212){const _0x8e86e2=_0x27c0,_0x43263f={'opzeX':'object'};return _0x180212>0x2||_0x43263f[_0x8e86e2(0xc9)]==typeof _0x21dff8&&null!==_0x21dff8&&(Array[_0x8e86e2(0xe9)](_0x21dff8)?_0x21dff8['some'](_0x2389d9=>hasDeepNesting(_0x2389d9,_0x180212+0x1)):Object[_0x8e86e2(0xe2)](_0x21dff8)[_0x8e86e2(0xe8)](_0x392f4f=>hasDeepNesting(_0x392f4f,_0x180212+0x1)));}function convertJsonToCompact(_0x22a7f3){const _0x4fee2f=_0x27c0,_0x48af26={'oKQYy':function(_0x5dfd66,_0x2d9dda,_0x1002ca){return _0x5dfd66(_0x2d9dda,_0x1002ca);},'dPMTH':function(_0x39e679,_0x5966e2){return _0x39e679==_0x5966e2;},'AcQwb':'object','WwnUy':function(_0x4c9dbc,_0x4b867f){return _0x4c9dbc!==_0x4b867f;},'Llrpi':function(_0x117b9a,_0x28b812,_0x4a4f3c){return _0x117b9a(_0x28b812,_0x4a4f3c);},'qHInI':function(_0x46caa7,_0x18bd84){return _0x46caa7(_0x18bd84);}};if(Array[_0x4fee2f(0xe9)](_0x22a7f3))return _0x22a7f3['every'](_0x1705bf=>'object'!=typeof _0x1705bf||null===_0x1705bf)?'['+_0x22a7f3[_0x4fee2f(0xe1)](formatValue)['join'](',\x20')+']':_0x48af26['oKQYy'](hasDeepNesting,_0x22a7f3,0x0)?JSON[_0x4fee2f(0xdd)](_0x22a7f3):_0x22a7f3['map'](_0x5c4cc2=>_0x4fee2f(0xed)!=typeof _0x5c4cc2||null===_0x5c4cc2||Array['isArray'](_0x5c4cc2)?formatValue(_0x5c4cc2):convertObjectToCompact(_0x5c4cc2))['join']('\x0a');if(_0x48af26['dPMTH'](_0x48af26['AcQwb'],typeof _0x22a7f3)&&_0x48af26[_0x4fee2f(0xe4)](null,_0x22a7f3)){if(_0x48af26[_0x4fee2f(0xda)](hasDeepNesting,_0x22a7f3,0x0)){const _0x1b2cac=_0x22a7f3;if(!Object[_0x4fee2f(0xe2)](_0x1b2cac)[_0x4fee2f(0xe8)](_0x5c70fe=>'object'!=typeof _0x5c70fe||null===_0x5c70fe))return JSON[_0x4fee2f(0xdd)](_0x22a7f3);}return convertObjectToCompact(_0x22a7f3);}return _0x48af26['qHInI'](formatValue,_0x22a7f3);}function convertObjectToCompact(_0x2af2cf){const _0x304011=_0x27c0,_0x288bc0={'qqAMd':function(_0x52247b,_0x51f546,_0x329835,_0x52ae17){return _0x52247b(_0x51f546,_0x329835,_0x52ae17);}},_0x4f00d6=_0x288bc0['qqAMd'](flattenObject,_0x2af2cf,'',0x0)[_0x304011(0xe1)](([_0x21dc36,_0x30aff5])=>'object'==typeof _0x30aff5&&null!==_0x30aff5?_0x21dc36+':\x20'+JSON['stringify'](_0x30aff5):_0x21dc36+':\x20'+formatValue(_0x30aff5));return _0x4f00d6[_0x304011(0xef)]<=0x4&&_0x4f00d6['every'](_0x56e603=>_0x56e603['length']<0x3c)?_0x4f00d6[_0x304011(0xd3)](',\x20'):_0x4f00d6[_0x304011(0xd3)]('\x0a');}function _0x1220(){const _0x3930a9=['string','boolean','3105772RwhgrL','push','text','cleaned','xNPYj','biyvh','join','uQOma','1phRpYu','6585YXozIn','8gLYiHU','pBtMh','dtnkC','Llrpi','bWXXz','52716004QpPDgU','stringify','tnaxW','replace','null','map','values','PrqPF','WwnUy','5262nYiLBW','5254329DdUVLO','1944100SjOFUq','some','isArray','5757948OenPnt','trim','4hzDgRs','object','markdownCleaned','length','number','startsWith','endsWith','count','cydlo','opzeX','6469225YVAYIh'];_0x1220=function(){return _0x3930a9;};return _0x1220();}function replaceJsonBlocks(_0x49ccb7){const _0x557801=_0x27c0,_0x17e2b9={'biyvh':function(_0x37a915,_0x105edd){return _0x37a915(_0x105edd);},'tnaxW':function(_0x310b19,_0x5136fd){return _0x310b19===_0x5136fd;},'xNPYj':function(_0x3041f7,_0x3ffb00){return _0x3041f7!==_0x3ffb00;}};let _0x5c814e=0x0,_0x11bd3d=_0x49ccb7;return _0x11bd3d=_0x11bd3d['replace'](FENCED_JSON_BLOCK,(_0x57cc05,_0x1cf95b)=>{const _0x1c9c15=_0x27c0,_0xf7a453=_0x1cf95b[_0x1c9c15(0xeb)]();if(!_0x17e2b9['biyvh'](isJsonLike,_0xf7a453))return _0x57cc05;const _0x4b7230=tryParseJson(_0xf7a453);return _0x17e2b9[_0x1c9c15(0xde)](null,_0x4b7230)?_0x57cc05:(_0x5c814e++,_0x17e2b9[_0x1c9c15(0xd2)](convertJsonToCompact,_0x4b7230));}),_0x11bd3d=_0x11bd3d[_0x557801(0xdf)](INLINE_JSON_OBJECT,(_0x1b4ce8,_0x3615a6)=>{const _0x46414a=_0x557801,_0x1f9305=tryParseJson(_0x3615a6);return _0x17e2b9['tnaxW'](null,_0x1f9305)||_0x46414a(0xed)!=typeof _0x1f9305||Array[_0x46414a(0xe9)](_0x1f9305)?_0x1b4ce8:(_0x5c814e++,_0x17e2b9['biyvh'](convertJsonToCompact,_0x1f9305));}),_0x11bd3d=_0x11bd3d['replace'](INLINE_JSON_ARRAY,(_0x284bde,_0x450a02)=>{const _0x13029c=_0x557801,_0x390ed2=tryParseJson(_0x450a02);return _0x17e2b9[_0x13029c(0xd1)](null,_0x390ed2)&&Array[_0x13029c(0xe9)](_0x390ed2)?0x0===_0x390ed2[_0x13029c(0xef)]?_0x284bde:(_0x5c814e++,convertJsonToCompact(_0x390ed2)):_0x284bde;}),{'text':_0x11bd3d,'count':_0x5c814e};}function cleanMarkdown(_0x2f9467){const _0x1ece7e=_0x27c0,_0x39be9b={'pBtMh':function(_0x242b7d,_0x5a0b55){return _0x242b7d!==_0x5a0b55;}};let _0xfbc05e=!0x1,_0x5e16b5=_0x2f9467;const _0x4a3f3d=_0x5e16b5;_0x5e16b5=_0x5e16b5['replace'](CONSECUTIVE_BLANK_LINES,'\x0a\x0a'),_0x39be9b[_0x1ece7e(0xd8)](_0x5e16b5,_0x4a3f3d)&&(_0xfbc05e=!0x0);const _0x56ed3a=_0x5e16b5;_0x5e16b5=_0x5e16b5[_0x1ece7e(0xdf)](EXCESSIVE_LIST_INDENT,'\x20\x20$2\x20'),_0x39be9b['pBtMh'](_0x5e16b5,_0x56ed3a)&&(_0xfbc05e=!0x0);const _0x3998bc=_0x5e16b5;_0x5e16b5=_0x5e16b5['replace'](BOLD_WHOLE_PARAGRAPH,'$1'),_0x5e16b5!==_0x3998bc&&(_0xfbc05e=!0x0);const _0x5bf31e=_0x5e16b5;return _0x5e16b5=_0x5e16b5['replace'](ITALIC_WHOLE_PARAGRAPH,'$1'),_0x39be9b['pBtMh'](_0x5e16b5,_0x5bf31e)&&(_0xfbc05e=!0x0),{'text':_0x5e16b5,'cleaned':_0xfbc05e};}export function optimizeFormat(_0x448660){const _0x2f7685=_0x27c0,_0x307147={'VEomG':function(_0x3890a6,_0xe58e15){return _0x3890a6(_0xe58e15);}};if(!_0x448660||!_0x448660['trim']())return{'text':'','jsonBlocksConverted':0x0,'markdownCleaned':!0x1};const _0x1cf76f=_0x307147['VEomG'](replaceJsonBlocks,_0x448660),_0x4b2b34=_0x307147['VEomG'](cleanMarkdown,_0x1cf76f[_0x2f7685(0xcf)]);return{'text':_0x4b2b34[_0x2f7685(0xcf)],'jsonBlocksConverted':_0x1cf76f[_0x2f7685(0xc7)],'markdownCleaned':_0x4b2b34[_0x2f7685(0xd0)]};}function _0x27c0(_0x344b6c,_0x189b68){_0x344b6c=_0x344b6c-0xc4;const _0x122004=_0x1220();let _0x27c046=_0x122004[_0x344b6c];return _0x27c046;}export const formatOptimizerStrategy={'name':'format-optimizer','compress'(_0x26fa9a,_0x49ba36={}){const _0x24f177=_0x27c0,_0x2fa0fa={'cydlo':function(_0x572675,_0x4280c0){return _0x572675(_0x4280c0);},'uQOma':function(_0x5b02a0,_0x20f844){return _0x5b02a0/_0x20f844;}};if(!_0x26fa9a||!_0x26fa9a['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':'format-optimizer','qualityEstimate':0x1,'wasTruncated':!0x1};const _0x212d36=_0x2fa0fa[_0x24f177(0xc8)](countTokens,_0x26fa9a),_0x3fc8fd=optimizeFormat(_0x26fa9a),_0x26dc29=_0x2fa0fa[_0x24f177(0xc8)](countTokens,_0x3fc8fd[_0x24f177(0xcf)]),_0x240eab=_0x26dc29>0x0?_0x2fa0fa[_0x24f177(0xd4)](_0x212d36,_0x26dc29):0x1,_0x15bf63=_0x3fc8fd['jsonBlocksConverted']>0x0?0.92:_0x3fc8fd[_0x24f177(0xee)]?0.98:0x1;return{'text':_0x3fc8fd['text'],'originalTokens':_0x212d36,'compressedTokens':_0x26dc29,'compressionRatio':_0x240eab,'strategyUsed':'format-optimizer','qualityEstimate':_0x15bf63,'wasTruncated':!0x1};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5054f9,_0x156d11){var _0x3ef9ab=_0x2304,_0x4c1e56=_0x5054f9();while(!![]){try{var _0x292a90=-parseInt(_0x3ef9ab(0x142))/0x1+-parseInt(_0x3ef9ab(0x13e))/0x2*(-parseInt(_0x3ef9ab(0x144))/0x3)+parseInt(_0x3ef9ab(0x13f))/0x4+-parseInt(_0x3ef9ab(0x13c))/0x5*(parseInt(_0x3ef9ab(0x145))/0x6)+parseInt(_0x3ef9ab(0x143))/0x7*(-parseInt(_0x3ef9ab(0x13d))/0x8)+-parseInt(_0x3ef9ab(0x140))/0x9*(-parseInt(_0x3ef9ab(0x13a))/0xa)+-parseInt(_0x3ef9ab(0x141))/0xb*(-parseInt(_0x3ef9ab(0x13b))/0xc);if(_0x292a90===_0x156d11)break;else _0x4c1e56['push'](_0x4c1e56['shift']());}catch(_0x347fe5){_0x4c1e56['push'](_0x4c1e56['shift']());}}}(_0x265e,0x85ec1));function _0x2304(_0x1186be,_0x1ac35e){_0x1186be=_0x1186be-0x13a;var _0x265e9b=_0x265e();var _0x2304b2=_0x265e9b[_0x1186be];return _0x2304b2;}export{splitSentences,extractContentWords,STOPWORDS,isStopword}from'./text-utils.js';function _0x265e(){var _0x37689d=['6638004ubCLPB','1089145XorrXJ','6634480vGYQhI','239156IFHNQp','2927936LzglvC','72JwAfrk','11TOIMav','128897DssSLy','7neXZtb','9CZMrFR','6rnkOsf','100870KEDMnS'];_0x265e=function(){return _0x37689d;};return _0x265e();}export{compressRuleBased,ruleBasedStrategy}from'./rule-based.js';export{compressStructural,structuralStrategy}from'./structural.js';export{compressTokenBudget,tokenBudgetStrategy}from'./token-budget.js';export{compressChunked,chunkedStrategy}from'./chunked.js';export{estimateQuality,quickQualityScore}from'./quality.js';export{CompressionPipeline,createDefaultPipeline}from'./pipeline.js';export{anonymizeText,deanonymizeText,anonymizeStrategy}from'./anonymize.js';export{deduplicateText,dedupStrategy}from'./dedup.js';export{CompressionCache,createCachedPipeline}from'./cache.js';export{optimizeFormat,formatOptimizerStrategy}from'./format-optimizer.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x15a0aa=_0x3b61;(function(_0x170cbf,_0x2323a3){const _0xfcd950=_0x3b61,_0x279ed0=_0x170cbf();while(!![]){try{const _0x182d80=-parseInt(_0xfcd950(0x1ba))/0x1*(parseInt(_0xfcd950(0x1b3))/0x2)+parseInt(_0xfcd950(0x1b8))/0x3+parseInt(_0xfcd950(0x1a3))/0x4+parseInt(_0xfcd950(0x1ac))/0x5*(parseInt(_0xfcd950(0x1a7))/0x6)+parseInt(_0xfcd950(0x1a2))/0x7+parseInt(_0xfcd950(0x1b7))/0x8+-parseInt(_0xfcd950(0x1b5))/0x9*(parseInt(_0xfcd950(0x1aa))/0xa);if(_0x182d80===_0x2323a3)break;else _0x279ed0['push'](_0x279ed0['shift']());}catch(_0x582341){_0x279ed0['push'](_0x279ed0['shift']());}}}(_0x1e17,0x5e37f));import{countTokens}from'../../shared/token-counter.js';import{ruleBasedStrategy}from'./rule-based.js';function _0x1e17(){const _0x43dc1d=['13086yLyZPR','text','891wyVkVJ','executeStage','3880520nidnGX','1675173rvCxFT','now','116GJreLz','VaPrz','Uszsw','5017656XiAlfL','1220996TnmNoP','stopOnTarget','join','wasTruncated','6gGehdt','compress','jbJFG','122990XlwdKh','trim','1484975dsiErd','minQuality','runStages','buildFinalResult','map','targetTokens','strategies'];_0x1e17=function(){return _0x43dc1d;};return _0x1e17();}function _0x3b61(_0xe7b4d3,_0x94dee2){_0xe7b4d3=_0xe7b4d3-0x1a1;const _0x1e1754=_0x1e17();let _0x3b61cd=_0x1e1754[_0xe7b4d3];return _0x3b61cd;}import{structuralStrategy}from'./structural.js';import{tokenBudgetStrategy}from'./token-budget.js';import{quickQualityScore}from'./quality.js';const DEFAULT_TARGET_TOKENS=0x1f4,DEFAULT_MIN_QUALITY=0.8;function buildEmptyPipelineResult(){return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':'pipeline','qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}function buildPassthroughResult(_0x199233,_0xa5c579){return{'text':_0x199233,'originalTokens':_0xa5c579,'compressedTokens':_0xa5c579,'compressionRatio':0x1,'strategyUsed':'pipeline','qualityEstimate':0x1,'wasTruncated':!0x1,'stages':[],'qualityReport':{'overallScore':0x1,'informationRetention':0x1,'structuralIntegrity':0x1,'keyTermPreservation':0x1},'targetMet':!0x0};}export class CompressionPipeline{[_0x15a0aa(0x1b2)];[_0x15a0aa(0x1b1)];['minQuality'];['stopOnTarget'];constructor(_0x4245f8){const _0x196eea=_0x15a0aa;this['strategies']=_0x4245f8['strategies'],this['targetTokens']=_0x4245f8['targetTokens']??0x1f4,this[_0x196eea(0x1ad)]=_0x4245f8[_0x196eea(0x1ad)]??0.8,this[_0x196eea(0x1a4)]=_0x4245f8['stopOnTarget']??!0x0;}[_0x15a0aa(0x1a8)](_0x59dd11,_0x582d61){const _0xb2d3e0=_0x15a0aa,_0x41460a={'xKAiI':function(_0x557804){return _0x557804();},'jbJFG':function(_0x5e701a,_0x1e083e){return _0x5e701a(_0x1e083e);},'Uszsw':function(_0x3d38ad,_0x2efd21,_0x821ca1){return _0x3d38ad(_0x2efd21,_0x821ca1);}},_0x53bf2c=_0x582d61??this[_0xb2d3e0(0x1b1)];if(!_0x59dd11||!_0x59dd11[_0xb2d3e0(0x1ab)]())return _0x41460a['xKAiI'](buildEmptyPipelineResult);const _0x5833ff=_0x59dd11,_0x31f15b=_0x41460a[_0xb2d3e0(0x1a9)](countTokens,_0x59dd11);if(_0x31f15b<=_0x53bf2c)return _0x41460a[_0xb2d3e0(0x1a1)](buildPassthroughResult,_0x59dd11,_0x31f15b);const {compressedText:_0x166d68,stages:_0x5ef6db,wasTruncated:_0x24e9d1}=this[_0xb2d3e0(0x1ae)](_0x5833ff,_0x31f15b,_0x53bf2c);return this[_0xb2d3e0(0x1af)](_0x5833ff,_0x31f15b,_0x166d68,_0x5ef6db,_0x24e9d1,_0x53bf2c);}[_0x15a0aa(0x1ae)](_0x2f0876,_0x592e1e,_0x291065){const _0x331b30=_0x15a0aa,_0x35b896={'BeOqW':function(_0x2aa57f,_0xe342c6){return _0x2aa57f<=_0xe342c6;},'ZhxJa':function(_0x4a367d,_0x1706e0){return _0x4a367d>_0x1706e0;}};let _0x5cd851=_0x2f0876;const _0x277ae3=[];let _0x3944ed=!0x1;for(const _0x31c5f2 of this[_0x331b30(0x1b2)]){const _0x4de77f=countTokens(_0x5cd851);if(this[_0x331b30(0x1a4)]&&_0x35b896['BeOqW'](_0x4de77f,_0x291065))break;const _0x441767=this['executeStage'](_0x31c5f2,_0x5cd851,_0x291065,_0x592e1e);if(quickQualityScore(_0x2f0876,_0x441767['text'])<this[_0x331b30(0x1ad)]&&_0x35b896['ZhxJa'](_0x277ae3['length'],0x0))break;_0x277ae3['push'](_0x441767['stageMetrics']),_0x5cd851=_0x441767[_0x331b30(0x1b4)],_0x441767[_0x331b30(0x1a6)]&&(_0x3944ed=!0x0);}return{'compressedText':_0x5cd851,'stages':_0x277ae3,'wasTruncated':_0x3944ed};}[_0x15a0aa(0x1b6)](_0x41068f,_0x1463ce,_0x3c5b68,_0x26905f){const _0x46f687=_0x15a0aa,_0x122e7d={'mXFrQ':function(_0x39616c,_0x13edc3){return _0x39616c(_0x13edc3);},'rAXsv':function(_0x155cf0,_0x3874fa){return _0x155cf0-_0x3874fa;},'bsEqv':function(_0x213b4e,_0x49ebdb){return _0x213b4e-_0x49ebdb;}},_0x55b5ca=_0x122e7d['mXFrQ'](countTokens,_0x1463ce),_0x53430a=performance['now'](),_0x3e54b6={'maxTokens':_0x3c5b68,'targetRatio':_0x3c5b68/_0x26905f},_0x444fa2=_0x41068f[_0x46f687(0x1a8)](_0x1463ce,_0x3e54b6),_0x574fbb=_0x122e7d['rAXsv'](performance[_0x46f687(0x1b9)](),_0x53430a);return{'text':_0x444fa2[_0x46f687(0x1b4)],'wasTruncated':_0x444fa2[_0x46f687(0x1a6)],'stageMetrics':{'strategyName':_0x41068f['name'],'inputTokens':_0x55b5ca,'outputTokens':_0x444fa2['compressedTokens'],'savingsRatio':_0x55b5ca>0x0?_0x122e7d['bsEqv'](0x1,_0x444fa2['compressedTokens']/_0x55b5ca):0x0,'durationMs':_0x574fbb}};}['buildFinalResult'](_0x3b37be,_0x51ae62,_0x5835b0,_0x22b72e,_0x4f066a,_0x5bd806){const _0x53a602=_0x15a0aa,_0xa582f5={'lHtXm':function(_0x19dadb,_0x4f9db0){return _0x19dadb>_0x4f9db0;},'VaPrz':function(_0x4fe5d0,_0x3cb655){return _0x4fe5d0/_0x3cb655;}},_0x214b85=countTokens(_0x5835b0),_0xd6cf14=quickQualityScore(_0x3b37be,_0x5835b0);return{'text':_0x5835b0,'originalTokens':_0x51ae62,'compressedTokens':_0x214b85,'compressionRatio':_0xa582f5['lHtXm'](_0x214b85,0x0)?_0xa582f5[_0x53a602(0x1bb)](_0x51ae62,_0x214b85):0x1,'strategyUsed':_0x22b72e[_0x53a602(0x1b0)](_0x6ef779=>_0x6ef779['strategyName'])[_0x53a602(0x1a5)]('+'),'qualityEstimate':_0xd6cf14,'wasTruncated':_0x4f066a,'stages':_0x22b72e,'qualityReport':{'overallScore':_0xd6cf14,'informationRetention':_0xd6cf14,'structuralIntegrity':_0xd6cf14,'keyTermPreservation':_0xd6cf14},'targetMet':_0x214b85<=_0x5bd806};}}export function createDefaultPipeline(_0x596a99){return new CompressionPipeline({'strategies':[ruleBasedStrategy,structuralStrategy,tokenBudgetStrategy],'targetTokens':_0x596a99,'minQuality':0.8,'stopOnTarget':!0x0});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x1dde(){const _0x21a2e3=['165887kDghJE','has','6318MGSyOw','8UVgLWy','54OxMWdf','2WGcuGr','FOijN','TjOok','8937szrTQV','match','LXaII','36145SUNLOw','slice','4751772HOrkvr','size','filter','ymOaX','QTaNl','map','length','overallScore','QkRWb','eDcGs','95084IrAMxf','425005PfLGAO','970qmjnwj','qjZYh','sort','12yUtcoX'];_0x1dde=function(){return _0x21a2e3;};return _0x1dde();}(function(_0x336a68,_0x4ef4f6){const _0x5325da=_0x59b8,_0x2148a5=_0x336a68();while(!![]){try{const _0x2d5a28=parseInt(_0x5325da(0x1f6))/0x1*(-parseInt(_0x5325da(0x1fb))/0x2)+parseInt(_0x5325da(0x1f8))/0x3*(-parseInt(_0x5325da(0x1f5))/0x4)+parseInt(_0x5325da(0x201))/0x5*(-parseInt(_0x5325da(0x1fa))/0x6)+-parseInt(_0x5325da(0x1f1))/0x7*(-parseInt(_0x5325da(0x1f9))/0x8)+parseInt(_0x5325da(0x1fe))/0x9*(-parseInt(_0x5325da(0x1f2))/0xa)+-parseInt(_0x5325da(0x1f0))/0xb+parseInt(_0x5325da(0x203))/0xc;if(_0x2d5a28===_0x4ef4f6)break;else _0x2148a5['push'](_0x2148a5['shift']());}catch(_0x188363){_0x2148a5['push'](_0x2148a5['shift']());}}}(_0x1dde,0x1bf21));function _0x59b8(_0x647bf0,_0x595272){_0x647bf0=_0x647bf0-0x1ea;const _0x1dde2a=_0x1dde();let _0x59b817=_0x1dde2a[_0x647bf0];return _0x59b817;}import{extractContentWords,STOPWORDS}from'./text-utils.js';const INFORMATION_RETENTION_WEIGHT=0.4,STRUCTURAL_INTEGRITY_WEIGHT=0.3,KEY_TERM_PRESERVATION_WEIGHT=0.3,MAX_KEY_TERMS=0xa,STRUCTURAL_MARKERS=[{'pattern':/\n\n/g,'weight':0x1},{'pattern':/^[-*]\s/gm,'weight':0x1},{'pattern':/^#{1,6}\s/gm,'weight':0x1},{'pattern':/```/g,'weight':0x1},{'pattern':/\d{4}[-/.]\d{1,2}[-/.]\d{1,2}/g,'weight':0x2},{'pattern':/\d+[.,]?\d*\s*[€$%]/g,'weight':0x2},{'pattern':/\b\d{3,}\b/g,'weight':1.5}];function getContentTerms(_0x917eaf){const _0x48e8e4=_0x59b8;return new Set(extractContentWords(_0x917eaf)[_0x48e8e4(0x205)](_0x899d6c=>!STOPWORDS['has'](_0x899d6c)));}function measureInformationRetention(_0x11cf71,_0x4bbcf3){const _0xe902f3=_0x59b8,_0x3f3ab6={'TjOok':function(_0x3346ad,_0x54aa8b){return _0x3346ad===_0x54aa8b;},'ymOaX':function(_0x177c3b,_0xb6cc2d){return _0x177c3b(_0xb6cc2d);},'QkRWb':function(_0x239810,_0x1639c6){return _0x239810/_0x1639c6;}},_0x31aec5=getContentTerms(_0x11cf71);if(_0x3f3ab6[_0xe902f3(0x1fd)](0x0,_0x31aec5[_0xe902f3(0x204)]))return 0x1;const _0x407dba=_0x3f3ab6[_0xe902f3(0x206)](getContentTerms,_0x4bbcf3);let _0xfceb7d=0x0;for(const _0x459446 of _0x31aec5)_0x407dba[_0xe902f3(0x1f7)](_0x459446)&&_0xfceb7d++;return _0x3f3ab6[_0xe902f3(0x1ee)](_0xfceb7d,_0x31aec5[_0xe902f3(0x204)]);}function measureStructuralIntegrity(_0x2c760b,_0x538d7e){const _0x364fc9=_0x59b8,_0x29690c={'eDcGs':function(_0x27fd56,_0x1770db){return _0x27fd56>_0x1770db;},'hqAxC':function(_0x164308,_0x30b148){return _0x164308*_0x30b148;},'VMIRA':function(_0x470f5b,_0x3866e8){return _0x470f5b/_0x3866e8;},'LXaII':function(_0x37af19,_0x4622ef){return _0x37af19/_0x4622ef;}};let _0x394a60=0x0,_0x358f3e=0x0;for(const {pattern:_0x5a9804,weight:_0x24a12d}of STRUCTURAL_MARKERS){const _0x550c58=_0x2c760b[_0x364fc9(0x1ff)](_0x5a9804),_0xc72bf6=_0x538d7e[_0x364fc9(0x1ff)](_0x5a9804);if(_0x550c58&&_0x29690c[_0x364fc9(0x1ef)](_0x550c58[_0x364fc9(0x1ec)],0x0)){const _0x41d6a8=_0x550c58[_0x364fc9(0x1ec)],_0x4a4636=_0xc72bf6?.['length']??0x0;_0x394a60+=_0x24a12d,_0x358f3e+=_0x29690c['hqAxC'](_0x24a12d,Math['min'](0x1,_0x29690c['VMIRA'](_0x4a4636,_0x41d6a8)));}}return _0x29690c['eDcGs'](_0x394a60,0x0)?_0x29690c[_0x364fc9(0x200)](_0x358f3e,_0x394a60):0x1;}function measureKeyTermPreservation(_0x1c0141,_0x458250){const _0x120398=_0x59b8,_0x4e7b88={'mIlSa':function(_0x2a89a7,_0x2db350){return _0x2a89a7===_0x2db350;}},_0x5cd7c9=extractContentWords(_0x1c0141)['filter'](_0x576804=>!STOPWORDS[_0x120398(0x1f7)](_0x576804));if(0x0===_0x5cd7c9['length'])return 0x1;const _0x3f9a5a={};for(const _0x77da49 of _0x5cd7c9)_0x3f9a5a[_0x77da49]=(_0x3f9a5a[_0x77da49]||0x0)+0x1;const _0x2b4a52=Object['entries'](_0x3f9a5a)[_0x120398(0x1f4)]((_0x463c52,_0x5cfd37)=>_0x5cfd37[0x1]-_0x463c52[0x1])[_0x120398(0x202)](0x0,0xa)[_0x120398(0x1eb)](([_0x1e07d9])=>_0x1e07d9);if(_0x4e7b88['mIlSa'](0x0,_0x2b4a52['length']))return 0x1;const _0x1f036a=_0x458250['toLowerCase']();let _0x539728=0x0;for(const _0x36495f of _0x2b4a52)_0x1f036a['includes'](_0x36495f)&&_0x539728++;return _0x539728/_0x2b4a52['length'];}export function estimateQuality(_0x7f8db4,_0x3199d2){const _0x38f008=_0x59b8,_0x471cb5={'FOijN':function(_0x7bb73a,_0x4f0a6e,_0x345134){return _0x7bb73a(_0x4f0a6e,_0x345134);},'qjZYh':function(_0x627bd7,_0x20b97d,_0xc387b7){return _0x627bd7(_0x20b97d,_0xc387b7);},'VFiGd':function(_0x5b9920,_0x522552){return _0x5b9920+_0x522552;},'QTaNl':function(_0x1594f8,_0x2a47c5){return _0x1594f8*_0x2a47c5;}},_0x27b2dd=measureInformationRetention(_0x7f8db4,_0x3199d2),_0x1b0b09=_0x471cb5[_0x38f008(0x1fc)](measureStructuralIntegrity,_0x7f8db4,_0x3199d2),_0x3fb61c=_0x471cb5[_0x38f008(0x1f3)](measureKeyTermPreservation,_0x7f8db4,_0x3199d2);return{'overallScore':_0x471cb5['VFiGd'](0.4*_0x27b2dd+0.3*_0x1b0b09,_0x471cb5[_0x38f008(0x1ea)](0.3,_0x3fb61c)),'informationRetention':_0x27b2dd,'structuralIntegrity':_0x1b0b09,'keyTermPreservation':_0x3fb61c};}export function quickQualityScore(_0x44e6af,_0x4dcad7){const _0x5f2422=_0x59b8,_0x1670ef={'EzBAJ':function(_0x3544a8,_0x2a2f30,_0x3e9827){return _0x3544a8(_0x2a2f30,_0x3e9827);}};return _0x1670ef['EzBAJ'](estimateQuality,_0x44e6af,_0x4dcad7)[_0x5f2422(0x1ed)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5b5af9,_0x53e6ba){const _0x20c8ea=_0x1297,_0x5205dd=_0x5b5af9();while(!![]){try{const _0x2e6c9f=-parseInt(_0x20c8ea(0x1aa))/0x1*(parseInt(_0x20c8ea(0x19d))/0x2)+parseInt(_0x20c8ea(0x1a2))/0x3*(-parseInt(_0x20c8ea(0x1a9))/0x4)+parseInt(_0x20c8ea(0x199))/0x5*(parseInt(_0x20c8ea(0x1a6))/0x6)+-parseInt(_0x20c8ea(0x1a1))/0x7+-parseInt(_0x20c8ea(0x1a7))/0x8*(-parseInt(_0x20c8ea(0x1a3))/0x9)+parseInt(_0x20c8ea(0x19a))/0xa+parseInt(_0x20c8ea(0x1a4))/0xb;if(_0x2e6c9f===_0x53e6ba)break;else _0x5205dd['push'](_0x5205dd['shift']());}catch(_0x107e35){_0x5205dd['push'](_0x5205dd['shift']());}}}(_0x439a,0x71439));import{countTokens}from'../../shared/token-counter.js';function _0x439a(){const _0x36a771=['EDzNz','4182696IAIeeg','7929BbciKP','603bwqaeX','15901963rlSQDy','split','6828QpHiGI','68776CuoXpo','min','1176ozAMyK','353dWeiWM','cdvOA','trim','845wvZIEZ','128450lhgMJo','rule-based','replace','2200EMtKTZ','length','removeStopwords'];_0x439a=function(){return _0x36a771;};return _0x439a();}import{isStopword}from'./text-utils.js';const MIN_WORDS_FOR_STOPWORD_REMOVAL=0x1e,BASE_QUALITY_ESTIMATE=0.95,QUALITY_VARIANCE_WEIGHT=0.05,GREETING_START=/^(Sehr\s+geehrte\s+(?:Damen\s+und\s+Herren|Frau|Herr)[^,]*,?\s*|Dear\s+(?:Sir|Madam|Mr|Mrs|Ms)[^,]*,?\s*|Hi\s*,?\s*|Hallo\s*,?\s*|Guten\s+Tag\s*,?\s*|Hello\s*,?\s*)/i,GREETING_END=/\s*(Mit\s+freundlichen\s+Grüßen|Freundliche\s+Grüße|Viele\s+Grüße|Best\s+regards|Kind\s+regards|Sincerely|Regards|Yours\s+(?:truly|faithfully))\s*[.,\s]*$/i,CONTACT_BLOCK=/\n\s*(?:Telefon|Tel\.?|Phone|Fax|Email|E-Mail|Kundennummer|Kd\.?-?Nr\.?):\s*[^\n]+/gi;function stripBoilerplate(_0x29a043){const _0x2d676e=_0x1297;let _0x3ec314=_0x29a043;return _0x3ec314=_0x3ec314['replace'](GREETING_START,''),_0x3ec314=_0x3ec314['replace'](GREETING_END,''),_0x3ec314=_0x3ec314[_0x2d676e(0x19c)](CONTACT_BLOCK,''),_0x3ec314;}function normalizeWhitespace(_0x2e7d78){const _0x7e2f9b=_0x1297;let _0x528781=_0x2e7d78;return _0x528781=_0x528781['replace'](/ {2,}/g,'\x20'),_0x528781=_0x528781[_0x7e2f9b(0x19c)](/\n{3,}/g,'\x0a\x0a'),_0x528781=_0x528781[_0x7e2f9b(0x19c)](/[ \t]+$/gm,''),_0x528781[_0x7e2f9b(0x198)]();}function removeStopwordsFromText(_0x115a14){const _0x52d142=_0x1297,_0x161ccf={'cdvOA':function(_0x169573,_0x3171f2){return _0x169573<=_0x3171f2;}},_0x2273f0=_0x115a14[_0x52d142(0x1a5)](/\s+/);if(_0x161ccf[_0x52d142(0x1ab)](_0x2273f0[_0x52d142(0x19e)],0x1e))return _0x115a14;return _0x2273f0['filter'](_0x4d8002=>!isStopword(_0x4d8002))['join']('\x20');}export function compressRuleBased(_0xae019b,_0x1bae4c={}){const _0x34b7bf=_0x1297,_0xbf2de={'EDzNz':_0x34b7bf(0x19b),'krjhJ':function(_0x2b4154,_0x46b308){return _0x2b4154(_0x46b308);},'dsehq':function(_0x1130b9,_0x35c55d){return _0x1130b9(_0x35c55d);},'hVBGB':function(_0x559aa0,_0x3738a4){return _0x559aa0/_0x3738a4;}};if(!_0xae019b||!_0xae019b[_0x34b7bf(0x198)]())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0xbf2de[_0x34b7bf(0x1a0)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x24ebca=_0xbf2de['krjhJ'](countTokens,_0xae019b);let _0x2c88ec=_0xbf2de['dsehq'](stripBoilerplate,_0xae019b['trim']());_0x2c88ec=normalizeWhitespace(_0x2c88ec),(_0x1bae4c[_0x34b7bf(0x19f)]??!0x0)&&(_0x2c88ec=removeStopwordsFromText(_0x2c88ec));const _0x5481b4=countTokens(_0x2c88ec);return{'text':_0x2c88ec,'originalTokens':_0x24ebca,'compressedTokens':_0x5481b4,'compressionRatio':_0x5481b4>0x0?_0xbf2de['hVBGB'](_0x24ebca,_0x5481b4):0x1,'strategyUsed':_0xbf2de['EDzNz'],'qualityEstimate':Math[_0x34b7bf(0x1a8)](0x1,0.95+_0x5481b4/_0x24ebca*0.05),'wasTruncated':!0x1};}function _0x1297(_0x298d4c,_0x1a8836){_0x298d4c=_0x298d4c-0x198;const _0x439a82=_0x439a();let _0x1297a8=_0x439a82[_0x298d4c];return _0x1297a8;}export const ruleBasedStrategy={'name':'rule-based','compress':compressRuleBased};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x812c16,_0x2920e3){const _0x29deb5=_0x5b4c,_0x2b0957=_0x812c16();while(!![]){try{const _0x1d879a=-parseInt(_0x29deb5(0x70))/0x1+-parseInt(_0x29deb5(0x6d))/0x2+-parseInt(_0x29deb5(0x65))/0x3*(parseInt(_0x29deb5(0x83))/0x4)+-parseInt(_0x29deb5(0x72))/0x5*(-parseInt(_0x29deb5(0x75))/0x6)+-parseInt(_0x29deb5(0x79))/0x7*(parseInt(_0x29deb5(0x7d))/0x8)+parseInt(_0x29deb5(0x73))/0x9+parseInt(_0x29deb5(0x6a))/0xa;if(_0x1d879a===_0x2920e3)break;else _0x2b0957['push'](_0x2b0957['shift']());}catch(_0x4bf599){_0x2b0957['push'](_0x2b0957['shift']());}}}(_0x1f00,0xcb5f3));import{countTokens}from'../../shared/token-counter.js';function _0x1f00(){const _0x345bb1=['floor','724ccIXiq','HRVFE','22482VVwyBc','has','zdzRt','entries','score','42349780kAnLGL','sqrt','log','1920122OJxBtI','maxTokens','map','1250969rELpBa','kKrHr','20NnxcoA','7113519IEJzUQ','index','761328czRScS','GhftF','length','sentence','14oNMEax','jGYEQ','IROfU','sort','4529864GPuIlf','structural','min','SCyOf','push'];_0x1f00=function(){return _0x345bb1;};return _0x1f00();}import{splitSentences,extractContentWords,STOPWORDS}from'./text-utils.js';const DEFAULT_TARGET_RATIO=0.45,MIN_EXTRACTIVE_SENTENCES=0x2,MIN_TARGET_TOKENS=0x32,BASE_QUALITY_ESTIMATE=0.85,QUALITY_VARIANCE_WEIGHT=0.15;function computeDocumentFrequency(_0x2bf3c8){const _0x1722ca=_0x5b4c,_0xf19b63={'iYBFb':function(_0x5e6db0,_0x598b71){return _0x5e6db0+_0x598b71;}},_0xf43a72={};for(const _0x5f06ec of _0x2bf3c8){const _0x4082ec=new Set(_0x5f06ec);for(const _0x2eb8f9 of _0x4082ec)STOPWORDS[_0x1722ca(0x66)](_0x2eb8f9)||(_0xf43a72[_0x2eb8f9]=_0xf19b63['iYBFb'](_0xf43a72[_0x2eb8f9]||0x0,0x1));}return _0xf43a72;}function computeTermFrequency(_0x423ded){const _0x384174=_0x5b4c,_0x49f550={};for(const _0x68934e of _0x423ded)STOPWORDS[_0x384174(0x66)](_0x68934e)||(_0x49f550[_0x68934e]=(_0x49f550[_0x68934e]||0x0)+0x1);return _0x49f550;}function buildTfIdfVector(_0xecbba2,_0x74091f,_0x18a411){const _0x2794a6=_0x5b4c,_0x472138={'GAaQP':function(_0x446b44,_0x2afdf1){return _0x446b44+_0x2afdf1;}},_0x13fdd8={};for(const [_0x2fb49f,_0x3dd5dc]of Object['entries'](_0xecbba2)){const _0x543594=Math[_0x2794a6(0x6c)](_0x472138['GAaQP'](_0x18a411,0x1)/((_0x74091f[_0x2fb49f]||0x0)+0x1));_0x13fdd8[_0x2fb49f]=_0x3dd5dc*_0x543594;}return _0x13fdd8;}function _0x5b4c(_0x1c1ad3,_0xfbaf51){_0x1c1ad3=_0x1c1ad3-0x65;const _0x1f000e=_0x1f00();let _0x5b4cc0=_0x1f000e[_0x1c1ad3];return _0x5b4cc0;}function buildTfIdf(_0x106531){const _0x47d323=_0x5b4c,_0x49c6bb={'HRVFE':function(_0x2dd62e,_0x1d6159){return _0x2dd62e(_0x1d6159);}},_0x32599c=_0x106531['length'],_0x162ea7=_0x106531['map'](extractContentWords),_0x45ee35=_0x49c6bb[_0x47d323(0x84)](computeDocumentFrequency,_0x162ea7);return _0x162ea7['map'](_0x29a82a=>buildTfIdfVector(computeTermFrequency(_0x29a82a),_0x45ee35,_0x32599c));}function computeCentroid(_0x2ece8a){const _0xdaf74f=_0x5b4c,_0x414e01={'sdCzZ':function(_0x1d6373,_0x277417){return _0x1d6373+_0x277417;},'Iuvqj':function(_0x3c0022,_0x53310d){return _0x3c0022/_0x53310d;}},_0x17a2df={},_0x237610=_0x2ece8a['length'];for(const _0x5c1e3b of _0x2ece8a)for(const [_0xb62ec5,_0x4b3647]of Object[_0xdaf74f(0x68)](_0x5c1e3b))_0x17a2df[_0xb62ec5]=_0x414e01['sdCzZ'](_0x17a2df[_0xb62ec5]||0x0,_0x414e01['Iuvqj'](_0x4b3647,_0x237610));return _0x17a2df;}function cosineSimilarity(_0x5b4d6f,_0x371d9d){const _0x186be6=_0x5b4c,_0x3fb5ee={'UcUgM':function(_0x2add8c,_0x46be18){return _0x2add8c*_0x46be18;},'kKrHr':function(_0x53ea39,_0x9692a5){return _0x53ea39*_0x9692a5;},'zdzRt':function(_0x4062c5,_0x5f46ce){return _0x4062c5/_0x5f46ce;}},_0x5d5d45=new Set([...Object['keys'](_0x5b4d6f),...Object['keys'](_0x371d9d)]);let _0x4295ba=0x0,_0x3f5014=0x0,_0x43371f=0x0;for(const _0x2d0e6f of _0x5d5d45){const _0x2e6a43=_0x5b4d6f[_0x2d0e6f]||0x0,_0x72bd9f=_0x371d9d[_0x2d0e6f]||0x0;_0x4295ba+=_0x3fb5ee['UcUgM'](_0x2e6a43,_0x72bd9f),_0x3f5014+=_0x2e6a43*_0x2e6a43,_0x43371f+=_0x3fb5ee[_0x186be6(0x71)](_0x72bd9f,_0x72bd9f);}const _0x583de8=_0x3fb5ee['kKrHr'](Math[_0x186be6(0x6b)](_0x3f5014),Math['sqrt'](_0x43371f));return _0x583de8>0x0?_0x3fb5ee[_0x186be6(0x67)](_0x4295ba,_0x583de8):0x0;}function selectTopSentences(_0x588af1,_0x1892a4){const _0x432b54=_0x5b4c,_0x13b528={'jGYEQ':function(_0x34cca4,_0x4dc1a8){return _0x34cca4(_0x4dc1a8);},'GhftF':function(_0x585cc8,_0x1f1870){return _0x585cc8+_0x1f1870;},'VejlL':function(_0xf3d401,_0x3b4a3e){return _0xf3d401<_0x3b4a3e;}},_0x416f0b=[];let _0x354b58=0x0;for(const _0x1fbdd6 of _0x588af1){const _0xfd301b=_0x13b528[_0x432b54(0x7a)](countTokens,_0x1fbdd6['sentence']);if(!(_0x13b528[_0x432b54(0x76)](_0x354b58,_0xfd301b)<=_0x1892a4||_0x13b528['VejlL'](_0x416f0b[_0x432b54(0x77)],0x2)))break;_0x416f0b[_0x432b54(0x81)]({'index':_0x1fbdd6['index'],'sentence':_0x1fbdd6[_0x432b54(0x78)]}),_0x354b58+=_0x13b528[_0x432b54(0x76)](_0xfd301b,0x1);}return _0x416f0b;}function buildEmptyResult(_0x388ba7){return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':_0x388ba7,'qualityEstimate':0x1,'wasTruncated':!0x1};}export function compressStructural(_0x536ffd,_0x28754b={}){const _0x2e9b8f=_0x5b4c,_0x5682c8={'jzjgr':function(_0x2195c9,_0xe44154){return _0x2195c9(_0xe44154);},'poMEV':function(_0x2a4371,_0x10f008){return _0x2a4371(_0x10f008);},'IROfU':'structural','hvTHv':function(_0x5bbc78,_0x26febe){return _0x5bbc78*_0x26febe;},'xtnZC':function(_0x10648c,_0x3b40cc){return _0x10648c>_0x3b40cc;},'oRdtV':function(_0x48aed5,_0x204826){return _0x48aed5/_0x204826;},'ONlQb':function(_0x86931a,_0x54ee48){return _0x86931a+_0x54ee48;},'SCyOf':function(_0x1275e5,_0x358af8){return _0x1275e5/_0x358af8;}};if(!_0x536ffd||!_0x536ffd['trim']())return _0x5682c8['jzjgr'](buildEmptyResult,'structural');const _0x540ec3=_0x5682c8['poMEV'](countTokens,_0x536ffd),_0x2ab140=_0x28754b['targetRatio']??0.45,_0x4e87f9=splitSentences(_0x536ffd);if(_0x4e87f9['length']<=0x2)return{'text':_0x536ffd,'originalTokens':_0x540ec3,'compressedTokens':_0x540ec3,'compressionRatio':0x1,'strategyUsed':_0x5682c8[_0x2e9b8f(0x7b)],'qualityEstimate':0x1,'wasTruncated':!0x1};const _0x213619=buildTfIdf(_0x4e87f9),_0x5ee87b=computeCentroid(_0x213619),_0x23fa77=_0x4e87f9[_0x2e9b8f(0x6f)]((_0x1f6c1d,_0x307db5)=>({'index':_0x307db5,'sentence':_0x1f6c1d,'score':cosineSimilarity(_0x213619[_0x307db5],_0x5ee87b)}));_0x23fa77[_0x2e9b8f(0x7c)]((_0x432d72,_0x139874)=>_0x139874[_0x2e9b8f(0x69)]-_0x432d72[_0x2e9b8f(0x69)]);const _0x4445f6=selectTopSentences(_0x23fa77,_0x28754b[_0x2e9b8f(0x6e)]?Math['min'](_0x28754b[_0x2e9b8f(0x6e)],Math['floor'](_0x5682c8['hvTHv'](_0x540ec3,_0x2ab140))):Math['max'](0x32,Math[_0x2e9b8f(0x82)](_0x5682c8['hvTHv'](_0x540ec3,_0x2ab140))));_0x4445f6[_0x2e9b8f(0x7c)]((_0x5ee4fa,_0x56c678)=>_0x5ee4fa['index']-_0x56c678[_0x2e9b8f(0x74)]);const _0x23a9d6=_0x4445f6[_0x2e9b8f(0x6f)](_0x14626e=>_0x14626e['sentence'])['join']('.\x20'),_0x5679a1=countTokens(_0x23a9d6);return{'text':_0x23a9d6,'originalTokens':_0x540ec3,'compressedTokens':_0x5679a1,'compressionRatio':_0x5682c8['xtnZC'](_0x5679a1,0x0)?_0x5682c8['oRdtV'](_0x540ec3,_0x5679a1):0x1,'strategyUsed':_0x2e9b8f(0x7e),'qualityEstimate':Math[_0x2e9b8f(0x7f)](0x1,_0x5682c8['ONlQb'](0.85,_0x5682c8[_0x2e9b8f(0x80)](_0x5679a1,_0x540ec3)*0.15)),'wasTruncated':!0x0};}export const structuralStrategy={'name':'structural','compress':compressStructural};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const _0x51adf3=_0x310c;(function(_0x5b2979,_0x1f0b1f){const _0x28d6bd=_0x310c,_0x1ad8ad=_0x5b2979();while(!![]){try{const _0x3e497e=parseInt(_0x28d6bd(0x18c))/0x1*(-parseInt(_0x28d6bd(0x1a7))/0x2)+parseInt(_0x28d6bd(0x182))/0x3+parseInt(_0x28d6bd(0x180))/0x4*(-parseInt(_0x28d6bd(0x17f))/0x5)+-parseInt(_0x28d6bd(0x189))/0x6*(parseInt(_0x28d6bd(0x171))/0x7)+-parseInt(_0x28d6bd(0x193))/0x8+-parseInt(_0x28d6bd(0x1a2))/0x9+parseInt(_0x28d6bd(0x165))/0xa;if(_0x3e497e===_0x1f0b1f)break;else _0x1ad8ad['push'](_0x1ad8ad['shift']());}catch(_0x1be6f2){_0x1ad8ad['push'](_0x1ad8ad['shift']());}}}(_0x3f8b,0xa17e8));function _0x3f8b(){const _0x19cb83=['should','von','length','ca.','will','7LOphhF','muss','vs.','müssen','hat','über','trim','des','oder','ggf.','ein','v.a.','e.g.','i.e.','642830Fzbqwk','24mqDUsK','d.h.','1990014LGNHwK','das','does','haben','bei','inkl.','there','5282364cgwqVh','may','filter','158889YYiOCs','Dr.','could','Ms.','they','replace','wollen','975944DsgSrO','were','nur','u.U.','z.B.','bzw.','evtl.','from','had','auch','toLowerCase','can','split','sind','und','8147844WxAKwr','ich','dass','how','with','2hwEPMb','i.d.R.','noch','about','into','wird','etc.','here','\x00PUNKT\x00','28361300TqStgR','those','Nr.','eine','replaceAll','waren','map'];_0x3f8b=function(){return _0x19cb83;};return _0x3f8b();}const ABBREVIATIONS=[_0x51adf3(0x167),_0x51adf3(0x197),_0x51adf3(0x198),'u.a.',_0x51adf3(0x162),_0x51adf3(0x199),_0x51adf3(0x18d),'Prof.',_0x51adf3(0x16f),_0x51adf3(0x17a),_0x51adf3(0x187),_0x51adf3(0x1a8),'o.ä.',_0x51adf3(0x196),_0x51adf3(0x17c),_0x51adf3(0x181),_0x51adf3(0x17d),_0x51adf3(0x17e),_0x51adf3(0x173),'Mr.','Mrs.',_0x51adf3(0x18f),'Jr.','Sr.'],PLACEHOLDER='\x00PUNKT\x00';export function splitSentences(_0x32c872){const _0x20dbfa=_0x51adf3,_0x11c4b4={'oNknH':_0x20dbfa(0x164)};let _0x542fe7=_0x32c872[_0x20dbfa(0x191)](/\s+/g,'\x20')['trim']();for(const _0x1eb56f of ABBREVIATIONS)_0x542fe7=_0x542fe7['replaceAll'](_0x1eb56f,_0x1eb56f[_0x20dbfa(0x169)]('.',_0x11c4b4['oNknH']));return _0x542fe7[_0x20dbfa(0x19f)](/[.!?]\s+|\n+/)[_0x20dbfa(0x16b)](_0x310770=>_0x310770[_0x20dbfa(0x169)](_0x20dbfa(0x164),'.')[_0x20dbfa(0x177)]())[_0x20dbfa(0x18b)](_0x292b8b=>_0x292b8b[_0x20dbfa(0x16e)]>0x0);}function _0x310c(_0x185480,_0x2fd0f0){_0x185480=_0x185480-0x15e;const _0x3f8b7f=_0x3f8b();let _0x310ca3=_0x3f8b7f[_0x185480];return _0x310ca3;}export function extractContentWords(_0x3b486a){const _0x1dc126=_0x51adf3;return _0x3b486a[_0x1dc126(0x19d)]()[_0x1dc126(0x191)](/[^a-zäöüß\s]/g,'')[_0x1dc126(0x19f)](/\s+/)['filter'](_0x567fd8=>_0x567fd8['length']>=0x3);}export const STOPWORDS=new Set(['der','die',_0x51adf3(0x183),'den','dem',_0x51adf3(0x178),_0x51adf3(0x17b),_0x51adf3(0x168),'einer','eines',_0x51adf3(0x1a1),_0x51adf3(0x179),'aber',_0x51adf3(0x1a4),'ist',_0x51adf3(0x1a0),'war',_0x51adf3(0x16a),_0x51adf3(0x161),'werden','für',_0x51adf3(0x16d),'mit',_0x51adf3(0x186),'nach','aus','auf',_0x51adf3(0x176),'unter',_0x51adf3(0x1a3),'wir','sie','man',_0x51adf3(0x185),_0x51adf3(0x175),'hatte','kann',_0x51adf3(0x172),'können',_0x51adf3(0x174),'sollen',_0x51adf3(0x192),'nicht',_0x51adf3(0x19c),_0x51adf3(0x195),_0x51adf3(0x15e),'the','and','for','are','was',_0x51adf3(0x194),'been','being','have','has',_0x51adf3(0x19b),_0x51adf3(0x184),'did',_0x51adf3(0x170),'would',_0x51adf3(0x18e),_0x51adf3(0x16c),_0x51adf3(0x18a),'might','shall',_0x51adf3(0x19e),'this','that','these',_0x51adf3(0x166),_0x51adf3(0x1a6),_0x51adf3(0x19a),_0x51adf3(0x160),_0x51adf3(0x15f),'than','then','them',_0x51adf3(0x190),'their',_0x51adf3(0x188),_0x51adf3(0x163),'what','which','when','where','who','whom',_0x51adf3(0x1a5),'not','but','its']);export function isStopword(_0x45eab8){return STOPWORDS['has'](_0x45eab8['toLowerCase']()['replace'](/[.,;:!?()'"'-]/g,''));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2cba1a,_0x27e730){const _0x3225fe=_0x16b2,_0xcadbea=_0x2cba1a();while(!![]){try{const _0x5d2e5f=parseInt(_0x3225fe(0xfa))/0x1*(parseInt(_0x3225fe(0x105))/0x2)+parseInt(_0x3225fe(0xf4))/0x3+-parseInt(_0x3225fe(0xfb))/0x4*(parseInt(_0x3225fe(0x103))/0x5)+parseInt(_0x3225fe(0xef))/0x6*(-parseInt(_0x3225fe(0x100))/0x7)+parseInt(_0x3225fe(0xee))/0x8+-parseInt(_0x3225fe(0x104))/0x9*(-parseInt(_0x3225fe(0xff))/0xa)+-parseInt(_0x3225fe(0x101))/0xb*(parseInt(_0x3225fe(0xf6))/0xc);if(_0x5d2e5f===_0x27e730)break;else _0xcadbea['push'](_0xcadbea['shift']());}catch(_0x9c38a5){_0xcadbea['push'](_0xcadbea['shift']());}}}(_0x1780,0x3f044));import{countTokens}from'../../shared/token-counter.js';import{splitSentences}from'./text-utils.js';const DEFAULT_TARGET_TOKENS=0x64,MIN_QUALITY_FLOOR=0.5,QUALITY_POSITION_BONUS=0.3;function computeUCurveScore(_0x31086c,_0x81d5c9){const _0x5d2681={'bciQU':function(_0x3d3e6d,_0xd219e9){return _0x3d3e6d-_0xd219e9;}};if(_0x81d5c9<=0x1)return 0x1;const _0x2e8e20=(_0x31086c+0x1)/_0x81d5c9;return 0x2*Math['max'](_0x2e8e20,_0x5d2681['bciQU'](0x1,_0x2e8e20));}function _0x1780(){const _0x577c83=['sentence','40samcBZ','2056663EIMjYC','22JemlNl','sort','10BWlTwZ','1044891Lrtjsy','4euhVfD','tokens','push','346216niwHUe','6FWJYMb','token-budget','tFmsr','BIFMs','score','340278kROEQo','elQZE','1735044bpXPIC','min','RJUBP','maxTokens','127714RtcAZl','70856QCAJnP','index','length'];_0x1780=function(){return _0x577c83;};return _0x1780();}function truncateSingleSentence(_0x4e750b,_0x5666a0,_0x2e9779){const _0x57df24=_0x16b2,_0x50fadc={'tFmsr':function(_0xae3990,_0x47e24c){return _0xae3990+_0x47e24c;},'cFstt':function(_0x4d9825,_0x5b8698){return _0x4d9825>_0x5b8698;}},_0x128116=_0x4e750b['split'](/\s+/);let _0x27f6ea='';for(const _0x5b41f7 of _0x128116){const _0x4e85ca=_0x27f6ea?_0x50fadc[_0x57df24(0xf1)](_0x27f6ea,'\x20')+_0x5b41f7:_0x5b41f7;if(countTokens(_0x4e85ca)>_0x2e9779)break;_0x27f6ea=_0x4e85ca;}const _0x4dc4d1=countTokens(_0x27f6ea);return{'text':_0x27f6ea,'originalTokens':_0x5666a0,'compressedTokens':_0x4dc4d1,'compressionRatio':_0x50fadc['cFstt'](_0x4dc4d1,0x0)?_0x5666a0/_0x4dc4d1:0x1,'strategyUsed':_0x57df24(0xf0),'qualityEstimate':_0x4dc4d1/_0x5666a0,'wasTruncated':!0x0};}function selectSentencesByBudget(_0x3fc62a,_0x17ec2f){const _0x193623=_0x16b2,_0x5d0320={'BgKea':function(_0x140980,_0x28cb24){return _0x140980+_0x28cb24;}},_0x16f8cf=[];let _0x29db46=0x0;for(const _0x388bcd of _0x3fc62a)(_0x5d0320['BgKea'](_0x29db46,_0x388bcd['tokens'])<=_0x17ec2f||0x0===_0x16f8cf[_0x193623(0xfd)])&&(_0x16f8cf[_0x193623(0x107)]({'index':_0x388bcd['index'],'sentence':_0x388bcd[_0x193623(0xfe)]}),_0x29db46+=_0x388bcd[_0x193623(0x106)]+0x1);return _0x16f8cf;}function _0x16b2(_0x556daf,_0x1e890a){_0x556daf=_0x556daf-0xee;const _0x178092=_0x1780();let _0x16b2f5=_0x178092[_0x556daf];return _0x16b2f5;}export function compressTokenBudget(_0x370913,_0x1abc1c={}){const _0x1ad24f=_0x16b2,_0x534fb0={'BIFMs':function(_0x5e7b80,_0x3813df){return _0x5e7b80<=_0x3813df;},'aCOZi':function(_0x10fcc7,_0x3ab7fa){return _0x10fcc7<=_0x3ab7fa;},'elQZE':function(_0x3e655e,_0x1efebf,_0x130581,_0x846968){return _0x3e655e(_0x1efebf,_0x130581,_0x846968);},'ywRao':_0x1ad24f(0xf0),'RJUBP':function(_0x5f07ba,_0x48abaa){return _0x5f07ba/_0x48abaa;}};if(!_0x370913||!_0x370913['trim']())return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'compressionRatio':0x1,'strategyUsed':'token-budget','qualityEstimate':0x1,'wasTruncated':!0x1};const _0x2ca614=countTokens(_0x370913),_0x59d422=_0x1abc1c[_0x1ad24f(0xf9)]??0x64;if(_0x534fb0[_0x1ad24f(0xf2)](_0x2ca614,_0x59d422))return{'text':_0x370913,'originalTokens':_0x2ca614,'compressedTokens':_0x2ca614,'compressionRatio':0x1,'strategyUsed':'token-budget','qualityEstimate':0x1,'wasTruncated':!0x1};const _0x3d950e=splitSentences(_0x370913);if(_0x534fb0['aCOZi'](_0x3d950e['length'],0x1))return _0x534fb0[_0x1ad24f(0xf5)](truncateSingleSentence,_0x370913,_0x2ca614,_0x59d422);const _0x24491d=!0x1!==_0x1abc1c['preserveStructure'],_0x5d6cff=_0x3d950e[_0x1ad24f(0xfd)],_0xb89744=_0x3d950e['map']((_0x24cd23,_0x482f28)=>({'index':_0x482f28,'sentence':_0x24cd23,'tokens':countTokens(_0x24cd23),'score':_0x24491d?computeUCurveScore(_0x482f28,_0x5d6cff):0x1}));_0xb89744[_0x1ad24f(0x102)]((_0x2c1735,_0x563c84)=>_0x563c84['score']-_0x2c1735[_0x1ad24f(0xf3)]);const _0x2b9dba=selectSentencesByBudget(_0xb89744,_0x59d422);_0x2b9dba['sort']((_0x2ab81f,_0x5306f3)=>_0x2ab81f['index']-_0x5306f3[_0x1ad24f(0xfc)]);const _0xcf5706=_0x2b9dba['map'](_0x592adb=>_0x592adb['sentence'])['join']('.\x20'),_0x1c2ffc=countTokens(_0xcf5706);return{'text':_0xcf5706,'originalTokens':_0x2ca614,'compressedTokens':_0x1c2ffc,'compressionRatio':_0x1c2ffc>0x0?_0x2ca614/_0x1c2ffc:0x1,'strategyUsed':_0x534fb0['ywRao'],'qualityEstimate':Math['max'](0.5,Math[_0x1ad24f(0xf7)](0x1,_0x534fb0[_0x1ad24f(0xf8)](_0x1c2ffc,_0x2ca614)+0.3)),'wasTruncated':!0x0};}export const tokenBudgetStrategy={'name':'token-budget','compress':compressTokenBudget};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x5f36(){const _0x2e1b6b=['214074JyvThP','provider','Invalid\x20config:\x20missing\x20or\x20invalid\x20\x22version\x22\x20field','1099812YjcjpT','2036qugIsO','claude','10KraFln','utf-8','rules','4417413TKPIPK','5713265dYuOEI','https://api.simosphere.ai/v1/meter','version','URmxi','6nFYHir','2882512VgSoSZ','isArray','4755HORMyl','tSXrC','model','gpt-4o','926400KvreJt','claude-sonnet-4-20250514','context_limits'];_0x5f36=function(){return _0x2e1b6b;};return _0x5f36();}const _0x54dfc7=_0x53ed;(function(_0x384ac3,_0x26b9c8){const _0x467aaf=_0x53ed,_0x21b2ad=_0x384ac3();while(!![]){try{const _0x401695=parseInt(_0x467aaf(0x131))/0x1+-parseInt(_0x467aaf(0x143))/0x2+parseInt(_0x467aaf(0x13f))/0x3*(-parseInt(_0x467aaf(0x132))/0x4)+parseInt(_0x467aaf(0x138))/0x5+parseInt(_0x467aaf(0x13c))/0x6*(-parseInt(_0x467aaf(0x137))/0x7)+parseInt(_0x467aaf(0x13d))/0x8+-parseInt(_0x467aaf(0x12e))/0x9*(parseInt(_0x467aaf(0x134))/0xa);if(_0x401695===_0x26b9c8)break;else _0x21b2ad['push'](_0x21b2ad['shift']());}catch(_0x33fbe2){_0x21b2ad['push'](_0x21b2ad['shift']());}}}(_0x5f36,0xa5851));import{readFileSync}from'node:fs';function _0x53ed(_0x2e9325,_0x2a4fcf){_0x2e9325=_0x2e9325-0x12c;const _0x5f36f8=_0x5f36();let _0x53ed3c=_0x5f36f8[_0x2e9325];return _0x53ed3c;}import{join}from'node:path';import _0x97d0a8 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':_0x54dfc7(0x139),'batch_interval':0x3c,'send_content':!0x1};export function parseConfig(_0x1450d7){const _0x2a7a0c=_0x54dfc7,_0x355f40={'iwjIw':function(_0xe9bd5b,_0x2ab565){return _0xe9bd5b!=_0x2ab565;},'pFYcF':'number','cCWxh':function(_0x5de85a,_0x488260){return _0x5de85a===_0x488260;},'PWAgG':_0x2a7a0c(0x142)},_0x42f194=_0x97d0a8['load'](_0x1450d7);if(!_0x42f194||_0x355f40['iwjIw'](_0x355f40['pFYcF'],typeof _0x42f194[_0x2a7a0c(0x13a)]))throw new Error(_0x2a7a0c(0x130));const _0x259a27=_0x42f194[_0x2a7a0c(0x12f)]??_0x2a7a0c(0x133),_0x5b1c06=_0x42f194[_0x2a7a0c(0x141)]??(_0x355f40['cCWxh'](_0x2a7a0c(0x133),_0x259a27)?_0x2a7a0c(0x12c):_0x355f40['PWAgG']),_0x4db4c9=listProviders();if(!_0x4db4c9['includes'](_0x259a27))throw new Error('Unknown\x20provider:\x20'+_0x259a27+'.\x20Known:\x20'+_0x4db4c9['join'](',\x20'));const _0x162a39=Array[_0x2a7a0c(0x13e)](_0x42f194[_0x2a7a0c(0x136)])?_0x42f194[_0x2a7a0c(0x136)]:[],_0x3f49dd=_0x42f194[_0x2a7a0c(0x12d)]??DEFAULT_LIMITS,_0x7fc26f=_0x42f194['metering']??DEFAULT_METERING;return{'version':_0x42f194[_0x2a7a0c(0x13a)],'provider':_0x259a27,'model':_0x5b1c06,'rules':_0x162a39,'context_limits':_0x3f49dd,'metering':_0x7fc26f};}export function loadConfigFromString(_0x1603c3){const _0x30285f=_0x54dfc7,_0x46ff48={'tSXrC':function(_0xc03b56,_0x1cfa90){return _0xc03b56(_0x1cfa90);}};return _0x46ff48[_0x30285f(0x140)](parseConfig,_0x1603c3);}export function loadConfig(_0x37a8f4){const _0x31fbe0=_0x54dfc7,_0x25feea={'URmxi':function(_0x573183,_0x3f6098,_0x2acb52){return _0x573183(_0x3f6098,_0x2acb52);}},_0x2452b5=_0x25feea[_0x31fbe0(0x13b)](join,_0x37a8f4,CONFIG_FILENAME);return parseConfig(_0x25feea[_0x31fbe0(0x13b)](readFileSync,_0x2452b5,_0x31fbe0(0x135)));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4bc00d,_0x44a0df){const _0x988738=_0x5806,_0x35a062=_0x4bc00d();while(!![]){try{const _0x1fa79b=parseInt(_0x988738(0x1b0))/0x1+-parseInt(_0x988738(0x1aa))/0x2+parseInt(_0x988738(0x1ae))/0x3+parseInt(_0x988738(0x1b5))/0x4*(-parseInt(_0x988738(0x1b1))/0x5)+-parseInt(_0x988738(0x1a3))/0x6*(parseInt(_0x988738(0x1ab))/0x7)+parseInt(_0x988738(0x1ad))/0x8+parseInt(_0x988738(0x1a4))/0x9;if(_0x1fa79b===_0x44a0df)break;else _0x35a062['push'](_0x35a062['shift']());}catch(_0x8b91fb){_0x35a062['push'](_0x35a062['shift']());}}}(_0x4deb,0x4b89a));function _0x4deb(){const _0x4ad7b4=['5mEbnBd','compressedTokens','\x20Token]','text','1839132LWJmtT','aWqZP','8562ZgbNQN','4719663DLOgUk','floor','\x0a\x0a[...\x20gekuerzt,\x20','wasTruncated','split','length','40490USxcOY','1757GEvoUK','\x20→\x20','151896dWdwCh','1231344lJGgTs','max','193765UUziRl'];_0x4deb=function(){return _0x4ad7b4;};return _0x4deb();}function _0x5806(_0x2e4fb2,_0x13c48a){_0x2e4fb2=_0x2e4fb2-0x1a3;const _0x4debea=_0x4deb();let _0x58062e=_0x4debea[_0x2e4fb2];return _0x58062e;}import{countTokens}from'../shared/token-counter.js';import{createDefaultPipeline}from'./compression/index.js';export function compressContext(_0x3aeb7e,_0x202de9){const _0x26d78e=_0x5806,_0x168658={'aWqZP':function(_0x4a620b,_0x25c079){return _0x4a620b<=_0x25c079;},'LGJOz':function(_0x1b19a7,_0x542c6b){return _0x1b19a7(_0x542c6b);},'sPmXY':function(_0x1bb2b5,_0x8c6028){return _0x1bb2b5+_0x8c6028;},'tjSGU':function(_0x461772,_0xadff61){return _0x461772>_0xadff61;},'CgiMq':function(_0x42aed9,_0x449d25){return _0x42aed9+_0x449d25;}};if(!_0x3aeb7e)return{'text':'','originalTokens':0x0,'compressedTokens':0x0,'wasTruncated':!0x1};const _0x27b0ae=countTokens(_0x3aeb7e);if(_0x168658[_0x26d78e(0x1b6)](_0x27b0ae,_0x202de9))return{'text':_0x3aeb7e,'originalTokens':_0x27b0ae,'compressedTokens':_0x27b0ae,'wasTruncated':!0x1};const _0x60fdc8=_0x168658['LGJOz'](createDefaultPipeline,_0x202de9)['compress'](_0x3aeb7e,_0x202de9);if(_0x60fdc8[_0x26d78e(0x1b2)]<=_0x202de9)return{'text':_0x60fdc8['text'],'originalTokens':_0x60fdc8['originalTokens'],'compressedTokens':_0x60fdc8['compressedTokens'],'wasTruncated':_0x60fdc8[_0x26d78e(0x1a7)]};const _0x3095e9=_0x60fdc8[_0x26d78e(0x1b4)][_0x26d78e(0x1a8)](/\s+/);let _0x4beb7c='';for(const _0x3fe039 of _0x3095e9){const _0x1cbc51=_0x4beb7c?_0x168658['sPmXY'](_0x4beb7c,'\x20')+_0x3fe039:_0x3fe039;if(_0x168658['tjSGU'](_0x168658['LGJOz'](countTokens,_0x1cbc51),_0x202de9-0xa))break;_0x4beb7c=_0x1cbc51;}const _0x585ec1=_0x168658['CgiMq'](_0x4beb7c,_0x26d78e(0x1a6)+_0x27b0ae+_0x26d78e(0x1ac)+countTokens(_0x4beb7c)+_0x26d78e(0x1b3));return{'text':_0x585ec1,'originalTokens':_0x27b0ae,'compressedTokens':countTokens(_0x585ec1),'wasTruncated':!0x0};}export function compressContextBudget(_0x5dfb12,_0x2957c6){const _0x31bdce=_0x5806,_0x507c0d=Math[_0x31bdce(0x1a5)](_0x2957c6/Math[_0x31bdce(0x1af)](_0x5dfb12[_0x31bdce(0x1a9)],0x1));return _0x5dfb12['map'](({label:_0x11f47e,text:_0x2bff84})=>({'label':_0x11f47e,'result':compressContext(_0x2bff84,_0x507c0d)}));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x4745(){const _0x2c814d=['push','prompt','1031128BxbvsQ','hook_event_name','join','944694GAcqur','engine','7CxCqnU','max_injected_tokens','content',']\x20Relevanter\x20Kontext:\x20','48188eRSMne','summary_only','collector','VhokY','110XvIZut','limits','\x20Token)','2220038sqXRzv','now','projectRoot','dtDmg','3RHbUpz','handlePreCompact','min','getSessionSummary','load','7740eKWXqA','max_tokens','2006279pCsoRk','kAyRH','trigger','11216gXIVZB','1448225GanZTY'];_0x4745=function(){return _0x2c814d;};return _0x4745();}function _0x3f5b(_0x556b6c,_0xf0f910){_0x556b6c=_0x556b6c-0x14e;const _0x474515=_0x4745();let _0x3f5b1b=_0x474515[_0x556b6c];return _0x3f5b1b;}const _0x11540d=_0x3f5b;(function(_0x21f731,_0x39ff57){const _0x4d6797=_0x3f5b,_0x4b4581=_0x21f731();while(!![]){try{const _0x3292ec=parseInt(_0x4d6797(0x155))/0x1+-parseInt(_0x4d6797(0x165))/0x2+parseInt(_0x4d6797(0x169))/0x3*(-parseInt(_0x4d6797(0x15e))/0x4)+parseInt(_0x4d6797(0x152))/0x5+parseInt(_0x4d6797(0x158))/0x6*(-parseInt(_0x4d6797(0x15a))/0x7)+-parseInt(_0x4d6797(0x151))/0x8*(parseInt(_0x4d6797(0x16e))/0x9)+parseInt(_0x4d6797(0x162))/0xa*(parseInt(_0x4d6797(0x14e))/0xb);if(_0x3292ec===_0x39ff57)break;else _0x4b4581['push'](_0x4b4581['shift']());}catch(_0xea3a3c){_0x4b4581['push'](_0x4b4581['shift']());}}}(_0x4745,0xcd859));import{RuleEngine}from'./rule-engine.js';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{['engine'];[_0x11540d(0x160)];[_0x11540d(0x167)];constructor(_0x278e66,_0x381379,_0x404847){const _0x53758c=_0x11540d;this['engine']=new RuleEngine(_0x278e66),this['projectRoot']=_0x381379,this[_0x53758c(0x160)]=new MetricsCollector(_0x381379,_0x404847||'session-'+Date[_0x53758c(0x166)]());}['handleUserPromptSubmit'](_0x15fcf9){const _0x4d7509=_0x11540d,_0x1d572f={'kAyRH':function(_0x4ac3bb,_0x497e46){return _0x4ac3bb(_0x497e46);},'FTbdr':function(_0x36fcff,_0x1dd047){return _0x36fcff>_0x1dd047;},'HDUqe':function(_0x49ec1e,_0x2e5763){return _0x49ec1e(_0x2e5763);},'VhokY':function(_0x5a77a3,_0x4e32a8){return _0x5a77a3+_0x4e32a8;}},_0x57c2ac=_0x15fcf9[_0x4d7509(0x154)]||'',_0x206d31=this['engine']['match'](_0x57c2ac);if(0x0===_0x206d31['length']){const _0x1092ad=_0x1d572f['kAyRH'](countTokens,_0x57c2ac);return this[_0x4d7509(0x160)]['record']({'hook_event':_0x15fcf9[_0x4d7509(0x156)],'baseline_tokens':_0x1092ad,'optimized_tokens':_0x1092ad,'rule_matched':null}),{};}const _0x3b5503=[],_0x2f4c5c=[];for(const _0x5257ca of _0x206d31)_0x2f4c5c[_0x4d7509(0x153)](_0x5257ca[_0x4d7509(0x150)][0x0]),_0x5257ca[_0x4d7509(0x15f)]?_0x3b5503['push']('['+_0x5257ca['trigger'][0x0]+']\x20Fuer\x20Details:\x20'+_0x5257ca[_0x4d7509(0x16d)]+'\x20laden.'):_0x3b5503[_0x4d7509(0x153)]('['+_0x5257ca['trigger'][0x0]+_0x4d7509(0x15d)+_0x5257ca[_0x4d7509(0x16d)]+'\x20(max\x20'+(_0x5257ca[_0x4d7509(0x16f)]||this[_0x4d7509(0x159)][_0x4d7509(0x163)]['max_file_tokens'])+_0x4d7509(0x164));let _0x294dd6=_0x3b5503['join']('\x0a');const _0x3ed870=this[_0x4d7509(0x159)][_0x4d7509(0x163)]['compress_above'];_0x1d572f['FTbdr'](_0x3ed870,0x0)&&(_0x294dd6=compressContext(_0x294dd6,_0x3ed870)['text']);const _0x59ac15=_0x1d572f[_0x4d7509(0x14f)](countTokens,_0x57c2ac),_0x5b942c=_0x1d572f['HDUqe'](countTokens,_0x294dd6),_0x280468=_0x59ac15+this['engine'][_0x4d7509(0x163)]['max_injected_tokens'],_0x1211d9=_0x1d572f[_0x4d7509(0x161)](_0x59ac15,Math[_0x4d7509(0x16b)](_0x5b942c,this['engine'][_0x4d7509(0x163)][_0x4d7509(0x15b)]));return this['collector']['record']({'hook_event':_0x15fcf9[_0x4d7509(0x156)],'baseline_tokens':_0x280468,'optimized_tokens':_0x1211d9,'rule_matched':_0x2f4c5c[_0x4d7509(0x157)]('+')}),{'additionalContext':_0x294dd6};}[_0x11540d(0x16a)](_0x4cbf8e){const _0x1718a5=_0x11540d,_0x5ce4df={'afyWo':function(_0x70786f,_0x483d08){return _0x70786f===_0x483d08;},'dtDmg':function(_0x118af3,_0x4c0a7a,_0x477d93){return _0x118af3(_0x4c0a7a,_0x477d93);}},_0x17cc0c=[];if(_0x4cbf8e['prompt']&&_0x17cc0c['push']({'role':'user','content':_0x4cbf8e[_0x1718a5(0x154)],'turnIndex':0x0}),_0x5ce4df['afyWo'](0x0,_0x17cc0c['length']))return{};const _0x4b771f=_0x5ce4df[_0x1718a5(0x168)](prioritizeContext,_0x17cc0c,this[_0x1718a5(0x159)][_0x1718a5(0x163)]),_0x10a013=_0x4b771f['prioritized']['map'](_0x284ef7=>_0x284ef7[_0x1718a5(0x15c)])['join']('\x0a\x0a');return this['collector']['record']({'hook_event':_0x4cbf8e[_0x1718a5(0x156)],'baseline_tokens':_0x4b771f['totalOriginalTokens'],'optimized_tokens':_0x4b771f['totalCompressedTokens'],'rule_matched':null}),{'additionalContext':_0x10a013};}['handleSessionStop'](){const _0x148891=_0x11540d;return this['collector']['flush'](),this[_0x148891(0x160)]['getSummary']();}[_0x11540d(0x16c)](){return this['collector']['getSummary']();}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x51764a=_0x4895;(function(_0xe91d1a,_0x5605b6){const _0x54e980=_0x4895,_0x3b1837=_0xe91d1a();while(!![]){try{const _0x4ab4ec=parseInt(_0x54e980(0xdc))/0x1*(parseInt(_0x54e980(0xe8))/0x2)+parseInt(_0x54e980(0xdd))/0x3+parseInt(_0x54e980(0xe3))/0x4+parseInt(_0x54e980(0xe6))/0x5+parseInt(_0x54e980(0xde))/0x6+parseInt(_0x54e980(0xea))/0x7*(parseInt(_0x54e980(0xef))/0x8)+-parseInt(_0x54e980(0xe1))/0x9*(parseInt(_0x54e980(0xee))/0xa);if(_0x4ab4ec===_0x5605b6)break;else _0x3b1837['push'](_0x3b1837['shift']());}catch(_0x294309){_0x3b1837['push'](_0x3b1837['shift']());}}}(_0x5e84,0xe6085));function _0x4895(_0x277424,_0x1ce159){_0x277424=_0x277424-0xd9;const _0x5e8453=_0x5e84();let _0x489558=_0x5e8453[_0x277424];return _0x489558;}function _0x5e84(){const _0xd414c6=['13214529ltRjcp','total_baseline','4235060RLYgYu','stringify','QnAMs','858115mCXFmd','send','314SWIGAC','http_','170968hXMIlb','Stop','YenLr','team_id','20bbloFc','8BlHOBR','application/json','total_optimized','total_delta','5089rVqePp','82404ydcxyu','10785132PPmPng','session_id','provider'];_0x5e84=function(){return _0xd414c6;};return _0x5e84();}export function buildMeterPayload(_0x514a34,_0x31bbcb){const _0x48f6fc=_0x4895,_0x5e0c7e={'YenLr':_0x48f6fc(0xeb)};return{'session_id':_0x514a34[_0x48f6fc(0xdf)],'tokens_saved':_0x514a34[_0x48f6fc(0xdb)],'baseline_tokens':_0x514a34[_0x48f6fc(0xe2)],'optimized_tokens':_0x514a34[_0x48f6fc(0xda)],'hook_event':_0x5e0c7e[_0x48f6fc(0xec)],'provider':_0x31bbcb[_0x48f6fc(0xe0)],'model':_0x31bbcb['model'],'team_id':_0x31bbcb[_0x48f6fc(0xed)]??''};}export class MeteringClient{['endpoint'];constructor(_0x50edbf){this['endpoint']=_0x50edbf;}async[_0x51764a(0xe7)](_0x12f12c){const _0x355616=_0x51764a,_0x1cb984={'QnAMs':'no_endpoint','KJXRD':_0x355616(0xd9)};if(!this['endpoint'])return{'sent':!0x1,'reason':_0x1cb984[_0x355616(0xe5)]};try{const _0x55215a=await fetch(this['endpoint'],{'method':'POST','headers':{'Content-Type':_0x1cb984['KJXRD'],'Authorization':'Bearer\x20'+(process.env.TOKENIZER_API_KEY||'')},'body':JSON[_0x355616(0xe4)](_0x12f12c),'signal':AbortSignal['timeout'](0x1388)});return _0x55215a['ok']?{'sent':!0x0}:{'sent':!0x1,'reason':_0x355616(0xe9)+_0x55215a['status']};}catch{return{'sent':!0x1,'reason':'network_error'};}}}
|