dsh-locator 0.11.4 → 0.11.6
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 +8 -0
- package/README-hi.md +8 -0
- package/README-pt.md +8 -0
- package/README.en.md +8 -0
- package/README.md +8 -0
- package/bin/darwin-arm64/indexd +0 -0
- package/bin/darwin-x64/indexd +0 -0
- package/bin/linux-arm64/indexd +0 -0
- package/bin/linux-x64/indexd +0 -0
- package/bin/win32-arm64/indexd.exe +0 -0
- package/bin/win32-x64/indexd.exe +0 -0
- package/client.js +24 -1
- package/lib/combined.d.ts +3 -1
- package/lib/combined.d.ts.map +1 -1
- package/lib/combined.js +2 -0
- package/lib/combined.js.map +1 -1
- package/lib/content.d.ts +33 -0
- package/lib/content.d.ts.map +1 -1
- package/lib/content.js +66 -0
- package/lib/content.js.map +1 -1
- package/lib/find.d.ts +70 -0
- package/lib/find.d.ts.map +1 -1
- package/lib/find.js +22 -2
- package/lib/find.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tools.d.ts +2 -1
- package/lib/tools.d.ts.map +1 -1
- package/lib/tools.js +9 -9
- package/lib/tools.js.map +1 -1
- package/package.json +1 -1
- package/src/combined.ts +5 -1
- package/src/content.ts +88 -0
- package/src/find.ts +22 -2
- package/src/index.ts +1 -1
- package/src/tools.ts +21 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.11.6 — 2026-11-14
|
|
4
|
+
|
|
5
|
+
* Fix `locator_find` being rejected by host output validation: the declared `state` schema was missing `fullIndex` and `reasoningIndex` (both on `ContentState` since 0.11.3) and the new `progress` field, so every call failed with `invalid output` instead of returning hits. `locator_status` now also returns the content index state (`content`); its schema always declared that object but the implementation never filled it.
|
|
6
|
+
* Both tools now share one content-state output schema, with tests that validate real status snapshots against it.
|
|
7
|
+
* `139 tests`; six engine binaries rebuilt at 0.11.6.
|
|
8
|
+
|
|
9
|
+
## 0.11.5 — 2026-11-14
|
|
10
|
+
|
|
11
|
+
* **Content build progress**: while a build runs, `content.progress` reports the current phase (`files` / `sessions`), scanned entries, the known total and the current path; the HTTP `status` route, `locator_status` and the Web panel (all five client languages) show it, and it disappears when the build finishes or fails. Builds can take minutes on a full index, so `building: true` alone left the panel and the agent blind.
|
|
12
|
+
* `136 tests`; six engine binaries rebuilt at 0.11.5.
|
|
13
|
+
|
|
3
14
|
## 0.11.4 — 2026-11-14
|
|
4
15
|
|
|
5
16
|
* Toggling `contentIndexReasoning` now rebuilds **only session documents**, keeping the 185k-file index intact instead of re-reading every file.
|
package/README-es.md
CHANGED
|
@@ -401,6 +401,14 @@ DeepSeek Harness
|
|
|
401
401
|
|
|
402
402
|
El motor es un único proceso Go y respeta las variables estándar `GOMEMLIMIT` y `GOGC` (o `memoryLimitMB` en la configuración). Un índice de 1,2–1,5 M de entradas alcanza varios cientos de MB de RSS con el GC por defecto; usa `GOMEMLIMIT=600MiB` (límite blando, el runtime cambia CPU por memoria) o `GOGC=50` cuando el host vaya justo de RAM. Ninguno cambia el formato de la instantánea. En la instalación en vivo usada para las cifras anteriores, el proceso anfitrión de DSH (incluida la caché de páginas de la base de contenido) rondaba los 700 MB de RSS con el índice construido, y la latencia del host en reposo se mantenía en p50 2 ms.
|
|
403
403
|
|
|
404
|
+
## Correcciones 0.11.6
|
|
405
|
+
|
|
406
|
+
- Corrige `locator_find`, cuyo `state` declarado no incluía `fullIndex`/`reasoningIndex` (desde 0.11.3) ni `progress`, por lo que el host rechazaba cada llamada con `invalid output`; `locator_status` ahora también devuelve el estado del índice de contenido (`content`). Ambos comparten el mismo schema para evitar que un campo nuevo vuelva a romper uno de ellos.
|
|
407
|
+
|
|
408
|
+
## Notas de actualización 0.11.5
|
|
409
|
+
|
|
410
|
+
- **Progreso de construcción de contenido**: durante la construcción, `locator_status`, la ruta HTTP `status` y el panel informan la fase actual (`files` / `sessions`), las entradas escaneadas, el total conocido y la ruta actual (`content.progress`) en lugar de solo `building: true`; el campo desaparece al terminar o fallar.
|
|
411
|
+
|
|
404
412
|
## Notas de actualización 0.11.0
|
|
405
413
|
|
|
406
414
|
- Cambiar `contentIndexReasoning` reconstruye solo las sesiones (el índice de archivos se conserva); reducir los caps fuerza reconstrucción; `locator_find` acepta `offset`; el panel copia todas las rutas cargadas/filtradas.
|
package/README-hi.md
CHANGED
|
@@ -402,6 +402,14 @@ DeepSeek Harness
|
|
|
402
402
|
|
|
403
403
|
इंजन एक Go प्रोसेस है और मानक `GOMEMLIMIT` और `GOGC` (या कॉन्फ़िग में `memoryLimitMB`) मानता है। 1.2–1.5 M एंट्री का इंडेक्स डिफ़ॉल्ट GC के साथ कई सौ MB RSS तक जाता है; होस्ट पर RAM कम हो तो `GOMEMLIMIT=600MiB` (सॉफ़्ट सीमा, रनटाइम CPU देकर मेमोरी बचाता है) या `GOGC=50` रखें। इनसे स्नैपशॉट फ़ॉर्मेट नहीं बदलता। ऊपर के आँकड़ों वाले लाइव सेटअप में DSH होस्ट प्रोसेस (कंटेंट डेटाबेस पेज कैश सहित) इंडेक्स बने रहने पर लगभग 700 MB RSS पर था, और खाली बैठे होस्ट की देरी p50 2ms रही।
|
|
404
404
|
|
|
405
|
+
## 0.11.6 सुधार
|
|
406
|
+
|
|
407
|
+
- `locator_find` ठीक किया गया: इसके घोषित `state` schema में `fullIndex`/`reasoningIndex` (0.11.3 से मौजूद) और `progress` नहीं थे, इसलिए हर कॉल host validation में `invalid output` से विफल होती थी; `locator_status` अब सामग्री इंडेक्स की स्थिति (`content`) भी लौटाता है। दोनों टूल एक ही state schema साझा करते हैं ताकि नया फ़ील्ड किसी एक को चुपचाप न तोड़े।
|
|
408
|
+
|
|
409
|
+
## 0.11.5 अपग्रेड नोट्स
|
|
410
|
+
|
|
411
|
+
- **सामग्री निर्माण प्रगति**: निर्माण के दौरान `locator_status`, HTTP `status` रूट और Web पैनल वर्तमान चरण (`files` / `sessions`), स्कैन की गई प्रविष्टियाँ, ज्ञात कुल और वर्तमान पथ (`content.progress`) बताते हैं — केवल `building: true` नहीं; निर्माण पूरा होने या विफल होने पर यह फ़ील्ड हट जाती है।
|
|
412
|
+
|
|
405
413
|
## 0.11.0 अपग्रेड नोट्स
|
|
406
414
|
|
|
407
415
|
- `contentIndexReasoning` बदलने पर केवल sessions rebuild होते हैं (फ़ाइल इंडेक्स रहता है); caps छोटा करने पर rebuild होता है; `locator_find` में `offset`; पैनल सभी loaded/filtered paths कॉपी कर सकता है।
|
package/README-pt.md
CHANGED
|
@@ -402,6 +402,14 @@ DeepSeek Harness
|
|
|
402
402
|
|
|
403
403
|
O motor é um único processo Go e respeita as variáveis padrão `GOMEMLIMIT` e `GOGC` (ou `memoryLimitMB` na configuração). Um índice de 1,2–1,5 M de entradas chega a várias centenas de MB de RSS com o GC padrão; use `GOMEMLIMIT=600MiB` (limite suave, o runtime troca CPU por memória) ou `GOGC=50` quando o host estiver apertado de RAM. Nenhum altera o formato do snapshot. Na instalação ao vivo usada para os números acima, o processo anfitrião do DSH (incluindo o cache de páginas do banco de conteúdo) ficava por volta de 700 MB de RSS com o índice construído, e a latência do host ocioso permanecia em p50 2 ms.
|
|
404
404
|
|
|
405
|
+
## Correções 0.11.6
|
|
406
|
+
|
|
407
|
+
- Corrige `locator_find`, cujo `state` declarado não incluía `fullIndex`/`reasoningIndex` (desde 0.11.3) nem `progress`, então o host rejeitava toda chamada com `invalid output`; `locator_status` agora também retorna o estado do índice de conteúdo (`content`). As duas ferramentas compartilham o mesmo schema para evitar que um campo novo volte a quebrar uma delas.
|
|
408
|
+
|
|
409
|
+
## Notas de atualização 0.11.5
|
|
410
|
+
|
|
411
|
+
- **Progresso da construção de conteúdo**: durante a construção, `locator_status`, a rota HTTP `status` e o painel informam a fase atual (`files` / `sessions`), as entradas verificadas, o total conhecido e o caminho atual (`content.progress`) em vez de apenas `building: true`; o campo desaparece quando a construção termina ou falha.
|
|
412
|
+
|
|
405
413
|
## Notas de atualização 0.11.0
|
|
406
414
|
|
|
407
415
|
- Alternar `contentIndexReasoning` reconstrói apenas as sessões (o índice de arquivos é mantido); reduzir os caps força reconstrução; `locator_find` aceita `offset`; o painel copia todos os caminhos carregados/filtrados.
|
package/README.en.md
CHANGED
|
@@ -402,6 +402,14 @@ DeepSeek Harness
|
|
|
402
402
|
|
|
403
403
|
The engine is a single Go process and honours the standard `GOMEMLIMIT` and `GOGC` environment variables (or `memoryLimitMB` in the config). A 1.2–1.5 M-entry index peaks around several hundred MB of RSS with the default GC; set `GOMEMLIMIT=600MiB` (soft limit, the runtime trades CPU for memory) or `GOGC=50` when the host is tight on RAM. Neither changes the snapshot format. In the live setup used for the numbers above, the DSH host process (including the content database page cache) sat around 700 MB RSS with the content index built, and idle host latency stayed at p50 2 ms.
|
|
404
404
|
|
|
405
|
+
## 0.11.6 fixes
|
|
406
|
+
|
|
407
|
+
- Fix `locator_find` failing host output validation: its declared `state` schema was missing `fullIndex`/`reasoningIndex` (present since 0.11.3) and `progress`, so every call ended in `invalid output`; `locator_status` now also returns the content index state (`content`). Both tools share one state schema so a new field cannot silently break one of them.
|
|
408
|
+
|
|
409
|
+
## 0.11.5 upgrade notes
|
|
410
|
+
|
|
411
|
+
- **Content build progress**: while a build runs, `locator_status`, the HTTP `status` route and the Web panel report the current phase (`files` / `sessions`), scanned entries, the known total and the current path (`content.progress`) instead of a bare `building: true`; the field disappears once the build finishes or fails.
|
|
412
|
+
|
|
405
413
|
## 0.11.0 upgrade notes
|
|
406
414
|
|
|
407
415
|
- Toggling `contentIndexReasoning` rebuilds sessions only (the file index is kept); shrinking content caps forces a rebuild so out-of-budget rows cannot stay searchable; `locator_find` accepts `offset`; the panel can copy all loaded/filtered paths.
|
package/README.md
CHANGED
|
@@ -364,6 +364,14 @@ Go 引擎在 `engine/` 下,测试用 `cd engine && go test ./...`。macOS 的
|
|
|
364
364
|
- 当前会话范围只覆盖已落定索引的会话消息(活跃会话约 2 分钟延迟);实时查找用 `Ctrl+F`。会话内查找条只覆盖已加载窗口,更早历史需手动加载。
|
|
365
365
|
- 会话内高亮依赖 CSS Custom Highlight API;不支持它的旧浏览器会退化为整行描边。
|
|
366
366
|
|
|
367
|
+
## 0.11.6 修复
|
|
368
|
+
|
|
369
|
+
- 修复 `locator_find` 输出被宿主判为非法的问题:工具声明的 `state` schema 缺少 `fullIndex`/`reasoningIndex`(0.11.3 起存在)和 `progress`,导致每次调用都以 `invalid output` 失败;`locator_status` 现在也会返回内容索引状态(`content`)。两个工具共用同一份 state schema,避免新字段再次悄悄打破其中一个。
|
|
370
|
+
|
|
371
|
+
## 0.11.5 更新
|
|
372
|
+
|
|
373
|
+
- **内容构建进度**:构建期间 `locator_status`、HTTP `status` 路由和 Web 面板会报告当前阶段(`files` / `sessions`)、已扫描条目数、已知总数和当前路径(`content.progress`),不再只有一个 `building: true`;构建结束或失败后该字段消失。
|
|
374
|
+
|
|
367
375
|
## 0.11.0 升级注意
|
|
368
376
|
|
|
369
377
|
- 切换 `contentIndexReasoning` 只重建会话,不再全量重建 185k 文件;调小内容 cap 会在下次启动重建,避免旧数据继续越预算可搜;`locator_find` 支持 `offset`;面板可一键复制当前已加载/过滤结果的路径。
|
package/bin/darwin-arm64/indexd
CHANGED
|
Binary file
|
package/bin/darwin-x64/indexd
CHANGED
|
Binary file
|
package/bin/linux-arm64/indexd
CHANGED
|
Binary file
|
package/bin/linux-x64/indexd
CHANGED
|
Binary file
|
|
Binary file
|
package/bin/win32-x64/indexd.exe
CHANGED
|
Binary file
|
package/client.js
CHANGED
|
@@ -199,6 +199,7 @@ body[data-ds-dark-theme] .dsh-locator-overlay{background:var(--dsw-alias-bg-mask
|
|
|
199
199
|
asc: 'Ascending', descOrder: 'Descending',
|
|
200
200
|
groupContent: 'Content', groupFiles: 'Files', groupDirs: 'Folders',
|
|
201
201
|
relevance: 'by relevance', contentBuilding: 'indexing… {files} files / {messages} messages',
|
|
202
|
+
contentProgressFiles: 'indexing… {scanned}/{total} files', contentProgressSessions: 'indexing… {scanned}/{total} sessions',
|
|
202
203
|
contentShort: 'Type at least 3 characters to search bodies and sessions (Ctrl+F handles shorter queries)',
|
|
203
204
|
contentDisabled: 'Content index is disabled (contentIndex: false)',
|
|
204
205
|
contentCapped: 'first {n}', showing: 'first {n}', deduped: '{n} name hits merged into content', loading: 'Searching…',
|
|
@@ -248,6 +249,7 @@ contentWarning: 'Index warning: {list}', contentBudget: 'Content index budget re
|
|
|
248
249
|
asc: '升序', descOrder: '降序',
|
|
249
250
|
groupContent: '内容', groupFiles: '文件', groupDirs: '目录',
|
|
250
251
|
relevance: '按相关度', contentBuilding: '索引构建中… {files} 文件 / {messages} 消息',
|
|
252
|
+
contentProgressFiles: '索引构建中… 文件 {scanned}/{total}', contentProgressSessions: '索引构建中… 会话 {scanned}/{total}',
|
|
251
253
|
contentShort: '输入至少 3 个字符后搜索正文与会话(更短的词请用 Ctrl+F)',
|
|
252
254
|
contentDisabled: '内容索引已关闭(contentIndex: false)',
|
|
253
255
|
contentCapped: '前 {n} 条', showing: '前 {n} 条', deduped: '{n} 条文件命中已并入内容', loading: '搜索中…',
|
|
@@ -297,6 +299,7 @@ contentWarning: '索引警告:{list}', contentBudget: '内容索引已达预
|
|
|
297
299
|
asc: 'Ascendente', descOrder: 'Descendente',
|
|
298
300
|
groupContent: 'Contenido', groupFiles: 'Archivos', groupDirs: 'Carpetas',
|
|
299
301
|
relevance: 'por relevancia', contentBuilding: 'indexando… {files} archivos / {messages} mensajes',
|
|
302
|
+
contentProgressFiles: 'indexando… {scanned}/{total} archivos', contentProgressSessions: 'indexando… {scanned}/{total} sesiones',
|
|
300
303
|
contentShort: 'Escribe al menos 3 caracteres para buscar contenido y sesiones (Ctrl+F para consultas cortas)',
|
|
301
304
|
contentDisabled: 'Índice de contenido desactivado (contentIndex: false)',
|
|
302
305
|
contentCapped: 'primeros {n}', showing: 'primeros {n}', deduped: '{n} aciertos de nombre fusionados', loading: 'Buscando…',
|
|
@@ -346,6 +349,7 @@ contentWarning: 'Aviso del índice: {list}', contentBudget: 'Se alcanzó el pres
|
|
|
346
349
|
asc: 'Ascendente', descOrder: 'Descendente',
|
|
347
350
|
groupContent: 'Conteúdo', groupFiles: 'Arquivos', groupDirs: 'Pastas',
|
|
348
351
|
relevance: 'por relevância', contentBuilding: 'indexando… {files} arquivos / {messages} mensagens',
|
|
352
|
+
contentProgressFiles: 'indexando… {scanned}/{total} arquivos', contentProgressSessions: 'indexando… {scanned}/{total} sessões',
|
|
349
353
|
contentShort: 'Digite pelo menos 3 caracteres para buscar conteúdo e sessões (Ctrl+F para consultas curtas)',
|
|
350
354
|
contentDisabled: 'Índice de conteúdo desativado (contentIndex: false)',
|
|
351
355
|
contentCapped: 'primeiros {n}', showing: 'primeiros {n}', deduped: '{n} acertos de nome mesclados', loading: 'Buscando…',
|
|
@@ -395,6 +399,7 @@ contentWarning: 'Aviso do índice: {list}', contentBudget: 'O orçamento do índ
|
|
|
395
399
|
asc: 'आरोही', descOrder: 'अवरोही',
|
|
396
400
|
groupContent: 'सामग्री', groupFiles: 'फ़ाइलें', groupDirs: 'फ़ोल्डर',
|
|
397
401
|
relevance: 'प्रासंगिकता से', contentBuilding: 'इंडेक्स बन रहा है… {files} फ़ाइलें / {messages} संदेश',
|
|
402
|
+
contentProgressFiles: 'इंडेक्स बन रहा है… {scanned}/{total} फ़ाइलें', contentProgressSessions: 'इंडेक्स बन रहा है… {scanned}/{total} सत्र',
|
|
398
403
|
contentShort: 'सामग्री और सत्र खोजने के लिए कम से कम 3 अक्षर लिखें (छोटी खोज के लिए Ctrl+F)',
|
|
399
404
|
contentDisabled: 'सामग्री इंडेक्स बंद है (contentIndex: false)',
|
|
400
405
|
contentCapped: 'पहले {n}', showing: 'पहले {n}', deduped: '{n} नाम-परिणाम सामग्री में मिलाए', loading: 'खोज रहे हैं…',
|
|
@@ -2278,6 +2283,24 @@ self.onmessage = event => {
|
|
|
2278
2283
|
if (code === 'invalid-control-char') return t('contentBadChars')
|
|
2279
2284
|
return code
|
|
2280
2285
|
}
|
|
2286
|
+
// Show the live build counters (phase + scanned/total + current path) when
|
|
2287
|
+
// the host publishes them; fall back to the aggregate counters otherwise.
|
|
2288
|
+
const shortProgressPath = value => {
|
|
2289
|
+
const text = String(value)
|
|
2290
|
+
return text.length <= 48 ? text : '…' + text.slice(-47)
|
|
2291
|
+
}
|
|
2292
|
+
const contentProgressText = () => {
|
|
2293
|
+
const progress = content !== undefined && content.progress ? content.progress : null
|
|
2294
|
+
const aggregate = () => t('contentBuilding', { files: content?.files ?? 0, messages: content?.messages ?? 0 })
|
|
2295
|
+
if (progress === null || typeof progress.scanned !== 'number') return aggregate()
|
|
2296
|
+
const total = typeof progress.total === 'number' && progress.total > 0 ? progress.total.toLocaleString() : ''
|
|
2297
|
+
if (total === '') return aggregate()
|
|
2298
|
+
const text = t(progress.phase === 'sessions' ? 'contentProgressSessions' : 'contentProgressFiles', {
|
|
2299
|
+
scanned: progress.scanned.toLocaleString(),
|
|
2300
|
+
total,
|
|
2301
|
+
})
|
|
2302
|
+
return typeof progress.path === 'string' && progress.path !== '' ? text + ' · ' + shortProgressPath(progress.path) : text
|
|
2303
|
+
}
|
|
2281
2304
|
const renderGroup = (key, label, group, extra) => {
|
|
2282
2305
|
if (!scopes[key] || group === undefined) return null
|
|
2283
2306
|
const hits = Array.isArray(group.hits) ? group.hits : []
|
|
@@ -2289,7 +2312,7 @@ self.onmessage = event => {
|
|
|
2289
2312
|
const budget = key === 'content' && group.truncated === true ? t('contentBudget') : null
|
|
2290
2313
|
const note = key === 'content'
|
|
2291
2314
|
? (matchMode === 'regex' ? t('panelRegexPaused')
|
|
2292
|
-
: contentBuilding ?
|
|
2315
|
+
: contentBuilding ? contentProgressText()
|
|
2293
2316
|
: (content?.capped ? t('contentCapped', { n: count }) : (query.trim() !== '' ? t('relevance') : null)))
|
|
2294
2317
|
: (group.deduped > 0 ? t('deduped', { n: group.deduped }) : (group.truncated ? t('showing', { n: hits.length }) : null))
|
|
2295
2318
|
const combinedNote = [note, warnings, budget].filter(value => value !== null && value !== '').join(' · ')
|
package/lib/combined.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* of a path that appears both as a body hit and a name hit.
|
|
10
10
|
* @module dsh-locator/combined
|
|
11
11
|
*/
|
|
12
|
-
import type { ContentHit, ContentState } from './content.ts';
|
|
12
|
+
import type { ContentHit, ContentProgress, ContentState } from './content.ts';
|
|
13
13
|
import type { ContentCount, ContentCountMode, ContentMatchMode, ContentSearchOptions, ContentSearchResult } from './content-search.ts';
|
|
14
14
|
import type { SearchArgs, SearchHit, SearchResult } from './runtime.ts';
|
|
15
15
|
/** Which groups a combined request asked for; every scope is on by default. */
|
|
@@ -70,6 +70,8 @@ export interface ContentGroup {
|
|
|
70
70
|
sessions: number;
|
|
71
71
|
messages: number;
|
|
72
72
|
truncated: boolean;
|
|
73
|
+
/** Live build progress while `building`; the panel shows the counters. */
|
|
74
|
+
progress?: ContentProgress;
|
|
73
75
|
/** Wall-clock time of the content lookup; 0 when it was skipped. */
|
|
74
76
|
tookMs: number;
|
|
75
77
|
error?: string;
|
package/lib/combined.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combined.d.ts","sourceRoot":"","sources":["../src/combined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"combined.d.ts","sourceRoot":"","sources":["../src/combined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE7E,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACpB,MAAM,qBAAqB,CAAA;AAC5B,OAAO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G;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,eAAe,CAqBtG;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,SAAS,UAAU,EAAE,EAClC,QAAQ,EAAE,SAAS,SAAS,EAAE,GAC7B;IAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAcxC;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAoC/G"}
|
package/lib/combined.js
CHANGED
|
@@ -200,6 +200,7 @@ async function contentGroup(deps, request, ask) {
|
|
|
200
200
|
sessions: state?.sessions ?? 0,
|
|
201
201
|
messages: state?.messages ?? 0,
|
|
202
202
|
truncated: state?.truncated ?? false,
|
|
203
|
+
...(state?.progress === undefined ? {} : { progress: state.progress }),
|
|
203
204
|
tookMs: 0,
|
|
204
205
|
};
|
|
205
206
|
};
|
|
@@ -243,6 +244,7 @@ async function contentGroup(deps, request, ask) {
|
|
|
243
244
|
sessions: state?.sessions ?? 0,
|
|
244
245
|
messages: state?.messages ?? 0,
|
|
245
246
|
truncated: state?.truncated ?? false,
|
|
247
|
+
...(state?.progress === undefined ? {} : { progress: state.progress }),
|
|
246
248
|
tookMs: Date.now() - started,
|
|
247
249
|
...(result.error === undefined ? {} : { error: result.error }),
|
|
248
250
|
};
|
package/lib/combined.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combined.js","sourceRoot":"","sources":["../src/combined.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"combined.js","sourceRoot":"","sources":["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C,KAAc;IAC/B,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;AAClE,CAAC;AAED,SAAS,OAAO,CAAC,KAAc;IAC7B,OAAO,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,MAAM,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;AAC3H,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,OAAO,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC/D,CAAC"}
|
package/lib/content.d.ts
CHANGED
|
@@ -31,6 +31,26 @@ export interface ContentHit {
|
|
|
31
31
|
line?: number;
|
|
32
32
|
score: number;
|
|
33
33
|
}
|
|
34
|
+
/** Which half of the content build a progress record belongs to. */
|
|
35
|
+
export type ContentProgressPhase = 'files' | 'sessions';
|
|
36
|
+
/**
|
|
37
|
+
* Live progress for the content build. It only exists while `building` is
|
|
38
|
+
* true, so the status endpoint, the Web panel and `locator_status` can show
|
|
39
|
+
* what a long first build is doing instead of a bare boolean.
|
|
40
|
+
*/
|
|
41
|
+
export interface ContentProgress {
|
|
42
|
+
phase: ContentProgressPhase;
|
|
43
|
+
/** Entries examined: engine entries for files, session logs for sessions. */
|
|
44
|
+
scanned: number;
|
|
45
|
+
/** Entries stored by this phase: indexed files or indexed session logs. */
|
|
46
|
+
indexed: number;
|
|
47
|
+
/** Known total for this phase; absent when it is not known yet. */
|
|
48
|
+
total?: number;
|
|
49
|
+
/** Most recently examined path, for a live "current item" hint. */
|
|
50
|
+
path?: string;
|
|
51
|
+
/** Epoch milliseconds when this phase started. */
|
|
52
|
+
startedAt: number;
|
|
53
|
+
}
|
|
34
54
|
export interface ContentState {
|
|
35
55
|
building: boolean;
|
|
36
56
|
files: number;
|
|
@@ -44,6 +64,8 @@ export interface ContentState {
|
|
|
44
64
|
*/
|
|
45
65
|
warnings: string[];
|
|
46
66
|
updatedAt: number;
|
|
67
|
+
/** Live build progress; absent when no build is running. */
|
|
68
|
+
progress?: ContentProgress;
|
|
47
69
|
/** Both numeric content caps are explicitly unlimited. */
|
|
48
70
|
fullIndex?: boolean;
|
|
49
71
|
/** Assistant reasoning/thinking blocks are included in session docs. */
|
|
@@ -97,6 +119,7 @@ export declare class ContentIndex {
|
|
|
97
119
|
private readonly lockToken;
|
|
98
120
|
private workerSeq;
|
|
99
121
|
private pendingStart;
|
|
122
|
+
private progress;
|
|
100
123
|
private dbIdentity;
|
|
101
124
|
/** Session id → indexed session log path, for session-scoped content search. */
|
|
102
125
|
private readonly sessionPaths;
|
|
@@ -198,6 +221,16 @@ export declare class ContentIndex {
|
|
|
198
221
|
private breathe;
|
|
199
222
|
/** True when a session log has been quiet long enough to be read safely. */
|
|
200
223
|
private settled;
|
|
224
|
+
/** Start one build phase; `total` becomes the progress denominator when known. */
|
|
225
|
+
private beginPhase;
|
|
226
|
+
/** Forget live progress once a build finishes, fails or is abandoned. */
|
|
227
|
+
private clearProgress;
|
|
228
|
+
/** Count one examined entry and keep its path for the "current item" hint. */
|
|
229
|
+
private scanEntry;
|
|
230
|
+
/** Count one entry that produced a stored row. */
|
|
231
|
+
private countIndexed;
|
|
232
|
+
/** Total engine entries, used as the files-phase progress denominator. */
|
|
233
|
+
private engineEntries;
|
|
201
234
|
private finish;
|
|
202
235
|
/**
|
|
203
236
|
* Rebuild the session id → session log path map from the persisted sources.
|
package/lib/content.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../src/content.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAYH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AA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EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAC3D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;YAMzF,cAAc;IAiB5B,8EAA8E;YAChE,cAAc;IAkC5B,mEAAmE;IACnE,OAAO,CAAC,cAAc;IAQtB;;;;OAIG;IACH,OAAO,CAAC,UAAU;CAYnB"}
|
package/lib/content.js
CHANGED
|
@@ -61,6 +61,7 @@ export class ContentIndex {
|
|
|
61
61
|
lockToken = randomUUID();
|
|
62
62
|
workerSeq = 0;
|
|
63
63
|
pendingStart = false;
|
|
64
|
+
progress = null;
|
|
64
65
|
dbIdentity = null;
|
|
65
66
|
/** Session id → indexed session log path, for session-scoped content search. */
|
|
66
67
|
sessionPaths = new Map();
|
|
@@ -72,10 +73,12 @@ export class ContentIndex {
|
|
|
72
73
|
status() {
|
|
73
74
|
if (this.db !== null && !this.state.building && !this.databaseIsCurrent())
|
|
74
75
|
this.recoverExternal();
|
|
76
|
+
const progress = this.progress;
|
|
75
77
|
return {
|
|
76
78
|
...this.state,
|
|
77
79
|
warnings: [...this.state.warnings],
|
|
78
80
|
building: this.state.building || this.pendingStart,
|
|
81
|
+
...(progress === null ? {} : { progress: { ...progress } }),
|
|
79
82
|
fullIndex: this.options.maxTotalBytes === 0 && this.options.maxFiles === 0,
|
|
80
83
|
reasoningIndex: this.options.includeReasoning === true,
|
|
81
84
|
};
|
|
@@ -117,6 +120,7 @@ export class ContentIndex {
|
|
|
117
120
|
this.stopWorker();
|
|
118
121
|
this.releaseLock();
|
|
119
122
|
this.pendingStart = false;
|
|
123
|
+
this.progress = null;
|
|
120
124
|
this.dbIdentity = null;
|
|
121
125
|
this.sessionPaths.clear();
|
|
122
126
|
}
|
|
@@ -210,12 +214,14 @@ export class ContentIndex {
|
|
|
210
214
|
this.state.error = '';
|
|
211
215
|
this.state.truncated = false;
|
|
212
216
|
this.state.warnings = [];
|
|
217
|
+
this.progress = null;
|
|
213
218
|
const run = mode === 'full' ? this.full(generation) : this.incremental(generation);
|
|
214
219
|
void run.catch(error => {
|
|
215
220
|
if (generation !== this.generation)
|
|
216
221
|
return;
|
|
217
222
|
this.state.error = messageOf(error);
|
|
218
223
|
this.state.building = false;
|
|
224
|
+
this.progress = null;
|
|
219
225
|
}).finally(() => {
|
|
220
226
|
this.releaseLock();
|
|
221
227
|
});
|
|
@@ -557,6 +563,7 @@ export class ContentIndex {
|
|
|
557
563
|
this.state.files = 0;
|
|
558
564
|
this.state.sessions = 0;
|
|
559
565
|
this.state.messages = 0;
|
|
566
|
+
this.progress = null;
|
|
560
567
|
this.boot();
|
|
561
568
|
}
|
|
562
569
|
/** Whether the engine is re-scanning, which can move its dump cursor. */
|
|
@@ -626,7 +633,46 @@ export class ContentIndex {
|
|
|
626
633
|
const delay = this.options.activeSessionDelayMs ?? 0;
|
|
627
634
|
return delay <= 0 || Date.now() - mtime >= delay;
|
|
628
635
|
}
|
|
636
|
+
/** Start one build phase; `total` becomes the progress denominator when known. */
|
|
637
|
+
beginPhase(phase, total) {
|
|
638
|
+
this.progress = { phase, scanned: 0, indexed: 0, startedAt: Date.now(), ...(total === undefined ? {} : { total }) };
|
|
639
|
+
}
|
|
640
|
+
/** Forget live progress once a build finishes, fails or is abandoned. */
|
|
641
|
+
clearProgress() {
|
|
642
|
+
this.progress = null;
|
|
643
|
+
}
|
|
644
|
+
/** Count one examined entry and keep its path for the "current item" hint. */
|
|
645
|
+
scanEntry(path) {
|
|
646
|
+
const progress = this.progress;
|
|
647
|
+
if (progress === null)
|
|
648
|
+
return;
|
|
649
|
+
progress.scanned++;
|
|
650
|
+
progress.path = path;
|
|
651
|
+
}
|
|
652
|
+
/** Count one entry that produced a stored row. */
|
|
653
|
+
countIndexed(amount = 1) {
|
|
654
|
+
if (this.progress !== null)
|
|
655
|
+
this.progress.indexed += amount;
|
|
656
|
+
}
|
|
657
|
+
/** Total engine entries, used as the files-phase progress denominator. */
|
|
658
|
+
async engineEntries() {
|
|
659
|
+
const cached = this.rt.status?.engine?.entries;
|
|
660
|
+
if (typeof cached === 'number' && cached > 0)
|
|
661
|
+
return cached;
|
|
662
|
+
const engineStatus = this.rt.engineStatus;
|
|
663
|
+
if (typeof engineStatus !== 'function')
|
|
664
|
+
return undefined;
|
|
665
|
+
try {
|
|
666
|
+
const status = await engineStatus.call(this.rt);
|
|
667
|
+
const entries = status?.entries;
|
|
668
|
+
return typeof entries === 'number' && entries > 0 ? entries : undefined;
|
|
669
|
+
}
|
|
670
|
+
catch {
|
|
671
|
+
return undefined;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
629
674
|
finish() {
|
|
675
|
+
this.clearProgress();
|
|
630
676
|
const counts = this.db.prepare("SELECT kind, COUNT(*) AS n FROM docs_meta GROUP BY kind").all();
|
|
631
677
|
this.state.files = Number(counts.find(row => row.kind === 'file')?.n ?? 0);
|
|
632
678
|
this.state.messages = Number(counts.find(row => row.kind === 'session')?.n ?? 0);
|
|
@@ -713,6 +759,10 @@ export class ContentIndex {
|
|
|
713
759
|
let seen = 0;
|
|
714
760
|
let scanned = 0;
|
|
715
761
|
let capped = false;
|
|
762
|
+
const total = await this.engineEntries();
|
|
763
|
+
if (generation !== this.generation)
|
|
764
|
+
return;
|
|
765
|
+
this.beginPhase('files', total);
|
|
716
766
|
for (;;) {
|
|
717
767
|
if (generation !== this.generation)
|
|
718
768
|
return;
|
|
@@ -724,6 +774,7 @@ export class ContentIndex {
|
|
|
724
774
|
await this.breathe();
|
|
725
775
|
if (generation !== this.generation)
|
|
726
776
|
return;
|
|
777
|
+
this.scanEntry(entry.path);
|
|
727
778
|
if (entry.dir || entry.size <= 0 || entry.size > this.options.maxFileBytes)
|
|
728
779
|
continue;
|
|
729
780
|
if (!TEXT_EXTENSIONS.has(extname(entry.name).toLowerCase()) || contentSkipPath(entry.path, this.options.excludes ?? []))
|
|
@@ -738,6 +789,7 @@ export class ContentIndex {
|
|
|
738
789
|
seen++;
|
|
739
790
|
if (!this.addDoc(row))
|
|
740
791
|
return;
|
|
792
|
+
this.countIndexed();
|
|
741
793
|
await this.breathe();
|
|
742
794
|
}
|
|
743
795
|
if (capped) {
|
|
@@ -763,6 +815,10 @@ export class ContentIndex {
|
|
|
763
815
|
let indexed = 0;
|
|
764
816
|
let scanned = 0;
|
|
765
817
|
let capped = false;
|
|
818
|
+
const total = await this.engineEntries();
|
|
819
|
+
if (generation !== this.generation)
|
|
820
|
+
return;
|
|
821
|
+
this.beginPhase('files', total);
|
|
766
822
|
for (;;) {
|
|
767
823
|
if (generation !== this.generation)
|
|
768
824
|
return;
|
|
@@ -774,6 +830,7 @@ export class ContentIndex {
|
|
|
774
830
|
await this.breathe();
|
|
775
831
|
if (generation !== this.generation)
|
|
776
832
|
return;
|
|
833
|
+
this.scanEntry(entry.path);
|
|
777
834
|
if (entry.dir || entry.size <= 0 || entry.size > this.options.maxFileBytes)
|
|
778
835
|
continue;
|
|
779
836
|
if (!TEXT_EXTENSIONS.has(extname(entry.name).toLowerCase()) || contentSkipPath(entry.path, this.options.excludes ?? []))
|
|
@@ -787,6 +844,7 @@ export class ContentIndex {
|
|
|
787
844
|
if (meta.get(key) === entry.mtime) {
|
|
788
845
|
// Unchanged and already stored: it still occupies one of the slots.
|
|
789
846
|
indexed++;
|
|
847
|
+
this.countIndexed();
|
|
790
848
|
continue;
|
|
791
849
|
}
|
|
792
850
|
if (this.wouldExceed(entry.size, key)) {
|
|
@@ -803,6 +861,7 @@ export class ContentIndex {
|
|
|
803
861
|
continue;
|
|
804
862
|
}
|
|
805
863
|
indexed++;
|
|
864
|
+
this.countIndexed();
|
|
806
865
|
await this.breathe();
|
|
807
866
|
}
|
|
808
867
|
if (capped) {
|
|
@@ -832,6 +891,7 @@ export class ContentIndex {
|
|
|
832
891
|
this.state.truncated = true;
|
|
833
892
|
continue;
|
|
834
893
|
}
|
|
894
|
+
this.countIndexed();
|
|
835
895
|
await this.breathe();
|
|
836
896
|
}
|
|
837
897
|
}
|
|
@@ -858,9 +918,11 @@ export class ContentIndex {
|
|
|
858
918
|
}
|
|
859
919
|
async indexSessions(generation) {
|
|
860
920
|
const files = (await this.sessionCandidates()).filter(file => this.settled(file.mtime));
|
|
921
|
+
this.beginPhase('sessions', files.length);
|
|
861
922
|
for (const file of files) {
|
|
862
923
|
if (generation !== this.generation)
|
|
863
924
|
return;
|
|
925
|
+
this.scanEntry(file.path);
|
|
864
926
|
const read = await this.readSessionText(file);
|
|
865
927
|
if (!read.ok) {
|
|
866
928
|
// A log that cannot be read or decompressed does not contribute rows;
|
|
@@ -872,6 +934,7 @@ export class ContentIndex {
|
|
|
872
934
|
if (!(await this.indexSessionText(file, read.text, generation)))
|
|
873
935
|
return;
|
|
874
936
|
this.db.prepare('INSERT OR REPLACE INTO sources (path, mtime) VALUES (?, ?)').run(file.path, file.mtime);
|
|
937
|
+
this.countIndexed();
|
|
875
938
|
await this.breathe();
|
|
876
939
|
}
|
|
877
940
|
}
|
|
@@ -880,10 +943,12 @@ export class ContentIndex {
|
|
|
880
943
|
for (const row of this.db.prepare('SELECT path, mtime FROM sources').all())
|
|
881
944
|
known.set(row.path, row.mtime);
|
|
882
945
|
const files = await this.sessionCandidates();
|
|
946
|
+
this.beginPhase('sessions', files.length);
|
|
883
947
|
const present = new Set();
|
|
884
948
|
for (const file of files) {
|
|
885
949
|
if (generation !== this.generation)
|
|
886
950
|
return;
|
|
951
|
+
this.scanEntry(file.path);
|
|
887
952
|
present.add(file.path);
|
|
888
953
|
// The session being written right now is left for a later refresh: keep
|
|
889
954
|
// its existing rows instead of re-reading the whole growing log.
|
|
@@ -903,6 +968,7 @@ export class ContentIndex {
|
|
|
903
968
|
if (!(await this.indexSessionText(file, read.text, generation)))
|
|
904
969
|
return;
|
|
905
970
|
this.db.prepare('INSERT OR REPLACE INTO sources (path, mtime) VALUES (?, ?)').run(file.path, file.mtime);
|
|
971
|
+
this.countIndexed();
|
|
906
972
|
await this.breathe();
|
|
907
973
|
}
|
|
908
974
|
for (const path of known.keys()) {
|