@aiready/pattern-detect 0.8.3 → 0.8.5

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,497 @@
1
+ // src/index.ts
2
+ import { readFileContent } from "@aiready/core";
3
+
4
+ // src/detector.ts
5
+ import { estimateTokens } from "@aiready/core";
6
+ function categorizePattern(code) {
7
+ const lower = code.toLowerCase();
8
+ if (lower.includes("request") && lower.includes("response") || lower.includes("router.") || lower.includes("app.get") || lower.includes("app.post") || lower.includes("express") || lower.includes("ctx.body")) {
9
+ return "api-handler";
10
+ }
11
+ if (lower.includes("validate") || lower.includes("schema") || lower.includes("zod") || lower.includes("yup") || lower.includes("if") && lower.includes("throw")) {
12
+ return "validator";
13
+ }
14
+ if (lower.includes("return (") || lower.includes("jsx") || lower.includes("component") || lower.includes("props")) {
15
+ return "component";
16
+ }
17
+ if (lower.includes("class ") || lower.includes("this.")) {
18
+ return "class-method";
19
+ }
20
+ if (lower.includes("return ") && !lower.includes("this") && !lower.includes("new ")) {
21
+ return "utility";
22
+ }
23
+ if (lower.includes("function") || lower.includes("=>")) {
24
+ return "function";
25
+ }
26
+ return "unknown";
27
+ }
28
+ function extractCodeBlocks(content, minLines) {
29
+ const lines = content.split("\n");
30
+ const blocks = [];
31
+ let currentBlock = [];
32
+ let blockStart = 0;
33
+ let braceDepth = 0;
34
+ let inFunction = false;
35
+ for (let i = 0; i < lines.length; i++) {
36
+ const line = lines[i];
37
+ const trimmed = line.trim();
38
+ if (!inFunction && (trimmed.includes("function ") || trimmed.includes("=>") || trimmed.includes("async ") || /^(export\s+)?(async\s+)?function\s+/.test(trimmed) || /^(export\s+)?const\s+\w+\s*=\s*(async\s*)?\(/.test(trimmed))) {
39
+ inFunction = true;
40
+ blockStart = i;
41
+ }
42
+ for (const char of line) {
43
+ if (char === "{") braceDepth++;
44
+ if (char === "}") braceDepth--;
45
+ }
46
+ if (inFunction) {
47
+ currentBlock.push(line);
48
+ }
49
+ if (inFunction && braceDepth === 0 && currentBlock.length >= minLines) {
50
+ const blockContent = currentBlock.join("\n");
51
+ const linesOfCode = currentBlock.filter(
52
+ (l) => l.trim() && !l.trim().startsWith("//")
53
+ ).length;
54
+ blocks.push({
55
+ content: blockContent,
56
+ startLine: blockStart + 1,
57
+ endLine: i + 1,
58
+ patternType: categorizePattern(blockContent),
59
+ linesOfCode
60
+ });
61
+ currentBlock = [];
62
+ inFunction = false;
63
+ } else if (inFunction && braceDepth === 0) {
64
+ currentBlock = [];
65
+ inFunction = false;
66
+ }
67
+ }
68
+ return blocks;
69
+ }
70
+ function normalizeCode(code) {
71
+ return code.replace(/\/\/.*$/gm, "").replace(/\/\*[\s\S]*?\*\//g, "").replace(/"[^"]*"/g, '"STR"').replace(/'[^']*'/g, "'STR'").replace(/`[^`]*`/g, "`STR`").replace(/\b\d+\b/g, "NUM").replace(/\s+/g, " ").trim();
72
+ }
73
+ function jaccardSimilarity(tokens1, tokens2) {
74
+ const set1 = new Set(tokens1);
75
+ const set2 = new Set(tokens2);
76
+ let intersection = 0;
77
+ for (const token of set1) {
78
+ if (set2.has(token)) intersection++;
79
+ }
80
+ const union = set1.size + set2.size - intersection;
81
+ return union === 0 ? 0 : intersection / union;
82
+ }
83
+ async function detectDuplicatePatterns(files, options) {
84
+ const {
85
+ minSimilarity,
86
+ minLines,
87
+ batchSize = 100,
88
+ approx = true,
89
+ minSharedTokens = 8,
90
+ maxCandidatesPerBlock = 100,
91
+ streamResults = false
92
+ } = options;
93
+ const duplicates = [];
94
+ const maxComparisons = approx ? Infinity : 5e5;
95
+ const allBlocks = files.flatMap(
96
+ (file) => extractCodeBlocks(file.content, minLines).map((block) => ({
97
+ content: block.content,
98
+ startLine: block.startLine,
99
+ endLine: block.endLine,
100
+ file: file.file,
101
+ normalized: normalizeCode(block.content),
102
+ patternType: block.patternType,
103
+ tokenCost: estimateTokens(block.content),
104
+ linesOfCode: block.linesOfCode
105
+ }))
106
+ );
107
+ console.log(`Extracted ${allBlocks.length} code blocks for analysis`);
108
+ if (!approx && allBlocks.length > 500) {
109
+ console.log(`\u26A0\uFE0F Using --no-approx mode with ${allBlocks.length} blocks may be slow (O(B\xB2) complexity).`);
110
+ console.log(` Consider using approximate mode (default) for better performance.`);
111
+ }
112
+ const stopwords = /* @__PURE__ */ new Set([
113
+ "return",
114
+ "const",
115
+ "let",
116
+ "var",
117
+ "function",
118
+ "class",
119
+ "new",
120
+ "if",
121
+ "else",
122
+ "for",
123
+ "while",
124
+ "async",
125
+ "await",
126
+ "try",
127
+ "catch",
128
+ "switch",
129
+ "case",
130
+ "default",
131
+ "import",
132
+ "export",
133
+ "from",
134
+ "true",
135
+ "false",
136
+ "null",
137
+ "undefined",
138
+ "this"
139
+ ]);
140
+ const tokenize = (norm) => norm.split(/[\s(){}\[\];,\.]+/).filter((t) => t && t.length >= 3 && !stopwords.has(t.toLowerCase()));
141
+ const blockTokens = allBlocks.map((b) => tokenize(b.normalized));
142
+ const invertedIndex = /* @__PURE__ */ new Map();
143
+ if (approx) {
144
+ for (let i = 0; i < blockTokens.length; i++) {
145
+ for (const tok of blockTokens[i]) {
146
+ let arr = invertedIndex.get(tok);
147
+ if (!arr) {
148
+ arr = [];
149
+ invertedIndex.set(tok, arr);
150
+ }
151
+ arr.push(i);
152
+ }
153
+ }
154
+ }
155
+ const totalComparisons = approx ? void 0 : allBlocks.length * (allBlocks.length - 1) / 2;
156
+ if (totalComparisons !== void 0) {
157
+ console.log(`Processing ${totalComparisons.toLocaleString()} comparisons in batches...`);
158
+ } else {
159
+ console.log(`Using approximate candidate selection to reduce comparisons...`);
160
+ }
161
+ let comparisonsProcessed = 0;
162
+ let comparisonsBudgetExhausted = false;
163
+ const startTime = Date.now();
164
+ for (let i = 0; i < allBlocks.length; i++) {
165
+ if (maxComparisons && comparisonsProcessed >= maxComparisons) {
166
+ comparisonsBudgetExhausted = true;
167
+ break;
168
+ }
169
+ if (i % batchSize === 0 && i > 0) {
170
+ const elapsed = ((Date.now() - startTime) / 1e3).toFixed(1);
171
+ const duplicatesFound = duplicates.length;
172
+ if (totalComparisons !== void 0) {
173
+ const progress = (comparisonsProcessed / totalComparisons * 100).toFixed(1);
174
+ const remaining = totalComparisons - comparisonsProcessed;
175
+ const rate = comparisonsProcessed / parseFloat(elapsed);
176
+ const eta = remaining > 0 ? (remaining / rate).toFixed(0) : 0;
177
+ console.log(` ${progress}% (${comparisonsProcessed.toLocaleString()}/${totalComparisons.toLocaleString()} comparisons, ${elapsed}s elapsed, ~${eta}s remaining, ${duplicatesFound} duplicates)`);
178
+ } else {
179
+ console.log(` Processed ${i.toLocaleString()}/${allBlocks.length} blocks (${elapsed}s elapsed, ${duplicatesFound} duplicates)`);
180
+ }
181
+ await new Promise((resolve) => setImmediate(resolve));
182
+ }
183
+ const block1 = allBlocks[i];
184
+ let candidates = null;
185
+ if (approx) {
186
+ const counts = /* @__PURE__ */ new Map();
187
+ const block1Tokens = new Set(blockTokens[i]);
188
+ const block1Size = block1Tokens.size;
189
+ const rareTokens = blockTokens[i].filter((tok) => {
190
+ const blocksWithToken = invertedIndex.get(tok)?.length || 0;
191
+ return blocksWithToken < allBlocks.length * 0.1;
192
+ });
193
+ for (const tok of rareTokens) {
194
+ const ids = invertedIndex.get(tok);
195
+ if (!ids) continue;
196
+ for (const j of ids) {
197
+ if (j <= i) continue;
198
+ if (allBlocks[j].file === block1.file) continue;
199
+ counts.set(j, (counts.get(j) || 0) + 1);
200
+ }
201
+ }
202
+ candidates = Array.from(counts.entries()).filter(([j, shared]) => {
203
+ const block2Tokens = blockTokens[j];
204
+ const block2Size = block2Tokens.length;
205
+ const minSize = Math.min(block1Size, block2Size);
206
+ const sharedPercentage = shared / minSize;
207
+ return shared >= minSharedTokens && sharedPercentage >= 0.3;
208
+ }).sort((a, b) => b[1] - a[1]).slice(0, Math.min(maxCandidatesPerBlock, 5)).map(([j, shared]) => ({ j, shared }));
209
+ }
210
+ if (approx && candidates) {
211
+ for (const { j } of candidates) {
212
+ if (!approx && maxComparisons !== Infinity && comparisonsProcessed >= maxComparisons) {
213
+ console.log(`\u26A0\uFE0F Comparison safety limit reached (${maxComparisons.toLocaleString()} comparisons in --no-approx mode).`);
214
+ console.log(` This prevents excessive runtime on large repos. Consider using approximate mode (default) or --min-lines to reduce blocks.`);
215
+ break;
216
+ }
217
+ comparisonsProcessed++;
218
+ const block2 = allBlocks[j];
219
+ const similarity = jaccardSimilarity(blockTokens[i], blockTokens[j]);
220
+ if (similarity >= minSimilarity) {
221
+ const duplicate = {
222
+ file1: block1.file,
223
+ file2: block2.file,
224
+ line1: block1.startLine,
225
+ line2: block2.startLine,
226
+ endLine1: block1.endLine,
227
+ endLine2: block2.endLine,
228
+ similarity,
229
+ snippet: block1.content.split("\n").slice(0, 5).join("\n") + "\n...",
230
+ patternType: block1.patternType,
231
+ tokenCost: block1.tokenCost + block2.tokenCost,
232
+ linesOfCode: block1.linesOfCode
233
+ };
234
+ duplicates.push(duplicate);
235
+ if (streamResults) {
236
+ console.log(`
237
+ \u2705 Found: ${duplicate.patternType} ${Math.round(similarity * 100)}% similar`);
238
+ console.log(` ${duplicate.file1}:${duplicate.line1}-${duplicate.endLine1} \u21D4 ${duplicate.file2}:${duplicate.line2}-${duplicate.endLine2}`);
239
+ console.log(` Token cost: ${duplicate.tokenCost.toLocaleString()}`);
240
+ }
241
+ }
242
+ }
243
+ } else {
244
+ for (let j = i + 1; j < allBlocks.length; j++) {
245
+ if (maxComparisons && comparisonsProcessed >= maxComparisons) break;
246
+ comparisonsProcessed++;
247
+ const block2 = allBlocks[j];
248
+ if (block1.file === block2.file) continue;
249
+ const similarity = jaccardSimilarity(blockTokens[i], blockTokens[j]);
250
+ if (similarity >= minSimilarity) {
251
+ const duplicate = {
252
+ file1: block1.file,
253
+ file2: block2.file,
254
+ line1: block1.startLine,
255
+ line2: block2.startLine,
256
+ endLine1: block1.endLine,
257
+ endLine2: block2.endLine,
258
+ similarity,
259
+ snippet: block1.content.split("\n").slice(0, 5).join("\n") + "\n...",
260
+ patternType: block1.patternType,
261
+ tokenCost: block1.tokenCost + block2.tokenCost,
262
+ linesOfCode: block1.linesOfCode
263
+ };
264
+ duplicates.push(duplicate);
265
+ if (streamResults) {
266
+ console.log(`
267
+ \u2705 Found: ${duplicate.patternType} ${Math.round(similarity * 100)}% similar`);
268
+ console.log(` ${duplicate.file1}:${duplicate.line1}-${duplicate.endLine1} \u21D4 ${duplicate.file2}:${duplicate.line2}-${duplicate.endLine2}`);
269
+ console.log(` Token cost: ${duplicate.tokenCost.toLocaleString()}`);
270
+ }
271
+ }
272
+ }
273
+ }
274
+ }
275
+ if (comparisonsBudgetExhausted) {
276
+ console.log(`\u26A0\uFE0F Comparison budget exhausted (${maxComparisons.toLocaleString()} comparisons). Use --max-comparisons to increase.`);
277
+ }
278
+ return duplicates.sort(
279
+ (a, b) => b.similarity - a.similarity || b.tokenCost - a.tokenCost
280
+ );
281
+ }
282
+
283
+ // src/index.ts
284
+ function getRefactoringSuggestion(patternType, similarity) {
285
+ const baseMessages = {
286
+ "api-handler": "Extract common middleware or create a base handler class",
287
+ validator: "Consolidate validation logic into shared schema validators (Zod/Yup)",
288
+ utility: "Move to a shared utilities file and reuse across modules",
289
+ "class-method": "Consider inheritance or composition to share behavior",
290
+ component: "Extract shared logic into a custom hook or HOC",
291
+ function: "Extract into a shared helper function",
292
+ unknown: "Extract common logic into a reusable module"
293
+ };
294
+ const urgency = similarity > 0.95 ? " (CRITICAL: Nearly identical code)" : similarity > 0.9 ? " (HIGH: Very similar, refactor soon)" : "";
295
+ return baseMessages[patternType] + urgency;
296
+ }
297
+ async function getSmartDefaults(directory, userOptions) {
298
+ if (userOptions.useSmartDefaults === false) {
299
+ return {
300
+ rootDir: directory,
301
+ minSimilarity: 0.6,
302
+ minLines: 8,
303
+ batchSize: 100,
304
+ approx: true,
305
+ minSharedTokens: 12,
306
+ maxCandidatesPerBlock: 5,
307
+ streamResults: false,
308
+ severity: "all",
309
+ includeTests: false
310
+ };
311
+ }
312
+ const scanOptions = {
313
+ rootDir: directory,
314
+ include: userOptions.include || ["**/*.{ts,tsx,js,jsx,py,java}"],
315
+ exclude: userOptions.exclude
316
+ };
317
+ const { scanFiles: scanFiles2 } = await import("@aiready/core");
318
+ const files = await scanFiles2(scanOptions);
319
+ const estimatedBlocks = files.length * 3;
320
+ const maxCandidatesPerBlock = Math.max(3, Math.min(10, Math.floor(3e4 / estimatedBlocks)));
321
+ const minSimilarity = Math.min(0.75, 0.5 + estimatedBlocks / 1e4 * 0.25);
322
+ const minLines = Math.max(6, Math.min(12, 6 + Math.floor(estimatedBlocks / 2e3)));
323
+ const minSharedTokens = Math.max(10, Math.min(20, 10 + Math.floor(estimatedBlocks / 2e3)));
324
+ const batchSize = estimatedBlocks > 1e3 ? 200 : 100;
325
+ const severity = estimatedBlocks > 5e3 ? "high" : "all";
326
+ let defaults = {
327
+ rootDir: directory,
328
+ minSimilarity,
329
+ minLines,
330
+ batchSize,
331
+ approx: true,
332
+ minSharedTokens,
333
+ maxCandidatesPerBlock,
334
+ streamResults: false,
335
+ severity,
336
+ includeTests: false
337
+ };
338
+ const result = { ...defaults };
339
+ for (const [key, value] of Object.entries(defaults)) {
340
+ if (key in userOptions && userOptions[key] !== void 0) {
341
+ result[key] = userOptions[key];
342
+ }
343
+ }
344
+ return result;
345
+ }
346
+ function logConfiguration(config, estimatedBlocks) {
347
+ console.log("\u{1F4CB} Configuration:");
348
+ console.log(` Repository size: ~${estimatedBlocks} code blocks`);
349
+ console.log(` Similarity threshold: ${config.minSimilarity}`);
350
+ console.log(` Minimum lines: ${config.minLines}`);
351
+ console.log(` Approximate mode: ${config.approx ? "enabled" : "disabled"}`);
352
+ console.log(` Max candidates per block: ${config.maxCandidatesPerBlock}`);
353
+ console.log(` Min shared tokens: ${config.minSharedTokens}`);
354
+ console.log(` Severity filter: ${config.severity}`);
355
+ console.log(` Include tests: ${config.includeTests}`);
356
+ console.log("");
357
+ }
358
+ async function analyzePatterns(options) {
359
+ const smartDefaults = await getSmartDefaults(options.rootDir || ".", options);
360
+ const finalOptions = { ...smartDefaults, ...options };
361
+ const {
362
+ minSimilarity = 0.4,
363
+ minLines = 5,
364
+ batchSize = 100,
365
+ approx = true,
366
+ minSharedTokens = 8,
367
+ maxCandidatesPerBlock = 100,
368
+ streamResults = false,
369
+ severity = "all",
370
+ includeTests = false,
371
+ ...scanOptions
372
+ } = finalOptions;
373
+ const { scanFiles: scanFiles2 } = await import("@aiready/core");
374
+ const files = await scanFiles2(scanOptions);
375
+ const estimatedBlocks = files.length * 3;
376
+ logConfiguration(finalOptions, estimatedBlocks);
377
+ const results = [];
378
+ const fileContents = await Promise.all(
379
+ files.map(async (file) => ({
380
+ file,
381
+ content: await readFileContent(file)
382
+ }))
383
+ );
384
+ const duplicates = await detectDuplicatePatterns(fileContents, {
385
+ minSimilarity,
386
+ minLines,
387
+ batchSize,
388
+ approx,
389
+ minSharedTokens,
390
+ maxCandidatesPerBlock,
391
+ streamResults
392
+ });
393
+ for (const file of files) {
394
+ const fileDuplicates = duplicates.filter(
395
+ (dup) => dup.file1 === file || dup.file2 === file
396
+ );
397
+ const issues = fileDuplicates.map((dup) => {
398
+ const otherFile = dup.file1 === file ? dup.file2 : dup.file1;
399
+ const severity2 = dup.similarity > 0.95 ? "critical" : dup.similarity > 0.9 ? "major" : "minor";
400
+ return {
401
+ type: "duplicate-pattern",
402
+ severity: severity2,
403
+ message: `${dup.patternType} pattern ${Math.round(dup.similarity * 100)}% similar to ${otherFile} (${dup.tokenCost} tokens wasted)`,
404
+ location: {
405
+ file,
406
+ line: dup.file1 === file ? dup.line1 : dup.line2
407
+ },
408
+ suggestion: getRefactoringSuggestion(dup.patternType, dup.similarity)
409
+ };
410
+ });
411
+ let filteredIssues = issues;
412
+ if (severity !== "all") {
413
+ const severityMap = {
414
+ critical: ["critical"],
415
+ high: ["critical", "major"],
416
+ medium: ["critical", "major", "minor"]
417
+ };
418
+ const allowedSeverities = severityMap[severity] || ["critical", "major", "minor"];
419
+ filteredIssues = issues.filter((issue) => allowedSeverities.includes(issue.severity));
420
+ }
421
+ const totalTokenCost = fileDuplicates.reduce(
422
+ (sum, dup) => sum + dup.tokenCost,
423
+ 0
424
+ );
425
+ results.push({
426
+ fileName: file,
427
+ issues: filteredIssues,
428
+ metrics: {
429
+ tokenCost: totalTokenCost,
430
+ consistencyScore: Math.max(0, 1 - fileDuplicates.length * 0.1)
431
+ }
432
+ });
433
+ }
434
+ return { results, duplicates, files };
435
+ }
436
+ function generateSummary(results) {
437
+ const allIssues = results.flatMap((r) => r.issues);
438
+ const totalTokenCost = results.reduce(
439
+ (sum, r) => sum + (r.metrics.tokenCost || 0),
440
+ 0
441
+ );
442
+ const patternsByType = {
443
+ "api-handler": 0,
444
+ validator: 0,
445
+ utility: 0,
446
+ "class-method": 0,
447
+ component: 0,
448
+ function: 0,
449
+ unknown: 0
450
+ };
451
+ allIssues.forEach((issue) => {
452
+ const match = issue.message.match(/^(\S+(?:-\S+)*) pattern/);
453
+ if (match) {
454
+ const type = match[1];
455
+ patternsByType[type] = (patternsByType[type] || 0) + 1;
456
+ }
457
+ });
458
+ const topDuplicates = allIssues.slice(0, 10).map((issue) => {
459
+ const similarityMatch = issue.message.match(/(\d+)% similar/);
460
+ const tokenMatch = issue.message.match(/\((\d+) tokens/);
461
+ const typeMatch = issue.message.match(/^(\S+(?:-\S+)*) pattern/);
462
+ const fileMatch = issue.message.match(/similar to (.+?) \(/);
463
+ return {
464
+ files: [
465
+ {
466
+ path: issue.location.file,
467
+ startLine: issue.location.line,
468
+ endLine: 0
469
+ // Not available from Issue
470
+ },
471
+ {
472
+ path: fileMatch?.[1] || "unknown",
473
+ startLine: 0,
474
+ // Not available from Issue
475
+ endLine: 0
476
+ // Not available from Issue
477
+ }
478
+ ],
479
+ similarity: similarityMatch ? parseInt(similarityMatch[1]) / 100 : 0,
480
+ patternType: typeMatch?.[1] || "unknown",
481
+ tokenCost: tokenMatch ? parseInt(tokenMatch[1]) : 0
482
+ };
483
+ });
484
+ return {
485
+ totalPatterns: allIssues.length,
486
+ totalTokenCost,
487
+ patternsByType,
488
+ topDuplicates
489
+ };
490
+ }
491
+
492
+ export {
493
+ detectDuplicatePatterns,
494
+ getSmartDefaults,
495
+ analyzePatterns,
496
+ generateSummary
497
+ };
package/dist/cli.js CHANGED
@@ -340,14 +340,7 @@ async function getSmartDefaults(directory, userOptions) {
340
340
  const scanOptions = {
341
341
  rootDir: directory,
342
342
  include: userOptions.include || ["**/*.{ts,tsx,js,jsx,py,java}"],
343
- exclude: userOptions.exclude || [
344
- "**/node_modules/**",
345
- "**/dist/**",
346
- "**/build/**",
347
- "**/coverage/**",
348
- "**/.git/**",
349
- "**/.turbo/**"
350
- ]
343
+ exclude: userOptions.exclude
351
344
  };
352
345
  const { scanFiles: scanFiles2 } = await import("@aiready/core");
353
346
  const files = await scanFiles2(scanOptions);
package/dist/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  analyzePatterns,
4
4
  generateSummary
5
- } from "./chunk-GSJFORRO.mjs";
5
+ } from "./chunk-65G3HXLQ.mjs";
6
6
 
7
7
  // src/cli.ts
8
8
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -349,14 +349,7 @@ async function getSmartDefaults(directory, userOptions) {
349
349
  const scanOptions = {
350
350
  rootDir: directory,
351
351
  include: userOptions.include || ["**/*.{ts,tsx,js,jsx,py,java}"],
352
- exclude: userOptions.exclude || [
353
- "**/node_modules/**",
354
- "**/dist/**",
355
- "**/build/**",
356
- "**/coverage/**",
357
- "**/.git/**",
358
- "**/.turbo/**"
359
- ]
352
+ exclude: userOptions.exclude
360
353
  };
361
354
  const { scanFiles: scanFiles2 } = await import("@aiready/core");
362
355
  const files = await scanFiles2(scanOptions);
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  detectDuplicatePatterns,
4
4
  generateSummary,
5
5
  getSmartDefaults
6
- } from "./chunk-GSJFORRO.mjs";
6
+ } from "./chunk-65G3HXLQ.mjs";
7
7
  export {
8
8
  analyzePatterns,
9
9
  detectDuplicatePatterns,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiready/pattern-detect",
3
- "version": "0.8.3",
3
+ "version": "0.8.5",
4
4
  "description": "Semantic duplicate pattern detection for AI-generated code - finds similar implementations that waste AI context tokens",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "commander": "^14.0.0",
47
47
  "chalk": "^5.3.0",
48
- "@aiready/core": "0.5.4"
48
+ "@aiready/core": "0.5.6"
49
49
  },
50
50
  "devDependencies": {
51
51
  "tsup": "^8.3.5",