Documentation
¶
Overview ¶
Package rendering implements the centralized UI rendering engine for plugin output.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine renders output blocks sent by plugins over the CoreCLIHelper RPCs.
All rendering goes to the writers the host configured, never to the plugin's own stdio. Rendering is serialized so that blocks appear in the order the plugin sent them even when a plugin sends from multiple goroutines.
func NewEngineWithWriters ¶
NewEngineWithWriters creates an Engine that writes to the given streams.
func (*Engine) HandleCommandOutput ¶
func (e *Engine) HandleCommandOutput(req *proto.SendCommandOutputRequest)
HandleCommandOutput renders output blocks sent by a plugin.
This is the only RPC that carries output, so a request may hold incremental chatter, the command's final result, or both. req.Final marks the last one.
func (*Engine) HandlePrompt ¶
func (e *Engine) HandlePrompt(req *proto.PromptRequest) *proto.PromptResponse
HandlePrompt asks the user a question and returns their answer.
Milestone 1 keeps this deliberately minimal: prompts still render as plain text and resolve to the caller's default. Interactive prompting is a separate milestone.
type EnvelopeBlock ¶
type EnvelopeBlock struct {
Type string `json:"type"`
Payload json.RawMessage `json:"payload"`
}
EnvelopeBlock represents a single output block in the JSON envelope.
type JSONEnvelope ¶
type JSONEnvelope struct {
Command string `json:"command"`
Data []EnvelopeBlock `json:"data"`
}
JSONEnvelope is the standard output format for --format=json. Only success output goes here (stdout). Errors go to stderr + non-zero exit.