peachsim 0.1.2559 → 0.1.2561
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/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +4 -4
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-LS2ZBXYP.mjs → acorn-Y2S2LXLT.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UJMP7URZ.mjs → chunk-35NYB6LV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AAFFHIIG.mjs → chunk-4PPL3O7Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FKFMGVED.mjs → chunk-4YW6XCTY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SS5UINWI.mjs → chunk-7IITPVQA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WFGPRQJJ.mjs → chunk-A72652JO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HWI7QTZ7.mjs → chunk-BBQNMMDP.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-QW3EGWMY.mjs → chunk-CPL4BXG5.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BWW57RNR.mjs → chunk-D3BIUZPZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VOK7DTGD.mjs → chunk-EC66AKCC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TKWWA4VX.mjs → chunk-FFE4PHHU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7CIRE3ZS.mjs → chunk-H3GKQG6A.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-MVS5CYG4.mjs → chunk-OODKPIA2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-PL4OOHW5.mjs → chunk-PAVV4OTD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NA4GB24X.mjs → chunk-PPGG2RHY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3ZVM2437.mjs → chunk-QWP3NMNA.mjs} +12 -12
- package/dist-lib/esm-chunks/{chunk-WV4ZEFOG.mjs → chunk-SGKTKV7R.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-SMLVNZUT.mjs → chunk-WECAJVNN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-K5RIWGZM.mjs → chunk-WKZCKZXF.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-SW3AH4KZ.mjs → chunk-XGA73PQN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T5SGWRTO.mjs → chunk-YSTT7VR7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-4VOHA3WO.mjs → chunk-Z3RYFNYV.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-GJV2HDPT.mjs → metro-layout-parser-S5YRM2N7.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-J5FW36UG.mjs → swift-package-prebuilt-5ZPMLU6X.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-CCCASTBM.mjs → swift-sdk-app-module-6Y5WESVQ.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-XYQDUFTD.mjs → swift-sdk-image-HOIAOANO.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-VY6NVGSN.mjs → swift-sdk-image-producer-PTR7MJ5Q.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +3 -3
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +44 -33
- package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +15 -15
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +79 -79
- package/dist-lib/public-origins-lib.json +69 -69
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +7 -7
- package/dist-lib/skills.cjs +50 -39
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +10 -10
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +5 -5
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/dist-types/packages/peach-engine/src/render-worker/compositor-runtime/layer-claims.d.ts +5 -2
- package/dist-types/packages/peach-engine/src/render-worker/native-shell-runtime.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +3 -1
- package/dist-types/packages/peach-globals/src/browser-object-url.d.ts +1 -8
- package/dist-types/packages/peach-globals/src/browser-url.d.ts +8 -0
- package/package.json +1 -1
- package/src/runtime-assets.ts +49 -43
package/src/runtime-assets.ts
CHANGED
|
@@ -228,10 +228,16 @@ export function resolveRuntimeFilePath(
|
|
|
228
228
|
// isolated surface: Swift timed waits block with Atomics.wait on a
|
|
229
229
|
// SharedArrayBuffer, which exists only when the document and its workers are
|
|
230
230
|
// isolated. require-corp because Safari does not isolate under credentialless.
|
|
231
|
+
export const runtimeIsolationHeaders = {
|
|
232
|
+
'cross-origin-opener-policy': 'same-origin',
|
|
233
|
+
'cross-origin-embedder-policy': 'require-corp',
|
|
234
|
+
'cross-origin-resource-policy': 'cross-origin',
|
|
235
|
+
}
|
|
236
|
+
|
|
231
237
|
export function setRuntimeIsolationHeaders(res: ServerResponse) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
for (const [name, value] of Object.entries(runtimeIsolationHeaders)) {
|
|
239
|
+
res.setHeader(name, value)
|
|
240
|
+
}
|
|
235
241
|
}
|
|
236
242
|
|
|
237
243
|
export function sendShellHtml(res: ServerResponse, html: string) {
|
|
@@ -240,37 +246,32 @@ export function sendShellHtml(res: ServerResponse, html: string) {
|
|
|
240
246
|
res.end(html)
|
|
241
247
|
}
|
|
242
248
|
|
|
249
|
+
// content-hashed artifacts (`name?sha256=<full hash>`, the one url scheme
|
|
250
|
+
// from src/site/cacheControl) are immutable: the url changes when the bytes
|
|
251
|
+
// do, so a warm document reuses its cache and a new artifact can never
|
|
252
|
+
// serve stale. (this file keeps its own 3-line predicate instead of
|
|
253
|
+
// importing the shared helper: the packaged CLI serves standalone.)
|
|
254
|
+
export function runtimeFileHeaders(filePath: string, url: string, lastModified: string) {
|
|
255
|
+
const immutable =
|
|
256
|
+
/^canvaskit-graphite-pipelines-[0-9a-f]{8}\.bin$/.test(path.basename(filePath)) ||
|
|
257
|
+
/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(url)
|
|
258
|
+
return {
|
|
259
|
+
...runtimeIsolationHeaders,
|
|
260
|
+
'content-type': MIME_TYPES[path.extname(filePath)] || 'application/octet-stream',
|
|
261
|
+
'cache-control': immutable ? 'public, max-age=31536000, immutable' : 'no-cache',
|
|
262
|
+
...(!immutable && { 'last-modified': lastModified }),
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
243
266
|
export function serveRuntimeFile(req: any, res: any, fullPath: string) {
|
|
244
|
-
setRuntimeIsolationHeaders(res)
|
|
245
|
-
const ext = path.extname(fullPath)
|
|
246
267
|
const stat = fs.statSync(fullPath)
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
res.setHeader('cache-control', 'public, max-age=31536000, immutable')
|
|
268
|
+
const headers = runtimeFileHeaders(fullPath, req?.url ?? '', stat.mtime.toUTCString())
|
|
269
|
+
for (const [name, value] of Object.entries(headers)) res.setHeader(name, value)
|
|
270
|
+
if (!headers['last-modified']) {
|
|
251
271
|
fs.createReadStream(fullPath).pipe(res)
|
|
252
272
|
return
|
|
253
273
|
}
|
|
254
|
-
|
|
255
|
-
// from src/site/cacheControl) are immutable: the url changes when the bytes
|
|
256
|
-
// do, so a warm document reuses its cache and a new artifact can never
|
|
257
|
-
// serve stale. (this file keeps its own 3-line predicate instead of
|
|
258
|
-
// importing the shared helper: the packaged CLI serves standalone.)
|
|
259
|
-
if (/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(req?.url ?? '')) {
|
|
260
|
-
res.setHeader('cache-control', 'public, max-age=31536000, immutable')
|
|
261
|
-
fs.createReadStream(fullPath).pipe(res)
|
|
262
|
-
return
|
|
263
|
-
}
|
|
264
|
-
// these urls are STABLE across dev rebuilds and runtime version switches
|
|
265
|
-
// (both worker entries, canvaskit-graphite.wasm, and the html shells are
|
|
266
|
-
// unhashed), so the
|
|
267
|
-
// browser must revalidate every load — the old year-long immutable here made every
|
|
268
|
-
// new tab run a stale cached tenant entry against a fresh engine,
|
|
269
|
-
// which also broke `do reload` ("bridge never reconnected"). no-cache +
|
|
270
|
-
// last-modified keeps repeat loads cheap 304s on localhost.
|
|
271
|
-
res.setHeader('cache-control', 'no-cache')
|
|
272
|
-
res.setHeader('last-modified', lastModified)
|
|
273
|
-
if (req?.headers?.['if-modified-since'] === lastModified) {
|
|
274
|
+
if (req?.headers?.['if-modified-since'] === headers['last-modified']) {
|
|
274
275
|
res.statusCode = 304
|
|
275
276
|
res.end()
|
|
276
277
|
return
|
|
@@ -278,6 +279,17 @@ export function serveRuntimeFile(req: any, res: any, fullPath: string) {
|
|
|
278
279
|
sendFileWithRanges(req, res, fullPath, stat.size, {})
|
|
279
280
|
}
|
|
280
281
|
|
|
282
|
+
export function runtimeFileRange(header: string | null | undefined, total: number) {
|
|
283
|
+
const parts = /^bytes=(\d*)-(\d*)$/.exec(header ?? '')
|
|
284
|
+
if (!parts) return
|
|
285
|
+
const [, startRaw, endRaw] = parts
|
|
286
|
+
if ((!startRaw && !endRaw) || (startRaw && endRaw && Number(endRaw) < Number(startRaw)))
|
|
287
|
+
return
|
|
288
|
+
const start = startRaw ? Number(startRaw) : Math.max(0, total - Number(endRaw))
|
|
289
|
+
const end = startRaw && endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
|
|
290
|
+
return start > end || start >= total ? null : { start, end }
|
|
291
|
+
}
|
|
292
|
+
|
|
281
293
|
// a file body that honours a single `bytes=` range. a media element can only
|
|
282
294
|
// seek a resource whose server answers ranges, so any file a <video> or
|
|
283
295
|
// <audio> might load goes through here.
|
|
@@ -289,20 +301,14 @@ export function sendFileWithRanges(
|
|
|
289
301
|
headers: Record<string, string>,
|
|
290
302
|
) {
|
|
291
303
|
const head = (req?.method || 'GET').toUpperCase() === 'HEAD'
|
|
292
|
-
const range =
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const start
|
|
300
|
-
const end = startRaw && endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
|
|
301
|
-
if (start > end || start >= total) {
|
|
302
|
-
res.writeHead(416, { ...headers, 'Content-Range': `bytes */${total}` })
|
|
303
|
-
res.end()
|
|
304
|
-
return
|
|
305
|
-
}
|
|
304
|
+
const range = runtimeFileRange(req?.headers?.range, total)
|
|
305
|
+
if (range === null) {
|
|
306
|
+
res.writeHead(416, { ...headers, 'Content-Range': `bytes */${total}` })
|
|
307
|
+
res.end()
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
if (range) {
|
|
311
|
+
const { start, end } = range
|
|
306
312
|
res.writeHead(206, {
|
|
307
313
|
...headers,
|
|
308
314
|
'Content-Range': `bytes ${start}-${end}/${total}`,
|