class Riffer::Rig::Tools::Bash
Constants
- DEFAULT_TIMEOUT_MS
- MAX_OUTPUT_BYTES
- POLL_SECONDS
Public Instance Methods
(context: Riffer::Agent::Context?, command: String, ?timeout_ms: Integer, ?run_in_background: bool) → Riffer::Tools::Response
Source
# File lib/riffer/rig/tools/bash.rb, line 43 def call(context:, command:, timeout_ms: DEFAULT_TIMEOUT_MS, run_in_background: false) return spawn_job(context, command) if run_in_background cancel_flag = context&.[](:cancel_flag) #: Riffer::Rig::Runtime::CancelFlag? cwd = context&.[](:cwd) #: String output, status = run(command, cwd, timeout_ms / 1000.0, cancel_flag) return error("Command exited with status #{status}\n#{output}", type: :command_failed) unless status.zero? text(output.empty? ? '(no output)' : output) end
@rbs context: Riffer::Agent::Context? @rbs command: String @rbs timeout_ms: Integer @rbs run_in_background: bool @rbs return: Riffer::Tools::Response