daytona 0.126.0.alpha.7 → 0.126.0.pre.alpha.4

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: 2a2b373aa6722a81aaed92298ca4f706bb15c40ba99e18139bc9b08fb769aec2
4
- data.tar.gz: f0bff8ea9b560aa0e4bd8c4ea5fdb04f2109dd015b30b85756f527279d1eec6a
3
+ metadata.gz: 81da12ccf937ba42e44bfafe07a06326f7d36b832ce998bff301237995790abb
4
+ data.tar.gz: ab6f3fd9edd49490860e41416e68108901014b53e5a98a7b9a50f1332b3f25e4
5
5
  SHA512:
6
- metadata.gz: d93167c5fe2380a5a66ef43843b5bf5d8061d981d5742d3139977cd240b4f4fb900f0a49a2936be040930de1cd0706906afb5d274d7c4d7a57c3995440d5f4d6
7
- data.tar.gz: 66c8ba030240184e1128704e6f96eb345dff24701c8f9456f573140c7f4a6e0f6d3c57046248a7b56e480e83765b5bcefc05e8d404f788897cb9bb3889384a49
6
+ metadata.gz: 5e23c9a3f20d5b71b80246af564aff231aafa105510fe42c5239553aa2b05493cbb2b35f8401861352406366072e1bf13e811920d3807149f74ac49c39ddc374
7
+ data.tar.gz: ed10d153328aa34c168277275bd2f5529afb7f0ba0bb4734a79a7c0afce02e5a55f5041cc4bd9face93af246354b9b972f3b941fa81c6c97320298acddf561cb
data/README.md CHANGED
@@ -86,14 +86,13 @@ From the repository root:
86
86
  ```bash
87
87
  # Set your RubyGems API key and version
88
88
  export RUBYGEMS_API_KEY="your-rubygems-api-key"
89
- export RUBYGEMS_PKG_VERSION="X.Y.Z" # pre-release format example: "X.Y.Z.alpha.1"
89
+ export RUBYGEMS_PKG_VERSION="X.Y.Z" # pre-release format example: "X.Y.Z-alpha.1"
90
90
 
91
91
  # Publish (builds and publishes all Ruby gems)
92
92
  yarn nx publish sdk-ruby
93
93
  ```
94
94
 
95
95
  This will automatically:
96
-
97
96
  - Set the version for all Ruby gems (api-client, toolbox-api-client, sdk)
98
97
  - Build all gems in the correct dependency order
99
98
  - Publish to RubyGems
@@ -67,7 +67,7 @@ module Daytona
67
67
  # right_click = sandbox.computer_use.mouse.click(x: 100, y: 200, button: 'right')
68
68
  def click(x:, y:, button: 'left', double: false) # rubocop:disable Naming/MethodParameterName
69
69
  request = DaytonaToolboxApiClient::MouseClickRequest.new(x:, y:, button:, double:)
70
- toolbox_api.click(request)
70
+ toolbox_api.click_mouse(request)
71
71
  rescue StandardError => e
72
72
  raise Sdk::Error, "Failed to click mouse: #{e.message}"
73
73
  end
@@ -87,7 +87,7 @@ module Daytona
87
87
  # puts "Dragged from #{result.from_x},#{result.from_y} to #{result.to_x},#{result.to_y}"
88
88
  def drag(start_x:, start_y:, end_x:, end_y:, button: 'left')
89
89
  request = DaytonaToolboxApiClient::MouseDragRequest.new(start_x:, start_y:, end_x:, end_y:, button:)
90
- toolbox_api.drag(request)
90
+ toolbox_api.drag_mouse(request)
91
91
  rescue StandardError => e
92
92
  raise Sdk::Error, "Failed to drag mouse: #{e.message}"
93
93
  end
@@ -109,7 +109,7 @@ module Daytona
109
109
  # scroll_down = sandbox.computer_use.mouse.scroll(x: 100, y: 200, direction: 'down', amount: 5)
110
110
  def scroll(x:, y:, direction:, amount: 1) # rubocop:disable Naming/MethodParameterName
111
111
  request = DaytonaToolboxApiClient::MouseScrollRequest.new(x:, y:, direction:, amount:)
112
- toolbox_api.scroll(request)
112
+ toolbox_api.scroll_mouse(request)
113
113
  true
114
114
  rescue StandardError => e
115
115
  raise Sdk::Error, "Failed to scroll mouse: #{e.message}"
data/lib/daytona/git.rb CHANGED
@@ -37,7 +37,7 @@ module Daytona
37
37
  # "README.md"
38
38
  # ])
39
39
  def add(path, files)
40
- toolbox_api.add_files(DaytonaToolboxApiClient::GitAddRequest.new(path:, files:))
40
+ toolbox_api.git_add_files(DaytonaToolboxApiClient::GitAddRequest.new(path:, files:))
41
41
  rescue StandardError => e
42
42
  raise Sdk::Error, "Failed to add files: #{e.message}"
43
43
  end
@@ -53,7 +53,7 @@ module Daytona
53
53
  # response = sandbox.git.branches("workspace/repo")
54
54
  # puts "Branches: #{response.branches}"
55
55
  def branches(path)
56
- toolbox_api.list_branches(path)
56
+ toolbox_api.git_list_branches(path)
57
57
  rescue StandardError => e
58
58
  raise Sdk::Error, "Failed to list branches: #{e.message}"
59
59
  end
@@ -97,7 +97,7 @@ module Daytona
97
97
  # commit_id: "abc123"
98
98
  # )
99
99
  def clone(url:, path:, branch: nil, commit_id: nil, username: nil, password: nil) # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists
100
- toolbox_api.clone_repository(
100
+ toolbox_api.git_clone_repository(
101
101
  DaytonaToolboxApiClient::GitCloneRequest.new(
102
102
  url: url,
103
103
  branch: branch,
@@ -135,7 +135,7 @@ module Daytona
135
135
  # )
136
136
  # puts "Commit SHA: #{commit_response.sha}"
137
137
  def commit(path:, message:, author:, email:, allow_empty: false)
138
- response = toolbox_api.commit_changes(
138
+ response = toolbox_api.git_commit_changes(
139
139
  DaytonaToolboxApiClient::GitCommitRequest.new(path:, message:, author:, email:, allow_empty:)
140
140
  )
141
141
  GitCommitResponse.new(sha: response.hash)
@@ -165,7 +165,7 @@ module Daytona
165
165
  # password: "github_token"
166
166
  # )
167
167
  def push(path:, username: nil, password: nil)
168
- toolbox_api.push_changes(
168
+ toolbox_api.git_push_changes(
169
169
  DaytonaToolboxApiClient::GitRepoRequest.new(path:, username:, password:)
170
170
  )
171
171
  rescue StandardError => e
@@ -194,7 +194,7 @@ module Daytona
194
194
  # )
195
195
  #
196
196
  def pull(path:, username: nil, password: nil)
197
- toolbox_api.pull_changes(
197
+ toolbox_api.git_pull_changes(
198
198
  DaytonaToolboxApiClient::GitRepoRequest.new(path:, username:, password:)
199
199
  )
200
200
  rescue StandardError => e
@@ -214,7 +214,7 @@ module Daytona
214
214
  # puts "Commits ahead: #{status.ahead}"
215
215
  # puts "Commits behind: #{status.behind}"
216
216
  def status(path)
217
- toolbox_api.get_status(path)
217
+ toolbox_api.git_get_status(path)
218
218
  rescue StandardError => e
219
219
  raise Sdk::Error, "Failed to get status: #{e.message}"
220
220
  end
@@ -231,7 +231,7 @@ module Daytona
231
231
  # # Checkout a branch
232
232
  # sandbox.git.checkout_branch("workspace/repo", "feature-branch")
233
233
  def checkout_branch(path, branch)
234
- toolbox_api.checkout_branch(
234
+ toolbox_api.git_checkout_branch(
235
235
  DaytonaToolboxApiClient::GitCheckoutRequest.new(path:, branch:)
236
236
  )
237
237
  rescue StandardError => e
@@ -251,7 +251,7 @@ module Daytona
251
251
  # sandbox.git.create_branch("workspace/repo", "new-feature")
252
252
  #
253
253
  def create_branch(path, name)
254
- toolbox_api.create_branch(
254
+ toolbox_api.git_create_branch(
255
255
  DaytonaToolboxApiClient::GitBranchRequest.new(path:, name:)
256
256
  )
257
257
  rescue StandardError => e
@@ -270,7 +270,7 @@ module Daytona
270
270
  # # Delete a branch
271
271
  # sandbox.git.delete_branch("workspace/repo", "old-feature")
272
272
  def delete_branch(path, name)
273
- toolbox_api.delete_branch(
273
+ toolbox_api.git_delete_branch(
274
274
  DaytonaToolboxApiClient::GitDeleteBranchRequest.new(path:, name:)
275
275
  )
276
276
  rescue StandardError => e
@@ -44,7 +44,7 @@ module Daytona
44
44
  # @param position [Daytona::LspServer::Position]
45
45
  # @return [DaytonaApiClient::CompletionList]
46
46
  def completions(path:, position:)
47
- toolbox_api.completions(
47
+ toolbox_api.lsp_completions(
48
48
  DaytonaToolboxApiClient::LspCompletionParams.new(
49
49
  language_id:,
50
50
  path_to_project:,
@@ -61,7 +61,7 @@ module Daytona
61
61
  # @param path [String]
62
62
  # @return [void]
63
63
  def did_close(path)
64
- toolbox_api.did_close(
64
+ toolbox_api.lsp_did_close(
65
65
  DaytonaToolboxApiClient::LspDocumentRequest.new(language_id:, path_to_project:, uri: uri(path))
66
66
  )
67
67
  end
@@ -74,7 +74,7 @@ module Daytona
74
74
  # @param path [String]
75
75
  # @return [void]
76
76
  def did_open(path)
77
- toolbox_api.did_open(
77
+ toolbox_api.lsp_did_open(
78
78
  DaytonaToolboxApiClient::LspDocumentRequest.new(language_id:, path_to_project:, uri: uri(path))
79
79
  )
80
80
  end
@@ -83,14 +83,14 @@ module Daytona
83
83
  #
84
84
  # @param path [String]
85
85
  # @return [Array<DaytonaToolboxApiClient::LspSymbol]
86
- def document_symbols(path) = toolbox_api.document_symbols(language_id, path_to_project, uri(path))
86
+ def document_symbols(path) = toolbox_api.lsp_document_symbols(language_id, path_to_project, uri(path))
87
87
 
88
88
  # Searches for symbols matching the query string across all files
89
89
  # in the Sandbox.
90
90
  #
91
91
  # @param query [String]
92
92
  # @return [Array<DaytonaToolboxApiClient::LspSymbol]
93
- def sandbox_symbols(query) = toolbox_api.workspace_symbols(query, language_id, path_to_project)
93
+ def sandbox_symbols(query) = toolbox_api.lsp_workspace_symbols(language_id, path_to_project, query)
94
94
 
95
95
  # Starts the language server.
96
96
  # This method must be called before using any other LSP functionality.
@@ -98,7 +98,7 @@ module Daytona
98
98
  #
99
99
  # @return [void]
100
100
  def start
101
- toolbox_api.start(
101
+ toolbox_api.lsp_start(
102
102
  DaytonaToolboxApiClient::LspServerRequest.new(language_id:, path_to_project:)
103
103
  )
104
104
  end
@@ -109,7 +109,7 @@ module Daytona
109
109
  #
110
110
  # @return [void]
111
111
  def stop
112
- toolbox_api.stop(
112
+ toolbox_api.lsp_stop(
113
113
  DaytonaToolboxApiClient::LspServerRequest.new(language_id:, path_to_project:)
114
114
  )
115
115
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Daytona
4
4
  module Sdk
5
- VERSION = '0.126.0.alpha.7'
5
+ VERSION = '0.126.0-alpha.4'
6
6
  end
7
7
  end
@@ -99,8 +99,7 @@ module Daytona
99
99
 
100
100
  snapshot = snapshots_api.create_snapshot(create_snapshot_req)
101
101
 
102
- # Always wait for snapshot to be ready, regardless of on_logs
103
- snapshot = wait_for_snapshot(snapshot, on_logs:)
102
+ snapshot = stream_logs(snapshot, on_logs:) if on_logs
104
103
 
105
104
  if [DaytonaApiClient::SnapshotState::ERROR, DaytonaApiClient::SnapshotState::BUILD_FAILED].include?(snapshot.state)
106
105
  raise Sdk::Error, "Failed to create snapshot #{snapshot.name}, reason: #{snapshot.error_reason}"
@@ -149,13 +148,10 @@ module Daytona
149
148
  # @return [DaytonaApiClient::ObjectStorageApi, nil] The object storage API client
150
149
  attr_reader :object_storage_api
151
150
 
152
- # Wait for snapshot to reach a terminal state (ACTIVE, ERROR, or BUILD_FAILED)
153
- # Optionally streams logs if on_logs callback is provided
154
- #
155
151
  # @param snapshot [DaytonaApiClient::SnapshotDto]
156
- # @param on_logs [Proc, nil]
152
+ # @param on_logs [Proc]
157
153
  # @return [DaytonaApiClient::SnapshotDto]
158
- def wait_for_snapshot(snapshot, on_logs:) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
154
+ def stream_logs(snapshot, on_logs:) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
159
155
  terminal_states = [
160
156
  DaytonaApiClient::SnapshotState::ACTIVE,
161
157
  DaytonaApiClient::SnapshotState::ERROR,
@@ -164,25 +160,13 @@ module Daytona
164
160
 
165
161
  thread = nil
166
162
  previous_state = snapshot.state
167
-
168
- # Log initial state if callback provided
169
- on_logs&.call("Creating snapshot #{snapshot.name} (#{snapshot.state})")
170
-
171
163
  until terminal_states.include?(snapshot.state)
172
164
  Sdk.logger.debug("Waiting for snapshot to be created: #{snapshot.state}")
173
-
174
- # Start log streaming thread if callback provided and snapshot is building
175
- if on_logs && thread.nil? && snapshot.state != DaytonaApiClient::SnapshotState::PENDING
165
+ if thread.nil? && snapshot.state != DaytonaApiClient::SnapshotState::BUILD_PENDING
176
166
  thread = start_log_streaming(snapshot, on_logs:)
177
167
  end
178
168
 
179
- # Log state changes if callback provided
180
- if on_logs && previous_state != snapshot.state
181
- if snapshot.state != DaytonaApiClient::SnapshotState::PENDING && thread.nil?
182
- thread = start_log_streaming(snapshot, on_logs:)
183
- end
184
- on_logs.call("Creating snapshot #{snapshot.name} (#{snapshot.state})")
185
- end
169
+ on_logs.call("Creating snapshot #{snapshot.name} (#{snapshot.state})") if previous_state != snapshot.state
186
170
 
187
171
  sleep(1)
188
172
  previous_state = snapshot.state
@@ -191,7 +175,7 @@ module Daytona
191
175
 
192
176
  thread&.join
193
177
 
194
- if on_logs && snapshot.state == DaytonaApiClient::SnapshotState::ACTIVE
178
+ if snapshot.state == DaytonaApiClient::SnapshotState::ACTIVE
195
179
  on_logs.call("Created snapshot #{snapshot.name} (#{snapshot.state})")
196
180
  end
197
181
 
data/project.json CHANGED
@@ -53,11 +53,7 @@
53
53
  "executor": "nx:run-commands",
54
54
  "options": {
55
55
  "cwd": "{projectRoot}",
56
- "commands": [
57
- "mkdir -p ~/.gem && echo \":rubygems: $RUBYGEMS_API_KEY\" > ~/.gem/credentials && chmod 0600 ~/.gem/credentials",
58
- "gem push daytona-*.gem --key rubygems --host https://rubygems.org"
59
- ],
60
- "parallel": false
56
+ "command": "gem push daytona-*.gem --key rubygems --host https://rubygems.org"
61
57
  },
62
58
  "dependsOn": [
63
59
  {
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.126.0.alpha.7
4
+ version: 0.126.0.pre.alpha.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daytona Platforms Inc.
@@ -29,28 +29,28 @@ dependencies:
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.126.0.alpha.7
32
+ version: 0.126.0.pre.alpha.4
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.126.0.alpha.7
39
+ version: 0.126.0.pre.alpha.4
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: daytona_toolbox_api_client
42
42
  requirement: !ruby/object:Gem::Requirement
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 0.126.0.alpha.7
46
+ version: 0.126.0.pre.alpha.4
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 0.126.0.alpha.7
53
+ version: 0.126.0.pre.alpha.4
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: dotenv
56
56
  requirement: !ruby/object:Gem::Requirement