@poe-platform/safe-bash 0.1.706 → 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
CHANGED
|
@@ -271,6 +271,11 @@ provided. Pass an `AbortSignal` as `signal` to cancel. [Option types](src/shell/
|
|
|
271
271
|
|
|
272
272
|
Always call `dispose()` when finished. Shell failures normally produce an exit
|
|
273
273
|
code and stderr; limit violations, cancellation, and host failures can reject `exec()`.
|
|
274
|
+
The command budget counts compound commands and loop conditions as well as body
|
|
275
|
+
commands. With both work budgets set to 10,000, `while true; do :; done` reaches
|
|
276
|
+
`maxCommands` first. Work budgets bound execution counts, not elapsed latency.
|
|
277
|
+
Await execution settlement and shell disposal before closing backing storage,
|
|
278
|
+
including after a caller timeout; cancellation is cooperative.
|
|
274
279
|
For Cloudflare Workers, start with the exported `cloudflareWorkerLimits` profile
|
|
275
280
|
and configure command-family buffers at no more than 8 MiB. Create a separate
|
|
276
281
|
`Shell`, environment object, and quota-wrapped filesystem view for each tenant or
|
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
import { captureRunCodeState, replaceRunCodeContextInitScripts, restoreRunCodePageState, restoreRunCodeTimeouts } from './browser-run-code-native.js';
|
|
2
2
|
import { restoreRunCodeContextState } from './browser-run-code-context-state.js';
|
|
3
|
-
import {
|
|
3
|
+
import { validateRunCodeState } from './browser-run-code-state.js';
|
|
4
4
|
const provider = '@cloudflare/playwright@1.3.6';
|
|
5
5
|
/** Reuse reconnect state transfer, with ordered new pages instead of old target identities. */
|
|
6
6
|
export function browserProfileRuntime(browser, context) {
|
|
7
7
|
return {
|
|
8
8
|
async capture(signal) {
|
|
9
9
|
signal.throwIfAborted();
|
|
10
|
-
const state = captureRunCodeState(browser, context);
|
|
11
|
-
serializeRunCodeState(state);
|
|
10
|
+
const state = validateRunCodeState(captureRunCodeState(browser, context));
|
|
12
11
|
return { provider, state };
|
|
13
12
|
},
|
|
14
13
|
async restore(value, signal) {
|
|
15
14
|
signal.throwIfAborted();
|
|
16
15
|
if (!value || typeof value !== 'object' || !('provider' in value) || value.provider !== provider || !('state' in value))
|
|
17
16
|
throw new Error('Unsupported Cloudflare browser profile settings');
|
|
18
|
-
const state =
|
|
17
|
+
const state = validateRunCodeState(value.state);
|
|
19
18
|
const pages = context.pages();
|
|
20
19
|
if (state.pages.length !== pages.length && !(state.pages.length === 0 && pages.length === 1))
|
|
21
20
|
throw new Error('Cloudflare browser profile tab settings mismatch');
|