Class: Airb::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/airb.rb

Class Method Summary collapse

Class Method Details

.startObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/airb.rb', line 9

def self.start
  $stdout.sync = true
  $stderr.sync = true
  capsule = Airb::Organism.build
  hub = nil

  # Optional: live visualizer (Lens) from VSM
  if ENV["VSM_LENS"] == "1"
    hub = VSM::Lens.attach!(
      capsule,
      host: "127.0.0.1",
      port: (ENV["VSM_LENS_PORT"] || 9292).to_i,
      token: ENV["VSM_LENS_TOKEN"]
    )
    puts "Lens: http://127.0.0.1:#{ENV['VSM_LENS_PORT'] || 9292}"
  end

  port = Airb::Ports::ChatTTY.new(capsule:)
  VSM::Runtime.start(capsule, ports: [port]) # async reactor + port loop
end