Files
coucou/scripts/test-agy-permissions.sh
Brendon AngandClaude Opus 5.5 128efcb77f Mac: approve Antigravity commands from the notch
Antigravity has no permission-request event: it runs PreToolUse before its
own permission check and waits for the hook's decision. With the new
Settings → Antigravity → Approve commands from the notch (off by default),
a run_command that none of Antigravity's command(...) rules covers waits on
the approval card: Allow prints {"decision":"allow"}, Deny prints "deny",
and Reply in terminal, no click or Coucou closed print "ask" (Antigravity's
own prompt). Coucou never allows a command without a click.

- AgyPermissionRules reads Antigravity's allow and deny rules (CLI settings,
  shared global grants, the session's project), so commands they cover get
  no card. Tested by scripts/test-agy-permissions.sh, added to CI.
- Relay: Antigravity's PreToolUse asks Coucou and reads one line back:
  "ask" at once, or {"pending":true} then the decision. It waits 3 s for the
  first line and 115 s for the click. The shell wrapper answers "ask" when
  Python is missing.
- The PreToolUse hook is installed with a 120 s timeout. Settings asks to
  install again the hooks written with the old 10 s.
- Card: Deny, Allow and Reply in terminal for Antigravity; other agents'
  cards are unchanged.
- Strings in the 14 languages, CHANGELOG, AGENTS.md, SPEC.md, README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:15:57 +08:00

9 lines
333 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "$0")/.."
TEST_DIR="$(mktemp -d "${TMPDIR:-/tmp}/coucou-agy-permissions.XXXXXX")"
trap 'rm -rf "$TEST_DIR"' EXIT
swiftc NotchBuddy/Sources/App/AgyPermissionRules.swift \
tests/AgyPermissionRulesTests.swift -o "$TEST_DIR/agy-permissions-tests"
"$TEST_DIR/agy-permissions-tests"