@quantiya/codevibe-gemini-plugin 1.0.14 → 1.0.16

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.
Files changed (2) hide show
  1. package/bin/codevibe-gemini +31 -13
  2. package/package.json +2 -2
@@ -78,23 +78,41 @@ configure_hooks_if_needed() {
78
78
  mkdir -p "$GEMINI_SETTINGS_DIR"
79
79
 
80
80
  # Check if hooks need to be configured
81
+ # Guard: if template is missing, skip auto-configure entirely
82
+ if [ ! -f "$TEMPLATE_FILE" ]; then
83
+ echo "⚠ Hooks template not found at: $TEMPLATE_FILE"
84
+ echo " Try: npm install -g @quantiya/codevibe@latest"
85
+ return
86
+ fi
87
+
81
88
  if [ ! -f "$GEMINI_SETTINGS_FILE" ]; then
82
- # No settings file - create it with hooks
89
+ # No settings file create from template
83
90
  echo "Configuring Gemini CLI hooks for CodeVibe..."
84
91
  sed "s|__CODEVIBE_HOOKS_DIR__|$HOOKS_DIR|g" "$TEMPLATE_FILE" > "$GEMINI_SETTINGS_FILE"
85
92
  echo "✓ Hooks configured at: $GEMINI_SETTINGS_FILE"
86
- elif ! grep -q "BeforeAgent" "$GEMINI_SETTINGS_FILE" 2>/dev/null; then
87
- # Settings file exists but missing agent hooks - warn user to upgrade
88
- echo " Gemini CLI hooks need updating. BeforeAgent/AfterAgent hooks required."
89
- echo " Update hooks in: $GEMINI_SETTINGS_FILE"
90
- echo " Or delete the file and restart to auto-configure."
91
- echo ""
92
- elif ! grep -q "BeforeTool" "$GEMINI_SETTINGS_FILE" 2>/dev/null; then
93
- # Settings file exists but no tool hooks - warn user
94
- echo "⚠ Gemini CLI hooks not fully configured."
95
- echo " To enable interactive prompts from mobile, add hooks to:"
96
- echo " $GEMINI_SETTINGS_FILE"
97
- echo ""
93
+ elif ! grep -q "codevibe" "$GEMINI_SETTINGS_FILE" 2>/dev/null; then
94
+ # Settings exists but no CodeVibe hooks present append ours
95
+ echo "Adding CodeVibe hooks to Gemini CLI settings..."
96
+ if command -v jq >/dev/null 2>&1; then
97
+ HOOKS_JSON=$(sed "s|__CODEVIBE_HOOKS_DIR__|$HOOKS_DIR|g" "$TEMPLATE_FILE")
98
+ # Append CodeVibe hook entries to each hook array, preserving existing user hooks
99
+ jq -s '
100
+ .[0] as $existing | .[1] as $new |
101
+ $existing | .hooks = (
102
+ ($existing.hooks // {}) as $eh |
103
+ ($new.hooks // {}) as $nh |
104
+ ($eh | keys) + ($nh | keys) | unique | map(
105
+ { (.) : (($eh[.] // []) + ($nh[.] // [])) }
106
+ ) | add // {}
107
+ )
108
+ ' "$GEMINI_SETTINGS_FILE" <(echo "$HOOKS_JSON") > "${GEMINI_SETTINGS_FILE}.tmp" && \
109
+ mv "${GEMINI_SETTINGS_FILE}.tmp" "$GEMINI_SETTINGS_FILE" && \
110
+ echo "✓ CodeVibe hooks added to: $GEMINI_SETTINGS_FILE" || \
111
+ echo "⚠ Failed to add hooks. Delete $GEMINI_SETTINGS_FILE and restart to auto-configure."
112
+ else
113
+ echo "⚠ jq not found — cannot add hooks to existing settings."
114
+ echo " Delete $GEMINI_SETTINGS_FILE and restart to auto-configure."
115
+ fi
98
116
  fi
99
117
  }
100
118
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quantiya/codevibe-gemini-plugin",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "description": "Control Gemini 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
  "bin": {
@@ -49,7 +49,7 @@
49
49
  "node": ">=18.0.0"
50
50
  },
51
51
  "dependencies": {
52
- "@quantiya/codevibe-core": "^1.0.11",
52
+ "@quantiya/codevibe-core": "^1.0.13",
53
53
  "chokidar": "^5.0.0",
54
54
  "dotenv": "^16.6.1",
55
55
  "express": "^5.1.0",