@quantiya/codevibe-antigravity-plugin 2.0.63 → 2.0.65
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.
- package/README.md +15 -0
- package/antigravity-plugin.json +1 -1
- package/dist/agy-hook.js +247 -0
- package/dist/installer-cli.js +227 -35
- package/dist/server.js +1256 -84
- package/libexec/agy-hook.sh +27 -0
- package/libexec/companion-launcher +29 -8
- package/package.json +3 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
#
|
|
3
|
+
# CodeVibe hook launcher for Antigravity CLI (agy), registered in the global
|
|
4
|
+
# ~/.gemini/config/hooks.json for PreInvocation and PostToolUse (F1).
|
|
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
|
|
8
|
+
# CODEVIBE_AGY_HOOK_OWNER inline in its tmux command), it does nothing else.
|
|
9
|
+
#
|
|
10
|
+
# Usage (from hooks.json): '<this file>' PreInvocation | PostToolUse
|
|
11
|
+
|
|
12
|
+
case "${CODEVIBE_AGY_HOOK_OWNER:-}" in
|
|
13
|
+
''|*[!0-9]*)
|
|
14
|
+
cat >/dev/null 2>&1
|
|
15
|
+
printf '{}'
|
|
16
|
+
exit 0
|
|
17
|
+
;;
|
|
18
|
+
esac
|
|
19
|
+
|
|
20
|
+
hook_dir=$(dirname "$0")
|
|
21
|
+
node_bin="${CODEVIBE_AGY_HOOK_NODE:-node}"
|
|
22
|
+
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"
|
|
24
|
+
fi
|
|
25
|
+
cat >/dev/null 2>&1
|
|
26
|
+
printf '{}'
|
|
27
|
+
exit 0
|
|
@@ -11,9 +11,14 @@
|
|
|
11
11
|
# (P42, 2026-09-09: a registered entry made agy spawn a second, argument-
|
|
12
12
|
# less daemon every few minutes; the daemon is launched by this launcher only).
|
|
13
13
|
#
|
|
14
|
+
# The same installer step registers the agy session hooks (F1,
|
|
15
|
+
# 2026-10-08): hook files in ~/.codevibe/codevibe-agy/hooks/ and a
|
|
16
|
+
# `codevibe-antigravity` entry in ~/.gemini/config/hooks.json. Non-fatal.
|
|
17
|
+
#
|
|
14
18
|
# 2. Generate ephemeral port + bearer token; create runtime dir at
|
|
15
|
-
# ~/.
|
|
16
|
-
#
|
|
19
|
+
# ~/.codevibe/codevibe-agy/runtime/$$ with mode 0700. (Before F1 it lived
|
|
20
|
+
# inside the plugin install dir, which the installer swaps — and deletes —
|
|
21
|
+
# on every version change, taking running sessions' conn.json with it.)
|
|
17
22
|
#
|
|
18
23
|
# 3. Create tmux session `codevibe-agy-$$` FIRST. Inside the tmux
|
|
19
24
|
# session, a holding loop polls `<runtime-dir>/conn.json` (the
|
|
@@ -328,12 +333,18 @@ if ! [[ "$MCP_PORT" =~ ^[0-9]+$ ]]; then
|
|
|
328
333
|
exit 1
|
|
329
334
|
fi
|
|
330
335
|
|
|
331
|
-
# Runtime dir at ~/.
|
|
332
|
-
#
|
|
333
|
-
|
|
336
|
+
# Runtime dir at ~/.codevibe/codevibe-agy/runtime/$$ with mode 0700. mkdir -p
|
|
337
|
+
# first, then chmod (umask may have made it 0755). Must equal runtimeBaseDir()
|
|
338
|
+
# in src/agy-hook-paths.ts: agy-hook.js finds conn.json there, and daemons read
|
|
339
|
+
# each other's claims.json there (contract-tested).
|
|
340
|
+
RUNTIME_BASE="$HOME/.codevibe/codevibe-agy/runtime"
|
|
334
341
|
RUNTIME_DIR="${RUNTIME_BASE}/${WRAPPER_PID}"
|
|
335
342
|
mkdir -p "$RUNTIME_DIR"
|
|
336
343
|
chmod 0700 "$RUNTIME_DIR" 2>/dev/null || true
|
|
344
|
+
# A crashed earlier launch with the same pid may have left these behind. A
|
|
345
|
+
# stale conn.json would end the inner script's readiness wait early, and a
|
|
346
|
+
# stale claims.json names conversations this launch does not own.
|
|
347
|
+
rm -f "$RUNTIME_DIR/conn.json" "$RUNTIME_DIR/claims.json"
|
|
337
348
|
# Also tighten the runtime base — best-effort, no fatal on failure.
|
|
338
349
|
chmod 0700 "$RUNTIME_BASE" 2>/dev/null || true
|
|
339
350
|
|
|
@@ -469,15 +480,23 @@ escaped_bin="$(escape_sq "$_CV_AGY_BIN")"
|
|
|
469
480
|
escaped_exit_file="$(escape_sq "$_CV_AGY_EXIT_FILE")"
|
|
470
481
|
escaped_conn_file="$(escape_sq "$RUNTIME_DIR/conn.json")"
|
|
471
482
|
escaped_mcp_log="$(escape_sq "$MCP_LOG_FILE")"
|
|
483
|
+
escaped_node_bin="$(escape_sq "$(command -v node)")"
|
|
472
484
|
AGY_CMD="'$escaped_bin'"
|
|
473
485
|
for arg in "$@"; do
|
|
474
486
|
escaped_arg="$(escape_sq "$arg")"
|
|
475
487
|
AGY_CMD="$AGY_CMD '$escaped_arg'"
|
|
476
488
|
done
|
|
477
489
|
|
|
478
|
-
# Inner script: wait for MCP readiness → run agy → record exit code.
|
|
479
|
-
#
|
|
480
|
-
#
|
|
490
|
+
# Inner script: wait for MCP readiness → run agy → record exit code. No
|
|
491
|
+
# secrets in the inner argv. A session on an ALREADY-RUNNING tmux server gets
|
|
492
|
+
# that server's environment, not ours (F1 Spike 3a), so anything agy must see
|
|
493
|
+
# from THIS launch is exported here, inline.
|
|
494
|
+
#
|
|
495
|
+
# CODEVIBE_AGY_HOOK_OWNER names this launch's runtime dir to agy-hook.js, which
|
|
496
|
+
# finds the daemon's conn.json through it. It is deliberately a name this
|
|
497
|
+
# launcher never exports globally: CODEVIBE_AGY_WRAPPER_PID is, so a tmux
|
|
498
|
+
# server started by a CodeVibe launch keeps it and would hand it to an
|
|
499
|
+
# unrelated agy in another window — whose hooks would then report to us.
|
|
481
500
|
INNER_SCRIPT="
|
|
482
501
|
i=0
|
|
483
502
|
while [ \$i -lt 100 ] && [ ! -f '$escaped_conn_file' ]; do
|
|
@@ -489,6 +508,8 @@ if [ ! -f '$escaped_conn_file' ]; then
|
|
|
489
508
|
echo 'CodeVibe Antigravity Companion: see $escaped_mcp_log for details.' >&2
|
|
490
509
|
fi
|
|
491
510
|
export ENVIRONMENT='$ENVIRONMENT'
|
|
511
|
+
export CODEVIBE_AGY_HOOK_OWNER='$WRAPPER_PID'
|
|
512
|
+
export CODEVIBE_AGY_HOOK_NODE='$escaped_node_bin'
|
|
492
513
|
$AGY_CMD
|
|
493
514
|
printf '%s' \"\$?\" > '$escaped_exit_file'
|
|
494
515
|
exit"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quantiya/codevibe-antigravity-plugin",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.65",
|
|
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": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"typecheck": "tsc --noEmit",
|
|
18
|
-
"build": "rm -rf dist && npm run typecheck && esbuild src/server.ts src/installer-cli.ts --bundle --platform=node --target=node18 --packages=external --outdir=dist",
|
|
18
|
+
"build": "rm -rf dist && npm run typecheck && esbuild src/server.ts src/installer-cli.ts src/agy-hook.ts --bundle --platform=node --target=node18 --packages=external --outdir=dist",
|
|
19
19
|
"prepack": "npm run build",
|
|
20
20
|
"postpack": "echo '[codevibe-antigravity-plugin] postpack: noop'",
|
|
21
21
|
"test": "jest --config jest.config.js --forceExit"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"node": ">=22.0.0"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@quantiya/codevibe-core": "^2.0.
|
|
49
|
+
"@quantiya/codevibe-core": "^2.0.60",
|
|
50
50
|
"chokidar": "^5.0.0",
|
|
51
51
|
"dotenv": "^16.6.1",
|
|
52
52
|
"express": "^5.1.0",
|