@camstack/system 1.2.437 → 1.2.438

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 (91) hide show
  1. package/dist/addon-runner.js +64 -12
  2. package/dist/addon-runner.mjs +65 -13
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +7 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +7 -1
  9. package/dist/builtins/autotrack/index.js +1 -1
  10. package/dist/builtins/autotrack/index.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/dist/builtins/camera-grid/index.js +9 -1
  16. package/dist/builtins/camera-grid/index.mjs +9 -1
  17. package/dist/builtins/composer/composer.addon.js +2 -2
  18. package/dist/builtins/composer/composer.addon.mjs +2 -2
  19. package/dist/builtins/console-logging/index.js +12 -5
  20. package/dist/builtins/console-logging/index.mjs +12 -5
  21. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  22. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  23. package/dist/builtins/device-manager/device-manager.addon.d.ts +5 -0
  24. package/dist/builtins/device-manager/device-manager.addon.js +702 -28
  25. package/dist/builtins/device-manager/device-manager.addon.mjs +702 -28
  26. package/dist/builtins/device-manager/device-meta-types.d.ts +4 -0
  27. package/dist/builtins/device-manager/device-provider-context.d.ts +9 -0
  28. package/dist/builtins/device-manager/device-removal-hooks.d.ts +103 -0
  29. package/dist/builtins/device-manager/device-row-store.d.ts +1 -0
  30. package/dist/builtins/device-manager/device-tombstone-store.d.ts +58 -0
  31. package/dist/builtins/device-manager/removal-cleanup.d.ts +50 -0
  32. package/dist/builtins/hub-forwarder/index.js +1 -1
  33. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  34. package/dist/builtins/keychain/index.js +37 -4
  35. package/dist/builtins/keychain/index.mjs +37 -4
  36. package/dist/builtins/keychain/keychain-service.d.ts +14 -0
  37. package/dist/builtins/keychain/keychain-store.d.ts +1 -1
  38. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/dist/builtins/local-auth/local-auth.addon.js +12 -12
  41. package/dist/builtins/local-auth/local-auth.addon.mjs +12 -12
  42. package/dist/builtins/local-network/local-network.addon.js +10 -1
  43. package/dist/builtins/local-network/local-network.addon.mjs +10 -1
  44. package/dist/builtins/loki-logging/index.js +28 -5
  45. package/dist/builtins/loki-logging/index.mjs +28 -5
  46. package/dist/builtins/native-metrics/native-metrics.addon.js +11 -1
  47. package/dist/builtins/native-metrics/native-metrics.addon.mjs +11 -1
  48. package/dist/builtins/platform-probe/index.js +1 -1
  49. package/dist/builtins/platform-probe/index.mjs +1 -1
  50. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/snapshot/index.js +11 -1
  53. package/dist/builtins/snapshot/index.mjs +11 -1
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +4 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +4 -1
  56. package/dist/builtins/sqlite-storage/index.js +1 -1
  57. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  58. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  59. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  60. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/dist/builtins/system-config/system-config.addon.js +20 -2
  63. package/dist/builtins/system-config/system-config.addon.mjs +20 -2
  64. package/dist/builtins/winston-logging/index.js +14 -5
  65. package/dist/builtins/winston-logging/index.mjs +14 -5
  66. package/dist/{composition-sources-BIT8IUKm.js → composition-sources-DI3Z83vG.js} +1 -1
  67. package/dist/{composition-sources-tpYR0f1x.mjs → composition-sources-DpHGCjdL.mjs} +1 -1
  68. package/dist/{constants-Bc6trhoW.mjs → constants-DQK705Sb.mjs} +1 -1
  69. package/dist/{constants-CwRY32Nx.js → constants-wkcn5Ij3.js} +1 -1
  70. package/dist/{device-ca-DImD8IzR.js → device-ca-BSvkXqyI.js} +1 -1
  71. package/dist/{device-ca-BhdBByGD.mjs → device-ca-DvIZjXIl.mjs} +1 -1
  72. package/dist/{dist-m5JkT8UN.mjs → dist-Dc8GKC5H.mjs} +272 -7
  73. package/dist/{dist-CEAyXW3Q.js → dist-GgG-7amw.js} +307 -6
  74. package/dist/file-host-worker.js +1 -1
  75. package/dist/file-host-worker.mjs +1 -1
  76. package/dist/i18n/catalog-registry.d.ts +35 -0
  77. package/dist/i18n/index.d.ts +2 -0
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.js +663 -20
  80. package/dist/index.mjs +659 -22
  81. package/dist/kernel/gc-census.d.ts +18 -1
  82. package/dist/kernel/settings-view-types.d.ts +2 -0
  83. package/dist/kernel/transport/local-transport.d.ts +3 -0
  84. package/dist/kernel/transport/peer-answered-error.d.ts +5 -1
  85. package/dist/{restore-archive-C75srVbG.js → restore-archive-CTRz8v9o.js} +1 -1
  86. package/dist/{restore-archive-DNxAStrJ.mjs → restore-archive-DPg9duVY.mjs} +1 -1
  87. package/dist/{retired-settings-keys-DNfV28R_.js → retired-settings-keys-Dr_4lfKu.js} +1 -1
  88. package/dist/{retired-settings-keys-C5qP9QIf.mjs → retired-settings-keys-Is0zO8gX.mjs} +1 -1
  89. package/dist/{wal-maintenance-DvnVO5IK.mjs → wal-maintenance-Bx3lcVA7.mjs} +0 -0
  90. package/dist/{wal-maintenance-Ch79gy9S.js → wal-maintenance-mjB2i-VR.js} +0 -0
  91. package/package.json +1 -1
@@ -718,7 +718,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
718
718
  return EventCategory;
719
719
  }({});
720
720
  //#endregion
721
- //#region ../types/dist/sleep-DAX0-2v9.mjs
721
+ //#region ../types/dist/sleep-DRqxtc0C.mjs
722
722
  /**
723
723
  * The audio chunk plane's byte format, and the ONE expansion from a coded
724
724
  * window to float samples (D455).
@@ -4421,6 +4421,35 @@ function collectZodSecretPaths(schema, prefix = "") {
4421
4421
  return [...new Set(paths)];
4422
4422
  }
4423
4423
  /**
4424
+ * A user-facing error with a STABLE code (D863).
4425
+ *
4426
+ * `message` is always the English text, so every consumer that knows nothing
4427
+ * of codes (old clients, logs, the mesh) behaves exactly as before. The hub's
4428
+ * tRPC error formatter reads `code` + `params` and, when the request language
4429
+ * has a text for `server:<code>`, replaces the response `message`; the code
4430
+ * stays in the payload (`data.i18n`).
4431
+ */
4432
+ /** Dotted lower-case code, e.g. `auth.invalid-credentials`. It is the key in the `server` catalog. */
4433
+ var ErrorCodeSchema = z.string().regex(/^[a-z][a-z0-9-]*(\.[a-z0-9-]+)+$/);
4434
+ z.object({
4435
+ code: ErrorCodeSchema,
4436
+ params: z.record(z.string(), z.union([z.string(), z.number()])).optional()
4437
+ });
4438
+ var CamstackError = class extends Error {
4439
+ i18nCode;
4440
+ i18nParams;
4441
+ constructor(code, params, englishMessage) {
4442
+ super(englishMessage);
4443
+ this.name = "CamstackError";
4444
+ this.i18nCode = code;
4445
+ this.i18nParams = params;
4446
+ }
4447
+ };
4448
+ /** `throw userError('device.not-found', { id }, 'Device 12 not found')` */
4449
+ function userError(code, params, englishFallback) {
4450
+ return new CamstackError(code, params, englishFallback);
4451
+ }
4452
+ /**
4424
4453
  * Type-safe JSON parsing helpers.
4425
4454
  *
4426
4455
  * `JSON.parse` is typed as `any` in lib.es5.d.ts, which triggers
@@ -4486,7 +4515,7 @@ function sleep(ms) {
4486
4515
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
4487
4516
  }
4488
4517
  //#endregion
4489
- //#region ../types/dist/err-msg-DX6i_MY4.mjs
4518
+ //#region ../types/dist/err-msg-DLerKiVO.mjs
4490
4519
  var DeviceType = /* @__PURE__ */ function(DeviceType) {
4491
4520
  DeviceType["Camera"] = "camera";
4492
4521
  DeviceType["Hub"] = "hub";
@@ -4736,6 +4765,22 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
4736
4765
  DeviceRole["Nightvision"] = "nightvision";
4737
4766
  DeviceRole["PrivacyMask"] = "privacy-mask";
4738
4767
  DeviceRole["Doorbell"] = "doorbell";
4768
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
4769
+ DeviceRole["CoverBlind"] = "cover-blind";
4770
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
4771
+ DeviceRole["CoverShutter"] = "cover-shutter";
4772
+ /** Exterior awning. HA `device_class: awning`. */
4773
+ DeviceRole["CoverAwning"] = "cover-awning";
4774
+ /** Curtain / drape. HA `device_class: curtain`. */
4775
+ DeviceRole["CoverCurtain"] = "cover-curtain";
4776
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
4777
+ DeviceRole["CoverGarage"] = "cover-garage";
4778
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
4779
+ DeviceRole["CoverGate"] = "cover-gate";
4780
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
4781
+ DeviceRole["CoverDoor"] = "cover-door";
4782
+ /** Window. HA `device_class: window`. */
4783
+ DeviceRole["CoverWindow"] = "cover-window";
4739
4784
  /** Virtual HA toggle (input_boolean.*) — distinguishable from a
4740
4785
  * real Switch device for UI rendering / export adapters. */
4741
4786
  DeviceRole["BinaryHelper"] = "binary-helper";
@@ -4816,7 +4861,7 @@ function errMsg(err) {
4816
4861
  return String(err);
4817
4862
  }
4818
4863
  //#endregion
4819
- //#region ../types/dist/composition-C-WpVYTX.mjs
4864
+ //#region ../types/dist/composition-EQ9Ok0Ee.mjs
4820
4865
  var AUDIO_ENCODER_BY_CODEC = {
4821
4866
  opus: "libopus",
4822
4867
  aac: "aac",
@@ -9769,7 +9814,8 @@ function scopesAllowAddon(scopes, addonId, access) {
9769
9814
  return scopes.some((s) => s.type === "addon" && s.target === addonId && s.access.includes(access));
9770
9815
  }
9771
9816
  z.enum(["new-session", "step-up"]);
9772
- z.enum(["en", "it"]);
9817
+ /** The languages the hub's app landing pages are written in (D858). */
9818
+ var AppPageLangSchema = z.enum(["en", "it"]);
9773
9819
  /** How a native app starts one login method (D858), as `auth.listLoginMethods` reports it. */
9774
9820
  var AppLoginPathSchema = z.discriminatedUnion("kind", [z.object({ kind: z.literal("native") }), z.object({
9775
9821
  kind: z.literal("browser"),
@@ -10372,7 +10418,9 @@ var ConfigTabDeclarationSchema = z.object({
10372
10418
  var ConfigSectionWithValuesSchema = z.object({
10373
10419
  id: z.string(),
10374
10420
  title: z.string(),
10421
+ titleKey: z.string().optional(),
10375
10422
  description: z.string().optional(),
10423
+ descriptionKey: z.string().optional(),
10376
10424
  style: z.enum(["card", "accordion"]).optional(),
10377
10425
  defaultCollapsed: z.boolean().optional(),
10378
10426
  columns: z.union([
@@ -16216,6 +16264,16 @@ var keychainCapability = {
16216
16264
  kind: "mutation",
16217
16265
  auth: "admin"
16218
16266
  }),
16267
+ /**
16268
+ * Delete every value scoped `device/<deviceId>`, whatever its owner (D864).
16269
+ * Reserved to `device-manager`, on the device-removed path: a driver's
16270
+ * device-scoped secret is not anybody's once the device is gone. Answers the
16271
+ * refs removed (never values).
16272
+ */
16273
+ deleteDeviceScope: method(z.object({ deviceId: z.number().int() }), z.object({ refs: z.array(z.string()).readonly() }), {
16274
+ kind: "mutation",
16275
+ auth: "admin"
16276
+ }),
16219
16277
  /** The caller's own refs, metadata only. */
16220
16278
  listMeta: method(z.object({}), z.array(KeychainSecretMetaSchema).readonly(), { auth: "admin" }),
16221
16279
  /** Whether values can be served — the save path refuses a write while locked. */
@@ -38220,6 +38278,42 @@ var DeviceRegisterPayloadSchema = z.object({
38220
38278
  * omits it and the keyword backstop applies. */
38221
38279
  secretConfigPaths: z.array(z.string()).optional()
38222
38280
  });
38281
+ /** One deleted device, kept by device-manager so an addon that missed the
38282
+ * deletion can still learn of it (D865). Written by the delete path ONLY. */
38283
+ var DeviceTombstoneSchema = z.object({
38284
+ deviceId: z.number().int().positive(),
38285
+ /** Epoch ms the device was deleted. */
38286
+ deletedAt: z.number(),
38287
+ /** The addon that owned the device when it was deleted. */
38288
+ providerAddonId: z.string()
38289
+ });
38290
+ /** How long a tombstone stays readable. Past it, a device that was deleted
38291
+ * and never cleaned is only reachable by the admin "clean data of deleted
38292
+ * devices" action. */
38293
+ var DEVICE_TOMBSTONE_RETENTION_MS = 2160 * 60 * 60 * 1e3;
38294
+ /** Data held for one device that device-manager no longer knows. */
38295
+ var OrphanDeviceDataSchema = z.object({
38296
+ deviceId: z.number().int().positive(),
38297
+ /** Rows/files per store (`<addonId>:<store>`). */
38298
+ stores: z.record(z.string(), z.number().int().nonnegative())
38299
+ });
38300
+ var CleanupDeletedDevicesResultSchema = z.object({
38301
+ /**
38302
+ * `skipped` — the absence check could not be trusted (a device-list read
38303
+ * failed or the two reads disagreed); nothing was listed or deleted.
38304
+ * `dry-run` — `devices` is what a confirmed run would delete.
38305
+ * `cleaned` — `devices` is what was deleted.
38306
+ */
38307
+ status: z.enum([
38308
+ "skipped",
38309
+ "dry-run",
38310
+ "cleaned"
38311
+ ]),
38312
+ reason: z.string().nullable(),
38313
+ devices: z.array(OrphanDeviceDataSchema),
38314
+ /** Implementers that could not be asked (their stores are not in `devices`). */
38315
+ unreachable: z.array(z.string())
38316
+ });
38223
38317
  var DeviceRemovePayloadSchema = z.object({ deviceId: z.number() });
38224
38318
  var DevicePersistConfigPayloadSchema = z.object({
38225
38319
  deviceId: z.number(),
@@ -38816,6 +38910,27 @@ var deviceManagerCapability = {
38816
38910
  kind: "mutation",
38817
38911
  auth: "admin"
38818
38912
  }),
38913
+ /**
38914
+ * The tombstones of devices deleted at or after `sinceMs` (D865). The
38915
+ * reconcile feed of every `device-removal-hook` implementer: an addon that
38916
+ * was down when a device was deleted asks here at start and periodically.
38917
+ * A tombstone exists only for a DELETE — never for a device that is merely
38918
+ * unregistered, offline or whose provider is restarting. Tombstones older
38919
+ * than `DEVICE_TOMBSTONE_RETENTION_MS` are gone.
38920
+ */
38921
+ listDeletedSince: method(z.object({ sinceMs: z.number() }), z.array(DeviceTombstoneSchema).readonly(), { auth: "admin" }),
38922
+ /**
38923
+ * Admin-triggered clean-up of data that belongs to devices deleted BEFORE
38924
+ * tombstones existed (D865). Asks every `device-removal-hook` implementer
38925
+ * which device ids it holds data for, keeps those absent from the device
38926
+ * list — confirmed by TWO reads of the list, skipped if either fails — and
38927
+ * with `confirm: false` only reports the counts per store. `confirm: true`
38928
+ * deletes. Never runs on its own.
38929
+ */
38930
+ cleanupDeletedDevicesData: method(z.object({ confirm: z.boolean() }), CleanupDeletedDevicesResultSchema, {
38931
+ kind: "mutation",
38932
+ auth: "admin"
38933
+ }),
38819
38934
  /** Cascade-delete every top-level device whose `integrationId` matches.
38820
38935
  * Children cascade automatically via the per-parent remove path.
38821
38936
  * Idempotent: a device whose `integrationId` was never set never matches.
@@ -39731,6 +39846,85 @@ var embeddingEncoderCapability = {
39731
39846
  }
39732
39847
  };
39733
39848
  /**
39849
+ * `device-removal-hook` — the reliable way an addon learns a device was DELETED,
39850
+ * so it can delete what it keeps for that device (D865).
39851
+ *
39852
+ * ## Why an event was not enough
39853
+ *
39854
+ * `DeviceUnregistered` is telemetry and may be dropped (D8, D11). An addon that
39855
+ * hung its per-device clean-up on it left durable garbage whenever the event was
39856
+ * lost, the addon was down, or it was restarting at that moment — footage,
39857
+ * analytics rows and settings of device 4483 outlived the device. Loss of this
39858
+ * signal corrupts durable state, so it travels by RPC with a recorded fact
39859
+ * behind it (D8: "if loss would corrupt durable state, use RPC plus a reconcile").
39860
+ *
39861
+ * ## The three pieces
39862
+ *
39863
+ * 1. device-manager records a TOMBSTONE per deleted device
39864
+ * (`deviceManager.listDeletedSince`). The tombstone is written by the delete
39865
+ * path only — a device that is unregistered, offline or whose provider is
39866
+ * restarting is NOT deleted and gets none.
39867
+ * 2. After a delete, device-manager calls `onDeviceRemoved` on EVERY provider of
39868
+ * this collection, one by one, with bounded retries, logged.
39869
+ * 3. An implementer that was down asks `deviceManager.listDeletedSince` at start
39870
+ * (and periodically) and runs its own `onDeviceRemoved` for each tombstone it
39871
+ * may have missed. Reconcile is driven by tombstones, never by "the device is
39872
+ * not in the current list": a failed or partial list read must not destroy data.
39873
+ *
39874
+ * ## Contract for an implementer
39875
+ *
39876
+ * - **Idempotent.** It is called again by a retry, by a reconcile and by the
39877
+ * admin cleanup of data that predates tombstones. A device with nothing left
39878
+ * answers zero counts.
39879
+ * - **One key per store** in `counts`, deleted rows/files per store, so the log
39880
+ * line and the admin dry run can say where the data was.
39881
+ * - **Training datasets are NOT device data** and are never deleted by a hook.
39882
+ * - **Per-device SETTINGS are not hooked.** Configuration lives in the standard
39883
+ * per-device store (`ctx.settings.*DeviceStore`), which device-manager clears
39884
+ * for every addon centrally at delete time. This hook is for device DATA
39885
+ * that is not settings: footage, event media, analytics rows, history.
39886
+ * - A provider that cannot tell is allowed to throw; the caller retries it.
39887
+ *
39888
+ * `listDeviceData` is the read side of the admin "Clean data of deleted devices"
39889
+ * action: which device ids this addon holds data for, and how much per store. It
39890
+ * never deletes. device-manager decides which of those ids are absent from the
39891
+ * fleet, from TWO consistent reads of the device list (D49).
39892
+ */
39893
+ /** What a hook is told about the deletion. */
39894
+ var DeviceRemovedInputSchema = z.object({
39895
+ deviceId: z.number().int().positive(),
39896
+ /** Epoch ms the device was deleted (the tombstone's `deletedAt`). */
39897
+ deletedAt: z.number(),
39898
+ /** The addon that owned the device, as device-manager last knew it. */
39899
+ providerAddonId: z.string()
39900
+ });
39901
+ /** Rows/files/refs deleted, per store this implementer owns. */
39902
+ var DeviceRemovedResultSchema = z.object({ counts: z.record(z.string(), z.number().int().nonnegative()) });
39903
+ /** One (store, device) pair an implementer holds data for. */
39904
+ var DeviceDataEntrySchema = z.object({
39905
+ store: z.string(),
39906
+ deviceId: z.number().int().positive(),
39907
+ /** Rows (or files) held for the device in the store. */
39908
+ count: z.number().int().nonnegative()
39909
+ });
39910
+ var deviceRemovalHookCapability = {
39911
+ name: "device-removal-hook",
39912
+ scope: "system",
39913
+ mode: "collection",
39914
+ internal: true,
39915
+ methods: {
39916
+ /** Delete everything this addon keeps for the deleted device. Idempotent. */
39917
+ onDeviceRemoved: method(DeviceRemovedInputSchema, DeviceRemovedResultSchema, {
39918
+ kind: "mutation",
39919
+ auth: "admin"
39920
+ }),
39921
+ /** Which devices this addon holds data for, per store. Reads only. */
39922
+ listDeviceData: method(z.void(), z.array(DeviceDataEntrySchema).readonly(), { auth: "admin" })
39923
+ },
39924
+ /** In-process only — enumerated through `addons.listCapabilityProviders`. */
39925
+ mount: { kind: "skip" }
39926
+ };
39927
+ /**
39734
39928
  * `failure-contribution` — the capability an addon reports its OWN losses
39735
39929
  * through, per camera, with the denominator attached. It stores nothing.
39736
39930
  *
@@ -68661,10 +68855,20 @@ var ServerNameInfoSchema = z.object({
68661
68855
  /** `true` when nobody named the hub: `name` is the machine hostname. */
68662
68856
  isDefault: z.boolean()
68663
68857
  });
68664
- /** The hostname without its domain (`nas.lan.example` becomes `nas`). */
68858
+ /** What an unset name shows when the hostname says nothing about the hub. */
68859
+ var SERVER_NAME_FALLBACK = "CamStack";
68860
+ /** A container id: Docker's default hostname (12 hex chars, or the full 64). */
68861
+ var CONTAINER_ID_PATTERN = /^(?:[0-9a-f]{12}|[0-9a-f]{64})$/;
68862
+ /**
68863
+ * The hostname without its domain (`nas.lan.example` becomes `nas`). A hostname
68864
+ * that names nothing (empty, `localhost`, a container id) yields
68865
+ * {@link SERVER_NAME_FALLBACK}.
68866
+ */
68665
68867
  function shortHostname(hostname) {
68666
68868
  const first = hostname.trim().split(".")[0] ?? "";
68667
- return first.length > 0 ? first : "hub";
68869
+ if (first.length === 0 || first.toLowerCase() === "localhost") return SERVER_NAME_FALLBACK;
68870
+ if (CONTAINER_ID_PATTERN.test(first)) return SERVER_NAME_FALLBACK;
68871
+ return first;
68668
68872
  }
68669
68873
  /**
68670
68874
  * system — system-scoped singleton capability exposing hub-level
@@ -74790,6 +74994,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
74790
74994
  addonId: null,
74791
74995
  access: "create"
74792
74996
  },
74997
+ "deviceManager.cleanupDeletedDevicesData": {
74998
+ capName: "device-manager",
74999
+ capScope: "system",
75000
+ addonId: null,
75001
+ access: "create"
75002
+ },
74793
75003
  "deviceManager.createDevice": {
74794
75004
  capName: "device-manager",
74795
75005
  capScope: "system",
@@ -74970,6 +75180,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
74970
75180
  addonId: null,
74971
75181
  access: "view"
74972
75182
  },
75183
+ "deviceManager.listDeletedSince": {
75184
+ capName: "device-manager",
75185
+ capScope: "system",
75186
+ addonId: null,
75187
+ access: "view"
75188
+ },
74973
75189
  "deviceManager.listDeviceIdsByCaps": {
74974
75190
  capName: "device-manager",
74975
75191
  capScope: "system",
@@ -75378,6 +75594,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
75378
75594
  addonId: null,
75379
75595
  access: "create"
75380
75596
  },
75597
+ "deviceRemovalHook.listDeviceData": {
75598
+ capName: "device-removal-hook",
75599
+ capScope: "system",
75600
+ addonId: null,
75601
+ access: "view"
75602
+ },
75603
+ "deviceRemovalHook.onDeviceRemoved": {
75604
+ capName: "device-removal-hook",
75605
+ capScope: "system",
75606
+ addonId: null,
75607
+ access: "create"
75608
+ },
75381
75609
  "deviceState.claimFields": {
75382
75610
  capName: "device-state",
75383
75611
  capScope: "system",
@@ -75810,6 +76038,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
75810
76038
  addonId: null,
75811
76039
  access: "delete"
75812
76040
  },
76041
+ "keychain.deleteDeviceScope": {
76042
+ capName: "keychain",
76043
+ capScope: "system",
76044
+ addonId: null,
76045
+ access: "delete"
76046
+ },
75813
76047
  "keychain.getState": {
75814
76048
  capName: "keychain",
75815
76049
  capScope: "system",
@@ -81192,6 +81426,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
81192
81426
  deviceManagerCapability,
81193
81427
  deviceOpsCapability,
81194
81428
  deviceProviderCapability,
81429
+ deviceRemovalHookCapability,
81195
81430
  deviceStateCapability,
81196
81431
  deviceStatusCapability,
81197
81432
  doorbellCapability,
@@ -82085,6 +82320,11 @@ Object.freeze({
82085
82320
  form: "single",
82086
82321
  optional: false
82087
82322
  }],
82323
+ "deviceRemovalHook.onDeviceRemoved": [{
82324
+ name: "deviceId",
82325
+ form: "single",
82326
+ optional: false
82327
+ }],
82088
82328
  "deviceState.claimFields": [{
82089
82329
  name: "deviceId",
82090
82330
  form: "single",
@@ -82274,6 +82514,11 @@ Object.freeze({
82274
82514
  form: "single",
82275
82515
  optional: false
82276
82516
  }],
82517
+ "keychain.deleteDeviceScope": [{
82518
+ name: "deviceId",
82519
+ form: "single",
82520
+ optional: false
82521
+ }],
82277
82522
  "lawnMowerControl.dock": [{
82278
82523
  name: "deviceId",
82279
82524
  form: "single",
@@ -84922,6 +85167,26 @@ new Set([
84922
85167
  "audio-tools",
84923
85168
  "audio-silence"
84924
85169
  ]);
85170
+ var CATALOG_LANGS = AppPageLangSchema.options;
85171
+ /** One catalog file: flat key to text. A file of any other shape is rejected whole. */
85172
+ var CatalogFileSchema = z.record(z.string().min(1), z.string());
85173
+ /** Fills `{name}` placeholders; an unknown placeholder is left as written. */
85174
+ function interpolate(template, params) {
85175
+ if (params === void 0) return template;
85176
+ return template.replace(/\{(\w+)\}/g, (whole, name) => {
85177
+ const value = params[name];
85178
+ return value === void 0 ? whole : String(value);
85179
+ });
85180
+ }
85181
+ /** Splits `"ns:key"`; `null` when the reference has no namespace. */
85182
+ function splitTranslationRef(ref) {
85183
+ const at = ref.indexOf(":");
85184
+ if (at <= 0 || at === ref.length - 1) return null;
85185
+ return {
85186
+ ns: ref.slice(0, at),
85187
+ key: ref.slice(at + 1)
85188
+ };
85189
+ }
84925
85190
  /**
84926
85191
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
84927
85192
  *
@@ -85613,4 +85878,4 @@ function enumerateInferenceDevices(hw) {
85613
85878
  return out;
85614
85879
  }
85615
85880
  //#endregion
85616
- export { addonPagesCapability as $, supportedRuntimes as $n, nodePin as $r, isLocationEnabled as $t, FieldClaimModeSchema as A, replacedFieldKeys as An, ReadinessTimeoutError as Ar, describeComposableCaps as At, NetworkTunnelStartedDataSchema as B, scopesAllowAddon as Bn, customAction as Br, evictionPolicyOfLocation as Bt, DEVICE_ENROLLMENT_TTL_MS as C, parseStreamParamsFormPatch as Cn, BaseAddon as Cr, createDeviceExtensionProvider as Ct, DeclaredDevices as D, procedureAuthKey as Dn, REDACTED_SECRET as Dr, decodeVectorBase64 as Dt, DEVICE_SAN_USER_PREFIX as E, platformProbeCapability as En, DEVICE_STATUS_METHOD as Er, declarationOwnerNodeId as Et, LOG_LEVEL_RANK as F, resolveHubAddressRoles as Fn, asString$1 as Fr, deviceStatusCapability as Ft, ScopedTokenSchema as G, siteZoneKey as Gn, formatSecretScope as Gr, foldSnapshotByFunction as Gt, RecordingStatusSchema as H, scoreRuntimes as Hn, emitDownForOwnedCaps as Hr, expressionContainsBuiltinCall as Ht, LegacyStorageLocationDefaultSchema as I, resolveLocationMode as In, buildSecretRef as Ir, enumerateInferenceDevices as It, StorageCleanupJobSchema as J, storageMigrationCapability as Jn, isEvent as Jr, gbToBytes as Jt, ServerNameSchema as K, snapshotCapability as Kn, hydrateSchema as Kr, formatDeviceRevoker as Kt, METHOD_ACCESS_MAP as L, resolveMethodAuth as Ln, collectSecretConfigKeys as Lr, enumerateItemArrayFields as Lt, HUB_MDNS_SERVICE_TYPE as M, resolveBucketMs as Mn, WELL_KNOWN_TAB_MAP as Mr, deviceExtensionCapability as Mt, HUB_MDNS_TXT_KEYS as N, resolveCoreBlockEntry as Nn, asJsonObject as Nr, deviceManagerCapability as Nt, DeviceStatusSchema as O, ptzAutotrackCapability as On, RUNTIME_DEFAULTS as Or, defineExtensionSlotProvider as Ot, KEYCHAIN_RESET_TRIGGER_ACTOR as P, resolveCoreBlockFiles as Pn, asNumber as Pr, deviceStateCapability as Pt, UserRecordSchema as Q, streamQualityLabel as Qn, isSecretMarkerLike as Qr, isDefaultAppConnectionEndpoint as Qt, MINUTES_PER_DAY as R, resolveNotificationTapAddress as Rn, collectZodSecretPaths as Rr, enumerateSchemaFields as Rt, DERIVED_CAMERA_SILENCED_CAP_NAMES as S, objectInputDeclaresRequiredDeviceId as Sn, errMsg as Sr, coreBlocksCapability as St, DEVICE_SAN_CREDENTIAL_PREFIX as T, planComposition as Tn, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Tr, databaseSnapshotCapability as Tt, STORAGE_ACCESS_FALLBACK as U, settingsStoreCapability as Un, emitReadiness as Ur, extractNestedAddonId as Ut, RECORDING_SOURCE_CAMSTACK_ADDON as V, scopesAllowDeviceCap as Vn, defineCustomActions as Vr, expandContainer as Vt, STREAM_PROFILE_META as W, shortHostname as Wn, expandCapMethods as Wr, filesystemBrowseCapability as Wt, StorageLocationTypeSchema as X, storageProviderCapability as Xn, isSecretClear as Xr, isArrayOutputSchema as Xt, StorageLocationModeSchema as Y, storageOccupancyCapability as Yn, isKeychainStoredField as Yr, isAppLinkBase as Yt, StorageMigrationJobSchema as Z, streamCatalogCapability as Zn, isSecretMarker as Zr, isCollectionArrayMethod as Zt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as _, modeMayWrite as _n, disarmRoseMemory as _r, compositionSourceRefs as _t, ApiKeyRecordSchema as a, resolveCapMount as ai, legacyAutoLinkIds as an, vectorStoreCapability as ar, bareAddonId as at, DATA_STORE_DATABASES as b, normalizeUnit as bn, DeviceRole as br, coreBlockIdFromAddonId as bt, CAMERA_SWITCH_ORDER as c, secretTreeFromPaths as ci, localNetworkCapability as cn, buildFfmpegArgs as cr, buildDeviceEnrollmentLink as ct, COMPOSED_ITEM_FIXED_FIELDS as d, toSecretFieldView as di, logLevelAtMost as dn, composedDeviceStableId as dr, calendarsCapability as dt, normalizeSecretOwner as ei, isObjectInput as en, userManagementCapability as er, addonSettingsCapability as et, COMPOSER_RUNNER_ID as f, transformSecretWrite as fi, looseSchema as fn, compositionFeatureEnabled as fr, cameraGridLayoutCapability as ft, CoreBlockSchema as g, metricsProviderCapability as gn, createStatefulExpressionMemory as gr, compositionFieldKey as gt, CalendarPreferencesSchema as h, memoizePinnedFfmpeg as hn, compositionSourceKey as hr, composerCapability as ht, AlertSchema as i, readinessKey as ii, keychainCapability as in, vectorIndexDimConflictError as ir, backupCapability as it, FieldClaimSchema as j, resolveAppConnections as jn, SECRET_CLEAR as jr, deviceCredentialsCapability as jt, FIRST_LEVEL_MACRO_CLASSES as k, reducePoints as kn, ReadinessRegistry as kr, deriveBatteryPresence as kt, CAMSTACK_APP_LINK_ORIGIN as l, sleep as li, locationIconKey as ln, cloneStatefulExpressionMemory as lr, buildDeviceSignatureMessage as lt, CORE_BLOCK_ADDON_PREFIX as m, mayWriteToLocation as mn, compositionSliceKey as mr, checkRoleAddress as mt, AGENT_MDNS_TXT_KEYS as n, parseJsonUnknown as ni, kebabToCamel as nn, validateCustomAddress as nr, alertsCapability as nt, BaseDevice as o, resolveSecretMarkers as oi, legacyModeOf as on, withLocationMode as or, batteryCapability as ot, CORE_BLOCKS_ADDON_ID as p, EventCategory as pi, mayReadLocation as pn, compositionItemFieldPath as pr, canonicalIconKey as pt, SsoBridgeClaimsSchema as q, storageCapability as qn, isDeviceConfigCap as qr, formatMinutes as qt, ALL_CAPABILITY_DEFINITIONS as r, parseSecretRef as ri, keychainAdminCapability as rn, vectorDimFromBase64 as rr, authProviderCapability as rt, BatteryStatusSchema as s, scopeKey as si, lifecycleJobSchema as sn, COMPOSER_ADDON_ID as sr, buildCapabilityLookup as st, AGENT_MDNS_SERVICE_TYPE as t, parseJsonObject as ti, isVoidInput as tn, validateComposition as tr, addonWidgetsCapability as tt, CAP_NAMES_WITH_STATUS as u, toNodeId as ui, logDestinationCapability as un, composedDeviceRef as ur, buildStreamParamsConfigSchema as ut, DATABASE_SNAPSHOT_SUFFIX as v, motionCapability as vn, toExpressionValue as vr, coreBlockAddonId as vt, DEVICE_NONCE_TTL_MS as w, pickAppLinkHub as wn, DATAPLANE_SECRET_HEADER as wr, dataStoreProviderCapability as wt, DAY_NAMES as x, objectInputDeclaresAddonId as xn, DeviceType as xr, coreBlockSourceKind as xt, DATABASE_SNAPSHOT_TIMEOUT_MS as y, normalizeCoreBlockWrite as yn, DeviceFeature as yr, coreBlockComposition as yt, MOTION_CLOSE_AFTER_MS as z, runtimeStatePolicyFor as zn, createEvent as zr, evaluateCompositionField as zt };
85881
+ export { StorageLocationTypeSchema as $, storageMigrationCapability as $n, isEvent as $r, isAppLinkBase as $t, DeclaredDevices as A, platformProbeCapability as An, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Ar, decodeVectorBase64 as At, METHOD_ACCESS_MAP as B, resolveLocationMode as Bn, asString$1 as Br, enumerateItemArrayFields as Bt, DAY_NAMES as C, normalizeCoreBlockWrite as Cn, toExpressionValue as Cr, coreBlockIdFromAddonId as Ct, DEVICE_SAN_CREDENTIAL_PREFIX as D, parseStreamParamsFormPatch as Dn, errMsg as Dr, dataStoreProviderCapability as Dt, DEVICE_NONCE_TTL_MS as E, objectInputDeclaresRequiredDeviceId as En, DeviceType as Er, createDeviceExtensionProvider as Et, HUB_MDNS_SERVICE_TYPE as F, resolveAppConnections as Fn, ReadinessTimeoutError as Fr, deviceExtensionCapability as Ft, RecordingStatusSchema as G, scopesAllowDeviceCap as Gn, customAction as Gr, expressionContainsBuiltinCall as Gt, MOTION_CLOSE_AFTER_MS as H, resolveNotificationTapAddress as Hn, collectSecretConfigKeys as Hr, evaluateCompositionField as Ht, HUB_MDNS_TXT_KEYS as I, resolveBucketMs as In, SECRET_CLEAR as Ir, deviceManagerCapability as It, ScopedTokenSchema as J, shortHostname as Jn, emitReadiness as Jr, foldSnapshotByFunction as Jt, STORAGE_ACCESS_FALLBACK as K, scoreRuntimes as Kn, defineCustomActions as Kr, extractNestedAddonId as Kt, KEYCHAIN_RESET_TRIGGER_ACTOR as L, resolveCoreBlockEntry as Ln, WELL_KNOWN_TAB_MAP as Lr, deviceStateCapability as Lt, FIRST_LEVEL_MACRO_CLASSES as M, ptzAutotrackCapability as Mn, REDACTED_SECRET as Mr, deriveBatteryPresence as Mt, FieldClaimModeSchema as N, reducePoints as Nn, RUNTIME_DEFAULTS as Nr, describeComposableCaps as Nt, DEVICE_SAN_USER_PREFIX as O, pickAppLinkHub as On, BaseAddon as Or, databaseSnapshotCapability as Ot, FieldClaimSchema as P, replacedFieldKeys as Pn, ReadinessRegistry as Pr, deviceCredentialsCapability as Pt, StorageLocationModeSchema as Q, storageCapability as Qn, isDeviceConfigCap as Qr, interpolate as Qt, LOG_LEVEL_RANK as R, resolveCoreBlockFiles as Rn, asJsonObject as Rr, deviceStatusCapability as Rt, DATA_STORE_DATABASES as S, motionCapability as Sn, disarmRoseMemory as Sr, coreBlockComposition as St, DEVICE_ENROLLMENT_TTL_MS as T, objectInputDeclaresAddonId as Tn, DeviceRole as Tr, coreBlocksCapability as Tt, NetworkTunnelStartedDataSchema as U, runtimeStatePolicyFor as Un, collectZodSecretPaths as Ur, evictionPolicyOfLocation as Ut, MINUTES_PER_DAY as V, resolveMethodAuth as Vn, buildSecretRef as Vr, enumerateSchemaFields as Vt, RECORDING_SOURCE_CAMSTACK_ADDON as W, scopesAllowAddon as Wn, createEvent as Wr, expandContainer as Wt, SsoBridgeClaimsSchema as X, snapshotCapability as Xn, formatSecretScope as Xr, formatMinutes as Xt, ServerNameSchema as Y, siteZoneKey as Yn, expandCapMethods as Yr, formatDeviceRevoker as Yt, StorageCleanupJobSchema as Z, splitTranslationRef as Zn, hydrateSchema as Zr, gbToBytes as Zt, CatalogFileSchema as _, transformSecretWrite as _i, mayReadLocation as _n, compositionFeatureEnabled as _r, checkRoleAddress as _t, ApiKeyRecordSchema as a, normalizeSecretOwner as ai, isVoidInput as an, userManagementCapability as ar, alertsCapability as at, DATABASE_SNAPSHOT_SUFFIX as b, metricsProviderCapability as bn, compositionSourceKey as br, compositionSourceRefs as bt, CAMERA_SWITCH_ORDER as c, parseSecretRef as ci, keychainCapability as cn, vectorDimFromBase64 as cr, bareAddonId as ct, CATALOG_LANGS as d, resolveSecretMarkers as di, lifecycleJobSchema as dn, withLocationMode as dr, buildDeviceEnrollmentLink as dt, isKeychainStoredField as ei, isArrayOutputSchema as en, storageOccupancyCapability as er, StorageMigrationJobSchema as et, COMPOSED_ITEM_FIXED_FIELDS as f, scopeKey as fi, localNetworkCapability as fn, COMPOSER_ADDON_ID as fr, buildDeviceSignatureMessage as ft, CalendarPreferencesSchema as g, toSecretFieldView as gi, looseSchema as gn, composedDeviceStableId as gr, canonicalIconKey as gt, CORE_BLOCK_ADDON_PREFIX as h, toNodeId as hi, logLevelAtMost as hn, composedDeviceRef as hr, cameraGridLayoutCapability as ht, AlertSchema as i, nodePin as ii, isObjectInput as in, supportedRuntimes as ir, addonWidgetsCapability as it, DeviceStatusSchema as j, procedureAuthKey as jn, DEVICE_STATUS_METHOD as jr, defineExtensionSlotProvider as jt, DEVICE_TOMBSTONE_RETENTION_MS as k, planComposition as kn, DATAPLANE_SECRET_HEADER as kr, declarationOwnerNodeId as kt, CAMSTACK_APP_LINK_ORIGIN as l, readinessKey as li, legacyAutoLinkIds as ln, vectorIndexDimConflictError as lr, batteryCapability as lt, CORE_BLOCKS_ADDON_ID as m, sleep as mi, logDestinationCapability as mn, cloneStatefulExpressionMemory as mr, calendarsCapability as mt, AGENT_MDNS_TXT_KEYS as n, isSecretMarker as ni, isDefaultAppConnectionEndpoint as nn, streamCatalogCapability as nr, addonPagesCapability as nt, BaseDevice as o, parseJsonObject as oi, kebabToCamel as on, validateComposition as or, authProviderCapability as ot, COMPOSER_RUNNER_ID as p, secretTreeFromPaths as pi, locationIconKey as pn, buildFfmpegArgs as pr, buildStreamParamsConfigSchema as pt, STREAM_PROFILE_META as q, settingsStoreCapability as qn, emitDownForOwnedCaps as qr, filesystemBrowseCapability as qt, ALL_CAPABILITY_DEFINITIONS as r, isSecretMarkerLike as ri, isLocationEnabled as rn, streamQualityLabel as rr, addonSettingsCapability as rt, BatteryStatusSchema as s, parseJsonUnknown as si, keychainAdminCapability as sn, validateCustomAddress as sr, backupCapability as st, AGENT_MDNS_SERVICE_TYPE as t, isSecretClear as ti, isCollectionArrayMethod as tn, storageProviderCapability as tr, UserRecordSchema as tt, CAP_NAMES_WITH_STATUS as u, resolveCapMount as ui, legacyModeOf as un, vectorStoreCapability as ur, buildCapabilityLookup as ut, CoreBlockSchema as v, userError as vi, mayWriteToLocation as vn, compositionItemFieldPath as vr, composerCapability as vt, DERIVED_CAMERA_SILENCED_CAP_NAMES as w, normalizeUnit as wn, DeviceFeature as wr, coreBlockSourceKind as wt, DATABASE_SNAPSHOT_TIMEOUT_MS as x, modeMayWrite as xn, createStatefulExpressionMemory as xr, coreBlockAddonId as xt, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as y, EventCategory as yi, memoizePinnedFfmpeg as yn, compositionSliceKey as yr, compositionFieldKey as yt, LegacyStorageLocationDefaultSchema as z, resolveHubAddressRoles as zn, asNumber as zr, enumerateInferenceDevices as zt };