wavescope-mcp 1.0.2

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.
@@ -0,0 +1,398 @@
1
+ // ─── Base keyword sets ───────────────────────────────────────
2
+ const cLikeKeywords = {
3
+ class: 1.0,
4
+ export: 0.6,
5
+ import: 0.6,
6
+ public: 0.3,
7
+ private: 0.3,
8
+ protected: 0.3,
9
+ abstract: 0.4,
10
+ static: 0.3,
11
+ async: 0.3,
12
+ const: 0.3,
13
+ let: 0.2,
14
+ var: 0.2,
15
+ if: 0.3,
16
+ else: 0.2,
17
+ for: 0.3,
18
+ while: 0.3,
19
+ do: 0.2,
20
+ switch: 0.3,
21
+ case: 0.2,
22
+ default: 0.2,
23
+ try: 0.3,
24
+ catch: 0.3,
25
+ finally: 0.2,
26
+ return: 0.2,
27
+ throw: 0.2,
28
+ };
29
+ const jsLikeKeywords = {
30
+ ...cLikeKeywords,
31
+ function: 0.9,
32
+ };
33
+ const tsLikeKeywords = {
34
+ ...jsLikeKeywords,
35
+ interface: 0.9,
36
+ type: 0.5,
37
+ enum: 0.8,
38
+ };
39
+ // ─── Language configurations ─────────────────────────────────
40
+ const pythonConfig = {
41
+ name: "python",
42
+ extensions: [".py", ".pyi", ".pyx"],
43
+ structuralKeywords: {
44
+ class: 1.0,
45
+ def: 0.9,
46
+ import: 0.6,
47
+ from: 0.5,
48
+ return: 0.2,
49
+ yield: 0.2,
50
+ raise: 0.2,
51
+ if: 0.3,
52
+ elif: 0.2,
53
+ else: 0.2,
54
+ try: 0.3,
55
+ except: 0.3,
56
+ finally: 0.2,
57
+ for: 0.3,
58
+ while: 0.3,
59
+ with: 0.4,
60
+ match: 0.3,
61
+ case: 0.2,
62
+ },
63
+ commentPrefixes: ["#"],
64
+ // Python docstrings ("""..."""/'''...''') are handled specially in signal.ts
65
+ blockCommentStart: '"""',
66
+ blockCommentEnd: '"""',
67
+ indentWeight: 0.15,
68
+ decoratorWeight: 0.5,
69
+ };
70
+ const tsConfig = {
71
+ name: "typescript",
72
+ extensions: [".ts", ".tsx", ".mts", ".cts"],
73
+ structuralKeywords: {
74
+ ...tsLikeKeywords,
75
+ get: 0.3,
76
+ set: 0.3,
77
+ },
78
+ commentPrefixes: ["//"],
79
+ blockCommentStart: "/*",
80
+ blockCommentEnd: "*/",
81
+ indentWeight: 0.15,
82
+ decoratorWeight: 0.5,
83
+ };
84
+ const jsConfig = {
85
+ name: "javascript",
86
+ extensions: [".js", ".jsx", ".mjs", ".cjs"],
87
+ structuralKeywords: {
88
+ ...jsLikeKeywords,
89
+ get: 0.3,
90
+ set: 0.3,
91
+ },
92
+ commentPrefixes: ["//"],
93
+ blockCommentStart: "/*",
94
+ blockCommentEnd: "*/",
95
+ indentWeight: 0.15,
96
+ decoratorWeight: 0.5,
97
+ };
98
+ const goConfig = {
99
+ name: "go",
100
+ extensions: [".go"],
101
+ structuralKeywords: {
102
+ ...cLikeKeywords,
103
+ func: 0.9,
104
+ go: 0.2,
105
+ defer: 0.2,
106
+ select: 0.2,
107
+ struct: 0.9,
108
+ package: 0.3,
109
+ },
110
+ commentPrefixes: ["//"],
111
+ blockCommentStart: "/*",
112
+ blockCommentEnd: "*/",
113
+ indentWeight: 0.1,
114
+ decoratorWeight: 0.0,
115
+ };
116
+ const rustConfig = {
117
+ name: "rust",
118
+ extensions: [".rs"],
119
+ structuralKeywords: {
120
+ ...cLikeKeywords,
121
+ fn: 0.9,
122
+ impl: 0.9,
123
+ mod: 0.6,
124
+ use: 0.5,
125
+ pub: 0.4,
126
+ mut: 0.1,
127
+ trait: 0.9,
128
+ struct: 0.9,
129
+ enum: 0.8,
130
+ type: 0.5,
131
+ match: 0.3,
132
+ where: 0.2,
133
+ unsafe: 0.3,
134
+ extern: 0.3,
135
+ macro_rules: 0.7,
136
+ },
137
+ commentPrefixes: ["//"],
138
+ blockCommentStart: "/*",
139
+ blockCommentEnd: "*/",
140
+ indentWeight: 0.15,
141
+ decoratorWeight: 0.4,
142
+ };
143
+ const javaConfig = {
144
+ name: "java",
145
+ extensions: [".java"],
146
+ structuralKeywords: {
147
+ ...tsLikeKeywords,
148
+ package: 0.6,
149
+ extends: 0.5,
150
+ implements: 0.5,
151
+ throws: 0.2,
152
+ synchronized: 0.2,
153
+ volatile: 0.1,
154
+ transient: 0.1,
155
+ native: 0.1,
156
+ strictfp: 0.1,
157
+ },
158
+ commentPrefixes: ["//"],
159
+ blockCommentStart: "/*",
160
+ blockCommentEnd: "*/",
161
+ indentWeight: 0.15,
162
+ decoratorWeight: 0.5,
163
+ };
164
+ const rubyConfig = {
165
+ name: "ruby",
166
+ extensions: [".rb", ".rake", ".gemspec"],
167
+ filenames: ["Rakefile", "Gemfile"],
168
+ structuralKeywords: {
169
+ class: 1.0,
170
+ def: 0.9,
171
+ module: 0.9,
172
+ require: 0.6,
173
+ include: 0.4,
174
+ extend: 0.4,
175
+ private: 0.3,
176
+ protected: 0.3,
177
+ public: 0.3,
178
+ attr_accessor: 0.5,
179
+ attr_reader: 0.5,
180
+ attr_writer: 0.5,
181
+ if: 0.3,
182
+ unless: 0.3,
183
+ else: 0.2,
184
+ elsif: 0.2,
185
+ while: 0.3,
186
+ until: 0.3,
187
+ for: 0.3,
188
+ do: 0.2,
189
+ begin: 0.3,
190
+ rescue: 0.3,
191
+ ensure: 0.2,
192
+ case: 0.2,
193
+ when: 0.2,
194
+ return: 0.2,
195
+ yield: 0.2,
196
+ raise: 0.2,
197
+ },
198
+ commentPrefixes: ["#"],
199
+ blockCommentStart: "=begin",
200
+ blockCommentEnd: "=end",
201
+ indentWeight: 0.12,
202
+ decoratorWeight: 0.0,
203
+ blockCommentAtLineStart: true,
204
+ };
205
+ const phpConfig = {
206
+ name: "php",
207
+ extensions: [".php"],
208
+ structuralKeywords: {
209
+ ...tsLikeKeywords,
210
+ namespace: 0.6,
211
+ use: 0.5,
212
+ trait: 0.8,
213
+ extends: 0.5,
214
+ implements: 0.5,
215
+ require_once: 0.5,
216
+ require: 0.5,
217
+ include: 0.4,
218
+ include_once: 0.4,
219
+ echo: 0.1,
220
+ },
221
+ commentPrefixes: ["//", "#"],
222
+ blockCommentStart: "/*",
223
+ blockCommentEnd: "*/",
224
+ indentWeight: 0.15,
225
+ decoratorWeight: 0.4,
226
+ };
227
+ const swiftConfig = {
228
+ name: "swift",
229
+ extensions: [".swift"],
230
+ structuralKeywords: {
231
+ ...cLikeKeywords,
232
+ func: 0.9,
233
+ guard: 0.3,
234
+ defer: 0.2,
235
+ protocol: 0.9,
236
+ extension: 0.7,
237
+ struct: 0.9,
238
+ actor: 0.9,
239
+ mutating: 0.3,
240
+ nonmutating: 0.3,
241
+ override: 0.3,
242
+ convenience: 0.2,
243
+ required: 0.2,
244
+ weak: 0.1,
245
+ unowned: 0.1,
246
+ throws: 0.2,
247
+ rethrows: 0.2,
248
+ associatedtype: 0.5,
249
+ typealias: 0.4,
250
+ },
251
+ commentPrefixes: ["//"],
252
+ blockCommentStart: "/*",
253
+ blockCommentEnd: "*/",
254
+ indentWeight: 0.15,
255
+ decoratorWeight: 0.4,
256
+ };
257
+ const kotlinConfig = {
258
+ name: "kotlin",
259
+ extensions: [".kt", ".kts"],
260
+ structuralKeywords: {
261
+ ...cLikeKeywords,
262
+ fun: 0.9,
263
+ val: 0.2,
264
+ object: 0.7,
265
+ companion: 0.4,
266
+ data: 0.4,
267
+ sealed: 0.5,
268
+ open: 0.4,
269
+ override: 0.3,
270
+ suspend: 0.3,
271
+ operator: 0.3,
272
+ infix: 0.2,
273
+ inline: 0.2,
274
+ tailrec: 0.2,
275
+ external: 0.2,
276
+ annotation: 0.4,
277
+ expect: 0.3,
278
+ actual: 0.3,
279
+ },
280
+ commentPrefixes: ["//"],
281
+ blockCommentStart: "/*",
282
+ blockCommentEnd: "*/",
283
+ indentWeight: 0.15,
284
+ decoratorWeight: 0.5,
285
+ };
286
+ const scalaConfig = {
287
+ name: "scala",
288
+ extensions: [".scala", ".sc"],
289
+ structuralKeywords: {
290
+ ...cLikeKeywords,
291
+ def: 0.9,
292
+ val: 0.2,
293
+ object: 0.7,
294
+ trait: 0.9,
295
+ sealed: 0.5,
296
+ implicit: 0.4,
297
+ given: 0.3,
298
+ using: 0.3,
299
+ extension: 0.5,
300
+ opaque: 0.3,
301
+ case: 0.4,
302
+ match: 0.3,
303
+ lazy: 0.1,
304
+ override: 0.3,
305
+ },
306
+ commentPrefixes: ["//"],
307
+ blockCommentStart: "/*",
308
+ blockCommentEnd: "*/",
309
+ indentWeight: 0.15,
310
+ decoratorWeight: 0.5,
311
+ };
312
+ const clojureConfig = {
313
+ name: "clojure",
314
+ extensions: [".clj", ".cljs", ".cljc", ".edn"],
315
+ structuralKeywords: {
316
+ defn: 0.9,
317
+ "defn-": 0.9,
318
+ def: 0.7,
319
+ defmacro: 0.9,
320
+ defmulti: 0.9,
321
+ defmethod: 0.8,
322
+ defprotocol: 0.9,
323
+ defrecord: 0.9,
324
+ deftype: 0.9,
325
+ definterface: 0.9,
326
+ defonce: 0.7,
327
+ "extend-type": 0.8,
328
+ "extend-protocol": 0.8,
329
+ letfn: 0.6,
330
+ reify: 0.6,
331
+ ns: 0.6,
332
+ require: 0.6,
333
+ use: 0.5,
334
+ import: 0.5,
335
+ fn: 0.4,
336
+ let: 0.2,
337
+ if: 0.3,
338
+ when: 0.3,
339
+ loop: 0.3,
340
+ for: 0.3,
341
+ doseq: 0.3,
342
+ try: 0.3,
343
+ catch: 0.3,
344
+ finally: 0.2,
345
+ },
346
+ commentPrefixes: [";"],
347
+ blockCommentStart: "(comment",
348
+ blockCommentEnd: ")",
349
+ indentWeight: 0.12,
350
+ decoratorWeight: 0.0,
351
+ blockCommentUsesParenDepth: true,
352
+ };
353
+ const genericConfig = {
354
+ name: "generic",
355
+ extensions: [],
356
+ structuralKeywords: {},
357
+ commentPrefixes: ["#"],
358
+ blockCommentStart: "/*",
359
+ blockCommentEnd: "*/",
360
+ indentWeight: 0.1,
361
+ decoratorWeight: 0.3,
362
+ };
363
+ // Ordered by priority — genericConfig (last) is the fallback.
364
+ // It must remain last and must not share extensions with preceding configs.
365
+ const configs = [
366
+ pythonConfig,
367
+ tsConfig,
368
+ jsConfig,
369
+ goConfig,
370
+ rustConfig,
371
+ javaConfig,
372
+ rubyConfig,
373
+ phpConfig,
374
+ swiftConfig,
375
+ kotlinConfig,
376
+ scalaConfig,
377
+ clojureConfig,
378
+ genericConfig,
379
+ ];
380
+ export { configs, pythonConfig, tsConfig, jsConfig, goConfig, rustConfig, javaConfig, rubyConfig, phpConfig, swiftConfig, kotlinConfig, scalaConfig, clojureConfig, genericConfig, };
381
+ export function detectLanguage(filename) {
382
+ const slash = Math.max(filename.lastIndexOf("/"), filename.lastIndexOf("\\"));
383
+ const basename = slash >= 0 ? filename.slice(slash + 1) : filename;
384
+ for (const cfg of configs) {
385
+ if (cfg.filenames?.includes(basename))
386
+ return cfg;
387
+ }
388
+ const dot = basename.lastIndexOf(".");
389
+ const ext = dot >= 0 ? basename.slice(dot).toLowerCase() : "";
390
+ if (ext) {
391
+ for (const cfg of configs) {
392
+ if (cfg.extensions.includes(ext))
393
+ return cfg;
394
+ }
395
+ }
396
+ return genericConfig;
397
+ }
398
+ //# sourceMappingURL=language.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"language.js","sourceRoot":"","sources":["../src/language.ts"],"names":[],"mappings":"AAyBA,gEAAgE;AAEhE,MAAM,aAAa,GAA2B;IAC5C,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,MAAM,EAAE,GAAG;IACX,OAAO,EAAE,GAAG;IACZ,SAAS,EAAE,GAAG;IACd,QAAQ,EAAE,GAAG;IACb,MAAM,EAAE,GAAG;IACX,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;IACV,GAAG,EAAE,GAAG;IACR,GAAG,EAAE,GAAG;IACR,EAAE,EAAE,GAAG;IACP,IAAI,EAAE,GAAG;IACT,GAAG,EAAE,GAAG;IACR,KAAK,EAAE,GAAG;IACV,E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AAG,CAAC,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9E,MAAM,QAAQ,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;IACnE,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;QAC1B,IAAI,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,QAAQ,CAAC;YAAE,OAAO,GAAG,CAAC;IACpD,CAAC;IACD,MAAM,GAAG,GAAG,QAAQ,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IACtC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9D,IAAI,GAAG,EAAE,CAAC;QACR,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC;gBAAE,OAAO,GAAG,CAAC;QAC/C,CAAC;IACH,CAAC;IACD,OAAO,aAAa,CAAC;AACvB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { FileContext, ImportantPosition } from "./context.js";
2
+ export declare const MAX_FILE_BYTES = 2000000;
3
+ export declare const MAX_FILES = 5000;
4
+ export interface ProjectFile {
5
+ filename: string;
6
+ path: string;
7
+ context: FileContext;
8
+ }
9
+ /**
10
+ * Project-level wavelet index across multiple files.
11
+ *
12
+ * Results are cached with a 60-second TTL to avoid expensive
13
+ * re-indexing on repeated calls.
14
+ */
15
+ export declare class ProjectIndex {
16
+ readonly root: string;
17
+ readonly files: ProjectFile[];
18
+ /** True when discovery stopped at MAX_FILES — index is incomplete. */
19
+ readonly truncated: boolean;
20
+ private fileMap;
21
+ private constructor();
22
+ static load(root: string): Promise<ProjectIndex>;
23
+ getFile(relPath: string): FileContext | null;
24
+ listFiles(): string[];
25
+ /**
26
+ * Project-wide important positions across all files.
27
+ *
28
+ * Uses raw absolute wavelet coefficients (same semantics as
29
+ * single-file `FileContext.getImportantPositions`) so that
30
+ * `minCoefficient` means the same thing in both modes.
31
+ */
32
+ getImportantPositions(minCoefficient?: number, limit?: number): ImportantPosition[];
33
+ }
34
+ //# sourceMappingURL=project.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAwC9D,eAAO,MAAM,cAAc,UAAY,CAAC;AACxC,eAAO,MAAM,SAAS,OAAQ,CAAC;AAG/B,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,CAAC;CACtB;AA2BD;;;;;GAKG;AACH,qBAAa,YAAY;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC;IAC9B,sEAAsE;IACtE,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,OAAO,CAA2B;IAE1C,OAAO;WAYM,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IA2BtD,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,GAAG,IAAI;IAI5C,SAAS,IAAI,MAAM,EAAE;IAIrB;;;;;;OAMG;IACH,qBAAqB,CACnB,cAAc,GAAE,MAAY,EAC5B,KAAK,GAAE,MAAW,GACjB,iBAAiB,EAAE;CAyBvB"}