@mingxy/cerebro 2.1.0 → 2.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/tui.tsx +13 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
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/tui.tsx CHANGED
@@ -78,10 +78,19 @@ const tui: TuiPlugin = async (api) => {
78
78
  try {
79
79
  const raw = readFileSync(join(tmpdir(), "cerebro_startup_toast.json"), "utf-8");
80
80
  const toast = JSON.parse(raw);
81
- setTimeout(() => {
82
- try { api.ui.toast(toast); } catch {}
83
- try { unlinkSync(join(tmpdir(), "cerebro_startup_toast.json")); } catch {}
84
- }, 2000);
81
+ // Retry: opencode 1.17.14+ delays TUI init; fixed timeout may fire before endpoint is ready
82
+ let attempts = 0;
83
+ const maxAttempts = 16;
84
+ const tryToast = () => {
85
+ attempts++;
86
+ try {
87
+ api.ui.toast(toast);
88
+ try { unlinkSync(join(tmpdir(), "cerebro_startup_toast.json")); } catch {}
89
+ } catch {
90
+ if (attempts < maxAttempts) setTimeout(tryToast, 500);
91
+ }
92
+ };
93
+ setTimeout(tryToast, 1000);
85
94
  } catch {}
86
95
  };
87
96