tesseract-agent 0.9.30 → 0.9.31

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 +48 -39
  2. package/package.json +1 -1
@@ -98225,6 +98225,19 @@ function meshManager() {
98225
98225
  return singleton3;
98226
98226
  }
98227
98227
 
98228
+ // ../../packages/host-core/dist/mesh/start-meshes.js
98229
+ function startMeshes(log9) {
98230
+ const ids = listMeshIds();
98231
+ if (ids.length <= 1) {
98232
+ const started2 = meshNode().start();
98233
+ log9(started2.ok ? "mesh: node up" : `mesh: not started \u2014 ${started2.reason}`);
98234
+ return;
98235
+ }
98236
+ for (const r of meshManager().startAll()) {
98237
+ log9(r.ok ? `mesh ${r.meshId}: up` : `mesh ${r.meshId}: not started \u2014 ${r.reason}`);
98238
+ }
98239
+ }
98240
+
98228
98241
  // ../../packages/host-core/dist/drops/receive-ui.js
98229
98242
  import { basename as basename12, dirname as dirname25 } from "node:path";
98230
98243
  var log5 = (...a) => console.log("[drops]", ...a);
@@ -100513,17 +100526,6 @@ function backoff2() {
100513
100526
 
100514
100527
  // ../../packages/host-core/dist/daemon-runtime.js
100515
100528
  var daemonClipboardSync = null;
100516
- function startMeshes(log9) {
100517
- const ids = listMeshIds();
100518
- if (ids.length <= 1) {
100519
- const started2 = meshNode().start();
100520
- log9(started2.ok ? "mesh: node up" : `mesh: not started \u2014 ${started2.reason}`);
100521
- return;
100522
- }
100523
- for (const r of meshManager().startAll()) {
100524
- log9(r.ok ? `mesh ${r.meshId}: up` : `mesh ${r.meshId}: not started \u2014 ${r.reason}`);
100525
- }
100526
- }
100527
100529
  var REFRESH_INTERVAL_MS = 12 * 60 * 60 * 1e3;
100528
100530
  var GRACEFUL_KILL_MS = 4e3;
100529
100531
  async function runDaemon(opts = {}) {
@@ -100585,7 +100587,6 @@ async function runDaemon(opts = {}) {
100585
100587
  } catch {
100586
100588
  }
100587
100589
  }
100588
- const STANDALONE_MESH_APP = process.env.CCB_MESH_APP === "1";
100589
100590
  const WE_ARE_RDESK_ONLY = process.env.CCB_RDESK_ONLY === "1" || process.env.CCB_MESH_ONLY === "1";
100590
100591
  async function takeoverMachine() {
100591
100592
  let lockPid = 0;
@@ -100672,7 +100673,7 @@ async function runDaemon(opts = {}) {
100672
100673
  } catch {
100673
100674
  }
100674
100675
  }
100675
- const standaloneViewer = process.env.CCB_RDESK_ROLE === "client" || STANDALONE_MESH_APP;
100676
+ const standaloneViewer = process.env.CCB_RDESK_ROLE === "client";
100676
100677
  if (!standaloneViewer) {
100677
100678
  registerSelfAsDaemon(VERSION2);
100678
100679
  if (await takeoverMachine()) {
@@ -100893,6 +100894,13 @@ async function runDaemon(opts = {}) {
100893
100894
  const eapp = electronModule()?.app;
100894
100895
  if (eapp) {
100895
100896
  eapp.on("before-quit", (e) => {
100897
+ if (standaloneViewer) {
100898
+ try {
100899
+ log9("APP before-quit \u2014 allowed (standalone app, not the daemon)");
100900
+ } catch {
100901
+ }
100902
+ return;
100903
+ }
100896
100904
  if (mergedProcess) {
100897
100905
  if (deliberateMergedQuit()) {
100898
100906
  try {
@@ -100923,6 +100931,13 @@ async function runDaemon(opts = {}) {
100923
100931
  }
100924
100932
  });
100925
100933
  eapp.on("will-quit", (e) => {
100934
+ if (standaloneViewer) {
100935
+ try {
100936
+ log9("APP will-quit \u2014 allowed (standalone app)");
100937
+ } catch {
100938
+ }
100939
+ return;
100940
+ }
100926
100941
  if (mergedProcess) {
100927
100942
  if (!deliberateMergedQuit()) {
100928
100943
  try {
@@ -100945,6 +100960,17 @@ async function runDaemon(opts = {}) {
100945
100960
  }
100946
100961
  });
100947
100962
  eapp.on("window-all-closed", () => {
100963
+ if (standaloneViewer) {
100964
+ try {
100965
+ log9("APP window-all-closed \u2014 quitting (standalone app)");
100966
+ } catch {
100967
+ }
100968
+ try {
100969
+ electronModule()?.app?.quit();
100970
+ } catch {
100971
+ }
100972
+ return;
100973
+ }
100948
100974
  try {
100949
100975
  log9("APP window-all-closed (kept alive \u2014 no auto-quit)");
100950
100976
  } catch {
@@ -101706,28 +101732,8 @@ async function runDaemon(opts = {}) {
101706
101732
  startFileProviderBridge(log9);
101707
101733
  startAutofillBridge(log9);
101708
101734
  }
101709
- const meshAppShouldRun = STANDALONE_MESH_APP && !lockHeldByAnother();
101710
- if (ownsMachine || meshAppShouldRun) {
101711
- if (meshAppShouldRun)
101712
- log9("mesh app: no daemon owns this machine \u2014 running the node here");
101735
+ if (ownsMachine)
101713
101736
  startMeshes(log9);
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
- }
101731
101737
  const who = c.userId ? `user ${c.userId}` : "no account (unclaimed machine)";
101732
101738
  log9(`started \u2014 device ${c.deviceId}, ${who}, relay ${c.backendOrigin}, local :${localInfo?.localPort ?? "off"}, version ${VERSION2}`);
101733
101739
  await refresh();
@@ -101751,11 +101757,6 @@ var MAX_IMAGE_BYTES2 = 10 * 1024 * 1024;
101751
101757
  // ../../packages/host-core/dist/host-daemon-entry.js
101752
101758
  init_daemon_settings();
101753
101759
 
101754
- // ../../packages/host-core/dist/clipboard/clipboard-sync.js
101755
- var MAX_IMAGE_BYTES3 = 10 * 1024 * 1024;
101756
- var OVERSIZED_BYTES = 512 * 1024;
101757
- var CHUNK_BYTES = 256 * 1024;
101758
-
101759
101760
  // ../../packages/host-core/dist/mesh/mesh-ipc.js
101760
101761
  init_dist();
101761
101762
 
@@ -101968,6 +101969,14 @@ function runInherit(cmd, args) {
101968
101969
  var UNIT = "tesseract-netd.service";
101969
101970
  var UNIT_PATH = `/etc/systemd/system/${UNIT}`;
101970
101971
 
101972
+ // ../../packages/host-core/dist/mesh/machine-owner.js
101973
+ init_credentials();
101974
+
101975
+ // ../../packages/host-core/dist/clipboard/clipboard-sync.js
101976
+ var MAX_IMAGE_BYTES3 = 10 * 1024 * 1024;
101977
+ var OVERSIZED_BYTES = 512 * 1024;
101978
+ var CHUNK_BYTES = 256 * 1024;
101979
+
101971
101980
  // ../../packages/host-core/dist/host-daemon-entry.js
101972
101981
  init_credentials();
101973
101982
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tesseract-agent",
3
- "version": "0.9.30",
3
+ "version": "0.9.31",
4
4
  "license": "UNLICENSED",
5
5
  "publishConfig": {
6
6
  "access": "public",