@camstack/system 1.2.328 → 1.2.330

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 (69) hide show
  1. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  2. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  3. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/alerts/alerts.addon.js +1 -1
  6. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  7. package/dist/builtins/autotrack/index.js +1 -1
  8. package/dist/builtins/autotrack/index.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.d.ts +7 -0
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +294 -79
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +294 -79
  12. package/dist/builtins/camera-grid/index.js +1 -1
  13. package/dist/builtins/camera-grid/index.mjs +1 -1
  14. package/dist/builtins/composer/composer.addon.js +2 -2
  15. package/dist/builtins/composer/composer.addon.mjs +2 -2
  16. package/dist/builtins/console-logging/index.js +1 -1
  17. package/dist/builtins/console-logging/index.mjs +1 -1
  18. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  19. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  20. package/dist/builtins/device-manager/device-manager.addon.js +2 -2
  21. package/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  22. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  23. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  24. package/dist/builtins/hub-forwarder/index.js +1 -1
  25. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  26. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  27. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  28. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  29. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  30. package/dist/builtins/local-network/local-network.addon.js +1 -1
  31. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  32. package/dist/builtins/loki-logging/index.js +1 -1
  33. package/dist/builtins/loki-logging/index.mjs +1 -1
  34. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  35. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  36. package/dist/builtins/platform-probe/index.js +1 -1
  37. package/dist/builtins/platform-probe/index.mjs +1 -1
  38. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  39. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  40. package/dist/builtins/snapshot/index.js +1 -1
  41. package/dist/builtins/snapshot/index.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  43. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  44. package/dist/builtins/sqlite-storage/sqlite-settings.addon.d.ts +4 -0
  45. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  46. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  47. package/dist/builtins/sqlite-storage/sqlite-snapshot-protocol.d.ts +49 -0
  48. package/dist/builtins/sqlite-storage/sqlite-snapshot-worker.d.ts +33 -0
  49. package/dist/builtins/sqlite-storage/sqlite-snapshotter.d.ts +98 -0
  50. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  51. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/system-backup/system-backup.service.d.ts +74 -20
  53. package/dist/builtins/system-config/system-config.addon.js +1 -1
  54. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  55. package/dist/builtins/winston-logging/index.js +1 -1
  56. package/dist/builtins/winston-logging/index.mjs +1 -1
  57. package/dist/{composition-sources-GkgXF6B9.js → composition-sources-2XxNEet3.js} +1 -1
  58. package/dist/{composition-sources-I8Rx7woY.mjs → composition-sources-Wj2kWund.mjs} +1 -1
  59. package/dist/{dist-BUejKKBm.js → dist-Bx4zxM9N.js} +534 -341
  60. package/dist/{dist-DWq17vC8.mjs → dist-Dp043AI0.mjs} +505 -342
  61. package/dist/index.js +1 -1
  62. package/dist/index.mjs +1 -1
  63. package/dist/{retired-settings-keys-DBPEzGop.js → retired-settings-keys-DR2WMe5d.js} +1 -1
  64. package/dist/{retired-settings-keys-BfHclEyd.mjs → retired-settings-keys-Dxf9vELs.mjs} +1 -1
  65. package/dist/sqlite-snapshot-protocol-2QaTouWV.mjs +34 -0
  66. package/dist/sqlite-snapshot-protocol-B9OndqZv.js +51 -0
  67. package/dist/sqlite-snapshot-worker.js +185 -0
  68. package/dist/sqlite-snapshot-worker.mjs +179 -0
  69. package/package.json +6 -3
@@ -9334,6 +9334,117 @@ var authProviderCapability = {
9334
9334
  mount: { kind: "skip" }
9335
9335
  };
9336
9336
  /**
9337
+ * The suffix of a verified snapshot, written next to the live database it
9338
+ * copies: `<db>.backup-snapshot`. A restore promotes it back over `<db>`
9339
+ * (`server/backend/src/sqlite-restore.ts` spells the same string — the
9340
+ * launcher stays free of `@camstack/*` runtime imports — and a spec pins the
9341
+ * two together).
9342
+ */
9343
+ var DATABASE_SNAPSHOT_SUFFIX = ".backup-snapshot";
9344
+ /**
9345
+ * The suffix of a copy still being written or verified. A file under this name
9346
+ * is never archived and never promoted: only a copy that passed every check is
9347
+ * renamed to {@link DATABASE_SNAPSHOT_SUFFIX}.
9348
+ */
9349
+ var DATABASE_SNAPSHOT_PARTIAL_SUFFIX = ".backup-snapshot-partial";
9350
+ /**
9351
+ * How long one snapshot may take end to end: the pinned copy of the whole
9352
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
9353
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
9354
+ * generous because a timeout fails the whole backup run.
9355
+ */
9356
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
9357
+ /**
9358
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
9359
+ * guesses which file is live from what sits beside it (a cleanly closed
9360
+ * database has no sidecars and is just as owned). Paths are absolute on the
9361
+ * owner's host.
9362
+ */
9363
+ var DatabaseSnapshotTargetsSchema = z.object({ databases: z.array(z.object({ livePath: z.string() })) });
9364
+ /** One b-tree table of the snapshot and the rows it holds. */
9365
+ var DatabaseSnapshotTableSchema = z.object({
9366
+ name: z.string(),
9367
+ rows: z.number().int().nonnegative()
9368
+ });
9369
+ /**
9370
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
9371
+ * caller pins the call to its own node, so it can read the file; a caller
9372
+ * that finds the path outside its own data root refuses it rather than
9373
+ * archiving something it cannot place.
9374
+ */
9375
+ var DatabaseSnapshotResultSchema = z.object({
9376
+ /** The live database the snapshot copies. Never to be copied as a file. */
9377
+ livePath: z.string(),
9378
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
9379
+ snapshotPath: z.string(),
9380
+ sizeBytes: z.number().int().nonnegative(),
9381
+ pageCount: z.number().int().nonnegative(),
9382
+ pageSize: z.number().int().positive(),
9383
+ /**
9384
+ * Every b-tree table with its row count. Read inside the SAME read
9385
+ * transaction the copy was taken from, and found EQUAL on the copy — so
9386
+ * this is the content of the snapshot, not an estimate of the source.
9387
+ */
9388
+ tables: z.array(DatabaseSnapshotTableSchema),
9389
+ /** Wall time of the pinned copy (row counts included). */
9390
+ copyMs: z.number().nonnegative(),
9391
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
9392
+ verifyMs: z.number().nonnegative(),
9393
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
9394
+ takenAt: z.number()
9395
+ });
9396
+ /**
9397
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
9398
+ * the same facts, with both paths relative to the archive root (the node's
9399
+ * data dir), because an archive outlives the host that made it.
9400
+ */
9401
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
9402
+ /** Archive-relative path of the live database the archive does NOT carry. */
9403
+ livePath: z.string(),
9404
+ /** Archive-relative path of the verified copy it carries in its place. */
9405
+ snapshotPath: z.string()
9406
+ });
9407
+ /**
9408
+ * database-snapshot — the OWNER of a live SQLite database writes a consistent,
9409
+ * verified copy of it (D693).
9410
+ *
9411
+ * A live database cannot be copied as files: three files written by a live
9412
+ * process cannot be read at one instant from outside it, and a tar of the
9413
+ * `.db` / `-wal` / `-shm` trio was measured torn in 6/6 archives (D679). Nor may
9414
+ * another process open it (D679 rule 2). So the process that owns the
9415
+ * connection writes the copy — through its own connection, on a thread,
9416
+ * pinned to one read transaction — and checks it before handing it out.
9417
+ *
9418
+ * Hub-only and internal: `sqlite-settings` is the registrant, and its consumer
9419
+ * is `backup-orchestrator`, which calls it pinned to its own node so the path
9420
+ * it gets back is on its own host. `auth: 'admin'` explicitly — `internal`
9421
+ * does not gate the mount (see `data-store-provider`).
9422
+ */
9423
+ var databaseSnapshotCapability = {
9424
+ name: "database-snapshot",
9425
+ scope: "system",
9426
+ mode: "singleton",
9427
+ internal: true,
9428
+ methods: {
9429
+ /**
9430
+ * Which databases this owner snapshots. Answered from memory — no file is
9431
+ * touched — so a backup can ask it before deciding anything.
9432
+ */
9433
+ listDatabases: method(z.object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }),
9434
+ /**
9435
+ * Write `<db>.backup-snapshot` and return what it holds. Throws — and
9436
+ * leaves no file under the final name — when the copy fails
9437
+ * `integrity_check` or its row counts differ from the pinned source's.
9438
+ * A second call while one is running joins it.
9439
+ */
9440
+ writeSnapshot: method(z.object({}), DatabaseSnapshotResultSchema, {
9441
+ kind: "mutation",
9442
+ auth: "admin",
9443
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
9444
+ })
9445
+ }
9446
+ };
9447
+ /**
9337
9448
  * Orchestrator-side destination metadata. The orchestrator computes
9338
9449
  * `id = <addonId>:<subId>` from its provider lookup so consumers
9339
9450
  * (admin UI, restore flow) see one canonical key.
@@ -9444,7 +9555,12 @@ var ArchiveManifestSchema = z.object({
9444
9555
  locations: z.array(z.string()),
9445
9556
  entries: z.array(ArchiveEntrySchema),
9446
9557
  totalBytes: z.number(),
9447
- totalFiles: z.number()
9558
+ totalFiles: z.number(),
9559
+ /**
9560
+ * Live SQLite databases this archive carries as their OWNER's verified
9561
+ * snapshot instead of as files (D693). Absent on archives made before.
9562
+ */
9563
+ sqliteSnapshots: z.array(ArchiveSqliteSnapshotSchema).optional()
9448
9564
  });
9449
9565
  var LocationStatSchema = z.object({
9450
9566
  name: z.string(),
@@ -11793,6 +11909,76 @@ var CompositionBlockStateSchema = z.object({
11793
11909
  reason: z.string().optional(),
11794
11910
  fields: z.array(CompositionFieldStateSchema)
11795
11911
  });
11912
+ /**
11913
+ * composer — runs every DECLARATIVE composition (D659).
11914
+ *
11915
+ * Internal and admin-only: its one caller is `core-blocks`' supervisor, which
11916
+ * sends the WHOLE set of composition blocks on every converge (idempotent),
11917
+ * and reads their state for the API. Nothing else talks to it.
11918
+ */
11919
+ /** The composer's runner id, `resolveRunnerId(decl, 'composer')`; pinned by `composer-manifest.spec.ts`. */
11920
+ var COMPOSER_RUNNER_ID = COMPOSER_ADDON_ID;
11921
+ var ComposerBlockSchema = z.object({
11922
+ id: z.string().min(1),
11923
+ name: z.string().min(1).max(120),
11924
+ enabled: z.boolean(),
11925
+ updatedAt: z.number(),
11926
+ composition: CompositionSchema
11927
+ });
11928
+ /**
11929
+ * A stored composition row that no longer PARSES — a schema a release
11930
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
11931
+ * its device as a placeholder and reports the block `failed` naming the parse
11932
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
11933
+ */
11934
+ var ComposerUnreadableBlockSchema = z.object({
11935
+ id: z.string().min(1),
11936
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
11937
+ name: z.string().nullable(),
11938
+ /** The parse error, in the operator's words. */
11939
+ error: z.string()
11940
+ });
11941
+ var ComposerApplyInputSchema = z.object({
11942
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
11943
+ integrationId: z.string().nullable(),
11944
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
11945
+ storeLoaded: z.boolean(),
11946
+ blocks: z.array(ComposerBlockSchema),
11947
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
11948
+ restartBlockIds: z.array(z.string()),
11949
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
11950
+ unreadableBlocks: z.array(ComposerUnreadableBlockSchema)
11951
+ });
11952
+ var ComposerBlockVerdictSchema = z.object({
11953
+ blockId: z.string(),
11954
+ status: CompositionRunStatusSchema,
11955
+ reason: z.string().optional()
11956
+ });
11957
+ var composerCapability = {
11958
+ name: "composer",
11959
+ scope: "system",
11960
+ mode: "singleton",
11961
+ internal: true,
11962
+ methods: {
11963
+ /**
11964
+ * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
11965
+ * `router({})` throws on one — every cap router is built at boot.
11966
+ */
11967
+ applyBlocks: method(ComposerApplyInputSchema, z.object({
11968
+ blocks: z.array(ComposerBlockVerdictSchema),
11969
+ /**
11970
+ * False when the composer declared and withdrew NOTHING (store not loaded,
11971
+ * integration unknown, its own rows unread or read empty once). An empty
11972
+ * apply the caller owes is paid off only by one the composer acted on (D49).
11973
+ */
11974
+ acted: z.boolean()
11975
+ }), {
11976
+ kind: "mutation",
11977
+ auth: "admin"
11978
+ }),
11979
+ getStates: method(z.object({ blockIds: z.array(z.string()) }), z.object({ states: z.array(CompositionBlockStateSchema) }), { auth: "admin" })
11980
+ }
11981
+ };
11796
11982
  function problem(code, path, message) {
11797
11983
  return {
11798
11984
  code,
@@ -13004,76 +13190,6 @@ var coreBlocksCapability = {
13004
13190
  }
13005
13191
  };
13006
13192
  /**
13007
- * composer — runs every DECLARATIVE composition (D659).
13008
- *
13009
- * Internal and admin-only: its one caller is `core-blocks`' supervisor, which
13010
- * sends the WHOLE set of composition blocks on every converge (idempotent),
13011
- * and reads their state for the API. Nothing else talks to it.
13012
- */
13013
- /** The composer's runner id, `resolveRunnerId(decl, 'composer')`; pinned by `composer-manifest.spec.ts`. */
13014
- var COMPOSER_RUNNER_ID = COMPOSER_ADDON_ID;
13015
- var ComposerBlockSchema = z.object({
13016
- id: z.string().min(1),
13017
- name: z.string().min(1).max(120),
13018
- enabled: z.boolean(),
13019
- updatedAt: z.number(),
13020
- composition: CompositionSchema
13021
- });
13022
- /**
13023
- * A stored composition row that no longer PARSES — a schema a release
13024
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13025
- * its device as a placeholder and reports the block `failed` naming the parse
13026
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13027
- */
13028
- var ComposerUnreadableBlockSchema = z.object({
13029
- id: z.string().min(1),
13030
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13031
- name: z.string().nullable(),
13032
- /** The parse error, in the operator's words. */
13033
- error: z.string()
13034
- });
13035
- var ComposerApplyInputSchema = z.object({
13036
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13037
- integrationId: z.string().nullable(),
13038
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13039
- storeLoaded: z.boolean(),
13040
- blocks: z.array(ComposerBlockSchema),
13041
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13042
- restartBlockIds: z.array(z.string()),
13043
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13044
- unreadableBlocks: z.array(ComposerUnreadableBlockSchema)
13045
- });
13046
- var ComposerBlockVerdictSchema = z.object({
13047
- blockId: z.string(),
13048
- status: CompositionRunStatusSchema,
13049
- reason: z.string().optional()
13050
- });
13051
- var composerCapability = {
13052
- name: "composer",
13053
- scope: "system",
13054
- mode: "singleton",
13055
- internal: true,
13056
- methods: {
13057
- /**
13058
- * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
13059
- * `router({})` throws on one — every cap router is built at boot.
13060
- */
13061
- applyBlocks: method(ComposerApplyInputSchema, z.object({
13062
- blocks: z.array(ComposerBlockVerdictSchema),
13063
- /**
13064
- * False when the composer declared and withdrew NOTHING (store not loaded,
13065
- * integration unknown, its own rows unread or read empty once). An empty
13066
- * apply the caller owes is paid off only by one the composer acted on (D49).
13067
- */
13068
- acted: z.boolean()
13069
- }), {
13070
- kind: "mutation",
13071
- auth: "admin"
13072
- }),
13073
- getStates: method(z.object({ blockIds: z.array(z.string()) }), z.object({ states: z.array(CompositionBlockStateSchema) }), { auth: "admin" })
13074
- }
13075
- };
13076
- /**
13077
13193
  * `custom-model-registry` — collection cap exposing operator-registered
13078
13194
  * custom detection models. Each provider (today: `addon-model-studio`)
13079
13195
  * contributes a list of `CustomModelDescriptor`s; the hub auto-concatenates
@@ -16232,6 +16348,272 @@ var deviceManagerCapability = {
16232
16348
  }
16233
16349
  };
16234
16350
  /**
16351
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
16352
+ * name (same pattern as `snapshot`):
16353
+ *
16354
+ * - **Native** providers: registered per-device by device-driver
16355
+ * addons via `ctx.registerNativeCap` — either on a
16356
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
16357
+ * or directly on the camera (Reolink registers at camera level).
16358
+ * Emits an `onPressed` event every time the firmware pushes a
16359
+ * ring; status tracks the last press and a pressCount since start
16360
+ * (diagnostic).
16361
+ *
16362
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
16363
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
16364
+ * device (contact / switch / event-emitter …) into a doorbell for
16365
+ * a camera. `defaultActive: false` — the operator explicitly binds
16366
+ * it per camera in the device-bindings UI, then picks the source
16367
+ * device + trigger in the per-device settings.
16368
+ *
16369
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
16370
+ * — subscribers listening at the camera level receive ring events
16371
+ * with `via[]` populated. No code on the parent needed.
16372
+ */
16373
+ var DoorbellStatusSchema = z.object({
16374
+ /** Ms epoch of the last press. null = never observed since this provider started. */
16375
+ lastPressedAt: z.number().nullable(),
16376
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
16377
+ pressCountSinceStart: z.number()
16378
+ });
16379
+ var DoorbellPressEventSchema = z.object({
16380
+ deviceId: z.number(),
16381
+ timestamp: z.number()
16382
+ });
16383
+ /**
16384
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
16385
+ * virtual-doorbell trigger devices, exactly what the wrapper's
16386
+ * `doorbellSources` persists (as `{ deviceId }` records).
16387
+ */
16388
+ var DoorbellSourceSlotValueSchema = z.object({ deviceIds: z.array(z.number().int().positive()) });
16389
+ /**
16390
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
16391
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
16392
+ * `doorbellSources` store (D648). A source rings when one of its
16393
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
16394
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
16395
+ * reports it, it never writes it.
16396
+ */
16397
+ var DOORBELL_SOURCE_SLOT = {
16398
+ id: "doorbell-source",
16399
+ label: "Doorbell trigger devices",
16400
+ description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
16401
+ shape: "association",
16402
+ hostDeviceTypes: [DeviceType.Camera],
16403
+ sourceCaps: SOURCE_CAPS,
16404
+ cardinality: "many",
16405
+ value: DoorbellSourceSlotValueSchema
16406
+ };
16407
+ var doorbellCapability = {
16408
+ name: "doorbell",
16409
+ scope: "device",
16410
+ deviceNative: true,
16411
+ mode: "singleton",
16412
+ kind: "wrapper",
16413
+ defaultActive: false,
16414
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
16415
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
16416
+ methods: {},
16417
+ events: {
16418
+ /**
16419
+ * Fires once per physical press. Reolink delivers via Baichuan
16420
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
16421
+ * release/duration — it's a pulse.
16422
+ */
16423
+ onPressed: {
16424
+ data: DoorbellPressEventSchema,
16425
+ fromState: {
16426
+ field: "lastPressedAt",
16427
+ on: "advance"
16428
+ }
16429
+ } },
16430
+ status: {
16431
+ schema: DoorbellStatusSchema,
16432
+ kind: "push"
16433
+ },
16434
+ /**
16435
+ * Runtime-state slice — last press timestamp + lifetime press count.
16436
+ * Mirrored by the kernel and readable via
16437
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
16438
+ * without subscribing.
16439
+ */
16440
+ runtimeState: DoorbellStatusSchema,
16441
+ /**
16442
+ * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
16443
+ *
16444
+ * See `RuntimeStateDurability`. Enforced by
16445
+ * `scripts/check-runtime-state-durability.ts`.
16446
+ */
16447
+ durability: "restored"
16448
+ };
16449
+ var ExtensionSlotIdSchema = z.enum(["doorbell-source", "linked-devices"]);
16450
+ var EXTENSION_SLOTS = {
16451
+ "doorbell-source": {
16452
+ descriptor: DOORBELL_SOURCE_SLOT,
16453
+ declaringCap: "doorbell",
16454
+ hostDeviceTypes: [DeviceType.Camera]
16455
+ },
16456
+ "linked-devices": {
16457
+ descriptor: LINKED_DEVICES_SLOT,
16458
+ declaringCap: "device-manager",
16459
+ hostDeviceTypes: [DeviceType.Camera]
16460
+ }
16461
+ };
16462
+ /** A slot's editable value, discriminated on `slot`. */
16463
+ var ExtensionSlotValueSchema = z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: z.literal("linked-devices") })]);
16464
+ /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
16465
+ var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
16466
+ var ExtensionSourceAvailabilitySchema = z.discriminatedUnion("state", [z.object({ state: z.literal("ok") }), z.object({
16467
+ state: z.literal("unreachable"),
16468
+ reason: z.string()
16469
+ })]);
16470
+ /** One provider of slots — the D554 source-listing row. */
16471
+ var ExtensionSourceSchema = z.object({
16472
+ /** The routing prefix of every `slotRef` this provider serves. */
16473
+ source: z.string(),
16474
+ label: z.string(),
16475
+ /** Stamped by the dispatcher from the registry (D557). */
16476
+ addonId: z.string().optional(),
16477
+ availability: ExtensionSourceAvailabilitySchema
16478
+ });
16479
+ /**
16480
+ * How one picked source stands. `missing` — no such device (deleted, or an id
16481
+ * that never existed); `foreign` — a device the slot's owner cannot read from
16482
+ * (a source owned by another addon); `unavailable` — it exists but is not a
16483
+ * valid source now (a container, which is never a pick). A source in any of
16484
+ * these states is SHOWN, never silently dropped or re-pointed.
16485
+ */
16486
+ var ExtensionSourceHealthSchema = z.enum([
16487
+ "ok",
16488
+ "missing",
16489
+ "foreign",
16490
+ "unavailable"
16491
+ ]);
16492
+ var ExtensionSlotSourceSchema = z.object({
16493
+ deviceId: z.number().int(),
16494
+ /** The device's name, or null when it could not be resolved (`missing`). */
16495
+ name: z.string().nullable(),
16496
+ health: ExtensionSourceHealthSchema,
16497
+ detail: z.string().optional()
16498
+ });
16499
+ /**
16500
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
16501
+ * reported read-only, named, never written through this contract (D62). The
16502
+ * virtual doorbell's sources ring only while the wrapper is bound to the
16503
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
16504
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
16505
+ */
16506
+ var ExtensionSlotActivationSchema = z.object({
16507
+ state: z.enum([
16508
+ "active",
16509
+ "inactive",
16510
+ "unknown"
16511
+ ]),
16512
+ authority: z.string(),
16513
+ detail: z.string().optional()
16514
+ });
16515
+ /** One slot of one device, as its owner reads it from its own store. */
16516
+ var ExtensionSlotStateSchema = z.object({
16517
+ state: z.literal("ok"),
16518
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
16519
+ slotRef: z.string(),
16520
+ slot: ExtensionSlotIdSchema,
16521
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
16522
+ authority: z.string(),
16523
+ activation: ExtensionSlotActivationSchema.nullable(),
16524
+ value: ExtensionSlotValueSchema,
16525
+ sources: z.array(ExtensionSlotSourceSchema),
16526
+ /**
16527
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
16528
+ * are therefore not in `value` (D655): a camera's device-tree children, and
16529
+ * the child a picked container stands for (D356 — a container is never a
16530
+ * pick, its children are). Read-only; the editor shows them and may offer
16531
+ * per-device options on them (the linked-devices tracked-event opt-in).
16532
+ * Absent when the owner links nothing beyond the picks, and from an owner
16533
+ * older than D655.
16534
+ */
16535
+ impliedSources: z.array(ExtensionSlotSourceSchema).optional()
16536
+ });
16537
+ /**
16538
+ * A provider that could not answer `listSlots` at all. It could not name its
16539
+ * own slots, so the row names the ADDON and carries the refusal verbatim.
16540
+ * Written by the dispatcher, never by a provider.
16541
+ */
16542
+ var ExtensionSlotUnreachableSchema = z.object({
16543
+ state: z.literal("unreachable"),
16544
+ addonId: z.string(),
16545
+ reason: z.string()
16546
+ });
16547
+ var ExtensionSlotRowSchema = z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
16548
+ /** One device the slot's editor may offer as a source. */
16549
+ var ExtensionCandidateSchema = z.object({
16550
+ deviceId: z.number().int(),
16551
+ name: z.string(),
16552
+ type: z.string(),
16553
+ location: z.string().nullable(),
16554
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
16555
+ parentName: z.string().nullable(),
16556
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
16557
+ suggested: z.boolean(),
16558
+ /** Why it is suggested ("same location"), null when it is not. */
16559
+ reason: z.string().nullable()
16560
+ });
16561
+ var ExtensionCandidatesSchema = z.object({ candidates: z.array(ExtensionCandidateSchema) });
16562
+ /**
16563
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
16564
+ * reloaded the host (or, for an accessory child, its parent) because the
16565
+ * write changed what the host REGISTERS. A slot never adds a capability to its
16566
+ * host — that is a composition (D663) — so today's owners answer `none`.
16567
+ */
16568
+ var ExtensionSetResultSchema = z.object({
16569
+ applied: z.literal(true),
16570
+ reload: z.enum([
16571
+ "none",
16572
+ "host",
16573
+ "parent"
16574
+ ])
16575
+ });
16576
+ var ExtensionSlotRefInputSchema = z.object({
16577
+ deviceId: z.number().int(),
16578
+ slotRef: z.string().min(1)
16579
+ });
16580
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
16581
+ var deviceExtensionCapability = {
16582
+ name: "device-extension",
16583
+ scope: "device",
16584
+ mode: "collection",
16585
+ kind: "wrapper",
16586
+ defaultActive: true,
16587
+ deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
16588
+ deviceConfig: { ui: {
16589
+ kind: "widget",
16590
+ widgetId: "host/extensions-panel",
16591
+ tab: "general",
16592
+ label: "Extensions",
16593
+ order: 72
16594
+ } },
16595
+ methods: {
16596
+ /** One row per slot owner — the D554 source listing `slotRef` routes by. */
16597
+ listSources: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSourceSchema)),
16598
+ /**
16599
+ * Every slot this device is offered, read by each owner from its own
16600
+ * store. A provider that throws is ONE `unreachable` row (D554.4).
16601
+ */
16602
+ listSlots: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSlotRowSchema)),
16603
+ /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
16604
+ listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
16605
+ /**
16606
+ * Write one slot through its owner's EXISTING write path. The owner
16607
+ * validates (a container is never a linked device, a camera is never its
16608
+ * own source) and refuses by name before persisting.
16609
+ */
16610
+ setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
16611
+ kind: "mutation",
16612
+ auth: "admin"
16613
+ })
16614
+ }
16615
+ };
16616
+ /**
16235
16617
  * Per-field ownership (D663). A composition may CLAIM fields of a native
16236
16618
  * cap's runtime-state slice on an existing device: `replace` overlays the
16237
16619
  * claimed fields on the native slice, `add` builds a slice the device does
@@ -19746,17 +20128,25 @@ var NcScheduleSchema = z.object({
19746
20128
  */
19747
20129
  var NcSystemEventDeliveryModeSchema = z.enum(["instant", "summary"]);
19748
20130
  /**
20131
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
20132
+ * every section; `section` = one notification per section with something to
20133
+ * say (an unavailable section included), each titled by its section.
20134
+ */
20135
+ var NcStateSummarySplitSchema = z.enum(["rule", "section"]);
20136
+ /**
19749
20137
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
19750
20138
  * CLOSES, it sends one notification with the current state of its kinds
19751
20139
  * (low batteries, consumables to replace, devices offline, updates
19752
- * available, ...), after its own filters. Nothing to report sends nothing.
20140
+ * available, ...), after its own filters — or, with `split: 'section'`
20141
+ * (D698), one notification per section. Nothing to report sends nothing.
19753
20142
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
19754
20143
  * midnight crossing); the send time is each window's END. Refused on the
19755
20144
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
19756
20145
  */
19757
20146
  var NcSystemEventDeliverySchema = z.discriminatedUnion("mode", [z.object({ mode: z.literal("instant") }), z.object({
19758
20147
  mode: z.literal("summary"),
19759
- schedule: NcScheduleSchema
20148
+ schedule: NcScheduleSchema,
20149
+ split: NcStateSummarySplitSchema.optional()
19760
20150
  })]);
19761
20151
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
19762
20152
  var NcPlateMatcherSchema = z.object({
@@ -20755,11 +21145,23 @@ var NcStateSummaryPreviewSectionSchema = z.object({
20755
21145
  reason: z.string().optional()
20756
21146
  });
20757
21147
  /**
21148
+ * One notification a previewed summary would send (D698): the whole summary on
21149
+ * a `rule` split (no `section`), one section's on a `section` split.
21150
+ */
21151
+ var NcStateSummaryPreviewRowSchema = z.object({
21152
+ section: z.string().optional(),
21153
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
21154
+ title: z.string(),
21155
+ text: z.string(),
21156
+ count: z.number().int().nonnegative()
21157
+ });
21158
+ /**
20758
21159
  * The summary a rule would send now. `empty` = nothing to report and every
20759
21160
  * section read: such a summary is NOT sent. `dropped` counts the open states
20760
21161
  * the rule's own filters (or a camera mute) left out, by reason.
20761
21162
  * `excludedGroups` names the kind groups selected that have no state to report
20762
- * (backups & exports).
21163
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
21164
+ * optional, so an older hub's answer still parses.
20763
21165
  */
20764
21166
  var NcStateSummaryPreviewSchema = z.object({
20765
21167
  empty: z.boolean(),
@@ -20767,7 +21169,9 @@ var NcStateSummaryPreviewSchema = z.object({
20767
21169
  text: z.string(),
20768
21170
  sections: z.array(NcStateSummaryPreviewSectionSchema),
20769
21171
  dropped: z.record(z.string(), z.number().int().nonnegative()),
20770
- excludedGroups: z.array(z.string())
21172
+ excludedGroups: z.array(z.string()),
21173
+ split: NcStateSummarySplitSchema.optional(),
21174
+ rows: z.array(NcStateSummaryPreviewRowSchema).optional()
20771
21175
  });
20772
21176
  var NcTestResultSchema = z.object({
20773
21177
  recordId: z.string(),
@@ -30708,272 +31112,6 @@ var videoclipsCapability = {
30708
31112
  }
30709
31113
  };
30710
31114
  /**
30711
- * Doorbell button cap. Two kinds of providers coexist behind this cap
30712
- * name (same pattern as `snapshot`):
30713
- *
30714
- * - **Native** providers: registered per-device by device-driver
30715
- * addons via `ctx.registerNativeCap` — either on a
30716
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
30717
- * or directly on the camera (Reolink registers at camera level).
30718
- * Emits an `onPressed` event every time the firmware pushes a
30719
- * ring; status tracks the last press and a pressCount since start
30720
- * (diagnostic).
30721
- *
30722
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
30723
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
30724
- * device (contact / switch / event-emitter …) into a doorbell for
30725
- * a camera. `defaultActive: false` — the operator explicitly binds
30726
- * it per camera in the device-bindings UI, then picks the source
30727
- * device + trigger in the per-device settings.
30728
- *
30729
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
30730
- * — subscribers listening at the camera level receive ring events
30731
- * with `via[]` populated. No code on the parent needed.
30732
- */
30733
- var DoorbellStatusSchema = z.object({
30734
- /** Ms epoch of the last press. null = never observed since this provider started. */
30735
- lastPressedAt: z.number().nullable(),
30736
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
30737
- pressCountSinceStart: z.number()
30738
- });
30739
- var DoorbellPressEventSchema = z.object({
30740
- deviceId: z.number(),
30741
- timestamp: z.number()
30742
- });
30743
- /**
30744
- * The `doorbell-source` extension slot's editable value (D648): the camera's
30745
- * virtual-doorbell trigger devices, exactly what the wrapper's
30746
- * `doorbellSources` persists (as `{ deviceId }` records).
30747
- */
30748
- var DoorbellSourceSlotValueSchema = z.object({ deviceIds: z.array(z.number().int().positive()) });
30749
- /**
30750
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
30751
- * doorbell, owned by the `virtual-doorbell` wrapper over its
30752
- * `doorbellSources` store (D648). A source rings when one of its
30753
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
30754
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
30755
- * reports it, it never writes it.
30756
- */
30757
- var DOORBELL_SOURCE_SLOT = {
30758
- id: "doorbell-source",
30759
- label: "Doorbell trigger devices",
30760
- description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
30761
- shape: "association",
30762
- hostDeviceTypes: [DeviceType.Camera],
30763
- sourceCaps: SOURCE_CAPS,
30764
- cardinality: "many",
30765
- value: DoorbellSourceSlotValueSchema
30766
- };
30767
- var doorbellCapability = {
30768
- name: "doorbell",
30769
- scope: "device",
30770
- deviceNative: true,
30771
- mode: "singleton",
30772
- kind: "wrapper",
30773
- defaultActive: false,
30774
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
30775
- extensionSlots: [DOORBELL_SOURCE_SLOT],
30776
- methods: {},
30777
- events: {
30778
- /**
30779
- * Fires once per physical press. Reolink delivers via Baichuan
30780
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
30781
- * release/duration — it's a pulse.
30782
- */
30783
- onPressed: {
30784
- data: DoorbellPressEventSchema,
30785
- fromState: {
30786
- field: "lastPressedAt",
30787
- on: "advance"
30788
- }
30789
- } },
30790
- status: {
30791
- schema: DoorbellStatusSchema,
30792
- kind: "push"
30793
- },
30794
- /**
30795
- * Runtime-state slice — last press timestamp + lifetime press count.
30796
- * Mirrored by the kernel and readable via
30797
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
30798
- * without subscribing.
30799
- */
30800
- runtimeState: DoorbellStatusSchema,
30801
- /**
30802
- * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
30803
- *
30804
- * See `RuntimeStateDurability`. Enforced by
30805
- * `scripts/check-runtime-state-durability.ts`.
30806
- */
30807
- durability: "restored"
30808
- };
30809
- var ExtensionSlotIdSchema = z.enum(["doorbell-source", "linked-devices"]);
30810
- var EXTENSION_SLOTS = {
30811
- "doorbell-source": {
30812
- descriptor: DOORBELL_SOURCE_SLOT,
30813
- declaringCap: "doorbell",
30814
- hostDeviceTypes: [DeviceType.Camera]
30815
- },
30816
- "linked-devices": {
30817
- descriptor: LINKED_DEVICES_SLOT,
30818
- declaringCap: "device-manager",
30819
- hostDeviceTypes: [DeviceType.Camera]
30820
- }
30821
- };
30822
- /** A slot's editable value, discriminated on `slot`. */
30823
- var ExtensionSlotValueSchema = z.discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: z.literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: z.literal("linked-devices") })]);
30824
- /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
30825
- var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
30826
- var ExtensionSourceAvailabilitySchema = z.discriminatedUnion("state", [z.object({ state: z.literal("ok") }), z.object({
30827
- state: z.literal("unreachable"),
30828
- reason: z.string()
30829
- })]);
30830
- /** One provider of slots — the D554 source-listing row. */
30831
- var ExtensionSourceSchema = z.object({
30832
- /** The routing prefix of every `slotRef` this provider serves. */
30833
- source: z.string(),
30834
- label: z.string(),
30835
- /** Stamped by the dispatcher from the registry (D557). */
30836
- addonId: z.string().optional(),
30837
- availability: ExtensionSourceAvailabilitySchema
30838
- });
30839
- /**
30840
- * How one picked source stands. `missing` — no such device (deleted, or an id
30841
- * that never existed); `foreign` — a device the slot's owner cannot read from
30842
- * (a source owned by another addon); `unavailable` — it exists but is not a
30843
- * valid source now (a container, which is never a pick). A source in any of
30844
- * these states is SHOWN, never silently dropped or re-pointed.
30845
- */
30846
- var ExtensionSourceHealthSchema = z.enum([
30847
- "ok",
30848
- "missing",
30849
- "foreign",
30850
- "unavailable"
30851
- ]);
30852
- var ExtensionSlotSourceSchema = z.object({
30853
- deviceId: z.number().int(),
30854
- /** The device's name, or null when it could not be resolved (`missing`). */
30855
- name: z.string().nullable(),
30856
- health: ExtensionSourceHealthSchema,
30857
- detail: z.string().optional()
30858
- });
30859
- /**
30860
- * A DIFFERENT authority that gates whether the slot's sources do anything —
30861
- * reported read-only, named, never written through this contract (D62). The
30862
- * virtual doorbell's sources ring only while the wrapper is bound to the
30863
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
30864
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
30865
- */
30866
- var ExtensionSlotActivationSchema = z.object({
30867
- state: z.enum([
30868
- "active",
30869
- "inactive",
30870
- "unknown"
30871
- ]),
30872
- authority: z.string(),
30873
- detail: z.string().optional()
30874
- });
30875
- /** One slot of one device, as its owner reads it from its own store. */
30876
- var ExtensionSlotStateSchema = z.object({
30877
- state: z.literal("ok"),
30878
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
30879
- slotRef: z.string(),
30880
- slot: ExtensionSlotIdSchema,
30881
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
30882
- authority: z.string(),
30883
- activation: ExtensionSlotActivationSchema.nullable(),
30884
- value: ExtensionSlotValueSchema,
30885
- sources: z.array(ExtensionSlotSourceSchema),
30886
- /**
30887
- * Devices the owner links to the host ON ITS OWN, by structure, and that
30888
- * are therefore not in `value` (D655): a camera's device-tree children, and
30889
- * the child a picked container stands for (D356 — a container is never a
30890
- * pick, its children are). Read-only; the editor shows them and may offer
30891
- * per-device options on them (the linked-devices tracked-event opt-in).
30892
- * Absent when the owner links nothing beyond the picks, and from an owner
30893
- * older than D655.
30894
- */
30895
- impliedSources: z.array(ExtensionSlotSourceSchema).optional()
30896
- });
30897
- /**
30898
- * A provider that could not answer `listSlots` at all. It could not name its
30899
- * own slots, so the row names the ADDON and carries the refusal verbatim.
30900
- * Written by the dispatcher, never by a provider.
30901
- */
30902
- var ExtensionSlotUnreachableSchema = z.object({
30903
- state: z.literal("unreachable"),
30904
- addonId: z.string(),
30905
- reason: z.string()
30906
- });
30907
- var ExtensionSlotRowSchema = z.discriminatedUnion("state", [ExtensionSlotStateSchema, ExtensionSlotUnreachableSchema]);
30908
- /** One device the slot's editor may offer as a source. */
30909
- var ExtensionCandidateSchema = z.object({
30910
- deviceId: z.number().int(),
30911
- name: z.string(),
30912
- type: z.string(),
30913
- location: z.string().nullable(),
30914
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
30915
- parentName: z.string().nullable(),
30916
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
30917
- suggested: z.boolean(),
30918
- /** Why it is suggested ("same location"), null when it is not. */
30919
- reason: z.string().nullable()
30920
- });
30921
- var ExtensionCandidatesSchema = z.object({ candidates: z.array(ExtensionCandidateSchema) });
30922
- /**
30923
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
30924
- * reloaded the host (or, for an accessory child, its parent) because the
30925
- * write changed what the host REGISTERS. A slot never adds a capability to its
30926
- * host — that is a composition (D663) — so today's owners answer `none`.
30927
- */
30928
- var ExtensionSetResultSchema = z.object({
30929
- applied: z.literal(true),
30930
- reload: z.enum([
30931
- "none",
30932
- "host",
30933
- "parent"
30934
- ])
30935
- });
30936
- var ExtensionSlotRefInputSchema = z.object({
30937
- deviceId: z.number().int(),
30938
- slotRef: z.string().min(1)
30939
- });
30940
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
30941
- var deviceExtensionCapability = {
30942
- name: "device-extension",
30943
- scope: "device",
30944
- mode: "collection",
30945
- kind: "wrapper",
30946
- defaultActive: true,
30947
- deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
30948
- deviceConfig: { ui: {
30949
- kind: "widget",
30950
- widgetId: "host/extensions-panel",
30951
- tab: "general",
30952
- label: "Extensions",
30953
- order: 72
30954
- } },
30955
- methods: {
30956
- /** One row per slot owner — the D554 source listing `slotRef` routes by. */
30957
- listSources: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSourceSchema)),
30958
- /**
30959
- * Every slot this device is offered, read by each owner from its own
30960
- * store. A provider that throws is ONE `unreachable` row (D554.4).
30961
- */
30962
- listSlots: method(z.object({ deviceId: z.number().int() }), z.array(ExtensionSlotRowSchema)),
30963
- /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
30964
- listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
30965
- /**
30966
- * Write one slot through its owner's EXISTING write path. The owner
30967
- * validates (a container is never a linked device, a camera is never its
30968
- * own source) and refuses by name before persisting.
30969
- */
30970
- setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
30971
- kind: "mutation",
30972
- auth: "admin"
30973
- })
30974
- }
30975
- };
30976
- /**
30977
31115
  * Optional client-side hints sent at session creation to help the provider
30978
31116
  * pick the best native source. All fields optional — a viewer that knows
30979
31117
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -47463,6 +47601,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
47463
47601
  coverCapability,
47464
47602
  customModelRegistryCapability,
47465
47603
  dataStoreProviderCapability,
47604
+ databaseSnapshotCapability,
47466
47605
  dayNightCapability,
47467
47606
  decoderCapability,
47468
47607
  detectionPipelineCapability,
@@ -48725,6 +48864,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
48725
48864
  addonId: null,
48726
48865
  access: "view"
48727
48866
  },
48867
+ "databaseSnapshot.listDatabases": {
48868
+ capName: "database-snapshot",
48869
+ capScope: "system",
48870
+ addonId: null,
48871
+ access: "view"
48872
+ },
48873
+ "databaseSnapshot.writeSnapshot": {
48874
+ capName: "database-snapshot",
48875
+ capScope: "system",
48876
+ addonId: null,
48877
+ access: "create"
48878
+ },
48728
48879
  "dataStoreProvider.aggregate": {
48729
48880
  capName: "data-store-provider",
48730
48881
  capScope: "system",
@@ -57553,6 +57704,18 @@ var STATE_SUMMARY_VARS = [
57553
57704
  systemEventKinds: [...SUMMARISABLE],
57554
57705
  systemEventDeliveries: ["summary"]
57555
57706
  },
57707
+ {
57708
+ name: "summarySection",
57709
+ label: "Summary: this section",
57710
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
57711
+ example: "Batterie scariche",
57712
+ group: "system",
57713
+ families: ["rule"],
57714
+ fields: [...RULE_TEXT],
57715
+ kinds: ["system"],
57716
+ systemEventKinds: [...SUMMARISABLE],
57717
+ systemEventDeliveries: ["summary"]
57718
+ },
57556
57719
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
57557
57720
  name: v.name,
57558
57721
  label: v.label,
@@ -58241,4 +58404,4 @@ function enumerateInferenceDevices(hw) {
58241
58404
  return out;
58242
58405
  }
58243
58406
  //#endregion
58244
- export { compositionSourceRefs as $, WELL_KNOWN_TAB_MAP as $n, parseStreamParamsFormPatch as $t, STORAGE_ACCESS_FALLBACK as A, SOURCE_CAPS as An, isCollectionArrayMethod as At, addonWidgetsCapability as B, evaluateSensorEdge as Bn, locationIconKey as Bt, METHOD_ACCESS_MAP as C, validateComposition as Cn, expandContainer as Ct, REDACTED_SECRET as D, withLocationMode as Dn, formatMinutes as Dt, RECORDING_SOURCE_CAMSTACK_ADDON as E, vectorStoreCapability as En, foldSnapshotByFunction as Et, StorageLocationTypeSchema as F, compositionFeatureEnabled as Fn, kebabToCamel as Ft, batteryCapability as G, DeviceType as Gn, mayWriteToLocation as Gt, authProviderCapability as H, toExpressionValue as Hn, logLevelAtMost as Ht, StorageMigrationJobSchema as I, compositionItemFieldPath as In, legacyAutoLinkIds as It, buildStreamParamsConfigSchema as J, DATAPLANE_SECRET_HEADER as Jn, modeMayWrite as Jt, buildCapabilityLookup as K, errMsg as Kn, memoizePinnedFfmpeg as Kt, UserRecordSchema as L, compositionSliceKey as Ln, legacyModeOf as Lt, ScopedTokenSchema as M, cloneStatefulExpressionMemory as Mn, isObjectInput as Mt, StorageCleanupJobSchema as N, composedDeviceRef as Nn, isSameAddonId as Nt, RUNTIME_DEFAULTS as O, COMPOSER_ADDON_ID as On, gbToBytes as Ot, StorageLocationModeSchema as P, composedDeviceStableId as Pn, isVoidInput as Pt, compositionFieldKey as Q, ReadinessTimeoutError as Qn, objectInputDeclaresRequiredDeviceId as Qt, addonPagesCapability as R, compositionSourceKey as Rn, lifecycleJobSchema as Rt, LocationIconIdSchema as S, userManagementCapability as Sn, evictionPolicyOfLocation as St, MOTION_CLOSE_AFTER_MS as T, vectorIndexDimConflictError as Tn, filesystemBrowseCapability as Tt, backupCapability as U, DeviceFeature as Un, looseSchema as Ut, alertsCapability as V, isSourceCap as Vn, logDestinationCapability as Vt, bareAddonId as W, DeviceRole as Wn, mayReadLocation as Wt, collectSecretConfigKeys as X, DEVICE_STATUS_METHOD as Xn, normalizeUnit as Xt, cameraGridLayoutCapability as Y, DEVICE_SETTINGS_CONTRIBUTION_METHODS as Yn, motionCapability as Yt, composerCapability as Z, ReadinessRegistry as Zn, objectInputDeclaresAddonId as Zt, FIRST_LEVEL_MACRO_CLASSES as _, storageMigrationCapability as _n, EventCategory as _r, doorbellFeatureSources as _t, BatteryStatusSchema as a, replacedFieldKeys as an, emitReadiness as ar, createDeviceExtensionProvider as at, LOG_LEVEL_RANK as b, streamCatalogCapability as bn, enumerateSchemaFields as bt, COMPOSED_ITEM_FIXED_FIELDS as c, resolveMethodAuth as cn, isDeviceConfigCap as cr, decodeVectorBase64 as ct, CORE_BLOCK_ADDON_PREFIX as d, scopesAllowDeviceCap as dn, parseJsonObject as dr, describeComposableCaps as dt, planComposition as en, asJsonObject as er, coreBlockAddonId as et, CoreBlockSchema as f, scoreRuntimes as fn, parseJsonUnknown as fr, deviceExtensionCapability as ft, DeviceStatusSchema as g, storageCapability as gn, sleep as gr, doorbellCapability as gt, DeclaredDevices as h, snapshotCapability as hn, scopeKey as hr, deviceStatusCapability as ht, BaseDevice as i, reducePoints as in, emitDownForOwnedCaps as ir, coreBlocksCapability as it, STREAM_PROFILE_META as j, buildFfmpegArgs as jn, isLocationEnabled as jt, RecordingStatusSchema as k, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as kn, isArrayOutputSchema as kt, COMPOSER_RUNNER_ID as l, runtimeStatePolicyFor as ln, isEvent as lr, defineExtensionSlotProvider as lt, DERIVED_CAMERA_SILENCED_CAP_NAMES as m, siteZoneKey as mn, resolveCapMount as mr, deviceStateCapability as mt, AlertSchema as n, procedureAuthKey as nn, asString$1 as nr, coreBlockIdFromAddonId as nt, CAMERA_SWITCH_ORDER as o, resolveBucketMs as on, expandCapMethods as or, dataStoreProviderCapability as ot, DAY_NAMES as p, settingsStoreCapability as pn, readinessKey as pr, deviceManagerCapability as pt, buildDoorbellCompositionFeature as q, BaseAddon as qn, metricsProviderCapability as qt, ApiKeyRecordSchema as r, ptzAutotrackCapability as rn, createEvent as rr, coreBlockSourceKind as rt, CAP_NAMES_WITH_STATUS as s, resolveLocationMode as sn, hydrateSchema as sr, declarationOwnerNodeId as st, ALL_CAPABILITY_DEFINITIONS as t, platformProbeCapability as tn, asNumber as tr, coreBlockComposition as tt, CORE_BLOCKS_ADDON_ID as u, scopesAllowAddon as un, nodePin as ur, deriveBatteryPresence as ut, FieldClaimModeSchema as v, storageOccupancyCapability as vn, enumerateInferenceDevices as vt, MINUTES_PER_DAY as w, vectorDimFromBase64 as wn, extractNestedAddonId as wt, LegacyStorageLocationDefaultSchema as x, streamQualityLabel as xn, evaluateCompositionField as xt, FieldClaimSchema as y, storageProviderCapability as yn, enumerateItemArrayFields as yt, addonSettingsCapability as z, createStatefulExpressionMemory as zn, localNetworkCapability as zt };
58407
+ export { collectSecretConfigKeys as $, DEVICE_SETTINGS_CONTRIBUTION_METHODS as $n, motionCapability as $t, REDACTED_SECRET as A, vectorStoreCapability as An, foldSnapshotByFunction as At, UserRecordSchema as B, compositionItemFieldPath as Bn, legacyAutoLinkIds as Bt, LOG_LEVEL_RANK as C, storageProviderCapability as Cn, enumerateItemArrayFields as Ct, MINUTES_PER_DAY as D, validateComposition as Dn, expandContainer as Dt, METHOD_ACCESS_MAP as E, userManagementCapability as En, evictionPolicyOfLocation as Et, ScopedTokenSchema as F, buildFfmpegArgs as Fn, isLocationEnabled as Ft, authProviderCapability as G, isSourceCap as Gn, logDestinationCapability as Gt, addonSettingsCapability as H, compositionSourceKey as Hn, lifecycleJobSchema as Ht, StorageCleanupJobSchema as I, cloneStatefulExpressionMemory as In, isObjectInput as It, batteryCapability as J, DeviceRole as Jn, mayReadLocation as Jt, backupCapability as K, toExpressionValue as Kn, logLevelAtMost as Kt, StorageLocationModeSchema as L, composedDeviceRef as Ln, isSameAddonId as Lt, RecordingStatusSchema as M, COMPOSER_ADDON_ID as Mn, gbToBytes as Mt, STORAGE_ACCESS_FALLBACK as N, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as Nn, isArrayOutputSchema as Nt, MOTION_CLOSE_AFTER_MS as O, vectorDimFromBase64 as On, extractNestedAddonId as Ot, STREAM_PROFILE_META as P, SOURCE_CAPS as Pn, isCollectionArrayMethod as Pt, cameraGridLayoutCapability as Q, DATAPLANE_SECRET_HEADER as Qn, modeMayWrite as Qt, StorageLocationTypeSchema as R, composedDeviceStableId as Rn, isVoidInput as Rt, FieldClaimSchema as S, storageOccupancyCapability as Sn, EventCategory as Sr, enumerateInferenceDevices as St, LocationIconIdSchema as T, streamQualityLabel as Tn, evaluateCompositionField as Tt, addonWidgetsCapability as U, createStatefulExpressionMemory as Un, localNetworkCapability as Ut, addonPagesCapability as V, compositionSliceKey as Vn, legacyModeOf as Vt, alertsCapability as W, evaluateSensorEdge as Wn, locationIconKey as Wt, buildDoorbellCompositionFeature as X, errMsg as Xn, memoizePinnedFfmpeg as Xt, buildCapabilityLookup as Y, DeviceType as Yn, mayWriteToLocation as Yt, buildStreamParamsConfigSchema as Z, BaseAddon as Zn, metricsProviderCapability as Zt, DERIVED_CAMERA_SILENCED_CAP_NAMES as _, settingsStoreCapability as _n, readinessKey as _r, deviceManagerCapability as _t, BatteryStatusSchema as a, platformProbeCapability as an, asNumber as ar, coreBlockIdFromAddonId as at, FIRST_LEVEL_MACRO_CLASSES as b, storageCapability as bn, sleep as br, doorbellCapability as bt, COMPOSED_ITEM_FIXED_FIELDS as c, reducePoints as cn, emitDownForOwnedCaps as cr, createDeviceExtensionProvider as ct, CORE_BLOCK_ADDON_PREFIX as d, resolveLocationMode as dn, hydrateSchema as dr, declarationOwnerNodeId as dt, normalizeUnit as en, DEVICE_STATUS_METHOD as er, composerCapability as et, CoreBlockSchema as f, resolveMethodAuth as fn, isDeviceConfigCap as fr, decodeVectorBase64 as ft, DAY_NAMES as g, scoreRuntimes as gn, parseJsonUnknown as gr, deviceExtensionCapability as gt, DATABASE_SNAPSHOT_TIMEOUT_MS as h, scopesAllowDeviceCap as hn, parseJsonObject as hr, describeComposableCaps as ht, BaseDevice as i, planComposition as in, asJsonObject as ir, coreBlockComposition as it, RUNTIME_DEFAULTS as j, withLocationMode as jn, formatMinutes as jt, RECORDING_SOURCE_CAMSTACK_ADDON as k, vectorIndexDimConflictError as kn, filesystemBrowseCapability as kt, COMPOSER_RUNNER_ID as l, replacedFieldKeys as ln, emitReadiness as lr, dataStoreProviderCapability as lt, DATABASE_SNAPSHOT_SUFFIX as m, scopesAllowAddon as mn, nodePin as mr, deriveBatteryPresence as mt, AlertSchema as n, objectInputDeclaresRequiredDeviceId as nn, ReadinessTimeoutError as nr, compositionSourceRefs as nt, CAMERA_SWITCH_ORDER as o, procedureAuthKey as on, asString$1 as or, coreBlockSourceKind as ot, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as p, runtimeStatePolicyFor as pn, isEvent as pr, defineExtensionSlotProvider as pt, bareAddonId as q, DeviceFeature as qn, looseSchema as qt, ApiKeyRecordSchema as r, parseStreamParamsFormPatch as rn, WELL_KNOWN_TAB_MAP as rr, coreBlockAddonId as rt, CAP_NAMES_WITH_STATUS as s, ptzAutotrackCapability as sn, createEvent as sr, coreBlocksCapability as st, ALL_CAPABILITY_DEFINITIONS as t, objectInputDeclaresAddonId as tn, ReadinessRegistry as tr, compositionFieldKey as tt, CORE_BLOCKS_ADDON_ID as u, resolveBucketMs as un, expandCapMethods as ur, databaseSnapshotCapability as ut, DeclaredDevices as v, siteZoneKey as vn, resolveCapMount as vr, deviceStateCapability as vt, LegacyStorageLocationDefaultSchema as w, streamCatalogCapability as wn, enumerateSchemaFields as wt, FieldClaimModeSchema as x, storageMigrationCapability as xn, toNodeId as xr, doorbellFeatureSources as xt, DeviceStatusSchema as y, snapshotCapability as yn, scopeKey as yr, deviceStatusCapability as yt, StorageMigrationJobSchema as z, compositionFeatureEnabled as zn, kebabToCamel as zt };