@camstack/system 1.2.225 → 1.2.227
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 +2 -2
- package/dist/addon-runner.mjs +2 -2
- package/dist/addon-utils.js +1 -1
- package/dist/addon-utils.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 +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- 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-backend.d.ts +25 -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 +3 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +3 -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/{custom-action-registry-CdLp1P9C.mjs → custom-action-registry-Bl_FtykP.mjs} +1 -1
- package/dist/{custom-action-registry-BTB-LgGN.js → custom-action-registry-mtS2EOEs.js} +1 -1
- package/dist/{dist-DmfYrdAn.mjs → dist-jOwC9aK1.mjs} +233 -53
- package/dist/{dist-DdRxWA7g.js → dist-u8F4ZyXi.js} +233 -53
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -3
- package/dist/index.mjs +4 -4
- package/dist/kernel/deps/npm-command.d.ts +22 -0
- package/dist/{manifest-system-deps-BhYmLVHw.mjs → manifest-system-deps-BEj9Dpu1.mjs} +35 -2
- package/dist/{manifest-system-deps-8x1jgPz_.js → manifest-system-deps-CrSP0Kkp.js} +40 -1
- package/dist/{retired-settings-keys-C-jOWHI0.js → retired-settings-keys-BQr0X6st.js} +1 -1
- package/dist/{retired-settings-keys-B0JHsynV.mjs → retired-settings-keys-Dcgpesdb.mjs} +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 { A as addonSettingsCapability, Dt as procedureAuthKey, Ft as scopesAllowDeviceCap, Jt as errMsg$1, Mt as resolveMethodAuth, Pt as scopesAllowAddon, Qt as DEVICE_STATUS_METHOD, Xt as DATAPLANE_SECRET_HEADER$1, Zt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, _ as RUNTIME_DEFAULTS, _n as readinessKey, _t as logLevelAtMost, an as asJsonObject$1, at as isArrayOutputSchema, cn as createEvent, ct as isObjectInput, dn as expandCapMethods, dt as isVoidInput, ft as kebabToCamel, gn as parseJsonUnknown, h as METHOD_ACCESS_MAP, hn as parseJsonObject, ln as emitDownForOwnedCaps, mt as lifecycleJobSchema, nn as ReadinessRegistry, on as asNumber, ot as isCollectionArrayMethod, p as LOG_LEVEL_RANK, rn as ReadinessTimeoutError, sn as asString$1, t as ALL_CAPABILITY_DEFINITIONS, tt as extractNestedAddonId, vn as resolveCapMount, vt as looseSchema, wt as objectInputDeclaresAddonId, xn as EventCategory$1, yn as scopeKey } from "./dist-
|
|
2
|
+
import { A as addonSettingsCapability, Dt as procedureAuthKey, Ft as scopesAllowDeviceCap, Jt as errMsg$1, Mt as resolveMethodAuth, Pt as scopesAllowAddon, Qt as DEVICE_STATUS_METHOD, Xt as DATAPLANE_SECRET_HEADER$1, Zt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, _ as RUNTIME_DEFAULTS, _n as readinessKey, _t as logLevelAtMost, an as asJsonObject$1, at as isArrayOutputSchema, cn as createEvent, ct as isObjectInput, dn as expandCapMethods, dt as isVoidInput, ft as kebabToCamel, gn as parseJsonUnknown, h as METHOD_ACCESS_MAP, hn as parseJsonObject, ln as emitDownForOwnedCaps, mt as lifecycleJobSchema, nn as ReadinessRegistry, on as asNumber, ot as isCollectionArrayMethod, p as LOG_LEVEL_RANK, rn as ReadinessTimeoutError, sn as asString$1, t as ALL_CAPABILITY_DEFINITIONS, tt as extractNestedAddonId, vn as resolveCapMount, vt as looseSchema, wt as objectInputDeclaresAddonId, xn as EventCategory$1, yn as scopeKey } from "./dist-jOwC9aK1.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";
|
|
@@ -26,9 +26,9 @@ import "./builtins/system-config/index.mjs";
|
|
|
26
26
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
27
27
|
import { _ as fetchJson, a as createFileDataPlaneHandler, c as parseRangeHeader, d as ModelDownloadService, f as collectModelFiles, g as ensureModel, h as downloadModel, i as startEventLoopStallMonitor, l as parseTokenizedUrl, m as downloadFile, n as STALL_TICK_MS, o as contentTypeFor, p as deleteModelFromDisk, r as attributeStall, s as createAuthenticatedFileServer, t as STALL_REPORT_MS, u as resolveFilePath, v as getModelFilePath, y as isModelDownloaded } from "./event-loop-stall-monitor-GPrVvx14.mjs";
|
|
28
28
|
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-2xbgg78V.mjs";
|
|
29
|
-
import { $ as buildUdsNativeCapProxy, $t as
|
|
29
|
+
import { $ as buildUdsNativeCapProxy, $t as ARRAY_BUFFER_CENSUS_THRESHOLD_MB, A as createUdsLoggerWithControl, An as recordSocketFrame, At as HUB_MAIN_HEAP_WATCH_LABEL, B as readMoleculerFanoutMode, Bn as diffCapActionCensus, Bt as createLoopDelayMeter, C as ipcParentLink, Cn as createSocketPlaneMeter, Ct as runNpm, D as createUdsEventBus, Dn as readSocketQueues, Dt as HEAP_RECLAIM_TRIGGER_MB, E as createUdsEventBridge, En as formatSocketPlane, Et as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, F as CapRouteError, Fn as CAP_ACTION_UNLABELLED, Ft as RUNNER_HEAP_WATCH_INTERVAL_MS, G as createLocalTransport, Gn as formatEventPlane, Gt as parseRssBudgetMb, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Hn as createEventPlaneMeter, Ht as describeRss, I as classifyCapRoute, In as EMPTY_CAP_ACTION_READING, It as RUNNER_RSS_BUDGET_ENV, J as SocketChannel, Jt as startHeapWatch, K as UdsLocalTransportClient, Kt as reclaimIntervalMs, L as LocalChildClient, Ln as MAX_CAP_ACTIONS_PER_PEER, Lt as ZERO_LOOP_DELAY, M as AGENT_CAP_FWD_SERVICE, Mn as socketDirectionBytes, Mt as HUB_RSS_BUDGET_ENV, N as CapRouteResolver, Nn as socketDirectionMessages, Nt as RSS_BUDGET_REANNOUNCE_MIN_MS, O as udsChildLogToWorkerEntry, On as EMPTY_SOCKET_DIRECTION, Ot as HEAP_WATCH_INTERVAL_MS, P as callWithServiceDiscovery, Pn as CAP_ACTION_OVERFLOW_LABEL, Pt as RSS_BUDGET_RELEASE_RATIO, Q as buildNativeCapProxy, Qt as ARRAY_BUFFER_CENSUS_SUSTAIN_MS, R as LocalChildRegistry, Rn as capActionLabel, Rt as buildHeapSample, S as buildLinkChain, Sn as SOCKET_QUEUE_TOP_N, St as resolveNpmInvocation, T as createParentUnownedCallHandler, Tn as diffSocketPlane, Tt as HEAP_RECLAIM_MIN_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Un as createEventPlaneReader, Ut as hubMainRssBudget, V as CapUsageRegistry, Vn as EVENT_PLANE_TOP_N, Vt as createV8Reclaimer, W as getCapUsageRegistry, Wn as diffEventPlane, Wt as nextRssBudgetState, X as FrameDecoder, Xt as strandedMb, Y as localEndpointPath, Yt as startRunnerHeapWatch, Z as encodeFrame, Zt as ARRAY_BUFFER_CENSUS_COOLDOWN_MS, _ as AddonDepsManager, _n as MESH_QUEUE_TOP_N, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as DECISIVE_HEAP_SPACES, at as createAddonService, b as brokerCallForCap, bn as EMPTY_SOCKET_PLANE_BASELINE, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatHeapSpaces, ct as capActionName, d as clusterEventTopic, dn as selectReportedSpaces, dt as capServiceName, en as ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as OUTBOUND_QUEUE_COOLDOWN_MS, ft as parseCapAction, g as subscribePassthrough, gn as formatOutboundQueueVerdict, gt as CapabilityHandle, h as setNodeEventInterest, hn as createOutboundQueueGate, ht as DeviceRegistry, i as createAddonContext, in as isArrayBufferCensusReport, j as AGENT_CAP_FWD_ACTION, jn as sampleSocketDirection, jt as HUB_MAIN_RSS_BUDGET_MB, k as createUdsLogger, kn as createSocketDirectionCounters, kt as HEAP_WATCH_WARN_RATIO, l as setHubConnected, ln as heapSpaceField, lt as capActionSuffix, m as registerEventBusService, mn as OUTBOUND_QUEUE_THRESHOLD_BYTES, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as createInspectorArrayBufferCensus, o as getWorkerDeviceRegistry, on as HEAP_SPACE_REPORT_MIN_MB, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as OUTBOUND_QUEUE_SUSTAIN_MS, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as shouldReclaim, r as adaptBrokerToCluster, rn as formatArrayBufferCensus, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as emitHeapDiagnosticReport, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as createArrayBufferCensusGate, u as EVENT_TOPIC_PREFIX, un as readHeapSpaces, ut as capBareAction, v as createKernelHwAccel, vn as createMeshQueueReader, vt as copyBundledNativeModules, w as localProviderLink, wn as createSocketPlaneReader, wt as createAddonDataPlaneFacility, x as brokerTransportLink, xn as SOCKET_PLANE_TOP_N, xt as buildNpmChildEnv, y as resolveHwAccel, yn as formatMeshQueue, yt as installManifestNativeDeps, z as UDS_NO_ROUTE_PREFIX, zn as createCapActionCensus, zt as createDeferredHeapWatchSink } from "./manifest-system-deps-BEj9Dpu1.mjs";
|
|
30
30
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Vp0bPV3U.mjs";
|
|
31
|
-
import { t as CustomActionRegistry } from "./custom-action-registry-
|
|
31
|
+
import { t as CustomActionRegistry } from "./custom-action-registry-Bl_FtykP.mjs";
|
|
32
32
|
import { z } from "zod";
|
|
33
33
|
import { createHash, randomUUID, timingSafeEqual } from "node:crypto";
|
|
34
34
|
import { PYTHON_VERSION, buildBinaryPath, downloadBinary, ensureBinary, ensureFfmpeg, ensurePython, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonRequirements } from "@camstack/types/node";
|
|
@@ -95784,4 +95784,4 @@ var LifecycleJobEngine = class {
|
|
|
95784
95784
|
}
|
|
95785
95785
|
};
|
|
95786
95786
|
//#endregion
|
|
95787
|
-
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, 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, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, 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_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
95787
|
+
export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, ARRAY_BUFFER_CENSUS_COOLDOWN_MS, ARRAY_BUFFER_CENSUS_SUSTAIN_MS, ARRAY_BUFFER_CENSUS_THRESHOLD_MB, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, 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, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, 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_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
@@ -21,6 +21,8 @@ export declare function __clearNpmInvocationCacheForTests(): void;
|
|
|
21
21
|
export declare function resolveNpmInvocation(options: ResolveNpmInvocationOptions): Promise<NpmInvocation>;
|
|
22
22
|
export interface RunNpmOptions {
|
|
23
23
|
readonly cacheDir: string;
|
|
24
|
+
/** The environment to derive the child's from. Defaults to `process.env`. */
|
|
25
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
24
26
|
readonly registry?: string | undefined;
|
|
25
27
|
readonly logger: IScopedLogger;
|
|
26
28
|
readonly cwd?: string;
|
|
@@ -32,6 +34,26 @@ export interface RunNpmOptions {
|
|
|
32
34
|
* `execFile('npm', ...)` — so "npm missing on this host" is either solved
|
|
33
35
|
* (bootstrap) or a LOUD, actionable error, never a swallowed ENOENT.
|
|
34
36
|
*/
|
|
37
|
+
/**
|
|
38
|
+
* The environment the npm child gets: the caller's, plus the directory of the
|
|
39
|
+
* Node we are running, FIRST on PATH.
|
|
40
|
+
*
|
|
41
|
+
* Why: on a packaged desktop there is no system npm and no system node — the
|
|
42
|
+
* app ships one bundled Node and the process runs with a bare launchd PATH
|
|
43
|
+
* (`/usr/bin:/bin:/usr/sbin:/sbin`, measured on the Mac-mini agent). npm runs
|
|
44
|
+
* every lifecycle script through `sh -c`, so a script spelled `node install.js`
|
|
45
|
+
* — which is how `node-av`, `better-sqlite3`, `esbuild` and our own closure
|
|
46
|
+
* postinstall are all spelled — dies with `sh: node: command not found`, and
|
|
47
|
+
* the whole install fails at exit 127 with no native prebuilds and no patches.
|
|
48
|
+
*
|
|
49
|
+
* Prepending (not appending) is deliberate: the lifecycle scripts of THIS
|
|
50
|
+
* closure must run on the Node that will load it, not on whatever older Node a
|
|
51
|
+
* host happens to have earlier on PATH.
|
|
52
|
+
*
|
|
53
|
+
* Idempotent, because npm invocations nest: a directory already in front is
|
|
54
|
+
* left alone rather than added again.
|
|
55
|
+
*/
|
|
56
|
+
export declare function buildNpmChildEnv(env: NodeJS.ProcessEnv, execPath: string): NodeJS.ProcessEnv;
|
|
35
57
|
export declare function runNpm(args: readonly string[], options: RunNpmOptions): Promise<{
|
|
36
58
|
stdout: string;
|
|
37
59
|
stderr: string;
|
|
@@ -2694,6 +2694,38 @@ async function resolveNpmInvocation(options) {
|
|
|
2694
2694
|
* `execFile('npm', ...)` — so "npm missing on this host" is either solved
|
|
2695
2695
|
* (bootstrap) or a LOUD, actionable error, never a swallowed ENOENT.
|
|
2696
2696
|
*/
|
|
2697
|
+
/**
|
|
2698
|
+
* The environment the npm child gets: the caller's, plus the directory of the
|
|
2699
|
+
* Node we are running, FIRST on PATH.
|
|
2700
|
+
*
|
|
2701
|
+
* Why: on a packaged desktop there is no system npm and no system node — the
|
|
2702
|
+
* app ships one bundled Node and the process runs with a bare launchd PATH
|
|
2703
|
+
* (`/usr/bin:/bin:/usr/sbin:/sbin`, measured on the Mac-mini agent). npm runs
|
|
2704
|
+
* every lifecycle script through `sh -c`, so a script spelled `node install.js`
|
|
2705
|
+
* — which is how `node-av`, `better-sqlite3`, `esbuild` and our own closure
|
|
2706
|
+
* postinstall are all spelled — dies with `sh: node: command not found`, and
|
|
2707
|
+
* the whole install fails at exit 127 with no native prebuilds and no patches.
|
|
2708
|
+
*
|
|
2709
|
+
* Prepending (not appending) is deliberate: the lifecycle scripts of THIS
|
|
2710
|
+
* closure must run on the Node that will load it, not on whatever older Node a
|
|
2711
|
+
* host happens to have earlier on PATH.
|
|
2712
|
+
*
|
|
2713
|
+
* Idempotent, because npm invocations nest: a directory already in front is
|
|
2714
|
+
* left alone rather than added again.
|
|
2715
|
+
*/
|
|
2716
|
+
function buildNpmChildEnv(env, execPath) {
|
|
2717
|
+
const nodeDir = path$1.dirname(execPath);
|
|
2718
|
+
const current = env["PATH"];
|
|
2719
|
+
if (current === void 0 || current.length === 0) return {
|
|
2720
|
+
...env,
|
|
2721
|
+
PATH: nodeDir
|
|
2722
|
+
};
|
|
2723
|
+
if (current === nodeDir || current.startsWith(`${nodeDir}${path$1.delimiter}`)) return { ...env };
|
|
2724
|
+
return {
|
|
2725
|
+
...env,
|
|
2726
|
+
PATH: `${nodeDir}${path$1.delimiter}${current}`
|
|
2727
|
+
};
|
|
2728
|
+
}
|
|
2697
2729
|
async function runNpm(args, options) {
|
|
2698
2730
|
const invocation = await resolveNpmInvocation({
|
|
2699
2731
|
cacheDir: options.cacheDir,
|
|
@@ -2702,7 +2734,8 @@ async function runNpm(args, options) {
|
|
|
2702
2734
|
});
|
|
2703
2735
|
return execFileAsync$2(invocation.command, [...invocation.argsPrefix, ...args], {
|
|
2704
2736
|
...options.cwd !== void 0 ? { cwd: options.cwd } : {},
|
|
2705
|
-
timeout: options.timeout ?? 3e5
|
|
2737
|
+
timeout: options.timeout ?? 3e5,
|
|
2738
|
+
env: buildNpmChildEnv(options.env ?? process.env, process.execPath)
|
|
2706
2739
|
});
|
|
2707
2740
|
}
|
|
2708
2741
|
async function resolveUncached(options) {
|
|
@@ -11416,4 +11449,4 @@ async function defaultRun(command, args) {
|
|
|
11416
11449
|
await execFileAsync(command, [...args], { timeout: INSTALL_TIMEOUT_MS });
|
|
11417
11450
|
}
|
|
11418
11451
|
//#endregion
|
|
11419
|
-
export { buildUdsNativeCapProxy as $,
|
|
11452
|
+
export { buildUdsNativeCapProxy as $, ARRAY_BUFFER_CENSUS_THRESHOLD_MB as $t, createUdsLoggerWithControl as A, recordSocketFrame as An, HUB_MAIN_HEAP_WATCH_LABEL as At, readMoleculerFanoutMode as B, diffCapActionCensus as Bn, createLoopDelayMeter as Bt, ipcParentLink as C, createSocketPlaneMeter as Cn, runNpm as Ct, createUdsEventBus as D, readSocketQueues as Dn, HEAP_RECLAIM_TRIGGER_MB as Dt, createUdsEventBridge as E, formatSocketPlane as En, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS as Et, CapRouteError as F, CAP_ACTION_UNLABELLED as Fn, RUNNER_HEAP_WATCH_INTERVAL_MS as Ft, createLocalTransport as G, formatEventPlane as Gn, parseRssBudgetMb as Gt, PARENT_ROUTED_PROVIDER_ADDON_ID as H, createEventPlaneMeter as Hn, describeRss as Ht, classifyCapRoute as I, EMPTY_CAP_ACTION_READING as In, RUNNER_RSS_BUDGET_ENV as It, SocketChannel as J, startHeapWatch as Jt, UdsLocalTransportClient as K, reclaimIntervalMs as Kt, LocalChildClient as L, MAX_CAP_ACTIONS_PER_PEER as Ln, ZERO_LOOP_DELAY as Lt, AGENT_CAP_FWD_SERVICE as M, socketDirectionBytes as Mn, HUB_RSS_BUDGET_ENV as Mt, CapRouteResolver as N, socketDirectionMessages as Nn, RSS_BUDGET_REANNOUNCE_MIN_MS as Nt, udsChildLogToWorkerEntry as O, EMPTY_SOCKET_DIRECTION as On, HEAP_WATCH_INTERVAL_MS as Ot, callWithServiceDiscovery as P, CAP_ACTION_OVERFLOW_LABEL as Pn, RSS_BUDGET_RELEASE_RATIO as Pt, buildNativeCapProxy as Q, ARRAY_BUFFER_CENSUS_SUSTAIN_MS as Qt, LocalChildRegistry as R, capActionLabel as Rn, buildHeapSample as Rt, buildLinkChain as S, SOCKET_QUEUE_TOP_N as Sn, resolveNpmInvocation as St, createParentUnownedCallHandler as T, diffSocketPlane as Tn, HEAP_RECLAIM_MIN_INTERVAL_MS as Tt, __resetCapUsageRegistryForTests as U, createEventPlaneReader as Un, hubMainRssBudget as Ut, CapUsageRegistry as V, EVENT_PLANE_TOP_N as Vn, createV8Reclaimer as Vt, getCapUsageRegistry as W, diffEventPlane as Wn, nextRssBudgetState as Wt, FrameDecoder as X, strandedMb as Xt, localEndpointPath as Y, startRunnerHeapWatch as Yt, encodeFrame as Z, ARRAY_BUFFER_CENSUS_COOLDOWN_MS as Zt, AddonDepsManager as _, MESH_QUEUE_TOP_N as _n, CapabilityUnavailableError as _t, createUdsAddonContext as a, DECISIVE_HEAP_SPACES as an, createAddonService as at, brokerCallForCap as b, EMPTY_SOCKET_PLANE_BASELINE as bn, resolveAddonClass as bt, getOrInitReadinessRegistryForClient as c, formatHeapSpaces as cn, capActionName as ct, clusterEventTopic as d, selectReportedSpaces as dn, capServiceName as dt, ARRAY_BUFFER_RELEASE_MIN_DROP_RATIO as en, createBrokerDeviceManagerApi as et, getBrokerEventBus as f, OUTBOUND_QUEUE_COOLDOWN_MS as fn, parseCapAction as ft, subscribePassthrough as g, formatOutboundQueueVerdict as gn, CapabilityHandle as gt, setNodeEventInterest as h, createOutboundQueueGate as hn, DeviceRegistry as ht, createAddonContext as i, isArrayBufferCensusReport as in, setWorkerNativeCapsChangeListener as it, AGENT_CAP_FWD_ACTION as j, sampleSocketDirection as jn, HUB_MAIN_RSS_BUDGET_MB as jt, createUdsLogger as k, createSocketDirectionCounters as kn, HEAP_WATCH_WARN_RATIO as kt, setHubConnected as l, heapSpaceField as ln, capActionSuffix as lt, registerEventBusService as m, OUTBOUND_QUEUE_THRESHOLD_BYTES as mn, serializeTypedArrays as mt, installManifestPythonDeps as n, createInspectorArrayBufferCensus as nn, getWorkerNativeCapSnapshot as nt, getWorkerDeviceRegistry as o, HEAP_SPACE_REPORT_MIN_MB as on, validateProviderRegistrations as ot, getMoleculerEventStats as p, OUTBOUND_QUEUE_SUSTAIN_MS as pn, deserializeTypedArrays as pt, UdsLocalTransportServer as q, shouldReclaim as qt, adaptBrokerToCluster as r, formatArrayBufferCensus as rn, mountNativeCapService as rt, getOrInitReadinessRegistry as s, emitHeapDiagnosticReport as sn, NATIVE_PROVIDER_SERVICE_INFIX as st, installManifestSystemDeps as t, createArrayBufferCensusGate as tn, getWorkerNativeCapProvider as tt, EVENT_TOPIC_PREFIX as u, readHeapSpaces as un, capBareAction as ut, createKernelHwAccel as v, createMeshQueueReader as vn, copyBundledNativeModules as vt, localProviderLink as w, createSocketPlaneReader as wn, createAddonDataPlaneFacility as wt, brokerTransportLink as x, SOCKET_PLANE_TOP_N as xn, buildNpmChildEnv as xt, resolveHwAccel as y, formatMeshQueue as yn, installManifestNativeDeps as yt, UDS_NO_ROUTE_PREFIX as z, createCapActionCensus as zn, createDeferredHeapWatchSink as zt };
|
|
@@ -2697,6 +2697,38 @@ async function resolveNpmInvocation(options) {
|
|
|
2697
2697
|
* `execFile('npm', ...)` — so "npm missing on this host" is either solved
|
|
2698
2698
|
* (bootstrap) or a LOUD, actionable error, never a swallowed ENOENT.
|
|
2699
2699
|
*/
|
|
2700
|
+
/**
|
|
2701
|
+
* The environment the npm child gets: the caller's, plus the directory of the
|
|
2702
|
+
* Node we are running, FIRST on PATH.
|
|
2703
|
+
*
|
|
2704
|
+
* Why: on a packaged desktop there is no system npm and no system node — the
|
|
2705
|
+
* app ships one bundled Node and the process runs with a bare launchd PATH
|
|
2706
|
+
* (`/usr/bin:/bin:/usr/sbin:/sbin`, measured on the Mac-mini agent). npm runs
|
|
2707
|
+
* every lifecycle script through `sh -c`, so a script spelled `node install.js`
|
|
2708
|
+
* — which is how `node-av`, `better-sqlite3`, `esbuild` and our own closure
|
|
2709
|
+
* postinstall are all spelled — dies with `sh: node: command not found`, and
|
|
2710
|
+
* the whole install fails at exit 127 with no native prebuilds and no patches.
|
|
2711
|
+
*
|
|
2712
|
+
* Prepending (not appending) is deliberate: the lifecycle scripts of THIS
|
|
2713
|
+
* closure must run on the Node that will load it, not on whatever older Node a
|
|
2714
|
+
* host happens to have earlier on PATH.
|
|
2715
|
+
*
|
|
2716
|
+
* Idempotent, because npm invocations nest: a directory already in front is
|
|
2717
|
+
* left alone rather than added again.
|
|
2718
|
+
*/
|
|
2719
|
+
function buildNpmChildEnv(env, execPath) {
|
|
2720
|
+
const nodeDir = node_path.dirname(execPath);
|
|
2721
|
+
const current = env["PATH"];
|
|
2722
|
+
if (current === void 0 || current.length === 0) return {
|
|
2723
|
+
...env,
|
|
2724
|
+
PATH: nodeDir
|
|
2725
|
+
};
|
|
2726
|
+
if (current === nodeDir || current.startsWith(`${nodeDir}${node_path.delimiter}`)) return { ...env };
|
|
2727
|
+
return {
|
|
2728
|
+
...env,
|
|
2729
|
+
PATH: `${nodeDir}${node_path.delimiter}${current}`
|
|
2730
|
+
};
|
|
2731
|
+
}
|
|
2700
2732
|
async function runNpm(args, options) {
|
|
2701
2733
|
const invocation = await resolveNpmInvocation({
|
|
2702
2734
|
cacheDir: options.cacheDir,
|
|
@@ -2705,7 +2737,8 @@ async function runNpm(args, options) {
|
|
|
2705
2737
|
});
|
|
2706
2738
|
return execFileAsync$2(invocation.command, [...invocation.argsPrefix, ...args], {
|
|
2707
2739
|
...options.cwd !== void 0 ? { cwd: options.cwd } : {},
|
|
2708
|
-
timeout: options.timeout ?? 3e5
|
|
2740
|
+
timeout: options.timeout ?? 3e5,
|
|
2741
|
+
env: buildNpmChildEnv(options.env ?? process.env, process.execPath)
|
|
2709
2742
|
});
|
|
2710
2743
|
}
|
|
2711
2744
|
async function resolveUncached(options) {
|
|
@@ -11767,6 +11800,12 @@ Object.defineProperty(exports, "buildNativeCapProxy", {
|
|
|
11767
11800
|
return buildNativeCapProxy;
|
|
11768
11801
|
}
|
|
11769
11802
|
});
|
|
11803
|
+
Object.defineProperty(exports, "buildNpmChildEnv", {
|
|
11804
|
+
enumerable: true,
|
|
11805
|
+
get: function() {
|
|
11806
|
+
return buildNpmChildEnv;
|
|
11807
|
+
}
|
|
11808
|
+
});
|
|
11770
11809
|
Object.defineProperty(exports, "buildUdsNativeCapProxy", {
|
|
11771
11810
|
enumerable: true,
|
|
11772
11811
|
get: function() {
|