vexp-cli 2.0.6 → 2.0.8

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/cli.js +29 -5
  2. package/package.json +6 -6
package/dist/cli.js CHANGED
@@ -62,8 +62,17 @@ function ensureBinary() {
62
62
  let replMode = false;
63
63
  function runBinary(binaryPath, args) {
64
64
  if (replMode) {
65
- // In REPL mode, run synchronously and don't exit the process
66
- const result = spawnSync(binaryPath, args, { stdio: "inherit", env: binaryEnv(binaryPath) });
65
+ // In REPL mode, run synchronously and don't exit the process.
66
+ // CRITICAL: stdin must be "ignore" (not "inherit") inheriting stdin
67
+ // from a readline-managed process leaves the readline in a broken
68
+ // state after spawnSync returns. The child's stdin access during
69
+ // spawnSync causes the parent readline to see EOF, closing the
70
+ // interactive prompt. All Rust subcommands receive their args via
71
+ // CLI, never stdin, so ignoring it is safe.
72
+ const result = spawnSync(binaryPath, args, {
73
+ stdio: ["ignore", "inherit", "inherit"],
74
+ env: binaryEnv(binaryPath),
75
+ });
67
76
  if (result.error) {
68
77
  console.error(chalk.red(`Error: ${result.error.message}`));
69
78
  }
@@ -84,8 +93,16 @@ function runBinary(binaryPath, args) {
84
93
  /** Promise-based binary runner that doesn't call process.exit(). */
85
94
  function runBinaryAsync(binaryPath, args, options) {
86
95
  return new Promise((resolve, reject) => {
96
+ // In REPL mode: never inherit stdin — it breaks readline state.
97
+ // "ignore" for stdin + "inherit" for stdout/stderr shows output
98
+ // without touching the parent's stdin stream.
99
+ const stdio = options?.silent
100
+ ? "pipe"
101
+ : replMode
102
+ ? ["ignore", "inherit", "inherit"]
103
+ : "inherit";
87
104
  const child = spawn(binaryPath, args, {
88
- stdio: options?.silent ? "pipe" : "inherit",
105
+ stdio,
89
106
  cwd: options?.cwd,
90
107
  env: binaryEnv(binaryPath),
91
108
  });
@@ -666,9 +683,16 @@ async function runSetupInteractive(rl) {
666
683
  const workspaceRoot = process.cwd();
667
684
  const binaryPath = ensureBinary();
668
685
  console.log(chalk.bold(`\n vexp setup — ${workspaceRoot}\n`));
669
- // Step 1: Index
686
+ // Step 1: Index (async+piped to avoid breaking the REPL readline —
687
+ // spawnSync with "inherit" blocks the event loop and can leave stdin
688
+ // in a dirty state that makes readline emit 'close' immediately).
670
689
  console.log(chalk.dim(" Indexing codebase...\n"));
671
- runBinary(binaryPath, ["init", workspaceRoot]);
690
+ try {
691
+ await runBinaryAsync(binaryPath, ["init", workspaceRoot], { cwd: workspaceRoot });
692
+ }
693
+ catch {
694
+ // Non-fatal: continue to agent config even if indexing had issues
695
+ }
672
696
  // Step 1.5: Start daemon + MCP HTTP server (parity with non-interactive setup)
673
697
  await startBackgroundServices(binaryPath, workspaceRoot);
674
698
  // Step 2: Select agents
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vexp-cli",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Vexp — Context Engine for AI Coding Agents. Pre-indexes your codebase into a dependency graph and delivers ranked context to any MCP-compatible agent. 58% lower cost per task, 90% fewer tool calls (SWE-bench Verified). Works with Claude Code, Cursor, Copilot, Windsurf, Codex, Cline, Aider, and 12+ agents. Local-first. Your code never leaves your machine.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -99,10 +99,10 @@
99
99
  "node": ">=20.0.0"
100
100
  },
101
101
  "optionalDependencies": {
102
- "@vexp/core-linux-x64": "2.0.6",
103
- "@vexp/core-linux-arm64": "2.0.6",
104
- "@vexp/core-darwin-x64": "2.0.6",
105
- "@vexp/core-darwin-arm64": "2.0.6",
106
- "@vexp/core-win32-x64": "2.0.6"
102
+ "@vexp/core-linux-x64": "2.0.8",
103
+ "@vexp/core-linux-arm64": "2.0.8",
104
+ "@vexp/core-darwin-x64": "2.0.8",
105
+ "@vexp/core-darwin-arm64": "2.0.8",
106
+ "@vexp/core-win32-x64": "2.0.8"
107
107
  }
108
108
  }