@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.
- package/dist/addon-runner.js +1 -1
- package/dist/addon-runner.mjs +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +3 -3
- package/dist/builtins/device-manager/device-manager.addon.mjs +3 -3
- package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +7 -0
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +15 -4
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +15 -4
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-DMOTtKH8.mjs → dist-Clses4Bs.mjs} +111 -7
- package/dist/{dist-mQ3BkrJd.js → dist-D5Jhh8Vk.js} +116 -6
- package/dist/index.js +29 -18
- package/dist/index.mjs +30 -18
- package/dist/kernel/cap-router-builder.d.ts +13 -0
- package/dist/kernel/index.d.ts +1 -1
- package/dist/kernel/moleculer/trpc-links.d.ts +1 -12
- package/dist/kernel/transport/cap-route-resolver.d.ts +25 -1
- package/dist/{manifest-python-deps-C9x9vrqt.js → manifest-python-deps-Bu8H1_rg.js} +16 -49
- package/dist/{manifest-python-deps-08rqn6xN.mjs → manifest-python-deps-Dxifi-o0.mjs} +17 -44
- package/dist/{retired-settings-keys-CPRvyt-E.mjs → retired-settings-keys-Cr8N6C6X.mjs} +1 -1
- package/dist/{retired-settings-keys-Dvkcu_zf.js → retired-settings-keys-Dflres-F.js} +1 -1
- 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
|
|
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
|
|
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
|
|
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)
|
|
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
|
-
|
|
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
|
-
|
|
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)
|
|
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,
|
|
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
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
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 };
|