@camstack/types 0.1.39 → 0.1.41
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/base-addon.d.ts +14 -2
- package/dist/addon/base-addon.d.ts.map +1 -1
- package/dist/addon/durable-state.d.ts +33 -0
- package/dist/addon/durable-state.d.ts.map +1 -0
- package/dist/capabilities/accessories.cap.d.ts +56 -8
- package/dist/capabilities/accessories.cap.d.ts.map +1 -1
- package/dist/capabilities/addon-settings.cap.d.ts +1 -0
- package/dist/capabilities/addon-settings.cap.d.ts.map +1 -1
- package/dist/capabilities/addons.cap.d.ts +187 -1
- package/dist/capabilities/addons.cap.d.ts.map +1 -1
- package/dist/capabilities/advanced-notifier.cap.d.ts +4 -0
- package/dist/capabilities/advanced-notifier.cap.d.ts.map +1 -1
- package/dist/capabilities/air-quality-sensor.cap.d.ts +56 -0
- package/dist/capabilities/air-quality-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/alarm-panel.cap.d.ts +154 -0
- package/dist/capabilities/alarm-panel.cap.d.ts.map +1 -0
- package/dist/capabilities/alerts.cap.d.ts +5 -5
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +39 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/audio-analyzer.cap.d.ts +2 -2
- package/dist/capabilities/automation-control.cap.d.ts +65 -0
- package/dist/capabilities/automation-control.cap.d.ts.map +1 -0
- package/dist/capabilities/battery.cap.d.ts +30 -1
- package/dist/capabilities/battery.cap.d.ts.map +1 -1
- package/dist/capabilities/binary.cap.d.ts +40 -0
- package/dist/capabilities/binary.cap.d.ts.map +1 -0
- package/dist/capabilities/brightness.cap.d.ts +3 -2
- package/dist/capabilities/brightness.cap.d.ts.map +1 -1
- package/dist/capabilities/broker.cap.d.ts +291 -0
- package/dist/capabilities/broker.cap.d.ts.map +1 -0
- package/dist/capabilities/button.cap.d.ts +27 -0
- package/dist/capabilities/button.cap.d.ts.map +1 -0
- package/dist/capabilities/camera-credentials.cap.d.ts +1 -0
- package/dist/capabilities/camera-credentials.cap.d.ts.map +1 -1
- package/dist/capabilities/camera-pipeline-config.cap.d.ts +43 -0
- package/dist/capabilities/camera-pipeline-config.cap.d.ts.map +1 -0
- package/dist/capabilities/camera-streams.cap.d.ts +147 -10
- package/dist/capabilities/camera-streams.cap.d.ts.map +1 -1
- package/dist/capabilities/capability-definition.d.ts +15 -0
- package/dist/capabilities/capability-definition.d.ts.map +1 -1
- package/dist/capabilities/carbon-monoxide.cap.d.ts +33 -0
- package/dist/capabilities/carbon-monoxide.cap.d.ts.map +1 -0
- package/dist/capabilities/climate-control.cap.d.ts +183 -0
- package/dist/capabilities/climate-control.cap.d.ts.map +1 -0
- package/dist/capabilities/color.cap.d.ts +186 -0
- package/dist/capabilities/color.cap.d.ts.map +1 -0
- package/dist/capabilities/connectivity.cap.d.ts +37 -0
- package/dist/capabilities/connectivity.cap.d.ts.map +1 -0
- package/dist/capabilities/consumables.cap.d.ts +105 -0
- package/dist/capabilities/consumables.cap.d.ts.map +1 -0
- package/dist/capabilities/contact.cap.d.ts +41 -0
- package/dist/capabilities/contact.cap.d.ts.map +1 -0
- package/dist/capabilities/control.cap.d.ts +167 -0
- package/dist/capabilities/control.cap.d.ts.map +1 -0
- package/dist/capabilities/cover.cap.d.ts +104 -0
- package/dist/capabilities/cover.cap.d.ts.map +1 -0
- package/dist/capabilities/custom-actions.d.ts +6 -0
- package/dist/capabilities/custom-actions.d.ts.map +1 -1
- package/dist/capabilities/decoder.cap.d.ts +1 -1
- package/dist/capabilities/device-adoption.cap.d.ts +203 -0
- package/dist/capabilities/device-adoption.cap.d.ts.map +1 -0
- package/dist/capabilities/device-discovery.cap.d.ts +44 -143
- package/dist/capabilities/device-discovery.cap.d.ts.map +1 -1
- package/dist/capabilities/device-manager.cap.d.ts +469 -0
- package/dist/capabilities/device-manager.cap.d.ts.map +1 -1
- package/dist/capabilities/device-ops.cap.d.ts +30 -0
- package/dist/capabilities/device-ops.cap.d.ts.map +1 -1
- package/dist/capabilities/device-provider.cap.d.ts +36 -0
- package/dist/capabilities/device-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/device-status.cap.d.ts +1 -0
- package/dist/capabilities/device-status.cap.d.ts.map +1 -1
- package/dist/capabilities/doorbell.cap.d.ts +1 -0
- package/dist/capabilities/doorbell.cap.d.ts.map +1 -1
- package/dist/capabilities/enum-sensor.cap.d.ts +60 -0
- package/dist/capabilities/enum-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/event-emitter.cap.d.ts +79 -0
- package/dist/capabilities/event-emitter.cap.d.ts.map +1 -0
- package/dist/capabilities/fan-control.cap.d.ts +100 -0
- package/dist/capabilities/fan-control.cap.d.ts.map +1 -0
- package/dist/capabilities/feature-probe.cap.d.ts +1 -0
- package/dist/capabilities/feature-probe.cap.d.ts.map +1 -1
- package/dist/capabilities/flood.cap.d.ts +37 -0
- package/dist/capabilities/flood.cap.d.ts.map +1 -0
- package/dist/capabilities/gas.cap.d.ts +34 -0
- package/dist/capabilities/gas.cap.d.ts.map +1 -0
- package/dist/capabilities/humidifier.cap.d.ts +82 -0
- package/dist/capabilities/humidifier.cap.d.ts.map +1 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +43 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/image.cap.d.ts +44 -0
- package/dist/capabilities/image.cap.d.ts.map +1 -0
- package/dist/capabilities/index.d.ts +103 -15
- package/dist/capabilities/index.d.ts.map +1 -1
- package/dist/capabilities/integrations.cap.d.ts +12 -0
- package/dist/capabilities/integrations.cap.d.ts.map +1 -1
- package/dist/capabilities/intercom.cap.d.ts +49 -9
- package/dist/capabilities/intercom.cap.d.ts.map +1 -1
- package/dist/capabilities/lawn-mower-control.cap.d.ts +83 -0
- package/dist/capabilities/lawn-mower-control.cap.d.ts.map +1 -0
- package/dist/capabilities/local-network.cap.d.ts +1 -1
- package/dist/capabilities/lock-control.cap.d.ts +92 -0
- package/dist/capabilities/lock-control.cap.d.ts.map +1 -0
- package/dist/capabilities/mask-shape.d.ts +99 -0
- package/dist/capabilities/mask-shape.d.ts.map +1 -0
- package/dist/capabilities/media-player.cap.d.ts +201 -0
- package/dist/capabilities/media-player.cap.d.ts.map +1 -0
- package/dist/capabilities/mesh-network.cap.d.ts +3 -3
- package/dist/capabilities/motion-trigger.cap.d.ts +1 -0
- package/dist/capabilities/motion-trigger.cap.d.ts.map +1 -1
- package/dist/capabilities/motion-zones.cap.d.ts +95 -13
- package/dist/capabilities/motion-zones.cap.d.ts.map +1 -1
- package/dist/capabilities/mqtt-broker.cap.d.ts +3 -3
- package/dist/capabilities/native-object-detection.cap.d.ts +74 -3
- package/dist/capabilities/native-object-detection.cap.d.ts.map +1 -1
- package/dist/capabilities/network-access.cap.d.ts +7 -7
- package/dist/capabilities/network-quality.cap.d.ts +5 -0
- package/dist/capabilities/network-quality.cap.d.ts.map +1 -1
- package/dist/capabilities/notifier.cap.d.ts +173 -0
- package/dist/capabilities/notifier.cap.d.ts.map +1 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts +52 -0
- package/dist/capabilities/numeric-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/oauth-integration.cap.d.ts +4 -2
- package/dist/capabilities/oauth-integration.cap.d.ts.map +1 -1
- package/dist/capabilities/osd.cap.d.ts +1 -0
- package/dist/capabilities/osd.cap.d.ts.map +1 -1
- package/dist/capabilities/pipeline-analytics.cap.d.ts +69 -22
- package/dist/capabilities/pipeline-analytics.cap.d.ts.map +1 -1
- package/dist/capabilities/pipeline-executor.cap.d.ts +2 -2
- package/dist/capabilities/pipeline-orchestrator.cap.d.ts +1 -1
- package/dist/capabilities/pipeline-runner.cap.d.ts +4 -2
- package/dist/capabilities/pipeline-runner.cap.d.ts.map +1 -1
- package/dist/capabilities/platform-probe.cap.d.ts +25 -0
- package/dist/capabilities/platform-probe.cap.d.ts.map +1 -1
- package/dist/capabilities/power-meter.cap.d.ts +65 -0
- package/dist/capabilities/power-meter.cap.d.ts.map +1 -0
- package/dist/capabilities/presence.cap.d.ts +79 -0
- package/dist/capabilities/presence.cap.d.ts.map +1 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts +43 -0
- package/dist/capabilities/pressure-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/privacy-mask.cap.d.ts +207 -0
- package/dist/capabilities/privacy-mask.cap.d.ts.map +1 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts +1 -0
- package/dist/capabilities/ptz-autotrack.cap.d.ts.map +1 -1
- package/dist/capabilities/ptz.cap.d.ts +1 -0
- package/dist/capabilities/ptz.cap.d.ts.map +1 -1
- package/dist/capabilities/reboot.cap.d.ts +1 -0
- package/dist/capabilities/reboot.cap.d.ts.map +1 -1
- package/dist/capabilities/recording.cap.d.ts +238 -32
- package/dist/capabilities/recording.cap.d.ts.map +1 -1
- package/dist/capabilities/restreamer.cap.d.ts +2 -2
- package/dist/capabilities/schemas/detection-shared.d.ts +14 -1
- package/dist/capabilities/schemas/detection-shared.d.ts.map +1 -1
- package/dist/capabilities/schemas/orchestrator-metrics.d.ts +2 -2
- package/dist/capabilities/schemas/streaming-shared.d.ts +64 -1
- package/dist/capabilities/schemas/streaming-shared.d.ts.map +1 -1
- package/dist/capabilities/script-runner.cap.d.ts +62 -0
- package/dist/capabilities/script-runner.cap.d.ts.map +1 -0
- package/dist/capabilities/settings-store.cap.d.ts +25 -0
- package/dist/capabilities/settings-store.cap.d.ts.map +1 -1
- package/dist/capabilities/smoke.cap.d.ts +38 -0
- package/dist/capabilities/smoke.cap.d.ts.map +1 -0
- package/dist/capabilities/snapshot-provider.cap.d.ts +1 -1
- package/dist/capabilities/snapshot.cap.d.ts +1 -0
- package/dist/capabilities/snapshot.cap.d.ts.map +1 -1
- package/dist/capabilities/sso-bridge.cap.d.ts +3 -3
- package/dist/capabilities/storage-evictable.cap.d.ts +54 -0
- package/dist/capabilities/storage-evictable.cap.d.ts.map +1 -0
- package/dist/capabilities/storage-provider.cap.d.ts +31 -186
- package/dist/capabilities/storage-provider.cap.d.ts.map +1 -1
- package/dist/capabilities/storage.cap.d.ts +35 -226
- package/dist/capabilities/storage.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-broker.cap.d.ts +309 -25
- package/dist/capabilities/stream-broker.cap.d.ts.map +1 -1
- package/dist/capabilities/stream-catalog.cap.d.ts +85 -0
- package/dist/capabilities/stream-catalog.cap.d.ts.map +1 -0
- package/dist/capabilities/stream-params.cap.d.ts +27 -26
- package/dist/capabilities/stream-params.cap.d.ts.map +1 -1
- package/dist/capabilities/switch.cap.d.ts +1 -0
- package/dist/capabilities/switch.cap.d.ts.map +1 -1
- package/dist/capabilities/tamper.cap.d.ts +33 -0
- package/dist/capabilities/tamper.cap.d.ts.map +1 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts +51 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts.map +1 -0
- package/dist/capabilities/update.cap.d.ts +49 -0
- package/dist/capabilities/update.cap.d.ts.map +1 -0
- package/dist/capabilities/user-management.cap.d.ts +20 -20
- package/dist/capabilities/vacuum-control.cap.d.ts +229 -0
- package/dist/capabilities/vacuum-control.cap.d.ts.map +1 -0
- package/dist/capabilities/valve.cap.d.ts +93 -0
- package/dist/capabilities/valve.cap.d.ts.map +1 -0
- package/dist/capabilities/vibration.cap.d.ts +33 -0
- package/dist/capabilities/vibration.cap.d.ts.map +1 -0
- package/dist/capabilities/water-heater.cap.d.ts +78 -0
- package/dist/capabilities/water-heater.cap.d.ts.map +1 -0
- package/dist/capabilities/weather.cap.d.ts +76 -0
- package/dist/capabilities/weather.cap.d.ts.map +1 -0
- package/dist/capabilities/webrtc-session.cap.d.ts +128 -0
- package/dist/capabilities/webrtc-session.cap.d.ts.map +1 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/device/base-device-provider.d.ts +11 -0
- package/dist/device/base-device-provider.d.ts.map +1 -1
- package/dist/device/base-device.d.ts +52 -0
- package/dist/device/base-device.d.ts.map +1 -1
- package/dist/device/device-context.d.ts +29 -0
- package/dist/device/device-context.d.ts.map +1 -1
- package/dist/device/device-link-transform.d.ts +6 -0
- package/dist/device/device-link-transform.d.ts.map +1 -0
- package/dist/device/device-management.d.ts +116 -4
- package/dist/device/device-management.d.ts.map +1 -1
- package/dist/device/device-type.d.ts +214 -3
- package/dist/device/device-type.d.ts.map +1 -1
- package/dist/device/device.d.ts +25 -0
- package/dist/device/device.d.ts.map +1 -1
- package/dist/device/index.d.ts +5 -1
- package/dist/device/index.d.ts.map +1 -1
- package/dist/device/path-util.d.ts +13 -0
- package/dist/device/path-util.d.ts.map +1 -0
- package/dist/device/schema-fields.d.ts +12 -0
- package/dist/device/schema-fields.d.ts.map +1 -0
- package/dist/device/source-info.d.ts +87 -0
- package/dist/device/source-info.d.ts.map +1 -0
- package/dist/device/system-mirror.d.ts +6 -2
- package/dist/device/system-mirror.d.ts.map +1 -1
- package/dist/encode-profile.d.ts +126 -0
- package/dist/encode-profile.d.ts.map +1 -0
- package/dist/enums/event-category.d.ts +92 -7
- package/dist/enums/event-category.d.ts.map +1 -1
- package/dist/generated/addon-api.d.ts +12821 -8025
- package/dist/generated/addon-api.d.ts.map +1 -1
- package/dist/generated/cap-status-types.d.ts +87 -1
- package/dist/generated/cap-status-types.d.ts.map +1 -1
- package/dist/generated/capability-router-map.d.ts +142 -7
- package/dist/generated/capability-router-map.d.ts.map +1 -1
- package/dist/generated/device-local-state.d.ts +123 -0
- package/dist/generated/device-local-state.d.ts.map +1 -1
- package/dist/generated/device-proxy.d.ts +132 -5
- package/dist/generated/device-proxy.d.ts.map +1 -1
- package/dist/generated/method-access-map.d.ts +1 -1
- package/dist/generated/method-access-map.d.ts.map +1 -1
- package/dist/generated/provider-kind-map.d.ts +1 -1
- package/dist/generated/provider-kind-map.d.ts.map +1 -1
- package/dist/generated/system-proxy.d.ts +10 -8
- package/dist/generated/system-proxy.d.ts.map +1 -1
- package/dist/health/wiring-health.d.ts +136 -0
- package/dist/health/wiring-health.d.ts.map +1 -0
- package/dist/{index-CMM1Y9W6.js → index-BSA_TBea.js} +4774 -923
- package/dist/index-BSA_TBea.js.map +1 -0
- package/dist/{index-QRlzao1I.mjs → index-Bpj3ScIH.mjs} +5142 -1291
- package/dist/index-Bpj3ScIH.mjs.map +1 -0
- package/dist/index.d.ts +23 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1498 -119
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1806 -427
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/addon-data-plane.d.ts +76 -0
- package/dist/interfaces/addon-data-plane.d.ts.map +1 -0
- package/dist/interfaces/addon.d.ts +61 -1
- package/dist/interfaces/addon.d.ts.map +1 -1
- package/dist/interfaces/advanced-notifier.d.ts +4 -0
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -1
- package/dist/interfaces/capability.d.ts +59 -1
- package/dist/interfaces/capability.d.ts.map +1 -1
- package/dist/interfaces/config-ui.d.ts +70 -6
- package/dist/interfaces/config-ui.d.ts.map +1 -1
- package/dist/interfaces/device-capabilities/camera.d.ts +2 -1
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -1
- package/dist/interfaces/event-bus.d.ts +105 -4
- package/dist/interfaces/event-bus.d.ts.map +1 -1
- package/dist/interfaces/kernel-abstractions.d.ts +10 -1
- package/dist/interfaces/kernel-abstractions.d.ts.map +1 -1
- package/dist/interfaces/network-quality.d.ts +8 -0
- package/dist/interfaces/network-quality.d.ts.map +1 -1
- package/dist/interfaces/pipeline-executor-capability.d.ts +2 -2
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts +2 -1
- package/dist/interfaces/pipeline-orchestrator-capability.d.ts.map +1 -1
- package/dist/interfaces/pipeline-runner-capability.d.ts +7 -0
- package/dist/interfaces/pipeline-runner-capability.d.ts.map +1 -1
- package/dist/interfaces/recording-config.d.ts +91 -0
- package/dist/interfaces/recording-config.d.ts.map +1 -0
- package/dist/interfaces/rtp-egress.d.ts +2 -3
- package/dist/interfaces/rtp-egress.d.ts.map +1 -1
- package/dist/interfaces/storage-location-declaration.d.ts +34 -0
- package/dist/interfaces/storage-location-declaration.d.ts.map +1 -0
- package/dist/interfaces/storage-location.d.ts +18 -74
- package/dist/interfaces/storage-location.d.ts.map +1 -1
- package/dist/interfaces/storage.d.ts +15 -4
- package/dist/interfaces/storage.d.ts.map +1 -1
- package/dist/interfaces/stream-broker.d.ts +39 -4
- package/dist/interfaces/stream-broker.d.ts.map +1 -1
- package/dist/interfaces/timezones.d.ts +59 -0
- package/dist/interfaces/timezones.d.ts.map +1 -0
- package/dist/node.d.ts +3 -0
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +50 -8
- package/dist/node.js.map +1 -1
- package/dist/node.mjs +51 -9
- package/dist/node.mjs.map +1 -1
- package/dist/readiness/readiness-registry.d.ts.map +1 -1
- package/dist/schemas/auth-records.d.ts +4 -4
- package/dist/storage/filesystem-storage-provider.d.ts +2 -1
- package/dist/storage/filesystem-storage-provider.d.ts.map +1 -1
- package/dist/stream-selection.d.ts +85 -0
- package/dist/stream-selection.d.ts.map +1 -0
- package/dist/types/detection.d.ts +3 -3
- package/dist/types/io.d.ts +13 -1
- package/dist/types/io.d.ts.map +1 -1
- package/dist/util/location-match.d.ts +15 -0
- package/dist/util/location-match.d.ts.map +1 -0
- package/dist/utils/canonical-hash.d.ts +20 -0
- package/dist/utils/canonical-hash.d.ts.map +1 -0
- package/dist/utils/export-reconciler.d.ts +101 -0
- package/dist/utils/export-reconciler.d.ts.map +1 -0
- package/dist/utils/privacy-grid-raster.d.ts +48 -0
- package/dist/utils/privacy-grid-raster.d.ts.map +1 -0
- package/dist/utils/sleep.d.ts +36 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/capabilities/recording-engine.cap.d.ts +0 -477
- package/dist/capabilities/recording-engine.cap.d.ts.map +0 -1
- package/dist/index-CMM1Y9W6.js.map +0 -1
- package/dist/index-QRlzao1I.mjs.map +0 -1
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared stream-selection picker for export addons.
|
|
3
|
+
*
|
|
4
|
+
* Both `addon-export-alexa` and `addon-export-hap` resolve the
|
|
5
|
+
* operator's `streamPreference` setting against the broker's RTSP
|
|
6
|
+
* entries before dialling a camera. Each addon used to roll its own:
|
|
7
|
+
* Alexa had `pickPreferredRtspEntry` under `handlers/`, HAP had an
|
|
8
|
+
* inline `"prefer /mid, then /high, then first"` chain inside its
|
|
9
|
+
* camera-streams mapper. The chains drifted (Alexa honoured
|
|
10
|
+
* `streamPreference`, HAP didn't; only Alexa got the smart
|
|
11
|
+
* resolution-targeted auto-pick) and the cross-addon import rule
|
|
12
|
+
* blocks deduping in either direction.
|
|
13
|
+
*
|
|
14
|
+
* Lifting the picker into `@camstack/types` lets every exporter call
|
|
15
|
+
* the same code path with the consumer's target resolution baked into
|
|
16
|
+
* the call site — Alexa passes 1280×720, HomeKit passes 1920×1080,
|
|
17
|
+
* the picker handles the rest.
|
|
18
|
+
*
|
|
19
|
+
* Selection algorithm:
|
|
20
|
+
* - pref === '<profile>' → profile-keyed entries (from
|
|
21
|
+
* `getProfileRtspEntries`) match on `e.profile`;
|
|
22
|
+
* legacy raw entries match on the brokerId
|
|
23
|
+
* suffix (`brokerId` ENDS WITH `/${pref}`, shape
|
|
24
|
+
* `${deviceId}/${camStreamId}`). Addons store the
|
|
25
|
+
* bare profile/camStream id in their
|
|
26
|
+
* `ExportDeviceSettings.streamPreference`. Falls
|
|
27
|
+
* back to 'auto' when no enabled entry matches
|
|
28
|
+
* either way.
|
|
29
|
+
* - pref === 'auto' → when `targetResolution` is given, pick the
|
|
30
|
+
* entry whose source resolution is closest to
|
|
31
|
+
* it (prefer ≥ target so the consumer
|
|
32
|
+
* downscales instead of upscaling). Without a
|
|
33
|
+
* target, fall back to first-enabled. If no
|
|
34
|
+
* entry advertises a resolution at all
|
|
35
|
+
* (broker hasn't probed yet), also fall back
|
|
36
|
+
* to first-enabled so cold start still serves.
|
|
37
|
+
*
|
|
38
|
+
* Returns `null` when nothing is publishable — callers fold that into
|
|
39
|
+
* the consumer's "no stream" error (Alexa: STREAM_TYPE_UNSUPPORTED;
|
|
40
|
+
* HAP: a thrown error inside `startFfmpegForSession`).
|
|
41
|
+
*/
|
|
42
|
+
export interface RtspEntryLike {
|
|
43
|
+
readonly brokerId: string;
|
|
44
|
+
readonly url: string;
|
|
45
|
+
readonly mutedUrl: string;
|
|
46
|
+
readonly enabled: boolean;
|
|
47
|
+
readonly codec?: string;
|
|
48
|
+
readonly resolution?: {
|
|
49
|
+
readonly width: number;
|
|
50
|
+
readonly height: number;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Profile slot this entry serves, set by `getProfileRtspEntries`.
|
|
54
|
+
* When `pref` is a profile ('high'|'mid'|'low') the picker matches on
|
|
55
|
+
* this first, before the legacy brokerId-suffix match.
|
|
56
|
+
*/
|
|
57
|
+
readonly profile?: 'high' | 'mid' | 'low';
|
|
58
|
+
}
|
|
59
|
+
export interface PickedStream {
|
|
60
|
+
readonly brokerId: string;
|
|
61
|
+
readonly profileId: string;
|
|
62
|
+
readonly url: string;
|
|
63
|
+
readonly mutedUrl: string;
|
|
64
|
+
readonly enabled: boolean;
|
|
65
|
+
readonly codec?: string;
|
|
66
|
+
readonly resolution?: {
|
|
67
|
+
readonly width: number;
|
|
68
|
+
readonly height: number;
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
export interface PickPreferredOptions {
|
|
72
|
+
/**
|
|
73
|
+
* Consumer's target resolution (Alexa ≈ 1280×720, HomeKit ≈ 1920×1080).
|
|
74
|
+
* When set and `pref === 'auto'`, the picker chooses the entry whose
|
|
75
|
+
* source resolution is closest — prefer ≥ target (downscale ok at
|
|
76
|
+
* the consumer), among the rest pick the largest source still ≤
|
|
77
|
+
* target. When absent, 'auto' falls back to first-enabled.
|
|
78
|
+
*/
|
|
79
|
+
readonly targetResolution?: {
|
|
80
|
+
readonly width: number;
|
|
81
|
+
readonly height: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export declare function pickPreferredRtspEntry(entries: readonly RtspEntryLike[], pref: 'auto' | string, deviceId: number, options?: PickPreferredOptions): PickedStream | null;
|
|
85
|
+
//# sourceMappingURL=stream-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream-selection.d.ts","sourceRoot":"","sources":["../src/stream-selection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;IACzE;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAA;CAC1C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,UAAU,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1E;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAChF;AAED,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,SAAS,aAAa,EAAE,EACjC,IAAI,EAAE,MAAM,GAAG,MAAM,EACrB,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,oBAAyB,GACjC,YAAY,GAAG,IAAI,CA0CrB"}
|
|
@@ -200,9 +200,9 @@ export interface AudioDetection extends DetectionBase {
|
|
|
200
200
|
*
|
|
201
201
|
* Named `DetectionEntry` rather than `Detection` because the
|
|
202
202
|
* device-capabilities namespace already exports a different `Detection`
|
|
203
|
-
* interface for
|
|
204
|
-
*
|
|
205
|
-
*
|
|
203
|
+
* interface for object detectors. The two live in separate files but
|
|
204
|
+
* both are re-exported at the package root, so keeping names distinct
|
|
205
|
+
* avoids an import-level collision.
|
|
206
206
|
*/
|
|
207
207
|
export type DetectionEntry = ObjectDetection | AudioDetection;
|
|
208
208
|
/**
|
package/dist/types/io.d.ts
CHANGED
|
@@ -32,9 +32,21 @@ export interface FrameInput {
|
|
|
32
32
|
readonly height: number;
|
|
33
33
|
readonly timestamp: number;
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Wire-safe audio chunk passed to the audio-analyzer and detection-pipeline
|
|
37
|
+
* caps. `data` holds the raw f32le bytes (4 bytes per sample, little-endian
|
|
38
|
+
* IEEE 754 float). Using `Uint8Array` rather than `Float32Array` is required
|
|
39
|
+
* for correct UDS/MsgPack transport: `@msgpack/msgpack` serialises both as a
|
|
40
|
+
* binary blob, but deserialises it as `Uint8Array`. A `Float32Array` receiver
|
|
41
|
+
* would silently read each individual byte (0–255) as a sample, producing
|
|
42
|
+
* wildly wrong level measurements (~+43 dBFS instead of ≤ 0).
|
|
43
|
+
*
|
|
44
|
+
* To iterate samples as floats, reconstruct the view:
|
|
45
|
+
* `new Float32Array(chunk.data.buffer, chunk.data.byteOffset, chunk.data.byteLength / 4)`
|
|
46
|
+
*/
|
|
35
47
|
export interface AudioChunkInput {
|
|
36
48
|
readonly [key: string]: unknown;
|
|
37
|
-
readonly data:
|
|
49
|
+
readonly data: Uint8Array<ArrayBuffer>;
|
|
38
50
|
readonly sampleRate: number;
|
|
39
51
|
readonly channels: number;
|
|
40
52
|
readonly timestamp: number;
|
package/dist/types/io.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/types/io.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEpE,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAA;AAEpE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../../src/types/io.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEpE,uEAAuE;AACvE,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,CAAA;AAEpE,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,CAAA;IACtC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAC3B;AAMD;;;;;;;GAOG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,2CAA2C;IAC3C,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,0FAA0F;IAC1F,QAAQ,CAAC,cAAc,CAAC,EAAE;QACxB,QAAQ,CAAC,MAAM,EAAE,SAAS,wBAAwB,EAAE,CAAA;QACpD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAC7B,CAAA;IACD,sCAAsC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,kEAAkE;AAClE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAClC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure fuzzy matcher for adoption location import. Normalized
|
|
3
|
+
* case-insensitive Levenshtein similarity, used to reuse an existing
|
|
4
|
+
* CamStack location when an imported source location (e.g. an HA area) is
|
|
5
|
+
* close enough — otherwise the caller creates a new location.
|
|
6
|
+
*/
|
|
7
|
+
/** Similarity in [0,1]; 1 = identical (after trim + lowercase). */
|
|
8
|
+
export declare function locationSimilarity(a: string, b: string): number;
|
|
9
|
+
/**
|
|
10
|
+
* Returns the existing name with the highest similarity to `externalName`,
|
|
11
|
+
* provided it is at least `threshold`; otherwise `null` (caller should create
|
|
12
|
+
* a new location named `externalName`).
|
|
13
|
+
*/
|
|
14
|
+
export declare function bestLocationMatch(externalName: string, existing: readonly string[], threshold?: number): string | null;
|
|
15
|
+
//# sourceMappingURL=location-match.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location-match.d.ts","sourceRoot":"","sources":["../../src/util/location-match.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA6BH,mEAAmE;AACnE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAM/D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,SAAS,SAAM,GACd,MAAM,GAAG,IAAI,CAWf"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deterministic SHA-256 hash of an arbitrary serialisable value. The
|
|
3
|
+
* canonical form sorts object keys alphabetically at every depth so two
|
|
4
|
+
* structurally-equal inputs with different key insertion orders produce
|
|
5
|
+
* the same hash. Returns a 64-char lowercase hex digest.
|
|
6
|
+
*
|
|
7
|
+
* Used by export adapters (Alexa, HAP) to short-circuit re-discovery /
|
|
8
|
+
* accessory-rebuild work when the upstream shape is byte-identical to
|
|
9
|
+
* the last applied state — preventing user-visible "re-discovery"
|
|
10
|
+
* notifications on every addon-runner respawn. Each respawn re-fires
|
|
11
|
+
* `DeviceBindingsChanged` for every cap registration, which without
|
|
12
|
+
* this guard would propagate redundant pushes.
|
|
13
|
+
*
|
|
14
|
+
* Note: this is a SYMPTOMATIC fix layered on top of the binding-change
|
|
15
|
+
* subscription. The proper fix is a single "device ready" lifecycle
|
|
16
|
+
* barrier so exports react only when the full cap set has landed —
|
|
17
|
+
* tracked separately for post-HA-integration work.
|
|
18
|
+
*/
|
|
19
|
+
export declare function canonicalHash(value: unknown): string;
|
|
20
|
+
//# sourceMappingURL=canonical-hash.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical-hash.d.ts","sourceRoot":"","sources":["../../src/utils/canonical-hash.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAGpD"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure, stateless primitives shared by the camera export addons (Alexa, HAP)
|
|
3
|
+
* to advertise devices to external ecosystems without re-discovery storms.
|
|
4
|
+
*
|
|
5
|
+
* Spec: docs/superpowers/specs/2026-06-01-alexa-hap-export-reconciler-design.md
|
|
6
|
+
*
|
|
7
|
+
* Two functions, both pure (no I/O, no clock, no randomness, no event
|
|
8
|
+
* subscriptions) so they are exhaustively unit-testable in isolation:
|
|
9
|
+
*
|
|
10
|
+
* 1) `canonicalDeviceFingerprint(shape)` — a stable hash of the
|
|
11
|
+
* EXPORT-RELEVANT device shape (coarse type + the persisted
|
|
12
|
+
* `DeviceFeature` set). Order-independent and de-duplicated, so an
|
|
13
|
+
* unchanged device produces an identical fingerprint across restarts.
|
|
14
|
+
* Identity (`deviceId`) and volatile runtime values (online, battery%,
|
|
15
|
+
* name, location) are deliberately excluded.
|
|
16
|
+
*
|
|
17
|
+
* 2) `diffExportTargets(desired, lastAdvertised)` — a 3-way set diff keyed
|
|
18
|
+
* by `deviceId`: what to add, what to update (fingerprint changed), what
|
|
19
|
+
* to remove (no longer desired). Each exporter feeds its own persisted
|
|
20
|
+
* per-target sync state in and applies the resulting delta to its
|
|
21
|
+
* platform.
|
|
22
|
+
*
|
|
23
|
+
* The wiring — event subscription, boot scan, platform apply, persistence —
|
|
24
|
+
* stays in each exporter; only the fingerprint + diff are shared.
|
|
25
|
+
*/
|
|
26
|
+
/** The export-relevant projection of a device, fed into the fingerprint. */
|
|
27
|
+
export interface DeviceExportShape {
|
|
28
|
+
/** Numeric device id. Identity only — NOT part of the fingerprint. */
|
|
29
|
+
readonly deviceId: number;
|
|
30
|
+
/**
|
|
31
|
+
* Coarse driver classification (e.g. `'camera' | 'battery-camera' | 'nvr'`),
|
|
32
|
+
* sourced from the `feature-probe` slice's `deviceType`. Part of the shape:
|
|
33
|
+
* the same feature set on a different device class can map to a different
|
|
34
|
+
* export surface.
|
|
35
|
+
*/
|
|
36
|
+
readonly deviceType: string;
|
|
37
|
+
/**
|
|
38
|
+
* Export-relevant `DeviceFeature` values (e.g. `'pan-tilt-zoom'`,
|
|
39
|
+
* `'two-way-audio'`, `'doorbell-button'`, `'motion-trigger'`,
|
|
40
|
+
* `'battery-operated'`, `'ptz-autotrack'`). Sourced from the PERSISTED
|
|
41
|
+
* `PersistedDeviceMeta.features`, so it survives restart and is stable
|
|
42
|
+
* without a re-probe. Hashed order-independently + de-duplicated.
|
|
43
|
+
*/
|
|
44
|
+
readonly features: readonly string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Compute the stable 64-char lowercase-hex fingerprint of a device's
|
|
48
|
+
* export-relevant shape. Two structurally-equal shapes (any feature order,
|
|
49
|
+
* any duplicates, any deviceId) hash identically.
|
|
50
|
+
*/
|
|
51
|
+
export declare function canonicalDeviceFingerprint(shape: DeviceExportShape): string;
|
|
52
|
+
/** Per-export-target sync state for one device, persisted addon-side. */
|
|
53
|
+
export interface ExportTargetEntry {
|
|
54
|
+
/** Fingerprint last advertised to this target for this device. */
|
|
55
|
+
readonly fingerprint: string;
|
|
56
|
+
/**
|
|
57
|
+
* Platform-specific external ids (Alexa endpoint ids, HAP accessory UUIDs).
|
|
58
|
+
* Opaque to the diff — carried so the exporter can address what to update or
|
|
59
|
+
* delete on its platform.
|
|
60
|
+
*/
|
|
61
|
+
readonly externalIds: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
/** The 3-way delta produced by `diffExportTargets`. */
|
|
64
|
+
export interface ExportDelta<T> {
|
|
65
|
+
/** Desired devices with no last-advertised entry — publish fresh. */
|
|
66
|
+
readonly toAdd: readonly T[];
|
|
67
|
+
/** Desired devices whose fingerprint differs from last-advertised — re-advertise. */
|
|
68
|
+
readonly toUpdate: readonly T[];
|
|
69
|
+
/** `deviceId`s present in last-advertised but absent from desired — retract. */
|
|
70
|
+
readonly toRemove: readonly number[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Pure 3-way diff of desired export state against the persisted
|
|
74
|
+
* last-advertised state, keyed by `deviceId`.
|
|
75
|
+
*
|
|
76
|
+
* - `desired` — one entry per device to advertise this cycle, each carrying
|
|
77
|
+
* the freshly-computed `fingerprint`.
|
|
78
|
+
* - `lastAdvertised` — the exporter's persisted per-target sync state.
|
|
79
|
+
*
|
|
80
|
+
* Neither input is mutated.
|
|
81
|
+
*/
|
|
82
|
+
export declare function diffExportTargets<T extends {
|
|
83
|
+
deviceId: number;
|
|
84
|
+
fingerprint: string;
|
|
85
|
+
}>(desired: readonly T[], lastAdvertised: ReadonlyMap<number, ExportTargetEntry>): ExportDelta<T>;
|
|
86
|
+
/**
|
|
87
|
+
* Resolve the fingerprint an exporter should feed into `diffExportTargets`
|
|
88
|
+
* for one device this cycle.
|
|
89
|
+
*
|
|
90
|
+
* When a device is NOT yet probe-ready, carry forward its last-advertised
|
|
91
|
+
* (persisted) fingerprint so it nets to NO CHANGE in `diffExportTargets`
|
|
92
|
+
* (neither update nor remove) — never advertise a partial mid-probe shape. A
|
|
93
|
+
* brand-new un-probed device with no persisted entry falls back to `fresh` so
|
|
94
|
+
* it can advertise once.
|
|
95
|
+
*/
|
|
96
|
+
export declare function resolveExportFingerprint(input: {
|
|
97
|
+
ready: boolean;
|
|
98
|
+
fresh: string;
|
|
99
|
+
persisted: string | undefined;
|
|
100
|
+
}): string;
|
|
101
|
+
//# sourceMappingURL=export-reconciler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export-reconciler.d.ts","sourceRoot":"","sources":["../../src/utils/export-reconciler.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,4EAA4E;AAC5E,MAAM,WAAW,iBAAiB;IAChC,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;;;OAMG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CAG3E;AAED,yEAAyE;AACzE,MAAM,WAAW,iBAAiB;IAChC,kEAAkE;IAClE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAA;CACxC;AAED,uDAAuD;AACvD,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,qEAAqE;IACrE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,EAAE,CAAA;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,EAAE,CAAA;IAC/B,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAA;CACrC;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,EACnF,OAAO,EAAE,SAAS,CAAC,EAAE,EACrB,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,iBAAiB,CAAC,GACrD,WAAW,CAAC,CAAC,CAAC,CAsBhB;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE;IAC9C,KAAK,EAAE,OAAO,CAAA;IACd,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,GAAG,MAAM,CAGT"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Privacy-mask rect ↔ cell rasterizer.
|
|
3
|
+
*
|
|
4
|
+
* Converts between a list of normalized axis-aligned rectangles
|
|
5
|
+
* (the native camera representation) and a row-major boolean cell grid
|
|
6
|
+
* (the cap model). All coordinates are in [0, 1] normalized space
|
|
7
|
+
* where (0, 0) is top-left.
|
|
8
|
+
*
|
|
9
|
+
* These utilities are pure functions with no side effects — safe to use
|
|
10
|
+
* in any addon without cross-process concerns.
|
|
11
|
+
*/
|
|
12
|
+
/** Normalized axis-aligned rect: origin (x, y), size (w, h). All values in [0, 1]. */
|
|
13
|
+
export interface NormRect {
|
|
14
|
+
readonly x: number;
|
|
15
|
+
readonly y: number;
|
|
16
|
+
readonly w: number;
|
|
17
|
+
readonly h: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Rasterize a list of normalized rects into a row-major boolean cell grid.
|
|
21
|
+
*
|
|
22
|
+
* Each cell at grid position (col, row) has its centre at:
|
|
23
|
+
* cx = (col + 0.5) / gridWidth
|
|
24
|
+
* cy = (row + 0.5) / gridHeight
|
|
25
|
+
*
|
|
26
|
+
* A cell is `true` when its centre falls inside any rect (closed interval
|
|
27
|
+
* on all four edges so single-pixel-wide rects always activate the cell
|
|
28
|
+
* whose centre is nearest the edge).
|
|
29
|
+
*
|
|
30
|
+
* Returns an array of length `gridWidth * gridHeight` in row-major order.
|
|
31
|
+
* Returns all-false when `rects` is empty or grid dimensions are ≤ 0.
|
|
32
|
+
*/
|
|
33
|
+
export declare function rectsToCells(rects: readonly NormRect[], gridWidth: number, gridHeight: number): boolean[];
|
|
34
|
+
/**
|
|
35
|
+
* Convert a row-major boolean cell grid back into normalized rects, capped at
|
|
36
|
+
* `maxRegions`.
|
|
37
|
+
*
|
|
38
|
+
* The algorithm performs a greedy maximal-rectangle cover:
|
|
39
|
+
* 1. Scans row by row to identify horizontal runs of `true` cells.
|
|
40
|
+
* 2. Merges vertically adjacent runs with the same column span.
|
|
41
|
+
* 3. Returns each resulting block as a normalized `NormRect`.
|
|
42
|
+
* 4. When more than `maxRegions` blocks result, keeps the `maxRegions`
|
|
43
|
+
* largest (by cell area).
|
|
44
|
+
*
|
|
45
|
+
* Returns an empty array for an empty grid or all-false cells.
|
|
46
|
+
*/
|
|
47
|
+
export declare function cellsToRects(cells: readonly boolean[], gridWidth: number, gridHeight: number, maxRegions: number): NormRect[];
|
|
48
|
+
//# sourceMappingURL=privacy-grid-raster.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy-grid-raster.d.ts","sourceRoot":"","sources":["../../src/utils/privacy-grid-raster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,sFAAsF;AACtF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,QAAQ,EAAE,EAC1B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,EAAE,CA2BX;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,OAAO,EAAE,EACzB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,GACjB,QAAQ,EAAE,CAsFZ"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
3
|
+
* wait, back off, or schedule a retry. Before these helpers landed, each
|
|
4
|
+
* call site re-implemented `new Promise(r => setTimeout(r, ms))` inline,
|
|
5
|
+
* with subtle variations (some swallowing cancellation, some not). Two
|
|
6
|
+
* shapes cover every observed use case:
|
|
7
|
+
*
|
|
8
|
+
* - {@link sleep} for a plain, uncancellable wait — the default choice.
|
|
9
|
+
* - {@link sleepCancellable} for a wait that wakes early when an
|
|
10
|
+
* abort signal trips, used by long-running pollers whose teardown
|
|
11
|
+
* must stop a pending backoff promptly.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Resolve after `ms` milliseconds. Never rejects, never cancels. The
|
|
15
|
+
* sleep cannot be interrupted; for a wakeable variant use
|
|
16
|
+
* {@link sleepCancellable}.
|
|
17
|
+
*
|
|
18
|
+
* `ms <= 0` resolves on the next microtask via `setTimeout(0)`, which
|
|
19
|
+
* still gives the event loop a chance to drain — useful for breaking
|
|
20
|
+
* up tight async loops without changing call-site semantics.
|
|
21
|
+
*/
|
|
22
|
+
export declare function sleep(ms: number): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Resolve after `ms` milliseconds OR when `signal.aborted` flips,
|
|
25
|
+
* whichever fires first. The returned promise never rejects — aborted
|
|
26
|
+
* sleeps resolve normally so callers can model "wait or wake" without
|
|
27
|
+
* try/catch noise.
|
|
28
|
+
*
|
|
29
|
+
* await sleepCancellable(backoffMs, lifecycle.abortSignal)
|
|
30
|
+
* if (lifecycle.aborted) return
|
|
31
|
+
*
|
|
32
|
+
* If `signal` is already aborted at call time the helper resolves on
|
|
33
|
+
* the next microtask.
|
|
34
|
+
*/
|
|
35
|
+
export declare function sleepCancellable(ms: number, signal: AbortSignal): Promise<void>;
|
|
36
|
+
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../../src/utils/sleep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH;;;;;;;;GAQG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAc/E"}
|