@ricsam/r5d-browser 0.0.136 → 0.0.138

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 (49) hide show
  1. package/README.md +7 -33
  2. package/dist/cjs/package.json +1 -1
  3. package/dist/mjs/browser-input.mjs +56 -1
  4. package/dist/mjs/cli-options.mjs +1 -0
  5. package/dist/mjs/main.mjs +25 -396
  6. package/dist/mjs/package.json +1 -1
  7. package/dist/mjs/personal-diagnostics.mjs +24 -0
  8. package/dist/mjs/personal-main.mjs +159 -0
  9. package/dist/mjs/personal-port-forward.mjs +183 -0
  10. package/dist/mjs/personal-relay-client.mjs +33 -0
  11. package/dist/mjs/personal-relay-shutdown.mjs +46 -0
  12. package/dist/mjs/runtime/browser-executor.mjs +11 -0
  13. package/dist/mjs/runtime/chromium-factory.mjs +101 -0
  14. package/dist/mjs/runtime/ipc.mjs +128 -0
  15. package/dist/mjs/runtime/isolated-root.mjs +53 -0
  16. package/dist/mjs/runtime/keeper.mjs +169 -0
  17. package/dist/mjs/runtime/ledger.mjs +193 -0
  18. package/dist/mjs/runtime/main.mjs +105 -0
  19. package/dist/mjs/runtime/private-paths.mjs +48 -0
  20. package/dist/mjs/runtime/protocol.mjs +72 -0
  21. package/dist/types/browser-input.d.ts +4 -0
  22. package/dist/types/cli-options.d.ts +1 -0
  23. package/dist/types/personal-diagnostics.d.ts +13 -0
  24. package/dist/types/personal-main.d.ts +9 -0
  25. package/dist/types/personal-port-forward.d.ts +45 -0
  26. package/dist/types/personal-relay-client.d.ts +51 -0
  27. package/dist/types/personal-relay-shutdown.d.ts +19 -0
  28. package/dist/types/runtime/browser-executor.d.ts +8 -0
  29. package/dist/types/runtime/chromium-factory.d.ts +25 -0
  30. package/dist/types/runtime/fixtures/counter-main.d.ts +1 -0
  31. package/dist/types/runtime/fixtures/counter-runtime.d.ts +7 -0
  32. package/dist/types/runtime/ipc.d.ts +23 -0
  33. package/dist/types/runtime/isolated-root.d.ts +12 -0
  34. package/dist/types/runtime/keeper.d.ts +44 -0
  35. package/dist/types/runtime/ledger.d.ts +41 -0
  36. package/dist/types/runtime/main.d.ts +23 -0
  37. package/dist/types/runtime/private-paths.d.ts +4 -0
  38. package/dist/types/runtime/protocol.d.ts +228 -0
  39. package/package.json +6 -5
  40. package/dist/cjs/browser-input.cjs +0 -87
  41. package/dist/cjs/browser-runtime.cjs +0 -708
  42. package/dist/cjs/chrome-launcher.cjs +0 -701
  43. package/dist/cjs/cli-options.cjs +0 -95
  44. package/dist/cjs/main.cjs +0 -427
  45. package/dist/cjs/password-safe-snapshot.cjs +0 -150
  46. package/dist/cjs/port-forward-manager.cjs +0 -233
  47. package/dist/cjs/upload-store.cjs +0 -136
  48. package/dist/mjs/port-forward-manager.mjs +0 -199
  49. package/dist/types/port-forward-manager.d.ts +0 -23
@@ -1,87 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var browser_input_exports = {};
20
- __export(browser_input_exports, {
21
- MAX_VIEWPORT_DIMENSION: () => MAX_VIEWPORT_DIMENSION,
22
- normalizeBrowserInput: () => normalizeBrowserInput,
23
- parseViewportInput: () => parseViewportInput
24
- });
25
- module.exports = __toCommonJS(browser_input_exports);
26
- const browserInputFields = {
27
- list_tabs: { required: [], optional: [] },
28
- list_downloads: { required: [], optional: [] },
29
- get_download: { required: ["downloadId"], optional: ["offset", "maxBytes"] },
30
- open_tab: { required: [], optional: ["url", "disposition"] },
31
- close_tab: { required: ["tabId"], optional: [] },
32
- navigate: { required: ["tabId", "url"], optional: [] },
33
- set_viewport: { required: ["tabId"], optional: ["width", "height", "reset"] },
34
- read_page: { required: ["tabId"], optional: ["depth", "maxChars"] },
35
- screenshot: { required: ["tabId"], optional: ["fullPage"] },
36
- move_mouse: { required: ["tabId", "x", "y"], optional: [] },
37
- mouse_click: { required: ["tabId"], optional: ["ref", "x", "y", "button", "clickCount"] },
38
- scroll: { required: ["tabId"], optional: ["ref", "direction", "amount", "x", "y"] },
39
- wait_for: { required: ["tabId"], optional: ["selector", "text", "url", "loadState", "state", "timeoutMs"] },
40
- form_input: { required: ["tabId", "ref"], optional: ["value", "values", "checked"] },
41
- keyboard: { required: ["tabId", "keys"], optional: ["modifiers"] },
42
- keyboard_type: { required: ["tabId", "text"], optional: ["mode", "delayMs"] },
43
- run_js: { required: ["tabId", "code"], optional: [] },
44
- upload_files: { required: ["tabId", "files"], optional: ["ref", "selector"] },
45
- upload_begin: { required: ["tabId", "uploadId", "files"], optional: ["ref", "selector"] },
46
- upload_chunk: { required: ["tabId", "uploadId", "index", "offset", "base64"], optional: [] },
47
- upload_attach: { required: ["tabId", "uploadId", "hashes"], optional: [] },
48
- upload_abort: { required: ["tabId", "uploadId"], optional: [] },
49
- port_forward: { required: ["workerPort"], optional: ["browserPort"] },
50
- list_port_forwards: { required: [], optional: [] },
51
- stop_port_forward: { required: ["forwardId"], optional: [] }
52
- };
53
- const MAX_VIEWPORT_DIMENSION = 4096;
54
- function parseViewportInput(input) {
55
- if (input.reset !== void 0 && typeof input.reset !== "boolean") throw new Error("set_viewport reset must be a boolean.");
56
- if (input.reset === true) {
57
- if (input.width !== void 0 || input.height !== void 0)
58
- throw new Error("set_viewport accepts width/height or reset: true, not both.");
59
- return null;
60
- }
61
- const { width, height } = input;
62
- for (const [name, value] of Object.entries({ width, height })) {
63
- if (typeof value !== "number" || !Number.isInteger(value) || value < 1 || value > MAX_VIEWPORT_DIMENSION) {
64
- throw new Error(
65
- `set_viewport requires ${name} to be an integer from 1 to ${MAX_VIEWPORT_DIMENSION} CSS pixels, or reset: true without dimensions.`
66
- );
67
- }
68
- }
69
- return { width, height };
70
- }
71
- function normalizeBrowserInput(action, input) {
72
- const fields = browserInputFields[action];
73
- for (const key of fields.required) {
74
- if (input[key] === null || input[key] === void 0) throw new Error(`${action} requires ${key}.`);
75
- }
76
- const normalized = { ...input };
77
- for (const key of fields.optional) {
78
- if (normalized[key] === null) delete normalized[key];
79
- }
80
- return normalized;
81
- }
82
- // Annotate the CommonJS export names for ESM import in node:
83
- 0 && (module.exports = {
84
- MAX_VIEWPORT_DIMENSION,
85
- normalizeBrowserInput,
86
- parseViewportInput
87
- });