@daytonaio/sdk 0.162.0 → 0.164.0-alpha.1
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 +3 -3
- package/src/CodeInterpreter.js +4 -4
- package/src/CodeInterpreter.js.map +1 -1
- package/src/Daytona.d.ts +1 -9
- package/src/Daytona.js +23 -66
- package/src/Daytona.js.map +1 -1
- package/src/FileSystem.d.ts +19 -1
- package/src/FileSystem.js +11 -3
- package/src/FileSystem.js.map +1 -1
- package/src/Image.js +51 -11
- package/src/Image.js.map +1 -1
- package/src/LspServer.js +2 -1
- package/src/LspServer.js.map +1 -1
- package/src/ObjectStorage.js +1 -1
- package/src/ObjectStorage.js.map +1 -1
- package/src/Process.d.ts +2 -3
- package/src/Process.js +42 -177
- package/src/Process.js.map +1 -1
- package/src/PtyHandle.js +4 -4
- package/src/PtyHandle.js.map +1 -1
- package/src/Sandbox.d.ts +2 -14
- package/src/Sandbox.js +16 -19
- package/src/Sandbox.js.map +1 -1
- package/src/errors/DaytonaError.d.ts +146 -7
- package/src/errors/DaytonaError.js +222 -15
- package/src/errors/DaytonaError.js.map +1 -1
- package/src/index.d.ts +4 -4
- package/src/index.js +6 -2
- package/src/index.js.map +1 -1
- package/src/types/Charts.d.ts +18 -132
- package/src/types/Charts.js +9 -18
- package/src/types/Charts.js.map +1 -1
- package/src/types/ExecuteResponse.d.ts +1 -1
- package/src/utils/FileTransfer.d.ts +1 -1
- package/src/utils/FileTransfer.js +54 -12
- package/src/utils/FileTransfer.js.map +1 -1
- package/src/utils/Multipart.d.ts +3 -1
- package/src/utils/Multipart.js +4 -2
- package/src/utils/Multipart.js.map +1 -1
- package/src/code-toolbox/SandboxJsCodeToolbox.d.ts +0 -5
- package/src/code-toolbox/SandboxJsCodeToolbox.js +0 -20
- package/src/code-toolbox/SandboxJsCodeToolbox.js.map +0 -1
- package/src/code-toolbox/SandboxPythonCodeToolbox.d.ts +0 -11
- package/src/code-toolbox/SandboxPythonCodeToolbox.js +0 -359
- package/src/code-toolbox/SandboxPythonCodeToolbox.js.map +0 -1
- package/src/code-toolbox/SandboxTsCodeToolbox.d.ts +0 -5
- package/src/code-toolbox/SandboxTsCodeToolbox.js +0 -29
- package/src/code-toolbox/SandboxTsCodeToolbox.js.map +0 -1
- package/src/utils/ArtifactParser.d.ts +0 -13
- package/src/utils/ArtifactParser.js +0 -55
- package/src/utils/ArtifactParser.js.map +0 -1
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2025 Daytona Platforms Inc.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.SandboxTsCodeToolbox = void 0;
|
|
8
|
-
const buffer_1 = require("buffer");
|
|
9
|
-
class SandboxTsCodeToolbox {
|
|
10
|
-
getRunCommand(code, params) {
|
|
11
|
-
// Prepend argv fix: ts-node places the script path at argv[1]; splice it out to match legacy node -e behaviour
|
|
12
|
-
const base64Code = buffer_1.Buffer.from('process.argv.splice(1, 1);\n' + code).toString('base64');
|
|
13
|
-
const argv = params?.argv ? params.argv.join(' ') : '';
|
|
14
|
-
// Pipe the base64-encoded code via stdin to avoid OS ARG_MAX limits on large payloads
|
|
15
|
-
// ts-node does not support - for stdin; use shell PID ($$) for the temp file — each code_run spawns its own
|
|
16
|
-
// shell process so $$ is unique across concurrent calls; cleaned up before exit
|
|
17
|
-
// npm_config_loglevel=error suppresses npm notice/warn output at source, preserving streaming and real errors
|
|
18
|
-
return [
|
|
19
|
-
`_f=/tmp/dtn_$$.ts`,
|
|
20
|
-
`printf '%s' '${base64Code}' | base64 -d > "$_f"`,
|
|
21
|
-
`npm_config_loglevel=error npx ts-node -T --ignore-diagnostics 5107 -O '{"module":"CommonJS"}' "$_f" ${argv}`,
|
|
22
|
-
`_dtn_ec=$?`,
|
|
23
|
-
`rm -f "$_f"`,
|
|
24
|
-
`exit $_dtn_ec`,
|
|
25
|
-
].join('; ');
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
exports.SandboxTsCodeToolbox = SandboxTsCodeToolbox;
|
|
29
|
-
//# sourceMappingURL=SandboxTsCodeToolbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SandboxTsCodeToolbox.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/code-toolbox/SandboxTsCodeToolbox.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,mCAA+B;AAE/B,MAAa,oBAAoB;IACxB,aAAa,CAAC,IAAY,EAAE,MAAsB;QACvD,+GAA+G;QAC/G,MAAM,UAAU,GAAG,eAAM,CAAC,IAAI,CAAC,8BAA8B,GAAG,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QACxF,MAAM,IAAI,GAAG,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;QAEtD,sFAAsF;QACtF,4GAA4G;QAC5G,gFAAgF;QAChF,8GAA8G;QAC9G,OAAO;YACL,mBAAmB;YACnB,gBAAgB,UAAU,uBAAuB;YACjD,uGAAuG,IAAI,EAAE;YAC7G,YAAY;YACZ,aAAa;YACb,eAAe;SAChB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,CAAC;CACF;AAnBD,oDAmBC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ExecutionArtifacts } from '../types/ExecuteResponse';
|
|
2
|
-
/**
|
|
3
|
-
* Utility class for parsing artifacts from command output
|
|
4
|
-
*/
|
|
5
|
-
export declare class ArtifactParser {
|
|
6
|
-
/**
|
|
7
|
-
* Parses artifacts from command output text
|
|
8
|
-
*
|
|
9
|
-
* @param output - Raw output from command execution
|
|
10
|
-
* @returns Parsed artifacts including stdout and charts
|
|
11
|
-
*/
|
|
12
|
-
static parseArtifacts(output: string): ExecutionArtifacts;
|
|
13
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright 2025 Daytona Platforms Inc.
|
|
4
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.ArtifactParser = void 0;
|
|
8
|
-
const Charts_1 = require("../types/Charts");
|
|
9
|
-
/**
|
|
10
|
-
* Utility class for parsing artifacts from command output
|
|
11
|
-
*/
|
|
12
|
-
class ArtifactParser {
|
|
13
|
-
/**
|
|
14
|
-
* Parses artifacts from command output text
|
|
15
|
-
*
|
|
16
|
-
* @param output - Raw output from command execution
|
|
17
|
-
* @returns Parsed artifacts including stdout and charts
|
|
18
|
-
*/
|
|
19
|
-
static parseArtifacts(output) {
|
|
20
|
-
const charts = [];
|
|
21
|
-
let stdout = output;
|
|
22
|
-
// Split output by lines to find artifact markers
|
|
23
|
-
const lines = output.split('\n');
|
|
24
|
-
const artifactLines = [];
|
|
25
|
-
for (const line of lines) {
|
|
26
|
-
// Look for the artifact marker pattern
|
|
27
|
-
if (line.startsWith('dtn_artifact_k39fd2:')) {
|
|
28
|
-
artifactLines.push(line);
|
|
29
|
-
try {
|
|
30
|
-
const artifactJson = line.substring('dtn_artifact_k39fd2:'.length).trim();
|
|
31
|
-
const artifactData = JSON.parse(artifactJson);
|
|
32
|
-
if (artifactData.type === 'chart' && artifactData.value) {
|
|
33
|
-
const chartData = artifactData.value;
|
|
34
|
-
charts.push((0, Charts_1.parseChart)(chartData));
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch (error) {
|
|
38
|
-
// Skip invalid artifacts
|
|
39
|
-
console.warn('Failed to parse artifact:', error);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
// Remove artifact lines from stdout along with their following newlines
|
|
44
|
-
for (const line of artifactLines) {
|
|
45
|
-
stdout = stdout.replace(line + '\n', '');
|
|
46
|
-
stdout = stdout.replace(line, '');
|
|
47
|
-
}
|
|
48
|
-
return {
|
|
49
|
-
stdout,
|
|
50
|
-
charts: charts.length > 0 ? charts : undefined,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.ArtifactParser = ArtifactParser;
|
|
55
|
-
//# sourceMappingURL=ArtifactParser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactParser.js","sourceRoot":"","sources":["../../../../../libs/sdk-typescript/src/utils/ArtifactParser.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAEH,4CAAmD;AAGnD;;GAEG;AACH,MAAa,cAAc;IACzB;;;;;OAKG;IACI,MAAM,CAAC,cAAc,CAAC,MAAc;QACzC,MAAM,MAAM,GAAY,EAAE,CAAA;QAC1B,IAAI,MAAM,GAAG,MAAM,CAAA;QAEnB,iDAAiD;QACjD,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;QAChC,MAAM,aAAa,GAAa,EAAE,CAAA;QAElC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,uCAAuC;YACvC,IAAI,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC;gBAC5C,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;gBAExB,IAAI,CAAC;oBACH,MAAM,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;oBACzE,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;oBAE7C,IAAI,YAAY,CAAC,IAAI,KAAK,OAAO,IAAI,YAAY,CAAC,KAAK,EAAE,CAAC;wBACxD,MAAM,SAAS,GAAG,YAAY,CAAC,KAAK,CAAA;wBACpC,MAAM,CAAC,IAAI,CAAC,IAAA,mBAAU,EAAC,SAAS,CAAC,CAAC,CAAA;oBACpC,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,yBAAyB;oBACzB,OAAO,CAAC,IAAI,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAA;gBAClD,CAAC;YACH,CAAC;QACH,CAAC;QAED,wEAAwE;QACxE,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;YACjC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,EAAE,EAAE,CAAC,CAAA;YACxC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;QACnC,CAAC;QAED,OAAO;YACL,MAAM;YACN,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;SAC/C,CAAA;IACH,CAAC;CACF;AA9CD,wCA8CC"}
|