@camstack/server 1.2.769 → 1.2.770
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 +6 -0
- package/dist/api/core/cap-providers.js +4 -193
- package/dist/api/trpc/generated-cap-routers.js +40 -30
- package/dist/core/addon/integration-visibility.js +0 -5
- package/package.json +35 -15
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-C_rkCAus.mjs → agent-https-BGRPCKwT.mjs} +1 -1
- package/system/dist/{agent-https-Cw5Wc_ip.js → agent-https-mq6d71iq.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 +3 -3
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
- 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 +17 -10
- package/system/dist/builtins/keychain/index.mjs +17 -10
- 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/integration-record-kinds.d.ts +3 -10
- package/system/dist/builtins/sqlite-storage/integration-registry.d.ts +1 -11
- package/system/dist/builtins/sqlite-storage/integration-rows-ports.d.ts +13 -15
- package/system/dist/builtins/sqlite-storage/migrations/legacy-integration-rows-door.d.ts +31 -0
- package/system/dist/builtins/sqlite-storage/migrations/migrations-provider.d.ts +39 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +48 -5
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +48 -5
- 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/{capture-engine-DXSWU1PY.js → capture-engine--FQ8NUHh.js} +1 -1
- package/system/dist/{capture-engine-Kl46lSBi.mjs → capture-engine-Cmx7DIzV.mjs} +1 -1
- package/system/dist/{composition-sources-ClCP809M.mjs → composition-sources-Bd09D5f4.mjs} +1 -1
- package/system/dist/{composition-sources-Cq0IeRv9.js → composition-sources-cvZAN87H.js} +1 -1
- package/system/dist/{constants-CDxTuuXp.mjs → constants-Dce28BAx.mjs} +1 -1
- package/system/dist/{constants-CI5ySMIj.js → constants-gM9xHjyj.js} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-BIJZBObd.mjs → custom-action-registry-oHl1xltx.mjs} +37 -37
- package/system/dist/{device-ca-DPvU-3TE.js → device-ca-BmeH6Y9E.js} +1 -1
- package/system/dist/{device-ca-uRLJ8-jZ.mjs → device-ca-DcMuT-Yp.mjs} +1 -1
- package/system/dist/{dist-C_SNsYGY.mjs → dist-C3WXy3Ix.mjs} +78 -55
- package/system/dist/{dist-BDixk7cu.js → dist-Dtw1sIeQ.js} +78 -55
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-7uRbexmH.js → hub-mdns-ciao-C49eqyby.js} +2 -2
- package/system/dist/{hub-mdns-ciao-ea1EwFAF.mjs → hub-mdns-ciao-Dfue_0kR.mjs} +2 -2
- package/system/dist/index.d.ts +1 -1
- package/system/dist/index.js +42 -230
- package/system/dist/index.mjs +262 -450
- package/system/dist/legacy-integration-rows-door-B8_XCqUX.js +290 -0
- package/system/dist/legacy-integration-rows-door-DK42Bh2Q.mjs +255 -0
- package/system/dist/migrations/hub/2026-11-05-drop-integration-settings.d.ts +16 -0
- package/system/dist/{restore-archive-D0y_tFM2.mjs → restore-archive-C0YDO-qd.mjs} +94 -94
- package/system/dist/{restore-archive-CpTnlXUA.js → restore-archive-DuktQtye.js} +1 -1
- package/system/dist/{wal-maintenance-Dy4gxMdb.js → wal-maintenance-BEo-y-cQ.js} +0 -0
- package/system/dist/{wal-maintenance-BvxzVfje.mjs → wal-maintenance-DhuvKiGK.mjs} +0 -0
- package/system/package.json +1 -1
- package/dist/api/core/integration-secrets.js +0 -96
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { Ci as objectInputDeclaresRequiredDeviceId, Do as DATAPLANE_SECRET_HEADER$1, E as CatalogFileSchema, Ea as supportedRuntimes, Eo as CALLER_STAMPED_CAPABILITIES$1, Go as ReadinessRegistry, Gr as isVoidInput, Gs as parseJsonUnknown, Ii as procedureAuthKey, Ko as ReadinessTimeoutError, Kr as kebabToCamel$1, Lr as isArrayOutputSchema, Nr as interpolate, Oo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Os as isDebugChannelName, Qi as resolveMethodAuth, Rr as isCollectionArrayMethod, Si as objectInputDeclaresAddonId, Ss as expandCapMethods, Ur as isObjectInput, Wo as RUNTIME_DEFAULTS, Ws as parseJsonObject, Ys as resolveCapMount, Zr as lifecycleJobSchema, Zs as scopeKey, a as AGENT_MDNS_TXT_KEYS, ac as userError, ai as looseSchema, as as asNumber, bs as emitDownForOwnedCaps, bt as METHOD_ACCESS_MAP, ca as scopesAllowDeviceCap, dc as EventCategory$1, fs as collectSecretMarkerRefs, i as AGENT_MDNS_SERVICE_TYPE, ii as logLevelAtMost, is as asJsonObject$1, ko as DEVICE_STATUS_METHOD, ln as addonSettingsCapability, ms as createEvent$1, o as ALL_CAPABILITY_DEFINITIONS, oc as withoutCallerStamp, os as asString$1, qs as readinessKey, sa as scopesAllowAddon, uc as errMsg$1, va as splitTranslationRef, vn as bareAddonId, vt as LOG_LEVEL_RANK, ws as getDebugInterest, y as CATALOG_LANGS, yr as extractNestedAddonId, ys as defineRecordKinds } 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 { Ci as objectInputDeclaresRequiredDeviceId, Do as DATAPLANE_SECRET_HEADER$1, E as CatalogFileSchema, Ea as supportedRuntimes, Eo as CALLER_STAMPED_CAPABILITIES$1, Go as ReadinessRegistry, Gr as isVoidInput, Gs as parseJsonUnknown, Ii as procedureAuthKey, Ko as ReadinessTimeoutError, Kr as kebabToCamel$1, Lr as isArrayOutputSchema, Nr as interpolate, Oo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Os as isDebugChannelName, Qi as resolveMethodAuth, Rr as isCollectionArrayMethod, Si as objectInputDeclaresAddonId, Ss as expandCapMethods, Ur as isObjectInput, Wo as RUNTIME_DEFAULTS, Ws as parseJsonObject, Ys as resolveCapMount, Zr as lifecycleJobSchema, Zs as scopeKey, a as AGENT_MDNS_TXT_KEYS, ac as userError, ai as looseSchema, as as asNumber, bs as emitDownForOwnedCaps, bt as METHOD_ACCESS_MAP, ca as scopesAllowDeviceCap, dc as EventCategory$1, fs as collectSecretMarkerRefs, i as AGENT_MDNS_SERVICE_TYPE, ii as logLevelAtMost, is as asJsonObject$1, ko as DEVICE_STATUS_METHOD, ln as addonSettingsCapability, ms as createEvent$1, o as ALL_CAPABILITY_DEFINITIONS, oc as withoutCallerStamp, os as asString$1, qs as readinessKey, sa as scopesAllowAddon, uc as errMsg$1, va as splitTranslationRef, vn as bareAddonId, vt as LOG_LEVEL_RANK, ws as getDebugInterest, y as CATALOG_LANGS, yr as extractNestedAddonId, ys as defineRecordKinds } from "./dist-C3WXy3Ix.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-DcMuT-Yp.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,23 @@ 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-DhuvKiGK.mjs";
|
|
29
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-DK42Bh2Q.mjs";
|
|
29
30
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
30
31
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
31
32
|
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
33
|
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-
|
|
34
|
+
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-BGRPCKwT.mjs";
|
|
35
|
+
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-Dce28BAx.mjs";
|
|
35
36
|
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
37
|
import "./builtins/system-config/index.mjs";
|
|
37
38
|
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-
|
|
39
|
+
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-oHl1xltx.mjs";
|
|
40
|
+
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-Dfue_0kR.mjs";
|
|
40
41
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
41
42
|
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-
|
|
43
|
+
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-C0YDO-qd.mjs";
|
|
44
|
+
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
44
45
|
import { z } from "zod";
|
|
45
46
|
import * as crypto$1 from "node:crypto";
|
|
46
47
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -55,7 +56,7 @@ import { BOOT_RECOVERY_BACKOFF_MS, CALLER_STAMPED_CAPABILITIES, DATAPLANE_SECRET
|
|
|
55
56
|
import * as os$1 from "node:os";
|
|
56
57
|
import { tmpdir } from "node:os";
|
|
57
58
|
import { pathToFileURL } from "node:url";
|
|
58
|
-
import * as fs from "node:fs";
|
|
59
|
+
import * as fs$1 from "node:fs";
|
|
59
60
|
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
60
61
|
import { execFile, spawn } from "node:child_process";
|
|
61
62
|
import { once } from "node:events";
|
|
@@ -5113,7 +5114,7 @@ var PythonEnvManager = class {
|
|
|
5113
5114
|
async ensure(options) {
|
|
5114
5115
|
const probe = await this.probe();
|
|
5115
5116
|
if (!probe.available || !probe.path) throw userError("system.python-required", void 0, "Python 3.10+ is required but not found on this system");
|
|
5116
|
-
if (!fs.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5117
|
+
if (!fs$1.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5117
5118
|
"-m",
|
|
5118
5119
|
"venv",
|
|
5119
5120
|
this.venvPath
|
|
@@ -5136,7 +5137,7 @@ var PythonEnvManager = class {
|
|
|
5136
5137
|
}
|
|
5137
5138
|
spawn(script, args) {
|
|
5138
5139
|
const venvPython = path$1.join(this.venvPath, "bin", "python");
|
|
5139
|
-
if (!fs.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5140
|
+
if (!fs$1.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5140
5141
|
return spawn(venvPython, [script, ...args]);
|
|
5141
5142
|
}
|
|
5142
5143
|
};
|
|
@@ -5488,20 +5489,20 @@ var StorageManager = class {
|
|
|
5488
5489
|
const basePath = this.locationManager.getBackend(mappedName).basePath;
|
|
5489
5490
|
location.files = {
|
|
5490
5491
|
async readFile(p) {
|
|
5491
|
-
return fs.promises.readFile(path$1.join(basePath, p));
|
|
5492
|
+
return fs$1.promises.readFile(path$1.join(basePath, p));
|
|
5492
5493
|
},
|
|
5493
5494
|
async writeFile(p, data) {
|
|
5494
5495
|
const full = path$1.join(basePath, p);
|
|
5495
|
-
await fs.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5496
|
-
await fs.promises.writeFile(full, data);
|
|
5496
|
+
await fs$1.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5497
|
+
await fs$1.promises.writeFile(full, data);
|
|
5497
5498
|
},
|
|
5498
5499
|
async deleteFile(p) {
|
|
5499
|
-
await fs.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5500
|
+
await fs$1.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5500
5501
|
},
|
|
5501
5502
|
async listFiles(prefix) {
|
|
5502
5503
|
const dir = prefix ? path$1.join(basePath, prefix) : basePath;
|
|
5503
5504
|
try {
|
|
5504
|
-
return (await fs.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5505
|
+
return (await fs$1.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5505
5506
|
} catch {
|
|
5506
5507
|
return [];
|
|
5507
5508
|
}
|
|
@@ -5511,7 +5512,7 @@ var StorageManager = class {
|
|
|
5511
5512
|
},
|
|
5512
5513
|
async exists(p) {
|
|
5513
5514
|
try {
|
|
5514
|
-
await fs.promises.access(path$1.join(basePath, p));
|
|
5515
|
+
await fs$1.promises.access(path$1.join(basePath, p));
|
|
5515
5516
|
return true;
|
|
5516
5517
|
} catch {
|
|
5517
5518
|
return false;
|
|
@@ -5671,98 +5672,35 @@ var AgentMdnsAdvertiser = class {
|
|
|
5671
5672
|
var import_read_all_rows = require_read_all_rows();
|
|
5672
5673
|
/**
|
|
5673
5674
|
* Record kinds owned by integration-registry (phase 4).
|
|
5675
|
+
*
|
|
5676
|
+
* An integration's configuration is the addon's own instance record. This owner
|
|
5677
|
+
* keeps only the registry row (id, addon, name, enabled, info).
|
|
5674
5678
|
*/
|
|
5675
5679
|
var INTEGRATIONS_LEGACY = "integrations";
|
|
5676
|
-
var
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
})
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
writeTrigger: "createIntegration / updateIntegration / deleteIntegration",
|
|
5697
|
-
device: "none",
|
|
5698
|
-
at: "none",
|
|
5699
|
-
indexes: [{
|
|
5700
|
-
name: "addon_id",
|
|
5701
|
-
fields: ["addonId"]
|
|
5702
|
-
}],
|
|
5703
|
-
retention: { none: "deleteIntegration only" }
|
|
5704
|
-
},
|
|
5705
|
-
"integration-settings": {
|
|
5706
|
-
schema: IntegrationSettingBodySchema,
|
|
5707
|
-
class: "config",
|
|
5708
|
-
writeTrigger: "setIntegrationSetting — one row per (integrationId, key)",
|
|
5709
|
-
device: "none",
|
|
5710
|
-
at: "none",
|
|
5711
|
-
indexes: [{
|
|
5712
|
-
name: "integration_id",
|
|
5713
|
-
fields: ["integrationId"]
|
|
5714
|
-
}],
|
|
5715
|
-
retention: { none: "cascade on deleteIntegration" }
|
|
5716
|
-
}
|
|
5717
|
-
});
|
|
5680
|
+
var _integrationRegistryRecordKinds = defineRecordKinds({ integrations: {
|
|
5681
|
+
schema: z.object({
|
|
5682
|
+
addonId: z.string(),
|
|
5683
|
+
name: z.string(),
|
|
5684
|
+
enabled: z.boolean(),
|
|
5685
|
+
info: z.record(z.string(), z.unknown()),
|
|
5686
|
+
originStableId: z.string().optional(),
|
|
5687
|
+
createdAt: z.number(),
|
|
5688
|
+
updatedAt: z.number()
|
|
5689
|
+
}),
|
|
5690
|
+
class: "config",
|
|
5691
|
+
writeTrigger: "createIntegration / updateIntegration / deleteIntegration",
|
|
5692
|
+
device: "none",
|
|
5693
|
+
at: "none",
|
|
5694
|
+
indexes: [{
|
|
5695
|
+
name: "addon_id",
|
|
5696
|
+
fields: ["addonId"]
|
|
5697
|
+
}],
|
|
5698
|
+
retention: { none: "deleteIntegration only" }
|
|
5699
|
+
} });
|
|
5718
5700
|
var integrationRegistryRecordKinds = _integrationRegistryRecordKinds;
|
|
5719
5701
|
_integrationRegistryRecordKinds.integrations;
|
|
5720
|
-
_integrationRegistryRecordKinds["integration-settings"];
|
|
5721
5702
|
//#endregion
|
|
5722
5703
|
//#region src/builtins/sqlite-storage/integration-registry.ts
|
|
5723
|
-
function serializeSetting(value) {
|
|
5724
|
-
if (typeof value === "number") return {
|
|
5725
|
-
value: String(value),
|
|
5726
|
-
valueType: "number"
|
|
5727
|
-
};
|
|
5728
|
-
if (typeof value === "boolean") return {
|
|
5729
|
-
value: String(value),
|
|
5730
|
-
valueType: "boolean"
|
|
5731
|
-
};
|
|
5732
|
-
if (typeof value === "string") return {
|
|
5733
|
-
value,
|
|
5734
|
-
valueType: "string"
|
|
5735
|
-
};
|
|
5736
|
-
return {
|
|
5737
|
-
value: JSON.stringify(value),
|
|
5738
|
-
valueType: "json"
|
|
5739
|
-
};
|
|
5740
|
-
}
|
|
5741
|
-
/**
|
|
5742
|
-
* Decode a settings row back to its value.
|
|
5743
|
-
*
|
|
5744
|
-
* `raw` is `unknown`, not `string`, on purpose: the collection surface parses
|
|
5745
|
-
* any TEXT column whose value starts with `{` or `[`, so a `json` setting
|
|
5746
|
-
* arrives here ALREADY an object. Coercing it with `String(...)` first — which
|
|
5747
|
-
* is what a straight port of the `table*` version did — produced the literal
|
|
5748
|
-
* `"[object Object]"`.
|
|
5749
|
-
*/
|
|
5750
|
-
function deserializeSetting(raw, valueType) {
|
|
5751
|
-
if (valueType === "json") {
|
|
5752
|
-
if (typeof raw !== "string") return raw;
|
|
5753
|
-
try {
|
|
5754
|
-
return JSON.parse(raw);
|
|
5755
|
-
} catch {
|
|
5756
|
-
return raw;
|
|
5757
|
-
}
|
|
5758
|
-
}
|
|
5759
|
-
const value = String(raw);
|
|
5760
|
-
switch (valueType) {
|
|
5761
|
-
case "number": return Number(value);
|
|
5762
|
-
case "boolean": return value === "true";
|
|
5763
|
-
default: return value;
|
|
5764
|
-
}
|
|
5765
|
-
}
|
|
5766
5704
|
/**
|
|
5767
5705
|
* Read an `info` blob off a row.
|
|
5768
5706
|
*
|
|
@@ -5830,29 +5768,6 @@ var INTEGRATIONS_INDEXES = [{
|
|
|
5830
5768
|
name: "idx_integrations_addon",
|
|
5831
5769
|
columns: ["addon_id"]
|
|
5832
5770
|
}];
|
|
5833
|
-
var INTEGRATION_SETTINGS_COLUMNS = [
|
|
5834
|
-
{
|
|
5835
|
-
name: "integration_id",
|
|
5836
|
-
type: "TEXT",
|
|
5837
|
-
notNull: true
|
|
5838
|
-
},
|
|
5839
|
-
{
|
|
5840
|
-
name: "key",
|
|
5841
|
-
type: "TEXT",
|
|
5842
|
-
notNull: true
|
|
5843
|
-
},
|
|
5844
|
-
{
|
|
5845
|
-
name: "value",
|
|
5846
|
-
type: "TEXT",
|
|
5847
|
-
notNull: true
|
|
5848
|
-
},
|
|
5849
|
-
{
|
|
5850
|
-
name: "value_type",
|
|
5851
|
-
type: "TEXT",
|
|
5852
|
-
notNull: true,
|
|
5853
|
-
defaultValue: "string"
|
|
5854
|
-
}
|
|
5855
|
-
];
|
|
5856
5771
|
/**
|
|
5857
5772
|
* @durable class=config owner=integration-registry
|
|
5858
5773
|
* write="`createIntegration` — an operator adds a provider, or an addon declares
|
|
@@ -5863,16 +5778,9 @@ var INTEGRATION_SETTINGS_COLUMNS = [
|
|
|
5863
5778
|
*/
|
|
5864
5779
|
var INTEGRATIONS = INTEGRATIONS_LEGACY;
|
|
5865
5780
|
/**
|
|
5866
|
-
* @durable class=config owner=integration-registry
|
|
5867
|
-
* write="`setIntegrationSetting` — one row per (integration_id, key), deleted and
|
|
5868
|
-
* re-inserted on every write; this is the operator's per-integration intent"
|
|
5869
|
-
* retention="cascade only — `deleteIntegration` removes the parent's rows. There
|
|
5870
|
-
* is no sweep, so a key an addon stops declaring stays on disk forever."
|
|
5871
|
-
*/
|
|
5872
|
-
var INTEGRATION_SETTINGS = INTEGRATION_SETTINGS_LEGACY;
|
|
5873
|
-
/**
|
|
5874
5781
|
* The persisted INTEGRATIONS — one row per provider instance an operator (or a
|
|
5875
|
-
* declaring addon) added
|
|
5782
|
+
* declaring addon) added. The instance's configuration lives on the addon's own
|
|
5783
|
+
* record, not here.
|
|
5876
5784
|
*
|
|
5877
5785
|
* It had a device half once: `devices` + `device_settings_kv`, `dev_NNNN` ids,
|
|
5878
5786
|
* `createDevice` / `listCameras` / `setDeviceSetting`. It was removed on
|
|
@@ -5904,23 +5812,14 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
5904
5812
|
this.recordStores = recordStores;
|
|
5905
5813
|
}
|
|
5906
5814
|
static recordStoresOf(records) {
|
|
5907
|
-
return {
|
|
5908
|
-
integrations: records.kind(integrationRegistryRecordKinds.integrations),
|
|
5909
|
-
settings: records.kind(integrationRegistryRecordKinds["integration-settings"])
|
|
5910
|
-
};
|
|
5815
|
+
return { integrations: records.kind(integrationRegistryRecordKinds.integrations) };
|
|
5911
5816
|
}
|
|
5912
5817
|
async initialize() {
|
|
5913
|
-
if (this.recordStores === void 0) {
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
});
|
|
5919
|
-
await this.store.declareCollection({
|
|
5920
|
-
collection: INTEGRATION_SETTINGS,
|
|
5921
|
-
columns: INTEGRATION_SETTINGS_COLUMNS
|
|
5922
|
-
});
|
|
5923
|
-
}
|
|
5818
|
+
if (this.recordStores === void 0) await this.store.declareCollection({
|
|
5819
|
+
collection: INTEGRATIONS,
|
|
5820
|
+
columns: INTEGRATIONS_COLUMNS,
|
|
5821
|
+
indexes: INTEGRATIONS_INDEXES
|
|
5822
|
+
});
|
|
5924
5823
|
await this.resumeCounter();
|
|
5925
5824
|
}
|
|
5926
5825
|
async resumeCounter() {
|
|
@@ -5988,7 +5887,6 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
5988
5887
|
}
|
|
5989
5888
|
}
|
|
5990
5889
|
});
|
|
5991
|
-
if (input.settings) await this.setIntegrationSettings(id, input.settings);
|
|
5992
5890
|
return {
|
|
5993
5891
|
id,
|
|
5994
5892
|
addonId: input.addonId,
|
|
@@ -6092,97 +5990,17 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
6092
5990
|
async deleteIntegration(id) {
|
|
6093
5991
|
const integration = await this.getIntegration(id);
|
|
6094
5992
|
if (integration !== null && IntegrationRegistry.isFixed(integration)) throw new Error(`integration "${id}" is fixed — it belongs to the addon that declared it and cannot be deleted`);
|
|
6095
|
-
const settingsKind = this.recordStores?.settings;
|
|
6096
5993
|
const integrationsKind = this.recordStores?.integrations;
|
|
6097
|
-
if (
|
|
6098
|
-
for (const row of await (0, import_read_all_rows.readAllRows)(settingsKind)) if (row.data.integrationId === id) await settingsKind.delete(row.id);
|
|
5994
|
+
if (integrationsKind !== void 0) {
|
|
6099
5995
|
await integrationsKind.delete(id);
|
|
6100
5996
|
return true;
|
|
6101
5997
|
}
|
|
6102
|
-
await this.store.deleteWhere({
|
|
6103
|
-
collection: INTEGRATION_SETTINGS,
|
|
6104
|
-
filter: { where: { integration_id: id } }
|
|
6105
|
-
});
|
|
6106
5998
|
await this.store.deleteWhere({
|
|
6107
5999
|
collection: INTEGRATIONS,
|
|
6108
6000
|
filter: { where: { id } }
|
|
6109
6001
|
});
|
|
6110
6002
|
return true;
|
|
6111
6003
|
}
|
|
6112
|
-
async getIntegrationSettings(integrationId) {
|
|
6113
|
-
const result = {};
|
|
6114
|
-
const kind = this.recordStores?.settings;
|
|
6115
|
-
if (kind !== void 0) {
|
|
6116
|
-
for (const row of await (0, import_read_all_rows.readAllRows)(kind)) {
|
|
6117
|
-
if (row.data.integrationId !== integrationId) continue;
|
|
6118
|
-
result[row.data.key] = deserializeSetting(row.data.value, row.data.valueType);
|
|
6119
|
-
}
|
|
6120
|
-
return result;
|
|
6121
|
-
}
|
|
6122
|
-
const rows = await this.store.query({
|
|
6123
|
-
collection: INTEGRATION_SETTINGS,
|
|
6124
|
-
filter: { where: { integration_id: integrationId } }
|
|
6125
|
-
});
|
|
6126
|
-
for (const row of rows) result[String(row.data["key"])] = deserializeSetting(row.data["value"], String(row.data["value_type"]));
|
|
6127
|
-
return result;
|
|
6128
|
-
}
|
|
6129
|
-
/**
|
|
6130
|
-
* Delete every legacy setting row of an integration and answer the keychain refs the rows
|
|
6131
|
-
* carried, so the caller (the rows-to-record migration) releases them after the rows are gone.
|
|
6132
|
-
* The integration itself stays.
|
|
6133
|
-
*/
|
|
6134
|
-
async clearIntegrationSettings(integrationId) {
|
|
6135
|
-
const refs = collectSecretMarkerRefs(await this.getIntegrationSettings(integrationId));
|
|
6136
|
-
const kind = this.recordStores?.settings;
|
|
6137
|
-
if (kind !== void 0) {
|
|
6138
|
-
for (const row of await (0, import_read_all_rows.readAllRows)(kind)) if (row.data.integrationId === integrationId) await kind.delete(row.id);
|
|
6139
|
-
return refs;
|
|
6140
|
-
}
|
|
6141
|
-
await this.store.deleteWhere({
|
|
6142
|
-
collection: INTEGRATION_SETTINGS,
|
|
6143
|
-
filter: { where: { integration_id: integrationId } }
|
|
6144
|
-
});
|
|
6145
|
-
return refs;
|
|
6146
|
-
}
|
|
6147
|
-
async setIntegrationSetting(integrationId, key, value) {
|
|
6148
|
-
const s = serializeSetting(value);
|
|
6149
|
-
const rowId = `${integrationId}:${key}`;
|
|
6150
|
-
const kind = this.recordStores?.settings;
|
|
6151
|
-
if (kind !== void 0) {
|
|
6152
|
-
await kind.put({
|
|
6153
|
-
id: rowId,
|
|
6154
|
-
data: {
|
|
6155
|
-
integrationId,
|
|
6156
|
-
key,
|
|
6157
|
-
value: s.value,
|
|
6158
|
-
valueType: s.valueType
|
|
6159
|
-
}
|
|
6160
|
-
});
|
|
6161
|
-
return;
|
|
6162
|
-
}
|
|
6163
|
-
await this.store.deleteWhere({
|
|
6164
|
-
collection: INTEGRATION_SETTINGS,
|
|
6165
|
-
filter: { where: {
|
|
6166
|
-
integration_id: integrationId,
|
|
6167
|
-
key
|
|
6168
|
-
} }
|
|
6169
|
-
});
|
|
6170
|
-
await this.store.insert({
|
|
6171
|
-
collection: INTEGRATION_SETTINGS,
|
|
6172
|
-
record: {
|
|
6173
|
-
id: rowId,
|
|
6174
|
-
data: {
|
|
6175
|
-
integration_id: integrationId,
|
|
6176
|
-
key,
|
|
6177
|
-
value: s.value,
|
|
6178
|
-
value_type: s.valueType
|
|
6179
|
-
}
|
|
6180
|
-
}
|
|
6181
|
-
});
|
|
6182
|
-
}
|
|
6183
|
-
async setIntegrationSettings(integrationId, settings) {
|
|
6184
|
-
for (const [key, value] of Object.entries(settings)) await this.setIntegrationSetting(integrationId, key, value);
|
|
6185
|
-
}
|
|
6186
6004
|
mapIntegration(row) {
|
|
6187
6005
|
return {
|
|
6188
6006
|
id: String(row["id"]),
|
|
@@ -6199,25 +6017,19 @@ var IntegrationRegistry = class IntegrationRegistry {
|
|
|
6199
6017
|
//#endregion
|
|
6200
6018
|
//#region src/builtins/sqlite-storage/integration-rows-ports.ts
|
|
6201
6019
|
/**
|
|
6202
|
-
* The system-side ports of `moveIntegrationRowsToRecords` (planning#416)
|
|
6203
|
-
*
|
|
6204
|
-
* integration's OWNER keychain
|
|
6205
|
-
*
|
|
6020
|
+
* The system-side ports of `moveIntegrationRowsToRecords` (planning#416). The leftover rows are
|
|
6021
|
+
* read on the settings connection by the migration-only door, and their secrets are resolved
|
|
6022
|
+
* through the integration's OWNER keychain handle (never exposed further) and cleared together
|
|
6023
|
+
* with the rows. The addon's own record kind is reached through its records handle.
|
|
6206
6024
|
*/
|
|
6207
6025
|
/**
|
|
6208
|
-
*
|
|
6209
|
-
*
|
|
6210
|
-
* no-op. Counts only; never a value.
|
|
6026
|
+
* Delete one integration's leftover rows AND the keychain values they pointed at (values first,
|
|
6027
|
+
* so a failed delete leaves the rows to retry). A missing store is a no-op. Counts only.
|
|
6211
6028
|
*/
|
|
6212
|
-
async function clearIntegrationRows(
|
|
6213
|
-
const
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
await deps.registry.clearIntegrationSettings(integrationId);
|
|
6217
|
-
return {
|
|
6218
|
-
rows: Object.keys(stored).length,
|
|
6219
|
-
secrets: refs.length
|
|
6220
|
-
};
|
|
6029
|
+
async function clearIntegrationRows(db, secrets, integrationId) {
|
|
6030
|
+
const refs = collectSecretMarkerRefs(readLegacyIntegrationRows(db, integrationId));
|
|
6031
|
+
if (refs.length > 0 && secrets !== null) await secrets.delete(refs);
|
|
6032
|
+
return clearLegacyIntegrationRows(db, integrationId);
|
|
6221
6033
|
}
|
|
6222
6034
|
//#endregion
|
|
6223
6035
|
//#region src/builtins/cluster-agent/record-kinds.ts
|
|
@@ -6328,7 +6140,7 @@ var TRADITIONAL_NATIVE_PACKAGES = ["better-sqlite3"];
|
|
|
6328
6140
|
function hasDotNode(dir, maxDepth) {
|
|
6329
6141
|
let entries;
|
|
6330
6142
|
try {
|
|
6331
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
6143
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
6332
6144
|
} catch {
|
|
6333
6145
|
return false;
|
|
6334
6146
|
}
|
|
@@ -6339,7 +6151,7 @@ function hasDotNode(dir, maxDepth) {
|
|
|
6339
6151
|
}
|
|
6340
6152
|
/** Locate the bundled `prebuild-install` bin.js inside the staged closure. */
|
|
6341
6153
|
function resolvePrebuildInstallBin(closureDir, moduleDir) {
|
|
6342
|
-
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;
|
|
6154
|
+
return [path$1.join(moduleDir, "node_modules", "prebuild-install", "bin.js"), path$1.join(closureDir, "node_modules", "prebuild-install", "bin.js")].find((c) => fs$1.existsSync(c)) ?? null;
|
|
6343
6155
|
}
|
|
6344
6156
|
/**
|
|
6345
6157
|
* Default fetcher: run the closure's own `prebuild-install` under the CURRENT
|
|
@@ -6392,7 +6204,7 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6392
6204
|
const fetched = [];
|
|
6393
6205
|
for (const pkg of packages) {
|
|
6394
6206
|
const moduleDir = path$1.join(nm, pkg);
|
|
6395
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
6207
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
6396
6208
|
if (hasDotNode(moduleDir, 4)) continue;
|
|
6397
6209
|
options.logger.warn("staged closure native prebuild missing — fetching for running ABI", { meta: {
|
|
6398
6210
|
pkg,
|
|
@@ -6455,12 +6267,12 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
6455
6267
|
function replantFromBundled(srcModuleDir, dstModuleDir, hasNative) {
|
|
6456
6268
|
if (!hasNative(srcModuleDir)) return false;
|
|
6457
6269
|
try {
|
|
6458
|
-
fs.rmSync(dstModuleDir, {
|
|
6270
|
+
fs$1.rmSync(dstModuleDir, {
|
|
6459
6271
|
recursive: true,
|
|
6460
6272
|
force: true
|
|
6461
6273
|
});
|
|
6462
|
-
fs.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6463
|
-
fs.cpSync(srcModuleDir, dstModuleDir, {
|
|
6274
|
+
fs$1.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6275
|
+
fs$1.cpSync(srcModuleDir, dstModuleDir, {
|
|
6464
6276
|
recursive: true,
|
|
6465
6277
|
dereference: true
|
|
6466
6278
|
});
|
|
@@ -6489,7 +6301,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
|
|
|
6489
6301
|
const missing = [];
|
|
6490
6302
|
for (const pkg of packages) {
|
|
6491
6303
|
const moduleDir = path$1.join(nm, pkg);
|
|
6492
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
6304
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
6493
6305
|
if (hasNative(moduleDir)) {
|
|
6494
6306
|
results.push({
|
|
6495
6307
|
pkg,
|
|
@@ -6588,7 +6400,7 @@ async function defaultDownloadTarball(url, destTgz) {
|
|
|
6588
6400
|
const res = await fetch(url);
|
|
6589
6401
|
if (!res.ok || !res.body) throw new Error(`HTTP ${res.status} downloading ${url}`);
|
|
6590
6402
|
const bytes = Buffer.from(await res.arrayBuffer());
|
|
6591
|
-
await fs.promises.writeFile(destTgz, bytes);
|
|
6403
|
+
await fs$1.promises.writeFile(destTgz, bytes);
|
|
6592
6404
|
}
|
|
6593
6405
|
async function defaultExtractTarball(tgzPath, destDir) {
|
|
6594
6406
|
await execFileAsync$5("tar", [
|
|
@@ -6674,7 +6486,7 @@ async function resolveUncached(options) {
|
|
|
6674
6486
|
argsPrefix: []
|
|
6675
6487
|
};
|
|
6676
6488
|
const cliPath = bootstrappedCliPath(options.cacheDir);
|
|
6677
|
-
if (fs.existsSync(cliPath)) {
|
|
6489
|
+
if (fs$1.existsSync(cliPath)) {
|
|
6678
6490
|
options.logger.info("system npm unavailable — using bootstrapped npm", { meta: { cliPath } });
|
|
6679
6491
|
return {
|
|
6680
6492
|
command: process.execPath,
|
|
@@ -6686,12 +6498,12 @@ async function resolveUncached(options) {
|
|
|
6686
6498
|
const registry = (options.registry ?? DEFAULT_REGISTRY).replace(/\/+$/, "");
|
|
6687
6499
|
const tarballUrl = tarballUrlOf(await (options.fetchJson ?? defaultFetchJson)(`${registry}/npm/latest`));
|
|
6688
6500
|
if (!tarballUrl) throw new Error(`registry metadata for 'npm' carries no dist.tarball (${registry})`);
|
|
6689
|
-
await fs.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6501
|
+
await fs$1.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6690
6502
|
const tgzPath = path$1.join(options.cacheDir, "npm-bootstrap.tgz");
|
|
6691
6503
|
await (options.downloadTarball ?? defaultDownloadTarball)(tarballUrl, tgzPath);
|
|
6692
6504
|
await (options.extractTarball ?? defaultExtractTarball)(tgzPath, options.cacheDir);
|
|
6693
|
-
await fs.promises.rm(tgzPath, { force: true });
|
|
6694
|
-
if (!fs.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6505
|
+
await fs$1.promises.rm(tgzPath, { force: true });
|
|
6506
|
+
if (!fs$1.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6695
6507
|
options.logger.info("npm bootstrapped", { meta: { cliPath } });
|
|
6696
6508
|
return {
|
|
6697
6509
|
command: process.execPath,
|
|
@@ -6757,7 +6569,7 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6757
6569
|
let dir = path$1.dirname(entryPath);
|
|
6758
6570
|
for (let hop = 0; hop < PACKAGE_JSON_LOOKUP_DEPTH; hop++) {
|
|
6759
6571
|
try {
|
|
6760
|
-
const version = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6572
|
+
const version = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6761
6573
|
if (typeof version === "string" && version.length > 0) return version;
|
|
6762
6574
|
} catch {}
|
|
6763
6575
|
const parent = path$1.dirname(dir);
|
|
@@ -6801,14 +6613,14 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6801
6613
|
function addonModuleCacheKey(entryPath) {
|
|
6802
6614
|
let stat;
|
|
6803
6615
|
try {
|
|
6804
|
-
stat = fs.statSync(entryPath);
|
|
6616
|
+
stat = fs$1.statSync(entryPath);
|
|
6805
6617
|
} catch {
|
|
6806
6618
|
return null;
|
|
6807
6619
|
}
|
|
6808
6620
|
const version = readOwningPackageVersion(entryPath) ?? `m${stat.mtimeMs}`;
|
|
6809
6621
|
let content;
|
|
6810
6622
|
try {
|
|
6811
|
-
content = createHash("sha1").update(fs.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6623
|
+
content = createHash("sha1").update(fs$1.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6812
6624
|
} catch {
|
|
6813
6625
|
content = `m${stat.mtimeMs}s${stat.size}`;
|
|
6814
6626
|
}
|
|
@@ -6912,14 +6724,14 @@ var AddonLoader = class {
|
|
|
6912
6724
|
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
6913
6725
|
* the addons-dir `@camstack/server/system` must NOT be double-loaded here. */
|
|
6914
6726
|
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
6915
|
-
if (!fs.existsSync(addonsDir)) return;
|
|
6727
|
+
if (!fs$1.existsSync(addonsDir)) return;
|
|
6916
6728
|
const skip = new Set(skipPackages);
|
|
6917
|
-
const entries = fs.readdirSync(addonsDir, { withFileTypes: true });
|
|
6729
|
+
const entries = fs$1.readdirSync(addonsDir, { withFileTypes: true });
|
|
6918
6730
|
for (const entry of entries) {
|
|
6919
6731
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
6920
6732
|
if (entry.name.startsWith("@")) {
|
|
6921
6733
|
const scopeDir = path$1.join(addonsDir, entry.name);
|
|
6922
|
-
const scopeEntries = fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
6734
|
+
const scopeEntries = fs$1.readdirSync(scopeDir, { withFileTypes: true });
|
|
6923
6735
|
for (const scopeEntry of scopeEntries) {
|
|
6924
6736
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
6925
6737
|
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
@@ -6933,7 +6745,7 @@ var AddonLoader = class {
|
|
|
6933
6745
|
}
|
|
6934
6746
|
async tryLoadAddon(addonDir) {
|
|
6935
6747
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6936
|
-
if (!fs.existsSync(pkgJsonPath)) return;
|
|
6748
|
+
if (!fs$1.existsSync(pkgJsonPath)) return;
|
|
6937
6749
|
try {
|
|
6938
6750
|
await this.loadFromAddonDir(addonDir);
|
|
6939
6751
|
} catch (err) {
|
|
@@ -6951,7 +6763,7 @@ var AddonLoader = class {
|
|
|
6951
6763
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
6952
6764
|
async loadFromAddonDir(addonDir) {
|
|
6953
6765
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6954
|
-
const pkgJson = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6766
|
+
const pkgJson = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6955
6767
|
const packageNameRaw = pkgJson["name"];
|
|
6956
6768
|
const packageName = typeof packageNameRaw === "string" ? packageNameRaw : "";
|
|
6957
6769
|
const packageVersionRaw = pkgJson["version"];
|
|
@@ -6999,7 +6811,7 @@ var AddonLoader = class {
|
|
|
6999
6811
|
}
|
|
7000
6812
|
const entryFile = declaration.entry.replace(/^\.\//, "").replace(/^src\//, "dist/").replace(/\.ts$/, ".js");
|
|
7001
6813
|
let entryPath = path$1.resolve(addonDir, entryFile);
|
|
7002
|
-
if (!fs.existsSync(entryPath)) {
|
|
6814
|
+
if (!fs$1.existsSync(entryPath)) {
|
|
7003
6815
|
const base = entryPath.replace(/\.(js|cjs|mjs)$/, "");
|
|
7004
6816
|
entryPath = [
|
|
7005
6817
|
`${base}.cjs`,
|
|
@@ -7008,9 +6820,9 @@ var AddonLoader = class {
|
|
|
7008
6820
|
path$1.resolve(addonDir, "dist", "index.cjs"),
|
|
7009
6821
|
path$1.resolve(addonDir, "dist", "index.mjs"),
|
|
7010
6822
|
path$1.resolve(addonDir, declaration.entry)
|
|
7011
|
-
].find((p) => fs.existsSync(p)) ?? entryPath;
|
|
6823
|
+
].find((p) => fs$1.existsSync(p)) ?? entryPath;
|
|
7012
6824
|
}
|
|
7013
|
-
if (!fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6825
|
+
if (!fs$1.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
7014
6826
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
7015
6827
|
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
7016
6828
|
const AddonClass = resolveAddonClass(mod);
|
|
@@ -7122,7 +6934,7 @@ function isDirectoryEntry(entry, parentDir) {
|
|
|
7122
6934
|
if (entry.name.startsWith(".")) return false;
|
|
7123
6935
|
if (entry.isDirectory()) return true;
|
|
7124
6936
|
if (entry.isSymbolicLink()) try {
|
|
7125
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
6937
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
7126
6938
|
} catch {
|
|
7127
6939
|
return false;
|
|
7128
6940
|
}
|
|
@@ -7216,7 +7028,7 @@ var execFileAsync$4 = promisify(execFile);
|
|
|
7216
7028
|
* Single source of truth — replaces scattered mkdirSync calls.
|
|
7217
7029
|
*/
|
|
7218
7030
|
function ensureDir(dirPath) {
|
|
7219
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
7031
|
+
fs$1.mkdirSync(dirPath, { recursive: true });
|
|
7220
7032
|
}
|
|
7221
7033
|
/**
|
|
7222
7034
|
* Copy a directory recursively — ASYNC so it never blocks the event loop.
|
|
@@ -7229,7 +7041,7 @@ function ensureDir(dirPath) {
|
|
|
7229
7041
|
* `fs.promises.cp` keeps the I/O off the event loop. (Node ≥18 stable.)
|
|
7230
7042
|
*/
|
|
7231
7043
|
async function copyDirRecursive(src, dest) {
|
|
7232
|
-
await fs.promises.cp(src, dest, {
|
|
7044
|
+
await fs$1.promises.cp(src, dest, {
|
|
7233
7045
|
recursive: true,
|
|
7234
7046
|
force: true
|
|
7235
7047
|
});
|
|
@@ -7334,13 +7146,13 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7334
7146
|
if (typeof fileEntry !== "string") continue;
|
|
7335
7147
|
if (fileEntry === "dist" || fileEntry.includes("*")) continue;
|
|
7336
7148
|
const srcPath = path$1.join(sourceDir, fileEntry);
|
|
7337
|
-
if (!fs.existsSync(srcPath)) continue;
|
|
7149
|
+
if (!fs$1.existsSync(srcPath)) continue;
|
|
7338
7150
|
const destPath = path$1.join(destDir, fileEntry);
|
|
7339
|
-
const stat = await fs.promises.stat(srcPath);
|
|
7151
|
+
const stat = await fs$1.promises.stat(srcPath);
|
|
7340
7152
|
if (stat.isDirectory()) await copyDirRecursive(srcPath, destPath);
|
|
7341
7153
|
else if (stat.isFile()) {
|
|
7342
7154
|
ensureDir(path$1.dirname(destPath));
|
|
7343
|
-
await fs.promises.copyFile(srcPath, destPath);
|
|
7155
|
+
await fs$1.promises.copyFile(srcPath, destPath);
|
|
7344
7156
|
}
|
|
7345
7157
|
}
|
|
7346
7158
|
}
|
|
@@ -7351,10 +7163,10 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
7351
7163
|
function isSourceNewer(packageDir) {
|
|
7352
7164
|
const srcDir = path$1.join(packageDir, "src");
|
|
7353
7165
|
const distDir = path$1.join(packageDir, "dist");
|
|
7354
|
-
if (!fs.existsSync(srcDir) || !fs.existsSync(distDir)) return true;
|
|
7166
|
+
if (!fs$1.existsSync(srcDir) || !fs$1.existsSync(distDir)) return true;
|
|
7355
7167
|
try {
|
|
7356
|
-
const distMtime = fs.statSync(distDir).mtimeMs;
|
|
7357
|
-
const entries = fs.readdirSync(srcDir, {
|
|
7168
|
+
const distMtime = fs$1.statSync(distDir).mtimeMs;
|
|
7169
|
+
const entries = fs$1.readdirSync(srcDir, {
|
|
7358
7170
|
withFileTypes: true,
|
|
7359
7171
|
recursive: true
|
|
7360
7172
|
});
|
|
@@ -7362,7 +7174,7 @@ function isSourceNewer(packageDir) {
|
|
|
7362
7174
|
if (!entry.isFile()) continue;
|
|
7363
7175
|
const parentDir = entry.parentPath ?? String(Reflect.get(entry, "path") ?? "");
|
|
7364
7176
|
const filePath = path$1.join(parentDir, entry.name);
|
|
7365
|
-
if (fs.statSync(filePath).mtimeMs > distMtime) return true;
|
|
7177
|
+
if (fs$1.statSync(filePath).mtimeMs > distMtime) return true;
|
|
7366
7178
|
}
|
|
7367
7179
|
return false;
|
|
7368
7180
|
} catch {
|
|
@@ -7379,7 +7191,7 @@ function isSourceNewer(packageDir) {
|
|
|
7379
7191
|
* `copyDirRecursive` for the wedge this prevents.
|
|
7380
7192
|
*/
|
|
7381
7193
|
async function installPackageFromNpm(packageName, targetDir) {
|
|
7382
|
-
const tmpDir = await fs.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
7194
|
+
const tmpDir = await fs$1.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
7383
7195
|
try {
|
|
7384
7196
|
const { stdout } = await execFileAsync$4("npm", [
|
|
7385
7197
|
"pack",
|
|
@@ -7402,21 +7214,21 @@ async function installPackageFromNpm(packageName, targetDir) {
|
|
|
7402
7214
|
extractDir
|
|
7403
7215
|
], { timeout: 3e4 });
|
|
7404
7216
|
const packageSubDir = path$1.join(extractDir, "package");
|
|
7405
|
-
const srcPkgJsonDir = fs.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
7406
|
-
await fs.promises.rm(targetDir, {
|
|
7217
|
+
const srcPkgJsonDir = fs$1.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
7218
|
+
await fs$1.promises.rm(targetDir, {
|
|
7407
7219
|
recursive: true,
|
|
7408
7220
|
force: true
|
|
7409
7221
|
});
|
|
7410
7222
|
ensureDir(targetDir);
|
|
7411
|
-
await fs.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
7223
|
+
await fs$1.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
7412
7224
|
const distSrc = path$1.join(srcPkgJsonDir, "dist");
|
|
7413
|
-
if (fs.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
7225
|
+
if (fs$1.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
7414
7226
|
try {
|
|
7415
|
-
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7227
|
+
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs$1.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
7416
7228
|
if (npmPkg) await copyExtraFileDirs(npmPkg, srcPkgJsonDir, targetDir);
|
|
7417
7229
|
} catch {}
|
|
7418
7230
|
} finally {
|
|
7419
|
-
await fs.promises.rm(tmpDir, {
|
|
7231
|
+
await fs$1.promises.rm(tmpDir, {
|
|
7420
7232
|
recursive: true,
|
|
7421
7233
|
force: true
|
|
7422
7234
|
});
|
|
@@ -7441,7 +7253,7 @@ function packageDirName$1(declaredName) {
|
|
|
7441
7253
|
}
|
|
7442
7254
|
function isDirLike$1(p) {
|
|
7443
7255
|
try {
|
|
7444
|
-
return fs.statSync(p).isDirectory();
|
|
7256
|
+
return fs$1.statSync(p).isDirectory();
|
|
7445
7257
|
} catch {
|
|
7446
7258
|
return false;
|
|
7447
7259
|
}
|
|
@@ -7459,12 +7271,12 @@ var AddonManifest = class {
|
|
|
7459
7271
|
*/
|
|
7460
7272
|
read() {
|
|
7461
7273
|
if (this.cache != null) return this.cache;
|
|
7462
|
-
if (!fs.existsSync(this.manifestPath)) {
|
|
7274
|
+
if (!fs$1.existsSync(this.manifestPath)) {
|
|
7463
7275
|
this.cache = this.empty();
|
|
7464
7276
|
return this.cache;
|
|
7465
7277
|
}
|
|
7466
7278
|
try {
|
|
7467
|
-
const raw = fs.readFileSync(this.manifestPath, "utf-8");
|
|
7279
|
+
const raw = fs$1.readFileSync(this.manifestPath, "utf-8");
|
|
7468
7280
|
const parsed = JSON.parse(raw);
|
|
7469
7281
|
if (parsed.version !== MANIFEST_VERSION) {
|
|
7470
7282
|
process.stderr.write(`[AddonManifest] schema mismatch (file=${parsed.version} vs runtime=${MANIFEST_VERSION}); starting empty\n`);
|
|
@@ -7485,13 +7297,13 @@ var AddonManifest = class {
|
|
|
7485
7297
|
* a half-written file.
|
|
7486
7298
|
*/
|
|
7487
7299
|
write(manifest) {
|
|
7488
|
-
fs.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7300
|
+
fs$1.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7489
7301
|
const tmp = `${this.manifestPath}.tmp.${process.pid}.${Date.now()}`;
|
|
7490
|
-
fs.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7302
|
+
fs$1.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7491
7303
|
encoding: "utf-8",
|
|
7492
7304
|
mode: 384
|
|
7493
7305
|
});
|
|
7494
|
-
fs.renameSync(tmp, this.manifestPath);
|
|
7306
|
+
fs$1.renameSync(tmp, this.manifestPath);
|
|
7495
7307
|
this.cache = manifest;
|
|
7496
7308
|
}
|
|
7497
7309
|
/** Lookup a single addon's manifest entry, or `null` if not tracked. */
|
|
@@ -7566,22 +7378,22 @@ var AddonManifest = class {
|
|
|
7566
7378
|
* exactly what moved. Returns the total number of changes.
|
|
7567
7379
|
*/
|
|
7568
7380
|
reconcileFromDisk(addonsDir, onChange) {
|
|
7569
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7381
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7570
7382
|
const m = this.read();
|
|
7571
7383
|
let changes = 0;
|
|
7572
7384
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7573
7385
|
/** Package name → version, for every ADDON package actually installed. */
|
|
7574
7386
|
const onDisk = /* @__PURE__ */ new Map();
|
|
7575
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7387
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7576
7388
|
if (!scope.name.startsWith("@") || !isDirLike$1(path$1.join(addonsDir, scope.name))) continue;
|
|
7577
7389
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7578
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7390
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7579
7391
|
if (!isDirLike$1(path$1.join(scopeDir, pkg.name))) continue;
|
|
7580
7392
|
const pkgJsonPath = path$1.join(scopeDir, pkg.name, "package.json");
|
|
7581
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7393
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7582
7394
|
let pkgJson;
|
|
7583
7395
|
try {
|
|
7584
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7396
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7585
7397
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7586
7398
|
pkgJson = parsed;
|
|
7587
7399
|
} catch {
|
|
@@ -7652,28 +7464,28 @@ var AddonManifest = class {
|
|
|
7652
7464
|
migrateFromInstallSourceMarkers(addonsDir) {
|
|
7653
7465
|
const m = this.read();
|
|
7654
7466
|
if (Object.keys(m.addons).length > 0) return 0;
|
|
7655
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7467
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7656
7468
|
let migrated = 0;
|
|
7657
7469
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7658
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7470
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7659
7471
|
if (!scope.isDirectory() || !scope.name.startsWith("@")) continue;
|
|
7660
7472
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7661
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7473
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7662
7474
|
if (!pkg.isDirectory()) continue;
|
|
7663
7475
|
const pkgDir = path$1.join(scopeDir, pkg.name);
|
|
7664
7476
|
const markerPath = path$1.join(pkgDir, ".install-source");
|
|
7665
7477
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
7666
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7478
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7667
7479
|
let pkgJson;
|
|
7668
7480
|
try {
|
|
7669
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7481
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7670
7482
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7671
7483
|
pkgJson = parsed;
|
|
7672
7484
|
} catch {
|
|
7673
7485
|
continue;
|
|
7674
7486
|
}
|
|
7675
7487
|
if (!pkgJson.name || !pkgJson.version) continue;
|
|
7676
|
-
const source = fs.existsSync(markerPath) ? fs.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7488
|
+
const source = fs$1.existsSync(markerPath) ? fs$1.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7677
7489
|
m.addons[pkgJson.name] = {
|
|
7678
7490
|
name: pkgJson.name,
|
|
7679
7491
|
version: pkgJson.version,
|
|
@@ -7877,7 +7689,7 @@ function planClosureDedupe(input) {
|
|
|
7877
7689
|
function readTreeManifest(pkgJsonPath) {
|
|
7878
7690
|
let raw;
|
|
7879
7691
|
try {
|
|
7880
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
7692
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
7881
7693
|
} catch {
|
|
7882
7694
|
return null;
|
|
7883
7695
|
}
|
|
@@ -7902,7 +7714,7 @@ function readTreeManifest(pkgJsonPath) {
|
|
|
7902
7714
|
function listTopLevelEntries(nodeModulesDir) {
|
|
7903
7715
|
let entries;
|
|
7904
7716
|
try {
|
|
7905
|
-
entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7717
|
+
entries = fs$1.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7906
7718
|
} catch {
|
|
7907
7719
|
return [];
|
|
7908
7720
|
}
|
|
@@ -7912,7 +7724,7 @@ function listTopLevelEntries(nodeModulesDir) {
|
|
|
7912
7724
|
if (entry.name.startsWith("@")) {
|
|
7913
7725
|
let inner;
|
|
7914
7726
|
try {
|
|
7915
|
-
inner = fs.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7727
|
+
inner = fs$1.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7916
7728
|
} catch {
|
|
7917
7729
|
continue;
|
|
7918
7730
|
}
|
|
@@ -7945,14 +7757,14 @@ function collectAddonTreeState(addonDir) {
|
|
|
7945
7757
|
const entryDir = path$1.join(nodeModulesDir, name);
|
|
7946
7758
|
let isLink = false;
|
|
7947
7759
|
try {
|
|
7948
|
-
isLink = fs.lstatSync(entryDir).isSymbolicLink();
|
|
7760
|
+
isLink = fs$1.lstatSync(entryDir).isSymbolicLink();
|
|
7949
7761
|
} catch {
|
|
7950
7762
|
continue;
|
|
7951
7763
|
}
|
|
7952
7764
|
if (isLink) {
|
|
7953
7765
|
let target = "";
|
|
7954
7766
|
try {
|
|
7955
|
-
target = fs.readlinkSync(entryDir);
|
|
7767
|
+
target = fs$1.readlinkSync(entryDir);
|
|
7956
7768
|
} catch {}
|
|
7957
7769
|
existingLinks.push({
|
|
7958
7770
|
name,
|
|
@@ -7966,7 +7778,7 @@ function collectAddonTreeState(addonDir) {
|
|
|
7966
7778
|
version: manifest.version
|
|
7967
7779
|
});
|
|
7968
7780
|
for (const [depName, range] of manifest.ranges) {
|
|
7969
|
-
if (fs.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7781
|
+
if (fs$1.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7970
7782
|
addRange(depName, range);
|
|
7971
7783
|
}
|
|
7972
7784
|
}
|
|
@@ -7996,7 +7808,7 @@ function resolveClosureNodeModulesDir(explicitDir) {
|
|
|
7996
7808
|
const frameworkDir = explicitDir ?? process.env["CAMSTACK_FRAMEWORK_DIR"];
|
|
7997
7809
|
if (frameworkDir === void 0 || frameworkDir.length === 0) return null;
|
|
7998
7810
|
const nodeModulesDir = explicitDir ?? path$1.join(frameworkDir, "node_modules");
|
|
7999
|
-
return fs.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7811
|
+
return fs$1.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
8000
7812
|
}
|
|
8001
7813
|
function symlinkType() {
|
|
8002
7814
|
return process.platform === "win32" ? "junction" : "dir";
|
|
@@ -8015,10 +7827,10 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
8015
7827
|
const nodeModulesDir = path$1.join(addonDir, "node_modules");
|
|
8016
7828
|
const probePath = path$1.join(nodeModulesDir, ".closure-link-probe");
|
|
8017
7829
|
try {
|
|
8018
|
-
fs.mkdirSync(nodeModulesDir, { recursive: true });
|
|
8019
|
-
fs.rmSync(probePath, { force: true });
|
|
8020
|
-
fs.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
8021
|
-
fs.rmSync(probePath, { force: true });
|
|
7830
|
+
fs$1.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7831
|
+
fs$1.rmSync(probePath, { force: true });
|
|
7832
|
+
fs$1.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7833
|
+
fs$1.rmSync(probePath, { force: true });
|
|
8022
7834
|
} catch (err) {
|
|
8023
7835
|
logger.warn("closure dedupe skipped — symlinks unavailable on this volume", { meta: {
|
|
8024
7836
|
addonDir,
|
|
@@ -8040,12 +7852,12 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
8040
7852
|
}
|
|
8041
7853
|
const entryDir = path$1.join(nodeModulesDir, link.name);
|
|
8042
7854
|
try {
|
|
8043
|
-
fs.rmSync(entryDir, {
|
|
7855
|
+
fs$1.rmSync(entryDir, {
|
|
8044
7856
|
recursive: true,
|
|
8045
7857
|
force: true
|
|
8046
7858
|
});
|
|
8047
|
-
fs.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
8048
|
-
fs.symlinkSync(target, entryDir, symlinkType());
|
|
7859
|
+
fs$1.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7860
|
+
fs$1.symlinkSync(target, entryDir, symlinkType());
|
|
8049
7861
|
linked.push(link.name);
|
|
8050
7862
|
} catch (err) {
|
|
8051
7863
|
logger.warn("closure dedupe — link failed; entry removed copy may need reinstall", { meta: {
|
|
@@ -8121,7 +7933,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
8121
7933
|
count: Object.keys(native).length
|
|
8122
7934
|
} });
|
|
8123
7935
|
try {
|
|
8124
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7936
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
8125
7937
|
} catch (err) {
|
|
8126
7938
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
8127
7939
|
markerFile,
|
|
@@ -8159,7 +7971,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
8159
7971
|
}
|
|
8160
7972
|
await rebuildNativeDeps(addonDir, pending.map(([name]) => name), logger, npmCacheDir ?? defaultNpmCacheDir(), registry);
|
|
8161
7973
|
try {
|
|
8162
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7974
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
8163
7975
|
} catch (err) {
|
|
8164
7976
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
8165
7977
|
markerFile,
|
|
@@ -8181,12 +7993,12 @@ function copyPrebuiltNativeDep(name, addonDir, logger) {
|
|
|
8181
7993
|
if (source === target) continue;
|
|
8182
7994
|
if (!hasBuiltBinary(source)) continue;
|
|
8183
7995
|
try {
|
|
8184
|
-
fs.rmSync(target, {
|
|
7996
|
+
fs$1.rmSync(target, {
|
|
8185
7997
|
recursive: true,
|
|
8186
7998
|
force: true
|
|
8187
7999
|
});
|
|
8188
|
-
fs.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
8189
|
-
fs.cpSync(source, target, {
|
|
8000
|
+
fs$1.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
8001
|
+
fs$1.cpSync(source, target, {
|
|
8190
8002
|
recursive: true,
|
|
8191
8003
|
dereference: true
|
|
8192
8004
|
});
|
|
@@ -8222,7 +8034,7 @@ var BUNDLED_NATIVE_SIBLING_SCOPES = {
|
|
|
8222
8034
|
function hasAnyDotNode(dir, maxDepth) {
|
|
8223
8035
|
let entries;
|
|
8224
8036
|
try {
|
|
8225
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
8037
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
8226
8038
|
} catch {
|
|
8227
8039
|
return false;
|
|
8228
8040
|
}
|
|
@@ -8236,12 +8048,12 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8236
8048
|
if (!hasAnyDotNode(src, 5)) return;
|
|
8237
8049
|
if (hasAnyDotNode(dst, 5)) return;
|
|
8238
8050
|
try {
|
|
8239
|
-
fs.rmSync(dst, {
|
|
8051
|
+
fs$1.rmSync(dst, {
|
|
8240
8052
|
recursive: true,
|
|
8241
8053
|
force: true
|
|
8242
8054
|
});
|
|
8243
|
-
fs.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
8244
|
-
fs.cpSync(src, dst, {
|
|
8055
|
+
fs$1.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
8056
|
+
fs$1.cpSync(src, dst, {
|
|
8245
8057
|
recursive: true,
|
|
8246
8058
|
dereference: true
|
|
8247
8059
|
});
|
|
@@ -8276,7 +8088,7 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
8276
8088
|
*/
|
|
8277
8089
|
function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
8278
8090
|
const srcNm = path$1.join(sourceDir, "node_modules");
|
|
8279
|
-
if (!fs.existsSync(srcNm)) return;
|
|
8091
|
+
if (!fs$1.existsSync(srcNm)) return;
|
|
8280
8092
|
const dstNm = path$1.join(targetDir, "node_modules");
|
|
8281
8093
|
for (const [name, scopes] of Object.entries(BUNDLED_NATIVE_SIBLING_SCOPES)) {
|
|
8282
8094
|
copyPrebuiltModuleDir(path$1.join(srcNm, name), path$1.join(dstNm, name), name, logger);
|
|
@@ -8284,7 +8096,7 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8284
8096
|
const scopeSrc = path$1.join(srcNm, scope);
|
|
8285
8097
|
let siblings;
|
|
8286
8098
|
try {
|
|
8287
|
-
siblings = fs.readdirSync(scopeSrc);
|
|
8099
|
+
siblings = fs$1.readdirSync(scopeSrc);
|
|
8288
8100
|
} catch {
|
|
8289
8101
|
continue;
|
|
8290
8102
|
}
|
|
@@ -8294,12 +8106,12 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
8294
8106
|
}
|
|
8295
8107
|
/** A package dir is "built" when it carries a compiled `.node` or a prebuilds tree. */
|
|
8296
8108
|
function hasBuiltBinary(pkgDir) {
|
|
8297
|
-
if (!fs.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
8109
|
+
if (!fs$1.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
8298
8110
|
const releaseDir = path$1.join(pkgDir, "build", "Release");
|
|
8299
8111
|
try {
|
|
8300
|
-
if (fs.existsSync(releaseDir) && fs.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
8112
|
+
if (fs$1.existsSync(releaseDir) && fs$1.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
8301
8113
|
} catch {}
|
|
8302
|
-
return fs.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
8114
|
+
return fs$1.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
8303
8115
|
}
|
|
8304
8116
|
/** Candidate hoisted locations for `<name>`: NODE_PATH entries + ancestors of `addonDir`. */
|
|
8305
8117
|
function candidateHoistedDirs(name, addonDir) {
|
|
@@ -8337,7 +8149,7 @@ function hashDeclaration(deps) {
|
|
|
8337
8149
|
}
|
|
8338
8150
|
function markerMatches(markerFile, expected) {
|
|
8339
8151
|
try {
|
|
8340
|
-
return fs.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
8152
|
+
return fs$1.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
8341
8153
|
} catch {
|
|
8342
8154
|
return false;
|
|
8343
8155
|
}
|
|
@@ -8444,7 +8256,7 @@ function parseInstallSource(value) {
|
|
|
8444
8256
|
function readPackageJson(pkgJsonPath) {
|
|
8445
8257
|
let raw;
|
|
8446
8258
|
try {
|
|
8447
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
8259
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
8448
8260
|
} catch {
|
|
8449
8261
|
return null;
|
|
8450
8262
|
}
|
|
@@ -8486,7 +8298,7 @@ function shouldSkipClosureProvidedSeed(packageName, isResolvable) {
|
|
|
8486
8298
|
var REGISTRY_LATEST_TIMEOUT_MS = 15e3;
|
|
8487
8299
|
function readInstalledPackageVersion(addonDir) {
|
|
8488
8300
|
try {
|
|
8489
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(addonDir, "package.json"), "utf-8"));
|
|
8301
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(addonDir, "package.json"), "utf-8"));
|
|
8490
8302
|
if (raw === null || typeof raw !== "object") return null;
|
|
8491
8303
|
const version = Reflect.get(raw, "version");
|
|
8492
8304
|
return typeof version === "string" && version.length > 0 ? version : null;
|
|
@@ -8627,7 +8439,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8627
8439
|
} catch {
|
|
8628
8440
|
return Object.freeze([]);
|
|
8629
8441
|
}
|
|
8630
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8442
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8631
8443
|
const parsed = JSON.parse(raw);
|
|
8632
8444
|
const deps = Object.keys(parsed.dependencies ?? {});
|
|
8633
8445
|
const agentOnly = new Set(parsed.camstack?.agentOnlyBootstrapAddons ?? []);
|
|
@@ -8672,7 +8484,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8672
8484
|
} catch {
|
|
8673
8485
|
return Object.freeze([]);
|
|
8674
8486
|
}
|
|
8675
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8487
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8676
8488
|
const addons = JSON.parse(raw).camstack?.agentBootstrapAddons ?? [];
|
|
8677
8489
|
return Object.freeze(["@camstack/server", ...addons]);
|
|
8678
8490
|
}
|
|
@@ -8702,7 +8514,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8702
8514
|
this.logger.info(`Install source: ${isLocal ? `bundle (${this.bundledAddonsDir})` : "npm"}, ${pkgList.length} package(s)`);
|
|
8703
8515
|
for (const packageName of pkgList) {
|
|
8704
8516
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
8705
|
-
if (fs.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8517
|
+
if (fs$1.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8706
8518
|
if (isLocal || shouldSkipClosureProvidedSeed(packageName, this.isResolvableFromClosure(packageName))) {
|
|
8707
8519
|
this.logger.debug(`${packageName} — already installed, skipping`);
|
|
8708
8520
|
continue;
|
|
@@ -8846,7 +8658,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8846
8658
|
const installedPackages = this.listInstalled();
|
|
8847
8659
|
for (const pkg of installedPackages) {
|
|
8848
8660
|
try {
|
|
8849
|
-
if (fs.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8661
|
+
if (fs$1.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8850
8662
|
} catch {
|
|
8851
8663
|
continue;
|
|
8852
8664
|
}
|
|
@@ -8886,7 +8698,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8886
8698
|
if (closureNodeModules !== null) for (const link of state.existingLinks) {
|
|
8887
8699
|
if (!isClosureLinkTarget(link.target, closureNodeModules)) continue;
|
|
8888
8700
|
const linkDir = path$1.join(nodeModulesDir, link.name);
|
|
8889
|
-
const targetManifest = fs.existsSync(path$1.join(linkDir, "package.json"));
|
|
8701
|
+
const targetManifest = fs$1.existsSync(path$1.join(linkDir, "package.json"));
|
|
8890
8702
|
const ranges = state.requirements.get(link.name) ?? [];
|
|
8891
8703
|
let holds = targetManifest;
|
|
8892
8704
|
if (holds && ranges.length > 0) {
|
|
@@ -8895,14 +8707,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8895
8707
|
}
|
|
8896
8708
|
if (!holds) {
|
|
8897
8709
|
this.logger.warn(`${packageName} — closure link for ${link.name} no longer holds; reinstalling this addon's deps`, { meta: { target: link.target } });
|
|
8898
|
-
fs.rmSync(linkDir, { force: true });
|
|
8710
|
+
fs$1.rmSync(linkDir, { force: true });
|
|
8899
8711
|
needsInstall = true;
|
|
8900
8712
|
}
|
|
8901
8713
|
}
|
|
8902
8714
|
const linked = [];
|
|
8903
8715
|
for (const [depName, range] of declaredEntries) {
|
|
8904
8716
|
if (typeof range !== "string") continue;
|
|
8905
|
-
if (fs.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8717
|
+
if (fs$1.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8906
8718
|
const closureVersion = closureNodeModules === null ? void 0 : readClosureVersions(closureNodeModules, [depName]).get(depName);
|
|
8907
8719
|
if (closureNodeModules !== null && closureVersion !== void 0 && closureSatisfiesRange(range, closureVersion)) {
|
|
8908
8720
|
if (executeClosureDedupe(addonDir, closureNodeModules, {
|
|
@@ -8935,7 +8747,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8935
8747
|
const closureNodeModules = resolveClosureNodeModulesDir(this.closureNodeModulesDir);
|
|
8936
8748
|
if (closureNodeModules !== null) {
|
|
8937
8749
|
const state = collectAddonTreeState(addonDir);
|
|
8938
|
-
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8750
|
+
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs$1.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8939
8751
|
}
|
|
8940
8752
|
this.logger.info(`${packageName} — reinstalling runtime dependencies`, { meta: { addonDir } });
|
|
8941
8753
|
await runNpm([
|
|
@@ -8980,7 +8792,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8980
8792
|
async realignFromClosure(packageName, closureDir) {
|
|
8981
8793
|
const targetDir = path$1.join(this.addonsDir, packageName);
|
|
8982
8794
|
const result = await this.installLocal(packageName, closureDir);
|
|
8983
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8795
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8984
8796
|
this.manifest.upsert(result.name, {
|
|
8985
8797
|
version: result.version,
|
|
8986
8798
|
source: "closure"
|
|
@@ -8996,17 +8808,17 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8996
8808
|
async installCopy(packageName, sourceDir, pkgData, targetDir) {
|
|
8997
8809
|
await this.ensureBuilt(packageName, sourceDir, pkgData);
|
|
8998
8810
|
const distDir = path$1.join(sourceDir, "dist");
|
|
8999
|
-
if (!fs.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
9000
|
-
await fs.promises.rm(targetDir, {
|
|
8811
|
+
if (!fs$1.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8812
|
+
await fs$1.promises.rm(targetDir, {
|
|
9001
8813
|
recursive: true,
|
|
9002
8814
|
force: true
|
|
9003
8815
|
});
|
|
9004
8816
|
ensureDir(targetDir);
|
|
9005
|
-
await fs.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8817
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
9006
8818
|
await copyDirRecursive(distDir, path$1.join(targetDir, "dist"));
|
|
9007
8819
|
await copyExtraFileDirs(pkgData, sourceDir, targetDir);
|
|
9008
8820
|
copyBundledNativeModules(sourceDir, targetDir, this.logger);
|
|
9009
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8821
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
9010
8822
|
const localPkgVersion = asString$1(pkgData.version, "0.0.0");
|
|
9011
8823
|
this.manifest.upsert(packageName, {
|
|
9012
8824
|
version: localPkgVersion,
|
|
@@ -9047,7 +8859,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9047
8859
|
* unusual auth, offline mode, etc).
|
|
9048
8860
|
*/
|
|
9049
8861
|
async installFromNpm(packageName, version) {
|
|
9050
|
-
const tmpDir = fs.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8862
|
+
const tmpDir = fs$1.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
9051
8863
|
const packageSpec = version ? `${packageName}@${version}` : packageName;
|
|
9052
8864
|
this.logger.info(`${packageName} — installing from npm`);
|
|
9053
8865
|
try {
|
|
@@ -9061,19 +8873,19 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9061
8873
|
];
|
|
9062
8874
|
if (this.registry) args.push("--registry", this.registry);
|
|
9063
8875
|
const { stdout } = await runNpm(args, this.npmRunOptions(tmpDir, 12e4));
|
|
9064
|
-
const tgzFiles = fs.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8876
|
+
const tgzFiles = fs$1.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
9065
8877
|
if (tgzFiles.length === 0) throw new Error(`npm pack produced no tgz. stdout: ${stdout.trim()}`);
|
|
9066
8878
|
return path$1.join(tmpDir, tgzFiles[0]);
|
|
9067
8879
|
});
|
|
9068
8880
|
const result = await this.installFromTgz(tgzPath);
|
|
9069
|
-
fs.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8881
|
+
fs$1.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
9070
8882
|
this.manifest.upsert(result.name, {
|
|
9071
8883
|
version: result.version,
|
|
9072
8884
|
source: "npm"
|
|
9073
8885
|
});
|
|
9074
8886
|
return result;
|
|
9075
8887
|
} finally {
|
|
9076
|
-
fs.rmSync(tmpDir, {
|
|
8888
|
+
fs$1.rmSync(tmpDir, {
|
|
9077
8889
|
recursive: true,
|
|
9078
8890
|
force: true
|
|
9079
8891
|
});
|
|
@@ -9111,7 +8923,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9111
8923
|
if (!tarRes.ok) throw new Error(`tarball GET ${tarballUrl} → ${tarRes.status}`);
|
|
9112
8924
|
const tgzPath = path$1.join(tmpDir, `${packageName.replace(/[/@]/g, "-").replace(/^-+/, "")}-${resolvedVersion}.tgz`);
|
|
9113
8925
|
const buf = Buffer.from(await tarRes.arrayBuffer());
|
|
9114
|
-
fs.writeFileSync(tgzPath, buf);
|
|
8926
|
+
fs$1.writeFileSync(tgzPath, buf);
|
|
9115
8927
|
return tgzPath;
|
|
9116
8928
|
}
|
|
9117
8929
|
/**
|
|
@@ -9132,7 +8944,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9132
8944
|
* on the next deploy.
|
|
9133
8945
|
*/
|
|
9134
8946
|
async evictInstallDir(targetDir) {
|
|
9135
|
-
if (!fs.existsSync(targetDir)) return;
|
|
8947
|
+
if (!fs$1.existsSync(targetDir)) return;
|
|
9136
8948
|
const graveyard = path$1.join(this.addonsDir, ".evicting");
|
|
9137
8949
|
ensureDir(graveyard);
|
|
9138
8950
|
await this.sweepGraveyard(graveyard);
|
|
@@ -9140,10 +8952,10 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9140
8952
|
const flatName = path$1.relative(this.addonsDir, targetDir).replace(/[/\\]/g, "-");
|
|
9141
8953
|
const asideDir = path$1.join(graveyard, `${flatName}-${ts}`);
|
|
9142
8954
|
try {
|
|
9143
|
-
fs.renameSync(targetDir, asideDir);
|
|
8955
|
+
fs$1.renameSync(targetDir, asideDir);
|
|
9144
8956
|
} catch (renameErr) {
|
|
9145
8957
|
if (renameErr.code === "EXDEV") {
|
|
9146
|
-
await fs.promises.rm(targetDir, {
|
|
8958
|
+
await fs$1.promises.rm(targetDir, {
|
|
9147
8959
|
recursive: true,
|
|
9148
8960
|
force: true
|
|
9149
8961
|
});
|
|
@@ -9151,7 +8963,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9151
8963
|
}
|
|
9152
8964
|
throw renameErr;
|
|
9153
8965
|
}
|
|
9154
|
-
await fs.promises.rm(asideDir, {
|
|
8966
|
+
await fs$1.promises.rm(asideDir, {
|
|
9155
8967
|
recursive: true,
|
|
9156
8968
|
force: true
|
|
9157
8969
|
}).catch((cleanupErr) => {
|
|
@@ -9172,14 +8984,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9172
8984
|
async sweepStagingResidue(stagingRoot) {
|
|
9173
8985
|
let names;
|
|
9174
8986
|
try {
|
|
9175
|
-
names = fs.readdirSync(stagingRoot);
|
|
8987
|
+
names = fs$1.readdirSync(stagingRoot);
|
|
9176
8988
|
} catch {
|
|
9177
8989
|
return;
|
|
9178
8990
|
}
|
|
9179
8991
|
const now = Date.now();
|
|
9180
8992
|
const ages = [];
|
|
9181
8993
|
for (const name of names) try {
|
|
9182
|
-
const stat = fs.statSync(path$1.join(stagingRoot, name));
|
|
8994
|
+
const stat = fs$1.statSync(path$1.join(stagingRoot, name));
|
|
9183
8995
|
ages.push({
|
|
9184
8996
|
name,
|
|
9185
8997
|
ageMs: now - stat.mtimeMs
|
|
@@ -9190,7 +9002,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9190
9002
|
stagingRoot,
|
|
9191
9003
|
entries: sweepable
|
|
9192
9004
|
} });
|
|
9193
|
-
await Promise.all(sweepable.map((name) => fs.promises.rm(path$1.join(stagingRoot, name), {
|
|
9005
|
+
await Promise.all(sweepable.map((name) => fs$1.promises.rm(path$1.join(stagingRoot, name), {
|
|
9194
9006
|
recursive: true,
|
|
9195
9007
|
force: true
|
|
9196
9008
|
}).catch(() => void 0)));
|
|
@@ -9199,11 +9011,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9199
9011
|
async sweepGraveyard(graveyard) {
|
|
9200
9012
|
let entries;
|
|
9201
9013
|
try {
|
|
9202
|
-
entries = fs.readdirSync(graveyard);
|
|
9014
|
+
entries = fs$1.readdirSync(graveyard);
|
|
9203
9015
|
} catch {
|
|
9204
9016
|
return;
|
|
9205
9017
|
}
|
|
9206
|
-
await Promise.all(entries.map((name) => fs.promises.rm(path$1.join(graveyard, name), {
|
|
9018
|
+
await Promise.all(entries.map((name) => fs$1.promises.rm(path$1.join(graveyard, name), {
|
|
9207
9019
|
recursive: true,
|
|
9208
9020
|
force: true
|
|
9209
9021
|
}).catch(() => void 0)));
|
|
@@ -9254,7 +9066,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9254
9066
|
return;
|
|
9255
9067
|
}
|
|
9256
9068
|
const strippedManifest = stripBundledDeps(pkgView.raw);
|
|
9257
|
-
await fs.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9069
|
+
await fs$1.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9258
9070
|
const deps = asJsonObject$1(strippedManifest["dependencies"]);
|
|
9259
9071
|
const depNames = deps ? Object.keys(deps) : [];
|
|
9260
9072
|
if (depNames.length === 0) return;
|
|
@@ -9386,9 +9198,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9386
9198
|
"-C",
|
|
9387
9199
|
stagingDir
|
|
9388
9200
|
], { timeout: 12e4 });
|
|
9389
|
-
const pkgDir = fs.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9201
|
+
const pkgDir = fs$1.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9390
9202
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
9391
|
-
if (!fs.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9203
|
+
if (!fs$1.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9392
9204
|
const pkgView = readPackageJson(pkgJsonPath);
|
|
9393
9205
|
if (!pkgView) throw new Error(`Invalid package.json at ${pkgJsonPath}`);
|
|
9394
9206
|
if (!pkgView.camstackAddons) throw new Error(`Package ${pkgView.name} has no camstack.addons manifest`);
|
|
@@ -9398,7 +9210,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9398
9210
|
this.dedupeTreeAgainstClosure(pkgDir, pkgView.name);
|
|
9399
9211
|
await this.evictInstallDir(targetDir);
|
|
9400
9212
|
ensureDir(path$1.dirname(targetDir));
|
|
9401
|
-
await fs.promises.rename(pkgDir, targetDir);
|
|
9213
|
+
await fs$1.promises.rename(pkgDir, targetDir);
|
|
9402
9214
|
this.manifest.upsert(pkgView.name, {
|
|
9403
9215
|
version: pkgView.version,
|
|
9404
9216
|
source: "bundled"
|
|
@@ -9409,7 +9221,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9409
9221
|
};
|
|
9410
9222
|
} finally {
|
|
9411
9223
|
this.inFlightStaging.delete(stagingName);
|
|
9412
|
-
await fs.promises.rm(stagingDir, {
|
|
9224
|
+
await fs$1.promises.rm(stagingDir, {
|
|
9413
9225
|
recursive: true,
|
|
9414
9226
|
force: true
|
|
9415
9227
|
}).catch(() => void 0);
|
|
@@ -9439,24 +9251,24 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9439
9251
|
const current = this.manifest.get(packageName);
|
|
9440
9252
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9441
9253
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9442
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9254
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9443
9255
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
9444
9256
|
const backupRoot = path$1.join(this.addonsDir, ".backups", packageName);
|
|
9445
9257
|
ensureDir(backupRoot);
|
|
9446
9258
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9447
9259
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9448
|
-
fs.renameSync(addonDir, backupDir);
|
|
9260
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9449
9261
|
let result;
|
|
9450
9262
|
try {
|
|
9451
9263
|
result = await this.installFromNpm(packageName, version);
|
|
9452
9264
|
} catch (installErr) {
|
|
9453
9265
|
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: errMsg$1(installErr) } });
|
|
9454
9266
|
try {
|
|
9455
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9267
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9456
9268
|
recursive: true,
|
|
9457
9269
|
force: true
|
|
9458
9270
|
});
|
|
9459
|
-
fs.renameSync(backupDir, addonDir);
|
|
9271
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9460
9272
|
this.manifest.upsert(packageName, {
|
|
9461
9273
|
version: current.version,
|
|
9462
9274
|
source: current.source,
|
|
@@ -9517,7 +9329,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9517
9329
|
const current = this.manifest.get(packageName);
|
|
9518
9330
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9519
9331
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9520
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9332
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9521
9333
|
await this.installRuntimeDependencies(stagedPath, packageName);
|
|
9522
9334
|
await this.installNativeDependencies(stagedPath, packageName);
|
|
9523
9335
|
this.dedupeTreeAgainstClosure(stagedPath, packageName);
|
|
@@ -9526,14 +9338,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9526
9338
|
ensureDir(backupRoot);
|
|
9527
9339
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9528
9340
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9529
|
-
fs.renameSync(addonDir, backupDir);
|
|
9341
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9530
9342
|
try {
|
|
9531
9343
|
try {
|
|
9532
|
-
fs.renameSync(stagedPath, addonDir);
|
|
9344
|
+
fs$1.renameSync(stagedPath, addonDir);
|
|
9533
9345
|
} catch (renameErr) {
|
|
9534
9346
|
if (renameErr.code === "EXDEV") {
|
|
9535
|
-
fs.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9536
|
-
fs.rmSync(stagedPath, {
|
|
9347
|
+
fs$1.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9348
|
+
fs$1.rmSync(stagedPath, {
|
|
9537
9349
|
recursive: true,
|
|
9538
9350
|
force: true
|
|
9539
9351
|
});
|
|
@@ -9542,11 +9354,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9542
9354
|
} catch (swapErr) {
|
|
9543
9355
|
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error: errMsg$1(swapErr) } });
|
|
9544
9356
|
try {
|
|
9545
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9357
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9546
9358
|
recursive: true,
|
|
9547
9359
|
force: true
|
|
9548
9360
|
});
|
|
9549
|
-
fs.renameSync(backupDir, addonDir);
|
|
9361
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9550
9362
|
this.manifest.upsert(packageName, {
|
|
9551
9363
|
version: current.version,
|
|
9552
9364
|
source: current.source,
|
|
@@ -9585,20 +9397,20 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9585
9397
|
this.logger.warn(`${packageName} — no backup to rollback to`);
|
|
9586
9398
|
return null;
|
|
9587
9399
|
}
|
|
9588
|
-
if (!fs.existsSync(entry.lastBackupDir)) {
|
|
9400
|
+
if (!fs$1.existsSync(entry.lastBackupDir)) {
|
|
9589
9401
|
this.logger.warn(`${packageName} — backup dir vanished: ${entry.lastBackupDir}`);
|
|
9590
9402
|
return null;
|
|
9591
9403
|
}
|
|
9592
9404
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9593
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9405
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9594
9406
|
recursive: true,
|
|
9595
9407
|
force: true
|
|
9596
9408
|
});
|
|
9597
|
-
fs.renameSync(entry.lastBackupDir, addonDir);
|
|
9409
|
+
fs$1.renameSync(entry.lastBackupDir, addonDir);
|
|
9598
9410
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
9599
9411
|
let restoredVersion = entry.version;
|
|
9600
|
-
if (fs.existsSync(pkgJsonPath)) try {
|
|
9601
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
9412
|
+
if (fs$1.existsSync(pkgJsonPath)) try {
|
|
9413
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
9602
9414
|
if (typeof parsed === "object" && parsed != null) {
|
|
9603
9415
|
const v = parsed.version;
|
|
9604
9416
|
if (typeof v === "string" && v.length > 0) restoredVersion = v;
|
|
@@ -9646,7 +9458,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9646
9458
|
return false;
|
|
9647
9459
|
}
|
|
9648
9460
|
try {
|
|
9649
|
-
await fs.promises.rm(target, {
|
|
9461
|
+
await fs$1.promises.rm(target, {
|
|
9650
9462
|
recursive: true,
|
|
9651
9463
|
force: true
|
|
9652
9464
|
});
|
|
@@ -9664,7 +9476,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9664
9476
|
listBackupsFor(packageName) {
|
|
9665
9477
|
const dir = path$1.join(this.backupsRoot, packageName);
|
|
9666
9478
|
try {
|
|
9667
|
-
return fs.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9479
|
+
return fs$1.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9668
9480
|
} catch {
|
|
9669
9481
|
return [];
|
|
9670
9482
|
}
|
|
@@ -9696,7 +9508,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9696
9508
|
for (const dir of [pkgDir, path$1.dirname(pkgDir)]) {
|
|
9697
9509
|
if (!this.isInsideBackups(dir)) continue;
|
|
9698
9510
|
try {
|
|
9699
|
-
await fs.promises.rmdir(dir);
|
|
9511
|
+
await fs$1.promises.rmdir(dir);
|
|
9700
9512
|
} catch {
|
|
9701
9513
|
return;
|
|
9702
9514
|
}
|
|
@@ -9778,7 +9590,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9778
9590
|
*/
|
|
9779
9591
|
resolveBackupToKeep(packageName, backups) {
|
|
9780
9592
|
const liveDir = path$1.join(this.addonsDir, packageName);
|
|
9781
|
-
if (!fs.existsSync(liveDir)) {
|
|
9593
|
+
if (!fs$1.existsSync(liveDir)) {
|
|
9782
9594
|
const newest = backups[backups.length - 1] ?? null;
|
|
9783
9595
|
if (newest != null) this.logger.warn(`${packageName} — live install dir missing; retaining its newest backup as the only surviving copy`, { meta: {
|
|
9784
9596
|
liveDir,
|
|
@@ -9795,7 +9607,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9795
9607
|
listBackedUpPackages() {
|
|
9796
9608
|
let entries;
|
|
9797
9609
|
try {
|
|
9798
|
-
entries = fs.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9610
|
+
entries = fs$1.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9799
9611
|
} catch {
|
|
9800
9612
|
return [];
|
|
9801
9613
|
}
|
|
@@ -9807,14 +9619,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9807
9619
|
continue;
|
|
9808
9620
|
}
|
|
9809
9621
|
const scopeDir = path$1.join(this.backupsRoot, entry.name);
|
|
9810
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9622
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9811
9623
|
}
|
|
9812
9624
|
return names;
|
|
9813
9625
|
}
|
|
9814
9626
|
async uninstall(packageName) {
|
|
9815
9627
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9816
|
-
if (fs.existsSync(addonDir)) {
|
|
9817
|
-
fs.rmSync(addonDir, {
|
|
9628
|
+
if (fs$1.existsSync(addonDir)) {
|
|
9629
|
+
fs$1.rmSync(addonDir, {
|
|
9818
9630
|
recursive: true,
|
|
9819
9631
|
force: true
|
|
9820
9632
|
});
|
|
@@ -9822,8 +9634,8 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9822
9634
|
return;
|
|
9823
9635
|
}
|
|
9824
9636
|
const legacyDir = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""));
|
|
9825
|
-
if (fs.existsSync(legacyDir)) {
|
|
9826
|
-
fs.rmSync(legacyDir, {
|
|
9637
|
+
if (fs$1.existsSync(legacyDir)) {
|
|
9638
|
+
fs$1.rmSync(legacyDir, {
|
|
9827
9639
|
recursive: true,
|
|
9828
9640
|
force: true
|
|
9829
9641
|
});
|
|
@@ -9831,22 +9643,22 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9831
9643
|
}
|
|
9832
9644
|
}
|
|
9833
9645
|
listInstalled() {
|
|
9834
|
-
if (!fs.existsSync(this.addonsDir)) return [];
|
|
9646
|
+
if (!fs$1.existsSync(this.addonsDir)) return [];
|
|
9835
9647
|
const packageDirs = [];
|
|
9836
|
-
for (const entry of fs.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9648
|
+
for (const entry of fs$1.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9837
9649
|
if (!isDirEntry(entry, this.addonsDir)) continue;
|
|
9838
9650
|
if (entry.name.startsWith("@")) {
|
|
9839
9651
|
const scopeDir = path$1.join(this.addonsDir, entry.name);
|
|
9840
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9652
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9841
9653
|
} else packageDirs.push(path$1.join(this.addonsDir, entry.name));
|
|
9842
9654
|
}
|
|
9843
9655
|
return packageDirs.map((dir) => {
|
|
9844
9656
|
const pkgPath = path$1.join(dir, "package.json");
|
|
9845
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9657
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9846
9658
|
const pkg = readPackageJson(pkgPath);
|
|
9847
9659
|
if (!pkg || !pkg.camstackAddons) return null;
|
|
9848
9660
|
const sourceFile = path$1.join(dir, ".install-source");
|
|
9849
|
-
const installSource = fs.existsSync(sourceFile) ? parseInstallSource(fs.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9661
|
+
const installSource = fs$1.existsSync(sourceFile) ? parseInstallSource(fs$1.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9850
9662
|
return {
|
|
9851
9663
|
name: pkg.name,
|
|
9852
9664
|
version: pkg.version,
|
|
@@ -9856,13 +9668,13 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9856
9668
|
}).filter((item) => item !== null);
|
|
9857
9669
|
}
|
|
9858
9670
|
isInstalled(packageName) {
|
|
9859
|
-
if (fs.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9860
|
-
return fs.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9671
|
+
if (fs$1.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9672
|
+
return fs$1.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9861
9673
|
}
|
|
9862
9674
|
getInstalledPackage(packageName) {
|
|
9863
9675
|
let pkgPath = path$1.join(this.addonsDir, packageName, "package.json");
|
|
9864
|
-
if (!fs.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9865
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9676
|
+
if (!fs$1.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9677
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9866
9678
|
const pkg = readPackageJson(pkgPath);
|
|
9867
9679
|
if (!pkg) return null;
|
|
9868
9680
|
return {
|
|
@@ -9881,7 +9693,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9881
9693
|
]) {
|
|
9882
9694
|
const candidate = path$1.join(this.bundledAddonsDir, dirName);
|
|
9883
9695
|
try {
|
|
9884
|
-
const pkg = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9696
|
+
const pkg = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9885
9697
|
if (pkg && asString$1(pkg["name"]) === packageName) return candidate;
|
|
9886
9698
|
} catch {}
|
|
9887
9699
|
}
|
|
@@ -9890,7 +9702,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9890
9702
|
/** Ensure a package is built (dist/ exists and page bundles present) */
|
|
9891
9703
|
async ensureBuilt(packageName, sourceDir, pkgData) {
|
|
9892
9704
|
const distDir = path$1.join(sourceDir, "dist");
|
|
9893
|
-
if (!(!fs.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9705
|
+
if (!(!fs$1.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9894
9706
|
this.logger.info(`${packageName} — building (dist/ missing or incomplete)`);
|
|
9895
9707
|
try {
|
|
9896
9708
|
await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
|
|
@@ -9905,7 +9717,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9905
9717
|
if (!camstack?.addons) return false;
|
|
9906
9718
|
for (const addon of camstack.addons) {
|
|
9907
9719
|
if (!addon.pages) continue;
|
|
9908
|
-
for (const page of addon.pages) if (page.bundle && !fs.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9720
|
+
for (const page of addon.pages) if (page.bundle && !fs$1.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9909
9721
|
}
|
|
9910
9722
|
return false;
|
|
9911
9723
|
}
|
|
@@ -9914,7 +9726,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9914
9726
|
function isDirEntry(entry, parentDir) {
|
|
9915
9727
|
if (entry.isDirectory()) return true;
|
|
9916
9728
|
if (entry.isSymbolicLink()) try {
|
|
9917
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9729
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9918
9730
|
} catch {
|
|
9919
9731
|
return false;
|
|
9920
9732
|
}
|
|
@@ -10013,7 +9825,7 @@ function selectAddonResidue(candidates) {
|
|
|
10013
9825
|
}
|
|
10014
9826
|
function readDeclaredName(dir) {
|
|
10015
9827
|
try {
|
|
10016
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9828
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
10017
9829
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
10018
9830
|
const name = parsed.name;
|
|
10019
9831
|
return typeof name === "string" ? name : null;
|
|
@@ -10023,7 +9835,7 @@ function readDeclaredName(dir) {
|
|
|
10023
9835
|
}
|
|
10024
9836
|
function readDeclaredVersion(dir) {
|
|
10025
9837
|
try {
|
|
10026
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9838
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
10027
9839
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
10028
9840
|
const version = parsed.version;
|
|
10029
9841
|
return typeof version === "string" ? version : null;
|
|
@@ -10033,7 +9845,7 @@ function readDeclaredVersion(dir) {
|
|
|
10033
9845
|
}
|
|
10034
9846
|
function isDirLike(p) {
|
|
10035
9847
|
try {
|
|
10036
|
-
return fs.statSync(p).isDirectory();
|
|
9848
|
+
return fs$1.statSync(p).isDirectory();
|
|
10037
9849
|
} catch {
|
|
10038
9850
|
return false;
|
|
10039
9851
|
}
|
|
@@ -10043,7 +9855,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
10043
9855
|
const base = scope === null ? dirName : `${scope.replace("@", "")}__${dirName}`;
|
|
10044
9856
|
let candidate = path$1.join(store, base);
|
|
10045
9857
|
let n = 1;
|
|
10046
|
-
while (fs.existsSync(candidate)) {
|
|
9858
|
+
while (fs$1.existsSync(candidate)) {
|
|
10047
9859
|
candidate = path$1.join(store, `${base}-${n}`);
|
|
10048
9860
|
n += 1;
|
|
10049
9861
|
}
|
|
@@ -10060,7 +9872,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
10060
9872
|
function quarantineAddonResidue(addonsDir, log) {
|
|
10061
9873
|
const quarantined = [];
|
|
10062
9874
|
const failed = [];
|
|
10063
|
-
if (!fs.existsSync(addonsDir)) return {
|
|
9875
|
+
if (!fs$1.existsSync(addonsDir)) return {
|
|
10064
9876
|
quarantined,
|
|
10065
9877
|
failed
|
|
10066
9878
|
};
|
|
@@ -10068,7 +9880,7 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
10068
9880
|
const scan = (parent, scope) => {
|
|
10069
9881
|
let names;
|
|
10070
9882
|
try {
|
|
10071
|
-
names = fs.readdirSync(parent);
|
|
9883
|
+
names = fs$1.readdirSync(parent);
|
|
10072
9884
|
} catch {
|
|
10073
9885
|
return;
|
|
10074
9886
|
}
|
|
@@ -10087,8 +9899,8 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
10087
9899
|
const version = readDeclaredVersion(full);
|
|
10088
9900
|
const to = freeQuarantineTarget(store, scope, dirName);
|
|
10089
9901
|
try {
|
|
10090
|
-
fs.mkdirSync(store, { recursive: true });
|
|
10091
|
-
fs.renameSync(full, to);
|
|
9902
|
+
fs$1.mkdirSync(store, { recursive: true });
|
|
9903
|
+
fs$1.renameSync(full, to);
|
|
10092
9904
|
} catch (err) {
|
|
10093
9905
|
const error = err instanceof Error ? err.message : String(err);
|
|
10094
9906
|
failed.push({
|
|
@@ -10146,11 +9958,11 @@ function getRestartMarkerPath(dataDir) {
|
|
|
10146
9958
|
* intact or no marker at all (never a half-written file).
|
|
10147
9959
|
*/
|
|
10148
9960
|
function writePendingRestart(dataDir, marker) {
|
|
10149
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
9961
|
+
fs$1.mkdirSync(dataDir, { recursive: true });
|
|
10150
9962
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10151
9963
|
const tmpPath = `${markerPath}.tmp`;
|
|
10152
|
-
fs.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
10153
|
-
fs.renameSync(tmpPath, markerPath);
|
|
9964
|
+
fs$1.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
9965
|
+
fs$1.renameSync(tmpPath, markerPath);
|
|
10154
9966
|
}
|
|
10155
9967
|
/**
|
|
10156
9968
|
* Read + consume the marker. Returns the parsed payload on success and
|
|
@@ -10175,10 +9987,10 @@ function writePendingRestart(dataDir, marker) {
|
|
|
10175
9987
|
*/
|
|
10176
9988
|
function readPendingRestart(dataDir) {
|
|
10177
9989
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10178
|
-
if (!fs.existsSync(markerPath)) return null;
|
|
9990
|
+
if (!fs$1.existsSync(markerPath)) return null;
|
|
10179
9991
|
let raw;
|
|
10180
9992
|
try {
|
|
10181
|
-
raw = fs.readFileSync(markerPath, "utf-8");
|
|
9993
|
+
raw = fs$1.readFileSync(markerPath, "utf-8");
|
|
10182
9994
|
} catch (err) {
|
|
10183
9995
|
console.error("[restart-coordinator] Marker unreadable — leaving in place:", err);
|
|
10184
9996
|
return null;
|
|
@@ -10217,7 +10029,7 @@ function readPendingRestart(dataDir) {
|
|
|
10217
10029
|
/** Remove the marker if present. No-op if missing. */
|
|
10218
10030
|
function clearPendingRestart(dataDir) {
|
|
10219
10031
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
10220
|
-
fs.rmSync(markerPath, { force: true });
|
|
10032
|
+
fs$1.rmSync(markerPath, { force: true });
|
|
10221
10033
|
}
|
|
10222
10034
|
function isRestartKind(value) {
|
|
10223
10035
|
return value === "framework-update" || value === "manual" || value === "system";
|
|
@@ -10229,7 +10041,7 @@ function scheduleSelfRestart(options = {}) {
|
|
|
10229
10041
|
const touchTarget = process.env["CAMSTACK_RESTART_TOUCH_FILE"];
|
|
10230
10042
|
if (touchTarget !== void 0 && touchTarget.length > 0) try {
|
|
10231
10043
|
const now = /* @__PURE__ */ new Date();
|
|
10232
|
-
fs.utimesSync(touchTarget, now, now);
|
|
10044
|
+
fs$1.utimesSync(touchTarget, now, now);
|
|
10233
10045
|
return;
|
|
10234
10046
|
} catch (err) {
|
|
10235
10047
|
console.error("[restart-coordinator] dev touch-reload failed; falling through to process exit:", err);
|
|
@@ -14593,11 +14405,11 @@ function applyEnvOverrides(raw) {
|
|
|
14593
14405
|
return result;
|
|
14594
14406
|
}
|
|
14595
14407
|
function loadYaml(configPath) {
|
|
14596
|
-
if (!fs.existsSync(configPath)) {
|
|
14408
|
+
if (!fs$1.existsSync(configPath)) {
|
|
14597
14409
|
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`);
|
|
14598
14410
|
return {};
|
|
14599
14411
|
}
|
|
14600
|
-
const parsed = load(fs.readFileSync(configPath, "utf-8")) ?? {};
|
|
14412
|
+
const parsed = load(fs$1.readFileSync(configPath, "utf-8")) ?? {};
|
|
14601
14413
|
console.log(`[ConfigManager] Loaded config from: ${configPath}`);
|
|
14602
14414
|
return parsed;
|
|
14603
14415
|
}
|
|
@@ -22758,7 +22570,7 @@ async function probeVaapiInit(renderNode) {
|
|
|
22758
22570
|
*/
|
|
22759
22571
|
function safeExistsSync(path) {
|
|
22760
22572
|
try {
|
|
22761
|
-
return fs.existsSync(path);
|
|
22573
|
+
return fs$1.existsSync(path);
|
|
22762
22574
|
} catch {
|
|
22763
22575
|
return false;
|
|
22764
22576
|
}
|
|
@@ -22777,11 +22589,11 @@ function probeLinuxGpus() {
|
|
|
22777
22589
|
if (safeExistsSync("/dev/nvidia0") || safeExistsSync("/proc/driver/nvidia/version")) signals.hasNvidiaGpu = true;
|
|
22778
22590
|
try {
|
|
22779
22591
|
const drmDir = "/sys/class/drm";
|
|
22780
|
-
if (fs.existsSync(drmDir)) for (const entry of fs.readdirSync(drmDir)) {
|
|
22592
|
+
if (fs$1.existsSync(drmDir)) for (const entry of fs$1.readdirSync(drmDir)) {
|
|
22781
22593
|
if (!entry.startsWith("card")) continue;
|
|
22782
22594
|
const vendorPath = `${drmDir}/${entry}/device/vendor`;
|
|
22783
22595
|
if (!safeExistsSync(vendorPath)) continue;
|
|
22784
|
-
const vendor = fs.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22596
|
+
const vendor = fs$1.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22785
22597
|
if (vendor === "0x10de") signals.hasNvidiaGpu = true;
|
|
22786
22598
|
else if (vendor === "0x1002") signals.hasAmdGpu = true;
|
|
22787
22599
|
else if (vendor === "0x8086") signals.hasIntelGpu = true;
|
|
@@ -22999,21 +22811,21 @@ function sleep$1(ms) {
|
|
|
22999
22811
|
* crashed holder) is stolen.
|
|
23000
22812
|
*/
|
|
23001
22813
|
async function withFileLock(lockPath, fn) {
|
|
23002
|
-
fs.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22814
|
+
fs$1.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
23003
22815
|
for (;;) try {
|
|
23004
|
-
const fd = fs.openSync(lockPath, "wx");
|
|
23005
|
-
fs.closeSync(fd);
|
|
22816
|
+
const fd = fs$1.openSync(lockPath, "wx");
|
|
22817
|
+
fs$1.closeSync(fd);
|
|
23006
22818
|
break;
|
|
23007
22819
|
} catch {
|
|
23008
22820
|
try {
|
|
23009
|
-
if (Date.now() - fs.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs.rmSync(lockPath, { force: true });
|
|
22821
|
+
if (Date.now() - fs$1.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs$1.rmSync(lockPath, { force: true });
|
|
23010
22822
|
else await sleep$1(LOCK_POLL_MS);
|
|
23011
22823
|
} catch {}
|
|
23012
22824
|
}
|
|
23013
22825
|
try {
|
|
23014
22826
|
return await fn();
|
|
23015
22827
|
} finally {
|
|
23016
|
-
fs.rmSync(lockPath, { force: true });
|
|
22828
|
+
fs$1.rmSync(lockPath, { force: true });
|
|
23017
22829
|
}
|
|
23018
22830
|
}
|
|
23019
22831
|
/** Coalesce in-process + serialize cross-process for one binary id. */
|
|
@@ -23071,7 +22883,7 @@ var AddonDepsManager = class {
|
|
|
23071
22883
|
* failed or tampered download throws, and provisioning reports it.
|
|
23072
22884
|
*/
|
|
23073
22885
|
async stageNativeDepsDeclaredBy(requirementsFile) {
|
|
23074
|
-
if (!declaresEdgetpuDelegate(fs.readFileSync(requirementsFile, "utf8"))) return;
|
|
22886
|
+
if (!declaresEdgetpuDelegate(fs$1.readFileSync(requirementsFile, "utf8"))) return;
|
|
23075
22887
|
await singleFlight(this.depsDir, "edgetpu-delegate", () => ensureEdgetpuDelegate(this.nodeRoot, this.logger));
|
|
23076
22888
|
}
|
|
23077
22889
|
getDepsDir() {
|
|
@@ -24102,7 +23914,7 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24102
23914
|
const addonId = declaration.id;
|
|
24103
23915
|
const nodeDataDir = process.env["CAMSTACK_DATA"] ?? dataDir;
|
|
24104
23916
|
const addonDataDir = path$1.resolve(nodeDataDir, "addons-data", addonId);
|
|
24105
|
-
fs.mkdirSync(addonDataDir, { recursive: true });
|
|
23917
|
+
fs$1.mkdirSync(addonDataDir, { recursive: true });
|
|
24106
23918
|
if (runtime.mode === "broker") ensureBindingSubscription(runtime.broker);
|
|
24107
23919
|
const regs = getRegistries(nodeId);
|
|
24108
23920
|
const workerResolver = {
|
|
@@ -25908,7 +25720,7 @@ var FailedRunnerRetryLedger = class {
|
|
|
25908
25720
|
function readRunnerPackageVersions(addonDirs) {
|
|
25909
25721
|
const out = {};
|
|
25910
25722
|
for (const dir of addonDirs) try {
|
|
25911
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
25723
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
25912
25724
|
const version = typeof raw === "object" && raw !== null ? Reflect.get(raw, "version") : null;
|
|
25913
25725
|
out[dir] = typeof version === "string" && version.length > 0 ? version : null;
|
|
25914
25726
|
} catch {
|
|
@@ -25969,7 +25781,7 @@ function readAddonHeapDeclaration(spec) {
|
|
|
25969
25781
|
if (cached !== void 0) return cached;
|
|
25970
25782
|
let declaration = EMPTY_HEAP_DECLARATION;
|
|
25971
25783
|
for (const manifestPath of [path$1.join(spec.addonDir, "package.json"), path$1.join(path$1.dirname(spec.addonDir), "package.json")]) try {
|
|
25972
|
-
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
25784
|
+
const raw = fs$1.readFileSync(manifestPath, "utf8");
|
|
25973
25785
|
const parsed = JSON.parse(raw);
|
|
25974
25786
|
const profile = extractHeapProfile(parsed, spec.addonId);
|
|
25975
25787
|
const maxOldSpaceMb = extractMaxOldSpaceMb(parsed, spec.addonId);
|
|
@@ -27191,17 +27003,17 @@ var JobJournal = class {
|
|
|
27191
27003
|
return path$1.join(this.jobsDir, `${id}.json`);
|
|
27192
27004
|
}
|
|
27193
27005
|
writeAtomic(filePath, data) {
|
|
27194
|
-
fs.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
27006
|
+
fs$1.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
27195
27007
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
27196
|
-
fs.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
27008
|
+
fs$1.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
27197
27009
|
encoding: "utf-8",
|
|
27198
27010
|
mode: 384
|
|
27199
27011
|
});
|
|
27200
|
-
fs.renameSync(tmp, filePath);
|
|
27012
|
+
fs$1.renameSync(tmp, filePath);
|
|
27201
27013
|
}
|
|
27202
27014
|
readIndex() {
|
|
27203
27015
|
try {
|
|
27204
|
-
const raw = JSON.parse(fs.readFileSync(this.indexPath, "utf-8"));
|
|
27016
|
+
const raw = JSON.parse(fs$1.readFileSync(this.indexPath, "utf-8"));
|
|
27205
27017
|
if (raw && Array.isArray(raw.jobIds)) return {
|
|
27206
27018
|
version: 1,
|
|
27207
27019
|
jobIds: raw.jobIds
|
|
@@ -27226,7 +27038,7 @@ var JobJournal = class {
|
|
|
27226
27038
|
}
|
|
27227
27039
|
getJob(id) {
|
|
27228
27040
|
try {
|
|
27229
|
-
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs.readFileSync(this.jobPath(id), "utf-8")));
|
|
27041
|
+
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs$1.readFileSync(this.jobPath(id), "utf-8")));
|
|
27230
27042
|
return parsed.success ? parsed.data : null;
|
|
27231
27043
|
} catch {
|
|
27232
27044
|
return null;
|
|
@@ -27291,14 +27103,14 @@ var StagingArea = class {
|
|
|
27291
27103
|
}
|
|
27292
27104
|
async fetchAndStage(input) {
|
|
27293
27105
|
const destDir = path$1.join(this.stagingDir, input.jobId, safeSegment(input.name));
|
|
27294
|
-
fs.rmSync(destDir, {
|
|
27106
|
+
fs$1.rmSync(destDir, {
|
|
27295
27107
|
recursive: true,
|
|
27296
27108
|
force: true
|
|
27297
27109
|
});
|
|
27298
27110
|
const tgz = await this.deps.fetchTarball(input.name, input.version, input.signal);
|
|
27299
27111
|
if (input.signal.aborted) throw new Error("staging aborted after fetch");
|
|
27300
27112
|
await this.deps.extract(tgz, destDir);
|
|
27301
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
27113
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
27302
27114
|
if (typeof raw.version !== "string" || raw.version.length === 0) throw new Error(`staging validation failed: ${input.name} staged a package.json with no version`);
|
|
27303
27115
|
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}`);
|
|
27304
27116
|
return {
|
|
@@ -27307,7 +27119,7 @@ var StagingArea = class {
|
|
|
27307
27119
|
};
|
|
27308
27120
|
}
|
|
27309
27121
|
cleanup(jobId) {
|
|
27310
|
-
fs.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
27122
|
+
fs$1.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
27311
27123
|
recursive: true,
|
|
27312
27124
|
force: true
|
|
27313
27125
|
});
|
|
@@ -27322,13 +27134,13 @@ var StagingArea = class {
|
|
|
27322
27134
|
sweepOrphans() {
|
|
27323
27135
|
let entries;
|
|
27324
27136
|
try {
|
|
27325
|
-
entries = fs.readdirSync(this.stagingDir);
|
|
27137
|
+
entries = fs$1.readdirSync(this.stagingDir);
|
|
27326
27138
|
} catch {
|
|
27327
27139
|
return 0;
|
|
27328
27140
|
}
|
|
27329
27141
|
let removed = 0;
|
|
27330
27142
|
for (const name of entries) try {
|
|
27331
|
-
fs.rmSync(path$1.join(this.stagingDir, name), {
|
|
27143
|
+
fs$1.rmSync(path$1.join(this.stagingDir, name), {
|
|
27332
27144
|
recursive: true,
|
|
27333
27145
|
force: true
|
|
27334
27146
|
});
|
|
@@ -27506,7 +27318,7 @@ var LifecycleJobEngine = class {
|
|
|
27506
27318
|
* on failure → `failed`.
|
|
27507
27319
|
*/
|
|
27508
27320
|
async reconcileJob(job) {
|
|
27509
|
-
const exists = this.deps.stagedPathExists ?? ((p) => fs.existsSync(p));
|
|
27321
|
+
const exists = this.deps.stagedPathExists ?? ((p) => fs$1.existsSync(p));
|
|
27510
27322
|
for (const task of job.tasks) {
|
|
27511
27323
|
if (task.target === "framework") {
|
|
27512
27324
|
if (!this.isTerminal(task.phase)) this.skipFrameworkTask(job, task);
|
|
@@ -28147,7 +27959,7 @@ var CatalogRegistry = class {
|
|
|
28147
27959
|
const file = path$1.join(packageDir, "i18n", `${lang}.json`);
|
|
28148
27960
|
let text;
|
|
28149
27961
|
try {
|
|
28150
|
-
text = fs.readFileSync(file, "utf8");
|
|
27962
|
+
text = fs$1.readFileSync(file, "utf8");
|
|
28151
27963
|
} catch {
|
|
28152
27964
|
continue;
|
|
28153
27965
|
}
|
|
@@ -28203,4 +28015,4 @@ function resetCatalogRegistryForTests() {
|
|
|
28203
28015
|
}
|
|
28204
28016
|
//#endregion
|
|
28205
28017
|
var readAllRows = import_read_all_rows.readAllRows;
|
|
28206
|
-
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, RunnerOfAddon, 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, clearIntegrationRows, clearNodeSettings, 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 };
|
|
28018
|
+
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, 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, RunnerOfAddon, 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, clearIntegrationRows, clearNodeSettings, 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 };
|