aidp 0.49.20 → 0.49.22

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: 3bcae0816a7d6d049e039d8670fd6b8e21e7e9228af2d0b996853c38f39b2bd6
4
- data.tar.gz: f7aeae62f6ce57552d31885a69461ea00c50bf9d4f30056a3f76ea563b174eb6
3
+ metadata.gz: 6cb8dcb8dbf9eb841ad69223a465c30329b9e9ed29853ddb168e237a6f3bebfb
4
+ data.tar.gz: 39d511353116c51196a464c85775ea9227f6e40ccd5028a7174fe048d7adc567
5
5
  SHA512:
6
- metadata.gz: 81497e0b2050c4e9d06e45a0251123e792993694b64e5015b6a0f907ab1dc22bd576266c11a2254afed433285570cf459152d357c01ea345e0cc99a7279f7d38
7
- data.tar.gz: 873e5c878b464542b6a533222db9842bf7303e06d29d868b020588079c6eb957ff51b4b2238b027cf15ce2579588bba8ad8ef4f841f47305eb5cfd71a5a1dfed
6
+ metadata.gz: cb5c58bbf3c79069585f2341f9b4839d2d03489f6a50bebba5b05d971f6deb4184050d987b6bc07547e79938de204ca44a45dfe112622b12b8d42f488dcc28d7
7
+ data.tar.gz: 555d5538815206f1ce3fd104a6a5f8c93b243320993fb73d0fdc9ac05d1f01e59197886d2f806b5a02dce45d9dd705305107f3ef388086aed987c1cf646cf1c4
@@ -126,6 +126,11 @@ module Aidp
126
126
  # When suppress_output is true, output is redirected to /dev/null
127
127
  # unless explicit out:/err: options are provided.
128
128
  #
129
+ # Commands are always executed in argument form so a shell never
130
+ # interprets any value. A leading environment hash is forwarded
131
+ # unchanged; otherwise the [program, argv0] form forces direct
132
+ # execution even when a single command string is supplied.
133
+ #
129
134
  # @param args [Array] Arguments passed to Kernel.system
130
135
  # @param opts [Hash] Options passed to Kernel.system
131
136
  # @return [Boolean, nil] Same as Kernel.system
@@ -133,7 +138,19 @@ module Aidp
133
138
  if self.class.suppress_output && !opts.key?(:out) && !opts.key?(:err)
134
139
  opts = opts.merge(out: File::NULL, err: File::NULL)
135
140
  end
136
- Kernel.system(*args, **opts)
141
+
142
+ if args.first.is_a?(Hash)
143
+ environment, *command = args
144
+ program, *rest = command.map(&:to_s)
145
+ raise ArgumentError, "command must not be blank" if program.nil? || program.empty?
146
+
147
+ Kernel.system(environment, [program, program], *rest, **opts)
148
+ else
149
+ program, *rest = args.map(&:to_s)
150
+ raise ArgumentError, "command must not be blank" if program.nil? || program.empty?
151
+
152
+ Kernel.system([program, program], *rest, **opts)
153
+ end
137
154
  end
138
155
  end
139
156
  end
@@ -36,7 +36,13 @@ module Aidp
36
36
  task_id: request[:task]&.dig(:id),
37
37
  artifact_dir: artifact_dir)
38
38
 
39
- stdout, stderr, status = Open3.capture3(*parts, stdin_data: JSON.generate(payload), chdir: @project_dir)
39
+ program, *args = parts.map(&:to_s)
40
+ stdout, stderr, status = Open3.capture3(
41
+ [program, program],
42
+ *args,
43
+ stdin_data: JSON.generate(payload),
44
+ chdir: @project_dir
45
+ )
40
46
  unless status.success?
41
47
  Aidp.log_error("cli_protocol", "execution_failed",
42
48
  role: role,
data/lib/aidp/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Aidp
4
- VERSION = "0.49.20"
4
+ VERSION = "0.49.22"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aidp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.20
4
+ version: 0.49.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bart Agapinan