@lousy-agents/mcp 5.17.13 → 5.17.14

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 +45 -22
  2. package/package.json +2 -2
@@ -16356,11 +16356,20 @@ class UrlElicitationRequiredError extends McpError {
16356
16356
  //# sourceMappingURL=types.js.map
16357
16357
  ;// CONCATENATED MODULE: ../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
16358
16358
 
16359
+ const STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
16359
16360
  /**
16360
16361
  * Buffers a continuous stdio stream into discrete JSON-RPC messages.
16361
16362
  */
16362
16363
  class ReadBuffer {
16364
+ constructor(options) {
16365
+ this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
16366
+ }
16363
16367
  append(chunk) {
16368
+ const newSize = (this._buffer?.length ?? 0) + chunk.length;
16369
+ if (newSize > this._maxBufferSize) {
16370
+ this.clear();
16371
+ throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
16372
+ }
16364
16373
  this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
16365
16374
  }
16366
16375
  readMessage() {
@@ -16395,19 +16404,25 @@ function serializeMessage(message) {
16395
16404
  * This transport is only available in Node.js environments.
16396
16405
  */
16397
16406
  class StdioServerTransport {
16398
- constructor(_stdin = external_node_process_.stdin, _stdout = external_node_process_.stdout) {
16407
+ constructor(_stdin = external_node_process_.stdin, _stdout = external_node_process_.stdout, options) {
16399
16408
  this._stdin = _stdin;
16400
16409
  this._stdout = _stdout;
16401
- this._readBuffer = new ReadBuffer();
16402
16410
  this._started = false;
16403
16411
  // Arrow functions to bind `this` properly, while maintaining function identity.
16404
16412
  this._ondata = (chunk) => {
16405
- this._readBuffer.append(chunk);
16406
- this.processReadBuffer();
16413
+ try {
16414
+ this._readBuffer.append(chunk);
16415
+ this.processReadBuffer();
16416
+ }
16417
+ catch (error) {
16418
+ this.onerror?.(error);
16419
+ this.close().catch(() => { });
16420
+ }
16407
16421
  };
16408
16422
  this._onerror = (error) => {
16409
16423
  this.onerror?.(error);
16410
16424
  };
16425
+ this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
16411
16426
  }
16412
16427
  /**
16413
16428
  * Starts listening for messages on stdin.
@@ -21755,6 +21770,20 @@ function normalizeObjectSchema(schema) {
21755
21770
  }
21756
21771
  return undefined;
21757
21772
  }
21773
+ function getDotPath(path) {
21774
+ if (path.length === 0) {
21775
+ return 'object root';
21776
+ }
21777
+ return path.reduce((acc, seg, index) => {
21778
+ if (index === 0) {
21779
+ return String(seg);
21780
+ }
21781
+ if (typeof seg === 'number') {
21782
+ return `${acc}[${seg}]`;
21783
+ }
21784
+ return `${acc}.${seg}`;
21785
+ }, '');
21786
+ }
21758
21787
  // --- Error message extraction ---
21759
21788
  /**
21760
21789
  * Safely extracts an error message from a parse result error.
@@ -21762,16 +21791,21 @@ function normalizeObjectSchema(schema) {
21762
21791
  */
21763
21792
  function getParseErrorMessage(error) {
21764
21793
  if (error && typeof error === 'object') {
21794
+ // When present, prioritize zod issues and format as a message and path
21795
+ if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) {
21796
+ return error.issues
21797
+ .map((i) => {
21798
+ if (!i.path?.length) {
21799
+ return i.message;
21800
+ }
21801
+ return `${i.message} at ${getDotPath(i.path)}`;
21802
+ })
21803
+ .join('\n');
21804
+ }
21765
21805
  // Try common error structures
21766
21806
  if ('message' in error && typeof error.message === 'string') {
21767
21807
  return error.message;
21768
21808
  }
21769
- if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) {
21770
- const firstIssue = error.issues[0];
21771
- if (firstIssue && typeof firstIssue === 'object' && 'message' in firstIssue) {
21772
- return String(firstIssue.message);
21773
- }
21774
- }
21775
21809
  // Fallback: try to stringify the error
21776
21810
  try {
21777
21811
  return JSON.stringify(error);
@@ -25053,18 +25087,7 @@ class Server extends Protocol {
25053
25087
  if (!methodSchema) {
25054
25088
  throw new Error('Schema is missing a method literal');
25055
25089
  }
25056
- // Extract literal value using type-safe property access
25057
- let methodValue;
25058
- if (isZ4Schema(methodSchema)) {
25059
- const v4Schema = methodSchema;
25060
- const v4Def = v4Schema._zod?.def;
25061
- methodValue = v4Def?.value ?? v4Schema.value;
25062
- }
25063
- else {
25064
- const v3Schema = methodSchema;
25065
- const legacyDef = v3Schema._def;
25066
- methodValue = legacyDef?.value ?? v3Schema.value;
25067
- }
25090
+ const methodValue = getLiteralValue(methodSchema);
25068
25091
  if (typeof methodValue !== 'string') {
25069
25092
  throw new Error('Schema method literal must be a string');
25070
25093
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lousy-agents/mcp",
3
- "version": "5.17.13",
3
+ "version": "5.17.14",
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": {
@@ -36,7 +36,7 @@
36
36
  "build": "rspack build --config rspack.config.ts && chmod +x dist/mcp-server.js"
37
37
  },
38
38
  "dependencies": {
39
- "@modelcontextprotocol/sdk": "1.29.0",
39
+ "@modelcontextprotocol/sdk": "1.30.0",
40
40
  "yaml": "2.9.0",
41
41
  "zod": "4.4.3"
42
42
  },