@mingxy/cerebro 2.1.1 โ 2.1.3
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 +5 -4
- package/src/index.ts +3 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mingxy/cerebro",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
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
|
@@ -120,15 +120,16 @@ async function detectProjectName(rootPath: string): Promise<string | undefined>
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export function showToast(tui: any, title: string, message: string, variant: string = "info", delayMs?: number) {
|
|
123
|
-
if (!tui?.showToast) {
|
|
124
|
-
logDebug("showToast: tui or tui.showToast unavailable");
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
123
|
const defaultDelay = 1000;
|
|
128
124
|
const effectiveDelay = delayMs ?? defaultDelay;
|
|
129
125
|
setTimeout(async () => {
|
|
126
|
+
if (!tui?.showToast) {
|
|
127
|
+
logInfo("showToast: tui.showToast unavailable after delay", { delay: effectiveDelay, title });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
130
|
try {
|
|
131
131
|
await tui.showToast({ body: { title, message, variant, duration: 5000 } });
|
|
132
|
+
logInfo("showToast: success", { title });
|
|
132
133
|
} catch (err) {
|
|
133
134
|
logErr("showToast failed", { error: String(err), title });
|
|
134
135
|
}
|
package/src/index.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { join, dirname } from "node:path";
|
|
|
4
4
|
import { tmpdir } from "node:os";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { CerebroClient } from "./client.js";
|
|
7
|
-
import { chatMessageRecallHook, autocontinueHook, compactingHook, sessionIdleHook, sessionMessages, firstMessages, timeMemorySystemHook } from "./hooks.js";
|
|
7
|
+
import { chatMessageRecallHook, autocontinueHook, compactingHook, sessionIdleHook, sessionMessages, firstMessages, timeMemorySystemHook, showToast } from "./hooks.js";
|
|
8
8
|
import { detectSaveKeyword, detectRecallKeyword, KEYWORD_NUDGE, RECALL_NUDGE } from "./keywords.js";
|
|
9
9
|
import { getUserTag, getProjectTag } from "./tags.js";
|
|
10
10
|
import { buildTools } from "./tools.js";
|
|
@@ -136,9 +136,8 @@ const OmemPlugin: Plugin = async (input) => {
|
|
|
136
136
|
? { variant: "success" as const, title: `๐ง Cerebro Connected ยท v${pluginVersion}`, message: `๐ Open in browser http://localhost:${webPort}` }
|
|
137
137
|
: { variant: "success" as const, title: `๐ง Cerebro Connected ยท v${pluginVersion}`, message: "No web server" };
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
} catch {}
|
|
139
|
+
// Direct toast via tui proxy โ bypasses broken TUI plugin file mechanism (opencode 1.17.14+)
|
|
140
|
+
showToast(tui, startupToast.title, startupToast.message, startupToast.variant, 2000);
|
|
142
141
|
|
|
143
142
|
// Auto-update check (fire-and-forget, non-blocking)
|
|
144
143
|
checkAndUpdate(tui, pluginVersion).catch(() => {});
|