ox-ai-workers 0.5.0 → 0.5.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: e39a685e524452b7b7aa6547817f9e81c522c8fa8f48c35c4745322986e57e5e
4
- data.tar.gz: 5f1fd1aaa0c019be6fc06cc607d963909a3e244c371b03ecb74aa5b48c7e507d
3
+ metadata.gz: 1b3d80806db64371193199ae3e0731060a156fd08398628e68fdd0bae2fa459c
4
+ data.tar.gz: bd70e01c89c093a85b2f32cf62b6de0826fff868378721e4203bfbc732998a63
5
5
  SHA512:
6
- metadata.gz: 1ae293da7bd885026371f173336efaa6de81714c86607c4013bee836222722c0be19f9b77099b3ffab0b064b8e954c60f8de64d65fb9afd99950ac98a5be2053
7
- data.tar.gz: b0a9bb36f6b9ec5b123934f698017ac65306212ef9467b9623b1de3fad43cf3e1e4c3a2b78069ba35de72e94d197e0f05cf20bc33c2c1fb902a370b8483b489a
6
+ metadata.gz: 796005900f27745768ec4cb9467937aaad3cb2dd2cad6d76e8ae3fa1a0da29a32c596de8456d491b3c7fadfc2db9324369befbf120ceddfc1224bbb53cdba05b
7
+ data.tar.gz: 8d1fcf58fbaf734dab49276bec6fdd6f8aabddbe187c0a97495fe1ca767e5dfcdd09eb56069bfc3574712941fe3e7d77a1b2420ca7b294ef2a701b4d7deb1e5b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.1] - 2024-07-30
4
+
5
+ - Improved FileSystem functionality
6
+ - Catch errors when eval sh command
7
+ - Fixed `execute` in Iterator
8
+
3
9
  ## [0.5.0] - 2024-07-30
4
10
 
5
11
  - snake_cased function names
@@ -30,7 +30,7 @@ module OxAiWorkers
30
30
  @worker = worker
31
31
  @tools = [self] + tools
32
32
  @role = role
33
- @context = nil
33
+ @context = []
34
34
  @monologue = I18n.t('oxaiworkers.iterator.monologue')
35
35
 
36
36
  @on_inner_monologue = on_inner_monologue
@@ -80,7 +80,7 @@ module OxAiWorkers
80
80
  @messages = []
81
81
  @worker.finish
82
82
  rebuild_worker
83
- complete! if can_complete?
83
+ # complete! if can_complete?
84
84
  @on_pack_history&.call(text: text)
85
85
  nil
86
86
  end
@@ -176,7 +176,7 @@ module OxAiWorkers
176
176
  end
177
177
 
178
178
  def valid?
179
- @messages.any?
179
+ @messages.present? || @milestones.present?
180
180
  end
181
181
  end
182
182
  end
@@ -23,10 +23,14 @@ module OxAiWorkers
23
23
 
24
24
  def sh(input:)
25
25
  puts Rainbow("Executing sh: \"#{input}\"").red
26
- stdout_and_stderr_s, status = Open3.capture2e(input)
27
- return stdout_and_stderr_s if stdout_and_stderr_s.present?
26
+ begin
27
+ stdout_and_stderr_s, status = Open3.capture2e(input)
28
+ return stdout_and_stderr_s if stdout_and_stderr_s.present?
28
29
 
29
- status.to_s
30
+ status.to_s
31
+ rescue StandardError => e
32
+ e.message
33
+ end
30
34
  end
31
35
  end
32
36
  end
@@ -39,14 +39,20 @@ module OxAiWorkers
39
39
 
40
40
  def list_directory(directory_path:)
41
41
  puts Rainbow("Listing directory: #{directory_path}").magenta
42
- Dir.entries(directory_path)
42
+ list = Dir.entries(directory_path)
43
+ list.delete_if { |f| f.start_with?('.') }
44
+ if list.present?
45
+ "Contents of directory \"#{directory_path}\":\n #{list.join("\n")}"
46
+ else
47
+ "Directory is empty: #{directory_path}"
48
+ end
43
49
  rescue Errno::ENOENT
44
50
  "No such directory: #{directory_path}"
45
51
  end
46
52
 
47
53
  def read_file(file_path:)
48
54
  puts Rainbow("Reading file: #{file_path}").magenta
49
- if File.binary?(file)
55
+ if File.binary?(file_path)
50
56
  "File is binary: #{file_path}"
51
57
  else
52
58
  File.read(file_path).to_s
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OxAiWorkers
4
- VERSION = '0.5.0'
4
+ VERSION = '0.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ox-ai-workers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Smolev