feat: add optional permission notification hook for AFK mode
Added optional hook that sends Telegram notifications when Claude requests tool permissions, solving the issue where users in AFK mode don't get notified about pending permission prompts. Features: - Self-contained hook in hooks/PermissionRequest.sh - Easy installation script (scripts/install-hook.sh) - Opt-in per project - users choose where to install - Sends Telegram alert with tool name and description - Shows ⏸️ warning icon for permission requests Installation: Users can now run ./scripts/install-hook.sh from any project to enable permission notifications. The hook integrates with the existing InnerVoice bridge. Documentation: - Added "Optional: Install Permission Notification Hook" section - Includes installation and uninstallation instructions - Example notification message format This keeps InnerVoice self-contained while allowing users to opt-in to enhanced AFK mode notifications. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
38
scripts/install-hook.sh
Executable file
38
scripts/install-hook.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# Install the InnerVoice permission notification hook in a project
|
||||
|
||||
set -e
|
||||
|
||||
HOOK_NAME="PermissionRequest.sh"
|
||||
INNERVOICE_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
SOURCE_HOOK="$INNERVOICE_DIR/hooks/$HOOK_NAME"
|
||||
|
||||
# Get target project directory (default to current directory)
|
||||
TARGET_DIR="${1:-.}"
|
||||
TARGET_HOOK_DIR="$TARGET_DIR/.claude/hooks"
|
||||
|
||||
echo "📦 Installing InnerVoice Permission Notification Hook"
|
||||
echo ""
|
||||
echo "Source: $SOURCE_HOOK"
|
||||
echo "Target: $TARGET_HOOK_DIR/$HOOK_NAME"
|
||||
echo ""
|
||||
|
||||
# Validate source hook exists
|
||||
if [ ! -f "$SOURCE_HOOK" ]; then
|
||||
echo "❌ Error: Source hook not found at $SOURCE_HOOK"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create target directory if needed
|
||||
mkdir -p "$TARGET_HOOK_DIR"
|
||||
|
||||
# Copy the hook
|
||||
cp "$SOURCE_HOOK" "$TARGET_HOOK_DIR/$HOOK_NAME"
|
||||
chmod +x "$TARGET_HOOK_DIR/$HOOK_NAME"
|
||||
|
||||
echo "✅ Hook installed successfully!"
|
||||
echo ""
|
||||
echo "🔔 Now when you're in AFK mode, you'll get Telegram notifications"
|
||||
echo " whenever Claude requests permission for a tool."
|
||||
echo ""
|
||||
echo "To uninstall: rm $TARGET_HOOK_DIR/$HOOK_NAME"
|
||||
Reference in New Issue
Block a user