shellway 0.7.4 → 0.7.5
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/extension/manifest.json +1 -1
- package/package.json +1 -1
- package/shellway.js +20 -3
package/extension/manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "Shellway",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.5",
|
|
5
5
|
"description": "Lets your AI (ChatGPT, Claude) use this browser through the Shellway app on your computer. Off until you turn it on.",
|
|
6
6
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnZWALJr6dwkQu7eX3reFbtgMAErsCyODHKnwz97XMKpR9bAz4+irBlJ2KEXD6ERZFjuKYqNZ2HLe0eQp5y9fWscyWeTUXNTstsFaymsb5C0aRcpW/dXRl2Dy9vQ7y7+ATH4SCxcckncfmEXt4GFQ6TtyPsctuQfYez6o9MHmwGaKwpCPaWmqfYqomy0yjzMCbCg2b0aP2+hDmOhc0KARhGVnzlZBIBSybtkpAmzXfUxMJHDD5ly3g6ScCcR+3Zf7SKyCfLMGSkwYwiJvvS4sNCtBzwKdDdbEh865T7H5NCS8GOhSt0hxkPPxpbTlXrWXINDiSkF00/b7ZToBRTmK4QIDAQAB",
|
|
7
7
|
"minimum_chrome_version": "116",
|
package/package.json
CHANGED
package/shellway.js
CHANGED
|
@@ -7,9 +7,9 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
7
|
import { execFileSync, execFile } from 'node:child_process';
|
|
8
8
|
import { readFile, writeFile, appendFile, readdir, stat, lstat, mkdir, rename, cp, rm } from 'node:fs/promises';
|
|
9
9
|
import { createServer as netServer, connect as netConnect } from 'node:net';
|
|
10
|
-
import { randomBytes, timingSafeEqual } from 'node:crypto';
|
|
10
|
+
import { randomBytes, timingSafeEqual, createHash } from 'node:crypto';
|
|
11
11
|
|
|
12
|
-
const AGENT_VERSION = '0.7.
|
|
12
|
+
const AGENT_VERSION = '0.7.5'; // keep equal to agent/package.json
|
|
13
13
|
if (Number(process.versions.node.split('.')[0]) < 22) {
|
|
14
14
|
console.error(`Shellway needs Node.js 22 or newer (you have ${process.versions.node}). Get it at https://nodejs.org`);
|
|
15
15
|
process.exit(1);
|
|
@@ -1134,6 +1134,23 @@ function installExtensionHost() {
|
|
|
1134
1134
|
const extConnected = () => !!ext.sock;
|
|
1135
1135
|
const extVersion = () => ext.version;
|
|
1136
1136
|
export { nativeHostManifest, nativeHostTargets, extJson, extCall, startExtBridge, extConnected, extVersion, installExtensionHost, SNAPSHOT_JS };
|
|
1137
|
+
// 0.7.5: one free trial per computer (owner 21 Nov 2026). The computer's own built-in ID (Windows MachineGuid, Mac
|
|
1138
|
+
// hardware UUID, Linux machine-id) does not change when the computer or the account is renamed. Only a one-way code
|
|
1139
|
+
// made from it is sent; the ID itself never leaves the computer.
|
|
1140
|
+
let machineHashCache;
|
|
1141
|
+
function machineId(os = platform()) {
|
|
1142
|
+
try {
|
|
1143
|
+
if (os === 'win32') { const o = execFileSync('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\Cryptography', '/v', 'MachineGuid'], { encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'ignore'], windowsHide: true }); return (/MachineGuid\s+REG_SZ\s+(\S+)/i.exec(o) || [])[1] || ''; }
|
|
1144
|
+
if (os === 'darwin') { const o = execFileSync('ioreg', ['-rd1', '-c', 'IOPlatformExpertDevice'], { encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'ignore'] }); return (/"IOPlatformUUID"\s*=\s*"([^"]+)"/.exec(o) || [])[1] || ''; }
|
|
1145
|
+
for (const f of ['/etc/machine-id', '/var/lib/dbus/machine-id']) { try { const v = readFileSync(f, 'utf8').trim(); if (v) return v; } catch {} }
|
|
1146
|
+
} catch {}
|
|
1147
|
+
return '';
|
|
1148
|
+
}
|
|
1149
|
+
function machineHash() {
|
|
1150
|
+
if (machineHashCache === undefined) { const id = String(machineId() || '').trim().toLowerCase(); machineHashCache = id.length >= 8 ? createHash('sha256').update('shellway-machine-v1:' + id).digest('hex').slice(0, 32) : null; }
|
|
1151
|
+
return machineHashCache;
|
|
1152
|
+
}
|
|
1153
|
+
export { machineHash };
|
|
1137
1154
|
const browserPages = async () => (await cdpJson('/json/list')).filter((t) => t.type === 'page' && !String(t.url).startsWith('devtools:'));
|
|
1138
1155
|
async function currentPage() {
|
|
1139
1156
|
await ensureBrowser();
|
|
@@ -1544,7 +1561,7 @@ function start() {
|
|
|
1544
1561
|
const ws = new WebSocket(wsUrl, { headers: { authorization: `Bearer ${conf.device_token}`, 'x-shellway-version': AGENT_VERSION } });
|
|
1545
1562
|
current = ws;
|
|
1546
1563
|
ws.onopen = () => { if (my !== gen) { try { ws.close(); } catch {} return; } connectingSince = 0; delay = 1000; lastMsg = Date.now();
|
|
1547
|
-
try { ws.send(JSON.stringify({ type: 'info', v: AGENT_VERSION, node: process.versions.node, os: platform(), reason: why, ...(prevCid ? { replaced: prevCid } : {}) })); } catch {}
|
|
1564
|
+
try { ws.send(JSON.stringify({ type: 'info', v: AGENT_VERSION, node: process.versions.node, os: platform(), reason: why, ...(machineHash() ? { mid: machineHash() } : {}), ...(prevCid ? { replaced: prevCid } : {}) })); } catch {}
|
|
1548
1565
|
why = 'network'; prevCid = null; console.log(`Connected as "${conf.device_name}"${readonly ? ' (read-only)' : ''}. Leave this running.`); };
|
|
1549
1566
|
ws.onmessage = async (ev) => {
|
|
1550
1567
|
lastMsg = Date.now();
|