@camstack/addon-pipeline-orchestrator 1.2.656 → 1.2.657

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 (39) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/assets/viewer/.viewer-current-files.json +18 -18
  3. package/assets/viewer/.viewer-version +1 -1
  4. package/assets/viewer/_expo/static/js/web/[frameId]-35c42299530aeeb8af9696a44574d5c2.js +23 -0
  5. package/assets/viewer/_expo/static/js/web/[id]-483ffcfbccae57166106f1a730461293.js +5 -0
  6. package/assets/viewer/_expo/static/js/web/[id]-c457536a2a37016983818811138b3a68.js +7 -0
  7. package/assets/viewer/_expo/static/js/web/[id]-fe77e3abe00340b8cdf3c7df3fb79c24.js +57 -0
  8. package/assets/viewer/_expo/static/js/web/[section]-72a776b38de8eb6487770a1830e6eada.js +31 -0
  9. package/assets/viewer/_expo/static/js/web/{__common-2f84b1ca43bfa1f12ceabf6b143bb44e.js → __common-d6b750942f15f710317cda14c45946b4.js} +1294 -1294
  10. package/assets/viewer/_expo/static/js/web/_layout-5d35df374c084c4635d1323a5e6d8399.js +29 -0
  11. package/assets/viewer/_expo/static/js/web/{_layout-17608b2531640cc566469fddcf1cdbea.js → _layout-daed64c97776d517df8e5f42a7d16b6f.js} +24 -24
  12. package/assets/viewer/_expo/static/js/web/adhoc-bcd88137d4e491b34717e02b4c9d0e32.js +1 -0
  13. package/assets/viewer/_expo/static/js/web/alarm-e5511212fbc4e9bab740e7ec259b5d9e.js +1 -0
  14. package/assets/viewer/_expo/static/js/web/cameras-5471fc1de6356415505bd7f707e6ac77.js +27 -0
  15. package/assets/viewer/_expo/static/js/web/{enroll-2c9af33bd8953e33bfb9034fdef2d63e.js → enroll-aba8aa69276085249ee806a26942194b.js} +19 -19
  16. package/assets/viewer/_expo/static/js/web/history-aa7ea0e4b4b755ec248bf939ade97798.js +3 -0
  17. package/assets/viewer/_expo/static/js/web/{index-7c624c3ed46f4397bb3abd93a9f436ec.js → index-265396a362ea3648a3697c2984d6c244.js} +2 -2
  18. package/assets/viewer/_expo/static/js/web/index-4498d2909e3bfdca3309ff3f3f59c10c.js +1 -0
  19. package/assets/viewer/_expo/static/js/web/index-ef33db09c327e9668346081607160e76.js +1 -0
  20. package/assets/viewer/_expo/static/js/web/new-ba66f0a1a170bf1a3f64c38ed30fcdbb.js +2 -0
  21. package/assets/viewer/_expo/static/js/web/sign-in-657339c48456ee6f863a61a77ff8af56.js +38 -0
  22. package/assets/viewer/index.html +1 -1
  23. package/dist/_stub.js +2 -2
  24. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-BlG7DFZv.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-CHSkS8Be.mjs} +2 -2
  25. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-C33x6eba.mjs +26 -0
  26. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-D8vih3Xp.mjs +26 -0
  27. package/dist/{hostInit-CNueneOD.mjs → hostInit-DT5XVm61.mjs} +2 -2
  28. package/dist/index.js +256 -202
  29. package/dist/index.mjs +256 -202
  30. package/dist/remoteEntry.js +1 -1
  31. package/package.json +2 -2
  32. package/assets/viewer/_expo/static/js/web/Clipboard-1f1164c412be79bd909a8e53c97a3482.js +0 -8
  33. package/assets/viewer/_expo/static/js/web/Haptics-8bcab636236172ba5f48ae47f6464b1c.js +0 -3
  34. package/assets/viewer/_expo/static/js/web/add-server-9d522e50b831fce3986b69e94e22191a.js +0 -2
  35. package/assets/viewer/_expo/static/js/web/connect-308ac6434caaad2fc6ccf6dbf0aa39d8.js +0 -2
  36. package/assets/viewer/_expo/static/js/web/index-b65eec858e160d6ed7880072a4ed593f.js +0 -4
  37. package/assets/viewer/_expo/static/js/web/index-e0b431ae0b4ca13eb0ab241ae4744574.js +0 -2
  38. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-NEEgITJZ.mjs +0 -26
  39. package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-B_KHG4Or.mjs +0 -26
package/dist/index.js CHANGED
@@ -6012,7 +6012,7 @@ var ZodIssueCode = {
6012
6012
  var ZodFirstPartyTypeKind;
6013
6013
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6014
6014
  //#endregion
6015
- //#region ../types/dist/sleep-DV4qxEyD.mjs
6015
+ //#region ../types/dist/sleep-hK-Dss3z.mjs
6016
6016
  /**
6017
6017
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6018
6018
  * window to float samples (D455).
@@ -12310,7 +12310,7 @@ function sleep(ms) {
12310
12310
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
12311
12311
  }
12312
12312
  //#endregion
12313
- //#region ../types/dist/composition-CD1GdFuv.mjs
12313
+ //#region ../types/dist/composition-BSGHhcr8.mjs
12314
12314
  /**
12315
12315
  * The ffmpeg build every CamStack node downloads, per platform and arch.
12316
12316
  *
@@ -13202,38 +13202,6 @@ function validateExpressionSource(src) {
13202
13202
  return null;
13203
13203
  }
13204
13204
  /**
13205
- * One power reading becomes a washer, dryer or dishwasher (D944 helper).
13206
- *
13207
- * Standby of the control board is under 5 W; a motor or a heater is far
13208
- * above that, so 5 W is the line. A door lock or a short pump spike is not
13209
- * a cycle, so running starts only after 30 s above the line.
13210
- *
13211
- * A wash, dry or dishwasher pause (soak, heat-wait, heater off between
13212
- * bursts) lasts several minutes. Ending the cycle on the first dip would
13213
- * report "finished" in the middle of the program, so the stop dwell is
13214
- * 10 minutes on every type. The number is stored per type so one machine
13215
- * can move later without moving the others.
13216
- */
13217
- var APPLIANCE_TEMPLATE_ID = "appliance";
13218
- var APPLIANCE_KINDS = [
13219
- "washer",
13220
- "dryer",
13221
- "dishwasher"
13222
- ];
13223
- DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher;
13224
- /**
13225
- * A dumb plug-in stove or heater, built from a smart plug (a `Heater`).
13226
- *
13227
- * The plug is the actuator: `switch.setState` is a FORWARD to the plug's own
13228
- * (D967), so the heater switches exactly as the plug does. Running is the
13229
- * plug being on; when a power reading is also named, running is the draw
13230
- * staying above the line instead (a plug left on with the stove's own
13231
- * thermostat open is not heating). 50 W is far above any standby and below
13232
- * the smallest radiator.
13233
- */
13234
- var HEATER_TEMPLATE_ID = "heater";
13235
- DeviceType.Heater;
13236
- /**
13237
13205
  * Statistics and integrals over a history read (D944).
13238
13206
  *
13239
13207
  * Pure: the same points always give the same answer, so a restart recomputes
@@ -13377,34 +13345,6 @@ var HelperSpecSchema = discriminatedUnion("kind", [
13377
13345
  /** Actuator groups only. Readings leave this unset. */
13378
13346
  active: ActiveCriterionSchema.optional()
13379
13347
  }),
13380
- object({
13381
- kind: literal("appliance"),
13382
- templateId: literal(APPLIANCE_TEMPLATE_ID),
13383
- appliance: _enum(APPLIANCE_KINDS),
13384
- thresholdWatts: number().positive(),
13385
- startDwellMs: number().int().nonnegative(),
13386
- stopDwellMs: number().int().nonnegative(),
13387
- member: HelperMemberSchema,
13388
- /**
13389
- * The plug that powers the appliance (`switch.on`). Optional: when set, the
13390
- * composition carries a `power-source` feature, so the hub can cut and restore
13391
- * that plug (power-source link of a NEW-target composition).
13392
- */
13393
- powerSwitch: HelperMemberSchema.optional(),
13394
- /** How long a forced restart keeps the plug off; the cap's default when unset. */
13395
- offSeconds: number().optional()
13396
- }),
13397
- object({
13398
- kind: literal("heater"),
13399
- templateId: literal(HEATER_TEMPLATE_ID),
13400
- /** The plug, read and commanded at `switch.on`. */
13401
- plug: HelperMemberSchema,
13402
- /** The plug's power reading, when it has one: running is then the draw, not the switch. */
13403
- meter: HelperMemberSchema.optional(),
13404
- thresholdWatts: number().positive(),
13405
- startDwellMs: number().int().nonnegative(),
13406
- stopDwellMs: number().int().nonnegative()
13407
- }),
13408
13348
  object({
13409
13349
  kind: literal("statistic"),
13410
13350
  stat: _enum(STATISTIC_STATS),
@@ -49629,49 +49569,6 @@ function actuator(input) {
49629
49569
  };
49630
49570
  }
49631
49571
  new Map(GROUP_TEMPLATES.map((template) => [template.id, template]));
49632
- var PowerSourceRefusalReasonSchema = _enum([
49633
- "no-power-source",
49634
- "switch-missing",
49635
- "switch-offline",
49636
- "switch-unknown",
49637
- "restart-in-progress",
49638
- "switch-call-failed"
49639
- ]);
49640
- var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
49641
- accepted: literal(false),
49642
- reason: PowerSourceRefusalReasonSchema,
49643
- /** One line for the operator, naming the switch. */
49644
- message: string()
49645
- })]);
49646
- var PowerSourceInfoSchema = object({
49647
- /** False when the device has no power source linked; the rest is then empty. */
49648
- linked: boolean(),
49649
- switchDeviceId: number().nullable(),
49650
- switchName: string().nullable(),
49651
- /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
49652
- switchOn: boolean().nullable(),
49653
- switchOnline: boolean().nullable(),
49654
- restartInProgress: boolean(),
49655
- offSeconds: number().int()
49656
- });
49657
- object({
49658
- /** Null while the switch has not reported: unknown is never `false` (D393). */
49659
- switchOn: boolean().nullable(),
49660
- offSeconds: number().int(),
49661
- lastFetchedAt: number()
49662
- });
49663
- DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
49664
- var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
49665
- systemMethod(deviceInput$2, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
49666
- kind: "mutation",
49667
- auth: "admin"
49668
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
49669
- kind: "mutation",
49670
- auth: "admin"
49671
- }), systemMethod(deviceInput$2, PowerSourceActionResultSchema, {
49672
- kind: "mutation",
49673
- auth: "admin"
49674
- });
49675
49572
  DeviceFeature.LightColorRgb, DeviceFeature.LightColorHsv, DeviceFeature.LightColorMired;
49676
49573
  DeviceType.Camera;
49677
49574
  `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
@@ -49699,6 +49596,165 @@ var ComposableCapabilitiesSchema = object({ caps: array(object({
49699
49596
  }).optional()
49700
49597
  })) });
49701
49598
  /**
49599
+ * A saved Customize assignment (D936). The schema is the type: callers use
49600
+ * `z.infer`, they do not restate the shape.
49601
+ */
49602
+ var OverrideSourceSchema = object({
49603
+ addonId: string().min(1),
49604
+ stableId: string().min(1),
49605
+ cap: string().min(1),
49606
+ fieldPath: string().min(1)
49607
+ });
49608
+ var IdentityTransformDraftSchema = object({ kind: literal("identity") });
49609
+ var InvertTransformDraftSchema = object({ kind: literal("invert") });
49610
+ var ThresholdTransformDraftSchema = object({
49611
+ kind: literal("threshold"),
49612
+ comparison: _enum(["gte", "lte"]),
49613
+ threshold: number(),
49614
+ startDwellMs: number().nonnegative(),
49615
+ stopDwellMs: number().nonnegative()
49616
+ });
49617
+ var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
49618
+ IdentityTransformDraftSchema,
49619
+ InvertTransformDraftSchema,
49620
+ ThresholdTransformDraftSchema,
49621
+ object({
49622
+ kind: literal("linear"),
49623
+ scale: number(),
49624
+ offset: number(),
49625
+ clampMin: number().optional(),
49626
+ clampMax: number().optional()
49627
+ }),
49628
+ object({
49629
+ kind: literal("enum-map"),
49630
+ mapping: record(string(), string().nullable())
49631
+ }),
49632
+ object({ kind: literal("number") })
49633
+ ]);
49634
+ var ScalarOverrideDraftSchema = object({
49635
+ kind: literal("scalar"),
49636
+ cap: string().min(1),
49637
+ targetId: string().min(1),
49638
+ source: OverrideSourceSchema,
49639
+ transform: CustomizeTransformDraftSchema
49640
+ });
49641
+ var KeyedArrayOverrideDraftSchema = object({
49642
+ kind: literal("keyedArray"),
49643
+ cap: string().min(1),
49644
+ targetId: string().min(1),
49645
+ key: string().min(1),
49646
+ label: string().min(1),
49647
+ fieldPath: string().min(1),
49648
+ source: OverrideSourceSchema,
49649
+ transform: CustomizeTransformDraftSchema
49650
+ });
49651
+ var PulseOverrideDraftSchema = object({
49652
+ kind: literal("pulse"),
49653
+ cap: string().min(1),
49654
+ targetId: string().min(1),
49655
+ enabled: boolean(),
49656
+ debounceMs: number().nonnegative(),
49657
+ edges: array(_enum([
49658
+ "rising",
49659
+ "button",
49660
+ "native-event"
49661
+ ])).min(1).optional(),
49662
+ sources: array(OverrideSourceSchema).min(1)
49663
+ });
49664
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
49665
+ "in-addition",
49666
+ "confirm",
49667
+ "replace"
49668
+ ]).optional() });
49669
+ discriminatedUnion("kind", [
49670
+ ScalarOverrideDraftSchema,
49671
+ KeyedArrayOverrideDraftSchema,
49672
+ PulseOverrideDraftSchema,
49673
+ object({
49674
+ kind: literal("span"),
49675
+ cap: string().min(1),
49676
+ targetId: string().min(1),
49677
+ timeoutMs: number().nonnegative(),
49678
+ cooldownMs: number().nonnegative().optional(),
49679
+ sources: array(SpanSourceDraftSchema)
49680
+ })
49681
+ ]);
49682
+ object({
49683
+ targetId: string().min(1),
49684
+ configured: boolean(),
49685
+ source: _enum(["native", "assigned"]),
49686
+ state: _enum([
49687
+ "active",
49688
+ "stale",
49689
+ "released",
49690
+ "unavailable"
49691
+ ]),
49692
+ reason: string().nullable()
49693
+ });
49694
+ /**
49695
+ * What a running-threshold proposal says (planning#405). The schema is the
49696
+ * type: the algorithm, the capability method and the UI all read `z.infer`.
49697
+ *
49698
+ * A proposal is read-only advice: it carries the numbers it was derived from
49699
+ * (`evidence`) so the operator can judge it, and an `insufficient` answer names
49700
+ * WHY with a typed reason and the catalog defaults, never an invented number.
49701
+ */
49702
+ var RunningProposalTierSchema = _enum(["raw", "5m"]);
49703
+ var RunningProposalConfidenceSchema = _enum([
49704
+ "high",
49705
+ "medium",
49706
+ "low"
49707
+ ]);
49708
+ var RunningProposalInsufficientReasonSchema = _enum([
49709
+ "no-history",
49710
+ "span-too-short",
49711
+ "truncated",
49712
+ "no-idle-floor",
49713
+ "no-runs",
49714
+ "no-separation"
49715
+ ]);
49716
+ var RunningProposalReplaySchema = object({
49717
+ /** Intervals the real dwell expression held true over the window. */
49718
+ intervals: number().int().nonnegative(),
49719
+ /** Intervals outside every run, or a second interval inside one. */
49720
+ extra: number().int().nonnegative(),
49721
+ /** Runs without an interval of their own (none, or merged into a neighbour). */
49722
+ missed: number().int().nonnegative()
49723
+ });
49724
+ var RunningProposalEvidenceSchema = object({
49725
+ tier: RunningProposalTierSchema,
49726
+ spanMs: number().nonnegative(),
49727
+ from: number(),
49728
+ to: number(),
49729
+ points: number().int().nonnegative(),
49730
+ runsFound: number().int().nonnegative(),
49731
+ pausesFound: number().int().nonnegative(),
49732
+ longestPauseMs: number().nonnegative(),
49733
+ idleFloorW: number(),
49734
+ noiseCeilingW: number(),
49735
+ plateauW: number(),
49736
+ replay: RunningProposalReplaySchema
49737
+ });
49738
+ var RunningProposalInsufficientEvidenceSchema = object({
49739
+ spanMs: number().nonnegative(),
49740
+ points: number().int().nonnegative(),
49741
+ runsFound: number().int().nonnegative()
49742
+ });
49743
+ var RunningThresholdProposalSchema = discriminatedUnion("state", [object({
49744
+ state: literal("proposal"),
49745
+ transform: ThresholdTransformDraftSchema,
49746
+ evidence: RunningProposalEvidenceSchema,
49747
+ confidence: RunningProposalConfidenceSchema,
49748
+ /** Why the confidence is not higher; empty when nothing held it back. */
49749
+ notes: array(string())
49750
+ }), object({
49751
+ state: literal("insufficient"),
49752
+ reason: RunningProposalInsufficientReasonSchema,
49753
+ evidence: RunningProposalInsufficientEvidenceSchema,
49754
+ /** The catalog defaults, offered as what stands when nothing better is known. */
49755
+ fallback: ThresholdTransformDraftSchema
49756
+ })]);
49757
+ /**
49702
49758
  * The report of a one-shot "move this owner's plaintext secrets into the
49703
49759
  * keychain" run (D878). COUNTS only - never a value, never a ref.
49704
49760
  *
@@ -49988,6 +50044,14 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
49988
50044
  kind: "mutation",
49989
50045
  auth: "admin",
49990
50046
  access: "view"
50047
+ }), method(object({
50048
+ deviceId: number().int(),
50049
+ cap: string().min(1),
50050
+ fieldPath: string().min(1),
50051
+ deviceType: _enum(DeviceType).optional()
50052
+ }), RunningThresholdProposalSchema, {
50053
+ auth: "admin",
50054
+ access: "view"
49991
50055
  }), method(object({
49992
50056
  blockId: string().min(1),
49993
50057
  trace: AutomationRunTraceSchema.optional(),
@@ -54365,15 +54429,15 @@ var FanPresetCaptureResultSchema = object({
54365
54429
  items: array(FanCaptureItemSchema),
54366
54430
  omitted: array(FanCaptureOmissionSchema)
54367
54431
  });
54368
- var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
54432
+ var deviceInput$2 = object({ deviceId: number().int().nonnegative() });
54369
54433
  DeviceType.Fan;
54370
- method(deviceInput$1, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$1.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
54434
+ method(deviceInput$2, array(FanPresetSchema), { auth: "protected" }), method(deviceInput$2.extend({ presets: array(FanPresetSchema).max(12) }), FanPresetsSetResultSchema, {
54371
54435
  kind: "mutation",
54372
54436
  auth: "admin"
54373
- }), method(deviceInput$1.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
54437
+ }), method(deviceInput$2.extend({ presetId: string().min(1) }), FanPresetApplyResultSchema, {
54374
54438
  kind: "mutation",
54375
54439
  auth: "protected"
54376
- }), method(deviceInput$1.extend({
54440
+ }), method(deviceInput$2.extend({
54377
54441
  fields: array(FanCaptureFieldSchema).optional(),
54378
54442
  steps: array(ActionStepSchema).max(20).default([])
54379
54443
  }), FanPresetCaptureResultSchema, { auth: "protected" });
@@ -70082,6 +70146,49 @@ object({
70082
70146
  DeviceType.PetFeeder,
70083
70147
  DeviceType.Heater
70084
70148
  ].filter((type) => type !== DeviceType.Sensor);
70149
+ var PowerSourceRefusalReasonSchema = _enum([
70150
+ "no-power-source",
70151
+ "switch-missing",
70152
+ "switch-offline",
70153
+ "switch-unknown",
70154
+ "restart-in-progress",
70155
+ "switch-call-failed"
70156
+ ]);
70157
+ var PowerSourceActionResultSchema = discriminatedUnion("accepted", [object({ accepted: literal(true) }), object({
70158
+ accepted: literal(false),
70159
+ reason: PowerSourceRefusalReasonSchema,
70160
+ /** One line for the operator, naming the switch. */
70161
+ message: string()
70162
+ })]);
70163
+ var PowerSourceInfoSchema = object({
70164
+ /** False when the device has no power source linked; the rest is then empty. */
70165
+ linked: boolean(),
70166
+ switchDeviceId: number().nullable(),
70167
+ switchName: string().nullable(),
70168
+ /** The switch's on/off state, or null when it is unknown. Never false for unknown (D393). */
70169
+ switchOn: boolean().nullable(),
70170
+ switchOnline: boolean().nullable(),
70171
+ restartInProgress: boolean(),
70172
+ offSeconds: number().int()
70173
+ });
70174
+ object({
70175
+ /** Null while the switch has not reported: unknown is never `false` (D393). */
70176
+ switchOn: boolean().nullable(),
70177
+ offSeconds: number().int(),
70178
+ lastFetchedAt: number()
70179
+ });
70180
+ DeviceType.Gateway, DeviceType.Hub, DeviceType.Camera, DeviceType.Sensor, DeviceType.MediaPlayer, DeviceType.Vacuum, DeviceType.Generic, DeviceType.Washer, DeviceType.Dryer, DeviceType.Dishwasher, DeviceType.PetFountain, DeviceType.Fan, DeviceType.Humidifier, DeviceType.Climate, DeviceType.WaterHeater;
70181
+ var deviceInput$1 = object({ deviceId: number().int().nonnegative() });
70182
+ systemMethod(deviceInput$1, PowerSourceInfoSchema, { auth: "admin" }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
70183
+ kind: "mutation",
70184
+ auth: "admin"
70185
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
70186
+ kind: "mutation",
70187
+ auth: "admin"
70188
+ }), systemMethod(deviceInput$1, PowerSourceActionResultSchema, {
70189
+ kind: "mutation",
70190
+ auth: "admin"
70191
+ });
70085
70192
  /**
70086
70193
  * Presence cap. Models HA `person.*` and `device_tracker.*` entities
70087
70194
  * on `DeviceType.Presence`. Read-only — no setters: presence is
@@ -78356,6 +78463,34 @@ discriminatedUnion("kind", [object({
78356
78463
  kind: literal("pronto"),
78357
78464
  code: string()
78358
78465
  })]);
78466
+ /**
78467
+ * Propose a running threshold from a device's own power history (planning#405).
78468
+ *
78469
+ * Pure and deterministic: the same series gives the same answer. The series is
78470
+ * a HELD-VALUE step series — a point's value stands until the next point — which
78471
+ * is how device-history stores a gauge, so "time at a level" is exact, not a
78472
+ * count of samples.
78473
+ *
78474
+ * 1. idle floor F = time-weighted median; noise ceiling N = highest value seen
78475
+ * near F. A device that is not near one level most of the time has no floor.
78476
+ * 2. coarse activity = above max(2N, N + 5 W); consecutive stretches are episodes.
78477
+ * 3. gaps between episodes split in two by the largest log-scale jump (>= 3x):
78478
+ * the short ones are pauses INSIDE a run (a soak), the long ones separate runs.
78479
+ * 4. T = geometric mean of N and the plateau's 10th percentile, snapped to a
78480
+ * grid a person would type; stop dwell covers the longest pause; start dwell
78481
+ * covers the longest standby blip above T.
78482
+ * 5. the numbers are proved by REPLAY through the real `dwell` evaluation: each
78483
+ * run must hold exactly one true interval and nothing may flap outside.
78484
+ */
78485
+ var SECOND_MS = 1e3;
78486
+ var MINUTE_MS$1 = 60 * SECOND_MS;
78487
+ 24 * (60 * MINUTE_MS$1);
78488
+ 10 * MINUTE_MS$1;
78489
+ 30 * SECOND_MS;
78490
+ 60 * SECOND_MS;
78491
+ 20 * MINUTE_MS$1;
78492
+ 10 * SECOND_MS;
78493
+ 10 * SECOND_MS;
78359
78494
  DeviceFeature.FanSpeed, DeviceFeature.FanPreset, DeviceFeature.FanDirection, DeviceFeature.FanOscillating, DeviceFeature.CoverStoppable, DeviceFeature.CoverPositionable, DeviceFeature.CoverTilt, DeviceFeature.ValvePositionable, DeviceFeature.MediaPlayerVolume, DeviceFeature.ClimateFanMode;
78360
78495
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
78361
78496
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
@@ -79897,6 +80032,13 @@ Object.freeze({
79897
80032
  access: "create",
79898
80033
  role: "admin"
79899
80034
  },
80035
+ "coreBlocks.proposeRunningThreshold": {
80036
+ capName: "core-blocks",
80037
+ capScope: "system",
80038
+ addonId: null,
80039
+ access: "view",
80040
+ role: "admin"
80041
+ },
79900
80042
  "coreBlocks.reportAutomationRun": {
79901
80043
  capName: "core-blocks",
79902
80044
  capScope: "system",
@@ -89383,6 +89525,11 @@ Object.freeze({
89383
89525
  form: "single",
89384
89526
  optional: false
89385
89527
  }],
89528
+ "coreBlocks.proposeRunningThreshold": [{
89529
+ name: "deviceId",
89530
+ form: "single",
89531
+ optional: false
89532
+ }],
89386
89533
  "cover.close": [{
89387
89534
  name: "deviceId",
89388
89535
  form: "single",
@@ -92143,99 +92290,6 @@ var BucketAccumulator = class {
92143
92290
  return n;
92144
92291
  }
92145
92292
  };
92146
- /**
92147
- * A saved Customize assignment (D936). The schema is the type: callers use
92148
- * `z.infer`, they do not restate the shape.
92149
- */
92150
- var OverrideSourceSchema = object({
92151
- addonId: string().min(1),
92152
- stableId: string().min(1),
92153
- cap: string().min(1),
92154
- fieldPath: string().min(1)
92155
- });
92156
- var CustomizeTransformDraftSchema = discriminatedUnion("kind", [
92157
- object({ kind: literal("identity") }),
92158
- object({ kind: literal("invert") }),
92159
- object({
92160
- kind: literal("threshold"),
92161
- comparison: _enum(["gte", "lte"]),
92162
- threshold: number(),
92163
- startDwellMs: number().nonnegative(),
92164
- stopDwellMs: number().nonnegative()
92165
- }),
92166
- object({
92167
- kind: literal("linear"),
92168
- scale: number(),
92169
- offset: number(),
92170
- clampMin: number().optional(),
92171
- clampMax: number().optional()
92172
- }),
92173
- object({
92174
- kind: literal("enum-map"),
92175
- mapping: record(string(), string().nullable())
92176
- }),
92177
- object({ kind: literal("number") })
92178
- ]);
92179
- var ScalarOverrideDraftSchema = object({
92180
- kind: literal("scalar"),
92181
- cap: string().min(1),
92182
- targetId: string().min(1),
92183
- source: OverrideSourceSchema,
92184
- transform: CustomizeTransformDraftSchema
92185
- });
92186
- var KeyedArrayOverrideDraftSchema = object({
92187
- kind: literal("keyedArray"),
92188
- cap: string().min(1),
92189
- targetId: string().min(1),
92190
- key: string().min(1),
92191
- label: string().min(1),
92192
- fieldPath: string().min(1),
92193
- source: OverrideSourceSchema,
92194
- transform: CustomizeTransformDraftSchema
92195
- });
92196
- var PulseOverrideDraftSchema = object({
92197
- kind: literal("pulse"),
92198
- cap: string().min(1),
92199
- targetId: string().min(1),
92200
- enabled: boolean(),
92201
- debounceMs: number().nonnegative(),
92202
- edges: array(_enum([
92203
- "rising",
92204
- "button",
92205
- "native-event"
92206
- ])).min(1).optional(),
92207
- sources: array(OverrideSourceSchema).min(1)
92208
- });
92209
- var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: _enum([
92210
- "in-addition",
92211
- "confirm",
92212
- "replace"
92213
- ]).optional() });
92214
- discriminatedUnion("kind", [
92215
- ScalarOverrideDraftSchema,
92216
- KeyedArrayOverrideDraftSchema,
92217
- PulseOverrideDraftSchema,
92218
- object({
92219
- kind: literal("span"),
92220
- cap: string().min(1),
92221
- targetId: string().min(1),
92222
- timeoutMs: number().nonnegative(),
92223
- cooldownMs: number().nonnegative().optional(),
92224
- sources: array(SpanSourceDraftSchema)
92225
- })
92226
- ]);
92227
- object({
92228
- targetId: string().min(1),
92229
- configured: boolean(),
92230
- source: _enum(["native", "assigned"]),
92231
- state: _enum([
92232
- "active",
92233
- "stale",
92234
- "released",
92235
- "unavailable"
92236
- ]),
92237
- reason: string().nullable()
92238
- });
92239
92293
  var G711_SCALE_CORRECTION_DB = {
92240
92294
  PCMU: 20 * Math.log10(4),
92241
92295
  PCMA: 20 * Math.log10(8)