From 710f5bb88ae8a8043bd8af1f76140921f7731394 Mon Sep 17 00:00:00 2001 From: "prompt.ac/@jeffrey" Date: Mon, 28 Sep 2026 17:45:21 -0700 Subject: [PATCH] dm-mcp: local machine is the actual hostname, so machine:neo routes over ssh from other Macs The LOCAL set hard-coded neo, so dm_send machine:neo run from frisbee spawned signal-cli locally and failed with ENOENT. Match the short hostname instead. Co-Authored-By: Claude Sonnet 5.5 --- slab/bin/dm-mcp.mjs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/slab/bin/dm-mcp.mjs b/slab/bin/dm-mcp.mjs index 358d525671..fceed12e8a 100755 --- a/slab/bin/dm-mcp.mjs +++ b/slab/bin/dm-mcp.mjs @@ -16,7 +16,7 @@ // only, so it travels with the repo and needs no PATH setup. `--http [port]` // runs one resident daemon every session shares (toolchain/mcp/http-front.mjs). // -// LOCAL-FIRST. This instance operates on the machine it runs on (neo). neo and +// LOCAL-FIRST. This instance operates on the machine it runs on. neo and // blueberry are linked to the SAME Signal account and the SAME iMessage account, // so their message CONTENT mirrors — the reason to have both is availability, // not different inboxes. The `machine` arg is accepted and, for signal-cli- @@ -32,7 +32,7 @@ import { createHash } from "node:crypto"; import { execFile } from "node:child_process"; import { existsSync, readFileSync, statSync } from "node:fs"; -import { homedir } from "node:os"; +import { homedir, hostname } from "node:os"; import { dirname, isAbsolute, join, resolve } from "node:path"; import { fileURLToPath } from "node:url"; import { httpPort, serveHttp, serveStdio } from "../../toolchain/mcp/http-front.mjs"; @@ -73,8 +73,11 @@ function sshHost(machine) { return machine; } -const LOCAL = new Set(["", "local", "neo", "this", undefined, null]); -const isLocal = (machine) => LOCAL.has(machine); +// "Local" is whichever machine this instance runs on — matched by hostname, so +// `machine: neo` runs signal-cli here on neo but routes over ssh from frisbee. +const HOST = hostname().split(".")[0].toLowerCase(); +const LOCAL = new Set(["", "local", "this", HOST, undefined, null]); +const isLocal = (machine) => LOCAL.has(typeof machine === "string" ? machine.toLowerCase() : machine); // Run a signal-cli invocation, locally or over ssh for a remote machine. function runSignalCli(args, machine, opts) { -- 2.51.2