@air-jam/devtools 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README.md +52 -2
- package/dist/agent.d.ts +15 -0
- package/dist/agent.js +19 -0
- package/dist/agent.js.map +1 -0
- package/dist/chunk-5YAARMW5.js +36 -0
- package/dist/chunk-5YAARMW5.js.map +1 -0
- package/dist/chunk-6WQODT37.js +1019 -0
- package/dist/chunk-6WQODT37.js.map +1 -0
- package/dist/chunk-CKFT2ZJE.js +801 -0
- package/dist/chunk-CKFT2ZJE.js.map +1 -0
- package/dist/chunk-ER3Q2C4G.js +358 -0
- package/dist/chunk-ER3Q2C4G.js.map +1 -0
- package/dist/chunk-GUEZP773.js +851 -0
- package/dist/chunk-GUEZP773.js.map +1 -0
- package/dist/chunk-HIDNI56E.js +33 -0
- package/dist/chunk-HIDNI56E.js.map +1 -0
- package/dist/chunk-QKXS5D35.js +43 -0
- package/dist/chunk-QKXS5D35.js.map +1 -0
- package/dist/chunk-S4LSCEVE.js +261 -0
- package/dist/chunk-S4LSCEVE.js.map +1 -0
- package/dist/chunk-VKMJO6VN.js +360 -0
- package/dist/chunk-VKMJO6VN.js.map +1 -0
- package/dist/chunk-WFUR3MXY.js +67 -0
- package/dist/chunk-WFUR3MXY.js.map +1 -0
- package/dist/chunk-XEMR7KUE.js +361 -0
- package/dist/chunk-XEMR7KUE.js.map +1 -0
- package/dist/chunk-ZLPD7FY5.js +191 -0
- package/dist/chunk-ZLPD7FY5.js.map +1 -0
- package/dist/context.d.ts +13 -0
- package/dist/context.js +9 -0
- package/dist/context.js.map +1 -0
- package/dist/controller.d.ts +41 -0
- package/dist/controller.js +30 -0
- package/dist/controller.js.map +1 -0
- package/dist/dev.d.ts +15 -0
- package/dist/dev.js +20 -0
- package/dist/dev.js.map +1 -0
- package/dist/game-session-broker.d.ts +57 -0
- package/dist/game-session-broker.js +235 -0
- package/dist/game-session-broker.js.map +1 -0
- package/dist/game-session.d.ts +13 -0
- package/dist/game-session.js +24 -0
- package/dist/game-session.js.map +1 -0
- package/dist/games.d.ts +21 -0
- package/dist/games.js +14 -0
- package/dist/games.js.map +1 -0
- package/dist/harness/visual.d.ts +321 -0
- package/dist/harness/visual.js +41 -0
- package/dist/harness/visual.js.map +1 -0
- package/dist/logs.d.ts +9 -0
- package/dist/logs.js +58 -0
- package/dist/logs.js.map +1 -0
- package/dist/mcp-config.d.ts +63 -0
- package/dist/mcp-config.js +190 -0
- package/dist/mcp-config.js.map +1 -0
- package/dist/platform-auth.d.ts +112 -0
- package/dist/platform-auth.js +37 -0
- package/dist/platform-auth.js.map +1 -0
- package/dist/platform-game-media.d.ts +309 -0
- package/dist/platform-game-media.js +168 -0
- package/dist/platform-game-media.js.map +1 -0
- package/dist/platform-games.d.ts +65 -0
- package/dist/platform-games.js +251 -0
- package/dist/platform-games.js.map +1 -0
- package/dist/quality.d.ts +10 -0
- package/dist/quality.js +63 -0
- package/dist/quality.js.map +1 -0
- package/dist/release.d.ts +1094 -0
- package/dist/release.js +1347 -0
- package/dist/release.js.map +1 -0
- package/dist/tooling/agent-contract.d.ts +2 -0
- package/dist/tooling/agent-contract.js +193 -0
- package/dist/tooling/agent-contract.js.map +1 -0
- package/dist/tooling/hold-runtime-host.d.ts +2 -0
- package/dist/tooling/hold-runtime-host.js +229 -0
- package/dist/tooling/hold-runtime-host.js.map +1 -0
- package/dist/tooling/inspect-airjam-agent.d.ts +2 -0
- package/dist/tooling/inspect-airjam-agent.js +37 -0
- package/dist/tooling/inspect-airjam-agent.js.map +1 -0
- package/dist/tooling/list-visual-scenarios.d.ts +2 -0
- package/dist/tooling/list-visual-scenarios.js +62 -0
- package/dist/tooling/list-visual-scenarios.js.map +1 -0
- package/dist/tooling/managed-dev-supervisor.d.ts +2 -0
- package/dist/tooling/managed-dev-supervisor.js +51 -0
- package/dist/tooling/managed-dev-supervisor.js.map +1 -0
- package/dist/tooling/run-visual-capture.d.ts +2 -0
- package/dist/tooling/run-visual-capture.js +167 -0
- package/dist/tooling/run-visual-capture.js.map +1 -0
- package/dist/types-C6NrHt88.d.ts +775 -0
- package/dist/visual.d.ts +15 -0
- package/dist/visual.js +263 -0
- package/dist/visual.js.map +1 -0
- package/package.json +113 -3
- package/src/agent.ts +380 -0
- package/src/commands.ts +40 -0
- package/src/context.ts +229 -0
- package/src/controller.ts +1376 -0
- package/src/dev.ts +999 -0
- package/src/fs-utils.ts +93 -0
- package/src/game-action-observation.ts +96 -0
- package/src/game-session-broker.ts +301 -0
- package/src/game-session.ts +459 -0
- package/src/games.ts +266 -0
- package/src/harness/visual/prefab-contract.ts +29 -0
- package/src/harness/visual/prefab-runner.ts +178 -0
- package/src/harness/visual/runner.ts +546 -0
- package/src/harness/visual/scenario-contract.ts +9 -0
- package/src/harness/visual/scenario-helpers.ts +63 -0
- package/src/harness/visual/session.ts +369 -0
- package/src/harness/visual/types.ts +181 -0
- package/src/harness/visual.ts +7 -0
- package/src/helper-scripts.ts +49 -0
- package/src/logs.ts +67 -0
- package/src/mcp-config.ts +262 -0
- package/src/platform-auth.ts +455 -0
- package/src/platform-game-media.ts +209 -0
- package/src/platform-games.ts +315 -0
- package/src/quality.ts +82 -0
- package/src/release.ts +1697 -0
- package/src/runtime-owner-protocol.ts +130 -0
- package/src/tooling/agent-contract.ts +232 -0
- package/src/tooling/agent-declaration.ts +36 -0
- package/src/tooling/airjam-agent-inspection.ts +45 -0
- package/src/tooling/airjam-agent.ts +118 -0
- package/src/tooling/hold-runtime-host.ts +224 -0
- package/src/tooling/inspect-airjam-agent.ts +20 -0
- package/src/tooling/list-visual-scenarios.ts +64 -0
- package/src/tooling/managed-dev-supervisor.ts +71 -0
- package/src/tooling/run-visual-capture.ts +217 -0
- package/src/tooling/runtime-owner-actions.ts +42 -0
- package/src/tooling/visual-pack.ts +46 -0
- package/src/types.ts +951 -0
- package/src/visual.ts +304 -0
- package/src/workspace-contract.ts +32 -0
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
import {
|
|
2
|
+
inspectGame,
|
|
3
|
+
listGames
|
|
4
|
+
} from "./chunk-ZLPD7FY5.js";
|
|
5
|
+
import {
|
|
6
|
+
runCommandResult
|
|
7
|
+
} from "./chunk-5YAARMW5.js";
|
|
8
|
+
import {
|
|
9
|
+
assertSupportedDevMode,
|
|
10
|
+
detectProjectContext,
|
|
11
|
+
pathExists,
|
|
12
|
+
readWorkspaceContract
|
|
13
|
+
} from "./chunk-S4LSCEVE.js";
|
|
14
|
+
|
|
15
|
+
// src/dev.ts
|
|
16
|
+
import crossSpawn from "cross-spawn";
|
|
17
|
+
import { randomUUID } from "crypto";
|
|
18
|
+
import { closeSync, openSync } from "fs";
|
|
19
|
+
import { mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
20
|
+
import http from "http";
|
|
21
|
+
import https from "https";
|
|
22
|
+
import path2 from "path";
|
|
23
|
+
|
|
24
|
+
// src/helper-scripts.ts
|
|
25
|
+
import { existsSync } from "fs";
|
|
26
|
+
import { createRequire } from "module";
|
|
27
|
+
import path from "path";
|
|
28
|
+
import { fileURLToPath } from "url";
|
|
29
|
+
var require2 = createRequire(import.meta.url);
|
|
30
|
+
var moduleDir = path.dirname(fileURLToPath(import.meta.url));
|
|
31
|
+
var resolveDevtoolsHelperScript = (fileName) => {
|
|
32
|
+
const builtHelperPath = path.resolve(
|
|
33
|
+
moduleDir,
|
|
34
|
+
"tooling",
|
|
35
|
+
fileName.replace(/\.ts$/, ".js")
|
|
36
|
+
);
|
|
37
|
+
if (existsSync(builtHelperPath)) {
|
|
38
|
+
return builtHelperPath;
|
|
39
|
+
}
|
|
40
|
+
const sourceHelperPath = path.resolve(
|
|
41
|
+
moduleDir,
|
|
42
|
+
"..",
|
|
43
|
+
"src",
|
|
44
|
+
"tooling",
|
|
45
|
+
fileName
|
|
46
|
+
);
|
|
47
|
+
if (existsSync(sourceHelperPath)) {
|
|
48
|
+
return sourceHelperPath;
|
|
49
|
+
}
|
|
50
|
+
throw new Error(
|
|
51
|
+
`Air Jam helper script is missing from this installation: ${fileName}`
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
var typescriptExtensions = /* @__PURE__ */ new Set([".ts", ".tsx", ".mts", ".cts"]);
|
|
55
|
+
var projectTypescriptLoaderHelpers = /* @__PURE__ */ new Set([
|
|
56
|
+
"agent-contract",
|
|
57
|
+
"inspect-airjam-agent",
|
|
58
|
+
"list-visual-scenarios",
|
|
59
|
+
"run-visual-capture"
|
|
60
|
+
]);
|
|
61
|
+
var resolveDevtoolsHelperArgs = (helperPath) => typescriptExtensions.has(path.extname(helperPath)) || projectTypescriptLoaderHelpers.has(
|
|
62
|
+
path.basename(helperPath, path.extname(helperPath))
|
|
63
|
+
) ? ["--import", require2.resolve("tsx"), helperPath] : [helperPath];
|
|
64
|
+
|
|
65
|
+
// src/dev.ts
|
|
66
|
+
var DEVTOOLS_SCHEMA_VERSION = 1;
|
|
67
|
+
var START_TIMEOUT_MS = 12e4;
|
|
68
|
+
var KNOWN_LOCAL_DEV_PORTS = [4e3, 5173];
|
|
69
|
+
var KNOWN_PORTS_ENV = "AIRJAM_DEVTOOLS_KNOWN_PORTS";
|
|
70
|
+
var DEFAULT_CONTROLLER_PATH = "/controller";
|
|
71
|
+
var MANAGED_PROCESS_STOP_TIMEOUT_MS = 1e4;
|
|
72
|
+
var toTopologyMode = (mode) => {
|
|
73
|
+
if (mode === "arcade-dev") {
|
|
74
|
+
return "arcade-live";
|
|
75
|
+
}
|
|
76
|
+
if (mode === "arcade-test") {
|
|
77
|
+
return "arcade-built";
|
|
78
|
+
}
|
|
79
|
+
return "standalone-dev";
|
|
80
|
+
};
|
|
81
|
+
var isKnownProjectMode = (mode) => mode === "monorepo" || mode === "standalone-game";
|
|
82
|
+
var getDevtoolsRoot = (rootDir) => path2.join(rootDir, ".airjam", "devtools");
|
|
83
|
+
var getManagedRegistryPath = (rootDir) => path2.join(getDevtoolsRoot(rootDir), "managed-processes.json");
|
|
84
|
+
var getManagedProcessLogPath = (rootDir, processId) => path2.join(getDevtoolsRoot(rootDir), "processes", `${processId}.log`);
|
|
85
|
+
var isProcessAlive = (pid) => {
|
|
86
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
process.kill(pid, 0);
|
|
91
|
+
return true;
|
|
92
|
+
} catch {
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
var readCommandOutput = (command, args) => {
|
|
97
|
+
try {
|
|
98
|
+
return runCommandResult({
|
|
99
|
+
command,
|
|
100
|
+
args,
|
|
101
|
+
cwd: process.cwd()
|
|
102
|
+
}).stdout.trim();
|
|
103
|
+
} catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
var readListeningPidsForPort = (port) => {
|
|
108
|
+
const output = readCommandOutput("lsof", [
|
|
109
|
+
"-nP",
|
|
110
|
+
`-tiTCP:${port}`,
|
|
111
|
+
"-sTCP:LISTEN"
|
|
112
|
+
]);
|
|
113
|
+
if (!output) {
|
|
114
|
+
return [];
|
|
115
|
+
}
|
|
116
|
+
return output.split(/\r?\n/).map((value) => Number.parseInt(value.trim(), 10)).filter((value) => Number.isInteger(value) && value > 0);
|
|
117
|
+
};
|
|
118
|
+
var readProcessCommand = (pid) => {
|
|
119
|
+
const output = readCommandOutput("ps", ["-p", String(pid), "-o", "command="]);
|
|
120
|
+
return output && output.length > 0 ? output : null;
|
|
121
|
+
};
|
|
122
|
+
var readProcessAgeMs = (pid) => {
|
|
123
|
+
const output = readCommandOutput("ps", ["-p", String(pid), "-o", "etimes="]);
|
|
124
|
+
const seconds = output ? Number.parseInt(output.trim(), 10) : Number.NaN;
|
|
125
|
+
return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1e3 : null;
|
|
126
|
+
};
|
|
127
|
+
var getKnownLocalDevPorts = () => {
|
|
128
|
+
const rawPorts = process.env[KNOWN_PORTS_ENV];
|
|
129
|
+
if (!rawPorts) {
|
|
130
|
+
return [...KNOWN_LOCAL_DEV_PORTS];
|
|
131
|
+
}
|
|
132
|
+
const ports = rawPorts.split(",").map((value) => Number.parseInt(value.trim(), 10)).filter((value) => Number.isInteger(value) && value > 0);
|
|
133
|
+
return ports.length > 0 ? Array.from(new Set(ports)) : [...KNOWN_LOCAL_DEV_PORTS];
|
|
134
|
+
};
|
|
135
|
+
var isLikelyAirJamLocalDevCommand = (command) => {
|
|
136
|
+
if (!command) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
return /(^|\W)(@air-jam\/server|air-jam-server|airjam|vite|create-airjam)(\W|$)/.test(
|
|
140
|
+
command
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
var listKnownPortListeners = () => {
|
|
144
|
+
const byPid = /* @__PURE__ */ new Map();
|
|
145
|
+
for (const port of getKnownLocalDevPorts()) {
|
|
146
|
+
for (const pid of readListeningPidsForPort(port)) {
|
|
147
|
+
const ports = byPid.get(pid) ?? /* @__PURE__ */ new Set();
|
|
148
|
+
ports.add(port);
|
|
149
|
+
byPid.set(pid, ports);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return Array.from(byPid.entries()).map(([pid, ports]) => {
|
|
153
|
+
const ageMs = readProcessAgeMs(pid);
|
|
154
|
+
return {
|
|
155
|
+
pid,
|
|
156
|
+
ports: Array.from(ports).sort((left, right) => left - right),
|
|
157
|
+
command: readProcessCommand(pid),
|
|
158
|
+
startedAt: ageMs !== null ? new Date(Date.now() - ageMs).toISOString() : null,
|
|
159
|
+
ageMs,
|
|
160
|
+
managed: false
|
|
161
|
+
};
|
|
162
|
+
}).sort((left, right) => left.pid - right.pid);
|
|
163
|
+
};
|
|
164
|
+
var waitForProcessExit = async (pid, timeoutMs = MANAGED_PROCESS_STOP_TIMEOUT_MS) => {
|
|
165
|
+
const startedAt = Date.now();
|
|
166
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
167
|
+
if (!isProcessAlive(pid)) {
|
|
168
|
+
return true;
|
|
169
|
+
}
|
|
170
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
171
|
+
}
|
|
172
|
+
return !isProcessAlive(pid);
|
|
173
|
+
};
|
|
174
|
+
var terminateManagedProcess = async (pid) => {
|
|
175
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (!isProcessAlive(pid)) {
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (process.platform === "win32") {
|
|
182
|
+
runCommandResult({
|
|
183
|
+
command: "taskkill",
|
|
184
|
+
args: ["/PID", String(pid), "/T", "/F"],
|
|
185
|
+
cwd: process.cwd()
|
|
186
|
+
});
|
|
187
|
+
} else {
|
|
188
|
+
try {
|
|
189
|
+
process.kill(-pid, "SIGTERM");
|
|
190
|
+
} catch {
|
|
191
|
+
try {
|
|
192
|
+
process.kill(pid, "SIGTERM");
|
|
193
|
+
} catch {
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (!await waitForProcessExit(pid)) {
|
|
198
|
+
if (process.platform !== "win32") {
|
|
199
|
+
try {
|
|
200
|
+
process.kill(-pid, "SIGKILL");
|
|
201
|
+
} catch {
|
|
202
|
+
try {
|
|
203
|
+
process.kill(pid, "SIGKILL");
|
|
204
|
+
} catch {
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
if (!await waitForProcessExit(pid, 2e3)) {
|
|
209
|
+
throw new Error(`Managed Air Jam dev process ${pid} did not terminate.`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
var readRegistry = async (rootDir) => {
|
|
214
|
+
const registryPath = getManagedRegistryPath(rootDir);
|
|
215
|
+
if (!await pathExists(registryPath)) {
|
|
216
|
+
return {
|
|
217
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
218
|
+
processes: []
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
const parsed = JSON.parse(
|
|
222
|
+
await readFile(registryPath, "utf8")
|
|
223
|
+
);
|
|
224
|
+
return {
|
|
225
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
226
|
+
processes: Array.isArray(parsed.processes) ? parsed.processes : []
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
var writeRegistry = async (rootDir, registry) => {
|
|
230
|
+
const registryPath = getManagedRegistryPath(rootDir);
|
|
231
|
+
await mkdir(path2.dirname(registryPath), { recursive: true });
|
|
232
|
+
await writeFile(
|
|
233
|
+
registryPath,
|
|
234
|
+
`${JSON.stringify(registry, null, 2)}
|
|
235
|
+
`,
|
|
236
|
+
"utf8"
|
|
237
|
+
);
|
|
238
|
+
};
|
|
239
|
+
var listManagedProcessesForRoot = async (rootDir) => {
|
|
240
|
+
const registry = await readRegistry(rootDir);
|
|
241
|
+
const aliveProcesses = registry.processes.filter(
|
|
242
|
+
(processInfo) => isProcessAlive(processInfo.pid)
|
|
243
|
+
);
|
|
244
|
+
if (aliveProcesses.length !== registry.processes.length) {
|
|
245
|
+
await writeRegistry(rootDir, {
|
|
246
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
247
|
+
processes: aliveProcesses
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
return aliveProcesses.sort(
|
|
251
|
+
(left, right) => left.startedAt.localeCompare(right.startedAt)
|
|
252
|
+
);
|
|
253
|
+
};
|
|
254
|
+
var appendArg = (args, flag, value) => {
|
|
255
|
+
if (value === void 0 || value === false || value === "") {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
if (value === true) {
|
|
259
|
+
args.push(flag);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
args.push(`${flag}=${value}`);
|
|
263
|
+
};
|
|
264
|
+
var resolveWorkspaceCliPath = (context) => {
|
|
265
|
+
const workspace = readWorkspaceContract(context.packageJson);
|
|
266
|
+
if (!workspace)
|
|
267
|
+
throw new Error(
|
|
268
|
+
"Air Jam workspace must declare airjam.workspace in package.json."
|
|
269
|
+
);
|
|
270
|
+
return path2.resolve(context.rootDir, workspace.cli);
|
|
271
|
+
};
|
|
272
|
+
var resolveRequestedGameId = async ({
|
|
273
|
+
cwd,
|
|
274
|
+
context,
|
|
275
|
+
gameId
|
|
276
|
+
}) => {
|
|
277
|
+
if (context.mode === "standalone-game") {
|
|
278
|
+
return (await inspectGame({ cwd, gameId })).id;
|
|
279
|
+
}
|
|
280
|
+
if (context.mode !== "monorepo") {
|
|
281
|
+
return null;
|
|
282
|
+
}
|
|
283
|
+
if (gameId) {
|
|
284
|
+
return gameId;
|
|
285
|
+
}
|
|
286
|
+
const games = await listGames({ cwd });
|
|
287
|
+
return games[0]?.id ?? null;
|
|
288
|
+
};
|
|
289
|
+
var resolveStartCommand = async ({
|
|
290
|
+
context,
|
|
291
|
+
cwd,
|
|
292
|
+
gameId,
|
|
293
|
+
mode,
|
|
294
|
+
secure
|
|
295
|
+
}) => {
|
|
296
|
+
if (context.mode === "monorepo") {
|
|
297
|
+
if (!gameId) {
|
|
298
|
+
throw new Error("Monorepo dev start requires a game id.");
|
|
299
|
+
}
|
|
300
|
+
const script = mode === "arcade-dev" ? "arcade:dev" : mode === "arcade-test" ? "arcade:test" : "standalone:dev";
|
|
301
|
+
const args2 = [
|
|
302
|
+
resolveWorkspaceCliPath(context),
|
|
303
|
+
"workspace",
|
|
304
|
+
script,
|
|
305
|
+
`--game=${gameId}`
|
|
306
|
+
];
|
|
307
|
+
appendArg(args2, "--secure", secure);
|
|
308
|
+
return {
|
|
309
|
+
command: process.execPath,
|
|
310
|
+
args: args2,
|
|
311
|
+
topologyMode: toTopologyMode(mode),
|
|
312
|
+
expectedLogPath: path2.join(cwd, ".airjam", "logs", "dev-latest.ndjson")
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (context.mode !== "standalone-game") {
|
|
316
|
+
throw new Error(
|
|
317
|
+
"Air Jam dev start is only available in known project modes."
|
|
318
|
+
);
|
|
319
|
+
}
|
|
320
|
+
const args = context.packageJson?.scripts?.dev !== void 0 ? ["run", "dev"] : ["exec", "airjam", "dev"];
|
|
321
|
+
if (secure) {
|
|
322
|
+
args.push("--", "--secure");
|
|
323
|
+
}
|
|
324
|
+
return {
|
|
325
|
+
command: "pnpm",
|
|
326
|
+
args,
|
|
327
|
+
topologyMode: "standalone-dev",
|
|
328
|
+
expectedLogPath: path2.join(cwd, ".airjam", "logs", "dev-latest.ndjson")
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
var parseJsonFromCommandOutput = (output) => {
|
|
332
|
+
const startIndex = output.indexOf("{");
|
|
333
|
+
const endIndex = output.lastIndexOf("}");
|
|
334
|
+
if (startIndex === -1 || endIndex === -1 || endIndex < startIndex) {
|
|
335
|
+
throw new Error(`Expected JSON output but received:
|
|
336
|
+
${output}`);
|
|
337
|
+
}
|
|
338
|
+
return JSON.parse(output.slice(startIndex, endIndex + 1));
|
|
339
|
+
};
|
|
340
|
+
var resolveTopologyCommand = async ({
|
|
341
|
+
context,
|
|
342
|
+
gameId,
|
|
343
|
+
mode,
|
|
344
|
+
secure
|
|
345
|
+
}) => {
|
|
346
|
+
const topologyMode = toTopologyMode(mode);
|
|
347
|
+
if (context.mode === "monorepo") {
|
|
348
|
+
if (!gameId) {
|
|
349
|
+
throw new Error("Monorepo topology inspection requires a game id.");
|
|
350
|
+
}
|
|
351
|
+
const args2 = [
|
|
352
|
+
resolveWorkspaceCliPath(context),
|
|
353
|
+
"workspace",
|
|
354
|
+
"topology",
|
|
355
|
+
`--game=${gameId}`,
|
|
356
|
+
`--mode=${topologyMode}`
|
|
357
|
+
];
|
|
358
|
+
appendArg(args2, "--secure", secure);
|
|
359
|
+
return {
|
|
360
|
+
command: process.execPath,
|
|
361
|
+
args: args2,
|
|
362
|
+
topologyMode
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
if (context.mode !== "standalone-game") {
|
|
366
|
+
throw new Error(
|
|
367
|
+
"Air Jam topology is only available in known project modes."
|
|
368
|
+
);
|
|
369
|
+
}
|
|
370
|
+
const topologyScript = context.packageJson?.scripts?.topology?.trim();
|
|
371
|
+
const topologyScriptUsesAirJamCli = typeof topologyScript === "string" && /\bairjam\s+topology\b/.test(topologyScript);
|
|
372
|
+
const args = topologyScript && !topologyScriptUsesAirJamCli ? ["run", "topology", "--", "--mode=standalone-dev"] : ["exec", "airjam", "topology", "--mode=standalone-dev"];
|
|
373
|
+
appendArg(args, "--secure", secure);
|
|
374
|
+
return {
|
|
375
|
+
command: "pnpm",
|
|
376
|
+
args,
|
|
377
|
+
topologyMode
|
|
378
|
+
};
|
|
379
|
+
};
|
|
380
|
+
var toObject = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
381
|
+
var toStringOrNull = (value) => typeof value === "string" && value.trim() !== "" ? value : null;
|
|
382
|
+
var joinUrl = (origin, pathname) => {
|
|
383
|
+
if (!origin) {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
return new URL(pathname, origin).toString();
|
|
387
|
+
};
|
|
388
|
+
var buildUrlSummary = ({
|
|
389
|
+
mode,
|
|
390
|
+
gameId,
|
|
391
|
+
surfaces,
|
|
392
|
+
controllerPath
|
|
393
|
+
}) => {
|
|
394
|
+
if (mode === "standalone-dev") {
|
|
395
|
+
const hostSurface = toObject(surfaces.host);
|
|
396
|
+
const controllerSurface = toObject(surfaces.controller);
|
|
397
|
+
const hostOrigin = toStringOrNull(hostSurface.appOrigin);
|
|
398
|
+
const controllerOrigin2 = toStringOrNull(controllerSurface.appOrigin) ?? hostOrigin;
|
|
399
|
+
const publicHost2 = toStringOrNull(hostSurface.publicHost) ?? toStringOrNull(controllerSurface.publicHost) ?? hostOrigin;
|
|
400
|
+
return {
|
|
401
|
+
appOrigin: hostOrigin,
|
|
402
|
+
hostUrl: hostOrigin,
|
|
403
|
+
controllerBaseUrl: joinUrl(controllerOrigin2, controllerPath),
|
|
404
|
+
publicHost: publicHost2,
|
|
405
|
+
localBuildUrl: null,
|
|
406
|
+
browserBuildUrl: null
|
|
407
|
+
};
|
|
408
|
+
}
|
|
409
|
+
const platformHost = toObject(surfaces.platformHost);
|
|
410
|
+
const platformController = toObject(surfaces.platformController);
|
|
411
|
+
const embeddedHost = toObject(surfaces.embeddedHost);
|
|
412
|
+
const appOrigin = toStringOrNull(platformHost.appOrigin);
|
|
413
|
+
const controllerOrigin = toStringOrNull(platformController.appOrigin) ?? toStringOrNull(platformHost.publicHost) ?? appOrigin;
|
|
414
|
+
const publicHost = toStringOrNull(platformHost.publicHost) ?? toStringOrNull(platformController.publicHost) ?? controllerOrigin;
|
|
415
|
+
const assetBasePath = toStringOrNull(embeddedHost.assetBasePath);
|
|
416
|
+
return {
|
|
417
|
+
appOrigin,
|
|
418
|
+
hostUrl: appOrigin && gameId ? new URL(`/arcade/local-${gameId}`, appOrigin).toString() : null,
|
|
419
|
+
controllerBaseUrl: joinUrl(controllerOrigin, DEFAULT_CONTROLLER_PATH),
|
|
420
|
+
publicHost,
|
|
421
|
+
localBuildUrl: mode === "arcade-test" && publicHost && assetBasePath ? new URL(assetBasePath, publicHost).toString() : null,
|
|
422
|
+
browserBuildUrl: mode === "arcade-test" && appOrigin && assetBasePath ? new URL(assetBasePath, appOrigin).toString() : null
|
|
423
|
+
};
|
|
424
|
+
};
|
|
425
|
+
var wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
426
|
+
var checkUrlReady = (targetUrl, secure) => new Promise((resolve) => {
|
|
427
|
+
const parsed = new URL(targetUrl);
|
|
428
|
+
const client = parsed.protocol === "https:" ? https : http;
|
|
429
|
+
const request = client.request(
|
|
430
|
+
parsed,
|
|
431
|
+
{
|
|
432
|
+
method: "GET",
|
|
433
|
+
rejectUnauthorized: secure ? false : void 0
|
|
434
|
+
},
|
|
435
|
+
(response) => {
|
|
436
|
+
response.resume();
|
|
437
|
+
resolve(Boolean(response.statusCode && response.statusCode < 500));
|
|
438
|
+
}
|
|
439
|
+
);
|
|
440
|
+
request.setTimeout(2500, () => {
|
|
441
|
+
request.destroy();
|
|
442
|
+
resolve(false);
|
|
443
|
+
});
|
|
444
|
+
request.on("error", () => resolve(false));
|
|
445
|
+
request.end();
|
|
446
|
+
});
|
|
447
|
+
var waitForTopologyReady = async ({
|
|
448
|
+
topology,
|
|
449
|
+
timeoutMs = START_TIMEOUT_MS
|
|
450
|
+
}) => {
|
|
451
|
+
const urls = [topology.urls.hostUrl, topology.urls.controllerBaseUrl].filter(
|
|
452
|
+
(value) => Boolean(value)
|
|
453
|
+
);
|
|
454
|
+
if (urls.length === 0) {
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
const startedAt = Date.now();
|
|
458
|
+
while (Date.now() - startedAt < timeoutMs) {
|
|
459
|
+
const statuses = await Promise.all(
|
|
460
|
+
urls.map((targetUrl) => checkUrlReady(targetUrl, topology.secure))
|
|
461
|
+
);
|
|
462
|
+
if (statuses.every(Boolean)) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
await wait(500);
|
|
466
|
+
}
|
|
467
|
+
throw new Error(
|
|
468
|
+
`Timed out waiting for Air Jam dev endpoints: ${urls.join(", ")}`
|
|
469
|
+
);
|
|
470
|
+
};
|
|
471
|
+
var tryAttachToRunningDev = async ({
|
|
472
|
+
cwd = process.cwd(),
|
|
473
|
+
gameId,
|
|
474
|
+
mode = "standalone-dev",
|
|
475
|
+
secure = false,
|
|
476
|
+
timeoutMs = 2500
|
|
477
|
+
} = {}) => {
|
|
478
|
+
try {
|
|
479
|
+
const topology = await getTopology({
|
|
480
|
+
cwd,
|
|
481
|
+
gameId,
|
|
482
|
+
mode,
|
|
483
|
+
secure
|
|
484
|
+
});
|
|
485
|
+
await waitForTopologyReady({
|
|
486
|
+
topology,
|
|
487
|
+
timeoutMs
|
|
488
|
+
});
|
|
489
|
+
return topology;
|
|
490
|
+
} catch {
|
|
491
|
+
return null;
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
var readManagedProcessLogTail = async (logPath, maxLines = 60) => {
|
|
495
|
+
if (!await pathExists(logPath)) {
|
|
496
|
+
return "";
|
|
497
|
+
}
|
|
498
|
+
const contents = await readFile(logPath, "utf8");
|
|
499
|
+
return contents.split(/\r?\n/).filter(Boolean).slice(-maxLines).join("\n");
|
|
500
|
+
};
|
|
501
|
+
var getDevStatus = async ({
|
|
502
|
+
cwd = process.cwd()
|
|
503
|
+
} = {}) => {
|
|
504
|
+
const context = await detectProjectContext({ cwd });
|
|
505
|
+
const managedProcesses = await listManagedProcessesForRoot(context.rootDir);
|
|
506
|
+
const managedPids = new Set(managedProcesses.map((entry) => entry.pid));
|
|
507
|
+
return {
|
|
508
|
+
processes: managedProcesses,
|
|
509
|
+
unmanagedProcesses: listKnownPortListeners().filter(
|
|
510
|
+
(entry) => !managedPids.has(entry.pid)
|
|
511
|
+
),
|
|
512
|
+
knownPorts: getKnownLocalDevPorts()
|
|
513
|
+
};
|
|
514
|
+
};
|
|
515
|
+
var getTopology = async ({
|
|
516
|
+
cwd = process.cwd(),
|
|
517
|
+
gameId,
|
|
518
|
+
mode = "standalone-dev",
|
|
519
|
+
secure = false
|
|
520
|
+
} = {}) => {
|
|
521
|
+
const context = await detectProjectContext({ cwd });
|
|
522
|
+
assertSupportedDevMode(context.packageJson, mode);
|
|
523
|
+
if (!isKnownProjectMode(context.mode)) {
|
|
524
|
+
throw new Error(
|
|
525
|
+
"Air Jam topology is only available in recognized Air Jam projects."
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
const resolvedGameId = await resolveRequestedGameId({
|
|
529
|
+
cwd,
|
|
530
|
+
context,
|
|
531
|
+
gameId
|
|
532
|
+
});
|
|
533
|
+
const game = resolvedGameId !== null ? await inspectGame({ cwd, gameId: resolvedGameId }) : null;
|
|
534
|
+
const controllerPath = game?.controllerPathLikely ?? DEFAULT_CONTROLLER_PATH;
|
|
535
|
+
const topologyCommand = await resolveTopologyCommand({
|
|
536
|
+
context,
|
|
537
|
+
gameId: resolvedGameId,
|
|
538
|
+
mode,
|
|
539
|
+
secure
|
|
540
|
+
});
|
|
541
|
+
const topologyResult = runCommandResult({
|
|
542
|
+
command: topologyCommand.command,
|
|
543
|
+
args: topologyCommand.args,
|
|
544
|
+
cwd: context.rootDir
|
|
545
|
+
});
|
|
546
|
+
if (!topologyResult.ok) {
|
|
547
|
+
throw new Error(
|
|
548
|
+
`Failed to inspect Air Jam topology.
|
|
549
|
+
|
|
550
|
+
${topologyResult.stderr || topologyResult.stdout}`
|
|
551
|
+
);
|
|
552
|
+
}
|
|
553
|
+
const parsed = parseJsonFromCommandOutput(
|
|
554
|
+
topologyResult.stdout
|
|
555
|
+
);
|
|
556
|
+
const surfaces = toObject(parsed.surfaces);
|
|
557
|
+
const processes = await listManagedProcessesForRoot(context.rootDir);
|
|
558
|
+
const matchingProcess = processes.find(
|
|
559
|
+
(processInfo) => processInfo.mode === mode && processInfo.secure === secure && processInfo.gameId === resolvedGameId
|
|
560
|
+
) ?? null;
|
|
561
|
+
return {
|
|
562
|
+
projectMode: context.mode,
|
|
563
|
+
mode,
|
|
564
|
+
topologyMode: topologyCommand.topologyMode,
|
|
565
|
+
gameId: resolvedGameId,
|
|
566
|
+
secure,
|
|
567
|
+
surfaces,
|
|
568
|
+
urls: buildUrlSummary({
|
|
569
|
+
mode,
|
|
570
|
+
gameId: resolvedGameId,
|
|
571
|
+
surfaces,
|
|
572
|
+
controllerPath
|
|
573
|
+
}),
|
|
574
|
+
process: matchingProcess
|
|
575
|
+
};
|
|
576
|
+
};
|
|
577
|
+
var startDev = async ({
|
|
578
|
+
cwd = process.cwd(),
|
|
579
|
+
gameId,
|
|
580
|
+
mode = "standalone-dev",
|
|
581
|
+
secure = false
|
|
582
|
+
} = {}) => {
|
|
583
|
+
const context = await detectProjectContext({ cwd });
|
|
584
|
+
assertSupportedDevMode(context.packageJson, mode);
|
|
585
|
+
if (!isKnownProjectMode(context.mode)) {
|
|
586
|
+
throw new Error(
|
|
587
|
+
"Air Jam dev start is only available in recognized Air Jam projects."
|
|
588
|
+
);
|
|
589
|
+
}
|
|
590
|
+
const resolvedGameId = await resolveRequestedGameId({
|
|
591
|
+
cwd,
|
|
592
|
+
context,
|
|
593
|
+
gameId
|
|
594
|
+
});
|
|
595
|
+
const existingProcesses = await listManagedProcessesForRoot(context.rootDir);
|
|
596
|
+
const exactMatch = existingProcesses.find(
|
|
597
|
+
(processInfo) => processInfo.mode === mode && processInfo.secure === secure && processInfo.gameId === resolvedGameId
|
|
598
|
+
) ?? null;
|
|
599
|
+
if (exactMatch) {
|
|
600
|
+
return {
|
|
601
|
+
process: exactMatch,
|
|
602
|
+
reusedExistingProcess: true,
|
|
603
|
+
topology: await getTopology({
|
|
604
|
+
cwd: context.rootDir,
|
|
605
|
+
gameId: resolvedGameId ?? void 0,
|
|
606
|
+
mode,
|
|
607
|
+
secure
|
|
608
|
+
})
|
|
609
|
+
};
|
|
610
|
+
}
|
|
611
|
+
if (existingProcesses.length > 0) {
|
|
612
|
+
throw new Error(
|
|
613
|
+
`Air Jam devtools already manages ${existingProcesses.length} running dev process(es) in ${context.rootDir}. Stop them first with airjam.stop_dev.`
|
|
614
|
+
);
|
|
615
|
+
}
|
|
616
|
+
const startCommand = await resolveStartCommand({
|
|
617
|
+
context,
|
|
618
|
+
cwd: context.rootDir,
|
|
619
|
+
gameId: resolvedGameId,
|
|
620
|
+
mode,
|
|
621
|
+
secure
|
|
622
|
+
});
|
|
623
|
+
const processId = randomUUID();
|
|
624
|
+
const logPath = getManagedProcessLogPath(context.rootDir, processId);
|
|
625
|
+
await mkdir(path2.dirname(logPath), { recursive: true });
|
|
626
|
+
const logFd = openSync(logPath, "a");
|
|
627
|
+
const supervisorPath = resolveDevtoolsHelperScript(
|
|
628
|
+
"managed-dev-supervisor.ts"
|
|
629
|
+
);
|
|
630
|
+
const supervisorDescriptor = Buffer.from(
|
|
631
|
+
JSON.stringify({
|
|
632
|
+
command: startCommand.command,
|
|
633
|
+
args: startCommand.args,
|
|
634
|
+
cwd: context.rootDir
|
|
635
|
+
}),
|
|
636
|
+
"utf8"
|
|
637
|
+
).toString("base64url");
|
|
638
|
+
const child = crossSpawn(
|
|
639
|
+
process.execPath,
|
|
640
|
+
[...resolveDevtoolsHelperArgs(supervisorPath), supervisorDescriptor],
|
|
641
|
+
{
|
|
642
|
+
cwd: context.rootDir,
|
|
643
|
+
detached: true,
|
|
644
|
+
stdio: ["ignore", logFd, logFd],
|
|
645
|
+
env: {
|
|
646
|
+
...process.env,
|
|
647
|
+
CI: process.env.CI ?? "1",
|
|
648
|
+
NO_UPDATE_NOTIFIER: "1"
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
);
|
|
652
|
+
const childExited = new Promise((resolve) => {
|
|
653
|
+
child.once("exit", (code, signal) => {
|
|
654
|
+
resolve({ code, signal });
|
|
655
|
+
});
|
|
656
|
+
});
|
|
657
|
+
try {
|
|
658
|
+
await new Promise((resolve, reject) => {
|
|
659
|
+
child.once("spawn", resolve);
|
|
660
|
+
child.once("error", reject);
|
|
661
|
+
});
|
|
662
|
+
} finally {
|
|
663
|
+
closeSync(logFd);
|
|
664
|
+
}
|
|
665
|
+
child.unref();
|
|
666
|
+
const managedProcess = {
|
|
667
|
+
id: processId,
|
|
668
|
+
pid: child.pid ?? 0,
|
|
669
|
+
cwd: context.rootDir,
|
|
670
|
+
projectMode: context.mode,
|
|
671
|
+
mode,
|
|
672
|
+
topologyMode: startCommand.topologyMode,
|
|
673
|
+
secure,
|
|
674
|
+
gameId: resolvedGameId,
|
|
675
|
+
command: startCommand.command,
|
|
676
|
+
args: startCommand.args,
|
|
677
|
+
logPath,
|
|
678
|
+
expectedLogPath: startCommand.expectedLogPath,
|
|
679
|
+
startedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
680
|
+
};
|
|
681
|
+
await writeRegistry(context.rootDir, {
|
|
682
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
683
|
+
processes: [managedProcess]
|
|
684
|
+
});
|
|
685
|
+
try {
|
|
686
|
+
const topology = await getTopology({
|
|
687
|
+
cwd: context.rootDir,
|
|
688
|
+
gameId: resolvedGameId ?? void 0,
|
|
689
|
+
mode,
|
|
690
|
+
secure
|
|
691
|
+
});
|
|
692
|
+
await Promise.race([
|
|
693
|
+
waitForTopologyReady({ topology }),
|
|
694
|
+
childExited.then(({ code, signal }) => {
|
|
695
|
+
throw new Error(
|
|
696
|
+
signal ? `Managed dev supervisor exited from signal ${signal}.` : `Managed dev supervisor exited with code ${code ?? "unknown"}.`
|
|
697
|
+
);
|
|
698
|
+
})
|
|
699
|
+
]);
|
|
700
|
+
return {
|
|
701
|
+
process: managedProcess,
|
|
702
|
+
reusedExistingProcess: false,
|
|
703
|
+
topology
|
|
704
|
+
};
|
|
705
|
+
} catch (error) {
|
|
706
|
+
await terminateManagedProcess(managedProcess.pid);
|
|
707
|
+
await writeRegistry(context.rootDir, {
|
|
708
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
709
|
+
processes: []
|
|
710
|
+
});
|
|
711
|
+
const logTail = await readManagedProcessLogTail(logPath);
|
|
712
|
+
const message = error instanceof Error ? error.message : String(error ?? "Unknown error");
|
|
713
|
+
throw new Error(
|
|
714
|
+
logTail ? `${message}
|
|
715
|
+
|
|
716
|
+
Managed dev log tail:
|
|
717
|
+
${logTail}` : message
|
|
718
|
+
);
|
|
719
|
+
}
|
|
720
|
+
};
|
|
721
|
+
var stopDev = async ({
|
|
722
|
+
cwd = process.cwd(),
|
|
723
|
+
processId,
|
|
724
|
+
mode
|
|
725
|
+
} = {}) => {
|
|
726
|
+
const context = await detectProjectContext({ cwd });
|
|
727
|
+
const processes = await listManagedProcessesForRoot(context.rootDir);
|
|
728
|
+
const selected = processes.filter((processInfo) => {
|
|
729
|
+
if (processId) {
|
|
730
|
+
return processInfo.id === processId;
|
|
731
|
+
}
|
|
732
|
+
if (mode) {
|
|
733
|
+
return processInfo.mode === mode;
|
|
734
|
+
}
|
|
735
|
+
return true;
|
|
736
|
+
});
|
|
737
|
+
for (const processInfo of selected) {
|
|
738
|
+
await terminateManagedProcess(processInfo.pid);
|
|
739
|
+
}
|
|
740
|
+
const remaining = processes.filter(
|
|
741
|
+
(processInfo) => !selected.some(
|
|
742
|
+
(selectedProcess) => selectedProcess.id === processInfo.id
|
|
743
|
+
)
|
|
744
|
+
);
|
|
745
|
+
await writeRegistry(context.rootDir, {
|
|
746
|
+
schemaVersion: DEVTOOLS_SCHEMA_VERSION,
|
|
747
|
+
processes: remaining
|
|
748
|
+
});
|
|
749
|
+
return {
|
|
750
|
+
stopped: selected
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
var resetLocalDev = async ({
|
|
754
|
+
cwd = process.cwd()
|
|
755
|
+
} = {}) => {
|
|
756
|
+
const context = await detectProjectContext({ cwd });
|
|
757
|
+
const stoppedManaged = (await stopDev({ cwd: context.rootDir })).stopped;
|
|
758
|
+
const managedPids = new Set(stoppedManaged.map((entry) => entry.pid));
|
|
759
|
+
const unmanaged = listKnownPortListeners().filter(
|
|
760
|
+
(entry) => !managedPids.has(entry.pid)
|
|
761
|
+
);
|
|
762
|
+
const stoppedUnmanaged = [];
|
|
763
|
+
for (const processInfo of unmanaged) {
|
|
764
|
+
if (!isLikelyAirJamLocalDevCommand(processInfo.command)) {
|
|
765
|
+
continue;
|
|
766
|
+
}
|
|
767
|
+
await terminateManagedProcess(processInfo.pid);
|
|
768
|
+
stoppedUnmanaged.push(processInfo);
|
|
769
|
+
}
|
|
770
|
+
await rm(
|
|
771
|
+
path2.join(context.rootDir, ".airjam", "preview-managed-server.json"),
|
|
772
|
+
{
|
|
773
|
+
force: true
|
|
774
|
+
}
|
|
775
|
+
).catch(() => void 0);
|
|
776
|
+
const stoppedPids = /* @__PURE__ */ new Set([
|
|
777
|
+
...stoppedManaged.map((entry) => entry.pid),
|
|
778
|
+
...stoppedUnmanaged.map((entry) => entry.pid)
|
|
779
|
+
]);
|
|
780
|
+
const remainingUnmanaged = listKnownPortListeners().filter(
|
|
781
|
+
(entry) => !stoppedPids.has(entry.pid)
|
|
782
|
+
);
|
|
783
|
+
return {
|
|
784
|
+
stoppedManaged,
|
|
785
|
+
stoppedUnmanaged,
|
|
786
|
+
remainingUnmanaged,
|
|
787
|
+
knownPorts: getKnownLocalDevPorts()
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
|
|
791
|
+
export {
|
|
792
|
+
resolveDevtoolsHelperScript,
|
|
793
|
+
resolveDevtoolsHelperArgs,
|
|
794
|
+
tryAttachToRunningDev,
|
|
795
|
+
getDevStatus,
|
|
796
|
+
getTopology,
|
|
797
|
+
startDev,
|
|
798
|
+
stopDev,
|
|
799
|
+
resetLocalDev
|
|
800
|
+
};
|
|
801
|
+
//# sourceMappingURL=chunk-CKFT2ZJE.js.map
|