Class: Ask::Agent::ContextSources::SkillsList

Inherits:
Ask::Agent::ContextSource show all
Defined in:
lib/ask/agent/context_sources.rb

Overview

The "## Available Skills" listing from the skills registry. Only renders when the registry has skills to list.

Instance Method Summary collapse

Methods inherited from Ask::Agent::ContextSource

inherited, key, #key, registered_sources

Constructor Details

#initialize(registry) ⇒ SkillsList

Returns a new instance of SkillsList.



29
30
31
# File 'lib/ask/agent/context_sources.rb', line 29

def initialize(registry)
  @registry = registry
end

Instance Method Details

#baseline(listing) ⇒ Object



37
38
39
# File 'lib/ask/agent/context_sources.rb', line 37

def baseline(listing)
  listing.empty? ? nil : listing
end

#loadObject



33
34
35
# File 'lib/ask/agent/context_sources.rb', line 33

def load
  @registry&.format_for_prompt.to_s
end

#update(prev, curr) ⇒ Object



41
42
43
44
# File 'lib/ask/agent/context_sources.rb', line 41

def update(prev, curr)
  return nil if prev == curr
  return "Skills have been updated:\n#{curr}"
end