Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

build-cli-archive.ts

549 lines21.2 KB

1#!/usr/bin/env node
2/** Runtime archives must run without host Node, npm, or compilers. */
3import * as NodeRuntime from "@effect/platform-node/NodeRuntime";
4import * as NodeServices from "@effect/platform-node/NodeServices";
5import * as Config from "effect/Config";
6import * as Effect from "effect/Effect";
7import * as FileSystem from "effect/FileSystem";
8import * as Layer from "effect/Layer";
9import * as Logger from "effect/Logger";
10import * as Option from "effect/Option";
11import * as Path from "effect/Path";
12import * as PlatformError from "effect/PlatformError";
13import * as Schema from "effect/Schema";
14import { Command, Flag } from "effect/cli";
15import { ChildProcess, ChildProcessSpawner } from "effect/process";
16​
17import * as HostProcess from "@t3tools/shared/HostProcess";
18import { fromYaml } from "@t3tools/shared/schemaYaml";
19import { resolveSpawnCommand } from "@t3tools/shared/shell";
20import rootPackageJson from "../package.json" with { type: "json" };
21import serverPackageJson from "../apps/server/package.json" with { type: "json" };
22​
23import {
24 createStagePatchedDependencies,
25 createStageWorkspaceConfig,
26 resolveFffNativeDependencies,
27 STAGE_INSTALL_ARGS,
28} from "./build-desktop-artifact.ts";
29import { assertLinuxArm64PageCompatibility } from "./lib/linux-arm64-sea.ts";
30import { selectCliRuntimeExternalDependencies } from "./lib/cli-external-packages.ts";
31import { signWithJsign } from "./lib/windows-jsign.ts";
32import { windowsSystemTar } from "./lib/windows-tar.ts";
33import { resolveCatalogDependencies } from "./lib/resolve-catalog.ts";
34​
35const BuildPlatform = Schema.Literals(["mac", "linux", "win"]);
36const BuildArch = Schema.Literals(["arm64", "x64"]);
37type BuildPlatform = typeof BuildPlatform.Type;
38type BuildArch = typeof BuildArch.Type;
39​
40const WorkspaceConfig = Schema.Struct({
41 catalog: Schema.optional(Schema.Record(Schema.String, Schema.String)),
42 overrides: Schema.optional(Schema.Record(Schema.String, Schema.String)),
43 patchedDependencies: Schema.optional(Schema.Record(Schema.String, Schema.String)),
44 allowBuilds: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)),
45});
46const decodeWorkspaceConfig = Schema.decodeEffect(fromYaml(WorkspaceConfig));
47const encodeJsonString = Schema.encodeEffect(Schema.fromJsonString(Schema.Unknown));
48const StageWorkspaceConfig = Schema.Struct({
49 supportedArchitectures: Schema.Struct({
50 os: Schema.Array(Schema.String),
51 cpu: Schema.Array(Schema.String),
52 libc: Schema.optional(Schema.Array(Schema.String)),
53 }),
54 allowBuilds: Schema.optional(Schema.Record(Schema.String, Schema.Boolean)),
55 patchedDependencies: Schema.optional(Schema.Record(Schema.String, Schema.String)),
56 overrides: Schema.optional(Schema.Record(Schema.String, Schema.String)),
57 nodeLinker: Schema.optional(Schema.Literals(["hoisted"])),
58});
59const encodeStageWorkspaceConfig = Schema.encodeEffect(fromYaml(StageWorkspaceConfig));
60​
61const RepoRoot = Effect.service(Path.Path).pipe(
62 Effect.flatMap((path) => path.fromFileUrl(new URL("..", import.meta.url))),
63);
64​
65export class CliArchiveCommandFailedError extends Schema.TaggedError<CliArchiveCommandFailedError>()(
66 "CliArchiveCommandFailedError",
67 { command: Schema.String, exitCode: Schema.Int },
68) {
69 override get message(): string {
70 return `${this.command} exited with code ${this.exitCode}.`;
71 }
73​
74export class CliArchiveInputMissingError extends Schema.TaggedError<CliArchiveInputMissingError>()(
75 "CliArchiveInputMissingError",
76 { inputPath: Schema.String, hint: Schema.String },
77) {
78 override get message(): string {
79 return `Missing ${this.inputPath}. ${this.hint}`;
80 }
82​
83export function cliArchivePlatformKey(platform: BuildPlatform, arch: BuildArch): string {
84 const nodePlatform = platform === "mac" ? "darwin" : platform === "win" ? "win32" : "linux";
85 return `${nodePlatform}-${arch}`;
87​
88export function cliArchiveStem(version: string, platform: BuildPlatform, arch: BuildArch): string {
89 return `t3-${version}-${cliArchivePlatformKey(platform, arch)}`;
91​
92export function cliArchiveFileName(version: string, platform: BuildPlatform, arch: BuildArch) {
93 // Minimal hosts may lack xz, but tar and Node zlib handle gzip without it.
94 return `${cliArchiveStem(version, platform, arch)}.${platform === "win" ? "zip" : "tar.gz"}`;
96​
97const runCommand = Effect.fn("runCommand")(function* (
98 command: ChildProcess.Command,
99 label: string,
100) {
101 const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
102 const child = yield* spawner.spawn(
103 ChildProcess.isStandardCommand(command)
104 ? ChildProcess.make(command.command, command.args, {
105 ...command.options,
106 stdout: "inherit",
107 stderr: "inherit",
108 })
109 : command,
110 );
111 const exitCode = Number(yield* child.exitCode);
112 if (exitCode !== 0) {
113 return yield* new CliArchiveCommandFailedError({ command: label, exitCode });
114 }
115});
116​
117const requireInput = Effect.fn("requireInput")(function* (inputPath: string, hint: string) {
118 const fs = yield* FileSystem.FileSystem;
119 if (!(yield* fs.exists(inputPath))) {
120 return yield* new CliArchiveInputMissingError({ inputPath, hint });
121 }
122});
123​
124/** Installed runtimes cannot rely on pnpm's store layout surviving archival. */
125const stageRuntimeExternals = Effect.fn("stageRuntimeExternals")(function* (input: {
126 readonly repoRoot: string;
127 readonly stageDir: string;
128 readonly platform: BuildPlatform;
129 readonly arch: BuildArch;
130 readonly version: string;
131}) {
132 const fs = yield* FileSystem.FileSystem;
133 const path = yield* Path.Path;
134 const workspace = yield* decodeWorkspaceConfig(
135 yield* fs.readFileString(path.join(input.repoRoot, "pnpm-workspace.yaml")),
136 );
137 const catalog = workspace.catalog ?? {};
138 const serverDependencies = resolveCatalogDependencies(
139 serverPackageJson.dependencies,
140 catalog,
141 "apps/server",
142 );
143 const fffNodeVersion = serverDependencies["@ff-labs/fff-node"];
144 if (fffNodeVersion === undefined) {
145 return yield* new CliArchiveInputMissingError({
146 inputPath: "apps/server/package.json#dependencies['@ff-labs/fff-node']",
147 hint: "The archive stages fff's platform binary from this version.",
148 });
149 }
150 const dependencies = {
151 ...selectCliRuntimeExternalDependencies(serverDependencies),
152 ...resolveFffNativeDependencies(input.platform, input.arch, fffNodeVersion),
153 };
154 const patchedDependencies = createStagePatchedDependencies(
155 workspace.patchedDependencies ?? {},
156 dependencies,
157 );
158​
159 yield* fs.writeFileString(
160 path.join(input.stageDir, "package.json"),
161 `${yield* encodeJsonString({
162 name: "t3-runtime",
163 version: input.version,
164 private: true,
165 packageManager: rootPackageJson.packageManager,
166 dependencies,
167 })}\n`,
168 );
169 yield* fs.writeFileString(
170 path.join(input.stageDir, "pnpm-workspace.yaml"),
171 yield* encodeStageWorkspaceConfig({
172 ...createStageWorkspaceConfig({
173 platform: input.platform,
174 arch: input.arch,
175 ...(workspace.allowBuilds ? { allowBuilds: workspace.allowBuilds } : {}),
176 patchedDependencies,
177 overrides: resolveCatalogDependencies(workspace.overrides ?? {}, catalog, "apps/server"),
178 }),
179 nodeLinker: "hoisted",
180 }),
181 );
182 if (Object.keys(patchedDependencies).length > 0) {
183 yield* fs.copy(path.join(input.repoRoot, "patches"), path.join(input.stageDir, "patches"));
184 }
185​
186 const install = yield* resolveSpawnCommand("vp", [...STAGE_INSTALL_ARGS]);
187 yield* runCommand(
188 ChildProcess.make(install.command, install.args, {
189 cwd: input.stageDir,
190 shell: install.shell,
191 stdout: "inherit",
192 stderr: "inherit",
193 }),
194 "vp install --prod (cli archive runtime externals)",
195 );
196​
197 const platformKey = cliArchivePlatformKey(input.platform, input.arch);
198 const prebuildsDir = path.join(input.stageDir, "node_modules/node-pty/prebuilds");
199 const foreignPrebuilds = (yield* fs
200 .readDirectory(prebuildsDir)
201 .pipe(Effect.orElseSucceed((): ReadonlyArray<string> => []))).filter(
202 (entry) => entry !== platformKey,
203 );
204 for (const entry of [
205 "package.json",
206 "pnpm-workspace.yaml",
207 "pnpm-lock.yaml",
208 "patches",
209 "node_modules/.pnpm",
210 "node_modules/.modules.yaml",
211 "node_modules/.pnpm-workspace-state-v1.json",
212 "node_modules/.bin",
213 ...foreignPrebuilds.map((entry) => `node_modules/node-pty/prebuilds/${entry}`),
214 ]) {
215 yield* fs.remove(path.join(input.stageDir, entry), { recursive: true, force: true });
216 }
217 // Nested .bin shims are unused symlinks, which the npm registry rejects in tarballs.
218 yield* removeNestedBinDirectories(fs, path, path.join(input.stageDir, "node_modules"));
219});
220​
221const removeNestedBinDirectories = Effect.fn("build-cli-archive.removeNestedBinDirectories")(
222 function* (
223 fs: FileSystem.FileSystem,
224 path: Path.Path,
225 root: string,
226 ): Effect.fn.Return<void, PlatformError.PlatformError> {
227 const entries = yield* fs.readDirectory(root).pipe(Effect.orElseSucceed(() => []));
228 for (const entry of entries) {
229 const child = path.join(root, entry);
230 if (entry === ".bin") {
231 yield* fs.remove(child, { recursive: true, force: true });
232 continue;
233 }
234 const info = yield* fs.stat(child).pipe(Effect.option);
235 if (Option.isSome(info) && info.value.type === "Directory") {
236 yield* removeNestedBinDirectories(fs, path, child);
237 }
238 }
239 },
240);
241​
242const stageWebClient = Effect.fn("stageWebClient")(function* (source: string, target: string) {
243 const fs = yield* FileSystem.FileSystem;
244 const path = yield* Path.Path;
245 yield* fs.copy(source, target);
246 const maps = (yield* fs.readDirectory(target, { recursive: true })).filter((entry) =>
247 entry.endsWith(".map"),
248 );
249 for (const entry of maps) {
250 yield* fs.remove(path.join(target, entry), { force: true });
251 }
252});
253​
254const MacSigningConfig = Config.all({
255 identity: Config.String("T3CODE_CLI_MAC_SIGN_IDENTITY").pipe(Config.option),
256 appleApiKey: Config.String("APPLE_API_KEY").pipe(Config.option),
257 appleApiKeyId: Config.String("APPLE_API_KEY_ID").pipe(Config.option),
258 appleApiIssuer: Config.String("APPLE_API_ISSUER").pipe(Config.option),
259});
260​
261/** Apple Silicon requires signed binaries; notarization's hardened runtime also requires every native addon signed. */
262const signMacArchiveContents = Effect.fn("signMacArchiveContents")(function* (input: {
263 readonly repoRoot: string;
264 readonly contentDir: string;
265 readonly executablePath: string;
266}) {
267 const fs = yield* FileSystem.FileSystem;
268 const path = yield* Path.Path;
269 const signing = yield* MacSigningConfig;
270 const identity = Option.getOrUndefined(signing.identity)?.trim() || "-";
271​
272 const entitlements = path.join(input.repoRoot, "apps/server/resources/cli-entitlements.plist");
273 const libraries = (yield* fs.readDirectory(input.contentDir, { recursive: true }))
274 .filter(
275 (entry) =>
276 entry.endsWith(".node") ||
277 entry.endsWith(".dylib") ||
278 entry.endsWith("spawn-helper") ||
279 entry.endsWith("t3-resource-monitor"),
280 )
281 .map((entry) => path.join(input.contentDir, entry));
282​
283 for (const target of [...libraries, input.executablePath]) {
284 yield* runCommand(
285 ChildProcess.make("codesign", [
286 "--force",
287 "--sign",
288 identity,
289 ...(identity === "-" ? [] : ["--options", "runtime", "--timestamp"]),
290 ...(target === input.executablePath ? ["--entitlements", entitlements] : []),
291 target,
292 ]),
293 `codesign ${path.relative(input.contentDir, target)}`,
294 );
295 }
296 if (identity === "-") {
297 yield* Effect.log("[cli-archive] Signed ad hoc (no T3CODE_CLI_MAC_SIGN_IDENTITY).");
298 return;
299 }
300​
301 const apiKey = Option.getOrUndefined(signing.appleApiKey);
302 const apiKeyId = Option.getOrUndefined(signing.appleApiKeyId);
303 const apiIssuer = Option.getOrUndefined(signing.appleApiIssuer);
304 if (!apiKey || !apiKeyId || !apiIssuer) {
305 yield* Effect.logWarning(
306 "[cli-archive] Developer ID signed but not notarized (missing APPLE_API_KEY*).",
307 );
308 return;
309 }
310 // notarytool requires an archive; bare executables rely on online tickets because they cannot be stapled.
311 const notarizeZip = path.join(path.dirname(input.executablePath), ".notarize-t3.zip");
312 yield* runCommand(
313 ChildProcess.make("ditto", ["-c", "-k", "--keepParent", input.executablePath, notarizeZip]),
314 "ditto (notarization zip)",
315 );
316 yield* runCommand(
317 ChildProcess.make("xcrun", [
318 "notarytool",
319 "submit",
320 notarizeZip,
321 "--key",
322 apiKey,
323 "--key-id",
324 apiKeyId,
325 "--issuer",
326 apiIssuer,
327 "--wait",
328 ]),
329 "notarytool submit",
330 ).pipe(Effect.ensuring(fs.remove(notarizeZip, { force: true }).pipe(Effect.ignore)));
331 yield* Effect.log("[cli-archive] Notarized t3.");
332});
333​
334const WindowsSigningConfig = Config.all({
335 endpoint: Config.String("AZURE_TRUSTED_SIGNING_ENDPOINT").pipe(Config.option),
336 accountName: Config.String("AZURE_TRUSTED_SIGNING_ACCOUNT_NAME").pipe(Config.option),
337 certificateProfileName: Config.String("AZURE_TRUSTED_SIGNING_CERTIFICATE_PROFILE_NAME").pipe(
338 Config.option,
339 ),
340});
341​
342/** Node's Windows --build-sea leaves a stale Authenticode offset pointing into rebuilt resources instead of certificates. */
343const stripStaleAuthenticodeEntry = Effect.fn("stripStaleAuthenticodeEntry")(function* (
344 executablePath: string,
345) {
346 const fs = yield* FileSystem.FileSystem;
347 const bytes = yield* fs.readFile(executablePath);
348 const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
349 const peOffset = view.getUint32(0x3c, true);
350 if (view.getUint32(peOffset, true) !== 0x00004550) {
351 return yield* new CliArchiveInputMissingError({
352 inputPath: executablePath,
353 hint: "Expected a PE executable to strip the stale signature entry from.",
354 });
355 }
356 const optionalHeader = peOffset + 24;
357 const magic = view.getUint16(optionalHeader, true);
358 // PE data directories start at +112 (PE32+) or +96 (PE32); index 4 holds the certificate offset and size.
359 const securityEntry = optionalHeader + (magic === 0x20b ? 112 : 96) + 4 * 8;
360 const offset = view.getUint32(securityEntry, true);
361 const size = view.getUint32(securityEntry + 4, true);
362 if (offset === 0 && size === 0) return;
363 if (offset + size === bytes.byteLength) {
364 // Let signtool replace intact certificate tables ending at EOF.
365 return;
366 }
367 view.setUint32(securityEntry, 0, true);
368 view.setUint32(securityEntry + 4, 0, true);
369 yield* fs.writeFile(executablePath, bytes);
370 yield* Effect.log(
371 `[cli-archive] Cleared the stale Authenticode entry (offset ${String(offset)}, size ${String(size)}) left by --build-sea.`,
372 );
373});
374​
375const signWindowsExecutable = Effect.fn("signWindowsExecutable")(function* (
376 executablePath: string,
377) {
378 const signing = yield* WindowsSigningConfig;
379 const endpoint = Option.getOrUndefined(signing.endpoint);
380 const accountName = Option.getOrUndefined(signing.accountName);
381 const profile = Option.getOrUndefined(signing.certificateProfileName);
382 if (!endpoint || !accountName || !profile) {
383 yield* Effect.log("[cli-archive] Windows signing disabled (missing Azure Trusted Signing).");
384 return;
385 }
386 yield* stripStaleAuthenticodeEntry(executablePath);
387 if ((yield* HostProcess.Platform) !== "win32") {
388 yield* signWithJsign(executablePath);
389 yield* Effect.log("[cli-archive] Signed t3.exe (Azure Trusted Signing via jsign).");
390 return;
391 }
392 const quote = (value: string) => `'${value.replaceAll("'", "''")}'`;
393 const script = [
394 "$ErrorActionPreference = 'Stop';",
395 "Invoke-TrustedSigning",
396 `-Endpoint ${quote(endpoint)}`,
397 `-CodeSigningAccountName ${quote(accountName)}`,
398 `-CertificateProfileName ${quote(profile)}`,
399 "-FileDigest 'SHA256'",
400 "-TimestampRfc3161 'http://timestamp.acs.microsoft.com'",
401 "-TimestampDigest 'SHA256'",
402 `-Files ${quote(executablePath)}`,
403 ].join(" ");
404 yield* runCommand(
405 ChildProcess.make("pwsh", ["-NoProfile", "-NonInteractive", "-Command", script]),
406 "Invoke-TrustedSigning t3.exe",
407 );
408 yield* Effect.log("[cli-archive] Signed t3.exe (Azure Trusted Signing).");
409});
410​
411const buildCliArchive = Effect.fn("buildCliArchive")(function* (input: {
412 readonly platform: BuildPlatform;
413 readonly arch: BuildArch;
414 readonly version: string;
415 readonly outputDir: string;
416 readonly resourceMonitorDir: Option.Option<string>;
417}) {
418 const fs = yield* FileSystem.FileSystem;
419 const path = yield* Path.Path;
420 const repoRoot = yield* RepoRoot;
421 const serverDir = path.join(repoRoot, "apps/server");
422 const executableName = input.platform === "win" ? "t3.exe" : "t3";
423 // tsdown suffixes cross-built executables; prefer the exact target over the plain host build.
424 const targetKey = `${input.platform === "mac" ? "darwin" : input.platform}-${input.arch}`;
425 const targetExecutable = path.join(
426 serverDir,
427 "dist-exe",
428 `t3-${targetKey}${input.platform === "win" ? ".exe" : ""}`,
429 );
430 // The unsuffixed executable is valid only for the host platform and architecture.
431 const hostPlatform = yield* HostProcess.Platform;
432 const hostKey = `${hostPlatform === "win32" ? "win" : hostPlatform}-${yield* HostProcess.Architecture}`;
433 const builtExecutable = (yield* fs.exists(targetExecutable))
434 ? targetExecutable
435 : targetKey === hostKey
436 ? path.join(serverDir, "dist-exe", executableName)
437 : targetExecutable;
438 const webClient = path.join(serverDir, "dist/client");
439 const resourceMonitorDir = Option.getOrElse(input.resourceMonitorDir, () =>
440 path.join(serverDir, "dist/resource-monitor"),
441 );
442​
443 yield* requireInput(
444 builtExecutable,
445 `Run \`node apps/server/scripts/cli.ts build-exe${targetKey === hostKey ? "" : ` --target ${targetKey}`}\` first.`,
446 );
447 // TEMPORARY one-time Node fix. Remove when fixed: https://github.com/nodejs/node/issues/67048
448 if (input.platform === "linux" && input.arch === "arm64") {
449 const bytes = yield* fs.readFile(builtExecutable);
450 yield* Effect.try(() => assertLinuxArm64PageCompatibility(bytes));
451 }
452 yield* requireInput(path.join(webClient, "index.html"), "Run `vp run --filter t3 build` first.");
453 yield* requireInput(
454 resourceMonitorDir,
455 "Build the resource monitor or pass --resource-monitor-dir.",
456 );
457​
458 const stem = cliArchiveStem(input.version, input.platform, input.arch);
459 const stageRoot = yield* fs.makeTempDirectoryScoped({ prefix: "t3-cli-archive-" });
460 const contentDir = path.join(stageRoot, stem);
461 yield* fs.makeDirectory(contentDir, { recursive: true });
462​
463 yield* Effect.log(`[cli-archive] Staging ${stem}...`);
464 yield* fs.copyFile(builtExecutable, path.join(contentDir, executableName));
465 yield* stageWebClient(webClient, path.join(contentDir, "client"));
466 yield* fs.copy(resourceMonitorDir, path.join(contentDir, "resource-monitor"));
467 yield* stageRuntimeExternals({
468 repoRoot,
469 stageDir: contentDir,
470 platform: input.platform,
471 arch: input.arch,
472 version: input.version,
473 });
474​
475 const executablePath = path.join(contentDir, executableName);
476 if (input.platform === "mac") {
477 yield* signMacArchiveContents({ repoRoot, contentDir, executablePath });
478 } else if (input.platform === "win") {
479 yield* signWindowsExecutable(executablePath);
480 }
481 if (input.platform !== "win") {
482 yield* fs.chmod(executablePath, 0o755);
483 }
484​
485 yield* fs.makeDirectory(input.outputDir, { recursive: true });
486 const archivePath = path.join(
487 input.outputDir,
488 cliArchiveFileName(input.version, input.platform, input.arch),
489 );
490 yield* fs.remove(archivePath, { force: true });
491 if (input.platform === "win" && hostPlatform !== "win32") {
492 yield* runCommand(
493 ChildProcess.make("zip", ["-q", "-r", "-X", path.resolve(archivePath), stem], {
494 cwd: stageRoot,
495 }),
496 "zip",
497 );
498 } else if (input.platform === "win") {
499 // Windows ships bsdtar, which writes zip natively. Name it by path: under
500 // the Git Bash shell CI uses, a bare `tar` is GNU tar, which neither
501 // writes zip nor accepts a drive-letter path.
502 yield* runCommand(
503 ChildProcess.make(windowsSystemTar(), ["-a", "-c", "-f", archivePath, "-C", stageRoot, stem]),
504 "tar (zip)",
505 );
506 } else {
507 // npm rejects Linux hardlink entries; macOS pnpm clones and bsdtar lacks this flag.
508 yield* runCommand(
509 ChildProcess.make("tar", [
510 ...(input.platform === "linux" ? ["--hard-dereference"] : []),
511 "-czf",
512 archivePath,
513 "-C",
514 stageRoot,
515 stem,
516 ]),
517 "tar (gzip)",
518 );
519 }
520 const stat = yield* fs.stat(archivePath);
521 yield* Effect.log(`[cli-archive] Wrote ${archivePath} (${String(stat.size)} bytes).`);
522 return archivePath;
523});
524​
525const command = Command.make(
526 "build-cli-archive",
527 {
528 platform: Flag.Literals("platform", BuildPlatform.literals),
529 arch: Flag.Literals("arch", BuildArch.literals),
530 version: Flag.String("version").pipe(
531 Flag.withDescription("Release version for the archive name."),
532 ),
533 outputDir: Flag.String("output-dir").pipe(Flag.withDefault("release-cli")),
534 resourceMonitorDir: Flag.String("resource-monitor-dir").pipe(
535 Flag.withDescription(
536 "Directory laid out like dist/resource-monitor (defaults to apps/server/dist/resource-monitor).",
537 ),
538 Flag.optional,
539 ),
540 },
541 (input) => buildCliArchive(input).pipe(Effect.scoped),
542).pipe(Command.withDescription("Package the t3 single-executable into a per-platform archive."));
543​
544if (import.meta.main) {
545 Command.run(command, { version: "0.0.0" }).pipe(
546 Effect.provide(Layer.mergeAll(Logger.layer([Logger.consolePretty()]), NodeServices.layer)),
547 NodeRuntime.runMain,
548 );