Class ComponentPropsReplyRenderer

java.lang.Object
com.inductiveautomation.perspective.designer.workspace.propertyeditor.ai.ComponentPropsReplyRenderer
All Implemented Interfaces:
ReplyRenderer

public final class ComponentPropsReplyRenderer extends Object implements 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 Details

  • Method Details

    • renderStatement

      public ReplyView renderStatement(String description)
      Description copied from interface: ReplyRenderer
      Render an informational reply with no apply-able actions. The returned ReplyView is expected to carry an empty actions list — the panel will read it as a STATEMENT card.
      Specified by:
      renderStatement in interface ReplyRenderer
      Parameters:
      description - prose explanation from the model, supporting markdown.
    • getSuggestionFailure

      public @Nullable String getSuggestionFailure(String value)
      Description copied from interface: ReplyRenderer
      Check 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:
      getSuggestionFailure in interface ReplyRenderer
      Parameters:
      value - the payload ReplyRenderer.renderSuggestion(String, String) would receive.
      Returns:
      null when 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

      public ReplyView renderSuggestion(String description, String value)
      Description copied from interface: ReplyRenderer
      Render an apply-able suggestion. The value is the literal content the user can write back to the host editor; description is the prose framing. The returned view typically carries one or more apply buttons (Insert, Replace, …).
      Specified by:
      renderSuggestion in interface ReplyRenderer
      Parameters:
      description - prose explanation from the model, supporting markdown.
      value - the literal content the apply buttons hand back to the host editor.