@hmduc16031996/claude-mb-bridge 1.1.7 → 1.1.9

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -59,10 +59,13 @@ program
59
59
  });
60
60
  async function handleUserPrompt(content, sessionId, cwd) {
61
61
  console.log('⏳ Executing Claude Code with PTY...');
62
- // Using 'claude' CLI with node-pty for better terminal support
63
- const shell = 'claude';
64
- const args = ['-p', '--add-dir', cwd];
65
- const proc = pty.spawn(shell, args, {
62
+ // Spawn claude directly (not via shell) so PTY works reliably across environments
63
+ const isWin = process.platform === 'win32';
64
+ const claudeExe = isWin ? 'cmd.exe' : 'claude';
65
+ const args = isWin
66
+ ? ['/c', 'claude', '--print', content]
67
+ : ['--print', content];
68
+ const proc = pty.spawn(claudeExe, args, {
66
69
  name: 'xterm-256color',
67
70
  cols: 80,
68
71
  rows: 24,
@@ -75,8 +78,6 @@ async function handleUserPrompt(content, sessionId, cwd) {
75
78
  output += data;
76
79
  process.stdout.write(data);
77
80
  });
78
- // Send the prompt through the PTY
79
- proc.write(content + '\n');
80
81
  return new Promise((resolve) => {
81
82
  proc.onExit(async ({ exitCode }) => {
82
83
  console.log(`\n✅ Claude Code finished with code ${exitCode}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hmduc16031996/claude-mb-bridge",
3
- "version": "1.1.7",
3
+ "version": "1.1.9",
4
4
  "description": "Bridge between Claude Code CLI and your mobile app via Supabase",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",