@syke1/mcp-server 1.5.6 → 1.6.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.
@@ -1,281 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.FileCache = void 0;
37
- const fs = __importStar(require("fs"));
38
- const path = __importStar(require("path"));
39
- const events_1 = require("events");
40
- const plugin_1 = require("../languages/plugin");
41
- const incremental_1 = require("../graph/incremental");
42
- const memo_cache_1 = require("../graph/memo-cache");
43
- /**
44
- * FileCache: Holds ALL source files in memory.
45
- * Emits "change" events when files are modified on disk.
46
- */
47
- class FileCache extends events_1.EventEmitter {
48
- constructor(projectRoot) {
49
- super();
50
- this.projectRoot = projectRoot;
51
- this.cache = new Map(); // abs path → content
52
- this.sourceDirs = [];
53
- this.watcher = null;
54
- this.debounceTimers = new Map();
55
- this.DEBOUNCE_MS = 1500;
56
- this.graph = null;
57
- this.plugins = (0, plugin_1.detectLanguages)(projectRoot);
58
- // Collect all extensions from detected plugins
59
- const allExts = new Set();
60
- for (const plugin of this.plugins) {
61
- for (const ext of plugin.extensions) {
62
- allExts.add(ext);
63
- }
64
- }
65
- this.extensions = allExts.size > 0 ? allExts : new Set([".ts"]);
66
- // Collect all source dirs
67
- for (const plugin of this.plugins) {
68
- for (const dir of plugin.getSourceDirs(projectRoot)) {
69
- if (!this.sourceDirs.includes(dir)) {
70
- this.sourceDirs.push(dir);
71
- }
72
- }
73
- }
74
- }
75
- /** Primary source directory (backward compat) */
76
- get sourceDir() {
77
- return this.sourceDirs[0] || path.join(this.projectRoot, "src");
78
- }
79
- /**
80
- * Set the dependency graph reference for incremental updates.
81
- * When a graph is set, file changes will trigger incremental
82
- * edge updates and memo cache invalidation instead of requiring
83
- * a full graph rebuild.
84
- */
85
- setGraph(graph) {
86
- this.graph = graph;
87
- }
88
- /** Load ALL source files into memory on startup */
89
- initialize() {
90
- let totalLines = 0;
91
- for (const plugin of this.plugins) {
92
- for (const dir of plugin.getSourceDirs(this.projectRoot)) {
93
- const files = plugin.discoverFiles(dir);
94
- for (const file of files) {
95
- try {
96
- const content = fs.readFileSync(file, "utf-8");
97
- this.cache.set(path.normalize(file), content);
98
- totalLines += content.split("\n").length;
99
- }
100
- catch (_) {
101
- // skip unreadable files
102
- }
103
- }
104
- }
105
- }
106
- console.error(`[syke:cache] Loaded ${this.cache.size} files (${totalLines.toLocaleString()} lines) into memory`);
107
- return { fileCount: this.cache.size, totalLines };
108
- }
109
- /** Start watching source directories for changes */
110
- startWatching() {
111
- if (this.watcher)
112
- return;
113
- // Watch each source directory
114
- for (const dir of this.sourceDirs) {
115
- try {
116
- const watcher = fs.watch(dir, { recursive: true }, (eventType, filename) => {
117
- if (!filename)
118
- return;
119
- if (!this.isWatchedFile(filename))
120
- return;
121
- const absPath = path.normalize(path.join(dir, filename));
122
- const relPath = filename.replace(/\\/g, "/");
123
- const existing = this.debounceTimers.get(absPath);
124
- if (existing)
125
- clearTimeout(existing);
126
- this.debounceTimers.set(absPath, setTimeout(() => {
127
- this.debounceTimers.delete(absPath);
128
- this.handleFileEvent(absPath, relPath);
129
- }, this.DEBOUNCE_MS));
130
- });
131
- // Store first watcher for backward compat
132
- if (!this.watcher)
133
- this.watcher = watcher;
134
- console.error(`[syke:cache] Watching ${dir} for changes`);
135
- }
136
- catch (err) {
137
- console.error(`[syke:cache] Watch failed for ${dir}: ${err.message}`);
138
- }
139
- }
140
- }
141
- isWatchedFile(filename) {
142
- if (filename.endsWith(".d.ts"))
143
- return false;
144
- for (const ext of this.extensions) {
145
- if (filename.endsWith(ext))
146
- return true;
147
- }
148
- return false;
149
- }
150
- handleFileEvent(absPath, relPath) {
151
- const oldContent = this.cache.get(absPath) || null;
152
- let newContent = null;
153
- let type;
154
- try {
155
- if (fs.existsSync(absPath)) {
156
- newContent = fs.readFileSync(absPath, "utf-8");
157
- if (oldContent === null) {
158
- type = "added";
159
- }
160
- else if (oldContent === newContent) {
161
- return; // no actual change
162
- }
163
- else {
164
- type = "modified";
165
- }
166
- this.cache.set(absPath, newContent);
167
- }
168
- else {
169
- type = "deleted";
170
- this.cache.delete(absPath);
171
- }
172
- }
173
- catch (_) {
174
- return;
175
- }
176
- const diff = this.computeDiff(oldContent, newContent);
177
- const change = {
178
- filePath: absPath,
179
- relativePath: relPath,
180
- type,
181
- oldContent,
182
- newContent,
183
- diff,
184
- timestamp: Date.now(),
185
- };
186
- console.error(`[syke:cache] ${type.toUpperCase()}: ${relPath} (${diff.length} changes)`);
187
- this.emit("change", change);
188
- // Incremental graph update (if graph is available)
189
- if (this.graph) {
190
- try {
191
- let result;
192
- if (type === "modified") {
193
- result = (0, incremental_1.updateGraphForFile)(this.graph, absPath, this.projectRoot);
194
- }
195
- else if (type === "added") {
196
- result = (0, incremental_1.addFileToGraph)(this.graph, absPath, this.projectRoot);
197
- }
198
- else {
199
- // deleted
200
- result = (0, incremental_1.removeFileFromGraph)(this.graph, absPath);
201
- }
202
- // Invalidate memo cache for affected files
203
- if (result.edgesChanged && result.affectedFiles.length > 0) {
204
- const invalidated = (0, memo_cache_1.getMemoCache)().invalidate(result.affectedFiles);
205
- console.error(`[syke:incremental] ${type}: ${relPath} — ` +
206
- `+${result.addedEdges.length}/-${result.removedEdges.length} edges, ` +
207
- `${result.affectedFiles.length} affected, ${invalidated} cache entries invalidated`);
208
- }
209
- // Emit graph-updated event for downstream consumers (e.g., SSE broadcast)
210
- this.emit("graph-updated", result);
211
- }
212
- catch (err) {
213
- console.error(`[syke:incremental] Error updating graph for ${relPath}: ${err.message}`);
214
- }
215
- }
216
- }
217
- /** Simple line-by-line diff */
218
- computeDiff(oldContent, newContent) {
219
- const diffs = [];
220
- const oldLines = oldContent ? oldContent.split("\n") : [];
221
- const newLines = newContent ? newContent.split("\n") : [];
222
- const maxLen = Math.max(oldLines.length, newLines.length);
223
- for (let i = 0; i < maxLen; i++) {
224
- const oldLine = i < oldLines.length ? oldLines[i] : undefined;
225
- const newLine = i < newLines.length ? newLines[i] : undefined;
226
- if (oldLine === undefined && newLine !== undefined) {
227
- diffs.push({ line: i + 1, type: "added", new: newLine });
228
- }
229
- else if (oldLine !== undefined && newLine === undefined) {
230
- diffs.push({ line: i + 1, type: "removed", old: oldLine });
231
- }
232
- else if (oldLine !== newLine) {
233
- diffs.push({ line: i + 1, type: "changed", old: oldLine, new: newLine });
234
- }
235
- }
236
- return diffs;
237
- }
238
- /** Get content of a specific file from cache */
239
- getFile(absPath) {
240
- return this.cache.get(path.normalize(absPath)) ?? null;
241
- }
242
- /** Get content by relative path (relative to first sourceDir) */
243
- getFileByRelPath(relPath) {
244
- const absPath = path.normalize(path.join(this.sourceDir, relPath));
245
- return this.cache.get(absPath) ?? null;
246
- }
247
- /** Get all cached files as {relativePath → content} */
248
- getAllFiles() {
249
- const result = new Map();
250
- for (const [absPath, content] of this.cache) {
251
- const rel = path.relative(this.sourceDir, absPath).replace(/\\/g, "/");
252
- result.set(rel, content);
253
- }
254
- return result;
255
- }
256
- /** Get file count */
257
- get size() {
258
- return this.cache.size;
259
- }
260
- /** Get total lines across all files */
261
- get totalLines() {
262
- let total = 0;
263
- for (const content of this.cache.values()) {
264
- total += content.split("\n").length;
265
- }
266
- return total;
267
- }
268
- /** Cleanup */
269
- stop() {
270
- if (this.watcher) {
271
- this.watcher.close();
272
- this.watcher = null;
273
- }
274
- for (const timer of this.debounceTimers.values()) {
275
- clearTimeout(timer);
276
- }
277
- this.debounceTimers.clear();
278
- console.error("[syke:cache] Watcher stopped");
279
- }
280
- }
281
- exports.FileCache = FileCache;
1
+ 'use strict';function _0x3156(_0x9232da,_0x2c7f45){_0x9232da=_0x9232da-0x82;const _0x1d8595=_0x1d85();let _0x315696=_0x1d8595[_0x9232da];if(_0x3156['hZUwZF']===undefined){var _0x228b08=function(_0x1fd658){const _0x540b0e='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x192c3d='',_0x233a82='';for(let _0x415dfa=0x0,_0x4f9ae9,_0x5c949c,_0x5b8d29=0x0;_0x5c949c=_0x1fd658['charAt'](_0x5b8d29++);~_0x5c949c&&(_0x4f9ae9=_0x415dfa%0x4?_0x4f9ae9*0x40+_0x5c949c:_0x5c949c,_0x415dfa++%0x4)?_0x192c3d+=String['fromCharCode'](0xff&_0x4f9ae9>>(-0x2*_0x415dfa&0x6)):0x0){_0x5c949c=_0x540b0e['indexOf'](_0x5c949c);}for(let _0x172fe3=0x0,_0x297909=_0x192c3d['length'];_0x172fe3<_0x297909;_0x172fe3++){_0x233a82+='%'+('00'+_0x192c3d['charCodeAt'](_0x172fe3)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x233a82);};_0x3156['DfMLTr']=_0x228b08,_0x3156['hklOFn']={},_0x3156['hZUwZF']=!![];}const _0x47620e=_0x1d8595[0x0],_0x339269=_0x9232da+_0x47620e,_0x317c24=_0x3156['hklOFn'][_0x339269];return!_0x317c24?(_0x315696=_0x3156['DfMLTr'](_0x315696),_0x3156['hklOFn'][_0x339269]=_0x315696):_0x315696=_0x317c24,_0x315696;}const _0x1d4284=_0x3156;(function(_0x38c00f,_0xe9b68b){const _0x53422b={_0x55b295:0xbf,_0x390849:0x9b,_0x14c13b:0xab},_0x4e643b=_0x3156,_0x53e2b4=_0x38c00f();while(!![]){try{const _0x4dc153=parseInt(_0x4e643b(_0x53422b._0x55b295))/0x1*(parseInt(_0x4e643b(0xe8))/0x2)+-parseInt(_0x4e643b(0xc4))/0x3+parseInt(_0x4e643b(0xba))/0x4*(parseInt(_0x4e643b(0xa9))/0x5)+-parseInt(_0x4e643b(_0x53422b._0x390849))/0x6*(-parseInt(_0x4e643b(0x9e))/0x7)+-parseInt(_0x4e643b(0x86))/0x8+parseInt(_0x4e643b(0x84))/0x9+parseInt(_0x4e643b(_0x53422b._0x14c13b))/0xa*(-parseInt(_0x4e643b(0xd6))/0xb);if(_0x4dc153===_0xe9b68b)break;else _0x53e2b4['push'](_0x53e2b4['shift']());}catch(_0x36d067){_0x53e2b4['push'](_0x53e2b4['shift']());}}}(_0x1d85,0x60d4a));var __createBinding=this&&this[_0x1d4284(0xdc)]||(Object[_0x1d4284(0x85)]?function(_0x4f1806,_0x58badf,_0x220c28,_0x4aed2a){const _0xe05d83={_0x4ffa4c:0xc5,_0x1ae015:0xbd,_0x5a5fd1:0xa3,_0x48d857:0x93},_0x433391=_0x1d4284,_0x3a2fac={};_0x3a2fac[_0x433391(_0xe05d83._0x4ffa4c)]=function(_0x4c9390,_0x453d2b){return _0x4c9390===_0x453d2b;},_0x3a2fac['TlrzJ']=_0x433391(_0xe05d83._0x1ae015);const _0x3bc190=_0x3a2fac;if(_0x3bc190['PnHeY'](_0x4aed2a,undefined))_0x4aed2a=_0x220c28;var _0x48bb49=Object['getOwnPropertyDescriptor'](_0x58badf,_0x220c28);if(!_0x48bb49||(_0x3bc190[_0x433391(0xb0)]in _0x48bb49?!_0x58badf[_0x433391(_0xe05d83._0x5a5fd1)]:_0x48bb49['writable']||_0x48bb49['configurable'])){const _0x2c8fa0={};_0x2c8fa0['enumerable']=!![],_0x2c8fa0[_0x433391(0xbd)]=function(){return _0x58badf[_0x220c28];},_0x48bb49=_0x2c8fa0;}Object[_0x433391(_0xe05d83._0x48d857)](_0x4f1806,_0x4aed2a,_0x48bb49);}:function(_0x5162ad,_0x581f3c,_0xd59be0,_0x309951){if(_0x309951===undefined)_0x309951=_0xd59be0;_0x5162ad[_0x309951]=_0x581f3c[_0xd59be0];}),__setModuleDefault=this&&this['__setModuleDefault']||(Object[_0x1d4284(0x85)]?function(_0x1ae938,_0x3ce9ad){const _0x563288={_0x2fecaa:0xb9,_0x2fd4da:0x9f},_0xd2d044=_0x1d4284,_0x1ec351={};_0x1ec351[_0xd2d044(0xc0)]=!![],_0x1ec351[_0xd2d044(_0x563288._0x2fecaa)]=_0x3ce9ad,Object['defineProperty'](_0x1ae938,_0xd2d044(_0x563288._0x2fd4da),_0x1ec351);}:function(_0xf76996,_0x1f4e8e){const _0x5549d2=_0x1d4284,_0x194ef8={};_0x194ef8['YGoTu']=_0x5549d2(0x9f);const _0x470663=_0x194ef8;_0xf76996[_0x470663[_0x5549d2(0xda)]]=_0x1f4e8e;}),__importStar=this&&this['__importStar']||(function(){const _0x5c76fd={_0x29ec7e:0xc6,_0x1c5eb1:0xd0},_0x441a50={'QNnsF':function(_0x2476c8,_0x255c00){return _0x2476c8!=_0x255c00;},'XuWpv':function(_0x3ba2e1,_0x2ef536){return _0x3ba2e1<_0x2ef536;},'khLfG':function(_0x58d70a,_0x57563c){return _0x58d70a!==_0x57563c;},'nERBY':'default','enZPD':function(_0x460a11,_0x45952d,_0x280e5a){return _0x460a11(_0x45952d,_0x280e5a);}};var _0x374b10=function(_0x2bb06d){return _0x374b10=Object['getOwnPropertyNames']||function(_0x3ded77){const _0x340f64=_0x3156;var _0xf75eaa=[];for(var _0x55e322 in _0x3ded77)if(Object['prototype']['hasOwnProperty'][_0x340f64(0xb7)](_0x3ded77,_0x55e322))_0xf75eaa[_0xf75eaa[_0x340f64(0xd0)]]=_0x55e322;return _0xf75eaa;},_0x374b10(_0x2bb06d);};return function(_0x4f7336){const _0x3a52f7=_0x3156,_0x4d74ac=_0x3a52f7(_0x5c76fd._0x29ec7e)[_0x3a52f7(0xb3)]('|');let _0x5ce134=0x0;while(!![]){switch(_0x4d74ac[_0x5ce134++]){case'0':if(_0x4f7336&&_0x4f7336['__esModule'])return _0x4f7336;continue;case'1':if(_0x441a50['QNnsF'](_0x4f7336,null)){for(var _0x449f9e=_0x374b10(_0x4f7336),_0x4251ea=0x0;_0x441a50[_0x3a52f7(0x90)](_0x4251ea,_0x449f9e[_0x3a52f7(_0x5c76fd._0x1c5eb1)]);_0x4251ea++)if(_0x441a50['khLfG'](_0x449f9e[_0x4251ea],_0x441a50[_0x3a52f7(0xe4)]))__createBinding(_0xaa28c,_0x4f7336,_0x449f9e[_0x4251ea]);}continue;case'2':var _0xaa28c={};continue;case'3':_0x441a50[_0x3a52f7(0xa8)](__setModuleDefault,_0xaa28c,_0x4f7336);continue;case'4':return _0xaa28c;}break;}};}());const _0x4ff7f4={};function _0x1d85(){const _0x256a6d=['vgXYEKO','ywzMzwn0zwrgAwXLCW','lI4VBgfUz3vHz2vZl3bSDwDPBG','C3bSAxq','zgvSzxrL','ywrKzwrfzgDLCW','ywrKzwq','y2fSBa','igXPBMvZksbPBNrVig1LBw9YEq','DMfSDwu','mtqYmJKYueHOsxHL','z2v0rMLSzq','zw5KC1DPDgG','z2v0','z2v0u291CMnLrgLYCW','mvPdtLz4EG','zw51BwvYywjSzq','wfjWDMm','C2v0','lI4Vz3jHCgGVAw5JCMvTzw50ywW','odG4mdK5uNnZweXI','ug5izvK','mhWYFdf8m3W0','EvbyzuG','C3rHCNrxyxrJAgLUzW','ywrK','D2f0y2HLCG','z3jHCgG','Aw5JBhvKzxm','AM9PBG','zxzLBNrZ','ignOyw5NzxmP','BgvUz3rO','C2v0r3jHCgG','igvKz2vZlca','w3n5A2u6y2fJAgvDifDHDgnOAw5Nia','C291CMnLrgLYCW','AxnxyxrJAgvKrMLSzq','mZmYmK54DNzYva','CMvSyxrPDMu','Cgf0Aa','CuP6Ew8','wuDVvhu','Bw9KAwzPzwq','x19JCMvHDgvcAw5KAw5N','igfMzMvJDgvKlca','CMvTB3zLzevKz2vZ','zw1PDa','zxH0zw5ZAw9UCW','zxHPC3rZu3LUyW','zMLSzunVDw50','BgLUzq','BKvsqLK','Dg9mB2nHBgvtDhjPBMC','w3n5A2u6y2fJAgvDieXVywrLzca','DhLWzq','ntK5ntqWA0LcDhnn','BM93','Dg90ywXmAw5LCW','zgvIB3vUy2vuAw1LCNm','mJu4mZC0n2vzze5Yqq','y3jLyxrL','mti4otGYnfrrCLvRrW','DxbKyxrLr3jHCgHgB3jgAwXL','vhnyzuS','wu9Mrwu','z3jHCgGTDxbKyxrLza','zwrNzxndAgfUz2vK','te9Awfq','z2v0twvTB0nHy2HL','D2zpwfy','C2L6zq','whvxChy','y2HHBMDLza','BM9YBwfSAxPL','zgvMAw5LuhjVCgvYDhK','ignHy2HLigvUDhjPzxmGAw52ywXPzgf0zwq','CMvHzezPBgvtEw5J','Dg9vChbLCKnHC2u','zxjYB3i','y2fJAgu','DeDsBLG','BwvZC2fNzq','mty4nKrID2vTqW','Aw5PDgLHBgL6zq','w3n5A2u6y2fJAgvDia','mtq2odzTB0zcuMi','zgvMyxvSDa','yvDfyvm','C291CMnLrgLY','w3n5A2u6Aw5JCMvTzw50ywXDia','x19LC01VzhvSzq','CMvTB3zLza','lNrZ','iokaLca','DMfSDwvZ','zw5Aueq','nZb2vNbxvxu','z2v0qwXSrMLSzxm','mJCXnZbnzw9SC0O','CMvTB3zLrMLSzuzYB21hCMfWAa','B1PQtxG','ChjVAMvJDfjVB3q','CgX1z2LUCW'];_0x1d85=function(){return _0x256a6d;};return _0x1d85();}_0x4ff7f4['value']=!![],Object[_0x1d4284(0x93)](exports,_0x1d4284(0xa3),_0x4ff7f4),exports['FileCache']=void 0x0;const fs=__importStar(require('fs')),path=__importStar(require(_0x1d4284(0xd8))),events_1=require(_0x1d4284(0xce)),plugin_1=require(_0x1d4284(0xb2)),incremental_1=require(_0x1d4284(0xc3)),memo_cache_1=require('../graph/memo-cache');class FileCache extends events_1['EventEmitter']{constructor(_0x8f08c4){const _0x11781e={_0x1e753c:0xa5,_0x57cd72:0xc9,_0x5b682d:0xbe},_0x340a9e=_0x1d4284,_0x293fa7={};_0x293fa7['HDtEf']=_0x340a9e(_0x11781e._0x1e753c);const _0x324af1=_0x293fa7;super(),this['projectRoot']=_0x8f08c4,this['cache']=new Map(),this[_0x340a9e(0xd4)]=[],this['watcher']=null,this[_0x340a9e(0x83)]=new Map(),this['DEBOUNCE_MS']=0x5dc,this['graph']=null,this['plugins']=(0x0,plugin_1['detectLanguages'])(_0x8f08c4);const _0x273131=new Set();for(const _0x2763fe of this[_0x340a9e(0xaf)]){for(const _0x5932a4 of _0x2763fe['extensions']){_0x273131[_0x340a9e(_0x11781e._0x57cd72)](_0x5932a4);}}this[_0x340a9e(0xe0)]=_0x273131['size']>0x0?_0x273131:new Set([_0x324af1['HDtEf']]);for(const _0x37f4e6 of this['plugins']){for(const _0x355a55 of _0x37f4e6[_0x340a9e(_0x11781e._0x5b682d)](_0x8f08c4)){!this[_0x340a9e(0xd4)][_0x340a9e(0xcc)](_0x355a55)&&this[_0x340a9e(0xd4)]['push'](_0x355a55);}}}get[_0x1d4284(0xa1)](){const _0x29003f=_0x1d4284,_0x4d7536={};_0x4d7536['LQnJD']='src';const _0x853de8=_0x4d7536;return this['sourceDirs'][0x0]||path[_0x29003f(0xcd)](this['projectRoot'],_0x853de8['LQnJD']);}[_0x1d4284(0xd1)](_0x239149){this['graph']=_0x239149;}[_0x1d4284(0x9c)](){const _0x1f0c38={_0x514204:0x88,_0x32059e:0xaf,_0x31154e:0x95,_0x324d56:0x92,_0x16ca7e:0x97,_0x3d800b:0xe6,_0x24e138:0x98,_0x19df5a:0x8f},_0x44feea=_0x1d4284,_0x299d3e={};_0x299d3e[_0x44feea(_0x1f0c38._0x514204)]='utf-8';const _0x4aff71=_0x299d3e;let _0x3c5081=0x0;for(const _0x2c08ca of this[_0x44feea(_0x1f0c38._0x32059e)]){for(const _0x4dc6f3 of _0x2c08ca[_0x44feea(0xbe)](this[_0x44feea(0xae)])){const _0x5df9a0=_0x2c08ca['discoverFiles'](_0x4dc6f3);for(const _0x1ed683 of _0x5df9a0){try{const _0x2604f8=fs[_0x44feea(_0x1f0c38._0x31154e)](_0x1ed683,_0x4aff71[_0x44feea(0x88)]);this['cache']['set'](path[_0x44feea(_0x1f0c38._0x324d56)](_0x1ed683),_0x2604f8),_0x3c5081+=_0x2604f8[_0x44feea(0xb3)]('\x0a')['length'];}catch(_0x3d8877){}}}}console[_0x44feea(_0x1f0c38._0x16ca7e)](_0x44feea(_0x1f0c38._0x3d800b)+this[_0x44feea(_0x1f0c38._0x24e138)][_0x44feea(0x8f)]+'\x20files\x20('+_0x3c5081[_0x44feea(0xe5)]()+_0x44feea(0xb8));const _0x512b14={};return _0x512b14[_0x44feea(0xe2)]=this['cache'][_0x44feea(_0x1f0c38._0x19df5a)],_0x512b14['totalLines']=_0x3c5081,_0x512b14;}[_0x1d4284(0xc8)](){const _0x75c694={_0xf7b704:0x97,_0x26f645:0xd3},_0x5991a3={_0x984da:0xd5,_0x40862a:0x83},_0x69a3a2=_0x1d4284;if(this[_0x69a3a2(0xca)])return;for(const _0x1c866f of this['sourceDirs']){try{const _0x164764={};_0x164764['recursive']=!![];const _0x56c05c=fs['watch'](_0x1c866f,_0x164764,(_0x34a54d,_0x12be75)=>{const _0x40c253=_0x69a3a2;if(!_0x12be75)return;if(!this[_0x40c253(_0x5991a3._0x984da)](_0x12be75))return;const _0x4050f7=path['normalize'](path['join'](_0x1c866f,_0x12be75)),_0x2fce22=_0x12be75['replace'](/\\/g,'/'),_0x2125fe=this[_0x40c253(0x83)]['get'](_0x4050f7);if(_0x2125fe)clearTimeout(_0x2125fe);this[_0x40c253(_0x5991a3._0x40862a)][_0x40c253(0xc2)](_0x4050f7,setTimeout(()=>{this['debounceTimers']['delete'](_0x4050f7),this['handleFileEvent'](_0x4050f7,_0x2fce22);},this['DEBOUNCE_MS']));});if(!this['watcher'])this[_0x69a3a2(0xca)]=_0x56c05c;console[_0x69a3a2(_0x75c694._0xf7b704)](_0x69a3a2(_0x75c694._0x26f645)+_0x1c866f+'\x20for\x20changes');}catch(_0x49d115){console[_0x69a3a2(0x97)]('[syke:cache]\x20Watch\x20failed\x20for\x20'+_0x1c866f+':\x20'+_0x49d115['message']);}}}['isWatchedFile'](_0xcfeb2){const _0xd96679=_0x1d4284;if(_0xcfeb2['endsWith']('.d.ts'))return![];for(const _0x3be9bf of this['extensions']){if(_0xcfeb2[_0xd96679(0xbc)](_0x3be9bf))return!![];}return![];}['handleFileEvent'](_0x2f74bd,_0x4de70a){const _0x3779a4={_0x502341:0xb6,_0x4e10ce:0xc1,_0x564628:0xa0,_0x1ab2fd:0x8a,_0x310120:0xe1,_0x29a872:0xc1,_0x8ba61e:0xb4,_0x1c4f98:0xe9,_0x3dfbf5:0x97,_0xf12386:0x9d,_0x81af07:0x96,_0x26af4d:0xc7,_0x46685c:0x87,_0x21579d:0xac,_0x414358:0xcb,_0x2c50be:0xa2,_0x1516ef:0xa6,_0x102f1e:0xb5,_0x4c35ed:0xd2,_0x35a528:0xd0,_0x42618e:0xdd},_0x4364db=_0x1d4284,_0xf4a8fb={};_0xf4a8fb[_0x4364db(0xd9)]='utf-8',_0xf4a8fb['tJOcK']=function(_0x52c348,_0x3ea9fc){return _0x52c348===_0x3ea9fc;},_0xf4a8fb['imIvD']=_0x4364db(_0x3779a4._0x502341),_0xf4a8fb[_0x4364db(0x89)]='modified',_0xf4a8fb[_0x4364db(_0x3779a4._0x4e10ce)]='deleted',_0xf4a8fb['yPXeH']=function(_0x3f034f,_0x32d79d){return _0x3f034f===_0x32d79d;},_0xf4a8fb[_0x4364db(0x99)]=function(_0x3b04da,_0x4b45f1){return _0x3b04da===_0x4b45f1;},_0xf4a8fb['eThGK']=function(_0x23878e,_0x3b5cf2){return _0x23878e>_0x3b5cf2;},_0xf4a8fb[_0x4364db(_0x3779a4._0x564628)]=_0x4364db(_0x3779a4._0x1ab2fd);const _0x47fe7e=_0xf4a8fb,_0x53ca85=this[_0x4364db(0x98)][_0x4364db(0xbd)](_0x2f74bd)||null;let _0xabaad3=null,_0x3f786e;try{if(fs[_0x4364db(_0x3779a4._0x310120)](_0x2f74bd)){_0xabaad3=fs['readFileSync'](_0x2f74bd,_0x47fe7e['qJzyo']);if(_0x47fe7e['tJOcK'](_0x53ca85,null))_0x3f786e=_0x47fe7e['imIvD'];else{if(_0x53ca85===_0xabaad3)return;else _0x3f786e=_0x47fe7e['YOfEe'];}this['cache']['set'](_0x2f74bd,_0xabaad3);}else _0x3f786e=_0x47fe7e[_0x4364db(_0x3779a4._0x29a872)],this[_0x4364db(0x98)][_0x4364db(_0x3779a4._0x8ba61e)](_0x2f74bd);}catch(_0x264c17){return;}const _0x226ca7=this['computeDiff'](_0x53ca85,_0xabaad3),_0x191793={'filePath':_0x2f74bd,'relativePath':_0x4de70a,'type':_0x3f786e,'oldContent':_0x53ca85,'newContent':_0xabaad3,'diff':_0x226ca7,'timestamp':Date[_0x4364db(_0x3779a4._0x1c4f98)]()};console[_0x4364db(_0x3779a4._0x3dfbf5)](_0x4364db(_0x3779a4._0xf12386)+_0x3f786e[_0x4364db(_0x3779a4._0x81af07)]()+':\x20'+_0x4de70a+'\x20('+_0x226ca7[_0x4364db(0xd0)]+_0x4364db(0xcf)),this['emit']('change',_0x191793);if(this[_0x4364db(0xcb)])try{let _0x3a935f;if(_0x47fe7e[_0x4364db(_0x3779a4._0x26af4d)](_0x3f786e,_0x4364db(0xdb)))_0x3a935f=(0x0,incremental_1[_0x4364db(_0x3779a4._0x46685c)])(this['graph'],_0x2f74bd,this['projectRoot']);else _0x47fe7e[_0x4364db(0x99)](_0x3f786e,'added')?_0x3a935f=(0x0,incremental_1['addFileToGraph'])(this['graph'],_0x2f74bd,this['projectRoot']):_0x3a935f=(0x0,incremental_1[_0x4364db(_0x3779a4._0x21579d)])(this[_0x4364db(_0x3779a4._0x414358)],_0x2f74bd);if(_0x3a935f[_0x4364db(0x8b)]&&_0x47fe7e['eThGK'](_0x3a935f['affectedFiles']['length'],0x0)){const _0x519595=(0x0,memo_cache_1[_0x4364db(0x8d)])()['invalidate'](_0x3a935f[_0x4364db(0xb1)]);console[_0x4364db(0x97)](_0x4364db(_0x3779a4._0x2c50be)+_0x3f786e+':\x20'+_0x4de70a+_0x4364db(_0x3779a4._0x1516ef)+('+'+_0x3a935f[_0x4364db(_0x3779a4._0x102f1e)]['length']+'/-'+_0x3a935f[_0x4364db(0xde)]['length']+_0x4364db(_0x3779a4._0x4c35ed))+(_0x3a935f['affectedFiles'][_0x4364db(_0x3779a4._0x35a528)]+_0x4364db(_0x3779a4._0x42618e)+_0x519595+_0x4364db(0x94)));}this[_0x4364db(0xdf)](_0x47fe7e['aWEaS'],_0x3a935f);}catch(_0x5ba8c3){console['error']('[syke:incremental]\x20Error\x20updating\x20graph\x20for\x20'+_0x4de70a+':\x20'+_0x5ba8c3[_0x4364db(0x9a)]);}}['computeDiff'](_0x40bcb0,_0x14c443){const _0x2cad0f={_0x3346e0:0xb6,_0x102079:0xd0,_0x236607:0xd0,_0x456629:0x8e,_0x472b5c:0xe3,_0x167366:0xe7,_0x1e9c97:0xa4,_0x6309ee:0xe7},_0x5acd98=_0x1d4284,_0x45c035={};_0x45c035['LOZXT']=function(_0x3f8f8d,_0x1f6d14){return _0x3f8f8d<_0x1f6d14;},_0x45c035['lLDeB']=function(_0x4d2418,_0x897860){return _0x4d2418===_0x897860;},_0x45c035[_0x5acd98(0xad)]=function(_0x2f8dde,_0x4e1b94){return _0x2f8dde+_0x4e1b94;},_0x45c035['wfOXV']=_0x5acd98(_0x2cad0f._0x3346e0);const _0x310694=_0x45c035,_0xa0e00a=[],_0x267905=_0x40bcb0?_0x40bcb0['split']('\x0a'):[],_0x563789=_0x14c443?_0x14c443[_0x5acd98(0xb3)]('\x0a'):[],_0x322cae=Math['max'](_0x267905[_0x5acd98(_0x2cad0f._0x102079)],_0x563789[_0x5acd98(0xd0)]);for(let _0x28153f=0x0;_0x310694[_0x5acd98(0x8c)](_0x28153f,_0x322cae);_0x28153f++){const _0x427d55=_0x310694['LOZXT'](_0x28153f,_0x267905[_0x5acd98(_0x2cad0f._0x236607)])?_0x267905[_0x28153f]:undefined,_0x501854=_0x28153f<_0x563789[_0x5acd98(0xd0)]?_0x563789[_0x28153f]:undefined;if(_0x310694['lLDeB'](_0x427d55,undefined)&&_0x501854!==undefined)_0xa0e00a['push']({'line':_0x310694[_0x5acd98(0xad)](_0x28153f,0x1),'type':_0x310694[_0x5acd98(_0x2cad0f._0x456629)],'new':_0x501854});else{if(_0x427d55!==undefined&&_0x501854===undefined){const _0x52f4b6={};_0x52f4b6[_0x5acd98(_0x2cad0f._0x472b5c)]=_0x28153f+0x1,_0x52f4b6[_0x5acd98(_0x2cad0f._0x167366)]=_0x5acd98(_0x2cad0f._0x1e9c97),_0x52f4b6['old']=_0x427d55,_0xa0e00a['push'](_0x52f4b6);}else{if(_0x427d55!==_0x501854){const _0x1ece35={};_0x1ece35[_0x5acd98(0xe3)]=_0x28153f+0x1,_0x1ece35[_0x5acd98(_0x2cad0f._0x6309ee)]=_0x5acd98(0x91),_0x1ece35['old']=_0x427d55,_0x1ece35['new']=_0x501854,_0xa0e00a['push'](_0x1ece35);}}}}return _0xa0e00a;}[_0x1d4284(0xbb)](_0x1ff349){return this['cache']['get'](path['normalize'](_0x1ff349))??null;}['getFileByRelPath'](_0x5abbd0){const _0x1123aa={_0x5c6340:0x92,_0x3171c5:0xcd,_0x2b0970:0xbd},_0x400445=_0x1d4284,_0x4269d1=path[_0x400445(_0x1123aa._0x5c6340)](path[_0x400445(_0x1123aa._0x3171c5)](this['sourceDir'],_0x5abbd0));return this['cache'][_0x400445(_0x1123aa._0x2b0970)](_0x4269d1)??null;}[_0x1d4284(0xaa)](){const _0x1c9bb5={_0x1130f1:0xd7},_0x59f8f8=_0x1d4284,_0x28c0e8=new Map();for(const [_0x333315,_0xe2f97f]of this[_0x59f8f8(0x98)]){const _0xdaf75d=path[_0x59f8f8(_0x1c9bb5._0x1130f1)](this['sourceDir'],_0x333315)['replace'](/\\/g,'/');_0x28c0e8['set'](_0xdaf75d,_0xe2f97f);}return _0x28c0e8;}get['size'](){const _0x1cc096=_0x1d4284;return this[_0x1cc096(0x98)][_0x1cc096(0x8f)];}get[_0x1d4284(0x82)](){const _0xac923a={_0x52dec3:0xa7,_0x5349be:0xb3},_0xf74d3e=_0x1d4284;let _0x93d494=0x0;for(const _0x2f4801 of this['cache'][_0xf74d3e(_0xac923a._0x52dec3)]()){_0x93d494+=_0x2f4801[_0xf74d3e(_0xac923a._0x5349be)]('\x0a')['length'];}return _0x93d494;}['stop'](){const _0x4128eb={_0x5e6926:0xca},_0x1c4ae4=_0x1d4284;this['watcher']&&(this[_0x1c4ae4(0xca)]['close'](),this[_0x1c4ae4(_0x4128eb._0x5e6926)]=null);for(const _0xab5f55 of this[_0x1c4ae4(0x83)]['values']()){clearTimeout(_0xab5f55);}this['debounceTimers']['clear'](),console['error']('[syke:cache]\x20Watcher\x20stopped');}}exports['FileCache']=FileCache;