@camstack/server 1.2.891 → 1.2.892

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 (117) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  3. package/dist/api/trpc/generated-cap-routers.js +194 -39
  4. package/dist/core/addon/addon-registry.service.js +47 -0
  5. package/dist/core/addon/retire-undeclared-fixed-integrations.js +57 -0
  6. package/package.json +31 -15
  7. package/system/dist/addon-runner.js +25 -9
  8. package/system/dist/addon-runner.mjs +25 -9
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  15. package/system/dist/builtins/autotrack/index.js +1 -1
  16. package/system/dist/builtins/autotrack/index.mjs +1 -1
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  19. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/system/dist/builtins/camera-grid/addon.d.ts +65 -41
  22. package/system/dist/builtins/camera-grid/grid-blocks.d.ts +51 -0
  23. package/system/dist/builtins/camera-grid/grid-camera-device.d.ts +4 -3
  24. package/system/dist/builtins/camera-grid/grid-layout-native-provider.d.ts +3 -1
  25. package/system/dist/builtins/camera-grid/grid-plan.d.ts +3 -3
  26. package/system/dist/builtins/camera-grid/index.d.ts +2 -6
  27. package/system/dist/builtins/camera-grid/index.js +431 -727
  28. package/system/dist/builtins/camera-grid/index.mjs +428 -719
  29. package/system/dist/builtins/composer/composed-device.d.ts +12 -2
  30. package/system/dist/builtins/composer/composer.addon.js +28 -10
  31. package/system/dist/builtins/composer/composer.addon.mjs +28 -10
  32. package/system/dist/builtins/composer/composition-declarations.d.ts +3 -1
  33. package/system/dist/builtins/console-logging/index.js +1 -1
  34. package/system/dist/builtins/console-logging/index.mjs +1 -1
  35. package/system/dist/builtins/core-blocks/core-blocks.addon.js +174 -39
  36. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +175 -40
  37. package/system/dist/builtins/core-blocks/hero-layout-service.d.ts +19 -1
  38. package/system/dist/builtins/core-blocks/power-source-devices.d.ts +9 -0
  39. package/system/dist/builtins/core-blocks/power-source-service.d.ts +39 -2
  40. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  41. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  42. package/system/dist/builtins/device-manager/device-identifiers-action.d.ts +9 -0
  43. package/system/dist/builtins/device-manager/device-manager.addon.js +172 -5
  44. package/system/dist/builtins/device-manager/device-manager.addon.mjs +172 -5
  45. package/system/dist/builtins/device-manager/device-meta-types.d.ts +5 -1
  46. package/system/dist/builtins/device-manager/device-row-store.d.ts +3 -2
  47. package/system/dist/builtins/device-manager/device-state-mirror.d.ts +7 -0
  48. package/system/dist/builtins/device-manager/workload-transition.d.ts +23 -0
  49. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  50. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  51. package/system/dist/builtins/keychain/index.js +4 -4
  52. package/system/dist/builtins/keychain/index.mjs +4 -4
  53. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  54. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  55. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  56. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  57. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  58. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  59. package/system/dist/builtins/loki-logging/index.js +1 -1
  60. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  61. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  62. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  63. package/system/dist/builtins/platform-probe/index.js +1 -1
  64. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  65. package/system/dist/builtins/record-entries/index.js +1 -1
  66. package/system/dist/builtins/record-entries/index.mjs +1 -1
  67. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  68. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  69. package/system/dist/builtins/snapshot/index.js +1 -1
  70. package/system/dist/builtins/snapshot/index.mjs +1 -1
  71. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  72. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  73. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  74. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  75. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  76. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  77. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  78. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  79. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  80. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  81. package/system/dist/builtins/winston-logging/index.js +1 -1
  82. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  83. package/system/dist/{capture-engine-DXz37Mjg.js → capture-engine-DHmlkW_d.js} +1 -1
  84. package/system/dist/{capture-engine-nmelnj-Y.mjs → capture-engine-sl6e9f9S.mjs} +1 -1
  85. package/system/dist/{composition-sources-uphZtYtN.mjs → composition-sources-CznD85Ri.mjs} +1 -1
  86. package/system/dist/{composition-sources-BLn3cU74.js → composition-sources-PqcZfe3j.js} +1 -1
  87. package/system/dist/{constants-DWU46D02.mjs → constants-CHwj_mIM.mjs} +1 -1
  88. package/system/dist/{constants-BAaGwvKn.js → constants-_2SOk0By.js} +1 -1
  89. package/system/dist/{device-ca-CK6mLB2w.mjs → device-ca-D2H1EMUY.mjs} +1 -1
  90. package/system/dist/{device-ca-jbH_rqZh.js → device-ca-WIEO5ZcE.js} +1 -1
  91. package/system/dist/{dist-Dgq9nuvh.mjs → dist-DbAhCrHy.mjs} +2366 -444
  92. package/system/dist/{dist-m5beNMze.js → dist-yx2KHo3b.js} +2467 -443
  93. package/system/dist/file-host-worker.js +1 -1
  94. package/system/dist/file-host-worker.mjs +1 -1
  95. package/system/dist/{hub-identity-DlBBoHJC.mjs → hub-identity-BcvZqT0L.mjs} +1 -1
  96. package/system/dist/{hub-identity-CKCA89XP.js → hub-identity-Buegac-w.js} +1 -1
  97. package/system/dist/{hub-mdns-ciao-B8uFW-RG.mjs → hub-mdns-ciao-B6K_dO2s.mjs} +2 -2
  98. package/system/dist/{hub-mdns-ciao-CqcCGPdi.js → hub-mdns-ciao-DcNPj7WJ.js} +2 -2
  99. package/system/dist/index.js +33 -19
  100. package/system/dist/index.mjs +33 -19
  101. package/system/dist/kernel/moleculer/child-cap-dispatch.d.ts +3 -6
  102. package/system/dist/kernel/moleculer/switch-toggle.d.ts +7 -2
  103. package/system/dist/{legacy-integration-rows-door-Co0gj1Lm.js → legacy-integration-rows-door-BsZyVNiR.js} +1 -1
  104. package/system/dist/{legacy-integration-rows-door-HI4nmSe_.mjs → legacy-integration-rows-door-DHOJeDPG.mjs} +1 -1
  105. package/system/dist/{rename-composition-block-UeVUYCwx.js → rename-composition-block-BXMor7MR.js} +1 -1
  106. package/system/dist/{rename-composition-block-BthBMrXA.mjs → rename-composition-block-DcVS1LuC.mjs} +1 -1
  107. package/system/dist/{restore-archive-P-ICnU58.mjs → restore-archive-BG8VJ8Ar.mjs} +82 -82
  108. package/system/dist/{restore-archive-CJLsfBwK.js → restore-archive-BURufVQd.js} +1 -1
  109. package/system/dist/{wal-maintenance-qWjb7_f2.mjs → wal-maintenance-B4wGD6QR.mjs} +0 -0
  110. package/system/dist/{wal-maintenance-CUtwx-2Z.js → wal-maintenance-CeaJyKNT.js} +0 -0
  111. package/system/package.json +2 -5
  112. package/system/dist/builtins/camera-grid/grid-camera-declarations.d.ts +0 -59
  113. package/system/dist/builtins/camera-grid/grid-instances.d.ts +0 -40
  114. package/system/dist/builtins/camera-grid/grid-record-kinds.d.ts +0 -31
  115. package/system/dist/builtins/camera-grid/migrations/__fixtures__/seed.d.ts +0 -13
  116. package/system/dist/builtins/camera-grid/migrations/camera-grids-to-records.d.ts +0 -26
  117. package/system/dist/builtins/camera-grid/migrations/index.d.ts +0 -6
@@ -1,7 +1,7 @@
1
- import { $a as resolveCoreBlockFiles, $r as fanAxisPath, Ac as actionEffect, Al as ruleFireOfClaim, Ao as stableIdMapOf, Ar as describeComposableCaps, B as DEFAULT_HOLD_OVERRIDE, Bc as collectSecretMarkerRefs, Bl as vocabActionIdFor, Cn as actionSourceCapability, Cs as composedDeviceRef, D as CORE_BLOCK_ADDON_PREFIX, Dr as defaultTagColorId, E as CORE_BLOCKS_ADDON_ID, Ea as powerSourceLinkOfComposition, En as addonIdOfActionId, Eo as siteFor, Et as INTERNAL_ACTION_PREFIX, Fa as readRecipeLiteral, Fi as kebabToCamel, Fn as assertStepsOffered, Ft as MediaPlayerStatusSchema, Ga as removeFromTags, Gi as lockDoorLinkOfComposition, Gl as DeviceRole, Gn as buildHeroModel, Go as timedRunLimitOf, Gt as PowerSourceInfoSchema, Ha as remoteCapability, Hn as buildCapabilityLookup, Ho as tagsCapability, Ia as readStoredRemoteConfig, Ja as replacedFieldKeys, Jc as defineEntryKind, Jo as timedRunSeconds, Ka as renameInTags, Kc as defineAddonMigrations, Kl as DeviceType$1, Ko as timedRunMaxIn, Kr as evaluateStepCondition, Ma as projectDeviceRow, N as CoreBlockSchema, Na as proposeRunningThreshold, Nl as secretTreeFromSchema, Nn as appendTrace, Ns as helperMembers, Oa as prepareRecipeUnits, Oc as VocabActionError, Os as compositionSourceKey, Ps as historyRetentionFromSettings, Qa as resolveCoreBlockEntry, Qc as entryBody, Qn as capUnitResolver, Qo as validateComposition, Rl as transformSecretWrite, Rt as NcTaggedRuleKindSchema, Sa as planComposition, T as COMPOSER_RUNNER_ID, Ta as powerSourceCapability, Ti as isBuiltinTemplateId, Tn as actionsCapability, Ts as compositionFeatureEnabled, Tt as IDLE_ACTION_STATUS, Ua as remoteLayoutComponentsCapability, Uc as commandOrigin$1, Uo as templateCapability, Va as reexpandAutomationInstance, Vi as localDateOf, Vl as vocabCall, Vn as buildActionSteps, Vo as tagKey, Wa as remoteSourceSteps, Wo as timedRunCapability, Ya as resolveActionVariables, Yc as defineRecordKinds, Yl as EventCategory$1, Yo as toTimings, Yt as QuantityUnitError, Zn as canonicalStoredStepTargets, Zt as REMOTE_MEDIA_COMMANDS, _ as BUILTIN_REMOTE_COMPONENTS, _c as RecordIntegrationInstances, _i as integrationInstancesCapability, _n as TagStyleSchema, _r as coreBlockSourceKind, ai as findChannelSource, ar as collectWhenMirrorSources, as as weekdayOfLocalDate, c as ActionError, ca as normalizeActionUnits, co as resolveStepArgs, cr as compileScalarOverride, cs as zoneOnlySite, ct as EMPTY_REMOTE_CONFIG, d as ActionTargetResolver, do as runSteps, dr as compositionSourceRefs, ds as DAY_MS, dt as FAN_OSCILLATION_AXES, en as RemoteAssumedStateSchema, eo as resolveHeroLayout, es as validateSchedulerInput, f as ActionVariableSchema, fr as compositionUnionReads, ft as FAN_OSCILLATION_AXIS_SETTABLE, g as BUILTIN_AUTOMATION_TEMPLATES, gi as instanceCodeHash, gl as isSecretRefOwnedBy, gn as TagNameSchema, gr as coreBlockIdFromAddonId, gs as HelperMemberSchema, gt as FanPresetSchema, h as AutomationTemplatePayloadSchema, hi as heroLayoutCapability, hr as coreBlockComposition, il as hydrateSchema, ir as collectDeviceTemplates, j as ConditionMirror, ka as problemsBlockSave, ki as isInternalActionId, kl as resolveSecretMarkers, l as ActionMinDelaySecSchema, la as normalizeCoreBlockWrite, ls as COMPOSER_ADDON_ID, m as AutomationStateDocSchema, ma as occurrenceOn, mi as hasTimeLeaves, ml as isSecretMarker, mo as schedulersCapability, mr as coreBlockAddonId, mt as FanControlStatusSchema, n as ACTION_TARGET_INVALIDATION_EVENTS, ni as fanPresetsCapability, nn as RunningStateStatusSchema, nr as checkTemplatePayload, oa as nextOccurrence, on as SchedulerError, oo as resolveRemoteSource, ot as EMPTY_AUTOMATION_STATE, qa as replaceRecipeLiteral, ql as errMsg$1, qn as builtinAutomationTemplate, qo as timedRunQuickRun, qr as evaluateWhenTree, qs as BaseAddon, s as ALL_CAPABILITY_DEFINITIONS, sa as nextTimeBoundaryInMs, sn as SchedulerSchema, st as EMPTY_REMOTE_ASSUMED_STATE, tn as RemoteLayoutPayloadSchema, tt as DeclaredDevices, u as ActionStepSchema, ua as normalizeTags, ui as generateAutomationBlock, un as SetOscillationAxisInputSchema, us as CompositionSchema, ut as FAN_CAPTURE_FIELDS, vi as internalActionId, vn as TagsFieldSchema, vr as coreBlocksCapability, wa as powerSourceActuatorConflicts, wn as actionWaitTotalMs, ws as composedDeviceStableId, xr as customKeyOfRole, yn as TemplateKindSchema, yo as seedInstanceOnce, ys as canonicalStoredBlockTarget } from "../../dist-Dgq9nuvh.mjs";
1
+ import { $a as remoteCapability, $r as evaluateWhenTree, $t as REMOTE_MEDIA_COMMANDS, An as actionsCapability, B as DEFAULT_HOLD_OVERRIDE, Ba as problemsBlockSave, Bn as assertStepsOffered, Bs as composedDeviceStableId, Bt as NcTaggedRuleKindSchema, Ci as instanceCodeHash, Cr as coreBlockSourceKind, D as CORE_BLOCK_ADDON_PREFIX, Dr as customKeyOfRole, Ds as DAY_MS, Dt as IDLE_ACTION_STATUS, E as CORE_BLOCKS_ADDON_ID, Eo as schedulersCapability, Es as CompositionSchema, Fa as powerSourceActuatorConflicts, Fs as canonicalStoredBlockTarget, Gc as VocabActionError, Ia as powerSourceCapability, Ir as describeComposableCaps, Ka as readRecipeLiteral, Kl as resolveSecretMarkers, Kn as buildActionSteps, La as powerSourceLinkOfComposition, Li as isInternalActionId, Lt as MediaPlayerStatusSchema, Mi as isBuiltinTemplateId, Ms as HelperMemberSchema, N as CoreBlockSchema, Na as planComposition, Nl as isSecretRefOwnedBy, Nr as defaultTagColorId, On as actionSourceCapability, Ot as INTERNAL_ACTION_PREFIX, Pc as RecordIntegrationInstances, Qa as reexpandAutomationInstance, Qn as builtinAutomationTemplate, Qr as evaluateStepCondition, Rn as appendTrace, Sn as TemplateKindSchema, So as runSteps, Sr as coreBlockIdFromAddonId, T as COMPOSER_RUNNER_ID, Ta as occurrenceOn, Ti as internalActionId, Ts as COMPOSER_ADDON_ID, Ua as projectDeviceRow, Uo as stableIdMapOf, Vs as compositionFeatureEnabled, Wa as proposeRunningThreshold, Wi as kebabToCamel, Ws as compositionSourceKey, Xl as secretTreeFromSchema, Xn as buildHeroModel, Xs as historyRetentionFromSettings, Ys as helperMembers, Zi as localDateOf, Zt as QuantityUnitError, _ as BUILTIN_REMOTE_COMPONENTS, _a as nextOccurrence, _o as resolveRemoteSource, _r as compositionSourceRefs, _t as FanPresetSchema, ai as fanAxisPath, ao as replacedFieldKeys, as as timedRunLimitOf, ba as normalizeCoreBlockWrite, bi as hasTimeLeaves, bn as TagStyleSchema, br as coreBlockAddonId, c as ActionError, ci as fanPresetsCapability, cn as SWITCH_DEFAULT_OPTIONS, cs as timedRunSeconds, ct as EMPTY_REMOTE_ASSUMED_STATE, cu as DeviceRole, d as ActionTargetResolver, di as findChannelSource, dl as defineEntryKind, do as resolveHeroLayout, dt as FAN_CAPTURE_FIELDS, eo as remoteLayoutComponentsCapability, f as ActionVariableSchema, fl as defineRecordKinds, fs as validateComposition, ft as FAN_OSCILLATION_AXES, fu as EventCategory$1, g as BUILTIN_AUTOMATION_TEMPLATES, gi as generateAutomationBlock, h as AutomationTemplatePayloadSchema, hl as entryBody, ht as FanControlStatusSchema, in as RunningStateStatusSchema, io as replaceRecipeLiteral, is as timedRunCapability, iu as vocabCall, j as ConditionMirror, jl as isSecretMarker, jn as addonIdOfActionId, jo as seedInstanceOnce, kn as actionWaitTotalMs, l as ActionMinDelaySecSchema, ll as defineAddonMigrations, ln as SchedulerError, lo as resolveCoreBlockEntry, lr as collectDeviceTemplates, ls as toTimings, lt as EMPTY_REMOTE_CONFIG, lu as DeviceType$1, m as AutomationStateDocSchema, mr as compileScalarOverride, ms as validateSchedulerInput, n as ACTION_TARGET_INVALIDATION_EVENTS, nn as RemoteAssumedStateSchema, no as removeFromTags, nr as canonicalStoredStepTargets, ns as tagsCapability, ol as commandOrigin$1, oo as resolveActionVariables, os as timedRunMaxIn, pn as SetOscillationAxisInputSchema, pt as FAN_OSCILLATION_AXIS_SETTABLE, qa as readStoredRemoteConfig, qc as actionEffect, ql as ruleFireOfClaim, qn as buildCapabilityLookup, qt as PowerSourceInfoSchema, rl as collectSecretMarkerRefs, rn as RemoteLayoutPayloadSchema, ro as renameInTags, rr as capUnitResolver, rs as templateCapability, ru as vocabActionIdFor, s as ALL_CAPABILITY_DEFINITIONS, sr as checkTemplatePayload, ss as timedRunQuickRun, st as EMPTY_AUTOMATION_STATE, ta as lockDoorLinkOfComposition, to as remoteSourceSteps, ts as tagKey, tt as DeclaredDevices, tu as transformSecretWrite, u as ActionStepSchema, uc as BaseAddon, un as SchedulerSchema, uo as resolveCoreBlockFiles, ur as collectWhenMirrorSources, uu as errMsg$1, va as nextTimeBoundaryInMs, vr as compositionUnionReads, wi as integrationInstancesCapability, wr as coreBlocksCapability, ws as zoneOnlySite, xa as normalizeTags, xi as heroLayoutCapability, xl as hydrateSchema, xn as TagsFieldSchema, xr as coreBlockComposition, ya as normalizeActionUnits, yn as TagNameSchema, yo as resolveStepArgs, ys as weekdayOfLocalDate, za as prepareRecipeUnits, zo as siteFor, zs as composedDeviceRef } from "../../dist-DbAhCrHy.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
- import { i as parseDeviceStateChanged, r as isRecord$1, t as describeCompositionSources } from "../../composition-sources-uphZtYtN.mjs";
4
- import { i as capSeriesKey } from "../../capture-engine-nmelnj-Y.mjs";
3
+ import { i as parseDeviceStateChanged, r as isRecord$1, t as describeCompositionSources } from "../../composition-sources-CznD85Ri.mjs";
4
+ import { i as capSeriesKey } from "../../capture-engine-sl6e9f9S.mjs";
5
5
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
6
6
  import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
7
7
  import { n as readCurrentCommandOrigin } from "../../cap-call-scope-Bic6Ekfw.mjs";
@@ -10,7 +10,7 @@ import { z } from "zod";
10
10
  import { randomUUID } from "node:crypto";
11
11
  import { customizationBlockName } from "@camstack/types/node";
12
12
  import * as path$1 from "node:path";
13
- import { nodeIdOfScopedKey } from "@camstack/types/addon";
13
+ import { isCapMethodAbsent, nodeIdOfScopedKey } from "@camstack/types/addon";
14
14
  import * as fs from "node:fs/promises";
15
15
  import { isDeepStrictEqual } from "node:util";
16
16
  import * as os$1 from "node:os";
@@ -4105,10 +4105,23 @@ function buildActionsRuntime(deps) {
4105
4105
  * The link and the off time are read from the STORED composition on each call
4106
4106
  * (D676), never cached as a second copy. A forced restart is switch off now,
4107
4107
  * switch on after `offSeconds`, through an injected scheduler so a spec drives
4108
- * the clock; the pending switch-on is cancelled on `stop()`.
4108
+ * the clock; the pending switch-on is cancelled on `stop()`. A switch that declares
4109
+ * a native power cycle (a PoE port) is cycled in one call instead, and never
4110
+ * switched off or on. A switch that ANSWERED it only reports (D1058) is never
4111
+ * switched on or off: power on / off are refused as `not-settable`, and `getStatus`
4112
+ * says so (`switchSettable`) for the surfaces that withdraw them.
4109
4113
  *
4110
4114
  * Every refusal is a typed result with its reason, logged with the device tag.
4111
4115
  */
4116
+ /** `switch.getOptions` FAILED (not absent): what the switch can do is unknown. */
4117
+ var SwitchOptionsUnreadableError = class extends Error {
4118
+ switchDeviceId;
4119
+ constructor(switchDeviceId, cause) {
4120
+ super(`switch ${switchDeviceId}: its options could not be read (${cause instanceof Error ? cause.message : String(cause)}); not power-cycling and not switching it off blind`);
4121
+ this.name = "SwitchOptionsUnreadableError";
4122
+ this.switchDeviceId = switchDeviceId;
4123
+ }
4124
+ };
4112
4125
  var timeoutScheduler = { schedule: (delayMs, fire) => {
4113
4126
  const handle = setTimeout(fire, delayMs);
4114
4127
  return { cancel: () => clearTimeout(handle) };
@@ -4118,28 +4131,40 @@ var PowerSourceService = class {
4118
4131
  deps;
4119
4132
  /** Restarts whose switch-on has not run yet, by device id. */
4120
4133
  restarting = /* @__PURE__ */ new Map();
4134
+ /**
4135
+ * Devices whose switch-options read is failing now: warned once per streak, cleared by a
4136
+ * success or when the device is no longer linked. A removed device leaves at most one bare id
4137
+ * behind (this service has no removal hook); the set dies with the process.
4138
+ */
4139
+ optionsReadFailing = /* @__PURE__ */ new Set();
4121
4140
  constructor(deps) {
4122
4141
  this.deps = deps;
4123
4142
  }
4124
4143
  getStatus = async ({ deviceId }) => {
4125
4144
  const link = await this.linkOf(deviceId);
4126
- if (link === null) return {
4127
- linked: false,
4128
- switchDeviceId: null,
4129
- switchName: null,
4130
- switchOn: null,
4131
- switchOnline: null,
4132
- restartInProgress: false,
4133
- offSeconds: 0
4134
- };
4145
+ if (link === null) {
4146
+ this.optionsReadFailing.delete(deviceId);
4147
+ return {
4148
+ linked: false,
4149
+ switchDeviceId: null,
4150
+ switchName: null,
4151
+ switchOn: null,
4152
+ switchOnline: null,
4153
+ switchSettable: null,
4154
+ restartInProgress: false,
4155
+ offSeconds: 0
4156
+ };
4157
+ }
4135
4158
  const switchDevice = await this.deps.devices.find(link.switch).catch(() => null);
4136
4159
  const switchOn = switchDevice === null ? null : await this.deps.devices.readOn(switchDevice.id).catch(() => null);
4160
+ const switchSettable = switchDevice === null ? null : await this.settableOf(deviceId, switchDevice.id);
4137
4161
  return {
4138
4162
  linked: true,
4139
4163
  switchDeviceId: switchDevice?.id ?? null,
4140
4164
  switchName: switchDevice?.name ?? link.switch.stableId,
4141
4165
  switchOn,
4142
4166
  switchOnline: switchDevice?.online ?? null,
4167
+ switchSettable,
4143
4168
  restartInProgress: this.restarting.has(deviceId),
4144
4169
  offSeconds: link.offSeconds
4145
4170
  };
@@ -4161,6 +4186,28 @@ var PowerSourceService = class {
4161
4186
  const { link, switchDevice } = lookup.resolved;
4162
4187
  const switchId = switchDevice.id;
4163
4188
  pending.switchId = switchId;
4189
+ const cycle = this.deps.devices.cycle;
4190
+ if (cycle !== void 0) {
4191
+ let cycled;
4192
+ try {
4193
+ cycled = await cycle(switchId);
4194
+ } catch (err) {
4195
+ this.restarting.delete(deviceId);
4196
+ const reason = err instanceof SwitchOptionsUnreadableError ? "switch-options-unreadable" : "switch-call-failed";
4197
+ return this.refuse(deviceId, reason, errorText$3(err), switchId);
4198
+ }
4199
+ if (cycled) {
4200
+ this.restarting.delete(deviceId);
4201
+ this.deps.logger.info("power-source: forced restart through the switch’s native power cycle", {
4202
+ tags: { deviceId },
4203
+ meta: {
4204
+ switchId,
4205
+ switchName: switchDevice.name
4206
+ }
4207
+ });
4208
+ return ACCEPTED;
4209
+ }
4210
+ }
4164
4211
  try {
4165
4212
  await this.deps.devices.setOn(switchId, false);
4166
4213
  } catch (err) {
@@ -4215,6 +4262,7 @@ var PowerSourceService = class {
4215
4262
  const lookup = await this.lookup(deviceId);
4216
4263
  if (lookup.kind === "refused") return this.refuse(deviceId, lookup.reason, lookup.message, null);
4217
4264
  const { switchDevice } = lookup.resolved;
4265
+ if (await this.settableOf(deviceId, switchDevice.id) === false) return this.refuse(deviceId, "not-settable", `the switch ${switchDevice.name} only reports its state; it cannot be switched ${on ? "on" : "off"}`, switchDevice.id);
4218
4266
  try {
4219
4267
  await this.deps.devices.setOn(switchDevice.id, on);
4220
4268
  } catch (err) {
@@ -4229,6 +4277,32 @@ var PowerSourceService = class {
4229
4277
  });
4230
4278
  return ACCEPTED;
4231
4279
  }
4280
+ /**
4281
+ * Whether the switch can be set: `true` for a plain switch (no options reader, or a provider
4282
+ * without `getOptions`), `null` when the read FAILED — never `false` for unknown. Every hero
4283
+ * build reads `getStatus`, so a failing read warns once per device per failure streak (tagged);
4284
+ * a successful read ends the streak.
4285
+ */
4286
+ async settableOf(deviceId, switchId) {
4287
+ const options = this.deps.devices.options;
4288
+ if (options === void 0) return true;
4289
+ try {
4290
+ const settable = (await options(switchId)).supportsSetState;
4291
+ this.optionsReadFailing.delete(deviceId);
4292
+ return settable;
4293
+ } catch (err) {
4294
+ if (this.optionsReadFailing.has(deviceId)) return null;
4295
+ this.optionsReadFailing.add(deviceId);
4296
+ this.deps.logger.warn("power-source: the switch options could not be read; settable unknown", {
4297
+ tags: { deviceId },
4298
+ meta: {
4299
+ switchId,
4300
+ error: errorText$3(err)
4301
+ }
4302
+ });
4303
+ return null;
4304
+ }
4305
+ }
4232
4306
  /** The link and the switch, or the reason there is nothing to act on. Reads the switch state: unknown is refused. */
4233
4307
  async lookup(deviceId) {
4234
4308
  const stored = await this.storedLinkOf(deviceId);
@@ -6201,6 +6275,8 @@ var RemoteComponentsService = class {
6201
6275
  * count comes from the remote cap and is `null` when it cannot be asked.
6202
6276
  */
6203
6277
  var REMOTE_CAP = "remote";
6278
+ var SWITCH_CAP = "switch";
6279
+ var POWER_SOURCE_CAP = "power-source";
6204
6280
  /** Models built at once for a list; the cap bounds the list, this bounds the fan-out on the registry. */
6205
6281
  var ROW_MODELS_CONCURRENCY = 16;
6206
6282
  var HeroLayoutService = class {
@@ -6235,6 +6311,8 @@ var HeroLayoutService = class {
6235
6311
  }
6236
6312
  }));
6237
6313
  const remoteCommands = await this.remoteCommands(deviceId);
6314
+ const switchOptions = bound.includes(SWITCH_CAP) ? await this.switchOptions(deviceId) : void 0;
6315
+ const powerSupplySettable = bound.includes(POWER_SOURCE_CAP) ? await this.powerSupplySettable(deviceId) : null;
6238
6316
  return buildHeroModel({
6239
6317
  device: {
6240
6318
  id: deviceId,
@@ -6250,7 +6328,9 @@ var HeroLayoutService = class {
6250
6328
  slices,
6251
6329
  now: this.deps.now(),
6252
6330
  remoteCommands,
6253
- access: { canActuate: canActuate ?? true }
6331
+ access: { canActuate: canActuate ?? true },
6332
+ ...switchOptions !== void 0 ? { switchOptions } : {},
6333
+ powerSupplySettable
6254
6334
  });
6255
6335
  };
6256
6336
  /**
@@ -6283,6 +6363,34 @@ var HeroLayoutService = class {
6283
6363
  return null;
6284
6364
  }
6285
6365
  }
6366
+ /**
6367
+ * What the switch can do. A provider without `getOptions` answers the defaults through the
6368
+ * reader; a read that FAILED is unknown — the hero draws on/off, as before (D315) — and is
6369
+ * logged with the device.
6370
+ */
6371
+ async switchOptions(deviceId) {
6372
+ try {
6373
+ return await this.deps.reader.switchOptions(deviceId);
6374
+ } catch (error) {
6375
+ this.deps.logger.warn("hero model: the switch options could not be read; on/off drawn", {
6376
+ tags: { deviceId },
6377
+ meta: { error: error instanceof Error ? error.message : String(error) }
6378
+ });
6379
+ return;
6380
+ }
6381
+ }
6382
+ /** Whether the supply's switch can be set; a failed read is unknown (on/off drawn), logged. */
6383
+ async powerSupplySettable(deviceId) {
6384
+ try {
6385
+ return await this.deps.reader.powerSupplySettable(deviceId);
6386
+ } catch (error) {
6387
+ this.deps.logger.warn("hero model: the power supply status could not be read; power on/off drawn", {
6388
+ tags: { deviceId },
6389
+ meta: { error: error instanceof Error ? error.message : String(error) }
6390
+ });
6391
+ return null;
6392
+ }
6393
+ }
6286
6394
  async remoteCommands(deviceId) {
6287
6395
  try {
6288
6396
  return await this.deps.reader.remoteCommands(deviceId);
@@ -6407,6 +6515,54 @@ async function seedLockDoors(deps) {
6407
6515
  }
6408
6516
  }
6409
6517
  //#endregion
6518
+ //#region src/builtins/core-blocks/power-source-devices.ts
6519
+ /**
6520
+ * The devices `power-source` acts on, reached over `ctx.api`: the linked switch is read,
6521
+ * set, and — when its provider declares a native power cycle — cycled in one call.
6522
+ */
6523
+ /** The switch's options; the defaults when its provider has no `getOptions`; throws typed when the read failed. */
6524
+ async function switchOptionsOf(api, deviceId) {
6525
+ try {
6526
+ return await api.switch.getOptions.query({ deviceId });
6527
+ } catch (err) {
6528
+ if (isCapMethodAbsent(err)) return SWITCH_DEFAULT_OPTIONS;
6529
+ throw new SwitchOptionsUnreadableError(deviceId, err);
6530
+ }
6531
+ }
6532
+ function powerSourceDevicesOver(requireApi) {
6533
+ return {
6534
+ find: async (ref) => {
6535
+ const row = (await requireApi().deviceManager.listAll.query({
6536
+ addonId: ref.addonId,
6537
+ projection: "slim"
6538
+ })).find((r) => r.stableId === ref.stableId);
6539
+ return row === void 0 ? null : {
6540
+ id: row.id,
6541
+ name: row.name,
6542
+ online: row.online
6543
+ };
6544
+ },
6545
+ readOn: async (deviceId) => {
6546
+ const status = await requireApi().switch.getStatus.query({ deviceId });
6547
+ const on = status !== null && typeof status === "object" ? Reflect.get(status, "on") : void 0;
6548
+ return typeof on === "boolean" ? on : null;
6549
+ },
6550
+ setOn: async (deviceId, on) => {
6551
+ await requireApi().switch.setState.mutate({
6552
+ deviceId,
6553
+ on
6554
+ });
6555
+ },
6556
+ options: (deviceId) => switchOptionsOf(requireApi(), deviceId),
6557
+ cycle: async (deviceId) => {
6558
+ const api = requireApi();
6559
+ if (!(await switchOptionsOf(api, deviceId)).supportsPowerCycle) return false;
6560
+ await api.switch.powerCycle.mutate({ deviceId });
6561
+ return true;
6562
+ }
6563
+ };
6564
+ }
6565
+ //#endregion
6410
6566
  //#region src/builtins/core-blocks/fan-link-forward.ts
6411
6567
  /**
6412
6568
  * A write to a fan-control field the operator linked in Customize goes to the
@@ -9890,7 +10046,9 @@ var CoreBlocksAddon = class extends BaseAddon {
9890
10046
  deviceId,
9891
10047
  capName
9892
10048
  }),
9893
- remoteCommands: async (deviceId) => (await requireApi().remote.listCommands.query({ deviceId })).commands.length
10049
+ remoteCommands: async (deviceId) => (await requireApi().remote.listCommands.query({ deviceId })).commands.length,
10050
+ switchOptions: (deviceId) => switchOptionsOf(requireApi(), deviceId),
10051
+ powerSupplySettable: async (deviceId) => (await requireApi().powerSource.getStatus.query({ deviceId })).switchSettable ?? null
9894
10052
  }
9895
10053
  });
9896
10054
  }
@@ -9910,30 +10068,7 @@ var CoreBlocksAddon = class extends BaseAddon {
9910
10068
  if (!api) throw new Error("core-blocks: no ctx.api on this node — power-source cannot reach devices");
9911
10069
  return api;
9912
10070
  };
9913
- return {
9914
- find: async (ref) => {
9915
- const row = (await requireApi().deviceManager.listAll.query({
9916
- addonId: ref.addonId,
9917
- projection: "slim"
9918
- })).find((r) => r.stableId === ref.stableId);
9919
- return row === void 0 ? null : {
9920
- id: row.id,
9921
- name: row.name,
9922
- online: row.online
9923
- };
9924
- },
9925
- readOn: async (deviceId) => {
9926
- const status = await requireApi().switch.getStatus.query({ deviceId });
9927
- const on = status !== null && typeof status === "object" ? Reflect.get(status, "on") : void 0;
9928
- return typeof on === "boolean" ? on : null;
9929
- },
9930
- setOn: async (deviceId, on) => {
9931
- await requireApi().switch.setState.mutate({
9932
- deviceId,
9933
- on
9934
- });
9935
- }
9936
- };
10071
+ return powerSourceDevicesOver(requireApi);
9937
10072
  }
9938
10073
  buildRemote(records) {
9939
10074
  const settings = this.ctx.settings;
@@ -8,7 +8,7 @@
8
8
  * says "not answered", never "off" (D315/D393). The remote's saved command
9
9
  * count comes from the remote cap and is `null` when it cannot be asked.
10
10
  */
11
- import { type IHeroLayoutProvider, type IScopedLogger, type ReadingQuantity } from "@camstack/types";
11
+ import { type IHeroLayoutProvider, type IScopedLogger, type ReadingQuantity, type SwitchOptions } from "@camstack/types";
12
12
  /** What the registry says about the device. */
13
13
  export interface HeroDeviceFacts {
14
14
  readonly type: string;
@@ -31,6 +31,16 @@ export interface HeroLayoutReader {
31
31
  readonly slice: (deviceId: number, capName: string) => Promise<unknown>;
32
32
  /** Saved remote commands; throws when the remote cannot be asked. */
33
33
  readonly remoteCommands: (deviceId: number) => Promise<number>;
34
+ /**
35
+ * The `switch` provider's `getOptions`: the defaults when it has none (a plain on/off switch);
36
+ * throws when it cannot be asked.
37
+ */
38
+ readonly switchOptions: (deviceId: number) => Promise<SwitchOptions>;
39
+ /**
40
+ * Whether the switch that powers the device can be set (`power-source.getStatus().switchSettable`);
41
+ * `null` = not known. Throws when it cannot be asked.
42
+ */
43
+ readonly powerSupplySettable: (deviceId: number) => Promise<boolean | null>;
34
44
  }
35
45
  export interface HeroLayoutServiceDeps {
36
46
  readonly reader: HeroLayoutReader;
@@ -49,5 +59,13 @@ export declare class HeroLayoutService implements IHeroLayoutProvider {
49
59
  */
50
60
  readonly getRowModels: IHeroLayoutProvider["getRowModels"];
51
61
  private rowOf;
62
+ /**
63
+ * What the switch can do. A provider without `getOptions` answers the defaults through the
64
+ * reader; a read that FAILED is unknown — the hero draws on/off, as before (D315) — and is
65
+ * logged with the device.
66
+ */
67
+ private switchOptions;
68
+ /** Whether the supply's switch can be set; a failed read is unknown (on/off drawn), logged. */
69
+ private powerSupplySettable;
52
70
  private remoteCommands;
53
71
  }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The devices `power-source` acts on, reached over `ctx.api`: the linked switch is read,
3
+ * set, and — when its provider declares a native power cycle — cycled in one call.
4
+ */
5
+ import { type AddonApi, type SwitchOptions } from "@camstack/types";
6
+ import { type PowerSourceDevices } from "./power-source-service.js";
7
+ /** The switch's options; the defaults when its provider has no `getOptions`; throws typed when the read failed. */
8
+ export declare function switchOptionsOf(api: AddonApi, deviceId: number): Promise<SwitchOptions>;
9
+ export declare function powerSourceDevicesOver(requireApi: () => AddonApi): PowerSourceDevices;
@@ -10,23 +10,47 @@
10
10
  * The link and the off time are read from the STORED composition on each call
11
11
  * (D676), never cached as a second copy. A forced restart is switch off now,
12
12
  * switch on after `offSeconds`, through an injected scheduler so a spec drives
13
- * the clock; the pending switch-on is cancelled on `stop()`.
13
+ * the clock; the pending switch-on is cancelled on `stop()`. A switch that declares
14
+ * a native power cycle (a PoE port) is cycled in one call instead, and never
15
+ * switched off or on. A switch that ANSWERED it only reports (D1058) is never
16
+ * switched on or off: power on / off are refused as `not-settable`, and `getStatus`
17
+ * says so (`switchSettable`) for the surfaces that withdraw them.
14
18
  *
15
19
  * Every refusal is a typed result with its reason, logged with the device tag.
16
20
  */
17
- import { type CompositionSourceRef, type CoreBlock, type IPowerSourceProvider, type IScopedLogger, type PowerSourceActionResult, type PowerSourceInfo } from "@camstack/types";
21
+ import { type CompositionSourceRef, type CoreBlock, type IPowerSourceProvider, type IScopedLogger, type PowerSourceActionResult, type PowerSourceInfo, type SwitchOptions } from "@camstack/types";
18
22
  /** What the service needs to know about a device it names. */
19
23
  export interface PowerSourceDevice {
20
24
  readonly id: number;
21
25
  readonly name: string;
22
26
  readonly online: boolean;
23
27
  }
28
+ /** `switch.getOptions` FAILED (not absent): what the switch can do is unknown. */
29
+ export declare class SwitchOptionsUnreadableError extends Error {
30
+ readonly switchDeviceId: number;
31
+ constructor(switchDeviceId: number, cause: unknown);
32
+ }
24
33
  export interface PowerSourceDevices {
25
34
  /** The device for a source ref, or null when it cannot be found. */
26
35
  readonly find: (ref: CompositionSourceRef) => Promise<PowerSourceDevice | null>;
27
36
  /** The switch's on/off state, or null when it has none. Throws when it cannot be read. */
28
37
  readonly readOn: (switchDeviceId: number) => Promise<boolean | null>;
29
38
  readonly setOn: (switchDeviceId: number, on: boolean) => Promise<void>;
39
+ /**
40
+ * What the switch can do (`switch.getOptions`): the defaults when its provider has no such
41
+ * method, `SwitchOptionsUnreadableError` when the read FAILED.
42
+ * Absent = every switch here is a plain on/off switch.
43
+ */
44
+ readonly options?: (switchDeviceId: number) => Promise<SwitchOptions>;
45
+ /**
46
+ * Cut and restore the switch's output in ONE native call, when its provider declares it
47
+ * (`switch.getOptions().supportsPowerCycle`). Resolves true when it cycled, false when the
48
+ * switch has no native cycle (the restart is then off / wait / on). Throws
49
+ * `SwitchOptionsUnreadableError` when what the switch can do could not be read, and any other
50
+ * error when the cycle call fails.
51
+ * Absent = no switch here has one.
52
+ */
53
+ readonly cycle?: (switchDeviceId: number) => Promise<boolean>;
30
54
  }
31
55
  export interface PowerSourceTimer {
32
56
  readonly cancel: () => void;
@@ -45,6 +69,12 @@ export declare class PowerSourceService implements IPowerSourceProvider {
45
69
  private readonly deps;
46
70
  /** Restarts whose switch-on has not run yet, by device id. */
47
71
  private readonly restarting;
72
+ /**
73
+ * Devices whose switch-options read is failing now: warned once per streak, cleared by a
74
+ * success or when the device is no longer linked. A removed device leaves at most one bare id
75
+ * behind (this service has no removal hook); the set dies with the process.
76
+ */
77
+ private readonly optionsReadFailing;
48
78
  constructor(deps: PowerSourceServiceDeps);
49
79
  getStatus: ({ deviceId }: {
50
80
  deviceId: number;
@@ -62,6 +92,13 @@ export declare class PowerSourceService implements IPowerSourceProvider {
62
92
  stop(): void;
63
93
  private finishRestart;
64
94
  private switchTo;
95
+ /**
96
+ * Whether the switch can be set: `true` for a plain switch (no options reader, or a provider
97
+ * without `getOptions`), `null` when the read FAILED — never `false` for unknown. Every hero
98
+ * build reads `getStatus`, so a failing read warns once per device per failure streak (tagged);
99
+ * a successful read ends the streak.
100
+ */
101
+ private settableOf;
65
102
  /** The link and the switch, or the reason there is nothing to act on. Reads the switch state: unknown is refused. */
66
103
  private lookup;
67
104
  /** The stored link of the device `deviceId`, read from the customizations now. */
@@ -3,8 +3,8 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-m5beNMze.js");
7
- const require_capture_engine = require("../../capture-engine-DXz37Mjg.js");
6
+ const require_dist = require("../../dist-yx2KHo3b.js");
7
+ const require_capture_engine = require("../../capture-engine-DHmlkW_d.js");
8
8
  const require_retention = require("../../retention-BcOSL6b9.js");
9
9
  let node_crypto = require("node:crypto");
10
10
  //#region src/builtins/device-history/capture/point-writer.ts
@@ -1,5 +1,5 @@
1
- import { Kl as DeviceType, Ks as wattMillisecondsToKwh, Lr as deviceRemovalHookCapability, Pn as armRemovalReconcile, Pr as deviceHistoryCapability, Rr as deviceRunsCapability, U as DEVICE_HISTORY_ENERGY_KEY, Vr as deviceTransitionsCapability, Yc as defineRecordKinds, Yl as EventCategory, Zc as emitReadiness, bc as RecordTooLargeError, bt as HISTORY_CATALOG, dl as isReadingQuantity, ec as DeviceTransitionSchema, ic as InvalidRecordError, nt as DeviceRunSchema, qs as BaseAddon, rl as historyUnitFor, xt as HISTORY_ITEM_CATALOG } from "../../dist-Dgq9nuvh.mjs";
2
- import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-nmelnj-Y.mjs";
1
+ import { Br as deviceHistoryCapability, Lc as RecordTooLargeError, Ol as isReadingQuantity, St as HISTORY_ITEM_CATALOG, U as DEVICE_HISTORY_ENERGY_KEY, Ur as deviceRemovalHookCapability, Wr as deviceRunsCapability, _c as DeviceTransitionSchema, bl as historyUnitFor, fl as defineRecordKinds, fu as EventCategory, lc as wattMillisecondsToKwh, lu as DeviceType, ml as emitReadiness, qr as deviceTransitionsCapability, rt as DeviceRunSchema, uc as BaseAddon, xc as InvalidRecordError, xt as HISTORY_CATALOG, zn as armRemovalReconcile } from "../../dist-DbAhCrHy.mjs";
2
+ import { a as catalogMetrics, c as DeviceDirectory, d as identityOf, f as subjectIdOf, i as capSeriesKey, l as isRealDeviceType, n as CaptureEngine, o as readPath, r as capItemSeriesKey, s as readUnit, t as CAP_KEY_PREFIX, u as SeriesRegistry } from "../../capture-engine-sl6e9f9S.mjs";
3
3
  import { a as FIVE_MINUTES_MS, c as bucketEndOf, i as DAY_MS, l as bucketStartOf, n as RetentionJob, o as HOUR_MS, r as DepartureTracker, s as ROLLUP_GRACE_MS, t as DEFAULT_RETENTION, u as floorTo } from "../../retention-CUOVI1p7.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  //#region src/builtins/device-history/capture/point-writer.ts
@@ -0,0 +1,9 @@
1
+ import { type IDeviceManagerProvider } from "@camstack/types";
2
+ import type { ProviderContext } from "./device-provider-context.js";
3
+ /** Why a `setIdentifiers` call was refused. */
4
+ export type SetIdentifiersRefusal = "unknown-device" | "not-owner" | "invalid";
5
+ export declare class SetIdentifiersRefusedError extends Error {
6
+ readonly reason: SetIdentifiersRefusal;
7
+ constructor(reason: SetIdentifiersRefusal, message: string);
8
+ }
9
+ export declare function setIdentifiers(pctx: ProviderContext, input: Parameters<IDeviceManagerProvider["setIdentifiers"]>[0]): ReturnType<IDeviceManagerProvider["setIdentifiers"]>;