echoclaw-relay-agent 0.23.0 → 0.23.2
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/cli.js
CHANGED
|
@@ -24,11 +24,11 @@ async function getServiceManager() {
|
|
|
24
24
|
const platform = detectPlatform();
|
|
25
25
|
switch (platform) {
|
|
26
26
|
case "macos": {
|
|
27
|
-
const { LaunchdService } = await import("./launchd-
|
|
27
|
+
const { LaunchdService } = await import("./launchd-6FICJJGR.js");
|
|
28
28
|
return new LaunchdService();
|
|
29
29
|
}
|
|
30
30
|
case "linux": {
|
|
31
|
-
const { SystemdService } = await import("./systemd-
|
|
31
|
+
const { SystemdService } = await import("./systemd-XHWEBL2W.js");
|
|
32
32
|
return new SystemdService();
|
|
33
33
|
}
|
|
34
34
|
case "windows": {
|
|
@@ -110,7 +110,10 @@ import path from "node:path";
|
|
|
110
110
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
111
111
|
function readCurrentVersion() {
|
|
112
112
|
const candidates = [
|
|
113
|
+
path.join(__dirname, "../package.json"),
|
|
114
|
+
// esbuild: dist/ → root
|
|
113
115
|
path.join(__dirname, "../../package.json"),
|
|
116
|
+
// tsc: dist/ota/ → root
|
|
114
117
|
path.join(__dirname, "../../../package.json")
|
|
115
118
|
];
|
|
116
119
|
for (const p of candidates) {
|
|
@@ -734,6 +737,13 @@ async function runDaemon(relay, code, gateway, bridgePort) {
|
|
|
734
737
|
agent.on("message", async (payload) => {
|
|
735
738
|
const payloadType = payload?.type;
|
|
736
739
|
const isChatMsg = payloadType === "chat" || payloadType === "system_prompt" || payloadType === "chat_abort" || payloadType === "chat_history";
|
|
740
|
+
if (payloadType === "ping") {
|
|
741
|
+
try {
|
|
742
|
+
await agent.send({ type: "pong", ts: payload.ts });
|
|
743
|
+
} catch {
|
|
744
|
+
}
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
737
747
|
if (payloadType === "memory_sync") {
|
|
738
748
|
console.log(` [memory_sync] version=${payload.version}`);
|
|
739
749
|
try {
|
package/dist/index.js
CHANGED
|
@@ -466,6 +466,10 @@ var LocalAgent = class extends EventEmitter2 {
|
|
|
466
466
|
async send(payload) {
|
|
467
467
|
if (!payload?.type) return;
|
|
468
468
|
const type = payload.type;
|
|
469
|
+
if (type === "ping") {
|
|
470
|
+
this.emit("message", { type: "pong", ts: payload.ts });
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
469
473
|
if (type === "chat" || type === "system_prompt") {
|
|
470
474
|
if (this.chatHandler) {
|
|
471
475
|
await this.chatHandler.handle(payload, async (msg) => {
|
|
@@ -50,7 +50,15 @@ var LaunchdService = class {
|
|
|
50
50
|
}
|
|
51
51
|
await bootoutService();
|
|
52
52
|
const nodeExe = process.execPath;
|
|
53
|
-
const
|
|
53
|
+
const selfDir = path.dirname(fileURLToPath(import.meta.url));
|
|
54
|
+
const candidates = [
|
|
55
|
+
path.resolve(selfDir, "cli.js"),
|
|
56
|
+
// esbuild: dist/cli.js (same dir)
|
|
57
|
+
path.resolve(selfDir, "..", "cli.js")
|
|
58
|
+
// tsc: dist/service/ → dist/cli.js
|
|
59
|
+
];
|
|
60
|
+
const { existsSync } = await import("node:fs");
|
|
61
|
+
const cliPath = candidates.find((p) => existsSync(p)) ?? candidates[0];
|
|
54
62
|
const args = ["--gateway", "--relay", relayServer];
|
|
55
63
|
if (options?.bridgePort !== void 0) {
|
|
56
64
|
args.push("--bridge-port", String(options.bridgePort));
|
|
@@ -55,7 +55,15 @@ function validatePort(port) {
|
|
|
55
55
|
var SystemdService = class {
|
|
56
56
|
async install(relayServer, options) {
|
|
57
57
|
const nodeExe = process.execPath;
|
|
58
|
-
const
|
|
58
|
+
const selfDir = path.dirname(fileURLToPath(import.meta.url));
|
|
59
|
+
const { existsSync } = await import("node:fs");
|
|
60
|
+
const candidates = [
|
|
61
|
+
path.resolve(selfDir, "cli.js"),
|
|
62
|
+
// esbuild: same dir
|
|
63
|
+
path.resolve(selfDir, "..", "cli.js")
|
|
64
|
+
// tsc: parent dir
|
|
65
|
+
];
|
|
66
|
+
const cliPath = candidates.find((p) => existsSync(p)) ?? candidates[0];
|
|
59
67
|
if (options?.bridgePort !== void 0) {
|
|
60
68
|
validatePort(options.bridgePort);
|
|
61
69
|
}
|
package/package.json
CHANGED