BREAKING CHANGE(cli): Add persistent process registration (tspm add), alias remove, and change start to use saved process IDs (breaking CLI behavior)

This commit is contained in:
2025-08-29 09:43:54 +00:00
parent 0427d38c7d
commit 4db128edaf
10 changed files with 263 additions and 142 deletions

View File

@@ -171,6 +171,31 @@ export class TspmDaemon {
);
// Query handlers
this.ipcServer.onMessage(
'add',
async (request: RequestForMethod<'add'>) => {
try {
const id = await this.tspmInstance.add(request.config as any);
const config = this.tspmInstance.processConfigs.get(id)!;
return { id, config };
} catch (error) {
throw new Error(`Failed to add process: ${error.message}`);
}
},
);
this.ipcServer.onMessage(
'remove',
async (request: RequestForMethod<'remove'>) => {
try {
await this.tspmInstance.delete(request.id);
return { success: true, message: `Process ${request.id} deleted successfully` };
} catch (error) {
throw new Error(`Failed to remove process: ${error.message}`);
}
},
);
this.ipcServer.onMessage(
'list',
async (request: RequestForMethod<'list'>) => {