feat: introduce device plugin runtime boundary

This commit is contained in:
DCCONSTRUCTIONS
2026-07-16 13:49:10 +03:00
parent 9225227421
commit 27bf7527df
45 changed files with 3748 additions and 1062 deletions
+27 -2
View File
@@ -1,9 +1,16 @@
# XGRIDS / LixelKity K1 plugin
This directory is the target package boundary for the first Mission Core device
plugin. The verified implementation remains temporarily in `src/k1link` so the
This directory is the package boundary for the first Mission Core device
plugin. It now owns the canonical v1alpha manifest
[`plugin.manifest.json`](plugin.manifest.json). The statically linked frontend
contribution lives in `apps/control-station/src/device-plugins/xgrids-k1/`; the
verified backend implementation remains temporarily in `src/k1link` so the
real-device path stays operational during extraction.
The v1alpha1 host deliberately assigns one model to one plugin runtime, so this
manifest exposes only `xgrids.lixelkity-k1`. Adding another device model means a
new plugin contribution until session/model routing lands in the next SDK.
The plugin owns:
- BLE discovery hints and K1 GATT metadata;
@@ -24,3 +31,21 @@ The plugin does not own:
Until extraction is complete, `src/k1link` is the compatibility source of
truth and every move into this package must preserve replay and real-device
acceptance.
Mission Core imports this plugin only from
`apps/control-station/src/composition/devicePlugins.ts`. The generic shell never
branches on this plugin ID or reads `k1_ip`, BLE candidates, MQTT topics, or
other vendor state.
Backend startup loads the reviewed factory declared by `backendEntrypoint`, then
cross-checks its plugin ID and complete action set against this manifest.
Actions enter through the host dispatcher and the transitional facade
`src/k1link/web/xgrids_k1_facade.py`. The old flat routes live in the plugin's
legacy router; both paths delegate to the same proven
`XgridsK1CompatibilityService` methods. Synchronous capture/runtime operations
run outside the FastAPI event loop.
Model switching calls the plugin deactivation hook and must receive a successful
`stream.stop` before Mission Core removes this custom UI. BLE, MQTT, codec and
evidence modules remain in `src/k1link` until replay parity and another physical
K1 regression are complete.
+53
View File
@@ -0,0 +1,53 @@
{
"apiVersion": "missioncore.nodedc/v1alpha1",
"kind": "DevicePlugin",
"metadata": {
"id": "nodedc.device.xgrids-lixelkity-k1",
"version": "0.1.0",
"displayName": "XGRIDS K1 Integration"
},
"spec": {
"hostApiRange": "v1alpha1",
"runtime": {
"backendEntrypoint": "k1link.web.xgrids_k1_facade:build_xgrids_k1_plugin",
"isolation": "transitional-in-process"
},
"permissions": [
"device.discovery.ble",
"device.provisioning.wifi-over-ble",
"network.mqtt.subscribe-private-lan",
"evidence.write-session-artifacts"
],
"actions": [
{ "id": "state.read", "mutating": false, "secretFields": [] },
{ "id": "discovery.scan", "mutating": false, "secretFields": [] },
{ "id": "network.provision", "mutating": true, "secretFields": ["password"] },
{ "id": "stream.start-live", "mutating": true, "secretFields": [] },
{ "id": "stream.start-replay", "mutating": true, "secretFields": [] },
{ "id": "stream.stop", "mutating": true, "secretFields": [] },
{ "id": "viewer.settings.update", "mutating": true, "secretFields": [] }
],
"models": [
{
"id": "xgrids.lixelkity-k1",
"vendor": "XGRIDS",
"displayName": "XGRIDS LixelKity K1",
"category": "Мобильный лидарный сканер",
"description": "Проверенный локальный профиль: BLE-настройка Wi-Fi, MQTT-приём, облако точек, поза и raw-first запись.",
"verified": true,
"capabilities": [
{ "id": "device.discovery.ble", "label": "Поиск BLE" },
{ "id": "device.provisioning.wifi-over-ble", "label": "Wi-Fi через BLE" },
{ "id": "spatial.point-cloud.live", "label": "Облако точек" },
{ "id": "spatial.pose.live", "label": "Траектория" },
{ "id": "evidence.raw-capture", "label": "Исходная запись" },
{ "id": "evidence.replay", "label": "Повтор записи" }
],
"ui": {
"slot": "device.connection",
"componentKey": "xgrids-k1.connection"
}
}
]
}
}