@wrongstack/tools 0.250.0 → 0.255.0
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/dist/audit.js +590 -48
- package/dist/audit.js.map +1 -1
- package/dist/{background-indexer-DwJsyAB0.d.ts → background-indexer-CJ5JiV5i.d.ts} +0 -8
- package/dist/bash.js +133 -23
- package/dist/bash.js.map +1 -1
- package/dist/builtin.js +710 -517
- package/dist/builtin.js.map +1 -1
- package/dist/codebase-index/index.d.ts +2 -2
- package/dist/codebase-index/index.js +16 -0
- package/dist/codebase-index/index.js.map +1 -1
- package/dist/codebase-index/worker.js +11 -6
- package/dist/codebase-index/worker.js.map +1 -1
- package/dist/exec.js +115 -5
- package/dist/exec.js.map +1 -1
- package/dist/format.js +590 -48
- package/dist/format.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +317 -124
- package/dist/index.js.map +1 -1
- package/dist/install.js +590 -48
- package/dist/install.js.map +1 -1
- package/dist/lint.js +589 -47
- package/dist/lint.js.map +1 -1
- package/dist/pack.js +710 -517
- package/dist/pack.js.map +1 -1
- package/dist/test.d.ts +1 -0
- package/dist/test.js +604 -55
- package/dist/test.js.map +1 -1
- package/dist/typecheck.js +590 -48
- package/dist/typecheck.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as IndexResult, S as Symbol, F as FileMeta, u as SymbolKind, v as SymbolLang, w as SearchResult, x as IndexStats, R as Ref } from '../background-indexer-
|
|
2
|
-
export { C as CircuitOpenError, a as CircuitSnapshot, b as CircuitState, y as FileSymbols, I as IndexCircuitBreaker, c as IndexTimeoutError, z as SCHEMA_VERSION, d as cancelPendingReindexes, e as codebaseIndexStats, f as codebaseIndexTool, g as codebaseSearchTool, h as codebaseStatsTool, i as enqueueReindex, j as getIndexState, k as indexCircuitBreaker, l as isIndexReady, m as isIndexableFile, n as isIndexing, o as onIndexStateChange, r as resetIndexCircuitBreaker, p as runStartupIndex, s as searchCodebaseIndex, q as shutdownCodebaseIndexHost } from '../background-indexer-
|
|
1
|
+
import { t as IndexResult, S as Symbol, F as FileMeta, u as SymbolKind, v as SymbolLang, w as SearchResult, x as IndexStats, R as Ref } from '../background-indexer-CJ5JiV5i.js';
|
|
2
|
+
export { C as CircuitOpenError, a as CircuitSnapshot, b as CircuitState, y as FileSymbols, I as IndexCircuitBreaker, c as IndexTimeoutError, z as SCHEMA_VERSION, d as cancelPendingReindexes, e as codebaseIndexStats, f as codebaseIndexTool, g as codebaseSearchTool, h as codebaseStatsTool, i as enqueueReindex, j as getIndexState, k as indexCircuitBreaker, l as isIndexReady, m as isIndexableFile, n as isIndexing, o as onIndexStateChange, r as resetIndexCircuitBreaker, p as runStartupIndex, s as searchCodebaseIndex, q as shutdownCodebaseIndexHost } from '../background-indexer-CJ5JiV5i.js';
|
|
3
3
|
import { Context } from '@wrongstack/core';
|
|
4
4
|
|
|
5
5
|
interface IndexerOptions {
|
|
@@ -2524,6 +2524,13 @@ function debounceKey(indexDir, file) {
|
|
|
2524
2524
|
function isIndexableFile(filePath) {
|
|
2525
2525
|
return detectLang(filePath) !== null;
|
|
2526
2526
|
}
|
|
2527
|
+
function isUniqueConstraintError(err) {
|
|
2528
|
+
if (err instanceof Error) {
|
|
2529
|
+
const msg = err.message.toLowerCase();
|
|
2530
|
+
return msg.includes("unique constraint") || msg.includes("UNIQUE constraint");
|
|
2531
|
+
}
|
|
2532
|
+
return false;
|
|
2533
|
+
}
|
|
2527
2534
|
async function runStartupIndex(opts) {
|
|
2528
2535
|
if (!indexCircuitBreaker.allowRequest()) throw circuitOpenError();
|
|
2529
2536
|
_indexing = true;
|
|
@@ -2553,6 +2560,15 @@ async function runStartupIndex(opts) {
|
|
|
2553
2560
|
return result;
|
|
2554
2561
|
} catch (err) {
|
|
2555
2562
|
_lastError = err instanceof Error ? err.message : String(err);
|
|
2563
|
+
if (isUniqueConstraintError(err) && !opts.force) {
|
|
2564
|
+
_lastError = null;
|
|
2565
|
+
const rebuildResult = await runStartupIndex({
|
|
2566
|
+
...opts,
|
|
2567
|
+
force: true
|
|
2568
|
+
});
|
|
2569
|
+
_ready = true;
|
|
2570
|
+
return rebuildResult;
|
|
2571
|
+
}
|
|
2556
2572
|
_ready = true;
|
|
2557
2573
|
if (!opts.signal?.aborted) indexCircuitBreaker.recordFailure(err);
|
|
2558
2574
|
throw err;
|