mr-memory 2.14.0 → 2.15.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/index.ts +23 -1
- package/package.json +1 -1
- package/upload.ts +23 -1
package/index.ts
CHANGED
|
@@ -80,6 +80,16 @@ const SYSTEM_NOISE_PATTERNS = [
|
|
|
80
80
|
/^Please read them now using the Read tool/,
|
|
81
81
|
/^GatewayRestart:\s*\{/,
|
|
82
82
|
/^This ensures your operating protocols are restored/,
|
|
83
|
+
// Cron job prompts — automated system instructions, not human conversation
|
|
84
|
+
/^\[cron:[^\]]+\]/,
|
|
85
|
+
// Sub-agent completion announcements (system-generated)
|
|
86
|
+
/^A background task "[^"]*" just completed/,
|
|
87
|
+
// Sub-agent stats lines
|
|
88
|
+
/^Stats: runtime \d+/,
|
|
89
|
+
// Summarize instruction for sub-agent completions
|
|
90
|
+
/^Summarize this naturally for the user/,
|
|
91
|
+
// Session reset greet prompts
|
|
92
|
+
/^Greet the user in your configured persona/,
|
|
83
93
|
];
|
|
84
94
|
|
|
85
95
|
/** Strip OpenClaw envelope metadata from user messages */
|
|
@@ -109,7 +119,19 @@ function sanitizeForIngest(text: string): string {
|
|
|
109
119
|
.replace(POST_COMPACTION_AUDIT_RE, "")
|
|
110
120
|
.replace(READ_TOOL_INSTRUCTION_RE, "")
|
|
111
121
|
.replace(TELEGRAM_ENVELOPE_RE, "")
|
|
112
|
-
.replace(MESSAGE_ID_TAG_RE, "")
|
|
122
|
+
.replace(MESSAGE_ID_TAG_RE, "")
|
|
123
|
+
// Embedded noise substrings — v2.15.0
|
|
124
|
+
.replace(/Pre-compaction memory flush\.?\s*(?:Store durable memories now[^\n]*\n?)*(?:IMPORTANT:[^\n]*\n?)?(?:Current time:[^\n]*\n?)?/g, "")
|
|
125
|
+
.replace(/`?HEARTBEAT_OK`?\s*/g, "")
|
|
126
|
+
.replace(/Read HEARTBEAT\.md[^\n]*(?:\n(?:Follow it strictly|Do not infer|If nothing needs)[^\n]*)*/g, "")
|
|
127
|
+
.replace(/\n*\s*NO_REPLY\s*$/g, "")
|
|
128
|
+
.replace(/You can respond with NO_REPLY[^\n]*\n*/g, "")
|
|
129
|
+
.replace(/If nothing to store,? reply (?:with )?NO_REPLY[^\n]*\n*/g, "")
|
|
130
|
+
.replace(/Store durable memories now[^\n]*\n*/g, "")
|
|
131
|
+
.replace(/This ensures your operating protocols are restored[^\n]*\n*/g, "")
|
|
132
|
+
.replace(/Current time:[^\n]*\n*/g, "")
|
|
133
|
+
.replace(/\bset:\s*\n\s*-\s*WORKFLOW_AUTO\.md[^\n]*\n(?:\s*-\s*memory[^\n]*\n)*/g, "")
|
|
134
|
+
.replace(/Do not mention technical details[^\n]*\n*/g, "");
|
|
113
135
|
// 3. Collapse excessive whitespace from removals
|
|
114
136
|
cleaned = cleaned.replace(/\n{3,}/g, "\n\n").trim();
|
|
115
137
|
return cleaned;
|
package/package.json
CHANGED
package/upload.ts
CHANGED
|
@@ -53,7 +53,19 @@ function sanitizeForUpload(text: string): string {
|
|
|
53
53
|
.replace(POST_COMPACTION_AUDIT_RE, "")
|
|
54
54
|
.replace(READ_TOOL_INSTRUCTION_RE, "")
|
|
55
55
|
.replace(TELEGRAM_ENVELOPE_RE, "")
|
|
56
|
-
.replace(MESSAGE_ID_TAG_RE, "")
|
|
56
|
+
.replace(MESSAGE_ID_TAG_RE, "")
|
|
57
|
+
// Embedded noise substrings — v2.15.0
|
|
58
|
+
.replace(/Pre-compaction memory flush\.?\s*(?:Store durable memories now[^\n]*\n?)*(?:IMPORTANT:[^\n]*\n?)?(?:Current time:[^\n]*\n?)?/g, "")
|
|
59
|
+
.replace(/`?HEARTBEAT_OK`?\s*/g, "")
|
|
60
|
+
.replace(/Read HEARTBEAT\.md[^\n]*(?:\n(?:Follow it strictly|Do not infer|If nothing needs)[^\n]*)*/g, "")
|
|
61
|
+
.replace(/\n*\s*NO_REPLY\s*$/g, "")
|
|
62
|
+
.replace(/You can respond with NO_REPLY[^\n]*\n*/g, "")
|
|
63
|
+
.replace(/If nothing to store,? reply (?:with )?NO_REPLY[^\n]*\n*/g, "")
|
|
64
|
+
.replace(/Store durable memories now[^\n]*\n*/g, "")
|
|
65
|
+
.replace(/This ensures your operating protocols are restored[^\n]*\n*/g, "")
|
|
66
|
+
.replace(/Current time:[^\n]*\n*/g, "")
|
|
67
|
+
.replace(/\bset:\s*\n\s*-\s*WORKFLOW_AUTO\.md[^\n]*\n(?:\s*-\s*memory[^\n]*\n)*/g, "")
|
|
68
|
+
.replace(/Do not mention technical details[^\n]*\n*/g, "");
|
|
57
69
|
cleaned = cleaned.replace(/\n{3,}/g, "\n\n").trim();
|
|
58
70
|
return cleaned;
|
|
59
71
|
}
|
|
@@ -76,6 +88,16 @@ const SYSTEM_NOISE_PATTERNS = [
|
|
|
76
88
|
/^Please read them now using the Read tool/,
|
|
77
89
|
/^GatewayRestart:\s*\{/,
|
|
78
90
|
/^This ensures your operating protocols are restored/,
|
|
91
|
+
// Cron job prompts — automated system instructions, not human conversation
|
|
92
|
+
/^\[cron:[^\]]+\]/,
|
|
93
|
+
// Sub-agent completion announcements (system-generated)
|
|
94
|
+
/^A background task "[^"]*" just completed/,
|
|
95
|
+
// Sub-agent stats lines
|
|
96
|
+
/^Stats: runtime \d+/,
|
|
97
|
+
// Summarize instruction for sub-agent completions
|
|
98
|
+
/^Summarize this naturally for the user/,
|
|
99
|
+
// Session reset greet prompts
|
|
100
|
+
/^Greet the user in your configured persona/,
|
|
79
101
|
];
|
|
80
102
|
|
|
81
103
|
function isSystemNoise(text: string): boolean {
|