@hasna/machines 0.0.44 → 0.0.45

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/index.js CHANGED
@@ -10590,7 +10590,7 @@ function runDoctor(machineId, options = {}) {
10590
10590
  // src/commands/daemon.ts
10591
10591
  import { execFileSync } from "child_process";
10592
10592
  import { chmodSync, existsSync as existsSync8, readFileSync as readFileSync6, statSync, mkdirSync as mkdirSync2, writeFileSync as writeFileSync4 } from "fs";
10593
- import { dirname as dirname4 } from "path";
10593
+ import { delimiter, dirname as dirname4 } from "path";
10594
10594
  import { platform as osPlatform } from "os";
10595
10595
  var DEFAULT_SERVICE_NAME = "machines-agent";
10596
10596
  var DEFAULT_EXECUTABLE = "/usr/local/bin/machines-agent";
@@ -10980,15 +10980,27 @@ WantedBy=${options.mode === "system" ? "multi-user.target" : "default.target"}
10980
10980
  `;
10981
10981
  }
10982
10982
  function daemonProgramArguments(options) {
10983
- const bunRuntime = siblingBunRuntime(options.executable);
10983
+ const bunRuntime = bunRuntimeForExecutable(options.executable);
10984
10984
  const base = bunRuntime ? [bunRuntime, options.executable] : [options.executable];
10985
10985
  return [...base, "--interval-ms", String(options.intervalMs)];
10986
10986
  }
10987
- function siblingBunRuntime(executable) {
10987
+ function bunRuntimeForExecutable(executable) {
10988
10988
  if (!isBunShebangScript(executable))
10989
10989
  return null;
10990
- const candidate = `${dirname4(executable)}/bun`;
10991
- return isExecutableFile(candidate) ? candidate : null;
10990
+ for (const candidate of bunRuntimeCandidates(executable)) {
10991
+ if (isExecutableFile(candidate))
10992
+ return candidate;
10993
+ }
10994
+ return null;
10995
+ }
10996
+ function bunRuntimeCandidates(executable) {
10997
+ const candidates = [
10998
+ `${dirname4(executable)}/bun`,
10999
+ process.env["BUN_INSTALL"] ? `${process.env["BUN_INSTALL"]}/bin/bun` : null,
11000
+ process.env["HOME"] ? `${process.env["HOME"]}/.bun/bin/bun` : null,
11001
+ ...(process.env["PATH"] ?? "").split(delimiter).filter(Boolean).map((entry) => `${entry}/bun`)
11002
+ ].filter((value) => Boolean(value));
11003
+ return [...new Set(candidates)];
10992
11004
  }
10993
11005
  function isBunShebangScript(executable) {
10994
11006
  try {
package/dist/index.js CHANGED
@@ -13729,7 +13729,7 @@ function renderDomainMapping(domain) {
13729
13729
  // src/commands/daemon.ts
13730
13730
  import { execFileSync as execFileSync2 } from "child_process";
13731
13731
  import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync4, statSync, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
13732
- import { dirname as dirname4 } from "path";
13732
+ import { delimiter, dirname as dirname4 } from "path";
13733
13733
  import { platform as osPlatform } from "os";
13734
13734
  var DEFAULT_SERVICE_NAME = "machines-agent";
13735
13735
  var DEFAULT_EXECUTABLE = "/usr/local/bin/machines-agent";
@@ -14142,15 +14142,27 @@ WantedBy=${options.mode === "system" ? "multi-user.target" : "default.target"}
14142
14142
  `;
14143
14143
  }
14144
14144
  function daemonProgramArguments(options) {
14145
- const bunRuntime = siblingBunRuntime(options.executable);
14145
+ const bunRuntime = bunRuntimeForExecutable(options.executable);
14146
14146
  const base = bunRuntime ? [bunRuntime, options.executable] : [options.executable];
14147
14147
  return [...base, "--interval-ms", String(options.intervalMs)];
14148
14148
  }
14149
- function siblingBunRuntime(executable) {
14149
+ function bunRuntimeForExecutable(executable) {
14150
14150
  if (!isBunShebangScript(executable))
14151
14151
  return null;
14152
- const candidate = `${dirname4(executable)}/bun`;
14153
- return isExecutableFile(candidate) ? candidate : null;
14152
+ for (const candidate of bunRuntimeCandidates(executable)) {
14153
+ if (isExecutableFile(candidate))
14154
+ return candidate;
14155
+ }
14156
+ return null;
14157
+ }
14158
+ function bunRuntimeCandidates(executable) {
14159
+ const candidates = [
14160
+ `${dirname4(executable)}/bun`,
14161
+ process.env["BUN_INSTALL"] ? `${process.env["BUN_INSTALL"]}/bin/bun` : null,
14162
+ process.env["HOME"] ? `${process.env["HOME"]}/.bun/bin/bun` : null,
14163
+ ...(process.env["PATH"] ?? "").split(delimiter).filter(Boolean).map((entry) => `${entry}/bun`)
14164
+ ].filter((value) => Boolean(value));
14165
+ return [...new Set(candidates)];
14154
14166
  }
14155
14167
  function isBunShebangScript(executable) {
14156
14168
  try {
package/dist/mcp/index.js CHANGED
@@ -5955,7 +5955,7 @@ function diffMachines(leftMachineId, rightMachineId) {
5955
5955
 
5956
5956
  // src/commands/daemon.ts
5957
5957
  import { chmodSync, existsSync as existsSync6, readFileSync as readFileSync4, statSync, mkdirSync as mkdirSync2, writeFileSync as writeFileSync3 } from "fs";
5958
- import { dirname as dirname4 } from "path";
5958
+ import { delimiter, dirname as dirname4 } from "path";
5959
5959
  import { platform as osPlatform } from "os";
5960
5960
  var DEFAULT_SERVICE_NAME = "machines-agent";
5961
5961
  var DEFAULT_EXECUTABLE = "/usr/local/bin/machines-agent";
@@ -6219,15 +6219,27 @@ WantedBy=${options.mode === "system" ? "multi-user.target" : "default.target"}
6219
6219
  `;
6220
6220
  }
6221
6221
  function daemonProgramArguments(options) {
6222
- const bunRuntime = siblingBunRuntime(options.executable);
6222
+ const bunRuntime = bunRuntimeForExecutable(options.executable);
6223
6223
  const base = bunRuntime ? [bunRuntime, options.executable] : [options.executable];
6224
6224
  return [...base, "--interval-ms", String(options.intervalMs)];
6225
6225
  }
6226
- function siblingBunRuntime(executable) {
6226
+ function bunRuntimeForExecutable(executable) {
6227
6227
  if (!isBunShebangScript(executable))
6228
6228
  return null;
6229
- const candidate = `${dirname4(executable)}/bun`;
6230
- return isExecutableFile(candidate) ? candidate : null;
6229
+ for (const candidate of bunRuntimeCandidates(executable)) {
6230
+ if (isExecutableFile(candidate))
6231
+ return candidate;
6232
+ }
6233
+ return null;
6234
+ }
6235
+ function bunRuntimeCandidates(executable) {
6236
+ const candidates = [
6237
+ `${dirname4(executable)}/bun`,
6238
+ process.env["BUN_INSTALL"] ? `${process.env["BUN_INSTALL"]}/bin/bun` : null,
6239
+ process.env["HOME"] ? `${process.env["HOME"]}/.bun/bin/bun` : null,
6240
+ ...(process.env["PATH"] ?? "").split(delimiter).filter(Boolean).map((entry) => `${entry}/bun`)
6241
+ ].filter((value) => Boolean(value));
6242
+ return [...new Set(candidates)];
6231
6243
  }
6232
6244
  function isBunShebangScript(executable) {
6233
6245
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/machines",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "Machine fleet management CLI + MCP for developers",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",