Package com.inductiveautomation.ignition.designer.scripteditor.workspace.ai


@NullMarked package com.inductiveautomation.ignition.designer.scripteditor.workspace.ai
Click-to-apply configuration advice for the event-script "Ask AI" assistant.

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.