@clawchatsai/connector 0.1.5 → 0.1.6

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/index.js CHANGED
@@ -564,6 +564,7 @@ function setupDataChannelHandler(dc, connectionId, ctx) {
564
564
  dc.onClosed(() => {
565
565
  connectedClients.delete(connectionId);
566
566
  cleanupAuth(connectionId);
567
+ app?.debugLogger.handleClientDisconnect(dc);
567
568
  });
568
569
  }
569
570
  /**
@@ -661,6 +662,24 @@ function processAuthenticatedMessage(dc, connectionId, msg, ctx) {
661
662
  case 'ping':
662
663
  dc.send(JSON.stringify({ type: 'pong' }));
663
664
  break;
665
+ case 'clawchats':
666
+ case 'shellchat': {
667
+ if (!app)
668
+ break;
669
+ const action = msg['action'];
670
+ if (action === 'debug-start') {
671
+ const ts = typeof msg['ts'] === 'string' ? msg['ts'] : new Date().toISOString();
672
+ const r = app.debugLogger.start(ts, dc);
673
+ dc.send(JSON.stringify(r.error === 'already-active'
674
+ ? { type: 'clawchats', event: 'debug-error', error: 'Recording already active in another tab', sessionId: r.sessionId }
675
+ : { type: 'clawchats', event: 'debug-started', sessionId: r.sessionId }));
676
+ }
677
+ else if (action === 'debug-dump') {
678
+ const r = app.debugLogger.saveDump(msg);
679
+ dc.send(JSON.stringify({ type: 'clawchats', event: 'debug-saved', sessionId: r.sessionId, files: r.files }));
680
+ }
681
+ break;
682
+ }
664
683
  default:
665
684
  // Unknown message type — ignore silently.
666
685
  // (Sending an error response would break heartbeat backward-compat
@@ -1055,13 +1074,13 @@ async function handleSetupTotp() {
1055
1074
  }
1056
1075
  else {
1057
1076
  // Expired — generate a fresh one
1058
- totpSecret = generateTotpSecret();
1077
+ totpSecret = process.env.CLAWCHATS_DEV_TOTP_SECRET || generateTotpSecret();
1059
1078
  config.totpPending = { secret: totpSecret, generatedAt: new Date().toISOString() };
1060
1079
  saveConfig(config);
1061
1080
  }
1062
1081
  }
1063
1082
  else {
1064
- totpSecret = generateTotpSecret();
1083
+ totpSecret = process.env.CLAWCHATS_DEV_TOTP_SECRET || generateTotpSecret();
1065
1084
  config.totpPending = { secret: totpSecret, generatedAt: new Date().toISOString() };
1066
1085
  saveConfig(config);
1067
1086
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clawchatsai/connector",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "type": "module",
5
5
  "description": "ClawChats OpenClaw plugin — P2P tunnel + local API bridge",
6
6
  "main": "dist/index.js",
package/server/index.js CHANGED
@@ -344,6 +344,7 @@ export function createApp(config = {}) {
344
344
  closeAllDbs: closeAll,
345
345
  gatewayClient,
346
346
  setupBrowserWs,
347
+ debugLogger,
347
348
  dataDir: DATA_DIR,
348
349
  };
349
350
  }