@joshuaswarren/openclaw-engram 9.0.59 → 9.0.60

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.
@@ -1764,7 +1764,7 @@ ${sanitized.text}
1764
1764
  memoryId: id,
1765
1765
  eventType: "created",
1766
1766
  timestamp: fm.created,
1767
- actor: "storage.writeMemory",
1767
+ actor: options.actor ?? "storage.writeMemory",
1768
1768
  after: this.summarizeLifecycleState(fm, filePath),
1769
1769
  relatedMemoryIds: [
1770
1770
  ...options.supersedes ? [options.supersedes] : [],
@@ -1826,11 +1826,12 @@ ${sanitized.text}
1826
1826
 
1827
1827
  ${sanitized.text}
1828
1828
  `, "utf-8");
1829
+ const actor = typeof options.actor === "string" && options.actor.length > 0 ? options.actor : "storage.writeArtifact";
1829
1830
  await this.appendGeneratedMemoryLifecycleEventFailOpen("storage.writeArtifact", {
1830
1831
  memoryId: id,
1831
1832
  eventType: "created",
1832
1833
  timestamp: fm.created,
1833
- actor: "storage.writeArtifact",
1834
+ actor,
1834
1835
  after: this.summarizeLifecycleState(fm, filePath),
1835
1836
  relatedMemoryIds: options.sourceMemoryId ? [options.sourceMemoryId] : []
1836
1837
  });
@@ -2329,7 +2330,7 @@ ${sanitized.text}
2329
2330
  memoryId: id,
2330
2331
  eventType: "updated",
2331
2332
  timestamp: updated.updated,
2332
- actor: "storage.updateMemory",
2333
+ actor: options?.actor ?? "storage.updateMemory",
2333
2334
  before: this.summarizeLifecycleState(memory.frontmatter, memory.path),
2334
2335
  after: this.summarizeLifecycleState(updated, memory.path),
2335
2336
  relatedMemoryIds: [
@@ -3629,7 +3630,7 @@ ${memory.content}
3629
3630
  /**
3630
3631
  * Add links to an existing memory.
3631
3632
  */
3632
- async addLinksToMemory(memoryId, links) {
3633
+ async addLinksToMemory(memoryId, links, lifecycle) {
3633
3634
  const memories = await this.readAllMemories();
3634
3635
  const memory = memories.find((m) => m.frontmatter.id === memoryId);
3635
3636
  if (!memory) return false;
@@ -3640,17 +3641,15 @@ ${memory.content}
3640
3641
  mergedLinks.push(link);
3641
3642
  }
3642
3643
  }
3643
- const updatedFm = {
3644
- ...memory.frontmatter,
3645
- links: mergedLinks,
3646
- updated: (/* @__PURE__ */ new Date()).toISOString()
3647
- };
3648
- const fileContent = `${serializeFrontmatter(updatedFm)}
3649
-
3650
- ${memory.content}
3651
- `;
3652
3644
  try {
3653
- await writeFile2(memory.path, fileContent, "utf-8");
3645
+ await this.writeMemoryFrontmatter(
3646
+ memory,
3647
+ {
3648
+ links: mergedLinks,
3649
+ updated: (/* @__PURE__ */ new Date()).toISOString()
3650
+ },
3651
+ lifecycle
3652
+ );
3654
3653
  log.debug(`added ${links.length} links to memory ${memoryId}`);
3655
3654
  return true;
3656
3655
  } catch (err) {
@@ -3723,4 +3722,4 @@ export {
3723
3722
  serializeEntityFile,
3724
3723
  StorageManager
3725
3724
  };
3726
- //# sourceMappingURL=chunk-CWVXHH36.js.map
3725
+ //# sourceMappingURL=chunk-M4PLG26T.js.map