omniai-tools 0.6.0 → 0.6.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: 50e3528ac19ae28cd4360f56a696e9d5cfb1ff81a3d3b89469a65c5fcaefbd83
4
- data.tar.gz: da593f7ac889edfae81b6a7f68559008dfcde4db86f698f439b219a9fe649ad3
3
+ metadata.gz: d9fc703ed47e1756627d0f2078e340839f6f7b1f9f7f7dec6d16db9ef187a5b5
4
+ data.tar.gz: 81b50a1493dfab9218ab87c5529ad96e6915e42bf9db5926da0ca2f1a7d89f86
5
5
  SHA512:
6
- metadata.gz: 98eca70c71d4f1eb509e6234de4aefbe8750116f8ed6882e21a10565fbd636d1982128f11de3c244dc32d0ba40e1e7a77b86b653935a8dc4ee1a78515453644b
7
- data.tar.gz: 4191ddbcd454fffd8eff72f61d7470c502d8405d08782981bea5f4e3908b8bc6c767b57563cd24e7b40f9a203bbe3e20c340f1fc966e4f1dffada7a044871686
6
+ metadata.gz: a8161e1fc16285ab875ce9836d53e9accff7b039d1b79f9e4ff7ae362b4e38125ea1683475ae1e846640d938a9c676c19213f9c0757c5364e28943e256e8237f
7
+ data.tar.gz: a95cf834e444627c57ea2a71fe81564fb232baa6bc708537c5b825895777d24b516f56d806a8bcfa5f84db0bdabc0aadeaa6ba098663f70a2f4cbba9228e503e
@@ -13,6 +13,7 @@ module OmniAI
13
13
  LINK_CLICK = "link_click"
14
14
  ELEMENT_CLICK = "element_click"
15
15
  TEXT_FIELD_SET = "text_field_set"
16
+ SCREENSHOT = "screenshot"
16
17
  end
17
18
 
18
19
  ACTIONS = [
@@ -24,6 +25,7 @@ module OmniAI
24
25
  Action::LINK_CLICK,
25
26
  Action::ELEMENT_CLICK,
26
27
  Action::TEXT_FIELD_SET,
28
+ Action::SCREENSHOT,
27
29
  ].freeze
28
30
 
29
31
  description <<~TEXT
@@ -102,6 +104,7 @@ module OmniAI
102
104
  * `#{Action::LINK_CLICK}`: Click a link element
103
105
  * `#{Action::ELEMENT_CLICK}`: Click any clickable element
104
106
  * `#{Action::TEXT_FIELD_SET}`: Enter text in input fields or text areas
107
+ * `#{Action::SCREENSHOT}`: Take a screenshot of the current page
105
108
  TEXT
106
109
 
107
110
  parameter :url, :string, description: <<~TEXT
@@ -4,10 +4,10 @@ module OmniAI
4
4
  module Tools
5
5
  module Disk
6
6
  # @example
7
- # tool = OmniAI::Tools::Disk::DirectoryCreateTool.new(root: "./project")
8
- # tool.execute(path: "./foo/bar")
9
- class DirectoryCreateTool < BaseTool
10
- description "Creates a directory."
7
+ # tool = OmniAI::Tools::Disk::DirectoryMoveTool.new(root: "./project")
8
+ # tool.execute(old_path: "./foo", new_path: "./bar")
9
+ class DirectoryMoveTool < BaseTool
10
+ description "Moves a directory from one location to another."
11
11
 
12
12
  parameter :old_path, :string, description: "a path (e.g. `./old`)"
13
13
  parameter :new_path, :string, description: "a path (e.g. `./new`)"
@@ -19,9 +19,8 @@ module OmniAI
19
19
  #
20
20
  # @return [String]
21
21
  def execute(old_path:, new_path:)
22
- @logger.info("#{self.class.name}#execute path=#{path.inspect}")
23
-
24
- FileUtils.mv(old_path, new_path)
22
+ @logger.info("#{self.class.name}#execute old_path=#{old_path.inspect} new_path=#{new_path.inspect}")
23
+ FileUtils.mv(resolve!(path: old_path), resolve!(path: new_path))
25
24
  rescue SecurityError => e
26
25
  @logger.error(e.message)
27
26
  raise e
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OmniAI
4
4
  module Tools
5
- VERSION = "0.6.0"
5
+ VERSION = "0.6.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniai-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre