brainiac-discord 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5edd0068ecc82d20372d269791ff8e750fcec8106f4adcc99fdef3c252e03ada
4
- data.tar.gz: b30c999fc3497d7608463975a3d9f4a8c09b135e3d7bc9da1099b6a5306594c2
3
+ metadata.gz: c28ec3344ab8f68efb007fc26d1cf8313427b74bc9e0b4db4f8bd82eddd403d8
4
+ data.tar.gz: c86021ac1c0145cef864bd59f79e43edde8ba2645a4a2d31cd409570c3f935a1
5
5
  SHA512:
6
- metadata.gz: f65f1deefed415c9b3a038162ad6c59714f2677c9ce8ec201e880ce9ae9b159571cb4910a7515268d0e09ad262e69011ea6f7b1c40471bc846ea5f84fa74d366
7
- data.tar.gz: 23ba4bda9f6eb4e9797e6724ad57f12908da3176f116eacdaa11f8b5c3462647180cb8c0a1a1766c00ac12de49c2216e8fdf84da9ad719dcde0bae42307851f9
6
+ metadata.gz: 26f16e31243fefadb58e7c77c7dcb1cd835c9e674ebbaf0766b3feece5f5cfc4a6262b3a0c3a2281b63f30fc20d8dbc9a51daa806f4a044e2be8c6df6c1e6d39
7
+ data.tar.gz: dc8afd82dd157ec2f4c5c81e4bf3fd90b18bfd6dee1b568598eb1245a109a7ccb8aef20b79ae6329f34f2ac704c7cd185d3e56082aa3c08297929eab8820e799
@@ -101,9 +101,9 @@ module Brainiac
101
101
  content.match?(/<@&#{Regexp.escape(role_id)}>/)
102
102
  end
103
103
 
104
- # Check if another agent bot is explicitly mentioned in this message.
105
- # When a user @mentions a specific agent, thread participants who weren't
106
- # mentioned should stay silent — no intent check needed.
104
+ # Check if another agent bot or a known human user is explicitly mentioned
105
+ # in this message. When a user @mentions someone specific, thread participants
106
+ # who weren't mentioned should stay silent — no intent check needed.
107
107
  def other_agent_mentioned?(mentions, content, agent_key)
108
108
  mention_roles = []
109
109
 
@@ -118,7 +118,18 @@ module Brainiac
118
118
  mention_roles << role_id if role_id
119
119
  end
120
120
 
121
- mention_roles.any? { |rid| content.match?(/<@&#{Regexp.escape(rid)}>/) }
121
+ return true if mention_roles.any? { |rid| content.match?(/<@&#{Regexp.escape(rid)}>/) }
122
+
123
+ # Also check human user_mappings — if a human was explicitly @mentioned,
124
+ # thread participants should stand down (message directed at someone specific)
125
+ Config.user_mappings.each_value do |discord_id|
126
+ next unless discord_id
127
+
128
+ return true if mentions.any? { |m| m["id"].to_s == discord_id.to_s } ||
129
+ content.match?(/<@!?#{Regexp.escape(discord_id.to_s)}>/)
130
+ end
131
+
132
+ false
122
133
  end
123
134
 
124
135
  def validate_cross_agent_dispatch(sender_agent_key, agent_key, mentioned, content, channel_id)
@@ -3,7 +3,7 @@
3
3
  module Brainiac
4
4
  module Plugins
5
5
  module Discord
6
- VERSION = "0.0.5"
6
+ VERSION = "0.0.6"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac-discord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis