feat(cli/daemon/processmonitor): Add flexible target resolution and search command; improve restart/backoff and error handling

This commit is contained in:
2025-08-30 16:55:10 +00:00
parent 22a43204d4
commit ebc20a9232
17 changed files with 327 additions and 109 deletions

View File

@@ -9,17 +9,16 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
smartcli,
'edit',
async (argvArg: CliArguments) => {
const idRaw = argvArg._[1];
if (!idRaw) {
console.error('Error: Please provide a process ID to edit');
console.log('Usage: tspm edit <id>');
const target = argvArg._[1];
if (!target) {
console.error('Error: Please provide a process target to edit');
console.log('Usage: tspm edit <id | id:N | name:LABEL>');
return;
}
const id = idRaw;
// Load current config
const { config } = await tspmIpcClient.request('describe', { id });
// Resolve and load current config
const resolved = await tspmIpcClient.request('resolveTarget', { target: String(target) });
const { config } = await tspmIpcClient.request('describe', { id: resolved.id });
// Interactive editing is temporarily disabled - needs smartinteract API update
console.log('Interactive editing is temporarily disabled.');
@@ -63,7 +62,7 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
};
const updateResponse = await tspmIpcClient.request('update', {
id,
id: resolved.id,
updates,
});
@@ -73,4 +72,3 @@ export function registerEditCommand(smartcli: plugins.smartcli.Smartcli) {
{ actionLabel: 'edit process config' },
);
}