@mthines/reaper-mcp 0.79.0 → 0.79.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/main.js CHANGED
@@ -688,16 +688,22 @@ async function ensureBridgeDir() {
688
688
  return dir;
689
689
  }
690
690
  var BRIDGE_NOT_RUNNING_PREFIX = "Bridge not running:";
691
+ var BRIDGE_OUTDATED_PREFIX = "Bridge outdated:";
692
+ var UNKNOWN_COMMAND_PREFIX = "Unknown command type";
691
693
  function classifyBridgeError(error7) {
692
694
  if (error7?.startsWith("Timeout:")) return "timeout";
693
695
  if (error7?.startsWith(BRIDGE_NOT_RUNNING_PREFIX)) return "bridge_not_running";
696
+ if (error7?.startsWith(BRIDGE_OUTDATED_PREFIX)) return "bridge_outdated";
694
697
  if (error7?.startsWith("Handler error:")) return "handler_crash";
695
- if (error7?.startsWith("Unknown command type")) return "unknown_command";
698
+ if (error7?.startsWith(UNKNOWN_COMMAND_PREFIX)) return "unknown_command";
696
699
  if (error7?.startsWith("Internal error:")) return "internal_error";
697
700
  return "command_failed";
698
701
  }
699
702
  function isSystemError(type) {
700
- return type !== "command_failed" && type !== "bridge_not_running";
703
+ return type !== "command_failed" && type !== "bridge_not_running" && type !== "bridge_outdated";
704
+ }
705
+ function outdatedBridgeMessage(command2, bridgeError) {
706
+ return `${BRIDGE_OUTDATED_PREFIX} the REAPER bridge does not know the command '${command2}', so the mcp_bridge.lua running in REAPER is from a different reaper-mcp release than this server. Restart the bridge so it loads the installed copy: restart REAPER, or stop mcp_bridge.lua and run it again from Actions \u2192 Show action list. If it still happens, update the REAPER side (Extensions \u2192 ReaPack \u2192 Synchronize packages when ReaPack installed it, otherwise run in a terminal: reaper-mcp setup), then restart REAPER. (The bridge said: ${bridgeError})`;
701
707
  }
702
708
  var HEARTBEAT_FRESH_MS = 5e3;
703
709
  var BRIDGE_DOWN_AFTER_MS = 6e4;
@@ -867,7 +873,11 @@ async function sendCommand(type, params = {}, timeoutMs = DEFAULT_TIMEOUT_MS) {
867
873
  const pickupMs = rawResponse["_pickupMs"];
868
874
  const deferCycle = rawResponse["_deferCycle"];
869
875
  notePageLink(rawResponse["_page"]);
870
- const errorType = response.success ? void 0 : classifyBridgeError(response.error);
876
+ let errorType = response.success ? void 0 : classifyBridgeError(response.error);
877
+ if (errorType === "unknown_command") {
878
+ response.error = outdatedBridgeMessage(type, response.error ?? `${UNKNOWN_COMMAND_PREFIX}: ${type}`);
879
+ errorType = "bridge_outdated";
880
+ }
871
881
  span.setAttribute("reaper.bridge.poll_attempts", pollAttempts);
872
882
  if (handlerMs != null) {
873
883
  span.setAttribute("reaper.bridge.handler_ms", handlerMs);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mthines/reaper-mcp",
3
- "version": "0.79.0",
3
+ "version": "0.79.1",
4
4
  "type": "module",
5
5
  "description": "MCP server for controlling REAPER DAW — real-time mixing, FX control, and frequency analysis for AI agents",
6
6
  "license": "MIT",