nikcli-remote 1.0.0 → 1.0.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.
@@ -2635,6 +2635,9 @@ var RemoteServer = class extends EventEmitter2 {
2635
2635
  * Handle authentication
2636
2636
  */
2637
2637
  handleAuth(client, token) {
2638
+ console.log(`[Tunnel] Auth attempt from ${client.id}, token length: ${token?.length || 0}`);
2639
+ console.log(`[Tunnel] Expected secret: ${this.sessionSecret?.substring(0, 8)}...`);
2640
+ console.log(`[Tunnel] Received token: ${token?.substring(0, 8)}...`);
2638
2641
  if (token === this.sessionSecret) {
2639
2642
  client.authenticated = true;
2640
2643
  if (this.session) {
@@ -2655,7 +2658,9 @@ var RemoteServer = class extends EventEmitter2 {
2655
2658
  this.terminal?.start();
2656
2659
  }
2657
2660
  this.emit("client:connected", client.device);
2661
+ console.log(`[Tunnel] Auth success for ${client.id}`);
2658
2662
  } else {
2663
+ console.log(`[Tunnel] Auth failed for ${client.id}`);
2659
2664
  client.ws.send(JSON.stringify({ type: MessageTypes.AUTH_FAILED, timestamp: Date.now() }));
2660
2665
  setTimeout(() => client.ws.close(1008, "Authentication failed"), 100);
2661
2666
  }
package/dist/index.cjs CHANGED
@@ -6499,6 +6499,9 @@ var init_server = __esm({
6499
6499
  * Handle authentication
6500
6500
  */
6501
6501
  handleAuth(client, token) {
6502
+ console.log(`[Tunnel] Auth attempt from ${client.id}, token length: ${token?.length || 0}`);
6503
+ console.log(`[Tunnel] Expected secret: ${this.sessionSecret?.substring(0, 8)}...`);
6504
+ console.log(`[Tunnel] Received token: ${token?.substring(0, 8)}...`);
6502
6505
  if (token === this.sessionSecret) {
6503
6506
  client.authenticated = true;
6504
6507
  if (this.session) {
@@ -6519,7 +6522,9 @@ var init_server = __esm({
6519
6522
  this.terminal?.start();
6520
6523
  }
6521
6524
  this.emit("client:connected", client.device);
6525
+ console.log(`[Tunnel] Auth success for ${client.id}`);
6522
6526
  } else {
6527
+ console.log(`[Tunnel] Auth failed for ${client.id}`);
6523
6528
  client.ws.send(JSON.stringify({ type: MessageTypes.AUTH_FAILED, timestamp: Date.now() }));
6524
6529
  setTimeout(() => client.ws.close(1008, "Authentication failed"), 100);
6525
6530
  }
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  checkTunnelAvailability,
8
8
  findAvailableTunnel,
9
9
  getWebClient
10
- } from "./chunk-TJTKYXIZ.js";
10
+ } from "./chunk-QLGPGAPC.js";
11
11
  import {
12
12
  __require
13
13
  } from "./chunk-MCKGQKYU.js";
@@ -133,7 +133,7 @@ function progressBar(current, total, width = 30) {
133
133
 
134
134
  // src/index.ts
135
135
  async function createRemoteServer(config = {}) {
136
- const { RemoteServer: RemoteServer2 } = await import("./server-XW6FLG7E.js");
136
+ const { RemoteServer: RemoteServer2 } = await import("./server-ISK4MDQQ.js");
137
137
  const server = new RemoteServer2(config);
138
138
  const session = await server.start();
139
139
  return { server, session };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  RemoteServer
3
- } from "./chunk-TJTKYXIZ.js";
3
+ } from "./chunk-QLGPGAPC.js";
4
4
  import "./chunk-MCKGQKYU.js";
5
5
  export {
6
6
  RemoteServer
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nikcli-remote",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Native remote terminal server for NikCLI - Mobile control via WebSocket",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/server.ts CHANGED
@@ -403,6 +403,10 @@ export class RemoteServer extends EventEmitter {
403
403
  * Handle authentication
404
404
  */
405
405
  private handleAuth(client: ClientConnection & { ws: WebSocket }, token: string): void {
406
+ console.log(`[Tunnel] Auth attempt from ${client.id}, token length: ${token?.length || 0}`)
407
+ console.log(`[Tunnel] Expected secret: ${this.sessionSecret?.substring(0, 8)}...`)
408
+ console.log(`[Tunnel] Received token: ${token?.substring(0, 8)}...`)
409
+
406
410
  if (token === this.sessionSecret) {
407
411
  client.authenticated = true
408
412
 
@@ -428,7 +432,9 @@ export class RemoteServer extends EventEmitter {
428
432
  }
429
433
 
430
434
  this.emit('client:connected', client.device)
435
+ console.log(`[Tunnel] Auth success for ${client.id}`)
431
436
  } else {
437
+ console.log(`[Tunnel] Auth failed for ${client.id}`)
432
438
  client.ws.send(JSON.stringify({ type: MessageTypes.AUTH_FAILED, timestamp: Date.now() }))
433
439
  setTimeout(() => client.ws.close(1008, 'Authentication failed'), 100)
434
440
  }