jefrichat-mcp 0.6.0 → 0.7.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.
- package/dist/index.js +33 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6883,12 +6883,12 @@ var require_dist = __commonJS({
|
|
|
6883
6883
|
throw new Error(`Unknown format "${name}"`);
|
|
6884
6884
|
return f;
|
|
6885
6885
|
};
|
|
6886
|
-
function addFormats(ajv, list,
|
|
6886
|
+
function addFormats(ajv, list, fs5, exportName) {
|
|
6887
6887
|
var _a;
|
|
6888
6888
|
var _b;
|
|
6889
6889
|
(_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
|
|
6890
6890
|
for (const f of list)
|
|
6891
|
-
ajv.addFormat(f,
|
|
6891
|
+
ajv.addFormat(f, fs5[f]);
|
|
6892
6892
|
}
|
|
6893
6893
|
module.exports = exports = formatsPlugin;
|
|
6894
6894
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -24788,7 +24788,7 @@ var StdioServerTransport = class {
|
|
|
24788
24788
|
};
|
|
24789
24789
|
|
|
24790
24790
|
// src/index.ts
|
|
24791
|
-
import
|
|
24791
|
+
import fs4 from "node:fs";
|
|
24792
24792
|
import os3 from "node:os";
|
|
24793
24793
|
import path2 from "node:path";
|
|
24794
24794
|
|
|
@@ -26319,7 +26319,25 @@ function attachInbox(c, inbox2, self, onIncoming) {
|
|
|
26319
26319
|
|
|
26320
26320
|
// src/notify.ts
|
|
26321
26321
|
import cp2 from "node:child_process";
|
|
26322
|
+
import fs3 from "node:fs";
|
|
26322
26323
|
var OFF = process.env.JEFRI_NOTIFY === "0" || process.env.JEFRI_NOTIFY === "false";
|
|
26324
|
+
function findTerminalNotifier() {
|
|
26325
|
+
if (process.platform !== "darwin") return null;
|
|
26326
|
+
for (const p of ["/opt/homebrew/bin/terminal-notifier", "/usr/local/bin/terminal-notifier"]) {
|
|
26327
|
+
try {
|
|
26328
|
+
if (fs3.existsSync(p)) return p;
|
|
26329
|
+
} catch {
|
|
26330
|
+
}
|
|
26331
|
+
}
|
|
26332
|
+
try {
|
|
26333
|
+
const out = (cp2.spawnSync("which", ["terminal-notifier"], { encoding: "utf8" }).stdout || "").trim();
|
|
26334
|
+
if (out && fs3.existsSync(out)) return out;
|
|
26335
|
+
} catch {
|
|
26336
|
+
}
|
|
26337
|
+
return null;
|
|
26338
|
+
}
|
|
26339
|
+
var TERMINAL_NOTIFIER = findTerminalNotifier();
|
|
26340
|
+
var macNeedsTerminalNotifier = process.platform === "darwin" && !TERMINAL_NOTIFIER && !OFF;
|
|
26323
26341
|
var clean = (s) => (s || "").replace(/[\r\n\t]+/g, " ").replace(/[\x00-\x1F]/g, "").slice(0, 140).trim();
|
|
26324
26342
|
function notifyIncoming(title, body) {
|
|
26325
26343
|
if (OFF) return;
|
|
@@ -26331,9 +26349,13 @@ function notifyIncoming(title, body) {
|
|
|
26331
26349
|
}
|
|
26332
26350
|
try {
|
|
26333
26351
|
if (process.platform === "darwin") {
|
|
26334
|
-
|
|
26335
|
-
|
|
26336
|
-
|
|
26352
|
+
if (TERMINAL_NOTIFIER) {
|
|
26353
|
+
cp2.spawn(TERMINAL_NOTIFIER, ["-title", t, "-message", b, "-sound", "Ping"], { stdio: "ignore", detached: true }).unref();
|
|
26354
|
+
} else {
|
|
26355
|
+
const esc2 = (x) => x.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
26356
|
+
const script = `display notification "${esc2(b)}" with title "${esc2(t)}" sound name "Ping"`;
|
|
26357
|
+
cp2.spawn("osascript", ["-e", script], { stdio: "ignore", detached: true }).unref();
|
|
26358
|
+
}
|
|
26337
26359
|
} else if (process.platform === "win32") {
|
|
26338
26360
|
const esc2 = (x) => x.replace(/'/g, "''");
|
|
26339
26361
|
const ps = `Add-Type -AssemblyName System.Windows.Forms;$n=New-Object System.Windows.Forms.NotifyIcon;$n.Icon=[System.Drawing.SystemIcons]::Information;$n.BalloonTipTitle='${esc2(t)}';$n.BalloonTipText='${esc2(b)}';$n.Visible=$true;$n.ShowBalloonTip(6000);Start-Sleep -Milliseconds 6500;$n.Dispose()`;
|
|
@@ -26357,7 +26379,7 @@ var TOKEN_CACHE = path2.join(os3.homedir(), ".acp", "tokens.json");
|
|
|
26357
26379
|
var cacheKey = `${SERVER}::${USERNAME}`;
|
|
26358
26380
|
function readTokenCache() {
|
|
26359
26381
|
try {
|
|
26360
|
-
return JSON.parse(
|
|
26382
|
+
return JSON.parse(fs4.readFileSync(TOKEN_CACHE, "utf8"));
|
|
26361
26383
|
} catch {
|
|
26362
26384
|
return {};
|
|
26363
26385
|
}
|
|
@@ -26365,8 +26387,8 @@ function readTokenCache() {
|
|
|
26365
26387
|
function cacheToken(tok) {
|
|
26366
26388
|
const c = readTokenCache();
|
|
26367
26389
|
c[cacheKey] = tok;
|
|
26368
|
-
|
|
26369
|
-
|
|
26390
|
+
fs4.mkdirSync(path2.dirname(TOKEN_CACHE), { recursive: true });
|
|
26391
|
+
fs4.writeFileSync(TOKEN_CACHE, JSON.stringify(c, null, 2));
|
|
26370
26392
|
}
|
|
26371
26393
|
var clientPromise = null;
|
|
26372
26394
|
var inbox = [];
|
|
@@ -26406,6 +26428,8 @@ function ensureClient() {
|
|
|
26406
26428
|
});
|
|
26407
26429
|
void refreshGroups();
|
|
26408
26430
|
setInterval(refreshGroups, 6e4).unref?.();
|
|
26431
|
+
if (macNeedsTerminalNotifier)
|
|
26432
|
+
log("tip: for reliable desktop notifications on macOS, run: brew install terminal-notifier");
|
|
26409
26433
|
attachInbox(c, inbox, self, (m) => {
|
|
26410
26434
|
const preview = m.kind === "file" ? `\u{1F4CE} ${m.fileName ?? "file"}` : m.content ?? "";
|
|
26411
26435
|
const where = m.groupId ? ` \xB7 ${groupNames.get(m.groupId) ?? "group"}` : "";
|
package/package.json
CHANGED