@camstack/server 1.2.737 → 1.2.739

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 (86) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/core/cap-providers.js +14 -16
  3. package/dist/api/trpc/generated-cap-routers.js +10 -6
  4. package/package.json +13 -7
  5. package/system/dist/{agent-https-Bi3JY1e0.js → agent-https-DX_ypzVA.js} +1 -1
  6. package/system/dist/{agent-https-DiK6iQzW.mjs → agent-https-Dwec4v5Z.mjs} +1 -1
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  12. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  13. package/system/dist/builtins/autotrack/index.js +1 -1
  14. package/system/dist/builtins/autotrack/index.mjs +1 -1
  15. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  16. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  17. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  18. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  19. package/system/dist/builtins/camera-grid/index.js +1 -1
  20. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  21. package/system/dist/builtins/composer/composer.addon.js +3 -3
  22. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  23. package/system/dist/builtins/console-logging/index.js +1 -1
  24. package/system/dist/builtins/console-logging/index.mjs +1 -1
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  26. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  27. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  28. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  29. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  30. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  31. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/system/dist/builtins/keychain/index.js +3 -3
  34. package/system/dist/builtins/keychain/index.mjs +3 -3
  35. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  38. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  39. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  40. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  41. package/system/dist/builtins/loki-logging/index.js +1 -1
  42. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  45. package/system/dist/builtins/platform-probe/index.js +1 -1
  46. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  47. package/system/dist/builtins/record-entries/index.js +1 -1
  48. package/system/dist/builtins/record-entries/index.mjs +1 -1
  49. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  50. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  51. package/system/dist/builtins/snapshot/index.js +1 -1
  52. package/system/dist/builtins/snapshot/index.mjs +1 -1
  53. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  54. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  55. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  56. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  57. package/system/dist/builtins/sqlite-storage/migrations/migration-engine.d.ts +8 -1
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +5 -4
  59. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +5 -4
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  63. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  64. package/system/dist/builtins/winston-logging/index.js +1 -1
  65. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  66. package/system/dist/{composition-sources-lnsR-YuH.mjs → composition-sources-6UWb8sIp.mjs} +1 -1
  67. package/system/dist/{composition-sources-DQLGJMMh.js → composition-sources-jF-eMoO5.js} +1 -1
  68. package/system/dist/{constants-DA5jgmYT.js → constants-dJ_YPC9D.js} +1 -1
  69. package/system/dist/{constants-D7I0cM20.mjs → constants-v7B-_yzi.mjs} +1 -1
  70. package/system/dist/{device-ca-Clr2bCe-.mjs → device-ca-BVaCxlFs.mjs} +1 -1
  71. package/system/dist/{device-ca-GPjZE-Mm.js → device-ca-CImkiiR-.js} +1 -1
  72. package/system/dist/{dist-Xi7ZQ7UI.js → dist-BXWXN1Dl.js} +43 -30
  73. package/system/dist/{dist-Cyj93AvD.mjs → dist-BvHqoBym.mjs} +43 -30
  74. package/system/dist/file-host-worker.js +1 -1
  75. package/system/dist/file-host-worker.mjs +1 -1
  76. package/system/dist/{hub-mdns-ciao-BMgUdxgG.js → hub-mdns-ciao-B7wwnU92.js} +2 -2
  77. package/system/dist/{hub-mdns-ciao-ouzCfqVS.mjs → hub-mdns-ciao-B_ldgRYZ.mjs} +2 -2
  78. package/system/dist/index.js +7 -7
  79. package/system/dist/index.mjs +7 -7
  80. package/system/dist/{restore-archive-C4e9U8RW.mjs → restore-archive-CLfRtdYG.mjs} +1 -1
  81. package/system/dist/{restore-archive-CZozfCX-.js → restore-archive-ne_KESE9.js} +1 -1
  82. package/system/dist/{retention-DCrdPMot.js → retention--waznpBD.js} +1 -1
  83. package/system/dist/{retention-BfC_C1vy.mjs → retention-MD1lPsHB.mjs} +1 -1
  84. package/system/dist/{wal-maintenance-C2GNRuvy.mjs → wal-maintenance-D8DIMgjl.mjs} +0 -0
  85. package/system/dist/{wal-maintenance-PjOoh6-K.js → wal-maintenance-DmhOVavh.js} +0 -0
  86. package/system/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { $s as errMsg, $t as UNATTRIBUTED_BUCKET_KEY, Bi as resolveBucketMs, Nt as ROOT_BUCKET_KEY, Pi as reducePoints, ec as EventCategory, oi as metricsProviderCapability, po as BaseAddon, rs as createEvent, xr as foldSnapshotByFunction } from "../../dist-Cyj93AvD.mjs";
1
+ import { $s as errMsg, $t as UNATTRIBUTED_BUCKET_KEY, Bi as resolveBucketMs, Nt as ROOT_BUCKET_KEY, Pi as reducePoints, ec as EventCategory, oi as metricsProviderCapability, po as BaseAddon, rs as createEvent, xr as foldSnapshotByFunction } from "../../dist-BvHqoBym.mjs";
2
2
  import { access, readFile, readdir } from "node:fs/promises";
3
3
  import { promisify } from "node:util";
4
4
  import * as os$1 from "node:os";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_coral_accelerators = require("../../coral-accelerators-BSVsBVzt.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,5 +1,5 @@
1
1
  import { o as __toESM, r as __exportAll } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $s as errMsg, Ti as platformProbeCapability, bi as parseAcceleratorFactsJson, ec as EventCategory, po as BaseAddon, sr as enumerateInferenceDevices, ta as scoreRuntimes, us as emitReadiness } from "../../dist-Cyj93AvD.mjs";
2
+ import { $s as errMsg, Ti as platformProbeCapability, bi as parseAcceleratorFactsJson, ec as EventCategory, po as BaseAddon, sr as enumerateInferenceDevices, ta as scoreRuntimes, us as emitReadiness } from "../../dist-BvHqoBym.mjs";
3
3
  import { n as detectCoralAccelerator, r as nodeCoralFs } from "../../coral-accelerators-DBlgWB8k.mjs";
4
4
  import * as path$1 from "node:path";
5
5
  import { promisify } from "node:util";
@@ -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-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  let zod = require("zod");
8
8
  let node_crypto = require("node:crypto");
9
9
  //#region src/builtins/record-entries/entries-service.ts
@@ -1,4 +1,4 @@
1
- import { Co as InvalidRecordError, Go as UnknownRecordKindError, Mi as recordEntriesCapability, Us as secretViewsOf, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
1
+ import { Co as InvalidRecordError, Go as UnknownRecordKindError, Mi as recordEntriesCapability, Us as secretViewsOf, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
2
2
  import { z } from "zod";
3
3
  import { randomUUID } from "node:crypto";
4
4
  //#region src/builtins/record-entries/entries-service.ts
@@ -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-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
8
8
  /**
9
9
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -1,4 +1,4 @@
1
- import { ec as EventCategory, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
1
+ import { ec as EventCategory, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
2
2
  //#region src/builtins/remote-access-orchestrator/enabled-providers-reconcile.ts
3
3
  /**
4
4
  * Reconcile the durable `enabledProviders` set against authoritative
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_snapshot_courtesy = require("../../snapshot-courtesy-D_C5-nC0.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { $s as errMsg, As as nodePin, Qs as DeviceType, Xs as DeviceFeature, Zn as deriveBatteryPresence, _a as streamQualityLabel, ec as EventCategory, gn as batteryCapability, h as BatteryStatusSchema, hn as bareAddonId, ii as memoizePinnedFfmpeg, la as snapshotCapability, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
1
+ import { $s as errMsg, As as nodePin, Qs as DeviceType, Xs as DeviceFeature, Zn as deriveBatteryPresence, _a as streamQualityLabel, ec as EventCategory, gn as batteryCapability, h as BatteryStatusSchema, hn as bareAddonId, ii as memoizePinnedFfmpeg, la as snapshotCapability, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
2
2
  import { i as renderCourtesyOverlayJpeg, n as courtesyCacheKey, r as renderCourtesyJpeg } from "../../snapshot-courtesy-CyFs1M3I.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  let node_fs_promises = require("node:fs/promises");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { br as filesystemBrowseCapability, ha as storageProviderCapability, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
1
+ import { br as filesystemBrowseCapability, ha as storageProviderCapability, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { mkdir, readdir, realpath, statfs } from "node:fs/promises";
4
4
  import * as path$1 from "node:path";
@@ -4,7 +4,7 @@ Object.defineProperties(exports, {
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
6
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./filesystem-storage.addon.js");
7
- const require_wal_maintenance = require("../../wal-maintenance-PjOoh6-K.js");
7
+ const require_wal_maintenance = require("../../wal-maintenance-DmhOVavh.js");
8
8
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./sqlite-settings.addon.js");
9
9
  //#region src/builtins/sqlite-storage/config-store.ts
10
10
  var ConfigStore = class {
@@ -1,5 +1,5 @@
1
1
  import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./filesystem-storage.addon.mjs";
2
- import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-C2GNRuvy.mjs";
2
+ import { B as SQLITE_ENGINE_STORM_WALL_SHARE, F as SQLITE_MMAP_FLOOR_BYTES, G as SqliteOpProfiler, H as SQLITE_PROFILE_REPORT_INTERVAL_MS, I as SQLITE_PAGE_CACHE_CEILING_KIB, K as sqliteEngineStorm, L as SQLITE_PAGE_CACHE_FLOOR_KIB, N as SQLITE_JOURNAL_SIZE_LIMIT_BYTES, P as SQLITE_MMAP_CEILING_BYTES, R as sqliteMmapSizeFor, U as SQLITE_PROFILE_TOP_N, V as SQLITE_PROFILE_REPORT_FLOOR_MS, W as SQLITE_SLOW_CALL_MS, a as WalMaintenance, i as WAL_MAINTENANCE_INTERVAL_MS, l as SqliteSettingsBackend, n as WAL_HIGH_WATER_BYTES, r as WAL_IDLE_QUIET_MS, t as WAL_CHECKPOINT_BUSY_TIMEOUT_MS, z as sqlitePageCacheKibFor } from "../../wal-maintenance-D8DIMgjl.mjs";
3
3
  import { SqliteSettingsAddon } from "./sqlite-settings.addon.mjs";
4
4
  //#region src/builtins/sqlite-storage/config-store.ts
5
5
  var ConfigStore = class {
@@ -24,6 +24,13 @@ export interface MigrationEngineOptions {
24
24
  /** Writes the pending-restore marker the launcher promotes at the next start. */
25
25
  readonly scheduleRestore?: (request: PreMigrationRestoreRequest) => Promise<void>;
26
26
  readonly bootId?: string;
27
+ /**
28
+ * The runner (child) id an addon runs in — its group when it declares one. A
29
+ * grouped runner's cap calls are stamped with the RUNNER id (the identity the
30
+ * transport knows), so an owner reaches the engine as its group. Omitted →
31
+ * identity (addonId === runner id), as for an ungrouped addon.
32
+ */
33
+ readonly runnerIdOf?: (addonId: string) => string;
27
34
  }
28
35
  export declare class MigrationEngine {
29
36
  private readonly options;
@@ -79,7 +86,7 @@ export declare class MigrationEngine {
79
86
  /** Every migration the engine knows this boot: the hub's, then each declared owner's. */
80
87
  private allMetas;
81
88
  private addonMetaOf;
82
- /** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
89
+ /** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
83
90
  private assertOwnerCaller;
84
91
  /** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
85
92
  private refusalOfCatalogue;
@@ -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-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_retired_settings_keys = require("../../retired-settings-keys-C8nOOr5H.js");
8
- const require_wal_maintenance = require("../../wal-maintenance-PjOoh6-K.js");
8
+ const require_wal_maintenance = require("../../wal-maintenance-DmhOVavh.js");
9
9
  const require_sqlite_snapshot_protocol = require("../../sqlite-snapshot-protocol-B9OndqZv.js");
10
10
  const require_wal_checkpoint_policy = require("../../wal-checkpoint-policy-d2z2qPqx.js");
11
11
  let zod = require("zod");
@@ -1526,10 +1526,10 @@ var MigrationEngine = class {
1526
1526
  if (found !== void 0) return found;
1527
1527
  }
1528
1528
  }
1529
- /** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
1529
+ /** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
1530
1530
  assertOwnerCaller(owner, caller) {
1531
1531
  if (caller === null || caller.length === 0) throw new MigrationOwnerRefusal("no-caller-identity", `migrations for "${owner}" refused: no caller identity — an owner is bound to the authenticated addon`);
1532
- if (caller !== owner) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
1532
+ if (caller !== owner && (this.options.runnerIdOf?.(owner) ?? owner) !== caller) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
1533
1533
  }
1534
1534
  /** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
1535
1535
  refusalOfCatalogue(owner, metas) {
@@ -2778,6 +2778,7 @@ var SqliteSettingsAddon = class extends require_dist.BaseAddon {
2778
2778
  logger: this.ctx.logger.child("PreMigrationSnapshot")
2779
2779
  }),
2780
2780
  announce: (kind, ids) => this.announceMigrations(kind, ids),
2781
+ runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? ((addonId) => addonId),
2781
2782
  scheduleRestore: (request) => scheduleMigrationRestore(node_path.default.resolve(dir, "..", ".."), request)
2782
2783
  });
2783
2784
  const deps = {
@@ -1,6 +1,6 @@
1
- import { $s as errMsg$1, Ao as RECORD_SWEEP_INTERVAL_MS, Co as InvalidRecordError, Dn as catalogueIssues, Gn as dataStoreProviderCapability, Go as UnknownRecordKindError, Io as RecordKindDeclarationSchema, Kn as databaseSnapshotCapability, M as DATABASE_SNAPSHOT_SUFFIX, Ms as normalizeSecretOwner, N as DATABASE_SNAPSHOT_TIMEOUT_MS, Ni as recordsCapability, No as RUNTIME_DEFAULTS, P as DATA_STORE_DATABASES, Tt as MigrationMetaSchema, Uo as TransactRefusedError, da as storageAdminCapability, ec as EventCategory, hn as bareAddonId, is as customAction, j as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, ja as vectorStoreCapability, os as defineCustomActions, po as BaseAddon, si as migrationsCapability, ts as collectSecretMarkerRefs, wo as NoCallerError, yi as orderMigrations, yo as DeclarationRefusedError } from "../../dist-Cyj93AvD.mjs";
1
+ import { $s as errMsg$1, Ao as RECORD_SWEEP_INTERVAL_MS, Co as InvalidRecordError, Dn as catalogueIssues, Gn as dataStoreProviderCapability, Go as UnknownRecordKindError, Io as RecordKindDeclarationSchema, Kn as databaseSnapshotCapability, M as DATABASE_SNAPSHOT_SUFFIX, Ms as normalizeSecretOwner, N as DATABASE_SNAPSHOT_TIMEOUT_MS, Ni as recordsCapability, No as RUNTIME_DEFAULTS, P as DATA_STORE_DATABASES, Tt as MigrationMetaSchema, Uo as TransactRefusedError, da as storageAdminCapability, ec as EventCategory, hn as bareAddonId, is as customAction, j as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, ja as vectorStoreCapability, os as defineCustomActions, po as BaseAddon, si as migrationsCapability, ts as collectSecretMarkerRefs, wo as NoCallerError, yi as orderMigrations, yo as DeclarationRefusedError } from "../../dist-BvHqoBym.mjs";
2
2
  import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
3
- import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-C2GNRuvy.mjs";
3
+ import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-D8DIMgjl.mjs";
4
4
  import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
5
5
  import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
6
6
  import { createRequire } from "node:module";
@@ -1520,10 +1520,10 @@ var MigrationEngine = class {
1520
1520
  if (found !== void 0) return found;
1521
1521
  }
1522
1522
  }
1523
- /** An addon drives only its own catalogue: the transport-stamped caller must be the owner. */
1523
+ /** An addon drives only its own catalogue: the transport-stamped caller must be the owner, or the runner that hosts it (the keychain's rule, D787). */
1524
1524
  assertOwnerCaller(owner, caller) {
1525
1525
  if (caller === null || caller.length === 0) throw new MigrationOwnerRefusal("no-caller-identity", `migrations for "${owner}" refused: no caller identity — an owner is bound to the authenticated addon`);
1526
- if (caller !== owner) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
1526
+ if (caller !== owner && (this.options.runnerIdOf?.(owner) ?? owner) !== caller) throw new MigrationOwnerRefusal("caller-not-owner", `migrations for "${owner}" refused: caller "${caller}" is not the owner "${owner}"`);
1527
1527
  }
1528
1528
  /** Why an owner's catalogue is refused whole, or `null` when it can be taken. */
1529
1529
  refusalOfCatalogue(owner, metas) {
@@ -2771,6 +2771,7 @@ var SqliteSettingsAddon = class extends BaseAddon {
2771
2771
  logger: this.ctx.logger.child("PreMigrationSnapshot")
2772
2772
  }),
2773
2773
  announce: (kind, ids) => this.announceMigrations(kind, ids),
2774
+ runnerIdOf: this.ctx.kernel?.runnerIdForAddon ?? ((addonId) => addonId),
2774
2775
  scheduleRestore: (request) => scheduleMigrationRestore(path.resolve(dir, "..", ".."), request)
2775
2776
  });
2776
2777
  const deps = {
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { $o as collectSecretConfigKeys, Gr as legacyModeOf, Jt as StorageLocationTypeSchema, Kt as StorageCleanupJobSchema, Ns as parseJsonObject, Pa as withLocationMode, Rr as isLocationEnabled, Vs as secretTreeFromPaths, Wi as resolveLocationMode, Yt as StorageMigrationJobSchema, ci as modeMayWrite, cs as defineRecordKinds, ec as EventCategory, fa as storageCapability, fr as evictionPolicyOfLocation, jo as REDACTED_SECRET, js as normalizeNodeId, na as settingsStoreCapability, ni as mayWriteToLocation, pa as storageMigrationCapability, po as BaseAddon, qs as transformSecretWrite, qt as StorageLocationModeSchema, ti as mayReadLocation, wr as gbToBytes, ws as isSecretMarker, yt as LegacyStorageLocationDefaultSchema, zs as resolveSecretMarkers } from "../../dist-Cyj93AvD.mjs";
1
+ import { $o as collectSecretConfigKeys, Gr as legacyModeOf, Jt as StorageLocationTypeSchema, Kt as StorageCleanupJobSchema, Ns as parseJsonObject, Pa as withLocationMode, Rr as isLocationEnabled, Vs as secretTreeFromPaths, Wi as resolveLocationMode, Yt as StorageMigrationJobSchema, ci as modeMayWrite, cs as defineRecordKinds, ec as EventCategory, fa as storageCapability, fr as evictionPolicyOfLocation, jo as REDACTED_SECRET, js as normalizeNodeId, na as settingsStoreCapability, ni as mayWriteToLocation, pa as storageMigrationCapability, po as BaseAddon, qs as transformSecretWrite, qt as StorageLocationModeSchema, ti as mayReadLocation, wr as gbToBytes, ws as isSecretMarker, yt as LegacyStorageLocationDefaultSchema, zs as resolveSecretMarkers } from "../../dist-BvHqoBym.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,11 +3,11 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_x509_es = require("../../x509.es-WtnRNyYS.js");
9
- const require_agent_https = require("../../agent-https-Bi3JY1e0.js");
10
- const require_constants$8 = require("../../constants-DA5jgmYT.js");
9
+ const require_agent_https = require("../../agent-https-DX_ypzVA.js");
10
+ const require_constants$8 = require("../../constants-dJ_YPC9D.js");
11
11
  const require_src$1 = require("../../src-CnAqG6EF.js");
12
12
  let zod = require("zod");
13
13
  let node_crypto = require("node:crypto");
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $s as errMsg, Wt as ServerNameSchema, gs as hydrateSchema, is as customAction, oa as shortHostname, os as defineCustomActions, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
2
+ import { $s as errMsg, Wt as ServerNameSchema, gs as hydrateSchema, is as customAction, oa as shortHostname, os as defineCustomActions, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
5
- import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-DiK6iQzW.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-D7I0cM20.mjs";
5
+ import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-Dwec4v5Z.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-v7B-_yzi.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-Xi7ZQ7UI.js");
6
+ const require_dist = require("../../dist-BXWXN1Dl.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Qr as logDestinationCapability, po as BaseAddon } from "../../dist-Cyj93AvD.mjs";
1
+ import { Qr as logDestinationCapability, po as BaseAddon } from "../../dist-BvHqoBym.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- import { $s as errMsg, Xa as compositionSourceKey } from "./dist-Cyj93AvD.mjs";
1
+ import { $s as errMsg, Xa as compositionSourceKey } from "./dist-BvHqoBym.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Xi7ZQ7UI.js");
1
+ const require_dist = require("./dist-BXWXN1Dl.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-Xi7ZQ7UI.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-BXWXN1Dl.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { Qo as buildSecretRef } from "./dist-Cyj93AvD.mjs";
1
+ import { Qo as buildSecretRef } from "./dist-BvHqoBym.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,4 +1,4 @@
1
- import { H as DEVICE_SAN_CREDENTIAL_PREFIX, Qo as buildSecretRef, U as DEVICE_SAN_USER_PREFIX } from "./dist-Cyj93AvD.mjs";
1
+ import { H as DEVICE_SAN_CREDENTIAL_PREFIX, Qo as buildSecretRef, U as DEVICE_SAN_USER_PREFIX } from "./dist-BvHqoBym.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Xi7ZQ7UI.js");
1
+ const require_dist = require("./dist-BXWXN1Dl.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -61595,15 +61595,9 @@ var AvailableIntegrationTypeSchema = zod.z.object({
61595
61595
  * branch on CAP — never on addon name. `device-adoption` integrations
61596
61596
  * (Home Assistant, …) route through the broker step (Approach A);
61597
61597
  * `device-provider` integrations (Reolink/ONVIF) keep the
61598
- * legacy config → discovery flow. `connection` is an addon that only holds a
61599
- * connection as typed records (`integration-instances`, D985): no devices,
61600
- * no discovery.
61598
+ * legacy config → discovery flow.
61601
61599
  */
61602
- kind: zod.z.enum([
61603
- "device-adoption",
61604
- "device-provider",
61605
- "connection"
61606
- ]),
61600
+ kind: zod.z.enum(["device-adoption", "device-provider"]),
61607
61601
  /**
61608
61602
  * For `device-adoption` addons: the broker kind to create/link
61609
61603
  * (e.g. `home-assistant`), declared in the addon manifest. `null` for
@@ -61735,18 +61729,17 @@ var integrationsCapability = {
61735
61729
  };
61736
61730
  /**
61737
61731
  * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
61738
- * (an account, a relay, a destination) as typed records, shown on the
61739
- * Integrations page like every other integration (D985, D986).
61732
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
61733
+ * own function page reads and writes them (Logging for Loki); the Integrations
61734
+ * page lists only the integrations that bring devices (D996).
61740
61735
  *
61741
- * A collection of providers: each addon that holds connections registers one
61742
- * and the hub aggregator (`integrations.*`) reaches a provider with the pinned
61743
- * `addonId`. It is internal and has no route: the operator-facing surface is
61744
- * the `integrations` cap, which keeps ONE list.
61736
+ * A collection of providers: each addon that holds connections registers one and a
61737
+ * caller reaches a provider with the pinned `addonId`.
61745
61738
  *
61746
- * Identity: the instance id IS the `integrations` registry id (`int_NNNN`,
61747
- * immutable, already in the `/integrations/<id>` URL). A second operator-chosen
61748
- * slug would be a second authority over one identity (D224). `name` is the
61749
- * editable label.
61739
+ * Identity: the instance id is immutable and opaque to the caller. A record the
61740
+ * Loki migration made keeps the `integrations` registry id it was created under
61741
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
61742
+ * `name` is the editable label.
61750
61743
  *
61751
61744
  * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
61752
61745
  * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
@@ -61792,25 +61785,36 @@ var integrationInstancesCapability = {
61792
61785
  name: "integration-instances",
61793
61786
  scope: "system",
61794
61787
  mode: "collection",
61795
- internal: true,
61796
61788
  methods: {
61797
- describe: method(zod.z.void(), IntegrationInstanceDescriptionSchema),
61789
+ describe: method(zod.z.void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }),
61798
61790
  /** The form; `id: null` is the create form. */
61799
- instanceFormSchema: method(zod.z.object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3),
61800
- listInstances: method(zod.z.void(), zod.z.array(IntegrationInstanceSchema).readonly()),
61801
- getInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable()),
61802
- /** Insert the typed record for a registry row that already exists. */
61791
+ instanceFormSchema: method(zod.z.object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3, { auth: "admin" }),
61792
+ listInstances: method(zod.z.void(), zod.z.array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
61793
+ getInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
61794
+ /** Insert the typed record under the given id (a duplicate id is refused). */
61803
61795
  createInstance: method(zod.z.object({
61804
61796
  id: IntegrationInstanceIdSchema,
61805
61797
  name: zod.z.string().min(1)
61806
- }), zod.z.object({ id: zod.z.string() }), { kind: "mutation" }),
61807
- updateInstance: method(IntegrationInstancePatchSchema, zod.z.object({ ok: zod.z.literal(true) }), { kind: "mutation" }),
61798
+ }), zod.z.object({ id: zod.z.string() }), {
61799
+ kind: "mutation",
61800
+ auth: "admin"
61801
+ }),
61802
+ updateInstance: method(IntegrationInstancePatchSchema, zod.z.object({ ok: zod.z.literal(true) }), {
61803
+ kind: "mutation",
61804
+ auth: "admin"
61805
+ }),
61808
61806
  /** Delete the record and its keychain refs together. */
61809
- deleteInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), zod.z.object({ ok: zod.z.literal(true) }), { kind: "mutation" }),
61807
+ deleteInstance: method(zod.z.object({ id: IntegrationInstanceIdSchema }), zod.z.object({ ok: zod.z.literal(true) }), {
61808
+ kind: "mutation",
61809
+ auth: "admin"
61810
+ }),
61810
61811
  testInstance: optionalMethod(zod.z.object({
61811
61812
  id: IntegrationInstanceIdSchema.nullable(),
61812
61813
  values: zod.z.record(zod.z.string(), zod.z.unknown())
61813
- }), TestConnectionResultSchema$1, { kind: "mutation" })
61814
+ }), TestConnectionResultSchema$1, {
61815
+ kind: "mutation",
61816
+ auth: "admin"
61817
+ })
61814
61818
  },
61815
61819
  mount: { kind: "skip" }
61816
61820
  };
@@ -85436,7 +85440,16 @@ var smokeCapability = {
85436
85440
  * future fields without breaking the existing call sites.
85437
85441
  */
85438
85442
  var EmailAddressSchema = zod.z.email();
85443
+ /**
85444
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
85445
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
85446
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
85447
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
85448
+ */
85449
+ var InstanceIdSchema = zod.z.string().min(1).optional();
85450
+ var RelayPinSchema = zod.z.object({ instanceId: InstanceIdSchema });
85439
85451
  var SendEmailInputSchema = zod.z.object({
85452
+ instanceId: InstanceIdSchema,
85440
85453
  to: zod.z.union([EmailAddressSchema, zod.z.array(EmailAddressSchema).min(1)]),
85441
85454
  cc: zod.z.array(EmailAddressSchema).optional(),
85442
85455
  bcc: zod.z.array(EmailAddressSchema).optional(),
@@ -85482,12 +85495,12 @@ var smtpProviderCapability = {
85482
85495
  }),
85483
85496
  /** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
85484
85497
  * Used by the operator's "Test connection" button. */
85485
- verify: method(zod.z.void(), SmtpStatusSchema, {
85498
+ verify: method(RelayPinSchema, SmtpStatusSchema, {
85486
85499
  kind: "mutation",
85487
85500
  auth: "admin",
85488
85501
  access: "view"
85489
85502
  }),
85490
- getStatus: method(zod.z.void(), SmtpStatusSchema, { auth: "admin" })
85503
+ getStatus: method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" })
85491
85504
  }
85492
85505
  };
85493
85506
  /**
@@ -61595,15 +61595,9 @@ var AvailableIntegrationTypeSchema = z.object({
61595
61595
  * branch on CAP — never on addon name. `device-adoption` integrations
61596
61596
  * (Home Assistant, …) route through the broker step (Approach A);
61597
61597
  * `device-provider` integrations (Reolink/ONVIF) keep the
61598
- * legacy config → discovery flow. `connection` is an addon that only holds a
61599
- * connection as typed records (`integration-instances`, D985): no devices,
61600
- * no discovery.
61598
+ * legacy config → discovery flow.
61601
61599
  */
61602
- kind: z.enum([
61603
- "device-adoption",
61604
- "device-provider",
61605
- "connection"
61606
- ]),
61600
+ kind: z.enum(["device-adoption", "device-provider"]),
61607
61601
  /**
61608
61602
  * For `device-adoption` addons: the broker kind to create/link
61609
61603
  * (e.g. `home-assistant`), declared in the addon manifest. `null` for
@@ -61735,18 +61729,17 @@ var integrationsCapability = {
61735
61729
  };
61736
61730
  /**
61737
61731
  * `integration-instances` - the connection of an addon that holds ONE or SEVERAL
61738
- * (an account, a relay, a destination) as typed records, shown on the
61739
- * Integrations page like every other integration (D985, D986).
61732
+ * (an account, a relay, a destination) as typed records (D985, D986). The addon's
61733
+ * own function page reads and writes them (Logging for Loki); the Integrations
61734
+ * page lists only the integrations that bring devices (D996).
61740
61735
  *
61741
- * A collection of providers: each addon that holds connections registers one
61742
- * and the hub aggregator (`integrations.*`) reaches a provider with the pinned
61743
- * `addonId`. It is internal and has no route: the operator-facing surface is
61744
- * the `integrations` cap, which keeps ONE list.
61736
+ * A collection of providers: each addon that holds connections registers one and a
61737
+ * caller reaches a provider with the pinned `addonId`.
61745
61738
  *
61746
- * Identity: the instance id IS the `integrations` registry id (`int_NNNN`,
61747
- * immutable, already in the `/integrations/<id>` URL). A second operator-chosen
61748
- * slug would be a second authority over one identity (D224). `name` is the
61749
- * editable label.
61739
+ * Identity: the instance id is immutable and opaque to the caller. A record the
61740
+ * Loki migration made keeps the `integrations` registry id it was created under
61741
+ * (`int_NNNN`); a single instance made by its function page takes the addon id.
61742
+ * `name` is the editable label.
61750
61743
  *
61751
61744
  * Secrets: every field the instance kind marks `.meta({ secret: true })` reaches
61752
61745
  * the form as a `SecretFieldView`, never text (D789). A patch value omitted, `''`
@@ -61792,25 +61785,36 @@ var integrationInstancesCapability = {
61792
61785
  name: "integration-instances",
61793
61786
  scope: "system",
61794
61787
  mode: "collection",
61795
- internal: true,
61796
61788
  methods: {
61797
- describe: method(z.void(), IntegrationInstanceDescriptionSchema),
61789
+ describe: method(z.void(), IntegrationInstanceDescriptionSchema, { auth: "admin" }),
61798
61790
  /** The form; `id: null` is the create form. */
61799
- instanceFormSchema: method(z.object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3),
61800
- listInstances: method(z.void(), z.array(IntegrationInstanceSchema).readonly()),
61801
- getInstance: method(z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable()),
61802
- /** Insert the typed record for a registry row that already exists. */
61791
+ instanceFormSchema: method(z.object({ id: IntegrationInstanceIdSchema.nullable() }), ConfigSchemaPassthrough$3, { auth: "admin" }),
61792
+ listInstances: method(z.void(), z.array(IntegrationInstanceSchema).readonly(), { auth: "admin" }),
61793
+ getInstance: method(z.object({ id: IntegrationInstanceIdSchema }), IntegrationInstanceSchema.nullable(), { auth: "admin" }),
61794
+ /** Insert the typed record under the given id (a duplicate id is refused). */
61803
61795
  createInstance: method(z.object({
61804
61796
  id: IntegrationInstanceIdSchema,
61805
61797
  name: z.string().min(1)
61806
- }), z.object({ id: z.string() }), { kind: "mutation" }),
61807
- updateInstance: method(IntegrationInstancePatchSchema, z.object({ ok: z.literal(true) }), { kind: "mutation" }),
61798
+ }), z.object({ id: z.string() }), {
61799
+ kind: "mutation",
61800
+ auth: "admin"
61801
+ }),
61802
+ updateInstance: method(IntegrationInstancePatchSchema, z.object({ ok: z.literal(true) }), {
61803
+ kind: "mutation",
61804
+ auth: "admin"
61805
+ }),
61808
61806
  /** Delete the record and its keychain refs together. */
61809
- deleteInstance: method(z.object({ id: IntegrationInstanceIdSchema }), z.object({ ok: z.literal(true) }), { kind: "mutation" }),
61807
+ deleteInstance: method(z.object({ id: IntegrationInstanceIdSchema }), z.object({ ok: z.literal(true) }), {
61808
+ kind: "mutation",
61809
+ auth: "admin"
61810
+ }),
61810
61811
  testInstance: optionalMethod(z.object({
61811
61812
  id: IntegrationInstanceIdSchema.nullable(),
61812
61813
  values: z.record(z.string(), z.unknown())
61813
- }), TestConnectionResultSchema$1, { kind: "mutation" })
61814
+ }), TestConnectionResultSchema$1, {
61815
+ kind: "mutation",
61816
+ auth: "admin"
61817
+ })
61814
61818
  },
61815
61819
  mount: { kind: "skip" }
61816
61820
  };
@@ -85436,7 +85440,16 @@ var smokeCapability = {
85436
85440
  * future fields without breaking the existing call sites.
85437
85441
  */
85438
85442
  var EmailAddressSchema = z.email();
85443
+ /**
85444
+ * Which relay of a multi-relay provider answers (D996). Absent = the provider's first / default
85445
+ * relay, so a caller written before relays existed keeps working unchanged. A provider with one
85446
+ * fixed relay ignores it. This is the integration instance id (`int_NNNN`), NOT the addon id: the
85447
+ * collection pin `addonId` still picks the provider, `instanceId` picks the relay inside it.
85448
+ */
85449
+ var InstanceIdSchema = z.string().min(1).optional();
85450
+ var RelayPinSchema = z.object({ instanceId: InstanceIdSchema });
85439
85451
  var SendEmailInputSchema = z.object({
85452
+ instanceId: InstanceIdSchema,
85440
85453
  to: z.union([EmailAddressSchema, z.array(EmailAddressSchema).min(1)]),
85441
85454
  cc: z.array(EmailAddressSchema).optional(),
85442
85455
  bcc: z.array(EmailAddressSchema).optional(),
@@ -85482,12 +85495,12 @@ var smtpProviderCapability = {
85482
85495
  }),
85483
85496
  /** Round-trip ping against the SMTP relay (EHLO + AUTH if configured).
85484
85497
  * Used by the operator's "Test connection" button. */
85485
- verify: method(z.void(), SmtpStatusSchema, {
85498
+ verify: method(RelayPinSchema, SmtpStatusSchema, {
85486
85499
  kind: "mutation",
85487
85500
  auth: "admin",
85488
85501
  access: "view"
85489
85502
  }),
85490
- getStatus: method(z.void(), SmtpStatusSchema, { auth: "admin" })
85503
+ getStatus: method(RelayPinSchema, SmtpStatusSchema, { auth: "admin" })
85491
85504
  }
85492
85505
  };
85493
85506
  /**
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-PjOoh6-K.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-DmhOVavh.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-C2GNRuvy.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-D8DIMgjl.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
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-Xi7ZQ7UI.js");
2
+ const require_dist = require("./dist-BXWXN1Dl.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-Bi3JY1e0.js");
4
+ const require_agent_https = require("./agent-https-DX_ypzVA.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");