@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.
@@ -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
- const value = JSON.parse(json);
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
- throw new RunCodeUserError(String(error));
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.705",
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.705",
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",