Class: Pikuri::Trifecta::Contribution
- Inherits:
-
Object
- Object
- Pikuri::Trifecta::Contribution
- Defined in:
- lib/pikuri/trifecta/contribution.rb
Overview
What an extension adds to the tree, returned from Agent::Extension#trifecta_contribution. Two independent things, either of which may be empty:
# a sub-agent extension: one child per persona, nothing of its own
Contribution.new(legs: Pikuri::Tool::TrifectaLegs::NONE, children: nodes)
# an MCP extension: legs no tool can declare, no children
Contribution.new(label: '(mcp)', legs: assumed_with_private, children: [])
Needed because two things in the tree are invisible to per-tool tagging:
a sub-agent is a whole node the tools cannot describe, and a foreign tool
surface (MCP) arrives as raw RubyLLM::Tool subclasses with no leg
surface at all.
Immutable.
Instance Attribute Summary collapse
-
#children ⇒ Array<Node>
readonly
Child nodes this extension introduces.
-
#label ⇒ String
readonly
Name of the row these
legsappear under in the report, parenthesized to mark it as not-a-tool. -
#legs ⇒ Pikuri::Tool::TrifectaLegs
readonly
Legs this extension adds to the node it is wired into, over and above that node's own tools.
Instance Method Summary collapse
-
#initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) ⇒ Contribution
constructor
A new instance of Contribution.
Constructor Details
#initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) ⇒ Contribution
Returns a new instance of Contribution.
38 39 40 |
# File 'lib/pikuri/trifecta/contribution.rb', line 38 def initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) super end |
Instance Attribute Details
#children ⇒ Array<Node> (readonly)
Returns child nodes this extension introduces.
34 35 36 37 38 39 40 41 |
# File 'lib/pikuri/trifecta/contribution.rb', line 34 class Contribution < Data.define(:label, :legs, :children) # @param label [String] row name for +legs+; ignored when they are +NONE+ # @param legs [Pikuri::Tool::TrifectaLegs] # @param children [Array<Node>] def initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) super end end |
#label ⇒ String (readonly)
Returns name of the row these legs appear under in the
report, parenthesized to mark it as not-a-tool. It is what
Report#attribution points the reader at, so it
has to name the surface they can actually go and change — two
extensions declaring under one label would blame each other's
wiring.
34 35 36 37 38 39 40 41 |
# File 'lib/pikuri/trifecta/contribution.rb', line 34 class Contribution < Data.define(:label, :legs, :children) # @param label [String] row name for +legs+; ignored when they are +NONE+ # @param legs [Pikuri::Tool::TrifectaLegs] # @param children [Array<Node>] def initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) super end end |
#legs ⇒ Pikuri::Tool::TrifectaLegs (readonly)
Returns legs this extension adds to the node it is wired into, over and above that node's own tools.
34 35 36 37 38 39 40 41 |
# File 'lib/pikuri/trifecta/contribution.rb', line 34 class Contribution < Data.define(:label, :legs, :children) # @param label [String] row name for +legs+; ignored when they are +NONE+ # @param legs [Pikuri::Tool::TrifectaLegs] # @param children [Array<Node>] def initialize(label: '(extension)', legs: Pikuri::Tool::TrifectaLegs::NONE, children: []) super end end |