@alfe.ai/gateway 0.8.2 → 0.8.3

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 CHANGED
@@ -23814,7 +23814,10 @@ async function startDaemon() {
23814
23814
  await mcpManager.loadIntoBundler(mcpBundler);
23815
23815
  const warmBundler = (reason) => {
23816
23816
  if (!mcpBundler) return;
23817
- mcpBundler.warmup().catch((err) => {
23817
+ const target = mcpBundler;
23818
+ target.warmup().then(() => {
23819
+ warnFailedMcpServers(target, logger$1, reason);
23820
+ }).catch((err) => {
23818
23821
  logger$1.warn({
23819
23822
  err: err instanceof Error ? err.message : String(err),
23820
23823
  reason
@@ -24442,6 +24445,28 @@ function handleMcpListTools(bundler) {
24442
24445
  };
24443
24446
  }
24444
24447
  /**
24448
+ * Observability backstop for the INTEGRATION warm path. `applyForIntegration`
24449
+ * registers MCP servers into the store and the daemon warms them silently via
24450
+ * the store-change `onChange` hook — so a server that fails its connect (e.g.
24451
+ * an MCP server whose backing account/credential wasn't resolvable at warm
24452
+ * time, like ctrader-mcp `exit(1)`-ing on empty accounts) leaves NO trace,
24453
+ * making the black hole undiagnosable. After a warm, read `bundler.statuses()`
24454
+ * and warn once per still-failed server so the failure is visible. These
24455
+ * self-heal on the bundler's background retry sweep once the dependency
24456
+ * appears. Returns the servers it warned about (for tests / callers).
24457
+ */
24458
+ function warnFailedMcpServers(bundler, log, reason) {
24459
+ if (!bundler) return [];
24460
+ const failed = bundler.statuses().filter((s) => !s.connected && s.lastError !== void 0);
24461
+ for (const status of failed) log.warn({
24462
+ server: status.name,
24463
+ reason,
24464
+ consecutiveFailures: status.consecutiveFailures,
24465
+ lastError: status.lastError
24466
+ }, `MCP server "${status.name}" failed to connect: ${status.lastError ?? ""}`);
24467
+ return failed;
24468
+ }
24469
+ /**
24445
24470
  * Route a tool call to the appropriate MCP child via the daemon-hosted
24446
24471
  * bundler. `name` is the prefixed (`mcp__<server>__<tool>`) name; args is
24447
24472
  * the raw JSON object the LLM produced.
@@ -1,5 +1,9 @@
1
1
  import pino from "pino";
2
2
 
3
+ //#region src/logger.d.ts
4
+
5
+ declare const logger: pino.Logger<never, boolean>;
6
+ //#endregion
3
7
  //#region src/protocol.d.ts
4
8
 
5
9
  interface IPCRequest {
@@ -335,9 +339,6 @@ declare function queryDaemonHealth(socketPath: string, timeoutMs?: number): Prom
335
339
  */
336
340
  declare function formatHealthReport(health: DaemonHealth): string;
337
341
  //#endregion
338
- //#region src/logger.d.ts
339
- declare const logger: pino.Logger<never, boolean>;
340
- //#endregion
341
342
  //#region src/process-manager.d.ts
342
343
  /**
343
344
  * Install the service unit for the current platform.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alfe.ai/gateway",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "Alfe local gateway daemon — persistent control plane for agent integrations",
5
5
  "type": "module",
6
6
  "bin": {
@@ -25,10 +25,10 @@
25
25
  "ws": "^8.18.0",
26
26
  "@alfe.ai/agent-api-client": "^0.11.0",
27
27
  "@alfe.ai/ai-proxy-local": "^0.0.13",
28
- "@alfe.ai/integration-manifest": "^0.3.2",
29
28
  "@alfe.ai/config": "^0.3.0",
30
- "@alfe.ai/integrations": "^0.5.1",
31
- "@alfe.ai/mcp-bundler": "^0.3.1"
29
+ "@alfe.ai/integration-manifest": "^0.3.2",
30
+ "@alfe.ai/integrations": "^0.5.2",
31
+ "@alfe.ai/mcp-bundler": "^0.3.2"
32
32
  },
33
33
  "license": "UNLICENSED",
34
34
  "homepage": "https://alfe.ai",