Lines 2489-2529javascript
2489function killOrphanedProcesses() {
2491 const { reaped, skipped } = reapRegisteredPtys();
2492 if (reaped.length > 0) {
2493 console.log(`[Main] Reaped ${reaped.length} orphaned PTY process tree(s):`, reaped);
2495 if (skipped.length > 0) {
2496 console.log(`[Main] Skipped ${skipped.length} already-dead PTY record(s) from registry`);
2501var mainWindow = null;
2502var watcherProcess = null;
2503var relay = new TerminalRelay(() => mainWindow);
2504var teamsService = null;
2505var pendingHardReload = false;
2506function startFileWatcher() {
2507 const copilotOfficePath = path8.join(process.cwd(), "CopilotOffice");
2508 if (!fs7.existsSync(path8.join(copilotOfficePath, "package.json"))) {
2509 if (fs7.existsSync(path8.join(process.cwd(), "src", "main.ts"))) {
2510 watcherProcess = (0, import_child_process4.spawn)("npx", ["esbuild", "src/main.ts", "--bundle", "--outfile=dist/game.bundle.js", "--platform=browser", "--format=iife", "--global-name=CopilotOffice", "--watch"], {
2511 cwd: process.cwd(),
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/electron/main.jsView on unpkg · L2509 2517 watcherProcess = (0, import_child_process4.spawn)("npx", ["esbuild", "src/main.ts", "--bundle", "--outfile=dist/game.bundle.js", "--platform=browser", "--format=iife", "--global-name=CopilotOffice", "--watch"], {
2518 cwd: copilotOfficePath,
2523 if (watcherProcess) {
2524 watcherProcess.stdout?.on("data", (data) => {
2525 const msg = data.toString();
2526 console.log("[Watcher]", msg);
2527 if (msg.includes("watching") || msg.includes("built")) {
2528 if (mainWindow && !mainWindow.isDestroyed()) {
2529 mainWindow.webContents.send("build-complete");