@camstack/system 1.2.442 → 1.2.444

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 (107) hide show
  1. package/assets/record-entries/icon.svg +8 -0
  2. package/dist/addon-runner.js +41 -11
  3. package/dist/addon-runner.mjs +42 -12
  4. package/dist/addon-utils.js +1 -1
  5. package/dist/addon-utils.mjs +1 -1
  6. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  8. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  10. package/dist/builtins/alerts/alerts.addon.d.ts +10 -2
  11. package/dist/builtins/alerts/alerts.addon.js +43 -10
  12. package/dist/builtins/alerts/alerts.addon.mjs +43 -10
  13. package/dist/builtins/autotrack/index.js +1 -1
  14. package/dist/builtins/autotrack/index.mjs +1 -1
  15. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  16. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  17. package/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/dist/builtins/camera-grid/index.js +1 -1
  20. package/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/dist/builtins/composer/composer.addon.js +2 -2
  22. package/dist/builtins/composer/composer.addon.mjs +2 -2
  23. package/dist/builtins/console-logging/index.js +1 -1
  24. package/dist/builtins/console-logging/index.mjs +1 -1
  25. package/dist/builtins/core-blocks/block-package.d.ts +4 -2
  26. package/dist/builtins/core-blocks/block-settings-store.d.ts +65 -19
  27. package/dist/builtins/core-blocks/core-blocks.addon.js +365 -38
  28. package/dist/builtins/core-blocks/core-blocks.addon.mjs +365 -38
  29. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  30. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  31. package/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/dist/builtins/keychain/index.js +3 -3
  34. package/dist/builtins/keychain/index.mjs +3 -3
  35. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  38. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  39. package/dist/builtins/local-network/local-network.addon.js +2 -2
  40. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  41. package/dist/builtins/loki-logging/index.js +1 -1
  42. package/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.js +2 -2
  44. package/dist/builtins/native-metrics/native-metrics.addon.mjs +2 -2
  45. package/dist/builtins/platform-probe/index.js +2 -2
  46. package/dist/builtins/platform-probe/index.mjs +2 -2
  47. package/dist/builtins/record-entries/entries-service.d.ts +42 -0
  48. package/dist/builtins/record-entries/index.d.ts +1 -0
  49. package/dist/builtins/record-entries/index.js +142 -0
  50. package/dist/builtins/record-entries/index.mjs +136 -0
  51. package/dist/builtins/record-entries/record-entries.addon.d.ts +13 -0
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/dist/builtins/snapshot/index.js +1 -1
  55. package/dist/builtins/snapshot/index.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/file-host-client.d.ts +2 -0
  57. package/dist/builtins/sqlite-storage/file-host-handlers.d.ts +4 -0
  58. package/dist/builtins/sqlite-storage/file-host-protocol.d.ts +7 -1
  59. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  60. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  61. package/dist/builtins/sqlite-storage/index.js +1 -1
  62. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  63. package/dist/builtins/sqlite-storage/owned-sqlite-file.d.ts +7 -0
  64. package/dist/builtins/sqlite-storage/placement-router.d.ts +5 -0
  65. package/dist/builtins/sqlite-storage/records/records-catalog.d.ts +29 -0
  66. package/dist/builtins/sqlite-storage/records/records-engine-types.d.ts +46 -0
  67. package/dist/builtins/sqlite-storage/records/records-engine.d.ts +90 -0
  68. package/dist/builtins/sqlite-storage/records/records-explain.d.ts +18 -0
  69. package/dist/builtins/sqlite-storage/records/records-plan.d.ts +90 -0
  70. package/dist/builtins/sqlite-storage/records/records-probe.d.ts +33 -0
  71. package/dist/builtins/sqlite-storage/records/records-provider.d.ts +59 -0
  72. package/dist/builtins/sqlite-storage/records/records-rows.d.ts +46 -0
  73. package/dist/builtins/sqlite-storage/records/records-sql.d.ts +41 -0
  74. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +0 -10
  75. package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +8 -0
  76. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +337 -4
  77. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +337 -4
  78. package/dist/builtins/sqlite-storage/storage-admin-provider.d.ts +7 -1
  79. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  80. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  81. package/dist/builtins/system-config/system-config.addon.js +2 -2
  82. package/dist/builtins/system-config/system-config.addon.mjs +2 -2
  83. package/dist/builtins/winston-logging/index.js +1 -1
  84. package/dist/builtins/winston-logging/index.mjs +1 -1
  85. package/dist/{composition-sources-CftPpY4O.mjs → composition-sources-C3rKncIF.mjs} +1 -1
  86. package/dist/{composition-sources-DmSEMtUD.js → composition-sources-NAPZddic.js} +1 -1
  87. package/dist/{constants-2iWQ-Nx-.mjs → constants-BKX2QnIg.mjs} +1 -1
  88. package/dist/{constants-b7kpjuO4.js → constants-BXiNEIeV.js} +1 -1
  89. package/dist/{device-ca-tKY_ZS9H.js → device-ca-DT9X2S6d.js} +1 -1
  90. package/dist/{device-ca-BJpYTAPg.mjs → device-ca-jxjSL8Ov.mjs} +1 -1
  91. package/dist/{dist-CyIHDLCg.js → dist-D1vECb_6.js} +1247 -120
  92. package/dist/{dist-DsrQYcLm.mjs → dist-DERK-gP5.mjs} +1068 -121
  93. package/dist/file-host-worker.js +11 -1
  94. package/dist/file-host-worker.mjs +11 -1
  95. package/dist/{hub-mdns-ciao-BS2akjWx.mjs → hub-mdns-ciao-CRaC97V0.mjs} +1 -1
  96. package/dist/{hub-mdns-ciao-Da-0NEyr.js → hub-mdns-ciao-Cah9GCIg.js} +1 -1
  97. package/dist/index.js +53 -21
  98. package/dist/index.mjs +54 -22
  99. package/dist/kernel/moleculer/records-api-transport.d.ts +9 -0
  100. package/dist/kernel/settings-view-types.d.ts +0 -7
  101. package/dist/{restore-archive-Cdf09dHm.js → restore-archive-Dy-qKTdF.js} +1 -1
  102. package/dist/{restore-archive-RaA3uZ7H.mjs → restore-archive-daKyE24F.mjs} +1 -1
  103. package/dist/{wal-maintenance-C-bmkDhm.js → wal-maintenance-dAv4IdzC.js} +0 -0
  104. package/dist/{wal-maintenance-DE8QrreK.mjs → wal-maintenance-zRc24mOC.mjs} +0 -0
  105. package/package.json +22 -1
  106. package/dist/{custom-action-registry-BKmoaqG0.js → custom-action-registry-COyb49zm.js} +1 -1
  107. package/dist/{custom-action-registry-CyUuhATc.mjs → custom-action-registry-stpC3Zy-.mjs} +1 -1
@@ -1,5 +1,5 @@
1
- import { A as DeclaredDevices, Ar as errMsg, Bn as resolveCoreBlockFiles, Cr as compositionSourceKey, Ct as coreBlockAddonId, Dt as coreBlocksCapability, Et as coreBlockSourceKind, Ft as describeComposableCaps, In as replacedFieldKeys, St as compositionSourceRefs, Tn as normalizeCoreBlockWrite, Tt as coreBlockIdFromAddonId, ei as hydrateSchema, ft as buildCapabilityLookup, h as CORE_BLOCK_ADDON_PREFIX, jn as planComposition, jr as BaseAddon, lr as validateComposition, m as CORE_BLOCKS_ADDON_ID, p as COMPOSER_RUNNER_ID, r as ALL_CAPABILITY_DEFINITIONS, v as CoreBlockSchema, vr as composedDeviceRef, wt as coreBlockComposition, zn as resolveCoreBlockEntry } from "../../dist-DsrQYcLm.mjs";
2
- import { t as describeCompositionSources } from "../../composition-sources-CftPpY4O.mjs";
1
+ import { Ct as compositionSourceRefs, Dr as compositionSourceKey, Dt as coreBlockSourceKind, Ei as hydrateSchema, En as normalizeCoreBlockWrite, Et as coreBlockIdFromAddonId, Fr as BaseAddon, Hn as resolveCoreBlockEntry, It as describeComposableCaps, Mn as planComposition, Ni as isSecretRefOwnedBy, Ot as coreBlocksCapability, Pr as errMsg, Sr as composedDeviceRef, Tt as coreBlockComposition, Un as resolveCoreBlockFiles, Wi as resolveSecretMarkers, Zi as transformSecretWrite, _i as collectSecretMarkerRefs, fr as validateComposition, g as CORE_BLOCK_ADDON_PREFIX, h as CORE_BLOCKS_ADDON_ID, j as DeclaredDevices, ji as isSecretMarker, m as COMPOSER_RUNNER_ID, pt as buildCapabilityLookup, qi as secretTreeFromSchema, r as ALL_CAPABILITY_DEFINITIONS, wt as coreBlockAddonId, y as CoreBlockSchema, zn as replacedFieldKeys } from "../../dist-DERK-gP5.mjs";
2
+ import { t as describeCompositionSources } from "../../composition-sources-C3rKncIF.mjs";
3
3
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
4
4
  import { n as unwrapStoredValue, t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
5
5
  import { createRequire } from "node:module";
@@ -7,6 +7,7 @@ import { randomUUID } from "node:crypto";
7
7
  import { customizationBlockName } from "@camstack/types/node";
8
8
  import * as fs from "node:fs/promises";
9
9
  import * as path$1 from "node:path";
10
+ import { isDeepStrictEqual } from "node:util";
10
11
  import * as os$1 from "node:os";
11
12
  import { pathToFileURL } from "node:url";
12
13
  //#region src/builtins/core-blocks/block-package.ts
@@ -70,6 +71,10 @@ import * as blockModule from './block.js'
70
71
 
71
72
  const BLOCK_ID = __BLOCK_ID__
72
73
  const BLOCK_NAME = __BLOCK_NAME__
74
+ // The block's settings form, embedded so the SDK derives the keychain secret
75
+ // tree from it (a password field is stored as a marker and read back resolved,
76
+ // D880). null = the block declares none.
77
+ const BLOCK_SETTINGS_SCHEMA = __BLOCK_SETTINGS_SCHEMA__
73
78
  const blockMain = blockModule.default
74
79
 
75
80
  export default class CoreBlockAddon extends BaseAddon {
@@ -81,6 +86,10 @@ export default class CoreBlockAddon extends BaseAddon {
81
86
  this.disposer = null
82
87
  }
83
88
 
89
+ globalSettingsSchema() {
90
+ return BLOCK_SETTINGS_SCHEMA
91
+ }
92
+
84
93
  async onInitialize() {
85
94
  if (typeof blockMain !== 'function') {
86
95
  throw new Error(
@@ -108,8 +117,8 @@ export default class CoreBlockAddon extends BaseAddon {
108
117
  `;
109
118
  /** Build the wrapper for one block. Exported for the test that asserts the
110
119
  * generated source actually carries the block's identity. */
111
- function renderBlockWrapper(blockId, blockName) {
112
- return WRAPPER_SOURCE.replace("__BLOCK_ID__", JSON.stringify(blockId)).replace("__BLOCK_NAME__", JSON.stringify(blockName));
120
+ function renderBlockWrapper(blockId, blockName, settingsSchema = void 0) {
121
+ return WRAPPER_SOURCE.replace("__BLOCK_ID__", () => JSON.stringify(blockId)).replace("__BLOCK_NAME__", () => JSON.stringify(blockName)).replace("__BLOCK_SETTINGS_SCHEMA__", () => JSON.stringify(settingsSchema ?? null));
113
122
  }
114
123
  /** The package manifest the addon runner reads to find the entry point. */
115
124
  function renderBlockManifest(blockId, blockName) {
@@ -158,7 +167,7 @@ async function materializeBlock(input) {
158
167
  await Promise.all([
159
168
  fs.writeFile(path$1.join(addonDir, "package.json"), renderBlockManifest(input.blockId, input.blockName), "utf-8"),
160
169
  fs.writeFile(path$1.join(distDir, "block.js"), input.js, "utf-8"),
161
- fs.writeFile(path$1.join(distDir, "index.js"), renderBlockWrapper(input.blockId, input.blockName), "utf-8")
170
+ fs.writeFile(path$1.join(distDir, "index.js"), renderBlockWrapper(input.blockId, input.blockName, input.settingsSchema), "utf-8")
162
171
  ]);
163
172
  return {
164
173
  addonDir,
@@ -421,7 +430,8 @@ var BlockSupervisor = class {
421
430
  blockId: block.id,
422
431
  blockName: block.name,
423
432
  js: compiled.js,
424
- files
433
+ files,
434
+ settingsSchema: block.settingsSchema
425
435
  });
426
436
  await this.deps.host.spawn({
427
437
  runnerId: pkg.addonId,
@@ -555,9 +565,33 @@ function createAddonSettingsStore(door, addonId) {
555
565
  //#endregion
556
566
  //#region src/builtins/core-blocks/block-settings-store.ts
557
567
  /**
568
+ * Preference values for core blocks.
569
+ *
570
+ * Schema lives on the block record (`settingsSchema`, extracted from the
571
+ * compiled entry's named export or set by the editor). The VALUES live where a
572
+ * running script reads them and nowhere else: the block addon's own
573
+ * `addon-settings` rows (`core-block-<id>.<field>`, D870), so
574
+ * `ctx.settings.readAddonStore()` answers them like any addon's settings and a
575
+ * settings patch never rewrites the operator's source.
576
+ *
577
+ * A field the block's `settingsSchema` declares `password` / `secret: true` is
578
+ * keychain-backed (D783 / D787), owner = the block's addon id, scope `global`:
579
+ * the row holds the marker, the value lives in the keychain. The block's
580
+ * generated wrapper declares the same schema, so the running script reads the
581
+ * resolved VALUE. A marker is honoured only for its own ref (an incoming marker
582
+ * is never stored - the write path treats it as "keep"), a REDACTED / view
583
+ * value keeps what is stored, and a keychain that cannot take a write refuses
584
+ * it rather than storing plaintext.
585
+ *
586
+ * Before D880 the values were ALSO kept as one blob per block in
587
+ * `core-blocks:settings`: two raw copies of every password. That collection is
588
+ * now LEGACY - read only by {@link BlockSettingsStore.migrateRawSecrets}, which
589
+ * moves the secrets, copies any key the rows lack, and deletes the blob.
590
+ */
591
+ /**
558
592
  * @durable class=config owner=core-blocks
559
- * write="`setValues` / `mergeValues` persist the operator's prefs for one block"
560
- * retention="`delete` when the block is deleted. Nothing ages out."
593
+ * write="NOTHING since D880 - the values live in the block addon's `addon-settings` rows. Only the one-shot `migrateRawSecrets` reads it, then deletes each row."
594
+ * retention="legacy: every row is deleted by the verified operator migration; the declaration goes with it once every hub ran it."
561
595
  */
562
596
  var CORE_BLOCK_SETTINGS_COLLECTION = "core-blocks:settings";
563
597
  var CORE_BLOCK_SETTINGS_COLUMNS = [{
@@ -571,54 +605,335 @@ var CORE_BLOCK_SETTINGS_COLUMNS = [{
571
605
  notNull: true,
572
606
  defaultValue: "{}"
573
607
  }];
608
+ /** The block declares a secret, but this process has no keychain door to put it in. */
609
+ var BlockSecretsUnavailableError = class extends Error {
610
+ blockId;
611
+ constructor(blockId) {
612
+ super(`core block "${blockId}" declares a password field, but this process has no keychain door - nothing was saved. Unlock the keychain (System -> Secrets) and save again.`);
613
+ this.blockId = blockId;
614
+ this.name = "BlockSecretsUnavailableError";
615
+ }
616
+ };
617
+ /** The block addon's settings rows could not be read: never answered as "empty". */
618
+ var BlockSettingsUnreadableError = class extends Error {
619
+ blockId;
620
+ constructor(blockId, reason) {
621
+ super(`core block "${blockId}": its settings rows cannot be read (${reason})`);
622
+ this.blockId = blockId;
623
+ this.name = "BlockSettingsUnreadableError";
624
+ }
625
+ };
626
+ function isRecord(value) {
627
+ return typeof value === "object" && value !== null && !Array.isArray(value);
628
+ }
629
+ /** Walk `blob` along the secret `tree`: how many declared secret values are raw / markers. */
630
+ function countSecretLeaves(tree, blob) {
631
+ const counts = {
632
+ raw: 0,
633
+ markers: 0
634
+ };
635
+ if (!isRecord(blob)) return counts;
636
+ const visit = (node, value) => {
637
+ if (node.kind === "leaf") {
638
+ if (isSecretMarker(value)) counts.markers += 1;
639
+ else if (typeof value === "string" && value.length > 0) counts.raw += 1;
640
+ return;
641
+ }
642
+ if (node.kind === "object") {
643
+ if (isRecord(value)) for (const [key, child] of node.children) visit(child, value[key]);
644
+ return;
645
+ }
646
+ if (Array.isArray(value)) for (const row of value) {
647
+ if (!isRecord(row)) continue;
648
+ for (const [key, child] of node.item) visit(child, row[key]);
649
+ }
650
+ };
651
+ for (const [key, node] of tree) visit(node, blob[key]);
652
+ return counts;
653
+ }
654
+ /** Only the top-level keys the secret tree names (and, when given, `only` holds). */
655
+ function secretKeysOf(tree, blob, only) {
656
+ const out = {};
657
+ for (const key of tree.keys()) if (key in blob && (only === void 0 || key in only)) out[key] = blob[key];
658
+ return out;
659
+ }
660
+ /**
661
+ * Names that LOOK like a credential. Only used on a block whose schema does not
662
+ * declare the field (none, or a partial one): such a value cannot be moved by type,
663
+ * so it is FLAGGED, never copied and never silently dropped.
664
+ */
665
+ var CREDENTIAL_NAME = /(password|passwd|passphrase|secret|token|api_?key|private_?key|access_?code|credential|cookie|pincode|pin$)/i;
666
+ var NOT_A_VALUE_SUFFIX = /(hash|hashed|fingerprint|count|length|expires|expiry|type|kind|version|status|label|ref|path|id|name)$/i;
667
+ function holdsRawCredential(value, depth = 0) {
668
+ if (depth > 8) return false;
669
+ if (Array.isArray(value)) return value.some((v) => holdsRawCredential(v, depth + 1));
670
+ if (!isRecord(value) || isSecretMarker(value)) return false;
671
+ return Object.entries(value).some(([key, child]) => CREDENTIAL_NAME.test(key) && !NOT_A_VALUE_SUFFIX.test(key) ? typeof child === "string" && child.length > 0 || holdsRawCredential(child, depth + 1) : holdsRawCredential(child, depth + 1));
672
+ }
673
+ /** Top-level keys the schema does not declare secret that nevertheless hold a raw credential-named value. */
674
+ function untrackedCredentialKeys(tree, blob) {
675
+ const out = /* @__PURE__ */ new Set();
676
+ for (const [key, value] of Object.entries(blob)) {
677
+ if (tree.has(key)) continue;
678
+ if (CREDENTIAL_NAME.test(key) && !NOT_A_VALUE_SUFFIX.test(key) && typeof value === "string" && value.length > 0 || !isSecretMarker(value) && holdsRawCredential(value)) out.add(key);
679
+ }
680
+ return out;
681
+ }
682
+ /** The legacy row's values, tolerating the old bare-blob shape. */
683
+ function legacyValuesOf(row) {
684
+ if (!isRecord(row)) return {};
685
+ const values = row["values"];
686
+ if (isRecord(values)) return { ...values };
687
+ return "values" in row ? {} : { ...row };
688
+ }
574
689
  var BlockSettingsStore = class {
575
690
  store;
691
+ keychainFor;
692
+ onOrphaned;
576
693
  constructor(deps) {
577
694
  this.store = deps.store;
695
+ this.keychainFor = deps.keychainFor;
696
+ this.onOrphaned = deps.onOrphaned ?? (() => void 0);
578
697
  }
698
+ /** Declares the LEGACY collection, so the migration can read it. */
579
699
  static async declare(store) {
580
700
  await store.declareCollection.mutate({
581
701
  collection: CORE_BLOCK_SETTINGS_COLLECTION,
582
702
  columns: [...CORE_BLOCK_SETTINGS_COLUMNS]
583
703
  });
584
704
  }
585
- async getValues(blockId) {
586
- const row = await this.store.get.query({
705
+ rows(blockId) {
706
+ const store = this.store;
707
+ return createAddonSettingsStore({
708
+ query: (input) => store.query.query(input),
709
+ get: (input) => store.get.query(input),
710
+ transact: (input) => store.transact.mutate(input)
711
+ }, coreBlockAddonId(blockId));
712
+ }
713
+ /**
714
+ * The block's stored values - markers, NOT resolved. For the admin form
715
+ * (`hydrateSchema` turns a marker into a "set" view) and as the `stored`
716
+ * side of a write. Absent answers `{}`; an unreadable store THROWS.
717
+ */
718
+ async readStored(blockId) {
719
+ const read = await this.rows(blockId).read();
720
+ if (read.kind === "unreadable") throw new BlockSettingsUnreadableError(blockId, read.error);
721
+ return read.kind === "present" ? { ...read.value } : {};
722
+ }
723
+ /**
724
+ * Patch the block's values. Secret fields (by the schema TYPE) go to the
725
+ * keychain first and the row gets the marker; a keychain that cannot take
726
+ * them refuses the whole patch.
727
+ */
728
+ async mergeValues(blockId, schema, patch) {
729
+ const tree = secretTreeFromSchema(schema ?? null);
730
+ if (tree.size === 0) {
731
+ await this.rows(blockId).merge(patch);
732
+ return;
733
+ }
734
+ const secrets = this.keychainFor(coreBlockAddonId(blockId));
735
+ if (secrets === null) throw new BlockSecretsUnavailableError(blockId);
736
+ const result = await transformSecretWrite({
737
+ tree,
738
+ secrets,
739
+ patch,
740
+ stored: await this.readStored(blockId),
741
+ operatorWrite: true
742
+ });
743
+ await this.rows(blockId).merge(result.patch);
744
+ const { orphaned } = await result.afterWrite();
745
+ if (orphaned.length > 0) this.onOrphaned(blockId, orphaned);
746
+ }
747
+ /** The block is gone: its rows, its keychain values and the legacy blob go with it. */
748
+ async delete(blockId) {
749
+ const stored = await this.readStored(blockId);
750
+ const owner = coreBlockAddonId(blockId);
751
+ const refs = collectSecretMarkerRefs(stored);
752
+ const removal = {};
753
+ for (const key of Object.keys(stored)) removal[key] = void 0;
754
+ await this.rows(blockId).merge(removal);
755
+ await this.store.delete.mutate({
587
756
  collection: CORE_BLOCK_SETTINGS_COLLECTION,
588
757
  key: blockId
589
758
  });
590
- if (row === null || typeof row !== "object") return {};
591
- const values = row.values;
592
- if (values !== null && typeof values === "object" && !Array.isArray(values)) return { ...values };
593
- if (!("values" in row)) return { ...row };
594
- return {};
759
+ if (refs.length === 0) return;
760
+ const secrets = this.keychainFor(owner);
761
+ try {
762
+ await secrets?.delete(refs);
763
+ if (secrets === null) this.onOrphaned(blockId, refs);
764
+ } catch {
765
+ this.onOrphaned(blockId, refs);
766
+ }
595
767
  }
596
- async mergeValues(blockId, patch) {
597
- const next = {
598
- ...await this.getValues(blockId),
599
- ...patch
768
+ /**
769
+ * D880: move every plaintext secret a block's `settingsSchema` declares into
770
+ * the keychain, and delete the legacy `core-blocks:settings` blob.
771
+ *
772
+ * Per block: gather the values (the addon-settings rows win; a key only the
773
+ * blob holds is carried over), put each secret, READ IT BACK and compare,
774
+ * and only then write the marker. The legacy row is deleted only after the
775
+ * block's rows hold every key it had and every secret resolves. A block that
776
+ * fails stays exactly as it was. Dry run unless `apply`; idempotent; counts
777
+ * only - never a value, a ref or a block id.
778
+ */
779
+ async migrateRawSecrets(blocks, apply) {
780
+ const legacyRows = await this.store.query.query({ collection: CORE_BLOCK_SETTINGS_COLLECTION });
781
+ const legacyById = /* @__PURE__ */ new Map();
782
+ for (const row of legacyRows) legacyById.set(row.id, legacyValuesOf(row.data));
783
+ const tally = {
784
+ rows: 0,
785
+ raw: 0,
786
+ markers: 0,
787
+ migrated: 0,
788
+ failed: 0,
789
+ redundant: 0
600
790
  };
601
- await this.store.set.mutate({
602
- collection: CORE_BLOCK_SETTINGS_COLLECTION,
603
- key: blockId,
604
- value: { values: next }
605
- });
606
- await this.mirrorToBlockAddon(blockId, next);
607
- return next;
791
+ const verifyAfter = [];
792
+ for (const block of blocks) {
793
+ const tree = secretTreeFromSchema(block.settingsSchema ?? null);
794
+ const legacy = legacyById.get(block.id);
795
+ const stored = await this.readStored(block.id);
796
+ const effective = {
797
+ ...legacy,
798
+ ...stored
799
+ };
800
+ const counts = countSecretLeaves(tree, effective);
801
+ const untracked = untrackedCredentialKeys(tree, effective);
802
+ if (tree.size > 0 || untracked.size > 0) {
803
+ tally.rows += 1;
804
+ if (counts.raw > 0 || untracked.size > 0) tally.raw += 1;
805
+ else if (counts.markers > 0) tally.markers += 1;
806
+ verifyAfter.push(block);
807
+ }
808
+ const hasLegacy = legacy !== void 0;
809
+ if (hasLegacy) tally.redundant += 1;
810
+ if (!apply) continue;
811
+ const carry = this.carryable(block.id, effective, stored, tree, untracked);
812
+ if (carry.foreign > 0) tally.failed += 1;
813
+ if (counts.raw > 0) if (await this.moveBlock(block, tree, carry.rest, effective, stored)) tally.migrated += 1;
814
+ else {
815
+ tally.failed += 1;
816
+ continue;
817
+ }
818
+ else if (hasLegacy && Object.keys(carry.rest).length > 0) await this.rows(block.id).merge(carry.rest);
819
+ const legacyUntracked = untrackedCredentialKeys(tree, legacy ?? {});
820
+ if (hasLegacy && legacyUntracked.size === 0) await this.dropLegacy(block.id);
821
+ }
822
+ const known = new Set(blocks.map((b) => b.id));
823
+ for (const id of legacyById.keys()) {
824
+ if (known.has(id)) continue;
825
+ tally.redundant += 1;
826
+ if (apply) await this.dropLegacy(id);
827
+ }
828
+ return this.report(apply, tally, verifyAfter);
608
829
  }
609
- async delete(blockId) {
830
+ /**
831
+ * The keys of the legacy blob that may be copied into the block's rows: not in
832
+ * the rows already, not a secret the tree moves, not a credential-named value no
833
+ * schema declares (flagged instead), and not a marker that points at another
834
+ * owner's secret (counted as `foreign`, never copied).
835
+ */
836
+ carryable(blockId, effective, stored, tree, untracked) {
837
+ const owner = coreBlockAddonId(blockId);
838
+ const rest = {};
839
+ let foreign = 0;
840
+ for (const [key, value] of Object.entries(effective)) {
841
+ if (key in stored || tree.has(key) || untracked.has(key)) continue;
842
+ if (collectSecretMarkerRefs(value).some((ref) => !isSecretRefOwnedBy(ref, owner))) {
843
+ foreign += 1;
844
+ continue;
845
+ }
846
+ rest[key] = value;
847
+ }
848
+ return {
849
+ rest,
850
+ foreign
851
+ };
852
+ }
853
+ async dropLegacy(blockId) {
610
854
  await this.store.delete.mutate({
611
855
  collection: CORE_BLOCK_SETTINGS_COLLECTION,
612
856
  key: blockId
613
857
  });
614
858
  }
615
- async mirrorToBlockAddon(blockId, values) {
616
- const store = this.store;
617
- await createAddonSettingsStore({
618
- query: (input) => store.query.query(input),
619
- get: (input) => store.get.query(input),
620
- transact: (input) => store.transact.mutate(input)
621
- }, coreBlockAddonId(blockId)).merge(values);
859
+ /** put -> read back -> compare -> only then the marker rows. */
860
+ async moveBlock(block, tree, rest, effective, stored) {
861
+ const secrets = this.keychainFor(coreBlockAddonId(block.id));
862
+ if (secrets === null) return false;
863
+ const original = secretKeysOf(tree, effective);
864
+ let written = null;
865
+ try {
866
+ written = await transformSecretWrite({
867
+ tree,
868
+ secrets,
869
+ patch: original,
870
+ stored: secretKeysOf(tree, stored),
871
+ operatorWrite: true
872
+ });
873
+ const back = await resolveSecretMarkers(written.patch, secrets, { unresolved: "omit" });
874
+ const expected = await resolveSecretMarkers(secretKeysOf(tree, original, written.patch), secrets, { unresolved: "omit" });
875
+ if (back.unresolved.length > 0 || expected.unresolved.length > 0 || !isDeepStrictEqual(back.value, expected.value)) {
876
+ await this.discard(secrets, written.patch, stored);
877
+ return false;
878
+ }
879
+ await this.rows(block.id).merge({
880
+ ...rest,
881
+ ...written.patch
882
+ });
883
+ await written.afterWrite();
884
+ return true;
885
+ } catch {
886
+ if (written !== null) await this.discard(secrets, written.patch, stored);
887
+ return false;
888
+ }
889
+ }
890
+ /** Remove the values a failed move put, never one the row already pointed at. */
891
+ async discard(secrets, patch, stored) {
892
+ const had = new Set(collectSecretMarkerRefs(stored));
893
+ const fresh = collectSecretMarkerRefs(patch).filter((ref) => !had.has(ref));
894
+ if (fresh.length === 0) return;
895
+ try {
896
+ await secrets.delete(fresh);
897
+ } catch {}
898
+ }
899
+ async report(apply, tally, subjects) {
900
+ let remainingRaw = 0;
901
+ let unresolvedMarkers = 0;
902
+ const legacyById = /* @__PURE__ */ new Map();
903
+ for (const row of await this.store.query.query({ collection: CORE_BLOCK_SETTINGS_COLLECTION })) legacyById.set(row.id, legacyValuesOf(row.data));
904
+ for (const block of subjects) {
905
+ const tree = secretTreeFromSchema(block.settingsSchema ?? null);
906
+ const after = await this.readStored(block.id);
907
+ const counts = countSecretLeaves(tree, after);
908
+ remainingRaw += counts.raw;
909
+ const legacyKeys = legacyById.get(block.id) ?? {};
910
+ for (const key of untrackedCredentialKeys(tree, after)) if (!(key in legacyKeys)) remainingRaw += 1;
911
+ if (counts.markers === 0) continue;
912
+ const secrets = this.keychainFor(coreBlockAddonId(block.id));
913
+ if (secrets === null) {
914
+ unresolvedMarkers += counts.markers;
915
+ continue;
916
+ }
917
+ const resolved = await resolveSecretMarkers(secretKeysOf(tree, after), secrets, { unresolved: "omit" });
918
+ unresolvedMarkers += resolved.unresolved.length;
919
+ }
920
+ const bySchema = new Map(subjects.map((b) => [b.id, b.settingsSchema]));
921
+ for (const [id, values] of legacyById) {
922
+ const tree = secretTreeFromSchema(bySchema.get(id) ?? null);
923
+ remainingRaw += countSecretLeaves(tree, values).raw + untrackedCredentialKeys(tree, values).size;
924
+ }
925
+ return {
926
+ apply,
927
+ rows: tally.rows,
928
+ raw: tally.raw,
929
+ markers: tally.markers,
930
+ migrated: tally.migrated,
931
+ failed: tally.failed,
932
+ remainingRaw,
933
+ unresolvedMarkers,
934
+ redundantCopies: tally.redundant,
935
+ verified: remainingRaw === 0 && unresolvedMarkers === 0
936
+ };
622
937
  }
623
938
  };
624
939
  //#endregion
@@ -1948,7 +2263,14 @@ var CoreBlocksAddon = class extends BaseAddon {
1948
2263
  store: settingsStore,
1949
2264
  logger: this.ctx.logger.child("store")
1950
2265
  });
1951
- this.prefs = new BlockSettingsStore({ store: settingsStore });
2266
+ this.prefs = new BlockSettingsStore({
2267
+ store: settingsStore,
2268
+ keychainFor: (owner) => this.ctx.secrets?.forOwner?.(owner) ?? null,
2269
+ onOrphaned: (blockId, refs) => this.ctx.logger.warn("core block settings: dropped keychain refs could not be deleted", { meta: {
2270
+ blockId,
2271
+ refs: [...refs]
2272
+ } })
2273
+ });
1952
2274
  await this.store.load();
1953
2275
  this.transpiler = await loadTranspiler(this.ctx.logger);
1954
2276
  armBlocksIntegration({
@@ -2208,13 +2530,18 @@ var CoreBlocksAddon = class extends BaseAddon {
2208
2530
  if (block === null) return null;
2209
2531
  const schema = block.settingsSchema;
2210
2532
  if (schema === void 0) return null;
2211
- return hydrateSchema(schema, await this.requirePrefs().getValues(blockId));
2533
+ return hydrateSchema(schema, await this.requirePrefs().readStored(blockId), { inlineSecretsAsViews: true });
2212
2534
  },
2213
2535
  updateBlockSettings: async ({ blockId, patch }) => {
2214
- if (this.requireStore().get(blockId) === null) throw new Error(`core-blocks: no block "${blockId}"`);
2215
- await this.requirePrefs().mergeValues(blockId, patch);
2536
+ const block = this.requireStore().get(blockId);
2537
+ if (block === null) throw new Error(`core-blocks: no block "${blockId}"`);
2538
+ await this.requirePrefs().mergeValues(blockId, block.settingsSchema, patch);
2216
2539
  return { success: true };
2217
2540
  },
2541
+ migrateRawSecrets: async ({ apply }) => this.requirePrefs().migrateRawSecrets(this.requireStore().list().map((b) => ({
2542
+ id: b.id,
2543
+ settingsSchema: b.settingsSchema
2544
+ })), apply),
2218
2545
  getTypeDefs: async () => {
2219
2546
  this.typeDefs ??= await loadBlockTypeDefs(this.ctx.logger);
2220
2547
  return { libs: this.typeDefs.map((l) => ({
@@ -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-CyIHDLCg.js");
6
+ const require_dist = require("../../dist-D1vECb_6.js");
7
7
  const require_prefix_range = require("../../prefix-range-D_KueXbQ.js");
8
8
  const require_prefix_walk = require("../../prefix-walk-Dv6MLZlM.js");
9
9
  const require_retired_settings_keys = require("../../retired-settings-keys-D_VwZiDt.js");
@@ -1,4 +1,4 @@
1
- import { Ar as errMsg, Br as WELL_KNOWN_TAB_MAP, Bt as deviceStatusCapability, C as DAY_NAMES, Ci as EventCategory, Dr as DeviceFeature, En as normalizeUnit, Gn as runtimeStatePolicyFor, Ht as enumerateItemArrayFields, Kr as collectZodSecretPaths, Kt as expandContainer, Lt as deviceExtensionCapability, N as FieldClaimModeSchema, Nt as defineExtensionSlotProvider, Or as DeviceRole, Ot as createDeviceExtensionProvider, P as FieldClaimSchema, Qt as formatMinutes, Rt as deviceManagerCapability, Si as userError, Ut as enumerateSchemaFields, V as MINUTES_PER_DAY, Y as STREAM_PROFILE_META, Zn as siteZoneKey, _i as secretTreeFromPaths, ai as isSecretMarker, bi as toSecretFieldView, c as CAMERA_SWITCH_ORDER, dn as legacyAutoLinkIds, hi as resolveSecretMarkers, hn as locationIconKey, ht as buildStreamParamsConfigSchema, ii as isSecretClear, j as DeviceStatusSchema, jr as BaseAddon, kn as parseStreamParamsFormPatch, kr as DeviceType, oi as isSecretMarkerLike, r as ALL_CAPABILITY_DEFINITIONS, ri as isKeychainStoredField, ti as isDeviceConfigCap, u as CAP_NAMES_WITH_STATUS, vi as sleep$1, vt as canonicalIconKey, xi as transformSecretWrite, zr as SECRET_CLEAR, zt as deviceStateCapability } from "../../dist-DsrQYcLm.mjs";
1
+ import { $i as EventCategory, $t as formatMinutes, Ai as isSecretClear, An as parseStreamParamsFormPatch, Bt as deviceStateCapability, Di as isDeviceConfigCap, Dn as normalizeUnit, F as FieldClaimSchema, Fr as BaseAddon, H as MINUTES_PER_DAY, Ji as sleep$1, Jn as runtimeStatePolicyFor, Ki as secretTreeFromPaths, M as DeviceStatusSchema, Mi as isSecretMarkerLike, Mr as DeviceRole, Nr as DeviceType, P as FieldClaimModeSchema, Pr as errMsg, Pt as defineExtensionSlotProvider, Qi as userError, Rt as deviceExtensionCapability, Ut as enumerateItemArrayFields, Vt as deviceStatusCapability, Wi as resolveSecretMarkers, Wt as enumerateSchemaFields, X as STREAM_PROFILE_META, Xi as toSecretFieldView, Zi as transformSecretWrite, d as CAP_NAMES_WITH_STATUS, er as siteZoneKey, fn as legacyAutoLinkIds, gn as locationIconKey, gt as buildStreamParamsConfigSchema, ji as isSecretMarker, jr as DeviceFeature, ki as isKeychainStoredField, kt as createDeviceExtensionProvider, l as CAMERA_SWITCH_ORDER, li as WELL_KNOWN_TAB_MAP, oi as SECRET_CLEAR, qt as expandContainer, r as ALL_CAPABILITY_DEFINITIONS, vi as collectZodSecretPaths, w as DAY_NAMES, yt as canonicalIconKey, zt as deviceManagerCapability } from "../../dist-DERK-gP5.mjs";
2
2
  import { t as prefixRange } from "../../prefix-range-Dl0znowN.mjs";
3
3
  import { t as loadPrefixed } from "../../prefix-walk-DAOBSyH1.mjs";
4
4
  import { r as purgeRetiredSettingsRows } from "../../retired-settings-keys-Bhwe4ymb.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-CyIHDLCg.js");
6
+ const require_dist = require("../../dist-D1vECb_6.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.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 { gn as logDestinationCapability, jr as BaseAddon } from "../../dist-DsrQYcLm.mjs";
1
+ import { Fr as BaseAddon, _n as logDestinationCapability } from "../../dist-DERK-gP5.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  //#region src/builtins/hub-forwarder/hub-forwarder-destination.ts
4
4
  var DEFAULT_OUTBOUND_BUFFER_SIZE = 500;
@@ -3,9 +3,9 @@ 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-CyIHDLCg.js");
7
- const require_device_ca = require("../../device-ca-tKY_ZS9H.js");
8
- const require_constants = require("../../constants-b7kpjuO4.js");
6
+ const require_dist = require("../../dist-D1vECb_6.js");
7
+ const require_device_ca = require("../../device-ca-DT9X2S6d.js");
8
+ const require_constants = require("../../constants-BXiNEIeV.js");
9
9
  const require_platform_key_source = require("../../platform-key-source-Di7HrlGR.js");
10
10
  let node_crypto = require("node:crypto");
11
11
  let _camstack_types_node = require("@camstack/types/node");
@@ -1,6 +1,6 @@
1
- import { $r as formatSecretScope, Ci as EventCategory, L as KEYCHAIN_RESET_TRIGGER_ACTOR, fi as parseSecretRef, jr as BaseAddon, li as normalizeSecretOwner, ln as keychainAdminCapability, un as keychainCapability } from "../../dist-DsrQYcLm.mjs";
2
- import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-BJpYTAPg.mjs";
3
- import { a as MESH_CA_KEY_REF } from "../../constants-2iWQ-Nx-.mjs";
1
+ import { $i as EventCategory, Bi as parseSecretRef, Fr as BaseAddon, Li as normalizeSecretOwner, R as KEYCHAIN_RESET_TRIGGER_ACTOR, Ti as formatSecretScope, dn as keychainCapability, un as keychainAdminCapability } from "../../dist-DERK-gP5.mjs";
2
+ import { d as JWT_SIGNING_KEY_REF, n as DEVICE_CA_KEY_REF, p as SYSTEM_SECRET_OWNER } from "../../device-ca-jxjSL8Ov.mjs";
3
+ import { a as MESH_CA_KEY_REF } from "../../constants-BKX2QnIg.mjs";
4
4
  import { n as getPlatformKeychainKey } from "../../platform-key-source-BWlq0jjn.mjs";
5
5
  import { createCipheriv, createDecipheriv, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
6
6
  import { restrictDirToOwnerSync, restrictFileToOwnerSync, writeOwnerOnlyFileSync } from "@camstack/types/node";
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-CyIHDLCg.js");
3
+ const require_dist = require("../../dist-D1vECb_6.js");
4
4
  //#region src/builtins/liveness-monitor/liveness-checks.ts
5
5
  var NO_DEVICES = "liveness:no-devices";
6
6
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -1,4 +1,4 @@
1
- import { Ar as errMsg, Ci as EventCategory, G as RecordingStatusSchema, W as RECORDING_SOURCE_CAMSTACK_ADDON, jr as BaseAddon, qr as createEvent } from "../../dist-DsrQYcLm.mjs";
1
+ import { $i as EventCategory, Fr as BaseAddon, G as RECORDING_SOURCE_CAMSTACK_ADDON, K as RecordingStatusSchema, Pr as errMsg, yi as createEvent } from "../../dist-DERK-gP5.mjs";
2
2
  //#region src/builtins/liveness-monitor/liveness-checks.ts
3
3
  var NO_DEVICES = "liveness:no-devices";
4
4
  var ALL_OFFLINE = "liveness:all-devices-offline";
@@ -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-CyIHDLCg.js");
6
+ const require_dist = require("../../dist-D1vECb_6.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-tKY_ZS9H.js");
9
+ const require_device_ca = require("../../device-ca-DT9X2S6d.js");
10
10
  let node_crypto = require("node:crypto");
11
11
  node_crypto = require_chunk.__toESM(node_crypto);
12
12
  let crypto$1 = require("crypto");
@@ -1,8 +1,8 @@
1
1
  import { i as __require, o as __toESM, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { E as DEVICE_NONCE_TTL_MS, It as deviceCredentialsCapability, Q as SsoBridgeClaimsSchema, Si as userError, T as DEVICE_ENROLLMENT_TTL_MS, X as ScopedTokenSchema, Zt as formatDeviceRevoker, a as ApiKeyRecordSchema, ai as isSecretMarker, cr as userManagementCapability, ct as authProviderCapability, jr as BaseAddon, mt as buildDeviceSignatureMessage, pt as buildDeviceEnrollmentLink, rt as UserRecordSchema, si as makeSecretMarker } from "../../dist-DsrQYcLm.mjs";
2
+ import { $ as SsoBridgeClaimsSchema, D as DEVICE_NONCE_TTL_MS, E as DEVICE_ENROLLMENT_TTL_MS, Fr as BaseAddon, Lt as deviceCredentialsCapability, Pi as makeSecretMarker, Qi as userError, Qt as formatDeviceRevoker, Z as ScopedTokenSchema, a as ApiKeyRecordSchema, dr as userManagementCapability, ht as buildDeviceSignatureMessage, it as UserRecordSchema, ji as isSecretMarker, lt as authProviderCapability, mt as buildDeviceEnrollmentLink } from "../../dist-DERK-gP5.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-BJpYTAPg.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-jxjSL8Ov.mjs";
6
6
  import * as crypto$1 from "node:crypto";
7
7
  import { X509Certificate, createHash, randomUUID, timingSafeEqual } from "node:crypto";
8
8
  import nodeCrypto from "crypto";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("../../chunk-Cek0wNdY.js");
3
- const require_dist = require("../../dist-CyIHDLCg.js");
4
- const require_hub_mdns_ciao = require("../../hub-mdns-ciao-Da-0NEyr.js");
3
+ const require_dist = require("../../dist-D1vECb_6.js");
4
+ const require_hub_mdns_ciao = require("../../hub-mdns-ciao-Cah9GCIg.js");
5
5
  let zod = require("zod");
6
6
  let node_net = require("node:net");
7
7
  let node_os = require("node:os");
@@ -1,5 +1,5 @@
1
- import { An as pickAppLinkHub, Ci as EventCategory, F as HUB_MDNS_SERVICE_TYPE, I as HUB_MDNS_TXT_KEYS, Ln as resolveAppConnections, U as NetworkTunnelStartedDataSchema, Vn as resolveHubAddressRoles, Wn as resolveNotificationTapAddress, in as isDefaultAppConnectionEndpoint, jr as BaseAddon, l as CAMSTACK_APP_LINK_ORIGIN, mn as localNetworkCapability, tn as isAppLinkBase, ur as validateCustomAddress, yt as checkRoleAddress } from "../../dist-DsrQYcLm.mjs";
2
- import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-BS2akjWx.mjs";
1
+ import { $i as EventCategory, Bn as resolveAppConnections, Fr as BaseAddon, I as HUB_MDNS_SERVICE_TYPE, L as HUB_MDNS_TXT_KEYS, W as NetworkTunnelStartedDataSchema, Wn as resolveHubAddressRoles, an as isDefaultAppConnectionEndpoint, bt as checkRoleAddress, hn as localNetworkCapability, jn as pickAppLinkHub, nn as isAppLinkBase, pr as validateCustomAddress, qn as resolveNotificationTapAddress, u as CAMSTACK_APP_LINK_ORIGIN } from "../../dist-DERK-gP5.mjs";
2
+ import { P as readLanHttpState, a as storeUploadedCertificate, d as servedHttpsLeafFingerprint, g as readTlsMode, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as applyLanHttp, k as DEFAULT_LAN_HTTP_PORT, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, r as regenerateCertificate, t as createCiaoPublisher, v as writeExtraSans, w as ensureTlsCert } from "../../hub-mdns-ciao-CRaC97V0.mjs";
3
3
  import { z } from "zod";
4
4
  import { isIP } from "node:net";
5
5
  import * as os$1 from "node:os";