replicas-cli 0.3.223 → 0.3.224

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 +21 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -28320,16 +28320,25 @@ var init_learned_skills = __esm({
28320
28320
 
28321
28321
  // ../shared/src/user-message-matching.ts
28322
28322
  function parseTimestampMs(timestamp) {
28323
- const value = typeof timestamp === "number" ? timestamp : Date.parse(timestamp);
28324
- return Number.isFinite(value) ? value : 0;
28323
+ if (typeof timestamp === "number") return Number.isFinite(timestamp) ? timestamp : 0;
28324
+ let value = parsedTimestamps.get(timestamp);
28325
+ if (value === void 0) {
28326
+ const parsed = Date.parse(timestamp);
28327
+ value = Number.isFinite(parsed) ? parsed : 0;
28328
+ if (parsedTimestamps.size >= 5e4) parsedTimestamps.clear();
28329
+ parsedTimestamps.set(timestamp, value);
28330
+ }
28331
+ return value;
28325
28332
  }
28326
28333
  function areUserMessagesWithinMatchWindow(a, b) {
28327
28334
  return a.content === b.content && Math.abs(parseTimestampMs(a.timestamp) - parseTimestampMs(b.timestamp)) <= USER_MESSAGE_MATCH_GRACE_PERIOD_MS;
28328
28335
  }
28336
+ var parsedTimestamps;
28329
28337
  var init_user_message_matching = __esm({
28330
28338
  "../shared/src/user-message-matching.ts"() {
28331
28339
  "use strict";
28332
28340
  init_constants();
28341
+ parsedTimestamps = /* @__PURE__ */ new Map();
28333
28342
  }
28334
28343
  });
28335
28344
 
@@ -30633,7 +30642,13 @@ function filterDisplayMessages(messages, provider2) {
30633
30642
  }
30634
30643
  result = result.flatMap((msg) => {
30635
30644
  if (msg.type !== "user") return [msg];
30636
- const { content, files, walkthroughs, appshots, annotations } = stripAttachmentNote(stripReplicasInstructionBlock(msg.content).trim());
30645
+ let stripped = strippedUserContents.get(msg.content);
30646
+ if (!stripped) {
30647
+ stripped = stripAttachmentNote(stripReplicasInstructionBlock(msg.content).trim());
30648
+ if (strippedUserContents.size >= 5e3) strippedUserContents.clear();
30649
+ strippedUserContents.set(msg.content, stripped);
30650
+ }
30651
+ const { content, files, walkthroughs, appshots, annotations } = stripped;
30637
30652
  if (INTERRUPTED_MESSAGE_REGEX.test(content)) {
30638
30653
  return [{ id: msg.id, type: "interruption", timestamp: msg.timestamp }];
30639
30654
  }
@@ -30651,7 +30666,7 @@ function filterDisplayMessages(messages, provider2) {
30651
30666
  });
30652
30667
  return result;
30653
30668
  }
30654
- var INTERRUPTION_DEDUP_WINDOW_MS;
30669
+ var INTERRUPTION_DEDUP_WINDOW_MS, strippedUserContents;
30655
30670
  var init_parsers = __esm({
30656
30671
  "../shared/src/display-message/parsers/index.ts"() {
30657
30672
  "use strict";
@@ -30676,6 +30691,7 @@ var init_parsers = __esm({
30676
30691
  init_mcp();
30677
30692
  init_utils();
30678
30693
  INTERRUPTION_DEDUP_WINDOW_MS = 15e3;
30694
+ strippedUserContents = /* @__PURE__ */ new Map();
30679
30695
  }
30680
30696
  });
30681
30697
 
@@ -31364,7 +31380,7 @@ var CLI_VERSION;
31364
31380
  var init_cli_version = __esm({
31365
31381
  "../shared/src/cli-version.ts"() {
31366
31382
  "use strict";
31367
- CLI_VERSION = "0.3.223";
31383
+ CLI_VERSION = "0.3.224";
31368
31384
  }
31369
31385
  });
31370
31386
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.223",
3
+ "version": "0.3.224",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {