Class ComponentPropsReplyRenderer
java.lang.Object
com.inductiveautomation.perspective.designer.workspace.propertyeditor.ai.ComponentPropsReplyRenderer
- All Implemented Interfaces:
ReplyRenderer
ReplyRenderer for ComponentPropsAgent. The harness delivers replies as ResponseEnvelope — a STATEMENT envelope
(clarifying question or explanation) renders as prose only; a SUGGESTION envelope's value
field is a JSON-encoded PropTreeReply payload this renderer parses, best-effort validates
each suggestion against the component's PROPS JsonSchema, and surfaces a single Apply
button that writes every change back through the DesignAdapter.-
Constructor Summary
ConstructorsConstructorDescriptionComponentPropsReplyRenderer(DesignAdapter adapter, String componentPath, @Nullable JsonSchema propsSchema, Runnable closeAfterApply) -
Method Summary
Modifier and TypeMethodDescription@Nullable StringgetSuggestionFailure(String value) Check an apply-able payload before anything renders it.renderStatement(String description) Render an informational reply with no apply-able actions.renderSuggestion(String description, String value) Render an apply-able suggestion.
-
Constructor Details
-
ComponentPropsReplyRenderer
public ComponentPropsReplyRenderer(DesignAdapter adapter, String componentPath, @Nullable JsonSchema propsSchema, Runnable closeAfterApply)
-
-
Method Details
-
renderStatement
Description copied from interface:ReplyRendererRender an informational reply with no apply-able actions. The returnedReplyViewis expected to carry an empty actions list — the panel will read it as aSTATEMENTcard.- Specified by:
renderStatementin interfaceReplyRenderer- Parameters:
description- prose explanation from the model, supporting markdown.
-
getSuggestionFailure
Description copied from interface:ReplyRendererCheck an apply-able payload before anything renders it. A renderer that rejects a payload here gets the model asked again while the turn is still open, instead of the user reading a rejection card for a reply nothing tried to fix.Unlike the render methods this runs on the sending thread, not the EDT, so an implementation must inspect only
value— no Swing state, no editor snapshot.- Specified by:
getSuggestionFailurein interfaceReplyRenderer- Parameters:
value- the payloadReplyRenderer.renderSuggestion(String, String)would receive.- Returns:
nullwhen the payload is usable. Otherwise what to tell the model, phrased for it to act on: what was wrong and what to send instead.
-
renderSuggestion
Description copied from interface:ReplyRendererRender an apply-able suggestion. Thevalueis the literal content the user can write back to the host editor;descriptionis the prose framing. The returned view typically carries one or more apply buttons (Insert, Replace, …).- Specified by:
renderSuggestionin interfaceReplyRenderer- Parameters:
description- prose explanation from the model, supporting markdown.value- the literal content the apply buttons hand back to the host editor.
-