@quantiya/codevibe-antigravity-plugin 2.0.83 → 2.0.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,29 @@
1
1
  #!/bin/sh
2
2
  #
3
3
  # CodeVibe hook launcher for Antigravity CLI (agy), registered in the global
4
- # ~/.gemini/config/hooks.json for PreInvocation and PostToolUse (F1).
4
+ # ~/.gemini/config/hooks.json for PreInvocation, PostToolUse, PreToolUse, and Stop (F1).
5
5
  #
6
- # Every agy process on this machine runs it, so it must stay cheap and must
7
- # always print `{}`. Unless the CodeVibe launcher started this agy (which sets
6
+ # Every agy process on this machine runs it, so it must stay cheap.
7
+ # For PreInvocation and PostToolUse it prints `{}`.
8
+ # For PreToolUse it prints `{"decision":"allow"}` so agy proceeds with the tool.
9
+ # For Stop it prints `{"decision":"stop"}` to acknowledge turn termination.
10
+ # Unless the CodeVibe launcher started this agy (which sets
8
11
  # CODEVIBE_AGY_HOOK_OWNER inline in its tmux command), it does nothing else.
9
12
  #
10
- # Usage (from hooks.json): '<this file>' PreInvocation | PostToolUse
13
+ # Usage (from hooks.json): '<this file>' PreInvocation | PostToolUse | PreToolUse | Stop
14
+
15
+ if [ "$1" = "PreToolUse" ]; then
16
+ DEFAULT_RESP='{"decision":"allow"}'
17
+ elif [ "$1" = "Stop" ]; then
18
+ DEFAULT_RESP='{"decision":"stop"}'
19
+ else
20
+ DEFAULT_RESP='{}'
21
+ fi
11
22
 
12
23
  case "${CODEVIBE_AGY_HOOK_OWNER:-}" in
13
24
  ''|*[!0-9]*)
14
25
  cat >/dev/null 2>&1
15
- printf '{}'
26
+ printf '%s' "$DEFAULT_RESP"
16
27
  exit 0
17
28
  ;;
18
29
  esac
@@ -20,8 +31,13 @@ esac
20
31
  hook_dir=$(dirname "$0")
21
32
  node_bin="${CODEVIBE_AGY_HOOK_NODE:-node}"
22
33
  if [ -f "$hook_dir/agy-hook.js" ] && command -v "$node_bin" >/dev/null 2>&1; then
23
- exec "$node_bin" "$hook_dir/agy-hook.js" "$1"
34
+ out=$("$node_bin" "$hook_dir/agy-hook.js" "$1" 2>/dev/null)
35
+ rc=$?
36
+ if [ $rc -eq 0 ] && [ -n "$out" ]; then
37
+ printf '%s' "$out"
38
+ exit 0
39
+ fi
24
40
  fi
25
41
  cat >/dev/null 2>&1
26
- printf '{}'
42
+ printf '%s' "$DEFAULT_RESP"
27
43
  exit 0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-antigravity-plugin",
3
- "version": "2.0.83",
3
+ "version": "2.0.85",
4
4
  "description": "Control Antigravity CLI from your iPhone and Android — real-time sync, approve file edits, send prompts by voice. Part of CodeVibe.",
5
5
  "main": "dist/server.js",
6
6
  "codevibe": {
@@ -46,7 +46,7 @@
46
46
  "node": ">=22.0.0"
47
47
  },
48
48
  "dependencies": {
49
- "@quantiya/codevibe-core": "^2.0.74",
49
+ "@quantiya/codevibe-core": "^2.0.75",
50
50
  "chokidar": "^5.0.0",
51
51
  "dotenv": "^16.6.1",
52
52
  "express": "^5.1.0",