refactor!: remove redundant compatibility layers
Use native browser and Tauri behavior instead of custom selector, dialog, and window-state implementations. Remove obsolete bridge, relay, asset, and dependency paths to keep the supported surface small. BREAKING CHANGE: The Noctalia relay no longer accepts --agent, and the Tauri host no longer exposes the legacy load_agent command.
This commit is contained in:
@@ -10,23 +10,17 @@ function flag(args, name) {
|
||||
|
||||
async function run() {
|
||||
const args = process.argv.slice(2);
|
||||
const socketPath = flag(args, "--socket") ?? process.env.PI_STATUS_BRIDGE_SOCKET;
|
||||
const agentId = flag(args, "--agent");
|
||||
const socketPath =
|
||||
flag(args, "--socket") ?? process.env.PI_STATUS_BRIDGE_SOCKET;
|
||||
if (!socketPath)
|
||||
throw new Error("Usage: pi-status-bridge-noctalia-relay --socket <path> [--agent <id>]");
|
||||
throw new Error("Usage: pi-status-bridge-noctalia-relay --socket <path>");
|
||||
const client = await connectLocalClient({ socketPath });
|
||||
let agent;
|
||||
if (agentId) {
|
||||
const agents = await client.request("list_agents");
|
||||
agent = agents.agents.find((candidate) => candidate.id === agentId);
|
||||
if (!agent) throw new Error(`unknown agent: ${agentId}`);
|
||||
}
|
||||
const relay = createNoctaliaStateRelay({
|
||||
client,
|
||||
...(agent ? { agent } : {}),
|
||||
onState: (state) => void publishNoctaliaState(state).catch((error) =>
|
||||
process.stderr.write(`${error.message}\n`),
|
||||
),
|
||||
onState: (state) =>
|
||||
void publishNoctaliaState(state).catch((error) =>
|
||||
process.stderr.write(`${error.message}\n`),
|
||||
),
|
||||
});
|
||||
await relay.start();
|
||||
await new Promise((resolve) => {
|
||||
@@ -39,6 +33,8 @@ async function run() {
|
||||
}
|
||||
|
||||
run().catch((error) => {
|
||||
process.stderr.write(`${error instanceof Error ? error.message : "Noctalia relay failed"}\n`);
|
||||
process.stderr.write(
|
||||
`${error instanceof Error ? error.message : "Noctalia relay failed"}\n`,
|
||||
);
|
||||
process.exitCode = 1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user