fix: sync cache on install, copy all hook files to live 0.1.0 cache

install.sh now copies hooks-handlers/*.py and hooks.json into the live
cache dir after symlinking — ensures edits take effect in the running
session without a CC restart for hook scripts, and on next session start
for hooks.json changes.

Also manually synced 0.1.0 cache to unblock current session:
- post-tool-use.py: find_catalog + already-owned spawn guard
- user-prompt-submit.py: null buddymon_id fallback
- roster-stop.py: reads roster_output.txt (no recursive CLI call)
- hooks.json: roster-stop.py Stop hook entry
This commit is contained in:
pyr0ball 2026-04-12 19:28:59 -07:00
parent 67e47de7ca
commit 1edbfb9007

View file

@ -290,6 +290,16 @@ PYEOF
cp "${REPO_DIR}/lib/catalog.json" "${BUDDYMON_DIR}/catalog.json" cp "${REPO_DIR}/lib/catalog.json" "${BUDDYMON_DIR}/catalog.json"
ok "Installed catalog.json → ${BUDDYMON_DIR}/catalog.json" ok "Installed catalog.json → ${BUDDYMON_DIR}/catalog.json"
# Sync hooks-handlers and hooks.json into the live cache so edits take effect
# without waiting for a CC plugin-cache refresh. CC re-reads hook scripts on
# every invocation but only reads hooks.json at session start.
if [[ -d "${CACHE_DIR}/hooks-handlers" ]]; then
cp "${REPO_DIR}/hooks-handlers/"*.py "${CACHE_DIR}/hooks-handlers/"
cp "${REPO_DIR}/hooks-handlers/"*.sh "${CACHE_DIR}/hooks-handlers/" 2>/dev/null || true
cp "${REPO_DIR}/hooks/hooks.json" "${CACHE_DIR}/hooks/hooks.json"
ok "Synced hooks-handlers + hooks.json → ${CACHE_DIR}/"
fi
# Install statusline into settings.json if not already configured # Install statusline into settings.json if not already configured
python3 << PYEOF python3 << PYEOF
import json import json