@remit/search-index-worker 0.0.25 → 0.0.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/search-index-worker",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "exports": {
@@ -0,0 +1,30 @@
1
+ import { formatIndexProvenance } from "@remit/search-service";
2
+ import { buildEmbeddingServiceFromEnv } from "@remit/search-service/from-env";
3
+ import { readSqliteIndexProvenance } from "@remit/search-service/sqlite-vec";
4
+
5
+ /**
6
+ * `remit check-index` (#455): which embedder wrote the vectors that are in the
7
+ * index, counted against the one this deployment is configured with.
8
+ *
9
+ * An alternate entrypoint in the search-index-worker image — the same shape the
10
+ * backend's `migrate.mjs` has — rather than an image or a service of its own. It
11
+ * belongs in this image because this is where the configured embedder resolves:
12
+ * the weight precision is part of the embedding identity and is set in this
13
+ * image, so the same environment read from any other container names a model
14
+ * that never wrote a vector here.
15
+ *
16
+ * Reads the vector store and writes nothing.
17
+ */
18
+ const path = process.env.LOCAL_VECTORDB_PATH;
19
+ if (!path) {
20
+ process.stderr.write(
21
+ "LOCAL_VECTORDB_PATH is unset, so this deployment keeps no vector index on disk and there is nothing to report.\n",
22
+ );
23
+ process.exit(1);
24
+ }
25
+
26
+ const report = await readSqliteIndexProvenance({
27
+ path,
28
+ configuredEmbeddingId: buildEmbeddingServiceFromEnv().embeddingId,
29
+ });
30
+ process.stdout.write(formatIndexProvenance(report));