tesseract-agent 0.1.4 → 0.1.6

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-bundle/cli.js +14 -3
  2. package/package.json +1 -1
@@ -7771,9 +7771,15 @@ WantedBy=${o.system ? "multi-user.target" : "default.target"}
7771
7771
  }
7772
7772
  function run(cmd, args) {
7773
7773
  const r = spawnSync(cmd, args, { stdio: "inherit" });
7774
- if (r.status !== 0 && r.error) throw r.error;
7774
+ if (r.error) throw r.error;
7775
+ if (r.status !== 0) throw new Error(`\`${cmd} ${args.join(" ")}\` exited ${r.status}`);
7775
7776
  }
7776
7777
  function install(o) {
7778
+ if (!o.system && typeof process.getuid === "function" && process.getuid() === 0) {
7779
+ throw new Error(
7780
+ "Run `tesseract-agent install` as your normal user (no sudo) \u2014 it installs a per-user systemd service.\nFor a root-managed system service instead, use `sudo tesseract-agent install --system`."
7781
+ );
7782
+ }
7777
7783
  const p = unitPath(o.system);
7778
7784
  mkdirSync3(dirname5(p), { recursive: true });
7779
7785
  writeFileSync3(p, buildUnit(o));
@@ -7824,7 +7830,7 @@ function logs(system, follow) {
7824
7830
  }
7825
7831
 
7826
7832
  // src/cli.ts
7827
- var CLI_VERSION = process.env.CCB_DAEMON_VERSION ?? "0.1.4";
7833
+ var CLI_VERSION = process.env.CCB_DAEMON_VERSION ?? "0.1.6";
7828
7834
  function parseFlags(argv) {
7829
7835
  const out = {};
7830
7836
  for (let i = 0; i < argv.length; i++) {
@@ -7841,7 +7847,7 @@ function parseFlags(argv) {
7841
7847
  }
7842
7848
  return out;
7843
7849
  }
7844
- var HELP = `tesseract-agent \u2014 run agents on this machine remotely, under your account.
7850
+ var HELP = `tesseract-agent v${CLI_VERSION} \u2014 run agents on this machine remotely, under your account.
7845
7851
 
7846
7852
  Usage:
7847
7853
  tesseract-agent login [--token JWT] [--name LABEL] [--api URL] [--relay URL]
@@ -7914,6 +7920,11 @@ async function main() {
7914
7920
  requireLinux("logs");
7915
7921
  logs(system, flags["no-follow"] !== true);
7916
7922
  break;
7923
+ case "--version":
7924
+ case "-v":
7925
+ case "version":
7926
+ console.log(CLI_VERSION);
7927
+ break;
7917
7928
  case void 0:
7918
7929
  case "--help":
7919
7930
  case "-h":
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tesseract-agent",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "license": "UNLICENSED",
5
5
  "publishConfig": {
6
6
  "access": "public"