@larkup/vector-stores 0.1.21 → 0.1.23

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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @larkup/vector-stores
2
2
 
3
+ ## 0.1.23
4
+
5
+ ### Patch Changes
6
+
7
+ - 197c629: fix: Docker compatibility, AI agent tool priority, and indexing reliability
8
+
9
+ - Fix yt-dlp "No supported JavaScript runtime" error in Docker by passing --js-runtimes nodejs:node
10
+ - Fix LanceDB "Found field not in schema: metadata" by always serializing metadata column
11
+ - Speed up Marketplace tool installs in Docker with --prefer-offline
12
+ - Enforce RAG-first tool priority: searchKnowledgeBase → webSearch → other tools
13
+ - Instruct AI to use presentMedia for image previews instead of raw markdown (fixes [Image unavailable])
14
+ - Strengthen webSearch tool description to enforce secondary priority
15
+
16
+ ## 0.1.22
17
+
18
+ ### Patch Changes
19
+
20
+ - 08e7029: Fix LanceDB native-module loading in packaged Larkup installations, align marketplace catalog versions with published tools, and make clearing a knowledge base discoverable.
21
+
3
22
  ## 0.1.21
4
23
 
5
24
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@larkup/vector-stores",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,14 +14,14 @@
14
14
  "./chroma": "./src/adapters/chroma.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@lancedb/lancedb": "^0.30.0",
18
- "@pinecone-database/pinecone": "^7.2.0"
17
+ "@lancedb/lancedb": "^0.31.0",
18
+ "@pinecone-database/pinecone": "^8.1.0"
19
19
  },
20
20
  "peerDependencies": {
21
21
  "@larkup/core": ">=0.1.20 <1.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "chromadb": "^1.10.5",
24
+ "chromadb": "^3.5.0",
25
25
  "typescript": "5.7.3"
26
26
  }
27
27
  }
@@ -1,8 +1,25 @@
1
1
  import path from 'node:path';
2
2
  import fs from 'node:fs/promises';
3
- import * as lancedb from '@lancedb/lancedb';
4
3
  import type { QueryHit, VectorRecord, VectorStoreAdapter } from './base';
5
4
 
5
+ type LanceDBModule = typeof import('@lancedb/lancedb');
6
+ type LanceConnection = Awaited<ReturnType<LanceDBModule['connect']>>;
7
+ type LanceTable = Awaited<ReturnType<LanceConnection['openTable']>>;
8
+
9
+ let lancedbModule: LanceDBModule | null = null;
10
+
11
+ /**
12
+ * Keep LanceDB outside Turbopack's server bundle. Its native binding resolves
13
+ * platform-specific optional packages at runtime, and static bundling turns
14
+ * the package name into a non-resolvable hashed external module.
15
+ */
16
+ async function getLanceDB(): Promise<LanceDBModule> {
17
+ if (!lancedbModule) {
18
+ lancedbModule = await import(/* turbopackIgnore: true */ '@lancedb/lancedb');
19
+ }
20
+ return lancedbModule;
21
+ }
22
+
6
23
  /**
7
24
  * LanceDB adapter — embedded/on-disk for local dev, LanceDB Cloud, or an
8
25
  * S3-compatible object store (including Cloudflare R2).
@@ -37,16 +54,17 @@ interface LanceRow extends Record<string, unknown> {
37
54
  }
38
55
 
39
56
  export class LanceDBAdapter implements VectorStoreAdapter {
40
- private conn: lancedb.Connection | null = null;
41
- private table: lancedb.Table | null = null;
57
+ private conn: LanceConnection | null = null;
58
+ private table: LanceTable | null = null;
42
59
  private readonly tableName: string;
43
60
 
44
61
  constructor(private readonly config: LanceConfig) {
45
62
  this.tableName = config.tableName?.trim() || 'documents';
46
63
  }
47
64
 
48
- private async connect(): Promise<lancedb.Connection> {
65
+ private async connect(): Promise<LanceConnection> {
49
66
  if (this.conn) return this.conn;
67
+ const lancedb = await getLanceDB();
50
68
  if (this.config.mode === 'cloud') {
51
69
  if (!this.config.uri || !this.config.apiKey) {
52
70
  throw new Error('LanceDB Cloud requires both a URI and an API key.');
@@ -140,7 +158,7 @@ export class LanceDBAdapter implements VectorStoreAdapter {
140
158
  source: r.source,
141
159
  documentId: r.documentId,
142
160
  chunkIndex: r.chunkIndex,
143
- metadata: r.metadata ? JSON.stringify(r.metadata) : undefined,
161
+ metadata: JSON.stringify(r.metadata ?? {}),
144
162
  };
145
163
  }
146
164
 
@@ -208,7 +226,7 @@ export class LanceDBAdapter implements VectorStoreAdapter {
208
226
 
209
227
  // ── Cloud mode ───────────────────────────────────────────────────────────
210
228
  // to force a real authenticated HTTP round-trip.
211
- let conn: lancedb.Connection;
229
+ let conn: LanceConnection;
212
230
  try {
213
231
  conn = await this.connect();
214
232
  } catch (err: any) {