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.



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

def initialize(registry)
  @registry = registry
end

Instance Method Details

#baseline(listing) ⇒ Object



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

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

#loadObject



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

def load
  @registry&.format_for_prompt.to_s
end

#update(prev, curr) ⇒ Object



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

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