@amaster.ai/employee-runtime-connector 0.1.0-beta.11 → 0.1.0-beta.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/README.md +0 -2
- package/dist/amaster-runtime-daemon.mjs +91 -1177
- package/dist/amaster-runtime.mjs +1 -23
- package/package.json +1 -1
package/dist/amaster-runtime.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { dirname, join, resolve } from "node:path";
|
|
|
5
5
|
import { homedir, hostname } from "node:os";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
|
|
8
|
-
const CONNECTOR_VERSION = "0.1.0-beta.
|
|
8
|
+
const CONNECTOR_VERSION = "0.1.0-beta.2";
|
|
9
9
|
|
|
10
10
|
const CAPABILITIES = [
|
|
11
11
|
"remote_registration",
|
|
@@ -91,27 +91,6 @@ const envFile = process.env.AMASTER_RUNTIME_ENV_FILE || join(configDir, "runtime
|
|
|
91
91
|
const pidFile = process.env.AMASTER_RUNTIME_PID_FILE || join(configDir, "runtime-daemon.pid");
|
|
92
92
|
const logFile = process.env.AMASTER_RUNTIME_LOG_FILE || join(configDir, "runtime-daemon.log");
|
|
93
93
|
|
|
94
|
-
function assertDaemonPathCoherence() {
|
|
95
|
-
const explicitPaths = [
|
|
96
|
-
["AMASTER_RUNTIME_ENV_FILE", process.env.AMASTER_RUNTIME_ENV_FILE],
|
|
97
|
-
["AMASTER_RUNTIME_PID_FILE", process.env.AMASTER_RUNTIME_PID_FILE],
|
|
98
|
-
["AMASTER_RUNTIME_LOG_FILE", process.env.AMASTER_RUNTIME_LOG_FILE],
|
|
99
|
-
].map(([name, value]) => [name, String(value ?? "").trim()])
|
|
100
|
-
.filter(([, value]) => value);
|
|
101
|
-
if (explicitPaths.length === 0 || explicitPaths.length === 3) return;
|
|
102
|
-
const mismatched = explicitPaths.filter(([, value]) => dirname(resolve(value)) !== configDir);
|
|
103
|
-
if (mismatched.length === 0) return;
|
|
104
|
-
const mismatchSummary = mismatched
|
|
105
|
-
.map(([name, value]) => `${name}=${resolve(value)}`)
|
|
106
|
-
.join(", ");
|
|
107
|
-
const suggestedStateHome = dirname(resolve(mismatched[0][1]));
|
|
108
|
-
throw new Error([
|
|
109
|
-
`${mismatchSummary} is outside runtime state home ${configDir}.`,
|
|
110
|
-
`Set AMASTER_RUNTIME_STATE_HOME=${suggestedStateHome} so env/pid/log state shares one root,`,
|
|
111
|
-
"or explicitly set AMASTER_RUNTIME_ENV_FILE, AMASTER_RUNTIME_PID_FILE, and AMASTER_RUNTIME_LOG_FILE.",
|
|
112
|
-
].join(" "));
|
|
113
|
-
}
|
|
114
|
-
|
|
115
94
|
function exactSemver(value) {
|
|
116
95
|
const normalized = typeof value === "string" ? value.trim() : "";
|
|
117
96
|
const match = normalized.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/);
|
|
@@ -785,7 +764,6 @@ function spawnDaemonForeground(args = []) {
|
|
|
785
764
|
}
|
|
786
765
|
|
|
787
766
|
function commandDaemon(argv) {
|
|
788
|
-
assertDaemonPathCoherence();
|
|
789
767
|
const [action = "status", ...rest] = argv;
|
|
790
768
|
if (action === "status") {
|
|
791
769
|
commandStatus();
|