@camstack/addon-post-analysis 1.2.640 → 1.2.642

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.
Files changed (14) hide show
  1. package/dist/{clip-model-registry-B1HxbGuP.mjs → clip-model-registry-CoH7ORtC.mjs} +218 -30
  2. package/dist/{clip-model-registry-C8xdbChV.js → clip-model-registry-Dj3lrvL2.js} +218 -30
  3. package/dist/embedding-encoder/index.js +1 -1
  4. package/dist/embedding-encoder/index.mjs +1 -1
  5. package/dist/pipeline-analytics/_stub.js +2 -2
  6. package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CO5qrMxU.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-Dhan9FH4.mjs} +2 -2
  7. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-_TUthUZh.mjs +26 -0
  8. package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DIbQ2FJ4.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CuNXxDlT.mjs} +1 -1
  9. package/dist/pipeline-analytics/{hostInit-BN2pgAbz.mjs → hostInit-j1gxJvS7.mjs} +2 -2
  10. package/dist/pipeline-analytics/index.js +470 -27
  11. package/dist/pipeline-analytics/index.mjs +470 -27
  12. package/dist/pipeline-analytics/remoteEntry.js +1 -1
  13. package/package.json +1 -1
  14. package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CENVyAAQ.mjs +0 -26
@@ -5640,7 +5640,7 @@ var ZodIssueCode = {
5640
5640
  var ZodFirstPartyTypeKind;
5641
5641
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5642
5642
  //#endregion
5643
- //#region ../types/dist/sleep-bykKrTgu.mjs
5643
+ //#region ../types/dist/sleep-0sD_LHLI.mjs
5644
5644
  /**
5645
5645
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5646
5646
  * window to float samples (D455).
@@ -9083,6 +9083,7 @@ var CAP_NAMES = Object.freeze([
9083
9083
  "login-method",
9084
9084
  "media-player",
9085
9085
  "mesh-network",
9086
+ "meter",
9086
9087
  "metrics-provider",
9087
9088
  "model-convert",
9088
9089
  "model-distributor",
@@ -10140,6 +10141,10 @@ Object.freeze({
10140
10141
  ]
10141
10142
  }
10142
10143
  ],
10144
+ "meter": [{
10145
+ "path": "value",
10146
+ "valueType": "number"
10147
+ }],
10143
10148
  "motion": [
10144
10149
  {
10145
10150
  "path": "detected",
@@ -10885,7 +10890,7 @@ Object.freeze({
10885
10890
  * can answer "may a rule actuate this?" without importing the schema barrel
10886
10891
  * (~144MB RSS per runner, D28).
10887
10892
  *
10888
- * Coverage: 93 device-scoped capabilities.
10893
+ * Coverage: 94 device-scoped capabilities.
10889
10894
  */
10890
10895
  var DEVICE_SCOPED_CAPS = new Set([
10891
10896
  "accessories",
@@ -10937,6 +10942,7 @@ var DEVICE_SCOPED_CAPS = new Set([
10937
10942
  "lawn-mower-control",
10938
10943
  "lock-control",
10939
10944
  "media-player",
10945
+ "meter",
10940
10946
  "motion",
10941
10947
  "motion-detection",
10942
10948
  "motion-trigger",
@@ -11385,7 +11391,7 @@ function errMsg(err) {
11385
11391
  return String(err);
11386
11392
  }
11387
11393
  //#endregion
11388
- //#region ../types/dist/composition-B2rw5L29.mjs
11394
+ //#region ../types/dist/composition-CpETZ4HL.mjs
11389
11395
  /**
11390
11396
  * Deterministic SHA-256 hash of an arbitrary serialisable value. The
11391
11397
  * canonical form sorts object keys alphabetically at every depth so two
@@ -12321,6 +12327,77 @@ var APPLIANCE_KINDS = [
12321
12327
  ];
12322
12328
  DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
12323
12329
  /**
12330
+ * Statistics and integrals over a history read (D944).
12331
+ *
12332
+ * Pure: the same points always give the same answer, so a restart recomputes
12333
+ * rather than trusting a buffer. A gauge mean is time-weighted (value × ms),
12334
+ * never the mean of the samples. A hole with no held value is not integrated
12335
+ * as zero. A truncated read is not published.
12336
+ */
12337
+ var STATISTIC_STATS = [
12338
+ "min",
12339
+ "max",
12340
+ "mean",
12341
+ "sum",
12342
+ "count",
12343
+ "change"
12344
+ ];
12345
+ /**
12346
+ * The range a statistics or integral helper asks history for (D944).
12347
+ *
12348
+ * Calendar edges are the hub's timezone, never UTC midnight: a day is 23, 24
12349
+ * or 25 hours across a DST change. A tier is eligible only when its retention
12350
+ * is strictly longer than the longest that range can be. Forever qualifies.
12351
+ * Equal to a tier's retention is a refusal, not a short answer.
12352
+ */
12353
+ var MINUTE_MS = 6e4;
12354
+ var HOUR_MS = 60 * MINUTE_MS;
12355
+ var DAY_MS = 24 * HOUR_MS;
12356
+ var ROLLING_SPANS = [
12357
+ "1h",
12358
+ "24h",
12359
+ "2d",
12360
+ "7d",
12361
+ "30d",
12362
+ "custom"
12363
+ ];
12364
+ var CALENDAR_PERIODS = [
12365
+ "today",
12366
+ "yesterday",
12367
+ "this-week",
12368
+ "this-month"
12369
+ ];
12370
+ var RESET_PERIODS = [
12371
+ "never",
12372
+ "daily",
12373
+ "weekly",
12374
+ "monthly"
12375
+ ];
12376
+ 5 * MINUTE_MS;
12377
+ 24 * HOUR_MS, 2 * DAY_MS, 7 * DAY_MS, 30 * DAY_MS;
12378
+ 7 * DAY_MS, 30 * DAY_MS, 365 * DAY_MS;
12379
+ var StatisticWindowSchema = discriminatedUnion("kind", [object({
12380
+ kind: literal("rolling"),
12381
+ span: _enum(ROLLING_SPANS),
12382
+ customMinutes: number().int().min(5).optional()
12383
+ }).check((payload) => {
12384
+ if (payload.value.span === "custom" && payload.value.customMinutes === void 0) payload.issues.push({
12385
+ code: "custom",
12386
+ message: "a custom range needs a duration in minutes",
12387
+ path: ["customMinutes"],
12388
+ input: payload.value
12389
+ });
12390
+ if (payload.value.span !== "custom" && payload.value.customMinutes !== void 0) payload.issues.push({
12391
+ code: "custom",
12392
+ message: "only a custom range carries a duration",
12393
+ path: ["customMinutes"],
12394
+ input: payload.value
12395
+ });
12396
+ }), object({
12397
+ kind: literal("calendar"),
12398
+ period: _enum(CALENDAR_PERIODS)
12399
+ })]);
12400
+ /**
12324
12401
  * A composition source identity: `(addonId, stableId)`, never a numeric device
12325
12402
  * id. Split out so helper schemas can name it without a cycle through
12326
12403
  * `composition.ts` (D659).
@@ -12376,22 +12453,37 @@ var HelperMemberSchema = object({
12376
12453
  cap: string().min(1),
12377
12454
  fieldPath: string().min(1)
12378
12455
  });
12379
- var HelperSpecSchema = discriminatedUnion("kind", [object({
12380
- kind: literal("group"),
12381
- templateId: GroupTemplateIdSchema,
12382
- aggregate: AggregateReducerSchema,
12383
- members: array(HelperMemberSchema).min(1).max(64),
12384
- /** Actuator groups only. Readings leave this unset. */
12385
- active: ActiveCriterionSchema.optional()
12386
- }), object({
12387
- kind: literal("appliance"),
12388
- templateId: literal(APPLIANCE_TEMPLATE_ID),
12389
- appliance: _enum(APPLIANCE_KINDS),
12390
- thresholdWatts: number().positive(),
12391
- startDwellMs: number().int().nonnegative(),
12392
- stopDwellMs: number().int().nonnegative(),
12393
- member: HelperMemberSchema
12394
- })]);
12456
+ var HelperSpecSchema = discriminatedUnion("kind", [
12457
+ object({
12458
+ kind: literal("group"),
12459
+ templateId: GroupTemplateIdSchema,
12460
+ aggregate: AggregateReducerSchema,
12461
+ members: array(HelperMemberSchema).min(1).max(64),
12462
+ /** Actuator groups only. Readings leave this unset. */
12463
+ active: ActiveCriterionSchema.optional()
12464
+ }),
12465
+ object({
12466
+ kind: literal("appliance"),
12467
+ templateId: literal(APPLIANCE_TEMPLATE_ID),
12468
+ appliance: _enum(APPLIANCE_KINDS),
12469
+ thresholdWatts: number().positive(),
12470
+ startDwellMs: number().int().nonnegative(),
12471
+ stopDwellMs: number().int().nonnegative(),
12472
+ member: HelperMemberSchema
12473
+ }),
12474
+ object({
12475
+ kind: literal("statistic"),
12476
+ stat: _enum(STATISTIC_STATS),
12477
+ window: StatisticWindowSchema,
12478
+ source: HelperMemberSchema
12479
+ }),
12480
+ object({
12481
+ kind: literal("integral"),
12482
+ reset: _enum(RESET_PERIODS),
12483
+ output: _enum(["energy", "meter"]),
12484
+ source: HelperMemberSchema
12485
+ })
12486
+ ]);
12395
12487
  /** A composed device's stableId is this prefix plus the block id. */
12396
12488
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
12397
12489
  /** Longest snippet a `code` source may carry (slice 4). */
@@ -12465,6 +12557,26 @@ var CompositionFieldSourceSchema = discriminatedUnion("kind", [
12465
12557
  "omit",
12466
12558
  "offline"
12467
12559
  ])
12560
+ }),
12561
+ object({
12562
+ kind: literal("series"),
12563
+ read: CompositionFieldReadSchema,
12564
+ /** `value` is the statistic or the integral. The others are the gap counts. */
12565
+ publish: _enum([
12566
+ "value",
12567
+ "included",
12568
+ "excluded",
12569
+ "total"
12570
+ ]),
12571
+ /**
12572
+ * What an unanswered `value` does. Counts ignore this. `offline` leaves the
12573
+ * device unseeded until history answers, so a restart cannot publish 0.
12574
+ */
12575
+ empty: _enum([
12576
+ "null",
12577
+ "omit",
12578
+ "offline"
12579
+ ])
12468
12580
  })
12469
12581
  ]);
12470
12582
  var CompositionCommandTargetSchema = discriminatedUnion("kind", [object({
@@ -19512,7 +19624,8 @@ var CompositionProblemSchema = object({
19512
19624
  "native-capability-replace",
19513
19625
  "mixed-quantity",
19514
19626
  "helper-mismatch",
19515
- "member-constraint"
19627
+ "member-constraint",
19628
+ "retention"
19516
19629
  ]),
19517
19630
  path: string(),
19518
19631
  message: string()
@@ -19752,7 +19865,7 @@ Object.freeze({
19752
19865
  * One catalog row per base reading a group helper can build (D944 §3).
19753
19866
  * Data, not a form default written into the block.
19754
19867
  */
19755
- var NOW = {
19868
+ var NOW$1 = {
19756
19869
  fieldPath: "lastFetchedAt",
19757
19870
  expr: "now"
19758
19871
  };
@@ -19798,7 +19911,7 @@ var GROUP_TEMPLATES = [
19798
19911
  quantity: "temperature",
19799
19912
  defaultAggregate: "mean",
19800
19913
  empty: "null",
19801
- companions: [NOW]
19914
+ companions: [NOW$1]
19802
19915
  }),
19803
19916
  numeric({
19804
19917
  id: "humidity",
@@ -19809,7 +19922,7 @@ var GROUP_TEMPLATES = [
19809
19922
  quantity: "humidity",
19810
19923
  defaultAggregate: "mean",
19811
19924
  empty: "null",
19812
- companions: [NOW]
19925
+ companions: [NOW$1]
19813
19926
  }),
19814
19927
  numeric({
19815
19928
  id: "pressure",
@@ -19820,7 +19933,7 @@ var GROUP_TEMPLATES = [
19820
19933
  quantity: "pressure",
19821
19934
  defaultAggregate: "mean",
19822
19935
  empty: "null",
19823
- companions: [NOW]
19936
+ companions: [NOW$1]
19824
19937
  }),
19825
19938
  numeric({
19826
19939
  id: "illuminance",
@@ -19831,7 +19944,7 @@ var GROUP_TEMPLATES = [
19831
19944
  quantity: "illuminance",
19832
19945
  defaultAggregate: "mean",
19833
19946
  empty: "null",
19834
- companions: [NOW]
19947
+ companions: [NOW$1]
19835
19948
  }),
19836
19949
  numeric({
19837
19950
  id: "power",
@@ -19842,7 +19955,7 @@ var GROUP_TEMPLATES = [
19842
19955
  quantity: "power",
19843
19956
  defaultAggregate: "sum",
19844
19957
  empty: "omit",
19845
- companions: [NOW]
19958
+ companions: [NOW$1]
19846
19959
  }),
19847
19960
  numeric({
19848
19961
  id: "energy",
@@ -19853,7 +19966,7 @@ var GROUP_TEMPLATES = [
19853
19966
  quantity: "energy",
19854
19967
  defaultAggregate: "sum",
19855
19968
  empty: "omit",
19856
- companions: [NOW]
19969
+ companions: [NOW$1]
19857
19970
  }),
19858
19971
  numeric({
19859
19972
  id: "battery",
@@ -19888,7 +20001,7 @@ var GROUP_TEMPLATES = [
19888
20001
  quantity: "device",
19889
20002
  defaultAggregate: "mean",
19890
20003
  empty: "null",
19891
- companions: [NOW]
20004
+ companions: [NOW$1]
19892
20005
  }),
19893
20006
  binary({
19894
20007
  id: "motion",
@@ -20017,6 +20130,7 @@ function actuator(input) {
20017
20130
  }
20018
20131
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
20019
20132
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
20133
+ DeviceType.Camera;
20020
20134
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
20021
20135
  /**
20022
20136
  * What a composition may BUILD on a device type (G2, D676): the caps a new
@@ -48128,7 +48242,20 @@ var NcRuleInputSchema = object({
48128
48242
  * save by the hub's grouping guard). `.optional()`, never `.default()`: the addon cap
48129
48243
  * path does not run Zod defaults.
48130
48244
  */
48131
- groupingSec: number().int().min(5).max(60).optional()
48245
+ groupingSec: number().int().min(5).max(60).optional(),
48246
+ /**
48247
+ * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
48248
+ * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
48249
+ * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
48250
+ * same mark the Library writes, and records whose notification it was and
48251
+ * when. A channel with no buttons gets the same two choices as links.
48252
+ *
48253
+ * `.optional()`, never `.default()` (a Zod default does not run on the addon
48254
+ * cap path): absent and `false` both mean off, which is what every rule
48255
+ * authored before this field meant. An editor turns it off by writing
48256
+ * `false`, so it needs no `clear` key.
48257
+ */
48258
+ askVerdict: boolean().optional()
48132
48259
  });
48133
48260
  /**
48134
48261
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -64979,6 +65106,44 @@ var lockControlCapability = {
64979
65106
  volatileStateFields: ["lastChangedAt"]
64980
65107
  };
64981
65108
  /**
65109
+ * A monotonic total between resets (D944). Energy uses `power-meter.kwhTotal`
65110
+ * so dashboards keep one series; every other instantaneous reading lands here.
65111
+ * `value` is the time integral in the source quantity's accumulated base
65112
+ * (base-unit seconds, or kWh on the power meter). `null` is a gap, never zero.
65113
+ */
65114
+ var MeterStatusSchema = object({
65115
+ value: number().nullable().meta(readingMeta("device", { label: "Total" })),
65116
+ lastFetchedAt: number()
65117
+ });
65118
+ var meterCapability = {
65119
+ name: "meter",
65120
+ scope: "device",
65121
+ deviceNative: true,
65122
+ mode: "singleton",
65123
+ deviceTypes: [DeviceType.Sensor],
65124
+ methods: {},
65125
+ status: {
65126
+ schema: MeterStatusSchema,
65127
+ kind: "push"
65128
+ },
65129
+ runtimeState: MeterStatusSchema,
65130
+ /**
65131
+ * Runtime-state durability: **restored** — the total is a cache of the
65132
+ * history integral. A restart shows it only until the history pass
65133
+ * recomputes the open period; it is not an in-memory buffer.
65134
+ *
65135
+ * See `RuntimeStateDurability`. Enforced by
65136
+ * `scripts/check-runtime-state-durability.ts`.
65137
+ */
65138
+ durability: "restored",
65139
+ history: { fields: { value: {
65140
+ kind: "counter",
65141
+ deadband: .001,
65142
+ minIntervalMs: 6e4
65143
+ } } },
65144
+ volatileStateFields: ["lastFetchedAt"]
65145
+ };
65146
+ /**
64982
65147
  * Media-player cap. Models HA `media_player.*` (Sonos, Chromecast,
64983
65148
  * Apple TV, Spotify, Roku, generic OTT receivers, …) on
64984
65149
  * `DeviceType.MediaPlayer`. Disjoint from the camera streaming
@@ -73456,6 +73621,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
73456
73621
  lawnMowerControl: lawnMowerControlCapability,
73457
73622
  lockControl: lockControlCapability,
73458
73623
  mediaPlayer: mediaPlayerCapability,
73624
+ meter: meterCapability,
73459
73625
  motion: motionCapability,
73460
73626
  motionTrigger: motionTriggerCapability,
73461
73627
  motionZones: motionZonesCapability,
@@ -78421,6 +78587,13 @@ Object.freeze({
78421
78587
  access: "create",
78422
78588
  role: "admin"
78423
78589
  },
78590
+ "meter.getStatus": {
78591
+ capName: "meter",
78592
+ capScope: "device",
78593
+ addonId: null,
78594
+ access: "view",
78595
+ role: "viewer"
78596
+ },
78424
78597
  "metricsProvider.collectSnapshot": {
78425
78598
  capName: "metrics-provider",
78426
78599
  capScope: "system",
@@ -87379,6 +87552,17 @@ var SENSOR_CAP_VOCABULARY = {
87379
87552
  }],
87380
87553
  events: { onMotionChanged: { notOperatorFacing: "the `detected` state trigger phrases both edges, from the mirror that survives a dropped event (D49)" } }
87381
87554
  },
87555
+ meter: {
87556
+ scope: "device",
87557
+ noun: t("Meter", "Contatore"),
87558
+ state: [{
87559
+ kind: "numeric",
87560
+ field: "value",
87561
+ quantity: t("the total", "il totale"),
87562
+ label: t("Total", "Totale"),
87563
+ icon: "gauge"
87564
+ }]
87565
+ },
87382
87566
  "numeric-sensor": {
87383
87567
  scope: "device",
87384
87568
  noun: t("Sensor", "Sensore"),
@@ -89068,6 +89252,11 @@ Object.freeze({
89068
89252
  form: "single",
89069
89253
  optional: false
89070
89254
  }],
89255
+ "meter.getStatus": [{
89256
+ name: "deviceId",
89257
+ form: "single",
89258
+ optional: false
89259
+ }],
89071
89260
  "motion.getStatus": [{
89072
89261
  name: "deviceId",
89073
89262
  form: "single",
@@ -90772,7 +90961,6 @@ var BucketAccumulator = class {
90772
90961
  return n;
90773
90962
  }
90774
90963
  };
90775
- DeviceType.Camera;
90776
90964
  /**
90777
90965
  * A saved Customize assignment (D936). The schema is the type: callers use
90778
90966
  * `z.infer`, they do not restate the shape.