@mingxy/cerebro 2.1.2 → 2.1.4

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": "2.1.2",
3
+ "version": "2.1.4",
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
@@ -60,15 +60,7 @@ const OmemPlugin: Plugin = async (input) => {
60
60
  // project_path must be git root so parent/child dirs share memories.
61
61
  const { directory: _directory, worktree, client } = input;
62
62
  const directory = worktree || _directory;
63
- // Proxy: dynamically resolve client.tui on each access so toast works
64
- // even if client.tui isn't ready yet at plugin init time
65
- const tui = new Proxy({} as any, {
66
- get(_, prop) {
67
- const realTui = (client as any)?.tui;
68
- const val = realTui?.[prop];
69
- return typeof val === "function" ? val.bind(realTui) : val;
70
- },
71
- });
63
+ const tui = (client as any)?.tui;
72
64
 
73
65
  // Load overrides from opencode.json plugin_config
74
66
  let overrides: Record<string, unknown> = {};