Class: RubyCode::Tools::Explore

Inherits:
Base
  • Object
show all
Defined in:
lib/rubycode/tools/explore.rb

Overview

Explore tool - spawns a sub-agent for autonomous codebase exploration

Instance Attribute Summary

Attributes inherited from Base

#context

Instance Method Summary collapse

Methods inherited from Base

definition, #execute, #initialize, load_schema

Constructor Details

This class inherits a constructor from RubyCode::Tools::Base

Instance Method Details

#perform(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/rubycode/tools/explore.rb', line 7

def perform(params)
  query = params["query"]
  max_iterations = params["max_iterations"] || 10

  # Build a fresh adapter for the sub-agent
  adapter = build_adapter

  # Create explorer and run
  explorer = Explorer.new(
    adapter: adapter,
    config: context[:config] || RubyCode.config,
    query: query,
    max_iterations: max_iterations
  )

  explorer.explore

  # Return the exploration result
end