@camstack/server 1.2.859 → 1.2.861

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.
Files changed (95) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/trpc/generated-cap-routers.js +16 -0
  3. package/dist/core/cluster-update/cluster-update-steps.js +10 -2
  4. package/dist/server-root/index.js +1125 -45
  5. package/package.json +10 -9
  6. package/system/dist/addon-runner.js +76 -1
  7. package/system/dist/addon-runner.mjs +76 -1
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  12. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  14. package/system/dist/builtins/autotrack/index.js +1 -1
  15. package/system/dist/builtins/autotrack/index.mjs +1 -1
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  18. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  19. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  20. package/system/dist/builtins/camera-grid/index.js +1 -1
  21. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  22. package/system/dist/builtins/composer/composer.addon.js +4 -4
  23. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  24. package/system/dist/builtins/console-logging/index.js +1 -1
  25. package/system/dist/builtins/console-logging/index.mjs +1 -1
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  28. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  29. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  30. package/system/dist/builtins/device-manager/device-manager.addon.js +32 -23
  31. package/system/dist/builtins/device-manager/device-manager.addon.mjs +32 -23
  32. package/system/dist/builtins/device-manager/device-search.d.ts +4 -3
  33. package/system/dist/builtins/device-manager/removal-fence.d.ts +2 -2
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +4 -4
  37. package/system/dist/builtins/keychain/index.mjs +4 -4
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  42. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  43. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  44. package/system/dist/builtins/loki-logging/index.js +1 -1
  45. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  46. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  47. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  48. package/system/dist/builtins/platform-probe/index.js +1 -1
  49. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  50. package/system/dist/builtins/record-entries/index.js +1 -1
  51. package/system/dist/builtins/record-entries/index.mjs +1 -1
  52. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/system/dist/builtins/snapshot/index.js +1 -1
  55. package/system/dist/builtins/snapshot/index.mjs +1 -1
  56. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  57. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  61. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  62. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  63. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  65. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  66. package/system/dist/builtins/winston-logging/index.js +1 -1
  67. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  68. package/system/dist/{capture-engine-B4_fq2JB.mjs → capture-engine-B5OYzCH1.mjs} +1 -1
  69. package/system/dist/{capture-engine-yhFFC7F8.js → capture-engine-BManwD48.js} +1 -1
  70. package/system/dist/{composition-sources-BQOEYCJG.mjs → composition-sources-B8hoUx1K.mjs} +1 -1
  71. package/system/dist/{composition-sources-CKSSe5ny.js → composition-sources-DWu-IL2w.js} +1 -1
  72. package/system/dist/{constants-dfnEfsX7.js → constants-CUAopsxj.js} +1 -1
  73. package/system/dist/{constants-h8wJE_8O.mjs → constants-qDKQ7NaY.mjs} +1 -1
  74. package/system/dist/{device-ca-h54CenJx.mjs → device-ca-BOUTrISA.mjs} +1 -1
  75. package/system/dist/{device-ca-_o0-3jJ6.js → device-ca-DNrM4Ao-.js} +1 -1
  76. package/system/dist/{dist-atHH8IeD.mjs → dist-3MQdfUTG.mjs} +254 -71
  77. package/system/dist/{dist-WEGVb8qV.js → dist-B9Kzw974.js} +259 -70
  78. package/system/dist/file-host-worker.js +1 -1
  79. package/system/dist/file-host-worker.mjs +1 -1
  80. package/system/dist/{hub-identity-nIMYA24i.js → hub-identity-BQIE6w3g.js} +1 -1
  81. package/system/dist/{hub-identity-DLF698tj.mjs → hub-identity-DEbxcoVh.mjs} +1 -1
  82. package/system/dist/{hub-mdns-ciao-B6ZHStt1.js → hub-mdns-ciao-Bj_RdJiH.js} +2 -2
  83. package/system/dist/{hub-mdns-ciao-DchpUVAk.mjs → hub-mdns-ciao-BzKGywE2.mjs} +2 -2
  84. package/system/dist/index.js +84 -9
  85. package/system/dist/index.mjs +84 -9
  86. package/system/dist/kernel/moleculer/switch-toggle.d.ts +41 -0
  87. package/system/dist/{legacy-integration-rows-door-BbaIE1qF.js → legacy-integration-rows-door-CRfEC_HP.js} +1 -1
  88. package/system/dist/{legacy-integration-rows-door-DBO3ZLmn.mjs → legacy-integration-rows-door-rgL9olef.mjs} +1 -1
  89. package/system/dist/{rename-composition-block-IIfaFnEl.js → rename-composition-block-Bbt43q6n.js} +1 -1
  90. package/system/dist/{rename-composition-block-6ISzMLgj.mjs → rename-composition-block-DlgSgxch.mjs} +1 -1
  91. package/system/dist/{restore-archive-ChRNoqGg.js → restore-archive-DJBACMC0.js} +1 -1
  92. package/system/dist/{restore-archive-DeDRh7Lf.mjs → restore-archive-aQzQt2Kv.mjs} +82 -82
  93. package/system/dist/{wal-maintenance-BXj9xnDD.mjs → wal-maintenance-Bu6vjJlR.mjs} +0 -0
  94. package/system/dist/{wal-maintenance-l3CsKEaJ.js → wal-maintenance-BvIEU1r1.js} +0 -0
  95. package/system/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import { i as __require } from "./chunk-CNf5ZN-e.mjs";
2
- import { A as CatalogFileSchema, At as LOG_LEVEL_RANK, Bc as expandCapMethods, Bi as logLevelAtMost, C as CATALOG_LANGS, Dc as collectSecretMarkerRefs, Di as isVoidInput, Do as supportedRuntimes, El as userError, Er as describeUnmet, Gr as extractNestedAddonId, Hc as getDebugInterest, Ht as PackageRequiresSchema, Ic as defineRecordKinds, Il as EventCategory$1, Is as CALLER_STAMPED_CAPABILITIES$1, Lc as emitDownForOwnedCaps, Lo as unmetRequirements, Ls as DATAPLANE_SECRET_HEADER$1, Ni as lifecycleJobSchema, Oi as kebabToCamel$1, Pl as errMsg$1, Pn as bareAddonId, Rs as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Sa as procedureAuthKey, Ti as isObjectInput, Vi as looseSchema, _i as isArrayOutputSchema, a as AGENT_MDNS_SERVICE_TYPE, aa as objectInputDeclaresRequiredDeviceId, ao as scopesAllowAddon, bc as asString$1, dl as parseJsonUnknown, fi as interpolate, hl as resolveCapMount, ia as objectInputDeclaresAddonId, jc as createEvent$1, jt as METHOD_ACCESS_MAP, kl as withoutCallerStamp, nc as ReadinessRegistry, o as AGENT_MDNS_TXT_KEYS, oo as scopesAllowDeviceCap, pi as isAddonInstanceId, pl as readinessKey, qa as resolveMethodAuth, qc as isDebugChannelName, rc as ReadinessTimeoutError, rr as compareVersions, s as ALL_CAPABILITY_DEFINITIONS, tc as RUNTIME_DEFAULTS, ul as parseJsonObject, vc as asJsonObject$1, vl as scopeKey, vo as splitTranslationRef, wn as addonSettingsCapability, yc as asNumber, yi as isCollectionArrayMethod, zs as DEVICE_STATUS_METHOD } from "./dist-atHH8IeD.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-h54CenJx.mjs";
2
+ import { A as CatalogFileSchema, Al as withoutCallerStamp, At as LOG_LEVEL_RANK, Bs as DEVICE_STATUS_METHOD, C as CATALOG_LANGS, Ca as procedureAuthKey, Dl as userError, Ei as isObjectInput, Er as describeUnmet, Fl as errMsg$1, Hi as looseSchema, Ht as PackageRequiresSchema, Ja as resolveMethodAuth, Jc as isDebugChannelName, Kr as extractNestedAddonId, Lc as defineRecordKinds, Ll as EventCategory$1, Ls as CALLER_STAMPED_CAPABILITIES$1, Mc as createEvent$1, Oc as collectSecretMarkerRefs, Oi as isVoidInput, Oo as supportedRuntimes, Pi as lifecycleJobSchema, Pn as bareAddonId, Rc as emitDownForOwnedCaps, Ro as unmetRequirements, Rs as DATAPLANE_SECRET_HEADER$1, Uc as getDebugInterest, Vc as expandCapMethods, Vi as logLevelAtMost, a as AGENT_MDNS_SERVICE_TYPE, aa as objectInputDeclaresAddonId, bc as asNumber, bi as isCollectionArrayMethod, dl as parseJsonObject, fl as parseJsonUnknown, gl as resolveCapMount, ic as ReadinessTimeoutError, jt as METHOD_ACCESS_MAP, ki as kebabToCamel$1, mi as isAddonInstanceId, ml as readinessKey, nc as RUNTIME_DEFAULTS, o as AGENT_MDNS_TXT_KEYS, oa as objectInputDeclaresRequiredDeviceId, oo as scopesAllowAddon, pi as interpolate, rc as ReadinessRegistry, rr as compareVersions, s as ALL_CAPABILITY_DEFINITIONS, so as scopesAllowDeviceCap, vi as isArrayOutputSchema, wn as addonSettingsCapability, xc as asString$1, yc as asJsonObject$1, yl as scopeKey, yo as splitTranslationRef, zs as DEVICE_SETTINGS_CONTRIBUTION_METHODS } from "./dist-3MQdfUTG.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-BOUTrISA.mjs";
4
4
  import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
5
5
  import { a as redactLogText, i as redactLogMeta, r as redactLogEntry, t as isCredentialKeyName } from "./log-redactor-XLDrPzOi.mjs";
6
6
  import { AlertCenterAddon, n as lastCauseAfterChunk, r as readRunnerDisplayName, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
@@ -27,22 +27,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
27
27
  import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
28
28
  import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
29
29
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
30
- import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-BXj9xnDD.mjs";
31
- import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-DBO3ZLmn.mjs";
30
+ import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-Bu6vjJlR.mjs";
31
+ import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-rgL9olef.mjs";
32
32
  import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
33
33
  import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
34
34
  import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
35
35
  import "./builtins/storage-orchestrator/index.mjs";
36
- import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-DLF698tj.mjs";
37
- import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-h8wJE_8O.mjs";
36
+ import { A as evaluateExistingCert, B as AGENT_HTTPS_NAMES_COLLECTION, C as localCaCommonName, D as LEAF_RENEWAL_WINDOW_DAYS, E as CA_VALIDITY_DAYS, F as isConstrainedCa, H as AgentHttpsNames, I as isLocalOnlyHostname, L as permitsIdentity, M as PERMITTED_DNS_SUFFIXES, N as PERMITTED_IP_RANGES, O as MAX_LEAF_VALIDITY_DAYS, P as buildNameConstraintSet, R as permitsName, T as systemHostFacts, U as getProcessAgentHttpsNames, V as AGENT_HTTPS_NAMES_COLUMNS, W as setProcessAgentHttpsNames, _ as pemDigest, a as AgentHttpsInstallError, c as certificateNames, d as describeHttpsLeaf, f as installAgentHttps, g as loadAgentHttps, h as issueAgentHttpsLeaf, i as loadOrCreateHubId, k as SERVER_AUTH_OID, l as collectAgentNames, m as isPrivateAddress, n as HUB_IDENTITY_RELATIVE, o as acceptAgentSans, p as isContainerBridgeAddress, r as isAnnouncedHubId, s as agentHttpsPaths, t as HUB_IDENTITY_FILE, u as createAgentHttpsRequest, v as pinnedHttpsCaFingerprint, w as collectCertIdentity, y as CA_COMMON_NAME, z as readNameConstraints } from "./hub-identity-DEbxcoVh.mjs";
37
+ import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-qDKQ7NaY.mjs";
38
38
  import { $ as caFingerprint, A as emitProcessNodeRegistered, B as setProcessMeshTlsListenerState, C as verifyMembershipAnswer, Ct as parseOriginList, D as ServiceBroker, Dt as parseCidrList, E as Errors, Et as normalizeIp, F as setProcessMeshPeerTransportLookup, G as describeMeshLeaf, H as MESH_NODE_CERTIFICATES_COLUMNS, I as renewMeshCertificate, J as MeshCrl, K as getProcessMeshCertificateRegistry, L as revokeMeshCertificate, M as getProcessPeerLeaf, N as isProcessVerifiedMeshPeer, O as setProcessMeshTlsEnabler, Ot as readCidrSetting, P as onProcessNodeRegistered, Q as requireProcessMeshCa, R as getProcessMeshTlsListenerState, S as signMembershipProof, St as normalizeOrigin, SystemConfigAddon, T as TlsTcpTransporter, Tt as createCidrMatcher, U as MeshCertificateRegistry, V as MESH_NODE_CERTIFICATES_COLLECTION, W as RENEWAL_ABANDONED, X as MeshCaKeeper, Y as processMeshCrl, Z as getProcessMeshCaState, _ as keyFingerprintShort, _t as parseAgentDashboardOrigins, a as dialableHubHost, at as isValidAgentNodeId, b as MEMBERSHIP_PATHS, bt as OPAQUE_ORIGIN, c as PAIRING_MAX_CODE_ATTEMPTS, ct as loadMeshCa, d as PAIRING_PIN_DIGITS, dt as AGENT_UI_UNLOCK_TYP, et as caFingerprintCompact, f as PAIRING_PROTOCOL, ft as AGENT_UI_UNLOCK_USE, g as describeCsr, gt as mintAgentUiUnlockTicket, h as computePairingSas, ht as isAllowedAgentDashboardReturnTo, i as AgentPairing, it as generateMeshKeyPair, j as getProcessNodeMeshTransport, k as dropProcessPeer, l as PAIRING_MAX_SESSIONS, lt as AGENT_DASHBOARD_ORIGINS_FIELD, m as computePairingCommitment, mt as UnlockTicketJtiStore, n as HubPairing, nt as exportMeshPrivateKeyPem, o as hubHostFromMeshAddress, ot as issueMeshLeafForNode, p as PAIRING_TTL_MS, pt as AGENT_UI_UNLOCK_VERSION, q as setProcessMeshCertificateRegistry, r as PairingHttpError, rt as generateMeshCa, s as PAIRING_CODE_DIGITS, st as issueMeshLeafFromCsr, tt as createMeshCsrPem, u as PAIRING_PATHS, ut as AGENT_UI_UNLOCK_TTL_MS, v as signPairingProof, vt as verifyAgentUiUnlockTicket, w as MESH_TLS_PORT_HELLO_FIELD, wt as readOriginSetting, x as MembershipResponder, xt as isInsecureOrigin, y as verifyPairingProof, yt as InvalidCorsOriginError, z as openMeshTlsWhenRevocationsLoaded } from "./builtins/system-config/system-config.addon.mjs";
39
39
  import "./builtins/system-config/index.mjs";
40
40
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
41
41
  import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
42
- import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-DchpUVAk.mjs";
42
+ import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-BzKGywE2.mjs";
43
43
  import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
44
44
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
45
- import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-DeDRh7Lf.mjs";
45
+ import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-aQzQt2Kv.mjs";
46
46
  import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
47
47
  import { z } from "zod";
48
48
  import * as crypto$1 from "node:crypto";
@@ -13725,6 +13725,76 @@ function recordsTransportOf(api) {
13725
13725
  };
13726
13726
  }
13727
13727
  //#endregion
13728
+ //#region src/kernel/moleculer/switch-toggle.ts
13729
+ var REFUSAL_TEXT = {
13730
+ "no-slice": "switch has no state slice",
13731
+ stale: "switch state is unknown"
13732
+ };
13733
+ var SwitchToggleRefusedError = class extends Error {
13734
+ reason;
13735
+ deviceId;
13736
+ constructor(reason, deviceId) {
13737
+ super(`device ${deviceId}: ${REFUSAL_TEXT[reason]}; refusing to guess on or off`);
13738
+ this.name = "SwitchToggleRefusedError";
13739
+ this.reason = reason;
13740
+ this.deviceId = deviceId;
13741
+ }
13742
+ };
13743
+ /** `on` when the slice states it, otherwise the reason the toggle must refuse. */
13744
+ function classifySwitchOn(slice) {
13745
+ if (slice === void 0 || slice === null) return {
13746
+ known: false,
13747
+ reason: "no-slice"
13748
+ };
13749
+ if (typeof slice !== "object" || Array.isArray(slice)) return {
13750
+ known: false,
13751
+ reason: "stale"
13752
+ };
13753
+ const on = Reflect.get(slice, "on");
13754
+ if (typeof on !== "boolean") return {
13755
+ known: false,
13756
+ reason: "stale"
13757
+ };
13758
+ return {
13759
+ known: true,
13760
+ on
13761
+ };
13762
+ }
13763
+ function isSetState(fn) {
13764
+ return typeof fn === "function";
13765
+ }
13766
+ function refuse$1(read, deviceId, reason) {
13767
+ read.logger.warn(`switch.toggle refused: ${REFUSAL_TEXT[reason]}`, {
13768
+ tags: { deviceId },
13769
+ meta: { reason }
13770
+ });
13771
+ throw new SwitchToggleRefusedError(reason, deviceId);
13772
+ }
13773
+ async function runToggle(provider, setState, read, input) {
13774
+ const deviceId = typeof input?.deviceId === "number" ? input.deviceId : read.deviceId;
13775
+ const state = classifySwitchOn(deviceId === read.deviceId ? read.readSlice() : void 0);
13776
+ if (!state.known) refuse$1(read, deviceId, state.reason);
13777
+ await setState.call(provider, {
13778
+ deviceId,
13779
+ on: !state.on
13780
+ });
13781
+ }
13782
+ /**
13783
+ * `provider`, plus `toggle` when `capName` is `switch` and the provider did
13784
+ * not write one. Any other cap is returned as the same object.
13785
+ */
13786
+ function withDefaultSwitchToggle(capName, provider, read) {
13787
+ if (capName !== "switch") return provider;
13788
+ if (typeof Reflect.get(provider, "toggle") === "function") return provider;
13789
+ const setState = Reflect.get(provider, "setState");
13790
+ if (!isSetState(setState)) return provider;
13791
+ const toggle = (input) => runToggle(provider, setState, read, input);
13792
+ return {
13793
+ ...provider,
13794
+ toggle
13795
+ };
13796
+ }
13797
+ //#endregion
13728
13798
  //#region src/kernel/moleculer/children-batch-loader.ts
13729
13799
  /**
13730
13800
  * Narrow an untyped cap answer to the fields the reconcile reads.
@@ -14277,7 +14347,7 @@ function createBrokerDeviceManagerApi(opts) {
14277
14347
  }
14278
14348
  });
14279
14349
  }
14280
- const finalProvider = (() => {
14350
+ const withStatus = (() => {
14281
14351
  if (!cap.status || !cap.runtimeState || !runtimeStateRef) return provider;
14282
14352
  if (typeof Reflect.get(provider, "getStatus") === "function") return provider;
14283
14353
  const rsRef = runtimeStateRef;
@@ -14290,6 +14360,11 @@ function createBrokerDeviceManagerApi(opts) {
14290
14360
  getStatus: defaultGetStatus
14291
14361
  };
14292
14362
  })();
14363
+ const finalProvider = withDefaultSwitchToggle(cap.name, withStatus, {
14364
+ deviceId: id,
14365
+ readSlice: () => runtimeStateRef?.getCapState("switch"),
14366
+ logger: opts.logger
14367
+ });
14293
14368
  if (opts.capabilityRegistry) opts.capabilityRegistry.registerNativeProvider(cap.name, id, addonId, finalProvider);
14294
14369
  else if (opts.broker || opts.udsMode) {
14295
14370
  let perCap = workerNativeCaps.get(cap.name);
@@ -0,0 +1,41 @@
1
+ /**
2
+ * The one default for `switch.toggle` (D393).
3
+ *
4
+ * Every native provider is registered in `registerNativeCap`. A switch
5
+ * provider that did not write `toggle` gets this body there — never a copy
6
+ * in each addon. It reads the device's `switch` slice and calls that
7
+ * provider's `setState` with the opposite `on`. A missing slice, or a slice
8
+ * whose `on` is not a boolean (`null` is "never reported"), is unknown:
9
+ * the call refuses and logs the device. It does not guess off.
10
+ */
11
+ import type { IScopedLogger } from "@camstack/types";
12
+ /** Why a toggle will not act. Both are unknown; neither is off. */
13
+ export type SwitchToggleRefusal = "no-slice" | "stale";
14
+ export type SwitchOn = {
15
+ readonly known: true;
16
+ readonly on: boolean;
17
+ } | {
18
+ readonly known: false;
19
+ readonly reason: SwitchToggleRefusal;
20
+ };
21
+ export declare class SwitchToggleRefusedError extends Error {
22
+ readonly reason: SwitchToggleRefusal;
23
+ readonly deviceId: number;
24
+ constructor(reason: SwitchToggleRefusal, deviceId: number);
25
+ }
26
+ /** `on` when the slice states it, otherwise the reason the toggle must refuse. */
27
+ export declare function classifySwitchOn(slice: unknown): SwitchOn;
28
+ export interface SwitchToggleInput {
29
+ readonly deviceId?: number;
30
+ }
31
+ /** What the default needs from the device it was registered on. */
32
+ export interface SwitchToggleRead {
33
+ readonly deviceId: number;
34
+ readSlice(): unknown;
35
+ readonly logger: Pick<IScopedLogger, "warn">;
36
+ }
37
+ /**
38
+ * `provider`, plus `toggle` when `capName` is `switch` and the provider did
39
+ * not write one. Any other cap is returned as the same object.
40
+ */
41
+ export declare function withDefaultSwitchToggle<P extends object>(capName: string, provider: P, read: SwitchToggleRead): P;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-WEGVb8qV.js");
1
+ const require_dist = require("./dist-B9Kzw974.js");
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- import { Dc as collectSecretMarkerRefs } from "./dist-atHH8IeD.mjs";
1
+ import { Oc as collectSecretMarkerRefs } from "./dist-3MQdfUTG.mjs";
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-WEGVb8qV.js");
1
+ const require_dist = require("./dist-B9Kzw974.js");
2
2
  //#region src/builtins/core-blocks/rename-composition-block.ts
3
3
  /**
4
4
  * An operator rename of a composed device writes the composition block's
@@ -1,4 +1,4 @@
1
- import { Al as COMPOSED_DEVICE_STABLE_ID_PREFIX, Pl as errMsg } from "./dist-atHH8IeD.mjs";
1
+ import { Fl as errMsg, jl as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./dist-3MQdfUTG.mjs";
2
2
  //#region src/builtins/core-blocks/rename-composition-block.ts
3
3
  /**
4
4
  * An operator rename of a composed device writes the composition block's
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-WEGVb8qV.js");
2
+ const require_dist = require("./dist-B9Kzw974.js");
3
3
  let zod = require("zod");
4
4
  let node_crypto = require("node:crypto");
5
5
  let buffer = require("buffer");