@misterhuydo/sentinel 1.5.30 → 1.5.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@misterhuydo/sentinel",
3
- "version": "1.5.30",
3
+ "version": "1.5.31",
4
4
  "description": "Sentinel — Autonomous DevOps Agent installer and manager",
5
5
  "bin": {
6
6
  "sentinel": "./bin/sentinel.js"
@@ -1 +1 @@
1
- __version__ = "1.5.30"
1
+ __version__ = "1.5.31"
@@ -125,10 +125,12 @@ async def run_slack_bot(cfg_loader, store) -> None:
125
125
 
126
126
  @app.event("app_mention")
127
127
  async def on_mention(event, client):
128
+ # Resolve allowed channel lazily (used for passive message filtering only).
129
+ # @mentions are always handled regardless of SLACK_CHANNEL — Boss responds
130
+ # in whatever channel the user mentioned it from.
128
131
  if cfg.slack_channel and not _allowed_id:
129
132
  await _resolve_allowed(client)
130
- if _allowed(event.get("channel", "")):
131
- await _dispatch(event, client, cfg_loader, store)
133
+ await _dispatch(event, client, cfg_loader, store)
132
134
 
133
135
  # ── Passive bot watcher — seed DB from config on startup ─────────────────
134
136
  for bot_id_cfg in cfg.slack_watch_bot_ids:
@@ -139,8 +141,13 @@ async def run_slack_bot(cfg_loader, store) -> None:
139
141
  @app.event("message")
140
142
  async def on_message(event, client):
141
143
  if event.get("bot_id"):
142
- # Passive bot watcher — bot messages from DB-registered bots
143
- if event.get("channel") and store.is_watched_bot(event["bot_id"]):
144
+ # Passive bot watcher — match on bot_id (B-prefix) OR user (U-prefix)
145
+ # watch_bot stores the U-prefixed user ID; Slack events send B-prefixed bot_id
146
+ _is_watched = (
147
+ store.is_watched_bot(event["bot_id"])
148
+ or store.is_watched_bot(event.get("user", ""))
149
+ )
150
+ if event.get("channel") and _is_watched:
144
151
  await _handle_bot_message(event, client, cfg_loader, store)
145
152
  return
146
153
 
@@ -199,8 +206,13 @@ async def _handle_bot_message(event: dict, client, cfg_loader, store) -> None:
199
206
  return
200
207
 
201
208
  # Find the project this bot is registered to
209
+ # Match on either the B-prefixed bot_id or the U-prefixed user ID
210
+ _user_id = event.get("user", "")
202
211
  bots = store.get_watched_bots()
203
- bot_info = next((b for b in bots if b["bot_id"] == bot_id), None)
212
+ bot_info = next(
213
+ (b for b in bots if b["bot_id"] in (bot_id, _user_id)),
214
+ None,
215
+ )
204
216
  project_name = (bot_info or {}).get("project_name") or ""
205
217
 
206
218
  # Resolve the project issues directory