@jabezpauls/agentbox 0.1.13 → 0.1.15

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/agentbox.mjs +27 -18
  2. package/package.json +1 -1
package/dist/agentbox.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // agentbox-cli v0.1.13
2
+ // agentbox-cli v0.1.15
3
3
  import { createRequire as __agentboxCreateRequire } from "node:module";
4
4
  const require = __agentboxCreateRequire(import.meta.url);
5
5
  var __create = Object.create;
@@ -3868,7 +3868,7 @@ function parseSize(raw2) {
3868
3868
  }
3869
3869
 
3870
3870
  // src/version.ts
3871
- var VERSION = true ? "v0.1.13" : "0.0.0-dev";
3871
+ var VERSION = true ? "v0.1.15" : "0.0.0-dev";
3872
3872
  var STANDALONE = typeof __AGENTBOX_STANDALONE__ === "boolean" && __AGENTBOX_STANDALONE__;
3873
3873
  var MIN_NODE_MAJOR = 20;
3874
3874
  function nodeMajor(version = process.versions.node) {
@@ -5375,7 +5375,8 @@ function homeDir(ctx) {
5375
5375
  function sshDir(ctx) {
5376
5376
  return path5.join(homeDir(ctx), ".ssh");
5377
5377
  }
5378
- function cliCommand(platform) {
5378
+ function cliCommand(platform, standalone = STANDALONE) {
5379
+ if (standalone) return [process.execPath];
5379
5380
  const script = path5.resolve(process.argv[1] ?? "agentbox");
5380
5381
  if (platform !== "win32") {
5381
5382
  try {
@@ -11746,9 +11747,20 @@ function unitDir(env = process.env, home2 = os9.homedir()) {
11746
11747
  const xdg = env.XDG_CONFIG_HOME;
11747
11748
  return path26.join(xdg && path26.isAbsolute(xdg) ? xdg : path26.join(home2, ".config"), "systemd", "user");
11748
11749
  }
11749
- function execStart(execPath = process.execPath, script = process.argv[1]) {
11750
- const isSea = script === void 0 || path26.resolve(script) === path26.resolve(execPath);
11751
- return isSea ? [execPath, "node", "run"] : [execPath, path26.resolve(script), "node", "run"];
11750
+ function runningAsSea() {
11751
+ if (STANDALONE) return true;
11752
+ try {
11753
+ const sea = process.getBuiltinModule?.("node:sea");
11754
+ return typeof sea?.isSea === "function" && sea.isSea();
11755
+ } catch {
11756
+ return false;
11757
+ }
11758
+ }
11759
+ function isStandalone(execPath, script, sea = runningAsSea()) {
11760
+ return sea || script === void 0 || path26.resolve(script) === path26.resolve(execPath);
11761
+ }
11762
+ function execStart(execPath = process.execPath, script = process.argv[1], sea = runningAsSea()) {
11763
+ return isStandalone(execPath, script, sea) ? [execPath, "node", "run"] : [execPath, path26.resolve(script), "node", "run"];
11752
11764
  }
11753
11765
  function quote(arg) {
11754
11766
  return `"${arg.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/%/g, "%%")}"`;
@@ -11822,11 +11834,8 @@ function regExe(env = process.env) {
11822
11834
  const root = env.SystemRoot && path27.win32.isAbsolute(env.SystemRoot) ? env.SystemRoot : "C:\\Windows";
11823
11835
  return path27.win32.join(root, "System32", "reg.exe");
11824
11836
  }
11825
- function standalone(execPath, script) {
11826
- return script === void 0 || path27.resolve(script) === path27.resolve(execPath);
11827
- }
11828
- function guiExecutable(execPath = process.execPath, script = process.argv[1]) {
11829
- if (!standalone(execPath, script)) {
11837
+ function guiExecutable(execPath = process.execPath, script = process.argv[1], sea = runningAsSea()) {
11838
+ if (!isStandalone(execPath, script, sea)) {
11830
11839
  return {
11831
11840
  problem: "the Windows sign-in entry needs the standalone agentbox.exe and agentbox-node.exe (this is agentbox.mjs under Node, which would open a console window at every sign-in); run `agentbox node run` yourself, or install the standalone executables"
11832
11841
  };
@@ -11838,8 +11847,8 @@ function guiExecutable(execPath = process.execPath, script = process.argv[1]) {
11838
11847
  function runEntry(gui) {
11839
11848
  return `"${gui}" node supervise`;
11840
11849
  }
11841
- function runCommandLine(execPath = process.execPath, script = process.argv[1]) {
11842
- if (!standalone(execPath, script)) return [execPath, path27.resolve(script), "node", "run"];
11850
+ function runCommandLine(execPath = process.execPath, script = process.argv[1], sea = runningAsSea()) {
11851
+ if (!isStandalone(execPath, script, sea)) return [execPath, path27.resolve(script), "node", "run"];
11843
11852
  const dir = path27.dirname(execPath);
11844
11853
  const exe = path27.basename(execPath).toLowerCase() === GUI_EXE ? path27.join(dir, CONSOLE_EXE) : execPath;
11845
11854
  return [exe, "node", "run"];
@@ -12760,15 +12769,15 @@ async function runNode(o) {
12760
12769
  if (checking || o.checkUpdates === false) return;
12761
12770
  checking = true;
12762
12771
  try {
12763
- const standalone2 = execStart().length === 3;
12772
+ const standalone = execStart().length === 3;
12764
12773
  const gui = path30.join(path30.dirname(process.execPath), GUI_EXE);
12765
12774
  const report = await checkForUpdate({
12766
12775
  policy: policy.policy.updates,
12767
12776
  running: o.version,
12768
12777
  // Only the standalone executable replaces itself; agentbox.mjs under Node does not.
12769
- nodePath: standalone2 ? process.execPath : null,
12778
+ nodePath: standalone ? process.execPath : null,
12770
12779
  // Windows: the windowless copy beside it, which the sign-in entry starts.
12771
- ...win && standalone2 && fs22.existsSync(gui) ? { nodeGuiPath: gui } : {},
12780
+ ...win && standalone && fs22.existsSync(gui) ? { nodeGuiPath: gui } : {},
12772
12781
  ...fs22.existsSync(herdrBin) ? { herdr: { path: herdrBin, version: HERDR_VERSION } } : {},
12773
12782
  ...installedClaude(claude) ? { claude: { path: claude.bin, version: installedClaude(claude), versionFile: claude.versionFile } } : {},
12774
12783
  // Agents live in herdr: herdr and Claude Code are replaced only while none runs.
@@ -14392,12 +14401,12 @@ function nodeCredentials(env, platform = process.platform) {
14392
14401
  }
14393
14402
  return candidates.find((f) => fs26.existsSync(f)) ?? null;
14394
14403
  }
14395
- function signedUpdatesOnly(env, platform = process.platform, standalone2 = STANDALONE) {
14404
+ function signedUpdatesOnly(env, platform = process.platform, standalone = STANDALONE) {
14396
14405
  const creds = nodeCredentials(env, platform);
14397
14406
  if (creds) {
14398
14407
  return `this machine is joined to a box as a node (${creds}), so agentbox here updates only from signed releases, never from a box: the node checks for them itself (\`updates\` in its policy.json), or see https://github.com/jabezpauls/agentbox/releases`;
14399
14408
  }
14400
- if (standalone2) {
14409
+ if (standalone) {
14401
14410
  return "this is the standalone agentbox, which updates only from signed releases, never from a box; download the latest from https://github.com/jabezpauls/agentbox/releases";
14402
14411
  }
14403
14412
  return null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jabezpauls/agentbox",
3
3
  "type": "module",
4
- "version": "0.1.13",
4
+ "version": "0.1.15",
5
5
  "description": "agentbox from your own machine: sign in, attach, move files, mount the workspace.",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/jabezpauls/agentbox/blob/main/docs/cli.md",