@camstack/system 1.2.430 → 1.2.432
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-manager/device-manager.addon.js +2 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +74 -10
- package/dist/builtins/system-config/system-config.addon.mjs +74 -11
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-o5MPSlk6.js → composition-sources-CFlUdpO7.js} +1 -1
- package/dist/{composition-sources-Cw_TXEq9.mjs → composition-sources-DpbL38z3.mjs} +1 -1
- package/dist/{constants-CttE77VF.mjs → constants-B89vjrSm.mjs} +1 -1
- package/dist/{constants-BcNaVkvI.js → constants-DfP8V3eX.js} +1 -1
- package/dist/{device-ca-B-BTxeCj.mjs → device-ca-4IY98a_-.mjs} +1 -1
- package/dist/{device-ca-CKiqh2Iu.js → device-ca-BCyAPmIj.js} +1 -1
- package/dist/{dist-DxJdci75.js → dist-BCKOeWu_.js} +317 -1
- package/dist/{dist-CXG6muCR.mjs → dist-Bt8GTRHB.mjs} +317 -1
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/index.js +203 -53
- package/dist/index.mjs +198 -55
- package/dist/kernel/index.d.ts +4 -2
- package/dist/kernel/moleculer/broker-factory.d.ts +28 -2
- package/dist/kernel/moleculer/broker-transport-swap.d.ts +43 -0
- package/dist/kernel/moleculer/mesh-mtls/mesh-certificate-registry.d.ts +10 -0
- package/dist/kernel/moleculer/mesh-mtls/mesh-peer-transport.d.ts +7 -3
- package/dist/kernel/moleculer/mesh-mtls/mesh-renewal.d.ts +8 -1
- package/dist/{restore-archive-D_wBL1OO.mjs → restore-archive-Bh34W8J8.mjs} +1 -1
- package/dist/{restore-archive-CQJNoqRK.js → restore-archive-DhHH7VQp.js} +1 -1
- package/dist/{retired-settings-keys-EmDe11cP.mjs → retired-settings-keys-CmcEitC2.mjs} +1 -1
- package/dist/{retired-settings-keys-g1oifXxR.js → retired-settings-keys-u3Wwkdrq.js} +1 -1
- package/dist/{wal-maintenance-BW1LIHi0.js → wal-maintenance-ChzCPUi2.js} +0 -0
- package/dist/{wal-maintenance-vhPZLYuA.mjs → wal-maintenance-uQGuStFW.mjs} +0 -0
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { i as __require } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $r as readinessKey, Cr as ReadinessRegistry, Dr as asJsonObject$1, F as METHOD_ACCESS_MAP, Fn as scopesAllowAddon, Gt as isArrayOutputSchema, In as scopesAllowDeviceCap, Ir as emitDownForOwnedCaps, Kt as isCollectionArrayMethod, Mn as resolveMethodAuth, N as LOG_LEVEL_RANK, Nr as createEvent$1, Or as asNumber, Rr as expandCapMethods, Rt as extractNestedAddonId, Sn as procedureAuthKey, Sr as RUNTIME_DEFAULTS, Xr as parseJsonObject, Xt as isVoidInput, Y as addonSettingsCapability, Yt as isObjectInput, Zr as parseJsonUnknown, Zt as kebabToCamel$1, _n as objectInputDeclaresRequiredDeviceId, br as DEVICE_STATUS_METHOD, ei as resolveCapMount, gn as objectInputDeclaresAddonId, gr as errMsg$1, kr as asString$1, li as EventCategory$1, ni as scopeKey, nn as lifecycleJobSchema, on as logLevelAtMost, qn as supportedRuntimes, sn as looseSchema, t as ALL_CAPABILITY_DEFINITIONS, vr as DATAPLANE_SECRET_HEADER$1, wr as ReadinessTimeoutError, yr as DEVICE_SETTINGS_CONTRIBUTION_METHODS } from "./dist-
|
|
3
|
-
import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-
|
|
2
|
+
import { $r as readinessKey, Cr as ReadinessRegistry, Dr as asJsonObject$1, F as METHOD_ACCESS_MAP, Fn as scopesAllowAddon, Gt as isArrayOutputSchema, In as scopesAllowDeviceCap, Ir as emitDownForOwnedCaps, Kt as isCollectionArrayMethod, Mn as resolveMethodAuth, N as LOG_LEVEL_RANK, Nr as createEvent$1, Or as asNumber, Rr as expandCapMethods, Rt as extractNestedAddonId, Sn as procedureAuthKey, Sr as RUNTIME_DEFAULTS, Xr as parseJsonObject, Xt as isVoidInput, Y as addonSettingsCapability, Yt as isObjectInput, Zr as parseJsonUnknown, Zt as kebabToCamel$1, _n as objectInputDeclaresRequiredDeviceId, br as DEVICE_STATUS_METHOD, ei as resolveCapMount, gn as objectInputDeclaresAddonId, gr as errMsg$1, kr as asString$1, li as EventCategory$1, ni as scopeKey, nn as lifecycleJobSchema, on as logLevelAtMost, qn as supportedRuntimes, sn as looseSchema, t as ALL_CAPABILITY_DEFINITIONS, vr as DATAPLANE_SECRET_HEADER$1, wr as ReadinessTimeoutError, yr as DEVICE_SETTINGS_CONTRIBUTION_METHODS } from "./dist-Bt8GTRHB.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-4IY98a_-.mjs";
|
|
4
4
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
5
5
|
import "./builtins/alerts/index.mjs";
|
|
6
6
|
import { CalendarsAddon } from "./builtins/calendars/calendars.addon.mjs";
|
|
@@ -21,21 +21,21 @@ import "./builtins/local-auth/index.mjs";
|
|
|
21
21
|
import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index.mjs";
|
|
22
22
|
import NativeMetricsAddon, { a as NativeMetricsProvider, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
|
|
23
23
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
24
|
-
import { c as SqliteSettingsBackend, l as prefixRange } from "./wal-maintenance-
|
|
24
|
+
import { c as SqliteSettingsBackend, l as prefixRange } from "./wal-maintenance-uQGuStFW.mjs";
|
|
25
25
|
import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
26
26
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
27
27
|
import { StorageOrchestratorAddon, a as stripForwardedCaller, i as createHubCapForwardService, n as HUB_CAP_FWD_ACTION, o as buildStorageLocationRegistry, r as HUB_CAP_FWD_SERVICE, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
28
28
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
29
29
|
import { a as setProcessAgentHttpsNames, i as getProcessAgentHttpsNames, n as AGENT_HTTPS_NAMES_COLUMNS, r as AgentHttpsNames, t as AGENT_HTTPS_NAMES_COLLECTION } from "./agent-https-names-uetr4OQl.mjs";
|
|
30
|
-
import { _ as getProcessClusterSecretGate, a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, d as CLUSTER_SECRET_REF, f as CLUSTER_SECRET_REJECTED_EXIT_CODE, g as clusterSecretMatches, h as checkClusterSecret, i as MESH_CA_FIELD, m as CLUSTER_SECRET_UNAVAILABLE_TYPE, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, p as CLUSTER_SECRET_SETTINGS_KEY, u as CLUSTER_SECRET_MISMATCH_TYPE, v as hashClusterSecret, y as isClusterSecretMismatchError } from "./constants-
|
|
31
|
-
import { $ as
|
|
30
|
+
import { _ as getProcessClusterSecretGate, a as MESH_CA_KEY_REF, b as setProcessClusterSecretGate, d as CLUSTER_SECRET_REF, f as CLUSTER_SECRET_REJECTED_EXIT_CODE, g as clusterSecretMatches, h as checkClusterSecret, i as MESH_CA_FIELD, m as CLUSTER_SECRET_UNAVAILABLE_TYPE, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, p as CLUSTER_SECRET_SETTINGS_KEY, u as CLUSTER_SECRET_MISMATCH_TYPE, v as hashClusterSecret, y as isClusterSecretMismatchError } from "./constants-B89vjrSm.mjs";
|
|
31
|
+
import { $ as verifyAgentUiUnlockTicket, A as setProcessMeshCertificateRegistry, B as generateMeshCa, C as setProcessMeshTlsListenerState, D as RENEWAL_ABANDONED, E as MeshCertificateRegistry, F as requireProcessMeshCa, G as AGENT_DASHBOARD_ORIGINS_FIELD, H as issueMeshLeafForNode, I as caFingerprint, J as AGENT_UI_UNLOCK_VERSION, K as AGENT_UI_UNLOCK_DOMAIN, L as caFingerprintCompact, M as processMeshCrl, N as MeshCaKeeper, O as describeMeshLeaf, P as getProcessMeshCaState, Q as parseAgentDashboardOrigins, R as createMeshCsrPem, S as openMeshTlsWhenRevocationsLoaded, SystemConfigAddon, T as MESH_NODE_CERTIFICATES_COLUMNS, U as issueMeshLeafFromCsr, V as generateMeshKeyPair, W as loadMeshCa, X as isAllowedAgentDashboardReturnTo, Y as UnlockTicketJtiStore, Z as mintAgentUiUnlockTicket, _ as onProcessNodeRegistered, a as ServiceBroker, at as requestProcessMeshEnforcement, b as revokeMeshCertificate, c as enrollMeshNode, ct as setProcessMeshEnforcer, d as processJoinTokenJtiStore, dt as parseCidrList, et as MESH_AUTH_MODE_FIELD, f as verifyMeshJoinToken, ft as readCidrSetting, g as getProcessPeerLeaf, h as getProcessNodeMeshTransport, i as Errors, it as parseMeshAuthMode, j as MeshCrl, k as getProcessMeshCertificateRegistry, l as JoinTokenJtiStore, lt as createCidrMatcher, m as emitProcessNodeRegistered, n as MESH_TLS_PORT_HELLO_FIELD, nt as getProcessMeshAuthStatus, o as Transporters, ot as setProcessMeshAuthMode, p as dropProcessPeer, q as AGENT_UI_UNLOCK_TTL_MS, r as TlsTcpTransporter, rt as isMeshAuthMode, s as setProcessMeshTlsEnabler, st as setProcessMeshAuthStatusSource, tt as getProcessMeshAuthMode, u as mintMeshJoinToken, ut as normalizeIp, v as setProcessMeshPeerTransportLookup, w as MESH_NODE_CERTIFICATES_COLLECTION, x as getProcessMeshTlsListenerState, y as renewMeshCertificate, z as exportMeshPrivateKeyPem } from "./builtins/system-config/system-config.addon.mjs";
|
|
32
32
|
import "./builtins/system-config/index.mjs";
|
|
33
33
|
import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
|
|
34
34
|
import { C as isModelDownloaded, 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-BQnbN0DP.mjs";
|
|
35
35
|
import { A as readTlsMode, B as CA_VALIDITY_DAYS, C as registerHttpsListener, D as UPLOADED_CA_FILE, E as prepareBootTls, F as loadTlsCert, G as DEFAULT_LAN_HTTP_PORT, H as MAX_LEAF_VALIDITY_DAYS, I as reissueTlsLeaf, J as bindPendingLanHttp, K as allFamiliesListenHost, L as CA_COMMON_NAME, M as writeExtraSans, N as writeTlsMode, O as readExtraSans, P as ensureTlsCert, R as collectCertIdentity, S as leafFingerprintOf, T as servedHttpsLeafFingerprint, U as SERVER_AUTH_OID, V as LEAF_RENEWAL_WINDOW_DAYS, W as evaluateExistingCert, X as readLanHttpState, Y as closeLanHttp, Z as registerLanHttpHandler, _ as regenerateCertificate, a as collectAgentNames, b as validateUploadedTls, c as installAgentHttps, d as isPrivateAddress, f as issueAgentHttpsLeaf, g as applyCertificateToListener, h as pinnedHttpsCaFingerprint, i as certificateNames, j as splitPemCertificates, k as readTlsAccessStatus, l as isContainerBridgeAddress, m as pemDigest, n as acceptAgentSans, o as createAgentHttpsRequest, p as loadAgentHttps, q as applyLanHttp, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isLocalOnlyHostname, v as revertToGeneratedCertificate, w as reloadHttpsListener, x as clearHttpsListener, y as storeUploadedCertificate, z as systemHostFacts } from "./tls-CpcGkeJV.mjs";
|
|
36
36
|
import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
|
|
37
37
|
import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
|
|
38
|
-
import { c as BackupDecryptError, f as generateBackupKeyPair, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-
|
|
38
|
+
import { c as BackupDecryptError, f as generateBackupKeyPair, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-Bh34W8J8.mjs";
|
|
39
39
|
import { z } from "zod";
|
|
40
40
|
import * as crypto$1 from "node:crypto";
|
|
41
41
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
@@ -15051,7 +15051,7 @@ function resolveUseHostname() {
|
|
|
15051
15051
|
return process.env["CAMSTACK_MOLECULER_USE_HOSTNAME"] !== "false";
|
|
15052
15052
|
}
|
|
15053
15053
|
function createBroker(config) {
|
|
15054
|
-
const { nodeID, mode,
|
|
15054
|
+
const { nodeID, mode, logLevel = "warn", tcpPort = DEFAULT_HUB_TCP_PORT } = config;
|
|
15055
15055
|
const useHostname = resolveUseHostname();
|
|
15056
15056
|
const infraLevel = "error";
|
|
15057
15057
|
const wildcardLevel = logLevel;
|
|
@@ -15098,56 +15098,11 @@ function createBroker(config) {
|
|
|
15098
15098
|
},
|
|
15099
15099
|
metrics: metricsConfig
|
|
15100
15100
|
});
|
|
15101
|
-
const
|
|
15102
|
-
const hasMeshTls = config.meshTls !== void 0;
|
|
15103
|
-
const hubDialPort = hasMeshTls ? config.tlsPort ?? 6443 : tcpPort;
|
|
15104
|
-
if (hasMeshTls) {
|
|
15105
|
-
const urls = hubAddress !== void 0 ? normalizeHubUrl(hubAddress, hubDialPort) : void 0;
|
|
15106
|
-
return new ServiceBroker({
|
|
15107
|
-
nodeID,
|
|
15108
|
-
serializer: "MsgPack",
|
|
15109
|
-
transporter: new TlsTcpTransporter({
|
|
15110
|
-
port: agentListenPort,
|
|
15111
|
-
tlsPort: config.agentTlsListenPort ?? 6443,
|
|
15112
|
-
peerTlsPort: hubDialPort,
|
|
15113
|
-
hubOnlyPeers: true,
|
|
15114
|
-
maxPacketSize: 10 * 1024 * 1024,
|
|
15115
|
-
useHostname,
|
|
15116
|
-
debug: false,
|
|
15117
|
-
meshTls: config.meshTls,
|
|
15118
|
-
udpDiscovery: false,
|
|
15119
|
-
...urls !== void 0 ? { urls } : {}
|
|
15120
|
-
}),
|
|
15121
|
-
...config.middlewares !== void 0 ? { middlewares: [...config.middlewares] } : {},
|
|
15122
|
-
logger: {
|
|
15123
|
-
type: "Console",
|
|
15124
|
-
options: { level: {
|
|
15125
|
-
BROKER: infraLevel,
|
|
15126
|
-
TRANSPORTER: infraLevel,
|
|
15127
|
-
TRANSIT: infraLevel,
|
|
15128
|
-
REGISTRY: infraLevel,
|
|
15129
|
-
DISCOVERER: infraLevel,
|
|
15130
|
-
"**": wildcardLevel
|
|
15131
|
-
} }
|
|
15132
|
-
},
|
|
15133
|
-
metrics: metricsConfig
|
|
15134
|
-
});
|
|
15135
|
-
}
|
|
15136
|
-
const tcpOptions = {
|
|
15137
|
-
maxPacketSize: 10 * 1024 * 1024,
|
|
15138
|
-
port: agentListenPort,
|
|
15139
|
-
useHostname,
|
|
15140
|
-
debug: false
|
|
15141
|
-
};
|
|
15142
|
-
tcpOptions.udpDiscovery = false;
|
|
15143
|
-
if (hubAddress) tcpOptions.urls = normalizeHubUrl(hubAddress, tcpPort);
|
|
15101
|
+
const transport = createAgentTransport(config);
|
|
15144
15102
|
return new ServiceBroker({
|
|
15145
15103
|
nodeID,
|
|
15146
15104
|
serializer: "MsgPack",
|
|
15147
|
-
transporter:
|
|
15148
|
-
type: "TCP",
|
|
15149
|
-
options: tcpOptions
|
|
15150
|
-
},
|
|
15105
|
+
transporter: transport.kind === "tls" ? transport.transporter : transport.descriptor,
|
|
15151
15106
|
...config.middlewares !== void 0 ? { middlewares: [...config.middlewares] } : {},
|
|
15152
15107
|
logger: {
|
|
15153
15108
|
type: "Console",
|
|
@@ -15163,6 +15118,58 @@ function createBroker(config) {
|
|
|
15163
15118
|
metrics: metricsConfig
|
|
15164
15119
|
});
|
|
15165
15120
|
}
|
|
15121
|
+
/**
|
|
15122
|
+
* The transport of an agent broker, from its config. An agent with no hub address dials nobody
|
|
15123
|
+
* and stays `unconfigured` until one is set (the agent UI lists the hubs found over mDNS, D839).
|
|
15124
|
+
* There is no UDP discovery to fall back on (D843).
|
|
15125
|
+
*
|
|
15126
|
+
* The reader binds a STABLE port derived from the nodeID (not an OS-ephemeral `port: 0`). See
|
|
15127
|
+
* `deriveAgentListenPort` - this is what makes a same-nodeID kill+restart reconnect cleanly:
|
|
15128
|
+
* Moleculer never refreshes a known node's address, so the agent must return at the same address
|
|
15129
|
+
* it left from.
|
|
15130
|
+
*
|
|
15131
|
+
* Shared by `createBroker` (the first transport) and the in-place reconnect
|
|
15132
|
+
* (`broker-transport-swap.ts`, the next one): one builder, so a reconnect cannot dial differently
|
|
15133
|
+
* from a boot.
|
|
15134
|
+
*/
|
|
15135
|
+
function createAgentTransport(config) {
|
|
15136
|
+
const { nodeID, hubAddress, tcpPort = DEFAULT_HUB_TCP_PORT } = config;
|
|
15137
|
+
const useHostname = resolveUseHostname();
|
|
15138
|
+
const agentListenPort = config.agentListenPort ?? deriveAgentListenPort(nodeID);
|
|
15139
|
+
const hubDialPort = config.meshTls !== void 0 ? config.tlsPort ?? 6443 : tcpPort;
|
|
15140
|
+
if (config.meshTls !== void 0) {
|
|
15141
|
+
const urls = hubAddress !== void 0 ? normalizeHubUrl(hubAddress, hubDialPort) : void 0;
|
|
15142
|
+
return {
|
|
15143
|
+
kind: "tls",
|
|
15144
|
+
transporter: new TlsTcpTransporter({
|
|
15145
|
+
port: agentListenPort,
|
|
15146
|
+
tlsPort: config.agentTlsListenPort ?? 6443,
|
|
15147
|
+
peerTlsPort: hubDialPort,
|
|
15148
|
+
hubOnlyPeers: true,
|
|
15149
|
+
maxPacketSize: 10 * 1024 * 1024,
|
|
15150
|
+
useHostname,
|
|
15151
|
+
debug: false,
|
|
15152
|
+
meshTls: config.meshTls,
|
|
15153
|
+
udpDiscovery: false,
|
|
15154
|
+
...urls !== void 0 ? { urls } : {}
|
|
15155
|
+
})
|
|
15156
|
+
};
|
|
15157
|
+
}
|
|
15158
|
+
return {
|
|
15159
|
+
kind: "tcp",
|
|
15160
|
+
descriptor: {
|
|
15161
|
+
type: "TCP",
|
|
15162
|
+
options: {
|
|
15163
|
+
maxPacketSize: 10 * 1024 * 1024,
|
|
15164
|
+
port: agentListenPort,
|
|
15165
|
+
useHostname,
|
|
15166
|
+
debug: false,
|
|
15167
|
+
udpDiscovery: false,
|
|
15168
|
+
...hubAddress ? { urls: normalizeHubUrl(hubAddress, tcpPort) } : {}
|
|
15169
|
+
}
|
|
15170
|
+
}
|
|
15171
|
+
};
|
|
15172
|
+
}
|
|
15166
15173
|
function normalizeHubUrl(raw, defaultPort) {
|
|
15167
15174
|
const atSplit = raw.includes("@") ? raw.split("@") : null;
|
|
15168
15175
|
const nodeIdFromAt = atSplit ? atSplit[0] : null;
|
|
@@ -15178,6 +15185,142 @@ function getBrokerTlsTransporter(broker) {
|
|
|
15178
15185
|
return tx instanceof TlsTcpTransporter ? tx : null;
|
|
15179
15186
|
}
|
|
15180
15187
|
//#endregion
|
|
15188
|
+
//#region src/kernel/moleculer/broker-transport-swap.ts
|
|
15189
|
+
/**
|
|
15190
|
+
* Reconnecting a broker's TRANSPORT in place, without rebuilding the broker (D856 amendment).
|
|
15191
|
+
*
|
|
15192
|
+
* An agent changes how it dials the hub (a new hub address, a new cluster secret, a mesh leaf
|
|
15193
|
+
* swap or its rollback) by replacing its transporter. It used to stop the whole `ServiceBroker`
|
|
15194
|
+
* and build another. That threw away everything bound to the old one: the `$process` service
|
|
15195
|
+
* (whose `stopped()` SIGTERMs every runner - the "child gone" lines), `$agent-cap-fwd`,
|
|
15196
|
+
* `$agent`, the event bus, the addon services and every closure that captured the broker. The
|
|
15197
|
+
* node came back ONLINE and capless, and the hub's confirm step then failed with
|
|
15198
|
+
* "`$agent-cap-fwd.forward` is not found".
|
|
15199
|
+
*
|
|
15200
|
+
* The broker, its services, its registries and its child runners are all independent of the
|
|
15201
|
+
* wire. So only the wire is replaced: disconnect the transit, forget the remote nodes (their
|
|
15202
|
+
* connection is gone, and the next `$node.connected` is what re-runs the mesh join), install a
|
|
15203
|
+
* new transporter on the SAME transit and connect it. Children never notice; the join's settle
|
|
15204
|
+
* re-sends the full manifest (D3), which still carries every child.
|
|
15205
|
+
*/
|
|
15206
|
+
function isObject(value) {
|
|
15207
|
+
return typeof value === "object" && value !== null;
|
|
15208
|
+
}
|
|
15209
|
+
function isFunction(value) {
|
|
15210
|
+
return typeof value === "function";
|
|
15211
|
+
}
|
|
15212
|
+
/** Moleculer's d.ts hides the transit and the registry internals: check them at runtime instead. */
|
|
15213
|
+
function isWrappingBroker(value) {
|
|
15214
|
+
return isObject(value) && isFunction(Reflect.get(value, "wrapMethod")) && hasNodeCatalog(Reflect.get(value, "registry")) && "transit" in value;
|
|
15215
|
+
}
|
|
15216
|
+
/** The node catalog the swap forgets remote nodes through (private Moleculer API, pinned by a spec). */
|
|
15217
|
+
function hasNodeCatalog(registry) {
|
|
15218
|
+
if (!isObject(registry)) return false;
|
|
15219
|
+
const nodes = Reflect.get(registry, "nodes");
|
|
15220
|
+
return isObject(nodes) && isFunction(Reflect.get(nodes, "disconnected")) && isFunction(Reflect.get(nodes, "list"));
|
|
15221
|
+
}
|
|
15222
|
+
function isTransporterLike(value) {
|
|
15223
|
+
return isObject(value) && isFunction(Reflect.get(value, "init")) && isFunction(Reflect.get(value, "connect")) && isFunction(Reflect.get(value, "disconnect"));
|
|
15224
|
+
}
|
|
15225
|
+
function wrapping(broker) {
|
|
15226
|
+
if (!isWrappingBroker(broker)) throw new Error("not a Moleculer broker with a transport");
|
|
15227
|
+
return broker;
|
|
15228
|
+
}
|
|
15229
|
+
function transitOf(broker) {
|
|
15230
|
+
const transit = wrapping(broker).transit;
|
|
15231
|
+
if (transit === null || transit === void 0) throw new Error("the broker has no transport to reconnect");
|
|
15232
|
+
return transit;
|
|
15233
|
+
}
|
|
15234
|
+
/** The transporter currently installed on the broker (for identity checks). */
|
|
15235
|
+
function currentBrokerTransporter(broker) {
|
|
15236
|
+
return { tx: transitOf(broker).tx };
|
|
15237
|
+
}
|
|
15238
|
+
/** Build the transporter an {@link AgentTransport} describes (nothing is bound or dialled yet). */
|
|
15239
|
+
function buildTransporter(transport) {
|
|
15240
|
+
const tx = transport.kind === "tls" ? transport.transporter : Transporters.resolve(transport.descriptor);
|
|
15241
|
+
if (!isTransporterLike(tx)) throw new Error("the agent transport is not a Moleculer transporter");
|
|
15242
|
+
return { tx };
|
|
15243
|
+
}
|
|
15244
|
+
/**
|
|
15245
|
+
* Whether `pending` is the transporter installed on the broker right now. A reconnect that was
|
|
15246
|
+
* abandoned at its deadline and resumes later must not tear down a newer run's transport.
|
|
15247
|
+
*/
|
|
15248
|
+
function isInstalledTransporter(broker, pending) {
|
|
15249
|
+
return transitOf(broker).tx === pending.tx;
|
|
15250
|
+
}
|
|
15251
|
+
/**
|
|
15252
|
+
* Disconnect the installed transporter and forget every remote node. Forgetting is what makes the
|
|
15253
|
+
* hub's next INFO a NEW connection: `$node.connected` fires again, so the agent's mesh join re-runs
|
|
15254
|
+
* and its settle re-sends the manifest. Without it the hub would still be "available" in the local
|
|
15255
|
+
* registry and nothing would re-announce the node.
|
|
15256
|
+
*/
|
|
15257
|
+
async function disconnectBrokerTransport(broker) {
|
|
15258
|
+
const b = wrapping(broker);
|
|
15259
|
+
const transit = transitOf(broker);
|
|
15260
|
+
const leaving = transit.tx;
|
|
15261
|
+
retired.add(leaving);
|
|
15262
|
+
try {
|
|
15263
|
+
await transit.disconnect();
|
|
15264
|
+
} finally {
|
|
15265
|
+
detachListeners(leaving);
|
|
15266
|
+
for (const node of b.registry.nodes.list({ onlyAvailable: true })) if (node.id !== b.nodeID) b.registry.nodes.disconnected(node.id, false);
|
|
15267
|
+
}
|
|
15268
|
+
}
|
|
15269
|
+
/** Transporters that were disconnected or replaced: their `connect` is a no-op for good. */
|
|
15270
|
+
var retired = /* @__PURE__ */ new WeakSet();
|
|
15271
|
+
/**
|
|
15272
|
+
* The leaving transporter's writer must not keep reporting into the SHARED node catalog: a late
|
|
15273
|
+
* FIN on one of its sockets would call `nodes.disconnected` on the node the NEW transporter just
|
|
15274
|
+
* connected to.
|
|
15275
|
+
*/
|
|
15276
|
+
function detachListeners(tx) {
|
|
15277
|
+
for (const emitter of [tx.writer, tx.reader]) if (isObject(emitter) && isFunction(Reflect.get(emitter, "removeAllListeners"))) Reflect.get(emitter, "removeAllListeners").call(emitter);
|
|
15278
|
+
}
|
|
15279
|
+
/**
|
|
15280
|
+
* One connect at a time per transporter, and none for a retired or replaced one. Moleculer's connect
|
|
15281
|
+
* retry re-runs `tx.connect()` on whatever `transit.tx` is when its timer fires; a second run of
|
|
15282
|
+
* `startTcpServer` overwrites the live reader and writer, leaks the gossip interval and leaves a
|
|
15283
|
+
* listening server behind. A connect that fails is cleaned up before the retry runs.
|
|
15284
|
+
*/
|
|
15285
|
+
function guardConnect(transit, tx) {
|
|
15286
|
+
const original = tx.connect.bind(tx);
|
|
15287
|
+
let inflight = null;
|
|
15288
|
+
tx.connect = (...args) => {
|
|
15289
|
+
if (retired.has(tx) || transit.tx !== tx) return Promise.resolve();
|
|
15290
|
+
if (inflight !== null) return inflight;
|
|
15291
|
+
if (tx.connected === true) return Promise.resolve();
|
|
15292
|
+
const run = original(...args).catch(async (error) => {
|
|
15293
|
+
await Promise.resolve(tx.disconnect()).catch(() => void 0);
|
|
15294
|
+
throw error;
|
|
15295
|
+
}).finally(() => {
|
|
15296
|
+
if (inflight === run) inflight = null;
|
|
15297
|
+
});
|
|
15298
|
+
inflight = run;
|
|
15299
|
+
return run;
|
|
15300
|
+
};
|
|
15301
|
+
}
|
|
15302
|
+
/**
|
|
15303
|
+
* Install `pending` as the broker's transporter: the same wiring Moleculer's `Transit` constructor
|
|
15304
|
+
* does (init + the broker's send/receive middleware wrapping, which carries the mesh join gate).
|
|
15305
|
+
*/
|
|
15306
|
+
function installBrokerTransporter(broker, pending) {
|
|
15307
|
+
const b = wrapping(broker);
|
|
15308
|
+
const transit = transitOf(broker);
|
|
15309
|
+
const tx = pending.tx;
|
|
15310
|
+
retired.add(transit.tx);
|
|
15311
|
+
guardConnect(transit, tx);
|
|
15312
|
+
tx.init(transit, (cmd, packet) => transit.messageHandler(cmd, packet), transit.afterConnect.bind(transit));
|
|
15313
|
+
const send = b.wrapMethod("transporterSend", tx.send, tx);
|
|
15314
|
+
const receive = b.wrapMethod("transporterReceive", tx.receive, tx, { reverse: true });
|
|
15315
|
+
tx.send = send;
|
|
15316
|
+
tx.receive = receive;
|
|
15317
|
+
transit.tx = tx;
|
|
15318
|
+
}
|
|
15319
|
+
/** Connect the installed transporter (the broker's own `start()` path, minus the services). */
|
|
15320
|
+
async function connectBrokerTransport(broker) {
|
|
15321
|
+
await transitOf(broker).connect();
|
|
15322
|
+
}
|
|
15323
|
+
//#endregion
|
|
15181
15324
|
//#region src/kernel/moleculer/addon-deploy-source.ts
|
|
15182
15325
|
function isAddonDeploySource(v) {
|
|
15183
15326
|
if (!v || typeof v !== "object") return false;
|
|
@@ -26885,4 +27028,4 @@ var LifecycleJobEngine = class {
|
|
|
26885
27028
|
*/
|
|
26886
27029
|
var CAP_METHOD_NOT_IMPLEMENTED = "CAP_METHOD_NOT_IMPLEMENTED";
|
|
26887
27030
|
//#endregion
|
|
26888
|
-
export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_READINESS_SERVICE_NAME, AGENT_REGISTER_NODE_ACTION, AGENT_UI_UNLOCK_DOMAIN, AGENT_UI_UNLOCK_TTL_MS, 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, AddonRouteRegistry, AdminTokenManager, AgentHttpsInstallError, AgentHttpsNames, AgentMeshAuthenticator, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REF, CLUSTER_SECRET_REJECTED_EXIT_CODE, CLUSTER_SECRET_SETTINGS_KEY, CLUSTER_SECRET_UNAVAILABLE_TYPE, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, 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, DEFAULT_MESH_JOIN_MAX_HELD, DEFAULT_MESH_JOIN_MAX_HOLD_MS, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JWT_SIGNING_KEY_REF, JobJournal, JoinTokenJtiStore, 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, MESH_ACTION_FORBIDDEN_TYPE, MESH_AUTH_MODE_FIELD, MESH_AUTO_ENFORCE_GRACE_MS, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_JOIN_AUTHENTICATE_ACTION, MESH_JOIN_CHALLENGE_ACTION, MESH_JOIN_CHALLENGE_INVALID_TYPE, MESH_JOIN_CHALLENGE_TTL_MS, MESH_JOIN_PROTOCOL, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshJoinClient, MeshJoinHold, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, 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, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, ScopedTokenManager, 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, applyCertificateToListener, applyLanHttp, attachUserManagementInternal, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, builderMountedCapNames, caFingerprint, caFingerprintCompact, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, certificateNames, checkClusterSecret, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectAgentNames, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCidrMatcher, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, decideMeshAutoEnforce, deleteModelFromDisk, deriveAgentListenPort, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installAgentHttps, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isLocalOnlyHostname, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isPeerEventPacket, isPrivateAddress, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadAgentHttps, loadDeviceCa, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, onProcessNodeRegistered, openMeshTlsWhenRevocationsLoaded, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, pinnedHttpsCaFingerprint, prepareBootTls, prepareRestoreArchive, probePlatform, processJoinTokenJtiStore, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshCertificateRegistry, setProcessMeshEnforcer, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
|
27031
|
+
export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, AGENT_HTTPS_NAMES_COLLECTION, AGENT_HTTPS_NAMES_COLUMNS, AGENT_READINESS_SERVICE_NAME, AGENT_REGISTER_NODE_ACTION, AGENT_UI_UNLOCK_DOMAIN, AGENT_UI_UNLOCK_TTL_MS, 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, AddonRouteRegistry, AdminTokenManager, AgentHttpsInstallError, AgentHttpsNames, AgentMeshAuthenticator, AlertCenterAddon, ApiKeyManager, AuthAuditLog, AuthManager, BackupDecryptError, BackupKeyFormatError, BackupKeyMismatchError, BackupKeyRequiredError, CAP_ACTION_OVERFLOW_LABEL, CAP_ACTION_UNLABELLED, CAP_METHOD_NOT_IMPLEMENTED, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REF, CLUSTER_SECRET_REJECTED_EXIT_CODE, CLUSTER_SECRET_SETTINGS_KEY, CLUSTER_SECRET_UNAVAILABLE_TYPE, CORE_CAP_SERVICE_NAME, CalendarsAddon, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, 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, DEFAULT_MESH_JOIN_MAX_HELD, DEFAULT_MESH_JOIN_MAX_HOLD_MS, DEVICE_CA_KEY_REF, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceCaStore, DeviceCredentialManager, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FIRST_BOOT_ADMIN_PASSWORD, FIRST_BOOT_ADMIN_USERNAME, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, GET_STATUS_METHOD, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JWT_SIGNING_KEY_REF, JobJournal, JoinTokenJtiStore, 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, MESH_ACTION_FORBIDDEN_TYPE, MESH_AUTH_MODE_FIELD, MESH_AUTO_ENFORCE_GRACE_MS, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MESH_JOIN_AUTHENTICATE_ACTION, MESH_JOIN_CHALLENGE_ACTION, MESH_JOIN_CHALLENGE_INVALID_TYPE, MESH_JOIN_CHALLENGE_TTL_MS, MESH_JOIN_PROTOCOL, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MESH_NODE_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, MeshCertificateRegistry, MeshCrl, MeshJoinClient, MeshJoinHold, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PREVIOUS_LEAF_GRACE_MS, PYTHON_VERSION, 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, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, SOCKET_QUEUE_TOP_N, STALL_REPORT_MS, STALL_TICK_MS, STORE_READABLE_BOOTSTRAP_KEYS, SYSTEM_SECRET_OWNER, ScopedLogger, ScopedTokenManager, 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, applyCertificateToListener, applyLanHttp, attachUserManagementInternal, attributeStall, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildNpmChildEnv, buildStorageLocationRegistry, buildTransporter, builderMountedCapNames, caFingerprint, caFingerprintCompact, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionLabel, capActionName, capActionSuffix, capBareAction, capServiceName, certificateNames, checkClusterSecret, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectAgentNames, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, connectBrokerTransport, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, createAgentHttpsRequest, createAgentTransport, createArrayBufferCensusGate, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCapActionCensus, createCidrMatcher, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createInspectorArrayBufferCensus, createKernelHwAccel, createKernelInferenceEngine, createLocalTransport, createLoopDelayMeter, createMeshAccessMiddleware, createMeshCsrPem, createMeshQueueReader, createOutboundQueueGate, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, currentBrokerTransporter, decideMeshAutoEnforce, deleteModelFromDisk, deriveAgentListenPort, describeHttpsLeaf, describeMeshLeaf, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, disconnectBrokerTransport, downloadBinary, downloadFile, downloadModel, dropProcessPeer, emitDownForOwnedCaps, emitHeapDiagnosticReport, emitProcessNodeRegistered, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateDeviceCa, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessAgentHttpsNames, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessMeshCertificateRegistry, getProcessMeshTlsListenerState, getProcessNodeMeshTransport, getProcessPeerLeaf, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installAgentHttps, installBrokerTransporter, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isContainerBridgeAddress, isCredentialKeyName, isInfraCapability, isInstalledTransporter, isLocalOnlyHostname, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isPeerEventPacket, isPrivateAddress, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueAgentHttpsLeaf, issueDeviceLeaf, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadAgentHttps, loadDeviceCa, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, onProcessNodeRegistered, openMeshTlsWhenRevocationsLoaded, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, pemDigest, pinnedHttpsCaFingerprint, prepareBootTls, prepareRestoreArchive, probePlatform, processJoinTokenJtiStore, processJwtSigningKey, processMeshCrl, proxyToUpstream, quarantineAddonResidue, readBackupEncryptionHeader, readCidrSetting, readExtraSans, readHeapSpaces, readLanHttpState, readPendingRestart, readSocketQueues, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, redactLogEntry, redactLogMeta, redactLogText, regenerateCertificate, registerEventBusService, registerHttpsListener, registerLanHttpHandler, reissueTlsLeaf, reloadHttpsListener, renewMeshCertificate, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, revokeMeshCertificate, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessAgentHttpsNames, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshCertificateRegistry, setProcessMeshEnforcer, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setProcessMeshTlsListenerState, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, systemHostFacts, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyDeviceLeaf, verifyDeviceSignature, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
|
package/dist/kernel/index.d.ts
CHANGED
|
@@ -37,8 +37,10 @@ export type { AddonSettingsView } from "./config-manager.js";
|
|
|
37
37
|
export { DeviceRegistry } from "./device-registry.js";
|
|
38
38
|
export { buildStorageLocationRegistry } from "./storage-location-registry.js";
|
|
39
39
|
export type { StorageLocationRegistry } from "./storage-location-registry.js";
|
|
40
|
-
export { createBroker, deriveAgentListenPort, getBrokerTlsTransporter } from "./moleculer/broker-factory.js";
|
|
41
|
-
export type { BrokerConfig } from "./moleculer/broker-factory.js";
|
|
40
|
+
export { createAgentTransport, createBroker, deriveAgentListenPort, getBrokerTlsTransporter } from "./moleculer/broker-factory.js";
|
|
41
|
+
export type { AgentTransport, BrokerConfig } from "./moleculer/broker-factory.js";
|
|
42
|
+
export { buildTransporter, connectBrokerTransport, currentBrokerTransporter, disconnectBrokerTransport, installBrokerTransporter, isInstalledTransporter } from "./moleculer/broker-transport-swap.js";
|
|
43
|
+
export type { PendingTransporter } from "./moleculer/broker-transport-swap.js";
|
|
42
44
|
export { caFingerprint, caFingerprintCompact, describeMeshLeaf, dropProcessPeer, emitProcessNodeRegistered, onProcessNodeRegistered, getProcessMeshCertificateRegistry, getProcessPeerLeaf, MESH_NODE_CERTIFICATES_COLLECTION, MESH_NODE_CERTIFICATES_COLUMNS, MeshCertificateRegistry, getProcessMeshTlsListenerState, openMeshTlsWhenRevocationsLoaded, RENEWAL_ABANDONED, setProcessMeshTlsListenerState, renewMeshCertificate, revokeMeshCertificate, setProcessMeshCertificateRegistry, createMeshCsrPem, enrollMeshNode, exportMeshPrivateKeyPem, getProcessNodeMeshTransport, setProcessMeshPeerTransportLookup, generateMeshCa, generateMeshKeyPair, getProcessMeshCaState, issueMeshLeafForNode, issueMeshLeafFromCsr, JoinTokenJtiStore, loadMeshCa, MESH_CA_FIELD, MESH_CA_KEY_REF, MESH_CA_SETTINGS_KEY, MeshCaKeeper, MeshCrl, mintMeshJoinToken, processMeshCrl, processJoinTokenJtiStore, requireProcessMeshCa, setProcessMeshTlsEnabler, TlsTcpTransporter, verifyMeshJoinToken, DEFAULT_HUB_TLS_TCP_PORT, MESH_TLS_PORT_HELLO_FIELD } from "./moleculer/mesh-mtls/index.js";
|
|
43
45
|
export type { MeshCertificateRecord, MeshLeafDescription, MeshLog, MeshPeerLeaf, MeshPeers, MeshRegistrations, MeshTlsListenerState, NodeMeshClient, RenewMeshResult, RevokeMeshResult, MeshCaSigner, MeshEnrollResult, MeshPeerTransportLookup, MeshTransport, MeshJoinTokenClaims, MeshTlsMaterial } from "./moleculer/mesh-mtls/index.js";
|
|
44
46
|
export { type AddonDeploySource, isAddonDeploySource } from "./moleculer/addon-deploy-source.js";
|
|
@@ -68,8 +68,34 @@ interface BrokerConfig {
|
|
|
68
68
|
*/
|
|
69
69
|
declare function deriveAgentListenPort(nodeID: string): number;
|
|
70
70
|
declare function createBroker(config: BrokerConfig): ServiceBroker;
|
|
71
|
+
/** What an agent's transport is made of: an mTLS transporter, or the clear TCP descriptor. */
|
|
72
|
+
type AgentTransport = {
|
|
73
|
+
readonly kind: "tls";
|
|
74
|
+
readonly transporter: TlsTcpTransporter;
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: "tcp";
|
|
77
|
+
readonly descriptor: {
|
|
78
|
+
readonly type: "TCP";
|
|
79
|
+
readonly options: Record<string, unknown>;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* The transport of an agent broker, from its config. An agent with no hub address dials nobody
|
|
84
|
+
* and stays `unconfigured` until one is set (the agent UI lists the hubs found over mDNS, D839).
|
|
85
|
+
* There is no UDP discovery to fall back on (D843).
|
|
86
|
+
*
|
|
87
|
+
* The reader binds a STABLE port derived from the nodeID (not an OS-ephemeral `port: 0`). See
|
|
88
|
+
* `deriveAgentListenPort` - this is what makes a same-nodeID kill+restart reconnect cleanly:
|
|
89
|
+
* Moleculer never refreshes a known node's address, so the agent must return at the same address
|
|
90
|
+
* it left from.
|
|
91
|
+
*
|
|
92
|
+
* Shared by `createBroker` (the first transport) and the in-place reconnect
|
|
93
|
+
* (`broker-transport-swap.ts`, the next one): one builder, so a reconnect cannot dial differently
|
|
94
|
+
* from a boot.
|
|
95
|
+
*/
|
|
96
|
+
declare function createAgentTransport(config: BrokerConfig): AgentTransport;
|
|
71
97
|
declare function normalizeHubUrl(raw: string, defaultPort: number): string;
|
|
72
98
|
/** The hub's {@link TlsTcpTransporter}, or null when the broker is not mesh-TLS. */
|
|
73
99
|
declare function getBrokerTlsTransporter(broker: ServiceBroker): TlsTcpTransporter | null;
|
|
74
|
-
export { createBroker, deriveAgentListenPort, getBrokerTlsTransporter, normalizeHubUrl };
|
|
75
|
-
export type { BrokerConfig };
|
|
100
|
+
export { createAgentTransport, createBroker, deriveAgentListenPort, getBrokerTlsTransporter, normalizeHubUrl };
|
|
101
|
+
export type { AgentTransport, BrokerConfig };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { AgentTransport } from "./broker-factory.js";
|
|
2
|
+
/** The slice of a Moleculer transporter this module drives. */
|
|
3
|
+
interface TransporterLike {
|
|
4
|
+
init(transit: unknown, messageHandler: unknown, afterConnect: unknown): void;
|
|
5
|
+
send: unknown;
|
|
6
|
+
receive: unknown;
|
|
7
|
+
connected?: boolean;
|
|
8
|
+
connect(...args: unknown[]): Promise<unknown>;
|
|
9
|
+
disconnect(): Promise<unknown>;
|
|
10
|
+
/** TCP transporters keep their sockets on these; both are event emitters. */
|
|
11
|
+
reader?: unknown;
|
|
12
|
+
writer?: unknown;
|
|
13
|
+
}
|
|
14
|
+
/** Any Moleculer broker (the d.ts of `ServiceBroker` does not describe what this module drives). */
|
|
15
|
+
export type SwappableBroker = object;
|
|
16
|
+
/** A transporter built for a swap and not yet installed. */
|
|
17
|
+
export interface PendingTransporter {
|
|
18
|
+
readonly tx: TransporterLike;
|
|
19
|
+
}
|
|
20
|
+
/** The transporter currently installed on the broker (for identity checks). */
|
|
21
|
+
export declare function currentBrokerTransporter(broker: SwappableBroker): PendingTransporter;
|
|
22
|
+
/** Build the transporter an {@link AgentTransport} describes (nothing is bound or dialled yet). */
|
|
23
|
+
export declare function buildTransporter(transport: AgentTransport): PendingTransporter;
|
|
24
|
+
/**
|
|
25
|
+
* Whether `pending` is the transporter installed on the broker right now. A reconnect that was
|
|
26
|
+
* abandoned at its deadline and resumes later must not tear down a newer run's transport.
|
|
27
|
+
*/
|
|
28
|
+
export declare function isInstalledTransporter(broker: SwappableBroker, pending: PendingTransporter): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Disconnect the installed transporter and forget every remote node. Forgetting is what makes the
|
|
31
|
+
* hub's next INFO a NEW connection: `$node.connected` fires again, so the agent's mesh join re-runs
|
|
32
|
+
* and its settle re-sends the manifest. Without it the hub would still be "available" in the local
|
|
33
|
+
* registry and nothing would re-announce the node.
|
|
34
|
+
*/
|
|
35
|
+
export declare function disconnectBrokerTransport(broker: SwappableBroker): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Install `pending` as the broker's transporter: the same wiring Moleculer's `Transit` constructor
|
|
38
|
+
* does (init + the broker's send/receive middleware wrapping, which carries the mesh join gate).
|
|
39
|
+
*/
|
|
40
|
+
export declare function installBrokerTransporter(broker: SwappableBroker, pending: PendingTransporter): void;
|
|
41
|
+
/** Connect the installed transporter (the broker's own `start()` path, minus the services). */
|
|
42
|
+
export declare function connectBrokerTransport(broker: SwappableBroker): Promise<void>;
|
|
43
|
+
export {};
|
|
@@ -78,6 +78,16 @@ export declare class MeshCertificateRegistry {
|
|
|
78
78
|
*/
|
|
79
79
|
settleInterruptedRenewals(): Promise<number>;
|
|
80
80
|
/** Set a never-completed renewal leaf aside (not current, NOT on the CRL). */
|
|
81
|
+
/** Fingerprints of renewal leaves whose handover is running right now (this process only). */
|
|
82
|
+
private readonly renewalsInFlight;
|
|
83
|
+
/**
|
|
84
|
+
* A renewal's leaf is "in flight" from signing until the handover ends. While it is, a node seen
|
|
85
|
+
* presenting its OLD leaf is simply not swapped yet: the new leaf is not set aside (that would
|
|
86
|
+
* flap set-aside / reinstate on the node's first connection with it).
|
|
87
|
+
*/
|
|
88
|
+
beginRenewal(fingerprint: string): void;
|
|
89
|
+
endRenewal(fingerprint: string): void;
|
|
90
|
+
private abandonRenewalsNewerThan;
|
|
81
91
|
abandon(fingerprint: string): Promise<boolean>;
|
|
82
92
|
/** Replay every persisted revocation into `crl` (hub boot). Set-aside leaves are not revocations. */
|
|
83
93
|
restoreCrl(crl: MeshCrl): number;
|
|
@@ -28,9 +28,13 @@ export declare function getProcessNodeMeshTransport(nodeId: string): MeshTranspo
|
|
|
28
28
|
export declare function getProcessPeerLeaf(nodeId: string): MeshPeerLeaf | undefined;
|
|
29
29
|
/** Disconnect `nodeId` (closes its mutual-TLS sockets). `0` when none were open. */
|
|
30
30
|
export declare function dropProcessPeer(nodeId: string): number;
|
|
31
|
-
type RegistrationListener = (nodeId: string) => void;
|
|
31
|
+
type RegistrationListener = (nodeId: string, addonIds?: readonly string[]) => void;
|
|
32
32
|
/** Subscribe to "node X finished registering". Returns the unsubscribe. */
|
|
33
33
|
export declare function onProcessNodeRegistered(listener: RegistrationListener): () => void;
|
|
34
|
-
/**
|
|
35
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Called by the hub when a node's `registerNode` has been applied. `addonIds` is what that
|
|
36
|
+
* registration carried (a node's own addons and its children's, D3), so a waiter can tell the
|
|
37
|
+
* registration of a node that came back WHOLE from the first one of a node that lost its children.
|
|
38
|
+
*/
|
|
39
|
+
export declare function emitProcessNodeRegistered(nodeId: string, addonIds?: readonly string[]): void;
|
|
36
40
|
export {};
|
|
@@ -53,7 +53,7 @@ export interface MeshPeers {
|
|
|
53
53
|
}
|
|
54
54
|
/** "Node X finished registering" - the hub's registration completion (D3), not a poll. */
|
|
55
55
|
export interface MeshRegistrations {
|
|
56
|
-
subscribe(listener: (nodeId: string) => void): () => void;
|
|
56
|
+
subscribe(listener: (nodeId: string, addonIds?: readonly string[]) => void): () => void;
|
|
57
57
|
}
|
|
58
58
|
export interface MeshLog {
|
|
59
59
|
info(message: string, extras?: {
|
|
@@ -79,6 +79,13 @@ export interface RenewMeshDeps {
|
|
|
79
79
|
/** Registration completions: the node is usable once its manifest has landed. */
|
|
80
80
|
readonly registrations: MeshRegistrations;
|
|
81
81
|
readonly log: MeshLog;
|
|
82
|
+
/**
|
|
83
|
+
* The addon ids the hub holds for the node BEFORE the renewal (its own and its children's). The
|
|
84
|
+
* node is "back" only on a registration that carries all of them again: a registration that has
|
|
85
|
+
* lost its forked children is a node that is online and capless, not a node that came back.
|
|
86
|
+
* Absent: any registration with the new leaf counts.
|
|
87
|
+
*/
|
|
88
|
+
readonly expectedAddons?: (nodeId: string) => readonly string[];
|
|
82
89
|
/** How long to wait for the node to be back AND registered with the new leaf. */
|
|
83
90
|
readonly reconnectTimeoutMs?: number;
|
|
84
91
|
/** Gap between attempts to confirm while the node's capability is not there yet. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as DATABASE_SNAPSHOT_SUFFIX } from "./dist-
|
|
1
|
+
import { g as DATABASE_SNAPSHOT_SUFFIX } from "./dist-Bt8GTRHB.mjs";
|
|
2
2
|
import { createCipheriv, createDecipheriv, createHash, createPrivateKey, createPublicKey, diffieHellman, generateKeyPairSync, hkdfSync, randomBytes } from "node:crypto";
|
|
3
3
|
import { Buffer as Buffer$1 } from "buffer";
|
|
4
4
|
import * as fsp from "node:fs/promises";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-BCKOeWu_.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let buffer = require("buffer");
|
|
5
5
|
let node_fs_promises = require("node:fs/promises");
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/system",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.432",
|
|
4
4
|
"description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|
|
@@ -501,7 +501,7 @@
|
|
|
501
501
|
"jose": "^6.2.3",
|
|
502
502
|
"js-yaml": "^4.1.0",
|
|
503
503
|
"jsonwebtoken": "^9.0.0",
|
|
504
|
-
"moleculer": "
|
|
504
|
+
"moleculer": "0.15.0",
|
|
505
505
|
"otplib": "13.4.1",
|
|
506
506
|
"sqlite-vec": "^0.1.9",
|
|
507
507
|
"superjson": "^2.2.0",
|