daytona 0.194.0 → 0.196.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: 52e589fc8beb1606bed33e09a6caabe834daf349ec5042e36332eaee4bd23544
4
- data.tar.gz: ffe431dbab005054179308e74c1b1c5d406f34925f096f01be7bf75e9a149b59
3
+ metadata.gz: 95de6205d02f5efc95082860ba7b1cc47d7aaa4a80add3b2799d7b62ece1d67c
4
+ data.tar.gz: 11c927bf961766c0eae71d6196a538688844913d06de0746497510b09137293e
5
5
  SHA512:
6
- metadata.gz: 73d0b98ed2a79fbaafd27f5e49a12a78f3289e37d15bf512a6f99b37b5e0d3a1da44fb5b322fc4abd8226598e152372ba53b91335bfdcb1d1fa84416eace7294
7
- data.tar.gz: e8244a2e9dd9f7737af789ab7855cbb2eee625f0774cbe34d845955195b3f9cc2e80c44872c468b7c29a595582f45faaddb32a1ca4ec8da2b6ae3e8441297822
6
+ metadata.gz: 6f30debf54313e1bd30c6392b7ec2fd6c316306aad88eb3e1cd58fa0a51326f4036468c76fb2fe9388c41139aa40f0efecaa680d31eab6c16736f2f9dd9c250c
7
+ data.tar.gz: cf1ac1f0075f85966d2c9a00eb3c02d3c0e7080c8d7773fe9e5004c5e91bfd5e11670da7946ad15d5fcea13db6772d6c5918935d02f1f4a0cef61e010ae2f695
@@ -159,6 +159,7 @@ module Daytona
159
159
  computer_use_api = DaytonaToolboxApiClient::ComputerUseApi.new(create_authenticated_client.call)
160
160
  interpreter_api = DaytonaToolboxApiClient::InterpreterApi.new(create_authenticated_client.call)
161
161
  info_api = DaytonaToolboxApiClient::InfoApi.new(create_authenticated_client.call)
162
+ server_api = DaytonaToolboxApiClient::ServerApi.new(create_authenticated_client.call)
162
163
 
163
164
  @process = Process.new(
164
165
  sandbox_id: id,
@@ -178,6 +179,7 @@ module Daytona
178
179
  )
179
180
  @lsp_api = lsp_api
180
181
  @info_api = info_api
182
+ @server_api = server_api
181
183
  end
182
184
 
183
185
  # Archives the sandbox, making it inactive and preserving its state. When sandboxes are
@@ -240,6 +242,27 @@ module Daytona
240
242
  @domain_allow_list = data.domain_allow_list
241
243
  end
242
244
 
245
+ # Replaces the set of organization vault secrets mounted in the Sandbox. Pass an empty
246
+ # hash to detach all secrets. Rotated, attached or detached secrets take effect for
247
+ # outbound requests within seconds. New environment variables are only visible to
248
+ # processes spawned after the update; a Sandbox created without any secrets must be
249
+ # restarted for newly attached secrets to work.
250
+ #
251
+ # @param secrets [Hash<String, String>] Mapping of environment variable name to
252
+ # organization vault secret name
253
+ # @return [void]
254
+ # @raise [Daytona::Sdk::Error]
255
+ #
256
+ # @example
257
+ # sandbox.update_secrets({ 'API_KEY' => 'my-vault-secret' })
258
+ def update_secrets(secrets)
259
+ body = DaytonaApiClient::UpdateSandboxSecrets.new(
260
+ secrets: secrets.map { |env_var, secret_name| { env_var.to_s => secret_name.to_s } }
261
+ )
262
+ data = sandbox_api.update_sandbox_secrets(id, body)
263
+ process_response(data)
264
+ end
265
+
243
266
  # Sets the auto-stop interval for the Sandbox.
244
267
  # The Sandbox will automatically stop after being idle (no new events) for the specified interval.
245
268
  # Events include any state changes or interactions with the Sandbox through the SDK.
@@ -298,6 +321,23 @@ module Daytona
298
321
  raise Sdk::Error, "Failed to get working directory path: #{e.message}"
299
322
  end
300
323
 
324
+ # Updates the Sandbox daemon's process environment. Newly spawned processes, sessions
325
+ # and PTYs inherit the change; already-running processes keep their existing environment.
326
+ #
327
+ # @param env [Hash<String, String>, nil] Env vars to set in the daemon's process environment
328
+ # @param unset [Array<String>, nil] Environment variable names to remove
329
+ # @return [void]
330
+ # @raise [Daytona::Sdk::Error]
331
+ #
332
+ # @example
333
+ # sandbox.update_env(env: { 'FOO' => 'bar' }, unset: ['OLD_VAR'])
334
+ def update_env(env: nil, unset: nil)
335
+ @server_api.update_env(DaytonaToolboxApiClient::UpdateEnvRequest.new(set: env, unset:))
336
+ nil
337
+ rescue StandardError => e
338
+ raise Sdk::Error, "Failed to update environment: #{e.message}"
339
+ end
340
+
301
341
  # Sets labels for the Sandbox.
302
342
  #
303
343
  # @param labels [Hash<String, String>]
@@ -570,7 +610,7 @@ module Daytona
570
610
  end
571
611
 
572
612
  instrument :archive, :auto_archive_interval=, :auto_delete_interval=, :auto_stop_interval=,
573
- :update_network_settings,
613
+ :update_network_settings, :update_secrets, :update_env,
574
614
  :create_ssh_access, :delete, :get_user_home_dir, :get_work_dir, :labels=,
575
615
  :preview_url, :create_signed_preview_url, :expire_signed_preview_url,
576
616
  :refresh, :refresh_activity, :revoke_ssh_access, :start, :recover, :stop,
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Daytona
7
7
  module Sdk
8
- VERSION = '0.194.0'
8
+ VERSION = '0.196.0'
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: daytona
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.194.0
4
+ version: 0.196.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daytona Platforms Inc.
@@ -85,28 +85,28 @@ dependencies:
85
85
  requirements:
86
86
  - - '='
87
87
  - !ruby/object:Gem::Version
88
- version: 0.194.0
88
+ version: 0.196.0
89
89
  type: :runtime
90
90
  prerelease: false
91
91
  version_requirements: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - '='
94
94
  - !ruby/object:Gem::Version
95
- version: 0.194.0
95
+ version: 0.196.0
96
96
  - !ruby/object:Gem::Dependency
97
97
  name: daytona_toolbox_api_client
98
98
  requirement: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - '='
101
101
  - !ruby/object:Gem::Version
102
- version: 0.194.0
102
+ version: 0.196.0
103
103
  type: :runtime
104
104
  prerelease: false
105
105
  version_requirements: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - '='
108
108
  - !ruby/object:Gem::Version
109
- version: 0.194.0
109
+ version: 0.196.0
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: dotenv
112
112
  requirement: !ruby/object:Gem::Requirement