@camstack/server 1.2.788 → 1.2.790
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 +14 -0
- package/dist/agent/agent-child-manifest.js +39 -0
- package/dist/agent/agent-hub-registration.js +11 -1
- package/dist/agent/forward-to-hub.js +43 -0
- package/dist/agent/main.js +31 -81
- package/dist/agent/stale-addon-gate.js +70 -34
- package/dist/api/trpc/generated-cap-mounts.js +1 -6
- package/dist/api/trpc/generated-cap-routers.js +1221 -1417
- package/dist/core/addon/addon-registry.service.js +25 -33
- package/dist/core/addon/boot-health-snapshot.js +0 -28
- package/dist/core/addon/{hub-spawn-gate.js → hub-addon-support.js} +12 -35
- package/dist/core/moleculer/moleculer.service.js +2 -13
- package/dist/core/moleculer/runner-hosted-on-node.js +23 -0
- package/dist/core/updates/required-addon-update.js +1 -1
- package/package.json +23 -58
- package/system/dist/addon-utils.mjs +1 -1
- package/system/dist/{agent-https-jJDe-XNl.js → agent-https-BmXXKQAA.js} +1 -1
- package/system/dist/{agent-https-szf2FU49.mjs → agent-https-ByceQLwr.mjs} +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.d.ts +8 -0
- package/system/dist/builtins/alerts/alerts.addon.js +72 -1
- package/system/dist/builtins/alerts/alerts.addon.mjs +74 -3
- 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 +11 -5
- package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +11 -5
- 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 +4 -4
- package/system/dist/builtins/keychain/index.mjs +4 -4
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
- package/system/dist/builtins/local-network/local-network.addon.js +2 -2
- package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
- package/system/dist/builtins/loki-logging/index.js +1 -1
- package/system/dist/builtins/loki-logging/index.mjs +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
- package/system/dist/builtins/platform-probe/index.js +1 -1
- package/system/dist/builtins/platform-probe/index.mjs +10 -10
- package/system/dist/builtins/record-entries/index.js +1 -1
- package/system/dist/builtins/record-entries/index.mjs +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/system/dist/builtins/snapshot/index.js +1 -1
- package/system/dist/builtins/snapshot/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
- package/system/dist/builtins/sqlite-storage/index.js +1 -1
- package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/system/dist/builtins/storage-orchestrator/access-guards.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/custom-actions.d.ts +11 -0
- package/system/dist/builtins/storage-orchestrator/index.d.ts +1 -0
- package/system/dist/builtins/storage-orchestrator/index.js +2 -0
- package/system/dist/builtins/storage-orchestrator/index.mjs +2 -2
- package/system/dist/builtins/storage-orchestrator/location-instances.d.ts +72 -0
- package/system/dist/builtins/storage-orchestrator/location-repoint-move.d.ts +1 -1
- package/system/dist/builtins/storage-orchestrator/location-secret-refs.d.ts +26 -0
- package/system/dist/builtins/storage-orchestrator/location-store.d.ts +28 -2
- package/system/dist/builtins/storage-orchestrator/migrations/index.d.ts +9 -2
- package/system/dist/builtins/storage-orchestrator/migrations/legacy-location-secret-refs.d.ts +13 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secret-ports.d.ts +15 -0
- package/system/dist/builtins/storage-orchestrator/migrations/location-secrets-to-record.d.ts +57 -0
- package/system/dist/builtins/storage-orchestrator/provider-discovery.d.ts +10 -13
- package/system/dist/builtins/storage-orchestrator/record-kinds.d.ts +6 -0
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.d.ts +39 -8
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +954 -131
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +954 -132
- package/system/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +8 -0
- 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 +112 -3
- package/system/dist/builtins/winston-logging/index.mjs +112 -3
- package/system/dist/builtins/winston-logging/migrations/index.d.ts +8 -0
- package/system/dist/builtins/winston-logging/migrations/node-fields.d.ts +43 -0
- package/system/dist/builtins/winston-logging/winston-logging.addon.d.ts +10 -2
- package/system/dist/{capture-engine-DNHgjQot.js → capture-engine-BHj1fNYC.js} +1 -1
- package/system/dist/{capture-engine-BsKY_3xa.mjs → capture-engine-D9n4KDaN.mjs} +1 -1
- package/system/dist/{composition-sources-BgO0GQYW.js → composition-sources-BGgIuuvd.js} +1 -1
- package/system/dist/{composition-sources-BRdGsbVT.mjs → composition-sources-wI4qWTz2.mjs} +1 -1
- package/system/dist/{constants-CQeMrR4f.mjs → constants-DHqkxbYk.mjs} +1 -1
- package/system/dist/{constants-C3jGKQSQ.js → constants-DNdriMRD.js} +1 -1
- package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
- package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
- package/system/dist/{device-ca-D3y6wGmn.js → device-ca-C2RzT1VT.js} +1 -1
- package/system/dist/{device-ca-ByVi5eUC.mjs → device-ca-gr5eE3h5.mjs} +1 -1
- package/system/dist/{dist-BsQA6-0i.mjs → dist-BUoL5bbr.mjs} +116 -418
- package/system/dist/{dist-BRI-Mwx0.js → dist-DV0V3JiE.js} +133 -417
- package/system/dist/file-host-worker.js +1 -1
- package/system/dist/file-host-worker.mjs +1 -1
- package/system/dist/{hub-mdns-ciao-Ry_Jpljx.js → hub-mdns-ciao-Be5PGXW6.js} +2 -2
- package/system/dist/{hub-mdns-ciao-8dJTW2LI.mjs → hub-mdns-ciao-DoSb8dwB.mjs} +2 -2
- package/system/dist/index.js +151 -53
- package/system/dist/index.mjs +362 -266
- package/system/dist/kernel/addon-health-monitor.d.ts +0 -21
- package/system/dist/kernel/index.d.ts +2 -0
- package/system/dist/kernel/transport/runner-of-addon.d.ts +2 -0
- package/system/dist/kernel/unsupported-addon-tracker.d.ts +74 -0
- package/system/dist/{legacy-integration-rows-door-D5BdSNla.js → legacy-integration-rows-door-D5s8oM7e.js} +1 -1
- package/system/dist/{legacy-integration-rows-door-CjXTbmvH.mjs → legacy-integration-rows-door-DRC0xn6k.mjs} +1 -1
- package/system/dist/migrations/hub/2026-11-06-addon-settings-bare-rows.d.ts +3 -0
- package/system/dist/{restore-archive-Co2lk3OU.mjs → restore-archive-DH3P9j-V.mjs} +94 -94
- package/system/dist/{restore-archive-GoWJMdHy.js → restore-archive-Dh4gfCRY.js} +1 -1
- package/system/dist/{wal-maintenance-DRnV6QYu.mjs → wal-maintenance-BWfH3Lov.mjs} +0 -0
- package/system/dist/{wal-maintenance-C1Haue74.js → wal-maintenance-DgN_WD5T.js} +0 -0
- package/system/package.json +4 -1
package/system/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import {
|
|
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 { $r as isObjectInput, Ba as supportedRuntimes, Cc as userError, Cs as asString$1, D as CatalogFileSchema, Go as DEVICE_STATUS_METHOD, Gs as isDebugChannelName, Ho as CALLER_STAMPED_CAPABILITIES$1, Is as defineRecordKinds, Jr as isCollectionArrayMethod, Ls as emitDownForOwnedCaps, Ma as splitTranslationRef, Ni as objectInputDeclaresAddonId, Nt as PackageRequiresSchema, Oc as errMsg$1, Pi as objectInputDeclaresRequiredDeviceId, Sa as scopesAllowDeviceCap, Ss as asNumber, St as METHOD_ACCESS_MAP, Tn as bareAddonId, Un as compareVersions, Uo as DATAPLANE_SECRET_HEADER$1, Ur as interpolate, Vs as getDebugInterest, Wo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Yi as procedureAuthKey, a as AGENT_MDNS_SERVICE_TYPE, b as CATALOG_LANGS, bt as LOG_LEVEL_RANK, cc as parseJsonObject, cs as ReadinessTimeoutError, dc as readinessKey, fa as resolveMethodAuth, fr as describeUnmet, gn as addonSettingsCapability, hc as scopeKey, hi as looseSchema, js as createEvent$1, kc as EventCategory$1, kr as extractNestedAddonId, ks as collectSecretMarkerRefs, lc as parseJsonUnknown, mi as logLevelAtMost, ni as kebabToCamel$1, o as AGENT_MDNS_TXT_KEYS, os as RUNTIME_DEFAULTS, pc as resolveCapMount, qa as unmetRequirements, qr as isArrayOutputSchema, s as ALL_CAPABILITY_DEFINITIONS, si as lifecycleJobSchema, ss as ReadinessRegistry, ti as isVoidInput, wc as withoutCallerStamp, xa as scopesAllowAddon, xs as asJsonObject$1, zs as expandCapMethods } from "./dist-BUoL5bbr.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-gr5eE3h5.mjs";
|
|
4
4
|
import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
|
|
5
5
|
import { AlertCenterAddon, a as redactLogEntry, i as isCredentialKeyName, n as lastCauseAfterChunk, o as redactLogMeta, r as readRunnerDisplayName, s as redactLogText, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
|
|
6
6
|
import "./builtins/alerts/index.mjs";
|
|
@@ -25,29 +25,29 @@ 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-
|
|
29
|
-
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-
|
|
28
|
+
import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-BWfH3Lov.mjs";
|
|
29
|
+
import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-DRC0xn6k.mjs";
|
|
30
30
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
31
31
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
32
|
-
import { StorageOrchestratorAddon, a as
|
|
32
|
+
import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
33
33
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
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-
|
|
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-
|
|
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-ByceQLwr.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-DHqkxbYk.mjs";
|
|
36
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";
|
|
37
37
|
import "./builtins/system-config/index.mjs";
|
|
38
38
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
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-
|
|
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-
|
|
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-B9zFBNVa.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-DoSb8dwB.mjs";
|
|
41
41
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
42
42
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
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-
|
|
44
|
-
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-DH3P9j-V.mjs";
|
|
44
|
+
import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
|
|
45
45
|
import { z } from "zod";
|
|
46
46
|
import * as crypto$1 from "node:crypto";
|
|
47
47
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
48
48
|
import { PYTHON_VERSION, buildBinaryPath, declaresEdgetpuDelegate, downloadBinary, ensureBinary, ensureBinary as ensureBinary$1, ensureEdgetpuDelegate, ensureFfmpeg, ensureFfmpeg as ensureFfmpeg$1, ensurePython, ensurePython as ensurePython$1, findInPath, getFfmpegDownloadUrl, getPlatformInfo, getPythonDownloadUrl, installPythonPackages, installPythonPackages as installPythonPackages$1, installPythonRequirements, installPythonRequirements as installPythonRequirements$1 } from "@camstack/types/node";
|
|
49
49
|
import { connect, createConnection, createServer } from "node:net";
|
|
50
|
-
import * as fs from "node:fs";
|
|
50
|
+
import * as fs$1 from "node:fs";
|
|
51
51
|
import { accessSync, constants, createReadStream, createWriteStream, existsSync, readFileSync, readdirSync } from "node:fs";
|
|
52
52
|
import * as path$1 from "node:path";
|
|
53
53
|
import { basename, dirname, isAbsolute, join, resolve } from "node:path";
|
|
@@ -5020,7 +5020,7 @@ var PythonEnvManager = class {
|
|
|
5020
5020
|
async ensure(options) {
|
|
5021
5021
|
const probe = await this.probe();
|
|
5022
5022
|
if (!probe.available || !probe.path) throw userError("system.python-required", void 0, "Python 3.10+ is required but not found on this system");
|
|
5023
|
-
if (!fs.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5023
|
+
if (!fs$1.existsSync(path$1.join(this.venvPath, "bin", "python"))) await execFileAsync$7(probe.path, [
|
|
5024
5024
|
"-m",
|
|
5025
5025
|
"venv",
|
|
5026
5026
|
this.venvPath
|
|
@@ -5043,7 +5043,7 @@ var PythonEnvManager = class {
|
|
|
5043
5043
|
}
|
|
5044
5044
|
spawn(script, args) {
|
|
5045
5045
|
const venvPython = path$1.join(this.venvPath, "bin", "python");
|
|
5046
|
-
if (!fs.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5046
|
+
if (!fs$1.existsSync(venvPython)) throw new Error("Python venv not initialized. Call ensure() first.");
|
|
5047
5047
|
return spawn(venvPython, [script, ...args]);
|
|
5048
5048
|
}
|
|
5049
5049
|
};
|
|
@@ -5395,20 +5395,20 @@ var StorageManager = class {
|
|
|
5395
5395
|
const basePath = this.locationManager.getBackend(mappedName).basePath;
|
|
5396
5396
|
location.files = {
|
|
5397
5397
|
async readFile(p) {
|
|
5398
|
-
return fs.promises.readFile(path$1.join(basePath, p));
|
|
5398
|
+
return fs$1.promises.readFile(path$1.join(basePath, p));
|
|
5399
5399
|
},
|
|
5400
5400
|
async writeFile(p, data) {
|
|
5401
5401
|
const full = path$1.join(basePath, p);
|
|
5402
|
-
await fs.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5403
|
-
await fs.promises.writeFile(full, data);
|
|
5402
|
+
await fs$1.promises.mkdir(path$1.dirname(full), { recursive: true });
|
|
5403
|
+
await fs$1.promises.writeFile(full, data);
|
|
5404
5404
|
},
|
|
5405
5405
|
async deleteFile(p) {
|
|
5406
|
-
await fs.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5406
|
+
await fs$1.promises.rm(path$1.join(basePath, p), { force: true });
|
|
5407
5407
|
},
|
|
5408
5408
|
async listFiles(prefix) {
|
|
5409
5409
|
const dir = prefix ? path$1.join(basePath, prefix) : basePath;
|
|
5410
5410
|
try {
|
|
5411
|
-
return (await fs.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5411
|
+
return (await fs$1.promises.readdir(dir)).map((f) => prefix ? `${prefix}/${f}` : f);
|
|
5412
5412
|
} catch {
|
|
5413
5413
|
return [];
|
|
5414
5414
|
}
|
|
@@ -5418,7 +5418,7 @@ var StorageManager = class {
|
|
|
5418
5418
|
},
|
|
5419
5419
|
async exists(p) {
|
|
5420
5420
|
try {
|
|
5421
|
-
await fs.promises.access(path$1.join(basePath, p));
|
|
5421
|
+
await fs$1.promises.access(path$1.join(basePath, p));
|
|
5422
5422
|
return true;
|
|
5423
5423
|
} catch {
|
|
5424
5424
|
return false;
|
|
@@ -5868,7 +5868,7 @@ var TRADITIONAL_NATIVE_PACKAGES = ["better-sqlite3"];
|
|
|
5868
5868
|
function hasDotNode(dir, maxDepth) {
|
|
5869
5869
|
let entries;
|
|
5870
5870
|
try {
|
|
5871
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
5871
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
5872
5872
|
} catch {
|
|
5873
5873
|
return false;
|
|
5874
5874
|
}
|
|
@@ -5879,7 +5879,7 @@ function hasDotNode(dir, maxDepth) {
|
|
|
5879
5879
|
}
|
|
5880
5880
|
/** Locate the bundled `prebuild-install` bin.js inside the staged closure. */
|
|
5881
5881
|
function resolvePrebuildInstallBin(closureDir, moduleDir) {
|
|
5882
|
-
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;
|
|
5882
|
+
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;
|
|
5883
5883
|
}
|
|
5884
5884
|
/**
|
|
5885
5885
|
* Default fetcher: run the closure's own `prebuild-install` under the CURRENT
|
|
@@ -5932,7 +5932,7 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
5932
5932
|
const fetched = [];
|
|
5933
5933
|
for (const pkg of packages) {
|
|
5934
5934
|
const moduleDir = path$1.join(nm, pkg);
|
|
5935
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
5935
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
5936
5936
|
if (hasDotNode(moduleDir, 4)) continue;
|
|
5937
5937
|
options.logger.warn("staged closure native prebuild missing — fetching for running ABI", { meta: {
|
|
5938
5938
|
pkg,
|
|
@@ -5995,12 +5995,12 @@ async function ensureNativePrebuilds(closureDir, options) {
|
|
|
5995
5995
|
function replantFromBundled(srcModuleDir, dstModuleDir, hasNative) {
|
|
5996
5996
|
if (!hasNative(srcModuleDir)) return false;
|
|
5997
5997
|
try {
|
|
5998
|
-
fs.rmSync(dstModuleDir, {
|
|
5998
|
+
fs$1.rmSync(dstModuleDir, {
|
|
5999
5999
|
recursive: true,
|
|
6000
6000
|
force: true
|
|
6001
6001
|
});
|
|
6002
|
-
fs.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6003
|
-
fs.cpSync(srcModuleDir, dstModuleDir, {
|
|
6002
|
+
fs$1.mkdirSync(path$1.dirname(dstModuleDir), { recursive: true });
|
|
6003
|
+
fs$1.cpSync(srcModuleDir, dstModuleDir, {
|
|
6004
6004
|
recursive: true,
|
|
6005
6005
|
dereference: true
|
|
6006
6006
|
});
|
|
@@ -6029,7 +6029,7 @@ async function ensureAddonNativePrebuilds(addonDir, options) {
|
|
|
6029
6029
|
const missing = [];
|
|
6030
6030
|
for (const pkg of packages) {
|
|
6031
6031
|
const moduleDir = path$1.join(nm, pkg);
|
|
6032
|
-
if (!fs.existsSync(moduleDir)) continue;
|
|
6032
|
+
if (!fs$1.existsSync(moduleDir)) continue;
|
|
6033
6033
|
if (hasNative(moduleDir)) {
|
|
6034
6034
|
results.push({
|
|
6035
6035
|
pkg,
|
|
@@ -6128,7 +6128,7 @@ async function defaultDownloadTarball(url, destTgz) {
|
|
|
6128
6128
|
const res = await fetch(url);
|
|
6129
6129
|
if (!res.ok || !res.body) throw new Error(`HTTP ${res.status} downloading ${url}`);
|
|
6130
6130
|
const bytes = Buffer.from(await res.arrayBuffer());
|
|
6131
|
-
await fs.promises.writeFile(destTgz, bytes);
|
|
6131
|
+
await fs$1.promises.writeFile(destTgz, bytes);
|
|
6132
6132
|
}
|
|
6133
6133
|
async function defaultExtractTarball(tgzPath, destDir) {
|
|
6134
6134
|
await execFileAsync$5("tar", [
|
|
@@ -6214,7 +6214,7 @@ async function resolveUncached(options) {
|
|
|
6214
6214
|
argsPrefix: []
|
|
6215
6215
|
};
|
|
6216
6216
|
const cliPath = bootstrappedCliPath(options.cacheDir);
|
|
6217
|
-
if (fs.existsSync(cliPath)) {
|
|
6217
|
+
if (fs$1.existsSync(cliPath)) {
|
|
6218
6218
|
options.logger.info("system npm unavailable — using bootstrapped npm", { meta: { cliPath } });
|
|
6219
6219
|
return {
|
|
6220
6220
|
command: process.execPath,
|
|
@@ -6226,12 +6226,12 @@ async function resolveUncached(options) {
|
|
|
6226
6226
|
const registry = (options.registry ?? DEFAULT_REGISTRY$1).replace(/\/+$/, "");
|
|
6227
6227
|
const tarballUrl = tarballUrlOf(await (options.fetchJson ?? defaultFetchJson)(`${registry}/npm/latest`));
|
|
6228
6228
|
if (!tarballUrl) throw new Error(`registry metadata for 'npm' carries no dist.tarball (${registry})`);
|
|
6229
|
-
await fs.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6229
|
+
await fs$1.promises.mkdir(options.cacheDir, { recursive: true });
|
|
6230
6230
|
const tgzPath = path$1.join(options.cacheDir, "npm-bootstrap.tgz");
|
|
6231
6231
|
await (options.downloadTarball ?? defaultDownloadTarball)(tarballUrl, tgzPath);
|
|
6232
6232
|
await (options.extractTarball ?? defaultExtractTarball)(tgzPath, options.cacheDir);
|
|
6233
|
-
await fs.promises.rm(tgzPath, { force: true });
|
|
6234
|
-
if (!fs.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6233
|
+
await fs$1.promises.rm(tgzPath, { force: true });
|
|
6234
|
+
if (!fs$1.existsSync(cliPath)) throw new Error(`extracted npm tarball is missing ${cliPath}`);
|
|
6235
6235
|
options.logger.info("npm bootstrapped", { meta: { cliPath } });
|
|
6236
6236
|
return {
|
|
6237
6237
|
command: process.execPath,
|
|
@@ -6297,7 +6297,7 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6297
6297
|
let dir = path$1.dirname(entryPath);
|
|
6298
6298
|
for (let hop = 0; hop < PACKAGE_JSON_LOOKUP_DEPTH; hop++) {
|
|
6299
6299
|
try {
|
|
6300
|
-
const version = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6300
|
+
const version = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8")))?.["version"];
|
|
6301
6301
|
if (typeof version === "string" && version.length > 0) return version;
|
|
6302
6302
|
} catch {}
|
|
6303
6303
|
const parent = path$1.dirname(dir);
|
|
@@ -6341,14 +6341,14 @@ function readOwningPackageVersion(entryPath) {
|
|
|
6341
6341
|
function addonModuleCacheKey(entryPath) {
|
|
6342
6342
|
let stat;
|
|
6343
6343
|
try {
|
|
6344
|
-
stat = fs.statSync(entryPath);
|
|
6344
|
+
stat = fs$1.statSync(entryPath);
|
|
6345
6345
|
} catch {
|
|
6346
6346
|
return null;
|
|
6347
6347
|
}
|
|
6348
6348
|
const version = readOwningPackageVersion(entryPath) ?? `m${stat.mtimeMs}`;
|
|
6349
6349
|
let content;
|
|
6350
6350
|
try {
|
|
6351
|
-
content = createHash("sha1").update(fs.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6351
|
+
content = createHash("sha1").update(fs$1.readFileSync(entryPath)).digest("hex").slice(0, 16);
|
|
6352
6352
|
} catch {
|
|
6353
6353
|
content = `m${stat.mtimeMs}s${stat.size}`;
|
|
6354
6354
|
}
|
|
@@ -6452,14 +6452,14 @@ var AddonLoader = class {
|
|
|
6452
6452
|
* BUILTINS from the active closure, not the (now-inert) addons-dir copy, so
|
|
6453
6453
|
* the addons-dir `@camstack/server/system` must NOT be double-loaded here. */
|
|
6454
6454
|
async loadFromDirectory(addonsDir, skipPackages = []) {
|
|
6455
|
-
if (!fs.existsSync(addonsDir)) return;
|
|
6455
|
+
if (!fs$1.existsSync(addonsDir)) return;
|
|
6456
6456
|
const skip = new Set(skipPackages);
|
|
6457
|
-
const entries = fs.readdirSync(addonsDir, { withFileTypes: true });
|
|
6457
|
+
const entries = fs$1.readdirSync(addonsDir, { withFileTypes: true });
|
|
6458
6458
|
for (const entry of entries) {
|
|
6459
6459
|
if (!isDirectoryEntry(entry, addonsDir)) continue;
|
|
6460
6460
|
if (entry.name.startsWith("@")) {
|
|
6461
6461
|
const scopeDir = path$1.join(addonsDir, entry.name);
|
|
6462
|
-
const scopeEntries = fs.readdirSync(scopeDir, { withFileTypes: true });
|
|
6462
|
+
const scopeEntries = fs$1.readdirSync(scopeDir, { withFileTypes: true });
|
|
6463
6463
|
for (const scopeEntry of scopeEntries) {
|
|
6464
6464
|
if (!isDirectoryEntry(scopeEntry, scopeDir)) continue;
|
|
6465
6465
|
if (skip.has(`${entry.name}/${scopeEntry.name}`)) continue;
|
|
@@ -6473,7 +6473,7 @@ var AddonLoader = class {
|
|
|
6473
6473
|
}
|
|
6474
6474
|
async tryLoadAddon(addonDir) {
|
|
6475
6475
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6476
|
-
if (!fs.existsSync(pkgJsonPath)) return;
|
|
6476
|
+
if (!fs$1.existsSync(pkgJsonPath)) return;
|
|
6477
6477
|
try {
|
|
6478
6478
|
await this.loadFromAddonDir(addonDir);
|
|
6479
6479
|
} catch (err) {
|
|
@@ -6491,7 +6491,7 @@ var AddonLoader = class {
|
|
|
6491
6491
|
/** Load addon from a specific directory (package.json + dist/) */
|
|
6492
6492
|
async loadFromAddonDir(addonDir) {
|
|
6493
6493
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
6494
|
-
const pkgJson = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6494
|
+
const pkgJson = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8"))) ?? {};
|
|
6495
6495
|
const packageNameRaw = pkgJson["name"];
|
|
6496
6496
|
const packageName = typeof packageNameRaw === "string" ? packageNameRaw : "";
|
|
6497
6497
|
const packageVersionRaw = pkgJson["version"];
|
|
@@ -6539,7 +6539,7 @@ var AddonLoader = class {
|
|
|
6539
6539
|
}
|
|
6540
6540
|
const entryFile = declaration.entry.replace(/^\.\//, "").replace(/^src\//, "dist/").replace(/\.ts$/, ".js");
|
|
6541
6541
|
let entryPath = path$1.resolve(addonDir, entryFile);
|
|
6542
|
-
if (!fs.existsSync(entryPath)) {
|
|
6542
|
+
if (!fs$1.existsSync(entryPath)) {
|
|
6543
6543
|
const base = entryPath.replace(/\.(js|cjs|mjs)$/, "");
|
|
6544
6544
|
entryPath = [
|
|
6545
6545
|
`${base}.cjs`,
|
|
@@ -6548,9 +6548,9 @@ var AddonLoader = class {
|
|
|
6548
6548
|
path$1.resolve(addonDir, "dist", "index.cjs"),
|
|
6549
6549
|
path$1.resolve(addonDir, "dist", "index.mjs"),
|
|
6550
6550
|
path$1.resolve(addonDir, declaration.entry)
|
|
6551
|
-
].find((p) => fs.existsSync(p)) ?? entryPath;
|
|
6551
|
+
].find((p) => fs$1.existsSync(p)) ?? entryPath;
|
|
6552
6552
|
}
|
|
6553
|
-
if (!fs.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6553
|
+
if (!fs$1.existsSync(entryPath)) throw new Error(`Entry not found: ${entryPath}`);
|
|
6554
6554
|
const modUnknown = await importAddonModuleFresh(entryPath);
|
|
6555
6555
|
const mod = isRecord$4(modUnknown) ? modUnknown : {};
|
|
6556
6556
|
const AddonClass = resolveAddonClass(mod);
|
|
@@ -6662,7 +6662,7 @@ function isDirectoryEntry(entry, parentDir) {
|
|
|
6662
6662
|
if (entry.name.startsWith(".")) return false;
|
|
6663
6663
|
if (entry.isDirectory()) return true;
|
|
6664
6664
|
if (entry.isSymbolicLink()) try {
|
|
6665
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
6665
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
6666
6666
|
} catch {
|
|
6667
6667
|
return false;
|
|
6668
6668
|
}
|
|
@@ -6756,7 +6756,7 @@ var execFileAsync$4 = promisify(execFile);
|
|
|
6756
6756
|
* Single source of truth — replaces scattered mkdirSync calls.
|
|
6757
6757
|
*/
|
|
6758
6758
|
function ensureDir(dirPath) {
|
|
6759
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
6759
|
+
fs$1.mkdirSync(dirPath, { recursive: true });
|
|
6760
6760
|
}
|
|
6761
6761
|
/**
|
|
6762
6762
|
* Copy a directory recursively — ASYNC so it never blocks the event loop.
|
|
@@ -6769,7 +6769,7 @@ function ensureDir(dirPath) {
|
|
|
6769
6769
|
* `fs.promises.cp` keeps the I/O off the event loop. (Node ≥18 stable.)
|
|
6770
6770
|
*/
|
|
6771
6771
|
async function copyDirRecursive(src, dest) {
|
|
6772
|
-
await fs.promises.cp(src, dest, {
|
|
6772
|
+
await fs$1.promises.cp(src, dest, {
|
|
6773
6773
|
recursive: true,
|
|
6774
6774
|
force: true
|
|
6775
6775
|
});
|
|
@@ -6874,13 +6874,13 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
6874
6874
|
if (typeof fileEntry !== "string") continue;
|
|
6875
6875
|
if (fileEntry === "dist" || fileEntry.includes("*")) continue;
|
|
6876
6876
|
const srcPath = path$1.join(sourceDir, fileEntry);
|
|
6877
|
-
if (!fs.existsSync(srcPath)) continue;
|
|
6877
|
+
if (!fs$1.existsSync(srcPath)) continue;
|
|
6878
6878
|
const destPath = path$1.join(destDir, fileEntry);
|
|
6879
|
-
const stat = await fs.promises.stat(srcPath);
|
|
6879
|
+
const stat = await fs$1.promises.stat(srcPath);
|
|
6880
6880
|
if (stat.isDirectory()) await copyDirRecursive(srcPath, destPath);
|
|
6881
6881
|
else if (stat.isFile()) {
|
|
6882
6882
|
ensureDir(path$1.dirname(destPath));
|
|
6883
|
-
await fs.promises.copyFile(srcPath, destPath);
|
|
6883
|
+
await fs$1.promises.copyFile(srcPath, destPath);
|
|
6884
6884
|
}
|
|
6885
6885
|
}
|
|
6886
6886
|
}
|
|
@@ -6891,10 +6891,10 @@ async function copyExtraFileDirs(pkgJson, sourceDir, destDir) {
|
|
|
6891
6891
|
function isSourceNewer(packageDir) {
|
|
6892
6892
|
const srcDir = path$1.join(packageDir, "src");
|
|
6893
6893
|
const distDir = path$1.join(packageDir, "dist");
|
|
6894
|
-
if (!fs.existsSync(srcDir) || !fs.existsSync(distDir)) return true;
|
|
6894
|
+
if (!fs$1.existsSync(srcDir) || !fs$1.existsSync(distDir)) return true;
|
|
6895
6895
|
try {
|
|
6896
|
-
const distMtime = fs.statSync(distDir).mtimeMs;
|
|
6897
|
-
const entries = fs.readdirSync(srcDir, {
|
|
6896
|
+
const distMtime = fs$1.statSync(distDir).mtimeMs;
|
|
6897
|
+
const entries = fs$1.readdirSync(srcDir, {
|
|
6898
6898
|
withFileTypes: true,
|
|
6899
6899
|
recursive: true
|
|
6900
6900
|
});
|
|
@@ -6902,7 +6902,7 @@ function isSourceNewer(packageDir) {
|
|
|
6902
6902
|
if (!entry.isFile()) continue;
|
|
6903
6903
|
const parentDir = entry.parentPath ?? String(Reflect.get(entry, "path") ?? "");
|
|
6904
6904
|
const filePath = path$1.join(parentDir, entry.name);
|
|
6905
|
-
if (fs.statSync(filePath).mtimeMs > distMtime) return true;
|
|
6905
|
+
if (fs$1.statSync(filePath).mtimeMs > distMtime) return true;
|
|
6906
6906
|
}
|
|
6907
6907
|
return false;
|
|
6908
6908
|
} catch {
|
|
@@ -6919,7 +6919,7 @@ function isSourceNewer(packageDir) {
|
|
|
6919
6919
|
* `copyDirRecursive` for the wedge this prevents.
|
|
6920
6920
|
*/
|
|
6921
6921
|
async function installPackageFromNpm(packageName, targetDir) {
|
|
6922
|
-
const tmpDir = await fs.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
6922
|
+
const tmpDir = await fs$1.promises.mkdtemp(path$1.join(os$1.tmpdir(), "camstack-install-"));
|
|
6923
6923
|
try {
|
|
6924
6924
|
const { stdout } = await execFileAsync$4("npm", [
|
|
6925
6925
|
"pack",
|
|
@@ -6942,21 +6942,21 @@ async function installPackageFromNpm(packageName, targetDir) {
|
|
|
6942
6942
|
extractDir
|
|
6943
6943
|
], { timeout: 3e4 });
|
|
6944
6944
|
const packageSubDir = path$1.join(extractDir, "package");
|
|
6945
|
-
const srcPkgJsonDir = fs.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
6946
|
-
await fs.promises.rm(targetDir, {
|
|
6945
|
+
const srcPkgJsonDir = fs$1.existsSync(path$1.join(packageSubDir, "package.json")) ? packageSubDir : extractDir;
|
|
6946
|
+
await fs$1.promises.rm(targetDir, {
|
|
6947
6947
|
recursive: true,
|
|
6948
6948
|
force: true
|
|
6949
6949
|
});
|
|
6950
6950
|
ensureDir(targetDir);
|
|
6951
|
-
await fs.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
6951
|
+
await fs$1.promises.copyFile(path$1.join(srcPkgJsonDir, "package.json"), path$1.join(targetDir, "package.json"));
|
|
6952
6952
|
const distSrc = path$1.join(srcPkgJsonDir, "dist");
|
|
6953
|
-
if (fs.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
6953
|
+
if (fs$1.existsSync(distSrc)) await copyDirRecursive(distSrc, path$1.join(targetDir, "dist"));
|
|
6954
6954
|
try {
|
|
6955
|
-
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
6955
|
+
const npmPkg = asJsonObject$1(parseJsonUnknown(await fs$1.promises.readFile(path$1.join(srcPkgJsonDir, "package.json"), "utf-8")));
|
|
6956
6956
|
if (npmPkg) await copyExtraFileDirs(npmPkg, srcPkgJsonDir, targetDir);
|
|
6957
6957
|
} catch {}
|
|
6958
6958
|
} finally {
|
|
6959
|
-
await fs.promises.rm(tmpDir, {
|
|
6959
|
+
await fs$1.promises.rm(tmpDir, {
|
|
6960
6960
|
recursive: true,
|
|
6961
6961
|
force: true
|
|
6962
6962
|
});
|
|
@@ -6981,7 +6981,7 @@ function packageDirName$1(declaredName) {
|
|
|
6981
6981
|
}
|
|
6982
6982
|
function isDirLike$1(p) {
|
|
6983
6983
|
try {
|
|
6984
|
-
return fs.statSync(p).isDirectory();
|
|
6984
|
+
return fs$1.statSync(p).isDirectory();
|
|
6985
6985
|
} catch {
|
|
6986
6986
|
return false;
|
|
6987
6987
|
}
|
|
@@ -6999,12 +6999,12 @@ var AddonManifest = class {
|
|
|
6999
6999
|
*/
|
|
7000
7000
|
read() {
|
|
7001
7001
|
if (this.cache != null) return this.cache;
|
|
7002
|
-
if (!fs.existsSync(this.manifestPath)) {
|
|
7002
|
+
if (!fs$1.existsSync(this.manifestPath)) {
|
|
7003
7003
|
this.cache = this.empty();
|
|
7004
7004
|
return this.cache;
|
|
7005
7005
|
}
|
|
7006
7006
|
try {
|
|
7007
|
-
const raw = fs.readFileSync(this.manifestPath, "utf-8");
|
|
7007
|
+
const raw = fs$1.readFileSync(this.manifestPath, "utf-8");
|
|
7008
7008
|
const parsed = JSON.parse(raw);
|
|
7009
7009
|
if (parsed.version !== MANIFEST_VERSION) {
|
|
7010
7010
|
process.stderr.write(`[AddonManifest] schema mismatch (file=${parsed.version} vs runtime=${MANIFEST_VERSION}); starting empty\n`);
|
|
@@ -7025,13 +7025,13 @@ var AddonManifest = class {
|
|
|
7025
7025
|
* a half-written file.
|
|
7026
7026
|
*/
|
|
7027
7027
|
write(manifest) {
|
|
7028
|
-
fs.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7028
|
+
fs$1.mkdirSync(path$1.dirname(this.manifestPath), { recursive: true });
|
|
7029
7029
|
const tmp = `${this.manifestPath}.tmp.${process.pid}.${Date.now()}`;
|
|
7030
|
-
fs.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7030
|
+
fs$1.writeFileSync(tmp, JSON.stringify(manifest, null, 2), {
|
|
7031
7031
|
encoding: "utf-8",
|
|
7032
7032
|
mode: 384
|
|
7033
7033
|
});
|
|
7034
|
-
fs.renameSync(tmp, this.manifestPath);
|
|
7034
|
+
fs$1.renameSync(tmp, this.manifestPath);
|
|
7035
7035
|
this.cache = manifest;
|
|
7036
7036
|
}
|
|
7037
7037
|
/** Lookup a single addon's manifest entry, or `null` if not tracked. */
|
|
@@ -7106,22 +7106,22 @@ var AddonManifest = class {
|
|
|
7106
7106
|
* exactly what moved. Returns the total number of changes.
|
|
7107
7107
|
*/
|
|
7108
7108
|
reconcileFromDisk(addonsDir, onChange) {
|
|
7109
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7109
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7110
7110
|
const m = this.read();
|
|
7111
7111
|
let changes = 0;
|
|
7112
7112
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7113
7113
|
/** Package name → version, for every ADDON package actually installed. */
|
|
7114
7114
|
const onDisk = /* @__PURE__ */ new Map();
|
|
7115
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7115
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7116
7116
|
if (!scope.name.startsWith("@") || !isDirLike$1(path$1.join(addonsDir, scope.name))) continue;
|
|
7117
7117
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7118
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7118
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7119
7119
|
if (!isDirLike$1(path$1.join(scopeDir, pkg.name))) continue;
|
|
7120
7120
|
const pkgJsonPath = path$1.join(scopeDir, pkg.name, "package.json");
|
|
7121
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7121
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7122
7122
|
let pkgJson;
|
|
7123
7123
|
try {
|
|
7124
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7124
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7125
7125
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7126
7126
|
pkgJson = parsed;
|
|
7127
7127
|
} catch {
|
|
@@ -7192,28 +7192,28 @@ var AddonManifest = class {
|
|
|
7192
7192
|
migrateFromInstallSourceMarkers(addonsDir) {
|
|
7193
7193
|
const m = this.read();
|
|
7194
7194
|
if (Object.keys(m.addons).length > 0) return 0;
|
|
7195
|
-
if (!fs.existsSync(addonsDir)) return 0;
|
|
7195
|
+
if (!fs$1.existsSync(addonsDir)) return 0;
|
|
7196
7196
|
let migrated = 0;
|
|
7197
7197
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7198
|
-
for (const scope of fs.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7198
|
+
for (const scope of fs$1.readdirSync(addonsDir, { withFileTypes: true })) {
|
|
7199
7199
|
if (!scope.isDirectory() || !scope.name.startsWith("@")) continue;
|
|
7200
7200
|
const scopeDir = path$1.join(addonsDir, scope.name);
|
|
7201
|
-
for (const pkg of fs.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7201
|
+
for (const pkg of fs$1.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
7202
7202
|
if (!pkg.isDirectory()) continue;
|
|
7203
7203
|
const pkgDir = path$1.join(scopeDir, pkg.name);
|
|
7204
7204
|
const markerPath = path$1.join(pkgDir, ".install-source");
|
|
7205
7205
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
7206
|
-
if (!fs.existsSync(pkgJsonPath)) continue;
|
|
7206
|
+
if (!fs$1.existsSync(pkgJsonPath)) continue;
|
|
7207
7207
|
let pkgJson;
|
|
7208
7208
|
try {
|
|
7209
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
7209
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
7210
7210
|
if (typeof parsed !== "object" || parsed == null) continue;
|
|
7211
7211
|
pkgJson = parsed;
|
|
7212
7212
|
} catch {
|
|
7213
7213
|
continue;
|
|
7214
7214
|
}
|
|
7215
7215
|
if (!pkgJson.name || !pkgJson.version) continue;
|
|
7216
|
-
const source = fs.existsSync(markerPath) ? fs.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7216
|
+
const source = fs$1.existsSync(markerPath) ? fs$1.readFileSync(markerPath, "utf-8").trim() : "bundled";
|
|
7217
7217
|
m.addons[pkgJson.name] = {
|
|
7218
7218
|
name: pkgJson.name,
|
|
7219
7219
|
version: pkgJson.version,
|
|
@@ -7417,7 +7417,7 @@ function planClosureDedupe(input) {
|
|
|
7417
7417
|
function readTreeManifest(pkgJsonPath) {
|
|
7418
7418
|
let raw;
|
|
7419
7419
|
try {
|
|
7420
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
7420
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
7421
7421
|
} catch {
|
|
7422
7422
|
return null;
|
|
7423
7423
|
}
|
|
@@ -7442,7 +7442,7 @@ function readTreeManifest(pkgJsonPath) {
|
|
|
7442
7442
|
function listTopLevelEntries(nodeModulesDir) {
|
|
7443
7443
|
let entries;
|
|
7444
7444
|
try {
|
|
7445
|
-
entries = fs.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7445
|
+
entries = fs$1.readdirSync(nodeModulesDir, { withFileTypes: true });
|
|
7446
7446
|
} catch {
|
|
7447
7447
|
return [];
|
|
7448
7448
|
}
|
|
@@ -7452,7 +7452,7 @@ function listTopLevelEntries(nodeModulesDir) {
|
|
|
7452
7452
|
if (entry.name.startsWith("@")) {
|
|
7453
7453
|
let inner;
|
|
7454
7454
|
try {
|
|
7455
|
-
inner = fs.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7455
|
+
inner = fs$1.readdirSync(path$1.join(nodeModulesDir, entry.name), { withFileTypes: true });
|
|
7456
7456
|
} catch {
|
|
7457
7457
|
continue;
|
|
7458
7458
|
}
|
|
@@ -7485,14 +7485,14 @@ function collectAddonTreeState(addonDir) {
|
|
|
7485
7485
|
const entryDir = path$1.join(nodeModulesDir, name);
|
|
7486
7486
|
let isLink = false;
|
|
7487
7487
|
try {
|
|
7488
|
-
isLink = fs.lstatSync(entryDir).isSymbolicLink();
|
|
7488
|
+
isLink = fs$1.lstatSync(entryDir).isSymbolicLink();
|
|
7489
7489
|
} catch {
|
|
7490
7490
|
continue;
|
|
7491
7491
|
}
|
|
7492
7492
|
if (isLink) {
|
|
7493
7493
|
let target = "";
|
|
7494
7494
|
try {
|
|
7495
|
-
target = fs.readlinkSync(entryDir);
|
|
7495
|
+
target = fs$1.readlinkSync(entryDir);
|
|
7496
7496
|
} catch {}
|
|
7497
7497
|
existingLinks.push({
|
|
7498
7498
|
name,
|
|
@@ -7506,7 +7506,7 @@ function collectAddonTreeState(addonDir) {
|
|
|
7506
7506
|
version: manifest.version
|
|
7507
7507
|
});
|
|
7508
7508
|
for (const [depName, range] of manifest.ranges) {
|
|
7509
|
-
if (fs.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7509
|
+
if (fs$1.existsSync(path$1.join(entryDir, "node_modules", depName))) continue;
|
|
7510
7510
|
addRange(depName, range);
|
|
7511
7511
|
}
|
|
7512
7512
|
}
|
|
@@ -7536,7 +7536,7 @@ function resolveClosureNodeModulesDir(explicitDir) {
|
|
|
7536
7536
|
const frameworkDir = explicitDir ?? process.env["CAMSTACK_FRAMEWORK_DIR"];
|
|
7537
7537
|
if (frameworkDir === void 0 || frameworkDir.length === 0) return null;
|
|
7538
7538
|
const nodeModulesDir = explicitDir ?? path$1.join(frameworkDir, "node_modules");
|
|
7539
|
-
return fs.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7539
|
+
return fs$1.existsSync(nodeModulesDir) ? nodeModulesDir : null;
|
|
7540
7540
|
}
|
|
7541
7541
|
function symlinkType() {
|
|
7542
7542
|
return process.platform === "win32" ? "junction" : "dir";
|
|
@@ -7555,10 +7555,10 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7555
7555
|
const nodeModulesDir = path$1.join(addonDir, "node_modules");
|
|
7556
7556
|
const probePath = path$1.join(nodeModulesDir, ".closure-link-probe");
|
|
7557
7557
|
try {
|
|
7558
|
-
fs.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7559
|
-
fs.rmSync(probePath, { force: true });
|
|
7560
|
-
fs.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7561
|
-
fs.rmSync(probePath, { force: true });
|
|
7558
|
+
fs$1.mkdirSync(nodeModulesDir, { recursive: true });
|
|
7559
|
+
fs$1.rmSync(probePath, { force: true });
|
|
7560
|
+
fs$1.symlinkSync(closureNodeModulesDir, probePath, symlinkType());
|
|
7561
|
+
fs$1.rmSync(probePath, { force: true });
|
|
7562
7562
|
} catch (err) {
|
|
7563
7563
|
logger.warn("closure dedupe skipped — symlinks unavailable on this volume", { meta: {
|
|
7564
7564
|
addonDir,
|
|
@@ -7580,12 +7580,12 @@ function executeClosureDedupe(addonDir, closureNodeModulesDir, plan, logger) {
|
|
|
7580
7580
|
}
|
|
7581
7581
|
const entryDir = path$1.join(nodeModulesDir, link.name);
|
|
7582
7582
|
try {
|
|
7583
|
-
fs.rmSync(entryDir, {
|
|
7583
|
+
fs$1.rmSync(entryDir, {
|
|
7584
7584
|
recursive: true,
|
|
7585
7585
|
force: true
|
|
7586
7586
|
});
|
|
7587
|
-
fs.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7588
|
-
fs.symlinkSync(target, entryDir, symlinkType());
|
|
7587
|
+
fs$1.mkdirSync(path$1.dirname(entryDir), { recursive: true });
|
|
7588
|
+
fs$1.symlinkSync(target, entryDir, symlinkType());
|
|
7589
7589
|
linked.push(link.name);
|
|
7590
7590
|
} catch (err) {
|
|
7591
7591
|
logger.warn("closure dedupe — link failed; entry removed copy may need reinstall", { meta: {
|
|
@@ -7661,7 +7661,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
7661
7661
|
count: Object.keys(native).length
|
|
7662
7662
|
} });
|
|
7663
7663
|
try {
|
|
7664
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7664
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
7665
7665
|
} catch (err) {
|
|
7666
7666
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
7667
7667
|
markerFile,
|
|
@@ -7699,7 +7699,7 @@ async function installManifestNativeDeps(addonDir, pkgRaw, logger, registry, npm
|
|
|
7699
7699
|
}
|
|
7700
7700
|
await rebuildNativeDeps(addonDir, pending.map(([name]) => name), logger, npmCacheDir ?? defaultNpmCacheDir(), registry);
|
|
7701
7701
|
try {
|
|
7702
|
-
fs.writeFileSync(markerFile, markerHash);
|
|
7702
|
+
fs$1.writeFileSync(markerFile, markerHash);
|
|
7703
7703
|
} catch (err) {
|
|
7704
7704
|
logger.warn("Failed to write native deps marker", { meta: {
|
|
7705
7705
|
markerFile,
|
|
@@ -7721,12 +7721,12 @@ function copyPrebuiltNativeDep(name, addonDir, logger) {
|
|
|
7721
7721
|
if (source === target) continue;
|
|
7722
7722
|
if (!hasBuiltBinary(source)) continue;
|
|
7723
7723
|
try {
|
|
7724
|
-
fs.rmSync(target, {
|
|
7724
|
+
fs$1.rmSync(target, {
|
|
7725
7725
|
recursive: true,
|
|
7726
7726
|
force: true
|
|
7727
7727
|
});
|
|
7728
|
-
fs.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
7729
|
-
fs.cpSync(source, target, {
|
|
7728
|
+
fs$1.mkdirSync(path$1.dirname(target), { recursive: true });
|
|
7729
|
+
fs$1.cpSync(source, target, {
|
|
7730
7730
|
recursive: true,
|
|
7731
7731
|
dereference: true
|
|
7732
7732
|
});
|
|
@@ -7762,7 +7762,7 @@ var BUNDLED_NATIVE_SIBLING_SCOPES = {
|
|
|
7762
7762
|
function hasAnyDotNode(dir, maxDepth) {
|
|
7763
7763
|
let entries;
|
|
7764
7764
|
try {
|
|
7765
|
-
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
7765
|
+
entries = fs$1.readdirSync(dir, { withFileTypes: true });
|
|
7766
7766
|
} catch {
|
|
7767
7767
|
return false;
|
|
7768
7768
|
}
|
|
@@ -7776,12 +7776,12 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
7776
7776
|
if (!hasAnyDotNode(src, 5)) return;
|
|
7777
7777
|
if (hasAnyDotNode(dst, 5)) return;
|
|
7778
7778
|
try {
|
|
7779
|
-
fs.rmSync(dst, {
|
|
7779
|
+
fs$1.rmSync(dst, {
|
|
7780
7780
|
recursive: true,
|
|
7781
7781
|
force: true
|
|
7782
7782
|
});
|
|
7783
|
-
fs.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
7784
|
-
fs.cpSync(src, dst, {
|
|
7783
|
+
fs$1.mkdirSync(path$1.dirname(dst), { recursive: true });
|
|
7784
|
+
fs$1.cpSync(src, dst, {
|
|
7785
7785
|
recursive: true,
|
|
7786
7786
|
dereference: true
|
|
7787
7787
|
});
|
|
@@ -7816,7 +7816,7 @@ function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
|
7816
7816
|
*/
|
|
7817
7817
|
function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
7818
7818
|
const srcNm = path$1.join(sourceDir, "node_modules");
|
|
7819
|
-
if (!fs.existsSync(srcNm)) return;
|
|
7819
|
+
if (!fs$1.existsSync(srcNm)) return;
|
|
7820
7820
|
const dstNm = path$1.join(targetDir, "node_modules");
|
|
7821
7821
|
for (const [name, scopes] of Object.entries(BUNDLED_NATIVE_SIBLING_SCOPES)) {
|
|
7822
7822
|
copyPrebuiltModuleDir(path$1.join(srcNm, name), path$1.join(dstNm, name), name, logger);
|
|
@@ -7824,7 +7824,7 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
7824
7824
|
const scopeSrc = path$1.join(srcNm, scope);
|
|
7825
7825
|
let siblings;
|
|
7826
7826
|
try {
|
|
7827
|
-
siblings = fs.readdirSync(scopeSrc);
|
|
7827
|
+
siblings = fs$1.readdirSync(scopeSrc);
|
|
7828
7828
|
} catch {
|
|
7829
7829
|
continue;
|
|
7830
7830
|
}
|
|
@@ -7834,12 +7834,12 @@ function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
|
7834
7834
|
}
|
|
7835
7835
|
/** A package dir is "built" when it carries a compiled `.node` or a prebuilds tree. */
|
|
7836
7836
|
function hasBuiltBinary(pkgDir) {
|
|
7837
|
-
if (!fs.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
7837
|
+
if (!fs$1.existsSync(path$1.join(pkgDir, "package.json"))) return false;
|
|
7838
7838
|
const releaseDir = path$1.join(pkgDir, "build", "Release");
|
|
7839
7839
|
try {
|
|
7840
|
-
if (fs.existsSync(releaseDir) && fs.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
7840
|
+
if (fs$1.existsSync(releaseDir) && fs$1.readdirSync(releaseDir).some((f) => f.endsWith(".node"))) return true;
|
|
7841
7841
|
} catch {}
|
|
7842
|
-
return fs.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
7842
|
+
return fs$1.existsSync(path$1.join(pkgDir, "prebuilds"));
|
|
7843
7843
|
}
|
|
7844
7844
|
/** Candidate hoisted locations for `<name>`: NODE_PATH entries + ancestors of `addonDir`. */
|
|
7845
7845
|
function candidateHoistedDirs(name, addonDir) {
|
|
@@ -7877,7 +7877,7 @@ function hashDeclaration(deps) {
|
|
|
7877
7877
|
}
|
|
7878
7878
|
function markerMatches(markerFile, expected) {
|
|
7879
7879
|
try {
|
|
7880
|
-
return fs.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
7880
|
+
return fs$1.readFileSync(markerFile, "utf-8").trim() === expected;
|
|
7881
7881
|
} catch {
|
|
7882
7882
|
return false;
|
|
7883
7883
|
}
|
|
@@ -8088,7 +8088,7 @@ function parseInstallSource(value) {
|
|
|
8088
8088
|
function readPackageJson(pkgJsonPath) {
|
|
8089
8089
|
let raw;
|
|
8090
8090
|
try {
|
|
8091
|
-
raw = asJsonObject$1(parseJsonUnknown(fs.readFileSync(pkgJsonPath, "utf-8")));
|
|
8091
|
+
raw = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(pkgJsonPath, "utf-8")));
|
|
8092
8092
|
} catch {
|
|
8093
8093
|
return null;
|
|
8094
8094
|
}
|
|
@@ -8132,7 +8132,7 @@ var REGISTRY_LATEST_TIMEOUT_MS = 15e3;
|
|
|
8132
8132
|
var FALLBACK_VERSION_PROBES = 25;
|
|
8133
8133
|
function readInstalledPackageVersion(addonDir) {
|
|
8134
8134
|
try {
|
|
8135
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(addonDir, "package.json"), "utf-8"));
|
|
8135
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(addonDir, "package.json"), "utf-8"));
|
|
8136
8136
|
if (raw === null || typeof raw !== "object") return null;
|
|
8137
8137
|
const version = Reflect.get(raw, "version");
|
|
8138
8138
|
return typeof version === "string" && version.length > 0 ? version : null;
|
|
@@ -8280,7 +8280,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8280
8280
|
} catch {
|
|
8281
8281
|
return Object.freeze([]);
|
|
8282
8282
|
}
|
|
8283
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8283
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8284
8284
|
const parsed = JSON.parse(raw);
|
|
8285
8285
|
const deps = Object.keys(parsed.dependencies ?? {});
|
|
8286
8286
|
const agentOnly = new Set(parsed.camstack?.agentOnlyBootstrapAddons ?? []);
|
|
@@ -8325,7 +8325,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8325
8325
|
} catch {
|
|
8326
8326
|
return Object.freeze([]);
|
|
8327
8327
|
}
|
|
8328
|
-
const raw = fs.readFileSync(pkgPath, "utf-8");
|
|
8328
|
+
const raw = fs$1.readFileSync(pkgPath, "utf-8");
|
|
8329
8329
|
const addons = JSON.parse(raw).camstack?.agentBootstrapAddons ?? [];
|
|
8330
8330
|
return Object.freeze(["@camstack/server", ...addons]);
|
|
8331
8331
|
}
|
|
@@ -8355,7 +8355,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8355
8355
|
this.logger.info(`Install source: ${isLocal ? `bundle (${this.bundledAddonsDir})` : "npm"}, ${pkgList.length} package(s)`);
|
|
8356
8356
|
for (const packageName of pkgList) {
|
|
8357
8357
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
8358
|
-
if (fs.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8358
|
+
if (fs$1.existsSync(path$1.join(addonDir, "package.json"))) {
|
|
8359
8359
|
if (isLocal || shouldSkipClosureProvidedSeed(packageName, this.isResolvableFromClosure(packageName))) {
|
|
8360
8360
|
this.logger.debug(`${packageName} — already installed, skipping`);
|
|
8361
8361
|
continue;
|
|
@@ -8606,7 +8606,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8606
8606
|
const installedPackages = this.listInstalled();
|
|
8607
8607
|
for (const pkg of installedPackages) {
|
|
8608
8608
|
try {
|
|
8609
|
-
if (fs.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8609
|
+
if (fs$1.lstatSync(pkg.dir).isSymbolicLink()) continue;
|
|
8610
8610
|
} catch {
|
|
8611
8611
|
continue;
|
|
8612
8612
|
}
|
|
@@ -8646,7 +8646,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8646
8646
|
if (closureNodeModules !== null) for (const link of state.existingLinks) {
|
|
8647
8647
|
if (!isClosureLinkTarget(link.target, closureNodeModules)) continue;
|
|
8648
8648
|
const linkDir = path$1.join(nodeModulesDir, link.name);
|
|
8649
|
-
const targetManifest = fs.existsSync(path$1.join(linkDir, "package.json"));
|
|
8649
|
+
const targetManifest = fs$1.existsSync(path$1.join(linkDir, "package.json"));
|
|
8650
8650
|
const ranges = state.requirements.get(link.name) ?? [];
|
|
8651
8651
|
let holds = targetManifest;
|
|
8652
8652
|
if (holds && ranges.length > 0) {
|
|
@@ -8655,14 +8655,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8655
8655
|
}
|
|
8656
8656
|
if (!holds) {
|
|
8657
8657
|
this.logger.warn(`${packageName} — closure link for ${link.name} no longer holds; reinstalling this addon's deps`, { meta: { target: link.target } });
|
|
8658
|
-
fs.rmSync(linkDir, { force: true });
|
|
8658
|
+
fs$1.rmSync(linkDir, { force: true });
|
|
8659
8659
|
needsInstall = true;
|
|
8660
8660
|
}
|
|
8661
8661
|
}
|
|
8662
8662
|
const linked = [];
|
|
8663
8663
|
for (const [depName, range] of declaredEntries) {
|
|
8664
8664
|
if (typeof range !== "string") continue;
|
|
8665
|
-
if (fs.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8665
|
+
if (fs$1.existsSync(path$1.join(nodeModulesDir, depName, "package.json"))) continue;
|
|
8666
8666
|
const closureVersion = closureNodeModules === null ? void 0 : readClosureVersions(closureNodeModules, [depName]).get(depName);
|
|
8667
8667
|
if (closureNodeModules !== null && closureVersion !== void 0 && closureSatisfiesRange(range, closureVersion)) {
|
|
8668
8668
|
if (executeClosureDedupe(addonDir, closureNodeModules, {
|
|
@@ -8695,7 +8695,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8695
8695
|
const closureNodeModules = resolveClosureNodeModulesDir(this.closureNodeModulesDir);
|
|
8696
8696
|
if (closureNodeModules !== null) {
|
|
8697
8697
|
const state = collectAddonTreeState(addonDir);
|
|
8698
|
-
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8698
|
+
for (const link of state.existingLinks) if (isClosureLinkTarget(link.target, closureNodeModules)) fs$1.rmSync(path$1.join(addonDir, "node_modules", link.name), { force: true });
|
|
8699
8699
|
}
|
|
8700
8700
|
this.logger.info(`${packageName} — reinstalling runtime dependencies`, { meta: { addonDir } });
|
|
8701
8701
|
await runNpm([
|
|
@@ -8740,7 +8740,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8740
8740
|
async realignFromClosure(packageName, closureDir) {
|
|
8741
8741
|
const targetDir = path$1.join(this.addonsDir, packageName);
|
|
8742
8742
|
const result = await this.installLocal(packageName, closureDir);
|
|
8743
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8743
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "closure");
|
|
8744
8744
|
this.manifest.upsert(result.name, {
|
|
8745
8745
|
version: result.version,
|
|
8746
8746
|
source: "closure"
|
|
@@ -8756,17 +8756,17 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8756
8756
|
async installCopy(packageName, sourceDir, pkgData, targetDir) {
|
|
8757
8757
|
await this.ensureBuilt(packageName, sourceDir, pkgData);
|
|
8758
8758
|
const distDir = path$1.join(sourceDir, "dist");
|
|
8759
|
-
if (!fs.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8760
|
-
await fs.promises.rm(targetDir, {
|
|
8759
|
+
if (!fs$1.existsSync(distDir)) throw new Error(`${packageName} has no dist/ after build`);
|
|
8760
|
+
await fs$1.promises.rm(targetDir, {
|
|
8761
8761
|
recursive: true,
|
|
8762
8762
|
force: true
|
|
8763
8763
|
});
|
|
8764
8764
|
ensureDir(targetDir);
|
|
8765
|
-
await fs.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8765
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, "package.json"), JSON.stringify(stripBundledDeps(pkgData), null, 2));
|
|
8766
8766
|
await copyDirRecursive(distDir, path$1.join(targetDir, "dist"));
|
|
8767
8767
|
await copyExtraFileDirs(pkgData, sourceDir, targetDir);
|
|
8768
8768
|
copyBundledNativeModules(sourceDir, targetDir, this.logger);
|
|
8769
|
-
await fs.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8769
|
+
await fs$1.promises.writeFile(path$1.join(targetDir, ".install-source"), "local");
|
|
8770
8770
|
const localPkgVersion = asString$1(pkgData.version, "0.0.0");
|
|
8771
8771
|
this.manifest.upsert(packageName, {
|
|
8772
8772
|
version: localPkgVersion,
|
|
@@ -8807,7 +8807,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8807
8807
|
* unusual auth, offline mode, etc).
|
|
8808
8808
|
*/
|
|
8809
8809
|
async installFromNpm(packageName, version) {
|
|
8810
|
-
const tmpDir = fs.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8810
|
+
const tmpDir = fs$1.mkdtempSync(path$1.join(os$1.tmpdir(), "camstack-addon-npm-"));
|
|
8811
8811
|
const packageSpec = version ? `${packageName}@${version}` : packageName;
|
|
8812
8812
|
this.logger.info(`${packageName} — installing from npm`);
|
|
8813
8813
|
try {
|
|
@@ -8821,19 +8821,19 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8821
8821
|
];
|
|
8822
8822
|
if (this.registry) args.push("--registry", this.registry);
|
|
8823
8823
|
const { stdout } = await runNpm(args, this.npmRunOptions(tmpDir, 12e4));
|
|
8824
|
-
const tgzFiles = fs.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8824
|
+
const tgzFiles = fs$1.readdirSync(tmpDir).filter((f) => f.endsWith(".tgz"));
|
|
8825
8825
|
if (tgzFiles.length === 0) throw new Error(`npm pack produced no tgz. stdout: ${stdout.trim()}`);
|
|
8826
8826
|
return path$1.join(tmpDir, tgzFiles[0]);
|
|
8827
8827
|
});
|
|
8828
8828
|
const result = await this.installFromTgz(tgzPath);
|
|
8829
|
-
fs.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8829
|
+
fs$1.writeFileSync(path$1.join(this.addonsDir, result.name, ".install-source"), "npm");
|
|
8830
8830
|
this.manifest.upsert(result.name, {
|
|
8831
8831
|
version: result.version,
|
|
8832
8832
|
source: "npm"
|
|
8833
8833
|
});
|
|
8834
8834
|
return result;
|
|
8835
8835
|
} finally {
|
|
8836
|
-
fs.rmSync(tmpDir, {
|
|
8836
|
+
fs$1.rmSync(tmpDir, {
|
|
8837
8837
|
recursive: true,
|
|
8838
8838
|
force: true
|
|
8839
8839
|
});
|
|
@@ -8871,7 +8871,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8871
8871
|
if (!tarRes.ok) throw new Error(`tarball GET ${tarballUrl} → ${tarRes.status}`);
|
|
8872
8872
|
const tgzPath = path$1.join(tmpDir, `${packageName.replace(/[/@]/g, "-").replace(/^-+/, "")}-${resolvedVersion}.tgz`);
|
|
8873
8873
|
const buf = Buffer.from(await tarRes.arrayBuffer());
|
|
8874
|
-
fs.writeFileSync(tgzPath, buf);
|
|
8874
|
+
fs$1.writeFileSync(tgzPath, buf);
|
|
8875
8875
|
return tgzPath;
|
|
8876
8876
|
}
|
|
8877
8877
|
/**
|
|
@@ -8892,7 +8892,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8892
8892
|
* on the next deploy.
|
|
8893
8893
|
*/
|
|
8894
8894
|
async evictInstallDir(targetDir) {
|
|
8895
|
-
if (!fs.existsSync(targetDir)) return;
|
|
8895
|
+
if (!fs$1.existsSync(targetDir)) return;
|
|
8896
8896
|
const graveyard = path$1.join(this.addonsDir, ".evicting");
|
|
8897
8897
|
ensureDir(graveyard);
|
|
8898
8898
|
await this.sweepGraveyard(graveyard);
|
|
@@ -8900,10 +8900,10 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8900
8900
|
const flatName = path$1.relative(this.addonsDir, targetDir).replace(/[/\\]/g, "-");
|
|
8901
8901
|
const asideDir = path$1.join(graveyard, `${flatName}-${ts}`);
|
|
8902
8902
|
try {
|
|
8903
|
-
fs.renameSync(targetDir, asideDir);
|
|
8903
|
+
fs$1.renameSync(targetDir, asideDir);
|
|
8904
8904
|
} catch (renameErr) {
|
|
8905
8905
|
if (renameErr.code === "EXDEV") {
|
|
8906
|
-
await fs.promises.rm(targetDir, {
|
|
8906
|
+
await fs$1.promises.rm(targetDir, {
|
|
8907
8907
|
recursive: true,
|
|
8908
8908
|
force: true
|
|
8909
8909
|
});
|
|
@@ -8911,7 +8911,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8911
8911
|
}
|
|
8912
8912
|
throw renameErr;
|
|
8913
8913
|
}
|
|
8914
|
-
await fs.promises.rm(asideDir, {
|
|
8914
|
+
await fs$1.promises.rm(asideDir, {
|
|
8915
8915
|
recursive: true,
|
|
8916
8916
|
force: true
|
|
8917
8917
|
}).catch((cleanupErr) => {
|
|
@@ -8932,14 +8932,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8932
8932
|
async sweepStagingResidue(stagingRoot) {
|
|
8933
8933
|
let names;
|
|
8934
8934
|
try {
|
|
8935
|
-
names = fs.readdirSync(stagingRoot);
|
|
8935
|
+
names = fs$1.readdirSync(stagingRoot);
|
|
8936
8936
|
} catch {
|
|
8937
8937
|
return;
|
|
8938
8938
|
}
|
|
8939
8939
|
const now = Date.now();
|
|
8940
8940
|
const ages = [];
|
|
8941
8941
|
for (const name of names) try {
|
|
8942
|
-
const stat = fs.statSync(path$1.join(stagingRoot, name));
|
|
8942
|
+
const stat = fs$1.statSync(path$1.join(stagingRoot, name));
|
|
8943
8943
|
ages.push({
|
|
8944
8944
|
name,
|
|
8945
8945
|
ageMs: now - stat.mtimeMs
|
|
@@ -8950,7 +8950,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8950
8950
|
stagingRoot,
|
|
8951
8951
|
entries: sweepable
|
|
8952
8952
|
} });
|
|
8953
|
-
await Promise.all(sweepable.map((name) => fs.promises.rm(path$1.join(stagingRoot, name), {
|
|
8953
|
+
await Promise.all(sweepable.map((name) => fs$1.promises.rm(path$1.join(stagingRoot, name), {
|
|
8954
8954
|
recursive: true,
|
|
8955
8955
|
force: true
|
|
8956
8956
|
}).catch(() => void 0)));
|
|
@@ -8959,11 +8959,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
8959
8959
|
async sweepGraveyard(graveyard) {
|
|
8960
8960
|
let entries;
|
|
8961
8961
|
try {
|
|
8962
|
-
entries = fs.readdirSync(graveyard);
|
|
8962
|
+
entries = fs$1.readdirSync(graveyard);
|
|
8963
8963
|
} catch {
|
|
8964
8964
|
return;
|
|
8965
8965
|
}
|
|
8966
|
-
await Promise.all(entries.map((name) => fs.promises.rm(path$1.join(graveyard, name), {
|
|
8966
|
+
await Promise.all(entries.map((name) => fs$1.promises.rm(path$1.join(graveyard, name), {
|
|
8967
8967
|
recursive: true,
|
|
8968
8968
|
force: true
|
|
8969
8969
|
}).catch(() => void 0)));
|
|
@@ -9014,7 +9014,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9014
9014
|
return;
|
|
9015
9015
|
}
|
|
9016
9016
|
const strippedManifest = stripBundledDeps(pkgView.raw);
|
|
9017
|
-
await fs.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9017
|
+
await fs$1.promises.writeFile(pkgJsonPath, JSON.stringify(strippedManifest, null, 2));
|
|
9018
9018
|
const deps = asJsonObject$1(strippedManifest["dependencies"]);
|
|
9019
9019
|
const depNames = deps ? Object.keys(deps) : [];
|
|
9020
9020
|
if (depNames.length === 0) return;
|
|
@@ -9146,9 +9146,9 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9146
9146
|
"-C",
|
|
9147
9147
|
stagingDir
|
|
9148
9148
|
], { timeout: 12e4 });
|
|
9149
|
-
const pkgDir = fs.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9149
|
+
const pkgDir = fs$1.existsSync(path$1.join(stagingDir, "package", "package.json")) ? path$1.join(stagingDir, "package") : stagingDir;
|
|
9150
9150
|
const pkgJsonPath = path$1.join(pkgDir, "package.json");
|
|
9151
|
-
if (!fs.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9151
|
+
if (!fs$1.existsSync(pkgJsonPath)) throw new Error("No package.json found in tgz archive");
|
|
9152
9152
|
const pkgView = readPackageJson(pkgJsonPath);
|
|
9153
9153
|
if (!pkgView) throw new Error(`Invalid package.json at ${pkgJsonPath}`);
|
|
9154
9154
|
if (!pkgView.camstackAddons) throw new Error(`Package ${pkgView.name} has no camstack.addons manifest`);
|
|
@@ -9158,7 +9158,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9158
9158
|
this.dedupeTreeAgainstClosure(pkgDir, pkgView.name);
|
|
9159
9159
|
await this.evictInstallDir(targetDir);
|
|
9160
9160
|
ensureDir(path$1.dirname(targetDir));
|
|
9161
|
-
await fs.promises.rename(pkgDir, targetDir);
|
|
9161
|
+
await fs$1.promises.rename(pkgDir, targetDir);
|
|
9162
9162
|
this.manifest.upsert(pkgView.name, {
|
|
9163
9163
|
version: pkgView.version,
|
|
9164
9164
|
source: "bundled"
|
|
@@ -9169,7 +9169,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9169
9169
|
};
|
|
9170
9170
|
} finally {
|
|
9171
9171
|
this.inFlightStaging.delete(stagingName);
|
|
9172
|
-
await fs.promises.rm(stagingDir, {
|
|
9172
|
+
await fs$1.promises.rm(stagingDir, {
|
|
9173
9173
|
recursive: true,
|
|
9174
9174
|
force: true
|
|
9175
9175
|
}).catch(() => void 0);
|
|
@@ -9199,24 +9199,24 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9199
9199
|
const current = this.manifest.get(packageName);
|
|
9200
9200
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9201
9201
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9202
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9202
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9203
9203
|
const ts = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
9204
9204
|
const backupRoot = path$1.join(this.addonsDir, ".backups", packageName);
|
|
9205
9205
|
ensureDir(backupRoot);
|
|
9206
9206
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9207
9207
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9208
|
-
fs.renameSync(addonDir, backupDir);
|
|
9208
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9209
9209
|
let result;
|
|
9210
9210
|
try {
|
|
9211
9211
|
result = await this.installFromNpm(packageName, version);
|
|
9212
9212
|
} catch (installErr) {
|
|
9213
9213
|
this.logger.error(`${packageName} — install failed, restoring backup`, { meta: { error: errMsg$1(installErr) } });
|
|
9214
9214
|
try {
|
|
9215
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9215
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9216
9216
|
recursive: true,
|
|
9217
9217
|
force: true
|
|
9218
9218
|
});
|
|
9219
|
-
fs.renameSync(backupDir, addonDir);
|
|
9219
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9220
9220
|
this.manifest.upsert(packageName, {
|
|
9221
9221
|
version: current.version,
|
|
9222
9222
|
source: current.source,
|
|
@@ -9277,7 +9277,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9277
9277
|
const current = this.manifest.get(packageName);
|
|
9278
9278
|
if (current == null) throw new Error(`Cannot update ${packageName}: not currently tracked in manifest`);
|
|
9279
9279
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9280
|
-
if (!fs.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9280
|
+
if (!fs$1.existsSync(addonDir)) throw new Error(`Cannot update ${packageName}: install dir ${addonDir} missing`);
|
|
9281
9281
|
await this.installRuntimeDependencies(stagedPath, packageName);
|
|
9282
9282
|
await this.installNativeDependencies(stagedPath, packageName);
|
|
9283
9283
|
this.dedupeTreeAgainstClosure(stagedPath, packageName);
|
|
@@ -9286,14 +9286,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9286
9286
|
ensureDir(backupRoot);
|
|
9287
9287
|
const backupDir = path$1.join(backupRoot, ts);
|
|
9288
9288
|
this.logger.info(`${packageName} — backing up v${current.version} → ${backupDir}`);
|
|
9289
|
-
fs.renameSync(addonDir, backupDir);
|
|
9289
|
+
fs$1.renameSync(addonDir, backupDir);
|
|
9290
9290
|
try {
|
|
9291
9291
|
try {
|
|
9292
|
-
fs.renameSync(stagedPath, addonDir);
|
|
9292
|
+
fs$1.renameSync(stagedPath, addonDir);
|
|
9293
9293
|
} catch (renameErr) {
|
|
9294
9294
|
if (renameErr.code === "EXDEV") {
|
|
9295
|
-
fs.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9296
|
-
fs.rmSync(stagedPath, {
|
|
9295
|
+
fs$1.cpSync(stagedPath, addonDir, { recursive: true });
|
|
9296
|
+
fs$1.rmSync(stagedPath, {
|
|
9297
9297
|
recursive: true,
|
|
9298
9298
|
force: true
|
|
9299
9299
|
});
|
|
@@ -9302,11 +9302,11 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9302
9302
|
} catch (swapErr) {
|
|
9303
9303
|
this.logger.error(`${packageName} — staged swap failed, restoring backup`, { meta: { error: errMsg$1(swapErr) } });
|
|
9304
9304
|
try {
|
|
9305
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9305
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9306
9306
|
recursive: true,
|
|
9307
9307
|
force: true
|
|
9308
9308
|
});
|
|
9309
|
-
fs.renameSync(backupDir, addonDir);
|
|
9309
|
+
fs$1.renameSync(backupDir, addonDir);
|
|
9310
9310
|
this.manifest.upsert(packageName, {
|
|
9311
9311
|
version: current.version,
|
|
9312
9312
|
source: current.source,
|
|
@@ -9345,20 +9345,20 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9345
9345
|
this.logger.warn(`${packageName} — no backup to rollback to`);
|
|
9346
9346
|
return null;
|
|
9347
9347
|
}
|
|
9348
|
-
if (!fs.existsSync(entry.lastBackupDir)) {
|
|
9348
|
+
if (!fs$1.existsSync(entry.lastBackupDir)) {
|
|
9349
9349
|
this.logger.warn(`${packageName} — backup dir vanished: ${entry.lastBackupDir}`);
|
|
9350
9350
|
return null;
|
|
9351
9351
|
}
|
|
9352
9352
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9353
|
-
if (fs.existsSync(addonDir)) fs.rmSync(addonDir, {
|
|
9353
|
+
if (fs$1.existsSync(addonDir)) fs$1.rmSync(addonDir, {
|
|
9354
9354
|
recursive: true,
|
|
9355
9355
|
force: true
|
|
9356
9356
|
});
|
|
9357
|
-
fs.renameSync(entry.lastBackupDir, addonDir);
|
|
9357
|
+
fs$1.renameSync(entry.lastBackupDir, addonDir);
|
|
9358
9358
|
const pkgJsonPath = path$1.join(addonDir, "package.json");
|
|
9359
9359
|
let restoredVersion = entry.version;
|
|
9360
|
-
if (fs.existsSync(pkgJsonPath)) try {
|
|
9361
|
-
const parsed = JSON.parse(fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
9360
|
+
if (fs$1.existsSync(pkgJsonPath)) try {
|
|
9361
|
+
const parsed = JSON.parse(fs$1.readFileSync(pkgJsonPath, "utf-8"));
|
|
9362
9362
|
if (typeof parsed === "object" && parsed != null) {
|
|
9363
9363
|
const v = parsed.version;
|
|
9364
9364
|
if (typeof v === "string" && v.length > 0) restoredVersion = v;
|
|
@@ -9406,7 +9406,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9406
9406
|
return false;
|
|
9407
9407
|
}
|
|
9408
9408
|
try {
|
|
9409
|
-
await fs.promises.rm(target, {
|
|
9409
|
+
await fs$1.promises.rm(target, {
|
|
9410
9410
|
recursive: true,
|
|
9411
9411
|
force: true
|
|
9412
9412
|
});
|
|
@@ -9424,7 +9424,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9424
9424
|
listBackupsFor(packageName) {
|
|
9425
9425
|
const dir = path$1.join(this.backupsRoot, packageName);
|
|
9426
9426
|
try {
|
|
9427
|
-
return fs.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9427
|
+
return fs$1.readdirSync(dir, { withFileTypes: true }).filter((e) => e.isDirectory()).map((e) => path$1.join(dir, e.name)).sort();
|
|
9428
9428
|
} catch {
|
|
9429
9429
|
return [];
|
|
9430
9430
|
}
|
|
@@ -9456,7 +9456,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9456
9456
|
for (const dir of [pkgDir, path$1.dirname(pkgDir)]) {
|
|
9457
9457
|
if (!this.isInsideBackups(dir)) continue;
|
|
9458
9458
|
try {
|
|
9459
|
-
await fs.promises.rmdir(dir);
|
|
9459
|
+
await fs$1.promises.rmdir(dir);
|
|
9460
9460
|
} catch {
|
|
9461
9461
|
return;
|
|
9462
9462
|
}
|
|
@@ -9538,7 +9538,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9538
9538
|
*/
|
|
9539
9539
|
resolveBackupToKeep(packageName, backups) {
|
|
9540
9540
|
const liveDir = path$1.join(this.addonsDir, packageName);
|
|
9541
|
-
if (!fs.existsSync(liveDir)) {
|
|
9541
|
+
if (!fs$1.existsSync(liveDir)) {
|
|
9542
9542
|
const newest = backups[backups.length - 1] ?? null;
|
|
9543
9543
|
if (newest != null) this.logger.warn(`${packageName} — live install dir missing; retaining its newest backup as the only surviving copy`, { meta: {
|
|
9544
9544
|
liveDir,
|
|
@@ -9555,7 +9555,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9555
9555
|
listBackedUpPackages() {
|
|
9556
9556
|
let entries;
|
|
9557
9557
|
try {
|
|
9558
|
-
entries = fs.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9558
|
+
entries = fs$1.readdirSync(this.backupsRoot, { withFileTypes: true });
|
|
9559
9559
|
} catch {
|
|
9560
9560
|
return [];
|
|
9561
9561
|
}
|
|
@@ -9567,14 +9567,14 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9567
9567
|
continue;
|
|
9568
9568
|
}
|
|
9569
9569
|
const scopeDir = path$1.join(this.backupsRoot, entry.name);
|
|
9570
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9570
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (inner.isDirectory()) names.push(`${entry.name}/${inner.name}`);
|
|
9571
9571
|
}
|
|
9572
9572
|
return names;
|
|
9573
9573
|
}
|
|
9574
9574
|
async uninstall(packageName) {
|
|
9575
9575
|
const addonDir = path$1.join(this.addonsDir, packageName);
|
|
9576
|
-
if (fs.existsSync(addonDir)) {
|
|
9577
|
-
fs.rmSync(addonDir, {
|
|
9576
|
+
if (fs$1.existsSync(addonDir)) {
|
|
9577
|
+
fs$1.rmSync(addonDir, {
|
|
9578
9578
|
recursive: true,
|
|
9579
9579
|
force: true
|
|
9580
9580
|
});
|
|
@@ -9582,8 +9582,8 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9582
9582
|
return;
|
|
9583
9583
|
}
|
|
9584
9584
|
const legacyDir = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""));
|
|
9585
|
-
if (fs.existsSync(legacyDir)) {
|
|
9586
|
-
fs.rmSync(legacyDir, {
|
|
9585
|
+
if (fs$1.existsSync(legacyDir)) {
|
|
9586
|
+
fs$1.rmSync(legacyDir, {
|
|
9587
9587
|
recursive: true,
|
|
9588
9588
|
force: true
|
|
9589
9589
|
});
|
|
@@ -9591,22 +9591,22 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9591
9591
|
}
|
|
9592
9592
|
}
|
|
9593
9593
|
listInstalled() {
|
|
9594
|
-
if (!fs.existsSync(this.addonsDir)) return [];
|
|
9594
|
+
if (!fs$1.existsSync(this.addonsDir)) return [];
|
|
9595
9595
|
const packageDirs = [];
|
|
9596
|
-
for (const entry of fs.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9596
|
+
for (const entry of fs$1.readdirSync(this.addonsDir, { withFileTypes: true })) {
|
|
9597
9597
|
if (!isDirEntry(entry, this.addonsDir)) continue;
|
|
9598
9598
|
if (entry.name.startsWith("@")) {
|
|
9599
9599
|
const scopeDir = path$1.join(this.addonsDir, entry.name);
|
|
9600
|
-
for (const inner of fs.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9600
|
+
for (const inner of fs$1.readdirSync(scopeDir, { withFileTypes: true })) if (isDirEntry(inner, scopeDir)) packageDirs.push(path$1.join(scopeDir, inner.name));
|
|
9601
9601
|
} else packageDirs.push(path$1.join(this.addonsDir, entry.name));
|
|
9602
9602
|
}
|
|
9603
9603
|
return packageDirs.map((dir) => {
|
|
9604
9604
|
const pkgPath = path$1.join(dir, "package.json");
|
|
9605
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9605
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9606
9606
|
const pkg = readPackageJson(pkgPath);
|
|
9607
9607
|
if (!pkg || !pkg.camstackAddons) return null;
|
|
9608
9608
|
const sourceFile = path$1.join(dir, ".install-source");
|
|
9609
|
-
const installSource = fs.existsSync(sourceFile) ? parseInstallSource(fs.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9609
|
+
const installSource = fs$1.existsSync(sourceFile) ? parseInstallSource(fs$1.readFileSync(sourceFile, "utf-8").trim()) : void 0;
|
|
9610
9610
|
return {
|
|
9611
9611
|
name: pkg.name,
|
|
9612
9612
|
version: pkg.version,
|
|
@@ -9616,13 +9616,13 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9616
9616
|
}).filter((item) => item !== null);
|
|
9617
9617
|
}
|
|
9618
9618
|
isInstalled(packageName) {
|
|
9619
|
-
if (fs.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9620
|
-
return fs.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9619
|
+
if (fs$1.existsSync(path$1.join(this.addonsDir, packageName, "package.json"))) return true;
|
|
9620
|
+
return fs$1.existsSync(path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json"));
|
|
9621
9621
|
}
|
|
9622
9622
|
getInstalledPackage(packageName) {
|
|
9623
9623
|
let pkgPath = path$1.join(this.addonsDir, packageName, "package.json");
|
|
9624
|
-
if (!fs.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9625
|
-
if (!fs.existsSync(pkgPath)) return null;
|
|
9624
|
+
if (!fs$1.existsSync(pkgPath)) pkgPath = path$1.join(this.addonsDir, packageName.replace(/^@[^/]+\//, ""), "package.json");
|
|
9625
|
+
if (!fs$1.existsSync(pkgPath)) return null;
|
|
9626
9626
|
const pkg = readPackageJson(pkgPath);
|
|
9627
9627
|
if (!pkg) return null;
|
|
9628
9628
|
return {
|
|
@@ -9641,7 +9641,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9641
9641
|
]) {
|
|
9642
9642
|
const candidate = path$1.join(this.bundledAddonsDir, dirName);
|
|
9643
9643
|
try {
|
|
9644
|
-
const pkg = asJsonObject$1(parseJsonUnknown(fs.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9644
|
+
const pkg = asJsonObject$1(parseJsonUnknown(fs$1.readFileSync(path$1.join(candidate, "package.json"), "utf-8")));
|
|
9645
9645
|
if (pkg && asString$1(pkg["name"]) === packageName) return candidate;
|
|
9646
9646
|
} catch {}
|
|
9647
9647
|
}
|
|
@@ -9650,7 +9650,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9650
9650
|
/** Ensure a package is built (dist/ exists and page bundles present) */
|
|
9651
9651
|
async ensureBuilt(packageName, sourceDir, pkgData) {
|
|
9652
9652
|
const distDir = path$1.join(sourceDir, "dist");
|
|
9653
|
-
if (!(!fs.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9653
|
+
if (!(!fs$1.existsSync(distDir) || this.isDistIncomplete(pkgData, sourceDir))) return;
|
|
9654
9654
|
this.logger.info(`${packageName} — building (dist/ missing or incomplete)`);
|
|
9655
9655
|
try {
|
|
9656
9656
|
await runNpm(["run", "build"], this.npmRunOptions(sourceDir, 18e4));
|
|
@@ -9665,7 +9665,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9665
9665
|
if (!camstack?.addons) return false;
|
|
9666
9666
|
for (const addon of camstack.addons) {
|
|
9667
9667
|
if (!addon.pages) continue;
|
|
9668
|
-
for (const page of addon.pages) if (page.bundle && !fs.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9668
|
+
for (const page of addon.pages) if (page.bundle && !fs$1.existsSync(path$1.join(sourceDir, "dist", page.bundle))) return true;
|
|
9669
9669
|
}
|
|
9670
9670
|
return false;
|
|
9671
9671
|
}
|
|
@@ -9674,7 +9674,7 @@ var AddonInstaller = class AddonInstaller {
|
|
|
9674
9674
|
function isDirEntry(entry, parentDir) {
|
|
9675
9675
|
if (entry.isDirectory()) return true;
|
|
9676
9676
|
if (entry.isSymbolicLink()) try {
|
|
9677
|
-
return fs.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9677
|
+
return fs$1.statSync(path$1.join(parentDir, entry.name)).isDirectory();
|
|
9678
9678
|
} catch {
|
|
9679
9679
|
return false;
|
|
9680
9680
|
}
|
|
@@ -9773,7 +9773,7 @@ function selectAddonResidue(candidates) {
|
|
|
9773
9773
|
}
|
|
9774
9774
|
function readDeclaredName(dir) {
|
|
9775
9775
|
try {
|
|
9776
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9776
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9777
9777
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9778
9778
|
const name = parsed.name;
|
|
9779
9779
|
return typeof name === "string" ? name : null;
|
|
@@ -9783,7 +9783,7 @@ function readDeclaredName(dir) {
|
|
|
9783
9783
|
}
|
|
9784
9784
|
function readDeclaredVersion(dir) {
|
|
9785
9785
|
try {
|
|
9786
|
-
const parsed = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9786
|
+
const parsed = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
9787
9787
|
if (typeof parsed !== "object" || parsed === null) return null;
|
|
9788
9788
|
const version = parsed.version;
|
|
9789
9789
|
return typeof version === "string" ? version : null;
|
|
@@ -9793,7 +9793,7 @@ function readDeclaredVersion(dir) {
|
|
|
9793
9793
|
}
|
|
9794
9794
|
function isDirLike(p) {
|
|
9795
9795
|
try {
|
|
9796
|
-
return fs.statSync(p).isDirectory();
|
|
9796
|
+
return fs$1.statSync(p).isDirectory();
|
|
9797
9797
|
} catch {
|
|
9798
9798
|
return false;
|
|
9799
9799
|
}
|
|
@@ -9803,7 +9803,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9803
9803
|
const base = scope === null ? dirName : `${scope.replace("@", "")}__${dirName}`;
|
|
9804
9804
|
let candidate = path$1.join(store, base);
|
|
9805
9805
|
let n = 1;
|
|
9806
|
-
while (fs.existsSync(candidate)) {
|
|
9806
|
+
while (fs$1.existsSync(candidate)) {
|
|
9807
9807
|
candidate = path$1.join(store, `${base}-${n}`);
|
|
9808
9808
|
n += 1;
|
|
9809
9809
|
}
|
|
@@ -9820,7 +9820,7 @@ function freeQuarantineTarget(store, scope, dirName) {
|
|
|
9820
9820
|
function quarantineAddonResidue(addonsDir, log) {
|
|
9821
9821
|
const quarantined = [];
|
|
9822
9822
|
const failed = [];
|
|
9823
|
-
if (!fs.existsSync(addonsDir)) return {
|
|
9823
|
+
if (!fs$1.existsSync(addonsDir)) return {
|
|
9824
9824
|
quarantined,
|
|
9825
9825
|
failed
|
|
9826
9826
|
};
|
|
@@ -9828,7 +9828,7 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9828
9828
|
const scan = (parent, scope) => {
|
|
9829
9829
|
let names;
|
|
9830
9830
|
try {
|
|
9831
|
-
names = fs.readdirSync(parent);
|
|
9831
|
+
names = fs$1.readdirSync(parent);
|
|
9832
9832
|
} catch {
|
|
9833
9833
|
return;
|
|
9834
9834
|
}
|
|
@@ -9847,8 +9847,8 @@ function quarantineAddonResidue(addonsDir, log) {
|
|
|
9847
9847
|
const version = readDeclaredVersion(full);
|
|
9848
9848
|
const to = freeQuarantineTarget(store, scope, dirName);
|
|
9849
9849
|
try {
|
|
9850
|
-
fs.mkdirSync(store, { recursive: true });
|
|
9851
|
-
fs.renameSync(full, to);
|
|
9850
|
+
fs$1.mkdirSync(store, { recursive: true });
|
|
9851
|
+
fs$1.renameSync(full, to);
|
|
9852
9852
|
} catch (err) {
|
|
9853
9853
|
const error = err instanceof Error ? err.message : String(err);
|
|
9854
9854
|
failed.push({
|
|
@@ -9906,11 +9906,11 @@ function getRestartMarkerPath(dataDir) {
|
|
|
9906
9906
|
* intact or no marker at all (never a half-written file).
|
|
9907
9907
|
*/
|
|
9908
9908
|
function writePendingRestart(dataDir, marker) {
|
|
9909
|
-
fs.mkdirSync(dataDir, { recursive: true });
|
|
9909
|
+
fs$1.mkdirSync(dataDir, { recursive: true });
|
|
9910
9910
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
9911
9911
|
const tmpPath = `${markerPath}.tmp`;
|
|
9912
|
-
fs.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
9913
|
-
fs.renameSync(tmpPath, markerPath);
|
|
9912
|
+
fs$1.writeFileSync(tmpPath, JSON.stringify(marker, null, 2), "utf-8");
|
|
9913
|
+
fs$1.renameSync(tmpPath, markerPath);
|
|
9914
9914
|
}
|
|
9915
9915
|
/**
|
|
9916
9916
|
* Read + consume the marker. Returns the parsed payload on success and
|
|
@@ -9935,10 +9935,10 @@ function writePendingRestart(dataDir, marker) {
|
|
|
9935
9935
|
*/
|
|
9936
9936
|
function readPendingRestart(dataDir) {
|
|
9937
9937
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
9938
|
-
if (!fs.existsSync(markerPath)) return null;
|
|
9938
|
+
if (!fs$1.existsSync(markerPath)) return null;
|
|
9939
9939
|
let raw;
|
|
9940
9940
|
try {
|
|
9941
|
-
raw = fs.readFileSync(markerPath, "utf-8");
|
|
9941
|
+
raw = fs$1.readFileSync(markerPath, "utf-8");
|
|
9942
9942
|
} catch (err) {
|
|
9943
9943
|
console.error("[restart-coordinator] Marker unreadable — leaving in place:", err);
|
|
9944
9944
|
return null;
|
|
@@ -9977,7 +9977,7 @@ function readPendingRestart(dataDir) {
|
|
|
9977
9977
|
/** Remove the marker if present. No-op if missing. */
|
|
9978
9978
|
function clearPendingRestart(dataDir) {
|
|
9979
9979
|
const markerPath = getRestartMarkerPath(dataDir);
|
|
9980
|
-
fs.rmSync(markerPath, { force: true });
|
|
9980
|
+
fs$1.rmSync(markerPath, { force: true });
|
|
9981
9981
|
}
|
|
9982
9982
|
function isRestartKind(value) {
|
|
9983
9983
|
return value === "framework-update" || value === "manual" || value === "system";
|
|
@@ -9989,7 +9989,7 @@ function scheduleSelfRestart(options = {}) {
|
|
|
9989
9989
|
const touchTarget = process.env["CAMSTACK_RESTART_TOUCH_FILE"];
|
|
9990
9990
|
if (touchTarget !== void 0 && touchTarget.length > 0) try {
|
|
9991
9991
|
const now = /* @__PURE__ */ new Date();
|
|
9992
|
-
fs.utimesSync(touchTarget, now, now);
|
|
9992
|
+
fs$1.utimesSync(touchTarget, now, now);
|
|
9993
9993
|
return;
|
|
9994
9994
|
} catch (err) {
|
|
9995
9995
|
console.error("[restart-coordinator] dev touch-reload failed; falling through to process exit:", err);
|
|
@@ -14359,11 +14359,11 @@ function applyEnvOverrides(raw) {
|
|
|
14359
14359
|
return result;
|
|
14360
14360
|
}
|
|
14361
14361
|
function loadYaml(configPath) {
|
|
14362
|
-
if (!fs.existsSync(configPath)) {
|
|
14362
|
+
if (!fs$1.existsSync(configPath)) {
|
|
14363
14363
|
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`);
|
|
14364
14364
|
return {};
|
|
14365
14365
|
}
|
|
14366
|
-
const parsed = load(fs.readFileSync(configPath, "utf-8")) ?? {};
|
|
14366
|
+
const parsed = load(fs$1.readFileSync(configPath, "utf-8")) ?? {};
|
|
14367
14367
|
console.log(`[ConfigManager] Loaded config from: ${configPath}`);
|
|
14368
14368
|
return parsed;
|
|
14369
14369
|
}
|
|
@@ -19712,6 +19712,12 @@ var RunnerOfAddon = class {
|
|
|
19712
19712
|
this.byAddon.set(addonId, runnerId);
|
|
19713
19713
|
return runnerId;
|
|
19714
19714
|
}
|
|
19715
|
+
/** The addons the spawn plan put in `runnerId` (a solo runner records itself: `[addonId]`; an addon never planned here is not listed). */
|
|
19716
|
+
addonsOf(runnerId) {
|
|
19717
|
+
const out = [];
|
|
19718
|
+
for (const [addonId, runner] of this.byAddon) if (runner === runnerId) out.push(addonId);
|
|
19719
|
+
return out;
|
|
19720
|
+
}
|
|
19715
19721
|
resolve = (addonId) => this.byAddon.get(addonId) ?? addonId;
|
|
19716
19722
|
};
|
|
19717
19723
|
//#endregion
|
|
@@ -22717,7 +22723,7 @@ async function probeVaapiInit(renderNode) {
|
|
|
22717
22723
|
*/
|
|
22718
22724
|
function safeExistsSync(path) {
|
|
22719
22725
|
try {
|
|
22720
|
-
return fs.existsSync(path);
|
|
22726
|
+
return fs$1.existsSync(path);
|
|
22721
22727
|
} catch {
|
|
22722
22728
|
return false;
|
|
22723
22729
|
}
|
|
@@ -22736,11 +22742,11 @@ function probeLinuxGpus() {
|
|
|
22736
22742
|
if (safeExistsSync("/dev/nvidia0") || safeExistsSync("/proc/driver/nvidia/version")) signals.hasNvidiaGpu = true;
|
|
22737
22743
|
try {
|
|
22738
22744
|
const drmDir = "/sys/class/drm";
|
|
22739
|
-
if (fs.existsSync(drmDir)) for (const entry of fs.readdirSync(drmDir)) {
|
|
22745
|
+
if (fs$1.existsSync(drmDir)) for (const entry of fs$1.readdirSync(drmDir)) {
|
|
22740
22746
|
if (!entry.startsWith("card")) continue;
|
|
22741
22747
|
const vendorPath = `${drmDir}/${entry}/device/vendor`;
|
|
22742
22748
|
if (!safeExistsSync(vendorPath)) continue;
|
|
22743
|
-
const vendor = fs.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22749
|
+
const vendor = fs$1.readFileSync(vendorPath, "utf8").trim().toLowerCase();
|
|
22744
22750
|
if (vendor === "0x10de") signals.hasNvidiaGpu = true;
|
|
22745
22751
|
else if (vendor === "0x1002") signals.hasAmdGpu = true;
|
|
22746
22752
|
else if (vendor === "0x8086") signals.hasIntelGpu = true;
|
|
@@ -22958,21 +22964,21 @@ function sleep$1(ms) {
|
|
|
22958
22964
|
* crashed holder) is stolen.
|
|
22959
22965
|
*/
|
|
22960
22966
|
async function withFileLock(lockPath, fn) {
|
|
22961
|
-
fs.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22967
|
+
fs$1.mkdirSync(join(lockPath, ".."), { recursive: true });
|
|
22962
22968
|
for (;;) try {
|
|
22963
|
-
const fd = fs.openSync(lockPath, "wx");
|
|
22964
|
-
fs.closeSync(fd);
|
|
22969
|
+
const fd = fs$1.openSync(lockPath, "wx");
|
|
22970
|
+
fs$1.closeSync(fd);
|
|
22965
22971
|
break;
|
|
22966
22972
|
} catch {
|
|
22967
22973
|
try {
|
|
22968
|
-
if (Date.now() - fs.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs.rmSync(lockPath, { force: true });
|
|
22974
|
+
if (Date.now() - fs$1.statSync(lockPath).mtimeMs > LOCK_STALE_MS) fs$1.rmSync(lockPath, { force: true });
|
|
22969
22975
|
else await sleep$1(LOCK_POLL_MS);
|
|
22970
22976
|
} catch {}
|
|
22971
22977
|
}
|
|
22972
22978
|
try {
|
|
22973
22979
|
return await fn();
|
|
22974
22980
|
} finally {
|
|
22975
|
-
fs.rmSync(lockPath, { force: true });
|
|
22981
|
+
fs$1.rmSync(lockPath, { force: true });
|
|
22976
22982
|
}
|
|
22977
22983
|
}
|
|
22978
22984
|
/** Coalesce in-process + serialize cross-process for one binary id. */
|
|
@@ -23030,7 +23036,7 @@ var AddonDepsManager = class {
|
|
|
23030
23036
|
* failed or tampered download throws, and provisioning reports it.
|
|
23031
23037
|
*/
|
|
23032
23038
|
async stageNativeDepsDeclaredBy(requirementsFile) {
|
|
23033
|
-
if (!declaresEdgetpuDelegate(fs.readFileSync(requirementsFile, "utf8"))) return;
|
|
23039
|
+
if (!declaresEdgetpuDelegate(fs$1.readFileSync(requirementsFile, "utf8"))) return;
|
|
23034
23040
|
await singleFlight(this.depsDir, "edgetpu-delegate", () => ensureEdgetpuDelegate(this.nodeRoot, this.logger));
|
|
23035
23041
|
}
|
|
23036
23042
|
getDepsDir() {
|
|
@@ -24061,7 +24067,7 @@ async function buildAddonContext(runtime, declaration, dataDir, options) {
|
|
|
24061
24067
|
const addonId = declaration.id;
|
|
24062
24068
|
const nodeDataDir = process.env["CAMSTACK_DATA"] ?? dataDir;
|
|
24063
24069
|
const addonDataDir = path$1.resolve(nodeDataDir, "addons-data", addonId);
|
|
24064
|
-
fs.mkdirSync(addonDataDir, { recursive: true });
|
|
24070
|
+
fs$1.mkdirSync(addonDataDir, { recursive: true });
|
|
24065
24071
|
if (runtime.mode === "broker") ensureBindingSubscription(runtime.broker);
|
|
24066
24072
|
const regs = getRegistries(nodeId);
|
|
24067
24073
|
const workerResolver = {
|
|
@@ -25554,7 +25560,6 @@ var AddonHealthMonitor = class {
|
|
|
25554
25560
|
logger;
|
|
25555
25561
|
retryFn;
|
|
25556
25562
|
now;
|
|
25557
|
-
isHeldBack;
|
|
25558
25563
|
timer = null;
|
|
25559
25564
|
graceEmittedFor = false;
|
|
25560
25565
|
constructor(opts) {
|
|
@@ -25562,7 +25567,6 @@ var AddonHealthMonitor = class {
|
|
|
25562
25567
|
this.logger = opts.logger;
|
|
25563
25568
|
this.retryFn = opts.retryFn;
|
|
25564
25569
|
this.now = opts.now ?? (() => Date.now());
|
|
25565
|
-
this.isHeldBack = opts.isHeldBack ?? (() => false);
|
|
25566
25570
|
this.tickIntervalMs = opts.tickIntervalMs ?? 3e4;
|
|
25567
25571
|
this.gracePeriodMs = opts.gracePeriodMs ?? 3e5;
|
|
25568
25572
|
this.retryIntervalsMs = opts.retryIntervalsMs ?? HEALTH_MONITOR_RETRY_INTERVALS_MS;
|
|
@@ -25590,8 +25594,7 @@ var AddonHealthMonitor = class {
|
|
|
25590
25594
|
lastError: null,
|
|
25591
25595
|
nextRetryAt: null,
|
|
25592
25596
|
alertEmitted: false,
|
|
25593
|
-
retrying: false
|
|
25594
|
-
heldBack: false
|
|
25597
|
+
retrying: false
|
|
25595
25598
|
});
|
|
25596
25599
|
if (wasAlerting) this.emit(EventCategory$1.AddonLoadRecovered, {
|
|
25597
25600
|
packageName,
|
|
@@ -25606,11 +25609,6 @@ var AddonHealthMonitor = class {
|
|
|
25606
25609
|
*/
|
|
25607
25610
|
recordFailure(packageName, err, addonId) {
|
|
25608
25611
|
const existing = this.state.get(packageName);
|
|
25609
|
-
const id = addonId ?? existing?.addonId;
|
|
25610
|
-
if (id !== void 0 && this.isHeldBack(id)) {
|
|
25611
|
-
this.recordHeldBack(packageName, errMsg$1(err), id);
|
|
25612
|
-
return;
|
|
25613
|
-
}
|
|
25614
25612
|
const t = this.now();
|
|
25615
25613
|
const retryCount = (existing?.retryCount ?? 0) + 1;
|
|
25616
25614
|
const intervalIdx = Math.min(retryCount - 1, this.retryIntervalsMs.length - 1);
|
|
@@ -25629,8 +25627,7 @@ var AddonHealthMonitor = class {
|
|
|
25629
25627
|
lastError: errPayload,
|
|
25630
25628
|
nextRetryAt,
|
|
25631
25629
|
alertEmitted: existing?.alertEmitted ?? false,
|
|
25632
|
-
retrying: false
|
|
25633
|
-
heldBack: false
|
|
25630
|
+
retrying: false
|
|
25634
25631
|
};
|
|
25635
25632
|
this.state.set(packageName, next);
|
|
25636
25633
|
this.logger.warn("Addon load/init failure recorded", { meta: {
|
|
@@ -25659,39 +25656,6 @@ var AddonHealthMonitor = class {
|
|
|
25659
25656
|
}
|
|
25660
25657
|
}
|
|
25661
25658
|
/**
|
|
25662
|
-
* The spawn gate holds this addon back (its package is not yet at the version the
|
|
25663
|
-
* server requires). Not a failure: the same retry backoff is armed, so the addon
|
|
25664
|
-
* is reloaded once its package is current, but no failure is logged as a warning
|
|
25665
|
-
* and no `AddonLoadFailed` / `AddonRetryScheduled` event is emitted. A retry that
|
|
25666
|
-
* finds the gate open records success the normal way.
|
|
25667
|
-
*/
|
|
25668
|
-
recordHeldBack(packageName, reason, addonId) {
|
|
25669
|
-
const existing = this.state.get(packageName);
|
|
25670
|
-
const t = this.now();
|
|
25671
|
-
const retryCount = (existing?.retryCount ?? 0) + 1;
|
|
25672
|
-
const nextRetryAt = t + this.retryIntervalsMs[Math.min(retryCount - 1, this.retryIntervalsMs.length - 1)];
|
|
25673
|
-
this.state.set(packageName, {
|
|
25674
|
-
packageName,
|
|
25675
|
-
addonId: addonId ?? existing?.addonId,
|
|
25676
|
-
phase: "failed",
|
|
25677
|
-
retryCount,
|
|
25678
|
-
firstFailureAt: existing?.firstFailureAt ?? t,
|
|
25679
|
-
lastAttemptAt: t,
|
|
25680
|
-
lastError: { message: reason },
|
|
25681
|
-
nextRetryAt,
|
|
25682
|
-
alertEmitted: false,
|
|
25683
|
-
retrying: false,
|
|
25684
|
-
heldBack: true
|
|
25685
|
-
});
|
|
25686
|
-
this.logger.info("Addon held back by the stale gate, retry armed", { meta: {
|
|
25687
|
-
packageName,
|
|
25688
|
-
addonId: addonId ?? existing?.addonId,
|
|
25689
|
-
retryCount,
|
|
25690
|
-
nextRetryAt,
|
|
25691
|
-
reason
|
|
25692
|
-
} });
|
|
25693
|
-
}
|
|
25694
|
-
/**
|
|
25695
25659
|
* Force an immediate retry attempt for a package, resetting the
|
|
25696
25660
|
* counter back to 0 (next failure goes to the 60s interval again).
|
|
25697
25661
|
* Used by the user-facing `addons.retryLoad` tRPC procedure and by
|
|
@@ -25768,7 +25732,7 @@ var AddonHealthMonitor = class {
|
|
|
25768
25732
|
const t = this.now();
|
|
25769
25733
|
if (!this.inGracePeriod() && !this.graceEmittedFor) {
|
|
25770
25734
|
this.graceEmittedFor = true;
|
|
25771
|
-
for (const s of this.state.values()) if (s.phase === "failed" && !s.
|
|
25735
|
+
for (const s of this.state.values()) if (s.phase === "failed" && !s.alertEmitted && s.lastError) {
|
|
25772
25736
|
s.alertEmitted = true;
|
|
25773
25737
|
this.emit(EventCategory$1.AddonLoadFailed, {
|
|
25774
25738
|
packageName: s.packageName,
|
|
@@ -25815,6 +25779,138 @@ var AddonHealthMonitor = class {
|
|
|
25815
25779
|
}
|
|
25816
25780
|
};
|
|
25817
25781
|
//#endregion
|
|
25782
|
+
//#region src/kernel/unsupported-addon-tracker.ts
|
|
25783
|
+
/**
|
|
25784
|
+
* The operator alert for an addon that RUNS below the version the server needs.
|
|
25785
|
+
*
|
|
25786
|
+
* An addon whose installed package is under the running server's minimum
|
|
25787
|
+
* (`camstack.requires.addons`, or its own `requires.server`) is always started:
|
|
25788
|
+
* a held-back addon is invisible and silently loses its function, and the
|
|
25789
|
+
* `CrashSupervisor` (D6) already bounds a crash loop. What the operator needs is
|
|
25790
|
+
* to SEE it, so this tracker turns the gate's verdict into one alert pair on the
|
|
25791
|
+
* usual AlertCenter path, the way `AddonHealthMonitor` does for a load failure:
|
|
25792
|
+
*
|
|
25793
|
+
* - `AddonUnsupportedVersion` once per streak (same package, same installed
|
|
25794
|
+
* version, same unmet facts), after a short settle window so the alert
|
|
25795
|
+
* centre is subscribed even when the verdict comes from the first boot plan;
|
|
25796
|
+
* - `AddonUnsupportedResolved` when a later judgement finds the package
|
|
25797
|
+
* supported, or the node's installed set no longer holds it, which dismisses
|
|
25798
|
+
* the alert.
|
|
25799
|
+
*
|
|
25800
|
+
* One tracker per process; the verdict is re-judged on every spawn path, and
|
|
25801
|
+
* `observe` is idempotent; given the node's full installed set, a streak whose
|
|
25802
|
+
* package is no longer installed is resolved too. State is in memory: a restart raises a still-
|
|
25803
|
+
* unsupported addon once more, and AlertCenter upserts it under the same id.
|
|
25804
|
+
*/
|
|
25805
|
+
var UNSUPPORTED_ADDON_SETTLE_MS = 6e4;
|
|
25806
|
+
var UnsupportedAddonTracker = class {
|
|
25807
|
+
options;
|
|
25808
|
+
streaks = /* @__PURE__ */ new Map();
|
|
25809
|
+
settleMs;
|
|
25810
|
+
now;
|
|
25811
|
+
startedAt;
|
|
25812
|
+
timer = null;
|
|
25813
|
+
logged = /* @__PURE__ */ new Set();
|
|
25814
|
+
constructor(options) {
|
|
25815
|
+
this.options = options;
|
|
25816
|
+
this.settleMs = options.settleMs ?? 6e4;
|
|
25817
|
+
this.now = options.now ?? (() => Date.now());
|
|
25818
|
+
this.startedAt = this.now();
|
|
25819
|
+
}
|
|
25820
|
+
/**
|
|
25821
|
+
* One gate run. `judged` is every package the run looked at, `unsupported` the
|
|
25822
|
+
* subset below its minimum. A judged package with a streak that is not in
|
|
25823
|
+
* `unsupported` any more is resolved; a package this run did not judge is left alone.
|
|
25824
|
+
* `installed`, when the run saw the node's FULL package set, also resolves every
|
|
25825
|
+
* streak whose package is not in it (uninstalled).
|
|
25826
|
+
*/
|
|
25827
|
+
observe(judged, unsupported, installed) {
|
|
25828
|
+
if (installed !== void 0) {
|
|
25829
|
+
const present = new Set(installed);
|
|
25830
|
+
for (const packageName of [...this.streaks.keys()]) if (!present.has(packageName)) this.resolve(packageName);
|
|
25831
|
+
}
|
|
25832
|
+
const unsupportedNames = new Set(unsupported.map((f) => f.packageName));
|
|
25833
|
+
for (const packageName of judged) if (!unsupportedNames.has(packageName)) this.resolve(packageName);
|
|
25834
|
+
for (const facts of unsupported) this.raise(facts);
|
|
25835
|
+
this.flush();
|
|
25836
|
+
}
|
|
25837
|
+
/** Log a line the first time only (an unjudged addon is reported once, not on every judgement). */
|
|
25838
|
+
logOnce(line) {
|
|
25839
|
+
if (this.logged.has(line)) return;
|
|
25840
|
+
this.logged.add(line);
|
|
25841
|
+
this.options.log(line);
|
|
25842
|
+
}
|
|
25843
|
+
/** Stop the settle timer (shutdown). */
|
|
25844
|
+
stop() {
|
|
25845
|
+
if (this.timer !== null) clearTimeout(this.timer);
|
|
25846
|
+
this.timer = null;
|
|
25847
|
+
}
|
|
25848
|
+
raise(facts) {
|
|
25849
|
+
const existing = this.streaks.get(facts.packageName);
|
|
25850
|
+
if (existing !== void 0 && sameFacts(existing.facts, facts)) return;
|
|
25851
|
+
this.options.log(`[unsupported-addon] ${facts.addonId} (${facts.packageName}@${facts.installedVersion}) runs below what this server requires: ${facts.unmet.join("; ")}`);
|
|
25852
|
+
this.streaks.set(facts.packageName, {
|
|
25853
|
+
facts,
|
|
25854
|
+
raised: false
|
|
25855
|
+
});
|
|
25856
|
+
}
|
|
25857
|
+
resolve(packageName) {
|
|
25858
|
+
const streak = this.streaks.get(packageName);
|
|
25859
|
+
if (streak === void 0) return;
|
|
25860
|
+
this.streaks.delete(packageName);
|
|
25861
|
+
if (!streak.raised) return;
|
|
25862
|
+
this.options.log(`[unsupported-addon] ${streak.facts.addonId} (${packageName}) is supported again, alert cleared`);
|
|
25863
|
+
this.emit(EventCategory$1.AddonUnsupportedResolved, {
|
|
25864
|
+
packageName,
|
|
25865
|
+
addonId: streak.facts.addonId,
|
|
25866
|
+
nodeId: this.options.nodeId
|
|
25867
|
+
});
|
|
25868
|
+
}
|
|
25869
|
+
/** Emit every pending streak once the settle window is over; otherwise arm one timer for its end. */
|
|
25870
|
+
flush() {
|
|
25871
|
+
const remaining = this.startedAt + this.settleMs - this.now();
|
|
25872
|
+
if (remaining > 0) {
|
|
25873
|
+
if (this.timer === null && this.streaks.size > 0) {
|
|
25874
|
+
this.timer = setTimeout(() => {
|
|
25875
|
+
this.timer = null;
|
|
25876
|
+
this.flush();
|
|
25877
|
+
}, remaining);
|
|
25878
|
+
this.timer.unref();
|
|
25879
|
+
}
|
|
25880
|
+
return;
|
|
25881
|
+
}
|
|
25882
|
+
for (const streak of this.streaks.values()) {
|
|
25883
|
+
if (streak.raised) continue;
|
|
25884
|
+
streak.raised = true;
|
|
25885
|
+
const f = streak.facts;
|
|
25886
|
+
this.emit(EventCategory$1.AddonUnsupportedVersion, {
|
|
25887
|
+
packageName: f.packageName,
|
|
25888
|
+
addonId: f.addonId,
|
|
25889
|
+
nodeId: this.options.nodeId,
|
|
25890
|
+
installedVersion: f.installedVersion,
|
|
25891
|
+
requiredMinimum: f.requiredMinimum,
|
|
25892
|
+
serverVersion: f.serverVersion,
|
|
25893
|
+
unmet: [...f.unmet]
|
|
25894
|
+
});
|
|
25895
|
+
}
|
|
25896
|
+
}
|
|
25897
|
+
emit(category, data) {
|
|
25898
|
+
this.options.eventBus.emit({
|
|
25899
|
+
id: randomUUID(),
|
|
25900
|
+
timestamp: /* @__PURE__ */ new Date(),
|
|
25901
|
+
category,
|
|
25902
|
+
source: {
|
|
25903
|
+
type: "addon",
|
|
25904
|
+
id: String(data["packageName"])
|
|
25905
|
+
},
|
|
25906
|
+
data
|
|
25907
|
+
});
|
|
25908
|
+
}
|
|
25909
|
+
};
|
|
25910
|
+
function sameFacts(a, b) {
|
|
25911
|
+
return a.installedVersion === b.installedVersion && a.requiredMinimum === b.requiredMinimum && a.serverVersion === b.serverVersion && a.unmet.join("\n") === b.unmet.join("\n");
|
|
25912
|
+
}
|
|
25913
|
+
//#endregion
|
|
25818
25914
|
//#region src/kernel/moleculer/runner-refusal.ts
|
|
25819
25915
|
var REFUSED_PREFIX = "REFUSED:";
|
|
25820
25916
|
function isReport(value) {
|
|
@@ -25921,7 +26017,7 @@ var FailedRunnerRetryLedger = class {
|
|
|
25921
26017
|
function readRunnerPackageVersions(addonDirs) {
|
|
25922
26018
|
const out = {};
|
|
25923
26019
|
for (const dir of addonDirs) try {
|
|
25924
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
26020
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(dir, "package.json"), "utf-8"));
|
|
25925
26021
|
const version = typeof raw === "object" && raw !== null ? Reflect.get(raw, "version") : null;
|
|
25926
26022
|
out[dir] = typeof version === "string" && version.length > 0 ? version : null;
|
|
25927
26023
|
} catch {
|
|
@@ -25982,7 +26078,7 @@ function readAddonHeapDeclaration(spec) {
|
|
|
25982
26078
|
if (cached !== void 0) return cached;
|
|
25983
26079
|
let declaration = EMPTY_HEAP_DECLARATION;
|
|
25984
26080
|
for (const manifestPath of [path$1.join(spec.addonDir, "package.json"), path$1.join(path$1.dirname(spec.addonDir), "package.json")]) try {
|
|
25985
|
-
const raw = fs.readFileSync(manifestPath, "utf8");
|
|
26081
|
+
const raw = fs$1.readFileSync(manifestPath, "utf8");
|
|
25986
26082
|
const parsed = JSON.parse(raw);
|
|
25987
26083
|
const profile = extractHeapProfile(parsed, spec.addonId);
|
|
25988
26084
|
const maxOldSpaceMb = extractMaxOldSpaceMb(parsed, spec.addonId);
|
|
@@ -27215,17 +27311,17 @@ var JobJournal = class {
|
|
|
27215
27311
|
return path$1.join(this.jobsDir, `${id}.json`);
|
|
27216
27312
|
}
|
|
27217
27313
|
writeAtomic(filePath, data) {
|
|
27218
|
-
fs.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
27314
|
+
fs$1.mkdirSync(path$1.dirname(filePath), { recursive: true });
|
|
27219
27315
|
const tmp = `${filePath}.tmp.${process.pid}.${Date.now()}`;
|
|
27220
|
-
fs.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
27316
|
+
fs$1.writeFileSync(tmp, JSON.stringify(data, null, 2), {
|
|
27221
27317
|
encoding: "utf-8",
|
|
27222
27318
|
mode: 384
|
|
27223
27319
|
});
|
|
27224
|
-
fs.renameSync(tmp, filePath);
|
|
27320
|
+
fs$1.renameSync(tmp, filePath);
|
|
27225
27321
|
}
|
|
27226
27322
|
readIndex() {
|
|
27227
27323
|
try {
|
|
27228
|
-
const raw = JSON.parse(fs.readFileSync(this.indexPath, "utf-8"));
|
|
27324
|
+
const raw = JSON.parse(fs$1.readFileSync(this.indexPath, "utf-8"));
|
|
27229
27325
|
if (raw && Array.isArray(raw.jobIds)) return {
|
|
27230
27326
|
version: 1,
|
|
27231
27327
|
jobIds: raw.jobIds
|
|
@@ -27250,7 +27346,7 @@ var JobJournal = class {
|
|
|
27250
27346
|
}
|
|
27251
27347
|
getJob(id) {
|
|
27252
27348
|
try {
|
|
27253
|
-
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs.readFileSync(this.jobPath(id), "utf-8")));
|
|
27349
|
+
const parsed = lifecycleJobSchema.safeParse(JSON.parse(fs$1.readFileSync(this.jobPath(id), "utf-8")));
|
|
27254
27350
|
return parsed.success ? parsed.data : null;
|
|
27255
27351
|
} catch {
|
|
27256
27352
|
return null;
|
|
@@ -27315,14 +27411,14 @@ var StagingArea = class {
|
|
|
27315
27411
|
}
|
|
27316
27412
|
async fetchAndStage(input) {
|
|
27317
27413
|
const destDir = path$1.join(this.stagingDir, input.jobId, safeSegment(input.name));
|
|
27318
|
-
fs.rmSync(destDir, {
|
|
27414
|
+
fs$1.rmSync(destDir, {
|
|
27319
27415
|
recursive: true,
|
|
27320
27416
|
force: true
|
|
27321
27417
|
});
|
|
27322
27418
|
const tgz = await this.deps.fetchTarball(input.name, input.version, input.signal);
|
|
27323
27419
|
if (input.signal.aborted) throw new Error("staging aborted after fetch");
|
|
27324
27420
|
await this.deps.extract(tgz, destDir);
|
|
27325
|
-
const raw = JSON.parse(fs.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
27421
|
+
const raw = JSON.parse(fs$1.readFileSync(path$1.join(destDir, "package.json"), "utf-8"));
|
|
27326
27422
|
if (typeof raw.version !== "string" || raw.version.length === 0) throw new Error(`staging validation failed: ${input.name} staged a package.json with no version`);
|
|
27327
27423
|
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}`);
|
|
27328
27424
|
return {
|
|
@@ -27331,7 +27427,7 @@ var StagingArea = class {
|
|
|
27331
27427
|
};
|
|
27332
27428
|
}
|
|
27333
27429
|
cleanup(jobId) {
|
|
27334
|
-
fs.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
27430
|
+
fs$1.rmSync(path$1.join(this.stagingDir, jobId), {
|
|
27335
27431
|
recursive: true,
|
|
27336
27432
|
force: true
|
|
27337
27433
|
});
|
|
@@ -27346,13 +27442,13 @@ var StagingArea = class {
|
|
|
27346
27442
|
sweepOrphans() {
|
|
27347
27443
|
let entries;
|
|
27348
27444
|
try {
|
|
27349
|
-
entries = fs.readdirSync(this.stagingDir);
|
|
27445
|
+
entries = fs$1.readdirSync(this.stagingDir);
|
|
27350
27446
|
} catch {
|
|
27351
27447
|
return 0;
|
|
27352
27448
|
}
|
|
27353
27449
|
let removed = 0;
|
|
27354
27450
|
for (const name of entries) try {
|
|
27355
|
-
fs.rmSync(path$1.join(this.stagingDir, name), {
|
|
27451
|
+
fs$1.rmSync(path$1.join(this.stagingDir, name), {
|
|
27356
27452
|
recursive: true,
|
|
27357
27453
|
force: true
|
|
27358
27454
|
});
|
|
@@ -27530,7 +27626,7 @@ var LifecycleJobEngine = class {
|
|
|
27530
27626
|
* on failure → `failed`.
|
|
27531
27627
|
*/
|
|
27532
27628
|
async reconcileJob(job) {
|
|
27533
|
-
const exists = this.deps.stagedPathExists ?? ((p) => fs.existsSync(p));
|
|
27629
|
+
const exists = this.deps.stagedPathExists ?? ((p) => fs$1.existsSync(p));
|
|
27534
27630
|
for (const task of job.tasks) {
|
|
27535
27631
|
if (task.target === "framework") {
|
|
27536
27632
|
if (!this.isTerminal(task.phase)) this.skipFrameworkTask(job, task);
|
|
@@ -28171,7 +28267,7 @@ var CatalogRegistry = class {
|
|
|
28171
28267
|
const file = path$1.join(packageDir, "i18n", `${lang}.json`);
|
|
28172
28268
|
let text;
|
|
28173
28269
|
try {
|
|
28174
|
-
text = fs.readFileSync(file, "utf8");
|
|
28270
|
+
text = fs$1.readFileSync(file, "utf8");
|
|
28175
28271
|
} catch {
|
|
28176
28272
|
continue;
|
|
28177
28273
|
}
|
|
@@ -28227,4 +28323,4 @@ function resetCatalogRegistryForTests() {
|
|
|
28227
28323
|
}
|
|
28228
28324
|
//#endregion
|
|
28229
28325
|
var readAllRows = import_read_all_rows.readAllRows;
|
|
28230
|
-
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, 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, RegistryReadError, ReplEngine, RingBuffer, RunnerOfAddon, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, clearHeldInstall, 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, createMigrationApi, createMigrationApiOverContext, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createRequiresRegistry, 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, listHeldInstalls, 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, recordHeldInstall, 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 };
|
|
28326
|
+
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, 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, RegistryReadError, ReplEngine, RingBuffer, RunnerOfAddon, SERVER_AUTH_OID, SERVER_NAMESPACE, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, 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, UNSUPPORTED_ADDON_SETTLE_MS, UPLOADED_CA_FILE, USER_MANAGEMENT_INTERNAL, UdsLocalTransportClient, UdsLocalTransportServer, UnlockTicketJtiStore, UnsupportedAddonTracker, 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, clearHeldInstall, 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, createMigrationApi, createMigrationApiOverContext, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createRequiresRegistry, 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, listHeldInstalls, 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, recordHeldInstall, 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 };
|