Skip to main content
As described in Data exchange, the panel exchanges data with MN through 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:
You can reference files like this:
.., absolute paths, and paths outside the package are not allowed.

Media

After you hand media data to the panel with putMedia (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)
See Beyond the panel.

Running AI tasks

mn.ai(noteid, taskId, params) is equivalent to:
  • POST /ai/run-task
  • Request body: {noteid, taskId, params}
See Using MN’s built-in AI.

UI control

See Controlling the UI.