@wipcomputer/wip-ldm-os 0.4.73-alpha.23 → 0.4.73-alpha.24
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
|
@@ -42,6 +42,24 @@ function getAgentId() {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
function getSessionName(input) {
|
|
45
|
+
// 1. Try CC session file for the parent PID.
|
|
46
|
+
// CC writes /rename labels to ~/.claude/sessions/<pid>.json.
|
|
47
|
+
// This hook is spawned fresh each time by CC, so ppid = CC PID.
|
|
48
|
+
// Reading the session file picks up /rename and /resume labels
|
|
49
|
+
// without any env var or restart.
|
|
50
|
+
try {
|
|
51
|
+
const ccSessionPath = join(HOME, '.claude', 'sessions', `${process.ppid}.json`);
|
|
52
|
+
const data = JSON.parse(readFileSync(ccSessionPath, 'utf8'));
|
|
53
|
+
if (data.name && typeof data.name === 'string') {
|
|
54
|
+
return data.name;
|
|
55
|
+
}
|
|
56
|
+
} catch {
|
|
57
|
+
// No session file. Normal for non-CC harnesses.
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// 2. Env var override
|
|
61
|
+
// 3. CWD basename fallback
|
|
62
|
+
// 4. Default
|
|
45
63
|
return (
|
|
46
64
|
process.env.LDM_SESSION_NAME ||
|
|
47
65
|
process.env.CLAUDE_SESSION_NAME ||
|