@camstack/system 1.2.138 → 1.2.140

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.
Files changed (60) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-manager.addon.js +3 -3
  16. package/dist/builtins/device-manager/device-manager.addon.mjs +3 -3
  17. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +7 -0
  18. package/dist/builtins/doorbell/virtual-doorbell.addon.js +15 -4
  19. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +15 -4
  20. package/dist/builtins/hub-forwarder/index.js +1 -1
  21. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  22. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  23. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  24. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  25. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  26. package/dist/builtins/local-network/local-network.addon.js +1 -1
  27. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  28. package/dist/builtins/loki-logging/index.js +1 -1
  29. package/dist/builtins/loki-logging/index.mjs +1 -1
  30. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  32. package/dist/builtins/platform-probe/index.js +1 -1
  33. package/dist/builtins/platform-probe/index.mjs +1 -1
  34. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  36. package/dist/builtins/snapshot/index.js +1 -1
  37. package/dist/builtins/snapshot/index.mjs +1 -1
  38. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  39. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  41. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  42. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  43. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  44. package/dist/builtins/system-config/system-config.addon.js +1 -1
  45. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  46. package/dist/builtins/winston-logging/index.js +1 -1
  47. package/dist/builtins/winston-logging/index.mjs +1 -1
  48. package/dist/{dist-DMOTtKH8.mjs → dist-Clses4Bs.mjs} +111 -7
  49. package/dist/{dist-mQ3BkrJd.js → dist-D5Jhh8Vk.js} +116 -6
  50. package/dist/index.js +29 -18
  51. package/dist/index.mjs +30 -18
  52. package/dist/kernel/cap-router-builder.d.ts +13 -0
  53. package/dist/kernel/index.d.ts +1 -1
  54. package/dist/kernel/moleculer/trpc-links.d.ts +1 -12
  55. package/dist/kernel/transport/cap-route-resolver.d.ts +25 -1
  56. package/dist/{manifest-python-deps-C9x9vrqt.js → manifest-python-deps-Bu8H1_rg.js} +16 -49
  57. package/dist/{manifest-python-deps-08rqn6xN.mjs → manifest-python-deps-Dxifi-o0.mjs} +17 -44
  58. package/dist/{retired-settings-keys-CPRvyt-E.mjs → retired-settings-keys-Cr8N6C6X.mjs} +1 -1
  59. package/dist/{retired-settings-keys-Dvkcu_zf.js → retired-settings-keys-Dflres-F.js} +1 -1
  60. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { At as asNumber, B as extractNestedAddonId, Bt as parseJsonUnknown$1, Dt as ReadinessTimeoutError, Et as ReadinessRegistry, Ft as expandCapMethods, Gt as EventCategory$1, H as isArrayOutputSchema, Ht as resolveCapMount, J as lifecycleJobSchema, K as isVoidInput, Mt as createEvent, Nt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_STATUS_METHOD, U as isCollectionArrayMethod, Ut as scopeKey, Vt as readinessKey, W as isObjectInput, Z as logLevelAtMost, bt as DATAPLANE_SECRET_HEADER$1, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asString$1, kt as asJsonObject$1, ot as scopesAllowAddon, q as kebabToCamel, st as scopesAllowDeviceCap, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, vt as errMsg$1, xt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, y as addonSettingsCapability, zt as parseJsonObject } from "./dist-DMOTtKH8.mjs";
2
+ import { At as asJsonObject$1, B as extractNestedAddonId, Bt as parseJsonObject, Ct as DEVICE_STATUS_METHOD, Dt as ReadinessRegistry, H as isArrayOutputSchema, Ht as readinessKey, It as expandCapMethods, J as lifecycleJobSchema, K as isVoidInput, Kt as EventCategory$1, Mt as asString$1, Nt as createEvent, Ot as ReadinessTimeoutError, Pt as emitDownForOwnedCaps, Q as looseSchema, St as DEVICE_SETTINGS_CONTRIBUTION_METHODS, U as isCollectionArrayMethod, Ut as resolveCapMount, Vt as parseJsonUnknown$1, W as isObjectInput, Wt as scopeKey, Z as logLevelAtMost, at as resolveMethodAuth, ct as scopesAllowDeviceCap, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, it as procedureAuthKey, jt as asNumber, q as kebabToCamel, st as scopesAllowAddon, t as ALL_CAPABILITY_DEFINITIONS, tt as objectInputDeclaresAddonId, xt as DATAPLANE_SECRET_HEADER$1, y as addonSettingsCapability, yt as errMsg$1 } from "./dist-Clses4Bs.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -25,7 +25,7 @@ import "./builtins/system-config/index.mjs";
25
25
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
26
26
  import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
27
27
  import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-CQhPGSJm.mjs";
28
- import { $ as buildNativeCapProxy, A as createHubCapForwardService, At as buildHeapSample, B as AGENT_CAP_FWD_ACTION, C as brokerTransportLink, Ct as runNpm, D as localProviderLink, Dt as HEAP_WATCH_INTERVAL_MS, E as ipcParentLink, Et as HEAP_RECLAIM_TRIGGER_MB, F as createUdsLogger, Ft as strandedMb, G as callWithServiceDiscovery, H as CapRouteResolver, I as createUdsLoggerWithControl, J as UdsLocalTransportServer, K as createLocalTransport, L as LocalChildClient, M as createUdsEventBridge, Mt as shouldReclaim, N as createUdsEventBus, Nt as startHeapWatch, O as HUB_CAP_FWD_ACTION, Ot as HEAP_WATCH_WARN_RATIO, P as udsChildLogToWorkerEntry, Pt as startRunnerHeapWatch, Q as encodeFrame, R as LocalChildRegistry, S as brokerCallForCap, St as resolveNpmInvocation, T as ipcChildLink, Tt as HEAP_RECLAIM_MIN_INTERVAL_MS, U as CapRouteError, V as AGENT_CAP_FWD_SERVICE, W as classifyCapRoute, X as localEndpointPath, Y as SocketChannel, Z as FrameDecoder, _ as createKernelHwAccel, _t as CapabilityHandle, a as getWorkerDeviceRegistry, b as __resetCapUsageRegistryForTests, bt as installManifestNativeDeps, c as setHubConnected, ct as NATIVE_PROVIDER_SERVICE_INFIX, d as getBrokerEventBus, dt as capBareAction, et as buildUdsNativeCapProxy, f as getMoleculerEventStats, ft as capServiceName, g as AddonDepsManager, gt as DeviceRegistry, h as subscribePassthrough, ht as serializeTypedArrays, i as createUdsAddonContext, it as mountNativeCapService, j as createParentUnownedCallHandler, jt as createV8Reclaimer, k as HUB_CAP_FWD_SERVICE, kt as RUNNER_HEAP_WATCH_INTERVAL_MS, l as EVENT_TOPIC_PREFIX, lt as capActionName, m as setNodeEventInterest, mt as deserializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as createAddonService, p as registerEventBusService, pt as parseCapAction, q as UdsLocalTransportClient, r as createAddonContext, s as getOrInitReadinessRegistryForClient, st as validateProviderRegistrations, t as installManifestPythonDeps, tt as createBrokerDeviceManagerApi, u as clusterEventTopic, ut as capActionSuffix, v as resolveHwAccel, vt as CapabilityUnavailableError, w as buildLinkChain, wt as createAddonDataPlaneFacility, x as getCapUsageRegistry, xt as resolveAddonClass, y as CapUsageRegistry, yt as copyBundledNativeModules, z as UDS_NO_ROUTE_PREFIX } from "./manifest-python-deps-08rqn6xN.mjs";
28
+ import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, At as createV8Reclaimer, B as AGENT_CAP_FWD_SERVICE, C as brokerTransportLink, Ct as createAddonDataPlaneFacility, D as HUB_CAP_FWD_ACTION, Dt as HEAP_WATCH_WARN_RATIO, E as localProviderLink, Et as HEAP_WATCH_INTERVAL_MS, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, Mt as startHeapWatch, N as udsChildLogToWorkerEntry, Nt as startRunnerHeapWatch, O as HUB_CAP_FWD_SERVICE, Ot as RUNNER_HEAP_WATCH_INTERVAL_MS, P as createUdsLogger, Pt as strandedMb, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerCallForCap, St as runNpm, T as ipcParentLink, Tt as HEAP_RECLAIM_TRIGGER_MB, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as createKernelHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as __resetCapUsageRegistryForTests, bt as resolveAddonClass, c as setHubConnected, ct as capActionName, d as getBrokerEventBus, dt as capServiceName, et as createBrokerDeviceManagerApi, f as getMoleculerEventStats, ft as parseCapAction, g as AddonDepsManager, gt as CapabilityHandle, h as subscribePassthrough, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, jt as shouldReclaim, k as createHubCapForwardService, kt as buildHeapSample, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as setNodeEventInterest, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as registerEventBusService, pt as deserializeTypedArrays, q as UdsLocalTransportServer, r as createAddonContext, rt as mountNativeCapService, s as getOrInitReadinessRegistryForClient, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestPythonDeps, u as clusterEventTopic, ut as capBareAction, v as resolveHwAccel, vt as copyBundledNativeModules, w as buildLinkChain, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as getCapUsageRegistry, xt as resolveNpmInvocation, y as CapUsageRegistry, yt as installManifestNativeDeps, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-Dxifi-o0.mjs";
29
29
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
30
30
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
31
31
  import { z } from "zod";
@@ -6399,15 +6399,35 @@ function methodsFor(def) {
6399
6399
  return {
6400
6400
  name,
6401
6401
  kind: m.kind ?? "query",
6402
- auth: m.auth ?? "protected",
6402
+ auth: resolveMethodAuth(def, m),
6403
6403
  schema: m,
6404
6404
  isVoid: isVoidInput(m.input),
6405
6405
  isObject: isObjectInput(m.input),
6406
- callerRequired: m.caller === "required"
6406
+ callerRequired: m.caller === "required",
6407
+ isArrayOutput: m.kind !== "subscription" && isArrayOutputSchema(m.output)
6407
6408
  };
6408
6409
  });
6409
6410
  }
6410
6411
  /**
6412
+ * Invoke `method.name` on a resolved provider, raising the canonical
6413
+ * "method not found" error (Task 7.5d) when the provider does not implement
6414
+ * it — the naive `provider[method.name]?.(payload)` optional call let a
6415
+ * missing method answer `undefined` (200 to the caller). EXCEPTION, mirrored
6416
+ * from `child-cap-dispatch.ts`'s `isCollectionListMethod` graceful skip: a
6417
+ * COLLECTION cap's array-output method degrades to `[]` — the hub fans that
6418
+ * method across every registered provider
6419
+ * (`resolveCollectionProvider`/`concatArrayMethod`), so ONE provider not
6420
+ * implementing it is a graceful skip, not an error. Every other missing
6421
+ * method (singleton, device-native, or a collection's SCALAR method) is a
6422
+ * real implementation gap and fails loud.
6423
+ */
6424
+ function invokeCapMethod(provider, method, payload, capName, isCollection, services) {
6425
+ const fn = provider[method.name];
6426
+ if (typeof fn === "function") return fn(payload);
6427
+ if (isCollection && method.isArrayOutput) return [];
6428
+ return (services.methodNotFound ?? ((cap, m) => services.badRequest(`Capability "${cap}" has no method "${m}"`)))(capName, method.name);
6429
+ }
6430
+ /**
6411
6431
  * Extract the authenticated caller identity from the (structurally
6412
6432
  * unknown) tRPC context. The builder cannot import the server's
6413
6433
  * `TrpcContext`, so the read is narrowing-based: `ctx.user.id` (string)
@@ -6527,37 +6547,29 @@ function buildOneCapRouter(def, primitives, services) {
6527
6547
  }).optional() : z.object({ nodeId: z.string().optional() }).optional();
6528
6548
  procedures[method.name] = base.input(voidSelector)[procKind](({ input, ctx }) => {
6529
6549
  const sel = input ?? {};
6530
- return (nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0))[method.name]?.();
6550
+ return invokeCapMethod(nodeIdData ? requireLocal(capName, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services) : resolveProviderForCall(capName, sel.nodeId, () => getLocal(ctx, isCollection ? sel.addonId : void 0), services, isCollection ? sel.addonId : void 0), method, void 0, capName, isCollection, services);
6531
6551
  });
6532
6552
  continue;
6533
6553
  }
6534
6554
  if (method.isObject) {
6535
6555
  const schema = nodeIdData ? inputSchema : looseSchema(inputSchema);
6536
6556
  procedures[method.name] = base.input(schema)[procKind](({ input, ctx }) => {
6537
- if (nodeIdData) {
6538
- const provider = requireLocal(capName, () => getLocal(ctx), services);
6539
- const payload = method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input;
6540
- return provider[method.name]?.(payload);
6541
- }
6557
+ if (nodeIdData) return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(stripKeys(input, []).rest, ctx, capName, method.name, services) : input, capName, isCollection, services);
6542
6558
  if (isCollection) {
6543
6559
  const { rest, picked } = stripKeys(input, ["nodeId", "addonId"]);
6544
6560
  const nodeId = typeof picked.nodeId === "string" ? picked.nodeId : void 0;
6545
6561
  const topLevelAddonId = typeof picked.addonId === "string" ? picked.addonId : void 0;
6546
6562
  const canRecoverNestedAddonId = !isArrayOutputSchema(method.schema.output) && !objectInputDeclaresAddonId(method.schema.input);
6547
6563
  const addonId = topLevelAddonId ?? (canRecoverNestedAddonId ? extractNestedAddonId(rest) : void 0);
6548
- const provider = resolveProviderForCall(capName, nodeId, () => getLocal(ctx, addonId), services, topLevelAddonId);
6549
- const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
6550
- return provider[method.name]?.(payload);
6564
+ return invokeCapMethod(resolveProviderForCall(capName, nodeId, () => getLocal(ctx, addonId), services, topLevelAddonId), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
6551
6565
  }
6552
6566
  const { rest, picked } = stripKeys(input, ["nodeId"]);
6553
- const provider = resolveProviderForCall(capName, typeof picked.nodeId === "string" ? picked.nodeId : void 0, () => getLocal(ctx), services);
6554
- const payload = method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest;
6555
- return provider[method.name]?.(payload);
6567
+ return invokeCapMethod(resolveProviderForCall(capName, typeof picked.nodeId === "string" ? picked.nodeId : void 0, () => getLocal(ctx), services), method, method.callerRequired ? injectCaller(rest, ctx, capName, method.name, services) : rest, capName, isCollection, services);
6556
6568
  });
6557
6569
  continue;
6558
6570
  }
6559
6571
  procedures[method.name] = base.input(inputSchema)[procKind](({ input, ctx }) => {
6560
- return requireLocal(capName, () => getLocal(ctx), services)[method.name]?.(input);
6572
+ return invokeCapMethod(requireLocal(capName, () => getLocal(ctx), services), method, input, capName, isCollection, services);
6561
6573
  });
6562
6574
  }
6563
6575
  return primitives.router(procedures);
@@ -95101,4 +95113,4 @@ var LifecycleJobEngine = class {
95101
95113
  }
95102
95114
  };
95103
95115
  //#endregion
95104
- export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDoorSettingsView, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readLanHttpState, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
95116
+ export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDoorSettingsView, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readLanHttpState, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
@@ -91,6 +91,19 @@ export interface CapRouterServices {
91
91
  * fallthrough rather than crashing.
92
92
  */
93
93
  readonly rejectUnresolvedAddonPin?: (capName: string, addonId: string) => void;
94
+ /**
95
+ * Raise the canonical error for a resolved provider that does NOT
96
+ * implement `method` (Task 7.5d). Before this existed the router called
97
+ * `provider[method.name]?.(payload)` — an optional call that let a missing
98
+ * method answer `undefined`, which tRPC serializes as a 200. The UDS child
99
+ * dispatcher (`child-cap-dispatch.ts`) hits the SAME condition (a provider
100
+ * missing a method) and THROWS; two authorities disagreeing about the same
101
+ * defect is worse than either alone, and the hub's silence is the one a
102
+ * caller cannot detect. OPTIONAL for framework-live-update version skew: an
103
+ * older server hands a services object without it; the builder falls back
104
+ * to `badRequest` so the call still fails closed instead of answering 200.
105
+ */
106
+ readonly methodNotFound?: (capName: string, method: string) => never;
94
107
  }
95
108
  /**
96
109
  * Build a single capability's router (the runtime equivalent of one
@@ -65,7 +65,7 @@ export type { HubServiceDeps } from './moleculer/hub-service.js';
65
65
  export { createBrokerDeviceManagerApi, buildNativeCapProxy, buildUdsNativeCapProxy, mountNativeCapService, NATIVE_PROVIDER_SERVICE_INFIX, } from './moleculer/device-cap-proxy.js';
66
66
  export type { WorkerDeviceManagerOptions } from './moleculer/device-cap-proxy.js';
67
67
  export { getWorkerDeviceRegistry } from './moleculer/addon-context-factory.js';
68
- export { localProviderLink, brokerTransportLink, ipcChildLink, ipcParentLink, buildLinkChain, brokerCallForCap, } from './moleculer/trpc-links.js';
68
+ export { localProviderLink, brokerTransportLink, ipcParentLink, buildLinkChain, brokerCallForCap, } from './moleculer/trpc-links.js';
69
69
  export type { LocalProviderResolver, BrokerCapCallOpts } from './moleculer/trpc-links.js';
70
70
  export { createProcessService } from './moleculer/process-service.js';
71
71
  export type { ProcessInfo } from './moleculer/process-service.js';
@@ -1,7 +1,7 @@
1
1
  import { TRPCLink } from '@trpc/client';
2
2
  import { AnyRouter } from '@trpc/server';
3
3
  import { ServiceBroker } from 'moleculer';
4
- import { CapCallInput, LocalChildRegistry } from '../transport/index.js';
4
+ import { CapCallInput } from '../transport/index.js';
5
5
  /**
6
6
  * Resolver for in-process capability providers.
7
7
  *
@@ -171,17 +171,6 @@ export interface BrokerTransportLinkOptions {
171
171
  readonly discoveryTimeoutMs?: number;
172
172
  }
173
173
  export declare function brokerTransportLink<TRouter extends AnyRouter>(broker: ServiceBroker, serviceMap?: Readonly<Record<string, string>>, observerOpts?: CapUsageObserverOptions, linkOptions?: BrokerTransportLinkOptions): TRPCLink<TRouter>;
174
- /**
175
- * Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
176
- * `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
177
- * passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
178
- * so this link is transparent for everything it does not own.
179
- *
180
- * `deviceId` for device-scoped caps is read from `op.input` (the same place
181
- * the codegen'd device-scoped routers carry it); the full `op.input` is
182
- * forwarded as the child method's argument.
183
- */
184
- export declare function ipcChildLink<TRouter extends AnyRouter>(registry: LocalChildRegistry): TRPCLink<TRouter>;
185
174
  /**
186
175
  * Middle link that routes a child addon's outbound `ctx.api` cap call to the
187
176
  * parent hub over UDS via `callOut` (obtained at call-time so the child can
@@ -114,6 +114,19 @@ export interface AgentCapForwardParams {
114
114
  */
115
115
  readonly childId?: string;
116
116
  readonly deviceId?: number;
117
+ /**
118
+ * Out-of-band PROVIDER-selection hint — the twin of `CapCallMessage.addonId`
119
+ * (Task 7.5a). A GROUPED runner (`execution.group`) on an AGENT can host two
120
+ * co-located addons registering the SAME collection cap, exactly like the
121
+ * hub-local-uds case (`LocalChildRegistry.toCapCall`'s `addonId`, threaded by
122
+ * `buildCapCallFn`'s hub-local branch). Before this field existed, the hub had
123
+ * no channel to carry the selector across the hub→agent envelope — grouped-
124
+ * runner provider selection worked on the hub and silently fell back to
125
+ * "whichever provider is first" on an agent. Absent → the agent dispatch falls
126
+ * back to its sole provider for the cap (same fallback `child-cap-dispatch.ts`
127
+ * already has for a call that never carried the hint).
128
+ */
129
+ readonly addonId?: string;
117
130
  }
118
131
  /** The Moleculer service name that Task 6's agent registers. */
119
132
  export declare const AGENT_CAP_FWD_SERVICE: "$agent-cap-fwd";
@@ -170,7 +183,18 @@ export declare class CapRouteResolver {
170
183
  * caller then falls through to its remote-resolution branch.
171
184
  */
172
185
  resolveHubLocalUdsRoute(capName: string, deviceId?: number): HubLocalUdsRoute | null;
173
- dispatch(route: CapRoute, method: string, args: unknown): Promise<unknown>;
186
+ /**
187
+ * @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
188
+ * the addonId of the provider the CALLER already resolved (e.g.
189
+ * `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
190
+ * provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
191
+ * route already encodes the provider in its action name
192
+ * (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
193
+ * `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
194
+ * talks to `LocalChildRegistry.callCapOnChild` directly rather than through
195
+ * `dispatch`.
196
+ */
197
+ dispatch(route: CapRoute, method: string, args: unknown, addonId?: string): Promise<unknown>;
174
198
  /**
175
199
  * Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
176
200
  * transport errors. The outer `dispatch` wraps non-CapRouteErrors.
@@ -4796,9 +4796,20 @@ var CapRouteResolver = class {
4796
4796
  childId
4797
4797
  };
4798
4798
  }
4799
- async dispatch(route, method, args) {
4799
+ /**
4800
+ * @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
4801
+ * the addonId of the provider the CALLER already resolved (e.g.
4802
+ * `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
4803
+ * provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
4804
+ * route already encodes the provider in its action name
4805
+ * (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
4806
+ * `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
4807
+ * talks to `LocalChildRegistry.callCapOnChild` directly rather than through
4808
+ * `dispatch`.
4809
+ */
4810
+ async dispatch(route, method, args, addonId) {
4800
4811
  try {
4801
- return await this.dispatchInner(route, method, args);
4812
+ return await this.dispatchInner(route, method, args, addonId);
4802
4813
  } catch (err) {
4803
4814
  if (err instanceof CapRouteError) throw err;
4804
4815
  const nodeId = this.routeNodeId(route);
@@ -4817,7 +4828,7 @@ var CapRouteResolver = class {
4817
4828
  * Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
4818
4829
  * transport errors. The outer `dispatch` wraps non-CapRouteErrors.
4819
4830
  */
4820
- async dispatchInner(route, method, args) {
4831
+ async dispatchInner(route, method, args, addonId) {
4821
4832
  switch (route.kind) {
4822
4833
  case "hub-in-process": return route.ref.invoke(method, args);
4823
4834
  case "hub-local-uds": {
@@ -4863,7 +4874,8 @@ var CapRouteResolver = class {
4863
4874
  method,
4864
4875
  args,
4865
4876
  ...route.childId !== void 0 ? { childId: route.childId } : {},
4866
- ...deviceId !== void 0 ? { deviceId } : {}
4877
+ ...deviceId !== void 0 ? { deviceId } : {},
4878
+ ...addonId !== void 0 ? { addonId } : {}
4867
4879
  };
4868
4880
  return callWithServiceDiscovery(this.broker, AGENT_CAP_FWD_SERVICE, AGENT_CAP_FWD_ACTION, params, {
4869
4881
  nodeID: route.agentNodeId,
@@ -6448,45 +6460,6 @@ function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
6448
6460
  };
6449
6461
  }
6450
6462
  /**
6451
- * Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
6452
- * `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
6453
- * passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
6454
- * so this link is transparent for everything it does not own.
6455
- *
6456
- * `deviceId` for device-scoped caps is read from `op.input` (the same place
6457
- * the codegen'd device-scoped routers carry it); the full `op.input` is
6458
- * forwarded as the child method's argument.
6459
- */
6460
- function ipcChildLink(registry) {
6461
- return () => {
6462
- return ({ op, next }) => {
6463
- const parsed = parsePath(op.path);
6464
- if (!parsed) return next(op);
6465
- const input = op.input;
6466
- const inputObj = input && typeof input === "object" && !Array.isArray(input) ? input : null;
6467
- const deviceId = inputObj && typeof inputObj.deviceId === "number" ? inputObj.deviceId : void 0;
6468
- if (registry.resolveChildId(parsed.capName, deviceId) === null) return next(op);
6469
- return observable((observer) => {
6470
- registry.callCap({
6471
- capName: parsed.capName,
6472
- method: parsed.method,
6473
- args: op.input,
6474
- deviceId
6475
- }).then((data) => {
6476
- observer.next({ result: {
6477
- type: "data",
6478
- data
6479
- } });
6480
- observer.complete();
6481
- }).catch((cause) => {
6482
- observer.error(_trpc_client.TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
6483
- });
6484
- return () => {};
6485
- });
6486
- };
6487
- };
6488
- }
6489
- /**
6490
6463
  * Middle link that routes a child addon's outbound `ctx.api` cap call to the
6491
6464
  * parent hub over UDS via `callOut` (obtained at call-time so the child can
6492
6465
  * reconnect without rebuilding its tRPC client).
@@ -8581,12 +8554,6 @@ Object.defineProperty(exports, "installManifestPythonDeps", {
8581
8554
  return installManifestPythonDeps;
8582
8555
  }
8583
8556
  });
8584
- Object.defineProperty(exports, "ipcChildLink", {
8585
- enumerable: true,
8586
- get: function() {
8587
- return ipcChildLink;
8588
- }
8589
- });
8590
8557
  Object.defineProperty(exports, "ipcParentLink", {
8591
8558
  enumerable: true,
8592
8559
  get: function() {
@@ -4792,9 +4792,20 @@ var CapRouteResolver = class {
4792
4792
  childId
4793
4793
  };
4794
4794
  }
4795
- async dispatch(route, method, args) {
4795
+ /**
4796
+ * @param addonId Optional out-of-band PROVIDER-selection hint (Task 7.5a):
4797
+ * the addonId of the provider the CALLER already resolved (e.g.
4798
+ * `buildCapCallFn`'s `deps.addonId` for a registered grouped-runner
4799
+ * provider). Only meaningful for `agent-child-forward` — a `remote-moleculer`
4800
+ * route already encodes the provider in its action name
4801
+ * (`${addonId}.${cap}.${method}`, via `NodeCapAuthority.getAddonId`), and a
4802
+ * `hub-local-uds` caller that already knows the addonId (`buildCapCallFn`)
4803
+ * talks to `LocalChildRegistry.callCapOnChild` directly rather than through
4804
+ * `dispatch`.
4805
+ */
4806
+ async dispatch(route, method, args, addonId) {
4796
4807
  try {
4797
- return await this.dispatchInner(route, method, args);
4808
+ return await this.dispatchInner(route, method, args, addonId);
4798
4809
  } catch (err) {
4799
4810
  if (err instanceof CapRouteError) throw err;
4800
4811
  const nodeId = this.routeNodeId(route);
@@ -4813,7 +4824,7 @@ var CapRouteResolver = class {
4813
4824
  * Inner dispatch: may throw CapRouteError (validation failures) or arbitrary
4814
4825
  * transport errors. The outer `dispatch` wraps non-CapRouteErrors.
4815
4826
  */
4816
- async dispatchInner(route, method, args) {
4827
+ async dispatchInner(route, method, args, addonId) {
4817
4828
  switch (route.kind) {
4818
4829
  case "hub-in-process": return route.ref.invoke(method, args);
4819
4830
  case "hub-local-uds": {
@@ -4859,7 +4870,8 @@ var CapRouteResolver = class {
4859
4870
  method,
4860
4871
  args,
4861
4872
  ...route.childId !== void 0 ? { childId: route.childId } : {},
4862
- ...deviceId !== void 0 ? { deviceId } : {}
4873
+ ...deviceId !== void 0 ? { deviceId } : {},
4874
+ ...addonId !== void 0 ? { addonId } : {}
4863
4875
  };
4864
4876
  return callWithServiceDiscovery(this.broker, AGENT_CAP_FWD_SERVICE, AGENT_CAP_FWD_ACTION, params, {
4865
4877
  nodeID: route.agentNodeId,
@@ -6444,45 +6456,6 @@ function brokerTransportLink(broker, serviceMap, observerOpts, linkOptions) {
6444
6456
  };
6445
6457
  }
6446
6458
  /**
6447
- * Middle link that routes a cap op to a LOCAL addon-runner over UDS via the
6448
- * `LocalChildRegistry`. If no local child owns `(capName, deviceId?)`, the op
6449
- * passes through to `next(op)` (e.g. `brokerTransportLink` for remote agents),
6450
- * so this link is transparent for everything it does not own.
6451
- *
6452
- * `deviceId` for device-scoped caps is read from `op.input` (the same place
6453
- * the codegen'd device-scoped routers carry it); the full `op.input` is
6454
- * forwarded as the child method's argument.
6455
- */
6456
- function ipcChildLink(registry) {
6457
- return () => {
6458
- return ({ op, next }) => {
6459
- const parsed = parsePath(op.path);
6460
- if (!parsed) return next(op);
6461
- const input = op.input;
6462
- const inputObj = input && typeof input === "object" && !Array.isArray(input) ? input : null;
6463
- const deviceId = inputObj && typeof inputObj.deviceId === "number" ? inputObj.deviceId : void 0;
6464
- if (registry.resolveChildId(parsed.capName, deviceId) === null) return next(op);
6465
- return observable((observer) => {
6466
- registry.callCap({
6467
- capName: parsed.capName,
6468
- method: parsed.method,
6469
- args: op.input,
6470
- deviceId
6471
- }).then((data) => {
6472
- observer.next({ result: {
6473
- type: "data",
6474
- data
6475
- } });
6476
- observer.complete();
6477
- }).catch((cause) => {
6478
- observer.error(TRPCClientError.from(cause instanceof Error ? cause : new Error(String(cause))));
6479
- });
6480
- return () => {};
6481
- });
6482
- };
6483
- };
6484
- }
6485
- /**
6486
6459
  * Middle link that routes a child addon's outbound `ctx.api` cap call to the
6487
6460
  * parent hub over UDS via `callOut` (obtained at call-time so the child can
6488
6461
  * reconnect without rebuilding its tRPC client).
@@ -8175,4 +8148,4 @@ async function installManifestPythonDeps(declaration, addonDir, deps, logger) {
8175
8148
  await deps.installPythonRequirements(reqAbs);
8176
8149
  }
8177
8150
  //#endregion
8178
- export { buildNativeCapProxy as $, createHubCapForwardService as A, buildHeapSample as At, AGENT_CAP_FWD_ACTION as B, brokerTransportLink as C, runNpm as Ct, localProviderLink as D, HEAP_WATCH_INTERVAL_MS as Dt, ipcParentLink as E, HEAP_RECLAIM_TRIGGER_MB as Et, createUdsLogger as F, strandedMb as Ft, callWithServiceDiscovery as G, CapRouteResolver as H, createUdsLoggerWithControl as I, UdsLocalTransportServer as J, createLocalTransport as K, LocalChildClient as L, createUdsEventBridge as M, shouldReclaim as Mt, createUdsEventBus as N, startHeapWatch as Nt, HUB_CAP_FWD_ACTION as O, HEAP_WATCH_WARN_RATIO as Ot, udsChildLogToWorkerEntry as P, startRunnerHeapWatch as Pt, encodeFrame as Q, LocalChildRegistry as R, brokerCallForCap as S, resolveNpmInvocation as St, ipcChildLink as T, HEAP_RECLAIM_MIN_INTERVAL_MS as Tt, CapRouteError as U, AGENT_CAP_FWD_SERVICE as V, classifyCapRoute as W, localEndpointPath as X, SocketChannel as Y, FrameDecoder as Z, createKernelHwAccel as _, CapabilityHandle as _t, getWorkerDeviceRegistry as a, setWorkerNativeCapsChangeListener as at, __resetCapUsageRegistryForTests as b, installManifestNativeDeps as bt, setHubConnected as c, NATIVE_PROVIDER_SERVICE_INFIX as ct, getBrokerEventBus as d, capBareAction as dt, buildUdsNativeCapProxy as et, getMoleculerEventStats as f, capServiceName as ft, AddonDepsManager as g, DeviceRegistry as gt, subscribePassthrough as h, serializeTypedArrays as ht, createUdsAddonContext as i, mountNativeCapService as it, createParentUnownedCallHandler as j, createV8Reclaimer as jt, HUB_CAP_FWD_SERVICE as k, RUNNER_HEAP_WATCH_INTERVAL_MS as kt, EVENT_TOPIC_PREFIX as l, capActionName as lt, setNodeEventInterest as m, deserializeTypedArrays as mt, adaptBrokerToCluster as n, getWorkerNativeCapProvider as nt, getOrInitReadinessRegistry as o, createAddonService as ot, registerEventBusService as p, parseCapAction as pt, UdsLocalTransportClient as q, createAddonContext as r, getWorkerNativeCapSnapshot as rt, getOrInitReadinessRegistryForClient as s, validateProviderRegistrations as st, installManifestPythonDeps as t, createBrokerDeviceManagerApi as tt, clusterEventTopic as u, capActionSuffix as ut, resolveHwAccel as v, CapabilityUnavailableError as vt, buildLinkChain as w, createAddonDataPlaneFacility as wt, getCapUsageRegistry as x, resolveAddonClass as xt, CapUsageRegistry as y, copyBundledNativeModules as yt, UDS_NO_ROUTE_PREFIX as z };
8151
+ export { buildUdsNativeCapProxy as $, createParentUnownedCallHandler as A, createV8Reclaimer as At, AGENT_CAP_FWD_SERVICE as B, brokerTransportLink as C, createAddonDataPlaneFacility as Ct, HUB_CAP_FWD_ACTION as D, HEAP_WATCH_WARN_RATIO as Dt, localProviderLink as E, HEAP_WATCH_INTERVAL_MS as Et, createUdsLoggerWithControl as F, createLocalTransport as G, CapRouteError as H, LocalChildClient as I, SocketChannel as J, UdsLocalTransportClient as K, LocalChildRegistry as L, createUdsEventBus as M, startHeapWatch as Mt, udsChildLogToWorkerEntry as N, startRunnerHeapWatch as Nt, HUB_CAP_FWD_SERVICE as O, RUNNER_HEAP_WATCH_INTERVAL_MS as Ot, createUdsLogger as P, strandedMb as Pt, buildNativeCapProxy as Q, UDS_NO_ROUTE_PREFIX as R, brokerCallForCap as S, runNpm as St, ipcParentLink as T, HEAP_RECLAIM_TRIGGER_MB as Tt, classifyCapRoute as U, CapRouteResolver as V, callWithServiceDiscovery as W, FrameDecoder as X, localEndpointPath as Y, encodeFrame as Z, createKernelHwAccel as _, CapabilityUnavailableError as _t, getWorkerDeviceRegistry as a, createAddonService as at, __resetCapUsageRegistryForTests as b, resolveAddonClass as bt, setHubConnected as c, capActionName as ct, getBrokerEventBus as d, capServiceName as dt, createBrokerDeviceManagerApi as et, getMoleculerEventStats as f, parseCapAction as ft, AddonDepsManager as g, CapabilityHandle as gt, subscribePassthrough as h, DeviceRegistry as ht, createUdsAddonContext as i, setWorkerNativeCapsChangeListener as it, createUdsEventBridge as j, shouldReclaim as jt, createHubCapForwardService as k, buildHeapSample as kt, EVENT_TOPIC_PREFIX as l, capActionSuffix as lt, setNodeEventInterest as m, serializeTypedArrays as mt, adaptBrokerToCluster as n, getWorkerNativeCapSnapshot as nt, getOrInitReadinessRegistry as o, validateProviderRegistrations as ot, registerEventBusService as p, deserializeTypedArrays as pt, UdsLocalTransportServer as q, createAddonContext as r, mountNativeCapService as rt, getOrInitReadinessRegistryForClient as s, NATIVE_PROVIDER_SERVICE_INFIX as st, installManifestPythonDeps as t, getWorkerNativeCapProvider as tt, clusterEventTopic as u, capBareAction as ut, resolveHwAccel as v, copyBundledNativeModules as vt, buildLinkChain as w, HEAP_RECLAIM_MIN_INTERVAL_MS as wt, getCapUsageRegistry as x, resolveNpmInvocation as xt, CapUsageRegistry as y, installManifestNativeDeps as yt, AGENT_CAP_FWD_ACTION as z };
@@ -1,4 +1,4 @@
1
- import { kt as asJsonObject } from "./dist-DMOTtKH8.mjs";
1
+ import { At as asJsonObject } from "./dist-Clses4Bs.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-mQ3BkrJd.js");
1
+ const require_dist = require("./dist-D5Jhh8Vk.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.138",
3
+ "version": "1.2.140",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",