Class UserLibraryPromptAssist
- All Implemented Interfaces:
PromptAssist
LibraryPromptAssist over the project's user-defined script library — the Jython modules
authored under "Project Library" — letting the user drop a reference to a symbol they authored
into an AI prompt. Operates on the live, parsed project scripts maintained by ScriptIndexer, so insert-row bodies reflect the current source.
Functions, classes, and module-level values render as PromptAssist.Option.Insert rows whose body
carries the symbol's rendered documentation. Packages and script modules render as PromptAssist.Option.InsertOrDrillIn rows: confirming references the module as a whole — a body listing the
symbols directly inside it — and expanding browses into it.
Inserts produce tokens shaped @library:<path> (e.g.
@library:myUtils.helpers.calibrate, @library:myUtils.helpers), where the path is
exactly the callable name; user-library symbols need no system. prefix.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PromptAssist
PromptAssist.Option -
Constructor Summary
ConstructorsConstructorDescriptionUserLibraryPromptAssist(DesignableProject project, Supplier<Map<String, com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor>> indexSupplier) -
Method Summary
Modifier and TypeMethodDescriptionSelf-description appended to the embedded agent's system prompt.protected StringdrillInDetail(String path) Labels the row"module"whenpathresolves to a real script module (a non-folder library resource) and"package"when it is only a grouping folder.protected ScriptLibrarylibrary()The library this assist browses.Methods inherited from class LibraryPromptAssist
callablePath, id, label, options, packageDocumentation, separator
-
Constructor Details
-
UserLibraryPromptAssist
public UserLibraryPromptAssist(DesignableProject project, Supplier<Map<String, com.inductiveautomation.ignition.common.script.typing.CompletionDescriptor>> indexSupplier) - Parameters:
project- the project whose library resources refine drill-in labels (module vs package).indexSupplier- source of the parsed script index, consulted on every browse so edits surface immediately;ScriptIndexer::getIndexedScriptsoutside of tests.
-
-
Method Details
-
agentContext
Description copied from interface:PromptAssistSelf-description appended to the embedded agent's system prompt. The embed concatenates the fragments from every mounted assist into a single addendum so each provider documents its own token shape and reference-body schema in one place, decoupled from any specific agent's translation rules. Fragments are expected to be Markdown; the embed adds a heading for each assist usingPromptAssist.label()and joins them with blank lines.The embed's framing already tells the model every token is shaped
@<id>:<path>and announces this assist's@<id>:prefix in its section heading, so the fragment should not restate the generic shape. It should cover:- the grammar of the
<path>portion, with a concrete example token; - the schema of the
<reference token="...">body</reference>body the embed will attach when one of those tokens appears — the line names (Path:,Type:, …) the agent should look for and what they mean; - a one-line statement of what the reference represents semantically (so the agent can reason about it without knowing this assist exists).
- Returns:
- the Markdown fragment, or
Optional.empty()when the assist has nothing to contribute (e.g. unit-test stubs).
- the grammar of the
-
library
Description copied from class:LibraryPromptAssistThe library this assist browses. Called on everyLibraryPromptAssist.options(String)invocation, off the EDT; aScriptLibraryis a cheap fixed view, so implementations build one against their source's current state per call.- Specified by:
libraryin classLibraryPromptAssist
-
drillInDetail
Labels the row"module"whenpathresolves to a real script module (a non-folder library resource) and"package"when it is only a grouping folder.- Overrides:
drillInDetailin classLibraryPromptAssist
-