@misterhuydo/sentinel 1.0.41 → 1.0.43

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/.cairn/.hint-lock CHANGED
@@ -1 +1 @@
1
- 2026-03-21T21:53:40.473Z
1
+ 2026-03-21T22:25:43.489Z
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-21T22:00:33.969Z",
3
- "checkpoint_at": "2026-03-21T22:00:33.970Z",
2
+ "message": "Auto-checkpoint at 2026-03-21T22:26:00.108Z",
3
+ "checkpoint_at": "2026-03-21T22:26:00.109Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -4,7 +4,7 @@
4
4
  # Usage:
5
5
  # ./fetch_log.sh # reads all *.properties in script dir
6
6
  # ./fetch_log.sh SSOLWA.properties # specific file(s)
7
- # ./fetch_log.sh /path/to/SSOLWA.properties, /path/to/UAS.properties
7
+ # ./fetch_log.sh --debug SSOLWA.properties # show SSH errors + resolved paths
8
8
  #
9
9
  # Required properties:
10
10
  # KEY=<pem file> — filename resolved from config dir, then ~/.ssh/
@@ -22,6 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
22
22
  DEFAULT_SSH_USER="ec2-user"
23
23
  DEFAULT_TAIL=1000
24
24
  DEFAULT_GREP_FILTER="WARN|ERROR|FATAL|Exception|Error"
25
+ DEBUG=0
25
26
 
26
27
  show_help() {
27
28
  cat << 'EOF'
@@ -30,6 +31,7 @@ fetch_log.sh — Generic SSH log fetcher
30
31
  USAGE
31
32
  ./fetch_log.sh Read all *.properties in script dir
32
33
  ./fetch_log.sh FILE.properties ... One or more properties files
34
+ ./fetch_log.sh --debug FILE.properties Show SSH errors and resolved paths
33
35
 
34
36
  OUTPUT
35
37
  OUTPUT_DIR/<ServiceName>/<logname>-<node>.log
@@ -55,6 +57,11 @@ if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
55
57
  exit 0
56
58
  fi
57
59
 
60
+ if [[ "${1:-}" == "--debug" || "${1:-}" == "-d" ]]; then
61
+ DEBUG=1
62
+ shift
63
+ fi
64
+
58
65
  trim() {
59
66
  local s="$*"
60
67
  s="${s#"${s%%[![:space:]]*}"}"
@@ -119,6 +126,15 @@ fetch_from_properties() {
119
126
  REMOTE_SERVICE_USER="${REMOTE_SERVICE_USER:-$SERVICE_NAME}"
120
127
  OUTPUT_DIR="${OUTPUT_DIR:-$SCRIPT_DIR}"
121
128
 
129
+ if [[ $DEBUG -eq 1 ]]; then
130
+ echo " KEY: $KEY"
131
+ echo " REMOTE_USER: $REMOTE_SERVICE_USER"
132
+ echo " GREP_FILTER: ${GREP_FILTER:-(none)}"
133
+ echo " GREP_EXCLUDE: ${GREP_EXCLUDE:-(none)}"
134
+ echo " TAIL: $TAIL"
135
+ echo " OUTPUT_DIR: $OUTPUT_DIR"
136
+ fi
137
+
122
138
  local SERVICE_DIR="$OUTPUT_DIR/$SERVICE_NAME"
123
139
  mkdir -p "$SERVICE_DIR"
124
140
 
@@ -141,7 +157,7 @@ fetch_from_properties() {
141
157
  ssh_host="$host_entry"
142
158
  fi
143
159
 
144
- echo "--- [$SERVICE_NAME] node-$node_idx ($ssh_host) ---"
160
+ echo "--- [$SERVICE_NAME] node-$node_idx ($ssh_user@$ssh_host) ---"
145
161
 
146
162
  for raw_log in "${LOG_ARRAY[@]}"; do
147
163
  local log_path
@@ -158,15 +174,33 @@ fetch_from_properties() {
158
174
  [[ -n "$TAIL" ]] && remote_cmd+=" | tail -n $TAIL"
159
175
  [[ -n "$HEAD" ]] && [[ -z "$TAIL" ]] && remote_cmd+=" | head -n $HEAD"
160
176
 
177
+ if [[ $DEBUG -eq 1 ]]; then
178
+ echo " remote_path: $remote_path"
179
+ echo " cmd: $remote_cmd"
180
+ fi
181
+
161
182
  local log_basename dest
162
183
  log_basename="$(basename "$log_path")"
163
184
  log_basename="${log_basename%.*}"
164
185
  dest="$SERVICE_DIR/${log_basename}-${node_idx}.log"
165
186
 
166
- ssh -i "$KEY" -o StrictHostKeyChecking=no -o ConnectTimeout=10 \
167
- -l "$ssh_user" "$ssh_host" "$remote_cmd" > "$dest" 2>/dev/null \
168
- && echo " OK: $dest" \
169
- || echo " FAILED: $log_path on $ssh_host"
187
+ local ssh_stderr
188
+ if [[ $DEBUG -eq 1 ]]; then
189
+ ssh_stderr=$(ssh -i "$KEY" -o StrictHostKeyChecking=no -o ConnectTimeout=10 \
190
+ -l "$ssh_user" "$ssh_host" "$remote_cmd" > "$dest" 2>&1 >/dev/null)
191
+ local rc=$?
192
+ if [[ $rc -eq 0 ]]; then
193
+ echo " OK: $dest"
194
+ else
195
+ echo " FAILED: $log_path on $ssh_host"
196
+ [[ -n "$ssh_stderr" ]] && echo " SSH error: $ssh_stderr" >&2
197
+ fi
198
+ else
199
+ ssh -i "$KEY" -o StrictHostKeyChecking=no -o ConnectTimeout=10 \
200
+ -l "$ssh_user" "$ssh_host" "$remote_cmd" > "$dest" 2>/dev/null \
201
+ && echo " OK: $dest" \
202
+ || echo " FAILED: $log_path on $ssh_host"
203
+ fi
170
204
  done
171
205
 
172
206
  ((node_idx++))
@@ -87,8 +87,7 @@ def scan_issues(project_dir: Path) -> list[IssueEvent]:
87
87
  Skips dotfiles, archives, and compiled binaries.
88
88
  """
89
89
  issues_dir = project_dir / "issues"
90
- if not issues_dir.exists():
91
- return []
90
+ issues_dir.mkdir(exist_ok=True)
92
91
 
93
92
  events = []
94
93
  for f in sorted(issues_dir.iterdir()):