claude-simple 0.2.27 → 0.2.28
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/client.js +21 -2
- package/dist/app.0.2.28.min.js +1220 -0
- package/dist/index.html +2 -2
- package/dist/{style.0.2.27.min.css → style.0.2.28.min.css} +157 -1
- package/package.json +1 -1
- package/public/agent-panel.js +7 -2
- package/public/api.js +7 -4
- package/public/app.js +2 -0
- package/public/chat.js +34 -0
- package/public/notes.js +316 -0
- package/public/router.js +4 -0
- package/public/shell/session-list.js +30 -5
- package/public/shell/session-nav.js +6 -4
- package/public/shell/templates.js +3 -0
- package/public/shell.js +15 -2
- package/public/style.css +156 -0
- package/public/sw.js +1 -1
- package/src/agents/grok.js +16 -0
- package/src/agents/sessions.js +137 -12
- package/src/app.js +31 -15
- package/src/session-history.js +31 -0
- package/dist/app.0.2.27.min.js +0 -1182
package/client.js
CHANGED
|
@@ -4,6 +4,7 @@ import { startAutoUpdate } from './src/auto-update.js';
|
|
|
4
4
|
import { WebSocket } from 'ws';
|
|
5
5
|
import os from 'os';
|
|
6
6
|
import crypto from 'crypto';
|
|
7
|
+
import zlib from 'zlib';
|
|
7
8
|
import { promises as fs, watch as watchFs } from 'fs';
|
|
8
9
|
import path from 'path';
|
|
9
10
|
|
|
@@ -408,8 +409,26 @@ function connect() {
|
|
|
408
409
|
}
|
|
409
410
|
|
|
410
411
|
const body = await res.text();
|
|
411
|
-
|
|
412
|
-
|
|
412
|
+
const raw = Buffer.from(body, 'utf8');
|
|
413
|
+
// Large JSON (session history) is gzip+base64 on the control channel so
|
|
414
|
+
// Hub→phone does not wait on an uncompressed multi-MB WS frame.
|
|
415
|
+
if (raw.length >= 4096) {
|
|
416
|
+
try {
|
|
417
|
+
const zipped = zlib.gzipSync(raw, { level: 4 });
|
|
418
|
+
if (zipped.length < raw.length * 0.95) {
|
|
419
|
+
sendControl({
|
|
420
|
+
type: 'http-res',
|
|
421
|
+
reqId: msg.reqId,
|
|
422
|
+
status: res.status,
|
|
423
|
+
headers,
|
|
424
|
+
body: zipped.toString('base64'),
|
|
425
|
+
encoding: 'gzip',
|
|
426
|
+
});
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
} catch { /* fall through to plain text */ }
|
|
430
|
+
}
|
|
431
|
+
headers['content-length'] = String(raw.length);
|
|
413
432
|
sendControl({
|
|
414
433
|
type: 'http-res',
|
|
415
434
|
reqId: msg.reqId,
|