shared_tools 0.6.0 → 0.7.0

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.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/lib/shared_tools/tools/apply_patch_tool.rb +1 -1
  3. data/lib/shared_tools/tools/bash_tool.rb +1 -1
  4. data/lib/shared_tools/tools/browser/click_tool.rb +1 -1
  5. data/lib/shared_tools/tools/browser/inspect_tool.rb +1 -1
  6. data/lib/shared_tools/tools/browser/page_inspect_tool.rb +1 -1
  7. data/lib/shared_tools/tools/browser/page_screenshot_tool.rb +1 -1
  8. data/lib/shared_tools/tools/browser/selector_inspect_tool.rb +1 -1
  9. data/lib/shared_tools/tools/browser/text_field_area_set_tool.rb +1 -1
  10. data/lib/shared_tools/tools/browser/visit_tool.rb +1 -1
  11. data/lib/shared_tools/tools/browser_tool.rb +1 -1
  12. data/lib/shared_tools/tools/bundle_tool.rb +1 -1
  13. data/lib/shared_tools/tools/calculator_tool.rb +1 -1
  14. data/lib/shared_tools/tools/clipboard_tool.rb +1 -1
  15. data/lib/shared_tools/tools/composite_analysis_tool.rb +1 -1
  16. data/lib/shared_tools/tools/computer_tool.rb +1 -1
  17. data/lib/shared_tools/tools/cron_tool.rb +1 -1
  18. data/lib/shared_tools/tools/csv_read_tool.rb +1 -1
  19. data/lib/shared_tools/tools/csv_write_tool.rb +1 -1
  20. data/lib/shared_tools/tools/current_date_time_tool.rb +2 -2
  21. data/lib/shared_tools/tools/data_science_kit.rb +1 -1
  22. data/lib/shared_tools/tools/database_query_tool.rb +1 -1
  23. data/lib/shared_tools/tools/database_tool.rb +1 -1
  24. data/lib/shared_tools/tools/diff_tool.rb +1 -1
  25. data/lib/shared_tools/tools/disk/directory_create_tool.rb +1 -1
  26. data/lib/shared_tools/tools/disk/directory_delete_tool.rb +1 -1
  27. data/lib/shared_tools/tools/disk/directory_list_tool.rb +1 -1
  28. data/lib/shared_tools/tools/disk/directory_move_tool.rb +1 -1
  29. data/lib/shared_tools/tools/disk/file_create_tool.rb +1 -1
  30. data/lib/shared_tools/tools/disk/file_delete_tool.rb +1 -1
  31. data/lib/shared_tools/tools/disk/file_move_tool.rb +1 -1
  32. data/lib/shared_tools/tools/disk/file_read_tool.rb +1 -1
  33. data/lib/shared_tools/tools/disk/file_replace_tool.rb +1 -1
  34. data/lib/shared_tools/tools/disk/file_write_tool.rb +1 -1
  35. data/lib/shared_tools/tools/disk_tool.rb +1 -1
  36. data/lib/shared_tools/tools/dns_tool.rb +1 -1
  37. data/lib/shared_tools/tools/doc/docx_reader_tool.rb +1 -1
  38. data/lib/shared_tools/tools/doc/pdf_reader_tool.rb +1 -1
  39. data/lib/shared_tools/tools/doc/spreadsheet_reader_tool.rb +1 -1
  40. data/lib/shared_tools/tools/doc/text_reader_tool.rb +1 -1
  41. data/lib/shared_tools/tools/doc_tool.rb +1 -1
  42. data/lib/shared_tools/tools/docker/compose_run_tool.rb +1 -1
  43. data/lib/shared_tools/tools/download_file_tool.rb +1 -1
  44. data/lib/shared_tools/tools/error_handling_tool.rb +1 -1
  45. data/lib/shared_tools/tools/eval/python_eval_tool.rb +1 -1
  46. data/lib/shared_tools/tools/eval/ruby_eval_tool.rb +1 -1
  47. data/lib/shared_tools/tools/eval/shell_eval_tool.rb +1 -1
  48. data/lib/shared_tools/tools/eval_tool.rb +1 -1
  49. data/lib/shared_tools/tools/gem_tool.rb +1 -1
  50. data/lib/shared_tools/tools/git/add_tool.rb +1 -1
  51. data/lib/shared_tools/tools/git/blame_tool.rb +1 -1
  52. data/lib/shared_tools/tools/git/branch_tool.rb +1 -1
  53. data/lib/shared_tools/tools/git/checkout_tool.rb +1 -1
  54. data/lib/shared_tools/tools/git/commit_tool.rb +1 -1
  55. data/lib/shared_tools/tools/git/diff_tool.rb +1 -1
  56. data/lib/shared_tools/tools/git/grep_tool.rb +1 -1
  57. data/lib/shared_tools/tools/git/log_tool.rb +1 -1
  58. data/lib/shared_tools/tools/git/show_tool.rb +1 -1
  59. data/lib/shared_tools/tools/git/status_tool.rb +1 -1
  60. data/lib/shared_tools/tools/git_tool.rb +1 -1
  61. data/lib/shared_tools/tools/glob_tool.rb +1 -1
  62. data/lib/shared_tools/tools/http_request_tool.rb +1 -1
  63. data/lib/shared_tools/tools/json_query_tool.rb +1 -1
  64. data/lib/shared_tools/tools/lint_tool.rb +1 -1
  65. data/lib/shared_tools/tools/multi_edit_tool.rb +1 -1
  66. data/lib/shared_tools/tools/notification_tool.rb +1 -1
  67. data/lib/shared_tools/tools/parse_ruby_tool.rb +1 -1
  68. data/lib/shared_tools/tools/process_kill_tool.rb +1 -1
  69. data/lib/shared_tools/tools/process_list_tool.rb +1 -1
  70. data/lib/shared_tools/tools/process_output_tool.rb +1 -1
  71. data/lib/shared_tools/tools/process_start_tool.rb +0 -0
  72. data/lib/shared_tools/tools/python_tests_tool.rb +1 -1
  73. data/lib/shared_tools/tools/replace_in_files_tool.rb +1 -1
  74. data/lib/shared_tools/tools/run_tests_tool.rb +1 -1
  75. data/lib/shared_tools/tools/search_codebase_tool.rb +1 -1
  76. data/lib/shared_tools/tools/secure_tool_template.rb +1 -1
  77. data/lib/shared_tools/tools/system_info_tool.rb +1 -1
  78. data/lib/shared_tools/tools/todo_write_tool.rb +1 -1
  79. data/lib/shared_tools/tools/toml_query_tool.rb +1 -1
  80. data/lib/shared_tools/tools/tree_tool.rb +1 -1
  81. data/lib/shared_tools/tools/weather_tool.rb +1 -1
  82. data/lib/shared_tools/tools/web_fetch_tool.rb +1 -1
  83. data/lib/shared_tools/tools/workflow_manager_tool.rb +1 -1
  84. data/lib/shared_tools/tools/yaml_query_tool.rb +1 -1
  85. data/lib/shared_tools/version.rb +1 -1
  86. metadata +17 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 28d0b117ea90e414478dd4e16006c38ca33fd1bcd4a7778ac5a1aed87f168dbd
4
- data.tar.gz: bba1e30acb8b8e329edf85460d87ded7838ce4a687560dca7542d0c6a4ad7a49
3
+ metadata.gz: 95941947776da1920fb3f5d5a5c0a1866d2170810e23cbcfb53e55e79ee32847
4
+ data.tar.gz: be6b46bce0292f7c0092146fe85b09d6572ea1c2fbd0daf8268cfb6e417d3ea3
5
5
  SHA512:
6
- metadata.gz: 02c7930f52bc3498f9f4e7d2648fb10a020a908688e3e551f3ab44857593a4730f2eb531e8abd4924d24c777a286266076a17624c83d42266b0aa19f8e123c61
7
- data.tar.gz: 1341ca665381c7969fc30c4ff650531c0d1cc088a63523c25e3f9991ab2d2b5e24837ef9caed8efbe79959d8d9ea9f666abc4997b469f3de2fb113d4af6e9aba
6
+ metadata.gz: 28c25227c7fa22fe93e56c48136855edb59193dbcc3ea3ca7236e1de4e9512d76f70256dd6d00f47386243fed9aa2589a9d98ba57703cd68f7c8c4139f0588e3
7
+ data.tar.gz: ca6d285368be559a1642e344c4909a05b44fa143ce5d76ebc21471a347912ff3553ec866b416b560b3bacc56672fb275427426d87a52f538e493b4b447cbb8b0
@@ -22,7 +22,7 @@ module SharedTools
22
22
  class ApplyPatchTool < ::RubyLLM::Tool
23
23
  GIT_ENV = { "GIT_PAGER" => "cat", "GIT_TERMINAL_PROMPT" => "0" }.freeze
24
24
 
25
- def self.name = 'apply_patch'
25
+ def self.tool_name = 'apply_patch'
26
26
 
27
27
  description "Apply a unified diff to files under root (as produced by `git diff` / `diff -u`). " \
28
28
  "Validates the patch first and reports the affected files; nothing is written if it " \
@@ -24,7 +24,7 @@ module SharedTools
24
24
  class BashTool < ::RubyLLM::Tool
25
25
  DEFAULT_TIMEOUT = 30
26
26
 
27
- def self.name = 'bash'
27
+ def self.tool_name = 'bash'
28
28
 
29
29
  description "Run a single ALLOWLISTED executable with arguments. " \
30
30
  "No shell is involved: no pipes, redirects, globs, or variable expansion. " \
@@ -11,7 +11,7 @@ module SharedTools
11
11
  # tool.execute(selector: "some text")
12
12
  # tool.execute(selector: "//div[@role='button']")
13
13
  class ClickTool < ::RubyLLM::Tool
14
- def self.name = 'browser_click'
14
+ def self.tool_name = 'browser_click'
15
15
 
16
16
  description "A browser automation tool for clicking any clickable element."
17
17
 
@@ -11,7 +11,7 @@ module SharedTools
11
11
  module Browser
12
12
  # A browser automation tool for finding UI elements by their text content.
13
13
  class InspectTool < ::RubyLLM::Tool
14
- def self.name = 'browser_inspect'
14
+ def self.tool_name = 'browser_inspect'
15
15
 
16
16
  include InspectUtils
17
17
 
@@ -11,7 +11,7 @@ module SharedTools
11
11
  module Browser
12
12
  # A browser automation tool for viewing the full HTML of the page.
13
13
  class PageInspectTool < ::RubyLLM::Tool
14
- def self.name = 'browser_page_inspect'
14
+ def self.tool_name = 'browser_page_inspect'
15
15
 
16
16
  include InspectUtils
17
17
 
@@ -7,7 +7,7 @@ module SharedTools
7
7
  # Saves the screenshot to a file and returns the path — avoids injecting
8
8
  # large base64 blobs into the conversation context.
9
9
  class PageScreenshotTool < ::RubyLLM::Tool
10
- def self.name = 'browser_page_screenshot'
10
+ def self.tool_name = 'browser_page_screenshot'
11
11
 
12
12
  description "Take a screenshot of the current browser page and save it to a file."
13
13
 
@@ -11,7 +11,7 @@ module SharedTools
11
11
  module Browser
12
12
  # A browser automation tool for inspecting elements using CSS selectors.
13
13
  class SelectorInspectTool < ::RubyLLM::Tool
14
- def self.name = 'browser_selector_inspect'
14
+ def self.tool_name = 'browser_selector_inspect'
15
15
 
16
16
  include InspectUtils
17
17
 
@@ -8,7 +8,7 @@ module SharedTools
8
8
  # tool = SharedTools::Tools::Browser::TextFieldSetTool.new(browser:)
9
9
  # tool.execute(selector: "...", text: "...")
10
10
  class TextFieldAreaSetTool < ::RubyLLM::Tool
11
- def self.name = 'browser_text_field_set'
11
+ def self.tool_name = 'browser_text_field_set'
12
12
 
13
13
  description "A browser automation tool for clicking a specific link."
14
14
 
@@ -8,7 +8,7 @@ module SharedTools
8
8
  # tool = SharedTools::Tools::Browser::VisitTool.new(driver:)
9
9
  # tool.execute(to: "https://news.ycombinator.com")
10
10
  class VisitTool < ::RubyLLM::Tool
11
- def self.name = 'browser_visit'
11
+ def self.tool_name = 'browser_visit'
12
12
 
13
13
  description "A browser automation tool for navigating to a specific URL."
14
14
 
@@ -6,7 +6,7 @@ module SharedTools
6
6
  module Tools
7
7
  # A tool for controller a browser.
8
8
  class BrowserTool < ::RubyLLM::Tool
9
- def self.name = 'browser_tool'
9
+ def self.tool_name = 'browser'
10
10
  module Action
11
11
  VISIT = "visit"
12
12
  PAGE_INSPECT = "page_inspect"
@@ -21,7 +21,7 @@ module SharedTools
21
21
  NAME_RE = /\A[A-Za-z0-9_.-]+\z/
22
22
  DEFAULT_TIMEOUT = 180
23
23
 
24
- def self.name = 'bundle'
24
+ def self.tool_name = 'bundle'
25
25
 
26
26
  description "Run Bundler in a project. Actions: install, update, outdated, check, lock, add. " \
27
27
  "For 'add' provide a gem name; for 'update' a gem name is optional (omit to update " \
@@ -11,7 +11,7 @@ end
11
11
  module SharedTools
12
12
  module Tools
13
13
  class CalculatorTool < RubyLLM::Tool
14
- def self.name = 'calculator'
14
+ def self.tool_name = 'calculator'
15
15
 
16
16
  def available?
17
17
  DENTAKU_AVAILABLE
@@ -13,7 +13,7 @@ module SharedTools
13
13
  # tool.execute(action: 'read')
14
14
  # tool.execute(action: 'clear')
15
15
  class ClipboardTool < ::RubyLLM::Tool
16
- def self.name = 'clipboard_tool'
16
+ def self.tool_name = 'clipboard'
17
17
 
18
18
  description <<~DESC
19
19
  Read from, write to, and clear the system clipboard.
@@ -5,7 +5,7 @@ require 'json'
5
5
  module SharedTools
6
6
  module Tools
7
7
  class CompositeAnalysisTool < RubyLLM::Tool
8
- def self.name = "composite_analysis"
8
+ def self.tool_name = "composite_analysis"
9
9
 
10
10
  description <<~'DESCRIPTION'
11
11
  Perform comprehensive multi-stage data analysis by orchestrating multiple specialized analysis steps
@@ -11,7 +11,7 @@ module SharedTools
11
11
  # computer.execute(action: 'mouse_position')
12
12
  # computer.execute(action: 'type', text: 'Hello')
13
13
  class ComputerTool < ::RubyLLM::Tool
14
- def self.name = 'computer_tool'
14
+ def self.tool_name = 'computer'
15
15
  description "A tool for interacting with a computer."
16
16
 
17
17
  module Action
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # tool.execute(action: 'next_times', expression: '0 * * * *', count: 5)
15
15
  # tool.execute(action: 'generate', description: 'every day at 9am')
16
16
  class CronTool < ::RubyLLM::Tool
17
- def self.name = 'cron_tool'
17
+ def self.tool_name = 'cron'
18
18
 
19
19
  description <<~DESC
20
20
  Parse, validate, explain, and generate cron expressions (standard 5-field format).
@@ -16,7 +16,7 @@ module SharedTools
16
16
  MAX_BYTES = 10 * 1024 * 1024
17
17
  DEFAULT_LIMIT = 100
18
18
 
19
- def self.name = 'csv_read'
19
+ def self.tool_name = 'csv_read'
20
20
 
21
21
  description "Read a CSV file and return its rows. By default the first row is treated as a " \
22
22
  "header. Use limit to cap the number of data rows returned."
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # tool = SharedTools::Tools::CsvWriteTool.new
15
15
  # tool.execute(path: "./out.csv", headers: ["name", "age"], rows: [["Alice", 30]])
16
16
  class CsvWriteTool < ::RubyLLM::Tool
17
- def self.name = 'csv_write'
17
+ def self.tool_name = 'csv_write'
18
18
 
19
19
  description "Write rows to a CSV file. Provide rows as an array of arrays (each inner array " \
20
20
  "is a row of cell values, written as strings), with an optional headers array " \
@@ -12,7 +12,7 @@ module SharedTools
12
12
  # tool.execute # full output
13
13
  # tool.execute(format: 'date') # date fields only
14
14
  class CurrentDateTimeTool < ::RubyLLM::Tool
15
- def self.name = 'current_date_time_tool'
15
+ def self.tool_name = 'current_date_time'
16
16
 
17
17
  description <<~DESC
18
18
  Returns the current date, time, timezone, and calendar metadata from the system clock.
@@ -41,7 +41,7 @@ module SharedTools
41
41
  @logger.info("CurrentDateTimeTool#execute format=#{format}")
42
42
 
43
43
  now = Time.now
44
- utc = now.utc
44
+ utc = now.getutc # getutc returns a copy; Time#utc would convert now in place
45
45
 
46
46
  date_info = {
47
47
  year: now.year,
@@ -5,7 +5,7 @@ require 'json'
5
5
  module SharedTools
6
6
  module Tools
7
7
  class DataScienceKit < RubyLLM::Tool
8
- def self.name = "data_science_kit"
8
+ def self.tool_name = "data_science_kit"
9
9
 
10
10
  description <<~'DESCRIPTION'
11
11
  Comprehensive data science and analytics toolkit for performing statistical analysis,
@@ -11,7 +11,7 @@ end
11
11
  module SharedTools
12
12
  module Tools
13
13
  class DatabaseQueryTool < RubyLLM::Tool
14
- def self.name = 'database_query'
14
+ def self.tool_name = 'database_query'
15
15
 
16
16
  def available?
17
17
  SEQUEL_AVAILABLE
@@ -10,7 +10,7 @@ module SharedTools
10
10
  # tool = SharedTools::Tools::DatabaseTool.new(driver:)
11
11
  # tool.execute(statements: ["SELECT * FROM people"])
12
12
  class DatabaseTool < ::RubyLLM::Tool
13
- def self.name = 'database_tool'
13
+ def self.tool_name = 'database'
14
14
  description <<~TEXT
15
15
  Executes SQL commands (INSERT / UPDATE / SELECT / etc) on a database.
16
16
 
@@ -12,7 +12,7 @@ module SharedTools
12
12
  # tool = SharedTools::Tools::DiffTool.new
13
13
  # tool.execute(old: "a\nb\n", new: "a\nc\n")
14
14
  class DiffTool < ::RubyLLM::Tool
15
- def self.name = 'diff'
15
+ def self.tool_name = 'diff'
16
16
 
17
17
  description "Compare two blocks of text and return a readable line-by-line diff " \
18
18
  "(removed lines prefixed -, added lines prefixed +). In-process."
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::DirectoryCreateTool.new(root: "./project")
10
10
  # tool.execute(path: "./foo/bar")
11
11
  class DirectoryCreateTool < ::RubyLLM::Tool
12
- def self.name = 'disk_directory_create'
12
+ def self.tool_name = 'disk_directory_create'
13
13
 
14
14
  description "Creates a directory."
15
15
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::DirectoryDeleteTool.new(root: "./project")
10
10
  # tool.execute(path: "./foo/bar")
11
11
  class DirectoryDeleteTool < ::RubyLLM::Tool
12
- def self.name = 'disk_directory_delete'
12
+ def self.tool_name = 'disk_directory_delete'
13
13
 
14
14
  description "Deletes a directory."
15
15
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::SummaryTool.new(root: "./project")
10
10
  # tool.execute
11
11
  class DirectoryListTool < ::RubyLLM::Tool
12
- def self.name = 'disk_directory_list'
12
+ def self.tool_name = 'disk_directory_list'
13
13
 
14
14
  description "Summarizes the contents (files and directories) of a directory."
15
15
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::DirectoryMoveTool.new(root: "./project")
10
10
  # tool.execute(path: "./foo", destination: "./bar")
11
11
  class DirectoryMoveTool < ::RubyLLM::Tool
12
- def self.name = 'disk_directory_move'
12
+ def self.tool_name = 'disk_directory_move'
13
13
 
14
14
  description "Moves a directory from one location to another."
15
15
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::FileCreateTool.new(root: "./project")
10
10
  # tool.execute(path: "./README.md")
11
11
  class FileCreateTool < ::RubyLLM::Tool
12
- def self.name = 'disk_file_create'
12
+ def self.tool_name = 'disk_file_create'
13
13
 
14
14
  description "Creates a file."
15
15
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::FileDeleteTool.new(root: "./project")
10
10
  # tool.execute(path: "./README.md")
11
11
  class FileDeleteTool < ::RubyLLM::Tool
12
- def self.name = 'disk_file_delete'
12
+ def self.tool_name = 'disk_file_delete'
13
13
 
14
14
  description "Deletes a file."
15
15
 
@@ -12,7 +12,7 @@ module SharedTools
12
12
  # destination: "./README.md",
13
13
  # )
14
14
  class FileMoveTool < ::RubyLLM::Tool
15
- def self.name = 'disk_file_move'
15
+ def self.tool_name = 'disk_file_move'
16
16
 
17
17
  description "Moves a file."
18
18
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::FileReadTool.new
10
10
  # tool.execute(path: "./README.md") # => "..."
11
11
  class FileReadTool < ::RubyLLM::Tool
12
- def self.name = 'disk_file_read'
12
+ def self.tool_name = 'disk_file_read'
13
13
 
14
14
  description "Reads the contents of a file."
15
15
 
@@ -13,7 +13,7 @@ module SharedTools
13
13
  # path: "README.md"
14
14
  # )
15
15
  class FileReplaceTool < ::RubyLLM::Tool
16
- def self.name = 'disk_file_replace'
16
+ def self.tool_name = 'disk_file_replace'
17
17
 
18
18
  description "Replaces a specific string in a file (old_text => new_text)."
19
19
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Disk::FileWriteTool.new(root: "./project")
10
10
  # tool.execute(path: "./README.md", text: "Hello World")
11
11
  class FileWriteTool < ::RubyLLM::Tool
12
- def self.name = 'disk_file_write'
12
+ def self.tool_name = 'disk_file_write'
13
13
 
14
14
  description "Writes the contents of a file."
15
15
 
@@ -13,7 +13,7 @@ module SharedTools
13
13
  # disk.execute(action: SharedTools::Tools::DiskTool::Action::FILE_READ, path: "./demo.rb")
14
14
  # disk.execute(action: SharedTools::Tools::DiskTool::Action::FILE_DELETE, path: "./demo.rb")
15
15
  class DiskTool < ::RubyLLM::Tool
16
- def self.name = 'disk_tool'
16
+ def self.tool_name = 'disk'
17
17
  description <<~TEXT
18
18
  A tool for interacting with a system. It is able to list, create, delete, move and modify directories and files.
19
19
  TEXT
@@ -20,7 +20,7 @@ module SharedTools
20
20
  # tool.execute(action: 'whois', host: 'github.com')
21
21
  # tool.execute(action: 'whois', host: '8.8.8.8')
22
22
  class DnsTool < ::RubyLLM::Tool
23
- def self.name = 'dns_tool'
23
+ def self.tool_name = 'dns'
24
24
 
25
25
  description <<~DESC
26
26
  Perform DNS lookups, reverse lookups, record queries, external IP detection,
@@ -16,7 +16,7 @@ module SharedTools
16
16
  # tool.execute(doc_path: "./report.docx")
17
17
  # tool.execute(doc_path: "./report.docx", paragraph_range: "1-10")
18
18
  class DocxReaderTool < ::RubyLLM::Tool
19
- def self.name = 'doc_docx_read'
19
+ def self.tool_name = 'doc_docx_read'
20
20
 
21
21
  description "Read the text content of a Microsoft Word (.docx) document."
22
22
 
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # tool = SharedTools::Tools::Doc::PdfReaderTool.new
15
15
  # tool.execute(doc_path: "./document.pdf", page_numbers: "1, 5, 10")
16
16
  class PdfReaderTool < ::RubyLLM::Tool
17
- def self.name = 'doc_pdf_read'
17
+ def self.tool_name = 'doc_pdf_read'
18
18
 
19
19
  description "Read the text of any set of pages from a PDF document."
20
20
 
@@ -21,7 +21,7 @@ module SharedTools
21
21
  # @example Read a row range from a worksheet
22
22
  # tool.execute(doc_path: "./report.xlsx", sheet: "Summary", row_range: "2-50")
23
23
  class SpreadsheetReaderTool < ::RubyLLM::Tool
24
- def self.name = 'doc_spreadsheet_read'
24
+ def self.tool_name = 'doc_spreadsheet_read'
25
25
 
26
26
  description "Read tabular data from spreadsheet files (CSV, XLSX, ODS, and other formats)."
27
27
 
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Doc::TextReaderTool.new
10
10
  # tool.execute(doc_path: "./guide.txt")
11
11
  class TextReaderTool < ::RubyLLM::Tool
12
- def self.name = 'doc_text_read'
12
+ def self.tool_name = 'doc_text_read'
13
13
 
14
14
  description "Read the full contents of a plain text file."
15
15
 
@@ -6,7 +6,7 @@ module SharedTools
6
6
  module Tools
7
7
  # A tool for reading and processing documents
8
8
  class DocTool < ::RubyLLM::Tool
9
- def self.name = 'doc_tool'
9
+ def self.tool_name = 'doc'
10
10
 
11
11
  module Action
12
12
  PDF_READ = "pdf_read"
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Docker::ComposeRunTool.new
10
10
  # tool.execute(service: "app", command: "rspec", args: ["spec/main_spec.rb"])
11
11
  class ComposeRunTool < ::RubyLLM::Tool
12
- def self.name = 'docker_compose_run'
12
+ def self.tool_name = 'docker_compose_run'
13
13
 
14
14
  description "Runs a command via Docker with arguments on the project (e.g. `rspec spec/main_spec.rb`)."
15
15
 
@@ -20,7 +20,7 @@ module SharedTools
20
20
  class DownloadFileTool < ::RubyLLM::Tool
21
21
  include HttpHelpers
22
22
 
23
- def self.name = 'download_file'
23
+ def self.tool_name = 'download_file'
24
24
 
25
25
  description "Download an http/https URL to a file within root. SSRF-protected and " \
26
26
  "size-capped. Use for fetching an asset or release to disk (web_fetch returns text " \
@@ -22,7 +22,7 @@ module SharedTools
22
22
  class ResourceNotFoundError < StandardError; end
23
23
 
24
24
  class ErrorHandlingTool < RubyLLM::Tool
25
- def self.name = 'error_handling_tool'
25
+ def self.tool_name = 'error_handling'
26
26
 
27
27
  description <<~'DESCRIPTION'
28
28
  Reference tool demonstrating comprehensive error handling patterns and resilience strategies
@@ -8,7 +8,7 @@ module SharedTools
8
8
  # tool = SharedTools::Tools::Eval::PythonEvalTool.new
9
9
  # tool.execute(code: "print('Hello'); result = 2 + 2")
10
10
  class PythonEvalTool < ::RubyLLM::Tool
11
- def self.name = 'eval_python'
11
+ def self.tool_name = 'eval_python'
12
12
 
13
13
  description <<~DESCRIPTION
14
14
  Execute Python source code safely and return the result.
@@ -9,7 +9,7 @@ module SharedTools
9
9
  # tool = SharedTools::Tools::Eval::RubyEvalTool.new
10
10
  # tool.execute(code: "puts 'Hello'; 2 + 2")
11
11
  class RubyEvalTool < ::RubyLLM::Tool
12
- def self.name = 'eval_ruby'
12
+ def self.tool_name = 'eval_ruby'
13
13
 
14
14
  description <<~DESCRIPTION
15
15
  Execute Ruby source code safely and return the result.
@@ -13,7 +13,7 @@ module SharedTools
13
13
  STDOUT_MAX = 5000
14
14
  STDERR_MAX = 2000
15
15
 
16
- def self.name = 'eval_shell'
16
+ def self.tool_name = 'eval_shell'
17
17
 
18
18
  description "Execute a shell command safely and return the result."
19
19
 
@@ -6,7 +6,7 @@ module SharedTools
6
6
  module Tools
7
7
  # A tool for evaluating code in different programming languages
8
8
  class EvalTool < ::RubyLLM::Tool
9
- def self.name = 'eval_tool'
9
+ def self.tool_name = 'eval'
10
10
 
11
11
  module Action
12
12
  RUBY = "ruby"
@@ -26,7 +26,7 @@ module SharedTools
26
26
  NAME_RE = /\A[A-Za-z0-9_.-]+\z/
27
27
  HOST = "https://rubygems.org"
28
28
 
29
- def self.name = 'gem'
29
+ def self.tool_name = 'gem'
30
30
 
31
31
  description "Look up RubyGems.org metadata for a gem (read-only). Actions: info (summary), " \
32
32
  "version (latest version), dependencies (runtime deps), search (find gems by " \
@@ -15,7 +15,7 @@ module SharedTools
15
15
  class AddTool < ::RubyLLM::Tool
16
16
  include Helpers
17
17
 
18
- def self.name = 'git_add'
18
+ def self.tool_name = 'git_add'
19
19
 
20
20
  description "Stage changes in the repository. Pass specific paths, or set all to stage " \
21
21
  "every change (git add -A)."
@@ -14,7 +14,7 @@ module SharedTools
14
14
  class BlameTool < ::RubyLLM::Tool
15
15
  include Helpers
16
16
 
17
- def self.name = 'git_blame'
17
+ def self.tool_name = 'git_blame'
18
18
 
19
19
  description "Show git blame for a file in the repository: which commit, author, and date " \
20
20
  "last touched each line. Optionally limit to a line range. Read-only."
@@ -15,7 +15,7 @@ module SharedTools
15
15
  class BranchTool < ::RubyLLM::Tool
16
16
  include Helpers
17
17
 
18
- def self.name = 'git_branch'
18
+ def self.tool_name = 'git_branch'
19
19
 
20
20
  description "List the branches of the repository, with the current branch marked (*) and " \
21
21
  "each branch's tip commit. Set all true to include remote-tracking branches. Read-only."
@@ -17,7 +17,7 @@ module SharedTools
17
17
  class CheckoutTool < ::RubyLLM::Tool
18
18
  include Helpers
19
19
 
20
- def self.name = 'git_checkout'
20
+ def self.tool_name = 'git_checkout'
21
21
 
22
22
  description "Switch to a branch/commit in the repository, or create a new branch with " \
23
23
  "create: true. Note this can change the working tree."
@@ -16,7 +16,7 @@ module SharedTools
16
16
  class CommitTool < ::RubyLLM::Tool
17
17
  include Helpers
18
18
 
19
- def self.name = 'git_commit'
19
+ def self.tool_name = 'git_commit'
20
20
 
21
21
  description "Commit staged changes in the repository with a message. Set all to also " \
22
22
  "stage modified/deleted tracked files first (git commit -a). Does not push."
@@ -16,7 +16,7 @@ module SharedTools
16
16
  class DiffTool < ::RubyLLM::Tool
17
17
  include Helpers
18
18
 
19
- def self.name = 'git_diff'
19
+ def self.tool_name = 'git_diff'
20
20
 
21
21
  description "Show a unified git diff for the repository. By default shows unstaged " \
22
22
  "changes; set staged to show what's staged. Optionally scope to a path or diff " \
@@ -16,7 +16,7 @@ module SharedTools
16
16
  class GrepTool < ::RubyLLM::Tool
17
17
  include Helpers
18
18
 
19
- def self.name = 'git_grep'
19
+ def self.tool_name = 'git_grep'
20
20
 
21
21
  description "Search the tracked files of the repository for a pattern using git grep, " \
22
22
  "returning file:line: matches. Optionally restrict to a path, ignore case, or treat " \
@@ -17,7 +17,7 @@ module SharedTools
17
17
  MAX_COUNT = 200
18
18
  FORMAT = "%h %ad %an: %s"
19
19
 
20
- def self.name = 'git_log'
20
+ def self.tool_name = 'git_log'
21
21
 
22
22
  description "Show recent git commit history for the repository (hash, date, author, " \
23
23
  "subject). Optionally limit the count or scope to a path. Read-only."
@@ -15,7 +15,7 @@ module SharedTools
15
15
  class ShowTool < ::RubyLLM::Tool
16
16
  include Helpers
17
17
 
18
- def self.name = 'git_show'
18
+ def self.tool_name = 'git_show'
19
19
 
20
20
  description "Show a git object in the repository. With no path, shows the commit at ref " \
21
21
  "(message and diff). With a path, shows that file's contents as of ref. Defaults " \
@@ -14,7 +14,7 @@ module SharedTools
14
14
  class StatusTool < ::RubyLLM::Tool
15
15
  include Helpers
16
16
 
17
- def self.name = 'git_status'
17
+ def self.tool_name = 'git_status'
18
18
 
19
19
  description "Show the git working-tree status of the repository: current branch and " \
20
20
  "staged, unstaged, and untracked changes. Read-only."
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # git.execute(action: SharedTools::Tools::GitTool::Action::LOG, count: 5)
15
15
  # git.execute(action: SharedTools::Tools::GitTool::Action::COMMIT, message: "Fix the thing")
16
16
  class GitTool < ::RubyLLM::Tool
17
- def self.name = 'git_tool'
17
+ def self.tool_name = 'git'
18
18
 
19
19
  description <<~TEXT
20
20
  A tool for interacting with a git repository. Read-only actions (status, diff, log, show,
@@ -17,7 +17,7 @@ module SharedTools
17
17
  class GlobTool < ::RubyLLM::Tool
18
18
  MAX_RESULTS = 1_000
19
19
 
20
- def self.name = 'glob'
20
+ def self.tool_name = 'glob'
21
21
 
22
22
  description "Find files matching a glob pattern within a directory (e.g. '**/*.rb', " \
23
23
  "'app/models/*.rb'). Returns matching paths, sorted, relative to base."
@@ -21,7 +21,7 @@ module SharedTools
21
21
  MUTATING_METHODS = %w[POST PUT PATCH DELETE].freeze
22
22
  SHOWN_HEADERS = %w[content-type content-length location etag last-modified].freeze
23
23
 
24
- def self.name = 'http_request'
24
+ def self.tool_name = 'http_request'
25
25
 
26
26
  description "Make an HTTP request to an http/https URL and return the status, headers, and " \
27
27
  "body. GET and HEAD are available by default; POST/PUT/PATCH/DELETE require user " \
@@ -19,7 +19,7 @@ module SharedTools
19
19
  class JsonQueryTool < ::RubyLLM::Tool
20
20
  MAX_BYTES = 5 * 1024 * 1024
21
21
 
22
- def self.name = 'json_query'
22
+ def self.tool_name = 'json_query'
23
23
 
24
24
  description "Query JSON with a path expression, or pretty-print it. Provide either a file " \
25
25
  "path or an inline json string. Path syntax: keys separated by dots, [n] for " \
@@ -20,7 +20,7 @@ module SharedTools
20
20
  LINTERS = %w[rubocop standard].freeze
21
21
  DEFAULT_TIMEOUT = 120
22
22
 
23
- def self.name = 'lint'
23
+ def self.tool_name = 'lint'
24
24
 
25
25
  description "Lint a project with RuboCop or Standard. Auto-detects (Standard if .standard.yml " \
26
26
  "is present, else RuboCop) or set linter explicitly. Optionally scope to a path and " \
@@ -23,7 +23,7 @@ module SharedTools
23
23
 
24
24
  MAX_BYTES = 10 * 1024 * 1024
25
25
 
26
- def self.name = 'multi_edit'
26
+ def self.tool_name = 'multi_edit'
27
27
 
28
28
  description "Apply multiple find/replace edits to a single file atomically. Provide edits as " \
29
29
  "an array of objects with old_string, new_string, and optional replace_all. Edits " \
@@ -18,7 +18,7 @@ module SharedTools
18
18
  # @example Text-to-speech
19
19
  # tool.execute(action: 'speak', message: 'Task finished')
20
20
  class NotificationTool < ::RubyLLM::Tool
21
- def self.name = 'notification_tool'
21
+ def self.tool_name = 'notification'
22
22
 
23
23
  description <<~DESC.strip
24
24
  Send desktop notifications, modal alerts, or text-to-speech messages.
@@ -20,7 +20,7 @@ module SharedTools
20
20
  KINDS = %w[class module method constant].freeze
21
21
  MAX_BYTES = 5 * 1024 * 1024
22
22
 
23
- def self.name = 'parse_ruby'
23
+ def self.tool_name = 'parse_ruby'
24
24
 
25
25
  description "Outline a Ruby file's structure (classes, modules, methods, constants with line " \
26
26
  "numbers), or locate definitions. Give a query to find definitions whose name " \
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # tool = SharedTools::Tools::ProcessKillTool.new
15
15
  # tool.execute(id: "proc_1")
16
16
  class ProcessKillTool < ::RubyLLM::Tool
17
- def self.name = 'process_kill'
17
+ def self.tool_name = 'process_kill'
18
18
 
19
19
  description "Stop a background process (started with process_start) and return any final " \
20
20
  "output. Terminates the whole process group, escalating to SIGKILL if needed."
@@ -13,7 +13,7 @@ module SharedTools
13
13
  # tool = SharedTools::Tools::ProcessListTool.new
14
14
  # tool.execute
15
15
  class ProcessListTool < ::RubyLLM::Tool
16
- def self.name = 'process_list'
16
+ def self.tool_name = 'process_list'
17
17
 
18
18
  description "List background processes (started with process_start): id, status, pid, age, and " \
19
19
  "command. Read-only."
@@ -14,7 +14,7 @@ module SharedTools
14
14
  # tool = SharedTools::Tools::ProcessOutputTool.new
15
15
  # tool.execute(id: "proc_1")
16
16
  class ProcessOutputTool < ::RubyLLM::Tool
17
- def self.name = 'process_output'
17
+ def self.tool_name = 'process_output'
18
18
 
19
19
  description "Read new stdout/stderr from a background process (started with process_start) " \
20
20
  "since the last read, along with its status and exit code if it has finished. Poll " \
@@ -22,7 +22,7 @@ module SharedTools
22
22
  FRAMEWORKS = %w[pytest unittest].freeze
23
23
  DEFAULT_TIMEOUT = 180
24
24
 
25
- def self.name = 'python_tests'
25
+ def self.tool_name = 'python_tests'
26
26
 
27
27
  description "Run a Python project's test suite from root and report results. Uses pytest by " \
28
28
  "default, or unittest (python -m unittest discover) when framework is unittest. " \
@@ -21,7 +21,7 @@ module SharedTools
21
21
  REGEX_TIMEOUT = 2
22
22
  IGNORED_DIRS = %w[.git .hg .svn node_modules .bundle tmp].freeze
23
23
 
24
- def self.name = 'replace_in_files'
24
+ def self.tool_name = 'replace_in_files'
25
25
 
26
26
  description "Replace occurrences of a pattern with a replacement across files in root " \
27
27
  "matching a glob (default '**/*'). Literal by default; set regex true to use a " \
@@ -21,7 +21,7 @@ module SharedTools
21
21
  FRAMEWORKS = %w[rspec minitest].freeze
22
22
  DEFAULT_TIMEOUT = 180
23
23
 
24
- def self.name = 'run_tests'
24
+ def self.tool_name = 'run_tests'
25
25
 
26
26
  description "Run a Ruby project's test suite from root and report results. Auto-detects RSpec " \
27
27
  "(spec/ or .rspec) or Minitest (test/ via rake), or set framework explicitly. " \
@@ -29,7 +29,7 @@ module SharedTools
29
29
  REGEX_TIMEOUT = 2
30
30
  IGNORED_DIRS = %w[.git .hg .svn node_modules .bundle tmp].freeze
31
31
 
32
- def self.name = 'search_codebase'
32
+ def self.tool_name = 'search_codebase'
33
33
 
34
34
  description "Search file contents for a regular expression under a directory. Returns " \
35
35
  "'path:line: text' for each match, or context blocks when context/before/after " \
@@ -6,7 +6,7 @@ require 'securerandom'
6
6
  module SharedTools
7
7
  module Tools
8
8
  class SecureToolTemplate < RubyLLM::Tool
9
- def self.name = 'secure_tool_template'
9
+ def self.tool_name = 'secure_tool_template'
10
10
 
11
11
  description <<~'DESCRIPTION'
12
12
  Reference template demonstrating comprehensive security best practices for safe tool development.
@@ -11,7 +11,7 @@ module SharedTools
11
11
  # tool.execute # all categories
12
12
  # tool.execute(category: 'cpu') # CPU only
13
13
  class SystemInfoTool < ::RubyLLM::Tool
14
- def self.name = 'system_info_tool'
14
+ def self.tool_name = 'system_info'
15
15
 
16
16
  description <<~DESC
17
17
  Retrieve system information from the local machine.
@@ -21,7 +21,7 @@ module SharedTools
21
21
  STATUSES = %w[pending in_progress completed].freeze
22
22
  MARKS = { "pending" => "[ ]", "in_progress" => "[~]", "completed" => "[x]" }.freeze
23
23
 
24
- def self.name = 'todo_write'
24
+ def self.tool_name = 'todo_write'
25
25
 
26
26
  description "Maintain a task list for multi-step work. Pass the full list of todos; each call " \
27
27
  "replaces the previous list. Each todo has a content string and a status of " \
@@ -19,7 +19,7 @@ module SharedTools
19
19
  class TomlQueryTool < ::RubyLLM::Tool
20
20
  MAX_BYTES = 5 * 1024 * 1024
21
21
 
22
- def self.name = 'toml_query'
22
+ def self.tool_name = 'toml_query'
23
23
 
24
24
  description "Query TOML with a path expression, or pretty-print it. Provide either a file " \
25
25
  "path or an inline toml string. Path syntax: keys separated by dots, [n] for " \
@@ -18,7 +18,7 @@ module SharedTools
18
18
  MAX_ENTRIES = 500
19
19
  IGNORED_DIRS = %w[.git .hg .svn node_modules .bundle tmp].freeze
20
20
 
21
- def self.name = 'tree'
21
+ def self.tool_name = 'tree'
22
22
 
23
23
  description "Show a directory tree, to a limited depth. Directories are marked with a " \
24
24
  "trailing slash. Skips ignored directories (node_modules, .git, ...) and hidden " \
@@ -11,7 +11,7 @@ end
11
11
  module SharedTools
12
12
  module Tools
13
13
  class WeatherTool < RubyLLM::Tool
14
- def self.name = 'weather_tool'
14
+ def self.tool_name = 'weather'
15
15
 
16
16
  def available?
17
17
  OPENWEATHERMAP_AVAILABLE
@@ -16,7 +16,7 @@ module SharedTools
16
16
  class WebFetchTool < ::RubyLLM::Tool
17
17
  include HttpHelpers
18
18
 
19
- def self.name = 'web_fetch'
19
+ def self.tool_name = 'web_fetch'
20
20
 
21
21
  description "Fetch a web page or text/JSON resource over http/https and return its readable " \
22
22
  "content (HTML is converted to text). Follows redirects safely. Cannot reach " \
@@ -7,7 +7,7 @@ require 'fileutils'
7
7
  module SharedTools
8
8
  module Tools
9
9
  class WorkflowManagerTool < RubyLLM::Tool
10
- def self.name = 'workflow_manager'
10
+ def self.tool_name = 'workflow_manager'
11
11
 
12
12
  description <<~'DESCRIPTION'
13
13
  Manage complex multi-step workflows with persistent state tracking across tool invocations.
@@ -21,7 +21,7 @@ module SharedTools
21
21
  MAX_BYTES = 5 * 1024 * 1024
22
22
  PERMITTED = [Date, Time, Symbol].freeze
23
23
 
24
- def self.name = 'yaml_query'
24
+ def self.tool_name = 'yaml_query'
25
25
 
26
26
  description "Query YAML with a path expression, or pretty-print it. Provide either a file " \
27
27
  "path or an inline yaml string. Loaded safely (no object deserialization). Path " \
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SharedTools
4
- VERSION = "0.6.0"
4
+ VERSION = "0.7.0"
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.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer
@@ -97,6 +97,22 @@ dependencies:
97
97
  - ">="
98
98
  - !ruby/object:Gem::Version
99
99
  version: "0"
100
+ - !ruby/object:Gem::Dependency
101
+ name: tsort
102
+ requirement: !ruby/object:Gem::Requirement
103
+ requirements:
104
+ -
105
+ - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: "0"
108
+ type: :development
109
+ prerelease: false
110
+ version_requirements: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ -
113
+ - ">="
114
+ - !ruby/object:Gem::Version
115
+ version: "0"
100
116
  - !ruby/object:Gem::Dependency
101
117
  name: sequel
102
118
  requirement: !ruby/object:Gem::Requirement