fix: use mempalace CLI in top-level hook scripts
hooks/mempal_precompact_hook.sh and hooks/mempal_save_hook.sh used python3 -m mempalace mine which fails when mempalace is installed via pipx or uv. Switch to the mempalace CLI entry point which pipx/uv put on PATH. Also removes the now-unused PYTHON variable from mempal_save_hook.sh. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
Igor Lins e Silva
parent
be89e49add
commit
67a067701e
@@ -65,7 +65,7 @@ echo "[$(date '+%H:%M:%S')] PRE-COMPACT triggered for session $SESSION_ID" >> "$
|
|||||||
if [ -n "$MEMPAL_DIR" ] && [ -d "$MEMPAL_DIR" ]; then
|
if [ -n "$MEMPAL_DIR" ] && [ -d "$MEMPAL_DIR" ]; then
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
REPO_DIR="$(dirname "$SCRIPT_DIR")"
|
||||||
python3 -m mempalace mine "$MEMPAL_DIR" >> "$STATE_DIR/hook.log" 2>&1
|
mempalace mine "$MEMPAL_DIR" >> "$STATE_DIR/hook.log" 2>&1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Silent: return empty JSON to not block. "decision": "allow" is invalid —
|
# Silent: return empty JSON to not block. "decision": "allow" is invalid —
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ if [ "$SINCE_LAST" -ge "$SAVE_INTERVAL" ] && [ "$EXCHANGE_COUNT" -gt 0 ]; then
|
|||||||
# 1. TRANSCRIPT_PATH (from Claude Code) — mine the directory it lives in
|
# 1. TRANSCRIPT_PATH (from Claude Code) — mine the directory it lives in
|
||||||
# 2. MEMPAL_DIR (user-configured) — mine that directory
|
# 2. MEMPAL_DIR (user-configured) — mine that directory
|
||||||
# At least one should work. If neither is set, nothing mines.
|
# At least one should work. If neither is set, nothing mines.
|
||||||
PYTHON="$(command -v python3)"
|
|
||||||
MINE_DIR=""
|
MINE_DIR=""
|
||||||
if [ -n "$TRANSCRIPT_PATH" ] && [ -f "$TRANSCRIPT_PATH" ]; then
|
if [ -n "$TRANSCRIPT_PATH" ] && [ -f "$TRANSCRIPT_PATH" ]; then
|
||||||
MINE_DIR="$(dirname "$TRANSCRIPT_PATH")"
|
MINE_DIR="$(dirname "$TRANSCRIPT_PATH")"
|
||||||
@@ -153,7 +152,7 @@ if [ "$SINCE_LAST" -ge "$SAVE_INTERVAL" ] && [ "$EXCHANGE_COUNT" -gt 0 ]; then
|
|||||||
MINE_DIR="$MEMPAL_DIR"
|
MINE_DIR="$MEMPAL_DIR"
|
||||||
fi
|
fi
|
||||||
if [ -n "$MINE_DIR" ]; then
|
if [ -n "$MINE_DIR" ]; then
|
||||||
"$PYTHON" -m mempalace mine "$MINE_DIR" >> "$STATE_DIR/hook.log" 2>&1 &
|
mempalace mine "$MINE_DIR" >> "$STATE_DIR/hook.log" 2>&1 &
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# MEMPAL_VERBOSE toggle:
|
# MEMPAL_VERBOSE toggle:
|
||||||
|
|||||||
Reference in New Issue
Block a user