tesseract-agent 0.9.29 → 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.
- package/dist-bundle/cli.js +70 -43
- package/package.json +1 -1
package/dist-bundle/cli.js
CHANGED
|
@@ -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"
|
|
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 {
|
|
@@ -101020,13 +101046,15 @@ async function runDaemon(opts = {}) {
|
|
|
101020
101046
|
log9("local listener failed to start", e.message);
|
|
101021
101047
|
}
|
|
101022
101048
|
writeStatus2({ deviceId: deviceId2, connected: false });
|
|
101023
|
-
|
|
101024
|
-
|
|
101025
|
-
|
|
101049
|
+
if (ownsMachine) {
|
|
101050
|
+
try {
|
|
101051
|
+
registerNativeHost({ daemonDir: daemonDir2(), log: log9 });
|
|
101052
|
+
} catch {
|
|
101053
|
+
}
|
|
101026
101054
|
}
|
|
101027
101055
|
const syncActivity = () => {
|
|
101028
101056
|
try {
|
|
101029
|
-
if (readActivityTrackingEnabled())
|
|
101057
|
+
if (ownsMachine && readActivityTrackingEnabled())
|
|
101030
101058
|
activityTracker.start();
|
|
101031
101059
|
else
|
|
101032
101060
|
activityTracker.stop();
|
|
@@ -101704,12 +101732,8 @@ async function runDaemon(opts = {}) {
|
|
|
101704
101732
|
startFileProviderBridge(log9);
|
|
101705
101733
|
startAutofillBridge(log9);
|
|
101706
101734
|
}
|
|
101707
|
-
|
|
101708
|
-
if (ownsMachine || meshAppShouldRun) {
|
|
101709
|
-
if (meshAppShouldRun)
|
|
101710
|
-
log9("mesh app: no daemon owns this machine \u2014 running the node here");
|
|
101735
|
+
if (ownsMachine)
|
|
101711
101736
|
startMeshes(log9);
|
|
101712
|
-
}
|
|
101713
101737
|
const who = c.userId ? `user ${c.userId}` : "no account (unclaimed machine)";
|
|
101714
101738
|
log9(`started \u2014 device ${c.deviceId}, ${who}, relay ${c.backendOrigin}, local :${localInfo?.localPort ?? "off"}, version ${VERSION2}`);
|
|
101715
101739
|
await refresh();
|
|
@@ -101733,11 +101757,6 @@ var MAX_IMAGE_BYTES2 = 10 * 1024 * 1024;
|
|
|
101733
101757
|
// ../../packages/host-core/dist/host-daemon-entry.js
|
|
101734
101758
|
init_daemon_settings();
|
|
101735
101759
|
|
|
101736
|
-
// ../../packages/host-core/dist/clipboard/clipboard-sync.js
|
|
101737
|
-
var MAX_IMAGE_BYTES3 = 10 * 1024 * 1024;
|
|
101738
|
-
var OVERSIZED_BYTES = 512 * 1024;
|
|
101739
|
-
var CHUNK_BYTES = 256 * 1024;
|
|
101740
|
-
|
|
101741
101760
|
// ../../packages/host-core/dist/mesh/mesh-ipc.js
|
|
101742
101761
|
init_dist();
|
|
101743
101762
|
|
|
@@ -101934,6 +101953,30 @@ function meshIdOf(cert) {
|
|
|
101934
101953
|
// ../../packages/host-core/dist/mesh/netd-client.js
|
|
101935
101954
|
var MAX_LINE = 1024 * 1024;
|
|
101936
101955
|
|
|
101956
|
+
// ../../packages/host-core/dist/service/exec.js
|
|
101957
|
+
import { execFile as execFile10, spawn as spawn14 } from "node:child_process";
|
|
101958
|
+
import { promisify as promisify6 } from "node:util";
|
|
101959
|
+
var run4 = promisify6(execFile10);
|
|
101960
|
+
function runInherit(cmd, args) {
|
|
101961
|
+
return new Promise((resolve16) => {
|
|
101962
|
+
const p = spawn14(cmd, args, { stdio: "inherit" });
|
|
101963
|
+
p.on("error", () => resolve16());
|
|
101964
|
+
p.on("close", () => resolve16());
|
|
101965
|
+
});
|
|
101966
|
+
}
|
|
101967
|
+
|
|
101968
|
+
// ../../packages/host-core/dist/net-service/systemd-system.js
|
|
101969
|
+
var UNIT = "tesseract-netd.service";
|
|
101970
|
+
var UNIT_PATH = `/etc/systemd/system/${UNIT}`;
|
|
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
|
+
|
|
101937
101980
|
// ../../packages/host-core/dist/host-daemon-entry.js
|
|
101938
101981
|
init_credentials();
|
|
101939
101982
|
|
|
@@ -101950,18 +101993,6 @@ import { writeFileSync as writeFileSync39, existsSync as existsSync36, mkdirSync
|
|
|
101950
101993
|
import { dirname as dirname28, join as join71 } from "node:path";
|
|
101951
101994
|
import { homedir as homedir12, userInfo as userInfo2 } from "node:os";
|
|
101952
101995
|
|
|
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
101996
|
// ../../packages/host-core/dist/service/types.js
|
|
101966
101997
|
var SERVICE_LABEL_BASE = "dev.tesseract.app.host";
|
|
101967
101998
|
|
|
@@ -102246,10 +102277,6 @@ function getServiceController(instanceId) {
|
|
|
102246
102277
|
}
|
|
102247
102278
|
}
|
|
102248
102279
|
|
|
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
102280
|
// ../../packages/host-core/dist/index.js
|
|
102254
102281
|
init_dist();
|
|
102255
102282
|
init_serpapi_runner();
|