@camstack/addon-provider-rtsp 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/addon.js +125 -127
- package/dist/addon.mjs +125 -127
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7671,111 +7671,6 @@ function classifyStreams(streams) {
|
|
|
7671
7671
|
return result;
|
|
7672
7672
|
}
|
|
7673
7673
|
/**
|
|
7674
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7675
|
-
* an addon declares its channels in.
|
|
7676
|
-
*
|
|
7677
|
-
* ## Two axes, deliberately separated
|
|
7678
|
-
*
|
|
7679
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7680
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7681
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7682
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7683
|
-
* `log-channels` capability enumerates the declarations.
|
|
7684
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7685
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7686
|
-
* over the values is the exact defect
|
|
7687
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7688
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7689
|
-
*
|
|
7690
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7691
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7692
|
-
* the hot path with a value somebody actually read, and by
|
|
7693
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7694
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7695
|
-
* disarmed one (D49).
|
|
7696
|
-
*
|
|
7697
|
-
* ## The canonical call shape
|
|
7698
|
-
*
|
|
7699
|
-
* ```ts
|
|
7700
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7701
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7702
|
-
* }
|
|
7703
|
-
* ```
|
|
7704
|
-
*
|
|
7705
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7706
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7707
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7708
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7709
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7710
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7711
|
-
*
|
|
7712
|
-
* ## Why a channel emits at `info`
|
|
7713
|
-
*
|
|
7714
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7715
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7716
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7717
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7718
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7719
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7720
|
-
*/
|
|
7721
|
-
/**
|
|
7722
|
-
* The level a channel writes at once armed.
|
|
7723
|
-
*
|
|
7724
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7725
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7726
|
-
* to read it later.
|
|
7727
|
-
*/
|
|
7728
|
-
var LogChannelLevelSchema = _enum([
|
|
7729
|
-
"info",
|
|
7730
|
-
"warn",
|
|
7731
|
-
"error"
|
|
7732
|
-
]);
|
|
7733
|
-
/**
|
|
7734
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7735
|
-
* declaration is inert.
|
|
7736
|
-
*/
|
|
7737
|
-
var LogChannelDescriptorSchema = object({
|
|
7738
|
-
/**
|
|
7739
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7740
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7741
|
-
* owns it without a second lookup.
|
|
7742
|
-
*/
|
|
7743
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7744
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7745
|
-
description: string().min(1),
|
|
7746
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7747
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7748
|
-
/**
|
|
7749
|
-
* Whether this channel can be narrowed to a camera.
|
|
7750
|
-
*
|
|
7751
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7752
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7753
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7754
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7755
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7756
|
-
* the body is the only way to filter.
|
|
7757
|
-
*
|
|
7758
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7759
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7760
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7761
|
-
* path was never taken.
|
|
7762
|
-
*/
|
|
7763
|
-
perDevice: boolean()
|
|
7764
|
-
});
|
|
7765
|
-
/**
|
|
7766
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7767
|
-
*
|
|
7768
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7769
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7770
|
-
*/
|
|
7771
|
-
var LogChannelWindowSchema = object({
|
|
7772
|
-
channel: string().min(1),
|
|
7773
|
-
/** Epoch ms the window closes at. */
|
|
7774
|
-
armedUntilMs: number(),
|
|
7775
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7776
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7777
|
-
});
|
|
7778
|
-
/**
|
|
7779
7674
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7780
7675
|
* recordings and events management surfaces.
|
|
7781
7676
|
*
|
|
@@ -8721,8 +8616,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8721
8616
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8722
8617
|
*
|
|
8723
8618
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8724
|
-
* The
|
|
8725
|
-
*
|
|
8619
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8620
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8621
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8622
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8623
|
+
* slug is `default`.
|
|
8726
8624
|
*
|
|
8727
8625
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8728
8626
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8743,21 +8641,20 @@ var StorageLocationSchema = object({
|
|
|
8743
8641
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8744
8642
|
*/
|
|
8745
8643
|
nodeId: string().optional(),
|
|
8746
|
-
isDefault: boolean().default(false),
|
|
8747
8644
|
isSystem: boolean().default(false),
|
|
8748
8645
|
/**
|
|
8749
|
-
*
|
|
8750
|
-
*
|
|
8751
|
-
*
|
|
8752
|
-
*
|
|
8753
|
-
*
|
|
8646
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8647
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8648
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8649
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8650
|
+
* written.
|
|
8754
8651
|
*
|
|
8755
|
-
* OPTIONAL
|
|
8756
|
-
*
|
|
8757
|
-
*
|
|
8758
|
-
*
|
|
8759
|
-
*
|
|
8760
|
-
*
|
|
8652
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8653
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8654
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8655
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8656
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8657
|
+
* stops existing rather than being re-derived on every read.
|
|
8761
8658
|
*/
|
|
8762
8659
|
enabled: boolean().optional(),
|
|
8763
8660
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8770,10 +8667,12 @@ var StorageLocationSchema = object({
|
|
|
8770
8667
|
createdAt: number(),
|
|
8771
8668
|
updatedAt: number()
|
|
8772
8669
|
});
|
|
8670
|
+
object({ isDefault: boolean().optional() });
|
|
8773
8671
|
/**
|
|
8774
8672
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8775
8673
|
* Either:
|
|
8776
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8674
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8675
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8777
8676
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8778
8677
|
*
|
|
8779
8678
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8949,6 +8848,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8949
8848
|
*/
|
|
8950
8849
|
debug: boolean().optional()
|
|
8951
8850
|
});
|
|
8851
|
+
/**
|
|
8852
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8853
|
+
* an addon declares its channels in.
|
|
8854
|
+
*
|
|
8855
|
+
* ## Two axes, deliberately separated
|
|
8856
|
+
*
|
|
8857
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8858
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8859
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8860
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8861
|
+
* `log-channels` capability enumerates the declarations.
|
|
8862
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8863
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8864
|
+
* over the values is the exact defect
|
|
8865
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8866
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8867
|
+
*
|
|
8868
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8869
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8870
|
+
* the hot path with a value somebody actually read, and by
|
|
8871
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8872
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8873
|
+
* disarmed one (D49).
|
|
8874
|
+
*
|
|
8875
|
+
* ## The canonical call shape
|
|
8876
|
+
*
|
|
8877
|
+
* ```ts
|
|
8878
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8879
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8880
|
+
* }
|
|
8881
|
+
* ```
|
|
8882
|
+
*
|
|
8883
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8884
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8885
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8886
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8887
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8888
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8889
|
+
*
|
|
8890
|
+
* ## Why a channel emits at `info`
|
|
8891
|
+
*
|
|
8892
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8893
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8894
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8895
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8896
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8897
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8898
|
+
*/
|
|
8899
|
+
/**
|
|
8900
|
+
* The level a channel writes at once armed.
|
|
8901
|
+
*
|
|
8902
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8903
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8904
|
+
* to read it later.
|
|
8905
|
+
*/
|
|
8906
|
+
var LogChannelLevelSchema = _enum([
|
|
8907
|
+
"info",
|
|
8908
|
+
"warn",
|
|
8909
|
+
"error"
|
|
8910
|
+
]);
|
|
8911
|
+
/**
|
|
8912
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8913
|
+
* declaration is inert.
|
|
8914
|
+
*/
|
|
8915
|
+
var LogChannelDescriptorSchema = object({
|
|
8916
|
+
/**
|
|
8917
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8918
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8919
|
+
* owns it without a second lookup.
|
|
8920
|
+
*/
|
|
8921
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8922
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8923
|
+
description: string().min(1),
|
|
8924
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8925
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8926
|
+
/**
|
|
8927
|
+
* Whether this channel can be narrowed to a camera.
|
|
8928
|
+
*
|
|
8929
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8930
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8931
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8932
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8933
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8934
|
+
* the body is the only way to filter.
|
|
8935
|
+
*
|
|
8936
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8937
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8938
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8939
|
+
* path was never taken.
|
|
8940
|
+
*/
|
|
8941
|
+
perDevice: boolean()
|
|
8942
|
+
});
|
|
8943
|
+
/**
|
|
8944
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8945
|
+
*
|
|
8946
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8947
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8948
|
+
*/
|
|
8949
|
+
var LogChannelWindowSchema = object({
|
|
8950
|
+
channel: string().min(1),
|
|
8951
|
+
/** Epoch ms the window closes at. */
|
|
8952
|
+
armedUntilMs: number(),
|
|
8953
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8954
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8955
|
+
});
|
|
8952
8956
|
var MODEL_FORMATS = [
|
|
8953
8957
|
"onnx",
|
|
8954
8958
|
"coreml",
|
|
@@ -22085,7 +22089,7 @@ method(object({
|
|
|
22085
22089
|
downloadId: string(),
|
|
22086
22090
|
offset: number(),
|
|
22087
22091
|
length: number()
|
|
22088
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22092
|
+
}), _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({
|
|
22089
22093
|
createdAt: true,
|
|
22090
22094
|
updatedAt: true
|
|
22091
22095
|
}), StorageLocationSchema, {
|
|
@@ -39004,12 +39008,6 @@ Object.freeze({
|
|
|
39004
39008
|
addonId: null,
|
|
39005
39009
|
access: "view"
|
|
39006
39010
|
},
|
|
39007
|
-
"storage.getDefaultLocation": {
|
|
39008
|
-
capName: "storage",
|
|
39009
|
-
capScope: "system",
|
|
39010
|
-
addonId: null,
|
|
39011
|
-
access: "view"
|
|
39012
|
-
},
|
|
39013
39011
|
"storage.list": {
|
|
39014
39012
|
capName: "storage",
|
|
39015
39013
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -7647,111 +7647,6 @@ function classifyStreams(streams) {
|
|
|
7647
7647
|
return result;
|
|
7648
7648
|
}
|
|
7649
7649
|
/**
|
|
7650
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7651
|
-
* an addon declares its channels in.
|
|
7652
|
-
*
|
|
7653
|
-
* ## Two axes, deliberately separated
|
|
7654
|
-
*
|
|
7655
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7656
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7657
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7658
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7659
|
-
* `log-channels` capability enumerates the declarations.
|
|
7660
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7661
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7662
|
-
* over the values is the exact defect
|
|
7663
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7664
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7665
|
-
*
|
|
7666
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7667
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7668
|
-
* the hot path with a value somebody actually read, and by
|
|
7669
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7670
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7671
|
-
* disarmed one (D49).
|
|
7672
|
-
*
|
|
7673
|
-
* ## The canonical call shape
|
|
7674
|
-
*
|
|
7675
|
-
* ```ts
|
|
7676
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7677
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7678
|
-
* }
|
|
7679
|
-
* ```
|
|
7680
|
-
*
|
|
7681
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7682
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7683
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7684
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7685
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7686
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7687
|
-
*
|
|
7688
|
-
* ## Why a channel emits at `info`
|
|
7689
|
-
*
|
|
7690
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7691
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7692
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7693
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7694
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7695
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7696
|
-
*/
|
|
7697
|
-
/**
|
|
7698
|
-
* The level a channel writes at once armed.
|
|
7699
|
-
*
|
|
7700
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7701
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7702
|
-
* to read it later.
|
|
7703
|
-
*/
|
|
7704
|
-
var LogChannelLevelSchema = _enum([
|
|
7705
|
-
"info",
|
|
7706
|
-
"warn",
|
|
7707
|
-
"error"
|
|
7708
|
-
]);
|
|
7709
|
-
/**
|
|
7710
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7711
|
-
* declaration is inert.
|
|
7712
|
-
*/
|
|
7713
|
-
var LogChannelDescriptorSchema = object({
|
|
7714
|
-
/**
|
|
7715
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7716
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7717
|
-
* owns it without a second lookup.
|
|
7718
|
-
*/
|
|
7719
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7720
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7721
|
-
description: string().min(1),
|
|
7722
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7723
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7724
|
-
/**
|
|
7725
|
-
* Whether this channel can be narrowed to a camera.
|
|
7726
|
-
*
|
|
7727
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7728
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7729
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7730
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7731
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7732
|
-
* the body is the only way to filter.
|
|
7733
|
-
*
|
|
7734
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7735
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7736
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7737
|
-
* path was never taken.
|
|
7738
|
-
*/
|
|
7739
|
-
perDevice: boolean()
|
|
7740
|
-
});
|
|
7741
|
-
/**
|
|
7742
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7743
|
-
*
|
|
7744
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7745
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7746
|
-
*/
|
|
7747
|
-
var LogChannelWindowSchema = object({
|
|
7748
|
-
channel: string().min(1),
|
|
7749
|
-
/** Epoch ms the window closes at. */
|
|
7750
|
-
armedUntilMs: number(),
|
|
7751
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7752
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7753
|
-
});
|
|
7754
|
-
/**
|
|
7755
7650
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7756
7651
|
* recordings and events management surfaces.
|
|
7757
7652
|
*
|
|
@@ -8697,8 +8592,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8697
8592
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8698
8593
|
*
|
|
8699
8594
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8700
|
-
* The
|
|
8701
|
-
*
|
|
8595
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8596
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8597
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8598
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8599
|
+
* slug is `default`.
|
|
8702
8600
|
*
|
|
8703
8601
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8704
8602
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8719,21 +8617,20 @@ var StorageLocationSchema = object({
|
|
|
8719
8617
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8720
8618
|
*/
|
|
8721
8619
|
nodeId: string().optional(),
|
|
8722
|
-
isDefault: boolean().default(false),
|
|
8723
8620
|
isSystem: boolean().default(false),
|
|
8724
8621
|
/**
|
|
8725
|
-
*
|
|
8726
|
-
*
|
|
8727
|
-
*
|
|
8728
|
-
*
|
|
8729
|
-
*
|
|
8622
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8623
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8624
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8625
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8626
|
+
* written.
|
|
8730
8627
|
*
|
|
8731
|
-
* OPTIONAL
|
|
8732
|
-
*
|
|
8733
|
-
*
|
|
8734
|
-
*
|
|
8735
|
-
*
|
|
8736
|
-
*
|
|
8628
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8629
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8630
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8631
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8632
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8633
|
+
* stops existing rather than being re-derived on every read.
|
|
8737
8634
|
*/
|
|
8738
8635
|
enabled: boolean().optional(),
|
|
8739
8636
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8746,10 +8643,12 @@ var StorageLocationSchema = object({
|
|
|
8746
8643
|
createdAt: number(),
|
|
8747
8644
|
updatedAt: number()
|
|
8748
8645
|
});
|
|
8646
|
+
object({ isDefault: boolean().optional() });
|
|
8749
8647
|
/**
|
|
8750
8648
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8751
8649
|
* Either:
|
|
8752
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8650
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8651
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8753
8652
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8754
8653
|
*
|
|
8755
8654
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8925,6 +8824,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8925
8824
|
*/
|
|
8926
8825
|
debug: boolean().optional()
|
|
8927
8826
|
});
|
|
8827
|
+
/**
|
|
8828
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8829
|
+
* an addon declares its channels in.
|
|
8830
|
+
*
|
|
8831
|
+
* ## Two axes, deliberately separated
|
|
8832
|
+
*
|
|
8833
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8834
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8835
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8836
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8837
|
+
* `log-channels` capability enumerates the declarations.
|
|
8838
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8839
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8840
|
+
* over the values is the exact defect
|
|
8841
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8842
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8843
|
+
*
|
|
8844
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8845
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8846
|
+
* the hot path with a value somebody actually read, and by
|
|
8847
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8848
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8849
|
+
* disarmed one (D49).
|
|
8850
|
+
*
|
|
8851
|
+
* ## The canonical call shape
|
|
8852
|
+
*
|
|
8853
|
+
* ```ts
|
|
8854
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8855
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8856
|
+
* }
|
|
8857
|
+
* ```
|
|
8858
|
+
*
|
|
8859
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8860
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8861
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8862
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8863
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8864
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8865
|
+
*
|
|
8866
|
+
* ## Why a channel emits at `info`
|
|
8867
|
+
*
|
|
8868
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8869
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8870
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8871
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8872
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8873
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8874
|
+
*/
|
|
8875
|
+
/**
|
|
8876
|
+
* The level a channel writes at once armed.
|
|
8877
|
+
*
|
|
8878
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8879
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8880
|
+
* to read it later.
|
|
8881
|
+
*/
|
|
8882
|
+
var LogChannelLevelSchema = _enum([
|
|
8883
|
+
"info",
|
|
8884
|
+
"warn",
|
|
8885
|
+
"error"
|
|
8886
|
+
]);
|
|
8887
|
+
/**
|
|
8888
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8889
|
+
* declaration is inert.
|
|
8890
|
+
*/
|
|
8891
|
+
var LogChannelDescriptorSchema = object({
|
|
8892
|
+
/**
|
|
8893
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8894
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8895
|
+
* owns it without a second lookup.
|
|
8896
|
+
*/
|
|
8897
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8898
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8899
|
+
description: string().min(1),
|
|
8900
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8901
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8902
|
+
/**
|
|
8903
|
+
* Whether this channel can be narrowed to a camera.
|
|
8904
|
+
*
|
|
8905
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8906
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8907
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8908
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8909
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8910
|
+
* the body is the only way to filter.
|
|
8911
|
+
*
|
|
8912
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8913
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8914
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8915
|
+
* path was never taken.
|
|
8916
|
+
*/
|
|
8917
|
+
perDevice: boolean()
|
|
8918
|
+
});
|
|
8919
|
+
/**
|
|
8920
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8921
|
+
*
|
|
8922
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8923
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8924
|
+
*/
|
|
8925
|
+
var LogChannelWindowSchema = object({
|
|
8926
|
+
channel: string().min(1),
|
|
8927
|
+
/** Epoch ms the window closes at. */
|
|
8928
|
+
armedUntilMs: number(),
|
|
8929
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8930
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8931
|
+
});
|
|
8928
8932
|
var MODEL_FORMATS = [
|
|
8929
8933
|
"onnx",
|
|
8930
8934
|
"coreml",
|
|
@@ -22061,7 +22065,7 @@ method(object({
|
|
|
22061
22065
|
downloadId: string(),
|
|
22062
22066
|
offset: number(),
|
|
22063
22067
|
length: number()
|
|
22064
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22068
|
+
}), _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({
|
|
22065
22069
|
createdAt: true,
|
|
22066
22070
|
updatedAt: true
|
|
22067
22071
|
}), StorageLocationSchema, {
|
|
@@ -38980,12 +38984,6 @@ Object.freeze({
|
|
|
38980
38984
|
addonId: null,
|
|
38981
38985
|
access: "view"
|
|
38982
38986
|
},
|
|
38983
|
-
"storage.getDefaultLocation": {
|
|
38984
|
-
capName: "storage",
|
|
38985
|
-
capScope: "system",
|
|
38986
|
-
addonId: null,
|
|
38987
|
-
access: "view"
|
|
38988
|
-
},
|
|
38989
38987
|
"storage.list": {
|
|
38990
38988
|
capName: "storage",
|
|
38991
38989
|
capScope: "system",
|