@poe-platform/safe-bash 0.1.705 → 0.1.707
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/README.md +5 -0
- package/dist/safe-bash/commands/playwright/index.d.ts.map +1 -1
- package/dist/safe-bash/playwright/adapter.d.ts +1 -0
- package/dist/safe-bash/playwright/adapter.d.ts.map +1 -1
- package/dist/safe-bash/playwright/adapter.js.map +1 -1
- package/dist/safe-bash/playwright/controller.d.ts +6 -1
- package/dist/safe-bash/playwright/controller.d.ts.map +1 -1
- package/dist/safe-bash/playwright/controller.js +5 -2
- package/dist/safe-bash/playwright/controller.js.map +1 -1
- package/dist/safe-bash/playwright/index.d.ts +2 -2
- package/dist/safe-bash/playwright/index.d.ts.map +1 -1
- package/dist/safe-bash/playwright/index.js +2 -0
- package/dist/safe-bash/playwright/index.js.map +1 -1
- package/dist/safe-bash/playwright/snapshot.d.ts +1 -1
- package/dist/safe-bash/playwright/snapshot.d.ts.map +1 -1
- package/dist/safe-bash/playwright/snapshot.js +25 -6
- package/dist/safe-bash/playwright/snapshot.js.map +1 -1
- package/dist/safe-playwright-cloudflare/browser-profile-runtime.js +3 -4
- package/dist/safe-playwright-cloudflare/browser-run-code-guest.generated.js +1 -1
- package/dist/safe-playwright-cloudflare/browser-run-code-state.js +4 -1
- package/dist/safe-playwright-cloudflare/browser-run-code.js +6 -2
- package/package.json +2 -2
|
@@ -71,7 +71,10 @@ export function parseRunCodeState(json) {
|
|
|
71
71
|
if (typeof json !== "string" ||
|
|
72
72
|
new TextEncoder().encode(json).byteLength > MAX_PAGE_STATE_BYTES)
|
|
73
73
|
throw new Error("Run-code page state byte limit exceeded");
|
|
74
|
-
|
|
74
|
+
return validateRunCodeState(JSON.parse(json));
|
|
75
|
+
}
|
|
76
|
+
/** Shared native schema; portable profiles enforce their total byte budget separately. */
|
|
77
|
+
export function validateRunCodeState(value) {
|
|
75
78
|
if (!allowedObject(value, [
|
|
76
79
|
"pages",
|
|
77
80
|
"contextInitScripts",
|
|
@@ -159,8 +159,12 @@ async function prepareAndRun(options, input, signal, setRelay, fail) {
|
|
|
159
159
|
}
|
|
160
160
|
catch (error) {
|
|
161
161
|
// Loader compilation can fail before any guest obtains browser access.
|
|
162
|
-
if (!relay.opened())
|
|
163
|
-
|
|
162
|
+
if (!relay.opened()) {
|
|
163
|
+
const detail = String(error);
|
|
164
|
+
throw new RunCodeUserError(detail.includes("SyntaxError:")
|
|
165
|
+
? `${detail}\nplaywright-cli run-code expects one JavaScript function accepting page, for example: async (page) => { return await page.title(); }`
|
|
166
|
+
: detail);
|
|
167
|
+
}
|
|
164
168
|
throw error;
|
|
165
169
|
}
|
|
166
170
|
finally {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@poe-platform/safe-bash",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.707",
|
|
4
4
|
"description": "Extensible virtual shell with pluggable filesystems and streaming commands",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -378,7 +378,7 @@
|
|
|
378
378
|
"access": "public"
|
|
379
379
|
},
|
|
380
380
|
"dependencies": {
|
|
381
|
-
"@poe-platform/safe-fs": "0.1.
|
|
381
|
+
"@poe-platform/safe-fs": "0.1.707",
|
|
382
382
|
"pako": "3.0.1",
|
|
383
383
|
"@types/node": "^25.2.2",
|
|
384
384
|
"@noble/hashes": "2.4.0",
|