# Changelog ## 2025-08-29 - 4.1.0 - feat(cli) Add support for restarting all processes from CLI; improve usage message and reporting - CLI 'restart' command now accepts 'all' to restart all processes via the daemon (tspm restart all). - Improved usage/help output when no process id is provided. - CLI now prints summaries of restarted process IDs and failed restarts and sets a non-zero exit code when any restarts failed. ## 2025-08-29 - 4.0.0 - BREAKING CHANGE(cli) Add persistent process registration (tspm add), alias remove, and change start to use saved process IDs (breaking CLI behavior) - Add a new CLI command `tspm add` that registers a process configuration without starting it; daemon assigns a sequential numeric ID and returns the stored config. - Change `tspm start` to accept a process ID and start the saved configuration instead of accepting ad-hoc commands/files. This is a breaking change to the CLI contract. - Add `remove` as an alias for the existing `delete` command; both CLI and daemon now support `remove` which stops and deletes the stored process. - Daemon and IPC protocol updated to support `add` and `remove` methods; shared IPC types extended accordingly. - ProcessManager: implemented add() and getNextSequentialId() to persist configs and produce numeric IDs. - CLI registration updated (registerIpcCommand) to accept multiple command names, enabling aliases for commands. ## 2025-08-29 - 3.1.3 - fix(client) Improve IPC client robustness and daemon debug logging; update tests and package metadata - IPC client: generate unique clientId for each CLI session, increase register timeout, mark client disconnected on lifecycle events and socket errors, and surface a clearer connection error message - Daemon: add debug hooks to log client connect/disconnect and server errors to help troubleshoot IPC issues - Tests: update imports to new client/daemon locations, add helpers to start the daemon and retry connections, relax timing assertions, and improve test reliability - Package: add exports map and typings entry, update test script to run with verbose logging and longer timeout, and bump @push.rocks/smartipc to ^2.2.1 ## 2025-08-28 - 3.1.2 - fix(daemon) Reorganize project into daemon/client/shared layout, update imports and protocol, rename Tspm → ProcessManager, and bump smartipc to ^2.1.3 - Reorganized source tree: moved files into ts/daemon, ts/client and ts/shared with updated index/barrel exports. - Renamed core class Tspm → ProcessManager and updated all references. - Consolidated IPC types under ts/shared/protocol/ipc.types.ts and added protocol.version + standardized error codes. - Updated CLI to use the new client API (tspmIpcClient) and adjusted command registration/registration helpers. - Bumped dependency @push.rocks/smartipc from ^2.1.2 to ^2.1.3 to address daemon connectivity; updated daemon heartbeat behavior (heartbeatThrowOnTimeout=false). - Updated readme.plan.md to reflect completed refactor tasks and testing status. - Minor fixes and stabilization across daemon, process manager/monitor/wrapper, and client service manager implementations. ## 2025-08-28 - 3.1.1 - fix(cli) Fix internal imports, centralize IPC types and improve daemon entry/start behavior - Corrected import paths in CLI commands and utilities to use client/tspm.ipcclient and shared/common/utils.errorhandler - Centralized process/IPC type definitions into ts/shared/protocol/ipc.types.ts and updated references across daemon and client code - Refactored ts/daemon/index.ts to export startDaemon and only auto-start the daemon when the module is executed directly - Adjusted ts/index.ts exports to expose client API, shared protocol types, and daemon start entrypoint ## 2025-08-28 - 3.1.0 - feat(daemon) Reorganize and refactor core into client/daemon/shared modules; add IPC protocol and tests - Reorganized core code: split daemon and client logic into ts/daemon and ts/client directories - Moved process management into ProcessManager, ProcessMonitor and ProcessWrapper under ts/daemon - Added a dedicated IPC client and service manager under ts/client (tspm.ipcclient, tspm.servicemanager) - Introduced shared protocol and error handling: ts/shared/protocol/ipc.types.ts, protocol.version.ts and ts/shared/common/utils.errorhandler.ts - Updated CLI to import Logger from shared/common utils and updated related helpers - Added daemon entrypoint at ts/daemon/index.ts and reorganized daemon startup/shutdown/heartbeat handling - Added test assets (test/testassets/simple-test.ts, simple-script2.ts) and expanded test files under test/ - Removed legacy top-level class files (classes.*) in favor of the new structured layout ## 2025-08-28 - 3.0.2 - fix(daemon) Ensure TSPM runtime dir exists and improve daemon startup/debug output - Create ~/.tspm directory before starting the daemon to avoid missing-directory errors - Start daemon child process with stdio inherited when TSPM_DEBUG=true to surface startup errors during debugging - Add warning and troubleshooting guidance when daemon process starts but does not respond (suggest checking socket file and using TSPM_DEBUG) - Bump package version to 3.0.1 ## 2025-08-28 - 3.0.0 - BREAKING CHANGE(daemon) Refactor daemon and service management: remove IPC auto-spawn, add TspmServiceManager, tighten IPC/client/CLI behavior and tests - Remove automatic daemon spawn from the IPC client — clients now error with guidance and require the daemon to be started manually or enabled as a system service - Add TspmServiceManager to manage the daemon as a systemd service (enable/disable/reload/status) - Update IPC server/client to use SmartIpc.createServer/createClient with heartbeat defaults and explicit onMessage handlers - Daemon publishes per-process logs to topics (logs.) and re-emits ProcessMonitor logs for pub/sub - CLI updated: add enable/disable service commands, adjust daemon start/stop/status workflows and improve user hints when daemon is not running - Add/adjust integration and unit tests to cover daemon lifecycle, IPC client behavior, log streaming, heartbeat and resource reporting - Documentation expanded (README, readme.plan.md, changelog) to reflect the refactor and migration notes - Various code cleanups, formatting fixes and defensive checks across modules ## 2025-08-28 - 2.0.0 - BREAKING CHANGE(daemon) Refactor daemon lifecycle and service management: remove IPC auto-spawn, add TspmServiceManager and CLI enable/disable - Do not auto-spawn the daemon from the IPC client anymore — attempts to connect will now error with instructions to start the daemon manually or enable the system service (breaking change). - Add TspmServiceManager to manage the daemon as a systemd service via smartdaemon (enable/disable/reload/status helpers). - CLI: add 'enable' and 'disable' commands to install/uninstall the daemon as a system service and add 'daemon start-service' entrypoint used by systemd. - CLI: improve error handling and user hints when the daemon is not running (suggests `tspm daemon start` or `tspm enable`). - IPC client: removed startDaemon() and related auto-reconnect/start logic; request() no longer auto-reconnects or implicitly start the daemon. - Export TspmServiceManager from the package index so service management is part of the public API. - Updated development plan/readme (readme.plan.md) to reflect the refactor toward proper SmartDaemon integration and migration notes. ## 2025-08-26 - 1.8.0 - feat(daemon) Add real-time log streaming and pub/sub: daemon publishes per-process logs, IPC client subscribe/unsubscribe, CLI --follow streaming, and sequencing for logs - Upgrade @push.rocks/smartipc dependency to ^2.1.2 - Daemon: initialize SmartIpc server with heartbeat and publish process logs to topic `logs.`; write PID file and start heartbeat monitoring - Tspm: re-emit monitor log events as 'process:log' so daemon can broadcast logs - ProcessWrapper: include seq and runId on IProcessLog entries and maintain nextSeq/runId (adds sequencing to logs); default log buffer size applied - TspmIpcClient: improved connect options (retries, timeouts, heartbeat handling), add subscribe/unsubscribe for real-time logs, and use SmartIpc.waitForServer when starting daemon - CLI: add --follow flag to `logs` command to stream live logs, detect sequence gaps/duplicates, and handle graceful cleanup on Ctrl+C - ProcessMonitor: now extends EventEmitter and re-emits process logs for upstream consumption - Standardized heartbeat and IPC timing defaults (heartbeatInterval: 5000ms, heartbeatTimeout: 20000ms, heartbeatInitialGracePeriodMs: 10000ms) ## 2025-08-25 - 1.7.0 - feat(readme) Add comprehensive README with detailed usage, command reference, daemon management, architecture and development instructions - Expanded README from a short placeholder to a full documentation covering: Quick Start, Installation, Command Reference, Daemon Management, Monitoring & Information, Batch Operations, Architecture, Programmatic Usage, Advanced Features, Development, Debugging, Performance, and Legal information - Included usage examples and CLI command reference for start/stop/restart/delete/list/describe/logs and batch/daemon commands - Added human-friendly memory formatting and examples, process and daemon status outputs, and programmatic TypeScript usage snippet - Improved onboarding instructions: cloning, installing, testing, building, and running the project ## 2025-08-25 - 1.6.1 - fix(daemon) Fix smartipc integration and add daemon/ipc integration tests - Replace direct smartipc server/client construction with SmartIpc.createServer/createClient and set heartbeat: false - Switch IPC handler registration to use onMessage and add explicit Request/Response typing for handlers - Update IPC client to use SmartIpc.createClient and improve daemon start/connect logic - Add comprehensive tests: unit tests for TspmDaemon and TspmIpcClient and full integration tests for daemon lifecycle, process management, error handling, heartbeat and resource reporting ## 2025-08-25 - 1.6.0 - feat(daemon) Add central TSPM daemon and IPC client; refactor CLI to use daemon and improve monitoring/error handling - Add central daemon implementation (ts/classes.daemon.ts) to manage all processes via a single background service and Unix socket. - Introduce IPC client and typed IPC contracts (ts/classes.ipcclient.ts, ts/ipc.types.ts) so CLI communicates with the daemon. - Refactor CLI to use the daemon for commands (ts/cli.ts): start/stop/restart/delete/list/describe/logs/start-all/stop-all/restart-all and new daemon start/stop/status commands. - Enhance process monitoring and wrapping: ProcessMonitor and ProcessWrapper improvements (ts/classes.processmonitor.ts, ts/classes.processwrapper.ts) with better logging, memory checks, and restart behavior. - Improve centralized error handling and Logger behavior (ts/utils.errorhandler.ts). - Persist and load process configurations via TspmConfig and config storage changes (ts/classes.config.ts, ts/classes.tspm.ts). - Bump dependency and devDependency versions and add packageManager entry in package.json. - Add ts/daemon entrypoint and export daemon/ipc types from ts/index.ts; add paths for tspm runtime dir (ts/paths.ts). - Update tests and test tooling imports (test/test.ts) and adjust commitinfo and readme hints. ## 2025-03-10 - 1.5.1 - fix(core) Improve error handling, logging, and test suite; update dependency versions - Updated devDependencies versions in package.json (@git.zone/tsbuild, @push.rocks/tapbundle, and @push.rocks/smartdaemon) - Refactored error handling and enhanced logging in ProcessMonitor and ProcessWrapper modules - Improved test structure by adding clear module import tests and usage examples in test files ## 2025-03-04 - 1.5.0 - feat(cli) Enhance CLI with new process management commands - Added comprehensive CLI commands for process management including start, stop, restart, list, describe and logs. - Implemented memory string parsing for process memory limits. - Enhanced CLI output with formatted table listings for active processes. ## 2025-03-03 - 1.4.0 - feat(core) Introduced process management features using ProcessWrapper and enhanced configuration. - Added ProcessWrapper for wrapping and managing child processes. - Refactored process monitoring logic using ProcessWrapper. - Introduced TspmConfig for configuration handling. - Enhanced CLI to support new process management commands like 'startAsDaemon'. ## 2025-03-01 - 1.3.1 - fix(test) Update test script to fix type references and remove private method call - Corrected type references in test script for IMonitorConfig. - Fixed test script to use console.log instead of private method monitor.log. ## 2025-03-01 - 1.3.0 - feat(cli) Add CLI support with command parsing and version display - Added a basic CLI interface using smartcli. - Implemented command parsing with a 'restart' command. - Integrated project version display in the CLI. ## 2025-03-01 - 1.2.0 - feat(core) Introduce ProcessMonitor with memory management and spawning features - Added ProcessMonitor class with functionality to manage process execution and memory usage. - Implemented process spawning with ability to handle command arguments and directories. - Added periodic memory monitoring and automatic restarts when memory thresholds are exceeded. - ProcessMonitor now logs its actions with optional configuration name for better identification. - Updated test file to include example usage of ProcessMonitor. ## 2025-03-01 - 1.1.1 - fix(package) Update dependencies and pnpm configuration - Updated @types/node to 22.13.8 - Updated pnpm configuration to include onlyBuiltDependencies with esbuild, mongodb-memory-server, and puppeteer ## 2025-03-01 - 1.1.0 - feat(core) Introduce ProcessMonitor class and integrate native and external plugins - Added a new ProcessMonitor class to manage and monitor child processes with memory constraints. - Integrated native 'path' and external '@push.rocks/smartpath' packages in a unified plugins file. - Adjusted index and related files for improved modular structure. ## 2025-02-24 - 1.0.3 - fix(core) Corrected description in package.json and readme.md from 'task manager' to 'process manager'. - Updated the project description in package.json. - Aligned the description in readme.md with package.json. ## 2025-02-24 - 1.0.2 - fix(core) Internal changes with no functional impact. ## 2025-02-24 - 1.0.1 - initial release Initial release with baseline functionality.