@relaymessenger/cli 0.3.0 → 0.3.1

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.
@@ -3765,6 +3765,7 @@ var require_fast_uri = __commonJS({
3765
3765
  return uriTokens.join("");
3766
3766
  }
3767
3767
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
3768
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
3768
3769
  function getParseError(parsed, matches) {
3769
3770
  if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
3770
3771
  return 'URI path must start with "/" when authority is present.';
@@ -3794,6 +3795,11 @@ var require_fast_uri = __commonJS({
3794
3795
  uri = "//" + uri;
3795
3796
  }
3796
3797
  }
3798
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
3799
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
3800
+ parsed.error = "URI authority must not contain a literal backslash.";
3801
+ malformedAuthorityOrPort = true;
3802
+ }
3797
3803
  const matches = uri.match(URI_PARSE);
3798
3804
  if (matches) {
3799
3805
  parsed.scheme = matches[1];
@@ -24352,16 +24358,7 @@ var Server = class extends Protocol {
24352
24358
  if (!methodSchema) {
24353
24359
  throw new Error("Schema is missing a method literal");
24354
24360
  }
24355
- let methodValue;
24356
- if (isZ4Schema(methodSchema)) {
24357
- const v4Schema = methodSchema;
24358
- const v4Def = v4Schema._zod?.def;
24359
- methodValue = v4Def?.value ?? v4Schema.value;
24360
- } else {
24361
- const v3Schema = methodSchema;
24362
- const legacyDef = v3Schema._def;
24363
- methodValue = legacyDef?.value ?? v3Schema.value;
24364
- }
24361
+ const methodValue = getLiteralValue(methodSchema);
24365
24362
  if (typeof methodValue !== "string") {
24366
24363
  throw new Error("Schema method literal must be a string");
24367
24364
  }
@@ -24670,8 +24667,17 @@ var Server = class extends Protocol {
24670
24667
  import process3 from "node:process";
24671
24668
 
24672
24669
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js
24670
+ var STDIO_DEFAULT_MAX_BUFFER_SIZE = 10 * 1024 * 1024;
24673
24671
  var ReadBuffer = class {
24672
+ constructor(options) {
24673
+ this._maxBufferSize = options?.maxBufferSize ?? STDIO_DEFAULT_MAX_BUFFER_SIZE;
24674
+ }
24674
24675
  append(chunk) {
24676
+ const newSize = (this._buffer?.length ?? 0) + chunk.length;
24677
+ if (newSize > this._maxBufferSize) {
24678
+ this.clear();
24679
+ throw new Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);
24680
+ }
24675
24681
  this._buffer = this._buffer ? Buffer.concat([this._buffer, chunk]) : chunk;
24676
24682
  }
24677
24683
  readMessage() {
@@ -24699,18 +24705,24 @@ function serializeMessage(message) {
24699
24705
 
24700
24706
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js
24701
24707
  var StdioServerTransport = class {
24702
- constructor(_stdin = process3.stdin, _stdout = process3.stdout) {
24708
+ constructor(_stdin = process3.stdin, _stdout = process3.stdout, options) {
24703
24709
  this._stdin = _stdin;
24704
24710
  this._stdout = _stdout;
24705
- this._readBuffer = new ReadBuffer();
24706
24711
  this._started = false;
24707
24712
  this._ondata = (chunk) => {
24708
- this._readBuffer.append(chunk);
24709
- this.processReadBuffer();
24713
+ try {
24714
+ this._readBuffer.append(chunk);
24715
+ this.processReadBuffer();
24716
+ } catch (error51) {
24717
+ this.onerror?.(error51);
24718
+ this.close().catch(() => {
24719
+ });
24720
+ }
24710
24721
  };
24711
24722
  this._onerror = (error51) => {
24712
24723
  this.onerror?.(error51);
24713
24724
  };
24725
+ this._readBuffer = new ReadBuffer({ maxBufferSize: options?.maxBufferSize });
24714
24726
  }
24715
24727
  /**
24716
24728
  * Starts listening for messages on stdin.
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@relaymessenger/cli",
3
- "version": "0.3.0",
4
- "description": "Relay \u2014 messaging for agents. Bridge Claude Code, Codex, Hermes Agent, or OpenClaw to Relay. https://relayapp.im",
3
+ "version": "0.3.1",
4
+ "description": "Relay messaging for agents. Bridge Claude Code, Codex, Hermes Agent, or OpenClaw to Relay. https://relayapp.im",
5
5
  "homepage": "https://relayapp.im",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "git+https://github.com/relaymessenger/relayapp.git"
8
+ "url": "git+https://github.com/relaymessenger/relayapp.git",
9
+ "directory": "packages/relaymessenger"
10
+ },
11
+ "bugs": {
12
+ "url": "https://github.com/relaymessenger/relayapp/issues"
9
13
  },
10
14
  "type": "module",
11
15
  "bin": {