@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.
- package/.claude-plugin/marketplace.json +0 -0
- package/.claude-plugin/plugin.json +1 -1
- package/.mcp.json +0 -0
- package/README.md +0 -0
- package/config.json +0 -0
- package/hooks/apply-dream.mjs +0 -0
- package/hooks/common.mjs +18 -1
- package/hooks/common.sh +0 -0
- package/hooks/dream.mjs +0 -0
- package/hooks/flush-detached.mjs +0 -0
- package/hooks/hooks.json +0 -0
- package/hooks/post-compact.mjs +0 -0
- package/hooks/pre-compact.mjs +0 -0
- package/hooks/recall-approve.mjs +0 -0
- package/hooks/session-end.mjs +0 -0
- package/hooks/session-start.mjs +0 -0
- package/hooks/stop.mjs +0 -0
- package/hooks/user-prompt-submit.mjs +0 -0
- package/package.json +1 -1
- package/scripts/memory-profile.sh +0 -0
- package/scripts/memory-save.sh +0 -0
- package/scripts/memory-search.sh +0 -0
- package/scripts/web-server.mjs +0 -0
- package/skills/apply-dream/SKILL.md +0 -0
- package/skills/dream/SKILL.md +0 -0
- package/skills/memory-profile/SKILL.md +0 -0
- package/skills/memory-save/SKILL.md +0 -0
- package/skills/memory-search/SKILL.md +0 -0
- package/tests/common.test.mjs +0 -0
- package/tests/hooks.test.mjs +0 -0
- package/tests/test_smoke.sh +0 -0
- package/web/assets/geist-cyrillic-wght-normal-CHSlOQsW.woff2 +0 -0
- package/web/assets/geist-latin-ext-wght-normal-DMtmJ5ZE.woff2 +0 -0
- package/web/assets/geist-latin-wght-normal-Dm3htQBi.woff2 +0 -0
- package/web/assets/index-BITUpTtU.js +0 -0
- package/web/assets/index-DVguCuEA.css +0 -0
- package/web/assets/index-zOJZZn-i.js +0 -0
- package/web/favicon.svg +0 -0
- package/web/icons.svg +0 -0
- package/web/index.html +0 -0
|
File without changes
|
package/.mcp.json
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
package/config.json
CHANGED
|
File without changes
|
package/hooks/apply-dream.mjs
CHANGED
|
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(
|
|
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
|
package/hooks/flush-detached.mjs
CHANGED
|
File without changes
|
package/hooks/hooks.json
CHANGED
|
File without changes
|
package/hooks/post-compact.mjs
CHANGED
|
File without changes
|
package/hooks/pre-compact.mjs
CHANGED
|
File without changes
|
package/hooks/recall-approve.mjs
CHANGED
|
File without changes
|
package/hooks/session-end.mjs
CHANGED
|
File without changes
|
package/hooks/session-start.mjs
CHANGED
|
File without changes
|
package/hooks/stop.mjs
CHANGED
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
File without changes
|
package/scripts/memory-save.sh
CHANGED
|
File without changes
|
package/scripts/memory-search.sh
CHANGED
|
File without changes
|
package/scripts/web-server.mjs
CHANGED
|
File without changes
|
|
File without changes
|
package/skills/dream/SKILL.md
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/tests/common.test.mjs
CHANGED
|
File without changes
|
package/tests/hooks.test.mjs
CHANGED
|
File without changes
|
package/tests/test_smoke.sh
CHANGED
|
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
|