@dench.com/cli 0.3.4 → 0.3.5

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/fs-daemon.ts +21 -35
  2. package/package.json +1 -1
package/fs-daemon.ts CHANGED
@@ -1451,38 +1451,24 @@ async function runInitialSync(argv: string[]): Promise<void> {
1451
1451
  );
1452
1452
  }
1453
1453
 
1454
- /**
1455
- * Only auto-run when this file is the entry point. Tests import named
1456
- * exports (`readMountInfo`, `findMountForPath`, `isFuseFsType`,
1457
- * etc.) and must not trigger the daemon's main loop. The check below
1458
- * tolerates Bun (`process.argv[1]`), the npm-installed wrapper
1459
- * (`require.main === module`), and the dench CLI's `tsx`-based
1460
- * fallback (`import.meta.main`).
1461
- */
1462
- const isDirectEntrypoint = (() => {
1463
- try {
1464
- if (typeof require !== "undefined" && require.main === module) return true;
1465
- } catch {
1466
- // require / module aren't defined in pure ESM mode; fall through.
1467
- }
1468
- // biome-ignore lint/suspicious/noExplicitAny: Bun-specific import.meta property
1469
- if ((import.meta as any).main === true) return true;
1470
- const entry = process.argv[1] ?? "";
1471
- return entry.endsWith("fs-daemon.ts") || entry.endsWith("/fs-daemon");
1472
- })();
1473
-
1474
- if (isDirectEntrypoint) {
1475
- main().catch((error) => {
1476
- console.error(
1477
- `[dench-fs-daemon] fatal: ${
1478
- error instanceof Error ? (error.stack ?? error.message) : String(error)
1479
- }`,
1480
- );
1481
- // Always exit with a non-zero code so the supervisor (in
1482
- // src/lib/daytona/sandbox-bootstrap.ts) can decide whether to
1483
- // restart. Previously we parked the process on a noop interval,
1484
- // which made `pgrep dench-fs-daemon` report "alive" for a daemon
1485
- // that had silently given up syncing.
1486
- process.exit(1);
1487
- });
1488
- }
1454
+ // Always run main(). Earlier versions guarded this on an `isDirectEntrypoint`
1455
+ // heuristic (`process.argv[1].endsWith("/fs-daemon")` etc.), but bun's global
1456
+ // install symlinks the launcher as `/root/.bun/bin/dench-fs-daemon` — that
1457
+ // path ends with `-fs-daemon`, not `/fs-daemon`, so the guard returned false
1458
+ // and the script exited 0 silently. Nothing imports this file as a module any
1459
+ // more (the test suite imports `fs-daemon-mount.ts` for the FUSE helpers), so
1460
+ // the guard is unnecessary and matches the unconditional `main()` call in
1461
+ // `cli/dench.ts`.
1462
+ main().catch((error) => {
1463
+ console.error(
1464
+ `[dench-fs-daemon] fatal: ${
1465
+ error instanceof Error ? (error.stack ?? error.message) : String(error)
1466
+ }`,
1467
+ );
1468
+ // Always exit with a non-zero code so the supervisor (in
1469
+ // src/lib/daytona/sandbox-bootstrap.ts) can decide whether to restart.
1470
+ // Previously we parked the process on a noop interval, which made
1471
+ // `pgrep dench-fs-daemon` report "alive" for a daemon that had silently
1472
+ // given up syncing.
1473
+ process.exit(1);
1474
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dench.com/cli",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Dench agent workspace CLI.",
5
5
  "type": "module",
6
6
  "bin": {