Class: Daytona::ComputerUse
- Inherits:
-
Object
- Object
- Daytona::ComputerUse
- 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:) ⇒ 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.
Constructor Details
#initialize(sandbox_id:, toolbox_api:) ⇒ ComputerUse
Initialize a new ComputerUse instance.
598 599 600 601 602 603 604 605 606 |
# File 'lib/daytona/computer_use.rb', line 598 def initialize(sandbox_id:, toolbox_api:) @sandbox_id = sandbox_id @toolbox_api = toolbox_api @mouse = Mouse.new(sandbox_id:, toolbox_api:) @keyboard = Keyboard.new(sandbox_id:, toolbox_api:) @screenshot = Screenshot.new(sandbox_id:, toolbox_api:) @display = Display.new(sandbox_id:, toolbox_api:) @recording = Recording.new(sandbox_id:, toolbox_api:) end |
Instance Attribute Details
#display ⇒ Display (readonly)
Returns Display operations interface.
589 590 591 |
# File 'lib/daytona/computer_use.rb', line 589 def display @display end |
#keyboard ⇒ Keyboard (readonly)
Returns Keyboard operations interface.
583 584 585 |
# File 'lib/daytona/computer_use.rb', line 583 def keyboard @keyboard end |
#mouse ⇒ Mouse (readonly)
Returns Mouse operations interface.
580 581 582 |
# File 'lib/daytona/computer_use.rb', line 580 def mouse @mouse end |
#recording ⇒ Recording (readonly)
Returns Screen recording operations interface.
592 593 594 |
# File 'lib/daytona/computer_use.rb', line 592 def recording @recording end |
#sandbox_id ⇒ String (readonly)
Returns The ID of the sandbox.
574 575 576 |
# File 'lib/daytona/computer_use.rb', line 574 def sandbox_id @sandbox_id end |
#screenshot ⇒ Screenshot (readonly)
Returns Screenshot operations interface.
586 587 588 |
# File 'lib/daytona/computer_use.rb', line 586 def screenshot @screenshot end |
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi (readonly)
Returns API client for sandbox operations.
577 578 579 |
# File 'lib/daytona/computer_use.rb', line 577 def toolbox_api @toolbox_api end |
Instance Method Details
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
704 705 706 707 708 |
# File 'lib/daytona/computer_use.rb', line 704 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.
689 690 691 692 693 |
# File 'lib/daytona/computer_use.rb', line 689 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.
659 660 661 662 663 |
# File 'lib/daytona/computer_use.rb', line 659 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.
674 675 676 677 678 |
# File 'lib/daytona/computer_use.rb', line 674 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).
616 617 618 619 620 |
# File 'lib/daytona/computer_use.rb', line 616 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.
644 645 646 647 648 |
# File 'lib/daytona/computer_use.rb', line 644 def status toolbox_api.get_computer_use_status rescue StandardError => e raise Sdk::Error, "Failed to get computer use status: #{e.}" end |