@paymos/mcp 1.5.0 → 1.5.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [1.5.1] - 2026-11-13
6
+
7
+ - fix(plugins,publicweb): SDK webhook credit recipes, CMS recovery, redirects and CSP logs (audit 2026-11-13)
8
+
5
9
  ## [1.5.0] - 2026-11-07
6
10
 
7
11
  - feat(publicweb,docs,blazor,mcp): add MCP prompt tab to code snippets and compact /contacts header
package/dist/index.js CHANGED
@@ -1257,7 +1257,7 @@ function registerIntegrationRecommendation(server) {
1257
1257
  }
1258
1258
 
1259
1259
  // src/version.ts
1260
- var MCP_VERSION = "1.5.0";
1260
+ var MCP_VERSION = "1.5.1";
1261
1261
 
1262
1262
  // src/server.ts
1263
1263
  function buildServer(gateway) {
@@ -1274,27 +1274,85 @@ function buildServer(gateway) {
1274
1274
  // src/setup.ts
1275
1275
  import {
1276
1276
  chmodSync,
1277
- closeSync as closeSync2,
1277
+ closeSync as closeSync3,
1278
1278
  constants as constants2,
1279
1279
  existsSync,
1280
- fstatSync as fstatSync2,
1280
+ fstatSync as fstatSync3,
1281
1281
  linkSync,
1282
- lstatSync as lstatSync2,
1283
- mkdirSync,
1284
- openSync as openSync2,
1282
+ lstatSync as lstatSync3,
1283
+ mkdirSync as mkdirSync2,
1284
+ openSync as openSync3,
1285
1285
  readFileSync as readFileSync2,
1286
1286
  renameSync,
1287
- unlinkSync,
1287
+ unlinkSync as unlinkSync2,
1288
1288
  writeFileSync
1289
1289
  } from "fs";
1290
1290
  import { randomUUID } from "crypto";
1291
1291
  import { homedir } from "os";
1292
- import { dirname, isAbsolute, join, resolve } from "path";
1292
+ import { dirname as dirname2, isAbsolute, join, resolve } from "path";
1293
1293
  import { createInterface } from "readline";
1294
1294
  import { Writable } from "stream";
1295
1295
  import { isDeepStrictEqual } from "util";
1296
1296
  import { applyEdits, modify, parse as parseJson, parseTree } from "jsonc-parser";
1297
1297
  import { parse as parseToml, stringify as stringifyToml } from "smol-toml";
1298
+
1299
+ // src/setup-lock.ts
1300
+ import { closeSync as closeSync2, fstatSync as fstatSync2, lstatSync as lstatSync2, mkdirSync, openSync as openSync2, unlinkSync } from "fs";
1301
+ import { dirname } from "path";
1302
+ var LOCK_SUFFIX = ".paymos-setup.lock";
1303
+ var STALE_LOCK_MS = 3e4;
1304
+ var DestinationBusyError = class extends Error {
1305
+ constructor() {
1306
+ super("Another setup is publishing to this destination.");
1307
+ this.name = "DestinationBusyError";
1308
+ }
1309
+ };
1310
+ function acquire(lock, now) {
1311
+ for (let attempt = 0; ; attempt++) {
1312
+ let fd;
1313
+ try {
1314
+ fd = openSync2(lock, "wx", 384);
1315
+ } catch (cause) {
1316
+ if (cause.code !== "EEXIST") throw cause;
1317
+ if (attempt > 0 || !removeIfStale(lock, now)) throw new DestinationBusyError();
1318
+ continue;
1319
+ }
1320
+ try {
1321
+ const stat = fstatSync2(fd);
1322
+ return { ino: stat.ino, dev: stat.dev };
1323
+ } finally {
1324
+ closeSync2(fd);
1325
+ }
1326
+ }
1327
+ }
1328
+ function removeIfStale(lock, now) {
1329
+ try {
1330
+ if (now() - lstatSync2(lock).mtimeMs < STALE_LOCK_MS) return false;
1331
+ unlinkSync(lock);
1332
+ return true;
1333
+ } catch (cause) {
1334
+ return cause.code === "ENOENT";
1335
+ }
1336
+ }
1337
+ function release(lock, mine) {
1338
+ try {
1339
+ const stat = lstatSync2(lock);
1340
+ if (stat.ino === mine.ino && stat.dev === mine.dev) unlinkSync(lock);
1341
+ } catch {
1342
+ }
1343
+ }
1344
+ function withDestinationLock(destination, action, now = Date.now) {
1345
+ const lock = destination + LOCK_SUFFIX;
1346
+ mkdirSync(dirname(lock), { recursive: true, mode: 448 });
1347
+ const mine = acquire(lock, now);
1348
+ try {
1349
+ return action();
1350
+ } finally {
1351
+ release(lock, mine);
1352
+ }
1353
+ }
1354
+
1355
+ // src/setup.ts
1298
1356
  var SETUP_CLIENTS = [
1299
1357
  "codex",
1300
1358
  "claude-code",
@@ -1387,18 +1445,18 @@ function defaultConfigPath(client, env, context) {
1387
1445
  function snapshot(path) {
1388
1446
  let fd;
1389
1447
  try {
1390
- const stat = lstatSync2(path);
1448
+ const stat = lstatSync3(path);
1391
1449
  if (stat.isSymbolicLink()) error("symlink");
1392
1450
  if (!stat.isFile() || stat.size > 4194304) error("configFile");
1393
- fd = openSync2(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
1394
- if (fstatSync2(fd).ino !== stat.ino) error("changed");
1451
+ fd = openSync3(path, constants2.O_RDONLY | (constants2.O_NOFOLLOW ?? 0));
1452
+ if (fstatSync3(fd).ino !== stat.ino) error("changed");
1395
1453
  return { path, content: readFileSync2(fd, "utf8") };
1396
1454
  } catch (cause) {
1397
1455
  if (cause.code === "ENOENT") return { path, content: null };
1398
1456
  if (cause instanceof Error && Object.values(SETUP_COPY.errors).includes(cause.message)) throw cause;
1399
1457
  return error("configFile");
1400
1458
  } finally {
1401
- if (fd !== void 0) closeSync2(fd);
1459
+ if (fd !== void 0) closeSync3(fd);
1402
1460
  }
1403
1461
  }
1404
1462
  function assertUnchanged(before) {
@@ -1471,20 +1529,20 @@ function planClientConfig(client, original, credentialsPath, platform) {
1471
1529
  return next;
1472
1530
  }
1473
1531
  function writeConfig(before, content) {
1474
- mkdirSync(dirname(before.path), { recursive: true, mode: 448 });
1475
- const temp = join(dirname(before.path), `.paymos-${randomUUID()}.tmp`);
1532
+ mkdirSync2(dirname2(before.path), { recursive: true, mode: 448 });
1533
+ const temp = join(dirname2(before.path), `.paymos-${randomUUID()}.tmp`);
1476
1534
  let created = false;
1477
1535
  try {
1478
1536
  writeFileSync(temp, content, { encoding: "utf8", mode: 384, flag: "wx" });
1479
1537
  created = true;
1480
1538
  if (process.platform !== "win32") chmodSync(temp, 384);
1481
- const identity = lstatSync2(temp);
1539
+ const identity = lstatSync3(temp);
1482
1540
  assertUnchanged(before);
1483
1541
  if (before.content === null) linkSync(temp, before.path);
1484
1542
  else renameSync(temp, before.path);
1485
1543
  return { ino: identity.ino, dev: identity.dev };
1486
1544
  } finally {
1487
- if (created && existsSync(temp)) unlinkSync(temp);
1545
+ if (created && existsSync(temp)) unlinkSync2(temp);
1488
1546
  }
1489
1547
  }
1490
1548
  async function ask(io, label, secret = false) {
@@ -1566,17 +1624,20 @@ async function runSetup(argv, env = process.env, io = terminalIO(), context = {
1566
1624
  }
1567
1625
  let createdKeys;
1568
1626
  try {
1569
- assertUnchanged(before);
1570
- assertUnchanged(beforeKeys);
1571
- if (stored === void 0) {
1572
- createdKeys = writeConfig(beforeKeys, JSON.stringify(credentials, null, 2) + "\n");
1573
- }
1574
- if (before.content !== next) writeConfig(before, next);
1627
+ withDestinationLock(configPath, () => {
1628
+ assertUnchanged(before);
1629
+ assertUnchanged(beforeKeys);
1630
+ if (stored === void 0) {
1631
+ createdKeys = writeConfig(beforeKeys, JSON.stringify(credentials, null, 2) + "\n");
1632
+ }
1633
+ if (before.content !== next) writeConfig(before, next);
1634
+ });
1575
1635
  } catch (cause) {
1636
+ if (cause instanceof DestinationBusyError) error("changed");
1576
1637
  if (createdKeys !== void 0) {
1577
1638
  try {
1578
- const stat = lstatSync2(credentialsPath);
1579
- if (!stat.isSymbolicLink() && stat.ino === createdKeys.ino && stat.dev === createdKeys.dev && isDeepStrictEqual(readCredentialFile(credentialsPath), credentials)) unlinkSync(credentialsPath);
1639
+ const stat = lstatSync3(credentialsPath);
1640
+ if (!stat.isSymbolicLink() && stat.ino === createdKeys.ino && stat.dev === createdKeys.dev && isDeepStrictEqual(readCredentialFile(credentialsPath), credentials)) unlinkSync2(credentialsPath);
1580
1641
  } catch {
1581
1642
  }
1582
1643
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@paymos/mcp",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Official Paymos MCP server: a local stdio server that lets coding agents (Claude Code, Cursor, custom LLM bots) build and verify a merchant integration against the Paymos sandbox without reading docs.",
5
5
  "keywords": [
6
6
  "paymos",