@lousy-agents/mcp 5.22.14 → 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 +122 -44
  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);
@@ -39512,7 +39512,11 @@ function safeRealpathSync(targetPath, cache) {
39512
39512
  return cached;
39513
39513
  }
39514
39514
  try {
39515
- const resolved = realpathSync(pathForWindowsFilesystem(targetPath));
39515
+ const ordinary = realpathSync(pathForWindowsFilesystem(targetPath));
39516
+ // Ordinary resolution keeps the caller's letter case. Its result has no symlinks or
39517
+ // dot segments left, so native resolution on POSIX only adopts the on-disk spelling
39518
+ // that root admission compares against. Windows root admission reconciles aliases.
39519
+ const resolved = process.platform === "win32" ? ordinary : realpathSync.native(ordinary);
39516
39520
  cache?.set(targetPath, resolved);
39517
39521
  cache?.set(resolved, resolved);
39518
39522
  return resolved;
@@ -41741,6 +41745,7 @@ function validateDescriptor(value, allowUnknownFlags) {
41741
41745
  typeof value.currentUserSid !== "string" || !SID_RE.test(value.currentUserSid) ||
41742
41746
  (value.currentAppContainerSid != null && (typeof value.currentAppContainerSid !== "string" || !APP_CONTAINER_SID_RE.test(value.currentAppContainerSid))) ||
41743
41747
  typeof value.daclPresent !== "boolean" || typeof value.isLocal !== "boolean" ||
41748
+ (value.isVolumeRoot !== undefined && typeof value.isVolumeRoot !== "boolean") ||
41744
41749
  typeof value.aceListComplete !== "boolean" || !Array.isArray(value.unsupportedAceTypes) ||
41745
41750
  !value.unsupportedAceTypes.every(windows_security_facts_uint32) || !Array.isArray(value.aces) ||
41746
41751
  !value.aces.every(ace => validateAce(ace, allowUnknownFlags))) {
@@ -50139,9 +50144,14 @@ const onCopySourceAdmission = Symbol("onCopySourceAdmission");
50139
50144
 
50140
50145
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/file-sync.js
50141
50146
 
50147
+ function syncFile(handle) {
50148
+ return typeof handle === "number"
50149
+ ? new Promise((resolve, reject) => external_node_fs_.fsync(handle, error => error ? reject(error) : resolve()))
50150
+ : handle.sync();
50151
+ }
50142
50152
  async function syncFileBestEffort(handle) {
50143
50153
  try {
50144
- await handle.sync();
50154
+ await syncFile(handle);
50145
50155
  }
50146
50156
  catch (error) {
50147
50157
  if (error?.code !== "EPERM")
@@ -50847,6 +50857,7 @@ class NativeStagedFile {
50847
50857
  #verifyMode;
50848
50858
  #state = { status: "open", publication: NOT_PUBLISHED };
50849
50859
  #receipt;
50860
+ #publicationFlush;
50850
50861
  #rejectFinalSymlink = false;
50851
50862
  #unsupportedNoReplace;
50852
50863
  #fallbackCleanup;
@@ -50883,8 +50894,7 @@ class NativeStagedFile {
50883
50894
  const env_1 = { stack: [], error: void 0, hasError: false };
50884
50895
  try {
50885
50896
  const exclusive = params.overwrite === false && params.input.kind === "buffer" && params.input.stageBeforePublish === false;
50886
- // This owner never escapes. Only the internal verifier borrows its fd;
50887
- // public descriptor methods remain await-free and cannot race disposal.
50897
+ // This owner never escapes; only the internal verifier borrows its fd.
50888
50898
  const staged = native_staged_file_addDisposableResource(env_1, await NativeStagedFile.create({
50889
50899
  binding, parentFd, closeParentFd, directory, mode: params.mode, sync: params.sync,
50890
50900
  // Public staging uses portable names; existing POSIX writes accept literal names.
@@ -50903,9 +50913,10 @@ class NativeStagedFile {
50903
50913
  }
50904
50914
  let published;
50905
50915
  try {
50906
- published = exclusive
50916
+ const publication = exclusive
50907
50917
  ? staged.#completePublication(params.basename, false, params.onPublished)
50908
- : await staged.publish(params.basename, { overwrite: params.overwrite !== false }, params.onPublished);
50918
+ : staged.publish(params.basename, { overwrite: params.overwrite !== false }, params.onPublished);
50919
+ published = publication instanceof Promise ? await publication : publication;
50909
50920
  }
50910
50921
  catch (error) {
50911
50922
  if (!staged.#unsupportedNoReplace || isFsSafeNativeRequired() ||
@@ -51068,29 +51079,21 @@ class NativeStagedFile {
51068
51079
  restoreCopyMetadata(fd, input.metadata);
51069
51080
  if (this.#verifyMode)
51070
51081
  this.#assertStagePermissions(fd);
51071
- if (this.#owner.sync !== false) {
51072
- if (this.#owner.strictFileSync)
51073
- external_node_fs_.fsyncSync(fd);
51074
- else
51075
- syncFileBestEffortSync(fd);
51076
- }
51082
+ if (this.#owner.sync !== false)
51083
+ await (this.#owner.strictFileSync ? syncFile(fd) : syncFileBestEffort(fd));
51077
51084
  const stat = external_node_fs_.fstatSync(fd, { bigint: true });
51078
51085
  this.#receipt = createStagedFileReceipt(this.#owner.directory, this.#owner.name, stat);
51079
51086
  this.#assertCurrent();
51080
51087
  }
51081
51088
  catch (error) {
51082
51089
  const { receipt: cleanup, error: cleanupError } = this.#finalize();
51083
- if (cleanupError) {
51084
- throw stagedFailure("file", new AggregateError([error, cleanupError], "preparation and cleanup failed"), { phase: "prepare", publication: cleanup.publication, cleanup });
51085
- }
51086
- if (cleanup.status === "preserved") {
51087
- throw stagedFailure("file", error, { phase: "prepare", publication: cleanup.publication, cleanup });
51090
+ if (cleanupError || cleanup.status === "preserved") {
51091
+ throw stagedFailure("file", cleanupError
51092
+ ? new AggregateError([error, cleanupError], "preparation and cleanup failed") : error, { phase: "prepare", publication: cleanup.publication, cleanup });
51088
51093
  }
51089
51094
  throw error;
51090
51095
  }
51091
51096
  }
51092
- // Keep public descriptor work await-free: each call completes its mutations
51093
- // before the next invocation, including closure and cached cleanup failures.
51094
51097
  async assertCurrent() {
51095
51098
  this.#assertCurrent();
51096
51099
  }
@@ -51135,7 +51138,8 @@ class NativeStagedFile {
51135
51138
  }
51136
51139
  throw error;
51137
51140
  }
51138
- return this.#completePublication(basename, overwrite, onPublished);
51141
+ const publication = this.#completePublication(basename, overwrite, onPublished);
51142
+ return publication instanceof Promise ? await publication : publication;
51139
51143
  }
51140
51144
  catch (error) {
51141
51145
  if (isMutationAuthorityError(error))
@@ -51161,17 +51165,21 @@ class NativeStagedFile {
51161
51165
  external_node_fs_.fchmodSync(fd, this.#owner.mode);
51162
51166
  // Content was synced during preparation. A lost chmod leaves 0600, no wider
51163
51167
  // than modes retaining owner rw; restrictive modes still need a durable correction.
51164
- if (this.#owner.sync !== false && ((this.#owner.mode & 0o600) !== 0o600 || (stagedMode & ~this.#owner.mode) !== 0)) {
51165
- if (this.#owner.strictFileSync)
51166
- external_node_fs_.fsyncSync(fd);
51167
- else
51168
- syncFileBestEffortSync(fd);
51169
- }
51170
- if (this.#owner.sync !== false)
51171
- syncFileBestEffortSync(this.#owner.parentFd);
51172
- this.#assertNamed(basename, this.#owner.mode);
51173
- this.#assertDirectory();
51174
- return receipt;
51168
+ const verify = () => {
51169
+ this.#assertNamed(basename, this.#owner.mode);
51170
+ this.#assertDirectory();
51171
+ return receipt;
51172
+ };
51173
+ if (this.#owner.sync === false)
51174
+ return verify();
51175
+ this.#publicationFlush = Promise.resolve().then(async () => {
51176
+ if ((this.#owner.mode & 0o600) !== 0o600 || (stagedMode & ~this.#owner.mode) !== 0) {
51177
+ await (this.#owner.strictFileSync ? syncFile(fd) : syncFileBestEffort(fd));
51178
+ }
51179
+ await syncFileBestEffort(this.#owner.parentFd);
51180
+ return verify();
51181
+ }).finally(() => { this.#publicationFlush = undefined; });
51182
+ return this.#publicationFlush;
51175
51183
  }
51176
51184
  #finalize() {
51177
51185
  if (this.#state.status === "closed") {
@@ -51226,6 +51234,9 @@ class NativeStagedFile {
51226
51234
  return this.#state;
51227
51235
  }
51228
51236
  async cleanup() {
51237
+ // Native descriptors cannot close or be recycled while libuv is synchronizing them.
51238
+ if (this.#publicationFlush)
51239
+ await this.#publicationFlush.catch(() => { });
51229
51240
  const closed = this.#finalize();
51230
51241
  if (closed.error) {
51231
51242
  throw closed.error;
@@ -53712,8 +53723,8 @@ function pinnedWriteModeAssertion(fd, mode, assertBeforeMutation, privateCreatio
53712
53723
 
53713
53724
 
53714
53725
  // Node has no portable no-replace rename. Publish the completed stage by link,
53715
- // then remove its verified temporary name without yielding.
53716
- function publishCopyStage(params) {
53726
+ // then remove its verified temporary name after any descriptor handoff.
53727
+ async function publishCopyStage(params) {
53717
53728
  const { identity, temporaryPath, targetPath } = params;
53718
53729
  const assertCurrent = () => {
53719
53730
  directory_guard_assertSyncDirectoryGuard(params.parentGuard);
@@ -53767,13 +53778,23 @@ function publishCopyStage(params) {
53767
53778
  }
53768
53779
  }
53769
53780
  else {
53770
- const parent = external_node_fs_.lstatSync(external_node_path_.dirname(temporaryPath), { bigint: true });
53771
- const current = external_node_fs_.lstatSync(temporaryPath, { bigint: true });
53772
- if (parent.isSymbolicLink() || !parent.isDirectory() ||
53773
- !file_identity_sameFileIdentityForCleanup(parent, params.parentGuard.stat) ||
53774
- current.isSymbolicLink() || !current.isFile() ||
53775
- !file_identity_sameFileIdentityForCleanup(current, identity)) {
53776
- 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();
53777
53798
  }
53778
53799
  // This removes the stage's name, never the published destination or source.
53779
53800
  external_node_fs_.unlinkSync(temporaryPath);
@@ -53846,6 +53867,40 @@ function publishThroughPlaceholder(params, assertCurrent) {
53846
53867
  }
53847
53868
  }
53848
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
+
53849
53904
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/pinned-write-staged.js
53850
53905
 
53851
53906
 
@@ -53867,6 +53922,7 @@ function publishThroughPlaceholder(params, assertCurrent) {
53867
53922
 
53868
53923
 
53869
53924
 
53925
+
53870
53926
 
53871
53927
 
53872
53928
  async function runPinnedStagedWrite(params, parentPath, parentGuard) {
@@ -53884,6 +53940,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53884
53940
  let handle;
53885
53941
  let tempIdentity;
53886
53942
  let readHandle;
53943
+ let handoffCloseFailure;
53887
53944
  let renamed = false;
53888
53945
  const completeCreate = params.overwrite === false && params.input.kind !== "file" && params.input.stageBeforePublish === true;
53889
53946
  let receipt;
@@ -53938,11 +53995,15 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53938
53995
  }), external_node_path_.basename(tempPath), external_node_fs_.fstatSync(handle.fd, { bigint: true }));
53939
53996
  }
53940
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")));
53941
54002
  phase = "publish";
53942
54003
  await withAsyncDirectoryGuards([parentGuard], async () => {
53943
54004
  assertFinalSymlinkRejected(targetPath, params.rejectFinalSymlink);
53944
54005
  if (params.overwrite === false) {
53945
- publishCopyStage({
54006
+ await publishCopyStage({
53946
54007
  temporaryPath: tempPath, targetPath, fd: handle.fd,
53947
54008
  identity: tempIdentity, parentGuard,
53948
54009
  assertBeforeMutation,
@@ -53956,6 +54017,18 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53956
54017
  publication = Object.freeze({ status: "published", staged: receipt, basename: params.basename, overwrite: false });
53957
54018
  params.onPublished?.(identity);
53958
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
+ },
53959
54032
  });
53960
54033
  }
53961
54034
  else {
@@ -53983,6 +54056,7 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
53983
54056
  throw new errors_FsSafeError("path-mismatch", "fallback target changed during write");
53984
54057
  }
53985
54058
  const expectedHash = sha256Hex(params.input.data, params.input.encoding);
54059
+ await readHandle?.close();
53986
54060
  readHandle = await promises_.open(targetPath, read_open_flags_resolveReadOpenFlags());
53987
54061
  const readHandleStat = external_node_fs_.fstatSync(readHandle.fd, { bigint: true });
53988
54062
  const actualHash = sha256Hex(await readFileHandleBounded(readHandle, Infinity));
@@ -54021,7 +54095,11 @@ async function runPinnedStagedWrite(params, parentPath, parentGuard) {
54021
54095
  pathname: tempPath, handle, identity: tempIdentity, parentGuard, throwOnCleanupError: true,
54022
54096
  }) : "not-needed";
54023
54097
  },
54024
- 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
+ }],
54025
54103
  });
54026
54104
  }
54027
54105
  else
@@ -109900,4 +109978,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
109900
109978
  // module factories are used so entry inlining is disabled
109901
109979
  // startup
109902
109980
  // Load entry module and return exports
109903
- 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.14",
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": {