daytona 0.168.0 → 0.170.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 +4 -4
- data/.rspec +3 -0
- data/lib/daytona/code_interpreter.rb +3 -0
- data/lib/daytona/common/charts.rb +3 -0
- data/lib/daytona/common/code_interpreter.rb +3 -0
- data/lib/daytona/common/code_language.rb +3 -0
- data/lib/daytona/common/daytona.rb +3 -0
- data/lib/daytona/common/file_system.rb +3 -0
- data/lib/daytona/common/git.rb +3 -0
- data/lib/daytona/common/image.rb +6 -2
- data/lib/daytona/common/process.rb +3 -0
- data/lib/daytona/common/pty.rb +4 -1
- data/lib/daytona/common/resources.rb +3 -0
- data/lib/daytona/common/response.rb +3 -0
- data/lib/daytona/common/snapshot.rb +3 -0
- data/lib/daytona/computer_use.rb +7 -4
- data/lib/daytona/config.rb +3 -0
- data/lib/daytona/daytona.rb +3 -0
- data/lib/daytona/file_system.rb +3 -0
- data/lib/daytona/git.rb +4 -1
- data/lib/daytona/lsp_server.rb +3 -0
- data/lib/daytona/object_storage.rb +3 -0
- data/lib/daytona/otel.rb +3 -0
- data/lib/daytona/process.rb +7 -1
- data/lib/daytona/sandbox.rb +25 -0
- data/lib/daytona/sdk/version.rb +4 -1
- data/lib/daytona/sdk.rb +3 -0
- data/lib/daytona/snapshot_service.rb +3 -0
- data/lib/daytona/util.rb +3 -0
- data/lib/daytona/volume.rb +3 -0
- data/lib/daytona/volume_service.rb +3 -0
- data/lib/daytona.rb +3 -0
- data/project.json +17 -0
- data/scripts/generate-docs.rb +2 -0
- metadata +6 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7515dcf7e9ce6366233315925a09418cfe7714473f55ccf2062010f3d5ac692c
|
|
4
|
+
data.tar.gz: 85148ff08b50b7a9d647ac53ae8b73622e5e3d9d01f9a211229a1ec071f49979
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ccd9ad77b30a91e4aa4ca503d87d3d9a976978b553bf3c0a1ba6e80c912c804bfab99b520377edc71ab17abd4eb22790edac7ae683bf2f6a58bfe6419a08e390
|
|
7
|
+
data.tar.gz: 071d6d27256509829400a640d70b386c7a627e44731b07b0a2ba04559c3837bf31ec4f037c76f9f4bdbe5073af58d9660551d14ccac9e6fff5dd653712c0b04a
|
data/.rspec
ADDED
data/lib/daytona/common/git.rb
CHANGED
data/lib/daytona/common/image.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
require 'digest'
|
|
@@ -261,8 +264,9 @@ module Daytona
|
|
|
261
264
|
raise Sdk::Error, "Context directory #{context_dir} does not exist" unless Dir.exist?(context_dir)
|
|
262
265
|
end
|
|
263
266
|
|
|
264
|
-
# Extract copy sources from dockerfile commands
|
|
265
|
-
extract_copy_sources
|
|
267
|
+
# Extract copy sources from dockerfile commands (class-level helper)
|
|
268
|
+
self.class.send(:extract_copy_sources, dockerfile_commands.join("\n"),
|
|
269
|
+
context_dir || '').each do |context_path, original_path|
|
|
266
270
|
archive_base_path = context_path
|
|
267
271
|
if context_dir && !original_path.start_with?(context_dir)
|
|
268
272
|
archive_base_path = context_path.delete_prefix(context_dir)
|
data/lib/daytona/common/pty.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
require 'json'
|
|
@@ -299,7 +302,7 @@ module Daytona
|
|
|
299
302
|
module WebSocketControlStatus
|
|
300
303
|
ALL = [
|
|
301
304
|
CONNECTED = 'connected',
|
|
302
|
-
|
|
305
|
+
ERROR = 'error'
|
|
303
306
|
].freeze
|
|
304
307
|
end
|
|
305
308
|
end
|
data/lib/daytona/computer_use.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
module Daytona
|
|
@@ -167,14 +170,14 @@ module Daytona
|
|
|
167
170
|
|
|
168
171
|
# Presses a key with optional modifiers.
|
|
169
172
|
#
|
|
170
|
-
# @param key [String] The key to press
|
|
171
|
-
# @param modifiers [Array<String>, nil]
|
|
173
|
+
# @param key [String] The key to press. Canonical names include 'enter', 'escape', 'tab', letters, digits, unshifted punctuation, function keys, and grammar-safe numpad names such as 'num_plus'. Named keys are case-insensitive, and common aliases such as 'Return' and 'Escape' are normalized.
|
|
174
|
+
# @param modifiers [Array<String>, nil] Canonical modifier names are 'ctrl', 'alt', 'shift', and 'cmd'. Common aliases such as 'control', 'option', 'meta', and 'win' are normalized.
|
|
172
175
|
# @return [void]
|
|
173
176
|
# @raise [Daytona::Sdk::Error] If the operation fails
|
|
174
177
|
#
|
|
175
178
|
# @example
|
|
176
179
|
# # Press Enter
|
|
177
|
-
# sandbox.computer_use.keyboard.press("
|
|
180
|
+
# sandbox.computer_use.keyboard.press("enter")
|
|
178
181
|
#
|
|
179
182
|
# # Press Ctrl+C
|
|
180
183
|
# sandbox.computer_use.keyboard.press("c", modifiers: ["ctrl"])
|
|
@@ -190,7 +193,7 @@ module Daytona
|
|
|
190
193
|
|
|
191
194
|
# Presses a hotkey combination.
|
|
192
195
|
#
|
|
193
|
-
# @param keys [String]
|
|
196
|
+
# @param keys [String] A single atomic hotkey chord (e.g., 'ctrl+c', 'alt+tab', 'cmd+shift+t', 'ctrl + c', 'shift'). Uses the same normalized key contract as #press.
|
|
194
197
|
# @return [void]
|
|
195
198
|
# @raise [Daytona::Sdk::Error] If the operation fails
|
|
196
199
|
#
|
data/lib/daytona/config.rb
CHANGED
data/lib/daytona/daytona.rb
CHANGED
data/lib/daytona/file_system.rb
CHANGED
data/lib/daytona/git.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
module Daytona
|
|
@@ -142,7 +145,7 @@ module Daytona
|
|
|
142
145
|
response = toolbox_api.commit_changes(
|
|
143
146
|
DaytonaToolboxApiClient::GitCommitRequest.new(path:, message:, author:, email:, allow_empty:)
|
|
144
147
|
)
|
|
145
|
-
GitCommitResponse.new(sha: response.
|
|
148
|
+
GitCommitResponse.new(sha: response._hash)
|
|
146
149
|
rescue StandardError => e
|
|
147
150
|
raise Sdk::Error, "Failed to commit changes: #{e.message}"
|
|
148
151
|
end
|
data/lib/daytona/lsp_server.rb
CHANGED
data/lib/daytona/otel.rb
CHANGED
data/lib/daytona/process.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
require 'uri'
|
|
@@ -500,7 +503,10 @@ module Daytona
|
|
|
500
503
|
# puts "PTY Session #{session.id}: #{session.cols}x#{session.rows}"
|
|
501
504
|
# end
|
|
502
505
|
def list_pty_sessions
|
|
503
|
-
toolbox_api.list_pty_sessions
|
|
506
|
+
response = toolbox_api.list_pty_sessions
|
|
507
|
+
return [] if response.nil?
|
|
508
|
+
|
|
509
|
+
response.respond_to?(:sessions) ? (response.sessions || []) : response
|
|
504
510
|
end
|
|
505
511
|
|
|
506
512
|
# Gets detailed information about a specific PTY session
|
data/lib/daytona/sandbox.rb
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
# Copyright Daytona Platforms Inc.
|
|
2
|
+
# SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
1
4
|
# frozen_string_literal: true
|
|
2
5
|
|
|
3
6
|
require 'timeout'
|
|
@@ -202,6 +205,27 @@ module Daytona
|
|
|
202
205
|
@auto_delete_interval = interval
|
|
203
206
|
end
|
|
204
207
|
|
|
208
|
+
# Updates outbound network policy on the runner (block all, restore access, or CIDR allow list).
|
|
209
|
+
#
|
|
210
|
+
# @param network_block_all [Boolean, nil]
|
|
211
|
+
# @param network_allow_list [String, nil]
|
|
212
|
+
# @return [void]
|
|
213
|
+
# @raise [Daytona::Sdk::Error]
|
|
214
|
+
def update_network_settings(network_block_all: nil, network_allow_list: nil)
|
|
215
|
+
if network_block_all.nil? && network_allow_list.nil?
|
|
216
|
+
raise Sdk::Error,
|
|
217
|
+
'At least one of network_block_all or network_allow_list must be provided'
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
body = DaytonaApiClient::UpdateSandboxNetworkSettings.new(
|
|
221
|
+
network_block_all:,
|
|
222
|
+
network_allow_list:
|
|
223
|
+
)
|
|
224
|
+
data = sandbox_api.update_network_settings(id, body)
|
|
225
|
+
@network_block_all = data.network_block_all
|
|
226
|
+
@network_allow_list = data.network_allow_list
|
|
227
|
+
end
|
|
228
|
+
|
|
205
229
|
# Sets the auto-stop interval for the Sandbox.
|
|
206
230
|
# The Sandbox will automatically stop after being idle (no new events) for the specified interval.
|
|
207
231
|
# Events include any state changes or interactions with the Sandbox through the SDK.
|
|
@@ -510,6 +534,7 @@ module Daytona
|
|
|
510
534
|
end
|
|
511
535
|
|
|
512
536
|
instrument :archive, :auto_archive_interval=, :auto_delete_interval=, :auto_stop_interval=,
|
|
537
|
+
:update_network_settings,
|
|
513
538
|
:create_ssh_access, :delete, :get_user_home_dir, :get_work_dir, :labels=,
|
|
514
539
|
:preview_url, :create_signed_preview_url, :expire_signed_preview_url,
|
|
515
540
|
:refresh, :refresh_activity, :revoke_ssh_access, :start, :recover, :stop,
|
data/lib/daytona/sdk/version.rb
CHANGED
data/lib/daytona/sdk.rb
CHANGED
data/lib/daytona/util.rb
CHANGED
data/lib/daytona/volume.rb
CHANGED
data/lib/daytona.rb
CHANGED
data/project.json
CHANGED
|
@@ -41,6 +41,23 @@
|
|
|
41
41
|
"command": "bundle exec rubocop"
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
|
+
"test": {
|
|
45
|
+
"executor": "nx:run-commands",
|
|
46
|
+
"cache": true,
|
|
47
|
+
"inputs": ["default", { "env": "DAYTONA_API_KEY" }, { "env": "DAYTONA_API_URL" }, { "env": "DAYTONA_JWT_TOKEN" }, { "env": "DAYTONA_ORGANIZATION_ID" }, { "env": "DAYTONA_TARGET" }],
|
|
48
|
+
"outputs": [],
|
|
49
|
+
"options": {
|
|
50
|
+
"cwd": "{projectRoot}",
|
|
51
|
+
"command": "bundle exec rspec --format documentation --tag '~e2e'"
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
"test:e2e": {
|
|
55
|
+
"executor": "nx:run-commands",
|
|
56
|
+
"options": {
|
|
57
|
+
"cwd": "{projectRoot}",
|
|
58
|
+
"command": "bundle exec rspec spec/e2e_spec.rb --format documentation"
|
|
59
|
+
}
|
|
60
|
+
},
|
|
44
61
|
"format": {
|
|
45
62
|
"executor": "nx:run-commands",
|
|
46
63
|
"options": {
|
data/scripts/generate-docs.rb
CHANGED
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.
|
|
4
|
+
version: 0.170.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.
|
|
88
|
+
version: 0.170.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.
|
|
95
|
+
version: 0.170.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.
|
|
102
|
+
version: 0.170.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.
|
|
109
|
+
version: 0.170.0
|
|
110
110
|
- !ruby/object:Gem::Dependency
|
|
111
111
|
name: dotenv
|
|
112
112
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -171,6 +171,7 @@ executables: []
|
|
|
171
171
|
extensions: []
|
|
172
172
|
extra_rdoc_files: []
|
|
173
173
|
files:
|
|
174
|
+
- ".rspec"
|
|
174
175
|
- ".rubocop.yml"
|
|
175
176
|
- ".ruby-version"
|
|
176
177
|
- CODE_OF_CONDUCT.md
|