Class: Daytona::ComputerUse
- Inherits:
-
Object
- Object
- Daytona::ComputerUse
- Includes:
- Instrumentation
- Defined in:
- lib/daytona/computer_use.rb
Defined Under Namespace
Classes: Accessibility, Display, Keyboard, Mouse, Recording, Screenshot, ScreenshotOptions, ScreenshotRegion
Instance Attribute Summary collapse
-
#accessibility ⇒ Accessibility
readonly
Accessibility operations interface.
-
#display ⇒ Display
readonly
Display operations interface.
-
#keyboard ⇒ Keyboard
readonly
Keyboard operations interface.
-
#mouse ⇒ Mouse
readonly
Mouse operations interface.
-
#recording ⇒ Recording
readonly
Screen recording operations interface.
-
#sandbox_id ⇒ String
readonly
The ID of the sandbox.
-
#screenshot ⇒ Screenshot
readonly
Screenshot operations interface.
-
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi
readonly
API client for sandbox operations.
Instance Method Summary collapse
-
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
-
#get_process_logs(process_name:) ⇒ DaytonaApiClient::ProcessLogsResponse
Gets logs for a specific VNC process.
-
#get_process_status(process_name:) ⇒ DaytonaApiClient::ProcessStatusResponse
Gets the status of a specific VNC process.
-
#initialize(sandbox_id:, toolbox_api:, otel_state: nil) ⇒ ComputerUse
constructor
Initialize a new ComputerUse instance.
-
#restart_process(process_name:) ⇒ DaytonaApiClient::ProcessRestartResponse
Restarts a specific VNC process.
-
#start ⇒ DaytonaApiClient::ComputerUseStartResponse
Starts all computer use processes (Xvfb, xfce4, x11vnc, novnc).
-
#status ⇒ DaytonaApiClient::ComputerUseStatusResponse
Gets the status of all computer use processes.
-
#stop ⇒ DaytonaApiClient::ComputerUseStopResponse
Stops all computer use processes.
Methods included from Instrumentation
Constructor Details
#initialize(sandbox_id:, toolbox_api:, otel_state: nil) ⇒ ComputerUse
Initialize a new ComputerUse instance.
796 797 798 799 800 801 802 803 804 805 806 |
# File 'lib/daytona/computer_use.rb', line 796 def initialize(sandbox_id:, toolbox_api:, otel_state: nil) @sandbox_id = sandbox_id @toolbox_api = toolbox_api @otel_state = otel_state @mouse = Mouse.new(sandbox_id:, toolbox_api:, otel_state:) @keyboard = Keyboard.new(sandbox_id:, toolbox_api:, otel_state:) @screenshot = Screenshot.new(sandbox_id:, toolbox_api:, otel_state:) @display = Display.new(sandbox_id:, toolbox_api:, otel_state:) @recording = Recording.new(sandbox_id:, toolbox_api:, otel_state:) @accessibility = Accessibility.new(sandbox_id:, toolbox_api:, otel_state:) end |
Instance Attribute Details
#accessibility ⇒ Accessibility (readonly)
Returns Accessibility operations interface.
789 790 791 |
# File 'lib/daytona/computer_use.rb', line 789 def accessibility @accessibility end |
#display ⇒ Display (readonly)
Returns Display operations interface.
783 784 785 |
# File 'lib/daytona/computer_use.rb', line 783 def display @display end |
#keyboard ⇒ Keyboard (readonly)
Returns Keyboard operations interface.
777 778 779 |
# File 'lib/daytona/computer_use.rb', line 777 def keyboard @keyboard end |
#mouse ⇒ Mouse (readonly)
Returns Mouse operations interface.
774 775 776 |
# File 'lib/daytona/computer_use.rb', line 774 def mouse @mouse end |
#recording ⇒ Recording (readonly)
Returns Screen recording operations interface.
786 787 788 |
# File 'lib/daytona/computer_use.rb', line 786 def recording @recording end |
#sandbox_id ⇒ String (readonly)
Returns The ID of the sandbox.
768 769 770 |
# File 'lib/daytona/computer_use.rb', line 768 def sandbox_id @sandbox_id end |
#screenshot ⇒ Screenshot (readonly)
Returns Screenshot operations interface.
780 781 782 |
# File 'lib/daytona/computer_use.rb', line 780 def screenshot @screenshot end |
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi (readonly)
Returns API client for sandbox operations.
771 772 773 |
# File 'lib/daytona/computer_use.rb', line 771 def toolbox_api @toolbox_api end |
Instance Method Details
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
904 905 906 907 908 |
# File 'lib/daytona/computer_use.rb', line 904 def get_process_errors(process_name:) toolbox_api.get_process_errors(process_name, sandbox_id) rescue StandardError => e raise Sdk::Error, "Failed to get process errors: #{e.}" end |
#get_process_logs(process_name:) ⇒ DaytonaApiClient::ProcessLogsResponse
Gets logs for a specific VNC process.
889 890 891 892 893 |
# File 'lib/daytona/computer_use.rb', line 889 def get_process_logs(process_name:) toolbox_api.get_process_logs(process_name, sandbox_id) rescue StandardError => e raise Sdk::Error, "Failed to get process logs: #{e.}" end |
#get_process_status(process_name:) ⇒ DaytonaApiClient::ProcessStatusResponse
Gets the status of a specific VNC process.
859 860 861 862 863 |
# File 'lib/daytona/computer_use.rb', line 859 def get_process_status(process_name:) toolbox_api.get_process_status(process_name, sandbox_id) rescue StandardError => e raise Sdk::Error, "Failed to get process status: #{e.}" end |
#restart_process(process_name:) ⇒ DaytonaApiClient::ProcessRestartResponse
Restarts a specific VNC process.
874 875 876 877 878 |
# File 'lib/daytona/computer_use.rb', line 874 def restart_process(process_name:) toolbox_api.restart_process(process_name, sandbox_id) rescue StandardError => e raise Sdk::Error, "Failed to restart process: #{e.}" end |
#start ⇒ DaytonaApiClient::ComputerUseStartResponse
Starts all computer use processes (Xvfb, xfce4, x11vnc, novnc).
816 817 818 819 820 |
# File 'lib/daytona/computer_use.rb', line 816 def start toolbox_api.start_computer_use rescue StandardError => e raise Sdk::Error, "Failed to start computer use: #{e.}" end |
#status ⇒ DaytonaApiClient::ComputerUseStatusResponse
Gets the status of all computer use processes.
844 845 846 847 848 |
# File 'lib/daytona/computer_use.rb', line 844 def status toolbox_api.get_computer_use_status rescue StandardError => e raise Sdk::Error, "Failed to get computer use status: #{e.}" end |