Class: RubynCode::SubAgents::AgentType

Inherits:
Data
  • Object
show all
Defined in:
lib/rubyn_code/sub_agents/agent_type.rb

Overview

A sub-agent type: the built-in ‘explore`/`worker`, or a user-defined agent loaded from .rubyn-code/agents/*.md. Captures everything spawn_agent needs to run it — display name, system prompt, the tool allowlist (nil = access-based default), access level, and turn budget.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#accessObject (readonly)

Returns the value of attribute access

Returns:

  • (Object)

    the current value of access



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def access
  @access
end

#descriptionObject (readonly)

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def description
  @description
end

#max_iterationsObject (readonly)

Returns the value of attribute max_iterations

Returns:

  • (Object)

    the current value of max_iterations



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def max_iterations
  @max_iterations
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def name
  @name
end

#system_promptObject (readonly)

Returns the value of attribute system_prompt

Returns:

  • (Object)

    the current value of system_prompt



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def system_prompt
  @system_prompt
end

#tool_namesObject (readonly)

Returns the value of attribute tool_names

Returns:

  • (Object)

    the current value of tool_names



9
10
11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 9

def tool_names
  @tool_names
end

Instance Method Details

#custom?Boolean

Returns:

  • (Boolean)


14
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 14

def custom? = !%w[explore worker].include?(name)

#read_only?Boolean

Returns read-only agents may only call read-risk tools.

Returns:

  • (Boolean)

    read-only agents may only call read-risk tools



11
# File 'lib/rubyn_code/sub_agents/agent_type.rb', line 11

def read_only? = access == :read