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.
657 658 659 660 661 662 663 664 665 666 |
# File 'lib/daytona/computer_use.rb', line 657 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.
647 648 649 |
# File 'lib/daytona/computer_use.rb', line 647 def display @display end |
#keyboard ⇒ Keyboard (readonly)
Returns Keyboard operations interface.
641 642 643 |
# File 'lib/daytona/computer_use.rb', line 641 def keyboard @keyboard end |
#mouse ⇒ Mouse (readonly)
Returns Mouse operations interface.
638 639 640 |
# File 'lib/daytona/computer_use.rb', line 638 def mouse @mouse end |
#recording ⇒ Recording (readonly)
Returns Screen recording operations interface.
650 651 652 |
# File 'lib/daytona/computer_use.rb', line 650 def recording @recording end |
#sandbox_id ⇒ String (readonly)
Returns The ID of the sandbox.
632 633 634 |
# File 'lib/daytona/computer_use.rb', line 632 def sandbox_id @sandbox_id end |
#screenshot ⇒ Screenshot (readonly)
Returns Screenshot operations interface.
644 645 646 |
# File 'lib/daytona/computer_use.rb', line 644 def screenshot @screenshot end |
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi (readonly)
Returns API client for sandbox operations.
635 636 637 |
# File 'lib/daytona/computer_use.rb', line 635 def toolbox_api @toolbox_api end |
Instance Method Details
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
764 765 766 767 768 |
# File 'lib/daytona/computer_use.rb', line 764 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.
749 750 751 752 753 |
# File 'lib/daytona/computer_use.rb', line 749 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.
719 720 721 722 723 |
# File 'lib/daytona/computer_use.rb', line 719 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.
734 735 736 737 738 |
# File 'lib/daytona/computer_use.rb', line 734 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).
676 677 678 679 680 |
# File 'lib/daytona/computer_use.rb', line 676 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.
704 705 706 707 708 |
# File 'lib/daytona/computer_use.rb', line 704 def status toolbox_api.get_computer_use_status rescue StandardError => e raise Sdk::Error, "Failed to get computer use status: #{e.}" end |