@camstack/addon-provider-rtsp 1.2.77 → 1.2.79

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
@@ -7671,111 +7671,6 @@ function classifyStreams(streams) {
7671
7671
  return result;
7672
7672
  }
7673
7673
  /**
7674
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7675
- * an addon declares its channels in.
7676
- *
7677
- * ## Two axes, deliberately separated
7678
- *
7679
- * - **DECLARATION** — which channels exist. Only the addon knows:
7680
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7681
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7682
- * and rots silently. So a channel is declared where it is consulted, and the
7683
- * `log-channels` capability enumerates the declarations.
7684
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7685
- * thing: the logging settings document on the `system` cap. Two authorities
7686
- * over the values is the exact defect
7687
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7688
- * remove; re-introducing it from the cure side would be grotesque.
7689
- *
7690
- * Nothing in this file reads a clock, an env var or a store. The registry is
7691
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7692
- * the hot path with a value somebody actually read, and by
7693
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7694
- * never reaches here, so it can neither disarm an armed channel nor arm a
7695
- * disarmed one (D49).
7696
- *
7697
- * ## The canonical call shape
7698
- *
7699
- * ```ts
7700
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7701
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7702
- * }
7703
- * ```
7704
- *
7705
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7706
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7707
- * object literal is never constructed because it lives inside the branch. It
7708
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7709
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7710
- * destination floor (measured at 1.93 ns/call when off).
7711
- *
7712
- * ## Why a channel emits at `info`
7713
- *
7714
- * `loki-logging.addon.ts` pins the destination default at `info` and
7715
- * `loki-destination.ts` drops everything below it, so a line emitted at
7716
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7717
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7718
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7719
- * emits at the channel's declared level, whose schema floor is `info`.
7720
- */
7721
- /**
7722
- * The level a channel writes at once armed.
7723
- *
7724
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7725
- * not leave the process for Loki, and the whole point of arming a channel is
7726
- * to read it later.
7727
- */
7728
- var LogChannelLevelSchema = _enum([
7729
- "info",
7730
- "warn",
7731
- "error"
7732
- ]);
7733
- /**
7734
- * What an addon declares about one channel. No value, no state — a
7735
- * declaration is inert.
7736
- */
7737
- var LogChannelDescriptorSchema = object({
7738
- /**
7739
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7740
- * the addon's short name so an operator reading a channel list can tell who
7741
- * owns it without a second lookup.
7742
- */
7743
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7744
- /** One sentence: what the operator will SEE after arming it. */
7745
- description: string().min(1),
7746
- /** The level its lines are emitted at. Never below `info`. */
7747
- defaultLevel: LogChannelLevelSchema,
7748
- /**
7749
- * Whether this channel can be narrowed to a camera.
7750
- *
7751
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7752
- * consulted with the numeric device id, AND every line the channel admits
7753
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7754
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7755
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7756
- * the body is the only way to filter.
7757
- *
7758
- * A channel whose lines carry the device only in `meta` (or not at all) is
7759
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7760
- * the operator narrows to one camera, sees nothing, and concludes the code
7761
- * path was never taken.
7762
- */
7763
- perDevice: boolean()
7764
- });
7765
- /**
7766
- * An armed window over one channel, as the document hands it to a mirror.
7767
- *
7768
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7769
- * expires by itself, which is the one failure a boolean cannot avoid.
7770
- */
7771
- var LogChannelWindowSchema = object({
7772
- channel: string().min(1),
7773
- /** Epoch ms the window closes at. */
7774
- armedUntilMs: number(),
7775
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7776
- deviceIds: array(number().int()).readonly().nullable()
7777
- });
7778
- /**
7779
7674
  * Ops-log — the durable, append-only operations audit shared by the
7780
7675
  * recordings and events management surfaces.
7781
7676
  *
@@ -8721,8 +8616,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8721
8616
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8722
8617
  *
8723
8618
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8724
- * The default location for a type uses `id === <type>:default` by
8725
- * convention (the bare type ref like `'backups'` resolves to it).
8619
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8620
+ * There is no default location any more (D383): `enabled` is the whole write
8621
+ * model, and a bare type ref resolves to the sole location of the type, or —
8622
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8623
+ * slug is `default`.
8726
8624
  *
8727
8625
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8728
8626
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8743,21 +8641,20 @@ var StorageLocationSchema = object({
8743
8641
  * flag at upsert time, not here (the schema is provider-agnostic).
8744
8642
  */
8745
8643
  nodeId: string().optional(),
8746
- isDefault: boolean().default(false),
8747
8644
  isSystem: boolean().default(false),
8748
8645
  /**
8749
- * Operator opt-in: whether consumers that BALANCE across several locations
8750
- * of a type may write here. Recordings reads it today; event media and
8751
- * backups are the next consumers, which is why the flag lives on the
8752
- * location rather than in any one addon's store nothing has to be
8753
- * extended to add the next consumer.
8646
+ * THE write switch, and the only one (D383). `enabled: true` means every
8647
+ * consumer that chooses a write target for this type may write here, and all
8648
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8649
+ * still read, still played back, still age-swept, still drained, never
8650
+ * written.
8754
8651
  *
8755
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8756
- * flag existed reads back with no flag and keeps working exactly as before;
8757
- * that is the whole compat story, and it is why no migration ships with it.
8758
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8759
- * disk must not silently start writing to it); the default of a type is
8760
- * always stamped `true`.
8652
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8653
+ * stored" on an update and "born inert unless it is the first location of its
8654
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8655
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8656
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8657
+ * stops existing rather than being re-derived on every read.
8761
8658
  */
8762
8659
  enabled: boolean().optional(),
8763
8660
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8770,10 +8667,12 @@ var StorageLocationSchema = object({
8770
8667
  createdAt: number(),
8771
8668
  updatedAt: number()
8772
8669
  });
8670
+ object({ isDefault: boolean().optional() });
8773
8671
  /**
8774
8672
  * Reference accepted by consumer-facing `api.storage.*` calls.
8775
8673
  * Either:
8776
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8674
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8675
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8777
8676
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8778
8677
  *
8779
8678
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8949,6 +8848,111 @@ var DecoderSessionConfigSchema = object({
8949
8848
  */
8950
8849
  debug: boolean().optional()
8951
8850
  });
8851
+ /**
8852
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8853
+ * an addon declares its channels in.
8854
+ *
8855
+ * ## Two axes, deliberately separated
8856
+ *
8857
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8858
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8859
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8860
+ * and rots silently. So a channel is declared where it is consulted, and the
8861
+ * `log-channels` capability enumerates the declarations.
8862
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8863
+ * thing: the logging settings document on the `system` cap. Two authorities
8864
+ * over the values is the exact defect
8865
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8866
+ * remove; re-introducing it from the cure side would be grotesque.
8867
+ *
8868
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8869
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8870
+ * the hot path with a value somebody actually read, and by
8871
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8872
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8873
+ * disarmed one (D49).
8874
+ *
8875
+ * ## The canonical call shape
8876
+ *
8877
+ * ```ts
8878
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8879
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8880
+ * }
8881
+ * ```
8882
+ *
8883
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8884
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8885
+ * object literal is never constructed because it lives inside the branch. It
8886
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8887
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8888
+ * destination floor (measured at 1.93 ns/call when off).
8889
+ *
8890
+ * ## Why a channel emits at `info`
8891
+ *
8892
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8893
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8894
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8895
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8896
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8897
+ * emits at the channel's declared level, whose schema floor is `info`.
8898
+ */
8899
+ /**
8900
+ * The level a channel writes at once armed.
8901
+ *
8902
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8903
+ * not leave the process for Loki, and the whole point of arming a channel is
8904
+ * to read it later.
8905
+ */
8906
+ var LogChannelLevelSchema = _enum([
8907
+ "info",
8908
+ "warn",
8909
+ "error"
8910
+ ]);
8911
+ /**
8912
+ * What an addon declares about one channel. No value, no state — a
8913
+ * declaration is inert.
8914
+ */
8915
+ var LogChannelDescriptorSchema = object({
8916
+ /**
8917
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8918
+ * the addon's short name so an operator reading a channel list can tell who
8919
+ * owns it without a second lookup.
8920
+ */
8921
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8922
+ /** One sentence: what the operator will SEE after arming it. */
8923
+ description: string().min(1),
8924
+ /** The level its lines are emitted at. Never below `info`. */
8925
+ defaultLevel: LogChannelLevelSchema,
8926
+ /**
8927
+ * Whether this channel can be narrowed to a camera.
8928
+ *
8929
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8930
+ * consulted with the numeric device id, AND every line the channel admits
8931
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8932
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8933
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8934
+ * the body is the only way to filter.
8935
+ *
8936
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8937
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8938
+ * the operator narrows to one camera, sees nothing, and concludes the code
8939
+ * path was never taken.
8940
+ */
8941
+ perDevice: boolean()
8942
+ });
8943
+ /**
8944
+ * An armed window over one channel, as the document hands it to a mirror.
8945
+ *
8946
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8947
+ * expires by itself, which is the one failure a boolean cannot avoid.
8948
+ */
8949
+ var LogChannelWindowSchema = object({
8950
+ channel: string().min(1),
8951
+ /** Epoch ms the window closes at. */
8952
+ armedUntilMs: number(),
8953
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8954
+ deviceIds: array(number().int()).readonly().nullable()
8955
+ });
8952
8956
  var MODEL_FORMATS = [
8953
8957
  "onnx",
8954
8958
  "coreml",
@@ -10605,12 +10609,30 @@ var BackupDestinationInfoSchema = object({
10605
10609
  lastSuccessAt: number().optional(),
10606
10610
  /** Newest-archive size from `manifests.json`, or undefined. */
10607
10611
  lastSuccessSizeBytes: number().optional(),
10608
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10612
+ /**
10613
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10614
+ * destination, comma-joined. Absent when no enabled schedule targets it
10615
+ * — a destination nothing is scheduled to write to must not advertise a
10616
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10617
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10618
+ * and reading it made a destination with a DISABLED schedule claim a
10619
+ * nightly run.
10620
+ */
10609
10621
  cron: string().optional(),
10610
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10622
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10611
10623
  nextRunAt: number().optional(),
10612
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10613
- lastRunAt: number().optional()
10624
+ /**
10625
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10626
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10627
+ * newest archive that actually landed) and `lastError`.
10628
+ */
10629
+ lastAttemptAt: number().optional(),
10630
+ /**
10631
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10632
+ * landed the archive. A destination that has never been written to has
10633
+ * neither this nor `lastAttemptAt`.
10634
+ */
10635
+ lastError: string().optional()
10614
10636
  });
10615
10637
  /**
10616
10638
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10773,8 +10795,16 @@ var BackupScheduleSchema = object({
10773
10795
  retentionCount: number().int().min(1).max(1e3),
10774
10796
  /** Optional subset of source locations to include; omitted = all. */
10775
10797
  dataSources: array(string()).readonly().optional(),
10776
- /** ms-epoch of last successful run. */
10777
- lastRunAt: number().optional(),
10798
+ /**
10799
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10800
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10801
+ * "succeeded" — a run refused by every destination stamps it too.
10802
+ */
10803
+ lastAttemptAt: number().optional(),
10804
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10805
+ lastSuccessAt: number().optional(),
10806
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10807
+ lastError: string().optional(),
10778
10808
  /** ms-epoch of next computed firing (read-only, filled on list). */
10779
10809
  nextRunAt: number().optional()
10780
10810
  });
@@ -10823,14 +10853,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10823
10853
  locationId: string(),
10824
10854
  enabled: boolean(),
10825
10855
  retentionCount: number().int().min(1).max(1e3),
10826
- label: string().optional(),
10827
- /**
10828
- * Per-destination cron expression. Empty string clears the
10829
- * schedule (manual-only). Validated server-side via croner;
10830
- * malformed expressions reject the upsert with an actionable
10831
- * message.
10832
- */
10833
- cron: string().optional()
10856
+ label: string().optional()
10834
10857
  }), _void(), {
10835
10858
  kind: "mutation",
10836
10859
  auth: "admin"
@@ -22066,7 +22089,7 @@ method(object({
22066
22089
  downloadId: string(),
22067
22090
  offset: number(),
22068
22091
  length: number()
22069
- }), _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({
22092
+ }), _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({
22070
22093
  createdAt: true,
22071
22094
  updatedAt: true
22072
22095
  }), StorageLocationSchema, {
@@ -38985,12 +39008,6 @@ Object.freeze({
38985
39008
  addonId: null,
38986
39009
  access: "view"
38987
39010
  },
38988
- "storage.getDefaultLocation": {
38989
- capName: "storage",
38990
- capScope: "system",
38991
- addonId: null,
38992
- access: "view"
38993
- },
38994
39011
  "storage.list": {
38995
39012
  capName: "storage",
38996
39013
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7647,111 +7647,6 @@ function classifyStreams(streams) {
7647
7647
  return result;
7648
7648
  }
7649
7649
  /**
7650
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7651
- * an addon declares its channels in.
7652
- *
7653
- * ## Two axes, deliberately separated
7654
- *
7655
- * - **DECLARATION** — which channels exist. Only the addon knows:
7656
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7657
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7658
- * and rots silently. So a channel is declared where it is consulted, and the
7659
- * `log-channels` capability enumerates the declarations.
7660
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7661
- * thing: the logging settings document on the `system` cap. Two authorities
7662
- * over the values is the exact defect
7663
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7664
- * remove; re-introducing it from the cure side would be grotesque.
7665
- *
7666
- * Nothing in this file reads a clock, an env var or a store. The registry is
7667
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7668
- * the hot path with a value somebody actually read, and by
7669
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7670
- * never reaches here, so it can neither disarm an armed channel nor arm a
7671
- * disarmed one (D49).
7672
- *
7673
- * ## The canonical call shape
7674
- *
7675
- * ```ts
7676
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7677
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7678
- * }
7679
- * ```
7680
- *
7681
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7682
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7683
- * object literal is never constructed because it lives inside the branch. It
7684
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7685
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7686
- * destination floor (measured at 1.93 ns/call when off).
7687
- *
7688
- * ## Why a channel emits at `info`
7689
- *
7690
- * `loki-logging.addon.ts` pins the destination default at `info` and
7691
- * `loki-destination.ts` drops everything below it, so a line emitted at
7692
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7693
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7694
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7695
- * emits at the channel's declared level, whose schema floor is `info`.
7696
- */
7697
- /**
7698
- * The level a channel writes at once armed.
7699
- *
7700
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7701
- * not leave the process for Loki, and the whole point of arming a channel is
7702
- * to read it later.
7703
- */
7704
- var LogChannelLevelSchema = _enum([
7705
- "info",
7706
- "warn",
7707
- "error"
7708
- ]);
7709
- /**
7710
- * What an addon declares about one channel. No value, no state — a
7711
- * declaration is inert.
7712
- */
7713
- var LogChannelDescriptorSchema = object({
7714
- /**
7715
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7716
- * the addon's short name so an operator reading a channel list can tell who
7717
- * owns it without a second lookup.
7718
- */
7719
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7720
- /** One sentence: what the operator will SEE after arming it. */
7721
- description: string().min(1),
7722
- /** The level its lines are emitted at. Never below `info`. */
7723
- defaultLevel: LogChannelLevelSchema,
7724
- /**
7725
- * Whether this channel can be narrowed to a camera.
7726
- *
7727
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7728
- * consulted with the numeric device id, AND every line the channel admits
7729
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7730
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7731
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7732
- * the body is the only way to filter.
7733
- *
7734
- * A channel whose lines carry the device only in `meta` (or not at all) is
7735
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7736
- * the operator narrows to one camera, sees nothing, and concludes the code
7737
- * path was never taken.
7738
- */
7739
- perDevice: boolean()
7740
- });
7741
- /**
7742
- * An armed window over one channel, as the document hands it to a mirror.
7743
- *
7744
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7745
- * expires by itself, which is the one failure a boolean cannot avoid.
7746
- */
7747
- var LogChannelWindowSchema = object({
7748
- channel: string().min(1),
7749
- /** Epoch ms the window closes at. */
7750
- armedUntilMs: number(),
7751
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7752
- deviceIds: array(number().int()).readonly().nullable()
7753
- });
7754
- /**
7755
7650
  * Ops-log — the durable, append-only operations audit shared by the
7756
7651
  * recordings and events management surfaces.
7757
7652
  *
@@ -8697,8 +8592,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8697
8592
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8698
8593
  *
8699
8594
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8700
- * The default location for a type uses `id === <type>:default` by
8701
- * convention (the bare type ref like `'backups'` resolves to it).
8595
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8596
+ * There is no default location any more (D383): `enabled` is the whole write
8597
+ * model, and a bare type ref resolves to the sole location of the type, or —
8598
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8599
+ * slug is `default`.
8702
8600
  *
8703
8601
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8704
8602
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8719,21 +8617,20 @@ var StorageLocationSchema = object({
8719
8617
  * flag at upsert time, not here (the schema is provider-agnostic).
8720
8618
  */
8721
8619
  nodeId: string().optional(),
8722
- isDefault: boolean().default(false),
8723
8620
  isSystem: boolean().default(false),
8724
8621
  /**
8725
- * Operator opt-in: whether consumers that BALANCE across several locations
8726
- * of a type may write here. Recordings reads it today; event media and
8727
- * backups are the next consumers, which is why the flag lives on the
8728
- * location rather than in any one addon's store nothing has to be
8729
- * extended to add the next consumer.
8622
+ * THE write switch, and the only one (D383). `enabled: true` means every
8623
+ * consumer that chooses a write target for this type may write here, and all
8624
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8625
+ * still read, still played back, still age-swept, still drained, never
8626
+ * written.
8730
8627
  *
8731
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8732
- * flag existed reads back with no flag and keeps working exactly as before;
8733
- * that is the whole compat story, and it is why no migration ships with it.
8734
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8735
- * disk must not silently start writing to it); the default of a type is
8736
- * always stamped `true`.
8628
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8629
+ * stored" on an update and "born inert unless it is the first location of its
8630
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8631
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8632
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8633
+ * stops existing rather than being re-derived on every read.
8737
8634
  */
8738
8635
  enabled: boolean().optional(),
8739
8636
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8746,10 +8643,12 @@ var StorageLocationSchema = object({
8746
8643
  createdAt: number(),
8747
8644
  updatedAt: number()
8748
8645
  });
8646
+ object({ isDefault: boolean().optional() });
8749
8647
  /**
8750
8648
  * Reference accepted by consumer-facing `api.storage.*` calls.
8751
8649
  * Either:
8752
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8650
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8651
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8753
8652
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8754
8653
  *
8755
8654
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8925,6 +8824,111 @@ var DecoderSessionConfigSchema = object({
8925
8824
  */
8926
8825
  debug: boolean().optional()
8927
8826
  });
8827
+ /**
8828
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8829
+ * an addon declares its channels in.
8830
+ *
8831
+ * ## Two axes, deliberately separated
8832
+ *
8833
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8834
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8835
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8836
+ * and rots silently. So a channel is declared where it is consulted, and the
8837
+ * `log-channels` capability enumerates the declarations.
8838
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8839
+ * thing: the logging settings document on the `system` cap. Two authorities
8840
+ * over the values is the exact defect
8841
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8842
+ * remove; re-introducing it from the cure side would be grotesque.
8843
+ *
8844
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8845
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8846
+ * the hot path with a value somebody actually read, and by
8847
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8848
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8849
+ * disarmed one (D49).
8850
+ *
8851
+ * ## The canonical call shape
8852
+ *
8853
+ * ```ts
8854
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8855
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8856
+ * }
8857
+ * ```
8858
+ *
8859
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8860
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8861
+ * object literal is never constructed because it lives inside the branch. It
8862
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8863
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8864
+ * destination floor (measured at 1.93 ns/call when off).
8865
+ *
8866
+ * ## Why a channel emits at `info`
8867
+ *
8868
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8869
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8870
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8871
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8872
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8873
+ * emits at the channel's declared level, whose schema floor is `info`.
8874
+ */
8875
+ /**
8876
+ * The level a channel writes at once armed.
8877
+ *
8878
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8879
+ * not leave the process for Loki, and the whole point of arming a channel is
8880
+ * to read it later.
8881
+ */
8882
+ var LogChannelLevelSchema = _enum([
8883
+ "info",
8884
+ "warn",
8885
+ "error"
8886
+ ]);
8887
+ /**
8888
+ * What an addon declares about one channel. No value, no state — a
8889
+ * declaration is inert.
8890
+ */
8891
+ var LogChannelDescriptorSchema = object({
8892
+ /**
8893
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8894
+ * the addon's short name so an operator reading a channel list can tell who
8895
+ * owns it without a second lookup.
8896
+ */
8897
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8898
+ /** One sentence: what the operator will SEE after arming it. */
8899
+ description: string().min(1),
8900
+ /** The level its lines are emitted at. Never below `info`. */
8901
+ defaultLevel: LogChannelLevelSchema,
8902
+ /**
8903
+ * Whether this channel can be narrowed to a camera.
8904
+ *
8905
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8906
+ * consulted with the numeric device id, AND every line the channel admits
8907
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8908
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8909
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8910
+ * the body is the only way to filter.
8911
+ *
8912
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8913
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8914
+ * the operator narrows to one camera, sees nothing, and concludes the code
8915
+ * path was never taken.
8916
+ */
8917
+ perDevice: boolean()
8918
+ });
8919
+ /**
8920
+ * An armed window over one channel, as the document hands it to a mirror.
8921
+ *
8922
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8923
+ * expires by itself, which is the one failure a boolean cannot avoid.
8924
+ */
8925
+ var LogChannelWindowSchema = object({
8926
+ channel: string().min(1),
8927
+ /** Epoch ms the window closes at. */
8928
+ armedUntilMs: number(),
8929
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8930
+ deviceIds: array(number().int()).readonly().nullable()
8931
+ });
8928
8932
  var MODEL_FORMATS = [
8929
8933
  "onnx",
8930
8934
  "coreml",
@@ -10581,12 +10585,30 @@ var BackupDestinationInfoSchema = object({
10581
10585
  lastSuccessAt: number().optional(),
10582
10586
  /** Newest-archive size from `manifests.json`, or undefined. */
10583
10587
  lastSuccessSizeBytes: number().optional(),
10584
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10588
+ /**
10589
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10590
+ * destination, comma-joined. Absent when no enabled schedule targets it
10591
+ * — a destination nothing is scheduled to write to must not advertise a
10592
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10593
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10594
+ * and reading it made a destination with a DISABLED schedule claim a
10595
+ * nightly run.
10596
+ */
10585
10597
  cron: string().optional(),
10586
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10598
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10587
10599
  nextRunAt: number().optional(),
10588
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10589
- lastRunAt: number().optional()
10600
+ /**
10601
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10602
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10603
+ * newest archive that actually landed) and `lastError`.
10604
+ */
10605
+ lastAttemptAt: number().optional(),
10606
+ /**
10607
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10608
+ * landed the archive. A destination that has never been written to has
10609
+ * neither this nor `lastAttemptAt`.
10610
+ */
10611
+ lastError: string().optional()
10590
10612
  });
10591
10613
  /**
10592
10614
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10749,8 +10771,16 @@ var BackupScheduleSchema = object({
10749
10771
  retentionCount: number().int().min(1).max(1e3),
10750
10772
  /** Optional subset of source locations to include; omitted = all. */
10751
10773
  dataSources: array(string()).readonly().optional(),
10752
- /** ms-epoch of last successful run. */
10753
- lastRunAt: number().optional(),
10774
+ /**
10775
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10776
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10777
+ * "succeeded" — a run refused by every destination stamps it too.
10778
+ */
10779
+ lastAttemptAt: number().optional(),
10780
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10781
+ lastSuccessAt: number().optional(),
10782
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10783
+ lastError: string().optional(),
10754
10784
  /** ms-epoch of next computed firing (read-only, filled on list). */
10755
10785
  nextRunAt: number().optional()
10756
10786
  });
@@ -10799,14 +10829,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10799
10829
  locationId: string(),
10800
10830
  enabled: boolean(),
10801
10831
  retentionCount: number().int().min(1).max(1e3),
10802
- label: string().optional(),
10803
- /**
10804
- * Per-destination cron expression. Empty string clears the
10805
- * schedule (manual-only). Validated server-side via croner;
10806
- * malformed expressions reject the upsert with an actionable
10807
- * message.
10808
- */
10809
- cron: string().optional()
10832
+ label: string().optional()
10810
10833
  }), _void(), {
10811
10834
  kind: "mutation",
10812
10835
  auth: "admin"
@@ -22042,7 +22065,7 @@ method(object({
22042
22065
  downloadId: string(),
22043
22066
  offset: number(),
22044
22067
  length: number()
22045
- }), _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({
22068
+ }), _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({
22046
22069
  createdAt: true,
22047
22070
  updatedAt: true
22048
22071
  }), StorageLocationSchema, {
@@ -38961,12 +38984,6 @@ Object.freeze({
38961
38984
  addonId: null,
38962
38985
  access: "view"
38963
38986
  },
38964
- "storage.getDefaultLocation": {
38965
- capName: "storage",
38966
- capScope: "system",
38967
- addonId: null,
38968
- access: "view"
38969
- },
38970
38987
  "storage.list": {
38971
38988
  capName: "storage",
38972
38989
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-rtsp",
3
- "version": "1.2.77",
3
+ "version": "1.2.79",
4
4
  "description": "Generic RTSP camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",