tesseract-agent 0.9.29 → 0.9.30

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 +38 -20
  2. package/package.json +1 -1
@@ -101020,13 +101020,15 @@ async function runDaemon(opts = {}) {
101020
101020
  log9("local listener failed to start", e.message);
101021
101021
  }
101022
101022
  writeStatus2({ deviceId: deviceId2, connected: false });
101023
- try {
101024
- registerNativeHost({ daemonDir: daemonDir2(), log: log9 });
101025
- } catch {
101023
+ if (ownsMachine) {
101024
+ try {
101025
+ registerNativeHost({ daemonDir: daemonDir2(), log: log9 });
101026
+ } catch {
101027
+ }
101026
101028
  }
101027
101029
  const syncActivity = () => {
101028
101030
  try {
101029
- if (readActivityTrackingEnabled())
101031
+ if (ownsMachine && readActivityTrackingEnabled())
101030
101032
  activityTracker.start();
101031
101033
  else
101032
101034
  activityTracker.stop();
@@ -101710,6 +101712,22 @@ async function runDaemon(opts = {}) {
101710
101712
  log9("mesh app: no daemon owns this machine \u2014 running the node here");
101711
101713
  startMeshes(log9);
101712
101714
  }
101715
+ if (meshAppShouldRun) {
101716
+ let handedBack = false;
101717
+ const handover = setInterval(() => {
101718
+ if (handedBack || !lockHeldByAnother())
101719
+ return;
101720
+ handedBack = true;
101721
+ log9("mesh app: a daemon now owns this machine \u2014 handing the node back to it");
101722
+ try {
101723
+ meshManager().stopAll();
101724
+ meshNode().stop();
101725
+ } catch {
101726
+ }
101727
+ clearInterval(handover);
101728
+ }, 15e3);
101729
+ handover.unref?.();
101730
+ }
101713
101731
  const who = c.userId ? `user ${c.userId}` : "no account (unclaimed machine)";
101714
101732
  log9(`started \u2014 device ${c.deviceId}, ${who}, relay ${c.backendOrigin}, local :${localInfo?.localPort ?? "off"}, version ${VERSION2}`);
101715
101733
  await refresh();
@@ -101934,6 +101952,22 @@ function meshIdOf(cert) {
101934
101952
  // ../../packages/host-core/dist/mesh/netd-client.js
101935
101953
  var MAX_LINE = 1024 * 1024;
101936
101954
 
101955
+ // ../../packages/host-core/dist/service/exec.js
101956
+ import { execFile as execFile10, spawn as spawn14 } from "node:child_process";
101957
+ import { promisify as promisify6 } from "node:util";
101958
+ var run4 = promisify6(execFile10);
101959
+ function runInherit(cmd, args) {
101960
+ return new Promise((resolve16) => {
101961
+ const p = spawn14(cmd, args, { stdio: "inherit" });
101962
+ p.on("error", () => resolve16());
101963
+ p.on("close", () => resolve16());
101964
+ });
101965
+ }
101966
+
101967
+ // ../../packages/host-core/dist/net-service/systemd-system.js
101968
+ var UNIT = "tesseract-netd.service";
101969
+ var UNIT_PATH = `/etc/systemd/system/${UNIT}`;
101970
+
101937
101971
  // ../../packages/host-core/dist/host-daemon-entry.js
101938
101972
  init_credentials();
101939
101973
 
@@ -101950,18 +101984,6 @@ import { writeFileSync as writeFileSync39, existsSync as existsSync36, mkdirSync
101950
101984
  import { dirname as dirname28, join as join71 } from "node:path";
101951
101985
  import { homedir as homedir12, userInfo as userInfo2 } from "node:os";
101952
101986
 
101953
- // ../../packages/host-core/dist/service/exec.js
101954
- import { execFile as execFile10, spawn as spawn14 } from "node:child_process";
101955
- import { promisify as promisify6 } from "node:util";
101956
- var run4 = promisify6(execFile10);
101957
- function runInherit(cmd, args) {
101958
- return new Promise((resolve16) => {
101959
- const p = spawn14(cmd, args, { stdio: "inherit" });
101960
- p.on("error", () => resolve16());
101961
- p.on("close", () => resolve16());
101962
- });
101963
- }
101964
-
101965
101987
  // ../../packages/host-core/dist/service/types.js
101966
101988
  var SERVICE_LABEL_BASE = "dev.tesseract.app.host";
101967
101989
 
@@ -102246,10 +102268,6 @@ function getServiceController(instanceId) {
102246
102268
  }
102247
102269
  }
102248
102270
 
102249
- // ../../packages/host-core/dist/net-service/systemd-system.js
102250
- var UNIT = "tesseract-netd.service";
102251
- var UNIT_PATH = `/etc/systemd/system/${UNIT}`;
102252
-
102253
102271
  // ../../packages/host-core/dist/index.js
102254
102272
  init_dist();
102255
102273
  init_serpapi_runner();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tesseract-agent",
3
- "version": "0.9.29",
3
+ "version": "0.9.30",
4
4
  "license": "UNLICENSED",
5
5
  "publishConfig": {
6
6
  "access": "public",