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:
@@ -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'>) => {
|
||||
|
Reference in New Issue
Block a user