dsh-locator 0.5.0 → 0.5.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.
- package/CHANGELOG.md +11 -0
- package/README-es.md +162 -0
- package/README-hi.md +162 -0
- package/README-pt.md +162 -0
- package/README.en.md +257 -0
- package/README.md +172 -143
- package/docs/assets/architecture.svg +68 -0
- package/docs/assets/panel-en.png +0 -0
- package/docs/assets/panel-zh.png +0 -0
- package/package.json +7 -3
- package/README-zh.md +0 -226
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.2 — 2026-11-10
|
|
4
|
+
|
|
5
|
+
* Replaced both README screenshots with demo data (`/tmp/demo`); the previous images exposed a home-directory path and have been withdrawn (npm 0.5.1 unpublished, tag/history rewritten).
|
|
6
|
+
* No code change.
|
|
7
|
+
|
|
8
|
+
## 0.5.1 — 2026-11-10
|
|
9
|
+
|
|
10
|
+
* README is now Chinese-primary (`README.md`) with full English (`README.en.md`), Spanish, Portuguese and Hindi translations; the old `README-zh.md` was replaced.
|
|
11
|
+
* Added a real panel screenshot (zh/en) and an architecture SVG under `docs/assets/`.
|
|
12
|
+
* Added the same centered header, install-channel matrix, mirror badges, official-repository note and star CTA used by the rest of the family.
|
|
13
|
+
|
|
3
14
|
## 0.5.0 — 2026-11-09
|
|
4
15
|
|
|
5
16
|
* **USN restart catch-up**: index records carry the NTFS FRN (in the old snapshot padding, so v1 snapshots still load), `scan --usn` persists `usn-state.json` (journal id, next USN, roots), and `serve --usn` replays the journal before serving. A file created while the daemon is stopped is found after restart without a full scan; a wrapped/mismatched journal falls back to the portable watcher. Validated on a Windows CI runner.
|
package/README-es.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🔎 dsh-locator
|
|
4
|
+
|
|
5
|
+
**Búsqueda de archivos en todo el disco, en milisegundos, para DeepSeek Harness — sin Everything.**
|
|
6
|
+
|
|
7
|
+
Índice propio multiplataforma (Windows USN/MFT · macOS FSEvents · Linux inotify), cuatro herramientas para el agente y un panel web ordenable.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
10
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
11
|
+
[](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-locator/releases)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://github.com/topics/dsh-plugin)
|
|
15
|
+
[](#)
|
|
16
|
+
[](https://gitee.com/perrylink/dsh-locator)
|
|
17
|
+
[](https://gitcode.com/PerryLink/dsh-locator)
|
|
18
|
+
|
|
19
|
+
[简体中文](README.md) · [English](README.en.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add dsh-locator
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
> **Repositorio oficial:** [GitHub `PerryLink/dsh-locator`](https://github.com/PerryLink/dsh-locator). Gitee y GitCode son espejos sincronizados automáticamente; GitHub es la fuente de verdad.
|
|
28
|
+
>
|
|
29
|
+
> Forma parte de la [familia de plugins DSH](https://github.com/PerryLink) (Apache-2.0). Si te sirve, **una ⭐ ayuda a que la próxima persona lo encuentre**; no desbloquea nada.
|
|
30
|
+
|
|
31
|
+
`dsh-locator` indexa una vez los directorios que elijas, guarda el resultado en una instantánea compacta, aplica los cambios del sistema de archivos y responde consultas de nombre/ruta en decenas de milisegundos sobre más de un millón de entradas. El agente recibe `locator_search`, `locator_status`, `locator_rebuild` y `locator_export`; las personas tienen un **panel global** en la Web GUI (`Ctrl+Shift+F` o la lupa del pie de la barra lateral).
|
|
32
|
+
|
|
33
|
+
## ¿Por qué otro buscador?
|
|
34
|
+
|
|
35
|
+
`glob` y `grep` recorren el workspace en cada llamada: rápidos si conoces el directorio, lentos si solo recuerdas parte de un nombre. Everything es excelente en Windows, pero solo existe en Windows; envolverlo deja fuera macOS, Linux, WSL y hosts remotos. `dsh-locator` es dueño del índice, así que las mismas herramientas funcionan en cualquier sitio donde corran Node y Go.
|
|
36
|
+
|
|
37
|
+
## Instalación
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# npm (recomendado)
|
|
41
|
+
dsh plugin --profile web add dsh-locator
|
|
42
|
+
|
|
43
|
+
# GitHub main
|
|
44
|
+
dsh plugin --profile web add github:PerryLink/dsh-locator
|
|
45
|
+
|
|
46
|
+
# desde el código
|
|
47
|
+
pnpm install
|
|
48
|
+
pnpm build
|
|
49
|
+
pnpm build:engine
|
|
50
|
+
dsh plugin --profile web add /ruta/absoluta/dsh-locator
|
|
51
|
+
|
|
52
|
+
# tarball
|
|
53
|
+
npm pack
|
|
54
|
+
dsh plugin --profile web add /ruta/absoluta/dsh-locator-0.5.0.tgz
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
El paquete npm incluye motores precompilados para `linux-x64`, `linux-arm64`, `win32-x64`, `win32-arm64`, `darwin-x64` y `darwin-arm64`.
|
|
58
|
+
|
|
59
|
+
Si instalas en un perfil Web ya en ejecución, **recarga la página** (`F5`): las herramientas pueden montarse en caliente, pero el panel (`client.js`) se carga desde el boot graph al abrir la página. Los perfiles headless/TUI no montan panel.
|
|
60
|
+
|
|
61
|
+
## Panel web
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
Pulsa `Ctrl+Shift+F` en cualquier parte de la Web GUI, o haz clic en la lupa del pie de la barra lateral. El panel consulta el mismo índice mediante rutas del host del mismo origen (`POST /dsh-locator/search`, `POST /dsh-locator/status`), sin segundo servidor ni puerto extra.
|
|
66
|
+
|
|
67
|
+
* Consulta vacía: entradas recientes por fecha; al escribir, debounce de 110 ms y la misma sintaxis que las herramientas.
|
|
68
|
+
* Clic en una columna para ordenar por nombre, tamaño, fecha o ruta; otro clic invierte.
|
|
69
|
+
* `Solo archivos` / `Solo carpetas`; la barra inferior muestra aciertos, límite y tiempo.
|
|
70
|
+
* `↑`/`↓` selecciona, `Enter` copia, `Ctrl+O` abre, `Ctrl+Enter` inserta `@"ruta"` en el compositor, doble clic revela en el explorador, `Esc` cierra.
|
|
71
|
+
* La interfaz sigue `navigator.language` (zh/en/es/pt/hi).
|
|
72
|
+
|
|
73
|
+
## Herramientas
|
|
74
|
+
|
|
75
|
+
| Herramienta | Uso |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `locator_search` | Consulta el índice con sintaxis estilo Everything. |
|
|
78
|
+
| `locator_status` | Raíces, entradas, watcher, modo USN y errores. |
|
|
79
|
+
| `locator_rebuild` | Reconstruye en segundo plano; las búsquedas siguen usando el índice anterior. |
|
|
80
|
+
| `locator_export` | Copia de solo lectura en SQLite (`entries(path, name, dir, size, mtime_ms, ext)`). |
|
|
81
|
+
|
|
82
|
+
### Sintaxis de consulta
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
reporte palabras AND en el nombre
|
|
86
|
+
"dos palabras" frase literal
|
|
87
|
+
*.go ? comodines
|
|
88
|
+
ext:pdf,docx ext:!tmp por extensión (o negación)
|
|
89
|
+
path:src subcadena de la ruta completa
|
|
90
|
+
size:>10mb 1kb..2mb tamaño
|
|
91
|
+
dm:today dm:thisweek fecha de modificación
|
|
92
|
+
folder: file: solo carpetas / solo archivos
|
|
93
|
+
!tmp negar
|
|
94
|
+
case:1 wholeword:1 mayúsculas / palabra completa
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Configuración esencial
|
|
98
|
+
|
|
99
|
+
| Clave | Valor |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `roots` | Directorios a indexar; vacío = directorio personal. |
|
|
102
|
+
| `excludes` | Globs por nombre (`node_modules`, `.git`, …). |
|
|
103
|
+
| `watch` | Activa las notificaciones del sistema. |
|
|
104
|
+
| `refreshIntervalMs` | Reconstrucción periódica si no hay watcher nativo. |
|
|
105
|
+
| `windowsUsn` | Ruta rápida USN/MFT (Windows, administrador; por defecto `false`). |
|
|
106
|
+
| `scanWorkers` | Lectores de directorio en paralelo; 0 = CPU. |
|
|
107
|
+
| `stateDir` | Directorio de la instantánea; vacío = caché del sistema. |
|
|
108
|
+
|
|
109
|
+
## Plataformas
|
|
110
|
+
|
|
111
|
+
| Plataforma | Exploración | Actualizaciones |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| Linux | recorrido paralelo | inotify recursivo |
|
|
114
|
+
| Windows | recorrido o USN/MFT (admin) | `ReadDirectoryChangesW`; USN reanuda tras reinicio |
|
|
115
|
+
| macOS | recorrido | FSEvents en binarios cgo; kqueue como respaldo |
|
|
116
|
+
|
|
117
|
+
En Windows, `scan --usn` guarda `usn-state.json` (id del diario, siguiente USN, raíces) y `serve --usn` reproduce el diario antes de servir: un archivo creado con el daemon detenido aparece al reiniciar sin reescanear. Un diario desactualizado o desmontado cae al watcher portátil.
|
|
118
|
+
|
|
119
|
+
## Rendimiento
|
|
120
|
+
|
|
121
|
+
- 1,2 M de entradas: consulta en caliente 25–35 ms; búsqueda durante el escaneo ~2 ms.
|
|
122
|
+
- `C:\Windows` (164 216 entradas) indexado por USN en 7,8 s en un runner de CI; consulta 9,6 ms.
|
|
123
|
+
- `locator_export` de 1,24 M de filas: 477 MB, 6,4 s.
|
|
124
|
+
|
|
125
|
+
## Diseño
|
|
126
|
+
|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
* **Escaneo paralelo**: cola acotada, lotes por directorio para que el padre exista antes que los hijos.
|
|
130
|
+
* **Memoria**: registros de 40 B, nombres en una arena compartida, tabla de rutas abierta; la ruta completa se reconstruye solo al devolver resultados.
|
|
131
|
+
* **Consulta**: los términos se compilan una vez, se reparten por fragmentos y un heap acotado selecciona `offset+limit`.
|
|
132
|
+
* **Persistencia**: archivo temporal + rename atómico; el snapshot es la fuente de arranque.
|
|
133
|
+
* **Protocolo**: NDJSON por stdio; sin puerto ni superficie de red.
|
|
134
|
+
|
|
135
|
+
## Compilar desde el código
|
|
136
|
+
|
|
137
|
+
Requiere Node `^22.19 || >=24.9`, pnpm y Go 1.22+.
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
pnpm install
|
|
141
|
+
pnpm build
|
|
142
|
+
pnpm build:engine:all
|
|
143
|
+
pnpm check
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
El motor Go vive en `engine/`; pruebas: `cd engine && go test ./...`.
|
|
147
|
+
|
|
148
|
+
## Límites
|
|
149
|
+
|
|
150
|
+
* Solo nombres, rutas, tamaños y fechas: **no indexa contenido**. Para contenido usa `grep`.
|
|
151
|
+
* No es un driver de sistema de archivos; cubre solo las raíces configuradas.
|
|
152
|
+
* inotify consume un descriptor por directorio; árboles enormes pueden agotar el límite del kernel (se avisa y la instantánea sigue usable).
|
|
153
|
+
* Escrituras WSL en `/mnt/c` pueden no generar notificaciones de Windows; reconstruye esas raíces.
|
|
154
|
+
* macOS: FSEvents en los binarios publicados; kqueue (máx. 4.096 directorios) en compilaciones `CGO_ENABLED=0`. Los cambios de contenido dependen de la reconstrucción periódica.
|
|
155
|
+
|
|
156
|
+
## Seguridad y privacidad
|
|
157
|
+
|
|
158
|
+
El índice es local: sin red, sin telemetría, sin subidas. La instantánea contiene nombres y rutas; trátala como datos privados. El plugin nunca modifica, mueve ni borra los archivos indexados.
|
|
159
|
+
|
|
160
|
+
## Licencia
|
|
161
|
+
|
|
162
|
+
Apache-2.0.
|
package/README-hi.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🔎 dsh-locator
|
|
4
|
+
|
|
5
|
+
**DeepSeek Harness के लिए पूरे डिस्क पर मिलीसेकंड में फ़ाइल खोज — Everything के बिना।**
|
|
6
|
+
|
|
7
|
+
अपना क्रॉस-प्लेटफ़ॉर्म इंडेक्स (Windows USN/MFT · macOS FSEvents · Linux inotify), एजेंट के लिए चार टूल और क्रमबद्ध करने योग्य Web पैनल।
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
10
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
11
|
+
[](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-locator/releases)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://github.com/topics/dsh-plugin)
|
|
15
|
+
[](#)
|
|
16
|
+
[](https://gitee.com/perrylink/dsh-locator)
|
|
17
|
+
[](https://gitcode.com/PerryLink/dsh-locator)
|
|
18
|
+
|
|
19
|
+
[简体中文](README.md) · [English](README.en.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add dsh-locator
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
> **आधिकारिक रिपॉज़िटरी:** [GitHub `PerryLink/dsh-locator`](https://github.com/PerryLink/dsh-locator)। Gitee और GitCode स्वतः सिंक होने वाले मिरर हैं; GitHub ही स्रोत है।
|
|
28
|
+
>
|
|
29
|
+
> यह [DSH प्लगइन परिवार](https://github.com/PerryLink) (Apache-2.0) का हिस्सा है। अगर यह मदद करे, तो **एक ⭐** अगली बार खोजने वाले की मदद करता है — इससे कोई सुविधा नहीं खुलती।
|
|
30
|
+
|
|
31
|
+
`dsh-locator` आपके चुने हुए डायरेक्टरी को एक बार इंडेक्स करता है, परिणाम को एक कॉम्पैक्ट स्नैपशॉट में रखता है, फ़ाइल सिस्टम के बदलाव लागू करता है, और दस लाख से अधिक प्रविष्टियों पर नाम/पथ क्वेरी कुछ दसियों मिलीसेकंड में लौटाता है। एजेंट को `locator_search`, `locator_status`, `locator_rebuild` और `locator_export` मिलते हैं; लोगों को Web GUI में एक **वैश्विक पैनल** मिलता है (`Ctrl+Shift+F` या साइडबार के निचले हिस्से में आवर्धक चिह्न)।
|
|
32
|
+
|
|
33
|
+
## एक और खोज क्यों?
|
|
34
|
+
|
|
35
|
+
`glob` और `grep` हर कॉल पर वर्कस्पेस घूमते हैं — डायरेक्टरी पता हो तो तेज़, नाम का कुछ हिस्सा याद हो तो धीमे। Everything Windows पर बहुत अच्छा है, पर केवल Windows पर; उसे लपेटने से macOS, Linux, WSL और रिमोट होस्ट बाहर रह जाते हैं। `dsh-locator` खुद इंडेक्स का मालिक है, इसलिए वही टूल हर जगह चलते हैं जहाँ Node और Go चलते हैं।
|
|
36
|
+
|
|
37
|
+
## इंस्टॉल
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# npm (अनुशंसित)
|
|
41
|
+
dsh plugin --profile web add dsh-locator
|
|
42
|
+
|
|
43
|
+
# GitHub main
|
|
44
|
+
dsh plugin --profile web add github:PerryLink/dsh-locator
|
|
45
|
+
|
|
46
|
+
# सोर्स से
|
|
47
|
+
pnpm install
|
|
48
|
+
pnpm build
|
|
49
|
+
pnpm build:engine
|
|
50
|
+
dsh plugin --profile web add /absolute/path/dsh-locator
|
|
51
|
+
|
|
52
|
+
# tarball
|
|
53
|
+
npm pack
|
|
54
|
+
dsh plugin --profile web add /absolute/path/dsh-locator-0.5.0.tgz
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
npm पैकेज में `linux-x64`, `linux-arm64`, `win32-x64`, `win32-arm64`, `darwin-x64` और `darwin-arm64` के पहले से बने इंजन हैं।
|
|
58
|
+
|
|
59
|
+
चल रहे Web प्रोफ़ाइल में इंस्टॉल के बाद **पेज रीलोड करें** (`F5`): टूल तुरंत माउंट हो सकते हैं, पर पैनल (`client.js`) पेज लोड पर boot graph से आता है। headless/TUI प्रोफ़ाइल में पैनल नहीं मिलता।
|
|
60
|
+
|
|
61
|
+
## Web पैनल
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
Web GUI में कहीं भी `Ctrl+Shift+F` दबाएँ, या साइडबार के निचले हिस्से में आवर्धक चिह्न पर क्लिक करें। पैनल उसी इंडेक्स को समान-मूल होस्ट रूट से क्वेरी करता है (`POST /dsh-locator/search`, `POST /dsh-locator/status`) — दूसरा सर्वर या अतिरिक्त पोर्ट नहीं।
|
|
66
|
+
|
|
67
|
+
* खाली क्वेरी: तारीख़ के अनुसार हाल की प्रविष्टियाँ; टाइप करते ही 110 ms डिबाउंस और टूल जैसी ही सिंटैक्स।
|
|
68
|
+
* कॉलम हेडर पर क्लिक करके नाम, आकार, तारीख़ या पथ से क्रम; दोबारा क्लिक पर उलटा।
|
|
69
|
+
* `केवल फ़ाइलें` / `केवल फ़ोल्डर`; निचली पट्टी में हिट, सीमा और समय।
|
|
70
|
+
* `↑`/`↓` चयन, `Enter` कॉपी, `Ctrl+O` खोलें, `Ctrl+Enter` कंपोज़र में `@"पथ"` डालें, डबल-क्लिक फ़ाइल मैनेजर में दिखाएँ, `Esc` बंद।
|
|
71
|
+
* इंटरफ़ेस `navigator.language` का पालन करता है (zh/en/es/pt/hi)।
|
|
72
|
+
|
|
73
|
+
## टूल
|
|
74
|
+
|
|
75
|
+
| टूल | काम |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `locator_search` | Everything-शैली सिंटैक्स से इंडेक्स क्वेरी। |
|
|
78
|
+
| `locator_status` | रूट, प्रविष्टियाँ, watcher, USN मोड और त्रुटियाँ। |
|
|
79
|
+
| `locator_rebuild` | पृष्ठभूमि में पुनर्निर्माण; खोज पुराने इंडेक्स से चलती रहती है। |
|
|
80
|
+
| `locator_export` | केवल-पढ़ने योग्य SQLite प्रति (`entries(path, name, dir, size, mtime_ms, ext)`)। |
|
|
81
|
+
|
|
82
|
+
### क्वेरी सिंटैक्स
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
report नाम में AND शब्द
|
|
86
|
+
"do shabd" सटीक वाक्यांश
|
|
87
|
+
*.go ? वाइल्डकार्ड
|
|
88
|
+
ext:pdf,docx ext:!tmp एक्सटेंशन (या नकार)
|
|
89
|
+
path:src पूरे पथ का उपभाग
|
|
90
|
+
size:>10mb 1kb..2mb आकार
|
|
91
|
+
dm:today dm:thisweek बदलाव की तारीख़
|
|
92
|
+
folder: file: केवल फ़ोल्डर / केवल फ़ाइलें
|
|
93
|
+
!tmp नकार
|
|
94
|
+
case:1 wholeword:1 केस / पूरा शब्द
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## मुख्य कॉन्फ़िग
|
|
98
|
+
|
|
99
|
+
| कुंजी | अर्थ |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `roots` | इंडेक्स करने वाली डायरेक्टरियाँ; खाली = होम डायरेक्टरी। |
|
|
102
|
+
| `excludes` | नाम-आधारित glob (`node_modules`, `.git`, …)। |
|
|
103
|
+
| `watch` | सिस्टम की फ़ाइल सूचनाएँ चालू करें। |
|
|
104
|
+
| `refreshIntervalMs` | नेटिव watcher न होने पर समय-समय पर पुनर्निर्माण। |
|
|
105
|
+
| `windowsUsn` | USN/MFT तेज़ रास्ता (Windows, व्यवस्थापक; डिफ़ॉल्ट `false`)। |
|
|
106
|
+
| `scanWorkers` | समानांतर डायरेक्टरी रीडर; 0 = CPU। |
|
|
107
|
+
| `stateDir` | स्नैपशॉट डायरेक्टरी; खाली = सिस्टम कैश। |
|
|
108
|
+
|
|
109
|
+
## प्लेटफ़ॉर्म
|
|
110
|
+
|
|
111
|
+
| प्लेटफ़ॉर्म | स्कैन | अपडेट |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| Linux | समानांतर वॉक | inotify (पुनरावर्ती) |
|
|
114
|
+
| Windows | वॉक या USN/MFT (admin) | `ReadDirectoryChangesW`; USN पुनः आरंभ पर फिर शुरू |
|
|
115
|
+
| macOS | वॉक | cgo बाइनरी में FSEvents; `CGO_ENABLED=0` पर kqueue |
|
|
116
|
+
|
|
117
|
+
Windows पर `scan --usn` `usn-state.json` (जर्नल id, अगला USN, रूट) लिखता है और `serve --usn` सेवा से पहले जर्नल दोहराता है: डेमॉन बंद रहते बनाई फ़ाइल पुनः आरंभ पर बिना पूरे स्कैन के दिखती है। पुराना/हटाया जर्नल पोर्टेबल watcher पर लौट आता है।
|
|
118
|
+
|
|
119
|
+
## प्रदर्शन
|
|
120
|
+
|
|
121
|
+
- 1.2 M प्रविष्टियाँ: गरम क्वेरी 25–35 ms; स्कैन के दौरान खोज ~2 ms।
|
|
122
|
+
- `C:\Windows` (164,216 प्रविष्टियाँ) USN से CI runner पर 7.8 s में इंडेक्स; क्वेरी 9.6 ms।
|
|
123
|
+
- 1.24 M पंक्तियों का `locator_export`: 477 MB, 6.4 s।
|
|
124
|
+
|
|
125
|
+
## डिज़ाइन
|
|
126
|
+
|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
* **समानांतर स्कैन**: सीमित कतार, प्रति-डायरेक्टरी बैच ताकि पिता बच्चों से पहले मौजूद हो।
|
|
130
|
+
* **मेमोरी**: 40 B रिकॉर्ड, साझा नाम arena, खुली पथ तालिका; पूरा पथ केवल परिणाम लौटाते समय बनता है।
|
|
131
|
+
* **क्वेरी**: शब्द एक बार पार्स, खंडों में समानांतर मिलान, सीमित heap से `offset+limit`।
|
|
132
|
+
* **स्थायित्व**: अस्थायी फ़ाइल + atomic rename; स्नैपशॉट ही शुरुआत का स्रोत।
|
|
133
|
+
* **प्रोटोकॉल**: stdio पर NDJSON; कोई पोर्ट या नेटवर्क सतह नहीं।
|
|
134
|
+
|
|
135
|
+
## सोर्स से बिल्ड
|
|
136
|
+
|
|
137
|
+
Node `^22.19 || >=24.9`, pnpm और Go 1.22+ चाहिए।
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
pnpm install
|
|
141
|
+
pnpm build
|
|
142
|
+
pnpm build:engine:all
|
|
143
|
+
pnpm check
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Go इंजन `engine/` में है; टेस्ट: `cd engine && go test ./...`.
|
|
147
|
+
|
|
148
|
+
## सीमाएँ
|
|
149
|
+
|
|
150
|
+
* केवल नाम, पथ, आकार और तारीख़: **सामग्री इंडेक्स नहीं**। सामग्री के लिए `grep`।
|
|
151
|
+
* यह फ़ाइल-सिस्टम ड्राइवर नहीं; केवल कॉन्फ़िगर किए रूट कवर करता है।
|
|
152
|
+
* inotify प्रति डायरेक्टरी एक descriptor लेता है; बहुत बड़े पेड़ कर्नेल सीमा पार कर सकते हैं (चेतावनी मिलती है, स्नैपशॉट उपयोगी रहता है)।
|
|
153
|
+
* WSL की `/mnt/c` लेख Windows सूचनाएँ नहीं दे सकतीं; उन रूट को फिर से बनाएँ।
|
|
154
|
+
* macOS: प्रकाशित बाइनरी में FSEvents; `CGO_ENABLED=0` बिल्ड में kqueue (अधिकतम 4,096 डायरेक्टरी)। सामग्री बदलाव समय-समय पर पुनर्निर्माण से।
|
|
155
|
+
|
|
156
|
+
## सुरक्षा और गोपनीयता
|
|
157
|
+
|
|
158
|
+
इंडेक्स स्थानीय है: कोई नेटवर्क, टेलीमेट्री या अपलोड नहीं। स्नैपशॉट में नाम और पथ हैं, इसे निजी डेटा मानें। प्लगइन इंडेक्स की गई फ़ाइलों को कभी बदलता, हटाता या स्थानांतरित नहीं करता।
|
|
159
|
+
|
|
160
|
+
## लाइसेंस
|
|
161
|
+
|
|
162
|
+
Apache-2.0.
|
package/README-pt.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# 🔎 dsh-locator
|
|
4
|
+
|
|
5
|
+
**Busca de arquivos em todo o disco, em milissegundos, para o DeepSeek Harness — sem o Everything.**
|
|
6
|
+
|
|
7
|
+
Índice próprio multiplataforma (Windows USN/MFT · macOS FSEvents · Linux inotify), quatro ferramentas para o agente e um painel web ordenável.
|
|
8
|
+
|
|
9
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
10
|
+
[](https://www.npmjs.com/package/dsh-locator)
|
|
11
|
+
[](https://github.com/PerryLink/dsh-locator/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/PerryLink/dsh-locator/releases)
|
|
13
|
+
[](LICENSE)
|
|
14
|
+
[](https://github.com/topics/dsh-plugin)
|
|
15
|
+
[](#)
|
|
16
|
+
[](https://gitee.com/perrylink/dsh-locator)
|
|
17
|
+
[](https://gitcode.com/PerryLink/dsh-locator)
|
|
18
|
+
|
|
19
|
+
[简体中文](README.md) · [English](README.en.md) · [Español](README-es.md) · [Português](README-pt.md) · [हिन्दी](README-hi.md)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add dsh-locator
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
> **Repositório oficial:** [GitHub `PerryLink/dsh-locator`](https://github.com/PerryLink/dsh-locator). Gitee e GitCode são espelhos sincronizados automaticamente; o GitHub é a fonte da verdade.
|
|
28
|
+
>
|
|
29
|
+
> Faz parte da [família de plugins DSH](https://github.com/PerryLink) (Apache-2.0). Se ajudar, **uma ⭐ ajuda a próxima pessoa a encontrar**; nada é liberado por isso.
|
|
30
|
+
|
|
31
|
+
`dsh-locator` indexa uma vez os diretórios escolhidos, guarda o resultado num instantâneo compacto, aplica as mudanças do sistema de arquivos e responde consultas de nome/caminho em dezenas de milissegundos sobre mais de um milhão de entradas. O agente recebe `locator_search`, `locator_status`, `locator_rebuild` e `locator_export`; as pessoas têm um **painel global** na Web GUI (`Ctrl+Shift+F` ou a lupa no rodapé da barra lateral).
|
|
32
|
+
|
|
33
|
+
## Por que outro buscador?
|
|
34
|
+
|
|
35
|
+
`glob` e `grep` percorrem o workspace a cada chamada: rápidos quando você sabe o diretório, lentos quando lembra só parte de um nome. O Everything é excelente no Windows, mas só existe no Windows; envolvê-lo deixa macOS, Linux, WSL e hosts remotos de fora. O `dsh-locator` é dono do índice, então as mesmas ferramentas funcionam onde Node e Go rodam.
|
|
36
|
+
|
|
37
|
+
## Instalação
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
# npm (recomendado)
|
|
41
|
+
dsh plugin --profile web add dsh-locator
|
|
42
|
+
|
|
43
|
+
# GitHub main
|
|
44
|
+
dsh plugin --profile web add github:PerryLink/dsh-locator
|
|
45
|
+
|
|
46
|
+
# do código
|
|
47
|
+
pnpm install
|
|
48
|
+
pnpm build
|
|
49
|
+
pnpm build:engine
|
|
50
|
+
dsh plugin --profile web add /caminho/absoluto/dsh-locator
|
|
51
|
+
|
|
52
|
+
# tarball
|
|
53
|
+
npm pack
|
|
54
|
+
dsh plugin --profile web add /caminho/absoluto/dsh-locator-0.5.0.tgz
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
O pacote npm inclui motores pré-compilados para `linux-x64`, `linux-arm64`, `win32-x64`, `win32-arm64`, `darwin-x64` e `darwin-arm64`.
|
|
58
|
+
|
|
59
|
+
Ao instalar num perfil Web já em execução, **recarregue a página** (`F5`): as ferramentas podem montar a quente, mas o painel (`client.js`) vem do boot graph no carregamento. Perfis headless/TUI não montam painel.
|
|
60
|
+
|
|
61
|
+
## Painel web
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
Pressione `Ctrl+Shift+F` em qualquer lugar da Web GUI, ou clique na lupa no rodapé da barra lateral. O painel consulta o mesmo índice por rotas do host na mesma origem (`POST /dsh-locator/search`, `POST /dsh-locator/status`), sem segundo servidor e sem porta extra.
|
|
66
|
+
|
|
67
|
+
* Consulta vazia: entradas recentes por data; ao digitar, debounce de 110 ms e a mesma sintaxe das ferramentas.
|
|
68
|
+
* Clique no cabeçalho para ordenar por nome, tamanho, data ou caminho; outro clique inverte.
|
|
69
|
+
* `Somente arquivos` / `Somente pastas`; o rodapé mostra resultados, limite e tempo.
|
|
70
|
+
* `↑`/`↓` seleciona, `Enter` copia, `Ctrl+O` abre, `Ctrl+Enter` insere `@"caminho"` no compositor, clique duplo revela no gerenciador, `Esc` fecha.
|
|
71
|
+
* A interface segue `navigator.language` (zh/en/es/pt/hi).
|
|
72
|
+
|
|
73
|
+
## Ferramentas
|
|
74
|
+
|
|
75
|
+
| Ferramenta | Uso |
|
|
76
|
+
|---|---|
|
|
77
|
+
| `locator_search` | Consulta com sintaxe estilo Everything. |
|
|
78
|
+
| `locator_status` | Raízes, entradas, watcher, modo USN e erros. |
|
|
79
|
+
| `locator_rebuild` | Reconstrói em segundo plano; buscas continuam no índice antigo. |
|
|
80
|
+
| `locator_export` | Cópia somente leitura em SQLite (`entries(path, name, dir, size, mtime_ms, ext)`). |
|
|
81
|
+
|
|
82
|
+
### Sintaxe de consulta
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
relatorio palavras AND no nome
|
|
86
|
+
"duas palavras" frase literal
|
|
87
|
+
*.go ? curingas
|
|
88
|
+
ext:pdf,docx ext:!tmp por extensão (ou negação)
|
|
89
|
+
path:src subcadeia do caminho completo
|
|
90
|
+
size:>10mb 1kb..2mb tamanho
|
|
91
|
+
dm:today dm:thisweek data de modificação
|
|
92
|
+
folder: file: só pastas / só arquivos
|
|
93
|
+
!tmp negar
|
|
94
|
+
case:1 wholeword:1 maiúsculas / palavra inteira
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Configuração essencial
|
|
98
|
+
|
|
99
|
+
| Chave | Valor |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `roots` | Diretórios indexados; vazio = diretório pessoal. |
|
|
102
|
+
| `excludes` | Globs por nome (`node_modules`, `.git`, …). |
|
|
103
|
+
| `watch` | Ativa notificações do sistema. |
|
|
104
|
+
| `refreshIntervalMs` | Reconstrução periódica quando não há watcher nativo. |
|
|
105
|
+
| `windowsUsn` | Caminho rápido USN/MFT (Windows, administrador; padrão `false`). |
|
|
106
|
+
| `scanWorkers` | Leitores de diretório em paralelo; 0 = CPU. |
|
|
107
|
+
| `stateDir` | Diretório do instantâneo; vazio = cache do sistema. |
|
|
108
|
+
|
|
109
|
+
## Plataformas
|
|
110
|
+
|
|
111
|
+
| Plataforma | Varredura | Atualizações |
|
|
112
|
+
|---|---|---|
|
|
113
|
+
| Linux | varredura paralela | inotify recursivo |
|
|
114
|
+
| Windows | varredura ou USN/MFT (admin) | `ReadDirectoryChangesW`; USN retoma após reinício |
|
|
115
|
+
| macOS | varredura | FSEvents nos binários cgo; kqueue como fallback |
|
|
116
|
+
|
|
117
|
+
No Windows, `scan --usn` grava `usn-state.json` (id do diário, próximo USN, raízes) e `serve --usn` reproduz o diário antes de servir: um arquivo criado com o daemon parado aparece após reiniciar sem reescanear. Diário desatualizado ou removido cai no watcher portátil.
|
|
118
|
+
|
|
119
|
+
## Desempenho
|
|
120
|
+
|
|
121
|
+
- 1,2 M de entradas: consulta a quente 25–35 ms; busca durante a varredura ~2 ms.
|
|
122
|
+
- `C:\Windows` (164.216 entradas) indexado por USN em 7,8 s num runner de CI; consulta 9,6 ms.
|
|
123
|
+
- `locator_export` de 1,24 M de linhas: 477 MB, 6,4 s.
|
|
124
|
+
|
|
125
|
+
## Design
|
|
126
|
+
|
|
127
|
+

|
|
128
|
+
|
|
129
|
+
* **Varredura paralela**: fila limitada e lotes por diretório para o pai existir antes dos filhos.
|
|
130
|
+
* **Memória**: registros de 40 B, nomes numa arena compartilhada, tabela de caminhos aberta; o caminho completo só é reconstruído ao devolver resultados.
|
|
131
|
+
* **Consulta**: termos compilados uma vez, divididos em fragmentos e um heap limitado escolhe `offset+limit`.
|
|
132
|
+
* **Persistência**: arquivo temporário + rename atômico; o instantâneo é a fonte de inicialização.
|
|
133
|
+
* **Protocolo**: NDJSON por stdio; sem porta nem superfície de rede.
|
|
134
|
+
|
|
135
|
+
## Compilar do código
|
|
136
|
+
|
|
137
|
+
Requer Node `^22.19 || >=24.9`, pnpm e Go 1.22+.
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
pnpm install
|
|
141
|
+
pnpm build
|
|
142
|
+
pnpm build:engine:all
|
|
143
|
+
pnpm check
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
O motor Go fica em `engine/`; testes: `cd engine && go test ./...`.
|
|
147
|
+
|
|
148
|
+
## Limites
|
|
149
|
+
|
|
150
|
+
* Só nomes, caminhos, tamanhos e datas: **não indexa conteúdo**. Para conteúdo use `grep`.
|
|
151
|
+
* Não é um driver de sistema de arquivos; cobre apenas as raízes configuradas.
|
|
152
|
+
* inotify usa um descritor por diretório; árvores enormes podem estourar o limite do kernel (há aviso e o instantâneo continua utilizável).
|
|
153
|
+
* Escritas do WSL em `/mnt/c` podem não gerar notificações do Windows; reconstrua essas raízes.
|
|
154
|
+
* macOS: FSEvents nos binários publicados; kqueue (máx. 4.096 diretórios) em builds `CGO_ENABLED=0`. Mudanças de conteúdo dependem da reconstrução periódica.
|
|
155
|
+
|
|
156
|
+
## Segurança e privacidade
|
|
157
|
+
|
|
158
|
+
O índice é local: sem rede, sem telemetria, sem uploads. O instantâneo contém nomes e caminhos; trate-o como dado privado. O plugin nunca modifica, move ou apaga os arquivos indexados.
|
|
159
|
+
|
|
160
|
+
## Licença
|
|
161
|
+
|
|
162
|
+
Apache-2.0.
|