@mingxy/cerebro-claude-code 0.3.11 → 0.3.12

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 (40) hide show
  1. package/.claude-plugin/marketplace.json +0 -0
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.mcp.json +0 -0
  4. package/README.md +0 -0
  5. package/config.json +0 -0
  6. package/hooks/apply-dream.mjs +0 -0
  7. package/hooks/common.mjs +18 -1
  8. package/hooks/common.sh +0 -0
  9. package/hooks/dream.mjs +0 -0
  10. package/hooks/flush-detached.mjs +0 -0
  11. package/hooks/hooks.json +0 -0
  12. package/hooks/post-compact.mjs +0 -0
  13. package/hooks/pre-compact.mjs +0 -0
  14. package/hooks/recall-approve.mjs +0 -0
  15. package/hooks/session-end.mjs +0 -0
  16. package/hooks/session-start.mjs +0 -0
  17. package/hooks/stop.mjs +0 -0
  18. package/hooks/user-prompt-submit.mjs +0 -0
  19. package/package.json +1 -1
  20. package/scripts/memory-profile.sh +0 -0
  21. package/scripts/memory-save.sh +0 -0
  22. package/scripts/memory-search.sh +0 -0
  23. package/scripts/web-server.mjs +0 -0
  24. package/skills/apply-dream/SKILL.md +0 -0
  25. package/skills/dream/SKILL.md +0 -0
  26. package/skills/memory-profile/SKILL.md +0 -0
  27. package/skills/memory-save/SKILL.md +0 -0
  28. package/skills/memory-search/SKILL.md +0 -0
  29. package/tests/common.test.mjs +0 -0
  30. package/tests/hooks.test.mjs +0 -0
  31. package/tests/test_smoke.sh +0 -0
  32. package/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
  33. package/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
  34. package/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
  35. package/web/assets/index-BITUpTtU.js +0 -0
  36. package/web/assets/index-DVguCuEA.css +0 -0
  37. package/web/assets/index-zOJZZn-i.js +0 -0
  38. package/web/favicon.svg +0 -0
  39. package/web/icons.svg +0 -0
  40. package/web/index.html +0 -0
File without changes
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cerebro",
3
3
  "description": "Persistent memory for Claude Code — memories survive across sessions, projects, and machines",
4
- "version": "0.3.11",
4
+ "version": "0.3.12",
5
5
  "author": {
6
6
  "name": "mingxy-cerebro",
7
7
  "email": "hi@cerebro.dev"
package/.mcp.json CHANGED
File without changes
package/README.md CHANGED
File without changes
package/config.json CHANGED
File without changes
File without changes
package/hooks/common.mjs CHANGED
@@ -231,11 +231,28 @@ function _log(level, msg) {
231
231
  const SESSIONS_DIR = join(HOME, ".config/cerebro/sessions");
232
232
  const WEB_PID_FILE = join(HOME, ".config/cerebro/web-server.pid");
233
233
 
234
+ // CC runs hooks through a bash wrapper — process.ppid is the wrapper, which
235
+ // dies the moment the hook exits. Climb past shells to the CC main process;
236
+ // non-Linux (no /proc) or unclimbable chain falls back to the old behavior.
237
+ function ccMainPid() {
238
+ let pid = process.ppid;
239
+ for (let i = 0; i < 4 && pid > 1; i++) {
240
+ try {
241
+ const comm = readFileSync(`/proc/${pid}/comm`, "utf-8").trim();
242
+ if (!/^(bash|sh|dash|zsh)$/.test(comm)) return pid;
243
+ const m = readFileSync(`/proc/${pid}/status`, "utf-8").match(/^PPid:\s+(\d+)/m);
244
+ if (!m) break;
245
+ pid = parseInt(m[1], 10);
246
+ } catch { break; }
247
+ }
248
+ return process.ppid;
249
+ }
250
+
234
251
  export function writeLive(sid) {
235
252
  if (!sid) return;
236
253
  try {
237
254
  mkdirSync(SESSIONS_DIR, { recursive: true });
238
- writeFileSync(join(SESSIONS_DIR, `${sid}.live`), String(process.ppid));
255
+ writeFileSync(join(SESSIONS_DIR, `${sid}.live`), String(ccMainPid()));
239
256
  } catch {}
240
257
  }
241
258
 
package/hooks/common.sh CHANGED
File without changes
package/hooks/dream.mjs CHANGED
File without changes
File without changes
package/hooks/hooks.json CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/hooks/stop.mjs CHANGED
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mingxy/cerebro-claude-code",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Persistent memory for Claude Code — memories survive across sessions, projects, and machines",
5
5
  "author": {
6
6
  "name": "mingxy-cerebro",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/web/favicon.svg CHANGED
File without changes
package/web/icons.svg CHANGED
File without changes
package/web/index.html CHANGED
File without changes