UNPKG

consortium

Version:

Remote control and session sharing CLI for AI coding agents

84 lines (81 loc) • 2.21 kB
import { existsSync, unlinkSync } from 'fs'; import { execSync } from 'child_process'; import { l as logger } from './types-vIstUf63.mjs'; import { c as PLIST_FILE } from './index-Ucc63AlK.mjs'; import 'axios'; import 'chalk'; import 'node:fs'; import 'node:os'; import 'node:path'; import 'node:events'; import 'socket.io-client'; import 'zod'; import 'node:crypto'; import 'tweetnacl'; import 'node:module'; import 'util'; import 'fs/promises'; import 'os'; import 'crypto'; import 'path'; import 'url'; import 'node:child_process'; import 'node:fs/promises'; import 'node:util'; import 'http'; import 'net'; import 'expo-server-sdk'; import 'node:net'; import 'node:readline'; import 'ink'; import 'react'; import 'node:url'; import 'node:http'; import 'node:https'; import 'node:stream/promises'; import 'tar'; import 'ps-list'; import 'cross-spawn'; import 'tmp'; import 'qrcode-terminal'; import 'open'; import 'fastify'; import 'fastify-type-provider-zod'; import 'ws'; import 'playwright-core'; import 'imapflow'; import 'mailparser'; import 'yaml'; import '@modelcontextprotocol/sdk/client/index.js'; import '@modelcontextprotocol/sdk/client/streamableHttp.js'; import 'readline'; import '@modelcontextprotocol/sdk/server/mcp.js'; import '@modelcontextprotocol/sdk/server/streamableHttp.js'; import 'libsodium-wrappers'; import 'pixelmatch'; import 'pngjs'; const PLIST_LABEL = "com.consortium-cli.daemon"; async function uninstallLaunchAgent(_opts) { await uninstall(); } async function uninstall() { try { if (!existsSync(PLIST_FILE)) { logger.debug("LaunchAgent plist not found. Nothing to uninstall."); return; } try { const uid = process.getuid?.() ?? parseInt(execSync("id -u").toString().trim(), 10); execSync(`launchctl bootout gui/${uid}/${PLIST_LABEL}`, { stdio: "ignore" }); logger.debug("LaunchAgent unloaded"); } catch { logger.debug("LaunchAgent was not loaded (already stopped)"); } unlinkSync(PLIST_FILE); logger.debug(`Removed LaunchAgent plist from ${PLIST_FILE}`); } catch (error) { logger.debug("Failed to uninstall LaunchAgent:", error); throw error; } } export { uninstall, uninstallLaunchAgent };