fix(daemon): Improve daemon log delivery and process monitor memory accounting; gate debug output and update tests to numeric ProcessId

This commit is contained in:
2025-08-30 21:50:43 +00:00
parent 3b21a338fb
commit c694672438
7 changed files with 115 additions and 40 deletions

View File

@@ -1,5 +1,6 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as tspm from '../ts/index.js';
import { toProcessId } from '../ts/shared/protocol/id.js';
import { join } from 'path';
// Basic module import test
@@ -51,7 +52,7 @@ async function exampleUsingIpcClient() {
// Start a process using the request method
await client.request('start', {
config: {
id: 'web-server',
id: toProcessId(2001),
name: 'Web Server',
projectDir: '/path/to/web/project',
command: 'npm run serve',
@@ -65,7 +66,7 @@ async function exampleUsingIpcClient() {
// Start another process
await client.request('start', {
config: {
id: 'api-server',
id: toProcessId(2002),
name: 'API Server',
projectDir: '/path/to/api/project',
command: 'npm run api',
@@ -80,13 +81,13 @@ async function exampleUsingIpcClient() {
// Get logs from a process
const logs = await client.request('getLogs', {
id: 'web-server',
id: toProcessId(2001),
lines: 20,
});
console.log('Web server logs:', logs.logs);
// Stop a process
await client.request('stop', { id: 'api-server' });
await client.request('stop', { id: toProcessId(2002) });
// Handle graceful shutdown
process.on('SIGINT', async () => {