@camstack/types 1.2.538 → 1.2.540

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 (45) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/addon.js +44 -12
  3. package/dist/addon.mjs +44 -12
  4. package/dist/automation/step-runner.d.ts +2 -0
  5. package/dist/capabilities/capability-definition.d.ts +4 -0
  6. package/dist/capabilities/climate-control.cap.d.ts +18 -6
  7. package/dist/capabilities/cover.cap.d.ts +9 -3
  8. package/dist/capabilities/device-manager.cap.d.ts +14 -0
  9. package/dist/capabilities/fan-control.cap.d.ts +12 -4
  10. package/dist/capabilities/index.d.ts +3 -3
  11. package/dist/capabilities/lock-control.cap.d.ts +3 -1
  12. package/dist/capabilities/media-player.cap.d.ts +48 -16
  13. package/dist/capabilities/notification-output.cap.d.ts +40 -0
  14. package/dist/capabilities/notification-rules.cap.d.ts +252 -0
  15. package/dist/capabilities/osd-manager.cap.d.ts +40 -277
  16. package/dist/capabilities/valve.cap.d.ts +3 -1
  17. package/dist/client.js +41 -1
  18. package/dist/client.mjs +41 -1
  19. package/dist/{composed-stable-id-C3J6LxC9.js → composed-stable-id-BtaMj_W7.js} +4 -0
  20. package/dist/{composed-stable-id-DLcPInGv.mjs → composed-stable-id-jnvhwGoH.mjs} +4 -0
  21. package/dist/device/device-binding.d.ts +6 -0
  22. package/dist/device/device-feature-requirements.d.ts +137 -0
  23. package/dist/device/device-type.d.ts +5 -1
  24. package/dist/device/implemented-methods.d.ts +6 -0
  25. package/dist/expression/device-template.d.ts +31 -1
  26. package/dist/generated/addon-api.d.ts +7 -7
  27. package/dist/generated/collection-array-methods.d.ts +1 -1
  28. package/dist/generated/device-proxy.d.ts +1 -1
  29. package/dist/generated/method-access-map.d.ts +1 -1
  30. package/dist/{composition-BcVAbtBc.js → implemented-methods-C_iV6BiP.js} +17 -1
  31. package/dist/{composition-BFJq1Y88.mjs → implemented-methods-OitwyO1Y.mjs} +12 -2
  32. package/dist/index.d.ts +6 -2
  33. package/dist/index.js +733 -426
  34. package/dist/index.mjs +475 -185
  35. package/dist/interfaces/addon.d.ts +7 -0
  36. package/dist/interfaces/event-bus.d.ts +2 -0
  37. package/dist/migrations/api/migration-api.v1.d.ts +11 -0
  38. package/dist/migrations/api/migration-api.v1.schema.d.ts +25 -0
  39. package/dist/node.d.ts +1 -0
  40. package/dist/node.js +26 -25
  41. package/dist/node.mjs +3 -3
  42. package/dist/notification/notification-fields.d.ts +51 -0
  43. package/dist/{sleep-DgCXXFc3.js → sleep-DPMn-Sik.js} +2 -2
  44. package/dist/{sleep-VrfKAAGN.mjs → sleep-Dz1P6--1.mjs} +2 -2
  45. package/package.json +1 -1
@@ -0,0 +1,137 @@
1
+ import type { DeviceBindingEntry } from './device-binding.js';
2
+ import { DeviceFeature } from './device-type.js';
3
+ /**
4
+ * The ONE table that says what each {@link DeviceFeature} stands for (#459).
5
+ *
6
+ * A feature is present when the device has the cap bound AND the bound
7
+ * provider implements the listed methods. Nothing else decides it: a driver
8
+ * does not set a feature, the kernel derives it from the bindings
9
+ * (`getBindings`, D12/D13) and persists the result.
10
+ *
11
+ * `authority` is the migration switch of the rollout:
12
+ * - `derived`: the kernel's value is the only one; a driver's claim is ignored.
13
+ * - `reported`: the cap-backed definition exists (provenance shows it), but the
14
+ * driver's own claim still decides, because the providers have not yet
15
+ * dropped their stub methods (an "implemented" test would say yes to a
16
+ * method that throws). A family flips to `derived` in the commit that
17
+ * removes its stubs.
18
+ * A feature with no cap behind it is `kind: 'reported'` until it is dropped or
19
+ * becomes a cap (see the plan, section 5).
20
+ */
21
+ export type FeatureAuthority = 'derived' | 'reported';
22
+ export interface CapBackedFeature {
23
+ readonly kind: 'cap';
24
+ readonly cap: string;
25
+ /** Methods the bound provider must implement. Empty = the cap being bound is enough. */
26
+ readonly methods: readonly string[];
27
+ readonly authority: FeatureAuthority;
28
+ }
29
+ export interface ReportedFeature {
30
+ readonly kind: 'reported';
31
+ readonly reason: string;
32
+ }
33
+ export type FeatureRequirement = CapBackedFeature | ReportedFeature;
34
+ /** Exhaustive: a new `DeviceFeature` without a row does not compile. */
35
+ export declare const DEVICE_FEATURE_REQUIREMENTS: {
36
+ readonly "battery-operated": ReportedFeature;
37
+ readonly rebootable: CapBackedFeature;
38
+ readonly resyncable: ReportedFeature;
39
+ readonly "native-snapshot": ReportedFeature;
40
+ readonly "doorbell-button": CapBackedFeature;
41
+ readonly "two-way-audio": CapBackedFeature;
42
+ readonly "pan-tilt-zoom": CapBackedFeature;
43
+ readonly "ptz-autotrack": CapBackedFeature;
44
+ readonly "motion-trigger": CapBackedFeature;
45
+ readonly "timed-run": CapBackedFeature;
46
+ readonly switch: CapBackedFeature;
47
+ readonly "light-color-rgb": ReportedFeature;
48
+ readonly "light-color-hsv": ReportedFeature;
49
+ readonly "light-color-mired": ReportedFeature;
50
+ readonly "climate-dual-setpoint": CapBackedFeature;
51
+ readonly "climate-humidity": CapBackedFeature;
52
+ readonly "climate-fan-mode": CapBackedFeature;
53
+ readonly "climate-preset": CapBackedFeature;
54
+ readonly "climate-swing-vertical": CapBackedFeature;
55
+ readonly "climate-swing-horizontal": CapBackedFeature;
56
+ readonly "cover-positionable": CapBackedFeature;
57
+ readonly "cover-tilt": CapBackedFeature;
58
+ readonly "cover-stoppable": CapBackedFeature;
59
+ readonly "valve-positionable": CapBackedFeature;
60
+ readonly "fan-speed": CapBackedFeature;
61
+ readonly "fan-preset": CapBackedFeature;
62
+ readonly "fan-direction": CapBackedFeature;
63
+ readonly "fan-oscillating": CapBackedFeature;
64
+ readonly "lock-pin-required": ReportedFeature;
65
+ readonly "lock-open": CapBackedFeature;
66
+ readonly "media-player-seek": CapBackedFeature;
67
+ readonly "media-player-volume": CapBackedFeature;
68
+ readonly "media-player-mute": CapBackedFeature;
69
+ readonly "media-player-shuffle": CapBackedFeature;
70
+ readonly "media-player-repeat": CapBackedFeature;
71
+ readonly "media-player-select-source": CapBackedFeature;
72
+ readonly "media-player-play-media": CapBackedFeature;
73
+ readonly "media-player-next": CapBackedFeature;
74
+ readonly "media-player-previous": CapBackedFeature;
75
+ readonly "media-player-stop": CapBackedFeature;
76
+ readonly "media-player-volume-step": CapBackedFeature;
77
+ readonly "media-player-channel-step": CapBackedFeature;
78
+ readonly "media-player-power": CapBackedFeature;
79
+ readonly "alarm-pin-required": ReportedFeature;
80
+ readonly "presence-gps": ReportedFeature;
81
+ readonly "notifier-image": ReportedFeature;
82
+ readonly "notifier-priority": ReportedFeature;
83
+ readonly "notifier-data": ReportedFeature;
84
+ readonly "notifier-actions": ReportedFeature;
85
+ readonly "notifier-recipients": ReportedFeature;
86
+ readonly "script-variables": ReportedFeature;
87
+ readonly "automation-skip-condition": ReportedFeature;
88
+ readonly "vacuum-has-map": ReportedFeature;
89
+ readonly "vacuum-has-ai": ReportedFeature;
90
+ readonly "mower-has-map": ReportedFeature;
91
+ readonly "mower-has-targeted-mowing": ReportedFeature;
92
+ readonly navigation: CapBackedFeature;
93
+ readonly "network-link": CapBackedFeature;
94
+ };
95
+ /** Why a feature is absent: the cap is not bound, or the provider lacks methods. */
96
+ export type FeatureMissing = {
97
+ readonly reason: 'cap-not-bound';
98
+ readonly cap: string;
99
+ } | {
100
+ readonly reason: 'methods-not-implemented';
101
+ readonly cap: string;
102
+ readonly methods: readonly string[];
103
+ };
104
+ /** Where a present feature comes from. */
105
+ export interface FeatureSupplier {
106
+ readonly cap: string;
107
+ readonly providerAddonId: string;
108
+ readonly providerNodeId: string;
109
+ }
110
+ export interface FeatureDerivation {
111
+ readonly feature: DeviceFeature;
112
+ readonly authority: FeatureAuthority;
113
+ readonly present: boolean;
114
+ readonly supplier?: FeatureSupplier;
115
+ readonly missing?: FeatureMissing;
116
+ }
117
+ /**
118
+ * The provenance of every cap-backed feature, from one device's bindings. The
119
+ * feature set the kernel persists and the "why is it missing" the device page
120
+ * shows are the same computation.
121
+ */
122
+ export declare function deriveFeatureProvenance(entries: readonly DeviceBindingEntry[]): readonly FeatureDerivation[];
123
+ /** True when the kernel, not the driver, decides this feature. */
124
+ export declare function isKernelDerivedFeature(value: string): boolean;
125
+ /**
126
+ * The feature set to persist: the kernel's value for every `derived` feature,
127
+ * plus the driver's own claim for the rest (`reported`). Unknown strings are
128
+ * dropped.
129
+ */
130
+ export declare function settleDeviceFeatures(entries: readonly DeviceBindingEntry[], reportedByDriver: readonly string[]): DeviceFeature[];
131
+ /**
132
+ * What `registerDevice` stores. A driver re-registers after every probe with
133
+ * its own idea of the features; the `derived` ones are the kernel's, so a
134
+ * re-register keeps what the row already has for them. A first registration
135
+ * (no row yet) takes the driver's list as a bootstrap until the kernel derives.
136
+ */
137
+ export declare function reconcileReportedFeatures(stored: readonly string[] | undefined, reported: readonly string[]): string[];
@@ -273,7 +273,11 @@ export declare enum DeviceFeature {
273
273
  MowerHasMap = "mower-has-map",
274
274
  /** Robot mower exposes targeted mowing (all-area / zones / edges /
275
275
  * spots) — gates the Mow action + map selectors. */
276
- MowerHasTargetedMowing = "mower-has-targeted-mowing"
276
+ MowerHasTargetedMowing = "mower-has-targeted-mowing",
277
+ /** The device has a drive/navigation surface (`navigation` cap): a robot camera. */
278
+ Navigation = "navigation",
279
+ /** The device has a network-link reading (`network-link` cap). */
280
+ NetworkLink = "network-link"
277
281
  }
278
282
  /**
279
283
  * The features a device carries because a capability is bound on it: a bound cap
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Which of a cap's methods a registered provider object serves. Sent with the
3
+ * registration so the hub can tell "cap bound" from "cap bound AND this method
4
+ * implemented". A method is implemented when the object has it as a function.
5
+ */
6
+ export declare function implementedMethodsOf(methodNames: readonly string[], provider: object): string[];
@@ -22,8 +22,38 @@ export declare const DEVICE_TEMPLATE_MAX_OUTPUT = 4096;
22
22
  /** What an unknown or unavailable value renders as. */
23
23
  export declare const DEVICE_TEMPLATE_UNAVAILABLE = "\u2014";
24
24
  export declare const DeviceTemplateSchema: z.ZodString;
25
+ /**
26
+ * The clock, as a template value: `{{ now | time('HH:mm') }}` (epoch ms; the
27
+ * zone is the server's). Reserved: no device alias may be spelled `now`.
28
+ */
29
+ export declare const DEVICE_TEMPLATE_NOW_ALIAS = "now";
30
+ /**
31
+ * The device a caller renders FOR, as a template name: `{{ camera.temperature }}`.
32
+ * It resolves only when the call names `thisDevice`, so a template stays copyable
33
+ * between devices. It shadows a device whose own alias is `camera`.
34
+ */
35
+ export declare const DEVICE_TEMPLATE_THIS_ALIAS = "camera";
36
+ /** One value a caller hands the renderer for `thisDevice`. */
37
+ export declare const DeviceTemplateValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>;
38
+ /**
39
+ * The device a render is FOR (`camera` in the text) and the values the caller
40
+ * knows about it that no capability carries, for example `lastPerson` and
41
+ * `lastPlate`. `values` read as `camera.<name>`; a name a capability also carries
42
+ * is `ambiguous` and is written `camera.values.<name>`.
43
+ */
44
+ export declare const DeviceTemplateThisDeviceSchema: z.ZodObject<{
45
+ deviceId: z.ZodNumber;
46
+ values: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
47
+ }, z.core.$strip>;
48
+ export type DeviceTemplateThisDevice = z.infer<typeof DeviceTemplateThisDeviceSchema>;
49
+ /** The synthetic slice `thisDevice.values` is exposed under. */
50
+ export declare const DEVICE_TEMPLATE_VALUES_CAP = "values";
25
51
  /** The filters a template may use. Anything else is refused at parse time. */
26
- export declare const DEVICE_TEMPLATE_FILTERS: readonly ['unit', 'round', 'default', 'since', 'ago', 'format', 'upper', 'lower', 'title', 'capitalize', 'trim', 'abs', 'int', 'float', 'length', 'd', 'join', 'replace', 'first', 'last', 'sort', 'reverse', 'sum', 'string', 'list', 'truncate'];
52
+ export declare const DEVICE_TEMPLATE_FILTERS: readonly ['unit', 'round', 'trunc',
53
+ /** `{{ x | onoff }}`: `true` reads ON, `false` OFF, anything else is left as it is. */
54
+ 'onoff', 'default', 'since', 'ago', 'format', 'upper', 'lower', 'title', 'capitalize', 'trim', 'abs', 'int', 'float', 'length', 'd', 'join', 'replace', 'first', 'last', 'sort', 'reverse', 'sum', 'string', 'list', 'truncate',
55
+ /** `{{ now | time('HH:mm') }}`: an epoch timestamp as clock text in the server's zone. */
56
+ 'time'];
27
57
  export type DeviceTemplateFilter = (typeof DEVICE_TEMPLATE_FILTERS)[number];
28
58
  /** A device-state reference found in a template: the alias and the literal path after it. */
29
59
  export interface DeviceTemplateRef {
@@ -6624,13 +6624,6 @@ export type AppRouter = TrpcCoreRouter<{
6624
6624
  output: z.infer<typeof osdManagerCapability.methods.getDeviceOsd.output>;
6625
6625
  meta: object;
6626
6626
  }>;
6627
- getSourceCatalog: TRPCQueryProcedure<{
6628
- input: {
6629
- [x: string]: unknown;
6630
- } & z.input<typeof osdManagerCapability.methods.getSourceCatalog.input>;
6631
- output: z.infer<typeof osdManagerCapability.methods.getSourceCatalog.output>;
6632
- meta: object;
6633
- }>;
6634
6627
  getConditionSupport: TRPCQueryProcedure<{
6635
6628
  input: {
6636
6629
  [x: string]: unknown;
@@ -6673,6 +6666,13 @@ export type AppRouter = TrpcCoreRouter<{
6673
6666
  output: z.infer<typeof osdManagerCapability.methods.previewSlot.output>;
6674
6667
  meta: object;
6675
6668
  }>;
6669
+ previewTemplate: TRPCMutationProcedure<{
6670
+ input: {
6671
+ [x: string]: unknown;
6672
+ } & z.input<typeof osdManagerCapability.methods.previewTemplate.input>;
6673
+ output: z.infer<typeof osdManagerCapability.methods.previewTemplate.output>;
6674
+ meta: object;
6675
+ }>;
6676
6676
  renderDevice: TRPCMutationProcedure<{
6677
6677
  input: {
6678
6678
  [x: string]: unknown;
@@ -21,7 +21,7 @@ export declare function isCollectionArrayMethodName(capName: string, method: str
21
21
  * Per capability, the methods declared `optionalMethod` — the ones whose
22
22
  * ABSENCE on a provider is a fact about that provider, not a bug.
23
23
  *
24
- * Coverage: 4 caps, 12 methods.
24
+ * Coverage: 10 caps, 43 methods.
25
25
  */
26
26
  export declare const PROVIDER_OPTIONAL_METHODS: Readonly<Record<string, readonly string[]>>;
27
27
  /**
@@ -351,7 +351,7 @@ export interface DeviceProxy {
351
351
  readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'listRecentFaces' | 'getFaceByTrack'>;
352
352
  readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
353
353
  readonly notificationRules: Pick<InferDeviceProxyCap<typeof notificationRulesCapability>, 'setDeviceMuted'>;
354
- readonly osdManager: Pick<InferDeviceProxyCap<typeof osdManagerCapability>, 'getDeviceOsd' | 'getSourceCatalog' | 'setSlotBinding' | 'clearSlotBinding' | 'setSlotCameraEnabled' | 'previewSlot' | 'renderDevice'>;
354
+ readonly osdManager: Pick<InferDeviceProxyCap<typeof osdManagerCapability>, 'getDeviceOsd' | 'setSlotBinding' | 'clearSlotBinding' | 'setSlotCameraEnabled' | 'previewSlot' | 'previewTemplate' | 'renderDevice'>;
355
355
  readonly pipelineExecutor: Pick<InferDeviceProxyCap<typeof pipelineExecutorCapability>, 'runPipeline' | 'runPipelineBatch'>;
356
356
  readonly pipelineOrchestrator: Pick<InferDeviceProxyCap<typeof pipelineOrchestratorCapability>, 'assignPipeline' | 'unassignPipeline' | 'setPipelineDevicePin' | 'getPipelineDevicePin' | 'getPipelineAssignment' | 'getCameraMetrics' | 'assignAudio' | 'unassignAudio' | 'getAudioAssignment' | 'getCameraSettings' | 'setCameraStepToggle' | 'getCameraDetectionSource' | 'setCameraDetectionSource' | 'setCameraStepSettings' | 'resolvePipeline' | 'getCameraSwitches' | 'setCameraSwitch' | 'getCameraStatus' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
357
357
  readonly pipelineRunner: Pick<InferDeviceProxyCap<typeof pipelineRunnerCapability>, 'detachCamera' | 'getCameraMetrics' | 'requestOccupancyBurst' | 'runDetailSubtree' | 'parkTrackFrame' | 'getParkedTrackFrame' | 'releaseParkedTrackFrames'>;
@@ -6,7 +6,7 @@
6
6
  * scope+access check inside `protectedProcedure` (see
7
7
  * `server/backend/src/api/trpc/trpc.middleware.ts`).
8
8
  *
9
- * Coverage: 1487 method paths across 205 capabilities.
9
+ * Coverage: 1482 method paths across 205 capabilities.
10
10
  */
11
11
  import type { MethodRole } from '../auth/viewer-access.js';
12
12
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
@@ -1,4 +1,4 @@
1
- const require_composed_stable_id = require("./composed-stable-id-C3J6LxC9.js");
1
+ const require_composed_stable_id = require("./composed-stable-id-BtaMj_W7.js");
2
2
  let zod = require("zod");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/ffmpeg/invocation.ts
@@ -3399,6 +3399,16 @@ function featureSources(feature) {
3399
3399
  return featureFieldEntries(feature).map((e) => e.source);
3400
3400
  }
3401
3401
  //#endregion
3402
+ //#region src/device/implemented-methods.ts
3403
+ /**
3404
+ * Which of a cap's methods a registered provider object serves. Sent with the
3405
+ * registration so the hub can tell "cap bound" from "cap bound AND this method
3406
+ * implemented". A method is implemented when the object has it as a function.
3407
+ */
3408
+ function implementedMethodsOf(methodNames, provider) {
3409
+ return methodNames.filter((name) => typeof Reflect.get(provider, name) === "function");
3410
+ }
3411
+ //#endregion
3402
3412
  Object.defineProperty(exports, "ACTIVE_CRITERIA", {
3403
3413
  enumerable: true,
3404
3414
  get: function() {
@@ -4185,6 +4195,12 @@ Object.defineProperty(exports, "historyRetentionFromSettings", {
4185
4195
  return historyRetentionFromSettings;
4186
4196
  }
4187
4197
  });
4198
+ Object.defineProperty(exports, "implementedMethodsOf", {
4199
+ enumerable: true,
4200
+ get: function() {
4201
+ return implementedMethodsOf;
4202
+ }
4203
+ });
4188
4204
  Object.defineProperty(exports, "integralCadenceMs", {
4189
4205
  enumerable: true,
4190
4206
  get: function() {
@@ -1,4 +1,4 @@
1
- import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-DLcPInGv.mjs";
1
+ import { a as DeviceType, i as DeviceRole, t as COMPOSED_DEVICE_STABLE_ID_PREFIX } from "./composed-stable-id-jnvhwGoH.mjs";
2
2
  import { z } from "zod";
3
3
  import { createHash } from "node:crypto";
4
4
  //#region src/ffmpeg/invocation.ts
@@ -3399,4 +3399,14 @@ function featureSources(feature) {
3399
3399
  return featureFieldEntries(feature).map((e) => e.source);
3400
3400
  }
3401
3401
  //#endregion
3402
- export { GROUP_TEMPLATE_IDS as $, compileExpression as $t, MAX_COMPOSITION_ITEMS as A, FFMPEG_PATH_ENV as An, nextLocalMidnight as At, fieldReads as B, audioPlanFromEncodeProfile as Bn, evaluateStatistic as Bt, CompositionSchema as C, SOURCE_CAP_CHANGED_AT_FIELD as Cn, RESET_PERIODS as Ct, MAX_COMPOSITION_CODE_LENGTH as D, isSourceCap as Dn, historyRetentionFromSettings as Dt, FORWARD_INPUT_KEY as E, evaluateSensorLevelEdge as En, StatisticWindowSchema as Et, compositionReadKey as F, getFfmpegDownloadUrl as Fn, rollingDurationMs as Ft, ActiveCriterionSchema as G, invocationFromEncodeProfile as Gn, cloneStatefulExpressionMemory as Gt, ACTIVE_CRITERIA as H, buildFfmpegArgs as Hn, KWH_PER_WATT_MS as Ht, compositionSliceKey as I, canonicalHash as In, statisticCadenceMs as It, BINARY_AGGREGATES as J, pickVideoEncoder as Jn, evaluateStatefulExpressionCall as Jt, AggregateReducerSchema as K, isSoftwareDecode as Kn, createStatefulExpressionMemory as Kt, compositionSourceKey as L, Fmp4BoxSplitter as Ln, SERIES_KINDS as Lt, composedDeviceStableId as M, ffmpegBinaryName as Mn, openStatistic as Mt, compositionFeatureEnabled as N, FFMPEG_RELEASE as Nn, planResetTier as Nt, MAX_COMPOSITION_FEATURES as O, sliceActiveValue as On, integralCadenceMs as Ot, compositionItemFieldPath as P, getFfmpegArtifact as Pn, planStatisticTier as Pt, ExpressionHelperSpecSchema as Q, evaluateAst as Qt, featureFieldEntries as R, AUDIO_PRESETS as Rn, STATISTIC_STATS as Rt, CompositionPassthroughFeatureSchema as S, SOURCE_CAP_ACTIVE_FIELD as Sn, MIN_CUSTOM_MINUTES as St, CompositionTargetSchema as T, evaluateSensorEdge as Tn, RollingWindowSchema as Tt, AGGREGATE_REDUCERS as U, buildInputArgs as Un, wattMillisecondsToKwh as Ut, isForwardInputRef as V, buildAudioArgs as Vn, integrateReading as Vt, ARITHMETIC_OPS as W, buildVideoArgs as Wn, EXPRESSION_INJECTED_NOW as Wt, DerivativeHelperSpecSchema as X, validateExpressionSource as Xt, DERIVATIVE_UNITS as Y, resolveStreamMaps as Yn, toExpressionValue as Yt, EXPRESSION_OUTPUTS as Z, createExpressionScope as Zt, CompositionForwardCommandSchema as _, isStatefulBuiltin as _n, HISTORY_FAST_MS as _t, CompositionAggregateSourceSchema as a, MAX_EXPRESSION_AST_NODES as an, IntegralHelperSpecSchema as at, CompositionLiteralBindingSchema as b, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as bn, HOUR_MS as bt, CompositionCommandTargetSchema as c, MAX_EXPRESSION_EVAL_STEPS as cn, StatisticHelperSpecSchema as ct, CompositionExtensionCommandSchema as d, EXPRESSION_BUILTINS as dn, isHistoryHelper as dt, compileExpressionSafe as en, GroupHelperSpecSchema as et, CompositionFeatureSchema as f, EXPRESSION_BUILTIN_NAMES as fn, CompositionSourceRefSchema as ft, CompositionForwardArgSchema as g, evaluateRose as gn, DEFAULT_HISTORY_RETENTION as gt, CompositionFieldsFeatureSchema as h, evaluateDwell as hn, DAY_MS as ht, CUSTOMIZATION_BLOCK_NAME_PREFIX as i, EXPRESSION_IDENTIFIER_RE as in, INTEGRAL_OUTPUTS as it, composedDeviceRef as j, chooseFfmpegBinary as jn, openReset as jt, MAX_COMPOSITION_FIELDS_PER_FEATURE as k, sliceChangedAt as kn, maxDurationMs as kt, CompositionExistingTargetSchema as l, MAX_EXPRESSION_SOURCE_LENGTH as ln, ThresholdHelperSpecSchema as lt, CompositionFieldSourceSchema as m, evaluateCount as mn, CalendarWindowSchema as mt, COMPOSITION_ITEM_ARRAY_PATH as n, tokenize as nn, HelperMemberSchema as nt, CompositionBindingSchema as o, MAX_EXPRESSION_BINDINGS as on, MAX_HELPER_MEMBERS as ot, CompositionFieldReadSchema as p, disarmRoseMemory as pn, CALENDAR_PERIODS as pt, ArithmeticHelperSpecSchema as q, logBannerArgs as qn, evaluateExpressionSource as qt, COMPOSITION_ITEM_KEY_RE as r, EXPRESSION_COMPILE_CACHE_CAPACITY as rn, HelperSpecSchema as rt, CompositionCodeSourceSchema as s, MAX_EXPRESSION_CALL_ARGS as sn, NUMERIC_AGGREGATES as st, COMPOSER_ADDON_ID as t, parseExpression as tn, GroupTemplateIdSchema as tt, CompositionExpressionSourceSchema as u, RESERVED_BINDING_NAMES as un, helperMembers as ut, CompositionFromSourceSchema as v, ExpressionEvalError as vn, HISTORY_SLOW_MS as vt, CompositionSeriesSourceSchema as w, SOURCE_DEVICE_TYPES as wn, ROLLING_SPANS as wt, CompositionNewTargetSchema as x, SOURCE_CAPS as xn, MINUTE_MS as xt, CompositionItemEntrySchema as y, ExpressionParseError as yn, HISTORY_TIERS as yt, featureSources as z, RESTREAM_INPUT_PROBE as zn, evaluateDerivative as zt };
3402
+ //#region src/device/implemented-methods.ts
3403
+ /**
3404
+ * Which of a cap's methods a registered provider object serves. Sent with the
3405
+ * registration so the hub can tell "cap bound" from "cap bound AND this method
3406
+ * implemented". A method is implemented when the object has it as a function.
3407
+ */
3408
+ function implementedMethodsOf(methodNames, provider) {
3409
+ return methodNames.filter((name) => typeof Reflect.get(provider, name) === "function");
3410
+ }
3411
+ //#endregion
3412
+ export { ExpressionHelperSpecSchema as $, evaluateAst as $t, MAX_COMPOSITION_FIELDS_PER_FEATURE as A, sliceChangedAt as An, maxDurationMs as At, featureSources as B, RESTREAM_INPUT_PROBE as Bn, evaluateDerivative as Bt, CompositionPassthroughFeatureSchema as C, SOURCE_CAP_ACTIVE_FIELD as Cn, MIN_CUSTOM_MINUTES as Ct, FORWARD_INPUT_KEY as D, evaluateSensorLevelEdge as Dn, StatisticWindowSchema as Dt, CompositionTargetSchema as E, evaluateSensorEdge as En, RollingWindowSchema as Et, compositionItemFieldPath as F, getFfmpegArtifact as Fn, planStatisticTier as Ft, ARITHMETIC_OPS as G, buildVideoArgs as Gn, EXPRESSION_INJECTED_NOW as Gt, isForwardInputRef as H, buildAudioArgs as Hn, integrateReading as Ht, compositionReadKey as I, getFfmpegDownloadUrl as In, rollingDurationMs as It, ArithmeticHelperSpecSchema as J, logBannerArgs as Jn, evaluateExpressionSource as Jt, ActiveCriterionSchema as K, invocationFromEncodeProfile as Kn, cloneStatefulExpressionMemory as Kt, compositionSliceKey as L, canonicalHash as Ln, statisticCadenceMs as Lt, composedDeviceRef as M, chooseFfmpegBinary as Mn, openReset as Mt, composedDeviceStableId as N, ffmpegBinaryName as Nn, openStatistic as Nt, MAX_COMPOSITION_CODE_LENGTH as O, isSourceCap as On, historyRetentionFromSettings as Ot, compositionFeatureEnabled as P, FFMPEG_RELEASE as Pn, planResetTier as Pt, EXPRESSION_OUTPUTS as Q, createExpressionScope as Qt, compositionSourceKey as R, Fmp4BoxSplitter as Rn, SERIES_KINDS as Rt, CompositionNewTargetSchema as S, SOURCE_CAPS as Sn, MINUTE_MS as St, CompositionSeriesSourceSchema as T, SOURCE_DEVICE_TYPES as Tn, ROLLING_SPANS as Tt, ACTIVE_CRITERIA as U, buildFfmpegArgs as Un, KWH_PER_WATT_MS as Ut, fieldReads as V, audioPlanFromEncodeProfile as Vn, evaluateStatistic as Vt, AGGREGATE_REDUCERS as W, buildInputArgs as Wn, wattMillisecondsToKwh as Wt, DERIVATIVE_UNITS as X, resolveStreamMaps as Xn, toExpressionValue as Xt, BINARY_AGGREGATES as Y, pickVideoEncoder as Yn, evaluateStatefulExpressionCall as Yt, DerivativeHelperSpecSchema as Z, validateExpressionSource as Zt, CompositionForwardArgSchema as _, evaluateRose as _n, DEFAULT_HISTORY_RETENTION as _t, CUSTOMIZATION_BLOCK_NAME_PREFIX as a, EXPRESSION_IDENTIFIER_RE as an, INTEGRAL_OUTPUTS as at, CompositionItemEntrySchema as b, ExpressionParseError as bn, HISTORY_TIERS as bt, CompositionCodeSourceSchema as c, MAX_EXPRESSION_CALL_ARGS as cn, NUMERIC_AGGREGATES as ct, CompositionExpressionSourceSchema as d, RESERVED_BINDING_NAMES as dn, helperMembers as dt, compileExpression as en, GROUP_TEMPLATE_IDS as et, CompositionExtensionCommandSchema as f, EXPRESSION_BUILTINS as fn, isHistoryHelper as ft, CompositionFieldsFeatureSchema as g, evaluateDwell as gn, DAY_MS as gt, CompositionFieldSourceSchema as h, evaluateCount as hn, CalendarWindowSchema as ht, COMPOSITION_ITEM_KEY_RE as i, EXPRESSION_COMPILE_CACHE_CAPACITY as in, HelperSpecSchema as it, MAX_COMPOSITION_ITEMS as j, FFMPEG_PATH_ENV as jn, nextLocalMidnight as jt, MAX_COMPOSITION_FEATURES as k, sliceActiveValue as kn, integralCadenceMs as kt, CompositionCommandTargetSchema as l, MAX_EXPRESSION_EVAL_STEPS as ln, StatisticHelperSpecSchema as lt, CompositionFieldReadSchema as m, disarmRoseMemory as mn, CALENDAR_PERIODS as mt, COMPOSER_ADDON_ID as n, parseExpression as nn, GroupTemplateIdSchema as nt, CompositionAggregateSourceSchema as o, MAX_EXPRESSION_AST_NODES as on, IntegralHelperSpecSchema as ot, CompositionFeatureSchema as p, EXPRESSION_BUILTIN_NAMES as pn, CompositionSourceRefSchema as pt, AggregateReducerSchema as q, isSoftwareDecode as qn, createStatefulExpressionMemory as qt, COMPOSITION_ITEM_ARRAY_PATH as r, tokenize as rn, HelperMemberSchema as rt, CompositionBindingSchema as s, MAX_EXPRESSION_BINDINGS as sn, MAX_HELPER_MEMBERS as st, implementedMethodsOf as t, compileExpressionSafe as tn, GroupHelperSpecSchema as tt, CompositionExistingTargetSchema as u, MAX_EXPRESSION_SOURCE_LENGTH as un, ThresholdHelperSpecSchema as ut, CompositionForwardCommandSchema as v, isStatefulBuiltin as vn, HISTORY_FAST_MS as vt, CompositionSchema as w, SOURCE_CAP_CHANGED_AT_FIELD as wn, RESET_PERIODS as wt, CompositionLiteralBindingSchema as x, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as xn, HOUR_MS as xt, CompositionFromSourceSchema as y, ExpressionEvalError as yn, HISTORY_SLOW_MS as yt, featureFieldEntries as z, AUDIO_PRESETS as zn, STATISTIC_STATS as zt };
package/dist/index.d.ts CHANGED
@@ -271,6 +271,9 @@ export { DeviceRuntimeState } from './device/device-runtime-state.js';
271
271
  export type { SliceEventBus, SliceHandle, SliceHandleApi, SliceHandleSource, } from './device/device-state-handle.js';
272
272
  export { createEventBusSliceSource, createLazyTrpcSource, createMirrorSource, createSliceHandle, } from './device/device-state-handle.js';
273
273
  export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType, featuresOfBoundCaps, } from './device/device-type.js';
274
+ export type { CapBackedFeature, FeatureAuthority, FeatureDerivation, FeatureMissing, FeatureRequirement, FeatureSupplier, ReportedFeature, } from './device/device-feature-requirements.js';
275
+ export { DEVICE_FEATURE_REQUIREMENTS, deriveFeatureProvenance, isKernelDerivedFeature, reconcileReportedFeatures, settleDeviceFeatures, } from './device/device-feature-requirements.js';
276
+ export { implementedMethodsOf } from './device/implemented-methods.js';
274
277
  export { APPLIANCE_EXPORT, type ApplianceExportDecision, type ApplianceExportEcosystem, type ApplianceExported, type ApplianceNotExported, type PlugApplianceType, PLUG_APPLIANCE_TYPES, applianceExport, isPlugApplianceType, } from './device/appliance-export.js';
275
278
  export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './device/features.js';
276
279
  export type { IconCategoryId, IconEntry, IconHit, IconKey, } from './device/icon-catalog.js';
@@ -296,8 +299,8 @@ export { collectZodSecretPaths, isZodSecret, SECRET_META } from './device/zod-se
296
299
  export { EventCategory, isOwnerOnlyEventCategory, OWNER_ONLY_EVENT_CATEGORIES, publicEventCategories, } from './enums/event-category.js';
297
300
  export * from './enums/index.js';
298
301
  export type { CompileResult, EvaluateExpressionSourceResult, ExpressionBinaryOperator, ExpressionBindingSource, ExpressionBuiltin, ExpressionEvalHooks, ExpressionEvalOptions, ExpressionFieldBinding, ExpressionGlobalBinding, ExpressionLiteralBinding, ExpressionLogicalOperator, ExpressionNode, ExpressionNodePath, ExpressionSource, ExpressionSourceInput, ExpressionUnaryOperator, ExpressionValue, CountCallState, RoseCallState, StatefulCallState, StatefulCallInvocation, StatefulExpressionEnvironment, StatefulExpressionMemory, StatefulExpressionBuiltin, Keyword, ParsedExpression, Punctuator, Token, } from './expression/index.js';
299
- export { DEVICE_TEMPLATE_BUDGET_MS, DEVICE_TEMPLATE_FILTERS, DEVICE_TEMPLATE_MAX_LENGTH, DEVICE_TEMPLATE_MAX_OUTPUT, DEVICE_TEMPLATE_UNAVAILABLE, DEVICE_TEMPLATE_REFUSAL_REASONS, DEVICE_TEMPLATE_TRACE_REASONS, DeviceTemplateRefusalSchema, DeviceTemplateRenderSchema, DeviceTemplateSchema, DeviceTemplateTraceEntrySchema, resolveTemplateRef, templateCapKey, } from './expression/device-template.js';
300
- export type { DeviceTemplateFilter, DeviceTemplateRef, DeviceTemplateRefusal, DeviceTemplateRefusalReason, DeviceTemplateRender, DeviceTemplateTraceEntry, DeviceTemplateTraceReason, DeviceTemplateView, ResolvedTemplateRef, } from './expression/device-template.js';
302
+ export { DEVICE_TEMPLATE_BUDGET_MS, DEVICE_TEMPLATE_FILTERS, DEVICE_TEMPLATE_MAX_LENGTH, DEVICE_TEMPLATE_MAX_OUTPUT, DEVICE_TEMPLATE_NOW_ALIAS, DEVICE_TEMPLATE_THIS_ALIAS, DEVICE_TEMPLATE_VALUES_CAP, DEVICE_TEMPLATE_UNAVAILABLE, DEVICE_TEMPLATE_REFUSAL_REASONS, DEVICE_TEMPLATE_TRACE_REASONS, DeviceTemplateRefusalSchema, DeviceTemplateRenderSchema, DeviceTemplateSchema, DeviceTemplateThisDeviceSchema, DeviceTemplateTraceEntrySchema, DeviceTemplateValueSchema, resolveTemplateRef, templateCapKey, } from './expression/device-template.js';
303
+ export type { DeviceTemplateFilter, DeviceTemplateRef, DeviceTemplateRefusal, DeviceTemplateRefusalReason, DeviceTemplateRender, DeviceTemplateThisDevice, DeviceTemplateTraceEntry, DeviceTemplateTraceReason, DeviceTemplateView, ResolvedTemplateRef, } from './expression/device-template.js';
301
304
  export { compileExpression, compileExpressionSafe, cloneStatefulExpressionMemory, createExpressionScope, createStatefulExpressionMemory, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, ExpressionBindingSourceSchema, ExpressionEvalError, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionParseError, ExpressionSourceSchema, evaluateAst, evaluateCount, disarmRoseMemory, evaluateExpressionSource, evaluateRose, evaluateStatefulExpressionCall, isStatefulBuiltin, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, parseExpression, RESERVED_BINDING_NAMES, toExpressionValue, tokenize, validateExpressionSource, } from './expression/index.js';
302
305
  export type { AddonApi, AppRouter } from './generated/addon-api.js';
303
306
  export type { CapNameWithStatus, CapStatusTypeMap } from './generated/cap-status-types.js';
@@ -350,6 +353,7 @@ export { isAudioClassName, isBaseConditionKey, knownValues, NC_BASE_CONDITION_KE
350
353
  export { type PreparedAction, type PreparedAttachment, type PreparedNotification, prepareNotification, type ResolvedLevel, } from './notification/degrade-engine.js';
351
354
  export { isRootRelativeUrl, type PublicEndpointReader, type PublicEndpointReading, type PublicEndpointSource, publicEndpointReaderFrom, type ResolveAttachmentUrlsDeps, resolveAttachmentUrls, } from './notification/attachment-url.js';
352
355
  export { deliveryParamsDeclaredBy, resolveDeliveryParams } from './notification/delivery-params.js';
356
+ export { deliverableFields, fieldSupportForTargets, NOTIFICATION_FIELDS, type NotificationFieldSupport, type NotificationFieldTarget, sanitizeTargetOverride, } from './notification/notification-fields.js';
353
357
  export { htmlToText, markdownToHtmlLite, markdownToText, type NotificationFormat as NotificationBodyFormat, resolveFormat, textToHtml, transcodeBody, } from './notification/format-transcode.js';
354
358
  export { conditionExclusionReason, conditionVisibleForKind, defaultDeliveryForSection, droppedConditionsForKind, isAudioRule, isOccupancyRule, isSystemDelivery, isSystemRuleKind, kindsForDiscriminator, NC_AUDIO_SEED, NC_CAMERA_SCOPE_CAP_NAME, NC_OCCUPANCY_DEFAULTS, NC_RULE_EDITOR_SECTION_ORDER, NC_RULE_KIND_SPECS, NC_RULE_SECTIONS, NC_SYSTEM_DELIVERY, NC_SYSTEM_RULE_KINDS, type NcDroppedCondition, type NcKindVisibilitySubject, type NcRuleEditorSection, type NcRuleEditorSectionKey, type NcRuleKind, type NcRuleKindSpec, type NcRuleOwningSectionKey, type NcRuleSection, type NcRuleSectionKey, type NcRuleConditionsSubject, type NcRuleSectionSubject, type NcRuleSeed, parseRuleSection, ruleDeviceCompatCapNames, ruleDeviceCompatCapQueries, ruleEditorSectionsForKind, ruleGroupingApplies, ruleKindOf, ruleKindSpec, ruleMatchesSection, ruleSection, ruleSectionOf, ruleSeedForSection, systemFamilyOfKind, systemRuleKindOf, } from './notification/rule-kinds.js';
355
359
  export { imageModesForKind, legacyImageMode, NC_MEDIA_IMAGE_MODES, type NcMediaRuleSubject, ncMediaPolicyError, normalizeNcMediaPolicy, resolveNcMediaImage, ruleTriggerZoneIds, subjectHasPath, } from './notification/media-image.js';