@mastra/oracledb 0.4.2-alpha.0 → 0.5.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/dist/storage/domains/memory/observational.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -4295,6 +4295,10 @@ async function getObservationalMemoryHistory(ctx, threadId, resourceId, limit =
|
|
|
4295
4295
|
lookupKey,
|
|
4296
4296
|
limit
|
|
4297
4297
|
};
|
|
4298
|
+
if (options?.recordId !== void 0) {
|
|
4299
|
+
conditions.push(`id = :recordId`);
|
|
4300
|
+
binds.recordId = options.recordId;
|
|
4301
|
+
}
|
|
4298
4302
|
if (options?.from) {
|
|
4299
4303
|
conditions.push(`${OM_CREATED_AT} >= :fromDate`);
|
|
4300
4304
|
binds.fromDate = options.from;
|
|
@@ -4303,11 +4307,28 @@ async function getObservationalMemoryHistory(ctx, threadId, resourceId, limit =
|
|
|
4303
4307
|
conditions.push(`${OM_CREATED_AT} <= :toDate`);
|
|
4304
4308
|
binds.toDate = options.to;
|
|
4305
4309
|
}
|
|
4310
|
+
if (options?.groupId !== void 0) {
|
|
4311
|
+
conditions.push(`(DBMS_LOB.INSTR(${OM_ACTIVE_OBSERVATIONS}, :groupPrefix) > 0 OR EXISTS (
|
|
4312
|
+
SELECT 1 FROM JSON_TABLE(${OM_BUFFERED_OBSERVATION_CHUNKS}, '$[*]'
|
|
4313
|
+
COLUMNS (observations CLOB PATH '$.observations')) chunk
|
|
4314
|
+
WHERE DBMS_LOB.INSTR(chunk.observations, :groupPrefix) > 0
|
|
4315
|
+
))`);
|
|
4316
|
+
binds.groupPrefix = `<observation-group id="${options.groupId}"`;
|
|
4317
|
+
}
|
|
4318
|
+
if (options?.beforeGeneration !== void 0) {
|
|
4319
|
+
conditions.push(`${OM_GENERATION_COUNT} < :beforeGeneration`);
|
|
4320
|
+
binds.beforeGeneration = options.beforeGeneration;
|
|
4321
|
+
}
|
|
4322
|
+
if (options?.afterGeneration !== void 0) {
|
|
4323
|
+
conditions.push(`${OM_GENERATION_COUNT} > :afterGeneration`);
|
|
4324
|
+
binds.afterGeneration = options.afterGeneration;
|
|
4325
|
+
}
|
|
4326
|
+
const direction = options?.sortDirection === "ASC" ? "ASC" : "DESC";
|
|
4306
4327
|
if (options?.offset !== void 0) binds.offset = options.offset;
|
|
4307
4328
|
return await ctx.db.withConnection(async (connection) => {
|
|
4308
4329
|
return rows(await connection.execute(`${omSelect()} FROM ${table(ctx, TABLE_OBSERVATIONAL_MEMORY)}
|
|
4309
4330
|
WHERE ${conditions.join(" AND ")}
|
|
4310
|
-
ORDER BY ${OM_GENERATION_COUNT}
|
|
4331
|
+
ORDER BY ${OM_GENERATION_COUNT} ${direction}, ${OM_CREATED_AT} ASC, "id" ASC
|
|
4311
4332
|
OFFSET :offset ROWS FETCH NEXT :limit ROWS ONLY`, asBindParameters({
|
|
4312
4333
|
offset: options?.offset ?? 0,
|
|
4313
4334
|
...binds
|
|
@@ -5370,6 +5391,7 @@ const DEFAULT_VECTOR_REGISTRY_TABLE$1 = "MASTRA_VECTOR_INDEXES";
|
|
|
5370
5391
|
var MemoryOracle = class MemoryOracle extends MemoryStorage {
|
|
5371
5392
|
supportsPartialThreadUpdate = true;
|
|
5372
5393
|
supportsObservationalMemory = true;
|
|
5394
|
+
supportsObservationalMemoryHistorySearch = true;
|
|
5373
5395
|
static MANAGED_TABLES = [
|
|
5374
5396
|
TABLE_THREADS,
|
|
5375
5397
|
TABLE_MESSAGES,
|