@camstack/addon-provider-tuya 0.2.87 → 0.2.88

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 CHANGED
@@ -8447,6 +8447,157 @@ var CameraSwitchGroupSchema = object({
8447
8447
  /** Unix ms when the group was composed server-side. */
8448
8448
  fetchedAt: number()
8449
8449
  });
8450
+ /**
8451
+ * What the gate decided about a birth, from the CALLER's point of view.
8452
+ *
8453
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8454
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8455
+ * The third member is the one the gate's own type cannot express, because
8456
+ * exhaustion is a property of how long the caller waited.
8457
+ */
8458
+ var BirthDecisionVerdictSchema = _enum([
8459
+ "confirmed",
8460
+ "suppressed",
8461
+ "exhausted-fallback"
8462
+ ]);
8463
+ /** One birth decision, as it is kept. */
8464
+ var BirthDecisionRecordSchema = object({
8465
+ id: string(),
8466
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8467
+ at: number().int(),
8468
+ /** The camera. Required: every question here is asked per-camera. */
8469
+ deviceId: number().int(),
8470
+ /**
8471
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8472
+ * birth has no track at all, and a confirmed one is expected to age out long
8473
+ * before this row does. Named `sourceTrackId` so the retention model's
8474
+ * ownership derivation (`collection-classification.ts`, which keys on a
8475
+ * column literally called `trackId`) cannot reach it.
8476
+ */
8477
+ sourceTrackId: string(),
8478
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8479
+ className: string(),
8480
+ verdict: BirthDecisionVerdictSchema,
8481
+ /**
8482
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8483
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8484
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8485
+ * "unknown": it says the gate took no measurement because it was off, which
8486
+ * is a different population and must never be averaged in with the rest.
8487
+ */
8488
+ reason: string().nullable(),
8489
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8490
+ attempts: number().int(),
8491
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8492
+ deferredForMs: number().int(),
8493
+ /**
8494
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8495
+ *
8496
+ * `true` when the frame the verdict was taken on carried no matched
8497
+ * detection for this track — the tracker was coasting a frozen box and the
8498
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8499
+ * straight out of `result.tracked` without checking, so this is reachable
8500
+ * today; the question is the RATE, per camera, and whether refusing those
8501
+ * frames would have cost real tracks (cross-read against `verdict` and
8502
+ * `decidedByBirthEvidence`).
8503
+ */
8504
+ decidedOnCoastedFrame: boolean(),
8505
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8506
+ birthEvidenceAvailable: boolean(),
8507
+ /**
8508
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8509
+ * deciding are different: the carried crop is confirm-only, so a candidate
8510
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8511
+ * crop of a later instant. A coasted decision backed by carried evidence is
8512
+ * a real observation of the birth instant; one without it is not.
8513
+ */
8514
+ decidedByBirthEvidence: boolean(),
8515
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8516
+ * found — deliberately not 0, which would be a measurement that never was. */
8517
+ bestScore: number().nullable(),
8518
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8519
+ appliedMinConfidence: number().nullable(),
8520
+ /**
8521
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8522
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8523
+ */
8524
+ firstSeen: number().int().nullable(),
8525
+ /**
8526
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8527
+ * or `null` when there is none, it is older than
8528
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8529
+ */
8530
+ motionOnsetAt: number().int().nullable(),
8531
+ /**
8532
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8533
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8534
+ *
8535
+ * **Why motion onset and not something else.** Two other proxies were
8536
+ * considered and rejected:
8537
+ * - *the recording/pipeline session start*: for a camera on
8538
+ * `detectionMode: 'always'` the session opens at process start, hours
8539
+ * before any subject. It measures nothing.
8540
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8541
+ * `firstSeen` IS the first detection of that object, so for the track that
8542
+ * OPENS a burst — the only one the operator is complaining about — the two
8543
+ * are the same instant and the latency is 0 by construction.
8544
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8545
+ * mechanism from the object detector, so it is the only one that can precede
8546
+ * it. It is also already maintained per-device at frame rate on this very
8547
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8548
+ * it free — and, decisively, the frame path and the motion path are gated to
8549
+ * the SAME designated post-processing node, so the mirror is never empty for
8550
+ * a camera whose births land here.
8551
+ *
8552
+ * **Error bars, all of them.**
8553
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8554
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8555
+ * latency without bound. Mitigated, never removed, by
8556
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8557
+ * candidate for "this burst is this subject", and even then it is a
8558
+ * candidate, not a fact.
8559
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8560
+ * intensity threshold. A subject entering slowly at the far edge of the
8561
+ * frame can clear the detector's confidence floor BEFORE it clears the
8562
+ * motion floor, making this negative. Negatives are stored as-is and
8563
+ * never clamped — clamping would fabricate the distribution's left tail,
8564
+ * which is the half that says the proxy is unreliable.
8565
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8566
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8567
+ * therefore comparable WITHIN a camera and not across cameras of
8568
+ * different motion sources. The motion source is deliberately not copied
8569
+ * here — it belongs to the addon that owns the device (D224) and this is
8570
+ * a write on the frame path — so group by `deviceId`, which is how the
8571
+ * question is always asked anyway.
8572
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8573
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8574
+ * past it this is `null`.
8575
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8576
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8577
+ * camera nobody has a reference instant for.
8578
+ *
8579
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8580
+ * as such. It is not a per-track fact and must never be shown as one.
8581
+ */
8582
+ birthLatencyMs: number().int().nullable(),
8583
+ /**
8584
+ * How many births this device has already decided since that motion onset.
8585
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8586
+ * this subject. `null` when there is no usable onset.
8587
+ */
8588
+ birthIndexInBurst: number().int().nullable()
8589
+ });
8590
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8591
+ var BirthDecisionQueryInputSchema = object({
8592
+ /** Restrict to a single camera; omit for every row. */
8593
+ deviceId: number().int().optional(),
8594
+ /** Only decisions at or after this epoch ms. */
8595
+ since: number().int().optional(),
8596
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8597
+ verdict: BirthDecisionVerdictSchema.optional(),
8598
+ /** Max rows returned, newest-first. */
8599
+ limit: number().int().min(1).max(5e3).optional()
8600
+ });
8450
8601
  /** One archived note — the operator's words plus enough context to find what
8451
8602
  * they were looking at, after the track itself is gone. */
8452
8603
  var ArchivedDebugNoteSchema = object({
@@ -20956,7 +21107,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20956
21107
  deviceId: number(),
20957
21108
  trackId: string(),
20958
21109
  flags: TrackFlagsPatchSchema
20959
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21110
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20960
21111
  kind: "query",
20961
21112
  auth: "admin"
20962
21113
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -38364,6 +38515,12 @@ Object.freeze({
38364
38515
  addonId: null,
38365
38516
  access: "view"
38366
38517
  },
38518
+ "pipelineAnalytics.listBirthDecisions": {
38519
+ capName: "pipeline-analytics",
38520
+ capScope: "device",
38521
+ addonId: null,
38522
+ access: "view"
38523
+ },
38367
38524
  "pipelineAnalytics.listEventKinds": {
38368
38525
  capName: "pipeline-analytics",
38369
38526
  capScope: "device",
@@ -42156,6 +42313,11 @@ Object.freeze({
42156
42313
  form: "single",
42157
42314
  optional: true
42158
42315
  }],
42316
+ "pipelineAnalytics.listBirthDecisions": [{
42317
+ name: "deviceId",
42318
+ form: "single",
42319
+ optional: true
42320
+ }],
42159
42321
  "pipelineAnalytics.listEventKinds": [{
42160
42322
  name: "deviceId",
42161
42323
  form: "single",
package/dist/addon.mjs CHANGED
@@ -8446,6 +8446,157 @@ var CameraSwitchGroupSchema = object({
8446
8446
  /** Unix ms when the group was composed server-side. */
8447
8447
  fetchedAt: number()
8448
8448
  });
8449
+ /**
8450
+ * What the gate decided about a birth, from the CALLER's point of view.
8451
+ *
8452
+ * Deliberately not `ConfirmationVerdict`: `undecided` is not a birth decision
8453
+ * at all — it is a deferral, and the row is written when the deferral ENDS.
8454
+ * The third member is the one the gate's own type cannot express, because
8455
+ * exhaustion is a property of how long the caller waited.
8456
+ */
8457
+ var BirthDecisionVerdictSchema = _enum([
8458
+ "confirmed",
8459
+ "suppressed",
8460
+ "exhausted-fallback"
8461
+ ]);
8462
+ /** One birth decision, as it is kept. */
8463
+ var BirthDecisionRecordSchema = object({
8464
+ id: string(),
8465
+ /** Epoch ms the VERDICT was taken (not the birth instant — see `firstSeen`). */
8466
+ at: number().int(),
8467
+ /** The camera. Required: every question here is asked per-camera. */
8468
+ deviceId: number().int(),
8469
+ /**
8470
+ * The track the decision was about. PROVENANCE, not ownership — a suppressed
8471
+ * birth has no track at all, and a confirmed one is expected to age out long
8472
+ * before this row does. Named `sourceTrackId` so the retention model's
8473
+ * ownership derivation (`collection-classification.ts`, which keys on a
8474
+ * column literally called `trackId`) cannot reach it.
8475
+ */
8476
+ sourceTrackId: string(),
8477
+ /** The candidate's claimed class. The miss rate is asked per class too. */
8478
+ className: string(),
8479
+ verdict: BirthDecisionVerdictSchema,
8480
+ /**
8481
+ * The gate's own `ConfirmationReason` (`confirmed`, `suppressed`,
8482
+ * `native-pass`, `no-crop`, `timeout`, `carried-inconclusive`, …), or `null`
8483
+ * when the gate is DISABLED and every birth is waved through. `null` is not
8484
+ * "unknown": it says the gate took no measurement because it was off, which
8485
+ * is a different population and must never be averaged in with the rest.
8486
+ */
8487
+ reason: string().nullable(),
8488
+ /** Deferral attempts this birth used. 0 = decided on its first look. */
8489
+ attempts: number().int(),
8490
+ /** Ms from the FIRST undecided attempt to this verdict. 0 = never deferred. */
8491
+ deferredForMs: number().int(),
8492
+ /**
8493
+ * THE COLUMN THE RE-OFFER DEFECT IS COUNTED IN.
8494
+ *
8495
+ * `true` when the frame the verdict was taken on carried no matched
8496
+ * detection for this track — the tracker was coasting a frozen box and the
8497
+ * subject was not observed. The deferred-birth re-offer pulls the candidate
8498
+ * straight out of `result.tracked` without checking, so this is reachable
8499
+ * today; the question is the RATE, per camera, and whether refusing those
8500
+ * frames would have cost real tracks (cross-read against `verdict` and
8501
+ * `decidedByBirthEvidence`).
8502
+ */
8503
+ decidedOnCoastedFrame: boolean(),
8504
+ /** Were D379 birth-instant pixels in hand when this candidate was submitted? */
8505
+ birthEvidenceAvailable: boolean(),
8506
+ /**
8507
+ * Did those pixels DECIDE it (`cropSource === 'carried'`)? Available and
8508
+ * deciding are different: the carried crop is confirm-only, so a candidate
8509
+ * can hold evidence, be found inconclusive on it, and be decided by a native
8510
+ * crop of a later instant. A coasted decision backed by carried evidence is
8511
+ * a real observation of the birth instant; one without it is not.
8512
+ */
8513
+ decidedByBirthEvidence: boolean(),
8514
+ /** Best class-compatible crop score, or `null` when nothing compatible was
8515
+ * found — deliberately not 0, which would be a measurement that never was. */
8516
+ bestScore: number().nullable(),
8517
+ /** The bar this candidate actually faced (the phantom-cell hook may raise it). */
8518
+ appliedMinConfidence: number().nullable(),
8519
+ /**
8520
+ * The track's own `firstSeen` — the candidate's first frame, which is where
8521
+ * the timeline starts. `null` for a suppressed birth, which has no track.
8522
+ */
8523
+ firstSeen: number().int().nullable(),
8524
+ /**
8525
+ * The device's most recent motion RISING EDGE at the moment of the decision,
8526
+ * or `null` when there is none, it is older than
8527
+ * {@link MAX_BIRTH_LATENCY_PROXY_MS}, or this runner never saw one.
8528
+ */
8529
+ motionOnsetAt: number().int().nullable(),
8530
+ /**
8531
+ * `firstSeen − motionOnsetAt` — THE OPERATOR'S COMPLAINT, IN MILLISECONDS,
8532
+ * AND THE WEAKEST NUMBER IN THIS ROW. Read the error bars before quoting it.
8533
+ *
8534
+ * **Why motion onset and not something else.** Two other proxies were
8535
+ * considered and rejected:
8536
+ * - *the recording/pipeline session start*: for a camera on
8537
+ * `detectionMode: 'always'` the session opens at process start, hours
8538
+ * before any subject. It measures nothing.
8539
+ * - *the first detection on the device in this burst*: CIRCULAR. A track's
8540
+ * `firstSeen` IS the first detection of that object, so for the track that
8541
+ * OPENS a burst — the only one the operator is complaining about — the two
8542
+ * are the same instant and the latency is 0 by construction.
8543
+ * Motion onset is the only in-process signal produced by a DIFFERENT
8544
+ * mechanism from the object detector, so it is the only one that can precede
8545
+ * it. It is also already maintained per-device at frame rate on this very
8546
+ * node (`handleMotionAnalysis` / `handleOnboardMotion`), which is what makes
8547
+ * it free — and, decisively, the frame path and the motion path are gated to
8548
+ * the SAME designated post-processing node, so the mirror is never empty for
8549
+ * a camera whose births land here.
8550
+ *
8551
+ * **Error bars, all of them.**
8552
+ * 1. *Motion has no class.* A burst opened by rain, a headlight sweeping a
8553
+ * wall or a branch, and only later joined by the person, OVERSTATES the
8554
+ * latency without bound. Mitigated, never removed, by
8555
+ * {@link BirthDecisionRecord.birthIndexInBurst}: only index 0 is a
8556
+ * candidate for "this burst is this subject", and even then it is a
8557
+ * candidate, not a fact.
8558
+ * 2. *The sign is not guaranteed.* The analyzer needs a pixel-count and
8559
+ * intensity threshold. A subject entering slowly at the far edge of the
8560
+ * frame can clear the detector's confidence floor BEFORE it clears the
8561
+ * motion floor, making this negative. Negatives are stored as-is and
8562
+ * never clamped — clamping would fabricate the distribution's left tail,
8563
+ * which is the half that says the proxy is unreliable.
8564
+ * 3. *Onboard motion carries firmware latency of unknown, per-model offset*
8565
+ * (hundreds of ms), plus camera-vs-hub clock skew on top. Numbers are
8566
+ * therefore comparable WITHIN a camera and not across cameras of
8567
+ * different motion sources. The motion source is deliberately not copied
8568
+ * here — it belongs to the addon that owns the device (D224) and this is
8569
+ * a write on the frame path — so group by `deviceId`, which is how the
8570
+ * question is always asked anyway.
8571
+ * 4. *Continuous motion.* On a busy scene the burst never closes and the
8572
+ * onset is minutes old. Bounded by {@link MAX_BIRTH_LATENCY_PROXY_MS};
8573
+ * past it this is `null`.
8574
+ * 5. *No motion signal at all* — analyzer off, onboard-only camera not
8575
+ * reporting, or nothing since boot: `null`. Which is the truth about a
8576
+ * camera nobody has a reference instant for.
8577
+ *
8578
+ * So this is a per-camera DISTRIBUTION over index-0 births, and it is honest
8579
+ * as such. It is not a per-track fact and must never be shown as one.
8580
+ */
8581
+ birthLatencyMs: number().int().nullable(),
8582
+ /**
8583
+ * How many births this device has already decided since that motion onset.
8584
+ * 0 = the first, i.e. the only index at which the burst plausibly belongs to
8585
+ * this subject. `null` when there is no usable onset.
8586
+ */
8587
+ birthIndexInBurst: number().int().nullable()
8588
+ });
8589
+ /** Query input for `listBirthDecisions` — newest first, one camera or all. */
8590
+ var BirthDecisionQueryInputSchema = object({
8591
+ /** Restrict to a single camera; omit for every row. */
8592
+ deviceId: number().int().optional(),
8593
+ /** Only decisions at or after this epoch ms. */
8594
+ since: number().int().optional(),
8595
+ /** Restrict to one verdict — the miss rate is read one population at a time. */
8596
+ verdict: BirthDecisionVerdictSchema.optional(),
8597
+ /** Max rows returned, newest-first. */
8598
+ limit: number().int().min(1).max(5e3).optional()
8599
+ });
8449
8600
  /** One archived note — the operator's words plus enough context to find what
8450
8601
  * they were looking at, after the track itself is gone. */
8451
8602
  var ArchivedDebugNoteSchema = object({
@@ -20955,7 +21106,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20955
21106
  deviceId: number(),
20956
21107
  trackId: string(),
20957
21108
  flags: TrackFlagsPatchSchema
20958
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
21109
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
20959
21110
  kind: "query",
20960
21111
  auth: "admin"
20961
21112
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -38363,6 +38514,12 @@ Object.freeze({
38363
38514
  addonId: null,
38364
38515
  access: "view"
38365
38516
  },
38517
+ "pipelineAnalytics.listBirthDecisions": {
38518
+ capName: "pipeline-analytics",
38519
+ capScope: "device",
38520
+ addonId: null,
38521
+ access: "view"
38522
+ },
38366
38523
  "pipelineAnalytics.listEventKinds": {
38367
38524
  capName: "pipeline-analytics",
38368
38525
  capScope: "device",
@@ -42155,6 +42312,11 @@ Object.freeze({
42155
42312
  form: "single",
42156
42313
  optional: true
42157
42314
  }],
42315
+ "pipelineAnalytics.listBirthDecisions": [{
42316
+ name: "deviceId",
42317
+ form: "single",
42318
+ optional: true
42319
+ }],
42158
42320
  "pipelineAnalytics.listEventKinds": [{
42159
42321
  name: "deviceId",
42160
42322
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-tuya",
3
- "version": "0.2.87",
3
+ "version": "0.2.88",
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",