@camstack/system 1.2.417 → 1.2.418

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 (78) hide show
  1. package/dist/addon-utils.js +1 -1
  2. package/dist/addon-utils.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/autotrack/index.js +1 -1
  10. package/dist/builtins/autotrack/index.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/dist/builtins/camera-grid/index.js +1 -1
  16. package/dist/builtins/camera-grid/index.mjs +1 -1
  17. package/dist/builtins/composer/composer.addon.js +2 -2
  18. package/dist/builtins/composer/composer.addon.mjs +2 -2
  19. package/dist/builtins/console-logging/index.js +1 -1
  20. package/dist/builtins/console-logging/index.mjs +1 -1
  21. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  22. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  23. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  24. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  25. package/dist/builtins/hub-forwarder/index.js +1 -1
  26. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  27. package/dist/builtins/keychain/index.js +7 -9
  28. package/dist/builtins/keychain/index.mjs +7 -9
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  32. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  33. package/dist/builtins/local-network/local-network.addon.js +2 -2
  34. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  35. package/dist/builtins/loki-logging/index.js +1 -1
  36. package/dist/builtins/loki-logging/index.mjs +1 -1
  37. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  39. package/dist/builtins/platform-probe/amd-npu.d.ts +6 -0
  40. package/dist/builtins/platform-probe/index.js +317 -19
  41. package/dist/builtins/platform-probe/index.mjs +318 -20
  42. package/dist/builtins/platform-probe/platform-scorer.d.ts +4 -0
  43. package/dist/builtins/platform-probe/windows-hardware.d.ts +77 -0
  44. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  45. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  46. package/dist/builtins/snapshot/index.js +1 -1
  47. package/dist/builtins/snapshot/index.mjs +1 -1
  48. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  49. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  50. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  51. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  52. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  53. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  54. package/dist/builtins/system-config/system-config.addon.js +2 -2
  55. package/dist/builtins/system-config/system-config.addon.mjs +2 -2
  56. package/dist/builtins/winston-logging/index.js +1 -1
  57. package/dist/builtins/winston-logging/index.mjs +1 -1
  58. package/dist/{composition-sources-CndJVssc.mjs → composition-sources-0cPw9E0M.mjs} +1 -1
  59. package/dist/{composition-sources-ChAX2Kdo.js → composition-sources-BVjuMvpb.js} +1 -1
  60. package/dist/{constants-VXvZkGgw.js → constants-Aj0OBqlt.js} +1 -1
  61. package/dist/{constants-BzxwnfDc.mjs → constants-C8T7u1_Z.mjs} +1 -1
  62. package/dist/{custom-action-registry-DHv0kYcT.mjs → custom-action-registry-BQnbN0DP.mjs} +1 -2
  63. package/dist/{custom-action-registry-Bb28ibZV.js → custom-action-registry-Bf_YnagS.js} +3 -4
  64. package/dist/{dist-BMOD9OyH.js → dist-DVUg8e1T.js} +56 -72
  65. package/dist/{dist-H_RapIeM.mjs → dist-DlmdESNT.mjs} +57 -55
  66. package/dist/index.js +38 -10
  67. package/dist/index.mjs +38 -10
  68. package/dist/{jwt-signing-key-xQxqpwMC.mjs → jwt-signing-key-CGg61A5v.mjs} +1 -1
  69. package/dist/{jwt-signing-key-BiKHENST.js → jwt-signing-key-Jyu81jZR.js} +1 -1
  70. package/dist/{restore-archive-BobsETEp.js → restore-archive-Bq5PpQ-H.js} +1 -1
  71. package/dist/{restore-archive-CCAQicV-.mjs → restore-archive-DVo5ooBt.mjs} +1 -1
  72. package/dist/{retired-settings-keys-BMq2u4Wv.js → retired-settings-keys-CihMX6h9.js} +1 -1
  73. package/dist/{retired-settings-keys-CwL4zHLg.mjs → retired-settings-keys-k_XuC-Mt.mjs} +1 -1
  74. package/dist/{tls-C0TRPfqc.js → tls-BgImdxCO.js} +4 -11
  75. package/dist/{tls-D-2dPY-5.mjs → tls-CaOLZ09W.mjs} +5 -12
  76. package/package.json +1 -1
  77. package/dist/amd-npu-B-QyyMyF.js +0 -53
  78. package/dist/amd-npu-Db_SoSuL.mjs +0 -52
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as __require } from "./chunk-CNf5ZN-e.mjs";
2
- import { An as scopesAllowAddon, Ar as emitDownForOwnedCaps, Bt as isArrayOutputSchema, Cr as asString$1, Dn as resolveMethodAuth, Dr as createEvent$1, Gr as parseJsonUnknown, Gt as isVoidInput, Hn as supportedRuntimes, J as addonSettingsCapability, Jr as resolveCapMount, Kt as kebabToCamel$1, L as RUNTIME_DEFAULTS, M as METHOD_ACCESS_MAP, Mr as expandCapMethods, Nt as extractNestedAddonId, Sr as asNumber, Vt as isCollectionArrayMethod, Wr as parseJsonObject, Wt as isObjectInput, Xr as scopeKey, Zt as lifecycleJobSchema, _n as procedureAuthKey, _r as ReadinessRegistry, dn as objectInputDeclaresAddonId, dr as errMsg$1, fn as objectInputDeclaresRequiredDeviceId, hr as DEVICE_STATUS_METHOD, jn as scopesAllowDeviceCap, k as LOG_LEVEL_RANK, mr as DEVICE_SETTINGS_CONTRIBUTION_METHODS, nn as looseSchema, pr as DATAPLANE_SECRET_HEADER$1, qr as readinessKey, ri as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as logLevelAtMost, vr as ReadinessTimeoutError, xr as asJsonObject$1 } from "./dist-H_RapIeM.mjs";
3
- import { c as staticJwtSigningKey, i as getProcessJwtSigningKeyState, n as JwtSigningKeyUnavailableError, o as processJwtSigningKey, r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "./jwt-signing-key-xQxqpwMC.mjs";
2
+ import { At as extractNestedAddonId, Bt as isObjectInput, Cn as resolveMethodAuth, Dn as scopesAllowDeviceCap, Dr as emitDownForOwnedCaps, En as scopesAllowAddon, G as addonSettingsCapability, Gr as resolveCapMount, Hr as parseJsonUnknown, Ht as kebabToCamel$1, It as isArrayOutputSchema, Lt as isCollectionArrayMethod, O as LOG_LEVEL_RANK, Qt as looseSchema, Rn as supportedRuntimes, Vr as parseJsonObject, Vt as isVoidInput, Wr as readinessKey, Zt as logLevelAtMost, br as asString$1, cn as objectInputDeclaresRequiredDeviceId, dr as DEVICE_STATUS_METHOD, ei as EventCategory$1, hr as ReadinessTimeoutError, j as METHOD_ACCESS_MAP, kr as expandCapMethods, lr as DATAPLANE_SECRET_HEADER$1, mr as ReadinessRegistry, pn as procedureAuthKey, pr as RUNTIME_DEFAULTS, qr as scopeKey, qt as lifecycleJobSchema, sn as objectInputDeclaresAddonId, sr as errMsg$1, t as ALL_CAPABILITY_DEFINITIONS, ur as DEVICE_SETTINGS_CONTRIBUTION_METHODS, vr as asJsonObject$1, wr as createEvent$1, yr as asNumber } from "./dist-DlmdESNT.mjs";
3
+ import { c as staticJwtSigningKey, i as getProcessJwtSigningKeyState, n as JwtSigningKeyUnavailableError, o as processJwtSigningKey, r as SYSTEM_SECRET_OWNER, t as JWT_SIGNING_KEY_REF } from "./jwt-signing-key-CGg61A5v.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";
@@ -25,15 +25,15 @@ import { SqliteSettingsAddon, o as SqliteSettingsBackend, s as prefixRange } fro
25
25
  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
- 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-BzxwnfDc.mjs";
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-C8T7u1_Z.mjs";
29
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";
30
30
  import "./builtins/system-config/index.mjs";
31
31
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
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-DHv0kYcT.mjs";
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-D-2dPY-5.mjs";
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
+ 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-CCAQicV-.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-DVo5ooBt.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";
@@ -51,12 +51,12 @@ import { execFile, spawn } from "node:child_process";
51
51
  import * as util from "node:util";
52
52
  import { promisify } from "node:util";
53
53
  import { once } from "node:events";
54
+ import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, asJsonObject, asString, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readNodePin, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
54
55
  import { createServer as createServer$1, request } from "node:http";
55
56
  import * as v8 from "node:v8";
56
57
  import { Session } from "node:inspector/promises";
57
58
  import { monitorEventLoopDelay } from "node:perf_hooks";
58
59
  import * as vm from "node:vm";
59
- import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, EventCategory, PEER_BYTES_CHUNK_BYTES, PEER_BYTES_MAX_OUTSTANDING, PEER_BYTES_STALL_MS, PEER_BYTES_TICKET_TTL_MS, ReadinessRegistry as ReadinessRegistry$1, asJsonObject, asString, collectZodSecretPaths, createDeviceProxy, createEvent, createEventBusSliceSource, createSecretsAccess, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods as expandCapMethods$1, maskUrlCredentials, readNodePin, scopeKey as scopeKey$1, scrubKnownSecrets, sleep, withCapInputDefaults } from "@camstack/types/addon";
60
60
  import { TRPCClientError, createTRPCClient } from "@trpc/client";
61
61
  //#region src/addon/addon-api-factory.ts
62
62
  /**
@@ -24062,6 +24062,8 @@ function stripForgedIdentity(action, params) {
24062
24062
  }
24063
24063
  return withoutIdentity(params);
24064
24064
  }
24065
+ /** Minimum gap between two "mesh event refused" lines for one sender. */
24066
+ var DROPPED_EVENT_LOG_INTERVAL_MS = 6e4;
24065
24067
  function senderOf(ctx) {
24066
24068
  const nodeID = ctx.nodeID;
24067
24069
  return typeof nodeID === "string" && nodeID.length > 0 ? nodeID : null;
@@ -24075,6 +24077,29 @@ function paramNodeId(params) {
24075
24077
  */
24076
24078
  function createMeshAccessMiddleware(options) {
24077
24079
  const { ownNodeId, authenticator, logger } = options;
24080
+ const dropped = /* @__PURE__ */ new Map();
24081
+ const noteDroppedEvent = (sender, eventName) => {
24082
+ const now = Date.now();
24083
+ const entry = dropped.get(sender) ?? {
24084
+ lastLogAt: 0,
24085
+ count: 0
24086
+ };
24087
+ const count = entry.count + 1;
24088
+ if (now - entry.lastLogAt >= DROPPED_EVENT_LOG_INTERVAL_MS) {
24089
+ logger?.warn("mesh event refused", {
24090
+ sender,
24091
+ event: eventName,
24092
+ droppedSinceLastLog: count
24093
+ });
24094
+ dropped.set(sender, {
24095
+ lastLogAt: now,
24096
+ count: 0
24097
+ });
24098
+ } else dropped.set(sender, {
24099
+ lastLogAt: entry.lastLogAt,
24100
+ count
24101
+ });
24102
+ };
24078
24103
  return {
24079
24104
  name: "CamstackMeshAccess",
24080
24105
  localAction(next, action) {
@@ -24100,9 +24125,12 @@ function createMeshAccessMiddleware(options) {
24100
24125
  const name = event.name ?? "";
24101
24126
  return function meshGatedEvent(ctx) {
24102
24127
  const sender = senderOf(ctx);
24103
- if (sender === null || sender === ownNodeId) return next.call(this, ctx);
24104
- if (authenticator.admitEvent(sender, name).verdict === "deny") return void 0;
24105
- return next.call(this, ctx);
24128
+ 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));
24106
24134
  };
24107
24135
  }
24108
24136
  };
@@ -1,4 +1,4 @@
1
- import { wr as buildSecretRef } from "./dist-H_RapIeM.mjs";
1
+ import { xr as buildSecretRef } from "./dist-DlmdESNT.mjs";
2
2
  import { randomBytes } from "node:crypto";
3
3
  //#region src/auth/jwt-signing-key.ts
4
4
  /**
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-BMOD9OyH.js");
1
+ const require_dist = require("./dist-DVUg8e1T.js");
2
2
  let node_crypto = require("node:crypto");
3
3
  //#region src/auth/jwt-signing-key.ts
4
4
  /**
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-BMOD9OyH.js");
2
+ const require_dist = require("./dist-DVUg8e1T.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");
@@ -1,4 +1,4 @@
1
- import { g as DATABASE_SNAPSHOT_SUFFIX } from "./dist-H_RapIeM.mjs";
1
+ import { g as DATABASE_SNAPSHOT_SUFFIX } from "./dist-DlmdESNT.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,4 +1,4 @@
1
- const require_dist = require("./dist-BMOD9OyH.js");
1
+ const require_dist = require("./dist-DVUg8e1T.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- import { xr as asJsonObject } from "./dist-H_RapIeM.mjs";
1
+ import { vr as asJsonObject } from "./dist-DlmdESNT.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,6 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
2
  const require_x509_es = require("./x509.es-Dzl0BbmG.js");
3
3
  let node_crypto = require("node:crypto");
4
+ let _camstack_types_node = require("@camstack/types/node");
4
5
  let node_net = require("node:net");
5
6
  let node_fs_promises = require("node:fs/promises");
6
7
  let node_path = require("node:path");
@@ -594,22 +595,14 @@ async function regenerate(paths, identity, commonName, validDays, newCa) {
594
595
  const chainPem = `${leaf.certPem.trimEnd()}\n${ca.certPem.trimEnd()}\n`;
595
596
  if (newCa) {
596
597
  await (0, node_fs_promises.writeFile)(`${paths.caCertPath}.new`, ca.certPem, "utf-8");
597
- await (0, node_fs_promises.writeFile)(`${paths.caKeyPath}.new`, ca.keyPem, {
598
- encoding: "utf-8",
599
- mode: 384
600
- });
598
+ (0, _camstack_types_node.writeOwnerOnlyFileSync)(`${paths.caKeyPath}.new`, ca.keyPem);
601
599
  (0, node_fs.renameSync)(`${paths.caCertPath}.new`, paths.caCertPath);
602
600
  (0, node_fs.renameSync)(`${paths.caKeyPath}.new`, paths.caKeyPath);
603
- await (0, node_fs_promises.chmod)(paths.caKeyPath, 384);
604
601
  }
605
- await (0, node_fs_promises.writeFile)(`${paths.keyPath}.new`, leaf.keyPem, {
606
- encoding: "utf-8",
607
- mode: 384
608
- });
602
+ (0, _camstack_types_node.writeOwnerOnlyFileSync)(`${paths.keyPath}.new`, leaf.keyPem);
609
603
  await (0, node_fs_promises.writeFile)(`${paths.certPath}.new`, chainPem, "utf-8");
610
604
  (0, node_fs.renameSync)(`${paths.keyPath}.new`, paths.keyPath);
611
605
  (0, node_fs.renameSync)(`${paths.certPath}.new`, paths.certPath);
612
- await (0, node_fs_promises.chmod)(paths.keyPath, 384);
613
606
  }
614
607
  function describe(paths, generated, reason, caRotated, previousFingerprintSha256, reissueError) {
615
608
  const leaf = new node_crypto.X509Certificate((0, node_fs.readFileSync)(paths.certPath));
@@ -917,7 +910,7 @@ async function storeUploadedCertificate(dataDir, input) {
917
910
  const dir = (0, node_path.join)(dataDir, "tls");
918
911
  await (0, node_fs_promises.mkdir)(dir, { recursive: true });
919
912
  await (0, node_fs_promises.writeFile)((0, node_path.join)(dir, "camstack.crt"), withNewline(input.certPem));
920
- await (0, node_fs_promises.writeFile)((0, node_path.join)(dir, "camstack.key"), withNewline(input.keyPem), { mode: 384 });
913
+ (0, _camstack_types_node.writeOwnerOnlyFileSync)((0, node_path.join)(dir, "camstack.key"), withNewline(input.keyPem));
921
914
  const caPath = (0, node_path.join)(dir, UPLOADED_CA_FILE);
922
915
  if (input.caPem !== void 0 && input.caPem.trim() !== "") await (0, node_fs_promises.writeFile)(caPath, withNewline(input.caPem));
923
916
  else (0, node_fs.rmSync)(caPath, { force: true });
@@ -1,7 +1,8 @@
1
1
  import { a as KeyUsagesExtension, d as X509Certificate$1, f as X509CertificateGenerator, i as KeyUsageFlags, l as SubjectAlternativeNameExtension, n as BasicConstraintsExtension, o as PemConverter, p as cryptoProvider, r as ExtendedKeyUsageExtension, t as AuthorityKeyIdentifierExtension, u as SubjectKeyIdentifierExtension } from "./x509.es-CAjSsrkk.mjs";
2
2
  import { X509Certificate, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
3
+ import { writeOwnerOnlyFileSync } from "@camstack/types/node";
3
4
  import { isIP } from "node:net";
4
- import { chmod, mkdir, writeFile } from "node:fs/promises";
5
+ import { mkdir, writeFile } from "node:fs/promises";
5
6
  import { join } from "node:path";
6
7
  import * as os from "node:os";
7
8
  import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -592,22 +593,14 @@ async function regenerate(paths, identity, commonName, validDays, newCa) {
592
593
  const chainPem = `${leaf.certPem.trimEnd()}\n${ca.certPem.trimEnd()}\n`;
593
594
  if (newCa) {
594
595
  await writeFile(`${paths.caCertPath}.new`, ca.certPem, "utf-8");
595
- await writeFile(`${paths.caKeyPath}.new`, ca.keyPem, {
596
- encoding: "utf-8",
597
- mode: 384
598
- });
596
+ writeOwnerOnlyFileSync(`${paths.caKeyPath}.new`, ca.keyPem);
599
597
  renameSync(`${paths.caCertPath}.new`, paths.caCertPath);
600
598
  renameSync(`${paths.caKeyPath}.new`, paths.caKeyPath);
601
- await chmod(paths.caKeyPath, 384);
602
599
  }
603
- await writeFile(`${paths.keyPath}.new`, leaf.keyPem, {
604
- encoding: "utf-8",
605
- mode: 384
606
- });
600
+ writeOwnerOnlyFileSync(`${paths.keyPath}.new`, leaf.keyPem);
607
601
  await writeFile(`${paths.certPath}.new`, chainPem, "utf-8");
608
602
  renameSync(`${paths.keyPath}.new`, paths.keyPath);
609
603
  renameSync(`${paths.certPath}.new`, paths.certPath);
610
- await chmod(paths.keyPath, 384);
611
604
  }
612
605
  function describe(paths, generated, reason, caRotated, previousFingerprintSha256, reissueError) {
613
606
  const leaf = new X509Certificate(readFileSync(paths.certPath));
@@ -915,7 +908,7 @@ async function storeUploadedCertificate(dataDir, input) {
915
908
  const dir = join(dataDir, "tls");
916
909
  await mkdir(dir, { recursive: true });
917
910
  await writeFile(join(dir, "camstack.crt"), withNewline(input.certPem));
918
- await writeFile(join(dir, "camstack.key"), withNewline(input.keyPem), { mode: 384 });
911
+ writeOwnerOnlyFileSync(join(dir, "camstack.key"), withNewline(input.keyPem));
919
912
  const caPath = join(dir, UPLOADED_CA_FILE);
920
913
  if (input.caPem !== void 0 && input.caPem.trim() !== "") await writeFile(caPath, withNewline(input.caPem));
921
914
  else rmSync(caPath, { force: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.417",
3
+ "version": "1.2.418",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",
@@ -1,53 +0,0 @@
1
- require("./chunk-Cek0wNdY.js");
2
- //#region src/builtins/platform-probe/amd-npu.ts
3
- var ACCEL_CLASS = "/sys/class/accel";
4
- var ACCEL_DEV = "/dev/accel";
5
- var AMD_PCI_VENDOR = "0x1022";
6
- /** Phoenix / Hawk Point XDNA1. */
7
- var XDNA1_DEVICES = new Set(["0x1502"]);
8
- /** Strix / Krackan XDNA2. */
9
- var XDNA2_DEVICES = new Set(["0x17f0"]);
10
- function normalizePciId(raw) {
11
- const t = raw.trim().toLowerCase();
12
- if (t.startsWith("0x")) return t;
13
- if (t.length > 0 && [...t].every((c) => "0123456789abcdef".includes(c))) return "0x" + t;
14
- return t;
15
- }
16
- function hasAccelCharDevice(fsx) {
17
- if (fsx.listDir(ACCEL_DEV).some((n) => n.startsWith("accel"))) return true;
18
- return fsx.exists("/dev/accel/accel0");
19
- }
20
- /**
21
- * Detect an AMD XDNA NPU and report it as **present only**.
22
- *
23
- * Inference is NOT offered until P2 (Ryzen AI on Linux is Strix-first;
24
- * Phoenix is not a production path today). The probe still names the
25
- * generation so the UI and fleet census can show the hardware.
26
- */
27
- function classifyAmdNpu(ctx, fsx) {
28
- if (ctx.platform !== "linux" || ctx.arch !== "x64" || !ctx.amdPresent) return null;
29
- if (!hasAccelCharDevice(fsx)) return null;
30
- for (const name of fsx.listDir(ACCEL_CLASS)) {
31
- if (!name.startsWith("accel")) continue;
32
- const vendor = normalizePciId(fsx.readFile("/sys/class/accel/" + name + "/device/vendor"));
33
- const device = normalizePciId(fsx.readFile("/sys/class/accel/" + name + "/device/device"));
34
- if (vendor !== AMD_PCI_VENDOR) continue;
35
- if (XDNA1_DEVICES.has(device)) return {
36
- type: "amd-xdna",
37
- name: "AMD XDNA1 NPU",
38
- generation: "xdna1"
39
- };
40
- if (XDNA2_DEVICES.has(device)) return {
41
- type: "amd-xdna",
42
- name: "AMD XDNA2 NPU",
43
- generation: "xdna2"
44
- };
45
- return {
46
- type: "amd-xdna",
47
- name: "AMD XDNA NPU"
48
- };
49
- }
50
- return null;
51
- }
52
- //#endregion
53
- exports.classifyAmdNpu = classifyAmdNpu;
@@ -1,52 +0,0 @@
1
- //#region src/builtins/platform-probe/amd-npu.ts
2
- var ACCEL_CLASS = "/sys/class/accel";
3
- var ACCEL_DEV = "/dev/accel";
4
- var AMD_PCI_VENDOR = "0x1022";
5
- /** Phoenix / Hawk Point XDNA1. */
6
- var XDNA1_DEVICES = new Set(["0x1502"]);
7
- /** Strix / Krackan XDNA2. */
8
- var XDNA2_DEVICES = new Set(["0x17f0"]);
9
- function normalizePciId(raw) {
10
- const t = raw.trim().toLowerCase();
11
- if (t.startsWith("0x")) return t;
12
- if (t.length > 0 && [...t].every((c) => "0123456789abcdef".includes(c))) return "0x" + t;
13
- return t;
14
- }
15
- function hasAccelCharDevice(fsx) {
16
- if (fsx.listDir(ACCEL_DEV).some((n) => n.startsWith("accel"))) return true;
17
- return fsx.exists("/dev/accel/accel0");
18
- }
19
- /**
20
- * Detect an AMD XDNA NPU and report it as **present only**.
21
- *
22
- * Inference is NOT offered until P2 (Ryzen AI on Linux is Strix-first;
23
- * Phoenix is not a production path today). The probe still names the
24
- * generation so the UI and fleet census can show the hardware.
25
- */
26
- function classifyAmdNpu(ctx, fsx) {
27
- if (ctx.platform !== "linux" || ctx.arch !== "x64" || !ctx.amdPresent) return null;
28
- if (!hasAccelCharDevice(fsx)) return null;
29
- for (const name of fsx.listDir(ACCEL_CLASS)) {
30
- if (!name.startsWith("accel")) continue;
31
- const vendor = normalizePciId(fsx.readFile("/sys/class/accel/" + name + "/device/vendor"));
32
- const device = normalizePciId(fsx.readFile("/sys/class/accel/" + name + "/device/device"));
33
- if (vendor !== AMD_PCI_VENDOR) continue;
34
- if (XDNA1_DEVICES.has(device)) return {
35
- type: "amd-xdna",
36
- name: "AMD XDNA1 NPU",
37
- generation: "xdna1"
38
- };
39
- if (XDNA2_DEVICES.has(device)) return {
40
- type: "amd-xdna",
41
- name: "AMD XDNA2 NPU",
42
- generation: "xdna2"
43
- };
44
- return {
45
- type: "amd-xdna",
46
- name: "AMD XDNA NPU"
47
- };
48
- }
49
- return null;
50
- }
51
- //#endregion
52
- export { classifyAmdNpu };