@camstack/server 1.2.790 → 1.2.792

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 (100) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/trpc/device-config-secret-redaction.js +14 -1
  3. package/dist/api/trpc/generated-cap-routers.js +24 -0
  4. package/dist/api/trpc/localized-schema-paths.js +1 -0
  5. package/dist/core/addon/addon-settings-provider.js +57 -0
  6. package/package.json +18 -24
  7. package/system/dist/addon-runner.js +22 -0
  8. package/system/dist/addon-runner.mjs +22 -0
  9. package/system/dist/{agent-https-ByceQLwr.mjs → agent-https-BmVaVskH.mjs} +1 -1
  10. package/system/dist/{agent-https-BmXXKQAA.js → agent-https-DOs15BCJ.js} +1 -1
  11. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  14. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  15. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  16. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  17. package/system/dist/builtins/autotrack/autotrack.addon.d.ts +7 -7
  18. package/system/dist/builtins/autotrack/index.js +15 -8
  19. package/system/dist/builtins/autotrack/index.mjs +15 -8
  20. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  21. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  22. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  23. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  24. package/system/dist/builtins/camera-grid/index.js +1 -1
  25. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  26. package/system/dist/builtins/composer/composer.addon.js +3 -3
  27. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  28. package/system/dist/builtins/console-logging/index.js +1 -1
  29. package/system/dist/builtins/console-logging/index.mjs +1 -1
  30. package/system/dist/builtins/core-blocks/core-blocks.addon.js +3 -3
  31. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +3 -3
  32. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  33. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  34. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  35. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  36. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  37. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  38. package/system/dist/builtins/keychain/index.js +4 -4
  39. package/system/dist/builtins/keychain/index.mjs +4 -4
  40. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  41. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  42. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  43. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  44. package/system/dist/builtins/local-network/address-book.d.ts +2 -0
  45. package/system/dist/builtins/local-network/local-network.addon.d.ts +7 -0
  46. package/system/dist/builtins/local-network/local-network.addon.js +27 -9
  47. package/system/dist/builtins/local-network/local-network.addon.mjs +27 -9
  48. package/system/dist/builtins/loki-logging/index.js +53 -83
  49. package/system/dist/builtins/loki-logging/index.mjs +53 -83
  50. package/system/dist/builtins/loki-logging/loki-logging.addon.d.ts +1 -4
  51. package/system/dist/builtins/loki-logging/migrations/index.d.ts +4 -1
  52. package/system/dist/builtins/loki-logging/migrations/retired-enabled-flag.d.ts +22 -0
  53. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  54. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  55. package/system/dist/builtins/platform-probe/index.js +1 -1
  56. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  57. package/system/dist/builtins/record-entries/index.js +1 -1
  58. package/system/dist/builtins/record-entries/index.mjs +1 -1
  59. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts +4 -10
  60. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -9
  61. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -9
  62. package/system/dist/builtins/snapshot/index.js +1 -1
  63. package/system/dist/builtins/snapshot/index.mjs +1 -1
  64. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  65. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  66. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  67. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  68. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  69. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  70. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  71. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  72. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  73. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  74. package/system/dist/builtins/winston-logging/index.js +1 -1
  75. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  76. package/system/dist/{capture-engine-BHj1fNYC.js → capture-engine-BVpkq9Mv.js} +1 -1
  77. package/system/dist/{capture-engine-D9n4KDaN.mjs → capture-engine-D-oUDtX5.mjs} +1 -1
  78. package/system/dist/{composition-sources-wI4qWTz2.mjs → composition-sources-Br7JhpbD.mjs} +1 -1
  79. package/system/dist/{composition-sources-BGgIuuvd.js → composition-sources-DKCbVA67.js} +1 -1
  80. package/system/dist/{constants-DHqkxbYk.mjs → constants-Bl0Qxbek.mjs} +1 -1
  81. package/system/dist/{constants-DNdriMRD.js → constants-CJVY-mUq.js} +1 -1
  82. package/system/dist/{device-ca-gr5eE3h5.mjs → device-ca-BeDGy8NK.mjs} +1 -1
  83. package/system/dist/{device-ca-C2RzT1VT.js → device-ca-i8EbKp3q.js} +1 -1
  84. package/system/dist/{dist-BUoL5bbr.mjs → dist-CPUbgRkb.mjs} +280 -8
  85. package/system/dist/{dist-DV0V3JiE.js → dist-Ddkk4Dqq.js} +280 -8
  86. package/system/dist/file-host-worker.js +1 -1
  87. package/system/dist/file-host-worker.mjs +1 -1
  88. package/system/dist/{hub-mdns-ciao-DoSb8dwB.mjs → hub-mdns-ciao-DgF4SifE.mjs} +2 -2
  89. package/system/dist/{hub-mdns-ciao-Be5PGXW6.js → hub-mdns-ciao-lHRHbXqV.js} +2 -2
  90. package/system/dist/index.js +8 -8
  91. package/system/dist/index.mjs +8 -8
  92. package/system/dist/kernel/transport/child-cap-protocol.d.ts +1 -1
  93. package/system/dist/{legacy-integration-rows-door-DRC0xn6k.mjs → legacy-integration-rows-door-9JSt493H.mjs} +1 -1
  94. package/system/dist/{legacy-integration-rows-door-D5s8oM7e.js → legacy-integration-rows-door-n9GIUxgq.js} +1 -1
  95. package/system/dist/{restore-archive-Dh4gfCRY.js → restore-archive-BDvLSZtj.js} +1 -1
  96. package/system/dist/{restore-archive-DH3P9j-V.mjs → restore-archive-DWS1l6ac.mjs} +82 -82
  97. package/system/dist/{wal-maintenance-BWfH3Lov.mjs → wal-maintenance-BQJAmAwS.mjs} +0 -0
  98. package/system/dist/{wal-maintenance-DgN_WD5T.js → wal-maintenance-CWlz_qRq.js} +0 -0
  99. package/system/package.json +1 -1
  100. package/system/dist/builtins/loki-logging/retire-enabled-flag.d.ts +0 -33
@@ -1188,7 +1188,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1188
1188
  return DeviceRole;
1189
1189
  }({});
1190
1190
  //#endregion
1191
- //#region ../types/dist/sleep-AEnTN3b4.mjs
1191
+ //#region ../types/dist/sleep-CQP-REJp.mjs
1192
1192
  /**
1193
1193
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1194
1194
  * window to float samples (D455).
@@ -1600,6 +1600,59 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries([
1600
1600
  function isValuelessField(field) {
1601
1601
  return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
1602
1602
  }
1603
+ /**
1604
+ * Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
1605
+ * `key → { value, default }`, recursing through `group` and `sub-tabs`
1606
+ * layout fields. Keeping `value` and `default` SEPARATE (rather than
1607
+ * pre-resolving) lets callers both read the effective value AND detect
1608
+ * overrides (`value` differs from `default`). Structural over `unknown`;
1609
+ * malformed input yields an empty map, never throws.
1610
+ */
1611
+ function collectHydratedFieldEntries(schema) {
1612
+ const out = /* @__PURE__ */ new Map();
1613
+ if (typeof schema !== "object" || schema === null) return out;
1614
+ const sections = schema.sections;
1615
+ if (!Array.isArray(sections)) return out;
1616
+ for (const section of sections) if (typeof section === "object" && section !== null) collectFieldEntriesInto(section.fields, out);
1617
+ return out;
1618
+ }
1619
+ /** Recursive field walker for {@link collectHydratedFieldEntries}. */
1620
+ function collectFieldEntriesInto(fields, into) {
1621
+ if (!Array.isArray(fields)) return;
1622
+ for (const field of fields) {
1623
+ if (typeof field !== "object" || field === null) continue;
1624
+ const type = field.type;
1625
+ if (type === "group") {
1626
+ collectFieldEntriesInto(field.fields, into);
1627
+ continue;
1628
+ }
1629
+ if (type === "sub-tabs") {
1630
+ const tabs = field.tabs;
1631
+ if (Array.isArray(tabs)) {
1632
+ for (const tab of tabs) if (typeof tab === "object" && tab !== null) collectFieldEntriesInto(tab.fields, into);
1633
+ }
1634
+ continue;
1635
+ }
1636
+ const key = field.key;
1637
+ if (typeof key !== "string" || key.length === 0) continue;
1638
+ if (!("value" in field)) continue;
1639
+ into.set(key, {
1640
+ value: field.value,
1641
+ default: field.default
1642
+ });
1643
+ }
1644
+ }
1645
+ /**
1646
+ * Flatten a hydrated settings payload into `key → EFFECTIVE value`
1647
+ * (`value ?? default`). The read-side inverse of `hydrateSchema` for the
1648
+ * common "just give me the resolved values" case. Built on
1649
+ * {@link collectHydratedFieldEntries}.
1650
+ */
1651
+ function collectHydratedFieldValues(schema) {
1652
+ const out = /* @__PURE__ */ new Map();
1653
+ for (const [key, entry] of collectHydratedFieldEntries(schema)) out.set(key, entry.value ?? entry.default);
1654
+ return out;
1655
+ }
1603
1656
  function hydrateSchema(schema, values, options = {}) {
1604
1657
  return {
1605
1658
  ...schema.tabs ? { tabs: [...schema.tabs] } : {},
@@ -2953,6 +3006,21 @@ function nodeIdOfScopedKey(key) {
2953
3006
  const nodeId = key.slice(at + 1);
2954
3007
  return nodeId === "" ? null : nodeId;
2955
3008
  }
3009
+ /** The one refusal of a key a scope did not declare. */
3010
+ function assertDeclaredKeys(keys, declared) {
3011
+ const undeclared = keys.filter((key) => !declared.has(key));
3012
+ if (undeclared.length > 0) throw new Error(`scoped settings: [${undeclared.join(", ")}] not declared for this scope (declared: [${[...declared].join(", ")}])`);
3013
+ }
3014
+ /** Build the handle over an addon's scoped read, write and unset. */
3015
+ function createScopedSettings(deps) {
3016
+ return {
3017
+ async get() {
3018
+ return deps.schema.parse(await deps.read());
3019
+ },
3020
+ patch: (patch) => deps.write(Object.fromEntries(Object.entries(patch))),
3021
+ unset: (keys) => deps.unset(keys)
3022
+ };
3023
+ }
2956
3024
  /** A write to a secret path could not be stored in the keychain, so it was refused. */
2957
3025
  var KeychainWriteRefusedError = class extends Error {
2958
3026
  fieldPath;
@@ -3528,7 +3596,16 @@ function createHandle(raw, opts) {
3528
3596
  return blob;
3529
3597
  }
3530
3598
  },
3531
- writeAddonStore: writeAddon
3599
+ writeAddonStore: writeAddon,
3600
+ removeClearedKeys: (keys) => serialize("addon", async () => {
3601
+ const stored = await readStoredAddonBlob(raw);
3602
+ index.seen("addon", stored);
3603
+ const removable = keys.filter((key) => collectSecretMarkerRefs(stored[key]).length === 0);
3604
+ if (removable.length === 0) return;
3605
+ const patch = Object.fromEntries(removable.map((key) => [key, void 0]));
3606
+ await raw.writeAddonStore(patch);
3607
+ index.wrote("addon", patch);
3608
+ })
3532
3609
  };
3533
3610
  }
3534
3611
  /** The context the addon sees, plus the private raw view and write outcome. */
@@ -4086,6 +4163,151 @@ var BaseAddon = class {
4086
4163
  }
4087
4164
  }
4088
4165
  /**
4166
+ * Hook: values layered over the stored ones when the FORM of one scope is served
4167
+ * ({@link getScopedSettings}) — a preview that derives dependent options without writing.
4168
+ * Never applied to {@link ScopedSettings.get} or to a write. `null` ⇒ no overlay.
4169
+ */
4170
+ async scopedSettingsOverlay(_scope, _cap, _nodeId) {
4171
+ return null;
4172
+ }
4173
+ /**
4174
+ * Hook: a write of one scope changed stored values (not called when the store reports no change,
4175
+ * e.g. the write-back of a stored secret). `keys` are the bare field keys of the write, node keys included.
4176
+ */
4177
+ async onScopedSettingsChanged(_scope, _cap, _keys) {}
4178
+ /** Typed handle over the CLUSTER settings `cap` declares (`clusterSettingsSchema`). */
4179
+ clusterSettings(cap, schema) {
4180
+ return this.scopedHandle("cluster", cap, schema);
4181
+ }
4182
+ /** Typed handle over the fleet defaults of the per-device settings `cap` declares. */
4183
+ deviceDefaults(cap, schema) {
4184
+ return this.scopedHandle("device-defaults", cap, schema);
4185
+ }
4186
+ /**
4187
+ * Typed handle over the settings `cap` owns PER NODE. `nodeId` omitted ⇒ the local node. A node
4188
+ * with no row yields the schema defaults — never a bare-key fallback.
4189
+ */
4190
+ nodeSettings(cap, schema, nodeId) {
4191
+ return this.scopedHandle("node", cap, schema, nodeId);
4192
+ }
4193
+ /**
4194
+ * {@link state} for a value that is kept per node: stored under `<key>@<nodeId>`, and the
4195
+ * settings store carries `nodeId` in the row data (D986 §1), so a forgotten node's rows go in one
4196
+ * central delete. `nodeId` omitted ⇒ the local node.
4197
+ */
4198
+ nodeState(key, schema, fallback, nodeId) {
4199
+ this._declaredStateKeys.add(key);
4200
+ return createDurableState({
4201
+ key: nodeScopedKey(key, nodeId ?? this._ctx?.kernel?.localNodeId ?? ""),
4202
+ schema,
4203
+ fallback,
4204
+ read: async () => this.resolveStoredSecrets(await this.readAddonStoreWithRetry()),
4205
+ write: async (patch) => {
4206
+ await this._ctx?.settings?.writeAddonStore(patch);
4207
+ },
4208
+ onParseError: (k, e) => this._ctx?.logger?.warn?.(`durable-state: stored "${k}" failed validation — using fallback`, { meta: {
4209
+ addonId: this._ctx?.id,
4210
+ key: k,
4211
+ error: String(e)
4212
+ } })
4213
+ });
4214
+ }
4215
+ /** The loaded schema `cap` declares for `scope`, or `null`. */
4216
+ async declaredScopedSchema(scope, cap) {
4217
+ await this.loadScopedSchemas(cap);
4218
+ return this.loadedScopedSchemas(cap).find((entry) => entry.scope === scope)?.schema ?? null;
4219
+ }
4220
+ async requireScopedSchema(scope, cap) {
4221
+ const schema = await this.declaredScopedSchema(scope, cap);
4222
+ if (schema === null) throw new Error(`${this.constructor.name}: cap "${cap}" declares no ${scope} settings`);
4223
+ return schema;
4224
+ }
4225
+ scopedKeys(schema) {
4226
+ return new Set(schema.sections.flatMap((section) => collectValueFieldKeys(section.fields)));
4227
+ }
4228
+ /** `store` narrowed to the keys `schema` declares. */
4229
+ narrowToScope(store, schema) {
4230
+ const keys = this.scopedKeys(schema);
4231
+ return Object.fromEntries(Object.entries(store).filter(([key]) => keys.has(key)));
4232
+ }
4233
+ scopedHandle(scope, cap, schema, nodeId) {
4234
+ return createScopedSettings({
4235
+ schema,
4236
+ read: async () => {
4237
+ const declared = await this.requireScopedSchema(scope, cap);
4238
+ const stored = this.narrowToScope(await this.resolveGlobalStore(nodeId, cap), declared);
4239
+ const effective = collectHydratedFieldValues(hydrateSchema(declared, stored));
4240
+ return {
4241
+ ...Object.fromEntries([...effective].filter(([, value]) => value !== void 0)),
4242
+ ...stored
4243
+ };
4244
+ },
4245
+ write: (patch) => this.writeScoped(scope, cap, patch, nodeId),
4246
+ unset: (keys) => this.unsetScoped(scope, cap, keys, nodeId)
4247
+ });
4248
+ }
4249
+ /** The one write path of the scoped API: declared keys only, then the global patch. */
4250
+ async writeScoped(scope, cap, patch, nodeId) {
4251
+ assertDeclaredKeys(Object.keys(patch), this.scopedKeys(await this.requireScopedSchema(scope, cap)));
4252
+ if (await this.applyGlobalPatch(patch, scope === "node" ? nodeId : void 0, cap)) await this.onScopedSettingsChanged(scope, cap, Object.keys(patch));
4253
+ }
4254
+ /**
4255
+ * Remove declared keys of one scope. A secret goes through {@link clearSecrets} — its keychain
4256
+ * value is released exactly as there — and the emptied row is then removed; every other key is
4257
+ * removed by an `undefined` patch (which a secret transform would read as "keep").
4258
+ */
4259
+ async unsetScoped(scope, cap, keys, nodeId) {
4260
+ assertDeclaredKeys(keys, this.scopedKeys(await this.requireScopedSchema(scope, cap)));
4261
+ const target = scope === "node" ? nodeId : void 0;
4262
+ const tree = this.addonSecretTree();
4263
+ const secretKeys = keys.filter((key) => tree.has(key));
4264
+ const plainKeys = keys.filter((key) => !tree.has(key));
4265
+ let changed = false;
4266
+ if (plainKeys.length > 0) {
4267
+ const patch = Object.fromEntries(plainKeys.map((key) => [key, void 0]));
4268
+ changed = await this.applyGlobalPatch(patch, target, cap) || changed;
4269
+ }
4270
+ if (secretKeys.length > 0) {
4271
+ await this.clearSecretKeys(secretKeys, target, cap);
4272
+ const node = normalizeNodeId(target ?? this._ctx?.kernel?.localNodeId);
4273
+ const rows = secretKeys.map((key) => scope === "node" ? nodeScopedKey(key, node) : key);
4274
+ if (this._secretSettings !== null) await this._secretSettings.removeClearedKeys(rows);
4275
+ else await this._ctx?.settings?.writeAddonStore(Object.fromEntries(rows.map((row) => [row, void 0])));
4276
+ changed = true;
4277
+ }
4278
+ if (changed) await this.onScopedSettingsChanged(scope, cap, [...keys]);
4279
+ }
4280
+ /**
4281
+ * The hydrated form of one scope of one capability's settings (any
4282
+ * {@link scopedSettingsOverlay} applied), or `null` when the capability declares nothing there.
4283
+ */
4284
+ async getScopedSettings(scope, cap, nodeId) {
4285
+ const schema = await this.declaredScopedSchema(scope, cap);
4286
+ if (schema === null) return null;
4287
+ const stored = this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema);
4288
+ const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
4289
+ return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
4290
+ }
4291
+ /** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
4292
+ async updateScopedSettings(scope, cap, patch, nodeId) {
4293
+ this._operatorWriteDepth++;
4294
+ try {
4295
+ await this.writeScoped(scope, cap, patch, nodeId);
4296
+ } finally {
4297
+ this._operatorWriteDepth--;
4298
+ }
4299
+ }
4300
+ /**
4301
+ * The effective values (`stored ?? default`) of one scope, a secret as its `set` view — never
4302
+ * its value. `null` when the capability declares nothing for the scope.
4303
+ */
4304
+ async readScopedValues(scope, cap, nodeId) {
4305
+ const schema = await this.declaredScopedSchema(scope, cap);
4306
+ if (schema === null) return null;
4307
+ const form = hydrateSchema(schema, this.narrowToScope(await this.readRawProjectedStore(nodeId, cap), schema), { inlineSecretsAsViews: true });
4308
+ return Object.fromEntries([...collectHydratedFieldValues(form)].filter(([, value]) => value !== void 0));
4309
+ }
4310
+ /**
4089
4311
  * What the create wizard and the integration edit page render for one instance: the addon's
4090
4312
  * per-instance schema when it declares one, else its global schema (what they always showed).
4091
4313
  */
@@ -4237,6 +4459,9 @@ var BaseAddon = class {
4237
4459
  * a keychain (an older kernel) it writes `''`, as such code always did.
4238
4460
  */
4239
4461
  async clearSecrets(keys, nodeId) {
4462
+ await this.clearSecretKeys(keys, nodeId);
4463
+ }
4464
+ async clearSecretKeys(keys, nodeId, cap) {
4240
4465
  const tree = this.addonSecretTree();
4241
4466
  const keychain = this._ctx?.secrets !== void 0;
4242
4467
  const stored = keychain ? await this.readAddonStoreWithRetry() : {};
@@ -4249,25 +4474,27 @@ var BaseAddon = class {
4249
4474
  const keychainStored = tree.has(key) || collectSecretMarkerRefs(stored[key]).length > 0;
4250
4475
  patch[key] = keychain && keychainStored ? SECRET_CLEAR : "";
4251
4476
  }
4252
- await this.applyGlobalPatch(patch, nodeId);
4477
+ await this.applyGlobalPatch(patch, nodeId, cap);
4253
4478
  }
4254
- async applyGlobalPatch(barePatch, nodeId) {
4255
- await this.loadScopedSchemas();
4256
- const keys = this.perNodeKeys();
4479
+ /** Resolves `true` when the write changed stored values. */
4480
+ async applyGlobalPatch(barePatch, nodeId, cap) {
4481
+ await this.loadScopedSchemas(cap);
4482
+ const keys = this.perNodeKeys(cap);
4257
4483
  const localNode = normalizeNodeId(this._ctx?.kernel?.localNodeId);
4258
4484
  const target = normalizeNodeId(nodeId ?? this._ctx?.kernel?.localNodeId);
4259
4485
  const scoped = keys.size > 0 ? scopePatch(barePatch, keys, target) : barePatch;
4260
4486
  const handle = this._secretSettings;
4261
4487
  if (handle !== null) {
4262
4488
  const { changed } = await handle.writeAddonStore(scoped);
4263
- if (!changed) return;
4489
+ if (!changed) return false;
4264
4490
  } else await this._ctx?.settings?.writeAddonStore(scoped);
4265
- if (target !== localNode) return;
4491
+ if (target !== localNode) return true;
4266
4492
  await this.resolveConfig();
4267
4493
  await this.onConfigChanged();
4268
4494
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
4269
4495
  const legacy = this.globalSettingsSchema();
4270
4496
  this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
4497
+ return true;
4271
4498
  }
4272
4499
  /**
4273
4500
  * The set of field keys the global settings schema declares `perNode: true`
@@ -45475,6 +45702,8 @@ var SettingsSchemaWithValuesSchema = zod.z.object({
45475
45702
  });
45476
45703
  /** Patch object — keys are field names, values are the new field values. */
45477
45704
  var SettingsPatchSchema = zod.z.record(zod.z.string(), zod.z.unknown());
45705
+ /** The scope of a scoped-settings call (D986): where the capability declared the values. */
45706
+ var ScopedSettingsScopeSchema = zod.z.enum(SCOPED_SETTINGS_SCOPES);
45478
45707
  /** Standard success response for update operations. */
45479
45708
  var SettingsUpdateResultSchema = zod.z.object({ success: zod.z.literal(true) });
45480
45709
  /**
@@ -45523,6 +45752,28 @@ var addonSettingsCapability = {
45523
45752
  kind: "mutation",
45524
45753
  auth: "admin"
45525
45754
  }),
45755
+ getScopedSettings: method(zod.z.object({
45756
+ addonId: zod.z.string(),
45757
+ cap: zod.z.string(),
45758
+ scope: ScopedSettingsScopeSchema,
45759
+ nodeId: zod.z.string().optional()
45760
+ }), SettingsSchemaWithValuesSchema.nullable()),
45761
+ updateScopedSettings: method(zod.z.object({
45762
+ addonId: zod.z.string(),
45763
+ cap: zod.z.string(),
45764
+ scope: ScopedSettingsScopeSchema,
45765
+ nodeId: zod.z.string().optional(),
45766
+ patch: SettingsPatchSchema
45767
+ }), SettingsUpdateResultSchema, {
45768
+ kind: "mutation",
45769
+ auth: "admin"
45770
+ }),
45771
+ readScopedValues: method(zod.z.object({
45772
+ addonId: zod.z.string(),
45773
+ cap: zod.z.string(),
45774
+ scope: ScopedSettingsScopeSchema,
45775
+ nodeId: zod.z.string().optional()
45776
+ }), zod.z.record(zod.z.string(), zod.z.unknown()).nullable()),
45526
45777
  getIntegrationSettings: method(zod.z.object({
45527
45778
  addonId: zod.z.string(),
45528
45779
  nodeId: zod.z.string().optional()
@@ -96167,6 +96418,20 @@ var METHOD_ACCESS_MAP = Object.freeze({
96167
96418
  access: "view",
96168
96419
  role: "admin"
96169
96420
  },
96421
+ "addonSettings.getScopedSettings": {
96422
+ capName: "addon-settings",
96423
+ capScope: "system",
96424
+ addonId: null,
96425
+ access: "view",
96426
+ role: "admin"
96427
+ },
96428
+ "addonSettings.readScopedValues": {
96429
+ capName: "addon-settings",
96430
+ capScope: "system",
96431
+ addonId: null,
96432
+ access: "view",
96433
+ role: "admin"
96434
+ },
96170
96435
  "addonSettings.unsetStoredSettingsKeys": {
96171
96436
  capName: "addon-settings",
96172
96437
  capScope: "system",
@@ -96188,6 +96453,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
96188
96453
  access: "create",
96189
96454
  role: "admin"
96190
96455
  },
96456
+ "addonSettings.updateScopedSettings": {
96457
+ capName: "addon-settings",
96458
+ capScope: "system",
96459
+ addonId: null,
96460
+ access: "create",
96461
+ role: "admin"
96462
+ },
96191
96463
  "addonWidgets.listWidgets": {
96192
96464
  capName: "addon-widgets",
96193
96465
  capScope: "system",
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-DgN_WD5T.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-CWlz_qRq.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-BWfH3Lov.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-BQJAmAwS.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Cc as userError } from "./dist-BUoL5bbr.mjs";
2
+ import { Cc as userError } from "./dist-CPUbgRkb.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-ByceQLwr.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-BmVaVskH.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-DV0V3JiE.js");
2
+ const require_dist = require("./dist-Ddkk4Dqq.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-BmXXKQAA.js");
4
+ const require_agent_https = require("./agent-https-DOs15BCJ.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs = require("node:fs");
@@ -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-DV0V3JiE.js");
4
- const require_device_ca = require("./device-ca-C2RzT1VT.js");
3
+ const require_dist = require("./dist-Ddkk4Dqq.js");
4
+ const require_device_ca = require("./device-ca-i8EbKp3q.js");
5
5
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
6
6
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
7
7
  require("./builtins/alerts/index.js");
@@ -26,22 +26,22 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
26
26
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
27
27
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
28
28
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
29
- const require_wal_maintenance = require("./wal-maintenance-DgN_WD5T.js");
30
- const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-D5s8oM7e.js");
29
+ const require_wal_maintenance = require("./wal-maintenance-CWlz_qRq.js");
30
+ const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-n9GIUxgq.js");
31
31
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
32
32
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
33
33
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
34
34
  require("./builtins/storage-orchestrator/index.js");
35
- const require_agent_https = require("./agent-https-BmXXKQAA.js");
36
- const require_constants = require("./constants-DNdriMRD.js");
35
+ const require_agent_https = require("./agent-https-DOs15BCJ.js");
36
+ const require_constants = require("./constants-CJVY-mUq.js");
37
37
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
38
38
  require("./builtins/system-config/index.js");
39
39
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
40
40
  const require_custom_action_registry = require("./custom-action-registry-CmWpSeMS.js");
41
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-Be5PGXW6.js");
41
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-lHRHbXqV.js");
42
42
  const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
43
43
  const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
44
- const require_restore_archive = require("./restore-archive-Dh4gfCRY.js");
44
+ const require_restore_archive = require("./restore-archive-BDvLSZtj.js");
45
45
  const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
46
46
  let zod = require("zod");
47
47
  let node_crypto = require("node:crypto");
@@ -1,6 +1,6 @@
1
1
  import { i as __require } from "./chunk-CNf5ZN-e.mjs";
2
- import { $r as isObjectInput, Ba as supportedRuntimes, Cc as userError, Cs as asString$1, D as CatalogFileSchema, Go as DEVICE_STATUS_METHOD, Gs as isDebugChannelName, Ho as CALLER_STAMPED_CAPABILITIES$1, Is as defineRecordKinds, Jr as isCollectionArrayMethod, Ls as emitDownForOwnedCaps, Ma as splitTranslationRef, Ni as objectInputDeclaresAddonId, Nt as PackageRequiresSchema, Oc as errMsg$1, Pi as objectInputDeclaresRequiredDeviceId, Sa as scopesAllowDeviceCap, Ss as asNumber, St as METHOD_ACCESS_MAP, Tn as bareAddonId, Un as compareVersions, Uo as DATAPLANE_SECRET_HEADER$1, Ur as interpolate, Vs as getDebugInterest, Wo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Yi as procedureAuthKey, a as AGENT_MDNS_SERVICE_TYPE, b as CATALOG_LANGS, bt as LOG_LEVEL_RANK, cc as parseJsonObject, cs as ReadinessTimeoutError, dc as readinessKey, fa as resolveMethodAuth, fr as describeUnmet, gn as addonSettingsCapability, hc as scopeKey, hi as looseSchema, js as createEvent$1, kc as EventCategory$1, kr as extractNestedAddonId, ks as collectSecretMarkerRefs, lc as parseJsonUnknown, mi as logLevelAtMost, ni as kebabToCamel$1, o as AGENT_MDNS_TXT_KEYS, os as RUNTIME_DEFAULTS, pc as resolveCapMount, qa as unmetRequirements, qr as isArrayOutputSchema, s as ALL_CAPABILITY_DEFINITIONS, si as lifecycleJobSchema, ss as ReadinessRegistry, ti as isVoidInput, wc as withoutCallerStamp, xa as scopesAllowAddon, xs as asJsonObject$1, zs as expandCapMethods } from "./dist-BUoL5bbr.mjs";
3
- import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-gr5eE3h5.mjs";
2
+ import { $r as isObjectInput, Ba as supportedRuntimes, Cc as userError, Cs as asString$1, D as CatalogFileSchema, Go as DEVICE_STATUS_METHOD, Gs as isDebugChannelName, Ho as CALLER_STAMPED_CAPABILITIES$1, Is as defineRecordKinds, Jr as isCollectionArrayMethod, Ls as emitDownForOwnedCaps, Ma as splitTranslationRef, Ni as objectInputDeclaresAddonId, Nt as PackageRequiresSchema, Oc as errMsg$1, Pi as objectInputDeclaresRequiredDeviceId, Sa as scopesAllowDeviceCap, Ss as asNumber, St as METHOD_ACCESS_MAP, Tn as bareAddonId, Un as compareVersions, Uo as DATAPLANE_SECRET_HEADER$1, Ur as interpolate, Vs as getDebugInterest, Wo as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Yi as procedureAuthKey, a as AGENT_MDNS_SERVICE_TYPE, b as CATALOG_LANGS, bt as LOG_LEVEL_RANK, cc as parseJsonObject, cs as ReadinessTimeoutError, dc as readinessKey, fa as resolveMethodAuth, fr as describeUnmet, gn as addonSettingsCapability, hc as scopeKey, hi as looseSchema, js as createEvent$1, kc as EventCategory$1, kr as extractNestedAddonId, ks as collectSecretMarkerRefs, lc as parseJsonUnknown, mi as logLevelAtMost, ni as kebabToCamel$1, o as AGENT_MDNS_TXT_KEYS, os as RUNTIME_DEFAULTS, pc as resolveCapMount, qa as unmetRequirements, qr as isArrayOutputSchema, s as ALL_CAPABILITY_DEFINITIONS, si as lifecycleJobSchema, ss as ReadinessRegistry, ti as isVoidInput, wc as withoutCallerStamp, xa as scopesAllowAddon, xs as asJsonObject$1, zs as expandCapMethods } from "./dist-CPUbgRkb.mjs";
3
+ import { d as JWT_SIGNING_KEY_REF, f as JwtSigningKeyUnavailableError, g as processJwtSigningKey, i as generateDeviceCa, l as verifyDeviceLeaf, m as getProcessJwtSigningKeyState, n as DEVICE_CA_KEY_REF, o as issueDeviceLeaf, p as SYSTEM_SECRET_OWNER, s as loadDeviceCa, u as verifyDeviceSignature, v as staticJwtSigningKey } from "./device-ca-BeDGy8NK.mjs";
4
4
  import { t as require_read_all_rows } from "./read-all-rows-TaPqdWNF.mjs";
5
5
  import { AlertCenterAddon, a as redactLogEntry, i as isCredentialKeyName, n as lastCauseAfterChunk, o as redactLogMeta, r as readRunnerDisplayName, s as redactLogText, t as CRASH_BREAKER_ERROR_PREFIX } from "./builtins/alerts/alerts.addon.mjs";
6
6
  import "./builtins/alerts/index.mjs";
@@ -25,22 +25,22 @@ import { LokiDestination, LokiLoggingAddon } from "./builtins/loki-logging/index
25
25
  import NativeMetricsAddon, { a as NativeMetricsProvider, i as parseProcStatusRss, n as nodeProcReader, r as parseProcStat } from "./builtins/native-metrics/native-metrics.addon.mjs";
26
26
  import { DeviceHistoryAddon } from "./builtins/device-history/device-history.addon.mjs";
27
27
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
28
- import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-BWfH3Lov.mjs";
29
- import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-DRC0xn6k.mjs";
28
+ import { D as RecordsEngine, l as SqliteSettingsBackend } from "./wal-maintenance-BQJAmAwS.mjs";
29
+ import { n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows } from "./legacy-integration-rows-door-9JSt493H.mjs";
30
30
  import { SqliteSettingsAddon } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
31
31
  import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
32
32
  import { StorageOrchestratorAddon, a as createHubCapForwardService, i as HUB_CAP_FWD_SERVICE, o as stripForwardedCaller, r as HUB_CAP_FWD_ACTION, s as buildStorageLocationRegistry, t as StorageOrchestratorService, u as storageOrchestratorRecordKinds } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
33
33
  import "./builtins/storage-orchestrator/index.mjs";
34
- import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-ByceQLwr.mjs";
35
- import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-DHqkxbYk.mjs";
34
+ import { A as buildNameConstraintSet, B as setProcessAgentHttpsNames, C as LEAF_RENEWAL_WINDOW_DAYS, E as evaluateExistingCert, F as readNameConstraints, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, N as permitsIdentity, O as PERMITTED_DNS_SUFFIXES, P as permitsName, R as AgentHttpsNames, S as CA_VALIDITY_DAYS, T as SERVER_AUTH_OID, a as collectAgentNames, b as collectCertIdentity, c as installAgentHttps, d as issueAgentHttpsLeaf, f as loadAgentHttps, h as CA_COMMON_NAME, i as certificateNames, j as isConstrainedCa, k as PERMITTED_IP_RANGES, l as isContainerBridgeAddress, m as pinnedHttpsCaFingerprint, n as acceptAgentSans, o as createAgentHttpsRequest, p as pemDigest, r as agentHttpsPaths, s as describeHttpsLeaf, t as AgentHttpsInstallError, u as isPrivateAddress, w as MAX_LEAF_VALIDITY_DAYS, x as systemHostFacts, y as localCaCommonName, z as getProcessAgentHttpsNames } from "./agent-https-BmVaVskH.mjs";
35
+ import { a as MESH_CA_KEY_REF, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY } from "./constants-Bl0Qxbek.mjs";
36
36
  import { $ as caFingerprintCompact, A as getProcessNodeMeshTransport, B as MESH_NODE_CERTIFICATES_COLLECTION, C as MESH_TLS_PORT_HELLO_FIELD, Ct as readOriginSetting, D as setProcessMeshTlsEnabler, Dt as readCidrSetting, E as ServiceBroker, Et as parseCidrList, F as renewMeshCertificate, G as getProcessMeshCertificateRegistry, H as MeshCertificateRegistry, I as revokeMeshCertificate, J as processMeshCrl, K as setProcessMeshCertificateRegistry, L as getProcessMeshTlsListenerState, M as isProcessVerifiedMeshPeer, N as onProcessNodeRegistered, O as dropProcessPeer, P as setProcessMeshPeerTransportLookup, Q as caFingerprint, R as openMeshTlsWhenRevocationsLoaded, S as verifyMembershipAnswer, St as parseOriginList, SystemConfigAddon, T as Errors, Tt as normalizeIp, U as RENEWAL_ABANDONED, V as MESH_NODE_CERTIFICATES_COLUMNS, W as describeMeshLeaf, X as getProcessMeshCaState, Y as MeshCaKeeper, Z as requireProcessMeshCa, _ as signPairingProof, _t as verifyAgentUiUnlockTicket, a as hubHostFromMeshAddress, at as issueMeshLeafForNode, b as MembershipResponder, bt as isInsecureOrigin, c as PAIRING_MAX_SESSIONS, ct as AGENT_DASHBOARD_ORIGINS_FIELD, d as PAIRING_PROTOCOL, dt as AGENT_UI_UNLOCK_USE, et as createMeshCsrPem, f as PAIRING_TTL_MS, ft as AGENT_UI_UNLOCK_VERSION, g as keyFingerprintShort, gt as parseAgentDashboardOrigins, h as describeCsr, ht as mintAgentUiUnlockTicket, i as AgentPairing, it as isValidAgentNodeId, j as getProcessPeerLeaf, k as emitProcessNodeRegistered, l as PAIRING_PATHS, lt as AGENT_UI_UNLOCK_TTL_MS, m as computePairingSas, mt as isAllowedAgentDashboardReturnTo, n as HubPairing, nt as generateMeshCa, o as PAIRING_CODE_DIGITS, ot as issueMeshLeafFromCsr, p as computePairingCommitment, pt as UnlockTicketJtiStore, q as MeshCrl, r as PairingHttpError, rt as generateMeshKeyPair, s as PAIRING_MAX_CODE_ATTEMPTS, st as loadMeshCa, tt as exportMeshPrivateKeyPem, u as PAIRING_PIN_DIGITS, ut as AGENT_UI_UNLOCK_TYP, v as verifyPairingProof, vt as InvalidCorsOriginError, w as TlsTcpTransporter, wt as createCidrMatcher, x as signMembershipProof, xt as normalizeOrigin, y as MEMBERSHIP_PATHS, yt as OPAQUE_ORIGIN, z as setProcessMeshTlsListenerState } from "./builtins/system-config/system-config.addon.mjs";
37
37
  import "./builtins/system-config/index.mjs";
38
38
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
39
39
  import { C as isModelDownloaded, E as setHuggingFaceReachabilityObserver, T as revisionWeightUrl, _ as downloadFile, a as startEventLoopStallMonitor, b as fetchJson, c as createAuthenticatedFileServer, d as resolveFilePath, f as ModelDownloadService, g as deleteModelFromDisk, h as collectModelFiles, i as attributeStall, l as parseRangeHeader, m as adoptModelRevisions, n as STALL_REPORT_MS, o as createFileDataPlaneHandler, r as STALL_TICK_MS, s as contentTypeFor, t as CustomActionRegistry, u as parseTokenizedUrl, v as downloadModel, w as resolveFormatRevision, x as getModelFilePath, y as ensureModel } from "./custom-action-registry-B9zFBNVa.mjs";
40
- import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-DoSb8dwB.mjs";
40
+ import { A as retirePreviousLocalCa, C as checkUploadedCa, D as loadTlsCert, E as ensureTlsCert, F as closeLanHttp, I as readLanHttpState, L as registerLanHttpHandler, M as allFamiliesListenHost, N as applyLanHttp, O as reissueTlsLeaf, P as bindPendingLanHttp, S as chainsToPublicRoot, T as caReplacementMarkerFile, _ as readTlsMode, a as storeUploadedCertificate, b as writeTlsEnabled, c as leafFingerprintOf, d as servedHttpsLeafFingerprint, f as prepareBootTls, g as readTlsEnabled, h as readTlsAccessStatus, i as revertToGeneratedCertificate, j as DEFAULT_LAN_HTTP_PORT, k as replaceUnconstrainedLocalCa, l as registerHttpsListener, m as readExtraSans, n as applyCertificateToListener, o as useStoredUploadedCertificate, p as UPLOADED_CA_FILE, r as regenerateCertificate, s as clearHttpsListener, t as createCiaoPublisher, u as reloadHttpsListener, v as splitPemCertificates, w as validateUploadedTls, x as writeTlsMode, y as writeExtraSans } from "./hub-mdns-ciao-DgF4SifE.mjs";
41
41
  import { n as getPlatformKeychainKey, r as setPlatformKeychainKey, t as clearPlatformKeychainKey } from "./platform-key-source-BWlq0jjn.mjs";
42
42
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-Di9daRwI.mjs";
43
- import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-DH3P9j-V.mjs";
43
+ import { _ as backupRecordStoresOf, c as BackupDecryptError, f as generateBackupKeyPair, g as backupOrchestratorRecordKinds, h as readBackupEncryptionHeader, l as BackupKeyFormatError, r as prepareRestoreArchive, s as SystemBackupService, t as BackupKeyRequiredError, u as BackupKeyMismatchError } from "./restore-archive-DWS1l6ac.mjs";
44
44
  import { r as nodeCoralFs, t as classifyCoralAccelerator } from "./coral-accelerators-DBlgWB8k.mjs";
45
45
  import { z } from "zod";
46
46
  import * as crypto$1 from "node:crypto";
@@ -239,7 +239,7 @@ export interface ReadinessSnapshotResponse {
239
239
  */
240
240
  export type AddonCallTarget = "routes" | "custom" | "settings" | "data-planes";
241
241
  /** The addon-settings methods reachable over the addon-call plane. */
242
- export type AddonSettingsMethod = "getGlobalSettings" | "updateGlobalSettings" | "getIntegrationSettings" | "getIntegrationFormSchema" | "getDeviceSettings" | "updateDeviceSettings" | "getDeclaredSettingsKeys" | "unsetStoredSettingsKeys";
242
+ export type AddonSettingsMethod = "getGlobalSettings" | "updateGlobalSettings" | "getScopedSettings" | "updateScopedSettings" | "readScopedValues" | "getIntegrationSettings" | "getIntegrationFormSchema" | "getDeviceSettings" | "updateDeviceSettings" | "getDeclaredSettingsKeys" | "unsetStoredSettingsKeys";
243
243
  /**
244
244
  * Parent → child: invoke an ADDON-LEVEL method on a loaded addon (not a cap).
245
245
  * Carried as a correlated request frame (`channel.request`) — it returns a
@@ -1,4 +1,4 @@
1
- import { ks as collectSecretMarkerRefs } from "./dist-BUoL5bbr.mjs";
1
+ import { ks as collectSecretMarkerRefs } from "./dist-CPUbgRkb.mjs";
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-DV0V3JiE.js");
1
+ const require_dist = require("./dist-Ddkk4Dqq.js");
2
2
  //#region src/builtins/sqlite-storage/migrations/legacy-integration-rows-door.ts
3
3
  /**
4
4
  * Migration-only door for the leftover integration rows (planning#416).
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-DV0V3JiE.js");
2
+ const require_dist = require("./dist-Ddkk4Dqq.js");
3
3
  let zod = require("zod");
4
4
  let node_crypto = require("node:crypto");
5
5
  let buffer = require("buffer");