Files
personal-agent-os/memory-systems/agent-os/.gemini/hooks/protect-system-files-wrapper.sh
T
2026-09-16 00:00:30 -07:00

25 lines
877 B
Bash

#!/usr/bin/env bash
# =============================================================================
# Generated by adapters/gemini-cli/adapter.sh — do not edit.
# Wrapper for hook: protect-system-files
# Reads Gemini CLI native JSON from stdin, translates it into the neutral
# schema, and pipes the result to protect-system-files.sh.
# =============================================================================
set -eo pipefail
INPUT=$(cat)
HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
NEUTRAL=$(echo "$INPUT" | jq -c '{
event: "before-tool-use",
tool: (.tool_name // ""),
args: (.tool_input // {}),
session_id: (env.GEMINI_SESSION_ID // ""),
cwd: (env.GEMINI_CWD // env.GEMINI_PROJECT_DIR // ""),
framework: "gemini-cli",
platform_dir: ".gemini",
dispatcher_name: "GEMINI.md"
}')
echo "$NEUTRAL" | bash "$HOOK_DIR/protect-system-files.sh"