BREAKING CHANGE(daemon): Refactor daemon and service management: remove IPC auto-spawn, add TspmServiceManager, tighten IPC/client/CLI behavior and tests

This commit is contained in:
2025-08-28 15:52:29 +00:00
parent 8e3cfb624b
commit e73f4acd63
38 changed files with 810 additions and 580 deletions

View File

@@ -4,23 +4,28 @@ import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';
export function registerStopAllCommand(smartcli: plugins.smartcli.Smartcli) {
registerIpcCommand(smartcli, 'stop-all', async (_argvArg: CliArguments) => {
console.log('Stopping all processes...');
const response = await tspmIpcClient.request('stopAll', {});
registerIpcCommand(
smartcli,
'stop-all',
async (_argvArg: CliArguments) => {
console.log('Stopping all processes...');
const response = await tspmIpcClient.request('stopAll', {});
if (response.stopped.length > 0) {
console.log(`✓ Stopped ${response.stopped.length} processes:`);
for (const id of response.stopped) {
console.log(` - ${id}`);
if (response.stopped.length > 0) {
console.log(`✓ Stopped ${response.stopped.length} processes:`);
for (const id of response.stopped) {
console.log(` - ${id}`);
}
}
}
if (response.failed.length > 0) {
console.log(`✗ Failed to stop ${response.failed.length} processes:`);
for (const failure of response.failed) {
console.log(` - ${failure.id}: ${failure.error}`);
if (response.failed.length > 0) {
console.log(`✗ Failed to stop ${response.failed.length} processes:`);
for (const failure of response.failed) {
console.log(` - ${failure.id}: ${failure.error}`);
}
process.exitCode = 1; // Signal partial failure
}
process.exitCode = 1; // Signal partial failure
}
}, { actionLabel: 'stop all processes' });
}
},
{ actionLabel: 'stop all processes' },
);
}