@tickernelz/paperclip-pro-plugin-modal 2026.1022.1 → 2026.1022.3
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 +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/manifest.d.ts +0 -4
- package/dist/manifest.d.ts.map +0 -1
- package/dist/manifest.js +0 -89
- package/dist/manifest.js.map +0 -1
- package/dist/plugin.d.ts +0 -18
- package/dist/plugin.d.ts.map +0 -1
- package/dist/plugin.js +0 -552
- package/dist/plugin.js.map +0 -1
- package/dist/worker.d.ts +0 -3
- package/dist/worker.d.ts.map +0 -1
- package/dist/worker.js +0 -5
- package/dist/worker.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tickernelz/paperclip-pro-plugin-modal",
|
|
3
|
-
"version": "2026.1022.
|
|
3
|
+
"version": "2026.1022.3",
|
|
4
4
|
"description": "Modal sandbox provider plugin for Paperclip environments",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/tickernelz/paperclip-pro",
|
|
@@ -39,6 +39,6 @@
|
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"modal": "^0.7.4",
|
|
42
|
-
"@tickernelz/paperclip-pro-plugin-sdk": "2026.1022.
|
|
42
|
+
"@tickernelz/paperclip-pro-plugin-sdk": "2026.1022.3"
|
|
43
43
|
}
|
|
44
44
|
}
|
package/dist/index.d.ts
DELETED
package/dist/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/manifest.d.ts
DELETED
package/dist/manifest.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAKtF,QAAA,MAAM,QAAQ,EAAE,yBA+Ff,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/manifest.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
const PLUGIN_ID = "paperclip.modal-sandbox-provider";
|
|
2
|
-
const PLUGIN_VERSION = "0.1.1";
|
|
3
|
-
const manifest = {
|
|
4
|
-
id: PLUGIN_ID,
|
|
5
|
-
apiVersion: 1,
|
|
6
|
-
version: PLUGIN_VERSION,
|
|
7
|
-
displayName: "Modal Sandbox Provider",
|
|
8
|
-
description: "First-party sandbox provider plugin that provisions Modal 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: "modal",
|
|
18
|
-
kind: "sandbox_provider",
|
|
19
|
-
displayName: "Modal Sandbox",
|
|
20
|
-
description: "Provisions Modal sandboxes with configurable image, app, auth, timeouts, and network controls.",
|
|
21
|
-
configSchema: {
|
|
22
|
-
type: "object",
|
|
23
|
-
required: ["appName", "image"],
|
|
24
|
-
properties: {
|
|
25
|
-
appName: {
|
|
26
|
-
type: "string",
|
|
27
|
-
description: "Modal App name used as the parent for sandboxes. The plugin calls `modal.apps.fromName(appName, { createIfMissing: true })`, so the App is created on first acquire if it does not already exist.",
|
|
28
|
-
default: "paperclip",
|
|
29
|
-
},
|
|
30
|
-
image: {
|
|
31
|
-
type: "string",
|
|
32
|
-
description: "Container image reference passed to `modal.images.fromRegistry()`, e.g. `python:3.13` or `node:24`. The default `node:24` satisfies the sandbox runtime contract (node, sh, and tar on PATH).",
|
|
33
|
-
default: "node:24",
|
|
34
|
-
},
|
|
35
|
-
tokenId: {
|
|
36
|
-
type: "string",
|
|
37
|
-
format: "secret-ref",
|
|
38
|
-
description: "Modal token ID. Paste a token or an existing Paperclip secret reference; saved environments store pasted values as company secrets. Required.",
|
|
39
|
-
},
|
|
40
|
-
tokenSecret: {
|
|
41
|
-
type: "string",
|
|
42
|
-
format: "secret-ref",
|
|
43
|
-
description: "Modal token secret paired with tokenId. Required.",
|
|
44
|
-
},
|
|
45
|
-
environment: {
|
|
46
|
-
type: "string",
|
|
47
|
-
description: "Optional Modal environment name. Falls back to the SDK profile default.",
|
|
48
|
-
},
|
|
49
|
-
workdir: {
|
|
50
|
-
type: "string",
|
|
51
|
-
description: "Remote working directory inside the sandbox.",
|
|
52
|
-
default: "/workspace/paperclip",
|
|
53
|
-
},
|
|
54
|
-
sandboxTimeoutMs: {
|
|
55
|
-
type: "number",
|
|
56
|
-
description: "Maximum sandbox lifetime in milliseconds. Must be a positive multiple of 1000 between 1000 and 86400000 (24 hours).",
|
|
57
|
-
default: 3_600_000,
|
|
58
|
-
},
|
|
59
|
-
idleTimeoutMs: {
|
|
60
|
-
type: "number",
|
|
61
|
-
description: "Optional idle timeout in milliseconds. When set, Modal terminates the sandbox if no exec is active for this duration. Must be a positive multiple of 1000.",
|
|
62
|
-
},
|
|
63
|
-
execTimeoutMs: {
|
|
64
|
-
type: "number",
|
|
65
|
-
description: "Default per-exec timeout in milliseconds when the caller does not provide one. Must be a positive multiple of 1000.",
|
|
66
|
-
default: 300_000,
|
|
67
|
-
},
|
|
68
|
-
blockNetwork: {
|
|
69
|
-
type: "boolean",
|
|
70
|
-
description: "Whether to block all egress network access from the sandbox.",
|
|
71
|
-
default: false,
|
|
72
|
-
},
|
|
73
|
-
cidrAllowlist: {
|
|
74
|
-
type: "array",
|
|
75
|
-
items: { type: "string" },
|
|
76
|
-
description: "Optional list of CIDRs the sandbox is allowed to reach. Cannot be combined with blockNetwork.",
|
|
77
|
-
},
|
|
78
|
-
reuseLease: {
|
|
79
|
-
type: "boolean",
|
|
80
|
-
description: "When true, the sandbox is detached (not terminated) on release and resumed by id later. Reuse relies on Modal's sandbox lifetime and idle timeout because Modal has no separate pause primitive.",
|
|
81
|
-
default: false,
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
],
|
|
87
|
-
};
|
|
88
|
-
export default manifest;
|
|
89
|
-
//# sourceMappingURL=manifest.js.map
|
package/dist/manifest.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,SAAS,GAAG,kCAAkC,CAAC;AACrD,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,wBAAwB;IACrC,WAAW,EACT,0GAA0G;IAC5G,MAAM,EAAE,WAAW;IACnB,UAAU,EAAE,CAAC,YAAY,CAAC;IAC1B,YAAY,EAAE,CAAC,8BAA8B,CAAC;IAC9C,WAAW,EAAE;QACX,MAAM,EAAE,kBAAkB;KAC3B;IACD,kBAAkB,EAAE;QAClB;YACE,SAAS,EAAE,OAAO;YACl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I,EAAE,QAAQ,EAAE;wBACzB,WAAW,EACT,+FAA+F;qBAClG;oBACD,UAAU,EAAE;wBACV,IAAI,EAAE,SAAS;wBACf,WAAW,EACT,kMAAkM;wBACpM,OAAO,EAAE,KAAK;qBACf;iBACF;aACF;SACF;KACF;CACF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/plugin.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
interface ModalDriverConfig {
|
|
2
|
-
appName: string;
|
|
3
|
-
image: string;
|
|
4
|
-
tokenId: string | null;
|
|
5
|
-
tokenSecret: string | null;
|
|
6
|
-
environment: string | null;
|
|
7
|
-
workdir: string;
|
|
8
|
-
sandboxTimeoutMs: number;
|
|
9
|
-
idleTimeoutMs: number | null;
|
|
10
|
-
execTimeoutMs: number;
|
|
11
|
-
blockNetwork: boolean;
|
|
12
|
-
cidrAllowlist: string[] | null;
|
|
13
|
-
reuseLease: boolean;
|
|
14
|
-
}
|
|
15
|
-
export declare function parseDriverConfig(raw: Record<string, unknown>): ModalDriverConfig;
|
|
16
|
-
declare const plugin: import("@tickernelz/paperclip-pro-plugin-sdk").PaperclipPlugin;
|
|
17
|
-
export default plugin;
|
|
18
|
-
//# sourceMappingURL=plugin.d.ts.map
|
package/dist/plugin.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAgCA,UAAU,iBAAiB;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,OAAO,CAAC;CACrB;AAqBD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAoBjF;AAuPD,QAAA,MAAM,MAAM,gEAoUV,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/plugin.js
DELETED
|
@@ -1,552 +0,0 @@
|
|
|
1
|
-
import { ModalClient, NotFoundError, SandboxTimeoutError, TimeoutError, } from "modal";
|
|
2
|
-
import { definePlugin } from "@tickernelz/paperclip-pro-plugin-sdk";
|
|
3
|
-
const DEFAULT_WORKDIR = "/workspace/paperclip";
|
|
4
|
-
const DEFAULT_SANDBOX_TIMEOUT_MS = 3_600_000;
|
|
5
|
-
const DEFAULT_EXEC_TIMEOUT_MS = 300_000;
|
|
6
|
-
const MAX_SANDBOX_TIMEOUT_MS = 86_400_000;
|
|
7
|
-
function parseOptionalString(value) {
|
|
8
|
-
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
9
|
-
}
|
|
10
|
-
function parseOptionalNumber(value) {
|
|
11
|
-
if (value == null || value === "")
|
|
12
|
-
return null;
|
|
13
|
-
const parsed = Number(value);
|
|
14
|
-
return Number.isFinite(parsed) ? parsed : null;
|
|
15
|
-
}
|
|
16
|
-
function parseStringArray(value) {
|
|
17
|
-
if (!Array.isArray(value))
|
|
18
|
-
return null;
|
|
19
|
-
const trimmed = value
|
|
20
|
-
.filter((entry) => typeof entry === "string")
|
|
21
|
-
.map((entry) => entry.trim())
|
|
22
|
-
.filter((entry) => entry.length > 0);
|
|
23
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
24
|
-
}
|
|
25
|
-
export function parseDriverConfig(raw) {
|
|
26
|
-
const sandboxTimeoutMsRaw = parseOptionalNumber(raw.sandboxTimeoutMs);
|
|
27
|
-
const execTimeoutMsRaw = parseOptionalNumber(raw.execTimeoutMs);
|
|
28
|
-
const idleTimeoutMsRaw = parseOptionalNumber(raw.idleTimeoutMs);
|
|
29
|
-
return {
|
|
30
|
-
appName: parseOptionalString(raw.appName) ?? "",
|
|
31
|
-
image: parseOptionalString(raw.image) ?? "",
|
|
32
|
-
tokenId: parseOptionalString(raw.tokenId),
|
|
33
|
-
tokenSecret: parseOptionalString(raw.tokenSecret),
|
|
34
|
-
environment: parseOptionalString(raw.environment),
|
|
35
|
-
workdir: parseOptionalString(raw.workdir) ?? DEFAULT_WORKDIR,
|
|
36
|
-
sandboxTimeoutMs: sandboxTimeoutMsRaw != null ? Math.trunc(sandboxTimeoutMsRaw) : DEFAULT_SANDBOX_TIMEOUT_MS,
|
|
37
|
-
idleTimeoutMs: idleTimeoutMsRaw != null ? Math.trunc(idleTimeoutMsRaw) : null,
|
|
38
|
-
execTimeoutMs: execTimeoutMsRaw != null ? Math.trunc(execTimeoutMsRaw) : DEFAULT_EXEC_TIMEOUT_MS,
|
|
39
|
-
blockNetwork: raw.blockNetwork === true,
|
|
40
|
-
cidrAllowlist: parseStringArray(raw.cidrAllowlist),
|
|
41
|
-
reuseLease: raw.reuseLease === true,
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function isMultipleOf1000(value) {
|
|
45
|
-
return value > 0 && value % 1000 === 0;
|
|
46
|
-
}
|
|
47
|
-
function resolveAuth(config) {
|
|
48
|
-
// The plugin worker runs in a child process that does not inherit host env
|
|
49
|
-
// vars (see PluginWorkerManager.spawnProcess), so MODAL_TOKEN_ID /
|
|
50
|
-
// MODAL_TOKEN_SECRET cannot be read here. Credentials must come from the
|
|
51
|
-
// environment config, which Paperclip stores as company secrets.
|
|
52
|
-
const tokenId = config.tokenId ?? "";
|
|
53
|
-
const tokenSecret = config.tokenSecret ?? "";
|
|
54
|
-
if (!tokenId && !tokenSecret)
|
|
55
|
-
return null;
|
|
56
|
-
if (!tokenId || !tokenSecret) {
|
|
57
|
-
throw new Error("Modal sandbox environments require both tokenId and tokenSecret to be configured.");
|
|
58
|
-
}
|
|
59
|
-
return { tokenId, tokenSecret };
|
|
60
|
-
}
|
|
61
|
-
function createModalClient(config) {
|
|
62
|
-
const auth = resolveAuth(config);
|
|
63
|
-
const params = {};
|
|
64
|
-
if (auth) {
|
|
65
|
-
params.tokenId = auth.tokenId;
|
|
66
|
-
params.tokenSecret = auth.tokenSecret;
|
|
67
|
-
}
|
|
68
|
-
if (config.environment) {
|
|
69
|
-
params.environment = config.environment;
|
|
70
|
-
}
|
|
71
|
-
return new ModalClient(params);
|
|
72
|
-
}
|
|
73
|
-
async function resolveApp(client, config) {
|
|
74
|
-
return await client.apps.fromName(config.appName, {
|
|
75
|
-
createIfMissing: true,
|
|
76
|
-
environment: config.environment ?? undefined,
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
function buildSandboxCreateParams(input) {
|
|
80
|
-
const params = {
|
|
81
|
-
workdir: input.config.workdir,
|
|
82
|
-
timeoutMs: input.config.sandboxTimeoutMs,
|
|
83
|
-
blockNetwork: input.config.blockNetwork,
|
|
84
|
-
};
|
|
85
|
-
if (input.config.idleTimeoutMs != null) {
|
|
86
|
-
params.idleTimeoutMs = input.config.idleTimeoutMs;
|
|
87
|
-
}
|
|
88
|
-
if (input.config.cidrAllowlist && input.config.cidrAllowlist.length > 0) {
|
|
89
|
-
params.cidrAllowlist = input.config.cidrAllowlist;
|
|
90
|
-
}
|
|
91
|
-
// Modal sandboxes accept tag metadata via setTags after creation; the create
|
|
92
|
-
// RPC does not take tags directly. We pass them through input so the caller
|
|
93
|
-
// can apply them after `create` resolves.
|
|
94
|
-
void input.tags;
|
|
95
|
-
return params;
|
|
96
|
-
}
|
|
97
|
-
function buildSandboxTags(input) {
|
|
98
|
-
return {
|
|
99
|
-
"paperclip-provider": "modal",
|
|
100
|
-
"paperclip-company-id": input.companyId,
|
|
101
|
-
"paperclip-environment-id": input.environmentId,
|
|
102
|
-
"paperclip-reuse-lease": input.reuseLease ? "true" : "false",
|
|
103
|
-
...(input.runId ? { "paperclip-run-id": input.runId } : {}),
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
async function createSandboxFor(client, app, config, tags) {
|
|
107
|
-
const image = client.images.fromRegistry(config.image);
|
|
108
|
-
const params = buildSandboxCreateParams({ config, tags });
|
|
109
|
-
const sandbox = await client.sandboxes.create(app, image, params);
|
|
110
|
-
try {
|
|
111
|
-
await sandbox.setTags(tags);
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
// setTags is best-effort metadata; surface but do not block lease creation.
|
|
115
|
-
console.warn(`Failed to set tags on Modal sandbox ${sandbox.sandboxId}: ${formatErrorMessage(error)}`);
|
|
116
|
-
}
|
|
117
|
-
return sandbox;
|
|
118
|
-
}
|
|
119
|
-
function leaseMetadata(input) {
|
|
120
|
-
return {
|
|
121
|
-
provider: "modal",
|
|
122
|
-
shellCommand: "sh",
|
|
123
|
-
sandboxId: input.sandbox.sandboxId,
|
|
124
|
-
appName: input.config.appName,
|
|
125
|
-
image: input.config.image,
|
|
126
|
-
sandboxTimeoutMs: input.config.sandboxTimeoutMs,
|
|
127
|
-
idleTimeoutMs: input.config.idleTimeoutMs,
|
|
128
|
-
reuseLease: input.config.reuseLease,
|
|
129
|
-
remoteCwd: input.remoteCwd,
|
|
130
|
-
resumedLease: input.resumedLease,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
function formatErrorMessage(error) {
|
|
134
|
-
return error instanceof Error ? error.message : String(error);
|
|
135
|
-
}
|
|
136
|
-
function shellQuote(value) {
|
|
137
|
-
return `'${value.replace(/'/g, `'"'"'`)}'`;
|
|
138
|
-
}
|
|
139
|
-
function isValidShellEnvKey(value) {
|
|
140
|
-
return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
|
|
141
|
-
}
|
|
142
|
-
// Modal's `sandbox.exec` takes an argv array and bypasses the shell entirely,
|
|
143
|
-
// so adapter probes that rely on PATH mutations from /etc/profile or ~/.bashrc
|
|
144
|
-
// do not work without an explicit profile source. Wrap the user command in a
|
|
145
|
-
// `sh -c` script that sources the common login profiles before it runs. The
|
|
146
|
-
// script sources no `nvm.sh`; the sandbox image supplies node on the PATH. The
|
|
147
|
-
// script sources the profiles itself, so a non-login shell (`sh -c`) is enough.
|
|
148
|
-
// Env is set after profile sourcing so caller env wins; stdin is staged to a
|
|
149
|
-
// temp file and shell-redirected so fast-failing commands do not race a
|
|
150
|
-
// streaming stdin writer.
|
|
151
|
-
function buildLoginShellScript(input) {
|
|
152
|
-
const env = input.env ?? {};
|
|
153
|
-
for (const key of Object.keys(env)) {
|
|
154
|
-
if (!isValidShellEnvKey(key)) {
|
|
155
|
-
throw new Error(`Invalid sandbox environment variable key: ${key}`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
const envArgs = Object.entries(env)
|
|
159
|
-
.filter((entry) => typeof entry[1] === "string")
|
|
160
|
-
.map(([key, value]) => `${key}=${shellQuote(value)}`);
|
|
161
|
-
const commandParts = [shellQuote(input.command), ...input.args.map(shellQuote)].join(" ");
|
|
162
|
-
const redirected = input.stdinPath
|
|
163
|
-
? `${commandParts} < ${shellQuote(input.stdinPath)}`
|
|
164
|
-
: commandParts;
|
|
165
|
-
const finalLine = envArgs.length > 0 ? `exec env ${envArgs.join(" ")} ${redirected}` : `exec ${redirected}`;
|
|
166
|
-
const lines = [
|
|
167
|
-
'if [ -f /etc/profile ]; then . /etc/profile >/dev/null 2>&1 || true; fi',
|
|
168
|
-
'if [ -f "$HOME/.profile" ]; then . "$HOME/.profile" >/dev/null 2>&1 || true; fi',
|
|
169
|
-
'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',
|
|
170
|
-
'if [ -f "$HOME/.zprofile" ]; then . "$HOME/.zprofile" >/dev/null 2>&1 || true; fi',
|
|
171
|
-
];
|
|
172
|
-
if (input.cwd) {
|
|
173
|
-
lines.push(`cd ${shellQuote(input.cwd)}`);
|
|
174
|
-
}
|
|
175
|
-
lines.push(finalLine);
|
|
176
|
-
return lines.join(" && ");
|
|
177
|
-
}
|
|
178
|
-
async function ensureRemoteWorkspace(sandbox, remoteCwd) {
|
|
179
|
-
// Use a one-shot exec to mkdir -p; Modal does not expose a direct
|
|
180
|
-
// filesystem mkdir helper and creating a file via `open()` does not create
|
|
181
|
-
// intermediate directories.
|
|
182
|
-
const proc = await sandbox.exec(["sh", "-lc", `mkdir -p ${shellQuote(remoteCwd)}`]);
|
|
183
|
-
const exitCode = await proc.wait();
|
|
184
|
-
if (exitCode !== 0) {
|
|
185
|
-
throw new Error(`Failed to create remote workspace directory '${remoteCwd}': mkdir exited with code ${exitCode}`);
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
async function stageStdin(sandbox, stdin, remotePath) {
|
|
189
|
-
const file = await sandbox.open(remotePath, "w");
|
|
190
|
-
try {
|
|
191
|
-
await file.write(new TextEncoder().encode(stdin));
|
|
192
|
-
await file.flush();
|
|
193
|
-
}
|
|
194
|
-
finally {
|
|
195
|
-
await file.close().catch(() => undefined);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
async function deleteStdinPath(sandbox, remotePath) {
|
|
199
|
-
// Best-effort cleanup of the staged stdin file. We swallow errors because
|
|
200
|
-
// it is fine for the file to outlive the sandbox if it is going to be
|
|
201
|
-
// terminated, and a missing rm tool would otherwise mask the real result.
|
|
202
|
-
try {
|
|
203
|
-
const proc = await sandbox.exec(["sh", "-lc", `rm -f ${shellQuote(remotePath)}`]);
|
|
204
|
-
await proc.wait();
|
|
205
|
-
}
|
|
206
|
-
catch {
|
|
207
|
-
// ignore
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
async function readProcessStreams(proc) {
|
|
211
|
-
const [stdout, stderr, exitCode] = await Promise.all([
|
|
212
|
-
proc.stdout.readText(),
|
|
213
|
-
proc.stderr.readText(),
|
|
214
|
-
proc.wait(),
|
|
215
|
-
]);
|
|
216
|
-
return { stdout, stderr, exitCode };
|
|
217
|
-
}
|
|
218
|
-
function isModalNotFound(error) {
|
|
219
|
-
return error instanceof NotFoundError;
|
|
220
|
-
}
|
|
221
|
-
async function getSandboxOrNull(client, providerLeaseId) {
|
|
222
|
-
try {
|
|
223
|
-
return await client.sandboxes.fromId(providerLeaseId);
|
|
224
|
-
}
|
|
225
|
-
catch (error) {
|
|
226
|
-
if (isModalNotFound(error))
|
|
227
|
-
return null;
|
|
228
|
-
throw error;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
function warnIfUnsupportedNode(logger) {
|
|
232
|
-
const major = Number.parseInt(process.versions.node.split(".")[0] ?? "0", 10);
|
|
233
|
-
if (Number.isFinite(major) && major < 24) {
|
|
234
|
-
const message = `Modal sandbox provider is running on Node ${process.versions.node}; Paperclip requires Node 24+. Upgrade the host runtime before using this plugin.`;
|
|
235
|
-
logger?.warn(message);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
function leaseRemoteCwd(metadata, fallback) {
|
|
239
|
-
if (metadata && typeof metadata.remoteCwd === "string" && metadata.remoteCwd.trim().length > 0) {
|
|
240
|
-
return metadata.remoteCwd.trim();
|
|
241
|
-
}
|
|
242
|
-
return fallback;
|
|
243
|
-
}
|
|
244
|
-
const plugin = definePlugin({
|
|
245
|
-
async setup(ctx) {
|
|
246
|
-
warnIfUnsupportedNode(ctx.logger);
|
|
247
|
-
ctx.logger.info("Modal sandbox provider plugin ready");
|
|
248
|
-
},
|
|
249
|
-
async onHealth() {
|
|
250
|
-
return { status: "ok", message: "Modal sandbox provider plugin healthy" };
|
|
251
|
-
},
|
|
252
|
-
async onEnvironmentValidateConfig(params) {
|
|
253
|
-
const config = parseDriverConfig(params.config);
|
|
254
|
-
const errors = [];
|
|
255
|
-
if (!config.appName) {
|
|
256
|
-
errors.push("Modal sandbox environments require an appName.");
|
|
257
|
-
}
|
|
258
|
-
if (!config.image) {
|
|
259
|
-
errors.push("Modal sandbox environments require an image reference.");
|
|
260
|
-
}
|
|
261
|
-
if (config.sandboxTimeoutMs < 1000 ||
|
|
262
|
-
config.sandboxTimeoutMs > MAX_SANDBOX_TIMEOUT_MS ||
|
|
263
|
-
!isMultipleOf1000(config.sandboxTimeoutMs)) {
|
|
264
|
-
errors.push("sandboxTimeoutMs must be a positive multiple of 1000 between 1000 and 86400000.");
|
|
265
|
-
}
|
|
266
|
-
if (config.idleTimeoutMs != null &&
|
|
267
|
-
(config.idleTimeoutMs < 1000 || !isMultipleOf1000(config.idleTimeoutMs))) {
|
|
268
|
-
errors.push("idleTimeoutMs must be a positive multiple of 1000 when provided.");
|
|
269
|
-
}
|
|
270
|
-
if (config.execTimeoutMs < 1000 || !isMultipleOf1000(config.execTimeoutMs)) {
|
|
271
|
-
errors.push("execTimeoutMs must be a positive multiple of 1000.");
|
|
272
|
-
}
|
|
273
|
-
if (config.blockNetwork && config.cidrAllowlist && config.cidrAllowlist.length > 0) {
|
|
274
|
-
errors.push("cidrAllowlist cannot be combined with blockNetwork.");
|
|
275
|
-
}
|
|
276
|
-
const hasTokenId = Boolean(config.tokenId);
|
|
277
|
-
const hasTokenSecret = Boolean(config.tokenSecret);
|
|
278
|
-
if (hasTokenId !== hasTokenSecret) {
|
|
279
|
-
errors.push("tokenId and tokenSecret must both be provided when either is set.");
|
|
280
|
-
}
|
|
281
|
-
else if (!hasTokenId) {
|
|
282
|
-
errors.push("Modal sandbox environments require tokenId and tokenSecret.");
|
|
283
|
-
}
|
|
284
|
-
if (errors.length > 0) {
|
|
285
|
-
return { ok: false, errors };
|
|
286
|
-
}
|
|
287
|
-
return { ok: true, normalizedConfig: { ...config } };
|
|
288
|
-
},
|
|
289
|
-
async onEnvironmentProbe(params) {
|
|
290
|
-
const config = parseDriverConfig(params.config);
|
|
291
|
-
const tags = buildSandboxTags({
|
|
292
|
-
companyId: params.companyId,
|
|
293
|
-
environmentId: params.environmentId,
|
|
294
|
-
reuseLease: false,
|
|
295
|
-
});
|
|
296
|
-
const client = createModalClient(config);
|
|
297
|
-
try {
|
|
298
|
-
const app = await resolveApp(client, config);
|
|
299
|
-
const sandbox = await createSandboxFor(client, app, config, tags);
|
|
300
|
-
try {
|
|
301
|
-
await ensureRemoteWorkspace(sandbox, config.workdir);
|
|
302
|
-
const proc = await sandbox.exec(["sh", "-lc", "printf paperclip-probe"]);
|
|
303
|
-
const { stdout, exitCode } = await readProcessStreams(proc);
|
|
304
|
-
if (exitCode !== 0 || stdout.trim() !== "paperclip-probe") {
|
|
305
|
-
return {
|
|
306
|
-
ok: false,
|
|
307
|
-
summary: `Modal sandbox probe failed: exit ${exitCode}, stdout=${JSON.stringify(stdout)}`,
|
|
308
|
-
metadata: {
|
|
309
|
-
provider: "modal",
|
|
310
|
-
sandboxId: sandbox.sandboxId,
|
|
311
|
-
appName: config.appName,
|
|
312
|
-
image: config.image,
|
|
313
|
-
},
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
return {
|
|
317
|
-
ok: true,
|
|
318
|
-
summary: `Connected to Modal sandbox in app ${config.appName}.`,
|
|
319
|
-
metadata: {
|
|
320
|
-
provider: "modal",
|
|
321
|
-
sandboxId: sandbox.sandboxId,
|
|
322
|
-
appName: config.appName,
|
|
323
|
-
image: config.image,
|
|
324
|
-
workdir: config.workdir,
|
|
325
|
-
sandboxTimeoutMs: config.sandboxTimeoutMs,
|
|
326
|
-
idleTimeoutMs: config.idleTimeoutMs,
|
|
327
|
-
reuseLease: config.reuseLease,
|
|
328
|
-
remoteCwd: config.workdir,
|
|
329
|
-
},
|
|
330
|
-
};
|
|
331
|
-
}
|
|
332
|
-
finally {
|
|
333
|
-
await sandbox.terminate().catch(() => undefined);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
catch (error) {
|
|
337
|
-
return {
|
|
338
|
-
ok: false,
|
|
339
|
-
summary: "Modal sandbox probe failed.",
|
|
340
|
-
metadata: {
|
|
341
|
-
provider: "modal",
|
|
342
|
-
appName: config.appName,
|
|
343
|
-
image: config.image,
|
|
344
|
-
reuseLease: config.reuseLease,
|
|
345
|
-
error: formatErrorMessage(error),
|
|
346
|
-
},
|
|
347
|
-
};
|
|
348
|
-
}
|
|
349
|
-
finally {
|
|
350
|
-
client.close();
|
|
351
|
-
}
|
|
352
|
-
},
|
|
353
|
-
async onEnvironmentAcquireLease(params) {
|
|
354
|
-
const config = parseDriverConfig(params.config);
|
|
355
|
-
const client = createModalClient(config);
|
|
356
|
-
try {
|
|
357
|
-
const app = await resolveApp(client, config);
|
|
358
|
-
const tags = buildSandboxTags({
|
|
359
|
-
companyId: params.companyId,
|
|
360
|
-
environmentId: params.environmentId,
|
|
361
|
-
runId: params.runId,
|
|
362
|
-
reuseLease: config.reuseLease,
|
|
363
|
-
});
|
|
364
|
-
const sandbox = await createSandboxFor(client, app, config, tags);
|
|
365
|
-
try {
|
|
366
|
-
await ensureRemoteWorkspace(sandbox, config.workdir);
|
|
367
|
-
return {
|
|
368
|
-
providerLeaseId: sandbox.sandboxId,
|
|
369
|
-
metadata: leaseMetadata({
|
|
370
|
-
config,
|
|
371
|
-
sandbox,
|
|
372
|
-
remoteCwd: config.workdir,
|
|
373
|
-
resumedLease: false,
|
|
374
|
-
}),
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
catch (error) {
|
|
378
|
-
await sandbox.terminate().catch(() => undefined);
|
|
379
|
-
throw error;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
finally {
|
|
383
|
-
// Keep the client open for the lease lifetime is unnecessary; subsequent
|
|
384
|
-
// calls construct their own client. Close the local handle to free
|
|
385
|
-
// grpc resources.
|
|
386
|
-
client.close();
|
|
387
|
-
}
|
|
388
|
-
},
|
|
389
|
-
async onEnvironmentResumeLease(params) {
|
|
390
|
-
const config = parseDriverConfig(params.config);
|
|
391
|
-
const client = createModalClient(config);
|
|
392
|
-
try {
|
|
393
|
-
const sandbox = await getSandboxOrNull(client, params.providerLeaseId);
|
|
394
|
-
if (!sandbox) {
|
|
395
|
-
return { providerLeaseId: null, metadata: { expired: true } };
|
|
396
|
-
}
|
|
397
|
-
try {
|
|
398
|
-
await ensureRemoteWorkspace(sandbox, config.workdir);
|
|
399
|
-
return {
|
|
400
|
-
providerLeaseId: sandbox.sandboxId,
|
|
401
|
-
metadata: leaseMetadata({ config, sandbox, remoteCwd: config.workdir, resumedLease: true }),
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
catch (error) {
|
|
405
|
-
// If we just resumed and workspace setup blew up, treat as a lease
|
|
406
|
-
// failure rather than silently terminating the user's reusable
|
|
407
|
-
// sandbox. Detach so the sandbox is not killed for a transient setup
|
|
408
|
-
// error.
|
|
409
|
-
void sandbox.detach();
|
|
410
|
-
throw error;
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
finally {
|
|
414
|
-
client.close();
|
|
415
|
-
}
|
|
416
|
-
},
|
|
417
|
-
async onEnvironmentReleaseLease(params) {
|
|
418
|
-
if (!params.providerLeaseId)
|
|
419
|
-
return;
|
|
420
|
-
const config = parseDriverConfig(params.config);
|
|
421
|
-
const client = createModalClient(config);
|
|
422
|
-
try {
|
|
423
|
-
const sandbox = await getSandboxOrNull(client, params.providerLeaseId);
|
|
424
|
-
if (!sandbox)
|
|
425
|
-
return;
|
|
426
|
-
if (config.reuseLease) {
|
|
427
|
-
// Modal has no separate pause primitive. Detaching releases the local
|
|
428
|
-
// grpc connection but leaves the sandbox running on Modal until its
|
|
429
|
-
// configured sandboxTimeoutMs or idleTimeoutMs expires. The next
|
|
430
|
-
// acquire/resume reconnects via sandboxes.fromId(providerLeaseId).
|
|
431
|
-
void sandbox.detach();
|
|
432
|
-
return;
|
|
433
|
-
}
|
|
434
|
-
await sandbox.terminate();
|
|
435
|
-
}
|
|
436
|
-
finally {
|
|
437
|
-
client.close();
|
|
438
|
-
}
|
|
439
|
-
},
|
|
440
|
-
async onEnvironmentDestroyLease(params) {
|
|
441
|
-
if (!params.providerLeaseId)
|
|
442
|
-
return;
|
|
443
|
-
const config = parseDriverConfig(params.config);
|
|
444
|
-
const client = createModalClient(config);
|
|
445
|
-
try {
|
|
446
|
-
const sandbox = await getSandboxOrNull(client, params.providerLeaseId);
|
|
447
|
-
if (!sandbox)
|
|
448
|
-
return;
|
|
449
|
-
await sandbox.terminate();
|
|
450
|
-
}
|
|
451
|
-
finally {
|
|
452
|
-
client.close();
|
|
453
|
-
}
|
|
454
|
-
},
|
|
455
|
-
async onEnvironmentRealizeWorkspace(params) {
|
|
456
|
-
const config = parseDriverConfig(params.config);
|
|
457
|
-
const fallback = params.workspace.remotePath ??
|
|
458
|
-
params.workspace.localPath ??
|
|
459
|
-
config.workdir;
|
|
460
|
-
const remoteCwd = leaseRemoteCwd(params.lease.metadata, fallback);
|
|
461
|
-
if (params.lease.providerLeaseId) {
|
|
462
|
-
const client = createModalClient(config);
|
|
463
|
-
try {
|
|
464
|
-
const sandbox = await getSandboxOrNull(client, params.lease.providerLeaseId);
|
|
465
|
-
if (sandbox) {
|
|
466
|
-
await ensureRemoteWorkspace(sandbox, remoteCwd);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
finally {
|
|
470
|
-
client.close();
|
|
471
|
-
}
|
|
472
|
-
}
|
|
473
|
-
return {
|
|
474
|
-
cwd: remoteCwd,
|
|
475
|
-
metadata: { provider: "modal", remoteCwd },
|
|
476
|
-
};
|
|
477
|
-
},
|
|
478
|
-
async onEnvironmentExecute(params) {
|
|
479
|
-
if (!params.lease.providerLeaseId) {
|
|
480
|
-
return {
|
|
481
|
-
exitCode: 1,
|
|
482
|
-
timedOut: false,
|
|
483
|
-
stdout: "",
|
|
484
|
-
stderr: "No provider lease ID available for execution.",
|
|
485
|
-
};
|
|
486
|
-
}
|
|
487
|
-
const config = parseDriverConfig(params.config);
|
|
488
|
-
const client = createModalClient(config);
|
|
489
|
-
const callerTimeoutMs = params.timeoutMs != null && Number.isFinite(params.timeoutMs) && params.timeoutMs > 0
|
|
490
|
-
? Math.max(1000, Math.trunc(params.timeoutMs / 1000) * 1000)
|
|
491
|
-
: config.execTimeoutMs;
|
|
492
|
-
try {
|
|
493
|
-
const sandbox = await getSandboxOrNull(client, params.lease.providerLeaseId);
|
|
494
|
-
if (!sandbox) {
|
|
495
|
-
return {
|
|
496
|
-
exitCode: 1,
|
|
497
|
-
timedOut: false,
|
|
498
|
-
stdout: "",
|
|
499
|
-
stderr: "Modal sandbox lease is no longer available.\n",
|
|
500
|
-
};
|
|
501
|
-
}
|
|
502
|
-
const stdinPath = params.stdin != null
|
|
503
|
-
? `/tmp/paperclip-stdin-${Date.now()}-${Math.random().toString(36).slice(2, 10)}`
|
|
504
|
-
: null;
|
|
505
|
-
try {
|
|
506
|
-
if (stdinPath && params.stdin != null) {
|
|
507
|
-
await stageStdin(sandbox, params.stdin, stdinPath);
|
|
508
|
-
}
|
|
509
|
-
const script = buildLoginShellScript({
|
|
510
|
-
command: params.command,
|
|
511
|
-
args: params.args ?? [],
|
|
512
|
-
cwd: params.cwd ?? config.workdir,
|
|
513
|
-
env: params.env,
|
|
514
|
-
stdinPath: stdinPath ?? undefined,
|
|
515
|
-
});
|
|
516
|
-
const proc = await sandbox.exec(["sh", "-c", script], {
|
|
517
|
-
timeoutMs: callerTimeoutMs,
|
|
518
|
-
stdout: "pipe",
|
|
519
|
-
stderr: "pipe",
|
|
520
|
-
});
|
|
521
|
-
const { stdout, stderr, exitCode } = await readProcessStreams(proc);
|
|
522
|
-
return {
|
|
523
|
-
exitCode,
|
|
524
|
-
timedOut: false,
|
|
525
|
-
stdout,
|
|
526
|
-
stderr,
|
|
527
|
-
};
|
|
528
|
-
}
|
|
529
|
-
catch (error) {
|
|
530
|
-
if (error instanceof TimeoutError || error instanceof SandboxTimeoutError) {
|
|
531
|
-
return {
|
|
532
|
-
exitCode: null,
|
|
533
|
-
timedOut: true,
|
|
534
|
-
stdout: "",
|
|
535
|
-
stderr: `${formatErrorMessage(error)}\n`,
|
|
536
|
-
};
|
|
537
|
-
}
|
|
538
|
-
throw error;
|
|
539
|
-
}
|
|
540
|
-
finally {
|
|
541
|
-
if (stdinPath) {
|
|
542
|
-
await deleteStdinPath(sandbox, stdinPath);
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
finally {
|
|
547
|
-
client.close();
|
|
548
|
-
}
|
|
549
|
-
},
|
|
550
|
-
});
|
|
551
|
-
export default plugin;
|
|
552
|
-
//# sourceMappingURL=plugin.js.map
|
package/dist/plugin.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,YAAY,GAKb,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAiBpE,MAAM,eAAe,GAAG,sBAAsB,CAAC;AAC/C,MAAM,0BAA0B,GAAG,SAAS,CAAC;AAC7C,MAAM,uBAAuB,GAAG,OAAO,CAAC;AACxC,MAAM,sBAAsB,GAAG,UAAU,CAAC;AAiB1C,SAAS,mBAAmB,CAAC,KAAc;IACzC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE;QAAE,OAAO,IAAI,CAAC;IAC/C,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACjD,CA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;gBACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,EAAE;oBACpD,SAAS,EAAE,eAAe;oBAC1B,MAAM,EAAE,MAAM;oBACd,MAAM,EAAE,MAAM;iBACf,CAAC,CAAC;gBACH,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,CAAC;gBACpE,OAAO;oBACL,QAAQ;oBACR,QAAQ,EAAE,KAAK;oBACf,MAAM;oBACN,MAAM;iBACP,CAAC;YACJ,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,KAAK,YAAY,YAAY,IAAI,KAAK,YAAY,mBAAmB,EAAE,CAAC;oBAC1E,OAAO;wBACL,QAAQ,EAAE,IAAI;wBACd,QAAQ,EAAE,IAAI;wBACd,MAAM,EAAE,EAAE;wBACV,MAAM,EAAE,GAAG,kBAAkB,CAAC,KAAK,CAAC,IAAI;qBACzC,CAAC;gBACJ,CAAC;gBACD,MAAM,KAAK,CAAC;YACd,CAAC;oBAAS,CAAC;gBACT,IAAI,SAAS,EAAE,CAAC;oBACd,MAAM,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,eAAe,MAAM,CAAC"}
|
package/dist/worker.d.ts
DELETED
package/dist/worker.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
package/dist/worker.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,eAAe,MAAM,CAAC;AACtB,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC"}
|