@camstack/agent 1.1.14 → 1.1.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/cli.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __cr } from 'node:module'; const require = globalThis.require ?? __cr(import.meta.url);
3
3
  import {
4
4
  startAgent
5
- } from "./chunk-TN65ESPJ.mjs";
5
+ } from "./chunk-YI3D74BS.mjs";
6
6
 
7
7
  // src/cli.ts
8
8
  import { existsSync } from "fs";
package/dist/index.js CHANGED
@@ -1248,6 +1248,24 @@ async function startAgent(configPath) {
1248
1248
  // fallback. Getter: `agentUdsRegistry` is assigned later in this scope,
1249
1249
  // after the handler is constructed.
1250
1250
  getLocalDispatcher: () => agentUdsRegistry ?? null,
1251
+ // AGENT → HUB forward: a cap no agent-local child owns is routed to the
1252
+ // hub's `$hub-cap-fwd.forward`, which runs it through the hub's own
1253
+ // routing. Only the hub registers `$hub-cap-fwd`, so the undirected
1254
+ // `broker.call` discovers it there (no nodeID pin needed). This is what
1255
+ // makes an agent's forked addon reach a hub-hosted cap (`stream-broker`,
1256
+ // `settings-store`, …) instead of 30s-deadlining on raw `${cap}.*`
1257
+ // discovery (hub-local addon runners expose no Moleculer service).
1258
+ forwardToHub: (input) => broker.call(
1259
+ import_system3.HUB_CAP_FWD_ACTION,
1260
+ {
1261
+ capName: input.capName,
1262
+ method: input.method,
1263
+ args: input.args,
1264
+ ...input.deviceId !== void 0 ? { deviceId: input.deviceId } : {},
1265
+ ...input.nodeId !== void 0 ? { nodeId: input.nodeId } : {}
1266
+ },
1267
+ { timeout: 6e4 }
1268
+ ),
1251
1269
  logger: { warn: (msg) => consoleLogger.warn(`[uds-fallback] ${msg}`) }
1252
1270
  });
1253
1271
  agentUdsRegistry = new import_system3.LocalChildRegistry({