shared_tools 0.7.0 → 0.7.1

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: 95941947776da1920fb3f5d5a5c0a1866d2170810e23cbcfb53e55e79ee32847
4
- data.tar.gz: be6b46bce0292f7c0092146fe85b09d6572ea1c2fbd0daf8268cfb6e417d3ea3
3
+ metadata.gz: 34cacf7e0ae9289b41abac0941cd1123ff725d8dbac4d8ed8d793e7a01fdac88
4
+ data.tar.gz: cba8ee56b7c22b41847ce844c09edffb2e29a49844cd79a6eab1ccab758b25a3
5
5
  SHA512:
6
- metadata.gz: 28c25227c7fa22fe93e56c48136855edb59193dbcc3ea3ca7236e1de4e9512d76f70256dd6d00f47386243fed9aa2589a9d98ba57703cd68f7c8c4139f0588e3
7
- data.tar.gz: ca6d285368be559a1642e344c4909a05b44fa143ce5d76ebc21471a347912ff3553ec866b416b560b3bacc56672fb275427426d87a52f538e493b4b447cbb8b0
6
+ metadata.gz: 94dde27edb4d0b7e4d6df7537012df4bdb9d5f06a1e7e3839610d08b85ea3524056dd4eb6b3bc7cddf49791c9af9f7159fde9ed567c9a135d9fcb3653f633352
7
+ data.tar.gz: 3cb75f11a57a07a41695f46ad02e70d70af52506fe0778ae11bae53388fb12ffed06ceb524d9060e0b483d89b7c1f690d8949389b2d7d6732ada3917c1015b80
data/CHANGELOG.md CHANGED
@@ -8,6 +8,8 @@
8
8
  - **Breaking:** Requiring a client file no longer has side effects. It does not check environment variables, does not run `brew`/`apt`/`dnf`, and does not connect; environment variables are read when the server process starts. Use `Klass.available?` / `missing_envars` / `verify!` (raises `LoadError` like before) and `Klass.install_packages!`. `require 'shared_tools/mcp'` loads every definition, records availability for `SharedTools.mcp_status`, and `SharedTools::MCP.available` lists the usable classes.
9
9
  - **Breaking:** MCP server names are now symbol-friendly: `brave-search` → `brave_search`, `hugging-face` → `hugging_face`, `sequential-thinking` → `sequential_thinking` (others unchanged). These are the names in `SharedTools.mcp_status` and `chat.mcp[...]`.
10
10
  - Removed `lib/shared_tools/mcp/streamable_http_patch.rb`; it patched a `ruby_llm-mcp` internal. ruby_llm 2.1's spec-compliant SSE parser already handles mixed CRLF/LF line endings.
11
+ - Added `description` to `SharedTools::MCP::ClientSupport` (class macro plus instance reader; subclasses inherit it) and gave every MCP client one. robot_lab's `mcp_discovery: true` scores servers by name plus description, so it can now pick e.g. `SharedTools::MCP::GitHub` for "open a pull request" and `Playwright` for "take a screenshot of the page".
12
+ - Added `csv` as a runtime dependency. It is a bundled (not default) gem since Ruby 3.4, so `CsvReadTool`/`CsvWriteTool` -- and `SharedTools.tools` / `load_all_tools`, which eager-load them -- raised `LoadError: cannot load such file -- csv` in any bundle that did not list it.
11
13
  - Added `test/shared_tools/tool_classes_test.rb`: every shipped `RubyLLM::Tool` subclass must define its own `#execute`, expose an object `parameters_schema` whose properties `#execute` accepts, and no 1.x `params do` / `param :` may remain in `lib/`. It also calls `current_date_time`, `system_info` and `dns` (used by aia's demo 18) through `Tool#call` and checks the data they return. Added `test/shared_tools/mcp/clients_test.rb` (class-level only; no servers are started).
12
14
  - Updated the MCP examples, `lib/shared_tools/mcp/README.md`, `README.md` and `docs/` for the new MCP classes.
13
15
 
@@ -30,6 +30,8 @@ module SharedTools
30
30
  class BraveSearch < ::RubyLLM::MCP
31
31
  extend ClientSupport
32
32
 
33
+ description "Brave web search: current web pages, news, and local results"
34
+
33
35
  requires_envars "BRAVE_API_KEY"
34
36
 
35
37
  command "npx", "-y", "@modelcontextprotocol/server-brave-search"
@@ -29,6 +29,8 @@ module SharedTools
29
29
  class Chart < ::RubyLLM::MCP
30
30
  extend ClientSupport
31
31
 
32
+ description "Generate charts and data visualisations (bar, line, pie, maps, diagrams)"
33
+
32
34
  command "npx", "-y", "@antv/mcp-server-chart"
33
35
  end
34
36
  end
@@ -50,10 +50,29 @@ module SharedTools
50
50
  end
51
51
 
52
52
  module ClientSupport
53
+ # Instance-side reader, so a server instance answers #description the
54
+ # way robot_lab's RobotLab::MCP::Server does.
55
+ module InstanceMethods
56
+ def description
57
+ self.class.description.to_s
58
+ end
59
+ end
60
+
53
61
  def self.extended(klass)
62
+ klass.include(InstanceMethods)
54
63
  SharedTools::MCP.register(klass)
55
64
  end
56
65
 
66
+ # Declares (or, with no argument, returns) a short description of what
67
+ # the server offers. robot_lab's mcp_discovery scores servers by name
68
+ # plus description, so a description lets it pick this server for
69
+ # relevant messages. Subclasses inherit their parent's description.
70
+ def description(text = nil)
71
+ return @description || (superclass.description if superclass.respond_to?(:description)) if text.nil?
72
+
73
+ @description = text.to_s
74
+ end
75
+
57
76
  # Declares (or, with no arguments, returns) the environment variables
58
77
  # the server needs. All of them must be set for #available? to be true.
59
78
  def requires_envars(*names)
@@ -30,6 +30,8 @@ module SharedTools
30
30
  class GitHub < ::RubyLLM::MCP
31
31
  extend ClientSupport
32
32
 
33
+ description "GitHub repositories, issues, pull requests, code search, commits, branches, and releases"
34
+
33
35
  self.default_name = "github"
34
36
 
35
37
  requires_envars "GITHUB_PERSONAL_ACCESS_TOKEN"
@@ -32,6 +32,8 @@ module SharedTools
32
32
  class HuggingFace < ::RubyLLM::MCP
33
33
  extend ClientSupport
34
34
 
35
+ description "Hugging Face Hub: search models, datasets, Spaces, and papers"
36
+
35
37
  requires_envars "HF_TOKEN"
36
38
  requires_packages "hf-mcp-server"
37
39
 
@@ -30,6 +30,8 @@ module SharedTools
30
30
  class Memory < ::RubyLLM::MCP
31
31
  extend ClientSupport
32
32
 
33
+ description "Persistent knowledge graph memory: remember and recall facts, entities, and relations across conversations"
34
+
33
35
  command "npx", "-y", "@modelcontextprotocol/server-memory"
34
36
  # An unset MEMORY_FILE_PATH resolves to "", which the server treats as unset.
35
37
  env "MEMORY_FILE_PATH" => env_from("MEMORY_FILE_PATH")
@@ -32,6 +32,8 @@ module SharedTools
32
32
  class Notion < ::RubyLLM::MCP
33
33
  extend ClientSupport
34
34
 
35
+ description "Notion workspace pages, databases, and search"
36
+
35
37
  requires_envars "NOTION_TOKEN"
36
38
  requires_packages "notion-mcp-server"
37
39
 
@@ -32,6 +32,8 @@ module SharedTools
32
32
  class Playwright < ::RubyLLM::MCP
33
33
  extend ClientSupport
34
34
 
35
+ description "Browser automation: navigate web pages, click, type, fill forms, take screenshots"
36
+
35
37
  command "npx", "-y", "@playwright/mcp"
36
38
  end
37
39
  end
@@ -30,6 +30,8 @@ module SharedTools
30
30
  class SequentialThinking < ::RubyLLM::MCP
31
31
  extend ClientSupport
32
32
 
33
+ description "Step-by-step chain-of-thought reasoning for complex, multi-stage problems"
34
+
33
35
  command "npx", "-y", "@modelcontextprotocol/server-sequential-thinking"
34
36
  end
35
37
  end
@@ -39,6 +39,8 @@ module SharedTools
39
39
  class Slack < ::RubyLLM::MCP
40
40
  extend ClientSupport
41
41
 
42
+ description "Slack channels, messages, threads, users, and search"
43
+
42
44
  TOKEN_ENVARS = %w[SLACK_MCP_XOXP_TOKEN SLACK_MCP_XOXB_TOKEN].freeze
43
45
 
44
46
  requires_packages "slack-mcp-server"
@@ -31,6 +31,8 @@ module SharedTools
31
31
  class Tavily < ::RubyLLM::MCP
32
32
  extend ClientSupport
33
33
 
34
+ description "Tavily web search and page extraction for research and current events"
35
+
34
36
  requires_envars "TAVILY_API_KEY"
35
37
 
36
38
  url "https://mcp.tavily.com/mcp/"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SharedTools
4
- VERSION = "0.7.0"
4
+ VERSION = "0.7.1"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shared_tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -65,6 +65,22 @@ dependencies:
65
65
  - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: "0"
68
+ - !ruby/object:Gem::Dependency
69
+ name: csv
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ -
73
+ - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ -
81
+ - ">="
82
+ - !ruby/object:Gem::Version
83
+ version: "0"
68
84
  - !ruby/object:Gem::Dependency
69
85
  name: bigdecimal
70
86
  requirement: !ruby/object:Gem::Requirement