History

deno

Rhys Sullivan committed 8 months ago

Commit 51503051 parent 03444f43 files · +15 −42Browse files

Unified · Split

3 files
  1. apps/executor/package.json +0 −2
  2. apps/executor/src/cli/main.ts +15 −38
  3. bun.lock +0 −2
apps/executor/package.json+0−2
@@ -42,8 +42,6 @@ · 41 unmodified lines
4242 "@executor-v3/codemode-core": "workspace:*",
4343 "@executor-v3/control-plane": "workspace:*",
4444 "@executor-v3/server": "workspace:*",
45− "@executor-v3/runtime-local-inproc": "workspace:*",
46− "@executor-v3/runtime-deno-subprocess": "workspace:*",
4745 "effect": "catalog:"
4846 },
4947 "devDependencies": {
apps/executor/src/cli/main.ts+15−38
@@ -22,7 +22,7 @@ import { · 21 unmodified lines
2222 type SqlControlPlaneRuntime,
2323 } from "@executor-v3/control-plane";
2424 import type { ToolCatalog } from "@executor-v3/codemode-core";
25−import { isDenoAvailable } from "@executor-v3/runtime-deno-subprocess";
25+
2626 import * as Effect from "effect/Effect";
2727 import * as Schema from "effect/Schema";
2828 import * as Option from "effect/Option";
@@ -1188,27 +1188,11 @@ const getDenoVersion = (): Effect.Effect<string | null, never, never> => · 1159 unmodified lines
11881188 catch: () => null,
11891189 }).pipe(Effect.catchAll(() => Effect.succeed(null)));
11901190
1191−const installDeno = (): Effect.Effect<boolean, Error, never> =>
1192− Effect.tryPromise({
1193− try: () =>
1194− new Promise<boolean>((resolve, reject) => {
1195− const child = spawn("sh", ["-c", "curl -fsSL https://deno.land/install.sh | sh"], {
1196− stdio: ["ignore", "inherit", "inherit"],
1197− });
1198−
1199− child.once("error", (err) => reject(err));
1200− child.once("close", (code) => resolve(code === 0));
1201− }),
1202− catch: toError,
1203− });
1204−
12051191 const sandboxCommand = Command.make(
12061192 "sandbox",
12071193 {},
12081194 () =>
12091195 Effect.gen(function* () {
1210− yield* printText("Checking Deno sandbox runtime...");
1211−
12121196 const version = yield* getDenoVersion();
12131197
12141198 if (version !== null) {
@@ -1216,29 +1200,22 @@ const sandboxCommand = Command.make( · 1 unmodified line
12161200 return;
12171201 }
12181202
1219− if (!isDenoAvailable()) {
1220− yield* printText("Deno is not installed. Installing...");
1221− } else {
1222− yield* printText("Deno binary found but did not respond. Reinstalling...");
1223− }
1224−
1225− const installed = yield* installDeno();
1226− if (!installed) {
1227− return yield* Effect.fail(
1228− new Error("Deno installation failed. Install manually: https://docs.deno.com/runtime/getting_started/installation/"),
1229− );
1230− }
1231−
1232− const postVersion = yield* getDenoVersion();
1233− if (postVersion === null) {
1234− return yield* Effect.fail(
1235− new Error("Deno was installed but could not be verified. You may need to restart your shell."),
1236− );
1237− }
1203+ yield* printText(
1204+ [
1205+ "Deno is not installed.",
1206+ "",
1207+ "The executor sandbox requires Deno to run code in a secure, isolated subprocess.",
1208+ "",
1209+ "Install Deno:",
1210+ " curl -fsSL https://deno.land/install.sh | sh",
1211+ "",
1212+ "Or see: https://docs.deno.com/runtime/getting_started/installation/",
1213+ ].join("\n"),
1214+ );
12381215
1239− yield* printText(`Deno sandbox installed successfully (deno ${postVersion}).`);
1216+ process.exitCode = 1;
12401217 }),
1241−).pipe(Command.withDescription("Check and install the Deno sandbox runtime"));
1218+).pipe(Command.withDescription("Check whether the Deno sandbox runtime is available"));
12421219
12431220
12441221 const callCommand = Command.make(
bun.lock+0−2
@@ -22,8 +22,6 @@ · 21 unmodified lines
2222 "@effect/platform-node": "catalog:",
2323 "@executor-v3/codemode-core": "workspace:*",
2424 "@executor-v3/control-plane": "workspace:*",
25− "@executor-v3/runtime-deno-subprocess": "workspace:*",
26− "@executor-v3/runtime-local-inproc": "workspace:*",
2725 "@executor-v3/server": "workspace:*",
2826 "effect": "catalog:",
2927 },