mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-19 12:10:37 +09:00
Add Daytona sandbox provider plugin (#5580)
## Thinking Path > - Paperclip orchestrates AI agents for zero-human companies > - Agents need isolated sandbox environments to execute work safely; Paperclip already supports E2B as a sandbox provider plugin > - Users want to use Daytona (https://www.daytona.io/) as an alternative sandbox backend, but no plugin existed for it > - Without a Daytona plugin, teams that prefer Daytona's pricing/regions/runtime can't run Paperclip agents on it > - This pull request adds a `@paperclip/sandbox-provider-daytona` plugin that mirrors the existing E2B plugin shape and wires up Daytona's `@daytonaio/sdk` for sandbox lifecycle, command execution, and shell detection > - The benefit is that operators can pick Daytona as a first-class sandbox provider without touching core code, broadening Paperclip's runtime options ## What Changed - New plugin package `packages/plugins/sandbox-providers/daytona` with manifest, worker entry, and provider implementation backed by `@daytonaio/sdk` - Implements sandbox create/destroy/exec/upload/download lifecycle, shell command detection, and config/env wiring consistent with the E2B plugin - Adds unit tests under `src/plugin.test.ts` and a README documenting setup and the `DAYTONA_API_KEY` requirement - Minor adjustments in `scripts/paperclip-issue-update.sh`, `packages/shared/src/issue-thread-interactions.test.ts`, and `packages/shared/src/validators/issue.ts` to support the integration ## Verification - Re-ran the full sandbox provider matrix on the QA Paperclip instance using Daytona as the runtime — all 6 adapters executed inside the Daytona sandbox with zero `environmentExecute` timeouts - 5/6 adapters pass cleanly (or with informational warns); the only failure is `codex_local`, which is an OpenAI quota/billing issue unrelated to Daytona - `pnpm --filter @paperclip/sandbox-provider-daytona test` runs the plugin unit tests ## Risks - New optional plugin; no behavior change for users who don't enable it - Requires `DAYTONA_API_KEY` for runtime use — documented in the plugin README - Daytona SDK is a new external dependency; tracked in the plugin's own package.json so it doesn't affect the core install footprint ## Model Used - Claude Opus 4.7 (`claude-opus-4-7`), extended thinking, tool use enabled ## Checklist - [x] I have included a thinking path that traces from project context to this change - [x] I have specified the model used (with version and capability details) - [x] I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work - [x] I have run tests locally and they pass - [x] I have added or updated tests where applicable - [ ] If this change affects the UI, I have included before/after screenshots (N/A — backend plugin) - [x] I have updated relevant documentation to reflect my changes - [x] I have considered and documented any risks above - [x] I will address all Greptile and reviewer comments before requesting merge --------- Co-authored-by: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
f784d8d90e
commit
06e6ee25cd
10 changed files with 1361 additions and 0 deletions
104
packages/plugins/sandbox-providers/daytona/src/manifest.ts
Normal file
104
packages/plugins/sandbox-providers/daytona/src/manifest.ts
Normal file
|
|
@ -0,0 +1,104 @@
|
|||
import type { PaperclipPluginManifestV1 } from "@paperclipai/plugin-sdk";
|
||||
|
||||
const PLUGIN_ID = "paperclip.daytona-sandbox-provider";
|
||||
const PLUGIN_VERSION = "0.1.0";
|
||||
|
||||
const manifest: PaperclipPluginManifestV1 = {
|
||||
id: PLUGIN_ID,
|
||||
apiVersion: 1,
|
||||
version: PLUGIN_VERSION,
|
||||
displayName: "Daytona Sandbox Provider",
|
||||
description:
|
||||
"First-party sandbox provider plugin that provisions Daytona sandboxes as Paperclip execution environments.",
|
||||
author: "Paperclip",
|
||||
categories: ["automation"],
|
||||
capabilities: ["environment.drivers.register"],
|
||||
entrypoints: {
|
||||
worker: "./dist/worker.js",
|
||||
},
|
||||
environmentDrivers: [
|
||||
{
|
||||
driverKey: "daytona",
|
||||
kind: "sandbox_provider",
|
||||
displayName: "Daytona Sandbox",
|
||||
description:
|
||||
"Provisions Daytona sandboxes with configurable image or snapshot selection, startup timeouts, and lease reuse.",
|
||||
configSchema: {
|
||||
type: "object",
|
||||
properties: {
|
||||
apiKey: {
|
||||
type: "string",
|
||||
format: "secret-ref",
|
||||
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.",
|
||||
},
|
||||
apiUrl: {
|
||||
type: "string",
|
||||
description:
|
||||
"Optional Daytona API base URL. If omitted, the Daytona SDK uses its configured default endpoint.",
|
||||
},
|
||||
target: {
|
||||
type: "string",
|
||||
description: "Optional Daytona target/region identifier.",
|
||||
},
|
||||
snapshot: {
|
||||
type: "string",
|
||||
description: "Optional Daytona snapshot name to start from.",
|
||||
},
|
||||
image: {
|
||||
type: "string",
|
||||
description:
|
||||
"Optional base image or Daytona Image reference. If set, the sandbox is created from this image instead of a snapshot.",
|
||||
},
|
||||
language: {
|
||||
type: "string",
|
||||
description:
|
||||
"Optional Daytona language hint for direct code execution. If omitted, Daytona uses its default runtime.",
|
||||
},
|
||||
cpu: {
|
||||
type: "number",
|
||||
description: "Optional CPU allocation in cores.",
|
||||
},
|
||||
memory: {
|
||||
type: "number",
|
||||
description: "Optional memory allocation in GiB.",
|
||||
},
|
||||
disk: {
|
||||
type: "number",
|
||||
description: "Optional disk allocation in GiB.",
|
||||
},
|
||||
gpu: {
|
||||
type: "number",
|
||||
description: "Optional GPU allocation in units.",
|
||||
},
|
||||
timeoutMs: {
|
||||
type: "number",
|
||||
description: "Timeout for Daytona create/start/stop/execute operations in milliseconds.",
|
||||
default: 300000,
|
||||
},
|
||||
autoStopInterval: {
|
||||
type: "number",
|
||||
description: "Optional Daytona auto-stop interval in minutes. `0` disables auto-stop.",
|
||||
},
|
||||
autoArchiveInterval: {
|
||||
type: "number",
|
||||
description: "Optional Daytona auto-archive interval in minutes. `0` uses Daytona's max interval.",
|
||||
},
|
||||
autoDeleteInterval: {
|
||||
type: "number",
|
||||
description:
|
||||
"Optional Daytona auto-delete interval in minutes. `-1` disables auto-delete and `0` deletes immediately after stop.",
|
||||
},
|
||||
reuseLease: {
|
||||
type: "boolean",
|
||||
description:
|
||||
"Whether to stop and later resume the sandbox across runs instead of deleting it on release.",
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default manifest;
|
||||
Loading…
Add table
Add a link
Reference in a new issue