shellway 0.8.0 → 0.8.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "manifest_version": 3,
3
3
  "name": "Shellway",
4
- "version": "0.8.0",
4
+ "version": "0.8.1",
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shellway",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Shellway agent: lets ChatGPT, Claude and Cursor work on this computer through the Shellway relay.",
5
5
  "type": "module",
6
6
  "bin": {
package/shellway.js CHANGED
@@ -9,7 +9,7 @@ import { readFile, writeFile, appendFile, readdir, stat, lstat, mkdir, rename, c
9
9
  import { createServer as netServer, connect as netConnect } from 'node:net';
10
10
  import { randomBytes, timingSafeEqual, createHash } from 'node:crypto';
11
11
 
12
- const AGENT_VERSION = '0.8.0'; // keep equal to agent/package.json
12
+ const AGENT_VERSION = '0.8.1'; // 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);
@@ -1559,6 +1559,7 @@ async function tokenValid(conf) {
1559
1559
  // the same conversation with Shellway over plain HTTPS requests (long-poll). It looks like a WebSocket to start(), so
1560
1560
  // keepalives, receipts and reconnects work the same. Messages from Shellway carry a number and are acknowledged on the
1561
1561
  // next poll, so an answer lost on the way is sent again and a repeat is ignored.
1562
+ const POLL_SEND_MS = Number(process.env.SHELLWAY_POLL_SEND_MS) || 10_000;
1562
1563
  export class PollLink {
1563
1564
  constructor(base, token, version) {
1564
1565
  this.base = base; this.h = { authorization: `Bearer ${token}`, 'x-shellway-version': version };
@@ -1610,15 +1611,18 @@ export class PollLink {
1610
1611
  while (this.outq.length && this.readyState === 1) {
1611
1612
  const batch = this.outq.splice(0, 50);
1612
1613
  try {
1613
- const r = await this._req(`/agent/poll/send?sid=${this.sid}`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(batch) }, 30_000);
1614
+ // 0.8.1 (customer 10396, 23 Nov): on his network about 1 upload in 10 stalls and never arrives (relay logged
1615
+ // HTTP 408 after 60 s). Answers and keepalives waited 30 s per try, so commands timed out and the link was
1616
+ // reset every 29 s. Now a stalled upload is given up after 10 s and sent again on a new request, up to 6 times.
1617
+ const r = await this._req(`/agent/poll/send?sid=${this.sid}`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify(batch) }, POLL_SEND_MS);
1614
1618
  if (r.status === 410) { this._end(1006, 'closed by Shellway'); break; }
1615
1619
  if (!r.ok) throw new Error(`HTTP ${r.status}`);
1616
1620
  fails = 0;
1617
1621
  } catch (e) {
1618
1622
  if (this.readyState !== 1) break;
1619
1623
  this.outq.unshift(...batch);
1620
- if (++fails >= 3) { this._fail(e); this._end(1006, ''); break; }
1621
- await new Promise((ok) => setTimeout(ok, 1000));
1624
+ if (++fails >= 6) { this._fail(e); this._end(1006, ''); break; }
1625
+ await new Promise((ok) => setTimeout(ok, 300));
1622
1626
  }
1623
1627
  }
1624
1628
  } finally { this.sending = false; }