mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
When a program started by the process operation exits on its own, the daemon now ends its process group (Unix) or its own job object (Windows) before reaping it, so a wrapper like npx does not leave its server running. The pid leaves the tracked groups before it is reaped, so a racing close cannot signal a reused pid.
4.1 KiB
4.1 KiB
Changelog
[Unreleased]
Added
- The daemon's
processoperation runs a program with plain pipes for stdin, stdout and stderr, for programs that speak a protocol on stdin and stdout such as MCP servers:processWriteandprocessCloseStdinfeed its stdin in arrival order, output arrives as raw bytes per stream, and cancelling, a lost connection or the program's own exit kills its process group (on Windows, its job object), so a wrapper such asnpxthat exits leaves nothing running.helloreports it infeatures.openProcess()returns aRemoteProcess; daemons released before it fail the open withnot_supported. Unlike terminals, it works on Windows too.
Fixed
- On Windows, an
execcommand's output readers stop once the command has settled, also while a descendant keeps a pipe open without writing; they stayed blocked until it exited, because cancelling a blocked read did not reach the standard library's overlapped pipe I/O.
[1.5.0] - 2026-11-02
Breaking Changes
RemoteWatcherfollows Durable'sFileWatcher:close(context)isstop(context), and its changes are tagged ({ kind: "paths", paths },{ kind: "overflow" },{ kind: "failed", error }). The daemon'swatchprotocol is unchanged. Migration:await watcher.close(ctx)becomesawait watcher.stop(ctx); testchange.kindinstead of"overflow" in changeor"error" in change.
Fixed
execandptyfail withspawn_errorinstead of hanging when the daemon cannot start a helper thread (for example at a cgroup task limit); the started command is killed and reaped (#11433).Connection.close()on Unix no longer leaves running commands behind: the daemon used to die from the client'sSIGTERMbefore killing its process groups. It now kills them onSIGTERM,SIGINTorSIGHUPbefore exiting.
[1.4.0] - 2026-10-21
[1.3.0] - 2026-10-15
[1.2.0] - 2026-10-12
Added
- The daemon's
listFilesoperation: a bounded, cancellable, gitignore-aware listing of a directory tree (files, directories and unfollowed symlinks);helloreports it infeatures, and older daemons answernot_supportedwithout a request. RemoteExecutionEnv.listFilesandLocalExecutionEnv, a localExecutionEnvon a pi-env daemon connection with the same operations.nodePlatform(info)maps the daemon's platform and architecture names to Node's.- Pseudo-terminals for interactive programs: the daemon's
pty,ptyWrite, andptyResizeoperations stream raw terminal output as events, write input in arrival order, sendSIGWINCHon resize, and kill the process group on cancel or a lost connection.openTerminal()returns aRemoteTerminal, andlocalDaemon()starts the daemon for this machine. Unix only; Windows answersENOTSUP. RemoteTerminal.foreground()(daemonptyForeground) reports the process group in front of a terminal when it is not the program's own, such as a job its shell runs, with the leader's name on macOS and Linux (TerminalForeground).
[1.1.0] - 2026-10-07
[1.0.4] - 2026-10-05
Added
- Initial release of
@earendil-works/pi-env:RemoteExecutionEnv, a DurableExecutionEnvon another machine, andConnectionto thepi-envdaemon that runs there. Results matchNodeExecutionEnvon that machine on Linux, macOS, Android and Windows. The daemon watches files natively (polling on Windows and network file systems), honors output windows so dropped command output is not transferred, and keeps control replies ahead of bulk output; watchers reportoverflowand resume after a lost connection. - SSH bootstrap:
connectSshdetects the remote system, deploys the daemon this package ships for it (named by its SHA-256 and verified before every start), and connects;sshConnectiondoes the same lazily at the first operation, so building an environment never needs the network without forwarding, shared connections or configured commands;loginShellstarts it through the user's login shell, and Termux hosts get setup warnings.scanHostKey,acceptHostKeyandforgetHostKeymanage trusted host keys; a changed key is never accepted without removing the old one.