metheus-governance-mcp-cli 0.2.258 → 0.2.259

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.
@@ -192,9 +192,17 @@ export function evaluateTelegramRunnerTrigger(record, route, bot) {
192
192
  return { shouldRespond: false, reason: "bot replies are disabled by trigger_policy", trigger: "bot_reply_disabled", requiresDirectReply: false };
193
193
  }
194
194
  const mentionsBot = doesTelegramArchiveMentionBot(parsed, bot, route);
195
- return mentionsBot
196
- ? { shouldRespond: true, reason: "bot reply is a candidate continuation message", trigger: "bot_reply_mention", requiresDirectReply: false }
197
- : { shouldRespond: true, reason: "bot reply is a candidate continuation message", trigger: "bot_reply", requiresDirectReply: false };
195
+ if (mentionsBot) {
196
+ return { shouldRespond: true, reason: "bot reply is a candidate continuation message", trigger: "bot_reply_mention", requiresDirectReply: false };
197
+ }
198
+ const replySenderUsername = normalizeTelegramMentionUsername(parsed.username || parsed.botUsername || parsed.botName || parsed.sender);
199
+ const currentBotCandidates = buildTelegramBotUsernameCandidates(bot, route);
200
+ const isOwnReply = replySenderUsername && currentBotCandidates.includes(replySenderUsername);
201
+ const repliesToBot = isTelegramArchiveReplyingToBot(parsed, bot, route);
202
+ if (isOwnReply || repliesToBot) {
203
+ return { shouldRespond: true, reason: "bot reply is a candidate continuation message", trigger: "bot_reply", requiresDirectReply: false };
204
+ }
205
+ return { shouldRespond: false, reason: "bot reply is from a different bot and does not mention or reply to this bot", trigger: "bot_reply_foreign", requiresDirectReply: false };
198
206
  }
199
207
  if (!isInboundArchiveKind(parsed.kind)) {
200
208
  return { shouldRespond: false, reason: "comment is not an inbound archived message", trigger: "invalid", requiresDirectReply: false };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "metheus-governance-mcp-cli",
3
- "version": "0.2.258",
3
+ "version": "0.2.259",
4
4
  "description": "Metheus Governance MCP CLI (setup + stdio proxy)",
5
5
  "type": "module",
6
6
  "files": [