agent-relay 6.2.7 → 6.2.8

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 +27 -80
  2. package/package.json +9 -9
package/dist/index.cjs CHANGED
@@ -79216,13 +79216,18 @@ var BOX_DRAWING_ONLY_RE = /^[\s\u2500-\u257f\u2580-\u259f\u25a0-\u25ff\-_=~]{3,}
79216
79216
  var BROKER_LOG_RE = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s+(?:INFO|WARN|ERROR|DEBUG)\s/u;
79217
79217
  var CLAUDE_HEADER_RE = /^(?:[\s\u2580-\u259f✢*·▗▖▘▝]+\s*)?(?:Claude\s+Code(?:\s+v?[\d.]+)?|(?:Sonnet|Haiku|Opus)\s*[\d.]+|claude-(?:sonnet|haiku|opus)-[\w.-]+|Running\s+on\s+claude)/iu;
79218
79218
  var DIR_BREADCRUMB_RE = /^\s*~[\\/]/u;
79219
- var UI_HINT_RE = /\b(?:Press\s+up\s+to\s+edit|tab\s+to\s+queue|bypass\s+permissions|esc\s+to\s+interrupt)\b/iu;
79219
+ var UI_HINT_RE = /\b(?:Press\s*up\s*to\s*edit|tab\s*to\s*queue|bypass\s*permissions|esc\s*to\s*interrupt|paste\s*again\s*to\s*expand|shift\s*[+]?\s*tab\s*to\s*cycle|running\s+stop\s+hook|fan\s+out\s+subagents)/iu;
79220
+ var VIM_MODE_RE = /^[-\s]*--?(?:INSERT|NORMAL|VISUAL|REPLACE)--?[-\s]*$|--?(?:INSERT|NORMAL|VISUAL|REPLACE)--/u;
79221
+ var CLAUDE_FOOTER_RE = /(?:Opus|Sonnet|Haiku)\s*\d[\d.]*\s*\(?(?:1M\s*context|context)?\)?\s*ctx\s*:\s*\d+%/iu;
79220
79222
  var THINKING_LINE_RE = new RegExp(`^[\\s${SPINNER}]*\\s*\\w[\\w\\s]*\\u2026\\s*$`, "u");
79223
+ var THINKING_STATUS_RE = /\b(?:thinking\s+(?:with\s+\w+\s+effort|more\s+with|harder)|↓\s*\d+\s*tokens?\b|↑\s*\d+\s*tokens?\b|crunched\s+for\s+\d|sautéed\s+for\s+\d|befuddl|flibbertigib|gitifying|flowing\s*…)/iu;
79221
79224
  var CURSOR_ONLY_RE = /^[\s❯⎿›»◀▶←→↑↓⟨⟩⟪⟫·]+$/u;
79222
79225
  var CURSOR_AGENT_RE = /^(?:Cursor Agent|[\s⬡⬢]*Generating[.\s]|\[Pasted text|Auto-run all|Add a follow-up|ctrl\+c to stop|shift\+tab|Auto$|\/\s*commands|@\s*files|!\s*shell|follow-ups?\s|The user ha)/iu;
79223
79226
  var SLASH_COMMAND_RE = /^\/\w+\s*$/u;
79224
79227
  var MCP_JSON_KV_RE = /^\s*"(?:type|method|params|result|id|jsonrpc|tool|name|arguments|content|role|metadata)"\s*:/u;
79225
79228
  var MEANINGFUL_CONTENT_RE = /[a-zA-Z0-9]/u;
79229
+ var MALFORMED_PTY_FRAME_RUN_RE = /(?:(?:qW0|q[A-Za-z]?0|[lmjkx]q{2,}|q{2,}[lmjkx]?)[\s|/_=\-~]*){4,}/giu;
79230
+ var MALFORMED_PTY_FRAME_ONLY_RE = /^[\s|/_=\-~lmjkxqtwuvn0W]{12,}$/iu;
79226
79231
  function scrubSecrets(text) {
79227
79232
  let result = text;
79228
79233
  for (const pattern of SECRET_PATTERNS) {
@@ -79230,6 +79235,14 @@ function scrubSecrets(text) {
79230
79235
  }
79231
79236
  return result;
79232
79237
  }
79238
+ function stripMalformedPtyFrameGarbage(line) {
79239
+ const strippedRuns = line.replace(MALFORMED_PTY_FRAME_RUN_RE, " ");
79240
+ const compact = strippedRuns.replace(SPINNER_RE, "").replace(/\s+/g, "");
79241
+ if (compact.length >= 12 && MALFORMED_PTY_FRAME_ONLY_RE.test(compact)) {
79242
+ return "";
79243
+ }
79244
+ return strippedRuns;
79245
+ }
79233
79246
  function scrubForChannel(text) {
79234
79247
  let withoutSystemReminders = text;
79235
79248
  const openTag = "<system-reminder>";
@@ -79261,9 +79274,10 @@ function scrubForChannel(text) {
79261
79274
  const meaningful = [];
79262
79275
  let jsonDepth = 0;
79263
79276
  for (const line of lines) {
79264
- const trimmed = line.trim();
79277
+ const cleanedLine = stripMalformedPtyFrameGarbage(line);
79278
+ const trimmed = cleanedLine.trim();
79265
79279
  if (jsonDepth > 0) {
79266
- jsonDepth += countJsonDepth(line);
79280
+ jsonDepth += countJsonDepth(cleanedLine);
79267
79281
  if (jsonDepth <= 0)
79268
79282
  jsonDepth = 0;
79269
79283
  continue;
@@ -79271,10 +79285,10 @@ function scrubForChannel(text) {
79271
79285
  if (trimmed.length === 0)
79272
79286
  continue;
79273
79287
  if (trimmed.startsWith("{") || /^\[\s*\{/.test(trimmed)) {
79274
- jsonDepth = Math.max(countJsonDepth(line), 0);
79288
+ jsonDepth = Math.max(countJsonDepth(cleanedLine), 0);
79275
79289
  continue;
79276
79290
  }
79277
- if (MCP_JSON_KV_RE.test(line))
79291
+ if (MCP_JSON_KV_RE.test(cleanedLine))
79278
79292
  continue;
79279
79293
  if (SPINNER_CLASS_RE.test(trimmed))
79280
79294
  continue;
@@ -79288,8 +79302,14 @@ function scrubForChannel(text) {
79288
79302
  continue;
79289
79303
  if (UI_HINT_RE.test(trimmed))
79290
79304
  continue;
79305
+ if (VIM_MODE_RE.test(trimmed))
79306
+ continue;
79307
+ if (CLAUDE_FOOTER_RE.test(trimmed))
79308
+ continue;
79291
79309
  if (THINKING_LINE_RE.test(trimmed))
79292
79310
  continue;
79311
+ if (THINKING_STATUS_RE.test(trimmed))
79312
+ continue;
79293
79313
  if (CURSOR_ONLY_RE.test(trimmed))
79294
79314
  continue;
79295
79315
  if (CURSOR_AGENT_RE.test(trimmed))
@@ -79301,7 +79321,7 @@ function scrubForChannel(text) {
79301
79321
  const alphanum = trimmed.replace(SPINNER_RE, "").replace(/\s+/g, "");
79302
79322
  if (alphanum.replace(/[^a-zA-Z0-9]/g, "").length <= 3)
79303
79323
  continue;
79304
- meaningful.push(line);
79324
+ meaningful.push(cleanedLine);
79305
79325
  }
79306
79326
  return meaningful.join("\n").replace(/\n{3,}/g, "\n\n").trim();
79307
79327
  }
@@ -87365,80 +87385,7 @@ ${excerpt}` : "";
87365
87385
  * The raw (ANSI-stripped) output is still written to disk for step chaining.
87366
87386
  */
87367
87387
  static scrubForChannel(text) {
87368
- const withoutSystemReminders = text.replace(/<system-reminder>[\s\S]*?<\/system-reminder>/giu, "").replace(/<system-reminder>[\s\S]*/giu, "");
87369
- const normalized = withoutSystemReminders.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
87370
- const ansiStripped = stripAnsi(normalized);
87371
- const SPINNER2 = "\\u2756\\u2738\\u2739\\u273a\\u273b\\u273c\\u273d\\u2731\\u2732\\u2733\\u2734\\u2735\\u2736\\u2737\\u2743\\u2745\\u2746\\u25d6\\u25d7\\u25d8\\u25d9\\u2022\\u25cf\\u25cb\\u25a0\\u25a1\\u25b6\\u25c0\\u23f5\\u23f6\\u23f7\\u23f8\\u23f9\\u25e2\\u25e3\\u25e4\\u25e5\\u2597\\u2596\\u2598\\u259d\\u2bc8\\u2bc7\\u2bc5\\u2bc6\\u00b7\\u2590\\u258c\\u2588\\u2584\\u2580\\u259a\\u259e\\u2b21\\u2b22";
87372
- const spinnerRe = new RegExp(`[${SPINNER2}]`, "gu");
87373
- const spinnerClassRe = new RegExp(`^[\\s${SPINNER2}]*$`, "u");
87374
- const boxDrawingOnlyRe = /^[\s\u2500-\u257f\u2580-\u259f\u25a0-\u25ff\-_=~]{3,}$/u;
87375
- const brokerLogRe = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+Z\s+(?:INFO|WARN|ERROR|DEBUG)\s/u;
87376
- const claudeHeaderRe = /^(?:[\s\u2580-\u259f✢*·▗▖▘▝]+\s*)?(?:Claude\s+Code(?:\s+v?[\d.]+)?|(?:Sonnet|Haiku|Opus)\s*[\d.]+|claude-(?:sonnet|haiku|opus)-[\w.-]+|Running\s+on\s+claude)/iu;
87377
- const dirBreadcrumbRe = /^\s*~[\\/]/u;
87378
- const uiHintRe = /\b(?:Press\s+up\s+to\s+edit|tab\s+to\s+queue|bypass\s+permissions|esc\s+to\s+interrupt)\b/iu;
87379
- const thinkingLineRe = new RegExp(`^[\\s${SPINNER2}]*\\s*\\w[\\w\\s]*\\u2026\\s*$`, "u");
87380
- const cursorOnlyRe = /^[\s❯⎿›»◀▶←→↑↓⟨⟩⟪⟫·]+$/u;
87381
- const cursorAgentRe = /^(?:Cursor Agent|[\s⬡⬢]*Generating[.\s]|\[Pasted text|Auto-run all|Add a follow-up|ctrl\+c to stop|shift\+tab|Auto$|\/\s*commands|@\s*files|!\s*shell|follow-ups?\s|The user ha)/iu;
87382
- const slashCommandRe = /^\/\w+\s*$/u;
87383
- const mcpJsonKvRe = /^\s*"(?:type|method|params|result|id|jsonrpc|tool|name|arguments|content|role|metadata)"\s*:/u;
87384
- const meaningfulContentRe = /[a-zA-Z0-9]/u;
87385
- const countJsonDepth = (line) => {
87386
- let depth = 0;
87387
- for (const ch of line) {
87388
- if (ch === "{" || ch === "[")
87389
- depth += 1;
87390
- if (ch === "}" || ch === "]")
87391
- depth -= 1;
87392
- }
87393
- return depth;
87394
- };
87395
- const lines = ansiStripped.split("\n");
87396
- const meaningful = [];
87397
- let jsonDepth = 0;
87398
- for (const line of lines) {
87399
- const trimmed = line.trim();
87400
- if (jsonDepth > 0) {
87401
- jsonDepth += countJsonDepth(line);
87402
- if (jsonDepth <= 0)
87403
- jsonDepth = 0;
87404
- continue;
87405
- }
87406
- if (trimmed.length === 0)
87407
- continue;
87408
- if (trimmed.startsWith("{") || /^\[\s*\{/.test(trimmed)) {
87409
- jsonDepth = Math.max(countJsonDepth(line), 0);
87410
- continue;
87411
- }
87412
- if (mcpJsonKvRe.test(line))
87413
- continue;
87414
- if (spinnerClassRe.test(trimmed))
87415
- continue;
87416
- if (boxDrawingOnlyRe.test(trimmed))
87417
- continue;
87418
- if (brokerLogRe.test(trimmed))
87419
- continue;
87420
- if (claudeHeaderRe.test(trimmed))
87421
- continue;
87422
- if (dirBreadcrumbRe.test(trimmed))
87423
- continue;
87424
- if (uiHintRe.test(trimmed))
87425
- continue;
87426
- if (thinkingLineRe.test(trimmed))
87427
- continue;
87428
- if (cursorOnlyRe.test(trimmed))
87429
- continue;
87430
- if (cursorAgentRe.test(trimmed))
87431
- continue;
87432
- if (slashCommandRe.test(trimmed))
87433
- continue;
87434
- if (!meaningfulContentRe.test(trimmed))
87435
- continue;
87436
- const alphanum = trimmed.replace(spinnerRe, "").replace(/\s+/g, "");
87437
- if (alphanum.replace(/[^a-zA-Z0-9]/g, "").length <= 3)
87438
- continue;
87439
- meaningful.push(line);
87440
- }
87441
- return meaningful.join("\n").replace(/\n{3,}/g, "\n\n").trim();
87388
+ return scrubForChannel(text);
87442
87389
  }
87443
87390
  /** Sanitize a workflow name into a valid channel name. */
87444
87391
  sanitizeChannelName(name) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-relay",
3
- "version": "6.2.7",
3
+ "version": "6.2.8",
4
4
  "description": "Real-time agent-to-agent communication system",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -132,14 +132,14 @@
132
132
  },
133
133
  "homepage": "https://github.com/AgentWorkforce/relay#readme",
134
134
  "dependencies": {
135
- "@agent-relay/cloud": "6.2.7",
136
- "@agent-relay/config": "6.2.7",
137
- "@agent-relay/hooks": "6.2.7",
138
- "@agent-relay/sdk": "6.2.7",
139
- "@agent-relay/telemetry": "6.2.7",
140
- "@agent-relay/trajectory": "6.2.7",
141
- "@agent-relay/user-directory": "6.2.7",
142
- "@agent-relay/utils": "6.2.7",
135
+ "@agent-relay/cloud": "6.2.8",
136
+ "@agent-relay/config": "6.2.8",
137
+ "@agent-relay/hooks": "6.2.8",
138
+ "@agent-relay/sdk": "6.2.8",
139
+ "@agent-relay/telemetry": "6.2.8",
140
+ "@agent-relay/trajectory": "6.2.8",
141
+ "@agent-relay/user-directory": "6.2.8",
142
+ "@agent-relay/utils": "6.2.8",
143
143
  "@aws-sdk/client-s3": "3.1020.0",
144
144
  "@modelcontextprotocol/sdk": "^1.0.0",
145
145
  "@relayauth/core": "^0.1.2",