brainiac 0.0.26 → 0.0.27

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: 963f3a3319ca2ccff44fc003072a0566d3b76d06a42ea645d81693bb48ea2ab3
4
- data.tar.gz: 7abb9b38680549aaf3da6068b459f0faf474f5862f7f235f1dabddfcb38d5e55
3
+ metadata.gz: 889b0c7491371dd4deb7dc5a173eb5c45045cf9d85a9bf1b5cfcf75bb233d407
4
+ data.tar.gz: c5532f51f711e5b5839fd3c9cbfe3e297e8ae00849a44b9b82331d13d5d318f0
5
5
  SHA512:
6
- metadata.gz: dae8e213cb21a26f97de1406a5fe0bc1ce7dc5806e3b67079e2c0183b94888439f288243d86dc52fd9831d1ee61294a2f28fe9fe4f88dc03819c1d720a95db9b
7
- data.tar.gz: 2e7cf53a24fd776e2eb7960c379dc49309d932412f5fe39a8a56dd90a6162dcf3a9924396a7386b67a0288c0034381343effb529e53b8bcf4b4f43b7fc454708
6
+ metadata.gz: 81735abd0d5d4dc9e9aeccaf3ae80e7c51f3ca529f759750e0dc8ad4f3f15a3bee54ea3169f96e9a6e3a7b378d8395940e9b5af10bd92e8117d0fc49a602d855
7
+ data.tar.gz: 71bfdf3580bbe77aa873be4d7ef211b42f9f19979efce7a76cdcbfdeb30c914bdf9dae48b32d571bf28ad9871f53c1fd92946f025e36d7d9aa2a4e2b38ad4df5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brainiac (0.0.26)
4
+ brainiac (0.0.27)
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.26)
87
+ brainiac (0.0.27)
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
@@ -256,8 +256,9 @@ _brainiac() {
256
256
  puts "yes" if names.include?(ARGV[1])
257
257
  ' "$brainiac_dir/plugins.json" "$cmd" 2>/dev/null)
258
258
 
259
- if [[ "$is_plugin" == "yes" && $cword -eq 2 ]]; then
259
+ if [[ "$is_plugin" == "yes" ]]; then
260
260
  # Get plugin subcommands via its CLI module
261
+ # Pass remaining words (after plugin name) for nested completion
261
262
  local subcmds
262
263
  subcmds=$(ruby -rjson -e '
263
264
  brainiac_dir = ENV["BRAINIAC_DIR"] || File.join(Dir.home, ".brainiac")
@@ -280,10 +281,16 @@ _brainiac() {
280
281
  pascal = ARGV[0].split(/[-_]/).map(&:capitalize).join
281
282
  mod = Brainiac::Plugins.const_get(pascal) if Brainiac::Plugins.const_defined?(pascal)
282
283
  if mod&.respond_to?(:completions)
283
- puts mod.completions.join("\n")
284
+ args = ARGV[1..] || []
285
+ result = if mod.method(:completions).arity == 0
286
+ args.empty? ? mod.completions : []
287
+ else
288
+ mod.completions(args)
289
+ end
290
+ puts result.join("\n")
284
291
  end
285
292
  end
286
- ' "$cmd" 2>/dev/null)
293
+ ' "$cmd" ${words[@]:2:$((cword-2))} 2>/dev/null)
287
294
  COMPREPLY=($(compgen -W "$subcmds" -- "$cur"))
288
295
  fi
289
296
  fi
@@ -171,8 +171,10 @@ def build_brain_context(agent_name: AI_AGENT_NAME, card_title: "", card_number:
171
171
  search_queries << agent_name
172
172
 
173
173
  # Plugin hook: source-specific brain queries (e.g., plugins inject source-specific knowledge)
174
+ # Passes card_number and agent_name so plugins like brainiac-basecamp can inject epic context
174
175
  plugin_queries = Brainiac.emit(:build_brain_context,
175
- source: source, card_title: card_title, comment_body: comment_body)
176
+ source: source, card_title: card_title, comment_body: comment_body,
177
+ card_number: card_number, agent_name: agent_name)
176
178
  plugin_queries.flatten.compact.each do |query|
177
179
  knowledge_threads << Thread.new { query_brain(query, scope: :knowledge, max_results: 2) }
178
180
  search_queries << query
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Brainiac
4
4
  # @return [String] the current gem version
5
- VERSION = "0.0.26"
5
+ VERSION = "0.0.27"
6
6
  end
@@ -70,13 +70,13 @@ end
70
70
  def generate_output(env_key)
71
71
  deployments = fetch_deployments
72
72
  unless deployments
73
- puts({ text: "", tooltip: "#{env_key}: server unreachable", class: "error" }.to_json)
73
+ puts({ text: "⚠️", tooltip: "#{env_key}: server unreachable", class: "error" }.to_json)
74
74
  return
75
75
  end
76
76
 
77
77
  d = deployments.find { |dep| dep["env"] == env_key }
78
78
  unless d
79
- puts({ text: "", tooltip: "#{env_key}: not configured", class: "error" }.to_json)
79
+ puts({ text: "⚠️", tooltip: "#{env_key}: not configured", class: "error" }.to_json)
80
80
  return
81
81
  end
82
82
 
@@ -88,16 +88,16 @@ def generate_output(env_key)
88
88
  status = d["last_deploy_status"]
89
89
 
90
90
  if status == "deploying"
91
- dot = '<span color="#ffaa00">●</span>'
91
+ dot = "🟡"
92
92
  css_class = "deploy-deploying"
93
93
  elsif status == "failed"
94
- dot = '<span color="#ff4444">●</span>'
94
+ dot = "🔴"
95
95
  css_class = "deploy-failed"
96
96
  elsif recent && status == "success"
97
- dot = '<span color="#4488ff">●</span>'
97
+ dot = "🔵"
98
98
  css_class = "deploy-recent"
99
99
  else
100
- dot = '<span color="#ff4444">●</span>'
100
+ dot = "🔴"
101
101
  css_class = "deploy-occupied"
102
102
  end
103
103
 
@@ -112,7 +112,7 @@ def generate_output(env_key)
112
112
  end
113
113
  tooltip = "#{status_icon} #{label}: #{card}#{branch}#{" (#{ago})" if ago}\nClick: open URL | Right-click: deploy"
114
114
  else
115
- dot = '<span color="#44ff44">●</span>'
115
+ dot = "🟢"
116
116
  css_class = "deploy-available"
117
117
  ago = time_ago(d["cleared_at"])
118
118
  last = d["last_card"] ? " (was ##{d["last_card"]})" : ""
@@ -19,7 +19,6 @@ DISCORD_CONFIG_FILE = File.join(BRAINIAC_DIR, "discord.json")
19
19
 
20
20
  index = ARGV.find { |a| !a.start_with?("--") }&.to_i
21
21
  unless index
22
- puts({ text: "", tooltip: "", class: "" }.to_json)
23
22
  exit
24
23
  end
25
24
 
@@ -187,8 +186,9 @@ def generate_output(index)
187
186
  state = fetch_state
188
187
 
189
188
  if state["error"]
190
- puts({ text: "", tooltip: "", class: "" }.to_json) if index.positive?
191
- puts({ text: "⚠️", tooltip: "Brainiac Error: #{escape_pango(state["error"])}", class: "error" }.to_json) if index.zero?
189
+ return if index.positive?
190
+
191
+ puts({ text: "⚠️", tooltip: "Brainiac Error: #{escape_pango(state["error"])}", class: "error" }.to_json)
192
192
  return
193
193
  end
194
194
 
@@ -200,10 +200,7 @@ def generate_output(index)
200
200
  end
201
201
 
202
202
  session = sessions[index]
203
- unless session
204
- puts({ text: "", tooltip: "", class: "" }.to_json)
205
- return
206
- end
203
+ return unless session
207
204
 
208
205
  agent = session["agent"]
209
206
  emoji = AGENTS.dig(agent&.downcase, :emoji) || DEFAULT_EMOJI
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.26
4
+ version: 0.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Davis