Class: Pikuri::Skill::Promoted

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/skill/promoted.rb

Overview

Emitted when a touched file brings +paths:+-gated skills into play, so a UI can say why a skill it never listed suddenly exists:

Promoted.new(skills: [rdoc], path: 'lib/pikuri/agent.rb').to_s
# => "skills available: writing-rdoc (matched lib/pikuri/agent.rb)"

path is load-bearing rather than decoration: activation deliberately over-fires (a coarse glob costs a few hundred bytes, a missed one costs the skill), so a human will see a skill appear for no visible reason, and without the trigger, diagnosing it means guessing which glob matched.

This fires before the tool result the touch produced: the listener decides at before_tool_call, while the injection itself waits for the tool batch to be answered. "We decided" and "the model saw it" are genuinely different moments; Agent::Event::SystemInjected marks the second one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



21
22
23
# File 'lib/pikuri/skill/promoted.rb', line 21

def path
  @path
end

#skillsObject (readonly)

Returns the value of attribute skills

Returns:

  • (Object)

    the current value of skills



21
22
23
# File 'lib/pikuri/skill/promoted.rb', line 21

def skills
  @skills
end

Instance Method Details

#to_sString

Returns one line, for a renderer with no case arm of its own.

Returns:

  • (String)

    one line, for a renderer with no case arm of its own



23
# File 'lib/pikuri/skill/promoted.rb', line 23

def to_s = "skills available: #{skills.map(&:name).join(', ')} (matched #{path})"