@camstack/addon-post-analysis 1.2.103 → 1.2.104

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.
@@ -20739,6 +20739,7 @@ DeviceType.Camera, method(object({
20739
20739
  isBattery: boolean(),
20740
20740
  reason: _enum([
20741
20741
  "disabled",
20742
+ "offline",
20742
20743
  "sleeping",
20743
20744
  "unreachable",
20744
20745
  "waking"
@@ -20784,9 +20785,17 @@ targets: array(object({
20784
20785
  sleeping: boolean(),
20785
20786
  /** Current device state rendered over the cached frame. State images
20786
20787
  * remain authoritative even when their photographic background is
20787
- * old; null means the link must carry a current camera frame. */
20788
+ * old; null means the link must carry a current camera frame.
20789
+ *
20790
+ * **This is the ONLY source a surface may derive an inactive tile
20791
+ * from.** A client that reads a device's `online`/`disabled` flags and
20792
+ * draws its own verdict will disagree with the pixels it is painting
20793
+ * — the frame comes from here, and so must the sentence over it
20794
+ * (D190). Pair with `ageMs` for the age of the photograph behind the
20795
+ * state. */
20788
20796
  stateReason: _enum([
20789
20797
  "disabled",
20798
+ "offline",
20790
20799
  "sleeping",
20791
20800
  "unreachable",
20792
20801
  "waking"
@@ -20770,6 +20770,7 @@ DeviceType.Camera, method(object({
20770
20770
  isBattery: boolean(),
20771
20771
  reason: _enum([
20772
20772
  "disabled",
20773
+ "offline",
20773
20774
  "sleeping",
20774
20775
  "unreachable",
20775
20776
  "waking"
@@ -20815,9 +20816,17 @@ targets: array(object({
20815
20816
  sleeping: boolean(),
20816
20817
  /** Current device state rendered over the cached frame. State images
20817
20818
  * remain authoritative even when their photographic background is
20818
- * old; null means the link must carry a current camera frame. */
20819
+ * old; null means the link must carry a current camera frame.
20820
+ *
20821
+ * **This is the ONLY source a surface may derive an inactive tile
20822
+ * from.** A client that reads a device's `online`/`disabled` flags and
20823
+ * draws its own verdict will disagree with the pixels it is painting
20824
+ * — the frame comes from here, and so must the sentence over it
20825
+ * (D190). Pair with `ageMs` for the age of the photograph behind the
20826
+ * state. */
20819
20827
  stateReason: _enum([
20820
20828
  "disabled",
20829
+ "offline",
20821
20830
  "sleeping",
20822
20831
  "unreachable",
20823
20832
  "waking"
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BwxXdV9d.js");
5
+ const require_dist = require("../dist-KXhjlCmh.js");
6
6
  let node_fs = require("node:fs");
7
7
  let node_fs$1 = require_dist.__toESM(node_fs, 1);
8
8
  node_fs = require_dist.__toESM(node_fs);
@@ -1,4 +1,4 @@
1
- import { O as PoolMemoryWatchdog, Q as embeddingEncoderCapability, dt as resolvePoolMemoryPolicy, ot as parseProcStatus, tt as hfModelUrl, yt as BaseAddon } from "../dist-CZm8slPB.mjs";
1
+ import { O as PoolMemoryWatchdog, Q as embeddingEncoderCapability, dt as resolvePoolMemoryPolicy, ot as parseProcStatus, tt as hfModelUrl, yt as BaseAddon } from "../dist-IZLiqXRa.mjs";
2
2
  import { createRequire } from "node:module";
3
3
  import * as fs from "node:fs";
4
4
  import "node:fs";
@@ -18,7 +18,7 @@ var e = {
18
18
  },
19
19
  "@camstack/types": {
20
20
  name: "@camstack/types",
21
- version: "1.2.92",
21
+ version: "1.2.93",
22
22
  scope: ["default"],
23
23
  loaded: !1,
24
24
  from: "addon_pipeline_analytics_widgets",
@@ -36,7 +36,7 @@ async function r() {
36
36
  }
37
37
  },
38
38
  "@camstack/types": {
39
- version: "1.2.92",
39
+ version: "1.2.93",
40
40
  scope: "default",
41
41
  shareConfig: {
42
42
  singleton: !0,
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-BwxXdV9d.js");
5
+ const require_dist = require("../dist-KXhjlCmh.js");
6
6
  let node_fs = require("node:fs");
7
7
  node_fs = require_dist.__toESM(node_fs, 1);
8
8
  let node_path = require("node:path");
@@ -18171,7 +18171,7 @@ function applyTemplatePatch(merged, template) {
18171
18171
  return withoutTemplate;
18172
18172
  }
18173
18173
  /** Narrowing guard — the persisted `rule` column is `unknown` until parsed. */
18174
- function isRecord$1(value) {
18174
+ function isRecord$2(value) {
18175
18175
  return typeof value === "object" && value !== null && !Array.isArray(value);
18176
18176
  }
18177
18177
  /**
@@ -18201,7 +18201,7 @@ function isRecord$1(value) {
18201
18201
  * the same reason.
18202
18202
  */
18203
18203
  function withCreatedAt(rowId, raw, synthesised, now) {
18204
- if (!isRecord$1(raw)) return raw;
18204
+ if (!isRecord$2(raw)) return raw;
18205
18205
  if (typeof raw["createdAt"] === "number") return raw;
18206
18206
  const stamped = synthesised.get(rowId) ?? now();
18207
18207
  synthesised.set(rowId, stamped);
@@ -40557,7 +40557,17 @@ function buildRecordedStillPorts(input) {
40557
40557
  })
40558
40558
  };
40559
40559
  }
40560
- /** Where the completion marker lives. */
40560
+ /**
40561
+ * Where the completion marker lives.
40562
+ *
40563
+ * @durable class=config owner=pipeline-analytics
40564
+ * write="one marker row when a boot migration completes; overwritten only by
40565
+ * a re-run of the same migration"
40566
+ * loss="a re-scan of the analytics store on the next boot — idempotent,
40567
+ * never destructive"
40568
+ * retention="never pruned: one row per completed migration, bounded by the
40569
+ * number of migrations ever written (two today)"
40570
+ */
40561
40571
  var MIGRATION_MARKER_COLLECTION = "pipeline-analytics:migrations";
40562
40572
  var MIGRATION_MARKER_KEY = "label-tier-4g";
40563
40573
  /**
@@ -43737,11 +43747,11 @@ function rowToSensorEvent(id, data) {
43737
43747
  deviceId: Number(data["deviceId"]),
43738
43748
  sourceDeviceId: Number(data["sourceDeviceId"]),
43739
43749
  kind: String(data["kind"]),
43740
- value: isRecord(value) ? value : null,
43750
+ value: isRecord$1(value) ? value : null,
43741
43751
  timestamp: Number(data["timestamp"])
43742
43752
  };
43743
43753
  }
43744
- function isRecord(x) {
43754
+ function isRecord$1(x) {
43745
43755
  return x !== null && typeof x === "object" && !Array.isArray(x);
43746
43756
  }
43747
43757
  /**
@@ -44099,6 +44109,24 @@ var TRACKS_INDEXES = [{
44099
44109
  name: "idx_tracks_device_firstSeen",
44100
44110
  columns: ["deviceId", "firstSeen"]
44101
44111
  }];
44112
+ function isRecord(v) {
44113
+ return typeof v === "object" && v !== null;
44114
+ }
44115
+ /** Validate the JSON column back into `Track.audioLabels` — a malformed row
44116
+ * yields null rather than a lying shape (this column now carries the meaning
44117
+ * of an audio row, D189; it must not be trusted by assertion). */
44118
+ function readAudioLabels(v) {
44119
+ if (!Array.isArray(v)) return null;
44120
+ const out = [];
44121
+ for (const e of v) if (isRecord(e) && typeof e["label"] === "string" && typeof e["peakScore"] === "number" && typeof e["count"] === "number" && typeof e["firstAt"] === "number" && typeof e["lastAt"] === "number") out.push({
44122
+ label: e["label"],
44123
+ peakScore: e["peakScore"],
44124
+ count: e["count"],
44125
+ firstAt: e["firstAt"],
44126
+ lastAt: e["lastAt"]
44127
+ });
44128
+ return out.length > 0 ? out : null;
44129
+ }
44102
44130
  /** Serialize the per-label aggregate map into the `Track.audioLabels`
44103
44131
  * array shape, most-frequent label first. */
44104
44132
  function audioLabelsToArray(agg) {
@@ -45299,8 +45327,9 @@ var TrackStore = class {
45299
45327
  });
45300
45328
  const names = /* @__PURE__ */ new Set();
45301
45329
  for (const r of rows) {
45330
+ const isAudio = r.data["source"] === "audio";
45302
45331
  const className = r.data["className"];
45303
- if (typeof className === "string" && className.length > 0) names.add(className);
45332
+ if (typeof className === "string" && className.length > 0) names.add(isAudio ? AUDIO_TRACK_CLASS : className);
45304
45333
  const classes = r.data["classes"];
45305
45334
  if (Array.isArray(classes)) {
45306
45335
  for (const c of classes) if (typeof c === "string" && c.length > 0) names.add(c);
@@ -45429,7 +45458,7 @@ var TrackStore = class {
45429
45458
  const importance = data["importance"];
45430
45459
  const bestEventId = data["bestEventId"];
45431
45460
  const importanceReason = data["importanceReason"];
45432
- const audioLabels = data["audioLabels"];
45461
+ const audioLabels = readAudioLabels(data["audioLabels"]);
45433
45462
  const retrainParsed = require_dist.RetrainStatusSchema.safeParse(data["retrainStatus"]);
45434
45463
  const debug = data["debug"];
45435
45464
  const favourited = data["favourited"];
@@ -50684,9 +50713,10 @@ function evaluatePeriodicSnapshot(input) {
50684
50713
  movedFraction
50685
50714
  };
50686
50715
  }
50687
- /** Where the completion marker lives — the collection `runLabelTierMigration`
50688
- * already established for exactly this. */
50689
- var AUDIO_CLASS_MIGRATION_MARKER_COLLECTION = "pipeline-analytics:migrations";
50716
+ /** Where the completion marker lives — the SAME collection
50717
+ * `runLabelTierMigration` owns and classifies; referencing the constant
50718
+ * instead of repeating the literal keeps one declarer for the guards. */
50719
+ var AUDIO_CLASS_MIGRATION_MARKER_COLLECTION = MIGRATION_MARKER_COLLECTION;
50690
50720
  var AUDIO_CLASS_MIGRATION_MARKER_KEY = "audio-track-class-d189";
50691
50721
  /**
50692
50722
  * The decision for ONE stored row, exposed so the rule is testable without a
@@ -1,4 +1,4 @@
1
- import { $ as encodeVectorBase64, A as RetrainStatusSchema, At as literal, B as TrackSourceSchema, C as NcSnoozeSchema, Ct as isDeviceScopedCap, D as OpsLogEntrySchema, Dt as array, E as NcTaxonomySchema, Et as _enum, F as SceneMonitorSchema, Ft as string, G as audioMetricsCapability, H as addonWidgetsSourceCapability, I as TIMELAPSE_DENSE_FLOOR_SEC, It as unknown, J as cosineSimilarity$1, K as audioModeOf, L as TimelapseRuleInputSchema, Lt as EventCategory, M as SCENE_DEFAULT_ANCHOR_THRESHOLD, Mt as object, N as SCENE_DEFAULT_UNCOVERED_POLICY, Nt as partialRecord, Ot as boolean, P as SCENE_DIVERGED, Pt as record, R as TimelapseRulePatchSchema, S as NcSnoozeInputSchema, St as hydrateSchema, T as NcSystemEventKindSchema, Tt as sleep, U as alarmPanelCapability, V as VISIT_MERGE_GAP_MS, W as assertTimelapseCadences, X as defineCustomActions, Y as customAction, Z as deriveRecordingMode, _ as NcRuleInputSchema, _t as zoneAnalyticsCapability, at as notificationRulesCapability, b as NcRuleTargetSchema, bt as DeviceType, c as EVENT_PAD_MS, ct as plateGalleryCapability, d as NC_ALARM_SYSTEM_EVENT_KINDS, et as faceGalleryCapability, f as NC_CONDITION_CATALOG, ft as sceneMonitorCapability, g as NcConditionDescriptorSchema, gt as videoclipsCapability, h as NC_TAXONOMY, ht as vectorDimFromBase64, i as DETECTION_MACRO_CLASSES, it as kebabToCamel, jt as number, k as RECORDING_EXPORT_MAX_READ_BYTES, kt as discriminatedUnion, l as LabelAttributionSchema, lt as readDeviceStateFrom, mt as systemEventFilterApplies, n as DEFAULT_EVENT_COLOR, nt as isDetectionMacroClass, o as DeclaredDevices, p as NC_DEFAULT_SNOOZE_MINUTES, pt as subKindsOf, q as buildEventKindDescriptor, rt as isScheduleActive, s as EVENT_KIND_BY_CAP, st as pipelineAnalyticsCapability, t as BaseDevice, u as MACRO_LABELS, ut as readTimelapseGeneratedAt, v as NcRulePatchSchema, vt as errMsg, w as NcSnoozeSuppressedSchema, wt as nodePin, x as NcScheduleSchema, xt as createEvent, y as NcRuleSchema, yt as BaseAddon, z as TimelapseRuleSchema } from "../dist-CZm8slPB.mjs";
1
+ import { $ as encodeVectorBase64, A as RetrainStatusSchema, At as literal, B as TrackSourceSchema, C as NcSnoozeSchema, Ct as isDeviceScopedCap, D as OpsLogEntrySchema, Dt as array, E as NcTaxonomySchema, Et as _enum, F as SceneMonitorSchema, Ft as string, G as audioMetricsCapability, H as addonWidgetsSourceCapability, I as TIMELAPSE_DENSE_FLOOR_SEC, It as unknown, J as cosineSimilarity$1, K as audioModeOf, L as TimelapseRuleInputSchema, Lt as EventCategory, M as SCENE_DEFAULT_ANCHOR_THRESHOLD, Mt as object, N as SCENE_DEFAULT_UNCOVERED_POLICY, Nt as partialRecord, Ot as boolean, P as SCENE_DIVERGED, Pt as record, R as TimelapseRulePatchSchema, S as NcSnoozeInputSchema, St as hydrateSchema, T as NcSystemEventKindSchema, Tt as sleep, U as alarmPanelCapability, V as VISIT_MERGE_GAP_MS, W as assertTimelapseCadences, X as defineCustomActions, Y as customAction, Z as deriveRecordingMode, _ as NcRuleInputSchema, _t as zoneAnalyticsCapability, at as notificationRulesCapability, b as NcRuleTargetSchema, bt as DeviceType, c as EVENT_PAD_MS, ct as plateGalleryCapability, d as NC_ALARM_SYSTEM_EVENT_KINDS, et as faceGalleryCapability, f as NC_CONDITION_CATALOG, ft as sceneMonitorCapability, g as NcConditionDescriptorSchema, gt as videoclipsCapability, h as NC_TAXONOMY, ht as vectorDimFromBase64, i as DETECTION_MACRO_CLASSES, it as kebabToCamel, jt as number, k as RECORDING_EXPORT_MAX_READ_BYTES, kt as discriminatedUnion, l as LabelAttributionSchema, lt as readDeviceStateFrom, mt as systemEventFilterApplies, n as DEFAULT_EVENT_COLOR, nt as isDetectionMacroClass, o as DeclaredDevices, p as NC_DEFAULT_SNOOZE_MINUTES, pt as subKindsOf, q as buildEventKindDescriptor, rt as isScheduleActive, s as EVENT_KIND_BY_CAP, st as pipelineAnalyticsCapability, t as BaseDevice, u as MACRO_LABELS, ut as readTimelapseGeneratedAt, v as NcRulePatchSchema, vt as errMsg, w as NcSnoozeSuppressedSchema, wt as nodePin, x as NcScheduleSchema, xt as createEvent, y as NcRuleSchema, yt as BaseAddon, z as TimelapseRuleSchema } from "../dist-IZLiqXRa.mjs";
2
2
  import { t as __exportAll } from "../embedding-encoder/index.mjs";
3
3
  import * as fs from "node:fs";
4
4
  import { promises } from "node:fs";
@@ -18149,7 +18149,7 @@ function applyTemplatePatch(merged, template) {
18149
18149
  return withoutTemplate;
18150
18150
  }
18151
18151
  /** Narrowing guard — the persisted `rule` column is `unknown` until parsed. */
18152
- function isRecord$1(value) {
18152
+ function isRecord$2(value) {
18153
18153
  return typeof value === "object" && value !== null && !Array.isArray(value);
18154
18154
  }
18155
18155
  /**
@@ -18179,7 +18179,7 @@ function isRecord$1(value) {
18179
18179
  * the same reason.
18180
18180
  */
18181
18181
  function withCreatedAt(rowId, raw, synthesised, now) {
18182
- if (!isRecord$1(raw)) return raw;
18182
+ if (!isRecord$2(raw)) return raw;
18183
18183
  if (typeof raw["createdAt"] === "number") return raw;
18184
18184
  const stamped = synthesised.get(rowId) ?? now();
18185
18185
  synthesised.set(rowId, stamped);
@@ -40497,7 +40497,17 @@ function buildRecordedStillPorts(input) {
40497
40497
  })
40498
40498
  };
40499
40499
  }
40500
- /** Where the completion marker lives. */
40500
+ /**
40501
+ * Where the completion marker lives.
40502
+ *
40503
+ * @durable class=config owner=pipeline-analytics
40504
+ * write="one marker row when a boot migration completes; overwritten only by
40505
+ * a re-run of the same migration"
40506
+ * loss="a re-scan of the analytics store on the next boot — idempotent,
40507
+ * never destructive"
40508
+ * retention="never pruned: one row per completed migration, bounded by the
40509
+ * number of migrations ever written (two today)"
40510
+ */
40501
40511
  var MIGRATION_MARKER_COLLECTION = "pipeline-analytics:migrations";
40502
40512
  var MIGRATION_MARKER_KEY = "label-tier-4g";
40503
40513
  /**
@@ -43677,11 +43687,11 @@ function rowToSensorEvent(id, data) {
43677
43687
  deviceId: Number(data["deviceId"]),
43678
43688
  sourceDeviceId: Number(data["sourceDeviceId"]),
43679
43689
  kind: String(data["kind"]),
43680
- value: isRecord(value) ? value : null,
43690
+ value: isRecord$1(value) ? value : null,
43681
43691
  timestamp: Number(data["timestamp"])
43682
43692
  };
43683
43693
  }
43684
- function isRecord(x) {
43694
+ function isRecord$1(x) {
43685
43695
  return x !== null && typeof x === "object" && !Array.isArray(x);
43686
43696
  }
43687
43697
  /**
@@ -44039,6 +44049,24 @@ var TRACKS_INDEXES = [{
44039
44049
  name: "idx_tracks_device_firstSeen",
44040
44050
  columns: ["deviceId", "firstSeen"]
44041
44051
  }];
44052
+ function isRecord(v) {
44053
+ return typeof v === "object" && v !== null;
44054
+ }
44055
+ /** Validate the JSON column back into `Track.audioLabels` — a malformed row
44056
+ * yields null rather than a lying shape (this column now carries the meaning
44057
+ * of an audio row, D189; it must not be trusted by assertion). */
44058
+ function readAudioLabels(v) {
44059
+ if (!Array.isArray(v)) return null;
44060
+ const out = [];
44061
+ for (const e of v) if (isRecord(e) && typeof e["label"] === "string" && typeof e["peakScore"] === "number" && typeof e["count"] === "number" && typeof e["firstAt"] === "number" && typeof e["lastAt"] === "number") out.push({
44062
+ label: e["label"],
44063
+ peakScore: e["peakScore"],
44064
+ count: e["count"],
44065
+ firstAt: e["firstAt"],
44066
+ lastAt: e["lastAt"]
44067
+ });
44068
+ return out.length > 0 ? out : null;
44069
+ }
44042
44070
  /** Serialize the per-label aggregate map into the `Track.audioLabels`
44043
44071
  * array shape, most-frequent label first. */
44044
44072
  function audioLabelsToArray(agg) {
@@ -45239,8 +45267,9 @@ var TrackStore = class {
45239
45267
  });
45240
45268
  const names = /* @__PURE__ */ new Set();
45241
45269
  for (const r of rows) {
45270
+ const isAudio = r.data["source"] === "audio";
45242
45271
  const className = r.data["className"];
45243
- if (typeof className === "string" && className.length > 0) names.add(className);
45272
+ if (typeof className === "string" && className.length > 0) names.add(isAudio ? AUDIO_TRACK_CLASS : className);
45244
45273
  const classes = r.data["classes"];
45245
45274
  if (Array.isArray(classes)) {
45246
45275
  for (const c of classes) if (typeof c === "string" && c.length > 0) names.add(c);
@@ -45369,7 +45398,7 @@ var TrackStore = class {
45369
45398
  const importance = data["importance"];
45370
45399
  const bestEventId = data["bestEventId"];
45371
45400
  const importanceReason = data["importanceReason"];
45372
- const audioLabels = data["audioLabels"];
45401
+ const audioLabels = readAudioLabels(data["audioLabels"]);
45373
45402
  const retrainParsed = RetrainStatusSchema.safeParse(data["retrainStatus"]);
45374
45403
  const debug = data["debug"];
45375
45404
  const favourited = data["favourited"];
@@ -50624,9 +50653,10 @@ function evaluatePeriodicSnapshot(input) {
50624
50653
  movedFraction
50625
50654
  };
50626
50655
  }
50627
- /** Where the completion marker lives — the collection `runLabelTierMigration`
50628
- * already established for exactly this. */
50629
- var AUDIO_CLASS_MIGRATION_MARKER_COLLECTION = "pipeline-analytics:migrations";
50656
+ /** Where the completion marker lives — the SAME collection
50657
+ * `runLabelTierMigration` owns and classifies; referencing the constant
50658
+ * instead of repeating the literal keeps one declarer for the guards. */
50659
+ var AUDIO_CLASS_MIGRATION_MARKER_COLLECTION = MIGRATION_MARKER_COLLECTION;
50630
50660
  var AUDIO_CLASS_MIGRATION_MARKER_KEY = "audio-track-class-d189";
50631
50661
  /**
50632
50662
  * The decision for ONE stored row, exposed so the rule is testable without a
@@ -30,7 +30,7 @@ async function d(e) {
30
30
  }
31
31
  }
32
32
  async function f() {
33
- return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-MP5xue-m.mjs")).catch((e) => {
33
+ return l ||= d(() => import("./_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-D8fRo8aP.mjs")).catch((e) => {
34
34
  throw l = void 0, e;
35
35
  }), l;
36
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-post-analysis",
3
- "version": "1.2.103",
3
+ "version": "1.2.104",
4
4
  "description": "Post-Analysis bundle — enrichment, embedding-encoder, pipeline-analytics. Multi-entry npm package shipping addons that consume pipeline output.",
5
5
  "keywords": [
6
6
  "camstack",