shared_tools 0.2.1 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +594 -42
- data/lib/shared_tools/{ruby_llm/mcp → mcp}/github_mcp_server.rb +31 -24
- data/lib/shared_tools/mcp/imcp.rb +28 -0
- data/lib/shared_tools/mcp/tavily_mcp_server.rb +44 -0
- data/lib/shared_tools/mcp.rb +24 -0
- data/lib/shared_tools/tools/browser/base_driver.rb +64 -0
- data/lib/shared_tools/tools/browser/base_tool.rb +50 -0
- data/lib/shared_tools/tools/browser/click_tool.rb +54 -0
- data/lib/shared_tools/tools/browser/elements/element_grouper.rb +73 -0
- data/lib/shared_tools/tools/browser/elements/nearby_element_detector.rb +109 -0
- data/lib/shared_tools/tools/browser/formatters/action_formatter.rb +37 -0
- data/lib/shared_tools/tools/browser/formatters/data_entry_formatter.rb +135 -0
- data/lib/shared_tools/tools/browser/formatters/element_formatter.rb +52 -0
- data/lib/shared_tools/tools/browser/formatters/input_formatter.rb +59 -0
- data/lib/shared_tools/tools/browser/inspect_tool.rb +87 -0
- data/lib/shared_tools/tools/browser/inspect_utils.rb +51 -0
- data/lib/shared_tools/tools/browser/page_inspect/button_summarizer.rb +140 -0
- data/lib/shared_tools/tools/browser/page_inspect/form_summarizer.rb +98 -0
- data/lib/shared_tools/tools/browser/page_inspect/html_summarizer.rb +37 -0
- data/lib/shared_tools/tools/browser/page_inspect/link_summarizer.rb +103 -0
- data/lib/shared_tools/tools/browser/page_inspect_tool.rb +55 -0
- data/lib/shared_tools/tools/browser/page_screenshot_tool.rb +39 -0
- data/lib/shared_tools/tools/browser/selector_generator/base_selectors.rb +28 -0
- data/lib/shared_tools/tools/browser/selector_generator/contextual_selectors.rb +140 -0
- data/lib/shared_tools/tools/browser/selector_generator.rb +73 -0
- data/lib/shared_tools/tools/browser/selector_inspect_tool.rb +67 -0
- data/lib/shared_tools/tools/browser/text_field_area_set_tool.rb +45 -0
- data/lib/shared_tools/tools/browser/visit_tool.rb +43 -0
- data/lib/shared_tools/tools/browser/watir_driver.rb +132 -0
- data/lib/shared_tools/tools/browser.rb +27 -0
- data/lib/shared_tools/tools/browser_tool.rb +255 -0
- data/lib/shared_tools/tools/calculator_tool.rb +169 -0
- data/lib/shared_tools/tools/composite_analysis_tool.rb +520 -0
- data/lib/shared_tools/tools/computer/base_driver.rb +177 -0
- data/lib/shared_tools/tools/computer/mac_driver.rb +103 -0
- data/lib/shared_tools/tools/computer.rb +21 -0
- data/lib/shared_tools/tools/computer_tool.rb +207 -0
- data/lib/shared_tools/tools/data_science_kit.rb +707 -0
- data/lib/shared_tools/tools/database/base_driver.rb +17 -0
- data/lib/shared_tools/tools/database/postgres_driver.rb +30 -0
- data/lib/shared_tools/tools/database/sqlite_driver.rb +29 -0
- data/lib/shared_tools/tools/database.rb +9 -0
- data/lib/shared_tools/tools/database_query_tool.rb +313 -0
- data/lib/shared_tools/tools/database_tool.rb +99 -0
- data/lib/shared_tools/tools/devops_toolkit.rb +420 -0
- data/lib/shared_tools/tools/disk/base_driver.rb +91 -0
- data/lib/shared_tools/tools/disk/base_tool.rb +20 -0
- data/lib/shared_tools/tools/disk/directory_create_tool.rb +39 -0
- data/lib/shared_tools/tools/disk/directory_delete_tool.rb +39 -0
- data/lib/shared_tools/tools/disk/directory_list_tool.rb +37 -0
- data/lib/shared_tools/tools/disk/directory_move_tool.rb +40 -0
- data/lib/shared_tools/tools/disk/file_create_tool.rb +38 -0
- data/lib/shared_tools/tools/disk/file_delete_tool.rb +40 -0
- data/lib/shared_tools/tools/disk/file_move_tool.rb +43 -0
- data/lib/shared_tools/tools/disk/file_read_tool.rb +40 -0
- data/lib/shared_tools/tools/disk/file_replace_tool.rb +44 -0
- data/lib/shared_tools/tools/disk/file_write_tool.rb +40 -0
- data/lib/shared_tools/tools/disk/local_driver.rb +91 -0
- data/lib/shared_tools/tools/disk.rb +17 -0
- data/lib/shared_tools/tools/disk_tool.rb +132 -0
- data/lib/shared_tools/tools/doc/pdf_reader_tool.rb +79 -0
- data/lib/shared_tools/tools/doc.rb +8 -0
- data/lib/shared_tools/tools/doc_tool.rb +109 -0
- data/lib/shared_tools/tools/docker/base_tool.rb +56 -0
- data/lib/shared_tools/tools/docker/compose_run_tool.rb +77 -0
- data/lib/shared_tools/tools/docker.rb +8 -0
- data/lib/shared_tools/tools/error_handling_tool.rb +403 -0
- data/lib/shared_tools/tools/eval/python_eval_tool.rb +209 -0
- data/lib/shared_tools/tools/eval/ruby_eval_tool.rb +93 -0
- data/lib/shared_tools/tools/eval/shell_eval_tool.rb +64 -0
- data/lib/shared_tools/tools/eval.rb +10 -0
- data/lib/shared_tools/tools/eval_tool.rb +139 -0
- data/lib/shared_tools/tools/secure_tool_template.rb +353 -0
- data/lib/shared_tools/tools/version.rb +7 -0
- data/lib/shared_tools/tools/weather_tool.rb +197 -0
- data/lib/shared_tools/tools/workflow_manager_tool.rb +312 -0
- data/lib/shared_tools/tools.rb +16 -0
- data/lib/shared_tools/version.rb +1 -1
- data/lib/shared_tools.rb +9 -33
- metadata +189 -68
- data/lib/shared_tools/llm_rb/run_shell_command.rb +0 -23
- data/lib/shared_tools/llm_rb.rb +0 -9
- data/lib/shared_tools/omniai.rb +0 -9
- data/lib/shared_tools/raix/what_is_the_weather.rb +0 -18
- data/lib/shared_tools/raix.rb +0 -9
- data/lib/shared_tools/ruby_llm/edit_file.rb +0 -71
- data/lib/shared_tools/ruby_llm/incomplete/calculator_tool.rb +0 -70
- data/lib/shared_tools/ruby_llm/incomplete/composite_analysis_tool.rb +0 -89
- data/lib/shared_tools/ruby_llm/incomplete/data_science_kit.rb +0 -128
- data/lib/shared_tools/ruby_llm/incomplete/database_query_tool.rb +0 -100
- data/lib/shared_tools/ruby_llm/incomplete/devops_toolkit.rb +0 -112
- data/lib/shared_tools/ruby_llm/incomplete/error_handling_tool.rb +0 -109
- data/lib/shared_tools/ruby_llm/incomplete/secure_tool_template.rb +0 -117
- data/lib/shared_tools/ruby_llm/incomplete/weather_tool.rb +0 -110
- data/lib/shared_tools/ruby_llm/incomplete/workflow_manager_tool.rb +0 -145
- data/lib/shared_tools/ruby_llm/list_files.rb +0 -49
- data/lib/shared_tools/ruby_llm/mcp/imcp.rb +0 -33
- data/lib/shared_tools/ruby_llm/mcp.rb +0 -10
- data/lib/shared_tools/ruby_llm/pdf_page_reader.rb +0 -59
- data/lib/shared_tools/ruby_llm/python_eval.rb +0 -194
- data/lib/shared_tools/ruby_llm/read_file.rb +0 -40
- data/lib/shared_tools/ruby_llm/ruby_eval.rb +0 -77
- data/lib/shared_tools/ruby_llm/run_shell_command.rb +0 -49
- data/lib/shared_tools/ruby_llm.rb +0 -12
metadata
CHANGED
|
@@ -1,36 +1,64 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: shared_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
|
-
-
|
|
7
|
+
- Dewayne VanHoozer
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: ruby_llm
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: ruby_llm-mcp
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ">="
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: '0'
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - ">="
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: '0'
|
|
12
40
|
- !ruby/object:Gem::Dependency
|
|
13
41
|
name: zeitwerk
|
|
14
42
|
requirement: !ruby/object:Gem::Requirement
|
|
15
43
|
requirements:
|
|
16
|
-
- - "
|
|
44
|
+
- - ">="
|
|
17
45
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: '
|
|
46
|
+
version: '0'
|
|
19
47
|
type: :runtime
|
|
20
48
|
prerelease: false
|
|
21
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
50
|
requirements:
|
|
23
|
-
- - "
|
|
51
|
+
- - ">="
|
|
24
52
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: '
|
|
53
|
+
version: '0'
|
|
26
54
|
- !ruby/object:Gem::Dependency
|
|
27
|
-
name:
|
|
55
|
+
name: nokogiri
|
|
28
56
|
requirement: !ruby/object:Gem::Requirement
|
|
29
57
|
requirements:
|
|
30
58
|
- - ">="
|
|
31
59
|
- !ruby/object:Gem::Version
|
|
32
60
|
version: '0'
|
|
33
|
-
type: :
|
|
61
|
+
type: :runtime
|
|
34
62
|
prerelease: false
|
|
35
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
64
|
requirements:
|
|
@@ -38,13 +66,41 @@ dependencies:
|
|
|
38
66
|
- !ruby/object:Gem::Version
|
|
39
67
|
version: '0'
|
|
40
68
|
- !ruby/object:Gem::Dependency
|
|
41
|
-
name:
|
|
69
|
+
name: dentaku
|
|
42
70
|
requirement: !ruby/object:Gem::Requirement
|
|
43
71
|
requirements:
|
|
44
72
|
- - ">="
|
|
45
73
|
- !ruby/object:Gem::Version
|
|
46
74
|
version: '0'
|
|
47
|
-
type: :
|
|
75
|
+
type: :runtime
|
|
76
|
+
prerelease: false
|
|
77
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
78
|
+
requirements:
|
|
79
|
+
- - ">="
|
|
80
|
+
- !ruby/object:Gem::Version
|
|
81
|
+
version: '0'
|
|
82
|
+
- !ruby/object:Gem::Dependency
|
|
83
|
+
name: sequel
|
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
|
85
|
+
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '0'
|
|
89
|
+
type: :runtime
|
|
90
|
+
prerelease: false
|
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
92
|
+
requirements:
|
|
93
|
+
- - ">="
|
|
94
|
+
- !ruby/object:Gem::Version
|
|
95
|
+
version: '0'
|
|
96
|
+
- !ruby/object:Gem::Dependency
|
|
97
|
+
name: openweathermap
|
|
98
|
+
requirement: !ruby/object:Gem::Requirement
|
|
99
|
+
requirements:
|
|
100
|
+
- - ">="
|
|
101
|
+
- !ruby/object:Gem::Version
|
|
102
|
+
version: '0'
|
|
103
|
+
type: :runtime
|
|
48
104
|
prerelease: false
|
|
49
105
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
106
|
requirements:
|
|
@@ -55,18 +111,18 @@ dependencies:
|
|
|
55
111
|
name: pdf-reader
|
|
56
112
|
requirement: !ruby/object:Gem::Requirement
|
|
57
113
|
requirements:
|
|
58
|
-
- - "
|
|
114
|
+
- - ">="
|
|
59
115
|
- !ruby/object:Gem::Version
|
|
60
|
-
version: '
|
|
116
|
+
version: '0'
|
|
61
117
|
type: :development
|
|
62
118
|
prerelease: false
|
|
63
119
|
version_requirements: !ruby/object:Gem::Requirement
|
|
64
120
|
requirements:
|
|
65
|
-
- - "
|
|
121
|
+
- - ">="
|
|
66
122
|
- !ruby/object:Gem::Version
|
|
67
|
-
version: '
|
|
123
|
+
version: '0'
|
|
68
124
|
- !ruby/object:Gem::Dependency
|
|
69
|
-
name:
|
|
125
|
+
name: sqlite3
|
|
70
126
|
requirement: !ruby/object:Gem::Requirement
|
|
71
127
|
requirements:
|
|
72
128
|
- - ">="
|
|
@@ -80,47 +136,61 @@ dependencies:
|
|
|
80
136
|
- !ruby/object:Gem::Version
|
|
81
137
|
version: '0'
|
|
82
138
|
- !ruby/object:Gem::Dependency
|
|
83
|
-
name:
|
|
139
|
+
name: watir
|
|
84
140
|
requirement: !ruby/object:Gem::Requirement
|
|
85
141
|
requirements:
|
|
86
|
-
- - "
|
|
142
|
+
- - ">="
|
|
87
143
|
- !ruby/object:Gem::Version
|
|
88
|
-
version:
|
|
144
|
+
version: '0'
|
|
89
145
|
type: :development
|
|
90
146
|
prerelease: false
|
|
91
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
148
|
requirements:
|
|
93
|
-
- - "
|
|
149
|
+
- - ">="
|
|
94
150
|
- !ruby/object:Gem::Version
|
|
95
|
-
version:
|
|
151
|
+
version: '0'
|
|
96
152
|
- !ruby/object:Gem::Dependency
|
|
97
|
-
name:
|
|
153
|
+
name: webdrivers
|
|
98
154
|
requirement: !ruby/object:Gem::Requirement
|
|
99
155
|
requirements:
|
|
100
|
-
- - "
|
|
156
|
+
- - ">="
|
|
101
157
|
- !ruby/object:Gem::Version
|
|
102
|
-
version: 0
|
|
158
|
+
version: '0'
|
|
103
159
|
type: :development
|
|
104
160
|
prerelease: false
|
|
105
161
|
version_requirements: !ruby/object:Gem::Requirement
|
|
106
162
|
requirements:
|
|
107
|
-
- - "
|
|
163
|
+
- - ">="
|
|
108
164
|
- !ruby/object:Gem::Version
|
|
109
|
-
version: 0
|
|
165
|
+
version: '0'
|
|
166
|
+
- !ruby/object:Gem::Dependency
|
|
167
|
+
name: macos
|
|
168
|
+
requirement: !ruby/object:Gem::Requirement
|
|
169
|
+
requirements:
|
|
170
|
+
- - ">="
|
|
171
|
+
- !ruby/object:Gem::Version
|
|
172
|
+
version: '0'
|
|
173
|
+
type: :development
|
|
174
|
+
prerelease: false
|
|
175
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
176
|
+
requirements:
|
|
177
|
+
- - ">="
|
|
178
|
+
- !ruby/object:Gem::Version
|
|
179
|
+
version: '0'
|
|
110
180
|
- !ruby/object:Gem::Dependency
|
|
111
181
|
name: bundler
|
|
112
182
|
requirement: !ruby/object:Gem::Requirement
|
|
113
183
|
requirements:
|
|
114
|
-
- - "
|
|
184
|
+
- - ">="
|
|
115
185
|
- !ruby/object:Gem::Version
|
|
116
|
-
version: '
|
|
186
|
+
version: '0'
|
|
117
187
|
type: :development
|
|
118
188
|
prerelease: false
|
|
119
189
|
version_requirements: !ruby/object:Gem::Requirement
|
|
120
190
|
requirements:
|
|
121
|
-
- - "
|
|
191
|
+
- - ">="
|
|
122
192
|
- !ruby/object:Gem::Version
|
|
123
|
-
version: '
|
|
193
|
+
version: '0'
|
|
124
194
|
- !ruby/object:Gem::Dependency
|
|
125
195
|
name: debug_me
|
|
126
196
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -136,38 +206,38 @@ dependencies:
|
|
|
136
206
|
- !ruby/object:Gem::Version
|
|
137
207
|
version: '0'
|
|
138
208
|
- !ruby/object:Gem::Dependency
|
|
139
|
-
name:
|
|
209
|
+
name: minitest
|
|
140
210
|
requirement: !ruby/object:Gem::Requirement
|
|
141
211
|
requirements:
|
|
142
|
-
- - "
|
|
212
|
+
- - ">="
|
|
143
213
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '
|
|
214
|
+
version: '0'
|
|
145
215
|
type: :development
|
|
146
216
|
prerelease: false
|
|
147
217
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
218
|
requirements:
|
|
149
|
-
- - "
|
|
219
|
+
- - ">="
|
|
150
220
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '
|
|
221
|
+
version: '0'
|
|
152
222
|
- !ruby/object:Gem::Dependency
|
|
153
|
-
name:
|
|
223
|
+
name: rake
|
|
154
224
|
requirement: !ruby/object:Gem::Requirement
|
|
155
225
|
requirements:
|
|
156
|
-
- - "
|
|
226
|
+
- - ">="
|
|
157
227
|
- !ruby/object:Gem::Version
|
|
158
|
-
version: '
|
|
228
|
+
version: '0'
|
|
159
229
|
type: :development
|
|
160
230
|
prerelease: false
|
|
161
231
|
version_requirements: !ruby/object:Gem::Requirement
|
|
162
232
|
requirements:
|
|
163
|
-
- - "
|
|
233
|
+
- - ">="
|
|
164
234
|
- !ruby/object:Gem::Version
|
|
165
|
-
version: '
|
|
235
|
+
version: '0'
|
|
166
236
|
description: |
|
|
167
|
-
SharedTools provides a collection of reusable common tools
|
|
168
|
-
for Ruby applications using
|
|
237
|
+
SharedTools provides a collection of reusable common tools
|
|
238
|
+
for Ruby applications using ruby_llm gem.
|
|
169
239
|
email:
|
|
170
|
-
-
|
|
240
|
+
- dvanhoozer@gmail.com
|
|
171
241
|
executables: []
|
|
172
242
|
extensions: []
|
|
173
243
|
extra_rdoc_files: []
|
|
@@ -176,31 +246,82 @@ files:
|
|
|
176
246
|
- LICENSE
|
|
177
247
|
- README.md
|
|
178
248
|
- lib/shared_tools.rb
|
|
179
|
-
- lib/shared_tools/
|
|
180
|
-
- lib/shared_tools/
|
|
181
|
-
- lib/shared_tools/
|
|
182
|
-
- lib/shared_tools/
|
|
183
|
-
- lib/shared_tools/
|
|
184
|
-
- lib/shared_tools/
|
|
185
|
-
- lib/shared_tools/
|
|
186
|
-
- lib/shared_tools/
|
|
187
|
-
- lib/shared_tools/
|
|
188
|
-
- lib/shared_tools/
|
|
189
|
-
- lib/shared_tools/
|
|
190
|
-
- lib/shared_tools/
|
|
191
|
-
- lib/shared_tools/
|
|
192
|
-
- lib/shared_tools/
|
|
193
|
-
- lib/shared_tools/
|
|
194
|
-
- lib/shared_tools/
|
|
195
|
-
- lib/shared_tools/
|
|
196
|
-
- lib/shared_tools/
|
|
197
|
-
- lib/shared_tools/
|
|
198
|
-
- lib/shared_tools/
|
|
199
|
-
- lib/shared_tools/
|
|
200
|
-
- lib/shared_tools/
|
|
201
|
-
- lib/shared_tools/
|
|
202
|
-
- lib/shared_tools/
|
|
203
|
-
- lib/shared_tools/
|
|
249
|
+
- lib/shared_tools/mcp.rb
|
|
250
|
+
- lib/shared_tools/mcp/github_mcp_server.rb
|
|
251
|
+
- lib/shared_tools/mcp/imcp.rb
|
|
252
|
+
- lib/shared_tools/mcp/tavily_mcp_server.rb
|
|
253
|
+
- lib/shared_tools/tools.rb
|
|
254
|
+
- lib/shared_tools/tools/browser.rb
|
|
255
|
+
- lib/shared_tools/tools/browser/base_driver.rb
|
|
256
|
+
- lib/shared_tools/tools/browser/base_tool.rb
|
|
257
|
+
- lib/shared_tools/tools/browser/click_tool.rb
|
|
258
|
+
- lib/shared_tools/tools/browser/elements/element_grouper.rb
|
|
259
|
+
- lib/shared_tools/tools/browser/elements/nearby_element_detector.rb
|
|
260
|
+
- lib/shared_tools/tools/browser/formatters/action_formatter.rb
|
|
261
|
+
- lib/shared_tools/tools/browser/formatters/data_entry_formatter.rb
|
|
262
|
+
- lib/shared_tools/tools/browser/formatters/element_formatter.rb
|
|
263
|
+
- lib/shared_tools/tools/browser/formatters/input_formatter.rb
|
|
264
|
+
- lib/shared_tools/tools/browser/inspect_tool.rb
|
|
265
|
+
- lib/shared_tools/tools/browser/inspect_utils.rb
|
|
266
|
+
- lib/shared_tools/tools/browser/page_inspect/button_summarizer.rb
|
|
267
|
+
- lib/shared_tools/tools/browser/page_inspect/form_summarizer.rb
|
|
268
|
+
- lib/shared_tools/tools/browser/page_inspect/html_summarizer.rb
|
|
269
|
+
- lib/shared_tools/tools/browser/page_inspect/link_summarizer.rb
|
|
270
|
+
- lib/shared_tools/tools/browser/page_inspect_tool.rb
|
|
271
|
+
- lib/shared_tools/tools/browser/page_screenshot_tool.rb
|
|
272
|
+
- lib/shared_tools/tools/browser/selector_generator.rb
|
|
273
|
+
- lib/shared_tools/tools/browser/selector_generator/base_selectors.rb
|
|
274
|
+
- lib/shared_tools/tools/browser/selector_generator/contextual_selectors.rb
|
|
275
|
+
- lib/shared_tools/tools/browser/selector_inspect_tool.rb
|
|
276
|
+
- lib/shared_tools/tools/browser/text_field_area_set_tool.rb
|
|
277
|
+
- lib/shared_tools/tools/browser/visit_tool.rb
|
|
278
|
+
- lib/shared_tools/tools/browser/watir_driver.rb
|
|
279
|
+
- lib/shared_tools/tools/browser_tool.rb
|
|
280
|
+
- lib/shared_tools/tools/calculator_tool.rb
|
|
281
|
+
- lib/shared_tools/tools/composite_analysis_tool.rb
|
|
282
|
+
- lib/shared_tools/tools/computer.rb
|
|
283
|
+
- lib/shared_tools/tools/computer/base_driver.rb
|
|
284
|
+
- lib/shared_tools/tools/computer/mac_driver.rb
|
|
285
|
+
- lib/shared_tools/tools/computer_tool.rb
|
|
286
|
+
- lib/shared_tools/tools/data_science_kit.rb
|
|
287
|
+
- lib/shared_tools/tools/database.rb
|
|
288
|
+
- lib/shared_tools/tools/database/base_driver.rb
|
|
289
|
+
- lib/shared_tools/tools/database/postgres_driver.rb
|
|
290
|
+
- lib/shared_tools/tools/database/sqlite_driver.rb
|
|
291
|
+
- lib/shared_tools/tools/database_query_tool.rb
|
|
292
|
+
- lib/shared_tools/tools/database_tool.rb
|
|
293
|
+
- lib/shared_tools/tools/devops_toolkit.rb
|
|
294
|
+
- lib/shared_tools/tools/disk.rb
|
|
295
|
+
- lib/shared_tools/tools/disk/base_driver.rb
|
|
296
|
+
- lib/shared_tools/tools/disk/base_tool.rb
|
|
297
|
+
- lib/shared_tools/tools/disk/directory_create_tool.rb
|
|
298
|
+
- lib/shared_tools/tools/disk/directory_delete_tool.rb
|
|
299
|
+
- lib/shared_tools/tools/disk/directory_list_tool.rb
|
|
300
|
+
- lib/shared_tools/tools/disk/directory_move_tool.rb
|
|
301
|
+
- lib/shared_tools/tools/disk/file_create_tool.rb
|
|
302
|
+
- lib/shared_tools/tools/disk/file_delete_tool.rb
|
|
303
|
+
- lib/shared_tools/tools/disk/file_move_tool.rb
|
|
304
|
+
- lib/shared_tools/tools/disk/file_read_tool.rb
|
|
305
|
+
- lib/shared_tools/tools/disk/file_replace_tool.rb
|
|
306
|
+
- lib/shared_tools/tools/disk/file_write_tool.rb
|
|
307
|
+
- lib/shared_tools/tools/disk/local_driver.rb
|
|
308
|
+
- lib/shared_tools/tools/disk_tool.rb
|
|
309
|
+
- lib/shared_tools/tools/doc.rb
|
|
310
|
+
- lib/shared_tools/tools/doc/pdf_reader_tool.rb
|
|
311
|
+
- lib/shared_tools/tools/doc_tool.rb
|
|
312
|
+
- lib/shared_tools/tools/docker.rb
|
|
313
|
+
- lib/shared_tools/tools/docker/base_tool.rb
|
|
314
|
+
- lib/shared_tools/tools/docker/compose_run_tool.rb
|
|
315
|
+
- lib/shared_tools/tools/error_handling_tool.rb
|
|
316
|
+
- lib/shared_tools/tools/eval.rb
|
|
317
|
+
- lib/shared_tools/tools/eval/python_eval_tool.rb
|
|
318
|
+
- lib/shared_tools/tools/eval/ruby_eval_tool.rb
|
|
319
|
+
- lib/shared_tools/tools/eval/shell_eval_tool.rb
|
|
320
|
+
- lib/shared_tools/tools/eval_tool.rb
|
|
321
|
+
- lib/shared_tools/tools/secure_tool_template.rb
|
|
322
|
+
- lib/shared_tools/tools/version.rb
|
|
323
|
+
- lib/shared_tools/tools/weather_tool.rb
|
|
324
|
+
- lib/shared_tools/tools/workflow_manager_tool.rb
|
|
204
325
|
- lib/shared_tools/version.rb
|
|
205
326
|
homepage: https://github.com/madbomber/shared_tools
|
|
206
327
|
licenses:
|
|
@@ -223,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
223
344
|
- !ruby/object:Gem::Version
|
|
224
345
|
version: '0'
|
|
225
346
|
requirements: []
|
|
226
|
-
rubygems_version: 3.
|
|
347
|
+
rubygems_version: 3.7.2
|
|
227
348
|
specification_version: 4
|
|
228
349
|
summary: Shared utilities and AI tools for Ruby applications with configurable logging
|
|
229
350
|
test_files: []
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../../shared_tools'
|
|
4
|
-
|
|
5
|
-
module SharedTools
|
|
6
|
-
verify_gem :llm_rb
|
|
7
|
-
|
|
8
|
-
RunShellCommand = LLM.function(:system) do |fn|
|
|
9
|
-
fn.description "Run a shell command"
|
|
10
|
-
|
|
11
|
-
fn.params do |schema|
|
|
12
|
-
schema.object(command: schema.string.required)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
fn.define do |params|
|
|
16
|
-
ro, wo = IO.pipe
|
|
17
|
-
re, we = IO.pipe
|
|
18
|
-
Process.wait Process.spawn(params.command, out: wo, err: we)
|
|
19
|
-
[wo, we].each(&:close)
|
|
20
|
-
{ stderr: re.read, stdout: ro.read }
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
end
|
data/lib/shared_tools/llm_rb.rb
DELETED
data/lib/shared_tools/omniai.rb
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative "../../shared_tools"
|
|
4
|
-
|
|
5
|
-
module SharedTools
|
|
6
|
-
verify_gem :raix
|
|
7
|
-
|
|
8
|
-
class WhatIsTheWeather
|
|
9
|
-
include ::Raix::ChatCompletion
|
|
10
|
-
include ::Raix::FunctionDispatch
|
|
11
|
-
|
|
12
|
-
function :check_weather,
|
|
13
|
-
"Check the weather for a location",
|
|
14
|
-
location: { type: "string", required: true } do |arguments|
|
|
15
|
-
"The weather in #{arguments[:location]} is hot and sunny"
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
end
|
data/lib/shared_tools/raix.rb
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require_relative '../../shared_tools'
|
|
4
|
-
|
|
5
|
-
module SharedTools
|
|
6
|
-
verify_gem :ruby_llm
|
|
7
|
-
|
|
8
|
-
class EditFile < ::RubyLLM::Tool
|
|
9
|
-
def self.name = 'edit_file'
|
|
10
|
-
|
|
11
|
-
description <<~DESCRIPTION
|
|
12
|
-
Make edits to a text file.
|
|
13
|
-
|
|
14
|
-
Replaces 'old_str' with 'new_str' in the given file.
|
|
15
|
-
'old_str' and 'new_str' MUST be different from each other.
|
|
16
|
-
|
|
17
|
-
If the file specified with path doesn't exist, it will be created.
|
|
18
|
-
|
|
19
|
-
By default, only the first occurrence will be replaced. Set replace_all to true to replace all occurrences.
|
|
20
|
-
DESCRIPTION
|
|
21
|
-
param :path, desc: "The path to the file"
|
|
22
|
-
param :old_str, desc: "Text to search for - must match exactly"
|
|
23
|
-
param :new_str, desc: "Text to replace old_str with"
|
|
24
|
-
param :replace_all, desc: "Whether to replace all occurrences (true) or just the first one (false)", required: false
|
|
25
|
-
|
|
26
|
-
def execute(path:, old_str:, new_str:, replace_all: false)
|
|
27
|
-
RubyLLM.logger.info("Editing file: #{path}")
|
|
28
|
-
|
|
29
|
-
# Normalize path to absolute path
|
|
30
|
-
absolute_path = File.absolute_path(path)
|
|
31
|
-
|
|
32
|
-
if File.exist?(absolute_path)
|
|
33
|
-
RubyLLM.logger.debug("File exists, reading content")
|
|
34
|
-
content = File.read(absolute_path)
|
|
35
|
-
else
|
|
36
|
-
RubyLLM.logger.debug("File doesn't exist, creating new file")
|
|
37
|
-
content = ""
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
matches = content.scan(old_str).size
|
|
41
|
-
RubyLLM.logger.debug("Found #{matches} matches for the string to replace")
|
|
42
|
-
|
|
43
|
-
if matches == 0
|
|
44
|
-
RubyLLM.logger.warn("No matches found for the string to replace. File will remain unchanged.")
|
|
45
|
-
return { success: false, warning: "No matches found for the string to replace" }
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
if matches > 1 && !replace_all
|
|
49
|
-
RubyLLM.logger.warn("Multiple matches (#{matches}) found for the string to replace. Only the first occurrence will be replaced.")
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
if replace_all
|
|
53
|
-
updated_content = content.gsub(old_str, new_str)
|
|
54
|
-
replaced_count = matches
|
|
55
|
-
RubyLLM.logger.info("Replacing all #{matches} occurrences")
|
|
56
|
-
else
|
|
57
|
-
updated_content = content.sub(old_str, new_str)
|
|
58
|
-
replaced_count = 1
|
|
59
|
-
RubyLLM.logger.info("Replacing first occurrence only")
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
File.write(absolute_path, updated_content)
|
|
63
|
-
|
|
64
|
-
RubyLLM.logger.info("Successfully updated file: #{path}")
|
|
65
|
-
{ success: true, matches: matches, replaced: replaced_count }
|
|
66
|
-
rescue => e
|
|
67
|
-
RubyLLM.logger.error("Failed to edit file '#{path}': #{e.message}")
|
|
68
|
-
{ error: e.message }
|
|
69
|
-
end
|
|
70
|
-
end
|
|
71
|
-
end
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
# calculator_tool.rb - Simple custom tool example
|
|
2
|
-
require 'ruby_llm/tool'
|
|
3
|
-
|
|
4
|
-
module Tools
|
|
5
|
-
class Calculator < RubyLLM::Tool
|
|
6
|
-
def self.name = "calculator"
|
|
7
|
-
|
|
8
|
-
description <<~DESCRIPTION
|
|
9
|
-
Perform advanced mathematical calculations with comprehensive error handling and validation.
|
|
10
|
-
This tool supports basic arithmetic operations, parentheses, and common mathematical functions.
|
|
11
|
-
It provides safe evaluation of mathematical expressions without executing arbitrary code,
|
|
12
|
-
making it suitable for use in AI-assisted calculations where security is important.
|
|
13
|
-
The tool returns formatted results with configurable precision and helpful error messages
|
|
14
|
-
when invalid expressions are provided.
|
|
15
|
-
DESCRIPTION
|
|
16
|
-
|
|
17
|
-
param :expression,
|
|
18
|
-
desc: <<~DESC,
|
|
19
|
-
Mathematical expression to evaluate using standard arithmetic operators and parentheses.
|
|
20
|
-
Supported operations include: addition (+), subtraction (-), multiplication (*), division (/),
|
|
21
|
-
and parentheses for grouping. Examples: '2 + 2', '(10 * 5) / 2', '15.5 - 3.2'.
|
|
22
|
-
Only numeric characters, operators, parentheses, decimal points, and spaces are allowed
|
|
23
|
-
for security reasons. Complex mathematical functions are not supported in this version.
|
|
24
|
-
DESC
|
|
25
|
-
type: :string,
|
|
26
|
-
required: true
|
|
27
|
-
|
|
28
|
-
param :precision,
|
|
29
|
-
desc: <<~DESC,
|
|
30
|
-
Number of decimal places to display in the result. Must be a non-negative integer.
|
|
31
|
-
Set to 0 for whole numbers only, or higher values for more precise decimal results.
|
|
32
|
-
Default is 2 decimal places, which works well for most financial and general calculations.
|
|
33
|
-
Maximum precision is limited to 10 decimal places to prevent excessive output.
|
|
34
|
-
DESC
|
|
35
|
-
type: :integer,
|
|
36
|
-
default: 2
|
|
37
|
-
|
|
38
|
-
def execute(expression:, precision: 2)
|
|
39
|
-
begin
|
|
40
|
-
# Use safe evaluation instead of raw eval
|
|
41
|
-
result = safe_eval(expression)
|
|
42
|
-
formatted_result = result.round(precision)
|
|
43
|
-
|
|
44
|
-
{
|
|
45
|
-
success: true,
|
|
46
|
-
result: formatted_result,
|
|
47
|
-
expression: expression,
|
|
48
|
-
precision: precision
|
|
49
|
-
}
|
|
50
|
-
rescue => e
|
|
51
|
-
{
|
|
52
|
-
success: false,
|
|
53
|
-
error: "Invalid expression: #{e.message}",
|
|
54
|
-
expression: expression,
|
|
55
|
-
suggestion: "Try expressions like '2 + 2' or '10 * 5'"
|
|
56
|
-
}
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
private
|
|
61
|
-
|
|
62
|
-
def safe_eval(expression)
|
|
63
|
-
# Implement safe mathematical evaluation
|
|
64
|
-
# This is a simplified example - use a proper math parser in production
|
|
65
|
-
allowed_chars = /\A[0-9+\-*\/\(\)\.\s]+\z/
|
|
66
|
-
raise "Invalid characters in expression" unless expression.match?(allowed_chars)
|
|
67
|
-
eval(expression)
|
|
68
|
-
end
|
|
69
|
-
end
|
|
70
|
-
end
|