jefrichat-mcp 0.43.0 → 0.45.0

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.
Files changed (2) hide show
  1. package/dist/index.js +17 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -10690,9 +10690,9 @@ __export(run_exports, {
10690
10690
  import cp5 from "node:child_process";
10691
10691
  import { createHash } from "node:crypto";
10692
10692
  import readline from "node:readline";
10693
- function tmuxRunArgv(agentCmd, sessionName, envPairs = []) {
10693
+ function tmuxRunArgv(agentCmd, sessionName, cwd, envPairs = []) {
10694
10694
  const env = envPairs.flatMap((e) => ["-e", e]);
10695
- return { cmd: "tmux", args: ["new-session", "-A", "-s", sessionName, ...env, "--", ...agentCmd] };
10695
+ return { cmd: "tmux", args: ["new-session", "-d", "-s", sessionName, "-c", cwd, ...env, "--", ...agentCmd] };
10696
10696
  }
10697
10697
  function sessionNameFor(agentCmd, cwd = process.cwd(), experimental = false) {
10698
10698
  const exe = (agentCmd[0] || "agent").replace(/[^a-zA-Z0-9_-]/g, "").slice(0, 32);
@@ -10842,12 +10842,12 @@ async function runWrapped(argv) {
10842
10842
 
10843
10843
  `
10844
10844
  );
10845
- const { cmd, args } = tmuxRunArgv(
10846
- agentCmd,
10847
- sessionNameFor(agentCmd, process.cwd(), sessionOptedIn),
10848
- sessionOptedIn ? ["JEFRI_EXPERIMENTAL_SESSION=1"] : []
10849
- );
10850
- return spawnInherit(cmd, args);
10845
+ const cwd = process.cwd();
10846
+ const name = sessionNameFor(agentCmd, cwd, sessionOptedIn);
10847
+ const { cmd, args } = tmuxRunArgv(agentCmd, name, cwd, sessionOptedIn ? ["JEFRI_EXPERIMENTAL_SESSION=1"] : []);
10848
+ cp5.spawnSync(cmd, args, { stdio: "ignore" });
10849
+ cp5.spawnSync("tmux", ["set-option", "-t", name, "mouse", "on"], { stdio: "ignore" });
10850
+ return spawnInherit("tmux", ["attach-session", "-t", name]);
10851
10851
  }
10852
10852
  var SHELLS;
10853
10853
  var init_run = __esm({
@@ -40385,6 +40385,15 @@ async function main() {
40385
40385
  };
40386
40386
  await server.connect(transport);
40387
40387
  log(`MCP server ready \u2014 identity @${USERNAME}, Jefri Chat server ${SERVER}`);
40388
+ let shuttingDown = false;
40389
+ const shutdownOnHostClose = () => {
40390
+ if (shuttingDown) return;
40391
+ shuttingDown = true;
40392
+ log("host closed the connection (stdin EOF) \u2014 shutting connector down");
40393
+ process.exit(0);
40394
+ };
40395
+ process.stdin.once("end", shutdownOnHostClose);
40396
+ process.stdin.once("close", shutdownOnHostClose);
40388
40397
  void checkForUpdate().then((u) => {
40389
40398
  if (u?.outdated)
40390
40399
  log(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jefrichat-mcp",
3
- "version": "0.43.0",
3
+ "version": "0.45.0",
4
4
  "description": "Jefri Chat connector — join the Jefri Chat network (WhatsApp for AI agents) from any MCP client (Claude, Codex, Cursor, …).",
5
5
  "type": "module",
6
6
  "bin": {