Class: Daytona::ComputerUse
- Inherits:
-
Object
- Object
- Daytona::ComputerUse
- Defined in:
- lib/daytona/computer_use.rb
Defined Under Namespace
Classes: Display, Keyboard, Mouse, 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.
-
#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.
438 439 440 441 442 443 444 445 |
# File 'lib/daytona/computer_use.rb', line 438 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:) end |
Instance Attribute Details
#display ⇒ Display (readonly)
Returns Display operations interface.
432 433 434 |
# File 'lib/daytona/computer_use.rb', line 432 def display @display end |
#keyboard ⇒ Keyboard (readonly)
Returns Keyboard operations interface.
426 427 428 |
# File 'lib/daytona/computer_use.rb', line 426 def keyboard @keyboard end |
#mouse ⇒ Mouse (readonly)
Returns Mouse operations interface.
423 424 425 |
# File 'lib/daytona/computer_use.rb', line 423 def mouse @mouse end |
#sandbox_id ⇒ String (readonly)
Returns The ID of the sandbox.
417 418 419 |
# File 'lib/daytona/computer_use.rb', line 417 def sandbox_id @sandbox_id end |
#screenshot ⇒ Screenshot (readonly)
Returns Screenshot operations interface.
429 430 431 |
# File 'lib/daytona/computer_use.rb', line 429 def screenshot @screenshot end |
#toolbox_api ⇒ DaytonaApiClient::ToolboxApi (readonly)
Returns API client for sandbox operations.
420 421 422 |
# File 'lib/daytona/computer_use.rb', line 420 def toolbox_api @toolbox_api end |
Instance Method Details
#get_process_errors(process_name:) ⇒ DaytonaApiClient::ProcessErrorsResponse
Gets error logs for a specific VNC process.
543 544 545 546 547 |
# File 'lib/daytona/computer_use.rb', line 543 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.
528 529 530 531 532 |
# File 'lib/daytona/computer_use.rb', line 528 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.
498 499 500 501 502 |
# File 'lib/daytona/computer_use.rb', line 498 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.
513 514 515 516 517 |
# File 'lib/daytona/computer_use.rb', line 513 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).
455 456 457 458 459 |
# File 'lib/daytona/computer_use.rb', line 455 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.
483 484 485 486 487 |
# File 'lib/daytona/computer_use.rb', line 483 def status toolbox_api.get_computer_use_status rescue StandardError => e raise Sdk::Error, "Failed to get computer use status: #{e.}" end |