@daytonaio/sdk 0.175.0 → 0.178.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.
Files changed (91) hide show
  1. package/cjs/CodeInterpreter.d.ts +3 -2
  2. package/cjs/CodeInterpreter.js.map +1 -1
  3. package/cjs/ComputerUse.d.ts +104 -2
  4. package/cjs/ComputerUse.js +851 -763
  5. package/cjs/ComputerUse.js.map +1 -1
  6. package/cjs/Daytona.d.ts +4 -3
  7. package/cjs/Daytona.js +429 -443
  8. package/cjs/Daytona.js.map +1 -1
  9. package/cjs/FileSystem.d.ts +2 -2
  10. package/cjs/FileSystem.js +491 -521
  11. package/cjs/FileSystem.js.map +1 -1
  12. package/cjs/Git.d.ts +2 -1
  13. package/cjs/Git.js +287 -310
  14. package/cjs/Git.js.map +1 -1
  15. package/cjs/LspServer.d.ts +2 -1
  16. package/cjs/LspServer.js +209 -226
  17. package/cjs/LspServer.js.map +1 -1
  18. package/cjs/ObjectStorage.js +170 -166
  19. package/cjs/ObjectStorage.js.map +1 -1
  20. package/cjs/Process.d.ts +4 -3
  21. package/cjs/Process.js +562 -600
  22. package/cjs/Process.js.map +1 -1
  23. package/cjs/PtyHandle.d.ts +2 -2
  24. package/cjs/PtyHandle.js +327 -338
  25. package/cjs/PtyHandle.js.map +1 -1
  26. package/cjs/Sandbox.d.ts +4 -3
  27. package/cjs/Sandbox.js +756 -821
  28. package/cjs/Sandbox.js.map +1 -1
  29. package/cjs/Snapshot.d.ts +3 -2
  30. package/cjs/Snapshot.js +203 -213
  31. package/cjs/Snapshot.js.map +1 -1
  32. package/cjs/Volume.d.ts +2 -1
  33. package/cjs/Volume.js +90 -92
  34. package/cjs/Volume.js.map +1 -1
  35. package/cjs/errors/DaytonaError.d.ts +2 -1
  36. package/cjs/errors/DaytonaError.js.map +1 -1
  37. package/cjs/index.d.ts +2 -2
  38. package/cjs/index.js +2 -1
  39. package/cjs/index.js.map +1 -1
  40. package/cjs/types/CodeInterpreter.d.ts +1 -1
  41. package/cjs/utils/Binary.js +14 -2
  42. package/cjs/utils/Binary.js.map +1 -1
  43. package/cjs/utils/otel.decorator.d.ts +7 -8
  44. package/cjs/utils/otel.decorator.js +24 -30
  45. package/cjs/utils/otel.decorator.js.map +1 -1
  46. package/esm/CodeInterpreter.d.ts +3 -2
  47. package/esm/CodeInterpreter.js.map +1 -1
  48. package/esm/ComputerUse.d.ts +104 -2
  49. package/esm/ComputerUse.js +857 -763
  50. package/esm/ComputerUse.js.map +1 -1
  51. package/esm/Daytona.d.ts +4 -3
  52. package/esm/Daytona.js +431 -444
  53. package/esm/Daytona.js.map +1 -1
  54. package/esm/FileSystem.d.ts +2 -2
  55. package/esm/FileSystem.js +493 -522
  56. package/esm/FileSystem.js.map +1 -1
  57. package/esm/Git.d.ts +2 -1
  58. package/esm/Git.js +289 -311
  59. package/esm/Git.js.map +1 -1
  60. package/esm/LspServer.d.ts +2 -1
  61. package/esm/LspServer.js +211 -227
  62. package/esm/LspServer.js.map +1 -1
  63. package/esm/ObjectStorage.js +172 -167
  64. package/esm/ObjectStorage.js.map +1 -1
  65. package/esm/Process.d.ts +4 -3
  66. package/esm/Process.js +564 -601
  67. package/esm/Process.js.map +1 -1
  68. package/esm/PtyHandle.d.ts +2 -2
  69. package/esm/PtyHandle.js +329 -339
  70. package/esm/PtyHandle.js.map +1 -1
  71. package/esm/Sandbox.d.ts +4 -3
  72. package/esm/Sandbox.js +759 -823
  73. package/esm/Sandbox.js.map +1 -1
  74. package/esm/Snapshot.d.ts +3 -2
  75. package/esm/Snapshot.js +206 -215
  76. package/esm/Snapshot.js.map +1 -1
  77. package/esm/Volume.d.ts +2 -1
  78. package/esm/Volume.js +92 -93
  79. package/esm/Volume.js.map +1 -1
  80. package/esm/errors/DaytonaError.d.ts +2 -1
  81. package/esm/errors/DaytonaError.js.map +1 -1
  82. package/esm/index.d.ts +2 -2
  83. package/esm/index.js +1 -1
  84. package/esm/index.js.map +1 -1
  85. package/esm/types/CodeInterpreter.d.ts +1 -1
  86. package/esm/utils/Binary.js +14 -2
  87. package/esm/utils/Binary.js.map +1 -1
  88. package/esm/utils/otel.decorator.d.ts +7 -8
  89. package/esm/utils/otel.decorator.js +26 -32
  90. package/esm/utils/otel.decorator.js.map +1 -1
  91. package/package.json +3 -3
package/cjs/Git.js CHANGED
@@ -12,315 +12,292 @@ const otel_decorator_1 = require("./utils/otel.decorator");
12
12
  *
13
13
  * @class
14
14
  */
15
- class Git {
16
- apiClient;
17
- constructor(apiClient) {
18
- this.apiClient = apiClient;
19
- }
20
- /**
21
- * Stages the specified files for the next commit, similar to
22
- * running 'git add' on the command line.
23
- *
24
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
25
- * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
26
- * @returns {Promise<void>}
27
- *
28
- * @example
29
- * // Stage a single file
30
- * await git.add('workspace/repo', ['file.txt']);
31
- *
32
- * @example
33
- * // Stage whole repository
34
- * await git.add('workspace/repo', ['.']);
35
- */
36
- async add(path, files) {
37
- await this.apiClient.addFiles({
38
- path,
39
- files,
40
- });
41
- }
42
- /**
43
- * List branches in the repository.
44
- *
45
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
46
- * @returns {Promise<ListBranchResponse>} List of branches in the repository
47
- *
48
- * @example
49
- * const response = await git.branches('workspace/repo');
50
- * console.log(`Branches: ${response.branches}`);
51
- */
52
- async branches(path) {
53
- const response = await this.apiClient.listBranches(path);
54
- return response.data;
55
- }
56
- /**
57
- * Create branch in the repository.
58
- *
59
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
60
- * @param {string} name - Name of the new branch to create
61
- * @returns {Promise<void>}
62
- *
63
- * @example
64
- * await git.createBranch('workspace/repo', 'new-feature');
65
- */
66
- async createBranch(path, name) {
67
- await this.apiClient.createBranch({
68
- path,
69
- name,
70
- });
71
- return;
72
- }
73
- /**
74
- * Delete branche in the repository.
75
- *
76
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
77
- * @param {string} name - Name of the branch to delete
78
- * @returns {Promise<void>}
79
- *
80
- * @example
81
- * await git.deleteBranch('workspace/repo', 'new-feature');
82
- */
83
- async deleteBranch(path, name) {
84
- await this.apiClient.deleteBranch({
85
- path,
86
- name,
87
- });
88
- return;
89
- }
90
- /**
91
- * Checkout branche in the repository.
92
- *
93
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
94
- * @param {string} branch - Name of the branch to checkout
95
- * @returns {Promise<void>}
96
- *
97
- * @example
98
- * await git.checkoutBranch('workspace/repo', 'new-feature');
99
- */
100
- async checkoutBranch(path, branch) {
101
- await this.apiClient.checkoutBranch({
102
- path,
103
- branch,
104
- });
105
- return;
106
- }
107
- /**
108
- * Clones a Git repository into the specified path. It supports
109
- * cloning specific branches or commits, and can authenticate with the remote
110
- * repository if credentials are provided.
111
- *
112
- * @param {string} url - Repository URL to clone from
113
- * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
114
- * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
115
- * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
116
- * @param {string} [username] - Git username for authentication
117
- * @param {string} [password] - Git password or token for authentication
118
- * @returns {Promise<void>}
119
- *
120
- * @example
121
- * // Clone the default branch
122
- * await git.clone(
123
- * 'https://github.com/user/repo.git',
124
- * 'workspace/repo'
125
- * );
126
- *
127
- * @example
128
- * // Clone a specific branch with authentication
129
- * await git.clone(
130
- * 'https://github.com/user/private-repo.git',
131
- * 'workspace/private',
132
- * branch='develop',
133
- * username='user',
134
- * password='token'
135
- * );
136
- *
137
- * @example
138
- * // Clone a specific commit
139
- * await git.clone(
140
- * 'https://github.com/user/repo.git',
141
- * 'workspace/repo-old',
142
- * commitId='abc123'
143
- * );
144
- */
145
- async clone(url, path, branch, commitId, username, password) {
146
- await this.apiClient.cloneRepository({
147
- url: url,
148
- branch: branch,
149
- path,
150
- username,
151
- password,
152
- commit_id: commitId,
153
- });
154
- }
155
- /**
156
- * Commits staged changes.
157
- *
158
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
159
- * @param {string} message - Commit message describing the changes
160
- * @param {string} author - Name of the commit author
161
- * @param {string} email - Email address of the commit author
162
- * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
163
- * @returns {Promise<void>}
164
- *
165
- * @example
166
- * // Stage and commit changes
167
- * await git.add('workspace/repo', ['README.md']);
168
- * await git.commit(
169
- * 'workspace/repo',
170
- * 'Update documentation',
171
- * 'John Doe',
172
- * 'john@example.com',
173
- * true
174
- * );
175
- *
176
- */
177
- async commit(path, message, author, email, allowEmpty) {
178
- const response = await this.apiClient.commitChanges({
179
- path,
180
- message,
181
- author,
182
- email,
183
- allow_empty: allowEmpty,
184
- });
185
- return {
186
- sha: response.data.hash,
187
- };
188
- }
189
- /**
190
- * Push local changes to the remote repository.
191
- *
192
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
193
- * @param {string} [username] - Git username for authentication
194
- * @param {string} [password] - Git password or token for authentication
195
- * @returns {Promise<void>}
196
- *
197
- * @example
198
- * // Push to a public repository
199
- * await git.push('workspace/repo');
200
- *
201
- * @example
202
- * // Push to a private repository
203
- * await git.push(
204
- * 'workspace/repo',
205
- * 'user',
206
- * 'token'
207
- * );
208
- */
209
- async push(path, username, password) {
210
- await this.apiClient.pushChanges({
211
- path,
212
- username,
213
- password,
214
- });
215
- }
216
- /**
217
- * Pulls changes from the remote repository.
218
- *
219
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
220
- * @param {string} [username] - Git username for authentication
221
- * @param {string} [password] - Git password or token for authentication
222
- * @returns {Promise<void>}
223
- *
224
- * @example
225
- * // Pull from a public repository
226
- * await git.pull('workspace/repo');
227
- *
228
- * @example
229
- * // Pull from a private repository
230
- * await git.pull(
231
- * 'workspace/repo',
232
- * 'user',
233
- * 'token'
234
- * );
235
- */
236
- async pull(path, username, password) {
237
- await this.apiClient.pullChanges({
238
- path,
239
- username,
240
- password,
241
- });
242
- }
243
- /**
244
- * Gets the current status of the Git repository.
245
- *
246
- * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
247
- * @returns {Promise<GitStatus>} Current repository status including:
248
- * - currentBranch: Name of the current branch
249
- * - ahead: Number of commits ahead of the remote branch
250
- * - behind: Number of commits behind the remote branch
251
- * - branchPublished: Whether the branch has been published to the remote repository
252
- * - fileStatus: List of file statuses
253
- *
254
- * @example
255
- * const status = await sandbox.git.status('workspace/repo');
256
- * console.log(`Current branch: ${status.currentBranch}`);
257
- * console.log(`Commits ahead: ${status.ahead}`);
258
- * console.log(`Commits behind: ${status.behind}`);
259
- */
260
- async status(path) {
261
- const response = await this.apiClient.getStatus(path);
262
- return response.data;
263
- }
264
- }
15
+ let Git = (() => {
16
+ let _instanceExtraInitializers = [];
17
+ let _add_decorators;
18
+ let _branches_decorators;
19
+ let _createBranch_decorators;
20
+ let _deleteBranch_decorators;
21
+ let _checkoutBranch_decorators;
22
+ let _clone_decorators;
23
+ let _commit_decorators;
24
+ let _push_decorators;
25
+ let _pull_decorators;
26
+ let _status_decorators;
27
+ return class Git {
28
+ static {
29
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
30
+ _add_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
31
+ _branches_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
32
+ _createBranch_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
33
+ _deleteBranch_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
34
+ _checkoutBranch_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
35
+ _clone_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
36
+ _commit_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
37
+ _push_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
38
+ _pull_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
39
+ _status_decorators = [(0, otel_decorator_1.WithInstrumentation)()];
40
+ tslib_1.__esDecorate(this, null, _add_decorators, { kind: "method", name: "add", static: false, private: false, access: { has: obj => "add" in obj, get: obj => obj.add }, metadata: _metadata }, null, _instanceExtraInitializers);
41
+ tslib_1.__esDecorate(this, null, _branches_decorators, { kind: "method", name: "branches", static: false, private: false, access: { has: obj => "branches" in obj, get: obj => obj.branches }, metadata: _metadata }, null, _instanceExtraInitializers);
42
+ tslib_1.__esDecorate(this, null, _createBranch_decorators, { kind: "method", name: "createBranch", static: false, private: false, access: { has: obj => "createBranch" in obj, get: obj => obj.createBranch }, metadata: _metadata }, null, _instanceExtraInitializers);
43
+ tslib_1.__esDecorate(this, null, _deleteBranch_decorators, { kind: "method", name: "deleteBranch", static: false, private: false, access: { has: obj => "deleteBranch" in obj, get: obj => obj.deleteBranch }, metadata: _metadata }, null, _instanceExtraInitializers);
44
+ tslib_1.__esDecorate(this, null, _checkoutBranch_decorators, { kind: "method", name: "checkoutBranch", static: false, private: false, access: { has: obj => "checkoutBranch" in obj, get: obj => obj.checkoutBranch }, metadata: _metadata }, null, _instanceExtraInitializers);
45
+ tslib_1.__esDecorate(this, null, _clone_decorators, { kind: "method", name: "clone", static: false, private: false, access: { has: obj => "clone" in obj, get: obj => obj.clone }, metadata: _metadata }, null, _instanceExtraInitializers);
46
+ tslib_1.__esDecorate(this, null, _commit_decorators, { kind: "method", name: "commit", static: false, private: false, access: { has: obj => "commit" in obj, get: obj => obj.commit }, metadata: _metadata }, null, _instanceExtraInitializers);
47
+ tslib_1.__esDecorate(this, null, _push_decorators, { kind: "method", name: "push", static: false, private: false, access: { has: obj => "push" in obj, get: obj => obj.push }, metadata: _metadata }, null, _instanceExtraInitializers);
48
+ tslib_1.__esDecorate(this, null, _pull_decorators, { kind: "method", name: "pull", static: false, private: false, access: { has: obj => "pull" in obj, get: obj => obj.pull }, metadata: _metadata }, null, _instanceExtraInitializers);
49
+ tslib_1.__esDecorate(this, null, _status_decorators, { kind: "method", name: "status", static: false, private: false, access: { has: obj => "status" in obj, get: obj => obj.status }, metadata: _metadata }, null, _instanceExtraInitializers);
50
+ if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
51
+ }
52
+ apiClient = tslib_1.__runInitializers(this, _instanceExtraInitializers);
53
+ constructor(apiClient) {
54
+ this.apiClient = apiClient;
55
+ }
56
+ /**
57
+ * Stages the specified files for the next commit, similar to
58
+ * running 'git add' on the command line.
59
+ *
60
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
61
+ * @param {string[]} files - List of file paths or directories to stage, relative to the repository root
62
+ * @returns {Promise<void>}
63
+ *
64
+ * @example
65
+ * // Stage a single file
66
+ * await git.add('workspace/repo', ['file.txt']);
67
+ *
68
+ * @example
69
+ * // Stage whole repository
70
+ * await git.add('workspace/repo', ['.']);
71
+ */
72
+ async add(path, files) {
73
+ await this.apiClient.addFiles({
74
+ path,
75
+ files,
76
+ });
77
+ }
78
+ /**
79
+ * List branches in the repository.
80
+ *
81
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
82
+ * @returns {Promise<ListBranchResponse>} List of branches in the repository
83
+ *
84
+ * @example
85
+ * const response = await git.branches('workspace/repo');
86
+ * console.log(`Branches: ${response.branches}`);
87
+ */
88
+ async branches(path) {
89
+ const response = await this.apiClient.listBranches(path);
90
+ return response.data;
91
+ }
92
+ /**
93
+ * Create branch in the repository.
94
+ *
95
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
96
+ * @param {string} name - Name of the new branch to create
97
+ * @returns {Promise<void>}
98
+ *
99
+ * @example
100
+ * await git.createBranch('workspace/repo', 'new-feature');
101
+ */
102
+ async createBranch(path, name) {
103
+ await this.apiClient.createBranch({
104
+ path,
105
+ name,
106
+ });
107
+ return;
108
+ }
109
+ /**
110
+ * Delete branche in the repository.
111
+ *
112
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
113
+ * @param {string} name - Name of the branch to delete
114
+ * @returns {Promise<void>}
115
+ *
116
+ * @example
117
+ * await git.deleteBranch('workspace/repo', 'new-feature');
118
+ */
119
+ async deleteBranch(path, name) {
120
+ await this.apiClient.deleteBranch({
121
+ path,
122
+ name,
123
+ });
124
+ return;
125
+ }
126
+ /**
127
+ * Checkout branche in the repository.
128
+ *
129
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
130
+ * @param {string} branch - Name of the branch to checkout
131
+ * @returns {Promise<void>}
132
+ *
133
+ * @example
134
+ * await git.checkoutBranch('workspace/repo', 'new-feature');
135
+ */
136
+ async checkoutBranch(path, branch) {
137
+ await this.apiClient.checkoutBranch({
138
+ path,
139
+ branch,
140
+ });
141
+ return;
142
+ }
143
+ /**
144
+ * Clones a Git repository into the specified path. It supports
145
+ * cloning specific branches or commits, and can authenticate with the remote
146
+ * repository if credentials are provided.
147
+ *
148
+ * @param {string} url - Repository URL to clone from
149
+ * @param {string} path - Path where the repository should be cloned. Relative paths are resolved based on the sandbox working directory.
150
+ * @param {string} [branch] - Specific branch to clone. If not specified, clones the default branch
151
+ * @param {string} [commitId] - Specific commit to clone. If specified, the repository will be left in a detached HEAD state at this commit
152
+ * @param {string} [username] - Git username for authentication
153
+ * @param {string} [password] - Git password or token for authentication
154
+ * @returns {Promise<void>}
155
+ *
156
+ * @example
157
+ * // Clone the default branch
158
+ * await git.clone(
159
+ * 'https://github.com/user/repo.git',
160
+ * 'workspace/repo'
161
+ * );
162
+ *
163
+ * @example
164
+ * // Clone a specific branch with authentication
165
+ * await git.clone(
166
+ * 'https://github.com/user/private-repo.git',
167
+ * 'workspace/private',
168
+ * branch='develop',
169
+ * username='user',
170
+ * password='token'
171
+ * );
172
+ *
173
+ * @example
174
+ * // Clone a specific commit
175
+ * await git.clone(
176
+ * 'https://github.com/user/repo.git',
177
+ * 'workspace/repo-old',
178
+ * commitId='abc123'
179
+ * );
180
+ */
181
+ async clone(url, path, branch, commitId, username, password) {
182
+ await this.apiClient.cloneRepository({
183
+ url: url,
184
+ branch: branch,
185
+ path,
186
+ username,
187
+ password,
188
+ commit_id: commitId,
189
+ });
190
+ }
191
+ /**
192
+ * Commits staged changes.
193
+ *
194
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
195
+ * @param {string} message - Commit message describing the changes
196
+ * @param {string} author - Name of the commit author
197
+ * @param {string} email - Email address of the commit author
198
+ * @param {boolean} [allowEmpty] - Allow creating an empty commit when no changes are staged
199
+ * @returns {Promise<void>}
200
+ *
201
+ * @example
202
+ * // Stage and commit changes
203
+ * await git.add('workspace/repo', ['README.md']);
204
+ * await git.commit(
205
+ * 'workspace/repo',
206
+ * 'Update documentation',
207
+ * 'John Doe',
208
+ * 'john@example.com',
209
+ * true
210
+ * );
211
+ *
212
+ */
213
+ async commit(path, message, author, email, allowEmpty) {
214
+ const response = await this.apiClient.commitChanges({
215
+ path,
216
+ message,
217
+ author,
218
+ email,
219
+ allow_empty: allowEmpty,
220
+ });
221
+ return {
222
+ sha: response.data.hash,
223
+ };
224
+ }
225
+ /**
226
+ * Push local changes to the remote repository.
227
+ *
228
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
229
+ * @param {string} [username] - Git username for authentication
230
+ * @param {string} [password] - Git password or token for authentication
231
+ * @returns {Promise<void>}
232
+ *
233
+ * @example
234
+ * // Push to a public repository
235
+ * await git.push('workspace/repo');
236
+ *
237
+ * @example
238
+ * // Push to a private repository
239
+ * await git.push(
240
+ * 'workspace/repo',
241
+ * 'user',
242
+ * 'token'
243
+ * );
244
+ */
245
+ async push(path, username, password) {
246
+ await this.apiClient.pushChanges({
247
+ path,
248
+ username,
249
+ password,
250
+ });
251
+ }
252
+ /**
253
+ * Pulls changes from the remote repository.
254
+ *
255
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
256
+ * @param {string} [username] - Git username for authentication
257
+ * @param {string} [password] - Git password or token for authentication
258
+ * @returns {Promise<void>}
259
+ *
260
+ * @example
261
+ * // Pull from a public repository
262
+ * await git.pull('workspace/repo');
263
+ *
264
+ * @example
265
+ * // Pull from a private repository
266
+ * await git.pull(
267
+ * 'workspace/repo',
268
+ * 'user',
269
+ * 'token'
270
+ * );
271
+ */
272
+ async pull(path, username, password) {
273
+ await this.apiClient.pullChanges({
274
+ path,
275
+ username,
276
+ password,
277
+ });
278
+ }
279
+ /**
280
+ * Gets the current status of the Git repository.
281
+ *
282
+ * @param {string} path - Path to the Git repository root. Relative paths are resolved based on the sandbox working directory.
283
+ * @returns {Promise<GitStatus>} Current repository status including:
284
+ * - currentBranch: Name of the current branch
285
+ * - ahead: Number of commits ahead of the remote branch
286
+ * - behind: Number of commits behind the remote branch
287
+ * - branchPublished: Whether the branch has been published to the remote repository
288
+ * - fileStatus: List of file statuses
289
+ *
290
+ * @example
291
+ * const status = await sandbox.git.status('workspace/repo');
292
+ * console.log(`Current branch: ${status.currentBranch}`);
293
+ * console.log(`Commits ahead: ${status.ahead}`);
294
+ * console.log(`Commits behind: ${status.behind}`);
295
+ */
296
+ async status(path) {
297
+ const response = await this.apiClient.getStatus(path);
298
+ return response.data;
299
+ }
300
+ };
301
+ })();
265
302
  exports.Git = Git;
266
- tslib_1.__decorate([
267
- (0, otel_decorator_1.WithInstrumentation)(),
268
- tslib_1.__metadata("design:type", Function),
269
- tslib_1.__metadata("design:paramtypes", [String, Array]),
270
- tslib_1.__metadata("design:returntype", Promise)
271
- ], Git.prototype, "add", null);
272
- tslib_1.__decorate([
273
- (0, otel_decorator_1.WithInstrumentation)(),
274
- tslib_1.__metadata("design:type", Function),
275
- tslib_1.__metadata("design:paramtypes", [String]),
276
- tslib_1.__metadata("design:returntype", Promise)
277
- ], Git.prototype, "branches", null);
278
- tslib_1.__decorate([
279
- (0, otel_decorator_1.WithInstrumentation)(),
280
- tslib_1.__metadata("design:type", Function),
281
- tslib_1.__metadata("design:paramtypes", [String, String]),
282
- tslib_1.__metadata("design:returntype", Promise)
283
- ], Git.prototype, "createBranch", null);
284
- tslib_1.__decorate([
285
- (0, otel_decorator_1.WithInstrumentation)(),
286
- tslib_1.__metadata("design:type", Function),
287
- tslib_1.__metadata("design:paramtypes", [String, String]),
288
- tslib_1.__metadata("design:returntype", Promise)
289
- ], Git.prototype, "deleteBranch", null);
290
- tslib_1.__decorate([
291
- (0, otel_decorator_1.WithInstrumentation)(),
292
- tslib_1.__metadata("design:type", Function),
293
- tslib_1.__metadata("design:paramtypes", [String, String]),
294
- tslib_1.__metadata("design:returntype", Promise)
295
- ], Git.prototype, "checkoutBranch", null);
296
- tslib_1.__decorate([
297
- (0, otel_decorator_1.WithInstrumentation)(),
298
- tslib_1.__metadata("design:type", Function),
299
- tslib_1.__metadata("design:paramtypes", [String, String, String, String, String, String]),
300
- tslib_1.__metadata("design:returntype", Promise)
301
- ], Git.prototype, "clone", null);
302
- tslib_1.__decorate([
303
- (0, otel_decorator_1.WithInstrumentation)(),
304
- tslib_1.__metadata("design:type", Function),
305
- tslib_1.__metadata("design:paramtypes", [String, String, String, String, Boolean]),
306
- tslib_1.__metadata("design:returntype", Promise)
307
- ], Git.prototype, "commit", null);
308
- tslib_1.__decorate([
309
- (0, otel_decorator_1.WithInstrumentation)(),
310
- tslib_1.__metadata("design:type", Function),
311
- tslib_1.__metadata("design:paramtypes", [String, String, String]),
312
- tslib_1.__metadata("design:returntype", Promise)
313
- ], Git.prototype, "push", null);
314
- tslib_1.__decorate([
315
- (0, otel_decorator_1.WithInstrumentation)(),
316
- tslib_1.__metadata("design:type", Function),
317
- tslib_1.__metadata("design:paramtypes", [String, String, String]),
318
- tslib_1.__metadata("design:returntype", Promise)
319
- ], Git.prototype, "pull", null);
320
- tslib_1.__decorate([
321
- (0, otel_decorator_1.WithInstrumentation)(),
322
- tslib_1.__metadata("design:type", Function),
323
- tslib_1.__metadata("design:paramtypes", [String]),
324
- tslib_1.__metadata("design:returntype", Promise)
325
- ], Git.prototype, "status", null);
326
303
  //# sourceMappingURL=Git.js.map
package/cjs/Git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Git.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/Git.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;AAGH,2DAA4D;AAY5D;;;;GAIG;AACH,MAAa,GAAG;IACe;IAA7B,YAA6B,SAAiB;QAAjB,cAAS,GAAT,SAAS,CAAQ;IAAG,CAAC;IAElD;;;;;;;;;;;;;;;OAeG;IAEU,AAAN,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAAe;QAC5C,MAAM,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;YAC5B,IAAI;YACJ,KAAK;SACN,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;;;;OASG;IAEU,AAAN,KAAK,CAAC,QAAQ,CAAC,IAAY;QAChC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;QACxD,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;IAED;;;;;;;;;OASG;IAEU,AAAN,KAAK,CAAC,YAAY,CAAC,IAAY,EAAE,IAAY;QAClD,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;YAChC,IAAI;YACJ,IAAI;SACL,CAAC,CAAA;QACF,OAAM;IACR,CAAC;IAED;;;;;;;;;OASG;IAEU,AAAN,KAAK,CAAC,YAAY,CAAC,IAAY,EAAE,IAAY;QAClD,MAAM,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC;YAChC,IAAI;YACJ,IAAI;SACL,CAAC,CAAA;QACF,OAAM;IACR,CAAC;IAED;;;;;;;;;OASG;IAEU,AAAN,KAAK,CAAC,cAAc,CAAC,IAAY,EAAE,MAAc;QACtD,MAAM,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC;YAClC,IAAI;YACJ,MAAM;SAC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D,OAAO,QAAQ,CAAC,IAAI,CAAA;QACtB,CAAC;;;AAtRU,kBAAG"}
@@ -1,4 +1,5 @@
1
- import { CompletionList, LspSymbol, LspApi } from '@daytona/toolbox-api-client';
1
+ import { LspApi } from '@daytona/toolbox-api-client';
2
+ import type { CompletionList, LspSymbol } from '@daytona/toolbox-api-client';
2
3
  /**
3
4
  * Supported language server types.
4
5
  */