@camstack/addon-export-alexa 1.2.83 → 1.2.85

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.
@@ -7783,111 +7783,6 @@ var CameraSwitchGroupSchema = object({
7783
7783
  fetchedAt: number()
7784
7784
  });
7785
7785
  /**
7786
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7787
- * an addon declares its channels in.
7788
- *
7789
- * ## Two axes, deliberately separated
7790
- *
7791
- * - **DECLARATION** — which channels exist. Only the addon knows:
7792
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7793
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7794
- * and rots silently. So a channel is declared where it is consulted, and the
7795
- * `log-channels` capability enumerates the declarations.
7796
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7797
- * thing: the logging settings document on the `system` cap. Two authorities
7798
- * over the values is the exact defect
7799
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7800
- * remove; re-introducing it from the cure side would be grotesque.
7801
- *
7802
- * Nothing in this file reads a clock, an env var or a store. The registry is
7803
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7804
- * the hot path with a value somebody actually read, and by
7805
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7806
- * never reaches here, so it can neither disarm an armed channel nor arm a
7807
- * disarmed one (D49).
7808
- *
7809
- * ## The canonical call shape
7810
- *
7811
- * ```ts
7812
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7813
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7814
- * }
7815
- * ```
7816
- *
7817
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7818
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7819
- * object literal is never constructed because it lives inside the branch. It
7820
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7821
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7822
- * destination floor (measured at 1.93 ns/call when off).
7823
- *
7824
- * ## Why a channel emits at `info`
7825
- *
7826
- * `loki-logging.addon.ts` pins the destination default at `info` and
7827
- * `loki-destination.ts` drops everything below it, so a line emitted at
7828
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7829
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7830
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7831
- * emits at the channel's declared level, whose schema floor is `info`.
7832
- */
7833
- /**
7834
- * The level a channel writes at once armed.
7835
- *
7836
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7837
- * not leave the process for Loki, and the whole point of arming a channel is
7838
- * to read it later.
7839
- */
7840
- var LogChannelLevelSchema = _enum([
7841
- "info",
7842
- "warn",
7843
- "error"
7844
- ]);
7845
- /**
7846
- * What an addon declares about one channel. No value, no state — a
7847
- * declaration is inert.
7848
- */
7849
- var LogChannelDescriptorSchema = object({
7850
- /**
7851
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7852
- * the addon's short name so an operator reading a channel list can tell who
7853
- * owns it without a second lookup.
7854
- */
7855
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7856
- /** One sentence: what the operator will SEE after arming it. */
7857
- description: string().min(1),
7858
- /** The level its lines are emitted at. Never below `info`. */
7859
- defaultLevel: LogChannelLevelSchema,
7860
- /**
7861
- * Whether this channel can be narrowed to a camera.
7862
- *
7863
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7864
- * consulted with the numeric device id, AND every line the channel admits
7865
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7866
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7867
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7868
- * the body is the only way to filter.
7869
- *
7870
- * A channel whose lines carry the device only in `meta` (or not at all) is
7871
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7872
- * the operator narrows to one camera, sees nothing, and concludes the code
7873
- * path was never taken.
7874
- */
7875
- perDevice: boolean()
7876
- });
7877
- /**
7878
- * An armed window over one channel, as the document hands it to a mirror.
7879
- *
7880
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7881
- * expires by itself, which is the one failure a boolean cannot avoid.
7882
- */
7883
- var LogChannelWindowSchema = object({
7884
- channel: string().min(1),
7885
- /** Epoch ms the window closes at. */
7886
- armedUntilMs: number(),
7887
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7888
- deviceIds: array(number().int()).readonly().nullable()
7889
- });
7890
- /**
7891
7786
  * Ops-log — the durable, append-only operations audit shared by the
7892
7787
  * recordings and events management surfaces.
7893
7788
  *
@@ -8833,8 +8728,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8833
8728
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8834
8729
  *
8835
8730
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8836
- * The default location for a type uses `id === <type>:default` by
8837
- * convention (the bare type ref like `'backups'` resolves to it).
8731
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8732
+ * There is no default location any more (D383): `enabled` is the whole write
8733
+ * model, and a bare type ref resolves to the sole location of the type, or —
8734
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8735
+ * slug is `default`.
8838
8736
  *
8839
8737
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8840
8738
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8855,21 +8753,20 @@ var StorageLocationSchema = object({
8855
8753
  * flag at upsert time, not here (the schema is provider-agnostic).
8856
8754
  */
8857
8755
  nodeId: string().optional(),
8858
- isDefault: boolean().default(false),
8859
8756
  isSystem: boolean().default(false),
8860
8757
  /**
8861
- * Operator opt-in: whether consumers that BALANCE across several locations
8862
- * of a type may write here. Recordings reads it today; event media and
8863
- * backups are the next consumers, which is why the flag lives on the
8864
- * location rather than in any one addon's store — nothing has to be
8865
- * extended to add the next consumer.
8758
+ * THE write switch, and the only one (D383). `enabled: true` means every
8759
+ * consumer that chooses a write target for this type may write here, and all
8760
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8761
+ * still read, still played back, still age-swept, still drained, never
8762
+ * written.
8866
8763
  *
8867
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8868
- * flag existed reads back with no flag and keeps working exactly as before;
8869
- * that is the whole compat story, and it is why no migration ships with it.
8870
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8871
- * disk must not silently start writing to it); the default of a type is
8872
- * always stamped `true`.
8764
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8765
+ * stored" on an update and "born inert unless it is the first location of its
8766
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8767
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8768
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8769
+ * stops existing rather than being re-derived on every read.
8873
8770
  */
8874
8771
  enabled: boolean().optional(),
8875
8772
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8882,10 +8779,12 @@ var StorageLocationSchema = object({
8882
8779
  createdAt: number(),
8883
8780
  updatedAt: number()
8884
8781
  });
8782
+ object({ isDefault: boolean().optional() });
8885
8783
  /**
8886
8784
  * Reference accepted by consumer-facing `api.storage.*` calls.
8887
8785
  * Either:
8888
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8786
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8787
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8889
8788
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8890
8789
  *
8891
8790
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9061,6 +8960,111 @@ var DecoderSessionConfigSchema = object({
9061
8960
  */
9062
8961
  debug: boolean().optional()
9063
8962
  });
8963
+ /**
8964
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8965
+ * an addon declares its channels in.
8966
+ *
8967
+ * ## Two axes, deliberately separated
8968
+ *
8969
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8970
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8971
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8972
+ * and rots silently. So a channel is declared where it is consulted, and the
8973
+ * `log-channels` capability enumerates the declarations.
8974
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8975
+ * thing: the logging settings document on the `system` cap. Two authorities
8976
+ * over the values is the exact defect
8977
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8978
+ * remove; re-introducing it from the cure side would be grotesque.
8979
+ *
8980
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8981
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8982
+ * the hot path with a value somebody actually read, and by
8983
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8984
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8985
+ * disarmed one (D49).
8986
+ *
8987
+ * ## The canonical call shape
8988
+ *
8989
+ * ```ts
8990
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8991
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8992
+ * }
8993
+ * ```
8994
+ *
8995
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8996
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8997
+ * object literal is never constructed because it lives inside the branch. It
8998
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8999
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
9000
+ * destination floor (measured at 1.93 ns/call when off).
9001
+ *
9002
+ * ## Why a channel emits at `info`
9003
+ *
9004
+ * `loki-logging.addon.ts` pins the destination default at `info` and
9005
+ * `loki-destination.ts` drops everything below it, so a line emitted at
9006
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
9007
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
9008
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
9009
+ * emits at the channel's declared level, whose schema floor is `info`.
9010
+ */
9011
+ /**
9012
+ * The level a channel writes at once armed.
9013
+ *
9014
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9015
+ * not leave the process for Loki, and the whole point of arming a channel is
9016
+ * to read it later.
9017
+ */
9018
+ var LogChannelLevelSchema = _enum([
9019
+ "info",
9020
+ "warn",
9021
+ "error"
9022
+ ]);
9023
+ /**
9024
+ * What an addon declares about one channel. No value, no state — a
9025
+ * declaration is inert.
9026
+ */
9027
+ var LogChannelDescriptorSchema = object({
9028
+ /**
9029
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9030
+ * the addon's short name so an operator reading a channel list can tell who
9031
+ * owns it without a second lookup.
9032
+ */
9033
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9034
+ /** One sentence: what the operator will SEE after arming it. */
9035
+ description: string().min(1),
9036
+ /** The level its lines are emitted at. Never below `info`. */
9037
+ defaultLevel: LogChannelLevelSchema,
9038
+ /**
9039
+ * Whether this channel can be narrowed to a camera.
9040
+ *
9041
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9042
+ * consulted with the numeric device id, AND every line the channel admits
9043
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9044
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9045
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9046
+ * the body is the only way to filter.
9047
+ *
9048
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9049
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9050
+ * the operator narrows to one camera, sees nothing, and concludes the code
9051
+ * path was never taken.
9052
+ */
9053
+ perDevice: boolean()
9054
+ });
9055
+ /**
9056
+ * An armed window over one channel, as the document hands it to a mirror.
9057
+ *
9058
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9059
+ * expires by itself, which is the one failure a boolean cannot avoid.
9060
+ */
9061
+ var LogChannelWindowSchema = object({
9062
+ channel: string().min(1),
9063
+ /** Epoch ms the window closes at. */
9064
+ armedUntilMs: number(),
9065
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9066
+ deviceIds: array(number().int()).readonly().nullable()
9067
+ });
9064
9068
  function pickPreferredRtspEntry(entries, pref, deviceId, options = {}) {
9065
9069
  if (entries.length === 0) return null;
9066
9070
  const prefix = `${deviceId}/`;
@@ -10797,12 +10801,30 @@ var BackupDestinationInfoSchema = object({
10797
10801
  lastSuccessAt: number().optional(),
10798
10802
  /** Newest-archive size from `manifests.json`, or undefined. */
10799
10803
  lastSuccessSizeBytes: number().optional(),
10800
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10804
+ /**
10805
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10806
+ * destination, comma-joined. Absent when no enabled schedule targets it
10807
+ * — a destination nothing is scheduled to write to must not advertise a
10808
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10809
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10810
+ * and reading it made a destination with a DISABLED schedule claim a
10811
+ * nightly run.
10812
+ */
10801
10813
  cron: string().optional(),
10802
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10814
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10803
10815
  nextRunAt: number().optional(),
10804
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10805
- lastRunAt: number().optional()
10816
+ /**
10817
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10818
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10819
+ * newest archive that actually landed) and `lastError`.
10820
+ */
10821
+ lastAttemptAt: number().optional(),
10822
+ /**
10823
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10824
+ * landed the archive. A destination that has never been written to has
10825
+ * neither this nor `lastAttemptAt`.
10826
+ */
10827
+ lastError: string().optional()
10806
10828
  });
10807
10829
  /**
10808
10830
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10965,8 +10987,16 @@ var BackupScheduleSchema = object({
10965
10987
  retentionCount: number().int().min(1).max(1e3),
10966
10988
  /** Optional subset of source locations to include; omitted = all. */
10967
10989
  dataSources: array(string()).readonly().optional(),
10968
- /** ms-epoch of last successful run. */
10969
- lastRunAt: number().optional(),
10990
+ /**
10991
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10992
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10993
+ * "succeeded" — a run refused by every destination stamps it too.
10994
+ */
10995
+ lastAttemptAt: number().optional(),
10996
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10997
+ lastSuccessAt: number().optional(),
10998
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10999
+ lastError: string().optional(),
10970
11000
  /** ms-epoch of next computed firing (read-only, filled on list). */
10971
11001
  nextRunAt: number().optional()
10972
11002
  });
@@ -11015,14 +11045,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
11015
11045
  locationId: string(),
11016
11046
  enabled: boolean(),
11017
11047
  retentionCount: number().int().min(1).max(1e3),
11018
- label: string().optional(),
11019
- /**
11020
- * Per-destination cron expression. Empty string clears the
11021
- * schedule (manual-only). Validated server-side via croner;
11022
- * malformed expressions reject the upsert with an actionable
11023
- * message.
11024
- */
11025
- cron: string().optional()
11048
+ label: string().optional()
11026
11049
  }), _void(), {
11027
11050
  kind: "mutation",
11028
11051
  auth: "admin"
@@ -21849,7 +21872,7 @@ method(object({
21849
21872
  downloadId: string(),
21850
21873
  offset: number(),
21851
21874
  length: number()
21852
- }), _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({
21875
+ }), _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({
21853
21876
  createdAt: true,
21854
21877
  updatedAt: true
21855
21878
  }), StorageLocationSchema, {
@@ -34698,12 +34721,6 @@ Object.freeze({
34698
34721
  addonId: null,
34699
34722
  access: "view"
34700
34723
  },
34701
- "storage.getDefaultLocation": {
34702
- capName: "storage",
34703
- capScope: "system",
34704
- addonId: null,
34705
- access: "view"
34706
- },
34707
34724
  "storage.list": {
34708
34725
  capName: "storage",
34709
34726
  capScope: "system",
@@ -7756,111 +7756,6 @@ var CameraSwitchGroupSchema = object({
7756
7756
  fetchedAt: number()
7757
7757
  });
7758
7758
  /**
7759
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7760
- * an addon declares its channels in.
7761
- *
7762
- * ## Two axes, deliberately separated
7763
- *
7764
- * - **DECLARATION** — which channels exist. Only the addon knows:
7765
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7766
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7767
- * and rots silently. So a channel is declared where it is consulted, and the
7768
- * `log-channels` capability enumerates the declarations.
7769
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7770
- * thing: the logging settings document on the `system` cap. Two authorities
7771
- * over the values is the exact defect
7772
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7773
- * remove; re-introducing it from the cure side would be grotesque.
7774
- *
7775
- * Nothing in this file reads a clock, an env var or a store. The registry is
7776
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7777
- * the hot path with a value somebody actually read, and by
7778
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7779
- * never reaches here, so it can neither disarm an armed channel nor arm a
7780
- * disarmed one (D49).
7781
- *
7782
- * ## The canonical call shape
7783
- *
7784
- * ```ts
7785
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7786
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7787
- * }
7788
- * ```
7789
- *
7790
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7791
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7792
- * object literal is never constructed because it lives inside the branch. It
7793
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7794
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7795
- * destination floor (measured at 1.93 ns/call when off).
7796
- *
7797
- * ## Why a channel emits at `info`
7798
- *
7799
- * `loki-logging.addon.ts` pins the destination default at `info` and
7800
- * `loki-destination.ts` drops everything below it, so a line emitted at
7801
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7802
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7803
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7804
- * emits at the channel's declared level, whose schema floor is `info`.
7805
- */
7806
- /**
7807
- * The level a channel writes at once armed.
7808
- *
7809
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7810
- * not leave the process for Loki, and the whole point of arming a channel is
7811
- * to read it later.
7812
- */
7813
- var LogChannelLevelSchema = _enum([
7814
- "info",
7815
- "warn",
7816
- "error"
7817
- ]);
7818
- /**
7819
- * What an addon declares about one channel. No value, no state — a
7820
- * declaration is inert.
7821
- */
7822
- var LogChannelDescriptorSchema = object({
7823
- /**
7824
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7825
- * the addon's short name so an operator reading a channel list can tell who
7826
- * owns it without a second lookup.
7827
- */
7828
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7829
- /** One sentence: what the operator will SEE after arming it. */
7830
- description: string().min(1),
7831
- /** The level its lines are emitted at. Never below `info`. */
7832
- defaultLevel: LogChannelLevelSchema,
7833
- /**
7834
- * Whether this channel can be narrowed to a camera.
7835
- *
7836
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7837
- * consulted with the numeric device id, AND every line the channel admits
7838
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7839
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7840
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7841
- * the body is the only way to filter.
7842
- *
7843
- * A channel whose lines carry the device only in `meta` (or not at all) is
7844
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7845
- * the operator narrows to one camera, sees nothing, and concludes the code
7846
- * path was never taken.
7847
- */
7848
- perDevice: boolean()
7849
- });
7850
- /**
7851
- * An armed window over one channel, as the document hands it to a mirror.
7852
- *
7853
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7854
- * expires by itself, which is the one failure a boolean cannot avoid.
7855
- */
7856
- var LogChannelWindowSchema = object({
7857
- channel: string().min(1),
7858
- /** Epoch ms the window closes at. */
7859
- armedUntilMs: number(),
7860
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7861
- deviceIds: array(number().int()).readonly().nullable()
7862
- });
7863
- /**
7864
7759
  * Ops-log — the durable, append-only operations audit shared by the
7865
7760
  * recordings and events management surfaces.
7866
7761
  *
@@ -8806,8 +8701,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8806
8701
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8807
8702
  *
8808
8703
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8809
- * The default location for a type uses `id === <type>:default` by
8810
- * convention (the bare type ref like `'backups'` resolves to it).
8704
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8705
+ * There is no default location any more (D383): `enabled` is the whole write
8706
+ * model, and a bare type ref resolves to the sole location of the type, or —
8707
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8708
+ * slug is `default`.
8811
8709
  *
8812
8710
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8813
8711
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8828,21 +8726,20 @@ var StorageLocationSchema = object({
8828
8726
  * flag at upsert time, not here (the schema is provider-agnostic).
8829
8727
  */
8830
8728
  nodeId: string().optional(),
8831
- isDefault: boolean().default(false),
8832
8729
  isSystem: boolean().default(false),
8833
8730
  /**
8834
- * Operator opt-in: whether consumers that BALANCE across several locations
8835
- * of a type may write here. Recordings reads it today; event media and
8836
- * backups are the next consumers, which is why the flag lives on the
8837
- * location rather than in any one addon's store — nothing has to be
8838
- * extended to add the next consumer.
8731
+ * THE write switch, and the only one (D383). `enabled: true` means every
8732
+ * consumer that chooses a write target for this type may write here, and all
8733
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8734
+ * still read, still played back, still age-swept, still drained, never
8735
+ * written.
8839
8736
  *
8840
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8841
- * flag existed reads back with no flag and keeps working exactly as before;
8842
- * that is the whole compat story, and it is why no migration ships with it.
8843
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8844
- * disk must not silently start writing to it); the default of a type is
8845
- * always stamped `true`.
8737
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8738
+ * stored" on an update and "born inert unless it is the first location of its
8739
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8740
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8741
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8742
+ * stops existing rather than being re-derived on every read.
8846
8743
  */
8847
8744
  enabled: boolean().optional(),
8848
8745
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8855,10 +8752,12 @@ var StorageLocationSchema = object({
8855
8752
  createdAt: number(),
8856
8753
  updatedAt: number()
8857
8754
  });
8755
+ object({ isDefault: boolean().optional() });
8858
8756
  /**
8859
8757
  * Reference accepted by consumer-facing `api.storage.*` calls.
8860
8758
  * Either:
8861
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8759
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8760
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8862
8761
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8863
8762
  *
8864
8763
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9034,6 +8933,111 @@ var DecoderSessionConfigSchema = object({
9034
8933
  */
9035
8934
  debug: boolean().optional()
9036
8935
  });
8936
+ /**
8937
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8938
+ * an addon declares its channels in.
8939
+ *
8940
+ * ## Two axes, deliberately separated
8941
+ *
8942
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8943
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8944
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8945
+ * and rots silently. So a channel is declared where it is consulted, and the
8946
+ * `log-channels` capability enumerates the declarations.
8947
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8948
+ * thing: the logging settings document on the `system` cap. Two authorities
8949
+ * over the values is the exact defect
8950
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8951
+ * remove; re-introducing it from the cure side would be grotesque.
8952
+ *
8953
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8954
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8955
+ * the hot path with a value somebody actually read, and by
8956
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8957
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8958
+ * disarmed one (D49).
8959
+ *
8960
+ * ## The canonical call shape
8961
+ *
8962
+ * ```ts
8963
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8964
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8965
+ * }
8966
+ * ```
8967
+ *
8968
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8969
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8970
+ * object literal is never constructed because it lives inside the branch. It
8971
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8972
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8973
+ * destination floor (measured at 1.93 ns/call when off).
8974
+ *
8975
+ * ## Why a channel emits at `info`
8976
+ *
8977
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8978
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8979
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8980
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8981
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8982
+ * emits at the channel's declared level, whose schema floor is `info`.
8983
+ */
8984
+ /**
8985
+ * The level a channel writes at once armed.
8986
+ *
8987
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
8988
+ * not leave the process for Loki, and the whole point of arming a channel is
8989
+ * to read it later.
8990
+ */
8991
+ var LogChannelLevelSchema = _enum([
8992
+ "info",
8993
+ "warn",
8994
+ "error"
8995
+ ]);
8996
+ /**
8997
+ * What an addon declares about one channel. No value, no state — a
8998
+ * declaration is inert.
8999
+ */
9000
+ var LogChannelDescriptorSchema = object({
9001
+ /**
9002
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9003
+ * the addon's short name so an operator reading a channel list can tell who
9004
+ * owns it without a second lookup.
9005
+ */
9006
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9007
+ /** One sentence: what the operator will SEE after arming it. */
9008
+ description: string().min(1),
9009
+ /** The level its lines are emitted at. Never below `info`. */
9010
+ defaultLevel: LogChannelLevelSchema,
9011
+ /**
9012
+ * Whether this channel can be narrowed to a camera.
9013
+ *
9014
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9015
+ * consulted with the numeric device id, AND every line the channel admits
9016
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9017
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9018
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9019
+ * the body is the only way to filter.
9020
+ *
9021
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9022
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9023
+ * the operator narrows to one camera, sees nothing, and concludes the code
9024
+ * path was never taken.
9025
+ */
9026
+ perDevice: boolean()
9027
+ });
9028
+ /**
9029
+ * An armed window over one channel, as the document hands it to a mirror.
9030
+ *
9031
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9032
+ * expires by itself, which is the one failure a boolean cannot avoid.
9033
+ */
9034
+ var LogChannelWindowSchema = object({
9035
+ channel: string().min(1),
9036
+ /** Epoch ms the window closes at. */
9037
+ armedUntilMs: number(),
9038
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9039
+ deviceIds: array(number().int()).readonly().nullable()
9040
+ });
9037
9041
  function pickPreferredRtspEntry(entries, pref, deviceId, options = {}) {
9038
9042
  if (entries.length === 0) return null;
9039
9043
  const prefix = `${deviceId}/`;
@@ -10770,12 +10774,30 @@ var BackupDestinationInfoSchema = object({
10770
10774
  lastSuccessAt: number().optional(),
10771
10775
  /** Newest-archive size from `manifests.json`, or undefined. */
10772
10776
  lastSuccessSizeBytes: number().optional(),
10773
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10777
+ /**
10778
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10779
+ * destination, comma-joined. Absent when no enabled schedule targets it
10780
+ * — a destination nothing is scheduled to write to must not advertise a
10781
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10782
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10783
+ * and reading it made a destination with a DISABLED schedule claim a
10784
+ * nightly run.
10785
+ */
10774
10786
  cron: string().optional(),
10775
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10787
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10776
10788
  nextRunAt: number().optional(),
10777
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10778
- lastRunAt: number().optional()
10789
+ /**
10790
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10791
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10792
+ * newest archive that actually landed) and `lastError`.
10793
+ */
10794
+ lastAttemptAt: number().optional(),
10795
+ /**
10796
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10797
+ * landed the archive. A destination that has never been written to has
10798
+ * neither this nor `lastAttemptAt`.
10799
+ */
10800
+ lastError: string().optional()
10779
10801
  });
10780
10802
  /**
10781
10803
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10938,8 +10960,16 @@ var BackupScheduleSchema = object({
10938
10960
  retentionCount: number().int().min(1).max(1e3),
10939
10961
  /** Optional subset of source locations to include; omitted = all. */
10940
10962
  dataSources: array(string()).readonly().optional(),
10941
- /** ms-epoch of last successful run. */
10942
- lastRunAt: number().optional(),
10963
+ /**
10964
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10965
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10966
+ * "succeeded" — a run refused by every destination stamps it too.
10967
+ */
10968
+ lastAttemptAt: number().optional(),
10969
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10970
+ lastSuccessAt: number().optional(),
10971
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10972
+ lastError: string().optional(),
10943
10973
  /** ms-epoch of next computed firing (read-only, filled on list). */
10944
10974
  nextRunAt: number().optional()
10945
10975
  });
@@ -10988,14 +11018,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10988
11018
  locationId: string(),
10989
11019
  enabled: boolean(),
10990
11020
  retentionCount: number().int().min(1).max(1e3),
10991
- label: string().optional(),
10992
- /**
10993
- * Per-destination cron expression. Empty string clears the
10994
- * schedule (manual-only). Validated server-side via croner;
10995
- * malformed expressions reject the upsert with an actionable
10996
- * message.
10997
- */
10998
- cron: string().optional()
11021
+ label: string().optional()
10999
11022
  }), _void(), {
11000
11023
  kind: "mutation",
11001
11024
  auth: "admin"
@@ -21822,7 +21845,7 @@ method(object({
21822
21845
  downloadId: string(),
21823
21846
  offset: number(),
21824
21847
  length: number()
21825
- }), _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({
21848
+ }), _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({
21826
21849
  createdAt: true,
21827
21850
  updatedAt: true
21828
21851
  }), StorageLocationSchema, {
@@ -34671,12 +34694,6 @@ Object.freeze({
34671
34694
  addonId: null,
34672
34695
  access: "view"
34673
34696
  },
34674
- "storage.getDefaultLocation": {
34675
- capName: "storage",
34676
- capScope: "system",
34677
- addonId: null,
34678
- access: "view"
34679
- },
34680
34697
  "storage.list": {
34681
34698
  capName: "storage",
34682
34699
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-export-alexa",
3
- "version": "1.2.83",
3
+ "version": "1.2.85",
4
4
  "description": "Alexa Smart Home Skill export — hub-side OAuth provider + directive handler. The companion AWS Lambda forwards Alexa directives to this addon's /addon/export-alexa/directive endpoint.",
5
5
  "keywords": [
6
6
  "camstack",