@camstack/server 1.2.857 → 1.2.859

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 (94) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/trpc/generated-cap-mounts.js +2 -1
  3. package/dist/api/trpc/generated-cap-routers.js +15 -1
  4. package/dist/core/addon/instance-links.service.js +6 -2
  5. package/package.json +10 -12
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  12. package/system/dist/builtins/autotrack/index.js +1 -1
  13. package/system/dist/builtins/autotrack/index.mjs +1 -1
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  16. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/system/dist/builtins/camera-grid/index.js +1 -1
  19. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/system/dist/builtins/composer/composer.addon.js +4 -4
  21. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  22. package/system/dist/builtins/console-logging/index.js +1 -1
  23. package/system/dist/builtins/console-logging/index.mjs +1 -1
  24. package/system/dist/builtins/core-blocks/automation-template-instances.d.ts +38 -0
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.d.ts +6 -0
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.js +227 -21
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +227 -21
  28. package/system/dist/builtins/core-blocks/remote-wiring.d.ts +3 -0
  29. package/system/dist/builtins/core-blocks/templates-service.d.ts +11 -0
  30. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +2 -2
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +4 -4
  37. package/system/dist/builtins/keychain/index.mjs +4 -4
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  42. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  43. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  44. package/system/dist/builtins/loki-logging/index.js +1 -1
  45. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  46. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  47. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  48. package/system/dist/builtins/platform-probe/index.js +1 -1
  49. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  50. package/system/dist/builtins/record-entries/index.js +1 -1
  51. package/system/dist/builtins/record-entries/index.mjs +1 -1
  52. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/system/dist/builtins/snapshot/index.js +1 -1
  55. package/system/dist/builtins/snapshot/index.mjs +1 -1
  56. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  57. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  61. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  62. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  63. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  64. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  65. package/system/dist/builtins/system-config/system-config.addon.mjs +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-BpTIydES.mjs → capture-engine-B4_fq2JB.mjs} +1 -1
  69. package/system/dist/{capture-engine-OjKUSU7_.js → capture-engine-yhFFC7F8.js} +1 -1
  70. package/system/dist/{composition-sources-eLYlvnnR.mjs → composition-sources-BQOEYCJG.mjs} +1 -1
  71. package/system/dist/{composition-sources-WroUQ4J-.js → composition-sources-CKSSe5ny.js} +1 -1
  72. package/system/dist/{constants-B8nWtzwq.js → constants-dfnEfsX7.js} +1 -1
  73. package/system/dist/{constants-DO33IJ7k.mjs → constants-h8wJE_8O.mjs} +1 -1
  74. package/system/dist/{device-ca-EtzHeETW.js → device-ca-_o0-3jJ6.js} +1 -1
  75. package/system/dist/{device-ca-BOquIg22.mjs → device-ca-h54CenJx.mjs} +1 -1
  76. package/system/dist/{dist-n0kCY8sq.js → dist-WEGVb8qV.js} +2961 -64
  77. package/system/dist/{dist-7eN_r5dA.mjs → dist-atHH8IeD.mjs} +2902 -65
  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-C_6dgozE.mjs → hub-identity-DLF698tj.mjs} +1 -1
  81. package/system/dist/{hub-identity-Cz0pt7Ho.js → hub-identity-nIMYA24i.js} +1 -1
  82. package/system/dist/{hub-mdns-ciao-CmGrhCgY.js → hub-mdns-ciao-B6ZHStt1.js} +2 -2
  83. package/system/dist/{hub-mdns-ciao-CdHseQBh.mjs → hub-mdns-ciao-DchpUVAk.mjs} +2 -2
  84. package/system/dist/index.js +12 -8
  85. package/system/dist/index.mjs +12 -8
  86. package/system/dist/{legacy-integration-rows-door-Bm1OQy6O.js → legacy-integration-rows-door-BbaIE1qF.js} +1 -1
  87. package/system/dist/{legacy-integration-rows-door-Cnqq1aq-.mjs → legacy-integration-rows-door-DBO3ZLmn.mjs} +1 -1
  88. package/system/dist/{rename-composition-block-CuKj9mH0.mjs → rename-composition-block-6ISzMLgj.mjs} +1 -1
  89. package/system/dist/{rename-composition-block-D82Y4jGp.js → rename-composition-block-IIfaFnEl.js} +1 -1
  90. package/system/dist/{restore-archive-C2kHLNPq.js → restore-archive-ChRNoqGg.js} +1 -1
  91. package/system/dist/{restore-archive-BOnkR2ZT.mjs → restore-archive-DeDRh7Lf.mjs} +1 -1
  92. package/system/dist/{wal-maintenance-Bdrc5v7T.mjs → wal-maintenance-BXj9xnDD.mjs} +0 -0
  93. package/system/dist/{wal-maintenance-CBrmyT6U.js → wal-maintenance-l3CsKEaJ.js} +0 -0
  94. package/system/package.json +1 -1
@@ -1,7 +1,7 @@
1
- import { $ as DeclaredDevices, $t as RunningStateStatusSchema, Ba as resolveRemoteSource, Bo as COMPOSER_ADDON_ID, C as COMPOSER_RUNNER_ID, Cc as defineAddonMigrations, Cl as DeviceType$1, Co as timedRunMaxIn, Ct as IDLE_ACTION_STATUS, Da as remoteSourceSteps, Dn as appendTrace, Ea as remoteLayoutComponentsCapability, Ec as defineRecordKinds, El as EventCategory$1, Eo as toTimings, Fc as hydrateSchema, Fn as buildActionSteps, Ga as runSteps, Gc as isSecretMarker, Gn as capUnitResolver, Ha as resolveStepArgs, Ho as DAY_MS, Ht as PowerSourceInfoSchema, In as buildCapabilityLookup, Io as weekdayOfLocalDate, Ja as schedulersCapability, Ji as nextTimeBoundaryInMs, Js as RecordIntegrationInstances, Jt as REMOTE_MEDIA_COMMANDS, Kr as fanPresetsCapability, Kt as QuantityUnitError, Lr as evaluateStepCondition, Ma as resolveCoreBlockEntry, Mi as lockDoorLinkOfComposition, Na as resolveCoreBlockFiles, Nt as MediaPlayerStatusSchema, Oa as replacedFieldKeys, Oi as localDateOf, Pa as resolveHeroLayout, Qa as seedInstanceOnce, Qn as collectWhenMirrorSources, Qt as RemoteLayoutPayloadSchema, R as DEFAULT_HOLD_OVERRIDE, Rr as evaluateWhenTree, Si as kebabToCamel, Sl as DeviceRole, So as timedRunLimitOf, Sr as describeComposableCaps, T as CORE_BLOCK_ADDON_PREFIX, Ta as remoteCapability, Tc as defineEntryKind, To as timedRunSeconds, Ur as fanAxisPath, Vo as CompositionSchema, Wn as canonicalStoredStepTargets, Xi as normalizeCoreBlockWrite, Xo as canonicalStoredBlockTarget, Yi as normalizeActionUnits, Yn as checkTemplatePayload, Yr as findChannelSource, Zn as collectDeviceTemplates, Zt as RemoteAssumedStateSchema, _a as projectDeviceRow, _c as collectSecretMarkerRefs, _l as vocabActionIdFor, _n as actionSourceCapability, ac as VocabActionError, ai as integrationInstancesCapability, ao as siteFor, ar as compositionUnionReads, as as compositionSourceKey, at as EMPTY_REMOTE_ASSUMED_STATE, ba as readStoredRemoteConfig, bc as commandOrigin$1, bn as addonIdOfActionId, bo as templateCapability, c as ActionError, ca as planComposition, cr as coreBlockComposition, ct as FAN_CAPTURE_FIELDS, d as ActionTargetResolver, da as powerSourceCapability, dr as coreBlocksCapability, ds as historyRetentionFromSettings, ea as occurrenceOn, es as composedDeviceRef, f as ActionVariableSchema, fa as powerSourceLinkOfComposition, ft as FanControlStatusSchema, gi as isInternalActionId, h as BUILTIN_REMOTE_COMPONENTS, hl as transformSecretWrite, ii as heroLayoutCapability, in as SchedulerSchema, ir as compositionSourceRefs, it as EMPTY_AUTOMATION_STATE, j as CoreBlockSchema, jo as validateSchedulerInput, k as ConditionMirror, ka as resolveActionVariables, kc as entryBody, kn as assertStepsOffered, ko as validateComposition, l as ActionMinDelaySecSchema, lo as stableIdMapOf, lr as coreBlockIdFromAddonId, lt as FAN_OSCILLATION_AXES, m as AutomationStateDocSchema, ma as problemsBlockSave, mr as customKeyOfRole, mt as FanPresetSchema, n as ACTION_TARGET_INVALIDATION_EVENTS, ns as compositionFeatureEnabled, oi as internalActionId, ol as resolveSecretMarkers, ot as EMPTY_REMOTE_CONFIG, pn as TemplateKindSchema, qc as isSecretRefOwnedBy, qi as nextOccurrence, qo as HelperMemberSchema, ri as hasTimeLeaves, rn as SchedulerError, s as ALL_CAPABILITY_DEFINITIONS, sc as actionEffect, sl as ruleFireOfClaim, sn as SetOscillationAxisInputSchema, sr as coreBlockAddonId, tr as compileScalarOverride, ts as composedDeviceStableId, u as ActionStepSchema, ua as powerSourceActuatorConflicts, ul as secretTreeFromSchema, ur as coreBlockSourceKind, us as helperMembers, ut as FAN_OSCILLATION_AXIS_SETTABLE, va as proposeRunningThreshold, vl as vocabCall, vn as actionWaitTotalMs, w as CORE_BLOCKS_ADDON_ID, wl as errMsg$1, wo as timedRunQuickRun, ws as BaseAddon, wt as INTERNAL_ACTION_PREFIX, xo as timedRunCapability, yn as actionsCapability, zn as buildHeroModel, zo as zoneOnlySite } from "../../dist-7eN_r5dA.mjs";
1
+ import { $i as nextOccurrence, $t as RemoteAssumedStateSchema, Ac as commandOrigin$1, Ao as templateCapability, B as DEFAULT_HOLD_OVERRIDE, Br as evaluateStepCondition, D as CORE_BLOCK_ADDON_PREFIX, Da as readRecipeLiteral, Dc as collectSecretMarkerRefs, Dl as vocabActionIdFor, E as CORE_BLOCKS_ADDON_ID, Et as INTERNAL_ACTION_PREFIX, Fa as remoteLayoutComponentsCapability, Fc as defineEntryKind, Fo as timedRunSeconds, Ft as MediaPlayerStatusSchema, Gc as hydrateSchema, Ha as resolveCoreBlockEntry, Ia as remoteSourceSteps, Ic as defineRecordKinds, Il as EventCategory$1, Io as toTimings, Jn as capUnitResolver, Jt as QuantityUnitError, Ko as weekdayOfLocalDate, Kr as fanAxisPath, La as replaceRecipeLiteral, Ln as buildActionSteps, Ml as DeviceRole, Mo as timedRunLimitOf, N as CoreBlockSchema, Na as reexpandAutomationInstance, Nc as defineAddonMigrations, Nl as DeviceType$1, No as timedRunMaxIn, Oa as readStoredRemoteConfig, Oi as kebabToCamel, Ol as vocabCall, Pa as remoteCapability, Pi as localDateOf, Pl as errMsg$1, Po as timedRunQuickRun, Ps as BaseAddon, Qa as resolveStepArgs, Qn as checkTemplatePayload, Qo as DAY_MS, Qr as findChannelSource, Ra as replacedFieldKeys, Ri as lockDoorLinkOfComposition, Rn as buildCapabilityLookup, Si as isInternalActionId, Sn as addonIdOfActionId, T as COMPOSER_RUNNER_ID, Ta as proposeRunningThreshold, Tl as transformSecretWrite, Tr as describeComposableCaps, Tt as IDLE_ACTION_STATUS, Ua as resolveCoreBlockFiles, Un as builtinAutomationTemplate, Vn as buildHeroModel, Vo as validateSchedulerInput, Vr as evaluateWhenTree, Wa as resolveHeroLayout, Wt as PowerSourceInfoSchema, Xa as resolveRemoteSource, Xo as COMPOSER_ADDON_ID, Xt as REMOTE_MEDIA_COMMANDS, Yo as zoneOnlySite, Yr as fanPresetsCapability, Zo as CompositionSchema, _ as BUILTIN_REMOTE_COMPONENTS, _a as powerSourceCapability, _c as actionEffect, _l as ruleFireOfClaim, _r as customKeyOfRole, an as SchedulerError, ba as prepareRecipeUnits, bl as secretTreeFromSchema, bn as actionWaitTotalMs, bs as helperMembers, c as ActionError, ci as heroLayoutCapability, co as seedInstanceOnce, cr as compositionUnionReads, ct as EMPTY_REMOTE_CONFIG, d as ActionTargetResolver, di as internalActionId, dr as coreBlockComposition, ds as composedDeviceStableId, dt as FAN_OSCILLATION_AXES, ea as nextTimeBoundaryInMs, en as RemoteLayoutPayloadSchema, er as collectDeviceTemplates, f as ActionVariableSchema, fr as coreBlockIdFromAddonId, fs as compositionFeatureEnabled, ft as FAN_OSCILLATION_AXIS_SETTABLE, g as BUILTIN_AUTOMATION_TEMPLATES, ga as powerSourceActuatorConflicts, gl as resolveSecretMarkers, gt as FanPresetSchema, h as AutomationTemplatePayloadSchema, hc as VocabActionError, hn as TemplateKindSchema, ho as siteFor, hs as compositionSourceKey, ic as RecordIntegrationInstances, io as schedulersCapability, ir as compileScalarOverride, j as ConditionMirror, jn as assertStepsOffered, jo as timedRunCapability, kn as appendTrace, l as ActionMinDelaySecSchema, li as instanceCodeHash, ln as SetOscillationAxisInputSchema, m as AutomationStateDocSchema, ma as planComposition, mr as coreBlocksCapability, mt as FanControlStatusSchema, n as ACTION_TARGET_INVALIDATION_EVENTS, na as normalizeCoreBlockWrite, oa as occurrenceOn, on as SchedulerSchema, os as canonicalStoredBlockTarget, ot as EMPTY_AUTOMATION_STATE, pr as coreBlockSourceKind, qn as canonicalStoredStepTargets, ri as generateAutomationBlock, rl as isSecretRefOwnedBy, rs as HelperMemberSchema, s as ALL_CAPABILITY_DEFINITIONS, si as hasTimeLeaves, sr as compositionSourceRefs, st as EMPTY_REMOTE_ASSUMED_STATE, ta as normalizeActionUnits, tl as isSecretMarker, tn as RunningStateStatusSchema, to as runSteps, tr as collectWhenMirrorSources, tt as DeclaredDevices, u as ActionStepSchema, ui as integrationInstancesCapability, ur as coreBlockAddonId, us as composedDeviceRef, ut as FAN_CAPTURE_FIELDS, va as powerSourceLinkOfComposition, vi as isBuiltinTemplateId, wa as projectDeviceRow, xa as problemsBlockSave, xn as actionsCapability, xs as historyRetentionFromSettings, yn as actionSourceCapability, yo as stableIdMapOf, za as resolveActionVariables, zc as entryBody, zo as validateComposition } from "../../dist-atHH8IeD.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-eLYlvnnR.mjs";
4
- import { i as capSeriesKey } from "../../capture-engine-BpTIydES.mjs";
3
+ import { i as parseDeviceStateChanged, r as isRecord$1, t as describeCompositionSources } from "../../composition-sources-BQOEYCJG.mjs";
4
+ import { i as capSeriesKey } from "../../capture-engine-B4_fq2JB.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";
@@ -4113,7 +4113,7 @@ var PowerSourceService = class {
4113
4113
  await this.deps.devices.setOn(switchId, false);
4114
4114
  } catch (err) {
4115
4115
  this.restarting.delete(deviceId);
4116
- return this.refuse(deviceId, "switch-call-failed", errorText$2(err), switchId);
4116
+ return this.refuse(deviceId, "switch-call-failed", errorText$3(err), switchId);
4117
4117
  }
4118
4118
  this.deps.logger.info("power-source: forced restart, power is off", {
4119
4119
  tags: { deviceId },
@@ -4151,7 +4151,7 @@ var PowerSourceService = class {
4151
4151
  tags: { deviceId },
4152
4152
  meta: {
4153
4153
  switchId,
4154
- error: errorText$2(err)
4154
+ error: errorText$3(err)
4155
4155
  }
4156
4156
  });
4157
4157
  } finally {
@@ -4166,7 +4166,7 @@ var PowerSourceService = class {
4166
4166
  try {
4167
4167
  await this.deps.devices.setOn(switchDevice.id, on);
4168
4168
  } catch (err) {
4169
- return this.refuse(deviceId, "switch-call-failed", errorText$2(err), switchDevice.id);
4169
+ return this.refuse(deviceId, "switch-call-failed", errorText$3(err), switchDevice.id);
4170
4170
  }
4171
4171
  this.deps.logger.info(`power-source: ${action}`, {
4172
4172
  tags: { deviceId },
@@ -4249,7 +4249,7 @@ var PowerSourceService = class {
4249
4249
  };
4250
4250
  }
4251
4251
  };
4252
- function errorText$2(err) {
4252
+ function errorText$3(err) {
4253
4253
  return err instanceof Error ? err.message : String(err);
4254
4254
  }
4255
4255
  var TIMED_RUN_SETTLE_MS = 3e3;
@@ -6694,7 +6694,7 @@ function rolesFor(command) {
6694
6694
  case "playMedia": return [];
6695
6695
  }
6696
6696
  }
6697
- function errorText$1(err) {
6697
+ function errorText$2(err) {
6698
6698
  return err instanceof Error ? err.message : String(err);
6699
6699
  }
6700
6700
  var RemoteService = class {
@@ -6797,7 +6797,7 @@ var RemoteService = class {
6797
6797
  } catch (err) {
6798
6798
  this.deps.logger.warn("remote: the media-player slice could not be written", {
6799
6799
  tags: { deviceId },
6800
- meta: { error: errorText$1(err) }
6800
+ meta: { error: errorText$2(err) }
6801
6801
  });
6802
6802
  }
6803
6803
  }
@@ -7192,13 +7192,13 @@ var RemoteService = class {
7192
7192
  meta: {
7193
7193
  source: source.name,
7194
7194
  transmitterId,
7195
- error: errorText$1(err)
7195
+ error: errorText$2(err)
7196
7196
  }
7197
7197
  });
7198
7198
  return {
7199
7199
  status: "refused",
7200
7200
  reason: "action-failed",
7201
- detail: errorText$1(err)
7201
+ detail: errorText$2(err)
7202
7202
  };
7203
7203
  }
7204
7204
  const kept = await this.readAssumed(deviceId);
@@ -7280,13 +7280,13 @@ var RemoteService = class {
7280
7280
  meta: {
7281
7281
  role,
7282
7282
  sent,
7283
- error: errorText$1(err)
7283
+ error: errorText$2(err)
7284
7284
  }
7285
7285
  });
7286
7286
  return {
7287
7287
  status: "refused",
7288
7288
  reason: "action-failed",
7289
- detail: errorText$1(err)
7289
+ detail: errorText$2(err)
7290
7290
  };
7291
7291
  }
7292
7292
  }
@@ -7358,8 +7358,12 @@ var RemoteService = class {
7358
7358
  * it does not know what a remote is.
7359
7359
  *
7360
7360
  * A delete asks the {@link TemplateUsage} port who still points at the record
7361
- * and refuses with the devices named (typed `in-use`), so a button grid cannot
7362
- * vanish under a device that draws from it.
7361
+ * and refuses with the devices and automations named (typed `in-use`), so a
7362
+ * button grid cannot vanish under a device that draws from it, nor an automation
7363
+ * template under the automations made from it.
7364
+ *
7365
+ * Saving an `automation` template re-expands every automation made from it
7366
+ * (#527) through the {@link AutomationTemplateInstances} port.
7363
7367
  */
7364
7368
  function recordOf(id, body) {
7365
7369
  return {
@@ -7371,6 +7375,18 @@ function recordOf(id, body) {
7371
7375
  updatedAt: body.updatedAt
7372
7376
  };
7373
7377
  }
7378
+ /** A shipped template as a record: read-only, timeless. */
7379
+ function builtinRecordOf(template) {
7380
+ return {
7381
+ id: template.id,
7382
+ kind: "automation",
7383
+ name: template.name,
7384
+ payload: template.payload,
7385
+ createdAt: 0,
7386
+ updatedAt: 0,
7387
+ builtIn: true
7388
+ };
7389
+ }
7374
7390
  var TemplatesService = class {
7375
7391
  deps;
7376
7392
  now;
@@ -7391,9 +7407,12 @@ var TemplatesService = class {
7391
7407
  for (const row of page.records) out.push(recordOf(row.id, row.data));
7392
7408
  cursor = page.nextCursor ?? void 0;
7393
7409
  } while (cursor !== void 0);
7410
+ if (kind === void 0 || kind === "automation") out.push(...BUILTIN_AUTOMATION_TEMPLATES.map(builtinRecordOf));
7394
7411
  return out;
7395
7412
  };
7396
7413
  get = async ({ id }) => {
7414
+ const builtin = builtinAutomationTemplate(id);
7415
+ if (builtin !== void 0) return builtinRecordOf(builtin);
7397
7416
  const row = await this.deps.templates.get(id);
7398
7417
  return row === null ? null : recordOf(row.id, row.data);
7399
7418
  };
@@ -7429,6 +7448,11 @@ var TemplatesService = class {
7429
7448
  };
7430
7449
  };
7431
7450
  update = async ({ id, name, payload }) => {
7451
+ if (isBuiltinTemplateId(id)) return {
7452
+ status: "refused",
7453
+ reason: "read-only",
7454
+ detail: `"${id}" ships with CamStack`
7455
+ };
7432
7456
  const existing = await this.deps.templates.get(id);
7433
7457
  if (existing === null) return {
7434
7458
  status: "refused",
@@ -7463,22 +7487,43 @@ var TemplatesService = class {
7463
7487
  id,
7464
7488
  data: body
7465
7489
  });
7490
+ if (payload !== void 0) await this.reexpandInstances(id, body);
7466
7491
  return {
7467
7492
  status: "saved",
7468
7493
  template: recordOf(id, body)
7469
7494
  };
7470
7495
  };
7496
+ /**
7497
+ * The shipped templates change only with a release: their instances are
7498
+ * re-expanded once per start, and an instance whose code comes out the same
7499
+ * is not saved (no restart).
7500
+ */
7501
+ async reexpandBuiltinInstances() {
7502
+ if (this.deps.automations === void 0) return;
7503
+ for (const template of BUILTIN_AUTOMATION_TEMPLATES) await this.deps.automations.reexpand(template.id, template.payload);
7504
+ }
7505
+ /** A changed automation template reaches every automation made from it. */
7506
+ async reexpandInstances(id, body) {
7507
+ if (body.kind !== "automation" || this.deps.automations === void 0) return;
7508
+ const parsed = AutomationTemplatePayloadSchema.safeParse(body.payload);
7509
+ if (!parsed.success) return;
7510
+ await this.deps.automations.reexpand(id, parsed.data);
7511
+ }
7471
7512
  delete = async ({ id }) => {
7513
+ if (isBuiltinTemplateId(id)) return { status: "read-only" };
7472
7514
  if (await this.deps.templates.get(id) === null) return { status: "not-found" };
7473
- const [first, ...rest] = await this.deps.usage.devicesUsing(id);
7474
- if (first !== void 0) {
7475
- this.deps.logger.info("template: delete refused, devices still use it", { meta: {
7515
+ const devices = await this.deps.usage.devicesUsing(id);
7516
+ const automations = await this.deps.automations?.using(id) ?? [];
7517
+ if (devices.length > 0 || automations.length > 0) {
7518
+ this.deps.logger.info("template: delete refused, something still uses it", { meta: {
7476
7519
  id,
7477
- devices: rest.length + 1
7520
+ devices: devices.length,
7521
+ automations: automations.length
7478
7522
  } });
7479
7523
  return {
7480
7524
  status: "in-use",
7481
- devices: [first, ...rest]
7525
+ devices: [...devices],
7526
+ automations: [...automations]
7482
7527
  };
7483
7528
  }
7484
7529
  await this.deps.templates.delete(id);
@@ -7721,6 +7766,7 @@ function buildRemoteRuntime(deps) {
7721
7766
  templates: new TemplatesService({
7722
7767
  templates: templateRows,
7723
7768
  usage: templateUsageOver(deps.settings, deps.api),
7769
+ ...deps.automationInstances === void 0 ? {} : { automations: deps.automationInstances },
7724
7770
  logger: deps.logger.child("templates")
7725
7771
  }),
7726
7772
  remote: new RemoteService({
@@ -7745,6 +7791,140 @@ function buildRemoteRuntime(deps) {
7745
7791
  };
7746
7792
  }
7747
7793
  //#endregion
7794
+ //#region src/builtins/core-blocks/automation-template-instances.ts
7795
+ /**
7796
+ * The automations made from a template (#527), found and re-expanded where they
7797
+ * live: the core-block store. An instance is a block whose recipe literal links
7798
+ * to the template (`AutomationRecipe.template`) — there is no second list of
7799
+ * instances to keep in step with the blocks.
7800
+ *
7801
+ * When a template is saved, every instance is re-expanded with its stored
7802
+ * values through the same pure function the editor uses, and its code is
7803
+ * regenerated and saved through the ordinary block update (compile gate,
7804
+ * converge). An instance whose values no longer fit keeps its last good body
7805
+ * and is flagged on its link; it is never dropped and never left silent.
7806
+ *
7807
+ * A block whose code was edited outside the generator (its fingerprint no
7808
+ * longer matches `template.codeHash`) is never regenerated over: only its
7809
+ * literal is rewritten, to flag it `edited-by-hand`.
7810
+ */
7811
+ var EDITED_BY_HAND_DETAIL = "the code was edited by hand, so the template no longer updates it; convert it to a free automation or create it again from the template";
7812
+ /** True when the block's code is still exactly what the generator wrote. */
7813
+ function isGeneratedCode(code, recipe) {
7814
+ const stamped = recipe.template?.codeHash;
7815
+ return stamped !== void 0 && instanceCodeHash(code) === stamped;
7816
+ }
7817
+ /** The hand-edited block, flagged in its literal and otherwise byte for byte; null when already flagged. */
7818
+ function flaggedAsEdited(code, recipe) {
7819
+ const link = recipe.template;
7820
+ if (link === void 0) return null;
7821
+ if (link.problems?.some((p) => p.code === "edited-by-hand") === true) return null;
7822
+ return replaceRecipeLiteral(code, {
7823
+ ...recipe,
7824
+ template: {
7825
+ ...link,
7826
+ problems: [{
7827
+ code: "edited-by-hand",
7828
+ detail: EDITED_BY_HAND_DETAIL
7829
+ }]
7830
+ }
7831
+ });
7832
+ }
7833
+ function errorText$1(error) {
7834
+ return error instanceof Error ? error.message : String(error);
7835
+ }
7836
+ function automationTemplateInstancesOver(deps) {
7837
+ const units = deps.units ?? capUnitResolver(ALL_CAPABILITY_DEFINITIONS);
7838
+ const instancesOf = (templateId) => deps.blocks().flatMap((block) => {
7839
+ const read = readRecipeLiteral(block.code);
7840
+ if (read.status !== "recipe" || read.recipe.template?.templateId !== templateId) return [];
7841
+ return [{
7842
+ block,
7843
+ recipe: read.recipe
7844
+ }];
7845
+ });
7846
+ return {
7847
+ using: async (templateId) => instancesOf(templateId).map(({ block }) => ({
7848
+ blockId: block.id,
7849
+ name: block.name
7850
+ })),
7851
+ reexpand: async (templateId, payload) => {
7852
+ let updated = 0;
7853
+ let flagged = 0;
7854
+ let failed = 0;
7855
+ for (const { block, recipe } of instancesOf(templateId)) {
7856
+ if (!isGeneratedCode(block.code, recipe)) {
7857
+ const flaggedCode = flaggedAsEdited(block.code, recipe);
7858
+ if (flaggedCode === null) continue;
7859
+ try {
7860
+ await deps.saveCode(block.id, flaggedCode);
7861
+ } catch (error) {
7862
+ failed += 1;
7863
+ deps.logger.warn("automation template: a hand-edited instance could not be flagged", { meta: {
7864
+ templateId,
7865
+ blockId: block.id,
7866
+ error: errorText$1(error)
7867
+ } });
7868
+ continue;
7869
+ }
7870
+ flagged += 1;
7871
+ deps.logger.warn("automation template: an instance was edited by hand, it is flagged and not regenerated", { meta: {
7872
+ templateId,
7873
+ blockId: block.id
7874
+ } });
7875
+ continue;
7876
+ }
7877
+ const next = reexpandAutomationInstance(payload, recipe);
7878
+ const prepared = prepareRecipeUnits(next.recipe, units);
7879
+ if (!prepared.ok) {
7880
+ failed += 1;
7881
+ deps.logger.warn("automation template: an instance could not be prepared, left as it was", { meta: {
7882
+ templateId,
7883
+ blockId: block.id,
7884
+ error: prepared.error
7885
+ } });
7886
+ continue;
7887
+ }
7888
+ const code = generateAutomationBlock({
7889
+ name: block.name,
7890
+ recipe: prepared.recipe
7891
+ });
7892
+ if (code === block.code) continue;
7893
+ try {
7894
+ await deps.saveCode(block.id, code);
7895
+ } catch (error) {
7896
+ failed += 1;
7897
+ deps.logger.warn("automation template: an instance could not be saved, left as it was", { meta: {
7898
+ templateId,
7899
+ blockId: block.id,
7900
+ error: errorText$1(error)
7901
+ } });
7902
+ continue;
7903
+ }
7904
+ if (next.flagged) {
7905
+ flagged += 1;
7906
+ deps.logger.warn("automation template: an instance no longer fits the template, its last body is kept and it is flagged", { meta: {
7907
+ templateId,
7908
+ blockId: block.id,
7909
+ problems: next.recipe.template?.problems?.map((p) => p.detail)
7910
+ } });
7911
+ } else updated += 1;
7912
+ }
7913
+ deps.logger.info("automation template: instances re-expanded", { meta: {
7914
+ templateId,
7915
+ updated,
7916
+ flagged,
7917
+ failed
7918
+ } });
7919
+ return {
7920
+ updated,
7921
+ flagged,
7922
+ failed
7923
+ };
7924
+ }
7925
+ };
7926
+ }
7927
+ //#endregion
7748
7928
  //#region src/builtins/core-blocks/fan-presets-action-source.ts
7749
7929
  /**
7750
7930
  * Lists every fan preset as an `action-source` entry so the surfaces that
@@ -9185,6 +9365,7 @@ var CoreBlocksAddon = class extends BaseAddon {
9185
9365
  });
9186
9366
  armTimedRuns(timedRun, this.ctx.logger.child("timed-run"), { isDisposed: () => this.disposed });
9187
9367
  this.transpiler = await loadTranspiler(this.ctx.logger);
9368
+ this.remoteRuntime?.templates.reexpandBuiltinInstances().catch((error) => this.ctx.logger.warn("automation templates: built-in instances were not re-expanded", { meta: { error: error instanceof Error ? error.message : String(error) } }));
9188
9369
  armBlocksIntegration({
9189
9370
  logger: this.ctx.logger,
9190
9371
  reconcile: () => this.declareBlocksIntegration(),
@@ -9320,9 +9501,34 @@ var CoreBlocksAddon = class extends BaseAddon {
9320
9501
  settings,
9321
9502
  api: () => this.ctx.api,
9322
9503
  logger: this.ctx.logger,
9323
- hasNative: (deviceId) => this.hasNativeMediaPlayer(deviceId)
9504
+ hasNative: (deviceId) => this.hasNativeMediaPlayer(deviceId),
9505
+ automationInstances: automationTemplateInstancesOver({
9506
+ blocks: () => this.requireStore().list(),
9507
+ saveCode: (blockId, code) => this.saveGeneratedCode(blockId, code),
9508
+ logger: this.ctx.logger.child("automation-templates")
9509
+ })
9324
9510
  });
9325
9511
  }
9512
+ /**
9513
+ * A regenerated automation (a template instance re-expanded, #527) saved the
9514
+ * way an operator's edit is: through the compile gate, then the store, then a
9515
+ * converge that restarts its runner.
9516
+ */
9517
+ async saveGeneratedCode(blockId, code) {
9518
+ const existing = this.requireStore().get(blockId);
9519
+ if (existing === null) throw new Error(`core-blocks: no block "${blockId}"`);
9520
+ const write = existing.files === void 0 ? { code } : {
9521
+ code,
9522
+ files: {
9523
+ ...existing.files,
9524
+ [resolveCoreBlockEntry(existing.entry)]: code
9525
+ },
9526
+ entry: resolveCoreBlockEntry(existing.entry)
9527
+ };
9528
+ await this.gate(write);
9529
+ await this.requireStore().update(blockId, write);
9530
+ this.convergeSoon();
9531
+ }
9326
9532
  /** A driver's native media-player cap reads the device; the composer's own native holds no reading. */
9327
9533
  hasNativeMediaPlayer(deviceId) {
9328
9534
  const owner = this.ctx.kernel?.capabilityRegistry?.getNativeAddonId("media-player", deviceId);
@@ -12,6 +12,7 @@
12
12
  import { type IrNativeFormat, type AddonApi, type AddonContext, type IScopedLogger, type MediaPlayerStatus, type RecordsAccess } from "@camstack/types";
13
13
  import { RemoteService, type RemoteAssumptionStore, type RemoteConfigStore, type RemoteSliceWriter } from "./remote-service.js";
14
14
  import { TemplatesService, type TemplateUsage } from "./templates-service.js";
15
+ import type { AutomationTemplateInstances } from "./automation-template-instances.js";
15
16
  /** The key of the device's settings store that holds its remote configuration. */
16
17
  export declare const REMOTE_STORE_KEY = "remote";
17
18
  /** The key that holds what the remote last sent and so guesses; never read as history. */
@@ -24,6 +25,8 @@ export interface RemoteRuntimeDeps {
24
25
  readonly logger: IScopedLogger;
25
26
  /** Whether a driver's native media-player cap reads the device (the redirect's predicate). */
26
27
  readonly hasNative: (deviceId: number) => boolean;
28
+ /** The automations made from a template (#527); absent where no block store runs. */
29
+ readonly automationInstances?: AutomationTemplateInstances;
27
30
  /** The wait between two sends of a repeat; a spec drives it. */
28
31
  readonly sleep?: (ms: number) => Promise<void>;
29
32
  readonly now?: () => number;
@@ -1,4 +1,5 @@
1
1
  import { type IScopedLogger, type ITemplateProvider, type RecordKindHandle, type TemplateUser } from "@camstack/types";
2
+ import type { AutomationTemplateInstances } from "./automation-template-instances.js";
2
3
  import type { TemplateRowBody } from "./record-kinds.js";
3
4
  /** Who still uses a template — answered by whoever owns the pointers. */
4
5
  export interface TemplateUsage {
@@ -7,6 +8,8 @@ export interface TemplateUsage {
7
8
  export interface TemplatesServiceDeps {
8
9
  readonly templates: RecordKindHandle<TemplateRowBody>;
9
10
  readonly usage: TemplateUsage;
11
+ /** The automations made from a template; absent where no block store runs. */
12
+ readonly automations?: AutomationTemplateInstances;
10
13
  readonly logger: IScopedLogger;
11
14
  readonly now?: () => number;
12
15
  readonly newId?: () => string;
@@ -20,5 +23,13 @@ export declare class TemplatesService implements ITemplateProvider {
20
23
  readonly get: ITemplateProvider["get"];
21
24
  readonly create: ITemplateProvider["create"];
22
25
  readonly update: ITemplateProvider["update"];
26
+ /**
27
+ * The shipped templates change only with a release: their instances are
28
+ * re-expanded once per start, and an instance whose code comes out the same
29
+ * is not saved (no restart).
30
+ */
31
+ reexpandBuiltinInstances(): Promise<void>;
32
+ /** A changed automation template reaches every automation made from it. */
33
+ private reexpandInstances;
23
34
  readonly delete: ITemplateProvider["delete"];
24
35
  }
@@ -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-n0kCY8sq.js");
7
- const require_capture_engine = require("../../capture-engine-OjKUSU7_.js");
6
+ const require_dist = require("../../dist-WEGVb8qV.js");
7
+ const require_capture_engine = require("../../capture-engine-yhFFC7F8.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 { Cl as DeviceType, Cs as wattMillisecondsToKwh, Ec as defineRecordKinds, El as EventCategory, Er as deviceHistoryCapability, Fs as InvalidRecordError, Hc as isReadingQuantity, Mr as deviceTransitionsCapability, Oc as emitReadiness, On as armRemovalReconcile, Or as deviceRemovalHookCapability, Pc as historyUnitFor, V as DEVICE_HISTORY_ENERGY_KEY, Zs as RecordTooLargeError, et as DeviceRunSchema, js as DeviceTransitionSchema, kr as deviceRunsCapability, vt as HISTORY_CATALOG, ws as BaseAddon, yt as HISTORY_ITEM_CATALOG } from "../../dist-7eN_r5dA.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-BpTIydES.mjs";
1
+ import { An as armRemovalReconcile, Fr as deviceTransitionsCapability, Gs as InvalidRecordError, Ic as defineRecordKinds, Il as EventCategory, Mr as deviceRunsCapability, Nl as DeviceType, Ns as wattMillisecondsToKwh, Ps as BaseAddon, Qc as isReadingQuantity, Rc as emitReadiness, U as DEVICE_HISTORY_ENERGY_KEY, Vs as DeviceTransitionSchema, Wc as historyUnitFor, bt as HISTORY_CATALOG, jr as deviceRemovalHookCapability, kr as deviceHistoryCapability, nt as DeviceRunSchema, sc as RecordTooLargeError, xt as HISTORY_ITEM_CATALOG } from "../../dist-atHH8IeD.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-B4_fq2JB.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
@@ -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-n0kCY8sq.js");
6
+ const require_dist = require("../../dist-WEGVb8qV.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  const require_log_redactor = require("../../log-redactor-BhIEMaG9.js");
9
- const require_rename_composition_block = require("../../rename-composition-block-D82Y4jGp.js");
9
+ const require_rename_composition_block = require("../../rename-composition-block-IIfaFnEl.js");
10
10
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
11
11
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
12
12
  const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
@@ -1,7 +1,7 @@
1
- import { Ac as expandCapMethods$1, Ai as locationIconKey, Ar as deviceStateCapability, Bn as buildStreamParamsConfigSchema, Br as expandContainer, Cl as DeviceType$1, Dr as deviceManagerCapability, Ec as defineRecordKinds, El as EventCategory$1, Fr as enumerateSchemaFields, Gc as isSecretMarker, Ic as isCommand$1, J as DEVICE_TEMPLATE_MAX_OUTPUT, K as DEVICE_TEMPLATE_FILTERS, Ka as runtimeFieldUnit, Kc as isSecretMarkerLike, L as DAY_NAMES, Pr as enumerateItemArrayFields, Qo as capAppliesToDeviceKind, Qr as formatMinutes, Rc as isDeviceConfigCap, Sl as DeviceRole, Ti as legacyAutoLinkIds, Tr as deviceExtensionCapability, Ua as resolveTemplateRef, Uc as isSecretClear, Un as canonicalIconKey, Vc as isKeychainStoredField, X as DEVICE_TEMPLATE_VALUES_CAP, Zi as normalizeUnit, Zo as canonicalStoredDeviceType, _i as isKernelDerivedFeature, _l as vocabActionIdFor, b as CAP_NAMES_WITH_STATUS, br as defineExtensionSlotProvider, ec as SECRET_CLEAR, ei as generateDeviceAlias, eo as settleDeviceFeatures, fl as sleep$2, fs as implementedMethodsOf$1, gl as userError, gt as FieldClaimSchema, hl as transformSecretWrite, ht as FieldClaimModeSchema, ia as parseStreamParamsFormPatch, jr as deviceStatusCapability, jt as MINUTES_PER_DAY, k as ConditionMirror, ll as secretTreeFromPaths, ml as toSecretFieldView, nn as STREAM_PROFILE_META, nt as DeviceTombstoneSchema, oc as WELL_KNOWN_TAB_MAP, ol as resolveSecretMarkers, oo as siteZoneKey, pc as auditedFields, pr as createDeviceExtensionProvider, q as DEVICE_TEMPLATE_MAX_LENGTH, qa as runtimeStatePolicyFor, qn as checkDeviceAlias, rt as DiscoveryProposalBodySchema, s as ALL_CAPABILITY_DEFINITIONS, st as ExportNameRefusedError, tt as DeviceStatusSchema, v as CAMERA_SWITCH_ORDER, vc as collectZodSecretPaths$1, wl as errMsg$1, ws as BaseAddon, xa as reconcileReportedFeatures, xl as DeviceFeature, yc as commandEffect } from "../../dist-7eN_r5dA.mjs";
1
+ import { $a as resolveTemplateRef, $c as isSecretClear, Ar as deviceManagerCapability, Bc as expandCapMethods$1, Cc as auditedFields, Ci as isKernelDerivedFeature, Cr as defineExtensionSlotProvider, Dl as vocabActionIdFor, El as userError, Hn as buildStreamParamsConfigSchema, Ic as defineRecordKinds, Ii as locationIconKey, Il as EventCategory$1, J as DEVICE_TEMPLATE_FILTERS, Jc as isDeviceConfigCap, Kc as isCommand$1, Kn as canonicalIconKey, Lr as enumerateItemArrayFields, Ml as DeviceRole, Nl as DeviceType$1, Nr as deviceStateCapability, Nt as MINUTES_PER_DAY, Oc as collectZodSecretPaths$1, Or as deviceExtensionCapability, Pl as errMsg$1, Pr as deviceStatusCapability, Ps as BaseAddon, Q as DEVICE_TEMPLATE_VALUES_CAP, Rr as enumerateSchemaFields, S as CAP_NAMES_WITH_STATUS, Sl as sleep$2, Ss as implementedMethodsOf$1, Tl as transformSecretWrite, Ur as expandContainer, X as DEVICE_TEMPLATE_MAX_OUTPUT, Xn as checkDeviceAlias, Y as DEVICE_TEMPLATE_MAX_LENGTH, Zc as isKeychainStoredField, _t as FieldClaimModeSchema, at as DiscoveryProposalBodySchema, b as CAMERA_SWITCH_ORDER, cs as capAppliesToDeviceKind, gc as WELL_KNOWN_TAB_MAP, gl as resolveSecretMarkers, go as siteZoneKey, gr as createDeviceExtensionProvider, ii as generateDeviceAlias, in as STREAM_PROFILE_META, it as DeviceTombstoneSchema, j as ConditionMirror, ji as legacyAutoLinkIds, jl as DeviceFeature, ka as reconcileReportedFeatures, kc as commandEffect, lt as ExportNameRefusedError, nl as isSecretMarkerLike, no as runtimeFieldUnit, ra as normalizeUnit, ro as runtimeStatePolicyFor, rt as DeviceStatusSchema, s as ALL_CAPABILITY_DEFINITIONS, ss as canonicalStoredDeviceType, ti as formatMinutes, tl as isSecretMarker, ua as parseStreamParamsFormPatch, uc as SECRET_CLEAR, uo as settleDeviceFeatures, vt as FieldClaimSchema, wl as toSecretFieldView, yl as secretTreeFromPaths, z as DAY_NAMES } from "../../dist-atHH8IeD.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-CuKj9mH0.mjs";
4
+ import { n as renameCompositionBlock, t as composedBlockIdOf } from "../../rename-composition-block-6ISzMLgj.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";
@@ -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-n0kCY8sq.js");
6
+ const require_dist = require("../../dist-WEGVb8qV.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 { Ni as logDestinationCapability, ws as BaseAddon } from "../../dist-7eN_r5dA.mjs";
1
+ import { Ps as BaseAddon, zi as logDestinationCapability } from "../../dist-atHH8IeD.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-n0kCY8sq.js");
7
- const require_device_ca = require("../../device-ca-EtzHeETW.js");
6
+ const require_dist = require("../../dist-WEGVb8qV.js");
7
+ const require_device_ca = require("../../device-ca-_o0-3jJ6.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-Bm1OQy6O.js");
10
- const require_constants = require("../../constants-B8nWtzwq.js");
9
+ const require_legacy_integration_rows_door = require("../../legacy-integration-rows-door-BbaIE1qF.js");
10
+ const require_constants = require("../../constants-dfnEfsX7.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 { $c as normalizeSecretOwner, Ci as keychainAdminCapability, Dt as KeychainResetRecordSchema, Ec as defineRecordKinds, El as EventCategory, Et as KeychainAuditEntrySchema, Tt as KEYCHAIN_RESET_TRIGGER_ACTOR, jc as formatSecretScope, nl as parseSecretRef, wi as keychainCapability, ws as BaseAddon } from "../../dist-7eN_r5dA.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-BOquIg22.mjs";
1
+ import { Ai as keychainCapability, Dt as KEYCHAIN_RESET_TRIGGER_ACTOR, Ic as defineRecordKinds, Il as EventCategory, Ot as KeychainAuditEntrySchema, Ps as BaseAddon, Vc as formatSecretScope, fl as parseSecretRef, ki as keychainAdminCapability, kt as KeychainResetRecordSchema, ll as normalizeSecretOwner } from "../../dist-atHH8IeD.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-h54CenJx.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-Cnqq1aq-.mjs";
5
- import { a as MESH_CA_KEY_REF } from "../../constants-DO33IJ7k.mjs";
4
+ import { t as LEGACY_INTEGRATION_ROWS_TABLE } from "../../legacy-integration-rows-door-DBO3ZLmn.mjs";
5
+ import { a as MESH_CA_KEY_REF } from "../../constants-h8wJE_8O.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-n0kCY8sq.js");
3
+ const require_dist = require("../../dist-WEGVb8qV.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 { El as EventCategory, Li as mayWriteToLocation, Xt as RecordingStatusSchema, qt as RECORDING_SOURCE_CAMSTACK_ADDON, wl as errMsg, ws as BaseAddon, xc as createEvent } from "../../dist-7eN_r5dA.mjs";
1
+ import { Il as EventCategory, Pl as errMsg, Ps as BaseAddon, Qt as RecordingStatusSchema, Ui as mayWriteToLocation, Yt as RECORDING_SOURCE_CAMSTACK_ADDON, jc as createEvent } from "../../dist-atHH8IeD.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-n0kCY8sq.js");
6
+ const require_dist = require("../../dist-WEGVb8qV.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-EtzHeETW.js");
9
+ const require_device_ca = require("../../device-ca-_o0-3jJ6.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 authProviderCapability, B as DEVICE_ENROLLMENT_TTL_MS, E as CREDENTIAL_TOKEN_AUDIENCE, Ec as defineRecordKinds, Gc as isSecretMarker, Gt as PreferenceValueSchema, Jc as makeSecretMarker, Ln as buildDeviceEnrollmentLink, M as CredentialTokenClaimsSchema, Oo as userManagementCapability, Rn as buildDeviceSignatureMessage, Rt as PREFERENCES_MAX_VALUE_BYTES, U as DEVICE_NONCE_TTL_MS, Ut as PreferenceDeviceIdSchema, Wt as PreferenceNamespaceSchema, Zr as formatDeviceRevoker, an as ScopedTokenSchema, cn as SsoBridgeClaimsSchema, gl as userError, gn as UserRecordSchema, mi as isCredentialTokenPayload, mn as TokenScopeSchema, wr as deviceCredentialsCapability, ws as BaseAddon } from "../../dist-7eN_r5dA.mjs";
2
+ import { Bn as buildDeviceSignatureMessage, Bt as PREFERENCES_MAX_VALUE_BYTES, Dr as deviceCredentialsCapability, El as userError, G as DEVICE_NONCE_TTL_MS, Gt as PreferenceDeviceIdSchema, H as DEVICE_ENROLLMENT_TTL_MS, Ic as defineRecordKinds, Kt as PreferenceNamespaceSchema, Mn as authProviderCapability, O as CREDENTIAL_TOKEN_AUDIENCE, P as CredentialTokenClaimsSchema, Ps as BaseAddon, Ro as userManagementCapability, bi as isCredentialTokenPayload, ei as formatDeviceRevoker, gn as TokenScopeSchema, il as makeSecretMarker, qt as PreferenceValueSchema, sn as ScopedTokenSchema, tl as isSecretMarker, un as SsoBridgeClaimsSchema, vn as UserRecordSchema, zn as buildDeviceEnrollmentLink } from "../../dist-atHH8IeD.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-BOquIg22.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-h54CenJx.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-n0kCY8sq.js");
3
+ const require_dist = require("../../dist-WEGVb8qV.js");
4
4
  const require_dns_wire = require("../../dns-wire-B1BvF9Ao.js");
5
- const require_hub_identity = require("../../hub-identity-Cz0pt7Ho.js");
6
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-CmGrhCgY.js");
5
+ const require_hub_identity = require("../../hub-identity-nIMYA24i.js");
6
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-B6ZHStt1.js");
7
7
  let zod = require("zod");
8
8
  let node_net = require("node:net");
9
9
  let node_fs = require("node:fs");