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,9 +1,18 @@
#!/usr/bin/env node
import { startDaemon } from './tspm.daemon.js';
/**
* Daemon entry point - runs process management server
* This should only be run directly by the CLI or as a systemd service
*/
// Start the daemon
startDaemon().catch((error) => {
console.error('Failed to start daemon:', error);
process.exit(1);
});
export { startDaemon } from './tspm.daemon.js';
// When executed directly (not imported), start the daemon
if (import.meta.url === `file://${process.argv[1]}`) {
import('./tspm.daemon.js').then(({ startDaemon }) => {
startDaemon().catch((error) => {
console.error('Failed to start daemon:', error);
process.exit(1);
});
});
}