@mastra/libsql 0.11.1 → 0.11.3-alpha.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.
@@ -1,23 +1,23 @@
1
1
 
2
- > @mastra/libsql@0.11.1-alpha.0 build /home/runner/work/mastra/mastra/stores/libsql
2
+ > @mastra/libsql@0.11.3-alpha.0 build /home/runner/work/mastra/mastra/stores/libsql
3
3
  > tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
4
4
 
5
5
  CLI Building entry: src/index.ts
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI tsup v8.5.0
8
8
  TSC Build start
9
- TSC ⚡️ Build success in 10971ms
9
+ TSC ⚡️ Build success in 11053ms
10
10
  DTS Build start
11
11
  CLI Target: es2022
12
12
  Analysis will use the bundled TypeScript version 5.8.3
13
13
  Writing package typings: /home/runner/work/mastra/mastra/stores/libsql/dist/_tsup-dts-rollup.d.ts
14
14
  Analysis will use the bundled TypeScript version 5.8.3
15
15
  Writing package typings: /home/runner/work/mastra/mastra/stores/libsql/dist/_tsup-dts-rollup.d.cts
16
- DTS ⚡️ Build success in 12716ms
16
+ DTS ⚡️ Build success in 13286ms
17
17
  CLI Cleaning output folder
18
18
  ESM Build start
19
19
  CJS Build start
20
- ESM dist/index.js 87.14 KB
21
- ESM ⚡️ Build success in 2383ms
22
- CJS dist/index.cjs 88.20 KB
23
- CJS ⚡️ Build success in 2384ms
20
+ ESM dist/index.js 87.24 KB
21
+ ESM ⚡️ Build success in 2074ms
22
+ CJS dist/index.cjs 88.29 KB
23
+ CJS ⚡️ Build success in 2072ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @mastra/libsql
2
2
 
3
+ ## 0.11.3-alpha.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 24ac5ff: dependencies updates:
8
+ - Updated dependency [`@libsql/client@^0.15.10` ↗︎](https://www.npmjs.com/package/@libsql/client/v/0.15.10) (from `^0.15.9`, in `dependencies`)
9
+ - a3ca14c: `LibSQLVector.doUpsert`: check if transaction is open before attempting rollback
10
+ - Updated dependencies [510e2c8]
11
+ - Updated dependencies [2f72fb2]
12
+ - Updated dependencies [3f89307]
13
+ - Updated dependencies [9eda7d4]
14
+ - Updated dependencies [9d49408]
15
+ - Updated dependencies [2ecf658]
16
+ - Updated dependencies [7a7754f]
17
+ - Updated dependencies [fc92d80]
18
+ - Updated dependencies [23a6a7c]
19
+ - Updated dependencies [09bca64]
20
+ - @mastra/core@0.12.0-alpha.0
21
+
22
+ ## 0.11.2
23
+
24
+ ### Patch Changes
25
+
26
+ - 3cc50c7: Update mastra core peer dep version
27
+ - ce088f5: Update all peerdeps to latest core
28
+ - @mastra/core@0.11.1
29
+
3
30
  ## 0.11.1
4
31
 
5
32
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -652,7 +652,7 @@ var LibSQLVector = class extends vector.MastraVector {
652
652
  await tx.commit();
653
653
  return vectorIds;
654
654
  } catch (error) {
655
- await tx.rollback();
655
+ !tx.closed && await tx.rollback();
656
656
  if (error instanceof Error && error.message?.includes("dimensions are different")) {
657
657
  const match = error.message.match(/dimensions are different: (\d+) != (\d+)/);
658
658
  if (match) {
@@ -2416,7 +2416,10 @@ var LibSQLStore = class extends storage.MastraStorage {
2416
2416
  if (config.url.endsWith(":memory:")) {
2417
2417
  this.shouldCacheInit = false;
2418
2418
  }
2419
- this.client = client.createClient({ url: config.url });
2419
+ this.client = client.createClient({
2420
+ url: config.url,
2421
+ ...config.authToken ? { authToken: config.authToken } : {}
2422
+ });
2420
2423
  if (config.url.startsWith("file:") || config.url.includes(":memory:")) {
2421
2424
  this.client.execute("PRAGMA journal_mode=WAL;").then(() => this.logger.debug("LibSQLStore: PRAGMA journal_mode=WAL set.")).catch((err) => this.logger.warn("LibSQLStore: Failed to set PRAGMA journal_mode=WAL.", err));
2422
2425
  this.client.execute("PRAGMA busy_timeout = 5000;").then(() => this.logger.debug("LibSQLStore: PRAGMA busy_timeout=5000 set.")).catch((err) => this.logger.warn("LibSQLStore: Failed to set PRAGMA busy_timeout.", err));
package/dist/index.js CHANGED
@@ -650,7 +650,7 @@ var LibSQLVector = class extends MastraVector {
650
650
  await tx.commit();
651
651
  return vectorIds;
652
652
  } catch (error) {
653
- await tx.rollback();
653
+ !tx.closed && await tx.rollback();
654
654
  if (error instanceof Error && error.message?.includes("dimensions are different")) {
655
655
  const match = error.message.match(/dimensions are different: (\d+) != (\d+)/);
656
656
  if (match) {
@@ -2414,7 +2414,10 @@ var LibSQLStore = class extends MastraStorage {
2414
2414
  if (config.url.endsWith(":memory:")) {
2415
2415
  this.shouldCacheInit = false;
2416
2416
  }
2417
- this.client = createClient({ url: config.url });
2417
+ this.client = createClient({
2418
+ url: config.url,
2419
+ ...config.authToken ? { authToken: config.authToken } : {}
2420
+ });
2418
2421
  if (config.url.startsWith("file:") || config.url.includes(":memory:")) {
2419
2422
  this.client.execute("PRAGMA journal_mode=WAL;").then(() => this.logger.debug("LibSQLStore: PRAGMA journal_mode=WAL set.")).catch((err) => this.logger.warn("LibSQLStore: Failed to set PRAGMA journal_mode=WAL.", err));
2420
2423
  this.client.execute("PRAGMA busy_timeout = 5000;").then(() => this.logger.debug("LibSQLStore: PRAGMA busy_timeout=5000 set.")).catch((err) => this.logger.warn("LibSQLStore: Failed to set PRAGMA busy_timeout.", err));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/libsql",
3
- "version": "0.11.1",
3
+ "version": "0.11.3-alpha.0",
4
4
  "description": "Libsql provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@libsql/client": "^0.15.9"
23
+ "@libsql/client": "^0.15.10"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@microsoft/api-extractor": "^7.52.8",
@@ -29,12 +29,12 @@
29
29
  "tsup": "^8.5.0",
30
30
  "typescript": "^5.8.3",
31
31
  "vitest": "^3.2.4",
32
- "@internal/lint": "0.0.21",
33
- "@internal/storage-test-utils": "0.0.17",
34
- "@mastra/core": "0.11.0"
32
+ "@internal/lint": "0.0.23",
33
+ "@internal/storage-test-utils": "0.0.19",
34
+ "@mastra/core": "0.12.0-alpha.0"
35
35
  },
36
36
  "peerDependencies": {
37
- "@mastra/core": ">=0.10.7-0 <0.11.0-0"
37
+ "@mastra/core": ">=0.10.7-0 <0.12.0-0"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -69,7 +69,10 @@ export class LibSQLStore extends MastraStorage {
69
69
  this.shouldCacheInit = false;
70
70
  }
71
71
 
72
- this.client = createClient({ url: config.url });
72
+ this.client = createClient({
73
+ url: config.url,
74
+ ...(config.authToken ? { authToken: config.authToken } : {}),
75
+ });
73
76
 
74
77
  // Set PRAGMAs for better concurrency, especially for file-based databases
75
78
  if (config.url.startsWith('file:') || config.url.includes(':memory:')) {
@@ -232,7 +232,7 @@ export class LibSQLVector extends MastraVector<LibSQLVectorFilter> {
232
232
  await tx.commit();
233
233
  return vectorIds;
234
234
  } catch (error) {
235
- await tx.rollback();
235
+ !tx.closed && (await tx.rollback());
236
236
  if (error instanceof Error && error.message?.includes('dimensions are different')) {
237
237
  const match = error.message.match(/dimensions are different: (\d+) != (\d+)/);
238
238
  if (match) {