jefrichat-mcp 0.48.0 → 0.48.2

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 +61 -46
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11914,6 +11914,55 @@ var init_popup = __esm({
11914
11914
  }
11915
11915
  });
11916
11916
 
11917
+ // src/version.ts
11918
+ import fs9 from "node:fs";
11919
+ import np7 from "node:path";
11920
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
11921
+ function connectorVersion() {
11922
+ try {
11923
+ const here = np7.dirname(fileURLToPath2(import.meta.url));
11924
+ const pkg = JSON.parse(fs9.readFileSync(np7.join(here, "..", "package.json"), "utf8"));
11925
+ return pkg.version ?? "?";
11926
+ } catch {
11927
+ return "?";
11928
+ }
11929
+ }
11930
+ function isNewer(a, b) {
11931
+ const pa = a.split(".").map((n) => parseInt(n, 10) || 0);
11932
+ const pb = b.split(".").map((n) => parseInt(n, 10) || 0);
11933
+ for (let i = 0; i < 3; i++) {
11934
+ if ((pa[i] ?? 0) > (pb[i] ?? 0)) return true;
11935
+ if ((pa[i] ?? 0) < (pb[i] ?? 0)) return false;
11936
+ }
11937
+ return false;
11938
+ }
11939
+ async function checkForUpdate(timeoutMs = 3e3) {
11940
+ const current = connectorVersion();
11941
+ if (current === "?") return null;
11942
+ const ac = new AbortController();
11943
+ const timer = setTimeout(() => ac.abort(), timeoutMs);
11944
+ try {
11945
+ const r = await fetch("https://registry.npmjs.org/jefrichat-mcp/latest", {
11946
+ signal: ac.signal,
11947
+ headers: { accept: "application/json" }
11948
+ });
11949
+ if (!r.ok) return null;
11950
+ const j = await r.json();
11951
+ const latest = j.version;
11952
+ if (!latest) return null;
11953
+ return { current, latest, outdated: isNewer(latest, current) };
11954
+ } catch {
11955
+ return null;
11956
+ } finally {
11957
+ clearTimeout(timer);
11958
+ }
11959
+ }
11960
+ var init_version = __esm({
11961
+ "src/version.ts"() {
11962
+ "use strict";
11963
+ }
11964
+ });
11965
+
11917
11966
  // src/run.ts
11918
11967
  var run_exports = {};
11919
11968
  __export(run_exports, {
@@ -12269,6 +12318,14 @@ async function runPanel() {
12269
12318
  const noBrain = a.brainReady === false ? ` \xB7 no "${sanitizeForDisplay(a.brain ?? "brain")}" installed` : "";
12270
12319
  return `@${name}${host}${a.online ? "" : " (offline)"}${a.autonomous ? " \xB7 autonomous ON" : ""}${noBrain}`;
12271
12320
  }).join(" \xB7 ");
12321
+ let updateLine = "";
12322
+ void checkForUpdate().then((u) => {
12323
+ if (u?.outdated) {
12324
+ updateLine = ` ${yellow(`\u2191 connector ${u.current} \u2192 ${u.latest}`)} ${dim("\xB7 restart this agent's session to update")}`;
12325
+ dirty = true;
12326
+ }
12327
+ }).catch(() => {
12328
+ });
12272
12329
  let dirty = false;
12273
12330
  let outcome = null;
12274
12331
  session.on("message", () => {
@@ -12295,6 +12352,7 @@ async function runPanel() {
12295
12352
  await refresh();
12296
12353
  for (; ; ) {
12297
12354
  renderList(messages, agentLine + (dirty ? green(" \xB7 updated \u2014 press Enter to refresh") : ""));
12355
+ if (updateLine) output.write(updateLine + "\n");
12298
12356
  if (outcome) {
12299
12357
  output.write(" " + outcome + "\n");
12300
12358
  outcome = null;
@@ -12389,6 +12447,7 @@ var init_panel = __esm({
12389
12447
  "use strict";
12390
12448
  init_control_client();
12391
12449
  init_registry();
12450
+ init_version();
12392
12451
  init_control_proto();
12393
12452
  useColor = output.isTTY && !process.env.NO_COLOR;
12394
12453
  c = (code3) => (s) => useColor ? `\x1B[${code3}m${s}\x1B[0m` : s;
@@ -41986,52 +42045,7 @@ init_popup();
41986
42045
 
41987
42046
  // src/doctor.ts
41988
42047
  import cp6 from "node:child_process";
41989
-
41990
- // src/version.ts
41991
- import fs9 from "node:fs";
41992
- import np7 from "node:path";
41993
- import { fileURLToPath as fileURLToPath2 } from "node:url";
41994
- function connectorVersion() {
41995
- try {
41996
- const here = np7.dirname(fileURLToPath2(import.meta.url));
41997
- const pkg = JSON.parse(fs9.readFileSync(np7.join(here, "..", "package.json"), "utf8"));
41998
- return pkg.version ?? "?";
41999
- } catch {
42000
- return "?";
42001
- }
42002
- }
42003
- function isNewer(a, b) {
42004
- const pa = a.split(".").map((n) => parseInt(n, 10) || 0);
42005
- const pb = b.split(".").map((n) => parseInt(n, 10) || 0);
42006
- for (let i = 0; i < 3; i++) {
42007
- if ((pa[i] ?? 0) > (pb[i] ?? 0)) return true;
42008
- if ((pa[i] ?? 0) < (pb[i] ?? 0)) return false;
42009
- }
42010
- return false;
42011
- }
42012
- async function checkForUpdate(timeoutMs = 3e3) {
42013
- const current = connectorVersion();
42014
- if (current === "?") return null;
42015
- const ac = new AbortController();
42016
- const timer = setTimeout(() => ac.abort(), timeoutMs);
42017
- try {
42018
- const r = await fetch("https://registry.npmjs.org/jefrichat-mcp/latest", {
42019
- signal: ac.signal,
42020
- headers: { accept: "application/json" }
42021
- });
42022
- if (!r.ok) return null;
42023
- const j = await r.json();
42024
- const latest = j.version;
42025
- if (!latest) return null;
42026
- return { current, latest, outdated: isNewer(latest, current) };
42027
- } catch {
42028
- return null;
42029
- } finally {
42030
- clearTimeout(timer);
42031
- }
42032
- }
42033
-
42034
- // src/doctor.ts
42048
+ init_version();
42035
42049
  init_popup();
42036
42050
  import fs10 from "node:fs";
42037
42051
  var T = !!process.stdout.isTTY;
@@ -42178,6 +42192,7 @@ ${C.b}\u{1FA7A} Jefri Chat connector \u2014 setup check${C.x}
42178
42192
  }
42179
42193
 
42180
42194
  // src/index.ts
42195
+ init_version();
42181
42196
  var SERVER = process.env.JEFRI_SERVER ?? "http://localhost:4000";
42182
42197
  var TOKEN = process.env.JEFRI_TOKEN;
42183
42198
  var USERNAME = process.env.JEFRI_AS ?? "claude_agent";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jefrichat-mcp",
3
- "version": "0.48.0",
3
+ "version": "0.48.2",
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": {