@mastra/mongodb 1.5.5 → 1.5.6
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 +18 -0
- package/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/docs-memory-working-memory.md +2 -2
- package/dist/docs/references/docs-rag-retrieval.md +12 -12
- package/dist/docs/references/reference-storage-mongodb.md +1 -1
- package/dist/docs/references/reference-vectors-mongodb.md +1 -1
- package/dist/index.cjs +9 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/memory/index.d.ts.map +1 -1
- package/package.json +7 -8
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { saveScorePayloadSchema } from '@mastra/core/evals';
|
|
|
12
12
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
|
-
version: "1.5.
|
|
15
|
+
version: "1.5.6"};
|
|
16
16
|
var MongoDBFilterTranslator = class extends BaseFilterTranslator {
|
|
17
17
|
getSupportedOperators() {
|
|
18
18
|
return {
|
|
@@ -4382,15 +4382,15 @@ var MemoryStorageMongoDB = class _MemoryStorageMongoDB extends MemoryStorage {
|
|
|
4382
4382
|
let bestUnderTokens = 0;
|
|
4383
4383
|
for (let i = 0; i < chunks.length; i++) {
|
|
4384
4384
|
cumulativeMessageTokens += chunks[i].messageTokens ?? 0;
|
|
4385
|
-
const
|
|
4385
|
+
const boundary2 = i + 1;
|
|
4386
4386
|
if (cumulativeMessageTokens >= targetMessageTokens) {
|
|
4387
4387
|
if (bestOverBoundary === 0 || cumulativeMessageTokens < bestOverTokens) {
|
|
4388
|
-
bestOverBoundary =
|
|
4388
|
+
bestOverBoundary = boundary2;
|
|
4389
4389
|
bestOverTokens = cumulativeMessageTokens;
|
|
4390
4390
|
}
|
|
4391
4391
|
} else {
|
|
4392
4392
|
if (cumulativeMessageTokens > bestUnderTokens) {
|
|
4393
|
-
bestUnderBoundary =
|
|
4393
|
+
bestUnderBoundary = boundary2;
|
|
4394
4394
|
bestUnderTokens = cumulativeMessageTokens;
|
|
4395
4395
|
}
|
|
4396
4396
|
}
|
|
@@ -4424,9 +4424,12 @@ var MemoryStorageMongoDB = class _MemoryStorageMongoDB extends MemoryStorage {
|
|
|
4424
4424
|
const lastObservedAt = input.lastObservedAt ?? (latestChunk?.lastObservedAt ? new Date(latestChunk.lastObservedAt) : /* @__PURE__ */ new Date());
|
|
4425
4425
|
const existingActive = doc.activeObservations || "";
|
|
4426
4426
|
const existingTokenCount = Number(doc.observationTokenCount || 0);
|
|
4427
|
-
const
|
|
4427
|
+
const boundary = `
|
|
4428
4428
|
|
|
4429
|
-
${
|
|
4429
|
+
--- message boundary (${lastObservedAt.toISOString()}) ---
|
|
4430
|
+
|
|
4431
|
+
`;
|
|
4432
|
+
const newActive = existingActive ? `${existingActive}${boundary}${activatedContent}` : activatedContent;
|
|
4430
4433
|
const newTokenCount = existingTokenCount + activatedTokens;
|
|
4431
4434
|
const existingPending = Number(doc.pendingMessageTokens || 0);
|
|
4432
4435
|
const newPending = Math.max(0, existingPending - activatedMessageTokens);
|