@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/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -4319,6 +4319,10 @@ async function getObservationalMemoryHistory(ctx, threadId, resourceId, limit =
|
|
|
4319
4319
|
lookupKey,
|
|
4320
4320
|
limit
|
|
4321
4321
|
};
|
|
4322
|
+
if (options?.recordId !== void 0) {
|
|
4323
|
+
conditions.push(`id = :recordId`);
|
|
4324
|
+
binds.recordId = options.recordId;
|
|
4325
|
+
}
|
|
4322
4326
|
if (options?.from) {
|
|
4323
4327
|
conditions.push(`${OM_CREATED_AT} >= :fromDate`);
|
|
4324
4328
|
binds.fromDate = options.from;
|
|
@@ -4327,11 +4331,28 @@ async function getObservationalMemoryHistory(ctx, threadId, resourceId, limit =
|
|
|
4327
4331
|
conditions.push(`${OM_CREATED_AT} <= :toDate`);
|
|
4328
4332
|
binds.toDate = options.to;
|
|
4329
4333
|
}
|
|
4334
|
+
if (options?.groupId !== void 0) {
|
|
4335
|
+
conditions.push(`(DBMS_LOB.INSTR(${OM_ACTIVE_OBSERVATIONS}, :groupPrefix) > 0 OR EXISTS (
|
|
4336
|
+
SELECT 1 FROM JSON_TABLE(${OM_BUFFERED_OBSERVATION_CHUNKS}, '$[*]'
|
|
4337
|
+
COLUMNS (observations CLOB PATH '$.observations')) chunk
|
|
4338
|
+
WHERE DBMS_LOB.INSTR(chunk.observations, :groupPrefix) > 0
|
|
4339
|
+
))`);
|
|
4340
|
+
binds.groupPrefix = `<observation-group id="${options.groupId}"`;
|
|
4341
|
+
}
|
|
4342
|
+
if (options?.beforeGeneration !== void 0) {
|
|
4343
|
+
conditions.push(`${OM_GENERATION_COUNT} < :beforeGeneration`);
|
|
4344
|
+
binds.beforeGeneration = options.beforeGeneration;
|
|
4345
|
+
}
|
|
4346
|
+
if (options?.afterGeneration !== void 0) {
|
|
4347
|
+
conditions.push(`${OM_GENERATION_COUNT} > :afterGeneration`);
|
|
4348
|
+
binds.afterGeneration = options.afterGeneration;
|
|
4349
|
+
}
|
|
4350
|
+
const direction = options?.sortDirection === "ASC" ? "ASC" : "DESC";
|
|
4330
4351
|
if (options?.offset !== void 0) binds.offset = options.offset;
|
|
4331
4352
|
return await ctx.db.withConnection(async (connection) => {
|
|
4332
4353
|
return rows(await connection.execute(`${omSelect()} FROM ${table(ctx, _mastra_core_storage.TABLE_OBSERVATIONAL_MEMORY)}
|
|
4333
4354
|
WHERE ${conditions.join(" AND ")}
|
|
4334
|
-
ORDER BY ${OM_GENERATION_COUNT}
|
|
4355
|
+
ORDER BY ${OM_GENERATION_COUNT} ${direction}, ${OM_CREATED_AT} ASC, "id" ASC
|
|
4335
4356
|
OFFSET :offset ROWS FETCH NEXT :limit ROWS ONLY`, asBindParameters({
|
|
4336
4357
|
offset: options?.offset ?? 0,
|
|
4337
4358
|
...binds
|
|
@@ -5394,6 +5415,7 @@ const DEFAULT_VECTOR_REGISTRY_TABLE$1 = "MASTRA_VECTOR_INDEXES";
|
|
|
5394
5415
|
var MemoryOracle = class MemoryOracle extends _mastra_core_storage.MemoryStorage {
|
|
5395
5416
|
supportsPartialThreadUpdate = true;
|
|
5396
5417
|
supportsObservationalMemory = true;
|
|
5418
|
+
supportsObservationalMemoryHistorySearch = true;
|
|
5397
5419
|
static MANAGED_TABLES = [
|
|
5398
5420
|
_mastra_core_storage.TABLE_THREADS,
|
|
5399
5421
|
_mastra_core_storage.TABLE_MESSAGES,
|