@mastra/memory 1.27.0-alpha.0 → 1.27.0-alpha.1

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.
Files changed (28) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/docs/SKILL.md +6 -6
  3. package/dist/docs/assets/SOURCE_MAP.json +1 -1
  4. package/dist/docs/references/{docs-agents-agent-approval.md → docs-agents-human-in-the-loop.md} +5 -5
  5. package/dist/docs/references/docs-agents-networks.md +3 -3
  6. package/dist/docs/references/{docs-long-running-agents-background-tasks.md → docs-harness-background-tasks.md} +5 -5
  7. package/dist/docs/references/{docs-long-running-agents-goals.md → docs-harness-goals.md} +6 -6
  8. package/dist/docs/references/docs-memory-message-history.md +1 -1
  9. package/dist/docs/references/docs-memory-overview.md +4 -4
  10. package/dist/docs/references/docs-memory-working-memory.md +1 -1
  11. package/dist/docs/references/{docs-storage-overview.md → docs-storage.md} +1 -1
  12. package/dist/docs/references/{docs-capabilities-subagents.md → docs-subagents.md} +35 -5
  13. package/dist/docs/references/integrations-channels-github.md +1 -1
  14. package/dist/docs/references/integrations-databases-postgresql.md +1 -0
  15. package/dist/docs/references/reference-file-based-agents-memory.md +2 -2
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/processors/index.cjs +1 -1
  19. package/dist/processors/index.js +1 -1
  20. package/dist/processors/observational-memory/types.d.ts +2 -0
  21. package/dist/processors/observational-memory/types.d.ts.map +1 -1
  22. package/dist/{src-BUlG9vaB.js → src-BKRU-0Fx.js} +10 -6
  23. package/dist/{src-BUlG9vaB.js.map → src-BKRU-0Fx.js.map} +1 -1
  24. package/dist/{src-MvtBOFYO.cjs → src-_7ADtEwc.cjs} +10 -6
  25. package/dist/{src-MvtBOFYO.cjs.map → src-_7ADtEwc.cjs.map} +1 -1
  26. package/dist/tools/working-memory.d.ts +3 -1
  27. package/dist/tools/working-memory.d.ts.map +1 -1
  28. package/package.json +4 -4
@@ -19903,21 +19903,22 @@ const SET_WORKING_MEMORY_TOOL_NAME = "setWorkingMemory";
19903
19903
  /**
19904
19904
  * Deep merges two objects, with special handling for null values (delete) and arrays (replace).
19905
19905
  * - Object properties are recursively merged
19906
- * - null values in the update will delete the corresponding property
19906
+ * - null values in the update will delete the corresponding property, even when the property
19907
+ * or its parent object does not exist yet (so padded nulls never get stored literally)
19907
19908
  * - Arrays are replaced entirely (not merged element-by-element)
19908
19909
  * - Primitive values are overwritten
19910
+ * - The returned object is always newly constructed and never aliases `update`
19909
19911
  */
19910
19912
  function deepMergeWorkingMemory(existing, update) {
19911
19913
  if (!update || typeof update !== "object" || Object.keys(update).length === 0) return existing && typeof existing === "object" ? { ...existing } : {};
19912
- if (!existing || typeof existing !== "object") return update;
19913
- const result = { ...existing };
19914
+ const result = { ...existing && typeof existing === "object" && !Array.isArray(existing) ? existing : {} };
19914
19915
  for (const key of Object.keys(update)) {
19915
19916
  const updateValue = update[key];
19916
19917
  const existingValue = result[key];
19917
19918
  if (updateValue === void 0) continue;
19918
19919
  if (updateValue === null) delete result[key];
19919
19920
  else if (Array.isArray(updateValue)) result[key] = updateValue;
19920
- else if (typeof updateValue === "object" && updateValue !== null && typeof existingValue === "object" && existingValue !== null && !Array.isArray(existingValue)) result[key] = deepMergeWorkingMemory(existingValue, updateValue);
19921
+ else if (typeof updateValue === "object") result[key] = deepMergeWorkingMemory(existingValue && typeof existingValue === "object" && !Array.isArray(existingValue) ? existingValue : void 0, updateValue);
19921
19922
  else result[key] = updateValue;
19922
19923
  }
19923
19924
  return result;
@@ -25535,7 +25536,10 @@ ${formattedMessages}
25535
25536
  }
25536
25537
  };
25537
25538
  omDebug(`[OM:status] step=${stepNumber} msgs=${pendingTokens}/${threshold} obs=${currentObservationTokens}/${effectiveObservationTokensThreshold} gen=${record.generationCount}`);
25538
- await writer.custom(statusPart).catch(() => {});
25539
+ await writer.custom({
25540
+ ...statusPart,
25541
+ transient: true
25542
+ }).catch(() => {});
25539
25543
  }
25540
25544
  }
25541
25545
  /**
@@ -29046,4 +29050,4 @@ Object.defineProperty(exports, "wrapInObservationGroup", {
29046
29050
  }
29047
29051
  });
29048
29052
 
29049
- //# sourceMappingURL=src-MvtBOFYO.cjs.map
29053
+ //# sourceMappingURL=src-_7ADtEwc.cjs.map