@mastra/lance 0.0.0-workflow-deno-20250616132510 → 0.0.0-working-memory-per-user-20250620163010

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,20 +1,50 @@
1
1
  # @mastra/lance
2
2
 
3
- ## 0.0.0-workflow-deno-20250616132510
3
+ ## 0.0.0-working-memory-per-user-20250620163010
4
+
5
+ ### Patch Changes
6
+
7
+ - d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
8
+ - 2097952: [MASTRA-4021] Fix PG getMessages and update messageLimit for all storage adapters
9
+ - Updated dependencies [df82a7b]
10
+ - Updated dependencies [d8f2d19]
11
+ - Updated dependencies [9d52b17]
12
+ - Updated dependencies [2097952]
13
+ - Updated dependencies [8ba1b51]
14
+ - @mastra/core@0.0.0-working-memory-per-user-20250620163010
15
+
16
+ ## 0.1.3-alpha.0
17
+
18
+ ### Patch Changes
19
+
20
+ - d8f2d19: Add updateMessages API to storage classes (only support for PG and LibSQL for now) and to memory class. Additionally allow for metadata to be saved in the content field of a message.
21
+ - Updated dependencies [d8f2d19]
22
+ - Updated dependencies [9d52b17]
23
+ - Updated dependencies [8ba1b51]
24
+ - @mastra/core@0.10.7-alpha.0
25
+
26
+ ## 0.1.2
4
27
 
5
28
  ### Patch Changes
6
29
 
7
30
  - 63f6b7d: dependencies updates:
8
31
  - Updated dependency [`@lancedb/lancedb@^0.18.2` ↗︎](https://www.npmjs.com/package/@lancedb/lancedb/v/0.18.2) (from `^0.18.1`, in `dependencies`)
9
32
  - Updated dependencies [63f6b7d]
33
+ - Updated dependencies [12a95fc]
34
+ - Updated dependencies [4b0f8a6]
35
+ - Updated dependencies [51264a5]
36
+ - Updated dependencies [8e6f677]
37
+ - Updated dependencies [d70c420]
10
38
  - Updated dependencies [ee9af57]
11
39
  - Updated dependencies [36f1c36]
40
+ - Updated dependencies [2a16996]
12
41
  - Updated dependencies [10d352e]
13
- - Updated dependencies [b0c32de]
42
+ - Updated dependencies [9589624]
14
43
  - Updated dependencies [53d3c37]
44
+ - Updated dependencies [751c894]
15
45
  - Updated dependencies [577ce3a]
16
46
  - Updated dependencies [9260b3a]
17
- - @mastra/core@0.0.0-workflow-deno-20250616132510
47
+ - @mastra/core@0.10.6
18
48
 
19
49
  ## 0.1.2-alpha.0
20
50
 
@@ -10,6 +10,7 @@ import type { DescribeIndexParams } from '@mastra/core';
10
10
  import type { EvalRow } from '@mastra/core/storage';
11
11
  import type { IndexStats } from '@mastra/core';
12
12
  import { LogicalOperator } from '@mastra/core/vector/filter';
13
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
13
14
  import type { MastraMessageV1 } from '@mastra/core/memory';
14
15
  import type { MastraMessageV2 } from '@mastra/core/memory';
15
16
  import { MastraStorage } from '@mastra/core/storage';
@@ -309,6 +310,15 @@ declare class LanceStorage extends MastraStorage {
309
310
  getMessagesPaginated(_args: StorageGetMessagesArg): Promise<PaginationInfo & {
310
311
  messages: MastraMessageV1[] | MastraMessageV2[];
311
312
  }>;
313
+ updateMessages(_args: {
314
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
315
+ id: string;
316
+ content?: {
317
+ metadata?: MastraMessageContentV2['metadata'];
318
+ content?: MastraMessageContentV2['content'];
319
+ };
320
+ }[];
321
+ }): Promise<MastraMessageV2[]>;
312
322
  }
313
323
  export { LanceStorage }
314
324
  export { LanceStorage as LanceStorage_alias_1 }
@@ -10,6 +10,7 @@ import type { DescribeIndexParams } from '@mastra/core';
10
10
  import type { EvalRow } from '@mastra/core/storage';
11
11
  import type { IndexStats } from '@mastra/core';
12
12
  import { LogicalOperator } from '@mastra/core/vector/filter';
13
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
13
14
  import type { MastraMessageV1 } from '@mastra/core/memory';
14
15
  import type { MastraMessageV2 } from '@mastra/core/memory';
15
16
  import { MastraStorage } from '@mastra/core/storage';
@@ -309,6 +310,15 @@ declare class LanceStorage extends MastraStorage {
309
310
  getMessagesPaginated(_args: StorageGetMessagesArg): Promise<PaginationInfo & {
310
311
  messages: MastraMessageV1[] | MastraMessageV2[];
311
312
  }>;
313
+ updateMessages(_args: {
314
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> & {
315
+ id: string;
316
+ content?: {
317
+ metadata?: MastraMessageContentV2['metadata'];
318
+ content?: MastraMessageContentV2['content'];
319
+ };
320
+ }[];
321
+ }): Promise<MastraMessageV2[]>;
312
322
  }
313
323
  export { LanceStorage }
314
324
  export { LanceStorage as LanceStorage_alias_1 }
package/dist/index.cjs CHANGED
@@ -455,6 +455,7 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
455
455
  if (threadConfig) {
456
456
  throw new Error("ThreadConfig is not supported by LanceDB storage");
457
457
  }
458
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: Number.MAX_SAFE_INTEGER });
458
459
  const table = await this.lanceClient.openTable(storage.TABLE_MESSAGES);
459
460
  let query = table.query().where(`\`threadId\` = '${threadId}'`);
460
461
  if (selectBy) {
@@ -473,8 +474,8 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
473
474
  if (selectBy?.include && selectBy.include.length > 0) {
474
475
  records = this.processMessagesWithContext(records, selectBy.include);
475
476
  }
476
- if (selectBy?.last !== void 0 && selectBy.last !== false) {
477
- records = records.slice(-selectBy.last);
477
+ if (limit !== Number.MAX_SAFE_INTEGER) {
478
+ records = records.slice(-limit);
478
479
  }
479
480
  const messages = this.processResultWithTypeConversion(records, await this.getTableSchema(storage.TABLE_MESSAGES));
480
481
  const normalized = messages.map((msg) => ({
@@ -753,6 +754,10 @@ var LanceStorage = class _LanceStorage extends storage.MastraStorage {
753
754
  async getMessagesPaginated(_args) {
754
755
  throw new Error("Method not implemented.");
755
756
  }
757
+ async updateMessages(_args) {
758
+ this.logger.error("updateMessages is not yet implemented in LanceStore");
759
+ throw new Error("Method not implemented");
760
+ }
756
761
  };
757
762
  var LanceFilterTranslator = class extends filter.BaseFilterTranslator {
758
763
  translate(filter) {
package/dist/index.js CHANGED
@@ -453,6 +453,7 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
453
453
  if (threadConfig) {
454
454
  throw new Error("ThreadConfig is not supported by LanceDB storage");
455
455
  }
456
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: Number.MAX_SAFE_INTEGER });
456
457
  const table = await this.lanceClient.openTable(TABLE_MESSAGES);
457
458
  let query = table.query().where(`\`threadId\` = '${threadId}'`);
458
459
  if (selectBy) {
@@ -471,8 +472,8 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
471
472
  if (selectBy?.include && selectBy.include.length > 0) {
472
473
  records = this.processMessagesWithContext(records, selectBy.include);
473
474
  }
474
- if (selectBy?.last !== void 0 && selectBy.last !== false) {
475
- records = records.slice(-selectBy.last);
475
+ if (limit !== Number.MAX_SAFE_INTEGER) {
476
+ records = records.slice(-limit);
476
477
  }
477
478
  const messages = this.processResultWithTypeConversion(records, await this.getTableSchema(TABLE_MESSAGES));
478
479
  const normalized = messages.map((msg) => ({
@@ -751,6 +752,10 @@ var LanceStorage = class _LanceStorage extends MastraStorage {
751
752
  async getMessagesPaginated(_args) {
752
753
  throw new Error("Method not implemented.");
753
754
  }
755
+ async updateMessages(_args) {
756
+ this.logger.error("updateMessages is not yet implemented in LanceStore");
757
+ throw new Error("Method not implemented");
758
+ }
754
759
  };
755
760
  var LanceFilterTranslator = class extends BaseFilterTranslator {
756
761
  translate(filter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/lance",
3
- "version": "0.0.0-workflow-deno-20250616132510",
3
+ "version": "0.0.0-working-memory-per-user-20250620163010",
4
4
  "description": "Lance provider for Mastra - includes both vector and db storage capabilities",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,12 +29,12 @@
29
29
  "tsup": "^8.5.0",
30
30
  "typescript": "^5.8.3",
31
31
  "vitest": "^3.2.3",
32
- "@internal/lint": "0.0.0-workflow-deno-20250616132510",
33
- "@internal/storage-test-utils": "0.0.8",
34
- "@mastra/core": "0.0.0-workflow-deno-20250616132510"
32
+ "@internal/lint": "0.0.0-working-memory-per-user-20250620163010",
33
+ "@internal/storage-test-utils": "0.0.9",
34
+ "@mastra/core": "0.0.0-working-memory-per-user-20250620163010"
35
35
  },
36
36
  "peerDependencies": {
37
- "@mastra/core": "0.0.0-workflow-deno-20250616132510"
37
+ "@mastra/core": "0.0.0-working-memory-per-user-20250620163010"
38
38
  },
39
39
  "scripts": {
40
40
  "build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
@@ -1,5 +1,6 @@
1
1
  import { connect } from '@lancedb/lancedb';
2
2
  import type { Connection, ConnectionOptions, SchemaLike, FieldLike } from '@lancedb/lancedb';
3
+ import type { MastraMessageContentV2 } from '@mastra/core/agent';
3
4
  import { MessageList } from '@mastra/core/agent';
4
5
  import type { MastraMessageV1, MastraMessageV2, StorageThreadType, TraceType } from '@mastra/core/memory';
5
6
  import {
@@ -617,7 +618,7 @@ export class LanceStorage extends MastraStorage {
617
618
  if (threadConfig) {
618
619
  throw new Error('ThreadConfig is not supported by LanceDB storage');
619
620
  }
620
-
621
+ const limit = this.resolveMessageLimit({ last: selectBy?.last, defaultLimit: Number.MAX_SAFE_INTEGER });
621
622
  const table = await this.lanceClient.openTable(TABLE_MESSAGES);
622
623
  let query = table.query().where(`\`threadId\` = '${threadId}'`);
623
624
 
@@ -652,8 +653,8 @@ export class LanceStorage extends MastraStorage {
652
653
  }
653
654
 
654
655
  // If we're fetching the last N messages, take only the last N after sorting
655
- if (selectBy?.last !== undefined && selectBy.last !== false) {
656
- records = records.slice(-selectBy.last);
656
+ if (limit !== Number.MAX_SAFE_INTEGER) {
657
+ records = records.slice(-limit);
657
658
  }
658
659
 
659
660
  const messages = this.processResultWithTypeConversion(records, await this.getTableSchema(TABLE_MESSAGES));
@@ -1014,4 +1015,15 @@ export class LanceStorage extends MastraStorage {
1014
1015
  ): Promise<PaginationInfo & { messages: MastraMessageV1[] | MastraMessageV2[] }> {
1015
1016
  throw new Error('Method not implemented.');
1016
1017
  }
1018
+
1019
+ async updateMessages(_args: {
1020
+ messages: Partial<Omit<MastraMessageV2, 'createdAt'>> &
1021
+ {
1022
+ id: string;
1023
+ content?: { metadata?: MastraMessageContentV2['metadata']; content?: MastraMessageContentV2['content'] };
1024
+ }[];
1025
+ }): Promise<MastraMessageV2[]> {
1026
+ this.logger.error('updateMessages is not yet implemented in LanceStore');
1027
+ throw new Error('Method not implemented');
1028
+ }
1017
1029
  }