@icex-labs/openclaw-memory-engine 4.1.0 → 4.1.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.
- package/index.js +17 -20
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -138,28 +138,25 @@ export default definePluginEntry({
|
|
|
138
138
|
// ═══════════════════════════════════════════════════════════════════
|
|
139
139
|
|
|
140
140
|
api.registerHook("message:received", (event) => {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
});
|
|
141
|
+
try {
|
|
142
|
+
const ctx = event.context;
|
|
143
|
+
if (!ctx?.content) return;
|
|
144
|
+
const agentId = extractAgentId(event.sessionKey);
|
|
145
|
+
const wsDir = resolveWorkspace({ agentId });
|
|
146
|
+
captureMessage(wsDir, ctx.content, "user-message");
|
|
147
|
+
} catch { /* don't break message flow */ }
|
|
148
|
+
}, { name: "memory-engine-capture-received", description: "Auto-capture facts from incoming messages" });
|
|
150
149
|
|
|
151
150
|
api.registerHook("message:sent", (event) => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
captureMessage(wsDir, ctx.content, "agent-reply");
|
|
162
|
-
});
|
|
151
|
+
try {
|
|
152
|
+
const ctx = event.context;
|
|
153
|
+
if (!ctx?.content || !ctx?.success) return;
|
|
154
|
+
if (ctx.content.length < 50) return;
|
|
155
|
+
const agentId = extractAgentId(event.sessionKey);
|
|
156
|
+
const wsDir = resolveWorkspace({ agentId });
|
|
157
|
+
captureMessage(wsDir, ctx.content, "agent-reply");
|
|
158
|
+
} catch { /* don't break message flow */ }
|
|
159
|
+
}, { name: "memory-engine-capture-sent", description: "Auto-capture facts from agent replies" });
|
|
163
160
|
|
|
164
161
|
// ─── core_memory_read ───
|
|
165
162
|
api.registerTool(withAgent((agentId) => ({
|
package/package.json
CHANGED