-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·80 lines (66 loc) · 2.57 KB
/
install.sh
File metadata and controls
executable file
·80 lines (66 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/bin/bash
# Install the Facebook Pages plugin into an Agent Zero instance.
#
# Usage:
# ./install.sh # Auto-detect Agent Zero root
# ./install.sh /path/to/agent-zero # Install to specified path
set -eu
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -n "${1:-}" ]; then
A0_ROOT="$1"
elif [ -d "/a0/plugins" ]; then
A0_ROOT="/a0"
elif [ -d "/git/agent-zero/plugins" ]; then
A0_ROOT="/git/agent-zero"
else
echo "Error: Cannot find Agent Zero. Pass the path as argument."
exit 1
fi
PLUGIN_DIR="$A0_ROOT/usr/plugins/facebook"
echo "=== Facebook Pages Plugin Installer ==="
echo "Source: $SCRIPT_DIR"
echo "Target: $PLUGIN_DIR"
echo ""
mkdir -p "$PLUGIN_DIR"
# Copy plugin files (skip if already installed in-place, e.g. via A0 plugin installer)
if [ "$(realpath "$SCRIPT_DIR")" != "$(realpath "$PLUGIN_DIR")" ]; then
echo "Copying plugin files..."
cp -r "$SCRIPT_DIR/plugin.yaml" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/default_config.yaml" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/initialize.py" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/helpers" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/tools" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/prompts" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/api" "$PLUGIN_DIR/"
cp -r "$SCRIPT_DIR/webui" "$PLUGIN_DIR/"
[ -d "$SCRIPT_DIR/extensions" ] && cp -r "$SCRIPT_DIR/extensions" "$PLUGIN_DIR/"
[ -d "$SCRIPT_DIR/docs" ] && cp -r "$SCRIPT_DIR/docs" "$PLUGIN_DIR/"
[ -f "$SCRIPT_DIR/README.md" ] && cp "$SCRIPT_DIR/README.md" "$PLUGIN_DIR/"
[ -f "$SCRIPT_DIR/LICENSE" ] && cp "$SCRIPT_DIR/LICENSE" "$PLUGIN_DIR/"
else
echo "Files already in place (installed via plugin manager), skipping copy..."
fi
mkdir -p "$PLUGIN_DIR/data"
chmod 700 "$PLUGIN_DIR/data"
SKILLS_DIR="$A0_ROOT/usr/skills"
echo "Copying skills..."
for skill_dir in "$SCRIPT_DIR/skills"/*/; do
skill_name="$(basename "$skill_dir")"
mkdir -p "$SKILLS_DIR/$skill_name"
cp -r "$skill_dir"* "$SKILLS_DIR/$skill_name/"
done
echo "Installing dependencies..."
python3 "$PLUGIN_DIR/initialize.py" || python "$PLUGIN_DIR/initialize.py"
touch "$PLUGIN_DIR/.toggle-1"
if [ "$A0_ROOT" = "/a0" ] && [ -d "/git/agent-zero/usr" ]; then
GIT_PLUGIN="/git/agent-zero/usr/plugins/facebook"
mkdir -p "$(dirname "$GIT_PLUGIN")"
cp -r "$PLUGIN_DIR" "$GIT_PLUGIN" 2>/dev/null || true
fi
echo ""
echo "=== Installation complete ==="
echo "Plugin installed to: $PLUGIN_DIR"
echo ""
echo "Next steps:"
echo " 1. Configure credentials in the Facebook Pages plugin settings (WebUI)"
echo " 2. Restart Agent Zero to load the plugin"