@camstack/types 1.2.290 → 1.2.293

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.
package/dist/addon.js CHANGED
@@ -16,7 +16,7 @@ const require_err_msg = require("./err-msg-Dx2Kor0g.js");
16
16
  * Plain data, zero Zod: a forked runner must not import the schema barrel
17
17
  * (~144MB RSS per runner — D28).
18
18
  *
19
- * Coverage: 24 caps, 57 methods with defaults.
19
+ * Coverage: 24 caps, 58 methods with defaults.
20
20
  */
21
21
  var CAP_INPUT_DEFAULTS = Object.freeze({
22
22
  "addons": { "getLogs": { "limit": 100 } },
@@ -133,12 +133,18 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
133
133
  "lookbackMinutes": 60
134
134
  }
135
135
  },
136
- "osd-manager": { "setSlotBinding": { "binding": { "__nested__": {
137
- "enabled": true,
138
- "template": "${value}",
139
- "maxDecimals": 1,
140
- "fallbackText": ""
141
- } } } },
136
+ "osd-manager": {
137
+ "setSlotBinding": { "binding": { "__nested__": {
138
+ "enabled": true,
139
+ "template": "${value}",
140
+ "maxDecimals": 1,
141
+ "fallbackText": ""
142
+ } } },
143
+ "upsertTemplate": { "template": { "__nested__": {
144
+ "fields": [],
145
+ "parser": ""
146
+ } } }
147
+ },
142
148
  "pipeline-analytics": {
143
149
  "getAudioEvents": { "limit": 1e3 },
144
150
  "getKeyEvents": { "limit": 50 },
package/dist/addon.mjs CHANGED
@@ -15,7 +15,7 @@ import { a as DeviceType, t as errMsg } from "./err-msg-DX6i_MY4.mjs";
15
15
  * Plain data, zero Zod: a forked runner must not import the schema barrel
16
16
  * (~144MB RSS per runner — D28).
17
17
  *
18
- * Coverage: 24 caps, 57 methods with defaults.
18
+ * Coverage: 24 caps, 58 methods with defaults.
19
19
  */
20
20
  var CAP_INPUT_DEFAULTS = Object.freeze({
21
21
  "addons": { "getLogs": { "limit": 100 } },
@@ -132,12 +132,18 @@ var CAP_INPUT_DEFAULTS = Object.freeze({
132
132
  "lookbackMinutes": 60
133
133
  }
134
134
  },
135
- "osd-manager": { "setSlotBinding": { "binding": { "__nested__": {
136
- "enabled": true,
137
- "template": "${value}",
138
- "maxDecimals": 1,
139
- "fallbackText": ""
140
- } } } },
135
+ "osd-manager": {
136
+ "setSlotBinding": { "binding": { "__nested__": {
137
+ "enabled": true,
138
+ "template": "${value}",
139
+ "maxDecimals": 1,
140
+ "fallbackText": ""
141
+ } } },
142
+ "upsertTemplate": { "template": { "__nested__": {
143
+ "fields": [],
144
+ "parser": ""
145
+ } } }
146
+ },
141
147
  "pipeline-analytics": {
142
148
  "getAudioEvents": { "limit": 1e3 },
143
149
  "getKeyEvents": { "limit": 50 },
@@ -32,7 +32,7 @@ export { AUDIO_BACKEND_CHOICES, AudioAnalysisResultSchema, AudioAnalysisSettings
32
32
  export { AudioCodecInfoSchema, AudioDecodeSessionConfigSchema, AudioEncodedChunkSchema, AudioEncodeSessionConfigSchema, AudioPcmChunkSchema, audioCodecCapability, type IAudioCodecCapProvider, PcmSampleFormatSchema, } from './audio-codec.cap.js';
33
33
  export { AuthResultSchema, authProviderCapability } from './auth-provider.cap.js';
34
34
  export { ArchiveEntrySchema, ArchiveManifestSchema, BackupDestinationInfoSchema, BackupEntrySchema, type BackupRun, type BackupRunPhase, BackupRunPhaseSchema, BackupRunSchema, type BackupRunState, BackupRunStateSchema, type BackupTriggerResult, BackupTriggerResultSchema, backupCapability, type IBackupProvider, LocationStatSchema, } from './backup.cap.js';
35
- export { BrokerAddInputSchema, BrokerGetStateInputSchema, type BrokerInfo as UnifiedBrokerInfo, BrokerInfoSchema as UnifiedBrokerInfoSchema, type BrokerProviderInfo, BrokerProviderInfoSchema, BrokerPublishInputSchema, BrokerRegistryStatusSchema, type BrokerStatus as UnifiedBrokerStatus, BrokerStatusEnum, BrokerSubscribeInputSchema, BrokerSubscribeResultSchema, BrokerTestConnectionResultSchema, BrokerUnsubscribeInputSchema, brokerCapability, type IBrokerProvider, } from './broker.cap.js';
35
+ export { BrokerAddInputSchema, BrokerGetStateInputSchema, type BrokerInfo, BrokerInfoSchema, type BrokerInfo as UnifiedBrokerInfo, BrokerInfoSchema as UnifiedBrokerInfoSchema, type BrokerProviderInfo, BrokerProviderInfoSchema, BrokerPublishInputSchema, BrokerRegistryStatusSchema, type BrokerStatus as UnifiedBrokerStatus, BrokerStatusEnum, BrokerSubscribeInputSchema, BrokerSubscribeResultSchema, BrokerTestConnectionResultSchema, BrokerUnsubscribeInputSchema, brokerCapability, type IBrokerProvider, } from './broker.cap.js';
36
36
  export { cameraPipelineConfigCapability, type ICameraPipelineConfigProvider, } from './camera-pipeline-config.cap.js';
37
37
  export { cameraStreamsCapability, type ICameraStreamsProvider, type PickedCamStream, PickedCamStreamSchema, type PickStreamPreferences, PickStreamPreferencesSchema, type PickStreamRequirements, PickStreamRequirementsSchema, type StreamCodec, StreamCodecSchema, } from './camera-streams.cap.js';
38
38
  export { emitsCollectionSelector, extractNestedAddonId, isArrayOutputSchema, isCollectionArrayMethod, isObjectInput, isVoidInput, kebabToCamel, looseSchema, objectInputDeclaresAddonId, objectInputDeclaresRequiredDeviceId, procedureAuthKey, resolveMethodAuth, } from './cap-router-predicates.js';
@@ -81,8 +81,8 @@ export type { IModelDistributorProvider, ModelDistributeInput, ModelDistributeRe
81
81
  export { ModelDistributeInputSchema, ModelDistributeResultSchema, modelDistributorCapability, } from './model-distributor.cap.js';
82
82
  export type { IMotionDetectionProvider, MotionAnalysisResult, MotionRegion, } from './motion-detection.cap.js';
83
83
  export { MotionAnalysisResultSchema, MotionRegionSchema, motionDetectionCapability, } from './motion-detection.cap.js';
84
- export type { BrokerConnectionDetails, BrokerInfo, BrokerStatus as MqttBrokerLiveStatus, IMqttBrokerProvider, } from './mqtt-broker.cap.js';
85
- export { AddBrokerInputSchema, BrokerConnectionDetailsSchema, BrokerInfoSchema, MqttBrokerStatusSchema, mqttBrokerCapability, StartEmbeddedInputSchema, } from './mqtt-broker.cap.js';
84
+ export type { BrokerConnectionDetails, BrokerInfo as MqttBrokerInfo, BrokerStatus as MqttBrokerLiveStatus, IMqttBrokerProvider, } from './mqtt-broker.cap.js';
85
+ export { AddBrokerInputSchema, BrokerConnectionDetailsSchema, BrokerInfoSchema as MqttBrokerInfoSchema, MqttBrokerStatusSchema, mqttBrokerCapability, StartEmbeddedInputSchema, } from './mqtt-broker.cap.js';
86
86
  export type { NetworkAccessStatus, NetworkEndpoint } from './network-access.cap.js';
87
87
  export { NetworkAccessStatusSchema, NetworkEndpointSchema, networkAccessCapability, } from './network-access.cap.js';
88
88
  export { type Attachment, type AttachmentMediaType, AttachmentMediaTypeSchema, AttachmentSchema, type DiscoveredTarget, DiscoveredTargetSchema, type INotificationOutputProvider, type NotificationAction, type NotificationActionIcon, NotificationActionIconSchema, NotificationActionSchema, type NotificationFormat, NotificationFormatSchema, NotificationSchema, notificationOutputCapability, type RenderedAs, RenderedAsSchema, type SendResult, SendResultSchema, type Target, type TargetKind, type TargetKindCaps, TargetKindCapsSchema, type TargetKindLevel, TargetKindLevelSchema, TargetKindSchema, TargetSchema, type TestResult, TestResultSchema, } from './notification-output.cap.js';
@@ -185,7 +185,7 @@ export { ClusterAddonNodeDeploymentSchema, ClusterAddonStatusEntrySchema, type I
185
185
  export { type INotifierProvider, type NotifierAction, type NotifierPriority, type NotifierSendInput, type NotifierSendResult, type NotifierStatus, NotifierStatusSchema, type NotifierSupports, notifierCapability, } from './notifier.cap.js';
186
186
  export { type INumericSensorProvider, type NumericSensorStatus, NumericSensorStatusSchema, numericSensorCapability, } from './numeric-sensor.cap.js';
187
187
  export { type IOsdProvider, type OsdOverlay, type OsdOverlayKind, OsdOverlayKindEnum, OsdOverlayPatchSchema, OsdOverlaySchema, type OsdPosition, OsdPositionEnum, type OsdStatus, OsdStatusSchema, osdCapability, } from './osd.cap.js';
188
- export { type IOsdManagerProvider, type OsdRenderOutcome, OsdRenderOutcomeEnum, type OsdRenderResult, OsdRenderResultSchema, type OsdSlotBinding, OsdSlotBindingSchema, type OsdSlotView, OsdSlotViewSchema, type OsdSource, type OsdSourceOption, OsdSourceOptionSchema, OsdSourceSchema, type OsdSourceValueType, OsdSourceValueTypeEnum, osdManagerCapability, } from './osd-manager.cap.js';
188
+ export { type IOsdManagerProvider, type OsdNamedTemplate, OsdNamedTemplateSchema, type OsdRenderOutcome, OsdRenderOutcomeEnum, type OsdRenderResult, OsdRenderResultSchema, type OsdSlotBinding, OsdSlotBindingSchema, type OsdSlotView, OsdSlotViewSchema, type OsdSource, type OsdSourceOption, OsdSourceOptionSchema, OsdSourceSchema, type OsdSourceValueType, OsdSourceValueTypeEnum, type OsdTemplateField, OsdTemplateFieldSchema, osdManagerCapability, } from './osd-manager.cap.js';
189
189
  export { type IPetFeederProvider, PET_FEEDER_MANUAL_FEED_MAX, PET_FEEDER_MANUAL_FEED_MIN, type PetFeederStatus, PetFeederStatusSchema, petFeederCapability, } from './pet-feeder.cap.js';
190
190
  export { type IPlateGalleryProvider, type PlateInfo, plateGalleryCapability, type Vehicle, type VehicleSampleInfo, } from './plate-gallery.cap.js';
191
191
  export { type HardwareDecodeAccels, type HardwareEncoderId, type HardwareEncoderProbe, type HardwareEncoders, type IPlatformProbeProvider, platformProbeCapability, } from './platform-probe.cap.js';
@@ -10,28 +10,35 @@ import { type InferProvider } from './capability-definition.js';
10
10
  *
11
11
  * This cap owns the other half: a per-(camera, slot) BINDING that says
12
12
  * which value feeds the slot, how it is formatted, and under which
13
- * conditions it is shown at all. One addon renders every binding on every
14
- * camera, so a new source costs zero driver code.
15
- *
16
- * Three deliberate choices, each with a rejected alternative:
17
- *
18
- * 1. A source is `(capName, valuePath)` over the kernel's device
19
- * runtime-state mirror — NOT a closed enum of source kinds. Every
20
- * cap-keyed slice a device publishes is bindable the day the cap
21
- * ships. The rejected alternative (one enum member per source, with
22
- * a resolver branch each) is what makes "add the humidity too" a
23
- * code change.
24
- * 2. The display gate reuses `NcConditionsSchema` verbatim — the
25
- * notification centre's condition vocabulary — rather than a parallel
26
- * model. An operator who has learned one condition editor has learned
27
- * both.
28
- * 3. Because the renderer's facts are device STATE and not a detection
29
- * record, only a SUBSET of that vocabulary can be answered here.
30
- * `setSlotBinding` REJECTS the rest at write time (see
31
- * `getConditionSupport`). It does not accept-then-fail-closed: a
32
- * condition that can never be true renders a permanently blank
33
- * overlay, and a blank overlay looks exactly like a broken camera.
13
+ * conditions it is shown at all. Named TEMPLATES combine many device
14
+ * fields into one overlay string (Scrypted OSD Manager parity).
34
15
  */
16
+ /** One field reference inside a named multi-device template. */
17
+ export declare const OsdTemplateFieldSchema: z.ZodObject<{
18
+ deviceId: z.ZodNumber;
19
+ capName: z.ZodString;
20
+ valuePath: z.ZodString;
21
+ displayUnit: z.ZodOptional<z.ZodString>;
22
+ maxDecimals: z.ZodDefault<z.ZodNumber>;
23
+ }, z.core.$strip>;
24
+ export type OsdTemplateField = z.infer<typeof OsdTemplateFieldSchema>;
25
+ /**
26
+ * A named template: several device fields → one parser string with
27
+ * `{deviceId.capName.valuePath}` tokens (Scrypted `{deviceId.sensorId}`).
28
+ */
29
+ export declare const OsdNamedTemplateSchema: z.ZodObject<{
30
+ id: z.ZodString;
31
+ name: z.ZodString;
32
+ fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
33
+ deviceId: z.ZodNumber;
34
+ capName: z.ZodString;
35
+ valuePath: z.ZodString;
36
+ displayUnit: z.ZodOptional<z.ZodString>;
37
+ maxDecimals: z.ZodDefault<z.ZodNumber>;
38
+ }, z.core.$strip>>>;
39
+ parser: z.ZodDefault<z.ZodString>;
40
+ }, z.core.$strip>;
41
+ export type OsdNamedTemplate = z.infer<typeof OsdNamedTemplateSchema>;
35
42
  /** Where a slot's value comes from. */
36
43
  export declare const OsdSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
37
44
  kind: z.ZodLiteral<"static">;
@@ -45,12 +52,16 @@ export declare const OsdSourceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
45
52
  deviceId: z.ZodOptional<z.ZodNumber>;
46
53
  capName: z.ZodString;
47
54
  valuePath: z.ZodString;
55
+ displayUnit: z.ZodOptional<z.ZodString>;
48
56
  }, z.core.$strip>, z.ZodObject<{
49
57
  kind: z.ZodLiteral<"latest-recognition">;
50
58
  recognition: z.ZodEnum<{
51
59
  person: "person";
52
60
  plate: "plate";
53
61
  }>;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ kind: z.ZodLiteral<"template">;
64
+ templateId: z.ZodString;
54
65
  }, z.core.$strip>], "kind">;
55
66
  export type OsdSource = z.infer<typeof OsdSourceSchema>;
56
67
  export declare const OsdSlotBindingSchema: z.ZodObject<{
@@ -67,12 +78,16 @@ export declare const OsdSlotBindingSchema: z.ZodObject<{
67
78
  deviceId: z.ZodOptional<z.ZodNumber>;
68
79
  capName: z.ZodString;
69
80
  valuePath: z.ZodString;
81
+ displayUnit: z.ZodOptional<z.ZodString>;
70
82
  }, z.core.$strip>, z.ZodObject<{
71
83
  kind: z.ZodLiteral<"latest-recognition">;
72
84
  recognition: z.ZodEnum<{
73
85
  person: "person";
74
86
  plate: "plate";
75
87
  }>;
88
+ }, z.core.$strip>, z.ZodObject<{
89
+ kind: z.ZodLiteral<"template">;
90
+ templateId: z.ZodString;
76
91
  }, z.core.$strip>], "kind">;
77
92
  template: z.ZodDefault<z.ZodString>;
78
93
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -252,12 +267,16 @@ export declare const OsdSlotViewSchema: z.ZodObject<{
252
267
  deviceId: z.ZodOptional<z.ZodNumber>;
253
268
  capName: z.ZodString;
254
269
  valuePath: z.ZodString;
270
+ displayUnit: z.ZodOptional<z.ZodString>;
255
271
  }, z.core.$strip>, z.ZodObject<{
256
272
  kind: z.ZodLiteral<"latest-recognition">;
257
273
  recognition: z.ZodEnum<{
258
274
  person: "person";
259
275
  plate: "plate";
260
276
  }>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ kind: z.ZodLiteral<"template">;
279
+ templateId: z.ZodString;
261
280
  }, z.core.$strip>], "kind">;
262
281
  template: z.ZodDefault<z.ZodString>;
263
282
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -509,12 +528,16 @@ export declare const osdManagerCapability: {
509
528
  deviceId: z.ZodOptional<z.ZodNumber>;
510
529
  capName: z.ZodString;
511
530
  valuePath: z.ZodString;
531
+ displayUnit: z.ZodOptional<z.ZodString>;
512
532
  }, z.core.$strip>, z.ZodObject<{
513
533
  kind: z.ZodLiteral<"latest-recognition">;
514
534
  recognition: z.ZodEnum<{
515
535
  person: "person";
516
536
  plate: "plate";
517
537
  }>;
538
+ }, z.core.$strip>, z.ZodObject<{
539
+ kind: z.ZodLiteral<"template">;
540
+ templateId: z.ZodString;
518
541
  }, z.core.$strip>], "kind">;
519
542
  template: z.ZodDefault<z.ZodString>;
520
543
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -785,12 +808,16 @@ export declare const osdManagerCapability: {
785
808
  deviceId: z.ZodOptional<z.ZodNumber>;
786
809
  capName: z.ZodString;
787
810
  valuePath: z.ZodString;
811
+ displayUnit: z.ZodOptional<z.ZodString>;
788
812
  }, z.core.$strip>, z.ZodObject<{
789
813
  kind: z.ZodLiteral<"latest-recognition">;
790
814
  recognition: z.ZodEnum<{
791
815
  person: "person";
792
816
  plate: "plate";
793
817
  }>;
818
+ }, z.core.$strip>, z.ZodObject<{
819
+ kind: z.ZodLiteral<"template">;
820
+ templateId: z.ZodString;
794
821
  }, z.core.$strip>], "kind">;
795
822
  template: z.ZodDefault<z.ZodString>;
796
823
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -969,12 +996,16 @@ export declare const osdManagerCapability: {
969
996
  deviceId: z.ZodOptional<z.ZodNumber>;
970
997
  capName: z.ZodString;
971
998
  valuePath: z.ZodString;
999
+ displayUnit: z.ZodOptional<z.ZodString>;
972
1000
  }, z.core.$strip>, z.ZodObject<{
973
1001
  kind: z.ZodLiteral<"latest-recognition">;
974
1002
  recognition: z.ZodEnum<{
975
1003
  person: "person";
976
1004
  plate: "plate";
977
1005
  }>;
1006
+ }, z.core.$strip>, z.ZodObject<{
1007
+ kind: z.ZodLiteral<"template">;
1008
+ templateId: z.ZodString;
978
1009
  }, z.core.$strip>], "kind">;
979
1010
  template: z.ZodDefault<z.ZodString>;
980
1011
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -1185,12 +1216,16 @@ export declare const osdManagerCapability: {
1185
1216
  deviceId: z.ZodOptional<z.ZodNumber>;
1186
1217
  capName: z.ZodString;
1187
1218
  valuePath: z.ZodString;
1219
+ displayUnit: z.ZodOptional<z.ZodString>;
1188
1220
  }, z.core.$strip>, z.ZodObject<{
1189
1221
  kind: z.ZodLiteral<"latest-recognition">;
1190
1222
  recognition: z.ZodEnum<{
1191
1223
  person: "person";
1192
1224
  plate: "plate";
1193
1225
  }>;
1226
+ }, z.core.$strip>, z.ZodObject<{
1227
+ kind: z.ZodLiteral<"template">;
1228
+ templateId: z.ZodString;
1194
1229
  }, z.core.$strip>], "kind">;
1195
1230
  template: z.ZodDefault<z.ZodString>;
1196
1231
  maxCharacters: z.ZodOptional<z.ZodNumber>;
@@ -1377,6 +1412,58 @@ export declare const osdManagerCapability: {
1377
1412
  reason: z.ZodOptional<z.ZodString>;
1378
1413
  }, z.core.$strip>>;
1379
1414
  }, z.core.$strip>, "mutation">;
1415
+ /** Every named multi-device template. */
1416
+ readonly listTemplates: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
1417
+ templates: z.ZodArray<z.ZodObject<{
1418
+ id: z.ZodString;
1419
+ name: z.ZodString;
1420
+ fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
1421
+ deviceId: z.ZodNumber;
1422
+ capName: z.ZodString;
1423
+ valuePath: z.ZodString;
1424
+ displayUnit: z.ZodOptional<z.ZodString>;
1425
+ maxDecimals: z.ZodDefault<z.ZodNumber>;
1426
+ }, z.core.$strip>>>;
1427
+ parser: z.ZodDefault<z.ZodString>;
1428
+ }, z.core.$strip>>;
1429
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
1430
+ /**
1431
+ * Create or replace a named template by `id`. Returns the stored record
1432
+ * after Zod normalisation.
1433
+ */
1434
+ readonly upsertTemplate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1435
+ template: z.ZodObject<{
1436
+ id: z.ZodString;
1437
+ name: z.ZodString;
1438
+ fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
1439
+ deviceId: z.ZodNumber;
1440
+ capName: z.ZodString;
1441
+ valuePath: z.ZodString;
1442
+ displayUnit: z.ZodOptional<z.ZodString>;
1443
+ maxDecimals: z.ZodDefault<z.ZodNumber>;
1444
+ }, z.core.$strip>>>;
1445
+ parser: z.ZodDefault<z.ZodString>;
1446
+ }, z.core.$strip>;
1447
+ }, z.core.$strip>, z.ZodObject<{
1448
+ template: z.ZodObject<{
1449
+ id: z.ZodString;
1450
+ name: z.ZodString;
1451
+ fields: z.ZodDefault<z.ZodArray<z.ZodObject<{
1452
+ deviceId: z.ZodNumber;
1453
+ capName: z.ZodString;
1454
+ valuePath: z.ZodString;
1455
+ displayUnit: z.ZodOptional<z.ZodString>;
1456
+ maxDecimals: z.ZodDefault<z.ZodNumber>;
1457
+ }, z.core.$strip>>>;
1458
+ parser: z.ZodDefault<z.ZodString>;
1459
+ }, z.core.$strip>;
1460
+ }, z.core.$strip>, "mutation">;
1461
+ /** Drop a named template. Bindings that still reference it render unreadable. */
1462
+ readonly deleteTemplate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
1463
+ templateId: z.ZodString;
1464
+ }, z.core.$strip>, z.ZodObject<{
1465
+ success: z.ZodLiteral<true>;
1466
+ }, z.core.$strip>, "mutation">;
1380
1467
  };
1381
1468
  };
1382
1469
  export type IOsdManagerProvider = InferProvider<typeof osdManagerCapability>;
@@ -1401,6 +1401,13 @@ declare const KeyEventSchema: z.ZodObject<{
1401
1401
  importance: z.ZodNumber;
1402
1402
  bestEventId: z.ZodString;
1403
1403
  windowMs: z.ZodOptional<z.ZodNumber>;
1404
+ audioLabels: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1405
+ label: z.ZodString;
1406
+ peakScore: z.ZodNumber;
1407
+ count: z.ZodNumber;
1408
+ firstAt: z.ZodNumber;
1409
+ lastAt: z.ZodNumber;
1410
+ }, z.core.$strip>>>>;
1404
1411
  label: z.ZodOptional<z.ZodString>;
1405
1412
  labelScore: z.ZodOptional<z.ZodNumber>;
1406
1413
  labelMeta: z.ZodOptional<z.ZodObject<{
@@ -1448,6 +1455,13 @@ declare const KeyEventsForDeviceSchema: z.ZodObject<{
1448
1455
  importance: z.ZodNumber;
1449
1456
  bestEventId: z.ZodString;
1450
1457
  windowMs: z.ZodOptional<z.ZodNumber>;
1458
+ audioLabels: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
1459
+ label: z.ZodString;
1460
+ peakScore: z.ZodNumber;
1461
+ count: z.ZodNumber;
1462
+ firstAt: z.ZodNumber;
1463
+ lastAt: z.ZodNumber;
1464
+ }, z.core.$strip>>>>;
1451
1465
  label: z.ZodOptional<z.ZodString>;
1452
1466
  labelScore: z.ZodOptional<z.ZodNumber>;
1453
1467
  labelMeta: z.ZodOptional<z.ZodObject<{
@@ -2645,6 +2659,13 @@ export declare const pipelineAnalyticsCapability: {
2645
2659
  importance: z.ZodNumber;
2646
2660
  bestEventId: z.ZodString;
2647
2661
  windowMs: z.ZodOptional<z.ZodNumber>;
2662
+ audioLabels: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
2663
+ label: z.ZodString;
2664
+ peakScore: z.ZodNumber;
2665
+ count: z.ZodNumber;
2666
+ firstAt: z.ZodNumber;
2667
+ lastAt: z.ZodNumber;
2668
+ }, z.core.$strip>>>>;
2648
2669
  label: z.ZodOptional<z.ZodString>;
2649
2670
  labelScore: z.ZodOptional<z.ZodNumber>;
2650
2671
  labelMeta: z.ZodOptional<z.ZodObject<{
@@ -2702,6 +2723,13 @@ export declare const pipelineAnalyticsCapability: {
2702
2723
  importance: z.ZodNumber;
2703
2724
  bestEventId: z.ZodString;
2704
2725
  windowMs: z.ZodOptional<z.ZodNumber>;
2726
+ audioLabels: z.ZodOptional<z.ZodReadonly<z.ZodArray<z.ZodObject<{
2727
+ label: z.ZodString;
2728
+ peakScore: z.ZodNumber;
2729
+ count: z.ZodNumber;
2730
+ firstAt: z.ZodNumber;
2731
+ lastAt: z.ZodNumber;
2732
+ }, z.core.$strip>>>>;
2705
2733
  label: z.ZodOptional<z.ZodString>;
2706
2734
  labelScore: z.ZodOptional<z.ZodNumber>;
2707
2735
  labelMeta: z.ZodOptional<z.ZodObject<{
@@ -12,5 +12,6 @@ export * from './evaluate-field.js';
12
12
  export * from './examples.js';
13
13
  export * from './expression-kinds.js';
14
14
  export * from './presets/doorbell-feature.js';
15
+ export * from './presets/numeric-transforms.js';
15
16
  export * from './state-fields.js';
16
17
  export * from './validate-composition.js';
@@ -0,0 +1,19 @@
1
+ import type { CompositionFieldsFeature, CompositionSourceRef } from '../composition.js';
2
+ /** Source caps whose active boolean may be inverted: catalogue minus switch
3
+ * (commands) and motion (event stream, D672). */
4
+ export declare const INVERTIBLE_CAPS: readonly string[];
5
+ export interface InvertPresetInput {
6
+ readonly self: CompositionSourceRef;
7
+ readonly cap: string;
8
+ }
9
+ export declare function invertPresetFeature(input: InvertPresetInput): CompositionFieldsFeature | null;
10
+ export interface ConvertPresetInput {
11
+ readonly self: CompositionSourceRef;
12
+ readonly cap: string;
13
+ readonly fieldPath: string;
14
+ readonly from: string;
15
+ readonly to: string;
16
+ /** Cap top-level `unit` field replaced with `to`; null when the cap has none. */
17
+ readonly unitField: string | null;
18
+ }
19
+ export declare function convertPresetFeature(input: ConvertPresetInput): CompositionFieldsFeature | null;
@@ -1159,6 +1159,11 @@ function evaluateRose(level, changedAt, debounceMs, call, field, env) {
1159
1159
  const timestamp = typeof changedAt === "number" && Number.isFinite(changedAt) ? changedAt : null;
1160
1160
  const debounce = debounceMs === void 0 ? DEFAULT_ROSE_DEBOUNCE_MS : asFiniteNumber(debounceMs, "rose", 2);
1161
1161
  if (debounce < 0) throw new ExpressionEvalError("rose: debounce must be a non-negative finite number");
1162
+ if (call.disarmNext === true || field.disarmRoseNext) {
1163
+ call.disarmNext = false;
1164
+ if (call.priorLevel === void 0) call.priorLevel = active;
1165
+ return env.currentOutput;
1166
+ }
1162
1167
  const verdict = evaluateSensorLevelEdge({
1163
1168
  level: active,
1164
1169
  changedAt: timestamp,
@@ -1173,6 +1178,17 @@ function evaluateRose(level, changedAt, debounceMs, call, field, env) {
1173
1178
  field.acceptedEdgeAt = verdict.timestamp;
1174
1179
  return verdict.timestamp;
1175
1180
  }
1181
+ /** Next evaluation of every `rose` call baselines without rising. */
1182
+ function disarmRoseMemory(memory) {
1183
+ memory.disarmRoseNext = true;
1184
+ for (const [path, call] of memory.calls) {
1185
+ if (call.kind !== "rose") continue;
1186
+ memory.calls.set(path, {
1187
+ ...call,
1188
+ disarmNext: true
1189
+ });
1190
+ }
1191
+ }
1176
1192
  /**
1177
1193
  * `count(x)`: how many times `x` strictly advanced (D670). It starts on the
1178
1194
  * first ANSWERED read of `x`:
@@ -1926,13 +1942,15 @@ function evaluateAst(node, scope, opts) {
1926
1942
  function createStatefulExpressionMemory() {
1927
1943
  return {
1928
1944
  calls: /* @__PURE__ */ new Map(),
1929
- acceptedEdgeAt: null
1945
+ acceptedEdgeAt: null,
1946
+ disarmRoseNext: false
1930
1947
  };
1931
1948
  }
1932
1949
  function cloneStatefulExpressionMemory(memory) {
1933
1950
  return {
1934
1951
  calls: new Map([...memory.calls].map(([path, call]) => [path, { ...call }])),
1935
- acceptedEdgeAt: memory.acceptedEdgeAt
1952
+ acceptedEdgeAt: memory.acceptedEdgeAt,
1953
+ disarmRoseNext: memory.disarmRoseNext
1936
1954
  };
1937
1955
  }
1938
1956
  function evaluateStatefulExpressionCall(invocation, memory, env) {
@@ -2668,6 +2686,12 @@ Object.defineProperty(exports, "createStatefulExpressionMemory", {
2668
2686
  return createStatefulExpressionMemory;
2669
2687
  }
2670
2688
  });
2689
+ Object.defineProperty(exports, "disarmRoseMemory", {
2690
+ enumerable: true,
2691
+ get: function() {
2692
+ return disarmRoseMemory;
2693
+ }
2694
+ });
2671
2695
  Object.defineProperty(exports, "evaluateAst", {
2672
2696
  enumerable: true,
2673
2697
  get: function() {
@@ -1159,6 +1159,11 @@ function evaluateRose(level, changedAt, debounceMs, call, field, env) {
1159
1159
  const timestamp = typeof changedAt === "number" && Number.isFinite(changedAt) ? changedAt : null;
1160
1160
  const debounce = debounceMs === void 0 ? DEFAULT_ROSE_DEBOUNCE_MS : asFiniteNumber(debounceMs, "rose", 2);
1161
1161
  if (debounce < 0) throw new ExpressionEvalError("rose: debounce must be a non-negative finite number");
1162
+ if (call.disarmNext === true || field.disarmRoseNext) {
1163
+ call.disarmNext = false;
1164
+ if (call.priorLevel === void 0) call.priorLevel = active;
1165
+ return env.currentOutput;
1166
+ }
1162
1167
  const verdict = evaluateSensorLevelEdge({
1163
1168
  level: active,
1164
1169
  changedAt: timestamp,
@@ -1173,6 +1178,17 @@ function evaluateRose(level, changedAt, debounceMs, call, field, env) {
1173
1178
  field.acceptedEdgeAt = verdict.timestamp;
1174
1179
  return verdict.timestamp;
1175
1180
  }
1181
+ /** Next evaluation of every `rose` call baselines without rising. */
1182
+ function disarmRoseMemory(memory) {
1183
+ memory.disarmRoseNext = true;
1184
+ for (const [path, call] of memory.calls) {
1185
+ if (call.kind !== "rose") continue;
1186
+ memory.calls.set(path, {
1187
+ ...call,
1188
+ disarmNext: true
1189
+ });
1190
+ }
1191
+ }
1176
1192
  /**
1177
1193
  * `count(x)`: how many times `x` strictly advanced (D670). It starts on the
1178
1194
  * first ANSWERED read of `x`:
@@ -1926,13 +1942,15 @@ function evaluateAst(node, scope, opts) {
1926
1942
  function createStatefulExpressionMemory() {
1927
1943
  return {
1928
1944
  calls: /* @__PURE__ */ new Map(),
1929
- acceptedEdgeAt: null
1945
+ acceptedEdgeAt: null,
1946
+ disarmRoseNext: false
1930
1947
  };
1931
1948
  }
1932
1949
  function cloneStatefulExpressionMemory(memory) {
1933
1950
  return {
1934
1951
  calls: new Map([...memory.calls].map(([path, call]) => [path, { ...call }])),
1935
- acceptedEdgeAt: memory.acceptedEdgeAt
1952
+ acceptedEdgeAt: memory.acceptedEdgeAt,
1953
+ disarmRoseNext: memory.disarmRoseNext
1936
1954
  };
1937
1955
  }
1938
1956
  function evaluateStatefulExpressionCall(invocation, memory, env) {
@@ -2260,4 +2278,4 @@ function featureSources(feature) {
2260
2278
  return featureFieldEntries(feature).map((e) => e.source);
2261
2279
  }
2262
2280
  //#endregion
2263
- export { MAX_EXPRESSION_AST_NODES as $, compositionFeatureEnabled as A, AUDIO_PRESETS as At, createStatefulExpressionMemory as B, resolveStreamMaps as Bt, CompositionTargetSchema as C, chooseFfmpegBinary as Ct, MAX_COMPOSITION_ITEMS as D, getFfmpegDownloadUrl as Dt, MAX_COMPOSITION_FIELDS_PER_FEATURE as E, getFfmpegArtifact as Et, featureFieldEntries as F, buildVideoArgs as Ft, createExpressionScope as G, evaluateStatefulExpressionCall as H, featureSources as I, invocationFromEncodeProfile as It, compileExpressionSafe as J, evaluateAst as K, fieldReads as L, isSoftwareDecode as Lt, compositionReadKey as M, buildAudioArgs as Mt, compositionSliceKey as N, buildFfmpegArgs as Nt, composedDeviceRef as O, canonicalHash as Ot, compositionSourceKey as P, buildInputArgs as Pt, EXPRESSION_IDENTIFIER_RE as Q, EXPRESSION_INJECTED_NOW as R, logBannerArgs as Rt, CompositionSourceRefSchema as S, FFMPEG_PATH_ENV as St, MAX_COMPOSITION_FEATURES as T, FFMPEG_RELEASE as Tt, toExpressionValue as U, evaluateExpressionSource as V, validateExpressionSource as W, tokenize as X, parseExpression as Y, EXPRESSION_COMPILE_CACHE_CAPACITY as Z, CompositionItemEntrySchema as _, evaluateSensorEdge as _t, CUSTOMIZATION_BLOCK_NAME_PREFIX as a, EXPRESSION_BUILTINS as at, CompositionPassthroughFeatureSchema as b, sliceActiveValue as bt, CompositionCommandTargetSchema as c, evaluateRose as ct, CompositionFeatureSchema as d, ExpressionParseError as dt, MAX_EXPRESSION_BINDINGS as et, CompositionFieldReadSchema as f, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as ft, CompositionFromSourceSchema as g, SOURCE_DEVICE_TYPES as gt, CompositionForwardCommandSchema as h, SOURCE_CAP_CHANGED_AT_FIELD as ht, COMPOSITION_ITEM_KEY_RE as i, RESERVED_BINDING_NAMES as it, compositionItemFieldPath as j, audioPlanFromEncodeProfile as jt, composedDeviceStableId as k, Fmp4BoxSplitter as kt, CompositionExistingTargetSchema as l, isStatefulBuiltin as lt, CompositionFieldsFeatureSchema as m, SOURCE_CAP_ACTIVE_FIELD as mt, COMPOSER_ADDON_ID as n, MAX_EXPRESSION_EVAL_STEPS as nt, CompositionBindingSchema as o, EXPRESSION_BUILTIN_NAMES as ot, CompositionFieldSourceSchema as p, SOURCE_CAPS as pt, compileExpression as q, COMPOSITION_ITEM_ARRAY_PATH as r, MAX_EXPRESSION_SOURCE_LENGTH as rt, CompositionCodeSourceSchema as s, evaluateCount as st, COMPOSED_DEVICE_STABLE_ID_PREFIX as t, MAX_EXPRESSION_CALL_ARGS as tt, CompositionExpressionSourceSchema as u, ExpressionEvalError as ut, CompositionLiteralBindingSchema as v, evaluateSensorLevelEdge as vt, MAX_COMPOSITION_CODE_LENGTH as w, ffmpegBinaryName as wt, CompositionSchema as x, sliceChangedAt as xt, CompositionNewTargetSchema as y, isSourceCap as yt, cloneStatefulExpressionMemory as z, pickVideoEncoder as zt };
2281
+ export { MAX_EXPRESSION_AST_NODES as $, compositionFeatureEnabled as A, Fmp4BoxSplitter as At, createStatefulExpressionMemory as B, pickVideoEncoder as Bt, CompositionTargetSchema as C, FFMPEG_PATH_ENV as Ct, MAX_COMPOSITION_ITEMS as D, getFfmpegArtifact as Dt, MAX_COMPOSITION_FIELDS_PER_FEATURE as E, FFMPEG_RELEASE as Et, featureFieldEntries as F, buildInputArgs as Ft, createExpressionScope as G, evaluateStatefulExpressionCall as H, featureSources as I, buildVideoArgs as It, compileExpressionSafe as J, evaluateAst as K, fieldReads as L, invocationFromEncodeProfile as Lt, compositionReadKey as M, audioPlanFromEncodeProfile as Mt, compositionSliceKey as N, buildAudioArgs as Nt, composedDeviceRef as O, getFfmpegDownloadUrl as Ot, compositionSourceKey as P, buildFfmpegArgs as Pt, EXPRESSION_IDENTIFIER_RE as Q, EXPRESSION_INJECTED_NOW as R, isSoftwareDecode as Rt, CompositionSourceRefSchema as S, sliceChangedAt as St, MAX_COMPOSITION_FEATURES as T, ffmpegBinaryName as Tt, toExpressionValue as U, evaluateExpressionSource as V, resolveStreamMaps as Vt, validateExpressionSource as W, tokenize as X, parseExpression as Y, EXPRESSION_COMPILE_CACHE_CAPACITY as Z, CompositionItemEntrySchema as _, SOURCE_DEVICE_TYPES as _t, CUSTOMIZATION_BLOCK_NAME_PREFIX as a, EXPRESSION_BUILTINS as at, CompositionPassthroughFeatureSchema as b, isSourceCap as bt, CompositionCommandTargetSchema as c, evaluateCount as ct, CompositionFeatureSchema as d, ExpressionEvalError as dt, MAX_EXPRESSION_BINDINGS as et, CompositionFieldReadSchema as f, ExpressionParseError as ft, CompositionFromSourceSchema as g, SOURCE_CAP_CHANGED_AT_FIELD as gt, CompositionForwardCommandSchema as h, SOURCE_CAP_ACTIVE_FIELD as ht, COMPOSITION_ITEM_KEY_RE as i, RESERVED_BINDING_NAMES as it, compositionItemFieldPath as j, AUDIO_PRESETS as jt, composedDeviceStableId as k, canonicalHash as kt, CompositionExistingTargetSchema as l, evaluateRose as lt, CompositionFieldsFeatureSchema as m, SOURCE_CAPS as mt, COMPOSER_ADDON_ID as n, MAX_EXPRESSION_EVAL_STEPS as nt, CompositionBindingSchema as o, EXPRESSION_BUILTIN_NAMES as ot, CompositionFieldSourceSchema as p, DEFAULT_FIRST_SIGHTING_FRESHNESS_MS as pt, compileExpression as q, COMPOSITION_ITEM_ARRAY_PATH as r, MAX_EXPRESSION_SOURCE_LENGTH as rt, CompositionCodeSourceSchema as s, disarmRoseMemory as st, COMPOSED_DEVICE_STABLE_ID_PREFIX as t, MAX_EXPRESSION_CALL_ARGS as tt, CompositionExpressionSourceSchema as u, isStatefulBuiltin as ut, CompositionLiteralBindingSchema as v, evaluateSensorEdge as vt, MAX_COMPOSITION_CODE_LENGTH as w, chooseFfmpegBinary as wt, CompositionSchema as x, sliceActiveValue as xt, CompositionNewTargetSchema as y, evaluateSensorLevelEdge as yt, cloneStatefulExpressionMemory as z, logBannerArgs as zt };
@@ -48,6 +48,8 @@ export declare function evaluateRose(level: unknown, changedAt: unknown, debounc
48
48
  readonly startedAtMs: number;
49
49
  readonly nowMs: number;
50
50
  }): number | null;
51
+ /** Next evaluation of every `rose` call baselines without rising. */
52
+ export declare function disarmRoseMemory(memory: StatefulExpressionMemory): void;
51
53
  /**
52
54
  * `count(x)`: how many times `x` strictly advanced (D670). It starts on the
53
55
  * first ANSWERED read of `x`:
@@ -13,6 +13,13 @@ import { type ExpressionEvalOptions, type StatefulCallInvocation } from './evalu
13
13
  export interface RoseCallState {
14
14
  readonly kind: 'rose';
15
15
  priorLevel?: boolean;
16
+ /**
17
+ * Next evaluation seeds `priorLevel` from the current level and emits no
18
+ * edge. Set when a binding recovers from confirmed-unavailable (provider
19
+ * restart / unregister flap): inventing a false→true rise from the restore
20
+ * seed is a synthetic press (D49 inverse).
21
+ */
22
+ disarmNext?: boolean;
16
23
  }
17
24
  export interface CountCallState {
18
25
  readonly kind: 'count';
@@ -24,6 +31,11 @@ export type StatefulCallState = RoseCallState | CountCallState;
24
31
  export interface StatefulExpressionMemory {
25
32
  readonly calls: Map<string, StatefulCallState>;
26
33
  acceptedEdgeAt: number | null;
34
+ /**
35
+ * Every `rose` call in the next successful evaluation baselines without
36
+ * rising. Set when the field recovers from unavailable (binding flap).
37
+ */
38
+ disarmRoseNext: boolean;
27
39
  }
28
40
  export declare function createStatefulExpressionMemory(): StatefulExpressionMemory;
29
41
  export declare function cloneStatefulExpressionMemory(memory: StatefulExpressionMemory): StatefulExpressionMemory;
@@ -13,7 +13,7 @@ export type { ExpressionBinaryNode, ExpressionBinaryOperator, ExpressionCallNode
13
13
  export type { ExpressionBindingSource, ExpressionFieldBinding, ExpressionGlobalBinding, ExpressionLiteralBinding, ExpressionSource, } from './binding-source.js';
14
14
  export { ExpressionBindingSourceSchema, ExpressionFieldBindingSchema, ExpressionGlobalBindingSchema, ExpressionLiteralBindingSchema, ExpressionSourceSchema, } from './binding-source.js';
15
15
  export type { ExpressionBuiltin, ExpressionEvalHooks, StatefulExpressionBuiltin, } from './builtins.js';
16
- export { evaluateCount, evaluateRose, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, isStatefulBuiltin, } from './builtins.js';
16
+ export { disarmRoseMemory, evaluateCount, evaluateRose, EXPRESSION_BUILTIN_NAMES, EXPRESSION_BUILTINS, isStatefulBuiltin, } from './builtins.js';
17
17
  export type { CompileResult } from './compile.js';
18
18
  export { compileExpression, compileExpressionSafe } from './compile.js';
19
19
  export { ExpressionEvalError, ExpressionParseError } from './errors.js';
@@ -5271,6 +5271,27 @@ export type AppRouter = TrpcCoreRouter<{
5271
5271
  output: z.infer<typeof osdManagerCapability.methods.renderDevice.output>;
5272
5272
  meta: object;
5273
5273
  }>;
5274
+ listTemplates: TRPCQueryProcedure<{
5275
+ input: {
5276
+ [x: string]: unknown;
5277
+ } & z.input<typeof osdManagerCapability.methods.listTemplates.input>;
5278
+ output: z.infer<typeof osdManagerCapability.methods.listTemplates.output>;
5279
+ meta: object;
5280
+ }>;
5281
+ upsertTemplate: TRPCMutationProcedure<{
5282
+ input: {
5283
+ [x: string]: unknown;
5284
+ } & z.input<typeof osdManagerCapability.methods.upsertTemplate.input>;
5285
+ output: z.infer<typeof osdManagerCapability.methods.upsertTemplate.output>;
5286
+ meta: object;
5287
+ }>;
5288
+ deleteTemplate: TRPCMutationProcedure<{
5289
+ input: {
5290
+ [x: string]: unknown;
5291
+ } & z.input<typeof osdManagerCapability.methods.deleteTemplate.input>;
5292
+ output: z.infer<typeof osdManagerCapability.methods.deleteTemplate.output>;
5293
+ meta: object;
5294
+ }>;
5274
5295
  }>>;
5275
5296
  petFeeder: TRPCBuiltRouter<{
5276
5297
  ctx: TrpcContext;
@@ -11,7 +11,7 @@
11
11
  * Plain data, zero Zod: a forked runner must not import the schema barrel
12
12
  * (~144MB RSS per runner — D28).
13
13
  *
14
- * Coverage: 24 caps, 57 methods with defaults.
14
+ * Coverage: 24 caps, 58 methods with defaults.
15
15
  */
16
16
  export declare const CAP_INPUT_DEFAULTS: Readonly<Record<string, Readonly<Record<string, Readonly<Record<string, unknown>>>>>>;
17
17
  /**
@@ -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: 1199 method paths across 163 capabilities.
9
+ * Coverage: 1202 method paths across 163 capabilities.
10
10
  */
11
11
  import type { CapabilityMethodAccess } from '../capabilities/capability-definition.js';
12
12
  export interface MethodAccessRecord {