@camstack/addon-import-alexa 0.2.76 → 0.2.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +158 -141
  2. package/dist/addon.mjs +158 -141
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -7773,111 +7773,6 @@ var CameraSwitchGroupSchema = object({
7773
7773
  fetchedAt: number()
7774
7774
  });
7775
7775
  /**
7776
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7777
- * an addon declares its channels in.
7778
- *
7779
- * ## Two axes, deliberately separated
7780
- *
7781
- * - **DECLARATION** — which channels exist. Only the addon knows:
7782
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7783
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7784
- * and rots silently. So a channel is declared where it is consulted, and the
7785
- * `log-channels` capability enumerates the declarations.
7786
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7787
- * thing: the logging settings document on the `system` cap. Two authorities
7788
- * over the values is the exact defect
7789
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7790
- * remove; re-introducing it from the cure side would be grotesque.
7791
- *
7792
- * Nothing in this file reads a clock, an env var or a store. The registry is
7793
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7794
- * the hot path with a value somebody actually read, and by
7795
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7796
- * never reaches here, so it can neither disarm an armed channel nor arm a
7797
- * disarmed one (D49).
7798
- *
7799
- * ## The canonical call shape
7800
- *
7801
- * ```ts
7802
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7803
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7804
- * }
7805
- * ```
7806
- *
7807
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7808
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7809
- * object literal is never constructed because it lives inside the branch. It
7810
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7811
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7812
- * destination floor (measured at 1.93 ns/call when off).
7813
- *
7814
- * ## Why a channel emits at `info`
7815
- *
7816
- * `loki-logging.addon.ts` pins the destination default at `info` and
7817
- * `loki-destination.ts` drops everything below it, so a line emitted at
7818
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7819
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7820
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7821
- * emits at the channel's declared level, whose schema floor is `info`.
7822
- */
7823
- /**
7824
- * The level a channel writes at once armed.
7825
- *
7826
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7827
- * not leave the process for Loki, and the whole point of arming a channel is
7828
- * to read it later.
7829
- */
7830
- var LogChannelLevelSchema = _enum([
7831
- "info",
7832
- "warn",
7833
- "error"
7834
- ]);
7835
- /**
7836
- * What an addon declares about one channel. No value, no state — a
7837
- * declaration is inert.
7838
- */
7839
- var LogChannelDescriptorSchema = object({
7840
- /**
7841
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7842
- * the addon's short name so an operator reading a channel list can tell who
7843
- * owns it without a second lookup.
7844
- */
7845
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7846
- /** One sentence: what the operator will SEE after arming it. */
7847
- description: string().min(1),
7848
- /** The level its lines are emitted at. Never below `info`. */
7849
- defaultLevel: LogChannelLevelSchema,
7850
- /**
7851
- * Whether this channel can be narrowed to a camera.
7852
- *
7853
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7854
- * consulted with the numeric device id, AND every line the channel admits
7855
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7856
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7857
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7858
- * the body is the only way to filter.
7859
- *
7860
- * A channel whose lines carry the device only in `meta` (or not at all) is
7861
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7862
- * the operator narrows to one camera, sees nothing, and concludes the code
7863
- * path was never taken.
7864
- */
7865
- perDevice: boolean()
7866
- });
7867
- /**
7868
- * An armed window over one channel, as the document hands it to a mirror.
7869
- *
7870
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7871
- * expires by itself, which is the one failure a boolean cannot avoid.
7872
- */
7873
- var LogChannelWindowSchema = object({
7874
- channel: string().min(1),
7875
- /** Epoch ms the window closes at. */
7876
- armedUntilMs: number(),
7877
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7878
- deviceIds: array(number().int()).readonly().nullable()
7879
- });
7880
- /**
7881
7776
  * Ops-log — the durable, append-only operations audit shared by the
7882
7777
  * recordings and events management surfaces.
7883
7778
  *
@@ -8823,8 +8718,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8823
8718
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8824
8719
  *
8825
8720
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8826
- * The default location for a type uses `id === <type>:default` by
8827
- * convention (the bare type ref like `'backups'` resolves to it).
8721
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8722
+ * There is no default location any more (D383): `enabled` is the whole write
8723
+ * model, and a bare type ref resolves to the sole location of the type, or —
8724
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8725
+ * slug is `default`.
8828
8726
  *
8829
8727
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8830
8728
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8845,21 +8743,20 @@ var StorageLocationSchema = object({
8845
8743
  * flag at upsert time, not here (the schema is provider-agnostic).
8846
8744
  */
8847
8745
  nodeId: string().optional(),
8848
- isDefault: boolean().default(false),
8849
8746
  isSystem: boolean().default(false),
8850
8747
  /**
8851
- * Operator opt-in: whether consumers that BALANCE across several locations
8852
- * of a type may write here. Recordings reads it today; event media and
8853
- * backups are the next consumers, which is why the flag lives on the
8854
- * location rather than in any one addon's store — nothing has to be
8855
- * extended to add the next consumer.
8748
+ * THE write switch, and the only one (D383). `enabled: true` means every
8749
+ * consumer that chooses a write target for this type may write here, and all
8750
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8751
+ * still read, still played back, still age-swept, still drained, never
8752
+ * written.
8856
8753
  *
8857
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8858
- * flag existed reads back with no flag and keeps working exactly as before;
8859
- * that is the whole compat story, and it is why no migration ships with it.
8860
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8861
- * disk must not silently start writing to it); the default of a type is
8862
- * always stamped `true`.
8754
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8755
+ * stored" on an update and "born inert unless it is the first location of its
8756
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8757
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8758
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8759
+ * stops existing rather than being re-derived on every read.
8863
8760
  */
8864
8761
  enabled: boolean().optional(),
8865
8762
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8872,10 +8769,12 @@ var StorageLocationSchema = object({
8872
8769
  createdAt: number(),
8873
8770
  updatedAt: number()
8874
8771
  });
8772
+ object({ isDefault: boolean().optional() });
8875
8773
  /**
8876
8774
  * Reference accepted by consumer-facing `api.storage.*` calls.
8877
8775
  * Either:
8878
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8776
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8777
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8879
8778
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8880
8779
  *
8881
8780
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9051,6 +8950,111 @@ var DecoderSessionConfigSchema = object({
9051
8950
  */
9052
8951
  debug: boolean().optional()
9053
8952
  });
8953
+ /**
8954
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8955
+ * an addon declares its channels in.
8956
+ *
8957
+ * ## Two axes, deliberately separated
8958
+ *
8959
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8960
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8961
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8962
+ * and rots silently. So a channel is declared where it is consulted, and the
8963
+ * `log-channels` capability enumerates the declarations.
8964
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8965
+ * thing: the logging settings document on the `system` cap. Two authorities
8966
+ * over the values is the exact defect
8967
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8968
+ * remove; re-introducing it from the cure side would be grotesque.
8969
+ *
8970
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8971
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8972
+ * the hot path with a value somebody actually read, and by
8973
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8974
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8975
+ * disarmed one (D49).
8976
+ *
8977
+ * ## The canonical call shape
8978
+ *
8979
+ * ```ts
8980
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8981
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8982
+ * }
8983
+ * ```
8984
+ *
8985
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8986
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8987
+ * object literal is never constructed because it lives inside the branch. It
8988
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8989
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8990
+ * destination floor (measured at 1.93 ns/call when off).
8991
+ *
8992
+ * ## Why a channel emits at `info`
8993
+ *
8994
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8995
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8996
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8997
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8998
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8999
+ * emits at the channel's declared level, whose schema floor is `info`.
9000
+ */
9001
+ /**
9002
+ * The level a channel writes at once armed.
9003
+ *
9004
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9005
+ * not leave the process for Loki, and the whole point of arming a channel is
9006
+ * to read it later.
9007
+ */
9008
+ var LogChannelLevelSchema = _enum([
9009
+ "info",
9010
+ "warn",
9011
+ "error"
9012
+ ]);
9013
+ /**
9014
+ * What an addon declares about one channel. No value, no state — a
9015
+ * declaration is inert.
9016
+ */
9017
+ var LogChannelDescriptorSchema = object({
9018
+ /**
9019
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9020
+ * the addon's short name so an operator reading a channel list can tell who
9021
+ * owns it without a second lookup.
9022
+ */
9023
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9024
+ /** One sentence: what the operator will SEE after arming it. */
9025
+ description: string().min(1),
9026
+ /** The level its lines are emitted at. Never below `info`. */
9027
+ defaultLevel: LogChannelLevelSchema,
9028
+ /**
9029
+ * Whether this channel can be narrowed to a camera.
9030
+ *
9031
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9032
+ * consulted with the numeric device id, AND every line the channel admits
9033
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9034
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9035
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9036
+ * the body is the only way to filter.
9037
+ *
9038
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9039
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9040
+ * the operator narrows to one camera, sees nothing, and concludes the code
9041
+ * path was never taken.
9042
+ */
9043
+ perDevice: boolean()
9044
+ });
9045
+ /**
9046
+ * An armed window over one channel, as the document hands it to a mirror.
9047
+ *
9048
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9049
+ * expires by itself, which is the one failure a boolean cannot avoid.
9050
+ */
9051
+ var LogChannelWindowSchema = object({
9052
+ channel: string().min(1),
9053
+ /** Epoch ms the window closes at. */
9054
+ armedUntilMs: number(),
9055
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9056
+ deviceIds: array(number().int()).readonly().nullable()
9057
+ });
9054
9058
  var MODEL_FORMATS = [
9055
9059
  "onnx",
9056
9060
  "coreml",
@@ -10726,12 +10730,30 @@ var BackupDestinationInfoSchema = object({
10726
10730
  lastSuccessAt: number().optional(),
10727
10731
  /** Newest-archive size from `manifests.json`, or undefined. */
10728
10732
  lastSuccessSizeBytes: number().optional(),
10729
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10733
+ /**
10734
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10735
+ * destination, comma-joined. Absent when no enabled schedule targets it
10736
+ * — a destination nothing is scheduled to write to must not advertise a
10737
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10738
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10739
+ * and reading it made a destination with a DISABLED schedule claim a
10740
+ * nightly run.
10741
+ */
10730
10742
  cron: string().optional(),
10731
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10743
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10732
10744
  nextRunAt: number().optional(),
10733
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10734
- lastRunAt: number().optional()
10745
+ /**
10746
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10747
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10748
+ * newest archive that actually landed) and `lastError`.
10749
+ */
10750
+ lastAttemptAt: number().optional(),
10751
+ /**
10752
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10753
+ * landed the archive. A destination that has never been written to has
10754
+ * neither this nor `lastAttemptAt`.
10755
+ */
10756
+ lastError: string().optional()
10735
10757
  });
10736
10758
  /**
10737
10759
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10894,8 +10916,16 @@ var BackupScheduleSchema = object({
10894
10916
  retentionCount: number().int().min(1).max(1e3),
10895
10917
  /** Optional subset of source locations to include; omitted = all. */
10896
10918
  dataSources: array(string()).readonly().optional(),
10897
- /** ms-epoch of last successful run. */
10898
- lastRunAt: number().optional(),
10919
+ /**
10920
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10921
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10922
+ * "succeeded" — a run refused by every destination stamps it too.
10923
+ */
10924
+ lastAttemptAt: number().optional(),
10925
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10926
+ lastSuccessAt: number().optional(),
10927
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10928
+ lastError: string().optional(),
10899
10929
  /** ms-epoch of next computed firing (read-only, filled on list). */
10900
10930
  nextRunAt: number().optional()
10901
10931
  });
@@ -10944,14 +10974,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10944
10974
  locationId: string(),
10945
10975
  enabled: boolean(),
10946
10976
  retentionCount: number().int().min(1).max(1e3),
10947
- label: string().optional(),
10948
- /**
10949
- * Per-destination cron expression. Empty string clears the
10950
- * schedule (manual-only). Validated server-side via croner;
10951
- * malformed expressions reject the upsert with an actionable
10952
- * message.
10953
- */
10954
- cron: string().optional()
10977
+ label: string().optional()
10955
10978
  }), _void(), {
10956
10979
  kind: "mutation",
10957
10980
  auth: "admin"
@@ -22149,7 +22172,7 @@ method(object({
22149
22172
  downloadId: string(),
22150
22173
  offset: number(),
22151
22174
  length: number()
22152
- }), _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({
22175
+ }), _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({
22153
22176
  createdAt: true,
22154
22177
  updatedAt: true
22155
22178
  }), StorageLocationSchema, {
@@ -39011,12 +39034,6 @@ Object.freeze({
39011
39034
  addonId: null,
39012
39035
  access: "view"
39013
39036
  },
39014
- "storage.getDefaultLocation": {
39015
- capName: "storage",
39016
- capScope: "system",
39017
- addonId: null,
39018
- access: "view"
39019
- },
39020
39037
  "storage.list": {
39021
39038
  capName: "storage",
39022
39039
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -7773,111 +7773,6 @@ var CameraSwitchGroupSchema = object({
7773
7773
  fetchedAt: number()
7774
7774
  });
7775
7775
  /**
7776
- * Per-component log CHANNELS — the gate a hot path consults, and the registry
7777
- * an addon declares its channels in.
7778
- *
7779
- * ## Two axes, deliberately separated
7780
- *
7781
- * - **DECLARATION** — which channels exist. Only the addon knows:
7782
- * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7783
- * baichuan/handshake. A hand-wired central list rots at the first addition,
7784
- * and rots silently. So a channel is declared where it is consulted, and the
7785
- * `log-channels` capability enumerates the declarations.
7786
- * - **VALUE** — at which level, for which scope, until when. That stays ONE
7787
- * thing: the logging settings document on the `system` cap. Two authorities
7788
- * over the values is the exact defect
7789
- * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7790
- * remove; re-introducing it from the cure side would be grotesque.
7791
- *
7792
- * Nothing in this file reads a clock, an env var or a store. The registry is
7793
- * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7794
- * the hot path with a value somebody actually read, and by
7795
- * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7796
- * never reaches here, so it can neither disarm an armed channel nor arm a
7797
- * disarmed one (D49).
7798
- *
7799
- * ## The canonical call shape
7800
- *
7801
- * ```ts
7802
- * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7803
- * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7804
- * }
7805
- * ```
7806
- *
7807
- * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7808
- * read. Disarmed, a call site costs one load and one branch, and the `extras`
7809
- * object literal is never constructed because it lives inside the branch. It
7810
- * is the same shape already proven in production at `stream-broker.ts:1650`,
7811
- * and the same discipline `LoggingGate.allowsDestination` uses for the
7812
- * destination floor (measured at 1.93 ns/call when off).
7813
- *
7814
- * ## Why a channel emits at `info`
7815
- *
7816
- * `loki-logging.addon.ts` pins the destination default at `info` and
7817
- * `loki-destination.ts` drops everything below it, so a line emitted at
7818
- * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7819
- * minutes. A diagnostic that cannot be read an hour later is worse than no
7820
- * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7821
- * emits at the channel's declared level, whose schema floor is `info`.
7822
- */
7823
- /**
7824
- * The level a channel writes at once armed.
7825
- *
7826
- * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7827
- * not leave the process for Loki, and the whole point of arming a channel is
7828
- * to read it later.
7829
- */
7830
- var LogChannelLevelSchema = _enum([
7831
- "info",
7832
- "warn",
7833
- "error"
7834
- ]);
7835
- /**
7836
- * What an addon declares about one channel. No value, no state — a
7837
- * declaration is inert.
7838
- */
7839
- var LogChannelDescriptorSchema = object({
7840
- /**
7841
- * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7842
- * the addon's short name so an operator reading a channel list can tell who
7843
- * owns it without a second lookup.
7844
- */
7845
- name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7846
- /** One sentence: what the operator will SEE after arming it. */
7847
- description: string().min(1),
7848
- /** The level its lines are emitted at. Never below `info`. */
7849
- defaultLevel: LogChannelLevelSchema,
7850
- /**
7851
- * Whether this channel can be narrowed to a camera.
7852
- *
7853
- * `true` is a PROMISE with two halves, and both must hold: the gate is
7854
- * consulted with the numeric device id, AND every line the channel admits
7855
- * carries `tags: { deviceId }` with that same numeric id. The second half is
7856
- * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7857
- * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7858
- * the body is the only way to filter.
7859
- *
7860
- * A channel whose lines carry the device only in `meta` (or not at all) is
7861
- * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7862
- * the operator narrows to one camera, sees nothing, and concludes the code
7863
- * path was never taken.
7864
- */
7865
- perDevice: boolean()
7866
- });
7867
- /**
7868
- * An armed window over one channel, as the document hands it to a mirror.
7869
- *
7870
- * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7871
- * expires by itself, which is the one failure a boolean cannot avoid.
7872
- */
7873
- var LogChannelWindowSchema = object({
7874
- channel: string().min(1),
7875
- /** Epoch ms the window closes at. */
7876
- armedUntilMs: number(),
7877
- /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7878
- deviceIds: array(number().int()).readonly().nullable()
7879
- });
7880
- /**
7881
7776
  * Ops-log — the durable, append-only operations audit shared by the
7882
7777
  * recordings and events management surfaces.
7883
7778
  *
@@ -8823,8 +8718,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
8823
8718
  * `STORAGE_LOCATION_CARDINALITY` map has been removed.
8824
8719
  *
8825
8720
  * `id` is a stable namespaced string of the form `<type>:<slug>`.
8826
- * The default location for a type uses `id === <type>:default` by
8827
- * convention (the bare type ref like `'backups'` resolves to it).
8721
+ * The seed names its first instance `<type>:default` — a NAME, not a flag.
8722
+ * There is no default location any more (D383): `enabled` is the whole write
8723
+ * model, and a bare type ref resolves to the sole location of the type, or —
8724
+ * transitionally, only while legacy NULL-stamped rows exist — to the row whose
8725
+ * slug is `default`.
8828
8726
  *
8829
8727
  * `isSystem` is a legacy persisted flag. Seed still creates the initial
8830
8728
  * `<type>:default` locations; the flag is no longer a lock, a badge, or a
@@ -8845,21 +8743,20 @@ var StorageLocationSchema = object({
8845
8743
  * flag at upsert time, not here (the schema is provider-agnostic).
8846
8744
  */
8847
8745
  nodeId: string().optional(),
8848
- isDefault: boolean().default(false),
8849
8746
  isSystem: boolean().default(false),
8850
8747
  /**
8851
- * Operator opt-in: whether consumers that BALANCE across several locations
8852
- * of a type may write here. Recordings reads it today; event media and
8853
- * backups are the next consumers, which is why the flag lives on the
8854
- * location rather than in any one addon's store — nothing has to be
8855
- * extended to add the next consumer.
8748
+ * THE write switch, and the only one (D383). `enabled: true` means every
8749
+ * consumer that chooses a write target for this type may write here, and all
8750
+ * enabled locations of a type are used TOGETHER; `false` means read-only —
8751
+ * still read, still played back, still age-swept, still drained, never
8752
+ * written.
8856
8753
  *
8857
- * OPTIONAL, and ABSENT MEANS ACTIVE. Every location persisted before the
8858
- * flag existed reads back with no flag and keeps working exactly as before;
8859
- * that is the whole compat story, and it is why no migration ships with it.
8860
- * A newly CREATED sibling is stamped `false` by the orchestrator (creating a
8861
- * disk must not silently start writing to it); the default of a type is
8862
- * always stamped `true`.
8754
+ * OPTIONAL only for the wire: an upsert that omits it means "leave what is
8755
+ * stored" on an update and "born inert unless it is the first location of its
8756
+ * type" on a create. On a PERSISTED row absence is legacy and it means
8757
+ * enabled — {@link isLocationEnabled} is the one place that says so, and the
8758
+ * orchestrator stamps every flagless row `true` once at hydrate so absence
8759
+ * stops existing rather than being re-derived on every read.
8863
8760
  */
8864
8761
  enabled: boolean().optional(),
8865
8762
  /** COMPUTED at read time by the orchestrator (statfs of the backing volume
@@ -8872,10 +8769,12 @@ var StorageLocationSchema = object({
8872
8769
  createdAt: number(),
8873
8770
  updatedAt: number()
8874
8771
  });
8772
+ object({ isDefault: boolean().optional() });
8875
8773
  /**
8876
8774
  * Reference accepted by consumer-facing `api.storage.*` calls.
8877
8775
  * Either:
8878
- * - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
8776
+ * - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
8777
+ * (transitionally, the `<type>:default`-slugged row when several exist)
8879
8778
  * - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
8880
8779
  *
8881
8780
  * The orchestrator's `resolveRef(ref)` handles both cases.
@@ -9051,6 +8950,111 @@ var DecoderSessionConfigSchema = object({
9051
8950
  */
9052
8951
  debug: boolean().optional()
9053
8952
  });
8953
+ /**
8954
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
8955
+ * an addon declares its channels in.
8956
+ *
8957
+ * ## Two axes, deliberately separated
8958
+ *
8959
+ * - **DECLARATION** — which channels exist. Only the addon knows:
8960
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
8961
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
8962
+ * and rots silently. So a channel is declared where it is consulted, and the
8963
+ * `log-channels` capability enumerates the declarations.
8964
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
8965
+ * thing: the logging settings document on the `system` cap. Two authorities
8966
+ * over the values is the exact defect
8967
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
8968
+ * remove; re-introducing it from the cure side would be grotesque.
8969
+ *
8970
+ * Nothing in this file reads a clock, an env var or a store. The registry is
8971
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
8972
+ * the hot path with a value somebody actually read, and by
8973
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
8974
+ * never reaches here, so it can neither disarm an armed channel nor arm a
8975
+ * disarmed one (D49).
8976
+ *
8977
+ * ## The canonical call shape
8978
+ *
8979
+ * ```ts
8980
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
8981
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
8982
+ * }
8983
+ * ```
8984
+ *
8985
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
8986
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
8987
+ * object literal is never constructed because it lives inside the branch. It
8988
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
8989
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
8990
+ * destination floor (measured at 1.93 ns/call when off).
8991
+ *
8992
+ * ## Why a channel emits at `info`
8993
+ *
8994
+ * `loki-logging.addon.ts` pins the destination default at `info` and
8995
+ * `loki-destination.ts` drops everything below it, so a line emitted at
8996
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
8997
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
8998
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
8999
+ * emits at the channel's declared level, whose schema floor is `info`.
9000
+ */
9001
+ /**
9002
+ * The level a channel writes at once armed.
9003
+ *
9004
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
9005
+ * not leave the process for Loki, and the whole point of arming a channel is
9006
+ * to read it later.
9007
+ */
9008
+ var LogChannelLevelSchema = _enum([
9009
+ "info",
9010
+ "warn",
9011
+ "error"
9012
+ ]);
9013
+ /**
9014
+ * What an addon declares about one channel. No value, no state — a
9015
+ * declaration is inert.
9016
+ */
9017
+ var LogChannelDescriptorSchema = object({
9018
+ /**
9019
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
9020
+ * the addon's short name so an operator reading a channel list can tell who
9021
+ * owns it without a second lookup.
9022
+ */
9023
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
9024
+ /** One sentence: what the operator will SEE after arming it. */
9025
+ description: string().min(1),
9026
+ /** The level its lines are emitted at. Never below `info`. */
9027
+ defaultLevel: LogChannelLevelSchema,
9028
+ /**
9029
+ * Whether this channel can be narrowed to a camera.
9030
+ *
9031
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
9032
+ * consulted with the numeric device id, AND every line the channel admits
9033
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
9034
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
9035
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
9036
+ * the body is the only way to filter.
9037
+ *
9038
+ * A channel whose lines carry the device only in `meta` (or not at all) is
9039
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
9040
+ * the operator narrows to one camera, sees nothing, and concludes the code
9041
+ * path was never taken.
9042
+ */
9043
+ perDevice: boolean()
9044
+ });
9045
+ /**
9046
+ * An armed window over one channel, as the document hands it to a mirror.
9047
+ *
9048
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
9049
+ * expires by itself, which is the one failure a boolean cannot avoid.
9050
+ */
9051
+ var LogChannelWindowSchema = object({
9052
+ channel: string().min(1),
9053
+ /** Epoch ms the window closes at. */
9054
+ armedUntilMs: number(),
9055
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
9056
+ deviceIds: array(number().int()).readonly().nullable()
9057
+ });
9054
9058
  var MODEL_FORMATS = [
9055
9059
  "onnx",
9056
9060
  "coreml",
@@ -10726,12 +10730,30 @@ var BackupDestinationInfoSchema = object({
10726
10730
  lastSuccessAt: number().optional(),
10727
10731
  /** Newest-archive size from `manifests.json`, or undefined. */
10728
10732
  lastSuccessSizeBytes: number().optional(),
10729
- /** Per-destination cron expression. Empty = manual-only (no schedule). */
10733
+ /**
10734
+ * Cron cadence(s) of the ENABLED schedules that fan out to this
10735
+ * destination, comma-joined. Absent when no enabled schedule targets it
10736
+ * — a destination nothing is scheduled to write to must not advertise a
10737
+ * cadence (D384). This is never the `backup_destination_policies.cron`
10738
+ * column: that per-location cron has scheduled nothing since 2026-07-28
10739
+ * and reading it made a destination with a DISABLED schedule claim a
10740
+ * nightly run.
10741
+ */
10730
10742
  cron: string().optional(),
10731
- /** ms-epoch of next computed firing for this destination's cron, if any. */
10743
+ /** ms-epoch of the next firing across those schedules (earliest), if any. */
10732
10744
  nextRunAt: number().optional(),
10733
- /** ms-epoch of last successful scheduled run (mirrors policy.lastRunAt). */
10734
- lastRunAt: number().optional()
10745
+ /**
10746
+ * ms-epoch of the last time a run ATTEMPTED to write here — success or
10747
+ * failure. Never a success stamp: pair it with `lastSuccessAt` (the
10748
+ * newest archive that actually landed) and `lastError`.
10749
+ */
10750
+ lastAttemptAt: number().optional(),
10751
+ /**
10752
+ * Why the last attempt failed, verbatim. Absent when the last attempt
10753
+ * landed the archive. A destination that has never been written to has
10754
+ * neither this nor `lastAttemptAt`.
10755
+ */
10756
+ lastError: string().optional()
10735
10757
  });
10736
10758
  /**
10737
10759
  * Per-archive entry returned by `backup.listArchives({ destinationId })`.
@@ -10894,8 +10916,16 @@ var BackupScheduleSchema = object({
10894
10916
  retentionCount: number().int().min(1).max(1e3),
10895
10917
  /** Optional subset of source locations to include; omitted = all. */
10896
10918
  dataSources: array(string()).readonly().optional(),
10897
- /** ms-epoch of last successful run. */
10898
- lastRunAt: number().optional(),
10919
+ /**
10920
+ * ms-epoch of the last tick that FIRED this schedule. Stamped before the
10921
+ * archive runs (it is the dedupe anchor), so it says "attempted", never
10922
+ * "succeeded" — a run refused by every destination stamps it too.
10923
+ */
10924
+ lastAttemptAt: number().optional(),
10925
+ /** ms-epoch of the last run of this schedule that landed at ≥1 destination. */
10926
+ lastSuccessAt: number().optional(),
10927
+ /** Why the last fired run failed, verbatim. Absent when it succeeded. */
10928
+ lastError: string().optional(),
10899
10929
  /** ms-epoch of next computed firing (read-only, filled on list). */
10900
10930
  nextRunAt: number().optional()
10901
10931
  });
@@ -10944,14 +10974,7 @@ method(_void(), array(BackupDestinationInfoSchema).readonly(), { auth: "admin" }
10944
10974
  locationId: string(),
10945
10975
  enabled: boolean(),
10946
10976
  retentionCount: number().int().min(1).max(1e3),
10947
- label: string().optional(),
10948
- /**
10949
- * Per-destination cron expression. Empty string clears the
10950
- * schedule (manual-only). Validated server-side via croner;
10951
- * malformed expressions reject the upsert with an actionable
10952
- * message.
10953
- */
10954
- cron: string().optional()
10977
+ label: string().optional()
10955
10978
  }), _void(), {
10956
10979
  kind: "mutation",
10957
10980
  auth: "admin"
@@ -22149,7 +22172,7 @@ method(object({
22149
22172
  downloadId: string(),
22150
22173
  offset: number(),
22151
22174
  length: number()
22152
- }), _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({
22175
+ }), _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({
22153
22176
  createdAt: true,
22154
22177
  updatedAt: true
22155
22178
  }), StorageLocationSchema, {
@@ -39011,12 +39034,6 @@ Object.freeze({
39011
39034
  addonId: null,
39012
39035
  access: "view"
39013
39036
  },
39014
- "storage.getDefaultLocation": {
39015
- capName: "storage",
39016
- capScope: "system",
39017
- addonId: null,
39018
- access: "view"
39019
- },
39020
39037
  "storage.list": {
39021
39038
  capName: "storage",
39022
39039
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",