claude-remote-cli 3.8.0 → 3.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.
@@ -11,7 +11,7 @@
11
11
  <meta name="apple-mobile-web-app-capable" content="yes" />
12
12
  <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
13
13
  <meta name="theme-color" content="#1a1a1a" />
14
- <script type="module" crossorigin src="/assets/index-cJ7MQBLi.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-Oo6XkKVW.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-CiwYPknn.css">
16
16
  </head>
17
17
  <body>
package/dist/server/ws.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { WebSocketServer } from 'ws';
2
2
  import * as sessions from './sessions.js';
3
3
  import { trackEvent } from './analytics.js';
4
+ function replyPing(ws) {
5
+ if (ws.readyState === ws.OPEN)
6
+ ws.send('{"type":"pong"}');
7
+ }
4
8
  function parseCookies(cookieHeader) {
5
9
  const cookies = {};
6
10
  if (!cookieHeader)
@@ -43,6 +47,14 @@ function setupWebSocket(server, authenticatedTokens, watcher, _configPath) {
43
47
  wss.handleUpgrade(request, socket, head, (ws) => {
44
48
  const cleanup = () => { eventClients.delete(ws); };
45
49
  eventClients.add(ws);
50
+ ws.on('message', (msg) => {
51
+ try {
52
+ const parsed = JSON.parse(msg.toString());
53
+ if (parsed.type === 'ping')
54
+ replyPing(ws);
55
+ }
56
+ catch { /* ignore */ }
57
+ });
46
58
  ws.on('close', cleanup);
47
59
  ws.on('error', cleanup);
48
60
  });
@@ -99,6 +111,10 @@ function setupWebSocket(server, authenticatedTokens, watcher, _configPath) {
99
111
  const str = msg.toString();
100
112
  try {
101
113
  const parsed = JSON.parse(str);
114
+ if (parsed.type === 'ping') {
115
+ replyPing(ws);
116
+ return;
117
+ }
102
118
  if (parsed.type === 'resize' && parsed.cols && parsed.rows) {
103
119
  sessions.resize(session.id, parsed.cols, parsed.rows);
104
120
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-remote-cli",
3
- "version": "3.8.0",
3
+ "version": "3.8.1",
4
4
  "description": "Remote web interface for Claude Code CLI sessions",
5
5
  "type": "module",
6
6
  "main": "dist/server/index.js",