daytona 0.143.0 → 0.144.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da583a9eda175c31c2103a6b6384586803ac649e73f53074558718dc452028c9
4
- data.tar.gz: d2f70032d323701cfc350d1f2afdfb8031d070d42d2951c86f38775a6c1b2573
3
+ metadata.gz: c2f03e27060f75604f2953b72e4297b5015198c6161433ff38d06bc30dba5a4e
4
+ data.tar.gz: f6c6c04140b2f8286f0570ba1be2a43a7a054c1e7d18ae05ccd09b2dce5baf47
5
5
  SHA512:
6
- metadata.gz: 0f2f89c710237a3db61919daefc5328280e64551d8543885cdde8ce19f10e275071235a5999a60ecd2f8be9a06c81058a5d7308acefdf1165b90705cda14e933
7
- data.tar.gz: 9f0bc233d024f5d46db7b3144a4a1dfcb1c1563c0d5df5a3b059ff31a2edab7c3e7768d8a81577f92ea911d5b7763a6ebe8529e721aeda83b42888348eddad83
6
+ metadata.gz: fbbe62c835cff5fdb42901b3e003fcc2395843ba6dd91a6a5bca90b046a4e3d6904155e3b3b9ac69c4a455dcab9225d1f122ec2b87bdce258307c26e1679ebf5
7
+ data.tar.gz: 19895e481348534f22caea0d270ee1183078db29e8611b24e4934e727015b5213764d6da7aed4849664c0b2f5ab1dac97a0e944a9c3b146aeba7ff0b24eec181
@@ -69,13 +69,18 @@ module Daytona
69
69
  # @return [Boolean] Whether to execute the command asynchronously
70
70
  attr_accessor :run_async
71
71
 
72
+ # @return [Boolean] Whether to suppress input echo
73
+ attr_accessor :suppress_input_echo
74
+
72
75
  # Initialize a new SessionExecuteRequest
73
76
  #
74
77
  # @param command [String] The command to execute
75
78
  # @param run_async [Boolean] Whether to execute the command asynchronously
76
- def initialize(command:, run_async: false)
79
+ # @param suppress_input_echo [Boolean] Whether to suppress input echo (default is false)
80
+ def initialize(command:, run_async: false, suppress_input_echo: false)
77
81
  @command = command
78
82
  @run_async = run_async
83
+ @suppress_input_echo = suppress_input_echo
79
84
  end
80
85
  end
81
86
 
@@ -169,7 +169,8 @@ module Daytona
169
169
  def execute_session_command(session_id:, req:) # rubocop:disable Metrics/MethodLength
170
170
  response = toolbox_api.session_execute_command(
171
171
  session_id,
172
- DaytonaToolboxApiClient::SessionExecuteRequest.new(command: req.command, run_async: req.run_async)
172
+ DaytonaToolboxApiClient::SessionExecuteRequest.new(command: req.command, run_async: req.run_async,
173
+ suppress_input_echo: req.suppress_input_echo)
173
174
  )
174
175
 
175
176
  stdout, stderr = Util.demux(response.output || '')
@@ -379,6 +379,49 @@ module Daytona
379
379
  end
380
380
  end
381
381
 
382
+ # Resizes the Sandbox resources.
383
+ #
384
+ # Changes the CPU, memory, or disk allocation for the Sandbox. Resizing a started
385
+ # sandbox allows increasing CPU and memory. To resize disk or decrease resources,
386
+ # the sandbox must be stopped first.
387
+ #
388
+ # @param resources [Daytona::Resources] New resource configuration
389
+ # @param timeout [Numeric] Maximum wait time in seconds (defaults to 60 s)
390
+ # @return [void]
391
+ #
392
+ # @example Resize a started sandbox (CPU and memory can be increased)
393
+ # sandbox.resize(Daytona::Resources.new(cpu: 4, memory: 8))
394
+ #
395
+ # @example Resize a stopped sandbox (CPU, memory, and disk can be changed)
396
+ # sandbox.stop
397
+ # sandbox.resize(Daytona::Resources.new(cpu: 2, memory: 4, disk: 30))
398
+ def resize(resources, timeout = DEFAULT_TIMEOUT)
399
+ raise Sdk::Error, 'Resources must not be nil' if resources.nil?
400
+
401
+ with_timeout(
402
+ timeout:,
403
+ message: "Sandbox #{id} failed to resize within the #{timeout} seconds timeout period",
404
+ setup: proc {
405
+ resize_attrs = {}
406
+ resize_attrs[:cpu] = resources.cpu if resources.cpu
407
+ resize_attrs[:memory] = resources.memory if resources.memory
408
+ resize_attrs[:disk] = resources.disk if resources.disk
409
+ resize_request = DaytonaApiClient::ResizeSandbox.new(resize_attrs)
410
+ process_response(sandbox_api.resize_sandbox(id, resize_request))
411
+ }
412
+ ) { wait_for_resize_complete }
413
+ end
414
+
415
+ # Waits for the Sandbox resize operation to complete.
416
+ # Polls the Sandbox status until the state is no longer 'resizing'.
417
+ #
418
+ # @param timeout [Numeric] Maximum wait time in seconds (defaults to 60 s)
419
+ # @return [void]
420
+ def wait_for_resize_complete(_timeout = DEFAULT_TIMEOUT)
421
+ wait_for_states(operation: OPERATION_RESIZE, target_states: [DaytonaApiClient::SandboxState::STARTED,
422
+ DaytonaApiClient::SandboxState::STOPPED])
423
+ end
424
+
382
425
  # Creates a new Language Server Protocol (LSP) server instance.
383
426
  # The LSP server provides language-specific features like code completion,
384
427
  # diagnostics, and more.
@@ -422,7 +465,7 @@ module Daytona
422
465
  :preview_url, :create_signed_preview_url, :expire_signed_preview_url,
423
466
  :refresh, :refresh_activity, :revoke_ssh_access, :start, :recover, :stop,
424
467
  :create_lsp_server, :validate_ssh_access, :wait_for_sandbox_start,
425
- :wait_for_sandbox_stop,
468
+ :wait_for_sandbox_stop, :resize, :wait_for_resize_complete,
426
469
  component: 'Sandbox'
427
470
 
428
471
  private
@@ -531,5 +574,8 @@ module Daytona
531
574
 
532
575
  OPERATION_STOP = :stop
533
576
  private_constant :OPERATION_STOP
577
+
578
+ OPERATION_RESIZE = :resize
579
+ private_constant :OPERATION_RESIZE
534
580
  end
535
581
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Daytona
4
4
  module Sdk
5
- VERSION = '0.143.0'
5
+ VERSION = '0.144.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daytona
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.143.0
4
+ version: 0.144.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daytona Platforms Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-02-13 00:00:00.000000000 Z
11
+ date: 2026-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: opentelemetry-exporter-otlp
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 0.143.0
89
+ version: 0.144.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 0.143.0
96
+ version: 0.144.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: daytona_toolbox_api_client
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.143.0
103
+ version: 0.144.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.143.0
110
+ version: 0.144.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: dotenv
113
113
  requirement: !ruby/object:Gem::Requirement