@camstack/system 1.2.419 → 1.2.420

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/index.js CHANGED
@@ -15109,6 +15109,9 @@ function createBroker(config) {
15109
15109
  serializer: "MsgPack",
15110
15110
  transporter: new require_builtins_system_config_system_config_addon.TlsTcpTransporter({
15111
15111
  port: agentListenPort,
15112
+ tlsPort: config.agentTlsListenPort ?? 6443,
15113
+ peerTlsPort: hubDialPort,
15114
+ hubOnlyPeers: true,
15112
15115
  maxPacketSize: 10 * 1024 * 1024,
15113
15116
  useHostname,
15114
15117
  debug: false,
@@ -24111,6 +24114,10 @@ function createMeshAccessMiddleware(options) {
24111
24114
  const sender = senderOf(ctx);
24112
24115
  if (sender === null || sender === ownNodeId) return next.call(this, ctx);
24113
24116
  const verdict = authenticator.admitCall(sender, name);
24117
+ if (verdict.verdict === "hold") return verdict.settled.then((settled) => runAdmitted.call(this, ctx, sender, settled));
24118
+ return runAdmitted.call(this, ctx, sender, verdict);
24119
+ };
24120
+ function runAdmitted(ctx, sender, verdict) {
24114
24121
  if (verdict.verdict === "deny") {
24115
24122
  logger?.warn("mesh call refused", {
24116
24123
  sender,
@@ -24122,23 +24129,119 @@ function createMeshAccessMiddleware(options) {
24122
24129
  if (name === "$hub.unregisterNode" && paramNodeId(ctx.params) !== sender) return Promise.reject(new require_builtins_system_config_system_config_addon.Errors.MoleculerClientError(`node "${sender}" may unregister only itself`, 403, MESH_ACTION_FORBIDDEN_TYPE));
24123
24130
  ctx.params = stripForgedIdentity(name, ctx.params);
24124
24131
  return next.call(this, ctx);
24125
- };
24132
+ }
24126
24133
  },
24127
24134
  localEvent(next, event) {
24128
24135
  const name = event.name ?? "";
24129
24136
  return function meshGatedEvent(ctx) {
24130
24137
  const sender = senderOf(ctx);
24131
24138
  if (sender === null || sender === ownNodeId) return Promise.resolve(next.call(this, ctx));
24132
- if (authenticator.admitEvent(sender, name).verdict === "deny") {
24133
- noteDroppedEvent(sender, name);
24134
- return Promise.resolve();
24135
- }
24136
- return Promise.resolve(next.call(this, ctx));
24139
+ const verdict = authenticator.admitEvent(sender, name);
24140
+ const deliver = (settled) => {
24141
+ if (settled.verdict === "deny") {
24142
+ noteDroppedEvent(sender, name);
24143
+ return Promise.resolve();
24144
+ }
24145
+ return Promise.resolve(next.call(this, ctx));
24146
+ };
24147
+ return verdict.verdict === "hold" ? verdict.settled.then(deliver) : deliver(verdict);
24137
24148
  };
24138
24149
  }
24139
24150
  };
24140
24151
  }
24141
24152
  //#endregion
24153
+ //#region src/kernel/moleculer/mesh-join-hold.ts
24154
+ var DEFAULT_MESH_JOIN_MAX_HELD = 1e3;
24155
+ var DEFAULT_MESH_JOIN_MAX_HOLD_MS = 15e3;
24156
+ var MeshJoinHold = class {
24157
+ opts;
24158
+ waiters = [];
24159
+ firstHeldAt = null;
24160
+ overflow = 0;
24161
+ timer = null;
24162
+ /** Holding is open while a join is in flight; closed after a decision or the bound. */
24163
+ open = true;
24164
+ now;
24165
+ constructor(opts) {
24166
+ this.opts = opts;
24167
+ this.now = opts.now ?? Date.now;
24168
+ }
24169
+ /** Whether a request arriving now would be held (a join is in flight). */
24170
+ get holding() {
24171
+ return this.open;
24172
+ }
24173
+ /** How many requests wait right now. */
24174
+ get size() {
24175
+ return this.waiters.length;
24176
+ }
24177
+ /** A join started: hold again. */
24178
+ reopen() {
24179
+ this.open = true;
24180
+ }
24181
+ /** Hold one request; `null` when holding is closed (the caller refuses it). */
24182
+ hold(kind) {
24183
+ if (!this.open) return null;
24184
+ if (this.waiters.length >= (this.opts.maxHeld ?? 1e3)) {
24185
+ this.overflow++;
24186
+ return {
24187
+ verdict: "hold",
24188
+ settled: Promise.resolve(this.refusal("the hold before the mesh join is full"))
24189
+ };
24190
+ }
24191
+ if (this.firstHeldAt === null) {
24192
+ this.firstHeldAt = this.now();
24193
+ this.timer = setTimeout(() => this.refuse("bound"), this.opts.maxHoldMs ?? 15e3);
24194
+ this.timer.unref?.();
24195
+ }
24196
+ return {
24197
+ verdict: "hold",
24198
+ settled: new Promise((resolve) => {
24199
+ this.waiters.push({
24200
+ kind,
24201
+ resolve
24202
+ });
24203
+ })
24204
+ };
24205
+ }
24206
+ /** The join proved the hub: deliver everything held, in order. */
24207
+ release() {
24208
+ this.open = false;
24209
+ this.settle({ verdict: "allow" }, "delivered", "authenticated");
24210
+ }
24211
+ /** The join failed, or the bound ran out: refuse everything held. */
24212
+ refuse(reason) {
24213
+ this.open = false;
24214
+ this.settle(this.refusal(`the join ended "${reason}"`), "refused", reason);
24215
+ }
24216
+ refusal(why) {
24217
+ return {
24218
+ verdict: "deny",
24219
+ errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24220
+ message: `"${this.opts.hubNodeId}" sent this before the mesh join settled, and ${why}`
24221
+ };
24222
+ }
24223
+ settle(verdict, outcome, reason) {
24224
+ if (this.timer !== null) clearTimeout(this.timer);
24225
+ this.timer = null;
24226
+ const waiters = this.waiters;
24227
+ const overflow = this.overflow;
24228
+ const firstHeldAt = this.firstHeldAt;
24229
+ this.waiters = [];
24230
+ this.overflow = 0;
24231
+ this.firstHeldAt = null;
24232
+ if (waiters.length === 0 && overflow === 0) return;
24233
+ for (const w of waiters) w.resolve(verdict);
24234
+ this.opts.onReport?.({
24235
+ outcome,
24236
+ reason,
24237
+ events: waiters.filter((w) => w.kind === "event").length,
24238
+ calls: waiters.filter((w) => w.kind === "call").length,
24239
+ overflow,
24240
+ heldForMs: firstHeldAt === null ? 0 : this.now() - firstHeldAt
24241
+ });
24242
+ }
24243
+ };
24244
+ //#endregion
24142
24245
  //#region src/kernel/moleculer/agent-mesh-authenticator.ts
24143
24246
  /** The child's register action on its parent agent. */
24144
24247
  var AGENT_REGISTER_NODE_ACTION = "$agent.registerNode";
@@ -24158,10 +24261,22 @@ var AgentMeshAuthenticator = class {
24158
24261
  nodes = /* @__PURE__ */ new Map();
24159
24262
  hubNodeId;
24160
24263
  now;
24264
+ hold;
24161
24265
  constructor(deps) {
24162
24266
  this.deps = deps;
24163
24267
  this.hubNodeId = deps.hubNodeId ?? DEFAULT_HUB_NODE_ID;
24164
24268
  this.now = deps.now ?? Date.now;
24269
+ this.hold = new MeshJoinHold({
24270
+ hubNodeId: this.hubNodeId,
24271
+ now: this.now,
24272
+ ...deps.maxHeld !== void 0 ? { maxHeld: deps.maxHeld } : {},
24273
+ ...deps.maxHoldMs !== void 0 ? { maxHoldMs: deps.maxHoldMs } : {},
24274
+ ...deps.onHoldReport !== void 0 ? { onReport: deps.onHoldReport } : {}
24275
+ });
24276
+ }
24277
+ /** How many of the hub's requests wait for the join right now. */
24278
+ heldCount() {
24279
+ return this.hold.size;
24165
24280
  }
24166
24281
  /** Current mode: secret configured → enforce; else tolerate (upgrade path). */
24167
24282
  mode() {
@@ -24175,9 +24290,16 @@ var AgentMeshAuthenticator = class {
24175
24290
  noteHubJoinState(state) {
24176
24291
  if (state === "authenticated") {
24177
24292
  this.record(this.hubNodeId, "authenticated");
24293
+ this.hold.release();
24294
+ return;
24295
+ }
24296
+ if (state === "pending") {
24297
+ this.forget(this.hubNodeId);
24298
+ this.hold.reopen();
24178
24299
  return;
24179
24300
  }
24180
- if (state === "secret-mismatch" || state === "hub-unverified" || state === "pending") this.forget(this.hubNodeId);
24301
+ if (state === "secret-mismatch" || state === "hub-unverified") this.forget(this.hubNodeId);
24302
+ this.hold.refuse(state);
24181
24303
  }
24182
24304
  /** A child's `$agent.registerNode` was accepted (secret hash matched or none required). */
24183
24305
  noteChildRegistered(sender, proof = "authenticated") {
@@ -24196,11 +24318,11 @@ var AgentMeshAuthenticator = class {
24196
24318
  message: `"${action}" is not callable from another node (caller "${sender}")`
24197
24319
  };
24198
24320
  if (action === "$agent.registerNode" && isOwnChildNodeId(this.deps.ownNodeId, sender)) return { verdict: "allow" };
24199
- return this.admitSender(sender, action);
24321
+ return this.admitSender(sender, action, "call");
24200
24322
  }
24201
24323
  admitEvent(sender, eventName) {
24202
24324
  if (sender === this.deps.ownNodeId) return { verdict: "allow" };
24203
- return this.admitSender(sender, `event:${eventName}`);
24325
+ return this.admitSender(sender, `event:${eventName}`, "event");
24204
24326
  }
24205
24327
  stateOf(nodeId) {
24206
24328
  return this.nodes.get(nodeId)?.state ?? "unauthenticated";
@@ -24208,14 +24330,20 @@ var AgentMeshAuthenticator = class {
24208
24330
  authenticatedNodeIds() {
24209
24331
  return [...this.nodes].filter(([, r]) => r.state === "authenticated").map(([id]) => id);
24210
24332
  }
24211
- admitSender(sender, what) {
24333
+ admitSender(sender, what, kind) {
24212
24334
  const state = this.stateOf(sender);
24213
24335
  if (state === "authenticated" || state === "legacy") return { verdict: "allow" };
24214
- if (this.mode() === "enforced") return {
24215
- verdict: "deny",
24216
- errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24217
- message: `node "${sender}" has not authenticated to this agent — only the hub (after mutual mesh join) and this agent's own children may call it`
24218
- };
24336
+ if (this.mode() === "enforced") {
24337
+ if (sender === this.hubNodeId) {
24338
+ const held = this.hold.hold(kind);
24339
+ if (held !== null) return held;
24340
+ }
24341
+ return {
24342
+ verdict: "deny",
24343
+ errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24344
+ message: `node "${sender}" has not authenticated to this agent — only the hub (after mutual mesh join) and this agent's own children may call it`
24345
+ };
24346
+ }
24219
24347
  if (!this.nodes.has(sender)) {
24220
24348
  this.record(sender, "unauthenticated");
24221
24349
  this.deps.onTolerated?.(sender, what);
@@ -24235,6 +24363,40 @@ var AgentMeshAuthenticator = class {
24235
24363
  }
24236
24364
  };
24237
24365
  //#endregion
24366
+ //#region src/kernel/moleculer/agent-event-scope.ts
24367
+ /** Moleculer's EVENT packet type (`packets.PACKET_EVENT`). */
24368
+ var PACKET_EVENT = "EVENT";
24369
+ /** Is this an event packet addressed to a node other than the hub? */
24370
+ function isPeerEventPacket(packet, hubNodeId) {
24371
+ return packet.type === PACKET_EVENT && packet.target !== null && packet.target !== hubNodeId;
24372
+ }
24373
+ function createAgentEventScope(opts) {
24374
+ let toHub = 0;
24375
+ const withheld = /* @__PURE__ */ new Map();
24376
+ const gate = (next) => function agentEventScoped(packet) {
24377
+ if (packet.type !== PACKET_EVENT) return next(packet);
24378
+ if (!isPeerEventPacket(packet, opts.hubNodeId)) {
24379
+ if (packet.target === opts.hubNodeId) toHub++;
24380
+ return next(packet);
24381
+ }
24382
+ const peer = packet.target ?? "";
24383
+ const prev = withheld.get(peer) ?? 0;
24384
+ withheld.set(peer, prev + 1);
24385
+ if (prev === 0) opts.log?.(`mesh events: not sending events to node "${peer}" — an agent's events go to the hub only (D848)`);
24386
+ return Promise.resolve();
24387
+ };
24388
+ return {
24389
+ middleware: {
24390
+ name: "CamstackAgentEventScope",
24391
+ transitPublish: gate
24392
+ },
24393
+ stats: () => ({
24394
+ toHub,
24395
+ withheld: Object.fromEntries(withheld)
24396
+ })
24397
+ };
24398
+ }
24399
+ //#endregion
24238
24400
  //#region src/kernel/moleculer/mesh-join-client.ts
24239
24401
  /** States in which a call to the hub is refused locally. */
24240
24402
  var BLOCKING = new Set(["secret-mismatch", "hub-unverified"]);
@@ -26713,6 +26875,8 @@ exports.DEFAULT_DATA_PATH = DEFAULT_DATA_PATH;
26713
26875
  exports.DEFAULT_HUB_TLS_TCP_PORT = require_constants.DEFAULT_HUB_TLS_TCP_PORT;
26714
26876
  exports.DEFAULT_LAN_HTTP_PORT = require_tls.DEFAULT_LAN_HTTP_PORT;
26715
26877
  exports.DEFAULT_LOG_LEVEL = DEFAULT_LOG_LEVEL;
26878
+ exports.DEFAULT_MESH_JOIN_MAX_HELD = DEFAULT_MESH_JOIN_MAX_HELD;
26879
+ exports.DEFAULT_MESH_JOIN_MAX_HOLD_MS = DEFAULT_MESH_JOIN_MAX_HOLD_MS;
26716
26880
  exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS = require_dist.DEVICE_SETTINGS_CONTRIBUTION_METHODS;
26717
26881
  exports.DEVICE_STATUS_METHOD = require_dist.DEVICE_STATUS_METHOD;
26718
26882
  exports.DataPlaneRegistry = DataPlaneRegistry;
@@ -26786,11 +26950,13 @@ exports.MESH_JOIN_CHALLENGE_TTL_MS = MESH_JOIN_CHALLENGE_TTL_MS;
26786
26950
  exports.MESH_JOIN_PROTOCOL = MESH_JOIN_PROTOCOL;
26787
26951
  exports.MESH_NODE_UNAUTHENTICATED_TYPE = MESH_NODE_UNAUTHENTICATED_TYPE;
26788
26952
  exports.MESH_QUEUE_TOP_N = MESH_QUEUE_TOP_N;
26953
+ exports.MESH_TLS_PORT_HELLO_FIELD = require_builtins_system_config_system_config_addon.MESH_TLS_PORT_HELLO_FIELD;
26789
26954
  exports.METHOD_ACCESS_MAP = require_dist.METHOD_ACCESS_MAP;
26790
26955
  exports.MeshAuthenticator = MeshAuthenticator;
26791
26956
  exports.MeshCaKeeper = require_builtins_system_config_system_config_addon.MeshCaKeeper;
26792
26957
  exports.MeshCrl = require_builtins_system_config_system_config_addon.MeshCrl;
26793
26958
  exports.MeshJoinClient = MeshJoinClient;
26959
+ exports.MeshJoinHold = MeshJoinHold;
26794
26960
  exports.ModelDownloadService = require_custom_action_registry.ModelDownloadService;
26795
26961
  exports.NATIVE_PROVIDER_SERVICE_INFIX = NATIVE_PROVIDER_SERVICE_INFIX;
26796
26962
  exports.NATIVE_SCAN_DEPTH = NATIVE_SCAN_DEPTH;
@@ -26919,6 +27085,7 @@ exports.createAddonContext = createAddonContext;
26919
27085
  exports.createAddonDataPlaneFacility = createAddonDataPlaneFacility;
26920
27086
  exports.createAddonPeerBytesFacility = createAddonPeerBytesFacility;
26921
27087
  exports.createAddonService = createAddonService;
27088
+ exports.createAgentEventScope = createAgentEventScope;
26922
27089
  exports.createArrayBufferCensusGate = createArrayBufferCensusGate;
26923
27090
  exports.createAuthenticatedFileServer = require_custom_action_registry.createAuthenticatedFileServer;
26924
27091
  exports.createBroker = createBroker;
@@ -27095,6 +27262,7 @@ exports.isInfraCapability = isInfraCapability;
27095
27262
  exports.isMeshAuthMode = require_builtins_system_config_system_config_addon.isMeshAuthMode;
27096
27263
  exports.isModelDownloaded = require_custom_action_registry.isModelDownloaded;
27097
27264
  exports.isOwnChildNodeId = isOwnChildNodeId;
27265
+ exports.isPeerEventPacket = isPeerEventPacket;
27098
27266
  exports.isRemoteForbiddenAction = isRemoteForbiddenAction;
27099
27267
  exports.isRemoteForbiddenOnAgent = isRemoteForbiddenOnAgent;
27100
27268
  exports.isSettingsReadUnavailable = require_builtins_local_auth_local_auth_addon.isSettingsReadUnavailable;
package/dist/index.mjs CHANGED
@@ -26,14 +26,14 @@ import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
26
26
  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";
27
27
  import "./builtins/storage-orchestrator/index.mjs";
28
28
  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-BeQWXybC.mjs";
29
- import { A as AGENT_UI_UNLOCK_VERSION, B as parseMeshAuthMode, C as generateMeshKeyPair, D as AGENT_DASHBOARD_ORIGINS_FIELD, E as loadMeshCa, F as verifyAgentUiUnlockTicket, G as createCidrMatcher, H as setProcessMeshAuthMode, I as MESH_AUTH_MODE_FIELD, J as readCidrSetting, K as normalizeIp, L as getProcessMeshAuthMode, M as isAllowedAgentDashboardReturnTo, N as mintAgentUiUnlockTicket, O as AGENT_UI_UNLOCK_DOMAIN, P as parseAgentDashboardOrigins, R as getProcessMeshAuthStatus, S as generateMeshCa, SystemConfigAddon, T as issueMeshLeafFromCsr, U as setProcessMeshAuthStatusSource, V as requestProcessMeshEnforcement, W as setProcessMeshEnforcer, _ as requireProcessMeshCa, a as setProcessMeshTlsEnabler, b as createMeshCsrPem, c as mintMeshJoinToken, d as getProcessNodeMeshTransport, f as setProcessMeshPeerTransportLookup, g as getProcessMeshCaState, h as MeshCaKeeper, i as ServiceBroker, j as UnlockTicketJtiStore, k as AGENT_UI_UNLOCK_TTL_MS, l as processJoinTokenJtiStore, m as processMeshCrl, n as TlsTcpTransporter, o as enrollMeshNode, p as MeshCrl, q as parseCidrList, r as Errors, s as JoinTokenJtiStore, u as verifyMeshJoinToken, v as caFingerprint, w as issueMeshLeafForNode, x as exportMeshPrivateKeyPem, y as caFingerprintCompact, z as isMeshAuthMode } from "./builtins/system-config/system-config.addon.mjs";
29
+ import { A as AGENT_UI_UNLOCK_TTL_MS, B as isMeshAuthMode, C as generateMeshCa, D as loadMeshCa, E as issueMeshLeafFromCsr, F as parseAgentDashboardOrigins, G as setProcessMeshEnforcer, H as requestProcessMeshEnforcement, I as verifyAgentUiUnlockTicket, J as parseCidrList, K as createCidrMatcher, L as MESH_AUTH_MODE_FIELD, M as UnlockTicketJtiStore, N as isAllowedAgentDashboardReturnTo, O as AGENT_DASHBOARD_ORIGINS_FIELD, P as mintAgentUiUnlockTicket, R as getProcessMeshAuthMode, S as exportMeshPrivateKeyPem, SystemConfigAddon, T as issueMeshLeafForNode, U as setProcessMeshAuthMode, V as parseMeshAuthMode, W as setProcessMeshAuthStatusSource, Y as readCidrSetting, _ as getProcessMeshCaState, a as ServiceBroker, b as caFingerprintCompact, c as JoinTokenJtiStore, d as verifyMeshJoinToken, f as getProcessNodeMeshTransport, g as MeshCaKeeper, h as processMeshCrl, i as Errors, j as AGENT_UI_UNLOCK_VERSION, k as AGENT_UI_UNLOCK_DOMAIN, l as mintMeshJoinToken, m as MeshCrl, n as MESH_TLS_PORT_HELLO_FIELD, o as setProcessMeshTlsEnabler, p as setProcessMeshPeerTransportLookup, q as normalizeIp, r as TlsTcpTransporter, s as enrollMeshNode, u as processJoinTokenJtiStore, v as requireProcessMeshCa, w as generateMeshKeyPair, x as createMeshCsrPem, y as caFingerprint, z as getProcessMeshAuthStatus } from "./builtins/system-config/system-config.addon.mjs";
30
30
  import "./builtins/system-config/index.mjs";
31
31
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
32
32
  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";
33
33
  import { A as allFamiliesListenHost, C as collectCertIdentity, D as SERVER_AUTH_OID, E as MAX_LEAF_VALIDITY_DAYS, F as registerLanHttpHandler, M as bindPendingLanHttp, N as closeLanHttp, O as evaluateExistingCert, P as readLanHttpState, S as CA_COMMON_NAME, T as LEAF_RENEWAL_WINDOW_DAYS, _ as writeExtraSans, a as validateUploadedTls, b as loadTlsCert, c as registerHttpsListener, d as prepareBootTls, f as UPLOADED_CA_FILE, g as splitPemCertificates, h as readTlsMode, i as storeUploadedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, l as reloadHttpsListener, m as readTlsAccessStatus, n as regenerateCertificate, o as clearHttpsListener, p as readExtraSans, r as revertToGeneratedCertificate, s as leafFingerprintOf, t as applyCertificateToListener, u as servedHttpsLeafFingerprint, v as writeTlsMode, w as CA_VALIDITY_DAYS, x as reissueTlsLeaf, y as ensureTlsCert } from "./tls-CaOLZ09W.mjs";
34
34
  import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
35
35
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
36
- import { c as BackupKeyFormatError, d as generateBackupKeyPair, l as BackupKeyMismatchError, m as readBackupEncryptionHeader, o as SystemBackupService, r as prepareRestoreArchive, s as BackupDecryptError, t as BackupKeyRequiredError } from "./restore-archive-gGHgAZsz.mjs";
36
+ import { c as BackupKeyFormatError, d as generateBackupKeyPair, l as BackupKeyMismatchError, m as readBackupEncryptionHeader, o as SystemBackupService, r as prepareRestoreArchive, s as BackupDecryptError, t as BackupKeyRequiredError } from "./restore-archive-Bt65Em24.mjs";
37
37
  import { z } from "zod";
38
38
  import * as crypto$1 from "node:crypto";
39
39
  import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
@@ -15106,6 +15106,9 @@ function createBroker(config) {
15106
15106
  serializer: "MsgPack",
15107
15107
  transporter: new TlsTcpTransporter({
15108
15108
  port: agentListenPort,
15109
+ tlsPort: config.agentTlsListenPort ?? 6443,
15110
+ peerTlsPort: hubDialPort,
15111
+ hubOnlyPeers: true,
15109
15112
  maxPacketSize: 10 * 1024 * 1024,
15110
15113
  useHostname,
15111
15114
  debug: false,
@@ -24108,6 +24111,10 @@ function createMeshAccessMiddleware(options) {
24108
24111
  const sender = senderOf(ctx);
24109
24112
  if (sender === null || sender === ownNodeId) return next.call(this, ctx);
24110
24113
  const verdict = authenticator.admitCall(sender, name);
24114
+ if (verdict.verdict === "hold") return verdict.settled.then((settled) => runAdmitted.call(this, ctx, sender, settled));
24115
+ return runAdmitted.call(this, ctx, sender, verdict);
24116
+ };
24117
+ function runAdmitted(ctx, sender, verdict) {
24111
24118
  if (verdict.verdict === "deny") {
24112
24119
  logger?.warn("mesh call refused", {
24113
24120
  sender,
@@ -24119,23 +24126,119 @@ function createMeshAccessMiddleware(options) {
24119
24126
  if (name === "$hub.unregisterNode" && paramNodeId(ctx.params) !== sender) return Promise.reject(new Errors.MoleculerClientError(`node "${sender}" may unregister only itself`, 403, MESH_ACTION_FORBIDDEN_TYPE));
24120
24127
  ctx.params = stripForgedIdentity(name, ctx.params);
24121
24128
  return next.call(this, ctx);
24122
- };
24129
+ }
24123
24130
  },
24124
24131
  localEvent(next, event) {
24125
24132
  const name = event.name ?? "";
24126
24133
  return function meshGatedEvent(ctx) {
24127
24134
  const sender = senderOf(ctx);
24128
24135
  if (sender === null || sender === ownNodeId) return Promise.resolve(next.call(this, ctx));
24129
- if (authenticator.admitEvent(sender, name).verdict === "deny") {
24130
- noteDroppedEvent(sender, name);
24131
- return Promise.resolve();
24132
- }
24133
- return Promise.resolve(next.call(this, ctx));
24136
+ const verdict = authenticator.admitEvent(sender, name);
24137
+ const deliver = (settled) => {
24138
+ if (settled.verdict === "deny") {
24139
+ noteDroppedEvent(sender, name);
24140
+ return Promise.resolve();
24141
+ }
24142
+ return Promise.resolve(next.call(this, ctx));
24143
+ };
24144
+ return verdict.verdict === "hold" ? verdict.settled.then(deliver) : deliver(verdict);
24134
24145
  };
24135
24146
  }
24136
24147
  };
24137
24148
  }
24138
24149
  //#endregion
24150
+ //#region src/kernel/moleculer/mesh-join-hold.ts
24151
+ var DEFAULT_MESH_JOIN_MAX_HELD = 1e3;
24152
+ var DEFAULT_MESH_JOIN_MAX_HOLD_MS = 15e3;
24153
+ var MeshJoinHold = class {
24154
+ opts;
24155
+ waiters = [];
24156
+ firstHeldAt = null;
24157
+ overflow = 0;
24158
+ timer = null;
24159
+ /** Holding is open while a join is in flight; closed after a decision or the bound. */
24160
+ open = true;
24161
+ now;
24162
+ constructor(opts) {
24163
+ this.opts = opts;
24164
+ this.now = opts.now ?? Date.now;
24165
+ }
24166
+ /** Whether a request arriving now would be held (a join is in flight). */
24167
+ get holding() {
24168
+ return this.open;
24169
+ }
24170
+ /** How many requests wait right now. */
24171
+ get size() {
24172
+ return this.waiters.length;
24173
+ }
24174
+ /** A join started: hold again. */
24175
+ reopen() {
24176
+ this.open = true;
24177
+ }
24178
+ /** Hold one request; `null` when holding is closed (the caller refuses it). */
24179
+ hold(kind) {
24180
+ if (!this.open) return null;
24181
+ if (this.waiters.length >= (this.opts.maxHeld ?? 1e3)) {
24182
+ this.overflow++;
24183
+ return {
24184
+ verdict: "hold",
24185
+ settled: Promise.resolve(this.refusal("the hold before the mesh join is full"))
24186
+ };
24187
+ }
24188
+ if (this.firstHeldAt === null) {
24189
+ this.firstHeldAt = this.now();
24190
+ this.timer = setTimeout(() => this.refuse("bound"), this.opts.maxHoldMs ?? 15e3);
24191
+ this.timer.unref?.();
24192
+ }
24193
+ return {
24194
+ verdict: "hold",
24195
+ settled: new Promise((resolve) => {
24196
+ this.waiters.push({
24197
+ kind,
24198
+ resolve
24199
+ });
24200
+ })
24201
+ };
24202
+ }
24203
+ /** The join proved the hub: deliver everything held, in order. */
24204
+ release() {
24205
+ this.open = false;
24206
+ this.settle({ verdict: "allow" }, "delivered", "authenticated");
24207
+ }
24208
+ /** The join failed, or the bound ran out: refuse everything held. */
24209
+ refuse(reason) {
24210
+ this.open = false;
24211
+ this.settle(this.refusal(`the join ended "${reason}"`), "refused", reason);
24212
+ }
24213
+ refusal(why) {
24214
+ return {
24215
+ verdict: "deny",
24216
+ errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24217
+ message: `"${this.opts.hubNodeId}" sent this before the mesh join settled, and ${why}`
24218
+ };
24219
+ }
24220
+ settle(verdict, outcome, reason) {
24221
+ if (this.timer !== null) clearTimeout(this.timer);
24222
+ this.timer = null;
24223
+ const waiters = this.waiters;
24224
+ const overflow = this.overflow;
24225
+ const firstHeldAt = this.firstHeldAt;
24226
+ this.waiters = [];
24227
+ this.overflow = 0;
24228
+ this.firstHeldAt = null;
24229
+ if (waiters.length === 0 && overflow === 0) return;
24230
+ for (const w of waiters) w.resolve(verdict);
24231
+ this.opts.onReport?.({
24232
+ outcome,
24233
+ reason,
24234
+ events: waiters.filter((w) => w.kind === "event").length,
24235
+ calls: waiters.filter((w) => w.kind === "call").length,
24236
+ overflow,
24237
+ heldForMs: firstHeldAt === null ? 0 : this.now() - firstHeldAt
24238
+ });
24239
+ }
24240
+ };
24241
+ //#endregion
24139
24242
  //#region src/kernel/moleculer/agent-mesh-authenticator.ts
24140
24243
  /** The child's register action on its parent agent. */
24141
24244
  var AGENT_REGISTER_NODE_ACTION = "$agent.registerNode";
@@ -24155,10 +24258,22 @@ var AgentMeshAuthenticator = class {
24155
24258
  nodes = /* @__PURE__ */ new Map();
24156
24259
  hubNodeId;
24157
24260
  now;
24261
+ hold;
24158
24262
  constructor(deps) {
24159
24263
  this.deps = deps;
24160
24264
  this.hubNodeId = deps.hubNodeId ?? DEFAULT_HUB_NODE_ID;
24161
24265
  this.now = deps.now ?? Date.now;
24266
+ this.hold = new MeshJoinHold({
24267
+ hubNodeId: this.hubNodeId,
24268
+ now: this.now,
24269
+ ...deps.maxHeld !== void 0 ? { maxHeld: deps.maxHeld } : {},
24270
+ ...deps.maxHoldMs !== void 0 ? { maxHoldMs: deps.maxHoldMs } : {},
24271
+ ...deps.onHoldReport !== void 0 ? { onReport: deps.onHoldReport } : {}
24272
+ });
24273
+ }
24274
+ /** How many of the hub's requests wait for the join right now. */
24275
+ heldCount() {
24276
+ return this.hold.size;
24162
24277
  }
24163
24278
  /** Current mode: secret configured → enforce; else tolerate (upgrade path). */
24164
24279
  mode() {
@@ -24172,9 +24287,16 @@ var AgentMeshAuthenticator = class {
24172
24287
  noteHubJoinState(state) {
24173
24288
  if (state === "authenticated") {
24174
24289
  this.record(this.hubNodeId, "authenticated");
24290
+ this.hold.release();
24291
+ return;
24292
+ }
24293
+ if (state === "pending") {
24294
+ this.forget(this.hubNodeId);
24295
+ this.hold.reopen();
24175
24296
  return;
24176
24297
  }
24177
- if (state === "secret-mismatch" || state === "hub-unverified" || state === "pending") this.forget(this.hubNodeId);
24298
+ if (state === "secret-mismatch" || state === "hub-unverified") this.forget(this.hubNodeId);
24299
+ this.hold.refuse(state);
24178
24300
  }
24179
24301
  /** A child's `$agent.registerNode` was accepted (secret hash matched or none required). */
24180
24302
  noteChildRegistered(sender, proof = "authenticated") {
@@ -24193,11 +24315,11 @@ var AgentMeshAuthenticator = class {
24193
24315
  message: `"${action}" is not callable from another node (caller "${sender}")`
24194
24316
  };
24195
24317
  if (action === "$agent.registerNode" && isOwnChildNodeId(this.deps.ownNodeId, sender)) return { verdict: "allow" };
24196
- return this.admitSender(sender, action);
24318
+ return this.admitSender(sender, action, "call");
24197
24319
  }
24198
24320
  admitEvent(sender, eventName) {
24199
24321
  if (sender === this.deps.ownNodeId) return { verdict: "allow" };
24200
- return this.admitSender(sender, `event:${eventName}`);
24322
+ return this.admitSender(sender, `event:${eventName}`, "event");
24201
24323
  }
24202
24324
  stateOf(nodeId) {
24203
24325
  return this.nodes.get(nodeId)?.state ?? "unauthenticated";
@@ -24205,14 +24327,20 @@ var AgentMeshAuthenticator = class {
24205
24327
  authenticatedNodeIds() {
24206
24328
  return [...this.nodes].filter(([, r]) => r.state === "authenticated").map(([id]) => id);
24207
24329
  }
24208
- admitSender(sender, what) {
24330
+ admitSender(sender, what, kind) {
24209
24331
  const state = this.stateOf(sender);
24210
24332
  if (state === "authenticated" || state === "legacy") return { verdict: "allow" };
24211
- if (this.mode() === "enforced") return {
24212
- verdict: "deny",
24213
- errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24214
- message: `node "${sender}" has not authenticated to this agent — only the hub (after mutual mesh join) and this agent's own children may call it`
24215
- };
24333
+ if (this.mode() === "enforced") {
24334
+ if (sender === this.hubNodeId) {
24335
+ const held = this.hold.hold(kind);
24336
+ if (held !== null) return held;
24337
+ }
24338
+ return {
24339
+ verdict: "deny",
24340
+ errorType: MESH_NODE_UNAUTHENTICATED_TYPE,
24341
+ message: `node "${sender}" has not authenticated to this agent — only the hub (after mutual mesh join) and this agent's own children may call it`
24342
+ };
24343
+ }
24216
24344
  if (!this.nodes.has(sender)) {
24217
24345
  this.record(sender, "unauthenticated");
24218
24346
  this.deps.onTolerated?.(sender, what);
@@ -24232,6 +24360,40 @@ var AgentMeshAuthenticator = class {
24232
24360
  }
24233
24361
  };
24234
24362
  //#endregion
24363
+ //#region src/kernel/moleculer/agent-event-scope.ts
24364
+ /** Moleculer's EVENT packet type (`packets.PACKET_EVENT`). */
24365
+ var PACKET_EVENT = "EVENT";
24366
+ /** Is this an event packet addressed to a node other than the hub? */
24367
+ function isPeerEventPacket(packet, hubNodeId) {
24368
+ return packet.type === PACKET_EVENT && packet.target !== null && packet.target !== hubNodeId;
24369
+ }
24370
+ function createAgentEventScope(opts) {
24371
+ let toHub = 0;
24372
+ const withheld = /* @__PURE__ */ new Map();
24373
+ const gate = (next) => function agentEventScoped(packet) {
24374
+ if (packet.type !== PACKET_EVENT) return next(packet);
24375
+ if (!isPeerEventPacket(packet, opts.hubNodeId)) {
24376
+ if (packet.target === opts.hubNodeId) toHub++;
24377
+ return next(packet);
24378
+ }
24379
+ const peer = packet.target ?? "";
24380
+ const prev = withheld.get(peer) ?? 0;
24381
+ withheld.set(peer, prev + 1);
24382
+ if (prev === 0) opts.log?.(`mesh events: not sending events to node "${peer}" — an agent's events go to the hub only (D848)`);
24383
+ return Promise.resolve();
24384
+ };
24385
+ return {
24386
+ middleware: {
24387
+ name: "CamstackAgentEventScope",
24388
+ transitPublish: gate
24389
+ },
24390
+ stats: () => ({
24391
+ toHub,
24392
+ withheld: Object.fromEntries(withheld)
24393
+ })
24394
+ };
24395
+ }
24396
+ //#endregion
24235
24397
  //#region src/kernel/moleculer/mesh-join-client.ts
24236
24398
  /** States in which a call to the hub is refused locally. */
24237
24399
  var BLOCKING = new Set(["secret-mismatch", "hub-unverified"]);
@@ -26647,4 +26809,4 @@ var LifecycleJobEngine = class {
26647
26809
  */
26648
26810
  var CAP_METHOD_NOT_IMPLEMENTED = "CAP_METHOD_NOT_IMPLEMENTED";
26649
26811
  //#endregion
26650
- export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, 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, 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, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, 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_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, MeshCrl, MeshJoinClient, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, OUTBOUND_QUEUE_COOLDOWN_MS, OUTBOUND_QUEUE_SUSTAIN_MS, OUTBOUND_QUEUE_THRESHOLD_BYTES, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, 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, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, 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, checkClusterSecret, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, 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, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessNodeMeshTransport, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isCredentialKeyName, isInfraCapability, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, 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, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshEnforcer, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
26812
+ export { ADMIN_TOKEN_MAX_LIFETIME_MS, ADMIN_TOKEN_PREFIX, AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_DASHBOARD_ORIGINS_FIELD, 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, 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_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_CAP_ACTION_READING, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, 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_UNAUTHENTICATED_TYPE, MESH_QUEUE_TOP_N, MESH_TLS_PORT_HELLO_FIELD, METHOD_ACCESS_MAP, MeshAuthenticator, MeshCaKeeper, 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, PYTHON_VERSION, PeerAnsweredError, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, REFRESH_TOKEN_PREFIX, 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, adaptBrokerToCluster, addonSettingsCapability, adoptModelRevisions, afterWorkerOnlineAnnounce, 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, checkClusterSecret, classifyAddonDir, classifyCapRoute, clearHttpsListener, clearPendingRestart, clearPlatformKeychainKey, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, computeHubJoinProof, computeNodeJoinProof, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonPeerBytesFacility, createAddonService, createAgentEventScope, 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, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, deviceCapResolverLink, deviceOfGetStatus, diffCapActionCensus, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, enrollMeshNode, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, exportMeshPrivateKeyPem, fetchJson, findInPath, formatArrayBufferCensus, formatEventPlane, formatHeapSpaces, formatLogLine, formatMeshQueue, formatOutboundQueueVerdict, formatSocketPlane, generateBackupKeyPair, generateMeshCa, generateMeshKeyPair, getBrokerEventBus, getBrokerTlsTransporter, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPlatformKeychainKey, getProcessClusterSecretGate, getProcessJwtSigningKeyState, getProcessMeshAuthMode, getProcessMeshAuthStatus, getProcessMeshCaState, getProcessNodeMeshTransport, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getUserManagementInternal, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSpaceField, hostNodeIdOf, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isAllowedAgentDashboardReturnTo, isArrayBufferCensusReport, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isCredentialKeyName, isInfraCapability, isMeshAuthMode, isModelDownloaded, isOwnChildNodeId, isPeerEventPacket, isRemoteForbiddenAction, isRemoteForbiddenOnAgent, isSettingsReadUnavailable, isSourceNewer, isolatedBuiltinPhase, issueMeshLeafForNode, issueMeshLeafFromCsr, leafFingerprintOf, loadMeshCa, loadTlsCert, localEndpointPath, localProviderLink, localSupportedPythonRuntimes, mapSignalsToInferenceHardware, meshErrorType, mintAgentUiUnlockTicket, mintMeshJoinToken, mountNativeCapService, nextRssBudgetState, normalizeIp, overlayGetStatus, parseAgentDashboardOrigins, parseCapAction, parseCidrList, parseMeshAuthMode, parseRangeHeader, parseRssBudgetMb, parseTokenExpiry, parseTokenizedUrl, partitionIsolatedBuiltinIds, 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, requestProcessMeshEnforcement, requireProcessMeshCa, resolveFilePath, resolveFormatRevision, resolveHwAccel, resolveNpmInvocation, revertToGeneratedCertificate, revisionWeightUrl, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, servedHttpsLeafFingerprint, setHubConnected, setNodeEventInterest, setPlatformKeychainKey, setProcessClusterSecretGate, setProcessMeshAuthMode, setProcessMeshAuthStatusSource, setProcessMeshEnforcer, setProcessMeshPeerTransportLookup, setProcessMeshTlsEnabler, setWrapperActive, shouldReclaim, signalAllRunnerGroups, socketDirectionBytes, socketDirectionMessages, splitPemCertificates, stampCallerAddonId, startEventLoopStallMonitor, startHeapWatch, startRunnerHeapWatch, staticJwtSigningKey, storeMayAnswer, storeUploadedCertificate, strandedMb, stripCamstackDeps, stripForgedIdentity, stripForwardedCaller, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, verifyAgentUiUnlockTicket, verifyMeshJoinToken, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };