Template and architectural guide for developing Python plugins (utilizing GTK4 and Libadwaita user interfaces) for the Pole / NeoMir educational IDE.
Each plugin is organized as a standalone directory containing a plugin.json manifest and an executable entry point:
example-plugin/
├── meson.build # Standalone Meson build configuration
├── README.md # Plugin technical documentation
└── example/
├── plugin.json # Plugin metadata manifest
└── example_plugin.py # Executable script (GTK4/Adwaita + IPC socket client)
{
"id": "example",
"name": "Python Example Plugin",
"version": "1.0.0",
"author": "NeoMir Team",
"description": "Standard boilerplate for creating Python plugins with Adwaita UI and IPC bridge.",
"enabled": false,
"entry": "example_plugin.py"
}Plugins communicate with the host Pole application over a local Unix Domain Socket:
- Environment Variable:
NEOMIR_SOCKETorPOLE_SOCKET(injected by Pole upon process launch). - Fallback Socket Path:
$XDG_RUNTIME_DIR/neomir.sock(or/tmp/neomir.sock). - Frame Delimiter: Newline-terminated JSON strings (
\n).
| Command | Description | Payload Example |
|---|---|---|
up / down / left / right |
Move Robot actor by one cell | {"cmd": "up"} |
paint |
Mark / paint current cell | {"cmd": "paint"} |
reset |
Reset Robot actor to initial spawn position | {"cmd": "reset"} |
step_back |
Revert actor movement by one step | {"cmd": "step_back"} |
get_state |
Query coordinates, sensors, wall boundaries | {"cmd": "get_state"} |
turtle_forward |
Move Turtle forward | {"cmd": "turtle_forward", "dist": 50} |
turtle_left / turtle_right |
Turn Turtle heading angle | {"cmd": "turtle_left", "angle": 90} |
console_print |
Stream log message to Pole console | {"cmd": "console_print", "text": "Log\n"} |
console_clear |
Clear Pole console output | {"cmd": "console_clear"} |
{
"status": "ok",
"x": 2,
"y": 1,
"is_painted": false,
"crashed": false,
"wall_up": true,
"wall_down": false,
"wall_left": false,
"wall_right": false
}The plugin can be built and packaged using Meson and Ninja without external build dependencies.
meson setup _build
ninja -C _buildThis produces _build/example.plug.
ninja -C _build installDirectly installs plugin assets to $datadir/neomir/plugins/example/.
Open Settings → Extensions Tab → Click "Install from File..." (Select .plug...) and pick example.plug (or the folder directly).