opencode-pilot 0.1.0 → 0.2.1
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/.github/workflows/ci.yml +8 -1
- package/.releaserc.cjs +10 -1
- package/AGENTS.md +6 -12
- package/README.md +31 -25
- package/bin/opencode-pilot +47 -209
- package/examples/config.yaml +2 -9
- package/package.json +6 -6
- package/plugin/index.js +45 -245
- package/service/server.js +44 -1381
- package/test/unit/paths.test.js +4 -46
- package/test/unit/plugin.test.js +46 -0
- package/dist/opencode-ntfy.tar.gz +0 -0
- package/plugin/config.js +0 -76
- package/plugin/logger.js +0 -125
- package/plugin/notifier.js +0 -110
- package/service/io.opencode.ntfy.plist +0 -29
- package/test/run_tests.bash +0 -34
- package/test/test_actions.bash +0 -263
- package/test/test_cli.bash +0 -161
- package/test/test_config.bash +0 -438
- package/test/test_helper.bash +0 -140
- package/test/test_logger.bash +0 -401
- package/test/test_notifier.bash +0 -310
- package/test/test_plist.bash +0 -125
- package/test/test_plugin.bash +0 -952
- package/test/test_poll_service.bash +0 -179
- package/test/test_poller.bash +0 -120
- package/test/test_readiness.bash +0 -313
- package/test/test_repo_config.bash +0 -406
- package/test/test_service.bash +0 -1342
- package/test/unit/config.test.js +0 -86
package/test/test_plist.bash
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
#
|
|
3
|
-
# Tests for service/io.opencode.ntfy.plist - LaunchAgent plist for brew services
|
|
4
|
-
# Issue #13: Separate callback server as brew service
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
set -euo pipefail
|
|
8
|
-
|
|
9
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
10
|
-
source "$SCRIPT_DIR/test_helper.bash"
|
|
11
|
-
|
|
12
|
-
SERVICE_DIR="$(dirname "$SCRIPT_DIR")/service"
|
|
13
|
-
|
|
14
|
-
echo "Testing LaunchAgent plist..."
|
|
15
|
-
echo ""
|
|
16
|
-
|
|
17
|
-
# =============================================================================
|
|
18
|
-
# File Structure Tests
|
|
19
|
-
# =============================================================================
|
|
20
|
-
|
|
21
|
-
test_plist_file_exists() {
|
|
22
|
-
assert_file_exists "$SERVICE_DIR/io.opencode.ntfy.plist"
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
test_plist_is_valid_xml() {
|
|
26
|
-
if ! command -v plutil &>/dev/null; then
|
|
27
|
-
echo "SKIP: plutil not available (macOS only)"
|
|
28
|
-
return 0
|
|
29
|
-
fi
|
|
30
|
-
plutil -lint "$SERVICE_DIR/io.opencode.ntfy.plist" 2>&1 || {
|
|
31
|
-
echo "plist is not valid XML"
|
|
32
|
-
return 1
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
# =============================================================================
|
|
37
|
-
# Content Tests
|
|
38
|
-
# =============================================================================
|
|
39
|
-
|
|
40
|
-
test_plist_has_label() {
|
|
41
|
-
grep -q "<string>io.opencode.ntfy</string>" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
42
|
-
echo "Label not found in plist"
|
|
43
|
-
return 1
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
test_plist_has_program_arguments() {
|
|
48
|
-
grep -q "<key>ProgramArguments</key>" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
49
|
-
echo "ProgramArguments not found in plist"
|
|
50
|
-
return 1
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
test_plist_runs_node() {
|
|
55
|
-
grep -q "node" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
56
|
-
echo "node command not found in plist"
|
|
57
|
-
return 1
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
test_plist_runs_server_js() {
|
|
62
|
-
grep -q "server.js" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
63
|
-
echo "server.js not found in plist"
|
|
64
|
-
return 1
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
test_plist_has_keep_alive() {
|
|
69
|
-
grep -q "<key>KeepAlive</key>" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
70
|
-
echo "KeepAlive not found in plist"
|
|
71
|
-
return 1
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
test_plist_has_run_at_load() {
|
|
76
|
-
grep -q "<key>RunAtLoad</key>" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
77
|
-
echo "RunAtLoad not found in plist"
|
|
78
|
-
return 1
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
test_plist_has_stdout_log() {
|
|
83
|
-
grep -q "stdout\|StandardOutPath" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
84
|
-
echo "Stdout logging not found in plist"
|
|
85
|
-
return 1
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
test_plist_has_stderr_log() {
|
|
90
|
-
grep -q "stderr\|StandardErrorPath" "$SERVICE_DIR/io.opencode.ntfy.plist" || {
|
|
91
|
-
echo "Stderr logging not found in plist"
|
|
92
|
-
return 1
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
# =============================================================================
|
|
97
|
-
# Run Tests
|
|
98
|
-
# =============================================================================
|
|
99
|
-
|
|
100
|
-
echo "File Structure Tests:"
|
|
101
|
-
|
|
102
|
-
for test_func in \
|
|
103
|
-
test_plist_file_exists \
|
|
104
|
-
test_plist_is_valid_xml
|
|
105
|
-
do
|
|
106
|
-
run_test "${test_func#test_}" "$test_func"
|
|
107
|
-
done
|
|
108
|
-
|
|
109
|
-
echo ""
|
|
110
|
-
echo "Content Tests:"
|
|
111
|
-
|
|
112
|
-
for test_func in \
|
|
113
|
-
test_plist_has_label \
|
|
114
|
-
test_plist_has_program_arguments \
|
|
115
|
-
test_plist_runs_node \
|
|
116
|
-
test_plist_runs_server_js \
|
|
117
|
-
test_plist_has_keep_alive \
|
|
118
|
-
test_plist_has_run_at_load \
|
|
119
|
-
test_plist_has_stdout_log \
|
|
120
|
-
test_plist_has_stderr_log
|
|
121
|
-
do
|
|
122
|
-
run_test "${test_func#test_}" "$test_func"
|
|
123
|
-
done
|
|
124
|
-
|
|
125
|
-
print_summary
|