@camstack/addon-decoder-nodeav 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/index.js +158 -141
  2. package/dist/index.mjs +158 -141
  3. package/package.json +1 -1
package/dist/index.js 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",
@@ -10586,12 +10590,30 @@ var BackupDestinationInfoSchema = object({
10586
10590
  lastSuccessAt: number().optional(),
10587
10591
  /** Newest-archive size from `manifests.json`, or undefined. */
10588
10592
  lastSuccessSizeBytes: number().optional(),
10589
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10593
+ /**
10594
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10595
+ * destination, comma-joined. Absent when no enabled schedule targets it
10596
+ * — a destination nothing is scheduled to write to must not advertise a
10597
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10598
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10599
+ * and reading it made a destination with a DISABLED schedule claim a
10600
+ * nightly run.
10601
+ */
10590
10602
  cron: string().optional(),
10591
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10603
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10592
10604
  nextRunAt: number().optional(),
10593
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10594
- lastRunAt: number().optional()
10605
+ /**
10606
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10607
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10608
+ * newest archive that actually landed) and `lastError`.
10609
+ */
10610
+ lastAttemptAt: number().optional(),
10611
+ /**
10612
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10613
+ * landed the archive. A destination that has never been written to has
10614
+ * neither this nor `lastAttemptAt`.
10615
+ */
10616
+ lastError: string().optional()
10595
10617
  });
10596
10618
  /**
10597
10619
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10754,8 +10776,16 @@ var BackupScheduleSchema = object({
10754
10776
  retentionCount: number().int().min(1).max(1e3),
10755
10777
  /** Optional subset of source locations to include; omitted = all. */
10756
10778
  dataSources: array(string()).readonly().optional(),
10757
- /** ms-epoch of last successful run. */
10758
- lastRunAt: number().optional(),
10779
+ /**
10780
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10781
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10782
+ * "succeeded" — a run refused by every destination stamps it too.
10783
+ */
10784
+ lastAttemptAt: number().optional(),
10785
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10786
+ lastSuccessAt: number().optional(),
10787
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10788
+ lastError: string().optional(),
10759
10789
  /** ms-epoch of next computed firing (read-only, filled on list). */
10760
10790
  nextRunAt: number().optional()
10761
10791
  });
@@ -10804,14 +10834,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10804
10834
  locationId: string(),
10805
10835
  enabled: boolean(),
10806
10836
  retentionCount: number().int().min(1).max(1e3),
10807
- label: string().optional(),
10808
- /**
10809
- * Per-destination cron expression. Empty string clears the
10810
- * schedule (manual-only). Validated server-side via croner;
10811
- * malformed expressions reject the upsert with an actionable
10812
- * message.
10813
- */
10814
- cron: string().optional()
10837
+ label: string().optional()
10815
10838
  }), _void(), {
10816
10839
  kind: "mutation",
10817
10840
  auth: "admin"
@@ -21668,7 +21691,7 @@ method(object({
21668
21691
  downloadId: string(),
21669
21692
  offset: number(),
21670
21693
  length: number()
21671
- }), _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({
21694
+ }), _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({
21672
21695
  createdAt: true,
21673
21696
  updatedAt: true
21674
21697
  }), StorageLocationSchema, {
@@ -34517,12 +34540,6 @@ Object.freeze({
34517
34540
  addonId: null,
34518
34541
  access: "view"
34519
34542
  },
34520
- "storage.getDefaultLocation": {
34521
- capName: "storage",
34522
- capScope: "system",
34523
- addonId: null,
34524
- access: "view"
34525
- },
34526
34543
  "storage.list": {
34527
34544
  capName: "storage",
34528
34545
  capScope: "system",
package/dist/index.mjs CHANGED
@@ -7611,111 +7611,6 @@ var CameraSwitchGroupSchema = object({
7611
7611
  fetchedAt: number()
7612
7612
  });
7613
7613
  /**
7614
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7615
- * an addon declares its channels in.
7616
- *
7617
- * ## Two axes, deliberately separated
7618
- *
7619
- * - **DECLARATION** — which channels exist. Only the addon knows:
7620
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7621
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7622
- * and rots silently. So a channel is declared where it is consulted, and the
7623
- * `log-channels` capability enumerates the declarations.
7624
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7625
- * thing: the logging settings document on the `system` cap. Two authorities
7626
- * over the values is the exact defect
7627
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7628
- * remove; re-introducing it from the cure side would be grotesque.
7629
- *
7630
- * Nothing in this file reads a clock, an env var or a store. The registry is
7631
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7632
- * the hot path with a value somebody actually read, and by
7633
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7634
- * never reaches here, so it can neither disarm an armed channel nor arm a
7635
- * disarmed one (D49).
7636
- *
7637
- * ## The canonical call shape
7638
- *
7639
- * ```ts
7640
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7641
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7642
- * }
7643
- * ```
7644
- *
7645
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7646
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7647
- * object literal is never constructed because it lives inside the branch. It
7648
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7649
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7650
- * destination floor (measured at 1.93 ns/call when off).
7651
- *
7652
- * ## Why a channel emits at `info`
7653
- *
7654
- * `loki-logging.addon.ts` pins the destination default at `info` and
7655
- * `loki-destination.ts` drops everything below it, so a line emitted at
7656
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7657
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7658
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7659
- * emits at the channel's declared level, whose schema floor is `info`.
7660
- */
7661
- /**
7662
- * The level a channel writes at once armed.
7663
- *
7664
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7665
- * not leave the process for Loki, and the whole point of arming a channel is
7666
- * to read it later.
7667
- */
7668
- var LogChannelLevelSchema = _enum([
7669
- "info",
7670
- "warn",
7671
- "error"
7672
- ]);
7673
- /**
7674
- * What an addon declares about one channel. No value, no state — a
7675
- * declaration is inert.
7676
- */
7677
- var LogChannelDescriptorSchema = object({
7678
- /**
7679
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7680
- * the addon's short name so an operator reading a channel list can tell who
7681
- * owns it without a second lookup.
7682
- */
7683
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7684
- /** One sentence: what the operator will SEE after arming it. */
7685
- description: string().min(1),
7686
- /** The level its lines are emitted at. Never below `info`. */
7687
- defaultLevel: LogChannelLevelSchema,
7688
- /**
7689
- * Whether this channel can be narrowed to a camera.
7690
- *
7691
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7692
- * consulted with the numeric device id, AND every line the channel admits
7693
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7694
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7695
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7696
- * the body is the only way to filter.
7697
- *
7698
- * A channel whose lines carry the device only in `meta` (or not at all) is
7699
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7700
- * the operator narrows to one camera, sees nothing, and concludes the code
7701
- * path was never taken.
7702
- */
7703
- perDevice: boolean()
7704
- });
7705
- /**
7706
- * An armed window over one channel, as the document hands it to a mirror.
7707
- *
7708
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7709
- * expires by itself, which is the one failure a boolean cannot avoid.
7710
- */
7711
- var LogChannelWindowSchema = object({
7712
- channel: string().min(1),
7713
- /** Epoch ms the window closes at. */
7714
- armedUntilMs: number(),
7715
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7716
- deviceIds: array(number().int()).readonly().nullable()
7717
- });
7718
- /**
7719
7614
  * Ops-log — the durable, append-only operations audit shared by the
7720
7615
  * recordings and events management surfaces.
7721
7616
  *
@@ -8661,8 +8556,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8661
8556
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8662
8557
  *
8663
8558
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8664
- * The default location for a type uses `id === <type>:default` by
8665
- * convention (the bare type ref like `'backups'` resolves to it).
8559
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8560
+ * There is no default location any more (D383): `enabled` is the whole write
8561
+ * model, and a bare type ref resolves to the sole location of the type, or —
8562
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8563
+ * slug is `default`.
8666
8564
  *
8667
8565
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8668
8566
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8683,21 +8581,20 @@ var StorageLocationSchema = object({
8683
8581
  * flag at upsert time, not here (the schema is provider-agnostic).
8684
8582
  */
8685
8583
  nodeId: string().optional(),
8686
- isDefault: boolean().default(false),
8687
8584
  isSystem: boolean().default(false),
8688
8585
  /**
8689
- * Operator opt-in: whether consumers that BALANCE across several locations
8690
- * of a type may write here. Recordings reads it today; event media and
8691
- * backups are the next consumers, which is why the flag lives on the
8692
- * location rather than in any one addon's store nothing has to be
8693
- * extended to add the next consumer.
8586
+ * THE write switch, and the only one (D383). `enabled: true` means every
8587
+ * consumer that chooses a write target for this type may write here, and all
8588
+ * enabled locations of a type are used TOGETHER; `false` means read-only
8589
+ * still read, still played back, still age-swept, still drained, never
8590
+ * written.
8694
8591
  *
8695
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8696
- * flag existed reads back with no flag and keeps working exactly as before;
8697
- * that is the whole compat story, and it is why no migration ships with it.
8698
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8699
- * disk must not silently start writing to it); the default of a type is
8700
- * always stamped `true`.
8592
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8593
+ * stored" on an update and "born inert unless it is the first location of its
8594
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8595
+ * enabled {@link isLocationEnabled} is the one place that says so, and the
8596
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8597
+ * stops existing rather than being re-derived on every read.
8701
8598
  */
8702
8599
  enabled: boolean().optional(),
8703
8600
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8710,10 +8607,12 @@ var StorageLocationSchema = object({
8710
8607
  createdAt: number(),
8711
8608
  updatedAt: number()
8712
8609
  });
8610
+ object({ isDefault: boolean().optional() });
8713
8611
  /**
8714
8612
  * Reference accepted by consumer-facing `api.storage.*` calls.
8715
8613
  * Either:
8716
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8614
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8615
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8717
8616
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8718
8617
  *
8719
8618
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -8889,6 +8788,111 @@ var DecoderSessionConfigSchema = object({
8889
8788
  */
8890
8789
  debug: boolean().optional()
8891
8790
  });
8791
+ /**
8792
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8793
+ * an addon declares its channels in.
8794
+ *
8795
+ * ## Two axes, deliberately separated
8796
+ *
8797
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8798
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8799
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8800
+ * and rots silently. So a channel is declared where it is consulted, and the
8801
+ * `log-channels` capability enumerates the declarations.
8802
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8803
+ * thing: the logging settings document on the `system` cap. Two authorities
8804
+ * over the values is the exact defect
8805
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8806
+ * remove; re-introducing it from the cure side would be grotesque.
8807
+ *
8808
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8809
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8810
+ * the hot path with a value somebody actually read, and by
8811
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8812
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8813
+ * disarmed one (D49).
8814
+ *
8815
+ * ## The canonical call shape
8816
+ *
8817
+ * ```ts
8818
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8819
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8820
+ * }
8821
+ * ```
8822
+ *
8823
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8824
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8825
+ * object literal is never constructed because it lives inside the branch. It
8826
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8827
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8828
+ * destination floor (measured at 1.93 ns/call when off).
8829
+ *
8830
+ * ## Why a channel emits at `info`
8831
+ *
8832
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8833
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8834
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8835
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8836
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8837
+ * emits at the channel's declared level, whose schema floor is `info`.
8838
+ */
8839
+ /**
8840
+ * The level a channel writes at once armed.
8841
+ *
8842
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8843
+ * not leave the process for Loki, and the whole point of arming a channel is
8844
+ * to read it later.
8845
+ */
8846
+ var LogChannelLevelSchema = _enum([
8847
+ "info",
8848
+ "warn",
8849
+ "error"
8850
+ ]);
8851
+ /**
8852
+ * What an addon declares about one channel. No value, no state — a
8853
+ * declaration is inert.
8854
+ */
8855
+ var LogChannelDescriptorSchema = object({
8856
+ /**
8857
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
8858
+ * the addon's short name so an operator reading a channel list can tell who
8859
+ * owns it without a second lookup.
8860
+ */
8861
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
8862
+ /** One sentence: what the operator will SEE after arming it. */
8863
+ description: string().min(1),
8864
+ /** The level its lines are emitted at. Never below `info`. */
8865
+ defaultLevel: LogChannelLevelSchema,
8866
+ /**
8867
+ * Whether this channel can be narrowed to a camera.
8868
+ *
8869
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
8870
+ * consulted with the numeric device id, AND every line the channel admits
8871
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
8872
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
8873
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
8874
+ * the body is the only way to filter.
8875
+ *
8876
+ * A channel whose lines carry the device only in `meta` (or not at all) is
8877
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
8878
+ * the operator narrows to one camera, sees nothing, and concludes the code
8879
+ * path was never taken.
8880
+ */
8881
+ perDevice: boolean()
8882
+ });
8883
+ /**
8884
+ * An armed window over one channel, as the document hands it to a mirror.
8885
+ *
8886
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
8887
+ * expires by itself, which is the one failure a boolean cannot avoid.
8888
+ */
8889
+ var LogChannelWindowSchema = object({
8890
+ channel: string().min(1),
8891
+ /** Epoch ms the window closes at. */
8892
+ armedUntilMs: number(),
8893
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
8894
+ deviceIds: array(number().int()).readonly().nullable()
8895
+ });
8892
8896
  var MODEL_FORMATS = [
8893
8897
  "onnx",
8894
8898
  "coreml",
@@ -10582,12 +10586,30 @@ var BackupDestinationInfoSchema = object({
10582
10586
  lastSuccessAt: number().optional(),
10583
10587
  /** Newest-archive size from `manifests.json`, or undefined. */
10584
10588
  lastSuccessSizeBytes: number().optional(),
10585
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10589
+ /**
10590
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10591
+ * destination, comma-joined. Absent when no enabled schedule targets it
10592
+ * — a destination nothing is scheduled to write to must not advertise a
10593
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10594
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10595
+ * and reading it made a destination with a DISABLED schedule claim a
10596
+ * nightly run.
10597
+ */
10586
10598
  cron: string().optional(),
10587
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10599
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10588
10600
  nextRunAt: number().optional(),
10589
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10590
- lastRunAt: number().optional()
10601
+ /**
10602
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10603
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10604
+ * newest archive that actually landed) and `lastError`.
10605
+ */
10606
+ lastAttemptAt: number().optional(),
10607
+ /**
10608
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10609
+ * landed the archive. A destination that has never been written to has
10610
+ * neither this nor `lastAttemptAt`.
10611
+ */
10612
+ lastError: string().optional()
10591
10613
  });
10592
10614
  /**
10593
10615
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10750,8 +10772,16 @@ var BackupScheduleSchema = object({
10750
10772
  retentionCount: number().int().min(1).max(1e3),
10751
10773
  /** Optional subset of source locations to include; omitted = all. */
10752
10774
  dataSources: array(string()).readonly().optional(),
10753
- /** ms-epoch of last successful run. */
10754
- lastRunAt: number().optional(),
10775
+ /**
10776
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10777
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10778
+ * "succeeded" — a run refused by every destination stamps it too.
10779
+ */
10780
+ lastAttemptAt: number().optional(),
10781
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10782
+ lastSuccessAt: number().optional(),
10783
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10784
+ lastError: string().optional(),
10755
10785
  /** ms-epoch of next computed firing (read-only, filled on list). */
10756
10786
  nextRunAt: number().optional()
10757
10787
  });
@@ -10800,14 +10830,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10800
10830
  locationId: string(),
10801
10831
  enabled: boolean(),
10802
10832
  retentionCount: number().int().min(1).max(1e3),
10803
- label: string().optional(),
10804
- /**
10805
- * Per-destination cron expression. Empty string clears the
10806
- * schedule (manual-only). Validated server-side via croner;
10807
- * malformed expressions reject the upsert with an actionable
10808
- * message.
10809
- */
10810
- cron: string().optional()
10833
+ label: string().optional()
10811
10834
  }), _void(), {
10812
10835
  kind: "mutation",
10813
10836
  auth: "admin"
@@ -21664,7 +21687,7 @@ method(object({
21664
21687
  downloadId: string(),
21665
21688
  offset: number(),
21666
21689
  length: number()
21667
- }), _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({
21690
+ }), _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({
21668
21691
  createdAt: true,
21669
21692
  updatedAt: true
21670
21693
  }), StorageLocationSchema, {
@@ -34513,12 +34536,6 @@ Object.freeze({
34513
34536
  addonId: null,
34514
34537
  access: "view"
34515
34538
  },
34516
- "storage.getDefaultLocation": {
34517
- capName: "storage",
34518
- capScope: "system",
34519
- addonId: null,
34520
- access: "view"
34521
- },
34522
34539
  "storage.list": {
34523
34540
  capName: "storage",
34524
34541
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-decoder-nodeav",
3
- "version": "1.2.77",
3
+ "version": "1.2.79",
4
4
  "description": "Standalone in-process node-av decoder addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",