feat(hub): expose terminal session output events - #301
Closed
dvcolomban wants to merge 1 commit into
Closed
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
Author
|
Closing after narrowing the requirement. Existing client streaming covers the live terminal UI, and the bounded session buffer is sufficient for any later on-demand tail reader. There is no current server-side live observer, so this public event would have no active consumer. |
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.
What changed
terminals:session:outputevent carrying the session id and each consumed output chunkWhy
Hub hosts sometimes need to observe terminal output on the server side to relay selected sessions into another logging or observability system, or to derive diagnostics and application state. The existing terminal streaming channel is designed for connected RPC clients, not code already running inside the host process.
session.buffercannot provide an exact live feed. It retains only the latest 1,000 chunks, exposes no output notification or public sequence cursor, and mutates as older chunks are removed. A polling observer can therefore miss output when the buffer rotates and cannot reliably distinguish repeated chunks from chunks it already forwarded.The terminal host must remain the only reader of a
ReadableStream. Creating an RPC client that connects back to the same Hub would add transport, authentication, replay, and reconnect behavior just to observe data already in the process. A local event provides an opt-in observation point without competing for the stream, changing buffering, or introducing that loopback connection.Contract
The event is live-only and local to the node process. It does not replay buffered output or cross the client protocol. Every chunk already consumed by the terminal host is emitted once as
(sessionId, chunk)before the existing buffer and client-stream fan-out.Validation