@camstack/addon-terminal 0.1.83 → 0.1.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.
- package/dist/addon.js +125 -127
- package/dist/addon.mjs +125 -127
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7714,111 +7714,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7714
7714
|
var DETECTION_PIPELINE_CAP_NAME = "detection-pipeline";
|
|
7715
7715
|
var AUDIO_ANALYSIS_CAP_NAME = "audio-analysis";
|
|
7716
7716
|
/**
|
|
7717
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7718
|
-
* an addon declares its channels in.
|
|
7719
|
-
*
|
|
7720
|
-
* ## Two axes, deliberately separated
|
|
7721
|
-
*
|
|
7722
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7723
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7724
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7725
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7726
|
-
* `log-channels` capability enumerates the declarations.
|
|
7727
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7728
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7729
|
-
* over the values is the exact defect
|
|
7730
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7731
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7732
|
-
*
|
|
7733
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7734
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7735
|
-
* the hot path with a value somebody actually read, and by
|
|
7736
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7737
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7738
|
-
* disarmed one (D49).
|
|
7739
|
-
*
|
|
7740
|
-
* ## The canonical call shape
|
|
7741
|
-
*
|
|
7742
|
-
* ```ts
|
|
7743
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7744
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7745
|
-
* }
|
|
7746
|
-
* ```
|
|
7747
|
-
*
|
|
7748
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7749
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7750
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7751
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7752
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7753
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7754
|
-
*
|
|
7755
|
-
* ## Why a channel emits at `info`
|
|
7756
|
-
*
|
|
7757
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7758
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7759
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7760
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7761
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7762
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7763
|
-
*/
|
|
7764
|
-
/**
|
|
7765
|
-
* The level a channel writes at once armed.
|
|
7766
|
-
*
|
|
7767
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7768
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7769
|
-
* to read it later.
|
|
7770
|
-
*/
|
|
7771
|
-
var LogChannelLevelSchema = _enum([
|
|
7772
|
-
"info",
|
|
7773
|
-
"warn",
|
|
7774
|
-
"error"
|
|
7775
|
-
]);
|
|
7776
|
-
/**
|
|
7777
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7778
|
-
* declaration is inert.
|
|
7779
|
-
*/
|
|
7780
|
-
var LogChannelDescriptorSchema = object({
|
|
7781
|
-
/**
|
|
7782
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7783
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7784
|
-
* owns it without a second lookup.
|
|
7785
|
-
*/
|
|
7786
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7787
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7788
|
-
description: string().min(1),
|
|
7789
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7790
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7791
|
-
/**
|
|
7792
|
-
* Whether this channel can be narrowed to a camera.
|
|
7793
|
-
*
|
|
7794
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7795
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7796
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7797
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7798
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7799
|
-
* the body is the only way to filter.
|
|
7800
|
-
*
|
|
7801
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7802
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7803
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7804
|
-
* path was never taken.
|
|
7805
|
-
*/
|
|
7806
|
-
perDevice: boolean()
|
|
7807
|
-
});
|
|
7808
|
-
/**
|
|
7809
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7810
|
-
*
|
|
7811
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7812
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7813
|
-
*/
|
|
7814
|
-
var LogChannelWindowSchema = object({
|
|
7815
|
-
channel: string().min(1),
|
|
7816
|
-
/** Epoch ms the window closes at. */
|
|
7817
|
-
armedUntilMs: number(),
|
|
7818
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7819
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7820
|
-
});
|
|
7821
|
-
/**
|
|
7822
7717
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7823
7718
|
* recordings and events management surfaces.
|
|
7824
7719
|
*
|
|
@@ -8764,8 +8659,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8764
8659
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8765
8660
|
*
|
|
8766
8661
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8767
|
-
* The
|
|
8768
|
-
*
|
|
8662
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8663
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8664
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8665
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8666
|
+
* slug is `default`.
|
|
8769
8667
|
*
|
|
8770
8668
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8771
8669
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8786,21 +8684,20 @@ var StorageLocationSchema = object({
|
|
|
8786
8684
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8787
8685
|
*/
|
|
8788
8686
|
nodeId: string().optional(),
|
|
8789
|
-
isDefault: boolean().default(false),
|
|
8790
8687
|
isSystem: boolean().default(false),
|
|
8791
8688
|
/**
|
|
8792
|
-
*
|
|
8793
|
-
*
|
|
8794
|
-
*
|
|
8795
|
-
*
|
|
8796
|
-
*
|
|
8689
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8690
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8691
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8692
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8693
|
+
* written.
|
|
8797
8694
|
*
|
|
8798
|
-
* OPTIONAL
|
|
8799
|
-
*
|
|
8800
|
-
*
|
|
8801
|
-
*
|
|
8802
|
-
*
|
|
8803
|
-
*
|
|
8695
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8696
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8697
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8698
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8699
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8700
|
+
* stops existing rather than being re-derived on every read.
|
|
8804
8701
|
*/
|
|
8805
8702
|
enabled: boolean().optional(),
|
|
8806
8703
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8813,10 +8710,12 @@ var StorageLocationSchema = object({
|
|
|
8813
8710
|
createdAt: number(),
|
|
8814
8711
|
updatedAt: number()
|
|
8815
8712
|
});
|
|
8713
|
+
object({ isDefault: boolean().optional() });
|
|
8816
8714
|
/**
|
|
8817
8715
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8818
8716
|
* Either:
|
|
8819
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8717
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8718
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8820
8719
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8821
8720
|
*
|
|
8822
8721
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8992,6 +8891,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8992
8891
|
*/
|
|
8993
8892
|
debug: boolean().optional()
|
|
8994
8893
|
});
|
|
8894
|
+
/**
|
|
8895
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8896
|
+
* an addon declares its channels in.
|
|
8897
|
+
*
|
|
8898
|
+
* ## Two axes, deliberately separated
|
|
8899
|
+
*
|
|
8900
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8901
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8902
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8903
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8904
|
+
* `log-channels` capability enumerates the declarations.
|
|
8905
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8906
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8907
|
+
* over the values is the exact defect
|
|
8908
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8909
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8910
|
+
*
|
|
8911
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8912
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8913
|
+
* the hot path with a value somebody actually read, and by
|
|
8914
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8915
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8916
|
+
* disarmed one (D49).
|
|
8917
|
+
*
|
|
8918
|
+
* ## The canonical call shape
|
|
8919
|
+
*
|
|
8920
|
+
* ```ts
|
|
8921
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8922
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8923
|
+
* }
|
|
8924
|
+
* ```
|
|
8925
|
+
*
|
|
8926
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8927
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8928
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8929
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8930
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8931
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8932
|
+
*
|
|
8933
|
+
* ## Why a channel emits at `info`
|
|
8934
|
+
*
|
|
8935
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8936
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8937
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8938
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8939
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8940
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8941
|
+
*/
|
|
8942
|
+
/**
|
|
8943
|
+
* The level a channel writes at once armed.
|
|
8944
|
+
*
|
|
8945
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8946
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8947
|
+
* to read it later.
|
|
8948
|
+
*/
|
|
8949
|
+
var LogChannelLevelSchema = _enum([
|
|
8950
|
+
"info",
|
|
8951
|
+
"warn",
|
|
8952
|
+
"error"
|
|
8953
|
+
]);
|
|
8954
|
+
/**
|
|
8955
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8956
|
+
* declaration is inert.
|
|
8957
|
+
*/
|
|
8958
|
+
var LogChannelDescriptorSchema = object({
|
|
8959
|
+
/**
|
|
8960
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8961
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8962
|
+
* owns it without a second lookup.
|
|
8963
|
+
*/
|
|
8964
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8965
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8966
|
+
description: string().min(1),
|
|
8967
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8968
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8969
|
+
/**
|
|
8970
|
+
* Whether this channel can be narrowed to a camera.
|
|
8971
|
+
*
|
|
8972
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8973
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8974
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8975
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8976
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8977
|
+
* the body is the only way to filter.
|
|
8978
|
+
*
|
|
8979
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8980
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8981
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8982
|
+
* path was never taken.
|
|
8983
|
+
*/
|
|
8984
|
+
perDevice: boolean()
|
|
8985
|
+
});
|
|
8986
|
+
/**
|
|
8987
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8988
|
+
*
|
|
8989
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8990
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8991
|
+
*/
|
|
8992
|
+
var LogChannelWindowSchema = object({
|
|
8993
|
+
channel: string().min(1),
|
|
8994
|
+
/** Epoch ms the window closes at. */
|
|
8995
|
+
armedUntilMs: number(),
|
|
8996
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8997
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8998
|
+
});
|
|
8995
8999
|
var MODEL_FORMATS = [
|
|
8996
9000
|
"onnx",
|
|
8997
9001
|
"coreml",
|
|
@@ -22047,7 +22051,7 @@ method(object({
|
|
|
22047
22051
|
downloadId: string(),
|
|
22048
22052
|
offset: number(),
|
|
22049
22053
|
length: number()
|
|
22050
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22054
|
+
}), _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({
|
|
22051
22055
|
createdAt: true,
|
|
22052
22056
|
updatedAt: true
|
|
22053
22057
|
}), StorageLocationSchema, {
|
|
@@ -38518,12 +38522,6 @@ Object.freeze({
|
|
|
38518
38522
|
addonId: null,
|
|
38519
38523
|
access: "view"
|
|
38520
38524
|
},
|
|
38521
|
-
"storage.getDefaultLocation": {
|
|
38522
|
-
capName: "storage",
|
|
38523
|
-
capScope: "system",
|
|
38524
|
-
addonId: null,
|
|
38525
|
-
access: "view"
|
|
38526
|
-
},
|
|
38527
38525
|
"storage.list": {
|
|
38528
38526
|
capName: "storage",
|
|
38529
38527
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -7691,111 +7691,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
7691
7691
|
var DETECTION_PIPELINE_CAP_NAME = "detection-pipeline";
|
|
7692
7692
|
var AUDIO_ANALYSIS_CAP_NAME = "audio-analysis";
|
|
7693
7693
|
/**
|
|
7694
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7695
|
-
* an addon declares its channels in.
|
|
7696
|
-
*
|
|
7697
|
-
* ## Two axes, deliberately separated
|
|
7698
|
-
*
|
|
7699
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7700
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7701
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7702
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7703
|
-
* `log-channels` capability enumerates the declarations.
|
|
7704
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7705
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7706
|
-
* over the values is the exact defect
|
|
7707
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7708
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
7709
|
-
*
|
|
7710
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7711
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7712
|
-
* the hot path with a value somebody actually read, and by
|
|
7713
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7714
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7715
|
-
* disarmed one (D49).
|
|
7716
|
-
*
|
|
7717
|
-
* ## The canonical call shape
|
|
7718
|
-
*
|
|
7719
|
-
* ```ts
|
|
7720
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7721
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7722
|
-
* }
|
|
7723
|
-
* ```
|
|
7724
|
-
*
|
|
7725
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7726
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7727
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
7728
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7729
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7730
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
7731
|
-
*
|
|
7732
|
-
* ## Why a channel emits at `info`
|
|
7733
|
-
*
|
|
7734
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7735
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7736
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7737
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7738
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7739
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7740
|
-
*/
|
|
7741
|
-
/**
|
|
7742
|
-
* The level a channel writes at once armed.
|
|
7743
|
-
*
|
|
7744
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7745
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7746
|
-
* to read it later.
|
|
7747
|
-
*/
|
|
7748
|
-
var LogChannelLevelSchema = _enum([
|
|
7749
|
-
"info",
|
|
7750
|
-
"warn",
|
|
7751
|
-
"error"
|
|
7752
|
-
]);
|
|
7753
|
-
/**
|
|
7754
|
-
* What an addon declares about one channel. No value, no state — a
|
|
7755
|
-
* declaration is inert.
|
|
7756
|
-
*/
|
|
7757
|
-
var LogChannelDescriptorSchema = object({
|
|
7758
|
-
/**
|
|
7759
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7760
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
7761
|
-
* owns it without a second lookup.
|
|
7762
|
-
*/
|
|
7763
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7764
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
7765
|
-
description: string().min(1),
|
|
7766
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
7767
|
-
defaultLevel: LogChannelLevelSchema,
|
|
7768
|
-
/**
|
|
7769
|
-
* Whether this channel can be narrowed to a camera.
|
|
7770
|
-
*
|
|
7771
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7772
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
7773
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7774
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7775
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7776
|
-
* the body is the only way to filter.
|
|
7777
|
-
*
|
|
7778
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7779
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7780
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7781
|
-
* path was never taken.
|
|
7782
|
-
*/
|
|
7783
|
-
perDevice: boolean()
|
|
7784
|
-
});
|
|
7785
|
-
/**
|
|
7786
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
7787
|
-
*
|
|
7788
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7789
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7790
|
-
*/
|
|
7791
|
-
var LogChannelWindowSchema = object({
|
|
7792
|
-
channel: string().min(1),
|
|
7793
|
-
/** Epoch ms the window closes at. */
|
|
7794
|
-
armedUntilMs: number(),
|
|
7795
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7796
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
7797
|
-
});
|
|
7798
|
-
/**
|
|
7799
7694
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7800
7695
|
* recordings and events management surfaces.
|
|
7801
7696
|
*
|
|
@@ -8741,8 +8636,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
8741
8636
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
8742
8637
|
*
|
|
8743
8638
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
8744
|
-
* The
|
|
8745
|
-
*
|
|
8639
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
8640
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
8641
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
8642
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
8643
|
+
* slug is `default`.
|
|
8746
8644
|
*
|
|
8747
8645
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
8748
8646
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -8763,21 +8661,20 @@ var StorageLocationSchema = object({
|
|
|
8763
8661
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
8764
8662
|
*/
|
|
8765
8663
|
nodeId: string().optional(),
|
|
8766
|
-
isDefault: boolean().default(false),
|
|
8767
8664
|
isSystem: boolean().default(false),
|
|
8768
8665
|
/**
|
|
8769
|
-
*
|
|
8770
|
-
*
|
|
8771
|
-
*
|
|
8772
|
-
*
|
|
8773
|
-
*
|
|
8666
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
8667
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
8668
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
8669
|
+
* still read, still played back, still age-swept, still drained, never
|
|
8670
|
+
* written.
|
|
8774
8671
|
*
|
|
8775
|
-
* OPTIONAL
|
|
8776
|
-
*
|
|
8777
|
-
*
|
|
8778
|
-
*
|
|
8779
|
-
*
|
|
8780
|
-
*
|
|
8672
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
8673
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
8674
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
8675
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
8676
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
8677
|
+
* stops existing rather than being re-derived on every read.
|
|
8781
8678
|
*/
|
|
8782
8679
|
enabled: boolean().optional(),
|
|
8783
8680
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -8790,10 +8687,12 @@ var StorageLocationSchema = object({
|
|
|
8790
8687
|
createdAt: number(),
|
|
8791
8688
|
updatedAt: number()
|
|
8792
8689
|
});
|
|
8690
|
+
object({ isDefault: boolean().optional() });
|
|
8793
8691
|
/**
|
|
8794
8692
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
8795
8693
|
* Either:
|
|
8796
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
8694
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
8695
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
8797
8696
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
8798
8697
|
*
|
|
8799
8698
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -8969,6 +8868,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
8969
8868
|
*/
|
|
8970
8869
|
debug: boolean().optional()
|
|
8971
8870
|
});
|
|
8871
|
+
/**
|
|
8872
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8873
|
+
* an addon declares its channels in.
|
|
8874
|
+
*
|
|
8875
|
+
* ## Two axes, deliberately separated
|
|
8876
|
+
*
|
|
8877
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8878
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8879
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8880
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8881
|
+
* `log-channels` capability enumerates the declarations.
|
|
8882
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8883
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8884
|
+
* over the values is the exact defect
|
|
8885
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8886
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8887
|
+
*
|
|
8888
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8889
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8890
|
+
* the hot path with a value somebody actually read, and by
|
|
8891
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8892
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8893
|
+
* disarmed one (D49).
|
|
8894
|
+
*
|
|
8895
|
+
* ## The canonical call shape
|
|
8896
|
+
*
|
|
8897
|
+
* ```ts
|
|
8898
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8899
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8900
|
+
* }
|
|
8901
|
+
* ```
|
|
8902
|
+
*
|
|
8903
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8904
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8905
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8906
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8907
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8908
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8909
|
+
*
|
|
8910
|
+
* ## Why a channel emits at `info`
|
|
8911
|
+
*
|
|
8912
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8913
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8914
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8915
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8916
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8917
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8918
|
+
*/
|
|
8919
|
+
/**
|
|
8920
|
+
* The level a channel writes at once armed.
|
|
8921
|
+
*
|
|
8922
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8923
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8924
|
+
* to read it later.
|
|
8925
|
+
*/
|
|
8926
|
+
var LogChannelLevelSchema = _enum([
|
|
8927
|
+
"info",
|
|
8928
|
+
"warn",
|
|
8929
|
+
"error"
|
|
8930
|
+
]);
|
|
8931
|
+
/**
|
|
8932
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8933
|
+
* declaration is inert.
|
|
8934
|
+
*/
|
|
8935
|
+
var LogChannelDescriptorSchema = object({
|
|
8936
|
+
/**
|
|
8937
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8938
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8939
|
+
* owns it without a second lookup.
|
|
8940
|
+
*/
|
|
8941
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8942
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8943
|
+
description: string().min(1),
|
|
8944
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8945
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8946
|
+
/**
|
|
8947
|
+
* Whether this channel can be narrowed to a camera.
|
|
8948
|
+
*
|
|
8949
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8950
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8951
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8952
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8953
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8954
|
+
* the body is the only way to filter.
|
|
8955
|
+
*
|
|
8956
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8957
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8958
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8959
|
+
* path was never taken.
|
|
8960
|
+
*/
|
|
8961
|
+
perDevice: boolean()
|
|
8962
|
+
});
|
|
8963
|
+
/**
|
|
8964
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8965
|
+
*
|
|
8966
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8967
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8968
|
+
*/
|
|
8969
|
+
var LogChannelWindowSchema = object({
|
|
8970
|
+
channel: string().min(1),
|
|
8971
|
+
/** Epoch ms the window closes at. */
|
|
8972
|
+
armedUntilMs: number(),
|
|
8973
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8974
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8975
|
+
});
|
|
8972
8976
|
var MODEL_FORMATS = [
|
|
8973
8977
|
"onnx",
|
|
8974
8978
|
"coreml",
|
|
@@ -22024,7 +22028,7 @@ method(object({
|
|
|
22024
22028
|
downloadId: string(),
|
|
22025
22029
|
offset: number(),
|
|
22026
22030
|
length: number()
|
|
22027
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22031
|
+
}), _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({
|
|
22028
22032
|
createdAt: true,
|
|
22029
22033
|
updatedAt: true
|
|
22030
22034
|
}), StorageLocationSchema, {
|
|
@@ -38495,12 +38499,6 @@ Object.freeze({
|
|
|
38495
38499
|
addonId: null,
|
|
38496
38500
|
access: "view"
|
|
38497
38501
|
},
|
|
38498
|
-
"storage.getDefaultLocation": {
|
|
38499
|
-
capName: "storage",
|
|
38500
|
-
capScope: "system",
|
|
38501
|
-
addonId: null,
|
|
38502
|
-
access: "view"
|
|
38503
|
-
},
|
|
38504
38502
|
"storage.list": {
|
|
38505
38503
|
capName: "storage",
|
|
38506
38504
|
capScope: "system",
|