riffer 0.27.0 → 0.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7701c51a8dff2c1da03718cb852c86296ab738839163b86ddf46b5e4e78600da
4
- data.tar.gz: f99baf1c378b7a8a8ce2ec8dad231cd01e70d25cee4a277c2d724c0377dfc56d
3
+ metadata.gz: 22e4b5cd255cc4d66929a8696586b75a5f86d56728b930c50be48050972a5e60
4
+ data.tar.gz: c1a6a0a1f7200f2b9dceedbaccada8620ff39cf718d2cf7bbee6ee9954176441
5
5
  SHA512:
6
- metadata.gz: 423051f85e8fb037526b5aa6500b57b86fa4106a8a701e673df868c216661245a31702d9fb1fb3602a249d0f57dbe074a439e4f5f7a121d6d0c1c945d771f42f
7
- data.tar.gz: a52e8baf66cebd4dc522dc1d836325f35442272d3fb02146c153156cd1232f08ada5cc3dc968033badd65df599fd453fa882d479afecddac8512e3c7d5e12bad
6
+ metadata.gz: 0cf4b811e2c89ab5d71ce64a5d701ea8582d87edb70062440974bba0ab4b0898db74d87b05fbd3b9042b47a2cd9af3ebe0c1efb89022a7a3a6cee34dcd66e9da
7
+ data.tar.gz: d94271b381b08a9bbfa57c372a9dcd3b404601aeaed6ef11e7f78af3a6e7667abc9a8488034fdc6e74b4c13dd6346002d4add9a20f30ac10a73569a62ab401f5
@@ -1,3 +1,3 @@
1
1
  {
2
- ".": "0.27.0"
2
+ ".": "0.27.2"
3
3
  }
data/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.27.2](https://github.com/janeapp/riffer/compare/riffer/v0.27.1...riffer/v0.27.2) (2026-05-04)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * validate tools at the class-level resolution boundary ([#242](https://github.com/janeapp/riffer/issues/242)) ([7abbcd6](https://github.com/janeapp/riffer/commit/7abbcd607f1cbb3e1d45f5d148d902170a78af06))
14
+
15
+ ## [0.27.1](https://github.com/janeapp/riffer/compare/riffer/v0.27.0...riffer/v0.27.1) (2026-05-04)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * validate tools before sending them to providers ([#240](https://github.com/janeapp/riffer/issues/240)) ([537e2ab](https://github.com/janeapp/riffer/commit/537e2abf16542ba9d19d9fd3ffa649aefbca9c10))
21
+
8
22
  ## [0.27.0](https://github.com/janeapp/riffer/compare/riffer/v0.26.0...riffer/v0.27.0) (2026-05-01)
9
23
 
10
24
 
data/lib/riffer/agent.rb CHANGED
@@ -146,20 +146,30 @@ class Riffer::Agent
146
146
  # <tt>skills do; activate_tool ...; end</tt> override when set, otherwise
147
147
  # from <tt>Riffer.config.skills.default_activate_tool</tt>.
148
148
  #
149
+ # Each returned tool class is validated via +validate_as_tool!+, so
150
+ # callers serializing this list to a provider can rely on every entry
151
+ # having the metadata required for tool use (name + description).
152
+ #
149
153
  # Raises Riffer::ArgumentError on tool name conflicts with the skill
150
- # activation tool.
154
+ # activation tool, or when a tool class fails +validate_as_tool!+.
151
155
  #
152
156
  #--
153
157
  #: (?context: Hash[Symbol, untyped]?) -> Array[singleton(Riffer::Tool)]
154
158
  def self.resolved_tool_classes(context: nil)
155
159
  base = resolve_uses_tools_config(context)
156
- return base unless skills
157
160
 
158
- skill_activate_tool_class = skills.activate_tool || Riffer.config.skills.default_activate_tool
159
- if base.any? { |t| t.name == skill_activate_tool_class.name }
160
- raise Riffer::ArgumentError, "Tool name conflict with skill tools: #{skill_activate_tool_class.name}"
161
+ tools = if skills
162
+ skill_activate_tool_class = skills.activate_tool || Riffer.config.skills.default_activate_tool
163
+ if base.any? { |t| t.name == skill_activate_tool_class.name }
164
+ raise Riffer::ArgumentError, "Tool name conflict with skill tools: #{skill_activate_tool_class.name}"
165
+ end
166
+ base + [skill_activate_tool_class]
167
+ else
168
+ base
161
169
  end
162
- base + [skill_activate_tool_class]
170
+
171
+ tools.each(&:validate_as_tool!)
172
+ tools
163
173
  end
164
174
 
165
175
  #--
@@ -834,9 +844,12 @@ class Riffer::Agent
834
844
 
835
845
  #: () -> Array[singleton(Riffer::Tool)]
836
846
  def resolved_tools
837
- @resolved_tools ||= self.class.resolved_tool_classes(context: @context) + resolve_mcp_tool_classes
838
- assert_distinct_tool_names!(@resolved_tools)
839
- @resolved_tools
847
+ @resolved_tools ||= begin
848
+ tools = self.class.resolved_tool_classes(context: @context) + resolve_mcp_tool_classes
849
+ assert_distinct_tool_names!(tools)
850
+ tools.each(&:validate_as_tool!)
851
+ tools
852
+ end
840
853
  end
841
854
 
842
855
  #--
@@ -2,5 +2,5 @@
2
2
  # rbs_inline: enabled
3
3
 
4
4
  module Riffer
5
- VERSION = "0.27.0" #: String
5
+ VERSION = "0.27.2" #: String
6
6
  end
@@ -102,8 +102,12 @@ class Riffer::Agent
102
102
  # <tt>skills do; activate_tool ...; end</tt> override when set, otherwise
103
103
  # from <tt>Riffer.config.skills.default_activate_tool</tt>.
104
104
  #
105
+ # Each returned tool class is validated via +validate_as_tool!+, so
106
+ # callers serializing this list to a provider can rely on every entry
107
+ # having the metadata required for tool use (name + description).
108
+ #
105
109
  # Raises Riffer::ArgumentError on tool name conflicts with the skill
106
- # activation tool.
110
+ # activation tool, or when a tool class fails +validate_as_tool!+.
107
111
  #
108
112
  # --
109
113
  # : (?context: Hash[Symbol, untyped]?) -> Array[singleton(Riffer::Tool)]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: riffer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.0
4
+ version: 0.27.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jake Bottrall
@@ -91,14 +91,14 @@ dependencies:
91
91
  requirements:
92
92
  - - "~>"
93
93
  - !ruby/object:Gem::Version
94
- version: 0.59.0
94
+ version: 0.60.0
95
95
  type: :development
96
96
  prerelease: false
97
97
  version_requirements: !ruby/object:Gem::Requirement
98
98
  requirements:
99
99
  - - "~>"
100
100
  - !ruby/object:Gem::Version
101
- version: 0.59.0
101
+ version: 0.60.0
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: async
104
104
  requirement: !ruby/object:Gem::Requirement