@mastra/libsql 1.24.1 → 1.25.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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +23 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts +1 -0
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +5 -5
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -7827,6 +7827,7 @@ function addSqliteMetadataValuePredicate(conditions, params, path, value) {
|
|
|
7827
7827
|
var MemoryLibSQL = class MemoryLibSQL extends _mastra_core_storage.MemoryStorage {
|
|
7828
7828
|
supportsPartialThreadUpdate = true;
|
|
7829
7829
|
supportsObservationalMemory = true;
|
|
7830
|
+
supportsObservationalMemoryHistorySearch = true;
|
|
7830
7831
|
/**
|
|
7831
7832
|
* Retention-eligible tables. `threads`, `messages`, and `resources` all anchor
|
|
7832
7833
|
* on `createdAt` and are indexed for fast batched deletes. Cascade order is
|
|
@@ -8998,6 +8999,10 @@ var MemoryLibSQL = class MemoryLibSQL extends _mastra_core_storage.MemoryStorage
|
|
|
8998
8999
|
const lookupKey = this.getOMKey(threadId, resourceId);
|
|
8999
9000
|
const conditions = [`"lookupKey" = ?`];
|
|
9000
9001
|
const args = [lookupKey];
|
|
9002
|
+
if (options?.recordId !== void 0) {
|
|
9003
|
+
conditions.push(`id = ?`);
|
|
9004
|
+
args.push(options.recordId);
|
|
9005
|
+
}
|
|
9001
9006
|
if (options?.from) {
|
|
9002
9007
|
conditions.push(`"createdAt" >= ?`);
|
|
9003
9008
|
args.push(options.from.toISOString());
|
|
@@ -9006,8 +9011,25 @@ var MemoryLibSQL = class MemoryLibSQL extends _mastra_core_storage.MemoryStorage
|
|
|
9006
9011
|
conditions.push(`"createdAt" <= ?`);
|
|
9007
9012
|
args.push(options.to.toISOString());
|
|
9008
9013
|
}
|
|
9014
|
+
if (options?.groupId !== void 0) {
|
|
9015
|
+
conditions.push(`(instr("activeObservations", ?) > 0 OR EXISTS (
|
|
9016
|
+
SELECT 1 FROM json_each("bufferedObservationChunks") AS chunk
|
|
9017
|
+
WHERE instr(json_extract(chunk.value, '$.observations'), ?) > 0
|
|
9018
|
+
))`);
|
|
9019
|
+
const prefix = `<observation-group id="${options.groupId}"`;
|
|
9020
|
+
args.push(prefix, prefix);
|
|
9021
|
+
}
|
|
9022
|
+
if (options?.beforeGeneration !== void 0) {
|
|
9023
|
+
conditions.push(`"generationCount" < ?`);
|
|
9024
|
+
args.push(options.beforeGeneration);
|
|
9025
|
+
}
|
|
9026
|
+
if (options?.afterGeneration !== void 0) {
|
|
9027
|
+
conditions.push(`"generationCount" > ?`);
|
|
9028
|
+
args.push(options.afterGeneration);
|
|
9029
|
+
}
|
|
9030
|
+
const direction = options?.sortDirection === "ASC" ? "ASC" : "DESC";
|
|
9009
9031
|
args.push(limit);
|
|
9010
|
-
let sql = `SELECT * FROM "${OM_TABLE}" WHERE ${conditions.join(" AND ")} ORDER BY "generationCount"
|
|
9032
|
+
let sql = `SELECT * FROM "${OM_TABLE}" WHERE ${conditions.join(" AND ")} ORDER BY "generationCount" ${direction}, "createdAt" ASC, id ASC LIMIT ?`;
|
|
9011
9033
|
if (options?.offset != null) {
|
|
9012
9034
|
args.push(options.offset);
|
|
9013
9035
|
sql += ` OFFSET ?`;
|