@camstack/system 1.1.24 → 1.1.26
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/platform-probe/index.d.ts +20 -9
- package/dist/builtins/platform-probe/index.js +81 -305
- package/dist/builtins/platform-probe/index.mjs +83 -305
- package/dist/builtins/system-config/system-config.addon.js +51 -118
- package/dist/builtins/system-config/system-config.addon.mjs +51 -118
- package/dist/index.js +1 -2
- package/dist/index.mjs +2 -2
- package/dist/kernel/hwaccel/hwaccel-resolver.d.ts +9 -0
- package/dist/kernel/index.d.ts +0 -2
- package/dist/kernel/inference/inference-resolver.d.ts +16 -0
- package/dist/kernel/transport/parent-unowned-call.d.ts +20 -0
- package/dist/{manifest-python-deps-XWJwKYDx.js → manifest-python-deps-CCmnJmNf.js} +27 -37
- package/dist/{manifest-python-deps-CPJXzrZt.mjs → manifest-python-deps-DPA7N9UP.mjs} +31 -35
- package/package.json +1 -1
- package/dist/builtins/platform-probe/hardware-decode-accel-probe.d.ts +0 -37
- package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts +0 -13
- package/dist/kernel/hwaccel/hwaccel-service.d.ts +0 -4
|
@@ -39,8 +39,7 @@ import { BaseAddon, errMsg, hydrateSchema } from "@camstack/types";
|
|
|
39
39
|
/** Section key → user-facing section title. */
|
|
40
40
|
var SECTION_TITLES = {
|
|
41
41
|
server: "Server",
|
|
42
|
-
auth: "Authentication"
|
|
43
|
-
ffmpeg: "FFmpeg"
|
|
42
|
+
auth: "Authentication"
|
|
44
43
|
};
|
|
45
44
|
/** Keys that map 1:1 to a given yml section — used by `updateGlobalSettings`
|
|
46
45
|
* to figure out which section owns each key in the incoming patch. */
|
|
@@ -48,10 +47,7 @@ var KEY_TO_SECTION = {
|
|
|
48
47
|
port: "server",
|
|
49
48
|
host: "server",
|
|
50
49
|
dataPath: "server",
|
|
51
|
-
tokenExpiry: "auth"
|
|
52
|
-
binaryPath: "ffmpeg",
|
|
53
|
-
hwAccel: "ffmpeg",
|
|
54
|
-
threadCount: "ffmpeg"
|
|
50
|
+
tokenExpiry: "auth"
|
|
55
51
|
};
|
|
56
52
|
var SystemConfigAddon = class extends BaseAddon {
|
|
57
53
|
id = "system-config";
|
|
@@ -62,119 +58,56 @@ var SystemConfigAddon = class extends BaseAddon {
|
|
|
62
58
|
this.ctx.logger.info("Initialized — exposes yml-backed sections via getGlobalSettings");
|
|
63
59
|
}
|
|
64
60
|
buildGlobalSchema() {
|
|
65
|
-
return { sections: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
{
|
|
80
|
-
type: "text",
|
|
81
|
-
key: "port",
|
|
82
|
-
label: "Port",
|
|
83
|
-
description: "Listening port",
|
|
84
|
-
disabled: true
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
type: "text",
|
|
88
|
-
key: "host",
|
|
89
|
-
label: "Host",
|
|
90
|
-
description: "Bind address",
|
|
91
|
-
disabled: true
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
type: "text",
|
|
95
|
-
key: "dataPath",
|
|
96
|
-
label: "Data Path",
|
|
97
|
-
description: "Root data directory",
|
|
98
|
-
disabled: true,
|
|
99
|
-
span: 2
|
|
100
|
-
}
|
|
101
|
-
]
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: "system-config-auth",
|
|
105
|
-
title: SECTION_TITLES["auth"],
|
|
106
|
-
description: "Token and session settings.",
|
|
107
|
-
columns: 1,
|
|
108
|
-
fields: [{
|
|
61
|
+
return { sections: [{
|
|
62
|
+
id: "system-config-server",
|
|
63
|
+
title: SECTION_TITLES["server"],
|
|
64
|
+
description: "Core server connection settings — read-only, loaded from config.yaml at bootstrap.",
|
|
65
|
+
columns: 2,
|
|
66
|
+
fields: [
|
|
67
|
+
{
|
|
68
|
+
type: "info",
|
|
69
|
+
key: "server-restart-note",
|
|
70
|
+
label: "Restart required",
|
|
71
|
+
content: "Server settings are read-only. Change them in config.yaml and restart.",
|
|
72
|
+
variant: "warning"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
109
75
|
type: "text",
|
|
110
|
-
key: "
|
|
111
|
-
label: "
|
|
112
|
-
description: "
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
label: "None (CPU only)"
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
value: "videotoolbox",
|
|
149
|
-
label: "VideoToolbox (macOS)"
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
value: "vaapi",
|
|
153
|
-
label: "VA-API (Linux Intel/AMD)"
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
value: "qsv",
|
|
157
|
-
label: "QSV (Intel Quick Sync)"
|
|
158
|
-
},
|
|
159
|
-
{
|
|
160
|
-
value: "cuda",
|
|
161
|
-
label: "CUDA (NVIDIA)"
|
|
162
|
-
}
|
|
163
|
-
]
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
type: "number",
|
|
167
|
-
key: "threadCount",
|
|
168
|
-
label: "Thread Count",
|
|
169
|
-
description: "0 = auto (let FFmpeg decide)",
|
|
170
|
-
min: 0,
|
|
171
|
-
max: 16,
|
|
172
|
-
step: 1,
|
|
173
|
-
default: 0
|
|
174
|
-
}
|
|
175
|
-
]
|
|
176
|
-
}
|
|
177
|
-
] };
|
|
76
|
+
key: "port",
|
|
77
|
+
label: "Port",
|
|
78
|
+
description: "Listening port",
|
|
79
|
+
disabled: true
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "text",
|
|
83
|
+
key: "host",
|
|
84
|
+
label: "Host",
|
|
85
|
+
description: "Bind address",
|
|
86
|
+
disabled: true
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
type: "text",
|
|
90
|
+
key: "dataPath",
|
|
91
|
+
label: "Data Path",
|
|
92
|
+
description: "Root data directory",
|
|
93
|
+
disabled: true,
|
|
94
|
+
span: 2
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}, {
|
|
98
|
+
id: "system-config-auth",
|
|
99
|
+
title: SECTION_TITLES["auth"],
|
|
100
|
+
description: "Token and session settings.",
|
|
101
|
+
columns: 1,
|
|
102
|
+
fields: [{
|
|
103
|
+
type: "text",
|
|
104
|
+
key: "tokenExpiry",
|
|
105
|
+
label: "Token Expiry",
|
|
106
|
+
description: "JWT token lifetime (e.g. 24h, 7d, 1h)",
|
|
107
|
+
placeholder: "24h",
|
|
108
|
+
default: "24h"
|
|
109
|
+
}]
|
|
110
|
+
}] };
|
|
178
111
|
}
|
|
179
112
|
async getGlobalSettings() {
|
|
180
113
|
const schema = this.buildGlobalSchema();
|
package/dist/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const require_builtins_local_auth_local_auth_addon = require("./builtins/local-a
|
|
|
20
20
|
require("./builtins/local-auth/index.js");
|
|
21
21
|
const require_builtins_device_manager_device_manager_addon = require("./builtins/device-manager/device-manager.addon.js");
|
|
22
22
|
require("./builtins/device-manager/index.js");
|
|
23
|
-
const require_manifest_python_deps = require("./manifest-python-deps-
|
|
23
|
+
const require_manifest_python_deps = require("./manifest-python-deps-CCmnJmNf.js");
|
|
24
24
|
const require_custom_action_registry = require("./custom-action-registry-vLYEFTtv.js");
|
|
25
25
|
let _camstack_types_node = require("@camstack/types/node");
|
|
26
26
|
let node_http = require("node:http");
|
|
@@ -93415,7 +93415,6 @@ exports.createCoreCapService = createCoreCapService;
|
|
|
93415
93415
|
exports.createFileDataPlaneHandler = require_model_download_service.createFileDataPlaneHandler;
|
|
93416
93416
|
exports.createHubCapForwardService = require_manifest_python_deps.createHubCapForwardService;
|
|
93417
93417
|
exports.createHubService = createHubService;
|
|
93418
|
-
exports.createHwAccelService = require_manifest_python_deps.createHwAccelService;
|
|
93419
93418
|
exports.createKernelHwAccel = require_manifest_python_deps.createKernelHwAccel;
|
|
93420
93419
|
exports.createLocalTransport = require_manifest_python_deps.createLocalTransport;
|
|
93421
93420
|
exports.createParentUnownedCallHandler = require_manifest_python_deps.createParentUnownedCallHandler;
|
package/dist/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ import { LocalAuthAddon, a as require_ms, c as __esmMin, d as __toCommonJS, f as
|
|
|
18
18
|
import "./builtins/local-auth/index.mjs";
|
|
19
19
|
import { DeviceManagerAddon } from "./builtins/device-manager/device-manager.addon.mjs";
|
|
20
20
|
import "./builtins/device-manager/index.mjs";
|
|
21
|
-
import { $ as
|
|
21
|
+
import { $ as buildUdsNativeCapProxy, A as createParentUnownedCallHandler, B as AGENT_CAP_FWD_SERVICE, C as buildLinkChain, D as HUB_CAP_FWD_ACTION, E as localProviderLink, F as createUdsLoggerWithControl, G as createLocalTransport, H as CapRouteError, I as LocalChildClient, J as SocketChannel, K as UdsLocalTransportClient, L as LocalChildRegistry, M as createUdsEventBus, N as udsChildLogToWorkerEntry, O as HUB_CAP_FWD_SERVICE, P as createUdsLogger, Q as buildNativeCapProxy, R as UDS_NO_ROUTE_PREFIX, S as brokerTransportLink, T as ipcParentLink, U as classifyCapRoute, V as CapRouteResolver, W as callWithServiceDiscovery, X as FrameDecoder, Y as localEndpointPath, Z as encodeFrame, _ as resolveHwAccel, _t as CapabilityUnavailableError, a as getWorkerDeviceRegistry, at as createAddonService, b as getCapUsageRegistry, c as setHubConnected, ct as capActionName, d as getMoleculerEventStats, dt as capServiceName, et as createBrokerDeviceManagerApi, f as registerEventBusService, ft as parseCapAction, g as createKernelHwAccel, gt as CapabilityHandle, h as AddonDepsManager, ht as DeviceRegistry, i as createUdsAddonContext, j as createUdsEventBridge, k as createHubCapForwardService, l as EVENT_TOPIC_PREFIX, lt as capActionSuffix, m as subscribePassthrough, mt as serializeTypedArrays, n as adaptBrokerToCluster, o as getOrInitReadinessRegistry, ot as validateProviderRegistrations, p as setNodeEventInterest, 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 getBrokerEventBus, ut as capBareAction, v as CapUsageRegistry, vt as installManifestNativeDeps, w as ipcChildLink, x as brokerCallForCap, y as __resetCapUsageRegistryForTests, yt as resolveAddonClass, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-DPA7N9UP.mjs";
|
|
22
22
|
import { t as CustomActionRegistry } from "./custom-action-registry-BEXwC-oo.mjs";
|
|
23
23
|
import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
24
24
|
import { request } from "node:http";
|
|
@@ -93252,4 +93252,4 @@ async function stageFrameworkLockstep(input) {
|
|
|
93252
93252
|
return results;
|
|
93253
93253
|
}
|
|
93254
93254
|
//#endregion
|
|
93255
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FRAMEWORK_LOCKSTEP, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LifecycleJobEngine, LifecycleStateMachine, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, RESTART_MARKER_FILE, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyCapRoute, clearPendingRestart, clusterSecretMatches, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createFileDataPlaneHandler, createHubCapForwardService, createHubService,
|
|
93255
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CustomActionRegistry, DEFAULT_DATA_PATH, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FRAMEWORK_LOCKSTEP, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LifecycleJobEngine, LifecycleStateMachine, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, RESTART_MARKER_FILE, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, __resetCapUsageRegistryForTests, adaptBrokerToCluster, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, capActionName, capActionSuffix, capBareAction, capServiceName, classifyCapRoute, clearPendingRestart, clusterSecretMatches, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, detectWorkspacePackagesDir, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, encodeFrame, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensurePython, ensureTlsCert, fetchJson, findInPath, formatLogLine, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hashClusterSecret, installManifestNativeDeps, installManifestPythonDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcChildLink, ipcParentLink, isAddonDeploySource, isClusterSecretMismatchError, isInfraCapability, isModelDownloaded, isSourceNewer, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, parseCapAction, parseRangeHeader, parseTokenizedUrl, proxyToUpstream, readPendingRestart, readinessKey, registerEventBusService, resolveFilePath, resolveHwAccel, scheduleSelfRestart, scopeKey, scopesAllowDeviceCap, serializeTypedArrays, setHubConnected, setNodeEventInterest, stageFrameworkLockstep, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, writePendingRestart };
|
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
import { HwAccelBackend, HwAccelResolution } from '@camstack/types';
|
|
2
|
+
export interface PlatformSignals {
|
|
3
|
+
readonly platform: NodeJS.Platform;
|
|
4
|
+
readonly arch: string;
|
|
5
|
+
readonly hasNvidiaGpu: boolean;
|
|
6
|
+
readonly hasAmdGpu: boolean;
|
|
7
|
+
readonly hasIntelGpu: boolean;
|
|
8
|
+
readonly hasRenderNode: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function probePlatform(): PlatformSignals;
|
|
2
11
|
/**
|
|
3
12
|
* Resolve the preferred hardware acceleration backend order for the
|
|
4
13
|
* current host.
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -51,13 +51,11 @@ export type { UdsReadinessClient } from './moleculer/readiness-context.js';
|
|
|
51
51
|
export { createStreamProbeBrokerService } from './moleculer/stream-probe-service.js';
|
|
52
52
|
export type { StreamProbeBrokerDeps } from './moleculer/stream-probe-service.js';
|
|
53
53
|
export { resolveHwAccel, createKernelHwAccel } from './hwaccel/hwaccel-resolver.js';
|
|
54
|
-
export { createHwAccelService } from './hwaccel/hwaccel-service.js';
|
|
55
54
|
export { AddonDepsManager } from './deps/addon-deps-manager.js';
|
|
56
55
|
export { installManifestPythonDeps } from './deps/manifest-python-deps.js';
|
|
57
56
|
export { installManifestNativeDeps } from './deps/manifest-native-deps.js';
|
|
58
57
|
export { AddonHealthMonitor, HEALTH_MONITOR_TICK_MS, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, } from './addon-health-monitor.js';
|
|
59
58
|
export type { AddonHealthPhase, AddonHealthState, AddonHealthSnapshot, AddonHealthMonitorOptions, } from './addon-health-monitor.js';
|
|
60
|
-
export type { HwAccelServiceDeps } from './hwaccel/hwaccel-service.js';
|
|
61
59
|
export type { HubServiceDeps } from './moleculer/hub-service.js';
|
|
62
60
|
export { createBrokerDeviceManagerApi, buildNativeCapProxy, buildUdsNativeCapProxy, mountNativeCapService, NATIVE_PROVIDER_SERVICE_INFIX, } from './moleculer/device-cap-proxy.js';
|
|
63
61
|
export type { WorkerDeviceManagerOptions } from './moleculer/device-cap-proxy.js';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IKernelInferenceEngine, KernelInferenceHardware } from '@camstack/types';
|
|
2
|
+
import { PlatformSignals } from '../hwaccel/hwaccel-resolver.js';
|
|
3
|
+
/**
|
|
4
|
+
* Map the shared platform GPU-vendor probe into the inference `gpu`/`npu` types
|
|
5
|
+
* the runtime scorer understands. NVIDIA → cuda; Intel iGPU (or a bare render
|
|
6
|
+
* node) → openvino; Apple Silicon → CoreML/ANE. The Intel NPU is not separately
|
|
7
|
+
* detected — an Intel iGPU already selects openvino (the NPU only bumps the
|
|
8
|
+
* score, never changes the winner). PURE — unit-tested.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mapSignalsToInferenceHardware(signals: PlatformSignals): KernelInferenceHardware;
|
|
11
|
+
/**
|
|
12
|
+
* Build the local in-process inference-hardware resolver used to populate
|
|
13
|
+
* `ctx.kernel.inferenceEngine`. The exact model as `createKernelHwAccel`:
|
|
14
|
+
* deterministic per host, safe to call repeatedly, always the LOCAL node.
|
|
15
|
+
*/
|
|
16
|
+
export declare function createKernelInferenceEngine(): IKernelInferenceEngine;
|
|
@@ -58,6 +58,26 @@ export interface ParentUnownedCallDeps {
|
|
|
58
58
|
* deviceId-carrying SYSTEM-cap calls (e.g. `system.info({deviceId})`) fast.
|
|
59
59
|
*/
|
|
60
60
|
readonly isDeviceNativeCap?: (capName: string) => boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Optional predicate — returns `true` when `capName` declares
|
|
63
|
+
* `nodeIdMode: 'data'` in its `CapabilityDefinition` (`addon-settings`,
|
|
64
|
+
* `addons`, `nodes`, `pipeline-orchestrator`): an inline `nodeId` in the
|
|
65
|
+
* call args is DATA for the (hub-singleton) provider, which dispatches
|
|
66
|
+
* internally — NOT a routing hint. For such caps the handler must NOT lift
|
|
67
|
+
* `args.nodeId` into a routing pin: pinning routes the call to a node with
|
|
68
|
+
* no provider for the cap (e.g. a forked addon on an agent calling
|
|
69
|
+
* `addon-settings.getGlobalSettings({addonId, nodeId})` gets pinned to
|
|
70
|
+
* `nodeId` → dead broker fallback → ServiceNotFoundError). Suppressing the
|
|
71
|
+
* pin forwards the call unpinned → singleton resolution on the hub — exactly
|
|
72
|
+
* how `settings-store` (no `nodeId` arg) already behaves. `args` pass
|
|
73
|
+
* through UNTOUCHED: the provider still reads `nodeId` as data.
|
|
74
|
+
*
|
|
75
|
+
* The kernel layer has no cap registry, so the wiring side (which does)
|
|
76
|
+
* injects this. Omitted (or returning `false`) ⇒ legacy behaviour exactly:
|
|
77
|
+
* an inline `args.nodeId` keeps pinning (benchmark, platform-probe,
|
|
78
|
+
* pipeline-runner node-pinned execution is unaffected).
|
|
79
|
+
*/
|
|
80
|
+
readonly isDataNodeIdCap?: (capName: string) => boolean;
|
|
61
81
|
/**
|
|
62
82
|
* Optional forward-to-hub dispatcher (the AGENT path). When present, a cap
|
|
63
83
|
* that no agent-LOCAL child owns is forwarded to the hub's `$hub-cap-fwd`
|
|
@@ -4880,7 +4880,7 @@ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
4880
4880
|
function createParentUnownedCallHandler(deps) {
|
|
4881
4881
|
return async (input) => {
|
|
4882
4882
|
const deviceId = input.deviceId ?? extractDeviceId(input.args);
|
|
4883
|
-
const nodeId = input.nodeId ?? extractNodeId(input.args);
|
|
4883
|
+
const nodeId = deps.isDataNodeIdCap?.(input.capName) === true ? void 0 : input.nodeId ?? extractNodeId(input.args);
|
|
4884
4884
|
if (nodeId === void 0) {
|
|
4885
4885
|
const empty = deps.resolveEmptyCollection?.(input.capName, input.method);
|
|
4886
4886
|
if (empty != null) return empty;
|
|
@@ -5526,16 +5526,6 @@ function __resetCapUsageRegistryForTests() {
|
|
|
5526
5526
|
singleton = null;
|
|
5527
5527
|
}
|
|
5528
5528
|
//#endregion
|
|
5529
|
-
//#region src/kernel/hwaccel/hwaccel-service.ts
|
|
5530
|
-
function createHwAccelService(deps) {
|
|
5531
|
-
return {
|
|
5532
|
-
name: "$hwaccel",
|
|
5533
|
-
actions: { resolve: { async handler(ctx) {
|
|
5534
|
-
return deps.resolve(ctx.params.prefer ?? null);
|
|
5535
|
-
} } }
|
|
5536
|
-
};
|
|
5537
|
-
}
|
|
5538
|
-
//#endregion
|
|
5539
5529
|
//#region src/kernel/hwaccel/hwaccel-resolver.ts
|
|
5540
5530
|
/**
|
|
5541
5531
|
* Platform-probe for hardware video decode acceleration.
|
|
@@ -5671,6 +5661,29 @@ function createKernelHwAccel() {
|
|
|
5671
5661
|
return { resolve: async (prefer) => resolveHwAccel(prefer) };
|
|
5672
5662
|
}
|
|
5673
5663
|
//#endregion
|
|
5664
|
+
//#region src/kernel/inference/inference-resolver.ts
|
|
5665
|
+
/**
|
|
5666
|
+
* Map the shared platform GPU-vendor probe into the inference `gpu`/`npu` types
|
|
5667
|
+
* the runtime scorer understands. NVIDIA → cuda; Intel iGPU (or a bare render
|
|
5668
|
+
* node) → openvino; Apple Silicon → CoreML/ANE. The Intel NPU is not separately
|
|
5669
|
+
* detected — an Intel iGPU already selects openvino (the NPU only bumps the
|
|
5670
|
+
* score, never changes the winner). PURE — unit-tested.
|
|
5671
|
+
*/
|
|
5672
|
+
function mapSignalsToInferenceHardware(signals) {
|
|
5673
|
+
return {
|
|
5674
|
+
gpu: signals.hasNvidiaGpu ? { type: "nvidia" } : signals.hasIntelGpu || signals.hasRenderNode ? { type: "intel" } : null,
|
|
5675
|
+
npu: signals.platform === "darwin" && signals.arch === "arm64" ? { type: "apple-ane" } : null
|
|
5676
|
+
};
|
|
5677
|
+
}
|
|
5678
|
+
/**
|
|
5679
|
+
* Build the local in-process inference-hardware resolver used to populate
|
|
5680
|
+
* `ctx.kernel.inferenceEngine`. The exact model as `createKernelHwAccel`:
|
|
5681
|
+
* deterministic per host, safe to call repeatedly, always the LOCAL node.
|
|
5682
|
+
*/
|
|
5683
|
+
function createKernelInferenceEngine() {
|
|
5684
|
+
return { resolveHardware: async () => mapSignalsToInferenceHardware(probePlatform()) };
|
|
5685
|
+
}
|
|
5686
|
+
//#endregion
|
|
5674
5687
|
//#region src/kernel/moleculer/addon-data-plane-facility.ts
|
|
5675
5688
|
/**
|
|
5676
5689
|
* Kernel side of the addon HTTP **data-plane** (see {@link AddonDataPlane}).
|
|
@@ -6629,24 +6642,6 @@ function createRemoteProviderProxy(broker, serviceName, capName, nodeId, methods
|
|
|
6629
6642
|
function runtimeNodeId(runtime) {
|
|
6630
6643
|
return runtime.mode === "broker" ? runtime.broker.nodeID : runtime.nodeId;
|
|
6631
6644
|
}
|
|
6632
|
-
var hwaccelRegistered = /* @__PURE__ */ new WeakSet();
|
|
6633
|
-
/**
|
|
6634
|
-
* Idempotently register the per-node `$hwaccel` Moleculer service on
|
|
6635
|
-
* `broker`. Safe to call multiple times. The service exposes the
|
|
6636
|
-
* local platform probe as `$hwaccel.resolve` so cross-node queries
|
|
6637
|
-
* (`broker.call('$hwaccel.resolve', p, { nodeID })`) work.
|
|
6638
|
-
*/
|
|
6639
|
-
function ensureHwAccelService(broker) {
|
|
6640
|
-
if (hwaccelRegistered.has(broker)) return;
|
|
6641
|
-
const bkr = broker;
|
|
6642
|
-
try {
|
|
6643
|
-
bkr.createService(createHwAccelService(createKernelHwAccel()));
|
|
6644
|
-
hwaccelRegistered.add(broker);
|
|
6645
|
-
} catch (err) {
|
|
6646
|
-
if (!(err instanceof Error ? err.message : String(err)).includes("already registered")) throw err;
|
|
6647
|
-
hwaccelRegistered.add(broker);
|
|
6648
|
-
}
|
|
6649
|
-
}
|
|
6650
6645
|
/**
|
|
6651
6646
|
* Adapt a Moleculer ServiceBroker to the camstack-types `IClusterBroker`
|
|
6652
6647
|
* structural interface so addons can consume cluster-level RPC without
|
|
@@ -6953,8 +6948,8 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
6953
6948
|
value
|
|
6954
6949
|
})
|
|
6955
6950
|
};
|
|
6956
|
-
if (runtime.mode === "broker") ensureHwAccelService(runtime.broker);
|
|
6957
6951
|
const hwaccel = createKernelHwAccel();
|
|
6952
|
+
const inferenceEngine = createKernelInferenceEngine();
|
|
6958
6953
|
return {
|
|
6959
6954
|
localNodeId: nodeId,
|
|
6960
6955
|
storage: options?.storageProvider ?? void 0,
|
|
@@ -6975,7 +6970,8 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
6975
6970
|
}),
|
|
6976
6971
|
...runtime.mode === "broker" ? { cluster: { broker: adaptBrokerToCluster(runtime.broker) } } : {},
|
|
6977
6972
|
streamProbe,
|
|
6978
|
-
hwaccel
|
|
6973
|
+
hwaccel,
|
|
6974
|
+
inferenceEngine
|
|
6979
6975
|
};
|
|
6980
6976
|
})(),
|
|
6981
6977
|
registerProvider(capabilityName, provider) {
|
|
@@ -7313,12 +7309,6 @@ Object.defineProperty(exports, "createHubCapForwardService", {
|
|
|
7313
7309
|
return createHubCapForwardService;
|
|
7314
7310
|
}
|
|
7315
7311
|
});
|
|
7316
|
-
Object.defineProperty(exports, "createHwAccelService", {
|
|
7317
|
-
enumerable: true,
|
|
7318
|
-
get: function() {
|
|
7319
|
-
return createHwAccelService;
|
|
7320
|
-
}
|
|
7321
|
-
});
|
|
7322
7312
|
Object.defineProperty(exports, "createKernelHwAccel", {
|
|
7323
7313
|
enumerable: true,
|
|
7324
7314
|
get: function() {
|
|
@@ -11,7 +11,7 @@ import { promisify } from "node:util";
|
|
|
11
11
|
import * as os from "node:os";
|
|
12
12
|
import { tmpdir } from "node:os";
|
|
13
13
|
import { unlink } from "node:fs/promises";
|
|
14
|
-
import { DATAPLANE_SECRET_HEADER as DATAPLANE_SECRET_HEADER$1, DeviceType as DeviceType$1, DisposerChain, EventCategory as EventCategory$1, ReadinessRegistry, asJsonObject as asJsonObject$1, asString as asString$1, createDeviceProxy, deviceOpsCapability, emitReadiness, errMsg as errMsg$1, expandCapMethods as expandCapMethods$1, scopeKey, sleep as sleep$1 } from "@camstack/types/addon";
|
|
14
|
+
import { DATAPLANE_SECRET_HEADER as DATAPLANE_SECRET_HEADER$1, DeviceType as DeviceType$1, DisposerChain, EventCategory as EventCategory$1, ReadinessRegistry, asJsonObject as asJsonObject$1, asString as asString$1, createDeviceProxy, deviceOpsCapability, emitReadiness as emitReadiness$1, errMsg as errMsg$1, expandCapMethods as expandCapMethods$1, scopeKey, sleep as sleep$1 } from "@camstack/types/addon";
|
|
15
15
|
import { TRPCClientError, createTRPCClient } from "@trpc/client";
|
|
16
16
|
import { connect, createServer as createServer$1 } from "node:net";
|
|
17
17
|
//#region src/kernel/addon-class-resolver.ts
|
|
@@ -1237,7 +1237,7 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
1237
1237
|
nodeId
|
|
1238
1238
|
}
|
|
1239
1239
|
});
|
|
1240
|
-
emitReadiness(eventBus, {
|
|
1240
|
+
emitReadiness$1(eventBus, {
|
|
1241
1241
|
capName: cap.name,
|
|
1242
1242
|
scope: {
|
|
1243
1243
|
type: "device",
|
|
@@ -1780,7 +1780,7 @@ function createBrokerDeviceManagerApi(opts) {
|
|
|
1780
1780
|
nodeId
|
|
1781
1781
|
}
|
|
1782
1782
|
});
|
|
1783
|
-
emitReadiness(eventBus, {
|
|
1783
|
+
emitReadiness$1(eventBus, {
|
|
1784
1784
|
capName,
|
|
1785
1785
|
scope: {
|
|
1786
1786
|
type: "device",
|
|
@@ -4878,7 +4878,7 @@ var delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
4878
4878
|
function createParentUnownedCallHandler(deps) {
|
|
4879
4879
|
return async (input) => {
|
|
4880
4880
|
const deviceId = input.deviceId ?? extractDeviceId(input.args);
|
|
4881
|
-
const nodeId = input.nodeId ?? extractNodeId(input.args);
|
|
4881
|
+
const nodeId = deps.isDataNodeIdCap?.(input.capName) === true ? void 0 : input.nodeId ?? extractNodeId(input.args);
|
|
4882
4882
|
if (nodeId === void 0) {
|
|
4883
4883
|
const empty = deps.resolveEmptyCollection?.(input.capName, input.method);
|
|
4884
4884
|
if (empty != null) return empty;
|
|
@@ -5524,16 +5524,6 @@ function __resetCapUsageRegistryForTests() {
|
|
|
5524
5524
|
singleton = null;
|
|
5525
5525
|
}
|
|
5526
5526
|
//#endregion
|
|
5527
|
-
//#region src/kernel/hwaccel/hwaccel-service.ts
|
|
5528
|
-
function createHwAccelService(deps) {
|
|
5529
|
-
return {
|
|
5530
|
-
name: "$hwaccel",
|
|
5531
|
-
actions: { resolve: { async handler(ctx) {
|
|
5532
|
-
return deps.resolve(ctx.params.prefer ?? null);
|
|
5533
|
-
} } }
|
|
5534
|
-
};
|
|
5535
|
-
}
|
|
5536
|
-
//#endregion
|
|
5537
5527
|
//#region src/kernel/hwaccel/hwaccel-resolver.ts
|
|
5538
5528
|
/**
|
|
5539
5529
|
* Platform-probe for hardware video decode acceleration.
|
|
@@ -5669,6 +5659,29 @@ function createKernelHwAccel() {
|
|
|
5669
5659
|
return { resolve: async (prefer) => resolveHwAccel(prefer) };
|
|
5670
5660
|
}
|
|
5671
5661
|
//#endregion
|
|
5662
|
+
//#region src/kernel/inference/inference-resolver.ts
|
|
5663
|
+
/**
|
|
5664
|
+
* Map the shared platform GPU-vendor probe into the inference `gpu`/`npu` types
|
|
5665
|
+
* the runtime scorer understands. NVIDIA → cuda; Intel iGPU (or a bare render
|
|
5666
|
+
* node) → openvino; Apple Silicon → CoreML/ANE. The Intel NPU is not separately
|
|
5667
|
+
* detected — an Intel iGPU already selects openvino (the NPU only bumps the
|
|
5668
|
+
* score, never changes the winner). PURE — unit-tested.
|
|
5669
|
+
*/
|
|
5670
|
+
function mapSignalsToInferenceHardware(signals) {
|
|
5671
|
+
return {
|
|
5672
|
+
gpu: signals.hasNvidiaGpu ? { type: "nvidia" } : signals.hasIntelGpu || signals.hasRenderNode ? { type: "intel" } : null,
|
|
5673
|
+
npu: signals.platform === "darwin" && signals.arch === "arm64" ? { type: "apple-ane" } : null
|
|
5674
|
+
};
|
|
5675
|
+
}
|
|
5676
|
+
/**
|
|
5677
|
+
* Build the local in-process inference-hardware resolver used to populate
|
|
5678
|
+
* `ctx.kernel.inferenceEngine`. The exact model as `createKernelHwAccel`:
|
|
5679
|
+
* deterministic per host, safe to call repeatedly, always the LOCAL node.
|
|
5680
|
+
*/
|
|
5681
|
+
function createKernelInferenceEngine() {
|
|
5682
|
+
return { resolveHardware: async () => mapSignalsToInferenceHardware(probePlatform()) };
|
|
5683
|
+
}
|
|
5684
|
+
//#endregion
|
|
5672
5685
|
//#region src/kernel/moleculer/addon-data-plane-facility.ts
|
|
5673
5686
|
/**
|
|
5674
5687
|
* Kernel side of the addon HTTP **data-plane** (see {@link AddonDataPlane}).
|
|
@@ -6627,24 +6640,6 @@ function createRemoteProviderProxy(broker, serviceName, capName, nodeId, methods
|
|
|
6627
6640
|
function runtimeNodeId(runtime) {
|
|
6628
6641
|
return runtime.mode === "broker" ? runtime.broker.nodeID : runtime.nodeId;
|
|
6629
6642
|
}
|
|
6630
|
-
var hwaccelRegistered = /* @__PURE__ */ new WeakSet();
|
|
6631
|
-
/**
|
|
6632
|
-
* Idempotently register the per-node `$hwaccel` Moleculer service on
|
|
6633
|
-
* `broker`. Safe to call multiple times. The service exposes the
|
|
6634
|
-
* local platform probe as `$hwaccel.resolve` so cross-node queries
|
|
6635
|
-
* (`broker.call('$hwaccel.resolve', p, { nodeID })`) work.
|
|
6636
|
-
*/
|
|
6637
|
-
function ensureHwAccelService(broker) {
|
|
6638
|
-
if (hwaccelRegistered.has(broker)) return;
|
|
6639
|
-
const bkr = broker;
|
|
6640
|
-
try {
|
|
6641
|
-
bkr.createService(createHwAccelService(createKernelHwAccel()));
|
|
6642
|
-
hwaccelRegistered.add(broker);
|
|
6643
|
-
} catch (err) {
|
|
6644
|
-
if (!(err instanceof Error ? err.message : String(err)).includes("already registered")) throw err;
|
|
6645
|
-
hwaccelRegistered.add(broker);
|
|
6646
|
-
}
|
|
6647
|
-
}
|
|
6648
6643
|
/**
|
|
6649
6644
|
* Adapt a Moleculer ServiceBroker to the camstack-types `IClusterBroker`
|
|
6650
6645
|
* structural interface so addons can consume cluster-level RPC without
|
|
@@ -6951,8 +6946,8 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
6951
6946
|
value
|
|
6952
6947
|
})
|
|
6953
6948
|
};
|
|
6954
|
-
if (runtime.mode === "broker") ensureHwAccelService(runtime.broker);
|
|
6955
6949
|
const hwaccel = createKernelHwAccel();
|
|
6950
|
+
const inferenceEngine = createKernelInferenceEngine();
|
|
6956
6951
|
return {
|
|
6957
6952
|
localNodeId: nodeId,
|
|
6958
6953
|
storage: options?.storageProvider ?? void 0,
|
|
@@ -6973,7 +6968,8 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
6973
6968
|
}),
|
|
6974
6969
|
...runtime.mode === "broker" ? { cluster: { broker: adaptBrokerToCluster(runtime.broker) } } : {},
|
|
6975
6970
|
streamProbe,
|
|
6976
|
-
hwaccel
|
|
6971
|
+
hwaccel,
|
|
6972
|
+
inferenceEngine
|
|
6977
6973
|
};
|
|
6978
6974
|
})(),
|
|
6979
6975
|
registerProvider(capabilityName, provider) {
|
|
@@ -7089,4 +7085,4 @@ async function installManifestPythonDeps(declaration, addonDir, deps, logger) {
|
|
|
7089
7085
|
await deps.installPythonRequirements(reqAbs);
|
|
7090
7086
|
}
|
|
7091
7087
|
//#endregion
|
|
7092
|
-
export {
|
|
7088
|
+
export { buildUdsNativeCapProxy as $, createParentUnownedCallHandler as A, AGENT_CAP_FWD_SERVICE as B, buildLinkChain as C, HUB_CAP_FWD_ACTION as D, localProviderLink as E, createUdsLoggerWithControl as F, createLocalTransport as G, CapRouteError as H, LocalChildClient as I, SocketChannel as J, UdsLocalTransportClient as K, LocalChildRegistry as L, createUdsEventBus as M, udsChildLogToWorkerEntry as N, HUB_CAP_FWD_SERVICE as O, createUdsLogger as P, buildNativeCapProxy as Q, UDS_NO_ROUTE_PREFIX as R, brokerTransportLink as S, ipcParentLink as T, classifyCapRoute as U, CapRouteResolver as V, callWithServiceDiscovery as W, FrameDecoder as X, localEndpointPath as Y, encodeFrame as Z, resolveHwAccel as _, CapabilityUnavailableError as _t, getWorkerDeviceRegistry as a, createAddonService as at, getCapUsageRegistry as b, setHubConnected as c, capActionName as ct, getMoleculerEventStats as d, capServiceName as dt, createBrokerDeviceManagerApi as et, registerEventBusService as f, parseCapAction as ft, createKernelHwAccel as g, CapabilityHandle as gt, AddonDepsManager as h, DeviceRegistry as ht, createUdsAddonContext as i, setWorkerNativeCapsChangeListener as it, createUdsEventBridge as j, createHubCapForwardService as k, EVENT_TOPIC_PREFIX as l, capActionSuffix as lt, subscribePassthrough as m, serializeTypedArrays as mt, adaptBrokerToCluster as n, getWorkerNativeCapSnapshot as nt, getOrInitReadinessRegistry as o, validateProviderRegistrations as ot, setNodeEventInterest 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, getBrokerEventBus as u, capBareAction as ut, CapUsageRegistry as v, installManifestNativeDeps as vt, ipcChildLink as w, brokerCallForCap as x, __resetCapUsageRegistryForTests as y, resolveAddonClass as yt, AGENT_CAP_FWD_ACTION as z };
|
package/package.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { HardwareDecodeAccels, IScopedLogger } from '@camstack/types';
|
|
2
|
-
/**
|
|
3
|
-
* Injectable runner for `ffmpeg -hwaccels`. Defaults to a real `execFile`;
|
|
4
|
-
* tests pass a fake to assert behaviour without spawning ffmpeg.
|
|
5
|
-
*/
|
|
6
|
-
export type HwAccelExecFn = (ffmpegPath: string, args: readonly string[]) => Promise<{
|
|
7
|
-
stdout: string;
|
|
8
|
-
}>;
|
|
9
|
-
/**
|
|
10
|
-
* Parse the output of `ffmpeg -hwaccels`. The listing looks like:
|
|
11
|
-
*
|
|
12
|
-
* Hardware acceleration methods:
|
|
13
|
-
* videotoolbox
|
|
14
|
-
*
|
|
15
|
-
* The header line is dropped; remaining non-empty trimmed lines are the
|
|
16
|
-
* method names, lowercased and de-duplicated (order preserved).
|
|
17
|
-
*/
|
|
18
|
-
export declare function parseHwAccelsOutput(stdout: string): string[];
|
|
19
|
-
/**
|
|
20
|
-
* Probes which `-hwaccel` decode backends the configured ffmpeg binary
|
|
21
|
-
* supports. Mirrors {@link HardwareEncoderProber} (configured binary, cached,
|
|
22
|
-
* single-flight, forceable). Never throws: a probe failure yields an empty
|
|
23
|
-
* method list so callers fall back to software decode.
|
|
24
|
-
*/
|
|
25
|
-
export declare class HardwareDecodeAccelProber {
|
|
26
|
-
private cached;
|
|
27
|
-
private inflight;
|
|
28
|
-
private readonly logger;
|
|
29
|
-
private readonly ffmpegPath;
|
|
30
|
-
private readonly execFn;
|
|
31
|
-
constructor(logger: IScopedLogger, ffmpegPath?: string, execFn?: HwAccelExecFn);
|
|
32
|
-
getCached(): HardwareDecodeAccels | null;
|
|
33
|
-
probe(options?: {
|
|
34
|
-
readonly force?: boolean;
|
|
35
|
-
}): Promise<HardwareDecodeAccels>;
|
|
36
|
-
private runProbe;
|
|
37
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HardwareInfo, HardwareEncoders, IScopedLogger } from '@camstack/types';
|
|
2
|
-
export declare class HardwareEncoderProber {
|
|
3
|
-
private cached;
|
|
4
|
-
private inflight;
|
|
5
|
-
private readonly logger;
|
|
6
|
-
private readonly ffmpegPath;
|
|
7
|
-
constructor(logger: IScopedLogger, ffmpegPath?: string);
|
|
8
|
-
getCached(): HardwareEncoders | null;
|
|
9
|
-
probe(hardware: HardwareInfo, options?: {
|
|
10
|
-
readonly force?: boolean;
|
|
11
|
-
}): Promise<HardwareEncoders>;
|
|
12
|
-
private runProbe;
|
|
13
|
-
}
|