pi-observational-memory 2.4.0 → 2.4.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/serialize.ts +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-observational-memory",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "description": "Observational memory extension for pi — cache-friendly tiered compaction with observations and reflections.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/serialize.ts CHANGED
@@ -58,8 +58,10 @@ function textAndPlaceholders(
58
58
  return parts.join("\n");
59
59
  }
60
60
 
61
- function textOnly(content: string | Array<{ type?: string; text?: string }>): string {
61
+ function textOnly(content: unknown): string {
62
+ if (content == null) return "";
62
63
  if (typeof content === "string") return content;
64
+ if (!Array.isArray(content)) return "";
63
65
  return content
64
66
  .filter((b): b is TextContent => b?.type === "text" && typeof b.text === "string")
65
67
  .map((b) => b.text)