Package com.inductiveautomation.ignition.designer.scripteditor.workspace.ai
The tab owns the wiring: EventScriptTab.getAssistButton() builds the assist session,
and everything here is what that session is handed. A tab opts into trigger-configuration advice
by overriding triggerConfigSupport() to return a TriggerConfigSupport; one
that returns null — the default — is left with its script and its enabled checkbox. That
support object is an abstract class the tab extends, pairing a schema with the live configuration
and a write-back, so it cannot offer a schema the tab has no way to apply; a preview is optional
and falls back to raw JSON.
Two lifetimes carry state to the model: the schema and the reply-envelope contract are agent
context sections, stated once per session, while EventScriptPromptComposer leads every
message body with the live enabled state and configuration, because the popup is non-modal and
the panel may have changed since the last submit. The model replies with { "script":
..., "config": {...}, "enabled": ... } — every member optional, an absent one meaning no
change — which EventScriptReplyRenderer validates and applies to the live tab in one
click; persistence is the tab's normal save. enabled is EventScriptTab's own,
read and written straight through the base-class checkbox, so no tab declares it.
To make a tab's trigger configurable, add its record and schema to the config
subpackage and override triggerConfigSupport(). Read scope and the config panels
inside that override, not at construction time — a tab builds its assist button from
init(), before subclass constructor bodies run — and return null from a client- or
session-scoped subclass whose panel is absent or hidden from the user.
-
ClassDescriptionContributes the event-script tab's live state as the leading blocks of each assistant message:Renders event-script assistant replies and applies an accepted suggestion to the live tab in one click.Write-backs to the live tab, each invoked on the EDT when the user clicks Apply.An event-script tab as the assistant sees it, taken fresh at each read — the popup is non-modal, so nothing may be cached across submits.One event-script tab's trigger-configuration contract with the embedded assistant: the schema a proposal must satisfy, the configuration the panel holds right now, and the write-back and preview for a proposal the user accepts.