@camstack/addon-provider-onvif 1.2.76 → 1.2.78

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 (3) hide show
  1. package/dist/addon.js +158 -141
  2. package/dist/addon.mjs +158 -141
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7614,111 +7614,6 @@ var CameraSwitchGroupSchema = object({
7614
7614
  fetchedAt: number()
7615
7615
  });
7616
7616
  /**
7617
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7618
- * an addon declares its channels in.
7619
- *
7620
- * ## Two axes, deliberately separated
7621
- *
7622
- * - **DECLARATION** — which channels exist. Only the addon knows:
7623
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7624
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7625
- * and rots silently. So a channel is declared where it is consulted, and the
7626
- * `log-channels` capability enumerates the declarations.
7627
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7628
- * thing: the logging settings document on the `system` cap. Two authorities
7629
- * over the values is the exact defect
7630
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7631
- * remove; re-introducing it from the cure side would be grotesque.
7632
- *
7633
- * Nothing in this file reads a clock, an env var or a store. The registry is
7634
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7635
- * the hot path with a value somebody actually read, and by
7636
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7637
- * never reaches here, so it can neither disarm an armed channel nor arm a
7638
- * disarmed one (D49).
7639
- *
7640
- * ## The canonical call shape
7641
- *
7642
- * ```ts
7643
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7644
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7645
- * }
7646
- * ```
7647
- *
7648
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7649
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7650
- * object literal is never constructed because it lives inside the branch. It
7651
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7652
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7653
- * destination floor (measured at 1.93 ns/call when off).
7654
- *
7655
- * ## Why a channel emits at `info`
7656
- *
7657
- * `loki-logging.addon.ts` pins the destination default at `info` and
7658
- * `loki-destination.ts` drops everything below it, so a line emitted at
7659
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7660
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7661
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7662
- * emits at the channel's declared level, whose schema floor is `info`.
7663
- */
7664
- /**
7665
- * The level a channel writes at once armed.
7666
- *
7667
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7668
- * not leave the process for Loki, and the whole point of arming a channel is
7669
- * to read it later.
7670
- */
7671
- var LogChannelLevelSchema = _enum([
7672
- "info",
7673
- "warn",
7674
- "error"
7675
- ]);
7676
- /**
7677
- * What an addon declares about one channel. No value, no state — a
7678
- * declaration is inert.
7679
- */
7680
- var LogChannelDescriptorSchema = object({
7681
- /**
7682
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7683
- * the addon's short name so an operator reading a channel list can tell who
7684
- * owns it without a second lookup.
7685
- */
7686
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7687
- /** One sentence: what the operator will SEE after arming it. */
7688
- description: string().min(1),
7689
- /** The level its lines are emitted at. Never below `info`. */
7690
- defaultLevel: LogChannelLevelSchema,
7691
- /**
7692
- * Whether this channel can be narrowed to a camera.
7693
- *
7694
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7695
- * consulted with the numeric device id, AND every line the channel admits
7696
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7697
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7698
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7699
- * the body is the only way to filter.
7700
- *
7701
- * A channel whose lines carry the device only in `meta` (or not at all) is
7702
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7703
- * the operator narrows to one camera, sees nothing, and concludes the code
7704
- * path was never taken.
7705
- */
7706
- perDevice: boolean()
7707
- });
7708
- /**
7709
- * An armed window over one channel, as the document hands it to a mirror.
7710
- *
7711
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7712
- * expires by itself, which is the one failure a boolean cannot avoid.
7713
- */
7714
- var LogChannelWindowSchema = object({
7715
- channel: string().min(1),
7716
- /** Epoch ms the window closes at. */
7717
- armedUntilMs: number(),
7718
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7719
- deviceIds: array(number().int()).readonly().nullable()
7720
- });
7721
- /**
7722
7617
  * Ops-log — the durable, append-only operations audit shared by the
7723
7618
  * recordings and events management surfaces.
7724
7619
  *
@@ -8664,8 +8559,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8664
8559
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8665
8560
  *
8666
8561
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8667
- * The default location for a type uses `id === <type>:default` by
8668
- * convention (the bare type ref like `'backups'` resolves to it).
8562
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8563
+ * There is no default location any more (D383): `enabled` is the whole write
8564
+ * model, and a bare type ref resolves to the sole location of the type, or —
8565
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8566
+ * slug is `default`.
8669
8567
  *
8670
8568
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8671
8569
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8686,21 +8584,20 @@ var StorageLocationSchema = object({
8686
8584
  * flag at upsert time, not here (the schema is provider-agnostic).
8687
8585
  */
8688
8586
  nodeId: string().optional(),
8689
- isDefault: boolean().default(false),
8690
8587
  isSystem: boolean().default(false),
8691
8588
  /**
8692
- * Operator opt-in: whether consumers that BALANCE across several locations
8693
- * of a type may write here. Recordings reads it today; event media and
8694
- * backups are the next consumers, which is why the flag lives on the
8695
- * location rather than in any one addon's store nothing has to be
8696
- * extended to add the next consumer.
8589
+ * THE write switch, and the only one (D383). `enabled: true` means every
8590
+ * consumer that chooses a write target for this type may write here, and all
8591
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8592
+ * still read, still played back, still age-swept, still drained, never
8593
+ * written.
8697
8594
  *
8698
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8699
- * flag existed reads back with no flag and keeps working exactly as before;
8700
- * that is the whole compat story, and it is why no migration ships with it.
8701
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8702
- * disk must not silently start writing to it); the default of a type is
8703
- * always stamped `true`.
8595
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8596
+ * stored" on an update and "born inert unless it is the first location of its
8597
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8598
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8599
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8600
+ * stops existing rather than being re-derived on every read.
8704
8601
  */
8705
8602
  enabled: boolean().optional(),
8706
8603
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8713,10 +8610,12 @@ var StorageLocationSchema = object({
8713
8610
  createdAt: number(),
8714
8611
  updatedAt: number()
8715
8612
  });
8613
+ object({ isDefault: boolean().optional() });
8716
8614
  /**
8717
8615
  * Reference accepted by consumer-facing `api.storage.*` calls.
8718
8616
  * Either:
8719
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8617
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8618
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8720
8619
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8721
8620
  *
8722
8621
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8892,6 +8791,111 @@ var DecoderSessionConfigSchema = object({
8892
8791
  */
8893
8792
  debug: boolean().optional()
8894
8793
  });
8794
+ /**
8795
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8796
+ * an addon declares its channels in.
8797
+ *
8798
+ * ## Two axes, deliberately separated
8799
+ *
8800
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8801
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8802
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8803
+ * and rots silently. So a channel is declared where it is consulted, and the
8804
+ * `log-channels` capability enumerates the declarations.
8805
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8806
+ * thing: the logging settings document on the `system` cap. Two authorities
8807
+ * over the values is the exact defect
8808
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8809
+ * remove; re-introducing it from the cure side would be grotesque.
8810
+ *
8811
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8812
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8813
+ * the hot path with a value somebody actually read, and by
8814
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8815
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8816
+ * disarmed one (D49).
8817
+ *
8818
+ * ## The canonical call shape
8819
+ *
8820
+ * ```ts
8821
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8822
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8823
+ * }
8824
+ * ```
8825
+ *
8826
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8827
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8828
+ * object literal is never constructed because it lives inside the branch. It
8829
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8830
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8831
+ * destination floor (measured at 1.93 ns/call when off).
8832
+ *
8833
+ * ## Why a channel emits at `info`
8834
+ *
8835
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8836
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8837
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8838
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8839
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8840
+ * emits at the channel's declared level, whose schema floor is `info`.
8841
+ */
8842
+ /**
8843
+ * The level a channel writes at once armed.
8844
+ *
8845
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8846
+ * not leave the process for Loki, and the whole point of arming a channel is
8847
+ * to read it later.
8848
+ */
8849
+ var LogChannelLevelSchema = _enum([
8850
+ "info",
8851
+ "warn",
8852
+ "error"
8853
+ ]);
8854
+ /**
8855
+ * What an addon declares about one channel. No value, no state — a
8856
+ * declaration is inert.
8857
+ */
8858
+ var LogChannelDescriptorSchema = object({
8859
+ /**
8860
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8861
+ * the addon's short name so an operator reading a channel list can tell who
8862
+ * owns it without a second lookup.
8863
+ */
8864
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8865
+ /** One sentence: what the operator will SEE after arming it. */
8866
+ description: string().min(1),
8867
+ /** The level its lines are emitted at. Never below `info`. */
8868
+ defaultLevel: LogChannelLevelSchema,
8869
+ /**
8870
+ * Whether this channel can be narrowed to a camera.
8871
+ *
8872
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8873
+ * consulted with the numeric device id, AND every line the channel admits
8874
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8875
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8876
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8877
+ * the body is the only way to filter.
8878
+ *
8879
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8880
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8881
+ * the operator narrows to one camera, sees nothing, and concludes the code
8882
+ * path was never taken.
8883
+ */
8884
+ perDevice: boolean()
8885
+ });
8886
+ /**
8887
+ * An armed window over one channel, as the document hands it to a mirror.
8888
+ *
8889
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8890
+ * expires by itself, which is the one failure a boolean cannot avoid.
8891
+ */
8892
+ var LogChannelWindowSchema = object({
8893
+ channel: string().min(1),
8894
+ /** Epoch ms the window closes at. */
8895
+ armedUntilMs: number(),
8896
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8897
+ deviceIds: array(number().int()).readonly().nullable()
8898
+ });
8895
8899
  var MODEL_FORMATS = [
8896
8900
  "onnx",
8897
8901
  "coreml",
@@ -10548,12 +10552,30 @@ var BackupDestinationInfoSchema = object({
10548
10552
  lastSuccessAt: number().optional(),
10549
10553
  /** Newest-archive size from `manifests.json`, or undefined. */
10550
10554
  lastSuccessSizeBytes: number().optional(),
10551
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10555
+ /**
10556
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10557
+ * destination, comma-joined. Absent when no enabled schedule targets it
10558
+ * — a destination nothing is scheduled to write to must not advertise a
10559
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10560
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10561
+ * and reading it made a destination with a DISABLED schedule claim a
10562
+ * nightly run.
10563
+ */
10552
10564
  cron: string().optional(),
10553
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10565
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10554
10566
  nextRunAt: number().optional(),
10555
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10556
- lastRunAt: number().optional()
10567
+ /**
10568
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10569
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10570
+ * newest archive that actually landed) and `lastError`.
10571
+ */
10572
+ lastAttemptAt: number().optional(),
10573
+ /**
10574
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10575
+ * landed the archive. A destination that has never been written to has
10576
+ * neither this nor `lastAttemptAt`.
10577
+ */
10578
+ lastError: string().optional()
10557
10579
  });
10558
10580
  /**
10559
10581
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10716,8 +10738,16 @@ var BackupScheduleSchema = object({
10716
10738
  retentionCount: number().int().min(1).max(1e3),
10717
10739
  /** Optional subset of source locations to include; omitted = all. */
10718
10740
  dataSources: array(string()).readonly().optional(),
10719
- /** ms-epoch of last successful run. */
10720
- lastRunAt: number().optional(),
10741
+ /**
10742
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10743
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10744
+ * "succeeded" — a run refused by every destination stamps it too.
10745
+ */
10746
+ lastAttemptAt: number().optional(),
10747
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10748
+ lastSuccessAt: number().optional(),
10749
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10750
+ lastError: string().optional(),
10721
10751
  /** ms-epoch of next computed firing (read-only, filled on list). */
10722
10752
  nextRunAt: number().optional()
10723
10753
  });
@@ -10766,14 +10796,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10766
10796
  locationId: string(),
10767
10797
  enabled: boolean(),
10768
10798
  retentionCount: number().int().min(1).max(1e3),
10769
- label: string().optional(),
10770
- /**
10771
- * Per-destination cron expression. Empty string clears the
10772
- * schedule (manual-only). Validated server-side via croner;
10773
- * malformed expressions reject the upsert with an actionable
10774
- * message.
10775
- */
10776
- cron: string().optional()
10799
+ label: string().optional()
10777
10800
  }), _void(), {
10778
10801
  kind: "mutation",
10779
10802
  auth: "admin"
@@ -21722,7 +21745,7 @@ method(object({
21722
21745
  downloadId: string(),
21723
21746
  offset: number(),
21724
21747
  length: number()
21725
- }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(object({ type: StorageLocationTypeSchema }), StorageLocationSchema.nullable()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
21748
+ }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
21726
21749
  createdAt: true,
21727
21750
  updatedAt: true
21728
21751
  }), StorageLocationSchema, {
@@ -35439,12 +35462,6 @@ Object.freeze({
35439
35462
  addonId: null,
35440
35463
  access: "view"
35441
35464
  },
35442
- "storage.getDefaultLocation": {
35443
- capName: "storage",
35444
- capScope: "system",
35445
- addonId: null,
35446
- access: "view"
35447
- },
35448
35465
  "storage.list": {
35449
35466
  capName: "storage",
35450
35467
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7615,111 +7615,6 @@ var CameraSwitchGroupSchema = object({
7615
7615
  fetchedAt: number()
7616
7616
  });
7617
7617
  /**
7618
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7619
- * an addon declares its channels in.
7620
- *
7621
- * ## Two axes, deliberately separated
7622
- *
7623
- * - **DECLARATION** — which channels exist. Only the addon knows:
7624
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7625
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7626
- * and rots silently. So a channel is declared where it is consulted, and the
7627
- * `log-channels` capability enumerates the declarations.
7628
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7629
- * thing: the logging settings document on the `system` cap. Two authorities
7630
- * over the values is the exact defect
7631
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7632
- * remove; re-introducing it from the cure side would be grotesque.
7633
- *
7634
- * Nothing in this file reads a clock, an env var or a store. The registry is
7635
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7636
- * the hot path with a value somebody actually read, and by
7637
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7638
- * never reaches here, so it can neither disarm an armed channel nor arm a
7639
- * disarmed one (D49).
7640
- *
7641
- * ## The canonical call shape
7642
- *
7643
- * ```ts
7644
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7645
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7646
- * }
7647
- * ```
7648
- *
7649
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7650
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7651
- * object literal is never constructed because it lives inside the branch. It
7652
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7653
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7654
- * destination floor (measured at 1.93 ns/call when off).
7655
- *
7656
- * ## Why a channel emits at `info`
7657
- *
7658
- * `loki-logging.addon.ts` pins the destination default at `info` and
7659
- * `loki-destination.ts` drops everything below it, so a line emitted at
7660
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7661
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7662
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7663
- * emits at the channel's declared level, whose schema floor is `info`.
7664
- */
7665
- /**
7666
- * The level a channel writes at once armed.
7667
- *
7668
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7669
- * not leave the process for Loki, and the whole point of arming a channel is
7670
- * to read it later.
7671
- */
7672
- var LogChannelLevelSchema = _enum([
7673
- "info",
7674
- "warn",
7675
- "error"
7676
- ]);
7677
- /**
7678
- * What an addon declares about one channel. No value, no state — a
7679
- * declaration is inert.
7680
- */
7681
- var LogChannelDescriptorSchema = object({
7682
- /**
7683
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7684
- * the addon's short name so an operator reading a channel list can tell who
7685
- * owns it without a second lookup.
7686
- */
7687
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7688
- /** One sentence: what the operator will SEE after arming it. */
7689
- description: string().min(1),
7690
- /** The level its lines are emitted at. Never below `info`. */
7691
- defaultLevel: LogChannelLevelSchema,
7692
- /**
7693
- * Whether this channel can be narrowed to a camera.
7694
- *
7695
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7696
- * consulted with the numeric device id, AND every line the channel admits
7697
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7698
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7699
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7700
- * the body is the only way to filter.
7701
- *
7702
- * A channel whose lines carry the device only in `meta` (or not at all) is
7703
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7704
- * the operator narrows to one camera, sees nothing, and concludes the code
7705
- * path was never taken.
7706
- */
7707
- perDevice: boolean()
7708
- });
7709
- /**
7710
- * An armed window over one channel, as the document hands it to a mirror.
7711
- *
7712
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7713
- * expires by itself, which is the one failure a boolean cannot avoid.
7714
- */
7715
- var LogChannelWindowSchema = object({
7716
- channel: string().min(1),
7717
- /** Epoch ms the window closes at. */
7718
- armedUntilMs: number(),
7719
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7720
- deviceIds: array(number().int()).readonly().nullable()
7721
- });
7722
- /**
7723
7618
  * Ops-log — the durable, append-only operations audit shared by the
7724
7619
  * recordings and events management surfaces.
7725
7620
  *
@@ -8665,8 +8560,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8665
8560
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8666
8561
  *
8667
8562
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8668
- * The default location for a type uses `id === <type>:default` by
8669
- * convention (the bare type ref like `'backups'` resolves to it).
8563
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8564
+ * There is no default location any more (D383): `enabled` is the whole write
8565
+ * model, and a bare type ref resolves to the sole location of the type, or —
8566
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8567
+ * slug is `default`.
8670
8568
  *
8671
8569
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8672
8570
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8687,21 +8585,20 @@ var StorageLocationSchema = object({
8687
8585
  * flag at upsert time, not here (the schema is provider-agnostic).
8688
8586
  */
8689
8587
  nodeId: string().optional(),
8690
- isDefault: boolean().default(false),
8691
8588
  isSystem: boolean().default(false),
8692
8589
  /**
8693
- * Operator opt-in: whether consumers that BALANCE across several locations
8694
- * of a type may write here. Recordings reads it today; event media and
8695
- * backups are the next consumers, which is why the flag lives on the
8696
- * location rather than in any one addon's store nothing has to be
8697
- * extended to add the next consumer.
8590
+ * THE write switch, and the only one (D383). `enabled: true` means every
8591
+ * consumer that chooses a write target for this type may write here, and all
8592
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8593
+ * still read, still played back, still age-swept, still drained, never
8594
+ * written.
8698
8595
  *
8699
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8700
- * flag existed reads back with no flag and keeps working exactly as before;
8701
- * that is the whole compat story, and it is why no migration ships with it.
8702
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8703
- * disk must not silently start writing to it); the default of a type is
8704
- * always stamped `true`.
8596
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8597
+ * stored" on an update and "born inert unless it is the first location of its
8598
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8599
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8600
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8601
+ * stops existing rather than being re-derived on every read.
8705
8602
  */
8706
8603
  enabled: boolean().optional(),
8707
8604
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8714,10 +8611,12 @@ var StorageLocationSchema = object({
8714
8611
  createdAt: number(),
8715
8612
  updatedAt: number()
8716
8613
  });
8614
+ object({ isDefault: boolean().optional() });
8717
8615
  /**
8718
8616
  * Reference accepted by consumer-facing `api.storage.*` calls.
8719
8617
  * Either:
8720
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8618
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8619
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8721
8620
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8722
8621
  *
8723
8622
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8893,6 +8792,111 @@ var DecoderSessionConfigSchema = object({
8893
8792
  */
8894
8793
  debug: boolean().optional()
8895
8794
  });
8795
+ /**
8796
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8797
+ * an addon declares its channels in.
8798
+ *
8799
+ * ## Two axes, deliberately separated
8800
+ *
8801
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8802
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8803
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8804
+ * and rots silently. So a channel is declared where it is consulted, and the
8805
+ * `log-channels` capability enumerates the declarations.
8806
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8807
+ * thing: the logging settings document on the `system` cap. Two authorities
8808
+ * over the values is the exact defect
8809
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8810
+ * remove; re-introducing it from the cure side would be grotesque.
8811
+ *
8812
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8813
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8814
+ * the hot path with a value somebody actually read, and by
8815
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8816
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8817
+ * disarmed one (D49).
8818
+ *
8819
+ * ## The canonical call shape
8820
+ *
8821
+ * ```ts
8822
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8823
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8824
+ * }
8825
+ * ```
8826
+ *
8827
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8828
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8829
+ * object literal is never constructed because it lives inside the branch. It
8830
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8831
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8832
+ * destination floor (measured at 1.93 ns/call when off).
8833
+ *
8834
+ * ## Why a channel emits at `info`
8835
+ *
8836
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8837
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8838
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8839
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8840
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8841
+ * emits at the channel's declared level, whose schema floor is `info`.
8842
+ */
8843
+ /**
8844
+ * The level a channel writes at once armed.
8845
+ *
8846
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8847
+ * not leave the process for Loki, and the whole point of arming a channel is
8848
+ * to read it later.
8849
+ */
8850
+ var LogChannelLevelSchema = _enum([
8851
+ "info",
8852
+ "warn",
8853
+ "error"
8854
+ ]);
8855
+ /**
8856
+ * What an addon declares about one channel. No value, no state — a
8857
+ * declaration is inert.
8858
+ */
8859
+ var LogChannelDescriptorSchema = object({
8860
+ /**
8861
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8862
+ * the addon's short name so an operator reading a channel list can tell who
8863
+ * owns it without a second lookup.
8864
+ */
8865
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8866
+ /** One sentence: what the operator will SEE after arming it. */
8867
+ description: string().min(1),
8868
+ /** The level its lines are emitted at. Never below `info`. */
8869
+ defaultLevel: LogChannelLevelSchema,
8870
+ /**
8871
+ * Whether this channel can be narrowed to a camera.
8872
+ *
8873
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8874
+ * consulted with the numeric device id, AND every line the channel admits
8875
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8876
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8877
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8878
+ * the body is the only way to filter.
8879
+ *
8880
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8881
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8882
+ * the operator narrows to one camera, sees nothing, and concludes the code
8883
+ * path was never taken.
8884
+ */
8885
+ perDevice: boolean()
8886
+ });
8887
+ /**
8888
+ * An armed window over one channel, as the document hands it to a mirror.
8889
+ *
8890
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8891
+ * expires by itself, which is the one failure a boolean cannot avoid.
8892
+ */
8893
+ var LogChannelWindowSchema = object({
8894
+ channel: string().min(1),
8895
+ /** Epoch ms the window closes at. */
8896
+ armedUntilMs: number(),
8897
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8898
+ deviceIds: array(number().int()).readonly().nullable()
8899
+ });
8896
8900
  var MODEL_FORMATS = [
8897
8901
  "onnx",
8898
8902
  "coreml",
@@ -10549,12 +10553,30 @@ var BackupDestinationInfoSchema = object({
10549
10553
  lastSuccessAt: number().optional(),
10550
10554
  /** Newest-archive size from `manifests.json`, or undefined. */
10551
10555
  lastSuccessSizeBytes: number().optional(),
10552
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10556
+ /**
10557
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10558
+ * destination, comma-joined. Absent when no enabled schedule targets it
10559
+ * — a destination nothing is scheduled to write to must not advertise a
10560
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10561
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10562
+ * and reading it made a destination with a DISABLED schedule claim a
10563
+ * nightly run.
10564
+ */
10553
10565
  cron: string().optional(),
10554
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10566
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10555
10567
  nextRunAt: number().optional(),
10556
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10557
- lastRunAt: number().optional()
10568
+ /**
10569
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10570
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10571
+ * newest archive that actually landed) and `lastError`.
10572
+ */
10573
+ lastAttemptAt: number().optional(),
10574
+ /**
10575
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10576
+ * landed the archive. A destination that has never been written to has
10577
+ * neither this nor `lastAttemptAt`.
10578
+ */
10579
+ lastError: string().optional()
10558
10580
  });
10559
10581
  /**
10560
10582
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10717,8 +10739,16 @@ var BackupScheduleSchema = object({
10717
10739
  retentionCount: number().int().min(1).max(1e3),
10718
10740
  /** Optional subset of source locations to include; omitted = all. */
10719
10741
  dataSources: array(string()).readonly().optional(),
10720
- /** ms-epoch of last successful run. */
10721
- lastRunAt: number().optional(),
10742
+ /**
10743
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10744
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10745
+ * "succeeded" — a run refused by every destination stamps it too.
10746
+ */
10747
+ lastAttemptAt: number().optional(),
10748
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10749
+ lastSuccessAt: number().optional(),
10750
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10751
+ lastError: string().optional(),
10722
10752
  /** ms-epoch of next computed firing (read-only, filled on list). */
10723
10753
  nextRunAt: number().optional()
10724
10754
  });
@@ -10767,14 +10797,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10767
10797
  locationId: string(),
10768
10798
  enabled: boolean(),
10769
10799
  retentionCount: number().int().min(1).max(1e3),
10770
- label: string().optional(),
10771
- /**
10772
- * Per-destination cron expression. Empty string clears the
10773
- * schedule (manual-only). Validated server-side via croner;
10774
- * malformed expressions reject the upsert with an actionable
10775
- * message.
10776
- */
10777
- cron: string().optional()
10800
+ label: string().optional()
10778
10801
  }), _void(), {
10779
10802
  kind: "mutation",
10780
10803
  auth: "admin"
@@ -21723,7 +21746,7 @@ method(object({
21723
21746
  downloadId: string(),
21724
21747
  offset: number(),
21725
21748
  length: number()
21726
- }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(object({ type: StorageLocationTypeSchema }), StorageLocationSchema.nullable()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
21749
+ }), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
21727
21750
  createdAt: true,
21728
21751
  updatedAt: true
21729
21752
  }), StorageLocationSchema, {
@@ -35440,12 +35463,6 @@ Object.freeze({
35440
35463
  addonId: null,
35441
35464
  access: "view"
35442
35465
  },
35443
- "storage.getDefaultLocation": {
35444
- capName: "storage",
35445
- capScope: "system",
35446
- addonId: null,
35447
- access: "view"
35448
- },
35449
35466
  "storage.list": {
35450
35467
  capName: "storage",
35451
35468
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.2.76",
3
+ "version": "1.2.78",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",