@mingxy/cerebro 1.18.19 → 1.18.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro",
3
- "version": "1.18.19",
3
+ "version": "1.18.20",
4
4
  "description": "Cerebro persistent memory plugin for OpenCode — auto-recall, auto-capture, 9 memory tools with clustering, project-scoped memory isolation",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/hooks.ts CHANGED
@@ -342,6 +342,9 @@ export function chatMessageRecallHook(
342
342
  injectedSessions.add(input.sessionID);
343
343
 
344
344
  output.parts.unshift({
345
+ id: `prt_cerebro-inject-${Date.now()}`,
346
+ sessionID: input.sessionID,
347
+ messageID: output.message?.id,
345
348
  type: "text",
346
349
  text: injection.text,
347
350
  synthetic: true,
package/src/index.ts CHANGED
@@ -6,7 +6,7 @@ import { fileURLToPath } from "node:url";
6
6
  import type { Server } from "node:http";
7
7
  import { CerebroClient } from "./client.js";
8
8
  import { chatMessageRecallHook, autocontinueHook, compactingHook, sessionIdleHook, showToast as hooksShowToast, sessionMessages, firstMessages } from "./hooks.js";
9
- import { detectSaveKeyword, detectRecallKeyword } from "./keywords.js";
9
+ import { detectSaveKeyword, detectRecallKeyword, KEYWORD_NUDGE, RECALL_NUDGE } from "./keywords.js";
10
10
  import { getUserTag, getProjectTag } from "./tags.js";
11
11
  import { buildTools } from "./tools.js";
12
12
  import { logInfo, logDebug, logError } from "./logger.js";
@@ -163,12 +163,26 @@ const OmemPlugin: Plugin = async (input) => {
163
163
  firstMessages.set(input.sessionID, textContent);
164
164
  }
165
165
  if (detectSaveKeyword(textContent)) {
166
- hooksShowToast(tui, "💡 Memory Save Detected", "Auto-capture will save this on session idle", "info");
167
- logDebug("save keyword detected", { sessionId: input.sessionID });
166
+ output.parts.push({
167
+ id: `prt_cerebro-save-${Date.now()}`,
168
+ sessionID: input.sessionID,
169
+ messageID: output.message?.id,
170
+ type: "text",
171
+ text: KEYWORD_NUDGE,
172
+ synthetic: true,
173
+ } as any);
174
+ logDebug("save keyword detected, nudge pushed", { sessionId: input.sessionID });
168
175
  }
169
176
  if (detectRecallKeyword(textContent)) {
170
- hooksShowToast(tui, "🔍 Recall Detected", "Consider using memory_search for context", "info");
171
- logDebug("recall keyword detected", { sessionId: input.sessionID });
177
+ output.parts.push({
178
+ id: `prt_cerebro-recall-${Date.now()}`,
179
+ sessionID: input.sessionID,
180
+ messageID: output.message?.id,
181
+ type: "text",
182
+ text: RECALL_NUDGE,
183
+ synthetic: true,
184
+ } as any);
185
+ logDebug("recall keyword detected, nudge pushed", { sessionId: input.sessionID });
172
186
  }
173
187
  const policy = resolveAgentPolicy(agentId, config);
174
188
  if (policy !== "none") {