@lifeaitools/clauth 1.5.52 → 1.5.53

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.
@@ -5265,24 +5265,34 @@ async function startChitchatSession(name) {
5265
5265
  };
5266
5266
  terminalSessions.set(session_id, session);
5267
5267
 
5268
- // Spawn a visible Windows Terminal running /rdc:collab --session <id>
5269
- const binary = findClaudeBinary();
5270
- if (binary) {
5271
- try {
5272
- // Open Windows Terminal in regen-root. Claude Code skills are interactive REPL commands
5273
- // so we print the session ID and start claude — user types /rdc:collab --session <id>
5274
- const banner = `echo. && echo [rdc:collab] Session ready: ${session_id} && echo Type: /rdc:collab --session ${session_id} && echo.`;
5275
- const child = spawnProc('wt.exe', [
5276
- 'new-tab', '--title', `rdc:collab ${name}`,
5277
- '--', 'cmd', '/k', `cd /d ${CHITCHAT_CWD} && ${banner} && ${binary} & pause`
5278
- ], { detached: true, stdio: 'ignore', shell: false });
5279
- child.unref();
5280
- console.log(`[ClaudeAItoCLI] spawned terminal for session ${session_id} binary=${binary}`);
5281
- } catch (err) {
5282
- console.warn(`[ClaudeAItoCLI] could not spawn terminal: ${err.message}`);
5283
- }
5284
- } else {
5285
- console.warn(`[ClaudeAItoCLI] claude binary not found in PATH — terminal not spawned. Run manually: cd ${CHITCHAT_CWD} && claude, then type /rdc:collab --session ${session_id}`);
5268
+ // Spawn a Windows Terminal tab running `npx clauth chitchat --session <id>`
5269
+ // Uses LOCALAPPDATA WindowsApps path (App Execution Alias — not visible to fs.existsSync but spawnable)
5270
+ try {
5271
+ const wtPath = path.join(process.env.LOCALAPPDATA || '', 'Microsoft', 'WindowsApps', 'wt.exe');
5272
+ const ps1Path = path.join(os.tmpdir(), `clauth-collab-${session_id.slice(0, 8)}.ps1`);
5273
+ fs.writeFileSync(ps1Path,
5274
+ `Set-Location '${CHITCHAT_CWD}'\r\n` +
5275
+ `npx clauth chitchat --session ${session_id}\r\n`
5276
+ );
5277
+ const child = spawnProc(wtPath, [
5278
+ 'new-tab', '--title', `collab-${session_id.slice(0, 8)}`,
5279
+ '--', 'powershell.exe', '-NoExit', '-File', ps1Path
5280
+ ], { detached: true, stdio: 'ignore', shell: false });
5281
+ child.on('error', err => {
5282
+ console.warn(`[ClaudeAItoCLI] wt spawn failed (${err.message}) — fallback to cmd /c start`);
5283
+ try {
5284
+ execSyncTop(
5285
+ `cmd /c start "" wt.exe new-tab --title "collab-${session_id.slice(0, 8)}" -- powershell.exe -NoExit -File "${ps1Path}"`,
5286
+ { stdio: 'ignore', shell: true }
5287
+ );
5288
+ } catch (e2) {
5289
+ console.warn(`[ClaudeAItoCLI] fallback also failed: ${e2.message} — run manually: cd ${CHITCHAT_CWD} && npx clauth chitchat --session ${session_id}`);
5290
+ }
5291
+ });
5292
+ child.unref();
5293
+ console.log(`[ClaudeAItoCLI] spawned terminal tab for session ${session_id}`);
5294
+ } catch (err) {
5295
+ console.warn(`[ClaudeAItoCLI] could not spawn terminal: ${err.message}`);
5286
5296
  }
5287
5297
 
5288
5298
  // Queue greeting so claude.ai gets an immediate response on first chitchat_recv
package/cli/index.js CHANGED
@@ -631,6 +631,47 @@ tunnelCmd
631
631
  }
632
632
  });
633
633
 
634
+ // ──────────────────────────────────────────────
635
+ // clauth chitchat --session <id>
636
+ // ──────────────────────────────────────────────
637
+ program
638
+ .command("chitchat")
639
+ .description("Join a chitchat collab session — opens claude interactively")
640
+ .requiredOption("--session <id>", "Session ID from claude.ai")
641
+ .action(async (opts) => {
642
+ const id = opts.session;
643
+ // Verify session exists in the daemon
644
+ try {
645
+ const r = await fetch(`http://127.0.0.1:52437/chitchat/${id}`, { signal: AbortSignal.timeout(3000) });
646
+ if (!r.ok) {
647
+ console.error(`\n ✗ Session ${id} not found (daemon returned ${r.status})\n`);
648
+ process.exit(1);
649
+ }
650
+ } catch (e) {
651
+ console.error(`\n ✗ Daemon not reachable at http://127.0.0.1:52437 — is clauth running?\n`);
652
+ process.exit(1);
653
+ }
654
+ console.log(chalk.cyan(`
655
+ ┌─────────────────────────────────────────────────┐
656
+ │ rdc:collab session ready │
657
+ │ │
658
+ │ Session: ${id} │
659
+ │ │
660
+ │ Type this in Claude Code: │
661
+ │ /rdc:collab --session ${id.slice(0,8)}... │
662
+ └─────────────────────────────────────────────────┘
663
+ `));
664
+ console.log(chalk.yellow(` /rdc:collab --session ${id}\n`));
665
+ // Launch claude interactively in this terminal
666
+ const { spawn } = await import("child_process");
667
+ const proc = spawn("claude", [], {
668
+ stdio: "inherit",
669
+ cwd: "C:/Dev/regen-root",
670
+ shell: true,
671
+ });
672
+ proc.on("exit", (code) => process.exit(code ?? 0));
673
+ });
674
+
634
675
  // ──────────────────────────────────────────────
635
676
  // clauth --help override banner
636
677
  // ──────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifeaitools/clauth",
3
- "version": "1.5.52",
3
+ "version": "1.5.53",
4
4
  "description": "Hardware-bound credential vault for the LIFEAI infrastructure stack",
5
5
  "type": "module",
6
6
  "bin": {