This directory contains the canonical Ruby implementation of Recurgent.
bundle install
bundle exec rspec
bundle exec rubocop
bundle exec rake
./bin/recurgent
ruby examples/calculator.rb
ruby examples/debate.rblib/ # Agent runtime + providers + outcome model
spec/ # unit + acceptance tests
examples/ # executable demos
bin/ # executable entrypoint
Dynamic method calls return Agent::Outcome:
ok?+valuefor successful callserror?+ typederror_type/error_messagefor failures
Configure runtime dependency policy before creating Tool Builders:
Agent.configure_runtime(
gem_sources: ["https://rubygems.org"],
source_mode: "public_only",
allowed_gems: nil,
blocked_gems: nil
)To force internal source only:
Agent.configure_runtime(
gem_sources: ["https://artifactory.example.org/api/gems/ruby"],
source_mode: "internal_only",
allowed_gems: %w[nokogiri prawn]
)Warm up dependency environments before first call:
ticket = Agent.prepare(
"pdf tool",
dependencies: [{ name: "prawn", version: "~> 2.5" }]
)
result = ticket.await(timeout: 30)result is:
Agentwhen preparation succeedsAgent::Outcomewhen preparation fails (error_type: "environment_preparing")
- Environment cache identity includes Ruby version/platform, normalized dependency manifest,
source_mode, and normalizedgem_sources. - Worker-vs-inline execution follows the tool's effective manifest:
once a tool has a non-empty manifest, later calls with
dependencies: []still execute in the worker-backed environment. - Dependency manifests are monotonic per tool instance: existing gems/versions must remain identical, while new gems may be added.
Shared cross-runtime contract artifacts live at: