Class EventStreamScriptAssistMounter

java.lang.Object
com.inductiveautomation.eventstream.designer.ai.EventStreamScriptAssistMounter

public final class EventStreamScriptAssistMounter extends Object

Utility class that attaches a shared "Ask AI" toolbar button to an Event Stream script-editing surface.

The following is surface-specific:

  • callerContext framing
  • prompt assist

Everything else is identical, so each surface is one attach(DesignerContext, ExtensionFunctionPanel, Supplier, ToolBundle, Function) call.

  • Method Details

    • attach

      public static Optional<AssistToolbarButton> attach(DesignerContext designerContext, com.inductiveautomation.ignition.designer.gui.tools.ExtensionFunctionPanel editor, Supplier<String> callerContext, ToolBundle sampleTool, Function<DesignerAiContext, List<PromptAssist>> promptAssists)
      Mounts an icon-only "Ask AI" button on editor's toolbar when the AI module is installed and ready; a no-op otherwise, so callers need not gate on readiness themselves.
      Parameters:
      designerContext - the Designer context used to reach the AI subsystem.
      editor - the extension-function editor this assistant reads from and writes back to. Its descriptor is resolved lazily (at button-click time), so it need not be set yet.
      callerContext - free-form framing describing the surface's function — what it receives, what it must return, and any conventions the agent should follow. Carries the cheap shape descriptor; the concrete sample rides sampleTool instead.
      sampleTool - the surface's on-demand "fetch a real sample event" tool, added to the agent so the model can ground itself in the concrete event data when it needs to. Evaluated on the EDT when the agent is built; pass an empty bundle for none.
      promptAssists - selects the @-reference sources to surface, given the resolved AI context the button will use — typically ai -> List.of(ai.promptAssists().tags()). Taking the context rather than the built assists lets callers reach DesignerAiContext.promptAssists() without resolving that context themselves. Applied once, while the assistant is configured; return an empty list for none.
      Returns:
      the mounted button, or empty when the AI module is absent or unconfigured. Surfaces behind an "enable" checkbox bind its enabled state to their view model's enable property, the same way they bind editor's.