@lousy-agents/mcp 5.22.11 → 5.22.13

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 +70 -24
  2. package/package.json +2 -2
@@ -6559,7 +6559,7 @@ function escapeJsonPtr(str) {
6559
6559
 
6560
6560
 
6561
6561
  },
6562
- 7046(__unused_rspack_module, __unused_rspack___webpack_exports__, __webpack_require__) {
6562
+ 8363(__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);
@@ -27513,6 +27513,16 @@ class McpServer {
27513
27513
  this._promptHandlersInitialized = false;
27514
27514
  this.server = new Server(serverInfo, options);
27515
27515
  this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
27516
+ // A capability declared in the options gets its handlers now, so registering after connect() works.
27517
+ if (options?.capabilities?.tools) {
27518
+ this.setToolRequestHandlers();
27519
+ }
27520
+ if (options?.capabilities?.resources) {
27521
+ this.setResourceRequestHandlers();
27522
+ }
27523
+ if (options?.capabilities?.prompts) {
27524
+ this.setPromptRequestHandlers();
27525
+ }
27516
27526
  }
27517
27527
  /**
27518
27528
  * Access experimental features.
@@ -38347,6 +38357,39 @@ async function transferFileHandleCore(source, target, sizeHint, maxBytes, target
38347
38357
  }
38348
38358
  }
38349
38359
 
38360
+ // EXTERNAL MODULE: external "node:os"
38361
+ var external_node_os_ = __webpack_require__(8161);
38362
+ ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/error-detail.js
38363
+
38364
+
38365
+ const UNSAFE_ERROR_DETAIL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/gu;
38366
+ function formatErrorDetail(value) {
38367
+ return value.replace(UNSAFE_ERROR_DETAIL_CHARACTERS, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
38368
+ }
38369
+ function shortPath(value) {
38370
+ const home = external_node_os_.homedir();
38371
+ const prefix = home.endsWith(external_node_path_.sep) ? home : `${home}${external_node_path_.sep}`;
38372
+ const shortened = value === home ? "~"
38373
+ : value.startsWith(prefix) ? `~${external_node_path_.sep}${value.slice(prefix.length)}` : value;
38374
+ return formatErrorDetail(shortened);
38375
+ }
38376
+
38377
+ ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/file-open-error.js
38378
+
38379
+ /** Enrich only an attempted open whose absolute pathname is known by its owner. */
38380
+ function annotateReadOnlyOpenError(error, filePath) {
38381
+ if (!(error instanceof Error) || error.code !== "EROFS")
38382
+ return;
38383
+ // Keep the original error, code and errno, even if a caller froze its diagnostics.
38384
+ try {
38385
+ const failure = error;
38386
+ failure.path = filePath;
38387
+ failure.syscall = "open";
38388
+ failure.message = `EROFS: read-only filesystem, open '${formatErrorDetail(filePath)}'`;
38389
+ }
38390
+ catch { /* Diagnostics must not replace the I/O failure. */ }
38391
+ }
38392
+
38350
38393
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/copy-file-input.js
38351
38394
 
38352
38395
 
@@ -38355,6 +38398,7 @@ async function transferFileHandleCore(source, target, sizeHint, maxBytes, target
38355
38398
 
38356
38399
 
38357
38400
 
38401
+
38358
38402
  function resolveFileCopyCloneMode(mode) {
38359
38403
  const clone = resolveCopyCloneMode(mode, "never");
38360
38404
  if (clone === "always" && !native_getNativeBinding()?.copyFileExclusive) {
@@ -38377,7 +38421,7 @@ async function writeCopyFileToFd(fd, input, maxBytes, assertBeforeMutation) {
38377
38421
  maxBytes, sizeHint: input.size, signal: input.signal, assertBeforeMutation,
38378
38422
  });
38379
38423
  }
38380
- async function createNativeCopyFile(native, input, parentFd, basename, maxBytes) {
38424
+ async function createNativeCopyFile(native, input, parentFd, basename, maxBytes, targetPath) {
38381
38425
  input.signal?.throwIfAborted();
38382
38426
  const copier = selectNativeBinding(native, "copyFileExclusive");
38383
38427
  if (!copier) {
@@ -38393,6 +38437,7 @@ async function createNativeCopyFile(native, input, parentFd, basename, maxBytes)
38393
38437
  return await copier.copyFileExclusive(input.handle.fd, parentFd, basename, input.clone, maxBytes !== undefined && Number.isFinite(maxBytes) ? maxBytes : undefined, nativeSignal);
38394
38438
  }
38395
38439
  catch (error) {
38440
+ annotateReadOnlyOpenError(error, targetPath);
38396
38441
  const code = error?.code;
38397
38442
  if (code === "Cancelled" || code === "ABORT_ERR")
38398
38443
  input.signal?.throwIfAborted();
@@ -39096,8 +39141,6 @@ function errorCauseOptions(error) {
39096
39141
  return { cause: error instanceof Error ? error : undefined };
39097
39142
  }
39098
39143
 
39099
- // EXTERNAL MODULE: external "node:os"
39100
- var external_node_os_ = __webpack_require__(8161);
39101
39144
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/windows-appcontainer.js
39102
39145
 
39103
39146
 
@@ -40861,21 +40904,6 @@ function __resetNativeFallbackWarningsForTest() {
40861
40904
  var external_node_child_process_ = __webpack_require__(1421);
40862
40905
  // EXTERNAL MODULE: external "node:url"
40863
40906
  var external_node_url_ = __webpack_require__(3136);
40864
- ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/error-detail.js
40865
-
40866
-
40867
- const UNSAFE_ERROR_DETAIL_CHARACTERS = /[\u0000-\u001f\u007f-\u009f\u2028\u2029]/gu;
40868
- function formatErrorDetail(value) {
40869
- return value.replace(UNSAFE_ERROR_DETAIL_CHARACTERS, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
40870
- }
40871
- function shortPath(value) {
40872
- const home = external_node_os_.homedir();
40873
- const prefix = home.endsWith(external_node_path_.sep) ? home : `${home}${external_node_path_.sep}`;
40874
- const shortened = value === home ? "~"
40875
- : value.startsWith(prefix) ? `~${external_node_path_.sep}${value.slice(prefix.length)}` : value;
40876
- return formatErrorDetail(shortened);
40877
- }
40878
-
40879
40907
  ;// CONCATENATED MODULE: ../../node_modules/@openclaw/fs-safe/dist/permission-exec.js
40880
40908
 
40881
40909
 
@@ -47073,6 +47101,7 @@ var root_create_native_disposeResources = (undefined && undefined.__disposeResou
47073
47101
 
47074
47102
 
47075
47103
 
47104
+
47076
47105
 
47077
47106
 
47078
47107
  function rootWriteQueueKey(root, relativePath) {
@@ -47483,6 +47512,7 @@ async function tryOpenCreateRootNative(params) {
47483
47512
  catch (error) {
47484
47513
  if (hasNodeErrorCode(error, "EEXIST") && typeof error === "object" && error !== null)
47485
47514
  nativeCreateCollisions.add(error);
47515
+ annotateReadOnlyOpenError(error, params.target);
47486
47516
  throw error;
47487
47517
  }
47488
47518
  let rawOpen = true;
@@ -49542,6 +49572,7 @@ function syncFileBestEffortSync(fd, fsModule = external_node_fs_) {
49542
49572
 
49543
49573
 
49544
49574
 
49575
+
49545
49576
  function nativeOpenFlags(flags) {
49546
49577
  const closeOnExec = external_node_fs_.constants.O_CLOEXEC;
49547
49578
  return (flags |
@@ -49594,6 +49625,7 @@ async function createNativeExclusiveFile(targetPath, mode) {
49594
49625
  if (process.platform === "win32" && openError.code === "EPERM") {
49595
49626
  openError.path = targetPath;
49596
49627
  }
49628
+ annotateReadOnlyOpenError(error, targetPath);
49597
49629
  throw error;
49598
49630
  }
49599
49631
  fd = opened.fd;
@@ -49833,6 +49865,7 @@ async function settleStagedFile(params) {
49833
49865
 
49834
49866
 
49835
49867
 
49868
+
49836
49869
 
49837
49870
 
49838
49871
  function closeWriteFd(closeFd, fd) {
@@ -49899,7 +49932,7 @@ async function runPinnedWriteWindows(binding, params, root, parentFd, parentGuar
49899
49932
  tempName = `.fs-safe-${(0,external_node_crypto_.randomUUID)()}.tmp`;
49900
49933
  params.assertBeforeMutation?.();
49901
49934
  const copied = params.input.kind === "file" && !params.private
49902
- ? await createNativeCopyFile(binding, params.input, parentFd, tempName, params.maxBytes)
49935
+ ? await createNativeCopyFile(binding, params.input, parentFd, tempName, params.maxBytes, external_node_path_.join(parentPath, tempName))
49903
49936
  : undefined;
49904
49937
  if (params.private) {
49905
49938
  const parentIdentity = external_node_fs_.fstatSync(parentFd, { bigint: true });
@@ -49918,7 +49951,13 @@ async function runPinnedWriteWindows(binding, params, root, parentFd, parentGuar
49918
49951
  tempFd = copied.fd;
49919
49952
  }
49920
49953
  else {
49921
- tempFd = binding.openBeneath(parentFd, tempName, nativeOpenFlags(external_node_fs_.constants.O_WRONLY | external_node_fs_.constants.O_CREAT | external_node_fs_.constants.O_EXCL)).fd;
49954
+ try {
49955
+ tempFd = binding.openBeneath(parentFd, tempName, nativeOpenFlags(external_node_fs_.constants.O_WRONLY | external_node_fs_.constants.O_CREAT | external_node_fs_.constants.O_EXCL)).fd;
49956
+ }
49957
+ catch (error) {
49958
+ annotateReadOnlyOpenError(error, external_node_path_.join(parentPath, tempName));
49959
+ throw error;
49960
+ }
49922
49961
  }
49923
49962
  const verificationIdentity = strict_file_identity_inspectFileIdentitySync(() => external_node_fs_.fstatSync(tempFd, { bigint: true }));
49924
49963
  tempIdentity = verificationIdentity;
@@ -50188,6 +50227,7 @@ var native_staged_file_disposeResources = (undefined && undefined.__disposeResou
50188
50227
 
50189
50228
 
50190
50229
 
50230
+
50191
50231
  function assertNativeStaging(binding) {
50192
50232
  if ([
50193
50233
  binding.closeOwnedFd,
@@ -50397,14 +50437,20 @@ class NativeStagedFile {
50397
50437
  assertDarwinCreationAcl(this.#owner.parentFd, "file");
50398
50438
  // Native copying populates its new file before returning its descriptor.
50399
50439
  const copied = input.kind === "file" && !this.#verifyMode
50400
- ? await createNativeCopyFile(this.#owner.binding, input, this.#owner.parentFd, this.#owner.name, maxBytes)
50440
+ ? await createNativeCopyFile(this.#owner.binding, input, this.#owner.parentFd, this.#owner.name, maxBytes, external_node_path_.join(this.#owner.directory.realPath, this.#owner.name))
50401
50441
  : undefined;
50402
50442
  state.fileFd = copied?.fd;
50403
50443
  if (state.fileFd === undefined) {
50404
50444
  this.#assertBeforeMutation?.();
50405
50445
  if (this.#private)
50406
50446
  assertDarwinCreationAcl(this.#owner.parentFd, "file");
50407
- state.fileFd = this.#owner.binding.createStagedFile(this.#owner.parentFd, this.#owner.name);
50447
+ try {
50448
+ state.fileFd = this.#owner.binding.createStagedFile(this.#owner.parentFd, this.#owner.name);
50449
+ }
50450
+ catch (error) {
50451
+ annotateReadOnlyOpenError(error, external_node_path_.join(this.#owner.directory.realPath, this.#owner.name));
50452
+ throw error;
50453
+ }
50408
50454
  }
50409
50455
  const fd = state.fileFd;
50410
50456
  if (input.kind === "file")
@@ -108714,4 +108760,4 @@ if (installedChunkData !== 0) { // 0 means "already installed".'
108714
108760
  // module factories are used so entry inlining is disabled
108715
108761
  // startup
108716
108762
  // Load entry module and return exports
108717
- var __webpack_exports__ = __webpack_require__(7046);
108763
+ var __webpack_exports__ = __webpack_require__(8363);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/mcp",
3
- "version": "5.22.11",
3
+ "version": "5.22.13",
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": {
@@ -37,7 +37,7 @@
37
37
  "typecheck": "tsc --noEmit"
38
38
  },
39
39
  "dependencies": {
40
- "@modelcontextprotocol/sdk": "1.32.1",
40
+ "@modelcontextprotocol/sdk": "1.32.2",
41
41
  "yaml": "2.9.1",
42
42
  "zod": "4.5.2"
43
43
  },