nikcli-remote 1.0.10 → 1.0.12
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/dist/{chunk-TIYMAVGV.js → chunk-2O3AVNZN.js} +23 -4
- package/dist/index.cjs +23 -4
- package/dist/index.d.cts +12 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +2 -2
- package/dist/{server-O3KTQ4KJ.js → server-YYYXMHHV.js} +1 -1
- package/package.json +1 -1
- package/src/server.ts +34 -2
- package/src/web-client.ts +3 -3
|
@@ -17,12 +17,12 @@ function getWebClient() {
|
|
|
17
17
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
18
18
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
19
19
|
<meta name="mobile-web-app-capable" content="yes">
|
|
20
|
-
<meta name="theme-color" content="#
|
|
20
|
+
<meta name="theme-color" content="#000000">
|
|
21
21
|
<title>NikCLI Remote</title>
|
|
22
22
|
<style>
|
|
23
23
|
:root {
|
|
24
|
-
--bg: #
|
|
25
|
-
--bg-secondary: #
|
|
24
|
+
--bg: #000000;
|
|
25
|
+
--bg-secondary: #232323;
|
|
26
26
|
--fg: #e6edf3;
|
|
27
27
|
--fg-muted: #8b949e;
|
|
28
28
|
--accent: #58a6ff;
|
|
@@ -795,7 +795,8 @@ var RemoteServer = class extends EventEmitter {
|
|
|
795
795
|
stdout.write = ((data, encoding, cb) => {
|
|
796
796
|
const result = originalWrite(data, encoding, cb);
|
|
797
797
|
const text = data instanceof Buffer ? data.toString() : data;
|
|
798
|
-
this.
|
|
798
|
+
const cleaned = this.cleanOutputForMobile(text);
|
|
799
|
+
this.broadcastToAll({ type: MessageTypes.TERMINAL_OUTPUT, payload: { data: cleaned } });
|
|
799
800
|
return result;
|
|
800
801
|
});
|
|
801
802
|
this.wss?.on("connection", (ws) => {
|
|
@@ -811,6 +812,13 @@ var RemoteServer = class extends EventEmitter {
|
|
|
811
812
|
});
|
|
812
813
|
});
|
|
813
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* Clean output for mobile display - remove ANSI codes and TUI artifacts
|
|
817
|
+
*/
|
|
818
|
+
cleanOutputForMobile(text) {
|
|
819
|
+
let cleaned = text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").replace(/\r/g, "").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
820
|
+
return cleaned;
|
|
821
|
+
}
|
|
814
822
|
/**
|
|
815
823
|
* Stop the server
|
|
816
824
|
*/
|
|
@@ -862,6 +870,12 @@ var RemoteServer = class extends EventEmitter {
|
|
|
862
870
|
}
|
|
863
871
|
}
|
|
864
872
|
}
|
|
873
|
+
/**
|
|
874
|
+
* Public broadcast method for compatibility
|
|
875
|
+
*/
|
|
876
|
+
broadcast(message) {
|
|
877
|
+
this.broadcastToAll(message);
|
|
878
|
+
}
|
|
865
879
|
/**
|
|
866
880
|
* Send notification to clients
|
|
867
881
|
*/
|
|
@@ -905,6 +919,11 @@ var RemoteServer = class extends EventEmitter {
|
|
|
905
919
|
writeToTerminal(data) {
|
|
906
920
|
this.writeToClients(data);
|
|
907
921
|
}
|
|
922
|
+
/**
|
|
923
|
+
* Resize terminal (for compatibility - not used in direct streaming mode)
|
|
924
|
+
*/
|
|
925
|
+
resizeTerminal(cols, rows) {
|
|
926
|
+
}
|
|
908
927
|
/**
|
|
909
928
|
* Setup WebSocket handlers
|
|
910
929
|
*/
|
package/dist/index.cjs
CHANGED
|
@@ -96,12 +96,12 @@ function getWebClient() {
|
|
|
96
96
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
97
97
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
98
98
|
<meta name="mobile-web-app-capable" content="yes">
|
|
99
|
-
<meta name="theme-color" content="#
|
|
99
|
+
<meta name="theme-color" content="#000000">
|
|
100
100
|
<title>NikCLI Remote</title>
|
|
101
101
|
<style>
|
|
102
102
|
:root {
|
|
103
|
-
--bg: #
|
|
104
|
-
--bg-secondary: #
|
|
103
|
+
--bg: #000000;
|
|
104
|
+
--bg-secondary: #232323;
|
|
105
105
|
--fg: #e6edf3;
|
|
106
106
|
--fg-muted: #8b949e;
|
|
107
107
|
--accent: #58a6ff;
|
|
@@ -837,7 +837,8 @@ var init_server = __esm({
|
|
|
837
837
|
stdout.write = ((data, encoding, cb) => {
|
|
838
838
|
const result = originalWrite(data, encoding, cb);
|
|
839
839
|
const text = data instanceof Buffer ? data.toString() : data;
|
|
840
|
-
this.
|
|
840
|
+
const cleaned = this.cleanOutputForMobile(text);
|
|
841
|
+
this.broadcastToAll({ type: MessageTypes.TERMINAL_OUTPUT, payload: { data: cleaned } });
|
|
841
842
|
return result;
|
|
842
843
|
});
|
|
843
844
|
this.wss?.on("connection", (ws) => {
|
|
@@ -853,6 +854,13 @@ var init_server = __esm({
|
|
|
853
854
|
});
|
|
854
855
|
});
|
|
855
856
|
}
|
|
857
|
+
/**
|
|
858
|
+
* Clean output for mobile display - remove ANSI codes and TUI artifacts
|
|
859
|
+
*/
|
|
860
|
+
cleanOutputForMobile(text) {
|
|
861
|
+
let cleaned = text.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, "").replace(/\r/g, "").replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, "");
|
|
862
|
+
return cleaned;
|
|
863
|
+
}
|
|
856
864
|
/**
|
|
857
865
|
* Stop the server
|
|
858
866
|
*/
|
|
@@ -904,6 +912,12 @@ var init_server = __esm({
|
|
|
904
912
|
}
|
|
905
913
|
}
|
|
906
914
|
}
|
|
915
|
+
/**
|
|
916
|
+
* Public broadcast method for compatibility
|
|
917
|
+
*/
|
|
918
|
+
broadcast(message) {
|
|
919
|
+
this.broadcastToAll(message);
|
|
920
|
+
}
|
|
907
921
|
/**
|
|
908
922
|
* Send notification to clients
|
|
909
923
|
*/
|
|
@@ -947,6 +961,11 @@ var init_server = __esm({
|
|
|
947
961
|
writeToTerminal(data) {
|
|
948
962
|
this.writeToClients(data);
|
|
949
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* Resize terminal (for compatibility - not used in direct streaming mode)
|
|
966
|
+
*/
|
|
967
|
+
resizeTerminal(cols, rows) {
|
|
968
|
+
}
|
|
950
969
|
/**
|
|
951
970
|
* Setup WebSocket handlers
|
|
952
971
|
*/
|
package/dist/index.d.cts
CHANGED
|
@@ -149,6 +149,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
149
149
|
* Setup stdin/stdout proxy to forward to WebSocket clients
|
|
150
150
|
*/
|
|
151
151
|
private setupStdioProxy;
|
|
152
|
+
/**
|
|
153
|
+
* Clean output for mobile display - remove ANSI codes and TUI artifacts
|
|
154
|
+
*/
|
|
155
|
+
private cleanOutputForMobile;
|
|
152
156
|
/**
|
|
153
157
|
* Stop the server
|
|
154
158
|
*/
|
|
@@ -157,6 +161,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
157
161
|
* Broadcast message to all authenticated clients
|
|
158
162
|
*/
|
|
159
163
|
private broadcastToAll;
|
|
164
|
+
/**
|
|
165
|
+
* Public broadcast method for compatibility
|
|
166
|
+
*/
|
|
167
|
+
broadcast(message: BroadcastMessage): void;
|
|
160
168
|
/**
|
|
161
169
|
* Send notification to clients
|
|
162
170
|
*/
|
|
@@ -181,6 +189,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
181
189
|
* Alias for writeToClients - for compatibility
|
|
182
190
|
*/
|
|
183
191
|
writeToTerminal(data: string): void;
|
|
192
|
+
/**
|
|
193
|
+
* Resize terminal (for compatibility - not used in direct streaming mode)
|
|
194
|
+
*/
|
|
195
|
+
resizeTerminal(cols: number, rows: number): void;
|
|
184
196
|
/**
|
|
185
197
|
* Setup WebSocket handlers
|
|
186
198
|
*/
|
package/dist/index.d.ts
CHANGED
|
@@ -149,6 +149,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
149
149
|
* Setup stdin/stdout proxy to forward to WebSocket clients
|
|
150
150
|
*/
|
|
151
151
|
private setupStdioProxy;
|
|
152
|
+
/**
|
|
153
|
+
* Clean output for mobile display - remove ANSI codes and TUI artifacts
|
|
154
|
+
*/
|
|
155
|
+
private cleanOutputForMobile;
|
|
152
156
|
/**
|
|
153
157
|
* Stop the server
|
|
154
158
|
*/
|
|
@@ -157,6 +161,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
157
161
|
* Broadcast message to all authenticated clients
|
|
158
162
|
*/
|
|
159
163
|
private broadcastToAll;
|
|
164
|
+
/**
|
|
165
|
+
* Public broadcast method for compatibility
|
|
166
|
+
*/
|
|
167
|
+
broadcast(message: BroadcastMessage): void;
|
|
160
168
|
/**
|
|
161
169
|
* Send notification to clients
|
|
162
170
|
*/
|
|
@@ -181,6 +189,10 @@ declare class RemoteServer extends EventEmitter {
|
|
|
181
189
|
* Alias for writeToClients - for compatibility
|
|
182
190
|
*/
|
|
183
191
|
writeToTerminal(data: string): void;
|
|
192
|
+
/**
|
|
193
|
+
* Resize terminal (for compatibility - not used in direct streaming mode)
|
|
194
|
+
*/
|
|
195
|
+
resizeTerminal(cols: number, rows: number): void;
|
|
184
196
|
/**
|
|
185
197
|
* Setup WebSocket handlers
|
|
186
198
|
*/
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
RemoteServer,
|
|
5
5
|
getWebClient,
|
|
6
6
|
init_web_client
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2O3AVNZN.js";
|
|
8
8
|
import "./chunk-GI5RMYH6.js";
|
|
9
9
|
|
|
10
10
|
// src/tunnel.ts
|
|
@@ -227,7 +227,7 @@ async function findAvailableTunnel() {
|
|
|
227
227
|
// src/index.ts
|
|
228
228
|
init_web_client();
|
|
229
229
|
async function createRemoteServer(config = {}) {
|
|
230
|
-
const { RemoteServer: RemoteServerCls } = await import("./server-
|
|
230
|
+
const { RemoteServer: RemoteServerCls } = await import("./server-YYYXMHHV.js");
|
|
231
231
|
const server = new RemoteServerCls(config);
|
|
232
232
|
const session = await server.start();
|
|
233
233
|
return { server, session };
|
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -140,9 +140,10 @@ export class RemoteServer extends EventEmitter {
|
|
|
140
140
|
// Call original write
|
|
141
141
|
const result = originalWrite(data, encoding, cb)
|
|
142
142
|
|
|
143
|
-
// Broadcast to all authenticated clients
|
|
143
|
+
// Broadcast to all authenticated clients (cleaned for mobile)
|
|
144
144
|
const text = data instanceof Buffer ? data.toString() : data
|
|
145
|
-
this.
|
|
145
|
+
const cleaned = this.cleanOutputForMobile(text as any)
|
|
146
|
+
this.broadcastToAll({ type: MessageTypes.TERMINAL_OUTPUT, payload: { data: cleaned } })
|
|
146
147
|
|
|
147
148
|
return result
|
|
148
149
|
}) as typeof stdout.write
|
|
@@ -164,6 +165,22 @@ export class RemoteServer extends EventEmitter {
|
|
|
164
165
|
})
|
|
165
166
|
}
|
|
166
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Clean output for mobile display - remove ANSI codes and TUI artifacts
|
|
170
|
+
*/
|
|
171
|
+
private cleanOutputForMobile(text: string): string {
|
|
172
|
+
// Remove ANSI escape sequences (colors, cursor movements, clear screen)
|
|
173
|
+
let cleaned = text
|
|
174
|
+
// Remove escape sequences (colors, cursor, clear)
|
|
175
|
+
.replace(/\x1b\[[0-9;]*[a-zA-Z]/g, '')
|
|
176
|
+
// Remove carriage returns that cause overwrites
|
|
177
|
+
.replace(/\r/g, '')
|
|
178
|
+
// Remove special control chars that cause issues
|
|
179
|
+
.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]/g, '')
|
|
180
|
+
|
|
181
|
+
return cleaned
|
|
182
|
+
}
|
|
183
|
+
|
|
167
184
|
/**
|
|
168
185
|
* Stop the server
|
|
169
186
|
*/
|
|
@@ -234,6 +251,13 @@ export class RemoteServer extends EventEmitter {
|
|
|
234
251
|
}
|
|
235
252
|
}
|
|
236
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Public broadcast method for compatibility
|
|
256
|
+
*/
|
|
257
|
+
broadcast(message: BroadcastMessage): void {
|
|
258
|
+
this.broadcastToAll(message)
|
|
259
|
+
}
|
|
260
|
+
|
|
237
261
|
/**
|
|
238
262
|
* Send notification to clients
|
|
239
263
|
*/
|
|
@@ -283,6 +307,14 @@ export class RemoteServer extends EventEmitter {
|
|
|
283
307
|
this.writeToClients(data)
|
|
284
308
|
}
|
|
285
309
|
|
|
310
|
+
/**
|
|
311
|
+
* Resize terminal (for compatibility - not used in direct streaming mode)
|
|
312
|
+
*/
|
|
313
|
+
resizeTerminal(cols: number, rows: number): void {
|
|
314
|
+
// In direct streaming mode, terminal size is handled by the client
|
|
315
|
+
// This is a no-op for compatibility
|
|
316
|
+
}
|
|
317
|
+
|
|
286
318
|
/**
|
|
287
319
|
* Setup WebSocket handlers
|
|
288
320
|
*/
|
package/src/web-client.ts
CHANGED
|
@@ -11,12 +11,12 @@ export function getWebClient(): string {
|
|
|
11
11
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
12
12
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
13
13
|
<meta name="mobile-web-app-capable" content="yes">
|
|
14
|
-
<meta name="theme-color" content="#
|
|
14
|
+
<meta name="theme-color" content="#000000">
|
|
15
15
|
<title>NikCLI Remote</title>
|
|
16
16
|
<style>
|
|
17
17
|
:root {
|
|
18
|
-
--bg: #
|
|
19
|
-
--bg-secondary: #
|
|
18
|
+
--bg: #000000;
|
|
19
|
+
--bg-secondary: #232323;
|
|
20
20
|
--fg: #e6edf3;
|
|
21
21
|
--fg-muted: #8b949e;
|
|
22
22
|
--accent: #58a6ff;
|