ai-cli-online 2.3.1 → 2.3.2
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/README.md +1 -1
- package/package.json +1 -1
- package/server/dist/tmux.d.ts +3 -0
- package/server/dist/tmux.js +10 -6
- package/server/dist/websocket.js +3 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ Ideal for **unstable networks** where SSH drops frequently, or as a **local stat
|
|
|
24
24
|
- **Editor Panel** — multi-line editing with server-side draft persistence (SQLite)
|
|
25
25
|
- **File Transfer** — upload files to CWD, browse and download via REST API
|
|
26
26
|
- **Scroll History** — capture-pane scrollback viewer with ANSI color preservation
|
|
27
|
-
- **Session Management** — sidebar to restore, delete, and
|
|
27
|
+
- **Session Management** — sidebar to restore, delete, rename sessions, and close individual terminals (with confirmation)
|
|
28
28
|
- **Font Size Control** — adjustable terminal font size (A−/A+) with server-side persistence
|
|
29
29
|
- **Network Indicator** — real-time RTT latency display with signal bars
|
|
30
30
|
- **Auto Reconnect** — exponential backoff with jitter to prevent thundering herd
|
package/package.json
CHANGED
package/server/dist/tmux.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ export declare function isValidSessionId(sessionId: string): boolean;
|
|
|
17
17
|
export declare function buildSessionName(token: string, sessionId?: string): string;
|
|
18
18
|
/** Check if a tmux session exists */
|
|
19
19
|
export declare function hasSession(name: string): Promise<boolean>;
|
|
20
|
+
/** Configure tmux session options for web terminal usage.
|
|
21
|
+
* Note: set-option does NOT support the = exact-match prefix, so use bare name. */
|
|
22
|
+
export declare function configureSession(name: string): Promise<void>;
|
|
20
23
|
/** Create a new tmux session (detached) */
|
|
21
24
|
export declare function createSession(name: string, cols: number, rows: number, cwd: string): Promise<void>;
|
|
22
25
|
/**
|
package/server/dist/tmux.js
CHANGED
|
@@ -37,6 +37,15 @@ export async function hasSession(name) {
|
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
/** Configure tmux session options for web terminal usage.
|
|
41
|
+
* Note: set-option does NOT support the = exact-match prefix, so use bare name. */
|
|
42
|
+
export async function configureSession(name) {
|
|
43
|
+
await execFile('tmux', [
|
|
44
|
+
'set-option', '-t', name, 'history-limit', '50000', ';',
|
|
45
|
+
'set-option', '-t', name, 'status', 'off', ';',
|
|
46
|
+
'set-option', '-t', name, 'mouse', 'off',
|
|
47
|
+
]).catch(() => { });
|
|
48
|
+
}
|
|
40
49
|
/** Create a new tmux session (detached) */
|
|
41
50
|
export async function createSession(name, cols, rows, cwd) {
|
|
42
51
|
await execFile('tmux', [
|
|
@@ -46,12 +55,7 @@ export async function createSession(name, cols, rows, cwd) {
|
|
|
46
55
|
'-x', String(cols),
|
|
47
56
|
'-y', String(rows),
|
|
48
57
|
], { cwd });
|
|
49
|
-
|
|
50
|
-
await execFile('tmux', [
|
|
51
|
-
'set-option', '-t', `=${name}`, 'history-limit', '50000', ';',
|
|
52
|
-
'set-option', '-t', `=${name}`, 'status', 'off', ';',
|
|
53
|
-
'set-option', '-t', `=${name}`, 'mouse', 'off',
|
|
54
|
-
]).catch(() => { });
|
|
58
|
+
await configureSession(name);
|
|
55
59
|
console.log(`[tmux] Created session: ${name} (${cols}x${rows}) in ${cwd}`);
|
|
56
60
|
}
|
|
57
61
|
/**
|
package/server/dist/websocket.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { WebSocket } from 'ws';
|
|
2
|
-
import { buildSessionName, isValidSessionId, tokenToSessionName, hasSession, createSession, captureScrollback, resizeSession, getCwd, } from './tmux.js';
|
|
2
|
+
import { buildSessionName, isValidSessionId, tokenToSessionName, hasSession, createSession, configureSession, captureScrollback, resizeSession, getCwd, } from './tmux.js';
|
|
3
3
|
import { validatePath } from './files.js';
|
|
4
4
|
import { createReadStream } from 'fs';
|
|
5
5
|
import { stat as fsStat } from 'fs/promises';
|
|
@@ -182,10 +182,11 @@ export function setupWebSocket(wss, authToken, defaultCwd, tokenCompare, maxConn
|
|
|
182
182
|
await createSession(sessionName, cols, rows, defaultCwd);
|
|
183
183
|
}
|
|
184
184
|
else {
|
|
185
|
-
// resizeSession and
|
|
185
|
+
// resizeSession, captureScrollback, and configureSession are independent — run in parallel
|
|
186
186
|
const [, scrollback] = await Promise.all([
|
|
187
187
|
resizeSession(sessionName, cols, rows),
|
|
188
188
|
captureScrollback(sessionName),
|
|
189
|
+
configureSession(sessionName),
|
|
189
190
|
]);
|
|
190
191
|
if (scrollback) {
|
|
191
192
|
sendBinary(ws, BIN_TYPE_SCROLLBACK, scrollback);
|