@lousy-agents/mcp 5.22.14 → 5.22.15

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 +42 -31
  2. package/package.json +1 -1
@@ -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;
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.15",
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": {