feat(bridge): establish local pi status bridge

Deliver the initial local bridge, Noctalia v4/v5 adapters, desktop client, service unit, tests, and implementation documentation for persistent Pi status and control.
This commit is contained in:
2026-07-27 14:51:45 +02:00
commit b7fea83ed6
91 changed files with 15029 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { execFile } from "node:child_process";
import { promisify } from "node:util";
const execFileAsync = promisify(execFile);
export async function publishNoctaliaState(
state,
{ execute = async (command, args) => execFileAsync(command, args) } = {},
) {
if (!state || typeof state !== "object")
throw new TypeError("state is required");
const { state: bridgeState, projectLabel, attentionCount, detail } = state;
if (
typeof bridgeState !== "string" ||
typeof projectLabel !== "string" ||
!Number.isSafeInteger(attentionCount) ||
typeof detail !== "string"
) {
throw new TypeError(
"state must contain string state/projectLabel/detail and integer attentionCount",
);
}
await execute("qs", [
"-c",
"noctalia-shell",
"ipc",
"call",
"plugin:pi-status-bridge",
"setBridgeState",
bridgeState,
projectLabel,
String(attentionCount),
detail,
]);
}