Plugins

Covers Engine Plugin SDK 2.0.0 · Interface Plugin SDK 0.2.0

SDK_API::registerDCodeFunction

Registers one DCode function schema and its ordinary and optional prepared handlers.

Declaration

virtual std::string registerDCodeFunction(
            std::string local_id,
            std::string name,
            DCodeFunctionHandler handler,
            std::string doc = {},
            std::vector<DCodeFunctionArgument> input_arguments = {},
            std::vector<DCodeFunctionArgument> output_arguments = {},
            DCodePreparedFunctionHandler prepared_handler = {}
        ) = 0;

Parameters

NameDescription
local_idIdentifier unique within the plugin.
nameOperator-facing function name.
handlerSynchronous JSON callback. It may mutate fixed-shape argument values in place; DCode aliases observe those changes after return.
docFunction documentation shown by DCode tooling.
input_argumentsValidated input schema, including fixed list lengths and dictionary fields when prepared.
output_argumentsValidated result schema with the same shape rules.
prepared_handlerOptional synchronous typed handler. Its mutable fixed-shape argument views and result writer live only for the call; changing argument kind or collection shape fails the call.

Returns

The plugin-qualified DCode function identifier.