module BotConsole
BotConsole::Layout — curses pane geometry for multi-bot console display. Public: panes, horizontal_panes, vertical_panes Depends: (none) Tests: test/bot_console_test.rb
BotConsole::LogLine — condense Cinch / IRC stdout noise for the TUI log panes. Public: condense Depends: (none) Tests: test/bot_console_test.rb
Constants
- CHILD_ENV_DEFAULTS
-
Console-managed bots should QUIT promptly on SIGTERM — no AI sign-off wait.
- SYNC_FILENAME
Public Class Methods
Source
# File lib/bot_console.rb, line 125 def unquote_env_value(value) v = value.to_s.strip return v unless v.length >= 2 quote = v[0] return v unless (quote == "'" || quote == '"') && v[-1] == quote v[1..-2] end
Public Instance Methods
Source
# File lib/bot_console.rb, line 136 def child_env(env) CHILD_ENV_DEFAULTS.merge(env) end
Source
# File lib/bot_console.rb, line 108 def load_secrets_env(root) path = File.join(root, "config", "secrets.env") return {} unless File.file?(path) env = {} File.readlines(path, chomp: true).each do |line| line = line.strip next if line.empty? || line.start_with?("#") key, value = line.split("=", 2) next unless key env[key] = unquote_env_value(value.to_s) end env end
Source
# File lib/bot_console.rb, line 140 def run(root:) FileUtils.mkdir_p(File.join(root, "data", "bots")) FileUtils.mkdir_p(File.join(root, "data", "bot_console", "logs")) env = child_env(ENV.to_h.merge(load_secrets_env(root))) manager = Manager.new(root: root, env: env) UI.new(manager, root: root).run end