@camstack/addon-agent-ui 1.2.82 → 1.2.84

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