For the complete documentation index, see llms.txt. This page is also available as Markdown.
Service Extender
Service Extender — plugins for extending server functionality: notifications, integrations, automation.
Flow
PluginService Interface
InitPlugin for a service is func InitPlugin(ts any, moduleDir string, serviceConfig string) adaptix.PluginService.
Call is fire-and-forget (POST /plugin/service/call). CallRPC is the waiting form (POST /plugin/service/call_wait). Broadcasts from the server use TsPluginServiceSendDataAll and TsPluginServiceSendDataClient.
AxScript for Service (ax_config.axs)
The .axs file defines the UI for interacting with the service in GUI (settings dialogs, menus).
type PluginService interface {
Call(operator string, function string, args string)
CallRPC(operator string, function string, args string) (resultJSON string, err error)
}
// 1. Service initialization (called on load)
function InitService() {
// Optional: initial setup
}
// 2. Data handler from server
function data_handler(data) {
let response = JSON.parse(data);
switch (response.action) {
case "config":
// Show configuration dialog
buildConfigDialog(response);
break;
case "result":
if (response.success) {
ax.show_message("Success", "Operation completed!");
} else {
ax.show_message("Error", response.error);
}
break;
}
}
// Service metadata
var metadata = {
name: "My Service",
description: "Service description"
};
// Add item to Settings menu
let settings_action = menu.create_action("My Service Settings", function() {
// Request configuration from server
ax.service_command("my_service", "get_config", {});
});
menu.add_main_settings(settings_action);
// Settings dialog example
function buildConfigDialog(config) {
let label = form.create_label("API Key:");
let text_key = form.create_textline(config.api_key || "");
let check_enabled = form.create_check("Enable service");
check_enabled.setChecked(config.enabled || false);
let layout = form.create_vlayout();
layout.addWidget(label);
layout.addWidget(text_key);
layout.addWidget(check_enabled);
let dialog = form.create_dialog("Service Settings");
dialog.setSize(400, 200);
dialog.setLayout(layout);
if (dialog.exec()) {
// Send new configuration to server
ax.service_command("my_service", "set_config", {
api_key: text_key.text(),
enabled: check_enabled.isChecked()
});
}
}