@alfe.ai/gateway 0.0.10 → 0.0.12
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 +32 -10
- package/package.json +2 -2
package/dist/health.js
CHANGED
|
@@ -3755,9 +3755,12 @@ var ReconciliationEngine = class {
|
|
|
3755
3755
|
log$2.info(`Installing ${id}@${desired.version}`);
|
|
3756
3756
|
await this.manager.install(id, desired.version, desired.config);
|
|
3757
3757
|
report.installed.push(id);
|
|
3758
|
+
log$2.info(`Activating ${id}`);
|
|
3759
|
+
await this.manager.activate(id);
|
|
3760
|
+
report.activated.push(id);
|
|
3758
3761
|
report.results.push({
|
|
3759
3762
|
integrationId: id,
|
|
3760
|
-
action: "
|
|
3763
|
+
action: "activated",
|
|
3761
3764
|
actualStatus: "active"
|
|
3762
3765
|
});
|
|
3763
3766
|
return;
|
|
@@ -3770,9 +3773,12 @@ var ReconciliationEngine = class {
|
|
|
3770
3773
|
} catch {}
|
|
3771
3774
|
await this.manager.install(id, desired.version, desired.config);
|
|
3772
3775
|
report.installed.push(id);
|
|
3776
|
+
log$2.info(`Activating ${id}`);
|
|
3777
|
+
await this.manager.activate(id);
|
|
3778
|
+
report.activated.push(id);
|
|
3773
3779
|
report.results.push({
|
|
3774
3780
|
integrationId: id,
|
|
3775
|
-
action: "
|
|
3781
|
+
action: "activated",
|
|
3776
3782
|
actualStatus: "active"
|
|
3777
3783
|
});
|
|
3778
3784
|
return;
|
|
@@ -20103,18 +20109,32 @@ let shuttingDown = false;
|
|
|
20103
20109
|
let resolvedCliVersion;
|
|
20104
20110
|
/**
|
|
20105
20111
|
* Resolve the installed @alfe.ai/cli version.
|
|
20106
|
-
*
|
|
20107
|
-
*
|
|
20112
|
+
*
|
|
20113
|
+
* Strategy (in order):
|
|
20114
|
+
* 1. ALFE_CLI_VERSION env var (set by CLI entry point when run directly)
|
|
20115
|
+
* 2. Walk up from this file to find @alfe.ai/cli/package.json
|
|
20116
|
+
* (works when systemd runs the gateway binary directly, since
|
|
20117
|
+
* the path is .../cli/node_modules/@alfe.ai/gateway/dist/...)
|
|
20108
20118
|
*/
|
|
20109
20119
|
async function getCliVersion() {
|
|
20110
20120
|
if (process.env.ALFE_CLI_VERSION) return process.env.ALFE_CLI_VERSION;
|
|
20111
20121
|
try {
|
|
20112
|
-
const
|
|
20113
|
-
|
|
20114
|
-
|
|
20115
|
-
|
|
20116
|
-
|
|
20117
|
-
|
|
20122
|
+
const { fileURLToPath } = await import("node:url");
|
|
20123
|
+
const { dirname } = await import("node:path");
|
|
20124
|
+
let dir = dirname(fileURLToPath(import.meta.url));
|
|
20125
|
+
for (let i = 0; i < 10; i++) {
|
|
20126
|
+
const candidate = join(dir, "package.json");
|
|
20127
|
+
try {
|
|
20128
|
+
const raw = await readFile(candidate, "utf-8");
|
|
20129
|
+
const pkg = JSON.parse(raw);
|
|
20130
|
+
if (pkg.name === "@alfe.ai/cli") return pkg.version;
|
|
20131
|
+
} catch {}
|
|
20132
|
+
const parent = dirname(dir);
|
|
20133
|
+
if (parent === dir) break;
|
|
20134
|
+
dir = parent;
|
|
20135
|
+
}
|
|
20136
|
+
} catch {}
|
|
20137
|
+
logger$1.debug("Could not resolve @alfe.ai/cli version");
|
|
20118
20138
|
}
|
|
20119
20139
|
/**
|
|
20120
20140
|
* Flush pino's async transport and exit.
|
|
@@ -20269,6 +20289,8 @@ async function startDaemon() {
|
|
|
20269
20289
|
ALFE_AGENT_ID: config.agentId,
|
|
20270
20290
|
ANTHROPIC_BASE_URL: aiProxyUrl ?? "http://127.0.0.1:18193",
|
|
20271
20291
|
OPENAI_BASE_URL: aiProxyUrl ?? "http://127.0.0.1:18193",
|
|
20292
|
+
ANTHROPIC_API_KEY: config.apiKey,
|
|
20293
|
+
OPENAI_API_KEY: config.apiKey,
|
|
20272
20294
|
OPENCLAW_GATEWAY_TOKEN: runtimeToken
|
|
20273
20295
|
}
|
|
20274
20296
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alfe.ai/gateway",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Alfe local gateway daemon — persistent control plane for agent integrations",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@alfe.ai/ai-proxy-local": "^0.0.2",
|
|
26
26
|
"@alfe.ai/config": "^0.0.2",
|
|
27
27
|
"@alfe.ai/doctor": "^0.0.2",
|
|
28
|
-
"@alfe.ai/integrations": "^0.0.
|
|
28
|
+
"@alfe.ai/integrations": "^0.0.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ws": "^8.5.13",
|