@camstack/system 1.1.50 → 1.1.52

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 (64) hide show
  1. package/dist/addon-runner.js +2 -2
  2. package/dist/addon-runner.mjs +2 -2
  3. package/dist/addon-utils.js +1 -1
  4. package/dist/addon-utils.mjs +1 -1
  5. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  13. package/dist/builtins/console-logging/index.js +1 -1
  14. package/dist/builtins/console-logging/index.mjs +1 -1
  15. package/dist/builtins/device-manager/device-linked-devices.d.ts +47 -0
  16. package/dist/builtins/device-manager/device-manager.addon.js +1840 -1712
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +1840 -1712
  18. package/dist/builtins/doorbell/index.d.ts +2 -0
  19. package/dist/builtins/doorbell/index.js +8 -0
  20. package/dist/builtins/doorbell/index.mjs +2 -0
  21. package/dist/builtins/doorbell/trigger-engine.d.ts +69 -0
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.d.ts +87 -0
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.js +489 -0
  24. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +483 -0
  25. package/dist/builtins/hub-forwarder/index.js +1 -1
  26. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  28. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  29. package/dist/builtins/local-network/local-network.addon.js +1 -1
  30. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  31. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  32. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  33. package/dist/builtins/platform-probe/index.js +1 -1
  34. package/dist/builtins/platform-probe/index.mjs +1 -1
  35. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  36. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  37. package/dist/builtins/snapshot/index.js +162 -12
  38. package/dist/builtins/snapshot/index.mjs +162 -12
  39. package/dist/builtins/snapshot/snapshot-media-handler.d.ts +38 -0
  40. package/dist/builtins/snapshot/snapshot.addon.d.ts +26 -0
  41. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  46. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  47. package/dist/builtins/system-config/system-config.addon.js +4 -4
  48. package/dist/builtins/system-config/system-config.addon.mjs +4 -4
  49. package/dist/builtins/winston-logging/index.js +1 -1
  50. package/dist/builtins/winston-logging/index.mjs +1 -1
  51. package/dist/{dist-CC3E-_3h.mjs → dist-B_PSvr-m.mjs} +237 -13
  52. package/dist/{dist-CQYo6Zp8.js → dist-BduBhv6N.js} +242 -12
  53. package/dist/http/file-data-plane.d.ts +8 -0
  54. package/dist/index.d.ts +2 -0
  55. package/dist/index.js +35 -23
  56. package/dist/index.mjs +35 -24
  57. package/dist/kernel/addon-installer.d.ts +8 -0
  58. package/dist/kernel/deps/manifest-native-deps.d.ts +1 -1
  59. package/dist/kernel/deps/npm-command.d.ts +38 -0
  60. package/dist/{manifest-python-deps-DqATCsK0.mjs → manifest-python-deps-CIyvuHAB.mjs} +268 -124
  61. package/dist/{manifest-python-deps-Wy8dNJpr.js → manifest-python-deps-CPAMH5gV.js} +279 -123
  62. package/dist/{model-download-service-C-IHWnXx.mjs → model-download-service-Cp9f4dk6.mjs} +1 -1
  63. package/dist/{model-download-service-D-Umz4-L.js → model-download-service-hf0ookyy.js} +1 -1
  64. package/package.json +13 -1
package/dist/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { A as isCollectionArrayMethod, Ct as parseJsonObject, Dt as scopeKey, E as extractNestedAddonId, Et as resolveCapMount, L as looseSchema, M as isVoidInput, N as kebabToCamel, P as lifecycleJobSchema, Tt as readinessKey, V as objectInputDeclaresAddonId, W as procedureAuthKey, _t as createEvent, at as DEVICE_SETTINGS_CONTRIBUTION_METHODS, bt as expandCapMethods, dt as ReadinessRegistry, ft as ReadinessTimeoutError, gt as asString$1, ht as asNumber, it as DATAPLANE_SECRET_HEADER$1, j as isObjectInput, k as isArrayOutputSchema, mt as asJsonObject$1, nt as errMsg$1, o as METHOD_ACCESS_MAP, ot as DEVICE_STATUS_METHOD, p as addonSettingsCapability, s as RUNTIME_DEFAULTS, t as ALL_CAPABILITY_DEFINITIONS, ut as EventCategory$1, vt as emitDownForOwnedCaps, wt as parseJsonUnknown$1 } from "./dist-CC3E-_3h.mjs";
2
- import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-C-IHWnXx.mjs";
1
+ import { A as isArrayOutputSchema, Ct as parseJsonObject, D as extractNestedAddonId, Dt as scopeKey, Et as resolveCapMount, F as lifecycleJobSchema, G as procedureAuthKey, H as objectInputDeclaresAddonId, M as isObjectInput, N as isVoidInput, P as kebabToCamel, R as looseSchema, Tt as readinessKey, _t as createEvent, at as DATAPLANE_SECRET_HEADER$1, bt as expandCapMethods, dt as ReadinessRegistry, ft as ReadinessTimeoutError, gt as asString$1, ht as asNumber, j as isCollectionArrayMethod, kt as EventCategory$1, mt as asJsonObject$1, o as METHOD_ACCESS_MAP, ot as DEVICE_SETTINGS_CONTRIBUTION_METHODS, p as addonSettingsCapability, rt as errMsg$1, s as RUNTIME_DEFAULTS, st as DEVICE_STATUS_METHOD, t as ALL_CAPABILITY_DEFINITIONS, vt as emitDownForOwnedCaps, wt as parseJsonUnknown$1 } from "./dist-B_PSvr-m.mjs";
2
+ import { a as downloadModel, c as getModelFilePath, d as contentTypeFor, f as createAuthenticatedFileServer, h as resolveFilePath, i as downloadFile, l as isModelDownloaded, m as parseTokenizedUrl, n as collectModelFiles, o as ensureModel, p as parseRangeHeader, r as deleteModelFromDisk, s as fetchJson, t as ModelDownloadService, u as createFileDataPlaneHandler } from "./model-download-service-Cp9f4dk6.mjs";
3
+ 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, bt as resolveAddonClass, 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, xt as createAddonDataPlaneFacility, y as __resetCapUsageRegistryForTests, yt as runNpm, z as AGENT_CAP_FWD_ACTION } from "./manifest-python-deps-CIyvuHAB.mjs";
3
4
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Le3l0qS2.mjs";
4
5
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
5
6
  import { SqliteSettingsAddon, t as SqliteSettingsBackend } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
@@ -19,7 +20,6 @@ import { LocalAuthAddon, a as require_ms, c as __esmMin, d as __toCommonJS, f as
19
20
  import "./builtins/local-auth/index.mjs";
20
21
  import { DeviceManagerAddon } from "./builtins/device-manager/device-manager.addon.mjs";
21
22
  import "./builtins/device-manager/index.mjs";
22
- 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-DqATCsK0.mjs";
23
23
  import { t as CustomActionRegistry } from "./custom-action-registry-BEXwC-oo.mjs";
24
24
  import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
25
25
  import { z } from "zod";
@@ -29,13 +29,13 @@ import { accessSync, constants, existsSync, mkdirSync, readFileSync } from "node
29
29
  import * as path$39 from "node:path";
30
30
  import { dirname, isAbsolute, join, posix, resolve, win32 } from "node:path";
31
31
  import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
32
+ import { asJsonObject, parseJsonUnknown } from "@camstack/types/addon";
32
33
  import { execFile, spawn } from "node:child_process";
33
34
  import * as util$10 from "node:util";
34
35
  import { promisify } from "node:util";
35
36
  import * as vm from "node:vm";
36
37
  import * as os$18 from "node:os";
37
38
  import { lstat, readdir, readlink, realpath } from "node:fs/promises";
38
- import { asJsonObject, parseJsonUnknown } from "@camstack/types/addon";
39
39
  import { EventEmitter } from "node:events";
40
40
  import As from "node:stream";
41
41
  import { StringDecoder } from "node:string_decoder";
@@ -3056,6 +3056,24 @@ var AddonInstaller = class AddonInstaller {
3056
3056
  else this.installSource = "npm";
3057
3057
  }
3058
3058
  /**
3059
+ * Where a bootstrapped npm lives when the host has none on PATH (packaged
3060
+ * Electron agents ship a bare node binary). Persistent — sibling of the
3061
+ * installed addons, survives restarts, downloaded at most once per host.
3062
+ */
3063
+ get npmCacheDir() {
3064
+ return path$39.join(this.addonsDir, ".npm-bootstrap");
3065
+ }
3066
+ /** Shared options for every npm invocation this installer performs. */
3067
+ npmRunOptions(cwd, timeout) {
3068
+ return {
3069
+ cacheDir: this.npmCacheDir,
3070
+ registry: this.registry,
3071
+ logger: this.logger,
3072
+ cwd,
3073
+ timeout
3074
+ };
3075
+ }
3076
+ /**
3059
3077
  * Derive the bootstrap addon list from a meta-package's runtime dependencies.
3060
3078
  * Single source of truth: the meta-package's `package.json` declares which
3061
3079
  * `@camstack/addon-*` packages the deployment needs. Replaces previously
@@ -3239,17 +3257,16 @@ var AddonInstaller = class AddonInstaller {
3239
3257
  });
3240
3258
  const strippedDeps = stripBundledDeps(pkgData);
3241
3259
  if (strippedDeps["dependencies"] && typeof strippedDeps["dependencies"] === "object" && Object.keys(strippedDeps["dependencies"]).length > 0) try {
3242
- await execFileAsync("npm", [
3260
+ await runNpm([
3243
3261
  "install",
3244
3262
  "--omit=dev",
3245
3263
  "--ignore-scripts=false"
3246
- ], {
3247
- cwd: targetDir,
3248
- timeout: 12e4
3249
- });
3250
- } catch {}
3264
+ ], this.npmRunOptions(targetDir, 12e4));
3265
+ } catch (err) {
3266
+ this.logger.warn(`${packageName} — npm install failed (continuing)`, { meta: { error: errMsg$1(err) } });
3267
+ }
3251
3268
  try {
3252
- await installManifestNativeDeps(targetDir, pkgData, this.logger, this.registry);
3269
+ await installManifestNativeDeps(targetDir, pkgData, this.logger, this.registry, this.npmCacheDir);
3253
3270
  } catch (err) {
3254
3271
  this.logger.warn(`${packageName} — native deps install failed (continuing)`, { meta: { error: errMsg$1(err) } });
3255
3272
  }
@@ -3280,7 +3297,7 @@ var AddonInstaller = class AddonInstaller {
3280
3297
  tmpDir
3281
3298
  ];
3282
3299
  if (this.registry) args.push("--registry", this.registry);
3283
- const { stdout } = await execFileAsync("npm", args, { timeout: 12e4 });
3300
+ const { stdout } = await runNpm(args, this.npmRunOptions(tmpDir, 12e4));
3284
3301
  const tgzFiles = fs$17.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
3285
3302
  if (tgzFiles.length === 0) throw new Error(`npm pack produced no tgz. stdout: ${stdout.trim()}`);
3286
3303
  return path$39.join(tmpDir, tgzFiles[0]);
@@ -3421,7 +3438,7 @@ var AddonInstaller = class AddonInstaller {
3421
3438
  if (strippedRuntimeDeps != null && typeof strippedRuntimeDeps === "object" && Object.keys(strippedRuntimeDeps).length > 0) {
3422
3439
  this.logger.info(`${pkgView.name} — installing runtime dependencies`, { meta: { stagingDir: pkgDir } });
3423
3440
  try {
3424
- await execFileAsync("npm", [
3441
+ await runNpm([
3425
3442
  "install",
3426
3443
  "--omit=dev",
3427
3444
  "--omit=peer",
@@ -3429,16 +3446,13 @@ var AddonInstaller = class AddonInstaller {
3429
3446
  "--no-fund",
3430
3447
  "--no-package-lock",
3431
3448
  ...this.registry ? ["--registry", this.registry] : []
3432
- ], {
3433
- cwd: pkgDir,
3434
- timeout: 24e4
3435
- });
3449
+ ], this.npmRunOptions(pkgDir, 24e4));
3436
3450
  } catch (err) {
3437
- this.logger.warn(`${pkgView.name} — npm install failed (continuing)`, { meta: { error: err instanceof Error ? err.message : String(err) } });
3451
+ throw new Error(`${pkgView.name} — runtime dependency install failed: ${errMsg$1(err)}`, { cause: err });
3438
3452
  }
3439
3453
  }
3440
3454
  try {
3441
- await installManifestNativeDeps(pkgDir, pkgView.raw, this.logger, this.registry);
3455
+ await installManifestNativeDeps(pkgDir, pkgView.raw, this.logger, this.registry, this.npmCacheDir);
3442
3456
  } catch (nativeErr) {
3443
3457
  throw new Error(`${pkgView.name} — native deps install failed: ${errMsg$1(nativeErr)}`, { cause: nativeErr });
3444
3458
  }
@@ -3740,10 +3754,7 @@ var AddonInstaller = class AddonInstaller {
3740
3754
  if (!(!fs$17.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
3741
3755
  this.logger.info(`${packageName} — building (dist/ missing or incomplete)`);
3742
3756
  try {
3743
- await execFileAsync("npm", ["run", "build"], {
3744
- cwd: sourceDir,
3745
- timeout: 18e4
3746
- });
3757
+ await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
3747
3758
  } catch (err) {
3748
3759
  const msg = errMsg$1(err);
3749
3760
  this.logger.warn(`${packageName} auto-build failed`, { meta: { error: msg } });
@@ -93370,4 +93381,4 @@ async function stageFrameworkLockstep(input) {
93370
93381
  return results;
93371
93382
  }
93372
93383
  //#endregion
93373
- export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, ALL_CAPABILITY_DEFINITIONS, 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, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, 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, METHOD_ACCESS_MAP, 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, addonSettingsCapability, 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, expandCapMethods, 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, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, 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 };
93384
+ export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, ALL_CAPABILITY_DEFINITIONS, 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, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, 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, METHOD_ACCESS_MAP, 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, addonSettingsCapability, 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, createAddonDataPlaneFacility, 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, expandCapMethods, 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, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, 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 };
@@ -49,6 +49,14 @@ export declare class AddonInstaller {
49
49
  */
50
50
  readonly manifest: AddonManifest;
51
51
  constructor(config: AddonInstallerConfig, logger?: IScopedLogger);
52
+ /**
53
+ * Where a bootstrapped npm lives when the host has none on PATH (packaged
54
+ * Electron agents ship a bare node binary). Persistent — sibling of the
55
+ * installed addons, survives restarts, downloaded at most once per host.
56
+ */
57
+ private get npmCacheDir();
58
+ /** Shared options for every npm invocation this installer performs. */
59
+ private npmRunOptions;
52
60
  /**
53
61
  * Derive the bootstrap addon list from a meta-package's runtime dependencies.
54
62
  * Single source of truth: the meta-package's `package.json` declares which
@@ -22,4 +22,4 @@ import { IScopedLogger } from '@camstack/types';
22
22
  * ABI; surface a clear error at first `import` of the native module
23
23
  * otherwise).
24
24
  */
25
- export declare function installManifestNativeDeps(addonDir: string, pkgRaw: Record<string, unknown>, logger: IScopedLogger, registry?: string): Promise<void>;
25
+ export declare function installManifestNativeDeps(addonDir: string, pkgRaw: Record<string, unknown>, logger: IScopedLogger, registry?: string, npmCacheDir?: string): Promise<void>;
@@ -0,0 +1,38 @@
1
+ import { IScopedLogger } from '@camstack/types';
2
+ /** How the caller must spawn npm: `execFile(command, [...argsPrefix, ...npmArgs])`. */
3
+ export interface NpmInvocation {
4
+ readonly command: string;
5
+ readonly argsPrefix: readonly string[];
6
+ }
7
+ export interface ResolveNpmInvocationOptions {
8
+ /** Directory that holds (or receives) the bootstrapped npm package. */
9
+ readonly cacheDir: string;
10
+ /** npm registry base URL; defaults to the public registry. */
11
+ readonly registry?: string | undefined;
12
+ readonly logger: IScopedLogger;
13
+ /** Test seams — production callers omit all of these. */
14
+ readonly probeSystemNpm?: () => Promise<boolean>;
15
+ readonly fetchJson?: (url: string) => Promise<unknown>;
16
+ readonly downloadTarball?: (url: string, destTgz: string) => Promise<void>;
17
+ readonly extractTarball?: (tgzPath: string, destDir: string) => Promise<void>;
18
+ }
19
+ /** Test-only: reset the process-wide memo. */
20
+ export declare function __clearNpmInvocationCacheForTests(): void;
21
+ export declare function resolveNpmInvocation(options: ResolveNpmInvocationOptions): Promise<NpmInvocation>;
22
+ export interface RunNpmOptions {
23
+ readonly cacheDir: string;
24
+ readonly registry?: string | undefined;
25
+ readonly logger: IScopedLogger;
26
+ readonly cwd?: string;
27
+ readonly timeout?: number;
28
+ }
29
+ /**
30
+ * Resolve a working npm (system → bootstrapped → bootstrap) and run it with
31
+ * `args`. The ONE entry point every installer code path uses instead of a raw
32
+ * `execFile('npm', ...)` — so "npm missing on this host" is either solved
33
+ * (bootstrap) or a LOUD, actionable error, never a swallowed ENOENT.
34
+ */
35
+ export declare function runNpm(args: readonly string[], options: RunNpmOptions): Promise<{
36
+ stdout: string;
37
+ stderr: string;
38
+ }>;