@mingxy/cerebro 1.18.17 → 1.18.18
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 +1 -1
- package/src/hooks.ts +18 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mingxy/cerebro",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.18",
|
|
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
|
@@ -231,16 +231,16 @@ export async function buildMemoryInjection(
|
|
|
231
231
|
const [profile, projectMemories, searchResults] = await Promise.all([
|
|
232
232
|
Promise.race([
|
|
233
233
|
client.getInjection(),
|
|
234
|
-
new Promise<null>((resolve) => setTimeout(() => resolve(null),
|
|
234
|
+
new Promise<null>((resolve) => setTimeout(() => resolve(null), 1000)),
|
|
235
235
|
]).catch(() => null),
|
|
236
236
|
Promise.race([
|
|
237
237
|
client.listRecent(5, projectPath),
|
|
238
|
-
new Promise<never[]>((resolve) => setTimeout(() => resolve([]),
|
|
238
|
+
new Promise<never[]>((resolve) => setTimeout(() => resolve([]), 1000)),
|
|
239
239
|
]).catch(() => []),
|
|
240
240
|
query
|
|
241
241
|
? Promise.race([
|
|
242
242
|
client.searchMemories(query, 10, undefined, undefined, projectPath),
|
|
243
|
-
new Promise<never[]>((resolve) => setTimeout(() => resolve([]),
|
|
243
|
+
new Promise<never[]>((resolve) => setTimeout(() => resolve([]), 1500)),
|
|
244
244
|
]).catch(() => [])
|
|
245
245
|
: Promise.resolve([]),
|
|
246
246
|
]);
|
|
@@ -350,6 +350,21 @@ export function chatMessageRecallHook(
|
|
|
350
350
|
showToast(tui, "🧠 Memory Injected",
|
|
351
351
|
`${injection.profileCount} prefs · ${injection.projectMemoryCount} project · ${injection.memoryCount} relevant`,
|
|
352
352
|
"success");
|
|
353
|
+
|
|
354
|
+
client.createRecallEvent({
|
|
355
|
+
session_id: input.sessionID,
|
|
356
|
+
recall_type: "auto",
|
|
357
|
+
query_text: query,
|
|
358
|
+
max_score: 0,
|
|
359
|
+
llm_confidence: 0,
|
|
360
|
+
profile_injected: injection.profileCount > 0,
|
|
361
|
+
kept_count: injection.projectMemoryCount + injection.memoryCount,
|
|
362
|
+
discarded_count: 0,
|
|
363
|
+
injected_count: injection.projectMemoryCount + injection.memoryCount,
|
|
364
|
+
injected_content: injection.text,
|
|
365
|
+
}).catch((e: unknown) => {
|
|
366
|
+
logErr("chatMessageRecallHook createRecallEvent failed", { error: String(e) });
|
|
367
|
+
});
|
|
353
368
|
} else if (!hasContent) {
|
|
354
369
|
logDebug("chatMessageRecallHook: no content available, will retry next turn", {
|
|
355
370
|
sessionId: input.sessionID,
|