Class: Agentilda::Agent

Inherits:
Data
  • Object
show all
Defined in:
lib/agentilda/agent.rb

Overview

One specialist, loaded from ~/.agents/agents/<name>.md.

The definition files are the single source of truth for who does what: the frontmatter says which plan states this agent handles and what it may write, and the body is the prompt. Nothing about a specialty is duplicated in Ruby.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#advances_toSymbol? (readonly)

Returns the state it is expected to reach; nil = read-only.

Returns:

  • (Symbol, nil)

    the state it is expected to reach; nil = read-only



28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#allowed_toolsArray<String> (readonly)

Returns:

  • (Array<String>)


28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#descriptionString (readonly)

Returns:

  • (String)


28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#handlesArray<Symbol> (readonly)

Returns plan states this agent is offered work from.

Returns:

  • (Array<Symbol>)

    plan states this agent is offered work from



28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#mayArray<String> (readonly)

Returns commands lifted from Executor::FORBIDDEN_COMMANDS for this agent alone. Nothing in Executor::UNGRANTABLE can be lifted.

Returns:



28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#modelString? (readonly)

Returns:

  • (String, nil)


28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#nameString (readonly)

Returns:

  • (String)


28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

#networkObject (readonly)

Returns the value of attribute network

Returns:

  • (Object)

    the current value of network



28
29
30
# File 'lib/agentilda/agent.rb', line 28

def network
  @network
end

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



28
29
30
# File 'lib/agentilda/agent.rb', line 28

def path
  @path
end

#promptObject (readonly)

Returns the value of attribute prompt

Returns:

  • (Object)

    the current value of prompt



28
29
30
# File 'lib/agentilda/agent.rb', line 28

def prompt
  @prompt
end

#timeoutInteger? (readonly)

Returns seconds before this agent is abandoned; nil defers to the executor's run-wide default.

Returns:

  • (Integer, nil)

    seconds before this agent is abandoned; nil defers to the executor's run-wide default



28
29
30
31
32
33
34
35
36
# File 'lib/agentilda/agent.rb', line 28

Agent = Data.define(:name, :description, :handles, :advances_to, :model,
  :allowed_tools, :may, :network, :timeout, :prompt, :path) do
  # @return [Boolean] whether this agent changes anything on disk
  def read_only? = advances_to.nil?

  # @param status [Agentilda::Status]
  # @return [Boolean]
  def handles?(status) = handles.include?(status.key)
end

Instance Method Details

#handles?(status) ⇒ Boolean

Parameters:

Returns:

  • (Boolean)


35
# File 'lib/agentilda/agent.rb', line 35

def handles?(status) = handles.include?(status.key)

#read_only?Boolean

Returns whether this agent changes anything on disk.

Returns:

  • (Boolean)

    whether this agent changes anything on disk



31
# File 'lib/agentilda/agent.rb', line 31

def read_only? = advances_to.nil?