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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 123ee48772d662b7c3326b4c90584f3aa85cfeecf0c481f564cb3f79efb4355a
4
- data.tar.gz: d81be4471f1665ca426d9c02cc278f04e0fc67a272b6f9c5a82ce7ba05ef00ae
3
+ metadata.gz: faf9d51fb98a0185bdf17224d0adc4539ec4b0584194ad4c67248f6092fd97a4
4
+ data.tar.gz: 15ad522a423295771f9f55847b2a07ea207f28709dab653896dd233f5888b8fd
5
5
  SHA512:
6
- metadata.gz: 76b8df7eefa48bb122f7d75ba0730f0b8ac328ad284f45e137297dd650b7f6781bcc6ad14bd1a0a4f1a31a9c24392bd183a4b5b236f086a19bc504257f2cf180
7
- data.tar.gz: 7f089331037cc192f3cb284471b497e688d0831a38088f968cf4c5eabd175539a8b8f8e1986ad38739ee7a1efdb1beb81d3777d9f63e99c131fd74d47629dcd8
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.16)
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.16)
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
- puts " Restart the server to activate: brainiac restart"
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
- puts " Restart the server to apply: brainiac restart"
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
@@ -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 IS named in the message, never deterministic skip
313
- return false if msg_lower.match?(/\b#{Regexp.escape(agent_lower)}\b/)
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
- # Agent name is presentnow determine if it's direct address or mere mention
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
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Brainiac
4
4
  # @return [String] the current gem version
5
- VERSION = "0.0.16"
5
+ VERSION = "0.0.17"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brainiac
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis