|
|
@@ -73,14 +73,41 @@ fi
|
|
|
cd "$REPO_PATH" || exit 1
|
|
|
echo "Working directory: $(pwd)"
|
|
|
|
|
|
+# Load AGENT_MANAGER_PATH from project .env file
|
|
|
+# Try multiple possible locations for the agent-manager .env file
|
|
|
+AGENT_MANAGER_ENV_PATHS=(
|
|
|
+ "/home/claude/agent-manager/.env"
|
|
|
+ "/data/agent-manager/.env"
|
|
|
+ "$HOME/agent-manager/.env"
|
|
|
+)
|
|
|
+
|
|
|
+AGENT_MANAGER_PATH=""
|
|
|
+for ENV_PATH in "${AGENT_MANAGER_ENV_PATHS[@]}"; do
|
|
|
+ if [ -f "$ENV_PATH" ]; then
|
|
|
+ # Load AGENT_MANAGER_PATH from .env if it exists
|
|
|
+ AGENT_MANAGER_PATH=$(grep -E "^AGENT_MANAGER_PATH=" "$ENV_PATH" | cut -d '=' -f2-)
|
|
|
+ if [ -n "$AGENT_MANAGER_PATH" ]; then
|
|
|
+ echo "Loaded AGENT_MANAGER_PATH from: $ENV_PATH"
|
|
|
+ break
|
|
|
+ fi
|
|
|
+ fi
|
|
|
+done
|
|
|
+
|
|
|
+# Fallback: try to detect from script location
|
|
|
+if [ -z "$AGENT_MANAGER_PATH" ]; then
|
|
|
+ # Get the directory where this script is located
|
|
|
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
+ # Go up one level from scripts/ to get agent-manager root
|
|
|
+ AGENT_MANAGER_PATH="$(dirname "$SCRIPT_DIR")"
|
|
|
+ echo "Using detected path from script location: $AGENT_MANAGER_PATH"
|
|
|
+fi
|
|
|
+
|
|
|
echo "Calling Claude Agent SDK TypeScript client..."
|
|
|
+echo "Agent Manager Path: $AGENT_MANAGER_PATH"
|
|
|
echo "---"
|
|
|
|
|
|
-# Get the path to the agent-manager directory
|
|
|
-AGENT_MANAGER_DIR="/data/agent-manager"
|
|
|
-
|
|
|
# Call the TypeScript client
|
|
|
-node "$AGENT_MANAGER_DIR/client/dist/index.js" \
|
|
|
+node "$AGENT_MANAGER_PATH/client/dist/index.js" \
|
|
|
"$OWNER" \
|
|
|
"$REPO" \
|
|
|
"$PUSHER" \
|