claude-bridge-cli 1.5.0 → 1.5.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.
Files changed (2) hide show
  1. package/lib/bridge.js +12 -5
  2. package/package.json +1 -1
package/lib/bridge.js CHANGED
@@ -418,11 +418,18 @@ function askClaude(config, { prompt, session_id, images, cwd, plan_mode, allow_t
418
418
  const isWin = process.platform === "win32";
419
419
  const isCmdShim = isWin && config.claudeBin.endsWith(".cmd");
420
420
 
421
- // Only fall back to @file syntax for prompts that would exceed Windows
422
- // cmd.exe's ~8K arg limit. Direct -p means the JSONL stores the actual
423
- // prompt text (so session history shows the real user messages, not
424
- // temp-file paths). Threshold is conservative: 6000 chars.
425
- const useTempFile = finalPrompt.length > 6000;
421
+ // Fall back to @file syntax in two cases:
422
+ // 1) Prompt exceeds Windows cmd.exe's ~8K arg limit (threshold 6000).
423
+ // 2) Prompt contains a newline AND we're on Windows with a .cmd shim
424
+ // cmd.exe parses arg strings line-by-line and silently truncates
425
+ // at the first \n, even with Node.js's proper argv quoting. Without
426
+ // this fallback, any multi-line prompt to Claude on Windows lost
427
+ // everything after line 1, and the model saw a stub message + the
428
+ // header but none of the body. Manifested as "your message got
429
+ // cut off" responses for prompts that LOOK short.
430
+ const useTempFile =
431
+ finalPrompt.length > 6000 ||
432
+ (isWin && isCmdShim && /\r|\n/.test(finalPrompt));
426
433
  let tmpFile = null;
427
434
  if (useTempFile) {
428
435
  tmpFile = path.join(os.tmpdir(), `claude-prompt-${Date.now()}-${Math.random().toString(36).slice(2)}.txt`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-bridge-cli",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "Use Claude Code from your browser. Runs a local server that connects your browser tools to the Claude CLI.",
5
5
  "main": "lib/bridge.js",
6
6
  "bin": {