fix(cli): Fix internal imports, centralize IPC types and improve daemon entry/start behavior
This commit is contained in:
@@ -1,11 +1,7 @@
|
||||
import * as plugins from '../plugins.js';
|
||||
import { EventEmitter } from 'events';
|
||||
import * as paths from '../paths.js';
|
||||
import {
|
||||
ProcessMonitor,
|
||||
type IMonitorConfig,
|
||||
} from './processmonitor.js';
|
||||
import { type IProcessLog } from './processwrapper.js';
|
||||
import { ProcessMonitor } from './processmonitor.js';
|
||||
import { TspmConfig } from './tspm.config.js';
|
||||
import {
|
||||
Logger,
|
||||
@@ -14,23 +10,14 @@ import {
|
||||
ValidationError,
|
||||
handleError,
|
||||
} from '../shared/common/utils.errorhandler.js';
|
||||
import type {
|
||||
IProcessConfig,
|
||||
IProcessInfo,
|
||||
IProcessLog,
|
||||
IMonitorConfig
|
||||
} from '../shared/protocol/ipc.types.js';
|
||||
|
||||
export interface IProcessConfig extends IMonitorConfig {
|
||||
id: string; // Unique identifier for the process
|
||||
autorestart: boolean; // Whether to restart the process automatically on crash
|
||||
watch?: boolean; // Whether to watch for file changes and restart
|
||||
watchPaths?: string[]; // Paths to watch for changes
|
||||
}
|
||||
|
||||
export interface IProcessInfo {
|
||||
id: string;
|
||||
pid?: number;
|
||||
status: 'online' | 'stopped' | 'errored';
|
||||
memory: number;
|
||||
cpu?: number;
|
||||
uptime?: number;
|
||||
restarts: number;
|
||||
}
|
||||
|
||||
export class ProcessManager extends EventEmitter {
|
||||
public processes: Map<string, ProcessMonitor> = new Map();
|
||||
|
Reference in New Issue
Block a user