Extending Functionality Using Add-ons

The Oxygen AI Positron add-on offers advanced options for developers to extend its functionality. The following sections provide an overview of the main extension points available:

AI Connectors Extension
This extension point lets developers build an add-on that adds an AI connector to the Oxygen AI Positron. It enables connections to AI providers that are not covered by our built-in options.
To create a connector, follow these steps:
  1. Add oxygen-ai-positron-api as a dependency in your plugin project's pom.xml:
    <dependency>
      <groupId>com.oxygenxml</groupId>
      <artifactId>oxygen-ai-positron-api</artifactId>
      <version>8.5.0</version>
      <scope>provided</scope>
    </dependency>
  2. The oxygen-ai-positron-api artifact is available from a public repository at https://oxygenxml.com/maven/. To use this artifact in your plugin project, add the repository configuration to your project's pom.xml file:
     <repository>
       <id>oxygen-public-repo</id>
      <url>https://www.oxygenxml.com/maven/</url>
     </repository>
  3. Implement the ro.sync.exml.plugin.ai.AIConnectorsPluginExtension interface in your plugin's libraries.
  4. In the plugin descriptor file, define the <extension> element that points to the implementation of your classes:
    <extension type="AIConnectors" class="my.pack.CustomAIConnectorsProviderPluginExtension"/>
A sample plugin is available to show how to create a connector for a custom AI service that uses a REST API to provide OpenAI chat completions. You can find it here: https://github.com/oxygenxml/oxygen-ai-positron-custom-connector-addon
Key Concepts for 'oxygen-ai-positron-api':

The oxygen-ai-positron-api artifact provides the types used to declare a connector, expose UI parameters, and implement the runtime service.

AIConnector
Declares a connector that appears in Preferences and links the UI configuration to an AIService implementation. It does the following:
  • Defines the identity and display name (getConnectorId, getConnectorName).
  • Exposes the list of UI parameters (getParametersList).
  • Creates the runtime service (createAIService).
  • Optionally adapts outgoing requests (configureCompletionRequest).
AIService
Encapsulates calls to the AI backend (chat completions in streaming and non-streaming mode, moderation).
ConnectorParamBase parameters
Typed parameters drive both the Preferences UI and, when relevant, the AI Positron side-view. Common parameter types include:
  • TextFieldConnectorParam (e.g. base URL, model)
  • PasswordTextFieldConnectorParam (e.g. API key)
  • CheckBoxConnectorParam (e.g. moderation, streaming)
  • KeyValueTableConnectorParam (e.g. extra headers, extra query params)
  • ModelsComboConnectorParam (supplies the model combo in Preferences and the side-view)

For a code-level example of a connector class, see https://github.com/oxygenxml/oxygen-ai-positron-custom-connector-addon/blob/main/src/main/java/com/oxygenxml/positron/custom/connector/CustomAIConnector.java.

Note:
The AIConnectors extension type can be implemented starting with version 27.1 of Oxygen XML Web Author.
AI Tools Extension
The AI Tools extension point lets developers add their own custom callback tools or replace the built-in ones. This makes it possible to create custom interactions with AI engines.
To implement a tool, follow these steps:
  1. Implement the ro.sync.exml.plugin.ai.AIFunctionsPluginExtension interface in your plugin's libraries.
  2. In the plugin descriptor file, define the <extension> element that points to the implementation of your classes:
    <extension type="AIFunctions" class="my.pack.CustomAIFunctionsProviderPluginExtension"/>
Note:
The AIFunctions extension type can be implemented starting with version 27.1 of Oxygen XML Web Author.
MCP Server Configurations Extension
The MCP Server Configurations extension point lets developers add HTTP streamable MCP server configurations to AI Positron without needing to adjust AI Positron preferences.
To implement a tool, follow these steps:
  1. Implement the ro.sync.exml.plugin.ai.MCPServerConfigurationsPluginExtension interface in your plugin's libraries.
  2. In your implementation, return one or more instances of com.oxygenxml.positron.api.mcp.HTTPStreamableMCPServerConfig. Each instance must provide:
    • The MCP server name.
    • The server HTTP URL.
    • A map of static HTTP headers.
    • A provider for dynamic HTTP headers. The MCPDynamicHeadersProvider can receive context information from the application.
    • A refresher that can call an API to refresh all MCP server connections.
  3. In the plugin descriptor file, define the <extension> element that points to the implementation of your classes:
    <extension type="MCPServerConfigurations" class="my.pack.CustomMCPServerConfigurationsPluginExtension"/>
Note:
This extension point can be used with version 29.0 and newer of Oxygen XML Web Author.
AI Hooks Handler Extension
The AI Hooks Handler extension point lets developers intercept the events fired during the AI lifecycle (such as before a file is edited, before a tool is used, or after the agent responds). A hook handler can observe events for auditing or analytics, or veto blocking events to prevent an action from running.
To implement a hook handler, implement the ro.sync.exml.plugin.ai.AIHooksHandlerPluginExtension interface and declare it in the plugin descriptor file:
<extension type="AIHooksHandler" class="my.pack.CustomAIHooksHandlerPluginExtension"/>
For the list of available events, their payload, and a sample implementation, see Intercepting AI Events Using Hooks.