@misterhuydo/sentinel 1.4.7 → 1.4.9

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.
@@ -1,6 +1,6 @@
1
1
  {
2
- "message": "Auto-checkpoint at 2026-03-24T15:11:03.239Z",
3
- "checkpoint_at": "2026-03-24T15:11:03.240Z",
2
+ "message": "Auto-checkpoint at 2026-03-24T15:25:10.578Z",
3
+ "checkpoint_at": "2026-03-24T15:25:10.579Z",
4
4
  "active_files": [],
5
5
  "notes": [],
6
6
  "mtime_snapshot": {}
package/lib/generate.js CHANGED
@@ -49,21 +49,30 @@ fi
49
49
  pkill -f "sentinel.main --config $DIR/config" 2>/dev/null || true
50
50
  rm -f "$PID_FILE"
51
51
 
52
- # Check Claude Code authentication
53
- AUTH_OUT=$(claude --print \"hi\" 2>&1 || true)
54
- if echo "$AUTH_OUT" | grep -Eqi "not logged in|/login"; then
55
- echo ""
56
- echo "[sentinel] Claude Code is not authenticated."
57
- echo " 1. Open a new terminal and run: claude"
58
- echo " 2. Type /login at the prompt"
59
- echo " 3. Open the URL in any browser and log in"
60
- echo " 4. Type /exit when done"
61
- echo " 5. Re-run this script"
62
- echo ""
63
- exit 1
64
- fi
65
-
66
52
  WORKSPACE="$(dirname "$DIR")"
53
+
54
+ # Check Claude Code authentication — skip if CLAUDE_PRO_FOR_TASKS=false in either config
55
+ _claude_pro=true
56
+ for _conf in "$WORKSPACE/sentinel.properties" "$DIR/config/sentinel.properties"; do
57
+ if [[ -f "$_conf" ]]; then
58
+ _val=$(grep -iE "^CLAUDE_PRO_FOR_TASKS[[:space:]]*=" "$_conf" 2>/dev/null | tail -1 | cut -d= -f2- | tr -d ' ' | tr '[:upper:]' '[:lower:]')
59
+ [[ -n "$_val" ]] && _claude_pro="$_val"
60
+ fi
61
+ done
62
+ if [[ "$_claude_pro" != "false" ]]; then
63
+ AUTH_OUT=$(claude --print \"hi\" 2>&1 || true)
64
+ if echo "$AUTH_OUT" | grep -Eqi "not logged in|/login"; then
65
+ echo ""
66
+ echo "[sentinel] Claude Code is not authenticated."
67
+ echo " 1. Open a new terminal and run: claude"
68
+ echo " 2. Type /login at the prompt"
69
+ echo " 3. Open the URL in any browser and log in"
70
+ echo " 4. Type /exit when done"
71
+ echo " 5. Re-run this script"
72
+ echo ""
73
+ exit 1
74
+ fi
75
+ fi
67
76
  mkdir -p "$DIR/logs" "$WORKSPACE/logs" "$DIR/workspace/fetched" "$DIR/workspace/patches" "$DIR/issues"
68
77
  cd "$DIR"
69
78
  PYTHONPATH="${codeDir}" "${pythonBin}" -m sentinel.main --config ./config \\
@@ -182,12 +191,21 @@ if [[ -f "$PID_FILE" ]] && kill -0 "$(cat "$PID_FILE")" 2>/dev/null; then
182
191
  fi
183
192
  pkill -f "sentinel.main --config $DIR/config" 2>/dev/null || true
184
193
  rm -f "$PID_FILE"
185
- AUTH_OUT=$(claude --print \"hi\" 2>&1 || true)
186
- if echo "$AUTH_OUT" | grep -Eqi "not logged in|/login"; then
187
- echo "[sentinel] Claude Code is not authenticated. Run: claude then /login"
188
- exit 1
189
- fi
190
194
  WORKSPACE="$(dirname "$DIR")"
195
+ _claude_pro=true
196
+ for _conf in "$WORKSPACE/sentinel.properties" "$DIR/config/sentinel.properties"; do
197
+ if [[ -f "$_conf" ]]; then
198
+ _val=$(grep -iE "^CLAUDE_PRO_FOR_TASKS[[:space:]]*=" "$_conf" 2>/dev/null | tail -1 | cut -d= -f2- | tr -d ' ' | tr '[:upper:]' '[:lower:]')
199
+ [[ -n "$_val" ]] && _claude_pro="$_val"
200
+ fi
201
+ done
202
+ if [[ "$_claude_pro" != "false" ]]; then
203
+ AUTH_OUT=$(claude --print \"hi\" 2>&1 || true)
204
+ if echo "$AUTH_OUT" | grep -Eqi "not logged in|/login"; then
205
+ echo "[sentinel] Claude Code is not authenticated. Run: claude then /login"
206
+ exit 1
207
+ fi
208
+ fi
191
209
  mkdir -p "$DIR/logs" "$WORKSPACE/logs" "$DIR/workspace/fetched" "$DIR/workspace/patches" "$DIR/issues"
192
210
  cd "$DIR"
193
211
  PYTHONPATH="__CODE_DIR__" "__PYTHON_BIN__" -m sentinel.main --config ./config \
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -138,12 +138,14 @@ class ConfigLoader:
138
138
  d.update(_parse_properties(str(workspace_props)))
139
139
  logger.debug("Loaded workspace config from %s", workspace_props)
140
140
 
141
+ project_d: dict[str, str] = {}
141
142
  path = self.config_dir / "sentinel.properties"
142
143
  if not path.exists():
143
144
  if not d:
144
145
  logger.warning("sentinel.properties not found at %s", path)
145
146
  else:
146
- d.update(_parse_properties(str(path)))
147
+ project_d = _parse_properties(str(path))
148
+ d.update(project_d)
147
149
 
148
150
  c = SentinelConfig()
149
151
  c.poll_interval_seconds = int(d.get("POLL_INTERVAL_SECONDS", 120))
@@ -173,7 +175,15 @@ class ConfigLoader:
173
175
  c.slack_allowed_users = _csv(d.get("SLACK_ALLOWED_USERS", ""))
174
176
  c.slack_admin_users = _csv(d.get("SLACK_ADMIN_USERS", ""))
175
177
  c.project_name = d.get("PROJECT_NAME", "") or Path(self.config_dir).resolve().parent.name
176
- c.claude_pro_for_tasks = d.get("CLAUDE_PRO_FOR_TASKS", "true").lower() != "false"
178
+ # If CLAUDE_PRO_FOR_TASKS is explicitly set anywhere, respect it.
179
+ # Otherwise: if the project supplies its own ANTHROPIC_API_KEY, default to False
180
+ # (bill against their key, not the Claude Pro subscription).
181
+ if "CLAUDE_PRO_FOR_TASKS" in d:
182
+ c.claude_pro_for_tasks = d["CLAUDE_PRO_FOR_TASKS"].lower() != "false"
183
+ elif project_d.get("ANTHROPIC_API_KEY", "").strip():
184
+ c.claude_pro_for_tasks = False
185
+ else:
186
+ c.claude_pro_for_tasks = True
177
187
  c.sync_enabled = d.get("SYNC_ENABLED", "true").lower() != "false"
178
188
  c.sync_interval_seconds = int(d.get("SYNC_INTERVAL_SECONDS", 300))
179
189
  c.sync_retention_days = int(d.get("SYNC_RETENTION_DAYS", 30))
@@ -26,10 +26,11 @@ MAILS=you@yourdomain.com
26
26
  STATE_DB=./sentinel.db
27
27
  WORKSPACE_DIR=./workspace
28
28
 
29
- # Claude authenticationsee workspace sentinel.properties for full documentation.
30
- # Override here only if this project needs different credentials than the workspace default.
29
+ # Anthropic API key override workspace default to bill this project separately.
30
+ # Use case: the project owner (e.g. a client) provides their own key so fix costs
31
+ # are charged to their account. When set here, the Fix Engine automatically uses
32
+ # this key instead of the shared Claude Pro subscription.
31
33
  # ANTHROPIC_API_KEY=sk-ant-...
32
- # CLAUDE_PRO_FOR_TASKS=true
33
34
 
34
35
  # Slack Bot (optional) — Sentinel Boss conversational interface
35
36
  # Create a Slack App at api.slack.com, enable Socket Mode, add scopes: