fix(cli): Fix internal imports, centralize IPC types and improve daemon entry/start behavior

This commit is contained in:
2025-08-28 18:34:56 +00:00
parent 529a403c4b
commit 4ee4bcdda2
20 changed files with 95 additions and 72 deletions

View File

@@ -1,5 +1,5 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';

View File

@@ -1,5 +1,5 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';

View File

@@ -1,5 +1,5 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';

View File

@@ -1,7 +1,7 @@
import * as plugins from '../../../plugins.js';
import * as paths from '../../../paths.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { Logger } from '../../../utils.errorhandler.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import { Logger } from '../../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../../types.js';
import { formatMemory } from '../../helpers/memory.js';
@@ -83,7 +83,7 @@ export function registerDaemonCommand(smartcli: plugins.smartcli.Smartcli) {
case 'start-service':
// This is called by systemd - start the daemon directly
console.log('Starting TSPM daemon for systemd service...');
const { startDaemon } = await import('../../../classes.daemon.js');
const { startDaemon } = await import('../../../daemon/tspm.daemon.js');
await startDaemon();
break;

View File

@@ -1,7 +1,7 @@
import * as plugins from '../../plugins.js';
import * as paths from '../../paths.js';
import { tspmIpcClient } from '../../classes.ipcclient.js';
import { Logger } from '../../utils.errorhandler.js';
import { tspmIpcClient } from '../../client/tspm.ipcclient.js';
import { Logger } from '../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../types.js';
import { pad } from '../helpers/formatting.js';
import { formatMemory } from '../helpers/memory.js';

View File

@@ -1,5 +1,5 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';
import { formatMemory } from '../../helpers/memory.js';

View File

@@ -1,5 +1,5 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../classes.ipcclient.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { CliArguments } from '../../types.js';
import { registerIpcCommand } from '../../registration/index.js';
import { getBool, getNumber } from '../../helpers/argv.js';

View File

@@ -1,6 +1,6 @@
import * as plugins from '../../../plugins.js';
import { tspmIpcClient } from '../../../client/tspm.ipcclient.js';
import type { IProcessConfig } from '../../../classes.tspm.js';
import type { IProcessConfig } from '../../../shared/protocol/ipc.types.js';
import type { CliArguments } from '../../types.js';
import { parseMemoryString, formatMemory } from '../../helpers/memory.js';
import { registerIpcCommand } from '../../registration/index.js';

View File

@@ -1,6 +1,6 @@
import * as plugins from '../../../plugins.js';
import { TspmServiceManager } from '../../../classes.servicemanager.js';
import { Logger } from '../../../utils.errorhandler.js';
import { TspmServiceManager } from '../../../client/tspm.servicemanager.js';
import { Logger } from '../../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../../types.js';
export function registerDisableCommand(smartcli: plugins.smartcli.Smartcli) {

View File

@@ -1,6 +1,6 @@
import * as plugins from '../../../plugins.js';
import { TspmServiceManager } from '../../../classes.servicemanager.js';
import { Logger } from '../../../utils.errorhandler.js';
import { TspmServiceManager } from '../../../client/tspm.servicemanager.js';
import { Logger } from '../../../shared/common/utils.errorhandler.js';
import type { CliArguments } from '../../types.js';
export function registerEnableCommand(smartcli: plugins.smartcli.Smartcli) {