Hi!
We are working on various types of integrations of our plugin with Junie, and one of the features we are exploring is sending pre-defined prompts to Junie.
Ideally, what we’d like to have is to
- define a set of common prompts for our tools,
- bind them to various feasible IDE features like (intention) actions, line markers, etc.
- and upon users invoking those features, the pre-defined prompts would either be populated into Junie’s prompt field, or could even be submitted right away in a specific mode (Auto, Code, Ask).
I’ve done a bit of digging and experimenting, and at first glance com.intellij.ml.llm.matterhorn.junie.shared.tasks.TaskService#startseems like a candidate (have no idea if it is a good one or not, and I haven’t found any other candidate).
However, upon invoking it from our plugin’s code, it yields the following exception:
com.intellij.diagnostic.PluginException: Class com.intellij.ml.llm.matterhorn.junie.core.shared.tasks.TaskChainId must not be requested from main classloader of org.jetbrains.junie plugin. Matches content module (packagePrefix=com.intellij.ml.llm.matterhorn., moduleName=matterhorn.core.main). [Plugin: ...]
at com.intellij.ide.plugins.cl.PluginClassLoader.tryLoadingClass(PluginClassLoader.kt:205)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.kt:154)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
at our.plugin.actions.SomeAction.actionPerformed(SendPromptToJunieAction.kt:37)
at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:243)
Is there a way to achieve a feature like this external to Junie, when depending on Junie or any of its modules?
If it is, could anyone please direct me to corresponding parts of the Junie codebase, and advise what and how should be invoked, what module(s) of it should we specify as dependencies, etc.?
Thanks!