@neat.is/core 0.4.24-dev.20260701 → 0.4.25

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/cli.cjs CHANGED
@@ -11413,6 +11413,9 @@ async function healthIsForProject(restPort, project) {
11413
11413
  }
11414
11414
  return false;
11415
11415
  }
11416
+ function daemonLogPath(projectPath2) {
11417
+ return import_node_path50.default.join(projectPath2, "neat-out", "daemon.log");
11418
+ }
11416
11419
  function spawnDaemonDetached(spec) {
11417
11420
  const here = import_node_path50.default.dirname(new URL(importMetaUrl).pathname);
11418
11421
  const candidates = [
@@ -11444,15 +11447,19 @@ function spawnDaemonDetached(spec) {
11444
11447
  env.OTEL_PORT = String(spec.ports.otlp);
11445
11448
  env.NEAT_WEB_PORT = String(spec.ports.web);
11446
11449
  }
11450
+ let logFd = null;
11451
+ if (spec) {
11452
+ const logPath = daemonLogPath(spec.projectPath);
11453
+ fsSync.mkdirSync(import_node_path50.default.dirname(logPath), { recursive: true });
11454
+ logFd = fsSync.openSync(logPath, "a");
11455
+ }
11447
11456
  const child = (0, import_node_child_process3.spawn)(process.execPath, [entry2, "start"], {
11448
11457
  detached: true,
11449
- // stderr inherits the orchestrator's fd so the daemon's
11450
- // `BindAuthorityError` message lands in front of the operator instead
11451
- // of being swallowed (issue #341).
11452
- stdio: ["ignore", "ignore", "inherit"],
11458
+ stdio: ["ignore", logFd ?? "ignore", logFd ?? "ignore"],
11453
11459
  env
11454
11460
  });
11455
11461
  child.unref();
11462
+ if (logFd !== null) fsSync.closeSync(logFd);
11456
11463
  return child;
11457
11464
  }
11458
11465
  function openBrowser(url) {
@@ -11641,10 +11648,12 @@ async function runOrchestrator(opts) {
11641
11648
  } else {
11642
11649
  result.steps.browser = openBrowser(dashboardUrl);
11643
11650
  }
11644
- printSummary(result, graph, dashboardUrl);
11651
+ const daemonRunning = result.steps.daemon === "spawned" || result.steps.daemon === "already-running";
11652
+ const daemonLog = daemonRunning ? import_node_path50.default.relative(opts.scanPath, daemonLogPath(opts.scanPath)) : null;
11653
+ printSummary(result, graph, dashboardUrl, daemonLog);
11645
11654
  return result;
11646
11655
  }
11647
- function printSummary(result, graph, dashboardUrl) {
11656
+ function printSummary(result, graph, dashboardUrl, daemonLog) {
11648
11657
  const nodes = [];
11649
11658
  graph.forEachNode((_id, attrs) => nodes.push(attrs));
11650
11659
  const edges = [];
@@ -11666,6 +11675,14 @@ function printSummary(result, graph, dashboardUrl) {
11666
11675
  } else {
11667
11676
  console.log("running locally \u2014 open the dashboard, no token needed");
11668
11677
  }
11678
+ if (daemonLog !== null) {
11679
+ console.log("");
11680
+ console.log(`daemon running in the background (logs: ${daemonLog})`);
11681
+ console.log(
11682
+ "next: run your app or your test suite \u2014 OBSERVED edges fill in as it executes,"
11683
+ );
11684
+ console.log(" and divergences surface where code and runtime disagree.");
11685
+ }
11669
11686
  }
11670
11687
 
11671
11688
  // src/cli-verbs.ts