@alfe.ai/gateway 0.0.14 → 0.0.16
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/health.js +7 -11
- package/package.json +3 -3
package/dist/health.js
CHANGED
|
@@ -4,7 +4,7 @@ import { mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import pino from "pino";
|
|
7
|
-
import { chmodSync, existsSync, unlinkSync } from "node:fs";
|
|
7
|
+
import { chmodSync, existsSync, readFileSync, unlinkSync } from "node:fs";
|
|
8
8
|
import { getEndpointFromToken, readConfig } from "@alfe.ai/config";
|
|
9
9
|
import crypto from "crypto";
|
|
10
10
|
import { parse } from "smol-toml";
|
|
@@ -3436,7 +3436,12 @@ async function loadRuntimeConfigs() {
|
|
|
3436
3436
|
* of ~/.alfe/config.toml, and IPC/PID features are disabled.
|
|
3437
3437
|
*/
|
|
3438
3438
|
function isManagedMode() {
|
|
3439
|
-
|
|
3439
|
+
if (process.env.ALFE_MANAGED === "true") return true;
|
|
3440
|
+
try {
|
|
3441
|
+
return parse(readFileSync(join(homedir(), ".alfe", "config.toml"), "utf-8")).managed === true;
|
|
3442
|
+
} catch {
|
|
3443
|
+
return false;
|
|
3444
|
+
}
|
|
3440
3445
|
}
|
|
3441
3446
|
/**
|
|
3442
3447
|
* Load configuration for managed mode (ECS Fargate).
|
|
@@ -20478,15 +20483,6 @@ async function handleCloudCommand(command) {
|
|
|
20478
20483
|
}
|
|
20479
20484
|
if (command.command === "daemon.update") {
|
|
20480
20485
|
const version = command.payload?.version ?? "latest";
|
|
20481
|
-
if (!isManagedMode()) return {
|
|
20482
|
-
type: "COMMAND_ACK",
|
|
20483
|
-
commandId: command.commandId,
|
|
20484
|
-
status: "error",
|
|
20485
|
-
result: {
|
|
20486
|
-
code: "NOT_MANAGED",
|
|
20487
|
-
message: "daemon.update is only supported in managed mode"
|
|
20488
|
-
}
|
|
20489
|
-
};
|
|
20490
20486
|
setTimeout(() => {
|
|
20491
20487
|
import("./upgrade.js").then(({ upgradeAndExit }) => upgradeAndExit(version)).catch((err) => {
|
|
20492
20488
|
logger$1.error({ err: err instanceof Error ? err.message : String(err) }, "Upgrade failed");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"ws": "^8.18.0",
|
|
25
25
|
"@alfe.ai/ai-proxy-local": "^0.0.4",
|
|
26
26
|
"@alfe.ai/config": "^0.0.4",
|
|
27
|
-
"@alfe.ai/doctor": "^0.0.
|
|
28
|
-
"@alfe.ai/integrations": "^0.0.
|
|
27
|
+
"@alfe.ai/doctor": "^0.0.5",
|
|
28
|
+
"@alfe.ai/integrations": "^0.0.9"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ws": "^8.5.13",
|