mn.api, which in turn behaves like fetch against /bridge/v1/. Every other interaction with MN works the same way: through the path system.
Path overview
window.mn methods and their paths
Using files from the add-on package
Use/pkg/ to reference files relative to the add-on package root, such as asset data, CSS, and images.
Given this add-on directory:
mn-addon
Media
After you hand media data to the panel withputMedia (see Beyond the panel › Media data), the panel can retrieve the raw bytes of that media from /media/<key>.
Calling methods defined in main.js
mn.call(name, data) is equivalent to:
POST /addon/<name>- Request body:
data(JSON)
Running AI tasks
mn.ai(noteid, taskId, params) is equivalent to:
POST /ai/run-task- Request body:
{noteid, taskId, params}
UI control
See Controlling the UI.