@camstack/server 1.2.901 → 1.2.903

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 +12 -0
  2. package/package.json +12 -12
  3. package/system/dist/addon-runner.js +11 -6
  4. package/system/dist/addon-runner.mjs +12 -7
  5. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/system/dist/builtins/autotrack/index.js +1 -1
  12. package/system/dist/builtins/autotrack/index.mjs +1 -1
  13. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/system/dist/builtins/camera-grid/index.js +1 -1
  18. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/system/dist/builtins/composer/composer.addon.js +4 -4
  20. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  21. package/system/dist/builtins/console-logging/index.js +1 -1
  22. package/system/dist/builtins/console-logging/index.mjs +1 -1
  23. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  25. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  26. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  27. package/system/dist/builtins/device-manager/command-holds.d.ts +2 -0
  28. package/system/dist/builtins/device-manager/device-manager.addon.js +18 -4
  29. package/system/dist/builtins/device-manager/device-manager.addon.mjs +18 -4
  30. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +2 -0
  31. package/system/dist/builtins/device-manager/state-refresh-scheduler.d.ts +5 -1
  32. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  33. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  34. package/system/dist/builtins/keychain/index.js +4 -4
  35. package/system/dist/builtins/keychain/index.mjs +4 -4
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  37. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  38. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  39. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  40. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  41. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  42. package/system/dist/builtins/loki-logging/index.js +1 -1
  43. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  45. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  46. package/system/dist/builtins/platform-probe/index.js +46 -19
  47. package/system/dist/builtins/platform-probe/index.mjs +46 -19
  48. package/system/dist/builtins/platform-probe/platform-scorer.d.ts +7 -0
  49. package/system/dist/builtins/platform-probe/windows-hardware.d.ts +11 -6
  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 +3 -3
  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-B3csK2sW.js → capture-engine-BsGVKjld.js} +1 -1
  69. package/system/dist/{capture-engine-CCAzcezv.mjs → capture-engine-D0FpnENM.mjs} +1 -1
  70. package/system/dist/{composition-sources-Bkbk5Oh5.js → composition-sources-75AgWPIR.js} +1 -1
  71. package/system/dist/{composition-sources-BX7u-Hdf.mjs → composition-sources-B3anVC1t.mjs} +1 -1
  72. package/system/dist/{constants-BqxCksdV.js → constants-BhN1jHcJ.js} +1 -1
  73. package/system/dist/{constants-_bOm_ae5.mjs → constants-CjGZCAun.mjs} +1 -1
  74. package/system/dist/{device-ca-KNx_DazP.js → device-ca-D0-IU1v8.js} +1 -1
  75. package/system/dist/{device-ca-DRqN1P5Y.mjs → device-ca-rg3jkL9j.mjs} +1 -1
  76. package/system/dist/{dist-BNrIzdrJ.js → dist-Cadmv3rL.js} +372 -276
  77. package/system/dist/{dist-S-zGcCEr.mjs → dist-DFRmPXTo.mjs} +361 -271
  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-pN0LtUhx.js → hub-identity-CYU8a0Hk.js} +1 -1
  81. package/system/dist/{hub-identity-DSdbZxeR.mjs → hub-identity-D5hgkkLm.mjs} +1 -1
  82. package/system/dist/{hub-mdns-ciao-wAcv5VBY.mjs → hub-mdns-ciao-BkD9s5Bz.mjs} +2 -2
  83. package/system/dist/{hub-mdns-ciao-GafEbDm8.js → hub-mdns-ciao-CDCn7uUo.js} +2 -2
  84. package/system/dist/index.js +22 -16
  85. package/system/dist/index.mjs +23 -17
  86. package/system/dist/kernel/inference/inference-resolver.d.ts +4 -2
  87. package/system/dist/{legacy-integration-rows-door-B1swGb0r.js → legacy-integration-rows-door-C_l9jAFJ.js} +1 -1
  88. package/system/dist/{legacy-integration-rows-door--186Wij_.mjs → legacy-integration-rows-door-mF8pNWEV.mjs} +1 -1
  89. package/system/dist/{rename-composition-block-Cf5syiM4.mjs → rename-composition-block-CyULF94b.mjs} +1 -1
  90. package/system/dist/{rename-composition-block-gJ_4GdHr.js → rename-composition-block-lHaoyeuW.js} +1 -1
  91. package/system/dist/{restore-archive-DScscuGI.mjs → restore-archive-BZhn64U7.mjs} +1 -1
  92. package/system/dist/{restore-archive-DXi9iBay.js → restore-archive-IDxQg4bp.js} +1 -1
  93. package/system/dist/{wal-maintenance-s3KdED98.mjs → wal-maintenance-BFe0hYbV.mjs} +0 -0
  94. package/system/dist/{wal-maintenance-BA9XNPvt.js → wal-maintenance-Cj1dmAUb.js} +0 -0
  95. package/system/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { $ as DEVICE_TEMPLATE_VALUES_CAP, $r as deviceStatusCapability, Bo as sameIdentifiers, Br as defineExtensionSlotProvider, Bt as MINUTES_PER_DAY, C as COMMAND_BURST_OFFSETS_MS, Co as resolveCommandHold, Cu as DeviceRole, Dl as defineRecordKinds, Du as EventCategory$1, Fa as normalizeUnit, Fo as resolveTemplateRef, Go as searchRank, Gr as deviceExtensionCapability, Ha as parseStreamParamsFormPatch, Hl as isKeychainStoredField, Jr as deviceOffersActions, Kl as isSecretMarker, Ll as isCommand$1, Ls as workloadCapability, Mi as identityLinkId, Mr as createDeviceExtensionProvider, Mt as IdentityLinkBodySchema, Ni as identityLinkSidesRefusal, Nn as WORKLOAD_TRANSITION_CATEGORY, Pa as normalizeTags, Pn as WorkloadStateSchema, Qr as deviceStateCapability, Qs as capAppliesToDeviceKind, Ro as runtimeFieldUnit, Rs as workloadTransition, Sa as mergeIdentifiers, Si as formatMinutes, Su as DeviceFeature, Tc as BaseAddon, Ti as generateDeviceAlias, Tu as errMsg$1, W as DEVICE_IDENTIFIER_KEYS, Wl as isSecretClear, X as DEVICE_TEMPLATE_MAX_LENGTH, Y as DEVICE_TEMPLATE_FILTERS, Yi as isKernelDerivedFeature, Yo as settleDeviceFeatures, Z as DEVICE_TEMPLATE_MAX_OUTPUT, Zs as canonicalStoredDeviceType, Zt as PUSH_CONFIRM_WINDOW_MS, _u as userError, bl as commandEffect, bt as FieldClaimModeSchema, ct as DiscoveryProposalBodySchema, dr as checkDeviceAlias, ea as isWorkloadSettled, fc as implementedMethodsOf$1, fi as extractSourceInfoFromMetadata, ft as ExportNameRefusedError, gu as transformSecretWrite, hu as toSecretFieldView, ia as legacyAutoLinkIds, ii as enumerateSchemaFields, it as DeviceIdentifiersSchema, j as ConditionMirror, ji as identifierStrength, jl as expandCapMethods$1, li as expandContainer, ml as auditedFields, mn as STREAM_PROFILE_META, ot as DeviceStatusSchema, pu as sleep$2, qi as isEmptyIdentifiers, ql as isSecretMarkerLike, qr as deviceManagerCapability, ri as enumerateItemArrayFields, rr as buildStreamParamsConfigSchema, rt as DeviceIdentifierKeySchema, s as ALL_CAPABILITY_DEFINITIONS, sl as WELL_KNOWN_TAB_MAP, so as reconcileReportedFeatures, sr as canonicalIconKey, st as DeviceTombstoneSchema, su as resolveSecretMarkers, ti as effectiveRefreshIntervalMs, tl as SECRET_CLEAR, ts as siteZoneKey, ua as locationIconKey, uu as secretTreeFromPaths, vu as vocabActionIdFor, wu as DeviceType$1, x as CAP_NAMES_WITH_STATUS, xt as FieldClaimSchema, y as CAMERA_SWITCH_ORDER, yl as collectZodSecretPaths$1, z as DAY_NAMES, zl as isDeviceConfigCap, zo as runtimeStatePolicyFor } from "../../dist-S-zGcCEr.mjs";
1
+ import { $i as isWorkloadSettled, $o as siteZoneKey, $r as deviceStatusCapability, A as ConditionMirror, Ai as identifierStrength, Al as expandCapMethods$1, Br as defineExtensionSlotProvider, Cu as DeviceFeature, Eu as errMsg$1, Fs as workloadTransition, Gl as isSecretMarker, Gr as deviceExtensionCapability, Il as isCommand$1, J as DEVICE_TEMPLATE_FILTERS, Ji as isKernelDerivedFeature, Jr as deviceOffersActions, Js as canonicalStoredDeviceType, Ki as isEmptyIdentifiers, Kl as isSecretMarkerLike, Lo as runtimeFieldUnit, Mi as identityLinkSidesRefusal, Mn as WORKLOAD_TRANSITION_CATEGORY, Mr as createDeviceExtensionProvider, Na as normalizeTags, Nn as WorkloadStateSchema, Ou as EventCategory$1, Pa as normalizeUnit, Po as resolveTemplateRef, Ps as workloadCapability, Q as DEVICE_TEMPLATE_VALUES_CAP, Qc as SECRET_CLEAR, Qr as deviceStateCapability, R as DAY_NAMES, Rl as isDeviceConfigCap, Ro as runtimeStatePolicyFor, Sc as BaseAddon, So as resolveCommandHold, Tu as DeviceType$1, U as DEVICE_IDENTIFIER_KEYS, Ul as isSecretClear, Uo as searchRank, Va as parseStreamParamsFormPatch, Vl as isKeychainStoredField, X as DEVICE_TEMPLATE_MAX_OUTPUT, Xt as PUSH_CONFIRM_WINDOW_MS, Y as DEVICE_TEMPLATE_MAX_LENGTH, Ys as capAppliesToDeviceKind, _l as commandEffect, _r as commandBurstOffsets, _u as transformSecretWrite, at as DeviceStatusSchema, bt as FieldClaimSchema, ci as expandContainer, di as extractSourceInfoFromMetadata, dl as auditedFields, dt as ExportNameRefusedError, gl as collectZodSecretPaths$1, gu as toSecretFieldView, il as WELL_KNOWN_TAB_MAP, ji as identityLinkId, jt as IdentityLinkBodySchema, la as locationIconKey, lc as implementedMethodsOf$1, ni as enumerateItemArrayFields, nr as buildStreamParamsConfigSchema, nt as DeviceIdentifierKeySchema, oo as reconcileReportedFeatures, or as canonicalIconKey, ot as DeviceTombstoneSchema, ou as resolveSecretMarkers, pn as STREAM_PROFILE_META, pu as sleep$2, qo as settleDeviceFeatures, qr as deviceManagerCapability, ra as legacyAutoLinkIds, ri as enumerateSchemaFields, rt as DeviceIdentifiersSchema, s as ALL_CAPABILITY_DEFINITIONS, st as DiscoveryProposalBodySchema, ti as effectiveRefreshIntervalMs, ur as checkDeviceAlias, uu as secretTreeFromPaths, vu as userError, wi as generateDeviceAlias, wl as defineRecordKinds, wu as DeviceRole, x as CAP_NAMES_WITH_STATUS, xa as mergeIdentifiers, xi as formatMinutes, y as CAMERA_SWITCH_ORDER, yt as FieldClaimModeSchema, yu as vocabActionIdFor, zo as sameIdentifiers, zt as MINUTES_PER_DAY } from "../../dist-DFRmPXTo.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { a as redactLogText, i as redactLogMeta, n as isSecretArgumentKey } from "../../log-redactor-XLDrPzOi.mjs";
4
- import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-Cf5syiM4.mjs";
4
+ import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-CyULF94b.mjs";
5
5
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
6
6
  import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
7
7
  import { n as purgeRetiredSettingsRows } from "../../retired-settings-keys-u6xQA6r7.mjs";
@@ -12705,6 +12705,7 @@ var CommandHolds = class {
12705
12705
  capName: request.capName,
12706
12706
  method: request.method,
12707
12707
  holdMs: request.holdMs,
12708
+ expiresAt: Date.now() + request.holdMs,
12708
12709
  timer
12709
12710
  });
12710
12711
  }
@@ -12788,6 +12789,12 @@ var CommandHolds = class {
12788
12789
  for (const fields of this.held.get(deviceId)?.values() ?? []) if (fields.size > 0) return true;
12789
12790
  return false;
12790
12791
  }
12792
+ /** The longest time any pending hold on the device still has to run, in ms; 0 when none. */
12793
+ holdRemainingMs(deviceId) {
12794
+ let longest = 0;
12795
+ for (const arming of this.armings.values()) if (arming.deviceId === deviceId) longest = Math.max(longest, arming.expiresAt - Date.now());
12796
+ return longest;
12797
+ }
12791
12798
  /** Forget a removed device's holds. */
12792
12799
  clearDevice(deviceId) {
12793
12800
  this.held.delete(deviceId);
@@ -12948,6 +12955,10 @@ var DeviceStateMirror = class {
12948
12955
  isHoldingDevice(deviceId) {
12949
12956
  return this.holds.isHoldingDevice(deviceId);
12950
12957
  }
12958
+ /** How long the longest pending hold on the device still runs, ms; 0 when none. */
12959
+ holdRemainingMs(deviceId) {
12960
+ return this.holds.holdRemainingMs(deviceId);
12961
+ }
12951
12962
  /** Stop the hold timers (shutdown). */
12952
12963
  disposeHolds() {
12953
12964
  this.holds.dispose();
@@ -14191,7 +14202,9 @@ function __resetStateRefreshPolicyRegistryForTests() {
14191
14202
  * A non-batching integration keeps one schedule per device;
14192
14203
  * - command (`onCommand`, awaited by the D1022 seams): a polled device is read
14193
14204
  * at once and the command returns after it, then read again at ~3 s and
14194
- * ~10 s while a D1061 hold on it is still pending; a push device waits
14205
+ * ~10 s, then every ~10 s with a last read ~2 s before it expires, for as
14206
+ * long as a D1061 hold on it is still pending (the burst covers the hold's
14207
+ * own limit, 30 s by default, up to 120 s); a push device waits
14195
14208
  * `PUSH_CONFIRM_WINDOW_MS` for the confirming push and reads once if none
14196
14209
  * came. These reads are per device and never move a batched group's schedule;
14197
14210
  * - push health: silence past `heartbeatMs` reads the integration, asks it to
@@ -14431,7 +14444,7 @@ var StateRefreshScheduler = class {
14431
14444
  if (!this.deps.holdsPending(deviceId)) return;
14432
14445
  const timers = [];
14433
14446
  let stopped = false;
14434
- for (const offset of COMMAND_BURST_OFFSETS_MS) timers.push(setTimeout(() => {
14447
+ for (const offset of commandBurstOffsets(this.deps.holdRemainingMs(deviceId))) timers.push(setTimeout(() => {
14435
14448
  if (stopped || this.disposed) return;
14436
14449
  if (!this.deps.holdsPending(deviceId)) {
14437
14450
  stopped = true;
@@ -14591,6 +14604,7 @@ function startStateRefresh(deps) {
14591
14604
  policies: deps.policies ?? getStateRefreshPolicyRegistry(),
14592
14605
  logger: deps.logger,
14593
14606
  holdsPending: (deviceId) => deps.mirror.isHoldingDevice(deviceId),
14607
+ holdRemainingMs: (deviceId) => deps.mirror.holdRemainingMs(deviceId),
14594
14608
  refresh: deps.refresh,
14595
14609
  resubscribe: deps.resubscribe
14596
14610
  });
@@ -92,6 +92,8 @@ export declare class DeviceStateMirror {
92
92
  releaseCommand(token: number, reason: HoldRelease): void;
93
93
  /** Whether any command hold on the device is still unconfirmed (D1062). */
94
94
  isHoldingDevice(deviceId: number): boolean;
95
+ /** How long the longest pending hold on the device still runs, ms; 0 when none. */
96
+ holdRemainingMs(deviceId: number): number;
95
97
  /** Stop the hold timers (shutdown). */
96
98
  disposeHolds(): void;
97
99
  /** The native slice the mirror holds for `capName`, as a read-only view. */
@@ -14,7 +14,9 @@
14
14
  * A non-batching integration keeps one schedule per device;
15
15
  * - command (`onCommand`, awaited by the D1022 seams): a polled device is read
16
16
  * at once and the command returns after it, then read again at ~3 s and
17
- * ~10 s while a D1061 hold on it is still pending; a push device waits
17
+ * ~10 s, then every ~10 s with a last read ~2 s before it expires, for as
18
+ * long as a D1061 hold on it is still pending (the burst covers the hold's
19
+ * own limit, 30 s by default, up to 120 s); a push device waits
18
20
  * `PUSH_CONFIRM_WINDOW_MS` for the confirming push and reads once if none
19
21
  * came. These reads are per device and never move a batched group's schedule;
20
22
  * - push health: silence past `heartbeatMs` reads the integration, asks it to
@@ -40,6 +42,8 @@ export interface StateRefreshSchedulerDeps {
40
42
  readonly logger: IScopedLogger;
41
43
  /** Whether a D1061 command hold on the device is still unconfirmed. */
42
44
  readonly holdsPending: (deviceId: number) => boolean;
45
+ /** How long the longest pending hold on the device still runs, in ms (0 when none). */
46
+ readonly holdRemainingMs: (deviceId: number) => number;
43
47
  /** Ask the provider to re-read `deviceIds`, routed through `routeDeviceId`. */
44
48
  readonly refresh: (routeDeviceId: number, deviceIds: readonly number[], reason: StateRefreshReason) => Promise<void>;
45
49
  /** Ask the provider to re-establish its push subscription. */
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
9
9
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -1,4 +1,4 @@
1
- import { Tc as BaseAddon, pa as logDestinationCapability } from "../../dist-S-zGcCEr.mjs";
1
+ import { Sc as BaseAddon, fa as logDestinationCapability } from "../../dist-DFRmPXTo.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
7
- const require_device_ca = require("../../device-ca-KNx_DazP.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
+ const require_device_ca = require("../../device-ca-D0-IU1v8.js");
8
8
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
9
- const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-B1swGb0r.js");
10
- const require_constants = require("../../constants-BqxCksdV.js");
9
+ const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-C_l9jAFJ.js");
10
+ const require_constants = require("../../constants-BhN1jHcJ.js");
11
11
  const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
12
12
  let node_crypto = require("node:crypto");
13
13
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,8 +1,8 @@
1
- import { Dl as defineRecordKinds, Du as EventCategory, Ft as KeychainResetRecordSchema, Ml as formatSecretScope, Nt as KEYCHAIN_RESET_TRIGGER_ACTOR, Pt as KeychainAuditEntrySchema, Tc as BaseAddon, eu as normalizeSecretOwner, na as keychainAdminCapability, ra as keychainCapability, ru as parseSecretRef } from "../../dist-S-zGcCEr.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-DRqN1P5Y.mjs";
1
+ import { $l as normalizeSecretOwner, Mt as KEYCHAIN_RESET_TRIGGER_ACTOR, Nt as KeychainAuditEntrySchema, Ou as EventCategory, Pt as KeychainResetRecordSchema, Sc as BaseAddon, jl as formatSecretScope, na as keychainCapability, nu as parseSecretRef, ta as keychainAdminCapability, wl as defineRecordKinds } from "../../dist-DFRmPXTo.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-rg3jkL9j.mjs";
3
3
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
4
- import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door--186Wij_.mjs";
5
- import { a as MESH_CA_KEY_REF } from "../../constants-_bOm_ae5.mjs";
4
+ import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-mF8pNWEV.mjs";
5
+ import { a as MESH_CA_KEY_REF } from "../../constants-CjGZCAun.mjs";
6
6
  import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
7
7
  import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
8
8
  import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-BNrIzdrJ.js");
3
+ const require_dist = require("../../dist-Cadmv3rL.js");
4
4
  let node_fs = require("node:fs");
5
5
  let node_path = require("node:path");
6
6
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Du as EventCategory, Sl as createEvent, Tc as BaseAddon, Tu as errMsg, an as RECORDING_SOURCE_CAMSTACK_ADDON, cn as RecordingStatusSchema, va as mayWriteToLocation } from "../../dist-S-zGcCEr.mjs";
1
+ import { Eu as errMsg, Ou as EventCategory, Sc as BaseAddon, _a as mayWriteToLocation, in as RECORDING_SOURCE_CAMSTACK_ADDON, sn as RecordingStatusSchema, yl as createEvent } from "../../dist-DFRmPXTo.mjs";
2
2
  import { constants } from "node:fs";
3
3
  import path from "node:path";
4
4
  import * as fsp from "node:fs/promises";
@@ -3,10 +3,10 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_ms$1 = require("../../ms-LB3giGoU.js");
9
- const require_device_ca = require("../../device-ca-KNx_DazP.js");
9
+ const require_device_ca = require("../../device-ca-D0-IU1v8.js");
10
10
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
11
11
  let zod = require("zod");
12
12
  let node_crypto = require("node:crypto");
@@ -1,8 +1,8 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { An as TokenScopeSchema, Dl as defineRecordKinds, Es as userManagementCapability, Gi as isCredentialTokenPayload, H as DEVICE_ENROLLMENT_TTL_MS, Jn as authProviderCapability, K as DEVICE_NONCE_TTL_MS, Kl as isSecretMarker, Mn as UserRecordSchema, O as CREDENTIAL_TOKEN_AUDIENCE, P as CredentialTokenClaimsSchema, Tc as BaseAddon, Wr as deviceCredentialsCapability, Yl as makeSecretMarker, Yt as PREFERENCES_MAX_VALUE_BYTES, _u as userError, er as buildDeviceEnrollmentLink, nn as PreferenceNamespaceSchema, rn as PreferenceValueSchema, tn as PreferenceDeviceIdSchema, tr as buildDeviceSignatureMessage, vn as ScopedTokenSchema, xi as formatDeviceRevoker, xn as SsoBridgeClaimsSchema } from "../../dist-S-zGcCEr.mjs";
2
+ import { $n as buildDeviceEnrollmentLink, Cs as userManagementCapability, D as CREDENTIAL_TOKEN_AUDIENCE, G as DEVICE_NONCE_TTL_MS, Gl as isSecretMarker, Jl as makeSecretMarker, Jt as PREFERENCES_MAX_VALUE_BYTES, N as CredentialTokenClaimsSchema, Sc as BaseAddon, V as DEVICE_ENROLLMENT_TTL_MS, Wi as isCredentialTokenPayload, Wr as deviceCredentialsCapability, _n as ScopedTokenSchema, bi as formatDeviceRevoker, bn as SsoBridgeClaimsSchema, en as PreferenceDeviceIdSchema, er as buildDeviceSignatureMessage, jn as UserRecordSchema, kn as TokenScopeSchema, nn as PreferenceValueSchema, qn as authProviderCapability, tn as PreferenceNamespaceSchema, vu as userError, wl as defineRecordKinds } from "../../dist-DFRmPXTo.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { t as require_ms } from "../../ms-CgH2OFlD.mjs";
5
- import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-DRqN1P5Y.mjs";
5
+ import { _ as setProcessJwtSigningKey, a as importDevicePublicKey, c as rebuildDeviceCaCertificate, d as JWT_SIGNING_KEY_REF, g as processJwtSigningKey, h as loadJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, r as DEVICE_CA_SETTINGS_SECTION, s as loadDeviceCa, t as DEVICE_CA_FIELD, u as verifyDeviceSignature } from "../../device-ca-rg3jkL9j.mjs";
6
6
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
7
7
  import { z } from "zod";
8
8
  import * as crypto$1 from "node:crypto";
@@ -1,9 +1,9 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-BNrIzdrJ.js");
3
+ const require_dist = require("../../dist-Cadmv3rL.js");
4
4
  const require_dns_wire = require("../../dns-wire-B1BvF9Ao.js");
5
- const require_hub_identity = require("../../hub-identity-pN0LtUhx.js");
6
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-GafEbDm8.js");
5
+ const require_hub_identity = require("../../hub-identity-CYU8a0Hk.js");
6
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-CDCn7uUo.js");
7
7
  let zod = require("zod");
8
8
  let node_net = require("node:net");
9
9
  let node_fs = require("node:fs");
@@ -1,7 +1,7 @@
1
- import { $o as shortHostname, Do as resolveHubAddressRoles, Du as EventCategory, Et as HUB_MDNS_TXT_KEYS, Ga as pickAppLinkHub, Ki as isDefaultAppConnectionEndpoint, Kt as NetworkTunnelStartedDataSchema, Os as validateCustomAddress, Tc as BaseAddon, Tt as HUB_MDNS_SERVICE_TYPE, Tu as errMsg, Vi as isAppLinkBase, Za as preconditionOf, b as CAMSTACK_APP_LINK_ORIGIN, fr as checkRoleAddress, jo as resolveNotificationTapAddress, la as localNetworkCapability, wl as defineAddonMigrations, xo as resolveAppConnections } from "../../dist-S-zGcCEr.mjs";
1
+ import { Ao as resolveNotificationTapAddress, Bi as isAppLinkBase, Eo as resolveHubAddressRoles, Eu as errMsg, Gi as isDefaultAppConnectionEndpoint, Gt as NetworkTunnelStartedDataSchema, Ou as EventCategory, Sc as BaseAddon, Ts as validateCustomAddress, Tt as HUB_MDNS_TXT_KEYS, Wa as pickAppLinkHub, Xa as preconditionOf, Zo as shortHostname, b as CAMSTACK_APP_LINK_ORIGIN, bo as resolveAppConnections, ca as localNetworkCapability, dr as checkRoleAddress, wt as HUB_MDNS_SERVICE_TYPE, xl as defineAddonMigrations } from "../../dist-DFRmPXTo.mjs";
2
2
  import { a as emptyMdnsRecords, c as parseMdnsMessage, i as buildRecordQuery, l as parseMdnsRecords, n as MDNS_PORT, o as mergeMdnsRecords, r as buildPtrQuery, s as normalizeServiceType, t as MDNS_GROUP } from "../../dns-wire-Dm3H_7ST.mjs";
3
- import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-DSdbZxeR.mjs";
4
- import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-wAcv5VBY.mjs";
3
+ import { i as loadOrCreateHubId, r as isAnnouncedHubId } from "../../hub-identity-D5hgkkLm.mjs";
4
+ import { E as ensureTlsCert, I as readLanHttpState, N as applyLanHttp, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, d as servedHttpsLeafFingerprint, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, y as writeExtraSans } from "../../hub-mdns-ciao-BkD9s5Bz.mjs";
5
5
  import { z } from "zod";
6
6
  import { isIP } from "node:net";
7
7
  import { readFileSync } from "node:fs";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
7
  const require_log_read_filter = require("../../log-read-filter-Bi066jwU.js");
8
8
  let zod = require("zod");
9
9
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -1,4 +1,4 @@
1
- import { El as defineEntryKind, Fi as integrationInstancesCapability, Gl as isSecretFieldView, Kl as isSecretMarker, Qi as isSameAddonId, Tc as BaseAddon, Vl as isInstanceEnabled, Xn as bareAddonId, Yc as RecordIntegrationInstances, Za as preconditionOf, el as RevConflictError, pa as logDestinationCapability, wl as defineAddonMigrations } from "../../dist-S-zGcCEr.mjs";
1
+ import { Bl as isInstanceEnabled, Cl as defineEntryKind, Gl as isSecretMarker, Kc as RecordIntegrationInstances, Pi as integrationInstancesCapability, Sc as BaseAddon, Wl as isSecretFieldView, Xa as preconditionOf, Yn as bareAddonId, Zc as RevConflictError, Zi as isSameAddonId, fa as logDestinationCapability, xl as defineAddonMigrations } from "../../dist-DFRmPXTo.mjs";
2
2
  import { n as compileLogFilter, o as lineMatches } from "../../log-read-filter-D7Ev3zm-.mjs";
3
3
  import { z } from "zod";
4
4
  //#region src/builtins/loki-logging/loki-payload.ts
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
7
  let node_fs = require("node:fs");
8
8
  node_fs = require_chunk.__toESM(node_fs);
9
9
  let node_fs_promises = require("node:fs/promises");
@@ -1,4 +1,4 @@
1
- import { Du as EventCategory, Sl as createEvent, So as resolveBucketMs, Ta as metricsProviderCapability, Tc as BaseAddon, Tu as errMsg, bi as foldSnapshotByFunction, jn as UNATTRIBUTED_BUCKET_KEY, sn as ROOT_BUCKET_KEY, uo as reducePoints } from "../../dist-S-zGcCEr.mjs";
1
+ import { An as UNATTRIBUTED_BUCKET_KEY, Eu as errMsg, Ou as EventCategory, Sc as BaseAddon, lo as reducePoints, on as ROOT_BUCKET_KEY, wa as metricsProviderCapability, xo as resolveBucketMs, yi as foldSnapshotByFunction, yl as createEvent } from "../../dist-DFRmPXTo.mjs";
2
2
  import * as fs$1 from "node:fs";
3
3
  import { constants, readFileSync } from "node:fs";
4
4
  import { access, readFile, readdir } from "node:fs/promises";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-BNrIzdrJ.js");
6
+ const require_dist = require("../../dist-Cadmv3rL.js");
7
7
  const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
8
8
  let node_fs = require("node:fs");
9
9
  node_fs = require_chunk.__toESM(node_fs);
@@ -232,19 +232,18 @@ function gpuVendor(c) {
232
232
  if (/amd|radeon/i.test(c.name)) return "amd";
233
233
  return null;
234
234
  }
235
+ function realAdapters(controllers) {
236
+ return controllers.filter((c) => c.name.length > 0 && !VIRTUAL_ADAPTER.test(c.name));
237
+ }
235
238
  /**
236
- * The accelerator the node should treat as its GPU. Same preference as the
237
- * Linux probe — NVIDIA, then Intel, then AMD — so a laptop with an Intel iGPU
238
- * and a discrete card is described the way the rest of the system already
239
- * expects. Virtual adapters never count.
239
+ * The node's `gpu` slot: Intel, then AMD — the same iGPU model the Linux probe
240
+ * fills. An NVIDIA card never takes it (it has its own slot,
241
+ * `classifyWindowsNvidia`), so a host with both keeps OpenVINO on the iGPU.
242
+ * Virtual adapters never count.
240
243
  */
241
244
  function classifyWindowsGpu(controllers) {
242
- const real = controllers.filter((c) => c.name.length > 0 && !VIRTUAL_ADAPTER.test(c.name));
243
- for (const wanted of [
244
- "nvidia",
245
- "intel",
246
- "amd"
247
- ]) {
245
+ const real = realAdapters(controllers);
246
+ for (const wanted of ["intel", "amd"]) {
248
247
  const hit = real.find((c) => gpuVendor(c) === wanted);
249
248
  if (hit) return {
250
249
  type: wanted,
@@ -253,6 +252,11 @@ function classifyWindowsGpu(controllers) {
253
252
  }
254
253
  return null;
255
254
  }
255
+ /** An NVIDIA card from the video controllers, or null. Virtual adapters never count. */
256
+ function classifyWindowsNvidia(controllers) {
257
+ const hit = realAdapters(controllers).find((c) => gpuVendor(c) === "nvidia");
258
+ return hit ? { name: hit.name } : null;
259
+ }
256
260
  /**
257
261
  * An AMD XDNA NPU from PnP ids: `PCI\VEN_1022&DEV_1502` (Phoenix / Hawk Point)
258
262
  * or `DEV_17F0` (Strix / Krackan). Present-only, exactly like the Linux probe.
@@ -270,21 +274,24 @@ async function viaPowershell(run, systemRoot) {
270
274
  const parsed = parsePowershellOutput(await run(file, args));
271
275
  return {
272
276
  gpu: classifyWindowsGpu(parsed.controllers),
277
+ nvidia: classifyWindowsNvidia(parsed.controllers),
273
278
  npu: classifyWindowsAmdNpu(parsed.pnp),
274
279
  source: "powershell"
275
280
  };
276
281
  }
277
282
  async function viaWmic(run) {
278
283
  const [video, amd] = await Promise.all([run("wmic", WMIC_VIDEO_ARGS), run("wmic", WMIC_AMD_PNP_ARGS).catch(() => "")]);
284
+ const controllers = parseWmicCsv(video);
279
285
  return {
280
- gpu: classifyWindowsGpu(parseWmicCsv(video)),
286
+ gpu: classifyWindowsGpu(controllers),
287
+ nvidia: classifyWindowsNvidia(controllers),
281
288
  npu: classifyWindowsAmdNpu(parseWmicCsv(amd)),
282
289
  source: "wmic"
283
290
  };
284
291
  }
285
292
  /**
286
293
  * GPU + AMD NPU on a Windows host. NEVER throws: a probe that cannot run is
287
- * `{ gpu: null, npu: null, source: 'none' }` and boot goes on — the node then
294
+ * `{ gpu: null, nvidia: null, npu: null, source: 'none' }` and boot goes on — the node then
288
295
  * scores as a CPU node, which is correct for hardware we could not see.
289
296
  */
290
297
  async function probeWindowsHardware(run, options = {}) {
@@ -299,6 +306,7 @@ async function probeWindowsHardware(run, options = {}) {
299
306
  options.onFallback?.(`wmic probe failed (${wmicError instanceof Error ? wmicError.message : String(wmicError)}); hardware unknown`);
300
307
  return {
301
308
  gpu: null,
309
+ nvidia: null,
302
310
  npu: null,
303
311
  source: "none"
304
312
  };
@@ -470,6 +478,7 @@ var PlatformScorer = class {
470
478
  } });
471
479
  let gpu = null;
472
480
  let npu = null;
481
+ let nvidiaProbe = null;
473
482
  const coral = this.probeCoral().info;
474
483
  if (platform === "darwin" && arch === "arm64") {
475
484
  gpu = {
@@ -479,9 +488,10 @@ var PlatformScorer = class {
479
488
  npu = { type: "apple-ane" };
480
489
  }
481
490
  if (platform === "win32") {
482
- const nvidia = await this.probeNvidiaSmi();
491
+ const smi = await this.probeNvidiaSmi();
483
492
  const win = await this.probeWindowsHardwareSafely();
484
- gpu = nvidia ?? win.gpu;
493
+ gpu = win.gpu;
494
+ nvidiaProbe = smi ?? win.nvidia;
485
495
  npu = win.npu;
486
496
  if (gpu) this.logger.info("Windows GPU detected", { meta: {
487
497
  type: gpu.type,
@@ -495,8 +505,7 @@ var PlatformScorer = class {
495
505
  } });
496
506
  }
497
507
  if (platform === "linux") {
498
- const nvidia = await this.probeNvidiaSmi();
499
- if (nvidia) gpu = nvidia;
508
+ nvidiaProbe = await this.probeNvidiaSmi();
500
509
  const listRenderNodes = () => {
501
510
  try {
502
511
  return node_fs.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
@@ -578,6 +587,7 @@ var PlatformScorer = class {
578
587
  } });
579
588
  }
580
589
  }
590
+ const nvidia = nvidiaProbe === null ? null : this.describeNvidiaSlot(nvidiaProbe);
581
591
  const hardware = {
582
592
  platform,
583
593
  arch,
@@ -587,7 +597,8 @@ var PlatformScorer = class {
587
597
  availableRAM_MB,
588
598
  gpu,
589
599
  npu,
590
- coral
600
+ coral,
601
+ ...nvidia === null ? {} : { nvidia }
591
602
  };
592
603
  const accelerators = await this.readAcceleratorCompute();
593
604
  return accelerators === null ? hardware : {
@@ -670,6 +681,22 @@ var PlatformScorer = class {
670
681
  detection
671
682
  };
672
683
  }
684
+ /**
685
+ * The NVIDIA slot. This process has no ONNX Runtime to ask, so the card is
686
+ * reported present and — until a node's runtime lists the CUDA execution
687
+ * provider (#605) — not usable, with the reason logged on every probe the
688
+ * way an unusable Coral is: silence would read as "no NVIDIA".
689
+ */
690
+ describeNvidiaSlot(probe) {
691
+ const nvidia = require_dist.describeNvidia(probe, null);
692
+ if (nvidia.usable) this.logger.info("NVIDIA GPU detected", { meta: { name: nvidia.name } });
693
+ else this.logger.warn("NVIDIA GPU present but not usable", { meta: {
694
+ name: nvidia.name,
695
+ memoryMB: nvidia.memoryMB,
696
+ reason: nvidia.reason
697
+ } });
698
+ return nvidia;
699
+ }
673
700
  /** NVIDIA's own tool: exact model and VRAM. Null when absent or failing. */
674
701
  async probeNvidiaSmi() {
675
702
  try {
@@ -682,7 +709,6 @@ var PlatformScorer = class {
682
709
  if (!output) return null;
683
710
  const [name, mem] = output.split(",").map((s) => s.trim());
684
711
  return {
685
- type: "nvidia",
686
712
  name: name ?? "NVIDIA GPU",
687
713
  memoryMB: parseInt(mem ?? "0")
688
714
  };
@@ -712,6 +738,7 @@ var PlatformScorer = class {
712
738
  this.logger.warn("Windows hardware probe failed — scoring as a CPU node", { meta: { error: require_dist.errMsg(err) } });
713
739
  return {
714
740
  gpu: null,
741
+ nvidia: null,
715
742
  npu: null,
716
743
  source: "none"
717
744
  };
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { Ba as parseAcceleratorFactsJson, Du as EventCategory, Tc as BaseAddon, Tu as errMsg, Wo as scoreRuntimes, kl as emitReadiness, ni as enumerateInferenceDevices, qa as platformProbeCapability } from "../../dist-S-zGcCEr.mjs";
2
+ import { Dl as emitReadiness, Eu as errMsg, Ka as platformProbeCapability, Ou as EventCategory, Sc as BaseAddon, Tl as describeNvidia, kl as enumerateInferenceDevices, lu as scoreRuntimes, za as parseAcceleratorFactsJson } from "../../dist-DFRmPXTo.mjs";
3
3
  import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
4
4
  import * as fs$1 from "node:fs";
5
5
  import * as path$1 from "node:path";
@@ -225,19 +225,18 @@ function gpuVendor(c) {
225
225
  if (/amd|radeon/i.test(c.name)) return "amd";
226
226
  return null;
227
227
  }
228
+ function realAdapters(controllers) {
229
+ return controllers.filter((c) => c.name.length > 0 && !VIRTUAL_ADAPTER.test(c.name));
230
+ }
228
231
  /**
229
- * The accelerator the node should treat as its GPU. Same preference as the
230
- * Linux probe — NVIDIA, then Intel, then AMD — so a laptop with an Intel iGPU
231
- * and a discrete card is described the way the rest of the system already
232
- * expects. Virtual adapters never count.
232
+ * The node's `gpu` slot: Intel, then AMD — the same iGPU model the Linux probe
233
+ * fills. An NVIDIA card never takes it (it has its own slot,
234
+ * `classifyWindowsNvidia`), so a host with both keeps OpenVINO on the iGPU.
235
+ * Virtual adapters never count.
233
236
  */
234
237
  function classifyWindowsGpu(controllers) {
235
- const real = controllers.filter((c) => c.name.length > 0 && !VIRTUAL_ADAPTER.test(c.name));
236
- for (const wanted of [
237
- "nvidia",
238
- "intel",
239
- "amd"
240
- ]) {
238
+ const real = realAdapters(controllers);
239
+ for (const wanted of ["intel", "amd"]) {
241
240
  const hit = real.find((c) => gpuVendor(c) === wanted);
242
241
  if (hit) return {
243
242
  type: wanted,
@@ -246,6 +245,11 @@ function classifyWindowsGpu(controllers) {
246
245
  }
247
246
  return null;
248
247
  }
248
+ /** An NVIDIA card from the video controllers, or null. Virtual adapters never count. */
249
+ function classifyWindowsNvidia(controllers) {
250
+ const hit = realAdapters(controllers).find((c) => gpuVendor(c) === "nvidia");
251
+ return hit ? { name: hit.name } : null;
252
+ }
249
253
  /**
250
254
  * An AMD XDNA NPU from PnP ids: `PCI\VEN_1022&DEV_1502` (Phoenix / Hawk Point)
251
255
  * or `DEV_17F0` (Strix / Krackan). Present-only, exactly like the Linux probe.
@@ -263,21 +267,24 @@ async function viaPowershell(run, systemRoot) {
263
267
  const parsed = parsePowershellOutput(await run(file, args));
264
268
  return {
265
269
  gpu: classifyWindowsGpu(parsed.controllers),
270
+ nvidia: classifyWindowsNvidia(parsed.controllers),
266
271
  npu: classifyWindowsAmdNpu(parsed.pnp),
267
272
  source: "powershell"
268
273
  };
269
274
  }
270
275
  async function viaWmic(run) {
271
276
  const [video, amd] = await Promise.all([run("wmic", WMIC_VIDEO_ARGS), run("wmic", WMIC_AMD_PNP_ARGS).catch(() => "")]);
277
+ const controllers = parseWmicCsv(video);
272
278
  return {
273
- gpu: classifyWindowsGpu(parseWmicCsv(video)),
279
+ gpu: classifyWindowsGpu(controllers),
280
+ nvidia: classifyWindowsNvidia(controllers),
274
281
  npu: classifyWindowsAmdNpu(parseWmicCsv(amd)),
275
282
  source: "wmic"
276
283
  };
277
284
  }
278
285
  /**
279
286
  * GPU + AMD NPU on a Windows host. NEVER throws: a probe that cannot run is
280
- * `{ gpu: null, npu: null, source: 'none' }` and boot goes on — the node then
287
+ * `{ gpu: null, nvidia: null, npu: null, source: 'none' }` and boot goes on — the node then
281
288
  * scores as a CPU node, which is correct for hardware we could not see.
282
289
  */
283
290
  async function probeWindowsHardware(run, options = {}) {
@@ -292,6 +299,7 @@ async function probeWindowsHardware(run, options = {}) {
292
299
  options.onFallback?.(`wmic probe failed (${wmicError instanceof Error ? wmicError.message : String(wmicError)}); hardware unknown`);
293
300
  return {
294
301
  gpu: null,
302
+ nvidia: null,
295
303
  npu: null,
296
304
  source: "none"
297
305
  };
@@ -463,6 +471,7 @@ var PlatformScorer = class {
463
471
  } });
464
472
  let gpu = null;
465
473
  let npu = null;
474
+ let nvidiaProbe = null;
466
475
  const coral = this.probeCoral().info;
467
476
  if (platform === "darwin" && arch === "arm64") {
468
477
  gpu = {
@@ -472,9 +481,10 @@ var PlatformScorer = class {
472
481
  npu = { type: "apple-ane" };
473
482
  }
474
483
  if (platform === "win32") {
475
- const nvidia = await this.probeNvidiaSmi();
484
+ const smi = await this.probeNvidiaSmi();
476
485
  const win = await this.probeWindowsHardwareSafely();
477
- gpu = nvidia ?? win.gpu;
486
+ gpu = win.gpu;
487
+ nvidiaProbe = smi ?? win.nvidia;
478
488
  npu = win.npu;
479
489
  if (gpu) this.logger.info("Windows GPU detected", { meta: {
480
490
  type: gpu.type,
@@ -488,8 +498,7 @@ var PlatformScorer = class {
488
498
  } });
489
499
  }
490
500
  if (platform === "linux") {
491
- const nvidia = await this.probeNvidiaSmi();
492
- if (nvidia) gpu = nvidia;
501
+ nvidiaProbe = await this.probeNvidiaSmi();
493
502
  const listRenderNodes = () => {
494
503
  try {
495
504
  return fs$1.readdirSync("/dev/dri").filter((n) => n.startsWith("renderD")).map((n) => `/dev/dri/${n}`);
@@ -571,6 +580,7 @@ var PlatformScorer = class {
571
580
  } });
572
581
  }
573
582
  }
583
+ const nvidia = nvidiaProbe === null ? null : this.describeNvidiaSlot(nvidiaProbe);
574
584
  const hardware = {
575
585
  platform,
576
586
  arch,
@@ -580,7 +590,8 @@ var PlatformScorer = class {
580
590
  availableRAM_MB,
581
591
  gpu,
582
592
  npu,
583
- coral
593
+ coral,
594
+ ...nvidia === null ? {} : { nvidia }
584
595
  };
585
596
  const accelerators = await this.readAcceleratorCompute();
586
597
  return accelerators === null ? hardware : {
@@ -663,6 +674,22 @@ var PlatformScorer = class {
663
674
  detection
664
675
  };
665
676
  }
677
+ /**
678
+ * The NVIDIA slot. This process has no ONNX Runtime to ask, so the card is
679
+ * reported present and — until a node's runtime lists the CUDA execution
680
+ * provider (#605) — not usable, with the reason logged on every probe the
681
+ * way an unusable Coral is: silence would read as "no NVIDIA".
682
+ */
683
+ describeNvidiaSlot(probe) {
684
+ const nvidia = describeNvidia(probe, null);
685
+ if (nvidia.usable) this.logger.info("NVIDIA GPU detected", { meta: { name: nvidia.name } });
686
+ else this.logger.warn("NVIDIA GPU present but not usable", { meta: {
687
+ name: nvidia.name,
688
+ memoryMB: nvidia.memoryMB,
689
+ reason: nvidia.reason
690
+ } });
691
+ return nvidia;
692
+ }
666
693
  /** NVIDIA's own tool: exact model and VRAM. Null when absent or failing. */
667
694
  async probeNvidiaSmi() {
668
695
  try {
@@ -675,7 +702,6 @@ var PlatformScorer = class {
675
702
  if (!output) return null;
676
703
  const [name, mem] = output.split(",").map((s) => s.trim());
677
704
  return {
678
- type: "nvidia",
679
705
  name: name ?? "NVIDIA GPU",
680
706
  memoryMB: parseInt(mem ?? "0")
681
707
  };
@@ -705,6 +731,7 @@ var PlatformScorer = class {
705
731
  this.logger.warn("Windows hardware probe failed — scoring as a CPU node", { meta: { error: errMsg(err) } });
706
732
  return {
707
733
  gpu: null,
734
+ nvidia: null,
708
735
  npu: null,
709
736
  source: "none"
710
737
  };
@@ -51,6 +51,13 @@ export declare class PlatformScorer {
51
51
  * only when the answer changed, so a 60 s cadence stays quiet.
52
52
  */
53
53
  reprobeAccelerators(): AcceleratorReprobe | null;
54
+ /**
55
+ * The NVIDIA slot. This process has no ONNX Runtime to ask, so the card is
56
+ * reported present and — until a node's runtime lists the CUDA execution
57
+ * provider (#605) — not usable, with the reason logged on every probe the
58
+ * way an unusable Coral is: silence would read as "no NVIDIA".
59
+ */
60
+ private describeNvidiaSlot;
54
61
  /** NVIDIA's own tool: exact model and VRAM. Null when absent or failing. */
55
62
  private probeNvidiaSmi;
56
63
  /** Windows WMI probe; bounded, and a failure is a log line, never a boot failure. */