@daytonaio/sdk 0.169.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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@daytonaio/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.170.0",
|
|
4
4
|
"description": "Daytona TypeScript SDK for sandbox management and code execution",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"pathe": "^2.0.3",
|
|
49
49
|
"shell-quote": "^1.8.2",
|
|
50
50
|
"tar": "^7.5.11",
|
|
51
|
-
"@daytona/api-client": "0.
|
|
52
|
-
"@daytona/toolbox-api-client": "0.
|
|
51
|
+
"@daytona/api-client": "0.170.0",
|
|
52
|
+
"@daytona/toolbox-api-client": "0.170.0"
|
|
53
53
|
},
|
|
54
54
|
"packageManager": "yarn@4.13.0",
|
|
55
55
|
"type": "commonjs"
|
package/src/ComputerUse.d.ts
CHANGED
|
@@ -143,15 +143,15 @@ export declare class Keyboard {
|
|
|
143
143
|
/**
|
|
144
144
|
* Presses a key with optional modifiers
|
|
145
145
|
*
|
|
146
|
-
* @param {string} key - The key to press
|
|
147
|
-
* @param {string[]} [modifiers=[]] -
|
|
146
|
+
* @param {string} key - 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.
|
|
147
|
+
* @param {string[]} [modifiers=[]] - Canonical modifier names are 'ctrl', 'alt', 'shift', and 'cmd'. Common aliases such as 'control', 'option', 'meta', and 'win' are normalized.
|
|
148
148
|
* @throws {DaytonaError} If the press operation fails
|
|
149
149
|
*
|
|
150
150
|
* @example
|
|
151
151
|
* ```typescript
|
|
152
152
|
* // Press Enter
|
|
153
153
|
* try {
|
|
154
|
-
* await sandbox.computerUse.keyboard.press('
|
|
154
|
+
* await sandbox.computerUse.keyboard.press('enter');
|
|
155
155
|
* console.log('Operation success');
|
|
156
156
|
* } catch (e) {
|
|
157
157
|
* console.log('Operation failed:', e);
|
|
@@ -178,7 +178,7 @@ export declare class Keyboard {
|
|
|
178
178
|
/**
|
|
179
179
|
* Presses a hotkey combination
|
|
180
180
|
*
|
|
181
|
-
* @param {string} keys -
|
|
181
|
+
* @param {string} keys - 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()`.
|
|
182
182
|
* @throws {DaytonaError} If the hotkey operation fails
|
|
183
183
|
*
|
|
184
184
|
* @example
|
package/src/ComputerUse.js
CHANGED
|
@@ -192,15 +192,15 @@ class Keyboard {
|
|
|
192
192
|
/**
|
|
193
193
|
* Presses a key with optional modifiers
|
|
194
194
|
*
|
|
195
|
-
* @param {string} key - The key to press
|
|
196
|
-
* @param {string[]} [modifiers=[]] -
|
|
195
|
+
* @param {string} key - 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.
|
|
196
|
+
* @param {string[]} [modifiers=[]] - Canonical modifier names are 'ctrl', 'alt', 'shift', and 'cmd'. Common aliases such as 'control', 'option', 'meta', and 'win' are normalized.
|
|
197
197
|
* @throws {DaytonaError} If the press operation fails
|
|
198
198
|
*
|
|
199
199
|
* @example
|
|
200
200
|
* ```typescript
|
|
201
201
|
* // Press Enter
|
|
202
202
|
* try {
|
|
203
|
-
* await sandbox.computerUse.keyboard.press('
|
|
203
|
+
* await sandbox.computerUse.keyboard.press('enter');
|
|
204
204
|
* console.log('Operation success');
|
|
205
205
|
* } catch (e) {
|
|
206
206
|
* console.log('Operation failed:', e);
|
|
@@ -230,7 +230,7 @@ class Keyboard {
|
|
|
230
230
|
/**
|
|
231
231
|
* Presses a hotkey combination
|
|
232
232
|
*
|
|
233
|
-
* @param {string} keys -
|
|
233
|
+
* @param {string} keys - 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()`.
|
|
234
234
|
* @throws {DaytonaError} If the hotkey operation fails
|
|
235
235
|
*
|
|
236
236
|
* @example
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright Daytona Platforms Inc.
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.toMuxedOutput = exports.flushPromises = exports.createApiResponse = void 0;
|
|
6
|
+
const createApiResponse = (data) => ({ data });
|
|
7
|
+
exports.createApiResponse = createApiResponse;
|
|
8
|
+
const flushPromises = async () => {
|
|
9
|
+
await Promise.resolve();
|
|
10
|
+
};
|
|
11
|
+
exports.flushPromises = flushPromises;
|
|
12
|
+
const toMuxedOutput = (stdout, stderr) => {
|
|
13
|
+
const stdoutPrefix = new Uint8Array([0x01, 0x01, 0x01]);
|
|
14
|
+
const stderrPrefix = new Uint8Array([0x02, 0x02, 0x02]);
|
|
15
|
+
const encoder = new TextEncoder();
|
|
16
|
+
const out = encoder.encode(stdout);
|
|
17
|
+
const err = encoder.encode(stderr);
|
|
18
|
+
const bytes = new Uint8Array(stdoutPrefix.length + out.length + stderrPrefix.length + err.length);
|
|
19
|
+
bytes.set(stdoutPrefix, 0);
|
|
20
|
+
bytes.set(out, stdoutPrefix.length);
|
|
21
|
+
bytes.set(stderrPrefix, stdoutPrefix.length + out.length);
|
|
22
|
+
bytes.set(err, stdoutPrefix.length + out.length + stderrPrefix.length);
|
|
23
|
+
return new TextDecoder().decode(bytes);
|
|
24
|
+
};
|
|
25
|
+
exports.toMuxedOutput = toMuxedOutput;
|
|
26
|
+
//# sourceMappingURL=helpers.js.map
|
|
@@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