@lousy-agents/mcp 5.22.15 → 5.22.16

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/mcp-server.js +80 -13
  2. package/package.json +1 -1
@@ -6559,7 +6559,7 @@ function escapeJsonPtr(str) {
6559
6559
 
6560
6560
 
6561
6561
  },
6562
- 8363(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
6562
+ 9324(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
6563
6563
  // NAMESPACE OBJECT: ../../node_modules/micromark/lib/constructs.js
6564
6564
  var constructs_namespaceObject = {};
6565
6565
  __webpack_require__.r(constructs_namespaceObject);
@@ -53723,8 +53723,8 @@ function pinnedWriteModeAssertion(fd, mode, assertBeforeMutation, privateCreatio
53723
53723
 
53724
53724
 
53725
53725
  // Node has no portable no-replace rename. Publish the completed stage by link,
53726
- // then remove its verified temporary name without yielding.
53727
- function publishCopyStage(params) {
53726
+ // then remove its verified temporary name after any descriptor handoff.
53727
+ async function publishCopyStage(params) {
53728
53728
  const { identity, temporaryPath, targetPath } = params;
53729
53729
  const assertCurrent = () => {
53730
53730
  directory_guard_assertSyncDirectoryGuard(params.parentGuard);
@@ -53778,13 +53778,23 @@ function publishCopyStage(params) {
53778
53778
  }
53779
53779
  }
53780
53780
  else {
53781
- const parent = external_node_fs_.lstatSync(external_node_path_.dirname(temporaryPath), { bigint: true });
53782
- const current = external_node_fs_.lstatSync(temporaryPath, { bigint: true });
53783
- if (parent.isSymbolicLink() || !parent.isDirectory() ||
53784
- !file_identity_sameFileIdentityForCleanup(parent, params.parentGuard.stat) ||
53785
- current.isSymbolicLink() || !current.isFile() ||
53786
- !file_identity_sameFileIdentityForCleanup(current, identity)) {
53787
- throw new errors_FsSafeError("path-mismatch", "published copy temporary name changed before cleanup");
53781
+ const verifyPair = () => {
53782
+ directory_guard_assertSyncDirectoryGuard(params.parentGuard);
53783
+ const parent = external_node_fs_.lstatSync(external_node_path_.dirname(temporaryPath), { bigint: true });
53784
+ const current = external_node_fs_.lstatSync(temporaryPath, { bigint: true });
53785
+ const target = external_node_fs_.lstatSync(targetPath, { bigint: true });
53786
+ if (parent.isSymbolicLink() || !parent.isDirectory() ||
53787
+ !file_identity_sameFileIdentityForCleanup(parent, params.parentGuard.stat) ||
53788
+ current.isSymbolicLink() || !current.isFile() || current.nlink !== 2n ||
53789
+ target.isSymbolicLink() || !target.isFile() || target.nlink !== 2n ||
53790
+ !file_identity_sameFileIdentityForCleanup(current, identity) || !file_identity_sameFileIdentityForCleanup(target, identity)) {
53791
+ throw new errors_FsSafeError("path-mismatch", "published copy temporary name changed before cleanup");
53792
+ }
53793
+ };
53794
+ verifyPair();
53795
+ if (params.beforeTemporaryUnlink) {
53796
+ await params.beforeTemporaryUnlink();
53797
+ verifyPair();
53788
53798
  }
53789
53799
  // This removes the stage's name, never the published destination or source.
53790
53800
  external_node_fs_.unlinkSync(temporaryPath);
@@ -53857,6 +53867,40 @@ function publishThroughPlaceholder(params, assertCurrent) {
53857
53867
  }
53858
53868
  }
53859
53869
 
53870
+ ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/publication-handle.js
53871
+
53872
+
53873
+
53874
+
53875
+
53876
+
53877
+ /** Pin the published name before releasing a descriptor opened through its stage. */
53878
+ async function openPublicationHandle(targetPath, identity) {
53879
+ const flags = read_open_flags_resolveReadOpenFlags();
53880
+ const handle = await promises_.open(targetPath, flags).catch(async (error) => {
53881
+ // Restrictive final modes must not be widened just to inspect publication.
53882
+ if (!hasErrorCode(error, "EACCES") || (process.arch !== "x64" && process.arch !== "arm64"))
53883
+ throw error;
53884
+ const metadataFlag = process.platform === "linux" ? 0x200000 : undefined; // O_PATH
53885
+ if (metadataFlag === undefined)
53886
+ throw error;
53887
+ return promises_.open(targetPath, metadataFlag | external_node_fs_.constants.O_NOFOLLOW);
53888
+ });
53889
+ try {
53890
+ const opened = external_node_fs_.fstatSync(handle.fd, { bigint: true });
53891
+ const named = external_node_fs_.lstatSync(targetPath, { bigint: true });
53892
+ if (!opened.isFile() || !named.isFile() || named.isSymbolicLink() ||
53893
+ !file_identity_sameFileIdentityForCleanup(opened, identity) || !file_identity_sameFileIdentityForCleanup(named, identity)) {
53894
+ throw new errors_FsSafeError("path-mismatch", "publication descriptor handoff identity changed");
53895
+ }
53896
+ return handle;
53897
+ }
53898
+ catch (error) {
53899
+ await handle.close().catch(() => undefined);
53900
+ throw error;
53901
+ }
53902
+ }
53903
+
53860
53904
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js
53861
53905
 
53862
53906
 
@@ -53878,6 +53922,7 @@ function publishThroughPlaceholder(params, assertCurrent) {
53878
53922
 
53879
53923
 
53880
53924
 
53925
+
53881
53926
 
53882
53927
 
53883
53928
  async function runPinnedStagedWrite(params, parentPath, parentGuard) {
@@ -53895,6 +53940,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53895
53940
  let handle;
53896
53941
  let tempIdentity;
53897
53942
  let readHandle;
53943
+ let handoffCloseFailure;
53898
53944
  let renamed = false;
53899
53945
  const completeCreate = params.overwrite === false && params.input.kind !== "file" && params.input.stageBeforePublish === true;
53900
53946
  let receipt;
@@ -53949,11 +53995,15 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53949
53995
  }), external_node_path_.basename(tempPath), external_node_fs_.fstatSync(handle.fd, { bigint: true }));
53950
53996
  }
53951
53997
  let verifiedIdentity = expectedTempStat;
53998
+ // Keep unreadable modes supported where Node has no read-free file open.
53999
+ const canHandoff = process.platform !== "win32" &&
54000
+ ((params.mode & 0o400) !== 0 ||
54001
+ (process.platform === "linux" && (process.arch === "x64" || process.arch === "arm64")));
53952
54002
  phase = "publish";
53953
54003
  await withAsyncDirectoryGuards([parentGuard], async () => {
53954
54004
  assertFinalSymlinkRejected(targetPath, params.rejectFinalSymlink);
53955
54005
  if (params.overwrite === false) {
53956
- publishCopyStage({
54006
+ await publishCopyStage({
53957
54007
  temporaryPath: tempPath, targetPath, fd: handle.fd,
53958
54008
  identity: tempIdentity, parentGuard,
53959
54009
  assertBeforeMutation,
@@ -53967,6 +54017,18 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53967
54017
  publication = Object.freeze({ status: "published", staged: receipt, basename: params.basename, overwrite: false });
53968
54018
  params.onPublished?.(identity);
53969
54019
  },
54020
+ beforeTemporaryUnlink: !canHandoff ? undefined : async () => {
54021
+ readHandle = await openPublicationHandle(targetPath, expectedTempStat);
54022
+ // Keep the destination pinned while closing the stage's NFS dentry.
54023
+ const stagedHandle = handle;
54024
+ handle = undefined;
54025
+ try {
54026
+ await stagedHandle.close();
54027
+ }
54028
+ catch (error) {
54029
+ handoffCloseFailure = { error };
54030
+ }
54031
+ },
53970
54032
  });
53971
54033
  }
53972
54034
  else {
@@ -53994,6 +54056,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53994
54056
  throw new errors_FsSafeError("path-mismatch", "fallback target changed during write");
53995
54057
  }
53996
54058
  const expectedHash = sha256Hex(params.input.data, params.input.encoding);
54059
+ await readHandle?.close();
53997
54060
  readHandle = await promises_.open(targetPath, read_open_flags_resolveReadOpenFlags());
53998
54061
  const readHandleStat = external_node_fs_.fstatSync(readHandle.fd, { bigint: true });
53999
54062
  const actualHash = sha256Hex(await readFileHandleBounded(readHandle, Infinity));
@@ -54032,7 +54095,11 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
54032
54095
  pathname: tempPath, handle, identity: tempIdentity, parentGuard, throwOnCleanupError: true,
54033
54096
  }) : "not-needed";
54034
54097
  },
54035
- close: [async () => { await readHandle?.close(); }, async () => { await handle?.close(); }],
54098
+ close: [async () => { await readHandle?.close(); }, async () => {
54099
+ await handle?.close();
54100
+ if (handoffCloseFailure)
54101
+ throw handoffCloseFailure.error;
54102
+ }],
54036
54103
  });
54037
54104
  }
54038
54105
  else
@@ -109911,4 +109978,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
109911
109978
  // module factories are used so entry inlining is disabled
109912
109979
  // startup
109913
109980
  // Load entry module and return exports
109914
- var __webpack_exports__ = __webpack_require__(8363);
109981
+ var __webpack_exports__ = __webpack_require__(9324);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/mcp",
3
- "version": "5.22.15",
3
+ "version": "5.22.16",
4
4
  "description": "MCP server for lousy-agents - provides AI coding assistant tools via the Model Context Protocol",
5
5
  "type": "module",
6
6
  "repository": {