@paperclipai/plugin-daytona 0.1.0 → 2026.510.0-canary.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/LICENSE +21 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.d.ts +4 -0
- package/dist/manifest.d.ts.map +1 -0
- package/dist/manifest.js +93 -0
- package/dist/manifest.js.map +1 -0
- package/dist/plugin.d.ts +3 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +496 -0
- package/dist/plugin.js.map +1 -0
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +5 -0
- package/dist/worker.js.map +1 -0
- package/package.json +4 -12
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Paperclip AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AAKzE,QAAA,MAAM,QAAQ,EAAE,yBAgGf,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/manifest.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const PLUGIN_ID = "paperclip.daytona-sandbox-provider";
|
|
2
|
+
const PLUGIN_VERSION = "0.1.0";
|
|
3
|
+
const manifest = {
|
|
4
|
+
id: PLUGIN_ID,
|
|
5
|
+
apiVersion: 1,
|
|
6
|
+
version: PLUGIN_VERSION,
|
|
7
|
+
displayName: "Daytona Sandbox Provider",
|
|
8
|
+
description: "First-party sandbox provider plugin that provisions Daytona sandboxes as Paperclip execution environments.",
|
|
9
|
+
author: "Paperclip",
|
|
10
|
+
categories: ["automation"],
|
|
11
|
+
capabilities: ["environment.drivers.register"],
|
|
12
|
+
entrypoints: {
|
|
13
|
+
worker: "./dist/worker.js",
|
|
14
|
+
},
|
|
15
|
+
environmentDrivers: [
|
|
16
|
+
{
|
|
17
|
+
driverKey: "daytona",
|
|
18
|
+
kind: "sandbox_provider",
|
|
19
|
+
displayName: "Daytona Sandbox",
|
|
20
|
+
description: "Provisions Daytona sandboxes with configurable image or snapshot selection, startup timeouts, and lease reuse.",
|
|
21
|
+
configSchema: {
|
|
22
|
+
type: "object",
|
|
23
|
+
properties: {
|
|
24
|
+
apiKey: {
|
|
25
|
+
type: "string",
|
|
26
|
+
format: "secret-ref",
|
|
27
|
+
description: "Environment-specific Daytona API key. Paste a key or an existing Paperclip secret reference; saved environments store pasted values as company secrets. Falls back to DAYTONA_API_KEY if omitted.",
|
|
28
|
+
},
|
|
29
|
+
apiUrl: {
|
|
30
|
+
type: "string",
|
|
31
|
+
description: "Optional Daytona API base URL. If omitted, the Daytona SDK uses its configured default endpoint.",
|
|
32
|
+
},
|
|
33
|
+
target: {
|
|
34
|
+
type: "string",
|
|
35
|
+
description: "Optional Daytona target/region identifier.",
|
|
36
|
+
},
|
|
37
|
+
snapshot: {
|
|
38
|
+
type: "string",
|
|
39
|
+
description: "Optional Daytona snapshot name to start from.",
|
|
40
|
+
},
|
|
41
|
+
image: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Optional base image or Daytona Image reference. If set, the sandbox is created from this image instead of a snapshot.",
|
|
44
|
+
},
|
|
45
|
+
language: {
|
|
46
|
+
type: "string",
|
|
47
|
+
description: "Optional Daytona language hint for direct code execution. If omitted, Daytona uses its default runtime.",
|
|
48
|
+
},
|
|
49
|
+
cpu: {
|
|
50
|
+
type: "number",
|
|
51
|
+
description: "Optional CPU allocation in cores.",
|
|
52
|
+
},
|
|
53
|
+
memory: {
|
|
54
|
+
type: "number",
|
|
55
|
+
description: "Optional memory allocation in GiB.",
|
|
56
|
+
},
|
|
57
|
+
disk: {
|
|
58
|
+
type: "number",
|
|
59
|
+
description: "Optional disk allocation in GiB.",
|
|
60
|
+
},
|
|
61
|
+
gpu: {
|
|
62
|
+
type: "number",
|
|
63
|
+
description: "Optional GPU allocation in units.",
|
|
64
|
+
},
|
|
65
|
+
timeoutMs: {
|
|
66
|
+
type: "number",
|
|
67
|
+
description: "Timeout for Daytona create/start/stop/execute operations in milliseconds.",
|
|
68
|
+
default: 300000,
|
|
69
|
+
},
|
|
70
|
+
autoStopInterval: {
|
|
71
|
+
type: "number",
|
|
72
|
+
description: "Optional Daytona auto-stop interval in minutes. `0` disables auto-stop.",
|
|
73
|
+
},
|
|
74
|
+
autoArchiveInterval: {
|
|
75
|
+
type: "number",
|
|
76
|
+
description: "Optional Daytona auto-archive interval in minutes. `0` uses Daytona's max interval.",
|
|
77
|
+
},
|
|
78
|
+
autoDeleteInterval: {
|
|
79
|
+
type: "number",
|
|
80
|
+
description: "Optional Daytona auto-delete interval in minutes. `-1` disables auto-delete and `0` deletes immediately after stop.",
|
|
81
|
+
},
|
|
82
|
+
reuseLease: {
|
|
83
|
+
type: "boolean",
|
|
84
|
+
description: "Whether to stop and later resume the sandbox across runs instead of deleting it on release.",
|
|
85
|
+
default: false,
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
};
|
|
92
|
+
export default manifest;
|
|
93
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,oCAAoC,CAAC;AACvD,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,MAAM,QAAQ,GAA8B;IAC1C,EAAE,EAAE,SAAS;IACb,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,0BAA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2EAA2E;wBACxF,OAAO,EAAE,MAAM;qBAChB;oBACD,gBAAgB,EAAE;wBAChB,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,yEAAyE;qBACvF;oBACD,mBAAmB,EAAE;wBACnB,IAAI,EAAE,QAAQ;wBACd,WAAW,EAAE,qFAAqF;qBACnG;oBACD,kBAAkB,EAAE;wBAClB,IAAI,EAAE,QAAQ;wBACd,WAAW,EACT,qHAAqH;qBACxH;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,6FAA6F;wBAC/F,OAAO,EAAE,KAAK;qBACf;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAkYA,QAAA,MAAM,MAAM,mDAqOV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { randomUUID } from "node:crypto";
|
|
3
|
+
import { Daytona, DaytonaNotFoundError, DaytonaTimeoutError } from "@daytonaio/sdk";
|
|
4
|
+
import { definePlugin } from "@paperclipai/plugin-sdk";
|
|
5
|
+
function parseOptionalString(value) {
|
|
6
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
7
|
+
}
|
|
8
|
+
function parseOptionalInteger(value) {
|
|
9
|
+
if (value == null || value === "")
|
|
10
|
+
return null;
|
|
11
|
+
const parsed = Number(value);
|
|
12
|
+
return Number.isFinite(parsed) ? Math.trunc(parsed) : null;
|
|
13
|
+
}
|
|
14
|
+
function parseOptionalNumber(value) {
|
|
15
|
+
if (value == null || value === "")
|
|
16
|
+
return null;
|
|
17
|
+
const parsed = Number(value);
|
|
18
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
19
|
+
}
|
|
20
|
+
function parseDriverConfig(raw) {
|
|
21
|
+
const timeoutMs = Number(raw.timeoutMs ?? 300_000);
|
|
22
|
+
return {
|
|
23
|
+
apiKey: parseOptionalString(raw.apiKey),
|
|
24
|
+
apiUrl: parseOptionalString(raw.apiUrl),
|
|
25
|
+
target: parseOptionalString(raw.target),
|
|
26
|
+
snapshot: parseOptionalString(raw.snapshot),
|
|
27
|
+
image: parseOptionalString(raw.image),
|
|
28
|
+
language: parseOptionalString(raw.language),
|
|
29
|
+
timeoutMs: Number.isFinite(timeoutMs) ? Math.trunc(timeoutMs) : 300_000,
|
|
30
|
+
cpu: parseOptionalNumber(raw.cpu),
|
|
31
|
+
memory: parseOptionalNumber(raw.memory),
|
|
32
|
+
disk: parseOptionalNumber(raw.disk),
|
|
33
|
+
gpu: parseOptionalNumber(raw.gpu),
|
|
34
|
+
autoStopInterval: parseOptionalInteger(raw.autoStopInterval),
|
|
35
|
+
autoArchiveInterval: parseOptionalInteger(raw.autoArchiveInterval),
|
|
36
|
+
autoDeleteInterval: parseOptionalInteger(raw.autoDeleteInterval),
|
|
37
|
+
reuseLease: raw.reuseLease === true,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function resolveApiKey(config) {
|
|
41
|
+
if (config.apiKey) {
|
|
42
|
+
return config.apiKey;
|
|
43
|
+
}
|
|
44
|
+
const envApiKey = process.env.DAYTONA_API_KEY?.trim() ?? "";
|
|
45
|
+
if (!envApiKey) {
|
|
46
|
+
throw new Error("Daytona sandbox environments require an API key in config or DAYTONA_API_KEY.");
|
|
47
|
+
}
|
|
48
|
+
return envApiKey;
|
|
49
|
+
}
|
|
50
|
+
function createDaytonaClient(config) {
|
|
51
|
+
const clientConfig = {
|
|
52
|
+
apiKey: resolveApiKey(config),
|
|
53
|
+
};
|
|
54
|
+
if (config.apiUrl)
|
|
55
|
+
clientConfig.apiUrl = config.apiUrl;
|
|
56
|
+
if (config.target)
|
|
57
|
+
clientConfig.target = config.target;
|
|
58
|
+
return new Daytona(clientConfig);
|
|
59
|
+
}
|
|
60
|
+
function buildResources(config) {
|
|
61
|
+
if (config.cpu == null && config.memory == null && config.disk == null && config.gpu == null) {
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
return {
|
|
65
|
+
cpu: config.cpu ?? undefined,
|
|
66
|
+
memory: config.memory ?? undefined,
|
|
67
|
+
disk: config.disk ?? undefined,
|
|
68
|
+
gpu: config.gpu ?? undefined,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function buildCreateParams(config, labels) {
|
|
72
|
+
const base = {
|
|
73
|
+
labels,
|
|
74
|
+
language: config.language ?? undefined,
|
|
75
|
+
autoStopInterval: config.autoStopInterval ?? undefined,
|
|
76
|
+
autoArchiveInterval: config.autoArchiveInterval ?? undefined,
|
|
77
|
+
autoDeleteInterval: config.autoDeleteInterval ?? undefined,
|
|
78
|
+
};
|
|
79
|
+
if (config.image) {
|
|
80
|
+
return {
|
|
81
|
+
...base,
|
|
82
|
+
image: config.image,
|
|
83
|
+
resources: buildResources(config),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
return {
|
|
87
|
+
...base,
|
|
88
|
+
snapshot: config.snapshot ?? undefined,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function buildSandboxLabels(input) {
|
|
92
|
+
return {
|
|
93
|
+
"paperclip-provider": "daytona",
|
|
94
|
+
"paperclip-company-id": input.companyId,
|
|
95
|
+
"paperclip-environment-id": input.environmentId,
|
|
96
|
+
"paperclip-reuse-lease": input.reuseLease ? "true" : "false",
|
|
97
|
+
...(input.runId ? { "paperclip-run-id": input.runId } : {}),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
function toTimeoutSeconds(timeoutMs) {
|
|
101
|
+
return Math.max(1, Math.ceil(timeoutMs / 1000));
|
|
102
|
+
}
|
|
103
|
+
function resolveTimeoutMs(paramsTimeoutMs, config) {
|
|
104
|
+
return paramsTimeoutMs != null && Number.isFinite(paramsTimeoutMs) && paramsTimeoutMs > 0
|
|
105
|
+
? Math.trunc(paramsTimeoutMs)
|
|
106
|
+
: config.timeoutMs;
|
|
107
|
+
}
|
|
108
|
+
function formatErrorMessage(error) {
|
|
109
|
+
return error instanceof Error ? error.message : String(error);
|
|
110
|
+
}
|
|
111
|
+
function isValidUrl(value) {
|
|
112
|
+
try {
|
|
113
|
+
new URL(value);
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function ensureSandboxStarted(sandbox, timeoutSeconds) {
|
|
121
|
+
if (sandbox.state === "started")
|
|
122
|
+
return;
|
|
123
|
+
if (sandbox.state === "error") {
|
|
124
|
+
if (sandbox.recoverable) {
|
|
125
|
+
await sandbox.recover(timeoutSeconds);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
throw new Error(`Daytona sandbox ${sandbox.id} is in an unrecoverable error state: ${sandbox.errorReason ?? "unknown error"}`);
|
|
129
|
+
}
|
|
130
|
+
await sandbox.start(timeoutSeconds);
|
|
131
|
+
}
|
|
132
|
+
async function resolveSandboxWorkingDirectory(sandbox) {
|
|
133
|
+
const root = (await sandbox.getWorkDir())?.trim()
|
|
134
|
+
|| (await sandbox.getUserHomeDir())?.trim()
|
|
135
|
+
|| "/home/daytona";
|
|
136
|
+
const remoteCwd = path.posix.join(root, "paperclip-workspace");
|
|
137
|
+
await sandbox.fs.createFolder(remoteCwd, "755");
|
|
138
|
+
return remoteCwd;
|
|
139
|
+
}
|
|
140
|
+
async function detectSandboxShellCommand(sandbox, timeoutSeconds) {
|
|
141
|
+
try {
|
|
142
|
+
const result = await sandbox.process.executeCommand("if command -v bash >/dev/null 2>&1; then printf bash; else printf sh; fi", undefined, undefined, timeoutSeconds);
|
|
143
|
+
return result.result?.trim() === "bash" ? "bash" : "sh";
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return "sh";
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function leaseMetadata(input) {
|
|
150
|
+
return {
|
|
151
|
+
provider: "daytona",
|
|
152
|
+
shellCommand: input.shellCommand,
|
|
153
|
+
sandboxId: input.sandbox.id,
|
|
154
|
+
sandboxName: input.sandbox.name,
|
|
155
|
+
sandboxState: input.sandbox.state ?? null,
|
|
156
|
+
image: input.config.image,
|
|
157
|
+
snapshot: input.config.snapshot,
|
|
158
|
+
target: input.sandbox.target,
|
|
159
|
+
timeoutMs: input.config.timeoutMs,
|
|
160
|
+
reuseLease: input.config.reuseLease,
|
|
161
|
+
remoteCwd: input.remoteCwd,
|
|
162
|
+
resumedLease: input.resumedLease,
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
function shellQuote(value) {
|
|
166
|
+
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
167
|
+
}
|
|
168
|
+
function isValidShellEnvKey(value) {
|
|
169
|
+
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
|
|
170
|
+
}
|
|
171
|
+
// Mirror the E2B sandbox executor: source common login profiles (and nvm)
|
|
172
|
+
// before running the command so Daytona one-shot calls see the same PATH an
|
|
173
|
+
// interactive shell would. Without this, adapter probes can fail to resolve
|
|
174
|
+
// CLIs that are installed via profile-driven PATH mutations inside the
|
|
175
|
+
// sandbox image.
|
|
176
|
+
function buildLoginShellScript(input) {
|
|
177
|
+
const env = input.env ?? {};
|
|
178
|
+
for (const key of Object.keys(env)) {
|
|
179
|
+
if (!isValidShellEnvKey(key)) {
|
|
180
|
+
throw new Error(`Invalid sandbox environment variable key: ${key}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
const envArgs = Object.entries(env)
|
|
184
|
+
.filter((entry) => typeof entry[1] === "string")
|
|
185
|
+
.map(([key, value]) => `${key}=${shellQuote(value)}`);
|
|
186
|
+
const commandParts = [shellQuote(input.command), ...input.args.map(shellQuote)].join(" ");
|
|
187
|
+
const redirectedCommand = input.stdinPath
|
|
188
|
+
? `${commandParts} < ${shellQuote(input.stdinPath)}`
|
|
189
|
+
: commandParts;
|
|
190
|
+
// Each `executeCommand` call runs in its own shell, so we don't `exec`-
|
|
191
|
+
// replace it; running the command as the last `&&`-chained line is enough to
|
|
192
|
+
// surface the right exit code. Env is interpolated after profile sourcing so
|
|
193
|
+
// the caller's env wins over any defaults the profile exports.
|
|
194
|
+
const finalLine = envArgs.length > 0
|
|
195
|
+
? `env ${envArgs.join(" ")} ${redirectedCommand}`
|
|
196
|
+
: redirectedCommand;
|
|
197
|
+
const lines = [
|
|
198
|
+
'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',
|
|
199
|
+
'if [ -f "$HOME/.profile" ]; then . "$HOME/.profile" >/dev/null 2>&1 || true; fi',
|
|
200
|
+
// .bash_profile typically sources .bashrc itself; only source .bashrc
|
|
201
|
+
// directly when no .bash_profile exists to avoid double-running setup.
|
|
202
|
+
'if [ -f "$HOME/.bash_profile" ]; then . "$HOME/.bash_profile" >/dev/null 2>&1 || true; elif [ -f "$HOME/.bashrc" ]; then . "$HOME/.bashrc" >/dev/null 2>&1 || true; fi',
|
|
203
|
+
'if [ -f "$HOME/.zprofile" ]; then . "$HOME/.zprofile" >/dev/null 2>&1 || true; fi',
|
|
204
|
+
'export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"',
|
|
205
|
+
'[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" >/dev/null 2>&1 || true',
|
|
206
|
+
];
|
|
207
|
+
if (input.cwd) {
|
|
208
|
+
lines.push(`cd ${shellQuote(input.cwd)}`);
|
|
209
|
+
}
|
|
210
|
+
lines.push(finalLine);
|
|
211
|
+
return lines.join(" && ");
|
|
212
|
+
}
|
|
213
|
+
async function createSandbox(params, config) {
|
|
214
|
+
const client = createDaytonaClient(config);
|
|
215
|
+
const createParams = buildCreateParams(config, buildSandboxLabels({
|
|
216
|
+
companyId: params.companyId,
|
|
217
|
+
environmentId: params.environmentId,
|
|
218
|
+
runId: "runId" in params ? params.runId : undefined,
|
|
219
|
+
reuseLease: config.reuseLease,
|
|
220
|
+
}));
|
|
221
|
+
return await client.create(createParams, {
|
|
222
|
+
timeout: toTimeoutSeconds(config.timeoutMs),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
async function getSandbox(config, sandboxId) {
|
|
226
|
+
const client = createDaytonaClient(config);
|
|
227
|
+
return await client.get(sandboxId);
|
|
228
|
+
}
|
|
229
|
+
async function getSandboxOrNull(config, sandboxId) {
|
|
230
|
+
try {
|
|
231
|
+
return await getSandbox(config, sandboxId);
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
if (error instanceof DaytonaNotFoundError) {
|
|
235
|
+
return null;
|
|
236
|
+
}
|
|
237
|
+
throw error;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// One-shot command execution via Daytona's `process.executeCommand`. The
|
|
241
|
+
// session-based API (`createSession` + `executeSessionCommand` with
|
|
242
|
+
// `runAsync: false`) hangs indefinitely when the supplied command ends with
|
|
243
|
+
// `exec <something>`, which `buildLoginShellScript` always produces. Reproduced
|
|
244
|
+
// directly against the Daytona SDK: identical login-shell wrapper returns in
|
|
245
|
+
// ~600 ms via `executeCommand` but times out via `executeSessionCommand`. So we
|
|
246
|
+
// use the one-shot path, mirroring e2b's `sandbox.commands.run` model.
|
|
247
|
+
//
|
|
248
|
+
// `executeCommand` returns combined stdout+stderr in `result`. We surface that
|
|
249
|
+
// as `stdout` and leave `stderr` empty; callers that grep for error messages
|
|
250
|
+
// still see them in `stdout`.
|
|
251
|
+
async function executeOneShot(sandbox, params, config) {
|
|
252
|
+
const timeoutMs = resolveTimeoutMs(params.timeoutMs, config);
|
|
253
|
+
const timeoutSeconds = toTimeoutSeconds(timeoutMs);
|
|
254
|
+
const stdinPath = params.stdin != null ? `/tmp/paperclip-stdin-${randomUUID()}` : null;
|
|
255
|
+
try {
|
|
256
|
+
if (stdinPath) {
|
|
257
|
+
await sandbox.fs.uploadFile(Buffer.from(params.stdin ?? "", "utf8"), stdinPath, timeoutSeconds);
|
|
258
|
+
}
|
|
259
|
+
const command = buildLoginShellScript({
|
|
260
|
+
command: params.command,
|
|
261
|
+
args: params.args ?? [],
|
|
262
|
+
cwd: params.cwd,
|
|
263
|
+
env: params.env,
|
|
264
|
+
stdinPath: stdinPath ?? undefined,
|
|
265
|
+
});
|
|
266
|
+
// Pass cwd undefined: `buildLoginShellScript` already injects `cd` after
|
|
267
|
+
// profile sourcing when params.cwd is set, and the Daytona executor's own
|
|
268
|
+
// cwd argument runs before our login-shell init, which is the wrong order
|
|
269
|
+
// (env from .bashrc would override caller env).
|
|
270
|
+
const result = await sandbox.process.executeCommand(command, undefined, undefined, timeoutSeconds);
|
|
271
|
+
return {
|
|
272
|
+
exitCode: typeof result.exitCode === "number" ? result.exitCode : 1,
|
|
273
|
+
timedOut: false,
|
|
274
|
+
stdout: result.result ?? result.artifacts?.stdout ?? "",
|
|
275
|
+
stderr: "",
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
if (error instanceof DaytonaTimeoutError) {
|
|
280
|
+
return {
|
|
281
|
+
exitCode: null,
|
|
282
|
+
timedOut: true,
|
|
283
|
+
stdout: "",
|
|
284
|
+
stderr: `${error.message.trim()}\n`,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
throw error;
|
|
288
|
+
}
|
|
289
|
+
finally {
|
|
290
|
+
if (stdinPath) {
|
|
291
|
+
await sandbox.fs.deleteFile(stdinPath).catch(() => undefined);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
const plugin = definePlugin({
|
|
296
|
+
async setup(ctx) {
|
|
297
|
+
ctx.logger.info("Daytona sandbox provider plugin ready");
|
|
298
|
+
},
|
|
299
|
+
async onHealth() {
|
|
300
|
+
return { status: "ok", message: "Daytona sandbox provider plugin healthy" };
|
|
301
|
+
},
|
|
302
|
+
async onEnvironmentValidateConfig(params) {
|
|
303
|
+
const config = parseDriverConfig(params.config);
|
|
304
|
+
const errors = [];
|
|
305
|
+
if (typeof params.config.image === "string" && params.config.image.trim().length === 0) {
|
|
306
|
+
errors.push("Daytona image cannot be empty.");
|
|
307
|
+
}
|
|
308
|
+
if (typeof params.config.snapshot === "string" && params.config.snapshot.trim().length === 0) {
|
|
309
|
+
errors.push("Daytona snapshot cannot be empty.");
|
|
310
|
+
}
|
|
311
|
+
if (config.image && config.snapshot) {
|
|
312
|
+
errors.push("Daytona sandbox environments must set either image or snapshot, not both.");
|
|
313
|
+
}
|
|
314
|
+
if (config.apiUrl && !isValidUrl(config.apiUrl)) {
|
|
315
|
+
errors.push("apiUrl must be a valid URL.");
|
|
316
|
+
}
|
|
317
|
+
if (config.timeoutMs < 1 || config.timeoutMs > 86_400_000) {
|
|
318
|
+
errors.push("timeoutMs must be between 1 and 86400000.");
|
|
319
|
+
}
|
|
320
|
+
if (config.autoStopInterval != null && config.autoStopInterval < 0) {
|
|
321
|
+
errors.push("autoStopInterval must be greater than or equal to 0.");
|
|
322
|
+
}
|
|
323
|
+
if (config.autoArchiveInterval != null && config.autoArchiveInterval < 0) {
|
|
324
|
+
errors.push("autoArchiveInterval must be greater than or equal to 0.");
|
|
325
|
+
}
|
|
326
|
+
if (config.autoDeleteInterval != null && config.autoDeleteInterval < -1) {
|
|
327
|
+
errors.push("autoDeleteInterval must be greater than or equal to -1.");
|
|
328
|
+
}
|
|
329
|
+
if (!config.apiKey && !(process.env.DAYTONA_API_KEY?.trim())) {
|
|
330
|
+
errors.push("Daytona sandbox environments require an API key in config or DAYTONA_API_KEY.");
|
|
331
|
+
}
|
|
332
|
+
for (const [key, value] of Object.entries({
|
|
333
|
+
cpu: config.cpu,
|
|
334
|
+
memory: config.memory,
|
|
335
|
+
disk: config.disk,
|
|
336
|
+
gpu: config.gpu,
|
|
337
|
+
})) {
|
|
338
|
+
if (value != null && value <= 0) {
|
|
339
|
+
errors.push(`${key} must be greater than 0 when provided.`);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
if (errors.length > 0) {
|
|
343
|
+
return { ok: false, errors };
|
|
344
|
+
}
|
|
345
|
+
return {
|
|
346
|
+
ok: true,
|
|
347
|
+
normalizedConfig: { ...config },
|
|
348
|
+
};
|
|
349
|
+
},
|
|
350
|
+
async onEnvironmentProbe(params) {
|
|
351
|
+
const config = parseDriverConfig(params.config);
|
|
352
|
+
try {
|
|
353
|
+
const sandbox = await createSandbox(params, config);
|
|
354
|
+
try {
|
|
355
|
+
const remoteCwd = await resolveSandboxWorkingDirectory(sandbox);
|
|
356
|
+
const shellCommand = await detectSandboxShellCommand(sandbox, toTimeoutSeconds(config.timeoutMs));
|
|
357
|
+
return {
|
|
358
|
+
ok: true,
|
|
359
|
+
summary: `Connected to Daytona sandbox ${sandbox.name}.`,
|
|
360
|
+
metadata: {
|
|
361
|
+
provider: "daytona",
|
|
362
|
+
shellCommand,
|
|
363
|
+
sandboxId: sandbox.id,
|
|
364
|
+
sandboxName: sandbox.name,
|
|
365
|
+
target: sandbox.target,
|
|
366
|
+
image: config.image,
|
|
367
|
+
snapshot: config.snapshot,
|
|
368
|
+
timeoutMs: config.timeoutMs,
|
|
369
|
+
reuseLease: config.reuseLease,
|
|
370
|
+
remoteCwd,
|
|
371
|
+
},
|
|
372
|
+
};
|
|
373
|
+
}
|
|
374
|
+
finally {
|
|
375
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs)).catch(() => undefined);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
return {
|
|
380
|
+
ok: false,
|
|
381
|
+
summary: "Daytona sandbox probe failed.",
|
|
382
|
+
metadata: {
|
|
383
|
+
provider: "daytona",
|
|
384
|
+
image: config.image,
|
|
385
|
+
snapshot: config.snapshot,
|
|
386
|
+
timeoutMs: config.timeoutMs,
|
|
387
|
+
reuseLease: config.reuseLease,
|
|
388
|
+
error: formatErrorMessage(error),
|
|
389
|
+
},
|
|
390
|
+
};
|
|
391
|
+
}
|
|
392
|
+
},
|
|
393
|
+
async onEnvironmentAcquireLease(params) {
|
|
394
|
+
const config = parseDriverConfig(params.config);
|
|
395
|
+
const sandbox = await createSandbox(params, config);
|
|
396
|
+
try {
|
|
397
|
+
const remoteCwd = await resolveSandboxWorkingDirectory(sandbox);
|
|
398
|
+
const shellCommand = await detectSandboxShellCommand(sandbox, toTimeoutSeconds(config.timeoutMs));
|
|
399
|
+
return {
|
|
400
|
+
providerLeaseId: sandbox.id,
|
|
401
|
+
metadata: leaseMetadata({ config, sandbox, shellCommand, remoteCwd, resumedLease: false }),
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
catch (error) {
|
|
405
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs)).catch(() => undefined);
|
|
406
|
+
throw error;
|
|
407
|
+
}
|
|
408
|
+
},
|
|
409
|
+
async onEnvironmentResumeLease(params) {
|
|
410
|
+
const config = parseDriverConfig(params.config);
|
|
411
|
+
const sandbox = await getSandboxOrNull(config, params.providerLeaseId);
|
|
412
|
+
if (!sandbox) {
|
|
413
|
+
return { providerLeaseId: null, metadata: { expired: true } };
|
|
414
|
+
}
|
|
415
|
+
await ensureSandboxStarted(sandbox, toTimeoutSeconds(config.timeoutMs));
|
|
416
|
+
try {
|
|
417
|
+
const remoteCwd = await resolveSandboxWorkingDirectory(sandbox);
|
|
418
|
+
const shellCommand = await detectSandboxShellCommand(sandbox, toTimeoutSeconds(config.timeoutMs));
|
|
419
|
+
return {
|
|
420
|
+
providerLeaseId: sandbox.id,
|
|
421
|
+
metadata: leaseMetadata({ config, sandbox, shellCommand, remoteCwd, resumedLease: true }),
|
|
422
|
+
};
|
|
423
|
+
}
|
|
424
|
+
catch (error) {
|
|
425
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs)).catch(() => undefined);
|
|
426
|
+
throw error;
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
async onEnvironmentReleaseLease(params) {
|
|
430
|
+
if (!params.providerLeaseId)
|
|
431
|
+
return;
|
|
432
|
+
const config = parseDriverConfig(params.config);
|
|
433
|
+
const sandbox = await getSandboxOrNull(config, params.providerLeaseId);
|
|
434
|
+
if (!sandbox)
|
|
435
|
+
return;
|
|
436
|
+
if (config.reuseLease) {
|
|
437
|
+
if (sandbox.state !== "stopped") {
|
|
438
|
+
try {
|
|
439
|
+
await sandbox.stop(toTimeoutSeconds(config.timeoutMs));
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
console.warn(`Failed to stop Daytona sandbox during lease release: ${formatErrorMessage(error)}. Attempting delete instead.`);
|
|
443
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs)).catch((deleteError) => {
|
|
444
|
+
console.warn(`Failed to delete Daytona sandbox after stop failure: ${formatErrorMessage(deleteError)}`);
|
|
445
|
+
});
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs));
|
|
451
|
+
},
|
|
452
|
+
async onEnvironmentDestroyLease(params) {
|
|
453
|
+
if (!params.providerLeaseId)
|
|
454
|
+
return;
|
|
455
|
+
const config = parseDriverConfig(params.config);
|
|
456
|
+
const sandbox = await getSandboxOrNull(config, params.providerLeaseId);
|
|
457
|
+
if (!sandbox)
|
|
458
|
+
return;
|
|
459
|
+
await sandbox.delete(toTimeoutSeconds(config.timeoutMs));
|
|
460
|
+
},
|
|
461
|
+
async onEnvironmentRealizeWorkspace(params) {
|
|
462
|
+
const config = parseDriverConfig(params.config);
|
|
463
|
+
const remoteCwd = typeof params.lease.metadata?.remoteCwd === "string" &&
|
|
464
|
+
params.lease.metadata.remoteCwd.trim().length > 0
|
|
465
|
+
? params.lease.metadata.remoteCwd.trim()
|
|
466
|
+
: params.workspace.remotePath ?? params.workspace.localPath ?? "/paperclip-workspace";
|
|
467
|
+
if (params.lease.providerLeaseId) {
|
|
468
|
+
const sandbox = await getSandbox(config, params.lease.providerLeaseId);
|
|
469
|
+
await ensureSandboxStarted(sandbox, toTimeoutSeconds(config.timeoutMs));
|
|
470
|
+
await sandbox.fs.createFolder(remoteCwd, "755");
|
|
471
|
+
}
|
|
472
|
+
return {
|
|
473
|
+
cwd: remoteCwd,
|
|
474
|
+
metadata: {
|
|
475
|
+
provider: "daytona",
|
|
476
|
+
remoteCwd,
|
|
477
|
+
},
|
|
478
|
+
};
|
|
479
|
+
},
|
|
480
|
+
async onEnvironmentExecute(params) {
|
|
481
|
+
if (!params.lease.providerLeaseId) {
|
|
482
|
+
return {
|
|
483
|
+
exitCode: 1,
|
|
484
|
+
timedOut: false,
|
|
485
|
+
stdout: "",
|
|
486
|
+
stderr: "No provider lease ID available for execution.",
|
|
487
|
+
};
|
|
488
|
+
}
|
|
489
|
+
const config = parseDriverConfig(params.config);
|
|
490
|
+
const sandbox = await getSandbox(config, params.lease.providerLeaseId);
|
|
491
|
+
await ensureSandboxStarted(sandbox, toTimeoutSeconds(resolveTimeoutMs(params.timeoutMs, config)));
|
|
492
|
+
return await executeOneShot(sandbox, params, config);
|
|
493
|
+
},
|
|
494
|
+
});
|
|
495
|
+
export default plugin;
|
|
496
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AASpF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAmCvD,SAAS,mBAAmB,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,C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B,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAClG,OAAO,MAAM,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/worker.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AACA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,eAAe,MAAM,CAAC"}
|
package/dist/worker.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,eAAe,MAAM,CAAC;AACtB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@paperclipai/plugin-daytona",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "2026.510.0-canary.1",
|
|
4
4
|
"description": "Daytona sandbox provider plugin for Paperclip environments",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/paperclipai/paperclip",
|
|
@@ -22,15 +22,7 @@
|
|
|
22
22
|
"main": "./dist/index.js",
|
|
23
23
|
"types": "./dist/index.d.ts",
|
|
24
24
|
"publishConfig": {
|
|
25
|
-
"access": "public"
|
|
26
|
-
"exports": {
|
|
27
|
-
".": {
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"import": "./dist/index.js"
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"main": "./dist/index.js",
|
|
33
|
-
"types": "./dist/index.d.ts"
|
|
25
|
+
"access": "public"
|
|
34
26
|
},
|
|
35
27
|
"files": [
|
|
36
28
|
"dist"
|
|
@@ -47,6 +39,6 @@
|
|
|
47
39
|
],
|
|
48
40
|
"dependencies": {
|
|
49
41
|
"@daytonaio/sdk": "^0.171.0",
|
|
50
|
-
"@paperclipai/plugin-sdk": "
|
|
42
|
+
"@paperclipai/plugin-sdk": "2026.510.0-canary.1"
|
|
51
43
|
}
|
|
52
|
-
}
|
|
44
|
+
}
|