tilt-live 0.0.0-stage → 0.3.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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 cloudycotton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,15 @@
1
- # Temporary Holding Version
1
+ # tilt-live
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
+ See and control any Linux desktop, right in your browser.
4
+
5
+ ```sh
6
+ npx tilt-live
7
+ ```
8
+
9
+ Run it on the Linux machine or VM whose screen you want, open the link it prints, click the cursor
10
+ button, and the desktop is yours.
11
+
12
+ - The first run downloads [tilt](https://github.com/cloudycotton/tilt) (checksum-verified). After
13
+ that tilt updates itself whenever it starts; `TILT_NO_UPDATE=1` turns this off.
14
+ - `npx tilt-live --display :1`: every flag goes to [tilt](https://github.com/cloudycotton/tilt/blob/main/docs/guide.md#flags).
15
+ - Linux on x86_64 or arm64, Node 18+. MIT licensed.
@@ -0,0 +1,53 @@
1
+ #!/usr/bin/env node
2
+ // tilt-live: runs tilt (https://github.com/cloudycotton/tilt) with every argument passed through.
3
+ // The first run downloads the latest release (checksum-verified); after that tilt updates itself
4
+ // whenever it starts. Linux on x86_64 or arm64.
5
+ 'use strict';
6
+
7
+ const crypto = require('node:crypto');
8
+ const fs = require('node:fs');
9
+ const os = require('node:os');
10
+ const path = require('node:path');
11
+ const { spawn } = require('node:child_process');
12
+
13
+ // TILT_RELEASES points elsewhere for tests: a URL with GitHub's /latest/download layout.
14
+ const RELEASES = process.env.TILT_RELEASES || 'https://github.com/cloudycotton/tilt/releases';
15
+ const TRIPLE = { x64: 'x86_64-unknown-linux-musl', arm64: 'aarch64-unknown-linux-musl' }[process.arch];
16
+ const cacheDir = path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache'), 'tilt-live');
17
+ const bin = path.join(cacheDir, 'tilt');
18
+
19
+ function fail(msg) {
20
+ process.stderr.write(`tilt-live: ${msg}\n`);
21
+ process.exit(1);
22
+ }
23
+
24
+ async function download() {
25
+ const get = async (name) => {
26
+ const res = await fetch(`${RELEASES}/latest/download/${name}`, { signal: AbortSignal.timeout(120_000) });
27
+ if (!res.ok) throw new Error(`${name}: HTTP ${res.status}`);
28
+ return Buffer.from(await res.arrayBuffer());
29
+ };
30
+ const name = `tilt-${TRIPLE}`;
31
+ const [data, sums] = await Promise.all([get(name), get('SHA256SUMS')]);
32
+ const want = sums.toString().split('\n').map((l) => l.trim().split(/\s+/)).find((f) => f[1] === name)?.[0];
33
+ if (crypto.createHash('sha256').update(data).digest('hex') !== want) throw new Error(`${name}: checksum mismatch`);
34
+ fs.mkdirSync(cacheDir, { recursive: true });
35
+ const tmp = `${bin}.${process.pid}`;
36
+ fs.writeFileSync(tmp, data, { mode: 0o755 });
37
+ fs.renameSync(tmp, bin);
38
+ }
39
+
40
+ async function main() {
41
+ if (process.platform !== 'linux') fail('tilt streams a Linux desktop: run it on the Linux machine or VM whose screen you want');
42
+ if (!TRIPLE) fail('tilt runs on x86_64 or arm64');
43
+ if (!fs.existsSync(bin)) {
44
+ process.stderr.write('tilt-live: downloading tilt...\n');
45
+ await download().catch((e) => fail(`download failed: ${e.message}`));
46
+ }
47
+ const child = spawn(bin, process.argv.slice(2), { stdio: 'inherit' });
48
+ for (const sig of ['SIGINT', 'SIGTERM', 'SIGHUP', 'SIGQUIT']) process.on(sig, () => child.kill(sig));
49
+ child.on('error', (e) => fail(e.message));
50
+ child.on('exit', (code, sig) => process.exit(code ?? 128 + (os.constants.signals[sig] || 0)));
51
+ }
52
+
53
+ main();
package/package.json CHANGED
@@ -1,6 +1,41 @@
1
1
  {
2
2
  "name": "tilt-live",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.3.0",
4
+ "description": "See and control any Linux desktop, right in your browser (downloads tilt, which then keeps itself up to date)",
5
+ "keywords": [
6
+ "vnc",
7
+ "remote-desktop",
8
+ "x11",
9
+ "xvfb",
10
+ "webcodecs",
11
+ "h264",
12
+ "screen-sharing",
13
+ "e2b"
14
+ ],
15
+ "homepage": "https://github.com/cloudycotton/tilt",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/cloudycotton/tilt.git",
19
+ "directory": "npm"
20
+ },
21
+ "license": "MIT",
22
+ "bin": {
23
+ "tilt-live": "bin/tilt-live.js"
24
+ },
25
+ "files": [
26
+ "bin"
27
+ ],
28
+ "os": [
29
+ "linux"
30
+ ],
31
+ "cpu": [
32
+ "x64",
33
+ "arm64"
34
+ ],
35
+ "engines": {
36
+ "node": ">=18"
37
+ },
38
+ "scripts": {
39
+ "test": "node --test test/launcher.test.mjs"
40
+ }
41
+ }