agent-relay-plugin 0.4.32 → 0.4.33
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/hooks/approval-gate.sh
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Agent Relay plugin — approval gate for PreToolUse and PermissionDenied hooks.
|
|
3
3
|
# Enforces AGENT_RELAY_APPROVAL/profile approval policy: open (default), guarded, read-only.
|
|
4
4
|
|
|
5
|
+
if [ "${AGENT_RELAY_DISABLED:-}" = "1" ]; then
|
|
6
|
+
exit 0
|
|
7
|
+
fi
|
|
8
|
+
|
|
5
9
|
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
6
10
|
source "${script_dir}/profile-lib.sh"
|
|
7
11
|
project=$(basename "${PWD:-unknown}")
|
package/hooks/poll-inbox.sh
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
# Each new message prints one stdout line (consumed by Monitor as a notification).
|
|
4
4
|
# Usage: poll-inbox.sh <relay-url> <agent-id> [interval-seconds]
|
|
5
5
|
|
|
6
|
+
if [ "${AGENT_RELAY_DISABLED:-}" = "1" ]; then
|
|
7
|
+
exit 0
|
|
8
|
+
fi
|
|
9
|
+
|
|
6
10
|
RELAY_URL="$1"
|
|
7
11
|
AGENT_ID="$2"
|
|
8
12
|
INTERVAL="${3:-10}"
|
|
@@ -88,6 +92,11 @@ marked_ready=false
|
|
|
88
92
|
# Save parent PID (Claude Code wrapper) — if it dies, we're orphaned.
|
|
89
93
|
_parent_pid="$PPID"
|
|
90
94
|
while true; do
|
|
95
|
+
if [ "${AGENT_RELAY_DISABLED:-}" = "1" ]; then
|
|
96
|
+
set_status "offline"
|
|
97
|
+
exit 0
|
|
98
|
+
fi
|
|
99
|
+
|
|
91
100
|
# Exit if parent process is gone — prevents orphaned monitors from heartbeating forever.
|
|
92
101
|
if ! kill -0 "$_parent_pid" 2>/dev/null; then
|
|
93
102
|
set_status "offline"
|
package/hooks/relay-monitor.sh
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
# Runs automatically via monitors.json — no user interaction required.
|
|
5
5
|
# CLAUDE_CODE_SESSION_ID = stable session key for state file coordination between monitor and hooks.
|
|
6
6
|
|
|
7
|
+
if [ "${AGENT_RELAY_DISABLED:-}" = "1" ]; then
|
|
8
|
+
exit 0
|
|
9
|
+
fi
|
|
10
|
+
|
|
7
11
|
RELAY_URL="${AGENT_RELAY_URL:-http://localhost:4850}"
|
|
8
12
|
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
|
9
13
|
source "${script_dir}/profile-lib.sh"
|
package/hooks/session-end.sh
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
# Agent Relay plugin — SessionEnd hook
|
|
3
3
|
# Marks this session's agent as offline using state file written by relay-monitor.
|
|
4
4
|
|
|
5
|
+
if [ "${AGENT_RELAY_DISABLED:-}" = "1" ]; then
|
|
6
|
+
exit 0
|
|
7
|
+
fi
|
|
8
|
+
|
|
5
9
|
RELAY_URL="${AGENT_RELAY_URL:-http://localhost:4850}"
|
|
6
10
|
auth_header_args=()
|
|
7
11
|
if [ -n "${AGENT_RELAY_TOKEN:-}" ]; then
|
package/hooks/set-status.sh
CHANGED
package/package.json
CHANGED