@camstack/types 1.2.405 → 1.2.406

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 (41) hide show
  1. package/dist/addon.js +21 -2
  2. package/dist/addon.mjs +21 -2
  3. package/dist/capabilities/index.d.ts +4 -2
  4. package/dist/capabilities/notification-rules.cap.d.ts +3 -78
  5. package/dist/capabilities/osd-manager.cap.d.ts +0 -18
  6. package/dist/capabilities/running-state.cap.d.ts +76 -0
  7. package/dist/client.js +10 -62
  8. package/dist/client.mjs +10 -62
  9. package/dist/{composition-eoYYVfOp.js → composition-RmnnN39T.js} +86 -2
  10. package/dist/{composition-CB6PMT9p.mjs → composition-xz-ud5EQ.mjs} +86 -2
  11. package/dist/device/cap-vocabulary/entries/appliances.d.ts +1 -1
  12. package/dist/enums/event-category.d.ts +4 -0
  13. package/dist/enums.js +1 -1
  14. package/dist/enums.mjs +1 -1
  15. package/dist/{event-category-fDPduoeC.mjs → event-category-Ceif8n-v.mjs} +4 -0
  16. package/dist/{event-category-CXrwjC3e.js → event-category-DG6Vir8Z.js} +4 -0
  17. package/dist/expression/builtins.d.ts +7 -18
  18. package/dist/expression/expression-source.d.ts +14 -2
  19. package/dist/generated/addon-api.d.ts +14 -0
  20. package/dist/generated/addon-cap-facts.d.ts +1 -1
  21. package/dist/generated/cap-status-types.d.ts +3 -1
  22. package/dist/generated/capability-router-map.d.ts +5 -2
  23. package/dist/generated/device-local-state.d.ts +3 -0
  24. package/dist/generated/device-proxy.d.ts +3 -0
  25. package/dist/generated/device-scoped-caps.d.ts +1 -1
  26. package/dist/generated/history-catalog.d.ts +1 -1
  27. package/dist/generated/method-access-map.d.ts +1 -1
  28. package/dist/generated/method-device-selectors.d.ts +1 -1
  29. package/dist/generated/runtime-state-durability.d.ts +1 -1
  30. package/dist/index.d.ts +3 -0
  31. package/dist/index.js +345 -88
  32. package/dist/index.mjs +331 -88
  33. package/dist/interfaces/config-ui.d.ts +69 -2
  34. package/dist/node.js +1 -1
  35. package/dist/node.mjs +1 -1
  36. package/dist/running-state/assignment.d.ts +34 -0
  37. package/dist/running-state/defaults.d.ts +3 -0
  38. package/dist/running-state/from-operation.d.ts +14 -0
  39. package/dist/{sleep-CHIEEJkY.mjs → sleep-CYfIZzGv.mjs} +7 -3
  40. package/dist/{sleep-BKS4OPMo.js → sleep-UP964hNP.js} +7 -3
  41. package/package.json +1 -1
@@ -86,7 +86,7 @@ export interface ConfigSection {
86
86
  readonly immediate?: boolean;
87
87
  readonly fields: readonly ConfigField[];
88
88
  }
89
- export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigIconField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigScheduleField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigNotificationTargetSelectField | ConfigNotificationTargetMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
89
+ export type ConfigField = ConfigTextField | ConfigNumberField | ConfigBooleanField | ConfigSelectField | ConfigMultiSelectField | ConfigTimezoneField | ConfigDateTimeField | ConfigColorField | ConfigIconField | ConfigPasswordField | ConfigTextAreaField | ConfigSliderField | ConfigTagsField | ConfigScheduleField | ConfigGroupField | ConfigSubTabsField | ConfigSeparatorField | ConfigInfoField | ConfigQrCodeField | ConfigObjectArrayField | ConfigEditableArrayField | ConfigModelSelectorField | ConfigStorageLocationField | ConfigProbeField | ConfigButtonField | ConfigNodeSelectField | ConfigNodeMultiSelectField | ConfigDeviceSelectField | ConfigDeviceMultiSelectField | ConfigNotificationTargetSelectField | ConfigNotificationTargetMultiSelectField | ConfigWidgetField | ConfigAddonActionSelectField | ConfigAddonActionButtonField | ConfigDeviceActionButtonField | ConfigAccountSignInField | ConfigSecretPresenceField;
90
90
  /**
91
91
  * Per-MODEL applicability of a pipeline-step setting (D214).
92
92
  *
@@ -903,6 +903,18 @@ export interface ConfigAddonActionSelectField extends ConfigFieldBase {
903
903
  emptyParamsMessage?: string;
904
904
  /** Optional message shown when the action returns no results. */
905
905
  emptyResultsMessage?: string;
906
+ /**
907
+ * When the action returns fewer than this many rows, render nothing.
908
+ * A single row is written into `writesKey`, or into this field's key.
909
+ * The manual fallback next to it stays the control the operator sees.
910
+ */
911
+ hideWhenFewerThan?: number;
912
+ /**
913
+ * Settings key the chosen value is written to when it is not this field's
914
+ * key. Use it so a discovery select and a manual text field do not share
915
+ * one React key.
916
+ */
917
+ writesKey?: string;
906
918
  }
907
919
  /**
908
920
  * Button that invokes an addon customAction. Used for "Verify token /
@@ -957,6 +969,61 @@ export interface ConfigAddonActionButtonField extends ConfigFieldBase {
957
969
  /** Confirmation prompt before executing. */
958
970
  confirmMessage?: string;
959
971
  }
972
+ /**
973
+ * "Sign in with <provider>". The button asks the addon for an authorize URL.
974
+ * PKCE verifier and state stay on the addon, keyed by `attemptId`. One paste
975
+ * box completes the sign-in. Tokens are written into secret fields and are
976
+ * not rendered here.
977
+ */
978
+ export interface ConfigAccountSignInField extends ConfigFieldBase {
979
+ readonly type: 'account-sign-in';
980
+ /** The paste box is local. Stored keys are the sibling fields. */
981
+ readonly value?: undefined;
982
+ readonly addonId: string;
983
+ /** "Sign in with {providerLabel}". */
984
+ readonly providerLabel: string;
985
+ readonly beginAction: string;
986
+ readonly completeAction: string;
987
+ readonly signOutAction: string;
988
+ /** Non-secret settings key holding the account label. */
989
+ readonly accountKey: string;
990
+ /** Optional numeric settings key shown after the account. */
991
+ readonly countKey?: string;
992
+ /** Singular noun for `countKey` ("gateway" → "gateways"). */
993
+ readonly countNoun?: string;
994
+ /**
995
+ * Settings key holding an array or a JSON array string whose length is the
996
+ * count when `countKey` is empty.
997
+ */
998
+ readonly countFromKey?: string;
999
+ /** Placeholder for the paste box. */
1000
+ readonly pastePlaceholder?: string;
1001
+ /**
1002
+ * Shown when the complete action returns more than one `choices` row.
1003
+ * Picking one writes `choiceKey` plus `brand` and `region` when the row has them.
1004
+ */
1005
+ readonly choiceKey?: string;
1006
+ readonly choiceLabel?: string;
1007
+ /** Secret settings keys cleared with the keychain clear instruction on sign-out. */
1008
+ readonly secretKeys: readonly string[];
1009
+ /**
1010
+ * Copy these result keys into the form after a successful paste.
1011
+ * Secret values are stored for save and rendered only by their own fields.
1012
+ */
1013
+ readonly assignResult?: Readonly<Record<string, string>>;
1014
+ }
1015
+ /**
1016
+ * "yes" / "no" for a secret that must not be shown. Reads another field's
1017
+ * value: a non-empty string or a keychain view counts as present.
1018
+ */
1019
+ export interface ConfigSecretPresenceField extends ConfigFieldBase {
1020
+ readonly type: 'secret-presence';
1021
+ /** Reads another field. This row stores nothing. */
1022
+ readonly value?: undefined;
1023
+ readonly sourceKey: string;
1024
+ readonly yesLabel: string;
1025
+ readonly noLabel: string;
1026
+ }
960
1027
  /**
961
1028
  * Button that invokes a DEVICE custom action (the device equivalent of
962
1029
  * `addon-action-button`). The deviceId comes from the form context, so it is
@@ -1052,7 +1119,7 @@ export type ConfigFieldWithValue = (ConfigTextField & {
1052
1119
  readonly value: unknown;
1053
1120
  }) | ConfigWidgetField | (ConfigAddonActionSelectField & {
1054
1121
  readonly value: unknown;
1055
- }) | ConfigAddonActionButtonField | ConfigDeviceActionButtonField;
1122
+ }) | ConfigAddonActionButtonField | ConfigDeviceActionButtonField | ConfigAccountSignInField | ConfigSecretPresenceField;
1056
1123
  /** Recursive version of `ConfigGroupField` with hydrated child fields. */
1057
1124
  export interface ConfigGroupFieldWithValue extends ConfigFieldBase {
1058
1125
  readonly type: 'group';
package/dist/node.js CHANGED
@@ -21,7 +21,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
21
  enumerable: true
22
22
  }) : target, mod));
23
23
  //#endregion
24
- const require_composition = require("./composition-eoYYVfOp.js");
24
+ const require_composition = require("./composition-RmnnN39T.js");
25
25
  const require_err_msg = require("./err-msg-BhVbr0NX.js");
26
26
  let node_crypto = require("node:crypto");
27
27
  let node_fs = require("node:fs");
package/dist/node.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { At as Fmp4BoxSplitter, Ct as FFMPEG_PATH_ENV, Dt as getFfmpegArtifact, Et as FFMPEG_RELEASE, Ot as getFfmpegDownloadUrl, P as compositionSourceKey, Pt as buildFfmpegArgs, Rt as isSoftwareDecode, Tt as ffmpegBinaryName, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, kt as canonicalHash, wt as chooseFfmpegBinary } from "./composition-CB6PMT9p.mjs";
1
+ import { At as Fmp4BoxSplitter, Ct as FFMPEG_PATH_ENV, Dt as getFfmpegArtifact, Et as FFMPEG_RELEASE, Ot as getFfmpegDownloadUrl, P as compositionSourceKey, Pt as buildFfmpegArgs, Rt as isSoftwareDecode, Tt as ffmpegBinaryName, a as CUSTOMIZATION_BLOCK_NAME_PREFIX, kt as canonicalHash, wt as chooseFfmpegBinary } from "./composition-xz-ud5EQ.mjs";
2
2
  import { t as errMsg } from "./err-msg-BXKzRBwg.mjs";
3
3
  import { createHash, createHmac, randomUUID, timingSafeEqual } from "node:crypto";
4
4
  import * as fs from "node:fs";
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Pure builder for Customize → Running assignment (D933). Same contract as
3
+ * admin-ui battery presets: returns null when the source cannot be expressed.
4
+ */
5
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition/composition.js';
6
+ import type { CompositionFieldKind } from '../composition/composition-report.js';
7
+ export type PresetMode = 'add' | 'replace';
8
+ export interface RunningAssignmentSource {
9
+ readonly source: CompositionSourceRef;
10
+ readonly cap: string;
11
+ readonly fieldPath: string;
12
+ readonly kind: CompositionFieldKind;
13
+ }
14
+ export interface RunningAssignmentInput {
15
+ readonly mode: PresetMode;
16
+ readonly target: CompositionSourceRef;
17
+ readonly source: RunningAssignmentSource;
18
+ readonly changedAtField: string | null;
19
+ readonly invert: boolean;
20
+ readonly thresholdWatts: number;
21
+ readonly startDelayMs: number;
22
+ readonly stopDelayMs: number;
23
+ }
24
+ export declare function runningAssignmentFeature(input: RunningAssignmentInput): CompositionFieldsFeature | null;
25
+ export interface RunningAssignmentRecovered {
26
+ readonly source: RunningAssignmentSource;
27
+ readonly invert: boolean;
28
+ readonly thresholdWatts: number;
29
+ readonly startDelayMs: number;
30
+ readonly stopDelayMs: number;
31
+ }
32
+ /** Recover what {@link runningAssignmentFeature} wrote, else null. */
33
+ export declare function runningAssignmentRecovered(stored: CompositionFieldsFeature, target: CompositionSourceRef): RunningAssignmentRecovered | null;
34
+ export declare function isRunningAssignmentFeature(stored: CompositionFieldsFeature, mode: PresetMode, target: CompositionSourceRef): boolean;
@@ -0,0 +1,3 @@
1
+ export declare const RUNNING_POWER_THRESHOLD_WATTS = 5;
2
+ export declare const RUNNING_POWER_START_DELAY_MS = 30000;
3
+ export declare const RUNNING_POWER_STOP_DELAY_MS = 180000;
@@ -0,0 +1,14 @@
1
+ import type { DishwasherOperationState } from '../capabilities/dishwasher.cap.js';
2
+ import type { LawnMowerActivity } from '../capabilities/lawn-mower-control.cap.js';
3
+ import type { MediaPlayerState } from '../capabilities/media-player.cap.js';
4
+ import type { VacuumState } from '../capabilities/vacuum-control.cap.js';
5
+ import type { RunningStateStatus } from '../capabilities/running-state.cap.js';
6
+ /** Prior boolean clock used when republishing without moving `since`. */
7
+ export interface RunningStatePrevious {
8
+ readonly running: boolean | null;
9
+ readonly since: number | null;
10
+ }
11
+ export declare function runningFromDishwasherOperation(operation: DishwasherOperationState | null, program: string | null, previous: RunningStatePrevious | undefined, now: number): RunningStateStatus;
12
+ export declare function runningFromVacuumState(state: VacuumState | null, previous: RunningStatePrevious | undefined, now: number): RunningStateStatus;
13
+ export declare function runningFromLawnMower(activity: LawnMowerActivity | null, previous: RunningStatePrevious | undefined, now: number): RunningStateStatus;
14
+ export declare function runningFromMediaPlayer(state: MediaPlayerState | null, previous: RunningStatePrevious | undefined, now: number): RunningStateStatus;
@@ -1,4 +1,4 @@
1
- import { t as EventCategory } from "./event-category-fDPduoeC.mjs";
1
+ import { t as EventCategory } from "./event-category-Ceif8n-v.mjs";
2
2
  import { z } from "zod";
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
@@ -504,7 +504,7 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries(WELL_KNOWN_TABS.map((t) => [t.id, t]
504
504
  * `hydrateSchema` to skip the `value` injection for structural-only fields.
505
505
  */
506
506
  function isValuelessField(field) {
507
- return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
507
+ return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
508
508
  }
509
509
  /**
510
510
  * Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
@@ -7327,6 +7327,7 @@ function createDeviceProxy(api, binding, opts) {
7327
7327
  getStatus: (input) => dispatch("recording-onboard", "recordingOnboard", "getStatus", "query", input)
7328
7328
  };
7329
7329
  const recordingSignalInterface = { getStatus: (input) => dispatch("recording-signal", "recordingSignal", "getStatus", "query", input) };
7330
+ const runningStateInterface = { getStatus: (input) => dispatch("running-state", "runningState", "getStatus", "query", input) };
7330
7331
  const sceneMonitorInterface = {
7331
7332
  listScenes: (input) => dispatch("scene-monitor", "sceneMonitor", "listScenes", "query", input),
7332
7333
  listScenesBatch: (input) => dispatch("scene-monitor", "sceneMonitor", "listScenesBatch", "query", input),
@@ -7653,6 +7654,7 @@ function createDeviceProxy(api, binding, opts) {
7653
7654
  ptzAutotrack: createSliceHandle(stateSource, binding.deviceId, "ptz-autotrack"),
7654
7655
  recordingOnboard: createSliceHandle(stateSource, binding.deviceId, "recording-onboard"),
7655
7656
  recordingSignal: createSliceHandle(stateSource, binding.deviceId, "recording-signal"),
7657
+ runningState: createSliceHandle(stateSource, binding.deviceId, "running-state"),
7656
7658
  sceneMonitor: createSliceHandle(stateSource, binding.deviceId, "scene-monitor"),
7657
7659
  scriptRunner: createSliceHandle(stateSource, binding.deviceId, "script-runner"),
7658
7660
  smoke: createSliceHandle(stateSource, binding.deviceId, "smoke"),
@@ -7741,6 +7743,7 @@ function createDeviceProxy(api, binding, opts) {
7741
7743
  ...bound("recording") ? { recording: recordingInterface } : {},
7742
7744
  ...bound("recording-onboard") ? { recordingOnboard: recordingOnboardInterface } : {},
7743
7745
  ...bound("recording-signal") ? { recordingSignal: recordingSignalInterface } : {},
7746
+ ...bound("running-state") ? { runningState: runningStateInterface } : {},
7744
7747
  ...bound("scene-monitor") ? { sceneMonitor: sceneMonitorInterface } : {},
7745
7748
  ...bound("script-runner") ? { scriptRunner: scriptRunnerInterface } : {},
7746
7749
  ...bound("smoke") ? { smoke: smokeInterface } : {},
@@ -7791,7 +7794,7 @@ function createDeviceProxy(api, binding, opts) {
7791
7794
  * can answer "may a rule actuate this?" without importing the schema barrel
7792
7795
  * (~144MB RSS per runner, D28).
7793
7796
  *
7794
- * Coverage: 90 device-scoped capabilities.
7797
+ * Coverage: 91 device-scoped capabilities.
7795
7798
  */
7796
7799
  var DEVICE_SCOPED_CAPS = new Set([
7797
7800
  "accessories",
@@ -7863,6 +7866,7 @@ var DEVICE_SCOPED_CAPS = new Set([
7863
7866
  "recording",
7864
7867
  "recording-onboard",
7865
7868
  "recording-signal",
7869
+ "running-state",
7866
7870
  "scene-monitor",
7867
7871
  "script-runner",
7868
7872
  "smoke",
@@ -1,4 +1,4 @@
1
- const require_event_category = require("./event-category-CXrwjC3e.js");
1
+ const require_event_category = require("./event-category-DG6Vir8Z.js");
2
2
  let zod = require("zod");
3
3
  //#region src/audio/audio-chunk-format.ts
4
4
  /**
@@ -504,7 +504,7 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries(WELL_KNOWN_TABS.map((t) => [t.id, t]
504
504
  * `hydrateSchema` to skip the `value` injection for structural-only fields.
505
505
  */
506
506
  function isValuelessField(field) {
507
- return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
507
+ return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
508
508
  }
509
509
  /**
510
510
  * Base collector: flatten a hydrated `ConfigUISchemaWithValues` into
@@ -7327,6 +7327,7 @@ function createDeviceProxy(api, binding, opts) {
7327
7327
  getStatus: (input) => dispatch("recording-onboard", "recordingOnboard", "getStatus", "query", input)
7328
7328
  };
7329
7329
  const recordingSignalInterface = { getStatus: (input) => dispatch("recording-signal", "recordingSignal", "getStatus", "query", input) };
7330
+ const runningStateInterface = { getStatus: (input) => dispatch("running-state", "runningState", "getStatus", "query", input) };
7330
7331
  const sceneMonitorInterface = {
7331
7332
  listScenes: (input) => dispatch("scene-monitor", "sceneMonitor", "listScenes", "query", input),
7332
7333
  listScenesBatch: (input) => dispatch("scene-monitor", "sceneMonitor", "listScenesBatch", "query", input),
@@ -7653,6 +7654,7 @@ function createDeviceProxy(api, binding, opts) {
7653
7654
  ptzAutotrack: createSliceHandle(stateSource, binding.deviceId, "ptz-autotrack"),
7654
7655
  recordingOnboard: createSliceHandle(stateSource, binding.deviceId, "recording-onboard"),
7655
7656
  recordingSignal: createSliceHandle(stateSource, binding.deviceId, "recording-signal"),
7657
+ runningState: createSliceHandle(stateSource, binding.deviceId, "running-state"),
7656
7658
  sceneMonitor: createSliceHandle(stateSource, binding.deviceId, "scene-monitor"),
7657
7659
  scriptRunner: createSliceHandle(stateSource, binding.deviceId, "script-runner"),
7658
7660
  smoke: createSliceHandle(stateSource, binding.deviceId, "smoke"),
@@ -7741,6 +7743,7 @@ function createDeviceProxy(api, binding, opts) {
7741
7743
  ...bound("recording") ? { recording: recordingInterface } : {},
7742
7744
  ...bound("recording-onboard") ? { recordingOnboard: recordingOnboardInterface } : {},
7743
7745
  ...bound("recording-signal") ? { recordingSignal: recordingSignalInterface } : {},
7746
+ ...bound("running-state") ? { runningState: runningStateInterface } : {},
7744
7747
  ...bound("scene-monitor") ? { sceneMonitor: sceneMonitorInterface } : {},
7745
7748
  ...bound("script-runner") ? { scriptRunner: scriptRunnerInterface } : {},
7746
7749
  ...bound("smoke") ? { smoke: smokeInterface } : {},
@@ -7791,7 +7794,7 @@ function createDeviceProxy(api, binding, opts) {
7791
7794
  * can answer "may a rule actuate this?" without importing the schema barrel
7792
7795
  * (~144MB RSS per runner, D28).
7793
7796
  *
7794
- * Coverage: 90 device-scoped capabilities.
7797
+ * Coverage: 91 device-scoped capabilities.
7795
7798
  */
7796
7799
  var DEVICE_SCOPED_CAPS = new Set([
7797
7800
  "accessories",
@@ -7863,6 +7866,7 @@ var DEVICE_SCOPED_CAPS = new Set([
7863
7866
  "recording",
7864
7867
  "recording-onboard",
7865
7868
  "recording-signal",
7869
+ "running-state",
7866
7870
  "scene-monitor",
7867
7871
  "script-runner",
7868
7872
  "smoke",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/types",
3
- "version": "1.2.405",
3
+ "version": "1.2.406",
4
4
  "description": "Shared types, interfaces, and model catalogs for the CamStack detection ecosystem",
5
5
  "keywords": [
6
6
  "camstack",