@camstack/addon-decoder-nodeav 1.2.78 → 1.2.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +125 -127
- package/dist/index.mjs +125 -127
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7615,111 +7615,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7615
7615
|
fetchedAt: number()
|
|
7616
7616
|
});
|
|
7617
7617
|
/**
|
|
7618
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7619
|
-
* an addon declares its channels in.
|
|
7620
|
-
*
|
|
7621
|
-
* ## Two axes, deliberately separated
|
|
7622
|
-
*
|
|
7623
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7624
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7625
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7626
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7627
|
-
* `log-channels` capability enumerates the declarations.
|
|
7628
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7629
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7630
|
-
* over the values is the exact defect
|
|
7631
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7632
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7633
|
-
*
|
|
7634
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7635
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7636
|
-
* the hot path with a value somebody actually read, and by
|
|
7637
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7638
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7639
|
-
* disarmed one (D49).
|
|
7640
|
-
*
|
|
7641
|
-
* ## The canonical call shape
|
|
7642
|
-
*
|
|
7643
|
-
* ```ts
|
|
7644
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7645
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7646
|
-
* }
|
|
7647
|
-
* ```
|
|
7648
|
-
*
|
|
7649
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7650
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7651
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7652
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7653
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7654
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7655
|
-
*
|
|
7656
|
-
* ## Why a channel emits at `info`
|
|
7657
|
-
*
|
|
7658
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7659
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7660
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7661
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7662
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7663
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7664
|
-
*/
|
|
7665
|
-
/**
|
|
7666
|
-
* The level a channel writes at once armed.
|
|
7667
|
-
*
|
|
7668
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7669
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7670
|
-
* to read it later.
|
|
7671
|
-
*/
|
|
7672
|
-
var LogChannelLevelSchema = _enum([
|
|
7673
|
-
"info",
|
|
7674
|
-
"warn",
|
|
7675
|
-
"error"
|
|
7676
|
-
]);
|
|
7677
|
-
/**
|
|
7678
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7679
|
-
* declaration is inert.
|
|
7680
|
-
*/
|
|
7681
|
-
var LogChannelDescriptorSchema = object({
|
|
7682
|
-
/**
|
|
7683
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7684
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7685
|
-
* owns it without a second lookup.
|
|
7686
|
-
*/
|
|
7687
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7688
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7689
|
-
description: string().min(1),
|
|
7690
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7691
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7692
|
-
/**
|
|
7693
|
-
* Whether this channel can be narrowed to a camera.
|
|
7694
|
-
*
|
|
7695
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7696
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7697
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7698
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7699
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7700
|
-
* the body is the only way to filter.
|
|
7701
|
-
*
|
|
7702
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7703
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7704
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7705
|
-
* path was never taken.
|
|
7706
|
-
*/
|
|
7707
|
-
perDevice: boolean()
|
|
7708
|
-
});
|
|
7709
|
-
/**
|
|
7710
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7711
|
-
*
|
|
7712
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7713
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7714
|
-
*/
|
|
7715
|
-
var LogChannelWindowSchema = object({
|
|
7716
|
-
channel: string().min(1),
|
|
7717
|
-
/** Epoch ms the window closes at. */
|
|
7718
|
-
armedUntilMs: number(),
|
|
7719
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7720
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7721
|
-
});
|
|
7722
|
-
/**
|
|
7723
7618
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7724
7619
|
* recordings and events management surfaces.
|
|
7725
7620
|
*
|
|
@@ -8665,8 +8560,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8665
8560
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8666
8561
|
*
|
|
8667
8562
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8668
|
-
* The
|
|
8669
|
-
*
|
|
8563
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8564
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8565
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8566
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8567
|
+
* slug is `default`.
|
|
8670
8568
|
*
|
|
8671
8569
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8672
8570
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8687,21 +8585,20 @@ var StorageLocationSchema = object({
|
|
|
8687
8585
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8688
8586
|
*/
|
|
8689
8587
|
nodeId: string().optional(),
|
|
8690
|
-
isDefault: boolean().default(false),
|
|
8691
8588
|
isSystem: boolean().default(false),
|
|
8692
8589
|
/**
|
|
8693
|
-
*
|
|
8694
|
-
*
|
|
8695
|
-
*
|
|
8696
|
-
*
|
|
8697
|
-
*
|
|
8590
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8591
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8592
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8593
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8594
|
+
* written.
|
|
8698
8595
|
*
|
|
8699
|
-
* OPTIONAL
|
|
8700
|
-
*
|
|
8701
|
-
*
|
|
8702
|
-
*
|
|
8703
|
-
*
|
|
8704
|
-
*
|
|
8596
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8597
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8598
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8599
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8600
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8601
|
+
* stops existing rather than being re-derived on every read.
|
|
8705
8602
|
*/
|
|
8706
8603
|
enabled: boolean().optional(),
|
|
8707
8604
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8714,10 +8611,12 @@ var StorageLocationSchema = object({
|
|
|
8714
8611
|
createdAt: number(),
|
|
8715
8612
|
updatedAt: number()
|
|
8716
8613
|
});
|
|
8614
|
+
object({ isDefault: boolean().optional() });
|
|
8717
8615
|
/**
|
|
8718
8616
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8719
8617
|
* Either:
|
|
8720
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8618
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8619
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8721
8620
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8722
8621
|
*
|
|
8723
8622
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8893,6 +8792,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8893
8792
|
*/
|
|
8894
8793
|
debug: boolean().optional()
|
|
8895
8794
|
});
|
|
8795
|
+
/**
|
|
8796
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8797
|
+
* an addon declares its channels in.
|
|
8798
|
+
*
|
|
8799
|
+
* ## Two axes, deliberately separated
|
|
8800
|
+
*
|
|
8801
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8802
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8803
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8804
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8805
|
+
* `log-channels` capability enumerates the declarations.
|
|
8806
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8807
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8808
|
+
* over the values is the exact defect
|
|
8809
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8810
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8811
|
+
*
|
|
8812
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8813
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8814
|
+
* the hot path with a value somebody actually read, and by
|
|
8815
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8816
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8817
|
+
* disarmed one (D49).
|
|
8818
|
+
*
|
|
8819
|
+
* ## The canonical call shape
|
|
8820
|
+
*
|
|
8821
|
+
* ```ts
|
|
8822
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8823
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8824
|
+
* }
|
|
8825
|
+
* ```
|
|
8826
|
+
*
|
|
8827
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8828
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8829
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8830
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8831
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8832
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8833
|
+
*
|
|
8834
|
+
* ## Why a channel emits at `info`
|
|
8835
|
+
*
|
|
8836
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8837
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8838
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8839
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8840
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8841
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8842
|
+
*/
|
|
8843
|
+
/**
|
|
8844
|
+
* The level a channel writes at once armed.
|
|
8845
|
+
*
|
|
8846
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8847
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8848
|
+
* to read it later.
|
|
8849
|
+
*/
|
|
8850
|
+
var LogChannelLevelSchema = _enum([
|
|
8851
|
+
"info",
|
|
8852
|
+
"warn",
|
|
8853
|
+
"error"
|
|
8854
|
+
]);
|
|
8855
|
+
/**
|
|
8856
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8857
|
+
* declaration is inert.
|
|
8858
|
+
*/
|
|
8859
|
+
var LogChannelDescriptorSchema = object({
|
|
8860
|
+
/**
|
|
8861
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8862
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8863
|
+
* owns it without a second lookup.
|
|
8864
|
+
*/
|
|
8865
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8866
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8867
|
+
description: string().min(1),
|
|
8868
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8869
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8870
|
+
/**
|
|
8871
|
+
* Whether this channel can be narrowed to a camera.
|
|
8872
|
+
*
|
|
8873
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8874
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8875
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8876
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8877
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8878
|
+
* the body is the only way to filter.
|
|
8879
|
+
*
|
|
8880
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8881
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8882
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8883
|
+
* path was never taken.
|
|
8884
|
+
*/
|
|
8885
|
+
perDevice: boolean()
|
|
8886
|
+
});
|
|
8887
|
+
/**
|
|
8888
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8889
|
+
*
|
|
8890
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8891
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8892
|
+
*/
|
|
8893
|
+
var LogChannelWindowSchema = object({
|
|
8894
|
+
channel: string().min(1),
|
|
8895
|
+
/** Epoch ms the window closes at. */
|
|
8896
|
+
armedUntilMs: number(),
|
|
8897
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8898
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8899
|
+
});
|
|
8896
8900
|
var MODEL_FORMATS = [
|
|
8897
8901
|
"onnx",
|
|
8898
8902
|
"coreml",
|
|
@@ -21687,7 +21691,7 @@ method(object({
|
|
|
21687
21691
|
downloadId: string(),
|
|
21688
21692
|
offset: number(),
|
|
21689
21693
|
length: number()
|
|
21690
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
21694
|
+
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
|
|
21691
21695
|
createdAt: true,
|
|
21692
21696
|
updatedAt: true
|
|
21693
21697
|
}), StorageLocationSchema, {
|
|
@@ -34536,12 +34540,6 @@ Object.freeze({
|
|
|
34536
34540
|
addonId: null,
|
|
34537
34541
|
access: "view"
|
|
34538
34542
|
},
|
|
34539
|
-
"storage.getDefaultLocation": {
|
|
34540
|
-
capName: "storage",
|
|
34541
|
-
capScope: "system",
|
|
34542
|
-
addonId: null,
|
|
34543
|
-
access: "view"
|
|
34544
|
-
},
|
|
34545
34543
|
"storage.list": {
|
|
34546
34544
|
capName: "storage",
|
|
34547
34545
|
capScope: "system",
|
package/dist/index.mjs
CHANGED
|
@@ -7611,111 +7611,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7611
7611
|
fetchedAt: number()
|
|
7612
7612
|
});
|
|
7613
7613
|
/**
|
|
7614
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7615
|
-
* an addon declares its channels in.
|
|
7616
|
-
*
|
|
7617
|
-
* ## Two axes, deliberately separated
|
|
7618
|
-
*
|
|
7619
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7620
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7621
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7622
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7623
|
-
* `log-channels` capability enumerates the declarations.
|
|
7624
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7625
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7626
|
-
* over the values is the exact defect
|
|
7627
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7628
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7629
|
-
*
|
|
7630
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7631
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7632
|
-
* the hot path with a value somebody actually read, and by
|
|
7633
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7634
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7635
|
-
* disarmed one (D49).
|
|
7636
|
-
*
|
|
7637
|
-
* ## The canonical call shape
|
|
7638
|
-
*
|
|
7639
|
-
* ```ts
|
|
7640
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7641
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7642
|
-
* }
|
|
7643
|
-
* ```
|
|
7644
|
-
*
|
|
7645
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7646
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7647
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7648
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7649
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7650
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7651
|
-
*
|
|
7652
|
-
* ## Why a channel emits at `info`
|
|
7653
|
-
*
|
|
7654
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7655
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7656
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7657
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7658
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7659
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7660
|
-
*/
|
|
7661
|
-
/**
|
|
7662
|
-
* The level a channel writes at once armed.
|
|
7663
|
-
*
|
|
7664
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7665
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7666
|
-
* to read it later.
|
|
7667
|
-
*/
|
|
7668
|
-
var LogChannelLevelSchema = _enum([
|
|
7669
|
-
"info",
|
|
7670
|
-
"warn",
|
|
7671
|
-
"error"
|
|
7672
|
-
]);
|
|
7673
|
-
/**
|
|
7674
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7675
|
-
* declaration is inert.
|
|
7676
|
-
*/
|
|
7677
|
-
var LogChannelDescriptorSchema = object({
|
|
7678
|
-
/**
|
|
7679
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7680
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7681
|
-
* owns it without a second lookup.
|
|
7682
|
-
*/
|
|
7683
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7684
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7685
|
-
description: string().min(1),
|
|
7686
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7687
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7688
|
-
/**
|
|
7689
|
-
* Whether this channel can be narrowed to a camera.
|
|
7690
|
-
*
|
|
7691
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7692
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7693
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7694
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7695
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7696
|
-
* the body is the only way to filter.
|
|
7697
|
-
*
|
|
7698
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7699
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7700
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7701
|
-
* path was never taken.
|
|
7702
|
-
*/
|
|
7703
|
-
perDevice: boolean()
|
|
7704
|
-
});
|
|
7705
|
-
/**
|
|
7706
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7707
|
-
*
|
|
7708
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7709
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7710
|
-
*/
|
|
7711
|
-
var LogChannelWindowSchema = object({
|
|
7712
|
-
channel: string().min(1),
|
|
7713
|
-
/** Epoch ms the window closes at. */
|
|
7714
|
-
armedUntilMs: number(),
|
|
7715
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7716
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7717
|
-
});
|
|
7718
|
-
/**
|
|
7719
7614
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7720
7615
|
* recordings and events management surfaces.
|
|
7721
7616
|
*
|
|
@@ -8661,8 +8556,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8661
8556
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8662
8557
|
*
|
|
8663
8558
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8664
|
-
* The
|
|
8665
|
-
*
|
|
8559
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8560
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8561
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8562
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8563
|
+
* slug is `default`.
|
|
8666
8564
|
*
|
|
8667
8565
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8668
8566
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8683,21 +8581,20 @@ var StorageLocationSchema = object({
|
|
|
8683
8581
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8684
8582
|
*/
|
|
8685
8583
|
nodeId: string().optional(),
|
|
8686
|
-
isDefault: boolean().default(false),
|
|
8687
8584
|
isSystem: boolean().default(false),
|
|
8688
8585
|
/**
|
|
8689
|
-
*
|
|
8690
|
-
*
|
|
8691
|
-
*
|
|
8692
|
-
*
|
|
8693
|
-
*
|
|
8586
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8587
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8588
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8589
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8590
|
+
* written.
|
|
8694
8591
|
*
|
|
8695
|
-
* OPTIONAL
|
|
8696
|
-
*
|
|
8697
|
-
*
|
|
8698
|
-
*
|
|
8699
|
-
*
|
|
8700
|
-
*
|
|
8592
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8593
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8594
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8595
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8596
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8597
|
+
* stops existing rather than being re-derived on every read.
|
|
8701
8598
|
*/
|
|
8702
8599
|
enabled: boolean().optional(),
|
|
8703
8600
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8710,10 +8607,12 @@ var StorageLocationSchema = object({
|
|
|
8710
8607
|
createdAt: number(),
|
|
8711
8608
|
updatedAt: number()
|
|
8712
8609
|
});
|
|
8610
|
+
object({ isDefault: boolean().optional() });
|
|
8713
8611
|
/**
|
|
8714
8612
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8715
8613
|
* Either:
|
|
8716
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8614
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8615
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8717
8616
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8718
8617
|
*
|
|
8719
8618
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8889,6 +8788,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8889
8788
|
*/
|
|
8890
8789
|
debug: boolean().optional()
|
|
8891
8790
|
});
|
|
8791
|
+
/**
|
|
8792
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8793
|
+
* an addon declares its channels in.
|
|
8794
|
+
*
|
|
8795
|
+
* ## Two axes, deliberately separated
|
|
8796
|
+
*
|
|
8797
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8798
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8799
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8800
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8801
|
+
* `log-channels` capability enumerates the declarations.
|
|
8802
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8803
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8804
|
+
* over the values is the exact defect
|
|
8805
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8806
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8807
|
+
*
|
|
8808
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8809
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8810
|
+
* the hot path with a value somebody actually read, and by
|
|
8811
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8812
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8813
|
+
* disarmed one (D49).
|
|
8814
|
+
*
|
|
8815
|
+
* ## The canonical call shape
|
|
8816
|
+
*
|
|
8817
|
+
* ```ts
|
|
8818
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8819
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8820
|
+
* }
|
|
8821
|
+
* ```
|
|
8822
|
+
*
|
|
8823
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8824
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8825
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8826
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8827
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8828
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8829
|
+
*
|
|
8830
|
+
* ## Why a channel emits at `info`
|
|
8831
|
+
*
|
|
8832
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8833
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8834
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8835
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8836
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8837
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8838
|
+
*/
|
|
8839
|
+
/**
|
|
8840
|
+
* The level a channel writes at once armed.
|
|
8841
|
+
*
|
|
8842
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8843
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8844
|
+
* to read it later.
|
|
8845
|
+
*/
|
|
8846
|
+
var LogChannelLevelSchema = _enum([
|
|
8847
|
+
"info",
|
|
8848
|
+
"warn",
|
|
8849
|
+
"error"
|
|
8850
|
+
]);
|
|
8851
|
+
/**
|
|
8852
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8853
|
+
* declaration is inert.
|
|
8854
|
+
*/
|
|
8855
|
+
var LogChannelDescriptorSchema = object({
|
|
8856
|
+
/**
|
|
8857
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8858
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8859
|
+
* owns it without a second lookup.
|
|
8860
|
+
*/
|
|
8861
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8862
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8863
|
+
description: string().min(1),
|
|
8864
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8865
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8866
|
+
/**
|
|
8867
|
+
* Whether this channel can be narrowed to a camera.
|
|
8868
|
+
*
|
|
8869
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8870
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8871
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8872
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8873
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8874
|
+
* the body is the only way to filter.
|
|
8875
|
+
*
|
|
8876
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8877
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8878
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8879
|
+
* path was never taken.
|
|
8880
|
+
*/
|
|
8881
|
+
perDevice: boolean()
|
|
8882
|
+
});
|
|
8883
|
+
/**
|
|
8884
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8885
|
+
*
|
|
8886
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8887
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8888
|
+
*/
|
|
8889
|
+
var LogChannelWindowSchema = object({
|
|
8890
|
+
channel: string().min(1),
|
|
8891
|
+
/** Epoch ms the window closes at. */
|
|
8892
|
+
armedUntilMs: number(),
|
|
8893
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8894
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8895
|
+
});
|
|
8892
8896
|
var MODEL_FORMATS = [
|
|
8893
8897
|
"onnx",
|
|
8894
8898
|
"coreml",
|
|
@@ -21683,7 +21687,7 @@ method(object({
|
|
|
21683
21687
|
downloadId: string(),
|
|
21684
21688
|
offset: number(),
|
|
21685
21689
|
length: number()
|
|
21686
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
21690
|
+
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(_void(), array(StorageLocationDeclarationSchema).readonly()), method(StorageLocationSchema.omit({
|
|
21687
21691
|
createdAt: true,
|
|
21688
21692
|
updatedAt: true
|
|
21689
21693
|
}), StorageLocationSchema, {
|
|
@@ -34532,12 +34536,6 @@ Object.freeze({
|
|
|
34532
34536
|
addonId: null,
|
|
34533
34537
|
access: "view"
|
|
34534
34538
|
},
|
|
34535
|
-
"storage.getDefaultLocation": {
|
|
34536
|
-
capName: "storage",
|
|
34537
|
-
capScope: "system",
|
|
34538
|
-
addonId: null,
|
|
34539
|
-
access: "view"
|
|
34540
|
-
},
|
|
34541
34539
|
"storage.list": {
|
|
34542
34540
|
capName: "storage",
|
|
34543
34541
|
capScope: "system",
|