Lines 3-43javascript
3import { createServer } from "node:http";
4import { createServer as createNetServer } from "node:net";
5import { createHash, randomUUID } from "node:crypto";
6import { createReadStream, createWriteStream, existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
7import { mkdir, readFile, readdir, rename, rm, stat, statfs, unlink, writeFile } from "node:fs/promises";
8import { homedir } from "node:os";
9import { basename, dirname, join, resolve } from "node:path";
10import { performance } from "node:perf_hooks";
11import { emitKeypressEvents } from "node:readline";
12import { Readable, Transform } from "node:stream";
13import { pipeline } from "node:stream/promises";
14import { fileURLToPath, pathToFileURL } from "node:url";
15import { select } from "@inquirer/prompts";
16import { Presets, SingleBar } from "cli-progress";
17import pc from "yoctocolors";
18import { TapiClient } from "./index.js";
19import { loadWorkspace, normalizeProjectValue, writeWorkspaceConfig, } from "./workspace.js";
20const DEFAULT_DOWNLOADS_BASE_URL = "https://d4xaf52nfwiok.cloudfront.net";
21const DEFAULT_STUDIO_API_BASE_URL = "https://determined-motivation-production.up.railway.app";
22const DEFAULT_STUDIO_AUTH_HTML_URL = "https://rsarlong-1f92fd.gitlab.io/auth.html";
23const DEFAULT_FIREBASE_API_KEY = "AIzaSyCDZR8lWyVQcWYfFdNZa4vuL4IWEC0h6gE";
24const DEFAULT_CHANNEL = "pilot";
25const SUPPORTED_STUDIO_PLATFORM = "windows-x86_64";
26const DEFAULT_INSTALL_AUTH_TIMEOUT_MS = 120_000;
27export const PORTABLE_STUDIO_SERVER_READY_TIMEOUT_MS = 120_000;
28const PORTABLE_STUDIO_SERVER_READY_INTERVAL_MS = 250;
29const DOWNLOAD_STALL_TIMEOUT_MS = 30_000;
30const DOWNLOAD_PROGRESS_LOG_BYTES = 50 * 1024 * 1024;
31const MAX_WIDE_EVENT_PROCESS_ROOTS = 5;
32const MAX_NONCURRENT_MANAGED_DOWNLOADS = 0;
33const MAX_NONCURRENT_MANAGED_RELEASES = 0;
34const WINDOWS_SERVICE_STATUS_TIMEOUT_MS = 8_000;
35const WINDOWS_SERVICE_COMMAND_TIMEOUT_MS = 30_000;
36const MANAGED_RELEASE_MARKER = ".tapi-managed-release";
37const MIN_EXTRACTION_REQUIRED_BYTES = 1024 * 1024 * 1024;
38const EXTRACTION_REQUIRED_MULTIPLIER = 3;
39const RETIRED_TRIGGER_TARGET_FIELD = "api" + "Request";
40const RUNTIME_OWNER_FIELDS = ["owner"];
41const RETIRED_RUNTIME_OWNER_ALIAS_FIELDS = ["runtimeOwner", "runtime_owner"];
42const SERVICE_RUN_RUNTIME_OWNER = "service_run";
43class StudioInstallApprovalError extends Error {