Class: Daytona::ComputerUse
- Inherits:
-
Object
- Object
- Daytona::ComputerUse
- Includes:
- Instrumentation
- Defined in:
- lib/daytona/computer_use.rb
Defined Under Namespace
Classes: Display, Keyboard, Mouse, Recording, Screenshot, ScreenshotOptions, ScreenshotRegion
Instance Attribute Summary collapse
-
#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.
660 661 662 663 664 665 666 667 668 669 |
# File 'lib/daytona/computer_use.rb', line 660 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:) end |
Instance Attribute Details
#display ⇒ Display (readonly)
Returns Display operations interface.
650 651 652 |
# File 'lib/daytona/computer_use.rb', line 650 def display @display end |
#keyboard ⇒ Keyboard (readonly)
Returns Keyboard operations interface.
644 645 646 |
# File 'lib/daytona/computer_use.rb', line 644 def keyboard @keyboard end |
#mouse ⇒ Mouse (readonly)
Returns Mouse operations interface.
641 642 643 |
# File 'lib/daytona/computer_use.rb', line 641 def mouse @mouse end |
#recording ⇒ Recording (readonly)
Returns Screen recording operations interface.
653 654 655 |
# File 'lib/daytona/computer_use.rb', line 653 def recording @recording end |
#sandbox_id ⇒ String (readonly)
Returns The ID of the sandbox.
635 636 637 |
# File 'lib/daytona/computer_use.rb', line 635 def sandbox_id @sandbox_id end |
#screenshot ⇒ Screenshot (readonly)
Returns Screenshot operations interface.
647 648 649 |
# File 'lib/daytona/computer_use.rb', line 647 def screenshot @screenshot end |
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi (readonly)
Returns API client for sandbox operations.
638 639 640 |
# File 'lib/daytona/computer_use.rb', line 638 def toolbox_api @toolbox_api end |
Instance Method Details
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
767 768 769 770 771 |
# File 'lib/daytona/computer_use.rb', line 767 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.
752 753 754 755 756 |
# File 'lib/daytona/computer_use.rb', line 752 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.
722 723 724 725 726 |
# File 'lib/daytona/computer_use.rb', line 722 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.
737 738 739 740 741 |
# File 'lib/daytona/computer_use.rb', line 737 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).
679 680 681 682 683 |
# File 'lib/daytona/computer_use.rb', line 679 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.
707 708 709 710 711 |
# File 'lib/daytona/computer_use.rb', line 707 def status toolbox_api.get_computer_use_status rescue StandardError => e raise Sdk::Error, "Failed to get computer use status: #{e.}" end |