@camstack/types 1.2.46 → 1.2.47

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 (36) hide show
  1. package/dist/addon.js +4 -3
  2. package/dist/addon.mjs +4 -3
  3. package/dist/{fmp4-box-splitter-B53u9-Nu.mjs → canonical-hash-rO1sRmEK.mjs} +34 -34
  4. package/dist/capabilities/core-blocks.cap.d.ts +52 -0
  5. package/dist/capabilities/device-manager.cap.d.ts +11 -427
  6. package/dist/capabilities/index.d.ts +2 -2
  7. package/dist/capabilities/motion-detection.cap.d.ts +6 -1
  8. package/dist/capabilities/notification-rules.cap.d.ts +24 -24
  9. package/dist/capabilities/oauth-integration.cap.d.ts +4 -0
  10. package/dist/capabilities/osd-manager.cap.d.ts +12 -12
  11. package/dist/capabilities/pipeline-analytics.cap.d.ts +7 -1
  12. package/dist/capabilities/sso-bridge.cap.d.ts +3 -0
  13. package/dist/capabilities/stream-broker.cap.d.ts +1 -0
  14. package/dist/capabilities/user-management.cap.d.ts +3 -1
  15. package/dist/capabilities/videoclips.cap.d.ts +5 -0
  16. package/dist/device/declared-device.d.ts +197 -0
  17. package/dist/device/device-binding.d.ts +15 -9
  18. package/dist/device/device-management.d.ts +1 -83
  19. package/dist/device/index.d.ts +20 -19
  20. package/dist/expression/binding-source.d.ts +85 -0
  21. package/dist/expression/{link-expression.d.ts → expression-source.d.ts} +22 -13
  22. package/dist/expression/index.d.ts +17 -14
  23. package/dist/expression/limits.d.ts +1 -1
  24. package/dist/generated/addon-api.d.ts +7 -7
  25. package/dist/generated/device-proxy.d.ts +1 -1
  26. package/dist/generated/system-proxy.d.ts +1 -1
  27. package/dist/index.d.ts +9 -8
  28. package/dist/index.js +2322 -2057
  29. package/dist/index.mjs +2297 -2043
  30. package/dist/node.js +7 -7
  31. package/dist/node.mjs +1 -1
  32. package/dist/{sleep-BbYwFLG6.mjs → sleep-7WqNZVcL.mjs} +0 -1
  33. package/dist/{sleep-CyN9nHr_.js → sleep-ocMLM2o5.js} +0 -1
  34. package/package.json +1 -1
  35. package/dist/device/device-link-transform.d.ts +0 -5
  36. package/dist/{fmp4-box-splitter-BkWH7O3L.js → canonical-hash-DNV8S5ET.js} +33 -33
@@ -95,82 +95,6 @@ export interface ChildLayoutEntry {
95
95
  readonly collapsed?: boolean;
96
96
  }
97
97
  export type ChildLayout = readonly ChildLayoutEntry[];
98
- /** Field source: copy one field of a sibling accessory's cap status.
99
- * Addressed by the source's re-sync-stable accessory `stableIdSuffix`
100
- * (`sourceKey`) — NOT a raw numeric id — so the link survives a re-sync. The
101
- * source must be a sibling accessory under the SAME parent container as the
102
- * target device; resolution is `${parentStableId}-${sourceKey}`. For a source
103
- * anywhere else in the cluster use `DeviceLinkGlobalSource`. */
104
- export interface DeviceLinkFieldSource {
105
- readonly kind?: 'field';
106
- readonly sourceKey: string;
107
- readonly cap: string;
108
- readonly fieldPath: string;
109
- }
110
- /** Literal source: a per-device constant (e.g. `battery.binary = true`,
111
- * a consumable item's `label`/`resettable`). No sibling is read. */
112
- export interface DeviceLinkLiteralSource {
113
- readonly kind: 'literal';
114
- readonly value: string | number | boolean | null;
115
- }
116
- /** Global source (P2e): copy one field of ANY device's cap status, regardless
117
- * of parent container. Addressed by the source device's FULL `stableId` —
118
- * chosen over the numeric id because a re-sync (`resetToSource`) REALLOCATES
119
- * numeric ids while stableIds are deterministic from the provider (the same
120
- * property the sibling `sourceKey` mechanism relies on). stableId uniqueness
121
- * is formally per-addon; the resolver matches the first meta row with that
122
- * stableId (effective global uniqueness — an `addonId` disambiguator can be
123
- * added later without a wire break). */
124
- export interface DeviceLinkGlobalSource {
125
- readonly kind: 'global';
126
- readonly sourceStableId: string;
127
- readonly cap: string;
128
- readonly fieldPath: string;
129
- }
130
- /** The source kinds a single expression BINDING may use — a sibling FIELD, a
131
- * per-device LITERAL, or a GLOBAL device field. Never another expression:
132
- * bindings do not nest, so an expression cannot reference another expression. */
133
- export type DeviceLinkExpressionBinding = DeviceLinkFieldSource | DeviceLinkLiteralSource | DeviceLinkGlobalSource;
134
- /** Expression source (Stage X): compute the target field from N named source
135
- * bindings via a safe, non-Turing-complete infix expression (see
136
- * `packages/types/src/expression/`). Each binding resolves to an
137
- * `ExpressionValue` and is exposed to the expression under its record key.
138
- * `now` (epoch ms) is auto-injected and is a reserved binding name. The
139
- * evaluated result flows through `transform` exactly like a scalar source. */
140
- export interface DeviceLinkExpressionSource {
141
- readonly kind: 'expression';
142
- readonly expr: string;
143
- readonly bindings: Readonly<Record<string, DeviceLinkExpressionBinding>>;
144
- }
145
- export type DeviceLinkSource = DeviceLinkFieldSource | DeviceLinkLiteralSource | DeviceLinkGlobalSource | DeviceLinkExpressionSource;
146
- /** The target field a link writes: a dot-path into the target cap's status. */
147
- export interface DeviceLinkTarget {
148
- readonly cap: string;
149
- readonly fieldPath: string;
150
- /** Optional grouping key for array-of-items target caps (consumables); P2. */
151
- readonly itemKey?: string;
152
- }
153
- /** Optional value transform applied to the resolved source value. */
154
- export type DeviceLinkTransform = {
155
- readonly kind: 'identity';
156
- } | {
157
- readonly kind: 'enum-map';
158
- readonly mapping: Record<string, string | number | boolean>;
159
- readonly fallback?: string | number | boolean;
160
- } | {
161
- readonly kind: 'linear';
162
- readonly scale: number;
163
- readonly offset: number;
164
- readonly clamp?: readonly [number, number];
165
- };
166
- /** One operator-authored cross-device field wiring, persisted on the TARGET. */
167
- export interface DeviceLink {
168
- readonly id: string;
169
- readonly source: DeviceLinkSource;
170
- readonly target: DeviceLinkTarget;
171
- readonly transform?: DeviceLinkTransform;
172
- }
173
- export type DeviceLinks = readonly DeviceLink[];
174
98
  /** Per-cap display refinement inside a `DeviceDisplayOverride` — unit/precision
175
99
  * only (icon/label/hidden are device-level). Keyed by cap name for devices
176
100
  * carrying several numeric caps (e.g. power-meter). */
@@ -254,12 +178,8 @@ export interface DeviceMeta {
254
178
  * same lifecycle as `primaryChildEntityId`. Absent ⇒ no layout declared (all
255
179
  * children render in the plain Overview list). */
256
180
  readonly childLayout?: ChildLayout;
257
- /** Operator-authored cross-device field wirings (source field → this device's
258
- * cap field). Same create/persist/project/restore lifecycle as `childLayout`.
259
- * Absent ⇒ no links. Overlaid onto the target cap's `getStatus` at read time. */
260
- readonly deviceLinks?: DeviceLinks;
261
181
  /** Operator-authored per-device display override (icon/label/unit/precision/
262
- * hidden). Same create/persist/project/restore lifecycle as `deviceLinks`.
182
+ * hidden). Same create/persist/project/restore lifecycle as `childLayout`.
263
183
  * Absent ⇒ no override; the renderer falls back to role default → live slice
264
184
  * → canonical unit. Applied at RENDER time only — storage stays in source
265
185
  * units. */
@@ -292,8 +212,6 @@ export interface InitialDeviceMeta {
292
212
  * across re-register/restore. Optional: only set for CONTAINER devices that
293
213
  * declare a layout. */
294
214
  readonly childLayout?: ChildLayout;
295
- /** Cross-device field wirings set at create. Mirrors `DeviceMeta.deviceLinks`. */
296
- readonly deviceLinks?: DeviceLinks;
297
215
  /** Per-device display override set at create. Mirrors `DeviceMeta.display`. */
298
216
  readonly display?: DeviceDisplayOverride;
299
217
  }
@@ -1,25 +1,26 @@
1
- export { DeviceType, DeviceFeature, ChargingStatus, DeviceRole } from './device-type.js';
2
- export { AccessoryKind, ACCESSORY_LABEL, accessoryStableId, type AccessoryKindValue, } from './accessory.js';
3
- export type { IBatteryOperated, IRebootable, INativeSnapshot, IDoorbellButton, ITwoWayAudio, IPanTiltZoom, } from './features.js';
4
- export { DeviceConfig } from './device-config.js';
5
- export type { DeviceContext, DeviceManagerApi, DeviceConstructor, IDeviceRegistryReader, IDeviceRegistry, } from './device-context.js';
6
- export { BaseDevice } from './base-device.js';
1
+ export { ACCESSORY_LABEL, AccessoryKind, type AccessoryKindValue, accessoryStableId, } from './accessory.js';
7
2
  export type { AccessoryChildSpec } from './base-device.js';
3
+ export { BaseDevice } from './base-device.js';
4
+ export type { DeviceSummary, DiscoveryCandidate, FieldProbeResult, ProviderStatus, } from './base-device-provider.js';
8
5
  export { BaseDeviceProvider, toDeviceSummary } from './base-device-provider.js';
9
- export type { DiscoveryCandidate, DeviceSummary, ProviderStatus, FieldProbeResult, } from './base-device-provider.js';
10
- export type { IDevice } from './device.js';
11
- export { DEVICE_PROFILES, BATTERY_DEVICE_PROFILE, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
12
- export type { DeviceProfile, DeviceProfileMatch, DeviceProfileDefaults, PipelinePhaseMode, } from './device-profile.js';
13
6
  export type { ICameraDevice, StreamSourceEntry } from './camera-device.js';
14
- export type { DeviceManualCreation, DeviceDiscovery, DiscoveredDevice, SavedDevice, DeviceMeta, InitialDeviceMeta, CreateDeviceSpec, ChildLayout, ChildLayoutEntry, DeviceLinkFieldSource, DeviceLinkLiteralSource, DeviceLinkGlobalSource, DeviceLinkExpressionBinding, DeviceLinkExpressionSource, DeviceLinkSource, DeviceLinkTarget, DeviceLinkTransform, DeviceLink, DeviceLinks, } from './device-management.js';
15
- export { zodEntriesToConfigUI } from './zod-to-config-ui.js';
16
- export type { DeviceConfigEntry } from './zod-to-config-ui.js';
17
- export { createRuntimeStateBridge } from './runtime-state-helpers.js';
18
- export type { RuntimeStateBridge } from './runtime-state-helpers.js';
7
+ export type { DeclarationPlacement, DeclaredDeviceOutcome, DeclaredDevicePorts, DeclaredDeviceRow, DeclaredDevicesResult, DeclaredDevicesSpec, DeclaredIntegrationRow, DeviceDeclaration, } from './declared-device.js';
8
+ export { DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DeclaredDevices, declarationOwnerNodeId, } from './declared-device.js';
9
+ export type { IDevice } from './device.js';
10
+ export { DeviceConfig } from './device-config.js';
11
+ export type { DeviceConstructor, DeviceContext, DeviceManagerApi, IDeviceRegistry, IDeviceRegistryReader, } from './device-context.js';
12
+ export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceDiscovery, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, SavedDevice, } from './device-management.js';
13
+ export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device-profile.js';
14
+ export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device-profile.js';
19
15
  export type { IDeviceRuntimeState, Snapshot as RuntimeStateSnapshot, } from './device-runtime-state.js';
16
+ export { ChargingStatus, DeviceFeature, DeviceRole, DeviceType } from './device-type.js';
17
+ export type { IBatteryOperated, IDoorbellButton, INativeSnapshot, IPanTiltZoom, IRebootable, ITwoWayAudio, } from './features.js';
20
18
  export { getByPath, setByPath } from './path-util.js';
21
- export { applyTransform } from './device-link-transform.js';
22
- export { enumerateItemArrayFields, enumerateSchemaFields } from './schema-fields.js';
19
+ export type { ReachabilityPollHandle, ReachabilityPollLogger, ReachabilityPollOptions, } from './reachability-poll.js';
20
+ export { REACHABILITY_FAILURES_TO_OFFLINE, REACHABILITY_POLL_INTERVAL_MS, REACHABILITY_PROBE_TIMEOUT_MS, startReachabilityPoll, } from './reachability-poll.js';
21
+ export type { RuntimeStateBridge } from './runtime-state-helpers.js';
22
+ export { createRuntimeStateBridge } from './runtime-state-helpers.js';
23
23
  export type { WireableField } from './schema-fields.js';
24
- export { startReachabilityPoll, REACHABILITY_POLL_INTERVAL_MS, REACHABILITY_FAILURES_TO_OFFLINE, REACHABILITY_PROBE_TIMEOUT_MS, } from './reachability-poll.js';
25
- export type { ReachabilityPollOptions, ReachabilityPollHandle, ReachabilityPollLogger, } from './reachability-poll.js';
24
+ export { enumerateItemArrayFields, enumerateSchemaFields } from './schema-fields.js';
25
+ export type { DeviceConfigEntry } from './zod-to-config-ui.js';
26
+ export { zodEntriesToConfigUI } from './zod-to-config-ui.js';
@@ -0,0 +1,85 @@
1
+ /**
2
+ * What an expression's named bindings READ from.
3
+ *
4
+ * Salvaged verbatim from the deleted device-link mechanism. Wiring's source
5
+ * kinds were the one part of it worth keeping: addressing a device field by
6
+ * re-sync-stable `stableId`, a per-device constant, and a sibling-accessory
7
+ * read are the vocabulary any cross-device derivation needs, and they were
8
+ * already correct. What wiring got wrong was the DESTINATION — a field on
9
+ * somebody else's device, with no identity — not the source.
10
+ *
11
+ * These shapes are therefore kept, re-homed next to the engine that consumes
12
+ * them, and are the binding type of a composition recipe (the source picker
13
+ * stays `deviceManager.getWireableFields`). They deliberately do NOT nest: a
14
+ * binding is a read, never another expression.
15
+ *
16
+ * Schemas are authoritative; every type is `z.infer` of one, so a wire shape and
17
+ * a TypeScript shape cannot drift apart (`scripts/check-schema-type-twins.ts`).
18
+ */
19
+ import { z } from 'zod';
20
+ /** Read a sibling accessory's status field, addressed by the sibling's key.
21
+ * `kind` is optional for wire compatibility — absent means `'field'`. */
22
+ export declare const ExpressionFieldBindingSchema: z.ZodObject<{
23
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
24
+ sourceKey: z.ZodString;
25
+ cap: z.ZodString;
26
+ fieldPath: z.ZodString;
27
+ }, z.core.$strip>;
28
+ /** A constant. No device is read. */
29
+ export declare const ExpressionLiteralBindingSchema: z.ZodObject<{
30
+ kind: z.ZodLiteral<"literal">;
31
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
32
+ }, z.core.$strip>;
33
+ /** Read ANY device's status field, addressed by its re-sync-stable `stableId` —
34
+ * never by numeric id, which a re-adoption reissues. */
35
+ export declare const ExpressionGlobalBindingSchema: z.ZodObject<{
36
+ kind: z.ZodLiteral<"global">;
37
+ sourceStableId: z.ZodString;
38
+ cap: z.ZodString;
39
+ fieldPath: z.ZodString;
40
+ }, z.core.$strip>;
41
+ export declare const ExpressionBindingSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
42
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
43
+ sourceKey: z.ZodString;
44
+ cap: z.ZodString;
45
+ fieldPath: z.ZodString;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ kind: z.ZodLiteral<"literal">;
48
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
49
+ }, z.core.$strip>, z.ZodObject<{
50
+ kind: z.ZodLiteral<"global">;
51
+ sourceStableId: z.ZodString;
52
+ cap: z.ZodString;
53
+ fieldPath: z.ZodString;
54
+ }, z.core.$strip>]>;
55
+ /**
56
+ * An expression plus the bindings its free identifiers resolve against.
57
+ *
58
+ * The `superRefine` runs the SAME author-time validation as
59
+ * `validateExpressionSource` — compiles the expression, checks binding names,
60
+ * checks identifier coverage — so every boundary that parses one
61
+ * validates-at-write rather than discovering the problem at read time.
62
+ * Compiles are LRU-cached, so repeated validation of the same string is a hit.
63
+ */
64
+ export declare const ExpressionSourceSchema: z.ZodObject<{
65
+ expr: z.ZodString;
66
+ bindings: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
67
+ kind: z.ZodOptional<z.ZodLiteral<"field">>;
68
+ sourceKey: z.ZodString;
69
+ cap: z.ZodString;
70
+ fieldPath: z.ZodString;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ kind: z.ZodLiteral<"literal">;
73
+ value: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodNull]>;
74
+ }, z.core.$strip>, z.ZodObject<{
75
+ kind: z.ZodLiteral<"global">;
76
+ sourceStableId: z.ZodString;
77
+ cap: z.ZodString;
78
+ fieldPath: z.ZodString;
79
+ }, z.core.$strip>]>>;
80
+ }, z.core.$strip>;
81
+ export type ExpressionFieldBinding = z.infer<typeof ExpressionFieldBindingSchema>;
82
+ export type ExpressionLiteralBinding = z.infer<typeof ExpressionLiteralBindingSchema>;
83
+ export type ExpressionGlobalBinding = z.infer<typeof ExpressionGlobalBindingSchema>;
84
+ export type ExpressionBindingSource = z.infer<typeof ExpressionBindingSourceSchema>;
85
+ export type ExpressionSource = z.infer<typeof ExpressionSourceSchema>;
@@ -1,5 +1,15 @@
1
- import { type ExpressionEvalOptions } from './evaluator.js';
1
+ /**
2
+ * Expression-source helpers — the single seam every consumer of the engine
3
+ * shares, so author-time validation and read-time evaluation cannot drift.
4
+ *
5
+ * These were written for the `expression` device-link source and outlived it:
6
+ * wiring was deleted on 2026-08-08 with zero live users, and the engine was
7
+ * kept on purpose. It is the derivation language of a composed device and the
8
+ * escape-hatch leaf of an automation's condition tree — one language, three
9
+ * positions (derive a value, gate a trigger, compute an argument).
10
+ */
2
11
  import type { ExpressionValue } from './ast.js';
12
+ import { type ExpressionEvalOptions } from './evaluator.js';
3
13
  /** The `now` epoch-ms binding is auto-injected into every evaluation and is a
4
14
  * reserved binding name (authors may not rebind it). */
5
15
  export declare const EXPRESSION_INJECTED_NOW = "now";
@@ -10,8 +20,8 @@ export declare const EXPRESSION_INJECTED_NOW = "now";
10
20
  * its binding-miss policy (→ `null`). `null` itself is a valid value.
11
21
  */
12
22
  export declare function toExpressionValue(raw: unknown): ExpressionValue | undefined;
13
- /** Shape the author-time validator accepts (structural subset of a
14
- * `DeviceLinkExpressionSource`). */
23
+ /** Shape the author-time validator accepts (structural subset of an
24
+ * {@link ExpressionSource}). */
15
25
  export interface ExpressionSourceInput {
16
26
  readonly expr: string;
17
27
  readonly bindings: Readonly<Record<string, unknown>>;
@@ -24,10 +34,9 @@ export interface ExpressionSourceInput {
24
34
  * FREE identifier of the AST is covered by a binding or the injected `now`.
25
35
  */
26
36
  export declare function validateExpressionSource(src: ExpressionSourceInput): string | null;
27
- /** Result of a link-expression evaluation — `ok` carries the value, the error
28
- * branch carries a reason the async channel can log while the sync channel
29
- * silently skips. */
30
- export type EvaluateLinkExpressionResult = {
37
+ /** Result of an expression evaluation — `ok` carries the value, the error
38
+ * branch carries a reason the caller can log while it skips the derivation. */
39
+ export type EvaluateExpressionSourceResult = {
31
40
  readonly ok: true;
32
41
  readonly value: ExpressionValue;
33
42
  } | {
@@ -35,10 +44,10 @@ export type EvaluateLinkExpressionResult = {
35
44
  readonly error: string;
36
45
  };
37
46
  /**
38
- * Shared read-path evaluation for BOTH resolver channels. Builds a null-proto
39
- * scope from `bindingValues` plus the injected `now` (supplied by the caller
40
- * for determinism/testability), compiles via the LRU, and evaluates. Any
41
- * failure (parse or eval) returns `{ ok: false }` — the caller treats that as
42
- * "skip this link".
47
+ * Shared read-path evaluation. Builds a null-proto scope from `bindingValues`
48
+ * plus the injected `now` (supplied by the caller for determinism and
49
+ * testability), compiles via the LRU, and evaluates. Any failure (parse or
50
+ * eval) returns `{ ok: false }` — the caller treats that as "skip this
51
+ * derivation", never as a throw that takes the pass down.
43
52
  */
44
- export declare function evaluateLinkExpression(expr: string, bindingValues: Readonly<Record<string, ExpressionValue>>, now: number, opts?: ExpressionEvalOptions): EvaluateLinkExpressionResult;
53
+ export declare function evaluateExpressionSource(expr: string, bindingValues: Readonly<Record<string, ExpressionValue>>, now: number, opts?: ExpressionEvalOptions): EvaluateExpressionSourceResult;
@@ -2,24 +2,27 @@
2
2
  * Safe expression engine — public surface. A non-Turing-complete infix
3
3
  * mini-language (tokenizer → Pratt parser → whitelisted-AST interpreter) with
4
4
  * NO eval / new Function / node:vm, NO member access, NO loops/lambdas, and
5
- * hard resource bounds. Powers the `expression` DeviceLinkSource kind.
5
+ * hard resource bounds. It is the derivation language of a composed device and
6
+ * the escape-hatch leaf of an automation's condition tree.
6
7
  *
7
8
  * This is the module barrel; leaf files inside @camstack/types MUST import from
8
9
  * the deep modules (e.g. `../expression/compile.js`), never through this file
9
10
  * OR the root barrel (see biome-plugins/no-types-barrel-leaf-import.grit).
10
11
  */
11
- export type { ExpressionValue, ExpressionNode, ExpressionLiteralNode, ExpressionIdentifierNode, ExpressionUnaryNode, ExpressionBinaryNode, ExpressionLogicalNode, ExpressionConditionalNode, ExpressionCallNode, ExpressionBinaryOperator, ExpressionLogicalOperator, ExpressionUnaryOperator, } from './ast.js';
12
- export { ExpressionParseError, ExpressionEvalError } from './errors.js';
13
- export { MAX_EXPRESSION_SOURCE_LENGTH, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, RESERVED_BINDING_NAMES, } from './limits.js';
14
- export { tokenize } from './tokenizer.js';
15
- export type { Token, Punctuator, Keyword } from './tokenizer.js';
16
- export { parseExpression } from './parser.js';
17
- export type { ParsedExpression } from './parser.js';
18
- export { EXPRESSION_BUILTINS, EXPRESSION_BUILTIN_NAMES, } from './builtins.js';
12
+ export type { ExpressionBinaryNode, ExpressionBinaryOperator, ExpressionCallNode, ExpressionConditionalNode, ExpressionIdentifierNode, ExpressionLiteralNode, ExpressionLogicalNode, ExpressionLogicalOperator, ExpressionNode, ExpressionUnaryNode, ExpressionUnaryOperator, ExpressionValue, } from './ast.js';
13
+ export type { ExpressionBindingSource, ExpressionFieldBinding, ExpressionGlobalBinding, ExpressionLiteralBinding, ExpressionSource, } from './binding-source.js';
14
+ export { ExpressionBindingSourceSchema, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionSourceSchema, } from './binding-source.js';
19
15
  export type { ExpressionBuiltin, ExpressionEvalHooks } from './builtins.js';
20
- export { createExpressionScope, evaluateAst } from './evaluator.js';
21
- export type { ExpressionEvalOptions } from './evaluator.js';
22
- export { compileExpression, compileExpressionSafe } from './compile.js';
16
+ export { EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, } from './builtins.js';
23
17
  export type { CompileResult } from './compile.js';
24
- export { EXPRESSION_INJECTED_NOW, toExpressionValue, validateExpressionSource, evaluateLinkExpression, } from './link-expression.js';
25
- export type { ExpressionSourceInput, EvaluateLinkExpressionResult, } from './link-expression.js';
18
+ export { compileExpression, compileExpressionSafe } from './compile.js';
19
+ export { ExpressionEvalError, ExpressionParseError } from './errors.js';
20
+ export type { ExpressionEvalOptions } from './evaluator.js';
21
+ export { createExpressionScope, evaluateAst } from './evaluator.js';
22
+ export type { EvaluateExpressionSourceResult, ExpressionSourceInput, } from './expression-source.js';
23
+ export { EXPRESSION_INJECTED_NOW, evaluateExpressionSource, toExpressionValue, validateExpressionSource, } from './expression-source.js';
24
+ export { EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, MAX_EXPRESSION_AST_NODES, MAX_EXPRESSION_BINDINGS, MAX_EXPRESSION_CALL_ARGS, MAX_EXPRESSION_EVAL_STEPS, MAX_EXPRESSION_SOURCE_LENGTH, RESERVED_BINDING_NAMES, } from './limits.js';
25
+ export type { ParsedExpression } from './parser.js';
26
+ export { parseExpression } from './parser.js';
27
+ export type { Keyword, Punctuator, Token } from './tokenizer.js';
28
+ export { tokenize } from './tokenizer.js';
@@ -17,7 +17,7 @@ export declare const MAX_EXPRESSION_AST_NODES = 256;
17
17
  * evaluation. The grammar guarantees O(nodeCount) walks, so this can only trip
18
18
  * on a crafted maximum-size AST. */
19
19
  export declare const MAX_EXPRESSION_EVAL_STEPS = 4096;
20
- /** Max named bindings on one `DeviceLinkExpressionSource`. */
20
+ /** Max named bindings on one {@link ExpressionSource}. */
21
21
  export declare const MAX_EXPRESSION_BINDINGS = 32;
22
22
  /** Max positional arguments to any builtin call. */
23
23
  export declare const MAX_EXPRESSION_CALL_ARGS = 16;
@@ -1441,6 +1441,13 @@ export type AppRouter = TrpcCoreRouter<{
1441
1441
  output: z.infer<typeof coreBlocksCapability.methods.setEnabled.output>;
1442
1442
  meta: object;
1443
1443
  }>;
1444
+ restart: TRPCMutationProcedure<{
1445
+ input: {
1446
+ [x: string]: unknown;
1447
+ } & z.input<typeof coreBlocksCapability.methods.restart.input>;
1448
+ output: z.infer<typeof coreBlocksCapability.methods.restart.output>;
1449
+ meta: object;
1450
+ }>;
1444
1451
  compile: TRPCMutationProcedure<{
1445
1452
  input: {
1446
1453
  [x: string]: unknown;
@@ -2076,13 +2083,6 @@ export type AppRouter = TrpcCoreRouter<{
2076
2083
  output: z.infer<typeof deviceManagerCapability.methods.setChildLayout.output>;
2077
2084
  meta: object;
2078
2085
  }>;
2079
- setDeviceLinks: TRPCMutationProcedure<{
2080
- input: {
2081
- [x: string]: unknown;
2082
- } & z.input<typeof deviceManagerCapability.methods.setDeviceLinks.input>;
2083
- output: z.infer<typeof deviceManagerCapability.methods.setDeviceLinks.output>;
2084
- meta: object;
2085
- }>;
2086
2086
  setDisplay: TRPCMutationProcedure<{
2087
2087
  input: {
2088
2088
  [x: string]: unknown;
@@ -269,7 +269,7 @@ export interface DeviceProxy {
269
269
  readonly cameraPipelineConfig: Pick<InferDeviceProxyCap<typeof cameraPipelineConfigCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
270
270
  readonly deviceAdoption: Pick<InferDeviceProxyCap<typeof deviceAdoptionCapability>, 'getStatus'>;
271
271
  readonly deviceExport: Pick<InferDeviceProxyCap<typeof deviceExportCapability>, 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
272
- readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setLocation' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setDeviceLinks' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'getAllBindings' | 'setWrapperActive' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
272
+ readonly deviceManager: Pick<InferDeviceProxyCap<typeof deviceManagerCapability>, 'loadConfig' | 'loadRuntimeState' | 'loadMeta' | 'setName' | 'setLocation' | 'setType' | 'setIntegrationId' | 'setLinkDeviceId' | 'setPrimaryChildEntityId' | 'setChildLayout' | 'setDisplay' | 'getWireableFields' | 'setRole' | 'applyInitialMeta' | 'setMetadata' | 'setDisabled' | 'getDevice' | 'getLinkedDevices' | 'getStreamSources' | 'getConfigSchema' | 'getSettingsSchema' | 'updateConfig' | 'enable' | 'disable' | 'remove' | 'getStreamProfileMap' | 'setStreamProfileMap' | 'probeStreams' | 'getBindings' | 'getAllBindings' | 'setWrapperActive' | 'getDeviceSettingsAggregate' | 'getDeviceLiveInfoAggregate' | 'getDeviceAggregate' | 'runDeviceAction' | 'updateDeviceField' | 'updateDeviceFieldsBatch' | 'testField' | 'getDeviceStatusAggregate' | 'getDeviceSettingsContribution' | 'getDeviceLiveContribution' | 'applyDeviceSettingsPatch'>;
273
273
  readonly deviceState: Pick<InferDeviceProxyCap<typeof deviceStateCapability>, 'getSnapshot' | 'getCapSlice' | 'setCapSlice'>;
274
274
  readonly faceGallery: Pick<InferDeviceProxyCap<typeof faceGalleryCapability>, 'getFaceByTrack'>;
275
275
  readonly networkQuality: Pick<InferDeviceProxyCap<typeof networkQualityCapability>, 'getDeviceStats' | 'reportClientStats'>;
@@ -61,7 +61,7 @@ export interface SystemProxy {
61
61
  readonly audioCodec: Pick<InferProvider<typeof audioCodecCapability>, 'listSupportedCodecs' | 'canHandle' | 'createDecodeSession' | 'createEncodeSession' | 'closeSession' | 'pushEncodedFrame' | 'pullPcm' | 'pushPcm' | 'pullEncoded' | 'flushEncode' | 'listActiveSessions'>;
62
62
  readonly backup: Pick<InferProvider<typeof backupCapability>, 'listDestinations' | 'trigger' | 'list' | 'listLocations' | 'getEntries' | 'restore' | 'delete' | 'listArchives' | 'upsertDestinationPolicy' | 'previewSchedule' | 'listSchedules' | 'upsertSchedule' | 'deleteSchedule'>;
63
63
  readonly broker: Pick<InferProvider<typeof brokerCapability>, 'list' | 'get' | 'listProviders' | 'add' | 'remove' | 'testConnection' | 'getSettings' | 'setSettings' | 'getBrokerConfig' | 'getSettingsSchema' | 'testSettings' | 'publish' | 'subscribe' | 'unsubscribe' | 'getState' | 'getStatus'>;
64
- readonly coreBlocks: Pick<InferProvider<typeof coreBlocksCapability>, 'list' | 'get' | 'create' | 'update' | 'delete' | 'setEnabled' | 'compile' | 'getTypeDefs'>;
64
+ readonly coreBlocks: Pick<InferProvider<typeof coreBlocksCapability>, 'list' | 'get' | 'create' | 'update' | 'delete' | 'setEnabled' | 'restart' | 'compile' | 'getTypeDefs'>;
65
65
  readonly decoder: Pick<InferProvider<typeof decoderCapability>, 'supportsCodec' | 'getInfo' | 'createSession' | 'destroySession' | 'pushPacket' | 'openStream' | 'pullFrames' | 'pullHandles' | 'getFrame' | 'getShmStats' | 'updateConfig' | 'getStats' | 'listActiveSessions' | 'reprobeHwaccel'>;
66
66
  readonly deviceAdoption: Pick<InferProvider<typeof deviceAdoptionCapability>, 'listCandidateFilters' | 'listCandidates' | 'getCandidate' | 'refresh' | 'adopt' | 'release' | 'resync'>;
67
67
  readonly deviceExport: Pick<InferProvider<typeof deviceExportCapability>, 'getStatus' | 'listSupportedDeviceKinds' | 'listExposedDevices' | 'exposeDevice' | 'unexposeDevice'>;
package/dist/index.d.ts CHANGED
@@ -8,11 +8,11 @@ export type { IAuthProvider } from './capabilities/auth-provider.cap.js';
8
8
  export type { DisposerChainOptions, DisposerFn } from './disposer-chain.js';
9
9
  export { DisposerChain } from './disposer-chain.js';
10
10
  export * from './encode-profile.js';
11
- export * from './ffmpeg/invocation.js';
12
11
  export * from './ffmpeg/encode-defaults.js';
12
+ export * from './ffmpeg/fmp4-box-splitter.js';
13
13
  export * from './ffmpeg/hwaccel.js';
14
+ export * from './ffmpeg/invocation.js';
14
15
  export * from './ffmpeg/sharing-key.js';
15
- export * from './ffmpeg/fmp4-box-splitter.js';
16
16
  export * from './health/wiring-health.js';
17
17
  export type * from './interfaces/addon.js';
18
18
  export { DEFAULT_ADDON_PLACEMENT, isAgentOnlyPlacement, isDeployableToAgent, resolveAddonExecution, resolveAddonGroup, resolveAddonPlacement, resolveRunnerId, } from './interfaces/addon.js';
@@ -127,14 +127,15 @@ export { BaseDevice } from './device/base-device.js';
127
127
  export type { DeviceSummary, DiscoveryCandidate, FieldProbeResult, } from './device/base-device-provider.js';
128
128
  export { BaseDeviceProvider, toDeviceSummary } from './device/base-device-provider.js';
129
129
  export type { ICameraDevice, StreamSourceEntry } from './device/camera-device.js';
130
+ export type { DeclarationPlacement, DeclaredDeviceOutcome, DeclaredDevicePorts, DeclaredDeviceRow, DeclaredDevicesResult, DeclaredDevicesSpec, DeclaredIntegrationRow, DeviceDeclaration, } from './device/declared-device.js';
131
+ export { DECLARED_DEVICE_SWEEP_LIMIT, DECLARED_INTEGRATION_FIXED_KEY, DeclaredDevices, declarationOwnerNodeId, } from './device/declared-device.js';
130
132
  export type { IDevice } from './device/device.js';
131
133
  export type { DeviceBinding, DeviceBindingEntry } from './device/device-binding.js';
132
134
  export { DeviceConfig } from './device/device-config.js';
133
135
  export type { DeviceConstructor, DeviceContext, DeviceManagerApi, IDeviceRegistry, IDeviceRegistryReader, } from './device/device-context.js';
134
136
  export type { AccessoryControlInput, AccessoryControlKind, AccessoryControlPick, DeviceControlKind, SensorMapping, } from './device/device-control-resolution.js';
135
137
  export { DEVICE_TYPE_CONTROL_KIND, hasMotionTrigger, isNode, MOTION_TRIGGER_FEATURE, pickAccessoryControl, resolveDeviceControlKind, resolveMutate, SENSOR_FEATURES, SENSOR_MAP, } from './device/device-control-resolution.js';
136
- export { applyTransform } from './device/device-link-transform.js';
137
- export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceCapDisplayOverride, DeviceDiscovery, DeviceDisplayOverride, DeviceLink, DeviceLinkExpressionBinding, DeviceLinkExpressionSource, DeviceLinkFieldSource, DeviceLinkLiteralSource, DeviceLinkSource, DeviceLinks, DeviceLinkTarget, DeviceLinkTransform, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, RoleDisplayDefault, SavedDevice, } from './device/device-management.js';
138
+ export type { ChildLayout, ChildLayoutEntry, CreateDeviceSpec, DeviceCapDisplayOverride, DeviceDiscovery, DeviceDisplayOverride, DeviceManualCreation, DeviceMeta, DiscoveredDevice, InitialDeviceMeta, RoleDisplayDefault, SavedDevice, } from './device/device-management.js';
138
139
  export type { DeviceProfile, DeviceProfileDefaults, DeviceProfileMatch, PipelinePhaseMode, } from './device/device-profile.js';
139
140
  export { BATTERY_DEVICE_PROFILE, DEVICE_PROFILES, deviceMatchesProfile, resolveDeviceProfile, } from './device/device-profile.js';
140
141
  export type { IDeviceRuntimeState } from './device/device-runtime-state.js';
@@ -158,8 +159,8 @@ export type { DeviceConfigEntry } from './device/zod-to-config-ui.js';
158
159
  export { zodEntriesToConfigUI } from './device/zod-to-config-ui.js';
159
160
  export { EventCategory } from './enums/event-category.js';
160
161
  export * from './enums/index.js';
161
- export type { CompileResult, EvaluateLinkExpressionResult, ExpressionBinaryOperator, ExpressionBuiltin, ExpressionEvalHooks, ExpressionEvalOptions, ExpressionLogicalOperator, ExpressionNode, ExpressionSourceInput, ExpressionUnaryOperator, ExpressionValue, Keyword, ParsedExpression, Punctuator, Token, } from './expression/index.js';
162
- export { compileExpression, compileExpressionSafe, createExpressionScope, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, ExpressionEvalError, ExpressionParseError, evaluateAst, evaluateLinkExpression, 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';
162
+ export type { CompileResult, EvaluateExpressionSourceResult, ExpressionBinaryOperator, ExpressionBindingSource, ExpressionBuiltin, ExpressionEvalHooks, ExpressionEvalOptions, ExpressionFieldBinding, ExpressionGlobalBinding, ExpressionLiteralBinding, ExpressionLogicalOperator, ExpressionNode, ExpressionSource, ExpressionSourceInput, ExpressionUnaryOperator, ExpressionValue, Keyword, ParsedExpression, Punctuator, Token, } from './expression/index.js';
163
+ export { compileExpression, compileExpressionSafe, createExpressionScope, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, EXPRESSION_COMPILE_CACHE_CAPACITY, EXPRESSION_IDENTIFIER_RE, EXPRESSION_INJECTED_NOW, ExpressionBindingSourceSchema, ExpressionEvalError, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionParseError, ExpressionSourceSchema, evaluateAst, evaluateExpressionSource, 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';
163
164
  export type { AddonApi, AppRouter } from './generated/addon-api.js';
164
165
  export type { CapNameWithStatus, CapStatusTypeMap } from './generated/cap-status-types.js';
165
166
  export { CAP_NAMES_WITH_STATUS } from './generated/cap-status-types.js';
@@ -185,6 +186,8 @@ export { htmlToText, markdownToHtmlLite, markdownToText, type NotificationFormat
185
186
  export { isScheduleActive } from './notification/schedule.js';
186
187
  export type { TimelapseRule, TimelapseRuleInput, TimelapseRulePatch, TimelapseTemplate, } from './notification/timelapse-rule.js';
187
188
  export { TimelapseRuleInputSchema, TimelapseRulePatchSchema, TimelapseRuleSchema, TimelapseTemplateSchema, } from './notification/timelapse-rule.js';
189
+ export { DEFAULT_DETAIL_CROP_CONVENTION, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, type DetailCropConvention, DetailCropConventionSchema, type DetailCropRect, deriveDetailCropRect, type HydratedSettingsSection, type HydratedSettingsView, pickDetailCropConvention, readDetailCropConvention, } from './pipeline/detail-crop.js';
190
+ export { DEFAULT_NATIVE_LEASE_SETTINGS, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TTL_FIELD, NATIVE_LEASE_TTL_KEY, type NativeLeaseAdmission, NativeLeaseAdmissionSchema, type NativeLeaseKnob, type NativeLeaseNumberKnob, type NativeLeaseSettings, type NativeLeaseSettingsOverride, NativeLeaseSettingsSchema, pickNativeLeaseOverride, readNativeLeaseOverride, } from './pipeline/native-lease.js';
188
191
  export { type ApiKeyRecord, ApiKeyRecordSchema, type CapScope, CapScopeSchema, type MethodAccess, MethodAccessSchema, type ScopedToken, ScopedTokenSchema, type TokenScope, TokenScopeSchema, type UserRecord, UserRecordSchema, } from './schemas/auth-records.js';
189
192
  export type { CameraDetectionCapabilities, CameraMotionConfig, CameraNativeDetectionConfig, } from './types/camera-detection.js';
190
193
  export { DEVICE_TYPE_INFO, type DeviceTypeInfo } from './types/device-type.js';
@@ -206,8 +209,6 @@ export { BACKEND_TO_FORMAT, DEVICE_BACKEND_TO_FORMAT, deviceBackendToFormat, for
206
209
  export { sleep, sleepCancellable } from './utils/sleep.js';
207
210
  export { decodeVectorBase64, encodeVectorBase64, vectorDimFromBase64, } from './utils/vector-codec.js';
208
211
  export { evaluateZoneRules, type ZoneRuleEvalResult } from './utils/zone-rule-eval.js';
209
- export { DEFAULT_DETAIL_CROP_CONVENTION, DETAIL_CROP_PADDING_FIELD, DETAIL_CROP_PADDING_KEY, DETAIL_CROP_SECTION_ID, DETAIL_CROP_SQUARE_KEY, type DetailCropConvention, DetailCropConventionSchema, type DetailCropRect, deriveDetailCropRect, type HydratedSettingsSection, type HydratedSettingsView, pickDetailCropConvention, readDetailCropConvention, } from './pipeline/detail-crop.js';
210
- export { DEFAULT_NATIVE_LEASE_SETTINGS, NATIVE_LEASE_ACTIVITY_FIELD, NATIVE_LEASE_ACTIVITY_KEY, NATIVE_LEASE_ADMISSION_FIELD, NATIVE_LEASE_ADMISSION_KEY, NATIVE_LEASE_BUDGET_FIELD, NATIVE_LEASE_BUDGET_KEY, NATIVE_LEASE_SECTION_ID, NATIVE_LEASE_TTL_FIELD, NATIVE_LEASE_TTL_KEY, type NativeLeaseAdmission, NativeLeaseAdmissionSchema, type NativeLeaseKnob, type NativeLeaseNumberKnob, type NativeLeaseSettings, NativeLeaseSettingsSchema, type NativeLeaseSettingsOverride, pickNativeLeaseOverride, readNativeLeaseOverride, } from './pipeline/native-lease.js';
211
212
  export { bindAddonActions } from './helpers/bind-addon-actions.js';
212
213
  export type { DeviceOption, InferenceDeviceDescriptor, RuntimeId, } from './inference/runtime-capabilities.js';
213
214
  export { defaultDeviceFor, enumerateInferenceDevices, modelFormatForRuntime, runtimeDevices, scoreRuntimes, supportedRuntimes, } from './inference/runtime-capabilities.js';