@replohq/sandbox-runtime 1.7.4 → 1.7.5

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.
package/buildMetadata.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export const BUILD_METADATA = {
2
2
  "packageName": "@replohq/sandbox-runtime",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "branch": "HEAD",
5
- "commit": "f6125c1834fe26cb6f884cdff75da5f5788f3ca8",
6
- "builtAt": "2026-09-17T01:40:15.017Z"
5
+ "commit": "dadbeffde02243998e85250ba4b2a21565c0b804",
6
+ "builtAt": "2026-09-17T18:17:52.737Z"
7
7
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@replohq/sandbox-runtime",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "reploBuild": {
5
5
  "packageName": "@replohq/sandbox-runtime",
6
- "version": "1.7.4",
6
+ "version": "1.7.5",
7
7
  "branch": "HEAD",
8
- "commit": "f6125c1834fe26cb6f884cdff75da5f5788f3ca8",
9
- "builtAt": "2026-09-17T01:40:15.017Z"
8
+ "commit": "dadbeffde02243998e85250ba4b2a21565c0b804",
9
+ "builtAt": "2026-09-17T18:17:52.737Z"
10
10
  },
11
11
  "description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
12
12
  "license": "SEE LICENSE IN LICENSE",
@@ -1,4 +1,5 @@
1
1
  import { getWebsiteBuilderRpc } from "./iframeRpcChannel";
2
+ import { invalidateSymbolicationCache } from "./symbolicate";
2
3
  let hasInstalledFastRefreshRelay = false;
3
4
  let onFastRefreshComplete = null;
4
5
  function installFastRefreshRelay({
@@ -13,6 +14,9 @@ function installFastRefreshRelay({
13
14
  const originalInfo = console.info;
14
15
  const relayIfFastRefreshComplete = (...args) => {
15
16
  const message = args.join(" ");
17
+ if (message.includes("[Fast Refresh] rebuilding") || message.includes("[Fast Refresh] done")) {
18
+ invalidateSymbolicationCache();
19
+ }
16
20
  if (message.includes("[Fast Refresh] done")) {
17
21
  getWebsiteBuilderRpc()?.fastRefreshComplete(void 0);
18
22
  onFastRefreshComplete?.();
@@ -308,7 +308,9 @@ function useSelectionInteractions({
308
308
  data
309
309
  };
310
310
  void maybeSymbolicate(data).then((symbolicated) => {
311
- if (!isSelectionStillCurrent({
311
+ const session = interactionSessionRef.current;
312
+ const isPendingClickOnSelection = session.type === "drag" && !session.hasExceededThreshold && committedSelectionAtPointerDown.length === 1 && committedSelectionAtPointerDown[0] === selectionElement;
313
+ if (!isPendingClickOnSelection && !isSelectionStillCurrent({
312
314
  session: interactionSessionRef.current,
313
315
  selection: { type: "element", element: selectionElement }
314
316
  })) {
@@ -1,2 +1,3 @@
1
1
  import type { SelectedElement } from "../_vendor/schemas/generated/selectMode";
2
+ export declare function invalidateSymbolicationCache(): void;
2
3
  export declare function symbolicateSelectedElement(selectedElement: SelectedElement): Promise<SelectedElement>;
@@ -66,7 +66,46 @@ function extractResolvedFrame(entry) {
66
66
  }
67
67
  return entry.value?.originalStackFrame ?? null;
68
68
  }
69
- async function postFrames({
69
+ const MAX_SYMBOLICATION_CACHE_ENTRIES = 128;
70
+ const symbolications = /* @__PURE__ */ new Map();
71
+ let symbolicationRevision = 0;
72
+ function invalidateSymbolicationCache() {
73
+ symbolications.clear();
74
+ symbolicationRevision += 1;
75
+ }
76
+ async function postFrames(request) {
77
+ if (request.frames.length === 0) {
78
+ return [];
79
+ }
80
+ const key = JSON.stringify(request);
81
+ const cached = symbolications.get(key);
82
+ if (cached) {
83
+ return cached;
84
+ }
85
+ const revision = symbolicationRevision;
86
+ const promise = fetchFrames(request).then((results) => {
87
+ if (revision !== symbolicationRevision) {
88
+ return request.frames.map(() => null);
89
+ }
90
+ const hasUnresolvedFrames = results.length !== request.frames.length || results.some((result, index) => {
91
+ const frame = extractResolvedFrame(result);
92
+ return !frame?.file || frame.file === request.frames[index]?.file;
93
+ });
94
+ if (hasUnresolvedFrames && symbolications.get(key) === promise) {
95
+ symbolications.delete(key);
96
+ }
97
+ return results;
98
+ });
99
+ if (symbolications.size >= MAX_SYMBOLICATION_CACHE_ENTRIES) {
100
+ const oldestKey = symbolications.keys().next().value;
101
+ if (oldestKey !== void 0) {
102
+ symbolications.delete(oldestKey);
103
+ }
104
+ }
105
+ symbolications.set(key, promise);
106
+ return promise;
107
+ }
108
+ async function fetchFrames({
70
109
  frames,
71
110
  isServer
72
111
  }) {
@@ -195,5 +234,6 @@ async function symbolicateSelectedElement(selectedElement) {
195
234
  };
196
235
  }
197
236
  export {
237
+ invalidateSymbolicationCache,
198
238
  symbolicateSelectedElement
199
239
  };