agent-relay 6.0.15 → 6.0.17

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/index.cjs +60 -34
  2. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -1364,6 +1364,9 @@ var require_sender = __commonJS({
1364
1364
  "use strict";
1365
1365
  var { Duplex } = require("stream");
1366
1366
  var { randomFillSync } = require("crypto");
1367
+ var {
1368
+ types: { isUint8Array }
1369
+ } = require("util");
1367
1370
  var PerMessageDeflate2 = require_permessage_deflate();
1368
1371
  var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
1369
1372
  var { isBlob, isValidStatusCode } = require_validation();
@@ -1517,8 +1520,10 @@ var require_sender = __commonJS({
1517
1520
  buf.writeUInt16BE(code, 0);
1518
1521
  if (typeof data === "string") {
1519
1522
  buf.write(data, 2);
1520
- } else {
1523
+ } else if (isUint8Array(data)) {
1521
1524
  buf.set(data, 2);
1525
+ } else {
1526
+ throw new TypeError("Second argument must be a string or a Uint8Array");
1522
1527
  }
1523
1528
  }
1524
1529
  const options = {
@@ -10815,8 +10820,10 @@ ${cb}` : comment;
10815
10820
  }
10816
10821
  }
10817
10822
  if (afterDoc) {
10818
- Array.prototype.push.apply(doc.errors, this.errors);
10819
- Array.prototype.push.apply(doc.warnings, this.warnings);
10823
+ for (let i = 0; i < this.errors.length; ++i)
10824
+ doc.errors.push(this.errors[i]);
10825
+ for (let i = 0; i < this.warnings.length; ++i)
10826
+ doc.warnings.push(this.warnings[i]);
10820
10827
  } else {
10821
10828
  doc.errors = this.errors;
10822
10829
  doc.warnings = this.warnings;
@@ -11549,7 +11556,7 @@ var require_lexer = __commonJS({
11549
11556
  const n = (yield* this.pushCount(1)) + (yield* this.pushSpaces(true));
11550
11557
  this.indentNext = this.indentValue + 1;
11551
11558
  this.indentValue += n;
11552
- return yield* this.parseBlockStart();
11559
+ return "block-start";
11553
11560
  }
11554
11561
  return "doc";
11555
11562
  }
@@ -11848,28 +11855,38 @@ var require_lexer = __commonJS({
11848
11855
  return 0;
11849
11856
  }
11850
11857
  *pushIndicators() {
11851
- switch (this.charAt(0)) {
11852
- case "!":
11853
- return (yield* this.pushTag()) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
11854
- case "&":
11855
- return (yield* this.pushUntil(isNotAnchorChar)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
11856
- case "-":
11857
- // this is an error
11858
- case "?":
11859
- // this is an error outside flow collections
11860
- case ":": {
11861
- const inFlow = this.flowLevel > 0;
11862
- const ch1 = this.charAt(1);
11863
- if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
11864
- if (!inFlow)
11865
- this.indentNext = this.indentValue + 1;
11866
- else if (this.flowKey)
11867
- this.flowKey = false;
11868
- return (yield* this.pushCount(1)) + (yield* this.pushSpaces(true)) + (yield* this.pushIndicators());
11858
+ let n = 0;
11859
+ loop: while (true) {
11860
+ switch (this.charAt(0)) {
11861
+ case "!":
11862
+ n += yield* this.pushTag();
11863
+ n += yield* this.pushSpaces(true);
11864
+ continue loop;
11865
+ case "&":
11866
+ n += yield* this.pushUntil(isNotAnchorChar);
11867
+ n += yield* this.pushSpaces(true);
11868
+ continue loop;
11869
+ case "-":
11870
+ // this is an error
11871
+ case "?":
11872
+ // this is an error outside flow collections
11873
+ case ":": {
11874
+ const inFlow = this.flowLevel > 0;
11875
+ const ch1 = this.charAt(1);
11876
+ if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
11877
+ if (!inFlow)
11878
+ this.indentNext = this.indentValue + 1;
11879
+ else if (this.flowKey)
11880
+ this.flowKey = false;
11881
+ n += yield* this.pushCount(1);
11882
+ n += yield* this.pushSpaces(true);
11883
+ continue loop;
11884
+ }
11869
11885
  }
11870
11886
  }
11887
+ break loop;
11871
11888
  }
11872
- return 0;
11889
+ return n;
11873
11890
  }
11874
11891
  *pushTag() {
11875
11892
  if (this.charAt(1) === "<") {
@@ -12028,6 +12045,13 @@ var require_parser = __commonJS({
12028
12045
  }
12029
12046
  return prev.splice(i, prev.length);
12030
12047
  }
12048
+ function arrayPushArray(target, source) {
12049
+ if (source.length < 1e5)
12050
+ Array.prototype.push.apply(target, source);
12051
+ else
12052
+ for (let i = 0; i < source.length; ++i)
12053
+ target.push(source[i]);
12054
+ }
12031
12055
  function fixFlowSeqItems(fc) {
12032
12056
  if (fc.start.type === "flow-seq-start") {
12033
12057
  for (const it2 of fc.items) {
@@ -12037,11 +12061,11 @@ var require_parser = __commonJS({
12037
12061
  delete it2.key;
12038
12062
  if (isFlowToken(it2.value)) {
12039
12063
  if (it2.value.end)
12040
- Array.prototype.push.apply(it2.value.end, it2.sep);
12064
+ arrayPushArray(it2.value.end, it2.sep);
12041
12065
  else
12042
12066
  it2.value.end = it2.sep;
12043
12067
  } else
12044
- Array.prototype.push.apply(it2.start, it2.sep);
12068
+ arrayPushArray(it2.start, it2.sep);
12045
12069
  delete it2.sep;
12046
12070
  }
12047
12071
  }
@@ -12396,7 +12420,7 @@ var require_parser = __commonJS({
12396
12420
  const prev = map2.items[map2.items.length - 2];
12397
12421
  const end = prev?.value?.end;
12398
12422
  if (Array.isArray(end)) {
12399
- Array.prototype.push.apply(end, it2.start);
12423
+ arrayPushArray(end, it2.start);
12400
12424
  end.push(this.sourceToken);
12401
12425
  map2.items.pop();
12402
12426
  return;
@@ -12584,7 +12608,7 @@ var require_parser = __commonJS({
12584
12608
  const prev = seq.items[seq.items.length - 2];
12585
12609
  const end = prev?.value?.end;
12586
12610
  if (Array.isArray(end)) {
12587
- Array.prototype.push.apply(end, it2.start);
12611
+ arrayPushArray(end, it2.start);
12588
12612
  end.push(this.sourceToken);
12589
12613
  seq.items.pop();
12590
12614
  return;
@@ -43634,7 +43658,7 @@ var AgentRelayClient = class _AgentRelayClient {
43634
43658
  stdoutLines,
43635
43659
  stderrLines
43636
43660
  });
43637
- drainBrokerStdoutAfterStartup(child);
43661
+ drainBrokerStdioAfterStartup(child);
43638
43662
  const client = new _AgentRelayClient({
43639
43663
  baseUrl,
43640
43664
  apiKey,
@@ -43933,12 +43957,14 @@ async function waitForApiUrl(child, timeoutMs, debug) {
43933
43957
  });
43934
43958
  });
43935
43959
  }
43936
- function drainBrokerStdoutAfterStartup(child) {
43937
- if (!child.stdout)
43938
- return;
43939
- child.stdout.on("data", () => {
43940
- });
43941
- child.stdout.resume();
43960
+ function drainBrokerStdioAfterStartup(child) {
43961
+ for (const stream of [child.stdout, child.stderr]) {
43962
+ if (!stream)
43963
+ continue;
43964
+ stream.on("data", () => {
43965
+ });
43966
+ stream.resume();
43967
+ }
43942
43968
  }
43943
43969
  function pushBufferedLine(lines, line) {
43944
43970
  lines.push(line);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "6.0.15",
3
+ "version": "6.0.17",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -130,14 +130,14 @@
130
130
  },
131
131
  "homepage": "https://github.com/AgentWorkforce/relay#readme",
132
132
  "dependencies": {
133
- "@agent-relay/cloud": "6.0.15",
134
- "@agent-relay/config": "6.0.15",
135
- "@agent-relay/hooks": "6.0.15",
136
- "@agent-relay/sdk": "6.0.15",
137
- "@agent-relay/telemetry": "6.0.15",
138
- "@agent-relay/trajectory": "6.0.15",
139
- "@agent-relay/user-directory": "6.0.15",
140
- "@agent-relay/utils": "6.0.15",
133
+ "@agent-relay/cloud": "6.0.17",
134
+ "@agent-relay/config": "6.0.17",
135
+ "@agent-relay/hooks": "6.0.17",
136
+ "@agent-relay/sdk": "6.0.17",
137
+ "@agent-relay/telemetry": "6.0.17",
138
+ "@agent-relay/trajectory": "6.0.17",
139
+ "@agent-relay/user-directory": "6.0.17",
140
+ "@agent-relay/utils": "6.0.17",
141
141
  "@aws-sdk/client-s3": "3.1020.0",
142
142
  "@modelcontextprotocol/sdk": "^1.0.0",
143
143
  "@relayauth/core": "^0.1.2",