@poe-platform/safe-js 0.1.799 → 0.1.800

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.
Files changed (44) hide show
  1. package/README.md +3 -1
  2. package/dist/safe-js/chunks/{chunk-ULPZIHB5.js → chunk-5RLD4TVI.js} +174 -127
  3. package/dist/safe-js/chunks/{chunk-TBZILU4U.js → chunk-7THYP46K.js} +1 -1
  4. package/dist/safe-js/chunks/{chunk-UU4T2KIT.js → chunk-CK3YK2EC.js} +1 -1
  5. package/dist/safe-js/chunks/{chunk-3O7HA6WT.js → chunk-F6Y734YA.js} +2 -2
  6. package/dist/safe-js/chunks/{chunk-OPYN6N5M.js → chunk-HPHCQNFV.js} +154 -1
  7. package/dist/safe-js/chunks/{chunk-W6C3Q6U4.js → chunk-LWHXSNF6.js} +2 -2
  8. package/dist/safe-js/chunks/{chunk-ZKLJW27N.js → chunk-PMOXSLM5.js} +1 -1
  9. package/dist/safe-js/chunks/{chunk-M6S3F3WM.js → chunk-QEDOBN2G.js} +4 -4
  10. package/dist/safe-js/chunks/chunk-QRWRR6IA.js +78 -0
  11. package/dist/safe-js/chunks/{chunk-MCFRB5X3.js → chunk-SHMRT4QX.js} +76 -6
  12. package/dist/safe-js/chunks/{chunk-KULEMOAE.js → chunk-XAV2RKLO.js} +3 -154
  13. package/dist/safe-js/chunks/{chunk-MDJ7MJYI.js → chunk-XOMGWE37.js} +2 -2
  14. package/dist/safe-js/chunks/{chunk-QTCPJ7FN.js → chunk-XV5OYKND.js} +1 -1
  15. package/dist/safe-js/chunks/{chunk-OTVZWRYE.js → chunk-YAHDXC7P.js} +1 -1
  16. package/dist/safe-js/chunks/{cli-runtime-DYXJZCGV.js → cli-runtime-OCWFX4TM.js} +15 -15
  17. package/dist/safe-js/chunks/{dump-XDJEF2LG.js → dump-KUPBSXSL.js} +2 -2
  18. package/dist/safe-js/chunks/{harness-32OOFC5A.js → harness-3DDUS3RY.js} +2 -2
  19. package/dist/safe-js/chunks/{mcp-PTCA53MN.js → mcp-4D3WWY7U.js} +3 -3
  20. package/dist/safe-js/chunks/{migration-file-EEGIOHQB.js → migration-file-4CYSJ6LO.js} +3 -3
  21. package/dist/safe-js/chunks/{restore-U3CCH36B.js → restore-GDHBT5ZD.js} +3 -3
  22. package/dist/safe-js/chunks/{run-Q74MU3QQ.js → run-3X6J7FPV.js} +5 -5
  23. package/dist/safe-js/chunks/{runtime-modules-SL5D6LAJ.js → runtime-modules-MGSXY4BN.js} +2 -2
  24. package/dist/safe-js/cli.js +2 -2
  25. package/dist/safe-js/core.d.ts +6 -0
  26. package/dist/safe-js/core.js +33 -7
  27. package/dist/safe-js/index.js +24 -93
  28. package/dist/safe-js/interp/data-copy.d.ts +3 -2
  29. package/dist/safe-js/interp/host-bridge.d.ts +5 -4
  30. package/dist/safe-js/modules/fs.js +2 -2
  31. package/dist/safe-js/node-unavailable.d.ts +1 -0
  32. package/dist/safe-js/portable/chunks/chunk-H5X3T5VP.js +909 -0
  33. package/dist/safe-js/portable/chunks/chunk-KYJVK33V.js +58698 -0
  34. package/dist/safe-js/portable/chunks/chunk-XCTU25SU.js +111 -0
  35. package/dist/safe-js/portable/chunks/source-files-CVU252FB.js +7 -0
  36. package/dist/safe-js/portable/core.js +14757 -0
  37. package/dist/safe-js/portable/modules/fs.js +9 -0
  38. package/dist/safe-js/snapshot/arguments.d.ts +2 -0
  39. package/dist/safe-js/snapshot/property-descriptors.d.ts +2 -0
  40. package/dist/safe-js/snapshot/regexp-properties.d.ts +2 -0
  41. package/dist/safe-js/snapshot/symbols.d.ts +2 -0
  42. package/dist/safe-js/workerd.d.ts +3 -0
  43. package/dist/safe-js/workerd.js +74425 -0
  44. package/package.json +30 -6
package/README.md CHANGED
@@ -8,6 +8,8 @@ built-ins. It is suitable for capability-controlled scripts and agent workflows.
8
8
  Complete ECMAScript conformance has not been established; see
9
9
  [development status](#development-status) and [meaningful limitations](#meaningful-limitations).
10
10
 
11
+ Under `workerd` and `browser` conditions, the standalone root and `/core` exports select the portable interpreter with `makeFsModule`, `makeEnvModule`, `makeTimeModule`, `makeFailModule`, `makeMetricModule`, and `makeHarnessModule`. The `/modules/fs` entry is also portable; supply a filesystem adapter for host file access.
12
+
11
13
  ## Quickstart
12
14
 
13
15
  Install the public ESM package. Its declared Node.js minimum is 18.18+, but
@@ -36,7 +38,7 @@ console.log(result.returnValue);
36
38
 
37
39
  `run()` takes source text, not a file path. Success returns `ok`, `returnValue`, `snapshot`, and `stats`. Handle both an `ok: false` result and a rejected promise: parsing, budget exhaustion, cancellation, and some execution failures can reject. Top-level `await` in this example lets rejections reach Node.
38
40
 
39
- `@poe-platform/safe-js/core` exposes `run`, `createRealm`, `defineExtension`, `lint`, `Budget`, and replayable-random helpers. The `/core`, `/workerd`, and `/modules/fs` workspace entries bundle with the `workerd` or `browser` condition without Node built-ins. Supply a `@poe-code/safe-fs` adapter for filesystem capabilities; `createRootedSourceResolver(root, adapter)` grants portable source imports. File snapshots, migrations, harnesses, and file-running helpers also accept an `adapter`. The shared filesystem lives in `@poe-platform/safe-fs`, with a portable `/core` entry. Existing `@poe-platform/safe-js/fs`, `/fs/core`, and `/fs/node` imports re-export it. Legacy `poe-code/safe-js` imports remain available through the CLI package but use a separate runtime; keep factories and errors within one import family.
41
+ `@poe-platform/safe-js/core` exposes `run`, `createRealm`, `defineExtension`, `lint`, `Budget`, and replayable-random helpers for Node.js. In Workers, the `@poe-platform/safe-js` root selects `/workerd`: it exports the portable core API plus `declareHostOperation` without requiring `nodejs_compat`, including the runtime hooks needed by Safe Bash's `nodeCommands()`. The `/core` and `/modules/fs` workspace entries also bundle with the `workerd` or `browser` condition without Node built-ins. Supply a `@poe-platform/safe-fs/core` adapter for filesystem capabilities; `createRootedSourceResolver(root, adapter)` grants portable source imports. File snapshots, migrations, harnesses, and file-running helpers also accept an `adapter`. The shared filesystem lives in `@poe-platform/safe-fs`, with a portable `/core` entry. Existing `@poe-platform/safe-js/fs`, `/fs/core`, and `/fs/node` imports re-export it. Legacy `poe-code/safe-js` imports remain available through the CLI package but use a separate runtime; keep factories and errors within one import family.
40
42
 
41
43
  ## Supported features
42
44