@lookover-ai/webagent-device 0.0.0-stage → 0.1.0

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/LICENSE ADDED
@@ -0,0 +1,55 @@
1
+ Apache License
2
+
3
+ Version 2.0, January 2004
4
+
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
16
+
17
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
18
+
19
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
20
+
21
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
22
+
23
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
24
+
25
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
26
+
27
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
28
+
29
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
30
+
31
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
32
+
33
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
34
+
35
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
36
+
37
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
38
+
39
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
40
+
41
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
42
+
43
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
44
+
45
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
46
+
47
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
48
+
49
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
50
+
51
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
52
+
53
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
54
+
55
+ END OF TERMS AND CONDITIONS
package/README.md CHANGED
@@ -1,3 +1,110 @@
1
- # Temporary Holding Version
1
+ # @lookover-ai/webagent-device
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Lets browser sessions of your Lookover webagent organization leave the internet from **your own
4
+ machine and network**, for example to reach a site that only works from a home or office IP.
5
+
6
+ The tool connects **out** to Lookover's relay over a secure WebSocket (`wss`). It never opens a port
7
+ on your machine. When a session asks to reach a website, the relay tells this tool, the tool
8
+ resolves the name itself, checks it against the rules below, connects, and passes the bytes back and
9
+ forth. HTTPS content stays encrypted end to end: this tool cannot read it.
10
+
11
+ Requires Node.js 20 or newer. One runtime dependency (`ws`).
12
+
13
+ ## Consent and safety rules
14
+
15
+ Running this tool means **web traffic of your organization's sessions leaves from this machine's IP
16
+ address**. Websites see that address and may log it. You are responsible for what those sessions do
17
+ through it, so only use a machine and network you own or are allowed to use for this.
18
+
19
+ - Only sessions of the organization that paired the device can use it, and only if the dashboard
20
+ allows it (a device can be limited to its owner).
21
+ - Local and private destinations are **refused** unless you allow them with `--allow-private`:
22
+ loopback, RFC 1918 (10.x, 172.16-31.x, 192.168.x), link-local, CGNAT, unique-local IPv6, multicast
23
+ and cloud metadata addresses. Addresses that embed an IPv4 address (IPv4-mapped, NAT64, 6to4) are
24
+ judged by the embedded one. The tool dials the address it vetted, never the name again, so DNS
25
+ tricks cannot slip a private address past the check.
26
+ - Ports a browser never needs (mail, SSH, FTP, SMB, databases, remote desktop, ...) are refused
27
+ unless you name them with `--allow-ports`.
28
+ - `https` / `wss` only for the pairing and relay URLs (the device token travels there). Plain
29
+ `http` is accepted for localhost only, for development.
30
+ - At most 8 streams at once by default (`--max-streams`).
31
+ - `pair` shows this disclosure and asks you to type `yes`; `start` prints it again and prints every
32
+ connection it makes (destination host and port, never content).
33
+ - Pause any time with `webagent-device pause`, stop with Ctrl+C.
34
+
35
+ ## Commands
36
+
37
+ ```
38
+ webagent-device connect <PORT>... [--code CODE] [--api URL] [--yes] [--json]
39
+ npx @lookover-ai/webagent-device connect 3000 --code ABCD-EFGH --yes # what an AI agent runs
40
+ ```
41
+ **Local app mode.** Share these ports of this machine (an app you are developing) with your
42
+ webagent test sessions. The first run pairs the device (the code is made for a local app in the
43
+ dashboard); later runs reuse it. Sessions reach the app as `http://d-<id>.local-app.invalid:<port>/`
44
+ (never as `localhost`), only on the ports you name, and this machine dials nothing else: no DNS, no
45
+ other port, no LAN address (loopback `127.0.0.1`, then `::1`). Once connected it prints one
46
+ `local-app alias=<alias> url=http://<alias>:<port>/` line per port (with `--json`: one
47
+ `{alias, urls, ports, status}` line on stdout, everything else on stderr). Dev servers that check
48
+ the Host header (Vite `server.allowedHosts`, webpack-dev-server `allowedHosts`, Next
49
+ `allowedDevOrigins`, Angular `allowedHosts`) must allow the alias; `connect` probes and tells you.
50
+ Ports 1024-65535 only, not the mail/database/SSH ports. `status` shows the alias and ports.
51
+
52
+ - **No terminal (an AI agent runs it in the background):** `--yes` is required; without it the
53
+ command exits at once (code 2) and says so. With `--yes` the consent is one line instead of the
54
+ disclosure. The log then gets one `connected: device <id>, ports 3000 → <alias>` line per
55
+ (re)connection, one line per reconnect or error, and no line per successful connection.
56
+ - **Later runs** reuse the stored pairing, also for other ports (they need `--yes` or a yes again).
57
+ A `--code` given while a pairing is stored is not used, unless the stored pairing belongs to
58
+ another API or the relay refuses its token; then the code is claimed instead.
59
+ - **HTTPS dev servers** (`vite --https`, `next dev --experimental-https`, a self-signed
60
+ certificate): `connect` detects per port that the server speaks TLS and opens TLS to it itself
61
+ (SNI `localhost`, HTTP/1.1, certificate not checked: the peer is always this machine's loopback).
62
+ Sessions still open `http://<alias>:<port>/`, and the browser treats that origin as secure
63
+ (Secure cookies, `crypto.subtle`, service workers work as on `localhost`). An app that redirects
64
+ to `https://localhost/...` leaves the alias and is refused.
65
+ - **API:** production (`https://api.us.webagent.lookover.ai`) unless `--api` or `WEBAGENT_API_URL`
66
+ names another. Only pairing talks to the API.
67
+
68
+ ```
69
+ webagent-device pair <CODE> [--api URL] [--yes]
70
+ ```
71
+ Trade the pairing code from the dashboard (Proxies, Add device) for a device token. The token is
72
+ saved to `~/.config/webagent-device/config.json` (mode 0600; set `WEBAGENT_DEVICE_CONFIG_DIR` to
73
+ change the folder). `--yes` skips the question, for scripts: it is a deliberate consent.
74
+
75
+ ```
76
+ webagent-device start [--allow-private CIDR]... [--allow-ports N]... [--max-streams N]
77
+ ```
78
+ Connect and serve until stopped. Reconnects by itself; exits if the device is removed in the
79
+ dashboard (exit code 1). Options override the saved config. Example: `--allow-private 192.168.1.0/24`
80
+ to let sessions reach one office subnet. While running it listens on a local control socket
81
+ (`control.sock` in the config folder, mode 0600, never a network port).
82
+
83
+ ```
84
+ webagent-device status
85
+ ```
86
+ Prints the saved config **without the token** and whether a running `start` is connected.
87
+
88
+ ```
89
+ webagent-device pause
90
+ webagent-device resume
91
+ ```
92
+ Refuse every new connection (`paused`) or accept them again, without stopping the process. Talks to
93
+ the running `start` through the local control socket.
94
+
95
+ ```
96
+ webagent-device unpair
97
+ ```
98
+ Stops a running `start` and deletes the local config and token.
99
+
100
+ ## How to revoke
101
+
102
+ - **On this machine:** `webagent-device unpair`.
103
+ - **On the server:** open the dashboard, go to **Proxies**, and remove (or switch off) the device.
104
+ The relay then closes the connection at once and refuses the token from then on. Do this too after
105
+ `unpair`: deleting the file does not invalidate a copy of the token.
106
+ - Lost the machine or leaked the token? Remove the device in **Proxies** first.
107
+
108
+ ## License
109
+
110
+ Apache-2.0