rom-runtime 0.0.2__tar.gz

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 (97) hide show
  1. rom_runtime-0.0.2/Cargo.toml +47 -0
  2. rom_runtime-0.0.2/PKG-INFO +102 -0
  3. rom_runtime-0.0.2/README.md +74 -0
  4. rom_runtime-0.0.2/bindings/gom-python/Cargo.lock +1611 -0
  5. rom_runtime-0.0.2/bindings/gom-python/Cargo.toml +20 -0
  6. rom_runtime-0.0.2/bindings/gom-python/README.md +74 -0
  7. rom_runtime-0.0.2/bindings/gom-python/rust/lib.rs +12 -0
  8. rom_runtime-0.0.2/bindings/gom-python/scripts/smoke.py +22 -0
  9. rom_runtime-0.0.2/crates/rom-core/Cargo.toml +13 -0
  10. rom_runtime-0.0.2/crates/rom-core/src/engine.rs +92 -0
  11. rom_runtime-0.0.2/crates/rom-core/src/error.rs +11 -0
  12. rom_runtime-0.0.2/crates/rom-core/src/lib.rs +5 -0
  13. rom_runtime-0.0.2/crates/rom-runtime/Cargo.toml +18 -0
  14. rom_runtime-0.0.2/crates/rom-runtime/examples/fingerprintjs_report.rs +13 -0
  15. rom_runtime-0.0.2/crates/rom-runtime/src/bin/rom_bridge.rs +39 -0
  16. rom_runtime-0.0.2/crates/rom-runtime/src/bridge.rs +111 -0
  17. rom_runtime-0.0.2/crates/rom-runtime/src/compat.rs +214 -0
  18. rom_runtime-0.0.2/crates/rom-runtime/src/config.rs +90 -0
  19. rom_runtime-0.0.2/crates/rom-runtime/src/error.rs +13 -0
  20. rom_runtime-0.0.2/crates/rom-runtime/src/fingerprintjs.rs +188 -0
  21. rom_runtime-0.0.2/crates/rom-runtime/src/lib.rs +596 -0
  22. rom_runtime-0.0.2/crates/rom-runtime/src/runtime.rs +41 -0
  23. rom_runtime-0.0.2/crates/rom-runtime/src/tests_adjacent_html.rs +65 -0
  24. rom_runtime-0.0.2/crates/rom-runtime/src/tests_character_data.rs +103 -0
  25. rom_runtime-0.0.2/crates/rom-runtime/src/tests_classlist.rs +63 -0
  26. rom_runtime-0.0.2/crates/rom-runtime/src/tests_collections.rs +51 -0
  27. rom_runtime-0.0.2/crates/rom-runtime/src/tests_comments.rs +55 -0
  28. rom_runtime-0.0.2/crates/rom-runtime/src/tests_cookies.rs +378 -0
  29. rom_runtime-0.0.2/crates/rom-runtime/src/tests_cors.rs +377 -0
  30. rom_runtime-0.0.2/crates/rom-runtime/src/tests_css.rs +52 -0
  31. rom_runtime-0.0.2/crates/rom-runtime/src/tests_dataset.rs +53 -0
  32. rom_runtime-0.0.2/crates/rom-runtime/src/tests_dom_mutations.rs +148 -0
  33. rom_runtime-0.0.2/crates/rom-runtime/src/tests_dom_navigation.rs +58 -0
  34. rom_runtime-0.0.2/crates/rom-runtime/src/tests_events.rs +95 -0
  35. rom_runtime-0.0.2/crates/rom-runtime/src/tests_eventsource/parsing.rs +251 -0
  36. rom_runtime-0.0.2/crates/rom-runtime/src/tests_eventsource.rs +571 -0
  37. rom_runtime-0.0.2/crates/rom-runtime/src/tests_fetch_semantics.rs +865 -0
  38. rom_runtime-0.0.2/crates/rom-runtime/src/tests_file_reader.rs +85 -0
  39. rom_runtime-0.0.2/crates/rom-runtime/src/tests_fragments.rs +67 -0
  40. rom_runtime-0.0.2/crates/rom-runtime/src/tests_history.rs +286 -0
  41. rom_runtime-0.0.2/crates/rom-runtime/src/tests_innerhtml.rs +121 -0
  42. rom_runtime-0.0.2/crates/rom-runtime/src/tests_layout_observers.rs +95 -0
  43. rom_runtime-0.0.2/crates/rom-runtime/src/tests_messaging.rs +614 -0
  44. rom_runtime-0.0.2/crates/rom-runtime/src/tests_mutation_observer.rs +105 -0
  45. rom_runtime-0.0.2/crates/rom-runtime/src/tests_navigator.rs +146 -0
  46. rom_runtime-0.0.2/crates/rom-runtime/src/tests_node_equality.rs +57 -0
  47. rom_runtime-0.0.2/crates/rom-runtime/src/tests_node_helpers.rs +108 -0
  48. rom_runtime-0.0.2/crates/rom-runtime/src/tests_normalize.rs +69 -0
  49. rom_runtime-0.0.2/crates/rom-runtime/src/tests_parsing.rs +82 -0
  50. rom_runtime-0.0.2/crates/rom-runtime/src/tests_performance.rs +166 -0
  51. rom_runtime-0.0.2/crates/rom-runtime/src/tests_selectors.rs +72 -0
  52. rom_runtime-0.0.2/crates/rom-runtime/src/tests_split_text.rs +117 -0
  53. rom_runtime-0.0.2/crates/rom-runtime/src/tests_timers.rs +74 -0
  54. rom_runtime-0.0.2/crates/rom-runtime/src/tests_viewport.rs +84 -0
  55. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/advanced.rs +446 -0
  56. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/jwk.rs +117 -0
  57. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/lengths.rs +336 -0
  58. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/params.rs +499 -0
  59. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto/wrapping.rs +182 -0
  60. rom_runtime-0.0.2/crates/rom-runtime/src/tests_webcrypto.rs +420 -0
  61. rom_runtime-0.0.2/crates/rom-runtime/src/tests_websocket.rs +571 -0
  62. rom_runtime-0.0.2/crates/rom-runtime/tests/bridge_cli.rs +64 -0
  63. rom_runtime-0.0.2/crates/rom-webapi/Cargo.toml +34 -0
  64. rom_runtime-0.0.2/crates/rom-webapi/src/bootstrap.rs +317 -0
  65. rom_runtime-0.0.2/crates/rom-webapi/src/config.rs +38 -0
  66. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/aes.rs +387 -0
  67. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/core.rs +181 -0
  68. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/gcm.rs +138 -0
  69. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/ops.rs +276 -0
  70. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto/types.rs +194 -0
  71. rom_runtime-0.0.2/crates/rom-webapi/src/host_crypto.rs +494 -0
  72. rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch/client.rs +479 -0
  73. rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch/proxy.rs +108 -0
  74. rom_runtime-0.0.2/crates/rom-webapi/src/host_fetch.rs +185 -0
  75. rom_runtime-0.0.2/crates/rom-webapi/src/host_url.rs +68 -0
  76. rom_runtime-0.0.2/crates/rom-webapi/src/host_websocket.rs +411 -0
  77. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_body.js +627 -0
  78. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_cookie.js +328 -0
  79. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_crypto.js +457 -0
  80. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_crypto_params.js +491 -0
  81. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_dom.js +1409 -0
  82. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_eventsource.js +276 -0
  83. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_fetch.js +687 -0
  84. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_globals.js +1010 -0
  85. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_messaging.js +654 -0
  86. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_navigator.js +471 -0
  87. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_observers.js +344 -0
  88. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_parser.js +171 -0
  89. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_prelude.js +470 -0
  90. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_textcodecs.js +331 -0
  91. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_url.js +303 -0
  92. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_urlpattern.js +221 -0
  93. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_viewport.js +130 -0
  94. rom_runtime-0.0.2/crates/rom-webapi/src/js/bootstrap_websocket.js +346 -0
  95. rom_runtime-0.0.2/crates/rom-webapi/src/lib.rs +9 -0
  96. rom_runtime-0.0.2/pyproject.toml +39 -0
  97. rom_runtime-0.0.2/src/rom/__init__.py +92 -0
@@ -0,0 +1,47 @@
1
+ [workspace]
2
+ members = [
3
+ "crates/rom-core",
4
+ "crates/rom-webapi",
5
+ "crates/rom-runtime",
6
+ ]
7
+ default-members = [
8
+ "crates/rom-core",
9
+ "crates/rom-webapi",
10
+ "crates/rom-runtime",
11
+ ]
12
+ resolver = "2"
13
+
14
+ [workspace.package]
15
+ edition = "2024"
16
+ homepage = "https://github.com/Rxflex/rom"
17
+ license = "MIT"
18
+ repository = "https://github.com/Rxflex/rom"
19
+ version = "0.1.0"
20
+
21
+ [workspace.dependencies]
22
+ aes = "0.8.4"
23
+ aes-kw = "0.2.1"
24
+ aes-gcm = "0.10.3"
25
+ base64 = "0.22.1"
26
+ boring = "5.0.2"
27
+ cbc = "0.1.2"
28
+ hkdf = "0.12.4"
29
+ hmac = "0.12.1"
30
+ getrandom = "0.3.3"
31
+ httparse = "1.10.1"
32
+ pbkdf2 = "0.12.2"
33
+ rcgen = "0.14.7"
34
+ rom-core = { path = "crates/rom-core" }
35
+ rom-runtime = { path = "crates/rom-runtime" }
36
+ rom-webapi = { path = "crates/rom-webapi" }
37
+ rquickjs = "0.11.0"
38
+ rustls = "0.23.37"
39
+ serde = { version = "1.0.228", features = ["derive"] }
40
+ serde_json = "1.0.145"
41
+ sha1 = "0.10.6"
42
+ sha2 = "0.10.9"
43
+ thiserror = "2.0.17"
44
+ tungstenite = { version = "0.28.0", features = ["rustls-tls-native-roots"] }
45
+ typenum = "1.19.0"
46
+ ureq = "3.2.0"
47
+ url = "2.5.7"
@@ -0,0 +1,102 @@
1
+ Metadata-Version: 2.4
2
+ Name: rom-runtime
3
+ Version: 0.0.2
4
+ Classifier: Development Status :: 3 - Alpha
5
+ Classifier: Intended Audience :: Developers
6
+ Classifier: License :: OSI Approved :: MIT License
7
+ Classifier: Operating System :: OS Independent
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3 :: Only
10
+ Classifier: Programming Language :: Python :: 3.9
11
+ Classifier: Programming Language :: Python :: 3.10
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Rust
15
+ Classifier: Topic :: Internet
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Summary: Python wrapper for the ROM browser-like runtime
18
+ Keywords: rom,runtime,browser,web-api,fingerprint
19
+ Home-Page: https://github.com/Rxflex/rom
20
+ Author: Rxflex
21
+ License: MIT
22
+ Requires-Python: >=3.9
23
+ Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
24
+ Project-URL: Homepage, https://github.com/Rxflex/rom
25
+ Project-URL: Issues, https://github.com/Rxflex/rom/issues
26
+ Project-URL: Repository, https://github.com/Rxflex/rom
27
+
28
+ # `rom-runtime`
29
+
30
+ Python bindings for the ROM browser-like runtime.
31
+
32
+ This package exposes a thin Python API on top of ROM:
33
+
34
+ - `eval()`
35
+ - `eval_async()`
36
+ - `eval_json()`
37
+ - `surface_snapshot()`
38
+ - `fingerprint_probe()`
39
+ - `run_fingerprintjs_harness()`
40
+ - `fingerprintjs_version()`
41
+
42
+ It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
43
+
44
+ ## Install
45
+
46
+ ```bash
47
+ pip install rom-runtime
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ ```python
53
+ from rom import RomRuntime, has_native_binding
54
+
55
+ runtime = RomRuntime(
56
+ {
57
+ "href": "https://example.test/",
58
+ "cors_enabled": False,
59
+ "proxy_url": None,
60
+ }
61
+ )
62
+ href = runtime.eval_async("(async () => location.href)()")
63
+ snapshot = runtime.surface_snapshot()
64
+
65
+ print("native:", has_native_binding())
66
+ print(href)
67
+ print(snapshot["fetch"])
68
+ ```
69
+
70
+ Config keys use the Rust runtime field names, so use snake_case such as `cors_enabled` and `proxy_url`.
71
+ `cors_enabled` is `False` by default.
72
+
73
+ ## Optional native build from source
74
+
75
+ ```bash
76
+ python -m pip install maturin
77
+ python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
78
+ ```
79
+
80
+ Tagged GitHub releases build and publish wheels for Linux, Windows, and macOS, plus an sdist for source installs.
81
+
82
+ ## Common methods
83
+
84
+ - `eval()`
85
+ - `eval_async()`
86
+ - `eval_json()`
87
+ - `surface_snapshot()`
88
+ - `fingerprint_probe()`
89
+ - `run_fingerprintjs_harness()`
90
+ - `fingerprintjs_version()`
91
+
92
+ ## Environment
93
+
94
+ - `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
95
+ - `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
96
+ - `ROM_BRIDGE_CWD`: working directory used by the CLI fallback
97
+
98
+ ## More docs
99
+
100
+ - Root guide: [../../README.md](../../README.md)
101
+ - LLM guide: [../../LLMS.md](../../LLMS.md)
102
+
@@ -0,0 +1,74 @@
1
+ # `rom-runtime`
2
+
3
+ Python bindings for the ROM browser-like runtime.
4
+
5
+ This package exposes a thin Python API on top of ROM:
6
+
7
+ - `eval()`
8
+ - `eval_async()`
9
+ - `eval_json()`
10
+ - `surface_snapshot()`
11
+ - `fingerprint_probe()`
12
+ - `run_fingerprintjs_harness()`
13
+ - `fingerprintjs_version()`
14
+
15
+ It prefers a native `PyO3` extension when available and falls back to the ROM CLI bridge otherwise.
16
+
17
+ ## Install
18
+
19
+ ```bash
20
+ pip install rom-runtime
21
+ ```
22
+
23
+ ## Usage
24
+
25
+ ```python
26
+ from rom import RomRuntime, has_native_binding
27
+
28
+ runtime = RomRuntime(
29
+ {
30
+ "href": "https://example.test/",
31
+ "cors_enabled": False,
32
+ "proxy_url": None,
33
+ }
34
+ )
35
+ href = runtime.eval_async("(async () => location.href)()")
36
+ snapshot = runtime.surface_snapshot()
37
+
38
+ print("native:", has_native_binding())
39
+ print(href)
40
+ print(snapshot["fetch"])
41
+ ```
42
+
43
+ Config keys use the Rust runtime field names, so use snake_case such as `cors_enabled` and `proxy_url`.
44
+ `cors_enabled` is `False` by default.
45
+
46
+ ## Optional native build from source
47
+
48
+ ```bash
49
+ python -m pip install maturin
50
+ python -m maturin build --manifest-path bindings/gom-python/Cargo.toml --release
51
+ ```
52
+
53
+ Tagged GitHub releases build and publish wheels for Linux, Windows, and macOS, plus an sdist for source installs.
54
+
55
+ ## Common methods
56
+
57
+ - `eval()`
58
+ - `eval_async()`
59
+ - `eval_json()`
60
+ - `surface_snapshot()`
61
+ - `fingerprint_probe()`
62
+ - `run_fingerprintjs_harness()`
63
+ - `fingerprintjs_version()`
64
+
65
+ ## Environment
66
+
67
+ - `ROM_FORCE_CLI_BRIDGE=1`: disable the native path and force CLI fallback
68
+ - `ROM_BRIDGE_BIN`: explicit path to the `rom_bridge` executable
69
+ - `ROM_BRIDGE_CWD`: working directory used by the CLI fallback
70
+
71
+ ## More docs
72
+
73
+ - Root guide: [../../README.md](../../README.md)
74
+ - LLM guide: [../../LLMS.md](../../LLMS.md)