-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathverify-installation.sh
More file actions
executable file
·282 lines (250 loc) · 8.03 KB
/
verify-installation.sh
File metadata and controls
executable file
·282 lines (250 loc) · 8.03 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
#!/bin/bash
# AI Maestro - Installation Verification Script
# Run this after installation to verify everything works
#
# v0.21.26: Updated to check AMP scripts (post-migration) instead of
# old messaging scripts that were removed by install-plugin.sh.
# Added planning skill check. Fixed runtime tests.
# Don't use set -e - we want to continue on failures
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
PASS=0
FAIL=0
WARN=0
pass() {
echo -e "${GREEN}✓${NC} $1"
PASS=$((PASS + 1))
}
fail() {
echo -e "${RED}✗${NC} $1"
FAIL=$((FAIL + 1))
}
warn() {
echo -e "${YELLOW}⚠${NC} $1"
WARN=$((WARN + 1))
}
echo ""
echo "╔════════════════════════════════════════════════════════════════╗"
echo "║ AI Maestro - Installation Verification ║"
echo "╚════════════════════════════════════════════════════════════════╝"
echo ""
# 1. Check shell helpers are installed
echo "1. Checking shell helpers..."
if [ -f "$HOME/.local/share/aimaestro/shell-helpers/common.sh" ]; then
pass "common.sh installed"
else
fail "common.sh NOT installed - run install-plugin.sh"
fi
if [ -f "$HOME/.local/share/aimaestro/shell-helpers/agent-helper.sh" ]; then
pass "agent-helper.sh installed (share dir)"
else
warn "agent-helper.sh not in share dir - run install-agent-cli.sh"
fi
if [ -f "$HOME/.local/share/aimaestro/shell-helpers/docs-helper.sh" ]; then
pass "docs-helper.sh installed (share dir)"
else
warn "docs-helper.sh not in share dir - run install-doc-tools.sh"
fi
# 2. Check AMP messaging scripts (post-AMP migration)
echo ""
echo "2. Checking AMP messaging scripts..."
# Auto-discover AMP scripts from plugin directory
PLUGIN_SCRIPTS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/plugin/plugins/ai-maestro/scripts"
if [ -d "$PLUGIN_SCRIPTS_DIR" ]; then
for script_path in "$PLUGIN_SCRIPTS_DIR"/amp-*.sh; do
[ -f "$script_path" ] || continue
script=$(basename "$script_path")
if [ -x "$HOME/.local/bin/$script" ]; then
pass "$script"
else
fail "$script NOT installed - run install-plugin.sh"
fi
done
else
fail "Plugin scripts directory not found — cannot verify AMP scripts"
fi
# 3. Check memory scripts
echo ""
echo "3. Checking memory scripts..."
MEMORY_SCRIPTS=(
"memory-search.sh"
"memory-helper.sh"
)
for script in "${MEMORY_SCRIPTS[@]}"; do
if [ -x "$HOME/.local/bin/$script" ]; then
pass "$script"
else
fail "$script NOT installed - run install-plugin.sh"
fi
done
# 4. Check graph scripts
echo ""
echo "4. Checking graph scripts..."
GRAPH_SCRIPTS=(
"graph-helper.sh"
"graph-describe.sh"
"graph-find-callers.sh"
"graph-find-callees.sh"
"graph-find-related.sh"
"graph-find-by-type.sh"
)
for script in "${GRAPH_SCRIPTS[@]}"; do
if [ -x "$HOME/.local/bin/$script" ]; then
pass "$script"
else
fail "$script NOT installed - run install-plugin.sh"
fi
done
# 5. Check docs scripts
echo ""
echo "5. Checking docs scripts..."
DOCS_SCRIPTS=(
"docs-search.sh"
"docs-index.sh"
"docs-stats.sh"
"docs-list.sh"
"docs-get.sh"
"docs-find-by-type.sh"
)
for script in "${DOCS_SCRIPTS[@]}"; do
if [ -x "$HOME/.local/bin/$script" ]; then
pass "$script"
else
fail "$script NOT installed - run install-plugin.sh"
fi
done
# 6. Check agent CLI
echo ""
echo "6. Checking agent CLI..."
if [ -x "$HOME/.local/bin/aimaestro-agent.sh" ]; then
pass "aimaestro-agent.sh"
else
fail "aimaestro-agent.sh NOT installed - run install-agent-cli.sh"
fi
if [ -f "$HOME/.local/share/aimaestro/shell-helpers/agent-helper.sh" ]; then
pass "agent-helper.sh (helpers dir)"
else
fail "agent-helper.sh NOT in helpers dir - run install-agent-cli.sh"
fi
# 7. Check Claude Code skills
echo ""
echo "7. Checking Claude Code skills..."
# Auto-discover skills from plugin directory
PLUGIN_SKILLS_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/plugin/plugins/ai-maestro/skills"
if [ -d "$PLUGIN_SKILLS_DIR" ]; then
for skill_dir in "$PLUGIN_SKILLS_DIR"/*/; do
[ -d "$skill_dir" ] || continue
skill=$(basename "$skill_dir")
if [ -f "$HOME/.claude/skills/$skill/SKILL.md" ]; then
pass "$skill skill"
else
warn "$skill skill not installed"
fi
done
else
warn "Plugin skills directory not found — cannot verify skills"
fi
# 8. Check PATH
echo ""
echo "8. Checking PATH..."
if [[ ":$PATH:" == *":$HOME/.local/bin:"* ]]; then
pass "~/.local/bin is in PATH"
else
warn "~/.local/bin is NOT in PATH - add to ~/.zshrc or ~/.bashrc"
fi
# 9. Test script syntax (bash -n)
echo ""
echo "9. Testing script syntax..."
# Helpers in share dir
for helper in common.sh agent-helper.sh docs-helper.sh; do
local_path="$HOME/.local/share/aimaestro/shell-helpers/$helper"
if [ -f "$local_path" ]; then
if bash -n "$local_path" 2>/dev/null; then
pass "$helper syntax OK"
else
fail "$helper has syntax errors"
fi
fi
done
# Key scripts in bin
for script in aimaestro-agent.sh memory-helper.sh graph-helper.sh; do
local_path="$HOME/.local/bin/$script"
if [ -f "$local_path" ]; then
if bash -n "$local_path" 2>/dev/null; then
pass "$script syntax OK"
else
fail "$script has syntax errors"
fi
fi
done
# 10. Runtime tests (only inside tmux with API running)
echo ""
echo "10. Testing script execution..."
if [ -n "$TMUX" ]; then
# Test agent CLI
if [ -x "$HOME/.local/bin/aimaestro-agent.sh" ]; then
if "$HOME/.local/bin/aimaestro-agent.sh" list >/dev/null 2>&1; then
pass "aimaestro-agent.sh runs"
else
warn "aimaestro-agent.sh failed (may need API running at localhost:23000)"
fi
fi
# Test AMP inbox
if [ -x "$HOME/.local/bin/amp-inbox.sh" ]; then
if "$HOME/.local/bin/amp-inbox.sh" >/dev/null 2>&1; then
pass "amp-inbox.sh runs"
else
warn "amp-inbox.sh failed (may need AMP initialized)"
fi
fi
# Test memory search
if command -v memory-search.sh &>/dev/null; then
if memory-search.sh "test" >/dev/null 2>&1; then
pass "memory-search.sh runs"
else
warn "memory-search.sh failed (may need API running)"
fi
fi
# Test graph describe
if command -v graph-describe.sh &>/dev/null; then
if graph-describe.sh "test" >/dev/null 2>&1; then
pass "graph-describe.sh runs"
else
warn "graph-describe.sh failed (may need API running)"
fi
fi
# Test docs stats
if command -v docs-stats.sh &>/dev/null; then
if docs-stats.sh >/dev/null 2>&1; then
pass "docs-stats.sh runs"
else
warn "docs-stats.sh failed (may need API running)"
fi
fi
else
warn "Not in tmux session - skipping runtime tests"
fi
# Summary
echo ""
echo "════════════════════════════════════════════════════════════════"
echo ""
echo -e "Results: ${GREEN}$PASS passed${NC}, ${RED}$FAIL failed${NC}, ${YELLOW}$WARN warnings${NC}"
echo ""
if [ $FAIL -gt 0 ]; then
echo -e "${RED}Some checks failed. Run the appropriate installer:${NC}"
echo " ./install-plugin.sh - AMP scripts + memory/graph/docs tools + skills"
echo " ./install-agent-cli.sh - Agent management CLI"
echo ""
echo "Or run the full updater to fix everything at once:"
echo " ./update-aimaestro.sh"
exit 1
elif [ $WARN -gt 0 ]; then
echo -e "${YELLOW}Some optional features are missing.${NC}"
exit 0
else
echo -e "${GREEN}All checks passed!${NC}"
exit 0
fi