feat(cli): Add interactive edit command and update support for process configurations

This commit is contained in:
2025-08-30 14:02:22 +00:00
parent 5036f01516
commit 311a536fae
9 changed files with 185 additions and 3 deletions

View File

@@ -197,6 +197,32 @@ export class ProcessManager extends EventEmitter {
}
}
/**
* Update an existing process configuration
*/
public async update(
id: ProcessId,
updates: Partial<Omit<IProcessConfig, 'id'>>,
): Promise<IProcessConfig> {
const existing = this.processConfigs.get(id);
if (!existing) {
throw new ValidationError(
`Process with id '${id}' does not exist`,
'ERR_PROCESS_NOT_FOUND',
);
}
// Shallow merge; keep id intact
const merged: IProcessConfig = {
...existing,
...updates,
} as IProcessConfig;
this.processConfigs.set(id, merged);
await this.saveProcessConfigs();
return merged;
}
/**
* Stop a process by id
*/