brainiac 0.0.16 → 0.0.17
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 +4 -4
- data/Gemfile.lock +2 -2
- data/bin/brainiac +16 -2
- data/lib/brainiac/intent.rb +5 -4
- data/lib/brainiac/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: faf9d51fb98a0185bdf17224d0adc4539ec4b0584194ad4c67248f6092fd97a4
|
|
4
|
+
data.tar.gz: 15ad522a423295771f9f55847b2a07ea207f28709dab653896dd233f5888b8fd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c02497473d20acb2e64150a502cae30bad9e031da305be68655ee1b3f9854a99d734c93e887c2474927e7a63f85836c254cd1b14d5208778635c6940171be99
|
|
7
|
+
data.tar.gz: 118a28a54a16e21cf20f0199ed36dace15e82dbae60d9cab2c090a22241fa6eb7a7a5d2dee53763b37a13d43e9e9a3855d60cc8868ecd30fa95a6fe045fdad0c
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
brainiac (0.0.
|
|
4
|
+
brainiac (0.0.17)
|
|
5
5
|
puma (~> 7.2)
|
|
6
6
|
rackup (~> 2.3)
|
|
7
7
|
sinatra (~> 4.1)
|
|
@@ -84,7 +84,7 @@ DEPENDENCIES
|
|
|
84
84
|
CHECKSUMS
|
|
85
85
|
ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383
|
|
86
86
|
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
|
|
87
|
-
brainiac (0.0.
|
|
87
|
+
brainiac (0.0.17)
|
|
88
88
|
json (2.19.9) sha256=9b9025b7cdddafa38d316eca0b2358488e42d417045c1b90d216a9fefe46b79a
|
|
89
89
|
language_server-protocol (3.17.0.5) sha256=fd1e39a51a28bf3eec959379985a72e296e9f9acfce46f6a79d31ca8760803cc
|
|
90
90
|
lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
|
data/bin/brainiac
CHANGED
|
@@ -2380,7 +2380,14 @@ when "update", "upgrade"
|
|
|
2380
2380
|
|
|
2381
2381
|
if new_version
|
|
2382
2382
|
puts "✓ Updated #{gem_name}: #{current_version || "new"} → #{new_version}"
|
|
2383
|
-
|
|
2383
|
+
|
|
2384
|
+
if find_server_pid
|
|
2385
|
+
puts " Restarting server to activate..."
|
|
2386
|
+
wait_for_agents_to_finish
|
|
2387
|
+
stop_server
|
|
2388
|
+
sleep 2
|
|
2389
|
+
start_server(daemon: true)
|
|
2390
|
+
end
|
|
2384
2391
|
else
|
|
2385
2392
|
puts "✓ #{gem_name} is already at the latest version (#{current_version})"
|
|
2386
2393
|
end
|
|
@@ -2402,7 +2409,14 @@ when "update", "upgrade"
|
|
|
2402
2409
|
|
|
2403
2410
|
if new_version
|
|
2404
2411
|
puts "✓ Updated brainiac: #{current_version} → #{new_version}"
|
|
2405
|
-
|
|
2412
|
+
|
|
2413
|
+
if find_server_pid
|
|
2414
|
+
puts " Restarting server to apply..."
|
|
2415
|
+
wait_for_agents_to_finish
|
|
2416
|
+
stop_server
|
|
2417
|
+
sleep 2
|
|
2418
|
+
start_server(daemon: true)
|
|
2419
|
+
end
|
|
2406
2420
|
else
|
|
2407
2421
|
puts "✓ brainiac is already at the latest version (#{current_version})"
|
|
2408
2422
|
end
|
data/lib/brainiac/intent.rb
CHANGED
|
@@ -179,7 +179,7 @@ def check_intent(message, agent_name:, channel: "conversation", context: nil)
|
|
|
179
179
|
LOG.debug "[Intent] Full prompt:\n#{prompt}" if LOG.debug?
|
|
180
180
|
response = query_local_llm(prompt, config)
|
|
181
181
|
result = positive_intent?(response)
|
|
182
|
-
LOG.info "[Intent] Result: #{result ? "RESPOND" : "SKIP"} (model: #{config["model"]})"
|
|
182
|
+
LOG.info "[Intent] Result for #{agent_name}: #{result ? "RESPOND" : "SKIP"} (model: #{config["model"]})"
|
|
183
183
|
result
|
|
184
184
|
rescue OllamaModelNotFoundError => e
|
|
185
185
|
LOG.error "[Intent] #{e.message}"
|
|
@@ -309,8 +309,8 @@ def intent_names_other_agent?(message, agent_name)
|
|
|
309
309
|
msg_lower = message.downcase.strip
|
|
310
310
|
agent_lower = agent_name.downcase
|
|
311
311
|
|
|
312
|
-
# If this agent
|
|
313
|
-
return false if
|
|
312
|
+
# If this agent is DIRECTLY ADDRESSED (vocative), never skip — message is for us
|
|
313
|
+
return false if directly_addressed_to?(msg_lower, agent_lower)
|
|
314
314
|
|
|
315
315
|
# Check if any OTHER agent is directly addressed (not merely mentioned)
|
|
316
316
|
AGENT_REGISTRY.each do |key, entry|
|
|
@@ -319,7 +319,8 @@ def intent_names_other_agent?(message, agent_name)
|
|
|
319
319
|
next if other_lower == agent_lower
|
|
320
320
|
next unless msg_lower.match?(/\b#{Regexp.escape(other_lower)}\b/)
|
|
321
321
|
|
|
322
|
-
#
|
|
322
|
+
# Other agent is directly addressed — skip even if our name is mentioned in the body.
|
|
323
|
+
# e.g. "Effie, tell Galen you're sorry" → Effie is addressee, Galen is just mentioned.
|
|
323
324
|
return true if directly_addressed_to?(msg_lower, other_lower)
|
|
324
325
|
end
|
|
325
326
|
|
data/lib/brainiac/version.rb
CHANGED