@daytonaio/sdk 0.170.0 → 0.171.0-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.
- package/LICENSE +190 -0
- package/{src → cjs}/CodeInterpreter.d.ts +1 -0
- package/cjs/CodeInterpreter.js.map +1 -0
- package/{src → cjs}/ComputerUse.d.ts +2 -1
- package/{src → cjs}/ComputerUse.js +2 -2
- package/cjs/ComputerUse.js.map +1 -0
- package/{src → cjs}/Daytona.d.ts +3 -1
- package/{src → cjs}/Daytona.js +8 -2
- package/cjs/Daytona.js.map +1 -0
- package/{src → cjs}/FileSystem.d.ts +27 -0
- package/{src → cjs}/FileSystem.js +69 -0
- package/cjs/FileSystem.js.map +1 -0
- package/{src → cjs}/Git.d.ts +1 -0
- package/cjs/Git.js.map +1 -0
- package/{src → cjs}/Image.d.ts +1 -0
- package/cjs/Image.js.map +1 -0
- package/{src → cjs}/LspServer.d.ts +1 -0
- package/cjs/LspServer.js.map +1 -0
- package/{src → cjs}/ObjectStorage.d.ts +1 -0
- package/cjs/ObjectStorage.js.map +1 -0
- package/{src → cjs}/Process.d.ts +1 -0
- package/cjs/Process.js.map +1 -0
- package/{src → cjs}/PtyHandle.d.ts +1 -0
- package/cjs/PtyHandle.js.map +1 -0
- package/cjs/README.md +180 -0
- package/{src → cjs}/Sandbox.d.ts +1 -0
- package/{src → cjs}/Sandbox.js +1 -1
- package/cjs/Sandbox.js.map +1 -0
- package/{src → cjs}/Snapshot.d.ts +1 -0
- package/cjs/Snapshot.js.map +1 -0
- package/{src → cjs}/Volume.d.ts +1 -0
- package/cjs/Volume.js.map +1 -0
- package/{src → cjs}/errors/DaytonaError.d.ts +1 -0
- package/cjs/errors/DaytonaError.js.map +1 -0
- package/{src → cjs}/index.d.ts +1 -0
- package/cjs/index.js.map +1 -0
- package/cjs/package.json +3 -0
- package/{src → cjs}/types/Charts.d.ts +1 -0
- package/cjs/types/Charts.js.map +1 -0
- package/{src → cjs}/types/CodeInterpreter.d.ts +1 -0
- package/cjs/types/CodeInterpreter.js.map +1 -0
- package/{src → cjs}/types/ExecuteResponse.d.ts +1 -0
- package/cjs/types/ExecuteResponse.js.map +1 -0
- package/{src → cjs}/types/Pty.d.ts +1 -0
- package/cjs/types/Pty.js.map +1 -0
- package/{src → cjs}/utils/Binary.d.ts +1 -0
- package/cjs/utils/Binary.js.map +1 -0
- package/{src → cjs}/utils/FileTransfer.d.ts +2 -1
- package/{src → cjs}/utils/FileTransfer.js +5 -2
- package/cjs/utils/FileTransfer.js.map +1 -0
- package/cjs/utils/Import.d.ts +125 -0
- package/cjs/utils/Import.js +112 -0
- package/cjs/utils/Import.js.map +1 -0
- package/{src → cjs}/utils/Multipart.d.ts +1 -0
- package/cjs/utils/Multipart.js.map +1 -0
- package/{src → cjs}/utils/Runtime.d.ts +1 -0
- package/cjs/utils/Runtime.js.map +1 -0
- package/{src → cjs}/utils/Stream.d.ts +1 -0
- package/cjs/utils/Stream.js.map +1 -0
- package/{src → cjs}/utils/WebSocket.d.ts +1 -0
- package/cjs/utils/WebSocket.js.map +1 -0
- package/{src → cjs}/utils/otel.decorator.d.ts +1 -0
- package/cjs/utils/otel.decorator.js.map +1 -0
- package/esm/CodeInterpreter.d.ts +95 -0
- package/esm/CodeInterpreter.js +292 -0
- package/esm/CodeInterpreter.js.map +1 -0
- package/esm/ComputerUse.d.ts +539 -0
- package/esm/ComputerUse.js +799 -0
- package/esm/ComputerUse.js.map +1 -0
- package/esm/Daytona.d.ts +355 -0
- package/esm/Daytona.js +523 -0
- package/esm/Daytona.js.map +1 -0
- package/esm/FileSystem.d.ts +371 -0
- package/esm/FileSystem.js +485 -0
- package/esm/FileSystem.js.map +1 -0
- package/esm/Git.d.ts +203 -0
- package/esm/Git.js +322 -0
- package/esm/Git.js.map +1 -0
- package/esm/Image.d.ts +265 -0
- package/esm/Image.js +581 -0
- package/esm/Image.js.map +1 -0
- package/esm/LspServer.d.ts +172 -0
- package/esm/LspServer.js +255 -0
- package/esm/LspServer.js.map +1 -0
- package/esm/ObjectStorage.d.ts +79 -0
- package/esm/ObjectStorage.js +195 -0
- package/esm/ObjectStorage.js.map +1 -0
- package/esm/Process.d.ts +490 -0
- package/esm/Process.js +642 -0
- package/esm/Process.js.map +1 -0
- package/esm/PtyHandle.d.ts +155 -0
- package/esm/PtyHandle.js +412 -0
- package/esm/PtyHandle.js.map +1 -0
- package/esm/README.md +180 -0
- package/esm/Sandbox.d.ts +476 -0
- package/esm/Sandbox.js +901 -0
- package/esm/Sandbox.js.map +1 -0
- package/esm/Snapshot.d.ts +140 -0
- package/esm/Snapshot.js +244 -0
- package/esm/Snapshot.js.map +1 -0
- package/esm/Volume.d.ts +84 -0
- package/esm/Volume.js +115 -0
- package/esm/Volume.js.map +1 -0
- package/esm/errors/DaytonaError.d.ts +171 -0
- package/esm/errors/DaytonaError.js +243 -0
- package/esm/errors/DaytonaError.js.map +1 -0
- package/esm/index.d.ts +22 -0
- package/esm/index.js +21 -0
- package/esm/index.js.map +1 -0
- package/esm/package.json +3 -0
- package/esm/types/Charts.d.ts +38 -0
- package/esm/types/Charts.js +33 -0
- package/esm/types/Charts.js.map +1 -0
- package/esm/types/CodeInterpreter.d.ts +77 -0
- package/esm/types/CodeInterpreter.js +6 -0
- package/esm/types/CodeInterpreter.js.map +1 -0
- package/esm/types/ExecuteResponse.d.ts +26 -0
- package/esm/types/ExecuteResponse.js +6 -0
- package/esm/types/ExecuteResponse.js.map +1 -0
- package/esm/types/Pty.d.ts +48 -0
- package/esm/types/Pty.js +6 -0
- package/esm/types/Pty.js.map +1 -0
- package/esm/utils/Binary.d.ts +39 -0
- package/esm/utils/Binary.js +157 -0
- package/esm/utils/Binary.js.map +1 -0
- package/esm/utils/FileTransfer.d.ts +15 -0
- package/esm/utils/FileTransfer.js +254 -0
- package/esm/utils/FileTransfer.js.map +1 -0
- package/{src → esm}/utils/Import.d.ts +3 -5
- package/{src → esm}/utils/Import.js +12 -14
- package/esm/utils/Import.js.map +1 -0
- package/esm/utils/Multipart.d.ts +29 -0
- package/esm/utils/Multipart.js +109 -0
- package/esm/utils/Multipart.js.map +1 -0
- package/esm/utils/Runtime.d.ts +44 -0
- package/esm/utils/Runtime.js +89 -0
- package/esm/utils/Runtime.js.map +1 -0
- package/esm/utils/Stream.d.ts +20 -0
- package/esm/utils/Stream.js +360 -0
- package/esm/utils/Stream.js.map +1 -0
- package/esm/utils/WebSocket.d.ts +10 -0
- package/esm/utils/WebSocket.js +22 -0
- package/esm/utils/WebSocket.js.map +1 -0
- package/esm/utils/otel.decorator.d.ts +83 -0
- package/esm/utils/otel.decorator.js +136 -0
- package/esm/utils/otel.decorator.js.map +1 -0
- package/package.json +26 -8
- package/src/CodeInterpreter.js.map +0 -1
- package/src/ComputerUse.js.map +0 -1
- package/src/Daytona.js.map +0 -1
- package/src/FileSystem.js.map +0 -1
- package/src/Git.js.map +0 -1
- package/src/Image.js.map +0 -1
- package/src/LspServer.js.map +0 -1
- package/src/ObjectStorage.js.map +0 -1
- package/src/Process.js.map +0 -1
- package/src/PtyHandle.js.map +0 -1
- package/src/Sandbox.js.map +0 -1
- package/src/Snapshot.js.map +0 -1
- package/src/Volume.js.map +0 -1
- package/src/__tests__/helpers.d.ts +0 -5
- package/src/__tests__/helpers.js +0 -26
- package/src/__tests__/helpers.js.map +0 -1
- package/src/errors/DaytonaError.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/types/Charts.js.map +0 -1
- package/src/types/CodeInterpreter.js.map +0 -1
- package/src/types/ExecuteResponse.js.map +0 -1
- package/src/types/Pty.js.map +0 -1
- package/src/utils/Binary.js.map +0 -1
- package/src/utils/FileTransfer.js.map +0 -1
- package/src/utils/Import.js.map +0 -1
- package/src/utils/Multipart.js.map +0 -1
- package/src/utils/Runtime.js.map +0 -1
- package/src/utils/Stream.js.map +0 -1
- package/src/utils/WebSocket.js.map +0 -1
- package/src/utils/otel.decorator.js.map +0 -1
- /package/{src → cjs}/CodeInterpreter.js +0 -0
- /package/{src → cjs}/Git.js +0 -0
- /package/{src → cjs}/Image.js +0 -0
- /package/{src → cjs}/LspServer.js +0 -0
- /package/{src → cjs}/ObjectStorage.js +0 -0
- /package/{src → cjs}/Process.js +0 -0
- /package/{src → cjs}/PtyHandle.js +0 -0
- /package/{src → cjs}/Snapshot.js +0 -0
- /package/{src → cjs}/Volume.js +0 -0
- /package/{src → cjs}/errors/DaytonaError.js +0 -0
- /package/{src → cjs}/index.js +0 -0
- /package/{src → cjs}/types/Charts.js +0 -0
- /package/{src → cjs}/types/CodeInterpreter.js +0 -0
- /package/{src → cjs}/types/ExecuteResponse.js +0 -0
- /package/{src → cjs}/types/Pty.js +0 -0
- /package/{src → cjs}/utils/Binary.js +0 -0
- /package/{src → cjs}/utils/Multipart.js +0 -0
- /package/{src → cjs}/utils/Runtime.js +0 -0
- /package/{src → cjs}/utils/Stream.js +0 -0
- /package/{src → cjs}/utils/WebSocket.js +0 -0
- /package/{src → cjs}/utils/otel.decorator.js +0 -0
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for creating a PTY session
|
|
3
|
+
*/
|
|
4
|
+
export interface PtyCreateOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The unique identifier for the PTY session
|
|
7
|
+
*/
|
|
8
|
+
id: string;
|
|
9
|
+
/**
|
|
10
|
+
* Starting directory for the PTY session, defaults to the sandbox's working directory
|
|
11
|
+
*/
|
|
12
|
+
cwd?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Environment variables for the PTY session
|
|
15
|
+
*/
|
|
16
|
+
envs?: Record<string, string>;
|
|
17
|
+
/**
|
|
18
|
+
* Number of terminal columns
|
|
19
|
+
*/
|
|
20
|
+
cols?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Number of terminal rows
|
|
23
|
+
*/
|
|
24
|
+
rows?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Options for connecting to a PTY session
|
|
28
|
+
*/
|
|
29
|
+
export interface PtyConnectOptions {
|
|
30
|
+
/**
|
|
31
|
+
* Callback to handle PTY output data
|
|
32
|
+
*/
|
|
33
|
+
onData: (data: Uint8Array) => void | Promise<void>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* PTY session result on exit
|
|
37
|
+
*/
|
|
38
|
+
export interface PtyResult {
|
|
39
|
+
/**
|
|
40
|
+
* Exit code when the PTY process ends
|
|
41
|
+
*/
|
|
42
|
+
exitCode?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Error message if the PTY failed
|
|
45
|
+
*/
|
|
46
|
+
error?: string;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=Pty.d.ts.map
|
package/esm/types/Pty.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pty.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/types/Pty.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Buffer } from 'buffer';
|
|
2
|
+
/**
|
|
3
|
+
* Converts various data types to Uint8Array
|
|
4
|
+
*/
|
|
5
|
+
export declare function toUint8Array(data: string | ArrayBuffer | ArrayBufferView): Uint8Array;
|
|
6
|
+
/**
|
|
7
|
+
* Concatenates multiple Uint8Array chunks into a single Uint8Array
|
|
8
|
+
*/
|
|
9
|
+
export declare function concatUint8Arrays(parts: Uint8Array[]): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
|
|
12
|
+
*/
|
|
13
|
+
export declare function toBuffer(data: Uint8Array): Buffer;
|
|
14
|
+
/**
|
|
15
|
+
* Decodes Uint8Array to UTF-8 string
|
|
16
|
+
*/
|
|
17
|
+
export declare function utf8Decode(data: Uint8Array): string;
|
|
18
|
+
/**
|
|
19
|
+
* Finds all occurrences of a pattern in a byte buffer
|
|
20
|
+
*/
|
|
21
|
+
export declare function findAllBytes(buffer: Uint8Array, pattern: Uint8Array): number[];
|
|
22
|
+
/**
|
|
23
|
+
* Finds the first occurrence of a pattern in a byte buffer within a range
|
|
24
|
+
*/
|
|
25
|
+
export declare function findBytesInRange(buffer: Uint8Array, start: number, end: number, pattern: Uint8Array): number;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a sequence starts at a given position in a byte buffer
|
|
28
|
+
* Returns the position after the sequence if found, -1 otherwise
|
|
29
|
+
*/
|
|
30
|
+
export declare function indexAfterSequence(buffer: Uint8Array, start: number, sequence: Uint8Array): number;
|
|
31
|
+
/**
|
|
32
|
+
* Collects all bytes from various stream types into a single Uint8Array
|
|
33
|
+
*/
|
|
34
|
+
export declare function collectStreamBytes(stream: any): Promise<Uint8Array>;
|
|
35
|
+
/**
|
|
36
|
+
* Checks if value is a File object (browser environment)
|
|
37
|
+
*/
|
|
38
|
+
export declare function isFile(value: any): boolean;
|
|
39
|
+
//# sourceMappingURL=Binary.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Buffer } from 'buffer';
|
|
6
|
+
import { DaytonaError } from '../errors/DaytonaError.js';
|
|
7
|
+
/**
|
|
8
|
+
* Converts various data types to Uint8Array
|
|
9
|
+
*/
|
|
10
|
+
export function toUint8Array(data) {
|
|
11
|
+
if (typeof data === 'string') {
|
|
12
|
+
return new TextEncoder().encode(data);
|
|
13
|
+
}
|
|
14
|
+
if (data instanceof ArrayBuffer) {
|
|
15
|
+
return new Uint8Array(data);
|
|
16
|
+
}
|
|
17
|
+
if (ArrayBuffer.isView(data)) {
|
|
18
|
+
return new Uint8Array(data.buffer, data.byteOffset, data.byteLength);
|
|
19
|
+
}
|
|
20
|
+
throw new DaytonaError('Unsupported data type for byte conversion.');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Concatenates multiple Uint8Array chunks into a single Uint8Array
|
|
24
|
+
*/
|
|
25
|
+
export function concatUint8Arrays(parts) {
|
|
26
|
+
const size = parts.reduce((sum, part) => sum + part.byteLength, 0);
|
|
27
|
+
const result = new Uint8Array(size);
|
|
28
|
+
let offset = 0;
|
|
29
|
+
for (const part of parts) {
|
|
30
|
+
result.set(part, offset);
|
|
31
|
+
offset += part.byteLength;
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Converts Uint8Array to Buffer (uses polyfill in non-Node environments)
|
|
37
|
+
*/
|
|
38
|
+
export function toBuffer(data) {
|
|
39
|
+
return Buffer.from(data);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Decodes Uint8Array to UTF-8 string
|
|
43
|
+
*/
|
|
44
|
+
export function utf8Decode(data) {
|
|
45
|
+
return new TextDecoder('utf-8').decode(data);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Finds all occurrences of a pattern in a byte buffer
|
|
49
|
+
*/
|
|
50
|
+
export function findAllBytes(buffer, pattern) {
|
|
51
|
+
const results = [];
|
|
52
|
+
let i = 0;
|
|
53
|
+
while (i <= buffer.length - pattern.length) {
|
|
54
|
+
let match = true;
|
|
55
|
+
for (let j = 0; j < pattern.length; j++) {
|
|
56
|
+
if (buffer[i + j] !== pattern[j]) {
|
|
57
|
+
match = false;
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (match) {
|
|
62
|
+
results.push(i);
|
|
63
|
+
i += pattern.length;
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
i++;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Finds the first occurrence of a pattern in a byte buffer within a range
|
|
73
|
+
*/
|
|
74
|
+
export function findBytesInRange(buffer, start, end, pattern) {
|
|
75
|
+
let i = start;
|
|
76
|
+
while (i <= end - pattern.length) {
|
|
77
|
+
let match = true;
|
|
78
|
+
for (let j = 0; j < pattern.length; j++) {
|
|
79
|
+
if (buffer[i + j] !== pattern[j]) {
|
|
80
|
+
match = false;
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (match)
|
|
85
|
+
return i;
|
|
86
|
+
i++;
|
|
87
|
+
}
|
|
88
|
+
return -1;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Checks if a sequence starts at a given position in a byte buffer
|
|
92
|
+
* Returns the position after the sequence if found, -1 otherwise
|
|
93
|
+
*/
|
|
94
|
+
export function indexAfterSequence(buffer, start, sequence) {
|
|
95
|
+
for (let j = 0; j < sequence.length; j++) {
|
|
96
|
+
if (buffer[start + j] !== sequence[j])
|
|
97
|
+
return -1;
|
|
98
|
+
}
|
|
99
|
+
return start + sequence.length;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Collects all bytes from various stream types into a single Uint8Array
|
|
103
|
+
*/
|
|
104
|
+
export async function collectStreamBytes(stream) {
|
|
105
|
+
if (!stream)
|
|
106
|
+
return new Uint8Array(0);
|
|
107
|
+
// ReadableStream (WHATWG)
|
|
108
|
+
if (typeof stream.getReader === 'function') {
|
|
109
|
+
const reader = stream.getReader();
|
|
110
|
+
const chunks = [];
|
|
111
|
+
try {
|
|
112
|
+
while (true) {
|
|
113
|
+
const { done, value } = await reader.read();
|
|
114
|
+
if (done)
|
|
115
|
+
break;
|
|
116
|
+
if (value?.byteLength) {
|
|
117
|
+
chunks.push(value);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
finally {
|
|
122
|
+
await reader.cancel();
|
|
123
|
+
}
|
|
124
|
+
return concatUint8Arrays(chunks);
|
|
125
|
+
}
|
|
126
|
+
// AsyncIterable
|
|
127
|
+
if (stream?.[Symbol.asyncIterator]) {
|
|
128
|
+
const chunks = [];
|
|
129
|
+
for await (const chunk of stream) {
|
|
130
|
+
chunks.push(toUint8Array(chunk));
|
|
131
|
+
}
|
|
132
|
+
return concatUint8Arrays(chunks);
|
|
133
|
+
}
|
|
134
|
+
// Direct data types
|
|
135
|
+
if (typeof stream === 'string' || stream instanceof ArrayBuffer || ArrayBuffer.isView(stream)) {
|
|
136
|
+
return toUint8Array(stream);
|
|
137
|
+
}
|
|
138
|
+
// Blob
|
|
139
|
+
if (typeof Blob !== 'undefined' && stream instanceof Blob) {
|
|
140
|
+
const arrayBuffer = await stream.arrayBuffer();
|
|
141
|
+
return new Uint8Array(arrayBuffer);
|
|
142
|
+
}
|
|
143
|
+
// Response
|
|
144
|
+
if (typeof Response !== 'undefined' && stream instanceof Response) {
|
|
145
|
+
const arrayBuffer = await stream.arrayBuffer();
|
|
146
|
+
return new Uint8Array(arrayBuffer);
|
|
147
|
+
}
|
|
148
|
+
throw new DaytonaError('Unsupported stream type for byte collection.');
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Checks if value is a File object (browser environment)
|
|
152
|
+
*/
|
|
153
|
+
export function isFile(value) {
|
|
154
|
+
const FileConstructor = globalThis.File;
|
|
155
|
+
return typeof FileConstructor !== 'undefined' && value instanceof FileConstructor;
|
|
156
|
+
}
|
|
157
|
+
//# sourceMappingURL=Binary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Binary.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Binary.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAErD;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAA4C;IACvE,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IACvC,CAAC;IACD,IAAI,IAAI,YAAY,WAAW,EAAE,CAA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;QAClC,CAAC;QACD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAA;IAClC,CAAC;IAED,oBAAoB;IACpB,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,YAAY,WAAW,IAAI,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QAC9F,OAAO,YAAY,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED,OAAO;IACP,IAAI,OAAO,IAAI,KAAK,WAAW,IAAI,MAAM,YAAY,IAAI,EAAE,CAAC;QAC1D,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAA;QAC9C,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC;IAED,WAAW;IACX,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,MAAM,YAAY,QAAQ,EAAE,CAAC;QAClE,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,WAAW,EAAE,CAAA;QAC9C,OAAO,IAAI,UAAU,CAAC,WAAW,CAAC,CAAA;IACpC,CAAC;IAED,MAAM,IAAI,YAAY,CAAC,8CAA8C,CAAC,CAAA;AACxE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM,CAAC,KAAU;IAC/B,MAAM,eAAe,GAAI,UAAkB,CAAC,IAAI,CAAA;IAChD,OAAO,OAAO,eAAe,KAAK,WAAW,IAAI,KAAK,YAAY,eAAe,CAAA;AACnF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DownloadMetadata } from '../FileSystem.js';
|
|
2
|
+
/**
|
|
3
|
+
* Safely aborts a stream
|
|
4
|
+
*/
|
|
5
|
+
export declare function abortStream(stream: any): void;
|
|
6
|
+
/**
|
|
7
|
+
* Normalizes response data to extract the actual stream
|
|
8
|
+
*/
|
|
9
|
+
export declare function normalizeResponseStream(responseData: any): any;
|
|
10
|
+
/**
|
|
11
|
+
* Processes multipart response using busboy (Node.js path)
|
|
12
|
+
*/
|
|
13
|
+
export declare function processDownloadFilesResponseWithBusboy(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>, onFileStream?: (source: string, fileStream: any) => void): Promise<void>;
|
|
14
|
+
export declare function processDownloadFilesResponseWithBuffered(stream: any, headers: Record<string, string>, metadataMap: Map<string, DownloadMetadata>): Promise<void>;
|
|
15
|
+
//# sourceMappingURL=FileTransfer.d.ts.map
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2025 Daytona Platforms Inc.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
import { Buffer } from 'buffer';
|
|
6
|
+
import busboy from 'busboy';
|
|
7
|
+
import { DaytonaError } from '../errors/DaytonaError.js';
|
|
8
|
+
import { dynamicImport } from './Import.js';
|
|
9
|
+
import { collectStreamBytes, toBuffer, toUint8Array } from './Binary.js';
|
|
10
|
+
import { extractBoundary, getHeader, parseMultipartWithFormData } from './Multipart.js';
|
|
11
|
+
import { parseMultipart } from './Multipart.js';
|
|
12
|
+
/**
|
|
13
|
+
* Parses a bulk-download error part into the legacy message and structured metadata.
|
|
14
|
+
*/
|
|
15
|
+
function parseDownloadErrorPart(data, contentType) {
|
|
16
|
+
let message = new TextDecoder('utf-8').decode(data).trim();
|
|
17
|
+
if (!contentType || !/application\/json/i.test(contentType)) {
|
|
18
|
+
return { message };
|
|
19
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const payload = JSON.parse(message);
|
|
22
|
+
if (!payload || typeof payload !== 'object' || Array.isArray(payload)) {
|
|
23
|
+
return { message };
|
|
24
|
+
}
|
|
25
|
+
const payloadObject = payload;
|
|
26
|
+
const structuredMessage = payloadObject.message;
|
|
27
|
+
const statusCode = payloadObject.statusCode ?? payloadObject.status_code;
|
|
28
|
+
const errorCode = payloadObject.code ?? payloadObject.error_code;
|
|
29
|
+
if (typeof structuredMessage === 'string') {
|
|
30
|
+
message = structuredMessage;
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
message,
|
|
34
|
+
errorDetails: {
|
|
35
|
+
message,
|
|
36
|
+
statusCode: typeof statusCode === 'number' ? statusCode : undefined,
|
|
37
|
+
errorCode: typeof errorCode === 'string' ? errorCode : undefined,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return { message };
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Records a per-file error part on the corresponding download metadata entry.
|
|
47
|
+
*/
|
|
48
|
+
function assignDownloadErrorPart(metadata, data, contentType) {
|
|
49
|
+
const { message, errorDetails } = parseDownloadErrorPart(data, contentType);
|
|
50
|
+
metadata.error = message;
|
|
51
|
+
metadata.errorDetails = errorDetails;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Safely aborts a stream
|
|
55
|
+
*/
|
|
56
|
+
export function abortStream(stream) {
|
|
57
|
+
if (stream && typeof stream.destroy === 'function') {
|
|
58
|
+
stream.destroy();
|
|
59
|
+
}
|
|
60
|
+
else if (stream && typeof stream.cancel === 'function') {
|
|
61
|
+
stream.cancel();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Normalizes response data to extract the actual stream
|
|
66
|
+
*/
|
|
67
|
+
export function normalizeResponseStream(responseData) {
|
|
68
|
+
if (!responseData || typeof responseData !== 'object') {
|
|
69
|
+
return responseData;
|
|
70
|
+
}
|
|
71
|
+
// WHATWG ReadableStream
|
|
72
|
+
if (responseData.body && typeof responseData.body.getReader === 'function') {
|
|
73
|
+
return responseData.body;
|
|
74
|
+
}
|
|
75
|
+
// Some adapters use .stream
|
|
76
|
+
if (responseData.stream) {
|
|
77
|
+
return responseData.stream;
|
|
78
|
+
}
|
|
79
|
+
return responseData;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Processes multipart response using busboy (Node.js path)
|
|
83
|
+
*/
|
|
84
|
+
export async function processDownloadFilesResponseWithBusboy(stream, headers, metadataMap, onFileStream) {
|
|
85
|
+
const fileTasks = [];
|
|
86
|
+
await new Promise((resolve, reject) => {
|
|
87
|
+
const bb = busboy({
|
|
88
|
+
headers,
|
|
89
|
+
preservePath: true,
|
|
90
|
+
});
|
|
91
|
+
bb.on('file', (fieldName, fileStream, fileInfo) => {
|
|
92
|
+
const source = fileInfo?.filename;
|
|
93
|
+
if (!source) {
|
|
94
|
+
abortStream(stream);
|
|
95
|
+
reject(new DaytonaError(`Received unexpected file "${fileInfo?.filename}".`));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
const metadata = metadataMap.get(source);
|
|
99
|
+
if (!metadata) {
|
|
100
|
+
abortStream(stream);
|
|
101
|
+
reject(new DaytonaError(`Target metadata missing for valid source: ${source}`));
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (fieldName === 'error') {
|
|
105
|
+
// Collect per-file error metadata.
|
|
106
|
+
const chunks = [];
|
|
107
|
+
fileStream.on('data', (chunk) => chunks.push(chunk));
|
|
108
|
+
fileStream.on('end', () => {
|
|
109
|
+
assignDownloadErrorPart(metadata, Buffer.concat(chunks), fileInfo?.mimeType);
|
|
110
|
+
});
|
|
111
|
+
fileStream.on('error', (err) => {
|
|
112
|
+
metadata.error = `Stream error: ${err.message}`;
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
else if (fieldName === 'file') {
|
|
116
|
+
if (onFileStream) {
|
|
117
|
+
onFileStream(source, fileStream);
|
|
118
|
+
}
|
|
119
|
+
else if (metadata.destination) {
|
|
120
|
+
// Stream to file
|
|
121
|
+
fileTasks.push(new Promise((resolveTask) => {
|
|
122
|
+
dynamicImport('fs', 'Downloading files to local files is not supported: ').then((fs) => {
|
|
123
|
+
const writeStream = fs.createWriteStream(metadata.destination, { autoClose: true });
|
|
124
|
+
fileStream.pipe(writeStream);
|
|
125
|
+
writeStream.on('finish', () => {
|
|
126
|
+
metadata.result = metadata.destination;
|
|
127
|
+
resolveTask();
|
|
128
|
+
});
|
|
129
|
+
writeStream.on('error', (err) => {
|
|
130
|
+
metadata.error = `Write stream failed: ${err.message}`;
|
|
131
|
+
resolveTask();
|
|
132
|
+
});
|
|
133
|
+
fileStream.on('error', (err) => {
|
|
134
|
+
metadata.error = `Read stream failed: ${err.message}`;
|
|
135
|
+
});
|
|
136
|
+
});
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
// Collect to buffer
|
|
141
|
+
const chunks = [];
|
|
142
|
+
fileStream.on('data', (chunk) => {
|
|
143
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
144
|
+
});
|
|
145
|
+
fileStream.on('end', () => {
|
|
146
|
+
metadata.result = Buffer.concat(chunks);
|
|
147
|
+
});
|
|
148
|
+
fileStream.on('error', (err) => {
|
|
149
|
+
metadata.error = `Read failed: ${err.message}`;
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// Unknown field, drain it
|
|
155
|
+
fileStream.resume();
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
bb.on('error', (err) => {
|
|
159
|
+
abortStream(stream);
|
|
160
|
+
reject(err);
|
|
161
|
+
});
|
|
162
|
+
bb.on('finish', resolve);
|
|
163
|
+
// Feed stream into busboy
|
|
164
|
+
feedStreamToBusboy(stream, bb).catch((err) => bb.destroy(err));
|
|
165
|
+
});
|
|
166
|
+
await Promise.all(fileTasks);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Feeds various stream types into busboy
|
|
170
|
+
*/
|
|
171
|
+
async function feedStreamToBusboy(stream, bb) {
|
|
172
|
+
// Node.js stream (piping)
|
|
173
|
+
if (typeof stream?.pipe === 'function') {
|
|
174
|
+
stream.pipe(bb);
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
// Direct buffer-like data
|
|
178
|
+
if (typeof stream === 'string' || stream instanceof ArrayBuffer || ArrayBuffer.isView(stream)) {
|
|
179
|
+
const data = toUint8Array(stream);
|
|
180
|
+
bb.write(Buffer.from(data));
|
|
181
|
+
bb.end();
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
// WHATWG ReadableStream
|
|
185
|
+
if (typeof stream?.getReader === 'function') {
|
|
186
|
+
const reader = stream.getReader();
|
|
187
|
+
while (true) {
|
|
188
|
+
const { done, value } = await reader.read();
|
|
189
|
+
if (done)
|
|
190
|
+
break;
|
|
191
|
+
bb.write(Buffer.from(value));
|
|
192
|
+
}
|
|
193
|
+
bb.end();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
// AsyncIterable
|
|
197
|
+
if (stream?.[Symbol.asyncIterator]) {
|
|
198
|
+
for await (const chunk of stream) {
|
|
199
|
+
const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(toUint8Array(chunk));
|
|
200
|
+
bb.write(buffer);
|
|
201
|
+
}
|
|
202
|
+
bb.end();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
// Unsupported stream type
|
|
206
|
+
throw new DaytonaError(`Unsupported stream type: ${stream?.constructor?.name || typeof stream}`);
|
|
207
|
+
}
|
|
208
|
+
export async function processDownloadFilesResponseWithBuffered(stream, headers, metadataMap) {
|
|
209
|
+
const contentType = getHeader(headers, 'content-type') || '';
|
|
210
|
+
const bodyBytes = await collectStreamBytes(stream);
|
|
211
|
+
// Try native FormData parsing for multipart/form-data
|
|
212
|
+
if (/^multipart\/form-data/i.test(contentType) && typeof Response !== 'undefined') {
|
|
213
|
+
try {
|
|
214
|
+
const formDataParts = await parseMultipartWithFormData(bodyBytes, contentType);
|
|
215
|
+
for (const part of formDataParts) {
|
|
216
|
+
const metadata = metadataMap.get(part.filename);
|
|
217
|
+
if (!metadata) {
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
if (part.fieldName === 'error') {
|
|
221
|
+
assignDownloadErrorPart(metadata, part.data, part.contentType);
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
metadata.result = toBuffer(part.data);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
catch {
|
|
230
|
+
// Fall through to manual parsing
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// Manual multipart parsing (handles multipart/mixed, etc.)
|
|
234
|
+
const boundary = extractBoundary(contentType);
|
|
235
|
+
if (!boundary) {
|
|
236
|
+
throw new DaytonaError(`Missing multipart boundary in Content-Type: "${contentType}"`);
|
|
237
|
+
}
|
|
238
|
+
const parts = parseMultipart(bodyBytes, boundary);
|
|
239
|
+
for (const part of parts) {
|
|
240
|
+
if (!part.filename)
|
|
241
|
+
continue;
|
|
242
|
+
const metadata = metadataMap.get(part.filename);
|
|
243
|
+
if (!metadata)
|
|
244
|
+
continue;
|
|
245
|
+
if (part.name === 'error') {
|
|
246
|
+
assignDownloadErrorPart(metadata, part.data, part.headers['content-type']);
|
|
247
|
+
}
|
|
248
|
+
else if (part.name === 'file') {
|
|
249
|
+
metadata.result = toBuffer(part.data);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
return;
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=FileTransfer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FileTransfer.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/FileTransfer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAC/B,OAAO,MAAM,MAAM,QAAQ,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACrE,OAAO,EAAE,eAAe,EAAE,SAAS,EAA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eAAe,CAAC,WAAW,CAAC,CAAA;IAC7C,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,YAAY,CAAC,gDAAgD,WAAW,GAAG,CAAC,CAAA;IACxF,CAAC;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IACjD,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,IAAI,CAAC,QAAQ;YAAE,SAAQ;QAC5B,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;QAC/C,IAAI,CAAC,QAAQ;YAAE,SAAQ;QAEvB,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;YAC1B,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAA;QAC5E,CAAC;aAAM,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAChC,QAAQ,CAAC,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;IAED,OAAM;AACR,CAAC"}
|
|
@@ -48,12 +48,9 @@ declare const loaderMap: {
|
|
|
48
48
|
EventEmitter: typeof import("events");
|
|
49
49
|
EventEmitterAsyncResource: typeof import("events").EventEmitterAsyncResource;
|
|
50
50
|
}>;
|
|
51
|
-
tar: () => Promise<typeof import("tar"
|
|
51
|
+
tar: () => Promise<typeof import("tar")>;
|
|
52
52
|
'expand-tilde': () => Promise<any>;
|
|
53
|
-
ObjectStorage: () => Promise<
|
|
54
|
-
default: typeof import("../ObjectStorage");
|
|
55
|
-
ObjectStorage: typeof import("../ObjectStorage").ObjectStorage;
|
|
56
|
-
}>;
|
|
53
|
+
ObjectStorage: () => Promise<typeof import("../ObjectStorage.js")>;
|
|
57
54
|
fs: () => Promise<typeof import("fs")>;
|
|
58
55
|
'form-data': () => Promise<{
|
|
59
56
|
default: typeof import("form-data");
|
|
@@ -95,3 +92,4 @@ export declare function dynamicImport<K extends keyof ModuleMap>(name: K, errorP
|
|
|
95
92
|
type RequireMap = typeof requireMap;
|
|
96
93
|
export declare function dynamicRequire<K extends keyof RequireMap>(name: K, errorPrefix?: string): ReturnType<RequireMap[K]>;
|
|
97
94
|
export {};
|
|
95
|
+
//# sourceMappingURL=Import.d.ts.map
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequire as _cr } from 'module';
|
|
2
|
+
const require = _cr(import.meta.url);
|
|
2
3
|
/*
|
|
3
4
|
* Copyright 2025 Daytona Platforms Inc.
|
|
4
5
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
exports.dynamicRequire = dynamicRequire;
|
|
9
|
-
const DaytonaError_1 = require("../errors/DaytonaError");
|
|
10
|
-
const Runtime_1 = require("./Runtime");
|
|
7
|
+
import { DaytonaError } from '../errors/DaytonaError.js';
|
|
8
|
+
import { RUNTIME } from './Runtime.js';
|
|
11
9
|
const loaderMap = {
|
|
12
10
|
'fast-glob': () => import('fast-glob'),
|
|
13
11
|
'@iarna/toml': () => import('@iarna/toml'),
|
|
@@ -38,10 +36,10 @@ const validateMap = {
|
|
|
38
36
|
'form-data': (mod) => typeof mod === 'function',
|
|
39
37
|
util: (mod) => typeof mod.promisify === 'function',
|
|
40
38
|
};
|
|
41
|
-
async function dynamicImport(name, errorPrefix) {
|
|
39
|
+
export async function dynamicImport(name, errorPrefix) {
|
|
42
40
|
const loader = loaderMap[name];
|
|
43
41
|
if (!loader) {
|
|
44
|
-
throw new
|
|
42
|
+
throw new DaytonaError(`${errorPrefix || ''} Unknown module "${name}"`);
|
|
45
43
|
}
|
|
46
44
|
let mod;
|
|
47
45
|
try {
|
|
@@ -50,17 +48,17 @@ async function dynamicImport(name, errorPrefix) {
|
|
|
50
48
|
}
|
|
51
49
|
catch (err) {
|
|
52
50
|
const msg = err instanceof Error ? err.message : String(err);
|
|
53
|
-
throw new
|
|
51
|
+
throw new DaytonaError(`${errorPrefix || ''} Module "${name}" is not available in the "${RUNTIME}" runtime: ${msg}`);
|
|
54
52
|
}
|
|
55
53
|
if (validateMap[name] && !validateMap[name](mod)) {
|
|
56
|
-
throw new
|
|
54
|
+
throw new DaytonaError(`${errorPrefix || ''} Module "${name}" didn't pass import validation in the "${RUNTIME}" runtime`);
|
|
57
55
|
}
|
|
58
56
|
return mod;
|
|
59
57
|
}
|
|
60
|
-
function dynamicRequire(name, errorPrefix) {
|
|
58
|
+
export function dynamicRequire(name, errorPrefix) {
|
|
61
59
|
const loader = requireMap[name];
|
|
62
60
|
if (!loader) {
|
|
63
|
-
throw new
|
|
61
|
+
throw new DaytonaError(`${errorPrefix || ''} Unknown module "${name}"`);
|
|
64
62
|
}
|
|
65
63
|
let mod;
|
|
66
64
|
try {
|
|
@@ -69,10 +67,10 @@ function dynamicRequire(name, errorPrefix) {
|
|
|
69
67
|
}
|
|
70
68
|
catch (err) {
|
|
71
69
|
const msg = err instanceof Error ? err.message : String(err);
|
|
72
|
-
throw new
|
|
70
|
+
throw new DaytonaError(`${errorPrefix || ''} Module "${name}" is not available in the "${RUNTIME}" runtime: ${msg}`);
|
|
73
71
|
}
|
|
74
72
|
if (validateMap[name] && !validateMap[name](mod)) {
|
|
75
|
-
throw new
|
|
73
|
+
throw new DaytonaError(`${errorPrefix || ''} Module "${name}" didn't pass import validation in the "${RUNTIME}" runtime`);
|
|
76
74
|
}
|
|
77
75
|
return mod;
|
|
78
76
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Import.js","sourceRoot":"","sources":["../../../../../../libs/sdk-typescript/src/utils/Import.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,EAAE,OAAO,EA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