omp-plugin-duplicate-detector 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,32 +2,20 @@
2
2
 
3
3
  Real-time duplicate code detection for [oh-my-pi](https://github.com/oh-my-pi/oh-my-pi) (`omp`), built on [jscpd](https://github.com/kucherenko/jscpd).
4
4
 
5
+ <img width="717" height="254" alt="image" src="https://github.com/user-attachments/assets/d4673964-1842-4a38-93de-72772edede98" />
6
+
5
7
  The plugin indexes your repository in the background and watches the agent as it works. When newly written or edited code duplicates existing logic anywhere in the workspace, the agent is warned immediately, before the copy-paste hardens into a maintenance problem. Duplicate detection can be toggled on or off per project using `/duplicates on|off`.
6
8
 
7
9
  Indexing and mutation checks run entirely in a background worker with a persistent on-disk cache, so sessions start instantly and the agent loop is never blocked, even in large repositories.
8
10
  ## Installation
9
11
 
10
- Link the plugin into your local `omp` registry:
12
+ Install directly via the `omp` CLI:
11
13
 
12
14
  ```bash
13
- omp plugin link /path/to/omp-plugin-duplicate-detector
14
- ```
15
-
16
- Or declare it in `~/.omp/agent/config.yml` (or a project-level `.omp/config.yml`):
17
-
18
- ```yaml
19
- extensions:
20
- - /path/to/omp-plugin-duplicate-detector
21
- ```
22
-
23
- Or load it for a single session:
24
-
25
- ```bash
26
- omp -e /path/to/omp-plugin-duplicate-detector
15
+ omp plugin install omp-plugin-duplicate-detector
27
16
  ```
28
17
 
29
18
  On startup you'll see a short readiness note in the transcript, e.g. `Duplicate detector: Ready (1,420 Git files indexed, cached)`.
30
-
31
19
  ## Usage
32
20
 
33
21
  ### Real-time warnings
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omp-plugin-duplicate-detector",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Code clone and duplication detector plugin for oh-my-pi powered by jscpd",
5
5
  "type": "module",
6
6
  "files": [
@@ -158,6 +158,9 @@ export class DuplicateDetectorCoordinator extends EventEmitter<CoordinatorEvents
158
158
 
159
159
  try {
160
160
  const worker = new Worker(this.#workerUrl);
161
+ if (typeof worker.unref === "function") {
162
+ worker.unref();
163
+ }
161
164
 
162
165
  worker.onmessage = (event: MessageEvent<unknown>) => {
163
166
  this.#handleWorkerMessage(event.data);
@@ -264,6 +267,9 @@ export class DuplicateDetectorCoordinator extends EventEmitter<CoordinatorEvents
264
267
  ).catch(() => {});
265
268
  }
266
269
  }, delay);
270
+ if (typeof this.#restartTimer.unref === "function") {
271
+ this.#restartTimer.unref();
272
+ }
267
273
  }
268
274
  }
269
275
 
@@ -300,7 +306,9 @@ export class DuplicateDetectorCoordinator extends EventEmitter<CoordinatorEvents
300
306
  ),
301
307
  );
302
308
  }, this.#requestTimeoutMs);
303
-
309
+ if (typeof timeoutTimer.unref === "function") {
310
+ timeoutTimer.unref();
311
+ }
304
312
  this.#pendingRequests.set(id, {
305
313
  resolve: resolve as (value: unknown) => void,
306
314
  reject,