import * as plugins from '../../../plugins.js'; import { tspmIpcClient } from '../../../classes.ipcclient.js'; import type { CliArguments } from '../../types.js'; import { registerIpcCommand } from '../../registration/index.js'; export function registerStopCommand(smartcli: plugins.smartcli.Smartcli) { registerIpcCommand(smartcli, 'stop', async (argvArg: CliArguments) => { const id = argvArg._[1]; if (!id) { console.error('Error: Please provide a process ID'); console.log('Usage: tspm stop '); return; } console.log(`Stopping process: ${id}`); const response = await tspmIpcClient.request('stop', { id }); if (response.success) { console.log(`✓ ${response.message}`); } else { console.error(`✗ Failed to stop process: ${response.message}`); } }, { actionLabel: 'stop process' }); }