Refactor: Update stderr-test-hook to user-message-hook and improve path handling
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "command",
|
"type": "command",
|
||||||
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/stderr-test-hook.js",
|
"command": "node ${CLAUDE_PLUGIN_ROOT}/scripts/user-message-hook.js",
|
||||||
"timeout": 10
|
"timeout": 10
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
import{execSync as e}from"child_process";try{let o=e("node ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/context-hook.js --colors",{encoding:"utf8"});console.error(`
|
import{execSync as e}from"child_process";import{join as r}from"path";import{homedir as n}from"os";try{let o=r(n(),".claude","plugins","marketplaces","thedotmack","plugin","scripts","context-hook.js"),t=e(`node "${o}" --colors`,{encoding:"utf8"});console.error(`
|
||||||
|
|
||||||
\u{1F4DD} Claude-Mem Context Loaded
|
\u{1F4DD} Claude-Mem Context Loaded
|
||||||
\u2139\uFE0F Note: This appears as stderr but is informational only
|
\u2139\uFE0F Note: This appears as stderr but is informational only
|
||||||
|
|
||||||
`+o)}catch(o){console.error(`\u274C Failed to load context display: ${o}`)}process.exit(3);
|
`+t)}catch(o){console.error(`\u274C Failed to load context display: ${o}`)}process.exit(3);
|
||||||
|
|||||||
@@ -7,9 +7,13 @@
|
|||||||
* since it's currently the only way to display messages in Claude Code UI.
|
* since it's currently the only way to display messages in Claude Code UI.
|
||||||
*/
|
*/
|
||||||
import { execSync } from "child_process";
|
import { execSync } from "child_process";
|
||||||
|
import { join } from "path";
|
||||||
|
import { homedir } from "os";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const output = execSync("node ~/.claude/plugins/marketplaces/thedotmack/plugin/scripts/context-hook.js --colors", {
|
// Cross-platform path to context-hook.js in the installed plugin
|
||||||
|
const contextHookPath = join(homedir(), '.claude', 'plugins', 'marketplaces', 'thedotmack', 'plugin', 'scripts', 'context-hook.js');
|
||||||
|
const output = execSync(`node "${contextHookPath}" --colors`, {
|
||||||
encoding: 'utf8'
|
encoding: 'utf8'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user