feat(hub): expose PTY session results - #321
Merged
Merged
Conversation
|
@dvcolomban is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a public, promise-like result handle for PTY terminal sessions in @devframes/hub, allowing consumers to await completion and retrieve merged output plus process outcome details (exit code / signal, pid, killed state), including restart isolation.
Changes:
- Introduces
DevframePtyOutputandDevframePtyResult, and exposesgetResult()onDevframePtyTerminalSession. - Implements result capture/settlement per PTY run (including restart isolation) in the hub node host, and adds coverage for natural exits, non-zero exits, termination, and restart isolation.
- Updates terminals documentation and API/type snapshots to reflect the new PTY result contract.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/snapshots/tsnapi/@devframes/hub/types.snapshot.d.ts | Exposes the new PTY result types in the generated types snapshot export list. |
| tests/snapshots/tsnapi/@devframes/hub/index.snapshot.d.ts | Updates the public .d.ts snapshot to include DevframePtyOutput, DevframePtyResult, and getResult(). |
| packages/hub/src/types/terminals.ts | Defines the new PTY output/result contracts and adds getResult() to the PTY session interface. |
| packages/hub/src/node/host-terminals.ts | Captures merged PTY output per run and wires getResult() into PTY sessions (plus termination/restart interaction). |
| packages/hub/src/node/tests/host-terminals.test.ts | Adds tests validating PTY result resolution, non-zero exits, termination semantics, and restart/run isolation. |
| docs/content/5.add-ons/1.devframes/6.terminals.md | Documents getResult() behavior for PTY sessions alongside child-process sessions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
dvcolomban
marked this pull request as draft
August 31, 2026 13:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
PTY sessions provide interactive input and output, but callers cannot await a run or inspect its outcome. Consumers running finite commands need the merged terminal output, exit code, signal, and live process state without starting a separate child process.
A restarted session also needs a distinct result for each run so the previous result can settle independently while the session continues with the replacement process.
What
DevframePtyOutputand the promise-likeDevframePtyResult.getResult()on PTY terminal sessions with merged output and livepid,exitCode, andkilledgetters.DF8203, retain the previous result, and keep the session stream available for retry.killedas the portable termination indicator when deriving result and session state.Verification