Class: Agentilda::Agent
- Inherits:
-
Data
- Object
- Data
- Agentilda::Agent
- 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
-
#advances_to ⇒ Symbol?
readonly
The state it is expected to reach; nil = read-only.
- #allowed_tools ⇒ Array<String> readonly
- #description ⇒ String readonly
-
#handles ⇒ Array<Symbol>
readonly
Plan states this agent is offered work from.
-
#may ⇒ Array<String>
readonly
Commands lifted from Executor::FORBIDDEN_COMMANDS for this agent alone.
- #model ⇒ String? readonly
- #name ⇒ String readonly
-
#network ⇒ Object
readonly
Returns the value of attribute network.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#prompt ⇒ Object
readonly
Returns the value of attribute prompt.
-
#timeout ⇒ Integer?
readonly
Seconds before this agent is abandoned; nil defers to the executor's run-wide default.
Instance Method Summary collapse
- #handles?(status) ⇒ Boolean
-
#read_only? ⇒ Boolean
Whether this agent changes anything on disk.
Instance Attribute Details
#advances_to ⇒ Symbol? (readonly)
Returns 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_tools ⇒ Array<String> (readonly)
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 |
#description ⇒ String (readonly)
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 |
#handles ⇒ Array<Symbol> (readonly)
Returns 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 |
#may ⇒ Array<String> (readonly)
Returns commands lifted from Executor::FORBIDDEN_COMMANDS for this agent alone. Nothing in Executor::UNGRANTABLE can be lifted.
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 |
#model ⇒ String? (readonly)
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 |
#name ⇒ String (readonly)
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 |
#network ⇒ Object (readonly)
Returns the value of attribute network
28 29 30 |
# File 'lib/agentilda/agent.rb', line 28 def network @network end |
#path ⇒ Object (readonly)
Returns the value of attribute path
28 29 30 |
# File 'lib/agentilda/agent.rb', line 28 def path @path end |
#prompt ⇒ Object (readonly)
Returns the value of attribute prompt
28 29 30 |
# File 'lib/agentilda/agent.rb', line 28 def prompt @prompt end |
#timeout ⇒ Integer? (readonly)
Returns 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
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.
31 |
# File 'lib/agentilda/agent.rb', line 31 def read_only? = advances_to.nil? |