@camstack/addon-provider-tuya 0.2.78 → 0.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
|
@@ -8435,111 +8435,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
8435
8435
|
fetchedAt: number()
|
|
8436
8436
|
});
|
|
8437
8437
|
/**
|
|
8438
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8439
|
-
* an addon declares its channels in.
|
|
8440
|
-
*
|
|
8441
|
-
* ## Two axes, deliberately separated
|
|
8442
|
-
*
|
|
8443
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8444
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8445
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8446
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8447
|
-
* `log-channels` capability enumerates the declarations.
|
|
8448
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8449
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8450
|
-
* over the values is the exact defect
|
|
8451
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8452
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
8453
|
-
*
|
|
8454
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8455
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8456
|
-
* the hot path with a value somebody actually read, and by
|
|
8457
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8458
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8459
|
-
* disarmed one (D49).
|
|
8460
|
-
*
|
|
8461
|
-
* ## The canonical call shape
|
|
8462
|
-
*
|
|
8463
|
-
* ```ts
|
|
8464
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8465
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8466
|
-
* }
|
|
8467
|
-
* ```
|
|
8468
|
-
*
|
|
8469
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8470
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8471
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
8472
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8473
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8474
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
8475
|
-
*
|
|
8476
|
-
* ## Why a channel emits at `info`
|
|
8477
|
-
*
|
|
8478
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8479
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8480
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8481
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8482
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8483
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8484
|
-
*/
|
|
8485
|
-
/**
|
|
8486
|
-
* The level a channel writes at once armed.
|
|
8487
|
-
*
|
|
8488
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8489
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8490
|
-
* to read it later.
|
|
8491
|
-
*/
|
|
8492
|
-
var LogChannelLevelSchema = _enum([
|
|
8493
|
-
"info",
|
|
8494
|
-
"warn",
|
|
8495
|
-
"error"
|
|
8496
|
-
]);
|
|
8497
|
-
/**
|
|
8498
|
-
* What an addon declares about one channel. No value, no state — a
|
|
8499
|
-
* declaration is inert.
|
|
8500
|
-
*/
|
|
8501
|
-
var LogChannelDescriptorSchema = object({
|
|
8502
|
-
/**
|
|
8503
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8504
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
8505
|
-
* owns it without a second lookup.
|
|
8506
|
-
*/
|
|
8507
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8508
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
8509
|
-
description: string().min(1),
|
|
8510
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
8511
|
-
defaultLevel: LogChannelLevelSchema,
|
|
8512
|
-
/**
|
|
8513
|
-
* Whether this channel can be narrowed to a camera.
|
|
8514
|
-
*
|
|
8515
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8516
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
8517
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8518
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8519
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8520
|
-
* the body is the only way to filter.
|
|
8521
|
-
*
|
|
8522
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8523
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8524
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8525
|
-
* path was never taken.
|
|
8526
|
-
*/
|
|
8527
|
-
perDevice: boolean()
|
|
8528
|
-
});
|
|
8529
|
-
/**
|
|
8530
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
8531
|
-
*
|
|
8532
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8533
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8534
|
-
*/
|
|
8535
|
-
var LogChannelWindowSchema = object({
|
|
8536
|
-
channel: string().min(1),
|
|
8537
|
-
/** Epoch ms the window closes at. */
|
|
8538
|
-
armedUntilMs: number(),
|
|
8539
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8540
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
8541
|
-
});
|
|
8542
|
-
/**
|
|
8543
8438
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
8544
8439
|
* recordings and events management surfaces.
|
|
8545
8440
|
*
|
|
@@ -9485,8 +9380,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
9485
9380
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
9486
9381
|
*
|
|
9487
9382
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
9488
|
-
* The
|
|
9489
|
-
*
|
|
9383
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
9384
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
9385
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
9386
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
9387
|
+
* slug is `default`.
|
|
9490
9388
|
*
|
|
9491
9389
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
9492
9390
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -9507,21 +9405,20 @@ var StorageLocationSchema = object({
|
|
|
9507
9405
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
9508
9406
|
*/
|
|
9509
9407
|
nodeId: string().optional(),
|
|
9510
|
-
isDefault: boolean().default(false),
|
|
9511
9408
|
isSystem: boolean().default(false),
|
|
9512
9409
|
/**
|
|
9513
|
-
*
|
|
9514
|
-
*
|
|
9515
|
-
*
|
|
9516
|
-
*
|
|
9517
|
-
*
|
|
9410
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
9411
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
9412
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
9413
|
+
* still read, still played back, still age-swept, still drained, never
|
|
9414
|
+
* written.
|
|
9518
9415
|
*
|
|
9519
|
-
* OPTIONAL
|
|
9520
|
-
*
|
|
9521
|
-
*
|
|
9522
|
-
*
|
|
9523
|
-
*
|
|
9524
|
-
*
|
|
9416
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
9417
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
9418
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
9419
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
9420
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
9421
|
+
* stops existing rather than being re-derived on every read.
|
|
9525
9422
|
*/
|
|
9526
9423
|
enabled: boolean().optional(),
|
|
9527
9424
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -9534,10 +9431,12 @@ var StorageLocationSchema = object({
|
|
|
9534
9431
|
createdAt: number(),
|
|
9535
9432
|
updatedAt: number()
|
|
9536
9433
|
});
|
|
9434
|
+
object({ isDefault: boolean().optional() });
|
|
9537
9435
|
/**
|
|
9538
9436
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
9539
9437
|
* Either:
|
|
9540
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
9438
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
9439
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
9541
9440
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
9542
9441
|
*
|
|
9543
9442
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -9713,6 +9612,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
9713
9612
|
*/
|
|
9714
9613
|
debug: boolean().optional()
|
|
9715
9614
|
});
|
|
9615
|
+
/**
|
|
9616
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
9617
|
+
* an addon declares its channels in.
|
|
9618
|
+
*
|
|
9619
|
+
* ## Two axes, deliberately separated
|
|
9620
|
+
*
|
|
9621
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
9622
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
9623
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
9624
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
9625
|
+
* `log-channels` capability enumerates the declarations.
|
|
9626
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
9627
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
9628
|
+
* over the values is the exact defect
|
|
9629
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
9630
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
9631
|
+
*
|
|
9632
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
9633
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
9634
|
+
* the hot path with a value somebody actually read, and by
|
|
9635
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
9636
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
9637
|
+
* disarmed one (D49).
|
|
9638
|
+
*
|
|
9639
|
+
* ## The canonical call shape
|
|
9640
|
+
*
|
|
9641
|
+
* ```ts
|
|
9642
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
9643
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
9644
|
+
* }
|
|
9645
|
+
* ```
|
|
9646
|
+
*
|
|
9647
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
9648
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
9649
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
9650
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
9651
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
9652
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
9653
|
+
*
|
|
9654
|
+
* ## Why a channel emits at `info`
|
|
9655
|
+
*
|
|
9656
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
9657
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
9658
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
9659
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
9660
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
9661
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
9662
|
+
*/
|
|
9663
|
+
/**
|
|
9664
|
+
* The level a channel writes at once armed.
|
|
9665
|
+
*
|
|
9666
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
9667
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
9668
|
+
* to read it later.
|
|
9669
|
+
*/
|
|
9670
|
+
var LogChannelLevelSchema = _enum([
|
|
9671
|
+
"info",
|
|
9672
|
+
"warn",
|
|
9673
|
+
"error"
|
|
9674
|
+
]);
|
|
9675
|
+
/**
|
|
9676
|
+
* What an addon declares about one channel. No value, no state — a
|
|
9677
|
+
* declaration is inert.
|
|
9678
|
+
*/
|
|
9679
|
+
var LogChannelDescriptorSchema = object({
|
|
9680
|
+
/**
|
|
9681
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
9682
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
9683
|
+
* owns it without a second lookup.
|
|
9684
|
+
*/
|
|
9685
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
9686
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
9687
|
+
description: string().min(1),
|
|
9688
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
9689
|
+
defaultLevel: LogChannelLevelSchema,
|
|
9690
|
+
/**
|
|
9691
|
+
* Whether this channel can be narrowed to a camera.
|
|
9692
|
+
*
|
|
9693
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
9694
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
9695
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
9696
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
9697
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
9698
|
+
* the body is the only way to filter.
|
|
9699
|
+
*
|
|
9700
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
9701
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
9702
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
9703
|
+
* path was never taken.
|
|
9704
|
+
*/
|
|
9705
|
+
perDevice: boolean()
|
|
9706
|
+
});
|
|
9707
|
+
/**
|
|
9708
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
9709
|
+
*
|
|
9710
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
9711
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
9712
|
+
*/
|
|
9713
|
+
var LogChannelWindowSchema = object({
|
|
9714
|
+
channel: string().min(1),
|
|
9715
|
+
/** Epoch ms the window closes at. */
|
|
9716
|
+
armedUntilMs: number(),
|
|
9717
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9718
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
9719
|
+
});
|
|
9716
9720
|
var MODEL_FORMATS = [
|
|
9717
9721
|
"onnx",
|
|
9718
9722
|
"coreml",
|
|
@@ -22762,7 +22766,7 @@ method(object({
|
|
|
22762
22766
|
downloadId: string(),
|
|
22763
22767
|
offset: number(),
|
|
22764
22768
|
length: number()
|
|
22765
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22769
|
+
}), _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({
|
|
22766
22770
|
createdAt: true,
|
|
22767
22771
|
updatedAt: true
|
|
22768
22772
|
}), StorageLocationSchema, {
|
|
@@ -39615,12 +39619,6 @@ Object.freeze({
|
|
|
39615
39619
|
addonId: null,
|
|
39616
39620
|
access: "view"
|
|
39617
39621
|
},
|
|
39618
|
-
"storage.getDefaultLocation": {
|
|
39619
|
-
capName: "storage",
|
|
39620
|
-
capScope: "system",
|
|
39621
|
-
addonId: null,
|
|
39622
|
-
access: "view"
|
|
39623
|
-
},
|
|
39624
39622
|
"storage.list": {
|
|
39625
39623
|
capName: "storage",
|
|
39626
39624
|
capScope: "system",
|
package/dist/addon.mjs
CHANGED
|
@@ -8434,111 +8434,6 @@ var CameraSwitchGroupSchema = object({
|
|
|
8434
8434
|
fetchedAt: number()
|
|
8435
8435
|
});
|
|
8436
8436
|
/**
|
|
8437
|
-
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8438
|
-
* an addon declares its channels in.
|
|
8439
|
-
*
|
|
8440
|
-
* ## Two axes, deliberately separated
|
|
8441
|
-
*
|
|
8442
|
-
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8443
|
-
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8444
|
-
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8445
|
-
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8446
|
-
* `log-channels` capability enumerates the declarations.
|
|
8447
|
-
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8448
|
-
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8449
|
-
* over the values is the exact defect
|
|
8450
|
-
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8451
|
-
* remove; re-introducing it from the cure side would be grotesque.
|
|
8452
|
-
*
|
|
8453
|
-
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8454
|
-
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8455
|
-
* the hot path with a value somebody actually read, and by
|
|
8456
|
-
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8457
|
-
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8458
|
-
* disarmed one (D49).
|
|
8459
|
-
*
|
|
8460
|
-
* ## The canonical call shape
|
|
8461
|
-
*
|
|
8462
|
-
* ```ts
|
|
8463
|
-
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8464
|
-
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8465
|
-
* }
|
|
8466
|
-
* ```
|
|
8467
|
-
*
|
|
8468
|
-
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8469
|
-
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8470
|
-
* object literal is never constructed because it lives inside the branch. It
|
|
8471
|
-
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8472
|
-
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8473
|
-
* destination floor (measured at 1.93 ns/call when off).
|
|
8474
|
-
*
|
|
8475
|
-
* ## Why a channel emits at `info`
|
|
8476
|
-
*
|
|
8477
|
-
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8478
|
-
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8479
|
-
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8480
|
-
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8481
|
-
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8482
|
-
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8483
|
-
*/
|
|
8484
|
-
/**
|
|
8485
|
-
* The level a channel writes at once armed.
|
|
8486
|
-
*
|
|
8487
|
-
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8488
|
-
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8489
|
-
* to read it later.
|
|
8490
|
-
*/
|
|
8491
|
-
var LogChannelLevelSchema = _enum([
|
|
8492
|
-
"info",
|
|
8493
|
-
"warn",
|
|
8494
|
-
"error"
|
|
8495
|
-
]);
|
|
8496
|
-
/**
|
|
8497
|
-
* What an addon declares about one channel. No value, no state — a
|
|
8498
|
-
* declaration is inert.
|
|
8499
|
-
*/
|
|
8500
|
-
var LogChannelDescriptorSchema = object({
|
|
8501
|
-
/**
|
|
8502
|
-
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8503
|
-
* the addon's short name so an operator reading a channel list can tell who
|
|
8504
|
-
* owns it without a second lookup.
|
|
8505
|
-
*/
|
|
8506
|
-
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8507
|
-
/** One sentence: what the operator will SEE after arming it. */
|
|
8508
|
-
description: string().min(1),
|
|
8509
|
-
/** The level its lines are emitted at. Never below `info`. */
|
|
8510
|
-
defaultLevel: LogChannelLevelSchema,
|
|
8511
|
-
/**
|
|
8512
|
-
* Whether this channel can be narrowed to a camera.
|
|
8513
|
-
*
|
|
8514
|
-
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8515
|
-
* consulted with the numeric device id, AND every line the channel admits
|
|
8516
|
-
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8517
|
-
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8518
|
-
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8519
|
-
* the body is the only way to filter.
|
|
8520
|
-
*
|
|
8521
|
-
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8522
|
-
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8523
|
-
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8524
|
-
* path was never taken.
|
|
8525
|
-
*/
|
|
8526
|
-
perDevice: boolean()
|
|
8527
|
-
});
|
|
8528
|
-
/**
|
|
8529
|
-
* An armed window over one channel, as the document hands it to a mirror.
|
|
8530
|
-
*
|
|
8531
|
-
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8532
|
-
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8533
|
-
*/
|
|
8534
|
-
var LogChannelWindowSchema = object({
|
|
8535
|
-
channel: string().min(1),
|
|
8536
|
-
/** Epoch ms the window closes at. */
|
|
8537
|
-
armedUntilMs: number(),
|
|
8538
|
-
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8539
|
-
deviceIds: array(number().int()).readonly().nullable()
|
|
8540
|
-
});
|
|
8541
|
-
/**
|
|
8542
8437
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
8543
8438
|
* recordings and events management surfaces.
|
|
8544
8439
|
*
|
|
@@ -9484,8 +9379,11 @@ var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
|
9484
9379
|
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
9485
9380
|
*
|
|
9486
9381
|
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
9487
|
-
* The
|
|
9488
|
-
*
|
|
9382
|
+
* The seed names its first instance `<type>:default` — a NAME, not a flag.
|
|
9383
|
+
* There is no default location any more (D383): `enabled` is the whole write
|
|
9384
|
+
* model, and a bare type ref resolves to the sole location of the type, or —
|
|
9385
|
+
* transitionally, only while legacy NULL-stamped rows exist — to the row whose
|
|
9386
|
+
* slug is `default`.
|
|
9489
9387
|
*
|
|
9490
9388
|
* `isSystem` is a legacy persisted flag. Seed still creates the initial
|
|
9491
9389
|
* `<type>:default` locations; the flag is no longer a lock, a badge, or a
|
|
@@ -9506,21 +9404,20 @@ var StorageLocationSchema = object({
|
|
|
9506
9404
|
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
9507
9405
|
*/
|
|
9508
9406
|
nodeId: string().optional(),
|
|
9509
|
-
isDefault: boolean().default(false),
|
|
9510
9407
|
isSystem: boolean().default(false),
|
|
9511
9408
|
/**
|
|
9512
|
-
*
|
|
9513
|
-
*
|
|
9514
|
-
*
|
|
9515
|
-
*
|
|
9516
|
-
*
|
|
9409
|
+
* THE write switch, and the only one (D383). `enabled: true` means every
|
|
9410
|
+
* consumer that chooses a write target for this type may write here, and all
|
|
9411
|
+
* enabled locations of a type are used TOGETHER; `false` means read-only —
|
|
9412
|
+
* still read, still played back, still age-swept, still drained, never
|
|
9413
|
+
* written.
|
|
9517
9414
|
*
|
|
9518
|
-
* OPTIONAL
|
|
9519
|
-
*
|
|
9520
|
-
*
|
|
9521
|
-
*
|
|
9522
|
-
*
|
|
9523
|
-
*
|
|
9415
|
+
* OPTIONAL only for the wire: an upsert that omits it means "leave what is
|
|
9416
|
+
* stored" on an update and "born inert unless it is the first location of its
|
|
9417
|
+
* type" on a create. On a PERSISTED row absence is legacy and it means
|
|
9418
|
+
* enabled — {@link isLocationEnabled} is the one place that says so, and the
|
|
9419
|
+
* orchestrator stamps every flagless row `true` once at hydrate so absence
|
|
9420
|
+
* stops existing rather than being re-derived on every read.
|
|
9524
9421
|
*/
|
|
9525
9422
|
enabled: boolean().optional(),
|
|
9526
9423
|
/** COMPUTED at read time by the orchestrator (statfs of the backing volume
|
|
@@ -9533,10 +9430,12 @@ var StorageLocationSchema = object({
|
|
|
9533
9430
|
createdAt: number(),
|
|
9534
9431
|
updatedAt: number()
|
|
9535
9432
|
});
|
|
9433
|
+
object({ isDefault: boolean().optional() });
|
|
9536
9434
|
/**
|
|
9537
9435
|
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
9538
9436
|
* Either:
|
|
9539
|
-
* - a `StorageLocationType` (e.g. `'backups'`) →
|
|
9437
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → the sole location of that type
|
|
9438
|
+
* (transitionally, the `<type>:default`-slugged row when several exist)
|
|
9540
9439
|
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
9541
9440
|
*
|
|
9542
9441
|
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
@@ -9712,6 +9611,111 @@ var DecoderSessionConfigSchema = object({
|
|
|
9712
9611
|
*/
|
|
9713
9612
|
debug: boolean().optional()
|
|
9714
9613
|
});
|
|
9614
|
+
/**
|
|
9615
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
9616
|
+
* an addon declares its channels in.
|
|
9617
|
+
*
|
|
9618
|
+
* ## Two axes, deliberately separated
|
|
9619
|
+
*
|
|
9620
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
9621
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
9622
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
9623
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
9624
|
+
* `log-channels` capability enumerates the declarations.
|
|
9625
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
9626
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
9627
|
+
* over the values is the exact defect
|
|
9628
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
9629
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
9630
|
+
*
|
|
9631
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
9632
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
9633
|
+
* the hot path with a value somebody actually read, and by
|
|
9634
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
9635
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
9636
|
+
* disarmed one (D49).
|
|
9637
|
+
*
|
|
9638
|
+
* ## The canonical call shape
|
|
9639
|
+
*
|
|
9640
|
+
* ```ts
|
|
9641
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
9642
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
9643
|
+
* }
|
|
9644
|
+
* ```
|
|
9645
|
+
*
|
|
9646
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
9647
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
9648
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
9649
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
9650
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
9651
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
9652
|
+
*
|
|
9653
|
+
* ## Why a channel emits at `info`
|
|
9654
|
+
*
|
|
9655
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
9656
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
9657
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
9658
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
9659
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
9660
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
9661
|
+
*/
|
|
9662
|
+
/**
|
|
9663
|
+
* The level a channel writes at once armed.
|
|
9664
|
+
*
|
|
9665
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
9666
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
9667
|
+
* to read it later.
|
|
9668
|
+
*/
|
|
9669
|
+
var LogChannelLevelSchema = _enum([
|
|
9670
|
+
"info",
|
|
9671
|
+
"warn",
|
|
9672
|
+
"error"
|
|
9673
|
+
]);
|
|
9674
|
+
/**
|
|
9675
|
+
* What an addon declares about one channel. No value, no state — a
|
|
9676
|
+
* declaration is inert.
|
|
9677
|
+
*/
|
|
9678
|
+
var LogChannelDescriptorSchema = object({
|
|
9679
|
+
/**
|
|
9680
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
9681
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
9682
|
+
* owns it without a second lookup.
|
|
9683
|
+
*/
|
|
9684
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
9685
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
9686
|
+
description: string().min(1),
|
|
9687
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
9688
|
+
defaultLevel: LogChannelLevelSchema,
|
|
9689
|
+
/**
|
|
9690
|
+
* Whether this channel can be narrowed to a camera.
|
|
9691
|
+
*
|
|
9692
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
9693
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
9694
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
9695
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
9696
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
9697
|
+
* the body is the only way to filter.
|
|
9698
|
+
*
|
|
9699
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
9700
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
9701
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
9702
|
+
* path was never taken.
|
|
9703
|
+
*/
|
|
9704
|
+
perDevice: boolean()
|
|
9705
|
+
});
|
|
9706
|
+
/**
|
|
9707
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
9708
|
+
*
|
|
9709
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
9710
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
9711
|
+
*/
|
|
9712
|
+
var LogChannelWindowSchema = object({
|
|
9713
|
+
channel: string().min(1),
|
|
9714
|
+
/** Epoch ms the window closes at. */
|
|
9715
|
+
armedUntilMs: number(),
|
|
9716
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
9717
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
9718
|
+
});
|
|
9715
9719
|
var MODEL_FORMATS = [
|
|
9716
9720
|
"onnx",
|
|
9717
9721
|
"coreml",
|
|
@@ -22761,7 +22765,7 @@ method(object({
|
|
|
22761
22765
|
downloadId: string(),
|
|
22762
22766
|
offset: number(),
|
|
22763
22767
|
length: number()
|
|
22764
|
-
}), _instanceof(Uint8Array)), method(object({ downloadId: string() }), _void(), { kind: "mutation" }), method(object({ type: StorageLocationTypeSchema.optional() }), array(StorageLocationSchema).readonly()), method(
|
|
22768
|
+
}), _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({
|
|
22765
22769
|
createdAt: true,
|
|
22766
22770
|
updatedAt: true
|
|
22767
22771
|
}), StorageLocationSchema, {
|
|
@@ -39614,12 +39618,6 @@ Object.freeze({
|
|
|
39614
39618
|
addonId: null,
|
|
39615
39619
|
access: "view"
|
|
39616
39620
|
},
|
|
39617
|
-
"storage.getDefaultLocation": {
|
|
39618
|
-
capName: "storage",
|
|
39619
|
-
capScope: "system",
|
|
39620
|
-
addonId: null,
|
|
39621
|
-
access: "view"
|
|
39622
|
-
},
|
|
39623
39621
|
"storage.list": {
|
|
39624
39622
|
capName: "storage",
|
|
39625
39623
|
capScope: "system",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-tuya",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.79",
|
|
4
4
|
"description": "Tuya / Smart Life device-provider addon for CamStack — account-onboarded (Tuya IoT cloud fetch of device localKeys) + LOCAL DP control via the @apocaliss92/nodetuya encrypted-LAN client, exposing switch / water-heater-family kettle entities",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|