@algosuite/vo-mcp 0.2.0-beta.56 → 0.2.0-beta.58

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.
@@ -43,12 +43,15 @@ function installWindowsAutostart(runnerCommand, log, env) {
43
43
  log(`\u26A0 Could not remove legacy launcher ${legacyCmdPath} (${error instanceof Error ? error.message : String(error)}); remove it manually to avoid a double start`);
44
44
  }
45
45
  }
46
- const hiddenCommand = `cmd /c ${runnerCommand} >> "%USERPROFILE%\\.claude\\vo-runner.log" 2>&1`.replace(/"/g, '""');
46
+ const runnerConsoleCommand = `cmd /c ${runnerCommand} >> "%USERPROFILE%\\.claude\\vo-runner.log" 2>&1`.replace(/"/g, '""');
47
47
  const launcherContent = `' Auto-start launcher for vo-mcp runner
48
48
  ' Created by vo-mcp autostart installer
49
49
  ' Keepalive supervisor: restarts the runner if it exits (parity with launchd
50
50
  ' KeepAlive on macOS and systemd Restart=on-failure on Linux).
51
- ' To stop: create %USERPROFILE%\\.claude\\vo-runner.stop, or end wscript.exe.
51
+ ' Runs the runner in a MINIMIZED (style 7), never a hidden (style 0) window:
52
+ ' hidden script-host exec trips Defender's PowhidSubExec.B heuristic and gets
53
+ ' blocked at logon. To stop: create %USERPROFILE%\\.claude\\vo-runner.stop, or
54
+ ' end wscript.exe.
52
55
  Dim sh, fso, stopFile, backoff, startedAt, ranMs
53
56
  Set sh = CreateObject("WScript.Shell")
54
57
  Set fso = CreateObject("Scripting.FileSystemObject")
@@ -62,7 +65,7 @@ Do
62
65
  WScript.Quit 0
63
66
  End If
64
67
  startedAt = Timer
65
- sh.Run "${hiddenCommand}", 0, True
68
+ sh.Run "${runnerConsoleCommand}", 7, True
66
69
  ranMs = (Timer - startedAt) * 1000
67
70
  If ranMs < 0 Then ranMs = ${WINDOWS_HEALTHY_RUN_MS}
68
71
  If ranMs >= ${WINDOWS_HEALTHY_RUN_MS} Then
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/autostart.ts", "../src/autostart-cli.ts"],
4
- "sourcesContent": ["/**\n * Cross-platform auto-start registration for `vo-mcp runner`.\n *\n * WINDOWS: Uses the user Startup folder, NOT Task Scheduler. Headless\n * `claude -p` (which the runner spawns) HANGS under the Task Scheduler\n * service session \u2014 it only runs from an interactive, Explorer-descended\n * session. The Startup folder launches the runner HIDDEN at user login via a\n * .vbs shim (wscript is windowless; a .cmd launcher always parks a console on\n * the taskbar \u2014 `start /min` minimizes, it does not hide).\n *\n * MACOS: Uses ~/Library/LaunchAgents (launchd) with RunAtLoad + KeepAlive.\n *\n * LINUX: Uses ~/.config/systemd/user (systemd user unit) with Restart=on-failure;\n * ExecStart runs via a login shell so the npm-global `vo-mcp` resolves on PATH.\n *\n * All operations are idempotent and create backups where applicable.\n */\nimport { homedir, platform } from 'node:os';\nimport { isAbsolute, join } from 'node:path';\nimport { existsSync, mkdirSync, writeFileSync, readFileSync, unlinkSync, copyFileSync } from 'node:fs';\n\nexport interface AutostartOptions {\n readonly log?: (msg: string) => void;\n readonly runnerCommand?: string; // Override for tests\n readonly env?: Readonly<Record<string, string | undefined>>;\n /**\n * Override the detected platform. Injectable ONLY so the Windows branch can be\n * exercised on a Linux CI runner \u2014 every Windows assertion in autostart.test.ts\n * used to early-return on ubuntu-latest, so no Windows autostart behaviour was\n * verified anywhere.\n */\n readonly platform?: NodeJS.Platform;\n}\n\n/**\n * Base restart backoff for the Windows keepalive loop \u2014 short enough that a real\n * crash recovers well within a heartbeat interval.\n */\nconst WINDOWS_RESTART_BACKOFF_MS = 10_000;\n\n/**\n * A run lasting at least this long counts as HEALTHY and resets the backoff.\n * Anything shorter is treated as a fast-fail and doubles the wait.\n */\nconst WINDOWS_HEALTHY_RUN_MS = 60_000;\n\n/**\n * Ceiling for the escalating backoff. Without one, a permanently broken runner\n * (missing credential, bad install) would relaunch every 10s forever \u2014 ~8,600\n * restarts a day, each appending to vo-runner.log. That is a disk-fill risk on a\n * machine nobody is watching, which is the whole premise here. launchd throttles\n * to a 10s floor and systemd has StartLimitBurst for the same reason.\n */\nconst WINDOWS_MAX_BACKOFF_MS = 300_000;\n\n/**\n * Resolve the path to the vo-mcp runner command. Defaults to 'vo-mcp runner'\n * (assumes it's in PATH). Can be overridden for tests.\n */\nfunction resolveRunnerCommand(override?: string): string {\n return override ?? 'vo-mcp runner';\n}\n\n/** Preserve one command string as a single POSIX shell argument. */\nfunction quotePosixShellArgument(value: string): string {\n if (value.includes('\\u0000') || value.includes('\\r') || value.includes('\\n')) {\n throw new Error('Runner command must not contain NUL, carriage return, or newline characters.');\n }\n return `'${value.replace(/'/gu, `'\"'\"'`)}'`;\n}\n\n/**\n * Resolve the freedesktop config root used by both the systemd user unit and\n * the runner's managed clone directory. XDG_CONFIG_HOME is valid only when it\n * is absolute; a relative value falls back to the documented ~/.config root.\n */\nfunction resolveLinuxConfigHome(\n home: string,\n env: Readonly<Record<string, string | undefined>>,\n): string {\n const configured = env['XDG_CONFIG_HOME']?.trim();\n return configured && isAbsolute(configured) ? configured : join(home, '.config');\n}\n\n/**\n * A managed launcher is current only when every byte matches the template.\n * Matching the command substring cannot distinguish an up-to-date launcher\n * from an older broken version that happens to invoke the same command.\n */\nfunction launcherIsCurrent(\n path: string,\n desiredContent: string,\n label: string,\n log: (msg: string) => void,\n): boolean {\n if (!existsSync(path)) return false;\n if (readFileSync(path, 'utf8') === desiredContent) return true;\n const backupPath = `${path}.backup-${Date.now()}`;\n copyFileSync(path, backupPath);\n log(` Backed up existing ${label} to: ${backupPath}`);\n return false;\n}\n\n/**\n * Windows: Install a launcher script in the Startup folder.\n *\n * Creates a .vbs file that starts `vo-mcp runner` with a hidden window\n * (WScript.Shell.Run window style 0 \u2014 wscript itself never shows a window,\n * unlike a .cmd whose console `start /min` only minimizes). The Startup\n * folder is %APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\.\n */\nfunction installWindowsAutostart(runnerCommand: string, log: (msg: string) => void, env: Readonly<Record<string, string | undefined>>): void {\n const appData = env['APPDATA'] ?? join(homedir(), 'AppData', 'Roaming');\n const startupDir = join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');\n mkdirSync(startupDir, { recursive: true });\n\n const launcherPath = join(startupDir, 'vo-runner.vbs');\n const legacyCmdPath = join(startupDir, 'vo-runner.cmd');\n\n // Migrate: drop the pre-.vbs minimized launcher so logon can't start two runners.\n // Best-effort \u2014 an ACL-blocked/locked .cmd must not prevent installing the .vbs.\n if (existsSync(legacyCmdPath)) {\n try {\n unlinkSync(legacyCmdPath);\n log(` Removed legacy minimized .cmd launcher: ${legacyCmdPath}`);\n } catch (error) {\n log(`\u26A0 Could not remove legacy launcher ${legacyCmdPath} (${error instanceof Error ? error.message : String(error)}); remove it manually to avoid a double start`);\n }\n }\n\n // Write the launcher. VBS escapes embedded double quotes by doubling them.\n // The hidden window discards stdio, so redirect the runner's output to the\n // same log file the macOS plist and Linux unit use \u2014 otherwise every\n // [orphan-sweep]/[orphan-reaper] warning on Windows lands nowhere.\n const hiddenCommand = `cmd /c ${runnerCommand} >> \"%USERPROFILE%\\\\.claude\\\\vo-runner.log\" 2>&1`.replace(/\"/g, '\"\"');\n // KEEPALIVE. Windows was the ONLY platform with no restart supervision: macOS\n // sets launchd `KeepAlive`, Linux sets systemd `Restart=on-failure`, and this\n // was `.Run(..., 0, False)` \u2014 fire-and-forget. If the runner died mid-session\n // nothing restarted it until the next logon, which is why a Windows host could\n // sit dead for hours (2026-07-25) with no way to reach it.\n //\n // `True` makes .Run WAIT for the process, turning this into a supervisor loop.\n // The sleep is a restart backoff so a runner failing instantly cannot spin hot.\n //\n // The stop-sentinel is the escape hatch: wscript has no console, so without it\n // the only way to stop the loop is Task Manager. The file is CONSUMED (deleted)\n // once honoured, so a later logon starts clean instead of silently refusing.\n const launcherContent = `' Auto-start launcher for vo-mcp runner\n' Created by vo-mcp autostart installer\n' Keepalive supervisor: restarts the runner if it exits (parity with launchd\n' KeepAlive on macOS and systemd Restart=on-failure on Linux).\n' To stop: create %USERPROFILE%\\\\.claude\\\\vo-runner.stop, or end wscript.exe.\nDim sh, fso, stopFile, backoff, startedAt, ranMs\nSet sh = CreateObject(\"WScript.Shell\")\nSet fso = CreateObject(\"Scripting.FileSystemObject\")\nsh.CurrentDirectory = sh.ExpandEnvironmentStrings(\"%USERPROFILE%\")\nsh.Environment(\"Process\")(\"VO_CODE_RUNNER_CLONES_ROOT\") = sh.ExpandEnvironmentStrings(\"%APPDATA%\\\\ai.algosuite.vo-runner\\\\clones\")\nstopFile = sh.ExpandEnvironmentStrings(\"%USERPROFILE%\\\\.claude\\\\vo-runner.stop\")\nbackoff = ${WINDOWS_RESTART_BACKOFF_MS}\nDo\n If fso.FileExists(stopFile) Then\n fso.DeleteFile stopFile\n WScript.Quit 0\n End If\n startedAt = Timer\n sh.Run \"${hiddenCommand}\", 0, True\n ranMs = (Timer - startedAt) * 1000\n If ranMs < 0 Then ranMs = ${WINDOWS_HEALTHY_RUN_MS}\n If ranMs >= ${WINDOWS_HEALTHY_RUN_MS} Then\n backoff = ${WINDOWS_RESTART_BACKOFF_MS}\n ElseIf backoff < ${WINDOWS_MAX_BACKOFF_MS} Then\n backoff = backoff * 2\n End If\n WScript.Sleep backoff\nLoop\n`;\n\n if (launcherIsCurrent(launcherPath, launcherContent, 'launcher', log)) {\n log(`\u2713 Auto-start is already configured (Windows Startup folder)`);\n log(` Path: ${launcherPath}`);\n return;\n }\n\n writeFileSync(launcherPath, launcherContent, 'utf8');\n log(`\u2713 Installed Windows auto-start launcher`);\n log(` Path: ${launcherPath}`);\n log(` The runner will start hidden at next login.`);\n}\n\n/**\n * Windows: Uninstall the Startup folder launcher.\n */\nfunction uninstallWindowsAutostart(log: (msg: string) => void, env: Readonly<Record<string, string | undefined>>): void {\n const appData = env['APPDATA'] ?? join(homedir(), 'AppData', 'Roaming');\n const startupDir = join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');\n // Remove the current .vbs launcher AND any legacy .cmd from older installs.\n const launcherPaths = [join(startupDir, 'vo-runner.vbs'), join(startupDir, 'vo-runner.cmd')];\n\n let removedAny = false;\n for (const launcherPath of launcherPaths) {\n if (!existsSync(launcherPath)) continue;\n unlinkSync(launcherPath);\n removedAny = true;\n log(`\u2713 Removed Windows auto-start launcher`);\n log(` Path: ${launcherPath}`);\n }\n if (!removedAny) {\n log(`\u2713 Auto-start launcher not found (already removed)`);\n }\n}\n\n/**\n * macOS: Install a launchd plist in ~/Library/LaunchAgents.\n *\n * The plist runs `vo-mcp runner` at login with RunAtLoad=true and\n * KeepAlive=true (restarts if it crashes).\n */\nasync function installMacAutostart(\n runnerCommand: string,\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const launchAgentsDir = join(home, 'Library', 'LaunchAgents');\n mkdirSync(launchAgentsDir, { recursive: true });\n\n const plistPath = join(launchAgentsDir, 'ai.algosuite.vo-runner.plist');\n\n // Parse the runner command into program + args for launchd\n const parts = runnerCommand.split(/\\s+/);\n const program = parts[0] ?? 'vo-mcp';\n const args = parts.length > 1 ? parts.slice(1) : ['runner'];\n\n const plistContent = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>ai.algosuite.vo-runner</string>\n <key>ProgramArguments</key>\n <array>\n <string>${program}</string>\n${args.map((a) => ` <string>${a}</string>`).join('\\n')}\n </array>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <true/>\n <key>WorkingDirectory</key>\n <string>${home}</string>\n <key>EnvironmentVariables</key>\n <dict>\n <key>VO_CODE_RUNNER_CLONES_ROOT</key>\n <string>${join(home, 'Library', 'Application Support', 'ai.algosuite.vo-runner', 'clones')}</string>\n </dict>\n <key>StandardOutPath</key>\n <string>${join(home, '.claude', 'vo-runner.log')}</string>\n <key>StandardErrorPath</key>\n <string>${join(home, '.claude', 'vo-runner-error.log')}</string>\n</dict>\n</plist>\n`;\n\n if (launcherIsCurrent(plistPath, plistContent, 'plist', log)) {\n log(`\u2713 Auto-start is already configured (launchd)`);\n log(` Path: ${plistPath}`);\n return;\n }\n\n writeFileSync(plistPath, plistContent, 'utf8');\n log(`\u2713 Installed launchd plist`);\n log(` Path: ${plistPath}`);\n\n // Load the plist with launchctl\n try {\n const { execSync } = await import('node:child_process');\n execSync(`launchctl load \"${plistPath}\"`, { stdio: 'ignore' });\n log(`\u2713 Loaded plist with launchctl (runner will start at next login)`);\n log(` Logs: ${join(home, '.claude', 'vo-runner.log')}`);\n } catch {\n log(`\u26A0 Failed to load plist with launchctl (you may need to load it manually)`);\n log(` Run: launchctl load \"${plistPath}\"`);\n }\n}\n\n/**\n * macOS: Uninstall the launchd plist.\n */\nasync function uninstallMacAutostart(\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const launchAgentsDir = join(home, 'Library', 'LaunchAgents');\n const plistPath = join(launchAgentsDir, 'ai.algosuite.vo-runner.plist');\n\n if (!existsSync(plistPath)) {\n log(`\u2713 Auto-start plist not found (already removed)`);\n return;\n }\n\n // Unload the plist with launchctl\n try {\n const { execSync } = await import('node:child_process');\n execSync(`launchctl unload \"${plistPath}\"`, { stdio: 'ignore' });\n log(`\u2713 Unloaded plist with launchctl`);\n } catch {\n log(`\u26A0 Failed to unload plist with launchctl (continuing anyway)`);\n }\n\n unlinkSync(plistPath);\n log(`\u2713 Removed launchd plist`);\n log(` Path: ${plistPath}`);\n}\n\n/**\n * Linux: Install a systemd USER unit at\n * $XDG_CONFIG_HOME/systemd/user/vo-runner.service (default ~/.config),\n * then enable + start it (`systemctl --user enable --now`). Restart=on-failure\n * mirrors the macOS KeepAlive. ExecStart runs via a login shell so the npm-global\n * `vo-mcp` resolves under systemd's minimal PATH.\n */\nasync function installLinuxAutostart(\n runnerCommand: string,\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const configHome = resolveLinuxConfigHome(home, env);\n const unitDir = join(configHome, 'systemd', 'user');\n mkdirSync(unitDir, { recursive: true });\n const unitPath = join(unitDir, 'vo-runner.service');\n\n const logFile = join(home, '.claude', 'vo-runner.log');\n const errFile = join(home, '.claude', 'vo-runner-error.log');\n const quotedRunnerCommand = quotePosixShellArgument(runnerCommand);\n mkdirSync(join(home, '.claude'), { recursive: true });\n\n const unit = `[Unit]\nDescription=AlgoHQ Code Runner (vo-mcp)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=${home}\nEnvironment=\"VO_CODE_RUNNER_CLONES_ROOT=${join(configHome, 'ai.algosuite.vo-runner', 'clones')}\"\nExecStart=/bin/sh -lc ${quotedRunnerCommand}\nRestart=on-failure\nRestartSec=10\nStandardOutput=append:${logFile}\nStandardError=append:${errFile}\n\n[Install]\nWantedBy=default.target\n`;\n if (launcherIsCurrent(unitPath, unit, 'unit', log)) {\n log(`\u2713 Auto-start is already configured (systemd user unit)`);\n log(` Path: ${unitPath}`);\n return;\n }\n writeFileSync(unitPath, unit, 'utf8');\n log(`\u2713 Installed systemd user unit`);\n log(` Path: ${unitPath}`);\n\n // In tests, write the unit but NEVER actually enable/start a real service.\n if (process.env['VITEST']) {\n log(` (test mode: skipping systemctl enable)`);\n return;\n }\n try {\n const { execSync } = await import('node:child_process');\n execSync('systemctl --user daemon-reload', { stdio: 'ignore' });\n execSync('systemctl --user enable --now vo-runner.service', { stdio: 'ignore' });\n log(`\u2713 Enabled + started vo-runner.service (starts at login)`);\n log(` Logs: ${logFile}`);\n } catch {\n log(`\u26A0 Could not enable via systemctl (enable it manually):`);\n log(` systemctl --user daemon-reload && systemctl --user enable --now vo-runner.service`);\n }\n}\n\n/**\n * Linux: Uninstall the systemd user unit.\n */\nasync function uninstallLinuxAutostart(\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const configHome = resolveLinuxConfigHome(home, env);\n const unitPath = join(configHome, 'systemd', 'user', 'vo-runner.service');\n if (!existsSync(unitPath)) {\n log(`\u2713 Auto-start unit not found (already removed)`);\n return;\n }\n if (!process.env['VITEST']) {\n try {\n const { execSync } = await import('node:child_process');\n execSync('systemctl --user disable --now vo-runner.service', { stdio: 'ignore' });\n log(`\u2713 Disabled + stopped vo-runner.service`);\n } catch {\n log(`\u26A0 Could not disable via systemctl (continuing anyway)`);\n }\n }\n unlinkSync(unitPath);\n log(`\u2713 Removed systemd user unit`);\n log(` Path: ${unitPath}`);\n}\n\n/**\n * Install auto-start for the runner daemon. Cross-platform.\n */\nexport async function installAutostart(opts: AutostartOptions = {}): Promise<void> {\n const log = opts.log ?? ((m: string) => console.error(m));\n const env = opts.env ?? process.env;\n const runnerCommand = resolveRunnerCommand(opts.runnerCommand);\n const plat = opts.platform ?? platform();\n\n if (plat === 'win32') {\n installWindowsAutostart(runnerCommand, log, env);\n } else if (plat === 'darwin') {\n await installMacAutostart(runnerCommand, log, env);\n } else if (plat === 'linux') {\n await installLinuxAutostart(runnerCommand, log, env);\n } else {\n log(`\u2717 Auto-start is not supported on platform: ${plat}`);\n log(` Supported platforms: win32 (Windows), darwin (macOS), linux (Linux)`);\n }\n}\n\n/**\n * Uninstall auto-start for the runner daemon. Cross-platform.\n */\nexport async function uninstallAutostart(opts: AutostartOptions = {}): Promise<void> {\n const log = opts.log ?? ((m: string) => console.error(m));\n const env = opts.env ?? process.env;\n const plat = opts.platform ?? platform();\n\n if (plat === 'win32') {\n uninstallWindowsAutostart(log, env);\n } else if (plat === 'darwin') {\n await uninstallMacAutostart(log, env);\n } else if (plat === 'linux') {\n await uninstallLinuxAutostart(log, env);\n } else {\n log(`\u2717 Auto-start is not supported on platform: ${plat}`);\n log(` Supported platforms: win32 (Windows), darwin (macOS), linux (Linux)`);\n }\n}\n", "#!/usr/bin/env node\n/**\n * `vo-mcp runner --install-autostart` / `--uninstall-autostart` CLI entrypoints.\n *\n * Registers or unregisters the runner daemon to start automatically at user login.\n */\nimport { installAutostart, uninstallAutostart } from './autostart.js';\n\nexport async function installAutostartCli(): Promise<void> {\n const log = (m: string): void => console.error(m);\n\n log('\u2501\u2501\u2501 vo-mcp runner auto-start installer \u2501\u2501\u2501\\n');\n\n await installAutostart({ log });\n\n log('\\nAuto-start is now configured. The runner will launch automatically at your next login.');\n log('To remove: vo-mcp runner --uninstall-autostart');\n}\n\nexport async function uninstallAutostartCli(): Promise<void> {\n const log = (m: string): void => console.error(m);\n\n log('\u2501\u2501\u2501 vo-mcp runner auto-start uninstaller \u2501\u2501\u2501\\n');\n\n await uninstallAutostart({ log });\n\n log('\\nAuto-start has been removed. The runner will no longer launch automatically.');\n log('To reinstall: vo-mcp runner --install-autostart');\n}\n"],
5
- "mappings": ";;;;AAiBA,SAAS,SAAS,gBAAgB;AAClC,SAAS,YAAY,YAAY;AACjC,SAAS,YAAY,WAAW,eAAe,cAAc,YAAY,oBAAoB;AAmB7F,IAAM,6BAA6B;AAMnC,IAAM,yBAAyB;AAS/B,IAAM,yBAAyB;AAM/B,SAAS,qBAAqB,UAA2B;AACvD,SAAO,YAAY;AACrB;AAGA,SAAS,wBAAwB,OAAuB;AACtD,MAAI,MAAM,SAAS,IAAQ,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,SAAS,IAAI,GAAG;AAC5E,UAAM,IAAI,MAAM,8EAA8E;AAAA,EAChG;AACA,SAAO,IAAI,MAAM,QAAQ,OAAO,OAAO,CAAC;AAC1C;AAOA,SAAS,uBACP,MACA,KACQ;AACR,QAAM,aAAa,IAAI,iBAAiB,GAAG,KAAK;AAChD,SAAO,cAAc,WAAW,UAAU,IAAI,aAAa,KAAK,MAAM,SAAS;AACjF;AAOA,SAAS,kBACP,MACA,gBACA,OACA,KACS;AACT,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AAA,EACtC,WAAW,SAAS,SAAS;AAC3B,UAAM,wBAAwB,KAAK,GAAG;AAAA,EACxC,OAAO;AACL,QAAI,mDAA8C,IAAI,EAAE;AACxD,QAAI,uEAAuE;AAAA,EAC7E;AACF;;;ACzbA,eAAsB,sBAAqC;AACzD,QAAM,MAAM,CAAC,MAAoB,QAAQ,MAAM,CAAC;AAEhD,MAAI,4EAA8C;AAElD,QAAM,iBAAiB,EAAE,IAAI,CAAC;AAE9B,MAAI,0FAA0F;AAC9F,MAAI,gDAAgD;AACtD;AAEA,eAAsB,wBAAuC;AAC3D,QAAM,MAAM,CAAC,MAAoB,QAAQ,MAAM,CAAC;AAEhD,MAAI,8EAAgD;AAEpD,QAAM,mBAAmB,EAAE,IAAI,CAAC;AAEhC,MAAI,gFAAgF;AACpF,MAAI,iDAAiD;AACvD;",
4
+ "sourcesContent": ["/**\n * Cross-platform auto-start registration for `vo-mcp runner`.\n *\n * WINDOWS: Uses the user Startup folder, NOT Task Scheduler. Headless\n * `claude -p` (which the runner spawns) HANGS under the Task Scheduler\n * service session \u2014 it only runs from an interactive, Explorer-descended\n * session. The Startup folder launches the runner at user login via a .vbs\n * supervisor shim.\n *\n * The shim runs the runner in a MINIMIZED-not-activated window (WScript.Shell.Run\n * window style 7), NOT a hidden window (style 0). Style 0 is deliberately banned:\n * a script host (wscript) launching a hidden subprocess is the exact behavioural\n * signature of Windows Defender's `Trojan:Win32/PowhidSubExec.B` heuristic\n * (\"Pow[ershell]-hid[den]-Sub[process]-Exec\"), which blocked this launch pattern on\n * a fleet box on 2026-08-29 (see docs/vo/roadmap-log/2026-08-29-defender-safe-autostart.md).\n * A Defender block at logon silently prevents the runner from ever starting, which is\n * strictly worse than a labelled minimized console the operator can see. Style 7 keeps\n * the console off the foreground (never steals focus) while staying VISIBLE, so it does\n * not match the hidden-exec heuristic \u2014 the same visibility class as the pre-2026-07\n * `start /min` launcher, which was Defender-clean for months.\n *\n * MACOS: Uses ~/Library/LaunchAgents (launchd) with RunAtLoad + KeepAlive.\n *\n * LINUX: Uses ~/.config/systemd/user (systemd user unit) with Restart=on-failure;\n * ExecStart runs via a login shell so the npm-global `vo-mcp` resolves on PATH.\n *\n * All operations are idempotent and create backups where applicable.\n */\nimport { homedir, platform } from 'node:os';\nimport { isAbsolute, join } from 'node:path';\nimport { existsSync, mkdirSync, writeFileSync, readFileSync, unlinkSync, copyFileSync } from 'node:fs';\n\nexport interface AutostartOptions {\n readonly log?: (msg: string) => void;\n readonly runnerCommand?: string; // Override for tests\n readonly env?: Readonly<Record<string, string | undefined>>;\n /**\n * Override the detected platform. Injectable ONLY so the Windows branch can be\n * exercised on a Linux CI runner \u2014 every Windows assertion in autostart.test.ts\n * used to early-return on ubuntu-latest, so no Windows autostart behaviour was\n * verified anywhere.\n */\n readonly platform?: NodeJS.Platform;\n}\n\n/**\n * Base restart backoff for the Windows keepalive loop \u2014 short enough that a real\n * crash recovers well within a heartbeat interval.\n */\nconst WINDOWS_RESTART_BACKOFF_MS = 10_000;\n\n/**\n * A run lasting at least this long counts as HEALTHY and resets the backoff.\n * Anything shorter is treated as a fast-fail and doubles the wait.\n */\nconst WINDOWS_HEALTHY_RUN_MS = 60_000;\n\n/**\n * Ceiling for the escalating backoff. Without one, a permanently broken runner\n * (missing credential, bad install) would relaunch every 10s forever \u2014 ~8,600\n * restarts a day, each appending to vo-runner.log. That is a disk-fill risk on a\n * machine nobody is watching, which is the whole premise here. launchd throttles\n * to a 10s floor and systemd has StartLimitBurst for the same reason.\n */\nconst WINDOWS_MAX_BACKOFF_MS = 300_000;\n\n/**\n * Resolve the path to the vo-mcp runner command. Defaults to 'vo-mcp runner'\n * (assumes it's in PATH). Can be overridden for tests.\n */\nfunction resolveRunnerCommand(override?: string): string {\n return override ?? 'vo-mcp runner';\n}\n\n/** Preserve one command string as a single POSIX shell argument. */\nfunction quotePosixShellArgument(value: string): string {\n if (value.includes('\\u0000') || value.includes('\\r') || value.includes('\\n')) {\n throw new Error('Runner command must not contain NUL, carriage return, or newline characters.');\n }\n return `'${value.replace(/'/gu, `'\"'\"'`)}'`;\n}\n\n/**\n * Resolve the freedesktop config root used by both the systemd user unit and\n * the runner's managed clone directory. XDG_CONFIG_HOME is valid only when it\n * is absolute; a relative value falls back to the documented ~/.config root.\n */\nfunction resolveLinuxConfigHome(\n home: string,\n env: Readonly<Record<string, string | undefined>>,\n): string {\n const configured = env['XDG_CONFIG_HOME']?.trim();\n return configured && isAbsolute(configured) ? configured : join(home, '.config');\n}\n\n/**\n * A managed launcher is current only when every byte matches the template.\n * Matching the command substring cannot distinguish an up-to-date launcher\n * from an older broken version that happens to invoke the same command.\n */\nfunction launcherIsCurrent(\n path: string,\n desiredContent: string,\n label: string,\n log: (msg: string) => void,\n): boolean {\n if (!existsSync(path)) return false;\n if (readFileSync(path, 'utf8') === desiredContent) return true;\n const backupPath = `${path}.backup-${Date.now()}`;\n copyFileSync(path, backupPath);\n log(` Backed up existing ${label} to: ${backupPath}`);\n return false;\n}\n\n/**\n * Windows: Install a launcher script in the Startup folder.\n *\n * Creates a .vbs supervisor that starts `vo-mcp runner` in a minimized,\n * non-activated window (WScript.Shell.Run window style 7). Style 0 (hidden) is\n * banned \u2014 see the Defender PowhidSubExec note in the module header. The Startup\n * folder is %APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\.\n */\nfunction installWindowsAutostart(runnerCommand: string, log: (msg: string) => void, env: Readonly<Record<string, string | undefined>>): void {\n const appData = env['APPDATA'] ?? join(homedir(), 'AppData', 'Roaming');\n const startupDir = join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');\n mkdirSync(startupDir, { recursive: true });\n\n const launcherPath = join(startupDir, 'vo-runner.vbs');\n const legacyCmdPath = join(startupDir, 'vo-runner.cmd');\n\n // Migrate: drop the pre-.vbs minimized launcher so logon can't start two runners.\n // Best-effort \u2014 an ACL-blocked/locked .cmd must not prevent installing the .vbs.\n if (existsSync(legacyCmdPath)) {\n try {\n unlinkSync(legacyCmdPath);\n log(` Removed legacy minimized .cmd launcher: ${legacyCmdPath}`);\n } catch (error) {\n log(`\u26A0 Could not remove legacy launcher ${legacyCmdPath} (${error instanceof Error ? error.message : String(error)}); remove it manually to avoid a double start`);\n }\n }\n\n // Write the launcher. VBS escapes embedded double quotes by doubling them.\n // The minimized window discards stdio, so redirect the runner's output to the\n // same log file the macOS plist and Linux unit use \u2014 otherwise every\n // [orphan-sweep]/[orphan-reaper] warning on Windows lands nowhere.\n const runnerConsoleCommand = `cmd /c ${runnerCommand} >> \"%USERPROFILE%\\\\.claude\\\\vo-runner.log\" 2>&1`.replace(/\"/g, '\"\"');\n // KEEPALIVE. Windows was the ONLY platform with no restart supervision: macOS\n // sets launchd `KeepAlive`, Linux sets systemd `Restart=on-failure`, and this\n // was `.Run(..., 0, False)` \u2014 fire-and-forget. If the runner died mid-session\n // nothing restarted it until the next logon, which is why a Windows host could\n // sit dead for hours (2026-07-25) with no way to reach it.\n //\n // `True` makes .Run WAIT for the process, turning this into a supervisor loop.\n // The sleep is a restart backoff so a runner failing instantly cannot spin hot.\n //\n // Window style 7 = MINIMIZED, not activated (NOT 0 = hidden). Style 0 triggers\n // Windows Defender's Trojan:Win32/PowhidSubExec.B heuristic (script host spawning\n // a hidden subprocess) \u2014 it blocked this pattern on a fleet box 2026-08-29, and a\n // Defender block at logon silently kills the runner. Style 7 is visible (so it\n // does not match the hidden-exec heuristic) but never steals foreground focus.\n //\n // The stop-sentinel is the escape hatch: to stop the loop cleanly, create the\n // sentinel file (or end wscript.exe). The file is CONSUMED (deleted) once\n // honoured, so a later logon starts clean instead of silently refusing.\n const launcherContent = `' Auto-start launcher for vo-mcp runner\n' Created by vo-mcp autostart installer\n' Keepalive supervisor: restarts the runner if it exits (parity with launchd\n' KeepAlive on macOS and systemd Restart=on-failure on Linux).\n' Runs the runner in a MINIMIZED (style 7), never a hidden (style 0) window:\n' hidden script-host exec trips Defender's PowhidSubExec.B heuristic and gets\n' blocked at logon. To stop: create %USERPROFILE%\\\\.claude\\\\vo-runner.stop, or\n' end wscript.exe.\nDim sh, fso, stopFile, backoff, startedAt, ranMs\nSet sh = CreateObject(\"WScript.Shell\")\nSet fso = CreateObject(\"Scripting.FileSystemObject\")\nsh.CurrentDirectory = sh.ExpandEnvironmentStrings(\"%USERPROFILE%\")\nsh.Environment(\"Process\")(\"VO_CODE_RUNNER_CLONES_ROOT\") = sh.ExpandEnvironmentStrings(\"%APPDATA%\\\\ai.algosuite.vo-runner\\\\clones\")\nstopFile = sh.ExpandEnvironmentStrings(\"%USERPROFILE%\\\\.claude\\\\vo-runner.stop\")\nbackoff = ${WINDOWS_RESTART_BACKOFF_MS}\nDo\n If fso.FileExists(stopFile) Then\n fso.DeleteFile stopFile\n WScript.Quit 0\n End If\n startedAt = Timer\n sh.Run \"${runnerConsoleCommand}\", 7, True\n ranMs = (Timer - startedAt) * 1000\n If ranMs < 0 Then ranMs = ${WINDOWS_HEALTHY_RUN_MS}\n If ranMs >= ${WINDOWS_HEALTHY_RUN_MS} Then\n backoff = ${WINDOWS_RESTART_BACKOFF_MS}\n ElseIf backoff < ${WINDOWS_MAX_BACKOFF_MS} Then\n backoff = backoff * 2\n End If\n WScript.Sleep backoff\nLoop\n`;\n\n if (launcherIsCurrent(launcherPath, launcherContent, 'launcher', log)) {\n log(`\u2713 Auto-start is already configured (Windows Startup folder)`);\n log(` Path: ${launcherPath}`);\n return;\n }\n\n writeFileSync(launcherPath, launcherContent, 'utf8');\n log(`\u2713 Installed Windows auto-start launcher`);\n log(` Path: ${launcherPath}`);\n log(` The runner will start hidden at next login.`);\n}\n\n/**\n * Windows: Uninstall the Startup folder launcher.\n */\nfunction uninstallWindowsAutostart(log: (msg: string) => void, env: Readonly<Record<string, string | undefined>>): void {\n const appData = env['APPDATA'] ?? join(homedir(), 'AppData', 'Roaming');\n const startupDir = join(appData, 'Microsoft', 'Windows', 'Start Menu', 'Programs', 'Startup');\n // Remove the current .vbs launcher AND any legacy .cmd from older installs.\n const launcherPaths = [join(startupDir, 'vo-runner.vbs'), join(startupDir, 'vo-runner.cmd')];\n\n let removedAny = false;\n for (const launcherPath of launcherPaths) {\n if (!existsSync(launcherPath)) continue;\n unlinkSync(launcherPath);\n removedAny = true;\n log(`\u2713 Removed Windows auto-start launcher`);\n log(` Path: ${launcherPath}`);\n }\n if (!removedAny) {\n log(`\u2713 Auto-start launcher not found (already removed)`);\n }\n}\n\n/**\n * macOS: Install a launchd plist in ~/Library/LaunchAgents.\n *\n * The plist runs `vo-mcp runner` at login with RunAtLoad=true and\n * KeepAlive=true (restarts if it crashes).\n */\nasync function installMacAutostart(\n runnerCommand: string,\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const launchAgentsDir = join(home, 'Library', 'LaunchAgents');\n mkdirSync(launchAgentsDir, { recursive: true });\n\n const plistPath = join(launchAgentsDir, 'ai.algosuite.vo-runner.plist');\n\n // Parse the runner command into program + args for launchd\n const parts = runnerCommand.split(/\\s+/);\n const program = parts[0] ?? 'vo-mcp';\n const args = parts.length > 1 ? parts.slice(1) : ['runner'];\n\n const plistContent = `<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n <key>Label</key>\n <string>ai.algosuite.vo-runner</string>\n <key>ProgramArguments</key>\n <array>\n <string>${program}</string>\n${args.map((a) => ` <string>${a}</string>`).join('\\n')}\n </array>\n <key>RunAtLoad</key>\n <true/>\n <key>KeepAlive</key>\n <true/>\n <key>WorkingDirectory</key>\n <string>${home}</string>\n <key>EnvironmentVariables</key>\n <dict>\n <key>VO_CODE_RUNNER_CLONES_ROOT</key>\n <string>${join(home, 'Library', 'Application Support', 'ai.algosuite.vo-runner', 'clones')}</string>\n </dict>\n <key>StandardOutPath</key>\n <string>${join(home, '.claude', 'vo-runner.log')}</string>\n <key>StandardErrorPath</key>\n <string>${join(home, '.claude', 'vo-runner-error.log')}</string>\n</dict>\n</plist>\n`;\n\n if (launcherIsCurrent(plistPath, plistContent, 'plist', log)) {\n log(`\u2713 Auto-start is already configured (launchd)`);\n log(` Path: ${plistPath}`);\n return;\n }\n\n writeFileSync(plistPath, plistContent, 'utf8');\n log(`\u2713 Installed launchd plist`);\n log(` Path: ${plistPath}`);\n\n // Load the plist with launchctl\n try {\n const { execSync } = await import('node:child_process');\n execSync(`launchctl load \"${plistPath}\"`, { stdio: 'ignore' });\n log(`\u2713 Loaded plist with launchctl (runner will start at next login)`);\n log(` Logs: ${join(home, '.claude', 'vo-runner.log')}`);\n } catch {\n log(`\u26A0 Failed to load plist with launchctl (you may need to load it manually)`);\n log(` Run: launchctl load \"${plistPath}\"`);\n }\n}\n\n/**\n * macOS: Uninstall the launchd plist.\n */\nasync function uninstallMacAutostart(\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const launchAgentsDir = join(home, 'Library', 'LaunchAgents');\n const plistPath = join(launchAgentsDir, 'ai.algosuite.vo-runner.plist');\n\n if (!existsSync(plistPath)) {\n log(`\u2713 Auto-start plist not found (already removed)`);\n return;\n }\n\n // Unload the plist with launchctl\n try {\n const { execSync } = await import('node:child_process');\n execSync(`launchctl unload \"${plistPath}\"`, { stdio: 'ignore' });\n log(`\u2713 Unloaded plist with launchctl`);\n } catch {\n log(`\u26A0 Failed to unload plist with launchctl (continuing anyway)`);\n }\n\n unlinkSync(plistPath);\n log(`\u2713 Removed launchd plist`);\n log(` Path: ${plistPath}`);\n}\n\n/**\n * Linux: Install a systemd USER unit at\n * $XDG_CONFIG_HOME/systemd/user/vo-runner.service (default ~/.config),\n * then enable + start it (`systemctl --user enable --now`). Restart=on-failure\n * mirrors the macOS KeepAlive. ExecStart runs via a login shell so the npm-global\n * `vo-mcp` resolves under systemd's minimal PATH.\n */\nasync function installLinuxAutostart(\n runnerCommand: string,\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const configHome = resolveLinuxConfigHome(home, env);\n const unitDir = join(configHome, 'systemd', 'user');\n mkdirSync(unitDir, { recursive: true });\n const unitPath = join(unitDir, 'vo-runner.service');\n\n const logFile = join(home, '.claude', 'vo-runner.log');\n const errFile = join(home, '.claude', 'vo-runner-error.log');\n const quotedRunnerCommand = quotePosixShellArgument(runnerCommand);\n mkdirSync(join(home, '.claude'), { recursive: true });\n\n const unit = `[Unit]\nDescription=AlgoHQ Code Runner (vo-mcp)\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=${home}\nEnvironment=\"VO_CODE_RUNNER_CLONES_ROOT=${join(configHome, 'ai.algosuite.vo-runner', 'clones')}\"\nExecStart=/bin/sh -lc ${quotedRunnerCommand}\nRestart=on-failure\nRestartSec=10\nStandardOutput=append:${logFile}\nStandardError=append:${errFile}\n\n[Install]\nWantedBy=default.target\n`;\n if (launcherIsCurrent(unitPath, unit, 'unit', log)) {\n log(`\u2713 Auto-start is already configured (systemd user unit)`);\n log(` Path: ${unitPath}`);\n return;\n }\n writeFileSync(unitPath, unit, 'utf8');\n log(`\u2713 Installed systemd user unit`);\n log(` Path: ${unitPath}`);\n\n // In tests, write the unit but NEVER actually enable/start a real service.\n if (process.env['VITEST']) {\n log(` (test mode: skipping systemctl enable)`);\n return;\n }\n try {\n const { execSync } = await import('node:child_process');\n execSync('systemctl --user daemon-reload', { stdio: 'ignore' });\n execSync('systemctl --user enable --now vo-runner.service', { stdio: 'ignore' });\n log(`\u2713 Enabled + started vo-runner.service (starts at login)`);\n log(` Logs: ${logFile}`);\n } catch {\n log(`\u26A0 Could not enable via systemctl (enable it manually):`);\n log(` systemctl --user daemon-reload && systemctl --user enable --now vo-runner.service`);\n }\n}\n\n/**\n * Linux: Uninstall the systemd user unit.\n */\nasync function uninstallLinuxAutostart(\n log: (msg: string) => void,\n env: Readonly<Record<string, string | undefined>>,\n): Promise<void> {\n const home = env['HOME']?.trim() || homedir();\n const configHome = resolveLinuxConfigHome(home, env);\n const unitPath = join(configHome, 'systemd', 'user', 'vo-runner.service');\n if (!existsSync(unitPath)) {\n log(`\u2713 Auto-start unit not found (already removed)`);\n return;\n }\n if (!process.env['VITEST']) {\n try {\n const { execSync } = await import('node:child_process');\n execSync('systemctl --user disable --now vo-runner.service', { stdio: 'ignore' });\n log(`\u2713 Disabled + stopped vo-runner.service`);\n } catch {\n log(`\u26A0 Could not disable via systemctl (continuing anyway)`);\n }\n }\n unlinkSync(unitPath);\n log(`\u2713 Removed systemd user unit`);\n log(` Path: ${unitPath}`);\n}\n\n/**\n * Install auto-start for the runner daemon. Cross-platform.\n */\nexport async function installAutostart(opts: AutostartOptions = {}): Promise<void> {\n const log = opts.log ?? ((m: string) => console.error(m));\n const env = opts.env ?? process.env;\n const runnerCommand = resolveRunnerCommand(opts.runnerCommand);\n const plat = opts.platform ?? platform();\n\n if (plat === 'win32') {\n installWindowsAutostart(runnerCommand, log, env);\n } else if (plat === 'darwin') {\n await installMacAutostart(runnerCommand, log, env);\n } else if (plat === 'linux') {\n await installLinuxAutostart(runnerCommand, log, env);\n } else {\n log(`\u2717 Auto-start is not supported on platform: ${plat}`);\n log(` Supported platforms: win32 (Windows), darwin (macOS), linux (Linux)`);\n }\n}\n\n/**\n * Uninstall auto-start for the runner daemon. Cross-platform.\n */\nexport async function uninstallAutostart(opts: AutostartOptions = {}): Promise<void> {\n const log = opts.log ?? ((m: string) => console.error(m));\n const env = opts.env ?? process.env;\n const plat = opts.platform ?? platform();\n\n if (plat === 'win32') {\n uninstallWindowsAutostart(log, env);\n } else if (plat === 'darwin') {\n await uninstallMacAutostart(log, env);\n } else if (plat === 'linux') {\n await uninstallLinuxAutostart(log, env);\n } else {\n log(`\u2717 Auto-start is not supported on platform: ${plat}`);\n log(` Supported platforms: win32 (Windows), darwin (macOS), linux (Linux)`);\n }\n}\n", "#!/usr/bin/env node\n/**\n * `vo-mcp runner --install-autostart` / `--uninstall-autostart` CLI entrypoints.\n *\n * Registers or unregisters the runner daemon to start automatically at user login.\n */\nimport { installAutostart, uninstallAutostart } from './autostart.js';\n\nexport async function installAutostartCli(): Promise<void> {\n const log = (m: string): void => console.error(m);\n\n log('\u2501\u2501\u2501 vo-mcp runner auto-start installer \u2501\u2501\u2501\\n');\n\n await installAutostart({ log });\n\n log('\\nAuto-start is now configured. The runner will launch automatically at your next login.');\n log('To remove: vo-mcp runner --uninstall-autostart');\n}\n\nexport async function uninstallAutostartCli(): Promise<void> {\n const log = (m: string): void => console.error(m);\n\n log('\u2501\u2501\u2501 vo-mcp runner auto-start uninstaller \u2501\u2501\u2501\\n');\n\n await uninstallAutostart({ log });\n\n log('\\nAuto-start has been removed. The runner will no longer launch automatically.');\n log('To reinstall: vo-mcp runner --install-autostart');\n}\n"],
5
+ "mappings": ";;;;AA4BA,SAAS,SAAS,gBAAgB;AAClC,SAAS,YAAY,YAAY;AACjC,SAAS,YAAY,WAAW,eAAe,cAAc,YAAY,oBAAoB;AAmB7F,IAAM,6BAA6B;AAMnC,IAAM,yBAAyB;AAS/B,IAAM,yBAAyB;AAM/B,SAAS,qBAAqB,UAA2B;AACvD,SAAO,YAAY;AACrB;AAGA,SAAS,wBAAwB,OAAuB;AACtD,MAAI,MAAM,SAAS,IAAQ,KAAK,MAAM,SAAS,IAAI,KAAK,MAAM,SAAS,IAAI,GAAG;AAC5E,UAAM,IAAI,MAAM,8EAA8E;AAAA,EAChG;AACA,SAAO,IAAI,MAAM,QAAQ,OAAO,OAAO,CAAC;AAC1C;AAOA,SAAS,uBACP,MACA,KACQ;AACR,QAAM,aAAa,IAAI,iBAAiB,GAAG,KAAK;AAChD,SAAO,cAAc,WAAW,UAAU,IAAI,aAAa,KAAK,MAAM,SAAS;AACjF;AAOA,SAAS,kBACP,MACA,gBACA,OACA,KACS;AACT,MAAI,CAAC,WAAW,IAAI,EAA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EACtC,WAAW,SAAS,SAAS;AAC3B,UAAM,wBAAwB,KAAK,GAAG;AAAA,EACxC,OAAO;AACL,QAAI,mDAA8C,IAAI,EAAE;AACxD,QAAI,uEAAuE;AAAA,EAC7E;AACF;;;AC7cA,eAAsB,sBAAqC;AACzD,QAAM,MAAM,CAAC,MAAoB,QAAQ,MAAM,CAAC;AAEhD,MAAI,4EAA8C;AAElD,QAAM,iBAAiB,EAAE,IAAI,CAAC;AAE9B,MAAI,0FAA0F;AAC9F,MAAI,gDAAgD;AACtD;AAEA,eAAsB,wBAAuC;AAC3D,QAAM,MAAM,CAAC,MAAoB,QAAQ,MAAM,CAAC;AAEhD,MAAI,8EAAgD;AAEpD,QAAM,mBAAmB,EAAE,IAAI,CAAC;AAEhC,MAAI,gFAAgF;AACpF,MAAI,iDAAiD;AACvD;",
6
6
  "names": []
7
7
  }
@@ -588,12 +588,15 @@ function installWindowsAutostart(runnerCommand, log, env) {
588
588
  log(`\u26A0 Could not remove legacy launcher ${legacyCmdPath} (${error instanceof Error ? error.message : String(error)}); remove it manually to avoid a double start`);
589
589
  }
590
590
  }
591
- const hiddenCommand = `cmd /c ${runnerCommand} >> "%USERPROFILE%\\.claude\\vo-runner.log" 2>&1`.replace(/"/g, '""');
591
+ const runnerConsoleCommand = `cmd /c ${runnerCommand} >> "%USERPROFILE%\\.claude\\vo-runner.log" 2>&1`.replace(/"/g, '""');
592
592
  const launcherContent = `' Auto-start launcher for vo-mcp runner
593
593
  ' Created by vo-mcp autostart installer
594
594
  ' Keepalive supervisor: restarts the runner if it exits (parity with launchd
595
595
  ' KeepAlive on macOS and systemd Restart=on-failure on Linux).
596
- ' To stop: create %USERPROFILE%\\.claude\\vo-runner.stop, or end wscript.exe.
596
+ ' Runs the runner in a MINIMIZED (style 7), never a hidden (style 0) window:
597
+ ' hidden script-host exec trips Defender's PowhidSubExec.B heuristic and gets
598
+ ' blocked at logon. To stop: create %USERPROFILE%\\.claude\\vo-runner.stop, or
599
+ ' end wscript.exe.
597
600
  Dim sh, fso, stopFile, backoff, startedAt, ranMs
598
601
  Set sh = CreateObject("WScript.Shell")
599
602
  Set fso = CreateObject("Scripting.FileSystemObject")
@@ -607,7 +610,7 @@ Do
607
610
  WScript.Quit 0
608
611
  End If
609
612
  startedAt = Timer
610
- sh.Run "${hiddenCommand}", 0, True
613
+ sh.Run "${runnerConsoleCommand}", 7, True
611
614
  ranMs = (Timer - startedAt) * 1000
612
615
  If ranMs < 0 Then ranMs = ${WINDOWS_HEALTHY_RUN_MS}
613
616
  If ranMs >= ${WINDOWS_HEALTHY_RUN_MS} Then