Module: Nexo

Defined in:
lib/nexo.rb,
lib/nexo/mcp.rb,
lib/nexo/loop.rb,
lib/nexo/agent.rb,
lib/nexo/engine.rb,
lib/nexo/skills.rb,
lib/nexo/sandbox.rb,
lib/nexo/session.rb,
lib/nexo/version.rb,
lib/nexo/workflow.rb,
lib/nexo/run_store.rb,
lib/nexo/sandboxes.rb,
lib/nexo/concurrent.rb,
lib/nexo/tools/glob.rb,
lib/nexo/permissions.rb,
lib/nexo/tools/fetch.rb,
lib/nexo/tools/shell.rb,
lib/nexo/read_tracker.rb,
lib/nexo/workflow_job.rb,
lib/nexo/workflow_run.rb,
lib/nexo/configuration.rb,
lib/nexo/loops/ruby_llm.rb,
lib/nexo/mcp/gated_tool.rb,
lib/nexo/loops/agent_sdk.rb,
lib/nexo/sandboxes/local.rb,
lib/nexo/tools/read_file.rb,
lib/nexo/output_truncator.rb,
lib/nexo/sandboxes/remote.rb,
lib/nexo/tools/web_search.rb,
lib/nexo/tools/write_file.rb,
lib/nexo/sandboxes/virtual.rb,
lib/nexo/turbo_broadcaster.rb,
lib/nexo/sandboxes/container.rb,
lib/generators/nexo/skill/skill_generator.rb,
lib/generators/nexo/state/state_generator.rb,
lib/generators/nexo/install/install_generator.rb,
lib/generators/nexo/artifacts/artifacts_generator.rb,
lib/generators/nexo/workflows/workflows_generator.rb

Overview

Nexo composes the RubyLLM ecosystem into one front door, adding a Sandbox + Permissions seam and a WorkflowRun lifecycle primitive.

The published gem is nexo_ai; the Ruby namespace is always Nexo.

Defined Under Namespace

Modules: Generators, Loops, MCP, OutputTruncator, RunStore, Sandboxes, Skills, Tools, TurboBroadcaster Classes: Agent, ApprovalRequired, Concurrent, Configuration, ConfigurationError, Engine, Error, Loop, MissingDependencyError, Permissions, ReadTracker, Sandbox, Session, Workflow, WorkflowJob, WorkflowRun

Constant Summary collapse

VERSION =

The gem version (also used as spec.version in the gemspec).

"0.8.0"

Class Method Summary collapse

Class Method Details

.concurrent(max_in_flight: config.max_in_flight, &setup) ⇒ Object

Bounded, fiber-based fan-out (Spec 5). Yields a collector; every block added via c.add { ... } runs concurrently inside one async reactor, capped at max_in_flight in flight, with results returned in submission order and the first task error re-raised. Requires the optional async gem — raises MissingDependencyError if it is not installed.

results = Nexo.concurrent(max_in_flight: 8) do |c|
docs.each { |d| c.add { SummarizeDocument.run(text: d.body).result } }
end


95
96
97
98
99
# File 'lib/nexo.rb', line 95

def concurrent(max_in_flight: config.max_in_flight, &setup)
  c = Concurrent.new(max_in_flight: max_in_flight)
  setup.call(c)
  c.run
end

.configObject

Returns the memoized singleton Configuration.



69
70
71
# File 'lib/nexo.rb', line 69

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields the singleton Configuration for in-place setup and returns it.

Nexo.configure { |config| config.default_model = ENV["NEXO_MODEL"] }

Yields:



63
64
65
66
# File 'lib/nexo.rb', line 63

def configure
  yield(config)
  config
end

.generate_run_idObject

Returns a fresh run id as a time-ordered UUID v7 string (Ruby 3.3+). Both run stores and the WorkflowRun model obtain ids only through this helper, keeping id shape identical across backends.



82
83
84
# File 'lib/nexo.rb', line 82

def generate_run_id
  SecureRandom.uuid_v7
end

.reset_config!Object

Replaces the singleton with a fresh Configuration. Test helper for isolating the global between examples.



75
76
77
# File 'lib/nexo.rb', line 75

def reset_config!
  @config = Configuration.new
end