@hexclave/cli 1.0.69 → 1.0.71

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
@@ -31,6 +31,7 @@ import { checkbox, confirm, input, select } from "@inquirer/prompts";
31
31
  import { runHeadlessClaudeAgent } from "@hexclave/shared-backend/config-agent";
32
32
  import { createInitPrompt } from "@hexclave/shared/dist/helpers/init-prompt";
33
33
  import { execFileSync, spawn } from "child_process";
34
+ import crossSpawn from "cross-spawn";
34
35
  import { Readable } from "stream";
35
36
  import { pipeline } from "stream/promises";
36
37
  import * as tar from "tar";
@@ -2125,6 +2126,12 @@ const REQUIRED_DASHBOARD_RUNTIME_ENV_VARS = /* @__PURE__ */ new Set([
2125
2126
  "NEXT_PUBLIC_STACK_IS_PREVIEW",
2126
2127
  DASHBOARD_PORT_ENV_VAR
2127
2128
  ]);
2129
+ function dashboardEnvWithStatePath(env, statePath) {
2130
+ return {
2131
+ ...env,
2132
+ STACK_DEV_ENVS_PATH: env.STACK_DEV_ENVS_PATH ?? statePath
2133
+ };
2134
+ }
2128
2135
  function wait(ms) {
2129
2136
  return new Promise((resolvePromise) => setTimeout(resolvePromise, ms));
2130
2137
  }
@@ -2370,7 +2377,7 @@ async function startDashboardIfNeeded(options) {
2370
2377
  }) : null;
2371
2378
  const progress = startProgress(`Hexclave dashboard not found on port ${options.port}. Starting now`, { prefix: LOG_PREFIX });
2372
2379
  const dashboardEnv = {
2373
- ...process.env,
2380
+ ...dashboardEnvWithStatePath(process.env, devEnvStatePath()),
2374
2381
  NODE_ENV: devDashboardCommand == null ? "production" : "development",
2375
2382
  PORT: String(options.port),
2376
2383
  HOSTNAME: "0.0.0.0",
@@ -2578,7 +2585,7 @@ child.on("error", (error) => {
2578
2585
  `;
2579
2586
  function runChildProcess(command, env) {
2580
2587
  return new Promise((resolvePromise, reject) => {
2581
- const child = process.platform === "win32" ? spawn(command.command, command.args, {
2588
+ const child = process.platform === "win32" ? crossSpawn(command.command, command.args, {
2582
2589
  stdio: "inherit",
2583
2590
  env
2584
2591
  }) : spawn(process.execPath, ["-e", APP_COMMAND_WRAPPER_SCRIPT], {