@mingxy/cerebro 1.7.0 → 1.7.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro",
3
- "version": "1.7.0",
3
+ "version": "1.7.1",
4
4
  "description": "Cerebro persistent memory plugin for OpenCode — auto-recall, auto-capture, 9 memory tools with clustering",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/index.ts CHANGED
@@ -32,8 +32,9 @@ export function setAutoStoreEnabled(sessionId: string, enabled: boolean): void {
32
32
  autoStoreSessions.set(sessionId, enabled);
33
33
  }
34
34
 
35
- // Bridge for TUI plugin (same process, different module graph)
36
- (globalThis as any).__cerebro_autoStore = isAutoStoreEnabled;
35
+ // Bridge for TUI plugin: expose the Map directly so TUI can query with its own sessionID
36
+ // (tool sessionId and TUI sessionID may differ in format)
37
+ (globalThis as any).__cerebro_autoStoreMap = autoStoreSessions;
37
38
 
38
39
  function showToast(tui: any, title: string, message?: string, variant: string = "info", duration: number = 5000) {
39
40
  if (!tui) return;
package/src/tui.tsx CHANGED
@@ -13,24 +13,26 @@ function SidebarContentView(props: {
13
13
  const [autoStore, setAutoStore] = createSignal(true);
14
14
  const theme = () => props.api.theme.current;
15
15
 
16
+ const readAutoStore = () => (globalThis as any).__cerebro_autoStoreMap?.get(props.sessionID) ?? true;
17
+
16
18
  const unsubscribers = [
17
19
  props.api.event.on("session.updated", () => {
18
- setAutoStore(globalThis.__cerebro_autoStore?.(props.sessionID) ?? true);
20
+ setAutoStore(readAutoStore());
19
21
  }),
20
22
  props.api.event.on("tui.session.select", (event) => {
21
23
  if (event.properties?.sessionID === props.sessionID) {
22
- setAutoStore(globalThis.__cerebro_autoStore?.(props.sessionID) ?? true);
24
+ setAutoStore(readAutoStore());
23
25
  }
24
26
  }),
25
27
  ];
26
28
 
27
29
  createEffect(() => {
28
30
  props.sessionID;
29
- setAutoStore(globalThis.__cerebro_autoStore?.(props.sessionID) ?? true);
31
+ setAutoStore(readAutoStore());
30
32
  });
31
33
 
32
34
  const interval = setInterval(() => {
33
- setAutoStore(globalThis.__cerebro_autoStore?.(props.sessionID) ?? true);
35
+ setAutoStore(readAutoStore());
34
36
  }, 2000);
35
37
 
36
38
  onCleanup(() => {