@camstack/server 1.2.730 → 1.2.731
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/CHANGELOG.md +8 -0
- package/dist/api/core/server-management.provider.js +10 -3
- package/dist/api/trpc/generated-cap-mounts.js +2 -1
- package/dist/api/trpc/generated-cap-routers.js +1801 -1777
- package/dist/boot/boot-config.js +2 -46
- package/dist/launch-args.js +72 -34
- package/dist/main.js +2 -1
- package/package.json +17 -17
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-DZq8uf8L.mjs → agent-https-AJPmB73W.mjs} +1 -1
- package/system/dist/{agent-https-C8Gz2jjS.js → agent-https-CLJhq0GZ.js} +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
- package/system/dist/builtins/alerts/alerts.addon.js +1 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/system/dist/builtins/autotrack/index.js +1 -1
- package/system/dist/builtins/autotrack/index.mjs +1 -1
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
- package/system/dist/builtins/calendars/calendars.addon.js +1 -1
- package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/system/dist/builtins/camera-grid/index.js +1 -1
- package/system/dist/builtins/camera-grid/index.mjs +1 -1
- package/system/dist/builtins/composer/composer.addon.js +3 -3
- package/system/dist/builtins/composer/composer.addon.mjs +3 -3
- package/system/dist/builtins/console-logging/index.js +1 -1
- package/system/dist/builtins/console-logging/index.mjs +1 -1
- package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/system/dist/builtins/device-history/device-history.addon.js +2 -2
- package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
- package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/system/dist/builtins/hub-forwarder/index.js +1 -1
- package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/system/dist/builtins/keychain/index.js +3 -3
- package/system/dist/builtins/keychain/index.mjs +3 -3
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/system-config/system-config.addon.js +3 -3
- package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
- package/system/dist/builtins/winston-logging/index.js +1 -1
- package/system/dist/builtins/winston-logging/index.mjs +1 -1
- package/system/dist/{composition-sources-hokiaS3J.js → composition-sources-BNBlJAgu.js} +1 -1
- package/system/dist/{composition-sources-4M_NnTnV.mjs → composition-sources-D-S2hhdw.mjs} +1 -1
- package/system/dist/{constants-B0L3suFC.js → constants-CKwdQTnw.js} +1 -1
- package/system/dist/{constants-DTVU00LZ.mjs → constants-DmithOex.mjs} +1 -1
- package/system/dist/{coral-accelerators-DBlgWB8k.mjs → coral-accelerators-BW3OcrLD.mjs} +6 -6
- package/system/dist/{custom-action-registry-oHl1xltx.mjs → custom-action-registry-BIJZBObd.mjs} +37 -37
- package/system/dist/{device-ca-C_y2GrU5.mjs → device-ca-D-Cvxobt.mjs} +1 -1
- package/system/dist/{device-ca-DaTT1Y9v.js → device-ca-TbdQfW4d.js} +1 -1
- package/system/dist/{dist-B3S0ruBa.js → dist-dQKZfa3-.js} +174 -15
- package/system/dist/{dist-9lvgpcnm.mjs → dist-yrk6fm65.mjs} +174 -15
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-xgLfZIVx.mjs → hub-mdns-ciao-Cae5VWUc.mjs} +2 -2
- package/system/dist/{hub-mdns-ciao-Dkw38L-g.js → hub-mdns-ciao-DP3_GNZw.js} +2 -2
- package/system/dist/index.d.ts +1 -1
- package/system/dist/index.js +19 -9
- package/system/dist/index.mjs +230 -221
- package/system/dist/kernel/heap-watch.d.ts +7 -2
- package/system/dist/{restore-archive-cxnuWxQM.mjs → restore-archive-BJ5gxMvf.mjs} +94 -94
- package/system/dist/{restore-archive-orP6eHBd.js → restore-archive-X9c_wEBY.js} +1 -1
- package/system/dist/{retention-Me4u6zMp.mjs → retention-DBrdAv12.mjs} +1 -1
- package/system/dist/{retention-CB2cyW9k.js → retention-DRT2wUyB.js} +1 -1
- package/system/dist/{wal-maintenance-De7Ifvph.mjs → wal-maintenance-Bi4yImEY.mjs} +0 -0
- package/system/dist/{wal-maintenance-_PXj626-.js → wal-maintenance-hsgNGrjh.js} +0 -0
- package/system/package.json +4 -1
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { Ao as RUNTIME_DEFAULTS, Ar as isArrayOutputSchema, Di as procedureAuthKey, Ds as readinessKey, E as CatalogFileSchema, Er as interpolate, Go as asNumber, Hi as resolveMethodAuth, Ir as isObjectInput, Ko as asString$1, Lr as isVoidInput, Mo as ReadinessTimeoutError, Rr as kebabToCamel$1, Rs as userError, Ts as parseJsonUnknown, Ur as lifecycleJobSchema, Us as errMsg$1, Wo as asJsonObject$1, Ws as EventCategory$1, Xi as scopesAllowAddon, Xr as logLevelAtMost, Zi as scopesAllowDeviceCap, Zr as looseSchema, _t as LOG_LEVEL_RANK, a as AGENT_MDNS_TXT_KEYS, es as createEvent$1, fo as CALLER_STAMPED_CAPABILITIES$1, ha as supportedRuntimes, ho as DEVICE_STATUS_METHOD, i as AGENT_MDNS_SERVICE_TYPE, in as addonSettingsCapability, is as emitDownForOwnedCaps, jo as ReadinessRegistry, jr as isCollectionArrayMethod, js as scopeKey, ks as resolveCapMount, mi as objectInputDeclaresRequiredDeviceId, mo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, o as ALL_CAPABILITY_DEFINITIONS, os as expandCapMethods, pi as objectInputDeclaresAddonId, po as DATAPLANE_SECRET_HEADER$1, pr as extractNestedAddonId, rs as defineRecordKinds, sa as splitTranslationRef, ws as parseJsonObject, y as CATALOG_LANGS, yt as METHOD_ACCESS_MAP, zs as withoutCallerStamp } from "./dist-
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { Ao as RUNTIME_DEFAULTS, Ar as isArrayOutputSchema, Di as procedureAuthKey, Ds as readinessKey, E as CatalogFileSchema, Er as interpolate, Go as asNumber, Hi as resolveMethodAuth, Ir as isObjectInput, Ko as asString$1, Lr as isVoidInput, Mo as ReadinessTimeoutError, Rr as kebabToCamel$1, Rs as userError, Ts as parseJsonUnknown, Ur as lifecycleJobSchema, Us as errMsg$1, Wo as asJsonObject$1, Ws as EventCategory$1, Xi as scopesAllowAddon, Xr as logLevelAtMost, Zi as scopesAllowDeviceCap, Zr as looseSchema, _t as LOG_LEVEL_RANK, a as AGENT_MDNS_TXT_KEYS, es as createEvent$1, fo as CALLER_STAMPED_CAPABILITIES$1, ha as supportedRuntimes, ho as DEVICE_STATUS_METHOD, i as AGENT_MDNS_SERVICE_TYPE, in as addonSettingsCapability, is as emitDownForOwnedCaps, jo as ReadinessRegistry, jr as isCollectionArrayMethod, js as scopeKey, ks as resolveCapMount, mi as objectInputDeclaresRequiredDeviceId, mo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, o as ALL_CAPABILITY_DEFINITIONS, os as expandCapMethods, pi as objectInputDeclaresAddonId, po as DATAPLANE_SECRET_HEADER$1, pr as extractNestedAddonId, rs as defineRecordKinds, sa as splitTranslationRef, ws as parseJsonObject, y as CATALOG_LANGS, yt as METHOD_ACCESS_MAP, zs as withoutCallerStamp } from "./dist-yrk6fm65.mjs";
|
|
3
|
+
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-D-Cvxobt.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
6
6
|
import "./builtins/alerts/index.mjs";
|
|
@@ -25,22 +25,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
|
|
|
25
25
|
import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
26
26
|
import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
|
|
27
27
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
28
|
-
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-
|
|
28
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-Bi4yImEY.mjs";
|
|
29
29
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
30
30
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
31
31
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, l as STORAGE_DRAIN_STATE_LEGACY, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
32
32
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
33
|
-
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-
|
|
34
|
-
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-
|
|
33
|
+
import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-AJPmB73W.mjs";
|
|
34
|
+
import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-DmithOex.mjs";
|
|
35
35
|
import { $ as caFingerprintCompact, A as getProcessNodeMeshTransport, B as MESH_NODE_CERTIFICATES_COLLECTION, C as MESH_TLS_PORT_HELLO_FIELD, Ct as readOriginSetting, D as setProcessMeshTlsEnabler, Dt as readCidrSetting, E as ServiceBroker, Et as parseCidrList, F as renewMeshCertificate, G as getProcessMeshCertificateRegistry, H as MeshCertificateRegistry, I as revokeMeshCertificate, J as processMeshCrl, K as setProcessMeshCertificateRegistry, L as getProcessMeshTlsListenerState, M as isProcessVerifiedMeshPeer, N as onProcessNodeRegistered, O as dropProcessPeer, P as setProcessMeshPeerTransportLookup, Q as caFingerprint, R as openMeshTlsWhenRevocationsLoaded, S as verifyMembershipAnswer, St as parseOriginList, SystemConfigAddon, T as Errors, Tt as normalizeIp, U as RENEWAL_ABANDONED, V as MESH_NODE_CERTIFICATES_COLUMNS, W as describeMeshLeaf, X as getProcessMeshCaState, Y as MeshCaKeeper, Z as requireProcessMeshCa, _ as signPairingProof, _t as verifyAgentUiUnlockTicket, a as hubHostFromMeshAddress, at as issueMeshLeafForNode, b as MembershipResponder, bt as isInsecureOrigin, c as PAIRING_MAX_SESSIONS, ct as AGENT_DASHBOARD_ORIGINS_FIELD, d as PAIRING_PROTOCOL, dt as AGENT_UI_UNLOCK_USE, et as createMeshCsrPem, f as PAIRING_TTL_MS, ft as AGENT_UI_UNLOCK_VERSION, g as keyFingerprintShort, gt as parseAgentDashboardOrigins, h as describeCsr, ht as mintAgentUiUnlockTicket, i as AgentPairing, it as isValidAgentNodeId, j as getProcessPeerLeaf, k as emitProcessNodeRegistered, l as PAIRING_PATHS, lt as AGENT_UI_UNLOCK_TTL_MS, m as computePairingSas, mt as isAllowedAgentDashboardReturnTo, n as HubPairing, nt as generateMeshCa, o as PAIRING_CODE_DIGITS, ot as issueMeshLeafFromCsr, p as computePairingCommitment, pt as UnlockTicketJtiStore, q as MeshCrl, r as PairingHttpError, rt as generateMeshKeyPair, s as PAIRING_MAX_CODE_ATTEMPTS, st as loadMeshCa, tt as exportMeshPrivateKeyPem, u as PAIRING_PIN_DIGITS, ut as AGENT_UI_UNLOCK_TYP, v as verifyPairingProof, vt as InvalidCorsOriginError, w as TlsTcpTransporter, wt as createCidrMatcher, x as signMembershipProof, xt as normalizeOrigin, y as MEMBERSHIP_PATHS, yt as OPAQUE_ORIGIN, z as setProcessMeshTlsListenerState } from "./builtins/system-config/system-config.addon.mjs";
|
|
36
36
|
import "./builtins/system-config/index.mjs";
|
|
37
37
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
38
|
-
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-
|
|
39
|
-
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-
|
|
38
|
+
import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-BIJZBObd.mjs";
|
|
39
|
+
import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-Cae5VWUc.mjs";
|
|
40
40
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
41
41
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
42
|
-
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
43
|
-
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-
|
|
42
|
+
import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-BJ5gxMvf.mjs";
|
|
43
|
+
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-BW3OcrLD.mjs";
|
|
44
44
|
import { z } from "zod";
|
|
45
45
|
import * as crypto$1 from "node:crypto";
|
|
46
46
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -55,7 +55,7 @@ import * as os$1 from "node:os";
|
|
|
55
55
|
import { tmpdir } from "node:os";
|
|
56
56
|
import { pathToFileURL } from "node:url";
|
|
57
57
|
import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, ErrorI18nPayloadSchema, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, addonSliceHandleApi, asJsonObject, asString, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createRecordsAccess, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readErrorI18n, readNodePin, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
|
|
58
|
-
import * as fs
|
|
58
|
+
import * as fs from "node:fs";
|
|
59
59
|
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
60
60
|
import { execFile, spawn } from "node:child_process";
|
|
61
61
|
import { once } from "node:events";
|
|
@@ -2988,8 +2988,17 @@ var HUB_RSS_BUDGET_ENV = "CAMSTACK_HUB_RSS_BUDGET_MB";
|
|
|
2988
2988
|
* instead of being absorbed by a threshold nobody set.
|
|
2989
2989
|
*/
|
|
2990
2990
|
var HUB_MAIN_RSS_BUDGET_MB = 4096;
|
|
2991
|
-
/**
|
|
2992
|
-
|
|
2991
|
+
/** Source label when the budget comes from the node's launch-overrides setting. */
|
|
2992
|
+
var HUB_RSS_BUDGET_OVERRIDE_SOURCE = "node setting (launch-overrides.json rssBudgetMb)";
|
|
2993
|
+
/**
|
|
2994
|
+
* hub-main's budget: the node setting (`overrideMb`, from `launch-overrides.json`),
|
|
2995
|
+
* else the operator's env override, else the declared number.
|
|
2996
|
+
*/
|
|
2997
|
+
function hubMainRssBudget(env = process.env, overrideMb = null) {
|
|
2998
|
+
if (overrideMb !== null) return {
|
|
2999
|
+
budgetMb: overrideMb,
|
|
3000
|
+
source: HUB_RSS_BUDGET_OVERRIDE_SOURCE
|
|
3001
|
+
};
|
|
2993
3002
|
const override = env[HUB_RSS_BUDGET_ENV];
|
|
2994
3003
|
if (override !== void 0) return {
|
|
2995
3004
|
budgetMb: parseRssBudgetMb(override),
|
|
@@ -5092,7 +5101,7 @@ var PythonEnvManager = class {
|
|
|
5092
5101
|
async ensure(options) {
|
|
5093
5102
|
const probe = await this.probe();
|
|
5094
5103
|
if (!probe.available || !probe.path) throw userError("system.python-required", void 0, "Python 3.10+ is required but not found on this system");
|
|
5095
|
-
if (!fs
|
|
5104
|
+
if (!fs.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5096
5105
|
"-m",
|
|
5097
5106
|
"venv",
|
|
5098
5107
|
this.venvPath
|
|
@@ -5115,7 +5124,7 @@ var PythonEnvManager = class {
|
|
|
5115
5124
|
}
|
|
5116
5125
|
spawn(script, args) {
|
|
5117
5126
|
const venvPython = path$1.join(this.venvPath, "bin", "python");
|
|
5118
|
-
if (!fs
|
|
5127
|
+
if (!fs.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5119
5128
|
return spawn(venvPython, [script, ...args]);
|
|
5120
5129
|
}
|
|
5121
5130
|
};
|
|
@@ -5467,20 +5476,20 @@ var StorageManager = class {
|
|
|
5467
5476
|
const basePath = this.locationManager.getBackend(mappedName).basePath;
|
|
5468
5477
|
location.files = {
|
|
5469
5478
|
async readFile(p) {
|
|
5470
|
-
return fs
|
|
5479
|
+
return fs.promises.readFile(path$1.join(basePath, p));
|
|
5471
5480
|
},
|
|
5472
5481
|
async writeFile(p, data) {
|
|
5473
5482
|
const full = path$1.join(basePath, p);
|
|
5474
|
-
await fs
|
|
5475
|
-
await fs
|
|
5483
|
+
await fs.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5484
|
+
await fs.promises.writeFile(full, data);
|
|
5476
5485
|
},
|
|
5477
5486
|
async deleteFile(p) {
|
|
5478
|
-
await fs
|
|
5487
|
+
await fs.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5479
5488
|
},
|
|
5480
5489
|
async listFiles(prefix) {
|
|
5481
5490
|
const dir = prefix ? path$1.join(basePath, prefix) : basePath;
|
|
5482
5491
|
try {
|
|
5483
|
-
return (await fs
|
|
5492
|
+
return (await fs.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5484
5493
|
} catch {
|
|
5485
5494
|
return [];
|
|
5486
5495
|
}
|
|
@@ -5490,7 +5499,7 @@ var StorageManager = class {
|
|
|
5490
5499
|
},
|
|
5491
5500
|
async exists(p) {
|
|
5492
5501
|
try {
|
|
5493
|
-
await fs
|
|
5502
|
+
await fs.promises.access(path$1.join(basePath, p));
|
|
5494
5503
|
return true;
|
|
5495
5504
|
} catch {
|
|
5496
5505
|
return false;
|
|
@@ -6261,7 +6270,7 @@ var TRADITIONAL_NATIVE_PACKAGES = ["better-sqlite3"];
|
|
|
6261
6270
|
function hasDotNode(dir, maxDepth) {
|
|
6262
6271
|
let entries;
|
|
6263
6272
|
try {
|
|
6264
|
-
entries = fs
|
|
6273
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
6265
6274
|
} catch {
|
|
6266
6275
|
return false;
|
|
6267
6276
|
}
|
|
@@ -6272,7 +6281,7 @@ function hasDotNode(dir, maxDepth) {
|
|
|
6272
6281
|
}
|
|
6273
6282
|
/** Locate the bundled `prebuild-install` bin.js inside the staged closure. */
|
|
6274
6283
|
function resolvePrebuildInstallBin(closureDir, moduleDir) {
|
|
6275
|
-
return [path$1.join(moduleDir, "node_modules", "prebuild-install", "bin.js"), path$1.join(closureDir, "node_modules", "prebuild-install", "bin.js")].find((c) => fs
|
|
6284
|
+
return [path$1.join(moduleDir, "node_modules", "prebuild-install", "bin.js"), path$1.join(closureDir, "node_modules", "prebuild-install", "bin.js")].find((c) => fs.existsSync(c)) ?? null;
|
|
6276
6285
|
}
|
|
6277
6286
|
/**
|
|
6278
6287
|
* Default fetcher: run the closure's own `prebuild-install` under the CURRENT
|
|
@@ -6325,7 +6334,7 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6325
6334
|
const fetched = [];
|
|
6326
6335
|
for (const pkg of packages) {
|
|
6327
6336
|
const moduleDir = path$1.join(nm, pkg);
|
|
6328
|
-
if (!fs
|
|
6337
|
+
if (!fs.existsSync(moduleDir)) continue;
|
|
6329
6338
|
if (hasDotNode(moduleDir, 4)) continue;
|
|
6330
6339
|
options.logger.warn("staged closure native prebuild missing — fetching for running ABI", { meta: {
|
|
6331
6340
|
pkg,
|
|
@@ -6388,12 +6397,12 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6388
6397
|
function replantFromBundled(srcModuleDir, dstModuleDir, hasNative) {
|
|
6389
6398
|
if (!hasNative(srcModuleDir)) return false;
|
|
6390
6399
|
try {
|
|
6391
|
-
fs
|
|
6400
|
+
fs.rmSync(dstModuleDir, {
|
|
6392
6401
|
recursive: true,
|
|
6393
6402
|
force: true
|
|
6394
6403
|
});
|
|
6395
|
-
fs
|
|
6396
|
-
fs
|
|
6404
|
+
fs.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6405
|
+
fs.cpSync(srcModuleDir, dstModuleDir, {
|
|
6397
6406
|
recursive: true,
|
|
6398
6407
|
dereference: true
|
|
6399
6408
|
});
|
|
@@ -6422,7 +6431,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
|
|
|
6422
6431
|
const missing = [];
|
|
6423
6432
|
for (const pkg of packages) {
|
|
6424
6433
|
const moduleDir = path$1.join(nm, pkg);
|
|
6425
|
-
if (!fs
|
|
6434
|
+
if (!fs.existsSync(moduleDir)) continue;
|
|
6426
6435
|
if (hasNative(moduleDir)) {
|
|
6427
6436
|
results.push({
|
|
6428
6437
|
pkg,
|
|
@@ -6521,7 +6530,7 @@ async function defaultDownloadTarball(url, destTgz) {
|
|
|
6521
6530
|
const res = await fetch(url);
|
|
6522
6531
|
if (!res.ok || !res.body) throw new Error(`HTTP ${res.status} downloading ${url}`);
|
|
6523
6532
|
const bytes = Buffer.from(await res.arrayBuffer());
|
|
6524
|
-
await fs
|
|
6533
|
+
await fs.promises.writeFile(destTgz, bytes);
|
|
6525
6534
|
}
|
|
6526
6535
|
async function defaultExtractTarball(tgzPath, destDir) {
|
|
6527
6536
|
await execFileAsync$5("tar", [
|
|
@@ -6607,7 +6616,7 @@ async function resolveUncached(options) {
|
|
|
6607
6616
|
argsPrefix: []
|
|
6608
6617
|
};
|
|
6609
6618
|
const cliPath = bootstrappedCliPath(options.cacheDir);
|
|
6610
|
-
if (fs
|
|
6619
|
+
if (fs.existsSync(cliPath)) {
|
|
6611
6620
|
options.logger.info("system npm unavailable — using bootstrapped npm", { meta: { cliPath } });
|
|
6612
6621
|
return {
|
|
6613
6622
|
command: process.execPath,
|
|
@@ -6619,12 +6628,12 @@ async function resolveUncached(options) {
|
|
|
6619
6628
|
const registry = (options.registry ?? DEFAULT_REGISTRY).replace(/\/+$/, "");
|
|
6620
6629
|
const tarballUrl = tarballUrlOf(await (options.fetchJson ?? defaultFetchJson)(`${registry}/npm/latest`));
|
|
6621
6630
|
if (!tarballUrl) throw new Error(`registry metadata for 'npm' carries no dist.tarball (${registry})`);
|
|
6622
|
-
await fs
|
|
6631
|
+
await fs.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6623
6632
|
const tgzPath = path$1.join(options.cacheDir, "npm-bootstrap.tgz");
|
|
6624
6633
|
await (options.downloadTarball ?? defaultDownloadTarball)(tarballUrl, tgzPath);
|
|
6625
6634
|
await (options.extractTarball ?? defaultExtractTarball)(tgzPath, options.cacheDir);
|
|
6626
|
-
await fs
|
|
6627
|
-
if (!fs
|
|
6635
|
+
await fs.promises.rm(tgzPath, { force: true });
|
|
6636
|
+
if (!fs.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6628
6637
|
options.logger.info("npm bootstrapped", { meta: { cliPath } });
|
|
6629
6638
|
return {
|
|
6630
6639
|
command: process.execPath,
|
|
@@ -6690,7 +6699,7 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6690
6699
|
let dir = path$1.dirname(entryPath);
|
|
6691
6700
|
for (let hop = 0; hop < PACKAGE_JSON_LOOKUP_DEPTH; hop++) {
|
|
6692
6701
|
try {
|
|
6693
|
-
const version = asJsonObject$1(parseJsonUnknown(fs
|
|
6702
|
+
const version = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6694
6703
|
if (typeof version === "string" && version.length > 0) return version;
|
|
6695
6704
|
} catch {}
|
|
6696
6705
|
const parent = path$1.dirname(dir);
|
|
@@ -6734,14 +6743,14 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6734
6743
|
function addonModuleCacheKey(entryPath) {
|
|
6735
6744
|
let stat;
|
|
6736
6745
|
try {
|
|
6737
|
-
stat = fs
|
|
6746
|
+
stat = fs.statSync(entryPath);
|
|
6738
6747
|
} catch {
|
|
6739
6748
|
return null;
|
|
6740
6749
|
}
|
|
6741
6750
|
const version = readOwningPackageVersion(entryPath) ?? `m${stat.mtimeMs}`;
|
|
6742
6751
|
let content;
|
|
6743
6752
|
try {
|
|
6744
|
-
content = createHash("sha1").update(fs
|
|
6753
|
+
content = createHash("sha1").update(fs.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6745
6754
|
} catch {
|
|
6746
6755
|
content = `m${stat.mtimeMs}s${stat.size}`;
|
|
6747
6756
|
}
|
|
@@ -6845,14 +6854,14 @@ var AddonLoader = class {
|
|
|
6845
6854
|
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
6846
6855
|
* the addons-dir `@camstack/server/system` must NOT be double-loaded here. */
|
|
6847
6856
|
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
6848
|
-
if (!fs
|
|
6857
|
+
if (!fs.existsSync(addonsDir)) return;
|
|
6849
6858
|
const skip = new Set(skipPackages);
|
|
6850
|
-
const entries = fs
|
|
6859
|
+
const entries = fs.readdirSync(addonsDir, { withFileTypes: true });
|
|
6851
6860
|
for (const entry of entries) {
|
|
6852
6861
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
6853
6862
|
if (entry.name.startsWith("@")) {
|
|
6854
6863
|
const scopeDir = path$1.join(addonsDir, entry.name);
|
|
6855
|
-
const scopeEntries = fs
|
|
6864
|
+
const scopeEntries = fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
6856
6865
|
for (const scopeEntry of scopeEntries) {
|
|
6857
6866
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
6858
6867
|
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
@@ -6866,7 +6875,7 @@ var AddonLoader = class {
|
|
|
6866
6875
|
}
|
|
6867
6876
|
async tryLoadAddon(addonDir) {
|
|
6868
6877
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6869
|
-
if (!fs
|
|
6878
|
+
if (!fs.existsSync(pkgJsonPath)) return;
|
|
6870
6879
|
try {
|
|
6871
6880
|
await this.loadFromAddonDir(addonDir);
|
|
6872
6881
|
} catch (err) {
|
|
@@ -6884,7 +6893,7 @@ var AddonLoader = class {
|
|
|
6884
6893
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
6885
6894
|
async loadFromAddonDir(addonDir) {
|
|
6886
6895
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6887
|
-
const pkgJson = asJsonObject$1(parseJsonUnknown(fs
|
|
6896
|
+
const pkgJson = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6888
6897
|
const packageNameRaw = pkgJson["name"];
|
|
6889
6898
|
const packageName = typeof packageNameRaw === "string" ? packageNameRaw : "";
|
|
6890
6899
|
const packageVersionRaw = pkgJson["version"];
|
|
@@ -6931,7 +6940,7 @@ var AddonLoader = class {
|
|
|
6931
6940
|
}
|
|
6932
6941
|
const entryFile = declaration.entry.replace(/^\.\//, "").replace(/^src\//, "dist/").replace(/\.ts$/, ".js");
|
|
6933
6942
|
let entryPath = path$1.resolve(addonDir, entryFile);
|
|
6934
|
-
if (!fs
|
|
6943
|
+
if (!fs.existsSync(entryPath)) {
|
|
6935
6944
|
const base = entryPath.replace(/\.(js|cjs|mjs)$/, "");
|
|
6936
6945
|
entryPath = [
|
|
6937
6946
|
`${base}.cjs`,
|
|
@@ -6940,9 +6949,9 @@ var AddonLoader = class {
|
|
|
6940
6949
|
path$1.resolve(addonDir, "dist", "index.cjs"),
|
|
6941
6950
|
path$1.resolve(addonDir, "dist", "index.mjs"),
|
|
6942
6951
|
path$1.resolve(addonDir, declaration.entry)
|
|
6943
|
-
].find((p) => fs
|
|
6952
|
+
].find((p) => fs.existsSync(p)) ?? entryPath;
|
|
6944
6953
|
}
|
|
6945
|
-
if (!fs
|
|
6954
|
+
if (!fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6946
6955
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6947
6956
|
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6948
6957
|
const AddonClass = resolveAddonClass(mod);
|
|
@@ -7027,7 +7036,7 @@ function isDirectoryEntry(entry, parentDir) {
|
|
|
7027
7036
|
if (entry.name.startsWith(".")) return false;
|
|
7028
7037
|
if (entry.isDirectory()) return true;
|
|
7029
7038
|
if (entry.isSymbolicLink()) try {
|
|
7030
|
-
return fs
|
|
7039
|
+
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
7031
7040
|
} catch {
|
|
7032
7041
|
return false;
|
|
7033
7042
|
}
|
|
@@ -7121,7 +7130,7 @@ var execFileAsync$4 = promisify(execFile);
|
|
|
7121
7130
|
* Single source of truth — replaces scattered mkdirSync calls.
|
|
7122
7131
|
*/
|
|
7123
7132
|
function ensureDir(dirPath) {
|
|
7124
|
-
fs
|
|
7133
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
7125
7134
|
}
|
|
7126
7135
|
/**
|
|
7127
7136
|
* Copy a directory recursively — ASYNC so it never blocks the event loop.
|
|
@@ -7134,7 +7143,7 @@ function ensureDir(dirPath) {
|
|
|
7134
7143
|
* `fs.promises.cp` keeps the I/O off the event loop. (Node ≥18 stable.)
|
|
7135
7144
|
*/
|
|
7136
7145
|
async function copyDirRecursive(src, dest) {
|
|
7137
|
-
await fs
|
|
7146
|
+
await fs.promises.cp(src, dest, {
|
|
7138
7147
|
recursive: true,
|
|
7139
7148
|
force: true
|
|
7140
7149
|
});
|
|
@@ -7239,13 +7248,13 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7239
7248
|
if (typeof fileEntry !== "string") continue;
|
|
7240
7249
|
if (fileEntry === "dist" || fileEntry.includes("*")) continue;
|
|
7241
7250
|
const srcPath = path$1.join(sourceDir, fileEntry);
|
|
7242
|
-
if (!fs
|
|
7251
|
+
if (!fs.existsSync(srcPath)) continue;
|
|
7243
7252
|
const destPath = path$1.join(destDir, fileEntry);
|
|
7244
|
-
const stat = await fs
|
|
7253
|
+
const stat = await fs.promises.stat(srcPath);
|
|
7245
7254
|
if (stat.isDirectory()) await copyDirRecursive(srcPath, destPath);
|
|
7246
7255
|
else if (stat.isFile()) {
|
|
7247
7256
|
ensureDir(path$1.dirname(destPath));
|
|
7248
|
-
await fs
|
|
7257
|
+
await fs.promises.copyFile(srcPath, destPath);
|
|
7249
7258
|
}
|
|
7250
7259
|
}
|
|
7251
7260
|
}
|
|
@@ -7256,10 +7265,10 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7256
7265
|
function isSourceNewer(packageDir) {
|
|
7257
7266
|
const srcDir = path$1.join(packageDir, "src");
|
|
7258
7267
|
const distDir = path$1.join(packageDir, "dist");
|
|
7259
|
-
if (!fs
|
|
7268
|
+
if (!fs.existsSync(srcDir) || !fs.existsSync(distDir)) return true;
|
|
7260
7269
|
try {
|
|
7261
|
-
const distMtime = fs
|
|
7262
|
-
const entries = fs
|
|
7270
|
+
const distMtime = fs.statSync(distDir).mtimeMs;
|
|
7271
|
+
const entries = fs.readdirSync(srcDir, {
|
|
7263
7272
|
withFileTypes: true,
|
|
7264
7273
|
recursive: true
|
|
7265
7274
|
});
|
|
@@ -7267,7 +7276,7 @@ function isSourceNewer(packageDir) {
|
|
|
7267
7276
|
if (!entry.isFile()) continue;
|
|
7268
7277
|
const parentDir = entry.parentPath ?? String(Reflect.get(entry, "path") ?? "");
|
|
7269
7278
|
const filePath = path$1.join(parentDir, entry.name);
|
|
7270
|
-
if (fs
|
|
7279
|
+
if (fs.statSync(filePath).mtimeMs > distMtime) return true;
|
|
7271
7280
|
}
|
|
7272
7281
|
return false;
|
|
7273
7282
|
} catch {
|
|
@@ -7284,7 +7293,7 @@ function isSourceNewer(packageDir) {
|
|
|
7284
7293
|
* `copyDirRecursive` for the wedge this prevents.
|
|
7285
7294
|
*/
|
|
7286
7295
|
async function installPackageFromNpm(packageName, targetDir) {
|
|
7287
|
-
const tmpDir = await fs
|
|
7296
|
+
const tmpDir = await fs.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
7288
7297
|
try {
|
|
7289
7298
|
const { stdout } = await execFileAsync$4("npm", [
|
|
7290
7299
|
"pack",
|
|
@@ -7307,21 +7316,21 @@ async function installPackageFromNpm(packageName, targetDir) {
|
|
|
7307
7316
|
extractDir
|
|
7308
7317
|
], { timeout: 3e4 });
|
|
7309
7318
|
const packageSubDir = path$1.join(extractDir, "package");
|
|
7310
|
-
const srcPkgJsonDir = fs
|
|
7311
|
-
await fs
|
|
7319
|
+
const srcPkgJsonDir = fs.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
7320
|
+
await fs.promises.rm(targetDir, {
|
|
7312
7321
|
recursive: true,
|
|
7313
7322
|
force: true
|
|
7314
7323
|
});
|
|
7315
7324
|
ensureDir(targetDir);
|
|
7316
|
-
await fs
|
|
7325
|
+
await fs.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
7317
7326
|
const distSrc = path$1.join(srcPkgJsonDir, "dist");
|
|
7318
|
-
if (fs
|
|
7327
|
+
if (fs.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
7319
7328
|
try {
|
|
7320
|
-
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs
|
|
7329
|
+
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7321
7330
|
if (npmPkg) await copyExtraFileDirs(npmPkg, srcPkgJsonDir, targetDir);
|
|
7322
7331
|
} catch {}
|
|
7323
7332
|
} finally {
|
|
7324
|
-
await fs
|
|
7333
|
+
await fs.promises.rm(tmpDir, {
|
|
7325
7334
|
recursive: true,
|
|
7326
7335
|
force: true
|
|
7327
7336
|
});
|
|
@@ -7346,7 +7355,7 @@ function packageDirName$1(declaredName) {
|
|
|
7346
7355
|
}
|
|
7347
7356
|
function isDirLike$1(p) {
|
|
7348
7357
|
try {
|
|
7349
|
-
return fs
|
|
7358
|
+
return fs.statSync(p).isDirectory();
|
|
7350
7359
|
} catch {
|
|
7351
7360
|
return false;
|
|
7352
7361
|
}
|
|
@@ -7364,12 +7373,12 @@ var AddonManifest = class {
|
|
|
7364
7373
|
*/
|
|
7365
7374
|
read() {
|
|
7366
7375
|
if (this.cache != null) return this.cache;
|
|
7367
|
-
if (!fs
|
|
7376
|
+
if (!fs.existsSync(this.manifestPath)) {
|
|
7368
7377
|
this.cache = this.empty();
|
|
7369
7378
|
return this.cache;
|
|
7370
7379
|
}
|
|
7371
7380
|
try {
|
|
7372
|
-
const raw = fs
|
|
7381
|
+
const raw = fs.readFileSync(this.manifestPath, "utf-8");
|
|
7373
7382
|
const parsed = JSON.parse(raw);
|
|
7374
7383
|
if (parsed.version !== MANIFEST_VERSION) {
|
|
7375
7384
|
process.stderr.write(`[AddonManifest] schema mismatch (file=${parsed.version} vs runtime=${MANIFEST_VERSION}); starting empty\n`);
|
|
@@ -7390,13 +7399,13 @@ var AddonManifest = class {
|
|
|
7390
7399
|
* a half-written file.
|
|
7391
7400
|
*/
|
|
7392
7401
|
write(manifest) {
|
|
7393
|
-
fs
|
|
7402
|
+
fs.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7394
7403
|
const tmp = `${this.manifestPath}.tmp.${process.pid}.${Date.now()}`;
|
|
7395
|
-
fs
|
|
7404
|
+
fs.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7396
7405
|
encoding: "utf-8",
|
|
7397
7406
|
mode: 384
|
|
7398
7407
|
});
|
|
7399
|
-
fs
|
|
7408
|
+
fs.renameSync(tmp, this.manifestPath);
|
|
7400
7409
|
this.cache = manifest;
|
|
7401
7410
|
}
|
|
7402
7411
|
/** Lookup a single addon's manifest entry, or `null` if not tracked. */
|
|
@@ -7471,22 +7480,22 @@ var AddonManifest = class {
|
|
|
7471
7480
|
* exactly what moved. Returns the total number of changes.
|
|
7472
7481
|
*/
|
|
7473
7482
|
reconcileFromDisk(addonsDir, onChange) {
|
|
7474
|
-
if (!fs
|
|
7483
|
+
if (!fs.existsSync(addonsDir)) return 0;
|
|
7475
7484
|
const m = this.read();
|
|
7476
7485
|
let changes = 0;
|
|
7477
7486
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7478
7487
|
/** Package name → version, for every ADDON package actually installed. */
|
|
7479
7488
|
const onDisk = /* @__PURE__ */ new Map();
|
|
7480
|
-
for (const scope of fs
|
|
7489
|
+
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7481
7490
|
if (!scope.name.startsWith("@") || !isDirLike$1(path$1.join(addonsDir, scope.name))) continue;
|
|
7482
7491
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7483
|
-
for (const pkg of fs
|
|
7492
|
+
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7484
7493
|
if (!isDirLike$1(path$1.join(scopeDir, pkg.name))) continue;
|
|
7485
7494
|
const pkgJsonPath = path$1.join(scopeDir, pkg.name, "package.json");
|
|
7486
|
-
if (!fs
|
|
7495
|
+
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7487
7496
|
let pkgJson;
|
|
7488
7497
|
try {
|
|
7489
|
-
const parsed = JSON.parse(fs
|
|
7498
|
+
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7490
7499
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7491
7500
|
pkgJson = parsed;
|
|
7492
7501
|
} catch {
|
|
@@ -7557,28 +7566,28 @@ var AddonManifest = class {
|
|
|
7557
7566
|
migrateFromInstallSourceMarkers(addonsDir) {
|
|
7558
7567
|
const m = this.read();
|
|
7559
7568
|
if (Object.keys(m.addons).length > 0) return 0;
|
|
7560
|
-
if (!fs
|
|
7569
|
+
if (!fs.existsSync(addonsDir)) return 0;
|
|
7561
7570
|
let migrated = 0;
|
|
7562
7571
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7563
|
-
for (const scope of fs
|
|
7572
|
+
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7564
7573
|
if (!scope.isDirectory() || !scope.name.startsWith("@")) continue;
|
|
7565
7574
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7566
|
-
for (const pkg of fs
|
|
7575
|
+
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7567
7576
|
if (!pkg.isDirectory()) continue;
|
|
7568
7577
|
const pkgDir = path$1.join(scopeDir, pkg.name);
|
|
7569
7578
|
const markerPath = path$1.join(pkgDir, ".install-source");
|
|
7570
7579
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
7571
|
-
if (!fs
|
|
7580
|
+
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7572
7581
|
let pkgJson;
|
|
7573
7582
|
try {
|
|
7574
|
-
const parsed = JSON.parse(fs
|
|
7583
|
+
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7575
7584
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7576
7585
|
pkgJson = parsed;
|
|
7577
7586
|
} catch {
|
|
7578
7587
|
continue;
|
|
7579
7588
|
}
|
|
7580
7589
|
if (!pkgJson.name || !pkgJson.version) continue;
|
|
7581
|
-
const source = fs
|
|
7590
|
+
const source = fs.existsSync(markerPath) ? fs.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7582
7591
|
m.addons[pkgJson.name] = {
|
|
7583
7592
|
name: pkgJson.name,
|
|
7584
7593
|
version: pkgJson.version,
|
|
@@ -7782,7 +7791,7 @@ function planClosureDedupe(input) {
|
|
|
7782
7791
|
function readTreeManifest(pkgJsonPath) {
|
|
7783
7792
|
let raw;
|
|
7784
7793
|
try {
|
|
7785
|
-
raw = asJsonObject$1(parseJsonUnknown(fs
|
|
7794
|
+
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
7786
7795
|
} catch {
|
|
7787
7796
|
return null;
|
|
7788
7797
|
}
|
|
@@ -7807,7 +7816,7 @@ function readTreeManifest(pkgJsonPath) {
|
|
|
7807
7816
|
function listTopLevelEntries(nodeModulesDir) {
|
|
7808
7817
|
let entries;
|
|
7809
7818
|
try {
|
|
7810
|
-
entries = fs
|
|
7819
|
+
entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7811
7820
|
} catch {
|
|
7812
7821
|
return [];
|
|
7813
7822
|
}
|
|
@@ -7817,7 +7826,7 @@ function listTopLevelEntries(nodeModulesDir) {
|
|
|
7817
7826
|
if (entry.name.startsWith("@")) {
|
|
7818
7827
|
let inner;
|
|
7819
7828
|
try {
|
|
7820
|
-
inner = fs
|
|
7829
|
+
inner = fs.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7821
7830
|
} catch {
|
|
7822
7831
|
continue;
|
|
7823
7832
|
}
|
|
@@ -7850,14 +7859,14 @@ function collectAddonTreeState(addonDir) {
|
|
|
7850
7859
|
const entryDir = path$1.join(nodeModulesDir, name);
|
|
7851
7860
|
let isLink = false;
|
|
7852
7861
|
try {
|
|
7853
|
-
isLink = fs
|
|
7862
|
+
isLink = fs.lstatSync(entryDir).isSymbolicLink();
|
|
7854
7863
|
} catch {
|
|
7855
7864
|
continue;
|
|
7856
7865
|
}
|
|
7857
7866
|
if (isLink) {
|
|
7858
7867
|
let target = "";
|
|
7859
7868
|
try {
|
|
7860
|
-
target = fs
|
|
7869
|
+
target = fs.readlinkSync(entryDir);
|
|
7861
7870
|
} catch {}
|
|
7862
7871
|
existingLinks.push({
|
|
7863
7872
|
name,
|
|
@@ -7871,7 +7880,7 @@ function collectAddonTreeState(addonDir) {
|
|
|
7871
7880
|
version: manifest.version
|
|
7872
7881
|
});
|
|
7873
7882
|
for (const [depName, range] of manifest.ranges) {
|
|
7874
|
-
if (fs
|
|
7883
|
+
if (fs.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7875
7884
|
addRange(depName, range);
|
|
7876
7885
|
}
|
|
7877
7886
|
}
|
|
@@ -7901,7 +7910,7 @@ function resolveClosureNodeModulesDir(explicitDir) {
|
|
|
7901
7910
|
const frameworkDir = explicitDir ?? process.env["CAMSTACK_FRAMEWORK_DIR"];
|
|
7902
7911
|
if (frameworkDir === void 0 || frameworkDir.length === 0) return null;
|
|
7903
7912
|
const nodeModulesDir = explicitDir ?? path$1.join(frameworkDir, "node_modules");
|
|
7904
|
-
return fs
|
|
7913
|
+
return fs.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7905
7914
|
}
|
|
7906
7915
|
function symlinkType() {
|
|
7907
7916
|
return process.platform === "win32" ? "junction" : "dir";
|
|
@@ -7920,10 +7929,10 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7920
7929
|
const nodeModulesDir = path$1.join(addonDir, "node_modules");
|
|
7921
7930
|
const probePath = path$1.join(nodeModulesDir, ".closure-link-probe");
|
|
7922
7931
|
try {
|
|
7923
|
-
fs
|
|
7924
|
-
fs
|
|
7925
|
-
fs
|
|
7926
|
-
fs
|
|
7932
|
+
fs.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7933
|
+
fs.rmSync(probePath, { force: true });
|
|
7934
|
+
fs.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7935
|
+
fs.rmSync(probePath, { force: true });
|
|
7927
7936
|
} catch (err) {
|
|
7928
7937
|
logger.warn("closure dedupe skipped — symlinks unavailable on this volume", { meta: {
|
|
7929
7938
|
addonDir,
|
|
@@ -7945,12 +7954,12 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7945
7954
|
}
|
|
7946
7955
|
const entryDir = path$1.join(nodeModulesDir, link.name);
|
|
7947
7956
|
try {
|
|
7948
|
-
fs
|
|
7957
|
+
fs.rmSync(entryDir, {
|
|
7949
7958
|
recursive: true,
|
|
7950
7959
|
force: true
|
|
7951
7960
|
});
|
|
7952
|
-
fs
|
|
7953
|
-
fs
|
|
7961
|
+
fs.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7962
|
+
fs.symlinkSync(target, entryDir, symlinkType());
|
|
7954
7963
|
linked.push(link.name);
|
|
7955
7964
|
} catch (err) {
|
|
7956
7965
|
logger.warn("closure dedupe — link failed; entry removed copy may need reinstall", { meta: {
|
|
@@ -8026,7 +8035,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
8026
8035
|
count: Object.keys(native).length
|
|
8027
8036
|
} });
|
|
8028
8037
|
try {
|
|
8029
|
-
fs
|
|
8038
|
+
fs.writeFileSync(markerFile, markerHash);
|
|
8030
8039
|
} catch (err) {
|
|
8031
8040
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
8032
8041
|
markerFile,
|
|
@@ -8064,7 +8073,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
8064
8073
|
}
|
|
8065
8074
|
await rebuildNativeDeps(addonDir, pending.map(([name]) => name), logger, npmCacheDir ?? defaultNpmCacheDir(), registry);
|
|
8066
8075
|
try {
|
|
8067
|
-
fs
|
|
8076
|
+
fs.writeFileSync(markerFile, markerHash);
|
|
8068
8077
|
} catch (err) {
|
|
8069
8078
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
8070
8079
|
markerFile,
|
|
@@ -8086,12 +8095,12 @@ function copyPrebuiltNativeDep(name, addonDir, logger) {
|
|
|
8086
8095
|
if (source === target) continue;
|
|
8087
8096
|
if (!hasBuiltBinary(source)) continue;
|
|
8088
8097
|
try {
|
|
8089
|
-
fs
|
|
8098
|
+
fs.rmSync(target, {
|
|
8090
8099
|
recursive: true,
|
|
8091
8100
|
force: true
|
|
8092
8101
|
});
|
|
8093
|
-
fs
|
|
8094
|
-
fs
|
|
8102
|
+
fs.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
8103
|
+
fs.cpSync(source, target, {
|
|
8095
8104
|
recursive: true,
|
|
8096
8105
|
dereference: true
|
|
8097
8106
|
});
|
|
@@ -8127,7 +8136,7 @@ var BUNDLED_NATIVE_SIBLING_SCOPES = {
|
|
|
8127
8136
|
function hasAnyDotNode(dir, maxDepth) {
|
|
8128
8137
|
let entries;
|
|
8129
8138
|
try {
|
|
8130
|
-
entries = fs
|
|
8139
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
8131
8140
|
} catch {
|
|
8132
8141
|
return false;
|
|
8133
8142
|
}
|
|
@@ -8141,12 +8150,12 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8141
8150
|
if (!hasAnyDotNode(src, 5)) return;
|
|
8142
8151
|
if (hasAnyDotNode(dst, 5)) return;
|
|
8143
8152
|
try {
|
|
8144
|
-
fs
|
|
8153
|
+
fs.rmSync(dst, {
|
|
8145
8154
|
recursive: true,
|
|
8146
8155
|
force: true
|
|
8147
8156
|
});
|
|
8148
|
-
fs
|
|
8149
|
-
fs
|
|
8157
|
+
fs.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
8158
|
+
fs.cpSync(src, dst, {
|
|
8150
8159
|
recursive: true,
|
|
8151
8160
|
dereference: true
|
|
8152
8161
|
});
|
|
@@ -8181,7 +8190,7 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8181
8190
|
*/
|
|
8182
8191
|
function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
8183
8192
|
const srcNm = path$1.join(sourceDir, "node_modules");
|
|
8184
|
-
if (!fs
|
|
8193
|
+
if (!fs.existsSync(srcNm)) return;
|
|
8185
8194
|
const dstNm = path$1.join(targetDir, "node_modules");
|
|
8186
8195
|
for (const [name, scopes] of Object.entries(BUNDLED_NATIVE_SIBLING_SCOPES)) {
|
|
8187
8196
|
copyPrebuiltModuleDir(path$1.join(srcNm, name), path$1.join(dstNm, name), name, logger);
|
|
@@ -8189,7 +8198,7 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8189
8198
|
const scopeSrc = path$1.join(srcNm, scope);
|
|
8190
8199
|
let siblings;
|
|
8191
8200
|
try {
|
|
8192
|
-
siblings = fs
|
|
8201
|
+
siblings = fs.readdirSync(scopeSrc);
|
|
8193
8202
|
} catch {
|
|
8194
8203
|
continue;
|
|
8195
8204
|
}
|
|
@@ -8199,12 +8208,12 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8199
8208
|
}
|
|
8200
8209
|
/** A package dir is "built" when it carries a compiled `.node` or a prebuilds tree. */
|
|
8201
8210
|
function hasBuiltBinary(pkgDir) {
|
|
8202
|
-
if (!fs
|
|
8211
|
+
if (!fs.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
8203
8212
|
const releaseDir = path$1.join(pkgDir, "build", "Release");
|
|
8204
8213
|
try {
|
|
8205
|
-
if (fs
|
|
8214
|
+
if (fs.existsSync(releaseDir) && fs.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
8206
8215
|
} catch {}
|
|
8207
|
-
return fs
|
|
8216
|
+
return fs.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
8208
8217
|
}
|
|
8209
8218
|
/** Candidate hoisted locations for `<name>`: NODE_PATH entries + ancestors of `addonDir`. */
|
|
8210
8219
|
function candidateHoistedDirs(name, addonDir) {
|
|
@@ -8242,7 +8251,7 @@ function hashDeclaration(deps) {
|
|
|
8242
8251
|
}
|
|
8243
8252
|
function markerMatches(markerFile, expected) {
|
|
8244
8253
|
try {
|
|
8245
|
-
return fs
|
|
8254
|
+
return fs.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
8246
8255
|
} catch {
|
|
8247
8256
|
return false;
|
|
8248
8257
|
}
|
|
@@ -8349,7 +8358,7 @@ function parseInstallSource(value) {
|
|
|
8349
8358
|
function readPackageJson(pkgJsonPath) {
|
|
8350
8359
|
let raw;
|
|
8351
8360
|
try {
|
|
8352
|
-
raw = asJsonObject$1(parseJsonUnknown(fs
|
|
8361
|
+
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
8353
8362
|
} catch {
|
|
8354
8363
|
return null;
|
|
8355
8364
|
}
|
|
@@ -8391,7 +8400,7 @@ function shouldSkipClosureProvidedSeed(packageName, isResolvable) {
|
|
|
8391
8400
|
var REGISTRY_LATEST_TIMEOUT_MS = 15e3;
|
|
8392
8401
|
function readInstalledPackageVersion(addonDir) {
|
|
8393
8402
|
try {
|
|
8394
|
-
const raw = JSON.parse(fs
|
|
8403
|
+
const raw = JSON.parse(fs.readFileSync(path$1.join(addonDir, "package.json"), "utf-8"));
|
|
8395
8404
|
if (raw === null || typeof raw !== "object") return null;
|
|
8396
8405
|
const version = Reflect.get(raw, "version");
|
|
8397
8406
|
return typeof version === "string" && version.length > 0 ? version : null;
|
|
@@ -8532,7 +8541,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8532
8541
|
} catch {
|
|
8533
8542
|
return Object.freeze([]);
|
|
8534
8543
|
}
|
|
8535
|
-
const raw = fs
|
|
8544
|
+
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8536
8545
|
const parsed = JSON.parse(raw);
|
|
8537
8546
|
const deps = Object.keys(parsed.dependencies ?? {});
|
|
8538
8547
|
const agentOnly = new Set(parsed.camstack?.agentOnlyBootstrapAddons ?? []);
|
|
@@ -8577,7 +8586,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8577
8586
|
} catch {
|
|
8578
8587
|
return Object.freeze([]);
|
|
8579
8588
|
}
|
|
8580
|
-
const raw = fs
|
|
8589
|
+
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8581
8590
|
const addons = JSON.parse(raw).camstack?.agentBootstrapAddons ?? [];
|
|
8582
8591
|
return Object.freeze(["@camstack/server", ...addons]);
|
|
8583
8592
|
}
|
|
@@ -8607,7 +8616,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8607
8616
|
this.logger.info(`Install source: ${isLocal ? `bundle (${this.bundledAddonsDir})` : "npm"}, ${pkgList.length} package(s)`);
|
|
8608
8617
|
for (const packageName of pkgList) {
|
|
8609
8618
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
8610
|
-
if (fs
|
|
8619
|
+
if (fs.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8611
8620
|
if (isLocal || shouldSkipClosureProvidedSeed(packageName, this.isResolvableFromClosure(packageName))) {
|
|
8612
8621
|
this.logger.debug(`${packageName} — already installed, skipping`);
|
|
8613
8622
|
continue;
|
|
@@ -8751,7 +8760,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8751
8760
|
const installedPackages = this.listInstalled();
|
|
8752
8761
|
for (const pkg of installedPackages) {
|
|
8753
8762
|
try {
|
|
8754
|
-
if (fs
|
|
8763
|
+
if (fs.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8755
8764
|
} catch {
|
|
8756
8765
|
continue;
|
|
8757
8766
|
}
|
|
@@ -8791,7 +8800,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8791
8800
|
if (closureNodeModules !== null) for (const link of state.existingLinks) {
|
|
8792
8801
|
if (!isClosureLinkTarget(link.target, closureNodeModules)) continue;
|
|
8793
8802
|
const linkDir = path$1.join(nodeModulesDir, link.name);
|
|
8794
|
-
const targetManifest = fs
|
|
8803
|
+
const targetManifest = fs.existsSync(path$1.join(linkDir, "package.json"));
|
|
8795
8804
|
const ranges = state.requirements.get(link.name) ?? [];
|
|
8796
8805
|
let holds = targetManifest;
|
|
8797
8806
|
if (holds && ranges.length > 0) {
|
|
@@ -8800,14 +8809,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8800
8809
|
}
|
|
8801
8810
|
if (!holds) {
|
|
8802
8811
|
this.logger.warn(`${packageName} — closure link for ${link.name} no longer holds; reinstalling this addon's deps`, { meta: { target: link.target } });
|
|
8803
|
-
fs
|
|
8812
|
+
fs.rmSync(linkDir, { force: true });
|
|
8804
8813
|
needsInstall = true;
|
|
8805
8814
|
}
|
|
8806
8815
|
}
|
|
8807
8816
|
const linked = [];
|
|
8808
8817
|
for (const [depName, range] of declaredEntries) {
|
|
8809
8818
|
if (typeof range !== "string") continue;
|
|
8810
|
-
if (fs
|
|
8819
|
+
if (fs.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8811
8820
|
const closureVersion = closureNodeModules === null ? void 0 : readClosureVersions(closureNodeModules, [depName]).get(depName);
|
|
8812
8821
|
if (closureNodeModules !== null && closureVersion !== void 0 && closureSatisfiesRange(range, closureVersion)) {
|
|
8813
8822
|
if (executeClosureDedupe(addonDir, closureNodeModules, {
|
|
@@ -8840,7 +8849,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8840
8849
|
const closureNodeModules = resolveClosureNodeModulesDir(this.closureNodeModulesDir);
|
|
8841
8850
|
if (closureNodeModules !== null) {
|
|
8842
8851
|
const state = collectAddonTreeState(addonDir);
|
|
8843
|
-
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs
|
|
8852
|
+
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8844
8853
|
}
|
|
8845
8854
|
this.logger.info(`${packageName} — reinstalling runtime dependencies`, { meta: { addonDir } });
|
|
8846
8855
|
await runNpm([
|
|
@@ -8885,7 +8894,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8885
8894
|
async realignFromClosure(packageName, closureDir) {
|
|
8886
8895
|
const targetDir = path$1.join(this.addonsDir, packageName);
|
|
8887
8896
|
const result = await this.installLocal(packageName, closureDir);
|
|
8888
|
-
await fs
|
|
8897
|
+
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8889
8898
|
this.manifest.upsert(result.name, {
|
|
8890
8899
|
version: result.version,
|
|
8891
8900
|
source: "closure"
|
|
@@ -8901,17 +8910,17 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8901
8910
|
async installCopy(packageName, sourceDir, pkgData, targetDir) {
|
|
8902
8911
|
await this.ensureBuilt(packageName, sourceDir, pkgData);
|
|
8903
8912
|
const distDir = path$1.join(sourceDir, "dist");
|
|
8904
|
-
if (!fs
|
|
8905
|
-
await fs
|
|
8913
|
+
if (!fs.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8914
|
+
await fs.promises.rm(targetDir, {
|
|
8906
8915
|
recursive: true,
|
|
8907
8916
|
force: true
|
|
8908
8917
|
});
|
|
8909
8918
|
ensureDir(targetDir);
|
|
8910
|
-
await fs
|
|
8919
|
+
await fs.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8911
8920
|
await copyDirRecursive(distDir, path$1.join(targetDir, "dist"));
|
|
8912
8921
|
await copyExtraFileDirs(pkgData, sourceDir, targetDir);
|
|
8913
8922
|
copyBundledNativeModules(sourceDir, targetDir, this.logger);
|
|
8914
|
-
await fs
|
|
8923
|
+
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8915
8924
|
const localPkgVersion = asString$1(pkgData.version, "0.0.0");
|
|
8916
8925
|
this.manifest.upsert(packageName, {
|
|
8917
8926
|
version: localPkgVersion,
|
|
@@ -8952,7 +8961,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8952
8961
|
* unusual auth, offline mode, etc).
|
|
8953
8962
|
*/
|
|
8954
8963
|
async installFromNpm(packageName, version) {
|
|
8955
|
-
const tmpDir = fs
|
|
8964
|
+
const tmpDir = fs.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8956
8965
|
const packageSpec = version ? `${packageName}@${version}` : packageName;
|
|
8957
8966
|
this.logger.info(`${packageName} — installing from npm`);
|
|
8958
8967
|
try {
|
|
@@ -8966,19 +8975,19 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8966
8975
|
];
|
|
8967
8976
|
if (this.registry) args.push("--registry", this.registry);
|
|
8968
8977
|
const { stdout } = await runNpm(args, this.npmRunOptions(tmpDir, 12e4));
|
|
8969
|
-
const tgzFiles = fs
|
|
8978
|
+
const tgzFiles = fs.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8970
8979
|
if (tgzFiles.length === 0) throw new Error(`npm pack produced no tgz. stdout: ${stdout.trim()}`);
|
|
8971
8980
|
return path$1.join(tmpDir, tgzFiles[0]);
|
|
8972
8981
|
});
|
|
8973
8982
|
const result = await this.installFromTgz(tgzPath);
|
|
8974
|
-
fs
|
|
8983
|
+
fs.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8975
8984
|
this.manifest.upsert(result.name, {
|
|
8976
8985
|
version: result.version,
|
|
8977
8986
|
source: "npm"
|
|
8978
8987
|
});
|
|
8979
8988
|
return result;
|
|
8980
8989
|
} finally {
|
|
8981
|
-
fs
|
|
8990
|
+
fs.rmSync(tmpDir, {
|
|
8982
8991
|
recursive: true,
|
|
8983
8992
|
force: true
|
|
8984
8993
|
});
|
|
@@ -9016,7 +9025,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9016
9025
|
if (!tarRes.ok) throw new Error(`tarball GET ${tarballUrl} → ${tarRes.status}`);
|
|
9017
9026
|
const tgzPath = path$1.join(tmpDir, `${packageName.replace(/[/@]/g, "-").replace(/^-+/, "")}-${resolvedVersion}.tgz`);
|
|
9018
9027
|
const buf = Buffer.from(await tarRes.arrayBuffer());
|
|
9019
|
-
fs
|
|
9028
|
+
fs.writeFileSync(tgzPath, buf);
|
|
9020
9029
|
return tgzPath;
|
|
9021
9030
|
}
|
|
9022
9031
|
/**
|
|
@@ -9037,7 +9046,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9037
9046
|
* on the next deploy.
|
|
9038
9047
|
*/
|
|
9039
9048
|
async evictInstallDir(targetDir) {
|
|
9040
|
-
if (!fs
|
|
9049
|
+
if (!fs.existsSync(targetDir)) return;
|
|
9041
9050
|
const graveyard = path$1.join(this.addonsDir, ".evicting");
|
|
9042
9051
|
ensureDir(graveyard);
|
|
9043
9052
|
await this.sweepGraveyard(graveyard);
|
|
@@ -9045,10 +9054,10 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9045
9054
|
const flatName = path$1.relative(this.addonsDir, targetDir).replace(/[/\\]/g, "-");
|
|
9046
9055
|
const asideDir = path$1.join(graveyard, `${flatName}-${ts}`);
|
|
9047
9056
|
try {
|
|
9048
|
-
fs
|
|
9057
|
+
fs.renameSync(targetDir, asideDir);
|
|
9049
9058
|
} catch (renameErr) {
|
|
9050
9059
|
if (renameErr.code === "EXDEV") {
|
|
9051
|
-
await fs
|
|
9060
|
+
await fs.promises.rm(targetDir, {
|
|
9052
9061
|
recursive: true,
|
|
9053
9062
|
force: true
|
|
9054
9063
|
});
|
|
@@ -9056,7 +9065,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9056
9065
|
}
|
|
9057
9066
|
throw renameErr;
|
|
9058
9067
|
}
|
|
9059
|
-
await fs
|
|
9068
|
+
await fs.promises.rm(asideDir, {
|
|
9060
9069
|
recursive: true,
|
|
9061
9070
|
force: true
|
|
9062
9071
|
}).catch((cleanupErr) => {
|
|
@@ -9077,14 +9086,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9077
9086
|
async sweepStagingResidue(stagingRoot) {
|
|
9078
9087
|
let names;
|
|
9079
9088
|
try {
|
|
9080
|
-
names = fs
|
|
9089
|
+
names = fs.readdirSync(stagingRoot);
|
|
9081
9090
|
} catch {
|
|
9082
9091
|
return;
|
|
9083
9092
|
}
|
|
9084
9093
|
const now = Date.now();
|
|
9085
9094
|
const ages = [];
|
|
9086
9095
|
for (const name of names) try {
|
|
9087
|
-
const stat = fs
|
|
9096
|
+
const stat = fs.statSync(path$1.join(stagingRoot, name));
|
|
9088
9097
|
ages.push({
|
|
9089
9098
|
name,
|
|
9090
9099
|
ageMs: now - stat.mtimeMs
|
|
@@ -9095,7 +9104,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9095
9104
|
stagingRoot,
|
|
9096
9105
|
entries: sweepable
|
|
9097
9106
|
} });
|
|
9098
|
-
await Promise.all(sweepable.map((name) => fs
|
|
9107
|
+
await Promise.all(sweepable.map((name) => fs.promises.rm(path$1.join(stagingRoot, name), {
|
|
9099
9108
|
recursive: true,
|
|
9100
9109
|
force: true
|
|
9101
9110
|
}).catch(() => void 0)));
|
|
@@ -9104,11 +9113,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9104
9113
|
async sweepGraveyard(graveyard) {
|
|
9105
9114
|
let entries;
|
|
9106
9115
|
try {
|
|
9107
|
-
entries = fs
|
|
9116
|
+
entries = fs.readdirSync(graveyard);
|
|
9108
9117
|
} catch {
|
|
9109
9118
|
return;
|
|
9110
9119
|
}
|
|
9111
|
-
await Promise.all(entries.map((name) => fs
|
|
9120
|
+
await Promise.all(entries.map((name) => fs.promises.rm(path$1.join(graveyard, name), {
|
|
9112
9121
|
recursive: true,
|
|
9113
9122
|
force: true
|
|
9114
9123
|
}).catch(() => void 0)));
|
|
@@ -9159,7 +9168,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9159
9168
|
return;
|
|
9160
9169
|
}
|
|
9161
9170
|
const strippedManifest = stripBundledDeps(pkgView.raw);
|
|
9162
|
-
await fs
|
|
9171
|
+
await fs.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9163
9172
|
const deps = asJsonObject$1(strippedManifest["dependencies"]);
|
|
9164
9173
|
const depNames = deps ? Object.keys(deps) : [];
|
|
9165
9174
|
if (depNames.length === 0) return;
|
|
@@ -9291,9 +9300,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9291
9300
|
"-C",
|
|
9292
9301
|
stagingDir
|
|
9293
9302
|
], { timeout: 12e4 });
|
|
9294
|
-
const pkgDir = fs
|
|
9303
|
+
const pkgDir = fs.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9295
9304
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
9296
|
-
if (!fs
|
|
9305
|
+
if (!fs.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9297
9306
|
const pkgView = readPackageJson(pkgJsonPath);
|
|
9298
9307
|
if (!pkgView) throw new Error(`Invalid package.json at ${pkgJsonPath}`);
|
|
9299
9308
|
if (!pkgView.camstackAddons) throw new Error(`Package ${pkgView.name} has no camstack.addons manifest`);
|
|
@@ -9303,7 +9312,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9303
9312
|
this.dedupeTreeAgainstClosure(pkgDir, pkgView.name);
|
|
9304
9313
|
await this.evictInstallDir(targetDir);
|
|
9305
9314
|
ensureDir(path$1.dirname(targetDir));
|
|
9306
|
-
await fs
|
|
9315
|
+
await fs.promises.rename(pkgDir, targetDir);
|
|
9307
9316
|
this.manifest.upsert(pkgView.name, {
|
|
9308
9317
|
version: pkgView.version,
|
|
9309
9318
|
source: "bundled"
|
|
@@ -9314,7 +9323,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9314
9323
|
};
|
|
9315
9324
|
} finally {
|
|
9316
9325
|
this.inFlightStaging.delete(stagingName);
|
|
9317
|
-
await fs
|
|
9326
|
+
await fs.promises.rm(stagingDir, {
|
|
9318
9327
|
recursive: true,
|
|
9319
9328
|
force: true
|
|
9320
9329
|
}).catch(() => void 0);
|
|
@@ -9344,24 +9353,24 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9344
9353
|
const current = this.manifest.get(packageName);
|
|
9345
9354
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9346
9355
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9347
|
-
if (!fs
|
|
9356
|
+
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9348
9357
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
9349
9358
|
const backupRoot = path$1.join(this.addonsDir, ".backups", packageName);
|
|
9350
9359
|
ensureDir(backupRoot);
|
|
9351
9360
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9352
9361
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9353
|
-
fs
|
|
9362
|
+
fs.renameSync(addonDir, backupDir);
|
|
9354
9363
|
let result;
|
|
9355
9364
|
try {
|
|
9356
9365
|
result = await this.installFromNpm(packageName, version);
|
|
9357
9366
|
} catch (installErr) {
|
|
9358
9367
|
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: errMsg$1(installErr) } });
|
|
9359
9368
|
try {
|
|
9360
|
-
if (fs
|
|
9369
|
+
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9361
9370
|
recursive: true,
|
|
9362
9371
|
force: true
|
|
9363
9372
|
});
|
|
9364
|
-
fs
|
|
9373
|
+
fs.renameSync(backupDir, addonDir);
|
|
9365
9374
|
this.manifest.upsert(packageName, {
|
|
9366
9375
|
version: current.version,
|
|
9367
9376
|
source: current.source,
|
|
@@ -9422,7 +9431,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9422
9431
|
const current = this.manifest.get(packageName);
|
|
9423
9432
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9424
9433
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9425
|
-
if (!fs
|
|
9434
|
+
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9426
9435
|
await this.installRuntimeDependencies(stagedPath, packageName);
|
|
9427
9436
|
await this.installNativeDependencies(stagedPath, packageName);
|
|
9428
9437
|
this.dedupeTreeAgainstClosure(stagedPath, packageName);
|
|
@@ -9431,14 +9440,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9431
9440
|
ensureDir(backupRoot);
|
|
9432
9441
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9433
9442
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9434
|
-
fs
|
|
9443
|
+
fs.renameSync(addonDir, backupDir);
|
|
9435
9444
|
try {
|
|
9436
9445
|
try {
|
|
9437
|
-
fs
|
|
9446
|
+
fs.renameSync(stagedPath, addonDir);
|
|
9438
9447
|
} catch (renameErr) {
|
|
9439
9448
|
if (renameErr.code === "EXDEV") {
|
|
9440
|
-
fs
|
|
9441
|
-
fs
|
|
9449
|
+
fs.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9450
|
+
fs.rmSync(stagedPath, {
|
|
9442
9451
|
recursive: true,
|
|
9443
9452
|
force: true
|
|
9444
9453
|
});
|
|
@@ -9447,11 +9456,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9447
9456
|
} catch (swapErr) {
|
|
9448
9457
|
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error: errMsg$1(swapErr) } });
|
|
9449
9458
|
try {
|
|
9450
|
-
if (fs
|
|
9459
|
+
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9451
9460
|
recursive: true,
|
|
9452
9461
|
force: true
|
|
9453
9462
|
});
|
|
9454
|
-
fs
|
|
9463
|
+
fs.renameSync(backupDir, addonDir);
|
|
9455
9464
|
this.manifest.upsert(packageName, {
|
|
9456
9465
|
version: current.version,
|
|
9457
9466
|
source: current.source,
|
|
@@ -9490,20 +9499,20 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9490
9499
|
this.logger.warn(`${packageName} — no backup to rollback to`);
|
|
9491
9500
|
return null;
|
|
9492
9501
|
}
|
|
9493
|
-
if (!fs
|
|
9502
|
+
if (!fs.existsSync(entry.lastBackupDir)) {
|
|
9494
9503
|
this.logger.warn(`${packageName} — backup dir vanished: ${entry.lastBackupDir}`);
|
|
9495
9504
|
return null;
|
|
9496
9505
|
}
|
|
9497
9506
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9498
|
-
if (fs
|
|
9507
|
+
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9499
9508
|
recursive: true,
|
|
9500
9509
|
force: true
|
|
9501
9510
|
});
|
|
9502
|
-
fs
|
|
9511
|
+
fs.renameSync(entry.lastBackupDir, addonDir);
|
|
9503
9512
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
9504
9513
|
let restoredVersion = entry.version;
|
|
9505
|
-
if (fs
|
|
9506
|
-
const parsed = JSON.parse(fs
|
|
9514
|
+
if (fs.existsSync(pkgJsonPath)) try {
|
|
9515
|
+
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
9507
9516
|
if (typeof parsed === "object" && parsed != null) {
|
|
9508
9517
|
const v = parsed.version;
|
|
9509
9518
|
if (typeof v === "string" && v.length > 0) restoredVersion = v;
|
|
@@ -9551,7 +9560,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9551
9560
|
return false;
|
|
9552
9561
|
}
|
|
9553
9562
|
try {
|
|
9554
|
-
await fs
|
|
9563
|
+
await fs.promises.rm(target, {
|
|
9555
9564
|
recursive: true,
|
|
9556
9565
|
force: true
|
|
9557
9566
|
});
|
|
@@ -9569,7 +9578,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9569
9578
|
listBackupsFor(packageName) {
|
|
9570
9579
|
const dir = path$1.join(this.backupsRoot, packageName);
|
|
9571
9580
|
try {
|
|
9572
|
-
return fs
|
|
9581
|
+
return fs.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9573
9582
|
} catch {
|
|
9574
9583
|
return [];
|
|
9575
9584
|
}
|
|
@@ -9601,7 +9610,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9601
9610
|
for (const dir of [pkgDir, path$1.dirname(pkgDir)]) {
|
|
9602
9611
|
if (!this.isInsideBackups(dir)) continue;
|
|
9603
9612
|
try {
|
|
9604
|
-
await fs
|
|
9613
|
+
await fs.promises.rmdir(dir);
|
|
9605
9614
|
} catch {
|
|
9606
9615
|
return;
|
|
9607
9616
|
}
|
|
@@ -9683,7 +9692,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9683
9692
|
*/
|
|
9684
9693
|
resolveBackupToKeep(packageName, backups) {
|
|
9685
9694
|
const liveDir = path$1.join(this.addonsDir, packageName);
|
|
9686
|
-
if (!fs
|
|
9695
|
+
if (!fs.existsSync(liveDir)) {
|
|
9687
9696
|
const newest = backups[backups.length - 1] ?? null;
|
|
9688
9697
|
if (newest != null) this.logger.warn(`${packageName} — live install dir missing; retaining its newest backup as the only surviving copy`, { meta: {
|
|
9689
9698
|
liveDir,
|
|
@@ -9700,7 +9709,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9700
9709
|
listBackedUpPackages() {
|
|
9701
9710
|
let entries;
|
|
9702
9711
|
try {
|
|
9703
|
-
entries = fs
|
|
9712
|
+
entries = fs.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9704
9713
|
} catch {
|
|
9705
9714
|
return [];
|
|
9706
9715
|
}
|
|
@@ -9712,14 +9721,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9712
9721
|
continue;
|
|
9713
9722
|
}
|
|
9714
9723
|
const scopeDir = path$1.join(this.backupsRoot, entry.name);
|
|
9715
|
-
for (const inner of fs
|
|
9724
|
+
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9716
9725
|
}
|
|
9717
9726
|
return names;
|
|
9718
9727
|
}
|
|
9719
9728
|
async uninstall(packageName) {
|
|
9720
9729
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9721
|
-
if (fs
|
|
9722
|
-
fs
|
|
9730
|
+
if (fs.existsSync(addonDir)) {
|
|
9731
|
+
fs.rmSync(addonDir, {
|
|
9723
9732
|
recursive: true,
|
|
9724
9733
|
force: true
|
|
9725
9734
|
});
|
|
@@ -9727,8 +9736,8 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9727
9736
|
return;
|
|
9728
9737
|
}
|
|
9729
9738
|
const legacyDir = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""));
|
|
9730
|
-
if (fs
|
|
9731
|
-
fs
|
|
9739
|
+
if (fs.existsSync(legacyDir)) {
|
|
9740
|
+
fs.rmSync(legacyDir, {
|
|
9732
9741
|
recursive: true,
|
|
9733
9742
|
force: true
|
|
9734
9743
|
});
|
|
@@ -9736,22 +9745,22 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9736
9745
|
}
|
|
9737
9746
|
}
|
|
9738
9747
|
listInstalled() {
|
|
9739
|
-
if (!fs
|
|
9748
|
+
if (!fs.existsSync(this.addonsDir)) return [];
|
|
9740
9749
|
const packageDirs = [];
|
|
9741
|
-
for (const entry of fs
|
|
9750
|
+
for (const entry of fs.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9742
9751
|
if (!isDirEntry(entry, this.addonsDir)) continue;
|
|
9743
9752
|
if (entry.name.startsWith("@")) {
|
|
9744
9753
|
const scopeDir = path$1.join(this.addonsDir, entry.name);
|
|
9745
|
-
for (const inner of fs
|
|
9754
|
+
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9746
9755
|
} else packageDirs.push(path$1.join(this.addonsDir, entry.name));
|
|
9747
9756
|
}
|
|
9748
9757
|
return packageDirs.map((dir) => {
|
|
9749
9758
|
const pkgPath = path$1.join(dir, "package.json");
|
|
9750
|
-
if (!fs
|
|
9759
|
+
if (!fs.existsSync(pkgPath)) return null;
|
|
9751
9760
|
const pkg = readPackageJson(pkgPath);
|
|
9752
9761
|
if (!pkg || !pkg.camstackAddons) return null;
|
|
9753
9762
|
const sourceFile = path$1.join(dir, ".install-source");
|
|
9754
|
-
const installSource = fs
|
|
9763
|
+
const installSource = fs.existsSync(sourceFile) ? parseInstallSource(fs.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9755
9764
|
return {
|
|
9756
9765
|
name: pkg.name,
|
|
9757
9766
|
version: pkg.version,
|
|
@@ -9761,13 +9770,13 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9761
9770
|
}).filter((item) => item !== null);
|
|
9762
9771
|
}
|
|
9763
9772
|
isInstalled(packageName) {
|
|
9764
|
-
if (fs
|
|
9765
|
-
return fs
|
|
9773
|
+
if (fs.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9774
|
+
return fs.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9766
9775
|
}
|
|
9767
9776
|
getInstalledPackage(packageName) {
|
|
9768
9777
|
let pkgPath = path$1.join(this.addonsDir, packageName, "package.json");
|
|
9769
|
-
if (!fs
|
|
9770
|
-
if (!fs
|
|
9778
|
+
if (!fs.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9779
|
+
if (!fs.existsSync(pkgPath)) return null;
|
|
9771
9780
|
const pkg = readPackageJson(pkgPath);
|
|
9772
9781
|
if (!pkg) return null;
|
|
9773
9782
|
return {
|
|
@@ -9786,7 +9795,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9786
9795
|
]) {
|
|
9787
9796
|
const candidate = path$1.join(this.bundledAddonsDir, dirName);
|
|
9788
9797
|
try {
|
|
9789
|
-
const pkg = asJsonObject$1(parseJsonUnknown(fs
|
|
9798
|
+
const pkg = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9790
9799
|
if (pkg && asString$1(pkg["name"]) === packageName) return candidate;
|
|
9791
9800
|
} catch {}
|
|
9792
9801
|
}
|
|
@@ -9795,7 +9804,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9795
9804
|
/** Ensure a package is built (dist/ exists and page bundles present) */
|
|
9796
9805
|
async ensureBuilt(packageName, sourceDir, pkgData) {
|
|
9797
9806
|
const distDir = path$1.join(sourceDir, "dist");
|
|
9798
|
-
if (!(!fs
|
|
9807
|
+
if (!(!fs.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9799
9808
|
this.logger.info(`${packageName} — building (dist/ missing or incomplete)`);
|
|
9800
9809
|
try {
|
|
9801
9810
|
await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
|
|
@@ -9810,7 +9819,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9810
9819
|
if (!camstack?.addons) return false;
|
|
9811
9820
|
for (const addon of camstack.addons) {
|
|
9812
9821
|
if (!addon.pages) continue;
|
|
9813
|
-
for (const page of addon.pages) if (page.bundle && !fs
|
|
9822
|
+
for (const page of addon.pages) if (page.bundle && !fs.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9814
9823
|
}
|
|
9815
9824
|
return false;
|
|
9816
9825
|
}
|
|
@@ -9819,7 +9828,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9819
9828
|
function isDirEntry(entry, parentDir) {
|
|
9820
9829
|
if (entry.isDirectory()) return true;
|
|
9821
9830
|
if (entry.isSymbolicLink()) try {
|
|
9822
|
-
return fs
|
|
9831
|
+
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9823
9832
|
} catch {
|
|
9824
9833
|
return false;
|
|
9825
9834
|
}
|
|
@@ -9918,7 +9927,7 @@ function selectAddonResidue(candidates) {
|
|
|
9918
9927
|
}
|
|
9919
9928
|
function readDeclaredName(dir) {
|
|
9920
9929
|
try {
|
|
9921
|
-
const parsed = JSON.parse(fs
|
|
9930
|
+
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9922
9931
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9923
9932
|
const name = parsed.name;
|
|
9924
9933
|
return typeof name === "string" ? name : null;
|
|
@@ -9928,7 +9937,7 @@ function readDeclaredName(dir) {
|
|
|
9928
9937
|
}
|
|
9929
9938
|
function readDeclaredVersion(dir) {
|
|
9930
9939
|
try {
|
|
9931
|
-
const parsed = JSON.parse(fs
|
|
9940
|
+
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9932
9941
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9933
9942
|
const version = parsed.version;
|
|
9934
9943
|
return typeof version === "string" ? version : null;
|
|
@@ -9938,7 +9947,7 @@ function readDeclaredVersion(dir) {
|
|
|
9938
9947
|
}
|
|
9939
9948
|
function isDirLike(p) {
|
|
9940
9949
|
try {
|
|
9941
|
-
return fs
|
|
9950
|
+
return fs.statSync(p).isDirectory();
|
|
9942
9951
|
} catch {
|
|
9943
9952
|
return false;
|
|
9944
9953
|
}
|
|
@@ -9948,7 +9957,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9948
9957
|
const base = scope === null ? dirName : `${scope.replace("@", "")}__${dirName}`;
|
|
9949
9958
|
let candidate = path$1.join(store, base);
|
|
9950
9959
|
let n = 1;
|
|
9951
|
-
while (fs
|
|
9960
|
+
while (fs.existsSync(candidate)) {
|
|
9952
9961
|
candidate = path$1.join(store, `${base}-${n}`);
|
|
9953
9962
|
n += 1;
|
|
9954
9963
|
}
|
|
@@ -9965,7 +9974,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9965
9974
|
function quarantineAddonResidue(addonsDir, log) {
|
|
9966
9975
|
const quarantined = [];
|
|
9967
9976
|
const failed = [];
|
|
9968
|
-
if (!fs
|
|
9977
|
+
if (!fs.existsSync(addonsDir)) return {
|
|
9969
9978
|
quarantined,
|
|
9970
9979
|
failed
|
|
9971
9980
|
};
|
|
@@ -9973,7 +9982,7 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9973
9982
|
const scan = (parent, scope) => {
|
|
9974
9983
|
let names;
|
|
9975
9984
|
try {
|
|
9976
|
-
names = fs
|
|
9985
|
+
names = fs.readdirSync(parent);
|
|
9977
9986
|
} catch {
|
|
9978
9987
|
return;
|
|
9979
9988
|
}
|
|
@@ -9992,8 +10001,8 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9992
10001
|
const version = readDeclaredVersion(full);
|
|
9993
10002
|
const to = freeQuarantineTarget(store, scope, dirName);
|
|
9994
10003
|
try {
|
|
9995
|
-
fs
|
|
9996
|
-
fs
|
|
10004
|
+
fs.mkdirSync(store, { recursive: true });
|
|
10005
|
+
fs.renameSync(full, to);
|
|
9997
10006
|
} catch (err) {
|
|
9998
10007
|
const error = err instanceof Error ? err.message : String(err);
|
|
9999
10008
|
failed.push({
|
|
@@ -10051,11 +10060,11 @@ function getRestartMarkerPath(dataDir) {
|
|
|
10051
10060
|
* intact or no marker at all (never a half-written file).
|
|
10052
10061
|
*/
|
|
10053
10062
|
function writePendingRestart(dataDir, marker) {
|
|
10054
|
-
fs
|
|
10063
|
+
fs.mkdirSync(dataDir, { recursive: true });
|
|
10055
10064
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10056
10065
|
const tmpPath = `${markerPath}.tmp`;
|
|
10057
|
-
fs
|
|
10058
|
-
fs
|
|
10066
|
+
fs.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
10067
|
+
fs.renameSync(tmpPath, markerPath);
|
|
10059
10068
|
}
|
|
10060
10069
|
/**
|
|
10061
10070
|
* Read + consume the marker. Returns the parsed payload on success and
|
|
@@ -10080,10 +10089,10 @@ function writePendingRestart(dataDir, marker) {
|
|
|
10080
10089
|
*/
|
|
10081
10090
|
function readPendingRestart(dataDir) {
|
|
10082
10091
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10083
|
-
if (!fs
|
|
10092
|
+
if (!fs.existsSync(markerPath)) return null;
|
|
10084
10093
|
let raw;
|
|
10085
10094
|
try {
|
|
10086
|
-
raw = fs
|
|
10095
|
+
raw = fs.readFileSync(markerPath, "utf-8");
|
|
10087
10096
|
} catch (err) {
|
|
10088
10097
|
console.error("[restart-coordinator] Marker unreadable — leaving in place:", err);
|
|
10089
10098
|
return null;
|
|
@@ -10122,7 +10131,7 @@ function readPendingRestart(dataDir) {
|
|
|
10122
10131
|
/** Remove the marker if present. No-op if missing. */
|
|
10123
10132
|
function clearPendingRestart(dataDir) {
|
|
10124
10133
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10125
|
-
fs
|
|
10134
|
+
fs.rmSync(markerPath, { force: true });
|
|
10126
10135
|
}
|
|
10127
10136
|
function isRestartKind(value) {
|
|
10128
10137
|
return value === "framework-update" || value === "manual" || value === "system";
|
|
@@ -10134,7 +10143,7 @@ function scheduleSelfRestart(options = {}) {
|
|
|
10134
10143
|
const touchTarget = process.env["CAMSTACK_RESTART_TOUCH_FILE"];
|
|
10135
10144
|
if (touchTarget !== void 0 && touchTarget.length > 0) try {
|
|
10136
10145
|
const now = /* @__PURE__ */ new Date();
|
|
10137
|
-
fs
|
|
10146
|
+
fs.utimesSync(touchTarget, now, now);
|
|
10138
10147
|
return;
|
|
10139
10148
|
} catch (err) {
|
|
10140
10149
|
console.error("[restart-coordinator] dev touch-reload failed; falling through to process exit:", err);
|
|
@@ -14467,11 +14476,11 @@ function applyEnvOverrides(raw) {
|
|
|
14467
14476
|
return result;
|
|
14468
14477
|
}
|
|
14469
14478
|
function loadYaml(configPath) {
|
|
14470
|
-
if (!fs
|
|
14479
|
+
if (!fs.existsSync(configPath)) {
|
|
14471
14480
|
console.warn(`[ConfigManager] Config file not found at: ${configPath}\n → Using built-in defaults. Set CONFIG_PATH env var or create the file.\n → Example path from project root: ./server/backend/data/config.yaml`);
|
|
14472
14481
|
return {};
|
|
14473
14482
|
}
|
|
14474
|
-
const parsed = load(fs
|
|
14483
|
+
const parsed = load(fs.readFileSync(configPath, "utf-8")) ?? {};
|
|
14475
14484
|
console.log(`[ConfigManager] Loaded config from: ${configPath}`);
|
|
14476
14485
|
return parsed;
|
|
14477
14486
|
}
|
|
@@ -22567,7 +22576,7 @@ async function probeVaapiInit(renderNode) {
|
|
|
22567
22576
|
*/
|
|
22568
22577
|
function safeExistsSync(path) {
|
|
22569
22578
|
try {
|
|
22570
|
-
return fs
|
|
22579
|
+
return fs.existsSync(path);
|
|
22571
22580
|
} catch {
|
|
22572
22581
|
return false;
|
|
22573
22582
|
}
|
|
@@ -22586,11 +22595,11 @@ function probeLinuxGpus() {
|
|
|
22586
22595
|
if (safeExistsSync("/dev/nvidia0") || safeExistsSync("/proc/driver/nvidia/version")) signals.hasNvidiaGpu = true;
|
|
22587
22596
|
try {
|
|
22588
22597
|
const drmDir = "/sys/class/drm";
|
|
22589
|
-
if (fs
|
|
22598
|
+
if (fs.existsSync(drmDir)) for (const entry of fs.readdirSync(drmDir)) {
|
|
22590
22599
|
if (!entry.startsWith("card")) continue;
|
|
22591
22600
|
const vendorPath = `${drmDir}/${entry}/device/vendor`;
|
|
22592
22601
|
if (!safeExistsSync(vendorPath)) continue;
|
|
22593
|
-
const vendor = fs
|
|
22602
|
+
const vendor = fs.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22594
22603
|
if (vendor === "0x10de") signals.hasNvidiaGpu = true;
|
|
22595
22604
|
else if (vendor === "0x1002") signals.hasAmdGpu = true;
|
|
22596
22605
|
else if (vendor === "0x8086") signals.hasIntelGpu = true;
|
|
@@ -22808,21 +22817,21 @@ function sleep$1(ms) {
|
|
|
22808
22817
|
* crashed holder) is stolen.
|
|
22809
22818
|
*/
|
|
22810
22819
|
async function withFileLock(lockPath, fn) {
|
|
22811
|
-
fs
|
|
22820
|
+
fs.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22812
22821
|
for (;;) try {
|
|
22813
|
-
const fd = fs
|
|
22814
|
-
fs
|
|
22822
|
+
const fd = fs.openSync(lockPath, "wx");
|
|
22823
|
+
fs.closeSync(fd);
|
|
22815
22824
|
break;
|
|
22816
22825
|
} catch {
|
|
22817
22826
|
try {
|
|
22818
|
-
if (Date.now() - fs
|
|
22827
|
+
if (Date.now() - fs.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs.rmSync(lockPath, { force: true });
|
|
22819
22828
|
else await sleep$1(LOCK_POLL_MS);
|
|
22820
22829
|
} catch {}
|
|
22821
22830
|
}
|
|
22822
22831
|
try {
|
|
22823
22832
|
return await fn();
|
|
22824
22833
|
} finally {
|
|
22825
|
-
fs
|
|
22834
|
+
fs.rmSync(lockPath, { force: true });
|
|
22826
22835
|
}
|
|
22827
22836
|
}
|
|
22828
22837
|
/** Coalesce in-process + serialize cross-process for one binary id. */
|
|
@@ -22880,7 +22889,7 @@ var AddonDepsManager = class {
|
|
|
22880
22889
|
* failed or tampered download throws, and provisioning reports it.
|
|
22881
22890
|
*/
|
|
22882
22891
|
async stageNativeDepsDeclaredBy(requirementsFile) {
|
|
22883
|
-
if (!declaresEdgetpuDelegate(fs
|
|
22892
|
+
if (!declaresEdgetpuDelegate(fs.readFileSync(requirementsFile, "utf8"))) return;
|
|
22884
22893
|
await singleFlight(this.depsDir, "edgetpu-delegate", () => ensureEdgetpuDelegate(this.nodeRoot, this.logger));
|
|
22885
22894
|
}
|
|
22886
22895
|
getDepsDir() {
|
|
@@ -23917,7 +23926,7 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
23917
23926
|
const addonId = declaration.id;
|
|
23918
23927
|
const nodeDataDir = process.env["CAMSTACK_DATA"] ?? dataDir;
|
|
23919
23928
|
const addonDataDir = path$1.resolve(nodeDataDir, "addons-data", addonId);
|
|
23920
|
-
fs
|
|
23929
|
+
fs.mkdirSync(addonDataDir, { recursive: true });
|
|
23921
23930
|
if (runtime.mode === "broker") ensureBindingSubscription(runtime.broker);
|
|
23922
23931
|
const regs = getRegistries(nodeId);
|
|
23923
23932
|
const workerResolver = {
|
|
@@ -25718,7 +25727,7 @@ var FailedRunnerRetryLedger = class {
|
|
|
25718
25727
|
function readRunnerPackageVersions(addonDirs) {
|
|
25719
25728
|
const out = {};
|
|
25720
25729
|
for (const dir of addonDirs) try {
|
|
25721
|
-
const raw = JSON.parse(fs
|
|
25730
|
+
const raw = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
25722
25731
|
const version = typeof raw === "object" && raw !== null ? Reflect.get(raw, "version") : null;
|
|
25723
25732
|
out[dir] = typeof version === "string" && version.length > 0 ? version : null;
|
|
25724
25733
|
} catch {
|
|
@@ -25779,7 +25788,7 @@ function readAddonHeapDeclaration(spec) {
|
|
|
25779
25788
|
if (cached !== void 0) return cached;
|
|
25780
25789
|
let declaration = EMPTY_HEAP_DECLARATION;
|
|
25781
25790
|
for (const manifestPath of [path$1.join(spec.addonDir, "package.json"), path$1.join(path$1.dirname(spec.addonDir), "package.json")]) try {
|
|
25782
|
-
const raw = fs
|
|
25791
|
+
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
25783
25792
|
const parsed = JSON.parse(raw);
|
|
25784
25793
|
const profile = extractHeapProfile(parsed, spec.addonId);
|
|
25785
25794
|
const maxOldSpaceMb = extractMaxOldSpaceMb(parsed, spec.addonId);
|
|
@@ -27001,17 +27010,17 @@ var JobJournal = class {
|
|
|
27001
27010
|
return path$1.join(this.jobsDir, `${id}.json`);
|
|
27002
27011
|
}
|
|
27003
27012
|
writeAtomic(filePath, data) {
|
|
27004
|
-
fs
|
|
27013
|
+
fs.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
27005
27014
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
27006
|
-
fs
|
|
27015
|
+
fs.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
27007
27016
|
encoding: "utf-8",
|
|
27008
27017
|
mode: 384
|
|
27009
27018
|
});
|
|
27010
|
-
fs
|
|
27019
|
+
fs.renameSync(tmp, filePath);
|
|
27011
27020
|
}
|
|
27012
27021
|
readIndex() {
|
|
27013
27022
|
try {
|
|
27014
|
-
const raw = JSON.parse(fs
|
|
27023
|
+
const raw = JSON.parse(fs.readFileSync(this.indexPath, "utf-8"));
|
|
27015
27024
|
if (raw && Array.isArray(raw.jobIds)) return {
|
|
27016
27025
|
version: 1,
|
|
27017
27026
|
jobIds: raw.jobIds
|
|
@@ -27036,7 +27045,7 @@ var JobJournal = class {
|
|
|
27036
27045
|
}
|
|
27037
27046
|
getJob(id) {
|
|
27038
27047
|
try {
|
|
27039
|
-
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs
|
|
27048
|
+
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs.readFileSync(this.jobPath(id), "utf-8")));
|
|
27040
27049
|
return parsed.success ? parsed.data : null;
|
|
27041
27050
|
} catch {
|
|
27042
27051
|
return null;
|
|
@@ -27101,14 +27110,14 @@ var StagingArea = class {
|
|
|
27101
27110
|
}
|
|
27102
27111
|
async fetchAndStage(input) {
|
|
27103
27112
|
const destDir = path$1.join(this.stagingDir, input.jobId, safeSegment(input.name));
|
|
27104
|
-
fs
|
|
27113
|
+
fs.rmSync(destDir, {
|
|
27105
27114
|
recursive: true,
|
|
27106
27115
|
force: true
|
|
27107
27116
|
});
|
|
27108
27117
|
const tgz = await this.deps.fetchTarball(input.name, input.version, input.signal);
|
|
27109
27118
|
if (input.signal.aborted) throw new Error("staging aborted after fetch");
|
|
27110
27119
|
await this.deps.extract(tgz, destDir);
|
|
27111
|
-
const raw = JSON.parse(fs
|
|
27120
|
+
const raw = JSON.parse(fs.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
27112
27121
|
if (typeof raw.version !== "string" || raw.version.length === 0) throw new Error(`staging validation failed: ${input.name} staged a package.json with no version`);
|
|
27113
27122
|
if (EXACT_SEMVER.test(input.version) && raw.version !== input.version) throw new Error(`staging validation failed: ${input.name} expected version ${input.version}, got ${raw.version}`);
|
|
27114
27123
|
return {
|
|
@@ -27117,7 +27126,7 @@ var StagingArea = class {
|
|
|
27117
27126
|
};
|
|
27118
27127
|
}
|
|
27119
27128
|
cleanup(jobId) {
|
|
27120
|
-
fs
|
|
27129
|
+
fs.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
27121
27130
|
recursive: true,
|
|
27122
27131
|
force: true
|
|
27123
27132
|
});
|
|
@@ -27132,13 +27141,13 @@ var StagingArea = class {
|
|
|
27132
27141
|
sweepOrphans() {
|
|
27133
27142
|
let entries;
|
|
27134
27143
|
try {
|
|
27135
|
-
entries = fs
|
|
27144
|
+
entries = fs.readdirSync(this.stagingDir);
|
|
27136
27145
|
} catch {
|
|
27137
27146
|
return 0;
|
|
27138
27147
|
}
|
|
27139
27148
|
let removed = 0;
|
|
27140
27149
|
for (const name of entries) try {
|
|
27141
|
-
fs
|
|
27150
|
+
fs.rmSync(path$1.join(this.stagingDir, name), {
|
|
27142
27151
|
recursive: true,
|
|
27143
27152
|
force: true
|
|
27144
27153
|
});
|
|
@@ -27316,7 +27325,7 @@ var LifecycleJobEngine = class {
|
|
|
27316
27325
|
* on failure → `failed`.
|
|
27317
27326
|
*/
|
|
27318
27327
|
async reconcileJob(job) {
|
|
27319
|
-
const exists = this.deps.stagedPathExists ?? ((p) => fs
|
|
27328
|
+
const exists = this.deps.stagedPathExists ?? ((p) => fs.existsSync(p));
|
|
27320
27329
|
for (const task of job.tasks) {
|
|
27321
27330
|
if (task.target === "framework") {
|
|
27322
27331
|
if (!this.isTerminal(task.phase)) this.skipFrameworkTask(job, task);
|
|
@@ -27953,7 +27962,7 @@ var CatalogRegistry = class {
|
|
|
27953
27962
|
const file = path$1.join(packageDir, "i18n", `${lang}.json`);
|
|
27954
27963
|
let text;
|
|
27955
27964
|
try {
|
|
27956
|
-
text = fs
|
|
27965
|
+
text = fs.readFileSync(file, "utf8");
|
|
27957
27966
|
} catch {
|
|
27958
27967
|
continue;
|
|
27959
27968
|
}
|
|
@@ -28009,4 +28018,4 @@ function resetCatalogRegistryForTests() {
|
|
|
28009
28018
|
}
|
|
28010
28019
|
//#endregion
|
|
28011
28020
|
var readAllRows = import_read_all_rows.readAllRows;
|
|
28012
|
-
export { ADDON_VERSION_REASON_HUB, ADDON_VERSION_REASON_REGISTRY_LATEST, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_MAIN_HEAP_WATCH_LABEL, AGENT_READINESS_SERVICE_NAME, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_TYP, AGENT_UI_UNLOCK_USE, AGENT_UI_UNLOCK_VERSION, 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, AddonRefusedError, AddonRouteRegistry, AgentHttpsInstallError, AgentHttpsNames, AgentMdnsAdvertiser, AgentMeshIdentityGate, AgentPairing, AlertCenterAddon, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, CatalogRegistry, ClusterNodeHistoryBodySchema, ClusterNodeTombstoneBodySchema, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_HUB_TLS_TCP_PORT, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceHistoryAddon, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, 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, HubPairing, INFRA_CAPABILITIES, INTEGRATIONS_LEGACY, INTEGRATION_SETTINGS_LEGACY, IntegrationRegistry, InvalidCorsOriginError, JWT_SIGNING_KEY_REF, JobJournal, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MEMBERSHIP_PATHS, MESH_ACTION_FORBIDDEN_TYPE, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MembershipResponder, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshIdentityGate, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OPAQUE_ORIGIN, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PAIRING_CODE_DIGITS, PAIRING_MAX_CODE_ATTEMPTS, PAIRING_MAX_SESSIONS, PAIRING_PATHS, PAIRING_PIN_DIGITS, PAIRING_PROTOCOL, PAIRING_TTL_MS, PARENT_ROUTED_PROVIDER_ADDON_ID, PERMITTED_DNS_SUFFIXES, PERMITTED_IP_RANGES, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, PairingHttpError, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, RENEWAL_ABANDONED, 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, RecordsEngine, ReplEngine, RingBuffer, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORAGE_DRAIN_STATE_LEGACY, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, acceptAgentSans, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, agentHttpsPaths, allFamiliesListenHost, answerClaimedGetStatus, answerDeviceCallRedirect, applyCertificateToListener, applyLanHttp, asBrokerLike, attachUserManagementInternal, attributeStall, backupOrchestratorRecordKinds, backupRecordStoresOf, bareAddonOf, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildAgentAnnouncement, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNameConstraintSet, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildTransporter, builderMountedCapNames, caFingerprint, caFingerprintCompact, caReplacementMarkerFile, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, catalogNamespaceOf, certificateNames, chainsToPublicRoot, checkUploadedCa, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterAgentRecordKinds, clusterEventTopic, clusterNodeHistoryRecordKind, clusterNodeTombstoneRecordKind, collectAgentNames, collectCertIdentity, collectModelFiles, compileLogFilter, computePairingCommitment, computePairingSas, connectBrokerTransport, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createAgentTransport, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCiaoPublisher, createCidrMatcher, createCoreCapService, createCoreCatalogRegistry, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, currentBrokerTransporter, decideAddonVersionMove, deleteModelFromDisk, deriveAgentListenPort, describeCsr, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, disconnectBrokerTransport, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, filterIsEmpty, findAddonRefusal, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getCatalogRegistry, getFfmpegDownloadUrl, getLocalEventInterest, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessJwtSigningKeyState, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, heapSpaceField, hostNodeIdOf, hubHostFromMeshAddress, hubMainRssBudget, hubServerVersionOf, installAgentHttps, installBrokerTransporter, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, integrationRegistryRecordKinds, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isCollectionArrayMethod, isConstrainedCa, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isInsecureOrigin, isInstalledTransporter, isLocalOnlyHostname, isModelDownloaded, isPeerEventPacket, isPrivateAddress, isProcessVerifiedMeshPeer, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isValidAgentNodeId, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, keyFingerprintShort, leafFingerprintOf, levelRank, lineContainsText, lineMatches, loadAgentHttps, loadBootstrapConfig, loadDeviceCa, loadMeshCa, loadTlsCert, localCaCommonName, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mountNativeCapService, nextRssBudgetState, normalizeIp, normalizeOrigin, onLocalEventInterestChange, onProcessNodeRegistered, onSessionsRevoked, openMeshTlsWhenRevocationsLoaded, originNodeOf, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseOriginList, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, permitsIdentity, permitsName, pinnedHttpsCaFingerprint, preferencesLimitReasonOf, prepareBootTls, prepareRestoreArchive, probePlatform, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readAllRows, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readNameConstraints, readOriginSetting, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsEnabled, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, replaceUnconstrainedLocalCa, requireProcessMeshCa, resetCatalogRegistryForTests, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, retirePreviousLocalCa, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setHuggingFaceReachabilityObserver, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessMeshCertificateRegistry, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signMembershipProof, signPairingProof, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storageOrchestratorRecordKinds, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, useStoredUploadedCertificate, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyMembershipAnswer, verifyPairingProof, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsEnabled, writeTlsMode };
|
|
28021
|
+
export { ADDON_VERSION_REASON_HUB, ADDON_VERSION_REASON_REGISTRY_LATEST, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_MAIN_HEAP_WATCH_LABEL, AGENT_READINESS_SERVICE_NAME, AGENT_UI_UNLOCK_TTL_MS, AGENT_UI_UNLOCK_TYP, AGENT_UI_UNLOCK_USE, AGENT_UI_UNLOCK_VERSION, 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, AddonRefusedError, AddonRouteRegistry, AgentHttpsInstallError, AgentHttpsNames, AgentMdnsAdvertiser, AgentMeshIdentityGate, AgentPairing, AlertCenterAddon, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, CatalogRegistry, ClusterNodeHistoryBodySchema, ClusterNodeTombstoneBodySchema, ComposerAddon, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_HUB_TLS_TCP_PORT, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceHistoryAddon, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, 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, HUB_RSS_BUDGET_OVERRIDE_SOURCE, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, HubPairing, INFRA_CAPABILITIES, INTEGRATIONS_LEGACY, INTEGRATION_SETTINGS_LEGACY, IntegrationRegistry, InvalidCorsOriginError, JWT_SIGNING_KEY_REF, JobJournal, JwtSigningKeyUnavailableError, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LoginSessionManager, LokiDestination, LokiLoggingAddon, MAX_CAP_ACTIONS_PER_PEER, MAX_LEAF_VALIDITY_DAYS, MEMBERSHIP_PATHS, MESH_ACTION_FORBIDDEN_TYPE, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MembershipResponder, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshIdentityGate, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OPAQUE_ORIGIN, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PAIRING_CODE_DIGITS, PAIRING_MAX_CODE_ATTEMPTS, PAIRING_MAX_SESSIONS, PAIRING_PATHS, PAIRING_PIN_DIGITS, PAIRING_PROTOCOL, PAIRING_TTL_MS, PARENT_ROUTED_PROVIDER_ADDON_ID, PERMITTED_DNS_SUFFIXES, PERMITTED_IP_RANGES, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, PairingHttpError, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, RENEWAL_ABANDONED, 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, RecordsEngine, ReplEngine, RingBuffer, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORAGE_DRAIN_STATE_LEGACY, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, SettingsReadUnavailableError, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemBackupService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, TlsTcpTransporter, ToastService, UDS_NO_ROUTE_PREFIX, UNCLAIMED, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, acceptAgentSans, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, agentHttpsPaths, allFamiliesListenHost, answerClaimedGetStatus, answerDeviceCallRedirect, applyCertificateToListener, applyLanHttp, asBrokerLike, attachUserManagementInternal, attributeStall, backupOrchestratorRecordKinds, backupRecordStoresOf, bareAddonOf, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildAgentAnnouncement, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNameConstraintSet, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildTransporter, builderMountedCapNames, caFingerprint, caFingerprintCompact, caReplacementMarkerFile, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, catalogNamespaceOf, certificateNames, chainsToPublicRoot, checkUploadedCa, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterAgentRecordKinds, clusterEventTopic, clusterNodeHistoryRecordKind, clusterNodeTombstoneRecordKind, collectAgentNames, collectCertIdentity, collectModelFiles, compileLogFilter, computePairingCommitment, computePairingSas, connectBrokerTransport, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createAgentTransport, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCiaoPublisher, createCidrMatcher, createCoreCapService, createCoreCatalogRegistry, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, currentBrokerTransporter, decideAddonVersionMove, deleteModelFromDisk, deriveAgentListenPort, describeCsr, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, disconnectBrokerTransport, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, filterIsEmpty, findAddonRefusal, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getCatalogRegistry, getFfmpegDownloadUrl, getLocalEventInterest, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessJwtSigningKeyState, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, heapSpaceField, hostNodeIdOf, hubHostFromMeshAddress, hubMainRssBudget, hubServerVersionOf, installAgentHttps, installBrokerTransporter, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, integrationRegistryRecordKinds, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isCollectionArrayMethod, isConstrainedCa, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isInsecureOrigin, isInstalledTransporter, isLocalOnlyHostname, isModelDownloaded, isPeerEventPacket, isPrivateAddress, isProcessVerifiedMeshPeer, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isValidAgentNodeId, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, keyFingerprintShort, leafFingerprintOf, levelRank, lineContainsText, lineMatches, loadAgentHttps, loadBootstrapConfig, loadDeviceCa, loadMeshCa, loadTlsCert, localCaCommonName, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mountNativeCapService, nextRssBudgetState, normalizeIp, normalizeOrigin, onLocalEventInterestChange, onProcessNodeRegistered, onSessionsRevoked, openMeshTlsWhenRevocationsLoaded, originNodeOf, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseOriginList, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, permitsIdentity, permitsName, pinnedHttpsCaFingerprint, preferencesLimitReasonOf, prepareBootTls, prepareRestoreArchive, probePlatform, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readAllRows, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readNameConstraints, readOriginSetting, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsEnabled, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, replaceUnconstrainedLocalCa, requireProcessMeshCa, resetCatalogRegistryForTests, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, retirePreviousLocalCa, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setHuggingFaceReachabilityObserver, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessMeshCertificateRegistry, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signMembershipProof, signPairingProof, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storageOrchestratorRecordKinds, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, useStoredUploadedCertificate, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyMembershipAnswer, verifyPairingProof, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsEnabled, writeTlsMode };
|