@replohq/sandbox-runtime 1.14.0 → 1.16.0
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/_vendor/schemas/errors.d.ts +20 -2
- package/_vendor/schemas/iframeRpcChannel.mjs +33 -26
- package/buildMetadata.js +3 -3
- package/next/config.js +8 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ErrorUserFacingDetails, ErrorUserFacingDetailsWithMessage } from "./generated/errors";
|
|
2
|
-
import
|
|
2
|
+
import * as z from "zod";
|
|
3
3
|
/**
|
|
4
4
|
* Config to use for any standard error we throw in Replo
|
|
5
5
|
*/
|
|
@@ -83,6 +83,24 @@ export declare class ReploHTTPError extends ReploError {
|
|
|
83
83
|
details?: object;
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* HTTP error for callers that branch on `key` in code (SDKs, other services)
|
|
88
|
+
* rather than showing it in Replo's own UI, so it has no display `type`. The
|
|
89
|
+
* worker error handler answers `{ key, message, details, errorId }`. Should
|
|
90
|
+
* only be thrown from routes.
|
|
91
|
+
*/
|
|
92
|
+
export declare class ReploParseableHTTPError extends ReploError {
|
|
93
|
+
statusCode: number;
|
|
94
|
+
key: string;
|
|
95
|
+
userFacingMessage: string;
|
|
96
|
+
details?: Record<string, unknown>;
|
|
97
|
+
constructor(config: ReploErrorConfig & {
|
|
98
|
+
statusCode: number;
|
|
99
|
+
key: string;
|
|
100
|
+
userFacingMessage: string;
|
|
101
|
+
details?: Record<string, unknown>;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
86
104
|
/**
|
|
87
105
|
* Error used to represent an HTTP error that should be surfaced as such. This
|
|
88
106
|
* should be thrown when we want to pass the error through without changing the
|
|
@@ -467,6 +485,6 @@ export declare class IframeRpcChannelConfigurationError extends IframeRpcChannel
|
|
|
467
485
|
export declare class IframeRpcChannelInvalidInputError extends IframeRpcChannelError {
|
|
468
486
|
constructor({ method, cause }: {
|
|
469
487
|
method: string;
|
|
470
|
-
cause: ZodError;
|
|
488
|
+
cause: z.ZodError;
|
|
471
489
|
});
|
|
472
490
|
}
|
|
@@ -3,7 +3,8 @@ import { isNullish } from '../../chunk-PH3S6LJI.mjs';
|
|
|
3
3
|
import '../../chunk-FLYEIRFK.mjs';
|
|
4
4
|
import '../../chunk-TESFJQID.mjs';
|
|
5
5
|
import '../../chunk-G3S6ZNPF.mjs';
|
|
6
|
-
import
|
|
6
|
+
import * as z from 'zod';
|
|
7
|
+
import { z as z$1 } from 'zod';
|
|
7
8
|
|
|
8
9
|
var defaultLogger = {
|
|
9
10
|
info: console.log,
|
|
@@ -166,39 +167,39 @@ var IframeRpcChannelInvalidInputError = class extends IframeRpcChannelError {
|
|
|
166
167
|
}
|
|
167
168
|
};
|
|
168
169
|
|
|
169
|
-
var iframeRpcCallResultSchema = z.discriminatedUnion("type", [
|
|
170
|
-
z.object({
|
|
171
|
-
type: z.literal("success"),
|
|
172
|
-
data: z.unknown()
|
|
170
|
+
var iframeRpcCallResultSchema = z$1.discriminatedUnion("type", [
|
|
171
|
+
z$1.object({
|
|
172
|
+
type: z$1.literal("success"),
|
|
173
|
+
data: z$1.unknown()
|
|
173
174
|
}),
|
|
174
|
-
z.object({
|
|
175
|
-
type: z.literal("error"),
|
|
176
|
-
errorMessage: z.string()
|
|
175
|
+
z$1.object({
|
|
176
|
+
type: z$1.literal("error"),
|
|
177
|
+
errorMessage: z$1.string()
|
|
177
178
|
})
|
|
178
179
|
]);
|
|
179
|
-
var iframeRpcCallSchema = z.discriminatedUnion("type", [
|
|
180
|
-
z.object({
|
|
181
|
-
type: z.literal("notify"),
|
|
182
|
-
method: z.string(),
|
|
183
|
-
data: z.unknown().optional()
|
|
180
|
+
var iframeRpcCallSchema = z$1.discriminatedUnion("type", [
|
|
181
|
+
z$1.object({
|
|
182
|
+
type: z$1.literal("notify"),
|
|
183
|
+
method: z$1.string(),
|
|
184
|
+
data: z$1.unknown().optional()
|
|
184
185
|
}),
|
|
185
|
-
z.object({
|
|
186
|
-
type: z.literal("request"),
|
|
187
|
-
id: z.uuid(),
|
|
188
|
-
method: z.string(),
|
|
189
|
-
data: z.unknown().optional()
|
|
186
|
+
z$1.object({
|
|
187
|
+
type: z$1.literal("request"),
|
|
188
|
+
id: z$1.uuid(),
|
|
189
|
+
method: z$1.string(),
|
|
190
|
+
data: z$1.unknown().optional()
|
|
190
191
|
}),
|
|
191
|
-
z.object({
|
|
192
|
-
type: z.literal("response"),
|
|
193
|
-
id: z.uuid(),
|
|
192
|
+
z$1.object({
|
|
193
|
+
type: z$1.literal("response"),
|
|
194
|
+
id: z$1.uuid(),
|
|
194
195
|
result: iframeRpcCallResultSchema
|
|
195
196
|
})
|
|
196
197
|
]);
|
|
197
198
|
function isFireAndForgetOutputSchema(outputSchema) {
|
|
198
|
-
return outputSchema.type === "void" || outputSchema instanceof z.ZodVoid;
|
|
199
|
+
return outputSchema.type === "void" || outputSchema instanceof z$1.ZodVoid;
|
|
199
200
|
}
|
|
200
201
|
function isUndefinedInputSchema(inputSchema) {
|
|
201
|
-
return inputSchema.type === "undefined" || inputSchema instanceof z.ZodUndefined;
|
|
202
|
+
return inputSchema.type === "undefined" || inputSchema instanceof z$1.ZodUndefined;
|
|
202
203
|
}
|
|
203
204
|
function coerceEmptyRpcInput({
|
|
204
205
|
input,
|
|
@@ -379,14 +380,20 @@ function createIframeRpcChannel(options) {
|
|
|
379
380
|
pendingRequest.resolve(parsedOutput.data);
|
|
380
381
|
};
|
|
381
382
|
const handleMessage = (event) => {
|
|
382
|
-
const parsedMetadata = z.object({
|
|
383
|
-
channelIdentifier: z.literal(channelIdentifier),
|
|
384
|
-
version: z.literal(version)
|
|
383
|
+
const parsedMetadata = z$1.object({
|
|
384
|
+
channelIdentifier: z$1.literal(channelIdentifier),
|
|
385
|
+
version: z$1.literal(version)
|
|
385
386
|
}).safeParse(event.data);
|
|
386
387
|
if (!parsedMetadata.success) {
|
|
387
388
|
return;
|
|
388
389
|
}
|
|
389
390
|
if (!isExpectedMessage(event)) {
|
|
391
|
+
const isSiblingFrame = typeof document !== "undefined" && Array.from(document.querySelectorAll("iframe")).some((frame) => {
|
|
392
|
+
return event.source !== null && frame.contentWindow === event.source;
|
|
393
|
+
});
|
|
394
|
+
if (isSiblingFrame) {
|
|
395
|
+
return;
|
|
396
|
+
}
|
|
390
397
|
defaultLogger.error("[iframeRpcChannel] Dropping unexpected message", {
|
|
391
398
|
channelIdentifier,
|
|
392
399
|
version,
|
package/buildMetadata.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const BUILD_METADATA = {
|
|
2
2
|
"packageName": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"branch": "HEAD",
|
|
5
|
-
"commit": "
|
|
6
|
-
"builtAt": "2026-10-
|
|
5
|
+
"commit": "cce09bc70f0a5638a8b527e5351534efe9bfcdf7",
|
|
6
|
+
"builtAt": "2026-10-19T20:42:50.022Z"
|
|
7
7
|
};
|
package/next/config.js
CHANGED
|
@@ -4,6 +4,8 @@ const DEFAULT_PAGE_EXTENSIONS = ["tsx", "ts", "jsx", "js"];
|
|
|
4
4
|
const DEVELOPMENT_ONLY_PAGE_EXTENSIONS = ["dev.jsx", "dev.tsx"];
|
|
5
5
|
const BUILD_ONLY_PAGE_EXTENSIONS = ["published.tsx"];
|
|
6
6
|
const PUBLISH_TSCONFIG_FILENAME = "tsconfig.publish.json";
|
|
7
|
+
const PLATFORM_DEVICE_SIZES = [640, 828, 1080, 1200, 1920, 2048, 3840];
|
|
8
|
+
const PLATFORM_IMAGE_SIZES = [32, 48, 96, 128, 256, 384];
|
|
7
9
|
function getPageExtensions(configuredExtensions) {
|
|
8
10
|
const baseExtensions = (configuredExtensions ?? DEFAULT_PAGE_EXTENSIONS).filter((extension) => {
|
|
9
11
|
return !DEVELOPMENT_ONLY_PAGE_EXTENSIONS.includes(extension) && !BUILD_ONLY_PAGE_EXTENSIONS.includes(extension);
|
|
@@ -21,7 +23,12 @@ function withComponentPreviewPageExtension(config) {
|
|
|
21
23
|
return {
|
|
22
24
|
...config,
|
|
23
25
|
pageExtensions: getPageExtensions(config.pageExtensions),
|
|
24
|
-
typescript: getTypescriptConfig(config.typescript)
|
|
26
|
+
typescript: getTypescriptConfig(config.typescript),
|
|
27
|
+
images: {
|
|
28
|
+
...config.images,
|
|
29
|
+
deviceSizes: config.images?.deviceSizes ?? PLATFORM_DEVICE_SIZES,
|
|
30
|
+
imageSizes: config.images?.imageSizes ?? PLATFORM_IMAGE_SIZES
|
|
31
|
+
}
|
|
25
32
|
};
|
|
26
33
|
}
|
|
27
34
|
export {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@replohq/sandbox-runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"reploBuild": {
|
|
5
5
|
"packageName": "@replohq/sandbox-runtime",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.16.0",
|
|
7
7
|
"branch": "HEAD",
|
|
8
|
-
"commit": "
|
|
9
|
-
"builtAt": "2026-10-
|
|
8
|
+
"commit": "cce09bc70f0a5638a8b527e5351534efe9bfcdf7",
|
|
9
|
+
"builtAt": "2026-10-19T20:42:50.022Z"
|
|
10
10
|
},
|
|
11
11
|
"description": "Replo sandbox runtime — editor integration for agent-built Next.js sites.",
|
|
12
12
|
"license": "SEE LICENSE IN LICENSE",
|